@authing/guard-shim-react 4.5.33-alpha.2 → 4.5.33-alpha.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/dist/guard.min.js CHANGED
@@ -17747,7 +17747,7 @@ var zD=i(4232),$D=i(4631),HD=i(1062),WD=i(8787),GD={zhCN:zD/* default */.Z,enUS:
17747
17747
  * 多账号 状态
17748
17748
  */
17749
17749
  multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isSpecialBrowser:!1},tL=y().createContext(eL),nL=y().createContext({spin:!1,spinChange:function(){}}),rL=function(){return QD(nL)},oL=function(){return QD(tL).publicConfig},iL=function(){return QD(tL).httpClient},aL=function(){return QD(tL).isSpecialBrowser},sL=function(){return QD(tL).appId},cL=function(){return QD(tL).tenantId};function lL(){return QD(tL).initData}var uL=function(){return QD(tL).currentModule},dL=function(){return QD(tL).events},fL=function(){var e=QD(tL);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},pL=function(){return QD(tL).finallyConfig},hL=function(){return QD(tL).isAuthFlow},mL=function(){return QD(tL).multipleInstance},vL=function(){return QD(tL).phoneRegex},gL=function(){return QD(tL).defaultLanguageConfig},yL=function(){var e=oL(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},bL=function(e){var t,n,r=oL(),o=r.loginSmsConfig,i=r.registerSmsConfig,a=!1;switch(e){case"login":a="ON"===(null===(t=null==o?void 0:o.robot)||void 0===t?void 0:t.switch);break;case"register":a="ON"===(null===(n=null==i?void 0:i.robot)||void 0===n?void 0:n.switch)}return a},wL=y().useMemo,CL={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},EL=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=_u().i18n,i=QD(tL).guardPageConfig,a=pL(),s=wL((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=wL((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=wL((function(){return Object.keys(CL).includes(o.resolvedLanguage)?o.resolvedLanguage:dd(o.resolvedLanguage)[0]||"en-US"}),[o.resolvedLanguage]),u=wL((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,CL[l].label))}),[l]),d=wL((function(){return Object.keys(CL).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:CL[e].label}}))}),[n]);if(!c||0===n.length)return null;var f={items:d,onClick:function(e){l!==e.key&&(o.changeLanguage(e.key),null==r||r(e.key))}};return y().createElement("div",{className:"g2-change-language-container"},y().createElement(w_,{menu:f,trigger:["click"],placement:"bottom",overlayClassName:"authing-g2-change-language-menu"},y().createElement("span",{className:s},u,y().createElement(YD,{type:"authing-arrow-down-s-fill",className:"down-fill-svg"}))))};// CONCATENATED MODULE: ./package.json
