@kordar/easyui-tpl 1.0.5 → 1.0.6

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/index.js CHANGED
@@ -1 +1 @@
1
- var e=["reducerPath"];function t(e,t,n){return t=l(t),function(e,t){if(t&&("object"==d(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}(e,i()?Reflect.construct(t,n||[],l(e).constructor):t.apply(e,n))}function n(){return n="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=function(e,t){for(;!{}.hasOwnProperty.call(e,t)&&null!==(e=l(e)););return e}(e,t);if(r){var o=Object.getOwnPropertyDescriptor(r,t);return o.get?o.get.call(arguments.length<3?e:n):o.value}},n.apply(null,arguments)}function r(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&c(e,t)}function o(e){var t="function"==typeof Map?new Map:void 0;return o=function(e){if(null===e||!function(e){try{return-1!==Function.toString.call(e).indexOf("[native code]")}catch(t){return"function"==typeof e}}(e))return e;if("function"!=typeof e)throw new 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 a(e,arguments,l(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),c(n,e)},o(e)}function a(e,t,n){if(i())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,t);var o=new(e.bind.apply(e,r));return n&&c(o,n.prototype),o}function i(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(i=function(){return!!e})()}function c(e,t){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},c(e,t)}function l(e){return l=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},l(e)}function u(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,o,a,i,c=[],l=!0,u=!1;try{if(a=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=a.call(n)).done)&&(c.push(r.value),c.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=n.return&&(i=n.return(),Object(i)!==i))return}finally{if(u)throw o}}return c}}(e,t)||C(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function s(e){return function(e){if(Array.isArray(e))return k(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||C(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return d="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d(e)}function f(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */f=function(){return t};var e,t={},n=Object.prototype,r=n.hasOwnProperty,o=Object.defineProperty||function(e,t,n){e[t]=n.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",c=a.asyncIterator||"@@asyncIterator",l=a.toStringTag||"@@toStringTag";function u(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{u({},"")}catch(e){u=function(e,t,n){return e[t]=n}}function s(e,t,n,r){var a=t&&t.prototype instanceof b?t:b,i=Object.create(a.prototype),c=new P(r||[]);return o(i,"_invoke",{value:O(e,n,c)}),i}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=s;var m="suspendedStart",h="suspendedYield",v="executing",g="completed",y={};function b(){}function E(){}function x(){}var w={};u(w,i,(function(){return this}));var C=Object.getPrototypeOf,k=C&&C(C(T([])));k&&k!==n&&r.call(k,i)&&(w=k);var _=x.prototype=b.prototype=Object.create(w);function N(e){["next","throw","return"].forEach((function(t){u(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){function n(o,a,i,c){var l=p(e[o],e,a);if("throw"!==l.type){var u=l.arg,s=u.value;return s&&"object"==d(s)&&r.call(s,"__await")?t.resolve(s.__await).then((function(e){n("next",e,i,c)}),(function(e){n("throw",e,i,c)})):t.resolve(s).then((function(e){u.value=e,i(u)}),(function(e){return n("throw",e,i,c)}))}c(l.arg)}var a;o(this,"_invoke",{value:function(e,r){function o(){return new t((function(t,o){n(e,r,t,o)}))}return a=a?a.then(o,o):o()}})}function O(t,n,r){var o=m;return function(a,i){if(o===v)throw Error("Generator is already running");if(o===g){if("throw"===a)throw i;return{value:e,done:!0}}for(r.method=a,r.arg=i;;){var c=r.delegate;if(c){var l=D(c,r);if(l){if(l===y)continue;return l}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=g,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var u=p(t,n,r);if("normal"===u.type){if(o=r.done?g:h,u.arg===y)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(o=g,r.method="throw",r.arg=u.arg)}}}function D(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,D(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var a=p(o,t.iterator,n.arg);if("throw"===a.type)return n.method="throw",n.arg=a.arg,n.delegate=null,y;var i=a.arg;return i?i.done?(n[t.resultName]=i.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,y):i:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function A(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function R(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function P(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(A,this),this.reset(!0)}function T(t){if(t||""===t){var n=t[i];if(n)return n.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,a=function n(){for(;++o<t.length;)if(r.call(t,o))return n.value=t[o],n.done=!1,n;return n.value=e,n.done=!0,n};return a.next=a}}throw new TypeError(d(t)+" is not iterable")}return E.prototype=x,o(_,"constructor",{value:x,configurable:!0}),o(x,"constructor",{value:E,configurable:!0}),E.displayName=u(x,l,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===E||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,u(e,l,"GeneratorFunction")),e.prototype=Object.create(_),e},t.awrap=function(e){return{__await:e}},N(S.prototype),u(S.prototype,c,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,o,a){void 0===a&&(a=Promise);var i=new S(s(e,n,r,o),a);return t.isGeneratorFunction(n)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},N(_),u(_,l,"Generator"),u(_,i,(function(){return this})),u(_,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},t.values=T,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(R),!t)for(var n in this)"t"===n.charAt(0)&&r.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function o(r,o){return c.type="throw",c.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],c=i.completion;if("root"===i.tryLoc)return o("end");if(i.tryLoc<=this.prev){var l=r.call(i,"catchLoc"),u=r.call(i,"finallyLoc");if(l&&u){if(this.prev<i.catchLoc)return o(i.catchLoc,!0);if(this.prev<i.finallyLoc)return o(i.finallyLoc)}else if(l){if(this.prev<i.catchLoc)return o(i.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return o(i.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,y):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),R(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var o=r.arg;R(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:T(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),y}},t}function p(e,t,n,r,o,a,i){try{var c=e[a](i),l=c.value}catch(e){return void n(e)}c.done?t(l):Promise.resolve(l).then(r,o)}function m(e){return function(){var t=this,n=arguments;return new Promise((function(r,o){var a=e.apply(t,n);function i(e){p(a,r,o,i,c,"next",e)}function c(e){p(a,r,o,i,c,"throw",e)}i(void 0)}))}}function h(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function v(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,x(r.key),r)}}function g(e,t,n){return t&&v(e.prototype,t),n&&v(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function y(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function b(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(Object(n),!0).forEach((function(t){E(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function E(e,t,n){return(t=x(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function x(e){var t=function(e,t){if("object"!=d(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=d(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==d(t)?t:t+""}function w(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=C(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,o=function(){};return{s:o,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(c)throw a}}}}function C(e,t){if(e){if("string"==typeof e)return k(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?k(e,t):void 0}}function k(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}import _,{useState as N,useMemo as S,useLayoutEffect as O,useEffect as D,useContext as A,createRef as R,useRef as P}from"react";import{get as T,trim as j,invoke as I}from"lodash-es";import{Tooltip as V,Dialog as L,Form as M,FormField as F,TextBox as z,LinkButton as U,Pagination as W,GridColumn as B,CheckBox as q,DataGrid as K,GridColumnGroup as G,GridHeaderRow as Y,Layout as H,LayoutPanel as X,Panel as $,Tree as Q,ComboBox as J,TreeGrid as Z,RadioButton as ee,Label as te,NumberBox as ne,ComboTree as re,PasswordBox as oe,MenuButton as ae,Menu as ie,MenuItem as ce,treeHelper as le}from"rc-easyui";import{CheckAccessEleType as ue,FormDataType as se}from"@kordar-lib/base";import{tt as de,setLanguage as fe,getActivePkg as pe,tfield as me,tparam as he,getResourceBundle as ve}from"@kordar-lib/i18n";import{$confirm as ge,$toast as ye,setSideMenuState as be,useLocale as Ee,Access as xe,useRefDialog as we,DefaultPanel as Ce,useTheme as ke,DrawerPanel as _e,AdminLayout as Ne,TabsPanel as Se}from"@kordar/easyui";import{MenuService as Oe,SelectionTree as De,TabMenuService as Ae}from"@kordar-lib/menus";import{useDispatch as Re,useSelector as Pe}from"react-redux";import{useNavigate as Te,useLocation as je,Outlet as Ie}from"react-router-dom";import{useAppRedirect as Ve,useCheckAccess as Le,useLocalTable as Me,useTable as Fe,useFormData as ze}from"@kordar-components/react";function Ue(e){return _.createElement(_.Suspense,{fallback:_.createElement(_.Fragment,null,"...")},e)}var We=function(e){var t=e.value;return t?_.createElement(V,{content:t,position:"top"},_.createElement("div",{className:"yp-text-ellipsis"},t)):""},Be=function(){return _.createElement("div",null,"Type")},qe=function(e){return e.value.replace("T"," ").replace("Z","")},Ke=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?_.createElement("span",{className:"iconfont "+t},e):_.createElement("span",null,e)},Ge=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",o=T(e,t,[]);for(var a in o){var i=o[a];if(i.value==n)return i.label}return r},Ye=function(e){return[{type:ue.AND,value:["/resource/"+e+"/add"],key:"add"},{type:ue.AND,value:["/resource/"+e+"/update"],key:"update"},{type:ue.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:ue.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},He=function(e,t){return function(n){var r=n.fn,o=n.params,a=n.success,i=n.error;ge(de("confirm_del_title","Message"),null!=t?t:de("confirm_del_msg","Message"),(function(){r(o).then((function(t){var n=t.code;t.message,t.data;200===n?(a&&a(),e.refresh(),ye.success(de("del_success","Message"))):i&&i()}))}))}};function Xe(e){var t,n=[],r=new Map,o=w(e);try{for(o.s();!(t=o.n()).done;){var a,i=t.value,c="",l=i.name,u=j(l,"/").split("/");u.length<=2?c=u[0]:u.length>2&&(c=u[0]+"/"+u[1]);var s=r.get(c);null==s&&(s=[]);var d=null!==(a=i.description)&&void 0!==a?a:"";s.push({id:l,text:d+"["+l+"]"}),r.set(c,s)}}catch(e){o.e(e)}finally{o.f()}return r.forEach((function(e,t){n.push({text:t,children:e})})),n}function $e(e,t,n){var r=0;return e.forEach((function(e){if(e.children&&e.children.length>0){var o=$e(e.children,t,n);o>0&&(o===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)})),r}function Qe(e){var t,n=[],r=new Map,o=w(e);try{for(o.s();!(t=o.n()).done;){var a,i=t.value,c="",l=i.description,u=void 0,s=j(l,":").split(":");s.length<=2?c=s[0]:s.length>2&&(c=s[0]+":"+s[1]),s.length>=2&&(u=s[1]);var d=r.get(c);null==d&&(d=[]);var f=i.name;d.push({id:f,text:null!==(a=u)&&void 0!==a?a:f}),r.set(c,d)}}catch(e){o.e(e)}finally{o.f()}return r.forEach((function(e,t){n.push({text:t,children:e})})),n}var Je,Ze=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgVal"))||void 0===n?void 0:n(t))||{}},et=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgOptions"))||void 0===n?void 0:n(t))||[]},tt=function(e,t){if(!e[t])return[];var n=[],r=e[t];return r instanceof Array?r.forEach((function(e){return n.push({value:e.value,text:e.label})})):Object.keys(r).forEach((function(e,t){return n.push({value:e,text:r[e]})})),n};function nt(){return Je}new Oe;var rt={adminRegister:"admin/register",adminResetPassword:"admin/reset-password",initialize:"init",menus:"menus",langData:"lang-data",adminInfo:"resource/admin/info",loginCaptcha:"login/captcha",loginConfig:"login/config",loginSubmit:"login/submit",rbacRoles:"rbac/roles",rbacAddRole:"rbac/add-role",rbacUpdateRole:"rbac/update-role",rbacDeleteRole:"rbac/delete-role",rbacBatchDeleteRole:"rbac/batch-delete-role",rbacPermissions:"rbac/permissions",rbacAddPermission:"rbac/add-permission",rbacUpdatePermission:"rbac/update-permission",rbacDeletePermission:"rbac/delete-permission",rbacBatchDeletePermission:"rbac/batch-delete-permission",rbacRules:"rbac/rules",rbacAddRule:"rbac/add-rule",rbacDeleteRule:"rbac/delete-rule",rbacGetChildren:"rbac/get-children",rbacAddPermissionChildren:"rbac/add-permission-children",rbacGetRolesByUser:"rbac/get-roles-by-user",rbacAssignItemToUser:"rbac/assign-item-to-user",rbacFastAddPermission:"rbac/fast-add-permission",rbacGetPermissionsByUser:"rbac/get-permissions-by-user"};function ot(e){return rt[e]}var at=function(){return g((function e(){h(this,e)}),[{key:"result",value:function(e,t,n,r,o,a){200===e&&o&&o(n,r)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(o=m(f().mark((function e(t){var n,r,o,a,i,c,l,u=arguments;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,e.next=4,nt().post("resource/".concat(t,"/list"),n);case 4:o=e.sent,a=o.code,i=o.message,c=o.data,l=o.count,this.result(a,i,c,l,r);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return o.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(r=m(f().mark((function e(t){var n,r,o,a,i,c,l=arguments;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>1&&void 0!==l[1]?l[1]:{},r=l.length>2?l[2]:void 0,e.next=4,nt().post("resource/".concat(t,"/configs"),n);case 4:o=e.sent,a=o.code,i=o.message,c=o.data,this.result(a,i,c,0,r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"edit",value:function(e,t){return nt().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(n=m(f().mark((function e(t,n,r){var o,a,i,c;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nt().post("resource/".concat(t,"/edit"),n);case 2:o=e.sent,a=o.code,i=o.message,c=o.data,this.result(a,i,c,0,r);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"add",value:function(e,t){return nt().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return nt().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=m(f().mark((function e(t,n,r,o){var a,i,c,l,u,s,d,p;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==se.CREATE){e.next=10;break}return e.next=3,this.add(t,r);case 3:a=e.sent,i=a.code,c=a.message,l=a.data,this.result(i,c,l,0,o),e.next=18;break;case 10:if(n!==se.UPDATE){e.next=18;break}return e.next=13,this.update(t,r);case 13:u=e.sent,s=u.code,d=u.message,p=u.data,this.result(s,d,p,0,o);case 18:case"end":return e.stop()}}),e,this)}))),function(e,n,r,o){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return nt().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=m(f().mark((function e(t,n,r){var o,a,i,c;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nt().post("resource/".concat(t,"/delete"),n);case 2:o=e.sent,a=o.code,i=o.message,c=o.data,this.result(a,i,c,0,r);case 7:case"end":return e.stop()}}),e,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return nt().post("resource/".concat(e,"/info"),t)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{responseType:"blob"};return nt().post("resource/".concat(e,"/output"),t,n)}},{key:"outputOctetStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.output(e,t).then((function(e){var t=new Blob([e],{type:"application/octet-stream"}),r=URL.createObjectURL(t),o=document.createElement("a");o.setAttribute("download",n+".xlsx"),o.href=r,document.body.appendChild(o),o.click(),document.body.removeChild(o)}))}}]);var e,t,n,r,o}(),it=new at,ct=new(function(){return g((function e(){h(this,e)}),[{key:"roles",value:function(){return nt().post(ot("rbacRoles"))}},{key:"addRole",value:function(e){return nt().post(ot("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return nt().post(ot("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return nt().post(ot("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return nt().post(ot("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return nt().post(ot("rbacPermissions"))}},{key:"addPermission",value:function(e){return nt().post(ot("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return nt().post(ot("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return nt().post(ot("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return nt().post(ot("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return nt().post(ot("rbacRules"))}},{key:"addRule",value:function(e){return nt().post(ot("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return nt().post(ot("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return nt().get(ot("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return nt().post(ot("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return nt().get(ot("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return nt().post(ot("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return nt().post(ot("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return nt().get(ot("rbacGetPermissionsByUser"),{id:e})}}])}()),lt=new(function(){return g((function e(){h(this,e)}),[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nt().post(ot("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return nt().post(ot("adminResetPassword"),e)}},{key:"menus",value:function(){return nt().post(ot("menus"),{})}},{key:"info",value:function(e){return nt().post(ot("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),ut=new(function(){return g((function e(){h(this,e)}),[{key:"initialize",value:function(){return nt().post(ot("initialize"))}},{key:"getLugData",value:function(e){return nt().post(ot("langData"),{locale:e})}}])}());function st(e){return"Minified Redux error #".concat(e,"; visit https://redux.js.org/Errors?code=").concat(e," for the full message or use the non-minified dev environment for full errors. ")}var dt=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}(),ft=function(){return Math.random().toString(36).substring(7).split("").join(".")},pt={INIT:"@@redux/INIT".concat(ft()),REPLACE:"@@redux/REPLACE".concat(ft()),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION".concat(ft())}};function mt(e){if("object"!==d(e)||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function ht(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=d(e);switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";var n=function(e){return"function"==typeof e.constructor?e.constructor.name:null}(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function vt(e){var t=d(e);return"production"!==process.env.NODE_ENV&&(t=ht(e)),t}function gt(e,t,n){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?st(2):"Expected the root reducer to be a function. Instead, received: '".concat(vt(e),"'"));if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error("production"===process.env.NODE_ENV?st(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error("production"===process.env.NODE_ENV?st(1):"Expected the enhancer to be a function. Instead, received: '".concat(vt(n),"'"));return n(gt)(e,t)}var r=e,o=t,a=new Map,i=a,c=0,l=!1;function u(){i===a&&(i=new Map,a.forEach((function(e,t){i.set(t,e)})))}function s(){if(l)throw new Error("production"===process.env.NODE_ENV?st(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function f(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?st(4):"Expected the listener to be a function. Instead, received: '".concat(vt(e),"'"));if(l)throw new Error("production"===process.env.NODE_ENV?st(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var t=!0;u();var n=c++;return i.set(n,e),function(){if(t){if(l)throw new Error("production"===process.env.NODE_ENV?st(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");t=!1,u(),i.delete(n),a=null}}}function p(e){if(!mt(e))throw new Error("production"===process.env.NODE_ENV?st(7):"Actions must be plain objects. Instead, the actual type was: '".concat(vt(e),"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples."));if(void 0===e.type)throw new Error("production"===process.env.NODE_ENV?st(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if("string"!=typeof e.type)throw new Error("production"===process.env.NODE_ENV?st(17):'Action "type" property must be a string. Instead, the actual type was: \''.concat(vt(e.type),"'. Value was: '").concat(e.type,"' (stringified)"));if(l)throw new Error("production"===process.env.NODE_ENV?st(9):"Reducers may not dispatch actions.");try{l=!0,o=r(o,e)}finally{l=!1}return(a=i).forEach((function(e){e()})),e}return p({type:pt.INIT}),E({dispatch:p,subscribe:f,getState:s,replaceReducer:function(e){if("function"!=typeof e)throw new Error("production"===process.env.NODE_ENV?st(10):"Expected the nextReducer to be a function. Instead, received: '".concat(vt(e)));r=e,p({type:pt.REPLACE})}},dt,(function(){var e=f;return E({subscribe:function(t){if("object"!==d(t)||null===t)throw new Error("production"===process.env.NODE_ENV?st(11):"Expected the observer to be an object. Instead, received: '".concat(vt(t),"'"));function n(){var e=t;e.next&&e.next(s())}return n(),{unsubscribe:e(n)}}},dt,(function(){return this}))}))}function yt(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(e){}}function bt(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"production"!==process.env.NODE_ENV&&void 0===e[o]&&yt('No reducer provided for key "'.concat(o,'"')),"function"==typeof e[o]&&(n[o]=e[o])}var a,i,c=Object.keys(n);"production"!==process.env.NODE_ENV&&(a={});try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:pt.INIT}))throw new Error("production"===process.env.NODE_ENV?st(12):'The slice reducer for key "'.concat(t,"\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined."));if(void 0===n(void 0,{type:pt.PROBE_UNKNOWN_ACTION()}))throw new Error("production"===process.env.NODE_ENV?st(13):'The slice reducer for key "'.concat(t,"\" returned undefined when probed with a random type. Don't try to handle '").concat(pt.INIT,'\' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.'))}))}(n)}catch(e){i=e}return function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if(i)throw i;if("production"!==process.env.NODE_ENV){var r=function(e,t,n,r){var o=Object.keys(t),a=n&&n.type===pt.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(0===o.length)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!mt(e))return"The ".concat(a,' has unexpected type of "').concat(vt(e),'". Expected argument to be an object with the following keys: "').concat(o.join('", "'),'"');var i=Object.keys(e).filter((function(e){return!t.hasOwnProperty(e)&&!r[e]}));return i.forEach((function(e){r[e]=!0})),n&&n.type===pt.REPLACE?void 0:i.length>0?"Unexpected ".concat(i.length>1?"keys":"key",' "').concat(i.join('", "'),'" found in ').concat(a,'. Expected to find one of the known reducer keys instead: "').concat(o.join('", "'),'". Unexpected keys will be ignored.'):void 0}(e,n,t,a);r&&yt(r)}for(var o=!1,l={},u=0;u<c.length;u++){var s=c[u],d=n[s],f=e[s],p=d(f,t);if(void 0===p){var m=t&&t.type;throw new Error("production"===process.env.NODE_ENV?st(14):"When called with an action of type ".concat(m?'"'.concat(String(m),'"'):"(unknown type)",', the slice reducer for key "').concat(s,'" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.'))}l[s]=p,o=o||p!==f}return(o=o||c.length!==Object.keys(e).length)?l:e}}function Et(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function xt(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(n,r){var o=e(n,r),a=function(){throw new Error("production"===process.env.NODE_ENV?st(15):"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.")},i={getState:o.getState,dispatch:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return a.apply(void 0,[e].concat(n))}},c=t.map((function(e){return e(i)}));return a=Et.apply(void 0,s(c))(o.dispatch),b(b({},o),{},{dispatch:a})}}}function wt(e){return mt(e)&&"type"in e&&"string"==typeof e.type}var Ct=Symbol.for("immer-nothing"),kt=Symbol.for("immer-draftable"),_t=Symbol.for("immer-state"),Nt="production"!==process.env.NODE_ENV?[function(e){return"The plugin for '".concat(e,"' has not been loaded into Immer. To enable the plugin, import and call `enable").concat(e,"()` when initializing your application.")},function(e){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '".concat(e,"'")},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return"'current' expects a draft, got: ".concat(e)},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return"'original' expects a draft, got: ".concat(e)}]:[];function St(e){if("production"!==process.env.NODE_ENV){for(var t=Nt[e],n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a="function"==typeof t?t.apply(null,r):t;throw new Error("[Immer] ".concat(a))}throw new Error("[Immer] minified error nr: ".concat(e,". Full error at: https://bit.ly/3cXEKWf"))}var Ot=Object.getPrototypeOf;function Dt(e){return!!e&&!!e[_t]}function At(e){var t;return!!e&&(Pt(e)||Array.isArray(e)||!!e[kt]||!(null===(t=e.constructor)||void 0===t||!t[kt])||Lt(e)||Mt(e))}var Rt=Object.prototype.constructor.toString();function Pt(e){if(!e||"object"!==d(e))return!1;var t=Ot(e);if(null===t)return!0;var n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object||"function"==typeof n&&Function.toString.call(n)===Rt}function Tt(e,t){0===jt(e)?Reflect.ownKeys(e).forEach((function(n){t(n,e[n],e)})):e.forEach((function(n,r){return t(r,n,e)}))}function jt(e){var t=e[_t];return t?t.type_:Array.isArray(e)?1:Lt(e)?2:Mt(e)?3:0}function It(e,t){return 2===jt(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function Vt(e,t,n){var r=jt(e);2===r?e.set(t,n):3===r?e.add(n):e[t]=n}function Lt(e){return e instanceof Map}function Mt(e){return e instanceof Set}function Ft(e){return e.copy_||e.base_}function zt(e,t){if(Lt(e))return new Map(e);if(Mt(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);var n=Pt(e);if(!0===t||"class_only"===t&&!n){var r=Object.getOwnPropertyDescriptors(e);delete r[_t];for(var o=Reflect.ownKeys(r),a=0;a<o.length;a++){var i=o[a],c=r[i];!1===c.writable&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(r[i]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[i]})}return Object.create(Ot(e),r)}var l=Ot(e);if(null!==l&&n)return b({},e);var u=Object.create(l);return Object.assign(u,e)}function Ut(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return Bt(e)||Dt(e)||!At(e)||(jt(e)>1&&(e.set=e.add=e.clear=e.delete=Wt),Object.freeze(e),t&&Object.entries(e).forEach((function(e){var t=u(e,2);t[0];return Ut(t[1],!0)}))),e}function Wt(){St(2)}function Bt(e){return Object.isFrozen(e)}var qt,Kt={};function Gt(e){var t=Kt[e];return t||St(0,e),t}function Yt(){return qt}function Ht(e,t){t&&(Gt("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Xt(e){$t(e),e.drafts_.forEach(Jt),e.drafts_=null}function $t(e){e===qt&&(qt=e.parent_)}function Qt(e){return qt={drafts_:[],parent_:qt,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function Jt(e){var t=e[_t];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function Zt(e,t){t.unfinalizedDrafts_=t.drafts_.length;var n=t.drafts_[0];return void 0!==e&&e!==n?(n[_t].modified_&&(Xt(t),St(4)),At(e)&&(e=en(t,e),t.parent_||nn(t,e)),t.patches_&&Gt("Patches").generateReplacementPatches_(n[_t].base_,e,t.patches_,t.inversePatches_)):e=en(t,n,[]),Xt(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==Ct?e:void 0}function en(e,t,n){if(Bt(t))return t;var r=t[_t];if(!r)return Tt(t,(function(o,a){return tn(e,r,t,o,a,n)})),t;if(r.scope_!==e)return t;if(!r.modified_)return nn(e,r.base_,!0),r.base_;if(!r.finalized_){r.finalized_=!0,r.scope_.unfinalizedDrafts_--;var o=r.copy_,a=o,i=!1;3===r.type_&&(a=new Set(o),o.clear(),i=!0),Tt(a,(function(t,a){return tn(e,r,o,t,a,n,i)})),nn(e,o,!1),n&&e.patches_&&Gt("Patches").generatePatches_(r,n,e.patches_,e.inversePatches_)}return r.copy_}function tn(e,t,n,r,o,a,i){if("production"!==process.env.NODE_ENV&&o===n&&St(5),Dt(o)){var c=en(e,o,a&&t&&3!==t.type_&&!It(t.assigned_,r)?a.concat(r):void 0);if(Vt(n,r,c),!Dt(c))return;e.canAutoFreeze_=!1}else i&&n.add(o);if(At(o)&&!Bt(o)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;en(e,o),t&&t.scope_.parent_||"symbol"===d(r)||!Object.prototype.propertyIsEnumerable.call(n,r)||nn(e,o)}}function nn(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Ut(t,n)}var rn={get:function(e,t){if(t===_t)return e;var n=Ft(e);if(!It(n,t))return function(e,t,n){var r,o=cn(t,n);return o?"value"in o?o.value:null===(r=o.get)||void 0===r?void 0:r.call(e.draft_):void 0}(e,n,t);var r=n[t];return e.finalized_||!At(r)?r:r===an(e.base_,t)?(un(e),e.copy_[t]=dn(r,e)):r},has:function(e,t){return t in Ft(e)},ownKeys:function(e){return Reflect.ownKeys(Ft(e))},set:function(e,t,n){var r=cn(Ft(e),t);if(null!=r&&r.set)return r.set.call(e.draft_,n),!0;if(!e.modified_){var o=an(Ft(e),t),a=null==o?void 0:o[_t];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t}(n,o)&&(void 0!==n||It(e.base_,t)))return!0;un(e),ln(e)}return e.copy_[t]===n&&(void 0!==n||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty:function(e,t){return void 0!==an(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,un(e),ln(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor:function(e,t){var n=Ft(e),r=Reflect.getOwnPropertyDescriptor(n,t);return r?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:r.enumerable,value:n[t]}:r},defineProperty:function(){St(11)},getPrototypeOf:function(e){return Ot(e.base_)},setPrototypeOf:function(){St(12)}},on={};function an(e,t){var n=e[_t];return(n?Ft(n):e)[t]}function cn(e,t){if(t in e)for(var n=Ot(e);n;){var r=Object.getOwnPropertyDescriptor(n,t);if(r)return r;n=Ot(n)}}function ln(e){e.modified_||(e.modified_=!0,e.parent_&&ln(e.parent_))}function un(e){e.copy_||(e.copy_=zt(e.base_,e.scope_.immer_.useStrictShallowCopy_))}Tt(rn,(function(e,t){on[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),on.deleteProperty=function(e,t){return"production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&St(13),on.set.call(this,e,t,void 0)},on.set=function(e,t,n){return"production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&St(14),rn.set.call(this,e[0],t,n,e[0])};var sn=function(){return g((function e(t){var n=this;h(this,e),this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=function(e,t,r){if("function"==typeof e&&"function"!=typeof t){var o=t;t=e;var a=n;return function(){for(var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,r=arguments.length,i=new Array(r>1?r-1:0),c=1;c<r;c++)i[c-1]=arguments[c];return a.produce(n,(function(n){var r;return(r=t).call.apply(r,[e,n].concat(i))}))}}var i;if("function"!=typeof t&&St(6),void 0!==r&&"function"!=typeof r&&St(7),At(e)){var c=Qt(n),l=dn(e,void 0),u=!0;try{i=t(l),u=!1}finally{u?Xt(c):$t(c)}return Ht(c,r),Zt(i,c)}if(!e||"object"!==d(e)){if(void 0===(i=t(e))&&(i=e),i===Ct&&(i=void 0),n.autoFreeze_&&Ut(i,!0),r){var s=[],f=[];Gt("Patches").generateReplacementPatches_(e,i,s,f),r(s,f)}return i}St(1,e)},this.produceWithPatches=function(e,t){if("function"==typeof e)return function(t){for(var r=arguments.length,o=new Array(r>1?r-1:0),a=1;a<r;a++)o[a-1]=arguments[a];return n.produceWithPatches(t,(function(t){return e.apply(void 0,[t].concat(o))}))};var r,o,a=n.produce(e,t,(function(e,t){r=e,o=t}));return[a,r,o]},"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),"boolean"==typeof(null==t?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy)}),[{key:"createDraft",value:function(e){At(e)||St(8),Dt(e)&&(e=function(e){Dt(e)||St(10,e);return fn(e)}(e));var t=Qt(this),n=dn(e,void 0);return n[_t].isManual_=!0,$t(t),n}},{key:"finishDraft",value:function(e,t){var n=e&&e[_t];n&&n.isManual_||St(9);var r=n.scope_;return Ht(r,t),Zt(void 0,r)}},{key:"setAutoFreeze",value:function(e){this.autoFreeze_=e}},{key:"setUseStrictShallowCopy",value:function(e){this.useStrictShallowCopy_=e}},{key:"applyPatches",value:function(e,t){var n;for(n=t.length-1;n>=0;n--){var r=t[n];if(0===r.path.length&&"replace"===r.op){e=r.value;break}}n>-1&&(t=t.slice(n+1));var o=Gt("Patches").applyPatches_;return Dt(e)?o(e,t):this.produce(e,(function(e){return o(e,t)}))}}])}();function dn(e,t){var n=Lt(e)?Gt("MapSet").proxyMap_(e,t):Mt(e)?Gt("MapSet").proxySet_(e,t):function(e,t){var n=Array.isArray(e),r={type_:n?1:0,scope_:t?t.scope_:Yt(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},o=r,a=rn;n&&(o=[r],a=on);var i=Proxy.revocable(o,a),c=i.revoke,l=i.proxy;return r.draft_=l,r.revoke_=c,l}(e,t);return(t?t.scope_:Yt()).drafts_.push(n),n}function fn(e){if(!At(e)||Bt(e))return e;var t,n=e[_t];if(n){if(!n.modified_)return n.base_;n.finalized_=!0,t=zt(e,n.scope_.immer_.useStrictShallowCopy_)}else t=zt(e,!0);return Tt(t,(function(e,n){Vt(t,e,fn(n))})),n&&(n.finalized_=!1),t}var pn=new sn,mn=pn.produce;function hn(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}pn.produceWithPatches.bind(pn),pn.setAutoFreeze.bind(pn),pn.setUseStrictShallowCopy.bind(pn),pn.applyPatches.bind(pn),pn.createDraft.bind(pn),pn.finishDraft.bind(pn);var vn=hn(),gn=hn,yn="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!==arguments.length)return"object"===d(arguments[0])?Et:Et.apply(null,arguments)};function bn(e,t){function n(){if(t){var n=t.apply(void 0,arguments);if(!n)throw new Error("production"===process.env.NODE_ENV?qn(0):"prepareAction did not return an object");return b(b({type:e,payload:n.payload},"meta"in n&&{meta:n.meta}),"error"in n&&{error:n.error})}return{type:e,payload:arguments.length<=0?void 0:arguments[0]}}return n.toString=function(){return"".concat(e)},n.type=e,n.match=function(t){return wt(t)&&t.type===e},n}function En(e){return"function"==typeof e&&"type"in e&&function(e){return e&&"function"==typeof e.match}(e)}function xn(e,t){var n=0;return{measureTime:function(e){var t=Date.now();try{return e()}finally{var r=Date.now();n+=r-t}},warnIfExceeded:function(){n>e&&console.warn("".concat(t," took ").concat(n,"ms, which is more than the warning threshold of ").concat(e,"ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that."))}}}var wn=function(){function e(){var n;h(this,e);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return n=t(this,e,[].concat(o)),Object.setPrototypeOf(n,e.prototype),n}return r(e,o(Array)),g(e,[{key:"concat",value:function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];return function(e,t,r,o){var a=n(l(1&o?e.prototype:e),t,r);return 2&o&&"function"==typeof a?function(e){return a.apply(r,e)}:a}(e,"concat",this,1).apply(this,r)}},{key:"prepend",value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return 1===n.length&&Array.isArray(n[0])?a(e,s(n[0].concat(this))):a(e,s(n.concat(this)))}}],[{key:Symbol.species,get:function(){return e}}])}();function Cn(e){return At(e)?mn(e,(function(){})):e}function kn(e,t,n){return e.has(t)?e.get(t):e.set(t,n(t)).get(t)}function _n(e){return"object"!==d(e)||null==e||Object.isFrozen(e)}function Nn(e,t,n){var r=Sn(e,t,n);return{detectMutations:function(){return On(e,t,r,n)}}}function Sn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:new Set,a={value:n};if(!e(n)&&!o.has(n))for(var i in o.add(n),a.children={},n){var c=r?r+"."+i:i;t.length&&-1!==t.indexOf(c)||(a.children[i]=Sn(e,t,n[i],c))}return a}function On(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:"",i=n?n.value:void 0,c=i===r;if(o&&!c&&!Number.isNaN(r))return{wasMutated:!0,path:a};if(e(i)||e(r))return{wasMutated:!1};var l={};for(var u in n.children)l[u]=!0;for(var s in r)l[s]=!0;var d,f=t.length>0,p=function(){var o=a?a+"."+m:m;if(f&&t.some((function(e){return e instanceof RegExp?e.test(o):o===e})))return 0;var i=On(e,t,n.children[m],r[m],c,o);if(i.wasMutated)return{v:i}};for(var m in l)if(0!==(d=p())&&d)return d.v;return{wasMutated:!1}}function Dn(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("production"===process.env.NODE_ENV)return function(){return function(e){return function(t){return e(t)}}};var t=function(e,t){var n=[],r=[];return t||(t=function(e,t){return n[0]===t?"[Circular ~]":"[Circular ~."+r.slice(0,n.indexOf(t)).join(".")+"]"}),function(o,a){if(n.length>0){var i=n.indexOf(this);~i?n.splice(i+1):n.push(this),~i?r.splice(i,1/0,o):r.push(o),~n.indexOf(a)&&(a=t.call(this,o,a))}else n.push(a);return null==e?a:e.call(this,o,a)}},n=e.isImmutable,r=void 0===n?_n:n,o=e.ignoredPaths,a=e.warnAfter,i=void 0===a?32:a,c=Nn.bind(null,r,o);return function(e){var n,r=e.getState,o=r(),a=c(o);return function(e){return function(l){var u=xn(i,"ImmutableStateInvariantMiddleware");u.measureTime((function(){if(o=r(),n=a.detectMutations(),a=c(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?qn(19):"A state mutation was detected between dispatches, in the path '".concat(n.path||"","'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"))}));var s=e(l);return u.measureTime((function(){if(o=r(),n=a.detectMutations(),a=c(o),n.wasMutated)throw new Error("production"===process.env.NODE_ENV?qn(20):"A state mutation was detected inside a dispatch, in the path: ".concat(n.path||"",". Take a look at the reducer(s) handling the action ").concat((e=l,JSON.stringify(e,t(i,s),u)),". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)"));var e,i,u,s})),u.warnIfExceeded(),s}}}}function An(e){var t=d(e);return null==e||"string"===t||"boolean"===t||"number"===t||Array.isArray(e)||mt(e)}function Rn(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:An,o=arguments.length>3?arguments[3]:void 0,a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],i=arguments.length>5?arguments[5]:void 0;if(!r(e))return{keyPath:n||"<root>",value:e};if("object"!==d(e)||null===e)return!1;if(null!=i&&i.has(e))return!1;var c,l=null!=o?o(e):Object.entries(e),s=a.length>0,f=w(l);try{var p,m=function(){var e=u(c.value,2),l=e[0],f=e[1],p=n?n+"."+l:l;if(s&&a.some((function(e){return e instanceof RegExp?e.test(p):p===e})))return 0;return r(f)?"object"===d(f)&&(t=Rn(f,p,r,o,a,i))?{v:t}:void 0:{v:{keyPath:p,value:f}}};for(f.s();!(c=f.n()).done;)if(0!==(p=m())&&p)return p.v}catch(e){f.e(e)}finally{f.f()}return i&&Pn(e)&&i.add(e),!1}function Pn(e){if(!Object.isFrozen(e))return!1;for(var t=0,n=Object.values(e);t<n.length;t++){var r=n[t];if("object"===d(r)&&null!==r&&!Pn(r))return!1}return!0}function Tn(e){return"boolean"==typeof e}var jn=function(){return function(e){var t=null!=e?e:{},n=t.thunk,r=void 0===n||n,o=t.immutableCheck,a=void 0===o||o,i=t.serializableCheck,c=void 0===i||i,l=t.actionCreatorCheck,u=void 0===l||l,s=new wn;if(r&&(Tn(r)?s.push(vn):s.push(gn(r.extraArgument))),"production"!==process.env.NODE_ENV){if(a){var d={};Tn(a)||(d=a),s.unshift(Dn(d))}if(c){var f={};Tn(c)||(f=c),s.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("production"===process.env.NODE_ENV)return function(){return function(e){return function(t){return e(t)}}};var t=e.isSerializable,n=void 0===t?An:t,r=e.getEntries,o=e.ignoredActions,a=void 0===o?[]:o,i=e.ignoredActionPaths,c=void 0===i?["meta.arg","meta.baseQueryMeta"]:i,l=e.ignoredPaths,u=void 0===l?[]:l,s=e.warnAfter,d=void 0===s?32:s,f=e.ignoreState,p=void 0!==f&&f,m=e.ignoreActions,h=void 0!==m&&m,v=e.disableCache,g=void 0!==v&&v||!WeakSet?void 0:new WeakSet;return function(e){return function(t){return function(o){if(!wt(o))return t(o);var i=t(o),l=xn(d,"SerializableStateInvariantMiddleware");return h||a.length&&-1!==a.indexOf(o.type)||l.measureTime((function(){var e=Rn(o,"",n,r,c,g);if(e){var t=e.keyPath,a=e.value;console.error("A non-serializable value was detected in an action, in the path: `".concat(t,"`. Value:"),a,"\nTake a look at the logic that dispatched this action: ",o,"\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)","\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)")}})),p||(l.measureTime((function(){var t=Rn(e.getState(),"",n,r,u,g);if(t){var a=t.keyPath,i=t.value;console.error("A non-serializable value was detected in the state, in the path: `".concat(a,"`. Value:"),i,"\nTake a look at the reducer(s) handling this action type: ".concat(o.type,".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)"))}})),l.warnIfExceeded()),i}}}}(f))}if(u){var p={};Tn(u)||(p=u),s.unshift(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("production"===process.env.NODE_ENV)return function(){return function(e){return function(t){return e(t)}}};var t=e.isActionCreator,n=void 0===t?En:t;return function(){return function(e){return function(t){var r,o,a;return n(t)&&console.warn((a=(o=(r=t.type)?"".concat(r).split("/"):[])[o.length-1]||"actionCreator",'Detected an action creator with type "'.concat(r||"unknown","\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(").concat(a,"())` instead of `dispatch(").concat(a,")`. This is necessary even if the action has no payload."))),e(t)}}}}(p))}}return s}},In=function(e){return function(t){setTimeout(t,e)}},Vn=function(e){return function(t){var n=(null!=t?t:{}).autoBatch,r=void 0===n||n,o=new wn(e);return r&&o.push(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{type:"raf"};return function(t){return function(){var n=t.apply(void 0,arguments),r=!0,o=!1,a=!1,i=new Set,c="tick"===e.type?queueMicrotask:"raf"===e.type?"undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:In(10):"callback"===e.type?e.queueNotification:In(e.timeout),l=function(){a=!1,o&&(o=!1,i.forEach((function(e){return e()})))};return Object.assign({},n,{subscribe:function(e){var t=n.subscribe((function(){return r&&e()}));return i.add(e),function(){t(),i.delete(e)}},dispatch:function(e){try{var t;return r=!(null!=e&&null!==(t=e.meta)&&void 0!==t&&t.RTK_autoBatch),(o=!r)&&(a||(a=!0,c(l))),n.dispatch(e)}finally{r=!0}}})}}}("object"===d(r)?r:void 0)),o}};function Ln(e){var t,n={},r=[],o={addCase:function(e,a){if("production"!==process.env.NODE_ENV){if(r.length>0)throw new Error("production"===process.env.NODE_ENV?qn(26):"`builder.addCase` should only be called before calling `builder.addMatcher`");if(t)throw new Error("production"===process.env.NODE_ENV?qn(27):"`builder.addCase` should only be called before calling `builder.addDefaultCase`")}var i="string"==typeof e?e:e.type;if(!i)throw new Error("production"===process.env.NODE_ENV?qn(28):"`builder.addCase` cannot be called with an empty action type");if(i in n)throw new Error("production"===process.env.NODE_ENV?qn(29):"`builder.addCase` cannot be called with two reducers for the same action type '".concat(i,"'"));return n[i]=a,o},addMatcher:function(e,n){if("production"!==process.env.NODE_ENV&&t)throw new Error("production"===process.env.NODE_ENV?qn(30):"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");return r.push({matcher:e,reducer:n}),o},addDefaultCase:function(e){if("production"!==process.env.NODE_ENV&&t)throw new Error("production"===process.env.NODE_ENV?qn(31):"`builder.addDefaultCase` can only be called once");return t=e,o}};return e(o),[n,r,t]}var Mn=Symbol.for("rtk-slice-createasyncthunk");function Fn(e,t){return"".concat(e,"/").concat(t)}function zn(){var t,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).creators,r=null==n||null===(t=n.asyncThunk)||void 0===t?void 0:t[Mn];return function(t){var n=t.name,o=t.reducerPath,a=void 0===o?n:o;if(!n)throw new Error("production"===process.env.NODE_ENV?qn(11):"`name` is a required option for createSlice");"undefined"!=typeof process&&"development"===process.env.NODE_ENV&&void 0===t.initialState&&console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");var i=("function"==typeof t.reducers?t.reducers(function(){function e(e,t){return b({_reducerDefinitionType:"asyncThunk",payloadCreator:e},t)}return e.withTypes=function(){return e},{reducer:function(e){return Object.assign(E({},e.name,(function(){return e.apply(void 0,arguments)}))[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer:function(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:e}}()):t.reducers)||{},c=Object.keys(i),l={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},f={addCase:function(e,t){var n="string"==typeof e?e:e.type;if(!n)throw new Error("production"===process.env.NODE_ENV?qn(12):"`context.addCase` cannot be called with an empty action type");if(n in l.sliceCaseReducersByType)throw new Error("production"===process.env.NODE_ENV?qn(13):"`context.addCase` cannot be called with two reducers for the same action type: "+n);return l.sliceCaseReducersByType[n]=t,f},addMatcher:function(e,t){return l.sliceMatchers.push({matcher:e,reducer:t}),f},exposeAction:function(e,t){return l.actionCreators[e]=t,f},exposeCaseReducer:function(e,t){return l.sliceCaseReducersByName[e]=t,f}};function p(){if("production"!==process.env.NODE_ENV&&"object"===d(t.extraReducers))throw new Error("production"===process.env.NODE_ENV?qn(14):"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");var e=u("function"==typeof t.extraReducers?Ln(t.extraReducers):[t.extraReducers],3),n=e[0],r=void 0===n?{}:n,o=e[1],a=void 0===o?[]:o,i=e[2],c=void 0===i?void 0:i,f=b(b({},r),l.sliceCaseReducersByType);return function(e,t){if("production"!==process.env.NODE_ENV&&"object"===d(t))throw new Error("production"===process.env.NODE_ENV?qn(8):"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");var n,r=u(Ln(t),3),o=r[0],a=r[1],i=r[2];if(function(e){return"function"==typeof e}(e))n=function(){return Cn(e())};else{var c=Cn(e);n=function(){return c}}function l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:n(),t=arguments.length>1?arguments[1]:void 0,r=[o[t.type]].concat(s(a.filter((function(e){return(0,e.matcher)(t)})).map((function(e){return e.reducer}))));return 0===r.filter((function(e){return!!e})).length&&(r=[i]),r.reduce((function(e,n){if(n){if(Dt(e)){var r=n(e,t);return void 0===r?e:r}if(At(e))return mn(e,(function(e){return n(e,t)}));var o=n(e,t);if(void 0===o){if(null===e)return e;throw Error("A case reducer on a non-draftable value must not return undefined")}return o}return e}),e)}return l.getInitialState=n,l}(t.initialState,(function(e){for(var t in f)e.addCase(t,f[t]);var n,r=w(l.sliceMatchers);try{for(r.s();!(n=r.n()).done;){var o=n.value;e.addMatcher(o.matcher,o.reducer)}}catch(e){r.e(e)}finally{r.f()}var i,u=w(a);try{for(u.s();!(i=u.n()).done;){var s=i.value;e.addMatcher(s.matcher,s.reducer)}}catch(e){u.e(e)}finally{u.f()}c&&e.addDefaultCase(c)}))}c.forEach((function(e){var o=i[e],a={reducerName:e,type:Fn(n,e),createNotation:"function"==typeof t.reducers};!function(e){return"asyncThunk"===e._reducerDefinitionType}(o)?function(e,t,n){var r,o,a=e.type,i=e.reducerName,c=e.createNotation;if("reducer"in t){if(c&&!function(e){return"reducerWithPrepare"===e._reducerDefinitionType}(t))throw new Error("production"===process.env.NODE_ENV?qn(17):"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");r=t.reducer,o=t.prepare}else r=t;n.addCase(a,r).exposeCaseReducer(i,r).exposeAction(i,o?bn(a,o):bn(a))}(a,o,f):function(e,t,n,r){var o=e.type,a=e.reducerName;if(!r)throw new Error("production"===process.env.NODE_ENV?qn(18):"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");var i=t.payloadCreator,c=t.fulfilled,l=t.pending,u=t.rejected,s=t.settled,d=t.options,f=r(o,i,d);n.exposeAction(a,f),c&&n.addCase(f.fulfilled,c);l&&n.addCase(f.pending,l);u&&n.addCase(f.rejected,u);s&&n.addMatcher(f.settled,s);n.exposeCaseReducer(a,{fulfilled:c||Bn,pending:l||Bn,rejected:u||Bn,settled:s||Bn})}(a,o,f,r)}));var m,h=function(e){return e},v=new Map;function g(e,t){return m||(m=p()),m(e,t)}function y(){return m||(m=p()),m.getInitialState()}function x(e){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];function r(t){var r=t[e];if(void 0===r)if(n)r=y();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?qn(15):"selectSlice returned undefined for an uninjected slice reducer");return r}function o(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:h,r=kn(v,n,(function(){return new WeakMap}));return kn(r,e,(function(){for(var r={},o=0,a=Object.entries(null!==(i=t.selectors)&&void 0!==i?i:{});o<a.length;o++){var i,c=u(a[o],2),l=c[0],s=c[1];r[l]=Un(s,e,y,n)}return r}))}return{reducerPath:e,getSelectors:o,get selectors(){return o(r)},selectSlice:r}}var C=b(b({name:n,reducer:g,actions:l.actionCreators,caseReducers:l.sliceCaseReducersByName,getInitialState:y},x(a)),{},{injectInto:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.reducerPath,o=function(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}(n,e),i=null!=r?r:a;return t.inject({reducerPath:i,reducer:g},o),b(b({},C),x(i,!0))}});return C}}function Un(e,t,n,r){function o(o){var a=t(o);if(void 0===a)if(r)a=n();else if("production"!==process.env.NODE_ENV)throw new Error("production"===process.env.NODE_ENV?qn(16):"selectState returned undefined for an uninjected slice reducer");for(var i=arguments.length,c=new Array(i>1?i-1:0),l=1;l<i;l++)c[l-1]=arguments[l];return e.apply(void 0,[a].concat(c))}return o.unwrapped=e,o}var Wn=zn();function Bn(){}function qn(e){return"Minified Redux Toolkit error #".concat(e,"; visit https://redux-toolkit.js.org/Errors?code=").concat(e," for the full message or use the non-minified dev environment for full errors. ")}var Kn,Gn,Yn=function(e){var t,n,r=jn(),o=e.reducer,a=void 0===o?void 0:o,i=e.middleware,c=e.devTools,l=void 0===c||c,u=e.preloadedState,f=void 0===u?void 0:u,p=e.enhancers,m=void 0===p?void 0:p;if("function"==typeof a)t=a;else{if(!mt(a))throw new Error("production"===process.env.NODE_ENV?qn(1):"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");t=bt(a)}if("production"!==process.env.NODE_ENV&&i&&"function"!=typeof i)throw new Error("production"===process.env.NODE_ENV?qn(2):"`middleware` field must be a callback");if("function"==typeof i){if(n=i(r),"production"!==process.env.NODE_ENV&&!Array.isArray(n))throw new Error("production"===process.env.NODE_ENV?qn(3):"when using a middleware builder function, an array of middleware must be returned")}else n=r();if("production"!==process.env.NODE_ENV&&n.some((function(e){return"function"!=typeof e})))throw new Error("production"===process.env.NODE_ENV?qn(4):"each middleware provided to configureStore must be a function");var h=Et;l&&(h=yn(b({trace:"production"!==process.env.NODE_ENV},"object"===d(l)&&l)));var v=xt.apply(void 0,s(n)),g=Vn(v);if("production"!==process.env.NODE_ENV&&m&&"function"!=typeof m)throw new Error("production"===process.env.NODE_ENV?qn(5):"`enhancers` field must be a callback");var y="function"==typeof m?m(g):g();if("production"!==process.env.NODE_ENV&&!Array.isArray(y))throw new Error("production"===process.env.NODE_ENV?qn(6):"`enhancers` callback must return an array");if("production"!==process.env.NODE_ENV&&y.some((function(e){return"function"!=typeof e})))throw new Error("production"===process.env.NODE_ENV?qn(7):"each enhancer provided to configureStore must be a function");return"production"!==process.env.NODE_ENV&&n.length&&!y.includes(v)&&console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`"),gt(t,f,h.apply(void 0,s(y)))}({reducer:{},middleware:function(e){return e({serializableCheck:!1})}}),Hn=Re,Xn=Pe,$n=Wn({name:"user",initialState:{token:"",info:{},permissions:{},version:0},reducers:{login:function(e,t){var n=t.payload,r=n.token,o=n.info,a=n.success,i=n.error;if(r)return e.token=r,e.info=o,void(a&&a());i&&i()},logout:function(e,t){e.token="",e.info={},t.payload&&t.payload()},loadPermissions:function(e,t){for(var n in t.payload){var r=t.payload[n];e.permissions[r.name]=r}e.version+=1},incrementVersion:function(e,t){e.version+=1}}}),Qn=$n.actions,Jn=Qn.login,Zn=Qn.logout,er=Qn.loadPermissions,tr=Qn.incrementVersion,nr=Wn({name:"app",initialState:{sidebarCollapsed:!1,locale:"zh-CN",theme:"default",localeOptions:{en:"English"},historyLocation:{hash:"",search:"",pathname:""}},reducers:{setSidebarCollapsed:function(e,t){e.sidebarCollapsed=t.payload},setLocale:function(e,t){var n=t.payload,r=n.locale,o=n.callback;e.locale=r,o&&o()},setAppTheme:function(e,t){e.theme=t.payload},setLocaleOptions:function(e,t){e.localeOptions=t.payload},saveHistoryLocation:function(e,t){var n=t.payload,r=n.pathname;n.hash,n.search,"/login"!==r&&(e.historyLocation=t.payload)}}}),rr=nr.actions,or=rr.setSidebarCollapsed;rr.setLocale;var ar=rr.setLocaleOptions,ir=rr.saveHistoryLocation;rr.setAppTheme;var cr=Wn({name:"layout",initialState:{choices:[],tabs:[],choiceId:0},reducers:{sidebarChoice:function(e,t){var n=t.payload,r=n.id,o=n.choices;-1===e.tabs.findIndex((function(e){return e==r}))&&e.tabs.push(r),null!==o&&(e.choices=o),e.choiceId=r},justSaveChoice:function(e,t){var n=t.payload.choiceId;e.choices=[],e.choiceId=n},saveTabs:function(e,t){var n=t.payload.newTabs;e.tabs=null!=n?n:[]},saveChoice:function(e,t){var n=t.payload.choices;e.choices=n},removeTab:function(e,t){var n=t.payload.id,r=void 0,o=void 0,a=e.tabs.findIndex((function(e){return e==n}));-1!==a&&(r=e.tabs[a-1],o=e.tabs[a+1]),void 0!==o?e.choiceId=o:void 0!==r&&(e.choiceId=r),e.tabs=e.tabs.filter((function(e){return e!==n}))},clearLayoutData:function(e,t){e.choiceId="",e.choices=[],e.tabs=[]}}}),lr=cr.actions,ur=lr.sidebarChoice;lr.saveTabs;var sr,dr=lr.saveChoice,fr=lr.removeTab,pr=lr.clearLayoutData;function mr(e){var t=Hn(),n=Te(),r=null==Xn?void 0:Xn((function(e){return e.app.sidebarCollapsed})),o=Xn((function(e){return e.layout})),a=o.tabs,i=o.choices,c=o.choiceId,l=u(N(),2),s=l[0],d=l[1],p=u(N(),2),h=p[0],v=p[1],g=u(N([]),2),y=g[0],b=g[1],E=u(N([]),2),x=E[0],w=E[1],C=S((function(){var t;return e.init(be(y,i)),d(e.tabs),r?e.menus():[{id:0,text:"",state:"open",children:e.menusById(h||i[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]}),[y,r,h]),k=S((function(){return e.init(be(y,i)),e.menus()}),[y,r]),_=S((function(){for(var t=[],n=0;n<x.length;n++){var r=x[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==c,type:2})}for(var o=0;o<a.length;o++){var i=e.getItemById(a[o]);i&&t.push({id:i.id,path:i.path,closable:!0,title:i.text,selected:i.id==c,type:1})}return t}),[y,a,c]);return O((function(){m(f().mark((function e(){var t,n;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,lt.menus();case 2:t=e.sent,n=t.data,b(n.sidebar),w(n.welcome);case 6:case"end":return e.stop()}}),e)})))()}),[]),{collapsed:r,menuList:C,menuAll:k,onMenuSelection:function(r){if(r){var o=e.searchPathIndex(r.id);t(ur({id:r.id,choices:o})),n({pathname:r.path})}},menuArea:s,setMenuAreaId:v,choiceId:c,menuTabList:_,onTabClosed:function(n){var r=n.props.id;t(fr({id:r}));var o=e.searchPathIndex(c);t(dr({choices:o}))},onTabSelected:function(r){var o=e.searchPathIndex(r.id);t(ur({id:r.id,choices:o})),n({pathname:r.path})}}}function hr(){var e={location:je(),history:Xn((function(e){return e.app.historyLocation})),isGuest:function(){return Kn.isGuest()},saveHistoryLocation:function(e){return Gn.saveHistoryLocation(e)}};return Ve(e)}function vr(){var e=Ee().locale,t=u(N(),2),n=t[0],r=t[1],o=hr();return D((function(){fe(e,(function(){r(pe())})),o.autoRedirect()}),[]),D((function(){r(pe())}),[e]),{easyuiLangPkg:n}}function gr(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=Le(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:Kn.can,OrCan:Kn.orCan,Permissions:Kn.permissions}),a=Xn((function(e){return e.user.version})),i=u(N({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],l=i[1];return Me({value:c,setValue:l,config:e,checkaccess:o,dependency:r,version:a})}function yr(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=Le(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:Kn.can,OrCan:Kn.orCan,Permissions:Kn.permissions}),a=Xn((function(e){return e.user.version})),i=u(N({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],l=i[1];return Fe({value:c,setValue:l,config:e,checkaccess:o,dependency:r,version:a})}lr.justSaveChoice,function(e){function t(){var e,t,n=null!==(e=null===(t=Yn.getState().user)||void 0===t?void 0:t.info)&&void 0!==e?e:{};return 9==T(n,"type",0)}e.isGuest=function(){var e,t=null===(e=Yn.getState().user)||void 0===e?void 0:e.token;return!t||0===t.length},e.isSuper=t,e.token=function(){var e=Yn.getState().user;return T(e,"token","")},e.info=function(){var e=Yn.getState().user;return T(e,"info",{})},e.logout=function(e){Yn.dispatch(Zn(e))},e.permissions=function(){return Yn.getState().user.permissions},e.loadPermissions=function(e){Yn.dispatch(er(e||[]))},e.incrementVersion=function(){Yn.dispatch(tr({}))},e.can=function(){var e;if(t())return!0;var n=null===(e=Yn.getState().user)||void 0===e?void 0:e.permissions;if(!n)return!1;for(var r=0;r<arguments.length;r++)if(!n.hasOwnProperty(r<0||arguments.length<=r?void 0:arguments[r]))return!1;return!0},e.orCan=function(){var e;if(t())return!0;var n=null===(e=Yn.getState().user)||void 0===e?void 0:e.permissions;if(!n)return!1;for(var r=0;r<arguments.length;r++)if(n.hasOwnProperty(r<0||arguments.length<=r?void 0:arguments[r]))return!0;return!1},e.clear=function(){Yn.dispatch(pr({})),Yn.dispatch(ir({pathname:"/",hash:"",search:""}))}}(Kn||(Kn={})),(sr=Gn||(Gn={})).locale=function(){var e;return null!==(e=Yn.getState().app.locale)&&void 0!==e?e:"en"},sr.loadLanguageOptions=function(e){Yn.dispatch(ar(e))},sr.saveHistoryLocation=function(e){Yn.dispatch(ir({pathname:e.pathname,hash:e.hash,search:e.search}))};var br=_.createContext({pageConfig:{},fetchConfig:{}}),Er=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),r=e.pageConfig,o=(e.fetchConfig,e.close),a=(e.refs,u(ze(n).toArray(),1)[0]);D((function(){null==t||t.setMethod("onSubmit",i)}),[]);var i=function(){var e={username:a.username,phone:a.phone,password:"123456"};lt.register(e).then((function(e){200===e.code&&(ye.success(de("save success","Message")),t.refresh(),o())}))};return _.createElement(M,{model:a,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"username",label:me(r,"username.label","Username")+":"},_.createElement(z,{placeholder:me(r,"username.placeholder",""),value:a.username})),_.createElement(F,{name:"phone",label:me(r,"phone.label","Phone")+":"},_.createElement(z,{placeholder:me(r,"phone.placeholder",""),value:a.phone})),_.createElement("div",{className:"admin-form-submit"},_.createElement(U,{style:{width:80},onClick:function(){var e;return null==t||null===(e=t.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"icon-save"},he(r,"submit.text","Submit")),_.createElement(U,{style:{width:80},onClick:function(){return null==o?void 0:o()},iconCls:"icon-cancel"},he(r,"cancel.text","Cancel"))))},xr=function(e){var t=e.value,n=e.props,r=e.close,o=A(br),a=o.ctx,i=o.ctxState,c=o.pageConfig,l=o.fetchConfig,u=o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement(Er,b(b({className:"f-full",ctx:a,ctxState:i,pageConfig:c,fetchConfig:l},n),{},{close:r,refs:u})))},wr=function(e){var t=e.ctxState,n=e.ctx;return _.createElement(W,{total:null==t?void 0:t.total,pageNumber:null==t?void 0:t.pageNumber,pageSize:null==t?void 0:t.pageSize,layout:null==t?void 0:t.layout,onPageChange:function(e){var t=e.pageNumber,r=e.pageSize;return null==n?void 0:n.pageChange(t,r)},pageList:null==t?void 0:t.pageSizes,showPageRefresh:!1})},Cr=function(e){return function(t){return function(n){var r=u(N({}),2),o=r[0],a=r[1],i=u(N({}),2),c=i[0],l=i[1],s=u(N(0),2),d=s[0],f=s[1],p=Ee().locale;return D((function(){var t=ve(p,"Page",e.name);document.title=T(t,"title",de("title","App")),a(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then((function(e){var t=e.data;l(t||{}),f(d+1)}))}),[p]),_.createElement(_.Fragment,null,_.createElement(t,b({pageConfig:o,fetchConfig:c,fetchVersion:d},n)))}}},kr=function(e){var n=function(){function n(e){var r;return h(this,n),E(r=t(this,n,[e]),"tabRef",R()),r.state={clicked:!1,data:r.props.data||[],selectedRows:[]},r}return r(n,_.Component),g(n,[{key:"componentDidMount",value:function(){this.setState({selectedRows:this.props.selection||[]})}},{key:"componentDidUpdate",value:function(e){this.props.selection!==e.selection&&this.setState({selectedRows:this.props.selection}),this.props.data!==e.data&&this.setState({data:this.props.data})}},{key:"isChecked",value:function(e){var t=this;if(this.props.idField){var n=this.state.selectedRows.findIndex((function(n){return n[t.props.idField]===e[t.props.idField]}));if(n>=0)return!0}else{if(this.state.selectedRows.indexOf(e)>=0)return!0}return!1}},{key:"isAllChecked",value:function(){var e=this.state,t=e.selectedRows,n=e.data;return!(!t.length||t.length!==n.length)}},{key:"handleRowCheck",value:function(e,t){var n=this;if(!this.state.clicked){var r=this.state.data.indexOf(e),o=this.state.data.slice();if(o.splice(r,1,Object.assign({},e)),this.setState({data:o}),t)this.setState({selectedRows:[].concat(s(this.state.selectedRows),[o[r]])});else{var a=this.state.selectedRows.filter((function(t){if(n.props.idField){if(t[n.props.idField]!==e[n.props.idField])return!0}else if(t!==e)return!0;return!1}));this.setState({selectedRows:a})}this.setState({clicked:!0},(function(){setTimeout((function(){return n.setState({clicked:!1})})),n.props.onSelectionChange&&n.props.onSelectionChange(n.state.selectedRows)}))}}},{key:"handleAllCheck",value:function(e){var t=this;if(!this.state.clicked&&this.state.data){var n=this.state.data.map((function(e){return Object.assign({},e)}));this.setState({data:n,selectedRows:e?n:[],clicked:!0},(function(){setTimeout((function(){return t.setState({clicked:!1})})),t.props.onSelectionChange&&t.props.onSelectionChange(t.state.selectedRows)}))}}},{key:"render",value:function(){var t,n=this;return _.createElement(e,b(b({},this.props),{},{data:this.state.data}),_.createElement(B,{key:"ck_column_key",width:null!==(t=this.props.ckWidth)&&void 0!==t?t:20,align:"center",field:"ck",render:function(e){var t=e.row;return _.createElement(q,{checked:n.isChecked(t),onChange:function(e){return n.handleRowCheck(t,e)}})},header:function(){return _.createElement(q,{checked:n.isAllChecked(),onChange:function(e){return n.handleAllCheck(e)}})},filter:function(){return _.createElement("span",null)}}),this.props.children)}}])}();return n},_r=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{username:"",phone:""}),o=u(N(r),2),a=o[0],i=o[1],c=u(N(0),2),l=c[0],s=c[1],d=function(){s((function(e){return e+1}))};return _.createElement(M,{className:"admin-search-panel",labelWidth:"auto",model:a,key:l,onChange:function(e,t){i(b(b({},a),{},E({},e,t)))},labelPosition:"before"},_.createElement(F,{name:"username",label:me(n,"username.label","Username")},_.createElement(z,{value:a.username})),_.createElement(F,{name:"phone",label:me(n,"phone.label","Phone")},_.createElement(z,{value:a.phone})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:a.username,type:"LIKE",filter_empty:!0},{key:"phone",value:a.phone,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(r),null==t||t.reset(),d()}},he(n,"reset.text","Reset"))))},Nr=kr(K),Sr=function(){var e=A(br),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,o=e.ctxState,a=e.refs,i=(e.version,u(N(0),2)),c=i[0],l=i[1];return D((function(){l(c+1)}),[n]),_.createElement(_.Fragment,null,_.createElement(Nr,{toolbar:function(){var e={record:{username:"",password:""},type:se.CREATE,ctx:r,title:he(t,"add.text","Create Dict")};return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(_r,{ctx:r,pageConfig:t,fetchConfig:n})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},he(t,"refresh.text","Refresh")),_.createElement(xe,{ctx:r,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return I(a,"formDataRefDlg.open",e)}},he(t,"add.text","Add")))))},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",selection:null==o?void 0:o.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},ckWidth:20,key:c},_.createElement(B,{field:"id",title:me(t,"id.label","UserId"),width:"50px"}),_.createElement(B,{field:"username",title:me(t,"username.label","Username"),width:"80px"}),_.createElement(B,{field:"phone",title:me(t,"phone.label","Phone"),width:"60px"}),_.createElement(B,{field:"status",title:me(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return Ge(n,"admin-state",t)}}),_.createElement(B,{field:"type",title:me(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return Ge(n,"admin-type",t)}}),_.createElement(B,{field:"version",title:me(t,"version.label","Version"),width:"60px"}),_.createElement(B,{field:"create_time",title:me(t,"create_time.label","CreateTime"),width:"75px"}),_.createElement(B,{field:"update_time",title:me(t,"update_time.label","UpdateTime"),width:"75px"}),_.createElement(G,{frozen:!0,align:"right",width:"150px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:function(e){e.value;var n=e.row,o=(e.rowIndex,{record:n,ctx:r,type:se.UPDATE,title:"".concat(he(t,"update.text","Update: {#name}")).replace("{#name}",n.username)});return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:r,point:"assign"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"assigndlg.open",{ctx:r,record:n,title:"".concat(he(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})),_.createElement(xe,{ctx:r,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"formDataRefDlg.open",o)},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:r,point:"delete"},_.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:{id:n.id}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},Or=function(e){var t=e.ctx,n=e.record,r=e.pageConfig,o=(e.fetchConfig,e.close),a=u(N(),2),i=a[0],c=a[1],l=u(N([]),2),s=l[0],d=l[1],p=P(null),h=u(N([]),2),v=h[0],g=h[1],y=u(N([]),2),b=y[0],E=y[1],x=P(null);D((function(){null==t||t.setMethod("onSubmit",C),w()}),[]);var w=function(){var e=m(f().mark((function e(){var t,r,o,a,i,l;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ct.roles();case 2:return t=e.sent,r=Qe(t.data||[]),o=[],e.next=7,ct.permissions();case 7:a=e.sent,i=Xe(a.data||[]),l=[],ct.getPermissionsByUser(n.id).then((function(e){var t=e.code,n=e.data;if(200===t){var r=new Set;n&&n.forEach((function(e){r.add(e.name),1==e.item_type?b.push(e.name):s.push(e.name)})),$e(i,r,l),c(i),l.forEach((function(e){p.current.checkNode(e)}))}})),ct.getRolesByUser(n.id).then((function(e){var t=e.code,n=e.data;if(200===t){var a=new Set;n&&n.forEach((function(e){a.add(e.name),1==e.item_type?b.push(e.name):s.push(e.name)})),$e(r,a,o),g(r),o.forEach((function(e){x.current.checkNode(e)}))}}));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),C=function(){ct.assignItemToUser({id:n.id,roles:b,permissions:s}).then((function(e){200===e.code&&($toast.success(he(r,"assign_success","assign permission successfully!")),o())}))};return _.createElement(H,{style:{width:800,height:500}},_.createElement(X,{region:"west",style:{width:220}},_.createElement($,{bodyStyle:{padding:"10px",height:"100%"}},_.createElement(Q,{selectLeafOnly:!0,checkbox:!0,data:v,ref:x,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),E(t)}}}))),_.createElement(X,{region:"center",style:{height:"100%"}},_.createElement($,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return _.createElement(z,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){p.current.doFilter(e)}})}},_.createElement(Q,{selectLeafOnly:!0,checkbox:!0,data:i,ref:p,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),d(t)}}}))),_.createElement(X,{region:"south"},_.createElement("div",{className:"dialog-button"},_.createElement(U,{style:{width:80},onClick:C}," ",he(r,"submit.text","Submit")," "),_.createElement(U,{style:{width:80},onClick:o}," ",he(r,"close.text","Close")," "))))},Dr=function(e){var t=e.value,n=e.props,r=e.close,o=A(br),a=o.ctx,i=o.pageConfig,c=o.fetchConfig;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement(Or,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r})))},Ar="admin",Rr=[{type:ue.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(s(Ye(Ar))),Pr=Cr({name:"Admin",fetchConfig:function(){return it.configs(Ar)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=yr({name:Ar,fetch:function(e){return it.list(Ar,e)},checkAccessItems:Rr,defaultPageSize:30});r.ctx.registerEvent("remove",He(r.ctx));var o=we(),a=we();return D((function(){r.ctx.search()}),[r.version]),_.createElement(br.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o,assigndlg:a}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:r.ctx,ctxState:r.ctxState})}},_.createElement(xr,b({},o)),_.createElement(Dr,b({},a)),_.createElement(Sr,null)))})),Tr=function(){return _.createElement("h1",null,"Home!!!!!!!")},jr=_.createContext({pageConfig:{},fetchConfig:{}});var Ir=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,o=function(){var e=u(N(0),2),t=e[0],n=e[1];return[t,function(){n((function(e){return e+1}))}]}(),a=u(o,2),i=a[0],c=a[1],l={position:void 0,active:void 0,title:"",type:void 0},s=u(N(l),2),d=s[0],f=s[1];return _.createElement(M,{className:"admin-search-panel",model:d,labelWidth:"auto",key:i,labelPosition:"before"},_.createElement(F,{name:"title",label:me(n,"title.label","Title")},_.createElement(z,{value:d.title})),_.createElement(F,{name:"active",label:me(n,"active.label","Active")},_.createElement(J,{data:tt(r,"switch-state"),value:d.active})),_.createElement(F,{name:"type",label:me(n,"type.label","Type")},_.createElement(J,{data:tt(r,"setting-type"),value:d.type})),_.createElement(F,{name:"position",label:me(n,"position.label","Position")},_.createElement(J,{data:tt(r,"setting-position"),value:d.position})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:d.position,type:"="},{key:"type",value:d.type,type:"="},{key:"active",value:d.active,type:"="},{key:"title",value:d.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){f(b({},l)),null==t||t.reset(),c()}},he(n,"reset.text","Reset"))))},Vr=function(e){var t=e.pageVersion,n=A(jr),r=n.pageConfig,o=n.fetchConfig,a=n.ctx,i=n.ctxState,c=n.refs;return _.createElement(Z,{toolbar:function(){return function(e,t,n,r){return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(Ir,{ctx:n,pageConfig:e,fetchConfig:t})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()}},he(e,"refresh.text","Refresh")),_.createElement(xe,{ctx:n,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return I(r,"formdlg.open",{type:se.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:he(e,"add.text","Create Setting")})}},he(e,"add.text","Add")))))}(r,o,a,c)},data:null==i?void 0:i.data,loading:null==i?void 0:i.loading,style:null==i?void 0:i.style,idField:"id",treeField:"title",key:"tree-table-"+t},_.createElement(B,{field:"title",title:me(r,"title.label","Title"),width:"220px"}),_.createElement(B,{field:"icon",title:me(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return _.createElement("span",{className:"iconfont "+t})}}),_.createElement(B,{field:"active",title:me(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return Ge(o,"switch-state",t)}}),_.createElement(B,{field:"position",title:me(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return Ge(o,"setting-position",t)}}),_.createElement(B,{field:"type",title:me(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return Ge(o,"setting-type",t)}}),_.createElement(B,{field:"router_name",title:me(r,"router_name.label","RouterName"),align:"left",render:We,width:"180px"}),_.createElement(B,{field:"url",title:me(r,"url.label","URL"),align:"left",width:"300px"}),_.createElement(B,{field:"sort",title:me(r,"sort.label","Sort"),align:"left",width:"80px"}),_.createElement(B,{field:"create_time",title:me(r,"create_time.label","CreateTime"),width:"180px"}),_.createElement(B,{field:"update_time",title:me(r,"update_time.label","UpdateTime"),width:"180px"}),_.createElement(G,{frozen:!0,align:"right",width:"80px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:a,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(c,"formdlg.open",{ctx:a,record:t,type:se.UPDATE,title:"".concat(he(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:a,point:"delete"},_.createElement(U,{onClick:function(){return null==a?void 0:a.publish("remove",{id:t.id})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Lr=function(e){var t=e.ctx,n=e.type,r=e.record,o=e.pageConfig,a=e.fetchConfig,i=e.close,c=e.refs,l=u(N(r),2),s=l[0],d=l[1],f=S((function(){var e;return new De(null==t||null===(e=t.getMethod("getOriginalData"))||void 0===e?void 0:e()).tree(0,(function(e){return{id:e.id,text:e.title,children:[]}}),{id:0,text:he(o,"none_parent","None Parent"),children:[]})}),[t.config.data]);D((function(){t.setMethod("submitForm",p),t.setMethod("setRouterNameValue",(function(e){var t=e.row;e.column;d(b(b({},s),{},{router_name:t.name,url:t.url})),I(c,"routerlistdlg.close")}))}),[]);var p=function(){var e={object:{id:parseInt(s.id),title:s.title,router_name:s.router_name,icon:s.icon,active:parseInt(s.active),position:parseInt(s.position),type:parseInt(s.type),sort:parseInt(s.sort),pid:parseInt(s.pid),url:s.url},conditions:[]};n===se.UPDATE&&e.conditions.push({key:"id",value:r.id}),it.saveResult(null==t?void 0:t.name(),n,e,(function(){ye.success(de("save_success","Message")),t.refresh(),i()})).then((function(e){}))};return _.createElement(M,{model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"},onChange:function(e,t){d(b(b({},s),{},E({},e,t)))}},_.createElement(F,{name:"title",label:me(o,"title.label","Title")+":"},_.createElement(z,{placeholder:me(o,"title.placeholder",""),value:s.title})),_.createElement(F,{name:"router_name",label:me(o,"router_name.label","Router Name")+":"},_.createElement(z,{placeholder:me(o,"router_name.placeholder",""),value:s.router_name,addonRight:function(){var e={title:he(o,"router_title","Router List")};return _.createElement("span",{style:{paddingLeft:"8px"}},_.createElement("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return I(c,"routerlistdlg.open",e)}}))}})),_.createElement(F,{name:"icon",label:me(o,"icon.label","Icon")+":"},_.createElement(z,{placeholder:me(o,"icon.placeholder",""),value:s.icon})),_.createElement(F,{name:"active",label:me(o,"active.label","Status")+":"},_.createElement("div",null,tt(a,"switch-state").map((function(e){return _.createElement("span",{key:e.value},_.createElement(ee,{value:e.value,groupValue:s.active+"",inputId:"active-"+e.value}),_.createElement(te,{htmlFor:"active-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),_.createElement(F,{name:"type",label:me(o,"type.label","Type")+":"},_.createElement("div",null,tt(a,"setting-type").map((function(e){return _.createElement("span",{key:e.value},_.createElement(ee,{value:e.value,groupValue:s.type+"",inputId:"type-"+e.value}),_.createElement(te,{htmlFor:"type-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),_.createElement(F,{name:"position",label:me(o,"position.label","Position")+":"},_.createElement("div",null,tt(a,"setting-position").map((function(e){return _.createElement("span",{key:e.value},_.createElement(ee,{value:e.value,groupValue:s.position+"",inputId:"position-"+e.value}),_.createElement(te,{htmlFor:"position-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),_.createElement(F,{name:"sort",label:me(o,"sort.label","Sort")+":"},_.createElement(ne,{placeholder:me(o,"sort.placeholder",""),value:s.sort})),_.createElement(F,{name:"pid",label:me(o,"pid.label","Pid")+":"},_.createElement(re,{placeholder:me(o,"pid.placeholder",""),editable:!0,data:f,value:s.pid,onChange:function(e){return d(b(b({},s),{},{pid:e}))}})),_.createElement("div",{className:"yp-form-submit"},_.createElement(U,{style:{width:80},onClick:p},he(o,"submit.text","Submit")),_.createElement(U,{style:{width:80},onClick:i},he(o,"close.text","Close"))))},Mr=_.createContext({pageConfig:{},fetchConfig:{}}),Fr=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,o={name:"",type:""},a=u(N(o),2),i=a[0],c=a[1],l=u(N(0),2),s=l[0];l[1];return _.createElement(M,{className:"admin-search-panel",model:i,key:s,labelWidth:"auto",labelPosition:"before"},_.createElement(F,{name:"name",label:me(n,"name.label","Name")},_.createElement(z,{value:i.name})),_.createElement(F,{name:"type",label:me(n,"type.label","Type")},_.createElement(J,{data:tt(r,"router-type"),value:i.type})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:i.name,type:"LIKE"},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(b({},o)),null==t||t.reset()}},he(n,"reset.text","Reset"))))},zr=function(e){var t=e.selectedRow,n=e.scene,r=A(Mr),o=r.pageConfig,a=r.fetchConfig,i=r.ctx,c=r.ctxState,l=r.refs,s=u(N(0),2),d=s[0],f=s[1],p=function(){return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(Fr,{ctx:i,pageConfig:o,fetchConfig:a})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==i?void 0:i.refresh()}},he(o,"refresh.text","Refresh")),_.createElement(xe,{ctx:i,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return I(l,"formDataRefDlg.open",{type:se.CREATE,ctx:i,record:{name:""},title:he(o,"add.text","Create Router")})}},he(o,"add.text","Add")))))},m=function(e){e.value;var t=e.row;e.rowIndex;return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:i,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(l,"formDataRefDlg.open",{ctx:i,record:t,type:se.UPDATE,title:"".concat(he(o,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:i,point:"delete"},_.createElement(U,{onClick:function(){return null==i?void 0:i.publish("remove",[{key:"name",value:t.name},{key:"type",value:t.type}])},plain:!0,iconCls:"iconfont icon-del color-red"})))};return D((function(){f(d+1)}),[a]),"setting"===n?_.createElement(K,{toolbar:p,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,onCellDblClick:t,key:d},_.createElement(B,{field:"name",title:me(o,"name.label","Name"),render:We}),_.createElement(B,{field:"url",title:me(o,"type.label","URL"),align:"center",render:We}),_.createElement(B,{field:"type",title:me(o,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return Ge(a,"router-type",t)}}),_.createElement(G,{frozen:!0,align:"right",width:"120px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:m,width:"120px"})))):_.createElement(K,{toolbar:p,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,key:d},_.createElement(B,{field:"name",title:me(o,"name.label","Name"),render:We}),_.createElement(B,{field:"url",title:me(o,"type.label","URL"),align:"center",render:We}),_.createElement(B,{field:"type",title:me(o,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return Ge(a,"router-type",t)}}),_.createElement(B,{field:"data",title:me(o,"data.label","Data")}),_.createElement(B,{field:"create_time",title:me(o,"create_time.label","CreateTime"),width:"180px"}),_.createElement(B,{field:"update_time",title:me(o,"update_time.label","UpdateTime"),width:"180px"}),_.createElement(G,{frozen:!0,align:"right",width:"120px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:m,width:"120px"}))))},Ur=function(e){var t=e.ctx,n=e.type,r=e.record,o=e.pageConfig,a=e.fetchConfig,i=e.close,c=(e.refs,u(N(r),2)),l=c[0],s=c[1];D((function(){null==t||t.setMethod("onSubmit",d)}),[]);var d=function(){var e={object:{name:l.name,url:l.url,type:l.type,data:l.data},conditions:[]};n===se.UPDATE&&(e.conditions.push({key:"name",value:r.name}),e.conditions.push({key:"type",value:r.type})),it.saveResult(null==t?void 0:t.name(),n,e,(function(){ye.success(de("save_success","Message")),t.refresh(),i()})).then((function(e){}))};return _.createElement(M,{model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},onChange:function(e,t){s(b(b({},l),{},E({},e,t)))},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"name",label:me(o,"name.label","Name")+":"},_.createElement(z,{placeholder:me(o,"name.placeholder",""),value:l.name})),_.createElement(F,{name:"url",label:me(o,"url.label","Url")+":"},_.createElement(z,{placeholder:me(o,"url.placeholder",""),value:l.url})),_.createElement(F,{name:"type",label:me(o,"type.label","Type")+":"},_.createElement("div",null,tt(a,"router-type").map((function(e){return _.createElement("span",{key:e.value},_.createElement(ee,{value:e.value,groupValue:l.type+"",inputId:"type-"+e.value,disabled:n===se.UPDATE}),_.createElement(te,{htmlFor:"type-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),_.createElement(F,{name:"data",label:me(o,"data.label","Data")+":"},_.createElement(z,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:me(o,"data.placeholder",""),value:l.data})),_.createElement("div",{className:"admin-form-submit"},_.createElement(U,{style:{width:80},onClick:d},he(o,"submit.text","Submit")),_.createElement(U,{style:{width:80},onClick:i},he(o,"close.text","Close"))))},Wr=function(e){var t=e.value,n=e.props,r=e.close,o=A(Mr),a=o.ctx,i=o.pageConfig,c=o.fetchConfig,l=o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0},_.createElement(Ur,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:l})))},Br="router",qr=[{type:ue.AND,value:["/resource/router/add"],key:"add"},{type:ue.AND,value:["/resource/router/update"],key:"update"},{type:ue.AND,value:["/resource/router/delete"],key:"delete"},{type:ue.AND,value:["/resource/router/edit"],key:"edit"}],Kr=Cr({name:"Router",fetchConfig:function(){return it.configs(Br)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,o=e.scene,a=yr({name:Br,fetch:function(e){return it.list(Br,e)},checkAccessItems:qr,defaultPageSize:20});D((function(){a.ctx.search()}),[a.version]),a.ctx.registerEvent("remove",He(a.ctx));var i=we();return _.createElement(Mr.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:i}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:a.ctx,ctxState:a.ctxState})}},_.createElement(Wr,b({},i)),_.createElement(zr,{selectedRow:r,scene:o})))})),Gr=function(e){var t=e.value,n=e.props,r=e.close,o=A(jr),a=o.ctx,i=o.pageConfig,c=o.fetchConfig,l=o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement(Lr,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:l})))},Yr=function(e){var t=e.value,n=e.props,r=(e.close,A(jr).ctx);return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},_.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},_.createElement(Kr,{selectedRow:function(e){var t,n=e.row,o=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:o})},scene:"setting"})))},Hr="setting",Xr=[{type:ue.AND,value:["/resource/setting/add"],key:"add"},{type:ue.AND,value:["/resource/setting/update"],key:"update"},{type:ue.AND,value:["/resource/setting/delete"],key:"delete"},{type:ue.AND,value:["/resource/setting/edit"],key:"edit"}],$r=Cr({name:"Setting",fetchConfig:function(){return it.configs(Hr)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,o=gr({name:Hr,fetch:function(e){return it.list(Hr,e)},checkAccessItems:Xr,defaultPageSize:10,isTreeData:!0});o.ctx.registerEvent("remove",He(o.ctx));var a=we(),i=we();return D((function(){o.ctx.search()}),[]),_.createElement(jr.Provider,{value:{ctx:o.ctx,ctxState:o.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,routerlistdlg:i}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:o.ctx,ctxState:o.ctxState})}},_.createElement(Gr,b({},a)),_.createElement(Yr,b({},i)),_.createElement(Vr,{pageVersion:r})))})),Qr=new(function(){return g((function e(){h(this,e)}),[{key:"captcha",value:function(){return nt().post(ot("loginCaptcha"))}},{key:"login",value:(e=m(f().mark((function e(t,n,r){var o,a,i;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,nt().post(ot("loginSubmit"),t);case 2:o=e.sent,a=o.code,i=o.data,200===a?n(i,a):r(i,a);case 6:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return nt().post(ot("loginConfig"))}}]);var e}()),Jr=function(e){var t=e.pageConfig,n=e.rules,r=Hn(),o=u(N({username:"",captcha:"",password:"",code:"",token:""}),2),a=o[0],i=o[1],c=hr(),l=function(){Qr.captcha().then((function(e){var t=e.data;i(b(b({},a),{},{captcha:t.base64,token:t.token,code:""}))}))};return D((function(){l(),c.autoRedirect()}),[]),_.createElement(M,{model:a,labelWidth:0,labelAlign:"right",errorType:"tooltip",rules:null!=n?n:{username:{required:!0},password:{required:!0},code:{required:!0}},style:{maxWidth:500}},_.createElement(F,{name:"username"},_.createElement(z,{iconCls:"iconfont "+T(t.fields,"username.icon","icon-username"),placeholder:T(t.fields,"username.placeholder","username..."),value:a.username})),_.createElement(F,{name:"password"},_.createElement(oe,{iconCls:"iconfont "+T(t.fields,"password.icon","icon-password"),placeholder:T(t.fields,"password.placeholder","password..."),value:a.password})),_.createElement(F,{name:"code"},_.createElement(z,{iconCls:"iconfont "+T(t.fields,"code.icon","icon-captcha"),placeholder:T(t.fields,"code.placeholder","verification code..."),value:a.code,addonRight:function(){return _.createElement("img",{src:a.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:l})}})),_.createElement(F,null,_.createElement(U,{onClick:function(){var e={code:a.code,username:a.username,password:a.password,token:a.token};Qr.login(e,(function(e){r(Jn({token:e.token,info:e.user,error:function(){ye.error(T(t.params,"tips.loginError"))}})),c.autoRedirect()}),(function(){l()}))},btnCls:"login_btn"},T(t.params,"submit.text","Sign In"))))},Zr=function(){var e=Ee(!0),t=e.localeOptions,n=e.changeLocale;return _.createElement(ae,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return _.createElement(ie,null,Object.keys(t).map((function(e,n){return _.createElement(ce,{text:t[e],key:n,value:e})})))},onMenuItemClick:n})},eo=Cr({name:"Login",fetchConfig:Qr.configs})((function(e){var t,n=e.pageConfig,r=e.fetchConfig,o=e.rules;return _.createElement("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{}},_.createElement(Zr,null),_.createElement("div",{className:"login layui-anim layui-anim-up"},_.createElement("h1",null,null!==(t=r.title)&&void 0!==t?t:n.title),_.createElement(Jr,{pageConfig:n,fetchConfig:r,rules:o})))})),to=_.createContext({pageConfig:{},fetchConfig:{}}),no=function(e){var t=e.ctx,n=(e.type,e.record),r=e.pageConfig,o=(e.fetchConfig,e.close),a=u(N(),2),i=a[0],c=a[1],l=u(N([]),2),d=l[0],p=l[1],h=P(null),v=u(N([]),2),g=v[0],y=v[1],b=u(N([]),2),E=b[0],x=b[1],w=P(null);D((function(){null==t||t.setMethod("onSubmit",k),C()}),[]);var C=function(){var e=m(f().mark((function e(){var t,r,o,a,i,l,u,s,p,m;return f().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ct.roles();case 2:return t=e.sent,r=Qe(t.data||[]),o=[],e.next=7,ct.permissions();case 7:return a=e.sent,i=Xe(a.data||[]),l=[],e.next=12,ct.getChildren({name:n.name});case 12:u=e.sent,s=u.code,p=u.data,200===s&&(m=new Set,p&&p.forEach((function(e){m.add(e.name),1==e.item_type?E.push(e.name):d.push(e.name)})),$e(i,m,l),c(i),l.forEach((function(e){h.current.checkNode(e)})),$e(r,m,o),y(r),o.forEach((function(e){w.current.checkNode(e)})));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),k=function(){ct.addPermissionChildren({name:n.name,children:[].concat(s(d),s(E))}).then((function(e){200===e.code&&($toast.success(he(r,"assign_success","assign permission successfully!")),o())}))};return _.createElement(H,{style:{width:800,height:500}},_.createElement(X,{region:"west",style:{width:220}},_.createElement($,{bodyStyle:{padding:"10px",height:"100%"}},_.createElement(Q,{selectLeafOnly:!0,checkbox:!0,data:g,ref:w,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),x(t)}}}))),_.createElement(X,{region:"center",style:{height:"100%"}},_.createElement($,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return _.createElement(z,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){h.current.doFilter(e)}})}},_.createElement(Q,{selectLeafOnly:!0,checkbox:!0,data:i,ref:h,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),p(t)}}}))),_.createElement(X,{region:"south"},_.createElement("div",{className:"dialog-button"},_.createElement(U,{style:{width:80},onClick:k}," ",he(r,"submit.text","Submit")," "),_.createElement(U,{style:{width:80},onClick:o}," ",he(r,"close.text","Close")," "))))},ro=function(e){var t=e.value,n=e.props,r=e.close,o=A(to),a=o.ctx,i=o.pageConfig,c=o.fetchConfig;o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement(no,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r})))},oo=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),o=u(N(r),2),a=o[0],i=o[1],c=u(N(0),2),l=c[0],s=c[1],d=function(){s((function(e){return e+1}))};return _.createElement(M,{className:"admin-search-panel",model:a,key:l,labelWidth:"auto",labelPosition:"before"},_.createElement(F,{name:"name",label:me(n,"name.label","Name")},_.createElement(z,{value:a.name})),_.createElement(F,{name:"description",label:me(n,"description.label","Description")},_.createElement(z,{value:a.description})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:a.name,type:"LIKE"},{key:"description",value:a.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(b({},r)),null==t||t.reset(),d()}},he(n,"reset.text","Reset"))))},ao=kr(K),io=function(){var e=A(to),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,o=e.ctxState,a=e.refs,i=e.version;return _.createElement(ao,{toolbar:function(){return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(oo,{ctx:r,pageConfig:t,fetchConfig:n})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},he(t,"refresh.text","Refresh")),_.createElement(xe,{ctx:r,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){I(a,"formdlg.open",{type:se.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:he(t,"add.text","Create Role")})}},he(t,"add.text","Add"))),_.createElement(xe,{ctx:r,point:"batch-delete"},_.createElement(U,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?ye.error(de("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ct.batchDeleteRole,params:{names:r.tableSlectionValue()}})}},he(t,"batch_remove.text","Batch Remove")))))},data:(null==o?void 0:o.data)||[],loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"name",selection:null==o?void 0:o.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},key:i},_.createElement(B,{field:"name",title:me(t,"name.label","Name"),width:"220px"}),_.createElement(B,{field:"rule_name",title:me(t,"rule_name.label","RuleName"),align:"left",render:We,width:"180px"}),_.createElement(B,{field:"description",title:me(t,"description.label","Description"),align:"left",render:We,width:"180px"}),_.createElement(B,{field:"create_time",title:me(t,"create_time.label","CreateTime"),width:"180px",render:qe,sortable:!0}),_.createElement(B,{field:"update_time",title:me(t,"update_time.label","UpdateTime"),width:"180px",render:qe}),_.createElement(G,{frozen:!0,align:"right",width:"100px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:r,point:"assign-permission"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"assigndlg.open",{ctx:r,record:n,title:"".concat(he(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})),_.createElement(xe,{ctx:r,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"formdlg.open",{ctx:r,record:n,type:se.UPDATE,title:"".concat(he(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:r,point:"delete"},_.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ct.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},co=function(e){var t=e.ctx,n=e.type,r=e.record,o=e.pageConfig,a=(e.fetchConfig,e.close),i=u(ze(r).toArray(),2),c=i[0],l=i[1],s=u(ze(r).toArray(),1)[0];D((function(){t.setMethod("onSubmit",d)}),[]);var d=function(){n===se.CREATE&&ct.addRole(c).then((function(e){var n=e.code;e.data;200==n&&(ye.success(de("add_role_success","Message","add role successfully!")),t.refresh(),a())})),n===se.UPDATE&&ct.updateRole({source_name:s.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then((function(e){var n=e.code;e.data;200==n&&(ye.success(de("update_role_success","Message","update role successfully!")),t.refresh(),a())}))};return _.createElement(M,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},onChange:function(e,t){l(b(b({},c),{},E({},e,t)))},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"name",label:me(o,"name.label","Name")+":"},_.createElement(z,{placeholder:me(o,"name.placeholder",""),value:c.name})),_.createElement(F,{name:"description",label:me(o,"description.label","Description")+":"},_.createElement(z,{multiline:!0,placeholder:me(o,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),_.createElement("div",{className:"admin-form-submit"},_.createElement(U,{style:{width:80},iconCls:"icon-save",onClick:d},he(o,"submit.text","Submit")),_.createElement(U,{style:{width:80},iconCls:"icon-cancel",onClick:a},he(o,"close.text","Close"))))},lo=function(e){var t=e.value,n=e.props,r=e.close,o=A(to),a=o.ctx,i=o.pageConfig,c=o.fetchConfig;o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement(co,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r})))},uo=[{type:ue.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:ue.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:ue.AND,value:["/rbac/add-role"],key:"add"},{type:ue.AND,value:["/rbac/update-role"],key:"update"},{type:ue.AND,value:["/rbac/delete-role"],key:"delete"}],so=Cr({name:"Roles"})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=yr({name:"roles",fetch:function(e){return ct.roles()},checkAccessItems:uo,defaultPageSize:30,selectionValue:function(e){return e.name}});D((function(){r.ctx.search()}),[r.version]),r.ctx.registerEvent("remove",He(r.ctx));var o=we(),a=we();return _.createElement(to.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:o,assigndlg:a}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:r.ctx,ctxState:r.ctxState})}},_.createElement(lo,b({},o)),_.createElement(ro,b({},a)),_.createElement(io,null)))})),fo=_.createContext({pageConfig:{},fetchConfig:{}}),po=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),o=u(N(r),2),a=o[0],i=o[1],c=u(N(0),2),l=c[0],s=c[1],d=function(){s((function(e){return e+1}))};return _.createElement(M,{className:"admin-search-panel",model:a,labelWidth:"auto",labelPosition:"before",key:l},_.createElement(F,{name:"name",label:me(n,"name.label","Name")},_.createElement(z,{value:a.name})),_.createElement(F,{name:"description",label:me(n,"description.label","Description")},_.createElement(z,{value:a.description})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:a.name,type:"LIKE"},{key:"description",value:a.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(b({},r)),null==t||t.reset(),d()}},he(n,"reset.text","Reset"))))},mo=kr(K),ho=function(){var e=A(fo),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,o=e.ctxState,a=e.refs,i=e.version;return _.createElement(mo,{toolbar:function(){return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(po,{ctx:r,pageConfig:t,fetchConfig:n})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},he(t,"refresh.text","Refresh")),_.createElement(xe,{ctx:r,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){I(a,"formdlg.open",{type:se.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:he(t,"add.text","Create Role")})}},he(t,"add.text","Add"))),_.createElement(xe,{ctx:r,point:"batch-delete"},_.createElement(U,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?ye.error(de("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:ct.batchDeletePermission,params:{names:r.tableSlectionValue()}})}},he(t,"batch_remove.text","Batch Remove"))),_.createElement(xe,{ctx:r,point:"fast-add-permission"},_.createElement(U,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){I(a,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:he(t,"fast_add.text","Fast Add")})}},he(t,"fast_add.text","Fast Add")))))},data:(null==o?void 0:o.data)||[],idField:"name",selection:null==o?void 0:o.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,lazy:!0,key:i},_.createElement(B,{field:"name",title:me(t,"name.label","Name"),width:"220px"}),_.createElement(B,{field:"rule_name",title:me(t,"rule_name.label","RuleName"),align:"left",render:We,width:"180px"}),_.createElement(B,{field:"description",title:me(t,"description.label","Description"),align:"left",render:We,width:"180px"}),_.createElement(B,{field:"create_time",title:me(t,"create_time.label","CreateTime"),width:"180px",render:qe,sortable:!0}),_.createElement(B,{field:"update_time",title:me(t,"update_time.label","UpdateTime"),width:"180px",render:qe,sortable:!0}),_.createElement(G,{frozen:!0,align:"right",width:"80px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:r,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"formdlg.open",{ctx:r,record:n,type:se.UPDATE,title:"".concat(he(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:r,point:"delete"},_.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:ct.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},vo=function(e){var t=e.ctx,n=e.type,r=e.record,o=e.pageConfig,a=(e.fetchConfig,e.close),i=u(N(r),2),c=i[0],l=i[1],s=u(ze(r).toArray(),1)[0];D((function(){null==t||t.setMethod("onSubmit",d)}),[]);var d=function(){n===se.CREATE&&ct.addPermission(c).then((function(e){var n=e.code;e.data;200==n&&(t.refresh(),a())})),n===se.UPDATE&&ct.updatePermission({source_name:s.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then((function(e){var n=e.code;e.data;200==n&&(t.refresh(),a())}))};return _.createElement(M,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},onChange:function(e,t){l(b(b({},c),{},E({},e,t)))},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"name",label:me(o,"name.label","Name")+":"},_.createElement(z,{placeholder:me(o,"name.placeholder",""),value:c.name})),_.createElement(F,{name:"description",label:me(o,"description.label","Description")+":"},_.createElement(z,{multiline:!0,placeholder:me(o,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),_.createElement("div",{className:"admin-form-submit"},_.createElement(U,{style:{width:80},iconCls:"icon-save",onClick:d},he(o,"submit.text","Submit")),_.createElement(U,{style:{width:80},iconCls:"icon-cancel",onClick:a},he(o,"close.text","Close"))))},go=function(e){var t=e.value,n=e.props,r=e.close,o=A(fo),a=o.ctx,i=o.pageConfig,c=o.fetchConfig;o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0},_.createElement(vo,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r})))},yo=function(e){var t=e.ctx,n=(e.type,e.record),r=e.pageConfig,o=(e.fetchConfig,e.close),a=u(ze(n).toArray(),1)[0];D((function(){null==t||t.setMethod("onSubmit",i)}),[]);var i=function(){var e={resource:a.resource,name:a.name};ct.fastAddPermission(e).then((function(e){200===e.code&&(ye.success(de("save_success","Message","Save Success!")),t.refresh(),o())}))};return _.createElement(M,{model:a,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"resource",label:me(r,"fast_add_resource.label","Resource")+":"},_.createElement(z,{placeholder:me(r,"fast_add_resource.placeholder",""),value:a.resource})),_.createElement(F,{name:"name",label:me(r,"fast_add_name.label","Name")+":"},_.createElement(z,{placeholder:me(r,"fast_add_name.placeholder",""),value:a.name})),_.createElement("div",{className:"admin-form-submit"},_.createElement(U,{style:{width:80},iconCls:"icon-save",onClick:i},he(r,"submit.text","Submit")),_.createElement(U,{style:{width:80},iconCls:"icon-cancel",onClick:o},he(r,"close.text","Close"))))},bo=function(e){var t=e.value,n=e.props,r=e.close,o=A(fo),a=o.ctx,i=o.pageConfig,c=o.fetchConfig;o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement(yo,b(b({className:"f-full",ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r})))},Eo=[{type:ue.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:ue.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:ue.AND,value:["/rbac/add-permission"],key:"add"},{type:ue.AND,value:["/rbac/update-permission"],key:"update"},{type:ue.AND,value:["/rbac/delete-permission"],key:"delete"}],xo=Cr({name:"Permissions"})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=gr({name:"permissions",fetch:function(e){return ct.permissions()},checkAccessItems:Eo,defaultPageSize:50,selectionValue:function(e){return e.name}});D((function(){r.ctx.search()}),[r.version]);var o=we(),a=we();return r.ctx.registerEvent("remove",He(r.ctx)),_.createElement(fo.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:o,fastadddlg:a}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:r.ctx,ctxState:r.ctxState})}},_.createElement(go,b({},o)),_.createElement(bo,b({},a)),_.createElement(ho,null)))})),wo=_.createContext({pageConfig:{},fetchConfig:{}}),Co=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",sign:""}),o=u(N(r),2),a=o[0],i=o[1],c=u(N(0),2),l=c[0],s=c[1],d=function(){s((function(e){return e+1}))};return _.createElement(M,{className:"admin-search-panel",labelWidth:"auto",key:l,model:a,onChange:function(e,t){i(b(b({},a),{},E({},e,t)))},labelPosition:"before"},_.createElement(F,{name:"name",label:me(n,"name.label","Name")},_.createElement(z,{value:a.name})),_.createElement(F,{name:"sign",label:me(n,"sign.label","Sign")},_.createElement(z,{value:a.sign})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:a.name,type:"LIKE",filter_empty:!0},{key:"sign",value:a.sign,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(r),null==t||t.reset(),d()}},he(n,"reset.text","Reset"))))},ko=kr(K),_o=function(){var e=A(wo),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,o=e.ctxState,a=e.refs;return _.createElement(_.Fragment,null,_.createElement(ko,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:se.CREATE,ctx:r,title:he(t,"add.text","Create Dict")};return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(Co,{ctx:r,pageConfig:t,fetchConfig:n})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},he(t,"refresh.text","Refresh")),_.createElement(xe,{ctx:r,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return I(a,"formDataRefDlg.open",e)}},he(t,"add.text","Add"))),_.createElement(xe,{ctx:r,point:"delete"},_.createElement(U,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){return null==r?void 0:r.publish("batchRemove",{key:"id",values:r.tableSlectionValue()})}},he(t,"batch_remove.text","Batch Remove")))))},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",selection:null==o?void 0:o.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)}},_.createElement(B,{field:"name",title:me(t,"name.label","Name"),width:"160px"}),_.createElement(B,{field:"sign",title:me(t,"sign.label","Sign"),width:"150px"}),_.createElement(B,{field:"remark",title:me(t,"remark.label","Remark"),width:"180px"}),_.createElement(B,{field:"create_time",title:me(t,"create_time.label","CreateTime"),width:"120px"}),_.createElement(B,{field:"update_time",title:me(t,"update_time.label","UpdateTime"),width:"120px"}),_.createElement(G,{frozen:!0,align:"right",width:"150px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:function(e){e.value;var n=e.row,o=(e.rowIndex,{record:n,ctx:r,type:se.UPDATE,title:"".concat(he(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),i={sign:n.sign,title:he(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:r,point:"items"},_.createElement(V,{content:he(t,"item_list.text","Dict Item"),position:"top"},_.createElement(U,{onClick:function(){return I(a,"dictItemDataRefDlg.open",i)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"}))),_.createElement(xe,{ctx:r,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"formDataRefDlg.open",o)},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:r,point:"delete"},_.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{id:n.id})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},No=_.createContext({pageConfig:{},fetchConfig:{}}),So=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{label:"",value:""}),o=u(N(r),2),a=o[0],i=o[1],c=u(N(0),2),l=c[0],s=c[1],d=function(){s((function(e){return e+1}))};return _.createElement(M,{className:"admin-search-panel",model:a,key:l,labelWidth:"auto",onChange:function(e,t){i(b(b({},a),{},E({},e,t)))},labelPosition:"before"},_.createElement(F,{name:"label",label:me(n,"label.label","Label")},_.createElement(z,{value:a.label})),_.createElement(F,{name:"value",label:me(n,"value.label","Value")},_.createElement(z,{value:a.value})),_.createElement(F,null,_.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"label",value:a.label,type:"LIKE",filter_empty:!0},{key:"value",value:a.value,type:"=",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},he(n,"search.text","Search")),_.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(b({},r)),null==t||t.reset(),d()}},he(n,"reset.text","Reset"))))},Oo=function(){var e=A(No),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,o=e.ctxState,a=e.refs;return _.createElement(_.Fragment,null,_.createElement(K,{toolbar:function(){var e={record:{data:"",label:"",value:""},type:se.CREATE,ctx:r,title:he(t,"add.text","Create Dict")};return _.createElement(_.Fragment,null,_.createElement("div",null,_.createElement(So,{ctx:r,pageConfig:t,fetchConfig:n})),_.createElement("div",{style:{padding:4}},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},he(t,"refresh.text","Refresh")),_.createElement(xe,{ctx:r,point:"add"},_.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return I(a,"formDataRefDlg.open",e)}},he(t,"add.text","Add")))))},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style},_.createElement(B,{field:"label",title:me(t,"label.label","Label"),width:"160px"}),_.createElement(B,{field:"value",title:me(t,"value.label","Value"),align:"center",width:"180px"}),_.createElement(B,{field:"data",title:me(t,"data.label","Data"),align:"center",width:"180px"}),_.createElement(G,{frozen:!0,align:"right",width:"80px"},_.createElement(Y,null,_.createElement(B,{align:"center",render:function(e){e.value;var n=e.row,o=(e.rowIndex,{record:n,ctx:r,type:se.UPDATE,title:"".concat(he(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return _.createElement(_.Fragment,null,_.createElement(xe,{ctx:r,point:"update"},_.createElement(U,{plain:!0,onClick:function(){return I(a,"formDataRefDlg.open",o)},iconCls:"iconfont icon-edit color-dark-green"})),_.createElement(xe,{ctx:r,point:"delete"},_.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{id:n.id,data:{sign:n.sign}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"})))))},Do=function(e){var t=e.ctx,n=e.type,r=e.record,o=e.pageConfig,a=(e.fetchConfig,e.close),i=e.refs,c=u(ze(r).toArray(),1)[0];D((function(){null==t||t.setMethod("onSubmit",(function(e){return l(e)}))}),[]);var l=function(e){var o={object:{id:parseInt(c.id),label:c.label,sign:e,value:c.value,data:c.data},conditions:[]};n===se.UPDATE&&o.conditions.push({key:"id",value:r.id}),it.saveResult(null==t?void 0:t.name(),n,o,(function(){ye.success(de("save_success","Message")),null==t||t.refresh(),a()})).then((function(e){}))};return _.createElement(M,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"label",label:me(o,"label.label","Label")+":"},_.createElement(z,{placeholder:me(o,"label.placeholder",""),value:c.label})),_.createElement(F,{name:"value",label:me(o,"value.label","Value")+":"},_.createElement(z,{placeholder:me(o,"value.placeholder",""),value:c.value})),_.createElement(F,{name:"data",label:me(o,"data.label","Data")+":"},_.createElement(z,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:me(o,"data.placeholder",""),value:c.data,addonRight:function(){return _.createElement("span",{style:{paddingLeft:"8px"}},_.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},Ao=function(e){var t=e.value,n=e.props,r=e.close,o=A(No),a=o.ctx,i=o.pageConfig,c=o.fetchConfig,l=o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement("div",{className:"f-full"},_.createElement(Do,b(b({ctx:a,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:l}))),_.createElement("div",{className:"dialog-button"},_.createElement(U,{style:{width:80},onClick:function(){var e;return null==a||null===(e=a.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy"},he(i,"submit.text","Submit")),_.createElement(U,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},he(i,"cancel.text","Cancel"))))},Ro="dict-item",Po=Ye(Ro),To=Cr({name:"DictItem",fetchConfig:function(){return it.configs(Ro)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,o=yr({name:Ro,fetch:function(e){return it.list(Ro,e)},checkAccessItems:Po,fixedConditions:[{key:"sign",value:r}]},r);o.ctx.registerEvent("remove",He(o.ctx));var a=we({sign:r});return D((function(){o.ctx.search()}),[]),_.createElement(No.Provider,{value:{ctx:o.ctx,ctxState:o.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:o.ctx,ctxState:o.ctxState})}},_.createElement(Ao,b({},a)),_.createElement(Oo,null)))})),jo=function(e){var t=e.ctx,n=(e.ctxState,e.type),r=e.record,o=e.pageConfig,a=(e.fetchConfig,e.close),i=e.refs,c=u(ze(r).toArray(),1)[0];D((function(){null==t||t.setMethod("onSubmit",l)}),[]);var l=function(){var e={object:{id:parseInt(c.id),name:c.name,sign:c.sign,remark:c.remark},conditions:[]};n===se.UPDATE&&e.conditions.push({key:"id",value:r.id}),it.saveResult(null==t?void 0:t.name(),n,e,(function(){ye.success(de("save_success","Message")),t.refresh(),a()})).then((function(e){}))};return _.createElement(M,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"}},_.createElement(F,{name:"name",label:me(o,"name.label","Name")+":"},_.createElement(z,{placeholder:me(o,"name.placeholder",""),value:c.name})),_.createElement(F,{name:"sign",label:me(o,"sign.label","Sign")+":"},_.createElement(z,{placeholder:me(o,"sign.placeholder",""),disabled:n===se.UPDATE,value:c.sign})),_.createElement(F,{name:"remark",label:me(o,"remark.label","Remark")+":"},_.createElement(z,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:me(o,"remark.placeholder",""),value:c.remark,addonRight:function(){return _.createElement("span",{style:{paddingLeft:"8px"}},_.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},Io=function(e){var t=e.value,n=e.props;e.close;return A(wo),_.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},_.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},_.createElement(To,b({},n))))},Vo=function(e){var t=e.value,n=e.props,r=e.close,o=A(wo),a=o.ctx,i=o.ctxState,c=o.pageConfig,l=o.fetchConfig,u=o.refs;return _.createElement(L,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},_.createElement("div",{className:"f-full"},_.createElement(jo,b(b({ctx:a,ctxState:i,pageConfig:c,fetchConfig:l},n),{},{close:r,refs:u}))),_.createElement("div",{className:"dialog-button"},_.createElement(U,{style:{width:80},onClick:function(){var e;return null==a||null===(e=a.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy"},he(c,"submit.text","Submit")),_.createElement(U,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},he(c,"cancel.text","Cancel"))))},Lo="dict",Mo=[{type:ue.AND,value:["/resource/dict-item/list"],key:"items"}].concat(s(Ye(Lo))),Fo=Cr({name:"Dict",fetchConfig:function(){return it.configs(Lo)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=yr({name:Lo,fetch:function(e){return it.list(Lo,e)},checkAccessItems:Mo});r.ctx.registerEvent("remove",He(r.ctx));var o=we(),a=we();return D((function(){r.ctx.search()}),[r.version]),_.createElement(wo.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o,dictItemDataRefDlg:a}}},_.createElement(Ce,{mode:"cover",footer:function(){return _.createElement(wr,{ctx:r.ctx,ctxState:r.ctxState})}},_.createElement(Vo,b({},o)),_.createElement(Io,b({},a)),_.createElement(_o,null)))})),zo=function(){return _.createElement("h1",null,"404!!!!!!!")},Uo=function(e){return N([{id:"demo",name:"test1",data:{width:200,height:100}},{id:"demo",name:"test3",data:{width:400,height:100,top:500,left:200}}]),_.createElement("h2",null,"developing......")},Wo=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return P(null),_.createElement(Ce,{mode:"cover"},_.createElement(H,{style:{width:"100%",height:"100%"}},_.createElement(X,{region:"north",style:{height:50}},"North Region"),_.createElement(X,{region:"south",style:{height:50}},"South Region"),_.createElement(X,{region:"west",style:{width:240}},_.createElement("div",{style:{}},"West Region")),_.createElement(X,{region:"east",style:{width:240}},_.createElement("div",{style:{}},"East Region")),_.createElement(X,{region:"center",style:{width:"100%",height:"100%"}},_.createElement(Uo,null))))},Bo=_.createContext({}),qo=function(){var e=ke(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,Xn((function(e){return e.app.theme}))),o=P(null);return D((function(){}),[]),_.createElement(_.Fragment,null,_.createElement(_e,{width:"300px",placement:"right",ref:o},_.createElement($,{style:{width:"300px",height:"100%"},title:de("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"}},n.map((function(e,n){return _.createElement("div",{key:n},_.createElement(ee,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),_.createElement(te,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"}},de("themes."+e.key,"Setting",e.name)))})))),_.createElement(U,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){o.current.toggle()}}))},Ko=function(){var e=Xn((function(e){return e.user.info})),t=Te();return _.createElement(ae,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return _.createElement(ie,{noline:!0},_.createElement(ce,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"}))},onMenuItemClick:function(e){if("exit"==e){var n=de("confirm_logout","Message");ge("",n,(function(){Kn.logout((function(){t("/login")}))}))}}})},Go=new Ae(0,(function(e){return{id:e.id,text:e.title,iconCls:"iconfont "+e.icon,path:e.router_name,pid:e.pid,sort:e.sort,state:e.state,type:e.type}})),Yo={border:!1,plain:!0,scrollable:!0,narrow:!1},Ho={border:!1,animate:!0,multiple:!0,showCollapsedText:!1},Xo=function(){Te(),Xn((function(e){return e.user.info}));var e={dispatch:Hn(),useAppSelector:Xn},t=mr(Go),n=t.collapsed,r=t.menuList,o=t.choiceId,a=t.onMenuSelection,i=t.menuArea,c=t.setMenuAreaId,l=t.menuTabList,u=t.onTabClosed,s=t.onTabSelected,d=function(){return _.createElement(_.Fragment,null,!n&&(null==i?void 0:i.map((function(e,t){return _.createElement(U,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,key:e.id,onClick:function(){return c(e.id)}},e.text)}))))},f=function(){return _.createElement(_.Fragment,null,_.createElement(Ko,null),_.createElement(Zr,null),_.createElement(qo,null))},p=function(){return _.createElement(Se,{onTabSelect:s,tabsCfg:Yo,onTabClosed:u,data:l})};return _.createElement(Bo.Provider,{value:e},_.createElement(Ne,{menus:r,title:de("title","App","Admin"),collapsed:n,sidebarCfg:Ho,selection:le.findNode(r,"id",o),toggle:function(t){var n;return null===(n=e.dispatch)||void 0===n?void 0:n.call(e,or(t))},slots:{barLeft:_.createElement(d,null),barRight:_.createElement(f,null)},onSideMenuSelection:a},_.createElement(p,null),_.createElement("div",{className:"admin-tabs-panel-body"},_.createElement(Ie,null))))};function $o(e){var t,n,r;n=e.request,Je||(Je=n),r=null!==(t=e.apis)&&void 0!==t?t:{},rt=b(b({},rt),r)}export{Pr as AdminView,Bo as AppLayoutContext,Xo as BaseLayout,Fo as DictView,Tr as HomeView,Ue as Lazy,Zr as LocaleBarItem,eo as LoginView,zo as NotFoundView,wr as PaginationPanel,xo as PermissionsView,so as RolesView,Kr as RouterView,Wo as ScreenDesign,qo as SettingBarItem,$r as SettingView,lt as adminService,ut as configService,Ze as ctxPageValue,et as ctxPageValueOptions,tt as fetchConfigOptions,$o as install,Xe as permissionTree,$e as queryPermissionTress,ct as rbacService,He as removeEventFn,qe as renderDateTime02,Ge as renderFetchConfigValue,Ke as renderText,We as renderTooltip,Be as renderType,Ye as resourceAccessItems,it as resourceService,Qe as roleTree,hr as useAppRedirect,vr as useAppStarter,gr as useLocalTable,mr as useMenuAndTabData,yr as useTable,kr as withCheckGrid,Cr as withDocHoc};
1
+ function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e){return function(e){if(Array.isArray(e))return E(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||y(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,n,l){return n=a(n),function(t,n){if(n&&("object"==e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(t)}(t,r()?Reflect.construct(n,l||[],a(t).constructor):n.apply(t,l))}function r(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(r=function(){return!!e})()}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function l(e,t){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},l(e,t)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var r,a,l,o,i=[],c=!0,s=!1;try{if(l=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(r=l.call(n)).done)&&(i.push(r.value),i.length!==t);c=!0);}catch(e){s=!0,a=e}finally{try{if(!c&&null!=n.return&&(o=n.return(),Object(o)!==o))return}finally{if(s)throw a}}return i}}(e,t)||y(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */i=function(){return n};var t,n={},r=Object.prototype,a=r.hasOwnProperty,l=Object.defineProperty||function(e,t,n){e[t]=n.value},o="function"==typeof Symbol?Symbol:{},c=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function d(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{d({},"")}catch(t){d=function(e,t,n){return e[t]=n}}function f(e,t,n,r){var a=t&&t.prototype instanceof E?t:E,o=Object.create(a.prototype),i=new T(r||[]);return l(o,"_invoke",{value:_(e,n,i)}),o}function m(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}n.wrap=f;var p="suspendedStart",h="suspendedYield",g="executing",v="completed",y={};function E(){}function b(){}function x(){}var C={};d(C,c,(function(){return this}));var k=Object.getPrototypeOf,w=k&&k(k(I([])));w&&w!==r&&a.call(w,c)&&(C=w);var S=x.prototype=E.prototype=Object.create(C);function R(e){["next","throw","return"].forEach((function(t){d(e,t,(function(e){return this._invoke(t,e)}))}))}function A(t,n){function r(l,o,i,c){var s=m(t[l],t,o);if("throw"!==s.type){var u=s.arg,d=u.value;return d&&"object"==e(d)&&a.call(d,"__await")?n.resolve(d.__await).then((function(e){r("next",e,i,c)}),(function(e){r("throw",e,i,c)})):n.resolve(d).then((function(e){u.value=e,i(u)}),(function(e){return r("throw",e,i,c)}))}c(s.arg)}var o;l(this,"_invoke",{value:function(e,t){function a(){return new n((function(n,a){r(e,t,n,a)}))}return o=o?o.then(a,a):a()}})}function _(e,n,r){var a=p;return function(l,o){if(a===g)throw Error("Generator is already running");if(a===v){if("throw"===l)throw o;return{value:t,done:!0}}for(r.method=l,r.arg=o;;){var i=r.delegate;if(i){var c=N(i,r);if(c){if(c===y)continue;return c}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(a===p)throw a=v,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a=g;var s=m(e,n,r);if("normal"===s.type){if(a=r.done?v:h,s.arg===y)continue;return{value:s.arg,done:r.done}}"throw"===s.type&&(a=v,r.method="throw",r.arg=s.arg)}}}function N(e,n){var r=n.method,a=e.iterator[r];if(a===t)return n.delegate=null,"throw"===r&&e.iterator.return&&(n.method="return",n.arg=t,N(e,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),y;var l=m(a,e.iterator,n.arg);if("throw"===l.type)return n.method="throw",n.arg=l.arg,n.delegate=null,y;var o=l.arg;return o?o.done?(n[e.resultName]=o.value,n.next=e.nextLoc,"return"!==n.method&&(n.method="next",n.arg=t),n.delegate=null,y):o:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,y)}function P(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function D(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function T(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(P,this),this.reset(!0)}function I(n){if(n||""===n){var r=n[c];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var l=-1,o=function e(){for(;++l<n.length;)if(a.call(n,l))return e.value=n[l],e.done=!1,e;return e.value=t,e.done=!0,e};return o.next=o}}throw new TypeError(e(n)+" is not iterable")}return b.prototype=x,l(S,"constructor",{value:x,configurable:!0}),l(x,"constructor",{value:b,configurable:!0}),b.displayName=d(x,u,"GeneratorFunction"),n.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===b||"GeneratorFunction"===(t.displayName||t.name))},n.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,x):(e.__proto__=x,d(e,u,"GeneratorFunction")),e.prototype=Object.create(S),e},n.awrap=function(e){return{__await:e}},R(A.prototype),d(A.prototype,s,(function(){return this})),n.AsyncIterator=A,n.async=function(e,t,r,a,l){void 0===l&&(l=Promise);var o=new A(f(e,t,r,a),l);return n.isGeneratorFunction(t)?o:o.next().then((function(e){return e.done?e.value:o.next()}))},R(S),d(S,u,"Generator"),d(S,c,(function(){return this})),d(S,"toString",(function(){return"[object Generator]"})),n.keys=function(e){var t=Object(e),n=[];for(var r in t)n.push(r);return n.reverse(),function e(){for(;n.length;){var r=n.pop();if(r in t)return e.value=r,e.done=!1,e}return e.done=!0,e}},n.values=I,T.prototype={constructor:T,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(D),!e)for(var n in this)"t"===n.charAt(0)&&a.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=t)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var n=this;function r(r,a){return i.type="throw",i.arg=e,n.next=r,a&&(n.method="next",n.arg=t),!!a}for(var l=this.tryEntries.length-1;l>=0;--l){var o=this.tryEntries[l],i=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var c=a.call(o,"catchLoc"),s=a.call(o,"finallyLoc");if(c&&s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(c){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!s)throw Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&a.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var l=r;break}}l&&("break"===e||"continue"===e)&&l.tryLoc<=t&&t<=l.finallyLoc&&(l=null);var o=l?l.completion:{};return o.type=e,o.arg=t,l?(this.method="next",this.next=l.finallyLoc,y):this.complete(o)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),y},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),D(n),y}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var a=r.arg;D(n)}return a}}throw Error("illegal catch attempt")},delegateYield:function(e,n,r){return this.delegate={iterator:I(e),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=t),y}},n}function c(e,t,n,r,a,l,o){try{var i=e[l](o),c=i.value}catch(e){return void n(e)}i.done?t(c):Promise.resolve(c).then(r,a)}function s(e){return function(){var t=this,n=arguments;return new Promise((function(r,a){var l=e.apply(t,n);function o(e){c(l,r,a,o,i,"next",e)}function i(e){c(l,r,a,o,i,"throw",e)}o(void 0)}))}}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function d(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,g(r.key),r)}}function f(e,t,n){return t&&d(e.prototype,t),n&&d(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function m(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function p(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?m(Object(n),!0).forEach((function(t){h(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):m(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function h(e,t,n){return(t=g(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function g(t){var n=function(t,n){if("object"!=e(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var a=r.call(t,n||"default");if("object"!=e(a))return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===n?String:Number)(t)}(t,"string");return"symbol"==e(n)?n:n+""}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=y(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,a=function(){};return{s:a,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:a}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,o=!0,i=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){i=!0,l=e},f:function(){try{o||null==n.return||n.return()}finally{if(i)throw l}}}}function y(e,t){if(e){if("string"==typeof e)return E(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?E(e,t):void 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}import b,{useState as x,useMemo as C,useLayoutEffect as k,useEffect as w,useContext as S,createRef as R,useRef as A}from"react";import{get as _,trim as N,invoke as P}from"lodash-es";import{Tooltip as D,Dialog as T,Form as I,FormField as L,TextBox as O,LinkButton as U,Pagination as j,GridColumn as F,CheckBox as M,DataGrid as V,GridColumnGroup as z,GridHeaderRow as W,Layout as B,LayoutPanel as q,Panel as G,Tree as K,ComboBox as H,TreeGrid as $,RadioButton as Y,Label as Q,NumberBox as Z,ComboTree as J,PasswordBox as X,MenuButton as ee,Menu as te,MenuItem as ne,treeHelper as re}from"rc-easyui";import{CheckAccessEleType as ae,FormDataType as le}from"@kordar-lib/base";import{tt as oe,setLanguage as ie,getActivePkg as ce,tfield as se,tparam as ue,getResourceBundle as de}from"@kordar-lib/i18n";import{$confirm as fe,$toast as me,setSideMenuState as pe,useLocale as he,Access as ge,useRefDialog as ve,DefaultPanel as ye,useTheme as Ee,DrawerPanel as be,AdminLayout as xe,TabsPanel as Ce}from"@kordar/easyui";import{MenuService as ke,SelectionTree as we,TabMenuService as Se}from"@kordar-lib/menus";import{useAppDispatch as Re,useAppSelector as Ae,sidebarChoice as _e,removeTab as Ne,saveChoice as Pe,Admin as De,App as Te,login as Ie,setSidebarCollapsed as Le}from"@kordar-lib/reducers";import{useNavigate as Oe,useLocation as Ue,Outlet as je}from"react-router-dom";import{useAppRedirect as Fe,useCheckAccess as Me,useLocalTable as Ve,useTable as ze,useFormData as We}from"@kordar-components/react";function Be(e){return b.createElement(b.Suspense,{fallback:b.createElement(b.Fragment,null,"...")},e)}var qe=function(e){var t=e.value;return t?b.createElement(D,{content:t,position:"top"},b.createElement("div",{className:"yp-text-ellipsis"},t)):""},Ge=function(){return b.createElement("div",null,"Type")},Ke=function(e){return e.value.replace("T"," ").replace("Z","")},He=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t?b.createElement("span",{className:"iconfont "+t},e):b.createElement("span",null,e)},$e=function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"-",a=_(e,t,[]);for(var l in a){var o=a[l];if(o.value==n)return o.label}return r},Ye=function(e){return[{type:ae.AND,value:["/resource/"+e+"/add"],key:"add"},{type:ae.AND,value:["/resource/"+e+"/update"],key:"update"},{type:ae.AND,value:["/resource/"+e+"/delete"],key:"delete"},{type:ae.AND,value:["/resource/"+e+"/edit"],key:"edit"}]},Qe=function(e,t){return function(n){var r=n.fn,a=n.params,l=n.success,o=n.error;fe(oe("confirm_del_title","Message"),null!=t?t:oe("confirm_del_msg","Message"),(function(){r(a).then((function(t){var n=t.code;t.message,t.data;200===n?(l&&l(),e.refresh(),me.success(oe("del_success","Message"))):o&&o()}))}))}};function Ze(e){var t,n=[],r=new Map,a=v(e);try{for(a.s();!(t=a.n()).done;){var l,o=t.value,i="",c=o.name,s=N(c,"/").split("/");s.length<=2?i=s[0]:s.length>2&&(i=s[0]+"/"+s[1]);var u=r.get(i);null==u&&(u=[]);var d=null!==(l=o.description)&&void 0!==l?l:"";u.push({id:c,text:d+"["+c+"]"}),r.set(i,u)}}catch(e){a.e(e)}finally{a.f()}return r.forEach((function(e,t){n.push({text:t,children:e})})),n}function Je(e,t,n){var r=0;return e.forEach((function(e){if(e.children&&e.children.length>0){var a=Je(e.children,t,n);a>0&&(a===e.children.length?e.checkState="checked":e.checkState="indeterminate")}e.id&&t.has(e.id)&&(n.push(e),r++)})),r}function Xe(e){var t,n=[],r=new Map,a=v(e);try{for(a.s();!(t=a.n()).done;){var l,o=t.value,i="",c=o.description,s=void 0,u=N(c,":").split(":");u.length<=2?i=u[0]:u.length>2&&(i=u[0]+":"+u[1]),u.length>=2&&(s=u[1]);var d=r.get(i);null==d&&(d=[]);var f=o.name;d.push({id:f,text:null!==(l=s)&&void 0!==l?l:f}),r.set(i,d)}}catch(e){a.e(e)}finally{a.f()}return r.forEach((function(e,t){n.push({text:t,children:e})})),n}var et,tt=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgVal"))||void 0===n?void 0:n(t))||{}},nt=function(e,t){var n;return(null==e||null===(n=e.getMethod("pgOptions"))||void 0===n?void 0:n(t))||[]},rt=function(e,t){if(!e[t])return[];var n=[],r=e[t];return r instanceof Array?r.forEach((function(e){return n.push({value:e.value,text:e.label})})):Object.keys(r).forEach((function(e,t){return n.push({value:e,text:r[e]})})),n};function at(){return et}new ke;var lt={adminRegister:"admin/register",adminResetPassword:"admin/reset-password",initialize:"init",menus:"menus",langData:"lang-data",adminInfo:"resource/admin/info",loginCaptcha:"login/captcha",loginConfig:"login/config",loginSubmit:"login/submit",rbacRoles:"rbac/roles",rbacAddRole:"rbac/add-role",rbacUpdateRole:"rbac/update-role",rbacDeleteRole:"rbac/delete-role",rbacBatchDeleteRole:"rbac/batch-delete-role",rbacPermissions:"rbac/permissions",rbacAddPermission:"rbac/add-permission",rbacUpdatePermission:"rbac/update-permission",rbacDeletePermission:"rbac/delete-permission",rbacBatchDeletePermission:"rbac/batch-delete-permission",rbacRules:"rbac/rules",rbacAddRule:"rbac/add-rule",rbacDeleteRule:"rbac/delete-rule",rbacGetChildren:"rbac/get-children",rbacAddPermissionChildren:"rbac/add-permission-children",rbacGetRolesByUser:"rbac/get-roles-by-user",rbacAssignItemToUser:"rbac/assign-item-to-user",rbacFastAddPermission:"rbac/fast-add-permission",rbacGetPermissionsByUser:"rbac/get-permissions-by-user"};function ot(e){return lt[e]}var it=function(){return f((function e(){u(this,e)}),[{key:"result",value:function(e,t,n,r,a,l){200===e&&a&&a(n,r)}},{key:"list",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return at().post("resource/".concat(e,"/list"),t)}},{key:"listResult",value:(a=s(i().mark((function e(t){var n,r,a,l,o,c,s,u=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=u.length>1&&void 0!==u[1]?u[1]:{},r=u.length>2?u[2]:void 0,e.next=4,at().post("resource/".concat(t,"/list"),n);case 4:a=e.sent,l=a.code,o=a.message,c=a.data,s=a.count,this.result(l,o,c,s,r);case 10:case"end":return e.stop()}}),e,this)}))),function(e){return a.apply(this,arguments)})},{key:"configs",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return at().post("resource/".concat(e,"/configs"),{data:t})}},{key:"configsResult",value:(r=s(i().mark((function e(t){var n,r,a,l,o,c,s=arguments;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=s.length>1&&void 0!==s[1]?s[1]:{},r=s.length>2?s[2]:void 0,e.next=4,at().post("resource/".concat(t,"/configs"),n);case 4:a=e.sent,l=a.code,o=a.message,c=a.data,this.result(l,o,c,0,r);case 9:case"end":return e.stop()}}),e,this)}))),function(e){return r.apply(this,arguments)})},{key:"edit",value:function(e,t){return at().post("resource/".concat(e,"/edit"),t)}},{key:"editResult",value:(n=s(i().mark((function e(t,n,r){var a,l,o,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,at().post("resource/".concat(t,"/edit"),n);case 2:a=e.sent,l=a.code,o=a.message,c=a.data,this.result(l,o,c,0,r);case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return n.apply(this,arguments)})},{key:"add",value:function(e,t){return at().post("resource/".concat(e,"/add"),t)}},{key:"update",value:function(e,t){return at().post("resource/".concat(e,"/update"),t)}},{key:"saveResult",value:(t=s(i().mark((function e(t,n,r,a){var l,o,c,s,u,d,f,m;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n!==le.CREATE){e.next=10;break}return e.next=3,this.add(t,r);case 3:l=e.sent,o=l.code,c=l.message,s=l.data,this.result(o,c,s,0,a),e.next=18;break;case 10:if(n!==le.UPDATE){e.next=18;break}return e.next=13,this.update(t,r);case 13:u=e.sent,d=u.code,f=u.message,m=u.data,this.result(d,f,m,0,a);case 18:case"end":return e.stop()}}),e,this)}))),function(e,n,r,a){return t.apply(this,arguments)})},{key:"del",value:function(e,t){return at().post("resource/".concat(e,"/delete"),{data:t})}},{key:"delResult",value:(e=s(i().mark((function e(t,n,r){var a,l,o,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,at().post("resource/".concat(t,"/delete"),n);case 2:a=e.sent,l=a.code,o=a.message,c=a.data,this.result(l,o,c,0,r);case 7:case"end":return e.stop()}}),e,this)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"info",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return at().post("resource/".concat(e,"/info"),t)}},{key:"output",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{responseType:"blob"};return at().post("resource/".concat(e,"/output"),t,n)}},{key:"outputOctetStream",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0;return this.output(e,t).then((function(e){var t=new Blob([e],{type:"application/octet-stream"}),r=URL.createObjectURL(t),a=document.createElement("a");a.setAttribute("download",n+".xlsx"),a.href=r,document.body.appendChild(a),a.click(),document.body.removeChild(a)}))}}]);var e,t,n,r,a}(),ct=new it,st=new(function(){return f((function e(){u(this,e)}),[{key:"roles",value:function(){return at().post(ot("rbacRoles"))}},{key:"addRole",value:function(e){return at().post(ot("rbacAddRole"),e)}},{key:"updateRole",value:function(e){return at().post(ot("rbacUpdateRole"),e)}},{key:"deleteRole",value:function(e){return at().post(ot("rbacDeleteRole"),e)}},{key:"batchDeleteRole",value:function(e){return at().post(ot("rbacBatchDeleteRole"),e)}},{key:"permissions",value:function(){return at().post(ot("rbacPermissions"))}},{key:"addPermission",value:function(e){return at().post(ot("rbacAddPermission"),e)}},{key:"updatePermission",value:function(e){return at().post(ot("rbacUpdatePermission"),e)}},{key:"deletePermission",value:function(e){return at().post(ot("rbacDeletePermission"),e)}},{key:"batchDeletePermission",value:function(e){return at().post(ot("rbacBatchDeletePermission"),e)}},{key:"rules",value:function(){return at().post(ot("rbacRules"))}},{key:"addRule",value:function(e){return at().post(ot("rbacAddRule"),e)}},{key:"deleteRule",value:function(e){return at().post(ot("rbacDeleteRule"),e)}},{key:"getChildren",value:function(e){return at().get(ot("rbacGetChildren"),e)}},{key:"addPermissionChildren",value:function(e){return at().post(ot("rbacAddPermissionChildren"),e)}},{key:"getRolesByUser",value:function(e){return at().get(ot("rbacGetRolesByUser"),{id:e})}},{key:"assignItemToUser",value:function(e){return at().post(ot("rbacAssignItemToUser"),e)}},{key:"fastAddPermission",value:function(e){return at().post(ot("rbacFastAddPermission"),e)}},{key:"getPermissionsByUser",value:function(e){return at().get(ot("rbacGetPermissionsByUser"),{id:e})}}])}()),ut=new(function(){return f((function e(){u(this,e)}),[{key:"register",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return at().post(ot("adminRegister"),e)}},{key:"resetPassword",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return at().post(ot("adminResetPassword"),e)}},{key:"menus",value:function(){return at().post(ot("menus"),{})}},{key:"info",value:function(e){return at().post(ot("adminInfo"),{conditions:[{key:"id",value:e}]})}}])}()),dt=new(function(){return f((function e(){u(this,e)}),[{key:"initialize",value:function(){return at().post(ot("initialize"))}},{key:"getLugData",value:function(e){return at().post(ot("langData"),{locale:e})}}])}());function ft(e){var t=Re(),n=Oe(),r=null==Ae?void 0:Ae((function(e){return e.app.sidebarCollapsed})),a=Ae((function(e){return e.layout})),l=a.tabs,c=a.choices,u=a.choiceId,d=o(x(),2),f=d[0],m=d[1],p=o(x(),2),h=p[0],g=p[1],v=o(x([]),2),y=v[0],E=v[1],b=o(x([]),2),w=b[0],S=b[1],R=C((function(){var t;return e.init(pe(y,c)),m(e.tabs),r?e.menus():[{id:0,text:"",state:"open",children:e.menusById(h||c[0]||(null===(t=e.tabs[0])||void 0===t?void 0:t.id)).children||[]}]}),[y,r,h]),A=C((function(){return e.init(pe(y,c)),e.menus()}),[y,r]),_=C((function(){for(var t=[],n=0;n<w.length;n++){var r=w[n];t.push({id:r.id,path:r.router_name,closable:!1,title:r.title,selected:r.id==u,type:2})}for(var a=0;a<l.length;a++){var o=e.getItemById(l[a]);o&&t.push({id:o.id,path:o.path,closable:!0,title:o.text,selected:o.id==u,type:1})}return t}),[y,l,u]);return k((function(){s(i().mark((function e(){var t,n;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ut.menus();case 2:t=e.sent,n=t.data,E(n.sidebar),S(n.welcome);case 6:case"end":return e.stop()}}),e)})))()}),[]),{collapsed:r,menuList:R,menuAll:A,onMenuSelection:function(r){if(r){var a=e.searchPathIndex(r.id);t(_e({id:r.id,choices:a})),n({pathname:r.path})}},menuArea:f,setMenuAreaId:g,choiceId:u,menuTabList:_,onTabClosed:function(n){var r=n.props.id;t(Ne({id:r}));var a=e.searchPathIndex(u);t(Pe({choices:a}))},onTabSelected:function(r){var a=e.searchPathIndex(r.id);t(_e({id:r.id,choices:a})),n({pathname:r.path})}}}function mt(){var e={location:Ue(),history:Ae((function(e){return e.app.historyLocation})),isGuest:function(){return De.isGuest()},saveHistoryLocation:function(e){return Te.saveHistoryLocation(e)}};return Fe(e)}function pt(){var e=he().locale,t=o(x(),2),n=t[0],r=t[1],a=mt();return w((function(){ie(e,(function(){r(ce())})),a.autoRedirect()}),[]),w((function(){r(ce())}),[e]),{easyuiLangPkg:n}}function ht(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=Me(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:De.can,OrCan:De.orCan,Permissions:De.permissions}),l=Ae((function(e){return e.user.version})),i=o(x({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],s=i[1];return Ve({value:c,setValue:s,config:e,checkaccess:a,dependency:r,version:l})}function gt(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",a=Me(null!==(t=e.checkAccessItems)&&void 0!==t?t:[],{AndCan:De.can,OrCan:De.orCan,Permissions:De.permissions}),l=Ae((function(e){return e.user.version})),i=o(x({data:[],pageNumber:1,pageSize:null!==(n=e.defaultPageSize)&&void 0!==n?n:20,total:0,loading:!1,border:!1,pageSizes:[10,20,30,40,50],layout:["list","sep","first","prev","links","next","last","sep","refresh","info"],style:{width:"100%",height:"100%"},selectionValues:[]}),2),c=i[0],s=i[1];return ze({value:c,setValue:s,config:e,checkaccess:a,dependency:r,version:l})}var vt=b.createContext({pageConfig:{},fetchConfig:{}}),yt=function(e){var t=e.ctx,n=(e.ctxState,e.type,e.record),r=e.pageConfig,a=(e.fetchConfig,e.close),l=(e.refs,o(We(n).toArray(),1)[0]);w((function(){null==t||t.setMethod("onSubmit",i)}),[]);var i=function(){var e={username:l.username,phone:l.phone,password:"123456"};ut.register(e).then((function(e){200===e.code&&(me.success(oe("save success","Message")),t.refresh(),a())}))};return b.createElement(I,{model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{username:{required:!0},phone:{required:!0}},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"username",label:se(r,"username.label","Username")+":"},b.createElement(O,{placeholder:se(r,"username.placeholder",""),value:l.username})),b.createElement(L,{name:"phone",label:se(r,"phone.label","Phone")+":"},b.createElement(O,{placeholder:se(r,"phone.placeholder",""),value:l.phone})),b.createElement("div",{className:"admin-form-submit"},b.createElement(U,{style:{width:80},onClick:function(){var e;return null==t||null===(e=t.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"icon-save"},ue(r,"submit.text","Submit")),b.createElement(U,{style:{width:80},onClick:function(){return null==a?void 0:a()},iconCls:"icon-cancel"},ue(r,"cancel.text","Cancel"))))},Et=function(e){var t=e.value,n=e.props,r=e.close,a=S(vt),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,s=a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement(yt,p(p({className:"f-full",ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:s})))},bt=function(e){var t=e.ctxState,n=e.ctx;return b.createElement(j,{total:null==t?void 0:t.total,pageNumber:null==t?void 0:t.pageNumber,pageSize:null==t?void 0:t.pageSize,layout:null==t?void 0:t.layout,onPageChange:function(e){var t=e.pageNumber,r=e.pageSize;return null==n?void 0:n.pageChange(t,r)},pageList:null==t?void 0:t.pageSizes,showPageRefresh:!1})},xt=function(e){return function(t){return function(n){var r=o(x({}),2),a=r[0],l=r[1],i=o(x({}),2),c=i[0],s=i[1],u=o(x(0),2),d=u[0],f=u[1],m=he().locale;return w((function(){var t=de(m,"Page",e.name);document.title=_(t,"title",oe("title","App")),l(null!=t?t:{}),e.fetchConfig&&e.fetchConfig().then((function(e){var t=e.data;s(t||{}),f(d+1)}))}),[m]),b.createElement(b.Fragment,null,b.createElement(t,p({pageConfig:a,fetchConfig:c,fetchVersion:d},n)))}}},Ct=function(e){var r=function(){function r(e){var t;return u(this,r),h(t=n(this,r,[e]),"tabRef",R()),t.state={clicked:!1,data:t.props.data||[],selectedRows:[]},t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&l(e,t)}(r,b.Component),f(r,[{key:"componentDidMount",value:function(){this.setState({selectedRows:this.props.selection||[]})}},{key:"componentDidUpdate",value:function(e){this.props.selection!==e.selection&&this.setState({selectedRows:this.props.selection}),this.props.data!==e.data&&this.setState({data:this.props.data})}},{key:"isChecked",value:function(e){var t=this;if(this.props.idField){if(this.state.selectedRows.findIndex((function(n){return n[t.props.idField]===e[t.props.idField]}))>=0)return!0}else if(this.state.selectedRows.indexOf(e)>=0)return!0;return!1}},{key:"isAllChecked",value:function(){var e=this.state,t=e.selectedRows,n=e.data;return!(!t.length||t.length!==n.length)}},{key:"handleRowCheck",value:function(e,n){var r=this;if(!this.state.clicked){var a=this.state.data.indexOf(e),l=this.state.data.slice();if(l.splice(a,1,Object.assign({},e)),this.setState({data:l}),n)this.setState({selectedRows:[].concat(t(this.state.selectedRows),[l[a]])});else{var o=this.state.selectedRows.filter((function(t){if(r.props.idField){if(t[r.props.idField]!==e[r.props.idField])return!0}else if(t!==e)return!0;return!1}));this.setState({selectedRows:o})}this.setState({clicked:!0},(function(){setTimeout((function(){return r.setState({clicked:!1})})),r.props.onSelectionChange&&r.props.onSelectionChange(r.state.selectedRows)}))}}},{key:"handleAllCheck",value:function(e){var t=this;if(!this.state.clicked&&this.state.data){var n=this.state.data.map((function(e){return Object.assign({},e)}));this.setState({data:n,selectedRows:e?n:[],clicked:!0},(function(){setTimeout((function(){return t.setState({clicked:!1})})),t.props.onSelectionChange&&t.props.onSelectionChange(t.state.selectedRows)}))}}},{key:"render",value:function(){var t,n=this;return b.createElement(e,p(p({},this.props),{},{data:this.state.data}),b.createElement(F,{key:"ck_column_key",width:null!==(t=this.props.ckWidth)&&void 0!==t?t:20,align:"center",field:"ck",render:function(e){var t=e.row;return b.createElement(M,{checked:n.isChecked(t),onChange:function(e){return n.handleRowCheck(t,e)}})},header:function(){return b.createElement(M,{checked:n.isAllChecked(),onChange:function(e){return n.handleAllCheck(e)}})},filter:function(){return b.createElement("span",null)}}),this.props.children)}}])}();return r},kt=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{username:"",phone:""}),a=o(x(r),2),l=a[0],i=a[1],c=o(x(0),2),s=c[0],u=c[1],d=function(){u((function(e){return e+1}))};return b.createElement(I,{className:"admin-search-panel",labelWidth:"auto",model:l,key:s,onChange:function(e,t){i(p(p({},l),{},h({},e,t)))},labelPosition:"before"},b.createElement(L,{name:"username",label:se(n,"username.label","Username")},b.createElement(O,{value:l.username})),b.createElement(L,{name:"phone",label:se(n,"phone.label","Phone")},b.createElement(O,{value:l.phone})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"username",value:l.username,type:"LIKE",filter_empty:!0},{key:"phone",value:l.phone,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(r),null==t||t.reset(),d()}},ue(n,"reset.text","Reset"))))},wt=Ct(V),St=function(){var e=S(vt),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,i=(e.version,o(x(0),2)),c=i[0],s=i[1];return w((function(){s(c+1)}),[n]),b.createElement(b.Fragment,null,b.createElement(wt,{toolbar:function(){var e={record:{username:"",password:""},type:le.CREATE,ctx:r,title:ue(t,"add.text","Create Dict")};return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(kt,{ctx:r,pageConfig:t,fetchConfig:n})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},ue(t,"refresh.text","Refresh")),b.createElement(ge,{ctx:r,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return P(l,"formDataRefDlg.open",e)}},ue(t,"add.text","Add")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},ckWidth:20,key:c},b.createElement(F,{field:"id",title:se(t,"id.label","UserId"),width:"50px"}),b.createElement(F,{field:"username",title:se(t,"username.label","Username"),width:"80px"}),b.createElement(F,{field:"phone",title:se(t,"phone.label","Phone"),width:"60px"}),b.createElement(F,{field:"status",title:se(t,"status.label","Status"),align:"center",width:"80px",render:function(e){var t=e.value;return $e(n,"admin-state",t)}}),b.createElement(F,{field:"type",title:se(t,"type.label","Type"),align:"center",width:"80px",render:function(e){var t=e.value;return $e(n,"admin-type",t)}}),b.createElement(F,{field:"version",title:se(t,"version.label","Version"),width:"60px"}),b.createElement(F,{field:"create_time",title:se(t,"create_time.label","CreateTime"),width:"75px"}),b.createElement(F,{field:"update_time",title:se(t,"update_time.label","UpdateTime"),width:"75px"}),b.createElement(z,{frozen:!0,align:"right",width:"150px"},b.createElement(W,null,b.createElement(F,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:le.UPDATE,title:"".concat(ue(t,"update.text","Update: {#name}")).replace("{#name}",n.username)});return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:r,point:"assign"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"assigndlg.open",{ctx:r,record:n,title:"".concat(ue(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.username)})},iconCls:"iconfont icon-roles color-tomato"})),b.createElement(ge,{ctx:r,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:r,point:"delete"},b.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{conditions:{id:n.id}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},Rt=function(e){var t=e.ctx,n=e.record,r=e.pageConfig,a=(e.fetchConfig,e.close),l=o(x(),2),c=l[0],u=l[1],d=o(x([]),2),f=d[0],m=d[1],p=A(null),h=o(x([]),2),g=h[0],v=h[1],y=o(x([]),2),E=y[0],C=y[1],k=A(null);w((function(){null==t||t.setMethod("onSubmit",R),S()}),[]);var S=function(){var e=s(i().mark((function e(){var t,r,a,l,o,c;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,st.roles();case 2:return t=e.sent,r=Xe(t.data||[]),a=[],e.next=7,st.permissions();case 7:l=e.sent,o=Ze(l.data||[]),c=[],st.getPermissionsByUser(n.id).then((function(e){var t=e.code,n=e.data;if(200===t){var r=new Set;n&&n.forEach((function(e){r.add(e.name),1==e.item_type?E.push(e.name):f.push(e.name)})),Je(o,r,c),u(o),c.forEach((function(e){p.current.checkNode(e)}))}})),st.getRolesByUser(n.id).then((function(e){var t=e.code,n=e.data;if(200===t){var l=new Set;n&&n.forEach((function(e){l.add(e.name),1==e.item_type?E.push(e.name):f.push(e.name)})),Je(r,l,a),v(r),a.forEach((function(e){k.current.checkNode(e)}))}}));case 12:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),R=function(){st.assignItemToUser({id:n.id,roles:E,permissions:f}).then((function(e){200===e.code&&($toast.success(ue(r,"assign_success","assign permission successfully!")),a())}))};return b.createElement(B,{style:{width:800,height:500}},b.createElement(q,{region:"west",style:{width:220}},b.createElement(G,{bodyStyle:{padding:"10px",height:"100%"}},b.createElement(K,{selectLeafOnly:!0,checkbox:!0,data:g,ref:k,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),C(t)}}}))),b.createElement(q,{region:"center",style:{height:"100%"}},b.createElement(G,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return b.createElement(O,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){p.current.doFilter(e)}})}},b.createElement(K,{selectLeafOnly:!0,checkbox:!0,data:c,ref:p,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),m(t)}}}))),b.createElement(q,{region:"south"},b.createElement("div",{className:"dialog-button"},b.createElement(U,{style:{width:80},onClick:R}," ",ue(r,"submit.text","Submit")," "),b.createElement(U,{style:{width:80},onClick:a}," ",ue(r,"close.text","Close")," "))))},At=function(e){var t=e.value,n=e.props,r=e.close,a=S(vt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement(Rt,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},_t="admin",Nt=[{type:ae.AND,value:["/rbac/roles","/rbac/permissions","/rbac/get-permissions-by-user","/rbac/get-roles-by-user"],key:"assign"}].concat(t(Ye(_t))),Pt=xt({name:"Admin",fetchConfig:function(){return ct.configs(_t)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=gt({name:_t,fetch:function(e){return ct.list(_t,e)},checkAccessItems:Nt,defaultPageSize:30});r.ctx.registerEvent("remove",Qe(r.ctx));var a=ve(),l=ve();return w((function(){r.ctx.search()}),[r.version]),b.createElement(vt.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,assigndlg:l}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:r.ctx,ctxState:r.ctxState})}},b.createElement(Et,p({},a)),b.createElement(At,p({},l)),b.createElement(St,null)))})),Dt=function(){return b.createElement("h1",null,"Home!!!!!!!")},Tt=b.createContext({pageConfig:{},fetchConfig:{}});var It=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,a=function(){var e=o(x(0),2),t=e[0],n=e[1];return[t,function(){n((function(e){return e+1}))}]}(),l=o(a,2),i=l[0],c=l[1],s={position:void 0,active:void 0,title:"",type:void 0},u=o(x(s),2),d=u[0],f=u[1];return b.createElement(I,{className:"admin-search-panel",model:d,labelWidth:"auto",key:i,labelPosition:"before"},b.createElement(L,{name:"title",label:se(n,"title.label","Title")},b.createElement(O,{value:d.title})),b.createElement(L,{name:"active",label:se(n,"active.label","Active")},b.createElement(H,{data:rt(r,"switch-state"),value:d.active})),b.createElement(L,{name:"type",label:se(n,"type.label","Type")},b.createElement(H,{data:rt(r,"setting-type"),value:d.type})),b.createElement(L,{name:"position",label:se(n,"position.label","Position")},b.createElement(H,{data:rt(r,"setting-position"),value:d.position})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"position",value:d.position,type:"="},{key:"type",value:d.type,type:"="},{key:"active",value:d.active,type:"="},{key:"title",value:d.title,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){f(p({},s)),null==t||t.reset(),c()}},ue(n,"reset.text","Reset"))))},Lt=function(e){var t=e.pageVersion,n=S(Tt),r=n.pageConfig,a=n.fetchConfig,l=n.ctx,o=n.ctxState,i=n.refs;return b.createElement($,{toolbar:function(){return function(e,t,n,r){return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(It,{ctx:n,pageConfig:e,fetchConfig:t})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==n?void 0:n.refresh()}},ue(e,"refresh.text","Refresh")),b.createElement(ge,{ctx:n,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return P(r,"formdlg.open",{type:le.CREATE,ctx:n,record:{active:"0",type:"0",router_name:"",sort:0},title:ue(e,"add.text","Create Setting")})}},ue(e,"add.text","Add")))))}(r,a,l,i)},data:null==o?void 0:o.data,loading:null==o?void 0:o.loading,style:null==o?void 0:o.style,idField:"id",treeField:"title",key:"tree-table-"+t},b.createElement(F,{field:"title",title:se(r,"title.label","Title"),width:"220px"}),b.createElement(F,{field:"icon",title:se(r,"icon.label","Icon"),align:"center",width:"50px",render:function(e){var t=e.value;return b.createElement("span",{className:"iconfont "+t})}}),b.createElement(F,{field:"active",title:se(r,"active.label","Active"),align:"center",width:"80px",render:function(e){var t=e.value;return $e(a,"switch-state",t)}}),b.createElement(F,{field:"position",title:se(r,"position.label","Position"),align:"center",width:"80px",render:function(e){var t=e.value;return $e(a,"setting-position",t)}}),b.createElement(F,{field:"type",title:se(r,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return $e(a,"setting-type",t)}}),b.createElement(F,{field:"router_name",title:se(r,"router_name.label","RouterName"),align:"left",render:qe,width:"180px"}),b.createElement(F,{field:"url",title:se(r,"url.label","URL"),align:"left",width:"300px"}),b.createElement(F,{field:"sort",title:se(r,"sort.label","Sort"),align:"left",width:"80px"}),b.createElement(F,{field:"create_time",title:se(r,"create_time.label","CreateTime"),width:"180px"}),b.createElement(F,{field:"update_time",title:se(r,"update_time.label","UpdateTime"),width:"180px"}),b.createElement(z,{frozen:!0,align:"right",width:"80px"},b.createElement(W,null,b.createElement(F,{align:"center",render:function(e){e.value;var t=e.row;e.rowIndex;return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:l,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(i,"formdlg.open",{ctx:l,record:t,type:le.UPDATE,title:"".concat(ue(r,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:l,point:"delete"},b.createElement(U,{onClick:function(){return null==l?void 0:l.publish("remove",{id:t.id})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},Ot=function(e){var t=e.ctx,n=e.type,r=e.record,a=e.pageConfig,l=e.fetchConfig,i=e.close,c=e.refs,s=o(x(r),2),u=s[0],d=s[1],f=C((function(){var e;return new we(null==t||null===(e=t.getMethod("getOriginalData"))||void 0===e?void 0:e()).tree(0,(function(e){return{id:e.id,text:e.title,children:[]}}),{id:0,text:ue(a,"none_parent","None Parent"),children:[]})}),[t.config.data]);w((function(){t.setMethod("submitForm",m),t.setMethod("setRouterNameValue",(function(e){var t=e.row;e.column;d(p(p({},u),{},{router_name:t.name,url:t.url})),P(c,"routerlistdlg.close")}))}),[]);var m=function(){var e={object:{id:parseInt(u.id),title:u.title,router_name:u.router_name,icon:u.icon,active:parseInt(u.active),position:parseInt(u.position),type:parseInt(u.type),sort:parseInt(u.sort),pid:parseInt(u.pid),url:u.url},conditions:[]};n===le.UPDATE&&e.conditions.push({key:"id",value:r.id}),ct.saveResult(null==t?void 0:t.name(),n,e,(function(){me.success(oe("save_success","Message")),t.refresh(),i()})).then((function(e){}))};return b.createElement(I,{model:u,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{title:{required:!0}},style:{minWidth:500,padding:"20px"},onChange:function(e,t){d(p(p({},u),{},h({},e,t)))}},b.createElement(L,{name:"title",label:se(a,"title.label","Title")+":"},b.createElement(O,{placeholder:se(a,"title.placeholder",""),value:u.title})),b.createElement(L,{name:"router_name",label:se(a,"router_name.label","Router Name")+":"},b.createElement(O,{placeholder:se(a,"router_name.placeholder",""),value:u.router_name,addonRight:function(){var e={title:ue(a,"router_title","Router List")};return b.createElement("span",{style:{paddingLeft:"8px"}},b.createElement("span",{className:"textbox-icon iconfont icon-list2 color-dark-blue",onClick:function(){return P(c,"routerlistdlg.open",e)}}))}})),b.createElement(L,{name:"icon",label:se(a,"icon.label","Icon")+":"},b.createElement(O,{placeholder:se(a,"icon.placeholder",""),value:u.icon})),b.createElement(L,{name:"active",label:se(a,"active.label","Status")+":"},b.createElement("div",null,rt(l,"switch-state").map((function(e){return b.createElement("span",{key:e.value},b.createElement(Y,{value:e.value,groupValue:u.active+"",inputId:"active-"+e.value}),b.createElement(Q,{htmlFor:"active-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),b.createElement(L,{name:"type",label:se(a,"type.label","Type")+":"},b.createElement("div",null,rt(l,"setting-type").map((function(e){return b.createElement("span",{key:e.value},b.createElement(Y,{value:e.value,groupValue:u.type+"",inputId:"type-"+e.value}),b.createElement(Q,{htmlFor:"type-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),b.createElement(L,{name:"position",label:se(a,"position.label","Position")+":"},b.createElement("div",null,rt(l,"setting-position").map((function(e){return b.createElement("span",{key:e.value},b.createElement(Y,{value:e.value,groupValue:u.position+"",inputId:"position-"+e.value}),b.createElement(Q,{htmlFor:"position-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),b.createElement(L,{name:"sort",label:se(a,"sort.label","Sort")+":"},b.createElement(Z,{placeholder:se(a,"sort.placeholder",""),value:u.sort})),b.createElement(L,{name:"pid",label:se(a,"pid.label","Pid")+":"},b.createElement(J,{placeholder:se(a,"pid.placeholder",""),editable:!0,data:f,value:u.pid,onChange:function(e){return d(p(p({},u),{},{pid:e}))}})),b.createElement("div",{className:"yp-form-submit"},b.createElement(U,{style:{width:80},onClick:m},ue(a,"submit.text","Submit")),b.createElement(U,{style:{width:80},onClick:i},ue(a,"close.text","Close"))))},Ut=b.createContext({pageConfig:{},fetchConfig:{}}),jt=function(e){var t=e.ctx,n=e.pageConfig,r=e.fetchConfig,a={name:"",type:""},l=o(x(a),2),i=l[0],c=l[1],s=o(x(0),2),u=s[0];s[1];return b.createElement(I,{className:"admin-search-panel",model:i,key:u,labelWidth:"auto",labelPosition:"before"},b.createElement(L,{name:"name",label:se(n,"name.label","Name")},b.createElement(O,{value:i.name})),b.createElement(L,{name:"type",label:se(n,"type.label","Type")},b.createElement(H,{data:rt(r,"router-type"),value:i.type})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:i.name,type:"LIKE"},{key:"type",value:i.type,type:"EQ",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){c(p({},a)),null==t||t.reset()}},ue(n,"reset.text","Reset"))))},Ft=function(e){var t=e.selectedRow,n=e.scene,r=S(Ut),a=r.pageConfig,l=r.fetchConfig,i=r.ctx,c=r.ctxState,s=r.refs,u=o(x(0),2),d=u[0],f=u[1],m=function(){return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(jt,{ctx:i,pageConfig:a,fetchConfig:l})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==i?void 0:i.refresh()}},ue(a,"refresh.text","Refresh")),b.createElement(ge,{ctx:i,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return P(s,"formDataRefDlg.open",{type:le.CREATE,ctx:i,record:{name:""},title:ue(a,"add.text","Create Router")})}},ue(a,"add.text","Add")))))},p=function(e){e.value;var t=e.row;e.rowIndex;return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:i,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(s,"formDataRefDlg.open",{ctx:i,record:t,type:le.UPDATE,title:"".concat(ue(a,"update.text","Update: {#name}")).replace("{#name}",t.title)})},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:i,point:"delete"},b.createElement(U,{onClick:function(){return null==i?void 0:i.publish("remove",[{key:"name",value:t.name},{key:"type",value:t.type}])},plain:!0,iconCls:"iconfont icon-del color-red"})))};return w((function(){f(d+1)}),[l]),"setting"===n?b.createElement(V,{toolbar:m,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,onCellDblClick:t,key:d},b.createElement(F,{field:"name",title:se(a,"name.label","Name"),render:qe}),b.createElement(F,{field:"url",title:se(a,"type.label","URL"),align:"center",render:qe}),b.createElement(F,{field:"type",title:se(a,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return $e(l,"router-type",t)}}),b.createElement(z,{frozen:!0,align:"right",width:"120px"},b.createElement(W,null,b.createElement(F,{align:"center",render:p,width:"120px"})))):b.createElement(V,{toolbar:m,data:(null==c?void 0:c.data)||[],loading:null==c?void 0:c.loading,style:null==c?void 0:c.style,key:d},b.createElement(F,{field:"name",title:se(a,"name.label","Name"),render:qe}),b.createElement(F,{field:"url",title:se(a,"type.label","URL"),align:"center",render:qe}),b.createElement(F,{field:"type",title:se(a,"type.label","Type"),align:"center",width:"120px",render:function(e){var t=e.value;return $e(l,"router-type",t)}}),b.createElement(F,{field:"data",title:se(a,"data.label","Data")}),b.createElement(F,{field:"create_time",title:se(a,"create_time.label","CreateTime"),width:"180px"}),b.createElement(F,{field:"update_time",title:se(a,"update_time.label","UpdateTime"),width:"180px"}),b.createElement(z,{frozen:!0,align:"right",width:"120px"},b.createElement(W,null,b.createElement(F,{align:"center",render:p,width:"120px"}))))},Mt=function(e){var t=e.ctx,n=e.type,r=e.record,a=e.pageConfig,l=e.fetchConfig,i=e.close,c=(e.refs,o(x(r),2)),s=c[0],u=c[1];w((function(){null==t||t.setMethod("onSubmit",d)}),[]);var d=function(){var e={object:{name:s.name,url:s.url,type:s.type,data:s.data},conditions:[]};n===le.UPDATE&&(e.conditions.push({key:"name",value:r.name}),e.conditions.push({key:"type",value:r.type})),ct.saveResult(null==t?void 0:t.name(),n,e,(function(){me.success(oe("save_success","Message")),t.refresh(),i()})).then((function(e){}))};return b.createElement(I,{model:s,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},url:{required:!0},type:{required:!0}},onChange:function(e,t){u(p(p({},s),{},h({},e,t)))},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"name",label:se(a,"name.label","Name")+":"},b.createElement(O,{placeholder:se(a,"name.placeholder",""),value:s.name})),b.createElement(L,{name:"url",label:se(a,"url.label","Url")+":"},b.createElement(O,{placeholder:se(a,"url.placeholder",""),value:s.url})),b.createElement(L,{name:"type",label:se(a,"type.label","Type")+":"},b.createElement("div",null,rt(l,"router-type").map((function(e){return b.createElement("span",{key:e.value},b.createElement(Y,{value:e.value,groupValue:s.type+"",inputId:"type-"+e.value,disabled:n===le.UPDATE}),b.createElement(Q,{htmlFor:"type-"+e.value,style:{margin:"0 5px",width:"auto"}},e.text))})))),b.createElement(L,{name:"data",label:se(a,"data.label","Data")+":"},b.createElement(O,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:se(a,"data.placeholder",""),value:s.data})),b.createElement("div",{className:"admin-form-submit"},b.createElement(U,{style:{width:80},onClick:d},ue(a,"submit.text","Submit")),b.createElement(U,{style:{width:80},onClick:i},ue(a,"close.text","Close"))))},Vt=function(e){var t=e.value,n=e.props,r=e.close,a=S(Ut),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0},b.createElement(Mt,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},zt="router",Wt=[{type:ae.AND,value:["/resource/router/add"],key:"add"},{type:ae.AND,value:["/resource/router/update"],key:"update"},{type:ae.AND,value:["/resource/router/delete"],key:"delete"},{type:ae.AND,value:["/resource/router/edit"],key:"edit"}],Bt=xt({name:"Router",fetchConfig:function(){return ct.configs(zt)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.selectedRow,a=e.scene,l=gt({name:zt,fetch:function(e){return ct.list(zt,e)},checkAccessItems:Wt,defaultPageSize:20});w((function(){l.ctx.search()}),[l.version]),l.ctx.registerEvent("remove",Qe(l.ctx));var o=ve();return b.createElement(Ut.Provider,{value:{ctx:l.ctx,ctxState:l.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:o}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:l.ctx,ctxState:l.ctxState})}},b.createElement(Vt,p({},o)),b.createElement(Ft,{selectedRow:r,scene:a})))})),qt=function(e){var t=e.value,n=e.props,r=e.close,a=S(Tt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement(Ot,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c})))},Gt=function(e){var t=e.value,n=e.props,r=(e.close,S(Tt).ctx);return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},b.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},b.createElement(Bt,{selectedRow:function(e){var t,n=e.row,a=e.column;return null==r||null===(t=r.getMethod("setRouterNameValue"))||void 0===t?void 0:t({row:n,column:a})},scene:"setting"})))},Kt="setting",Ht=[{type:ae.AND,value:["/resource/setting/add"],key:"add"},{type:ae.AND,value:["/resource/setting/update"],key:"update"},{type:ae.AND,value:["/resource/setting/delete"],key:"delete"},{type:ae.AND,value:["/resource/setting/edit"],key:"edit"}],$t=xt({name:"Setting",fetchConfig:function(){return ct.configs(Kt)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.fetchVersion,a=ht({name:Kt,fetch:function(e){return ct.list(Kt,e)},checkAccessItems:Ht,defaultPageSize:10,isTreeData:!0});a.ctx.registerEvent("remove",Qe(a.ctx));var l=ve(),o=ve();return w((function(){a.ctx.search()}),[]),b.createElement(Tt.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:l,routerlistdlg:o}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:a.ctx,ctxState:a.ctxState})}},b.createElement(qt,p({},l)),b.createElement(Gt,p({},o)),b.createElement(Lt,{pageVersion:r})))})),Yt=new(function(){return f((function e(){u(this,e)}),[{key:"captcha",value:function(){return at().post(ot("loginCaptcha"))}},{key:"login",value:(e=s(i().mark((function e(t,n,r){var a,l,o;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,at().post(ot("loginSubmit"),t);case 2:a=e.sent,l=a.code,o=a.data,200===l?n(o,l):r(o,l);case 6:case"end":return e.stop()}}),e)}))),function(t,n,r){return e.apply(this,arguments)})},{key:"configs",value:function(){return at().post(ot("loginConfig"))}}]);var e}()),Qt=function(e){var t=e.pageConfig,n=e.rules,r=Re(),a=o(x({username:"",captcha:"",password:"",code:"",token:""}),2),l=a[0],i=a[1],c=mt(),s=function(){Yt.captcha().then((function(e){var t=e.data;i(p(p({},l),{},{captcha:t.base64,token:t.token,code:""}))}))};return w((function(){s(),c.autoRedirect()}),[]),b.createElement(I,{model:l,labelWidth:0,labelAlign:"right",errorType:"tooltip",rules:null!=n?n:{username:{required:!0},password:{required:!0},code:{required:!0}},style:{maxWidth:500}},b.createElement(L,{name:"username"},b.createElement(O,{iconCls:"iconfont "+_(t.fields,"username.icon","icon-username"),placeholder:_(t.fields,"username.placeholder","username..."),value:l.username})),b.createElement(L,{name:"password"},b.createElement(X,{iconCls:"iconfont "+_(t.fields,"password.icon","icon-password"),placeholder:_(t.fields,"password.placeholder","password..."),value:l.password})),b.createElement(L,{name:"code"},b.createElement(O,{iconCls:"iconfont "+_(t.fields,"code.icon","icon-captcha"),placeholder:_(t.fields,"code.placeholder","verification code..."),value:l.code,addonRight:function(){return b.createElement("img",{src:l.captcha,alt:"",style:{width:"150px",height:"100%"},onClick:s})}})),b.createElement(L,null,b.createElement(U,{onClick:function(){var e={code:l.code,username:l.username,password:l.password,token:l.token};Yt.login(e,(function(e){r(Ie({token:e.token,info:e.user,error:function(){me.error(_(t.params,"tips.loginError"))}})),c.autoRedirect()}),(function(){s()}))},btnCls:"login_btn"},_(t.params,"submit.text","Sign In"))))},Zt=function(){var e=he(!0),t=e.localeOptions,n=e.changeLocale;return b.createElement(ee,{text:"",plain:!0,iconCls:"iconfont icon-language",menu:function(){return b.createElement(te,null,Object.keys(t).map((function(e,n){return b.createElement(ne,{text:t[e],key:n,value:e})})))},onMenuItemClick:n})},Jt=xt({name:"Login",fetchConfig:Yt.configs})((function(e){var t,n=e.pageConfig,r=e.fetchConfig,a=e.rules;return b.createElement("div",{className:"layui-carousel video_mask bg-img",id:"login_carousel",style:r.bg?{background:"url("+r.bg+") center center no-repeat",backgroundSize:"cover"}:{}},b.createElement(Zt,null),b.createElement("div",{className:"login layui-anim layui-anim-up"},b.createElement("h1",null,null!==(t=r.title)&&void 0!==t?t:n.title),b.createElement(Qt,{pageConfig:n,fetchConfig:r,rules:a})))})),Xt=b.createContext({pageConfig:{},fetchConfig:{}}),en=function(e){var n=e.ctx,r=(e.type,e.record),a=e.pageConfig,l=(e.fetchConfig,e.close),c=o(x(),2),u=c[0],d=c[1],f=o(x([]),2),m=f[0],p=f[1],h=A(null),g=o(x([]),2),v=g[0],y=g[1],E=o(x([]),2),C=E[0],k=E[1],S=A(null);w((function(){null==n||n.setMethod("onSubmit",_),R()}),[]);var R=function(){var e=s(i().mark((function e(){var t,n,a,l,o,c,s,u,f,p;return i().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,st.roles();case 2:return t=e.sent,n=Xe(t.data||[]),a=[],e.next=7,st.permissions();case 7:return l=e.sent,o=Ze(l.data||[]),c=[],e.next=12,st.getChildren({name:r.name});case 12:s=e.sent,u=s.code,f=s.data,200===u&&(p=new Set,f&&f.forEach((function(e){p.add(e.name),1==e.item_type?C.push(e.name):m.push(e.name)})),Je(o,p,c),d(o),c.forEach((function(e){h.current.checkNode(e)})),Je(n,p,a),y(n),a.forEach((function(e){S.current.checkNode(e)})));case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),_=function(){st.addPermissionChildren({name:r.name,children:[].concat(t(m),t(C))}).then((function(e){200===e.code&&($toast.success(ue(a,"assign_success","assign permission successfully!")),l())}))};return b.createElement(B,{style:{width:800,height:500}},b.createElement(q,{region:"west",style:{width:220}},b.createElement(G,{bodyStyle:{padding:"10px",height:"100%"}},b.createElement(K,{selectLeafOnly:!0,checkbox:!0,data:v,ref:S,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),k(t)}}}))),b.createElement(q,{region:"center",style:{height:"100%"}},b.createElement(G,{style:{minWidth:500},bodyStyle:{padding:"10px",height:"412px"},header:function(){return b.createElement(O,{style:{width:"100%"},placeholder:"Searching...",key:"assign-permission",onChange:function(e){h.current.doFilter(e)}})}},b.createElement(K,{selectLeafOnly:!0,checkbox:!0,data:u,ref:h,onCheckChange:function(e){if(e&&e.length>0){var t=[];e.forEach((function(e){e.id&&t.push(e.id)})),p(t)}}}))),b.createElement(q,{region:"south"},b.createElement("div",{className:"dialog-button"},b.createElement(U,{style:{width:80},onClick:_}," ",ue(a,"submit.text","Submit")," "),b.createElement(U,{style:{width:80},onClick:l}," ",ue(a,"close.text","Close")," "))))},tn=function(e){var t=e.value,n=e.props,r=e.close,a=S(Xt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement(en,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},nn=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),a=o(x(r),2),l=a[0],i=a[1],c=o(x(0),2),s=c[0],u=c[1],d=function(){u((function(e){return e+1}))};return b.createElement(I,{className:"admin-search-panel",model:l,key:s,labelWidth:"auto",labelPosition:"before"},b.createElement(L,{name:"name",label:se(n,"name.label","Name")},b.createElement(O,{value:l.name})),b.createElement(L,{name:"description",label:se(n,"description.label","Description")},b.createElement(O,{value:l.description})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:l.name,type:"LIKE"},{key:"description",value:l.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},r)),null==t||t.reset(),d()}},ue(n,"reset.text","Reset"))))},rn=Ct(V),an=function(){var e=S(Xt),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return b.createElement(rn,{toolbar:function(){return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(nn,{ctx:r,pageConfig:t,fetchConfig:n})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},ue(t,"refresh.text","Refresh")),b.createElement(ge,{ctx:r,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){P(l,"formdlg.open",{type:le.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:ue(t,"add.text","Create Role")})}},ue(t,"add.text","Add"))),b.createElement(ge,{ctx:r,point:"batch-delete"},b.createElement(U,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?me.error(oe("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:st.batchDeleteRole,params:{names:r.tableSlectionValue()}})}},ue(t,"batch_remove.text","Batch Remove")))))},data:(null==a?void 0:a.data)||[],loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},key:o},b.createElement(F,{field:"name",title:se(t,"name.label","Name"),width:"220px"}),b.createElement(F,{field:"rule_name",title:se(t,"rule_name.label","RuleName"),align:"left",render:qe,width:"180px"}),b.createElement(F,{field:"description",title:se(t,"description.label","Description"),align:"left",render:qe,width:"180px"}),b.createElement(F,{field:"create_time",title:se(t,"create_time.label","CreateTime"),width:"180px",render:Ke,sortable:!0}),b.createElement(F,{field:"update_time",title:se(t,"update_time.label","UpdateTime"),width:"180px",render:Ke}),b.createElement(z,{frozen:!0,align:"right",width:"100px"},b.createElement(W,null,b.createElement(F,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:r,point:"assign-permission"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"assigndlg.open",{ctx:r,record:n,title:"".concat(ue(t,"assign_permission.text","Assign Permission: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-permissions color-tomato"})),b.createElement(ge,{ctx:r,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"formdlg.open",{ctx:r,record:n,type:le.UPDATE,title:"".concat(ue(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:r,point:"delete"},b.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:st.deleteRole,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},ln=function(e){var t=e.ctx,n=e.type,r=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=o(We(r).toArray(),2),c=i[0],s=i[1],u=o(We(r).toArray(),1)[0];w((function(){t.setMethod("onSubmit",d)}),[]);var d=function(){n===le.CREATE&&st.addRole(c).then((function(e){var n=e.code;e.data;200==n&&(me.success(oe("add_role_success","Message","add role successfully!")),t.refresh(),l())})),n===le.UPDATE&&st.updateRole({source_name:u.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then((function(e){var n=e.code;e.data;200==n&&(me.success(oe("update_role_success","Message","update role successfully!")),t.refresh(),l())}))};return b.createElement(I,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},onChange:function(e,t){s(p(p({},c),{},h({},e,t)))},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"name",label:se(a,"name.label","Name")+":"},b.createElement(O,{placeholder:se(a,"name.placeholder",""),value:c.name})),b.createElement(L,{name:"description",label:se(a,"description.label","Description")+":"},b.createElement(O,{multiline:!0,placeholder:se(a,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),b.createElement("div",{className:"admin-form-submit"},b.createElement(U,{style:{width:80},iconCls:"icon-save",onClick:d},ue(a,"submit.text","Submit")),b.createElement(U,{style:{width:80},iconCls:"icon-cancel",onClick:l},ue(a,"close.text","Close"))))},on=function(e){var t=e.value,n=e.props,r=e.close,a=S(Xt),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement(ln,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},cn=[{type:ae.AND,value:["/rbac/permissions","/rbac/add-permission-children","/rbac/get-children"],key:"assign-permission"},{type:ae.AND,value:["/rbac/batch-delete-role"],key:"batch-delete"},{type:ae.AND,value:["/rbac/add-role"],key:"add"},{type:ae.AND,value:["/rbac/update-role"],key:"update"},{type:ae.AND,value:["/rbac/delete-role"],key:"delete"}],sn=xt({name:"Roles"})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=gt({name:"roles",fetch:function(e){return st.roles()},checkAccessItems:cn,defaultPageSize:30,selectionValue:function(e){return e.name}});w((function(){r.ctx.search()}),[r.version]),r.ctx.registerEvent("remove",Qe(r.ctx));var a=ve(),l=ve();return b.createElement(Xt.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,assigndlg:l}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:r.ctx,ctxState:r.ctxState})}},b.createElement(on,p({},a)),b.createElement(tn,p({},l)),b.createElement(an,null)))})),un=b.createContext({pageConfig:{},fetchConfig:{}}),dn=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",description:""}),a=o(x(r),2),l=a[0],i=a[1],c=o(x(0),2),s=c[0],u=c[1],d=function(){u((function(e){return e+1}))};return b.createElement(I,{className:"admin-search-panel",model:l,labelWidth:"auto",labelPosition:"before",key:s},b.createElement(L,{name:"name",label:se(n,"name.label","Name")},b.createElement(O,{value:l.name})),b.createElement(L,{name:"description",label:se(n,"description.label","Description")},b.createElement(O,{value:l.description})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:l.name,type:"LIKE"},{key:"description",value:l.description,type:"LIKE"}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{type:"reset",iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},r)),null==t||t.reset(),d()}},ue(n,"reset.text","Reset"))))},fn=Ct(V),mn=function(){var e=S(un),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs,o=e.version;return b.createElement(fn,{toolbar:function(){return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(dn,{ctx:r,pageConfig:t,fetchConfig:n})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},ue(t,"refresh.text","Refresh")),b.createElement(ge,{ctx:r,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"l-btn-icon-none iconfont icon-add color-dark-green",onClick:function(){P(l,"formdlg.open",{type:le.CREATE,ctx:r,record:{name:"",description:"",execute_name:""},title:ue(t,"add.text","Create Role")})}},ue(t,"add.text","Add"))),b.createElement(ge,{ctx:r,point:"batch-delete"},b.createElement(U,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){var e=null==r?void 0:r.tableSlectionValue();e&&0===e.length?me.error(oe("none_checkbox_warn","Message","Please select the object to operate!")):null==r||r.publish("remove",{fn:st.batchDeletePermission,params:{names:r.tableSlectionValue()}})}},ue(t,"batch_remove.text","Batch Remove"))),b.createElement(ge,{ctx:r,point:"fast-add-permission"},b.createElement(U,{plain:!0,className:"k-color-info",iconCls:"iconfont icon-add3 color-golden-rod",onClick:function(){P(l,"fastadddlg.open",{ctx:r,record:{name:"",resource:""},title:ue(t,"fast_add.text","Fast Add")})}},ue(t,"fast_add.text","Fast Add")))))},data:(null==a?void 0:a.data)||[],idField:"name",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)},loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,lazy:!0,key:o},b.createElement(F,{field:"name",title:se(t,"name.label","Name"),width:"220px"}),b.createElement(F,{field:"rule_name",title:se(t,"rule_name.label","RuleName"),align:"left",render:qe,width:"180px"}),b.createElement(F,{field:"description",title:se(t,"description.label","Description"),align:"left",render:qe,width:"180px"}),b.createElement(F,{field:"create_time",title:se(t,"create_time.label","CreateTime"),width:"180px",render:Ke,sortable:!0}),b.createElement(F,{field:"update_time",title:se(t,"update_time.label","UpdateTime"),width:"180px",render:Ke,sortable:!0}),b.createElement(z,{frozen:!0,align:"right",width:"80px"},b.createElement(W,null,b.createElement(F,{align:"center",render:function(e){e.value;var n=e.row;e.rowIndex;return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:r,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"formdlg.open",{ctx:r,record:n,type:le.UPDATE,title:"".concat(ue(t,"update.text","Update: {#name}")).replace("{#name}",n.name)})},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:r,point:"delete"},b.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{fn:st.deletePermission,params:{name:n.name}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"}))))},pn=function(e){var t=e.ctx,n=e.type,r=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=o(x(r),2),c=i[0],s=i[1],u=o(We(r).toArray(),1)[0];w((function(){null==t||t.setMethod("onSubmit",d)}),[]);var d=function(){n===le.CREATE&&st.addPermission(c).then((function(e){var n=e.code;e.data;200==n&&(t.refresh(),l())})),n===le.UPDATE&&st.updatePermission({source_name:u.name,target_name:c.name,description:c.description,rule_name:c.ruleName}).then((function(e){var n=e.code;e.data;200==n&&(t.refresh(),l())}))};return b.createElement(I,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},onChange:function(e,t){s(p(p({},c),{},h({},e,t)))},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"name",label:se(a,"name.label","Name")+":"},b.createElement(O,{placeholder:se(a,"name.placeholder",""),value:c.name})),b.createElement(L,{name:"description",label:se(a,"description.label","Description")+":"},b.createElement(O,{multiline:!0,placeholder:se(a,"description.placeholder",""),value:c.description,style:{height:"80px",padding:"5px 2px"}})),b.createElement("div",{className:"admin-form-submit"},b.createElement(U,{style:{width:80},iconCls:"icon-save",onClick:d},ue(a,"submit.text","Submit")),b.createElement(U,{style:{width:80},iconCls:"icon-cancel",onClick:l},ue(a,"close.text","Close"))))},hn=function(e){var t=e.value,n=e.props,r=e.close,a=S(un),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,draggable:!0,resizable:!0},b.createElement(pn,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},gn=function(e){var t=e.ctx,n=(e.type,e.record),r=e.pageConfig,a=(e.fetchConfig,e.close),l=o(We(n).toArray(),1)[0];w((function(){null==t||t.setMethod("onSubmit",i)}),[]);var i=function(){var e={resource:l.resource,name:l.name};st.fastAddPermission(e).then((function(e){200===e.code&&(me.success(oe("save_success","Message","Save Success!")),t.refresh(),a())}))};return b.createElement(I,{model:l,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0}},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"resource",label:se(r,"fast_add_resource.label","Resource")+":"},b.createElement(O,{placeholder:se(r,"fast_add_resource.placeholder",""),value:l.resource})),b.createElement(L,{name:"name",label:se(r,"fast_add_name.label","Name")+":"},b.createElement(O,{placeholder:se(r,"fast_add_name.placeholder",""),value:l.name})),b.createElement("div",{className:"admin-form-submit"},b.createElement(U,{style:{width:80},iconCls:"icon-save",onClick:i},ue(r,"submit.text","Submit")),b.createElement(U,{style:{width:80},iconCls:"icon-cancel",onClick:a},ue(r,"close.text","Close"))))},vn=function(e){var t=e.value,n=e.props,r=e.close,a=S(un),l=a.ctx,o=a.pageConfig,i=a.fetchConfig;a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement(gn,p(p({className:"f-full",ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r})))},yn=[{type:ae.AND,value:["/rbac/fast-add-permission"],key:"fast-add-permission"},{type:ae.AND,value:["/rbac/batch-delete-permission"],key:"batch-delete"},{type:ae.AND,value:["/rbac/add-permission"],key:"add"},{type:ae.AND,value:["/rbac/update-permission"],key:"update"},{type:ae.AND,value:["/rbac/delete-permission"],key:"delete"}],En=xt({name:"Permissions"})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=ht({name:"permissions",fetch:function(e){return st.permissions()},checkAccessItems:yn,defaultPageSize:50,selectionValue:function(e){return e.name}});w((function(){r.ctx.search()}),[r.version]);var a=ve(),l=ve();return r.ctx.registerEvent("remove",Qe(r.ctx)),b.createElement(un.Provider,{value:{version:r.version,ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formdlg:a,fastadddlg:l}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:r.ctx,ctxState:r.ctxState})}},b.createElement(hn,p({},a)),b.createElement(vn,p({},l)),b.createElement(mn,null)))})),bn=b.createContext({pageConfig:{},fetchConfig:{}}),xn=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{name:"",sign:""}),a=o(x(r),2),l=a[0],i=a[1],c=o(x(0),2),s=c[0],u=c[1],d=function(){u((function(e){return e+1}))};return b.createElement(I,{className:"admin-search-panel",labelWidth:"auto",key:s,model:l,onChange:function(e,t){i(p(p({},l),{},h({},e,t)))},labelPosition:"before"},b.createElement(L,{name:"name",label:se(n,"name.label","Name")},b.createElement(O,{value:l.name})),b.createElement(L,{name:"sign",label:se(n,"sign.label","Sign")},b.createElement(O,{value:l.sign})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"name",value:l.name,type:"LIKE",filter_empty:!0},{key:"sign",value:l.sign,type:"LIKE",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(r),null==t||t.reset(),d()}},ue(n,"reset.text","Reset"))))},Cn=Ct(V),kn=function(){var e=S(bn),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return b.createElement(b.Fragment,null,b.createElement(Cn,{toolbar:function(){var e={record:{sign:"",name:"",remark:""},type:le.CREATE,ctx:r,title:ue(t,"add.text","Create Dict")};return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(xn,{ctx:r,pageConfig:t,fetchConfig:n})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},ue(t,"refresh.text","Refresh")),b.createElement(ge,{ctx:r,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return P(l,"formDataRefDlg.open",e)}},ue(t,"add.text","Add"))),b.createElement(ge,{ctx:r,point:"delete"},b.createElement(U,{plain:!0,className:"k-color-error",iconCls:"iconfont icon-del4 color-red",onClick:function(){return null==r?void 0:r.publish("batchRemove",{key:"id",values:r.tableSlectionValue()})}},ue(t,"batch_remove.text","Batch Remove")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style,idField:"id",selection:null==a?void 0:a.selectionValues,onSelectionChange:function(e){return null==r?void 0:r.tableSelectionChange(e)}},b.createElement(F,{field:"name",title:se(t,"name.label","Name"),width:"160px"}),b.createElement(F,{field:"sign",title:se(t,"sign.label","Sign"),width:"150px"}),b.createElement(F,{field:"remark",title:se(t,"remark.label","Remark"),width:"180px"}),b.createElement(F,{field:"create_time",title:se(t,"create_time.label","CreateTime"),width:"120px"}),b.createElement(F,{field:"update_time",title:se(t,"update_time.label","UpdateTime"),width:"120px"}),b.createElement(z,{frozen:!0,align:"right",width:"150px"},b.createElement(W,null,b.createElement(F,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:le.UPDATE,title:"".concat(ue(t,"update.text","Update: {#name}")).replace("{#name}",n.name)}),o={sign:n.sign,title:ue(t,"item_list.title","Dict Item: {#name}").replace("{#name}",n.name)};return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:r,point:"items"},b.createElement(D,{content:ue(t,"item_list.text","Dict Item"),position:"top"},b.createElement(U,{onClick:function(){return P(l,"dictItemDataRefDlg.open",o)},plain:!0,iconCls:"iconfont icon-zidianxiang2 color-dark-cyan"}))),b.createElement(ge,{ctx:r,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:r,point:"delete"},b.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{id:n.id})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"150px"})))))},wn=b.createContext({pageConfig:{},fetchConfig:{}}),Sn=function(e){var t=e.ctx,n=e.pageConfig,r=(e.fetchConfig,{label:"",value:""}),a=o(x(r),2),l=a[0],i=a[1],c=o(x(0),2),s=c[0],u=c[1],d=function(){u((function(e){return e+1}))};return b.createElement(I,{className:"admin-search-panel",model:l,key:s,labelWidth:"auto",onChange:function(e,t){i(p(p({},l),{},h({},e,t)))},labelPosition:"before"},b.createElement(L,{name:"label",label:se(n,"label.label","Label")},b.createElement(O,{value:l.label})),b.createElement(L,{name:"value",label:se(n,"value.label","Value")},b.createElement(O,{value:l.value})),b.createElement(L,null,b.createElement(U,{iconCls:"iconfont icon-search color-deep-sky-blue",onClick:function(){var e={conditions:[{key:"label",value:l.label,type:"LIKE",filter_empty:!0},{key:"value",value:l.value,type:"=",filter_empty:!0}]};null==t||t.search(e)},style:{marginRight:"5px"}},ue(n,"search.text","Search")),b.createElement(U,{iconCls:"iconfont icon-refresh2 color-deep-sky-blue",onClick:function(){i(p({},r)),null==t||t.reset(),d()}},ue(n,"reset.text","Reset"))))},Rn=function(){var e=S(wn),t=e.pageConfig,n=e.fetchConfig,r=e.ctx,a=e.ctxState,l=e.refs;return b.createElement(b.Fragment,null,b.createElement(V,{toolbar:function(){var e={record:{data:"",label:"",value:""},type:le.CREATE,ctx:r,title:ue(t,"add.text","Create Dict")};return b.createElement(b.Fragment,null,b.createElement("div",null,b.createElement(Sn,{ctx:r,pageConfig:t,fetchConfig:n})),b.createElement("div",{style:{padding:4}},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-refresh color-green",onClick:function(){return null==r?void 0:r.refresh()}},ue(t,"refresh.text","Refresh")),b.createElement(ge,{ctx:r,point:"add"},b.createElement(U,{plain:!0,className:"k-color-success",iconCls:"iconfont icon-add color-dark-green",onClick:function(){return P(l,"formDataRefDlg.open",e)}},ue(t,"add.text","Add")))))},data:null==a?void 0:a.data,loading:null==a?void 0:a.loading,style:null==a?void 0:a.style},b.createElement(F,{field:"label",title:se(t,"label.label","Label"),width:"160px"}),b.createElement(F,{field:"value",title:se(t,"value.label","Value"),align:"center",width:"180px"}),b.createElement(F,{field:"data",title:se(t,"data.label","Data"),align:"center",width:"180px"}),b.createElement(z,{frozen:!0,align:"right",width:"80px"},b.createElement(W,null,b.createElement(F,{align:"center",render:function(e){e.value;var n=e.row,a=(e.rowIndex,{record:n,ctx:r,type:le.UPDATE,title:"".concat(ue(t,"update.text","Update: {#name}")).replace("{#name}",n.label)});return b.createElement(b.Fragment,null,b.createElement(ge,{ctx:r,point:"update"},b.createElement(U,{plain:!0,onClick:function(){return P(l,"formDataRefDlg.open",a)},iconCls:"iconfont icon-edit color-dark-green"})),b.createElement(ge,{ctx:r,point:"delete"},b.createElement(U,{onClick:function(){return null==r?void 0:r.publish("remove",{id:n.id,data:{sign:n.sign}})},plain:!0,iconCls:"iconfont icon-del color-red"})))},width:"80px"})))))},An=function(e){var t=e.ctx,n=e.type,r=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=e.refs,c=o(We(r).toArray(),1)[0];w((function(){null==t||t.setMethod("onSubmit",(function(e){return s(e)}))}),[]);var s=function(e){var a={object:{id:parseInt(c.id),label:c.label,sign:e,value:c.value,data:c.data},conditions:[]};n===le.UPDATE&&a.conditions.push({key:"id",value:r.id}),ct.saveResult(null==t?void 0:t.name(),n,a,(function(){me.success(oe("save_success","Message")),null==t||t.refresh(),l()})).then((function(e){}))};return b.createElement(I,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{label:{required:!0},value:{required:!0}},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"label",label:se(a,"label.label","Label")+":"},b.createElement(O,{placeholder:se(a,"label.placeholder",""),value:c.label})),b.createElement(L,{name:"value",label:se(a,"value.label","Value")+":"},b.createElement(O,{placeholder:se(a,"value.placeholder",""),value:c.value})),b.createElement(L,{name:"data",label:se(a,"data.label","Data")+":"},b.createElement(O,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:se(a,"data.placeholder",""),value:c.data,addonRight:function(){return b.createElement("span",{style:{paddingLeft:"8px"}},b.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},_n=function(e){var t=e.value,n=e.props,r=e.close,a=S(wn),l=a.ctx,o=a.pageConfig,i=a.fetchConfig,c=a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement("div",{className:"f-full"},b.createElement(An,p(p({ctx:l,pageConfig:o,fetchConfig:i},n),{},{close:r,refs:c}))),b.createElement("div",{className:"dialog-button"},b.createElement(U,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e(n.sign)},iconCls:"iconfont icon-save color-navy"},ue(o,"submit.text","Submit")),b.createElement(U,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},ue(o,"cancel.text","Cancel"))))},Nn="dict-item",Pn=Ye(Nn),Dn=xt({name:"DictItem",fetchConfig:function(){return ct.configs(Nn)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=e.sign,a=gt({name:Nn,fetch:function(e){return ct.list(Nn,e)},checkAccessItems:Pn,fixedConditions:[{key:"sign",value:r}]},r);a.ctx.registerEvent("remove",Qe(a.ctx));var l=ve({sign:r});return w((function(){a.ctx.search()}),[]),b.createElement(wn.Provider,{value:{ctx:a.ctx,ctxState:a.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:l}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:a.ctx,ctxState:a.ctxState})}},b.createElement(_n,p({},l)),b.createElement(Rn,null)))})),Tn=function(e){var t=e.ctx,n=(e.ctxState,e.type),r=e.record,a=e.pageConfig,l=(e.fetchConfig,e.close),i=e.refs,c=o(We(r).toArray(),1)[0];w((function(){null==t||t.setMethod("onSubmit",s)}),[]);var s=function(){var e={object:{id:parseInt(c.id),name:c.name,sign:c.sign,remark:c.remark},conditions:[]};n===le.UPDATE&&e.conditions.push({key:"id",value:r.id}),ct.saveResult(null==t?void 0:t.name(),n,e,(function(){me.success(oe("save_success","Message")),t.refresh(),l()})).then((function(e){}))};return b.createElement(I,{model:c,labelWidth:120,labelAlign:"left",errorType:"tooltip",rules:{name:{required:!0},sign:{required:!0}},style:{minWidth:500,padding:"20px"}},b.createElement(L,{name:"name",label:se(a,"name.label","Name")+":"},b.createElement(O,{placeholder:se(a,"name.placeholder",""),value:c.name})),b.createElement(L,{name:"sign",label:se(a,"sign.label","Sign")+":"},b.createElement(O,{placeholder:se(a,"sign.placeholder",""),disabled:n===le.UPDATE,value:c.sign})),b.createElement(L,{name:"remark",label:se(a,"remark.label","Remark")+":"},b.createElement(O,{multiline:!0,style:{height:120,padding:"5px 2px"},placeholder:se(a,"remark.placeholder",""),value:c.remark,addonRight:function(){return b.createElement("span",{style:{paddingLeft:"8px"}},b.createElement("span",{className:"textbox-icon iconfont icon-view-001",onClick:function(){var e,t;return null===(e=(t=i.routerDataRefDlg).open)||void 0===e?void 0:e.call(t)}}))}})))},In=function(e){var t=e.value,n=e.props;e.close;return S(bn),b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref,style:{width:800}},b.createElement("div",{className:"f-full",style:{paddingTop:"8px"}},b.createElement(Dn,p({},n))))},Ln=function(e){var t=e.value,n=e.props,r=e.close,a=S(bn),l=a.ctx,o=a.ctxState,i=a.pageConfig,c=a.fetchConfig,s=a.refs;return b.createElement(T,{title:n.title,bodyCls:"f-column",modal:!0,closed:!0,ref:t.ref},b.createElement("div",{className:"f-full"},b.createElement(Tn,p(p({ctx:l,ctxState:o,pageConfig:i,fetchConfig:c},n),{},{close:r,refs:s}))),b.createElement("div",{className:"dialog-button"},b.createElement(U,{style:{width:80},onClick:function(){var e;return null==l||null===(e=l.getMethod("onSubmit"))||void 0===e?void 0:e()},iconCls:"iconfont icon-save color-navy"},ue(i,"submit.text","Submit")),b.createElement(U,{style:{width:80},onClick:function(){return null==r?void 0:r()},iconCls:"iconfont icon-cancel color-maroon"},ue(i,"cancel.text","Cancel"))))},On="dict",Un=[{type:ae.AND,value:["/resource/dict-item/list"],key:"items"}].concat(t(Ye(On))),jn=xt({name:"Dict",fetchConfig:function(){return ct.configs(On)}})((function(e){var t=e.pageConfig,n=e.fetchConfig,r=gt({name:On,fetch:function(e){return ct.list(On,e)},checkAccessItems:Un});r.ctx.registerEvent("remove",Qe(r.ctx));var a=ve(),l=ve();return w((function(){r.ctx.search()}),[r.version]),b.createElement(bn.Provider,{value:{ctx:r.ctx,ctxState:r.ctxState,pageConfig:t,fetchConfig:n,refs:{formDataRefDlg:a,dictItemDataRefDlg:l}}},b.createElement(ye,{mode:"cover",footer:function(){return b.createElement(bt,{ctx:r.ctx,ctxState:r.ctxState})}},b.createElement(Ln,p({},a)),b.createElement(In,p({},l)),b.createElement(kn,null)))})),Fn=function(){return b.createElement("h1",null,"404!!!!!!!")},Mn=function(e){return x([{id:"demo",name:"test1",data:{width:200,height:100}},{id:"demo",name:"test3",data:{width:400,height:100,top:500,left:200}}]),b.createElement("h2",null,"developing......")},Vn=function(e){e.pageConfig,e.fetchConfig,e.pageVersion;return A(null),b.createElement(ye,{mode:"cover"},b.createElement(B,{style:{width:"100%",height:"100%"}},b.createElement(q,{region:"north",style:{height:50}},"North Region"),b.createElement(q,{region:"south",style:{height:50}},"South Region"),b.createElement(q,{region:"west",style:{width:240}},b.createElement("div",{style:{}},"West Region")),b.createElement(q,{region:"east",style:{width:240}},b.createElement("div",{style:{}},"East Region")),b.createElement(q,{region:"center",style:{width:"100%",height:"100%"}},b.createElement(Mn,null))))},zn=b.createContext({}),Wn=function(){var e=Ee(),t=e.changeTheme,n=e.themeOptions,r=(e.loadHtmlTheme,Ae((function(e){return e.app.theme}))),a=A(null);return w((function(){}),[]),b.createElement(b.Fragment,null,b.createElement(be,{width:"300px",placement:"right",ref:a},b.createElement(G,{style:{width:"300px",height:"100%"},title:oe("theme-title","Setting","Theme"),bodyStyle:{padding:20,height:"100%"}},n.map((function(e,n){return b.createElement("div",{key:n},b.createElement(Y,{inputId:"theme-"+e.key,value:e.key,groupValue:r,onChange:function(n){return function(e,n){n&&t(e)}(e.key,n)}}),b.createElement(Q,{htmlFor:"theme-"+e.key,style:{margin:"2px 5px",width:"120px"}},oe("themes."+e.key,"Setting",e.name)))})))),b.createElement(U,{iconCls:"iconfont icon-diaoseban header-bar-btn",plain:!0,className:"k-menu-btn",onClick:function(){a.current.toggle()}}))},Bn=function(){var e=Ae((function(e){return e.user.info})),t=Oe();return b.createElement(ee,{text:e.username,plain:!0,iconCls:"iconfont icon-user",menu:function(){return b.createElement(te,{noline:!0},b.createElement(ne,{iconCls:"iconfont icon-logout2",value:"exit",text:"Exit"}))},onMenuItemClick:function(e){if("exit"==e){var n=oe("confirm_logout","Message");fe("",n,(function(){De.logout((function(){t("/login")}))}))}}})},qn=new Se(0,(function(e){return{id:e.id,text:e.title,iconCls:"iconfont "+e.icon,path:e.router_name,pid:e.pid,sort:e.sort,state:e.state,type:e.type}})),Gn={border:!1,plain:!0,scrollable:!0,narrow:!1},Kn={border:!1,animate:!0,multiple:!0,showCollapsedText:!1},Hn=function(){Oe(),Ae((function(e){return e.user.info}));var e={dispatch:Re(),useAppSelector:Ae},t=ft(qn),n=t.collapsed,r=t.menuList,a=t.choiceId,l=t.onMenuSelection,o=t.menuArea,i=t.setMenuAreaId,c=t.menuTabList,s=t.onTabClosed,u=t.onTabSelected,d=function(){return b.createElement(b.Fragment,null,!n&&(null==o?void 0:o.map((function(e,t){return b.createElement(U,{iconCls:e.iconCls?"l-btn-icon-none iconfont "+e.iconCls:"",plain:!0,key:e.id,onClick:function(){return i(e.id)}},e.text)}))))},f=function(){return b.createElement(b.Fragment,null,b.createElement(Bn,null),b.createElement(Zt,null),b.createElement(Wn,null))},m=function(){return b.createElement(Ce,{onTabSelect:u,tabsCfg:Gn,onTabClosed:s,data:c})};return b.createElement(zn.Provider,{value:e},b.createElement(xe,{menus:r,title:oe("title","App","Admin"),collapsed:n,sidebarCfg:Kn,selection:re.findNode(r,"id",a),toggle:function(t){var n;return null===(n=e.dispatch)||void 0===n?void 0:n.call(e,Le(t))},slots:{barLeft:b.createElement(d,null),barRight:b.createElement(f,null)},onSideMenuSelection:l},b.createElement(m,null),b.createElement("div",{className:"admin-tabs-panel-body"},b.createElement(je,null))))};function $n(e){var t,n,r;n=e.request,et||(et=n),r=null!==(t=e.apis)&&void 0!==t?t:{},lt=p(p({},lt),r)}export{Pt as AdminView,zn as AppLayoutContext,Hn as BaseLayout,jn as DictView,Dt as HomeView,Be as Lazy,Zt as LocaleBarItem,Jt as LoginView,Fn as NotFoundView,bt as PaginationPanel,En as PermissionsView,sn as RolesView,Bt as RouterView,Vn as ScreenDesign,Wn as SettingBarItem,$t as SettingView,ut as adminService,dt as configService,tt as ctxPageValue,nt as ctxPageValueOptions,rt as fetchConfigOptions,$n as install,Ze as permissionTree,Je as queryPermissionTress,st as rbacService,Qe as removeEventFn,Ke as renderDateTime02,$e as renderFetchConfigValue,He as renderText,qe as renderTooltip,Ge as renderType,Ye as resourceAccessItems,ct as resourceService,Xe as roleTree,mt as useAppRedirect,pt as useAppStarter,ht as useLocalTable,ft as useMenuAndTabData,gt as useTable,Ct as withCheckGrid,xt as withDocHoc};