@tsocial/tvweb-sdk.platform 5.38.2 → 5.38.3
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/build/esm/{chunk-7618f5a4.js → chunk-01c3fea1.js} +1 -1
- package/build/esm/chunk-2da8af58.js +1 -0
- package/build/esm/{chunk-3aa490f8.js → chunk-3a5e2fb7.js} +32 -32
- package/build/esm/chunk-443bbdef.js +1 -0
- package/build/esm/chunk-4c589d01.js +1 -0
- package/build/esm/{chunk-30dc9915.js → chunk-6000df97.js} +1 -1
- package/build/esm/chunk-62203103.js +1 -0
- package/build/esm/chunk-6c419352.js +1 -0
- package/build/esm/{chunk-da8ef78b.js → chunk-7b148a15.js} +5 -5
- package/build/esm/{chunk-48199d95.js → chunk-7fd5f30f.js} +2 -2
- package/build/esm/chunk-83b4e661.js +256 -0
- package/build/esm/{chunk-7fa83a52.js → chunk-85c7fccc.js} +1 -1
- package/build/esm/chunk-973e0c2c.js +1195 -0
- package/build/esm/{chunk-036bae4b.js → chunk-9a57dffd.js} +1 -1
- package/build/esm/{chunk-2118775a.js → chunk-cb78319b.js} +2 -2
- package/build/esm/chunk-df1a18df.js +1 -0
- package/build/esm/chunk-e6f33641.js +1 -0
- package/build/esm/chunk-ea488e70.js +1 -0
- package/build/esm/chunk-ec455fe3.js +3 -0
- package/build/esm/chunk-fc1ca1ea.js +1 -0
- package/build/esm/tvweb-sdk.platform.esm.min.js +1 -1
- package/build/tvweb-sdk.platform.cjs.min.js +651 -695
- package/build/tvweb-sdk.platform.standalone.js +5996 -7690
- package/build/tvweb-sdk.platform.standalone.min.js +651 -695
- package/build/types/index.d.ts +1 -9
- package/package.json +5 -5
- package/build/esm/chunk-0319b1ae.js +0 -45
- package/build/esm/chunk-2b4d00a3.js +0 -3
- package/build/esm/chunk-3b109c2f.js +0 -1
- package/build/esm/chunk-409b3310.js +0 -1
- package/build/esm/chunk-51b3fd2d.js +0 -1
- package/build/esm/chunk-6e5358d6.js +0 -1
- package/build/esm/chunk-71508ce2.js +0 -1
- package/build/esm/chunk-71ff4107.js +0 -1
- package/build/esm/chunk-88ec0901.js +0 -256
- package/build/esm/chunk-91b54c2c.js +0 -1
- package/build/esm/chunk-c747321c.js +0 -1195
- package/build/esm/chunk-d7bc8179.js +0 -1
- package/build/esm/chunk-ddb14dfb.js +0 -1
- package/build/esm/chunk-e5a92416.js +0 -1
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
import{aL as e,w as i,aM as r,aN as t,aO as o,e as s,n as n,ai as a,aj as l,aP as d,af as c,aQ as g,Y as f,r as u,H as h,P as p,z as m,s as _,V as b,j as w,o as v,v as k,B as R,b as y,aR as S}from"./chunk-973e0c2c.js";import{r as C,f as x,g as $,h as j,i as W,j as O,k as I,l as E,n as A,o as D,p as T}from"./chunk-62203103.js";var P,L,V,z,M,B,F,N,H,U,q,K,J,Y,Z,G,Q,X,ee,ei,er,et,eo,es,en,ea,el,ed,ec,eg,ef,eu,eh,ep,em=Object.freeze({__proto__:null,blink:e,flipY:i,slide:r,spin:t,splash:o});let e_=({curStep:e,faceDirection:i})=>{let r=n(e,"stepTimeConstraints.delayTime");return!!r&&(null===e.firstFrameSpottedAt?(e.name===i&&(e.firstFrameSpottedAt=new Date().getTime()),!0):!!(new Date().getTime()-e.firstFrameSpottedAt<r)||!1)},eb=(e,i)=>({radius:e.radius??s("Selfie.progressCircle.radius")({theme:i}),strokeWidth:e.strokeWidth??s("Selfie.progressCircle.strokeWidth")({theme:i}),progress:e.progress??s("Selfie.progressCircle.progress")({theme:i}),showErrorRing:e.showErrorRing??s("Selfie.progressCircle.showErrorRing")({theme:i}),activeColor:e.activeColor??s("Selfie.progressCircle.activeColor")({theme:i}),innerPadding:e.innerPadding??s("Selfie.progressCircle.innerPadding")({theme:i}),outsideRingColor:e.outsideRingColor??s("Selfie.progressCircle.outsideRingColor")({theme:i}),outsideRingOpacity:e.outsideRingOpacity??s("Selfie.progressCircle.outsideRingOpacity")({theme:i}),insideRingColor:e.insideRingColor??s("Selfie.progressCircle.insideRingColor")({theme:i}),insideRingWidth:e.insideRingWidth??s("Selfie.progressCircle.insideRingWidth")({theme:i}),insideRingStrokeDash:e.insideRingStrokeDash??s("Selfie.progressCircle.insideRingStrokeDash")({theme:i}),errorRingWidth:e.errorRingWidth??s("Selfie.progressCircle.errorRingWidth")({theme:i}),errorRingColor:e.errorRingColor??s("Selfie.progressCircle.errorRingColor")({theme:i}),dashedRingColor:e.dashedRingColor??s("Selfie.progressCircle.dashedRingColor")({theme:i}),dashedRingOpacity:e.dashedRingOpacity??s("Selfie.progressCircle.dashedRingOpacity")({theme:i}),dashedRingWidth:e.dashedRingWidth??s("Selfie.progressCircle.dashedRingWidth")({theme:i}),dashedRingLineThick:e.dashedRingLineThick??s("Selfie.progressCircle.dashedRingLineThick")({theme:i}),dashedRingLineSpacing:e.dashedRingLineSpacing??s("Selfie.progressCircle.dashedRingLineSpacing")({theme:i}),dashedInsideRingColor:e.dashedInsideRingColor??s("Selfie.progressCircle.dashedInsideRingColor")({theme:i}),dashedInsideRingWidth:e.dashedInsideRingWidth??s("Selfie.progressCircle.dashedInsideRingWidth")({theme:i}),showOutsideRing:e.showOutsideRing??s("Selfie.progressCircle.showOutsideRing")({theme:i}),showInsideRing:e.showInsideRing??s("Selfie.progressCircle.showInsideRing")({theme:i}),showDashedRing:e.showDashedRing??s("Selfie.progressCircle.showDashedRing")({theme:i})}),ew=(e,i)=>({radius:e.radius??s("Selfie.progressCircleV2.radius")({theme:i}),strokeWidth:e.strokeWidth??s("Selfie.progressCircleV2.strokeWidth")({theme:i}),progress:e.progress??s("Selfie.progressCircleV2.progress")({theme:i}),activeColor:e.activeColor??s("Selfie.progressCircleV2.activeColor")({theme:i}),neutralColor:e.neutralColor??s("Selfie.progressCircleV2.neutralColor")({theme:i}),errorColor:e.errorColor??s("Selfie.progressCircleV2.errorColor")({theme:i}),tickWidth:e.tickWidth??s("Selfie.progressCircleV2.tickWidth")({theme:i}),numberOfTicks:e.numberOfTicks??s("Selfie.progressCircleV2.numberOfTicks")({theme:i})}),ev=({incomingFrame:e,currentBestFrame:i})=>e?.isEyeClosed&&!i?.isEyeClosed?i:!e?.isEyeClosed&&i?.isEyeClosed?e:e?.blurScore>i?.blurScore?e:i;function ek(e){return new Promise(i=>{let r=new Image;r.onload=i,r.onerror=i,r.src=e})}function eR(){if(z)return V;z=1;var e=a(),i=l(),r=j();return V=function(t){if(!i(t))return!1;var o=e(t);return"[object Error]"==o||"[object DOMException]"==o||"string"==typeof t.message&&"string"==typeof t.name&&!r(t)}}function ey(){return ei?ee:(ei=1,ee=/<%=([\s\S]+?)%>/g)}var eS=f(function(){if(ep)return eh;ep=1;var e=function(){if(L)return P;L=1;var e=C(),i=x(),r=$();return P=i(function(i,t,o,s){e(t,r(t),i,s)})}(),i=function(){if(B)return M;B=1;var e=O(),i=W(),r=eR();return M=i(function(i,t){try{return e(i,void 0,t)}catch(e){return r(e)?e:Error(e)}})}(),r=function(){if(N)return F;N=1;var e=d();return F=function(i,r){return e(r,function(e){return i[e]})}}(),t=function(){if(U)return H;U=1;var e=c(),i=Object.prototype,r=i.hasOwnProperty;return H=function(t,o,s,n){return void 0===t||e(t,i[s])&&!r.call(n,s)?o:t}}(),o=function(){if(K)return q;K=1;var e={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"};return q=function(i){return"\\"+e[i]}}(),s=eR(),n=T(),a=function(){if(X)return Q;X=1;var e=A(),i=function(){if(G)return Z;G=1;var e=E(),i=Y?J:(Y=1,J=I()(Object.keys,Object)),r=Object.prototype.hasOwnProperty;return Z=function(t){if(!e(t))return i(t);var o=[];for(var s in Object(t))r.call(t,s)&&"constructor"!=s&&o.push(s);return o}}(),r=D();return Q=function(t){return r(t)?e(t):i(t)}}(),l=ey(),f=function(){if(eu)return ef;eu=1;var e=function(){if(ea)return en;ea=1;var e=function(){if(es)return eo;es=1;var e=et?er:(et=1,er=function(e){return function(i){return null==e?void 0:e[i]}});return eo=e({"&":"&","<":"<",">":">",'"':""","'":"'"})}(),i=g(),r=/[&<>"']/g,t=RegExp(r.source);return en=function(o){return(o=i(o))&&t.test(o)?o.replace(r,e):o}}(),i=ed?el:(ed=1,el=/<%-([\s\S]+?)%>/g),r=eg?ec:(eg=1,ec=/<%([\s\S]+?)%>/g),t=ey();return ef={escape:i,evaluate:r,interpolate:t,variable:"",imports:{_:{escape:e}}}}(),u=g(),h=/\b__p \+= '';/g,p=/\b(__p \+=) '' \+/g,m=/(__e\(.*?\)|\b__t\)) \+\n'';/g,_=/[()=,{}\[\]\/\s]/,b=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,w=/($^)/,v=/['\n\r\u2028\u2029\\]/g,k=Object.prototype.hasOwnProperty;return eh=function(d,c,g){var R=f.imports._.templateSettings||f;g&&n(d,c,g)&&(c=void 0),d=u(d),c=e({},c,R,t);var y=e({},c.imports,R.imports,t),S=a(y),C=r(y,S),x,$,j=0,W=c.interpolate||w,O="__p += '",I=RegExp((c.escape||w).source+"|"+W.source+"|"+(W===l?b:w).source+"|"+(c.evaluate||w).source+"|$","g"),E=k.call(c,"sourceURL")?"//# sourceURL="+(c.sourceURL+"").replace(/\s/g," ")+"\n":"";d.replace(I,function(e,i,r,t,s,n){return r||(r=t),O+=d.slice(j,n).replace(v,o),i&&(x=!0,O+="' +\n__e("+i+") +\n'"),s&&($=!0,O+="';\n"+s+";\n__p += '"),r&&(O+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),j=n+e.length,e}),O+="';\n";var A=k.call(c,"variable")&&c.variable;if(A){if(_.test(A))throw Error("Invalid `variable` option passed into `_.template`")}else O="with (obj) {\n"+O+"\n}\n";O=($?O.replace(h,""):O).replace(p,"$1").replace(m,"$1;"),O="function("+(A||"obj")+") {\n"+(A?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(x?", __e = _.escape":"")+($?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+O+"return __p\n}";var D=i(function(){return Function(S,E+"return "+O).apply(void 0,C)});if(D.source=O,s(D))throw D;return D}}());let eC=[],ex=()=>{eC=[]},e$=(e,i,r,t)=>{t&&ex(),eC.push({id:null});let o=eC.length-1;if(e&&e.key){let t=new Blob([JSON.stringify(i)]);r.uploadFile({file:t,metadata:JSON.stringify({type:"selfie"}),label:"video"},{"X-TV-Key":e.key}).then(e=>{e&&e.data&&e.data.file_id?eC[o].id=e.data.file_id:eC[o].id=-1})}else{let e=new Blob([JSON.stringify(i)]);r.uploadFile({file:e,metadata:JSON.stringify({type:"selfie"}),label:"video"}).then(e=>{e&&e.data&&e.data.file_id?eC[o].id=e.data.file_id:eC[o].id=-1})}},ej=()=>new Promise(e=>{let i=setInterval(()=>{eC.every(e=>e.id)&&(e(),clearInterval(i))},200)}),eW=e=>e.enable?eC.some(e=>-1===e.id)?null:eC:[],eO=[],eI=null,eE=!1,eA=()=>eO,eD=()=>{eE=!0,eO=[];try{eI instanceof MediaStream&&(eI.getTracks().forEach(e=>e.stop()),eI=null)}catch(e){}};async function eT({outputImagesSize:e,videoEl:i,resultAnalyzeVideoAndWindowSizes:r}){let t;eD();let o=document.createElement("canvas");o.width=e,o.height=e;let s=o.getContext("2d");try{let n={mimeType:"video/webm"};try{let e=(eI=i?.captureStream()?.clone()).getVideoTracks()[0];await e.applyConstraints({width:{min:360,ideal:400},height:{min:360,ideal:400}})}catch(e){}MediaRecorder.isTypeSupported("video/mp4")&&(eE=!1,!function e(i,r,t,o){if(!i||!o)return;let{cropX:s,cropY:n,cropWidth:a,cropHeight:l}=o;i.drawImage(r,s,n,a,l,0,0,t,t),eE||requestAnimationFrame(()=>e(i,r,t,o))}(s,i,e,r),eI=o.captureStream(25),n={mimeType:"video/mp4",videoBitsPerSecond:25e5}),t=new MediaRecorder(eI,n);let a=async()=>{await new Promise((e,i)=>{t.ondataavailable=r=>(function(e,i,r){if(e.data.size>0){let r=new Blob([e.data],{type:"video/mp4"});eO.push(r),i()}else console.error("No video have recored!"),r()})(r,e,i),"inactive"!==t.state&&t.stop()})};t.stopVideoRecording=a,t.discardRecording=()=>{"inactive"!==t.state&&t.stop()}}catch(e){}return{mediaRecorder:t}}let eP={data:{settings:{sdk_settings:{passive_liveness_settings:{auto_capture:{enable:!0,show_capture_button:!0,show_countdown:!0,wait_for_best_image_time_ms_web:3e3},manual_capture:{show_countdown:!0,wait_for_best_image_time_ms_web:3e3},blur_check:{enable:!0,web_blurry_threshold:.4},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5,force_check:!1},web_is_required_frontal_face:!0},active_liveness_settings:{reset_flow_on_orientation_change:!0,wait_before_start_flow_ms:2e3,face_tracking_setting:{enable:!1,web_terminate_threshold:.0030152991993743408,web_warning_threshold:.0017317430600108828,limit_for:"all_flow",max_warning_time:5},flow_interval_time_ms:3e3,take_one_picture_time_ms:3e3,limit_time_liveness_check:{enable:!1,limit_time_second:45,remain_time_show:10,format:"s",max_retry_count:0,non_stoppable:!1},terminate_if_no_face:{enable:!1,max_invalid_frame:5,max_time_ms:1e3},close_eye_detector:{enable:!0,web_threshold:.342,web_timeout:5,force_check:!1},exif_data_settings:{enable:!0},record_video:{enable:!1},save_encoded_frames:{enable:!1,enable_logging:!1,frames_batch_len:0,frames_interval_ms:180,quality_android:90,quality_ios:80},auto_gen_frame_ids:{enable:!1,max_items:50}}}}}},eL=30,eV=e=>{let{shouldStart:i,totalTime:r,totalDelayBetweenReset:t,interruptible:o=!0,onReset:s,onTick:n,onTimesUp:a}=e,l=u.useRef(new h({totalTime:r,totalDelayBetweenReset:t,interruptible:o}));return u.useEffect(()=>l.current.on("tick",({remainTime:e})=>{n({remainTime:e})}),[n]),u.useEffect(()=>l.current.on("delaystart",()=>{a()}),[a]),u.useEffect(()=>l.current.on("reset",({attemptCount:e,fromBackground:i})=>{s({attemptCount:e,fromBackground:i})}),[s]),u.useEffect(()=>i?l.current.start():()=>{},[i]),{stopTimer:u.useCallback(()=>{l.current.stop()},[])}},{ErrorDuration:ez}=_;function eM({children:e,errorMsg:i,className:r}){return b.isValidElement(e)?i?w.jsx("div",{className:r,children:b.cloneElement(e,{errorMsg:i})}):null:i?w.jsx("div",{className:r,children:i}):null}function eB({children:e,className:i,error:r}){let t=u.useRef(0),o=u.useRef(""),s=m(),n=u.useRef(ez.SHORT),{code:a,duration:l=ez.SHORT}=r||{},d=s(a);return Date.now()-t.current>=n.current?(t.current=Date.now(),n.current=l,o.current=d,eM({children:e,errorMsg:d,className:i})):eM({children:e,errorMsg:o.current,className:i})}eB.propTypes={children:p.node,className:p.string},eB.defaultProps={className:""};let eF=v.g`
|
|
2
|
+
transition: stroke-dashoffset 0.4s;
|
|
3
|
+
transform: rotate(-90deg);
|
|
4
|
+
transform-origin: 50% 50%;
|
|
5
|
+
`,eN=v.circle`
|
|
6
|
+
transition: stroke-dashoffset 0.4s, stroke 0.4s;
|
|
7
|
+
transform: rotate(-90deg);
|
|
8
|
+
transform-origin: 50% 50%;
|
|
9
|
+
fill: none;
|
|
10
|
+
`,eH=v.circle`
|
|
11
|
+
transition: stroke-dashoffset 0.4s;
|
|
12
|
+
transform: rotate(-90deg);
|
|
13
|
+
transform-origin: 50% 50%;
|
|
14
|
+
`;function eU({className:e,style:i,radius:r,strokeWidth:t,progress:o,showErrorRing:s,activeColor:n,innerPadding:a,outsideRingColor:l,outsideRingOpacity:d,insideRingColor:c,insideRingWidth:g,insideRingStrokeDash:f,errorRingWidth:u,errorRingColor:h,dashedRingColor:p,dashedRingOpacity:m,dashedRingWidth:_,dashedRingLineThick:b,dashedRingLineSpacing:v,dashedInsideRingColor:k,dashedInsideRingWidth:R,showOutsideRing:y,showInsideRing:S,showDashedRing:C}){let x=2*r,$=2*r,j=r-2*t,W=2*Math.PI*j,O=j-_/2-t/2-a,I=2*Math.PI*O,E=O-R/2-_/2,A=2*Math.PI*E,D=E-g/2-R/2,T=E-u/2-R/2;return w.jsxs("svg",{className:e,style:i,width:x,height:$,viewBox:`0 0 ${x} ${$}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[y?w.jsxs(w.Fragment,{children:[w.jsx("circle",{"data-testid":"outsideRing",opacity:d,cx:r,cy:r,r:j,stroke:l}),w.jsx(eH,{"data-testid":"outsideAnimateRing",cx:r,cy:r,r:j,stroke:n,strokeWidth:t,strokeLinecap:"round",strokeDasharray:`${W} ${W}`,style:{strokeDashoffset:W-o/100*W}})]}):null,C?w.jsxs(w.Fragment,{children:[w.jsx("circle",{"data-testid":"dashedRing",opacity:m,cx:r,cy:r,r:O,stroke:p,strokeWidth:_,strokeDasharray:`${b} ${v}`}),w.jsx("mask",{id:"mask0","mask-type":"alpha",maskUnits:"userSpaceOnUse",children:w.jsx("circle",{cx:r,cy:r,r:O,stroke:n,strokeWidth:_,strokeDasharray:`${b} ${v}`})}),w.jsx("g",{mask:"url(#mask0)",children:w.jsx(eH,{"data-testid":"dashedAnimateRing",cx:r,cy:r,r:O,stroke:n,strokeWidth:_,strokeDasharray:`${I} ${I}`,style:{strokeDashoffset:I-o/100*I}})}),w.jsx("circle",{"data-testid":"dashedInsideRing",opacity:m,cx:r,cy:r,r:E,stroke:k,strokeWidth:R}),w.jsx(eH,{"data-testid":"dashedInsideAnimateRing",cx:r,cy:r,r:E,stroke:n,strokeWidth:R,strokeLinecap:"round",strokeDasharray:`${A} ${A}`,style:{strokeDashoffset:A-o/100*A}})]}):null,S?w.jsx("circle",{"data-testid":"insideRing",strokeDasharray:f,cx:r,cy:r,r:D,stroke:c,strokeWidth:g}):null,s?w.jsx("circle",{"data-testid":"errorRing",strokeDasharray:f,cx:r,cy:r,r:T,stroke:h,strokeWidth:u}):null]})}eU.propTypes={className:p.string,style:p.shape({}),radius:p.number,strokeWidth:p.number,progress:p.number,showErrorRing:p.bool,activeColor:p.string,innerPadding:p.number,outsideRingColor:p.string,outsideRingOpacity:p.number,insideRingColor:p.string,insideRingWidth:p.number,insideRingStrokeDash:p.string,errorRingColor:p.string,errorRingWidth:p.number,dashedRingColor:p.string,dashedRingOpacity:p.number,dashedRingWidth:p.number,dashedRingLineThick:p.number,dashedRingLineSpacing:p.number,dashedInsideRingColor:p.string,dashedInsideRingWidth:p.number,showOutsideRing:p.bool,showDashedRing:p.bool,showInsideRing:p.bool},eU.defaultProps={className:"",style:null,radius:160,strokeWidth:3,progress:0,showErrorRing:!1,activeColor:"#0092ff",innerPadding:5,outsideRingColor:"#f2f6f9",outsideRingOpacity:.1,insideRingColor:"#f2f6f9",insideRingWidth:3,insideRingStrokeDash:"0",errorRingColor:"#df0000",errorRingWidth:3,dashedRingColor:"#ffffff",dashedRingOpacity:.3,dashedRingWidth:10,dashedRingLineThick:1,dashedRingLineSpacing:6,dashedInsideRingColor:"#ffffff",dashedInsideRingWidth:0,showOutsideRing:!0,showDashedRing:!0,showInsideRing:!0};let{blink:eq,slide:eK,spin:eJ}=em,eY=k`
|
|
15
|
+
z-index: ${R+20};
|
|
16
|
+
color: #ffffff;
|
|
17
|
+
`,eZ=v.div`
|
|
18
|
+
${eY}
|
|
19
|
+
`,eG=k`
|
|
20
|
+
${eY}
|
|
21
|
+
${({top:e})=>e&&k`
|
|
22
|
+
top: ${e}px;
|
|
23
|
+
`}
|
|
24
|
+
${({bottom:e})=>e&&k`
|
|
25
|
+
bottom: ${e}px;
|
|
26
|
+
`}
|
|
27
|
+
${({centerY:e})=>e&&k`
|
|
28
|
+
top: 50%;
|
|
29
|
+
transform: translateY(-50%);
|
|
30
|
+
`}
|
|
31
|
+
font-size: ${s("Selfie.error.fontSize")};
|
|
32
|
+
font-weight: ${s("Selfie.error.fontWeight")};
|
|
33
|
+
background: ${s("Selfie.error.backgroundColor")};
|
|
34
|
+
color: ${s("Selfie.error.color")};
|
|
35
|
+
padding: ${s("Selfie.error.padding")};
|
|
36
|
+
border-radius: ${s("Selfie.error.borderRadius")};
|
|
37
|
+
position: absolute;
|
|
38
|
+
white-space: pre-wrap;
|
|
39
|
+
text-align: center;
|
|
40
|
+
max-width: 80%;
|
|
41
|
+
`;v(eB)`
|
|
42
|
+
${eG}
|
|
43
|
+
`;let eQ=v.div`
|
|
44
|
+
${eG}
|
|
45
|
+
`,eX=v.div`
|
|
46
|
+
z-index: ${R+20};
|
|
47
|
+
display: flex;
|
|
48
|
+
align-items: center;
|
|
49
|
+
position: absolute;
|
|
50
|
+
left: 50%;
|
|
51
|
+
transform: translate(-50%, 0);
|
|
52
|
+
${({top:e})=>e&&k`
|
|
53
|
+
top: ${e}px;
|
|
54
|
+
`}
|
|
55
|
+
`,e0=v(eZ)`
|
|
56
|
+
font-size: ${s("Selfie.countdown.fontSize")};
|
|
57
|
+
font-weight: ${s("Selfie.countdown.fontWeight")};
|
|
58
|
+
background: ${s("Selfie.countdown.backgroundColor")};
|
|
59
|
+
color: ${s("Selfie.countdown.color")};
|
|
60
|
+
padding: ${s("Selfie.countdown.padding")};
|
|
61
|
+
border-radius: ${s("Selfie.countdown.borderRadius")};
|
|
62
|
+
white-space: nowrap;
|
|
63
|
+
`,e1=v(e0)`
|
|
64
|
+
position: absolute;
|
|
65
|
+
left: 50%;
|
|
66
|
+
transform: translate(-50%, 0);
|
|
67
|
+
${({top:e})=>e&&k`
|
|
68
|
+
top: ${e}px;
|
|
69
|
+
`}
|
|
70
|
+
`,e2=v(eZ)`
|
|
71
|
+
position: absolute;
|
|
72
|
+
${({top:e})=>e&&k`
|
|
73
|
+
top: ${e}px;
|
|
74
|
+
`}
|
|
75
|
+
${({bottom:e})=>e&&k`
|
|
76
|
+
bottom: ${e}px;
|
|
77
|
+
`}
|
|
78
|
+
color: ${s("Selfie.Active.instruction.color")};
|
|
79
|
+
font-size: ${s("Selfie.Active.instruction.fontSize")};
|
|
80
|
+
font-weight: ${s("Selfie.Active.instruction.fontWeight")};
|
|
81
|
+
text-shadow: ${s("Selfie.Active.instruction.textShadow")};
|
|
82
|
+
background-color: ${s("Selfie.Active.instruction.backgroundColor")};
|
|
83
|
+
border: ${s("Selfie.Active.instruction.border")};
|
|
84
|
+
border-radius: ${s("Selfie.Active.instruction.borderRadius")};
|
|
85
|
+
`,e3=v.div`
|
|
86
|
+
height: ${()=>y.isMobile?"50px":"70px"};
|
|
87
|
+
position: absolute;
|
|
88
|
+
${({top:e})=>e&&k`
|
|
89
|
+
top: ${e}px;
|
|
90
|
+
`}
|
|
91
|
+
${({bottom:e})=>e&&k`
|
|
92
|
+
bottom: ${e}px;
|
|
93
|
+
`}
|
|
94
|
+
width: 100%;
|
|
95
|
+
display: flex;
|
|
96
|
+
justify-content: center;
|
|
97
|
+
align-items: center;
|
|
98
|
+
z-index: ${R+20};
|
|
99
|
+
`,e5=v.div`
|
|
100
|
+
width: ${s("Selfie.Active.imageHolder.width")};
|
|
101
|
+
height: ${s("Selfie.Active.imageHolder.height")};
|
|
102
|
+
border-radius: ${s("Selfie.Active.imageHolder.borderRadius")};
|
|
103
|
+
font-size: ${s("Selfie.Active.imageHolder.fontSize")};
|
|
104
|
+
color: ${s("Selfie.Active.imageHolder.color")};
|
|
105
|
+
font-weight: ${s("Selfie.Active.imageHolder.fontWeight")};
|
|
106
|
+
|
|
107
|
+
${({theme:e})=>"v2"===n(e,"themeVersion")?"border: unset;":`border: ${s("Selfie.Active.imageHolder.border")({theme:e})};`}
|
|
108
|
+
|
|
109
|
+
display: flex;
|
|
110
|
+
justify-content: center;
|
|
111
|
+
align-items: center;
|
|
112
|
+
|
|
113
|
+
& + & {
|
|
114
|
+
margin-left: 10px;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
${e=>e.active?k`
|
|
118
|
+
img:not(.image_preview) {
|
|
119
|
+
border: ${s("Selfie.Active.imageHolder.activeStepBorder")};
|
|
120
|
+
border-radius: ${s("Selfie.Active.imageHolder.activeStepBorderRadius")};
|
|
121
|
+
}
|
|
122
|
+
`:k`
|
|
123
|
+
opacity: 0.3;
|
|
124
|
+
`}
|
|
125
|
+
|
|
126
|
+
img {
|
|
127
|
+
width: 100%;
|
|
128
|
+
margin: 0;
|
|
129
|
+
border-radius: ${s("Selfie.Active.imageHolder.borderRadius")};
|
|
130
|
+
}
|
|
131
|
+
img.image_preview {
|
|
132
|
+
border: ${s("Selfie.Active.imageHolder.border")};
|
|
133
|
+
}
|
|
134
|
+
`,e4=v.div`
|
|
135
|
+
color: #ffffff;
|
|
136
|
+
height: 70px;
|
|
137
|
+
position: absolute;
|
|
138
|
+
bottom: 0;
|
|
139
|
+
width: 100%;
|
|
140
|
+
display: flex;
|
|
141
|
+
justify-content: center;
|
|
142
|
+
align-items: center;
|
|
143
|
+
z-index: ${R+20};
|
|
144
|
+
`,e8=v.div`
|
|
145
|
+
${({disabled:e})=>e?k`
|
|
146
|
+
pointer-events: none;
|
|
147
|
+
`:k`
|
|
148
|
+
cursor: pointer;
|
|
149
|
+
`}
|
|
150
|
+
text-align: center;
|
|
151
|
+
|
|
152
|
+
img {
|
|
153
|
+
width: ${s("Selfie.captureIcon.width")};
|
|
154
|
+
}
|
|
155
|
+
`,e6=v.div`
|
|
156
|
+
position: absolute;
|
|
157
|
+
width: 100%;
|
|
158
|
+
top: 0;
|
|
159
|
+
bottom: 0;
|
|
160
|
+
display: flex;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
align-items: center;
|
|
163
|
+
color: #ffffff;
|
|
164
|
+
font-size: 140px;
|
|
165
|
+
opacity: 0.6;
|
|
166
|
+
`,e9=v.div`
|
|
167
|
+
position: absolute;
|
|
168
|
+
width: 100%;
|
|
169
|
+
top: 0;
|
|
170
|
+
bottom: 0;
|
|
171
|
+
display: flex;
|
|
172
|
+
flex-direction: column;
|
|
173
|
+
justify-content: center;
|
|
174
|
+
align-items: center;
|
|
175
|
+
${eK.default};
|
|
176
|
+
${eq.default};
|
|
177
|
+
`,e7=v(eU)`
|
|
178
|
+
position: absolute;
|
|
179
|
+
top: 0;
|
|
180
|
+
left: 0;
|
|
181
|
+
width: 100%;
|
|
182
|
+
height: 100%;
|
|
183
|
+
`,ie=v(({className:e="",radius:i=80,neutralColor:r="#CBD5E1",activeColor:t="#0276F1",errorColor:o="#E84848",strokeWidth:s=2,tickWidth:n=15,numberOfTicks:a=200,progress:l=0,showErrorRing:d=!1})=>{let c=2*i,g=i-5,f=2*Math.PI*g,u=Array.from({length:a}).map((e,r)=>{let t=360*r/a+3;return w.jsx("use",{href:"#tick",transform:`rotate(${t} ${i} ${i})`},r)}),h=i-eL,p=2*Math.PI*h;return w.jsxs("svg",{height:c,width:c,viewBox:`0 0 ${c} ${c}`,className:e,xmlns:"http://www.w3.org/2000/svg",children:[d?w.jsx("circle",{cx:i,cy:i,r:i-eL,stroke:o,strokeWidth:s,fill:"none"}):w.jsxs(w.Fragment,{children:[w.jsx("circle",{cx:i,cy:i,r:h,stroke:r,strokeWidth:s,fill:"none"}),w.jsx(eN,{cx:i,cy:i,r:h,stroke:t,strokeWidth:s,strokeLinecap:"round",strokeDasharray:`${p} ${p}`,style:{strokeDashoffset:p-l/100*p}})]}),w.jsx("defs",{children:w.jsx("line",{id:"tick",x1:i,y1:"0",x2:i,y2:n,stroke:r,strokeWidth:s,strokeLinecap:"round"})}),w.jsx("g",{id:"border-segments",children:u}),w.jsx("mask",{id:"tickMask",maskUnits:"userSpaceOnUse",children:w.jsx("g",{id:"tick-mask-segments",children:u})}),w.jsx("g",{mask:"url(#tickMask)",children:w.jsx(eF,{strokeDasharray:`${f} ${f}`,style:{strokeDashoffset:f-l/100*f},children:w.jsx("circle",{cx:i,cy:i,r:g,stroke:t,strokeWidth:20,fill:"none"})})})]})})`
|
|
184
|
+
position: absolute;
|
|
185
|
+
top: 0;
|
|
186
|
+
left: 0;
|
|
187
|
+
width: 100%;
|
|
188
|
+
height: 100%;
|
|
189
|
+
`,ii=v(function({className:e=""}){return w.jsx("svg",{className:e,width:"320",height:"320",viewBox:"0 0 320 320",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:w.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M320 0H0V320H320V0ZM160 296C235.111 296 296 235.111 296 160C296 84.8893 235.111 24 160 24C84.8893 24 24 84.8893 24 160C24 235.111 84.8893 296 160 296Z",fill:"currentColor"})})})`
|
|
190
|
+
width: 100%;
|
|
191
|
+
height: 100%;
|
|
192
|
+
vertical-align: middle;
|
|
193
|
+
margin: 0;
|
|
194
|
+
color: ${s("Selfie.backgroundColor")};
|
|
195
|
+
`,ir=v(function({className:e="",radius:i=160,backgroundColor:r="#fff",padding:t=0}){let o=2*i;return w.jsxs("svg",{className:e,width:o,height:o,viewBox:`0 0 ${o} ${o}`,fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[w.jsxs("mask",{id:"CIRCLE_MASK",children:[w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:"white",mask:"url(#CIRCLE_MASK)"}),w.jsx("circle",{cx:i,cy:i,r:i-t,fill:"black"})]}),w.jsx("circle",{cx:i,cy:i,r:i,fill:"none"}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:r,mask:"url(#CIRCLE_MASK)"})]})})`
|
|
196
|
+
width: 100%;
|
|
197
|
+
height: 100%;
|
|
198
|
+
vertical-align: middle;
|
|
199
|
+
margin: 0;
|
|
200
|
+
color: ${s("Selfie.backgroundColor")};
|
|
201
|
+
`,it=v.div`
|
|
202
|
+
position: absolute;
|
|
203
|
+
z-index: -1;
|
|
204
|
+
background: rgba(223, 0, 0, 0.2);
|
|
205
|
+
border-radius: 50%;
|
|
206
|
+
width: 86%;
|
|
207
|
+
height: 86%;
|
|
208
|
+
top: 7%;
|
|
209
|
+
left: 7%;
|
|
210
|
+
`,io=S`
|
|
211
|
+
from {
|
|
212
|
+
opacity: 1;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
to {
|
|
216
|
+
opacity: 0;
|
|
217
|
+
}
|
|
218
|
+
`,is=v.div`
|
|
219
|
+
position: absolute;
|
|
220
|
+
width: 100%;
|
|
221
|
+
top: 0;
|
|
222
|
+
bottom: 0;
|
|
223
|
+
z-index: -1;
|
|
224
|
+
background: rgba(255, 255, 255, 0.3);
|
|
225
|
+
animation: ${io} 1s infinite;
|
|
226
|
+
border-radius: 50%;
|
|
227
|
+
`,ia=v.div`
|
|
228
|
+
top: 0;
|
|
229
|
+
left: 0;
|
|
230
|
+
right: 0;
|
|
231
|
+
bottom: 0;
|
|
232
|
+
position: absolute;
|
|
233
|
+
margin: auto;
|
|
234
|
+
width: ${s("Selfie.loadingIcon.width")};
|
|
235
|
+
height: ${s("Selfie.loadingIcon.height")};
|
|
236
|
+
|
|
237
|
+
img {
|
|
238
|
+
width: 100%;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
z-index: ${R+20};
|
|
242
|
+
${eJ.default}
|
|
243
|
+
`,il=v.div`
|
|
244
|
+
text-align: center;
|
|
245
|
+
color: ${s("Selfie.title.color")};
|
|
246
|
+
font-size: ${s("Selfie.title.fontSize")};
|
|
247
|
+
font-weight: ${s("Selfie.title.fontWeight")};
|
|
248
|
+
background-color: ${s("Selfie.title.backgroundColor")};
|
|
249
|
+
position: absolute;
|
|
250
|
+
top: ${e=>e.y};
|
|
251
|
+
z-index: ${R+10};
|
|
252
|
+
display: flex;
|
|
253
|
+
align-items: center;
|
|
254
|
+
justify-content: center;
|
|
255
|
+
width: 100%;
|
|
256
|
+
`;export{eL as A,e4 as B,e6 as C,it as E,e2 as F,e9 as I,ia as L,e7 as O,eQ as S,il as T,ii as a,e1 as b,e8 as c,ew as d,ir as e,ie as f,eb as g,is as h,e3 as i,e5 as j,eX as k,e0 as l,eW as m,eP as n,e$ as o,ek as p,eA as q,eD as r,ex as s,eS as t,eV as u,eT as v,ej as w,e_ as x,ev as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as e,r as t,d as r,f as a,c as i,p as n,u as l,g as s,l as d,j as o,a as u,P as c}from"./chunk-
|
|
1
|
+
import{s as e,r as t,d as r,f as a,c as i,p as n,u as l,g as s,l as d,j as o,a as u,P as c}from"./chunk-973e0c2c.js";import{g as p,S as g,R as f}from"./chunk-3a5e2fb7.js";import{W as m}from"./chunk-62203103.js";import"./chunk-7b148a15.js";let{IDCardSide:y,Errors:I}=e;async function b({image:e,cardType:t,cardSide:r,apiClient:a,outputEncryptionSettings:i}){let n={label:`id_card.${t}.${r}`};if(i&&i.key){let t=new File([e.encrypted.hex],`${Date.now()}.jpg`,{type:"image/jpeg"});return a.uploadImage({file:t,...n},{"X-TV-Key":i.key})}let l=new File([e.blob],`${Date.now()}.jpg`,{type:"image/jpeg"});return a.uploadImage({file:l,...n})}let S={data:{image_id:null}};async function _({image:e,apiClient:t,rawString:r,results:a,outputEncryptionSettings:i}){if(!e||!e.blob||!r)return Promise.resolve(S);let n={raw:r};a&&a.length>1&&(n=a.reduce((e,t,r)=>(e[0===r?"raw":`raw${r+1}`]=t,e),{}));let l={label:"qr_code",metadata:JSON.stringify(n)};if(i&&i.key){let r=new Blob([e.encrypted.hex]);return t.uploadImage({file:r,...l},{"X-TV-Key":i.key})}return t.uploadImage({file:e.blob,...l})}let C={data:{file_id:null}};async function h({video:e,apiClient:t,outputEncryptionSettings:r}){if(!e||!e.blob)return Promise.resolve(C);let a={label:"video"};if(r&&r.key){let i=new Blob([e.encrypted.hex]);return t.uploadFile({file:i,...a},{"X-TV-Key":r.key})}return t.uploadFile({file:e.blob,...a})}async function v({imageId:e,cardType:t,apiClient:r}){return r.requestVerifyIDCard({card_type:t,image1:{id:e}})}async function D({apiClient:e,cardType:t,frontCardId:r,isCapturingFrontSide:a,backCardId:i,recordedVideos:n=[],qrImageId:l,previousCapturingVideoId:s,previousFullVideoId:d,latestCapturingVideoId:o,latestFullVideoId:u}){let c=n.filter(e=>null!==e.id),p=n.filter(e=>null===e.id&&e.frames.length>0),g=await Promise.all(p.map(t=>e.fileService.request({frames:t.frames}))),f={card_type:t,image:{id:r},image2:a?void 0:{id:i},videos:[...[s,d,o,u].filter(e=>null!=e).map(e=>({id:e})),...c.map(e=>({id:e.id})),...g.map(e=>({id:e.data.file_id}))]};return l&&(f.qr1_images=[{id:l}]),e.detectIDTampering(f)}async function w({cardType:e,apiClient:t,cardImageId:r,qrImageId:a}){let i={card_type:e,image1:{id:r}};return a&&(i.qr1_images=[{id:a}]),t.readIDCard(i)}async function k({image:e,frontCardId:t,qrImageId:r,onError:a,recordedVideos:i,apiClient:n,cardType:l,cardSide:s,qrScannedResult:d,outputEncryptionSettings:o,enabledServices:u,fullVideo:c,capturingVideo:p,previousCapturingVideoId:g,previousFullVideoId:f}){let m=[b({image:e,cardType:l,cardSide:s,apiClient:n,outputEncryptionSettings:o})];m.push(_({image:d?.image,apiClient:n,rawString:d?.result,results:d?.results,outputEncryptionSettings:o})),m.push(h({video:c,apiClient:n,outputEncryptionSettings:o}),h({video:p,apiClient:n,outputEncryptionSettings:o}));let[S,C,k,E]=await Promise.all(m);if(S.errors)return void a({...I.upload_error,details:S.errors});let V=S.data.image_id,j=C?.data?.image_id||r,R={data:null};if(u?.enableVerifySanityIDCard){let e=await v({imageId:V,cardType:l,apiClient:n});if(e.errors)return void a({...I.sanity_check_error,details:e.errors});R.data=e.data}let B={data:null};if(u?.enableReadIDCardInfo){let e=await w({cardType:l,apiClient:n,cardImageId:V,qrImageId:j});if(e.errors)return void a({...I.read_id_card_error,details:e.errors});B.data=e.data}let F=k?.data?.file_id||null,T=E?.data?.file_id||null,K={data:null};if(u?.enableDetectIDCardTampering){let e,r;if(s===y.BACK&&!t)return void a(I.missing_front_id_card);let d=s===y.FRONT;d?e=V:(e=t,r=V);let o=await D({apiClient:n,cardType:l,frontCardId:e,isCapturingFrontSide:d,backCardId:r,recordedVideos:i,qrImageId:j,previousCapturingVideoId:g,previousFullVideoId:f,latestCapturingVideoId:T,latestFullVideoId:F});if(o.errors)return void a({...I.detect_id_tampering_error,details:o.errors});K.data=o.data}return{sanityResult:R.data,tamperingInfo:K.data,cardInfo:B.data,cardImageId:V,qrImageId:j,mp4VideoIds:{full:F,capturing:T}}}let{Errors:E}=e,V=({readIDCardUIOnlyComponent:c,...f})=>{let{onError:y,onStepDone:I,apiCredentials:b,logCredentials:S,outputEncryptionSettings:_,serviceSettings:C,flowId:h,clientSettings:v,...D}=f,[w,V]=t.useState(v),[j,R]=t.useState(!1),{apiClient:B}=r.useApiClient({apiCredentials:b,logCredentials:S}),F=t.useRef(""),T=t.useRef(""),K=t.useRef(null),U=t.useRef(null),q=a.getEnabledServices(C,w),{billingSettings:O,enableBilling:P}=i.useSDKSettings(),x=n.buildBillingInput(f),A=l.getWebSetting(w,"data.settings.sdk_settings.billing_settings.billing_config"),{submitBilling:W}=s({enable:P,onError:y,billingSettings:O??{json:A??{}},billingUrl:l.getWebSetting(w,"data.settings.sdk_settings.billing_settings.url")}),$=t.useCallback(t=>{if(e.ErrorsWithoutBilling.includes(t.code))return void y(t);let r={error:t,sdkStatus:e.BillingStatus.fail};W({service:p(D.steps),input:x,output:r}),y&&y(t)},[W,D.steps,x,y]),G=t.useCallback((t,r)=>{if(r){let r={sdkStatus:e.BillingStatus.success,result:n.buildBillingOutput(t)},a={service:p(D.steps),input:x,output:r};if(Array.isArray(D.steps)&&1===D.steps.length&&D.steps[0].scannerType===g.QR_CODE){let{qrScannedResult:r={}}=t,i=r.result;if(i){let e=i.split("|")[0];a.id_num=d.SHA256(e),a.full_hash=d.SHA256(i)}else a.output={...a.output,sdkStatus:e.BillingStatus.cancel}}W(a)}I&&I(t)},[I,D.steps,x,W]);t.useEffect(()=>{async function e(){try{let e=await B.clientSettings({flow_id:h});V(e)}catch(e){console.error("Error fetching client settings:",e)}finally{R(!0)}}q.enableGetClientSettings&&e()},[B,q.enableGetClientSettings,h]);let N=t.useCallback(async(t,{shouldBilling:r})=>{let{cardType:a,cardSide:i,recordedVideos:n,qrScannedResult:l,image:s,fullVideo:d,capturingVideo:o}=t;try{if(!q.enableUploadImages||!s.blob)return void G(t,r);let u=null;(u=await k({image:s,cardSide:i,frontCardId:F.current,qrImageId:T.current,onError:$,apiClient:B,cardType:a,recordedVideos:n,qrScannedResult:l,outputEncryptionSettings:_,enabledServices:q,fullVideo:d,capturingVideo:o,previousCapturingVideoId:U.current,previousFullVideoId:K.current}))&&(i===e.IDCardSide.FRONT&&(F.current=u.cardImageId),U.current=u?.mp4VideoIds?.capturing,K.current=u?.mp4VideoIds?.full,T.current=u.qrImageId,G({...t,apiResult:u},r))}catch(e){$({...E.api_call_error,details:e})}},[B,q,$,G,_]);return q.enableGetClientSettings&&!j?null:o.jsx(u.LicenseProvider,{clientSettings:w,onError:y,children:o.jsx(m,{isWrappedBy:"id_with_api_call",children:o.jsx(c,{logCredentials:S,onError:y,onStepDone:N,outputEncryptionSettings:_,...D,clientSettings:w})})})};V.propTypes={onError:c.func,onStepDone:c.func,apiCredentials:c.shape({accessKey:c.string,secretKey:c.string,apiUrl:c.string}),logCredentials:c.shape({}),outputEncryptionSettings:c.shape({}),readIDCardUIOnlyComponent:c.func,serviceSettings:c.shape({}),flowId:c.string,clientSettings:c.shape({})},V.defaultProps={onError:()=>{},onStepDone:()=>{},apiCredentials:{accessKey:"",secretKey:"",apiUrl:""},logCredentials:{enable:!1},outputEncryptionSettings:{key:""},readIDCardUIOnlyComponent:f,serviceSettings:{enableUploadFrames:!0,enableUploadImages:!0,enableVerifySanityPortrait:!0,enableVerifySanityIDCard:!0,enableVerifyFaceLiveness:!0,enableDetectIDCardTampering:!0,enableReadIDCardInfo:!0},flowId:"",clientSettings:null};export{V as default};
|