@baasix/baasix 0.1.70 → 0.1.72
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/README.md +1 -1
- package/dist/app/404/index.html +1 -1
- package/dist/app/404.html +1 -1
- package/dist/app/_next/static/chunks/1303-7995fedb9f2f2f71.js +1 -0
- package/dist/app/_next/static/chunks/{4033-ea89dd457b87cead.js → 1407-cec5715f4fa2cd05.js} +1 -1
- package/dist/app/_next/static/chunks/{9599-24678970361fee69.js → 9599-c79f18993362c1ed.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/all-activity/{page-8e1f084e807ff5ee.js → page-f4aea4f863211cec.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/email-log/{page-4e08df2865fe9d0f.js → page-18600e8a50202067.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/notifications/{page-3a5070a5088835ae.js → page-30c71e8db4068db9.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/sessions/{page-edfa379cab0d3ccb.js → page-5357cdaabafac8b2.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-executions/{page-d007890f17b60862.js → page-8b8a0149514ed992.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/activity-log/workflow-logs/{page-976e9829706ac8f2.js → page-1f5f247089844a4b.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/data-browser/{page-fbb7a4d4f2a4353d.js → page-74e35ca26c4d1a9f.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/file-manager/{page-cea6a2c1670d4ef5.js → page-8cc3a301b2a369a7.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/permissions/{page-ed80f4bd5d81df95.js → page-fe065574e33b43e4.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/project/{page-310b8ce72d0516ea.js → page-3d0f42580482a37a.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/roles/{page-fd62dc19ac88dd64.js → page-87a5cb104f9f4b49.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-5cca04eb90158d28.js +1 -0
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tasks/{page-1479604bbfc53a83.js → page-1a1a5b0b39308a7c.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/templates/{page-6787b62a4960304f.js → page-84e453f00c231c83.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/tenants/{page-856d4af5fbd76c8e.js → page-710aebd539a6c2aa.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/invites/{page-ed5493d55f6c1db8.js → page-2c9325780d4034ae.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/list/{page-02e6ef533bdc3bbc.js → page-44612afdab8a0f34.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/{page-faf321b61a6fdeef.js → page-65f20e3184bf0474.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/preferences/{page-2116015e962a2ecc.js → page-a1494aedec6698f2.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/users/user-roles/{page-7d1bcbbfc8f0694b.js → page-abb35554727c4365.js} +1 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/workflows/{page-7f9cb24aaa798f42.js → page-52121976736277c5.js} +1 -1
- package/dist/app/_next/static/chunks/app/layout-1af2638eaca64bf1.js +1 -0
- package/dist/app/_next/static/chunks/{webpack-7a100cbf9402e7ea.js → webpack-706ae56cbfc92c86.js} +1 -1
- package/dist/app/activity-log/all-activity/index.html +1 -1
- package/dist/app/activity-log/all-activity/index.txt +3 -3
- package/dist/app/activity-log/email-log/index.html +1 -1
- package/dist/app/activity-log/email-log/index.txt +3 -3
- package/dist/app/activity-log/index.html +1 -1
- package/dist/app/activity-log/index.txt +2 -2
- package/dist/app/activity-log/notifications/index.html +1 -1
- package/dist/app/activity-log/notifications/index.txt +3 -3
- package/dist/app/activity-log/sessions/index.html +1 -1
- package/dist/app/activity-log/sessions/index.txt +3 -3
- package/dist/app/activity-log/workflow-executions/index.html +1 -1
- package/dist/app/activity-log/workflow-executions/index.txt +3 -3
- package/dist/app/activity-log/workflow-logs/index.html +1 -1
- package/dist/app/activity-log/workflow-logs/index.txt +3 -3
- package/dist/app/change-password/index.html +1 -1
- package/dist/app/change-password/index.txt +2 -2
- package/dist/app/dashboard/index.html +1 -1
- package/dist/app/dashboard/index.txt +2 -2
- package/dist/app/data-browser/index.html +1 -1
- package/dist/app/data-browser/index.txt +3 -3
- package/dist/app/file-manager/index.html +1 -1
- package/dist/app/file-manager/index.txt +3 -3
- package/dist/app/forgot-password/index.html +1 -1
- package/dist/app/forgot-password/index.txt +2 -2
- package/dist/app/index.html +1 -1
- package/dist/app/index.txt +2 -2
- package/dist/app/login/index.html +1 -1
- package/dist/app/login/index.txt +2 -2
- package/dist/app/register/index.html +1 -1
- package/dist/app/register/index.txt +2 -2
- package/dist/app/settings/migrations/index.html +1 -1
- package/dist/app/settings/migrations/index.txt +2 -2
- package/dist/app/settings/permissions/index.html +1 -1
- package/dist/app/settings/permissions/index.txt +3 -3
- package/dist/app/settings/project/index.html +1 -1
- package/dist/app/settings/project/index.txt +3 -3
- package/dist/app/settings/roles/index.html +1 -1
- package/dist/app/settings/roles/index.txt +3 -3
- package/dist/app/settings/schema/index.html +1 -1
- package/dist/app/settings/schema/index.txt +3 -3
- package/dist/app/settings/schema-diff/index.html +1 -1
- package/dist/app/settings/schema-diff/index.txt +2 -2
- package/dist/app/settings/tasks/index.html +1 -1
- package/dist/app/settings/tasks/index.txt +3 -3
- package/dist/app/settings/templates/edit/index.html +1 -1
- package/dist/app/settings/templates/edit/index.txt +2 -2
- package/dist/app/settings/templates/index.html +1 -1
- package/dist/app/settings/templates/index.txt +3 -3
- package/dist/app/settings/tenants/index.html +1 -1
- package/dist/app/settings/tenants/index.txt +3 -3
- package/dist/app/users/index.html +1 -1
- package/dist/app/users/index.txt +3 -3
- package/dist/app/users/invites/index.html +1 -1
- package/dist/app/users/invites/index.txt +3 -3
- package/dist/app/users/list/index.html +1 -1
- package/dist/app/users/list/index.txt +3 -3
- package/dist/app/users/preferences/index.html +1 -1
- package/dist/app/users/preferences/index.txt +3 -3
- package/dist/app/users/user-roles/index.html +1 -1
- package/dist/app/users/user-roles/index.txt +3 -3
- package/dist/app/workflows/detail/index.html +1 -1
- package/dist/app/workflows/detail/index.txt +2 -2
- package/dist/app/workflows/edit/index.html +1 -1
- package/dist/app/workflows/edit/index.txt +2 -2
- package/dist/app/workflows/execution/index.html +1 -1
- package/dist/app/workflows/execution/index.txt +2 -2
- package/dist/app/workflows/index.html +1 -1
- package/dist/app/workflows/index.txt +3 -3
- package/dist/auth/core.d.ts.map +1 -1
- package/dist/auth/core.js +11 -0
- package/dist/auth/core.js.map +1 -1
- package/dist/auth/routes.d.ts.map +1 -1
- package/dist/auth/routes.js +3 -0
- package/dist/auth/routes.js.map +1 -1
- package/dist/plugins/softDelete.d.ts.map +1 -1
- package/dist/plugins/softDelete.js +2 -2
- package/dist/plugins/softDelete.js.map +1 -1
- package/dist/routes/items.route.d.ts.map +1 -1
- package/dist/routes/items.route.js +14 -0
- package/dist/routes/items.route.js.map +1 -1
- package/dist/routes/schema.route.d.ts.map +1 -1
- package/dist/routes/schema.route.js +10 -8
- package/dist/routes/schema.route.js.map +1 -1
- package/dist/services/ItemsService.d.ts.map +1 -1
- package/dist/services/ItemsService.js +15 -5
- package/dist/services/ItemsService.js.map +1 -1
- package/dist/services/MCPService.d.ts.map +1 -1
- package/dist/services/MCPService.js +20 -1
- package/dist/services/MCPService.js.map +1 -1
- package/dist/utils/schemaManager.d.ts +1 -1
- package/dist/utils/schemaManager.d.ts.map +1 -1
- package/dist/utils/schemaManager.js +116 -12
- package/dist/utils/schemaManager.js.map +1 -1
- package/dist/utils/tenantUtils.d.ts.map +1 -1
- package/dist/utils/tenantUtils.js +5 -8
- package/dist/utils/tenantUtils.js.map +1 -1
- package/package.json +2 -2
- package/dist/app/_next/static/chunks/7304-bdd00a7504bc4081.js +0 -1
- package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-3d91124704c2e853.js +0 -1
- package/dist/app/_next/static/chunks/app/layout-64ac14a534e2809b.js +0 -1
- /package/dist/app/_next/static/{MOjte1maseOzDogE76k_j → hX9XuIu3767zdhQ9snZUx}/_buildManifest.js +0 -0
- /package/dist/app/_next/static/{MOjte1maseOzDogE76k_j → hX9XuIu3767zdhQ9snZUx}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4850],{45330:function(e,s,t){Promise.resolve().then(t.bind(t,97015))},79205:function(e,s,t){"use strict";t.d(s,{Z:function(){return i}});var a=t(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter((e,s,t)=>!!e&&t.indexOf(e)===s).join(" ")};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,a.forwardRef)((e,s)=>{let{color:t="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:i,className:o="",children:d,iconNode:u,...m}=e;return(0,a.createElement)("svg",{ref:s,...n,width:l,height:l,stroke:t,strokeWidth:i?24*Number(c)/Number(l):c,className:r("lucide",o),...m},[...u.map(e=>{let[s,t]=e;return(0,a.createElement)(s,t)}),...Array.isArray(d)?d:[d]])}),i=(e,s)=>{let t=(0,a.forwardRef)((t,n)=>{let{className:i,...o}=t;return(0,a.createElement)(c,{ref:n,iconNode:s,className:r("lucide-".concat(l(e)),i),...o})});return t.displayName="".concat(e),t}},51817:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});let a=(0,t(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},97015:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return _}});var a=t(57437),l=t(2265),r=t(72135),n=t(14438),c=t(12381),i=t(40279),o=t(69174),d=t(91032),u=t(75060),m=t(17168),h=t(53113);let x=(0,t(79205).Z)("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);var f=t(48736),p=t(69658),j=t(42208),w=t(15868),g=t(92735),v=t(18930),N=t(17689),k=t(98335),y=t(32489),b=t(51817),C=t(71096),z=t.n(C),Z=t(72337);let F=e=>{if(0===e)return"0 B";let s=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,s)).toFixed(2))+" "+["B","KB","MB","GB"][s]},S=e=>(null==e?void 0:e.startsWith("image/"))||!1,A=e=>(null==e?void 0:e.startsWith("video/"))||!1,E=e=>S(e)?(0,a.jsx)(h.Z,{className:"h-4 w-4 text-blue-500"}):A(e)?(0,a.jsx)(x,{className:"h-4 w-4 text-purple-500"}):(null==e?void 0:e.includes("pdf"))||(null==e?void 0:e.includes("document"))?(0,a.jsx)(f.Z,{className:"h-4 w-4 text-orange-500"}):(0,a.jsx)(p.Z,{className:"h-4 w-4 text-gray-500"}),M=e=>{let{record:s,apiUrl:t,token:r,size:n="sm"}=e,[c,i]=(0,l.useState)(!1),o=S(s.type),d={sm:"h-8 w-8",md:"h-12 w-12",lg:"h-48 w-full max-w-md"};if(!o||c)return(0,a.jsx)("div",{className:"".concat(d[n]," flex items-center justify-center bg-muted rounded ").concat("lg"===n?"aspect-video":""),children:E(s.type)});let u="".concat(t,"/assets/").concat(s.id,"?access_token=").concat(r).concat("sm"===n?"&width=64&height=64&fit=contain":"md"===n?"&width=96&height=96&fit=contain":"");return(0,a.jsx)("img",{src:u,alt:s.title||"File thumbnail",className:"".concat(d[n]," object-contain rounded ").concat("lg"===n?"max-h-64":""),onError:()=>i(!0),loading:"lazy"})},R=()=>{let[e,s]=(0,l.useState)(!1),[t,n]=(0,l.useState)(0),i=(0,r.Ji)(),d=localStorage.getItem("token"),u=e=>{let s="".concat(i,"/assets/").concat(e.id,"?download=true&access_token=").concat(d);window.open(s,"_blank")},m=(0,a.jsx)(c.z,{size:"icon",onClick:()=>s(!0),title:"Upload File",children:(0,a.jsx)(N.Z,{className:"h-4 w-4"})});return(0,a.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,a.jsx)(Z.DataBrowserInner,{selectedCollection:"baasix_File",title:"File Manager",enableSearch:!0,enableFilters:!0,enableCreate:!1,enableView:!0,enableFilePreview:!0,enableEdit:!0,enableDelete:!0,enableExport:!0,enableImport:!0,enableBulkSelect:!0,enableColumnSettings:!0,defaultSorters:[{field:"createdAt",order:"desc"}],defaultVisibleColumns:["title","type","size","createdAt"],headerActions:m,renderRowActions:e=>{let{record:s,onView:t,onEdit:l,onDelete:r}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,title:"View",children:(0,a.jsx)(j.Z,{className:"h-4 w-4"})}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:l,title:"Edit",children:(0,a.jsx)(w.Z,{className:"h-4 w-4"})}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u(s),title:"Download",children:(0,a.jsx)(g.Z,{className:"h-4 w-4"})}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:r,title:"Delete",children:(0,a.jsx)(v.Z,{className:"h-4 w-4"})})]})},customColumnRenderers:{title:(e,s)=>(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(M,{record:s,apiUrl:i,token:d,size:"sm"}),(0,a.jsx)("span",{className:"font-medium truncate max-w-xs",children:e})]}),type:e=>(0,a.jsx)(o.C,{variant:"secondary",className:"capitalize",children:e}),size:e=>(0,a.jsx)("span",{className:"text-muted-foreground",children:F(e||0)}),createdAt:e=>(0,a.jsx)("span",{className:"text-muted-foreground",children:e?z()(e).format("MMM D, YYYY h:mm A"):"-"})},onRefresh:()=>n(e=>e+1)},t),(0,a.jsx)(U,{open:e,onClose:()=>s(!1),onSuccess:()=>{n(e=>e+1),s(!1)}})]})},U=e=>{let{open:s,onClose:t,onSuccess:o}=e,[h,x]=(0,l.useState)("local"),[f,j]=(0,l.useState)([]),[w,g]=(0,l.useState)(""),[v,C]=(0,l.useState)(!1),z=(0,l.useRef)(null),{mutate:Z}=(0,r.RO)(),{mutate:S}=(0,r.uC)(),A=(0,l.useCallback)(e=>{e.preventDefault(),j(Array.from(e.dataTransfer.files))},[]),E=(0,l.useCallback)(e=>{e.preventDefault()},[]),M=e=>{j(f.filter((s,t)=>t!==e))},R=async()=>{C(!0);try{if("local"===h&&f.length>0){for(let e of f){let s=new FormData;s.append("file",e),await new Promise((t,a)=>{Z({resource:"files",values:s},{onSuccess:()=>{t()},onError:s=>{n.Am.error("Failed to upload ".concat(e.name,": ").concat(s.message)),a(s)}})})}n.Am.success("".concat(f.length," file(s) uploaded successfully")),j([]),o()}else"url"===h&&w&&S({url:"/files/upload-from-url",method:"post",values:{url:w}},{onSuccess:()=>{n.Am.success("File uploaded from URL successfully"),g(""),o()},onError:e=>{n.Am.error("Failed to upload from URL: ".concat(e.message))}})}catch(e){console.error("Upload error:",e)}finally{C(!1)}};return(0,a.jsx)(d.yo,{open:s,onOpenChange:e=>!e&&t(),children:(0,a.jsxs)(d.ue,{className:"w-[400px] sm:w-[450px]",children:[(0,a.jsx)(d.Tu,{children:(0,a.jsx)(d.bC,{children:"Upload Files"})}),(0,a.jsxs)("div",{className:"mt-6 space-y-6",children:[(0,a.jsxs)(m.mQ,{value:h,onValueChange:e=>x(e),children:[(0,a.jsxs)(m.dr,{className:"grid w-full grid-cols-2",children:[(0,a.jsxs)(m.SP,{value:"local",children:[(0,a.jsx)(N.Z,{className:"mr-2 h-4 w-4"}),"Local File"]}),(0,a.jsxs)(m.SP,{value:"url",children:[(0,a.jsx)(k.Z,{className:"mr-2 h-4 w-4"}),"From URL"]})]}),(0,a.jsxs)(m.nU,{value:"local",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{className:"border-2 border-dashed rounded-lg p-8 text-center cursor-pointer hover:border-primary transition-colors",onClick:()=>{var e;return null===(e=z.current)||void 0===e?void 0:e.click()},onDrop:A,onDragOver:E,children:[(0,a.jsx)(N.Z,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-sm font-medium",children:"Drag and drop files here"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"or click to browse"}),(0,a.jsx)("input",{ref:z,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&j(Array.from(e.target.files))}})]}),f.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(u._,{children:"Selected Files"}),(0,a.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:f.map((e,s)=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-2 bg-muted rounded",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 truncate",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"text-sm truncate",children:e.name}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["(",F(e.size),")"]})]}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>M(s),children:(0,a.jsx)(y.Z,{className:"h-3 w-3"})})]},s))})]})]}),(0,a.jsx)(m.nU,{value:"url",className:"mt-4 space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(u._,{htmlFor:"url",children:"File URL"}),(0,a.jsx)(i.I,{id:"url",placeholder:"https://example.com/file.pdf",value:w,onChange:e=>g(e.target.value)}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enter the URL of the file you want to upload"})]})})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(c.z,{variant:"outline",onClick:t,children:"Cancel"}),(0,a.jsxs)(c.z,{onClick:R,disabled:v||"local"===h&&0===f.length||"url"===h&&!w,children:[v?(0,a.jsx)(b.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,a.jsx)(N.Z,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]})]})})};function _(){return(0,a.jsx)(R,{})}}},function(e){e.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4850],{45330:function(e,s,t){Promise.resolve().then(t.bind(t,97015))},79205:function(e,s,t){"use strict";t.d(s,{Z:function(){return i}});var a=t(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),r=function(){for(var e=arguments.length,s=Array(e),t=0;t<e;t++)s[t]=arguments[t];return s.filter((e,s,t)=>!!e&&t.indexOf(e)===s).join(" ")};var n={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let c=(0,a.forwardRef)((e,s)=>{let{color:t="currentColor",size:l=24,strokeWidth:c=2,absoluteStrokeWidth:i,className:o="",children:d,iconNode:u,...m}=e;return(0,a.createElement)("svg",{ref:s,...n,width:l,height:l,stroke:t,strokeWidth:i?24*Number(c)/Number(l):c,className:r("lucide",o),...m},[...u.map(e=>{let[s,t]=e;return(0,a.createElement)(s,t)}),...Array.isArray(d)?d:[d]])}),i=(e,s)=>{let t=(0,a.forwardRef)((t,n)=>{let{className:i,...o}=t;return(0,a.createElement)(c,{ref:n,iconNode:s,className:r("lucide-".concat(l(e)),i),...o})});return t.displayName="".concat(e),t}},51817:function(e,s,t){"use strict";t.d(s,{Z:function(){return a}});let a=(0,t(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},97015:function(e,s,t){"use strict";t.r(s),t.d(s,{default:function(){return _}});var a=t(57437),l=t(2265),r=t(72135),n=t(14438),c=t(12381),i=t(40279),o=t(69174),d=t(91032),u=t(75060),m=t(17168),h=t(53113);let x=(0,t(79205).Z)("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]]);var f=t(48736),p=t(69658),j=t(42208),w=t(15868),g=t(92735),v=t(18930),N=t(17689),k=t(98335),y=t(32489),b=t(51817),C=t(71096),z=t.n(C),Z=t(72337);let F=e=>{if(0===e)return"0 B";let s=Math.floor(Math.log(e)/Math.log(1024));return parseFloat((e/Math.pow(1024,s)).toFixed(2))+" "+["B","KB","MB","GB"][s]},S=e=>(null==e?void 0:e.startsWith("image/"))||!1,A=e=>(null==e?void 0:e.startsWith("video/"))||!1,E=e=>S(e)?(0,a.jsx)(h.Z,{className:"h-4 w-4 text-blue-500"}):A(e)?(0,a.jsx)(x,{className:"h-4 w-4 text-purple-500"}):(null==e?void 0:e.includes("pdf"))||(null==e?void 0:e.includes("document"))?(0,a.jsx)(f.Z,{className:"h-4 w-4 text-orange-500"}):(0,a.jsx)(p.Z,{className:"h-4 w-4 text-gray-500"}),M=e=>{let{record:s,apiUrl:t,token:r,size:n="sm"}=e,[c,i]=(0,l.useState)(!1),o=S(s.type),d={sm:"h-8 w-8",md:"h-12 w-12",lg:"h-48 w-full max-w-md"};if(!o||c)return(0,a.jsx)("div",{className:"".concat(d[n]," flex items-center justify-center bg-muted rounded ").concat("lg"===n?"aspect-video":""),children:E(s.type)});let u="".concat(t,"/assets/").concat(s.id,"?access_token=").concat(r).concat("sm"===n?"&width=64&height=64&fit=contain":"md"===n?"&width=96&height=96&fit=contain":"");return(0,a.jsx)("img",{src:u,alt:s.title||"File thumbnail",className:"".concat(d[n]," object-contain rounded ").concat("lg"===n?"max-h-64":""),onError:()=>i(!0),loading:"lazy"})},R=()=>{let[e,s]=(0,l.useState)(!1),[t,n]=(0,l.useState)(0),i=(0,r.Ji)(),d=localStorage.getItem("token"),u=e=>{let s="".concat(i,"/assets/").concat(e.id,"?download=true&access_token=").concat(d);window.open(s,"_blank")},m=(0,a.jsx)(c.z,{size:"icon",onClick:()=>s(!0),title:"Upload File",children:(0,a.jsx)(N.Z,{className:"h-4 w-4"})});return(0,a.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,a.jsx)(Z.DataBrowserInner,{selectedCollection:"baasix_File",title:"File Manager",enableSearch:!0,enableFilters:!0,enableCreate:!1,enableView:!0,enableFilePreview:!0,enableEdit:!0,enableDelete:!0,enableExport:!0,enableImport:!0,enableBulkSelect:!0,enableColumnSettings:!0,defaultSorters:[{field:"createdAt",order:"desc"}],defaultVisibleColumns:["title","type","size","createdAt"],headerActions:m,renderRowActions:e=>{let{record:s,onView:t,onEdit:l,onDelete:r}=e;return(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:t,title:"View",children:(0,a.jsx)(j.Z,{className:"h-4 w-4"})}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:l,title:"Edit",children:(0,a.jsx)(w.Z,{className:"h-4 w-4"})}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>u(s),title:"Download",children:(0,a.jsx)(g.Z,{className:"h-4 w-4"})}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:r,title:"Delete",children:(0,a.jsx)(v.Z,{className:"h-4 w-4"})})]})},customColumnRenderers:{title:(e,s)=>(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)(M,{record:s,apiUrl:i,token:d,size:"sm"}),(0,a.jsx)("span",{className:"font-medium truncate max-w-xs",children:e})]}),type:e=>(0,a.jsx)(o.C,{variant:"secondary",className:"capitalize",children:e}),size:e=>(0,a.jsx)("span",{className:"text-muted-foreground",children:F(e||0)}),createdAt:e=>(0,a.jsx)("span",{className:"text-muted-foreground",children:e?z()(e).format("MMM D, YYYY h:mm A"):"-"})},onRefresh:()=>n(e=>e+1)},t),(0,a.jsx)(U,{open:e,onClose:()=>s(!1),onSuccess:()=>{n(e=>e+1),s(!1)}})]})},U=e=>{let{open:s,onClose:t,onSuccess:o}=e,[h,x]=(0,l.useState)("local"),[f,j]=(0,l.useState)([]),[w,g]=(0,l.useState)(""),[v,C]=(0,l.useState)(!1),z=(0,l.useRef)(null),{mutate:Z}=(0,r.RO)(),{mutate:S}=(0,r.uC)(),A=(0,l.useCallback)(e=>{e.preventDefault(),j(Array.from(e.dataTransfer.files))},[]),E=(0,l.useCallback)(e=>{e.preventDefault()},[]),M=e=>{j(f.filter((s,t)=>t!==e))},R=async()=>{C(!0);try{if("local"===h&&f.length>0){for(let e of f){let s=new FormData;s.append("file",e),await new Promise((t,a)=>{Z({resource:"files",values:s},{onSuccess:()=>{t()},onError:s=>{n.Am.error("Failed to upload ".concat(e.name,": ").concat(s.message)),a(s)}})})}n.Am.success("".concat(f.length," file(s) uploaded successfully")),j([]),o()}else"url"===h&&w&&S({url:"/files/upload-from-url",method:"post",values:{url:w}},{onSuccess:()=>{n.Am.success("File uploaded from URL successfully"),g(""),o()},onError:e=>{n.Am.error("Failed to upload from URL: ".concat(e.message))}})}catch(e){console.error("Upload error:",e)}finally{C(!1)}};return(0,a.jsx)(d.yo,{open:s,onOpenChange:e=>!e&&t(),children:(0,a.jsxs)(d.ue,{className:"w-[400px] sm:w-[450px]",children:[(0,a.jsx)(d.Tu,{children:(0,a.jsx)(d.bC,{children:"Upload Files"})}),(0,a.jsxs)("div",{className:"mt-6 space-y-6",children:[(0,a.jsxs)(m.mQ,{value:h,onValueChange:e=>x(e),children:[(0,a.jsxs)(m.dr,{className:"grid w-full grid-cols-2",children:[(0,a.jsxs)(m.SP,{value:"local",children:[(0,a.jsx)(N.Z,{className:"mr-2 h-4 w-4"}),"Local File"]}),(0,a.jsxs)(m.SP,{value:"url",children:[(0,a.jsx)(k.Z,{className:"mr-2 h-4 w-4"}),"From URL"]})]}),(0,a.jsxs)(m.nU,{value:"local",className:"mt-4 space-y-4",children:[(0,a.jsxs)("div",{className:"border-2 border-dashed rounded-lg p-8 text-center cursor-pointer hover:border-primary transition-colors",onClick:()=>{var e;return null===(e=z.current)||void 0===e?void 0:e.click()},onDrop:A,onDragOver:E,children:[(0,a.jsx)(N.Z,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),(0,a.jsx)("p",{className:"text-sm font-medium",children:"Drag and drop files here"}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:"or click to browse"}),(0,a.jsx)("input",{ref:z,type:"file",multiple:!0,className:"hidden",onChange:e=>{e.target.files&&j(Array.from(e.target.files))}})]}),f.length>0&&(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(u._,{children:"Selected Files"}),(0,a.jsx)("div",{className:"space-y-2 max-h-48 overflow-y-auto",children:f.map((e,s)=>(0,a.jsxs)("div",{className:"flex items-center justify-between p-2 bg-muted rounded",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 truncate",children:[(0,a.jsx)(p.Z,{className:"h-4 w-4 shrink-0"}),(0,a.jsx)("span",{className:"text-sm truncate",children:e.name}),(0,a.jsxs)("span",{className:"text-xs text-muted-foreground shrink-0",children:["(",F(e.size),")"]})]}),(0,a.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-6 w-6 shrink-0",onClick:()=>M(s),children:(0,a.jsx)(y.Z,{className:"h-3 w-3"})})]},s))})]})]}),(0,a.jsx)(m.nU,{value:"url",className:"mt-4 space-y-4",children:(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsx)(u._,{htmlFor:"url",children:"File URL"}),(0,a.jsx)(i.I,{id:"url",placeholder:"https://example.com/file.pdf",value:w,onChange:e=>g(e.target.value)}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enter the URL of the file you want to upload"})]})})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,a.jsx)(c.z,{variant:"outline",onClick:t,children:"Cancel"}),(0,a.jsxs)(c.z,{onClick:R,disabled:v||"local"===h&&0===f.length||"url"===h&&!w,children:[v?(0,a.jsx)(b.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,a.jsx)(N.Z,{className:"mr-2 h-4 w-4"}),"Upload"]})]})]})]})})};function _(){return(0,a.jsx)(R,{})}}},function(e){e.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,1407,1303,3817,2971,2117,1744],function(){return e(e.s=45330)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8154],{80723:function(n,e,u){Promise.resolve().then(u.bind(u,64310))},64310:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.HD,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8154],{80723:function(n,e,u){Promise.resolve().then(u.bind(u,64310))},64310:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.HD,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,1407,1303,3817,9599,2971,2117,1744],function(){return n(n.s=80723)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6691],{57433:function(n,e,u){Promise.resolve().then(u.bind(u,67306))},67306:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.iL,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6691],{57433:function(n,e,u){Promise.resolve().then(u.bind(u,67306))},67306:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.iL,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,1407,1303,3817,9599,2971,2117,1744],function(){return n(n.s=57433)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9735],{38509:function(n,e,u){Promise.resolve().then(u.bind(u,83975))},83975:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.kL,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9735],{38509:function(n,e,u){Promise.resolve().then(u.bind(u,83975))},83975:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.kL,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,1407,1303,3817,9599,2971,2117,1744],function(){return n(n.s=38509)}),_N_E=n.O()}]);
|
package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema/page-5cca04eb90158d28.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[842],{49204:function(e,a,l){Promise.resolve().then(l.bind(l,80671))},79205:function(e,a,l){"use strict";l.d(a,{Z:function(){return d}});var s=l(2265);let t=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),n=function(){for(var e=arguments.length,a=Array(e),l=0;l<e;l++)a[l]=arguments[l];return a.filter((e,a,l)=>!!e&&l.indexOf(e)===a).join(" ")};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let r=(0,s.forwardRef)((e,a)=>{let{color:l="currentColor",size:t=24,strokeWidth:r=2,absoluteStrokeWidth:d,className:c="",children:o,iconNode:u,...h}=e;return(0,s.createElement)("svg",{ref:a,...i,width:t,height:t,stroke:l,strokeWidth:d?24*Number(r)/Number(t):r,className:n("lucide",c),...h},[...u.map(e=>{let[a,l]=e;return(0,s.createElement)(a,l)}),...Array.isArray(o)?o:[o]])}),d=(e,a)=>{let l=(0,s.forwardRef)((l,i)=>{let{className:d,...c}=l;return(0,s.createElement)(r,{ref:i,iconNode:a,className:n("lucide-".concat(t(e)),d),...c})});return l.displayName="".concat(e),l}},41671:function(e,a,l){"use strict";l.d(a,{Z:function(){return s}});let s=(0,l(79205).Z)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},33003:function(e,a,l){"use strict";l.d(a,{Z:function(){return s}});let s=(0,l(79205).Z)("Columns3",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]])},54001:function(e,a,l){"use strict";l.d(a,{Z:function(){return s}});let s=(0,l(79205).Z)("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])},51817:function(e,a,l){"use strict";l.d(a,{Z:function(){return s}});let s=(0,l(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},80671:function(e,a,l){"use strict";l.r(a),l.d(a,{default:function(){return ec}});var s=l(57437),t=l(2265),n=l(72135),i=l(29696),r=l(81853),d=l(14438),c=l(79820),o=l(12381),u=l(43368),h=l(69174),m=l(33804),x=l(30767),p=l(82431),j=l(99397),v=l(17689),f=l(92735),g=l(51817),N=l(50091),y=l(33003),b=l(54001),C=l(98728),w=l(18930),S=l(91032),I=l(40279),k=l(75060),A=l(94589),T=l(15291);let _=e=>{let{open:a,onClose:l,onSuccess:c}=e,[u,h]=(0,t.useState)(""),[m,x]=(0,t.useState)("id"),[p,j]=(0,t.useState)("UUID"),[v,f]=(0,t.useState)(!0),[N,y]=(0,t.useState)(!0),[b,C]=(0,t.useState)(!1),[w,_]=(0,t.useState)(!0),{mutate:D,isLoading:M}=(0,n.RO)(),{refetch:E}=(0,i.I_)(),{isMultiTenant:R}=(0,r.PY)(),O=()=>{h(""),x("id"),j("UUID"),f(!0),y(!0),C(!1),_(!0)};return(0,s.jsx)(S.yo,{open:a,onOpenChange:e=>!e&&l(),children:(0,s.jsxs)(S.ue,{className:"w-[500px] sm:w-[600px] flex flex-col",children:[(0,s.jsx)(S.Tu,{children:(0,s.jsx)(S.bC,{children:"Create New Schema"})}),(0,s.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!u.trim()){d.Am.error("Please enter a schema name");return}if(u.length>63){d.Am.error("Schema name must be 63 characters or less (PostgreSQL identifier limit)");return}D({resource:"collections",values:{collectionName:u.toLowerCase(),schema:{name:u,fields:{[m]:{type:p,primaryKey:!0,defaultValue:"UUID"===p?{type:"UUIDV4"}:"Integer"===p?{type:"AUTOINCREMENT"}:"SUID"===p?{type:"SUID"}:void 0}},timestamps:v,paranoid:b,usertrack:N,tenantScoped:w}}},{onSuccess:()=>{d.Am.success("Schema created successfully"),E(),O(),c()},onError:e=>{d.Am.error("Error creating schema: ".concat(e.message))}})},className:"mt-6 space-y-6 flex-1 overflow-y-auto",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"schemaName",children:"Schema Name"}),(0,s.jsx)(I.I,{id:"schemaName",placeholder:"Enter schema name",value:u,onChange:e=>h(e.target.value),maxLength:63,className:u.length>63?"border-red-500":"",required:!0}),(0,s.jsxs)("p",{className:"text-xs ".concat(u.length>63?"text-red-600":u.length>50?"text-yellow-600":"text-muted-foreground"),children:[u.length,"/63 characters",u.length>63&&" - Name too long for PostgreSQL!"]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"primaryKeyName",children:"Primary Key Name"}),(0,s.jsx)(I.I,{id:"primaryKeyName",placeholder:"id",value:m,onChange:e=>x(e.target.value),required:!0})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"primaryKeyType",children:"Primary Key Type"}),(0,s.jsxs)(T.Ph,{value:p,onValueChange:j,children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select type"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"UUID",children:"UUID"}),(0,s.jsx)(T.Ql,{value:"Integer",children:"Integer"}),(0,s.jsx)(T.Ql,{value:"String",children:"String"}),(0,s.jsx)(T.Ql,{value:"SUID",children:"Short UID"})]})]})]}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Timestamps"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add createdAt and updatedAt fields"})]}),(0,s.jsx)(A.r,{checked:v,onCheckedChange:f})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Audit Logs"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Track user changes to records"})]}),(0,s.jsx)(A.r,{checked:N,onCheckedChange:y})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Soft Delete"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Mark records as deleted instead of removing them"})]}),(0,s.jsx)(A.r,{checked:b,onCheckedChange:C})]}),R&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Tenant Scoped"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enforce tenant isolation for this collection"})]}),(0,s.jsx)(A.r,{checked:w,onCheckedChange:_})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-4",children:[(0,s.jsx)(o.z,{type:"button",variant:"outline",onClick:l,children:"Cancel"}),(0,s.jsxs)(o.z,{type:"submit",disabled:M,children:[M&&(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Schema"]})]})]})]})})};var D=l(79205);let M=(0,D.Z)("Link2",[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]]);var E=l(73247),R=l(45675),O=l(23675),U=l(68245),L=l(33245),V=l(32489),Z=l(71488),z=l(12749),P=l(93448),F=l(79622);let Q=[{value:" - ",label:"Dash ( - )"},{value:" ",label:"Space ( )"},{value:", ",label:"Comma (, )"},{value:"_",label:"Underscore (_)"},{value:" & ",label:"Ampersand ( & )"},{value:" | ",label:"Pipe ( | )"},{value:" (",label:"Open Paren ( ()"},{value:") ",label:"Close Paren ( ))"},{value:"(",label:"Open Paren (()"},{value:")",label:"Close Paren ())"}],B={text:[{value:"String",label:"String"},{value:"Text",label:"Text"},{value:"HTML",label:"HTML (Rich Text)"},{value:"CiText",label:"Text (Case Insensitive)"},{value:"ENUM",label:"ENUM"}],numeric:[{value:"Integer",label:"Integer"},{value:"BigInt",label:"BigInt"},{value:"Decimal",label:"Decimal"},{value:"Double",label:"Double"},{value:"Real",label:"Real"}],date:[{value:"DateTime",label:"DateTime (with timezone)"},{value:"DateTime_NO_TZ",label:"DateTime (no timezone)"},{value:"Date",label:"Date"},{value:"Time",label:"Time (with timezone)"},{value:"Time_NO_TZ",label:"Time (no timezone)"}],other:[{value:"Boolean",label:"Boolean"},{value:"UUID",label:"UUID"},{value:"SUID",label:"Short UID"},{value:"JSON",label:"JSON"},{value:"JSONB",label:"JSONB"},{value:"VIRTUAL",label:"Virtual"}],array:[{value:"Array_Integer",label:"Array Integer"},{value:"Array_String",label:"Array String"},{value:"Array_Double",label:"Array Double"},{value:"Array_Date",label:"Array Date"},{value:"Array_DateTime",label:"Array DateTime (with timezone)"},{value:"Array_DateTime_NO_TZ",label:"Array DateTime (no timezone)"},{value:"Array_Time",label:"Array Time (with timezone)"},{value:"Array_Time_NO_TZ",label:"Array Time (no timezone)"},{value:"Array_Boolean",label:"Array Boolean"}],range:[{value:"Range_Integer",label:"Range Integer"},{value:"Range_Double",label:"Range Double"},{value:"Range_Decimal",label:"Range Decimal"},{value:"Range_Date",label:"Range Date"},{value:"Range_DateTime",label:"Range DateTime (with timezone)"},{value:"Range_DateTime_NO_TZ",label:"Range DateTime (no timezone)"},{value:"Range_Time",label:"Range Time (with timezone)"},{value:"Range_Time_NO_TZ",label:"Range Time (no timezone)"}],geo:[{value:"Point",label:"Point"},{value:"Polygon",label:"Polygon"},{value:"LineString",label:"LineString"}]},$=[{value:"M2O",label:"Many-to-One"},{value:"O2O",label:"One-to-One"},{value:"M2M",label:"Many-to-Many"},{value:"M2A",label:"Many-to-Any"}],W=e=>["DateTime","DateTime_NO_TZ","Date","Time","Time_NO_TZ"].includes(e),J=e=>{var a,l,r,c,u;let{open:m,onClose:x,collectionName:p,fieldName:j,isRelationship:v,onSuccess:f}=e,[N,y]=(0,t.useState)({name:"",type:"",allowNull:!0,hidden:!1,defaultValue:"",values:[],stringLength:"",precision:"",scale:"",calculated:"",target:"",relType:"",onDelete:"CASCADE",onUpdate:"CASCADE",alias:"",through:"",tables:[],showAs:[],polymorphic:!1,description:"",validateMin:"",validateMax:"",validateIsInt:!1,validateNotEmpty:!1,validateIsEmail:!1,validateIsUrl:!1,validateMinLength:"",validateMaxLength:"",validatePattern:""}),[b,C]=(0,t.useState)([]),[w,_]=(0,t.useState)(!1),{getSchemaByName:D,getNestedFields:M,schemas:E,refetch:R}=(0,i.I_)(),J=(0,t.useMemo)(()=>m&&p?{data:D(p)}:null,[m,p,D]),q=(0,t.useMemo)(()=>(null==E?void 0:E.map(e=>({id:e.collectionName,name:e.collectionName})))||[],[E]),H=(0,t.useMemo)(()=>N.target&&(null==M?void 0:M(N.target))||[],[N.target,M]),{mutate:K,isLoading:X}=(0,n.PQ)(),{mutate:Y,isLoading:G}=(0,n.RO)(),ee=!!j,ea=X||G;(0,t.useEffect)(()=>{if(m&&(null==J?void 0:J.data)&&j){var e,a,l,s,t,n,i,r,d;let c=J.data.schema.fields[j]||{},o=c.values||[],u="",h="",m="";c.values&&"object"==typeof c.values&&!Array.isArray(c.values)&&(u=c.values.stringLength||"",h=c.values.precision||"",m=c.values.scale||"",o=[]);let x="",p=!1;c.defaultValue&&("object"==typeof c.defaultValue&&"NOW"===c.defaultValue.type?x="$NOW":"object"==typeof c.defaultValue&&"UUIDV4"===c.defaultValue.type?x="$UUIDV4":"object"==typeof c.defaultValue&&"SUID"===c.defaultValue.type?x="$SUID":"object"==typeof c.defaultValue&&"AUTOINCREMENT"===c.defaultValue.type?x="$AUTOINCREMENT":"boolean"==typeof c.defaultValue?x=c.defaultValue?"true":"false":(x=String(c.defaultValue),("Integer"===c.type||"BigInt"===c.type)&&""!==x&&(p=!0))),_(p);let f=c.validate||{},g=c.type||"";if(v&&c.relType){if("BelongsTo"===c.relType)g="M2O";else if("HasOne"===c.relType)g="O2O";else if("BelongsToMany"===c.relType)g="M2M";else if("HasMany"===c.relType){if(c.polymorphic)g="M2A";else{let e=D(c.target);g=(null==e?void 0:null===(l=e.schema)||void 0===l?void 0:l.isJunction)?"M2M":"O2M"}}}y({name:j,type:g,allowNull:null===(s=c.allowNull)||void 0===s||s,hidden:null!==(t=c.hidden)&&void 0!==t&&t,defaultValue:x,values:o,stringLength:u,precision:h,scale:m,calculated:c.calculated||"",target:c.target||"",relType:c.relType||"",onDelete:c.onDelete||"CASCADE",onUpdate:c.onUpdate||"CASCADE",alias:c.alias||"",through:c.through||"",tables:c.tables||[],showAs:c.showAs||[],polymorphic:c.polymorphic||!1,constraints:c.constraints,description:c.description||"",validateMin:void 0!==f.min?String(f.min):"",validateMax:void 0!==f.max?String(f.max):"",validateIsInt:null!==(n=f.isInt)&&void 0!==n&&n,validateNotEmpty:null!==(i=f.notEmpty)&&void 0!==i&&i,validateIsEmail:null!==(r=f.isEmail)&&void 0!==r&&r,validateIsUrl:null!==(d=f.isUrl)&&void 0!==d&&d,validateMinLength:(null===(e=f.len)||void 0===e?void 0:e[0])!==void 0?String(f.len[0]):"",validateMaxLength:(null===(a=f.len)||void 0===a?void 0:a[1])!==void 0?String(f.len[1]):"",validatePattern:f.is||f.matches||""}),c.showAs&&Array.isArray(c.showAs)?C(c.showAs):C([])}else m&&!j&&(y({name:"",type:"",allowNull:!0,hidden:!1,defaultValue:"",values:[],stringLength:"",precision:"",scale:"",calculated:"",target:"",relType:"",onDelete:"CASCADE",onUpdate:"CASCADE",alias:"",through:"",tables:[],showAs:[],polymorphic:!1,description:"",validateMin:"",validateMax:"",validateIsInt:!1,validateNotEmpty:!1,validateIsEmail:!1,validateIsUrl:!1,validateMinLength:"",validateMaxLength:"",validatePattern:""}),C([]),_(!1))},[m,J,j]),(0,t.useEffect)(()=>{if(!ee&&v&&("M2M"===N.type||"M2A"===N.type)){let e="";"M2M"===N.type&&N.target&&N.name?e="".concat(p,"_").concat(N.target,"_").concat(N.name,"_junction"):"M2A"===N.type&&N.name&&(e="".concat(p,"_").concat(N.name,"_junction")),e&&(!N.through||N.through.endsWith("_junction"))&&y(a=>({...a,through:e}))}},[N.type,N.target,N.name,p,ee,v]);let el=()=>{var e;let a={name:N.name,type:N.type,target:N.target};("M2O"===N.type||"O2O"===N.type)&&(a.onDelete=N.onDelete,a.onUpdate=N.onUpdate),N.alias&&(a.alias=N.alias),N.through&&("M2M"===N.type||"M2A"===N.type)&&(a.through=N.through),(null===(e=N.tables)||void 0===e?void 0:e.length)&&(a.tables=N.tables),(null==b?void 0:b.length)>0&&(a.showAs=b),(j?K:Y)({resource:"relationships",meta:{collectionName:p},values:a,...j&&{id:j}},{onSuccess:()=>{d.Am.success("Relationship ".concat(j?"updated":"created"," successfully")),R(),x(),f()},onError:e=>{d.Am.error("Error ".concat(j?"updating":"creating"," relationship: ").concat(e.message))}})},es=e=>["Integer","BigInt","Decimal","Double","Real","Array_Integer","Array_BigInt","Array_Double","Array_Decimal","Range_Integer","Range_BigInt","Range_Double","Range_Decimal"].includes(e),et=e=>["String","Text","CiText"].includes(e),en=()=>{var e,a;let l=D(p),s={...null==l?void 0:null===(e=l.schema)||void 0===e?void 0:e.fields},t={type:N.type,allowNull:N.allowNull};if(N.hidden&&(t.hidden=!0),N.defaultValue&&("$NOW"===N.defaultValue?t.defaultValue={type:"NOW"}:"$UUIDV4"===N.defaultValue?t.defaultValue={type:"UUIDV4"}:"$SUID"===N.defaultValue?t.defaultValue={type:"SUID"}:"$AUTOINCREMENT"===N.defaultValue?t.defaultValue={type:"AUTOINCREMENT"}:"Boolean"===N.type?t.defaultValue="true"===N.defaultValue:"Integer"!==N.type&&"BigInt"!==N.type||isNaN(Number(N.defaultValue))?t.defaultValue=N.defaultValue:t.defaultValue=parseInt(N.defaultValue,10)),"ENUM"===N.type&&(null===(a=N.values)||void 0===a?void 0:a.length)>0&&(t.values=N.values),"VIRTUAL"===N.type&&N.calculated&&(t.calculated=N.calculated),"String"===N.type&&N.stringLength&&(t.values={stringLength:N.stringLength}),"Decimal"===N.type&&(N.precision||N.scale)){let e={};N.precision&&(e.precision=parseInt(N.precision,10)),N.scale&&(e.scale=parseInt(N.scale,10)),t.values=e}if(es(N.type)){let e={};""!==N.validateMin&&null!==N.validateMin&&void 0!==N.validateMin&&(e.min=parseFloat(N.validateMin)),""!==N.validateMax&&null!==N.validateMax&&void 0!==N.validateMax&&(e.max=parseFloat(N.validateMax)),N.validateIsInt&&(e.isInt=!0),Object.keys(e).length>0&&(t.validate=e)}if(et(N.type)){let e={};N.validateNotEmpty&&(e.notEmpty=!0),N.validateIsEmail&&(e.isEmail=!0),N.validateIsUrl&&(e.isUrl=!0);let a=""!==N.validateMinLength?parseInt(N.validateMinLength,10):null,l=""!==N.validateMaxLength?parseInt(N.validateMaxLength,10):null;(null!==a||null!==l)&&(e.len=[null!=a?a:0,null!=l?l:999999]),N.validatePattern&&(e.is=N.validatePattern),Object.keys(e).length>0&&(t.validate=e)}if(ee){let e={...s[j]};e.hidden&&!N.hidden&&delete e.hidden,e.validate&&!t.validate&&delete e.validate,s[j]={...e,...t}}else s[N.name]=t;K({resource:"collections",id:p,values:{schema:{...null==l?void 0:l.schema,fields:s}}},{onSuccess:()=>{d.Am.success("Field ".concat(ee?"updated":"added"," successfully")),R(),x(),f()},onError:e=>{d.Am.error("Error ".concat(ee?"updating":"adding"," field: ").concat(e.message))}})},ei=(e,a)=>{y(l=>({...l,[e]:a}))};return(0,s.jsx)(S.yo,{open:m,onOpenChange:e=>!e&&x(),children:(0,s.jsxs)(S.ue,{className:"!w-full sm:!w-[600px] overflow-y-auto",children:[(0,s.jsx)(S.Tu,{children:(0,s.jsxs)(S.bC,{children:[ee?"Edit":"Create"," ",v?"Relationship":"Field"]})}),(0,s.jsxs)("form",{onSubmit:e=>{if(e.preventDefault(),!N.name){d.Am.error("Please enter a field name");return}if(!N.type){d.Am.error("Please select a field type");return}v?el():en()},className:"mt-6 space-y-5",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"name",children:"Field Name"}),(0,s.jsx)(I.I,{id:"name",placeholder:"Enter field name",value:N.name,onChange:e=>ei("name",e.target.value),disabled:ee,required:!0})]}),v?(0,s.jsxs)(s.Fragment,{children:[ee&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Description"}),(0,s.jsx)(I.I,{value:N.description||"",disabled:!0})]}),!ee&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Relationship Type"}),(0,s.jsxs)(T.Ph,{value:N.type,onValueChange:e=>{ei("type",e),C([])},children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select relationship type"})}),(0,s.jsx)(T.Bw,{children:$.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))})]})]}),ee&&N.relType&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Relation Type"}),(0,s.jsxs)(T.Ph,{value:N.relType,disabled:!0,children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"BelongsTo",children:"BelongsTo"}),(0,s.jsx)(T.Ql,{value:"HasOne",children:"HasOne"}),(0,s.jsx)(T.Ql,{value:"HasMany",children:"HasMany"}),(0,s.jsx)(T.Ql,{value:"BelongsToMany",children:"BelongsToMany"})]})]})]}),"M2A"!==N.type&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Target Collection"}),(0,s.jsxs)(T.Ph,{value:N.target,onValueChange:e=>{ei("target",e),C([])},disabled:ee,children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select target collection"})}),(0,s.jsx)(T.Bw,{children:q.map(e=>(0,s.jsx)(T.Ql,{value:e.id,children:e.name},e.id))})]})]}),N.target&&"M2A"!==N.type&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(k._,{children:"Display Format"}),(0,s.jsx)(Z.pn,{children:(0,s.jsxs)(Z.u,{children:[(0,s.jsx)(Z.aJ,{asChild:!0,children:(0,s.jsx)(L.Z,{className:"h-3.5 w-3.5 text-muted-foreground cursor-help"})}),(0,s.jsx)(Z._v,{children:(0,s.jsx)("p",{children:"Select fields to display for this relationship"})})]})})]}),(0,s.jsxs)(z.J2,{children:[(0,s.jsx)(z.xo,{asChild:!0,children:(0,s.jsx)(o.z,{variant:"outline",role:"combobox",className:"w-full justify-start font-normal h-auto min-h-10",children:b.length>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:b.map((e,a)=>(0,s.jsxs)(h.C,{variant:"secondary",className:"mr-1",children:[e,(0,s.jsx)("button",{type:"button",className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:e=>{e.stopPropagation(),C(b.filter((e,l)=>l!==a))},children:(0,s.jsx)(V.Z,{className:"h-3 w-3"})})]},"".concat(e,"-").concat(a)))}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"Select fields to display..."})})}),(0,s.jsxs)(z.yk,{className:"w-[300px] p-0 overflow-hidden",align:"start",children:[(0,s.jsx)("div",{className:"px-2 py-1.5 border-b",children:(0,s.jsx)("div",{className:"text-sm font-medium",children:"Target Fields"})}),(0,s.jsx)("div",{className:"max-h-[200px] overflow-y-auto overflow-x-hidden p-1.5",style:{overscrollBehavior:"contain",touchAction:"pan-y",WebkitOverflowScrolling:"touch",willChange:"scroll-position",pointerEvents:"auto"},onWheel:e=>e.stopPropagation(),children:H.length>0?H.map(e=>(0,s.jsxs)("div",{className:"flex items-center space-x-2 py-1 px-2 hover:bg-muted rounded cursor-pointer",onClick:()=>{let a=e.value||e;b.includes(a)||C([...b,a])},children:[(0,s.jsx)(U.X,{checked:b.includes(e.value||e),onCheckedChange:a=>{let l=e.value||e;a?C([...b,l]):C(b.filter(e=>e!==l))}}),(0,s.jsx)("span",{className:"text-sm",children:e.title||e.value||e})]},e.value||e)):(0,s.jsx)("div",{className:"text-sm text-muted-foreground p-2",children:"No fields available"})}),(0,s.jsxs)("div",{className:"px-2 py-1.5 border-t",children:[(0,s.jsx)("div",{className:"text-xs font-medium mb-1",children:"Dividers"}),(0,s.jsx)("div",{className:"flex flex-wrap gap-0.5",children:Q.map(e=>(0,s.jsx)(o.z,{type:"button",variant:"outline",size:"sm",className:"h-6 px-2 text-xs",onClick:()=>{C([...b,e.value])},children:e.label},e.value))})]})]})]})]}),!ee&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"alias",children:"Target Alias (optional)"}),(0,s.jsx)(I.I,{id:"alias",placeholder:"Enter alias",value:N.alias,onChange:e=>ei("alias",e.target.value)})]}),!ee&&("M2M"===N.type||"M2A"===N.type)&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(k._,{htmlFor:"through",children:"Junction Table Name"}),(0,s.jsx)(Z.pn,{children:(0,s.jsxs)(Z.u,{children:[(0,s.jsx)(Z.aJ,{asChild:!0,children:(0,s.jsx)(L.Z,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),(0,s.jsx)(Z._v,{className:"max-w-xs",children:(0,s.jsx)("p",{children:"Name for the junction table. PostgreSQL limits table names to 63 characters. Modify if the auto-generated name is too long."})})]})})]}),(0,s.jsx)(I.I,{id:"through",placeholder:"Enter junction table name",value:N.through,onChange:e=>ei("through",e.target.value),maxLength:63,className:N.through&&N.through.length>63?"border-red-500":""}),(0,s.jsxs)("p",{className:(0,P.cn)("text-xs",(null===(a=N.through)||void 0===a?void 0:a.length)>63?"text-red-600":(null===(l=N.through)||void 0===l?void 0:l.length)>50?"text-amber-600":"text-muted-foreground"),children:[(null===(r=N.through)||void 0===r?void 0:r.length)||0,"/63 characters",(null===(c=N.through)||void 0===c?void 0:c.length)>63&&" - Name too long!"]})]}),("M2A"===N.type||N.polymorphic)&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Tables (for Many-to-Any)"}),(0,s.jsxs)(z.J2,{children:[(0,s.jsx)(z.xo,{asChild:!0,children:(0,s.jsx)(o.z,{variant:"outline",role:"combobox",className:"w-full justify-start font-normal h-auto min-h-10",children:(null===(u=N.tables)||void 0===u?void 0:u.length)>0?(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:N.tables.map(e=>(0,s.jsxs)(h.C,{variant:"secondary",className:"mr-1",children:[e,(0,s.jsx)("button",{type:"button",className:"ml-1 ring-offset-background rounded-full outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",onClick:a=>{a.stopPropagation(),ei("tables",N.tables.filter(a=>a!==e))},children:(0,s.jsx)(V.Z,{className:"h-3 w-3"})})]},e))}):(0,s.jsx)("span",{className:"text-muted-foreground",children:"Select tables..."})})}),(0,s.jsx)(z.yk,{className:"w-[300px] p-0",align:"start",children:(0,s.jsx)("div",{className:"max-h-[200px] overflow-y-auto p-2",children:q.map(e=>{var a;return(0,s.jsxs)("div",{className:"flex items-center space-x-2 py-1.5 px-2 hover:bg-muted rounded cursor-pointer",onClick:()=>{let a=N.tables||[];a.includes(e.id)||ei("tables",[...a,e.id])},children:[(0,s.jsx)(U.X,{checked:null===(a=N.tables)||void 0===a?void 0:a.includes(e.id),onCheckedChange:a=>{let l=N.tables||[];a?ei("tables",[...l,e.id]):ei("tables",l.filter(a=>a!==e.id))}}),(0,s.jsx)("span",{className:"text-sm",children:e.name})]},e.id)})})})]})]}),("M2O"===N.type||"O2O"===N.type)&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(k._,{className:"flex items-center gap-2",children:["On Delete",(0,s.jsx)(Z.pn,{children:(0,s.jsxs)(Z.u,{children:[(0,s.jsx)(Z.aJ,{asChild:!0,children:(0,s.jsx)(L.Z,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),(0,s.jsx)(Z._v,{side:"right",className:"max-w-xs",children:(0,s.jsxs)("p",{children:["Action when a record in ",(0,s.jsx)("strong",{children:N.target||"target"})," is deleted"]})})]})})]}),(0,s.jsxs)(T.Ph,{value:N.onDelete,onValueChange:e=>ei("onDelete",e),children:[(0,s.jsx)(T.i4,{className:"[&_span.text-muted-foreground]:hidden",children:(0,s.jsx)(T.ki,{})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"CASCADE",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"CASCADE"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Delete related records"})]})}),(0,s.jsx)(T.Ql,{value:"SET NULL",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"SET NULL"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Set reference to null"})]})}),(0,s.jsx)(T.Ql,{value:"RESTRICT",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"RESTRICT"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Prevent delete if referenced"})]})}),(0,s.jsx)(T.Ql,{value:"NO ACTION",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"NO ACTION"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Like RESTRICT, checked at end of transaction"})]})})]})]})]}),("M2O"===N.type||"O2O"===N.type)&&!1!==N.constraints&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(k._,{className:"flex items-center gap-2",children:["On Update",(0,s.jsx)(Z.pn,{children:(0,s.jsxs)(Z.u,{children:[(0,s.jsx)(Z.aJ,{asChild:!0,children:(0,s.jsx)(L.Z,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),(0,s.jsx)(Z._v,{side:"right",className:"max-w-xs",children:(0,s.jsxs)("p",{children:["Action when the primary key of ",(0,s.jsx)("strong",{children:N.target||"target"})," is updated"]})})]})})]}),(0,s.jsxs)(T.Ph,{value:N.onUpdate,onValueChange:e=>ei("onUpdate",e),children:[(0,s.jsx)(T.i4,{className:"[&_span.text-muted-foreground]:hidden",children:(0,s.jsx)(T.ki,{})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"CASCADE",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"CASCADE"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Update reference automatically"})]})}),(0,s.jsx)(T.Ql,{value:"SET NULL",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"SET NULL"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Set reference to null"})]})}),(0,s.jsx)(T.Ql,{value:"RESTRICT",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"RESTRICT"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Prevent update if referenced"})]})}),(0,s.jsx)(T.Ql,{value:"NO ACTION",children:(0,s.jsxs)("div",{className:"flex flex-col items-start",children:[(0,s.jsx)("span",{children:"NO ACTION"}),(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"Like RESTRICT, checked at end of transaction"})]})})]})]})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Field Type"}),(0,s.jsxs)(T.Ph,{value:N.type,onValueChange:e=>ei("type",e),disabled:ee,children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select field type"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Text Types"}),B.text.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]}),(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Numeric Types"}),B.numeric.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]}),(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Date Types"}),B.date.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]}),(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Other Types"}),B.other.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]}),(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Array Types"}),B.array.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]}),(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Range Types"}),B.range.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]}),(0,s.jsxs)(T.DI,{children:[(0,s.jsx)(T.n5,{children:"Geo Types"}),B.geo.map(e=>(0,s.jsx)(T.Ql,{value:e.value,children:e.label},e.value))]})]})]})]}),"VIRTUAL"===N.type?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"calculated",children:"Calculation String"}),(0,s.jsx)(O.g,{id:"calculated",placeholder:"${this.firstName} ${this.lastName}",value:N.calculated,onChange:e=>ei("calculated",e.target.value)}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Use $","{this.fieldName}"," syntax to reference other fields"]})]}):"ENUM"===N.type?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Enum Values"}),(0,s.jsx)(F.OF,{value:N.values||[],onChange:e=>ei("values",e),itemType:"string",placeholder:"Type a value and press Enter"})]}):"String"===N.type?(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"stringLength",children:"Maximum Length"}),(0,s.jsx)(I.I,{id:"stringLength",type:"number",placeholder:"255",value:N.stringLength||"",onChange:e=>ei("stringLength",e.target.value)})]}):"Decimal"===N.type?(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"precision",children:"Precision (Total Digits)"}),(0,s.jsx)(I.I,{id:"precision",type:"number",placeholder:"e.g., 10",value:N.precision||"",onChange:e=>ei("precision",e.target.value)}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Total number of digits (before and after decimal point)"})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"scale",children:"Scale (Decimal Places)"}),(0,s.jsx)(I.I,{id:"scale",type:"number",placeholder:"e.g., 2",value:N.scale||"",onChange:e=>ei("scale",e.target.value)}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Number of digits after the decimal point"})]})]}):null,(0,s.jsxs)(s.Fragment,{children:[(()=>{if(!es(N.type))return null;let e=["Integer","BigInt","Array_Integer","Array_BigInt","Range_Integer","Range_BigInt"].includes(N.type),a=N.type.startsWith("Range_"),l=N.type.startsWith("Array_");return(0,s.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(k._,{className:"text-sm font-medium",children:"Validation Rules"}),(0,s.jsx)(Z.pn,{children:(0,s.jsxs)(Z.u,{children:[(0,s.jsx)(Z.aJ,{asChild:!0,children:(0,s.jsx)(L.Z,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),(0,s.jsx)(Z._v,{className:"max-w-xs",children:(0,s.jsx)("p",{children:a?"Min/max values apply to both lower and upper bounds of the range.":l?"Min/max values apply to each element in the array.":"Set minimum and maximum allowed values for this field."})})]})})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"validateMin",children:"Minimum Value"}),(0,s.jsx)(I.I,{id:"validateMin",type:"number",step:e?"1":"any",placeholder:"No minimum",value:N.validateMin,onChange:e=>ei("validateMin",e.target.value)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"validateMax",children:"Maximum Value"}),(0,s.jsx)(I.I,{id:"validateMax",type:"number",step:e?"1":"any",placeholder:"No maximum",value:N.validateMax,onChange:e=>ei("validateMax",e.target.value)})]})]}),!e&&(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(U.X,{id:"validateIsInt",checked:N.validateIsInt,onCheckedChange:e=>ei("validateIsInt",!0===e)}),(0,s.jsx)(k._,{htmlFor:"validateIsInt",className:"text-sm font-normal cursor-pointer",children:"Require integer values (no decimals)"})]})]})})(),et(N.type)?(0,s.jsxs)("div",{className:"space-y-4 pt-4 border-t",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(k._,{className:"text-sm font-medium",children:"Validation Rules"}),(0,s.jsx)(Z.pn,{children:(0,s.jsxs)(Z.u,{children:[(0,s.jsx)(Z.aJ,{asChild:!0,children:(0,s.jsx)(L.Z,{className:"h-4 w-4 text-muted-foreground cursor-help"})}),(0,s.jsx)(Z._v,{className:"max-w-xs",children:(0,s.jsx)("p",{children:"Configure validation rules for string content and format."})})]})})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{className:"text-sm text-muted-foreground",children:"Format Validation"}),(0,s.jsxs)(T.Ph,{value:N.validateIsEmail?"email":N.validateIsUrl?"url":N.validateNotEmpty?"notEmpty":"none",onValueChange:e=>{ei("validateNotEmpty","notEmpty"===e),ei("validateIsEmail","email"===e),ei("validateIsUrl","url"===e)},children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"No format validation"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"none",children:"No format validation"}),(0,s.jsx)(T.Ql,{value:"notEmpty",children:"Required (cannot be empty)"}),(0,s.jsx)(T.Ql,{value:"email",children:"Must be valid email format"}),(0,s.jsx)(T.Ql,{value:"url",children:"Must be valid URL format"})]})]})]}),(0,s.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"validateMinLength",children:"Min Length"}),(0,s.jsx)(I.I,{id:"validateMinLength",type:"number",min:"0",placeholder:"No minimum",value:N.validateMinLength,onChange:e=>ei("validateMinLength",e.target.value)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"validateMaxLength",children:"Max Length"}),(0,s.jsx)(I.I,{id:"validateMaxLength",type:"number",min:"0",placeholder:"No maximum",value:N.validateMaxLength,onChange:e=>ei("validateMaxLength",e.target.value)})]})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"validatePattern",children:"Regex Pattern"}),(0,s.jsx)(I.I,{id:"validatePattern",placeholder:"e.g., ^[A-Z]{2}\\\\d{4}$",value:N.validatePattern,onChange:e=>ei("validatePattern",e.target.value)}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Regular expression pattern the value must match"})]})]}):null]}),"VIRTUAL"!==N.type&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Nullable"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Allow null values for this field"})]}),(0,s.jsx)(A.r,{checked:N.allowNull,onCheckedChange:e=>ei("allowNull",e)})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Hidden"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Never return this field in API responses (for sensitive data like passwords)"})]}),(0,s.jsx)(A.r,{checked:N.hidden,onCheckedChange:e=>ei("hidden",e)})]}),"VIRTUAL"!==N.type&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"defaultValue",children:"Default Value"}),W(N.type)?(0,s.jsxs)(T.Ph,{value:N.defaultValue||"_none_",onValueChange:e=>ei("defaultValue","_none_"===e?"":e),children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select default value"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"_none_",children:"No default"}),(0,s.jsx)(T.Ql,{value:"$NOW",children:"Current Date/Time"})]})]}):"UUID"===N.type?(0,s.jsxs)(T.Ph,{value:N.defaultValue||"_none_",onValueChange:e=>ei("defaultValue","_none_"===e?"":e),children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select default value"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"_none_",children:"No default"}),(0,s.jsx)(T.Ql,{value:"$UUIDV4",children:"Auto-generate UUID"})]})]}):"SUID"===N.type?(0,s.jsxs)(T.Ph,{value:N.defaultValue||"_none_",onValueChange:e=>ei("defaultValue","_none_"===e?"":e),children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select default value"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"_none_",children:"No default"}),(0,s.jsx)(T.Ql,{value:"$SUID",children:"Auto-generate Short UID"})]})]}):"Boolean"===N.type?(0,s.jsxs)(T.Ph,{value:""===N.defaultValue?"_none_":N.defaultValue,onValueChange:e=>ei("defaultValue","_none_"===e?"":e),children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select default value"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"_none_",children:"No default"}),(0,s.jsx)(T.Ql,{value:"true",children:"True"}),(0,s.jsx)(T.Ql,{value:"false",children:"False"})]})]}):"Integer"===N.type||"BigInt"===N.type?(0,s.jsxs)(T.Ph,{value:w?"$CUSTOM":N.defaultValue||"_none_",onValueChange:e=>{"$CUSTOM"===e?(_(!0),ei("defaultValue","")):(_(!1),ei("defaultValue","_none_"===e?"":e))},children:[(0,s.jsx)(T.i4,{children:(0,s.jsx)(T.ki,{placeholder:"Select default value"})}),(0,s.jsxs)(T.Bw,{children:[(0,s.jsx)(T.Ql,{value:"_none_",children:"No default"}),(0,s.jsx)(T.Ql,{value:"$AUTOINCREMENT",children:"Auto-increment"}),(0,s.jsx)(T.Ql,{value:"$CUSTOM",children:"Custom value..."})]})]}):(0,s.jsx)(I.I,{id:"defaultValue",placeholder:"Enter default value",value:N.defaultValue,onChange:e=>ei("defaultValue",e.target.value)}),("Integer"===N.type||"BigInt"===N.type)&&w&&(0,s.jsx)(I.I,{id:"defaultValueCustom",type:"number",placeholder:"Enter numeric default value",className:"mt-2",value:N.defaultValue,onChange:e=>{ei("defaultValue",e.target.value)}})]})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-4",children:[(0,s.jsx)(o.z,{type:"button",variant:"outline",onClick:x,children:"Cancel"}),(0,s.jsxs)(o.z,{type:"submit",disabled:ea,children:[ea&&(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}),ee?"Update":"Create"," ",v?"Relationship":"Field"]})]})]})]})})},q=e=>{var a,l;let{open:r,onClose:c,collectionName:u,onSuccess:p}=e,[v,f]=(0,t.useState)(!1),[N,y]=(0,t.useState)(null),[b,C]=(0,t.useState)(!1),[k,A]=(0,t.useState)([]),[T,_]=(0,t.useState)(!1),[D,O]=(0,t.useState)(null),[U,L]=(0,t.useState)(""),{getSchemaByName:V,isLoading:Z,refetch:z}=(0,i.I_)(),P=(0,t.useMemo)(()=>r&&u?{data:V(u)}:null,[r,u,V]),F=(0,t.useMemo)(()=>k.filter(e=>e.name.toLowerCase().includes(U.toLowerCase())),[k,U]),{mutate:Q,isLoading:B}=(0,n.PQ)(),{mutate:$,isLoading:W}=(0,n.R2)();(0,t.useEffect)(()=>{var e,a;(null==P?void 0:null===(a=P.data)||void 0===a?void 0:null===(e=a.schema)||void 0===e?void 0:e.fields)&&A(Object.entries(P.data.schema.fields).map(e=>{let[a,l]=e;return{name:a,...l}}))},[P]);let q=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];y(null),C(e),f(!0)},H=e=>{let a=k.find(a=>a.name===e);y(e),C(!!(null==a?void 0:a.relType)),f(!0)},K=e=>{O(e),_(!0)},X=e=>e.relType?(0,s.jsxs)(h.C,{variant:"outline",className:"gap-1",children:[(0,s.jsx)(M,{className:"h-3 w-3"}),e.relType]}):(0,s.jsx)(h.C,{variant:"secondary",children:e.type});return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(S.yo,{open:r,onOpenChange:e=>!e&&c(),children:(0,s.jsx)(S.ue,{className:"!w-full sm:!w-[800px] flex flex-col overflow-hidden p-0",children:(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden p-6",children:[(0,s.jsx)(S.Tu,{children:(0,s.jsxs)(S.bC,{className:"truncate max-w-[250px] sm:max-w-full",children:["Manage Fields - ",null==P?void 0:null===(l=P.data)||void 0===l?void 0:null===(a=l.schema)||void 0===a?void 0:a.name]})}),(0,s.jsxs)("div",{className:"mt-6 space-y-4 flex-1 flex flex-col min-h-0",children:[(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap justify-between items-center",children:[(0,s.jsxs)("div",{className:"flex gap-2 flex-wrap",children:[(0,s.jsxs)(o.z,{onClick:()=>q(!1),size:"sm",children:[(0,s.jsx)(j.Z,{className:"mr-2 h-4 w-4"}),"Add Field"]}),(0,s.jsxs)(o.z,{variant:"outline",size:"sm",onClick:()=>q(!0),children:[(0,s.jsx)(M,{className:"mr-2 h-4 w-4"}),"Add Relationship"]})]}),(0,s.jsxs)("div",{className:"relative w-full sm:w-auto",children:[(0,s.jsx)(E.Z,{className:"absolute left-2.5 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),(0,s.jsx)(I.I,{placeholder:"Search fields...",value:U,onChange:e=>L(e.target.value),className:"pl-8 h-9 w-full sm:w-[200px]"})]})]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto",children:(0,s.jsx)("div",{className:"min-w-[500px]",children:(0,s.jsxs)(m.iA,{children:[(0,s.jsx)(m.xD,{children:(0,s.jsxs)(m.SC,{children:[(0,s.jsx)(m.ss,{children:"Name"}),(0,s.jsx)(m.ss,{children:"Type"}),(0,s.jsx)(m.ss,{children:"Nullable"}),(0,s.jsx)(m.ss,{className:"w-28",children:"Actions"})]})}),(0,s.jsx)(m.RM,{children:Z?(0,s.jsx)(m.SC,{children:(0,s.jsx)(m.pj,{colSpan:4,className:"h-32 text-center",children:(0,s.jsx)(g.Z,{className:"h-6 w-6 animate-spin mx-auto"})})}):0===k.length?(0,s.jsx)(m.SC,{children:(0,s.jsx)(m.pj,{colSpan:4,className:"h-32 text-center text-muted-foreground",children:"No fields defined"})}):0===F.length?(0,s.jsx)(m.SC,{children:(0,s.jsx)(m.pj,{colSpan:4,className:"h-32 text-center text-muted-foreground",children:"No fields match your search"})}):F.map(e=>(0,s.jsxs)(m.SC,{children:[(0,s.jsx)(m.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name}),e.primaryKey&&(0,s.jsx)(h.C,{variant:"default",className:"text-xs",children:"PK"}),e.SystemGenerated&&(0,s.jsx)(h.C,{variant:"outline",className:"text-xs",children:"System"})]})}),(0,s.jsx)(m.pj,{children:X(e)}),(0,s.jsx)(m.pj,{children:e.allowNull?(0,s.jsx)(h.C,{variant:"outline",children:"Yes"}):(0,s.jsx)(h.C,{variant:"secondary",children:"No"})}),(0,s.jsx)(m.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(o.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>H(e.name),children:(0,s.jsx)(R.Z,{className:"h-4 w-4"})}),!e.SystemGenerated&&!e.primaryKey&&(0,s.jsx)(o.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>K(e),children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})]})})]},e.name))})]})})})]})]})})}),(0,s.jsx)(J,{open:v,onClose:()=>f(!1),collectionName:u,fieldName:N,isRelationship:b,onSuccess:()=>{f(!1),z(),p()}}),(0,s.jsx)(x.aR,{open:T,onOpenChange:_,children:(0,s.jsxs)(x._T,{children:[(0,s.jsxs)(x.fY,{children:[(0,s.jsx)(x.f$,{children:"Delete Field"}),(0,s.jsxs)(x.yT,{children:['Are you sure you want to delete the field "',null==D?void 0:D.name,'"? This action cannot be undone.']})]}),(0,s.jsxs)(x.xo,{children:[(0,s.jsx)(x.le,{children:"Cancel"}),(0,s.jsxs)(x.OL,{onClick:()=>{var e;if(!D)return;let a=V(u);if(!(null==a?void 0:null===(e=a.schema)||void 0===e?void 0:e.fields)||0===Object.keys(a.schema.fields).length){d.Am.error("Unable to get current schema data");return}if(D.relType)$({resource:"relationships",meta:{collectionName:u},id:D.name},{onSuccess:()=>{d.Am.success("Field deleted successfully"),z(),_(!1),O(null)},onError:e=>{d.Am.error("Error deleting field: ".concat(e.message))}});else{let e={...a.schema.fields};delete e[D.name],Q({resource:"collections",id:u,values:{schema:{...a.schema,fields:e}}},{onSuccess:()=>{d.Am.success("Field deleted successfully"),z(),p(),_(!1),O(null)},onError:e=>{d.Am.error("Error deleting field: ".concat(e.message))}})}},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[W||B?(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})};var H=l(74291);let K=e=>{var a,l;let{open:r,onClose:c,collectionName:u}=e,[p,v]=(0,t.useState)(!1),[f,N]=(0,t.useState)(""),[y,C]=(0,t.useState)([]),[A,T]=(0,t.useState)(!1),[_,D]=(0,t.useState)(!1),[M,E]=(0,t.useState)(!1),[R,O]=(0,t.useState)(null),[L,V]=(0,t.useState)([]),{getSchemaByName:Z,isLoading:z,refetch:P}=(0,i.I_)(),F=(0,t.useMemo)(()=>r&&u?{data:Z(u)}:null,[r,u,Z]),Q=(0,t.useMemo)(()=>{var e,a;return(null==F?void 0:null===(a=F.data)||void 0===a?void 0:null===(e=a.schema)||void 0===e?void 0:e.fields)?Object.keys(F.data.schema.fields):[]},[F]);(0,t.useEffect)(()=>{var e,a;(null==F?void 0:null===(a=F.data)||void 0===a?void 0:null===(e=a.schema)||void 0===e?void 0:e.indexes)?V(F.data.schema.indexes):V([])},[F]);let{mutate:B,isLoading:$}=(0,n.RO)(),{mutate:W,isLoading:J}=(0,n.R2)(),q=()=>{N(""),C([]),T(!1),D(!1)},K=()=>{P()},X=e=>{O(e),E(!0)},Y=e=>{y.includes(e)?C(y.filter(a=>a!==e)):C([...y,e])};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(S.yo,{open:r,onOpenChange:e=>!e&&c(),children:(0,s.jsx)(S.ue,{className:"!w-full sm:!w-[700px] flex flex-col overflow-hidden p-0",children:(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden p-6",children:[(0,s.jsx)(S.Tu,{children:(0,s.jsxs)(S.bC,{className:"truncate max-w-[250px] sm:max-w-full",children:["Manage Indexes - ",null==F?void 0:null===(l=F.data)||void 0===l?void 0:null===(a=l.schema)||void 0===a?void 0:a.name]})}),(0,s.jsxs)("div",{className:"mt-6 space-y-4 flex-1 flex flex-col min-h-0",children:[(0,s.jsxs)(o.z,{onClick:()=>v(!0),size:"sm",children:[(0,s.jsx)(j.Z,{className:"mr-2 h-4 w-4"}),"Add Index"]}),(0,s.jsx)("div",{className:"flex-1 overflow-auto",children:(0,s.jsx)("div",{className:"min-w-[450px]",children:(0,s.jsxs)(m.iA,{children:[(0,s.jsx)(m.xD,{children:(0,s.jsxs)(m.SC,{children:[(0,s.jsx)(m.ss,{children:"Name"}),(0,s.jsx)(m.ss,{children:"Fields"}),(0,s.jsx)(m.ss,{children:"Type"}),(0,s.jsx)(m.ss,{className:"w-20",children:"Actions"})]})}),(0,s.jsx)(m.RM,{children:z?(0,s.jsx)(m.SC,{children:(0,s.jsx)(m.pj,{colSpan:4,className:"h-32 text-center",children:(0,s.jsx)(g.Z,{className:"h-6 w-6 animate-spin mx-auto"})})}):0===L.length?(0,s.jsx)(m.SC,{children:(0,s.jsxs)(m.pj,{colSpan:4,className:"h-32 text-center text-muted-foreground",children:[(0,s.jsx)(b.Z,{className:"h-8 w-8 mx-auto mb-2 opacity-50"}),(0,s.jsx)("p",{children:"No indexes defined"})]})}):L.map(e=>(0,s.jsxs)(m.SC,{children:[(0,s.jsx)(m.pj,{className:"font-medium",children:e.name||e.id}),(0,s.jsx)(m.pj,{children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1",children:(e.fields||[]).map(e=>(0,s.jsx)(h.C,{variant:"secondary",children:e},e))})}),(0,s.jsx)(m.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-1 flex-wrap",children:[e.unique?(0,s.jsx)(h.C,{variant:"default",children:"Unique"}):(0,s.jsx)(h.C,{variant:"outline",children:"Standard"}),e.nullsNotDistinct&&(0,s.jsx)(h.C,{variant:"secondary",className:"text-xs",children:"NULLS NOT DISTINCT"})]})}),(0,s.jsx)(m.pj,{children:(0,s.jsx)(o.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>X(e.name||e.id),children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})})]},e.name||e.id))})]})})})]})]})})}),(0,s.jsx)(H.Vq,{open:p,onOpenChange:v,children:(0,s.jsxs)(H.cZ,{children:[(0,s.jsx)(H.fK,{children:(0,s.jsx)(H.$N,{children:"Create Index"})}),(0,s.jsxs)("div",{className:"space-y-4 py-4",children:[(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{htmlFor:"indexName",children:"Index Name"}),(0,s.jsx)(I.I,{id:"indexName",placeholder:"Enter index name",value:f,onChange:e=>N(e.target.value)})]}),(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsx)(k._,{children:"Select Fields"}),(0,s.jsx)("div",{className:"border rounded-md p-3 space-y-2 max-h-48 overflow-y-auto",children:Q.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(U.X,{id:e,checked:y.includes(e),onCheckedChange:()=>Y(e)}),(0,s.jsx)(k._,{htmlFor:e,className:"cursor-pointer",children:e})]},e))})]}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(U.X,{id:"unique",checked:A,onCheckedChange:e=>{T(e),e||D(!1)}}),(0,s.jsx)(k._,{htmlFor:"unique",className:"cursor-pointer",children:"Unique Index"})]}),A&&(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(U.X,{id:"nullsNotDistinct",checked:_,onCheckedChange:e=>D(e)}),(0,s.jsxs)(k._,{htmlFor:"nullsNotDistinct",className:"cursor-pointer flex items-center gap-1",children:["Nulls Not Distinct",(0,s.jsx)("span",{className:"text-xs text-muted-foreground",children:"(treat NULLs as equal)"})]})]})]}),(0,s.jsxs)(H.cN,{children:[(0,s.jsx)(o.z,{variant:"outline",onClick:()=>{q(),v(!1)},children:"Cancel"}),(0,s.jsxs)(o.z,{onClick:()=>{if(!f.trim()){d.Am.error("Please enter an index name");return}if(0===y.length){d.Am.error("Please select at least one field");return}B({resource:"indexes",meta:{collectionName:u},values:{name:f,fields:y,unique:A,...A&&_?{nullsNotDistinct:!0}:{}}},{onSuccess:()=>{d.Am.success("Index created successfully"),q(),v(!1),K()},onError:e=>{d.Am.error("Error creating index: ".concat(e.message))}})},disabled:$,children:[$&&(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Create Index"]})]})]})}),(0,s.jsx)(x.aR,{open:M,onOpenChange:E,children:(0,s.jsxs)(x._T,{children:[(0,s.jsxs)(x.fY,{children:[(0,s.jsx)(x.f$,{children:"Delete Index"}),(0,s.jsxs)(x.yT,{children:['Are you sure you want to delete the index "',R,'"? This action cannot be undone.']})]}),(0,s.jsxs)(x.xo,{children:[(0,s.jsx)(x.le,{children:"Cancel"}),(0,s.jsxs)(x.OL,{onClick:()=>{R&&W({resource:"indexes",meta:{collectionName:u},id:R},{onSuccess:()=>{d.Am.success("Index deleted successfully"),E(!1),O(null),K()},onError:e=>{d.Am.error("Error deleting index: ".concat(e.message))}})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[J?(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})};var X=l(95937),Y=l(90641),G=l(8227),ee=l(40875),ea=l(10407);let el=(0,D.Z)("Radio",[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]]);var es=l(41671);let et=e=>{if(!e)return"disabled";if(!0===e)return"enabled (all actions)";if("object"==typeof e){if(!e.enabled)return"disabled";let a=e.actions||["insert","update","delete"];return"enabled (".concat(a.join(", "),")")}return"disabled"},en=e=>{let{open:a,onClose:l}=e,[r,c]=(0,t.useState)(null),[u,m]=(0,t.useState)(null),[x,p]=(0,t.useState)(["new","modified","deleted"]),[f,N]=(0,t.useState)(!1),y=(0,t.useRef)(null),b=(0,n.Ji)(),{refetch:C}=(0,i.I_)(),{mutate:I,isLoading:k}=(0,n.uC)(),{mutate:A,isLoading:T}=(0,n.uC)(),_=()=>{c(null),m(null),y.current&&(y.current.value="")},D=async e=>{if(!e||!e.name.endsWith(".json")){d.Am.error("Please select a valid JSON file");return}c(e),m(null);let a=new FormData;a.append("schema",e),I({url:"".concat(b,"/schemas-preview-import"),method:"post",values:a},{onSuccess:e=>{m(null==e?void 0:e.data)},onError:e=>{d.Am.error("Preview failed: ".concat(e.message||"Unknown error")),m(null)}})},M=async()=>{if(!r)return;let e=new FormData;e.append("schema",r),A({url:"".concat(b,"/schemas-import"),method:"post",values:e},{onSuccess:()=>{d.Am.success("Schemas imported successfully"),C(),_(),l()},onError:e=>{d.Am.error("Import failed: ".concat(e.message||"Unknown error"))}})},E=e=>{p(a=>a.includes(e)?a.filter(a=>a!==e):[...a,e])},O=function(e,a,l,t){let n=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"default";if(!e||0===e.length)return null;let i=x.includes(t);return(0,s.jsxs)(G.zF,{open:i,onOpenChange:()=>E(t),children:[(0,s.jsxs)(G.wy,{className:"flex items-center justify-between w-full p-3 bg-muted/50 rounded-lg hover:bg-muted transition-colors",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[a,(0,s.jsx)("span",{className:"font-medium",children:l}),(0,s.jsx)(h.C,{variant:n,children:e.length})]}),i?(0,s.jsx)(ee.Z,{className:"h-4 w-4"}):(0,s.jsx)(ea.Z,{className:"h-4 w-4"})]}),(0,s.jsx)(G.Fw,{children:(0,s.jsx)("div",{className:"mt-2 space-y-2 pl-4",children:e.map((e,l)=>(0,s.jsxs)("div",{className:"p-2 rounded border bg-background",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[a,(0,s.jsx)("span",{children:"string"==typeof e?e:e.collectionName}),e.differences&&Object.keys(e.differences).length>0&&(0,s.jsxs)(h.C,{variant:"outline",className:"ml-auto",children:[Object.keys(e.differences).length," change(s)"]})]}),e.differences&&Object.keys(e.differences).length>0&&(0,s.jsx)("div",{className:"mt-2 pl-6 text-xs space-y-1",children:Object.entries(e.differences).map(e=>{let[a,l]=e;return(0,s.jsx)("div",{className:"flex items-start gap-2 text-muted-foreground",children:"realtime"===a?(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(el,{className:"h-3 w-3"}),(0,s.jsx)("span",{className:"font-medium",children:"Realtime:"}),(0,s.jsx)("span",{className:"text-red-500 line-through",children:et(l.from)}),(0,s.jsx)("span",{children:"→"}),(0,s.jsx)("span",{className:"text-green-500",children:et(l.to)})]}):(0,s.jsxs)("span",{children:[(0,s.jsxs)("span",{className:"font-medium",children:[a,":"]})," ","added"===l.type&&(0,s.jsx)("span",{className:"text-green-500",children:"added"}),"removed"===l.type&&(0,s.jsx)("span",{className:"text-red-500",children:"removed"}),"modified"===l.type&&(0,s.jsx)("span",{className:"text-yellow-500",children:"modified"})]})},a)})})]},l))})})]})},U=u&&(u.changes.new.length>0||u.changes.modified.length>0||u.changes.deleted.length>0);return(0,s.jsx)(S.yo,{open:a,onOpenChange:e=>{e||(_(),l())},children:(0,s.jsxs)(S.ue,{className:"w-[600px] sm:w-[700px] sm:max-w-[700px] flex flex-col",children:[(0,s.jsx)(S.Tu,{children:(0,s.jsx)(S.bC,{children:"Import Schema"})}),(0,s.jsxs)("div",{className:"flex-1 overflow-hidden flex flex-col mt-6",children:[(0,s.jsxs)("div",{className:"border-2 border-dashed rounded-lg p-8 text-center cursor-pointer transition-colors flex-shrink-0 ".concat(f?"border-primary bg-primary/5":"hover:border-primary"),onClick:()=>{var e;return null===(e=y.current)||void 0===e?void 0:e.click()},onDragOver:e=>{e.preventDefault(),N(!0)},onDragLeave:e=>{e.preventDefault(),N(!1)},onDrop:e=>{e.preventDefault(),N(!1);let a=e.dataTransfer.files[0];a&&D(a)},children:[(0,s.jsx)(v.Z,{className:"h-10 w-10 mx-auto mb-4 text-muted-foreground"}),r?(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:r.name}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground",children:"Click or drag to select a different file"})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"font-medium",children:"Click or drag schema file to upload"}),(0,s.jsx)("p",{className:"text-sm text-muted-foreground mt-1",children:"Support for single JSON file upload only"})]}),(0,s.jsx)("input",{ref:y,type:"file",accept:".json",className:"hidden",onChange:e=>{var a;let l=null===(a=e.target.files)||void 0===a?void 0:a[0];l&&D(l)}})]}),k&&(0,s.jsxs)("div",{className:"flex items-center justify-center py-8",children:[(0,s.jsx)(g.Z,{className:"h-6 w-6 animate-spin mr-2"}),(0,s.jsx)("span",{children:"Analyzing schema changes..."})]}),u&&(0,s.jsx)(Y.x,{className:"flex-1 mt-4",children:(0,s.jsxs)("div",{className:"space-y-4 pr-4",children:[(0,s.jsxs)(X.bZ,{children:[(0,s.jsx)(L.Z,{className:"h-4 w-4"}),(0,s.jsx)(X.Cd,{children:"Schema Analysis Complete"}),(0,s.jsxs)(X.X,{children:["Import version: ",u.importVersion," (",u.importTimestamp,")"]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:[O(u.changes.new,(0,s.jsx)(j.Z,{className:"h-4 w-4 text-green-500"}),"New Schemas","new","default"),O(u.changes.modified,(0,s.jsx)(R.Z,{className:"h-4 w-4 text-yellow-500"}),"Modified Schemas","modified","secondary"),O(u.changes.deleted,(0,s.jsx)(w.Z,{className:"h-4 w-4 text-red-500"}),"Deleted Schemas","deleted","destructive"),O(u.changes.unchanged,(0,s.jsx)(es.Z,{className:"h-4 w-4 text-green-500"}),"Unchanged Schemas","unchanged","outline")]}),!U&&(0,s.jsxs)(X.bZ,{children:[(0,s.jsx)(es.Z,{className:"h-4 w-4"}),(0,s.jsx)(X.X,{children:"No changes detected. All schemas are already up to date."})]})]})})]}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t mt-4 flex-shrink-0",children:[(0,s.jsx)(o.z,{variant:"outline",onClick:()=>{_(),l()},children:"Cancel"}),u&&(0,s.jsxs)(o.z,{onClick:M,disabled:T,children:[T&&(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Confirm Import"]})]})]})})};var ei=l(31593);let er=e=>{let{open:a,onClose:l,onSuccess:c,schema:u,collectionName:h}=e,[m,x]=(0,t.useState)(!1),[p,j]=(0,t.useState)(!1),[v,f]=(0,t.useState)(!1),[N,y]=(0,t.useState)(!1),[b,w]=(0,t.useState)(!0),[I,T]=(0,t.useState)(!1),[_,D]=(0,t.useState)(["insert","update","delete"]),{getSchemaByName:M,refetch:E}=(0,i.I_)(),{mutate:R,isLoading:O}=(0,n.PQ)(),{isMultiTenant:L}=(0,r.PY)(),V=a?M(h):null,Z=(null==V?void 0:V.schema)||u;(0,t.useEffect)(()=>{if(a&&Z){let e=!0===Z.timestamps,a=!0===Z.usertrack,l=!0===Z.paranoid,s=!0===Z.sortEnabled,t=!1!==Z.tenantScoped,n=!1,i=["insert","update","delete"];!0===Z.realtime?n=!0:"object"==typeof Z.realtime&&null!==Z.realtime&&(n=!0===Z.realtime.enabled,i=Z.realtime.actions||["insert","update","delete"]),console.log("Schema settings loaded:",{collectionName:h,timestamps:Z.timestamps,usertrack:Z.usertrack,paranoid:Z.paranoid,sortEnabled:Z.sortEnabled,tenantScoped:Z.tenantScoped,realtime:Z.realtime,parsed:{ts:e,ut:a,pn:l,se:s,tsc:t,rtEnabled:n,rtActions:i}}),x(e),j(a),f(l),y(s),w(t),T(n),D(i)}},[a,h,Z]);let z=(e,a)=>{a?D(a=>[...a,e]):D(a=>a.filter(a=>a!==e))};return(0,s.jsx)(S.yo,{open:a,onOpenChange:e=>!e&&l(),children:(0,s.jsx)(S.ue,{className:"!w-full sm:!w-[500px] flex flex-col overflow-hidden p-0",children:(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden p-6",children:[(0,s.jsx)(S.Tu,{className:"flex-shrink-0",children:(0,s.jsxs)(S.bC,{className:"flex items-center gap-2",children:[(0,s.jsx)(C.Z,{className:"h-5 w-5 flex-shrink-0"}),"Schema Settings"]})}),(0,s.jsx)(Y.x,{className:"flex-1 mt-6",children:(0,s.jsxs)("div",{className:"space-y-6 pr-4",children:[(0,s.jsxs)("div",{className:"p-4 rounded-lg bg-muted",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate max-w-[250px] sm:max-w-[400px]",title:null==Z?void 0:Z.name,children:null==Z?void 0:Z.name}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground truncate max-w-[250px] sm:max-w-[400px]",title:h,children:["Collection: ",h]})]}),(0,s.jsx)(ei.Z,{}),(0,s.jsxs)("div",{className:"space-y-6",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Timestamps"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Add createdAt and updatedAt fields automatically"})]}),(0,s.jsx)(A.r,{checked:m,onCheckedChange:x})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"User Tracking"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Track who created and modified records"})]}),(0,s.jsx)(A.r,{checked:p,onCheckedChange:j})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Sorting"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Enable sorting capabilities for this collection"})]}),(0,s.jsx)(A.r,{checked:N,onCheckedChange:y})]}),(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Soft Delete"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Mark records as deleted instead of removing them"}),(null==Z?void 0:Z.paranoid)&&(0,s.jsx)("p",{className:"text-xs text-amber-600",children:"⚠️ Cannot be disabled once enabled"})]}),(0,s.jsx)(A.r,{checked:v,onCheckedChange:f,disabled:null==Z?void 0:Z.paranoid})]}),L&&(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsx)(k._,{children:"Tenant Scoped"}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Restrict reads/writes to current tenant context"})]}),(0,s.jsx)(A.r,{checked:b,onCheckedChange:w})]}),(0,s.jsx)(ei.Z,{}),(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsxs)("div",{className:"space-y-0.5",children:[(0,s.jsxs)(k._,{className:"flex items-center gap-2",children:[(0,s.jsx)(el,{className:"h-4 w-4"}),"Realtime"]}),(0,s.jsx)("p",{className:"text-xs text-muted-foreground",children:"Broadcast changes via WebSocket using PostgreSQL WAL"})]}),(0,s.jsx)(A.r,{checked:I,onCheckedChange:T})]}),I&&(0,s.jsxs)("div",{className:"pl-4 space-y-3 border-l-2 border-muted",children:[(0,s.jsx)(k._,{className:"text-xs text-muted-foreground",children:"Broadcast on:"}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-4",children:[(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(U.X,{id:"rt-insert",checked:_.includes("insert"),onCheckedChange:e=>z("insert",e)}),(0,s.jsx)("label",{htmlFor:"rt-insert",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Insert"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(U.X,{id:"rt-update",checked:_.includes("update"),onCheckedChange:e=>z("update",e)}),(0,s.jsx)("label",{htmlFor:"rt-update",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Update"})]}),(0,s.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,s.jsx)(U.X,{id:"rt-delete",checked:_.includes("delete"),onCheckedChange:e=>z("delete",e)}),(0,s.jsx)("label",{htmlFor:"rt-delete",className:"text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:"Delete"})]})]}),0===_.length&&(0,s.jsx)("p",{className:"text-xs text-amber-600",children:"⚠️ Select at least one action to broadcast"})]})]})]})]})}),(0,s.jsxs)("div",{className:"flex justify-end gap-2 pt-4 border-t mt-4 flex-shrink-0",children:[(0,s.jsx)(o.z,{variant:"outline",onClick:l,children:"Cancel"}),(0,s.jsxs)(o.z,{onClick:()=>{let e=M(h),a=I?{enabled:!0,actions:_}:{enabled:!1,actions:[]};R({resource:"collections",id:h,values:{schema:{...null==e?void 0:e.schema,timestamps:m,usertrack:p,paranoid:v,sortEnabled:N,tenantScoped:b,realtime:a}}},{onSuccess:()=>{d.Am.success("Schema settings updated successfully"),E(),c(),l()},onError:e=>{d.Am.error("Error updating settings: ".concat(e.message))}})},disabled:O,children:[O&&(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}),"Save Changes"]})]})]})})})},ed=()=>{let[e,a]=(0,t.useState)(!1),[l,S]=(0,t.useState)(!1),[I,k]=(0,t.useState)(!1),[A,T]=(0,t.useState)(!1),[D,M]=(0,t.useState)(!1),[E,R]=(0,t.useState)(null),[O,U]=(0,t.useState)(null),[L,V]=(0,t.useState)(""),[Z,z]=(0,t.useState)(!1),[P,F]=(0,t.useState)(null),Q=(0,n.Ji)(),{schemas:B,isLoading:$,refetch:W}=(0,i.I_)(),{mutate:J,isLoading:H}=(0,n.R2)(),{isMultiTenant:X}=(0,r.PY)(),Y=(0,t.useMemo)(()=>B&&L.trim()?B.filter(e=>{var a,l,s;let t=(null==e?void 0:null===(l=e.schema)||void 0===l?void 0:null===(a=l.name)||void 0===a?void 0:a.toLowerCase())||"",n=(null==e?void 0:null===(s=e.collectionName)||void 0===s?void 0:s.toLowerCase())||"",i=L.toLowerCase();return t.includes(i)||n.includes(i)}):B||[],[B,L]),G=e=>{R(e),S(!0)},ee=e=>{R(e),k(!0)},ea=e=>{R(e.collectionName),U(e.schema),M(!0)},el=e=>{F(e),z(!0)},{refetch:es}=(0,n.EV)({url:"".concat(Q,"/schemas-export"),method:"get",queryOptions:{enabled:!1,retry:!1}}),et=async()=>{try{var e;let a=await es(),l=null==a?void 0:a.data;if(!(null==l?void 0:l.data)){d.Am.error("No schemas found to export");return}let s=window.URL.createObjectURL(new Blob([JSON.stringify(l.data)])),t=document.createElement("a");t.href=s,t.setAttribute("download","schema-export-".concat((null===(e=l.data)||void 0===e?void 0:e.timestamp)||Date.now(),".json")),document.body.appendChild(t),t.click(),t.remove(),d.Am.success("Schemas exported successfully")}catch(e){d.Am.error("Error exporting schemas: ".concat(e.message))}},ei=e=>Object.keys((null==e?void 0:e.fields)||{}).length;return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-2",children:[(0,s.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 flex-shrink-0",children:[(0,s.jsx)("h1",{className:"text-lg font-semibold",children:"Collections Management"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)(u.t,{value:L,onChange:V,placeholder:"Search collections...",expandedWidth:"w-64"}),(0,s.jsx)(o.z,{variant:"outline",size:"icon",onClick:()=>W(),children:(0,s.jsx)(p.Z,{className:"h-4 w-4"})}),(0,s.jsxs)(o.z,{onClick:()=>a(!0),children:[(0,s.jsx)(j.Z,{className:"mr-2 h-4 w-4"}),"Create Schema"]}),(0,s.jsxs)(o.z,{variant:"outline",onClick:()=>T(!0),children:[(0,s.jsx)(v.Z,{className:"mr-2 h-4 w-4"}),"Import"]}),(0,s.jsxs)(o.z,{variant:"outline",onClick:et,children:[(0,s.jsx)(f.Z,{className:"mr-2 h-4 w-4"}),"Export"]})]})]}),(0,s.jsx)(c.Zb,{className:"flex-1 flex flex-col min-h-0 overflow-hidden",children:(0,s.jsx)("div",{className:"flex-1 overflow-auto",children:(0,s.jsxs)("table",{className:"w-full min-w-max",children:[(0,s.jsx)("thead",{className:"sticky top-0 z-10 bg-background border-b",children:(0,s.jsxs)(m.SC,{children:[(0,s.jsx)(m.ss,{children:"Schema Name"}),(0,s.jsx)(m.ss,{children:"Fields"}),(0,s.jsx)(m.ss,{children:"Options"}),(0,s.jsx)(m.ss,{className:"w-64",children:"Actions"})]})}),(0,s.jsx)("tbody",{children:$?(0,s.jsx)(m.SC,{children:(0,s.jsx)(m.pj,{colSpan:4,className:"h-48 text-center",children:(0,s.jsx)(g.Z,{className:"h-8 w-8 animate-spin mx-auto"})})}):0===Y.length?(0,s.jsx)(m.SC,{children:(0,s.jsxs)(m.pj,{colSpan:4,className:"h-48 text-center text-muted-foreground",children:[(0,s.jsx)(N.Z,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),(0,s.jsx)("p",{children:"No collections found"}),(0,s.jsxs)(o.z,{variant:"outline",className:"mt-4",onClick:()=>a(!0),children:[(0,s.jsx)(j.Z,{className:"mr-2 h-4 w-4"}),"Create your first collection"]})]})}):Y.map(e=>{var a,l,t,n,i,r;return(0,s.jsxs)(m.SC,{children:[(0,s.jsx)(m.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(N.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("span",{className:"font-medium",children:null===(a=e.schema)||void 0===a?void 0:a.name}),(null===(l=e.schema)||void 0===l?void 0:l.name)!==e.collectionName&&(0,s.jsx)("code",{className:"text-xs text-muted-foreground bg-muted px-1 py-0.5 rounded w-fit",children:e.collectionName})]})]})}),(0,s.jsx)(m.pj,{children:(0,s.jsxs)(h.C,{variant:"secondary",children:[ei(e.schema)," fields"]})}),(0,s.jsx)(m.pj,{children:(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(null===(t=e.schema)||void 0===t?void 0:t.timestamps)&&(0,s.jsx)(h.C,{variant:"outline",className:"text-xs",children:"Timestamps"}),(null===(n=e.schema)||void 0===n?void 0:n.paranoid)&&(0,s.jsx)(h.C,{variant:"outline",className:"text-xs",children:"Soft Delete"}),(null===(i=e.schema)||void 0===i?void 0:i.usertrack)&&(0,s.jsx)(h.C,{variant:"outline",className:"text-xs",children:"Audit"}),X&&((null===(r=e.schema)||void 0===r?void 0:r.tenantScoped)===!1?(0,s.jsx)(h.C,{variant:"outline",className:"text-xs",children:"Global"}):(0,s.jsx)(h.C,{variant:"outline",className:"text-xs",children:"Tenant Scoped"}))]})}),(0,s.jsx)(m.pj,{children:(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsxs)(o.z,{variant:"outline",size:"sm",onClick:()=>G(e.collectionName),children:[(0,s.jsx)(y.Z,{className:"mr-1 h-3 w-3"}),"Fields"]}),(0,s.jsxs)(o.z,{variant:"outline",size:"sm",onClick:()=>ee(e.collectionName),children:[(0,s.jsx)(b.Z,{className:"mr-1 h-3 w-3"}),"Indexes"]}),(0,s.jsx)(o.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>ea(e),children:(0,s.jsx)(C.Z,{className:"h-4 w-4"})}),!e.collectionName.includes("baasix_")&&(0,s.jsx)(o.z,{variant:"ghost",size:"icon",className:"h-8 w-8 text-destructive",onClick:()=>el(e.collectionName),children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})]})})]},e.collectionName)})})]})})}),(0,s.jsx)(_,{open:e,onClose:()=>a(!1),onSuccess:()=>{a(!1),W()}}),E&&(0,s.jsx)(q,{open:l,onClose:()=>S(!1),collectionName:E,onSuccess:()=>W()}),E&&(0,s.jsx)(K,{open:I,onClose:()=>k(!1),collectionName:E}),(0,s.jsx)(en,{open:A,onClose:()=>{T(!1),W()}}),E&&O&&(0,s.jsx)(er,{open:D,onClose:()=>M(!1),onSuccess:()=>W(),schema:O,collectionName:E}),(0,s.jsx)(x.aR,{open:Z,onOpenChange:z,children:(0,s.jsxs)(x._T,{children:[(0,s.jsxs)(x.fY,{children:[(0,s.jsx)(x.f$,{children:"Delete Schema"}),(0,s.jsxs)(x.yT,{children:['Are you sure you want to delete the schema "',P,'"? This action cannot be undone and will remove all data in this collection.']})]}),(0,s.jsxs)(x.xo,{children:[(0,s.jsx)(x.le,{children:"Cancel"}),(0,s.jsxs)(x.OL,{onClick:()=>{P&&J({resource:"collections",id:P},{onSuccess:()=>{d.Am.success("Schema deleted successfully"),z(!1),F(null),W()},onError:e=>{d.Am.error("Error deleting schema: ".concat(e.message))}})},className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[H?(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),"Delete"]})]})]})})]})};var ec=()=>(0,s.jsx)(ed,{})},30767:function(e,a,l){"use strict";l.d(a,{OL:function(){return v},_T:function(){return h},aR:function(){return d},f$:function(){return p},fY:function(){return m},le:function(){return f},vW:function(){return c},xo:function(){return x},yT:function(){return j}});var s=l(57437),t=l(2265),n=l(16720),i=l(93448),r=l(12381);let d=n.fC,c=n.xz,o=n.h_,u=t.forwardRef((e,a)=>{let{className:l,...t}=e;return(0,s.jsx)(n.aV,{className:(0,i.cn)("fixed inset-0 z-50 bg-background/80 backdrop-blur-sm data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",l),...t,ref:a})});u.displayName="AlertDialogOverlay";let h=t.forwardRef((e,a)=>{let{className:l,...t}=e;return(0,s.jsxs)(o,{children:[(0,s.jsx)(u,{}),(0,s.jsx)(n.VY,{ref:a,className:(0,i.cn)("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 sm:rounded-lg",l),...t})]})});h.displayName="AlertDialogContent";let m=e=>{let{className:a,...l}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",a),...l})};m.displayName="AlertDialogHeader";let x=e=>{let{className:a,...l}=e;return(0,s.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",a),...l})};x.displayName="AlertDialogFooter";let p=t.forwardRef((e,a)=>{let{className:l,...t}=e;return(0,s.jsx)(n.Dx,{ref:a,className:(0,i.cn)("text-lg font-semibold",l),...t})});p.displayName="AlertDialogTitle";let j=t.forwardRef((e,a)=>{let{className:l,...t}=e;return(0,s.jsx)(n.dk,{ref:a,className:(0,i.cn)("text-sm text-muted-foreground",l),...t})});j.displayName="AlertDialogDescription";let v=t.forwardRef((e,a)=>{let{className:l,...t}=e;return(0,s.jsx)(n.aU,{ref:a,className:(0,i.cn)((0,r.d)(),l),...t})});v.displayName="AlertDialogAction";let f=t.forwardRef((e,a)=>{let{className:l,...t}=e;return(0,s.jsx)(n.$j,{ref:a,className:(0,i.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",l),...t})});f.displayName="AlertDialogCancel"},8227:function(e,a,l){"use strict";l.d(a,{Fw:function(){return i},wy:function(){return n},zF:function(){return t}}),l(2265);var s=l(962);let t=s.fC,n=s.wy,i=s.Fw},31593:function(e,a,l){"use strict";l.d(a,{Z:function(){return r}});var s=l(57437),t=l(2265),n=l(90759),i=l(93448);let r=t.forwardRef((e,a)=>{let{className:l,orientation:t="horizontal",decorative:r=!0,...d}=e;return(0,s.jsx)(n.f,{ref:a,decorative:r,orientation:t,className:(0,i.cn)("shrink-0 bg-border","horizontal"===t?"h-[1px] w-full":"h-full w-[1px]",l),...d})});r.displayName=n.f.displayName},962:function(e,a,l){"use strict";l.d(a,{Fw:function(){return b},VY:function(){return k},fC:function(){return S},p_:function(){return p},wy:function(){return N},xz:function(){return I}});var s=l(2265),t=l(6741),n=l(73966),i=l(80886),r=l(61188),d=l(98575),c=l(82912),o=l(71599),u=l(99255),h=l(57437),m="Collapsible",[x,p]=(0,n.b)(m),[j,v]=x(m),f=s.forwardRef((e,a)=>{let{__scopeCollapsible:l,open:t,defaultOpen:n,disabled:r,onOpenChange:d,...o}=e,[x,p]=(0,i.T)({prop:t,defaultProp:null!=n&&n,onChange:d,caller:m});return(0,h.jsx)(j,{scope:l,disabled:r,contentId:(0,u.M)(),open:x,onOpenToggle:s.useCallback(()=>p(e=>!e),[p]),children:(0,h.jsx)(c.WV.div,{"data-state":w(x),"data-disabled":r?"":void 0,...o,ref:a})})});f.displayName=m;var g="CollapsibleTrigger",N=s.forwardRef((e,a)=>{let{__scopeCollapsible:l,...s}=e,n=v(g,l);return(0,h.jsx)(c.WV.button,{type:"button","aria-controls":n.contentId,"aria-expanded":n.open||!1,"data-state":w(n.open),"data-disabled":n.disabled?"":void 0,disabled:n.disabled,...s,ref:a,onClick:(0,t.Mj)(e.onClick,n.onOpenToggle)})});N.displayName=g;var y="CollapsibleContent",b=s.forwardRef((e,a)=>{let{forceMount:l,...s}=e,t=v(y,e.__scopeCollapsible);return(0,h.jsx)(o.z,{present:l||t.open,children:e=>{let{present:l}=e;return(0,h.jsx)(C,{...s,ref:a,present:l})}})});b.displayName=y;var C=s.forwardRef((e,a)=>{let{__scopeCollapsible:l,present:t,children:n,...i}=e,o=v(y,l),[u,m]=s.useState(t),x=s.useRef(null),p=(0,d.e)(a,x),j=s.useRef(0),f=j.current,g=s.useRef(0),N=g.current,b=o.open||u,C=s.useRef(b),S=s.useRef(void 0);return s.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,r.b)(()=>{let e=x.current;if(e){S.current=S.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let a=e.getBoundingClientRect();j.current=a.height,g.current=a.width,C.current||(e.style.transitionDuration=S.current.transitionDuration,e.style.animationName=S.current.animationName),m(t)}},[o.open,t]),(0,h.jsx)(c.WV.div,{"data-state":w(o.open),"data-disabled":o.disabled?"":void 0,id:o.contentId,hidden:!b,...i,ref:p,style:{"--radix-collapsible-content-height":f?"".concat(f,"px"):void 0,"--radix-collapsible-content-width":N?"".concat(N,"px"):void 0,...e.style},children:b&&n})});function w(e){return e?"open":"closed"}var S=f,I=N,k=b},370:function(e,a,l){"use strict";l.d(a,{f:function(){return d}});var s=l(2265);l(54887);var t=l(37053),n=l(57437),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let l=(0,t.Z8)(`Primitive.${a}`),i=s.forwardRef((e,s)=>{let{asChild:t,...i}=e,r=t?l:a;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(r,{...i,ref:s})});return i.displayName=`Primitive.${a}`,{...e,[a]:i}},{}),r=s.forwardRef((e,a)=>(0,n.jsx)(i.label,{...e,ref:a,onMouseDown:a=>{var l;a.target.closest("button, input, select, textarea")||(null===(l=e.onMouseDown)||void 0===l||l.call(e,a),!a.defaultPrevented&&a.detail>1&&a.preventDefault())}}));r.displayName="Label";var d=r},90759:function(e,a,l){"use strict";l.d(a,{f:function(){return o}});var s=l(2265);l(54887);var t=l(37053),n=l(57437),i=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,a)=>{let l=(0,t.Z8)(`Primitive.${a}`),i=s.forwardRef((e,s)=>{let{asChild:t,...i}=e,r=t?l:a;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,n.jsx)(r,{...i,ref:s})});return i.displayName=`Primitive.${a}`,{...e,[a]:i}},{}),r="horizontal",d=["horizontal","vertical"],c=s.forwardRef((e,a)=>{let{decorative:l,orientation:s=r,...t}=e,c=d.includes(s)?s:r;return(0,n.jsx)(i.div,{"data-orientation":c,...l?{role:"none"}:{"aria-orientation":"vertical"===c?c:void 0,role:"separator"},...t,ref:a})});c.displayName="Separator";var o=c}},function(e){e.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,1509,9487,1783,9881,7324,3563,2667,1407,2971,2117,1744],function(){return e(e.s=49204)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8344],{28439:function(e,t,n){Promise.resolve().then(n.bind(n,37161))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:i?24*Number(a)/Number(l):a,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:i,...s}=n;return(0,r.createElement)(a,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),i),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function a(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:a,children:i})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},37161:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return i}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let a=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8344],{28439:function(e,t,n){Promise.resolve().then(n.bind(n,37161))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:i?24*Number(a)/Number(l):a,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:i,...s}=n;return(0,r.createElement)(a,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),i),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function a(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:a,children:i})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},37161:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return i}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let a=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(1407),n.e(1303),n.e(3817)]).then(n.bind(n,72337)).then(e=>e.DataBrowserInner),{loadableGenerated:{webpack:()=>[72337]},ssr:!1,loading:()=>(0,r.jsx)(o,{})});function i(){return(0,r.jsx)(a,{selectedCollection:"baasix_Tasks",title:"Tasks",enableView:!0,defaultVisibleColumns:["type","task_status","scheduled_time","userCreated","createdAt"]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=28439)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4111],{30086:function(n,e,u){Promise.resolve().then(u.bind(u,15006))},15006:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.h2,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4111],{30086:function(n,e,u){Promise.resolve().then(u.bind(u,15006))},15006:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.h2,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,1407,1303,3817,9599,2971,2117,1744],function(){return n(n.s=30086)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5714],{51454:function(n,e,u){Promise.resolve().then(u.bind(u,77498))},77498:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.Xx,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5714],{51454:function(n,e,u){Promise.resolve().then(u.bind(u,77498))},77498:function(n,e,u){"use strict";u.r(e);var s=u(57437);u(2265);var t=u(24225);e.default=()=>(0,s.jsx)(t.Xx,{})}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,5650,2667,1407,1303,3817,9599,2971,2117,1744],function(){return n(n.s=51454)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1242],{58247:function(e,t,n){Promise.resolve().then(n.bind(n,55048))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:a?24*Number(i)/Number(l):i,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),a=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:a,...s}=n;return(0,r.createElement)(i,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),a),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function i(e){return{default:e&&"default"in e?e.default:e}}let a={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},s=function(e){let t={...a,...e},n=(0,l.lazy)(()=>t.loader().then(i)),s=t.loading;function d(e){let i=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,a=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:i,children:a})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},55048:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return a}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let i=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1242],{58247:function(e,t,n){Promise.resolve().then(n.bind(n,55048))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return a}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let i=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:i=2,absoluteStrokeWidth:a,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:a?24*Number(i)/Number(l):i,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),a=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:a,...s}=n;return(0,r.createElement)(i,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),a),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function i(e){return{default:e&&"default"in e?e.default:e}}let a={loader:()=>Promise.resolve(i(()=>null)),loading:null,ssr:!0},s=function(e){let t={...a,...e},n=(0,l.lazy)(()=>t.loader().then(i)),s=t.loading;function d(e){let i=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,a=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:i,children:a})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},55048:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return a}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let i=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(1407),n.e(1303),n.e(3817)]).then(n.bind(n,72337)).then(e=>e.DataBrowserInner),{loadableGenerated:{webpack:()=>[72337]},ssr:!1,loading:()=>(0,r.jsx)(o,{})});function a(){return(0,r.jsx)(i,{selectedCollection:"baasix_Invite",title:"User Invites",enableView:!0,defaultVisibleColumns:["email","role","tenant","status","inviter","expiresAt","createdAt"]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=58247)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3353],{88752:function(n,t,u){Promise.resolve().then(u.bind(u,18407))},18407:function(n,t,u){"use strict";u.r(t),u.d(t,{default:function(){return c}});var e=u(57437),r=u(65422);function c(){return(0,e.jsx)(r.t,{})}}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3353],{88752:function(n,t,u){Promise.resolve().then(u.bind(u,18407))},18407:function(n,t,u){"use strict";u.r(t),u.d(t,{default:function(){return c}});var e=u(57437),r=u(65422);function c(){return(0,e.jsx)(r.t,{})}}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,1407,1303,3817,7214,2971,2117,1744],function(){return n(n.s=88752)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8800],{46393:function(n,t,u){Promise.resolve().then(u.bind(u,9565))},9565:function(n,t,u){"use strict";u.r(t),u.d(t,{default:function(){return c}});var e=u(57437),r=u(65422);function c(){return(0,e.jsx)(r.t,{})}}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8800],{46393:function(n,t,u){Promise.resolve().then(u.bind(u,9565))},9565:function(n,t,u){"use strict";u.r(t),u.d(t,{default:function(){return c}});var e=u(57437),r=u(65422);function c(){return(0,e.jsx)(r.t,{})}}},function(n){n.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,1407,1303,3817,7214,2971,2117,1744],function(){return n(n.s=46393)}),_N_E=n.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7165],{37373:function(e,t,n){Promise.resolve().then(n.bind(n,544))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:i?24*Number(a)/Number(l):a,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:i,...s}=n;return(0,r.createElement)(a,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),i),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function a(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:a,children:i})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},544:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return i}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let a=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7165],{37373:function(e,t,n){Promise.resolve().then(n.bind(n,544))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:i?24*Number(a)/Number(l):a,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:i,...s}=n;return(0,r.createElement)(a,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),i),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function a(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:a,children:i})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},544:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return i}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let a=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(1407),n.e(1303),n.e(3817)]).then(n.bind(n,72337)).then(e=>e.DataBrowserInner),{loadableGenerated:{webpack:()=>[72337]},ssr:!1,loading:()=>(0,r.jsx)(o,{})});function i(){return(0,r.jsx)(a,{selectedCollection:"baasix_UserPreference",title:"User Preferences",enableView:!0,defaultVisibleColumns:["user","collectionName","preferenceType","isDefault","name","createdAt"]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=37373)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8615],{12874:function(e,t,n){Promise.resolve().then(n.bind(n,13345))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:i?24*Number(a)/Number(l):a,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:i,...s}=n;return(0,r.createElement)(a,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),i),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function a(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:a,children:i})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},13345:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return i}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let a=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8615],{12874:function(e,t,n){Promise.resolve().then(n.bind(n,13345))},79205:function(e,t,n){"use strict";n.d(t,{Z:function(){return i}});var r=n(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),u=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return t.filter((e,t,n)=>!!e&&n.indexOf(e)===t).join(" ")};var o={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,r.forwardRef)((e,t)=>{let{color:n="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:i,className:s="",children:d,iconNode:c,...f}=e;return(0,r.createElement)("svg",{ref:t,...o,width:l,height:l,stroke:n,strokeWidth:i?24*Number(a)/Number(l):a,className:u("lucide",s),...f},[...c.map(e=>{let[t,n]=e;return(0,r.createElement)(t,n)}),...Array.isArray(d)?d:[d]])}),i=(e,t)=>{let n=(0,r.forwardRef)((n,o)=>{let{className:i,...s}=n;return(0,r.createElement)(a,{ref:o,iconNode:t,className:u("lucide-".concat(l(e)),i),...s})});return n.displayName="".concat(e),n}},51817:function(e,t,n){"use strict";n.d(t,{Z:function(){return r}});let r=(0,n(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},30166:function(e,t,n){"use strict";n.d(t,{default:function(){return l.a}});var r=n(55775),l=n.n(r)},55775:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return u}});let r=n(47043);n(57437),n(2265);let l=r._(n(15602));function u(e,t){var n;let r={loading:e=>{let{error:t,isLoading:n,pastDelay:r}=e;return null}};"function"==typeof e&&(r.loader=e);let u={...r,...t};return(0,l.default)({...u,modules:null==(n=u.loadableGenerated)?void 0:n.modules})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81523:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"BailoutToCSR",{enumerable:!0,get:function(){return l}});let r=n(18993);function l(e){let{reason:t,children:n}=e;if("undefined"==typeof window)throw new r.BailoutToCSRError(t);return n}},15602:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let r=n(57437),l=n(2265),u=n(81523),o=n(70049);function a(e){return{default:e&&"default"in e?e.default:e}}let i={loader:()=>Promise.resolve(a(()=>null)),loading:null,ssr:!0},s=function(e){let t={...i,...e},n=(0,l.lazy)(()=>t.loader().then(a)),s=t.loading;function d(e){let a=s?(0,r.jsx)(s,{isLoading:!0,pastDelay:!0,error:null}):null,i=t.ssr?(0,r.jsxs)(r.Fragment,{children:["undefined"==typeof window?(0,r.jsx)(o.PreloadCss,{moduleIds:t.modules}):null,(0,r.jsx)(n,{...e})]}):(0,r.jsx)(u.BailoutToCSR,{reason:"next/dynamic",children:(0,r.jsx)(n,{...e})});return(0,r.jsx)(l.Suspense,{fallback:a,children:i})}return d.displayName="LoadableComponent",d}},70049:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PreloadCss",{enumerable:!0,get:function(){return u}});let r=n(57437),l=n(20544);function u(e){let{moduleIds:t}=e;if("undefined"!=typeof window)return null;let n=(0,l.getExpectedRequestStore)("next/dynamic css"),u=[];if(n.reactLoadableManifest&&t){let e=n.reactLoadableManifest;for(let n of t){if(!e[n])continue;let t=e[n].files.filter(e=>e.endsWith(".css"));u.push(...t)}}return 0===u.length?null:(0,r.jsx)(r.Fragment,{children:u.map(e=>(0,r.jsx)("link",{precedence:"dynamic",rel:"stylesheet",href:n.assetPrefix+"/_next/"+encodeURI(e),as:"style"},e))})}},13345:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return i}});var r=n(57437);n(2265);var l=n(30166),u=n(51817);function o(){return(0,r.jsx)("div",{className:"flex h-full items-center justify-center",children:(0,r.jsx)(u.Z,{className:"h-8 w-8 animate-spin"})})}let a=(0,l.default)(()=>Promise.all([n.e(7999),n.e(3572),n.e(7902),n.e(5094),n.e(4438),n.e(6530),n.e(4475),n.e(6241),n.e(926),n.e(600),n.e(1668),n.e(2676),n.e(1509),n.e(6869),n.e(9487),n.e(1783),n.e(9881),n.e(7324),n.e(9124),n.e(6712),n.e(2667),n.e(1407),n.e(1303),n.e(3817)]).then(n.bind(n,72337)).then(e=>e.DataBrowserInner),{loadableGenerated:{webpack:()=>[72337]},ssr:!1,loading:()=>(0,r.jsx)(o,{})});function i(){return(0,r.jsx)(a,{selectedCollection:"baasix_UserRole",title:"User Roles",enableView:!0,defaultVisibleColumns:["user","role","tenant","createdAt"]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=12874)}),_N_E=e.O()}]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7866],{69162:function(e,t,r){Promise.resolve().then(r.bind(r,53740))},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var s=r(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ")};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,s.forwardRef)((e,t)=>{let{color:r="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:c="",children:d,iconNode:u,...h}=e;return(0,s.createElement)("svg",{ref:t,...i,width:l,height:l,stroke:r,strokeWidth:n?24*Number(a)/Number(l):a,className:o("lucide",c),...h},[...u.map(e=>{let[t,r]=e;return(0,s.createElement)(t,r)}),...Array.isArray(d)?d:[d]])}),n=(e,t)=>{let r=(0,s.forwardRef)((r,i)=>{let{className:n,...c}=r;return(0,s.createElement)(a,{ref:i,iconNode:t,className:o("lucide-".concat(l(e)),n),...c})});return r.displayName="".concat(e),r}},41671:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},51817:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},33276:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},76865:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},53740:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return z}});var s=r(57437),l=r(2265),o=r(99376),i=r(72135),a=r(14438),n=r(41671);let c=(0,r(79205).Z)("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);var d=r(91723),u=r(45675),h=r(33276),w=r(67782),m=r(42208),x=r(78867),f=r(18930),p=r(92735),k=r(51817),g=r(17689),j=r(99397),v=r(76865),y=r(33245),b=r(12381),N=r(69174),C=r(32060),_=r(74291),Z=r(90641),A=r(95937),S=r(72337);let E=()=>{var e,t,r;let E=(0,o.useRouter)(),[z,W]=(0,l.useState)(null),[D,O]=(0,l.useState)(!1),[I,F]=(0,l.useState)(!1),[R,L]=(0,l.useState)(null),[B,X]=(0,l.useState)(null),[T,V]=(0,l.useState)(0),M=(0,l.useRef)(null),{mutate:$}=(0,i.RO)(),{mutate:q}=(0,i.uC)(),{mutate:P}=(0,i.uC)(),{mutate:U}=(0,i.uC)(),J=(0,i.x5)(),K=(0,i.Ji)(),[G,H]=(0,l.useState)(!1),Q=e=>{W(e),O(!0)},Y=e=>{if(!B)return;let t=new FormData;t.append("file",B),t.append("overwrite",e.toString()),U({url:"/workflows/import",method:"post",values:t},{onSuccess:e=>{let t=e.data.summary;a.Am.success("Import complete: ".concat(t.created," created, ").concat(t.updated," updated, ").concat(t.skipped," skipped")),F(!1),L(null),X(null),V(e=>e+1)},onError:()=>{a.Am.error("Failed to import workflows")}})},ee=async e=>{try{let{data:t}=await J().getOne({resource:"baasix_Workflow",id:e.id});$({resource:"baasix_Workflow",values:{id:"".concat(t.id,"-copy"),name:"".concat(t.name," (Copy)"),description:t.description,status:"draft",trigger_type:t.trigger_type,trigger_cron:t.trigger_cron,trigger_webhook_path:t.trigger_webhook_path,trigger_webhook_method:t.trigger_webhook_method,trigger_hook_collection:t.trigger_hook_collection,trigger_hook_action:t.trigger_hook_action,allowed_roles:t.allowed_roles||[],flow_data:t.flow_data,variables:t.variables||{},options:t.options||{}}},{onSuccess:e=>{a.Am.success("Workflow duplicated"),E.push("/workflows/edit?id=".concat(e.data.id))},onError:()=>{a.Am.error("Failed to duplicate workflow")}})}catch(e){a.Am.error("Failed to fetch workflow data")}},et=(0,l.useCallback)(async e=>{H(!0);try{let r=localStorage.getItem("token"),s=e;if(!s||0===s.length){var t;let e=await fetch("".concat(K,"/items/baasix_Workflow?fields=id&limit=-1"),{headers:{Authorization:"Bearer ".concat(r)}});if(!e.ok)throw Error("Failed to fetch workflows");let l=await e.json();s=(null===(t=l.data)||void 0===t?void 0:t.map(e=>e.id))||[]}if(!s||0===s.length){a.Am.error("No workflows found to export");return}let l=await fetch("".concat(K,"/workflows/export"),{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({workflowIds:s})});if(!l.ok){let e=await l.json().catch(()=>({}));throw Error(e.message||"Export failed")}let o=(await l.json()).data;if(!o||!o.workflows||0===o.workflows.length){a.Am.error("No workflows found to export");return}let i=new Blob([JSON.stringify(o,null,2)],{type:"application/json"}),n=window.URL.createObjectURL(i),c=document.createElement("a");c.href=n,c.setAttribute("download","workflows-export-".concat(Date.now(),".json")),document.body.appendChild(c),c.click(),c.remove(),window.URL.revokeObjectURL(n),a.Am.success("".concat(o.workflows.length," workflow(s) exported successfully"))}catch(e){a.Am.error("Export failed: ".concat(e.message))}finally{H(!1)}},[K]),er=e=>{let t={active:{variant:"default",icon:(0,s.jsx)(n.Z,{className:"h-3 w-3 mr-1"})},inactive:{variant:"secondary",icon:(0,s.jsx)(c,{className:"h-3 w-3 mr-1"})},draft:{variant:"outline",icon:(0,s.jsx)(d.Z,{className:"h-3 w-3 mr-1"})}},r=t[e]||t.draft;return(0,s.jsxs)(N.C,{variant:r.variant,className:"capitalize",children:[r.icon,e]})},es=e=>(0,s.jsx)(N.C,{variant:"secondary",className:{manual:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300",webhook:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300",schedule:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-300",hook:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-300"}[e]||"",children:e}),el=[{label:"Export Selected",icon:(0,s.jsx)(p.Z,{className:"h-4 w-4"}),variant:"outline",onClick:async e=>{let t=e.map(e=>e.id);await et(t)},disabled:G}],eo=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{ref:M,type:"file",accept:".json",onChange:e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!r)return;let s=new FormData;s.append("file",r),P({url:"/workflows/import/preview",method:"post",values:s},{onSuccess:e=>{L(e.data),X(r),F(!0)},onError:()=>{a.Am.error("Failed to preview import file")}}),M.current&&(M.current.value="")},className:"hidden"}),(0,s.jsxs)(C.h_,{children:[(0,s.jsx)(C.$F,{asChild:!0,children:(0,s.jsx)(b.z,{variant:"outline",size:"icon",title:"More",children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(C.AW,{align:"end",children:[(0,s.jsxs)(C.Xi,{onClick:()=>et(),disabled:G,children:[G?(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(p.Z,{className:"mr-2 h-4 w-4"}),"Export All Workflows"]}),(0,s.jsx)(C.VD,{}),(0,s.jsxs)(C.Xi,{onClick:()=>{var e;null===(e=M.current)||void 0===e||e.click()},children:[(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4"}),"Import Workflow"]})]})]}),(0,s.jsx)(b.z,{size:"icon",onClick:()=>{let e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);$({resource:"baasix_Workflow",values:{id:"workflow-".concat(e),name:"New Workflow - ".concat(e),description:"",status:"draft",trigger_type:"manual",allowed_roles:[],flow_data:{nodes:[{id:"trigger-1",type:"trigger",position:{x:250,y:50},data:{label:"Trigger"}}],edges:[]},variables:{},options:{}}},{onSuccess:e=>{a.Am.success("Workflow created"),E.push("/workflows/edit?id=".concat(e.data.id))}})},title:"Create Workflow",children:(0,s.jsx)(j.Z,{className:"h-4 w-4"})})]});return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,s.jsx)(S.DataBrowserInner,{selectedCollection:"baasix_Workflow",title:"Workflows",enableSearch:!0,enableFilters:!0,enableCreate:!1,enableEdit:!0,enableDelete:!0,enableExport:!1,enableImport:!1,enableBulkSelect:!0,enableColumnSettings:!0,defaultSorters:[{field:"updatedAt",order:"desc"}],defaultVisibleColumns:["name","status","trigger_type","updatedAt"],headerActions:eo,renderRowActions:e=>{let{record:t,onDelete:r}=e;return(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(b.z,{variant:"ghost",size:"icon",onClick:()=>E.push("/workflows/edit?id=".concat(t.id)),children:(0,s.jsx)(u.Z,{className:"h-4 w-4"})}),(0,s.jsx)(b.z,{variant:"ghost",size:"icon",onClick:()=>Q(t),disabled:"active"!==t.status,children:(0,s.jsx)(h.Z,{className:"h-4 w-4"})}),(0,s.jsxs)(C.h_,{children:[(0,s.jsx)(C.$F,{asChild:!0,children:(0,s.jsx)(b.z,{variant:"ghost",size:"icon",children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(C.AW,{align:"end",children:[(0,s.jsxs)(C.Xi,{onClick:()=>E.push("/workflows/edit?id=".concat(t.id)),children:[(0,s.jsx)(u.Z,{className:"h-4 w-4 mr-2"}),"Edit"]}),(0,s.jsxs)(C.Xi,{onClick:()=>E.push("/workflows/detail?id=".concat(t.id)),children:[(0,s.jsx)(m.Z,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,s.jsxs)(C.Xi,{onClick:()=>Q(t),disabled:"active"!==t.status,children:[(0,s.jsx)(h.Z,{className:"h-4 w-4 mr-2"}),"Execute"]}),(0,s.jsxs)(C.Xi,{onClick:()=>ee(t),children:[(0,s.jsx)(x.Z,{className:"h-4 w-4 mr-2"}),"Duplicate"]}),(0,s.jsx)(C.VD,{}),(0,s.jsxs)(C.Xi,{className:"text-destructive",onClick:r,children:[(0,s.jsx)(f.Z,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})},customColumnRenderers:{name:(e,t)=>(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{className:"text-primary hover:underline text-left font-medium",onClick:()=>E.push("/workflows/detail?id=".concat(t.id)),children:e}),t.description&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:t.description})]}),status:e=>er(e),trigger_type:e=>es(e),updatedAt:e=>(0,s.jsx)("span",{className:"text-muted-foreground",children:new Date(e).toLocaleString()})},customBulkActions:el,onRefresh:()=>V(e=>e+1)},T),(0,s.jsx)(_.Vq,{open:D,onOpenChange:O,children:(0,s.jsxs)(_.cZ,{children:[(0,s.jsxs)(_.fK,{children:[(0,s.jsx)(_.$N,{children:"Execute Workflow"}),(0,s.jsxs)(_.Be,{children:["Are you sure you want to execute the workflow"," ",(0,s.jsx)("strong",{children:null==z?void 0:z.name}),"?"]})]}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"This will start the workflow execution immediately."}),(0,s.jsxs)(_.cN,{children:[(0,s.jsx)(b.z,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),(0,s.jsx)(b.z,{onClick:()=>{z&&q({url:"/workflows/".concat(z.id,"/execute"),method:"post",values:{}},{onSuccess:()=>{a.Am.success("Workflow execution started"),O(!1),E.push("/workflows/detail?id=".concat(z.id))},onError:()=>{a.Am.error("Failed to execute workflow")}})},children:"Execute"})]})]})}),(0,s.jsx)(_.Vq,{open:I,onOpenChange:F,children:(0,s.jsxs)(_.cZ,{className:"max-w-2xl",children:[(0,s.jsx)(_.fK,{children:(0,s.jsx)(_.$N,{children:"Import Workflows"})}),R&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium mb-2",children:"Import Summary:"}),(0,s.jsxs)("ul",{className:"list-disc list-inside text-sm text-muted-foreground",children:[(0,s.jsxs)("li",{children:["Total workflows: ",R.total]}),(0,s.jsxs)("li",{children:["New workflows: ",R.new]}),(0,s.jsxs)("li",{children:["Existing workflows: ",(null===(e=R.conflicts)||void 0===e?void 0:e.length)||0]})]})]}),R.conflicts&&R.conflicts.length>0&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(A.bZ,{variant:"destructive",className:"border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20",children:[(0,s.jsx)(v.Z,{className:"h-4 w-4"}),(0,s.jsx)(A.Cd,{children:"Workflow Conflicts Detected"}),(0,s.jsx)(A.X,{children:"The following workflows already exist. Choose to overwrite them or import new ones only."})]}),(0,s.jsx)(Z.x,{className:"h-48 border rounded-md p-4",children:(0,s.jsx)("div",{className:"space-y-2",children:R.conflicts.map(e=>{var t,r;return(0,s.jsxs)("div",{className:"border-b pb-2 last:border-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name}),(null===(t=e.existing)||void 0===t?void 0:t.isDeleted)&&(0,s.jsx)(N.C,{variant:"destructive",className:"text-xs",children:"Deleted - will be restored"})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["ID: ",e.id," | Type: ",e.trigger_type," | Status: ",null===(r=e.existing)||void 0===r?void 0:r.status]})]},e.id)})})})]}),R.new>0&&(0,s.jsxs)(A.bZ,{children:[(0,s.jsx)(y.Z,{className:"h-4 w-4"}),(0,s.jsxs)(A.X,{children:[R.new," new workflow(s) will be imported"]})]})]}),(0,s.jsxs)(_.cN,{children:[(0,s.jsx)(b.z,{variant:"outline",onClick:()=>{F(!1),L(null),X(null)},children:"Cancel"}),(null==R?void 0:null===(t=R.conflicts)||void 0===t?void 0:t.length)>0&&(0,s.jsx)(b.z,{variant:"secondary",onClick:()=>Y(!1),children:"Import New Only"}),(0,s.jsx)(b.z,{onClick:()=>Y(!0),children:(null==R?void 0:null===(r=R.conflicts)||void 0===r?void 0:r.length)>0?"Import & Overwrite":"Import"})]})]})})]})};function z(){return(0,s.jsx)(E,{})}}},function(e){e.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,4033,7304,3817,2971,2117,1744],function(){return e(e.s=69162)}),_N_E=e.O()}]);
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7866],{69162:function(e,t,r){Promise.resolve().then(r.bind(r,53740))},79205:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});var s=r(2265);let l=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),o=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return t.filter((e,t,r)=>!!e&&r.indexOf(e)===t).join(" ")};var i={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};let a=(0,s.forwardRef)((e,t)=>{let{color:r="currentColor",size:l=24,strokeWidth:a=2,absoluteStrokeWidth:n,className:c="",children:d,iconNode:u,...h}=e;return(0,s.createElement)("svg",{ref:t,...i,width:l,height:l,stroke:r,strokeWidth:n?24*Number(a)/Number(l):a,className:o("lucide",c),...h},[...u.map(e=>{let[t,r]=e;return(0,s.createElement)(t,r)}),...Array.isArray(d)?d:[d]])}),n=(e,t)=>{let r=(0,s.forwardRef)((r,i)=>{let{className:n,...c}=r;return(0,s.createElement)(a,{ref:i,iconNode:t,className:o("lucide-".concat(l(e)),n),...c})});return r.displayName="".concat(e),r}},41671:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])},78867:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},51817:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},33276:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},76865:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});let s=(0,r(79205).Z)("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])},53740:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return z}});var s=r(57437),l=r(2265),o=r(99376),i=r(72135),a=r(14438),n=r(41671);let c=(0,r(79205).Z)("CirclePause",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);var d=r(91723),u=r(45675),h=r(33276),w=r(67782),m=r(42208),x=r(78867),f=r(18930),p=r(92735),k=r(51817),g=r(17689),j=r(99397),v=r(76865),y=r(33245),b=r(12381),N=r(69174),C=r(32060),_=r(74291),Z=r(90641),A=r(95937),S=r(72337);let E=()=>{var e,t,r;let E=(0,o.useRouter)(),[z,W]=(0,l.useState)(null),[D,O]=(0,l.useState)(!1),[I,F]=(0,l.useState)(!1),[R,L]=(0,l.useState)(null),[B,X]=(0,l.useState)(null),[T,V]=(0,l.useState)(0),M=(0,l.useRef)(null),{mutate:$}=(0,i.RO)(),{mutate:q}=(0,i.uC)(),{mutate:P}=(0,i.uC)(),{mutate:U}=(0,i.uC)(),J=(0,i.x5)(),K=(0,i.Ji)(),[G,H]=(0,l.useState)(!1),Q=e=>{W(e),O(!0)},Y=e=>{if(!B)return;let t=new FormData;t.append("file",B),t.append("overwrite",e.toString()),U({url:"/workflows/import",method:"post",values:t},{onSuccess:e=>{let t=e.data.summary;a.Am.success("Import complete: ".concat(t.created," created, ").concat(t.updated," updated, ").concat(t.skipped," skipped")),F(!1),L(null),X(null),V(e=>e+1)},onError:()=>{a.Am.error("Failed to import workflows")}})},ee=async e=>{try{let{data:t}=await J().getOne({resource:"baasix_Workflow",id:e.id});$({resource:"baasix_Workflow",values:{id:"".concat(t.id,"-copy"),name:"".concat(t.name," (Copy)"),description:t.description,status:"draft",trigger_type:t.trigger_type,trigger_cron:t.trigger_cron,trigger_webhook_path:t.trigger_webhook_path,trigger_webhook_method:t.trigger_webhook_method,trigger_hook_collection:t.trigger_hook_collection,trigger_hook_action:t.trigger_hook_action,allowed_roles:t.allowed_roles||[],flow_data:t.flow_data,variables:t.variables||{},options:t.options||{}}},{onSuccess:e=>{a.Am.success("Workflow duplicated"),E.push("/workflows/edit?id=".concat(e.data.id))},onError:()=>{a.Am.error("Failed to duplicate workflow")}})}catch(e){a.Am.error("Failed to fetch workflow data")}},et=(0,l.useCallback)(async e=>{H(!0);try{let r=localStorage.getItem("token"),s=e;if(!s||0===s.length){var t;let e=await fetch("".concat(K,"/items/baasix_Workflow?fields=id&limit=-1"),{headers:{Authorization:"Bearer ".concat(r)}});if(!e.ok)throw Error("Failed to fetch workflows");let l=await e.json();s=(null===(t=l.data)||void 0===t?void 0:t.map(e=>e.id))||[]}if(!s||0===s.length){a.Am.error("No workflows found to export");return}let l=await fetch("".concat(K,"/workflows/export"),{method:"POST",headers:{Authorization:"Bearer ".concat(r),"Content-Type":"application/json"},body:JSON.stringify({workflowIds:s})});if(!l.ok){let e=await l.json().catch(()=>({}));throw Error(e.message||"Export failed")}let o=(await l.json()).data;if(!o||!o.workflows||0===o.workflows.length){a.Am.error("No workflows found to export");return}let i=new Blob([JSON.stringify(o,null,2)],{type:"application/json"}),n=window.URL.createObjectURL(i),c=document.createElement("a");c.href=n,c.setAttribute("download","workflows-export-".concat(Date.now(),".json")),document.body.appendChild(c),c.click(),c.remove(),window.URL.revokeObjectURL(n),a.Am.success("".concat(o.workflows.length," workflow(s) exported successfully"))}catch(e){a.Am.error("Export failed: ".concat(e.message))}finally{H(!1)}},[K]),er=e=>{let t={active:{variant:"default",icon:(0,s.jsx)(n.Z,{className:"h-3 w-3 mr-1"})},inactive:{variant:"secondary",icon:(0,s.jsx)(c,{className:"h-3 w-3 mr-1"})},draft:{variant:"outline",icon:(0,s.jsx)(d.Z,{className:"h-3 w-3 mr-1"})}},r=t[e]||t.draft;return(0,s.jsxs)(N.C,{variant:r.variant,className:"capitalize",children:[r.icon,e]})},es=e=>(0,s.jsx)(N.C,{variant:"secondary",className:{manual:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-300",webhook:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-300",schedule:"bg-cyan-100 text-cyan-800 dark:bg-cyan-900 dark:text-cyan-300",hook:"bg-pink-100 text-pink-800 dark:bg-pink-900 dark:text-pink-300"}[e]||"",children:e}),el=[{label:"Export Selected",icon:(0,s.jsx)(p.Z,{className:"h-4 w-4"}),variant:"outline",onClick:async e=>{let t=e.map(e=>e.id);await et(t)},disabled:G}],eo=(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("input",{ref:M,type:"file",accept:".json",onChange:e=>{var t;let r=null===(t=e.target.files)||void 0===t?void 0:t[0];if(!r)return;let s=new FormData;s.append("file",r),P({url:"/workflows/import/preview",method:"post",values:s},{onSuccess:e=>{L(e.data),X(r),F(!0)},onError:()=>{a.Am.error("Failed to preview import file")}}),M.current&&(M.current.value="")},className:"hidden"}),(0,s.jsxs)(C.h_,{children:[(0,s.jsx)(C.$F,{asChild:!0,children:(0,s.jsx)(b.z,{variant:"outline",size:"icon",title:"More",children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(C.AW,{align:"end",children:[(0,s.jsxs)(C.Xi,{onClick:()=>et(),disabled:G,children:[G?(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,s.jsx)(p.Z,{className:"mr-2 h-4 w-4"}),"Export All Workflows"]}),(0,s.jsx)(C.VD,{}),(0,s.jsxs)(C.Xi,{onClick:()=>{var e;null===(e=M.current)||void 0===e||e.click()},children:[(0,s.jsx)(g.Z,{className:"mr-2 h-4 w-4"}),"Import Workflow"]})]})]}),(0,s.jsx)(b.z,{size:"icon",onClick:()=>{let e=new Date().toISOString().replace(/[:.]/g,"-").slice(0,-5);$({resource:"baasix_Workflow",values:{id:"workflow-".concat(e),name:"New Workflow - ".concat(e),description:"",status:"draft",trigger_type:"manual",allowed_roles:[],flow_data:{nodes:[{id:"trigger-1",type:"trigger",position:{x:250,y:50},data:{label:"Trigger"}}],edges:[]},variables:{},options:{}}},{onSuccess:e=>{a.Am.success("Workflow created"),E.push("/workflows/edit?id=".concat(e.data.id))}})},title:"Create Workflow",children:(0,s.jsx)(j.Z,{className:"h-4 w-4"})})]});return(0,s.jsxs)("div",{className:"flex flex-col h-full overflow-hidden",children:[(0,s.jsx)(S.DataBrowserInner,{selectedCollection:"baasix_Workflow",title:"Workflows",enableSearch:!0,enableFilters:!0,enableCreate:!1,enableEdit:!0,enableDelete:!0,enableExport:!1,enableImport:!1,enableBulkSelect:!0,enableColumnSettings:!0,defaultSorters:[{field:"updatedAt",order:"desc"}],defaultVisibleColumns:["name","status","trigger_type","updatedAt"],headerActions:eo,renderRowActions:e=>{let{record:t,onDelete:r}=e;return(0,s.jsxs)("div",{className:"flex items-center gap-1",children:[(0,s.jsx)(b.z,{variant:"ghost",size:"icon",onClick:()=>E.push("/workflows/edit?id=".concat(t.id)),children:(0,s.jsx)(u.Z,{className:"h-4 w-4"})}),(0,s.jsx)(b.z,{variant:"ghost",size:"icon",onClick:()=>Q(t),disabled:"active"!==t.status,children:(0,s.jsx)(h.Z,{className:"h-4 w-4"})}),(0,s.jsxs)(C.h_,{children:[(0,s.jsx)(C.$F,{asChild:!0,children:(0,s.jsx)(b.z,{variant:"ghost",size:"icon",children:(0,s.jsx)(w.Z,{className:"h-4 w-4"})})}),(0,s.jsxs)(C.AW,{align:"end",children:[(0,s.jsxs)(C.Xi,{onClick:()=>E.push("/workflows/edit?id=".concat(t.id)),children:[(0,s.jsx)(u.Z,{className:"h-4 w-4 mr-2"}),"Edit"]}),(0,s.jsxs)(C.Xi,{onClick:()=>E.push("/workflows/detail?id=".concat(t.id)),children:[(0,s.jsx)(m.Z,{className:"h-4 w-4 mr-2"}),"View Details"]}),(0,s.jsxs)(C.Xi,{onClick:()=>Q(t),disabled:"active"!==t.status,children:[(0,s.jsx)(h.Z,{className:"h-4 w-4 mr-2"}),"Execute"]}),(0,s.jsxs)(C.Xi,{onClick:()=>ee(t),children:[(0,s.jsx)(x.Z,{className:"h-4 w-4 mr-2"}),"Duplicate"]}),(0,s.jsx)(C.VD,{}),(0,s.jsxs)(C.Xi,{className:"text-destructive",onClick:r,children:[(0,s.jsx)(f.Z,{className:"h-4 w-4 mr-2"}),"Delete"]})]})]})]})},customColumnRenderers:{name:(e,t)=>(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{className:"text-primary hover:underline text-left font-medium",onClick:()=>E.push("/workflows/detail?id=".concat(t.id)),children:e}),t.description&&(0,s.jsx)("span",{className:"text-sm text-muted-foreground",children:t.description})]}),status:e=>er(e),trigger_type:e=>es(e),updatedAt:e=>(0,s.jsx)("span",{className:"text-muted-foreground",children:new Date(e).toLocaleString()})},customBulkActions:el,onRefresh:()=>V(e=>e+1)},T),(0,s.jsx)(_.Vq,{open:D,onOpenChange:O,children:(0,s.jsxs)(_.cZ,{children:[(0,s.jsxs)(_.fK,{children:[(0,s.jsx)(_.$N,{children:"Execute Workflow"}),(0,s.jsxs)(_.Be,{children:["Are you sure you want to execute the workflow"," ",(0,s.jsx)("strong",{children:null==z?void 0:z.name}),"?"]})]}),(0,s.jsx)("p",{className:"text-muted-foreground text-sm",children:"This will start the workflow execution immediately."}),(0,s.jsxs)(_.cN,{children:[(0,s.jsx)(b.z,{variant:"outline",onClick:()=>O(!1),children:"Cancel"}),(0,s.jsx)(b.z,{onClick:()=>{z&&q({url:"/workflows/".concat(z.id,"/execute"),method:"post",values:{}},{onSuccess:()=>{a.Am.success("Workflow execution started"),O(!1),E.push("/workflows/detail?id=".concat(z.id))},onError:()=>{a.Am.error("Failed to execute workflow")}})},children:"Execute"})]})]})}),(0,s.jsx)(_.Vq,{open:I,onOpenChange:F,children:(0,s.jsxs)(_.cZ,{className:"max-w-2xl",children:[(0,s.jsx)(_.fK,{children:(0,s.jsx)(_.$N,{children:"Import Workflows"})}),R&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-medium mb-2",children:"Import Summary:"}),(0,s.jsxs)("ul",{className:"list-disc list-inside text-sm text-muted-foreground",children:[(0,s.jsxs)("li",{children:["Total workflows: ",R.total]}),(0,s.jsxs)("li",{children:["New workflows: ",R.new]}),(0,s.jsxs)("li",{children:["Existing workflows: ",(null===(e=R.conflicts)||void 0===e?void 0:e.length)||0]})]})]}),R.conflicts&&R.conflicts.length>0&&(0,s.jsxs)("div",{className:"space-y-2",children:[(0,s.jsxs)(A.bZ,{variant:"destructive",className:"border-yellow-500 bg-yellow-50 dark:bg-yellow-900/20",children:[(0,s.jsx)(v.Z,{className:"h-4 w-4"}),(0,s.jsx)(A.Cd,{children:"Workflow Conflicts Detected"}),(0,s.jsx)(A.X,{children:"The following workflows already exist. Choose to overwrite them or import new ones only."})]}),(0,s.jsx)(Z.x,{className:"h-48 border rounded-md p-4",children:(0,s.jsx)("div",{className:"space-y-2",children:R.conflicts.map(e=>{var t,r;return(0,s.jsxs)("div",{className:"border-b pb-2 last:border-0",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"font-medium",children:e.name}),(null===(t=e.existing)||void 0===t?void 0:t.isDeleted)&&(0,s.jsx)(N.C,{variant:"destructive",className:"text-xs",children:"Deleted - will be restored"})]}),(0,s.jsxs)("p",{className:"text-xs text-muted-foreground",children:["ID: ",e.id," | Type: ",e.trigger_type," | Status: ",null===(r=e.existing)||void 0===r?void 0:r.status]})]},e.id)})})})]}),R.new>0&&(0,s.jsxs)(A.bZ,{children:[(0,s.jsx)(y.Z,{className:"h-4 w-4"}),(0,s.jsxs)(A.X,{children:[R.new," new workflow(s) will be imported"]})]})]}),(0,s.jsxs)(_.cN,{children:[(0,s.jsx)(b.z,{variant:"outline",onClick:()=>{F(!1),L(null),X(null)},children:"Cancel"}),(null==R?void 0:null===(t=R.conflicts)||void 0===t?void 0:t.length)>0&&(0,s.jsx)(b.z,{variant:"secondary",onClick:()=>Y(!1),children:"Import New Only"}),(0,s.jsx)(b.z,{onClick:()=>Y(!0),children:(null==R?void 0:null===(r=R.conflicts)||void 0===r?void 0:r.length)>0?"Import & Overwrite":"Import"})]})]})})]})};function z(){return(0,s.jsx)(E,{})}}},function(e){e.O(0,[7999,3572,7902,5094,4438,6530,4475,6241,926,600,1668,2676,1509,6869,9487,1783,9881,7324,9124,6712,2667,1407,1303,3817,2971,2117,1744],function(){return e(e.s=69162)}),_N_E=e.O()}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3185],{24654:function(){},72928:function(e,t,r){Promise.resolve().then(r.bind(r,84821))},84821:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return x}});var o=r(57437),s=r(2265),n=r(48667),a=r(72135),l=r(25655),i=r(45114),c=r(81853),u=r(28757),d=r(66037),y=r(83434),g=r(25922),f=r(14438);let m=e=>{let{...t}=e,{theme:r="system"}=(0,g.F)();return(0,o.jsx)(f.x7,{theme:r,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})};var p=r(71488);r(69268);let h=(0,u.DG)(y.G),b=(0,d.S)(y.G);function P(){return(0,o.jsx)("div",{className:"flex items-center justify-center min-h-screen bg-background",children:(0,o.jsxs)("div",{className:"text-center",children:[(0,o.jsx)("div",{className:"inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent align-[-0.125em] motion-reduce:animate-[spin_1.5s_linear_infinite]"}),(0,o.jsx)("p",{className:"mt-4 text-muted-foreground",children:"Loading..."})]})})}function v(e){let{children:t}=e,{projectSettings:r,isLoading:u}=(0,c.PY)();return(0,o.jsxs)("html",{lang:"en",suppressHydrationWarning:!0,children:[(0,o.jsxs)("head",{children:[(0,o.jsx)("title",{children:(null==r?void 0:r.name)||"Baasix"}),r&&(0,o.jsx)("link",{rel:"icon",href:"/assets/project_favicon"}),(0,o.jsx)(n.default,{src:"https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT",strategy:"afterInteractive"}),(0,o.jsx)(n.default,{id:"google-analytics",strategy:"afterInteractive",children:"\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', 'G-FBCW8DT7KT');\n "})]}),(0,o.jsx)("body",{className:"min-h-screen bg-background font-sans antialiased",children:(0,o.jsx)(s.Suspense,{fallback:(0,o.jsx)(P,{}),children:u?(0,o.jsx)(P,{}):(0,o.jsx)(a.N3,{routerProvider:l.ZP,dataProvider:h,authProvider:b,options:{syncWithLocation:!0,warnWhenUnsavedChanges:!0,useNewQueryKeys:!0,projectId:"qgjtlG-FtlSdF-Y2VHcF",disableTelemetry:!0},children:(0,o.jsxs)(i.ze,{defaultMode:"dark",children:[(0,o.jsx)(p.pn,{delayDuration:0,children:t}),(0,o.jsx)(m,{})]})})})})]})}function x(e){let{children:t}=e;return(0,o.jsx)(c.Ml,{baasixClient:y.G,children:(0,o.jsx)(v,{children:t})})}},71488:function(e,t,r){"use strict";r.d(t,{_v:function(){return u},aJ:function(){return c},pn:function(){return l},u:function(){return i}});var o=r(57437),s=r(2265),n=r(91668),a=r(93448);let l=n.zt,i=n.fC,c=n.xz,u=s.forwardRef((e,t)=>{let{className:r,sideOffset:s=4,...l}=e;return(0,o.jsx)(n.VY,{ref:t,sideOffset:s,className:(0,a.cn)("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",r),...l})});u.displayName=n.VY.displayName},93448:function(e,t,r){"use strict";r.d(t,{cn:function(){return n}});var o=r(61994),s=r(53335);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,s.m6)((0,o.W)(t))}},66037:function(e,t,r){"use strict";r.d(t,{S:function(){return i}});var o=r(49112);let s="token",n="baasix_access_token",a="user",l="baasix_user",i=e=>({login:async t=>{let{email:r,password:i}=t;try{let t=await e.auth.login({email:r,password:i});if(t.user){var c,u;if((null===(u=t.role)||void 0===u?void 0:null===(c=u.name)||void 0===c?void 0:c.toLowerCase())!=="administrator")return{success:!1,error:{message:"Access denied",name:"Only administrators can access this application"}};t.token&&(localStorage.setItem(s,t.token),localStorage.setItem(n,t.token));let e=JSON.stringify(t.user);return localStorage.setItem(a,e),localStorage.setItem(l,e),{success:!0,redirectTo:"/"}}return{success:!1,error:{message:"Login failed",name:"Invalid email or password"}}}catch(e){return{success:!1,error:{message:"Login failed",name:e instanceof o.NQ?e.message:"Invalid email or password"}}}},logout:async()=>{localStorage.removeItem(s),localStorage.removeItem(n),localStorage.removeItem(a),localStorage.removeItem(l),localStorage.removeItem("baasix_refresh_token"),localStorage.removeItem("baasix_token_expiry");try{await e.auth.logout()}catch(e){console.error("Logout error:",e)}return{success:!0,redirectTo:"/login"}},check:async()=>localStorage.getItem(s)||localStorage.getItem(n)?{authenticated:!0}:{authenticated:!1,error:{message:"Not authenticated",name:"Unauthorized"},redirectTo:"/login"},getPermissions:async()=>{try{let t=localStorage.getItem(a)||localStorage.getItem(l);if(t){var e;let r=JSON.parse(t);return(null==r?void 0:null===(e=r.role)||void 0===e?void 0:e.permissions)||[]}}catch(e){}return[]},getIdentity:async()=>{try{let t=localStorage.getItem(a)||localStorage.getItem(l);if(t)return JSON.parse(t);let r=await e.auth.getUser();if(r){let e=JSON.stringify(r);localStorage.setItem(a,e),localStorage.setItem(l,e)}return r}catch(e){return null}},onError:async e=>{let t=e instanceof o.NQ?e.status:null==e?void 0:e.status;return 401===t||403===t?{logout:!0,redirectTo:"/login",error:{message:"Unauthorized",name:"Unauthorized"}}:{}}})},81853:function(e,t,r){"use strict";r.d(t,{Ml:function(){return l},PY:function(){return a}});var o=r(57437),s=r(2265);let n=(0,s.createContext)({projectSettings:null,isMultiTenant:!1,isLoading:!0,refetch:()=>{}}),a=()=>s.useContext(n)||(console.warn("useProject used outside of ProjectContextProvider, using defaults"),{projectSettings:null,isMultiTenant:!1,isLoading:!1,refetch:()=>{}}),l=e=>{let{children:t,baasixClient:r}=e,[a,l]=(0,s.useState)(null),[i,c]=(0,s.useState)(!0),u=(0,s.useCallback)(async()=>{try{c(!0);let e=await r.server.info();l(null==e?void 0:e.project)}catch(e){console.error("Failed to fetch project settings",e)}finally{c(!1)}},[r]);(0,s.useEffect)(()=>{u()},[u]);let d=(null==a?void 0:a.multitenant)===!0||(null==a?void 0:a.multitenant)==="true";return(0,o.jsx)(n.Provider,{value:{projectSettings:a,isMultiTenant:d,isLoading:i,refetch:u},children:t})}},45114:function(e,t,r){"use strict";r.d(t,{Fg:function(){return i},ze:function(){return y}});var o=r(57437),s=r(2265),n=r(25922),a=r(81853);let l=(0,s.createContext)({}),i=()=>{let e=s.useContext(l);if(!e)throw Error("useTheme must be used within a ThemeContextProvider");return e};function c(e,t,r){return"".concat(e," ").concat(t,"% ").concat(r,"%")}function u(e,t,r){return Math.min(Math.max(e,t),r)}let d=e=>{let{children:t,defaultMode:r="dark"}=e,{setTheme:i,resolvedTheme:d}=(0,n.F)(),{projectSettings:y}=(0,a.PY)(),[g,f]=(0,s.useState)(!1);return((0,s.useEffect)(()=>{f(!0)},[]),(0,s.useEffect)(()=>{g&&(null==y?void 0:y.color)&&function(e,t){let r=function(e){if(6!==(e=e.replace(/^#/,"")).length)return null;let t=parseInt(e.substring(0,2),16)/255,r=parseInt(e.substring(2,4),16)/255,o=parseInt(e.substring(4,6),16)/255,s=Math.max(t,r,o),n=Math.min(t,r,o),a=0,l=0,i=(s+n)/2;if(s!==n){let e=s-n;switch(l=i>.5?e/(2-s-n):e/(s+n),s){case t:a=((r-o)/e+(r<o?6:0))/6;break;case r:a=((o-t)/e+2)/6;break;case o:a=((t-r)/e+4)/6}}return{h:Math.round(360*a),s:Math.round(100*l),l:Math.round(100*i)}}(e);if(!r)return;let o=document.documentElement,{h:s,s:n,l:a}=r,l=c(s,n,a);o.style.setProperty("--primary",l);let i=a>50?c(s,u(n-10,0,100),10):c(s,u(n-10,0,100),98);if(o.style.setProperty("--primary-foreground",i),o.style.setProperty("--ring",l),t){let e=c(s,u(n-20,10,40),u(a-5,15,25));o.style.setProperty("--accent",e),o.style.setProperty("--accent-foreground",c(s,u(n-30,0,30),95));let t=c(s,u(n-25,5,35),u(a-10,15,22));o.style.setProperty("--muted",t),o.style.setProperty("--muted-foreground",c(s,u(n-30,5,25),65)),o.style.setProperty("--secondary",c(s,u(n-20,10,35),u(a-8,15,22))),o.style.setProperty("--secondary-foreground",c(s,u(n-30,0,30),95)),o.style.setProperty("--border",c(s,u(n-25,5,35),u(a-10,18,28))),o.style.setProperty("--input",c(s,u(n-25,5,35),u(a-10,18,28))),o.style.setProperty("--sidebar-background",c(s,u(n-30,5,20),8)),o.style.setProperty("--sidebar-foreground",c(s,u(n-30,5,20),92)),o.style.setProperty("--sidebar-primary",l),o.style.setProperty("--sidebar-primary-foreground",i),o.style.setProperty("--sidebar-accent",c(s,u(n-25,5,25),15)),o.style.setProperty("--sidebar-accent-foreground",c(s,u(n-30,5,20),92)),o.style.setProperty("--sidebar-border",c(s,u(n-30,5,20),15)),o.style.setProperty("--sidebar-ring",l),o.style.setProperty("--chart-1",c(s,70,50)),o.style.setProperty("--chart-2",c((s+60)%360,60,45)),o.style.setProperty("--chart-3",c((s+120)%360,80,55)),o.style.setProperty("--chart-4",c((s+180)%360,65,60)),o.style.setProperty("--chart-5",c((s+240)%360,75,55))}else{let e=c(s,u(n-10,20,50),u(a+30,90,97));o.style.setProperty("--accent",e),o.style.setProperty("--accent-foreground",c(s,u(n,30,60),15));let t=c(s,u(n-20,10,45),u(a+35,94,98));o.style.setProperty("--muted",t),o.style.setProperty("--muted-foreground",c(s,u(n-20,10,30),45)),o.style.setProperty("--secondary",c(s,u(n-15,15,45),u(a+32,92,97))),o.style.setProperty("--secondary-foreground",c(s,u(n,30,60),15)),o.style.setProperty("--border",c(s,u(n-20,10,35),88)),o.style.setProperty("--input",c(s,u(n-20,10,35),88)),o.style.setProperty("--sidebar-background",c(s,u(n-25,5,25),97)),o.style.setProperty("--sidebar-foreground",c(s,u(n-20,10,30),25)),o.style.setProperty("--sidebar-primary",l),o.style.setProperty("--sidebar-primary-foreground",i),o.style.setProperty("--sidebar-accent",c(s,u(n-15,10,40),93)),o.style.setProperty("--sidebar-accent-foreground",c(s,u(n-20,10,30),20)),o.style.setProperty("--sidebar-border",c(s,u(n-25,5,25),90)),o.style.setProperty("--sidebar-ring",l),o.style.setProperty("--chart-1",c(s,76,61)),o.style.setProperty("--chart-2",c((s+60)%360,58,39)),o.style.setProperty("--chart-3",c((s+120)%360,37,24)),o.style.setProperty("--chart-4",c((s+180)%360,74,66)),o.style.setProperty("--chart-5",c((s+240)%360,87,67))}}(y.color,"dark"===d)},[g,null==y?void 0:y.color,d]),g)?(0,o.jsx)(l.Provider,{value:{setMode:()=>{i("light"===d?"dark":"light")},mode:d||r,primaryColor:(null==y?void 0:y.color)||"#644152"},children:t}):null},y=e=>{let{children:t,defaultMode:r="dark"}=e;return(0,o.jsx)(n.f,{attribute:"class",defaultTheme:r,enableSystem:!0,children:(0,o.jsx)(d,{defaultMode:r,children:t})})}},69268:function(){}},function(e){e.O(0,[7825,7999,5094,4438,6530,6241,1668,6869,8473,4883,1303,2971,2117,1744],function(){return e(e.s=72928)}),_N_E=e.O()}]);
|
package/dist/app/_next/static/chunks/{webpack-7a100cbf9402e7ea.js → webpack-706ae56cbfc92c86.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";var e,t,n,r,o,c,a,u,i,f,d,s,l={},b={};function p(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}},r=!0;try{l[e].call(n.exports,n,n.exports,p),r=!1}finally{r&&delete b[e]}return n.exports}p.m=l,e=[],p.O=function(t,n,r,o){if(n){o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[n,r,o];return}for(var a=1/0,c=0;c<e.length;c++){for(var n=e[c][0],r=e[c][1],o=e[c][2],u=!0,i=0;i<n.length;i++)a>=o&&Object.keys(p.O).every(function(e){return p.O[e](n[i])})?n.splice(i--,1):(u=!1,o<a&&(a=o));if(u){e.splice(c--,1);var f=r();void 0!==f&&(t=f)}}return t},p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},p.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);p.r(o);var c={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach(function(t){c[t]=function(){return e[t]}});return c.default=function(){return e},p.d(o,c),o},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return 4212===e?"static/chunks/d0deef33.0379166a4ec23470.js":2344===e?"static/chunks/2344.35b46d2179a765b5.js":1627===e?"static/chunks/1627.e85886e75c6c4cf1.js":780===e?"static/chunks/c37d3baf.c2ff165f5b02c692.js":3834===e?"static/chunks/3834.84944e390d902509.js":1299===e?"static/chunks/1299.77cc7b7b76b75cba.js":"static/chunks/"+(({3572:"70e0d97a",7902:"54a60aa6",7999:"6fcbdc68"})[e]||e)+"-"+({600:"539045311240f579",926:"156f32067d111d6b",1509:"56ac00cdaaecdf53",1668:"e3eabd0f6753c780",1783:"d9fb550fd324300c",2667:"7993936698bf75a9",2676:"73b0ee7c80073a84",3563:"b8842744384391fe",3572:"aeaf0cdc26ba1a58",3817:"863d6bb5cfa0a8de",
|
|
1
|
+
!function(){"use strict";var e,t,n,r,o,c,a,u,i,f,d,s,l={},b={};function p(e){var t=b[e];if(void 0!==t)return t.exports;var n=b[e]={exports:{}},r=!0;try{l[e].call(n.exports,n,n.exports,p),r=!1}finally{r&&delete b[e]}return n.exports}p.m=l,e=[],p.O=function(t,n,r,o){if(n){o=o||0;for(var c=e.length;c>0&&e[c-1][2]>o;c--)e[c]=e[c-1];e[c]=[n,r,o];return}for(var a=1/0,c=0;c<e.length;c++){for(var n=e[c][0],r=e[c][1],o=e[c][2],u=!0,i=0;i<n.length;i++)a>=o&&Object.keys(p.O).every(function(e){return p.O[e](n[i])})?n.splice(i--,1):(u=!1,o<a&&(a=o));if(u){e.splice(c--,1);var f=r();void 0!==f&&(t=f)}}return t},p.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return p.d(t,{a:t}),t},n=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__},p.t=function(e,r){if(1&r&&(e=this(e)),8&r||"object"==typeof e&&e&&(4&r&&e.__esModule||16&r&&"function"==typeof e.then))return e;var o=Object.create(null);p.r(o);var c={};t=t||[null,n({}),n([]),n(n)];for(var a=2&r&&e;"object"==typeof a&&!~t.indexOf(a);a=n(a))Object.getOwnPropertyNames(a).forEach(function(t){c[t]=function(){return e[t]}});return c.default=function(){return e},p.d(o,c),o},p.d=function(e,t){for(var n in t)p.o(t,n)&&!p.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},p.f={},p.e=function(e){return Promise.all(Object.keys(p.f).reduce(function(t,n){return p.f[n](e,t),t},[]))},p.u=function(e){return 4212===e?"static/chunks/d0deef33.0379166a4ec23470.js":2344===e?"static/chunks/2344.35b46d2179a765b5.js":1627===e?"static/chunks/1627.e85886e75c6c4cf1.js":780===e?"static/chunks/c37d3baf.c2ff165f5b02c692.js":3834===e?"static/chunks/3834.84944e390d902509.js":1299===e?"static/chunks/1299.77cc7b7b76b75cba.js":"static/chunks/"+(({3572:"70e0d97a",7902:"54a60aa6",7999:"6fcbdc68"})[e]||e)+"-"+({600:"539045311240f579",926:"156f32067d111d6b",1303:"7995fedb9f2f2f71",1407:"cec5715f4fa2cd05",1509:"56ac00cdaaecdf53",1668:"e3eabd0f6753c780",1783:"d9fb550fd324300c",2667:"7993936698bf75a9",2676:"73b0ee7c80073a84",3563:"b8842744384391fe",3572:"aeaf0cdc26ba1a58",3817:"863d6bb5cfa0a8de",4438:"c9a12ca15b6e9160",4475:"8bdfbd536fba8c48",5094:"8d53e403235d4ca6",6241:"30d7169d1010e5a4",6530:"a91e10cffa4200c4",6712:"781937c53a2c49da",6869:"4f920a71fdc6b538",7324:"b53229c59a640880",7902:"d9747982e0a81f58",7999:"90be1a5480b8d353",9124:"a02f9e209e6e3cce",9487:"b17481605e513b83",9881:"419697138376e755"})[e]+".js"},p.miniCssF=function(e){return"static/css/a275cc2b185e04f8.css"},p.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||Function("return this")()}catch(e){if("object"==typeof window)return window}}(),p.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r={},o="_N_E:",p.l=function(e,t,n,c){if(r[e]){r[e].push(t);return}if(void 0!==n)for(var a,u,i=document.getElementsByTagName("script"),f=0;f<i.length;f++){var d=i[f];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==o+n){a=d;break}}a||(u=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,p.nc&&a.setAttribute("nonce",p.nc),a.setAttribute("data-webpack",o+n),a.src=p.tu(e)),r[e]=[t];var s=function(t,n){a.onerror=a.onload=null,clearTimeout(l);var o=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),o&&o.forEach(function(e){return e(n)}),t)return t(n)},l=setTimeout(s.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=s.bind(null,a.onerror),a.onload=s.bind(null,a.onload),u&&document.head.appendChild(a)},p.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},p.tt=function(){return void 0===c&&(c={createScriptURL:function(e){return e}},"undefined"!=typeof trustedTypes&&trustedTypes.createPolicy&&(c=trustedTypes.createPolicy("nextjs#bundler",c))),c},p.tu=function(e){return p.tt().createScriptURL(e)},p.p="/admin/_next/",a=function(e,t,n,r){var o=document.createElement("link");return o.rel="stylesheet",o.type="text/css",o.onerror=o.onload=function(c){if(o.onerror=o.onload=null,"load"===c.type)n();else{var a=c&&("load"===c.type?"missing":c.type),u=c&&c.target&&c.target.href||t,i=Error("Loading CSS chunk "+e+" failed.\n("+u+")");i.code="CSS_CHUNK_LOAD_FAILED",i.type=a,i.request=u,o.parentNode.removeChild(o),r(i)}},o.href=t,document.head.appendChild(o),o},u=function(e,t){for(var n=document.getElementsByTagName("link"),r=0;r<n.length;r++){var o=n[r],c=o.getAttribute("data-href")||o.getAttribute("href");if("stylesheet"===o.rel&&(c===e||c===t))return o}for(var a=document.getElementsByTagName("style"),r=0;r<a.length;r++){var o=a[r],c=o.getAttribute("data-href");if(c===e||c===t)return o}},i={2272:0},p.f.miniCss=function(e,t){i[e]?t.push(i[e]):0!==i[e]&&({1627:1})[e]&&t.push(i[e]=new Promise(function(t,n){var r=p.miniCssF(e),o=p.p+r;if(u(r,o))return t();a(e,o,t,n)}).then(function(){i[e]=0},function(t){throw delete i[e],t}))},f={2272:0,7825:0},p.f.j=function(e,t){var n=p.o(f,e)?f[e]:void 0;if(0!==n){if(n)t.push(n[2]);else if(/^(1627|2272|7825)$/.test(e))f[e]=0;else{var r=new Promise(function(t,r){n=f[e]=[t,r]});t.push(n[2]=r);var o=p.p+p.u(e),c=Error();p.l(o,function(t){if(p.o(f,e)&&(0!==(n=f[e])&&(f[e]=void 0),n)){var r=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+r+": "+o+")",c.name="ChunkLoadError",c.type=r,c.request=o,n[1](c)}},"chunk-"+e,e)}}},p.O.j=function(e){return 0===f[e]},d=function(e,t){var n,r,o=t[0],c=t[1],a=t[2],u=0;if(o.some(function(e){return 0!==f[e]})){for(n in c)p.o(c,n)&&(p.m[n]=c[n]);if(a)var i=a(p)}for(e&&e(t);u<o.length;u++)r=o[u],p.o(f,r)&&f[r]&&f[r][0](),f[r]=0;return p.O(i)},(s=self.webpackChunk_N_E=self.webpackChunk_N_E||[]).forEach(d.bind(null,0)),s.push=d.bind(null,s.push.bind(s)),p.nc=void 0}();
|