@authing/guard-shim-react 4.5.11-alpha.8 → 4.5.11-alpha.9

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
@@ -12584,7 +12584,7 @@ e.SELF_UNLOCKING_VERIFY_CODE="SELF_UNLOCKING_VERIFY_CODE"}(Nc||(Nc={}));
12584
12584
  // EXTERNAL MODULE: ./node_modules/ua-parser-js/src/ua-parser.js
12585
12585
  var Mc=i(1763),Dc=i.n(Mc),Lc=i(1935),Fc=i.n(Lc),jc=function(){return"undefined"==typeof navigator?null:/MicroMessenger/i.test(null===navigator||void 0===navigator?void 0:navigator.userAgent)&&!/wxwork/i.test(navigator.userAgent)},Bc=function(){return"undefined"==typeof navigator?null:/Lark/i.test(navigator.userAgent)},qc=function(){return"undefined"==typeof navigator?null:/dingtalk/i.test(navigator.userAgent)},Uc=function(){var e;
12586
12586
  // 1. 首先筛选出一定是特殊浏览器的 UA
12587
- if(jc()||/wxwork/i.test(navigator.userAgent)||Bc()||qc()||"undefined"!=typeof navigator&&/QtWebEngine/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/MiuiBrowser/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/MQQBrowser/i.test(navigator.userAgent)||window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))return!0;
12587
+ if(jc()||/wxwork/i.test(navigator.userAgent)||Bc()||qc()||"undefined"!=typeof navigator&&/QtWebEngine/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/MiuiBrowser/i.test(navigator.userAgent)||"undefined"!=typeof navigator&&/MQQBrowser/i.test(navigator.userAgent)||window.navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i)||window.navigator.userAgent.match(/webview/i))return!0;
12588
12588
  // 2. 利用 ua-parser-js 进一步判断,筛选出很可能不是特殊浏览器的 UA
12589
12589
  // 由于一些特殊浏览器也可能会被误判为非特殊,所以需要首先经过第 1 步筛选
12590
12590
  var t=Dc()();return!["Chrome","Firefox","Safari","Opera","IE","Edge"].includes(null!==(e=t.browser.name)&&void 0!==e?e:"");
