proje-react-panel 1.0.9 → 1.0.10

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.
Files changed (100) hide show
  1. package/.eslintrc.js +2 -0
  2. package/.idea/vcs.xml +0 -1
  3. package/.idea/watcherTasks.xml +4 -0
  4. package/dist/api/crudApi.d.ts +12 -4
  5. package/dist/components/ErrorBoundary.d.ts +16 -0
  6. package/dist/components/ErrorComponent.d.ts +4 -0
  7. package/dist/components/Form.d.ts +6 -0
  8. package/dist/components/FormField.d.ts +13 -0
  9. package/dist/components/Label.d.ts +8 -0
  10. package/dist/components/Panel.d.ts +3 -1
  11. package/dist/components/layout/Layout.d.ts +9 -2
  12. package/dist/components/layout/SideBar.d.ts +13 -2
  13. package/dist/components/list/List.d.ts +5 -5
  14. package/dist/components/screens/ControllerCreate.d.ts +5 -0
  15. package/dist/components/screens/ControllerDetails.d.ts +5 -0
  16. package/dist/components/screens/ControllerEdit.d.ts +5 -0
  17. package/dist/components/screens/ControllerList.d.ts +5 -0
  18. package/dist/components/screens/Login.d.ts +4 -0
  19. package/dist/decorators/Cell.d.ts +9 -0
  20. package/dist/decorators/Input.d.ts +13 -0
  21. package/dist/hooks/useScreens.d.ts +2 -0
  22. package/dist/index.cjs.js +1 -12
  23. package/dist/index.d.ts +6 -1
  24. package/dist/index.esm.js +1 -12
  25. package/dist/initPanel.d.ts +2 -0
  26. package/dist/initPanelOptions.d.ts +8 -0
  27. package/dist/screens/ControllerDetails.d.ts +2 -2
  28. package/dist/screens/ControllerEdit.d.ts +2 -2
  29. package/dist/screens/ControllerList.d.ts +2 -2
  30. package/dist/screens/Form.d.ts +2 -2
  31. package/dist/src/api/crudApi.d.ts +6 -0
  32. package/dist/src/components/Panel.d.ts +9 -0
  33. package/dist/src/components/layout/Layout.d.ts +11 -0
  34. package/dist/src/components/layout/SideBar.d.ts +10 -0
  35. package/dist/src/components/list/List.d.ts +10 -0
  36. package/dist/src/decorators/Crud.d.ts +6 -0
  37. package/dist/src/index.d.ts +8 -0
  38. package/dist/src/screens/ControllerCreate.d.ts +5 -0
  39. package/dist/src/screens/ControllerDetails.d.ts +5 -0
  40. package/dist/src/screens/ControllerEdit.d.ts +5 -0
  41. package/dist/src/screens/ControllerList.d.ts +5 -0
  42. package/dist/src/screens/Form.d.ts +6 -0
  43. package/dist/src/store/store.d.ts +19 -0
  44. package/dist/src/types/Screen.d.ts +4 -0
  45. package/dist/src/types/ScreenCreatorData.d.ts +8 -0
  46. package/dist/src/utils/createScreens.d.ts +1 -0
  47. package/dist/src/utils/getFields.d.ts +2 -0
  48. package/dist/src/utils/getScreens.d.ts +2 -0
  49. package/dist/store/store.d.ts +19 -0
  50. package/dist/types/ScreenCreatorData.d.ts +9 -6
  51. package/dist/types/initPanelOptions.d.ts +8 -0
  52. package/dist/utils/crudScreens.d.ts +2 -0
  53. package/dist/utils/getFields.d.ts +1 -1
  54. package/dist/utils/getScreens.d.ts +2 -0
  55. package/package.json +14 -7
  56. package/src/api/crudApi.ts +30 -28
  57. package/src/components/ErrorBoundary.tsx +64 -0
  58. package/src/components/ErrorComponent.tsx +15 -0
  59. package/src/components/Form.tsx +70 -0
  60. package/src/components/FormField.tsx +60 -0
  61. package/src/components/Label.tsx +15 -0
  62. package/src/components/Panel.tsx +12 -7
  63. package/src/components/layout/Layout.tsx +16 -12
  64. package/src/components/layout/SideBar.tsx +38 -12
  65. package/src/components/list/List.tsx +73 -67
  66. package/src/components/screens/ControllerCreate.tsx +7 -0
  67. package/src/components/screens/ControllerDetails.tsx +40 -0
  68. package/src/components/screens/ControllerEdit.tsx +35 -0
  69. package/src/components/screens/ControllerList.tsx +44 -0
  70. package/src/components/screens/Login.tsx +64 -0
  71. package/src/decorators/Cell.ts +34 -0
  72. package/src/decorators/Input.ts +50 -0
  73. package/src/hooks/useScreens.tsx +37 -0
  74. package/src/index.ts +7 -2
  75. package/src/initPanel.ts +14 -0
  76. package/src/store/store.ts +18 -0
  77. package/src/styles/error-boundary.scss +89 -0
  78. package/src/styles/form.scss +38 -6
  79. package/src/styles/index.scss +22 -4
  80. package/src/styles/layout.scss +49 -0
  81. package/src/styles/list.scss +8 -6
  82. package/src/styles/login.scss +90 -0
  83. package/src/styles/sidebar.scss +17 -22
  84. package/src/types/ScreenCreatorData.ts +10 -7
  85. package/src/types/initPanelOptions.ts +8 -0
  86. package/src/utils/createScreens.ts +2 -2
  87. package/src/utils/getFields.ts +8 -9
  88. package/dist/utils/getScreenForRoutes.d.ts +0 -2
  89. package/dist/utils/storeData.d.ts +0 -4
  90. package/src/declerations/Cell.ts +0 -37
  91. package/src/screens/ControllerCreate.tsx +0 -13
  92. package/src/screens/ControllerDetails.tsx +0 -34
  93. package/src/screens/ControllerEdit.tsx +0 -31
  94. package/src/screens/ControllerList.tsx +0 -40
  95. package/src/screens/Form.tsx +0 -67
  96. package/src/utils/getScreenForRoutes.tsx +0 -44
  97. package/src/utils/storeData.ts +0 -7
  98. /package/dist/{declerations → decorators}/Crud.d.ts +0 -0
  99. /package/dist/{declerations → src/decorators}/Cell.d.ts +0 -0
  100. /package/src/{declerations → decorators}/Crud.ts +0 -0
