@nocobase/plugin-auth 2.2.0-beta.9 → 2.3.0-alpha.1
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/client/index.js +1 -1
- package/dist/client-v2/9.c10c60a4ecc4256d.js +10 -0
- package/dist/client-v2/index.js +1 -1
- package/dist/client-v2/pages/AuthenticatorsPage.d.ts +26 -0
- package/dist/externalVersion.js +11 -11
- package/dist/locale/de-DE.json +2 -1
- package/dist/locale/en-US.json +4 -1
- package/dist/locale/es-ES.json +2 -1
- package/dist/locale/fr-FR.json +2 -1
- package/dist/locale/hu-HU.json +2 -1
- package/dist/locale/id-ID.json +2 -1
- package/dist/locale/it-IT.json +2 -1
- package/dist/locale/ja-JP.json +2 -1
- package/dist/locale/ko-KR.json +2 -1
- package/dist/locale/nl-NL.json +2 -1
- package/dist/locale/pt-BR.json +2 -1
- package/dist/locale/ru-RU.json +2 -1
- package/dist/locale/tr-TR.json +2 -1
- package/dist/locale/uk-UA.json +2 -1
- package/dist/locale/vi-VN.json +2 -1
- package/dist/locale/zh-CN.json +4 -1
- package/dist/locale/zh-TW.json +2 -1
- package/dist/node_modules/cron/package.json +1 -1
- package/dist/node_modules/ms/package.json +1 -1
- package/dist/server/locale/en-US.json +2 -1
- package/dist/server/locale/zh-CN.json +3 -2
- package/dist/server/plugin.js +3 -1
- package/package.json +2 -2
- package/dist/client-v2/9.5301763a7da120fa.js +0 -10
package/dist/client/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/react","@ant-design/icons","@formily/shared","react","antd","@nocobase/client","@formily/core","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-auth"]=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):e["@nocobase/plugin-auth"]=t(e["react-i18next"],e["@emotion/css"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/react"],e["@ant-design/icons"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@formily/core"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,u,c,l,s,p){return function(){var f,d,m,y={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,s,p,f,d,m=0,y=!1,v=!1,b=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){var n=c,r=l;return c=l=void 0,m=t,p=e.apply(r,n)}function g(e){var n=e-d,r=e-m;return void 0===d||n>=t||n<0||v&&r>=s}function w(){var e,n,r,i=o();if(g(i))return x(i);f=setTimeout(w,(e=i-d,n=i-m,r=t-e,v?u(r,s-n):r))}function x(e){return(f=void 0,b&&c)?h(e):(c=l=void 0,p)}function S(){var e,n=o(),r=g(n);if(c=arguments,l=this,d=n,r){if(void 0===f)return m=e=d,f=setTimeout(w,t),y?h(e):p;if(v)return clearTimeout(f),f=setTimeout(w,t),h(d)}return void 0===f&&(f=setTimeout(w,t)),p}return t=i(t)||0,r(n)&&(y=!!n.leading,s=(v="maxWait"in n)?a(i(n.maxWait)||0,t):s,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==f&&clearTimeout(f),m=0,c=d=l=f=void 0},S.flush=function(){return void 0===f?p:x(o())},S}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},574:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return z},default:function(){return G},useRedirect:function(){return i.useRedirect},PluginAuthClient:function(){return H},AuthenticatorsContext:function(){return v.m},useAuthenticator:function(){return v.p},AuthenticatorsContextProvider:function(){return K},useSignIn:function(){return i.useSignIn}});var r=n(342),o=n(768),i=n(751),a=n(738),u=n.n(a),c={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},l=u()(function(e){e()},3e3,{leading:!0,trailing:!1}),s=n(872),p=n(230),f=n(155),d=n.n(f),m=n(59),y=n(442),v=n(706);function b(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 h(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w=function(){var e,t=(0,s.dE)().t,n=g((0,y.useSearchParams)(),1)[0].get("name"),o=(0,v.p)(n);return(null==o||null==(e=o.options)?void 0:e.enableResetPassword)?d().createElement(r.SchemaComponent,{schema:{type:"object",name:"forgotPasswordForm","x-component":"FormV2",properties:{email:{type:"string","x-component":"Input",title:'{{t("Reset password")}}',required:!0,"x-validator":"{{(value) => {\n if (!value) {\n return '';\n }\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t(\"Please enter a valid email\");\n }\n }}}","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter your email")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Send reset email")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=g(d().useState(!1),2),i=o[0],a=o[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),a(!0),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,t.auth.lostPassword(e.values)];case 3:return r.sent(),[3,5];case 4:return a(!1),[7];case 5:return m.message.success(n("Reset email sent successfully")),e.reset(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){h(i,n,o,a,u,"next",e)}function u(e){h(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:i}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Back to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function x(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 S(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var e,t=(0,s.dE)().t,n=(0,r.useAPIClient)(),o=P((0,y.useSearchParams)(),1)[0],i=o.get("resetToken"),a=(0,r.useNavigateNoUpdate)(),u=P(d().useState(!1),2),c=u[0],l=u[1],b=o.get("name"),h=(0,v.p)(b);return((0,f.useEffect)(function(){n.auth.checkResetToken({resetToken:i}).then(function(){l(!1)}).catch(function(e){l(!0)})},[]),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?!i||c?d().createElement(m.Result,{status:"403",title:t("Reset link has expired"),extra:d().createElement(m.Button,{type:"primary",onClick:function(){return a("/signin")}},t("Go to login"))}):d().createElement(r.SchemaComponent,{schema:{type:"object",name:"resetPasswordForm","x-component":"FormV2",properties:{password:{type:"string","x-component":"Password",title:'{{t("New password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter new password")}}'}},confirmPassword:{type:"string","x-component":"Password",title:'{{t("Confirm password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter the same password again")}}'},"x-validator":"{{(value, rules, {form}) => {\n if (!value) {\n return '';\n }\n if (value !== form.values.password) {\n return t(\"The passwords entered twice are inconsistent\");\n }\n }}}"},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Confirm")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=new URLSearchParams(window.location.search).get("resetToken"),i=P(d().useState(!1),2),a=i[0],u=i[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),u(!0),r.label=2;case 2:var i,a;return r.trys.push([2,,4,5]),[4,t.auth.resetPassword((i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e.values),a=a={resetToken:o},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i))];case 3:return r.sent(),[3,5];case 4:return u(!1),[7];case 5:return m.message.success(n("Password reset successful")),setTimeout(function(){window.location.href="/signin"},1e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){S(i,n,o,a,u,"next",e)}function u(e){S(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:a}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Go to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function E(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 j(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function T(e,t,n){return(T=C()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function I(e){var t="function"==typeof Map?new Map:void 0;return(I=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return T(e,arguments,A(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)})(e)}function C(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(C=function(){return!!e})()}var _=(0,r.lazy)(function(){return n.e("443").then(n.bind(n,862))},"AuthProvider").AuthProvider,F=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,751))},"Options","SignInForm","SignUpForm"),R=F.Options,N=F.SignInForm,U=F.SignUpForm,$=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthLayout","SignInPage","SignUpPage"),q=$.AuthLayout,L=$.SignInPage,M=$.SignUpPage,D=(0,r.lazy)(function(){return n.e("611").then(n.bind(n,718))},"Authenticator").Authenticator,V=(0,r.lazy)(function(){return n.e("680").then(n.bind(n,352))},"TokenPolicySettings").TokenPolicySettings,B=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthenticatorsContextProvider","AuthLayout"),K=B.AuthenticatorsContextProvider,z=B.AuthLayout,H=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,i,a,u;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=A(t),i=e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,C()?Reflect.construct(t,r||[],A(this).constructor):t.apply(this,r)),a="authTypes",u=new o.Registry,a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(n,e),t=[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){var e;return(e=function(){var e,t,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){var o,i;return this.app.pluginSettingsManager.add(s.CU,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(s.CU,'" })}}'),aclSnippet:"pm.auth"}),this.app.pluginSettingsManager.add("auth.authenticators",{icon:"LoginOutlined",title:'{{t("Authenticators", { ns: "'.concat(s.CU,'" })}}'),Component:D,aclSnippet:"pm.auth.authenticators",sort:1}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",Component:"SignUpPage"}),this.router.add("auth.forgotPassword",{path:"/forgot-password",Component:"ForgotPasswordPage"}),this.router.add("auth.resetPassword",{path:"/reset-password",Component:"ResetPasswordPage"}),this.app.addComponents({AuthLayout:q,SignInPage:L,SignUpPage:M,ForgotPasswordPage:w,ResetPasswordPage:O}),this.app.providers.unshift([_,{}]),this.registerType("Email/Password",{components:{SignInForm:N,SignUpForm:U,AdminSettingsForm:R}}),this.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(s.CU,'" })}}'),Component:V,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),t=(e=function(e){if(Array.isArray(e))return e}(((o=({app:this.app}).app).apiClient.axios,i=[function(e){var t,n=null==e||null==(t=e.headers)?void 0:t["x-new-token"];return n&&o.apiClient.auth.setToken(n),e},function(e){var t,n,r,i,a,u=null==e||null==(n=e.response)||null==(t=n.headers)?void 0:t["x-new-token"],s=null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.errors,p=Array.isArray(s)?s[0]:null,f=o.router.state.location,d=f.pathname,m=f.search,y=o.router.basename;if(u&&o.apiClient.auth.setToken(u),401===e.status&&(null==p?void 0:p.code)&&c[p.code]&&(o.apiClient.auth.setToken(""),d===o.getHref("signin")&&(null==p?void 0:p.code)!==c.EMPTY_TOKEN&&e.config&&(e.config.skipNotify=!1),(null==p?void 0:p.code)==="USER_HAS_NO_ROLES_ERR"&&(e.config.skipNotify=!0,o.error=p)),401===e.status&&!(null==(a=e.config)?void 0:a.skipAuth)&&(null==p?void 0:p.code)&&c[p.code]){if(!p||(null==p?void 0:p.code)===c.SKIP_TOKEN_RENEW)throw e;var v=o.router.isSkippedAuthCheckRoute(d);if(v&&(e.config.skipNotify=!0),d!==o.getHref("signin")&&!v){var b,h,g=(b=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=new RegExp("^".concat(b.replace(/\/?$/,""),"(\\/|$)")),d.replace(h,"/")||d);l(function(){o.apiClient.auth.setToken(null),o.router.navigate("/signin?redirect=".concat(g).concat(m),{replace:!0})})}}throw e}]))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(i)||function(e){if(e){if("string"==typeof e)return E(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,2)}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=e[1],this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:t,rejected:n,synchronous:!1,runWhen:null}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,u,"next",e)}function u(e){j(i,r,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(I(r.Plugin)),G=H},706:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},751:function(e,t,n){"use strict";n.r(t),n.d(t,{Options:function(){return F},SignInForm:function(){return y},SignUpForm:function(){return O},useRedirect:function(){return f},useSignUp:function(){return P},useSignIn:function(){return d}});var r=n(342),o=n(155),i=n.n(o),a=n(872),u=n(350),c=n(442),l=n(230);function s(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 p(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,c.useNavigate)(),r=(function(e){if(Array.isArray(e))return e}(e=(0,c.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return s(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,o.useCallback)(function(){var e=r.get("redirect")||t;!function(e){try{var t=new URL(e,window.location.origin);return/(?:^|\/)v2(?:\/|$)/.test(t.pathname)}catch(t){return/(?:^|\/)v2(?:\/|$)/.test(e)}}(e)?n(e,{replace:!0}):window.location.replace(e)},[n,t,r])}var d=function(e){var t=(0,l.useForm)(),n=(0,r.useAPIClient)(),o=f(),i=(0,r.useCurrentUserContext)().refreshAsync;return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:return r.sent(),[4,n.auth.signIn(t.values,e)];case 2:return r.sent(),[4,i()];case 3:return r.sent(),o(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){p(i,n,o,a,u,"next",e)}function u(e){p(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},m=function(e){var t=e.showForgotPassword;return{type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":'{{(value) => {\n if (!value) {\n return t("Please enter your username or email");\n }\n if (value.includes(\'@\')) {\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t("Please enter a valid email");\n }\n } else {\n return /^[^@<>"\'/]{1,50}$/.test(value) || t("Please enter a valid username");\n }\n }}}',"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{},showForgotPassword:t}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},links:{type:"void","x-component":"div","x-component-props":{style:{display:"flex",justifyContent:"space-between"}},properties:{signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"},forgotPassword:{type:"void","x-component":"Link","x-component-props":{to:'{{"/forgot-password?name=" + authenticator.name}}'},"x-content":'{{t("Forgot password")}}',"x-visible":t}}}}}},y=function(e){var t=(0,a.dE)().t,n=e.authenticator,o=n.authType,c=n.name,l=n.options,s=!!(0,u.useSignUpForms)()[o]&&null!=l&&!!l.allowSignUp,p="/signup?name=".concat(c);return i().createElement(r.SchemaComponent,{schema:m({showForgotPassword:!!(null==l?void 0:l.enableResetPassword)}),scope:{useBasicSignIn:function(){return d(c)},allowSignUp:s,signUpLink:p,t:t,authenticator:n}})},v=n(166),b=n(59),h=n(953),g=n(706);function w(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var P=function(e){var t=(0,c.useNavigate)(),n=(0,l.useForm)(),o=(0,r.useAPIClient)(),i=(0,h.useTranslation)().t;return{run:function(){var r;return(r=function(){var r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,n.submit()];case 1:return a.sent(),[4,o.auth.signUp(n.values,null==e?void 0:e.authenticator)];case 2:return a.sent(),b.message.success((null==e||null==(r=e.message)?void 0:r.success)||i("Sign up successfully, and automatically jump to the sign in page")),setTimeout(function(){t("/signin")},2e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){w(i,n,o,a,u,"next",e)}function u(e){w(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},O=function(e){var t=e.authenticatorName,n=(0,a.dE)().t,u=(0,h.useTranslation)("lm-collections").t,s=(0,g.p)(t).options,p=s.signupForm,f=(0,o.useMemo)(function(){return p.filter(function(e){return e.show}).reduce(function(e,t){var r=S(x({},t.uiSchema),{title:t.uiSchema.title?u(l.Schema.compile(t.uiSchema.title,{t:n})):""});return e[t.field]=S(x({},r),{required:t.required,"x-decorator":"FormItem"}),e},{})},[p]);if(!(null==s?void 0:s.allowSignUp))return i().createElement(c.Navigate,{to:"/not-found",replace:!0});var d={type:"object",name:(0,v.uid)(),"x-component":"FormV2",properties:S(x({},f),{password:{type:"string",required:!0,title:'{{t("Password")}}',"x-component":"Password","x-decorator":"FormItem","x-validator":{password:!0},"x-component-props":{checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem",title:'{{t("Confirm password")}}',"x-validator":{password:!0},"x-component-props":{style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}})};return i().createElement(r.SchemaComponent,{schema:d,scope:{useBasicSignUp:function(){return P({authenticator:t})},t:n}})},E=n(418);function j(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 T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){T(e,t,n[t])})}return e}function k(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function I(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return j(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var C=function(){var e=(0,r.useRecord)(),t=(0,r.useCollectionManager)().getCollection("users").fields.filter(function(e){var t;return!e.hidden&&!e.target&&e.interface&&!(null==(t=e.uiSchema)?void 0:t["x-read-pretty"])}),n=t.map(function(e){var t;return{value:e.name,label:null==(t=e.uiSchema)?void 0:t.title}}),u=(0,o.useMemo)(function(){var n=((null==(u=e.options)||null==(a=u.public)?void 0:a.signupForm)||[]).filter(function(e){return t.find(function(t){return t.name===e.field})}),r=!0,o=!1,i=void 0;try{for(var a,u,c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0)!function(){var e=c.value;n.find(function(t){return t.field===e.name})||n.push({field:e.name,show:"username"===e.name,required:"username"===e.name})}()}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n},[t,e]);return(0,o.useEffect)(function(){var t;e.options=k(A({},e.options),{public:k(A({},null==(t=e.options)?void 0:t.public),{signupForm:u})})},[e,u]),i().createElement(r.SchemaComponent,{components:{ArrayTable:E.ArrayTable},schema:{type:"void",properties:{"public.signupForm":{title:'{{t("Sign up form")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{bordered:!1},"x-validator":"{{ (value) => {\n const check = value?.some((item) => ['username', 'email'].includes(item.field) && item.show && item.required);\n if (!check) {\n return t('At least one of the username or email fields is required');\n }\n} }}",default:u,items:{type:"object","x-decorator":"ArrayItems.Item",properties:{column0:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:20,align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:100,title:(0,a.vV)("Field")},properties:{field:{type:"string","x-decorator":"FormItem","x-component":"Select",enum:n,"x-read-pretty":!0}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Show")},properties:{show:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".required"],fulfill:{state:{value:"{{ $deps[0] || $self.value }}"}}}}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Required")},properties:{required:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".show"],fulfill:{state:{value:"{{ !$deps[0] ? false : $self.value }}"}}}}}}}}}}}})},_=function(){var e=(0,a.dE)().t;return[(0,r.useGlobalVariable)("$env"),(0,r.useCurrentUserVariable)({maxDepth:1}).currentUserSettings,(0,r.useSystemSettingsVariable)().systemSettings,{value:"$resetLink",label:e("Reset password link")},{value:"$resetLinkExpiration",label:e("Reset link expiration (minutes)")}].filter(Boolean)},F=function(){var e=(0,a.dE)().t,t=_(),n=i().createElement("span",null,e("No notification channels found. Please "),i().createElement(c.Link,{to:"/admin/settings/notification-manager/channels"},e("add one first")),".");return i().createElement(r.SchemaComponent,{scope:{t:e},components:{Alert:b.Alert,SignupFormSettings:C,FormTab:E.FormTab},schema:{type:"object",properties:{notice:{type:"void","x-decorator":"FormItem","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}},collapse:{type:"void","x-component":"FormTab",properties:{basic:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Sign up settings")},properties:T({"public.allowSignUp":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox",default:!0}},(0,v.uid)(),{type:"void","x-component":"SignupFormSettings"})},forgetPassword:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Forgot password")},properties:{"public.enableResetPassword":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Enable forget password")}}',"x-component":"Checkbox",default:!1},divider1:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("1. Select notification channel"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},notificationChannel:{type:"string",title:'{{t("Notification channel (Email)")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:"notificationChannels",action:"list",params:{filter:{notificationType:"email"}}},notFoundContent:n},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}],description:'{{t("The notification channel used to send the reset password email, only support email channel")}}'},divider2:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("2. Configure reset email"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},emailSubject:{type:"string",required:!0,title:'{{t("Subject")}}',"x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:I(t)},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:'{{t("defaultResetPasswordEmailSubject")}}'}}}],default:'{{t("defaultResetPasswordEmailSubject")}}'},emailContentType:{type:"string",title:'{{t("Content type")}}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"HTML",value:"html"},{label:'{{t("Plain text")}}',value:"text"}],default:"html","x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:"html"}}}]},emailContentHTML:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),placeholder:"Hi,",autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "html"}}',initialValue:'{{t("defaultResetPasswordEmailContentHTML")}}'}}}],default:'{{t("defaultResetPasswordEmailContentHTML")}}'},emailContentText:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:I(t),autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "text"}}',initialValue:'{{t("defaultResetPasswordEmailContentText")}}'}}}],default:'{{t("defaultResetPasswordEmailContentText")}}'},resetTokenExpiresIn:{type:"number",title:'{{t("Reset link expiration")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{suffix:e("Minutes"),style:{width:"100%"}},default:120,required:!0,"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:120}}}]}}}}}}}})}},872:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},vV:function(){return u}});var r=n(953),o=n(342),i="auth";function a(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(e){return o.i18n.t(e,{ns:[i,"client"],nsMode:"fallback"})}},350:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return d},useSignInButtons:function(){return P},SignUpPage:function(){return I},useSignInForms:function(){return S},useSignUpForms:function(){return k},SignupPageContext:function(){return T},AuthenticatorsContextProvider:function(){return f},SignupPageProvider:function(){return A},SignInPage:function(){return O}});var r=n(477),o=n(342),i=n(59),a=n(155),u=n.n(a),c=n(442),l=n(953),s=n(706);function p(){var e,t,n=(e=["\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n text-align: center;\n padding-bottom: 24px;\n background-color: ",";\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return p=function(){return n},n}var f=function(e){var t=e.children,n=(0,o.useAPIClient)(),r=(0,o.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e||null==(t=e.data)?void 0:t.data)||[]})}),a=r.data,c=r.error;if(r.loading)return u().createElement("div",{style:{textAlign:"center",marginTop:20}},u().createElement(i.Spin,null));if(c)throw c;return u().createElement(s.m.Provider,{value:void 0===a?[]:a},t)};function d(){var e,t=((0,o.useSystemSettings)()||{}).data,n=(0,o.useToken)().token,i=(0,l.useTranslation)("lm-collections").t;return u().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},u().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},u().createElement(o.SwitchLanguage,null)),u().createElement("h1",{style:{textAlign:"center"}},u().createElement(o.ReadPretty.TextArea,{value:i(null==t||null==(e=t.data)?void 0:e.title)})),u().createElement(f,null,u().createElement(c.Outlet,null)),u().createElement("div",{className:(0,r.css)(p(),n.colorBgContainer)},u().createElement(o.PoweredBy,null)))}var m=n(574),y=n(872),v=n(230);function b(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 h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(){var e=g(["\n display: flex;\n "]);return w=function(){return e},e}function x(){var e=g(["\n display: flex;\n "]);return x=function(){return e},e}var S=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=h(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignInForm)&&(t[s]=p.components.SignInForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,o.usePlugin)(m.default).authTypes.getEntities(),n={},r=!0,i=!1,a=void 0;try{for(var c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var s,p=h(c.value,2),f=p[0],d=p[1];(null==(s=d.components)?void 0:s.SignInButton)&&(n[f]=d.components.SignInButton)}}catch(e){i=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw a}}var y=Object.keys(n);return e.filter(function(e){return y.includes(e.authType)}).map(function(e,t){return u().createElement(n[e.authType],{key:t,authenticator:e})})},O=function(){var e=(0,y.dE)().t;(0,o.useCurrentDocumentTitle)("Signin"),(0,o.useViewport)();var t=S(),n=(0,a.useContext)(s.m),c=P(n);if(!n.length)return u().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var l=n.map(function(n){var r=t[n.authType];if(r){var o="".concat(e("Sign-in")," (").concat(v.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({component:(0,a.createElement)(r,{authenticator:n}),tabTitle:n.title||o},n)}}).filter(function(e){return e});return u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(w())},l.length>1?u().createElement(i.Tabs,{items:l.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):l.length?u().createElement("div",null,l[0].component):u().createElement(u().Fragment,null),u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(x())},c))};function E(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 j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=(0,a.createContext)({});T.displayName="SignupPageContext";var A=function(e){var t=(0,a.useContext)(T);return t[e.authType]={component:e.component},u().createElement(T.Provider,{value:t},e.children)},k=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=j(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignUpForm)&&(t[s]=p.components.SignUpForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},I=function(){(0,o.useViewport)(),(0,o.useCurrentDocumentTitle)("Signup");var e=k(),t=j((0,c.useSearchParams)(),1)[0].get("name"),n=((0,s.p)(t)||{}).authType;return e[n]?(0,a.createElement)(e[n],{authenticatorName:t}):u().createElement(c.Navigate,{to:"/not-found",replace:!0})}},375:function(e){"use strict";e.exports=i},477:function(e){"use strict";e.exports=t},418:function(e){"use strict";e.exports=r},452:function(e){"use strict";e.exports=s},230:function(e){"use strict";e.exports=o},166:function(e){"use strict";e.exports=a},342:function(e){"use strict";e.exports=l},768:function(e){"use strict";e.exports=p},59:function(e){"use strict";e.exports=c},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=n},971:function(e,t,n){"use strict";var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src){var i=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");i.indexOf("/static/plugins/@nocobase/plugin-auth/dist/client/")>=0&&(r=i.replace(/\/[^\/]+$/,"/"))}if(!r){var a=window.__webpack_public_path__||"";a&&("/"!==a.charAt(a.length-1)&&(a+="/"),r=a+"static/plugins/@nocobase/plugin-auth/dist/client/")}if(!r){var u=window.__nocobase_modern_client_prefix__||"v",c="/"+(u=String(u).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var l=window.location.pathname||"/",s=l.indexOf(c);r=s>=0?l.slice(0,s+1):"/"}r&&(r=r.replace(RegExp("/"+u+"/?$"),"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),r+="static/plugins/@nocobase/plugin-auth/dist/client/"}n.p=r}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return y[e](n,n.exports,b),n.exports}b.m=y,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({443:"aa711879b4855b88",611:"bf903b6a5490becc",680:"8758971b4dd75b23"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h={},b.l=function(e,t,n,r){if(h[e])return void h[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-auth:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth:"+n),o.src=e),h[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(g=b.g.location+"");var h,g,w=b.g.document;if(!g&&w&&(w.currentScript&&"SCRIPT"===w.currentScript.tagName.toUpperCase()&&(g=w.currentScript.src),!g)){var x=w.getElementsByTagName("script");if(x.length)for(var S=x.length-1;S>-1&&(!g||!/^http(s?):/.test(g));)g=x[S--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");return b.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},b.f.j=function(e,t){var n=b.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},d=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);u<o.length;u++)r=o[u],b.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(m=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(d.bind(null,0)),m.push=d.bind(null,m.push.bind(m)),b(971),b(574)}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth",["react-i18next","@emotion/css","react-router-dom","@formily/antd-v5","@formily/react","@ant-design/icons","@formily/shared","react","antd","@nocobase/client","@formily/core","@nocobase/utils/client"],t):"object"==typeof exports?exports["@nocobase/plugin-auth"]=t(require("react-i18next"),require("@emotion/css"),require("react-router-dom"),require("@formily/antd-v5"),require("@formily/react"),require("@ant-design/icons"),require("@formily/shared"),require("react"),require("antd"),require("@nocobase/client"),require("@formily/core"),require("@nocobase/utils/client")):e["@nocobase/plugin-auth"]=t(e["react-i18next"],e["@emotion/css"],e["react-router-dom"],e["@formily/antd-v5"],e["@formily/react"],e["@ant-design/icons"],e["@formily/shared"],e.react,e.antd,e["@nocobase/client"],e["@formily/core"],e["@nocobase/utils/client"])}(self,function(e,t,n,r,o,i,a,u,c,l,s,p){return function(){var f,d,m,y={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,u=Math.min;e.exports=function(e,t,n){var c,l,s,p,f,d,m=0,y=!1,v=!1,b=!0;if("function"!=typeof e)throw TypeError("Expected a function");function h(t){var n=c,r=l;return c=l=void 0,m=t,p=e.apply(r,n)}function g(e){var n=e-d,r=e-m;return void 0===d||n>=t||n<0||v&&r>=s}function w(){var e,n,r,i=o();if(g(i))return x(i);f=setTimeout(w,(e=i-d,n=i-m,r=t-e,v?u(r,s-n):r))}function x(e){return(f=void 0,b&&c)?h(e):(c=l=void 0,p)}function S(){var e,n=o(),r=g(n);if(c=arguments,l=this,d=n,r){if(void 0===f)return m=e=d,f=setTimeout(w,t),y?h(e):p;if(v)return clearTimeout(f),f=setTimeout(w,t),h(d)}return void 0===f&&(f=setTimeout(w,t)),p}return t=i(t)||0,r(n)&&(y=!!n.leading,s=(v="maxWait"in n)?a(i(n.maxWait)||0,t):s,b="trailing"in n?!!n.trailing:b),S.cancel=function(){void 0!==f&&clearTimeout(f),m=0,c=d=l=f=void 0},S.flush=function(){return void 0===f?p:x(o())},S}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,c=/^0b[01]+$/i,l=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=c.test(e);return n||l.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},574:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return z},default:function(){return G},useRedirect:function(){return i.useRedirect},PluginAuthClient:function(){return H},AuthenticatorsContext:function(){return v.m},useAuthenticator:function(){return v.p},AuthenticatorsContextProvider:function(){return K},useSignIn:function(){return i.useSignIn}});var r=n(342),o=n(768),i=n(751),a=n(738),u=n.n(a),c={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},l=u()(function(e){e()},3e3,{leading:!0,trailing:!1}),s=n(872),p=n(230),f=n(155),d=n.n(f),m=n(59),y=n(442),v=n(706);function b(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 h(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function g(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var w=function(){var e,t=(0,s.dE)().t,n=g((0,y.useSearchParams)(),1)[0].get("name"),o=(0,v.p)(n);return(null==o||null==(e=o.options)?void 0:e.enableResetPassword)?d().createElement(r.SchemaComponent,{schema:{type:"object",name:"forgotPasswordForm","x-component":"FormV2",properties:{email:{type:"string","x-component":"Input",title:'{{t("Reset password")}}',required:!0,"x-validator":"{{(value) => {\n if (!value) {\n return '';\n }\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t(\"Please enter a valid email\");\n }\n }}}","x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter your email")}}',style:{}}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Send reset email")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=g(d().useState(!1),2),i=o[0],a=o[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),a(!0),r.label=2;case 2:return r.trys.push([2,,4,5]),[4,t.auth.lostPassword(e.values)];case 3:return r.sent(),[3,5];case 4:return a(!1),[7];case 5:return m.message.success(n("Reset email sent successfully")),e.reset(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){h(i,n,o,a,u,"next",e)}function u(e){h(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:i}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Back to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function x(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 S(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function P(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return x(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return x(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var O=function(){var e,t=(0,s.dE)().t,n=(0,r.useAPIClient)(),o=P((0,y.useSearchParams)(),1)[0],i=o.get("resetToken"),a=(0,r.useNavigateNoUpdate)(),u=P(d().useState(!1),2),c=u[0],l=u[1],b=o.get("name"),h=(0,v.p)(b);return((0,f.useEffect)(function(){n.auth.checkResetToken({resetToken:i}).then(function(){l(!1)}).catch(function(e){l(!0)})},[]),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?!i||c?d().createElement(m.Result,{status:"403",title:t("Reset link has expired"),extra:d().createElement(m.Button,{type:"primary",onClick:function(){return a("/signin")}},t("Go to login"))}):d().createElement(r.SchemaComponent,{schema:{type:"object",name:"resetPasswordForm","x-component":"FormV2",properties:{password:{type:"string","x-component":"Password",title:'{{t("New password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter new password")}}'}},confirmPassword:{type:"string","x-component":"Password",title:'{{t("Confirm password")}}',required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Please enter the same password again")}}'},"x-validator":"{{(value, rules, {form}) => {\n if (!value) {\n return '';\n }\n if (value !== form.values.password) {\n return t(\"The passwords entered twice are inconsistent\");\n }\n }}}"},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Confirm")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:function(){var e=(0,p.useForm)(),t=(0,r.useAPIClient)(),n=(0,s.dE)().t,o=new URLSearchParams(window.location.search).get("resetToken"),i=P(d().useState(!1),2),a=i[0],u=i[1];return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,e.submit()];case 1:r.sent(),u(!0),r.label=2;case 2:var i,a;return r.trys.push([2,,4,5]),[4,t.auth.resetPassword((i=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e.values),a=a={resetToken:o},Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(a)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(a)).forEach(function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(a,e))}),i))];case 3:return r.sent(),[3,5];case 4:return u(!1),[7];case 5:return m.message.success(n("Password reset successful")),setTimeout(function(){window.location.href="/signin"},1e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){S(i,n,o,a,u,"next",e)}function u(e){S(i,n,o,a,u,"throw",e)}a(void 0)})})()},loading:a}}}}}},signUp:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Go to login")}}'}}},scope:{t:t}}):d().createElement(y.Navigate,{to:"/not-found",replace:!0})};function E(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 j(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function T(e,t,n){return(T=I()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&k(o,n.prototype),o}).apply(null,arguments)}function A(e){return(A=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function k(e,t){return(k=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function C(e){var t="function"==typeof Map?new Map:void 0;return(C=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return T(e,arguments,A(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),k(n,e)})(e)}function I(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(I=function(){return!!e})()}var _=(0,r.lazy)(function(){return n.e("443").then(n.bind(n,862))},"AuthProvider").AuthProvider,F=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,751))},"Options","SignInForm","SignUpForm"),R=F.Options,N=F.SignInForm,U=F.SignUpForm,$=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthLayout","SignInPage","SignUpPage"),q=$.AuthLayout,L=$.SignInPage,M=$.SignUpPage,D=(0,r.lazy)(function(){return n.e("611").then(n.bind(n,718))},"Authenticator").Authenticator,V=(0,r.lazy)(function(){return n.e("680").then(n.bind(n,352))},"TokenPolicySettings").TokenPolicySettings,B=(0,r.lazy)(function(){return Promise.resolve().then(n.bind(n,350))},"AuthenticatorsContextProvider","AuthLayout"),K=B.AuthenticatorsContextProvider,z=B.AuthLayout,H=function(e){var t;if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");function n(){var e,t,r,i,a,u;if(!(this instanceof n))throw TypeError("Cannot call a class as a function");return t=n,r=arguments,t=A(t),i=e=function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this,I()?Reflect.construct(t,r||[],A(this).constructor):t.apply(this,r)),a="authTypes",u=new o.Registry,a in i?Object.defineProperty(i,a,{value:u,enumerable:!0,configurable:!0,writable:!0}):i[a]=u,e}return n.prototype=Object.create(e&&e.prototype,{constructor:{value:n,writable:!0,configurable:!0}}),e&&k(n,e),t=[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){var e;return(e=function(){var e,t,n;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){var o,i;return this.app.pluginSettingsManager.add(s.CU,{icon:"LoginOutlined",title:'{{t("Authentication", { ns: "'.concat(s.CU,'" })}}'),aclSnippet:"pm.auth"}),this.app.pluginSettingsManager.add("auth.authenticators",{icon:"LoginOutlined",title:'{{t("Authenticators", { ns: "'.concat(s.CU,'" })}}'),Component:D,aclSnippet:"pm.auth.authenticators",sort:1}),this.router.add("auth",{Component:"AuthLayout"}),this.router.add("auth.signin",{path:"/signin",Component:"SignInPage"}),this.router.add("auth.signup",{path:"/signup",skipAuthCheck:!0,Component:"SignUpPage"}),this.router.add("auth.forgotPassword",{path:"/forgot-password",skipAuthCheck:!0,Component:"ForgotPasswordPage"}),this.router.add("auth.resetPassword",{path:"/reset-password",skipAuthCheck:!0,Component:"ResetPasswordPage"}),this.app.addComponents({AuthLayout:q,SignInPage:L,SignUpPage:M,ForgotPasswordPage:w,ResetPasswordPage:O}),this.app.providers.unshift([_,{}]),this.registerType("Email/Password",{components:{SignInForm:N,SignUpForm:U,AdminSettingsForm:R}}),this.app.pluginSettingsManager.add("security.token-policy",{title:'{{t("Token policy", { ns: "'.concat(s.CU,'" })}}'),Component:V,aclSnippet:"pm.security.token-policy",icon:"ApiOutlined",sort:0}),t=(e=function(e){if(Array.isArray(e))return e}(((o=({app:this.app}).app).apiClient.axios,i=[function(e){var t,n=null==e||null==(t=e.headers)?void 0:t["x-new-token"];return n&&o.apiClient.auth.setToken(n),e},function(e){var t,n,r,i,a,u=null==e||null==(n=e.response)||null==(t=n.headers)?void 0:t["x-new-token"],s=null==e||null==(i=e.response)||null==(r=i.data)?void 0:r.errors,p=Array.isArray(s)?s[0]:null,f=o.router.state.location,d=f.pathname,m=f.search,y=o.router.basename;if(u&&o.apiClient.auth.setToken(u),401===e.status&&(null==p?void 0:p.code)&&c[p.code]&&(o.apiClient.auth.setToken(""),d===o.getHref("signin")&&(null==p?void 0:p.code)!==c.EMPTY_TOKEN&&e.config&&(e.config.skipNotify=!1),(null==p?void 0:p.code)==="USER_HAS_NO_ROLES_ERR"&&(e.config.skipNotify=!0,o.error=p)),401===e.status&&!(null==(a=e.config)?void 0:a.skipAuth)&&(null==p?void 0:p.code)&&c[p.code]){if(!p||(null==p?void 0:p.code)===c.SKIP_TOKEN_RENEW)throw e;var v=o.router.isSkippedAuthCheckRoute(d);if(v&&(e.config.skipNotify=!0),d!==o.getHref("signin")&&!v){var b,h,g=(b=y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),h=new RegExp("^".concat(b.replace(/\/?$/,""),"(\\/|$)")),d.replace(h,"/")||d);l(function(){o.apiClient.auth.setToken(null),o.router.navigate("/signin?redirect=".concat(g).concat(m),{replace:!0})})}}throw e}]))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(i)||function(e){if(e){if("string"==typeof e)return E(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return E(e,2)}}(i)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],n=e[1],this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:t,rejected:n,synchronous:!1,runWhen:null}),[2]})},function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){j(i,r,o,a,u,"next",e)}function u(e){j(i,r,o,a,u,"throw",e)}a(void 0)})}).call(this)}}],function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(n.prototype,t),n}(C(r.Plugin)),G=H},706:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},751:function(e,t,n){"use strict";n.r(t),n.d(t,{Options:function(){return F},SignInForm:function(){return y},SignUpForm:function(){return O},useRedirect:function(){return f},useSignUp:function(){return P},useSignIn:function(){return d}});var r=n(342),o=n(155),i=n.n(o),a=n(872),u=n(350),c=n(442),l=n(230);function s(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 p(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function f(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,c.useNavigate)(),r=(function(e){if(Array.isArray(e))return e}(e=(0,c.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return s(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return s(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,o.useCallback)(function(){var e=r.get("redirect")||t;!function(e){try{var t=new URL(e,window.location.origin);return/(?:^|\/)v2(?:\/|$)/.test(t.pathname)}catch(t){return/(?:^|\/)v2(?:\/|$)/.test(e)}}(e)?n(e,{replace:!0}):window.location.replace(e)},[n,t,r])}var d=function(e){var t=(0,l.useForm)(),n=(0,r.useAPIClient)(),o=f(),i=(0,r.useCurrentUserContext)().refreshAsync;return{run:function(){var r;return(r=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(r){switch(r.label){case 0:return[4,t.submit()];case 1:return r.sent(),[4,n.auth.signIn(t.values,e)];case 2:return r.sent(),[4,i()];case 3:return r.sent(),o(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){p(i,n,o,a,u,"next",e)}function u(e){p(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},m=function(e){var t=e.showForgotPassword;return{type:"object",name:"passwordForm","x-component":"FormV2",properties:{account:{type:"string","x-component":"Input","x-validator":'{{(value) => {\n if (!value) {\n return t("Please enter your username or email");\n }\n if (value.includes(\'@\')) {\n if (!/^[\\w-]+(\\.[\\w-]+)*@[\\w-]+(\\.[\\w-]+)+$/.test(value)) {\n return t("Please enter a valid email");\n }\n } else {\n return /^[^@<>"\'/]{1,50}$/.test(value) || t("Please enter a valid username");\n }\n }}}',"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Username/Email")}}',style:{}}},password:{type:"string","x-component":"Password",required:!0,"x-decorator":"FormItem","x-component-props":{placeholder:'{{t("Password")}}',style:{},showForgotPassword:t}},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign in")}}',type:"void","x-component":"Action","x-component-props":{htmlType:"submit",block:!0,type:"primary",useAction:"{{ useBasicSignIn }}",style:{width:"100%"}}}}},links:{type:"void","x-component":"div","x-component-props":{style:{display:"flex",justifyContent:"space-between"}},properties:{signUp:{type:"void","x-component":"Link","x-component-props":{to:"{{ signUpLink }}"},"x-content":'{{t("Create an account")}}',"x-visible":"{{ allowSignUp }}"},forgotPassword:{type:"void","x-component":"Link","x-component-props":{to:'{{"/forgot-password?name=" + authenticator.name}}'},"x-content":'{{t("Forgot password")}}',"x-visible":t}}}}}},y=function(e){var t=(0,a.dE)().t,n=e.authenticator,o=n.authType,c=n.name,l=n.options,s=!!(0,u.useSignUpForms)()[o]&&null!=l&&!!l.allowSignUp,p="/signup?name=".concat(c);return i().createElement(r.SchemaComponent,{schema:m({showForgotPassword:!!(null==l?void 0:l.enableResetPassword)}),scope:{useBasicSignIn:function(){return d(c)},allowSignUp:s,signUpLink:p,t:t,authenticator:n}})},v=n(166),b=n(59),h=n(953),g=n(706);function w(e,t,n,r,o,i,a){try{var u=e[i](a),c=u.value}catch(e){n(e);return}u.done?t(c):Promise.resolve(c).then(r,o)}function x(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function S(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}var P=function(e){var t=(0,c.useNavigate)(),n=(0,l.useForm)(),o=(0,r.useAPIClient)(),i=(0,h.useTranslation)().t;return{run:function(){var r;return(r=function(){var r;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:c(0)}),u(a,"throw",{value:c(1)}),u(a,"return",{value:c(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function c(u){return function(c){var l=[u,c];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&l[0]?r.return:l[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,l[1])).done)return o;switch(r=0,o&&(l=[2&l[0],o.value]),l[0]){case 0:case 1:o=l;break;case 4:return i.label++,{value:l[1],done:!1};case 5:i.label++,r=l[1],l=[0];continue;case 7:l=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===l[0]||2===l[0])){i=0;continue}if(3===l[0]&&(!o||l[1]>o[0]&&l[1]<o[3])){i.label=l[1];break}if(6===l[0]&&i.label<o[1]){i.label=o[1],o=l;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(l);break}o[2]&&i.ops.pop(),i.trys.pop();continue}l=t.call(e,i)}catch(e){l=[6,e],r=0}finally{n=o=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}}}(this,function(a){switch(a.label){case 0:return[4,n.submit()];case 1:return a.sent(),[4,o.auth.signUp(n.values,null==e?void 0:e.authenticator)];case 2:return a.sent(),b.message.success((null==e||null==(r=e.message)?void 0:r.success)||i("Sign up successfully, and automatically jump to the sign in page")),setTimeout(function(){t("/signin")},2e3),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,o){var i=r.apply(e,t);function a(e){w(i,n,o,a,u,"next",e)}function u(e){w(i,n,o,a,u,"throw",e)}a(void 0)})})()}}},O=function(e){var t=e.authenticatorName,n=(0,a.dE)().t,u=(0,h.useTranslation)("lm-collections").t,s=(0,g.p)(t).options,p=s.signupForm,f=(0,o.useMemo)(function(){return p.filter(function(e){return e.show}).reduce(function(e,t){var r=S(x({},t.uiSchema),{title:t.uiSchema.title?u(l.Schema.compile(t.uiSchema.title,{t:n})):""});return e[t.field]=S(x({},r),{required:t.required,"x-decorator":"FormItem"}),e},{})},[p]);if(!(null==s?void 0:s.allowSignUp))return i().createElement(c.Navigate,{to:"/not-found",replace:!0});var d={type:"object",name:(0,v.uid)(),"x-component":"FormV2",properties:S(x({},f),{password:{type:"string",required:!0,title:'{{t("Password")}}',"x-component":"Password","x-decorator":"FormItem","x-validator":{password:!0},"x-component-props":{checkStrength:!0,style:{}},"x-reactions":[{dependencies:[".confirm_password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},confirm_password:{type:"string",required:!0,"x-component":"Password","x-decorator":"FormItem",title:'{{t("Confirm password")}}',"x-validator":{password:!0},"x-component-props":{style:{}},"x-reactions":[{dependencies:[".password"],fulfill:{state:{selfErrors:'{{$deps[0] && $self.value && $self.value !== $deps[0] ? t("Password mismatch") : ""}}'}}}]},actions:{type:"void","x-component":"div",properties:{submit:{title:'{{t("Sign up")}}',type:"void","x-component":"Action","x-component-props":{block:!0,type:"primary",htmlType:"submit",useAction:"{{ useBasicSignUp }}",style:{width:"100%"}}}}},link:{type:"void","x-component":"div",properties:{link:{type:"void","x-component":"Link","x-component-props":{to:"/signin"},"x-content":'{{t("Log in with an existing account")}}'}}}})};return i().createElement(r.SchemaComponent,{schema:d,scope:{useBasicSignUp:function(){return P({authenticator:t})},t:n}})},E=n(418);function j(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 T(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){T(e,t,n[t])})}return e}function k(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function C(e){return function(e){if(Array.isArray(e))return j(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e){if(e){if("string"==typeof e)return j(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return j(e,void 0)}}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var I=function(){var e=(0,r.useRecord)(),t=(0,r.useCollectionManager)().getCollection("users").fields.filter(function(e){var t;return!e.hidden&&!e.target&&e.interface&&!(null==(t=e.uiSchema)?void 0:t["x-read-pretty"])}),n=t.map(function(e){var t;return{value:e.name,label:null==(t=e.uiSchema)?void 0:t.title}}),u=(0,o.useMemo)(function(){var n=((null==(u=e.options)||null==(a=u.public)?void 0:a.signupForm)||[]).filter(function(e){return t.find(function(t){return t.name===e.field})}),r=!0,o=!1,i=void 0;try{for(var a,u,c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0)!function(){var e=c.value;n.find(function(t){return t.field===e.name})||n.push({field:e.name,show:"username"===e.name,required:"username"===e.name})}()}catch(e){o=!0,i=e}finally{try{r||null==l.return||l.return()}finally{if(o)throw i}}return n},[t,e]);return(0,o.useEffect)(function(){var t;e.options=k(A({},e.options),{public:k(A({},null==(t=e.options)?void 0:t.public),{signupForm:u})})},[e,u]),i().createElement(r.SchemaComponent,{components:{ArrayTable:E.ArrayTable},schema:{type:"void",properties:{"public.signupForm":{title:'{{t("Sign up form")}}',type:"array","x-decorator":"FormItem","x-component":"ArrayTable","x-component-props":{bordered:!1},"x-validator":"{{ (value) => {\n const check = value?.some((item) => ['username', 'email'].includes(item.field) && item.show && item.required);\n if (!check) {\n return t('At least one of the username or email fields is required');\n }\n} }}",default:u,items:{type:"object","x-decorator":"ArrayItems.Item",properties:{column0:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:20,align:"center"},properties:{sort:{type:"void","x-component":"ArrayTable.SortHandle"}}},column1:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:100,title:(0,a.vV)("Field")},properties:{field:{type:"string","x-decorator":"FormItem","x-component":"Select",enum:n,"x-read-pretty":!0}}},column2:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Show")},properties:{show:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".required"],fulfill:{state:{value:"{{ $deps[0] || $self.value }}"}}}}}},column3:{type:"void","x-component":"ArrayTable.Column","x-component-props":{width:80,title:(0,a.vV)("Required")},properties:{required:{type:"boolean","x-decorator":"FormItem","x-component":"Checkbox","x-reactions":{dependencies:[".show"],fulfill:{state:{value:"{{ !$deps[0] ? false : $self.value }}"}}}}}}}}}}}})},_=function(){var e=(0,a.dE)().t;return[(0,r.useGlobalVariable)("$env"),(0,r.useCurrentUserVariable)({maxDepth:1}).currentUserSettings,(0,r.useSystemSettingsVariable)().systemSettings,{value:"$resetLink",label:e("Reset password link")},{value:"$resetLinkExpiration",label:e("Reset link expiration (minutes)")}].filter(Boolean)},F=function(){var e=(0,a.dE)().t,t=_(),n=i().createElement("span",null,e("No notification channels found. Please "),i().createElement(c.Link,{to:"/admin/settings/notification-manager/channels"},e("add one first")),".");return i().createElement(r.SchemaComponent,{scope:{t:e},components:{Alert:b.Alert,SignupFormSettings:I,FormTab:E.FormTab},schema:{type:"object",properties:{notice:{type:"void","x-decorator":"FormItem","x-component":"Alert","x-component-props":{showIcon:!0,message:'{{t("The authentication allows users to sign in via username or email.")}}'}},collapse:{type:"void","x-component":"FormTab",properties:{basic:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Sign up settings")},properties:T({"public.allowSignUp":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Allow to sign up")}}',"x-component":"Checkbox",default:!0}},(0,v.uid)(),{type:"void","x-component":"SignupFormSettings"})},forgetPassword:{type:"void","x-component":"FormTab.TabPane","x-component-props":{tab:(0,a.vV)("Forgot password")},properties:{"public.enableResetPassword":{"x-decorator":"FormItem",type:"boolean",title:'{{t("Enable forget password")}}',"x-component":"Checkbox",default:!1},divider1:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("1. Select notification channel"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},notificationChannel:{type:"string",title:'{{t("Notification channel (Email)")}}',required:!0,"x-decorator":"FormItem","x-component":"RemoteSelect","x-component-props":{multiple:!1,manual:!1,fieldNames:{label:"title",value:"name"},service:{resource:"notificationChannels",action:"list",params:{filter:{notificationType:"email"}}},notFoundContent:n},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}],description:'{{t("The notification channel used to send the reset password email, only support email channel")}}'},divider2:{type:"void","x-component":function(){return i().createElement(b.Divider,{orientation:"left",orientationMargin:"0"},e("2. Configure reset email"))},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}"}}}]},emailSubject:{type:"string",required:!0,title:'{{t("Subject")}}',"x-decorator":"FormItem","x-component":"Variable.TextArea","x-component-props":{scope:C(t)},"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:'{{t("defaultResetPasswordEmailSubject")}}'}}}],default:'{{t("defaultResetPasswordEmailSubject")}}'},emailContentType:{type:"string",title:'{{t("Content type")}}',required:!0,"x-decorator":"FormItem","x-component":"Radio.Group",enum:[{label:"HTML",value:"html"},{label:'{{t("Plain text")}}',value:"text"}],default:"html","x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:"html"}}}]},emailContentHTML:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:C(t),placeholder:"Hi,",autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "html"}}',initialValue:'{{t("defaultResetPasswordEmailContentHTML")}}'}}}],default:'{{t("defaultResetPasswordEmailContentHTML")}}'},emailContentText:{type:"string",required:!0,title:'{{t("Content")}}',"x-decorator":"FormItem","x-component":"Variable.RawTextArea","x-component-props":{scope:C(t),autoSize:{minRows:10}},"x-reactions":[{dependencies:[".public.enableResetPassword",".emailContentType"],fulfill:{state:{visible:'{{$deps[0] && $deps[1] === "text"}}',initialValue:'{{t("defaultResetPasswordEmailContentText")}}'}}}],default:'{{t("defaultResetPasswordEmailContentText")}}'},resetTokenExpiresIn:{type:"number",title:'{{t("Reset link expiration")}}',"x-decorator":"FormItem","x-component":"InputNumber","x-component-props":{suffix:e("Minutes"),style:{width:"100%"}},default:120,required:!0,"x-reactions":[{dependencies:[".public.enableResetPassword"],fulfill:{state:{visible:"{{$deps[0]}}",initialValue:120}}}]}}}}}}}})}},872:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},vV:function(){return u}});var r=n(953),o=n(342),i="auth";function a(){return(0,r.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(e){return o.i18n.t(e,{ns:[i,"client"],nsMode:"fallback"})}},350:function(e,t,n){"use strict";n.r(t),n.d(t,{AuthLayout:function(){return d},useSignInButtons:function(){return P},SignUpPage:function(){return C},useSignInForms:function(){return S},useSignUpForms:function(){return k},SignupPageContext:function(){return T},AuthenticatorsContextProvider:function(){return f},SignupPageProvider:function(){return A},SignInPage:function(){return O}});var r=n(477),o=n(342),i=n(59),a=n(155),u=n.n(a),c=n(442),l=n(953),s=n(706);function p(){var e,t,n=(e=["\n position: absolute;\n bottom: 0;\n width: 100%;\n left: 0;\n text-align: center;\n padding-bottom: 24px;\n background-color: ",";\n "],t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}})));return p=function(){return n},n}var f=function(e){var t=e.children,n=(0,o.useAPIClient)(),r=(0,o.useRequest)(function(){return n.resource("authenticators").publicList().then(function(e){var t;return(null==e||null==(t=e.data)?void 0:t.data)||[]})}),a=r.data,c=r.error;if(r.loading)return u().createElement("div",{style:{textAlign:"center",marginTop:20}},u().createElement(i.Spin,null));if(c)throw c;return u().createElement(s.m.Provider,{value:void 0===a?[]:a},t)};function d(){var e,t=((0,o.useSystemSettings)()||{}).data,n=(0,o.useToken)().token,i=(0,l.useTranslation)("lm-collections").t;return u().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},u().createElement("div",{style:{position:"fixed",top:"2em",right:"2em"}},u().createElement(o.SwitchLanguage,null)),u().createElement("h1",{style:{textAlign:"center"}},u().createElement(o.ReadPretty.TextArea,{value:i(null==t||null==(e=t.data)?void 0:e.title)})),u().createElement(f,null,u().createElement(c.Outlet,null)),u().createElement("div",{className:(0,r.css)(p(),n.colorBgContainer)},u().createElement(o.PoweredBy,null)))}var m=n(574),y=n(872),v=n(230);function b(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 h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return b(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return b(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}function w(){var e=g(["\n display: flex;\n "]);return w=function(){return e},e}function x(){var e=g(["\n display: flex;\n "]);return x=function(){return e},e}var S=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=h(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignInForm)&&(t[s]=p.components.SignInForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=(0,o.usePlugin)(m.default).authTypes.getEntities(),n={},r=!0,i=!1,a=void 0;try{for(var c,l=t[Symbol.iterator]();!(r=(c=l.next()).done);r=!0){var s,p=h(c.value,2),f=p[0],d=p[1];(null==(s=d.components)?void 0:s.SignInButton)&&(n[f]=d.components.SignInButton)}}catch(e){i=!0,a=e}finally{try{r||null==l.return||l.return()}finally{if(i)throw a}}var y=Object.keys(n);return e.filter(function(e){return y.includes(e.authType)}).map(function(e,t){return u().createElement(n[e.authType],{key:t,authenticator:e})})},O=function(){var e=(0,y.dE)().t;(0,o.useCurrentDocumentTitle)("Signin"),(0,o.useViewport)();var t=S(),n=(0,a.useContext)(s.m),c=P(n);if(!n.length)return u().createElement("div",{style:{color:"#ccc"}},e("No authentication methods available."));var l=n.map(function(n){var r=t[n.authType];if(r){var o="".concat(e("Sign-in")," (").concat(v.Schema.compile(n.authTypeTitle||n.authType,{t:e}),")");return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({component:(0,a.createElement)(r,{authenticator:n}),tabTitle:n.title||o},n)}}).filter(function(e){return e});return u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(w())},l.length>1?u().createElement(i.Tabs,{items:l.map(function(e){return{label:e.tabTitle,key:e.name,children:e.component}})}):l.length?u().createElement("div",null,l[0].component):u().createElement(u().Fragment,null),u().createElement(i.Space,{direction:"vertical",className:(0,r.css)(x())},c))};function E(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 j(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return E(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return E(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var T=(0,a.createContext)({});T.displayName="SignupPageContext";var A=function(e){var t=(0,a.useContext)(T);return t[e.authType]={component:e.component},u().createElement(T.Provider,{value:t},e.children)},k=function(){var e=(0,o.usePlugin)(m.default).authTypes.getEntities(),t={},n=!0,r=!1,i=void 0;try{for(var a,u=e[Symbol.iterator]();!(n=(a=u.next()).done);n=!0){var c,l=j(a.value,2),s=l[0],p=l[1];(null==(c=p.components)?void 0:c.SignUpForm)&&(t[s]=p.components.SignUpForm)}}catch(e){r=!0,i=e}finally{try{n||null==u.return||u.return()}finally{if(r)throw i}}return t},C=function(){(0,o.useViewport)(),(0,o.useCurrentDocumentTitle)("Signup");var e=k(),t=j((0,c.useSearchParams)(),1)[0].get("name"),n=((0,s.p)(t)||{}).authType;return e[n]?(0,a.createElement)(e[n],{authenticatorName:t}):u().createElement(c.Navigate,{to:"/not-found",replace:!0})}},375:function(e){"use strict";e.exports=i},477:function(e){"use strict";e.exports=t},418:function(e){"use strict";e.exports=r},452:function(e){"use strict";e.exports=s},230:function(e){"use strict";e.exports=o},166:function(e){"use strict";e.exports=a},342:function(e){"use strict";e.exports=l},768:function(e){"use strict";e.exports=p},59:function(e){"use strict";e.exports=c},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=n},971:function(e,t,n){"use strict";var r="",o="u">typeof document?document.currentScript:null;if(o&&o.src){var i=o.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");i.indexOf("/static/plugins/@nocobase/plugin-auth/dist/client/")>=0&&(r=i.replace(/\/[^\/]+$/,"/"))}if(!r){var a=window.__webpack_public_path__||"";a&&("/"!==a.charAt(a.length-1)&&(a+="/"),r=a+"static/plugins/@nocobase/plugin-auth/dist/client/")}if(!r){var u=window.__nocobase_modern_client_prefix__||"v",c="/"+(u=String(u).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(r=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var l=window.location.pathname||"/",s=l.indexOf(c);r=s>=0?l.slice(0,s+1):"/"}r&&(r=r.replace(RegExp("/"+u+"/?$"),"/")),r||(r="/"),"/"!==r.charAt(r.length-1)&&(r+="/"),r+="static/plugins/@nocobase/plugin-auth/dist/client/"}n.p=r}},v={};function b(e){var t=v[e];if(void 0!==t)return t.exports;var n=v[e]={exports:{}};return y[e](n,n.exports,b),n.exports}b.m=y,b.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return b.d(t,{a:t}),t},b.d=function(e,t){for(var n in t)b.o(t,n)&&!b.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},b.f={},b.e=function(e){return Promise.all(Object.keys(b.f).reduce(function(t,n){return b.f[n](e,t),t},[]))},b.u=function(e){return""+e+"."+({443:"aa711879b4855b88",611:"bf903b6a5490becc",680:"8758971b4dd75b23"})[e]+".js"},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},h={},b.l=function(e,t,n,r){if(h[e])return void h[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var c=a[u];if(c.getAttribute("src")==e||c.getAttribute("data-rspack")=="@nocobase/plugin-auth:"+n){o=c;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,b.nc&&o.setAttribute("nonce",b.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth:"+n),o.src=e),h[e]=[t];var l=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=h[e];if(delete h[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(l.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=l.bind(null,o.onerror),o.onload=l.bind(null,o.onload),i&&document.head.appendChild(o)},b.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.g.importScripts&&(g=b.g.location+"");var h,g,w=b.g.document;if(!g&&w&&(w.currentScript&&"SCRIPT"===w.currentScript.tagName.toUpperCase()&&(g=w.currentScript.src),!g)){var x=w.getElementsByTagName("script");if(x.length)for(var S=x.length-1;S>-1&&(!g||!/^http(s?):/.test(g));)g=x[S--].src}if(!g)throw Error("Automatic publicPath is not supported in this browser");return b.p=g.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},b.f.j=function(e,t){var n=b.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=b.p+b.u(e),i=Error();b.l(o,function(t){if(b.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},d=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)b.o(i,n)&&(b.m[n]=i[n]);a&&a(b)}for(e&&e(t);u<o.length;u++)r=o[u],b.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(m=self.webpackChunk_nocobase_plugin_auth=self.webpackChunk_nocobase_plugin_auth||[]).forEach(d.bind(null,0)),m.push=d.bind(null,m.push.bind(m)),b(971),b(574)}()});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file is part of the NocoBase (R) project.
|
|
3
|
+
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
+
* Authors: NocoBase Team.
|
|
5
|
+
*
|
|
6
|
+
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
+
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
"use strict";(self.webpackChunk_nocobase_plugin_auth_client_v2=self.webpackChunk_nocobase_plugin_auth_client_v2||[]).push([["9"],{648:function(e,t,n){n.r(t),n.d(t,{AuthenticatorFormView:function(){return O},default:function(){return A},loadAuthenticatorForEdit:function(){return S}});var r=n(375),o=n(485),u=n(694),a=n(6),l=n(59),i=n(773),c=n(155),s=n.n(c),d=n(488);function f(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 p(e,t,n,r,o,u,a){try{var l=e[u](a),i=l.value}catch(e){n(e);return}l.done?t(i):Promise.resolve(i).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var u=e.apply(t,n);function a(e){p(u,r,o,a,l,"next",e)}function l(e){p(u,r,o,a,l,"throw",e)}a(void 0)})}}function y(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function b(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var u=[],a=!0,l=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(u.push(n.value),!t||u.length!==t);a=!0);}catch(e){l=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(l)throw r}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function v(e){return e&&"u">typeof Symbol&&e.constructor===Symbol?"symbol":typeof e}function g(e,t){var n,r,o,u={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(a,"next",{value:i(0)}),l(a,"throw",{value:i(1)}),l(a,"return",{value:i(2)}),"function"==typeof Symbol&&l(a,Symbol.iterator,{value:function(){return this}}),a;function i(l){return function(i){var c=[l,i];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(o=(o=u.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){u.label=c[1];break}if(6===c[0]&&u.label<o[1]){u.label=o[1],o=c;break}if(o&&u.label<o[2]){u.label=o[2],u.ops.push(c);break}o[2]&&u.ops.pop(),u.trys.pop();continue}c=t.call(e,u)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var E=["id","name","authType","title","description","enabled"];function w(){return(0,u.useFlowContext)().api.resource("authenticators")}function S(e,t){return m(function(){var n,r,o,u,a;return g(this,function(l){switch(l.label){case 0:return[4,e.get({filterByTk:t.id})];case 1:if(!(u=(o=null==(r=l.sent())?void 0:r.data)&&(void 0===o?"undefined":v(o))==="object"&&"data"in o?o.data:o)||(void 0===u?"undefined":v(u))!=="object"||Array.isArray(u))return[2,(0,i.cloneDeep)(t)];return a=(0,i.cloneDeep)(u),[2,b(y({},(0,i.cloneDeep)(t),a),{options:null!=(n=a.options)?n:(0,i.cloneDeep)(t.options)})]}})})()}function O(e){var t,n,r=(0,d.dE)().t,f=(0,d.kj)(),p=(0,c.useMemo)(function(){return e.authTypeOptions.map(function(e){return{value:e.name,label:f(e.title||e.name)}})},[e.authTypeOptions,f]),E=w(),O=h(l.Form.useForm(),1)[0],A=h((0,c.useState)(!1),2),T=A[0],j=A[1],k=h((0,c.useState)(null),2),I=k[0],F=k[1],D="edit"===e.mode&&(null==(t=e.record)?void 0:t.id)!=null,C=(0,a.useRequest)(function(){return m(function(){return g(this,function(t){return e.record?[2,S(E,e.record)]:[2,void 0]})})()},{ready:D,refreshDeps:[null==(n=e.record)?void 0:n.id],onBefore:function(){return F(null)},onError:function(e){var t;return F((null!=(t=Error)&&"u">typeof Symbol&&t[Symbol.hasInstance]?!!t[Symbol.hasInstance](e):e instanceof t)?e:Error(String(e)))}}),P=C.data,x=C.loading,M=null!=P?P:e.record,_=(0,c.useMemo)(function(){return"edit"===e.mode?(0,i.cloneDeep)(M||{}):{name:(0,u.randomId)("s_"),authType:e.authType,enabled:!1,options:{}}},[M,e.authType,e.mode]);(0,c.useEffect)(function(){O.setFieldsValue(_)},[O,_]);var z=l.Form.useWatch("authType",O),B=null!=z?z:e.authType,q=(0,c.useMemo)(function(){var t;return null==(t=e.plugin.authTypes.get(B))?void 0:t.adminSettingsFormLoader},[e.plugin,B]),U=(0,c.useMemo)(function(){return q?(0,c.lazy)(q):null},[q]),R=(0,a.useMemoizedFn)(function(){O.setFieldValue("options",{})}),V=(0,a.useMemoizedFn)(function(){return m(function(){var t,n,r,o;return g(this,function(u){switch(u.label){case 0:return[4,O.validateFields()];case 1:n=function e(t){return"string"==typeof t?t.trim():Array.isArray(t)?t.map(e):t&&(void 0===t?"undefined":v(t))==="object"?Object.fromEntries(Object.entries(t).map(function(t){var n=h(t,2);return[n[0],e(n[1])]})):t}((t=u.sent()).options||{}),j(!0),u.label=2;case 2:if(u.trys.push([2,,7,8]),"create"!==e.mode)return[3,4];return[4,E.create({values:b(y({},t),{options:n})})];case 3:return u.sent(),[3,6];case 4:if((null==(r=e.record)?void 0:r.id)==null)return[3,6];return o=b(y({},(0,i.cloneDeep)(e.record),t),{options:y({},e.record.options||{},n)}),[4,E.update({filterByTk:e.record.id,values:o})];case 5:u.sent(),u.label=6;case 6:return e.onSubmitted(),[3,8];case 7:return j(!1),[7];case 8:return[2]}})})()});return s().createElement(o.DrawerFormLayout,{title:r("create"===e.mode?"Add new":"Configure"),onSubmit:V,submitting:T||x,submitText:r("Submit"),cancelText:r("Cancel")},I?s().createElement(l.Alert,{type:"error",showIcon:!0,message:r("Failed to load authenticator"),description:I.message,style:{marginBottom:16}}):null,s().createElement(l.Spin,{spinning:x},s().createElement(l.Form,{form:O,layout:"vertical",initialValues:_},s().createElement(l.Form.Item,{name:"name",label:r("Auth UID"),rules:[{required:!0,message:r("Please enter an Auth UID")},{pattern:/^[a-zA-Z0-9_-]+$/,message:r("a-z, A-Z, 0-9, _, -")}]},s().createElement(l.Input,{disabled:"edit"===e.mode})),s().createElement(l.Form.Item,{name:"authType",label:r("Auth Type"),rules:[{required:!0}]},s().createElement(l.Select,{options:p,onChange:R})),s().createElement(l.Form.Item,{name:"title",label:r("Title")},s().createElement(l.Input,null)),s().createElement(l.Form.Item,{name:"description",label:r("Description")},s().createElement(l.Input,null)),s().createElement(l.Form.Item,{name:"enabled",label:r("Enabled"),valuePropName:"checked"},s().createElement(l.Checkbox,null)),U?s().createElement(c.Suspense,{fallback:s().createElement(l.Spin,null)},s().createElement(U,null)):null)))}function A(){var e,t=(0,d.dE)().t,n=(0,d.kj)(),i=(0,u.useFlowContext)(),f=l.theme.useToken().token,p=l.App.useApp(),y=p.modal,b=p.message,v=w(),S=i.app.pm.get("@nocobase/plugin-auth"),A=h((0,c.useState)(1),2),T=A[0],j=A[1],k=h((0,c.useState)(o.DEFAULT_PAGE_SIZE),2),I=k[0],F=k[1],D=h((0,c.useState)([]),2),C=D[0],P=D[1],x=(e=w(),(0,a.useRequest)(function(){return m(function(){var t,n,r,o;return g(this,function(u){switch(u.label){case 0:return[4,e.listTypes()];case 1:return[2,Array.isArray(o=null!=(t=null==(r=u.sent())||null==(n=r.data)?void 0:n.data)?t:null==r?void 0:r.data)?o:[]]}})})()},{cacheKey:"@nocobase/plugin-auth:authenticators:listTypes"})).data,M=(0,a.useRequest)(function(){return m(function(){return g(this,function(e){switch(e.label){case 0:return[4,v.list({page:T,pageSize:I,sort:["sort"],fields:E,appends:[]})];case 1:var t,n,r,o,u;return[2,{records:o=Array.isArray(r=null==(n=null==(t=e.sent())?void 0:t.data)?void 0:n.data)?r:Array.isArray(null==r?void 0:r.data)?r.data:[],total:(u=(null==n?void 0:n.meta)||(null==r?void 0:r.meta)||{}).count||u.total||o.length}]}})})()},{refreshDeps:[T,I]}),_=M.data,z=M.loading,B=M.refresh,q=(0,a.useMemoizedFn)(function(e,t){if(t!==I){F(t),j(1);return}j(e)}),U=(0,c.useMemo)(function(){return x||[]},[x]),R=(0,a.useMemoizedFn)(function(e,t,n){i.viewer.drawer({width:"50%",closable:!0,content:function(){return s().createElement(O,{mode:e,authType:t,authTypeOptions:U,plugin:S,record:n,onSubmitted:function(){return B()}})}})}),V=(0,a.useMemoizedFn)(function(e){y.confirm({title:t("Delete"),content:t("Are you sure you want to delete it?"),onOk:function(){return m(function(){return g(this,function(t){switch(t.label){case 0:return[4,v.destroy({filterByTk:e})];case 1:return t.sent(),P([]),B(),[2]}})})()}})}),K=(0,a.useMemoizedFn)(function(e,n){return m(function(){var r;return g(this,function(o){switch(o.label){case 0:if(null==e.id||null==n.id)return[2];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,v.move({sourceId:e.id,targetId:n.id})];case 2:return o.sent(),b.success(t("Saved successfully"),.2),B(),[3,4];case 3:return r=o.sent(),b.error((null==r?void 0:r.message)||"Move failed"),[3,4];case 4:return[2]}})})()}),L=(0,a.useMemoizedFn)(function(e){var t=U.find(function(t){return t.name===e});return n((null==t?void 0:t.title)||e||"")}),Z=(0,c.useMemo)(function(){return[{title:t("Auth UID"),dataIndex:"name"},{title:t("Auth Type"),dataIndex:"authType",render:function(e){return e?s().createElement(l.Tag,null,L(e)):null}},{title:t("Title"),dataIndex:"title"},{title:t("Description"),dataIndex:"description"},{title:t("Enabled"),dataIndex:"enabled",align:"center",width:80,render:function(e){return e?s().createElement(r.CheckOutlined,{style:{color:f.colorSuccess}}):null}},{title:t("Actions"),width:160,render:function(e,n){return s().createElement(l.Space,null,s().createElement("a",{onClick:function(){if(n.authType){if(!S.authTypes.get(n.authType))return void b.error(t("Auth type {{type}} is not registered.").replace("{{type}}",n.authType));R("edit",n.authType,n)}}},t("Configure")),s().createElement("a",{onClick:function(){return V(n.id)}},t("Delete")))}}]},[L,V,b,R,S,t]);return s().createElement(l.Card,{variant:"borderless"},s().createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:f.marginSM,marginBottom:f.margin}},s().createElement(l.Button,{icon:s().createElement(r.DeleteOutlined,null),disabled:!C.length,onClick:function(){return V(C)}},t("Delete")),s().createElement(l.Dropdown,{menu:{items:U.map(function(e){return{key:e.name,label:n(e.title||e.name)}}),onClick:function(e){R("create",e.key)}},disabled:!U.length},s().createElement(l.Button,{type:"primary",icon:s().createElement(r.PlusOutlined,null)},t("Add new")," ",s().createElement(r.DownOutlined,null)))),s().createElement(o.Table,{rowKey:"id",loading:z,columns:Z,dataSource:(null==_?void 0:_.records)||[],isDraggable:!0,onSortEnd:K,rowSelection:{selectedRowKeys:C,onChange:P},pagination:{current:T,pageSize:I,total:(null==_?void 0:_.total)||0,onChange:q}}))}}}]);
|
package/dist/client-v2/index.js
CHANGED
|
@@ -7,4 +7,4 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth/client-v2",["react-i18next","react-router-dom","@formily/react","@ant-design/icons","@nocobase/flow-engine","ahooks","@nocobase/client-v2","react","antd","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-auth/client-v2"]=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-auth/client-v2"]=t(e["react-i18next"],e["react-router-dom"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,i,a,u,l,c,s){return function(){var f,p,d,h={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,u=Math.min;e.exports=function(e,t,n){var l,c,s,f,p,d,h=0,m=!1,y=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=l,r=c;return l=c=void 0,h=t,f=e.apply(r,n)}function g(e){var n=e-d,r=e-h;return void 0===d||n>=t||n<0||y&&r>=s}function w(){var e,n,r,i=o();if(g(i))return E(i);p=setTimeout(w,(e=i-d,n=i-h,r=t-e,y?u(r,s-n):r))}function E(e){return(p=void 0,v&&l)?b(e):(l=c=void 0,f)}function S(){var e,n=o(),r=g(n);if(l=arguments,c=this,d=n,r){if(void 0===p)return h=e=d,p=setTimeout(w,t),m?b(e):f;if(y)return clearTimeout(p),p=setTimeout(w,t),b(d)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,s=(y="maxWait"in n)?a(i(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==p&&clearTimeout(p),h=0,l=d=c=p=void 0},S.flush=function(){return void 0===p?f:E(o())},S}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},829:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(953),l=n(485),c=n(89);function s(){var e,t=r.theme.useToken().token,n=((0,l.useSystemSettings)()||{}).data,o=(0,u.useTranslation)("lm-collections").t;return i().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},i().createElement("div",{style:{position:"fixed",top:t.paddingLG,right:t.paddingLG,color:t.colorText}},i().createElement(l.SwitchLanguage,null)),i().createElement("h1",{style:{textAlign:"center"}},o(null==n||null==(e=n.data)?void 0:e.title)),i().createElement(c.A,null,i().createElement(a.Outlet,null)),i().createElement("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",paddingBottom:t.paddingLG,textAlign:"center",backgroundColor:t.colorBgContainer}},i().createElement(l.PoweredBy,null)))}},826:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=n(824);function f(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 p(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=d((0,a.useSearchParams)(),1)[0].get("name"),h=(0,l.p)(f),m=d(r.Form.useForm(),1)[0],y=d((0,o.useState)(!1),2),v=y[0],b=y[1],g=d((0,o.useState)(""),2),w=g[0],E=g[1];return((0,s.rN)(n("Reset password")),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?i().createElement(r.Form,{form:m,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:E(""),b(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.lostPassword(e)];case 2:return c.sent(),r.message.success(n("Reset email sent successfully")),m.resetFields(),[3,5];case 3:return E((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return b(!1),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,u,"next",e)}function u(e){p(i,n,r,a,u,"throw",e)}a(void 0)})})()}},w?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:w}):null,i().createElement(r.Form.Item,{label:n("Reset password"),name:"email",rules:[{required:!0,message:n("Please fill in your email address")},{type:"email",message:n("Please enter a valid email")}]},i().createElement(r.Input,{placeholder:n("Please enter your email")})),i().createElement(r.Form.Item,{style:{marginBottom:12}},i().createElement(r.Button,{loading:v,htmlType:"submit",type:"primary",block:!0},n("Send reset email"))),i().createElement(a.Link,{to:"/signin"},n("Back to login"))):i().createElement(a.Navigate,{to:"/signin",replace:!0})}},622:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=n(824);function f(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 p(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=(0,a.useNavigate)(),h=d((0,a.useSearchParams)(),1)[0],m=h.get("resetToken"),y=h.get("name"),v=(0,l.p)(y),b=d(r.Form.useForm(),1)[0],g=d((0,o.useState)(!1),2),w=g[0],E=g[1],S=d((0,o.useState)(!0),2),O=S[0],P=S[1],k=d((0,o.useState)(!1),2),A=k[0],x=k[1],T=d((0,o.useState)(""),2),j=T[0],_=T[1];return((0,s.rN)(n("Reset password")),(0,o.useEffect)(function(){var e=!0;if(!m){E(!0),P(!1);return}return t.apiClient.auth.checkResetToken({resetToken:m}).then(function(){e&&(E(!1),P(!1))}).catch(function(){e&&(E(!0),P(!1))}),function(){e=!1}},[t,m]),null==v||null==(e=v.options)?void 0:e.enableResetPassword)?O||m&&!w?i().createElement(r.Form,{form:b,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:_(""),x(!0),c.label=1;case 1:var s,p;return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.resetPassword((s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),p=p={resetToken:m},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(p)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(p)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(p,e))}),s))];case 2:return c.sent(),r.message.success(n("Password reset successful")),window.setTimeout(function(){f("/signin",{replace:!0})},1e3),[3,5];case 3:return _((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return x(!1),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,u,"next",e)}function u(e){p(i,n,r,a,u,"throw",e)}a(void 0)})})()}},j?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:j}):null,i().createElement(r.Form.Item,{label:n("New password"),name:"password",rules:[{required:!0,message:n("Please enter new password")}]},i().createElement(r.Input.Password,{autoComplete:"new-password"})),i().createElement(r.Form.Item,{label:n("Confirm password"),name:"confirmPassword",dependencies:["password"],rules:[{required:!0,message:n("Please enter the same password again")},function(e){var t=e.getFieldValue;return{validator:function(e,r){return r&&t("password")!==r?Promise.reject(Error(n("The passwords entered twice are inconsistent"))):Promise.resolve()}}}]},i().createElement(r.Input.Password,{autoComplete:"new-password"})),i().createElement(r.Form.Item,{style:{marginBottom:12}},i().createElement(r.Button,{loading:A||O,htmlType:"submit",type:"primary",block:!0},n("Confirm"))),i().createElement(a.Link,{to:"/signin"},n("Go to login"))):i().createElement(r.Result,{status:"403",title:n("Reset link has expired"),extra:i().createElement(r.Button,{type:"primary",onClick:function(){return f("/signin")}},n("Go to login"))}):i().createElement(a.Navigate,{to:"/signin",replace:!0})}},818:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(442),l=n(295),c=n(824),s=n(488),f=n(434);function p(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 d(e){var t=(0,r.usePlugin)(f.A);return(0,i.useMemo)(function(){var n={},r=!0,o=!1,i=void 0;try{for(var a,u=t.authTypes.getEntities()[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l,c=(l=a.value,function(e){if(Array.isArray(e))return e}(l)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=c[0],f=c[1][e];f&&(n[s]=f)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n},[t,e])}function h(e){var t=new Map;return function(n){if(e[n])return t.has(n)||t.set(n,(0,i.lazy)(e[n])),t.get(n)}}function m(){var e=(0,r.useApp)(),t=(0,u.useLocation)(),n=(0,u.useNavigate)(),f=(0,s.dE)().t,p=(0,s.kj)(),m=(0,i.useContext)(l.m),y=d("signInFormLoader"),v=d("signInButtonLoader"),b=(0,i.useMemo)(function(){return h(y)},[y]),g=(0,i.useMemo)(function(){return h(v)},[v]);(0,c.rN)(f("Signin")),(0,i.useEffect)(function(){var o=new URLSearchParams(t.search),i=o.get("redirect"),a=(0,r.normalizeV2RedirectPath)(e,i);i!==a&&(o.set("redirect",a),n({pathname:t.pathname,search:"?".concat(o)},{replace:!0}))},[e,t.pathname,t.search,n]);var w=(0,i.useMemo)(function(){return m.map(function(e){var t=b(e.authType);if(!t)return null;var n=p(e.authTypeTitle||e.authType);return{key:e.name,label:e.title||"".concat(f("Sign-in")," (").concat(n,")"),children:a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(t,{authenticator:e}))}}).filter(Boolean)},[m,b,f,p]),E=(0,i.useMemo)(function(){return m.map(function(e,t){var n=g(e.authType);return n?a().createElement(i.Suspense,{key:"".concat(e.name,"-").concat(t),fallback:a().createElement(o.Spin,null)},a().createElement(n,{authenticator:e})):null}).filter(Boolean)},[m,g]);return m.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},w.length>1?a().createElement(o.Tabs,{items:w}):w.length?w[0].children:null,E.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},E):null):a().createElement(o.Empty,{description:f("No authentication methods available.")})}},872:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(442),l=n(295),c=n(824),s=n(488),f=n(434);function p(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 d(){var e,t=(0,s.dE)().t,n=((function(e){if(Array.isArray(e))return e})(e=(0,u.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return p(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0].get("name"),d=(0,l.p)(n),h=(0,r.usePlugin)(f.A),m=(0,i.useMemo)(function(){if(!d)return null;var e,t=null==(e=h.authTypes.get(d.authType))?void 0:e.signUpFormLoader;return t?(0,i.lazy)(t):null},[d,h]);return((0,c.rN)(t("Signup")),d&&m)?a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(m,{authenticatorName:d.name})):a().createElement(o.Empty,{description:t("No authentication methods available.")})}},434:function(e,t,n){"use strict";n.d(t,{A:function(){return x},T:function(){return A}});var r=n(768),o=n(485),i=n(738),a=n.n(i),u=n(258),l=n(488);function c(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)})}}function f(e,t,n){return t=v(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,E()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t,n){return(d=E()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function S(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var O=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"section","preferences"),y(e,"sort",350),y(e,"label","Language"),e}return b(t,e),m(t,[{key:"prepare",value:function(){return s(function(){var e,t,n,r,i;return S(this,function(a){switch(a.label){case 0:return[4,this.context.systemSettings.load()];case 1:return i=(null==(r=a.sent())||null==(e=r.data)?void 0:e.enabledLanguages)||[],this.options=i.map(function(e){var t;return{value:e,label:(null==(t=o.languageCodes[e])?void 0:t.label)||e}}),this.value=(null==(t=(n=this.context.app.apiClient.auth).getLocale)?void 0:t.call(n))||this.context.app.apiClient.auth.locale,this.ready=this.options.length>1,[2]}})}).call(this)}},{key:"onChange",value:function(e){return s(function(){return S(this,function(t){return this.context.app.apiClient.auth.setLocale(e),window.location.reload(),[2]})}).call(this)}}]),t}(o.UserCenterSelectItemModel);y(O,"itemId","language");var P={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},k=a()(function(e){e()},3e3,{leading:!0,trailing:!1}),A=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"authTypes",new r.Registry),e}return b(t,e),m(t,[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){return s(function(){return S(this,function(e){return this.app.providers.unshift([u.A,{}]),this.app.flowEngine.registerModels({UserCenterLanguageItemModel:O}),this.addRoutes(),this.registerPresetAuthType(),this.registerSettingsPages(),this.installInterceptors(),[2]})}).call(this)}},{key:"registerSettingsPages",value:function(){var e=this,t=function(t){return e.app.i18n.t(t,{ns:l.CU})};this.pluginSettingsManager.addMenuItem({key:l.CU,title:t("Authentication"),icon:"LoginOutlined",aclSnippet:"pm.auth"}),this.pluginSettingsManager.addPageTabItem({menuKey:l.CU,key:"authenticators",title:t("Authenticators"),icon:"LoginOutlined",aclSnippet:"pm.auth.authenticators",sort:1,componentLoader:function(){return n.e("9").then(n.bind(n,648))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"security",key:"token-policy",title:t("Token policy"),icon:"ApiOutlined",aclSnippet:"pm.security.token-policy",sort:0,componentLoader:function(){return n.e("657").then(n.bind(n,632))}})}},{key:"addRoutes",value:function(){this.router.add("auth",{componentLoader:function(){return Promise.resolve().then(n.bind(n,829))}}),this.router.add("auth.signin",{path:"/signin",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,818))}}),this.router.add("auth.signup",{path:"/signup",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,872))}}),this.router.add("auth.forgotPassword",{path:"/forgot-password",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,826))}}),this.router.add("auth.resetPassword",{path:"/reset-password",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,622))}})}},{key:"registerPresetAuthType",value:function(){this.registerType("Email/Password",{signInFormLoader:function(){return n.e("795").then(n.bind(n,918))},signUpFormLoader:function(){return n.e("841").then(n.bind(n,720))},adminSettingsFormLoader:function(){return n.e("217").then(n.bind(n,264))}})}},{key:"installInterceptors",value:function(){var e=this;this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:function(t){var n,r=null==t||null==(n=t.headers)?void 0:n["x-new-token"];return r&&e.app.apiClient.auth.setToken(r),t},rejected:function(t){var n,r,i,a,u,l,c,s,f=null==t||null==(r=t.response)||null==(n=r.headers)?void 0:n["x-new-token"],p=null==t||null==(a=t.response)||null==(i=a.data)?void 0:i.errors,d=Array.isArray(p)?p[0]:null,h=(null==(l=e.app.router.router)||null==(u=l.state)?void 0:u.location)||window.location,m=(null==h?void 0:h.pathname)||window.location.pathname,y=(null==t?void 0:t.status)||(null==t||null==(c=t.response)?void 0:c.status);if(f&&e.app.apiClient.auth.setToken(f),401===y&&(null==d?void 0:d.code)&&P[null==d?void 0:d.code]&&(e.app.apiClient.auth.setToken(""),e.app.apiClient.auth.setRole(""),e.app.apiClient.auth.setAuthenticator("")),401===y&&!(null==(s=t.config)?void 0:s.skipAuth)&&(null==d?void 0:d.code)&&P[null==d?void 0:d.code]){if((null==d?void 0:d.code)===P.SKIP_TOKEN_RENEW)throw t;var v=e.app.router.isSkippedAuthCheckRoute(m);if(v&&(t.config.skipNotify=!0),!v){var b=(0,o.getCurrentV2RedirectPath)(e.app,h);return k(function(){e.app.apiClient.auth.setToken(""),e.app.router.navigate("/signin?redirect=".concat(encodeURIComponent(b)),{replace:!0})}),new Promise(function(){})}}throw t},synchronous:!1,runWhen:null})}}]),t}(w(o.Plugin)),x=A},258:function(e,t,n){"use strict";var r=n(485),o=n(155),i=n.n(o),a=n(442);t.A=function(e){var t=e.children,n=(0,r.useApp)(),u=(0,a.useNavigate)(),l=(0,a.useLocation)();return(0,o.useEffect)(function(){var e=new URLSearchParams(l.search),t=e.get("token"),r=e.get("authenticator");if(t){n.apiClient.auth.setToken(t),n.apiClient.auth.setAuthenticator(r),e.delete("token"),e.delete("authenticator");var o=e.toString();u({pathname:l.pathname,search:o?"?".concat(o):""},{replace:!0})}},[n,l.pathname,l.search,u]),i().createElement(i().Fragment,null,t)}},89:function(e,t,n){"use strict";var r=n(59),o=n(155),i=n.n(o),a=n(485),u=n(295);function l(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}t.A=function(e){var t,n,c=e.children,s=(0,a.useApp)(),f=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)({authenticators:[],error:null,loading:!0}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return l(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],d=f[1];return((0,o.useEffect)(function(){var e=!0;return s.apiClient.resource("authenticators").publicList().then(function(t){var n;e&&d({authenticators:(null==t||null==(n=t.data)?void 0:n.data)||[],error:null,loading:!1})}).catch(function(t){e&&d({authenticators:[],error:t,loading:!1})}),function(){e=!1}},[s]),p.loading)?i().createElement("div",{style:{textAlign:"center",marginTop:20}},i().createElement(r.Spin,null)):p.error?i().createElement(r.Alert,{type:"error",showIcon:!0,message:(null==(n=p.error)?void 0:n.message)||"Failed to load authenticators"}):i().createElement(u.m.Provider,{value:p.authenticators},c)}},295:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},824:function(e,t,n){"use strict";n.d(t,{go:function(){return s},rN:function(){return c},wn:function(){return l}});var r=n(155),o=n(442),i=n(485);function a(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 u(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function l(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,i.useApp)(),u=(0,o.useNavigate)(),l=(function(e){if(Array.isArray(e))return e}(e=(0,o.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return a(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,r.useCallback)(function(){var e,r;u(function(e,t){if(!t||"/"===t)return e.startsWith("/")?e:"/".concat(e);var n=t.endsWith("/")?t.slice(0,-1):t;return e===n?"/":e.startsWith("".concat(n,"/"))?e.slice(n.length)||"/":e}(l.get("redirect")||t,null==(e=(r=n.router).getBasename)?void 0:e.call(r)),{replace:!0})},[n.router,u,t,l])}function c(e){(0,r.useEffect)(function(){document.title=e},[e])}function s(e){var t=(0,i.useApp)(),n=l();return{run:function(r){var o;return(o=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:return[4,t.apiClient.auth.signIn(r,e)];case 1:return o.sent(),[4,t.apiClient.request({url:"/auth:check",skipAuth:!0,skipNotify:!0}).catch(function(){})];case 2:return o.sent(),n(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){u(i,n,r,a,l,"next",e)}function l(e){u(i,n,r,a,l,"throw",e)}a(void 0)})})()}}}},488:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},kj:function(){return u}});var r=n(694),o=n(953),i="auth";function a(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(t){return e.context.t(t,{ns:[i,"client"],nsMode:"fallback"})}}},375:function(e){"use strict";e.exports=r},230:function(e){"use strict";e.exports=n},485:function(e){"use strict";e.exports=a},694:function(e){"use strict";e.exports=o},768:function(e){"use strict";e.exports=c},6:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=l},773:function(e){"use strict";e.exports=s},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=t}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return h[e](n,n.exports,y),n.exports}y.m=h,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return""+e+"."+({217:"09744ff679406aff",657:"2a9dcca9ddc31ec0",795:"b26178560fd03daa",841:"ac9bfbb0615510e5",9:"5301763a7da120fa"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},y.l=function(e,t,n,r){if(v[e])return void v[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-auth/client-v2:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth/client-v2:"+n),o.src=e),v[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.g.importScripts&&(b=y.g.location+"");var v,b,g=y.g.document;if(!b&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(b=g.currentScript.src),!b)){var w=g.getElementsByTagName("script");if(w.length)for(var E=w.length-1;E>-1&&(!b||!/^http(s?):/.test(b));)b=w[E--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");y.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},y.f.j=function(e,t){var n=y.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},p=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);a&&a(y)}for(e&&e(t);u<o.length;u++)r=o[u],y.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(d=self.webpackChunk_nocobase_plugin_auth_client_v2=self.webpackChunk_nocobase_plugin_auth_client_v2||[]).forEach(p.bind(null,0)),d.push=p.bind(null,d.push.bind(d));var S={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-auth/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-auth/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth/dist/client-v2/"}y.p=e}(),!function(){"use strict";y.r(S),y.d(S,{AuthLayout:function(){return o.default},AuthProvider:function(){return c.A},AuthenticatorsContext:function(){return t.m},AuthenticatorsContextProvider:function(){return s.A},ForgotPasswordPage:function(){return u.default},NAMESPACE:function(){return n.CU},PluginAuthClientV2:function(){return e.T},ResetPasswordPage:function(){return l.default},SignInPage:function(){return i.default},SignUpPage:function(){return a.default},default:function(){return e.A},useAuthTranslation:function(){return n.dE},useAuthenticator:function(){return t.p},useDocumentTitle:function(){return r.rN},useRedirect:function(){return r.wn},useSignIn:function(){return r.go},useT:function(){return n.kj}});var e=y(434),t=y(295),n=y(488),r=y(824),o=y(829),i=y(818),a=y(872),u=y(826),l=y(622),c=y(258),s=y(89)}(),S}()});
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):"function"==typeof define&&define.amd?define("@nocobase/plugin-auth/client-v2",["react-i18next","react-router-dom","@formily/react","@ant-design/icons","@nocobase/flow-engine","ahooks","@nocobase/client-v2","react","antd","@nocobase/utils/client","lodash"],t):"object"==typeof exports?exports["@nocobase/plugin-auth/client-v2"]=t(require("react-i18next"),require("react-router-dom"),require("@formily/react"),require("@ant-design/icons"),require("@nocobase/flow-engine"),require("ahooks"),require("@nocobase/client-v2"),require("react"),require("antd"),require("@nocobase/utils/client"),require("lodash")):e["@nocobase/plugin-auth/client-v2"]=t(e["react-i18next"],e["react-router-dom"],e["@formily/react"],e["@ant-design/icons"],e["@nocobase/flow-engine"],e.ahooks,e["@nocobase/client-v2"],e.react,e.antd,e["@nocobase/utils/client"],e.lodash)}(self,function(e,t,n,r,o,i,a,u,l,c,s){return function(){var f,p,d,h={432:function(e,t,n){e.exports=n(36).Symbol},77:function(e,t,n){var r=n(432),o=n(444),i=n(371),a=r?r.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":a&&a in Object(e)?o(e):i(e)}},625:function(e,t,n){var r=n(531),o=/^\s+/;e.exports=function(e){return e?e.slice(0,r(e)+1).replace(o,""):e}},565:function(e,t,n){e.exports="object"==typeof n.g&&n.g&&n.g.Object===Object&&n.g},444:function(e,t,n){var r=n(432),o=Object.prototype,i=o.hasOwnProperty,a=o.toString,u=r?r.toStringTag:void 0;e.exports=function(e){var t=i.call(e,u),n=e[u];try{e[u]=void 0;var r=!0}catch(e){}var o=a.call(e);return r&&(t?e[u]=n:delete e[u]),o}},371:function(e){var t=Object.prototype.toString;e.exports=function(e){return t.call(e)}},36:function(e,t,n){var r=n(565),o="object"==typeof self&&self&&self.Object===Object&&self;e.exports=r||o||Function("return this")()},531:function(e){var t=/\s/;e.exports=function(e){for(var n=e.length;n--&&t.test(e.charAt(n)););return n}},738:function(e,t,n){var r=n(130),o=n(593),i=n(909),a=Math.max,u=Math.min;e.exports=function(e,t,n){var l,c,s,f,p,d,h=0,m=!1,y=!1,v=!0;if("function"!=typeof e)throw TypeError("Expected a function");function b(t){var n=l,r=c;return l=c=void 0,h=t,f=e.apply(r,n)}function g(e){var n=e-d,r=e-h;return void 0===d||n>=t||n<0||y&&r>=s}function w(){var e,n,r,i=o();if(g(i))return E(i);p=setTimeout(w,(e=i-d,n=i-h,r=t-e,y?u(r,s-n):r))}function E(e){return(p=void 0,v&&l)?b(e):(l=c=void 0,f)}function S(){var e,n=o(),r=g(n);if(l=arguments,c=this,d=n,r){if(void 0===p)return h=e=d,p=setTimeout(w,t),m?b(e):f;if(y)return clearTimeout(p),p=setTimeout(w,t),b(d)}return void 0===p&&(p=setTimeout(w,t)),f}return t=i(t)||0,r(n)&&(m=!!n.leading,s=(y="maxWait"in n)?a(i(n.maxWait)||0,t):s,v="trailing"in n?!!n.trailing:v),S.cancel=function(){void 0!==p&&clearTimeout(p),h=0,l=d=c=p=void 0},S.flush=function(){return void 0===p?f:E(o())},S}},130:function(e){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},189:function(e){e.exports=function(e){return null!=e&&"object"==typeof e}},733:function(e,t,n){var r=n(77),o=n(189);e.exports=function(e){return"symbol"==typeof e||o(e)&&"[object Symbol]"==r(e)}},593:function(e,t,n){var r=n(36);e.exports=function(){return r.Date.now()}},909:function(e,t,n){var r=n(625),o=n(130),i=n(733),a=0/0,u=/^[-+]0x[0-9a-f]+$/i,l=/^0b[01]+$/i,c=/^0o[0-7]+$/i,s=parseInt;e.exports=function(e){if("number"==typeof e)return e;if(i(e))return a;if(o(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=r(e);var n=l.test(e);return n||c.test(e)?s(e.slice(2),n?2:8):u.test(e)?a:+e}},829:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return s}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(953),l=n(485),c=n(89);function s(){var e,t=r.theme.useToken().token,n=((0,l.useSystemSettings)()||{}).data,o=(0,u.useTranslation)("lm-collections").t;return i().createElement("div",{style:{maxWidth:320,margin:"0 auto",paddingTop:"20vh",paddingBottom:"20vh"}},i().createElement("div",{style:{position:"fixed",top:t.paddingLG,right:t.paddingLG,color:t.colorText}},i().createElement(l.SwitchLanguage,null)),i().createElement("h1",{style:{textAlign:"center"}},o(null==n||null==(e=n.data)?void 0:e.title)),i().createElement(c.A,null,i().createElement(a.Outlet,null)),i().createElement("div",{style:{position:"absolute",bottom:0,left:0,width:"100%",paddingBottom:t.paddingLG,textAlign:"center",backgroundColor:t.colorBgContainer}},i().createElement(l.PoweredBy,null)))}},826:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=n(824);function f(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 p(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=d((0,a.useSearchParams)(),1)[0].get("name"),h=(0,l.p)(f),m=d(r.Form.useForm(),1)[0],y=d((0,o.useState)(!1),2),v=y[0],b=y[1],g=d((0,o.useState)(""),2),w=g[0],E=g[1];return((0,s.rN)(n("Reset password")),null==h||null==(e=h.options)?void 0:e.enableResetPassword)?i().createElement(r.Form,{form:m,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:E(""),b(!0),c.label=1;case 1:return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.lostPassword(e)];case 2:return c.sent(),r.message.success(n("Reset email sent successfully")),m.resetFields(),[3,5];case 3:return E((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return b(!1),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,u,"next",e)}function u(e){p(i,n,r,a,u,"throw",e)}a(void 0)})})()}},w?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:w}):null,i().createElement(r.Form.Item,{label:n("Reset password"),name:"email",rules:[{required:!0,message:n("Please fill in your email address")},{type:"email",message:n("Please enter a valid email")}]},i().createElement(r.Input,{placeholder:n("Please enter your email")})),i().createElement(r.Form.Item,{style:{marginBottom:12}},i().createElement(r.Button,{loading:v,htmlType:"submit",type:"primary",block:!0},n("Send reset email"))),i().createElement(a.Link,{to:"/signin"},n("Back to login"))):i().createElement(a.Navigate,{to:"/signin",replace:!0})}},622:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return h}});var r=n(59),o=n(155),i=n.n(o),a=n(442),u=n(485),l=n(295),c=n(488),s=n(824);function f(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 p(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function d(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,o=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=o){var i=[],a=!0,u=!1;try{for(o=o.call(e);!(a=(n=o.next()).done)&&(i.push(n.value),!t||i.length!==t);a=!0);}catch(e){u=!0,r=e}finally{try{a||null==o.return||o.return()}finally{if(u)throw r}}return i}}(e,t)||function(e,t){if(e){if("string"==typeof e)return f(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return f(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(){var e,t=(0,u.useApp)(),n=(0,c.dE)().t,f=(0,a.useNavigate)(),h=d((0,a.useSearchParams)(),1)[0],m=h.get("resetToken"),y=h.get("name"),v=(0,l.p)(y),b=d(r.Form.useForm(),1)[0],g=d((0,o.useState)(!1),2),w=g[0],E=g[1],S=d((0,o.useState)(!0),2),O=S[0],P=S[1],k=d((0,o.useState)(!1),2),A=k[0],x=k[1],T=d((0,o.useState)(""),2),j=T[0],_=T[1];return((0,s.rN)(n("Reset password")),(0,o.useEffect)(function(){var e=!0;if(!m){E(!0),P(!1);return}return t.apiClient.auth.checkResetToken({resetToken:m}).then(function(){e&&(E(!1),P(!1))}).catch(function(){e&&(E(!0),P(!1))}),function(){e=!1}},[t,m]),null==v||null==(e=v.options)?void 0:e.enableResetPassword)?O||m&&!w?i().createElement(r.Form,{form:b,layout:"vertical",onFinish:function(e){var o;return(o=function(){var o,i,a,u,l;return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(c){switch(c.label){case 0:_(""),x(!0),c.label=1;case 1:var s,p;return c.trys.push([1,3,4,5]),[4,t.apiClient.auth.resetPassword((s=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}({},e),p=p={resetToken:m},Object.getOwnPropertyDescriptors?Object.defineProperties(s,Object.getOwnPropertyDescriptors(p)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(p)).forEach(function(e){Object.defineProperty(s,e,Object.getOwnPropertyDescriptor(p,e))}),s))];case 2:return c.sent(),r.message.success(n("Password reset successful")),window.setTimeout(function(){f("/signin",{replace:!0})},1e3),[3,5];case 3:return _((null==(o=c.sent())||null==(l=o.response)||null==(u=l.data)||null==(a=u.errors)||null==(i=a[0])?void 0:i.message)||(null==o?void 0:o.message)||String(o)),[3,5];case 4:return x(!1),[7];case 5:return[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){p(i,n,r,a,u,"next",e)}function u(e){p(i,n,r,a,u,"throw",e)}a(void 0)})})()}},j?i().createElement(r.Alert,{style:{marginBottom:16},type:"error",showIcon:!0,message:j}):null,i().createElement(r.Form.Item,{label:n("New password"),name:"password",rules:[{required:!0,message:n("Please enter new password")}]},i().createElement(r.Input.Password,{autoComplete:"new-password"})),i().createElement(r.Form.Item,{label:n("Confirm password"),name:"confirmPassword",dependencies:["password"],rules:[{required:!0,message:n("Please enter the same password again")},function(e){var t=e.getFieldValue;return{validator:function(e,r){return r&&t("password")!==r?Promise.reject(Error(n("The passwords entered twice are inconsistent"))):Promise.resolve()}}}]},i().createElement(r.Input.Password,{autoComplete:"new-password"})),i().createElement(r.Form.Item,{style:{marginBottom:12}},i().createElement(r.Button,{loading:A||O,htmlType:"submit",type:"primary",block:!0},n("Confirm"))),i().createElement(a.Link,{to:"/signin"},n("Go to login"))):i().createElement(r.Result,{status:"403",title:n("Reset link has expired"),extra:i().createElement(r.Button,{type:"primary",onClick:function(){return f("/signin")}},n("Go to login"))}):i().createElement(a.Navigate,{to:"/signin",replace:!0})}},818:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return m}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(442),l=n(295),c=n(824),s=n(488),f=n(434);function p(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 d(e){var t=(0,r.usePlugin)(f.A);return(0,i.useMemo)(function(){var n={},r=!0,o=!1,i=void 0;try{for(var a,u=t.authTypes.getEntities()[Symbol.iterator]();!(r=(a=u.next()).done);r=!0){var l,c=(l=a.value,function(e){if(Array.isArray(e))return e}(l)||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(l)||function(e){if(e){if("string"==typeof e)return p(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,2)}}(l)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),s=c[0],f=c[1][e];f&&(n[s]=f)}}catch(e){o=!0,i=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw i}}return n},[t,e])}function h(e){var t=new Map;return function(n){if(e[n])return t.has(n)||t.set(n,(0,i.lazy)(e[n])),t.get(n)}}function m(){var e=(0,r.useApp)(),t=(0,u.useLocation)(),n=(0,u.useNavigate)(),f=(0,s.dE)().t,p=(0,s.kj)(),m=(0,i.useContext)(l.m),y=d("signInFormLoader"),v=d("signInButtonLoader"),b=(0,i.useMemo)(function(){return h(y)},[y]),g=(0,i.useMemo)(function(){return h(v)},[v]);(0,c.rN)(f("Signin")),(0,i.useEffect)(function(){var o=new URLSearchParams(t.search),i=o.get("redirect"),a=(0,r.normalizeV2RedirectPath)(e,i);i!==a&&(o.set("redirect",a),n({pathname:t.pathname,search:"?".concat(o)},{replace:!0}))},[e,t.pathname,t.search,n]);var w=(0,i.useMemo)(function(){return m.map(function(e){var t=b(e.authType);if(!t)return null;var n=p(e.authTypeTitle||e.authType);return{key:e.name,label:e.title||"".concat(f("Sign-in")," (").concat(n,")"),children:a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(t,{authenticator:e}))}}).filter(Boolean)},[m,b,f,p]),E=(0,i.useMemo)(function(){return m.map(function(e,t){var n=g(e.authType);return n?a().createElement(i.Suspense,{key:"".concat(e.name,"-").concat(t),fallback:a().createElement(o.Spin,null)},a().createElement(n,{authenticator:e})):null}).filter(Boolean)},[m,g]);return m.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},w.length>1?a().createElement(o.Tabs,{items:w}):w.length?w[0].children:null,E.length?a().createElement(o.Space,{direction:"vertical",style:{display:"flex"}},E):null):a().createElement(o.Empty,{description:f("No authentication methods available.")})}},872:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return d}});var r=n(485),o=n(59),i=n(155),a=n.n(i),u=n(442),l=n(295),c=n(824),s=n(488),f=n(434);function p(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 d(){var e,t=(0,s.dE)().t,n=((function(e){if(Array.isArray(e))return e})(e=(0,u.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return p(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return p(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0].get("name"),d=(0,l.p)(n),h=(0,r.usePlugin)(f.A),m=(0,i.useMemo)(function(){if(!d)return null;var e,t=null==(e=h.authTypes.get(d.authType))?void 0:e.signUpFormLoader;return t?(0,i.lazy)(t):null},[d,h]);return((0,c.rN)(t("Signup")),d&&m)?a().createElement(i.Suspense,{fallback:a().createElement(o.Spin,null)},a().createElement(m,{authenticatorName:d.name})):a().createElement(o.Empty,{description:t("No authentication methods available.")})}},434:function(e,t,n){"use strict";n.d(t,{A:function(){return x},T:function(){return A}});var r=n(768),o=n(485),i=n(738),a=n.n(i),u=n(258),l=n(488);function c(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function s(e){return function(){var t=this,n=arguments;return new Promise(function(r,o){var i=e.apply(t,n);function a(e){c(i,r,o,a,u,"next",e)}function u(e){c(i,r,o,a,u,"throw",e)}a(void 0)})}}function f(e,t,n){return t=v(t),function(e,t){var n;if(t&&("object"==((n=t)&&"u">typeof Symbol&&n.constructor===Symbol?"symbol":typeof n)||"function"==typeof t))return t;if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e,E()?Reflect.construct(t,n||[],v(e).constructor):t.apply(e,n))}function p(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function d(e,t,n){return(d=E()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&g(o,n.prototype),o}).apply(null,arguments)}function h(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function m(e,t,n){return t&&h(e.prototype,t),n&&h(e,n),e}function y(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v(e){return(v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function b(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&g(e,t)}function g(e,t){return(g=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function w(e){var t="function"==typeof Map?new Map:void 0;return(w=function(e){if(null===e||-1===Function.toString.call(e).indexOf("[native code]"))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return d(e,arguments,v(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),g(n,e)})(e)}function E(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(e){}return(E=function(){return!!e})()}function S(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}var O=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"section","preferences"),y(e,"sort",350),y(e,"label","Language"),e}return b(t,e),m(t,[{key:"prepare",value:function(){return s(function(){var e,t,n,r,i;return S(this,function(a){switch(a.label){case 0:return[4,this.context.systemSettings.load()];case 1:return i=(null==(r=a.sent())||null==(e=r.data)?void 0:e.enabledLanguages)||[],this.options=i.map(function(e){var t;return{value:e,label:(null==(t=o.languageCodes[e])?void 0:t.label)||e}}),this.value=(null==(t=(n=this.context.app.apiClient.auth).getLocale)?void 0:t.call(n))||this.context.app.apiClient.auth.locale,this.ready=this.options.length>1,[2]}})}).call(this)}},{key:"onChange",value:function(e){return s(function(){return S(this,function(t){return this.context.app.apiClient.auth.setLocale(e),window.location.reload(),[2]})}).call(this)}}]),t}(o.UserCenterSelectItemModel);y(O,"itemId","language");var P={EMPTY_TOKEN:"EMPTY_TOKEN",EXPIRED_TOKEN:"EXPIRED_TOKEN",INVALID_TOKEN:"INVALID_TOKEN",TOKEN_RENEW_FAILED:"TOKEN_RENEW_FAILED",BLOCKED_TOKEN:"BLOCKED_TOKEN",EXPIRED_SESSION:"EXPIRED_SESSION",NOT_EXIST_USER:"NOT_EXIST_USER",SKIP_TOKEN_RENEW:"SKIP_TOKEN_RENEW",USER_HAS_NO_ROLES_ERR:"USER_HAS_NO_ROLES_ERR"},k=a()(function(e){e()},3e3,{leading:!0,trailing:!1}),A=function(e){function t(){var e;return p(this,t),e=f(this,t,arguments),y(e,"authTypes",new r.Registry),e}return b(t,e),m(t,[{key:"registerType",value:function(e,t){this.authTypes.register(e,t)}},{key:"load",value:function(){return s(function(){return S(this,function(e){return this.app.providers.unshift([u.A,{}]),this.app.flowEngine.registerModels({UserCenterLanguageItemModel:O}),this.addRoutes(),this.registerPresetAuthType(),this.registerSettingsPages(),this.installInterceptors(),[2]})}).call(this)}},{key:"registerSettingsPages",value:function(){var e=this,t=function(t){return e.app.i18n.t(t,{ns:l.CU})};this.pluginSettingsManager.addMenuItem({key:l.CU,title:t("Authentication"),icon:"LoginOutlined",aclSnippet:"pm.auth"}),this.pluginSettingsManager.addPageTabItem({menuKey:l.CU,key:"authenticators",title:t("Authenticators"),icon:"LoginOutlined",aclSnippet:"pm.auth.authenticators",sort:1,componentLoader:function(){return n.e("9").then(n.bind(n,648))}}),this.pluginSettingsManager.addPageTabItem({menuKey:"security",key:"token-policy",title:t("Token policy"),icon:"ApiOutlined",aclSnippet:"pm.security.token-policy",sort:0,componentLoader:function(){return n.e("657").then(n.bind(n,632))}})}},{key:"addRoutes",value:function(){this.router.add("auth",{componentLoader:function(){return Promise.resolve().then(n.bind(n,829))}}),this.router.add("auth.signin",{path:"/signin",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,818))}}),this.router.add("auth.signup",{path:"/signup",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,872))}}),this.router.add("auth.forgotPassword",{path:"/forgot-password",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,826))}}),this.router.add("auth.resetPassword",{path:"/reset-password",skipAuthCheck:!0,componentLoader:function(){return Promise.resolve().then(n.bind(n,622))}})}},{key:"registerPresetAuthType",value:function(){this.registerType("Email/Password",{signInFormLoader:function(){return n.e("795").then(n.bind(n,918))},signUpFormLoader:function(){return n.e("841").then(n.bind(n,720))},adminSettingsFormLoader:function(){return n.e("217").then(n.bind(n,264))}})}},{key:"installInterceptors",value:function(){var e=this;this.app.apiClient.axios.interceptors.response.handlers.unshift({fulfilled:function(t){var n,r=null==t||null==(n=t.headers)?void 0:n["x-new-token"];return r&&e.app.apiClient.auth.setToken(r),t},rejected:function(t){var n,r,i,a,u,l,c,s,f=null==t||null==(r=t.response)||null==(n=r.headers)?void 0:n["x-new-token"],p=null==t||null==(a=t.response)||null==(i=a.data)?void 0:i.errors,d=Array.isArray(p)?p[0]:null,h=(null==(l=e.app.router.router)||null==(u=l.state)?void 0:u.location)||window.location,m=(null==h?void 0:h.pathname)||window.location.pathname,y=(null==t?void 0:t.status)||(null==t||null==(c=t.response)?void 0:c.status);if(f&&e.app.apiClient.auth.setToken(f),401===y&&(null==d?void 0:d.code)&&P[null==d?void 0:d.code]&&(e.app.apiClient.auth.setToken(""),e.app.apiClient.auth.setRole(""),e.app.apiClient.auth.setAuthenticator("")),401===y&&!(null==(s=t.config)?void 0:s.skipAuth)&&(null==d?void 0:d.code)&&P[null==d?void 0:d.code]){if((null==d?void 0:d.code)===P.SKIP_TOKEN_RENEW)throw t;var v=e.app.router.isSkippedAuthCheckRoute(m);if(v&&(t.config.skipNotify=!0),!v){var b=(0,o.getCurrentV2RedirectPath)(e.app,h);return k(function(){e.app.apiClient.auth.setToken(""),e.app.router.navigate("/signin?redirect=".concat(encodeURIComponent(b)),{replace:!0})}),new Promise(function(){})}}throw t},synchronous:!1,runWhen:null})}}]),t}(w(o.Plugin)),x=A},258:function(e,t,n){"use strict";var r=n(485),o=n(155),i=n.n(o),a=n(442);t.A=function(e){var t=e.children,n=(0,r.useApp)(),u=(0,a.useNavigate)(),l=(0,a.useLocation)();return(0,o.useEffect)(function(){var e=new URLSearchParams(l.search),t=e.get("token"),r=e.get("authenticator");if(t){n.apiClient.auth.setToken(t),n.apiClient.auth.setAuthenticator(r),e.delete("token"),e.delete("authenticator");var o=e.toString();u({pathname:l.pathname,search:o?"?".concat(o):""},{replace:!0})}},[n,l.pathname,l.search,u]),i().createElement(i().Fragment,null,t)}},89:function(e,t,n){"use strict";var r=n(59),o=n(155),i=n.n(o),a=n(485),u=n(295);function l(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}t.A=function(e){var t,n,c=e.children,s=(0,a.useApp)(),f=function(e){if(Array.isArray(e))return e}(t=(0,o.useState)({authenticators:[],error:null,loading:!0}))||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),2!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(t)||function(e){if(e){if("string"==typeof e)return l(e,2);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return l(e,2)}}(t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(),p=f[0],d=f[1];return((0,o.useEffect)(function(){var e=!0;return s.apiClient.resource("authenticators").publicList().then(function(t){var n;e&&d({authenticators:(null==t||null==(n=t.data)?void 0:n.data)||[],error:null,loading:!1})}).catch(function(t){e&&d({authenticators:[],error:t,loading:!1})}),function(){e=!1}},[s]),p.loading)?i().createElement("div",{style:{textAlign:"center",marginTop:20}},i().createElement(r.Spin,null)):p.error?i().createElement(r.Alert,{type:"error",showIcon:!0,message:(null==(n=p.error)?void 0:n.message)||"Failed to load authenticators"}):i().createElement(u.m.Provider,{value:p.authenticators},c)}},295:function(e,t,n){"use strict";n.d(t,{m:function(){return o},p:function(){return i}});var r=n(155),o=(0,r.createContext)([]);o.displayName="AuthenticatorsContext";var i=function(e){return(0,r.useContext)(o).find(function(t){return t.name===e})}},824:function(e,t,n){"use strict";n.d(t,{go:function(){return s},rN:function(){return c},wn:function(){return l}});var r=n(155),o=n(442),i=n(485);function a(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 u(e,t,n,r,o,i,a){try{var u=e[i](a),l=u.value}catch(e){n(e);return}u.done?t(l):Promise.resolve(l).then(r,o)}function l(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"/admin",n=(0,i.useApp)(),u=(0,o.useNavigate)(),l=(function(e){if(Array.isArray(e))return e}(e=(0,o.useSearchParams)())||function(e){var t,n,r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var o=[],i=!0,a=!1;try{for(r=r.call(e);!(i=(t=r.next()).done)&&(o.push(t.value),1!==o.length);i=!0);}catch(e){a=!0,n=e}finally{try{i||null==r.return||r.return()}finally{if(a)throw n}}return o}}(e)||function(e){if(e){if("string"==typeof e)return a(e,1);var t=Object.prototype.toString.call(e).slice(8,-1);if("Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t)return Array.from(t);if("Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return a(e,1)}}(e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0];return(0,r.useCallback)(function(){var e,r;u(function(e,t){if(!t||"/"===t)return e.startsWith("/")?e:"/".concat(e);var n=t.endsWith("/")?t.slice(0,-1):t;return e===n?"/":e.startsWith("".concat(n,"/"))?e.slice(n.length)||"/":e}(l.get("redirect")||t,null==(e=(r=n.router).getBasename)?void 0:e.call(r)),{replace:!0})},[n.router,u,t,l])}function c(e){(0,r.useEffect)(function(){document.title=e},[e])}function s(e){var t=(0,i.useApp)(),n=l();return{run:function(r){var o;return(o=function(){return function(e,t){var n,r,o,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),u=Object.defineProperty;return u(a,"next",{value:l(0)}),u(a,"throw",{value:l(1)}),u(a,"return",{value:l(2)}),"function"==typeof Symbol&&u(a,Symbol.iterator,{value:function(){return this}}),a;function l(u){return function(l){var c=[u,l];if(n)throw TypeError("Generator is already executing.");for(;a&&(a=0,c[0]&&(i=0)),i;)try{if(n=1,r&&(o=2&c[0]?r.return:c[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,c[1])).done)return o;switch(r=0,o&&(c=[2&c[0],o.value]),c[0]){case 0:case 1:o=c;break;case 4:return i.label++,{value:c[1],done:!1};case 5:i.label++,r=c[1],c=[0];continue;case 7:c=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===c[0]||2===c[0])){i=0;continue}if(3===c[0]&&(!o||c[1]>o[0]&&c[1]<o[3])){i.label=c[1];break}if(6===c[0]&&i.label<o[1]){i.label=o[1],o=c;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(c);break}o[2]&&i.ops.pop(),i.trys.pop();continue}c=t.call(e,i)}catch(e){c=[6,e],r=0}finally{n=o=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}(this,function(o){switch(o.label){case 0:return[4,t.apiClient.auth.signIn(r,e)];case 1:return o.sent(),[4,t.apiClient.request({url:"/auth:check",skipAuth:!0,skipNotify:!0}).catch(function(){})];case 2:return o.sent(),n(),[2]}})},function(){var e=this,t=arguments;return new Promise(function(n,r){var i=o.apply(e,t);function a(e){u(i,n,r,a,l,"next",e)}function l(e){u(i,n,r,a,l,"throw",e)}a(void 0)})})()}}}},488:function(e,t,n){"use strict";n.d(t,{CU:function(){return i},dE:function(){return a},kj:function(){return u}});var r=n(694),o=n(953),i="auth";function a(){return(0,o.useTranslation)([i,"client"],{nsMode:"fallback"})}function u(){var e=(0,r.useFlowEngine)();return function(t){return e.context.t(t,{ns:[i,"client"],nsMode:"fallback"})}}},375:function(e){"use strict";e.exports=r},230:function(e){"use strict";e.exports=n},485:function(e){"use strict";e.exports=a},694:function(e){"use strict";e.exports=o},768:function(e){"use strict";e.exports=c},6:function(e){"use strict";e.exports=i},59:function(e){"use strict";e.exports=l},773:function(e){"use strict";e.exports=s},155:function(e){"use strict";e.exports=u},953:function(t){"use strict";t.exports=e},442:function(e){"use strict";e.exports=t}},m={};function y(e){var t=m[e];if(void 0!==t)return t.exports;var n=m[e]={exports:{}};return h[e](n,n.exports,y),n.exports}y.m=h,y.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return y.d(t,{a:t}),t},y.d=function(e,t){for(var n in t)y.o(t,n)&&!y.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},y.f={},y.e=function(e){return Promise.all(Object.keys(y.f).reduce(function(t,n){return y.f[n](e,t),t},[]))},y.u=function(e){return""+e+"."+({217:"09744ff679406aff",657:"2a9dcca9ddc31ec0",795:"b26178560fd03daa",841:"ac9bfbb0615510e5",9:"c10c60a4ecc4256d"})[e]+".js"},y.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),y.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},v={},y.l=function(e,t,n,r){if(v[e])return void v[e].push(t);if(void 0!==n)for(var o,i,a=document.getElementsByTagName("script"),u=0;u<a.length;u++){var l=a[u];if(l.getAttribute("src")==e||l.getAttribute("data-rspack")=="@nocobase/plugin-auth/client-v2:"+n){o=l;break}}o||(i=!0,(o=document.createElement("script")).timeout=120,y.nc&&o.setAttribute("nonce",y.nc),o.setAttribute("data-rspack","@nocobase/plugin-auth/client-v2:"+n),o.src=e),v[e]=[t];var c=function(t,n){o.onerror=o.onload=null,clearTimeout(s);var r=v[e];if(delete v[e],o.parentNode&&o.parentNode.removeChild(o),r&&r.forEach(function(e){return e(n)}),t)return t(n)},s=setTimeout(c.bind(null,void 0,{type:"timeout",target:o}),12e4);o.onerror=c.bind(null,o.onerror),o.onload=c.bind(null,o.onload),i&&document.head.appendChild(o)},y.r=function(e){"u">typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},y.g.importScripts&&(b=y.g.location+"");var v,b,g=y.g.document;if(!b&&g&&(g.currentScript&&"SCRIPT"===g.currentScript.tagName.toUpperCase()&&(b=g.currentScript.src),!b)){var w=g.getElementsByTagName("script");if(w.length)for(var E=w.length-1;E>-1&&(!b||!/^http(s?):/.test(b));)b=w[E--].src}if(!b)throw Error("Automatic publicPath is not supported in this browser");y.p=b.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),f={889:0},y.f.j=function(e,t){var n=y.o(f,e)?f[e]:void 0;if(0!==n)if(n)t.push(n[2]);else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=y.p+y.u(e),i=Error();y.l(o,function(t){if(y.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;i.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",i.name="ChunkLoadError",i.type=r,i.request=o,n[1](i)}},"chunk-"+e,e)}},p=function(e,t){var n,r,o=t[0],i=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in i)y.o(i,n)&&(y.m[n]=i[n]);a&&a(y)}for(e&&e(t);u<o.length;u++)r=o[u],y.o(f,r)&&f[r]&&f[r][0](),f[r]=0},(d=self.webpackChunk_nocobase_plugin_auth_client_v2=self.webpackChunk_nocobase_plugin_auth_client_v2||[]).forEach(p.bind(null,0)),d.push=p.bind(null,d.push.bind(d));var S={};return!function(){"use strict";var e="",t="u">typeof document?document.currentScript:null;if(t&&t.src){var n=t.src.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"");n.indexOf("/static/plugins/@nocobase/plugin-auth/dist/client-v2/")>=0&&(e=n.replace(/\/[^\/]+$/,"/"))}if(!e){var r=window.__webpack_public_path__||"";r&&("/"!==r.charAt(r.length-1)&&(r+="/"),e=r+"static/plugins/@nocobase/plugin-auth/dist/client-v2/")}if(!e){var o=window.__nocobase_modern_client_prefix__||"v",i="/"+(o=String(o).replace(/^\/+|\/+$/g,"")||"v")+"/";if(!(e=window.__nocobase_public_path__||"")&&window.location&&window.location.pathname){var a=window.location.pathname||"/",u=a.indexOf(i);e=u>=0?a.slice(0,u+1):"/"}e&&(e=e.replace(RegExp("/"+o+"/?$"),"/")),e||(e="/"),"/"!==e.charAt(e.length-1)&&(e+="/"),e+="static/plugins/@nocobase/plugin-auth/dist/client-v2/"}y.p=e}(),!function(){"use strict";y.r(S),y.d(S,{AuthLayout:function(){return o.default},AuthProvider:function(){return c.A},AuthenticatorsContext:function(){return t.m},AuthenticatorsContextProvider:function(){return s.A},ForgotPasswordPage:function(){return u.default},NAMESPACE:function(){return n.CU},PluginAuthClientV2:function(){return e.T},ResetPasswordPage:function(){return l.default},SignInPage:function(){return i.default},SignUpPage:function(){return a.default},default:function(){return e.A},useAuthTranslation:function(){return n.dE},useAuthenticator:function(){return t.p},useDocumentTitle:function(){return r.rN},useRedirect:function(){return r.wn},useSignIn:function(){return r.go},useT:function(){return n.kj}});var e=y(434),t=y(295),n=y(488),r=y(824),o=y(829),i=y(818),a=y(872),u=y(826),l=y(622),c=y(258),s=y(89)}(),S}()});
|
|
@@ -7,4 +7,30 @@
|
|
|
7
7
|
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
8
|
*/
|
|
9
9
|
import React from 'react';
|
|
10
|
+
import type PluginAuthClientV2 from '../plugin';
|
|
11
|
+
type AuthenticatorRecord = {
|
|
12
|
+
id: number | string;
|
|
13
|
+
name?: string;
|
|
14
|
+
authType?: string;
|
|
15
|
+
title?: string;
|
|
16
|
+
description?: string;
|
|
17
|
+
enabled?: boolean;
|
|
18
|
+
options?: Record<string, any>;
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
};
|
|
21
|
+
type AuthTypeOption = {
|
|
22
|
+
name: string;
|
|
23
|
+
title?: string;
|
|
24
|
+
};
|
|
25
|
+
declare function useAuthenticatorsResource(): import("@nocobase/sdk").IResource;
|
|
26
|
+
export declare function loadAuthenticatorForEdit(resource: ReturnType<typeof useAuthenticatorsResource>, record: AuthenticatorRecord): Promise<AuthenticatorRecord>;
|
|
27
|
+
export declare function AuthenticatorFormView(props: {
|
|
28
|
+
mode: 'create' | 'edit';
|
|
29
|
+
authType: string;
|
|
30
|
+
authTypeOptions: AuthTypeOption[];
|
|
31
|
+
plugin: PluginAuthClientV2;
|
|
32
|
+
record?: AuthenticatorRecord;
|
|
33
|
+
onSubmitted: () => void;
|
|
34
|
+
}): React.JSX.Element;
|
|
10
35
|
export default function AuthenticatorsPage(): React.JSX.Element;
|
|
36
|
+
export {};
|
package/dist/externalVersion.js
CHANGED
|
@@ -8,21 +8,21 @@
|
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
module.exports = {
|
|
11
|
-
"@nocobase/client": "2.
|
|
11
|
+
"@nocobase/client": "2.3.0-alpha.1",
|
|
12
12
|
"react": "18.2.0",
|
|
13
13
|
"react-router-dom": "6.30.1",
|
|
14
|
-
"@nocobase/utils": "2.
|
|
14
|
+
"@nocobase/utils": "2.3.0-alpha.1",
|
|
15
15
|
"axios": "1.7.7",
|
|
16
16
|
"lodash": "4.18.1",
|
|
17
|
-
"@nocobase/client-v2": "2.
|
|
18
|
-
"@nocobase/flow-engine": "2.
|
|
17
|
+
"@nocobase/client-v2": "2.3.0-alpha.1",
|
|
18
|
+
"@nocobase/flow-engine": "2.3.0-alpha.1",
|
|
19
19
|
"react-i18next": "11.18.6",
|
|
20
|
-
"@nocobase/auth": "2.
|
|
21
|
-
"@nocobase/database": "2.
|
|
22
|
-
"@nocobase/cache": "2.
|
|
23
|
-
"@nocobase/server": "2.
|
|
24
|
-
"@nocobase/logger": "2.
|
|
25
|
-
"@nocobase/test": "2.
|
|
20
|
+
"@nocobase/auth": "2.3.0-alpha.1",
|
|
21
|
+
"@nocobase/database": "2.3.0-alpha.1",
|
|
22
|
+
"@nocobase/cache": "2.3.0-alpha.1",
|
|
23
|
+
"@nocobase/server": "2.3.0-alpha.1",
|
|
24
|
+
"@nocobase/logger": "2.3.0-alpha.1",
|
|
25
|
+
"@nocobase/test": "2.3.0-alpha.1",
|
|
26
26
|
"@formily/antd-v5": "1.2.3",
|
|
27
27
|
"antd": "5.24.2",
|
|
28
28
|
"@formily/shared": "2.3.7",
|
|
@@ -30,6 +30,6 @@ module.exports = {
|
|
|
30
30
|
"@emotion/css": "11.13.0",
|
|
31
31
|
"@ant-design/icons": "5.6.1",
|
|
32
32
|
"ahooks": "3.7.8",
|
|
33
|
-
"@nocobase/actions": "2.
|
|
33
|
+
"@nocobase/actions": "2.3.0-alpha.1",
|
|
34
34
|
"@formily/core": "2.3.7"
|
|
35
35
|
};
|
package/dist/locale/de-DE.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "Der Benutzername oder die E-Mail ist falsch, bitte erneut eingeben",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "Der Benutzername/die E-Mail oder das Passwort ist falsch, bitte erneut eingeben",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "Die Gültigkeitsdauer jedes ausgestellten API-Tokens. Nachdem das Token abgelaufen ist, wird der Server automatisch ein neues Token ausstellen, um die Benutzersitzung aufrechtzuerhalten, wenn es innerhalb der Sitzungsgültigkeitsdauer liegt und das Aktualisierungslimit nicht überschritten hat, andernfalls muss sich der Benutzer erneut anmelden. (Jedes Token kann nur einmal aktualisiert werden)",
|
|
71
|
+
"Invalid sign-in origin": "Ungültige Herkunft der Anmeldung",
|
|
71
72
|
"Token expired": "Token abgelaufen",
|
|
72
73
|
"Token policy": "Token-Richtlinie",
|
|
73
74
|
"Token validity period": "Token-Gültigkeitsdauer",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hallo {{$user.username}},</p>\n\n<p>Wir haben eine Anfrage zum Zurücksetzen des Passworts für Ihr {{$systemSettings.title}}-Konto erhalten.</p>\n\n<p>Bitte klicken Sie auf den unten stehenden Link, um Ihr neues Passwort festzulegen:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Passwort zurücksetzen</a>\n</p>\n\n<p>\n Wenn Sie keine Passwortzurücksetzung angefordert haben, ignorieren Sie bitte diese E-Mail. Ihr Passwort bleibt unverändert.\n</p>\n\n<p>\n Bitte beachten Sie: Zu Ihrer Sicherheit läuft dieser Link zum Zurücksetzen des Passworts in <strong>{{$resetLinkExpiration}} Minuten</strong> ab.\n</p>\n\n<p>Wenn Sie Probleme beim Zurücksetzen Ihres Passworts haben, wenden Sie sich bitte an unser Support-Team.</p>\n\n<p>\n Danke,<br>\n Das {{$systemSettings.title}}-Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hallo {{$user.username}},\n\nWir haben eine Anfrage zum Zurücksetzen des Passworts für Ihr {{$systemSettings.title}}-Konto erhalten.\n\nBitte klicken Sie auf den unten stehenden Link, um Ihr neues Passwort festzulegen:\n\n{{$resetLink}}\n\nWenn Sie keine Passwortzurücksetzung angefordert haben, ignorieren Sie bitte diese E-Mail. Ihr Passwort bleibt unverändert.\n\nBitte beachten Sie: Zu Ihrer Sicherheit läuft dieser Link zum Zurücksetzen des Passworts in {{$resetLinkExpiration}} Minuten ab.\n\nWenn Sie Probleme beim Zurücksetzen Ihres Passworts haben, wenden Sie sich bitte an unser Support-Team.\n\nDanke, Das {{$systemSettings.title}}-Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Setzen Sie Ihr Passwort für {{$systemSettings.title}} zurück"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/en-US.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"Days": "Days",
|
|
14
14
|
"Email channel not found": "Email channel not found",
|
|
15
15
|
"Enable forget password": "Enable forget password",
|
|
16
|
+
"Failed to load authenticator": "Failed to load authenticator",
|
|
16
17
|
"Expired token refresh limit": "Expired token refresh limit",
|
|
17
18
|
"Forgot password": "Forgot password",
|
|
18
19
|
"Go to login": "Go to login",
|
|
@@ -68,6 +69,8 @@
|
|
|
68
69
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
70
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
71
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
72
|
+
"Invalid CSRF token": "Invalid CSRF token",
|
|
73
|
+
"Invalid sign-in origin": "Invalid sign-in origin",
|
|
71
74
|
"Token expired": "Token expired",
|
|
72
75
|
"Token policy": "Token policy",
|
|
73
76
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +84,4 @@
|
|
|
81
84
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
85
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
86
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
87
|
+
}
|
package/dist/locale/es-ES.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Origen de inicio de sesión no válido",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/fr-FR.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Origine de connexion non valide",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/hu-HU.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "A felhasználónév vagy email cím helytelen, kérjük, adja meg újra",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "A felhasználónév/email cím vagy jelszó helytelen, kérjük, adja meg újra",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "A kiadott API Token érvényességi ideje. Miután a Token lejárt, ha az az munkamenet érvényességi idején belül van, és nem haladta meg a frissítési korlátot, a szerver automatikusan kiad egy új Tokent a felhasználói munkamenet fenntartásához, különben a felhasználónak újra be kell jelentkeznie. (Minden Token csak egyszer frissíthető)",
|
|
71
|
+
"Invalid sign-in origin": "Érvénytelen bejelentkezési forrás",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token politika",
|
|
73
74
|
"Token validity period": "Token érvényességi ideje",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/id-ID.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "Nama pengguna atau email salah, harap masukkan lagi",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "Nama pengguna/email atau kata sandi salah, harap masukkan lagi",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "Periode validitas setiap Token API yang dikeluarkan. Setelah Token kedaluwarsa, jika berada dalam periode validitas sesi dan belum melebihi batas refresh, server akan otomatis mengeluarkan Token baru untuk mempertahankan sesi pengguna, jika tidak, pengguna diwajibkan untuk masuk lagi. (Setiap Token hanya dapat di-refresh sekali)",
|
|
71
|
+
"Invalid sign-in origin": "Asal masuk tidak valid",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Kebijakan token",
|
|
73
74
|
"Token validity period": "Periode validitas token",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/it-IT.json
CHANGED
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"The username or email is incorrect, please re-enter": "Il nome utente o l'email è errato, per favore reinserisci",
|
|
74
74
|
"The username/email or password is incorrect, please re-enter": "Il nome utente/email o la password è errato, per favore reinserisci",
|
|
75
75
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "Il periodo di validità di ciascun token API emesso. Dopo la scadenza del token, se rientra nel periodo di validità della sessione e il limite di tempo di aggiornamento non è stato superato, il server emetterà automaticamente un nuovo token per mantenere la sessione utente, altrimenti all'utente verrà richiesto di accedere nuovamente. (Ogni token può essere aggiornato una sola volta)",
|
|
76
|
+
"Invalid sign-in origin": "Origine di accesso non valida",
|
|
76
77
|
"Token expired": "Token scaduto",
|
|
77
78
|
"Token policy": "Politica token",
|
|
78
79
|
"Token validity period": "Periodo di validità del token",
|
|
@@ -87,4 +88,4 @@
|
|
|
87
88
|
"defaultResetPasswordEmailContentHTML": "<p>Ciao {{$user.username}},</p>\n\n<p>Abbiamo ricevuto una richiesta di reimpostazione della password per il tuo account {{$systemSettings.title}}.</p>\n\n<p>Fai clic sul link sottostante per impostare la tua nuova password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reimposta la tua password</a>\n</p>\n\n<p>\n Se non hai richiesto la reimpostazione della password, ignora questa email. La tua password rimarrà invariata.\n</p>\n\n<p>\n Nota: per la tua sicurezza, questo link per la reimpostazione della password scadrà tra <strong>{{$resetLinkExpiration}} minuti</strong>.\n</p>\n\n<p>Se riscontri problemi durante la reimpostazione della password, contatta il nostro team di supporto.</p>\n\n<p>\n Grazie,<br>\n Il team di {{$systemSettings.title}}\n</p>",
|
|
88
89
|
"defaultResetPasswordEmailContentText": "Ciao {{$user.username}},\n\nAbbiamo ricevuto una richiesta di reimpostazione della password per il tuo account {{$systemSettings.title}}.\n\nFai clic sul link sottostante per impostare la tua nuova password:\n\n{{$resetLink}}\n\nSe non hai richiesto la reimpostazione della password, ignora questa email. La tua password rimarrà invariata.\n\nNota: per la tua sicurezza, questo link per la reimpostazione della password scadrà tra {{$resetLinkExpiration}} minuti.\n\nSe riscontri problemi durante la reimpostazione della password, contatta il nostro team di supporto.\n\nGrazie, Il team di {{$systemSettings.title}}",
|
|
89
90
|
"defaultResetPasswordEmailSubject": "Reimposta la tua password per {{$systemSettings.title}}"
|
|
90
|
-
}
|
|
91
|
+
}
|
package/dist/locale/ja-JP.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "ユーザー名またはメールアドレスが間違っています。再入力してください。",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "ユーザー名/メールアドレスまたはパスワードが正しくありません。再度入力してください。",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "発行された各APIトークンの有効期間。トークン失効後、セッション有効期間内かつ更新期限を超過していない場合、サーバーはユーザーセッション維持のため新規トークンを自動発行します。それ以外の場合は再ログインが必要です。(各トークンの更新は1回のみ可能)",
|
|
71
|
+
"Invalid sign-in origin": "サインイン元が無効です",
|
|
71
72
|
"Token expired": "トークンの有効期限が切れました",
|
|
72
73
|
"Token policy": "トークンポリシー",
|
|
73
74
|
"Token validity period": "トークン有効期間",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>{{$user.username}} 様,</p>\n\n<p>{{$systemSettings.title}} アカウントのパスワードリセットリクエストを受け付けました。</p>\n\n<p>以下のリンクをクリックして新しいパスワードを設定してください:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">パスワードをリセット</a>\n</p>\n\n<p>\n パスワードリセットをリクエストしていない場合は、このメールを無視してください。パスワードは変更されません。\n</p>\n\n<p>\n 注意: セキュリティのため、このパスワードリセットリンクは <strong>{{$resetLinkExpiration}} 分</strong> で有効期限が切れます。\n</p>\n\n<p>パスワードのリセットで問題が発生した場合は、サポートチームにお問い合わせください。</p>\n\n<p>\n よろしくお願いいたします,<br>\n {{$systemSettings.title}} チーム\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "{{$user.username}} 様,\n\n{{$systemSettings.title}} アカウントのパスワードリセットリクエストを受け付けました。\n\n以下のリンクをクリックして新しいパスワードを設定してください:\n\n{{$resetLink}}\n\nパスワードリセットをリクエストしていない場合は、このメールを無視してください。パスワードは変更されません。\n\n注意: セキュリティのため、このパスワードリセットリンクは {{$resetLinkExpiration}} 分 で有効期限が切れます。\n\nパスワードのリセットで問題が発生した場合は、サポートチームにお問い合わせください。\n\nよろしくお願いいたします, {{$systemSettings.title}} チーム",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "{{$systemSettings.title}} のパスワードをリセット"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/ko-KR.json
CHANGED
|
@@ -69,6 +69,7 @@
|
|
|
69
69
|
"The username or email is incorrect, please re-enter": "사용자 이름 또는 이메일이 올바르지 않습니다. 다시 입력해 주세요.",
|
|
70
70
|
"The username/email or password is incorrect, please re-enter": "사용자 이름/이메일 또는 비밀번호가 올바르지 않습니다. 다시 입력해 주세요.",
|
|
71
71
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "각 발급된 API 토큰의 유효 기간입니다. 토큰이 만료된 후 세션 유효 기간 내이고 갱신 한도에 도달하지 않았다면, 서버는 사용자 세션 유지를 위해 자동으로 새 토큰을 발급합니다. 그렇지 않은 경우 사용자는 다시 로그인해야 합니다. (각 토큰은 한 번만 갱신할 수 있습니다)",
|
|
72
|
+
"Invalid sign-in origin": "로그인 출처가 올바르지 않습니다",
|
|
72
73
|
"Token expired": "토큰이 만료되었습니다",
|
|
73
74
|
"Token policy": "토큰 정책",
|
|
74
75
|
"Token validity period": "토큰 유효 기간",
|
|
@@ -82,4 +83,4 @@
|
|
|
82
83
|
"defaultResetPasswordEmailContentHTML": "<p>안녕하세요 {{$user.username}}님,</p>\n\n<p>{{$systemSettings.title}} 계정의 비밀번호 재설정 요청을 받았습니다.</p>\n\n<p>아래 링크를 클릭하여 새 비밀번호를 설정하세요:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">비밀번호 재설정</a>\n</p>\n\n<p>\n 비밀번호 재설정을 요청하지 않으셨다면 이 이메일을 무시하세요. 비밀번호는 변경되지 않습니다.\n</p>\n\n<p>\n 참고: 보안을 위해 이 비밀번호 재설정 링크는 <strong>{{$resetLinkExpiration}}분</strong> 후에 만료됩니다.\n</p>\n\n<p>비밀번호 재설정에 문제가 발생하면 지원팀에 문의하세요.</p>\n\n<p>\n 감사합니다,<br>\n {{$systemSettings.title}} 팀\n</p>",
|
|
83
84
|
"defaultResetPasswordEmailContentText": "안녕하세요 {{$user.username}}님,\n\n{{$systemSettings.title}} 계정의 비밀번호 재설정 요청을 받았습니다.\n\n아래 링크를 클릭하여 새 비밀번호를 설정하세요:\n\n{{$resetLink}}\n\n비밀번호 재설정을 요청하지 않으셨다면 이 이메일을 무시하세요. 비밀번호는 변경되지 않습니다.\n\n참고: 보안을 위해 이 비밀번호 재설정 링크는 {{$resetLinkExpiration}}분 후에 만료됩니다.\n\n비밀번호 재설정에 문제가 발생하면 지원팀에 문의하세요.\n\n감사합니다, {{$systemSettings.title}} 팀",
|
|
84
85
|
"defaultResetPasswordEmailSubject": "{{$systemSettings.title}}의 비밀번호를 재설정하세요"
|
|
85
|
-
}
|
|
86
|
+
}
|
package/dist/locale/nl-NL.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "De gebruikersnaam of e-mail is incorrect, probeer het opnieuw",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "De gebruikersnaam/e-mail of het wachtwoord is incorrect, probeer het opnieuw",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Ongeldige aanmeldingsbron",
|
|
71
72
|
"Token expired": "Token verlopen",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hallo {{$user.username}},</p>\n\n<p>We hebben een verzoek ontvangen om het wachtwoord voor uw {{$systemSettings.title}}-account opnieuw in te stellen.</p>\n\n<p>Klik op de onderstaande link om uw nieuwe wachtwoord in te stellen:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Stel uw wachtwoord opnieuw in</a>\n</p>\n\n<p>\n Als u geen wachtwoordreset heeft aangevraagd, negeer dan deze e-mail. Uw wachtwoord blijft ongewijzigd.\n</p>\n\n<p>\n Let op: Voor uw veiligheid verloopt deze wachtwoordresetlink over <strong>{{$resetLinkExpiration}} minuten</strong>.\n</p>\n\n<p>Als u problemen ondervindt bij het opnieuw instellen van uw wachtwoord, neem dan contact op met ons ondersteuningsteam.</p>\n\n<p>\n Bedankt,<br>\n Het {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hallo {{$user.username}},\n\nWe hebben een verzoek ontvangen om het wachtwoord voor uw {{$systemSettings.title}}-account opnieuw in te stellen.\n\nKlik op de onderstaande link om uw nieuwe wachtwoord in te stellen:\n\n{{$resetLink}}\n\nAls u geen wachtwoordreset heeft aangevraagd, negeer dan deze e-mail. Uw wachtwoord blijft ongewijzigd.\n\nLet op: Voor uw veiligheid verloopt deze wachtwoordresetlink over {{$resetLinkExpiration}} minuten.\n\nAls u problemen ondervindt bij het opnieuw instellen van uw wachtwoord, neem dan contact op met ons ondersteuningsteam.\n\nBedankt, Het {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Stel uw wachtwoord opnieuw in voor {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/pt-BR.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Origem de login inválida",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/ru-RU.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "Имя пользователя или email неверны, пожалуйста, введите снова",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "Имя пользователя/email или пароль неверны, пожалуйста, введите снова",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "Срок действия каждого выданного API-токена. После истечения срока токена, если он находится в пределах срока действия сессии и не превысил лимит обновления, сервер автоматически выдаст новый токен для поддержания сессии, иначе пользователю потребуется войти снова. (Каждый токен может быть обновлен только один раз)",
|
|
71
|
+
"Invalid sign-in origin": "Недопустимый источник входа",
|
|
71
72
|
"Token expired": "Токен истек",
|
|
72
73
|
"Token policy": "Политика токенов",
|
|
73
74
|
"Token validity period": "Срок действия токена",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Привет {{$user.username}}</p>\n\n<p>Мы получили запрос на сброс пароля для вашей учетной записи {{$systemSettings.title}}.</p>\n\n<p>Пожалуйста, нажмите на ссылку ниже, чтобы установить новый пароль:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Сбросить пароль</a>\n</p>\n\n<p>\n Если вы не запрашивали сброс пароля, пожалуйста, проигнорируйте это письмо. Ваш пароль останется неизменным.\n</p>\n\n<p>\n Обратите внимание: для вашей безопасности эта ссылка для сброса пароля истечет через <strong>{{$resetLinkExpiration}} минут</strong>.\n</p>\n\n<p>Если у вас возникли проблемы со сбросом пароля, пожалуйста, обратитесь в нашу службу поддержки.</p>\n\n<p>\n Спасибо,<br>\n Команда {{$systemSettings.title}}\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Привет {{$user.username}}\n\nМы получили запрос на сброс пароля для вашей учетной записи {{$systemSettings.title}}.\n\nПожалуйста, нажмите на ссылку ниже, чтобы установить новый пароль:\n\n{{$resetLink}}\n\nЕсли вы не запрашивали сброс пароля, пожалуйста, проигнорируйте это письмо. Ваш пароль останется неизменным.\n\nОбратите внимание: для вашей безопасности эта ссылка для сброса пароля истечет через {{$resetLinkExpiration}} минут.\n\nЕсли у вас возникли проблемы со сбросом пароля, пожалуйста, обратитесь в нашу службу поддержки.\n\nСпасибо, Команда {{$systemSettings.title}}",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Сброс пароля для {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/tr-TR.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Geçersiz oturum açma kaynağı",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/uk-UA.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Недійсне джерело входу",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/vi-VN.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "Nguồn đăng nhập không hợp lệ",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"Days": "天",
|
|
14
14
|
"Email channel not found": "未找到邮件通道",
|
|
15
15
|
"Enable forget password": "启用忘记密码功能",
|
|
16
|
+
"Failed to load authenticator": "加载认证器失败",
|
|
16
17
|
"Expired token refresh limit": "过期 Token 刷新时限",
|
|
17
18
|
"Forgot password": "忘记密码",
|
|
18
19
|
"Go to login": "前往登录",
|
|
@@ -68,6 +69,8 @@
|
|
|
68
69
|
"The username or email is incorrect, please re-enter": "用户名或邮箱有误,请重新输入",
|
|
69
70
|
"The username/email or password is incorrect, please re-enter": "用户名/邮箱或密码有误,请重新输入",
|
|
70
71
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "每次签发的 API Token 的有效期。Token 过期后,如果处于会话有效期内,并且没有超过刷新时限,服务端将自动签发新 Token 以保持用户会话,否则要求用户重新登录。(每个 Token 只能被刷新一次)",
|
|
72
|
+
"Invalid CSRF token": "CSRF token 无效",
|
|
73
|
+
"Invalid sign-in origin": "登录来源无效",
|
|
71
74
|
"Token expired": "令牌已过期",
|
|
72
75
|
"Token policy": "Token 策略",
|
|
73
76
|
"Token validity period": "Token 有效期",
|
|
@@ -81,4 +84,4 @@
|
|
|
81
84
|
"defaultResetPasswordEmailContentHTML": "<p>您好 {{$user.username}},</p>\n\n<p>我们收到了重置您 {{$systemSettings.title}} 账户密码的请求。</p>\n\n<p>请点击下面的链接设置您的新密码:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">重置您的密码</a>\n</p>\n\n<p>\n 如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\n</p>\n\n<p>\n 请注意:为了您的安全,此密码重置链接将在 <strong>{{$resetLinkExpiration}} 分钟</strong>后过期。\n</p>\n\n<p>如果您在重置密码时遇到任何问题,请联系我们的支持团队。</p>\n\n<p>\n 谢谢,<br>\n {{$systemSettings.title}} 团队\n</p>",
|
|
82
85
|
"defaultResetPasswordEmailContentText": "您好 {{$user.username}},\n\n我们收到了重置您 {{$systemSettings.title}} 账户密码的请求。\n\n请点击下面的链接设置您的新密码:\n\n{{$resetLink}}\n\n如果您没有请求重置密码,请忽略此邮件。您的密码将保持不变。\n\n请注意:为了您的安全,此密码重置链接将在 {{$resetLinkExpiration}} 分钟后过期。\n\n如果您在重置密码时遇到任何问题,请联系我们的支持团队。\n\n谢谢,{{$systemSettings.title}} 团队",
|
|
83
86
|
"defaultResetPasswordEmailSubject": "重置您的 {{$systemSettings.title}} 密码"
|
|
84
|
-
}
|
|
87
|
+
}
|
package/dist/locale/zh-TW.json
CHANGED
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"The username or email is incorrect, please re-enter": "The username or email is incorrect, please re-enter",
|
|
69
69
|
"The username/email or password is incorrect, please re-enter": "The username/email or password is incorrect, please re-enter",
|
|
70
70
|
"The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)": "The validity period of each issued API Token. After the Token expires, if it is within the session validity period and has not exceeded the refresh limit, the server will automatically issue a new Token to maintain the user session, otherwise the user is required to log in again. (Each Token can only be refreshed once)",
|
|
71
|
+
"Invalid sign-in origin": "登入來源無效",
|
|
71
72
|
"Token expired": "Token expired",
|
|
72
73
|
"Token policy": "Token policy",
|
|
73
74
|
"Token validity period": "Token validity period",
|
|
@@ -81,4 +82,4 @@
|
|
|
81
82
|
"defaultResetPasswordEmailContentHTML": "<p>Hello {{$user.username}},</p>\n\n<p>We received a request to reset the password for your {{$systemSettings.title}} account.</p>\n\n<p>Please click the link below to set your new password:</p>\n\n<p>\n <a href=\"{{$resetLink}}\">Reset Your Password</a>\n</p>\n\n<p>\n If you did not request a password reset, please ignore this email. Your password will remain unchanged.\n</p>\n\n<p>\n Please note: For your security, this password reset link will expire in <strong>{{$resetLinkExpiration}} minutes</strong>.\n</p>\n\n<p>If you encounter any issues resetting your password, please contact our support team.</p>\n\n<p>\n Thanks,<br>\n The {{$systemSettings.title}} Team\n</p>",
|
|
82
83
|
"defaultResetPasswordEmailContentText": "Hello {{$user.username}},\n\nWe received a request to reset the password for your {{$systemSettings.title}} account.\n\nPlease click the link below to set your new password:\n\n{{$resetLink}}\n\nIf you did not request a password reset, please ignore this email. Your password will remain unchanged.\n\nPlease note: For your security, this password reset link will expire in {{$resetLinkExpiration}} minutes.\n\nIf you encounter any issues resetting your password, please contact our support team.\n\nThanks, The {{$systemSettings.title}} Team",
|
|
83
84
|
"defaultResetPasswordEmailSubject": "Reset your password for {{$systemSettings.title}}"
|
|
84
|
-
}
|
|
85
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-07-
|
|
1
|
+
{"name":"cron","description":"Cron jobs for your node","version":"2.4.4","author":"Nick Campbell <nicholas.j.campbell@gmail.com> (https://github.com/ncb000gt)","bugs":{"url":"https://github.com/kelektiv/node-cron/issues"},"repository":{"type":"git","url":"https://github.com/kelektiv/node-cron.git"},"main":"lib/cron","scripts":{"lint":"eslint {lib,tests}/*.js","test":"jest --coverage","test:watch":"jest --watch --coverage","test:types":"tsd","prepare":"husky install","release":"semantic-release"},"types":"types/index.d.ts","dependencies":{"@types/luxon":"~3.3.0","luxon":"~3.3.0"},"devDependencies":{"@commitlint/cli":"~17.6.6","@insurgentlab/commitlint-config":"^18.1.0","@insurgentlab/conventional-changelog-preset":"~6.0.3","@semantic-release/changelog":"~6.0.x","@semantic-release/commit-analyzer":"~9.0.x","@semantic-release/git":"~10.0.x","@semantic-release/github":"~8.1.x","@semantic-release/npm":"~10.0.x","@semantic-release/release-notes-generator":"~11.0.x","chai":"~4.2.x","eslint":"~8.36.x","eslint-config-prettier":"^8.7.x","eslint-config-standard":"~17.0.x","eslint-plugin-import":"~2.27.x","eslint-plugin-jest":"~27.2.x","eslint-plugin-n":"~15.6.x","eslint-plugin-prettier":"~4.2.x","eslint-plugin-promise":"~6.1.x","husky":"^8.0.3","jest":"~29.5.x","prettier":"~2.8.x","semantic-release":"~21.0.x","sinon":"^15.0.x","tsd":"^0.28.1"},"keywords":["cron","node cron","node-cron","schedule","scheduler","cronjob","cron job"],"license":"MIT","contributors":["Brandon der Blätter <https://interlucid.com/contact/> (https://github.com/intcreator)","Romain Beauxis <toots@rastageeks.org> (https://github.com/toots)","James Padolsey <> (https://github.com/jamespadolsey)","Finn Herpich <fh@three-heads.de> (https://github.com/ErrorProne)","Clifton Cunningham <clifton.cunningham@gmail.com> (https://github.com/cliftonc)","Eric Abouaf <eric.abouaf@gmail.com> (https://github.com/neyric)","humanchimp <morphcham@gmail.com> (https://github.com/humanchimp)","Craig Condon <craig@spiceapps.com> (https://github.com/spiceapps)","Dan Bear <daniel@hulu.com> (https://github.com/danhbear)","Vadim Baryshev <vadimbaryshev@gmail.com> (https://github.com/baryshev)","Leandro Ferrari <lfthomaz@gmail.com> (https://github.com/lfthomaz)","Gregg Zigler <greggzigler@gmail.com> (https://github.com/greggzigler)","Jordan Abderrachid <jabderrachid@gmail.com> (https://github.com/jordanabderrachid)","Masakazu Matsushita <matsukaz@gmail.com> (matsukaz)","Christopher Lunt <me@kirisu.co.uk> (https://github.com/kirisu)"],"jest":{"collectCoverage":true,"collectCoverageFrom":["lib/*.js"],"coverageThreshold":{"global":{"statements":80,"branches":80,"functions":70,"lines":80}}},"files":["lib","types","CHANGELOG.md","LICENSE","README.md"],"_lastModified":"2026-07-16T12:56:43.859Z"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2026-07-
|
|
1
|
+
{"name":"ms","version":"2.1.3","description":"Tiny millisecond conversion utility","repository":"vercel/ms","main":"./index","files":["index.js"],"scripts":{"precommit":"lint-staged","lint":"eslint lib/* bin/*","test":"mocha tests.js"},"eslintConfig":{"extends":"eslint:recommended","env":{"node":true,"es6":true}},"lint-staged":{"*.js":["npm run lint","prettier --single-quote --write","git add"]},"license":"MIT","devDependencies":{"eslint":"4.18.2","expect.js":"0.3.1","husky":"0.14.3","lint-staged":"5.0.0","mocha":"4.0.1","prettier":"2.0.5"},"_lastModified":"2026-07-16T12:56:43.948Z"}
|
|
@@ -4,5 +4,6 @@
|
|
|
4
4
|
"The password is incorrect, please re-enter": "The password is incorrect, please re-enter",
|
|
5
5
|
"Not a valid cellphone number, please re-enter": "Not a valid cellphone number, please re-enter",
|
|
6
6
|
"The phone number has been registered, please login directly": "The phone number has been registered, please login directly",
|
|
7
|
-
"The phone number is not registered, please register first": "The phone number is not registered, please register first"
|
|
7
|
+
"The phone number is not registered, please register first": "The phone number is not registered, please register first",
|
|
8
|
+
"Invalid CSRF token": "Invalid CSRF token"
|
|
8
9
|
}
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
"The phone number is not registered, please register first": "手机号未注册,请先注册",
|
|
7
7
|
"Please keep and enable at least one authenticator": "请至少保留并启用一个认证器",
|
|
8
8
|
"Please enter your username or email": "请输入用户名或邮箱",
|
|
9
|
-
"Please enter a valid username": "请输入有效的用户名"
|
|
10
|
-
|
|
9
|
+
"Please enter a valid username": "请输入有效的用户名",
|
|
10
|
+
"Invalid CSRF token": "CSRF token 无效"
|
|
11
|
+
}
|
package/dist/server/plugin.js
CHANGED
|
@@ -136,7 +136,9 @@ class PluginAuthServer extends import_server.Plugin {
|
|
|
136
136
|
([action, handler]) => this.app.resourceManager.registerActionHandler(`authenticators:${action}`, handler)
|
|
137
137
|
);
|
|
138
138
|
["signIn", "signUp"].forEach((action) => this.app.acl.allow("auth", action));
|
|
139
|
-
["check", "signOut", "changePassword"].forEach(
|
|
139
|
+
["check", "signOut", "syncCookies", "changePassword"].forEach(
|
|
140
|
+
(action) => this.app.acl.allow("auth", action, "loggedIn")
|
|
141
|
+
);
|
|
140
142
|
["lostPassword", "resetPassword", "checkResetToken"].forEach(
|
|
141
143
|
(action) => this.app.acl.allow("auth", action, "public")
|
|
142
144
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/plugin-auth",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.3.0-alpha.1",
|
|
4
4
|
"main": "./dist/server/index.js",
|
|
5
5
|
"homepage": "https://docs.nocobase.com/handbook/auth",
|
|
6
6
|
"homepage.ru-RU": "https://docs-ru.nocobase.com/handbook/auth",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"description": "User authentication management, including password, SMS, and support for Single Sign-On (SSO) protocols, with extensibility.",
|
|
32
32
|
"description.ru-RU": "Управление аутентификацией пользователей: пароли, SMS, поддержка протоколов единого входа (SSO) и возможность расширения.",
|
|
33
33
|
"description.zh-CN": "用户认证管理,包括基础的密码认证、短信认证、SSO 协议的认证等,可扩展。",
|
|
34
|
-
"gitHead": "
|
|
34
|
+
"gitHead": "2377df8ceb12549149017f7f14a61207bf6e49a2",
|
|
35
35
|
"keywords": [
|
|
36
36
|
"Authentication",
|
|
37
37
|
"Security"
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* This file is part of the NocoBase (R) project.
|
|
3
|
-
* Copyright (c) 2020-2024 NocoBase Co., Ltd.
|
|
4
|
-
* Authors: NocoBase Team.
|
|
5
|
-
*
|
|
6
|
-
* This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
|
|
7
|
-
* For more information, please refer to: https://www.nocobase.com/agreement.
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
|
-
"use strict";(self.webpackChunk_nocobase_plugin_auth_client_v2=self.webpackChunk_nocobase_plugin_auth_client_v2||[]).push([["9"],{648:function(e,t,n){n.r(t),n.d(t,{default:function(){return O}});var r=n(375),a=n(485),u=n(694),o=n(6),l=n(59),i=n(773),c=n(155),s=n.n(c),d=n(488),f=n(434);function p(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 m(e,t,n,r,a,u,o){try{var l=e[u](o),i=l.value}catch(e){n(e);return}l.done?t(i):Promise.resolve(i).then(r,a)}function y(e){return function(){var t=this,n=arguments;return new Promise(function(r,a){var u=e.apply(t,n);function o(e){m(u,r,a,o,l,"next",e)}function l(e){m(u,r,a,o,l,"throw",e)}o(void 0)})}}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){var r;r=n[t],t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r})}return e}function h(e,t){return t=null!=t?t:{},Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):(function(e){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t.push.apply(t,n)}return t})(Object(t)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(t,n))}),e}function v(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n,r,a=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var u=[],o=!0,l=!1;try{for(a=a.call(e);!(o=(n=a.next()).done)&&(u.push(n.value),!t||u.length!==t);o=!0);}catch(e){l=!0,r=e}finally{try{o||null==a.return||a.return()}finally{if(l)throw r}}return u}}(e,t)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if("Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return p(e,t)}}(e,t)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function g(e,t){var n,r,a,u={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype),l=Object.defineProperty;return l(o,"next",{value:i(0)}),l(o,"throw",{value:i(1)}),l(o,"return",{value:i(2)}),"function"==typeof Symbol&&l(o,Symbol.iterator,{value:function(){return this}}),o;function i(l){return function(i){var c=[l,i];if(n)throw TypeError("Generator is already executing.");for(;o&&(o=0,c[0]&&(u=0)),u;)try{if(n=1,r&&(a=2&c[0]?r.return:c[0]?r.throw||((a=r.return)&&a.call(r),0):r.next)&&!(a=a.call(r,c[1])).done)return a;switch(r=0,a&&(c=[2&c[0],a.value]),c[0]){case 0:case 1:a=c;break;case 4:return u.label++,{value:c[1],done:!1};case 5:u.label++,r=c[1],c=[0];continue;case 7:c=u.ops.pop(),u.trys.pop();continue;default:if(!(a=(a=u.trys).length>0&&a[a.length-1])&&(6===c[0]||2===c[0])){u=0;continue}if(3===c[0]&&(!a||c[1]>a[0]&&c[1]<a[3])){u.label=c[1];break}if(6===c[0]&&u.label<a[1]){u.label=a[1],a=c;break}if(a&&u.label<a[2]){u.label=a[2],u.ops.push(c);break}a[2]&&u.ops.pop(),u.trys.pop();continue}c=t.call(e,u)}catch(e){c=[6,e],r=0}finally{n=a=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}}function E(){return(0,u.useFlowContext)().api.resource("authenticators")}function w(e){var t=(0,d.dE)().t,n=(0,d.kj)(),r=(0,c.useMemo)(function(){return e.authTypeOptions.map(function(e){return{value:e.name,label:n(e.title||e.name)}})},[e.authTypeOptions,n]),f=E(),p=v(l.Form.useForm(),1)[0],m=v((0,c.useState)(!1),2),w=m[0],O=m[1],S=(0,c.useMemo)(function(){return"edit"===e.mode?(0,i.cloneDeep)(e.record||{}):{name:(0,u.randomId)("s_"),authType:e.authType,enabled:!1,options:{}}},[e.authType,e.mode,e.record]);(0,c.useEffect)(function(){p.setFieldsValue(S)},[p,S]);var T=l.Form.useWatch("authType",p),A=null!=T?T:e.authType,k=(0,c.useMemo)(function(){var t;return null==(t=e.plugin.authTypes.get(A))?void 0:t.adminSettingsFormLoader},[e.plugin,A]),j=(0,c.useMemo)(function(){return k?(0,c.lazy)(k):null},[k]),I=(0,o.useMemoizedFn)(function(){p.setFieldValue("options",{})}),F=(0,o.useMemoizedFn)(function(){return y(function(){var t,n,r,a;return g(this,function(u){switch(u.label){case 0:return[4,p.validateFields()];case 1:n=function e(t){return"string"==typeof t?t.trim():Array.isArray(t)?t.map(e):t&&(void 0===t?"undefined":t&&"u">typeof Symbol&&t.constructor===Symbol?"symbol":typeof t)=="object"?Object.fromEntries(Object.entries(t).map(function(t){var n=v(t,2);return[n[0],e(n[1])]})):t}((t=u.sent()).options||{}),O(!0),u.label=2;case 2:if(u.trys.push([2,,7,8]),"create"!==e.mode)return[3,4];return[4,f.create({values:h(b({},t),{options:n})})];case 3:return u.sent(),[3,6];case 4:if((null==(r=e.record)?void 0:r.id)==null)return[3,6];return a=h(b({},(0,i.cloneDeep)(e.record),t),{options:b({},e.record.options||{},n)}),[4,f.update({filterByTk:e.record.id,values:a})];case 5:u.sent(),u.label=6;case 6:return e.onSubmitted(),[3,8];case 7:return O(!1),[7];case 8:return[2]}})})()});return s().createElement(a.DrawerFormLayout,{title:t("create"===e.mode?"Add new":"Configure"),onSubmit:F,submitting:w,submitText:t("Submit"),cancelText:t("Cancel")},s().createElement(l.Form,{form:p,layout:"vertical",initialValues:S},s().createElement(l.Form.Item,{name:"name",label:t("Auth UID"),rules:[{required:!0,message:t("Please enter an Auth UID")},{pattern:/^[a-zA-Z0-9_-]+$/,message:t("a-z, A-Z, 0-9, _, -")}]},s().createElement(l.Input,{disabled:"edit"===e.mode})),s().createElement(l.Form.Item,{name:"authType",label:t("Auth Type"),rules:[{required:!0}]},s().createElement(l.Select,{options:r,onChange:I})),s().createElement(l.Form.Item,{name:"title",label:t("Title")},s().createElement(l.Input,null)),s().createElement(l.Form.Item,{name:"description",label:t("Description")},s().createElement(l.Input,null)),s().createElement(l.Form.Item,{name:"enabled",label:t("Enabled"),valuePropName:"checked"},s().createElement(l.Checkbox,null)),j?s().createElement(c.Suspense,{fallback:s().createElement(l.Spin,null)},s().createElement(j,null)):null))}function O(){var e,t=(0,d.dE)().t,n=(0,d.kj)(),i=(0,u.useFlowContext)(),p=l.theme.useToken().token,m=l.App.useApp(),b=m.modal,h=m.message,O=E(),S=i.app.pm.get(f.A),T=v((0,c.useState)(1),2),A=T[0],k=T[1],j=v((0,c.useState)(a.DEFAULT_PAGE_SIZE),2),I=j[0],F=j[1],D=v((0,c.useState)([]),2),C=D[0],P=D[1],x=(e=E(),(0,o.useRequest)(function(){return y(function(){var t,n,r,a;return g(this,function(u){switch(u.label){case 0:return[4,e.listTypes()];case 1:return[2,Array.isArray(a=null!=(t=null==(r=u.sent())||null==(n=r.data)?void 0:n.data)?t:null==r?void 0:r.data)?a:[]]}})})()},{cacheKey:"@nocobase/plugin-auth:authenticators:listTypes"})).data,M=(0,o.useRequest)(function(){return y(function(){return g(this,function(e){switch(e.label){case 0:return[4,O.list({page:A,pageSize:I,sort:["sort"],appends:[]})];case 1:var t,n,r,a,u;return[2,{records:a=Array.isArray(r=null==(n=null==(t=e.sent())?void 0:t.data)?void 0:n.data)?r:Array.isArray(null==r?void 0:r.data)?r.data:[],total:(u=(null==n?void 0:n.meta)||(null==r?void 0:r.meta)||{}).count||u.total||a.length}]}})})()},{refreshDeps:[A,I]}),_=M.data,z=M.loading,B=M.refresh,U=(0,o.useMemoizedFn)(function(e,t){if(t!==I){F(t),k(1);return}k(e)}),q=(0,c.useMemo)(function(){return x||[]},[x]),K=(0,o.useMemoizedFn)(function(e,t,n){i.viewer.drawer({width:"50%",closable:!0,content:function(){return s().createElement(w,{mode:e,authType:t,authTypeOptions:q,plugin:S,record:n,onSubmitted:function(){return B()}})}})}),L=(0,o.useMemoizedFn)(function(e){b.confirm({title:t("Delete"),content:t("Are you sure you want to delete it?"),onOk:function(){return y(function(){return g(this,function(t){switch(t.label){case 0:return[4,O.destroy({filterByTk:e})];case 1:return t.sent(),P([]),B(),[2]}})})()}})}),R=(0,o.useMemoizedFn)(function(e,n){return y(function(){var r;return g(this,function(a){switch(a.label){case 0:if(null==e.id||null==n.id)return[2];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,O.move({sourceId:e.id,targetId:n.id})];case 2:return a.sent(),h.success(t("Saved successfully"),.2),B(),[3,4];case 3:return r=a.sent(),h.error((null==r?void 0:r.message)||"Move failed"),[3,4];case 4:return[2]}})})()}),V=(0,o.useMemoizedFn)(function(e){var t=q.find(function(t){return t.name===e});return n((null==t?void 0:t.title)||e||"")}),Z=(0,c.useMemo)(function(){return[{title:t("Auth UID"),dataIndex:"name"},{title:t("Auth Type"),dataIndex:"authType",render:function(e){return e?s().createElement(l.Tag,null,V(e)):null}},{title:t("Title"),dataIndex:"title"},{title:t("Description"),dataIndex:"description"},{title:t("Enabled"),dataIndex:"enabled",align:"center",width:80,render:function(e){return e?s().createElement(r.CheckOutlined,{style:{color:p.colorSuccess}}):null}},{title:t("Actions"),width:160,render:function(e,n){return s().createElement(l.Space,null,s().createElement("a",{onClick:function(){if(n.authType){if(!S.authTypes.get(n.authType))return void h.error(t("Auth type {{type}} is not registered.").replace("{{type}}",n.authType));K("edit",n.authType,n)}}},t("Configure")),s().createElement("a",{onClick:function(){return L(n.id)}},t("Delete")))}}]},[V,L,h,K,S,t]);return s().createElement(l.Card,{variant:"borderless"},s().createElement("div",{style:{display:"flex",justifyContent:"flex-end",gap:p.marginSM,marginBottom:p.margin}},s().createElement(l.Button,{icon:s().createElement(r.DeleteOutlined,null),disabled:!C.length,onClick:function(){return L(C)}},t("Delete")),s().createElement(l.Dropdown,{menu:{items:q.map(function(e){return{key:e.name,label:n(e.title||e.name)}}),onClick:function(e){K("create",e.key)}},disabled:!q.length},s().createElement(l.Button,{type:"primary",icon:s().createElement(r.PlusOutlined,null)},t("Add new")," ",s().createElement(r.DownOutlined,null)))),s().createElement(a.Table,{rowKey:"id",loading:z,columns:Z,dataSource:(null==_?void 0:_.records)||[],isDraggable:!0,onSortEnd:R,rowSelection:{selectedRowKeys:C,onChange:P},pagination:{current:A,pageSize:I,total:(null==_?void 0:_.total)||0,onChange:U}}))}}}]);
|