@@ -17582,7 +17582,7 @@ var $D=i(4232),zD=i(4631),HD=i(1062),WD=i(8787),GD={zhCN:$D/* default */.Z,enUS:
17582
17582
  * 多账号 状态
17583
17583
  */
17584
17584
  multipleInstance:{isMultipleAccount:!1,instance:void 0,referMultipleState:void 0,multipleAccountData:void 0,clearBackFillData:void 0},phoneRegex:null,defaultLanguageConfig:"zh-CN",tenantInstance:void 0,isForeignUserpool:!1},tL=y().createContext(eL),nL=y().createContext({spin:!1,spinChange:function(){}}),rL=function(){return ZD(nL)},oL=function(){return ZD(tL).publicConfig},iL=function(){return ZD(tL).httpClient},aL=function(){return ZD(tL).appId},sL=function(){return ZD(tL).tenantId};function cL(){return ZD(tL).initData}var lL=function(){return ZD(tL).currentModule},uL=function(){return ZD(tL).events},dL=function(){var e=ZD(tL);return{changeModule:e.changeModule,backModule:e.backModule,currentModule:e.currentModule}},fL=function(){return ZD(tL).finallyConfig},pL=function(){return ZD(tL).isAuthFlow},hL=function(){return ZD(tL).multipleInstance},mL=function(){return ZD(tL).phoneRegex},vL=function(){return ZD(tL).defaultLanguageConfig},gL=function(){var e=oL(),t=e.customSecurityEnabled,n=e.appRobotVerify,r=e.userpoolRobotVerify;return t?n:r},yL=function(){return ZD(tL).isForeignUserpool},bL=y().useMemo,wL={"zh-CN":{label:"简体中文"},"zh-TW":{label:"繁體中文"},"en-US":{label:"English"},"ja-JP":{label:"日本語"}},CL=function(e){var t=e.langRange,n=void 0===t?["zh-CN","zh-TW","en-US","ja-JP"]:t,r=e.onLangChange,o=Pu().i18n,i=ZD(tL).guardPageConfig,a=fL(),s=bL((function(){return"g2-change-language-text ".concat(a.mode)}),[a]),c=bL((function(){var e;return null===(e=i.global)||void 0===e?void 0:e.showChangeLanguage}),[i]),l=bL((function(){return Object.keys(wL).includes(o.resolvedLanguage)?o.resolvedLanguage:ud(o.resolvedLanguage)[0]||"en-US"}),[o.resolvedLanguage]),u=bL((function(){return y().createElement(y().Fragment,null,y().createElement("span",null,wL[l].label))}),[l]),d=bL((function(){return Object.keys(wL).filter((function(e){return n.includes(e)})).map((function(e){return{key:e,label:wL[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
17585
- const EL=JSON.parse('{"i8":"4.5.11-alpha.8"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
17585
+ const EL=JSON.parse('{"i8":"4.5.11-alpha.9"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
17586
17586
  function kL(){return EL.i8}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
17587
17587
  var SL,xL=function(){return SL},PL=function(e){SL=e},_L=function(){return _L=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},_L.apply(this,arguments)},TL=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())}))},OL=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])}}},NL=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},IL=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))},AL=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return TL(void 0,void 0,void 0,(function(){return OL(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,IL([],NL(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},RL=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};AL.get=function(e,t,n){return void 0===t&&(t={}),TL(void 0,void 0,void 0,(function(){var r,o,i,a,s;return OL(this,(function(c){switch(c.label){case 0:r=_L(_L({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[AL.langHeader]=uZ(),s)),""!==AL.tenantId&&(r[AL.tenantHeader]=AL.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([RL(i.cancel),ma()("".concat(AL.baseUrl).concat(e).concat(Fc().stringify(t,{addQueryPrefix:!0})),_L(_L({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*/]}}))}))},AL.post=function(e,t,n){return TL(void 0,void 0,void 0,(function(){var r,o,i,a,s,c;return OL(this,(function(l){switch(l.label){case 0:r=_L(_L({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[AL.langHeader]=su.resolvedLanguage,s)),""!==AL.tenantId&&(r[AL.tenantHeader]=AL.tenantId),l.label=1;case 1:return l.trys.push([1,3,,4]),o=ma().CancelToken,i=o.source(),[4/*yield*/,Promise.race([RL(i.cancel),ma()("".concat(AL.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:i.token,headers:_L(_L({"Content-Type":"application/json"},null==n?void 0:n.headers),(c={},c[AL.langHeader]=uZ(),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*/]}}))}))},AL.postForm=function(e,t,n){return TL(void 0,void 0,void 0,(function(){var r,o,i,a;return OL(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([RL(o.cancel),ma()("".concat(AL.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:_L(_L({},null==n?void 0:n.headers),(a={},a[AL.langHeader]=uZ(),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*/]}}))}))},AL.baseUrl="",AL.setBaseUrl=function(e){AL.baseUrl=e.replace(/\/$/,"")};var ML,DL="x-authing-lang";AL.langHeader=DL,AL.tenantHeader="x-authing-app-tenant-idåå",AL.tenantId="",AL.setLangHeader=function(e){AL.langHeader=e||DL},AL.setTenantHeader=function(e){AL.tenantHeader=e||DL},AL.setTenantId=function(e){AL.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",
17588
17588
  /** 多租户门户选择页 */
@@ -18080,7 +18080,7 @@ return["country","gender"].includes(e.name)?n(k[e.name]({options:e.options,key:e
18080
18080
  // TODO 默认这里手机号与邮箱 都是有验证码的
18081
18081
  if("phone"===t){if(d){var r=uj(d,e[t],p).countryCode;return DU(DU({},n),{code:e.phoneCode,phoneCountryCode:r})}return DU(DU({},n),{code:e.phoneCode})}return"email"===t?DU(DU({},n),{code:e.emailCode}):n})),k.label=1;case 1:return k.trys.push([1,9,10,11]),t.includes("username")?[4/*yield*/,v("/api/v2/users/is-user-exists",{username:e.username})]:[3/*break*/,3];case 2:
18082
18082
  // checkResult 为 true 时 代表用户名已存在 直接报message 并且不调用注册接口
18083
- if(r=k.sent(),i=r.data,200===(h=r.code)&&i)return vC.error(b("common.userNameIsExists")),[2/*return*/];k.label=3;case 3:return t.includes("phone")?(a={phone:e.phone,phoneCode:e.phoneCode},d&&(c=uj(d,e.phone,p).countryCode,a.phoneCountryCode=c),[4/*yield*/,g("/api/v2/sms/preCheckCode",a)]):[3/*break*/,5];case 4:if(l=k.sent(),h=l.statusCode,u=l.data,y=u.valid,w=u.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=5;case 5:return t.includes("email")?[4/*yield*/,g("/api/v2/email/preCheckCode",{email:e.email,emailCode:e.emailCode})]:[3/*break*/,7];case 6:if(f=k.sent(),h=f.statusCode,m=f.data,y=m.valid,w=m.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=7;case 7:return[4/*yield*/,null==o?void 0:o({fieldValues:n})];case 8:return k.sent(),[3/*break*/,11];case 9:return k.sent(),[3/*break*/,11];case 10:return null===(E=s.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 11:return[2/*return*/]}}))}))}),[p]),2),N=O[1];return y().createElement(sT,{layout:"vertical",form:w,onFinish:N,onSubmitCapture:function(){return s.current.onSpin(!0)},onFinishFailed:function(){return s.current.onError()},className:"authing-g2-completeInfo-form authing-g2-form-required-item-icon-after"},T,y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:b("common.problem.form.submit"),ref:s,className:"password g2-completeInfo-submit"})))},KU=function(){return KU=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},KU.apply(this,arguments)},YU=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())}))},JU=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])}}};!function(e){e.Complete="complete-completion",e.Skip="skip-completion"}(mU||(mU={}));var QU,ZU=function(e,t){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,AQ().authFlow)(e,t)];case 1:return[2/*return*/,n.sent()]}}))}))},XU=function(e,t,n){var r,o,i=AQ().post;if("registerByEmail"===e){var a=n.phoneToken;return delete n.phoneToken,i("/api/v2/register-email",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:a,postUserInfoPipeline:!0}))}if("registerByPhoneCode"===e){var s=null==n?void 0:n.emailToken;return null==n||delete n.emailToken,i("/api/v2/register-phone-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),emailToken:s,postUserInfoPipeline:!0}))}if("registerByEmailCode"===e){a=n.phoneToken;return delete n.phoneToken,i("/api/v2/register-email-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:a,postUserInfoPipeline:!0}))}a=null!==(r=n.phoneToken)&&void 0!==r?r:null==t?void 0:t.phoneToken,s=null!==(o=n.emailToken)&&void 0!==o?o:null==t?void 0:t.emailToken;return delete n.phoneToken,delete n.emailToken,i("/api/v2/register-".concat(e.split("-")[0]),KU(KU({},t),{profile:KU(KU({},t.profile),n),postUserInfoPipeline:!0,phoneToken:a,emailToken:s}))},eV=function(e,t,n,r){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(o){switch(o.label){case 0:return e!==mU.Skip?[3/*break*/,2]:[4/*yield*/,(i=t,a=n,s=AQ().post,s("registerByEmail"===i?"/api/v2/register-email":"registerByPhoneCode"===i?"/api/v2/register-phone-code":"registerByEmailCode"===i?"/api/v2/register-email-code":"/api/v2/register-".concat(i.split("-")[0]),a))];case 1:case 3:return[2/*return*/,o.sent()];case 2:return e!==mU.Complete?[3/*break*/,4]:[4/*yield*/,XU(t,n,r)];case 4:return[2/*return*/]}var i,a,s}))}))},tV=function(){return tV=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},tV.apply(this,arguments)},nV=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())}))},rV=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])}}},oV=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},iV=y().useCallback,aV=y().useEffect,sV=y().useMemo,cV=y().useState,lV=function(e){var t=e.metaData,n=e.businessRequest,r=e.skipComplateFileds;fB();var o=fL(),i=Pu().t,a=rL().spinChange,s=oV(cV(!1),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-complete-info"},y().createElement("div",{className:"g2-view-header"},y().createElement("div",{className:"g2-completeInfo-header"},y().createElement(Bj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),r&&y().createElement(hj,{className:"g2-completeInfo-header-skip",type:"link",loading:c,onClick:function(){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(e){switch(e.label){case 0:return a(!0),l(!0),[4/*yield*/,n(mU.Skip)];case 1:return e.sent(),l(!1),a(!1),[2/*return*/]}}))}))}},!c&&y().createElement(YD,{type:"authing-a-share-forward-line1"}),y().createElement("span",null,i("common.skip")))),y().createElement("div",{className:"title"},i("common.perfectUserInfo")),y().createElement("div",{className:"title-explain"},i("common.welcomeDoc",{name:o.title}))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(GU,{metaData:t,businessRequest:function(e){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,null==n?void 0:n(mU.Complete,e)];case 1:return[2/*return*/,t.sent()]}}))}))}})))},uV=function(){var e=cL(),t=e.metaData,n=e.skip,r=uL(),o=WL(),i=hL().instance;return y().createElement(lV,{metaData:t,businessRequest:function(e,t){return nV(void 0,void 0,void 0,(function(){var n,a,s,c,l,u,d;return rV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,ZU(e,t)];case 1:return n=f.sent(),a=n.isFlowEnd,s=n.data,c=n.onGuardHandling,l=null==i?void 0:i.getOriginAccount(),u="password"===(null==i?void 0:i.getOriginWay())?null==i?void 0:i.setLoginWayByHttpData:null==i?void 0:i.setLoginWayByLDAPData,s&&i&&l&&u(l,s),a?null===(d=null==r?void 0:r.onLogin)||void 0===d||d.call(r,s,o):null==c||c(),[2/*return*/]}}))}))},skipComplateFileds:n})},dV=function(){var e=cL(),t=oL(),n=uL(),r=WL(),o=iL().get,i=fL(),a=oV(cV(),2),s=a[0],c=a[1],l=oV(cV(),2),u=l[0],d=l[1],f=sV((function(){return null==t?void 0:t.extendsFields.filter((function(t){return t.name!==sq[e.businessRequestName]}))}),[e.businessRequestName,null==t?void 0:t.extendsFields]),p=null==t?void 0:t.skipComplateFileds,h=sV((function(){return i.loadingComponent}),[i.loadingComponent]),m=iV((function(){return nV(void 0,void 0,void 0,(function(){var e;return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,o("/api/v2/udfs/field-metadata-for-completion",void 0,{})];case 1:return e=t.sent().data,c(e),[2/*return*/]}}))}))}),[o]);return aV((function(){m()}),[m]),aV((function(){if(s){var e=function(e,t){return void 0===e&&(e=[]),e.map((function(e){var n;return{type:e.inputType,label:e.label,name:e.name,required:e.required,validateRules:e.validateRules.map((function(e){return{type:e.type,content:e.content,errorMessage:e.errorMessage,i18n:e.i18n}})),options:null===(n=t.find((function(t){return t.key===e.name})))||void 0===n?void 0:n.options}}))}(f,s);d(e)}}),[f,s]),y().createElement(y().Fragment,null,u?y().createElement(lV,{metaData:u,skipComplateFileds:p,businessRequest:function(t,o){return nV(void 0,void 0,void 0,(function(){var i,a,s,c,l,u,d,p,h,m,v,g,y;return rV(this,(function(b){switch(b.label){case 0:return i=function(e,t){var n=[],r={};return null==t||t.forEach((function(t){var o,i=t.name,a=t.value,s=t.code,c=null===(o=e.find((function(e){return e.name===i})))||void 0===o?void 0:o.type;
18083
+ if(r=k.sent(),i=r.data,200===(h=r.code)&&i)return vC.error(b("common.userNameIsExists")),[2/*return*/];k.label=3;case 3:return t.includes("phone")?(a={phone:e.phone,phoneCode:e.phoneCode},d&&(c=uj(d,e.phone,p).countryCode,a.phoneCountryCode=c),[4/*yield*/,g("/api/v2/sms/preCheckCode",a)]):[3/*break*/,5];case 4:if(l=k.sent(),h=l.statusCode,u=l.data,y=u.valid,w=u.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=5;case 5:return t.includes("email")?[4/*yield*/,g("/api/v2/email/preCheckCode",{email:e.email,emailCode:e.emailCode})]:[3/*break*/,7];case 6:if(f=k.sent(),h=f.statusCode,m=f.data,y=m.valid,w=m.message,200!==h||!y)return vC.error(w),[2/*return*/];k.label=7;case 7:return[4/*yield*/,null==o?void 0:o({fieldValues:n})];case 8:return k.sent(),[3/*break*/,11];case 9:return k.sent(),[3/*break*/,11];case 10:return null===(E=s.current)||void 0===E||E.onSpin(!1),[7/*endfinally*/];case 11:return[2/*return*/]}}))}))}),[p]),2),N=O[1];return y().createElement(sT,{layout:"vertical",form:w,onFinish:N,onSubmitCapture:function(){return s.current.onSpin(!0)},onFinishFailed:function(){return s.current.onError()},className:"authing-g2-completeInfo-form authing-g2-form-required-item-icon-after"},T,y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{text:b("common.problem.form.submit"),ref:s,className:"password g2-completeInfo-submit"})))},KU=function(){return KU=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},KU.apply(this,arguments)},YU=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())}))},JU=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])}}};!function(e){e.Complete="complete-completion",e.Skip="skip-completion"}(mU||(mU={}));var QU,ZU=function(e,t){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(n){switch(n.label){case 0:return[4/*yield*/,(0,AQ().authFlow)(e,t)];case 1:return[2/*return*/,n.sent()]}}))}))},XU=function(e,t,n){var r=AQ().post;if("registerByEmail"===e){var o=n.phoneToken;return delete n.phoneToken,r("/api/v2/register-email",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:o,postUserInfoPipeline:!0}))}if("registerByPhoneCode"===e){var i=null==n?void 0:n.emailToken;return null==n||delete n.emailToken,r("/api/v2/register-phone-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),emailToken:i,postUserInfoPipeline:!0}))}if("registerByEmailCode"===e){o=n.phoneToken;return delete n.phoneToken,r("/api/v2/register-email-code",KU(KU({},t),{profile:KU(KU({},t.profile),n),phoneToken:o,postUserInfoPipeline:!0}))}o=n.phoneToken,i=n.emailToken;return delete n.phoneToken,delete n.emailToken,r("/api/v2/register-".concat(e.split("-")[0]),KU(KU({},t),{profile:KU(KU({},t.profile),n),postUserInfoPipeline:!0,phoneToken:o,emailToken:i}))},eV=function(e,t,n,r){return YU(void 0,void 0,void 0,(function(){return JU(this,(function(o){switch(o.label){case 0:return e!==mU.Skip?[3/*break*/,2]:[4/*yield*/,(i=t,a=n,s=AQ().post,s("registerByEmail"===i?"/api/v2/register-email":"registerByPhoneCode"===i?"/api/v2/register-phone-code":"registerByEmailCode"===i?"/api/v2/register-email-code":"/api/v2/register-".concat(i.split("-")[0]),a))];case 1:case 3:return[2/*return*/,o.sent()];case 2:return e!==mU.Complete?[3/*break*/,4]:[4/*yield*/,XU(t,n,r)];case 4:return[2/*return*/]}var i,a,s}))}))},tV=function(){return tV=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},tV.apply(this,arguments)},nV=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())}))},rV=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])}}},oV=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},iV=y().useCallback,aV=y().useEffect,sV=y().useMemo,cV=y().useState,lV=function(e){var t=e.metaData,n=e.businessRequest,r=e.skipComplateFileds;fB();var o=fL(),i=Pu().t,a=rL().spinChange,s=oV(cV(!1),2),c=s[0],l=s[1];return y().createElement("div",{className:"g2-view-container g2-complete-info"},y().createElement("div",{className:"g2-view-header"},y().createElement("div",{className:"g2-completeInfo-header"},y().createElement(Bj,{src:null==o?void 0:o.logo,size:48,borderRadius:4,alt:"",className:"icon"}),r&&y().createElement(hj,{className:"g2-completeInfo-header-skip",type:"link",loading:c,onClick:function(){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(e){switch(e.label){case 0:return a(!0),l(!0),[4/*yield*/,n(mU.Skip)];case 1:return e.sent(),l(!1),a(!1),[2/*return*/]}}))}))}},!c&&y().createElement(YD,{type:"authing-a-share-forward-line1"}),y().createElement("span",null,i("common.skip")))),y().createElement("div",{className:"title"},i("common.perfectUserInfo")),y().createElement("div",{className:"title-explain"},i("common.welcomeDoc",{name:o.title}))),y().createElement("div",{className:"g2-view-tabs g2-completeInfo-content"},y().createElement(GU,{metaData:t,businessRequest:function(e){return nV(void 0,void 0,void 0,(function(){return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,null==n?void 0:n(mU.Complete,e)];case 1:return[2/*return*/,t.sent()]}}))}))}})))},uV=function(){var e=cL(),t=e.metaData,n=e.skip,r=uL(),o=WL(),i=hL().instance;return y().createElement(lV,{metaData:t,businessRequest:function(e,t){return nV(void 0,void 0,void 0,(function(){var n,a,s,c,l,u,d;return rV(this,(function(f){switch(f.label){case 0:return[4/*yield*/,ZU(e,t)];case 1:return n=f.sent(),a=n.isFlowEnd,s=n.data,c=n.onGuardHandling,l=null==i?void 0:i.getOriginAccount(),u="password"===(null==i?void 0:i.getOriginWay())?null==i?void 0:i.setLoginWayByHttpData:null==i?void 0:i.setLoginWayByLDAPData,s&&i&&l&&u(l,s),a?null===(d=null==r?void 0:r.onLogin)||void 0===d||d.call(r,s,o):null==c||c(),[2/*return*/]}}))}))},skipComplateFileds:n})},dV=function(){var e=cL(),t=oL(),n=uL(),r=WL(),o=iL().get,i=fL(),a=oV(cV(),2),s=a[0],c=a[1],l=oV(cV(),2),u=l[0],d=l[1],f=sV((function(){return null==t?void 0:t.extendsFields.filter((function(t){return t.name!==sq[e.businessRequestName]}))}),[e.businessRequestName,null==t?void 0:t.extendsFields]),p=null==t?void 0:t.skipComplateFileds,h=sV((function(){return i.loadingComponent}),[i.loadingComponent]),m=iV((function(){return nV(void 0,void 0,void 0,(function(){var e;return rV(this,(function(t){switch(t.label){case 0:return[4/*yield*/,o("/api/v2/udfs/field-metadata-for-completion",void 0,{})];case 1:return e=t.sent().data,c(e),[2/*return*/]}}))}))}),[o]);return aV((function(){m()}),[m]),aV((function(){if(s){var e=function(e,t){return void 0===e&&(e=[]),e.map((function(e){var n;return{type:e.inputType,label:e.label,name:e.name,required:e.required,validateRules:e.validateRules.map((function(e){return{type:e.type,content:e.content,errorMessage:e.errorMessage,i18n:e.i18n}})),options:null===(n=t.find((function(t){return t.key===e.name})))||void 0===n?void 0:n.options}}))}(f,s);d(e)}}),[f,s]),y().createElement(y().Fragment,null,u?y().createElement(lV,{metaData:u,skipComplateFileds:p,businessRequest:function(t,o){return nV(void 0,void 0,void 0,(function(){var i,a,s,c,l,u,d,p,h,m,v,g,y;return rV(this,(function(b){switch(b.label){case 0:return i=function(e,t){var n=[],r={};return null==t||t.forEach((function(t){var o,i=t.name,a=t.value,s=t.code,c=null===(o=e.find((function(e){return e.name===i})))||void 0===o?void 0:o.type;
18084
18084
  // 根据字段类型生成不同的数据结构
18085
18085
  "internal"===c?("phone"===i&&(r.phoneToken=s),"email"===i&&(r.emailToken=s),r[i]=a):"user"===c&&n.push({key:i,value:a})})),{registerProfile:r,udf:n}}(f,null==o?void 0:o.fieldValues),a=i.registerProfile,s=i.udf,c=tV(tV({},e.content),{params:JSON.stringify(JSON.parse((null===(h=e.content)||void 0===h?void 0:h.params)?null===(m=e.content)||void 0===m?void 0:m.params:"[]").concat(s))}),[4/*yield*/,eV(t,e.businessRequestName,c,a)];case 1:return 200===(l=b.sent()).statusCode?(e.onRegisterSuccess(l.data),null===(v=null==n?void 0:n.onRegisterInfoCompleted)||void 0===v||v.call(n,l.data,c,r)):(null===(g=null==l?void 0:l.onGuardHandling)||void 0===g||g.call(l),u=l.apiCode,d=l.message,p=l.data,e.onRegisterFailed(u,p,d),null===(y=null==n?void 0:n.onRegisterInfoCompletedError)||void 0===y||y.call(n,{code:u,message:d},c,r)),[2/*return*/]}}))}))}}):h)},fV=y().useMemo;!function(e){e.IOS="ios",e.Android="Android"}(QU||(QU={}));var pV,hV=function(){fB();var e=Pu().t,t=oL(),n=dL().backModule,r=null==t?void 0:t.cdnBase,o=fV((function(){var t;return(t={})[QU.IOS]={title:e("common.downloadTotpAppIOS"),google:"".concat(r,"/GoogleAuthenticator-Apple.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Apple.png")},t[QU.Android]={title:e("common.downloadTotpAppAndroid"),google:"".concat(r,"/GoogleAuthenticator-Authing.png"),microsoft:"".concat(r,"/MicrosoftAuthenticator-Baidu.png")},t}),[r,e]),i=fV((function(){return Object.keys(o).map((function(t,n){return y().createElement(SR.TabPane,{tab:o[t].title,key:n,className:"g2-mfa-download-at-tab"},y().createElement("span",{className:"g2-mfa-totp-download-subtitle"},e("common.downloadTotpAppDocs")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode"},y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Bj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].google,alt:"Google Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Google Authenticator")),y().createElement("div",{className:"g2-mfa-totp-download-qrcode-item"},y().createElement(Bj,{width:120,height:120,className:"g2-mfa-totp-download-image",src:o[t].microsoft,alt:"Microsoft Authenticator"}),y().createElement("span",{className:"g2-mfa-totp-download-qrcode-text"},"Microsoft Authenticator"))))}))}),[o,e]),a=fV((function(){return y().createElement(lB,{onBack:function(){return null==n?void 0:n()}},e("common.backToMFA"))}),[n,e]);return y().createElement("div",{className:"g2-view-container g2-download-authenticator"},a,y().createElement("div",{className:"g2-view-tabs g2-mfa-totp-download-tabs"},y().createElement(SR,{defaultActiveKey:QU.IOS},i)))},mV=y().useMemo,vV=function(e){var t=cL();fB();var n=mV((function(){var n,r,o=null!==(n=null==e?void 0:e.error)&&void 0!==n?n:null==t?void 0:t.error;return null!==(r="".concat(null==o?void 0:o.message))&&void 0!==r?r:"".concat(su.t("user.contactAdministrator"))}),[null==t?void 0:t.error,null==e?void 0:e.error]);return y().createElement("div",{className:"g2-view-container g2-view-error"},y().createElement("div",{className:"g2-error-content"},y().createElement("div",{style:{display:"flex",justifyContent:"center"}},y().createElement("div",{style:{width:240,height:160,backgroundImage:"url(https://authing-files.oss-cn-zhangjiakou.aliyuncs.com/authing-guard/authing_error.svg)",backgroundSize:"contain"}})),y().createElement("div",{className:"g2-error-message"},su.t("user.error")),y().createElement("span",{className:"g2-error-message-text",dangerouslySetInnerHTML:{__html:n}})))},gV=function(){return gV=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},gV.apply(this,arguments)},yV=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())}))},bV=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])}}},wV=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},CV=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},EV=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))},kV=y().useMemo,SV={"phone-code":"phone","email-code":"email"},xV=function(e){var t,n=e.methods,r=e.areaCode,o=void 0===r?"CN":r,i=e.currentMethod,a=e.checkRepeat,s=e.checkExist,c=wV(e,["methods","areaCode","currentMethod","checkRepeat","checkExist"]),l=oL(),u=Pu().t,d=iL().get,f=mL(),p=(null===(t=l.internationalSmsConfig)||void 0===t?void 0:t.enabled)&&"phone-code"===i,h=kV((function(){return"email-code"===i?{field:u("common.emailLabel"),checkRepeatErrorMessage:u("common.checkEmail"),checkExistErrorMessage:u("common.noFindEmail"),formatErrorMessage:u("login.inputCorrectPhone"),pattern:UQ.email}:{field:u("common.phone"),checkRepeatErrorMessage:u("common.checkPhone"),checkExistErrorMessage:u("common.noFindPhone"),formatErrorMessage:u("login.inputCorrectPhone"),pattern:f||UQ.phone}}),[i,f,u]),m=IB((function(e,t,n){var r=e;"phone-code"===i&&p&&(r=uj(p,r,o).phoneNumber);d("/api/v2/users/find",{userPoolId:null==l?void 0:l.userPoolId,key:r,type:SV[i]}).then((function(e){var r=e.data;s&&(Boolean(r)?t(!0):n(h.checkExistErrorMessage)),a&&(Boolean(r)?n(h.checkRepeatErrorMessage):t(!0))}))})),v=kV((function(){return p?{validateTrigger:"onBlur",validator:function(e,t){return yV(void 0,void 0,void 0,(function(){return bV(this,(function(e){return!t||(0,rj.phone)(t,{country:o}).isValid||(0,rj.phone)(t).isValid?[2/*return*/,Promise.resolve()]:[2/*return*/,Promise.reject(u("common.i18nCheckErrorMessage"))]}))}))}}:{validateTrigger:"onBlur",pattern:h.pattern,message:h.formatErrorMessage}}),[o,p,h.formatErrorMessage,h.pattern,u]),g=kV((function(){
18086
18086
  // 如果不是必填就不校验
@@ -18566,19 +18566,15 @@ null===(g=s.current)||void 0===g||g.onError(),[3/*break*/,6];case 5:return null=
18566
18566
  // 开关控制 如果没有 register 就不开启了
18567
18567
  return!!oL().complateFiledsPlace.includes("register")&&(
18568
18568
  // 排除掉已有的字段
18569
- !(!Boolean(hd()(t,e))||0===t.length)&&(1!==t.length||t[0].name!==e))},rY=function(){return rY=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},rY.apply(this,arguments)},oY=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())}))},iY=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])}}},aY=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},sY=y().useRef,cY=y().useState,lY=y().useCallback,uY=y().useMemo,dY=function(e){var t,n,r,o,i=e.label,a=e.method,s=e.onRegisterSuccess,c=e.onRegisterFailed,l=e.onBeforeRegister,u=e.agreements,d=e.registeContext,f=e.publicConfig,p=Pu().t,h=sY(null),m=lj().isPhoneMedia,v=WL(),g=aY(sT.useForm(),1)[0],b=fL(),w=nY((a||"email").split("-")[0]),C=dL().changeModule,E=iL().post,k=aY(cY(!1),2),S=k[0],x=k[1],P=aY(cY(!1),2),_=P[0],T=P[1],O=aY(cY((null===(t=null==f?void 0:f.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),N=O[0],I=O[1],A=(null===(n=null==f?void 0:f.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,R=!b.autoRegister&&(null==f?void 0:f.enabledPPRegisterValid),M=null!==(r=null==f?void 0:f.verifyCodeLength)&&void 0!==r?r:4,D=GB(),L=D.getPassWordUnsafeText,F=D.setPasswordErrorTextShow,j=aY(ej((function(e){return oY(void 0,void 0,void 0,(function(){var t,n,r,o,i,f,p,m,g,y,k,x,P,_,O,I,M,D,L,j,B,q;return iY(this,(function(U){switch(U.label){case 0:if(null===(j=h.current)||void 0===j||j.onSpin(!0),!l)return[3/*break*/,4];U.label=1;case 1:return U.trys.push([1,3,,4]),[4/*yield*/,l({type:Ti.Email,data:{identity:e.email||e.account,password:e.password,code:e.code}},v)];case 2:return U.sent()?[3/*break*/,4]:(null===(B=h.current)||void 0===B||B.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(t=U.sent())?vC.error(t):vC.error(null==t?void 0:t.message),null===(q=h.current)||void 0===q||q.onSpin(!1),[2/*return*/];case 4:
18570
- // await form.validateFields()
18571
- return T(!0),(null==u?void 0:u.length)&&!S?(h.current.onError(),[2/*return*/]):(n=e.email,r=e.password,o=e.account,[4/*yield*/,(0,v.options.encryptFunction)(r,b.publicKey)]);case 5:return i=U.sent(),f=null!=d?d:{},"phone-password"===a&&(y=uj(A,o,N),k=y.phoneNumber,x=y.countryCode,o=k,p=x,R&&(m=null==e?void 0:e.code,g={phone:k})),P={account:o,email:n,password:i,phoneCountryCode:p,profile:rY({browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:zQ()},g),forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==b?void 0:b.isHost)?JSON.stringify(JQ(["login_page_context"])):void 0,context:JSON.stringify(f),phoneToken:m},_=function(e){s(e,{registerFrom:Ti.Email,account:n||o})},w?(null==C||C(ML.REGISTER_COMPLETE_INFO,{businessRequestName:a||"registerByEmail",content:rY({},P),onRegisterSuccess:_,onRegisterFailed:c}),[2/*return*/]):[4/*yield*/,E("/api/v2/register-".concat((a||"email").split("-")[0]),rY(rY({},P),{postUserInfoPipeline:!1}))];case 6:return O=U.sent(),I=O.statusCode,M=O.data,D=O.message,L=O.apiCode,200===I?_(M):(L===cQ.UNSAFE_PASSWORD_TIP&&F(!0),h.current.onError(),c(L,M,D),vC.error(D)),[2/*return*/]}}))}))}),[g,S,N],{loading:!1}),2),B=j[1],q=lY((function(e){var t;return f&&(null===(t=f.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(TU,rY({},e,{className:"authing-g2-input",size:"large",areaCode:N,onAreaCodeChange:function(e){I(e),g.getFieldValue(["phone"])&&g.validateFields(["phone"])},maxLength:20})):y().createElement(xq,rY({},e,{className:"authing-g2-input",size:"large",placeholder:p("login.inputPhone"),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),maxLength:11}))}),[N,g,f,p]),U=lY((function(e){return A?y().createElement(Rq,rY({},e,{isInternationSms:A,form:g,fieldName:"account",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:M}),areaCode:N,prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ii.SCENE_TYPE_REGISTER,maxLength:M,onSendCodeBefore:function(){return oY(void 0,void 0,void 0,(function(){return iY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,g.validateFields(["account"])];case 1:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(Rq,rY({},e,{form:g,fieldName:"account",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:p("common.inputFourVerifyCode",{length:M}),maxLength:M,scene:Ii.SCENE_TYPE_REGISTER,prefix:y().createElement(YD,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),onSendCodeBefore:function(){return oY(void 0,void 0,void 0,(function(){return iY(this,(function(e){switch(e.label){case 0:return[4/*yield*/,g.validateFields(["account"])];case 1:return e.sent(),[2/*return*/]}}))}))}}))}),[N,g,A,p,M]),V=uY((function(){var e;return a?"phone-password"===a?y().createElement(y().Fragment,null,y().createElement(UB.Phone,{key:"account",name:"account",className:(null===(e=null==f?void 0:f.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"authing-g2-input-form remove-padding":"authing-g2-input-form",
18572
- // validateFirst={true} // 会多次触发 find 接口
18573
- form:g,checkRepeat:!0,required:!0,areaCode:N},y().createElement(q,{autoFocus:!m})),R&&y().createElement(sT.Item,{key:"code",name:"code",validateTrigger:["onBlur","onChange"],rules:$Q(p("common.captchaCode")),className:"authing-g2-input-form"},y().createElement(U,null))):y().createElement(UB.CustomName,{method:null==a?void 0:a.split("-")[0],key:a,name:"account",className:"authing-g2-input-form",validateFirst:!0,form:g,checkRepeat:!0,required:!0},y().createElement(rO,{maxLength:50,autoFocus:!m,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:p("login.inputAccount",{text:i}),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})):null}),[q,a,m,N,i,p,g,null===(o=null==f?void 0:f.internationalSmsConfig)||void 0===o?void 0:o.enabled]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(sT,{form:g,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return h.current.onSpin(!0)},onFinish:function(e){B(e)},onFinishFailed:function(){return h.current.onError()},onValuesChange:function(e,t){t.password&&t["new-password"]&&g.validateFields(["new-password"])}},a&&i?V:y().createElement(UB.Email,{key:"email",name:"email",className:"authing-g2-input-form",validateFirst:!0,form:g,checkRepeat:!0,required:!0},y().createElement(rO,{autoFocus:!m,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:p("login.inputEmail"),
18569
+ !(!Boolean(hd()(t,e))||0===t.length)&&(1!==t.length||t[0].name!==e))},rY=function(){return rY=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},rY.apply(this,arguments)},oY=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())}))},iY=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])}}},aY=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},sY=y().useRef,cY=y().useState,lY=y().useCallback,uY=y().useMemo,dY=function(e){var t,n,r,o=e.label,i=e.method,a=e.onRegisterSuccess,s=e.onRegisterFailed,c=e.onBeforeRegister,l=e.agreements,u=e.registeContext,d=e.publicConfig,f=Pu().t,p=sY(null),h=lj().isPhoneMedia,m=WL(),v=aY(sT.useForm(),1)[0],g=fL(),b=nY((i||"email").split("-")[0]),w=dL().changeModule,C=iL().post,E=aY(cY(!1),2),k=E[0],S=E[1],x=aY(cY(!1),2),P=x[0],_=x[1],T=aY(cY((null===(t=null==d?void 0:d.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),O=T[0],N=T[1],I=(null===(n=null==d?void 0:d.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,A=GB(),R=A.getPassWordUnsafeText,M=A.setPasswordErrorTextShow,D=aY(ej((function(e){return oY(void 0,void 0,void 0,(function(){var t,n,r,o,d,f,h,y,E,S,x,P,T,N,A,R,D,L,F,j;return iY(this,(function(B){switch(B.label){case 0:if(null===(L=p.current)||void 0===L||L.onSpin(!0),!c)return[3/*break*/,4];B.label=1;case 1:return B.trys.push([1,3,,4]),[4/*yield*/,c({type:Ti.Email,data:{identity:e.email||e.account,password:e.password,code:e.code}},m)];case 2:return B.sent()?[3/*break*/,4]:(null===(F=p.current)||void 0===F||F.onSpin(!1),[2/*return*/]);case 3:return"string"==typeof(t=B.sent())?vC.error(t):vC.error(null==t?void 0:t.message),null===(j=p.current)||void 0===j||j.onSpin(!1),[2/*return*/];case 4:return[4/*yield*/,v.validateFields()];case 5:return B.sent(),_(!0),(null==l?void 0:l.length)&&!k?(p.current.onError(),[2/*return*/]):(n=e.email,r=e.password,o=e.account,[4/*yield*/,(0,m.options.encryptFunction)(r,g.publicKey)]);case 6:return d=B.sent(),f=null!=u?u:{},"phone-password"===i&&(y=uj(I,o,O),E=y.phoneNumber,S=y.countryCode,o=E,h=S),x={account:o,email:n,password:d,phoneCountryCode:h,profile:{browser:"undefined"!=typeof navigator?navigator.userAgent:null,device:zQ()},forceLogin:!1,generateToken:!0,clientIp:void 0,params:(null==g?void 0:g.isHost)?JSON.stringify(JQ(["login_page_context"])):void 0,context:JSON.stringify(f),phoneToken:void 0},P=function(e){a(e,{registerFrom:Ti.Email,account:n||o})},b?(null==w||w(ML.REGISTER_COMPLETE_INFO,{businessRequestName:i||"registerByEmail",content:rY({},x),onRegisterSuccess:P,onRegisterFailed:s}),[2/*return*/]):[4/*yield*/,C("/api/v2/register-".concat((i||"email").split("-")[0]),rY(rY({},x),{postUserInfoPipeline:!1}))];case 7:return T=B.sent(),N=T.statusCode,A=T.data,R=T.message,D=T.apiCode,200===N?P(A):(D===cQ.UNSAFE_PASSWORD_TIP&&M(!0),p.current.onError(),s(D,A,R),vC.error(R)),[2/*return*/]}}))}))}),[v,k,O],{loading:!1}),2),L=D[1],F=lY((function(e){var t;return d&&(null===(t=d.internationalSmsConfig)||void 0===t?void 0:t.enabled)?y().createElement(TU,rY({},e,{className:"authing-g2-input",size:"large",areaCode:O,onAreaCodeChange:function(e){N(e),v.getFieldValue(["phone"])&&v.validateFields(["phone"])},maxLength:20})):y().createElement(xq,rY({},e,{className:"authing-g2-input",size:"large",placeholder:f("login.inputPhone"),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}}),maxLength:11}))}),[O,v,d,f]),j=uY((function(){var e;return i?"phone-password"===i?y().createElement(UB.Phone,{key:"account",name:"account",className:(null===(e=null==d?void 0:d.internationalSmsConfig)||void 0===e?void 0:e.enabled)?"authing-g2-input-form remove-padding":"authing-g2-input-form",validateFirst:!0,form:v,checkRepeat:!0,required:!0,areaCode:O},y().createElement(F,{autoFocus:!h})):y().createElement(UB.CustomName,{method:null==i?void 0:i.split("-")[0],key:i,name:"account",className:"authing-g2-input-form",validateFirst:!0,form:v,checkRepeat:!0,required:!0},y().createElement(rO,{maxLength:50,autoFocus:!h,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:f("login.inputAccount",{text:o}),prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})):null}),[F,i,h,O,o,f,v,null===(r=null==d?void 0:d.internationalSmsConfig)||void 0===r?void 0:r.enabled]);return y().createElement("div",{className:"authing-g2-register-email"},y().createElement(sT,{form:v,name:"emailRegister",autoComplete:"off",onSubmitCapture:function(){return p.current.onSpin(!0)},onFinish:function(e){L(e)},onFinishFailed:function(){return p.current.onError()},onValuesChange:function(e,t){t.password&&t["new-password"]&&v.validateFields(["new-password"])}},i&&o?j:y().createElement(UB.Email,{key:"email",name:"email",className:"authing-g2-input-form",validateFirst:!0,form:v,checkRepeat:!0,required:!0},y().createElement(rO,{autoFocus:!h,className:"authing-g2-input",autoComplete:"off",size:"large",placeholder:f("login.inputEmail"),
18574
18570
  // prefix={<UserOutlined style={{ color: '#878A95' }} />}
18575
- prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{key:"password",name:"password",className:"authing-g2-input-form",validateFirst:!0},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:p("login.inputPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{key:"new-password",name:"new-password",fieldRequiredRuleMessage:p("common.repeatPasswordDoc"),rules:[{validateTrigger:"onBlur",validator:function(e,t){return t!==g.getFieldValue("password")&&t?Promise.reject(p("common.repeatPasswordDoc")):Promise.resolve()}}],className:"authing-g2-input-form",validateFirst:!0},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:p("common.passwordAgain"),
18571
+ prefix:y().createElement(YD,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{key:"password",name:"password",className:"authing-g2-input-form",validateFirst:!0},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:f("login.inputPwd"),prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),y().createElement(UB.Password,{key:"new-password",name:"new-password",fieldRequiredRuleMessage:f("common.repeatPasswordDoc"),rules:[{validateTrigger:"onBlur",validator:function(e,t){return t!==v.getFieldValue("password")&&t?Promise.reject(f("common.repeatPasswordDoc")):Promise.resolve()}}],className:"authing-g2-input-form",validateFirst:!0},y().createElement(zB,{className:"authing-g2-input",size:"large",placeholder:f("common.passwordAgain"),
18576
18572
  // prefix={<LockOutlined style={{ color: '#878A95' }} />}
18577
- prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),Boolean(null==u?void 0:u.length)&&y().createElement(h$,{onChange:x,agreements:u,showError:_}),L(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{
18573
+ prefix:y().createElement(YD,{type:"authing-a-lock-line1",style:{color:"#878A95"}})})),Boolean(null==l?void 0:l.length)&&y().createElement(h$,{onChange:S,agreements:l,showError:P}),R(),y().createElement(sT.Item,{className:"authing-g2-sumbit-form"},y().createElement(Cj,{
18578
18574
  // disabled={
18579
18575
  // !!agreements.find((item) => item.required && !acceptedAgreements)
18580
18576
  // }
18581
- text:p("common.register"),ref:h}))))},fY=function(){return fY=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},fY.apply(this,arguments)},pY=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())}))},hY=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])}}},mY=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},vY=y().useCallback,gY=y().useEffect,yY=y().useRef,bY=y().useState,wY=function(e){var t,n,r,o=e.onRegisterSuccess,i=e.onRegisterFailed,a=e.onBeforeRegister,s=e.agreements,c=e.publicConfig,l=e.registeContext,u=e.methods,d=void 0===u?[]:u,f=Pu().t,p=nY("phone"),h=nY("email"),m=fL(),v=lj().isPhoneMedia,g=WL(),b=dL().changeModule,w=RQ().post,C=yY(null),E=mY(sT.useForm(),1)[0],k=mY(bY(!1),2),S=k[0],x=k[1],P=mY(bY(!1),2),_=P[0],T=P[1],O=mY(bY((null===(t=null==c?void 0:c.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),N=O[0],I=O[1],A=null!==(n=null==c?void 0:c.verifyCodeLength)&&void 0!==n?n:4,R=mY(bY(d[0]),2),M=R[0],D=R[1],L=mY(bY(""),2),F=L[0],j=L[1],B=mY(bY(""),2),q=B[0],U=B[1],V=mY(bY(!1),2),$=V[0],z=V[1],H=(null===(r=null==c?void 0:c.internationalSmsConfig)||void 0===r?void 0:r.enabled)||!1,W=yL(),G=mY(bY(""),2),K=G[0],Y=G[1];gY((function(){var e;
18577
+ text:f("common.register"),ref:p}))))},fY=function(){return fY=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},fY.apply(this,arguments)},pY=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())}))},hY=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])}}},mY=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},vY=y().useCallback,gY=y().useEffect,yY=y().useRef,bY=y().useState,wY=function(e){var t,n,r,o=e.onRegisterSuccess,i=e.onRegisterFailed,a=e.onBeforeRegister,s=e.agreements,c=e.publicConfig,l=e.registeContext,u=e.methods,d=void 0===u?[]:u,f=Pu().t,p=nY("phone"),h=nY("email"),m=fL(),v=lj().isPhoneMedia,g=WL(),b=dL().changeModule,w=RQ().post,C=yY(null),E=mY(sT.useForm(),1)[0],k=mY(bY(!1),2),S=k[0],x=k[1],P=mY(bY(!1),2),_=P[0],T=P[1],O=mY(bY((null===(t=null==c?void 0:c.internationalSmsConfig)||void 0===t?void 0:t.defaultISOType)||"CN"),2),N=O[0],I=O[1],A=null!==(n=null==c?void 0:c.verifyCodeLength)&&void 0!==n?n:4,R=mY(bY(d[0]),2),M=R[0],D=R[1],L=mY(bY(""),2),F=L[0],j=L[1],B=mY(bY(""),2),q=B[0],U=B[1],V=mY(bY(!1),2),$=V[0],z=V[1],H=(null===(r=null==c?void 0:c.internationalSmsConfig)||void 0===r?void 0:r.enabled)||!1,W=yL(),G=mY(bY(""),2),K=G[0],Y=G[1];gY((function(){var e;
18582
18578
  // 开启国际化配置且登录方式为手机号码时
18583
18579
  1===d.length&&"phone-code"===d[0]&&c&&(null===(e=c.internationalSmsConfig)||void 0===e?void 0:e.enabled)&&z(!0)}),[d,c]),gY((function(){
18584
18580
  /** 如果是国外用户池,那么有图形验证码,需要请求图片 */
@@ -318,8 +318,6 @@ export interface ApplicationConfig {
318
318
  * 是否开启注册密码补全
319
319
  */
320
320
  enableCompletePassword: boolean;
321
- /** 是否开启手机密码注册手机号验证 */
322
- enabledPPRegisterValid?: boolean;
323
321
  /**
324
322
  * 登录注册排序
325
323
  */
@@ -16,5 +16,6 @@ export declare const isAlipayBrowser: () => boolean | null;
16
16
  export declare const isBaiduBrowser: () => boolean | null;
17
17
  export declare const isWeComeBrowser: () => boolean;
18
18
  export declare const isMobile: () => RegExpMatchArray | null;
19
+ export declare const isWebview: () => RegExpMatchArray | null;
19
20
  export declare const isSpecialBrowser: () => boolean;
20
21
  export declare const getPhoneInLoginPageContext: () => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@authing/guard-shim-react",
3
- "version": "4.5.11-alpha.8",
3
+ "version": "4.5.11-alpha.9",
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",