Files
to_session/text/3.65.22_0/scripts/ui/chunk-TWCNNRNT.js
Administrator a0720d80dc fefdwef
2025-11-12 12:54:37 +08:00

8 lines
4.8 KiB
JavaScript

import{e as j}from"./chunk-ND6CCRJ3.js";import{g as G}from"./chunk-JYK46VHM.js";import{b as W,c as Z}from"./chunk-YYLTB5E4.js";import{y as z}from"./chunk-ZASBKUPD.js";import{r as P}from"./chunk-4FLAC4IK.js";import{o as et}from"./chunk-64WUUNDB.js";import{a as ot}from"./chunk-62FSCPM5.js";import{d as M}from"./chunk-3MBHSNRN.js";import{c as _}from"./chunk-DS3RNNYF.js";import{I as Q,la as A,ra as X,ub as w,wb as tt,x as D}from"./chunk-I5E2ION7.js";import{H as R,y as d}from"./chunk-SQMXULWT.js";import{e as U,o as Y,q as O}from"./chunk-GQZAGQSC.js";import{ka as m}from"./chunk-RC6UR2LL.js";import{b as I}from"./chunk-BF2V36QE.js";import{f as T,o as a,q as p}from"./chunk-QTLWQ5AJ.js";a();p();a();p();var h=T(I());a();p();function $(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=$(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function nt(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=$(e))&&(o&&(o+=" "),o+=t);return o}var H=nt;R();a();p();var N={root:"_root_g36fg_1",image:"_image_g36fg_4",btn:"_btn_g36fg_7"};function B({className:e,onPass:t}){let[n]=Z(W.credentialId),o=M({light:"./static/images/passkey-light.png",dark:"./static/images/passkey-dark.png"}),[r,l]=(0,h.useState)(!1),i=async()=>{try{l(!0);let{password:u}=await j(n);t(u)}catch{l(!1)}finally{l(!1)}};return h.default.createElement(_.FlexBox,{className:H(N.root,e),direction:_.DIRECTION.vertical,align:_.ALIGN.center,justify:"center",onClick:i},h.default.createElement(U,{className:N.image,src:o,width:80,height:80}),h.default.createElement(m,{className:N.btn,category:m.CATEGORY.fill,type:m.TYPE.primary,loading:r,size:m.SIZE.md,onClick:i},d("wallet_extension_biometrics_loading_unlock")))}var Nt=B;a();p();var g=T(I());tt();var K=({elementName:e,children:t})=>{let n={lastTimestamp:null,charCount:0,paste:!1,result:[]},[{lastTimestamp:o,charCount:r,paste:l,result:i},u]=(0,g.useState)(n),c=s=>{let v=Date.now(),L=null;if(o){let b=v-o,J=s.length-r;b>0&&(L={count:J,duration:b},i.push(L))}u({lastTimestamp:v,charCount:s.length,paste:l,result:s?[...i]:[]})},y=()=>{if(i.length>0&&r!==0&&l){let s=i.reduce((L,b)=>L+b.duration,0);w({e,l:r,d:s}),u({lastTimestamp:o,charCount:r,paste:!1,result:i})}},C=()=>{u({lastTimestamp:Date.now(),charCount:r,paste:l,result:i})},E=()=>{u({lastTimestamp:o,charCount:r,paste:!0,result:i})};return g.default.cloneElement(t,{onChange(...s){t.props.onChange&&t.props.onChange(...s),c(typeof s[0]=="string"?s[0]:s[0].target.value)},onBlur(...s){t.props.onBlur&&t.props.onBlur(...s),y()},onFocus(...s){t.props.onFocus&&t.props.onFocus(...s),C()},onPaste(...s){t.props.onPaste&&t.props.onPaste(...s),E()}})};var Ot=e=>{let{elementName:t,...n}=e;return g.default.createElement(K,{elementName:t},g.default.createElement(O.Password,{...n}))};var Gt=({elementName:e,children:t})=>{let n={lastTimestamp:null},[{lastTimestamp:o},r]=(0,g.useState)(n),l=()=>{r({lastTimestamp:Date.now()})},i=c=>{let y=Date.now();if(o){let C=y-o;if(C>0&&c){let E={e,l:c.length,d:C};w(E)}}r({lastTimestamp:y})};return g.default.cloneElement(t,{onFocus(...c){t.props.onFocus&&t.props.onFocus(...c),l()},onPaste(...c){let y=c[0]?.clipboardData?.getData("text");t.props.onPaste&&t.props.onPaste(...c),i(y)}})},zt=K;a();p();var k=T(I()),V=T(ot()),q=T(et());X();Q();a();p();var S=T(I());R();a();p();var x={root:"_root_mkvsv_1",title:"_title_mkvsv_4",desc:"_desc_mkvsv_13",btn:"_btn_mkvsv_22",still:"_still_mkvsv_25",forgot:"_forgot_mkvsv_29"};function F({openNotification:e,resetPassword:t}){return S.default.createElement(_.Container,{className:x.root},S.default.createElement(P.Text,{className:x.title},d("wallet_extension_biometrics_dialog_title_cant_unlock")),S.default.createElement(P.Text,{className:x.desc},d("wallet_extension_biometrics_dialog_desc_cant_unlock")),S.default.createElement(m,{block:!0,category:m.CATEGORY.fill,type:m.TYPE.highlight,size:m.SIZE.lg,onClick:()=>{e()},className:x.btn},d("wallet_extension_biometrics_dialog_btn_cant_unlock_switch")),S.default.createElement(P.Text,{className:x.forgot,strong:!0,size:P.SIZE.sm,type:P.TYPE.secondary,onClick:()=>{t()}},d("wallet_extension_biometrics_btn_still_unable_unlock")))}function rt(){let e=(0,V.useHistory)(),t=(0,k.useRef)(null),n=()=>{t.current&&(t.current.destroyAll(),setTimeout(()=>{t.current=null}))},o=()=>{t.current||(t.current=Y.action({onClose:()=>{n()},visible:!0,maskClosable:!0,children:k.default.createElement(F,{openNotification:()=>{let{pathname:r,search:l}=e.location,u=A()===D;globalThis.platform.openExtensionInPopup(`${r}${l}`,null,!u)},resetPassword:()=>{n(),G(),e.push(z)}})}))};return(0,q.useUnmount)(()=>{n()}),{open:o,close:n}}export{nt as a,Nt as b,Ot as c,Gt as d,zt as e,rt as f};
window.inOKXExtension = true;
window.inMiniApp = false;
window.ASSETS_BUILD_TYPE = "publish";
//# sourceMappingURL=chunk-TWCNNRNT.js.map