@authing/guard-shim-react 4.5.0-alpha.2 → 4.5.0-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
|
@@ -20988,7 +20988,7 @@ this.end=function(){
|
|
|
20988
20988
|
// return [next]
|
|
20989
20989
|
// }
|
|
20990
20990
|
// CONCATENATED MODULE: ./package.json
|
|
20991
|
-
const ij=JSON.parse('{"i8":"4.5.0-alpha.
|
|
20991
|
+
const ij=JSON.parse('{"i8":"4.5.0-alpha.3"}');// CONCATENATED MODULE: ./src/_utils/getVersion.ts
|
|
20992
20992
|
function sj(){return ij.i8}// CONCATENATED MODULE: ./src/_utils/flowHandleStorage.ts
|
|
20993
20993
|
var uj,cj=function(){return uj},lj=function(e){uj=e},dj=function(){return dj=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},dj.apply(this,arguments)},fj=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},hj=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},pj=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},mj=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;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))},gj=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return fj(void 0,void 0,void 0,(function(){return hj(this,(function(t){switch(t.label){case 0:return[4/*yield*/,fetch.apply(void 0,mj([],pj(e),!1))];case 1:return[2/*return*/,t.sent().json()]}}))}))},vj=function(e){return new Promise((function(t){setTimeout((function(){t({data:{code:-1}}),e()}),1e4)}))};gj.get=function(e,t,n){return void 0===t&&(t={}),fj(void 0,void 0,void 0,(function(){var r,o,a,i,s;return hj(this,(function(u){switch(u.label){case 0:r=dj(dj({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[gj.langHeader]=AJ(),s)),""!==gj.tenantId&&(r[gj.tenantHeader]=gj.tenantId),u.label=1;case 1:return u.trys.push([1,3,,4]),o=mi().CancelToken,a=o.source(),[4/*yield*/,Promise.race([vj(a.cancel),mi()("".concat(gj.baseUrl).concat(e).concat(Nu().stringify(t,{addQueryPrefix:!0})),dj(dj({method:"GET"},n),{withCredentials:!0,headers:r,cancelToken:a.token}))])];case 2:return[2/*return*/,null==(i=u.sent())?void 0:i.data];case 3:return u.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},gj.post=function(e,t,n){return fj(void 0,void 0,void 0,(function(){var r,o,a,i,s,u;return hj(this,(function(c){switch(c.label){case 0:r=dj(dj({},null==n?void 0:n.headers),((s={"Content-Type":"application/json"})[gj.langHeader]=al.language,s)),""!==gj.tenantId&&(r[gj.tenantHeader]=gj.tenantId),c.label=1;case 1:return c.trys.push([1,3,,4]),o=mi().CancelToken,a=o.source(),[4/*yield*/,Promise.race([vj(a.cancel),mi()("".concat(gj.baseUrl).concat(e),{data:t,method:"POST",withCredentials:!0,cancelToken:a.token,headers:dj(dj({"Content-Type":"application/json"},null==n?void 0:n.headers),(u={},u[gj.langHeader]=AJ(),u))})])];case 2:return[2/*return*/,null==(i=c.sent())?void 0:i.data];case 3:return c.sent(),[2/*return*/,Promise.resolve({code:-2})];case 4:return[2/*return*/]}}))}))},gj.postForm=function(e,t,n){return fj(void 0,void 0,void 0,(function(){var r,o,a,i;return hj(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),r=mi().CancelToken,o=r.source(),[4/*yield*/,Promise.race([vj(o.cancel),mi()("".concat(gj.baseUrl).concat(e),{method:"POST",data:t,withCredentials:!0,cancelToken:o.token,headers:dj(dj({},null==n?void 0:n.headers),(i={},i[gj.langHeader]=AJ(),i))})])];case 1:return[2/*return*/,null==(a=s.sent())?void 0:a.data];case 2:return s.sent(),[2/*return*/,Promise.resolve({code:-2})];case 3:return[2/*return*/]}}))}))},gj.baseUrl="",gj.setBaseUrl=function(e){gj.baseUrl=e.replace(/\/$/,"")};var yj="x-authing-lang";gj.langHeader=yj,gj.tenantHeader="x-authing-app-tenant-idåå",gj.tenantId="",gj.setLangHeader=function(e){gj.langHeader=e||yj},gj.setTenantHeader=function(e){gj.tenantHeader=e||yj},gj.setTenantId=function(e){gj.tenantId=e};// CONCATENATED MODULE: ./src/_utils/guardHttp.ts
|
|
20994
20994
|
var _j,bj,wj=function(){return wj=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},wj.apply(this,arguments)},Mj=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},kj=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},Lj=sj();!function(e){e.ERROR_CODE="errorCode"}(bj||(bj={}));var Cj=/** @class */function(){function e(e){var t=this;this.headers={"x-authing-userpool-id":"","x-authing-app-id":"","x-authing-sdk-version":Lj,"x-authing-request-from":"Guard@".concat(Lj)},this.responseInterceptorMap=new Map,this.getHeaders=function(){return t.headers},this.get=function(e,n,r){return void 0===n&&(n={}),Mj(t,void 0,void 0,(function(){var t;return kj(this,(function(o){switch(o.label){case 0:return[4/*yield*/,gj.get(e,n,wj(wj({},r),{headers:wj(wj({},this.headers),null==r?void 0:r.headers)}))];case 1:return t=o.sent(),[2/*return*/,this.responseIntercept(t)]}}))}))},this.post=function(e,n,r){return Mj(t,void 0,void 0,(function(){var t;return kj(this,(function(o){switch(o.label){case 0:return[4/*yield*/,gj.post(e,n,{headers:wj(wj({},this.headers),null==r?void 0:r.headers)})];case 1:return t=o.sent(),[2/*return*/,this.responseIntercept(t)]}}))}))},this.postForm=function(e,n,r){return Mj(t,void 0,void 0,(function(){var t;return kj(this,(function(o){switch(o.label){case 0:return[4/*yield*/,gj.postForm(e,n,{headers:wj(wj({},this.headers),null==r?void 0:r.headers)})];case 1:return t=o.sent(),[2/*return*/,this.responseIntercept(t)]}}))}))},this.authFlow=function(e,n){return Mj(t,void 0,void 0,(function(){var t,r;return kj(this,(function(o){switch(o.label){case 0:return"/interaction/authFlow",t=cj(),[4/*yield*/,gj.post("/interaction/authFlow",{action:e,data:n,flowHandle:t},{headers:wj({},this.headers)})];case 1:return r=o.sent(),[2/*return*/,this.responseIntercept(r)]}}))}))},
|
|
@@ -21662,37 +21662,37 @@ var t=null==n?void 0:n.getMemoSingleUser(e);null==r||r("login",t)},handleDel:fun
|
|
|
21662
21662
|
// 7.15: 如果仅剩一个需求跳转
|
|
21663
21663
|
null==r||r("login"):a()}})})),QU=function(){return QU=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},QU.apply(this,arguments)},XU=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},eq=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},tq=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},nq=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},rq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},oq=y().useCallback,aq=y().useRef,iq=function(){var e=aq(null),t=rq(nT.useForm(),1)[0],n=nI(),r=HI(),o=oq((function(t){return tq(void 0,void 0,void 0,(function(){var o,a,i,s,u,c,l,d,f;return nq(this,(function(h){switch(h.label){case 0:return h.trys.push([0,2,,3]),[4/*yield*/,(p="reset-username-before-auth"/* ResetAccountBusinessAction.ResetName */,m=t,XU(void 0,void 0,void 0,(function(){return eq(this,(function(e){switch(e.label){case 0:return[4/*yield*/,(0,Ej().authFlow)(p,QU({},m))];case 1:return[2/*return*/,e.sent()]}}))})))];case 1:return o=h.sent(),a=o.apiCode,i=o.onGuardHandling,s=o.message,u=o.isFlowEnd,c=o.data,null===(l=e.current)||void 0===l||l.onSpin(!1),u?null===(d=null==n?void 0:n.onLogin)||void 0===d||d.call(n,c,r):a===GK.RESET_ACCOUNT_NAME?
|
|
21664
21664
|
// 用户名重复
|
|
21665
|
-
dw.error(s):(null===(f=e.current)||void 0===f||f.onError(),null==i||i()),[3/*break*/,3];case 2:return h.sent(),[3/*break*/,3];case 3:return[2/*return*/]}var p,m}))}))}),[r,n]);return y().createElement("div",{className:"g2-view-reset-username"},y().createElement("div",{className:"g2-view-reset-username__title"},al.t("common.resetAccount.title")),y().createElement(nT,{name:"passworLogin",onFinish:o,onFinishFailed:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.onError()},autoComplete:"off",form:t},y().createElement(qH.UserName,null,y().createElement(QT,{className:"authing-g2-input",size:"large",prefix:y().createElement(HN,{type:"authing-a-user-line1",style:{color:"#878A95"}}),placeholder:al.t("login.inputUsername")})),y().createElement(nT.Item,{className:"authing-g2-sumbit-form"},y().createElement(CR,{text:al.t("common.sure"),className:"password",ref:e}))))},sq=function(){return sq=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},sq.apply(this,arguments)},uq=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},cq=y().useMemo,lq=function(e){var t=e.methods,n=uq(e,["methods"]),r=GN(),o=Ll().t,a=cq((function(){var e;return{"email-code":{t:o("common.email"),sort:2},"phone-code":{t:(null===(e=null==r?void 0:r.internationalSmsConfig)||void 0===e?void 0:e.enabled)?o("common.areaCodePhone"):o("common.phoneNumber"),sort:1}}}),[r,o]),i=cq((function(){return o("login.inputAccount",{text:null==t?void 0:t.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[t,o,a]),s=cq((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(JF,sq({maxLength:11,placeholder:i},n)):y().createElement(QT,sq({placeholder:i},n,{prefix:y().createElement(HN,{type:"authing-a-user-line1",style:{color:"#878A95"}})}))}),[n,t,i]);return y().createElement(y().Fragment,null,s)},dq=function(){return dq=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},dq.apply(this,arguments)},fq=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},hq=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},pq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},mq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;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))};!function(e){e.Phone="phone",e.Email="email"}(kU||(kU={}));var gq,vq=y().useCallback,yq=y().useEffect,_q=y().useMemo,bq=y().useRef,wq=y().useState,Mq=function(e){var t,n,r,o=GN(),a=oI(),i=QN(),s=i._firstItemInitialValue,u=void 0===s?"":s,c=i.specifyDefaultLoginMethod,l=i._lockMethod,d=e.agreements,f=e.methods,h=e.autoRegister,p=e.submitButText,m=e.onLoginFailed,g=e.onLoginSuccess,v=e.saveIdentify,_=e.multipleInstance,b=e.backfillData,w=e.specifyCodeMethod,M=null!==(t=null==o?void 0:o.verifyCodeLength)&&void 0!==t?t:4,k=KN().post,L=LI().isPhoneMedia,C=(null===(n=null==o?void 0:o.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,S=bq(!1),E=pq(wq(!1),2),T=E[0],D=E[1],x=pq(wq(""),2),Y=x[0],P=x[1],O=pq(wq(c&&null!=l?l:f[0]),2),A=O[0],N=O[1],I=pq(wq(!1),2),j=I[0],R=
|
|
21665
|
+
dw.error(s):(null===(f=e.current)||void 0===f||f.onError(),null==i||i()),[3/*break*/,3];case 2:return h.sent(),[3/*break*/,3];case 3:return[2/*return*/]}var p,m}))}))}),[r,n]);return y().createElement("div",{className:"g2-view-reset-username"},y().createElement("div",{className:"g2-view-reset-username__title"},al.t("common.resetAccount.title")),y().createElement(nT,{name:"passworLogin",onFinish:o,onFinishFailed:function(){var t;return null===(t=e.current)||void 0===t?void 0:t.onError()},autoComplete:"off",form:t},y().createElement(qH.UserName,null,y().createElement(QT,{className:"authing-g2-input",size:"large",prefix:y().createElement(HN,{type:"authing-a-user-line1",style:{color:"#878A95"}}),placeholder:al.t("login.inputUsername")})),y().createElement(nT.Item,{className:"authing-g2-sumbit-form"},y().createElement(CR,{text:al.t("common.sure"),className:"password",ref:e}))))},sq=function(){return sq=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},sq.apply(this,arguments)},uq=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},cq=y().useMemo,lq=function(e){var t=e.methods,n=uq(e,["methods"]),r=GN(),o=Ll().t,a=cq((function(){var e;return{"email-code":{t:o("common.email"),sort:2},"phone-code":{t:(null===(e=null==r?void 0:r.internationalSmsConfig)||void 0===e?void 0:e.enabled)?o("common.areaCodePhone"):o("common.phoneNumber"),sort:1}}}),[r,o]),i=cq((function(){return o("login.inputAccount",{text:null==t?void 0:t.map((function(e){return a[e]})).sort((function(e,t){return e.sort-t.sort})).map((function(e){return e.t})).join(" / ")})}),[t,o,a]),s=cq((function(){return 1===t.length&&"phone-code"===t[0]?y().createElement(JF,sq({maxLength:11,placeholder:i},n)):y().createElement(QT,sq({placeholder:i},n,{prefix:y().createElement(HN,{type:"authing-a-user-line1",style:{color:"#878A95"}})}))}),[n,t,i]);return y().createElement(y().Fragment,null,s)},dq=function(){return dq=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},dq.apply(this,arguments)},fq=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{u(r.next(e))}catch(e){a(e)}}function s(e){try{u(r.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,s)}u((r=r.apply(e,t||[])).next())}))},hq=function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(a){return function(s){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,s])}}},pq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},mq=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;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))};!function(e){e.Phone="phone",e.Email="email"}(kU||(kU={}));var gq,vq=y().useCallback,yq=y().useEffect,_q=y().useMemo,bq=y().useRef,wq=y().useState,Mq=function(e){var t,n,r,o=GN(),a=oI(),i=QN(),s=i._firstItemInitialValue,u=void 0===s?"":s,c=i.specifyDefaultLoginMethod,l=i._lockMethod,d=e.agreements,f=e.methods,h=e.autoRegister,p=e.submitButText,m=e.onLoginFailed,g=e.onLoginSuccess,v=e.saveIdentify,_=e.multipleInstance,b=e.backfillData,w=e.specifyCodeMethod,M=null!==(t=null==o?void 0:o.verifyCodeLength)&&void 0!==t?t:4,k=KN().post,L=LI().isPhoneMedia,C=(null===(n=null==o?void 0:o.internationalSmsConfig)||void 0===n?void 0:n.enabled)||!1,S=bq(!1),E=pq(wq(!1),2),T=E[0],D=E[1],x=pq(wq(""),2),Y=x[0],P=x[1],O=pq(wq(c&&null!=l?l:f[0]),2),A=O[0],N=O[1],I=pq(wq(!1),2),j=I[0],R=I[1],H=pq(wq(!1),2),F=H[0],B=H[1],W=pq(wq((null===(r=null==o?void 0:o.internationalSmsConfig)||void 0===r?void 0:r.defaultISOType)||"CN"),2),z=W[0],U=W[1],q=lI(),V=pq(wq(""),2),$=V[0],G=V[1],K=pq(nT.useForm(),1)[0],J=vq((function(e){1!==f.length&&(fJ("email",e)?N(Su.EmailCode):
|
|
21666
21666
|
// 放开手机号校验 方便同时开启邮箱和短信国际化手机号通过
|
|
21667
|
-
N(Su.PhoneCode))}),[f.length]),
|
|
21667
|
+
N(Su.PhoneCode))}),[f.length]),Z=vq((function(e){P(e),J(e)}),[J]);yz({form:K,way:zs.PhoneCode,formKey:"identify",backfillData:b,isOnlyInternationSms:j,setAreaCode:U,cancelBackfill:c===zs.PhoneCode,changeCurrentMethod:Z});var Q=bq(null),X=Ll().t,ee=vq((function(e){return j?y().createElement(_B,dq({},e,{form:K,fieldName:"identify",className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:M}),areaCode:z,prefix:y().createElement(HN,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),isInternationSms:C,scene:Ya.SCENE_TYPE_LOGIN,maxLength:M,onSendCodeBefore:function(){return fq(void 0,void 0,void 0,(function(){return hq(this,(function(e){switch(e.label){case 0:return[4/*yield*/,K.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,K.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})):y().createElement(y().Fragment,null,A===Su.PhoneCode&&y().createElement(_B,dq({},e,{isInternationSms:C,className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:M}),areaCode:z,prefix:y().createElement(HN,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),scene:Ya.SCENE_TYPE_LOGIN,maxLength:M,form:K,fieldName:"identify",data:Y,codeFieldName:"captchaCode",onSendCodeBefore:function(){return fq(void 0,void 0,void 0,(function(){return hq(this,(function(e){switch(e.label){case 0:return[4/*yield*/,K.validateFields(["identify"])];case 1:return e.sent(),[4/*yield*/,K.validateFields(["captchaCode"])];case 2:return e.sent(),[2/*return*/]}}))}))}})),A===Su.EmailCode&&y().createElement(pB,dq({},e,{className:"authing-g2-input g2-send-code-input",autoComplete:"off",size:"large",placeholder:X("common.inputFourVerifyCode",{length:M}),prefix:y().createElement(HN,{type:"authing-a-shield-check-line1",style:{color:"#878A95"}}),form:K,fieldName:"identify",scene:Tu.LOGIN_VERIFY_CODE,maxLength:M,data:Y,onSendCodeBefore:function(){return fq(void 0,void 0,void 0,(function(){return hq(this,(function(e){switch(e.label){case 0:return[4/*yield*/,K.validateFields(["identify"])];case 1:return e.sent(),[2/*return*/]}}))}))}})))}),[z,A,K,Y,C,j,X,M]);yq((function(){var e;
|
|
21668
21668
|
// 开启国际化配置且登录方式为手机号码时
|
|
21669
|
-
(1===f.length&&"phone-code"===f[0]&&(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)||w===kU.Phone)&&N(Su.PhoneCode),
|
|
21669
|
+
(1===f.length&&"phone-code"===f[0]&&(null===(e=null==o?void 0:o.internationalSmsConfig)||void 0===e?void 0:e.enabled)||w===kU.Phone)&&(R(!0),N(Su.PhoneCode)),
|
|
21670
21670
|
// 指定了只用邮箱验证码
|
|
21671
|
-
w===kU.Email&&N(Su.EmailCode)}),[o,f,w]),yq((function(){
|
|
21671
|
+
w===kU.Email&&(B(!0),N(Su.EmailCode))}),[o,f,w]),yq((function(){
|
|
21672
21672
|
/** 如果是国外用户池,那么有图形验证码,需要请求图片 */
|
|
21673
|
-
|
|
21673
|
+
q&&G(_z(a.host))}),[q,null==a?void 0:a.host]),yq((function(){
|
|
21674
21674
|
// 方法发生变化时,图像验证码数据应该清空
|
|
21675
|
-
|
|
21675
|
+
q&&(null==K||K.setFieldsValue({captchaCode:void 0}))}),[K,A,q]);var te=function(e){return fq(void 0,void 0,void 0,(function(){var t,n,r,i,s,u,c,l;return hq(this,(function(d){switch(d.label){case 0:return t={phone:e.phoneNumber,code:e.code,customData:(null==a?void 0:a.isHost)?bJ(["login_page_context"]):void 0,autoRegister:h,withCustomData:!1},o&&(null===(c=o.internationalSmsConfig)||void 0===c?void 0:c.enabled)&&(t.phoneCountryCode=e.phoneCountryCode),[4/*yield*/,k("/api/v2/login/phone-code",t)];case 1:return n=d.sent(),r=n.code,i=n.data,s=n.onGuardHandling,u=n.message,null===(l=Q.current)||void 0===l||l.onSpin(!1),200===r?
|
|
21676
21676
|
// props.onLogin(200, data)
|
|
21677
21677
|
g(i):
|
|
21678
21678
|
// 向上层抛出错误
|
|
21679
|
-
(null==s?void 0:s())===$K.RENDER_MESSAGE&&m(r,i,u),[2/*return*/]}}))}))},
|
|
21679
|
+
(null==s?void 0:s())===$K.RENDER_MESSAGE&&m(r,i,u),[2/*return*/]}}))}))},ne=function(e){return fq(void 0,void 0,void 0,(function(){var t,n,r,o,i,s,u;return hq(this,(function(c){switch(c.label){case 0:return t={email:e.identify,code:e.code,customData:(null==a?void 0:a.isHost)?bJ(["login_page_context"]):void 0,autoRegister:h,withCustomData:!1},[4/*yield*/,k("/api/v2/login/email-code",t)];case 1:return n=c.sent(),r=n.code,o=n.data,i=n.onGuardHandling,s=n.message,null===(u=Q.current)||void 0===u||u.onSpin(!1),200===r?
|
|
21680
21680
|
// props.onLogin(200, data)
|
|
21681
21681
|
g(o):
|
|
21682
21682
|
// 向上层抛出错误
|
|
21683
|
-
(null==i?void 0:i())===$K.RENDER_MESSAGE&&m(r,o,s),[2/*return*/]}}))}))},
|
|
21683
|
+
(null==i?void 0:i())===$K.RENDER_MESSAGE&&m(r,o,s),[2/*return*/]}}))}))},re=_q((function(){var e,t;return p||(h&&!o.registerDisabled&&(null===(t=null===(e=a.registerMethods)||void 0===e?void 0:e.filter((function(e){
|
|
21684
21684
|
// @ts-ignore
|
|
21685
|
-
return[$s.Phone,$s.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(
|
|
21685
|
+
return[$s.Phone,$s.EmailCode].includes(e)})))||void 0===t?void 0:t.length)?"".concat(X("common.login")," / ").concat(X("common.register")):X("common.login"))}),[h,p,X,a.registerMethods,o.registerDisabled]),oe=vq((function(e){return y().createElement(EB,dq({},e,{className:"authing-g2-input",size:"large",areaCode:z,onAreaCodeChange:function(e){U(e),K.getFieldValue(["identify"])&&K.validateFields(["identify"])}}))}),[z,K]),ae=Fu();
|
|
21686
21686
|
// 邮箱验证码登录
|
|
21687
|
-
return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(nT,{name:"phoneCode",form
|
|
21687
|
+
return y().createElement("div",{className:"authing-g2-login-phone-code"},y().createElement(nT,{name:"phoneCode",form:K,onFinish:function(t){return fq(void 0,void 0,void 0,(function(){var n,r,o,a,i,s,u,c,l,f,h,p,v,y,b;return hq(this,(function(w){switch(w.label){case 0:return D(!0),(null==d?void 0:d.length)&&!S.current?(
|
|
21688
21688
|
// message.error(t('common.loginProtocolTips'))
|
|
21689
|
-
|
|
21689
|
+
Q.current.onError(),[2/*return*/]):(n=CI(C,t.identify,z),r=n.phoneNumber,o=n.countryCode,
|
|
21690
21690
|
// onBeforeLogin
|
|
21691
|
-
null===(h=
|
|
21691
|
+
null===(h=Q.current)||void 0===h||h.onSpin(!0),a={type:A,data:{identity:r,code:t.code,phoneCountryCode:o}},[4/*yield*/,null===(p=e.onBeforeLogin)||void 0===p?void 0:p.call(e,a)]);case 1:return!w.sent()&&e.onBeforeLogin?(null===(v=Q.current)||void 0===v||v.onSpin(!1),[2/*return*/]):e.onLoginRequest?[4/*yield*/,null===(y=e.onLoginRequest)||void 0===y?void 0:y.call(e,a)]:[3/*break*/,3];case 2:return i=w.sent(),s=i.code,u=i.apiCode,c=i.data,l=i.onGuardHandling,f=i.message,null===(b=Q.current)||void 0===b||b.onSpin(!1),200===s?g(c):
|
|
21692
21692
|
// 向上层抛出错误 执行绑定失败钩子
|
|
21693
21693
|
(null==l?void 0:l())===$K.RENDER_MESSAGE&&m(null!=u?u:s,c,f),[2/*return*/];case 3:
|
|
21694
21694
|
// 其实这里应该是保存两个 一个是 countryCode 一个是对应的 code
|
|
21695
|
-
return _&&_.setLoginWay("input","phone-code"===A?"phone-code":"email-code",void 0,C?{phoneCountryCode:o,areaCode:
|
|
21695
|
+
return _&&_.setLoginWay("input","phone-code"===A?"phone-code":"email-code",void 0,C?{phoneCountryCode:o,areaCode:z}:void 0),"phone-code"!==A?[3/*break*/,5]:[4/*yield*/,te(dq(dq({},t),{phoneNumber:r,phoneCountryCode:o}))];case 4:return w.sent(),[3/*break*/,7];case 5:return[4/*yield*/,ne(t)];case 6:w.sent(),w.label=7;case 7:return[2/*return*/]}}))}))},onFinishFailed:function(){return Q.current.onError()},autoComplete:"off",onValuesChange:function(e){(null==e?void 0:e.identify)&&v&&v(zs.PhoneCode,null==e?void 0:e.identify)}},y().createElement(LW,{initialValue:c===zs.PhoneCode?u:"phone"!==w&&C||!ae?"":ae,name:"identify",className:j?"authing-g2-input-form remove-padding":"authing-g2-input-form",methods:f,checkExist:!h,currentMethod:A,areaCode:z},j?y().createElement(oe,{autoFocus:!L}):y().createElement(lq,{className:"authing-g2-input",size:"large",autoFocus:!L,value:Y,methods:F?["email-code"]:f,onChange:function(e){var t=e.target.value;J(t)},onBlur:function(e){var t=e.target.value;J(t)},prefix:y().createElement(HN,{type:"authing-a-user-line1",style:{color:"#878A95"}})})),q&&A===Su.PhoneCode&&y().createElement(nT.Item,{className:"authing-g2-input-form",validateTrigger:["onBlur","onChange"],name:"captchaCode",rules:hJ(X("common.captchaCode"))},y().createElement(az,{className:"authing-g2-input",size:"large",placeholder:X("login.inputCaptchaCode"),verifyCodeUrl:$,changeCode:function(){return G(_z(a.host))}})),y().createElement(nT.Item,{validateTrigger:["onBlur","onChange"],className:"authing-g2-input-form",name:"code",rules:mq([],pq(hJ(X("common.captchaCode"))),!1)},y().createElement(ee,null)),Boolean(null==d?void 0:d.length)&&y().createElement(hz,{onChange:function(e){S.current=e},agreements:d,showError:T}),y().createElement(nT.Item,{className:"authing-g2-sumbit-form"},y().createElement(CR,{text:re,className:"password",ref:Q}))))},kq=function(){return gq},Lq=function(e){gq=e};// CONCATENATED MODULE: ./src/Login/core/withAuthingOtpPush/PushLoginGuideSelector.tsx
|
|
21696
21696
|
function Cq(e){var t=e.defaultValue,n=e.onChange,r=e.options;return y().createElement(rY,{defaultValue:t,onChange:n,options:r,dropdownMatchSelectWidth:!1,showArrow:!0})}// CONCATENATED MODULE: ./src/LazyloadImage/index.tsx
|
|
21697
21697
|
var Sq=function(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,a=n.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(r=a.next()).done;)i.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=a.return)&&n.call(a)}finally{if(o)throw o.error}}return i},Eq=y().useEffect,Tq=y().useState;function Dq(e){var t=e.src,n=e.placeholder,r=e.className,o=e.style,a=e.alt,i=e.width,s=e.height,u=Sq(Tq(!1),2),c=u[0],l=u[1],d=new Image(0,0);return d.src=t,Eq((function(){d.onload=function(){l(!0)}})),y().createElement(y().Fragment,null,c&&y().createElement("img",{src:t,width:i,height:s,className:r,style:o,alt:a})||n)}// CONCATENATED MODULE: ./node_modules/qrcode.react/lib/esm/index.js
|
|
21698
21698
|
var xq,Yq=Object.defineProperty,Pq=Object.getOwnPropertySymbols,Oq=Object.prototype.hasOwnProperty,Aq=Object.prototype.propertyIsEnumerable,Nq=(e,t,n)=>t in e?Yq(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Iq=(e,t)=>{for(var n in t||(t={}))Oq.call(t,n)&&Nq(e,n,t[n]);if(Pq)for(var n of Pq(t))Aq.call(t,n)&&Nq(e,n,t[n]);return e},jq=(e,t)=>{var n={};for(var r in e)Oq.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&Pq)for(var r of Pq(e))t.indexOf(r)<0&&Aq.call(e,r)&&(n[r]=e[r]);return n};(e=>{const t=class{constructor(e,n,r,o){if(this.version=e,this.errorCorrectionLevel=n,this.modules=[],this.isFunction=[],e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version value out of range");if(o<-1||o>7)throw new RangeError("Mask value out of range");this.size=4*e+17;let i=[];for(let e=0;e<this.size;e++)i.push(!1);for(let e=0;e<this.size;e++)this.modules.push(i.slice()),this.isFunction.push(i.slice());this.drawFunctionPatterns();const s=this.addEccAndInterleave(r);if(this.drawCodewords(s),-1==o){let e=1e9;for(let t=0;t<8;t++){this.applyMask(t),this.drawFormatBits(t);const n=this.getPenaltyScore();n<e&&(o=t,e=n),this.applyMask(t)}}a(0<=o&&o<=7),this.mask=o,this.applyMask(o),this.drawFormatBits(o),this.isFunction=[]}static encodeText(n,r){const o=e.QrSegment.makeSegments(n);return t.encodeSegments(o,r)}static encodeBinary(n,r){const o=e.QrSegment.makeBytes(n);return t.encodeSegments([o],r)}static encodeSegments(e,n,o=1,i=40,u=-1,c=!0){if(!(t.MIN_VERSION<=o&&o<=i&&i<=t.MAX_VERSION)||u<-1||u>7)throw new RangeError("Invalid value");let l,d;for(l=o;;l++){const r=8*t.getNumDataCodewords(l,n),o=s.getTotalBits(e,l);if(o<=r){d=o;break}if(l>=i)throw new RangeError("Data too long")}for(const e of[t.Ecc.MEDIUM,t.Ecc.QUARTILE,t.Ecc.HIGH])c&&d<=8*t.getNumDataCodewords(l,e)&&(n=e);let f=[];for(const t of e){r(t.mode.modeBits,4,f),r(t.numChars,t.mode.numCharCountBits(l),f);for(const e of t.getData())f.push(e)}a(f.length==d);const h=8*t.getNumDataCodewords(l,n);a(f.length<=h),r(0,Math.min(4,h-f.length),f),r(0,(8-f.length%8)%8,f),a(f.length%8==0);for(let e=236;f.length<h;e^=253)r(e,8,f);let p=[];for(;8*p.length<f.length;)p.push(0);return f.forEach(((e,t)=>p[t>>>3]|=e<<7-(7&t))),new t(l,n,p,u)}getModule(e,t){return 0<=e&&e<this.size&&0<=t&&t<this.size&&this.modules[t][e]}getModules(){return this.modules}drawFunctionPatterns(){for(let e=0;e<this.size;e++)this.setFunctionModule(6,e,e%2==0),this.setFunctionModule(e,6,e%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const e=this.getAlignmentPatternPositions(),t=e.length;for(let n=0;n<t;n++)for(let r=0;r<t;r++)0==n&&0==r||0==n&&r==t-1||n==t-1&&0==r||this.drawAlignmentPattern(e[n],e[r]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(e){const t=this.errorCorrectionLevel.formatBits<<3|e;let n=t;for(let e=0;e<10;e++)n=n<<1^1335*(n>>>9);const r=21522^(t<<10|n);a(r>>>15==0);for(let e=0;e<=5;e++)this.setFunctionModule(8,e,o(r,e));this.setFunctionModule(8,7,o(r,6)),this.setFunctionModule(8,8,o(r,7)),this.setFunctionModule(7,8,o(r,8));for(let e=9;e<15;e++)this.setFunctionModule(14-e,8,o(r,e));for(let e=0;e<8;e++)this.setFunctionModule(this.size-1-e,8,o(r,e));for(let e=8;e<15;e++)this.setFunctionModule(8,this.size-15+e,o(r,e));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let e=this.version;for(let t=0;t<12;t++)e=e<<1^7973*(e>>>11);const t=this.version<<12|e;a(t>>>18==0);for(let e=0;e<18;e++){const n=o(t,e),r=this.size-11+e%3,a=Math.floor(e/3);this.setFunctionModule(r,a,n),this.setFunctionModule(a,r,n)}}drawFinderPattern(e,t){for(let n=-4;n<=4;n++)for(let r=-4;r<=4;r++){const o=Math.max(Math.abs(r),Math.abs(n)),a=e+r,i=t+n;0<=a&&a<this.size&&0<=i&&i<this.size&&this.setFunctionModule(a,i,2!=o&&4!=o)}}drawAlignmentPattern(e,t){for(let n=-2;n<=2;n++)for(let r=-2;r<=2;r++)this.setFunctionModule(e+r,t+n,1!=Math.max(Math.abs(r),Math.abs(n)))}setFunctionModule(e,t,n){this.modules[t][e]=n,this.isFunction[t][e]=!0}addEccAndInterleave(e){const n=this.version,r=this.errorCorrectionLevel;if(e.length!=t.getNumDataCodewords(n,r))throw new RangeError("Invalid argument");const o=t.NUM_ERROR_CORRECTION_BLOCKS[r.ordinal][n],i=t.ECC_CODEWORDS_PER_BLOCK[r.ordinal][n],s=Math.floor(t.getNumRawDataModules(n)/8),u=o-s%o,c=Math.floor(s/o);let l=[];const d=t.reedSolomonComputeDivisor(i);for(let n=0,r=0;n<o;n++){let o=e.slice(r,r+c-i+(n<u?0:1));r+=o.length;const a=t.reedSolomonComputeRemainder(o,d);n<u&&o.push(0),l.push(o.concat(a))}let f=[];for(let e=0;e<l[0].length;e++)l.forEach(((t,n)=>{(e!=c-i||n>=u)&&f.push(t[e])}));return a(f.length==s),f}drawCodewords(e){if(e.length!=Math.floor(t.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let n=0;for(let t=this.size-1;t>=1;t-=2){6==t&&(t=5);for(let r=0;r<this.size;r++)for(let a=0;a<2;a++){const i=t-a,s=0==(t+1&2)?this.size-1-r:r;!this.isFunction[s][i]&&n<8*e.length&&(this.modules[s][i]=o(e[n>>>3],7-(7&n)),n++)}}a(n==8*e.length)}applyMask(e){if(e<0||e>7)throw new RangeError("Mask value out of range");for(let t=0;t<this.size;t++)for(let n=0;n<this.size;n++){let r;switch(e){case 0:r=(n+t)%2==0;break;case 1:r=t%2==0;break;case 2:r=n%3==0;break;case 3:r=(n+t)%3==0;break;case 4:r=(Math.floor(n/3)+Math.floor(t/2))%2==0;break;case 5:r=n*t%2+n*t%3==0;break;case 6:r=(n*t%2+n*t%3)%2==0;break;case 7:r=((n+t)%2+n*t%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[t][n]&&r&&(this.modules[t][n]=!this.modules[t][n])}}getPenaltyScore(){let e=0;for(let n=0;n<this.size;n++){let r=!1,o=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[n][i]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[n][i],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,a)*t.PENALTY_N3}for(let n=0;n<this.size;n++){let r=!1,o=0,a=[0,0,0,0,0,0,0];for(let i=0;i<this.size;i++)this.modules[i][n]==r?(o++,5==o?e+=t.PENALTY_N1:o>5&&e++):(this.finderPenaltyAddHistory(o,a),r||(e+=this.finderPenaltyCountPatterns(a)*t.PENALTY_N3),r=this.modules[i][n],o=1);e+=this.finderPenaltyTerminateAndCount(r,o,a)*t.PENALTY_N3}for(let n=0;n<this.size-1;n++)for(let r=0;r<this.size-1;r++){const o=this.modules[n][r];o==this.modules[n][r+1]&&o==this.modules[n+1][r]&&o==this.modules[n+1][r+1]&&(e+=t.PENALTY_N2)}let n=0;for(const e of this.modules)n=e.reduce(((e,t)=>e+(t?1:0)),n);const r=this.size*this.size,o=Math.ceil(Math.abs(20*n-10*r)/r)-1;return a(0<=o&&o<=9),e+=o*t.PENALTY_N4,a(0<=e&&e<=2568888),e}getAlignmentPatternPositions(){if(1==this.version)return[];{const e=Math.floor(this.version/7)+2,t=32==this.version?26:2*Math.ceil((4*this.version+4)/(2*e-2));let n=[6];for(let r=this.size-7;n.length<e;r-=t)n.splice(1,0,r);return n}}static getNumRawDataModules(e){if(e<t.MIN_VERSION||e>t.MAX_VERSION)throw new RangeError("Version number out of range");let n=(16*e+128)*e+64;if(e>=2){const t=Math.floor(e/7)+2;n-=(25*t-10)*t-55,e>=7&&(n-=36)}return a(208<=n&&n<=29648),n}static getNumDataCodewords(e,n){return Math.floor(t.getNumRawDataModules(e)/8)-t.ECC_CODEWORDS_PER_BLOCK[n.ordinal][e]*t.NUM_ERROR_CORRECTION_BLOCKS[n.ordinal][e]}static reedSolomonComputeDivisor(e){if(e<1||e>255)throw new RangeError("Degree out of range");let n=[];for(let t=0;t<e-1;t++)n.push(0);n.push(1);let r=1;for(let o=0;o<e;o++){for(let e=0;e<n.length;e++)n[e]=t.reedSolomonMultiply(n[e],r),e+1<n.length&&(n[e]^=n[e+1]);r=t.reedSolomonMultiply(r,2)}return n}static reedSolomonComputeRemainder(e,n){let r=n.map((e=>0));for(const o of e){const e=o^r.shift();r.push(0),n.forEach(((n,o)=>r[o]^=t.reedSolomonMultiply(n,e)))}return r}static reedSolomonMultiply(e,t){if(e>>>8!=0||t>>>8!=0)throw new RangeError("Byte out of range");let n=0;for(let r=7;r>=0;r--)n=n<<1^285*(n>>>7),n^=(t>>>r&1)*e;return a(n>>>8==0),n}finderPenaltyCountPatterns(e){const t=e[1];a(t<=3*this.size);const n=t>0&&e[2]==t&&e[3]==3*t&&e[4]==t&&e[5]==t;return(n&&e[0]>=4*t&&e[6]>=t?1:0)+(n&&e[6]>=4*t&&e[0]>=t?1:0)}finderPenaltyTerminateAndCount(e,t,n){return e&&(this.finderPenaltyAddHistory(t,n),t=0),t+=this.size,this.finderPenaltyAddHistory(t,n),this.finderPenaltyCountPatterns(n)}finderPenaltyAddHistory(e,t){0==t[0]&&(e+=this.size),t.pop(),t.unshift(e)}};let n=t;function r(e,t,n){if(t<0||t>31||e>>>t!=0)throw new RangeError("Value out of range");for(let r=t-1;r>=0;r--)n.push(e>>>r&1)}function o(e,t){return 0!=(e>>>t&1)}function a(e){if(!e)throw new Error("Assertion error")}n.MIN_VERSION=1,n.MAX_VERSION=40,n.PENALTY_N1=3,n.PENALTY_N2=3,n.PENALTY_N3=40,n.PENALTY_N4=10,n.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],n.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],e.QrCode=n;const i=class{constructor(e,t,n){if(this.mode=e,this.numChars=t,this.bitData=n,t<0)throw new RangeError("Invalid argument");this.bitData=n.slice()}static makeBytes(e){let t=[];for(const n of e)r(n,8,t);return new i(i.Mode.BYTE,e.length,t)}static makeNumeric(e){if(!i.isNumeric(e))throw new RangeError("String contains non-numeric characters");let t=[];for(let n=0;n<e.length;){const o=Math.min(e.length-n,3);r(parseInt(e.substr(n,o),10),3*o+1,t),n+=o}return new i(i.Mode.NUMERIC,e.length,t)}static makeAlphanumeric(e){if(!i.isAlphanumeric(e))throw new RangeError("String contains unencodable characters in alphanumeric mode");let t,n=[];for(t=0;t+2<=e.length;t+=2){let o=45*i.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t));o+=i.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t+1)),r(o,11,n)}return t<e.length&&r(i.ALPHANUMERIC_CHARSET.indexOf(e.charAt(t)),6,n),new i(i.Mode.ALPHANUMERIC,e.length,n)}static makeSegments(e){return""==e?[]:i.isNumeric(e)?[i.makeNumeric(e)]:i.isAlphanumeric(e)?[i.makeAlphanumeric(e)]:[i.makeBytes(i.toUtf8ByteArray(e))]}static makeEci(e){let t=[];if(e<0)throw new RangeError("ECI assignment value out of range");if(e<128)r(e,8,t);else if(e<16384)r(2,2,t),r(e,14,t);else{if(!(e<1e6))throw new RangeError("ECI assignment value out of range");r(6,3,t),r(e,21,t)}return new i(i.Mode.ECI,0,t)}static isNumeric(e){return i.NUMERIC_REGEX.test(e)}static isAlphanumeric(e){return i.ALPHANUMERIC_REGEX.test(e)}getData(){return this.bitData.slice()}static getTotalBits(e,t){let n=0;for(const r of e){const e=r.mode.numCharCountBits(t);if(r.numChars>=1<<e)return 1/0;n+=4+e+r.bitData.length}return n}static toUtf8ByteArray(e){e=encodeURI(e);let t=[];for(let n=0;n<e.length;n++)"%"!=e.charAt(n)?t.push(e.charCodeAt(n)):(t.push(parseInt(e.substr(n+1,2),16)),n+=2);return t}};let s=i;s.NUMERIC_REGEX=/^[0-9]*$/,s.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,s.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:",e.QrSegment=s})(xq||(xq={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.ordinal=e,this.formatBits=t}};let n=t;n.LOW=new t(0,1),n.MEDIUM=new t(1,0),n.QUARTILE=new t(2,3),n.HIGH=new t(3,2),e.Ecc=n})(t=e.QrCode||(e.QrCode={}))})(xq||(xq={})),(e=>{let t;(e=>{const t=class{constructor(e,t){this.modeBits=e,this.numBitsCharCount=t}numCharCountBits(e){return this.numBitsCharCount[Math.floor((e+7)/17)]}};let n=t;n.NUMERIC=new t(1,[10,12,14]),n.ALPHANUMERIC=new t(2,[9,11,13]),n.BYTE=new t(4,[8,16,16]),n.KANJI=new t(8,[8,10,12]),n.ECI=new t(7,[0,0,0]),e.Mode=n})(t=e.QrSegment||(e.QrSegment={}))})(xq||(xq={}));var Rq=xq,Hq={L:Rq.QrCode.Ecc.LOW,M:Rq.QrCode.Ecc.MEDIUM,Q:Rq.QrCode.Ecc.QUARTILE,H:Rq.QrCode.Ecc.HIGH},Fq=128,Bq="L",Wq="#FFFFFF",zq="#000000",Uq=!1,qq=4,Vq=.1;
|
|
@@ -58,7 +58,7 @@ declare function useLoginMultiple(setLoginWay: React.Dispatch<any>): {
|
|
|
58
58
|
getOriginAccount: () => string;
|
|
59
59
|
getOriginWay: () => string;
|
|
60
60
|
} | undefined;
|
|
61
|
-
referMultipleState: ((type: "
|
|
61
|
+
referMultipleState: ((type: "login" | "multiple") => void) | undefined;
|
|
62
62
|
backfillData: BackFillMultipleState | undefined;
|
|
63
63
|
defaultQrWay: string | undefined;
|
|
64
64
|
};
|
|
@@ -53,7 +53,7 @@ export declare const useFetchConsoleConfig: (forceUpdate: number, appId?: string
|
|
|
53
53
|
loginMethods?: LoginMethods[] | undefined;
|
|
54
54
|
passwordLoginMethods?: string[] | undefined;
|
|
55
55
|
socialConnections?: import("../../Type").SocialConnectionProvider[] | undefined;
|
|
56
|
-
socialConnectionsBtnShape?: "button" | "
|
|
56
|
+
socialConnectionsBtnShape?: "button" | "default" | "icon" | undefined;
|
|
57
57
|
enterpriseConnections?: string[] | undefined;
|
|
58
58
|
qrCodeScanOptions?: {
|
|
59
59
|
extIdpConnId?: string | undefined;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CodeAction } from './responseManagement/interface';
|
|
2
2
|
import { AxiosRequestConfig } from 'axios';
|
|
3
3
|
export declare const requestClient: {
|
|
4
|
-
(input:
|
|
4
|
+
(input: RequestInfo | URL, init?: RequestInit | undefined): Promise<any>;
|
|
5
5
|
get<T>(path: string, query?: Record<string, any>, init?: AxiosRequestConfig): Promise<AuthingResponse<T>>;
|
|
6
6
|
post<T_1>(path: string, data: any, config?: {
|
|
7
7
|
headers: any;
|
package/package.json
CHANGED