@sekyro/elements 0.1.0-rc.17 → 0.1.0-rc.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +9 -0
- package/dist/cdn/chunks/{capture-session-doc-MGDYUASI-LYQ23KS6.js → capture-session-doc-J4MIDQOS-DYA3TI2D.js} +1 -1
- package/dist/cdn/chunks/{chunk-QR7XWTXK.js → chunk-3XCA56FW.js} +1 -1
- package/dist/cdn/chunks/{chunk-SI6GIBVC.js → chunk-4QPD5ZMB.js} +1 -1
- package/dist/cdn/chunks/{chunk-PRMQUJTM.js → chunk-62FWEZDF.js} +1 -1
- package/dist/cdn/chunks/{chunk-3DAULGZ2.js → chunk-C5LJ5ZHE.js} +1 -1
- package/dist/cdn/chunks/chunk-CH3JN7FV.js +1 -0
- package/dist/cdn/chunks/{chunk-BR5RW4XZ.js → chunk-ECAWI75T.js} +1 -1
- package/dist/cdn/chunks/{chunk-3APQX7OW.js → chunk-EHIN4Z6H.js} +1 -1
- package/dist/cdn/chunks/{chunk-3S7YMUPU.js → chunk-F4Q2Q4OC.js} +1 -1
- package/dist/cdn/chunks/{chunk-IGZCP7OY.js → chunk-IWZRAEUN.js} +1 -1
- package/dist/cdn/chunks/{chunk-Z5QOJL3W.js → chunk-KOTLQOUY.js} +1 -1
- package/dist/cdn/chunks/{chunk-HM65LKWB.js → chunk-MK5WGJZO.js} +1 -1
- package/dist/cdn/chunks/{chunk-NPTVQXUW.js → chunk-NPEJKEWK.js} +1 -1
- package/dist/cdn/chunks/chunk-PP4PZVFR.js +3 -0
- package/dist/cdn/chunks/chunk-QWBHA4YX.js +33 -0
- package/dist/cdn/chunks/{chunk-DCTDTKG7.js → chunk-SYZUFSPK.js} +1 -1
- package/dist/cdn/chunks/{chunk-RPMVDYDV.js → chunk-TODKCK6A.js} +1 -1
- package/dist/cdn/chunks/{chunk-DHMC5D6M.js → chunk-UE6IZTZA.js} +1 -1
- package/dist/cdn/chunks/{chunk-Z6KNLRUW.js → chunk-VYFRJNC5.js} +1 -1
- package/dist/cdn/chunks/{chunk-2MJOW3FG.js → chunk-WVDCPIC3.js} +1 -1
- package/dist/cdn/chunks/{chunk-E5YZMFCZ.js → chunk-WZFFQZE2.js} +1 -1
- package/dist/cdn/chunks/{chunk-6TIQ2463.js → chunk-Y6VKSYVY.js} +1 -1
- package/dist/cdn/chunks/{chunk-6L4TYBV7.js → chunk-YZE7YZVV.js} +1 -1
- package/dist/cdn/chunks/{chunk-E5JQU363.js → chunk-ZF7TAXXU.js} +1 -1
- package/dist/cdn/chunks/{create-document-capture-KISF6XD3-R6PFAJU6.js → create-document-capture-SMEKDBGF-DISVYLXM.js} +1 -1
- package/dist/cdn/chunks/{detector-scanic-JC25DD3A-YZ3NPKMQ.js → detector-scanic-P2RTEQUV-A5WTP2Q7.js} +1 -1
- package/dist/cdn/chunks/document-capture-view-TV2VKLPV-6ZFRPTO3.js +1 -0
- package/dist/cdn/chunks/{eid-view-ZM7QAEME-DIL3UVBB.js → eid-view-VC3DHQWV-IBAI3YPF.js} +1 -1
- package/dist/cdn/chunks/{email-otp-view-EYS26ZZM-UNGUBHFI.js → email-otp-view-QCELBL7U-XSYVFDW7.js} +1 -1
- package/dist/cdn/chunks/flow-views-VCE6CEBN-Y6VVTJPN.js +1 -0
- package/dist/cdn/chunks/{form-view-Y5KA6R5T-KUDCNJNS.js → form-view-P2GVOYAC-ZWBQXCK3.js} +1 -1
- package/dist/cdn/chunks/overlay-de-EMTSLK3M-LA7EI7SW.js +1 -0
- package/dist/cdn/chunks/overlay-es-6WMAHH33-66DPI2L6.js +1 -0
- package/dist/cdn/chunks/overlay-pt-WBGMJQTQ-IOBB3HFB.js +1 -0
- package/dist/cdn/chunks/plan-runner-ZVYJ3UI3-PDRZPFOE.js +1 -0
- package/dist/cdn/chunks/{portrait-capture-view-E5LKQQ5Y-3HNPCMBJ.js → portrait-capture-view-QYEEV2D6-XMKA6YZR.js} +1 -1
- package/dist/cdn/chunks/{portrait-review-view-NJHH2E4W-B3RFT2PG.js → portrait-review-view-E3SBOU4F-QVDIDUCS.js} +1 -1
- package/dist/cdn/chunks/{proof-of-address-view-LS3JZUTD-MDTXER25.js → proof-of-address-view-NIAKWB6B-43ZQX5T6.js} +1 -1
- package/dist/cdn/define.js +1 -1
- package/dist/cdn/index.js +1 -1
- package/dist/{chunk-MWTOWGEI.js → chunk-46JFMIK7.js} +1 -1
- package/dist/{chunk-6NNMOFMF.js → chunk-5S5OC2EE.js} +1 -1
- package/dist/{chunk-WLCS5VAA.js → chunk-77AEILD6.js} +1 -1
- package/dist/chunk-BMRETLHG.js +33 -0
- package/dist/chunk-C3WB5BAA.js +1 -0
- package/dist/{chunk-5NSMKCTW.js → chunk-ELSYMAAW.js} +1 -1
- package/dist/{chunk-734Y6RUV.js → chunk-ENXYUW3S.js} +1 -1
- package/dist/{chunk-VJZANYM3.js → chunk-FKGVTX2Y.js} +1 -1
- package/dist/{chunk-D3TZZ4SI.js → chunk-IBMR3ZXU.js} +1 -1
- package/dist/{chunk-2WYXQYNY.js → chunk-JKDI3DQD.js} +1 -1
- package/dist/{chunk-ICJ544T4.js → chunk-N5JOXWJJ.js} +1 -1
- package/dist/{chunk-AJHRPKD4.js → chunk-SBLFJ2MR.js} +1 -1
- package/dist/{chunk-YVGOUZ7T.js → chunk-VFLMBXU5.js} +1 -1
- package/dist/{chunk-ZUFN5VIE.js → chunk-X2RZOTUB.js} +1 -1
- package/dist/define.cjs +5 -5
- package/dist/define.js +1 -1
- package/dist/document-capture-view-TV2VKLPV-7EOLXSFW.js +1 -0
- package/dist/{eid-view-ZM7QAEME-7FRC3TV6.js → eid-view-VC3DHQWV-IB3JCWRI.js} +1 -1
- package/dist/{email-otp-view-EYS26ZZM-EESWRHKM.js → email-otp-view-QCELBL7U-K6OU6CWG.js} +1 -1
- package/dist/flow-views-VCE6CEBN-EYXMVPZI.js +1 -0
- package/dist/{form-view-Y5KA6R5T-DOZFYGBK.js → form-view-P2GVOYAC-R5HGNTAJ.js} +1 -1
- package/dist/index.cjs +5 -5
- package/dist/index.d.cts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -1
- package/dist/overlay-de-EMTSLK3M-KNNEJ2DR.js +1 -0
- package/dist/overlay-es-6WMAHH33-YZN2JC7A.js +1 -0
- package/dist/overlay-pt-WBGMJQTQ-Y6AG6QUZ.js +1 -0
- package/dist/{portrait-capture-view-E5LKQQ5Y-E3BRULLL.js → portrait-capture-view-QYEEV2D6-OD3VHIKE.js} +1 -1
- package/dist/{portrait-review-view-NJHH2E4W-CKMVD7ME.js → portrait-review-view-E3SBOU4F-DJAWJV6V.js} +1 -1
- package/dist/{proof-of-address-view-LS3JZUTD-ZQ4BDFNP.js → proof-of-address-view-NIAKWB6B-4ZP6SD46.js} +1 -1
- package/package.json +2 -2
- package/sbom.cdx.json +4 -4
- package/dist/cdn/chunks/chunk-4RGDPCRE.js +0 -33
- package/dist/cdn/chunks/chunk-BDRBGJA3.js +0 -3
- package/dist/cdn/chunks/chunk-Q7ACZDU4.js +0 -1
- package/dist/cdn/chunks/document-capture-view-7ZSM7YTT-UHYBVOQI.js +0 -1
- package/dist/cdn/chunks/flow-views-7SAYQQ62-2TENAJ6C.js +0 -1
- package/dist/cdn/chunks/overlay-de-4OISTBDL-WWT74VG7.js +0 -1
- package/dist/cdn/chunks/overlay-es-YO5UCAO2-U3OAELIS.js +0 -1
- package/dist/cdn/chunks/overlay-pt-E7PSFLLQ-ZPN4CLS4.js +0 -1
- package/dist/cdn/chunks/plan-runner-NWK4LZFI-CDXUYVEW.js +0 -1
- package/dist/chunk-2EMXU2MG.js +0 -33
- package/dist/chunk-XI37ATRU.js +0 -1
- package/dist/document-capture-view-7ZSM7YTT-GLHWVI3B.js +0 -1
- package/dist/flow-views-7SAYQQ62-3NIWXTDB.js +0 -1
- package/dist/overlay-de-4OISTBDL-TH46LT3S.js +0 -1
- package/dist/overlay-es-YO5UCAO2-NBICE576.js +0 -1
- package/dist/overlay-pt-E7PSFLLQ-NCA5NABT.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as hr,d as fr}from"./chunk-5NSMKCTW.js";import{b as kr,c as bt}from"./chunk-MWTOWGEI.js";import{a as br}from"./chunk-YZ6YGLNN.js";import{c as Ct}from"./chunk-XI37ATRU.js";import{a as ur,b as dr,c as pr,d as Ae}from"./chunk-2WYXQYNY.js";import{F as yr,K as gr,L as vr,a as K,b as de,c as te,m as lr,n as Xe,p as or,q as et,r as ir,s as cr,t as kt,u as le,v as Le,w as tt,y as mr}from"./chunk-AJHRPKD4.js";import{a as l,c as U,i as s}from"./chunk-SSU37LFQ.js";var _r=U(K(),1),y=U(de(),1),re=U(de(),1),ye=U(K(),1),D=U(de(),1),C=U(K(),1),m=U(K(),1),at=U(K(),1),fe=U(de(),1),Gr=U(K(),1),Q=U(K(),1),ot=U(K(),1),we=U(de(),1),Se=U(de(),1),B=U(de(),1),it=U(K(),1),pe=U(K(),1),J=U(K(),1),L=U(K(),1),me=U(K(),1),Te=U(K(),1),Rt=U(de(),1),v=U(de(),1);import{subscribeCameraPermission as jn}from"@sekyro/web";import{getLivenessAssetsStatus as Tn,preloadLivenessAssets as Pn,subscribeLivenessAssets as Bn}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function ie({className:e,children:t}){return(0,y.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}l(ie,"ne");s(ie,"Svg");var Mt="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 wr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,y.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}l(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,y.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,y.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Nr,"pn");s(Nr,"LookStraightIcon");function Rr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Rr,"fn");s(Rr,"CameraCheckIcon");function Mr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}l(Mr,"mn");s(Mr,"CameraAskIcon");function Ar(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M3 3l18 18"})]})}l(Ar,"yn");s(Ar,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,y.jsxs)(ie,{className:t,children:[(0,y.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,y.jsx)("path",{d:"M4 4l16 16"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,y.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(nt,"Ve");s(nt,"SpeakerIcon");function Lr(e){return(0,y.jsx)(ie,{...e,children:(0,y.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Lr,"gn");s(Lr,"CheckIcon");function Er(e){return(0,y.jsxs)(ie,{className:e.className??"sekyro-spinner",children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,y.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Er,"hn");s(Er,"SpinnerIcon");var _t=["light","uncover","eyeLevel","straight"],xn={light:{key:"capture.tips.light",icon:s(()=>(0,re.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,re.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,re.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,re.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Ae(),n=(0,_r.useId)();return e.length===0?null:(0,re.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,re.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,re.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?xn[r]:void 0,o=typeof r=="string"?r:r.id,c=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,d=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,re.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,re.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,re.jsx)("span",{children:d})]},o)})})]})}l(Ir,"Cn");s(Ir,"TipList");var Nn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:c,look:d="cards",marked:S,onChoose:p}){let w=(0,ye.useId)(),N=kt(),[j,R]=(0,ye.useState)(null),O=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&R(null)},[a]),(0,ye.useEffect)(()=>()=>{O.current!==null&&clearTimeout(O.current)},[]);let q=s(M=>{r||j!==null||(R(M),O.current=setTimeout(()=>{O.current=null,R(null),p(M)},Nn))},"choose");return(0,D.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":c,children:[(0,D.jsxs)("div",{className:d==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,D.jsx)("h2",{id:w,ref:o?N:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,D.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,D.jsx)(le,{tone:"danger",children:(0,D.jsx)("span",{children:a})}):null,d==="buttons"?(0,D.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((M,X)=>(0,D.jsx)(te,{kind:X===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>p(M.id),"onClick"),children:M.label},M.id))}):(0,D.jsx)("div",{className:"sekyro-choices",children:n.map(M=>(0,D.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(j??S)===M.id,"aria-busy":r||void 0,disabled:r||j!==null&&j!==M.id,onClick:l(()=>q(M.id),"onClick"),children:[M.glyph!==void 0?(0,D.jsx)("span",{className:"sekyro-card__tile",children:M.glyph}):null,(0,D.jsxs)("span",{className:"sekyro-card__body",children:[(0,D.jsx)("span",{className:"sekyro-card__title",children:M.label}),M.sub!==void 0?(0,D.jsx)("span",{className:"sekyro-card__sub",children:M.sub}):null]}),(0,D.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},M.id))})]})}l(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}l(st,"he");s(st,"isVoiceKey");var Rn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Rn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"Me");s(je,"resolveClip");var Mn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",An={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function oe(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(oe,"re");s(oe,"synth");function Tr(){return oe()!==null&&typeof SpeechSynthesisUtterance=="function"}l(Tr,"Lr");s(Tr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(wt,"Sn");s(wt,"baseLang");function At(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}l(At,"Mn");s(At,"pickVoice");function Pr(e){if(!Tr())return!1;let t=[];try{t=oe()?.getVoices()??[]}catch{return!0}return t.length===0||At(t,e)!==void 0}l(Pr,"wn");s(Pr,"speechUsable");function Br(e){let t=oe();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Br,"Ln");s(Br,"subscribeVoices");function $e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}l($e,"Ke");s($e,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}l(St,"Rn");s(St,"release");function Or(){let e=null,t=null,n=0,r=null,a=null,o=null,c=!1,d=null,S=[],p=new Map,w=s(()=>{S=oe()?.getVoices()??[]},"loadVoices"),N=!1,j=s(()=>{let h=oe();N||h===null||(N=!0,w(),h.addEventListener?.("voiceschanged",w))},"bindVoices"),R=s(()=>(e??(e=new Audio),e),"element"),O=s((h,x,_,k)=>{let u=oe();if(u!==null&&h!==""&&typeof SpeechSynthesisUtterance=="function"){j();let A=At(S,x);if(S.length===0||A!==void 0){u.cancel();let I=new SpeechSynthesisUtterance(h);I.lang=x,A!==void 0&&(I.voice=A),I.rate=.95,_!==void 0&&(I.onend=_),(_!==void 0||k!==void 0)&&(I.onerror=$=>{k!==void 0&&$.error==="not-allowed"?k():_?.()}),u.speak(I);return}}_?.()},"speak"),q=s(()=>{n+=1,r=null,a=o=null,e!==null&&(e.pause(),e.currentTime=0),oe()?.cancel()},"stop"),M=s(h=>{for(let x of h){let _=$e(x);if(p.has(_))continue;let k=new Audio;k.preload="auto",k.src=x,p.set(_,k)}},"warmClips"),X=s((h,x,_)=>{let k={utterance:h,generation:x,end:_};d=k;let u=s(()=>x===n&&d===k,"live"),A=s(()=>{u()&&(a=k)},"block");if(oe()?.cancel(),h.url!==null){let I=R();I.pause(),I.muted=!1,I.src=h.url,I.currentTime=0,I.onended=_??null;let $=s(()=>{o===k&&(o=null)},"settled"),i=I.play();if(i===void 0)return;o=k,i.then($,T=>{if($(),!u())return;let P=T?.name;if(P!=="AbortError"){if(P==="NotAllowedError")return A();h.speech?O(h.text,h.lang,_,A):_?.()}});return}h.speech?O(h.text,h.lang,_,A):_?.()},"start");return{say(h){let x=h.url!==null?$e(h.url):`tts:${h.lang}:${h.text}`;if(x===r)return;r=x,a=o=null,n+=1;let _=n,k=h.onEnd;X(h,_,k!==void 0?()=>{_===n&&k()}:void 0)},unlock({lang:h,speech:x,prefetch:_}){let k=a??(c?null:o);c=!0;let u=k!==null&&k.generation===n?k:null;a=o=null,u!==null&&X(u.utterance,u.generation,u.end);let A=R();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let T=Uint8Array.from(atob(Mn),P=>P.charCodeAt(0));t=URL.createObjectURL(new Blob([T],{type:"audio/wav"}))}let I=A.paused===!1&&t!==null&&A.src!==t;t!==null&&!I&&(u===null||u.utterance.url===null)&&(A.muted=!0,A.onended=null,A.src=t,A.play()?.catch(()=>{}));let $=oe(),i=u!==null&&u.utterance.url===null;if(x&&!i&&$!==null&&typeof SpeechSynthesisUtterance=="function"){j();let T=new SpeechSynthesisUtterance(" ");T.volume=0,T.lang=h,$.speak(T)}M(_??[])},prefetch:M,stop:q,dispose(){q(),N&&oe()?.removeEventListener?.("voiceschanged",w),N=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let h of p.values())St(h);p.clear()}}}l(Or,"_n");s(Or,"createVoicePlayer");var Ln="sekyro.voiceGuidance";function qr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}l(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",En=typeof window<"u"?C.useLayoutEffect:C.useEffect,In=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let o=a===Ve?null:je(e,a,t);o===null||n.has($e(o))||(n.add($e(o)),r.push(o))}return r}l(rt,"ht");s(rt,"resolvedClipUrls");function $r({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?Ln:a.storageKey,[c,d]=(0,C.useState)(a.defaultEnabled??!0),S=(0,C.useRef)(c),[p,w]=(0,C.useState)(!1),[N,j]=(0,C.useState)("none"),[R,O]=(0,C.useState)(!1),q=(0,C.useRef)(!1),[M,X]=(0,C.useState)(0),h=(0,C.useRef)(null),x=(0,C.useCallback)(()=>(h.current??(h.current=Or()),h.current),[]),_=An[e],k=a.speechFallback,u=k===void 0||k===!0?!0:k===!1?!1:k.includes(e),A=a.clips??t??In,I=(0,C.useRef)(!1),$=(0,C.useRef)(A);En(()=>{$.current=A,S.current=c}),(0,C.useEffect)(()=>{if(r||o===null)return;let E=qr(o);E!==null&&(S.current=E,d(E))},[r,o]),(0,C.useEffect)(()=>{if(!(r||!u))return Br(()=>X(E=>E+1))},[r,u]);let i=a.clips;(0,C.useEffect)(()=>{if(r)return;let E=u&&Pr(_);w(rt(A,e).length>0||E),j(i!==void 0&&je(i,Ve,e)!==null?"partner":je(A,Ve,e)!==null||E?"default":"none")},[r,A,i,e,u,_,M]),(0,C.useEffect)(()=>{if(r||!c||!I.current)return;let E=rt(A,e);E.length>0&&x().prefetch(E)},[r,c,A,e,x]),(0,C.useEffect)(()=>()=>{h.current?.dispose(),h.current=null,I.current=!1},[]);let T=(0,C.useCallback)(E=>{r||(I.current=!0,x().unlock({lang:_,speech:u,...E?{prefetch:rt($.current,e)}:{}}))},[r,x,_,u,e]),P=(0,C.useCallback)(()=>T(S.current),[T]),z=(0,C.useCallback)(()=>{q.current=!1,O(!1)},[]),F=(0,C.useCallback)(()=>{z(),h.current?.stop()},[z]),ge=(0,C.useCallback)(()=>{q.current&&F()},[F]),he=(0,C.useCallback)((E,xe)=>{if(r)return;if(q.current){F();return}let ve=x();ve.stop(),q.current=!0,O(!0);let V=xe?.clip===!1?null:je($.current,Ve,e);ve.say({url:V,text:E,lang:_,speech:u,onEnd:z})},[r,F,x,e,_,u,z]),Y=(0,C.useCallback)(E=>{r||(E?T(!0):F(),o!==null&&Vr(o,E),S.current=E,d(E))},[r,T,F,o]),W=(0,C.useCallback)(()=>Y(!S.current),[Y]),ne=(0,C.useCallback)((E,xe)=>{if(r||!c)return;q.current&&z();let ve=je($.current,E,e);x().say({url:ve,text:xe,lang:_,speech:u})},[r,c,e,x,_,u,z]);return(0,C.useMemo)(()=>({supported:!r&&p,enabled:!r&&c,setEnabled:Y,toggle:W,unlock:P,speakKey:ne,stop:F,summary:r?"none":N,summaryPlaying:R,toggleSummary:he,stopSummary:ge}),[r,p,c,Y,W,P,ne,F,N,R,he,ge])}l($r,"vt");s($r,"useVoiceGuidance");function Fr(e,t,n,r){let{speakKey:a,stop:o,enabled:c}=e,d=(0,C.useRef)(!1);(0,C.useEffect)(()=>{if(!r||!c){d.current&&o(),d.current=!1;return}d.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,c,t,n,a,o])}l(Fr,"Ct");s(Fr,"useSpeakGuidance");function lt(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}l(lt,"Pn");s(lt,"retryCoachingOf");var Fe={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Dr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Ae(),c=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(Fe[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:Fe[t].tips.map(d=>(0,fe.jsx)("li",{children:o(d)},d))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(te,{ref:c,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}l(Dr,"Tn");s(Dr,"CapturedPanel");function Lt(){try{return!1}catch{return!1}}l(Lt,"nt");s(Lt,"isDevBuild");var Un=(0,Gr.createContext)(null);function Hr({state:e}){let t=Ae(),[n,r]=(0,ot.useState)(!1);(0,ot.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Rr,{}):e==="denied"?(0,we.jsx)(Ar,{}):(0,we.jsx)(Mr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(Hr,"On");s(Hr,"PermissionRow");function Kr({voice:e}){let t=Ae();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Lr,{className:"sekyro-switch__check"}):null})})]})}l(Kr,"Hn");s(Kr,"VoiceSwitch");function Zr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:c,startLabel:d,startDisabled:S,onStart:p}){let w=Ae(),N=(0,Q.useRef)(c?.stop);N.current=c?.stop,(0,Q.useEffect)(()=>()=>N.current?.(),[]);let j=(0,Q.useRef)(null),R=(0,Q.useRef)(null),O=(0,Q.useRef)(null),q=(0,Q.useRef)(e),M=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{let u=q.current;if(q.current=e,u===e)return;let A=M.current;e!=="loading"&&(M.current=!1),zr(j.current)&&(e==="failed"?O.current?.focus():A&&R.current?.focus())},[e]);let X=(0,Q.useCallback)(()=>{M.current=!0,t()},[t]),h=e==="loading",x=h||S,_=(0,Q.useCallback)(()=>{x||(N.current?.(),p())},[x,p]),k;return e==="failed"?k=(0,B.jsxs)(le,{tone:"danger",testId:"sekyro-assets-error",children:[(0,B.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,B.jsx)(te,{kind:"ghost",ref:O,className:"sekyro-btn--start",onClick:X,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):k=(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,B.jsx)(te,{ref:R,full:!0,"data-testid":"sekyro-start","aria-disabled":x?"true":void 0,"aria-busy":h?"true":void 0,onClick:_,children:h?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Er,{}),w("capture.preparing.title")]}):d??w("capture.start")}),h?(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,B.jsxs)("div",{ref:j,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,B.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,B.jsx)(Ir,{tips:o}):null,c!==void 0?(0,B.jsxs)(te,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,B.jsx)(nt,{off:!1}),w(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,B.jsx)(Hr,{state:n}),(0,B.jsx)(Kr,{voice:a}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),k,(0,B.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}l(Zr,"Fn");s(Zr,"PreCaptureScreen");function zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(zr,"Ur");s(zr,"focusIsOurs");function Yr(){let[e,t]=(0,it.useState)({state:"unknown",settled:!1});return(0,it.useEffect)(()=>jn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(Yr,"Dn");s(Yr,"useCameraStatus");function Wr(e){return Et(e,"mobileRequired")}l(Wr,"qn");s(Wr,"useMobileRequired");function Jr(e){return Et(e,"returning").required}l(Jr,"jn");s(Jr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(c=>{o&&r({required:c===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}l(Et,"Yn");s(Et,"useFlag");function Qr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:c,settled:!0});return}let d=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let p=e.captureChoice??null;d&&r({session:p!==null&&S===p?"choice":S==="assisted"||S==="choice"?S:"self",choice:p,settled:!0})},()=>{d&&r({session:"self",choice:null,settled:!0})}),()=>{d=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(c=>({...c,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}l(Qr,"$n");s(Qr,"useCaptureMode");function Xr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}l(Xr,"zn");s(Xr,"useBusy");var On=s(()=>"idle","serverSnapshot");function xt(e){return Pn(e!==void 0?{assetBaseUrl:e}:{})}l(xt,"Qn");s(xt,"preload");function en(e,t=!0){let n=(0,J.useSyncExternalStore)((0,J.useCallback)(p=>Bn(p,e),[e]),()=>Tn(e),On),[r,a]=(0,J.useState)(null),o=(0,J.useRef)(!1),c=(0,J.useCallback)(()=>{xt(e).then(p=>{o.current&&p==="idle"&&a({base:e})})},[e]);(0,J.useEffect)(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]);let d=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(n!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,c())},[n,e,c,t]);let S=(0,J.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}l(en,"Jn");s(en,"useLivenessAssets");var Cr={progress:0,hint:null,faceDetected:!1};function tn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,L.useRef)(e.verification).current,a=(0,L.useRef)(!1);e.verification!==r&&!a.current&&Lt()&&(a.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 o=(0,L.useRef)(null),[c,d]=(0,L.useState)("idle"),[S,p]=(0,L.useState)(Cr),[w,N]=(0,L.useState)(!1),[j,R]=(0,L.useState)(!1),[O,q]=(0,L.useState)(null),[M,X]=(0,L.useState)(!1),[h,x]=(0,L.useState)(null),[_,k]=(0,L.useState)(null),[u,A]=(0,L.useState)(null),[I,$]=(0,L.useState)(null),[i,T]=(0,L.useState)(null),[P,z]=(0,L.useState)(!1),F=(0,L.useRef)(null),ge=(0,L.useRef)("idle"),he=(0,L.useRef)(-1),[Y,W]=(0,L.useState)(0),ne=(0,L.useRef)(e);ne.current=e,(0,L.useEffect)(()=>{let ee=t.current;if(ee===null)return;let ce={video:ee,...n!==void 0?{assetBaseUrl:n}:{}},G=r!==void 0?r.liveness(ce):qn(ce);o.current=G;let Ne=s(()=>T(G.facingMode??null),"readFacing");Ne();let De=[G.on("state",b=>{b==="mode_switch"?z(!0):b!=="starting"&&b!=="gating"&&z(!1),b==="starting"?(ge.current!=="starting"&&(he.current+=1,W(Math.max(0,he.current))),k(null),A(null),p(Cr),R(!1),N(!1),q(null),x(null),F.current=null):b==="gating"&&ge.current==="recording"&&(R(!1),N(!1),q(null),F.current=null),ge.current=b,Ne(),d(b),ne.current.onStateChange?.(b)}),G.on("gate",b=>{let ke=F.current;F.current=b.progress,N(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&R(!0),p(b)}),G.on("frozen",({previewDataUrl:b})=>q(b)),G.on("profile",({animations:b})=>X(b==="reduced")),G.on("ramp",({colour:b})=>x(b)),G.on("captured",b=>{k(b),$(null),ne.current.onCaptured?.(b)}),G.on("error",b=>{A(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),ne.current.onError?.(b)}),r?.on("result",b=>{$(b),ne.current.onResult?.(b)})];return()=>{for(let b of De)b?.();o.current=null,G.destroy()}},[r,t,n]);let E=(0,L.useCallback)(()=>{o.current?.start()},[]),xe=(0,L.useCallback)(()=>{o.current?.retry()},[]),ve=(0,L.useCallback)(async()=>{let ee=o.current;return ee===null||typeof ee.canSwitchCaptureMode!="function"?!1:await ee.canSwitchCaptureMode().catch(()=>!1)===!0},[]),V=(0,L.useCallback)(async ee=>{let ce=o.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let G=await ce.setCaptureMode(ee).catch(()=>!1)===!0;return G&&T(ce.facingMode??null),G},[]);return{state:c,gate:S,draining:w,gateLocked:j,frozenPreview:O,reduceMotion:M,rampColour:h,artifacts:_,error:u,result:I,facingMode:i,start:E,retry:xe,canSwitchCaptureMode:ve,setCaptureMode:V,modeRestarted:P,attempt:Y}}l(tn,"er");s(tn,"useLivenessHandle");var Vn=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Vn.has(n));return t.length>0?{...e,options:t}:null}l(Nt,"tr");s(Nt,"pending");function rn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,c]=(0,me.useState)(!1),[d,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let N=!0,j=e.methodChoice;typeof j=="function"?(a(!1),Promise.resolve().then(()=>j.call(e)).then(O=>{N&&n(Nt(O))},()=>{}).finally(()=>{N&&a(!0)})):a(!0);let R=e.on("method",O=>n(Nt(O)));return()=>{N=!1,R()}},[e]);let p=(0,me.useCallback)(async N=>{if(e===void 0)return!1;c(!0),S(!1);try{return await e.selectMethod(N),n(null),!0}catch{return S(!0),!1}finally{c(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!d?w:null,settled:r,busy:o,failed:d,select:p}}l(rn,"nr");s(rn,"useMethodChoice");var $n=["ar","fr","en"];function nn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}l(nn,"so");s(nn,"isClipUrl");function sn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of $n){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,c]of Object.entries(a))!st(o)||!nn(c)||((n[r]??(n[r]={}))[o]=c)}return Object.keys(n).length>0?n:null}l(sn,"io");s(sn,"toVoiceClipMap");function an(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(d=>{if(!a)return;let S=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;n(p=>p?.setId===S?.setId?p:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let c=e.on("view",d=>o(d.voice));return()=>{a=!1,c()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?sn(t):null,[t]);return e===void 0?null:r}l(an,"rr");s(an,"useServerVoiceClips");function ln({voice:e}){let t=Ae();return(0,Rt.jsx)(te,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Rt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}l(ln,"sr");s(ln,"VoiceChip");var Fn=new Set(["abandoned","not_opened","cancelled","superseded"]),Dn=800,Gn="capture.lookAtColours";function on(e){return e===void 0||e!==!1&&e.length===_t.length&&_t.every(t=>e.includes(t))}l(on,"fo");s(on,"isDefaultTips");function cn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}l(cn,"mo");s(cn,"carriesActivation");function un(e){return typeof e=="object"&&e!==null&&!(0,m.isValidElement)(e)&&"tone"in e&&"text"in e}l(un,"yo");s(un,"isNoticeObject");var Hn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function dn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(dn,"ho");s(dn,"isCapturing");function pn(e){return e==="captured"||e==="uploading"||e==="checking"}l(pn,"vo");s(pn,"isPostCapture");function Kn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:c,startDisabled:d=!1,startLabel:S,tips:p,tipsSummary:w,coach:N,voice:j,onGuidance:R,onCaptured:O,onResult:q,onError:M,onStateChange:X,assetBaseUrl:h,className:x}){let _=dr(t),k=(0,m.useMemo)(()=>ur(t,r),[t,r,_]),u=(0,m.useMemo)(()=>g=>k[g]??"",[k]),A=n??(t==="ar"?"rtl":"ltr"),I=(0,m.useRef)(null),$=(0,m.useContext)(Un),i=tn({verification:e,videoRef:I,assetBaseUrl:h,onCaptured:O,onResult:q,onError:M,onStateChange:X}),T=en(h,i.state==="idle"&&i.error===null),P=rn(e),z=P.choice!==null,F=Wr(e),ge=Jr(e),he=Xr(e),Y=Yr(),W=Qr(e),ne=W.session==="choice",E=W.mode==="assisted",xe=j!==!1&&j?.clips===void 0,ve=an(xe?e:void 0),V=$r({locale:t,defaultClips:ve,options:j}),ee=E?"environment":"user",ce=W.settled,G=(0,m.useRef)(null),Ne=(0,m.useRef)(!1),De=(0,m.useRef)(V.unlock);De.current=V.unlock,(0,m.useEffect)(()=>{let g=G.current;if(g===null)return;let ae=["pointerup","touchend","click","keydown"],_e=s(()=>{for(let qe of ae)g.removeEventListener(qe,Me,!0)},"disarm");function Me(qe){if(Ne.current){_e();return}cn(qe)&&(Ne.current=!0,_e(),De.current())}l(Me,"Re"),s(Me,"onGesture");for(let qe of ae)g.addEventListener(qe,Me,{capture:!0,passive:!0});return _e},[]);let b=(0,m.useCallback)(()=>{Ne.current||(Ne.current=!0,V.unlock()),i.start()},[V.unlock,i.start]),ke=(0,m.useCallback)(()=>i.start(),[i.start]),Ee=(0,m.useRef)(!1),Pe=i.state==="idle"&&i.error===null,Ut=!z&&!F.required&&(o===!0||o==="when-permitted"&&Y.permission==="granted"),jt=Ut&&P.settled&&F.settled&&ce,mn=o==="when-permitted"&&!Y.permissionSettled&&!Ee.current,Tt=Ut&&Pe&&!Ee.current,ut=(mn||Tt||!ce)&&T.gate==="ready"?"loading":T.gate;(0,m.useEffect)(()=>{!jt||!Pe||T.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Pe,T.gate,ke]);let yn=Pe&&!z&&!F.required&&!(Tt&&T.gate==="ready"),[Pt,Bt]=(0,m.useState)(!1),{canSwitchCaptureMode:Ot,setCaptureMode:qt}=i;(0,m.useEffect)(()=>{if(!W.settled||!ne){Bt(!1);return}let g=!0;return Ot().then(ae=>{g&&Bt(ae)}),()=>{g=!1}},[W.settled,ne,Ot]);let{choose:Vt}=W,Ie=E?"self":"assisted",gn=(0,m.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),$t=i.state!=="idle"&&i.facingMode!==null?i.facingMode:ee;(0,m.useEffect)(()=>{let g=I.current?.style;$t==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[$t]);let Ge=(0,m.useMemo)(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);(0,m.useEffect)(()=>{if(Ge!==null)return()=>URL.revokeObjectURL(Ge)},[Ge]);let Ft=i.frozenPreview??Ge,Ue=e!==void 0,Z=dn(i.state),be=pn(i.state),He=Z||be,se=i.result,Dt=i.state==="done"&&se!==null,Ke=Z&&i.rampColour!==null,dt=i.state==="recording"&&i.frozenPreview!==null&&!Ke,Ze=$!==null,Gt=Pt&&Z&&!dt?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{gn()},"onSwitch")}:null,ze=i.modeRestarted&&Z?u("capture.modeSwitch.restarted"):null,Be=be||dt,Ht=be?"checking":dt?"frozen":i.state==="recording"||Ke?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ye=Z?i.gate.hint:null,We=i.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!i.gate.faceDetected?"fcv3.no_face":lr(Ye),[vn,Kt]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(We!=="fcv3.no_face"){Kt(We);return}if(!Z)return;let g=setTimeout(()=>Kt(We),Dn);return()=>clearTimeout(g)},[We,Z]);let pt=Z&&!Ke&&typeof N=="string"&&N!=="",Zt=E&&Z?u("capture.assisted.stage"):null,Re=Z&&!pt?Ke?Gn:vn:null,ht=pt?N:Re===null?"":u(Re);Fr(V,Re,ht,Z);let zt=(0,m.useRef)(R);zt.current=R,(0,m.useEffect)(()=>{if(st(Re))try{zt.current?.(Re)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Re]);let Oe=(0,m.useMemo)(()=>({supported:V.supported,enabled:V.enabled,setEnabled:V.setEnabled,toggle:V.toggle}),[V.supported,V.enabled,V.setEnabled,V.toggle]),ft=a?.voicePrompt,Yt=ft!==void 0,Wt=j===void 0,Jt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!Yt||!Wt||Jt.current||!Lt()||(Jt.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."))},[Yt,Wt]);let kn=ft!==void 0?(g,ae,_e)=>ft(g,ae,_e,Oe):V.supported?()=>(0,v.jsx)(ln,{voice:Oe}):void 0,{summary:mt,summaryPlaying:Qt,toggleSummary:Xt,stopSummary:er}=V,Je=w!==void 0&&w!=="",tr=Je?w:u("capture.tips.summary"),rr=Je?mt!=="none":mt==="partner"||mt==="default"&&on(p),bn=(0,m.useMemo)(()=>rr?{playing:Qt,toggle:s(()=>Xt(tr,{clip:!Je}),"toggle"),stop:er}:void 0,[rr,Qt,Xt,tr,er,Je]),Cn=(0,m.useMemo)(()=>({assets:ut,retryAssets:T.retry,permission:Y.permission,permissionSettled:Y.permissionSettled,captureMode:W.mode,facing:ee,voice:Oe}),[ut,T.retry,Y.permission,Y.permissionSettled,W.mode,ee,Oe]),_n=un(c)?(0,v.jsx)(le,{tone:c.tone,testId:"sekyro-host-notice",children:(0,v.jsx)("span",{children:c.text})}):c??null,ue=se!==null&&se.status==="retry"?se:null,H=Dt&&se.status==="unavailable"&&!z&&se.reasonCode!=="portrait_required"?se:null,Ce=Dt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,yt=s((g,ae)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Me=ir(t,ae);if(Me!==null)return u(Me.key).replace("{time}",Me.time)}let _e=et(g);return _e===null?null:u(_e)},"reasonText"),gt=s(g=>{let ae=g.retakeHint===void 0?null:Xe(g.retakeHint);return ae===null?yt(g.reasonCode):u(ae)},"retryText"),nr=Ce===null?null:yt(Ce.reasonCode,Ce.retryAfter)??(Ce.status==="not_verified"&&Ce.reason!==void 0&&Fn.has(Ce.reason)?u("errors.session_expired"):null),wn=H!==null&&H.reasonCode!==void 0&&H.reasonCode!=="nni_unbound"&&H.reasonCode!=="id_number_unbound"&&H.reasonCode!=="method_required"&&H.reasonCode!=="mobile_required"&&!(H.reasonCode==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Qe=H?.reasonCode,sr=i.attempt;(0,m.useEffect)(()=>{H===null||Qe===void 0||e?.reportCaptureIssue===void 0||Hn.has(Qe)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Qe,attempt:Math.min(1e3,sr)})},[H,Qe,sr,e]);let ar=kt(),Sn=z&&P.auto===null&&!Z&&!be&&i.error===null,vt=(0,m.useCallback)(async g=>{await P.select(g)&&i.state==="done"&&i.retry()},[P.select,i.state,i.retry]);return(0,m.useEffect)(()=>{P.auto!==null&&!P.busy&&!Z&&!be&&vt(P.auto)},[P.auto,P.busy,Z,be,vt]),(0,v.jsx)(pr,{value:u,children:(0,v.jsxs)("div",{ref:G,className:x===void 0?"sekyro-capture":`sekyro-capture ${x}`,dir:A,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[a?.header,ue!==null&>(ue)!==null&&!(Ze&&He)?(0,v.jsx)(le,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,v.jsx)("span",{children:gt(ue)})}):null,ze!==null&&!Ze?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,v.jsx)("span",{children:ze})}):null,he&&be&&!Ze?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,v.jsx)("span",{children:u("capture.busy")})}):null,F.required&&Pe?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,v.jsx)("span",{children:u("reasons.mobile_required")})}):null,i.error!==null?a?.errorPanel!==void 0?a.errorPanel(i.error,i.retry):(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-error-notice",children:[(0,v.jsx)("span",{children:u(or(i.error))}),i.error.retryable?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u("common.retry")}):null]}):null,H!==null?(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,v.jsx)("span",{children:(H.reasonCode==="attestation"&&H.attestationError==="clock_wrong"?u("errors.device_clock"):yt(H.reasonCode))??u(H.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),wn?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u(H.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,nr!==null&&Ce!==null?(0,v.jsx)(le,{tone:Ce.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,v.jsx)("span",{children:nr})}):null,(0,v.jsx)("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:Ze?$({videoRef:I,guidance:Be&&Ue?u("capture.checking"):ht,coached:pt&&!(Be&&Ue),note:Be?Ue?u(he?"capture.busy":"capture.checkingHint"):null:ze??(ue!==null?gt(ue):Zt),settled:Be&&Ue,progress:i.gate.progress,phase:Ht,still:Be?Ft:null,live:He,modeSwitch:Gt,...Pt?{status:ze}:{},ramp:i.rampColour===null?null:{colour:i.rampColour}}):(0,v.jsx)(hr,{videoRef:I,guidanceText:ht,guidanceHint:Ye,guidanceKey:Re,progress:i.gate.progress,phase:Ht,draining:i.draining,stillUrl:Ft,showChecking:Ue,operatorText:Zt,voicePrompt:kn,overlay:l(g=>(0,v.jsxs)(v.Fragment,{children:[a?.stageOverlay?.(g),(0,v.jsx)(fr,{colour:i.rampColour})]}),"overlay"),reduceMotion:i.reduceMotion,modeSwitch:Gt})}),Sn&&P.choice!==null?(0,v.jsx)(Ur,{title:u("method.title"),description:u("method.description"),options:P.choice.options.map(g=>({id:g,label:u(`method.${g}`)})),busy:P.busy,error:P.failed?u("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(g=>{vt(g)},"onChoose")}):null,yn?(0,v.jsxs)(v.Fragment,{children:[ge&&a?.header===void 0&&a?.intro===void 0?(0,v.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,v.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,v.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,_n,a?.intro!==void 0?a.intro(b,Cn):(0,v.jsx)(Zr,{assets:ut,onRetryAssets:T.retry,permission:Y.permission,captureMode:W.mode,voice:Oe,tips:p??_t,summary:bn,startLabel:S,startDisabled:d,onStart:b})]}):null,(0,v.jsx)(Dr,{showCoaching:ue!==null,coaching:lt(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?cr(k,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!Z&&!be||!Ue&&i.state==="captured",onRetake:i.retry}),a?.footer]})})}l(Kn,"xi");s(Kn,"LivenessCapture");var It=U(K(),1),ct=U(K(),1),f=U(de(),1);import{isInAppBrowser as es}from"@sekyro/web/client";var ks={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"};function Zn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}l(Zn,"Y");s(Zn,"identityLabel");function zn(e,t){let[n,r]=(0,It.useState)(!1),[a,o]=(0,It.useState)(null);return{busy:n,error:a,run:s(c=>{r(!0),o(null),c().then(()=>r(!1),d=>{r(!1),o(e.t(br(d,e.strings))),t?.(d)})},"run")}}l(zn,"q");s(zn,"useChoiceAction");function hn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,f.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("defs",{children:(0,f.jsx)("mask",{id:e,children:(0,f.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,f.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,f.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(hn,"O");s(hn,"FaceMark");var Yn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Wn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}l(Wn,"te");s(Wn,"faceIntroRetryOf");var Jn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Qn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:c,retry:d}){let S=Ct(),{t:p}=S,w=d===void 0?"face":lt(d.reason),N=w==="face"?null:Fe[w].tips,j=(0,ct.useContext)(yr)?.busy===!0;return(0,f.jsxs)("section",{className:"sekyro-step",children:[(0,f.jsx)(hn,{}),t.captureMode==="assisted"?(0,f.jsx)(tt,{title:p("capture.assisted.heading"),lead:p("capture.assisted.lead")}):o?(0,f.jsx)(tt,{title:p("returning.heading"),lead:p("returning.description")}):(0,f.jsx)(tt,{title:p(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:p(a?"native.face.humanIntroLead":"native.face.introLead")}),d!==void 0?(0,f.jsx)(fn,{retry:d,title:Fe[w].title}):null,r!==void 0&&N===null?(0,f.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,f.jsx)("ul",{className:"sekyro-tiprows",children:N!==null?N.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Jn[R]??"face"}),p(R)]},R)):n!==void 0?n.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Yn[R.id]??"face"}),R.text]},R.id)):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"light"}),p("capture.tips.light")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"jGlasses"}),p("capture.tips.uncover")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"smartphone"}),p("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,f.jsx)(te,{kind:"secondary",full:!0,onClick:t.retryAssets,children:p("common.retry")}):null,c!==void 0?null:(0,f.jsx)(mr,{children:(0,f.jsxs)(te,{full:!0,disabled:t.assets!=="ready"||j,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,f.jsx)(Le,{name:"camera"}),p("capture.start")]})})]})}l(Qn,"ne");s(Qn,"FaceIntro");var Xn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function fn({retry:e,title:t}){let n=Ct(),r=e.retakeHint===void 0?null:Xe(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Xn.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,f.jsxs)(gr,{tone:"warning",children:[r!==null?(0,f.jsx)("span",{children:n.t(r)}):a!==null?(0,f.jsx)("span",{children:n.t(a)}):null,r===null?(0,f.jsx)("span",{children:n.t(t)}):null,(0,f.jsx)("span",{children:vr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(fn,"T");s(fn,"RetryNotice");function ts(e){return es(e)}l(ts,"se");s(ts,"isInAppBrowser");function rs(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(rs,"ce");s(rs,"androidBrowserIntent");export{Ur as a,Lt as b,Un as c,Qr as d,Kn as e,ks as f,Zn as g,zn as h,Wn as i,Qn as j,ts as k,rs as l};
|
|
1
|
+
import{b as hr,d as fr}from"./chunk-ELSYMAAW.js";import{b as kr,c as bt}from"./chunk-46JFMIK7.js";import{a as br}from"./chunk-YZ6YGLNN.js";import{c as _t}from"./chunk-C3WB5BAA.js";import{a as ur,b as dr,c as pr,d as Ae}from"./chunk-JKDI3DQD.js";import{G as yr,L as gr,M as vr,a as K,b as de,c as te,m as lr,n as Xe,p as or,q as et,r as ir,s as cr,t as kt,u as le,v as Le,w as tt,y as mr}from"./chunk-SBLFJ2MR.js";import{a as l,c as U,i as s}from"./chunk-SSU37LFQ.js";var Cr=U(K(),1),y=U(de(),1),re=U(de(),1),ye=U(K(),1),D=U(de(),1),_=U(K(),1),m=U(K(),1),at=U(K(),1),fe=U(de(),1),Gr=U(K(),1),Q=U(K(),1),ot=U(K(),1),we=U(de(),1),Se=U(de(),1),B=U(de(),1),it=U(K(),1),pe=U(K(),1),J=U(K(),1),L=U(K(),1),me=U(K(),1),Te=U(K(),1),Rt=U(de(),1),v=U(de(),1);import{subscribeCameraPermission as jn}from"@sekyro/web";import{getLivenessAssetsStatus as Tn,preloadLivenessAssets as Pn,subscribeLivenessAssets as Bn}from"@sekyro/web";import{createLivenessCapture as qn}from"@sekyro/web";function ie({className:e,children:t}){return(0,y.jsx)("svg",{"aria-hidden":"true",focusable:"false",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round",className:e??"sekyro-icon sekyro-icon--sm",children:t})}l(ie,"ne");s(ie,"Svg");var Mt="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 wr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"4"}),(0,y.jsx)("path",{d:"M12 2.5v2M12 19.5v2M2.5 12h2M19.5 12h2M5.3 5.3l1.4 1.4M17.3 17.3l1.4 1.4M5.3 18.7l1.4-1.4M17.3 6.7l1.4-1.4"})]})}l(wr,"ln");s(wr,"SunIcon");function Sr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9"}),(0,y.jsx)("path",{d:"M9 10h.01M15 10h.01M8.8 14.6a4.2 4.2 0 0 0 6.4 0"})]})}l(Sr,"un");s(Sr,"FaceUncoveredIcon");function xr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("rect",{x:"7",y:"2.5",width:"10",height:"19",rx:"2"}),(0,y.jsx)("path",{d:"M10.5 18.5h3M2.5 9.5h2.5M19 9.5h2.5"}),(0,y.jsx)("circle",{cx:"12",cy:"9.5",r:"1.6"})]})}l(xr,"dn");s(xr,"PhoneEyeLevelIcon");function Nr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:"M2.5 12S6 5.5 12 5.5 21.5 12 21.5 12 18 18.5 12 18.5 2.5 12 2.5 12Z"}),(0,y.jsx)("circle",{cx:"12",cy:"12",r:"2.8"})]})}l(Nr,"pn");s(Nr,"LookStraightIcon");function Rr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M9 13l2 2 4-4"})]})}l(Rr,"fn");s(Rr,"CameraCheckIcon");function Mr(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M10.2 11.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.3M12 16.4h.01"})]})}l(Mr,"mn");s(Mr,"CameraAskIcon");function Ar(e){return(0,y.jsxs)(ie,{...e,children:[(0,y.jsx)("path",{d:Mt}),(0,y.jsx)("path",{d:"M3 3l18 18"})]})}l(Ar,"yn");s(Ar,"CameraBlockedIcon");function nt({off:e,className:t}){return(0,y.jsxs)(ie,{className:t,children:[(0,y.jsx)("path",{d:"M4.5 9.5v5H8l4 3.5v-12L8 9.5H4.5Z"}),e?(0,y.jsx)("path",{d:"M4 4l16 16"}):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("path",{d:"M15.5 9.7a3.6 3.6 0 0 1 0 4.6"}),(0,y.jsx)("path",{d:"M18 7.6a6.6 6.6 0 0 1 0 8.8"})]})]})}l(nt,"Ve");s(nt,"SpeakerIcon");function Lr(e){return(0,y.jsx)(ie,{...e,children:(0,y.jsx)("path",{d:"M5 12.5l4.5 4.5L19 7.5"})})}l(Lr,"gn");s(Lr,"CheckIcon");function Er(e){return(0,y.jsxs)(ie,{className:e.className??"sekyro-spinner",children:[(0,y.jsx)("circle",{cx:"12",cy:"12",r:"9",opacity:"0.25"}),(0,y.jsx)("path",{d:"M21 12a9 9 0 0 0-9-9"})]})}l(Er,"hn");s(Er,"SpinnerIcon");var Ct=["light","uncover","eyeLevel","straight"],xn={light:{key:"capture.tips.light",icon:s(()=>(0,re.jsx)(wr,{}),"icon")},uncover:{key:"capture.tips.uncover",icon:s(()=>(0,re.jsx)(Sr,{}),"icon")},eyeLevel:{key:"capture.tips.eyeLevel",icon:s(()=>(0,re.jsx)(xr,{}),"icon")},straight:{key:"capture.tips.straight",icon:s(()=>(0,re.jsx)(Nr,{}),"icon")}};function Ir({tips:e}){let t=Ae(),n=(0,Cr.useId)();return e.length===0?null:(0,re.jsxs)("section",{className:"sekyro-tips","aria-labelledby":n,"data-testid":"sekyro-tips",children:[(0,re.jsx)("p",{className:"sekyro-tips__title",id:n,children:t("capture.tips.title")}),(0,re.jsx)("ul",{className:"sekyro-tips__list",children:e.map(r=>{let a=typeof r=="string"?xn[r]:void 0,o=typeof r=="string"?r:r.id,c=a!==void 0?a.icon():typeof r=="string"?void 0:r.icon,d=a!==void 0?t(a.key):typeof r=="string"?r:r.text;return(0,re.jsxs)("li",{className:"sekyro-tips__item",children:[c!=null?(0,re.jsx)("span",{className:"sekyro-tips__icon","aria-hidden":"true",children:c}):null,(0,re.jsx)("span",{children:d})]},o)})})]})}l(Ir,"Cn");s(Ir,"TipList");var Nn=220;function Ur({title:e,description:t,options:n,busy:r,error:a,focus:o,testId:c,look:d="cards",marked:S,onChoose:p}){let w=(0,ye.useId)(),N=kt(),[j,R]=(0,ye.useState)(null),O=(0,ye.useRef)(null);(0,ye.useEffect)(()=>{a!==null&&R(null)},[a]),(0,ye.useEffect)(()=>()=>{O.current!==null&&clearTimeout(O.current)},[]);let q=s(M=>{r||j!==null||(R(M),O.current=setTimeout(()=>{O.current=null,R(null),p(M)},Nn))},"choose");return(0,D.jsxs)("section",{className:"sekyro-stack sekyro-stack--4 sekyro-choice","aria-labelledby":w,"data-testid":c,children:[(0,D.jsxs)("div",{className:d==="cards"?"sekyro-heading":"sekyro-stack sekyro-stack--1",children:[(0,D.jsx)("h2",{id:w,ref:o?N:void 0,tabIndex:-1,className:"sekyro-text-body",children:e}),t!==void 0&&t!==""?(0,D.jsx)("p",{className:"sekyro-text-muted",children:t}):null]}),a!==null?(0,D.jsx)(le,{tone:"danger",children:(0,D.jsx)("span",{children:a})}):null,d==="buttons"?(0,D.jsx)("div",{className:"sekyro-stack sekyro-stack--3",children:n.map((M,X)=>(0,D.jsx)(te,{kind:X===0?"primary":"ghost",full:!0,disabled:r,"aria-busy":r||void 0,onClick:l(()=>p(M.id),"onClick"),children:M.label},M.id))}):(0,D.jsx)("div",{className:"sekyro-choices",children:n.map(M=>(0,D.jsxs)("button",{type:"button",className:"sekyro-card","aria-pressed":(j??S)===M.id,"aria-busy":r||void 0,disabled:r||j!==null&&j!==M.id,onClick:l(()=>q(M.id),"onClick"),children:[M.glyph!==void 0?(0,D.jsx)("span",{className:"sekyro-card__tile",children:M.glyph}):null,(0,D.jsxs)("span",{className:"sekyro-card__body",children:[(0,D.jsx)("span",{className:"sekyro-card__title",children:M.label}),M.sub!==void 0?(0,D.jsx)("span",{className:"sekyro-card__sub",children:M.sub}):null]}),(0,D.jsx)("span",{className:"sekyro-radio","aria-hidden":"true"})]},M.id))})]})}l(Ur,"bn");s(Ur,"ChoiceScreen");var jr=["fcv3.no_face","fcv3.come_closer","fcv3.move_back","fcv3.center_face","fcv3.straighten","fcv3.more_light","fcv3.too_bright","fcv3.hold_still","fcv3.steady_camera","fcv3.hold_upright","fcv3.one_face","capture.tips.summary","capture.lookAtColours"];function st(e){return e!==null&&jr.includes(e)}l(st,"he");s(st,"isVoiceKey");var Rn=s((e,t)=>Object.prototype.hasOwnProperty.call(e,t),"own");function je(e,t,n){let r;try{if(typeof e=="function")r=e(t,n);else{let a=e[n];r=a!=null&&Rn(a,t)?a[t]:null}}catch{return null}return typeof r=="string"&&r!==""?r:null}l(je,"Me");s(je,"resolveClip");var Mn="UklGRiQAAABXQVZFZm10IBAAAAABAAEAESsAACJWAAACABAAZGF0YQAAAAA=",An={ar:"ar-SA",fr:"fr-FR",en:"en-US",es:"es-ES",pt:"pt-BR",de:"de-DE"};function oe(){return typeof window<"u"&&"speechSynthesis"in window?window.speechSynthesis:null}l(oe,"re");s(oe,"synth");function Tr(){return oe()!==null&&typeof SpeechSynthesisUtterance=="function"}l(Tr,"Lr");s(Tr,"speechAvailable");function wt(e){return(e.split(/[-_]/)[0]??e).toLowerCase()}l(wt,"Sn");s(wt,"baseLang");function At(e,t){let n=s(a=>a.replace(/_/g,"-").toLowerCase(),"norm"),r=wt(t);return e.find(a=>n(a.lang)===n(t))??e.find(a=>wt(a.lang)===r)}l(At,"Mn");s(At,"pickVoice");function Pr(e){if(!Tr())return!1;let t=[];try{t=oe()?.getVoices()??[]}catch{return!0}return t.length===0||At(t,e)!==void 0}l(Pr,"wn");s(Pr,"speechUsable");function Br(e){let t=oe();return t===null||typeof t.addEventListener!="function"?()=>{}:(t.addEventListener("voiceschanged",e),()=>t.removeEventListener?.("voiceschanged",e))}l(Br,"Ln");s(Br,"subscribeVoices");function $e(e){try{let t=typeof location<"u"?location.href:"http://localhost/",n=new URL(e,t);return`clip:${n.origin}${n.pathname}`}catch{return`clip:${e}`}}l($e,"Ke");s($e,"clipIdentity");function St(e){e.pause(),e.removeAttribute("src"),e.load()}l(St,"Rn");s(St,"release");function Or(){let e=null,t=null,n=0,r=null,a=null,o=null,c=!1,d=null,S=[],p=new Map,w=s(()=>{S=oe()?.getVoices()??[]},"loadVoices"),N=!1,j=s(()=>{let h=oe();N||h===null||(N=!0,w(),h.addEventListener?.("voiceschanged",w))},"bindVoices"),R=s(()=>(e??(e=new Audio),e),"element"),O=s((h,x,C,k)=>{let u=oe();if(u!==null&&h!==""&&typeof SpeechSynthesisUtterance=="function"){j();let A=At(S,x);if(S.length===0||A!==void 0){u.cancel();let I=new SpeechSynthesisUtterance(h);I.lang=x,A!==void 0&&(I.voice=A),I.rate=.95,C!==void 0&&(I.onend=C),(C!==void 0||k!==void 0)&&(I.onerror=$=>{k!==void 0&&$.error==="not-allowed"?k():C?.()}),u.speak(I);return}}C?.()},"speak"),q=s(()=>{n+=1,r=null,a=o=null,e!==null&&(e.pause(),e.currentTime=0),oe()?.cancel()},"stop"),M=s(h=>{for(let x of h){let C=$e(x);if(p.has(C))continue;let k=new Audio;k.preload="auto",k.src=x,p.set(C,k)}},"warmClips"),X=s((h,x,C)=>{let k={utterance:h,generation:x,end:C};d=k;let u=s(()=>x===n&&d===k,"live"),A=s(()=>{u()&&(a=k)},"block");if(oe()?.cancel(),h.url!==null){let I=R();I.pause(),I.muted=!1,I.src=h.url,I.currentTime=0,I.onended=C??null;let $=s(()=>{o===k&&(o=null)},"settled"),i=I.play();if(i===void 0)return;o=k,i.then($,T=>{if($(),!u())return;let P=T?.name;if(P!=="AbortError"){if(P==="NotAllowedError")return A();h.speech?O(h.text,h.lang,C,A):C?.()}});return}h.speech?O(h.text,h.lang,C,A):C?.()},"start");return{say(h){let x=h.url!==null?$e(h.url):`tts:${h.lang}:${h.text}`;if(x===r)return;r=x,a=o=null,n+=1;let C=n,k=h.onEnd;X(h,C,k!==void 0?()=>{C===n&&k()}:void 0)},unlock({lang:h,speech:x,prefetch:C}){let k=a??(c?null:o);c=!0;let u=k!==null&&k.generation===n?k:null;a=o=null,u!==null&&X(u.utterance,u.generation,u.end);let A=R();if(t===null&&typeof Blob=="function"&&typeof URL.createObjectURL=="function"){let T=Uint8Array.from(atob(Mn),P=>P.charCodeAt(0));t=URL.createObjectURL(new Blob([T],{type:"audio/wav"}))}let I=A.paused===!1&&t!==null&&A.src!==t;t!==null&&!I&&(u===null||u.utterance.url===null)&&(A.muted=!0,A.onended=null,A.src=t,A.play()?.catch(()=>{}));let $=oe(),i=u!==null&&u.utterance.url===null;if(x&&!i&&$!==null&&typeof SpeechSynthesisUtterance=="function"){j();let T=new SpeechSynthesisUtterance(" ");T.volume=0,T.lang=h,$.speak(T)}M(C??[])},prefetch:M,stop:q,dispose(){q(),N&&oe()?.removeEventListener?.("voiceschanged",w),N=!1,t!==null&&URL.revokeObjectURL(t),t=null,e!==null&&St(e),e=null;for(let h of p.values())St(h);p.clear()}}}l(Or,"_n");s(Or,"createVoicePlayer");var Ln="sekyro.voiceGuidance";function qr(e){try{if(typeof window>"u")return null;let t=window.localStorage.getItem(e);return t==="1"?!0:t==="0"?!1:null}catch{return null}}l(qr,"xn");s(qr,"readVoicePreference");function Vr(e,t){try{if(typeof window>"u")return;window.localStorage.setItem(e,t?"1":"0")}catch{}}l(Vr,"En");s(Vr,"writeVoicePreference");var Ve="capture.tips.summary",En=typeof window<"u"?_.useLayoutEffect:_.useEffect,In=Object.freeze({});function rt(e,t){let n=new Set,r=[];for(let a of jr){let o=a===Ve?null:je(e,a,t);o===null||n.has($e(o))||(n.add($e(o)),r.push(o))}return r}l(rt,"ht");s(rt,"resolvedClipUrls");function $r({locale:e,defaultClips:t,options:n}){let r=n===!1,a=r?{}:n??{},o=a.storageKey===void 0?Ln:a.storageKey,[c,d]=(0,_.useState)(a.defaultEnabled??!0),S=(0,_.useRef)(c),[p,w]=(0,_.useState)(!1),[N,j]=(0,_.useState)("none"),[R,O]=(0,_.useState)(!1),q=(0,_.useRef)(!1),[M,X]=(0,_.useState)(0),h=(0,_.useRef)(null),x=(0,_.useCallback)(()=>(h.current??(h.current=Or()),h.current),[]),C=An[e],k=a.speechFallback,u=k===void 0||k===!0?!0:k===!1?!1:k.includes(e),A=a.clips??t??In,I=(0,_.useRef)(!1),$=(0,_.useRef)(A);En(()=>{$.current=A,S.current=c}),(0,_.useEffect)(()=>{if(r||o===null)return;let E=qr(o);E!==null&&(S.current=E,d(E))},[r,o]),(0,_.useEffect)(()=>{if(!(r||!u))return Br(()=>X(E=>E+1))},[r,u]);let i=a.clips;(0,_.useEffect)(()=>{if(r)return;let E=u&&Pr(C);w(rt(A,e).length>0||E),j(i!==void 0&&je(i,Ve,e)!==null?"partner":je(A,Ve,e)!==null||E?"default":"none")},[r,A,i,e,u,C,M]),(0,_.useEffect)(()=>{if(r||!c||!I.current)return;let E=rt(A,e);E.length>0&&x().prefetch(E)},[r,c,A,e,x]),(0,_.useEffect)(()=>()=>{h.current?.dispose(),h.current=null,I.current=!1},[]);let T=(0,_.useCallback)(E=>{r||(I.current=!0,x().unlock({lang:C,speech:u,...E?{prefetch:rt($.current,e)}:{}}))},[r,x,C,u,e]),P=(0,_.useCallback)(()=>T(S.current),[T]),z=(0,_.useCallback)(()=>{q.current=!1,O(!1)},[]),F=(0,_.useCallback)(()=>{z(),h.current?.stop()},[z]),ge=(0,_.useCallback)(()=>{q.current&&F()},[F]),he=(0,_.useCallback)((E,xe)=>{if(r)return;if(q.current){F();return}let ve=x();ve.stop(),q.current=!0,O(!0);let V=xe?.clip===!1?null:je($.current,Ve,e);ve.say({url:V,text:E,lang:C,speech:u,onEnd:z})},[r,F,x,e,C,u,z]),Y=(0,_.useCallback)(E=>{r||(E?T(!0):F(),o!==null&&Vr(o,E),S.current=E,d(E))},[r,T,F,o]),W=(0,_.useCallback)(()=>Y(!S.current),[Y]),ne=(0,_.useCallback)((E,xe)=>{if(r||!c)return;q.current&&z();let ve=je($.current,E,e);x().say({url:ve,text:xe,lang:C,speech:u})},[r,c,e,x,C,u,z]);return(0,_.useMemo)(()=>({supported:!r&&p,enabled:!r&&c,setEnabled:Y,toggle:W,unlock:P,speakKey:ne,stop:F,summary:r?"none":N,summaryPlaying:R,toggleSummary:he,stopSummary:ge}),[r,p,c,Y,W,P,ne,F,N,R,he,ge])}l($r,"vt");s($r,"useVoiceGuidance");function Fr(e,t,n,r){let{speakKey:a,stop:o,enabled:c}=e,d=(0,_.useRef)(!1);(0,_.useEffect)(()=>{if(!r||!c){d.current&&o(),d.current=!1;return}d.current=!0,st(t)&&t!==Ve&&n!==""&&a(t,n)},[r,c,t,n,a,o])}l(Fr,"Ct");s(Fr,"useSpeakGuidance");function lt(e){switch(e){case"multiple_faces":return"one_face";case"capture_back_camera":return"front_camera";case"capture_front_camera":return"back_camera";case"capture_not_upright":return"upright";case"media_unreadable":case"clip_too_short":return"recording";case"device_integrity_failed":return"device";default:return"face"}}l(lt,"Pn");s(lt,"retryCoachingOf");var Fe={face:{title:"capture.retryCoaching.title",tips:["capture.retryCoaching.light","capture.retryCoaching.eyeLevel","capture.retryCoaching.head"]},one_face:{title:"capture.retryTips.title",tips:["capture.retryOneFace.alone","capture.retryOneFace.screens"]},front_camera:{title:"capture.retryTips.title",tips:["capture.retryFrontCamera.screenSide"]},back_camera:{title:"capture.retryTips.title",tips:["capture.retryBackCamera.backSide","capture.retryBackCamera.circle"]},upright:{title:"capture.retryTips.title",tips:["capture.retryUpright.vertical","capture.retryUpright.untilEnd"]},recording:{title:"capture.retryTips.title",tips:["capture.retryRecording.cameraOn","capture.retryRecording.stay","capture.retryRecording.network"]},device:{title:"capture.retryTips.title",tips:["capture.retryDevice.screenRecording","capture.retryDevice.phone"]}};function Dr({showCoaching:e,coaching:t="face",attemptsText:n,showRetake:r,onRetake:a}){let o=Ae(),c=(0,at.useRef)(null);return(0,at.useEffect)(()=>{r&&c.current?.focus()},[r]),!e&&!r?null:(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--3","data-testid":"sekyro-captured-panel",children:[e?(0,fe.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,fe.jsx)("p",{className:"sekyro-text-body",children:o(Fe[t].title)}),(0,fe.jsx)("ul",{className:"sekyro-coaching",children:Fe[t].tips.map(d=>(0,fe.jsx)("li",{children:o(d)},d))}),n!==null?(0,fe.jsx)("p",{className:"sekyro-text-muted","data-testid":"sekyro-attempts-remaining",children:n}):null]}):null,r?(0,fe.jsx)(te,{ref:c,className:"sekyro-btn--start",onClick:a,children:o("capture.recordAgain")}):null]})}l(Dr,"Tn");s(Dr,"CapturedPanel");function Lt(){try{return!1}catch{return!1}}l(Lt,"nt");s(Lt,"isDevBuild");var Un=(0,Gr.createContext)(null);function Hr({state:e}){let t=Ae(),[n,r]=(0,ot.useState)(!1);(0,ot.useEffect)(()=>{e!=="unknown"&&r(!0)},[e]);let a=e==="granted"?(0,we.jsx)(Rr,{}):e==="denied"?(0,we.jsx)(Ar,{}):(0,we.jsx)(Mr,{});return(0,we.jsxs)("div",{role:n?"status":void 0,className:`sekyro-permission sekyro-permission--${e}`,"data-testid":"sekyro-permission","data-state":e,children:[(0,we.jsx)("span",{className:"sekyro-permission__icon","aria-hidden":"true",children:a}),(0,we.jsx)("span",{children:t(`capture.permission.${e}`)})]})}l(Hr,"On");s(Hr,"PermissionRow");function Kr({voice:e}){let t=Ae();if(!e.supported)return null;let n=e.enabled;return(0,Se.jsxs)("button",{type:"button",role:"switch","aria-checked":n,className:"sekyro-switch","data-testid":"sekyro-voice-switch",onClick:l(()=>e.toggle(),"onClick"),children:[(0,Se.jsxs)("span",{className:"sekyro-switch__label",children:[(0,Se.jsx)(nt,{off:!n}),t("capture.voiceGuidance")]}),(0,Se.jsx)("span",{className:"sekyro-switch__track","aria-hidden":"true",children:(0,Se.jsx)("span",{className:"sekyro-switch__thumb",children:n?(0,Se.jsx)(Lr,{className:"sekyro-switch__check"}):null})})]})}l(Kr,"Hn");s(Kr,"VoiceSwitch");function Zr({assets:e,onRetryAssets:t,permission:n,captureMode:r="self",voice:a,tips:o,summary:c,startLabel:d,startDisabled:S,onStart:p}){let w=Ae(),N=(0,Q.useRef)(c?.stop);N.current=c?.stop,(0,Q.useEffect)(()=>()=>N.current?.(),[]);let j=(0,Q.useRef)(null),R=(0,Q.useRef)(null),O=(0,Q.useRef)(null),q=(0,Q.useRef)(e),M=(0,Q.useRef)(!1);(0,Q.useEffect)(()=>{let u=q.current;if(q.current=e,u===e)return;let A=M.current;e!=="loading"&&(M.current=!1),zr(j.current)&&(e==="failed"?O.current?.focus():A&&R.current?.focus())},[e]);let X=(0,Q.useCallback)(()=>{M.current=!0,t()},[t]),h=e==="loading",x=h||S,C=(0,Q.useCallback)(()=>{x||(N.current?.(),p())},[x,p]),k;return e==="failed"?k=(0,B.jsxs)(le,{tone:"danger",testId:"sekyro-assets-error",children:[(0,B.jsx)("p",{className:"sekyro-text-body",children:w("fcv2.err.models")}),(0,B.jsx)(te,{kind:"ghost",ref:O,className:"sekyro-btn--start",onClick:X,"data-testid":"sekyro-assets-retry",children:w("common.retry")})]}):k=(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,B.jsx)(te,{ref:R,full:!0,"data-testid":"sekyro-start","aria-disabled":x?"true":void 0,"aria-busy":h?"true":void 0,onClick:C,children:h?(0,B.jsxs)(B.Fragment,{children:[(0,B.jsx)(Er,{}),w("capture.preparing.title")]}):d??w("capture.start")}),h?(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.preparing.hint")}):null]}),(0,B.jsxs)("div",{ref:j,className:"sekyro-stack sekyro-stack--4","data-testid":"sekyro-intro","data-assets":e,children:[r==="assisted"?(0,B.jsxs)("div",{className:"sekyro-stack sekyro-stack--1","data-testid":"sekyro-assisted-intro",children:[(0,B.jsx)("h2",{className:"sekyro-text-body",children:w("capture.assisted.title")}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.assisted.lead")})]}):null,o!==!1?(0,B.jsx)(Ir,{tips:o}):null,c!==void 0?(0,B.jsxs)(te,{kind:"ghost",className:"sekyro-btn--start",onClick:c.toggle,"data-testid":"sekyro-tips-listen",children:[(0,B.jsx)(nt,{off:!1}),w(c.playing?"capture.tips.stop":"capture.tips.listen")]}):null,(0,B.jsx)(Hr,{state:n}),(0,B.jsx)(Kr,{voice:a}),(0,B.jsx)("p",{className:"sekyro-text-muted",children:w("capture.securityNote")}),k,(0,B.jsx)("p",{role:"status",className:"sekyro-visually-hidden","data-testid":"sekyro-intro-status",children:e==="loading"?w("capture.preparing.title"):e==="ready"?w("capture.ready"):""})]})}l(Zr,"Fn");s(Zr,"PreCaptureScreen");function zr(e){if(typeof document>"u")return!1;let t=document.activeElement;return t===null||t===document.body||e!==null&&e.contains(t)}l(zr,"Ur");s(zr,"focusIsOurs");function Yr(){let[e,t]=(0,it.useState)({state:"unknown",settled:!1});return(0,it.useEffect)(()=>jn(n=>t({state:n,settled:!0})),[]),{permission:e.state,permissionSettled:e.settled}}l(Yr,"Dn");s(Yr,"useCameraStatus");function Wr(e){return Et(e,"mobileRequired")}l(Wr,"qn");s(Wr,"useMobileRequired");function Jr(e){return Et(e,"returning").required}l(Jr,"jn");s(Jr,"useReturning");function Et(e,t){let[n,r]=(0,pe.useState)({required:!1,settled:e===void 0});return(0,pe.useEffect)(()=>{let a=e?.[t];if(e===void 0||typeof a!="function"){r({required:!1,settled:!0});return}let o=!0;return r({required:!1,settled:!1}),Promise.resolve().then(()=>a.call(e)).then(c=>{o&&r({required:c===!0,settled:!0})},()=>{o&&r({required:!1,settled:!0})}),()=>{o=!1}},[e,t]),n}l(Et,"Yn");s(Et,"useFlag");function Qr(e){let t=s(()=>e?.captureChoice??null,"initialChoice"),[n,r]=(0,pe.useState)(()=>({session:"self",choice:t(),settled:e===void 0}));(0,pe.useEffect)(()=>{let o=e?.captureMode,c=e?.captureChoice??null;if(e===void 0||typeof o!="function"){r({session:"self",choice:c,settled:!0});return}let d=!0;return r({session:"self",choice:c,settled:!1}),Promise.resolve().then(()=>o.call(e)).then(S=>{let p=e.captureChoice??null;d&&r({session:p!==null&&S===p?"choice":S==="assisted"||S==="choice"?S:"self",choice:p,settled:!0})},()=>{d&&r({session:"self",choice:null,settled:!0})}),()=>{d=!1}},[e]);let a=(0,pe.useCallback)(o=>{e?.chooseCaptureMode?.(o),r(c=>({...c,choice:o}))},[e]);return{mode:n.session==="choice"?n.choice??"self":n.session==="assisted"?"assisted":"self",session:n.session,choice:n.choice,settled:n.settled,choose:a}}l(Qr,"$n");s(Qr,"useCaptureMode");function Xr(e){let[t,n]=(0,pe.useState)(!1);return(0,pe.useEffect)(()=>{if(n(!1),e===void 0)return;let r=e.on("busy",()=>n(!0)),a=e.on("result",()=>n(!1));return()=>{r(),a()}},[e]),t}l(Xr,"zn");s(Xr,"useBusy");var On=s(()=>"idle","serverSnapshot");function xt(e){return Pn(e!==void 0?{assetBaseUrl:e}:{})}l(xt,"Qn");s(xt,"preload");function en(e,t=!0){let n=(0,J.useSyncExternalStore)((0,J.useCallback)(p=>Bn(p,e),[e]),()=>Tn(e),On),[r,a]=(0,J.useState)(null),o=(0,J.useRef)(!1),c=(0,J.useCallback)(()=>{xt(e).then(p=>{o.current&&p==="idle"&&a({base:e})})},[e]);(0,J.useEffect)(()=>(o.current=!0,c(),()=>{o.current=!1}),[c]);let d=(0,J.useRef)(null);(0,J.useEffect)(()=>{if(n!=="idle"){d.current={base:e};return}!t||d.current===null||d.current.base!==e||(d.current=null,c())},[n,e,c,t]);let S=(0,J.useCallback)(()=>{xt(e)},[e]);return{gate:r!==null&&r.base===e&&n==="idle"||n==="ready"?"ready":n==="failed"?"failed":"loading",retry:S}}l(en,"Jn");s(en,"useLivenessAssets");var _r={progress:0,hint:null,faceDetected:!1};function tn(e){let{videoRef:t,assetBaseUrl:n}=e,r=(0,L.useRef)(e.verification).current,a=(0,L.useRef)(!1);e.verification!==r&&!a.current&&Lt()&&(a.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 o=(0,L.useRef)(null),[c,d]=(0,L.useState)("idle"),[S,p]=(0,L.useState)(_r),[w,N]=(0,L.useState)(!1),[j,R]=(0,L.useState)(!1),[O,q]=(0,L.useState)(null),[M,X]=(0,L.useState)(!1),[h,x]=(0,L.useState)(null),[C,k]=(0,L.useState)(null),[u,A]=(0,L.useState)(null),[I,$]=(0,L.useState)(null),[i,T]=(0,L.useState)(null),[P,z]=(0,L.useState)(!1),F=(0,L.useRef)(null),ge=(0,L.useRef)("idle"),he=(0,L.useRef)(-1),[Y,W]=(0,L.useState)(0),ne=(0,L.useRef)(e);ne.current=e,(0,L.useEffect)(()=>{let ee=t.current;if(ee===null)return;let ce={video:ee,...n!==void 0?{assetBaseUrl:n}:{}},G=r!==void 0?r.liveness(ce):qn(ce);o.current=G;let Ne=s(()=>T(G.facingMode??null),"readFacing");Ne();let De=[G.on("state",b=>{b==="mode_switch"?z(!0):b!=="starting"&&b!=="gating"&&z(!1),b==="starting"?(ge.current!=="starting"&&(he.current+=1,W(Math.max(0,he.current))),k(null),A(null),p(_r),R(!1),N(!1),q(null),x(null),F.current=null):b==="gating"&&ge.current==="recording"&&(R(!1),N(!1),q(null),F.current=null),ge.current=b,Ne(),d(b),ne.current.onStateChange?.(b)}),G.on("gate",b=>{let ke=F.current;F.current=b.progress,N(ke!==null&&b.progress<ke-.001&&b.progress>0&&b.progress<1),b.progress>=1&&R(!0),p(b)}),G.on("frozen",({previewDataUrl:b})=>q(b)),G.on("profile",({animations:b})=>X(b==="reduced")),G.on("ramp",({colour:b})=>x(b)),G.on("captured",b=>{k(b),$(null),ne.current.onCaptured?.(b)}),G.on("error",b=>{A(b);let ke=r?.reportCaptureIssue;ke!==void 0&&bt(Ee=>ke.call(r,Ee),kr("liveness",b,Math.max(0,he.current))),ne.current.onError?.(b)}),r?.on("result",b=>{$(b),ne.current.onResult?.(b)})];return()=>{for(let b of De)b?.();o.current=null,G.destroy()}},[r,t,n]);let E=(0,L.useCallback)(()=>{o.current?.start()},[]),xe=(0,L.useCallback)(()=>{o.current?.retry()},[]),ve=(0,L.useCallback)(async()=>{let ee=o.current;return ee===null||typeof ee.canSwitchCaptureMode!="function"?!1:await ee.canSwitchCaptureMode().catch(()=>!1)===!0},[]),V=(0,L.useCallback)(async ee=>{let ce=o.current;if(ce===null||typeof ce.setCaptureMode!="function")return!1;let G=await ce.setCaptureMode(ee).catch(()=>!1)===!0;return G&&T(ce.facingMode??null),G},[]);return{state:c,gate:S,draining:w,gateLocked:j,frozenPreview:O,reduceMotion:M,rampColour:h,artifacts:C,error:u,result:I,facingMode:i,start:E,retry:xe,canSwitchCaptureMode:ve,setCaptureMode:V,modeRestarted:P,attempt:Y}}l(tn,"er");s(tn,"useLivenessHandle");var Vn=new Set(["national_number"]);function Nt(e){if(e==null||!e.available||e.selected!==null)return null;let t=e.options.filter(n=>Vn.has(n));return t.length>0?{...e,options:t}:null}l(Nt,"tr");s(Nt,"pending");function rn(e){let[t,n]=(0,me.useState)(null),[r,a]=(0,me.useState)(e===void 0),[o,c]=(0,me.useState)(!1),[d,S]=(0,me.useState)(!1);(0,me.useEffect)(()=>{if(n(null),e===void 0){a(!0);return}let N=!0,j=e.methodChoice;typeof j=="function"?(a(!1),Promise.resolve().then(()=>j.call(e)).then(O=>{N&&n(Nt(O))},()=>{}).finally(()=>{N&&a(!0)})):a(!0);let R=e.on("method",O=>n(Nt(O)));return()=>{N=!1,R()}},[e]);let p=(0,me.useCallback)(async N=>{if(e===void 0)return!1;c(!0),S(!1);try{return await e.selectMethod(N),n(null),!0}catch{return S(!0),!1}finally{c(!1)}},[e]),w=t!==null&&t.options.length===1?t.options[0]:null;return{choice:t,auto:w==="national_number"&&!d?w:null,settled:r,busy:o,failed:d,select:p}}l(rn,"nr");s(rn,"useMethodChoice");var $n=["ar","fr","en"];function nn(e){if(typeof e!="string")return!1;try{let t=new URL(e);return t.protocol==="https:"||t.protocol==="http:"&&/^(localhost|127\.0\.0\.1)$/.test(t.hostname)}catch{return!1}}l(nn,"so");s(nn,"isClipUrl");function sn(e){let t=e.clips;if(typeof t!="object"||t===null)return null;let n={};for(let r of $n){let a=t[r];if(!(typeof a!="object"||a===null))for(let[o,c]of Object.entries(a))!st(o)||!nn(c)||((n[r]??(n[r]={}))[o]=c)}return Object.keys(n).length>0?n:null}l(sn,"io");s(sn,"toVoiceClipMap");function an(e){let[t,n]=(0,Te.useState)(null);(0,Te.useEffect)(()=>{if(n(null),e===void 0)return;let a=!0,o=s(d=>{if(!a)return;let S=typeof d=="object"&&d!==null&&typeof d.setId=="string"?d:null;n(p=>p?.setId===S?.setId?p:S)},"take");try{typeof e.voiceClips=="function"&&Promise.resolve(e.voiceClips()).then(o,()=>o(null))}catch{o(null)}let c=e.on("view",d=>o(d.voice));return()=>{a=!1,c()}},[e]);let r=(0,Te.useMemo)(()=>t!==null?sn(t):null,[t]);return e===void 0?null:r}l(an,"rr");s(an,"useServerVoiceClips");function ln({voice:e}){let t=Ae();return(0,Rt.jsx)(te,{kind:"chip","aria-pressed":e.enabled,"aria-label":t("capture.voiceGuidance"),"data-testid":"sekyro-voice-toggle",onClick:l(()=>e.toggle(),"onClick"),children:(0,Rt.jsx)(nt,{off:!e.enabled,className:"sekyro-icon"})})}l(ln,"sr");s(ln,"VoiceChip");var Fn=new Set(["abandoned","not_opened","cancelled","superseded"]),Dn=800,Gn="capture.lookAtColours";function on(e){return e===void 0||e!==!1&&e.length===Ct.length&&Ct.every(t=>e.includes(t))}l(on,"fo");s(on,"isDefaultTips");function cn(e){if(e.type==="keydown"&&e.key==="Escape")return!1;let t=globalThis.navigator?.userActivation;return t===void 0?!(e.type==="pointerup"&&e.pointerType==="touch"):t.isActive}l(cn,"mo");s(cn,"carriesActivation");function un(e){return typeof e=="object"&&e!==null&&!(0,m.isValidElement)(e)&&"tone"in e&&"text"in e}l(un,"yo");s(un,"isNoticeObject");var Hn=new Set(["nni_unbound","id_number_unbound","method_required","mobile_required","portrait_required"]);function dn(e){return e==="starting"||e==="gating"||e==="recording"||e==="mode_switch"}l(dn,"ho");s(dn,"isCapturing");function pn(e){return e==="captured"||e==="uploading"||e==="checking"}l(pn,"vo");s(pn,"isPostCapture");function Kn({verification:e,locale:t,dir:n,strings:r,slots:a,autoStart:o=!1,notice:c,startDisabled:d=!1,startLabel:S,tips:p,tipsSummary:w,coach:N,voice:j,onGuidance:R,onCaptured:O,onResult:q,onError:M,onStateChange:X,assetBaseUrl:h,className:x}){let C=dr(t),k=(0,m.useMemo)(()=>ur(t,r),[t,r,C]),u=(0,m.useMemo)(()=>g=>k[g]??"",[k]),A=n??(t==="ar"?"rtl":"ltr"),I=(0,m.useRef)(null),$=(0,m.useContext)(Un),i=tn({verification:e,videoRef:I,assetBaseUrl:h,onCaptured:O,onResult:q,onError:M,onStateChange:X}),T=en(h,i.state==="idle"&&i.error===null),P=rn(e),z=P.choice!==null,F=Wr(e),ge=Jr(e),he=Xr(e),Y=Yr(),W=Qr(e),ne=W.session==="choice",E=W.mode==="assisted",xe=j!==!1&&j?.clips===void 0,ve=an(xe?e:void 0),V=$r({locale:t,defaultClips:ve,options:j}),ee=E?"environment":"user",ce=W.settled,G=(0,m.useRef)(null),Ne=(0,m.useRef)(!1),De=(0,m.useRef)(V.unlock);De.current=V.unlock,(0,m.useEffect)(()=>{let g=G.current;if(g===null)return;let ae=["pointerup","touchend","click","keydown"],Ce=s(()=>{for(let qe of ae)g.removeEventListener(qe,Me,!0)},"disarm");function Me(qe){if(Ne.current){Ce();return}cn(qe)&&(Ne.current=!0,Ce(),De.current())}l(Me,"Re"),s(Me,"onGesture");for(let qe of ae)g.addEventListener(qe,Me,{capture:!0,passive:!0});return Ce},[]);let b=(0,m.useCallback)(()=>{Ne.current||(Ne.current=!0,V.unlock()),i.start()},[V.unlock,i.start]),ke=(0,m.useCallback)(()=>i.start(),[i.start]),Ee=(0,m.useRef)(!1),Pe=i.state==="idle"&&i.error===null,Ut=!z&&!F.required&&(o===!0||o==="when-permitted"&&Y.permission==="granted"),jt=Ut&&P.settled&&F.settled&&ce,mn=o==="when-permitted"&&!Y.permissionSettled&&!Ee.current,Tt=Ut&&Pe&&!Ee.current,ut=(mn||Tt||!ce)&&T.gate==="ready"?"loading":T.gate;(0,m.useEffect)(()=>{!jt||!Pe||T.gate!=="ready"||Ee.current||(Ee.current=!0,ke())},[jt,Pe,T.gate,ke]);let yn=Pe&&!z&&!F.required&&!(Tt&&T.gate==="ready"),[Pt,Bt]=(0,m.useState)(!1),{canSwitchCaptureMode:Ot,setCaptureMode:qt}=i;(0,m.useEffect)(()=>{if(!W.settled||!ne){Bt(!1);return}let g=!0;return Ot().then(ae=>{g&&Bt(ae)}),()=>{g=!1}},[W.settled,ne,Ot]);let{choose:Vt}=W,Ie=E?"self":"assisted",gn=(0,m.useCallback)(async()=>{await qt(Ie)&&Vt(Ie)},[qt,Vt,Ie]),$t=i.state!=="idle"&&i.facingMode!==null?i.facingMode:ee;(0,m.useEffect)(()=>{let g=I.current?.style;$t==="user"?g?.removeProperty("transform"):g&&(g.transform="none")},[$t]);let Ge=(0,m.useMemo)(()=>i.artifacts!==null&&typeof URL.createObjectURL=="function"?URL.createObjectURL(i.artifacts.keyframe):null,[i.artifacts]);(0,m.useEffect)(()=>{if(Ge!==null)return()=>URL.revokeObjectURL(Ge)},[Ge]);let Ft=i.frozenPreview??Ge,Ue=e!==void 0,Z=dn(i.state),be=pn(i.state),He=Z||be,se=i.result,Dt=i.state==="done"&&se!==null,Ke=Z&&i.rampColour!==null,dt=i.state==="recording"&&i.frozenPreview!==null&&!Ke,Ze=$!==null,Gt=Pt&&Z&&!dt?{to:Ie,label:u(Ie==="assisted"?"capture.modeSwitch.toAssisted":"capture.modeSwitch.toSelf"),description:u(Ie==="assisted"?"capture.modeSwitch.toAssistedLabel":"capture.modeSwitch.toSelfLabel"),onSwitch:s(()=>{gn()},"onSwitch")}:null,ze=i.modeRestarted&&Z?u("capture.modeSwitch.restarted"):null,Be=be||dt,Ht=be?"checking":dt?"frozen":i.state==="recording"||Ke?"recording":i.gateLocked||i.gate.progress>=1?"locked":i.gate.faceDetected?"aligning":"seeking",Ye=Z?i.gate.hint:null,We=i.state==="starting"?"capture.preparing.title":Ye===null?null:Ye==="center"&&!i.gate.faceDetected?"fcv3.no_face":lr(Ye),[vn,Kt]=(0,m.useState)(null);(0,m.useEffect)(()=>{if(We!=="fcv3.no_face"){Kt(We);return}if(!Z)return;let g=setTimeout(()=>Kt(We),Dn);return()=>clearTimeout(g)},[We,Z]);let pt=Z&&!Ke&&typeof N=="string"&&N!=="",Zt=E&&Z?u("capture.assisted.stage"):null,Re=Z&&!pt?Ke?Gn:vn:null,ht=pt?N:Re===null?"":u(Re);Fr(V,Re,ht,Z);let zt=(0,m.useRef)(R);zt.current=R,(0,m.useEffect)(()=>{if(st(Re))try{zt.current?.(Re)}catch(g){console.error("[@sekyro/react] onGuidance threw:",g)}},[Re]);let Oe=(0,m.useMemo)(()=>({supported:V.supported,enabled:V.enabled,setEnabled:V.setEnabled,toggle:V.toggle}),[V.supported,V.enabled,V.setEnabled,V.toggle]),ft=a?.voicePrompt,Yt=ft!==void 0,Wt=j===void 0,Jt=(0,m.useRef)(!1);(0,m.useEffect)(()=>{!Yt||!Wt||Jt.current||!Lt()||(Jt.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."))},[Yt,Wt]);let kn=ft!==void 0?(g,ae,Ce)=>ft(g,ae,Ce,Oe):V.supported?()=>(0,v.jsx)(ln,{voice:Oe}):void 0,{summary:mt,summaryPlaying:Qt,toggleSummary:Xt,stopSummary:er}=V,Je=w!==void 0&&w!=="",tr=Je?w:u("capture.tips.summary"),rr=Je?mt!=="none":mt==="partner"||mt==="default"&&on(p),bn=(0,m.useMemo)(()=>rr?{playing:Qt,toggle:s(()=>Xt(tr,{clip:!Je}),"toggle"),stop:er}:void 0,[rr,Qt,Xt,tr,er,Je]),_n=(0,m.useMemo)(()=>({assets:ut,retryAssets:T.retry,permission:Y.permission,permissionSettled:Y.permissionSettled,captureMode:W.mode,facing:ee,voice:Oe}),[ut,T.retry,Y.permission,Y.permissionSettled,W.mode,ee,Oe]),Cn=un(c)?(0,v.jsx)(le,{tone:c.tone,testId:"sekyro-host-notice",children:(0,v.jsx)("span",{children:c.text})}):c??null,ue=se!==null&&se.status==="retry"?se:null,H=Dt&&se.status==="unavailable"&&!z&&se.reasonCode!=="portrait_required"?se:null,_e=Dt&&(se.status==="verified"||se.status==="not_verified"||se.status==="review")?se:null,yt=s((g,ae)=>{if(g===void 0)return null;if(g==="device_cooldown"){let Me=ir(t,ae);if(Me!==null)return u(Me.key).replace("{time}",Me.time)}let Ce=et(g);return Ce===null?null:u(Ce)},"reasonText"),gt=s(g=>{let ae=g.retakeHint===void 0?null:Xe(g.retakeHint);return ae===null?yt(g.reasonCode):u(ae)},"retryText"),nr=_e===null?null:yt(_e.reasonCode,_e.retryAfter)??(_e.status==="not_verified"&&_e.reason!==void 0&&Fn.has(_e.reason)?u("errors.session_expired"):null),wn=H!==null&&H.reasonCode!==void 0&&H.reasonCode!=="nni_unbound"&&H.reasonCode!=="id_number_unbound"&&H.reasonCode!=="method_required"&&H.reasonCode!=="mobile_required"&&!(H.reasonCode==="no_recorder"&&i.artifacts?.degraded==="NO_RECORDER"),Qe=H?.reasonCode,sr=i.attempt;(0,m.useEffect)(()=>{H===null||Qe===void 0||e?.reportCaptureIssue===void 0||Hn.has(Qe)||bt(g=>e.reportCaptureIssue?.(g),{check:"liveness",kind:"unavailable",phase:"upload",engineKind:Qe,attempt:Math.min(1e3,sr)})},[H,Qe,sr,e]);let ar=kt(),Sn=z&&P.auto===null&&!Z&&!be&&i.error===null,vt=(0,m.useCallback)(async g=>{await P.select(g)&&i.state==="done"&&i.retry()},[P.select,i.state,i.retry]);return(0,m.useEffect)(()=>{P.auto!==null&&!P.busy&&!Z&&!be&&vt(P.auto)},[P.auto,P.busy,Z,be,vt]),(0,v.jsx)(pr,{value:u,children:(0,v.jsxs)("div",{ref:G,className:x===void 0?"sekyro-capture":`sekyro-capture ${x}`,dir:A,lang:t,"data-testid":"sekyro-liveness-capture","data-state":i.state,children:[a?.header,ue!==null&>(ue)!==null&&!(Ze&&He)?(0,v.jsx)(le,{tone:"warning",role:"status",testId:"sekyro-retry-notice",children:(0,v.jsx)("span",{children:gt(ue)})}):null,ze!==null&&!Ze?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mode-switch-status",children:(0,v.jsx)("span",{children:ze})}):null,he&&be&&!Ze?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-busy-notice",children:(0,v.jsx)("span",{children:u("capture.busy")})}):null,F.required&&Pe?(0,v.jsx)(le,{tone:"info",role:"status",testId:"sekyro-mobile-required",children:(0,v.jsx)("span",{children:u("reasons.mobile_required")})}):null,i.error!==null?a?.errorPanel!==void 0?a.errorPanel(i.error,i.retry):(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-error-notice",children:[(0,v.jsx)("span",{children:u(or(i.error))}),i.error.retryable?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u("common.retry")}):null]}):null,H!==null?(0,v.jsxs)(le,{tone:"danger",testId:"sekyro-unavailable-notice",children:[(0,v.jsx)("span",{children:(H.reasonCode==="attestation"&&H.attestationError==="clock_wrong"?u("errors.device_clock"):yt(H.reasonCode))??u(H.reasonCode===void 0?"errors.session_expired":"errors.network_error")}),wn?(0,v.jsx)(te,{ref:ar,kind:"ghost",className:"sekyro-btn--start",onClick:i.retry,children:u(H.reasonCode==="attestation"?"common.retry":"capture.recordAgain")}):null]}):null,nr!==null&&_e!==null?(0,v.jsx)(le,{tone:_e.status==="not_verified"?"danger":"info",testId:"sekyro-result-notice",children:(0,v.jsx)("span",{children:nr})}):null,(0,v.jsx)("div",{className:He?void 0:"sekyro-hidden","data-capture-live":He?"":void 0,children:Ze?$({videoRef:I,guidance:Be&&Ue?u("capture.checking"):ht,coached:pt&&!(Be&&Ue),note:Be?Ue?u(he?"capture.busy":"capture.checkingHint"):null:ze??(ue!==null?gt(ue):Zt),settled:Be&&Ue,progress:i.gate.progress,phase:Ht,still:Be?Ft:null,live:He,modeSwitch:Gt,...Pt?{status:ze}:{},ramp:i.rampColour===null?null:{colour:i.rampColour}}):(0,v.jsx)(hr,{videoRef:I,guidanceText:ht,guidanceHint:Ye,guidanceKey:Re,progress:i.gate.progress,phase:Ht,draining:i.draining,stillUrl:Ft,showChecking:Ue,operatorText:Zt,voicePrompt:kn,overlay:l(g=>(0,v.jsxs)(v.Fragment,{children:[a?.stageOverlay?.(g),(0,v.jsx)(fr,{colour:i.rampColour})]}),"overlay"),reduceMotion:i.reduceMotion,modeSwitch:Gt})}),Sn&&P.choice!==null?(0,v.jsx)(Ur,{title:u("method.title"),description:u("method.description"),options:P.choice.options.map(g=>({id:g,label:u(`method.${g}`)})),busy:P.busy,error:P.failed?u("errors.network_error"):null,focus:i.state==="done",testId:"sekyro-method",look:"buttons",onChoose:l(g=>{vt(g)},"onChoose")}):null,yn?(0,v.jsxs)(v.Fragment,{children:[ge&&a?.header===void 0&&a?.intro===void 0?(0,v.jsxs)("div",{className:"sekyro-stack sekyro-stack--1",children:[(0,v.jsx)("h2",{className:"sekyro-text-body",children:u("returning.title")}),(0,v.jsx)("p",{className:"sekyro-text-muted",children:u("returning.description")})]}):null,Cn,a?.intro!==void 0?a.intro(b,_n):(0,v.jsx)(Zr,{assets:ut,onRetryAssets:T.retry,permission:Y.permission,captureMode:W.mode,voice:Oe,tips:p??Ct,summary:bn,startLabel:S,startDisabled:d,onStart:b})]}):null,(0,v.jsx)(Dr,{showCoaching:ue!==null,coaching:lt(ue?.reasonCode),attemptsText:ue?.attemptsRemaining!==void 0?cr(k,t,ue.attemptsRemaining):null,showRetake:ue!==null&&!Z&&!be||!Ue&&i.state==="captured",onRetake:i.retry}),a?.footer]})})}l(Kn,"xi");s(Kn,"LivenessCapture");var It=U(K(),1),ct=U(K(),1),f=U(de(),1);import{isInAppBrowser as es}from"@sekyro/web/client";var ks={document:"card",population_registry:"id",national_eid:"smartphone",phone_otp:"phone",email_otp:"email"},bs={population_registry:"hashtag",national_eid:"key"};function Zn(e,t){switch(e.service){case"document":return t.t("method.document_photo");case"population_registry":return t.t("method.national_number");case"national_eid":{let n=e.nationalEid?.providerName;return n?t.t("method.national_eid",{provider:n}):t.t("method.national_eidGeneric")}default:return null}}l(Zn,"D");s(Zn,"identityLabel");function zn(e,t){let[n,r]=(0,It.useState)(!1),[a,o]=(0,It.useState)(null);return{busy:n,error:a,run:s(c=>{r(!0),o(null),c().then(()=>r(!1),d=>{r(!1),o(e.t(br(d,e.strings))),t?.(d)})},"run")}}l(zn,"q");s(zn,"useChoiceAction");function hn(){let e=`sekyro-face-light-${(0,ct.useId)().replace(/[^A-Za-z0-9_-]/g,"")}`;return(0,f.jsxs)("svg",{className:"sekyro-mark sekyro-mark--face",viewBox:"0 0 168 206","aria-hidden":"true",focusable:"false",children:[(0,f.jsx)("defs",{children:(0,f.jsx)("mask",{id:e,children:(0,f.jsx)("ellipse",{className:"sekyro-mark__arc",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"1",fill:"none",stroke:"#fff",strokeWidth:"16"})})}),(0,f.jsx)("ellipse",{cx:"84",cy:"103",rx:"64",ry:"83",fill:"none",className:"sekyro-mark__line"}),(0,f.jsx)("path",{className:"sekyro-mark__face",d:"M68 64v10M100 64v10M84 66v25q0 2-6 1M60 108q24 18 48 0"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56"}),(0,f.jsx)("ellipse",{className:"sekyro-mark__ticks sekyro-mark__ticks--light",cx:"84",cy:"103",rx:"76",ry:"95",pathLength:"56",mask:`url(#${e})`})]})}l(hn,"O");s(hn,"FaceMark");var Yn={glasses:"jGlasses",lighting:"light",faceCamera:"camera"};function Wn(e){if(!(e?.kind!=="liveness"||e.reason===void 0))return{reason:e.reason,...e.retakeHint!==void 0?{retakeHint:e.retakeHint}:{},attemptsRemaining:e.attemptsRemaining??0,attemptsExhausted:e.attemptsExhausted===!0}}l(Wn,"ne");s(Wn,"faceIntroRetryOf");var Jn={"capture.retryFrontCamera.screenSide":"camera","capture.retryBackCamera.backSide":"camera","capture.retryUpright.vertical":"smartphone","capture.retryUpright.untilEnd":"smartphone","capture.retryRecording.cameraOn":"camera","capture.retryRecording.stay":"smartphone","capture.retryRecording.network":"smartphone","capture.retryDevice.screenRecording":"smartphone","capture.retryDevice.phone":"smartphone"};function Qn({start:e,context:t,tips:n,tipsTitle:r,human:a=!1,returning:o=!1,notice:c,retry:d}){let S=_t(),{t:p}=S,w=d===void 0?"face":lt(d.reason),N=w==="face"?null:Fe[w].tips,j=(0,ct.useContext)(yr)?.busy===!0;return(0,f.jsxs)("section",{className:"sekyro-step",children:[(0,f.jsx)(hn,{}),t.captureMode==="assisted"?(0,f.jsx)(tt,{title:p("capture.assisted.heading"),lead:p("capture.assisted.lead")}):o?(0,f.jsx)(tt,{title:p("returning.heading"),lead:p("returning.description")}):(0,f.jsx)(tt,{title:p(a?"native.face.humanIntroTitle":"native.face.introTitle"),lead:p(a?"native.face.humanIntroLead":"native.face.introLead")}),d!==void 0?(0,f.jsx)(fn,{retry:d,title:Fe[w].title}):null,r!==void 0&&N===null?(0,f.jsx)("p",{className:"sekyro-section-label",children:r}):null,(0,f.jsx)("ul",{className:"sekyro-tiprows",children:N!==null?N.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Jn[R]??"face"}),p(R)]},R)):n!==void 0?n.map(R=>(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:Yn[R.id]??"face"}),R.text]},R.id)):(0,f.jsxs)(f.Fragment,{children:[(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"light"}),p("capture.tips.light")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"jGlasses"}),p("capture.tips.uncover")]}),(0,f.jsxs)("li",{children:[(0,f.jsx)(Le,{name:"smartphone"}),p("capture.tips.eyeLevel")]})]})}),c??null,c!==void 0?null:t.assets==="failed"?(0,f.jsx)(te,{kind:"secondary",full:!0,onClick:t.retryAssets,children:p("common.retry")}):null,c!==void 0?null:(0,f.jsx)(mr,{children:(0,f.jsxs)(te,{full:!0,disabled:t.assets!=="ready"||j,"aria-busy":t.assets==="loading"||void 0,onClick:e,children:[(0,f.jsx)(Le,{name:"camera"}),p("capture.start")]})})]})}l(Qn,"re");s(Qn,"FaceIntro");var Xn=new Set(["match_inconclusive","no_face_source","below_threshold"]);function fn({retry:e,title:t}){let n=_t(),r=e.retakeHint===void 0?null:Xe(e.retakeHint),a=e.reason==="probe_not_from_liveness"?"capture.retrySamePerson.message":Xn.has(e.reason)?"capture.retryMatch.message":et(e.reason);return(0,f.jsxs)(gr,{tone:"warning",children:[r!==null?(0,f.jsx)("span",{children:n.t(r)}):a!==null?(0,f.jsx)("span",{children:n.t(a)}):null,r===null?(0,f.jsx)("span",{children:n.t(t)}):null,(0,f.jsx)("span",{children:vr(n,e.attemptsRemaining,e.attemptsExhausted)})]})}l(fn,"K");s(fn,"RetryNotice");function ts(e){return es(e)}l(ts,"ce");s(ts,"isInAppBrowser");function rs(e,t){let n=t??(typeof navigator>"u"?"":String(navigator.userAgent??""));if(!/Android/i.test(n))return null;let r;try{r=new URL(e)}catch{return null}if(r.protocol!=="https:"&&r.protocol!=="http:")return null;let a=r.protocol.slice(0,-1);return`intent://${r.host}${r.pathname}${r.search}#Intent;scheme=${a};action=android.intent.action.VIEW;S.browser_fallback_url=${encodeURIComponent(e)};end`}l(rs,"le");s(rs,"androidBrowserIntent");export{Ur as a,Lt as b,Un as c,Qr as d,Kn as e,ks as f,bs as g,Zn as h,zn as i,Wn as j,Qn as k,ts as l,rs as m};
|