@devtable/settings-form 8.13.3 → 8.13.5

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.
@@ -1,4 +1,4 @@
1
- (function(y,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@mantine/core"),require("@mantine/notifications"),require("react"),require("tabler-icons-react"),require("axios"),require("crypto-js"),require("lodash"),require("react-hook-form"),require("ahooks"),require("@monaco-editor/react"),require("monaco-editor"),require("monaco-editor/esm/vs/editor/editor.worker?worker"),require("monaco-editor/esm/vs/language/css/css.worker?worker"),require("monaco-editor/esm/vs/language/html/html.worker?worker"),require("monaco-editor/esm/vs/language/json/json.worker?worker"),require("monaco-editor/esm/vs/language/typescript/ts.worker?worker"),require("@mantine/modals")):typeof define=="function"&&define.amd?define(["exports","@mantine/core","@mantine/notifications","react","tabler-icons-react","axios","crypto-js","lodash","react-hook-form","ahooks","@monaco-editor/react","monaco-editor","monaco-editor/esm/vs/editor/editor.worker?worker","monaco-editor/esm/vs/language/css/css.worker?worker","monaco-editor/esm/vs/language/html/html.worker?worker","monaco-editor/esm/vs/language/json/json.worker?worker","monaco-editor/esm/vs/language/typescript/ts.worker?worker","@mantine/modals"],o):(y=typeof globalThis<"u"?globalThis:y||self,o(y["settings-form"]={},y["@mantine/core"],y["@mantine/notifications"],y.React,y["tabler-icons-react"],y.axios,y["crypto-js"],y._,y["react-hook-form"],y.ahooks,y["@monaco-editor/react"],y["monaco-editor"],y["monaco-editor/esm/vs/editor/editor"]["worker?worker"],y["monaco-editor/esm/vs/language/css/css"]["worker?worker"],y["monaco-editor/esm/vs/language/html/html"]["worker?worker"],y["monaco-editor/esm/vs/language/json/json"]["worker?worker"],y["monaco-editor/esm/vs/language/typescript/ts"]["worker?worker"],y["@mantine/modals"]))})(this,function(y,o,T,I,F,vt,bt,wt,P,V,ne,_t,yt,St,Ct,Pt,Rt,Q){"use strict";const q=t=>t&&typeof t=="object"&&"default"in t?t:{default:t};function Pe(t){if(t&&t.__esModule)return t;const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(n,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}return n.default=t,Object.freeze(n)}const Y=q(I),Z=Pe(I),Tt=q(vt),Et=q(bt),xt=q(wt),Ot=q(ne),zt=Pe(_t),kt=q(yt),At=q(St),jt=q(Ct),Dt=q(Pt),It=q(Rt);function qt(t){t=t||{};const n=Object.keys(t).sort(),i=[];for(let s=0;s<n.length;s++){const u=n[s];if(u!="authentication"&&t[u])i.push(n[s]+"="+(typeof t[u]=="object"?JSON.stringify(t[u]):t[u]));else{const l=Object.keys(t[u]).sort();for(let c=0;c<l.length;c++){const f=l[c];f!="sign"&&t[u][f]&&i.push(l[c]+"="+(typeof t[u][f]=="object"?JSON.stringify(t[u][f]):t[u][f]))}}}return i.sort().join("&")}function Nt(t,n){let i=qt(t);return i+="&key="+n,Et.default.MD5(i).toString().toUpperCase()}const O={baseURL:"http://localhost:31200",app_id:"",app_secret:"",getAuthentication(t){if(!this.app_id||!this.app_secret)return;const n=new Date().getTime().toString();return{app_id:this.app_id,nonce_str:n,sign:Nt({app_id:this.app_id,nonce_str:n,...t},this.app_secret)}},getRequest(t){return(n,i,s={})=>{const u=window.localStorage.getItem("token"),l={"X-Requested-With":"XMLHttpRequest","Content-Type":s.string?"application/x-www-form-urlencoded":"application/json",authorization:u?`bearer ${u}`:"",...s.headers},c={baseURL:this.baseURL,method:t,url:n,params:t==="GET"?i:s.params,headers:l};return["POST","PUT"].includes(t)&&(c.data=s.string?JSON.stringify(i):i,c.data.authentication=this.getAuthentication(c.data)),Tt.default(c).then(f=>f.data).catch(f=>xt.default.has(f,"response.data.detail.message")?Promise.reject(new Error(f.response.data.detail.message)):Promise.reject(f))}}};function ie(t){O.baseURL!==t.apiBaseURL&&(O.baseURL=t.apiBaseURL),t.app_id&&(O.app_id=t.app_id),t.app_secret&&(O.app_secret=t.app_secret)}const j={datasource:{list:async()=>await O.getRequest("POST")("/datasource/list",{filter:{},sort:[{field:"create_time",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(t,n,i)=>await O.getRequest("POST")("/datasource/create",{type:t,key:n,config:i}),delete:async t=>{await O.getRequest("POST")("/datasource/delete",{id:t})}},account:{login:async(t,n)=>{const i={name:t,password:n};return await O.getRequest("POST")("/account/login",i)},list:async()=>await O.getRequest("POST")("/account/list",{filter:{},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),get:async()=>await O.getRequest("GET")("/account/get",{}),update:async(t,n)=>{const i={name:t,email:n};return await O.getRequest("PUT")("/account/update",i)},changepassword:async(t,n)=>{const i={old_password:t,new_password:n};return await O.getRequest("POST")("/account/changepassword",i)},create:async(t,n,i,s)=>await O.getRequest("POST")("/account/create",{name:t,email:n,password:i,role_id:s}),edit:async t=>(t.reset_password||(t.new_password=void 0),await O.getRequest("PUT")("/account/edit",t)),delete:async t=>{if(!!t)return O.getRequest("POST")("/account/delete",{id:t})}},role:{list:async()=>await O.getRequest("GET")("/role/list",{})},api_key:{list:async()=>await O.getRequest("POST")("/api/key/list",{filter:{search:""},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(t,n)=>O.getRequest("POST")("/api/key/create",{name:t,role_id:n}),delete:async t=>{if(!!t)return O.getRequest("POST")("/api/key/delete",{id:t})}}},K={size:"sm",spacing:"md",button:{size:"xs"}};var ae={exports:{}},H={};/**
1
+ (function(P,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("@mantine/core"),require("@mantine/notifications"),require("react"),require("tabler-icons-react"),require("axios"),require("crypto-js"),require("lodash"),require("react-hook-form"),require("ahooks"),require("@monaco-editor/react"),require("@mantine/modals")):typeof define=="function"&&define.amd?define(["exports","@mantine/core","@mantine/notifications","react","tabler-icons-react","axios","crypto-js","lodash","react-hook-form","ahooks","@monaco-editor/react","@mantine/modals"],o):(P=typeof globalThis<"u"?globalThis:P||self,o(P["settings-form"]={},P["@mantine/core"],P["@mantine/notifications"],P.React,P["tabler-icons-react"],P.axios,P["crypto-js"],P._,P["react-hook-form"],P.ahooks,P["@monaco-editor/react"],P["@mantine/modals"]))})(this,function(P,o,T,I,B,mt,vt,bt,C,U,re,X){"use strict";const Q=t=>t&&typeof t=="object"&&"default"in t?t:{default:t};function wt(t){if(t&&t.__esModule)return t;const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(r,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}return r.default=t,Object.freeze(r)}const G=Q(I),Z=wt(I),yt=Q(mt),_t=Q(vt),St=Q(bt),Ct=Q(re);function Pt(t){t=t||{};const r=Object.keys(t).sort(),i=[];for(let s=0;s<r.length;s++){const u=r[s];if(u!="authentication"&&t[u])i.push(r[s]+"="+(typeof t[u]=="object"?JSON.stringify(t[u]):t[u]));else{const l=Object.keys(t[u]).sort();for(let c=0;c<l.length;c++){const f=l[c];f!="sign"&&t[u][f]&&i.push(l[c]+"="+(typeof t[u][f]=="object"?JSON.stringify(t[u][f]):t[u][f]))}}}return i.sort().join("&")}function Rt(t,r){let i=Pt(t);return i+="&key="+r,_t.default.MD5(i).toString().toUpperCase()}const O={baseURL:"http://localhost:31200",app_id:"",app_secret:"",getAuthentication(t){if(!this.app_id||!this.app_secret)return;const r=new Date().getTime().toString();return{app_id:this.app_id,nonce_str:r,sign:Rt({app_id:this.app_id,nonce_str:r,...t},this.app_secret)}},getRequest(t){return(r,i,s={})=>{const u=window.localStorage.getItem("token"),l={"X-Requested-With":"XMLHttpRequest","Content-Type":s.string?"application/x-www-form-urlencoded":"application/json",authorization:u?`bearer ${u}`:"",...s.headers},c={baseURL:this.baseURL,method:t,url:r,params:t==="GET"?i:s.params,headers:l};return["POST","PUT"].includes(t)&&(c.data=s.string?JSON.stringify(i):i,c.data.authentication=this.getAuthentication(c.data)),yt.default(c).then(f=>f.data).catch(f=>St.default.has(f,"response.data.detail.message")?Promise.reject(new Error(f.response.data.detail.message)):Promise.reject(f))}}};function ie(t){O.baseURL!==t.apiBaseURL&&(O.baseURL=t.apiBaseURL),t.app_id&&(O.app_id=t.app_id),t.app_secret&&(O.app_secret=t.app_secret)}const j={datasource:{list:async()=>await O.getRequest("POST")("/datasource/list",{filter:{},sort:[{field:"create_time",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(t,r,i)=>await O.getRequest("POST")("/datasource/create",{type:t,key:r,config:i}),delete:async t=>{await O.getRequest("POST")("/datasource/delete",{id:t})}},account:{login:async(t,r)=>{const i={name:t,password:r};return await O.getRequest("POST")("/account/login",i)},list:async()=>await O.getRequest("POST")("/account/list",{filter:{},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),get:async()=>await O.getRequest("GET")("/account/get",{}),update:async(t,r)=>{const i={name:t,email:r};return await O.getRequest("PUT")("/account/update",i)},changepassword:async(t,r)=>{const i={old_password:t,new_password:r};return await O.getRequest("POST")("/account/changepassword",i)},create:async(t,r,i,s)=>await O.getRequest("POST")("/account/create",{name:t,email:r,password:i,role_id:s}),edit:async t=>(t.reset_password||(t.new_password=void 0),await O.getRequest("PUT")("/account/edit",t)),delete:async t=>{if(!!t)return O.getRequest("POST")("/account/delete",{id:t})}},role:{list:async()=>await O.getRequest("GET")("/role/list",{})},api_key:{list:async()=>await O.getRequest("POST")("/api/key/list",{filter:{search:""},sort:[{field:"name",order:"ASC"}],pagination:{page:1,pagesize:100}}),create:async(t,r)=>O.getRequest("POST")("/api/key/create",{name:t,role_id:r}),delete:async t=>{if(!!t)return O.getRequest("POST")("/api/key/delete",{id:t})}}},Y={size:"sm",spacing:"md",button:{size:"xs"}};var ae={exports:{}},H={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Re;function Lt(){if(Re)return H;Re=1;var t=Y.default,n=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(f,g,w){var S,h={},p=null,z=null;w!==void 0&&(p=""+w),g.key!==void 0&&(p=""+g.key),g.ref!==void 0&&(z=g.ref);for(S in g)s.call(g,S)&&!l.hasOwnProperty(S)&&(h[S]=g[S]);if(f&&f.defaultProps)for(S in g=f.defaultProps,g)h[S]===void 0&&(h[S]=g[S]);return{$$typeof:n,type:f,key:p,ref:z,props:h,_owner:u.current}}return H.Fragment=i,H.jsx=c,H.jsxs=c,H}var ee={};/**
9
+ */var Pe;function Tt(){if(Pe)return H;Pe=1;var t=G.default,r=Symbol.for("react.element"),i=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,u=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,l={key:!0,ref:!0,__self:!0,__source:!0};function c(f,g,w){var _,m={},p=null,z=null;w!==void 0&&(p=""+w),g.key!==void 0&&(p=""+g.key),g.ref!==void 0&&(z=g.ref);for(_ in g)s.call(g,_)&&!l.hasOwnProperty(_)&&(m[_]=g[_]);if(f&&f.defaultProps)for(_ in g=f.defaultProps,g)m[_]===void 0&&(m[_]=g[_]);return{$$typeof:r,type:f,key:p,ref:z,props:m,_owner:u.current}}return H.Fragment=i,H.jsx=c,H.jsxs=c,H}var ee={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,16 +14,16 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Te;function Mt(){return Te||(Te=1,process.env.NODE_ENV!=="production"&&function(){var t=Y.default,n=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),S=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),N=Symbol.iterator,W="@@iterator";function me(e){if(e===null||typeof e!="object")return null;var a=N&&e[N]||e[W];return typeof a=="function"?a:null}var U=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function k(e){{for(var a=arguments.length,d=new Array(a>1?a-1:0),m=1;m<a;m++)d[m-1]=arguments[m];or("error",e,d)}}function or(e,a,d){{var m=U.ReactDebugCurrentFrame,C=m.getStackAddendum();C!==""&&(a+="%s",d=d.concat([C]));var R=d.map(function(_){return String(_)});R.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,R)}}var sr=!1,lr=!1,cr=!1,ur=!1,dr=!1,Ye;Ye=Symbol.for("react.module.reference");function fr(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||dr||e===u||e===w||e===S||ur||e===z||sr||lr||cr||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===h||e.$$typeof===c||e.$$typeof===f||e.$$typeof===g||e.$$typeof===Ye||e.getModuleId!==void 0))}function pr(e,a,d){var m=e.displayName;if(m)return m;var C=a.displayName||a.name||"";return C!==""?d+"("+C+")":d}function Ke(e){return e.displayName||"Context"}function M(e){if(e==null)return null;if(typeof e.tag=="number"&&k("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case i:return"Portal";case l:return"Profiler";case u:return"StrictMode";case w:return"Suspense";case S:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var a=e;return Ke(a)+".Consumer";case c:var d=e;return Ke(d._context)+".Provider";case g:return pr(e,e.render,"ForwardRef");case h:var m=e.displayName||null;return m!==null?m:M(e.type)||"Memo";case p:{var C=e,R=C._payload,_=C._init;try{return M(_(R))}catch{return null}}}return null}var G=Object.assign,te=0,Je,Xe,Qe,Ze,He,et,tt;function rt(){}rt.__reactDisabledLog=!0;function gr(){{if(te===0){Je=console.log,Xe=console.info,Qe=console.warn,Ze=console.error,He=console.group,et=console.groupCollapsed,tt=console.groupEnd;var e={configurable:!0,enumerable:!0,value:rt,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}te++}}function mr(){{if(te--,te===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},e,{value:Je}),info:G({},e,{value:Xe}),warn:G({},e,{value:Qe}),error:G({},e,{value:Ze}),group:G({},e,{value:He}),groupCollapsed:G({},e,{value:et}),groupEnd:G({},e,{value:tt})})}te<0&&k("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var he=U.ReactCurrentDispatcher,ve;function le(e,a,d){{if(ve===void 0)try{throw Error()}catch(C){var m=C.stack.trim().match(/\n( *(at )?)/);ve=m&&m[1]||""}return`
18
- `+ve+e}}var be=!1,ce;{var hr=typeof WeakMap=="function"?WeakMap:Map;ce=new hr}function nt(e,a){if(!e||be)return"";{var d=ce.get(e);if(d!==void 0)return d}var m;be=!0;var C=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=he.current,he.current=null,gr();try{if(a){var _=function(){throw Error()};if(Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(B){m=B}Reflect.construct(e,[],_)}else{try{_.call()}catch(B){m=B}e.call(_.prototype)}}else{try{throw Error()}catch(B){m=B}e()}}catch(B){if(B&&m&&typeof B.stack=="string"){for(var v=B.stack.split(`
19
- `),A=m.stack.split(`
20
- `),E=v.length-1,x=A.length-1;E>=1&&x>=0&&v[E]!==A[x];)x--;for(;E>=1&&x>=0;E--,x--)if(v[E]!==A[x]){if(E!==1||x!==1)do if(E--,x--,x<0||v[E]!==A[x]){var D=`
21
- `+v[E].replace(" at new "," at ");return e.displayName&&D.includes("<anonymous>")&&(D=D.replace("<anonymous>",e.displayName)),typeof e=="function"&&ce.set(e,D),D}while(E>=1&&x>=0);break}}}finally{be=!1,he.current=R,mr(),Error.prepareStackTrace=C}var X=e?e.displayName||e.name:"",ht=X?le(X):"";return typeof e=="function"&&ce.set(e,ht),ht}function vr(e,a,d){return nt(e,!1)}function br(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function ue(e,a,d){if(e==null)return"";if(typeof e=="function")return nt(e,br(e));if(typeof e=="string")return le(e);switch(e){case w:return le("Suspense");case S:return le("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return vr(e.render);case h:return ue(e.type,a,d);case p:{var m=e,C=m._payload,R=m._init;try{return ue(R(C),a,d)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,it={},at=U.ReactDebugCurrentFrame;function fe(e){if(e){var a=e._owner,d=ue(e.type,e._source,a?a.type:null);at.setExtraStackFrame(d)}else at.setExtraStackFrame(null)}function wr(e,a,d,m,C){{var R=Function.call.bind(de);for(var _ in e)if(R(e,_)){var v=void 0;try{if(typeof e[_]!="function"){var A=Error((m||"React class")+": "+d+" type `"+_+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[_]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw A.name="Invariant Violation",A}v=e[_](a,_,m,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){v=E}v&&!(v instanceof Error)&&(fe(C),k("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",m||"React class",d,_,typeof v),fe(null)),v instanceof Error&&!(v.message in it)&&(it[v.message]=!0,fe(C),k("Failed %s type: %s",d,v.message),fe(null))}}}var _r=Array.isArray;function we(e){return _r(e)}function yr(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,d=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return d}}function Sr(e){try{return ot(e),!1}catch{return!0}}function ot(e){return""+e}function st(e){if(Sr(e))return k("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",yr(e)),ot(e)}var re=U.ReactCurrentOwner,Cr={key:!0,ref:!0,__self:!0,__source:!0},lt,ct,_e;_e={};function Pr(e){if(de.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function Rr(e){if(de.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function Tr(e,a){if(typeof e.ref=="string"&&re.current&&a&&re.current.stateNode!==a){var d=M(re.current.type);_e[d]||(k('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',M(re.current.type),e.ref),_e[d]=!0)}}function Er(e,a){{var d=function(){lt||(lt=!0,k("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};d.isReactWarning=!0,Object.defineProperty(e,"key",{get:d,configurable:!0})}}function xr(e,a){{var d=function(){ct||(ct=!0,k("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};d.isReactWarning=!0,Object.defineProperty(e,"ref",{get:d,configurable:!0})}}var Or=function(e,a,d,m,C,R,_){var v={$$typeof:n,type:e,key:a,ref:d,props:_,_owner:R};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:m}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function zr(e,a,d,m,C){{var R,_={},v=null,A=null;d!==void 0&&(st(d),v=""+d),Rr(a)&&(st(a.key),v=""+a.key),Pr(a)&&(A=a.ref,Tr(a,C));for(R in a)de.call(a,R)&&!Cr.hasOwnProperty(R)&&(_[R]=a[R]);if(e&&e.defaultProps){var E=e.defaultProps;for(R in E)_[R]===void 0&&(_[R]=E[R])}if(v||A){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;v&&Er(_,x),A&&xr(_,x)}return Or(e,v,A,C,m,re.current,_)}}var ye=U.ReactCurrentOwner,ut=U.ReactDebugCurrentFrame;function J(e){if(e){var a=e._owner,d=ue(e.type,e._source,a?a.type:null);ut.setExtraStackFrame(d)}else ut.setExtraStackFrame(null)}var Se;Se=!1;function Ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===n}function dt(){{if(ye.current){var e=M(ye.current.type);if(e)return`
17
+ */var Re;function Et(){return Re||(Re=1,process.env.NODE_ENV!=="production"&&function(){var t=G.default,r=Symbol.for("react.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),f=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),_=Symbol.for("react.suspense_list"),m=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),z=Symbol.for("react.offscreen"),q=Symbol.iterator,V="@@iterator";function he(e){if(e===null||typeof e!="object")return null;var a=q&&e[q]||e[V];return typeof a=="function"?a:null}var $=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function A(e){{for(var a=arguments.length,d=new Array(a>1?a-1:0),h=1;h<a;h++)d[h-1]=arguments[h];Kt("error",e,d)}}function Kt(e,a,d){{var h=$.ReactDebugCurrentFrame,S=h.getStackAddendum();S!==""&&(a+="%s",d=d.concat([S]));var R=d.map(function(y){return String(y)});R.unshift("Warning: "+a),Function.prototype.apply.call(console[e],console,R)}}var Jt=!1,Xt=!1,Qt=!1,Zt=!1,Ht=!1,Ge;Ge=Symbol.for("react.module.reference");function en(e){return!!(typeof e=="string"||typeof e=="function"||e===s||e===l||Ht||e===u||e===w||e===_||Zt||e===z||Jt||Xt||Qt||typeof e=="object"&&e!==null&&(e.$$typeof===p||e.$$typeof===m||e.$$typeof===c||e.$$typeof===f||e.$$typeof===g||e.$$typeof===Ge||e.getModuleId!==void 0))}function tn(e,a,d){var h=e.displayName;if(h)return h;var S=a.displayName||a.name||"";return S!==""?d+"("+S+")":d}function Ye(e){return e.displayName||"Context"}function L(e){if(e==null)return null;if(typeof e.tag=="number"&&A("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case s:return"Fragment";case i:return"Portal";case l:return"Profiler";case u:return"StrictMode";case w:return"Suspense";case _:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case f:var a=e;return Ye(a)+".Consumer";case c:var d=e;return Ye(d._context)+".Provider";case g:return tn(e,e.render,"ForwardRef");case m:var h=e.displayName||null;return h!==null?h:L(e.type)||"Memo";case p:{var S=e,R=S._payload,y=S._init;try{return L(y(R))}catch{return null}}}return null}var W=Object.assign,te=0,Ke,Je,Xe,Qe,Ze,He,et;function tt(){}tt.__reactDisabledLog=!0;function nn(){{if(te===0){Ke=console.log,Je=console.info,Xe=console.warn,Qe=console.error,Ze=console.group,He=console.groupCollapsed,et=console.groupEnd;var e={configurable:!0,enumerable:!0,value:tt,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}te++}}function rn(){{if(te--,te===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:W({},e,{value:Ke}),info:W({},e,{value:Je}),warn:W({},e,{value:Xe}),error:W({},e,{value:Qe}),group:W({},e,{value:Ze}),groupCollapsed:W({},e,{value:He}),groupEnd:W({},e,{value:et})})}te<0&&A("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var me=$.ReactCurrentDispatcher,ve;function le(e,a,d){{if(ve===void 0)try{throw Error()}catch(S){var h=S.stack.trim().match(/\n( *(at )?)/);ve=h&&h[1]||""}return`
18
+ `+ve+e}}var be=!1,ce;{var an=typeof WeakMap=="function"?WeakMap:Map;ce=new an}function nt(e,a){if(!e||be)return"";{var d=ce.get(e);if(d!==void 0)return d}var h;be=!0;var S=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var R;R=me.current,me.current=null,nn();try{if(a){var y=function(){throw Error()};if(Object.defineProperty(y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(y,[])}catch(M){h=M}Reflect.construct(e,[],y)}else{try{y.call()}catch(M){h=M}e.call(y.prototype)}}else{try{throw Error()}catch(M){h=M}e()}}catch(M){if(M&&h&&typeof M.stack=="string"){for(var v=M.stack.split(`
19
+ `),D=h.stack.split(`
20
+ `),E=v.length-1,x=D.length-1;E>=1&&x>=0&&v[E]!==D[x];)x--;for(;E>=1&&x>=0;E--,x--)if(v[E]!==D[x]){if(E!==1||x!==1)do if(E--,x--,x<0||v[E]!==D[x]){var k=`
21
+ `+v[E].replace(" at new "," at ");return e.displayName&&k.includes("<anonymous>")&&(k=k.replace("<anonymous>",e.displayName)),typeof e=="function"&&ce.set(e,k),k}while(E>=1&&x>=0);break}}}finally{be=!1,me.current=R,rn(),Error.prepareStackTrace=S}var J=e?e.displayName||e.name:"",ht=J?le(J):"";return typeof e=="function"&&ce.set(e,ht),ht}function on(e,a,d){return nt(e,!1)}function sn(e){var a=e.prototype;return!!(a&&a.isReactComponent)}function ue(e,a,d){if(e==null)return"";if(typeof e=="function")return nt(e,sn(e));if(typeof e=="string")return le(e);switch(e){case w:return le("Suspense");case _:return le("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case g:return on(e.render);case m:return ue(e.type,a,d);case p:{var h=e,S=h._payload,R=h._init;try{return ue(R(S),a,d)}catch{}}}return""}var de=Object.prototype.hasOwnProperty,rt={},it=$.ReactDebugCurrentFrame;function fe(e){if(e){var a=e._owner,d=ue(e.type,e._source,a?a.type:null);it.setExtraStackFrame(d)}else it.setExtraStackFrame(null)}function ln(e,a,d,h,S){{var R=Function.call.bind(de);for(var y in e)if(R(e,y)){var v=void 0;try{if(typeof e[y]!="function"){var D=Error((h||"React class")+": "+d+" type `"+y+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[y]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw D.name="Invariant Violation",D}v=e[y](a,y,h,d,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(E){v=E}v&&!(v instanceof Error)&&(fe(S),A("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",h||"React class",d,y,typeof v),fe(null)),v instanceof Error&&!(v.message in rt)&&(rt[v.message]=!0,fe(S),A("Failed %s type: %s",d,v.message),fe(null))}}}var cn=Array.isArray;function we(e){return cn(e)}function un(e){{var a=typeof Symbol=="function"&&Symbol.toStringTag,d=a&&e[Symbol.toStringTag]||e.constructor.name||"Object";return d}}function dn(e){try{return at(e),!1}catch{return!0}}function at(e){return""+e}function ot(e){if(dn(e))return A("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",un(e)),at(e)}var ne=$.ReactCurrentOwner,fn={key:!0,ref:!0,__self:!0,__source:!0},st,lt,ye;ye={};function pn(e){if(de.call(e,"ref")){var a=Object.getOwnPropertyDescriptor(e,"ref").get;if(a&&a.isReactWarning)return!1}return e.ref!==void 0}function gn(e){if(de.call(e,"key")){var a=Object.getOwnPropertyDescriptor(e,"key").get;if(a&&a.isReactWarning)return!1}return e.key!==void 0}function hn(e,a){if(typeof e.ref=="string"&&ne.current&&a&&ne.current.stateNode!==a){var d=L(ne.current.type);ye[d]||(A('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',L(ne.current.type),e.ref),ye[d]=!0)}}function mn(e,a){{var d=function(){st||(st=!0,A("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};d.isReactWarning=!0,Object.defineProperty(e,"key",{get:d,configurable:!0})}}function vn(e,a){{var d=function(){lt||(lt=!0,A("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",a))};d.isReactWarning=!0,Object.defineProperty(e,"ref",{get:d,configurable:!0})}}var bn=function(e,a,d,h,S,R,y){var v={$$typeof:r,type:e,key:a,ref:d,props:y,_owner:R};return v._store={},Object.defineProperty(v._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(v,"_self",{configurable:!1,enumerable:!1,writable:!1,value:h}),Object.defineProperty(v,"_source",{configurable:!1,enumerable:!1,writable:!1,value:S}),Object.freeze&&(Object.freeze(v.props),Object.freeze(v)),v};function wn(e,a,d,h,S){{var R,y={},v=null,D=null;d!==void 0&&(ot(d),v=""+d),gn(a)&&(ot(a.key),v=""+a.key),pn(a)&&(D=a.ref,hn(a,S));for(R in a)de.call(a,R)&&!fn.hasOwnProperty(R)&&(y[R]=a[R]);if(e&&e.defaultProps){var E=e.defaultProps;for(R in E)y[R]===void 0&&(y[R]=E[R])}if(v||D){var x=typeof e=="function"?e.displayName||e.name||"Unknown":e;v&&mn(y,x),D&&vn(y,x)}return bn(e,v,D,S,h,ne.current,y)}}var _e=$.ReactCurrentOwner,ct=$.ReactDebugCurrentFrame;function K(e){if(e){var a=e._owner,d=ue(e.type,e._source,a?a.type:null);ct.setExtraStackFrame(d)}else ct.setExtraStackFrame(null)}var Se;Se=!1;function Ce(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function ut(){{if(_e.current){var e=L(_e.current.type);if(e)return`
22
22
 
23
- Check the render method of \``+e+"`."}return""}}function kr(e){{if(e!==void 0){var a=e.fileName.replace(/^.*[\\\/]/,""),d=e.lineNumber;return`
23
+ Check the render method of \``+e+"`."}return""}}function yn(e){{if(e!==void 0){var a=e.fileName.replace(/^.*[\\\/]/,""),d=e.lineNumber;return`
24
24
 
25
- Check your code at `+a+":"+d+"."}return""}}var ft={};function Ar(e){{var a=dt();if(!a){var d=typeof e=="string"?e:e.displayName||e.name;d&&(a=`
25
+ Check your code at `+a+":"+d+"."}return""}}var dt={};function _n(e){{var a=ut();if(!a){var d=typeof e=="string"?e:e.displayName||e.name;d&&(a=`
26
26
 
27
- Check the top-level render call using <`+d+">.")}return a}}function pt(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var d=Ar(a);if(ft[d])return;ft[d]=!0;var m="";e&&e._owner&&e._owner!==ye.current&&(m=" It was passed a child from "+M(e._owner.type)+"."),J(e),k('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,m),J(null)}}function gt(e,a){{if(typeof e!="object")return;if(we(e))for(var d=0;d<e.length;d++){var m=e[d];Ce(m)&&pt(m,a)}else if(Ce(e))e._store&&(e._store.validated=!0);else if(e){var C=me(e);if(typeof C=="function"&&C!==e.entries)for(var R=C.call(e),_;!(_=R.next()).done;)Ce(_.value)&&pt(_.value,a)}}}function jr(e){{var a=e.type;if(a==null||typeof a=="string")return;var d;if(typeof a=="function")d=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===g||a.$$typeof===h))d=a.propTypes;else return;if(d){var m=M(a);wr(d,e.props,"prop",m,e)}else if(a.PropTypes!==void 0&&!Se){Se=!0;var C=M(a);k("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",C||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&k("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Dr(e){{for(var a=Object.keys(e.props),d=0;d<a.length;d++){var m=a[d];if(m!=="children"&&m!=="key"){J(e),k("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",m),J(null);break}}e.ref!==null&&(J(e),k("Invalid attribute `ref` supplied to `React.Fragment`."),J(null))}}function mt(e,a,d,m,C,R){{var _=fr(e);if(!_){var v="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var A=kr(C);A?v+=A:v+=dt();var E;e===null?E="null":we(e)?E="array":e!==void 0&&e.$$typeof===n?(E="<"+(M(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,k("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,v)}var x=zr(e,a,d,C,R);if(x==null)return x;if(_){var D=a.children;if(D!==void 0)if(m)if(we(D)){for(var X=0;X<D.length;X++)gt(D[X],e);Object.freeze&&Object.freeze(D)}else k("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else gt(D,e)}return e===s?Dr(x):jr(x),x}}function Ir(e,a,d){return mt(e,a,d,!0)}function qr(e,a,d){return mt(e,a,d,!1)}var Nr=qr,Lr=Ir;ee.Fragment=s,ee.jsx=Nr,ee.jsxs=Lr}()),ee}(function(t){process.env.NODE_ENV==="production"?t.exports=Lt():t.exports=Mt()})(ae);const L=ae.exports.Fragment,r=ae.exports.jsx,b=ae.exports.jsxs;function Bt({submit:t,styles:n=K,type:i}){const{control:s,setValue:u,handleSubmit:l}=P.useForm({defaultValues:{type:i,key:"",config:{host:"",port:5432,username:"",password:"",database:""}}});return I.useEffect(()=>{u("type",i)},[u,i]),r(o.Box,{mx:"auto",children:b("form",{onSubmit:l(t),children:[r(P.Controller,{name:"key",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",placeholder:"A unique name",...c})}),r(o.Divider,{label:"Connection Info",labelPosition:"center"}),b(o.Group,{grow:!0,children:[r(P.Controller,{name:"config.host",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Host",sx:{flexGrow:1},...c})}),r(P.Controller,{name:"config.port",control:s,render:({field:c})=>r(o.NumberInput,{mb:n.spacing,size:n.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...c})})]}),r(P.Controller,{name:"config.username",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...c})}),r(P.Controller,{name:"config.password",control:s,render:({field:c})=>r(o.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",...c})}),r(P.Controller,{name:"config.database",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Database",...c})}),r(o.Group,{position:"right",mt:n.spacing,children:r(o.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}self.MonacoEnvironment={getWorker(t,n){return n==="json"?new Dt.default:n==="css"||n==="scss"||n==="less"?new At.default:n==="html"||n==="handlebars"||n==="razor"?new jt.default:n==="typescript"||n==="javascript"?new It.default:new kt.default}};function Ft(){ne.loader.__getMonacoInstance()||(console.log("loading monaco"),ne.loader.config({monaco:zt}),ne.loader.init().then(n=>console.log("here is the monaco instance:",n)))}Ft();const $t=({value:t,onChange:n})=>{const i=s=>{!s||n(s)};return r(o.Box,{sx:{position:"relative"},children:r(Ot.default,{height:"500px",defaultLanguage:"javascript",value:t,onChange:i,theme:"vs-dark",options:{minimap:{enabled:!1}}})})},Ee=I.forwardRef(({value:t,onChange:n,label:i,modalTitle:s,defaultValue:u,styles:l},c)=>{const[f,{setTrue:g,setFalse:w}]=V.useBoolean(),[S,h]=I.useState(t),p=()=>{w(),n(S)},z=()=>{w(),h(t)},N=()=>{h(u)};return I.useEffect(()=>{h(t)},[t]),b(L,{children:[r(o.Button,{variant:"filled",size:l.button.size,onClick:g,sx:{flexGrow:1},children:i}),r(o.Modal,{size:800,title:s,opened:f,onClose:w,closeOnClickOutside:!1,withCloseButton:!1,children:f&&b(o.Stack,{children:[r($t,{value:S,onChange:h}),b(o.Group,{position:"apart",children:[r(o.Button,{onClick:N,color:"red",leftIcon:r(F.Recycle,{size:20}),children:"Rest"}),b(o.Group,{position:"right",children:[r(o.Button,{onClick:z,variant:"subtle",children:"Cancel"}),r(o.Button,{onClick:p,children:"OK"})]})]})]})})]})}),oe={pre:["function pre_process({ method, url, params, headers, data }, utils) {"," // your code goes here"," return { method, url, params, headers, data }","}"].join(`
27
+ Check the top-level render call using <`+d+">.")}return a}}function ft(e,a){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var d=_n(a);if(dt[d])return;dt[d]=!0;var h="";e&&e._owner&&e._owner!==_e.current&&(h=" It was passed a child from "+L(e._owner.type)+"."),K(e),A('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',d,h),K(null)}}function pt(e,a){{if(typeof e!="object")return;if(we(e))for(var d=0;d<e.length;d++){var h=e[d];Ce(h)&&ft(h,a)}else if(Ce(e))e._store&&(e._store.validated=!0);else if(e){var S=he(e);if(typeof S=="function"&&S!==e.entries)for(var R=S.call(e),y;!(y=R.next()).done;)Ce(y.value)&&ft(y.value,a)}}}function Sn(e){{var a=e.type;if(a==null||typeof a=="string")return;var d;if(typeof a=="function")d=a.propTypes;else if(typeof a=="object"&&(a.$$typeof===g||a.$$typeof===m))d=a.propTypes;else return;if(d){var h=L(a);ln(d,e.props,"prop",h,e)}else if(a.PropTypes!==void 0&&!Se){Se=!0;var S=L(a);A("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S||"Unknown")}typeof a.getDefaultProps=="function"&&!a.getDefaultProps.isReactClassApproved&&A("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Cn(e){{for(var a=Object.keys(e.props),d=0;d<a.length;d++){var h=a[d];if(h!=="children"&&h!=="key"){K(e),A("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",h),K(null);break}}e.ref!==null&&(K(e),A("Invalid attribute `ref` supplied to `React.Fragment`."),K(null))}}function gt(e,a,d,h,S,R){{var y=en(e);if(!y){var v="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(v+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var D=yn(S);D?v+=D:v+=ut();var E;e===null?E="null":we(e)?E="array":e!==void 0&&e.$$typeof===r?(E="<"+(L(e.type)||"Unknown")+" />",v=" Did you accidentally export a JSX literal instead of a component?"):E=typeof e,A("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",E,v)}var x=wn(e,a,d,S,R);if(x==null)return x;if(y){var k=a.children;if(k!==void 0)if(h)if(we(k)){for(var J=0;J<k.length;J++)pt(k[J],e);Object.freeze&&Object.freeze(k)}else A("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pt(k,e)}return e===s?Cn(x):Sn(x),x}}function Pn(e,a,d){return gt(e,a,d,!0)}function Rn(e,a,d){return gt(e,a,d,!1)}var Tn=Rn,En=Pn;ee.Fragment=s,ee.jsx=Tn,ee.jsxs=En}()),ee}(function(t){process.env.NODE_ENV==="production"?t.exports=Tt():t.exports=Et()})(ae);const N=ae.exports.Fragment,n=ae.exports.jsx,b=ae.exports.jsxs;function xt({submit:t,styles:r=Y,type:i}){const{control:s,setValue:u,handleSubmit:l}=C.useForm({defaultValues:{type:i,key:"",config:{host:"",port:5432,username:"",password:"",database:""}}});return I.useEffect(()=>{u("type",i)},[u,i]),n(o.Box,{mx:"auto",children:b("form",{onSubmit:l(t),children:[n(C.Controller,{name:"key",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",placeholder:"A unique name",...c})}),n(o.Divider,{label:"Connection Info",labelPosition:"center"}),b(o.Group,{grow:!0,children:[n(C.Controller,{name:"config.host",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Host",sx:{flexGrow:1},...c})}),n(C.Controller,{name:"config.port",control:s,render:({field:c})=>n(o.NumberInput,{mb:r.spacing,size:r.size,required:!0,label:"Port",hideControls:!0,sx:{width:"8em"},...c})})]}),n(C.Controller,{name:"config.username",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...c})}),n(C.Controller,{name:"config.password",control:s,render:({field:c})=>n(o.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",...c})}),n(C.Controller,{name:"config.database",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Database",...c})}),n(o.Group,{position:"right",mt:r.spacing,children:n(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}self.MonacoEnvironment={getWorker:function(t,r){const i=(s,u)=>new Worker(self.MonacoEnvironment.getWorker(s),{name:u,type:"module"});switch(r){case"typescript":case"javascript":return i("/monaco-editor/min/vs/language/typescript/ts.worker?worker",r);default:return i("/monaco-editor/min/vs/editor/editor.worker?worker",r)}}};function Ot(){re.loader.__getMonacoInstance()||(console.log("loading monaco"),re.loader.config({paths:{vs:"/assets/monaco-editor/min/vs"}}),re.loader.init().then(r=>console.log("here is the monaco instance:",r)))}Ot();const zt=({value:t,onChange:r})=>{const i=s=>{!s||r(s)};return n(o.Box,{sx:{position:"relative"},children:n(Ct.default,{height:"500px",defaultLanguage:"javascript",value:t,onChange:i,theme:"vs-dark",options:{minimap:{enabled:!1}}})})},Te=I.forwardRef(({value:t,onChange:r,label:i,modalTitle:s,defaultValue:u,styles:l},c)=>{const[f,{setTrue:g,setFalse:w}]=U.useBoolean(),[_,m]=I.useState(t),p=()=>{w(),r(_)},z=()=>{w(),m(t)},q=()=>{m(u)};return I.useEffect(()=>{m(t)},[t]),b(N,{children:[n(o.Button,{variant:"filled",size:l.button.size,onClick:g,sx:{flexGrow:1},children:i}),n(o.Modal,{size:800,title:s,opened:f,onClose:w,closeOnClickOutside:!1,withCloseButton:!1,children:f&&b(o.Stack,{children:[n(zt,{value:_,onChange:m}),b(o.Group,{position:"apart",children:[n(o.Button,{onClick:q,color:"red",leftIcon:n(B.Recycle,{size:20}),children:"Rest"}),b(o.Group,{position:"right",children:[n(o.Button,{onClick:z,variant:"subtle",children:"Cancel"}),n(o.Button,{onClick:p,children:"OK"})]})]})]})})]})}),oe={pre:["function pre_process({ method, url, params, headers, data }, utils) {"," // your code goes here"," return { method, url, params, headers, data }","}"].join(`
28
28
  `),post:["function post_process(res, utils) {"," // your code goes here"," return data","}"].join(`
29
- `)};function Ut({submit:t,styles:n=K}){const{control:i,setValue:s,handleSubmit:u}=P.useForm({defaultValues:{type:"http",key:"",config:{host:"",processing:{pre:oe.pre,post:oe.post}}}});return r(o.Box,{mx:"auto",children:b("form",{onSubmit:u(t),children:[r(P.Controller,{name:"key",control:i,render:({field:l})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",placeholder:"A unique name",...l})}),r(o.Divider,{label:"Connection Info",labelPosition:"center"}),r(P.Controller,{name:"config.host",control:i,render:({field:l})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Base URL",sx:{flexGrow:1},...l})}),b(o.Group,{grow:!0,children:[r(P.Controller,{name:"config.processing.pre",control:i,render:({field:l})=>r(Ee,{label:"Pre Processing",modalTitle:"This function will run before sending the request (for scenarios like encryption)",defaultValue:oe.pre,...l,styles:n})}),r(P.Controller,{name:"config.processing.post",control:i,render:({field:l})=>r(Ee,{label:"Post Processing",modalTitle:"This function will run after sending the request (for scenarios like decryption)",defaultValue:oe.post,...l,styles:n})})]}),r(o.Group,{position:"right",mt:n.spacing,children:r(o.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Vt({postSubmit:t,styles:n=K}){const[i,s]=I.useState("postgresql"),u=async({type:f,key:g,config:w})=>{T.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0});try{console.log({type:f,key:g,config:w}),await j.datasource.create(f,g,w),T.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),t()}catch(S){T.updateNotification({id:"for-creating",title:"Failed",message:S.message,color:"red"})}},l=i==="postgresql"||i==="mysql",c=i==="http";return b(o.Box,{mx:"auto",children:[r(o.SegmentedControl,{fullWidth:!0,mb:n.spacing,size:n.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http"}],value:i,onChange:f=>s(f)}),l&&r(Bt,{submit:u,styles:n,type:i}),c&&r(Ut,{submit:u,styles:n})]})}function xe({onSuccess:t,styles:n=K}){const[i,s]=Y.default.useState(!1),u=()=>s(!0),l=()=>s(!1),c=()=>{t(),l()};return b(L,{children:[r(o.Modal,{overflow:"inside",opened:i,onClose:()=>s(!1),title:"Add a data source",trapFocus:!0,onDragStart:f=>{f.stopPropagation()},children:r(Vt,{postSubmit:c,styles:n})}),r(o.Button,{size:n.button.size,onClick:u,leftIcon:r(F.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var i=arguments[n];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},pe.apply(this,arguments)}function Wt(t,n){if(t==null)return{};var i,s,u=function(c,f){if(c==null)return{};var g,w,S={},h=Object.keys(c);for(w=0;w<h.length;w++)g=h[w],f.indexOf(g)>=0||(S[g]=c[g]);return S}(t,n);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(s=0;s<l.length;s++)i=l[s],n.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(u[i]=t[i])}return u}var Gt=["size","color","stroke"];function Yt(t){var n=t.size,i=n===void 0?24:n,s=t.color,u=s===void 0?"currentColor":s,l=t.stroke,c=l===void 0?2:l,f=Wt(t,Gt);return Z.createElement("svg",pe({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-lock",width:i,height:i,viewBox:"0 0 24 24",strokeWidth:c,stroke:u,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),Z.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Z.createElement("rect",{x:5,y:11,width:14,height:10,rx:2}),Z.createElement("circle",{cx:12,cy:16,r:1}),Z.createElement("path",{d:"M8 11v-4a4 4 0 0 1 8 0v4"}))}function Oe({id:t,name:n,isProtected:i,onSuccess:s,styles:u=K}){const l=Q.useModals(),c=async()=>{!t||(T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await j.datasource.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${n}] is deleted`,color:"green"}),s())},f=()=>l.openConfirmModal({title:"Delete this data source?",children:r(o.Text,{size:u.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:c}),g=o.useMantineTheme();return i?r(o.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be deleted",children:r("span",{children:r(Yt,{size:16,color:g.colors.gray[7]})})}):r(o.Button,{size:u.button.size,color:"red",onClick:f,leftIcon:r(F.Trash,{size:20}),children:"Delete"})}function Kt({styles:t=K,config:n}){ie(n);const{data:i=[],loading:s,refresh:u}=V.useRequest(async()=>{const{data:l}=await j.datasource.list();return l},{refreshDeps:[]});return b(L,{children:[r(o.Group,{pt:t.spacing,position:"right",children:r(xe,{onSuccess:u})}),b(o.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(o.LoadingOverlay,{visible:s}),b(o.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:b("tr",{children:[r("th",{children:"Type"}),r("th",{children:"Name"}),r("th",{children:"Action"})]})}),r("tbody",{children:i.map(({id:l,key:c,type:f,is_preset:g})=>b("tr",{children:[r("td",{width:200,children:f}),r("td",{children:c}),r("td",{width:200,children:r(o.Group,{position:"left",children:r(Oe,{isProtected:g,id:l,name:c,onSuccess:u})})})]},c))})]})]})]})}const Jt=I.forwardRef(({label:t,value:n,description:i,...s},u)=>b(o.Stack,{spacing:2,ref:u,...s,children:[r(o.Text,{size:"sm",children:t}),r(o.Text,{size:"xs",color:"dimmed",className:"role-description",children:i})]})),ge=I.forwardRef(({styles:t,value:n,onChange:i},s)=>{const{data:u=[],loading:l}=V.useRequest(async()=>(await j.role.list()).map(f=>({label:f.name,value:f.id,description:f.description,disabled:f.id===50})),{refreshDeps:[]});return r(o.Select,{ref:s,mb:t.spacing,size:t.size,required:!0,label:"Role",itemComponent:Jt,data:u,disabled:l,styles:()=>({item:{"&[data-selected]":{"&, &:hover":{".role-description":{color:"rgba(255,255,255,.8)"}}}}}),value:n,onChange:i})}),$={size:"sm",spacing:"md",button:{size:"xs"}};function Xt({postSubmit:t,styles:n=$,initialRoleID:i}){const{control:s,handleSubmit:u}=P.useForm({defaultValues:{name:"",email:"",role_id:i,password:""}}),l=async({name:c,email:f,password:g,role_id:w})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding account...",loading:!0}),await j.account.create(c,f,g,w),T.updateNotification({id:"for-creating",title:"Successful",message:"Account is added",color:"green"}),t()}catch(S){T.updateNotification({id:"for-creating",title:"Failed",message:S.message,color:"red"})}};return r(o.Box,{mx:"auto",children:b("form",{onSubmit:u(l),children:[r(P.Controller,{name:"name",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...c})}),r(P.Controller,{name:"email",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Email",...c})}),r(P.Controller,{name:"password",control:s,render:({field:c})=>r(o.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",description:"Password must be at least 8 characters long",...c})}),r(P.Controller,{name:"role_id",control:s,render:({field:c})=>r(ge,{styles:n,...c})}),r(o.Group,{position:"right",mt:n.spacing,children:r(o.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function ze({onSuccess:t,styles:n=$,initialRoleID:i}){const[s,u]=Y.default.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{t(),c()};return b(L,{children:[r(o.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:"Add an Account",trapFocus:!0,onDragStart:g=>{g.stopPropagation()},children:r(Xt,{postSubmit:f,styles:n,initialRoleID:i})}),r(o.Button,{size:n.button.size,onClick:l,leftIcon:r(F.PlaylistAdd,{size:20}),children:"Add an Account"})]})}function ke({id:t,name:n,onSuccess:i,styles:s=$}){const u=Q.useModals(),l=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting account...",loading:!0});try{await j.account.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Account [${n}] is deleted`,color:"green"}),i()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this account?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return r(o.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:r(F.Trash,{size:20}),children:"Delete"})}function Qt({id:t,name:n,email:i,role_id:s,postSubmit:u,styles:l=$}){const{control:c,handleSubmit:f,watch:g}=P.useForm({defaultValues:{name:n,email:i,role_id:s,reset_password:!1,new_password:""}}),w=async({name:p,email:z,role_id:N,reset_password:W,new_password:me})=>{try{T.showNotification({id:"for-updating",title:"Pending",message:"Updating account...",loading:!0}),await j.account.edit({id:t,name:p,email:z,role_id:N,reset_password:W,new_password:me}),T.updateNotification({id:"for-updating",title:"Successful",message:"Account is updated",color:"green"}),u()}catch(U){T.updateNotification({id:"for-updating",title:"Failed",message:U.message,color:"red"})}},[S,h]=g(["reset_password","new_password"]);return r(o.Box,{mx:"auto",children:b("form",{onSubmit:f(w),children:[r(P.Controller,{name:"name",control:c,render:({field:p})=>r(o.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Username",...p})}),r(P.Controller,{name:"email",control:c,render:({field:p})=>r(o.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Email",...p})}),r(P.Controller,{name:"role_id",control:c,render:({field:p})=>r(ge,{styles:l,...p})}),r(o.Divider,{my:20,variant:"dashed",label:"",labelPosition:"center"}),r(P.Controller,{name:"reset_password",control:c,render:({field:p})=>r(o.Switch,{mb:l.spacing,size:l.size,label:"Reset password",checked:p.value,onChange:z=>p.onChange(z.currentTarget.checked),styles:{label:{verticalAlign:"middle"}}})}),S&&r(P.Controller,{name:"new_password",control:c,render:({field:p})=>r(o.PasswordInput,{autoComplete:"off",mb:l.spacing,size:l.size,required:!0,description:"Password must be at least 8 characters long",label:"New Password",...p})}),r(o.Group,{position:"right",mt:l.spacing,children:r(o.Button,{type:"submit",size:l.button.size,children:"Submit"})})]})})}function Zt({account:t,onSuccess:n,styles:i=$}){const[s,u]=Y.default.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{n(),c()};return b(L,{children:[r(o.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:`Editing ${t.name}`,trapFocus:!0,onDragStart:g=>{g.stopPropagation()},children:r(Qt,{...t,postSubmit:f,styles:i})}),r(o.Button,{size:i.button.size,onClick:l,leftIcon:r(F.Edit,{size:20}),children:"Edit"})]})}function Ht({styles:t=$,config:n}){var w,S;ie(n);const{data:i=[],loading:s,refresh:u}=V.useRequest(async()=>{const{data:h}=await j.account.list();return h},{refreshDeps:[]}),{data:l=[],loading:c}=V.useRequest(async()=>(await j.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=I.useMemo(()=>l.reduce((h,p)=>(h.set(p.value,p.label),h),new Map),[l]),g=h=>{var p;return(p=f.get(h))!=null?p:h};return b(L,{children:[r(o.Group,{pt:t.spacing,position:"right",children:r(ze,{onSuccess:u,initialRoleID:(S=(w=l==null?void 0:l[0])==null?void 0:w.value)!=null?S:0})}),b(o.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(o.LoadingOverlay,{visible:s||c}),b(o.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:b("tr",{children:[r("th",{children:"Username"}),r("th",{children:"Email"}),r("th",{children:"Role"}),r("th",{children:"Action"})]})}),r("tbody",{children:i.map(h=>{const{id:p,name:z,email:N,role_id:W}=h;return b("tr",{children:[r("td",{width:200,children:z}),r("td",{width:200,children:N}),r("td",{width:200,children:g(W)}),r("td",{width:200,children:b(o.Group,{position:"left",children:[r(Zt,{account:h,onSuccess:u}),r(ke,{id:p,name:z,onSuccess:u})]})})]},p)})})]})]})]})}function er({postSubmit:t,styles:n=$}){const{control:i,handleSubmit:s}=P.useForm({defaultValues:{name:"",password:""}}),u=async({name:l,password:c})=>{try{T.showNotification({id:"for-login",title:"Pending",message:"Loggin in...",loading:!0});const f=await j.account.login(l,c);window.localStorage.setItem("token",f.token),T.updateNotification({id:"for-login",title:"Successful",message:"Logged in",color:"green"}),t(f)}catch(f){T.updateNotification({id:"for-login",title:"Login Failed",message:f.message,color:"red"})}};return r(o.Box,{mx:"auto",children:b("form",{onSubmit:s(u),children:[r(P.Controller,{name:"name",control:i,render:({field:l})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Username",...l})}),r(P.Controller,{name:"password",control:i,render:({field:l})=>r(o.PasswordInput,{mb:n.spacing,size:n.size,required:!0,label:"Password",...l})}),r(o.Group,{position:"right",mt:n.spacing,children:r(o.Button,{type:"submit",size:n.button.size,children:"Submit"})})]})})}function tr({styles:t=$,config:n,onSuccess:i}){return ie(n),r(L,{children:r(o.Box,{mt:t.spacing,sx:{position:"relative"},children:r(er,{styles:t,postSubmit:i})})})}const se={size:"sm",spacing:"md",button:{size:"xs"}};function rr({postSubmit:t,styles:n=se,initialRoleID:i}){const{control:s,handleSubmit:u}=P.useForm({defaultValues:{name:"",role_id:i}}),l=async({name:c,role_id:f})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding API Key...",loading:!0});const{app_id:g,app_secret:w}=await j.api_key.create(c,f);T.updateNotification({id:"for-creating",title:"Successful",message:"API Key is added",color:"green"}),t(g,w)}catch(g){T.updateNotification({id:"for-creating",title:"Failed",message:g.message,color:"red"})}};return r(o.Box,{mx:"auto",children:b("form",{onSubmit:u(l),children:[r(P.Controller,{name:"name",control:s,render:({field:c})=>r(o.TextInput,{mb:n.spacing,size:n.size,required:!0,label:"Name",...c})}),r(P.Controller,{name:"role_id",control:s,render:({field:c})=>r(ge,{styles:n,...c})}),r(o.Group,{position:"right",mt:n.spacing,children:r(o.Button,{type:"submit",size:n.button.size,children:"Save"})})]})})}function Ae({onSuccess:t,styles:n=se,initialRoleID:i}){const s=Q.useModals(),[u,l]=Y.default.useState(!1),c=()=>l(!0),f=()=>l(!1),g=(w,S)=>{f(),s.openModal({title:"API Key is generated",children:b(o.Stack,{children:[r(o.Text,{color:"dimmed",children:"Make sure you save it - you won't be able to access it again."}),r(o.TextInput,{defaultValue:w,disabled:!0,label:"APP ID",styles:{input:{cursor:"text !important"}}}),r(o.TextInput,{defaultValue:S,disabled:!0,label:"APP Secret",styles:{input:{cursor:"text !important"}}}),r(o.Button,{size:"sm",onClick:()=>{Q.closeAllModals()},children:"I've saved this API Key"})]}),onClose:()=>{t()}})};return b(L,{children:[r(o.Modal,{overflow:"inside",opened:u,onClose:()=>l(!1),title:"Add an API Key",trapFocus:!0,onDragStart:w=>{w.stopPropagation()},children:r(rr,{postSubmit:g,styles:n,initialRoleID:i})}),r(o.Button,{size:n.button.size,onClick:c,leftIcon:r(F.PlaylistAdd,{size:20}),children:"Add an API Key"})]})}function je({id:t,name:n,onSuccess:i,styles:s=se}){const u=Q.useModals(),l=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting API Key...",loading:!0});try{await j.api_key.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`API Key [${n}] is deleted`,color:"green"}),i()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this api-key?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return r(o.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:r(F.Trash,{size:20}),children:"Delete"})}function nr({styles:t=se,config:n}){var w,S;ie(n);const{data:i=[],loading:s,refresh:u}=V.useRequest(async()=>{const{data:h}=await j.api_key.list();return h},{refreshDeps:[]}),{data:l=[],loading:c}=V.useRequest(async()=>(await j.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=I.useMemo(()=>l.reduce((h,p)=>(h.set(p.value,p.label),h),new Map),[l]),g=h=>{var p;return(p=f.get(h))!=null?p:h};return b(L,{children:[r(o.Group,{pt:t.spacing,position:"right",children:r(Ae,{onSuccess:u,initialRoleID:(S=(w=l==null?void 0:l[0])==null?void 0:w.value)!=null?S:0})}),b(o.Box,{mt:t.spacing,sx:{position:"relative"},children:[r(o.LoadingOverlay,{visible:s||c}),b(o.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[r("thead",{children:b("tr",{children:[r("th",{children:"Name"}),r("th",{children:"APP ID"}),r("th",{children:"Role"}),r("th",{children:"Action"})]})}),r("tbody",{children:i.map(h=>{const{id:p,name:z,app_id:N,role_id:W}=h;return b("tr",{children:[r("td",{width:200,children:z}),r("td",{width:200,children:N}),r("td",{width:200,children:g(W)}),r("td",{width:200,children:r(o.Group,{position:"left",children:r(je,{id:p,name:z,onSuccess:u})})})]},p)})})]})]})]})}const ir=()=>Promise.resolve().then(()=>ar).then(({version:t})=>(console.log(`[@devtable/dashboard] version: ${t}`),t)),De="@devtable/settings-form",Ie="8.13.3",qe="Apache-2.0",Ne={access:"public",registry:"https://registry.npmjs.org/"},Le=["dist"],Me="./dist/settings-form.umd.js",Be="./dist/settings-form.es.js",Fe="./dist/index.d.ts",$e={".":{import:"./dist/settings-form.es.js",require:"./dist/settings-form.umd.js"},"./dist/style.css":{import:"./dist/style.css",require:"./dist/style.css"}},Ue={"dev-build":"tsc && vite build --watch",build:"tsc && vite build",preview:"vite preview"},Ve={"@monaco-editor/react":"4.4.6","monaco-editor":"0.36.0"},We={"@types/crypto-js":"v4.1.1","@types/lodash":"^4.14.182","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@types/react-grid-layout":"^1.3.2","rollup-plugin-visualizer":"5.6.0",typescript:"^4.6.3"},Ge={"@emotion/react":"11.10.0","@mantine/core":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5",ahooks:"^3.3.11",axios:"^0.27.2","crypto-js":"^4.1.1",lodash:"^4.17.21",react:"^16.8.0 || 17.x || 18.x","react-dom":"^16.8.0 || 17.x || 18.x","react-hook-form":"^7.31.2","tabler-icons-react":"^1.48.0"},ar=Object.freeze(Object.defineProperty({__proto__:null,name:De,version:Ie,license:qe,publishConfig:Ne,files:Le,main:Me,module:Be,types:Fe,exports:$e,scripts:Ue,dependencies:Ve,devDependencies:We,peerDependencies:Ge,default:{name:De,version:Ie,license:qe,publishConfig:Ne,files:Le,main:Me,module:Be,types:Fe,exports:$e,scripts:Ue,dependencies:Ve,devDependencies:We,peerDependencies:Ge}},Symbol.toStringTag,{value:"Module"}));y.APIKeyList=nr,y.AccountList=Ht,y.AddAPIKey=Ae,y.AddAccount=ze,y.AddDataSource=xe,y.DataSourceList=Kt,y.DeleteAPIKey=je,y.DeleteAccount=ke,y.DeleteDataSource=Oe,y.Login=tr,y.getVersion=ir,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
29
+ `)};function At({submit:t,styles:r=Y}){const{control:i,setValue:s,handleSubmit:u}=C.useForm({defaultValues:{type:"http",key:"",config:{host:"",processing:{pre:oe.pre,post:oe.post}}}});return n(o.Box,{mx:"auto",children:b("form",{onSubmit:u(t),children:[n(C.Controller,{name:"key",control:i,render:({field:l})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",placeholder:"A unique name",...l})}),n(o.Divider,{label:"Connection Info",labelPosition:"center"}),n(C.Controller,{name:"config.host",control:i,render:({field:l})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Base URL",sx:{flexGrow:1},...l})}),b(o.Group,{grow:!0,children:[n(C.Controller,{name:"config.processing.pre",control:i,render:({field:l})=>n(Te,{label:"Pre Processing",modalTitle:"This function will run before sending the request (for scenarios like encryption)",defaultValue:oe.pre,...l,styles:r})}),n(C.Controller,{name:"config.processing.post",control:i,render:({field:l})=>n(Te,{label:"Post Processing",modalTitle:"This function will run after sending the request (for scenarios like decryption)",defaultValue:oe.post,...l,styles:r})})]}),n(o.Group,{position:"right",mt:r.spacing,children:n(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Dt({postSubmit:t,styles:r=Y}){const[i,s]=I.useState("postgresql"),u=async({type:f,key:g,config:w})=>{T.showNotification({id:"for-creating",title:"Pending",message:"Adding data source...",loading:!0});try{console.log({type:f,key:g,config:w}),await j.datasource.create(f,g,w),T.updateNotification({id:"for-creating",title:"Successful",message:"Data source is added",color:"green"}),t()}catch(_){T.updateNotification({id:"for-creating",title:"Failed",message:_.message,color:"red"})}},l=i==="postgresql"||i==="mysql",c=i==="http";return b(o.Box,{mx:"auto",children:[n(o.SegmentedControl,{fullWidth:!0,mb:r.spacing,size:r.size,data:[{label:"PostgreSQL",value:"postgresql"},{label:"MySQL",value:"mysql"},{label:"HTTP",value:"http"}],value:i,onChange:f=>s(f)}),l&&n(xt,{submit:u,styles:r,type:i}),c&&n(At,{submit:u,styles:r})]})}function Ee({onSuccess:t,styles:r=Y}){const[i,s]=G.default.useState(!1),u=()=>s(!0),l=()=>s(!1),c=()=>{t(),l()};return b(N,{children:[n(o.Modal,{overflow:"inside",opened:i,onClose:()=>s(!1),title:"Add a data source",trapFocus:!0,onDragStart:f=>{f.stopPropagation()},children:n(Dt,{postSubmit:c,styles:r})}),n(o.Button,{size:r.button.size,onClick:u,leftIcon:n(B.PlaylistAdd,{size:20}),children:"Add a Data Source"})]})}function pe(){return pe=Object.assign?Object.assign.bind():function(t){for(var r=1;r<arguments.length;r++){var i=arguments[r];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(t[s]=i[s])}return t},pe.apply(this,arguments)}function jt(t,r){if(t==null)return{};var i,s,u=function(c,f){if(c==null)return{};var g,w,_={},m=Object.keys(c);for(w=0;w<m.length;w++)g=m[w],f.indexOf(g)>=0||(_[g]=c[g]);return _}(t,r);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(t);for(s=0;s<l.length;s++)i=l[s],r.indexOf(i)>=0||Object.prototype.propertyIsEnumerable.call(t,i)&&(u[i]=t[i])}return u}var kt=["size","color","stroke"];function It(t){var r=t.size,i=r===void 0?24:r,s=t.color,u=s===void 0?"currentColor":s,l=t.stroke,c=l===void 0?2:l,f=jt(t,kt);return Z.createElement("svg",pe({xmlns:"http://www.w3.org/2000/svg",className:"icon icon-tabler icon-tabler-lock",width:i,height:i,viewBox:"0 0 24 24",strokeWidth:c,stroke:u,fill:"none",strokeLinecap:"round",strokeLinejoin:"round"},f),Z.createElement("path",{stroke:"none",d:"M0 0h24v24H0z",fill:"none"}),Z.createElement("rect",{x:5,y:11,width:14,height:10,rx:2}),Z.createElement("circle",{cx:12,cy:16,r:1}),Z.createElement("path",{d:"M8 11v-4a4 4 0 0 1 8 0v4"}))}function xe({id:t,name:r,isProtected:i,onSuccess:s,styles:u=Y}){const l=X.useModals(),c=async()=>{!t||(T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting data source...",loading:!0}),await j.datasource.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Data source [${r}] is deleted`,color:"green"}),s())},f=()=>l.openConfirmModal({title:"Delete this data source?",children:n(o.Text,{size:u.size,children:"This action won't affect your database."}),labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:c}),g=o.useMantineTheme();return i?n(o.Tooltip,{withArrow:!0,events:{hover:!0,touch:!1,focus:!1},label:"This is a preset datasource, it can not be deleted",children:n("span",{children:n(It,{size:16,color:g.colors.gray[7]})})}):n(o.Button,{size:u.button.size,color:"red",onClick:f,leftIcon:n(B.Trash,{size:20}),children:"Delete"})}function qt({styles:t=Y,config:r}){ie(r);const{data:i=[],loading:s,refresh:u}=U.useRequest(async()=>{const{data:l}=await j.datasource.list();return l},{refreshDeps:[]});return b(N,{children:[n(o.Group,{pt:t.spacing,position:"right",children:n(Ee,{onSuccess:u})}),b(o.Box,{mt:t.spacing,sx:{position:"relative"},children:[n(o.LoadingOverlay,{visible:s}),b(o.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[n("thead",{children:b("tr",{children:[n("th",{children:"Type"}),n("th",{children:"Name"}),n("th",{children:"Action"})]})}),n("tbody",{children:i.map(({id:l,key:c,type:f,is_preset:g})=>b("tr",{children:[n("td",{width:200,children:f}),n("td",{children:c}),n("td",{width:200,children:n(o.Group,{position:"left",children:n(xe,{isProtected:g,id:l,name:c,onSuccess:u})})})]},c))})]})]})]})}const Nt=I.forwardRef(({label:t,value:r,description:i,...s},u)=>b(o.Stack,{spacing:2,ref:u,...s,children:[n(o.Text,{size:"sm",children:t}),n(o.Text,{size:"xs",color:"dimmed",className:"role-description",children:i})]})),ge=I.forwardRef(({styles:t,value:r,onChange:i},s)=>{const{data:u=[],loading:l}=U.useRequest(async()=>(await j.role.list()).map(f=>({label:f.name,value:f.id,description:f.description,disabled:f.id===50})),{refreshDeps:[]});return n(o.Select,{ref:s,mb:t.spacing,size:t.size,required:!0,label:"Role",itemComponent:Nt,data:u,disabled:l,styles:()=>({item:{"&[data-selected]":{"&, &:hover":{".role-description":{color:"rgba(255,255,255,.8)"}}}}}),value:r,onChange:i})}),F={size:"sm",spacing:"md",button:{size:"xs"}};function Lt({postSubmit:t,styles:r=F,initialRoleID:i}){const{control:s,handleSubmit:u}=C.useForm({defaultValues:{name:"",email:"",role_id:i,password:""}}),l=async({name:c,email:f,password:g,role_id:w})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding account...",loading:!0}),await j.account.create(c,f,g,w),T.updateNotification({id:"for-creating",title:"Successful",message:"Account is added",color:"green"}),t()}catch(_){T.updateNotification({id:"for-creating",title:"Failed",message:_.message,color:"red"})}};return n(o.Box,{mx:"auto",children:b("form",{onSubmit:u(l),children:[n(C.Controller,{name:"name",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...c})}),n(C.Controller,{name:"email",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Email",...c})}),n(C.Controller,{name:"password",control:s,render:({field:c})=>n(o.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",description:"Password must be at least 8 characters long",...c})}),n(C.Controller,{name:"role_id",control:s,render:({field:c})=>n(ge,{styles:r,...c})}),n(o.Group,{position:"right",mt:r.spacing,children:n(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Oe({onSuccess:t,styles:r=F,initialRoleID:i}){const[s,u]=G.default.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{t(),c()};return b(N,{children:[n(o.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:"Add an Account",trapFocus:!0,onDragStart:g=>{g.stopPropagation()},children:n(Lt,{postSubmit:f,styles:r,initialRoleID:i})}),n(o.Button,{size:r.button.size,onClick:l,leftIcon:n(B.PlaylistAdd,{size:20}),children:"Add an Account"})]})}function ze({id:t,name:r,onSuccess:i,styles:s=F}){const u=X.useModals(),l=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting account...",loading:!0});try{await j.account.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`Account [${r}] is deleted`,color:"green"}),i()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this account?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return n(o.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:n(B.Trash,{size:20}),children:"Delete"})}function Mt({id:t,name:r,email:i,role_id:s,postSubmit:u,styles:l=F}){const{control:c,handleSubmit:f,watch:g}=C.useForm({defaultValues:{name:r,email:i,role_id:s,reset_password:!1,new_password:""}}),w=async({name:p,email:z,role_id:q,reset_password:V,new_password:he})=>{try{T.showNotification({id:"for-updating",title:"Pending",message:"Updating account...",loading:!0}),await j.account.edit({id:t,name:p,email:z,role_id:q,reset_password:V,new_password:he}),T.updateNotification({id:"for-updating",title:"Successful",message:"Account is updated",color:"green"}),u()}catch($){T.updateNotification({id:"for-updating",title:"Failed",message:$.message,color:"red"})}},[_,m]=g(["reset_password","new_password"]);return n(o.Box,{mx:"auto",children:b("form",{onSubmit:f(w),children:[n(C.Controller,{name:"name",control:c,render:({field:p})=>n(o.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Username",...p})}),n(C.Controller,{name:"email",control:c,render:({field:p})=>n(o.TextInput,{mb:l.spacing,size:l.size,required:!0,label:"Email",...p})}),n(C.Controller,{name:"role_id",control:c,render:({field:p})=>n(ge,{styles:l,...p})}),n(o.Divider,{my:20,variant:"dashed",label:"",labelPosition:"center"}),n(C.Controller,{name:"reset_password",control:c,render:({field:p})=>n(o.Switch,{mb:l.spacing,size:l.size,label:"Reset password",checked:p.value,onChange:z=>p.onChange(z.currentTarget.checked),styles:{label:{verticalAlign:"middle"}}})}),_&&n(C.Controller,{name:"new_password",control:c,render:({field:p})=>n(o.PasswordInput,{autoComplete:"off",mb:l.spacing,size:l.size,required:!0,description:"Password must be at least 8 characters long",label:"New Password",...p})}),n(o.Group,{position:"right",mt:l.spacing,children:n(o.Button,{type:"submit",size:l.button.size,children:"Submit"})})]})})}function Bt({account:t,onSuccess:r,styles:i=F}){const[s,u]=G.default.useState(!1),l=()=>u(!0),c=()=>u(!1),f=()=>{r(),c()};return b(N,{children:[n(o.Modal,{overflow:"inside",opened:s,onClose:()=>u(!1),title:`Editing ${t.name}`,trapFocus:!0,onDragStart:g=>{g.stopPropagation()},children:n(Mt,{...t,postSubmit:f,styles:i})}),n(o.Button,{size:i.button.size,onClick:l,leftIcon:n(B.Edit,{size:20}),children:"Edit"})]})}function Ft({styles:t=F,config:r}){var w,_;ie(r);const{data:i=[],loading:s,refresh:u}=U.useRequest(async()=>{const{data:m}=await j.account.list();return m},{refreshDeps:[]}),{data:l=[],loading:c}=U.useRequest(async()=>(await j.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=I.useMemo(()=>l.reduce((m,p)=>(m.set(p.value,p.label),m),new Map),[l]),g=m=>{var p;return(p=f.get(m))!=null?p:m};return b(N,{children:[n(o.Group,{pt:t.spacing,position:"right",children:n(Oe,{onSuccess:u,initialRoleID:(_=(w=l==null?void 0:l[0])==null?void 0:w.value)!=null?_:0})}),b(o.Box,{mt:t.spacing,sx:{position:"relative"},children:[n(o.LoadingOverlay,{visible:s||c}),b(o.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[n("thead",{children:b("tr",{children:[n("th",{children:"Username"}),n("th",{children:"Email"}),n("th",{children:"Role"}),n("th",{children:"Action"})]})}),n("tbody",{children:i.map(m=>{const{id:p,name:z,email:q,role_id:V}=m;return b("tr",{children:[n("td",{width:200,children:z}),n("td",{width:200,children:q}),n("td",{width:200,children:g(V)}),n("td",{width:200,children:b(o.Group,{position:"left",children:[n(Bt,{account:m,onSuccess:u}),n(ze,{id:p,name:z,onSuccess:u})]})})]},p)})})]})]})]})}function $t({postSubmit:t,styles:r=F}){const{control:i,handleSubmit:s}=C.useForm({defaultValues:{name:"",password:""}}),u=async({name:l,password:c})=>{try{T.showNotification({id:"for-login",title:"Pending",message:"Loggin in...",loading:!0});const f=await j.account.login(l,c);window.localStorage.setItem("token",f.token),T.updateNotification({id:"for-login",title:"Successful",message:"Logged in",color:"green"}),t(f)}catch(f){T.updateNotification({id:"for-login",title:"Login Failed",message:f.message,color:"red"})}};return n(o.Box,{mx:"auto",children:b("form",{onSubmit:s(u),children:[n(C.Controller,{name:"name",control:i,render:({field:l})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Username",...l})}),n(C.Controller,{name:"password",control:i,render:({field:l})=>n(o.PasswordInput,{mb:r.spacing,size:r.size,required:!0,label:"Password",...l})}),n(o.Group,{position:"right",mt:r.spacing,children:n(o.Button,{type:"submit",size:r.button.size,children:"Submit"})})]})})}function Ut({styles:t=F,config:r,onSuccess:i}){return ie(r),n(N,{children:n(o.Box,{mt:t.spacing,sx:{position:"relative"},children:n($t,{styles:t,postSubmit:i})})})}const se={size:"sm",spacing:"md",button:{size:"xs"}};function Vt({postSubmit:t,styles:r=se,initialRoleID:i}){const{control:s,handleSubmit:u}=C.useForm({defaultValues:{name:"",role_id:i}}),l=async({name:c,role_id:f})=>{try{T.showNotification({id:"for-creating",title:"Pending",message:"Adding API Key...",loading:!0});const{app_id:g,app_secret:w}=await j.api_key.create(c,f);T.updateNotification({id:"for-creating",title:"Successful",message:"API Key is added",color:"green"}),t(g,w)}catch(g){T.updateNotification({id:"for-creating",title:"Failed",message:g.message,color:"red"})}};return n(o.Box,{mx:"auto",children:b("form",{onSubmit:u(l),children:[n(C.Controller,{name:"name",control:s,render:({field:c})=>n(o.TextInput,{mb:r.spacing,size:r.size,required:!0,label:"Name",...c})}),n(C.Controller,{name:"role_id",control:s,render:({field:c})=>n(ge,{styles:r,...c})}),n(o.Group,{position:"right",mt:r.spacing,children:n(o.Button,{type:"submit",size:r.button.size,children:"Save"})})]})})}function Ae({onSuccess:t,styles:r=se,initialRoleID:i}){const s=X.useModals(),[u,l]=G.default.useState(!1),c=()=>l(!0),f=()=>l(!1),g=(w,_)=>{f(),s.openModal({title:"API Key is generated",children:b(o.Stack,{children:[n(o.Text,{color:"dimmed",children:"Make sure you save it - you won't be able to access it again."}),n(o.TextInput,{defaultValue:w,disabled:!0,label:"APP ID",styles:{input:{cursor:"text !important"}}}),n(o.TextInput,{defaultValue:_,disabled:!0,label:"APP Secret",styles:{input:{cursor:"text !important"}}}),n(o.Button,{size:"sm",onClick:()=>{X.closeAllModals()},children:"I've saved this API Key"})]}),onClose:()=>{t()}})};return b(N,{children:[n(o.Modal,{overflow:"inside",opened:u,onClose:()=>l(!1),title:"Add an API Key",trapFocus:!0,onDragStart:w=>{w.stopPropagation()},children:n(Vt,{postSubmit:g,styles:r,initialRoleID:i})}),n(o.Button,{size:r.button.size,onClick:c,leftIcon:n(B.PlaylistAdd,{size:20}),children:"Add an API Key"})]})}function De({id:t,name:r,onSuccess:i,styles:s=se}){const u=X.useModals(),l=async()=>{if(!!t){T.showNotification({id:"for-deleting",title:"Pending",message:"Deleting API Key...",loading:!0});try{await j.api_key.delete(t),T.updateNotification({id:"for-deleting",title:"Successful",message:`API Key [${r}] is deleted`,color:"green"}),i()}catch(f){T.updateNotification({id:"for-deleting",title:"Failed",message:f.message,color:"red"})}}},c=()=>u.openConfirmModal({title:"Delete this api-key?",labels:{confirm:"Confirm",cancel:"Cancel"},onCancel:()=>console.log("Cancel"),onConfirm:l});return n(o.Button,{size:s.button.size,color:"red",onClick:c,leftIcon:n(B.Trash,{size:20}),children:"Delete"})}function Wt({styles:t=se,config:r}){var w,_;ie(r);const{data:i=[],loading:s,refresh:u}=U.useRequest(async()=>{const{data:m}=await j.api_key.list();return m},{refreshDeps:[]}),{data:l=[],loading:c}=U.useRequest(async()=>(await j.role.list()).map(p=>({label:p.name,value:p.id,description:p.description,disabled:p.id===50})),{refreshDeps:[]}),f=I.useMemo(()=>l.reduce((m,p)=>(m.set(p.value,p.label),m),new Map),[l]),g=m=>{var p;return(p=f.get(m))!=null?p:m};return b(N,{children:[n(o.Group,{pt:t.spacing,position:"right",children:n(Ae,{onSuccess:u,initialRoleID:(_=(w=l==null?void 0:l[0])==null?void 0:w.value)!=null?_:0})}),b(o.Box,{mt:t.spacing,sx:{position:"relative"},children:[n(o.LoadingOverlay,{visible:s||c}),b(o.Table,{horizontalSpacing:t.spacing,verticalSpacing:t.spacing,fontSize:t.size,highlightOnHover:!0,children:[n("thead",{children:b("tr",{children:[n("th",{children:"Name"}),n("th",{children:"APP ID"}),n("th",{children:"Role"}),n("th",{children:"Action"})]})}),n("tbody",{children:i.map(m=>{const{id:p,name:z,app_id:q,role_id:V}=m;return b("tr",{children:[n("td",{width:200,children:z}),n("td",{width:200,children:q}),n("td",{width:200,children:g(V)}),n("td",{width:200,children:n(o.Group,{position:"left",children:n(De,{id:p,name:z,onSuccess:u})})})]},p)})})]})]})]})}const Gt=()=>Promise.resolve().then(()=>Yt).then(({version:t})=>(console.log(`[@devtable/dashboard] version: ${t}`),t)),je="@devtable/settings-form",ke="8.13.5",Ie="Apache-2.0",qe={access:"public",registry:"https://registry.npmjs.org/"},Ne=["dist"],Le="./dist/settings-form.umd.js",Me="./dist/settings-form.es.js",Be="./dist/index.d.ts",Fe={".":{import:"./dist/settings-form.es.js",require:"./dist/settings-form.umd.js"},"./dist/style.css":{import:"./dist/style.css",require:"./dist/style.css"}},$e={"dev-build":"tsc && vite build --watch",build:"tsc && vite build",preview:"vite preview"},Ue={"@monaco-editor/react":"4.4.6","monaco-editor":"0.36.0"},Ve={"@types/crypto-js":"v4.1.1","@types/lodash":"^4.14.182","@types/react":"^18.0.0","@types/react-dom":"^18.0.0","@types/react-grid-layout":"^1.3.2","rollup-plugin-visualizer":"5.6.0",typescript:"^4.6.3","vite-plugin-static-copy":"0.13.1"},We={"@emotion/react":"11.10.0","@mantine/core":"5.9.5","@mantine/hooks":"5.9.5","@mantine/modals":"5.9.5","@mantine/notifications":"5.9.5",ahooks:"^3.3.11",axios:"^0.27.2","crypto-js":"^4.1.1",lodash:"^4.17.21",react:"^16.8.0 || 17.x || 18.x","react-dom":"^16.8.0 || 17.x || 18.x","react-hook-form":"^7.31.2","tabler-icons-react":"^1.48.0"},Yt=Object.freeze(Object.defineProperty({__proto__:null,name:je,version:ke,license:Ie,publishConfig:qe,files:Ne,main:Le,module:Me,types:Be,exports:Fe,scripts:$e,dependencies:Ue,devDependencies:Ve,peerDependencies:We,default:{name:je,version:ke,license:Ie,publishConfig:qe,files:Ne,main:Le,module:Me,types:Be,exports:Fe,scripts:$e,dependencies:Ue,devDependencies:Ve,peerDependencies:We}},Symbol.toStringTag,{value:"Module"}));P.APIKeyList=Wt,P.AccountList=Ft,P.AddAPIKey=Ae,P.AddAccount=Oe,P.AddDataSource=Ee,P.DataSourceList=qt,P.DeleteAPIKey=De,P.DeleteAccount=ze,P.DeleteDataSource=xe,P.Login=Ut,P.getVersion=Gt,Object.defineProperties(P,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devtable/settings-form",
3
- "version": "8.13.3",
3
+ "version": "8.13.5",
4
4
  "license": "Apache-2.0",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -38,7 +38,8 @@
38
38
  "@types/react-dom": "^18.0.0",
39
39
  "@types/react-grid-layout": "^1.3.2",
40
40
  "rollup-plugin-visualizer": "5.6.0",
41
- "typescript": "^4.6.3"
41
+ "typescript": "^4.6.3",
42
+ "vite-plugin-static-copy": "0.13.1"
42
43
  },
43
44
  "peerDependencies": {
44
45
  "@emotion/react": "11.10.0",