"use strict";(self.webpackChunkhunyuan_bot=self.webpackChunkhunyuan_bot||[]).push([[603],{603:(e,t,n)=>{n.d(t,{Gb:()=>u.Gb,qD:()=>D.Ay,LR:()=>c.LR,q_:()=>g,E6:()=>v,Ay:()=>z,IP:()=>V});var r=n(26093),o=n(7378),i=n(77256),a=n(85036),c=n(81711),l=n(37984),u=n(71568),s=n(14222),f=n(28619),h=n(2522),d=n.n(h),p=n(76911),y=n(85428),m=".impowerBox .title {display: none;} .impowerBox .qrcode {margin-top: 0; width: 100%; border: 0; vertical-align: top;} .impowerBox .status.status_browser {display: none;} .impowerBox .status {padding: 0; text-align: center;} .impowerBox .status_icon {display: block!important; position: absolute; top: 50vw; left: 50vw; margin: -22px 0 0 -22px; background-color: #fff; border-radius: 100%} .impowerBox .status_fail h4 {color: #d54941;} .impowerBox .status_succ h4 {color: #20C57D} .impowerBox .status_txt p {display: none} .impowerBox .info {width: 100%}";function v(e){var t=(0,r.Bd)().t,n=(0,r.qA)(),i=(0,o.useRef)("J_".concat((new Date).getTime())),a=e.isBindType,c=e.appid,h=e.redirectUrl,v=e.targetUrl,g=void 0===v?"":v,b=e.protocol,x=e.failTargetUrl,w=void 0===x?"":x,_=e.extraPayload,j=e.bindId,k=e.style,C=(0,f.$)((function(){d().ready("wxLoginSDK",(function(){var e=(0,l.DU)();localStorage.setItem(u.kg,e),localStorage.setItem(u.ey,g),localStorage.setItem(u.h1,w);var t=a?(0,p.CN)("wechat_bind",j||""):"wechat_login";new WxLogin({self_redirect:!1,id:i.current,appid:c,scope:"snsapi_login",redirect_uri:encodeURIComponent("".concat(h).concat(h.includes("?")?"&":"?","nonce=").concat(e)),state:t,lang:n===r.TM.English?"en":"cn",style:k,href:"data:text/css;base64,".concat(btoa(m))})}))}));return(0,o.useEffect)((function(){d().isDefined("wxLoginSDK")||d()(s._r,"wxLoginSDK"),setTimeout(C,0)}),[C]),(0,o.useEffect)((function(){_&&localStorage.setItem(u.o_,JSON.stringify(_))}),[_]),(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("div",{id:i.current,className:"hyc-wechat-login"}),!!b&&(0,y.jsxs)("div",{className:"hyc-login__agreement",children:[(0,y.jsxs)("span",{children:[t("扫码默认已阅读并同意")," "]}),b]})]})}function g(e){var t=e.isBindType,n=e.appid,r=e.redirectUrl,i=e.targetUrl,a=void 0===i?"":i,c=e.beforeQQJump,s=e.failTargetUrl,f=void 0===s?"":s,h=e.extraPayload,d=e.isMobile,m=e.bindId,v=(0,l.DU)(),g=t?(0,p.CN)("qq_bind",m||""):"qq_login",b=encodeURIComponent("".concat(r).concat(r.includes("?")?"&":"?","nonce=").concat(v,"&state=").concat(g,"&isMobile=").concat(d?"1":"0")),x="https://graph.qq.com/oauth2.0/authorize?response_type=code&client_id=".concat(n,"&redirect_uri=").concat(b,"&display=");return localStorage.setItem(u.kg,v),localStorage.setItem(u.ey,a),localStorage.setItem(u.h1,f),(0,o.useEffect)((function(){if("function"==typeof c)return c(),void setTimeout((function(){location.href=x}),200);location.href=x}),[x]),(0,o.useEffect)((function(){h&&localStorage.setItem(u.o_,JSON.stringify(h))}),[h]),(0,y.jsx)(y.Fragment,{})}var b=n(35360),x=n(97563),w=n(71892),_=n(3698),j=n.n(_),k=n(30313),C=n(28984);function S(e){return S="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},S(e)}function O(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function L(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?O(Object(n),!0).forEach((function(t){N(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):O(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function N(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=S(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=S(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==S(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function E(){E=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),c=new A(r||[]);return o(a,"_invoke",{value:O(e,n,c)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",y="completed",m={};function v(){}function g(){}function b(){}var x={};u(x,a,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(I([])));_&&_!==n&&r.call(_,a)&&(x=_);var j=b.prototype=v.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function C(e,t){function n(o,i,a,c){var l=f(e[o],e,i);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==S(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(s).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function O(t,n,r){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=L(c,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=f(t,n,r);if("normal"===u.type){if(o=r.done?y:d,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function L(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,L(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(S(t)+" is not iterable")}return g.prototype=b,o(j,"constructor",{value:b,configurable:!0}),o(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,l,"GeneratorFunction")),e.prototype=Object.create(j),e},t.awrap=function(e){return{__await:e}},k(C.prototype),u(C.prototype,c,(function(){return this})),t.AsyncIterator=C,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new C(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(j),u(j,l,"Generator"),u(j,a,(function(){return this})),u(j,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function P(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function A(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){P(i,r,o,a,c,"next",e)}function c(e){P(i,r,o,a,c,"throw",e)}a(void 0)}))}}function I(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return T(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?T(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function T(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var B=(0,C.hL)(),G=(0,C.Ik)();function q(e){var t=(0,r.Bd)().t,n=e.protocols,a=e.qq,s=e.wechat,h=e.onAgreementConfirm,d=e.onAgreementShow,p=e.onAgreementCancel,m=e.confirmBtnClickReport,v=e.onClickGetVerificationCode,w=e.onDisabledLoginTypeToast,_=e.onLoginIconClick,j=I((0,o.useState)(u.Gb.phone),2),C=j[0],S=j[1],O=I((0,o.useState)(!1),2),N=O[0],P=O[1],T=I((0,o.useState)("one"),2),q=T[0],D=T[1],R=(0,f.$)(A(E().mark((function e(){return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(N){e.next=6;break}return e.next=3,U();case 3:if(e.sent){e.next=6;break}return e.abrupt("return");case 6:D("two");case 7:case"end":return e.stop()}}),e)})))),F=(0,f.$)(function(){var e=A(E().mark((function e(n){var r,o,i,a;return E().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==_||_(n),n!==u.Gb.phone){e.next=4;break}return R(),e.abrupt("return");case 4:if(n!==u.Gb.wechat||B){e.next=8;break}return null==w||w(),(0,x.i0)(t("当前环境不支持微信登陆,可在微信端内打开链接后重试"),{duration:1500}),e.abrupt("return");case 8:if(N){e.next=14;break}return e.next=11,U();case 11:if(e.sent){e.next=14;break}return e.abrupt("return");case 14:if(n!==u.Gb.wechat){e.next=23;break}return r="wechat_official_login",o=(0,l.DU)(),i="https://yuanbao.tencent.com/scan?nonce=".concat(o,"&state=").concat(r),a="https://open.weixin.qq.com/connect/oauth2/authorize?appid=".concat(u.Bp,"&redirect_uri=").concat(i,"&response_type=code&scope=snsapi_userinfo&state=").concat(r,"#wechat_redirect"),localStorage.setItem(u.kg,o),localStorage.setItem(u.ey,(null==s?void 0:s.targetUrl)||""),location.href=a,e.abrupt("return");case 23:S(n);case 24:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),U=(0,f.$)((function(){return null==d||d(),new Promise((function(e){var r=i.r3.confirm({header:t("服务协议及隐私保护"),body:(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("span",{children:t("我已阅读并同意")})," ",n]}),width:420,placement:"center",closeBtn:null,theme:"info",cancelBtn:t("取消"),confirmBtn:t("同意"),onCancel:function(){r.hide(),null==p||p(),e(!1)},onClose:function(){r.hide(),e(!1)},destroyOnClose:!0,onConfirm:function(){r.hide(),null==h||h(),P(!0),e(!0)}})}))}));return(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h2",{className:"hyc-login__title",children:t("one"===q?"登录":"手机号登录")}),"two"===q&&(0,y.jsx)("div",{className:"hyc-mobile-login-form_left-arrow",onClick:function(){D("one")},children:(0,y.jsx)(b.D9,{})}),C===u.Gb.qq&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(g,L(L({},a),{},{appid:(null==a?void 0:a.appid)||"",redirectUrl:(null==a?void 0:a.redirectUrl)||"",beforeQQJump:function(){S(u.Gb.phone)},isMobile:!0,protocol:n}))}),"one"===q?(0,y.jsxs)("div",{className:"hyc-mobile-login-form",children:[B?(0,y.jsxs)("div",{className:"hyc-mobile-login-form_default-type hyc-mobile-login-form_wx-login",children:[(0,y.jsx)(b.yx,{color:"#07C160",size:60}),(0,y.jsx)("button",{className:"hyc-phone-login__btn",onClick:function(){return F(u.Gb.wechat)},style:{marginTop:"32px"},children:t("微信号快捷登录")})]}):G?(0,y.jsxs)("div",{className:"hyc-mobile-login-form_default-type hyc-mobile-login-form_qq-login",children:[(0,y.jsx)("div",{className:"hyc-mobile-login-form_qq-icon"}),(0,y.jsx)("button",{className:"hyc-phone-login__btn",onClick:function(){return F(u.Gb.qq)},style:{marginTop:"32px",background:"#0099FF"},children:t("QQ账号快捷登录")})]}):(0,y.jsx)("div",{className:"hyc-mobile-login-form_default-type",children:(0,y.jsx)(c.LR,L(L({},e),{},{showAgreement:!1,onAgreementShow:d,onAgreementConfirm:function(){null==h||h(),P(!0)},onAgreementCancel:p,outsideAgreementChecked:N,confirmBtnClickReport:m,onClickGetVerificationCode:v}))}),(0,y.jsxs)("div",{className:"hyc-mobile-login-form_other-type",children:[(0,y.jsx)("div",{className:"hyc-mobile-login-form_split",children:(0,y.jsx)("span",{children:t("其他登录方式")})}),(0,y.jsxs)("div",{className:"hyc-mobile-login-form_other-type__items",children:[(G||B)&&(0,y.jsxs)("div",{className:"hyc-mobile-login-form_other-type__item",onClick:function(){return F(u.Gb.phone)},children:[(0,y.jsx)("div",{className:"hyc-mobile-login-form_icon",style:{backgroundColor:"#FFBB01"},children:(0,y.jsx)(b.Lx,{color:"#fff",size:24})}),(0,y.jsx)("span",{children:t("手机号登录")})]}),!G&&(0,y.jsxs)("div",{className:"hyc-mobile-login-form_other-type__item",onClick:function(){return F(u.Gb.qq)},children:[(0,y.jsx)("div",{className:"hyc-mobile-login-form_icon",style:{backgroundColor:"#2cace3"},children:(0,y.jsx)("span",{children:(0,y.jsx)(b.yN,{color:"#fff",size:24})})}),(0,y.jsx)("span",{children:t("QQ登录")})]}),!B&&(0,y.jsxs)("div",{className:"hyc-mobile-login-form_other-type__item ",onClick:function(){return F(u.Gb.wechat)},children:[(0,y.jsx)("div",{className:"hyc-mobile-login-form_icon",style:{backgroundColor:"#D9D9D9"},children:(0,y.jsx)(b.yx,{color:"#fff",size:24})}),(0,y.jsx)("span",{style:{color:"#BDBDBD"},children:t("微信登录")})]})]})]}),!!n&&(0,y.jsx)("div",{className:"hyc-login__agreement",children:(0,y.jsxs)(k.S,{checked:N,onChange:function(e){P(e)},children:[(0,y.jsxs)("span",{children:[t("我已阅读并同意")," "]}),n]})})]}):(0,y.jsx)("div",{className:"hyc-mobile-login-form_default-type",children:(0,y.jsx)(c.LR,L(L({},e),{},{autofocus:!1,showAgreement:!1,onClickGetVerificationCode:v,confirmBtnClickReport:m}))})]})}var D=n(10934);function R(e){return R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R(e)}function F(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function U(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?F(Object(n),!0).forEach((function(t){M(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):F(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function M(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=R(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=R(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==R(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function $(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return Q(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Q(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Q(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function z(e){var t=(0,r.Bd)().t,n=e.step,l=void 0===n?"login":n,s=e.protocols,h=e.wechat,d=e.qq,p=e.phone,m=e.onClose,x=e.isMobile,_=void 0!==x&&x,k=e.brandPic,C=e.hideBrandPic,S=void 0!==C&&C,O=e.defaultLoginType,L=void 0===O?u.Gb.wechat:O,N=e.onDialogShow,E=e.onAgreementShow,P=e.onAgreementConfirm,A=e.onAgreementCancel,I=e.onDisabledLoginTypeToast,T=e.onClickGetVerificationCode,B=e.onLoginIconClick,G=e.onExposureReport,D=e.onBindPhoneShowReport,R=e.onBindPhoneBtnClickReport,F=e.onBindPhoneSkipBtnClickReport,M=e.onBindWechatShowReport,Q=e.onBindWechatSkipBtnClickReport,z=e.attach,V=e.extraContent,J=e.extraHeader,H=e.loginType,K=e.onLoginTypeChange,W=e.leftDownloadChildren,Y=e.noSkipBindPhone,Z=e.isTeamAccount,X=localStorage.getItem(u.ov),ee=$((0,o.useState)(_?u.Gb.phone:H||L),2),te=ee[0],ne=ee[1],re=(0,r.qA)(),oe=(0,o.useMemo)((function(){return s?(0,y.jsx)(y.Fragment,{children:s.map((function(e,n){return(0,y.jsxs)(o.Fragment,{children:[n>0&&n<s.length-1&&(0,y.jsx)("span",{children:"、"}),n===s.length-1&&s.length>1&&(0,y.jsxs)("span",{children:[" ",t("和")," "]}),(0,y.jsx)("a",{className:"hyc-login__protocol",target:"_blank",href:e.url,rel:"noreferrer",children:t(e.text)})]},e.url)}))}):null}),[s,t]),ie=(0,f.$)((function(){localStorage.removeItem(u.kg),localStorage.removeItem(u.ey),localStorage.removeItem(u.h1),localStorage.removeItem(u.o_)})),ae=(0,w.g)((function(){ie(),m()})),ce=(0,w.g)((function(){"login"===l?ae():le()})),le=(0,f.$)((function(){"bindPhone"===l&&(null==F||F()),"bindChat"===l&&(null==Q||Q());var e=i.r3.confirm({header:t("提示"),body:t("跳过此步骤可能导致新账号无法与已有账号关联,从而影响资料同步与互通。"),width:460,placement:"center",theme:"warning",cancelBtn:t("我再想想"),confirmBtn:t("跳过,直接登录"),onCancel:function(){e.hide()},onClose:function(){e.hide()},destroyOnClose:!0,onConfirm:function(){e.hide(),ae()}})}));(0,o.useEffect)((function(){_||ne(H||L)}),[_,H]),(0,o.useEffect)((function(){null==G||G(te)}),[te]),(0,o.useEffect)((function(){null==N||N()}),[]),(0,o.useEffect)((function(){"bindPhone"!==l||_||null==D||D(),"bindChat"!==l||_||null==M||M()}),[l,_]);var ue,se,fe,he;return(0,y.jsxs)(i.lG,{className:j()(["hyc-login__dialog",e.className],{"hyc-login__dialog--mobile":_}),placement:"center",width:_?400:"fit-content",footer:null,header:null,visible:!0,attach:z,children:[!Y&&(0,y.jsx)("button",{className:j()({"hyc-login__close":!0,"hyc-login__close--mobile":_}),onClick:ce,children:_?(0,y.jsx)(b.WO,{}):(0,y.jsx)(b.Ay,{type:"close"})}),J,!_&&!S&&(0,y.jsx)("div",{className:j()((ue=!!W,se=re,fe=se===r.TM.TraditionalChinese,he=se===r.TM.English,{"hyc-login__left":!0,"hyc-login__left--banner-zh-hk":!ue&&fe,"hyc-login__left--banner-en":!ue&&he,"hyc-login__left--download":ue,"hyc-login__left--download-zh-hk":ue&&fe,"hyc-login__left--download-en":ue&&he,"hyc-login__left--team":Z,"hyc-login__left--team-zh-hk":Z&&fe,"hyc-login__left--team-en":Z&&he})),style:k?{backgroundImage:"url(".concat(k,")")}:{},children:W}),(0,y.jsxs)("div",{className:j()({"hyc-login__content":!_,"hyc-login__content--mobile":_}),style:{padding:"bindPhone"===l?"19px":void 0},children:["login"===l&&(0,y.jsx)(y.Fragment,{children:_?(0,y.jsx)(q,U(U({},p),{},{qq:d,wechat:h,protocols:oe,onLoginIconClick:B,onAgreementShow:E,onAgreementConfirm:P,onAgreementCancel:A,confirmBtnClickReport:R,onClickGetVerificationCode:T,onDisabledLoginTypeToast:I})):(0,y.jsxs)(y.Fragment,{children:[(0,y.jsxs)("div",{className:"hyc-login__switch",children:[(0,y.jsxs)(a.sx.Group,{className:"hyc-login__switch-type",variant:"default-filled",size:"large",value:te,onChange:function(e){ne(e),null==K||K(e),e===u.Gb.phone&&ie()},children:[(0,y.jsxs)(a.sx.Button,{value:u.Gb.wechat,children:[(0,y.jsx)(b.yx,{}),t("微信")]}),(0,y.jsxs)(a.sx.Button,{value:u.Gb.phone,children:[(0,y.jsx)(b.Es,{}),(0,y.jsx)(r.x6,{i18nKey:"手机_login",children:"手机"})]}),(0,y.jsxs)(a.sx.Button,{value:u.Gb.qq,children:[(0,y.jsx)(b.k8,{}),"QQ"]})]}),!!X&&(0,y.jsx)("div",{className:"hyc-login__last-tag hyc-login__last-tag--".concat(X),children:(0,y.jsx)("span",{className:"hyc-login__last-tag__txt",children:t("上次登录")})})]}),te===u.Gb.phone&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h2",{className:"hyc-login__title",children:t("手机验证码登录")}),(0,y.jsx)(c.LR,U(U({},p),{},{protocols:oe}))]}),te===u.Gb.wechat&&(0,y.jsxs)(y.Fragment,{children:[(0,y.jsx)("h2",{className:"hyc-login__title",children:t("微信扫码登录")}),(0,y.jsx)(v,U(U({},h),{},{protocol:oe}))]}),te===u.Gb.qq&&(0,y.jsx)(y.Fragment,{children:(0,y.jsx)(g,U(U({},d),{},{beforeQQJump:function(){},protocol:oe}))})]})}),"bindChat"===l&&!_&&(0,y.jsxs)("div",{className:"hyc-login__bind-chat",children:[(0,y.jsx)("h2",{className:"hyc-login__bind-chat__title",children:t("绑定微信号 登录更便捷")}),(0,y.jsxs)("p",{className:"hyc-login__bind-chat__desc",children:[t("为了您的账号安全和资料互通,建议绑定微信号"),(0,y.jsx)("br",{}),t("绑定后可以通过微信扫码登录")]}),(0,y.jsx)(v,U(U({},h),{},{isBindType:!0})),(0,y.jsx)("div",{className:"hyc-login__bind-chat__skip",onClick:le,children:t("跳过,直接登录")})]}),"bindPhone"===l&&(0,y.jsxs)("div",{className:"hyc-login__bind-phone",children:[(0,y.jsx)("h2",{className:"hyc-login__bind-phone__title",children:t("您正在注册新账号")}),(0,y.jsx)("p",{className:"hyc-login__bind-phone__desc",children:t("若您曾用手机号登录过元宝,可绑定该手机号以获取历史记录")}),(0,y.jsx)(c.LR,U(U({},p),{},{confirmText:t("确认绑定"),isBindType:!0,confirmBtnClickReport:R})),!Y&&(0,y.jsx)("div",{className:"hyc-login__bind-chat__skip",onClick:le,children:t("跳过,直接登录")})]})]}),V]})}function V(e){return new Promise((function(t,n){var r,o=new URLSearchParams(window.location.search),i=o.get("code"),a=o.get("nonce"),c=o.get("state"),l=localStorage.getItem(u.kg),s=localStorage.getItem(u.ey),f=localStorage.getItem(u.h1),h=localStorage.getItem(u.o_);if(h)try{r=JSON.parse(h)}catch(e){}return i&&c&&a?l&&a===l?("wechat_login"!==c&&"wechat_official_login"!==c||localStorage.setItem(u.ov,u.Gb.wechat),"qq_login"===c&&localStorage.setItem(u.ov,u.Gb.qq),localStorage.removeItem(u.kg),localStorage.removeItem(u.ey),localStorage.removeItem(u.h1),localStorage.removeItem(u.o_),void t((function(){return e({code:i,targetUrl:s||"",failTargetUrl:f||"",extraPayload:r})}))):((0,x.Ax)("触发了非法的绑定场景,请不要随便使用陌生人提供的链接"),void n()):((0,x.Ax)("参数错误"),void n())}))}},10934:(e,t,n)=>{n.d(t,{Ay:()=>m,HO:()=>d});var r=n(98435),o=n(7378),i=n(56235),a=n(19333),c=n(97556),l=n(28619),u=n(71568),s=n(85428);function f(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return h(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?h(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var d=[{area:"86",len:11,desc:"中国"},{area:"852",len:8,desc:"中国香港"}],p=/^1[3456789]\d{9}$/,y=function(e,t){var n,h,y,m,v=(0,r.Bd)().t,g=e.onChange,b=e.disableList,x=void 0!==b&&b,w=e.autofocus,_=(0,o.useRef)(null),j=(0,o.useRef)(null),k=f((0,o.useState)(null!==(n=localStorage.getItem(u.Vd))&&void 0!==n?n:null===(h=e.areaList)||void 0===h||null===(h=h[0])||void 0===h?void 0:h.area),2),C=k[0],S=k[1],O=f((0,o.useState)(!1),2),L=O[0],N=O[1],E=f((0,o.useState)(""),2),P=E[0],A=E[1],I=f((0,o.useState)([]),2),T=I[0],B=I[1];(0,o.useEffect)((function(){var t,n,r,o;B(null!==(t=e.areaList)&&void 0!==t?t:d);var i=null!==(n=localStorage.getItem(u.Vd))&&void 0!==n?n:null===(r=e.areaList)||void 0===r||null===(r=r[0])||void 0===r?void 0:r.area;S(i),null==g||g({mobile:"",areaCode:i,len:null==T||null===(o=T.find((function(e){return e.area===i})))||void 0===o?void 0:o.len})}),[e.areaList]),(0,o.useEffect)((function(){var e=function(){N(!1)},t=function(t){var n,r;null!==(n=j.current)&&void 0!==n&&n.contains(t.target)||null!==(r=_.current)&&void 0!==r&&r.contains(t.target)||e()},n=function(t){"Escape"===t.key&&e()};return document.addEventListener("click",t),document.addEventListener("keydown",n),function(){document.removeEventListener("click",t),document.removeEventListener("keydown",n)}}),[]);(0,o.useImperativeHandle)(t,(function(){return{verifyPhoneNumber:function(){var e=T.find((function(e){return e.area===C}));if(null==e||!e.len){var t="";return P?p.test(P)||(t=v("请输入正确的手机号")):t=v("请输入手机号"),t}return P.length!==e.len?v("请输入正确的手机号"):""}}}));var G=(0,l.$)((function(e){var t=e.replace(/[^\d]/g,"");A(t),D({areaCode:C,mobile:t})})),q=(0,l.$)((function(e){var t;S(e),localStorage.setItem(u.Vd,e),D({areaCode:e,mobile:P,len:null==T||null===(t=T.find((function(t){return t.area===e})))||void 0===t?void 0:t.len}),N(!1)})),D=function(e){var t,n,r,o;null==g||g({areaCode:null!==(t=null==e?void 0:e.areaCode)&&void 0!==t?t:C,mobile:null!==(n=null==e?void 0:e.mobile)&&void 0!==n?n:P,len:null!==(r=null==e?void 0:e.len)&&void 0!==r?r:null==T||null===(o=T.find((function(e){return e.area===C})))||void 0===o?void 0:o.len})};return(0,s.jsx)("div",{className:"yuanbao-oversea-input",children:(0,s.jsxs)("div",{className:"yuanbao-oversea-input__wrap ".concat(L?"yuanbao-oversea-input__wrap_showList":""),children:[(0,s.jsxs)("div",{className:"yuanbao-oversea-input__wrap__formitem",children:[(0,s.jsxs)("label",{ref:_,className:"yuanbao-oversea-input__wrap__formitem__areaCode\n ".concat(x?"yuanbao-oversea-input__wrap__formitem__areaCode_disabled":""),onClick:function(e){x||(e.stopPropagation(),N(!0))},children:["+",C,x?null:(0,s.jsx)(i.A,{className:"icon-areaCode"})]}),(0,s.jsx)("div",{style:{flex:1},children:(0,s.jsx)(c.pd,{type:"tel",value:P,onChange:G,maxlength:null!==(y=null==T||null===(m=T.find((function(e){return e.area===C})))||void 0===m?void 0:m.len)&&void 0!==y?y:20,autofocus:w,placeholder:v("请输入手机号"),clearable:!0,showClearIconOnEmpty:P.length>0})})]}),L?(0,s.jsx)("div",{className:"yuanbao-oversea-input__wrap__arealist",ref:j,children:T.map((function(e){return(0,s.jsxs)("div",{onClick:function(){return q(e.area)},className:"yuanbao-oversea-input__wrap__arealist__item ".concat(e.area===C?"yuanbao-oversea-input__wrap__arealist__item_active":""),children:["+",e.area,"(",(null==e?void 0:e.desc)||"",")",(0,s.jsx)(a.A,{className:"yuanbao-oversea-input__wrap__arealist__item__icon"})]},e.area)}))}):null]})})};const m=(0,o.forwardRef)(y)},71568:(e,t,n)=>{n.d(t,{Bp:()=>u,Gb:()=>r,Vd:()=>s,ey:()=>i,h1:()=>c,kg:()=>o,o_:()=>l,ov:()=>a});var r=function(e){return e.qq="qq",e.phone="phone",e.wechat="wechat",e}({}),o="hyc-login-nonce",i="hyc-login-target-url",a="hyc-login-last-type",c="hyc-login-fail-target-url",l="hyc-login-extra-payload",u="wxb308df07bbaf96e8",s="hyc-login-phone-area"},81711:(e,t,n)=>{n.d(t,{LR:()=>A,nt:()=>E});var r=n(26093),o=n(7378),i=n(28619),a=n(77256),c=n(97556),l=n(922),u=n(30313),s=n(14222),f=n(97563),h=n(71568),d=n(2522),p=n.n(d),y=n(3698),m=n.n(y),v=n(10934),g=n(85428);function b(e){return b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},b(e)}function x(){x=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},i="function"==typeof Symbol?Symbol:{},a=i.iterator||"@@iterator",c=i.asyncIterator||"@@asyncIterator",l=i.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var i=t&&t.prototype instanceof v?t:v,a=Object.create(i.prototype),c=new A(r||[]);return o(a,"_invoke",{value:L(e,n,c)}),a}function f(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var h="suspendedStart",d="suspendedYield",p="executing",y="completed",m={};function v(){}function g(){}function w(){}var _={};u(_,a,(function(){return this}));var j=Object.getPrototypeOf,k=j&&j(j(I([])));k&&k!==n&&r.call(k,a)&&(_=k);var C=w.prototype=v.prototype=Object.create(_);function S(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function O(e,t){function n(o,i,a,c){var l=f(e[o],e,i);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==b(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,a,c)}),(function(e){n("throw",e,a,c)})):t.resolve(s).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,c)}))}c(l.arg)}var i;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return i=i?i.then(o,o):o()}})}function L(t,n,r){var o=h;return function(i,a){if(o===p)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var c=r.delegate;if(c){var l=N(c,r);if(l){if(l===m)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===h)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=p;var u=f(t,n,r);if("normal"===u.type){if(o=r.done?y:d,u.arg===m)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=y,r.method="throw",r.arg=u.arg)}}}function N(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,N(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),m;var i=f(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,m;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,m):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function P(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function I(t){if(t||""===t){var n=t[a];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return i.next=i}}throw new TypeError(b(t)+" is not iterable")}return g.prototype=w,o(C,"constructor",{value:w,configurable:!0}),o(w,"constructor",{value:g,configurable:!0}),g.displayName=u(w,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===g||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,w):(e.__proto__=w,u(e,l,"GeneratorFunction")),e.prototype=Object.create(C),e},t.awrap=function(e){return{__await:e}},S(O.prototype),u(O.prototype,c,(function(){return this})),t.AsyncIterator=O,t.async=function(e,n,r,o,i){void 0===i&&(i=Promise);var a=new O(s(e,n,r,o),i);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},S(C),u(C,l,"Generator"),u(C,a,(function(){return this})),u(C,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=I,A.prototype={constructor:A,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(P),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return o("end");if(a.tryLoc<=this.prev){var l=r.call(a,"catchLoc"),u=r.call(a,"finallyLoc");if(l&&u){if(this.prev<a.catchLoc)return o(a.catchLoc,!0);if(this.prev<a.finallyLoc)return o(a.finallyLoc)}else if(l){if(this.prev<a.catchLoc)return o(a.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return o(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var i=o;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),P(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;P(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:I(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),m}},t}function w(e,t,n,r,o,i,a){try{var c=e[i](a),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function _(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var i=e.apply(t,n);function a(e){w(i,r,o,a,c,"next",e)}function c(e){w(i,r,o,a,c,"throw",e)}a(void 0)}))}}function j(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function k(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?j(Object(n),!0).forEach((function(t){C(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function C(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=b(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=b(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==b(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function S(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,i,a,c=[],l=!0,u=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=i.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw o}}return c}}(e,t)||function(e,t){if(e){if("string"==typeof e)return O(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?O(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function O(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}var L="获取验证码",N="重新发送",E="tCaptcha",P="请输入验证码";function A(e){var t=(0,r.Bd)().t,n=e.isBindType,d=e.captcha,y=e.onConfirm,b=e.confirmText,w=void 0===b?t("登录"):b,j=e.protocols,C=e.confirmBtnClickReport,O=e.showAgreement,A=void 0===O||O,I=e.outsideAgreementChecked,T=e.onClickGetVerificationCode,B=e.onAgreementConfirm,G=e.onAgreementShow,q=e.onAgreementCancel,D=e.autofocus,R=void 0===D||D,F=e.ablePhoneAreaChoose,U=void 0!==F&&F,M=e.fetchPhoneAreaList,$=(0,o.useRef)(null),Q=S((0,o.useState)(U?{mobile:"",verificationCode:"",agreementChecked:!1}:{mobile:"",verificationCode:"",agreementChecked:!1,len:11,phoneArea:"86"}),2),z=Q[0],V=Q[1],J=(0,o.useRef)(null),H=S((0,o.useState)(!0),2),K=H[0],W=H[1],Y=S((0,o.useState)([]),2),Z=Y[0],X=Y[1];(0,o.useEffect)((function(){"function"==typeof M?M().then((function(e){X(e)})).catch((function(e){X(v.HO)})).finally((function(){W(!1)})):W(!1)}),[]);var ee=S((0,o.useState)(!1),2),te=ee[0],ne=ee[1];(0,o.useLayoutEffect)((function(){window.TencentCaptcha||p().isDefined(E)||p()(s.Mn,E)}),[]);var re=(0,r.qA)()===r.TM.English,oe=(0,i.$)((function(){return null==G||G(),new Promise((function(e){var n=a.r3.confirm({header:t("服务协议及隐私保护"),body:(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)("span",{children:t("我已阅读并同意")})," ",j,re?".":""]}),width:420,placement:"center",closeBtn:null,theme:"info",cancelBtn:t("取消"),confirmBtn:t("同意"),onCancel:function(){n.hide(),null==q||q(),e(!1)},onClose:function(){n.hide(),e(!1)},destroyOnClose:!0,onConfirm:function(){null==B||B(),n.hide(),V((function(e){return k(k({},e),{},{agreementChecked:!0})})),e(!0)}})}))})),ie=(0,o.useRef)(null),ae=S((0,o.useState)(!0),2),ce=ae[0],le=ae[1],ue=function(){var e=_(x().mark((function e(){var n,r;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=function(){return(r=_(x().mark((function e(n){var r,o,i,a,c;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,ne(!1),n.ticket&&n.randstr){e.next=4;break}throw Error(s.Z4);case 4:return o={phoneNumber:z.mobile,captchaTicket:n.ticket,captchaRandstr:n.randstr},U&&(o.phoneArea=null!==(i=null==z?void 0:z.phoneArea)&&void 0!==i?i:"86"),e.next=8,d.sendVerificationCode(o);case 8:(0,f.Zx)(t("验证码已发送")),e.next=17;break;case 11:return e.prev=11,e.t0=e.catch(0),le(!0),ne(!1),(0,f.Ax)(e.t0.message===s.Z4?t("安全验证不通过,请重试"):e.t0.message||t("请稍后重试")),e.abrupt("return");case 17:null===(r=J.current)||void 0===r||r.focus(),a=(new Date).getTime(),c=setInterval((function(){if(ie.current){var e=60-Math.floor((Date.now()-a)/1e3);if(e<=-1)return le(!0),clearInterval(c),void(ie.current.innerHTML=t(N));ie.current.innerHTML=t("{{restSecond}}秒后重发",{restSecond:e})}else clearInterval(c)}),200);case 20:case"end":return e.stop()}}),e,null,[[0,11]])})))).apply(this,arguments)},n=function(e){return r.apply(this,arguments)},ce){e.next=4;break}return e.abrupt("return");case 4:if(se()){e.next=6;break}return e.abrupt("return");case 6:if(null==T||T(),void 0===I||I){e.next=13;break}return e.next=10,oe();case 10:if(e.sent){e.next=13;break}return e.abrupt("return");case 13:if(!A||!j||z.agreementChecked){e.next=19;break}return e.next=16,oe();case 16:if(e.sent){e.next=19;break}return e.abrupt("return");case 19:le(!1),ne(!0),window.TencentCaptcha?new TencentCaptcha(d.appid,n,{loading:!1}).show():p().ready(E,(function(){new TencentCaptcha(d.appid,n,{loading:!1}).show()}));case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),se=(0,i.$)((function(){var e,t=null===(e=$.current)||void 0===e?void 0:e.verifyPhoneNumber();return t&&(0,f.Ax)(t),!t})),fe=(0,i.$)((function(){var e="";return z.verificationCode||(e=t(P)),e&&(0,f.Ax)(e),!e})),he=function(){var e=_(x().mark((function e(){var t,r,o,i;return x().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==C||C(),t=z.mobile,r=z.verificationCode,o=z.agreementChecked,se()){e.next=4;break}return e.abrupt("return");case 4:if(fe()){e.next=6;break}return e.abrupt("return");case 6:if(void 0===I||I){e.next=12;break}return e.next=9,oe();case 9:if(e.sent){e.next=12;break}return e.abrupt("return");case 12:if(!A||!j||o){e.next=18;break}return e.next=15,oe();case 15:if(e.sent){e.next=18;break}return e.abrupt("return");case 18:n||localStorage.setItem(h.ov,h.Gb.phone),i={phoneNumber:"".concat(t),verificationCode:"".concat(r)},U&&(i.phoneArea=z.phoneArea),y(i);case 22:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return K?(0,g.jsx)(g.Fragment,{}):(0,g.jsx)("div",{className:"hyc-phone-login",children:(0,g.jsxs)("section",{children:[(0,g.jsx)(v.Ay,{ref:$,disableList:!U,autofocus:R,areaList:Z,onChange:function(e){V((function(t){var n,r;return k(k({},t),{},{mobile:null!==(n=null==e?void 0:e.mobile)&&void 0!==n?n:"",phoneArea:null!==(r=null==e?void 0:e.areaCode)&&void 0!==r?r:"",len:null==e?void 0:e.len})}))}}),(0,g.jsxs)("div",{className:"hyc-phone-login__input-row",children:[(0,g.jsxs)("div",{style:{flex:1},children:[(0,g.jsx)(c.pd,{type:"number",ref:J,value:z.verificationCode,onChange:function(e){e.length>10||V((function(t){return k(k({},t),{},{verificationCode:e})}))},placeholder:t("请输入验证码"),onEnter:he}),(0,g.jsx)("div",{className:"outline-placeholder"})]}),(0,g.jsx)("span",{className:"hyc-phone-login__send-code-sep",children:"|"}),(0,g.jsx)("a",{className:m()("hyc-phone-login__send-code",{"is-disabled":!ce}),style:{display:te?"none":""},onClick:ue,ref:ie,children:t(L)}),(0,g.jsx)("div",{className:"hyc-phone-login__send-code",style:{display:te?"":"none",color:"#BDBDBD"},children:(0,g.jsx)(l.Rh,{inheritColor:!0,size:"16px",showOverlay:!1})})]}),(0,g.jsx)("button",{onClick:he,className:"hyc-phone-login__btn",children:w}),A&&!!j&&(0,g.jsx)("div",{className:"hyc-login__agreement",children:(0,g.jsxs)(u.S,{checked:z.agreementChecked,onChange:function(e){V((function(t){return k(k({},t),{},{agreementChecked:e})}))},children:[(0,g.jsxs)("span",{children:[t("我已阅读并同意")," "]}),j]})})]})})}}}]);
|