17750
- const kL=JSON.parse('{"i8":"4.5.33-alpha.2"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
17750
+ const kL=JSON.parse('{"i8":"4.5.33-alpha.3"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
17751
17751
  function SL(){return kL.i8}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
17752
17752
  var xL,PL=function(){return xL},_L=function(e){xL=e},TL=function(){return TL=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},TL.apply(this,arguments)},OL=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},NL=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},IL=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},AL=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))},RL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return OL(void 0,void 0,void 0,(function(){return NL(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,AL([],IL(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},ML=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};RL.get=function(e,t,n){return void 0===t&&(t={}),OL(void 0,void 0,void 0,(function(){var r,o,i,a,s;return NL(this,(function(c){switch(c.label){case 0:r=TL(TL({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[RL.langHeader]=gX(),s)),""!==RL.tenantId&&(r[RL.tenantHeader]=RL.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([ML(i.cancel),ma()("".concat(RL.baseUrl).concat(e).concat(jc().stringify(t,{addQueryPrefix:!0})),TL(TL({method:"GET"},n),{withCredentials:!0,headers:r,cancelToken:i.token}))])];case 2:return[2/*return*/,null==(a=c.sent())?void 0:a.data];case 3:return c.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},RL.post=function(e,t,n){return OL(void 0,void 0,void 0,(function(){var r,o,i,a,s,c;return NL(this,(function(l){switch(l.label){case 0:r=TL(TL({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[RL.langHeader]=cu.resolvedLanguage,s)),""!==RL.tenantId&&(r[RL.tenantHeader]=RL.tenantId),l.label=1;case 1:return l.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([ML(i.cancel),ma()("".concat(RL.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:i.token,headers:TL(TL({"Content-Type":"application/json"},null==n?void 0:n.headers),(c={},c[RL.langHeader]=gX(),c))})])];case 2:return[2/*return*/,null==(a=l.sent())?void 0:a.data];case 3:return l.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},RL.postForm=function(e,t,n){return OL(void 0,void 0,void 0,(function(){var r,o,i,a;return NL(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=ma().CancelToken,o=r.source(),[4/*yield*/,Promise.race([ML(o.cancel),ma()("".concat(RL.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:TL(TL({},null==n?void 0:n.headers),(a={},a[RL.langHeader]=gX(),a))})])];case 1:return[2/*return*/,null==(i=s.sent())?void 0:i.data];case 2:return s.sent(),[2/*return*/,Promise.resolve({code:-2})];case 3:return[2/*return*/]}}))}))},RL.baseUrl="",RL.setBaseUrl=function(e){RL.baseUrl=e.replace(/\/$/,"")};var DL,LL="x-authing-lang";RL.langHeader=LL,RL.tenantHeader="x-authing-app-tenant-idåå",RL.tenantId="",RL.setLangHeader=function(e){RL.langHeader=e||LL},RL.setTenantHeader=function(e){RL.tenantHeader=e||LL},RL.setTenantId=function(e){RL.tenantId=e},function(e){e.ERROR="error",e.LOGIN="login",e.REGISTER="register",e.MFA="mfa",e.FORGET_PWD="forgetPassword",e.FORCED_PASSWORD_RESET="forcedPasswordReset",e.NOTICE_PASSWORD_RESET="noticePasswordReset",e.FIRST_LOGIN_PASSWORD="firstLoginPassword",e.UNSAFE_PASSWORD_RESET="unsafePasswordReset",e.DOWNLOAD_AT="downloadAT",e.BIND_TOTP="bindTotp",e.ANY_QUESTIONS="anyQuestions",e.LOGIN_COMPLETE_INFO="loginCompleteInfo",e.REGISTER_PASSWORD="registerPassword",e.REGISTER_COMPLETE_INFO="registerCompleteInfo",e.RECOVERY_CODE="recoveryCode",e.SUBMIT_SUCCESS="submitSuccess",e.IDENTITY_BINDING_ASK="identityBindingAsk",e.IDENTITY_BINDING="identityBinding",e.IDENTITY_BINDING_NO_ASK="identityBindingNoAsk",e.SELF_UNLOCK="selfUnlock",e.FLOW_SELECT_ACCOUNT="flowSelectAccount",
17753
17753
  /** 多租户门户选择页 */
@@ -18847,15 +18847,17 @@ g=c.needBack,
18847
18847
  // changeModule = GuardModuleType.LOGIN,
18848
18848
  b=void 0===g||g,w=c.goBack,C=void 0===w?function(){return null==n?void 0:n(DL.LOGIN)}:w,E=null==s?void 0:s.cdnBase;return PZ((function(){return a.current=setInterval((function(){i((function(e){return e-1}))}),1e3),function(){return clearInterval(a.current)}}),[]),PZ((function(){o<=0&&(clearInterval(a.current),b&&(null==C||C()))}),[o,b,C]),y().createElement("div",{className:"g2-view-container g2-submit-success g2-view-container-submit-success"},y().createElement("div",{className:"g2-view-tabs g2-questions-send-success-pageWrap"},y().createElement($j,{className:"plate-submit-success",src:"".concat(E,"/questions-send-ok.png"),alt:"",width:157,height:120}),y().createElement("div",{className:"success-page-title "},u),y().createElement("div",{className:"success-page-message"},f),b&&y().createElement(y().Fragment,null,y().createElement(Pj,{className:"success-page-btn",onClick:function(){null==C||C()},text:h}),y().createElement("div",{className:"success-page-timer-tip"},o," ",v))))},NZ=function(){return NZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},NZ.apply(this,arguments)},IZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},AZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},RZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},MZ=y().useRef,DZ=(y().useState,y().useCallback,y().useEffect,function(){var e,t,n,r=_u().t,o=pL(),i=dL(),a=lL(),s=fL().changeModule,c=oL(),l=UQ(),u=(l.get,l.post),d=RZ(sT.useForm(),1)[0],f=MZ(null),p=null==c?void 0:c.verifyCodeLength;return y().createElement("div",{className:"g2-view-container g2-view-invitation-apply"},y().createElement("div",{className:"g2-view-container-inner"},y().createElement("div",{className:"g2-view-header"},y().createElement("img",{src:null===(e=null==a?void 0:a.userPool)||void 0===e?void 0:e.logo,alt:"",className:"icon"}),y().createElement("div",{className:"g2-view-header-container"},y().createElement("div",{className:"invitation-welcome"},null===(t=null==a?void 0:a.inviter)||void 0===t?void 0:t.displayName," ",r("common.welcomeJoin")),y().createElement("div",{className:"title"},null===(n=null==a?void 0:a.userPool)||void 0===n?void 0:n.name))),y().createElement("div",{className:"g2-view-content"},y().createElement(sT,{layout:"vertical",name:"et-pre-check-email",onFinish:function(){return IZ(void 0,void 0,void 0,(function(){var e,t,n,i,c,l;return AZ(this,(function(p){switch(p.label){case 0:return p.trys.push([0,2,3,4]),null===(c=f.current)||void 0===c||c.onSpin(!0),[4/*yield*/,u("/api/v3/signup-by-invitation",NZ(NZ({},d.getFieldsValue()),{identifier:null==a?void 0:a.identifier,profile:NZ({},d.getFieldsValue())}))];case 1:return e=p.sent(),t=e.statusCode,n=e.message,i=e.data,200!==t?vC.error(n):null==s||s(DL.MESSAGE,{message:"PENDING"===i.status?r("common.pendingMsg",[o.title]):r("common.doneMsg")}),[3/*break*/,4];case 2:return p.sent(),[3/*break*/,4];case 3:return null===(l=f.current)||void 0===l||l.onSpin(!1),[7/*endfinally*/];case 4:return[2/*return*/]}}))}))},onFinishFailed:function(){return f.current.onError()},autoComplete:"off",form:d,className:"authing-g2-form-required-item-icon-after"},y().createElement(sT.Item,{name:"name",label:r("common.name"),rules:[{required:!0}],className:"authing-g2-input-form"},y().createElement(rO,{type:"text",size:"large",className:"authing-g2-input",autoComplete:"off"})),y().createElement(WB.Email,{className:"authing-g2-input-form",name:"email",checkRepeat:!0,label:cu.t("common.email"),key:"internal email:email13",validateFirst:!0,required:!0},y().createElement(rO,{className:"authing-g2-input",autoComplete:"email",size:"large",placeholder:r("login.inputEmail")})),y().createElement(sT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"emailCode",key:"internal email:code1432",rules:JQ(r("common.captchaCode"))},y().createElement(xq,{className:"authing-g2-input g2-send-code-input",autoComplete:"one-time-code",size:"large",placeholder:r("common.inputFourVerifyCode",{length:p}),maxLength:p,data:"",scene:Nc.VERIFY_CODE,fieldName:"email",form:d,onSendCodeBefore:function(){return d.validateFields(["email"])}})),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Pj,{text:r("common.applyJoin"),className:"password",ref:f})))),y().createElement(EL,{langRange:null==o?void 0:o.langRange,onLangChange:null==i?void 0:i.onLangChange})))}),LZ=y().useMemo,FZ=function(e){var t=lL(),n=oL();gB();var r=LZ((function(){var n,r,o=null!==(n=null==e?void 0:e.message)&&void 0!==n?n:null==t?void 0:t.message;return null!==(r="".concat(o))&&void 0!==r?r:"".concat(cu.t("user.contactAdministrator"))}),[null==t?void 0:t.message,null==e?void 0:e.message]);return y().createElement("div",{className:"g2-view-container g2-view-message"},y().createElement("div",{className:"g2-message-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:135,height:103,backgroundImage:"url(".concat(n.cdnBase,"/authing_message.svg?v=1)"),backgroundSize:"contain"}})),y().createElement("span",{className:"g2-message-text",dangerouslySetInnerHTML:{__html:r}})))},jZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},BZ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},UZ=y().useCallback,qZ=function(e,t){var n=YL(),r=dL(),o=iL().post,i=BQ().authFlow,a=fL().changeModule,s=UZ((function(e){return jZ(void 0,void 0,void 0,(function(){var i,s,c,l,u,d,f,p,h,m,v,g;return BZ(this,(function(y){switch(y.label){case 0:if(!(i=null==r?void 0:r.onBeforeRegister))return[3/*break*/,4];y.label=1;case 1:return y.trys.push([1,3,,4]),[4/*yield*/,i({type:e.verifyType,data:e},n)];case 2:return y.sent()?[3/*break*/,4]:(null===(h=null==t?void 0:t.current)||void 0===h||h.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(s=y.sent())?vC.error(s):vC.error(null==s?void 0:s.message),null===(m=null==t?void 0:t.current)||void 0===m||m.onSpin(!1),[2/*return*/];case 4:return[4/*yield*/,o("/api/v3/join-by-invitation",e)];case 5:return c=y.sent(),l=c.statusCode,u=c.code,c.apiCode,d=c.data,f=c.onGuardHandling,p=c.message,200===l?(null===(v=null==r?void 0:r.onRegister)||void 0===v||v.call(r,d,n),null==a||a(DL.INVITE_SUCCESS)):(null==f||f(),null===(g=null==r?void 0:r.onRegisterError)||void 0===g||g.call(r,{code:u,data:d,message:p})),[2/*return*/]}}))}))}),[n,i,a,r,o,t]);return s},VZ=function(){return VZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},VZ.apply(this,arguments)},zZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},$Z=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},HZ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},WZ=y().useCallback,GZ=y().useEffect,KZ=y().useMemo,YZ=y().useRef,JZ=y().useState,ZZ=function(){var e=lL(),t=dL(),n=pL(),r=_u().t,o=YZ(null);gB();var i=fL().changeModule,a=iL().post,s=oL(),c=null==s?void 0:s.verifyCodeLength,l=HZ(sT.useForm(),1)[0],u=YZ(null),d=HZ(JZ(!0),2),f=d[0],p=d[1],h=HZ(JZ("prioritySMS"===e.sendVerifyCodeMethod&&e.phone?"smsCode":"emailCode"),2),m=h[0],v=h[1],g=YZ(null),b=KZ((function(){return"emailCode"===m?e.email:"smsCode"===m?e.phone:void 0}),[e.email,e.phone,m]),w=KZ((function(){var t={prioritySMS:{emailCode:{desc:r("common.sendSms"),show:e.phone,receiverType:"smsCode"},smsCode:{desc:r("common.sendEmail"),show:e.email,receiverType:"emailCode"}},priorityEmail:{emailCode:{desc:r("common.sendSms"),show:e.phone,receiverType:"smsCode"},smsCode:{desc:r("common.sendEmail"),show:e.email,receiverType:"emailCode"}}},n=e.sendVerifyCodeMethod;return["prioritySMS","priorityEmail"].some((function(e){return n===e}))?VZ({},t[n][m]):t[n]}),[e,r,m]),C=WZ((function(e){return zZ(void 0,void 0,void 0,(function(){return $Z(this,(function(t){switch(t.label){case 0:return[4/*yield*/,a("emailCode"===e.receiverType?"/api/v2/email/send":"/api/v2/sms/send",VZ(VZ({},e),{scene:"emailCode"===e.receiverType?Nc.REGISTER_VERIFY_CODE:Ii.SCENE_TYPE_REGISTER}))];case 1:return[2/*return*/,t.sent()]}}))}))}),[a]),E=qZ(0,u);GZ((function(){var e;o.current&&(null===(e=o.current)||void 0===e||e.click())}),[]);var k=function(t){return zZ(void 0,void 0,void 0,(function(){var n,r,o;return $Z(this,(function(i){switch(i.label){case 0:return n="default"===t?m:w.receiverType,[4/*yield*/,C({phone:e.phone,phoneCountryCode:e.phoneCountryCode,email:e.email,receiverType:n})];case 1:return 200===(r=i.sent()).code?(v(n),[2/*return*/,!0]):(null===(o=r.onGuardHandling)||void 0===o||o.call(r),[2/*return*/,!1])}}))}))};return y().createElement("div",{className:"g2-view-container g2-view-invite"},y().createElement("div",{className:"g2-invite-content"},y().createElement("div",{className:"g2-view-invite-header"},y().createElement("div",{className:"title"},r("common.inputCaptcha")),y().createElement("div",{className:"tips"},r("common.verifyAccount",[b&&("emailCode"===m?dX(b):fX(b))])),y().createElement("div",{className:"tips errorTips"},r("common.captchaMaxErrorCount",[e.verifyCodeMaxErrCount]))),y().createElement(sT,{form:l,onFinish:function(t){return zZ(void 0,void 0,void 0,(function(){var n,r,o,s,c,l,u,d,f,p,h,v;return $Z(this,(function(g){switch(g.label){case 0:return n=t.code.join(""),[4/*yield*/,a("/api/v3/verify-invite-code",{code:n,receiverType:m,token:e.token})];case 1:return r=g.sent(),o=r.statusCode,s=r.onGuardHandling,200!==o?[3/*break*/,5]:(c=e.extendsFields,l=void 0===c?[]:c,u=e.extendsFieldsOptions,d=void 0===u?[]:u,f=e.enabledInfoFill,p={code:n,token:e.token,receiverType:m},h=null==l?void 0:l.filter((function(t){return"email"===t.name&&"internal"===t.type?!e.email:"phone"===t.name&&"internal"===t.type?!e.phone:"username"===t.name&&"internal"===t.type?!e.username:"name"!==t.name||"internal"!==t.type||!e.name})),v=Fq(h,d),f&&v.length>0?(null==i||i(DL.INVITE_COMPLETE,VZ(VZ({},e),{
18849
18849
  // ...data,
18850
- verifyAccount:b,metaData:v,originModule:DL.INVITE_AUTH,originContext:e,context:p})),[3/*break*/,4]):[3/*break*/,2]);case 2:return[4/*yield*/,E(p)];case 3:g.sent(),g.label=4;case 4:return[3/*break*/,6];case 5:null==s||s(),g.label=6;case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.onError()},onValuesChange:function(e){e.code.filter((function(e){return Boolean(e)})).length>=c?p(!1):p(!0)}},y().createElement(Kj,{codeLength:c,name:"code"},y().createElement(oB,{length:c,showDivider:!0,gutter:"10px"})),y().createElement("div",{className:"resend_container"},y().createElement(kU,{btnRef:o,beforeSend:function(){return zZ(void 0,void 0,void 0,(function(){return $Z(this,(function(e){switch(e.label){case 0:return[4/*yield*/,k("default")];case 1:return[2/*return*/,e.sent()]}}))}))},type:"link"})),y().createElement(Pj,{text:r("login.nextStep"),ref:u,disabled:f})),(null==w?void 0:w.show)&&y().createElement("div",{className:"resend_container"},y().createElement(kU,{btnRef:g,sendDesc:w.desc,beforeSend:function(){return zZ(void 0,void 0,void 0,(function(){return $Z(this,(function(e){switch(e.label){case 0:return[4/*yield*/,k("reSend")];case 1:return[2/*return*/,e.sent()]}}))}))},type:"link",className:"resend_code"})),y().createElement(EL,{langRange:null==n?void 0:n.langRange,onLangChange:null==t?void 0:t.onLangChange})))},QZ=function(){return QZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},QZ.apply(this,arguments)},XZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},eQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},tQ=function(){var e=lL(),t=pL(),n=dL(),r=_u().t,o=e.metaData,i=e.extendsFieldsI18n,a=e.extendsFields,s=e.canBack,c=void 0===s||s,l=e.registerInfoFillMsg,u=fL().changeModule,d=qZ();return y().createElement("div",{className:"g2-view-container g2-complete-info g2-invitation-complete"},y().createElement("div",{className:"g2-view-header"},c&&(null==e?void 0:e.originModule)&&y().createElement(hB,{onBack:function(){(null==e?void 0:e.originModule)&&(null==u||u(e.originModule,e.originContext))}},r("common.back")),y().createElement("div",{className:"content"},y().createElement("div",{className:"title"},r("common.invitation.completeInfo")),y().createElement("div",{className:"title-explain"},l||r("common.invitation.completeInfoDesc")))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(eV,{extendsFieldsI18n:i,metaData:o,businessRequest:function(t){return XZ(void 0,void 0,void 0,(function(){var n,r,o,i,s,c,l,u;return eQ(this,(function(f){switch(f.label){case 0:return n=t.fieldValues,r=jq(a,n),o=r.registerProfile,i=r.udf,s=null,c=null,Reflect.has(o,"phoneToken")&&(s=o.phoneToken,Reflect.deleteProperty(o,"phoneToken")),Reflect.has(o,"emailToken")&&(c=o.emailToken,Reflect.deleteProperty(o,"emailToken")),l={profile:QZ(QZ({},o),{customData:i}),options:{phonePassCodeForInformationCompletion:s,emailPassCodeForInformationCompletion:c}},u=QZ(QZ({},e.context),l),[4/*yield*/,null==d?void 0:d(u)];case 1:return f.sent(),[2/*return*/]}}))}))}})),y().createElement(EL,{langRange:null==t?void 0:t.langRange,onLangChange:null==n?void 0:n.onLangChange}))},nQ=function(e){var t=_u().t;return y().createElement(kV,{error:{name:"invite_expire",message:e.key===DL.INVITE_EXPIRE?t("common.inviteExpired"):t("common.pageExpired")}})},rQ=function(){var e=_u().t;return y().createElement(FZ,{message:e("common.inviteSuccess")})},oQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},iQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},aQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sQ=y().useRef,cQ=function(){var e=_u().t,t=lL(),n=oL(),r=YL(),o=pL();gB();var i=(null==n?void 0:n.resetPwdCustomLogo)||(null==o?void 0:o.logo),a=t.account,s=t.userId,c=t.goBack,l=t.rule,u=void 0===l?[]:l,d=t.token,f=QB(),p=f.getPassWordUnsafeText,h=f.setPasswordErrorTextShow,m=aQ(sT.useForm(),1)[0],v=BQ().post,g=sQ(null);
18850
+ verifyAccount:b,metaData:v,originModule:DL.INVITE_AUTH,originContext:e,context:p})),[3/*break*/,4]):[3/*break*/,2]);case 2:return[4/*yield*/,E(p)];case 3:g.sent(),g.label=4;case 4:return[3/*break*/,6];case 5:null==s||s(),g.label=6;case 6:return[2/*return*/]}}))}))},onFinishFailed:function(){var e;return null===(e=u.current)||void 0===e?void 0:e.onError()},onValuesChange:function(e){e.code.filter((function(e){return Boolean(e)})).length>=c?p(!1):p(!0)}},y().createElement(Kj,{codeLength:c,name:"code"},y().createElement(oB,{length:c,showDivider:!0,gutter:"10px"})),y().createElement("div",{className:"resend_container"},y().createElement(kU,{btnRef:o,beforeSend:function(){return zZ(void 0,void 0,void 0,(function(){return $Z(this,(function(e){switch(e.label){case 0:return[4/*yield*/,k("default")];case 1:return[2/*return*/,e.sent()]}}))}))},type:"link"})),y().createElement(Pj,{text:r("login.nextStep"),ref:u,disabled:f})),(null==w?void 0:w.show)&&y().createElement("div",{className:"resend_container"},y().createElement(kU,{btnRef:g,sendDesc:w.desc,beforeSend:function(){return zZ(void 0,void 0,void 0,(function(){return $Z(this,(function(e){switch(e.label){case 0:return[4/*yield*/,k("reSend")];case 1:return[2/*return*/,e.sent()]}}))}))},type:"link",className:"resend_code"})),y().createElement(EL,{langRange:null==n?void 0:n.langRange,onLangChange:null==t?void 0:t.onLangChange})))},QZ=function(){return QZ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},QZ.apply(this,arguments)},XZ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},eQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},tQ=function(){var e=lL(),t=pL(),n=dL(),r=_u().t,o=e.metaData,i=e.extendsFieldsI18n,a=e.extendsFields,s=e.canBack,c=void 0===s||s,l=e.registerInfoFillMsg,u=fL().changeModule,d=qZ();return y().createElement("div",{className:"g2-view-container g2-complete-info g2-invitation-complete"},y().createElement("div",{className:"g2-view-header"},c&&(null==e?void 0:e.originModule)&&y().createElement(hB,{onBack:function(){(null==e?void 0:e.originModule)&&(null==u||u(e.originModule,e.originContext))}},r("common.back")),y().createElement("div",{className:"content"},y().createElement("div",{className:"title"},r("common.invitation.completeInfo")),y().createElement("div",{className:"title-explain"},l||r("common.invitation.completeInfoDesc")))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(eV,{extendsFieldsI18n:i,metaData:o,businessRequest:function(t){return XZ(void 0,void 0,void 0,(function(){var n,r,o,i,s,c,l,u;return eQ(this,(function(f){switch(f.label){case 0:return n=t.fieldValues,r=jq(a,n),o=r.registerProfile,i=r.udf,s=null,c=null,Reflect.has(o,"phoneToken")&&(s=o.phoneToken,Reflect.deleteProperty(o,"phoneToken")),Reflect.has(o,"emailToken")&&(c=o.emailToken,Reflect.deleteProperty(o,"emailToken")),l={profile:QZ(QZ({},o),{customData:i}),options:{phonePassCodeForInformationCompletion:s,emailPassCodeForInformationCompletion:c}},u=QZ(QZ({},e.context),l),[4/*yield*/,null==d?void 0:d(u)];case 1:return f.sent(),[2/*return*/]}}))}))}})),y().createElement(EL,{langRange:null==t?void 0:t.langRange,onLangChange:null==n?void 0:n.onLangChange}))},nQ=function(e){var t=_u().t;return y().createElement(kV,{error:{name:"invite_expire",message:e.key===DL.INVITE_EXPIRE?t("common.inviteExpired"):t("common.pageExpired")}})},rQ=function(){var e=_u().t;return y().createElement(FZ,{message:e("common.inviteSuccess")})},oQ=function(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))},iQ=function(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}},aQ=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a},sQ=y().useRef,cQ=function(){var e=_u().t,t=lL(),n=oL(),r=YL(),o=pL(),i=fL().changeModule;gB();var a=(null==n?void 0:n.resetPwdCustomLogo)||(null==o?void 0:o.logo),s=t.account,c=t.userId,l=t.goBack,u=t.rule,d=void 0===u?[]:u,f=t.token,p=QB(),h=p.getPassWordUnsafeText,m=p.setPasswordErrorTextShow,v=aQ(sT.useForm(),1)[0],g=BQ().post,b=sQ(null);
18851
18851
  /**
18852
18852
  * initData
18853
- */return y().createElement("div",{className:"g2-view-container g2-forget-password g2-password-reset-pageWrap g2-password-reset-step2"},y().createElement("div",{className:"g2-view-header"},y().createElement($j,{src:i,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},e("login.resetPwd")),y().createElement("div",{className:"title-explain"},e("login.resetPassword.resetPasswordText2",{account:a}))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(sT,{name:"resetPassword",form:m,onFinish:function(){return oQ(void 0,void 0,void 0,(function(){var e,t,o,i,a,c,l,u;return iQ(this,(function(f){switch(f.label){case 0:return null===(i=g.current)||void 0===i||i.onSpin(!0),e=m.getFieldsValue(),[4/*yield*/,null===(c=null===(a=r.options)||void 0===a?void 0:a.encryptFunction)||void 0===c?void 0:c.call(a,e.password,n.publicKey)];case 1:return t=f.sent(),[4/*yield*/,v("/api/v2/password/user-action/check",{userId:s,password:t})];case 2:return 200===(o=f.sent()).code&&(null===(l=null==o?void 0:o.data)||void 0===l?void 0:l.valid)?(v("/api/v2/users/password/forget/link-reset-password",{token:d,newPassword:t}).then((function(e){var t;null===(t=g.current)||void 0===t||t.onSpin(!1);var n=e.code;n===mQ.UNSAFE_PASSWORD_TIP&&h(!0),200===n||
18853
+ */return y().createElement("div",{className:"g2-view-container g2-forget-password g2-password-reset-pageWrap g2-password-reset-step2"},y().createElement("div",{className:"g2-view-header"},y().createElement($j,{src:a,size:48,borderRadius:4,alt:"",className:"icon"}),y().createElement("div",{className:"title"},e("login.resetPwd")),y().createElement("div",{className:"title-explain"},e("login.resetPassword.resetPasswordText2",{account:s}))),y().createElement("div",{className:"g2-view-tabs"},y().createElement(sT,{name:"resetPassword",form:v,onFinish:function(){return oQ(void 0,void 0,void 0,(function(){var e,t,o,a,s,l,u,d;return iQ(this,(function(p){switch(p.label){case 0:return null===(a=b.current)||void 0===a||a.onSpin(!0),e=v.getFieldsValue(),[4/*yield*/,null===(l=null===(s=r.options)||void 0===s?void 0:s.encryptFunction)||void 0===l?void 0:l.call(s,e.password,n.publicKey)];case 1:return t=p.sent(),[4/*yield*/,g("/api/v2/password/user-action/check",{userId:c,password:t})];case 2:return 200===(o=p.sent()).code&&(null===(u=null==o?void 0:o.data)||void 0===u?void 0:u.valid)?(g("/api/v2/users/password/forget/link-reset-password",{token:f,newPassword:t}).then((function(e){var t;null===(t=b.current)||void 0===t||t.onSpin(!1);var n=e.code;n===mQ.UNSAFE_PASSWORD_TIP&&m(!0),200===n?
18854
+ // events?.onPwdReset?.(authClient)
18855
+ null==i||i(DL.LOGIN):
18854
18856
  // events?.onPwdResetError?.(r, authClient)
18855
- vC.error(null==e?void 0:e.message)})).catch((function(e){g.current.onError(),
18857
+ vC.error(null==e?void 0:e.message)})).catch((function(e){b.current.onError(),
18856
18858
  // props.onSendError(codeMethod, e)
18857
18859
  // events?.onPwdResetError?.(e, authClient)
18858
- vC.error(e.message)})),[2/*return*/]):(null===(u=g.current)||void 0===u||u.onSpin(!1),vC.error(null==o?void 0:o.message),[2/*return*/])}}))}))},onFinishFailed:function(){var e;null===(e=null==g?void 0:g.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(sT.Item,{className:"authing-g2-input-form-password",name:"password",rules:u},y().createElement(GV,{className:"authing-g2-input",size:"large",placeholder:e("login.resetPassword.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95",marginBottom:2}})})),y().createElement(sT.Item,{className:"authing-g2-input-form-password-repeat",name:"repeatPassword",validateFirst:!0,rules:[{required:!0,message:e("login.resetPassword.pleaseInputPassword")},function(t){var n=t.getFieldValue;return{validator:function(t,r){var o=n("password");return void 0===o&&void 0===r||o===r?Promise.resolve():Promise.reject(e("login.resetPassword.checkPasswordDiff"))}}}]},y().createElement(GV,{className:"authing-g2-input",size:"large",placeholder:e("login.resetPassword.confirmNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95",marginBottom:2}})})),p(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Pj,{className:"reset-password-button",text:e("login.resetPassword.reset"),ref:g})))),c&&y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:c},e("login.resetPassword.back"))))},lQ=function(){return lQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lQ.apply(this,arguments)},uQ=y().useEffect,dQ=y().useMemo,fQ="authing-ant";vC.config({prefixCls:"".concat(fQ,"-message")}),function(e){e.zhCn="zh-CN",e.enUs="en-US",e.jaJp="ja-JP",e.zhTw="zh-TW"}(QJ||(QJ={}));var pQ,hQ,mQ,vQ=((ZJ={})[QJ.zhCn]=GD.zhCN,ZJ[QJ.enUs]=GD.enUS,ZJ[QJ.jaJp]=GD.jaJP,ZJ[QJ.zhTw]=GD.zhTW,ZJ),gQ=function(e){var t,n,r,o,i=e.guardProps,a=QD(tL).defaultMergedConfig,s=QD(tL).contextLoaded,c=uL().moduleName,l=iL(),u=fL().changeModule,d=(o=nL.Provider,{GuardButtonProvider:function(e){var t=e.children,n=ZD(y().useState(!1),2),r=n[0],i=n[1];return y().createElement(o,{value:{spin:r,spinChange:function(e){i(e)}}},t)}}).GuardButtonProvider,f=dQ((function(){return a.loadingComponent}),[a]),p=(
18860
+ vC.error(e.message)})),[2/*return*/]):(null===(d=b.current)||void 0===d||d.onSpin(!1),vC.error(null==o?void 0:o.message),[2/*return*/])}}))}))},onFinishFailed:function(){var e;null===(e=null==b?void 0:b.current)||void 0===e||e.onError()},autoComplete:"off"},y().createElement(sT.Item,{className:"authing-g2-input-form-password",name:"password",rules:d},y().createElement(GV,{className:"authing-g2-input",size:"large",placeholder:e("login.resetPassword.inputNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95",marginBottom:2}})})),y().createElement(sT.Item,{className:"authing-g2-input-form-password-repeat",name:"repeatPassword",validateFirst:!0,rules:[{required:!0,message:e("login.resetPassword.pleaseInputPassword")},function(t){var n=t.getFieldValue;return{validator:function(t,r){var o=n("password");return void 0===o&&void 0===r||o===r?Promise.resolve():Promise.reject(e("login.resetPassword.checkPasswordDiff"))}}}]},y().createElement(GV,{className:"authing-g2-input",size:"large",placeholder:e("login.resetPassword.confirmNewPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95",marginBottom:2}})})),h(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form submit-form"},y().createElement(Pj,{className:"reset-password-button",text:e("login.resetPassword.reset"),ref:b})))),l&&y().createElement("div",{className:"g2-tips-line"},y().createElement("div",{className:"link-like back-to-login",onClick:l},e("login.resetPassword.back"))))},lQ=function(){return lQ=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},lQ.apply(this,arguments)},uQ=y().useEffect,dQ=y().useMemo,fQ="authing-ant";vC.config({prefixCls:"".concat(fQ,"-message")}),function(e){e.zhCn="zh-CN",e.enUs="en-US",e.jaJp="ja-JP",e.zhTw="zh-TW"}(QJ||(QJ={}));var pQ,hQ,mQ,vQ=((ZJ={})[QJ.zhCn]=GD.zhCN,ZJ[QJ.enUs]=GD.enUS,ZJ[QJ.jaJp]=GD.jaJP,ZJ[QJ.zhTw]=GD.zhTW,ZJ),gQ=function(e){var t,n,r,o,i=e.guardProps,a=QD(tL).defaultMergedConfig,s=QD(tL).contextLoaded,c=uL().moduleName,l=iL(),u=fL().changeModule,d=(o=nL.Provider,{GuardButtonProvider:function(e){var t=e.children,n=ZD(y().useState(!1),2),r=n[0],i=n[1];return y().createElement(o,{value:{spin:r,spinChange:function(e){i(e)}}},t)}}).GuardButtonProvider,f=dQ((function(){return a.loadingComponent}),[a]),p=(
18859
18861
  // Error
18860
18862
  (t={})[DL.ERROR]=function(e){return y().createElement(kV,{key:e})},
18861
18863
  // Login
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.33-alpha.2",
3
+ "version": "4.5.33-alpha.3",
4
4
  "description": "Guard shim for react 16 / 17, only be used to internal",
5
5
  "types": "dist/typings/src/index.d.ts",
6
6
  "module": "dist/guard.min.js",