package/dist/index.esm.js CHANGED
@@ -1,12 +1 @@
1
- import*as e from"react";import t,{useState as r,useEffect as n}from"react";const a={screens:{}};function i(e){a.screens=e}var o,s={};
2
- /**
3
- * react-router v7.3.0
4
- *
5
- * Copyright (c) Remix Software Inc.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE.md file in the root directory of this source tree.
9
- *
10
- * @license MIT
11
- */
12
- function l(e,t){if(!1===e||null==e)throw new Error(t)}function u(e,t){if(!e){"undefined"!=typeof console&&console.warn(t);try{throw new Error(t)}catch(e){}}}function c({pathname:e="/",search:t="",hash:r=""}){return t&&"?"!==t&&(e+="?"===t.charAt(0)?t:"?"+t),r&&"#"!==r&&(e+="#"===r.charAt(0)?r:"#"+r),e}function d(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function f(e,t,r="/"){return function(e,t,r,n){let a="string"==typeof t?d(t):t,i=C(a.pathname||"/",r);if(null==i)return null;let o=m(e);!function(e){e.sort(((e,t)=>e.score!==t.score?t.score-e.score:function(e,t){let r=e.length===t.length&&e.slice(0,-1).every(((e,r)=>e===t[r]));return r?e[e.length-1]-t[t.length-1]:0}(e.routesMeta.map((e=>e.childrenIndex)),t.routesMeta.map((e=>e.childrenIndex)))))}(o);let s=null;for(let e=0;null==s&&e<o.length;++e){let t=A(i);s=S(o[e],t,n)}return s}(e,t,r,!1)}function m(e,t=[],r=[],n=""){let a=(e,a,i)=>{let o={relativePath:void 0===i?e.path||"":i,caseSensitive:!0===e.caseSensitive,childrenIndex:a,route:e};o.relativePath.startsWith("/")&&(l(o.relativePath.startsWith(n),`Absolute route path "${o.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),o.relativePath=o.relativePath.slice(n.length));let s=V([n,o.relativePath]),u=r.concat(o);e.children&&e.children.length>0&&(l(!0!==e.index,`Index routes must not have child routes. Please remove all child routes from route path "${s}".`),m(e.children,t,u,s)),(null!=e.path||e.index)&&t.push({path:s,score:E(s,e.index),routesMeta:u})};return e.forEach(((e,t)=>{if(""!==e.path&&e.path?.includes("?"))for(let r of h(e.path))a(e,t,r);else a(e,t)})),t}function h(e){let t=e.split("/");if(0===t.length)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(0===n.length)return a?[i,""]:[i];let o=h(n.join("/")),s=[];return s.push(...o.map((e=>""===e?i:[i,e].join("/")))),a&&s.push(...o),s.map((t=>e.startsWith("/")&&""===t?"/":t))}!function(){if(o)return s;o=1,Object.defineProperty(s,"__esModule",{value:!0}),s.parse=function(e,t){const r=new i,n=e.length;if(n<2)return r;const a=t?.decode||c;let o=0;do{const t=e.indexOf("=",o);if(-1===t)break;const i=e.indexOf(";",o),s=-1===i?n:i;if(t>s){o=e.lastIndexOf(";",t-1)+1;continue}const c=l(e,o,t),d=u(e,t,c),f=e.slice(c,d);if(void 0===r[f]){let n=l(e,t+1,s),i=u(e,s,n);const o=a(e.slice(n,i));r[f]=o}o=s+1}while(o<n);return r},s.serialize=function(i,o,s){const l=s?.encode||encodeURIComponent;if(!e.test(i))throw new TypeError(`argument name is invalid: ${i}`);const u=l(o);if(!t.test(u))throw new TypeError(`argument val is invalid: ${o}`);let c=i+"="+u;if(!s)return c;if(void 0!==s.maxAge){if(!Number.isInteger(s.maxAge))throw new TypeError(`option maxAge is invalid: ${s.maxAge}`);c+="; Max-Age="+s.maxAge}if(s.domain){if(!r.test(s.domain))throw new TypeError(`option domain is invalid: ${s.domain}`);c+="; Domain="+s.domain}if(s.path){if(!n.test(s.path))throw new TypeError(`option path is invalid: ${s.path}`);c+="; Path="+s.path}if(s.expires){if(!function(e){return"[object Date]"===a.call(e)}(s.expires)||!Number.isFinite(s.expires.valueOf()))throw new TypeError(`option expires is invalid: ${s.expires}`);c+="; Expires="+s.expires.toUTCString()}s.httpOnly&&(c+="; HttpOnly");s.secure&&(c+="; Secure");s.partitioned&&(c+="; Partitioned");if(s.priority){switch("string"==typeof s.priority?s.priority.toLowerCase():void 0){case"low":c+="; Priority=Low";break;case"medium":c+="; Priority=Medium";break;case"high":c+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${s.priority}`)}}if(s.sameSite){switch("string"==typeof s.sameSite?s.sameSite.toLowerCase():s.sameSite){case!0:case"strict":c+="; SameSite=Strict";break;case"lax":c+="; SameSite=Lax";break;case"none":c+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${s.sameSite}`)}}return c};const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,r=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,n=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,i=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function l(e,t,r){do{const r=e.charCodeAt(t);if(32!==r&&9!==r)return t}while(++t<r);return r}function u(e,t,r){for(;t>r;){const r=e.charCodeAt(--t);if(32!==r&&9!==r)return t+1}return r}function c(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}}();var p=/^:[\w-]+$/,y=3,v=2,g=1,b=10,w=-2,x=e=>"*"===e;function E(e,t){let r=e.split("/"),n=r.length;return r.some(x)&&(n+=w),t&&(n+=v),r.filter((e=>!x(e))).reduce(((e,t)=>e+(p.test(t)?y:""===t?g:b)),n)}function S(e,t,r=!1){let{routesMeta:n}=e,a={},i="/",o=[];for(let e=0;e<n.length;++e){let s=n[e],l=e===n.length-1,u="/"===i?t:t.slice(i.length)||"/",c=_({path:s.relativePath,caseSensitive:s.caseSensitive,end:l},u),d=s.route;if(!c&&l&&r&&!n[n.length-1].route.index&&(c=_({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},u)),!c)return null;Object.assign(a,c.params),o.push({params:a,pathname:V([i,c.pathname]),pathnameBase:$(V([i,c.pathnameBase])),route:d}),"/"!==c.pathnameBase&&(i=V([i,c.pathnameBase]))}return o}function _(e,t){"string"==typeof e&&(e={path:e,caseSensitive:!1,end:!0});let[r,n]=function(e,t=!1,r=!0){u("*"===e||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,((e,t,r)=>(n.push({paramName:t,isOptional:null!=r}),r?"/?([^\\/]+)?":"/([^\\/]+)")));e.endsWith("*")?(n.push({paramName:"*"}),a+="*"===e||"/*"===e?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":""!==e&&"/"!==e&&(a+="(?:(?=\\/|$))");let i=new RegExp(a,t?void 0:"i");return[i,n]}(e.path,e.caseSensitive,e.end),a=t.match(r);if(!a)return null;let i=a[0],o=i.replace(/(.)\/+$/,"$1"),s=a.slice(1);return{params:n.reduce(((e,{paramName:t,isOptional:r},n)=>{if("*"===t){let e=s[n]||"";o=i.slice(0,i.length-e.length).replace(/(.)\/+$/,"$1")}const a=s[n];return e[t]=r&&!a?void 0:(a||"").replace(/%2F/g,"/"),e}),{}),pathname:i,pathnameBase:o,pattern:e}}function A(e){try{return e.split("/").map((e=>decodeURIComponent(e).replace(/\//g,"%2F"))).join("/")}catch(t){return u(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function C(e,t){if("/"===t)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&"/"!==n?null:e.slice(r)||"/"}function k(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function F(e){let t=function(e){return e.filter(((e,t)=>0===t||e.route.path&&e.route.path.length>0))}(e);return t.map(((e,r)=>r===t.length-1?e.pathname:e.pathnameBase))}function D(e,t,r,n=!1){let a;"string"==typeof e?a=d(e):(a={...e},l(!a.pathname||!a.pathname.includes("?"),k("?","pathname","search",a)),l(!a.pathname||!a.pathname.includes("#"),k("#","pathname","hash",a)),l(!a.search||!a.search.includes("#"),k("#","search","hash",a)));let i,o=""===e||""===a.pathname,s=o?"/":a.pathname;if(null==s)i=r;else{let e=t.length-1;if(!n&&s.startsWith("..")){let t=s.split("/");for(;".."===t[0];)t.shift(),e-=1;a.pathname=t.join("/")}i=e>=0?t[e]:"/"}let u=function(e,t="/"){let{pathname:r,search:n="",hash:a=""}="string"==typeof e?d(e):e,i=r?r.startsWith("/")?r:function(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach((e=>{".."===e?r.length>1&&r.pop():"."!==e&&r.push(e)})),r.length>1?r.join("/"):"/"}(r,t):t;return{pathname:i,search:R(n),hash:T(a)}}(a,i),c=s&&"/"!==s&&s.endsWith("/"),f=(o||"."===s)&&r.endsWith("/");return u.pathname.endsWith("/")||!c&&!f||(u.pathname+="/"),u}var V=e=>e.join("/").replace(/\/\/+/g,"/"),$=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),R=e=>e&&"?"!==e?e.startsWith("?")?e:"?"+e:"",T=e=>e&&"#"!==e?e.startsWith("#")?e:"#"+e:"";var N=["POST","PUT","PATCH","DELETE"];new Set(N);var L=["GET",...N];new Set(L);var O=e.createContext(null);O.displayName="DataRouter";var P=e.createContext(null);P.displayName="DataRouterState";var j=e.createContext({isTransitioning:!1});j.displayName="ViewTransition",e.createContext(new Map).displayName="Fetchers",e.createContext(null).displayName="Await";var M=e.createContext(null);M.displayName="Navigation";var U=e.createContext(null);U.displayName="Location";var B=e.createContext({outlet:null,matches:[],isDataRoute:!1});B.displayName="Route";var W=e.createContext(null);function I(){return null!=e.useContext(U)}function z(){return l(I(),"useLocation() may be used only in the context of a <Router> component."),e.useContext(U).location}W.displayName="RouteError";var H="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function J(t){e.useContext(M).static||e.useLayoutEffect(t)}function q(){let{isDataRoute:t}=e.useContext(B);return t?function(){let{router:t}=function(t){let r=e.useContext(O);return l(r,re(t)),r}("useNavigate"),r=ne("useNavigate"),n=e.useRef(!1);return J((()=>{n.current=!0})),e.useCallback((async(e,a={})=>{u(n.current,H),n.current&&("number"==typeof e?t.navigate(e):await t.navigate(e,{fromRouteId:r,...a}))}),[t,r])}():function(){l(I(),"useNavigate() may be used only in the context of a <Router> component.");let t=e.useContext(O),{basename:r,navigator:n}=e.useContext(M),{matches:a}=e.useContext(B),{pathname:i}=z(),o=JSON.stringify(F(a)),s=e.useRef(!1);return J((()=>{s.current=!0})),e.useCallback(((e,a={})=>{if(u(s.current,H),!s.current)return;if("number"==typeof e)return void n.go(e);let l=D(e,JSON.parse(o),i,"path"===a.relative);null==t&&"/"!==r&&(l.pathname="/"===l.pathname?r:V([r,l.pathname])),(a.replace?n.replace:n.push)(l,a.state,a)}),[r,n,o,i,t])}()}var K=e.createContext(null);function Y(){let{matches:t}=e.useContext(B),r=t[t.length-1];return r?r.params:{}}function G(t,{relative:r}={}){let{matches:n}=e.useContext(B),{pathname:a}=z(),i=JSON.stringify(F(n));return e.useMemo((()=>D(t,JSON.parse(i),a,"path"===r)),[t,i,a,r])}function X(t,r,n,a){l(I(),"useRoutes() may be used only in the context of a <Router> component.");let i,{navigator:o,static:s}=e.useContext(M),{matches:c}=e.useContext(B),d=c[c.length-1],m=d?d.params:{},h=d?d.pathname:"/",p=d?d.pathnameBase:"/",y=d&&d.route;{let e=y&&y.path||"";ie(h,!y||e.endsWith("*")||e.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${h}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.\n\nPlease change the parent <Route path="${e}"> to <Route path="${"/"===e?"*":`${e}/*`}">.`)}i=z();let v=i.pathname||"/",g=v;if("/"!==p){let e=p.replace(/^\//,"").split("/");g="/"+v.replace(/^\//,"").split("/").slice(e.length).join("/")}let b=!s&&n&&n.matches&&n.matches.length>0?n.matches:f(t,{pathname:g});u(y||null!=b,`No routes matched location "${i.pathname}${i.search}${i.hash}" `),u(null==b||void 0!==b[b.length-1].route.element||void 0!==b[b.length-1].route.Component||void 0!==b[b.length-1].route.lazy,`Matched leaf route at location "${i.pathname}${i.search}${i.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let w=function(t,r=[],n=null){if(null==t){if(!n)return null;if(n.errors)t=n.matches;else{if(0!==r.length||n.initialized||!(n.matches.length>0))return null;t=n.matches}}let a=t,i=n?.errors;if(null!=i){let e=a.findIndex((e=>e.route.id&&void 0!==i?.[e.route.id]));l(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(i).join(",")}`),a=a.slice(0,Math.min(a.length,e+1))}let o=!1,s=-1;if(n)for(let e=0;e<a.length;e++){let t=a[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:r}=n,i=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!r||void 0===r[t.route.id]);if(t.route.lazy||i){o=!0,a=s>=0?a.slice(0,s+1):[a[0]];break}}}return a.reduceRight(((t,l,u)=>{let c,d=!1,f=null,m=null;n&&(c=i&&l.route.id?i[l.route.id]:void 0,f=l.route.errorElement||Z,o&&(s<0&&0===u?(ie("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,m=null):s===u&&(d=!0,m=l.route.hydrateFallbackElement||null)));let h=r.concat(a.slice(0,u+1)),p=()=>{let r;return r=c?f:d?m:l.route.Component?e.createElement(l.route.Component,null):l.route.element?l.route.element:t,e.createElement(te,{match:l,routeContext:{outlet:t,matches:h,isDataRoute:null!=n},children:r})};return n&&(l.route.ErrorBoundary||l.route.errorElement||0===u)?e.createElement(ee,{location:n.location,revalidation:n.revalidation,component:f,error:c,children:p(),routeContext:{outlet:null,matches:h,isDataRoute:!0}}):p()}),null)}(b&&b.map((e=>Object.assign({},e,{params:Object.assign({},m,e.params),pathname:V([p,o.encodeLocation?o.encodeLocation(e.pathname).pathname:e.pathname]),pathnameBase:"/"===e.pathnameBase?p:V([p,o.encodeLocation?o.encodeLocation(e.pathnameBase).pathname:e.pathnameBase])}))),c,n,a);return w}function Q(){let t=function(){let t=e.useContext(W),r=function(t){let r=e.useContext(P);return l(r,re(t)),r}("useRouteError"),n=ne("useRouteError");if(void 0!==t)return t;return r.errors?.[n]}(),r=function(e){return null!=e&&"number"==typeof e.status&&"string"==typeof e.statusText&&"boolean"==typeof e.internal&&"data"in e}(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,a="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:a},o={padding:"2px 4px",backgroundColor:a},s=null;return console.error("Error handled by React Router default ErrorBoundary:",t),s=e.createElement(e.Fragment,null,e.createElement("p",null,"💿 Hey developer 👋"),e.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",e.createElement("code",{style:o},"ErrorBoundary")," or"," ",e.createElement("code",{style:o},"errorElement")," prop on your route.")),e.createElement(e.Fragment,null,e.createElement("h2",null,"Unexpected Application Error!"),e.createElement("h3",{style:{fontStyle:"italic"}},r),n?e.createElement("pre",{style:i},n):null,s)}var Z=e.createElement(Q,null),ee=class extends e.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||"idle"!==t.revalidation&&"idle"===e.revalidation?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:void 0!==e.error?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return void 0!==this.state.error?e.createElement(B.Provider,{value:this.props.routeContext},e.createElement(W.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function te({routeContext:t,match:r,children:n}){let a=e.useContext(O);return a&&a.static&&a.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=r.route.id),e.createElement(B.Provider,{value:t},n)}function re(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ne(t){let r=function(t){let r=e.useContext(B);return l(r,re(t)),r}(t),n=r.matches[r.matches.length-1];return l(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}var ae={};function ie(e,t,r){t||ae[e]||(ae[e]=!0,u(!1,r))}function oe(t){return function(t){let r=e.useContext(B).outlet;return r?e.createElement(K.Provider,{value:t},r):r}(t.context)}function se(e){l(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}e.memo((function({routes:e,future:t,state:r}){return X(e,0,r,t)}));var le="get",ue="application/x-www-form-urlencoded";function ce(e){return null!=e&&"string"==typeof e.tagName}var de=null;var fe=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function me(e){return null==e||fe.has(e)?e:(u(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${ue}"`),null)}function he(e,t){let r,n,a,i,o;if(ce(s=e)&&"form"===s.tagName.toLowerCase()){let o=e.getAttribute("action");n=o?C(o,t):null,r=e.getAttribute("method")||le,a=me(e.getAttribute("enctype"))||ue,i=new FormData(e)}else if(function(e){return ce(e)&&"button"===e.tagName.toLowerCase()}(e)||function(e){return ce(e)&&"input"===e.tagName.toLowerCase()}(e)&&("submit"===e.type||"image"===e.type)){let o=e.form;if(null==o)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let s=e.getAttribute("formaction")||o.getAttribute("action");if(n=s?C(s,t):null,r=e.getAttribute("formmethod")||o.getAttribute("method")||le,a=me(e.getAttribute("formenctype"))||me(o.getAttribute("enctype"))||ue,i=new FormData(o,e),!function(){if(null===de)try{new FormData(document.createElement("form"),0),de=!1}catch(e){de=!0}return de}()){let{name:t,type:r,value:n}=e;if("image"===r){let e=t?`${t}.`:"";i.append(`${e}x`,"0"),i.append(`${e}y`,"0")}else t&&i.append(t,n)}}else{if(ce(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=le,n=null,a=ue,o=e}var s;return i&&"text/plain"===a&&(o=i,i=void 0),{action:n,method:r.toLowerCase(),encType:a,formData:i,body:o}}function pe(e,t){if(!1===e||null==e)throw new Error(t)}function ye(e){return null!=e&&(null==e.href?"preload"===e.rel&&"string"==typeof e.imageSrcSet&&"string"==typeof e.imageSizes:"string"==typeof e.rel&&"string"==typeof e.href)}async function ve(e,t,r){return function(e,t){let r=new Set;return new Set(t),e.reduce(((e,t)=>{let n=JSON.stringify(function(e){let t={},r=Object.keys(e).sort();for(let n of r)t[n]=e[n];return t}(t));return r.has(n)||(r.add(n),e.push({key:n,link:t})),e}),[])}((await Promise.all(e.map((async e=>{let n=t.routes[e.route.id];if(n){let e=await async function(e,t){if(e.id in t)return t[e.id];try{let r=await import(e.module);return t[e.id]=r,r}catch(t){if(console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode&&import.meta.hot)throw t;return window.location.reload(),new Promise((()=>{}))}}(n,r);return e.links?e.links():[]}return[]})))).flat(1).filter(ye).filter((e=>"stylesheet"===e.rel||"preload"===e.rel)).map((e=>"stylesheet"===e.rel?{...e,rel:"prefetch",as:"style"}:{...e,rel:"prefetch"})))}function ge(e,t,r,n,a,i){let o=(e,t)=>!r[t]||e.route.id!==r[t].route.id,s=(e,t)=>r[t].pathname!==e.pathname||r[t].route.path?.endsWith("*")&&r[t].params["*"]!==e.params["*"];return"assets"===i?t.filter(((e,t)=>o(e,t)||s(e,t))):"data"===i?t.filter(((t,i)=>{let l=n.routes[t.route.id];if(!l||!l.hasLoader)return!1;if(o(t,i)||s(t,i))return!0;if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if("boolean"==typeof n)return n}return!0})):[]}function be(e,t,{includeHydrateFallback:r}={}){return n=e.map((e=>{let n=t.routes[e.route.id];if(!n)return[];let a=[n.module];return n.clientActionModule&&(a=a.concat(n.clientActionModule)),n.clientLoaderModule&&(a=a.concat(n.clientLoaderModule)),r&&n.hydrateFallbackModule&&(a=a.concat(n.hydrateFallbackModule)),n.imports&&(a=a.concat(n.imports)),a})).flat(1),[...new Set(n)];var n}function we(){let t=e.useContext(O);return pe(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}var xe=e.createContext(void 0);function Ee(){let t=e.useContext(xe);return pe(t,"You must render this element inside a <HydratedRouter> element"),t}function Se(e,t){return r=>{e&&e(r),r.defaultPrevented||t(r)}}function _e({page:t,...r}){let{router:n}=we(),a=e.useMemo((()=>f(n.routes,t,n.basename)),[n.routes,t,n.basename]);return a?e.createElement(Ae,{page:t,matches:a,...r}):null}function Ae({page:t,matches:r,...n}){let a=z(),{manifest:i,routeModules:o}=Ee(),{basename:s}=we(),{loaderData:l,matches:u}=function(){let t=e.useContext(P);return pe(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}(),c=e.useMemo((()=>ge(t,r,u,i,a,"data")),[t,r,u,i,a]),d=e.useMemo((()=>ge(t,r,u,i,a,"assets")),[t,r,u,i,a]),f=e.useMemo((()=>{if(t===a.pathname+a.search+a.hash)return[];let e=new Set,n=!1;if(r.forEach((t=>{let r=i.routes[t.route.id];r&&r.hasLoader&&(!c.some((e=>e.route.id===t.route.id))&&t.route.id in l&&o[t.route.id]?.shouldRevalidate||r.hasClientLoader?n=!0:e.add(t.route.id))})),0===e.size)return[];let u=function(e,t){let r="string"==typeof e?new URL(e,"undefined"==typeof window?"server://singlefetch/":window.location.origin):e;return"/"===r.pathname?r.pathname="_root.data":t&&"/"===C(r.pathname,t)?r.pathname=`${t.replace(/\/$/,"")}/_root.data`:r.pathname=`${r.pathname.replace(/\/$/,"")}.data`,r}(t,s);return n&&e.size>0&&u.searchParams.set("_routes",r.filter((t=>e.has(t.route.id))).map((e=>e.route.id)).join(",")),[u.pathname+u.search]}),[s,l,a,i,c,r,t,o]),m=e.useMemo((()=>be(d,i)),[d,i]),h=function(t){let{manifest:r,routeModules:n}=Ee(),[a,i]=e.useState([]);return e.useEffect((()=>{let e=!1;return ve(t,r,n).then((t=>{e||i(t)})),()=>{e=!0}}),[t,r,n]),a}(d);return e.createElement(e.Fragment,null,f.map((t=>e.createElement("link",{key:t,rel:"prefetch",as:"fetch",href:t,...n}))),m.map((t=>e.createElement("link",{key:t,rel:"modulepreload",href:t,...n}))),h.map((({key:t,link:r})=>e.createElement("link",{key:t,...r}))))}function Ce(...e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}xe.displayName="FrameworkContext";var ke="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;try{ke&&(window.__reactRouterVersion="7.3.0")}catch(e){}var Fe=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,De=e.forwardRef((function({onClick:t,discover:r="render",prefetch:n="none",relative:a,reloadDocument:i,replace:o,state:s,target:d,to:f,preventScrollReset:m,viewTransition:h,...p},y){let v,{basename:g}=e.useContext(M),b="string"==typeof f&&Fe.test(f),w=!1;if("string"==typeof f&&b&&(v=f,ke))try{let e=new URL(window.location.href),t=f.startsWith("//")?new URL(e.protocol+f):new URL(f),r=C(t.pathname,g);t.origin===e.origin&&null!=r?f=r+t.search+t.hash:w=!0}catch(e){u(!1,`<Link to="${f}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let x=function(t,{relative:r}={}){l(I(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:a}=e.useContext(M),{hash:i,pathname:o,search:s}=G(t,{relative:r}),u=o;return"/"!==n&&(u="/"===o?n:V([n,o])),a.createHref({pathname:u,search:s,hash:i})}(f,{relative:a}),[E,S,_]=function(t,r){let n=e.useContext(xe),[a,i]=e.useState(!1),[o,s]=e.useState(!1),{onFocus:l,onBlur:u,onMouseEnter:c,onMouseLeave:d,onTouchStart:f}=r,m=e.useRef(null);e.useEffect((()=>{if("render"===t&&s(!0),"viewport"===t){let e=new IntersectionObserver((e=>{e.forEach((e=>{s(e.isIntersecting)}))}),{threshold:.5});return m.current&&e.observe(m.current),()=>{e.disconnect()}}}),[t]),e.useEffect((()=>{if(a){let e=setTimeout((()=>{s(!0)}),100);return()=>{clearTimeout(e)}}}),[a]);let h=()=>{i(!0)},p=()=>{i(!1),s(!1)};return n?"intent"!==t?[o,m,{}]:[o,m,{onFocus:Se(l,h),onBlur:Se(u,p),onMouseEnter:Se(c,h),onMouseLeave:Se(d,p),onTouchStart:Se(f,h)}]:[!1,m,{}]}(n,p),A=function(t,{target:r,replace:n,state:a,preventScrollReset:i,relative:o,viewTransition:s}={}){let l=q(),u=z(),d=G(t,{relative:o});return e.useCallback((e=>{if(function(e,t){return!(0!==e.button||t&&"_self"!==t||function(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}(e))}(e,r)){e.preventDefault();let r=void 0!==n?n:c(u)===c(d);l(t,{replace:r,state:a,preventScrollReset:i,relative:o,viewTransition:s})}}),[u,l,d,n,a,r,t,i,o,s])}(f,{replace:o,state:s,target:d,preventScrollReset:m,relative:a,viewTransition:h});let k=e.createElement("a",{...p,..._,href:v||x,onClick:w||i?t:function(e){t&&t(e),e.defaultPrevented||A(e)},ref:Ce(y,S),target:d,"data-discover":b||"render"!==r?void 0:"true"});return E&&!b?e.createElement(e.Fragment,null,k,e.createElement(_e,{page:x})):k}));function Ve(t){let r=e.useContext(O);return l(r,function(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}(t)),r}De.displayName="Link",e.forwardRef((function({"aria-current":t="page",caseSensitive:r=!1,className:n="",end:a=!1,style:i,to:o,viewTransition:s,children:u,...c},d){let f=G(o,{relative:c.relative}),m=z(),h=e.useContext(P),{navigator:p,basename:y}=e.useContext(M),v=null!=h&&function(t,r={}){let n=e.useContext(j);l(null!=n,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=Ve("useViewTransitionState"),i=G(t,{relative:r.relative});if(!n.isTransitioning)return!1;let o=C(n.currentLocation.pathname,a)||n.currentLocation.pathname,s=C(n.nextLocation.pathname,a)||n.nextLocation.pathname;return null!=_(i.pathname,s)||null!=_(i.pathname,o)}(f)&&!0===s,g=p.encodeLocation?p.encodeLocation(f).pathname:f.pathname,b=m.pathname,w=h&&h.navigation&&h.navigation.location?h.navigation.location.pathname:null;r||(b=b.toLowerCase(),w=w?w.toLowerCase():null,g=g.toLowerCase()),w&&y&&(w=C(w,y)||w);const x="/"!==g&&g.endsWith("/")?g.length-1:g.length;let E,S=b===g||!a&&b.startsWith(g)&&"/"===b.charAt(x),A=null!=w&&(w===g||!a&&w.startsWith(g)&&"/"===w.charAt(g.length)),k={isActive:S,isPending:A,isTransitioning:v},F=S?t:void 0;E="function"==typeof n?n(k):[n,S?"active":null,A?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let D="function"==typeof i?i(k):i;return e.createElement(De,{...c,"aria-current":F,className:E,ref:d,style:D,to:o,viewTransition:s},"function"==typeof u?u(k):u)})).displayName="NavLink",e.forwardRef((({discover:t="render",fetcherKey:r,navigate:n,reloadDocument:a,replace:i,state:o,method:s=le,action:u,onSubmit:d,relative:f,preventScrollReset:m,viewTransition:h,...p},y)=>{let v=function(){let{router:t}=Ve("useSubmit"),{basename:r}=e.useContext(M),n=ne("useRouteId");return e.useCallback((async(e,a={})=>{let{action:i,method:o,encType:s,formData:l,body:u}=he(e,r);if(!1===a.navigate){let e=a.fetcherKey||Re();await t.fetch(e,n,a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||o,formEncType:a.encType||s,flushSync:a.flushSync})}else await t.navigate(a.action||i,{preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||o,formEncType:a.encType||s,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})}),[t,r,n])}(),g=function(t,{relative:r}={}){let{basename:n}=e.useContext(M),a=e.useContext(B);l(a,"useFormAction must be used inside a RouteContext");let[i]=a.matches.slice(-1),o={...G(t||".",{relative:r})},s=z();if(null==t){o.search=s.search;let e=new URLSearchParams(o.search),t=e.getAll("index");if(t.some((e=>""===e))){e.delete("index"),t.filter((e=>e)).forEach((t=>e.append("index",t)));let r=e.toString();o.search=r?`?${r}`:""}}t&&"."!==t||!i.route.index||(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index");"/"!==n&&(o.pathname="/"===o.pathname?n:V([n,o.pathname]));return c(o)}(u,{relative:f}),b="get"===s.toLowerCase()?"get":"post",w="string"==typeof u&&Fe.test(u);return e.createElement("form",{ref:y,method:b,action:g,onSubmit:a?d:e=>{if(d&&d(e),e.defaultPrevented)return;e.preventDefault();let t=e.nativeEvent.submitter,a=t?.getAttribute("formmethod")||s;v(t||e.currentTarget,{fetcherKey:r,method:a,navigate:n,replace:i,state:o,relative:f,preventScrollReset:m,viewTransition:h})},...p,"data-discover":w||"render"!==t?void 0:"true"})})).displayName="Form";var $e=0,Re=()=>`__${String(++$e)}__`;function Te(){const[e,n]=r(!0);return t.createElement("div",{className:"sidebar "+(e?"open":"closed")},t.createElement("button",{className:"toggle-button",onClick:()=>n(!e)},e?"<":">"),t.createElement("nav",{className:"nav-links"}))}function Ne({children:e}){return t.createElement("div",{className:"layout"},t.createElement(Te,null),t.createElement("main",{className:"content"},e||t.createElement(oe,null)))}new TextEncoder;var Le=e=>"checkbox"===e.type,Oe=e=>e instanceof Date,Pe=e=>null==e;const je=e=>"object"==typeof e;var Me=e=>!Pe(e)&&!Array.isArray(e)&&je(e)&&!Oe(e),Ue="undefined"!=typeof window&&void 0!==window.HTMLElement&&"undefined"!=typeof document;function Be(e){let t;const r=Array.isArray(e),n="undefined"!=typeof FileList&&e instanceof FileList;if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else{if(Ue&&(e instanceof Blob||n)||!r&&!Me(e))return e;if(t=r?[]:{},r||(e=>{const t=e.constructor&&e.constructor.prototype;return Me(t)&&t.hasOwnProperty("isPrototypeOf")})(e))for(const r in e)e.hasOwnProperty(r)&&(t[r]=Be(e[r]));else t=e}return t}var We=e=>Array.isArray(e)?e.filter(Boolean):[],Ie=e=>void 0===e,ze=(e,t,r)=>{if(!t||!Me(e))return r;const n=We(t.split(/[,[\].]+?/)).reduce(((e,t)=>Pe(e)?e:e[t]),e);return Ie(n)||n===e?Ie(e[t])?r:e[t]:n},He=e=>"boolean"==typeof e,Je=e=>/^\w*$/.test(e),qe=e=>We(e.replace(/["|']|\]/g,"").split(/\.|\[/)),Ke=(e,t,r)=>{let n=-1;const a=Je(t)?[t]:qe(t),i=a.length,o=i-1;for(;++n<i;){const t=a[n];let i=r;if(n!==o){const r=e[t];i=Me(r)||Array.isArray(r)?r:isNaN(+a[n+1])?{}:[]}if("__proto__"===t||"constructor"===t||"prototype"===t)return;e[t]=i,e=e[t]}return e};const Ye="blur",Ge="focusout",Xe="onBlur",Qe="onChange",Ze="onSubmit",et="onTouched",tt="all",rt="max",nt="min",at="maxLength",it="minLength",ot="pattern",st="required",lt="validate";t.createContext(null);var ut=e=>Me(e)&&!Object.keys(e).length,ct=e=>Array.isArray(e)?e:[e];var dt=e=>"string"==typeof e,ft=(e,t,r,n,a)=>t?{...r[e],types:{...r[e]&&r[e].types?r[e].types:{},[n]:a||!0}}:{},mt=e=>({isOnSubmit:!e||e===Ze,isOnBlur:e===Xe,isOnChange:e===Qe,isOnAll:e===tt,isOnTouch:e===et}),ht=(e,t,r)=>!r&&(t.watchAll||t.watch.has(e)||[...t.watch].some((t=>e.startsWith(t)&&/^\.\w+/.test(e.slice(t.length)))));const pt=(e,t,r,n)=>{for(const a of r||Object.keys(e)){const r=ze(e,a);if(r){const{_f:e,...i}=r;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],a)&&!n)return!0;if(e.ref&&t(e.ref,e.name)&&!n)return!0;if(pt(i,t))break}else if(Me(i)&&pt(i,t))break}}};var yt=(e,t,r)=>{const n=ct(ze(e,r));return Ke(n,"root",t[r]),Ke(e,r,n),e},vt=e=>"file"===e.type,gt=e=>"function"==typeof e,bt=e=>{if(!Ue)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},wt=e=>dt(e),xt=e=>"radio"===e.type,Et=e=>e instanceof RegExp;const St={value:!1,isValid:!1},_t={value:!0,isValid:!0};var At=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter((e=>e&&e.checked&&!e.disabled)).map((e=>e.value));return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ie(e[0].attributes.value)?Ie(e[0].value)||""===e[0].value?_t:{value:e[0].value,isValid:!0}:_t:St}return St};const Ct={isValid:!1,value:null};var kt=e=>Array.isArray(e)?e.reduce(((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e),Ct):Ct;function Ft(e,t,r="validate"){if(wt(e)||Array.isArray(e)&&e.every(wt)||He(e)&&!e)return{type:r,message:wt(e)?e:"",ref:t}}var Dt=e=>Me(e)&&!Et(e)?e:{value:e,message:""},Vt=async(e,t,r,n,a,i)=>{const{ref:o,refs:s,required:l,maxLength:u,minLength:c,min:d,max:f,pattern:m,validate:h,name:p,valueAsNumber:y,mount:v}=e._f,g=ze(r,p);if(!v||t.has(p))return{};const b=s?s[0]:o,w=e=>{a&&b.reportValidity&&(b.setCustomValidity(He(e)?"":e||""),b.reportValidity())},x={},E=xt(o),S=Le(o),_=E||S,A=(y||vt(o))&&Ie(o.value)&&Ie(g)||bt(o)&&""===o.value||""===g||Array.isArray(g)&&!g.length,C=ft.bind(null,p,n,x),k=(e,t,r,n=at,a=it)=>{const i=e?t:r;x[p]={type:e?n:a,message:i,ref:o,...C(e?n:a,i)}};if(i?!Array.isArray(g)||!g.length:l&&(!_&&(A||Pe(g))||He(g)&&!g||S&&!At(s).isValid||E&&!kt(s).isValid)){const{value:e,message:t}=wt(l)?{value:!!l,message:l}:Dt(l);if(e&&(x[p]={type:st,message:t,ref:b,...C(st,t)},!n))return w(t),x}if(!(A||Pe(d)&&Pe(f))){let e,t;const r=Dt(f),a=Dt(d);if(Pe(g)||isNaN(g)){const n=o.valueAsDate||new Date(g),i=e=>new Date((new Date).toDateString()+" "+e),s="time"==o.type,l="week"==o.type;dt(r.value)&&g&&(e=s?i(g)>i(r.value):l?g>r.value:n>new Date(r.value)),dt(a.value)&&g&&(t=s?i(g)<i(a.value):l?g<a.value:n<new Date(a.value))}else{const n=o.valueAsNumber||(g?+g:g);Pe(r.value)||(e=n>r.value),Pe(a.value)||(t=n<a.value)}if((e||t)&&(k(!!e,r.message,a.message,rt,nt),!n))return w(x[p].message),x}if((u||c)&&!A&&(dt(g)||i&&Array.isArray(g))){const e=Dt(u),t=Dt(c),r=!Pe(e.value)&&g.length>+e.value,a=!Pe(t.value)&&g.length<+t.value;if((r||a)&&(k(r,e.message,t.message),!n))return w(x[p].message),x}if(m&&!A&&dt(g)){const{value:e,message:t}=Dt(m);if(Et(e)&&!g.match(e)&&(x[p]={type:ot,message:t,ref:o,...C(ot,t)},!n))return w(t),x}if(h)if(gt(h)){const e=Ft(await h(g,r),b);if(e&&(x[p]={...e,...C(lt,e.message)},!n))return w(e.message),x}else if(Me(h)){let e={};for(const t in h){if(!ut(e)&&!n)break;const a=Ft(await h[t](g,r),b,t);a&&(e={...a,...C(t,a.message)},w(a.message),n&&(x[p]=e))}if(!ut(e)&&(x[p]={ref:b,...e},!n))return x}return w(!0),x};function $t(e,t){const r=Array.isArray(t)?t:Je(t)?[t]:qe(t),n=1===r.length?e:function(e,t){const r=t.slice(0,-1).length;let n=0;for(;n<r;)e=Ie(e)?n++:e[t[n++]];return e}(e,r),a=r.length-1,i=r[a];return n&&delete n[i],0!==a&&(Me(n)&&ut(n)||Array.isArray(n)&&function(e){for(const t in e)if(e.hasOwnProperty(t)&&!Ie(e[t]))return!1;return!0}(n))&&$t(e,r.slice(0,-1)),e}var Rt=()=>{let e=[];return{get observers(){return e},next:t=>{for(const r of e)r.next&&r.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter((e=>e!==t))}}),unsubscribe:()=>{e=[]}}},Tt=e=>Pe(e)||!je(e);function Nt(e,t){if(Tt(e)||Tt(t))return e===t;if(Oe(e)&&Oe(t))return e.getTime()===t.getTime();const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(const a of r){const r=e[a];if(!n.includes(a))return!1;if("ref"!==a){const e=t[a];if(Oe(r)&&Oe(e)||Me(r)&&Me(e)||Array.isArray(r)&&Array.isArray(e)?!Nt(r,e):r!==e)return!1}}return!0}var Lt=e=>"select-multiple"===e.type,Ot=e=>bt(e)&&e.isConnected,Pt=e=>{for(const t in e)if(gt(e[t]))return!0;return!1};function jt(e,t={}){const r=Array.isArray(e);if(Me(e)||r)for(const r in e)Array.isArray(e[r])||Me(e[r])&&!Pt(e[r])?(t[r]=Array.isArray(e[r])?[]:{},jt(e[r],t[r])):Pe(e[r])||(t[r]=!0);return t}function Mt(e,t,r){const n=Array.isArray(e);if(Me(e)||n)for(const n in e)Array.isArray(e[n])||Me(e[n])&&!Pt(e[n])?Ie(t)||Tt(r[n])?r[n]=Array.isArray(e[n])?jt(e[n],[]):{...jt(e[n])}:Mt(e[n],Pe(t)?{}:t[n],r[n]):r[n]=!Nt(e[n],t[n]);return r}var Ut=(e,t)=>Mt(e,t,jt(t)),Bt=(e,{valueAsNumber:t,valueAsDate:r,setValueAs:n})=>Ie(e)?e:t?""===e?NaN:e?+e:e:r&&dt(e)?new Date(e):n?n(e):e;function Wt(e){const t=e.ref;return vt(t)?t.files:xt(t)?kt(e.refs).value:Lt(t)?[...t.selectedOptions].map((({value:e})=>e)):Le(t)?At(e.refs).value:Bt(Ie(t.value)?e.ref.value:t.value,e)}var It=e=>Ie(e)?e:Et(e)?e.source:Me(e)?Et(e.value)?e.value.source:e.value:e;const zt="AsyncFunction";function Ht(e,t,r){const n=ze(e,r);if(n||Je(r))return{error:n,name:r};const a=r.split(".");for(;a.length;){const n=a.join("."),i=ze(t,n),o=ze(e,n);if(i&&!Array.isArray(i)&&r!==n)return{name:r};if(o&&o.type)return{name:n,error:o};a.pop()}return{name:r}}const Jt={mode:Ze,reValidateMode:Qe,shouldFocusError:!0};function qt(e={}){let t,r={...Jt,...e},n={submitCount:0,isDirty:!1,isLoading:gt(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},i=(Me(r.defaultValues)||Me(r.values))&&Be(r.defaultValues||r.values)||{},o=r.shouldUnregister?{}:Be(i),s={action:!1,mount:!1,watch:!1},l={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Rt(),array:Rt(),state:Rt()},f=mt(r.mode),m=mt(r.reValidateMode),h=r.criteriaMode===tt,p=async e=>{if(!r.disabled&&(c.isValid||e)){const e=r.resolver?ut((await w()).errors):await x(a,!0);e!==n.isValid&&d.state.next({isValid:e})}},y=(e,t)=>{r.disabled||!c.isValidating&&!c.validatingFields||((e||Array.from(l.mount)).forEach((e=>{e&&(t?Ke(n.validatingFields,e,t):$t(n.validatingFields,e))})),d.state.next({validatingFields:n.validatingFields,isValidating:!ut(n.validatingFields)}))},v=(e,t,r,n)=>{const l=ze(a,e);if(l){const a=ze(o,e,Ie(r)?ze(i,e):r);Ie(a)||n&&n.defaultChecked||t?Ke(o,e,t?a:Wt(l._f)):_(e,a),s.mount&&p()}},g=(e,t,o,s,l)=>{let u=!1,f=!1;const m={name:e};if(!r.disabled){const r=!!(ze(a,e)&&ze(a,e)._f&&ze(a,e)._f.disabled);if(!o||s){c.isDirty&&(f=n.isDirty,n.isDirty=m.isDirty=E(),u=f!==m.isDirty);const a=r||Nt(ze(i,e),t);f=!(r||!ze(n.dirtyFields,e)),a||r?$t(n.dirtyFields,e):Ke(n.dirtyFields,e,!0),m.dirtyFields=n.dirtyFields,u=u||c.dirtyFields&&f!==!a}if(o){const t=ze(n.touchedFields,e);t||(Ke(n.touchedFields,e,o),m.touchedFields=n.touchedFields,u=u||c.touchedFields&&t!==o)}u&&l&&d.state.next(m)}return u?m:{}},b=(e,a,i,o)=>{const s=ze(n.errors,e),l=c.isValid&&He(a)&&n.isValid!==a;var f;if(r.delayError&&i?(f=()=>((e,t)=>{Ke(n.errors,e,t),d.state.next({errors:n.errors})})(e,i),t=e=>{clearTimeout(u),u=setTimeout(f,e)},t(r.delayError)):(clearTimeout(u),t=null,i?Ke(n.errors,e,i):$t(n.errors,e)),(i?!Nt(s,i):s)||!ut(o)||l){const t={...o,...l&&He(a)?{isValid:a}:{},errors:n.errors,name:e};n={...n,...t},d.state.next(t)}},w=async e=>{y(e,!0);const t=await r.resolver(o,r.context,((e,t,r,n)=>{const a={};for(const r of e){const e=ze(t,r);e&&Ke(a,r,e._f)}return{criteriaMode:r,names:[...e],fields:a,shouldUseNativeValidation:n}})(e||l.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return y(e),t},x=async(e,t,a={valid:!0})=>{for(const s in e){const u=e[s];if(u){const{_f:e,...d}=u;if(e){const d=l.array.has(e.name),f=u._f&&(!!(i=u._f)&&!!i.validate&&!!(gt(i.validate)&&i.validate.constructor.name===zt||Me(i.validate)&&Object.values(i.validate).find((e=>e.constructor.name===zt))));f&&c.validatingFields&&y([s],!0);const m=await Vt(u,l.disabled,o,h,r.shouldUseNativeValidation&&!t,d);if(f&&c.validatingFields&&y([s]),m[e.name]&&(a.valid=!1,t))break;!t&&(ze(m,e.name)?d?yt(n.errors,m,e.name):Ke(n.errors,e.name,m[e.name]):$t(n.errors,e.name))}!ut(d)&&await x(d,t,a)}}var i;return a.valid},E=(e,t)=>!r.disabled&&(e&&t&&Ke(o,e,t),!Nt(V(),i)),S=(e,t,r)=>((e,t,r,n,a)=>dt(e)?(n&&t.watch.add(e),ze(r,e,a)):Array.isArray(e)?e.map((e=>(n&&t.watch.add(e),ze(r,e)))):(n&&(t.watchAll=!0),r))(e,l,{...s.mount?o:Ie(t)?i:dt(e)?{[e]:t}:t},r,t),_=(e,t,r={})=>{const n=ze(a,e);let i=t;if(n){const r=n._f;r&&(!r.disabled&&Ke(o,e,Bt(t,r)),i=bt(r.ref)&&Pe(t)?"":t,Lt(r.ref)?[...r.ref.options].forEach((e=>e.selected=i.includes(e.value))):r.refs?Le(r.ref)?r.refs.length>1?r.refs.forEach((e=>(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(i)?!!i.find((t=>t===e.value)):i===e.value))):r.refs[0]&&(r.refs[0].checked=!!i):r.refs.forEach((e=>e.checked=e.value===i)):vt(r.ref)?r.ref.value="":(r.ref.value=i,r.ref.type||d.values.next({name:e,values:{...o}})))}(r.shouldDirty||r.shouldTouch)&&g(e,i,r.shouldTouch,r.shouldDirty,!0),r.shouldValidate&&D(e)},A=(e,t,r)=>{for(const n in t){const i=t[n],o=`${e}.${n}`,s=ze(a,o);(l.array.has(e)||Me(i)||s&&!s._f)&&!Oe(i)?A(o,i,r):_(o,i,r)}},C=(e,t,r={})=>{const u=ze(a,e),f=l.array.has(e),m=Be(t);Ke(o,e,m),f?(d.array.next({name:e,values:{...o}}),(c.isDirty||c.dirtyFields)&&r.shouldDirty&&d.state.next({name:e,dirtyFields:Ut(i,o),isDirty:E(e,m)})):!u||u._f||Pe(m)?_(e,m,r):A(e,m,r),ht(e,l)&&d.state.next({...n}),d.values.next({name:s.mount?e:void 0,values:{...o}})},k=async e=>{s.mount=!0;const i=e.target;let u=i.name,v=!0;const E=ze(a,u),S=()=>i.type?Wt(E._f):(e=>Me(e)&&e.target?Le(e.target)?e.target.checked:e.target.value:e)(e),_=e=>{v=Number.isNaN(e)||Oe(e)&&isNaN(e.getTime())||Nt(e,ze(o,u,e))};if(E){let i,s;const C=S(),k=e.type===Ye||e.type===Ge,F=!((A=E._f).mount&&(A.required||A.min||A.max||A.maxLength||A.minLength||A.pattern||A.validate)||r.resolver||ze(n.errors,u)||E._f.deps)||((e,t,r,n,a)=>!a.isOnAll&&(!r&&a.isOnTouch?!(t||e):(r?n.isOnBlur:a.isOnBlur)?!e:!(r?n.isOnChange:a.isOnChange)||e))(k,ze(n.touchedFields,u),n.isSubmitted,m,f),V=ht(u,l,k);Ke(o,u,C),k?(E._f.onBlur&&E._f.onBlur(e),t&&t(0)):E._f.onChange&&E._f.onChange(e);const $=g(u,C,k,!1),R=!ut($)||V;if(!k&&d.values.next({name:u,type:e.type,values:{...o}}),F)return c.isValid&&("onBlur"===r.mode&&k?p():k||p()),R&&d.state.next({name:u,...V?{}:$});if(!k&&V&&d.state.next({...n}),r.resolver){const{errors:e}=await w([u]);if(_(C),v){const t=Ht(n.errors,a,u),r=Ht(e,a,t.name||u);i=r.error,u=r.name,s=ut(e)}}else y([u],!0),i=(await Vt(E,l.disabled,o,h,r.shouldUseNativeValidation))[u],y([u]),_(C),v&&(i?s=!1:c.isValid&&(s=await x(a,!0)));v&&(E._f.deps&&D(E._f.deps),b(u,s,i,$))}var A},F=(e,t)=>{if(ze(n.errors,t)&&e.focus)return e.focus(),1},D=async(e,t={})=>{let i,o;const s=ct(e);if(r.resolver){const t=await(async e=>{const{errors:t}=await w(e);if(e)for(const r of e){const e=ze(t,r);e?Ke(n.errors,r,e):$t(n.errors,r)}else n.errors=t;return t})(Ie(e)?e:s);i=ut(t),o=e?!s.some((e=>ze(t,e))):i}else e?(o=(await Promise.all(s.map((async e=>{const t=ze(a,e);return await x(t&&t._f?{[e]:t}:t)})))).every(Boolean),(o||n.isValid)&&p()):o=i=await x(a);return d.state.next({...!dt(e)||c.isValid&&i!==n.isValid?{}:{name:e},...r.resolver||!e?{isValid:i}:{},errors:n.errors}),t.shouldFocus&&!o&&pt(a,F,e?s:l.mount),o},V=e=>{const t={...s.mount?o:i};return Ie(e)?t:dt(e)?ze(t,e):e.map((e=>ze(t,e)))},$=(e,t)=>({invalid:!!ze((t||n).errors,e),isDirty:!!ze((t||n).dirtyFields,e),error:ze((t||n).errors,e),isValidating:!!ze(n.validatingFields,e),isTouched:!!ze((t||n).touchedFields,e)}),R=(e,t,r)=>{const i=(ze(a,e,{_f:{}})._f||{}).ref,o=ze(n.errors,e)||{},{ref:s,message:l,type:u,...c}=o;Ke(n.errors,e,{...c,...t,ref:i}),d.state.next({name:e,errors:n.errors,isValid:!1}),r&&r.shouldFocus&&i&&i.focus&&i.focus()},T=(e,t={})=>{for(const s of e?ct(e):l.mount)l.mount.delete(s),l.array.delete(s),t.keepValue||($t(a,s),$t(o,s)),!t.keepError&&$t(n.errors,s),!t.keepDirty&&$t(n.dirtyFields,s),!t.keepTouched&&$t(n.touchedFields,s),!t.keepIsValidating&&$t(n.validatingFields,s),!r.shouldUnregister&&!t.keepDefaultValue&&$t(i,s);d.values.next({values:{...o}}),d.state.next({...n,...t.keepDirty?{isDirty:E()}:{}}),!t.keepIsValid&&p()},N=({disabled:e,name:t,field:r,fields:n})=>{(He(e)&&s.mount||e||l.disabled.has(t))&&(e?l.disabled.add(t):l.disabled.delete(t),g(t,Wt(r?r._f:ze(n,t)._f),!1,!1,!0))},L=(e,t={})=>{let n=ze(a,e);const o=He(t.disabled)||He(r.disabled);return Ke(a,e,{...n||{},_f:{...n&&n._f?n._f:{ref:{name:e}},name:e,mount:!0,...t}}),l.mount.add(e),n?N({field:n,disabled:He(t.disabled)?t.disabled:r.disabled,name:e}):v(e,!0,t.value),{...o?{disabled:t.disabled||r.disabled}:{},...r.progressive?{required:!!t.required,min:It(t.min),max:It(t.max),minLength:It(t.minLength),maxLength:It(t.maxLength),pattern:It(t.pattern)}:{},name:e,onChange:k,onBlur:k,ref:o=>{if(o){L(e,t),n=ze(a,e);const r=Ie(o.value)&&o.querySelectorAll&&o.querySelectorAll("input,select,textarea")[0]||o,s=(e=>xt(e)||Le(e))(r),l=n._f.refs||[];if(s?l.find((e=>e===r)):r===n._f.ref)return;Ke(a,e,{_f:{...n._f,...s?{refs:[...l.filter(Ot),r,...Array.isArray(ze(i,e))?[{}]:[]],ref:{type:r.type,name:e}}:{ref:r}}}),v(e,!1,void 0,r)}else n=ze(a,e,{}),n._f&&(n._f.mount=!1),(r.shouldUnregister||t.shouldUnregister)&&(!((e,t)=>e.has((e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e)(t)))(l.array,e)||!s.action)&&l.unMount.add(e)}}},O=()=>r.shouldFocusError&&pt(a,F,l.mount),P=(e,t)=>async i=>{let s;i&&(i.preventDefault&&i.preventDefault(),i.persist&&i.persist());let u=Be(o);if(l.disabled.size)for(const e of l.disabled)Ke(u,e,void 0);if(d.state.next({isSubmitting:!0}),r.resolver){const{errors:e,values:t}=await w();n.errors=e,u=t}else await x(a);if($t(n.errors,"root"),ut(n.errors)){d.state.next({errors:{}});try{await e(u,i)}catch(e){s=e}}else t&&await t({...n.errors},i),O(),setTimeout(O);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:ut(n.errors)&&!s,submitCount:n.submitCount+1,errors:n.errors}),s)throw s},j=(e,t={})=>{const u=e?Be(e):i,f=Be(u),m=ut(e),h=m?i:f;if(t.keepDefaultValues||(i=u),!t.keepValues){if(t.keepDirtyValues){const e=new Set([...l.mount,...Object.keys(Ut(i,o))]);for(const t of Array.from(e))ze(n.dirtyFields,t)?Ke(h,t,ze(o,t)):C(t,ze(h,t))}else{if(Ue&&Ie(e))for(const e of l.mount){const t=ze(a,e);if(t&&t._f){const e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(bt(e)){const t=e.closest("form");if(t){t.reset();break}}}}a={}}o=r.shouldUnregister?t.keepDefaultValues?Be(i):{}:Be(h),d.array.next({values:{...h}}),d.values.next({values:{...h}})}l={mount:t.keepDirtyValues?l.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!c.isValid||!!t.keepIsValid||!!t.keepDirtyValues,s.watch=!!r.shouldUnregister,d.state.next({submitCount:t.keepSubmitCount?n.submitCount:0,isDirty:!m&&(t.keepDirty?n.isDirty:!(!t.keepDefaultValues||Nt(e,i))),isSubmitted:!!t.keepIsSubmitted&&n.isSubmitted,dirtyFields:m?{}:t.keepDirtyValues?t.keepDefaultValues&&o?Ut(i,o):n.dirtyFields:t.keepDefaultValues&&e?Ut(i,e):t.keepDirty?n.dirtyFields:{},touchedFields:t.keepTouched?n.touchedFields:{},errors:t.keepErrors?n.errors:{},isSubmitSuccessful:!!t.keepIsSubmitSuccessful&&n.isSubmitSuccessful,isSubmitting:!1})},M=(e,t)=>j(gt(e)?e(o):e,t);return{control:{register:L,unregister:T,getFieldState:$,handleSubmit:P,setError:R,_executeSchema:w,_getWatch:S,_getDirty:E,_updateValid:p,_removeUnmounted:()=>{for(const e of l.unMount){const t=ze(a,e);t&&(t._f.refs?t._f.refs.every((e=>!Ot(e))):!Ot(t._f.ref))&&T(e)}l.unMount=new Set},_updateFieldArray:(e,t=[],l,u,f=!0,m=!0)=>{if(u&&l&&!r.disabled){if(s.action=!0,m&&Array.isArray(ze(a,e))){const t=l(ze(a,e),u.argA,u.argB);f&&Ke(a,e,t)}if(m&&Array.isArray(ze(n.errors,e))){const t=l(ze(n.errors,e),u.argA,u.argB);f&&Ke(n.errors,e,t),((e,t)=>{!We(ze(e,t)).length&&$t(e,t)})(n.errors,e)}if(c.touchedFields&&m&&Array.isArray(ze(n.touchedFields,e))){const t=l(ze(n.touchedFields,e),u.argA,u.argB);f&&Ke(n.touchedFields,e,t)}c.dirtyFields&&(n.dirtyFields=Ut(i,o)),d.state.next({name:e,isDirty:E(e,t),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else Ke(o,e,t)},_updateDisabledField:N,_getFieldArray:e=>We(ze(s.mount?o:i,e,r.shouldUnregister?ze(i,e,[]):[])),_reset:j,_resetDefaultValues:()=>gt(r.defaultValues)&&r.defaultValues().then((e=>{M(e,r.resetOptions),d.state.next({isLoading:!1})})),_updateFormState:e=>{n={...n,...e}},_disableForm:e=>{He(e)&&(d.state.next({disabled:e}),pt(a,((t,r)=>{const n=ze(a,r);n&&(t.disabled=n._f.disabled||e,Array.isArray(n._f.refs)&&n._f.refs.forEach((t=>{t.disabled=n._f.disabled||e})))}),0,!1))},_subjects:d,_proxyFormState:c,_setErrors:e=>{n.errors=e,d.state.next({errors:n.errors,isValid:!1})},get _fields(){return a},get _formValues(){return o},get _state(){return s},set _state(e){s=e},get _defaultValues(){return i},get _names(){return l},set _names(e){l=e},get _formState(){return n},set _formState(e){n=e},get _options(){return r},set _options(e){r={...r,...e}}},trigger:D,register:L,handleSubmit:P,watch:(e,t)=>gt(e)?d.values.subscribe({next:r=>e(S(void 0,t),r)}):S(e,t,!0),setValue:C,getValues:V,reset:M,resetField:(e,t={})=>{ze(a,e)&&(Ie(t.defaultValue)?C(e,Be(ze(i,e))):(C(e,t.defaultValue),Ke(i,e,Be(t.defaultValue))),t.keepTouched||$t(n.touchedFields,e),t.keepDirty||($t(n.dirtyFields,e),n.isDirty=t.defaultValue?E(e,Be(ze(i,e))):E()),t.keepError||($t(n.errors,e),c.isValid&&p()),d.state.next({...n}))},clearErrors:e=>{e&&ct(e).forEach((e=>$t(n.errors,e))),d.state.next({errors:e?n.errors:{}})},unregister:T,setError:R,setFocus:(e,t={})=>{const r=ze(a,e),n=r&&r._f;if(n){const e=n.refs?n.refs[0]:n.ref;e.focus&&(e.focus(),t.shouldSelect&&gt(e.select)&&e.select())}},getFieldState:$}}function Kt(e={}){const r=t.useRef(void 0),n=t.useRef(void 0),[a,i]=t.useState({isDirty:!1,isValidating:!1,isLoading:gt(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:gt(e.defaultValues)?void 0:e.defaultValues});r.current||(r.current={...qt(e),formState:a});const o=r.current.control;return o._options=e,function(e){const r=t.useRef(e);r.current=e,t.useEffect((()=>{const t=!e.disabled&&r.current.subject&&r.current.subject.subscribe({next:r.current.next});return()=>{t&&t.unsubscribe()}}),[e.disabled])}({subject:o._subjects.state,next:e=>{((e,t,r)=>{r(e);const{name:n,...a}=e;return ut(a)||Object.keys(a).length>=Object.keys(t).length||Object.keys(a).find((e=>t[e]===tt))})(e,o._proxyFormState,o._updateFormState)&&i({...o._formState})}}),t.useEffect((()=>o._disableForm(e.disabled)),[o,e.disabled]),t.useEffect((()=>{if(o._proxyFormState.isDirty){const e=o._getDirty();e!==a.isDirty&&o._subjects.state.next({isDirty:e})}}),[o,a.isDirty]),t.useEffect((()=>{e.values&&!Nt(e.values,n.current)?(o._reset(e.values,o._options.resetOptions),n.current=e.values,i((e=>({...e})))):o._resetDefaultValues()}),[e.values,o]),t.useEffect((()=>{e.errors&&o._setErrors(e.errors)}),[e.errors,o]),t.useEffect((()=>{o._state.mount||(o._updateValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()})),t.useEffect((()=>{e.shouldUnregister&&o._subjects.values.next({values:o._getWatch()})}),[e.shouldUnregister,o]),r.current.formState=((e,t,r,n=!0)=>{const a={defaultValues:t._defaultValues};for(const r in e)Object.defineProperty(a,r,{get:()=>{const a=r;return t._proxyFormState[a]!==tt&&(t._proxyFormState[a]=!n||tt),e[a]}});return a})(a,o),r.current}const Yt={getList:(e,t)=>fetch(e,{method:"GET",headers:{"Content-Type":"application/json"},body:JSON.stringify({page:t})}).then((e=>e.json())),create:(e,t)=>fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>e.json())),details:(e,t)=>fetch(`${e}/${t}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((e=>e.json())),edit:(e,t)=>fetch(`${e}/${t.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}).then((e=>e.json()))};function Gt({data:e,screen:r}){const{register:i,handleSubmit:o,reset:s,formState:{errors:l}}=Kt({resolver:a.screens[r.controller].resolver,defaultValues:e}),u=q(),c=a.screens[r.controller].fields;return n((()=>{s(e)}),[e,s]),t.createElement("div",{className:"form-wrapper"},t.createElement("form",{onSubmit:o((t=>{e?Yt.edit(r.controller,t).then((()=>{u("/"+r.controller,{replace:!0})})):Yt.create(r.controller,t).then((()=>{u("/"+r.controller,{replace:!0})}))}))},c.map((e=>t.createElement("div",{className:"form-field",key:e},t.createElement("label",{htmlFor:e},e.charAt(0).toUpperCase()+e.slice(1)),t.createElement("input",{type:"text",...i(e),placeholder:`Enter ${e}`,id:e}),l[e]&&t.createElement("span",{className:"error-message"},l[e]?.message)))),t.createElement("button",{type:"submit",className:"submit-button"},"Submit")))}function Xt({screen:e}){return t.createElement(Ne,null,t.createElement(Gt,{screen:e}))}function Qt({screen:e}){const{id:a}=Y(),[i,o]=r(null),[s,l]=r(null);return n((()=>{e.controller&&a&&Yt.details(e.controller,a).then((e=>{o(e.data)})).catch((e=>{l(e),console.error(e)}))}),[a,e]),t.createElement(Ne,null,t.createElement("p",{dangerouslySetInnerHTML:{__html:JSON.stringify(i,null," <br/>")}}))}function Zt({screen:e}){const{id:a}=Y(),[i,o]=r(null),[s,l]=r(null);return n((()=>{e.controller&&a&&Yt.details(e.controller,a).then((e=>{o(e.data)})).catch((e=>{l(e),console.error(e)}))}),[a,e]),t.createElement(Ne,null,t.createElement(Gt,{data:i,screen:e}))}function er({data:e,cells:r,screen:n}){return e&&0!==e.length?t.createElement("div",{className:"list-wrapper"},t.createElement("div",{className:"header"},"List"),t.createElement("table",{className:"list-table"},t.createElement("thead",null,t.createElement("tr",null,r.map((e=>t.createElement("th",{key:e.name},e.title??e.name))),t.createElement("th",null))),t.createElement("tbody",null,e.map(((e,n)=>t.createElement("tr",{key:n},r.map((r=>{const n=e[r.name];let a=n??"-";if("date"===r.type){if(n){const e=new Date(n);a=`${e.getDate().toString().padStart(2,"0")}/${(e.getMonth()+1).toString().padStart(2,"0")}/${e.getFullYear()} ${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}`}}else a=n?n.toString():r?.placeHolder??"-";let i=a;return r.linkTo&&(i=t.createElement(De,{to:r.linkTo(e)},a)),t.createElement("td",{key:r.name},i)})),t.createElement("td",null,t.createElement(De,{to:"edit/"+(e?.id??"-")},"Edit"),t.createElement(De,{to:"details/"+(e?.id??"-")},"Details")))))))):t.createElement("div",null,"No items available")}function tr({screen:e}){const[i,o]=r(0),[s,l]=r(null),[u,c]=r(null);return n((()=>{e.controller&&Yt.getList(e.controller,i).then((e=>{l(e.data)})).catch((e=>{c(e),console.error(e)}))}),[i,e.controller]),t.createElement(Ne,null,t.createElement(De,{to:"/maps/create"},"Create"),u?t.createElement("p",null,"Error ",u):null,t.createElement(er,{screen:e,cells:a.screens[e.key].cells,data:s}))}function rr(){const e=Object.entries(a.screens);return t.createElement(t.Fragment,null,e.map((([e,r])=>{let n=`/${r.crud.controller}`;const a={key:e,controller:r.crud.controller};return t.createElement(t.Fragment,{key:"index"},t.createElement(se,{path:n+"/create",element:t.createElement(Xt,{screen:a})}),t.createElement(se,{path:n+"/details/:id",element:t.createElement(Qt,{screen:a})}),t.createElement(se,{path:n+"/edit/:id",element:t.createElement(Zt,{screen:a})}),t.createElement(se,{path:n,element:t.createElement(tr,{screen:a})}))})),t.createElement(se,{path:"*",element:t.createElement("div",null,"404 - Not Found")}))}function nr({children:e}){return t.createElement(t.Fragment,null,e)}export{Ne as Layout,nr as Panel,i as createScreens,rr as getScreenForRoutes};
1
+ import{persist as t,createJSONStorage as e}from"zustand/middleware";import{createWithEqualityFn as r}from"zustand/traditional";import{shallow as n}from"zustand/vanilla/shallow";import o,{useEffect as i,useState as a,useMemo as s,Component as c}from"react";import{useNavigate as u,useParams as l,Link as p,Route as f}from"react-router";import{useForm as d,get as h,set as y}from"react-hook-form";const v=r()(t((t=>({screens:null,fetchSettings:null})),{name:"app-store-1",storage:e((()=>localStorage)),partialize:t=>({})}),n);function m(t){v.setState({screens:t})}const g=(t,e)=>fetch(`${t.baseUrl}/${e}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((t=>t.json())),_=(t,e,r)=>fetch(`${t?.baseUrl??""}/${e}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then((t=>t.json())),S=(t,e,r)=>fetch(`${t?.baseUrl??""}/${e}/${r}`,{method:"GET",headers:{"Content-Type":"application/json"}}).then((t=>t.json())),O=(t,e,r)=>fetch(`${t?.baseUrl??""}/${e}/${r.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)}).then((t=>t.json()));function E({htmlFor:t,label:e,fieldName:r}){return o.createElement("label",{htmlFor:t},e??r.charAt(0).toUpperCase()+r.slice(1))}function w({input:t,register:e,isEditForm:r,error:n}){const i=t.name||"";return o.createElement("div",{className:"form-field"},o.createElement(E,{htmlFor:i,label:t.label,fieldName:i}),(()=>{switch(t.type){case"textarea":return o.createElement("textarea",{...e(i),placeholder:t.placeholder,id:i,disabled:r&&!1===t.editable});case"select":return o.createElement("select",{...e(i),id:i,disabled:r&&!1===t.editable},o.createElement("option",{value:""},"Select ",i),t.selectOptions?.map((t=>o.createElement("option",{key:t,value:t},t))));default:return o.createElement("input",{type:t.inputType,...e(i),placeholder:t.placeholder,id:i,disabled:r&&!1===t.editable})}})(),n&&o.createElement("span",{className:"error-message"},n.message))}function b({data:t,screen:e}){const{screens:r,fetchSettings:n}=v((t=>({screens:t.screens??{},fetchSettings:t.fetchSettings}))),a=!!t,{register:s,handleSubmit:c,reset:l,formState:{errors:p}}=d({resolver:r[e.controller].resolver,defaultValues:{...t,__formEdit:a}}),f=u(),h=r[e.controller].inputs;return i((()=>{l({...t,__formEdit:a})}),[a,t,l]),o.createElement("div",{className:"form-wrapper"},o.createElement("form",{onSubmit:c((t=>{n&&(delete t.__formEdit,a?O(n,e.controller,t).then((()=>{f("/"+e.controller,{replace:!0})})):_(n,e.controller,t).then((()=>{f("/"+e.controller,{replace:!0})})))}))},h.map((t=>o.createElement(w,{key:t.name||"",input:t,register:s,isEditForm:a,error:p[t.name||""]}))),o.createElement("button",{type:"submit",className:"submit-button"},"Submit")))}function T({screen:t}){return o.createElement(b,{screen:t})}function M({error:t}){return o.createElement("div",{className:"error-container"},o.createElement("div",{className:"error-icon"},o.createElement("i",{className:"fa fa-exclamation-circle"})),o.createElement("div",{className:"error-content"},o.createElement("h3",null,"Error Occurred"),o.createElement("p",null,t?.message||"Something went wrong. Please try again later.")))}function A({screen:t}){const{fetchSettings:e}=v((t=>({fetchSettings:t.fetchSettings}))),{id:r}=l(),[n,s]=a(null),[c,u]=a(null);return i((()=>{e&&t.controller&&r&&S(e,t.controller,r).then((t=>{s(t)})).catch((t=>{u(t),console.error(t)}))}),[e,r,t]),c?o.createElement(M,{error:c}):o.createElement("p",{dangerouslySetInnerHTML:{__html:JSON.stringify(n,null," <br/>")}})}function x({screen:t}){const{fetchSettings:e}=v((t=>({fetchSettings:t.fetchSettings}))),{id:r}=l(),[n,s]=a(null),[c,u]=a(null);return i((()=>{e&&t.controller&&r&&S(e,t.controller,r).then((t=>{s(t)})).catch((t=>{u(t),console.error(t)}))}),[e,r,t]),c?o.createElement(M,{error:c}):o.createElement(b,{data:n,screen:t})}function N({data:t,cells:e}){return t&&0!==t.length?o.createElement("div",{className:"list-wrapper"},o.createElement("div",{className:"header"},"List"),o.createElement("table",{className:"list-table"},o.createElement("thead",null,o.createElement("tr",null,e.map((t=>o.createElement("th",{key:t.name},t.title??t.name))),o.createElement("th",null))),o.createElement("tbody",null,t.map(((t,r)=>o.createElement("tr",{key:r},e.map((e=>{const r=t[e.name];let n=r??"-";if("date"===e.type){if(r){const t=new Date(r);n=`${t.getDate().toString().padStart(2,"0")}/${(t.getMonth()+1).toString().padStart(2,"0")}/${t.getFullYear()} ${t.getHours().toString().padStart(2,"0")}:${t.getMinutes().toString().padStart(2,"0")}`}}else n=r?r.toString():e?.placeHolder??"-";let i=n;return o.createElement("td",{key:e.name},i)})),o.createElement("td",null,o.createElement(p,{to:"edit/"+(t?.id??"-")},"Edit"),o.createElement(p,{to:"details/"+(t?.id??"-")},"Details")))))))):o.createElement("div",null,"No items available")}function C({screen:t}){const{screens:e,fetchSettings:r}=v((t=>({screens:t.screens??{},fetchSettings:t.fetchSettings}))),[n,s]=a(0),[c,u]=a(null),[l,f]=a(null);return i((()=>{t.controller&&r&&g(r,t.controller).then((t=>{u(t)})).catch((t=>{f(t),console.error(t)}))}),[n,t.controller,r]),l?o.createElement(M,{error:l}):o.createElement("div",null,o.createElement(p,{to:"create"},"Create"),o.createElement(N,{screen:t,cells:e[t.key].cells,data:c}))}function P(){const t=v((t=>t.screens??{}));return s((()=>o.createElement(o.Fragment,null,Object.entries(t).map((([t,e])=>{const r=e.crud?.controller??t;let n=`${e.path}`;const i={key:t,controller:r};return console.log("path",e,n),o.createElement(o.Fragment,{key:"index"},o.createElement(f,{path:n+"/create",element:o.createElement(T,{screen:i})}),o.createElement(f,{path:n+"/details/:id",element:o.createElement(A,{screen:i})}),o.createElement(f,{path:n+"/edit/:id",element:o.createElement(x,{screen:i})}),o.createElement(f,{path:n,element:o.createElement(C,{screen:i})}))})),o.createElement(f,{path:"*",element:o.createElement("div",null,"404 - Not Found")}))),[t])}var L,k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},I={};!function(){return L||(L=1,function(t){!function(){var e="object"==typeof globalThis?globalThis:"object"==typeof k?k:"object"==typeof self?self:"object"==typeof this?this:function(){try{return Function("return this;")()}catch(t){}}()||function(){try{return(0,eval)("(function() { return this; })()")}catch(t){}}(),r=n(t);function n(t,e){return function(r,n){Object.defineProperty(t,r,{configurable:!0,writable:!0,value:n}),e&&e(r,n)}}void 0!==e.Reflect&&(r=n(e.Reflect,r)),function(t,e){var r=Object.prototype.hasOwnProperty,n="function"==typeof Symbol,o=n&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",i=n&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,c=!a&&!s,u={create:a?function(){return pt(Object.create(null))}:s?function(){return pt({__proto__:null})}:function(){return pt({})},has:c?function(t,e){return r.call(t,e)}:function(t,e){return e in t},get:c?function(t,e){return r.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),p="function"==typeof Map&&"function"==typeof Map.prototype.entries?Map:ct(),f="function"==typeof Set&&"function"==typeof Set.prototype.entries?Set:ut(),d="function"==typeof WeakMap?WeakMap:lt(),h=n?Symbol.for("@reflect-metadata:registry"):void 0,y=ot(),v=it(y);function m(t,e,r,n){if(D(r)){if(!H(t))throw new TypeError;if(!J(e))throw new TypeError;return A(t,e)}if(!H(t))throw new TypeError;if(!$(e))throw new TypeError;if(!$(n)&&!D(n)&&!F(n))throw new TypeError;return F(n)&&(n=void 0),x(t,e,r=G(r),n)}function g(t,e){function r(r,n){if(!$(r))throw new TypeError;if(!D(n)&&!Y(n))throw new TypeError;k(t,e,r,n)}return r}function _(t,e,r,n){if(!$(r))throw new TypeError;return D(n)||(n=G(n)),k(t,e,r,n)}function S(t,e,r){if(!$(e))throw new TypeError;return D(r)||(r=G(r)),N(t,e,r)}function O(t,e,r){if(!$(e))throw new TypeError;return D(r)||(r=G(r)),C(t,e,r)}function E(t,e,r){if(!$(e))throw new TypeError;return D(r)||(r=G(r)),P(t,e,r)}function w(t,e,r){if(!$(e))throw new TypeError;return D(r)||(r=G(r)),L(t,e,r)}function b(t,e){if(!$(t))throw new TypeError;return D(e)||(e=G(e)),I(t,e)}function T(t,e){if(!$(t))throw new TypeError;return D(e)||(e=G(e)),j(t,e)}function M(t,e,r){if(!$(e))throw new TypeError;if(D(r)||(r=G(r)),!$(e))throw new TypeError;D(r)||(r=G(r));var n=st(e,r,!1);return!D(n)&&n.OrdinaryDeleteMetadata(t,e,r)}function A(t,e){for(var r=t.length-1;r>=0;--r){var n=(0,t[r])(e);if(!D(n)&&!F(n)){if(!J(n))throw new TypeError;e=n}}return e}function x(t,e,r,n){for(var o=t.length-1;o>=0;--o){var i=(0,t[o])(e,r,n);if(!D(i)&&!F(i)){if(!$(i))throw new TypeError;n=i}}return n}function N(t,e,r){if(C(t,e,r))return!0;var n=rt(e);return!F(n)&&N(t,n,r)}function C(t,e,r){var n=st(e,r,!1);return!D(n)&&K(n.OrdinaryHasOwnMetadata(t,e,r))}function P(t,e,r){if(C(t,e,r))return L(t,e,r);var n=rt(e);return F(n)?void 0:P(t,n,r)}function L(t,e,r){var n=st(e,r,!1);if(!D(n))return n.OrdinaryGetOwnMetadata(t,e,r)}function k(t,e,r,n){st(r,n,!0).OrdinaryDefineOwnMetadata(t,e,r,n)}function I(t,e){var r=j(t,e),n=rt(t);if(null===n)return r;var o=I(n,e);if(o.length<=0)return r;if(r.length<=0)return o;for(var i=new f,a=[],s=0,c=r;s<c.length;s++){var u=c[s];i.has(u)||(i.add(u),a.push(u))}for(var l=0,p=o;l<p.length;l++){u=p[l];i.has(u)||(i.add(u),a.push(u))}return a}function j(t,e){var r=st(t,e,!1);return r?r.OrdinaryOwnMetadataKeys(t,e):[]}function V(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}function D(t){return void 0===t}function F(t){return null===t}function R(t){return"symbol"==typeof t}function $(t){return"object"==typeof t?null!==t:"function"==typeof t}function U(t,e){switch(V(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}var r="string",n=Q(t,o);if(void 0!==n){var i=n.call(t,r);if($(i))throw new TypeError;return i}return z(t)}function z(t,e){var r,n,o=t.toString;if(W(o)&&!$(n=o.call(t)))return n;if(W(r=t.valueOf)&&!$(n=r.call(t)))return n;throw new TypeError}function K(t){return!!t}function B(t){return""+t}function G(t){var e=U(t);return R(e)?e:B(e)}function H(t){return Array.isArray?Array.isArray(t):t instanceof Object?t instanceof Array:"[object Array]"===Object.prototype.toString.call(t)}function W(t){return"function"==typeof t}function J(t){return"function"==typeof t}function Y(t){switch(V(t)){case 3:case 4:return!0;default:return!1}}function q(t,e){return t===e||t!=t&&e!=e}function Q(t,e){var r=t[e];if(null!=r){if(!W(r))throw new TypeError;return r}}function X(t){var e=Q(t,i);if(!W(e))throw new TypeError;var r=e.call(t);if(!$(r))throw new TypeError;return r}function Z(t){return t.value}function tt(t){var e=t.next();return!e.done&&e}function et(t){var e=t.return;e&&e.call(t)}function rt(t){var e=Object.getPrototypeOf(t);if("function"!=typeof t||t===l)return e;if(e!==l)return e;var r=t.prototype,n=r&&Object.getPrototypeOf(r);if(null==n||n===Object.prototype)return e;var o=n.constructor;return"function"!=typeof o||o===t?e:o}function nt(){var t,r,n,o;D(h)||void 0===e.Reflect||h in e.Reflect||"function"!=typeof e.Reflect.defineMetadata||(t=at(e.Reflect));var i=new d,a={registerProvider:s,getProvider:u,setProvider:y};return a;function s(e){if(!Object.isExtensible(a))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case t===e:break;case D(r):r=e;break;case r===e:break;case D(n):n=e;break;case n===e:break;default:void 0===o&&(o=new f),o.add(e)}}function c(e,i){if(!D(r)){if(r.isProviderFor(e,i))return r;if(!D(n)){if(n.isProviderFor(e,i))return r;if(!D(o))for(var a=X(o);;){var s=tt(a);if(!s)return;var c=Z(s);if(c.isProviderFor(e,i))return et(a),c}}}if(!D(t)&&t.isProviderFor(e,i))return t}function u(t,e){var r,n=i.get(t);return D(n)||(r=n.get(e)),D(r)?(D(r=c(t,e))||(D(n)&&(n=new p,i.set(t,n)),n.set(e,r)),r):r}function l(t){if(D(t))throw new TypeError;return r===t||n===t||!D(o)&&o.has(t)}function y(t,e,r){if(!l(r))throw new Error("Metadata provider not registered.");var n=u(t,e);if(n!==r){if(!D(n))return!1;var o=i.get(t);D(o)&&(o=new p,i.set(t,o)),o.set(e,r)}return!0}}function ot(){var t;return!D(h)&&$(e.Reflect)&&Object.isExtensible(e.Reflect)&&(t=e.Reflect[h]),D(t)&&(t=nt()),!D(h)&&$(e.Reflect)&&Object.isExtensible(e.Reflect)&&Object.defineProperty(e.Reflect,h,{enumerable:!1,configurable:!1,writable:!1,value:t}),t}function it(t){var e=new d,r={isProviderFor:function(t,r){var n=e.get(t);return!D(n)&&n.has(r)},OrdinaryDefineOwnMetadata:a,OrdinaryHasOwnMetadata:o,OrdinaryGetOwnMetadata:i,OrdinaryOwnMetadataKeys:s,OrdinaryDeleteMetadata:c};return y.registerProvider(r),r;function n(n,o,i){var a=e.get(n),s=!1;if(D(a)){if(!i)return;a=new p,e.set(n,a),s=!0}var c=a.get(o);if(D(c)){if(!i)return;if(c=new p,a.set(o,c),!t.setProvider(n,o,r))throw a.delete(o),s&&e.delete(n),new Error("Wrong provider for target.")}return c}function o(t,e,r){var o=n(e,r,!1);return!D(o)&&K(o.has(t))}function i(t,e,r){var o=n(e,r,!1);if(!D(o))return o.get(t)}function a(t,e,r,o){n(r,o,!0).set(t,e)}function s(t,e){var r=[],o=n(t,e,!1);if(D(o))return r;for(var i=X(o.keys()),a=0;;){var s=tt(i);if(!s)return r.length=a,r;var c=Z(s);try{r[a]=c}catch(t){try{et(i)}finally{throw t}}a++}}function c(t,r,o){var i=n(r,o,!1);if(D(i))return!1;if(!i.delete(t))return!1;if(0===i.size){var a=e.get(r);D(a)||(a.delete(o),0===a.size&&e.delete(a))}return!0}}function at(t){var e=t.defineMetadata,r=t.hasOwnMetadata,n=t.getOwnMetadata,o=t.getOwnMetadataKeys,i=t.deleteMetadata,a=new d;return{isProviderFor:function(t,e){var r=a.get(t);return!(D(r)||!r.has(e))||!!o(t,e).length&&(D(r)&&(r=new f,a.set(t,r)),r.add(e),!0)},OrdinaryDefineOwnMetadata:e,OrdinaryHasOwnMetadata:r,OrdinaryGetOwnMetadata:n,OrdinaryOwnMetadataKeys:o,OrdinaryDeleteMetadata:i}}function st(t,e,r){var n=y.getProvider(t,e);if(!D(n))return n;if(r){if(y.setProvider(t,e,v))return v;throw new Error("Illegal state.")}}function ct(){var t={},e=[],r=function(){function t(t,e,r){this._index=0,this._keys=t,this._values=e,this._selector=r}return t.prototype["@@iterator"]=function(){return this},t.prototype[i]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t<this._keys.length){var r=this._selector(this._keys[t],this._values[t]);return t+1>=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:r,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}(),n=function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var r=this._find(t,!0);return this._values[r]=e,this},e.prototype.delete=function(e){var r=this._find(e,!1);if(r>=0){for(var n=this._keys.length,o=r+1;o<n;o++)this._keys[o-1]=this._keys[o],this._values[o-1]=this._values[o];return this._keys.length--,this._values.length--,q(e,this._cacheKey)&&(this._cacheKey=t,this._cacheIndex=-2),!0}return!1},e.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=t,this._cacheIndex=-2},e.prototype.keys=function(){return new r(this._keys,this._values,o)},e.prototype.values=function(){return new r(this._keys,this._values,a)},e.prototype.entries=function(){return new r(this._keys,this._values,s)},e.prototype["@@iterator"]=function(){return this.entries()},e.prototype[i]=function(){return this.entries()},e.prototype._find=function(t,e){if(!q(this._cacheKey,t)){this._cacheIndex=-1;for(var r=0;r<this._keys.length;r++)if(q(this._keys[r],t)){this._cacheIndex=r;break}}return this._cacheIndex<0&&e&&(this._cacheIndex=this._keys.length,this._keys.push(t),this._values.push(void 0)),this._cacheIndex},e}();return n;function o(t,e){return t}function a(t,e){return e}function s(t,e){return[t,e]}}function ut(){return function(){function t(){this._map=new p}return Object.defineProperty(t.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),t.prototype.has=function(t){return this._map.has(t)},t.prototype.add=function(t){return this._map.set(t,t),this},t.prototype.delete=function(t){return this._map.delete(t)},t.prototype.clear=function(){this._map.clear()},t.prototype.keys=function(){return this._map.keys()},t.prototype.values=function(){return this._map.keys()},t.prototype.entries=function(){return this._map.entries()},t.prototype["@@iterator"]=function(){return this.keys()},t.prototype[i]=function(){return this.keys()},t}()}function lt(){var t=16,e=u.create(),n=o();return function(){function t(){this._key=o()}return t.prototype.has=function(t){var e=i(t,!1);return void 0!==e&&u.has(e,this._key)},t.prototype.get=function(t){var e=i(t,!1);return void 0!==e?u.get(e,this._key):void 0},t.prototype.set=function(t,e){return i(t,!0)[this._key]=e,this},t.prototype.delete=function(t){var e=i(t,!1);return void 0!==e&&delete e[this._key]},t.prototype.clear=function(){this._key=o()},t}();function o(){var t;do{t="@@WeakMap@@"+c()}while(u.has(e,t));return e[t]=!0,t}function i(t,e){if(!r.call(t,n)){if(!e)return;Object.defineProperty(t,n,{value:u.create()})}return t[n]}function a(t,e){for(var r=0;r<e;++r)t[r]=255*Math.random()|0;return t}function s(t){if("function"==typeof Uint8Array){var e=new Uint8Array(t);return"undefined"!=typeof crypto?crypto.getRandomValues(e):"undefined"!=typeof msCrypto?msCrypto.getRandomValues(e):a(e,t),e}return a(new Array(t),t)}function c(){var e=s(t);e[6]=79&e[6]|64,e[8]=191&e[8]|128;for(var r="",n=0;n<t;++n){var o=e[n];4!==n&&6!==n&&8!==n||(r+="-"),o<16&&(r+="0"),r+=o.toString(16).toLowerCase()}return r}}function pt(t){return t.__=void 0,delete t.__,t}t("decorate",m),t("metadata",g),t("defineMetadata",_),t("hasMetadata",S),t("hasOwnMetadata",O),t("getMetadata",E),t("getOwnMetadata",w),t("getMetadataKeys",b),t("getOwnMetadataKeys",T),t("deleteMetadata",M)}(r,e),void 0===e.Reflect&&(e.Reflect=t)}()}(t||(t={}))),I;var t}();const j="Crud";function V(t){return e=>{t&&Reflect.defineMetadata(j,t,e)}}const D=Symbol("cell");function F(t){return(e,r)=>{const n=Reflect.getMetadata(D,e)||[];if(Reflect.defineMetadata(D,[...n,r.toString()],e),t){const n=`${D.toString()}:${r.toString()}:options`;Reflect.defineMetadata(n,t,e)}}}function R(t){const e=t.prototype;return(Reflect.getMetadata(D,e)||[]).map((t=>{const r=Reflect.getMetadata(`${D.toString()}:${t}:options`,e)||{};return{...r,name:r?.name??t}}))}const $=Symbol("input");function U(t){return(e,r)=>{const n=Reflect.getMetadata($,e)||[];if(Reflect.defineMetadata($,[...n,r.toString()],e),t){const n=`${$.toString()}:${r.toString()}:options`;Reflect.defineMetadata(n,t,e)}}}function z(t){const e=t.prototype;return(Reflect.getMetadata($,e)||[]).map((t=>{const r=Reflect.getMetadata(`${$.toString()}:${t}:options`,e)||{},n=r?.inputType??(o=t,["password"].some((t=>o.toLowerCase().includes(t)))?"password":"text");var o;return{...r,editable:r.editable??!0,sensitive:r.sensitive,name:r?.name??t,label:r?.label??t,placeholder:r?.placeholder??t,inputType:n,selectOptions:r?.selectOptions??[],cancelPasswordValidationOnEdit:r?.cancelPasswordValidationOnEdit??"password"===n}}))}function K({menu:t,getIcons:e}){const r=v((t=>t.screens??{})),[n,i]=a(!0);return o.createElement("div",{className:"sidebar "+(n?"open":"closed")},o.createElement("button",{className:"toggle-button",onClick:()=>i(!n)},n?"<":">"),o.createElement("nav",{className:"nav-links"},t?.(r).map(((t,r)=>o.createElement(p,{key:r,to:t.path,className:"nav-link"},o.createElement("span",{className:"nav-links-icon"},e?.(t.iconType)),n?o.createElement("span",null,t.name):null)))))}function B({children:t,menu:e,getIcons:r}){return o.createElement("div",{className:"layout"},o.createElement(K,{menu:e,getIcons:r}),o.createElement("main",{className:"content"},t))}class G extends c{state={hasError:!1,error:null,errorInfo:null};static getDerivedStateFromError(t){return{hasError:!0,error:t,errorInfo:null}}componentDidCatch(t,e){this.setState({error:t,errorInfo:e})}render(){return this.state.hasError?o.createElement("div",{className:"error-boundary"},o.createElement("div",{className:"error-boundary__content"},o.createElement("div",{className:"error-boundary__icon"},o.createElement("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor"},o.createElement("circle",{cx:"12",cy:"12",r:"10"}),o.createElement("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),o.createElement("line",{x1:"12",y1:"16",x2:"12",y2:"16"}))),o.createElement("h1",null,"Oops! Something went wrong"),o.createElement("p",{className:"error-boundary__message"},this.state.error?.message||"An unexpected error occurred"),o.createElement("button",{className:"error-boundary__button",onClick:()=>window.location.reload()},"Refresh Page"),"development"===process.env.NODE_ENV&&o.createElement("details",{className:"error-boundary__details"},o.createElement("summary",null,"Error Details"),o.createElement("pre",null,this.state.error?.toString()),o.createElement("pre",null,this.state.errorInfo?.componentStack)))):this.props.children}}var H=function(t){this.groups=[],this.each=!1,this.context=void 0,this.type=t.type,this.name=t.name,this.target=t.target,this.propertyName=t.propertyName,this.constraints=null==t?void 0:t.constraints,this.constraintCls=t.constraintCls,this.validationTypeOptions=t.validationTypeOptions,t.validationOptions&&(this.message=t.validationOptions.message,this.groups=t.validationOptions.groups,this.always=t.validationOptions.always,this.each=t.validationOptions.each,this.context=t.validationOptions.context)},W=function(){function t(){}return t.prototype.transform=function(t){var e=[];return Object.keys(t.properties).forEach((function(r){t.properties[r].forEach((function(n){var o={message:n.message,groups:n.groups,always:n.always,each:n.each},i={type:n.type,name:n.name,target:t.name,propertyName:r,constraints:n.constraints,validationTypeOptions:n.options,validationOptions:o};e.push(new H(i))}))})),e},t}();function J(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0}function Y(t){return null!==t&&"object"==typeof t&&"function"==typeof t.then}var q=function(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],n=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&n>=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")},Q=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},X=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))},Z=function(){function t(){this.validationMetadatas=new Map,this.constraintMetadatas=new Map}return Object.defineProperty(t.prototype,"hasValidationMetaData",{get:function(){return!!this.validationMetadatas.size},enumerable:!1,configurable:!0}),t.prototype.addValidationSchema=function(t){var e=this;(new W).transform(t).forEach((function(t){return e.addValidationMetadata(t)}))},t.prototype.addValidationMetadata=function(t){var e=this.validationMetadatas.get(t.target);e?e.push(t):this.validationMetadatas.set(t.target,[t])},t.prototype.addConstraintMetadata=function(t){var e=this.constraintMetadatas.get(t.target);e?e.push(t):this.constraintMetadatas.set(t.target,[t])},t.prototype.groupByPropertyName=function(t){var e={};return t.forEach((function(t){e[t.propertyName]||(e[t.propertyName]=[]),e[t.propertyName].push(t)})),e},t.prototype.getTargetValidationMetadatas=function(t,e,r,n,o){var i,a,s=function(t){return void 0!==t.always?t.always:(!t.groups||!t.groups.length)&&r},c=function(t){return!(!n||o&&o.length||!t.groups||!t.groups.length)},u=(this.validationMetadatas.get(t)||[]).filter((function(r){return(r.target===t||r.target===e)&&(!!s(r)||!c(r)&&(!(o&&o.length>0)||r.groups&&!!r.groups.find((function(t){return-1!==o.indexOf(t)}))))})),l=[];try{for(var p=q(this.validationMetadatas.entries()),f=p.next();!f.done;f=p.next()){var d=Q(f.value,2),h=d[0],y=d[1];t.prototype instanceof h&&l.push.apply(l,X([],Q(y),!1))}}catch(t){i={error:t}}finally{try{f&&!f.done&&(a=p.return)&&a.call(p)}finally{if(i)throw i.error}}var v=l.filter((function(e){return"string"!=typeof e.target&&(e.target!==t&&((!(e.target instanceof Function)||t.prototype instanceof e.target)&&(!!s(e)||!c(e)&&(!(o&&o.length>0)||e.groups&&!!e.groups.find((function(t){return-1!==o.indexOf(t)}))))))})).filter((function(t){return!u.find((function(e){return e.propertyName===t.propertyName&&e.type===t.type}))}));return u.concat(v)},t.prototype.getTargetValidatorConstraints=function(t){return this.constraintMetadatas.get(t)||[]},t}();function tt(){var t=J();return t.classValidatorMetadataStorage||(t.classValidatorMetadataStorage=new Z),t.classValidatorMetadataStorage}var et=function(){function t(){}return t.prototype.toString=function(t,e,r,n){var o=this;void 0===t&&(t=!1),void 0===e&&(e=!1),void 0===r&&(r=""),void 0===n&&(n=!1);var i=t?"":"",a=t?"":"",s=function(t){return" - property ".concat(i).concat(r).concat(t).concat(a," has failed the following constraints: ").concat(i).concat((n?Object.values:Object.keys)(null!==(e=o.constraints)&&void 0!==e?e:{}).join(", ")).concat(a," \n");var e};if(e){var c=Number.isInteger(+this.property)?"[".concat(this.property,"]"):"".concat(r?".":"").concat(this.property);return this.constraints?s(c):this.children?this.children.map((function(e){return e.toString(t,!0,"".concat(r).concat(c),n)})).join(""):""}return"An instance of ".concat(i).concat(this.target?this.target.constructor.name:"an object").concat(a," has failed the validation:\n")+(this.constraints?s(this.property):"")+(this.children?this.children.map((function(e){return e.toString(t,!0,o.property,n)})).join(""):"")},t}(),rt=function(){function t(){}return t.isValid=function(t){var e=this;return"isValid"!==t&&"getMessage"!==t&&-1!==Object.keys(this).map((function(t){return e[t]})).indexOf(t)},t.CUSTOM_VALIDATION="customValidation",t.NESTED_VALIDATION="nestedValidation",t.PROMISE_VALIDATION="promiseValidation",t.CONDITIONAL_VALIDATION="conditionalValidation",t.WHITELIST="whitelistValidation",t.IS_DEFINED="isDefined",t}();var nt=function(){function t(){}return t.replaceMessageSpecialTokens=function(t,e){var r;return t instanceof Function?r=t(e):"string"==typeof t&&(r=t),r&&Array.isArray(e.constraints)&&e.constraints.forEach((function(t,e){r=r.replace(new RegExp("\\$constraint".concat(e+1),"g"),function(t){return Array.isArray(t)?t.join(", "):("symbol"==typeof t&&(t=t.description),"".concat(t))}(t))})),r&&void 0!==e.value&&null!==e.value&&["string","boolean","number"].includes(typeof e.value)&&(r=r.replace(/\$value/g,e.value)),r&&(r=r.replace(/\$property/g,e.property)),r&&(r=r.replace(/\$target/g,e.targetName)),r},t}(),ot=function(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var n,o,i=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(n=i.next()).done;)a.push(n.value)}catch(t){o={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(o)throw o.error}}return a},it=function(){function t(t,e){this.validator=t,this.validatorOptions=e,this.awaitingPromises=[],this.ignoreAsyncValidations=!1,this.metadataStorage=tt()}return t.prototype.execute=function(t,e,r){var n,o,i=this;this.metadataStorage.hasValidationMetaData||!0!==(null===(n=this.validatorOptions)||void 0===n?void 0:n.enableDebugMessages)||console.warn("No validation metadata found. No validation will be performed. There are multiple possible reasons:\n - There may be multiple class-validator versions installed. You will need to flatten your dependencies to fix the issue.\n - This validation runs before any file with validation decorator was parsed by NodeJS.");var a=this.validatorOptions?this.validatorOptions.groups:void 0,s=this.validatorOptions&&this.validatorOptions.strictGroups||!1,c=this.validatorOptions&&this.validatorOptions.always||!1,u=void 0===(null===(o=this.validatorOptions)||void 0===o?void 0:o.forbidUnknownValues)||!1!==this.validatorOptions.forbidUnknownValues,l=this.metadataStorage.getTargetValidationMetadatas(t.constructor,e,c,s,a),p=this.metadataStorage.groupByPropertyName(l);if(this.validatorOptions&&u&&!l.length){var f=new et;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(f.target=t),f.value=void 0,f.property=void 0,f.children=[],f.constraints={unknownValue:"an unknown value was passed to the validate function"},void r.push(f)}this.validatorOptions&&this.validatorOptions.whitelist&&this.whitelist(t,p,r),Object.keys(p).forEach((function(e){var n=t[e],o=p[e].filter((function(t){return t.type===rt.IS_DEFINED})),a=p[e].filter((function(t){return t.type!==rt.IS_DEFINED&&t.type!==rt.WHITELIST}));n instanceof Promise&&a.find((function(t){return t.type===rt.PROMISE_VALIDATION}))?i.awaitingPromises.push(n.then((function(n){i.performValidations(t,n,e,o,a,r)}))):i.performValidations(t,n,e,o,a,r)}))},t.prototype.whitelist=function(t,e,r){var n=this,o=[];Object.keys(t).forEach((function(t){e[t]&&0!==e[t].length||o.push(t)})),o.length>0&&(this.validatorOptions&&this.validatorOptions.forbidNonWhitelisted?o.forEach((function(e){var o,i=n.generateValidationError(t,t[e],e);i.constraints=((o={})[rt.WHITELIST]="property ".concat(e," should not exist"),o),i.children=void 0,r.push(i)})):o.forEach((function(e){return delete t[e]})))},t.prototype.stripEmptyErrors=function(t){var e=this;return t.filter((function(t){if(t.children&&(t.children=e.stripEmptyErrors(t.children)),0===Object.keys(t.constraints).length){if(0===t.children.length)return!1;delete t.constraints}return!0}))},t.prototype.performValidations=function(t,e,r,n,o,i){var a=o.filter((function(t){return t.type===rt.CUSTOM_VALIDATION})),s=o.filter((function(t){return t.type===rt.NESTED_VALIDATION})),c=o.filter((function(t){return t.type===rt.CONDITIONAL_VALIDATION})),u=this.generateValidationError(t,e,r);i.push(u),this.conditionalValidations(t,e,c)&&(this.customValidations(t,e,n,u),this.mapContexts(t,e,n,u),void 0===e&&this.validatorOptions&&!0===this.validatorOptions.skipUndefinedProperties||null===e&&this.validatorOptions&&!0===this.validatorOptions.skipNullProperties||null==e&&this.validatorOptions&&!0===this.validatorOptions.skipMissingProperties||(this.customValidations(t,e,a,u),this.nestedValidations(e,s,u),this.mapContexts(t,e,o,u),this.mapContexts(t,e,a,u)))},t.prototype.generateValidationError=function(t,e,r){var n=new et;return this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.target&&!0!==this.validatorOptions.validationError.target||(n.target=t),this.validatorOptions&&this.validatorOptions.validationError&&void 0!==this.validatorOptions.validationError.value&&!0!==this.validatorOptions.validationError.value||(n.value=e),n.property=r,n.children=[],n.constraints={},n},t.prototype.conditionalValidations=function(t,e,r){return r.map((function(r){return r.constraints[0](t,e)})).reduce((function(t,e){return t&&e}),!0)},t.prototype.customValidations=function(t,e,r,n){var o=this;r.forEach((function(r){o.metadataStorage.getTargetValidatorConstraints(r.constraintCls).forEach((function(i){if(!(i.async&&o.ignoreAsyncValidations||o.validatorOptions&&o.validatorOptions.stopAtFirstError&&Object.keys(n.constraints||{}).length>0)){var a={targetName:t.constructor?t.constructor.name:void 0,property:r.propertyName,object:t,value:e,constraints:r.constraints};if(r.each&&(Array.isArray(e)||e instanceof Set||e instanceof Map)){var s,c=((s=e)instanceof Map?Array.from(s.values()):Array.isArray(s)?s:Array.from(s)).map((function(t){return i.instance.validate(t,a)}));if(c.some((function(t){return Y(t)}))){var u=c.map((function(t){return Y(t)?t:Promise.resolve(t)})),l=Promise.all(u).then((function(a){if(!a.every((function(t){return t}))){var s=ot(o.createValidationError(t,e,r,i),2),c=s[0],u=s[1];n.constraints[c]=u,r.context&&(n.contexts||(n.contexts={}),n.contexts[c]=Object.assign(n.contexts[c]||{},r.context))}}));o.awaitingPromises.push(l)}else{if(!c.every((function(t){return t}))){var p=ot(o.createValidationError(t,e,r,i),2);y=p[0],v=p[1];n.constraints[y]=v}}}else{var f=i.instance.validate(e,a);if(Y(f)){var d=f.then((function(a){if(!a){var s=ot(o.createValidationError(t,e,r,i),2),c=s[0],u=s[1];n.constraints[c]=u,r.context&&(n.contexts||(n.contexts={}),n.contexts[c]=Object.assign(n.contexts[c]||{},r.context))}}));o.awaitingPromises.push(d)}else if(!f){var h=ot(o.createValidationError(t,e,r,i),2),y=h[0],v=h[1];n.constraints[y]=v}}}}))}))},t.prototype.nestedValidations=function(t,e,r){var n=this;void 0!==t&&e.forEach((function(o){if((o.type===rt.NESTED_VALIDATION||o.type===rt.PROMISE_VALIDATION)&&!(n.validatorOptions&&n.validatorOptions.stopAtFirstError&&Object.keys(r.constraints||{}).length>0))if(Array.isArray(t)||t instanceof Set||t instanceof Map)(t instanceof Set?Array.from(t):t).forEach((function(o,i){n.performValidations(t,o,i.toString(),[],e,r.children)}));else if(t instanceof Object){var i="string"==typeof o.target?o.target:o.target.name;n.execute(t,i,r.children)}else{var a=ot(n.createValidationError(o.target,t,o),2),s=a[0],c=a[1];r.constraints[s]=c}}))},t.prototype.mapContexts=function(t,e,r,n){var o=this;return r.forEach((function(t){if(t.context){var e=void 0;if(t.type===rt.CUSTOM_VALIDATION)e=o.metadataStorage.getTargetValidatorConstraints(t.constraintCls)[0];var r=o.getConstraintType(t,e);n.constraints[r]&&(n.contexts||(n.contexts={}),n.contexts[r]=Object.assign(n.contexts[r]||{},t.context))}}))},t.prototype.createValidationError=function(t,e,r,n){var o=t.constructor?t.constructor.name:void 0,i=this.getConstraintType(r,n),a={targetName:o,property:r.propertyName,object:t,value:e,constraints:r.constraints},s=r.message||"";return r.message||this.validatorOptions&&(!this.validatorOptions||this.validatorOptions.dismissDefaultMessages)||n&&n.instance.defaultMessage instanceof Function&&(s=n.instance.defaultMessage(a)),[i,nt.replaceMessageSpecialTokens(s,a)]},t.prototype.getConstraintType=function(t,e){return e&&e.name?e.name:t.type},t}(),at=function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function a(t){try{c(n.next(t))}catch(t){i(t)}}function s(t){try{c(n.throw(t))}catch(t){i(t)}}function c(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}c((n=n.apply(t,e||[])).next())}))},st=function(t,e){var r,n,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(s){return function(c){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(o=2&s[0]?n.return:s[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,s[1])).done)return o;switch(n=0,o&&(s=[2&s[0],o.value]),s[0]){case 0:case 1:o=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!o||s[1]>o[0]&&s[1]<o[3])){a.label=s[1];break}if(6===s[0]&&a.label<o[1]){a.label=o[1],o=s;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(s);break}o[2]&&a.ops.pop(),a.trys.pop();continue}s=e.call(t,a)}catch(t){s=[6,t],n=0}finally{r=o=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}},ct=function(){function t(){}return t.prototype.validate=function(t,e,r){return this.coreValidate(t,e,r)},t.prototype.validateOrReject=function(t,e,r){return at(this,void 0,void 0,(function(){var n;return st(this,(function(o){switch(o.label){case 0:return[4,this.coreValidate(t,e,r)];case 1:return(n=o.sent()).length?[2,Promise.reject(n)]:[2]}}))}))},t.prototype.validateSync=function(t,e,r){var n="string"==typeof t?e:t,o="string"==typeof t?t:void 0,i=new it(this,"string"==typeof t?r:e);i.ignoreAsyncValidations=!0;var a=[];return i.execute(n,o,a),i.stripEmptyErrors(a)},t.prototype.coreValidate=function(t,e,r){var n="string"==typeof t?e:t,o="string"==typeof t?t:void 0,i=new it(this,"string"==typeof t?r:e),a=[];return i.execute(n,o,a),Promise.all(i.awaitingPromises).then((function(){return i.stripEmptyErrors(a)}))},t}(),ut=new(function(){function t(){this.instances=[]}return t.prototype.get=function(t){var e=this.instances.find((function(e){return e.type===t}));return e||(e={type:t,object:new t},this.instances.push(e)),e.object},t}());function lt(t){return ut.get(t)}function pt(t,e,r){return"string"==typeof t?lt(ct).validate(t,e,r):lt(ct).validate(t,e)}function ft(t,e,r){return"string"==typeof t?lt(ct).validateSync(t,e,r):lt(ct).validateSync(t,e)}const dt=(t,e,r)=>{if(t&&"reportValidity"in t){const n=h(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},ht=(t,e)=>{for(const r in e.fields){const n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?dt(n.ref,r,t):n&&n.refs&&n.refs.forEach((e=>dt(e,r,t)))}},yt=(t,e)=>{e.shouldUseNativeValidation&&ht(t,e);const r={};for(const n in t){const o=h(e.fields,n),i=Object.assign(t[n]||{},{ref:o&&o.ref});if(vt(e.names||Object.keys(t),n)){const t=Object.assign({},h(r,n));y(t,"root",i),y(r,n,t)}else y(r,n,i)}return r},vt=(t,e)=>{const r=mt(e);return t.some((t=>mt(t).match(`^${r}\\.\\d+`)))};function mt(t){return t.replace(/\]|\[/g,"")}var gt;!function(t){t[t.PLAIN_TO_CLASS=0]="PLAIN_TO_CLASS",t[t.CLASS_TO_PLAIN=1]="CLASS_TO_PLAIN",t[t.CLASS_TO_CLASS=2]="CLASS_TO_CLASS"}(gt||(gt={}));var _t=new(function(){function t(){this._typeMetadatas=new Map,this._transformMetadatas=new Map,this._exposeMetadatas=new Map,this._excludeMetadatas=new Map,this._ancestorsMap=new Map}return t.prototype.addTypeMetadata=function(t){this._typeMetadatas.has(t.target)||this._typeMetadatas.set(t.target,new Map),this._typeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.addTransformMetadata=function(t){this._transformMetadatas.has(t.target)||this._transformMetadatas.set(t.target,new Map),this._transformMetadatas.get(t.target).has(t.propertyName)||this._transformMetadatas.get(t.target).set(t.propertyName,[]),this._transformMetadatas.get(t.target).get(t.propertyName).push(t)},t.prototype.addExposeMetadata=function(t){this._exposeMetadatas.has(t.target)||this._exposeMetadatas.set(t.target,new Map),this._exposeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.addExcludeMetadata=function(t){this._excludeMetadatas.has(t.target)||this._excludeMetadatas.set(t.target,new Map),this._excludeMetadatas.get(t.target).set(t.propertyName,t)},t.prototype.findTransformMetadatas=function(t,e,r){return this.findMetadatas(this._transformMetadatas,t,e).filter((function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?r===gt.CLASS_TO_CLASS||r===gt.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||r===gt.CLASS_TO_PLAIN))}))},t.prototype.findExcludeMetadata=function(t,e){return this.findMetadata(this._excludeMetadatas,t,e)},t.prototype.findExposeMetadata=function(t,e){return this.findMetadata(this._exposeMetadatas,t,e)},t.prototype.findExposeMetadataByCustomName=function(t,e){return this.getExposedMetadatas(t).find((function(t){return t.options&&t.options.name===e}))},t.prototype.findTypeMetadata=function(t,e){return this.findMetadata(this._typeMetadatas,t,e)},t.prototype.getStrategy=function(t){var e=this._excludeMetadatas.get(t),r=e&&e.get(void 0),n=this._exposeMetadatas.get(t),o=n&&n.get(void 0);return r&&o||!r&&!o?"none":r?"excludeAll":"exposeAll"},t.prototype.getExposedMetadatas=function(t){return this.getMetadata(this._exposeMetadatas,t)},t.prototype.getExcludedMetadatas=function(t){return this.getMetadata(this._excludeMetadatas,t)},t.prototype.getExposedProperties=function(t,e){return this.getExposedMetadatas(t).filter((function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===gt.CLASS_TO_CLASS||e===gt.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===gt.CLASS_TO_PLAIN))})).map((function(t){return t.propertyName}))},t.prototype.getExcludedProperties=function(t,e){return this.getExcludedMetadatas(t).filter((function(t){return!t.options||(!0===t.options.toClassOnly&&!0===t.options.toPlainOnly||(!0===t.options.toClassOnly?e===gt.CLASS_TO_CLASS||e===gt.PLAIN_TO_CLASS:!0!==t.options.toPlainOnly||e===gt.CLASS_TO_PLAIN))})).map((function(t){return t.propertyName}))},t.prototype.clear=function(){this._typeMetadatas.clear(),this._exposeMetadatas.clear(),this._excludeMetadatas.clear(),this._ancestorsMap.clear()},t.prototype.getMetadata=function(t,e){var r,n=t.get(e);n&&(r=Array.from(n.values()).filter((function(t){return void 0!==t.propertyName})));for(var o=[],i=0,a=this.getAncestors(e);i<a.length;i++){var s=a[i],c=t.get(s);if(c){var u=Array.from(c.values()).filter((function(t){return void 0!==t.propertyName}));o.push.apply(o,u)}}return o.concat(r||[])},t.prototype.findMetadata=function(t,e,r){var n=t.get(e);if(n){var o=n.get(r);if(o)return o}for(var i=0,a=this.getAncestors(e);i<a.length;i++){var s=a[i],c=t.get(s);if(c){var u=c.get(r);if(u)return u}}},t.prototype.findMetadatas=function(t,e,r){var n,o=t.get(e);o&&(n=o.get(r));for(var i=[],a=0,s=this.getAncestors(e);a<s.length;a++){var c=s[a],u=t.get(c);u&&u.has(r)&&i.push.apply(i,u.get(r))}return i.slice().reverse().concat((n||[]).slice().reverse())},t.prototype.getAncestors=function(t){if(!t)return[];if(!this._ancestorsMap.has(t)){for(var e=[],r=Object.getPrototypeOf(t.prototype.constructor);void 0!==r.prototype;r=Object.getPrototypeOf(r.prototype.constructor))e.push(r);this._ancestorsMap.set(t,e)}return this._ancestorsMap.get(t)},t}());var St=function(t,e,r){if(r||2===arguments.length)for(var n,o=0,i=e.length;o<i;o++)!n&&o in e||(n||(n=Array.prototype.slice.call(e,0,o)),n[o]=e[o]);return t.concat(n||Array.prototype.slice.call(e))};var Ot=function(){function t(t,e){this.transformationType=t,this.options=e,this.recursionStack=new Set}return t.prototype.transform=function(t,e,r,n,o,i){var a,s=this;if(void 0===i&&(i=0),Array.isArray(e)||e instanceof Set){var c=n&&this.transformationType===gt.PLAIN_TO_CLASS?function(t){var e=new t;return e instanceof Set||"push"in e?e:[]}(n):[];return e.forEach((function(e,n){var o=t?t[n]:void 0;if(s.options.enableCircularCheck&&s.isCircular(e))s.transformationType===gt.CLASS_TO_CLASS&&(c instanceof Set?c.add(e):c.push(e));else{var a=void 0;if("function"!=typeof r&&r&&r.options&&r.options.discriminator&&r.options.discriminator.property&&r.options.discriminator.subTypes){if(s.transformationType===gt.PLAIN_TO_CLASS){a=r.options.discriminator.subTypes.find((function(t){return t.name===e[r.options.discriminator.property]}));var u={newObject:c,object:e,property:void 0},l=r.typeFunction(u);a=void 0===a?l:a.value,r.options.keepDiscriminatorProperty||delete e[r.options.discriminator.property]}s.transformationType===gt.CLASS_TO_CLASS&&(a=e.constructor),s.transformationType===gt.CLASS_TO_PLAIN&&(e[r.options.discriminator.property]=r.options.discriminator.subTypes.find((function(t){return t.value===e.constructor})).name)}else a=r;var p=s.transform(o,e,a,void 0,e instanceof Map,i+1);c instanceof Set?c.add(p):c.push(p)}})),c}if(r!==String||o){if(r!==Number||o){if(r!==Boolean||o){if((r===Date||e instanceof Date)&&!o)return e instanceof Date?new Date(e.valueOf()):null==e?e:new Date(e);if(("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:void 0).Buffer&&(r===Buffer||e instanceof Buffer)&&!o)return null==e?e:Buffer.from(e);if(null===(a=e)||"object"!=typeof a||"function"!=typeof a.then||o){if(o||null===e||"object"!=typeof e||"function"!=typeof e.then){if("object"==typeof e&&null!==e){r||e.constructor===Object||(Array.isArray(e)||e.constructor!==Array)&&(r=e.constructor),!r&&t&&(r=t.constructor),this.options.enableCircularCheck&&this.recursionStack.add(e);var u=this.getKeys(r,e,o),l=t||{};t||this.transformationType!==gt.PLAIN_TO_CLASS&&this.transformationType!==gt.CLASS_TO_CLASS||(l=o?new Map:r?new r:{});for(var p=function(n){if("__proto__"===n||"constructor"===n)return"continue";var a=n,s=n,c=n;if(!f.options.ignoreDecorators&&r)if(f.transformationType===gt.PLAIN_TO_CLASS)(u=_t.findExposeMetadataByCustomName(r,n))&&(c=u.propertyName,s=u.propertyName);else if(f.transformationType===gt.CLASS_TO_PLAIN||f.transformationType===gt.CLASS_TO_CLASS){var u;(u=_t.findExposeMetadata(r,n))&&u.options&&u.options.name&&(s=u.options.name)}var p=void 0;p=f.transformationType===gt.PLAIN_TO_CLASS?e[a]:e instanceof Map?e.get(a):e[a]instanceof Function?e[a]():e[a];var d=void 0,h=p instanceof Map;if(r&&o)d=r;else if(r){var y=_t.findTypeMetadata(r,c);if(y){var v={newObject:l,object:e,property:c},m=y.typeFunction?y.typeFunction(v):y.reflectedType;y.options&&y.options.discriminator&&y.options.discriminator.property&&y.options.discriminator.subTypes?e[a]instanceof Array?d=y:(f.transformationType===gt.PLAIN_TO_CLASS&&(d=void 0===(d=y.options.discriminator.subTypes.find((function(t){if(p&&p instanceof Object&&y.options.discriminator.property in p)return t.name===p[y.options.discriminator.property]})))?m:d.value,y.options.keepDiscriminatorProperty||p&&p instanceof Object&&y.options.discriminator.property in p&&delete p[y.options.discriminator.property]),f.transformationType===gt.CLASS_TO_CLASS&&(d=p.constructor),f.transformationType===gt.CLASS_TO_PLAIN&&p&&(p[y.options.discriminator.property]=y.options.discriminator.subTypes.find((function(t){return t.value===p.constructor})).name)):d=m,h=h||y.reflectedType===Map}else if(f.options.targetMaps)f.options.targetMaps.filter((function(t){return t.target===r&&!!t.properties[c]})).forEach((function(t){return d=t.properties[c]}));else if(f.options.enableImplicitConversion&&f.transformationType===gt.PLAIN_TO_CLASS){var g=Reflect.getMetadata("design:type",r.prototype,c);g&&(d=g)}}var _=Array.isArray(e[a])?f.getReflectedType(r,c):void 0,S=t?t[a]:void 0;if(l.constructor.prototype){var O=Object.getOwnPropertyDescriptor(l.constructor.prototype,s);if((f.transformationType===gt.PLAIN_TO_CLASS||f.transformationType===gt.CLASS_TO_CLASS)&&(O&&!O.set||l[s]instanceof Function))return"continue"}if(f.options.enableCircularCheck&&f.isCircular(p)){if(f.transformationType===gt.CLASS_TO_CLASS){w=p;(void 0!==(w=f.applyCustomTransformations(w,r,n,e,f.transformationType))||f.options.exposeUnsetFields)&&(l instanceof Map?l.set(s,w):l[s]=w)}}else{var E=f.transformationType===gt.PLAIN_TO_CLASS?s:n,w=void 0;f.transformationType===gt.CLASS_TO_PLAIN?(w=e[E],w=f.applyCustomTransformations(w,r,E,e,f.transformationType),w=e[E]===w?p:w,w=f.transform(S,w,d,_,h,i+1)):void 0===p&&f.options.exposeDefaultValues?w=l[s]:(w=f.transform(S,p,d,_,h,i+1),w=f.applyCustomTransformations(w,r,E,e,f.transformationType)),(void 0!==w||f.options.exposeUnsetFields)&&(l instanceof Map?l.set(s,w):l[s]=w)}},f=this,d=0,h=u;d<h.length;d++){p(h[d])}return this.options.enableCircularCheck&&this.recursionStack.delete(e),l}return e}return e}return new Promise((function(t,n){e.then((function(e){return t(s.transform(void 0,e,r,void 0,void 0,i+1))}),n)}))}return null==e?e:Boolean(e)}return null==e?e:Number(e)}return null==e?e:String(e)},t.prototype.applyCustomTransformations=function(t,e,r,n,o){var i=this,a=_t.findTransformMetadatas(e,r,this.transformationType);return void 0!==this.options.version&&(a=a.filter((function(t){return!t.options||i.checkVersion(t.options.since,t.options.until)}))),(a=this.options.groups&&this.options.groups.length?a.filter((function(t){return!t.options||i.checkGroups(t.options.groups)})):a.filter((function(t){return!t.options||!t.options.groups||!t.options.groups.length}))).forEach((function(e){t=e.transformFn({value:t,key:r,obj:n,type:o,options:i.options})})),t},t.prototype.isCircular=function(t){return this.recursionStack.has(t)},t.prototype.getReflectedType=function(t,e){if(t){var r=_t.findTypeMetadata(t,e);return r?r.reflectedType:void 0}},t.prototype.getKeys=function(t,e,r){var n=this,o=_t.getStrategy(t);"none"===o&&(o=this.options.strategy||"exposeAll");var i=[];if(("exposeAll"===o||r)&&(i=e instanceof Map?Array.from(e.keys()):Object.keys(e)),r)return i;if(this.options.ignoreDecorators&&this.options.excludeExtraneousValues&&t){var a=_t.getExposedProperties(t,this.transformationType),s=_t.getExcludedProperties(t,this.transformationType);i=St(St([],a,!0),s,!0)}if(!this.options.ignoreDecorators&&t){a=_t.getExposedProperties(t,this.transformationType);this.transformationType===gt.PLAIN_TO_CLASS&&(a=a.map((function(e){var r=_t.findExposeMetadata(t,e);return r&&r.options&&r.options.name?r.options.name:e}))),i=this.options.excludeExtraneousValues?a:i.concat(a);var c=_t.getExcludedProperties(t,this.transformationType);c.length>0&&(i=i.filter((function(t){return!c.includes(t)}))),void 0!==this.options.version&&(i=i.filter((function(e){var r=_t.findExposeMetadata(t,e);return!r||!r.options||n.checkVersion(r.options.since,r.options.until)}))),i=this.options.groups&&this.options.groups.length?i.filter((function(e){var r=_t.findExposeMetadata(t,e);return!r||!r.options||n.checkGroups(r.options.groups)})):i.filter((function(e){var r=_t.findExposeMetadata(t,e);return!(r&&r.options&&r.options.groups&&r.options.groups.length)}))}return this.options.excludePrefixes&&this.options.excludePrefixes.length&&(i=i.filter((function(t){return n.options.excludePrefixes.every((function(e){return t.substr(0,e.length)!==e}))}))),i=i.filter((function(t,e,r){return r.indexOf(t)===e}))},t.prototype.checkVersion=function(t,e){var r=!0;return r&&t&&(r=this.options.version>=t),r&&e&&(r=this.options.version<e),r},t.prototype.checkGroups=function(t){return!t||this.options.groups.some((function(e){return t.includes(e)}))},t}(),Et={enableCircularCheck:!1,enableImplicitConversion:!1,excludeExtraneousValues:!1,excludePrefixes:void 0,exposeDefaultValues:!1,exposeUnsetFields:!0,groups:void 0,ignoreDecorators:!1,strategy:void 0,targetMaps:void 0,version:void 0},wt=function(){return wt=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},wt.apply(this,arguments)},bt=new(function(){function t(){}return t.prototype.instanceToPlain=function(t,e){return new Ot(gt.CLASS_TO_PLAIN,wt(wt({},Et),e)).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToPlainFromExist=function(t,e,r){return new Ot(gt.CLASS_TO_PLAIN,wt(wt({},Et),r)).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.plainToInstance=function(t,e,r){return new Ot(gt.PLAIN_TO_CLASS,wt(wt({},Et),r)).transform(void 0,e,t,void 0,void 0,void 0)},t.prototype.plainToClassFromExist=function(t,e,r){return new Ot(gt.PLAIN_TO_CLASS,wt(wt({},Et),r)).transform(t,e,void 0,void 0,void 0,void 0)},t.prototype.instanceToInstance=function(t,e){return new Ot(gt.CLASS_TO_CLASS,wt(wt({},Et),e)).transform(void 0,t,void 0,void 0,void 0,void 0)},t.prototype.classToClassFromExist=function(t,e,r){return new Ot(gt.CLASS_TO_CLASS,wt(wt({},Et),r)).transform(e,t,void 0,void 0,void 0,void 0)},t.prototype.serialize=function(t,e){return JSON.stringify(this.instanceToPlain(t,e))},t.prototype.deserialize=function(t,e,r){var n=JSON.parse(e);return this.plainToInstance(t,n,r)},t.prototype.deserializeArray=function(t,e,r){var n=JSON.parse(e);return this.plainToInstance(t,n,r)},t}());function Tt(t,e,r,n){return void 0===r&&(r={}),void 0===n&&(n=""),t.reduce((function(t,r){var o=n?n+"."+r.property:r.property;if(r.constraints){var i=Object.keys(r.constraints)[0];t[o]={type:i,message:r.constraints[i]};var a=t[o];e&&a&&Object.assign(a,{types:r.constraints})}return r.children&&r.children.length&&Tt(r.children,e,t,o),t}),r)}function Mt(t,e,r){return void 0===e&&(e={}),void 0===r&&(r={}),function(n,o,i){try{var a=e.validator,s=(c=t,u=n,l=e.transformer,bt.plainToInstance(c,u,l));return Promise.resolve(("sync"===r.mode?ft:pt)(s,a)).then((function(t){return t.length?{values:{},errors:yt(Tt(t,!i.shouldUseNativeValidation&&"all"===i.criteriaMode),i)}:(i.shouldUseNativeValidation&&ht({},i),{values:r.raw?Object.assign({},n):s,errors:{}})}))}catch(t){return Promise.reject(t)}var c,u,l}}function At(t,e){const r=tt().getTargetValidationMetadatas(e,"",!1,!1),n=function(t){return Reflect.getMetadata(j,t)}(e);return{resolver:Mt(e),fields:Array.from(new Set(r.map((t=>t.propertyName)))),inputs:z(e),cells:R(e),crud:n,path:"/"+(n?.controller??t)}}function xt({children:t,init:e}){return i((()=>{!function({crud:t,fetch:e}){const r={};Object.entries(t).forEach((([t,e])=>{r[t]=At(t,e)})),m(r),v.setState({fetchSettings:{baseUrl:e.baseURL}})}(e())}),[e]),o.createElement(G,null,t)}export{F as Cell,V as Crud,U as Input,B as Layout,xt as Panel,m as createScreens,P as useScreens};
@@ -0,0 +1,2 @@
1
+ import { InitPanelOptions } from "./types/initPanelOptions";
2
+ export declare function initPanel({ crud, fetch }: InitPanelOptions): void;
@@ -0,0 +1,8 @@
1
+ type AnyClass = abstract new (...args: any[]) => any;
2
+ export interface InitPanelOptions {
3
+ crud: Record<string, AnyClass>;
4
+ fetch: {
5
+ baseURL: string;
6
+ };
7
+ }
8
+ export {};
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { Screen } from '../types/Screen';
1
+ import React from "react";
2
+ import { Screen } from "../types/Screen";
3
3
  export declare function ControllerDetails({ screen }: {
4
4
  screen: Screen;
5
5
  }): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { Screen } from '../types/Screen';
1
+ import React from "react";
2
+ import { Screen } from "../types/Screen";
3
3
  export declare function ControllerEdit({ screen }: {
4
4
  screen: Screen;
5
5
  }): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { Screen } from '../types/Screen';
1
+ import React from "react";
2
+ import { Screen } from "../types/Screen";
3
3
  export declare function ControllerList({ screen }: {
4
4
  screen: Screen;
5
5
  }): React.JSX.Element;
@@ -1,5 +1,5 @@
1
- import React from 'react';
2
- import { Screen } from '../types/Screen';
1
+ import React from "react";
2
+ import { Screen } from "../types/Screen";
3
3
  export declare function Form({ data, screen }: {
4
4
  data?: any;
5
5
  screen: Screen;
@@ -0,0 +1,6 @@
1
+ export declare const CrudApi: {
2
+ getList: (api: string, page: number) => Promise<any>;
3
+ create: (api: string, data: any) => Promise<any>;
4
+ details(api: string, id: any): Promise<any>;
5
+ edit(api: string, data: any): Promise<any>;
6
+ };
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ type AppProps = {
3
+ children: React.ReactNode;
4
+ setFetchSettings: () => {
5
+ baseUrl: string;
6
+ };
7
+ };
8
+ export declare function Panel({ children, setFetchSettings }: AppProps): React.JSX.Element;
9
+ export {};
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { ScreenCreatorData } from "../../types/ScreenCreatorData";
3
+ export declare function Layout<IconType>({ children, menu, getIcons, }: {
4
+ children?: React.ReactNode;
5
+ menu?: (screens: Record<string, ScreenCreatorData<any>>) => {
6
+ name: string;
7
+ path: string;
8
+ iconType: IconType;
9
+ }[];
10
+ getIcons?: (iconType: IconType) => React.ReactNode;
11
+ }): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { ScreenCreatorData } from "../../types/ScreenCreatorData";
3
+ export declare function SideBar<IconType>({ menu, getIcons, }: {
4
+ menu?: (screens: Record<string, ScreenCreatorData<any>>) => {
5
+ name: string;
6
+ path: string;
7
+ iconType: IconType;
8
+ }[];
9
+ getIcons?: (iconType: IconType) => React.ReactNode;
10
+ }): React.JSX.Element;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import { CellOptions } from "../../decorators/Cell";
3
+ import { Screen } from "../../types/Screen";
4
+ interface ListProps<T> {
5
+ data: T[];
6
+ cells: CellOptions<T>[];
7
+ screen: Screen;
8
+ }
9
+ export declare function List<T>({ data, cells, screen }: ListProps<T>): React.JSX.Element;
10
+ export {};
@@ -0,0 +1,6 @@
1
+ import 'reflect-metadata';
2
+ export interface CrudOptions {
3
+ controller: string;
4
+ }
5
+ export declare function Crud(options?: CrudOptions): ClassDecorator;
6
+ export declare function getClassCrudData(entityClass: any): CrudOptions | undefined;
@@ -0,0 +1,8 @@
1
+ export { type ScreenCreatorData } from "./types/ScreenCreatorData";
2
+ export { createScreens } from "./utils/createScreens";
3
+ export { getFields } from "./utils/getFields";
4
+ export { getScreens } from "./utils/getScreens";
5
+ export { Crud } from "./decorators/Crud";
6
+ export { Cell } from "./decorators/Cell";
7
+ export { Layout } from "./components/layout/Layout";
8
+ export { Panel } from "./components/Panel";
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Screen } from '../types/Screen';
3
+ export declare function ControllerCreate({ screen }: {
4
+ screen: Screen;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Screen } from '../types/Screen';
3
+ export declare function ControllerDetails({ screen }: {
4
+ screen: Screen;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ import { Screen } from '../types/Screen';
3
+ export declare function ControllerEdit({ screen }: {
4
+ screen: Screen;
5
+ }): React.JSX.Element;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ import { Screen } from "../types/Screen";
3
+ export declare function ControllerList({ screen }: {
4
+ screen: Screen;
5
+ }): React.JSX.Element;
@@ -0,0 +1,6 @@
1
+ import React from "react";
2
+ import { Screen } from "../types/Screen";
3
+ export declare function Form({ data, screen }: {
4
+ data?: any;
5
+ screen: Screen;
6
+ }): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ScreenCreatorData } from "../types/ScreenCreatorData";
2
+ interface AppState {
3
+ screens: Record<string, ScreenCreatorData<any>> | null;
4
+ fetchSettings: {
5
+ baseUrl: string;
6
+ } | null;
7
+ }
8
+ export declare const useAppStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<import("zustand/vanilla").StoreApi<AppState>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AppState, unknown>>) => void;
11
+ clearStorage: () => void;
12
+ rehydrate: () => Promise<void> | void;
13
+ hasHydrated: () => boolean;
14
+ onHydrate: (fn: (state: AppState) => void) => () => void;
15
+ onFinishHydration: (fn: (state: AppState) => void) => () => void;
16
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<AppState, unknown>>;
17
+ };
18
+ }>;
19
+ export {};
@@ -0,0 +1,4 @@
1
+ export interface Screen {
2
+ key: string;
3
+ controller: string;
4
+ }
@@ -0,0 +1,8 @@
1
+ import { CellOptions } from "../decorators/Cell";
2
+ import { CrudOptions } from "../decorators/Crud";
3
+ export interface ScreenCreatorData<T> {
4
+ resolver: any;
5
+ fields: string[];
6
+ cells: CellOptions<T>[];
7
+ crud: CrudOptions;
8
+ }
@@ -0,0 +1 @@
1
+ export declare function createScreens(screens: Record<string, any>): void;
@@ -0,0 +1,2 @@
1
+ import { ScreenCreatorData } from "../types/ScreenCreatorData";
2
+ export declare function getFields<T>(entityClass: T): ScreenCreatorData<T>;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function getScreens(): React.JSX.Element;
@@ -0,0 +1,19 @@
1
+ import { ScreenCreatorData } from "../types/ScreenCreatorData";
2
+ interface AppState {
3
+ screens: Record<string, ScreenCreatorData> | null;
4
+ fetchSettings: {
5
+ baseUrl: string;
6
+ } | null;
7
+ }
8
+ export declare const useAppStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<Omit<import("zustand/vanilla").StoreApi<AppState>, "persist"> & {
9
+ persist: {
10
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<AppState, unknown>>) => void;
11
+ clearStorage: () => void;
12
+ rehydrate: () => Promise<void> | void;
13
+ hasHydrated: () => boolean;
14
+ onHydrate: (fn: (state: AppState) => void) => () => void;
15
+ onFinishHydration: (fn: (state: AppState) => void) => () => void;
16
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<AppState, unknown>>;
17
+ };
18
+ }>;
19
+ export {};
@@ -1,8 +1,11 @@
1
- import { CellOptions } from "../declerations/Cell";
2
- import { CrudOptions } from "../declerations/Crud";
3
- export type ScreenCreatorData<T> = {
1
+ import { CellOptions } from "../decorators/Cell";
2
+ import { CrudOptions } from "../decorators/Crud";
3
+ import { InputOptions } from "../decorators/Input";
4
+ export interface ScreenCreatorData {
4
5
  resolver: any;
5
6
  fields: string[];
6
- cells: CellOptions<T>[];
7
- crud: CrudOptions;
8
- };
7
+ cells: CellOptions[];
8
+ inputs: InputOptions[];
9
+ crud?: CrudOptions;
10
+ path: string;
11
+ }
@@ -0,0 +1,8 @@
1
+ type AnyClass = abstract new (...args: any[]) => any;
2
+ export interface InitPanelOptions {
3
+ crud: Record<string, AnyClass>;
4
+ fetch: {
5
+ baseURL: string;
6
+ };
7
+ }
8
+ export {};
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function CrudScreens(): React.JSX.Element;
@@ -1,2 +1,2 @@
1
1
  import { ScreenCreatorData } from "../types/ScreenCreatorData";
2
- export declare function getFields<T>(entityClass: T): ScreenCreatorData<T>;
2
+ export declare function getFields<T>(key: string, entityClass: T): ScreenCreatorData;
@@ -0,0 +1,2 @@
1
+ import React from "react";
2
+ export declare function getScreens(): React.JSX.Element;