@baasix/baasix 0.1.66 → 0.1.68

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/dist/app/404/index.html +1 -1
  2. package/dist/app/404.html +1 -1
  3. package/dist/app/_next/static/chunks/4766-5d83c2d6dff813e8.js +1 -0
  4. package/dist/app/_next/static/chunks/6027-6d39d2ce7e6eb750.js +1 -0
  5. package/dist/app/_next/static/chunks/app/(authenticated)/layout-2950fbbfeba06dab.js +1 -0
  6. package/dist/app/_next/static/chunks/app/(authenticated)/settings/migrations/{page-505c3389890685b9.js → page-a7c078a1d9b3066a.js} +1 -1
  7. package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema-diff/page-b1885f4d82ce1ba6.js +1 -0
  8. package/dist/app/_next/static/css/268abf03bd241f28.css +3 -0
  9. package/dist/app/activity-log/all-activity/index.html +1 -1
  10. package/dist/app/activity-log/all-activity/index.txt +2 -2
  11. package/dist/app/activity-log/email-log/index.html +1 -1
  12. package/dist/app/activity-log/email-log/index.txt +2 -2
  13. package/dist/app/activity-log/index.html +1 -1
  14. package/dist/app/activity-log/index.txt +2 -2
  15. package/dist/app/activity-log/notifications/index.html +1 -1
  16. package/dist/app/activity-log/notifications/index.txt +2 -2
  17. package/dist/app/activity-log/sessions/index.html +1 -1
  18. package/dist/app/activity-log/sessions/index.txt +2 -2
  19. package/dist/app/activity-log/workflow-executions/index.html +1 -1
  20. package/dist/app/activity-log/workflow-executions/index.txt +2 -2
  21. package/dist/app/activity-log/workflow-logs/index.html +1 -1
  22. package/dist/app/activity-log/workflow-logs/index.txt +2 -2
  23. package/dist/app/change-password/index.html +1 -1
  24. package/dist/app/change-password/index.txt +2 -2
  25. package/dist/app/dashboard/index.html +1 -1
  26. package/dist/app/dashboard/index.txt +2 -2
  27. package/dist/app/data-browser/index.html +1 -1
  28. package/dist/app/data-browser/index.txt +2 -2
  29. package/dist/app/file-manager/index.html +1 -1
  30. package/dist/app/file-manager/index.txt +2 -2
  31. package/dist/app/forgot-password/index.html +1 -1
  32. package/dist/app/forgot-password/index.txt +1 -1
  33. package/dist/app/index.html +1 -1
  34. package/dist/app/index.txt +1 -1
  35. package/dist/app/login/index.html +1 -1
  36. package/dist/app/login/index.txt +1 -1
  37. package/dist/app/register/index.html +1 -1
  38. package/dist/app/register/index.txt +1 -1
  39. package/dist/app/settings/migrations/index.html +1 -1
  40. package/dist/app/settings/migrations/index.txt +3 -3
  41. package/dist/app/settings/permissions/index.html +1 -1
  42. package/dist/app/settings/permissions/index.txt +2 -2
  43. package/dist/app/settings/project/index.html +1 -1
  44. package/dist/app/settings/project/index.txt +2 -2
  45. package/dist/app/settings/roles/index.html +1 -1
  46. package/dist/app/settings/roles/index.txt +2 -2
  47. package/dist/app/settings/schema/index.html +1 -1
  48. package/dist/app/settings/schema/index.txt +2 -2
  49. package/dist/app/settings/schema-diff/index.html +1 -1
  50. package/dist/app/settings/schema-diff/index.txt +3 -3
  51. package/dist/app/settings/tasks/index.html +1 -1
  52. package/dist/app/settings/tasks/index.txt +2 -2
  53. package/dist/app/settings/templates/edit/index.html +1 -1
  54. package/dist/app/settings/templates/edit/index.txt +2 -2
  55. package/dist/app/settings/templates/index.html +1 -1
  56. package/dist/app/settings/templates/index.txt +2 -2
  57. package/dist/app/settings/tenants/index.html +1 -1
  58. package/dist/app/settings/tenants/index.txt +2 -2
  59. package/dist/app/users/index.html +1 -1
  60. package/dist/app/users/index.txt +2 -2
  61. package/dist/app/users/invites/index.html +1 -1
  62. package/dist/app/users/invites/index.txt +2 -2
  63. package/dist/app/users/list/index.html +1 -1
  64. package/dist/app/users/list/index.txt +2 -2
  65. package/dist/app/users/preferences/index.html +1 -1
  66. package/dist/app/users/preferences/index.txt +2 -2
  67. package/dist/app/users/user-roles/index.html +1 -1
  68. package/dist/app/users/user-roles/index.txt +2 -2
  69. package/dist/app/workflows/detail/index.html +1 -1
  70. package/dist/app/workflows/detail/index.txt +2 -2
  71. package/dist/app/workflows/edit/index.html +1 -1
  72. package/dist/app/workflows/edit/index.txt +2 -2
  73. package/dist/app/workflows/execution/index.html +1 -1
  74. package/dist/app/workflows/execution/index.txt +2 -2
  75. package/dist/app/workflows/index.html +1 -1
  76. package/dist/app/workflows/index.txt +2 -2
  77. package/dist/auth/routes.d.ts.map +1 -1
  78. package/dist/auth/routes.js +11 -0
  79. package/dist/auth/routes.js.map +1 -1
  80. package/dist/auth/services/session.d.ts.map +1 -1
  81. package/dist/auth/services/session.js +15 -0
  82. package/dist/auth/services/session.js.map +1 -1
  83. package/dist/routes/schema-diff.route.d.ts.map +1 -1
  84. package/dist/routes/schema-diff.route.js +70 -0
  85. package/dist/routes/schema-diff.route.js.map +1 -1
  86. package/dist/routes/schema.route.js +3 -3
  87. package/dist/routes/schema.route.js.map +1 -1
  88. package/dist/utils/schemaManager.d.ts.map +1 -1
  89. package/dist/utils/schemaManager.js +76 -1
  90. package/dist/utils/schemaManager.js.map +1 -1
  91. package/dist/utils/systemschema.d.ts +8 -2
  92. package/dist/utils/systemschema.d.ts.map +1 -1
  93. package/dist/utils/systemschema.js +5 -0
  94. package/dist/utils/systemschema.js.map +1 -1
  95. package/package.json +1 -1
  96. package/dist/app/_next/static/chunks/3233-ae028c73c510ebea.js +0 -1
  97. package/dist/app/_next/static/chunks/799-d4372ad380b0dec6.js +0 -1
  98. package/dist/app/_next/static/chunks/app/(authenticated)/layout-b7f18737e4c308a4.js +0 -1
  99. package/dist/app/_next/static/chunks/app/(authenticated)/settings/schema-diff/page-cae8772a7ae93b9a.js +0 -1
  100. package/dist/app/_next/static/css/45276c37be155f45.css +0 -3
  101. /package/dist/app/_next/static/{0OAEQ9OeMefOQpSdB_tKL → MOjte1maseOzDogE76k_j}/_buildManifest.js +0 -0
  102. /package/dist/app/_next/static/{0OAEQ9OeMefOQpSdB_tKL → MOjte1maseOzDogE76k_j}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/45276c37be155f45.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js"/><script src="/admin/_next/static/chunks/fd9d1056-54169f07cd680d6c.js" async=""></script><script src="/admin/_next/static/chunks/2117-29b5fa47421595ad.js" async=""></script><script src="/admin/_next/static/chunks/main-app-55bcae20c77aaf0e.js" async=""></script><script src="/admin/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js" async=""></script><script src="/admin/_next/static/chunks/5094-8d53e403235d4ca6.js" async=""></script><script src="/admin/_next/static/chunks/4438-c9a12ca15b6e9160.js" async=""></script><script src="/admin/_next/static/chunks/6530-a91e10cffa4200c4.js" async=""></script><script src="/admin/_next/static/chunks/6241-30d7169d1010e5a4.js" async=""></script><script src="/admin/_next/static/chunks/1668-e3eabd0f6753c780.js" async=""></script><script src="/admin/_next/static/chunks/6869-4f920a71fdc6b538.js" async=""></script><script src="/admin/_next/static/chunks/8473-6598318371eca31b.js" async=""></script><script src="/admin/_next/static/chunks/4883-8a924721bb21b3b0.js" async=""></script><script src="/admin/_next/static/chunks/7304-bdd00a7504bc4081.js" async=""></script><script src="/admin/_next/static/chunks/app/layout-64ac14a534e2809b.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT" as="script"/><meta name="robots" content="noindex"/><title>Baasix</title><script src="/admin/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-background font-sans antialiased"><!--$--><div class="flex items-center justify-center min-h-screen bg-background"><div class="text-center"><div class="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]"></div><p class="mt-4 text-muted-foreground">Loading...</p></div></div><!--/$--><script src="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/admin/_next/static/css/45276c37be155f45.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[36423,[],\"\"]\n6:I[84821,[\"7999\",\"static/chunks/6fcbdc68-90be1a5480b8d353.js\",\"5094\",\"static/chunks/5094-8d53e403235d4ca6.js\",\"4438\",\"static/chunks/4438-c9a12ca15b6e9160.js\",\"6530\",\"static/chunks/6530-a91e10cffa4200c4.js\",\"6241\",\"static/chunks/6241-30d7169d1010e5a4.js\",\"1668\",\"static/chunks/1668-e3eabd0f6753c780.js\",\"6869\",\"static/chunks/6869-4f920a71fdc6b538.js\",\"8473\",\"static/chunks/8473-6598318371eca31b.js\",\"4883\",\"static/chunks/4883-8a924721bb21b3b0.js\",\"7304\",\"static/chunks/7304-bdd00a7504bc4081.js\",\"3185\",\"static/chunks/app/layout-64ac14a534e2809b.js\"],\"default\",1]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"0OAEQ9OeMefOQpSdB_tKL\",\"assetPrefix\":\"/admin\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/admin/_next/static/css/45276c37be155f45.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/268abf03bd241f28.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js"/><script src="/admin/_next/static/chunks/fd9d1056-54169f07cd680d6c.js" async=""></script><script src="/admin/_next/static/chunks/2117-29b5fa47421595ad.js" async=""></script><script src="/admin/_next/static/chunks/main-app-55bcae20c77aaf0e.js" async=""></script><script src="/admin/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js" async=""></script><script src="/admin/_next/static/chunks/5094-8d53e403235d4ca6.js" async=""></script><script src="/admin/_next/static/chunks/4438-c9a12ca15b6e9160.js" async=""></script><script src="/admin/_next/static/chunks/6530-a91e10cffa4200c4.js" async=""></script><script src="/admin/_next/static/chunks/6241-30d7169d1010e5a4.js" async=""></script><script src="/admin/_next/static/chunks/1668-e3eabd0f6753c780.js" async=""></script><script src="/admin/_next/static/chunks/6869-4f920a71fdc6b538.js" async=""></script><script src="/admin/_next/static/chunks/8473-6598318371eca31b.js" async=""></script><script src="/admin/_next/static/chunks/4883-8a924721bb21b3b0.js" async=""></script><script src="/admin/_next/static/chunks/7304-bdd00a7504bc4081.js" async=""></script><script src="/admin/_next/static/chunks/app/layout-64ac14a534e2809b.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT" as="script"/><meta name="robots" content="noindex"/><title>Baasix</title><script src="/admin/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-background font-sans antialiased"><!--$--><div class="flex items-center justify-center min-h-screen bg-background"><div class="text-center"><div class="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]"></div><p class="mt-4 text-muted-foreground">Loading...</p></div></div><!--/$--><script src="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/admin/_next/static/css/268abf03bd241f28.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[36423,[],\"\"]\n6:I[84821,[\"7999\",\"static/chunks/6fcbdc68-90be1a5480b8d353.js\",\"5094\",\"static/chunks/5094-8d53e403235d4ca6.js\",\"4438\",\"static/chunks/4438-c9a12ca15b6e9160.js\",\"6530\",\"static/chunks/6530-a91e10cffa4200c4.js\",\"6241\",\"static/chunks/6241-30d7169d1010e5a4.js\",\"1668\",\"static/chunks/1668-e3eabd0f6753c780.js\",\"6869\",\"static/chunks/6869-4f920a71fdc6b538.js\",\"8473\",\"static/chunks/8473-6598318371eca31b.js\",\"4883\",\"static/chunks/4883-8a924721bb21b3b0.js\",\"7304\",\"static/chunks/7304-bdd00a7504bc4081.js\",\"3185\",\"static/chunks/app/layout-64ac14a534e2809b.js\"],\"default\",1]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"MOjte1maseOzDogE76k_j\",\"assetPrefix\":\"/admin\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/admin/_next/static/css/268abf03bd241f28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
package/dist/app/404.html CHANGED
@@ -1 +1 @@
1
- <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/45276c37be155f45.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js"/><script src="/admin/_next/static/chunks/fd9d1056-54169f07cd680d6c.js" async=""></script><script src="/admin/_next/static/chunks/2117-29b5fa47421595ad.js" async=""></script><script src="/admin/_next/static/chunks/main-app-55bcae20c77aaf0e.js" async=""></script><script src="/admin/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js" async=""></script><script src="/admin/_next/static/chunks/5094-8d53e403235d4ca6.js" async=""></script><script src="/admin/_next/static/chunks/4438-c9a12ca15b6e9160.js" async=""></script><script src="/admin/_next/static/chunks/6530-a91e10cffa4200c4.js" async=""></script><script src="/admin/_next/static/chunks/6241-30d7169d1010e5a4.js" async=""></script><script src="/admin/_next/static/chunks/1668-e3eabd0f6753c780.js" async=""></script><script src="/admin/_next/static/chunks/6869-4f920a71fdc6b538.js" async=""></script><script src="/admin/_next/static/chunks/8473-6598318371eca31b.js" async=""></script><script src="/admin/_next/static/chunks/4883-8a924721bb21b3b0.js" async=""></script><script src="/admin/_next/static/chunks/7304-bdd00a7504bc4081.js" async=""></script><script src="/admin/_next/static/chunks/app/layout-64ac14a534e2809b.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT" as="script"/><meta name="robots" content="noindex"/><title>Baasix</title><script src="/admin/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-background font-sans antialiased"><!--$--><div class="flex items-center justify-center min-h-screen bg-background"><div class="text-center"><div class="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]"></div><p class="mt-4 text-muted-foreground">Loading...</p></div></div><!--/$--><script src="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/admin/_next/static/css/45276c37be155f45.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[36423,[],\"\"]\n6:I[84821,[\"7999\",\"static/chunks/6fcbdc68-90be1a5480b8d353.js\",\"5094\",\"static/chunks/5094-8d53e403235d4ca6.js\",\"4438\",\"static/chunks/4438-c9a12ca15b6e9160.js\",\"6530\",\"static/chunks/6530-a91e10cffa4200c4.js\",\"6241\",\"static/chunks/6241-30d7169d1010e5a4.js\",\"1668\",\"static/chunks/1668-e3eabd0f6753c780.js\",\"6869\",\"static/chunks/6869-4f920a71fdc6b538.js\",\"8473\",\"static/chunks/8473-6598318371eca31b.js\",\"4883\",\"static/chunks/4883-8a924721bb21b3b0.js\",\"7304\",\"static/chunks/7304-bdd00a7504bc4081.js\",\"3185\",\"static/chunks/app/layout-64ac14a534e2809b.js\"],\"default\",1]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"0OAEQ9OeMefOQpSdB_tKL\",\"assetPrefix\":\"/admin\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/admin/_next/static/css/45276c37be155f45.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
1
+ <!DOCTYPE html><html lang="en"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><link rel="stylesheet" href="/admin/_next/static/css/268abf03bd241f28.css" data-precedence="next"/><link rel="preload" as="script" fetchPriority="low" href="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js"/><script src="/admin/_next/static/chunks/fd9d1056-54169f07cd680d6c.js" async=""></script><script src="/admin/_next/static/chunks/2117-29b5fa47421595ad.js" async=""></script><script src="/admin/_next/static/chunks/main-app-55bcae20c77aaf0e.js" async=""></script><script src="/admin/_next/static/chunks/6fcbdc68-90be1a5480b8d353.js" async=""></script><script src="/admin/_next/static/chunks/5094-8d53e403235d4ca6.js" async=""></script><script src="/admin/_next/static/chunks/4438-c9a12ca15b6e9160.js" async=""></script><script src="/admin/_next/static/chunks/6530-a91e10cffa4200c4.js" async=""></script><script src="/admin/_next/static/chunks/6241-30d7169d1010e5a4.js" async=""></script><script src="/admin/_next/static/chunks/1668-e3eabd0f6753c780.js" async=""></script><script src="/admin/_next/static/chunks/6869-4f920a71fdc6b538.js" async=""></script><script src="/admin/_next/static/chunks/8473-6598318371eca31b.js" async=""></script><script src="/admin/_next/static/chunks/4883-8a924721bb21b3b0.js" async=""></script><script src="/admin/_next/static/chunks/7304-bdd00a7504bc4081.js" async=""></script><script src="/admin/_next/static/chunks/app/layout-64ac14a534e2809b.js" async=""></script><link rel="preload" href="https://www.googletagmanager.com/gtag/js?id=G-FBCW8DT7KT" as="script"/><meta name="robots" content="noindex"/><title>Baasix</title><script src="/admin/_next/static/chunks/polyfills-42372ed130431b0a.js" noModule=""></script></head><body class="min-h-screen bg-background font-sans antialiased"><!--$--><div class="flex items-center justify-center min-h-screen bg-background"><div class="text-center"><div class="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]"></div><p class="mt-4 text-muted-foreground">Loading...</p></div></div><!--/$--><script src="/admin/_next/static/chunks/webpack-7a100cbf9402e7ea.js" async=""></script><script>(self.__next_f=self.__next_f||[]).push([0]);self.__next_f.push([2,null])</script><script>self.__next_f.push([1,"1:HL[\"/admin/_next/static/css/268abf03bd241f28.css\",\"style\"]\n"])</script><script>self.__next_f.push([1,"2:I[12846,[],\"\"]\n4:I[4707,[],\"\"]\n5:I[36423,[],\"\"]\n6:I[84821,[\"7999\",\"static/chunks/6fcbdc68-90be1a5480b8d353.js\",\"5094\",\"static/chunks/5094-8d53e403235d4ca6.js\",\"4438\",\"static/chunks/4438-c9a12ca15b6e9160.js\",\"6530\",\"static/chunks/6530-a91e10cffa4200c4.js\",\"6241\",\"static/chunks/6241-30d7169d1010e5a4.js\",\"1668\",\"static/chunks/1668-e3eabd0f6753c780.js\",\"6869\",\"static/chunks/6869-4f920a71fdc6b538.js\",\"8473\",\"static/chunks/8473-6598318371eca31b.js\",\"4883\",\"static/chunks/4883-8a924721bb21b3b0.js\",\"7304\",\"static/chunks/7304-bdd00a7504bc4081.js\",\"3185\",\"static/chunks/app/layout-64ac14a534e2809b.js\"],\"default\",1]\nc:I[61060,[],\"\"]\n7:{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"}\n8:{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"}\n9:{\"display\":\"inline-block\"}\na:{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0}\nd:[]\n"])</script><script>self.__next_f.push([1,"0:[\"$\",\"$L2\",null,{\"buildId\":\"MOjte1maseOzDogE76k_j\",\"assetPrefix\":\"/admin\",\"urlParts\":[\"\",\"_not-found\",\"\"],\"initialTree\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{}]}]},\"$undefined\",\"$undefined\",true],\"initialSeedData\":[\"\",{\"children\":[\"/_not-found\",{\"children\":[\"__PAGE__\",{},[[\"$L3\",[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":{\"fontFamily\":\"system-ui,\\\"Segoe UI\\\",Roboto,Helvetica,Arial,sans-serif,\\\"Apple Color Emoji\\\",\\\"Segoe UI Emoji\\\"\",\"height\":\"100vh\",\"textAlign\":\"center\",\"display\":\"flex\",\"flexDirection\":\"column\",\"alignItems\":\"center\",\"justifyContent\":\"center\"},\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":{\"display\":\"inline-block\",\"margin\":\"0 20px 0 0\",\"padding\":\"0 23px 0 0\",\"fontSize\":24,\"fontWeight\":500,\"verticalAlign\":\"top\",\"lineHeight\":\"49px\"},\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":{\"display\":\"inline-block\"},\"children\":[\"$\",\"h2\",null,{\"style\":{\"fontSize\":14,\"fontWeight\":400,\"lineHeight\":\"49px\",\"margin\":0},\"children\":\"This page could not be found.\"}]}]]}]}]],null],null],null]},[null,[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\",\"/_not-found\",\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":\"$undefined\",\"notFoundStyles\":\"$undefined\"}]],null]},[[[[\"$\",\"link\",\"0\",{\"rel\":\"stylesheet\",\"href\":\"/admin/_next/static/css/268abf03bd241f28.css\",\"precedence\":\"next\",\"crossOrigin\":\"$undefined\"}]],[\"$\",\"$L6\",null,{\"children\":[\"$\",\"$L4\",null,{\"parallelRouterKey\":\"children\",\"segmentPath\":[\"children\"],\"error\":\"$undefined\",\"errorStyles\":\"$undefined\",\"errorScripts\":\"$undefined\",\"template\":[\"$\",\"$L5\",null,{}],\"templateStyles\":\"$undefined\",\"templateScripts\":\"$undefined\",\"notFound\":[[\"$\",\"title\",null,{\"children\":\"404: This page could not be found.\"}],[\"$\",\"div\",null,{\"style\":\"$7\",\"children\":[\"$\",\"div\",null,{\"children\":[[\"$\",\"style\",null,{\"dangerouslySetInnerHTML\":{\"__html\":\"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}\"}}],[\"$\",\"h1\",null,{\"className\":\"next-error-h1\",\"style\":\"$8\",\"children\":\"404\"}],[\"$\",\"div\",null,{\"style\":\"$9\",\"children\":[\"$\",\"h2\",null,{\"style\":\"$a\",\"children\":\"This page could not be found.\"}]}]]}]}]],\"notFoundStyles\":[]}],\"params\":{}}]],null],null],\"couldBeIntercepted\":false,\"initialHead\":[[\"$\",\"meta\",null,{\"name\":\"robots\",\"content\":\"noindex\"}],\"$Lb\"],\"globalErrorComponent\":\"$c\",\"missingSlots\":\"$Wd\"}]\n"])</script><script>self.__next_f.push([1,"b:[[\"$\",\"meta\",\"0\",{\"name\":\"viewport\",\"content\":\"width=device-width, initial-scale=1\"}],[\"$\",\"meta\",\"1\",{\"charSet\":\"utf-8\"}]]\n3:null\n"])</script></body></html>
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4766],{79205:function(e,t,r){r.d(t,{Z:function(){return l}});var n=r(2265);let o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),a=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 u=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:o=24,strokeWidth:u=2,absoluteStrokeWidth:l,className:c="",children:s,iconNode:d,...f}=e;return(0,n.createElement)("svg",{ref:t,...i,width:o,height:o,stroke:r,strokeWidth:l?24*Number(u)/Number(o):u,className:a("lucide",c),...f},[...d.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(s)?s:[s]])}),l=(e,t)=>{let r=(0,n.forwardRef)((r,i)=>{let{className:l,...c}=r;return(0,n.createElement)(u,{ref:i,iconNode:t,className:a("lucide-".concat(o(e)),l),...c})});return r.displayName="".concat(e),r}},92934:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]])},71947:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("FileCode",[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]])},51817:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},33276:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(0,r(79205).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},76865:function(e,t,r){r.d(t,{Z:function(){return n}});let n=(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"}]])},1353:function(e,t,r){r.d(t,{Pc:function(){return k},ck:function(){return D},fC:function(){return T}});var n=r(2265),o=r(6741),a=r(9923),i=r(98575),u=r(73966),l=r(99255),c=r(82912),s=r(26606),d=r(80886),f=r(29114),p=r(57437),v="rovingFocusGroup.onEntryFocus",h={bubbles:!1,cancelable:!0},m="RovingFocusGroup",[b,y,w]=(0,a.B)(m),[g,k]=(0,u.b)(m,[w]),[x,j]=g(m),C=n.forwardRef((e,t)=>(0,p.jsx)(b.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(b.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,p.jsx)(M,{...e,ref:t})})}));C.displayName=m;var M=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:a,loop:u=!1,dir:l,currentTabStopId:b,defaultCurrentTabStopId:w,onCurrentTabStopIdChange:g,onEntryFocus:k,preventScrollOnEntryFocus:j=!1,...C}=e,M=n.useRef(null),A=(0,i.e)(t,M),R=(0,f.gm)(l),[F,T]=(0,d.T)({prop:b,defaultProp:null!=w?w:null,onChange:g,caller:m}),[D,E]=n.useState(!1),N=(0,s.W)(k),V=y(r),Z=n.useRef(!1),[L,K]=n.useState(0);return n.useEffect(()=>{let e=M.current;if(e)return e.addEventListener(v,N),()=>e.removeEventListener(v,N)},[N]),(0,p.jsx)(x,{scope:r,orientation:a,dir:R,loop:u,currentTabStopId:F,onItemFocus:n.useCallback(e=>T(e),[T]),onItemShiftTab:n.useCallback(()=>E(!0),[]),onFocusableItemAdd:n.useCallback(()=>K(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>K(e=>e-1),[]),children:(0,p.jsx)(c.WV.div,{tabIndex:D||0===L?-1:0,"data-orientation":a,...C,ref:A,style:{outline:"none",...e.style},onMouseDown:(0,o.Mj)(e.onMouseDown,()=>{Z.current=!0}),onFocus:(0,o.Mj)(e.onFocus,e=>{let t=!Z.current;if(e.target===e.currentTarget&&t&&!D){let t=new CustomEvent(v,h);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=V().filter(e=>e.focusable);I([e.find(e=>e.active),e.find(e=>e.id===F),...e].filter(Boolean).map(e=>e.ref.current),j)}}Z.current=!1}),onBlur:(0,o.Mj)(e.onBlur,()=>E(!1))})})}),A="RovingFocusGroupItem",R=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:a=!0,active:i=!1,tabStopId:u,children:s,...d}=e,f=(0,l.M)(),v=u||f,h=j(A,r),m=h.currentTabStopId===v,w=y(r),{onFocusableItemAdd:g,onFocusableItemRemove:k,currentTabStopId:x}=h;return n.useEffect(()=>{if(a)return g(),()=>k()},[a,g,k]),(0,p.jsx)(b.ItemSlot,{scope:r,id:v,focusable:a,active:i,children:(0,p.jsx)(c.WV.span,{tabIndex:m?0:-1,"data-orientation":h.orientation,...d,ref:t,onMouseDown:(0,o.Mj)(e.onMouseDown,e=>{a?h.onItemFocus(v):e.preventDefault()}),onFocus:(0,o.Mj)(e.onFocus,()=>h.onItemFocus(v)),onKeyDown:(0,o.Mj)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){h.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return F[o]}(e,h.orientation,h.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=w().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&o.reverse();let a=o.indexOf(e.currentTarget);o=h.loop?(r=o,n=a+1,r.map((e,t)=>r[(n+t)%r.length])):o.slice(a+1)}setTimeout(()=>I(o))}}),children:"function"==typeof s?s({isCurrentTabStop:m,hasTabStop:null!=x}):s})})});R.displayName=A;var F={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function I(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var T=C,D=R},20271:function(e,t,r){r.d(t,{VY:function(){return D},aV:function(){return I},fC:function(){return F},xz:function(){return T}});var n=r(2265),o=r(6741),a=r(73966),i=r(1353),u=r(71599),l=r(82912),c=r(29114),s=r(80886),d=r(99255),f=r(57437),p="Tabs",[v,h]=(0,a.b)(p,[i.Pc]),m=(0,i.Pc)(),[b,y]=v(p),w=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,onValueChange:o,defaultValue:a,orientation:i="horizontal",dir:u,activationMode:v="automatic",...h}=e,m=(0,c.gm)(u),[y,w]=(0,s.T)({prop:n,onChange:o,defaultProp:null!=a?a:"",caller:p});return(0,f.jsx)(b,{scope:r,baseId:(0,d.M)(),value:y,onValueChange:w,orientation:i,dir:m,activationMode:v,children:(0,f.jsx)(l.WV.div,{dir:m,"data-orientation":i,...h,ref:t})})});w.displayName=p;var g="TabsList",k=n.forwardRef((e,t)=>{let{__scopeTabs:r,loop:n=!0,...o}=e,a=y(g,r),u=m(r);return(0,f.jsx)(i.fC,{asChild:!0,...u,orientation:a.orientation,dir:a.dir,loop:n,children:(0,f.jsx)(l.WV.div,{role:"tablist","aria-orientation":a.orientation,...o,ref:t})})});k.displayName=g;var x="TabsTrigger",j=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:n,disabled:a=!1,...u}=e,c=y(x,r),s=m(r),d=A(c.baseId,n),p=R(c.baseId,n),v=n===c.value;return(0,f.jsx)(i.ck,{asChild:!0,...s,focusable:!a,active:v,children:(0,f.jsx)(l.WV.button,{type:"button",role:"tab","aria-selected":v,"aria-controls":p,"data-state":v?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...u,ref:t,onMouseDown:(0,o.Mj)(e.onMouseDown,e=>{a||0!==e.button||!1!==e.ctrlKey?e.preventDefault():c.onValueChange(n)}),onKeyDown:(0,o.Mj)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&c.onValueChange(n)}),onFocus:(0,o.Mj)(e.onFocus,()=>{let e="manual"!==c.activationMode;v||a||!e||c.onValueChange(n)})})})});j.displayName=x;var C="TabsContent",M=n.forwardRef((e,t)=>{let{__scopeTabs:r,value:o,forceMount:a,children:i,...c}=e,s=y(C,r),d=A(s.baseId,o),p=R(s.baseId,o),v=o===s.value,h=n.useRef(v);return n.useEffect(()=>{let e=requestAnimationFrame(()=>h.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,f.jsx)(u.z,{present:a||v,children:r=>{let{present:n}=r;return(0,f.jsx)(l.WV.div,{"data-state":v?"active":"inactive","data-orientation":s.orientation,role:"tabpanel","aria-labelledby":d,hidden:!n,id:p,tabIndex:0,...c,ref:t,style:{...e.style,animationDuration:h.current?"0s":void 0},children:n&&i})}})});function A(e,t){return"".concat(e,"-trigger-").concat(t)}function R(e,t){return"".concat(e,"-content-").concat(t)}M.displayName=C;var F=w,I=k,T=j,D=M}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6027],{16066:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleArrowUp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m16 12-4-4-4 4",key:"177agl"}],["path",{d:"M12 16V8",key:"1sbj14"}]])},99388:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},91723:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},65621:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])},69076:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])},10866:function(t,e,n){n.d(e,{Z:function(){return r}});let r=(0,n(79205).Z)("Settings2",[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]])},370:function(t,e,n){n.d(e,{f:function(){return l}});var r=n(2265);n(54887);var a=n(37053),i=n(57437),o=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,e)=>{let n=(0,a.Z8)(`Primitive.${e}`),o=r.forwardRef((t,r)=>{let{asChild:a,...o}=t,u=a?n:e;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,i.jsx)(u,{...o,ref:r})});return o.displayName=`Primitive.${e}`,{...t,[e]:o}},{}),u=r.forwardRef((t,e)=>(0,i.jsx)(o.label,{...t,ref:e,onMouseDown:e=>{var n;e.target.closest("button, input, select, textarea")||(null===(n=t.onMouseDown)||void 0===n||n.call(t,e),!e.defaultPrevented&&e.detail>1&&e.preventDefault())}}));u.displayName="Label";var l=u},7598:function(t,e,n){n.d(e,{Q:function(){return d}});var r=n(63497),a=n(99649);function i(t,e){let n=(0,a.Q)(t),r=(0,a.Q)(e),i=n.getTime()-r.getTime();return i<0?-1:i>0?1:i}var o=n(78198),u=n(81363),l=n(27742),f=n(5654),c=n(55528),s=n(9340);function d(t,e){return function(t,e,n){var r,d,h,m,y,v;let M,D,p;let k=(0,c.j)(),x=null!==(d=null!==(r=null==n?void 0:n.locale)&&void 0!==r?r:k.locale)&&void 0!==d?d:f._,b=i(t,e);if(isNaN(b))throw RangeError("Invalid time value");let g=Object.assign({},n,{addSuffix:null==n?void 0:n.addSuffix,comparison:b});b>0?(M=(0,a.Q)(e),D=(0,a.Q)(t)):(M=(0,a.Q)(t),D=(0,a.Q)(e));let w=(h=D,m=M,(v=null==void 0?void 0:(void 0).roundingMethod,t=>{let e=(v?Math[v]:Math.trunc)(t);return 0===e?0:e})((+(0,a.Q)(h)-+(0,a.Q)(m))/1e3)),Q=Math.round((w-((0,s.D)(D)-(0,s.D)(M))/1e3)/60);if(Q<2){if(null==n?void 0:n.includeSeconds){if(w<5)return x.formatDistance("lessThanXSeconds",5,g);if(w<10)return x.formatDistance("lessThanXSeconds",10,g);if(w<20)return x.formatDistance("lessThanXSeconds",20,g);if(w<40)return x.formatDistance("halfAMinute",0,g);else if(w<60)return x.formatDistance("lessThanXMinutes",1,g);else return x.formatDistance("xMinutes",1,g)}return 0===Q?x.formatDistance("lessThanXMinutes",1,g):x.formatDistance("xMinutes",Q,g)}if(Q<45)return x.formatDistance("xMinutes",Q,g);if(Q<90)return x.formatDistance("aboutXHours",1,g);if(Q<o.H_)return x.formatDistance("aboutXHours",Math.round(Q/60),g);if(Q<2520)return x.formatDistance("xDays",1,g);if(Q<o.fH){let t=Math.round(Q/o.H_);return x.formatDistance("xDays",t,g)}if(Q<2*o.fH)return p=Math.round(Q/o.fH),x.formatDistance("aboutXMonths",p,g);if((p=function(t,e){let n;let r=(0,a.Q)(t),o=(0,a.Q)(e),f=i(r,o),c=Math.abs((0,u.T)(r,o));if(c<1)n=0;else{1===r.getMonth()&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-f*c);let e=i(r,o)===-f;(function(t){let e=(0,a.Q)(t);return+function(t){let e=(0,a.Q)(t);return e.setHours(23,59,59,999),e}(e)==+(0,l.V)(e)})((0,a.Q)(t))&&1===c&&1===i(t,o)&&(e=!1),n=f*(c-Number(e))}return 0===n?0:n}(D,M))<12){let t=Math.round(Q/o.fH);return x.formatDistance("xMonths",t,g)}{let t=p%12,e=Math.trunc(p/12);return t<3?x.formatDistance("aboutXYears",e,g):t<9?x.formatDistance("overXYears",e,g):x.formatDistance("almostXYears",e+1,g)}}(t,(0,r.L)(t,Date.now()),e)}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2760],{24654:function(){},57166:function(e,t,r){Promise.resolve().then(r.bind(r,7915))},7915:function(e,t,r){"use strict";r.r(t),r.d(t,{default:function(){return en}});var s=r(57437),a=r(2265),n=r(72135),l=r(99376),i=r(12381),o=r(90641),d=r(96246),c=r(32060),u=r(71488),f=r(27648),m=r(45114),x=r(81853),p=r(25466),h=r(50091),g=r(95805),b=r(48736),y=r(13781),v=r(98728),j=r(65621),N=r(30755),w=r(54001),k=r(85929),P=r(97226),C=r(47692);let S=[{key:"dashboard",icon:p.Z,href:"/dashboard",label:"Dashboard"},{key:"data-browser",icon:h.Z,href:"/data-browser",label:"Data Browser"},{key:"users",icon:g.Z,href:"/users/list",label:"Users"},{key:"file-manager",icon:b.Z,href:"/file-manager",label:"File Manager"},{key:"workflows",icon:y.Z,href:"/workflows",label:"Workflows"},{key:"settings",icon:v.Z,href:"/settings/roles",label:"Settings"},{key:"activity-log",icon:j.Z,href:"/activity-log/all-activity",label:"Activity Log"}],D=e=>{var t,r,a,p,h,g;let{selectedMenu:b,setSelectedMenu:y,onToggleSidebarSheet:v,showSidebarToggle:j}=e,D=(0,l.useRouter)(),{data:R}=(0,n.kS)(),{mutate:E}=(0,n.aU)(),{setMode:z,mode:T}=(0,m.Fg)(),{projectSettings:A}=(0,x.PY)(),_=(0,n.Ji)(),M="".concat("/admin","/logo-icon.svg"),Z=(null==A?void 0:null===(t=A.branding)||void 0===t?void 0:t.icon)||(null==A?void 0:null===(r=A.branding)||void 0===r?void 0:r["logo-light"]),L=Z&&_&&"/"!==_?"".concat(_,"/assets/").concat(Z):_&&"/"!==_?"".concat(_,"/assets/project_icon"):M,F=(null==A?void 0:A.color)||"#663399",O=function(e){let t=e.replace("#",""),r=parseInt(t.substring(0,2),16);return(.299*r+.587*parseInt(t.substring(2,4),16)+.114*parseInt(t.substring(4,6),16))/255>.5}(F),V=O?"#1a1a2e":"#ffffff",I=O?"rgba(0, 0, 0, 0.1)":"rgba(255, 255, 255, 0.1)",Y=O?"rgba(0, 0, 0, 0.15)":"rgba(255, 255, 255, 0.2)",U=O?"rgba(0, 0, 0, 0.1)":"rgba(255, 255, 255, 0.1)";return(0,s.jsxs)("div",{className:"flex flex-col h-screen w-[60px] border-r fixed left-0 top-0 z-50",style:{backgroundColor:F,borderColor:U,color:V},children:[(0,s.jsx)("div",{className:"p-2 flex justify-center border-b",style:{borderColor:U},children:(0,s.jsx)(f.default,{href:"/",children:(0,s.jsx)("img",{alt:"logo",src:L,className:"w-10 h-10 object-contain",onError:e=>{e.target.src=M}})})}),j&&(0,s.jsx)("div",{className:"p-2 flex justify-center border-b md:hidden",style:{borderColor:U},children:(0,s.jsxs)(u.u,{children:[(0,s.jsx)(u.aJ,{asChild:!0,children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"w-10 h-10",style:{color:V},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=I},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"},onClick:v,children:(0,s.jsx)(N.Z,{className:"h-5 w-5"})})}),(0,s.jsx)(u._v,{side:"right",children:(0,s.jsx)("p",{children:"Toggle Menu"})})]})}),(0,s.jsx)(o.x,{className:"flex-1 py-2",children:(0,s.jsx)("div",{className:"flex flex-col items-center gap-1",children:S.map(e=>(0,s.jsxs)(u.u,{children:[(0,s.jsx)(u.aJ,{asChild:!0,children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"w-10 h-10",style:{color:V,backgroundColor:b===e.key?Y:"transparent"},onMouseEnter:t=>{b!==e.key&&(t.currentTarget.style.backgroundColor=I)},onMouseLeave:t=>{b!==e.key&&(t.currentTarget.style.backgroundColor="transparent")},onClick:()=>{y(e.key),D.push(e.href)},children:(0,s.jsx)(e.icon,{className:"h-5 w-5"})})}),(0,s.jsx)(u._v,{side:"right",children:(0,s.jsx)("p",{children:e.label})})]},e.key))})}),(0,s.jsx)("div",{className:"p-2 border-t flex justify-center",style:{borderColor:U},children:(0,s.jsxs)(c.h_,{children:[(0,s.jsx)(c.$F,{asChild:!0,children:(0,s.jsx)(i.z,{variant:"ghost",size:"icon",className:"rounded-full",style:{color:V},children:(0,s.jsxs)(d.qE,{className:"h-8 w-8",children:[(0,s.jsx)(d.F$,{src:null==R?void 0:R.avatar}),(0,s.jsxs)(d.Q5,{style:{backgroundColor:I,color:V},children:[null==R?void 0:null===(p=R.firstName)||void 0===p?void 0:null===(a=p.charAt(0))||void 0===a?void 0:a.toUpperCase(),null==R?void 0:null===(g=R.lastName)||void 0===g?void 0:null===(h=g.charAt(0))||void 0===h?void 0:h.toUpperCase()]})]})})}),(0,s.jsxs)(c.AW,{align:"end",side:"right",className:"w-56",children:[(0,s.jsx)(c.Ju,{children:(null==R?void 0:R.fullName)||"".concat((null==R?void 0:R.firstName)||""," ").concat((null==R?void 0:R.lastName)||"").trim()}),(0,s.jsx)(c.VD,{}),(0,s.jsx)(c.Xi,{asChild:!0,children:(0,s.jsxs)(f.default,{href:"/change-password",children:[(0,s.jsx)(w.Z,{className:"mr-2 h-4 w-4"}),"Change Password"]})}),(0,s.jsx)(c.Xi,{onClick:()=>z(),children:"dark"===T?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"mr-2 h-4 w-4"}),"Light Mode"]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(P.Z,{className:"mr-2 h-4 w-4"}),"Dark Mode"]})}),(0,s.jsx)(c.VD,{}),(0,s.jsxs)(c.Xi,{onClick:()=>E(),children:[(0,s.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Logout"]})]})]})})]})};var R=r(93448),E=r(40279),z=r(29696),T=r(73247);let A=e=>{let{selectedMenu:t,selectedSubMenu:r,onSelectSubMenu:n}=e,d=(0,l.useRouter)(),{schemas:c}=(0,z.I_)(),{isMultiTenant:u}=(0,x.PY)(),[f,m]=(0,a.useState)("");a.useEffect(()=>{m("")},[t]);let p=(0,a.useMemo)(()=>{let e=c||[],t=f.toLowerCase().trim();return e.filter(e=>{var t;return!(null===(t=e.collectionName)||void 0===t?void 0:t.startsWith("baasix_"))}).filter(e=>{var r,s,a;if(!t)return!0;let n=(null==e?void 0:null===(s=e.schema)||void 0===s?void 0:null===(r=s.name)||void 0===r?void 0:r.toLowerCase())||"",l=(null==e?void 0:null===(a=e.collectionName)||void 0===a?void 0:a.toLowerCase())||"";return n.includes(t)||l.includes(t)})},[c,f]),h=(e,r)=>{switch(n(e),t){case"data-browser":d.push("/data-browser/?collection=".concat(e,"&schema=").concat(encodeURIComponent(r||"")));break;case"users":d.push("/users/".concat(e,"/"));break;case"file-manager":d.push("/file-manager/".concat(e,"/"));break;case"settings":d.push("/settings/".concat(e,"/"));break;case"activity-log":d.push("/activity-log/".concat(e,"/"))}},g=e=>(0,s.jsx)(i.z,{variant:r===e.collectionName?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.collectionName&&"bg-accent"),onClick:()=>{var t;return h(e.collectionName,null===(t=e.schema)||void 0===t?void 0:t.name)},children:e.collectionName},e.collectionName);return(0,s.jsx)("div",{className:"flex flex-col h-full w-full border-r bg-sidebar overflow-hidden",children:(()=>{switch(t){case"data-browser":return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"p-2 border-b",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)(T.Z,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),(0,s.jsx)(E.I,{placeholder:"Search collections...",value:f,onChange:e=>m(e.target.value),className:"pl-8"})]})}),(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:p.length>0?p.map(g):(0,s.jsx)("p",{className:"text-sm text-muted-foreground px-2 py-1",children:"No collections found"})})})]});case"users":return(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:[{key:"list",label:"Users List"},{key:"invites",label:"Invites"},{key:"user-roles",label:"User Roles"},{key:"preferences",label:"Preferences"}].map(e=>(0,s.jsx)(i.z,{variant:r===e.key?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.key&&"bg-accent"),onClick:()=>h(e.key),children:e.label},e.key))})});case"settings":let e=[{key:"roles",label:"Roles"},{key:"permissions",label:"Permissions"},{key:"schema",label:"Collections"},{key:"tasks",label:"Tasks"},{key:"migrations",label:"Migrations"},{key:"schema-diff",label:"Schema Audit"},{key:"templates",label:"Email Templates"}];return u&&e.push({key:"tenants",label:"Tenants"}),e.push({key:"project",label:"Project Settings"}),(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:e.map(e=>(0,s.jsx)(i.z,{variant:r===e.key?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.key&&"bg-accent"),onClick:()=>h(e.key),children:e.label},e.key))})});case"activity-log":return(0,s.jsx)(o.x,{className:"flex-1",children:(0,s.jsx)("div",{className:"p-2 space-y-1",children:[{key:"all-activity",label:"All Activity"},{key:"email-log",label:"Email Log"},{key:"notifications",label:"Notifications"},{key:"sessions",label:"Sessions"},{key:"workflow-executions",label:"Workflow Executions"},{key:"workflow-logs",label:"Workflow Logs"}].map(e=>(0,s.jsx)(i.z,{variant:r===e.key?"secondary":"ghost",className:(0,R.cn)("w-full justify-start text-sm",r===e.key&&"bg-accent"),onClick:()=>h(e.key),children:e.label},e.key))})});default:return null}})()})};var _=r(82809),M=r(91032);let Z=e=>{let{children:t}=e,r=(0,l.usePathname)(),n=(0,l.useSearchParams)(),[i,o]=(0,a.useState)("data-browser"),[d,c]=(0,a.useState)(""),[u,f]=(0,a.useState)(!1);(0,a.useEffect)(()=>{let e=r.split("/").filter(Boolean);if(e.length>0){if(o(e[0]),"data-browser"===e[0]){let e=n.get("collection");e?c(e):c("")}else e.length>1?c(e[1]):c("")}},[r,n]);let m=e=>{c(e),f(!1)},x=r.startsWith("/settings/templates/edit"),p="file-manager"!==i&&"dashboard"!==i&&"workflows"!==i&&"change-password"!==i&&!x;return(0,s.jsxs)("div",{className:"h-screen flex flex-col",children:[(0,s.jsx)(D,{selectedMenu:i,setSelectedMenu:e=>{o(e),c("")},onToggleSidebarSheet:()=>f(!0),showSidebarToggle:p}),(0,s.jsx)("div",{className:"ml-[60px] flex-1 flex flex-col overflow-hidden",children:p?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"hidden md:flex flex-1 overflow-hidden",children:(0,s.jsxs)(_.pO,{direction:"horizontal",className:"flex-1",children:[(0,s.jsx)(_.ee,{defaultSize:15,minSize:10,maxSize:25,className:"flex flex-col",children:(0,s.jsx)(A,{selectedMenu:i,selectedSubMenu:d,onSelectSubMenu:m})}),(0,s.jsx)(_.Dp,{withHandle:!0}),(0,s.jsx)(_.ee,{defaultSize:85,className:"flex flex-col",children:(0,s.jsx)("main",{className:"p-4 flex-1 overflow-hidden flex flex-col",children:t})})]})}),(0,s.jsx)(M.yo,{open:u,onOpenChange:f,children:(0,s.jsxs)(M.ue,{side:"left",className:"w-[280px] p-0 left-[60px]",children:[(0,s.jsx)(M.bC,{className:"sr-only",children:"Navigation Menu"}),(0,s.jsx)(A,{selectedMenu:i,selectedSubMenu:d,onSelectSubMenu:m})]})}),(0,s.jsx)("main",{className:"p-4 flex-1 overflow-hidden flex flex-col md:hidden",children:t})]}):(0,s.jsx)("main",{className:"p-4 flex-1 overflow-hidden flex flex-col",children:t})})]})};var L=r(63751);let F=String.fromCharCode(104,116,116,112,115,58,47,47,119,119,119,46,98,97,97,115,105,120,46,99,111,109,47,97,112,105,47,118,101,114,105,102,121,45,108,105,99,101,110,115,101),O=(0,a.createContext)({status:"loading",subscriptionData:null,error:null,isLoading:!0,isValid:!1,refetch:async()=>{}}),V=()=>a.useContext(O)||(console.warn("useSubscription used outside of SubscriptionProvider, using defaults"),{status:"loading",subscriptionData:null,error:null,isLoading:!0,isValid:!1,refetch:async()=>{}}),I=e=>{let{children:t}=e,[r,n]=(0,a.useState)("loading"),[l,i]=(0,a.useState)(null),[o,d]=(0,a.useState)(null),c=(0,a.useCallback)(async()=>{var e,t,r,s,a;let l=window.location.hostname;"localhost"===l||"127.0.0.1"===l||"0.0.0.0"===l||l.endsWith(".local")||l.endsWith(".localhost"),n("loading"),d(null);try{let r=new AbortController,s=setTimeout(()=>r.abort(),15e3),a=await fetch(F,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({domain:l}),signal:r.signal});if(clearTimeout(s),!a.ok){let e="Failed to verify subscription";try{e=(await a.json()).error||e}catch(e){}n("error"),d({type:"unknown",message:"Subscription verification failed",details:"Server responded with status ".concat(a.status,": ").concat(e)}),i(null);return}let o=await a.json();if(o.subscribed)n("valid"),i({subscribed:!0,domain:o.domain,plan:o.plan,expiresAt:o.expiresAt,inGracePeriod:o.inGracePeriod,gracePeriodDaysRemaining:o.gracePeriodDaysRemaining,message:o.message}),d(null);else{n("invalid"),i({subscribed:!1,domain:o.domain,plan:o.plan,expiresAt:o.expiresAt,message:o.message});let r="not_found";((null===(e=o.message)||void 0===e?void 0:e.toLowerCase().includes("expired"))||(null===(t=o.message)||void 0===t?void 0:t.toLowerCase().includes("grace period ended")))&&(r="expired"),d({type:r,message:o.message||"No active subscription found for this domain"})}}catch(e){n("error"),"AbortError"===e.name?d({type:"network",message:"Connection timed out",details:"The subscription verification request took too long to complete. Please check your internet connection and try again."}):(null===(r=e.message)||void 0===r?void 0:r.includes("Failed to fetch"))||(null===(s=e.message)||void 0===s?void 0:s.includes("NetworkError"))||(null===(a=e.message)||void 0===a?void 0:a.includes("Network request failed"))?d({type:"network",message:"Network error",details:"Unable to connect to the Baasix license server. Please check your internet connection and try again."}):d({type:"unknown",message:"Verification failed",details:e.message||"An unexpected error occurred while verifying the subscription."}),i(null)}},[]);return(0,a.useEffect)(()=>{c()},[c]),(0,s.jsx)(O.Provider,{value:{status:r,subscriptionData:l,error:o,isLoading:"loading"===r,isValid:"valid"===r,refetch:c},children:t})};var Y=r(75395),U=r(49322),q=r(91723),W=r(83578),B=r(99388),$=r(82431),G=r(96362);function J(e){let{status:t,error:r,subscriptionData:n,onRetry:l}=e,[i,o]=a.useState(!1),d=async()=>{o(!0),await l(),o(!1)};return(0,s.jsx)("div",{className:"min-h-screen bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 flex items-center justify-center p-4",children:(0,s.jsxs)("div",{className:"max-w-md w-full",children:[(0,s.jsxs)("div",{className:"bg-white dark:bg-slate-800 rounded-2xl shadow-2xl overflow-hidden",children:[(0,s.jsxs)("div",{className:"bg-gradient-to-r from-indigo-600 to-blue-600 px-6 py-8 text-center",children:[(0,s.jsx)("div",{className:"inline-flex items-center justify-center w-20 h-20 bg-white/20 rounded-full mb-4",children:(()=>{if("error"===t)return(null==r?void 0:r.type)==="network"?(0,s.jsx)(Y.Z,{className:"h-16 w-16 text-orange-500"}):(0,s.jsx)(U.Z,{className:"h-16 w-16 text-red-500"});switch(null==r?void 0:r.type){case"expired":return(0,s.jsx)(q.Z,{className:"h-16 w-16 text-amber-500"});case"not_found":return(0,s.jsx)(W.Z,{className:"h-16 w-16 text-red-500"});default:return(0,s.jsx)(B.Z,{className:"h-16 w-16 text-red-500"})}})()}),(0,s.jsx)("h1",{className:"text-2xl font-bold text-white",children:(()=>{if("error"===t)return(null==r?void 0:r.type)==="network"?"Connection Error":"Verification Error";switch(null==r?void 0:r.type){case"expired":return"Subscription Expired";case"not_found":return"No Active Subscription";default:return"Subscription Required"}})()})]}),(0,s.jsxs)("div",{className:"px-6 py-8",children:[(0,s.jsx)("p",{className:"text-slate-600 dark:text-slate-300 text-center mb-6",children:"error"===t&&(null==r?void 0:r.type)==="network"?"We couldn't connect to the Baasix license server to verify your subscription.":(null==r?void 0:r.type)==="expired"?"Your Baasix subscription has expired. Please renew to continue using the admin panel.":"A valid Baasix subscription is required to use this admin panel."}),r&&(0,s.jsxs)("div",{className:"bg-slate-100 dark:bg-slate-700/50 rounded-lg p-4 mb-6",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300 mb-2",children:"Error Details"}),(0,s.jsx)("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:r.message}),r.details&&(0,s.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-500 mt-2",children:r.details})]}),(null==n?void 0:n.domain)&&(0,s.jsxs)("div",{className:"bg-slate-100 dark:bg-slate-700/50 rounded-lg p-4 mb-6",children:[(0,s.jsxs)("div",{className:"flex justify-between items-center",children:[(0,s.jsx)("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Domain"}),(0,s.jsx)("span",{className:"text-sm font-mono text-slate-700 dark:text-slate-300",children:n.domain})]}),n.plan&&(0,s.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,s.jsx)("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Previous Plan"}),(0,s.jsx)("span",{className:"text-sm font-medium text-slate-700 dark:text-slate-300 capitalize",children:n.plan})]}),n.expiresAt&&(0,s.jsxs)("div",{className:"flex justify-between items-center mt-2",children:[(0,s.jsx)("span",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Expired On"}),(0,s.jsx)("span",{className:"text-sm text-slate-700 dark:text-slate-300",children:new Date(n.expiresAt).toLocaleDateString()})]})]}),(0,s.jsxs)("div",{className:"space-y-3",children:["error"===t&&(0,s.jsxs)("button",{onClick:d,disabled:i,className:"w-full flex items-center justify-center gap-2 bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 text-slate-700 dark:text-slate-300 font-medium py-3 px-4 rounded-lg transition-colors disabled:opacity-50",children:[(0,s.jsx)($.Z,{className:"h-4 w-4 ".concat(i?"animate-spin":"")}),i?"Retrying...":"Try Again"]}),(0,s.jsxs)("a",{href:"https://www.baasix.com/#pricing",target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center justify-center gap-2 bg-gradient-to-r from-indigo-600 to-blue-600 hover:from-indigo-700 hover:to-blue-700 text-white font-medium py-3 px-4 rounded-lg transition-all shadow-lg shadow-indigo-500/25",children:[(null==r?void 0:r.type)==="expired"?"Renew Subscription":"Get Subscription",(0,s.jsx)(G.Z,{className:"h-4 w-4"})]}),(0,s.jsxs)("a",{href:"https://www.baasix.com",target:"_blank",rel:"noopener noreferrer",className:"w-full flex items-center justify-center gap-2 text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300 font-medium py-2 px-4 rounded-lg transition-colors",children:["Visit baasix.com",(0,s.jsx)(G.Z,{className:"h-4 w-4"})]})]})]}),(0,s.jsx)("div",{className:"bg-slate-50 dark:bg-slate-900/50 px-6 py-4 text-center border-t border-slate-200 dark:border-slate-700",children:(0,s.jsxs)("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:["Need help?"," ",(0,s.jsx)("a",{href:"mailto:support@baasix.com",className:"text-indigo-600 dark:text-indigo-400 hover:underline",children:"Contact support"})]})})]}),(0,s.jsx)("div",{className:"mt-6 text-center",children:(0,s.jsxs)("p",{className:"text-slate-400 text-sm",children:["Starting at just"," ",(0,s.jsx)("span",{className:"text-white font-semibold",children:"$9.99/year"})," per domain"]})})]})})}var X=r(76865),H=r(30767);function Q(e){if(!e)return null;let t=new Date(e),r=new Date;return Math.ceil((t.getTime()-r.getTime())/864e5)}function K(){let e=new Date().toISOString().split("T")[0];return"".concat("baasix_subscription_warning_dismissed","_").concat(e)}function ee(e){let{subscriptionData:t}=e,[r,n]=(0,a.useState)(!1),[l,i]=(0,a.useState)(null);(0,a.useEffect)(()=>{if(!t||"development"===t.plan||"lifetime"===t.plan)return;let e=K();if("true"===sessionStorage.getItem(e))return;if(t.inGracePeriod){i("grace"),n(!0);return}let r=Q(t.expiresAt);null!==r&&r<=14&&(i("expiring"),n(!0))},[t]);let o=()=>{let e=K();sessionStorage.setItem(e,"true"),n(!1)};if(!t||!l)return null;let d=Q(t.expiresAt),c=t.gracePeriodDaysRemaining;return(0,s.jsx)(H.aR,{open:r,onOpenChange:n,children:(0,s.jsxs)(H._T,{className:"max-w-md",children:[(0,s.jsx)(H.fY,{children:(0,s.jsxs)("div",{className:"flex items-center gap-3",children:["grace"===l?(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-red-100 dark:bg-red-900/30",children:(0,s.jsx)(X.Z,{className:"h-5 w-5 text-red-600 dark:text-red-400"})}):(0,s.jsx)("div",{className:"flex h-10 w-10 items-center justify-center rounded-full bg-amber-100 dark:bg-amber-900/30",children:(0,s.jsx)(q.Z,{className:"h-5 w-5 text-amber-600 dark:text-amber-400"})}),(0,s.jsx)(H.f$,{className:"text-left",children:"grace"===l?"Subscription Expired - Grace Period ends in "+(c?" ".concat(c," ").concat(1===c?"day":"days"):""):"Subscription Expiring On"+(t.expiresAt?" ".concat(new Date(t.expiresAt).toLocaleDateString()):"")})]})}),(0,s.jsxs)("div",{className:"space-y-4 text-sm text-muted-foreground",children:["grace"===l?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("p",{children:["Your Baasix subscription has expired. You are currently in the"," ",(0,s.jsx)("strong",{children:"grace period"}),"."]}),(0,s.jsxs)("div",{className:"rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-red-700 dark:text-red-300",children:"Grace period remaining"}),(0,s.jsxs)("span",{className:"text-lg font-bold text-red-600 dark:text-red-400",children:[c," ",1===c?"day":"days"]})]}),(0,s.jsx)("p",{className:"mt-2 text-xs text-red-600 dark:text-red-400",children:"After the grace period ends, you will lose access to the admin panel."})]})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("p",{children:"Your Baasix subscription will expire soon. Renew now to avoid any interruption in service."}),(0,s.jsxs)("div",{className:"rounded-lg bg-amber-50 dark:bg-amber-900/20 border border-amber-200 dark:border-amber-800 p-4",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between",children:[(0,s.jsx)("span",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Days until expiry"}),(0,s.jsxs)("span",{className:"text-lg font-bold text-amber-600 dark:text-amber-400",children:[d," ",1===d?"day":"days"]})]}),t.expiresAt&&(0,s.jsxs)("p",{className:"mt-2 text-xs text-amber-600 dark:text-amber-400",children:["Expires on"," ",new Date(t.expiresAt).toLocaleDateString(void 0,{weekday:"long",year:"numeric",month:"long",day:"numeric"})]})]})]}),(0,s.jsxs)("div",{className:"text-xs text-muted-foreground",children:["Domain: ",(0,s.jsx)("span",{className:"font-mono",children:t.domain})]})]}),(0,s.jsxs)(H.xo,{className:"flex-col sm:flex-row gap-2",children:[(0,s.jsx)(H.le,{onClick:o,className:"sm:order-1",children:"Remind Me Later"}),(0,s.jsxs)(H.OL,{onClick:()=>{window.open("https://www.baasix.com/#pricing","_blank"),o()},className:"grace"===l?"bg-red-600 hover:bg-red-700 sm:order-2":"bg-amber-600 hover:bg-amber-700 sm:order-2",children:["Renew Now",(0,s.jsx)(G.Z,{className:"ml-2 h-4 w-4"})]})]})]})})}function et(e){let{children:t}=e,{status:r,error:a,subscriptionData:n,isLoading:l,refetch:i}=V();return l?(0,s.jsx)("div",{className:"flex h-screen w-screen items-center justify-center bg-background",children:(0,s.jsxs)("div",{className:"text-center",children:[(0,s.jsx)("div",{className:"h-8 w-8 mx-auto animate-spin rounded-full border-4 border-primary border-t-transparent"}),(0,s.jsx)("p",{className:"mt-4 text-muted-foreground",children:"Verifying setup..."})]})}):"invalid"===r||"error"===r?(0,s.jsx)(J,{status:r,error:a,subscriptionData:n,onRetry:i}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(ee,{subscriptionData:n}),t]})}function er(e){let{children:t}=e;return(0,s.jsx)(I,{children:(0,s.jsx)(et,{children:t})})}function es(){return(0,s.jsx)("div",{className:"flex h-screen w-screen items-center justify-center",children:(0,s.jsx)("div",{className:"h-8 w-8 animate-spin rounded-full border-4 border-primary border-t-transparent"})})}function ea(e){let{children:t}=e,r=(0,l.useRouter)(),{data:i,isLoading:o}=(0,n.kq)();return((0,a.useEffect)(()=>{o||(null==i?void 0:i.authenticated)!==!1||r.replace("/login")},[o,i,r]),!o&&(null==i?void 0:i.authenticated))?(0,s.jsx)(er,{children:(0,s.jsx)(z.A1,{children:(0,s.jsx)(L.CE,{children:(0,s.jsx)(Z,{children:t})})})}):(0,s.jsx)(es,{})}function en(e){let{children:t}=e;return(0,s.jsx)(a.Suspense,{fallback:(0,s.jsx)(es,{}),children:(0,s.jsx)(ea,{children:t})})}},30767:function(e,t,r){"use strict";r.d(t,{OL:function(){return g},_T:function(){return f},aR:function(){return o},f$:function(){return p},fY:function(){return m},le:function(){return b},vW:function(){return d},xo:function(){return x},yT:function(){return h}});var s=r(57437),a=r(2265),n=r(16720),l=r(93448),i=r(12381);let o=n.fC,d=n.xz,c=n.h_,u=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.aV,{className:(0,l.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",r),...a,ref:t})});u.displayName="AlertDialogOverlay";let f=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsxs)(c,{children:[(0,s.jsx)(u,{}),(0,s.jsx)(n.VY,{ref:t,className:(0,l.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",r),...a})]})});f.displayName="AlertDialogContent";let m=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...r})};m.displayName="AlertDialogHeader";let x=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,l.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};x.displayName="AlertDialogFooter";let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,l.cn)("text-lg font-semibold",r),...a})});p.displayName="AlertDialogTitle";let h=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,l.cn)("text-sm text-muted-foreground",r),...a})});h.displayName="AlertDialogDescription";let g=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.aU,{ref:t,className:(0,l.cn)((0,i.d)(),r),...a})});g.displayName="AlertDialogAction";let b=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.$j,{ref:t,className:(0,l.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",r),...a})});b.displayName="AlertDialogCancel"},96246:function(e,t,r){"use strict";r.d(t,{F$:function(){return o},Q5:function(){return d},qE:function(){return i}});var s=r(57437),a=r(2265),n=r(27954),l=r(93448);let i=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.fC,{ref:t,className:(0,l.cn)("relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",r),...a})});i.displayName=n.fC.displayName;let o=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Ee,{ref:t,className:(0,l.cn)("aspect-square h-full w-full",r),...a})});o.displayName=n.Ee.displayName;let d=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.NY,{ref:t,className:(0,l.cn)("flex h-full w-full items-center justify-center rounded-full bg-muted",r),...a})});d.displayName=n.NY.displayName},12381:function(e,t,r){"use strict";r.d(t,{d:function(){return o},z:function(){return d}});var s=r(57437),a=r(2265),n=r(37053),l=r(90535),i=r(93448);let o=(0,l.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),d=a.forwardRef((e,t)=>{let{className:r,variant:a,size:l,asChild:d=!1,...c}=e,u=d?n.g7:"button";return(0,s.jsx)(u,{className:(0,i.cn)(o({variant:a,size:l,className:r})),ref:t,...c})});d.displayName="Button"},32060:function(e,t,r){"use strict";r.d(t,{$F:function(){return u},AW:function(){return f},Ju:function(){return x},VD:function(){return p},Xi:function(){return m},h_:function(){return c}});var s=r(57437),a=r(2265),n=r(28119),l=r(10407),i=r(30401),o=r(40519),d=r(93448);let c=n.fC,u=n.xz;n.ZA,n.Uv,n.Tr,n.Ee,a.forwardRef((e,t)=>{let{className:r,inset:a,children:i,...o}=e;return(0,s.jsxs)(n.fF,{ref:t,className:(0,d.cn)("flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent",a&&"pl-8",r),...o,children:[i,(0,s.jsx)(l.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=n.fF.displayName,a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.tu,{ref:t,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 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),...a})}).displayName=n.tu.displayName;let f=a.forwardRef((e,t)=>{let{className:r,sideOffset:a=4,...l}=e;return(0,s.jsx)(n.Uv,{children:(0,s.jsx)(n.VY,{ref:t,sideOffset:a,className:(0,d.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md 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 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})})});f.displayName=n.VY.displayName;let m=a.forwardRef((e,t)=>{let{className:r,inset:a,...l}=e;return(0,s.jsx)(n.ck,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a&&"pl-8",r),...l})});m.displayName=n.ck.displayName,a.forwardRef((e,t)=>{let{className:r,children:a,checked:l,...o}=e;return(0,s.jsxs)(n.oC,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),checked:l,...o,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.wU,{children:(0,s.jsx)(i.Z,{className:"h-4 w-4"})})}),a]})}).displayName=n.oC.displayName,a.forwardRef((e,t)=>{let{className:r,children:a,...l}=e;return(0,s.jsxs)(n.Rk,{ref:t,className:(0,d.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",r),...l,children:[(0,s.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,s.jsx)(n.wU,{children:(0,s.jsx)(o.Z,{className:"h-2 w-2 fill-current"})})}),a]})}).displayName=n.Rk.displayName;let x=a.forwardRef((e,t)=>{let{className:r,inset:a,...l}=e;return(0,s.jsx)(n.__,{ref:t,className:(0,d.cn)("px-2 py-1.5 text-sm font-semibold",a&&"pl-8",r),...l})});x.displayName=n.__.displayName;let p=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Z0,{ref:t,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",r),...a})});p.displayName=n.Z0.displayName},40279:function(e,t,r){"use strict";r.d(t,{I:function(){return l}});var s=r(57437),a=r(2265),n=r(93448);let l=a.forwardRef((e,t)=>{let{className:r,type:a,...l}=e;return(0,s.jsx)("input",{type:a,className:(0,n.cn)("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",r),ref:t,...l})});l.displayName="Input"},82809:function(e,t,r){"use strict";r.d(t,{Dp:function(){return d},ee:function(){return o},pO:function(){return i}});var s=r(57437),a=r(41905),n=r(23374),l=r(93448);let i=e=>{let{className:t,...r}=e;return(0,s.jsx)(n.eh,{className:(0,l.cn)("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...r})},o=n.s_,d=e=>{let{withHandle:t,className:r,...i}=e;return(0,s.jsx)(n.OT,{className:(0,l.cn)("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",r),...i,children:t&&(0,s.jsx)("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:(0,s.jsx)(a.Z,{className:"h-2.5 w-2.5"})})})}},90641:function(e,t,r){"use strict";r.d(t,{x:function(){return i}});var s=r(57437),a=r(2265),n=r(43643),l=r(93448);let i=a.forwardRef((e,t)=>{let{className:r,children:a,...i}=e;return(0,s.jsxs)(n.fC,{ref:t,className:(0,l.cn)("relative overflow-hidden",r),...i,children:[(0,s.jsx)(n.l_,{className:"h-full w-full rounded-[inherit]",children:a}),(0,s.jsx)(o,{}),(0,s.jsx)(n.Ns,{})]})});i.displayName=n.fC.displayName;let o=a.forwardRef((e,t)=>{let{className:r,orientation:a="vertical",...i}=e;return(0,s.jsx)(n.gb,{ref:t,orientation:a,className:(0,l.cn)("flex touch-none select-none transition-colors","vertical"===a&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===a&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",r),...i,children:(0,s.jsx)(n.q4,{className:"relative flex-1 rounded-full bg-border"})})});o.displayName=n.gb.displayName},91032:function(e,t,r){"use strict";r.d(t,{Ei:function(){return b},FF:function(){return h},Tu:function(){return p},bC:function(){return g},sw:function(){return c},ue:function(){return x},yo:function(){return d}});var s=r(57437),a=r(2265),n=r(70001),l=r(90535),i=r(32489),o=r(93448);let d=n.fC;n.xz;let c=n.x8,u=n.h_,f=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.aV,{className:(0,o.cn)("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",r),...a,ref:t})});f.displayName=n.aV.displayName;let m=(0,l.j)("fixed z-50 gap-4 bg-background p-6 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out overflow-hidden",{variants:{side:{top:"inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top",bottom:"inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom",left:"inset-y-0 left-0 h-full w-full sm:w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm",right:"inset-y-0 right-0 h-full w-full sm:w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right"}},defaultVariants:{side:"right"}}),x=a.forwardRef((e,t)=>{let{side:r="right",className:a,children:l,hideDefaultClose:d=!1,...c}=e;return(0,s.jsxs)(u,{children:[(0,s.jsx)(f,{}),(0,s.jsxs)(n.VY,{ref:t,className:(0,o.cn)(m({side:r}),a),...c,children:[!d&&(0,s.jsxs)(n.x8,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-secondary",children:[(0,s.jsx)(i.Z,{className:"h-4 w-4"}),(0,s.jsx)("span",{className:"sr-only",children:"Close"})]}),l]})]})});x.displayName=n.VY.displayName;let p=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col space-y-2 text-center sm:text-left",t),...r})};p.displayName="SheetHeader";let h=e=>{let{className:t,...r}=e;return(0,s.jsx)("div",{className:(0,o.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...r})};h.displayName="SheetFooter";let g=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.Dx,{ref:t,className:(0,o.cn)("text-lg font-semibold text-foreground",r),...a})});g.displayName=n.Dx.displayName;let b=a.forwardRef((e,t)=>{let{className:r,...a}=e;return(0,s.jsx)(n.dk,{ref:t,className:(0,o.cn)("text-sm text-muted-foreground",r),...a})});b.displayName=n.dk.displayName},71488:function(e,t,r){"use strict";r.d(t,{_v:function(){return c},aJ:function(){return d},pn:function(){return i},u:function(){return o}});var s=r(57437),a=r(2265),n=r(91668),l=r(93448);let i=n.zt,o=n.fC,d=n.xz,c=a.forwardRef((e,t)=>{let{className:r,sideOffset:a=4,...i}=e;return(0,s.jsx)(n.VY,{ref:t,sideOffset:a,className:(0,l.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),...i})});c.displayName=n.VY.displayName},93448:function(e,t,r){"use strict";r.d(t,{cn:function(){return n}});var s=r(61994),a=r(53335);function n(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,a.m6)((0,s.W)(t))}},63751:function(e,t,r){"use strict";r.d(t,{CE:function(){return d},Gn:function(){return o}});var s=r(57437),a=r(2265),n=r(72135),l=r(14438);let i=(0,a.createContext)(void 0),o=()=>{let e=(0,a.useContext)(i);if(!e)throw Error("usePreferences must be used within a PreferencesProvider");return e};function d(e){var t;let{children:r}=e,[o,d]=(0,a.useState)([]),[c,u]=(0,a.useState)(!1),{data:f}=(0,n.kS)(),m=(null==f?void 0:f.id)||(null==f?void 0:null===(t=f.user)||void 0===t?void 0:t.id)||null,{data:x,isLoading:p,refetch:h}=(0,n.sm)({resource:"baasix_UserPreference",queryOptions:{enabled:!!m},filters:m?[{field:"userId",operator:"eq",value:m}]:[],pagination:{pageSize:-1,mode:"off"}}),{mutate:g}=(0,n.RO)({resource:"baasix_UserPreference"}),{mutate:b}=(0,n.PQ)({resource:"baasix_UserPreference"});(0,a.useEffect)(()=>{(null==x?void 0:x.data)?(d(x.data),u(!0)):m&&!p&&(d([]),u(!0))},[x,m,p]);let y=(0,a.useMemo)(()=>{let e={};return o.forEach(t=>{t.isDefault&&(e[t.collectionName]||(e[t.collectionName]={}),e[t.collectionName][t.preferenceType]=t)}),e},[o]),v=(0,a.useCallback)((e,t)=>{var r;return(null===(r=y[e])||void 0===r?void 0:r[t])||null},[y]),j=(0,a.useCallback)(async(e,t,r)=>{if(!m){console.warn("No user ID available for saving preferences");return}let s=v(e,t),a={userId:m,collectionName:e,preferenceType:t,preferenceData:r,isDefault:!0};try{(null==s?void 0:s.id)?await new Promise((e,t)=>{b({id:s.id,values:a,successNotification:!1},{onSuccess:()=>{h(),e()},onError:e=>{console.error("Error updating preference:",e),t(e)}})}):await new Promise((e,t)=>{g({values:a,successNotification:!1},{onSuccess:()=>{h(),e()},onError:e=>{console.error("Error creating preference:",e),t(e)}})})}catch(e){throw l.Am.error("Failed to save preferences"),e}},[m,v,g,b,h]),N=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.columns;return r?r.preferenceData:null},[y]),w=(0,a.useCallback)(async(e,t)=>{await j(e,"columns",t)},[j]),k=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.filters;return r?r.preferenceData:null},[y]),P=(0,a.useCallback)(async(e,t)=>{await j(e,"filters",t)},[j]),C=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.sorting;return r?r.preferenceData:null},[y]),S=(0,a.useCallback)(async(e,t)=>{await j(e,"sorting",t)},[j]),D=(0,a.useCallback)(e=>{var t;let r=null===(t=y[e])||void 0===t?void 0:t.pagination;return r?r.preferenceData:null},[y]),R=(0,a.useCallback)(async(e,t)=>{await j(e,"pagination",t)},[j]);return(0,s.jsx)(i.Provider,{value:{getColumnPreferences:N,saveColumnPreferences:w,getFilterPreferences:k,saveFilterPreferences:P,getSortingPreferences:C,saveSortingPreferences:S,getPaginationPreferences:D,savePaginationPreferences:R,isLoading:p,isInitialized:c,refetchPreferences:h},children:r})}},81853:function(e,t,r){"use strict";r.d(t,{Ml:function(){return i},PY:function(){return l}});var s=r(57437),a=r(2265);let n=(0,a.createContext)({projectSettings:null,isMultiTenant:!1,isLoading:!0,refetch:()=>{}}),l=()=>a.useContext(n)||(console.warn("useProject used outside of ProjectContextProvider, using defaults"),{projectSettings:null,isMultiTenant:!1,isLoading:!1,refetch:()=>{}}),i=e=>{let{children:t,baasixClient:r}=e,[l,i]=(0,a.useState)(null),[o,d]=(0,a.useState)(!0),c=(0,a.useCallback)(async()=>{try{d(!0);let e=await r.server.info();i(null==e?void 0:e.project)}catch(e){console.error("Failed to fetch project settings",e)}finally{d(!1)}},[r]);(0,a.useEffect)(()=>{c()},[c]);let u=(null==l?void 0:l.multitenant)===!0||(null==l?void 0:l.multitenant)==="true";return(0,s.jsx)(n.Provider,{value:{projectSettings:l,isMultiTenant:u,isLoading:o,refetch:c},children:t})}},29696:function(e,t,r){"use strict";r.d(t,{A1:function(){return o},I_:function(){return i}});var s=r(57437),a=r(2265),n=r(72135);let l=(0,a.createContext)(void 0),i=()=>{let e=(0,a.useContext)(l);if(!e)throw Error("useSchema must be used within a SchemaProvider");return e};function o(e){let{children:t}=e,{data:r,isLoading:a,refetch:i}=(0,n.sm)({resource:"collections",queryOptions:{enabled:!0},sorters:[{field:"collectionName",order:"asc"}],pagination:{pageSize:500}}),o=(null==r?void 0:r.data)||[],d=e=>o.find(t=>t.collectionName===e),c=e=>{let t=d(e),r=null==t?void 0:t.schema.fields;if(r){let t={...r};for(let[e,r]of Object.entries(t))r.hidden&&delete t[e];return"baasix_Account"===e&&(delete t.password,delete t.accessToken,delete t.refreshToken,delete t.idToken),"baasix_Verification"===e&&delete t.value,"baasix_Sessions"===e&&delete t.token,t}return r},u=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5,s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(0===r)return[];let a=c(e);return a?Object.entries(a).map(e=>{let[a,n]=e,l=t?"".concat(t,".").concat(a):a,i=s?{title:n.relType?l+".*":l,value:n.relType?l+".*":l,key:n.relType?l+".*":l,isLeaf:!n.relType}:{title:l,value:l,key:l,isLeaf:!n.relType};return n.relType&&n.target&&(i.children=u(n.target,l,r-1,s)),i}):[]};return(0,s.jsx)(l.Provider,{value:{schemas:o,isLoading:a,refetch:i,getSchemaByName:d,getFieldsByCollection:c,getCollectionChoices:()=>o.map(e=>({label:e.schema.name,value:e.collectionName})),getTargetFields:e=>{let t=c(e);return t?Object.entries(t).map(e=>{let[t]=e;return{label:t,value:t}}):[]},formatRelationshipDisplay:(e,t)=>e&&t?null==t?void 0:t.split(",").map(t=>{let r=t.trim();return e[r]||r}).join(""):"",getNestedFields:e=>u(e),getPermissionFields:e=>[{title:"*",value:"*",key:"*",isLeaf:!0},...u(e,"",6,!0),{title:"*.*",value:"*.*",key:"*.*",isLeaf:!0},{title:"*.*.*",value:"*.*.*",key:"*.*.*",isLeaf:!0},{title:"*.*.*.*",value:"*.*.*.*",key:"*.*.*.*",isLeaf:!0}],isSortEnabled:e=>{var t;let r=d(e);return(null==r?void 0:null===(t=r.schema)||void 0===t?void 0:t.sortEnabled)===!0}},children:t})}},45114:function(e,t,r){"use strict";r.d(t,{Fg:function(){return o},ze:function(){return f}});var s=r(57437),a=r(2265),n=r(25922),l=r(81853);let i=(0,a.createContext)({}),o=()=>{let e=a.useContext(i);if(!e)throw Error("useTheme must be used within a ThemeContextProvider");return e};function d(e,t,r){return"".concat(e," ").concat(t,"% ").concat(r,"%")}function c(e,t,r){return Math.min(Math.max(e,t),r)}let u=e=>{let{children:t,defaultMode:r="dark"}=e,{setTheme:o,resolvedTheme:u}=(0,n.F)(),{projectSettings:f}=(0,l.PY)(),[m,x]=(0,a.useState)(!1);return((0,a.useEffect)(()=>{x(!0)},[]),(0,a.useEffect)(()=>{m&&(null==f?void 0:f.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,s=parseInt(e.substring(4,6),16)/255,a=Math.max(t,r,s),n=Math.min(t,r,s),l=0,i=0,o=(a+n)/2;if(a!==n){let e=a-n;switch(i=o>.5?e/(2-a-n):e/(a+n),a){case t:l=((r-s)/e+(r<s?6:0))/6;break;case r:l=((s-t)/e+2)/6;break;case s:l=((t-r)/e+4)/6}}return{h:Math.round(360*l),s:Math.round(100*i),l:Math.round(100*o)}}(e);if(!r)return;let s=document.documentElement,{h:a,s:n,l}=r,i=d(a,n,l);s.style.setProperty("--primary",i);let o=l>50?d(a,c(n-10,0,100),10):d(a,c(n-10,0,100),98);if(s.style.setProperty("--primary-foreground",o),s.style.setProperty("--ring",i),t){let e=d(a,c(n-20,10,40),c(l-5,15,25));s.style.setProperty("--accent",e),s.style.setProperty("--accent-foreground",d(a,c(n-30,0,30),95));let t=d(a,c(n-25,5,35),c(l-10,15,22));s.style.setProperty("--muted",t),s.style.setProperty("--muted-foreground",d(a,c(n-30,5,25),65)),s.style.setProperty("--secondary",d(a,c(n-20,10,35),c(l-8,15,22))),s.style.setProperty("--secondary-foreground",d(a,c(n-30,0,30),95)),s.style.setProperty("--border",d(a,c(n-25,5,35),c(l-10,18,28))),s.style.setProperty("--input",d(a,c(n-25,5,35),c(l-10,18,28))),s.style.setProperty("--sidebar-background",d(a,c(n-30,5,20),8)),s.style.setProperty("--sidebar-foreground",d(a,c(n-30,5,20),92)),s.style.setProperty("--sidebar-primary",i),s.style.setProperty("--sidebar-primary-foreground",o),s.style.setProperty("--sidebar-accent",d(a,c(n-25,5,25),15)),s.style.setProperty("--sidebar-accent-foreground",d(a,c(n-30,5,20),92)),s.style.setProperty("--sidebar-border",d(a,c(n-30,5,20),15)),s.style.setProperty("--sidebar-ring",i),s.style.setProperty("--chart-1",d(a,70,50)),s.style.setProperty("--chart-2",d((a+60)%360,60,45)),s.style.setProperty("--chart-3",d((a+120)%360,80,55)),s.style.setProperty("--chart-4",d((a+180)%360,65,60)),s.style.setProperty("--chart-5",d((a+240)%360,75,55))}else{let e=d(a,c(n-10,20,50),c(l+30,90,97));s.style.setProperty("--accent",e),s.style.setProperty("--accent-foreground",d(a,c(n,30,60),15));let t=d(a,c(n-20,10,45),c(l+35,94,98));s.style.setProperty("--muted",t),s.style.setProperty("--muted-foreground",d(a,c(n-20,10,30),45)),s.style.setProperty("--secondary",d(a,c(n-15,15,45),c(l+32,92,97))),s.style.setProperty("--secondary-foreground",d(a,c(n,30,60),15)),s.style.setProperty("--border",d(a,c(n-20,10,35),88)),s.style.setProperty("--input",d(a,c(n-20,10,35),88)),s.style.setProperty("--sidebar-background",d(a,c(n-25,5,25),97)),s.style.setProperty("--sidebar-foreground",d(a,c(n-20,10,30),25)),s.style.setProperty("--sidebar-primary",i),s.style.setProperty("--sidebar-primary-foreground",o),s.style.setProperty("--sidebar-accent",d(a,c(n-15,10,40),93)),s.style.setProperty("--sidebar-accent-foreground",d(a,c(n-20,10,30),20)),s.style.setProperty("--sidebar-border",d(a,c(n-25,5,25),90)),s.style.setProperty("--sidebar-ring",i),s.style.setProperty("--chart-1",d(a,76,61)),s.style.setProperty("--chart-2",d((a+60)%360,58,39)),s.style.setProperty("--chart-3",d((a+120)%360,37,24)),s.style.setProperty("--chart-4",d((a+180)%360,74,66)),s.style.setProperty("--chart-5",d((a+240)%360,87,67))}}(f.color,"dark"===u)},[m,null==f?void 0:f.color,u]),m)?(0,s.jsx)(i.Provider,{value:{setMode:()=>{o("light"===u?"dark":"light")},mode:u||r,primaryColor:(null==f?void 0:f.color)||"#644152"},children:t}):null},f=e=>{let{children:t,defaultMode:r="dark"}=e;return(0,s.jsx)(n.f,{attribute:"class",defaultTheme:r,enableSystem:!0,children:(0,s.jsx)(u,{defaultMode:r,children:t})})}}},function(e){e.O(0,[7999,5094,4438,6530,4475,6241,926,600,1668,9124,3563,8473,478,6599,2971,2117,1744],function(){return e(e.s=57166)}),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3753],{55203:function(e,s,a){Promise.resolve().then(a.bind(a,36818))},36818:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return F}});var t=a(57437),l=a(2265),r=a(72135),n=a(14438),i=a(79820),c=a(12381),d=a(69174),o=a(40279),m=a(43368),x=a(75060),u=a(23675),h=a(17168),j=a(90641),f=a(69140),p=a(33804),g=a(30767),N=a(74291),v=a(15291),b=a(92934),w=a(91723),y=a(51817),k=a(99388),C=a(69076),Z=a(76865),S=a(16066),M=a(49322),A=a(50091),R=a(71947),_=a(82431),z=a(99397),O=a(33276),D=a(10866),T=a(65621),V=a(22135),E=a(40875),L=a(7598),B=a(27107);let U=e=>{let{status:s}=e,a={completed:{variant:"default",icon:(0,t.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),label:"Completed"},pending:{variant:"secondary",icon:(0,t.jsx)(w.Z,{className:"h-3 w-3 mr-1"}),label:"Pending"},running:{variant:"outline",icon:(0,t.jsx)(y.Z,{className:"h-3 w-3 mr-1 animate-spin"}),label:"Running"},failed:{variant:"destructive",icon:(0,t.jsx)(k.Z,{className:"h-3 w-3 mr-1"}),label:"Failed"},rolled_back:{variant:"outline",icon:(0,t.jsx)(C.Z,{className:"h-3 w-3 mr-1"}),label:"Rolled Back"},skipped:{variant:"secondary",icon:(0,t.jsx)(Z.Z,{className:"h-3 w-3 mr-1"}),label:"Skipped"}}[s]||{variant:"secondary",icon:null,label:s};return(0,t.jsxs)(d.C,{variant:a.variant,className:"flex items-center",children:[a.icon,a.label]})},Y=e=>{let{type:s}=e,a={upgrade:{color:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",icon:(0,t.jsx)(S.Z,{className:"h-3 w-3 mr-1"})},hotfix:{color:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",icon:(0,t.jsx)(M.Z,{className:"h-3 w-3 mr-1"})},rollback:{color:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",icon:(0,t.jsx)(C.Z,{className:"h-3 w-3 mr-1"})},data:{color:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",icon:(0,t.jsx)(A.Z,{className:"h-3 w-3 mr-1"})},schema:{color:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",icon:(0,t.jsx)(R.Z,{className:"h-3 w-3 mr-1"})}}[s]||{color:"bg-gray-100 text-gray-800",icon:null};return(0,t.jsxs)(d.C,{variant:"outline",className:"flex items-center ".concat(a.color),children:[a.icon,s]})},P=()=>{var e,s,a;let k=(0,r.Ji)(),[S,M]=(0,l.useState)("status"),[R,P]=(0,l.useState)(""),[F,Q]=(0,l.useState)([]),[H,$]=(0,l.useState)(new Set),[q,I]=(0,l.useState)(!1),[W,G]=(0,l.useState)(!1),[J,K]=(0,l.useState)(!1),[X,ee]=(0,l.useState)(!1),[es,ea]=(0,l.useState)(!1),[et,el]=(0,l.useState)(null),[er,en]=(0,l.useState)({name:"",description:"",type:"upgrade"}),{data:ei,isLoading:ec,refetch:ed}=(0,r.EV)({url:"".concat(k,"/migrations/status"),method:"get",queryOptions:{refetchInterval:5e3}}),{data:eo,isLoading:em,refetch:ex}=(0,r.EV)({url:"".concat(k,"/migrations"),method:"get"}),{data:eu,isLoading:eh,refetch:ej}=(0,r.EV)({url:"".concat(k,"/migrations/pending"),method:"get"}),{mutate:ef,isLoading:ep}=(0,r.uC)(),{mutate:eg,isLoading:eN}=(0,r.uC)(),{mutate:ev,isLoading:eb}=(0,r.uC)(),{mutate:ew,isLoading:ey}=(0,r.uC)(),{mutate:ek,isLoading:eC}=(0,r.uC)(),{mutate:eZ,isLoading:eS}=(0,r.uC)(),eM=null==ei?void 0:null===(e=ei.data)||void 0===e?void 0:e.data,eA=(null==eo?void 0:null===(s=eo.data)||void 0===s?void 0:s.data)||[],eR=(null==eu?void 0:null===(a=eu.data)||void 0===a?void 0:a.data)||[],e_=(0,l.useMemo)(()=>{if(!R.trim())return eA;let e=R.toLowerCase();return eA.filter(s=>{var a;return s.version.toLowerCase().includes(e)||s.name.toLowerCase().includes(e)||(null===(a=s.description)||void 0===a?void 0:a.toLowerCase().includes(e))})},[eA,R]),ez=()=>{ed(),ex(),ej()},eO=e=>{eg({url:"".concat(k,"/migrations/rollback/").concat(encodeURIComponent(e)),method:"post",values:{}},{onSuccess:()=>{n.Am.success("Successfully rolled back migration ".concat(e)),G(!1),el(null),ez()},onError:e=>{n.Am.error("Failed to rollback: ".concat(e.message))}})},eD=e=>{eZ({url:"".concat(k,"/migrations/rollback-batch"),method:"post",values:{batch:e}},{onSuccess:s=>{var a,t;let l=null==s?void 0:null===(a=s.data)||void 0===a?void 0:a.data;n.Am.success("Successfully rolled back ".concat((null==l?void 0:null===(t=l.rolledBack)||void 0===t?void 0:t.length)||0," migration(s) from batch ").concat(e)),ez()},onError:e=>{n.Am.error("Failed to rollback batch: ".concat(e.message))}})},eT=e=>{ev({url:"".concat(k,"/migrations/mark-completed/").concat(encodeURIComponent(e)),method:"post",values:{}},{onSuccess:()=>{n.Am.success("Marked migration ".concat(e," as completed")),K(!1),ez()},onError:e=>{n.Am.error("Failed to mark as completed: ".concat(e.message))}})},eV=e=>{$(s=>{let a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})},eE=e=>{el(e),ea(!0)};return ec?(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(f.O,{className:"h-8 w-48"}),(0,t.jsx)(f.O,{className:"h-10 w-32"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[1,2,3,4].map(e=>(0,t.jsx)(f.O,{className:"h-24"},e))}),(0,t.jsx)(f.O,{className:"h-96"})]}):(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 flex-shrink-0",children:[(0,t.jsx)("h1",{className:"text-lg font-semibold",children:"Database Migrations"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(c.z,{variant:"outline",size:"icon",onClick:ez,children:(0,t.jsx)(_.Z,{className:"h-4 w-4"})}),(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>ee(!0),children:[(0,t.jsx)(z.Z,{className:"mr-2 h-4 w-4"}),"Create Migration"]}),(0,t.jsxs)(c.z,{onClick:()=>I(!0),disabled:!eR.length||ep,children:[ep?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(O.Z,{className:"mr-2 h-4 w-4"}),"Run Migrations"]})]})]}),(null==eM?void 0:eM.isSequelizeUpgrade)&&(0,t.jsx)(i.Zb,{className:"border-amber-500 bg-amber-50 dark:bg-amber-950",children:(0,t.jsx)(i.aY,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(Z.Z,{className:"h-5 w-5 text-amber-600"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Sequelize to Drizzle Upgrade Detected"}),(0,t.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Your database appears to be from an older Sequelize-based version. Please run the pending migrations to complete the upgrade."})]})]})})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 flex-shrink-0",children:[(0,t.jsx)(i.Zb,{children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Current Version"}),(0,t.jsx)(i.ll,{className:"text-2xl font-mono",children:(null==eM?void 0:eM.currentVersion)||"No migrations"})]})}),(0,t.jsx)(i.Zb,{children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Applied Migrations"}),(0,t.jsx)(i.ll,{className:"text-2xl",children:(null==eM?void 0:eM.appliedCount)||0})]})}),(0,t.jsx)(i.Zb,{className:(null==eM?void 0:eM.pendingCount)?"border-amber-500":"",children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Pending Migrations"}),(0,t.jsxs)(i.ll,{className:"text-2xl flex items-center gap-2",children:[(null==eM?void 0:eM.pendingCount)||0,(null==eM?void 0:eM.pendingCount)?(0,t.jsx)(Z.Z,{className:"h-5 w-5 text-amber-500"}):(0,t.jsx)(b.Z,{className:"h-5 w-5 text-green-500"})]})]})}),(0,t.jsx)(i.Zb,{children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Last Batch"}),(0,t.jsxs)(i.ll,{className:"text-2xl",children:["#",(null==eM?void 0:eM.lastBatch)||0]})]})})]}),(0,t.jsxs)(h.mQ,{value:S,onValueChange:M,className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)(h.dr,{className:"grid w-full max-w-md grid-cols-3",children:[(0,t.jsxs)(h.SP,{value:"status",children:[(0,t.jsx)(D.Z,{className:"h-4 w-4 mr-2"}),"Status"]}),(0,t.jsxs)(h.SP,{value:"pending",children:[(0,t.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Pending (",eR.length,")"]}),(0,t.jsxs)(h.SP,{value:"history",children:[(0,t.jsx)(T.Z,{className:"h-4 w-4 mr-2"}),"History"]})]}),(0,t.jsx)(h.nU,{value:"status",className:"flex-1 overflow-hidden",children:(0,t.jsxs)(i.Zb,{className:"h-full",children:[(0,t.jsxs)(i.Ol,{children:[(0,t.jsx)(i.ll,{children:"Migration Status"}),(0,t.jsx)(i.SZ,{children:"Overview of your database migration state"})]}),(0,t.jsxs)(i.aY,{className:"space-y-6",children:[(null==eM?void 0:eM.lastMigration)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Last Applied Migration"}),(0,t.jsx)(i.Zb,{children:(0,t.jsx)(i.aY,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-mono font-medium",children:eM.lastMigration.version}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:eM.lastMigration.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(U,{status:eM.lastMigration.status}),eM.lastMigration.executedAt&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:(0,L.Q)(new Date(eM.lastMigration.executedAt),{addSuffix:!0})})]})]})})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Quick Actions"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>I(!0),disabled:!eR.length,children:[(0,t.jsx)(O.Z,{className:"h-4 w-4 mr-2"}),"Run All Pending"]}),(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>{ew({url:"".concat(k,"/migrations/mark-all-completed"),method:"post",values:{}},{onSuccess:e=>{var s,a;let t=(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.markedCount)||0;n.Am.success("Marked ".concat(t," migration(s) as completed")),ez()},onError:e=>{n.Am.error("Failed to mark all as completed: ".concat(e.message))}})},disabled:ey||!eR.length,children:[ey?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,t.jsx)(b.Z,{className:"h-4 w-4 mr-2"}),"Mark All as Completed"]}),(null==eM?void 0:eM.lastBatch)&&eM.lastBatch>0&&(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>eD(eM.lastBatch),disabled:eS,children:[eS?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,t.jsx)(C.Z,{className:"h-4 w-4 mr-2"}),"Rollback Batch #",eM.lastBatch]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"System Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Total Migrations:"}),(0,t.jsx)("span",{className:"ml-2 font-medium",children:(null==eM?void 0:eM.totalMigrations)||0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Status:"}),(0,t.jsx)("span",{className:"ml-2",children:(null==eM?void 0:eM.isUpToDate)?(0,t.jsxs)(d.C,{variant:"default",children:[(0,t.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),"Up to Date"]}):(0,t.jsxs)(d.C,{variant:"secondary",children:[(0,t.jsx)(Z.Z,{className:"h-3 w-3 mr-1"}),"Updates Available"]})})]})]})]})]})]})}),(0,t.jsx)(h.nU,{value:"pending",className:"flex-1 overflow-hidden",children:(0,t.jsxs)(i.Zb,{className:"h-full flex flex-col",children:[(0,t.jsxs)(i.Ol,{children:[(0,t.jsx)(i.ll,{children:"Pending Migrations"}),(0,t.jsx)(i.SZ,{children:"Migrations waiting to be applied"})]}),(0,t.jsx)(i.aY,{className:"flex-1 overflow-hidden",children:eh?(0,t.jsx)("div",{className:"space-y-2",children:[1,2,3].map(e=>(0,t.jsx)(f.O,{className:"h-16"},e))}):0===eR.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,t.jsx)(b.Z,{className:"h-12 w-12 mb-4 text-green-500"}),(0,t.jsx)("p",{className:"text-lg font-medium",children:"All migrations are up to date!"}),(0,t.jsx)("p",{className:"text-sm",children:"No pending migrations to run."})]}):(0,t.jsx)(j.x,{className:"h-full",children:(0,t.jsx)("div",{className:"space-y-2",children:eR.map((e,s)=>(0,t.jsx)(i.Zb,{children:(0,t.jsx)(i.aY,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("span",{className:"text-muted-foreground w-6",children:[s+1,"."]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-mono font-medium",children:e.version}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.name}),e.description&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.description})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Y,{type:e.type}),e.canRollback&&(0,t.jsx)(d.C,{variant:"outline",className:"text-xs",children:"Reversible"}),(0,t.jsx)(c.z,{size:"sm",variant:"outline",onClick:()=>eT(e.version),children:"Mark Done"})]})]})})},e.version))})})})]})}),(0,t.jsx)(h.nU,{value:"history",className:"flex-1 overflow-hidden",children:(0,t.jsxs)(i.Zb,{className:"h-full flex flex-col",children:[(0,t.jsx)(i.Ol,{className:"flex-shrink-0",children:(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.ll,{children:"Migration History"}),(0,t.jsx)(i.SZ,{children:"All applied migrations"})]}),(0,t.jsx)(m.t,{value:R,onChange:P,placeholder:"Search migrations...",expandedWidth:"w-64"})]})}),(0,t.jsx)(i.aY,{className:"flex-1 overflow-hidden p-0",children:em?(0,t.jsx)("div",{className:"p-6 space-y-2",children:[1,2,3,4,5].map(e=>(0,t.jsx)(f.O,{className:"h-12"},e))}):0===e_.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,t.jsx)(A.Z,{className:"h-12 w-12 mb-4"}),(0,t.jsx)("p",{className:"text-lg font-medium",children:"No migrations found"}),(0,t.jsx)("p",{className:"text-sm",children:R?"Try a different search term":"No migrations have been run yet"})]}):(0,t.jsx)(j.x,{className:"h-full",children:(0,t.jsxs)(p.iA,{children:[(0,t.jsx)(p.xD,{className:"sticky top-0 bg-background",children:(0,t.jsxs)(p.SC,{children:[(0,t.jsx)(p.ss,{className:"w-8"}),(0,t.jsx)(p.ss,{children:"Version"}),(0,t.jsx)(p.ss,{children:"Name"}),(0,t.jsx)(p.ss,{children:"Type"}),(0,t.jsx)(p.ss,{children:"Status"}),(0,t.jsx)(p.ss,{children:"Batch"}),(0,t.jsx)(p.ss,{children:"Executed"}),(0,t.jsx)(p.ss,{children:"Duration"}),(0,t.jsx)(p.ss,{className:"w-24",children:"Actions"})]})}),(0,t.jsx)(p.RM,{children:e_.map(e=>(0,t.jsxs)(l.Fragment,{children:[(0,t.jsxs)(p.SC,{className:"failed"===e.status?"bg-red-50 dark:bg-red-950":"",children:[(0,t.jsx)(p.pj,{children:(e.errorMessage||e.description)&&(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>eV(e.id),children:H.has(e.id)?(0,t.jsx)(V.Z,{className:"h-4 w-4"}):(0,t.jsx)(E.Z,{className:"h-4 w-4"})})}),(0,t.jsx)(p.pj,{className:"font-mono text-sm",children:e.version}),(0,t.jsx)(p.pj,{children:e.name}),(0,t.jsx)(p.pj,{children:(0,t.jsx)(Y,{type:e.type})}),(0,t.jsx)(p.pj,{children:(0,t.jsx)(U,{status:e.status})}),(0,t.jsxs)(p.pj,{children:["#",e.batch||"-"]}),(0,t.jsx)(p.pj,{children:e.executedAt?(0,B.WU)(new Date(e.executedAt),"MMM d, yyyy HH:mm"):"-"}),(0,t.jsx)(p.pj,{children:e.executionTimeMs?"".concat(e.executionTimeMs,"ms"):"-"}),(0,t.jsx)(p.pj,{children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>eE(e),children:(0,t.jsx)(D.Z,{className:"h-4 w-4"})}),e.canRollback&&"completed"===e.status&&(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{el(e),G(!0)},children:(0,t.jsx)(C.Z,{className:"h-4 w-4"})})]})})]}),H.has(e.id)&&(0,t.jsx)(p.SC,{children:(0,t.jsxs)(p.pj,{colSpan:9,className:"bg-muted/50 p-4",children:[e.description&&(0,t.jsxs)("p",{className:"text-sm mb-2",children:[(0,t.jsx)("strong",{children:"Description:"})," ",e.description]}),e.errorMessage&&(0,t.jsxs)("div",{className:"text-sm text-red-600 dark:text-red-400",children:[(0,t.jsx)("strong",{children:"Error:"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900 rounded text-xs overflow-x-auto",children:e.errorMessage}),e.errorStack&&(0,t.jsxs)("details",{className:"mt-2",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs",children:"Stack trace"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900 rounded text-xs overflow-x-auto",children:e.errorStack})]})]})]})})]},e.id))})]})})})]})})]}),(0,t.jsx)(g.aR,{open:q,onOpenChange:I,children:(0,t.jsxs)(g._T,{children:[(0,t.jsxs)(g.fY,{children:[(0,t.jsx)(g.f$,{children:"Run Pending Migrations?"}),(0,t.jsxs)(g.yT,{children:["This will execute ",eR.length," pending migration(s). Make sure you have a database backup before proceeding."]})]}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto my-4",children:(0,t.jsx)("div",{className:"space-y-2",children:eR.map(e=>(0,t.jsxs)("div",{className:"text-sm p-2 bg-muted rounded flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-mono",children:e.version}),(0,t.jsx)(Y,{type:e.type})]},e.version))})}),(0,t.jsxs)(g.xo,{children:[(0,t.jsx)(g.le,{children:"Cancel"}),(0,t.jsxs)(g.OL,{onClick:()=>{ef({url:"".concat(k,"/migrations/run"),method:"post",values:{}},{onSuccess:e=>{var s,a,t;let l=null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.data;(null==l?void 0:null===(a=l.applied)||void 0===a?void 0:a.length)>0?n.Am.success("Successfully ran ".concat(l.applied.length," migration(s)")):n.Am.info("No pending migrations to run"),(null==l?void 0:null===(t=l.failed)||void 0===t?void 0:t.length)>0&&n.Am.error("".concat(l.failed.length," migration(s) failed")),I(!1),ez()},onError:e=>{n.Am.error("Failed to run migrations: ".concat(e.message))}})},disabled:ep,className:"bg-primary",children:[ep?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(O.Z,{className:"mr-2 h-4 w-4"}),"Run Migrations"]})]})]})}),(0,t.jsx)(g.aR,{open:W,onOpenChange:G,children:(0,t.jsxs)(g._T,{children:[(0,t.jsxs)(g.fY,{children:[(0,t.jsx)(g.f$,{children:"Rollback Migration?"}),(0,t.jsxs)(g.yT,{children:["This will rollback migration"," ",(0,t.jsx)("span",{className:"font-mono font-medium",children:null==et?void 0:et.version}),". This action may cause data loss. Are you sure?"]})]}),(0,t.jsxs)(g.xo,{children:[(0,t.jsx)(g.le,{children:"Cancel"}),(0,t.jsxs)(g.OL,{onClick:()=>et&&eO(et.version),disabled:eN,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[eN?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Rollback"]})]})]})}),(0,t.jsx)(N.Vq,{open:X,onOpenChange:ee,children:(0,t.jsxs)(N.cZ,{children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Create New Migration"}),(0,t.jsx)(N.Be,{children:"Generate a new migration file in the migrations directory"})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(x._,{htmlFor:"name",children:"Migration Name"}),(0,t.jsx)(o.I,{id:"name",placeholder:"e.g., add_user_preferences",value:er.name,onChange:e=>en({...er,name:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(x._,{htmlFor:"type",children:"Type"}),(0,t.jsxs)(v.Ph,{value:er.type,onValueChange:e=>en({...er,type:e}),children:[(0,t.jsx)(v.i4,{children:(0,t.jsx)(v.ki,{})}),(0,t.jsxs)(v.Bw,{children:[(0,t.jsx)(v.Ql,{value:"upgrade",children:"Upgrade"}),(0,t.jsx)(v.Ql,{value:"hotfix",children:"Hotfix"}),(0,t.jsx)(v.Ql,{value:"data",children:"Data Migration"}),(0,t.jsx)(v.Ql,{value:"schema",children:"Schema Change"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(x._,{htmlFor:"description",children:"Description (optional)"}),(0,t.jsx)(u.g,{id:"description",placeholder:"Describe what this migration does...",value:er.description,onChange:e=>en({...er,description:e.target.value})})]})]}),(0,t.jsxs)(N.cN,{children:[(0,t.jsx)(c.z,{variant:"outline",onClick:()=>ee(!1),children:"Cancel"}),(0,t.jsxs)(c.z,{onClick:()=>{if(!er.name.trim()){n.Am.error("Migration name is required");return}ek({url:"".concat(k,"/migrations/create"),method:"post",values:er},{onSuccess:e=>{var s,a;n.Am.success("Created migration: ".concat(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.filename)),ee(!1),en({name:"",description:"",type:"upgrade"}),ez()},onError:e=>{n.Am.error("Failed to create migration: ".concat(e.message))}})},disabled:eC,children:[eC?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(z.Z,{className:"mr-2 h-4 w-4"}),"Create Migration"]})]})]})}),(0,t.jsx)(N.Vq,{open:es,onOpenChange:ea,children:(0,t.jsxs)(N.cZ,{className:"max-w-2xl",children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Migration Details"}),(0,t.jsxs)(N.Be,{children:[null==et?void 0:et.version," - ",null==et?void 0:et.name]})]}),et&&(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto pr-2",children:(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Version"}),(0,t.jsx)("p",{className:"font-mono",children:et.version})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Name"}),(0,t.jsx)("p",{children:et.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Type"}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(Y,{type:et.type})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Status"}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(U,{status:et.status})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Batch"}),(0,t.jsxs)("p",{children:["#",et.batch||"-"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Execution Time"}),(0,t.jsxs)("p",{children:[et.executionTimeMs,"ms"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Executed At"}),(0,t.jsx)("p",{children:et.executedAt?(0,B.WU)(new Date(et.executedAt),"MMM d, yyyy HH:mm:ss"):"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Can Rollback"}),(0,t.jsx)("p",{children:et.canRollback?"Yes":"No"})]})]}),et.description&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Description"}),(0,t.jsx)("p",{className:"mt-1",children:et.description})]}),et.checksum&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Checksum"}),(0,t.jsx)("p",{className:"mt-1 font-mono text-xs break-all",children:et.checksum})]}),et.errorMessage&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground text-red-600",children:"Error"}),(0,t.jsx)("pre",{className:"mt-1 p-3 bg-red-100 dark:bg-red-900 rounded text-sm whitespace-pre-wrap break-words text-red-700 dark:text-red-300",children:et.errorMessage})]}),et.metadata&&Object.keys(et.metadata).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Metadata"}),(0,t.jsx)("pre",{className:"mt-1 p-3 bg-muted rounded text-sm whitespace-pre-wrap break-words",children:JSON.stringify(et.metadata,null,2)})]})]})}),(0,t.jsxs)(N.cN,{children:[(0,t.jsx)(c.z,{variant:"outline",onClick:()=>ea(!1),children:"Close"}),(null==et?void 0:et.canRollback)&&(null==et?void 0:et.status)==="completed"&&(0,t.jsxs)(c.z,{variant:"destructive",onClick:()=>{ea(!1),G(!0)},children:[(0,t.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Rollback"]})]})]})})]})};var F=()=>(0,t.jsx)(P,{})},30767:function(e,s,a){"use strict";a.d(s,{OL:function(){return p},_T:function(){return x},aR:function(){return c},f$:function(){return j},fY:function(){return u},le:function(){return g},vW:function(){return d},xo:function(){return h},yT:function(){return f}});var t=a(57437),l=a(2265),r=a(16720),n=a(93448),i=a(12381);let c=r.fC,d=r.xz,o=r.h_,m=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.aV,{className:(0,n.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",a),...l,ref:s})});m.displayName="AlertDialogOverlay";let x=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsxs)(o,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(r.VY,{ref:s,className:(0,n.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",a),...l})]})});x.displayName="AlertDialogContent";let u=e=>{let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-2 text-center sm:text-left",s),...a})};u.displayName="AlertDialogHeader";let h=e=>{let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a})};h.displayName="AlertDialogFooter";let j=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.Dx,{ref:s,className:(0,n.cn)("text-lg font-semibold",a),...l})});j.displayName="AlertDialogTitle";let f=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.dk,{ref:s,className:(0,n.cn)("text-sm text-muted-foreground",a),...l})});f.displayName="AlertDialogDescription";let p=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.aU,{ref:s,className:(0,n.cn)((0,i.d)(),a),...l})});p.displayName="AlertDialogAction";let g=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.$j,{ref:s,className:(0,n.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",a),...l})});g.displayName="AlertDialogCancel"},75060:function(e,s,a){"use strict";a.d(s,{_:function(){return d}});var t=a(57437),l=a(2265),r=a(370),n=a(90535),i=a(93448);let c=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.f,{ref:s,className:(0,i.cn)(c(),a),...l})});d.displayName=r.f.displayName},15291:function(e,s,a){"use strict";a.d(s,{Bw:function(){return f},DI:function(){return m},Ph:function(){return o},Ql:function(){return g},i4:function(){return u},ki:function(){return x},n5:function(){return p}});var t=a(57437),l=a(2265),r=a(74797),n=a(40875),i=a(22135),c=a(30401),d=a(93448);let o=r.fC,m=r.ZA,x=r.B4,u=l.forwardRef((e,s)=>{let{className:a,children:l,...i}=e;return(0,t.jsxs)(r.xz,{ref:s,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[l,(0,t.jsx)(r.JO,{asChild:!0,children:(0,t.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=r.xz.displayName;let h=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.u_,{ref:s,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...l,children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})});h.displayName=r.u_.displayName;let j=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.$G,{ref:s,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...l,children:(0,t.jsx)(n.Z,{className:"h-4 w-4"})})});j.displayName=r.$G.displayName;let f=l.forwardRef((e,s)=>{let{className:a,children:l,position:n="popper",...i}=e;return(0,t.jsx)(r.h_,{children:(0,t.jsxs)(r.VY,{ref:s,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 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","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...i,children:[(0,t.jsx)(h,{}),(0,t.jsx)(r.l_,{className:(0,d.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),style:{overscrollBehavior:"contain",touchAction:"pan-y",WebkitOverflowScrolling:"touch",willChange:"scroll-position",pointerEvents:"auto"},children:l}),(0,t.jsx)(j,{})]})})});f.displayName=r.VY.displayName;let p=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.__,{ref:s,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...l})});p.displayName=r.__.displayName;let g=l.forwardRef((e,s)=>{let{className:a,children:l,...n}=e;return(0,t.jsxs)(r.ck,{ref:s,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(r.wU,{children:(0,t.jsx)(c.Z,{className:"h-4 w-4"})})}),(0,t.jsx)(r.eT,{children:l})]})});g.displayName=r.ck.displayName,l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.Z0,{ref:s,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...l})}).displayName=r.Z0.displayName},69140:function(e,s,a){"use strict";a.d(s,{O:function(){return r}});var t=a(57437),l=a(93448);function r(e){let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,l.cn)("animate-pulse rounded-md bg-muted",s),...a})}},17168:function(e,s,a){"use strict";a.d(s,{SP:function(){return d},dr:function(){return c},mQ:function(){return i},nU:function(){return o}});var t=a(57437),l=a(2265),r=a(20271),n=a(93448);let i=r.fC,c=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.aV,{ref:s,className:(0,n.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...l})});c.displayName=r.aV.displayName;let d=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.xz,{ref:s,className:(0,n.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...l})});d.displayName=r.xz.displayName;let o=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.VY,{ref:s,className:(0,n.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...l})});o.displayName=r.VY.displayName},23675:function(e,s,a){"use strict";a.d(s,{g:function(){return n}});var t=a(57437),l=a(2265),r=a(93448);let n=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:s,...l})});n.displayName="Textarea"}},function(e){e.O(0,[7999,5094,4438,6530,4475,6241,926,600,1509,9487,3563,799,3233,2667,2971,2117,1744],function(){return e(e.s=55203)}),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3753],{55203:function(e,s,a){Promise.resolve().then(a.bind(a,36818))},36818:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return F}});var t=a(57437),l=a(2265),r=a(72135),n=a(14438),i=a(79820),c=a(12381),d=a(69174),o=a(40279),m=a(43368),x=a(75060),u=a(23675),h=a(17168),j=a(90641),f=a(69140),p=a(33804),g=a(30767),N=a(74291),v=a(15291),b=a(92934),w=a(91723),y=a(51817),k=a(99388),C=a(69076),Z=a(76865),S=a(16066),M=a(49322),A=a(50091),R=a(71947),_=a(82431),z=a(99397),O=a(33276),D=a(10866),T=a(65621),V=a(22135),E=a(40875),L=a(7598),B=a(27107);let U=e=>{let{status:s}=e,a={completed:{variant:"default",icon:(0,t.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),label:"Completed"},pending:{variant:"secondary",icon:(0,t.jsx)(w.Z,{className:"h-3 w-3 mr-1"}),label:"Pending"},running:{variant:"outline",icon:(0,t.jsx)(y.Z,{className:"h-3 w-3 mr-1 animate-spin"}),label:"Running"},failed:{variant:"destructive",icon:(0,t.jsx)(k.Z,{className:"h-3 w-3 mr-1"}),label:"Failed"},rolled_back:{variant:"outline",icon:(0,t.jsx)(C.Z,{className:"h-3 w-3 mr-1"}),label:"Rolled Back"},skipped:{variant:"secondary",icon:(0,t.jsx)(Z.Z,{className:"h-3 w-3 mr-1"}),label:"Skipped"}}[s]||{variant:"secondary",icon:null,label:s};return(0,t.jsxs)(d.C,{variant:a.variant,className:"flex items-center",children:[a.icon,a.label]})},Y=e=>{let{type:s}=e,a={upgrade:{color:"bg-blue-100 text-blue-800 dark:bg-blue-900 dark:text-blue-200",icon:(0,t.jsx)(S.Z,{className:"h-3 w-3 mr-1"})},hotfix:{color:"bg-orange-100 text-orange-800 dark:bg-orange-900 dark:text-orange-200",icon:(0,t.jsx)(M.Z,{className:"h-3 w-3 mr-1"})},rollback:{color:"bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200",icon:(0,t.jsx)(C.Z,{className:"h-3 w-3 mr-1"})},data:{color:"bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-200",icon:(0,t.jsx)(A.Z,{className:"h-3 w-3 mr-1"})},schema:{color:"bg-yellow-100 text-yellow-800 dark:bg-yellow-900 dark:text-yellow-200",icon:(0,t.jsx)(R.Z,{className:"h-3 w-3 mr-1"})}}[s]||{color:"bg-gray-100 text-gray-800",icon:null};return(0,t.jsxs)(d.C,{variant:"outline",className:"flex items-center ".concat(a.color),children:[a.icon,s]})},P=()=>{var e,s,a;let k=(0,r.Ji)(),[S,M]=(0,l.useState)("status"),[R,P]=(0,l.useState)(""),[F,Q]=(0,l.useState)([]),[H,$]=(0,l.useState)(new Set),[q,I]=(0,l.useState)(!1),[W,G]=(0,l.useState)(!1),[J,K]=(0,l.useState)(!1),[X,ee]=(0,l.useState)(!1),[es,ea]=(0,l.useState)(!1),[et,el]=(0,l.useState)(null),[er,en]=(0,l.useState)({name:"",description:"",type:"upgrade"}),{data:ei,isLoading:ec,refetch:ed}=(0,r.EV)({url:"".concat(k,"/migrations/status"),method:"get",queryOptions:{refetchInterval:5e3}}),{data:eo,isLoading:em,refetch:ex}=(0,r.EV)({url:"".concat(k,"/migrations"),method:"get"}),{data:eu,isLoading:eh,refetch:ej}=(0,r.EV)({url:"".concat(k,"/migrations/pending"),method:"get"}),{mutate:ef,isLoading:ep}=(0,r.uC)(),{mutate:eg,isLoading:eN}=(0,r.uC)(),{mutate:ev,isLoading:eb}=(0,r.uC)(),{mutate:ew,isLoading:ey}=(0,r.uC)(),{mutate:ek,isLoading:eC}=(0,r.uC)(),{mutate:eZ,isLoading:eS}=(0,r.uC)(),eM=null==ei?void 0:null===(e=ei.data)||void 0===e?void 0:e.data,eA=(null==eo?void 0:null===(s=eo.data)||void 0===s?void 0:s.data)||[],eR=(null==eu?void 0:null===(a=eu.data)||void 0===a?void 0:a.data)||[],e_=(0,l.useMemo)(()=>{if(!R.trim())return eA;let e=R.toLowerCase();return eA.filter(s=>{var a;return s.version.toLowerCase().includes(e)||s.name.toLowerCase().includes(e)||(null===(a=s.description)||void 0===a?void 0:a.toLowerCase().includes(e))})},[eA,R]),ez=()=>{ed(),ex(),ej()},eO=e=>{eg({url:"".concat(k,"/migrations/rollback/").concat(encodeURIComponent(e)),method:"post",values:{}},{onSuccess:()=>{n.Am.success("Successfully rolled back migration ".concat(e)),G(!1),el(null),ez()},onError:e=>{n.Am.error("Failed to rollback: ".concat(e.message))}})},eD=e=>{eZ({url:"".concat(k,"/migrations/rollback-batch"),method:"post",values:{batch:e}},{onSuccess:s=>{var a,t;let l=null==s?void 0:null===(a=s.data)||void 0===a?void 0:a.data;n.Am.success("Successfully rolled back ".concat((null==l?void 0:null===(t=l.rolledBack)||void 0===t?void 0:t.length)||0," migration(s) from batch ").concat(e)),ez()},onError:e=>{n.Am.error("Failed to rollback batch: ".concat(e.message))}})},eT=e=>{ev({url:"".concat(k,"/migrations/mark-completed/").concat(encodeURIComponent(e)),method:"post",values:{}},{onSuccess:()=>{n.Am.success("Marked migration ".concat(e," as completed")),K(!1),ez()},onError:e=>{n.Am.error("Failed to mark as completed: ".concat(e.message))}})},eV=e=>{$(s=>{let a=new Set(s);return a.has(e)?a.delete(e):a.add(e),a})},eE=e=>{el(e),ea(!0)};return ec?(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-4",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)(f.O,{className:"h-8 w-48"}),(0,t.jsx)(f.O,{className:"h-10 w-32"})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4",children:[1,2,3,4].map(e=>(0,t.jsx)(f.O,{className:"h-24"},e))}),(0,t.jsx)(f.O,{className:"h-96"})]}):(0,t.jsxs)("div",{className:"flex flex-col h-full overflow-hidden gap-4",children:[(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2 flex-shrink-0",children:[(0,t.jsx)("h1",{className:"text-lg font-semibold",children:"Database Migrations"}),(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,t.jsx)(c.z,{variant:"outline",size:"icon",onClick:ez,children:(0,t.jsx)(_.Z,{className:"h-4 w-4"})}),(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>ee(!0),children:[(0,t.jsx)(z.Z,{className:"mr-2 h-4 w-4"}),"Create Migration"]}),(0,t.jsxs)(c.z,{onClick:()=>I(!0),disabled:!eR.length||ep,children:[ep?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(O.Z,{className:"mr-2 h-4 w-4"}),"Run Migrations"]})]})]}),(null==eM?void 0:eM.isSequelizeUpgrade)&&(0,t.jsx)(i.Zb,{className:"border-amber-500 bg-amber-50 dark:bg-amber-950",children:(0,t.jsx)(i.aY,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)(Z.Z,{className:"h-5 w-5 text-amber-600"}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-medium text-amber-800 dark:text-amber-200",children:"Sequelize to Drizzle Upgrade Detected"}),(0,t.jsx)("p",{className:"text-sm text-amber-700 dark:text-amber-300",children:"Your database appears to be from an older Sequelize-based version. Please run the pending migrations to complete the upgrade."})]})]})})}),(0,t.jsxs)("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 flex-shrink-0",children:[(0,t.jsx)(i.Zb,{children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Current Version"}),(0,t.jsx)(i.ll,{className:"text-2xl font-mono",children:(null==eM?void 0:eM.currentVersion)||"No migrations"})]})}),(0,t.jsx)(i.Zb,{children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Applied Migrations"}),(0,t.jsx)(i.ll,{className:"text-2xl",children:(null==eM?void 0:eM.appliedCount)||0})]})}),(0,t.jsx)(i.Zb,{className:(null==eM?void 0:eM.pendingCount)?"border-amber-500":"",children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Pending Migrations"}),(0,t.jsxs)(i.ll,{className:"text-2xl flex items-center gap-2",children:[(null==eM?void 0:eM.pendingCount)||0,(null==eM?void 0:eM.pendingCount)?(0,t.jsx)(Z.Z,{className:"h-5 w-5 text-amber-500"}):(0,t.jsx)(b.Z,{className:"h-5 w-5 text-green-500"})]})]})}),(0,t.jsx)(i.Zb,{children:(0,t.jsxs)(i.Ol,{className:"pb-2",children:[(0,t.jsx)(i.SZ,{children:"Last Batch"}),(0,t.jsxs)(i.ll,{className:"text-2xl",children:["#",(null==eM?void 0:eM.lastBatch)||0]})]})})]}),(0,t.jsxs)(h.mQ,{value:S,onValueChange:M,className:"flex-1 flex flex-col min-h-0",children:[(0,t.jsxs)(h.dr,{className:"grid w-full max-w-md grid-cols-3",children:[(0,t.jsxs)(h.SP,{value:"status",children:[(0,t.jsx)(D.Z,{className:"h-4 w-4 mr-2"}),"Status"]}),(0,t.jsxs)(h.SP,{value:"pending",children:[(0,t.jsx)(w.Z,{className:"h-4 w-4 mr-2"}),"Pending (",eR.length,")"]}),(0,t.jsxs)(h.SP,{value:"history",children:[(0,t.jsx)(T.Z,{className:"h-4 w-4 mr-2"}),"History"]})]}),(0,t.jsx)(h.nU,{value:"status",className:"flex-1 overflow-hidden",children:(0,t.jsxs)(i.Zb,{className:"h-full",children:[(0,t.jsxs)(i.Ol,{children:[(0,t.jsx)(i.ll,{children:"Migration Status"}),(0,t.jsx)(i.SZ,{children:"Overview of your database migration state"})]}),(0,t.jsxs)(i.aY,{className:"space-y-6",children:[(null==eM?void 0:eM.lastMigration)&&(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Last Applied Migration"}),(0,t.jsx)(i.Zb,{children:(0,t.jsx)(i.aY,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-mono font-medium",children:eM.lastMigration.version}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:eM.lastMigration.name})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(U,{status:eM.lastMigration.status}),eM.lastMigration.executedAt&&(0,t.jsx)("span",{className:"text-sm text-muted-foreground",children:(0,L.Q)(new Date(eM.lastMigration.executedAt),{addSuffix:!0})})]})]})})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"Quick Actions"}),(0,t.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>I(!0),disabled:!eR.length,children:[(0,t.jsx)(O.Z,{className:"h-4 w-4 mr-2"}),"Run All Pending"]}),(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>{ew({url:"".concat(k,"/migrations/mark-all-completed"),method:"post",values:{}},{onSuccess:e=>{var s,a;let t=(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.markedCount)||0;n.Am.success("Marked ".concat(t," migration(s) as completed")),ez()},onError:e=>{n.Am.error("Failed to mark all as completed: ".concat(e.message))}})},disabled:ey||!eR.length,children:[ey?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,t.jsx)(b.Z,{className:"h-4 w-4 mr-2"}),"Mark All as Completed"]}),(null==eM?void 0:eM.lastBatch)&&eM.lastBatch>0&&(0,t.jsxs)(c.z,{variant:"outline",onClick:()=>eD(eM.lastBatch),disabled:eS,children:[eS?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,t.jsx)(C.Z,{className:"h-4 w-4 mr-2"}),"Rollback Batch #",eM.lastBatch]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)("h3",{className:"text-sm font-medium text-muted-foreground",children:"System Information"}),(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Total Migrations:"}),(0,t.jsx)("span",{className:"ml-2 font-medium",children:(null==eM?void 0:eM.totalMigrations)||0})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("span",{className:"text-muted-foreground",children:"Status:"}),(0,t.jsx)("span",{className:"ml-2",children:(null==eM?void 0:eM.isUpToDate)?(0,t.jsxs)(d.C,{variant:"default",children:[(0,t.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),"Up to Date"]}):(0,t.jsxs)(d.C,{variant:"secondary",children:[(0,t.jsx)(Z.Z,{className:"h-3 w-3 mr-1"}),"Updates Available"]})})]})]})]})]})]})}),(0,t.jsx)(h.nU,{value:"pending",className:"flex-1 overflow-hidden",children:(0,t.jsxs)(i.Zb,{className:"h-full flex flex-col",children:[(0,t.jsxs)(i.Ol,{children:[(0,t.jsx)(i.ll,{children:"Pending Migrations"}),(0,t.jsx)(i.SZ,{children:"Migrations waiting to be applied"})]}),(0,t.jsx)(i.aY,{className:"flex-1 overflow-hidden",children:eh?(0,t.jsx)("div",{className:"space-y-2",children:[1,2,3].map(e=>(0,t.jsx)(f.O,{className:"h-16"},e))}):0===eR.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,t.jsx)(b.Z,{className:"h-12 w-12 mb-4 text-green-500"}),(0,t.jsx)("p",{className:"text-lg font-medium",children:"All migrations are up to date!"}),(0,t.jsx)("p",{className:"text-sm",children:"No pending migrations to run."})]}):(0,t.jsx)(j.x,{className:"h-full",children:(0,t.jsx)("div",{className:"space-y-2",children:eR.map((e,s)=>(0,t.jsx)(i.Zb,{children:(0,t.jsx)(i.aY,{className:"py-4",children:(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsxs)("span",{className:"text-muted-foreground w-6",children:[s+1,"."]}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"font-mono font-medium",children:e.version}),(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:e.name}),e.description&&(0,t.jsx)("p",{className:"text-xs text-muted-foreground mt-1",children:e.description})]})]}),(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(Y,{type:e.type}),e.canRollback&&(0,t.jsx)(d.C,{variant:"outline",className:"text-xs",children:"Reversible"}),(0,t.jsx)(c.z,{size:"sm",variant:"outline",onClick:()=>eT(e.version),children:"Mark Done"})]})]})})},e.version))})})})]})}),(0,t.jsx)(h.nU,{value:"history",className:"flex-1 overflow-hidden",children:(0,t.jsxs)(i.Zb,{className:"h-full flex flex-col",children:[(0,t.jsx)(i.Ol,{className:"flex-shrink-0",children:(0,t.jsxs)("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-2",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(i.ll,{children:"Migration History"}),(0,t.jsx)(i.SZ,{children:"All applied migrations"})]}),(0,t.jsx)(m.t,{value:R,onChange:P,placeholder:"Search migrations...",expandedWidth:"w-64"})]})}),(0,t.jsx)(i.aY,{className:"flex-1 overflow-hidden p-0",children:em?(0,t.jsx)("div",{className:"p-6 space-y-2",children:[1,2,3,4,5].map(e=>(0,t.jsx)(f.O,{className:"h-12"},e))}):0===e_.length?(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center h-full text-muted-foreground",children:[(0,t.jsx)(A.Z,{className:"h-12 w-12 mb-4"}),(0,t.jsx)("p",{className:"text-lg font-medium",children:"No migrations found"}),(0,t.jsx)("p",{className:"text-sm",children:R?"Try a different search term":"No migrations have been run yet"})]}):(0,t.jsx)(j.x,{className:"h-full",children:(0,t.jsxs)(p.iA,{children:[(0,t.jsx)(p.xD,{className:"sticky top-0 bg-background",children:(0,t.jsxs)(p.SC,{children:[(0,t.jsx)(p.ss,{className:"w-8"}),(0,t.jsx)(p.ss,{children:"Version"}),(0,t.jsx)(p.ss,{children:"Name"}),(0,t.jsx)(p.ss,{children:"Type"}),(0,t.jsx)(p.ss,{children:"Status"}),(0,t.jsx)(p.ss,{children:"Batch"}),(0,t.jsx)(p.ss,{children:"Executed"}),(0,t.jsx)(p.ss,{children:"Duration"}),(0,t.jsx)(p.ss,{className:"w-24",children:"Actions"})]})}),(0,t.jsx)(p.RM,{children:e_.map(e=>(0,t.jsxs)(l.Fragment,{children:[(0,t.jsxs)(p.SC,{className:"failed"===e.status?"bg-red-50 dark:bg-red-950":"",children:[(0,t.jsx)(p.pj,{children:(e.errorMessage||e.description)&&(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-6 w-6",onClick:()=>eV(e.id),children:H.has(e.id)?(0,t.jsx)(V.Z,{className:"h-4 w-4"}):(0,t.jsx)(E.Z,{className:"h-4 w-4"})})}),(0,t.jsx)(p.pj,{className:"font-mono text-sm",children:e.version}),(0,t.jsx)(p.pj,{children:e.name}),(0,t.jsx)(p.pj,{children:(0,t.jsx)(Y,{type:e.type})}),(0,t.jsx)(p.pj,{children:(0,t.jsx)(U,{status:e.status})}),(0,t.jsxs)(p.pj,{children:["#",e.batch||"-"]}),(0,t.jsx)(p.pj,{children:e.executedAt?(0,B.WU)(new Date(e.executedAt),"MMM d, yyyy HH:mm"):"-"}),(0,t.jsx)(p.pj,{children:e.executionTimeMs?"".concat(e.executionTimeMs,"ms"):"-"}),(0,t.jsx)(p.pj,{children:(0,t.jsxs)("div",{className:"flex items-center gap-1",children:[(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>eE(e),children:(0,t.jsx)(D.Z,{className:"h-4 w-4"})}),e.canRollback&&"completed"===e.status&&(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-8 w-8",onClick:()=>{el(e),G(!0)},children:(0,t.jsx)(C.Z,{className:"h-4 w-4"})})]})})]}),H.has(e.id)&&(0,t.jsx)(p.SC,{children:(0,t.jsxs)(p.pj,{colSpan:9,className:"bg-muted/50 p-4",children:[e.description&&(0,t.jsxs)("p",{className:"text-sm mb-2",children:[(0,t.jsx)("strong",{children:"Description:"})," ",e.description]}),e.errorMessage&&(0,t.jsxs)("div",{className:"text-sm text-red-600 dark:text-red-400",children:[(0,t.jsx)("strong",{children:"Error:"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900 rounded text-xs overflow-x-auto",children:e.errorMessage}),e.errorStack&&(0,t.jsxs)("details",{className:"mt-2",children:[(0,t.jsx)("summary",{className:"cursor-pointer text-xs",children:"Stack trace"}),(0,t.jsx)("pre",{className:"mt-1 p-2 bg-red-100 dark:bg-red-900 rounded text-xs overflow-x-auto",children:e.errorStack})]})]})]})})]},e.id))})]})})})]})})]}),(0,t.jsx)(g.aR,{open:q,onOpenChange:I,children:(0,t.jsxs)(g._T,{children:[(0,t.jsxs)(g.fY,{children:[(0,t.jsx)(g.f$,{children:"Run Pending Migrations?"}),(0,t.jsxs)(g.yT,{children:["This will execute ",eR.length," pending migration(s). Make sure you have a database backup before proceeding."]})]}),(0,t.jsx)("div",{className:"max-h-48 overflow-y-auto my-4",children:(0,t.jsx)("div",{className:"space-y-2",children:eR.map(e=>(0,t.jsxs)("div",{className:"text-sm p-2 bg-muted rounded flex items-center justify-between",children:[(0,t.jsx)("span",{className:"font-mono",children:e.version}),(0,t.jsx)(Y,{type:e.type})]},e.version))})}),(0,t.jsxs)(g.xo,{children:[(0,t.jsx)(g.le,{children:"Cancel"}),(0,t.jsxs)(g.OL,{onClick:()=>{ef({url:"".concat(k,"/migrations/run"),method:"post",values:{}},{onSuccess:e=>{var s,a,t;let l=null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.data;(null==l?void 0:null===(a=l.applied)||void 0===a?void 0:a.length)>0?n.Am.success("Successfully ran ".concat(l.applied.length," migration(s)")):n.Am.info("No pending migrations to run"),(null==l?void 0:null===(t=l.failed)||void 0===t?void 0:t.length)>0&&n.Am.error("".concat(l.failed.length," migration(s) failed")),I(!1),ez()},onError:e=>{n.Am.error("Failed to run migrations: ".concat(e.message))}})},disabled:ep,className:"bg-primary",children:[ep?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(O.Z,{className:"mr-2 h-4 w-4"}),"Run Migrations"]})]})]})}),(0,t.jsx)(g.aR,{open:W,onOpenChange:G,children:(0,t.jsxs)(g._T,{children:[(0,t.jsxs)(g.fY,{children:[(0,t.jsx)(g.f$,{children:"Rollback Migration?"}),(0,t.jsxs)(g.yT,{children:["This will rollback migration"," ",(0,t.jsx)("span",{className:"font-mono font-medium",children:null==et?void 0:et.version}),". This action may cause data loss. Are you sure?"]})]}),(0,t.jsxs)(g.xo,{children:[(0,t.jsx)(g.le,{children:"Cancel"}),(0,t.jsxs)(g.OL,{onClick:()=>et&&eO(et.version),disabled:eN,className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:[eN?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Rollback"]})]})]})}),(0,t.jsx)(N.Vq,{open:X,onOpenChange:ee,children:(0,t.jsxs)(N.cZ,{children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Create New Migration"}),(0,t.jsx)(N.Be,{children:"Generate a new migration file in the migrations directory"})]}),(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(x._,{htmlFor:"name",children:"Migration Name"}),(0,t.jsx)(o.I,{id:"name",placeholder:"e.g., add_user_preferences",value:er.name,onChange:e=>en({...er,name:e.target.value})})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(x._,{htmlFor:"type",children:"Type"}),(0,t.jsxs)(v.Ph,{value:er.type,onValueChange:e=>en({...er,type:e}),children:[(0,t.jsx)(v.i4,{children:(0,t.jsx)(v.ki,{})}),(0,t.jsxs)(v.Bw,{children:[(0,t.jsx)(v.Ql,{value:"upgrade",children:"Upgrade"}),(0,t.jsx)(v.Ql,{value:"hotfix",children:"Hotfix"}),(0,t.jsx)(v.Ql,{value:"data",children:"Data Migration"}),(0,t.jsx)(v.Ql,{value:"schema",children:"Schema Change"})]})]})]}),(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsx)(x._,{htmlFor:"description",children:"Description (optional)"}),(0,t.jsx)(u.g,{id:"description",placeholder:"Describe what this migration does...",value:er.description,onChange:e=>en({...er,description:e.target.value})})]})]}),(0,t.jsxs)(N.cN,{children:[(0,t.jsx)(c.z,{variant:"outline",onClick:()=>ee(!1),children:"Cancel"}),(0,t.jsxs)(c.z,{onClick:()=>{if(!er.name.trim()){n.Am.error("Migration name is required");return}ek({url:"".concat(k,"/migrations/create"),method:"post",values:er},{onSuccess:e=>{var s,a;n.Am.success("Created migration: ".concat(null==e?void 0:null===(a=e.data)||void 0===a?void 0:null===(s=a.data)||void 0===s?void 0:s.filename)),ee(!1),en({name:"",description:"",type:"upgrade"}),ez()},onError:e=>{n.Am.error("Failed to create migration: ".concat(e.message))}})},disabled:eC,children:[eC?(0,t.jsx)(y.Z,{className:"mr-2 h-4 w-4 animate-spin"}):(0,t.jsx)(z.Z,{className:"mr-2 h-4 w-4"}),"Create Migration"]})]})]})}),(0,t.jsx)(N.Vq,{open:es,onOpenChange:ea,children:(0,t.jsxs)(N.cZ,{className:"max-w-2xl",children:[(0,t.jsxs)(N.fK,{children:[(0,t.jsx)(N.$N,{children:"Migration Details"}),(0,t.jsxs)(N.Be,{children:[null==et?void 0:et.version," - ",null==et?void 0:et.name]})]}),et&&(0,t.jsx)("div",{className:"max-h-[60vh] overflow-y-auto pr-2",children:(0,t.jsxs)("div",{className:"space-y-4 py-4",children:[(0,t.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Version"}),(0,t.jsx)("p",{className:"font-mono",children:et.version})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Name"}),(0,t.jsx)("p",{children:et.name})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Type"}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(Y,{type:et.type})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Status"}),(0,t.jsx)("div",{className:"mt-1",children:(0,t.jsx)(U,{status:et.status})})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Batch"}),(0,t.jsxs)("p",{children:["#",et.batch||"-"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Execution Time"}),(0,t.jsxs)("p",{children:[et.executionTimeMs,"ms"]})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Executed At"}),(0,t.jsx)("p",{children:et.executedAt?(0,B.WU)(new Date(et.executedAt),"MMM d, yyyy HH:mm:ss"):"-"})]}),(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Can Rollback"}),(0,t.jsx)("p",{children:et.canRollback?"Yes":"No"})]})]}),et.description&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Description"}),(0,t.jsx)("p",{className:"mt-1",children:et.description})]}),et.checksum&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Checksum"}),(0,t.jsx)("p",{className:"mt-1 font-mono text-xs break-all",children:et.checksum})]}),et.errorMessage&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground text-red-600",children:"Error"}),(0,t.jsx)("pre",{className:"mt-1 p-3 bg-red-100 dark:bg-red-900 rounded text-sm whitespace-pre-wrap break-words text-red-700 dark:text-red-300",children:et.errorMessage})]}),et.metadata&&Object.keys(et.metadata).length>0&&(0,t.jsxs)("div",{children:[(0,t.jsx)(x._,{className:"text-muted-foreground",children:"Metadata"}),(0,t.jsx)("pre",{className:"mt-1 p-3 bg-muted rounded text-sm whitespace-pre-wrap break-words",children:JSON.stringify(et.metadata,null,2)})]})]})}),(0,t.jsxs)(N.cN,{children:[(0,t.jsx)(c.z,{variant:"outline",onClick:()=>ea(!1),children:"Close"}),(null==et?void 0:et.canRollback)&&(null==et?void 0:et.status)==="completed"&&(0,t.jsxs)(c.z,{variant:"destructive",onClick:()=>{ea(!1),G(!0)},children:[(0,t.jsx)(C.Z,{className:"mr-2 h-4 w-4"}),"Rollback"]})]})]})})]})};var F=()=>(0,t.jsx)(P,{})},30767:function(e,s,a){"use strict";a.d(s,{OL:function(){return p},_T:function(){return x},aR:function(){return c},f$:function(){return j},fY:function(){return u},le:function(){return g},vW:function(){return d},xo:function(){return h},yT:function(){return f}});var t=a(57437),l=a(2265),r=a(16720),n=a(93448),i=a(12381);let c=r.fC,d=r.xz,o=r.h_,m=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.aV,{className:(0,n.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",a),...l,ref:s})});m.displayName="AlertDialogOverlay";let x=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsxs)(o,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(r.VY,{ref:s,className:(0,n.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",a),...l})]})});x.displayName="AlertDialogContent";let u=e=>{let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col space-y-2 text-center sm:text-left",s),...a})};u.displayName="AlertDialogHeader";let h=e=>{let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,n.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...a})};h.displayName="AlertDialogFooter";let j=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.Dx,{ref:s,className:(0,n.cn)("text-lg font-semibold",a),...l})});j.displayName="AlertDialogTitle";let f=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.dk,{ref:s,className:(0,n.cn)("text-sm text-muted-foreground",a),...l})});f.displayName="AlertDialogDescription";let p=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.aU,{ref:s,className:(0,n.cn)((0,i.d)(),a),...l})});p.displayName="AlertDialogAction";let g=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.$j,{ref:s,className:(0,n.cn)((0,i.d)({variant:"outline"}),"mt-2 sm:mt-0",a),...l})});g.displayName="AlertDialogCancel"},75060:function(e,s,a){"use strict";a.d(s,{_:function(){return d}});var t=a(57437),l=a(2265),r=a(370),n=a(90535),i=a(93448);let c=(0,n.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),d=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.f,{ref:s,className:(0,i.cn)(c(),a),...l})});d.displayName=r.f.displayName},15291:function(e,s,a){"use strict";a.d(s,{Bw:function(){return f},DI:function(){return m},Ph:function(){return o},Ql:function(){return g},i4:function(){return u},ki:function(){return x},n5:function(){return p}});var t=a(57437),l=a(2265),r=a(74797),n=a(40875),i=a(22135),c=a(30401),d=a(93448);let o=r.fC,m=r.ZA,x=r.B4,u=l.forwardRef((e,s)=>{let{className:a,children:l,...i}=e;return(0,t.jsxs)(r.xz,{ref:s,className:(0,d.cn)("flex h-10 w-full items-center justify-between rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",a),...i,children:[l,(0,t.jsx)(r.JO,{asChild:!0,children:(0,t.jsx)(n.Z,{className:"h-4 w-4 opacity-50"})})]})});u.displayName=r.xz.displayName;let h=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.u_,{ref:s,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...l,children:(0,t.jsx)(i.Z,{className:"h-4 w-4"})})});h.displayName=r.u_.displayName;let j=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.$G,{ref:s,className:(0,d.cn)("flex cursor-default items-center justify-center py-1",a),...l,children:(0,t.jsx)(n.Z,{className:"h-4 w-4"})})});j.displayName=r.$G.displayName;let f=l.forwardRef((e,s)=>{let{className:a,children:l,position:n="popper",...i}=e;return(0,t.jsx)(r.h_,{children:(0,t.jsxs)(r.VY,{ref:s,className:(0,d.cn)("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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 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","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",a),position:n,...i,children:[(0,t.jsx)(h,{}),(0,t.jsx)(r.l_,{className:(0,d.cn)("p-1 max-h-[300px] overflow-y-auto","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),style:{overscrollBehavior:"contain",touchAction:"pan-y",WebkitOverflowScrolling:"touch",willChange:"scroll-position",pointerEvents:"auto"},children:l}),(0,t.jsx)(j,{})]})})});f.displayName=r.VY.displayName;let p=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.__,{ref:s,className:(0,d.cn)("py-1.5 pl-8 pr-2 text-sm font-semibold",a),...l})});p.displayName=r.__.displayName;let g=l.forwardRef((e,s)=>{let{className:a,children:l,...n}=e;return(0,t.jsxs)(r.ck,{ref:s,className:(0,d.cn)("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",a),...n,children:[(0,t.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,t.jsx)(r.wU,{children:(0,t.jsx)(c.Z,{className:"h-4 w-4"})})}),(0,t.jsx)(r.eT,{children:l})]})});g.displayName=r.ck.displayName,l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.Z0,{ref:s,className:(0,d.cn)("-mx-1 my-1 h-px bg-muted",a),...l})}).displayName=r.Z0.displayName},69140:function(e,s,a){"use strict";a.d(s,{O:function(){return r}});var t=a(57437),l=a(93448);function r(e){let{className:s,...a}=e;return(0,t.jsx)("div",{className:(0,l.cn)("animate-pulse rounded-md bg-muted",s),...a})}},17168:function(e,s,a){"use strict";a.d(s,{SP:function(){return d},dr:function(){return c},mQ:function(){return i},nU:function(){return o}});var t=a(57437),l=a(2265),r=a(20271),n=a(93448);let i=r.fC,c=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.aV,{ref:s,className:(0,n.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",a),...l})});c.displayName=r.aV.displayName;let d=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.xz,{ref:s,className:(0,n.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",a),...l})});d.displayName=r.xz.displayName;let o=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)(r.VY,{ref:s,className:(0,n.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a),...l})});o.displayName=r.VY.displayName},23675:function(e,s,a){"use strict";a.d(s,{g:function(){return n}});var t=a(57437),l=a(2265),r=a(93448);let n=l.forwardRef((e,s)=>{let{className:a,...l}=e;return(0,t.jsx)("textarea",{className:(0,r.cn)("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:s,...l})});n.displayName="Textarea"}},function(e){e.O(0,[7999,5094,4438,6530,4475,6241,926,600,1509,9487,3563,4766,6027,2667,2971,2117,1744],function(){return e(e.s=55203)}),_N_E=e.O()}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8888],{87949:function(e,s,n){Promise.resolve().then(n.bind(n,99502))},40875:function(e,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(79205).Z)("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])},10407:function(e,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(79205).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},33003:function(e,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(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,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(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"}]])},82431:function(e,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(79205).Z)("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},73247:function(e,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(79205).Z)("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])},18930:function(e,s,n){"use strict";n.d(s,{Z:function(){return t}});let t=(0,n(79205).Z)("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])},99502:function(e,s,n){"use strict";n.r(s),n.d(s,{default:function(){return F}});var t=n(57437),a=n(2265),l=n(72135),i=n(14438),r=n(79820),c=n(12381),o=n(69174),d=n(17168),m=n(90641),u=n(69140),x=n(33804),h=n(8227),f=n(30767),j=n(40875),p=n(10407),b=n(71947),g=n(50091),v=n(18930),y=n(51817),N=n(82431),w=n(76865),C=n(33003),D=n(54001),k=n(92934);let I=(0,n(79205).Z)("TableProperties",[["path",{d:"M15 3v18",key:"14nvp0"}],["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]]);var O=n(33276),Z=n(43368);let S=e=>{let{label:s,value:n,variant:a="default",icon:l}=e;return(0,t.jsx)(r.Zb,{className:"".concat({default:"border-border",warning:n>0?"border-yellow-500/50 bg-yellow-500/5":"border-border",success:"border-green-500/50 bg-green-500/5"}[a]),children:(0,t.jsx)(r.aY,{className:"p-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"text-muted-foreground",children:l}),(0,t.jsxs)("div",{children:[(0,t.jsx)("p",{className:"text-2xl font-bold",children:n}),(0,t.jsx)("p",{className:"text-xs text-muted-foreground",children:s})]})]})})})},R=e=>{let{diff:s,onDeleteField:n}=e,[l,i]=(0,a.useState)(!1);return(0,t.jsxs)(h.zF,{open:l,onOpenChange:i,children:[(0,t.jsx)(h.wy,{asChild:!0,children:(0,t.jsxs)("button",{className:"flex w-full items-center justify-between rounded-md border p-3 text-left hover:bg-accent transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[l?(0,t.jsx)(j.Z,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(p.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:s.collection})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[s.fieldsOnlyInSchema.length>0&&(0,t.jsxs)(o.C,{variant:"outline",className:"bg-blue-500/10 text-blue-700 dark:text-blue-300 border-blue-500/30",children:[(0,t.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),s.fieldsOnlyInSchema.length," only in schema"]}),s.fieldsOnlyInDb.length>0&&(0,t.jsxs)(o.C,{variant:"outline",className:"bg-orange-500/10 text-orange-700 dark:text-orange-300 border-orange-500/30",children:[(0,t.jsx)(g.Z,{className:"h-3 w-3 mr-1"}),s.fieldsOnlyInDb.length," only in DB"]})]})]})}),(0,t.jsx)(h.Fw,{children:(0,t.jsxs)("div",{className:"ml-7 mt-2 space-y-3 pb-2",children:[s.fieldsOnlyInSchema.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-blue-700 dark:text-blue-300 mb-1 flex items-center gap-1",children:[(0,t.jsx)(b.Z,{className:"h-3.5 w-3.5"}),"In schema definition, missing from database"]}),(0,t.jsxs)(x.iA,{children:[(0,t.jsx)(x.xD,{children:(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.ss,{className:"w-[200px]",children:"Column"}),(0,t.jsx)(x.ss,{className:"w-[120px]",children:"Type"}),(0,t.jsx)(x.ss,{children:"Source Field"}),(0,t.jsx)(x.ss,{className:"w-[80px] text-right",children:"Action"})]})}),(0,t.jsx)(x.RM,{children:s.fieldsOnlyInSchema.map(e=>(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.pj,{className:"font-mono text-sm",children:e.column}),(0,t.jsx)(x.pj,{children:(0,t.jsx)(o.C,{variant:"secondary",children:e.type})}),(0,t.jsx)(x.pj,{className:"text-muted-foreground text-sm",children:e.fromField}),(0,t.jsx)(x.pj,{className:"text-right",children:(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>n(s.collection,e.fromField,"schema"),title:"Remove from schema",children:(0,t.jsx)(v.Z,{className:"h-3.5 w-3.5"})})})]},e.column))})]})]}),s.fieldsOnlyInDb.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-orange-700 dark:text-orange-300 mb-1 flex items-center gap-1",children:[(0,t.jsx)(g.Z,{className:"h-3.5 w-3.5"}),"In database, missing from schema definition"]}),(0,t.jsxs)(x.iA,{children:[(0,t.jsx)(x.xD,{children:(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.ss,{className:"w-[200px]",children:"Column"}),(0,t.jsx)(x.ss,{className:"w-[120px]",children:"Data Type"}),(0,t.jsx)(x.ss,{className:"w-[100px]",children:"Nullable"}),(0,t.jsx)(x.ss,{children:"Default"}),(0,t.jsx)(x.ss,{className:"w-[80px] text-right",children:"Action"})]})}),(0,t.jsx)(x.RM,{children:s.fieldsOnlyInDb.map(e=>(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.pj,{className:"font-mono text-sm",children:e.column}),(0,t.jsx)(x.pj,{children:(0,t.jsx)(o.C,{variant:"secondary",children:e.dataType})}),(0,t.jsx)(x.pj,{children:(0,t.jsx)(o.C,{variant:"YES"===e.isNullable?"outline":"default",children:"YES"===e.isNullable?"Yes":"No"})}),(0,t.jsx)(x.pj,{className:"text-muted-foreground text-sm font-mono max-w-[300px] truncate",children:e.columnDefault||"—"}),(0,t.jsx)(x.pj,{className:"text-right",children:(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>n(s.collection,e.column,"db"),title:"Drop from database",children:(0,t.jsx)(v.Z,{className:"h-3.5 w-3.5"})})})]},e.column))})]})]})]})})]})},T=e=>{let{diff:s}=e,[n,l]=(0,a.useState)(!1);return(0,t.jsxs)(h.zF,{open:n,onOpenChange:l,children:[(0,t.jsx)(h.wy,{asChild:!0,children:(0,t.jsxs)("button",{className:"flex w-full items-center justify-between rounded-md border p-3 text-left hover:bg-accent transition-colors",children:[(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[n?(0,t.jsx)(j.Z,{className:"h-4 w-4 text-muted-foreground"}):(0,t.jsx)(p.Z,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-medium",children:s.collection})]}),(0,t.jsxs)("div",{className:"flex gap-2",children:[s.indexesOnlyInSchema.length>0&&(0,t.jsxs)(o.C,{variant:"outline",className:"bg-blue-500/10 text-blue-700 dark:text-blue-300 border-blue-500/30",children:[(0,t.jsx)(b.Z,{className:"h-3 w-3 mr-1"}),s.indexesOnlyInSchema.length," missing in DB"]}),s.indexesOnlyInDb.length>0&&(0,t.jsxs)(o.C,{variant:"outline",className:"bg-orange-500/10 text-orange-700 dark:text-orange-300 border-orange-500/30",children:[(0,t.jsx)(g.Z,{className:"h-3 w-3 mr-1"}),s.indexesOnlyInDb.length," only in DB"]})]})]})}),(0,t.jsx)(h.Fw,{children:(0,t.jsxs)("div",{className:"ml-7 mt-2 space-y-3 pb-2",children:[s.indexesOnlyInSchema.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-blue-700 dark:text-blue-300 mb-1 flex items-center gap-1",children:[(0,t.jsx)(b.Z,{className:"h-3.5 w-3.5"}),"Defined in schema, missing from database"]}),(0,t.jsxs)(x.iA,{children:[(0,t.jsx)(x.xD,{children:(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.ss,{className:"w-[250px]",children:"Index Name"}),(0,t.jsx)(x.ss,{children:"Fields"}),(0,t.jsx)(x.ss,{className:"w-[100px]",children:"Unique"})]})}),(0,t.jsx)(x.RM,{children:s.indexesOnlyInSchema.map(e=>(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.pj,{className:"font-mono text-sm",children:e.name}),(0,t.jsx)(x.pj,{className:"font-mono text-sm",children:e.fields.join(", ")}),(0,t.jsx)(x.pj,{children:(0,t.jsx)(o.C,{variant:e.unique?"default":"secondary",children:e.unique?"Yes":"No"})})]},e.name))})]})]}),s.indexesOnlyInDb.length>0&&(0,t.jsxs)("div",{children:[(0,t.jsxs)("p",{className:"text-sm font-medium text-orange-700 dark:text-orange-300 mb-1 flex items-center gap-1",children:[(0,t.jsx)(g.Z,{className:"h-3.5 w-3.5"}),"In database, not defined in schema"]}),(0,t.jsxs)(x.iA,{children:[(0,t.jsx)(x.xD,{children:(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.ss,{className:"w-[250px]",children:"Index Name"}),(0,t.jsx)(x.ss,{children:"Columns"}),(0,t.jsx)(x.ss,{className:"w-[100px]",children:"Unique"})]})}),(0,t.jsx)(x.RM,{children:s.indexesOnlyInDb.map(e=>(0,t.jsxs)(x.SC,{children:[(0,t.jsx)(x.pj,{className:"font-mono text-sm",children:e.name}),(0,t.jsx)(x.pj,{className:"font-mono text-sm",children:e.columns}),(0,t.jsx)(x.pj,{children:(0,t.jsx)(o.C,{variant:e.isUnique?"default":"secondary",children:e.isUnique?"Yes":"No"})})]},e.name))})]})]})]})})]})},A=()=>{var e;let s=(0,l.Ji)(),[n,x]=(0,a.useState)("overview"),[h,j]=(0,a.useState)(""),[p,A]=(0,a.useState)({open:!1,title:"",description:"",action:()=>{}}),{data:F,isLoading:M,refetch:z,isRefetching:L}=(0,l.EV)({url:"".concat(s,"/utils/schema-diff"),method:"get"}),{mutate:Y,isLoading:U}=(0,l.uC)(),{mutate:q,isLoading:V}=(0,l.uC)(),E=null==F?void 0:null===(e=F.data)||void 0===e?void 0:e.data,W=e=>{A({open:!0,title:'Remove "'.concat(e,'" from schema?'),description:'This will remove the schema definition for "'.concat(e,'". The database table will NOT be affected. The collection will no longer be managed by baasix.'),action:()=>{Y({url:"".concat(s,"/utils/schema-diff/table/schema/").concat(encodeURIComponent(e)),method:"delete",values:{}},{onSuccess:()=>{i.Am.success('Schema definition "'.concat(e,'" removed')),z()},onError:s=>{i.Am.error((null==s?void 0:s.message)||'Failed to remove schema "'.concat(e,'"'))}})}})},_=e=>{A({open:!0,title:'Drop table "'.concat(e,'" from database?'),description:'This will permanently DROP the table "'.concat(e,'" and all its data from the database. This action cannot be undone.'),action:()=>{Y({url:"".concat(s,"/utils/schema-diff/table/db/").concat(encodeURIComponent(e)),method:"delete",values:{}},{onSuccess:()=>{i.Am.success('Table "'.concat(e,'" dropped from database')),z()},onError:s=>{i.Am.error((null==s?void 0:s.message)||'Failed to drop table "'.concat(e,'"'))}})}})},P=(e,n,t)=>{"schema"===t?A({open:!0,title:'Remove field "'.concat(n,'" from schema?'),description:'This will remove the field "'.concat(n,'" from the schema definition of "').concat(e,'". The database column will NOT be affected.'),action:()=>{Y({url:"".concat(s,"/utils/schema-diff/field/schema/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(n)),method:"delete",values:{}},{onSuccess:()=>{i.Am.success('Field "'.concat(n,'" removed from schema of "').concat(e,'"')),z()},onError:e=>{i.Am.error((null==e?void 0:e.message)||'Failed to remove field "'.concat(n,'"'))}})}}):A({open:!0,title:'Drop column "'.concat(n,'" from database?'),description:'This will permanently DROP the column "'.concat(n,'" from table "').concat(e,'" in the database. All data in this column will be lost. This action cannot be undone.'),action:()=>{Y({url:"".concat(s,"/utils/schema-diff/field/db/").concat(encodeURIComponent(e),"/").concat(encodeURIComponent(n)),method:"delete",values:{}},{onSuccess:()=>{i.Am.success('Column "'.concat(n,'" dropped from table "').concat(e,'"')),z()},onError:e=>{i.Am.error((null==e?void 0:e.message)||'Failed to drop column "'.concat(n,'"'))}})}})},B=(0,a.useMemo)(()=>{if(!(null==E?void 0:E.fieldDiffs))return[];if(!h)return E.fieldDiffs;let e=h.toLowerCase();return E.fieldDiffs.filter(s=>s.collection.toLowerCase().includes(e)||s.fieldsOnlyInSchema.some(s=>s.column.toLowerCase().includes(e))||s.fieldsOnlyInDb.some(s=>s.column.toLowerCase().includes(e)))},[null==E?void 0:E.fieldDiffs,h]),H=(0,a.useMemo)(()=>{if(!(null==E?void 0:E.tablesOnlyInSchema))return[];if(!h)return E.tablesOnlyInSchema;let e=h.toLowerCase();return E.tablesOnlyInSchema.filter(s=>s.toLowerCase().includes(e))},[null==E?void 0:E.tablesOnlyInSchema,h]),$=(0,a.useMemo)(()=>{if(!(null==E?void 0:E.tablesOnlyInDb))return[];if(!h)return E.tablesOnlyInDb;let e=h.toLowerCase();return E.tablesOnlyInDb.filter(s=>s.toLowerCase().includes(e))},[null==E?void 0:E.tablesOnlyInDb,h]),Q=(0,a.useMemo)(()=>{if(!(null==E?void 0:E.indexDiffs))return[];if(!h)return E.indexDiffs;let e=h.toLowerCase();return E.indexDiffs.filter(s=>s.collection.toLowerCase().includes(e)||s.indexesOnlyInSchema.some(s=>s.name.toLowerCase().includes(e)||s.fields.some(s=>s.toLowerCase().includes(e)))||s.indexesOnlyInDb.some(s=>s.name.toLowerCase().includes(e)||s.columns.toLowerCase().includes(e)))},[null==E?void 0:E.indexDiffs,h]),J=E&&(E.summary.tablesOnlyInSchemaCount>0||E.summary.tablesOnlyInDbCount>0||E.summary.collectionsWithFieldDiffs>0||E.summary.collectionsWithIndexDiffs>0);return M?(0,t.jsxs)("div",{className:"p-6 space-y-4",children:[(0,t.jsx)(u.O,{className:"h-8 w-48"}),(0,t.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-3 lg:grid-cols-5 gap-4",children:Array.from({length:5}).map((e,s)=>(0,t.jsx)(u.O,{className:"h-20"},s))}),(0,t.jsx)(u.O,{className:"h-64"})]}):(0,t.jsxs)("div",{className:"p-6 space-y-6 overflow-auto flex-1",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{children:[(0,t.jsx)("h1",{className:"text-2xl font-bold tracking-tight",children:"Schema Audit"}),(0,t.jsx)("p",{className:"text-muted-foreground text-sm mt-1",children:"Audit schema definitions against the database to find missing tables, fields, and indexes."})]}),(0,t.jsxs)(c.z,{variant:"outline",size:"sm",onClick:()=>z(),disabled:L,children:[L?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,t.jsx)(N.Z,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),E&&(0,t.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-5 gap-4",children:[(0,t.jsx)(S,{label:"Schema Collections",value:E.summary.totalSchemaCollections,icon:(0,t.jsx)(b.Z,{className:"h-5 w-5"})}),(0,t.jsx)(S,{label:"Database Tables",value:E.summary.totalDbTables,icon:(0,t.jsx)(g.Z,{className:"h-5 w-5"})}),(0,t.jsx)(S,{label:"Tables Only in Schema",value:E.summary.tablesOnlyInSchemaCount,variant:"warning",icon:(0,t.jsx)(w.Z,{className:"h-5 w-5"})}),(0,t.jsx)(S,{label:"Tables Only in DB",value:E.summary.tablesOnlyInDbCount,variant:"warning",icon:(0,t.jsx)(w.Z,{className:"h-5 w-5"})}),(0,t.jsx)(S,{label:"Field Mismatches",value:E.summary.collectionsWithFieldDiffs,variant:"warning",icon:(0,t.jsx)(C.Z,{className:"h-5 w-5"})}),(0,t.jsx)(S,{label:"Missing Indexes",value:E.summary.totalMissingIndexes,variant:"warning",icon:(0,t.jsx)(D.Z,{className:"h-5 w-5"})})]}),E&&!J&&(0,t.jsx)(r.Zb,{className:"border-green-500/50 bg-green-500/5",children:(0,t.jsxs)(r.aY,{className:"p-4 flex items-center gap-3",children:[(0,t.jsx)(k.Z,{className:"h-5 w-5 text-green-600"}),(0,t.jsx)("p",{className:"text-sm font-medium text-green-700 dark:text-green-300",children:"Schema and database are fully in sync. No differences found."})]})}),E&&J&&(0,t.jsxs)(d.mQ,{value:n,onValueChange:x,children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(d.dr,{children:[(0,t.jsxs)(d.SP,{value:"overview",className:"flex items-center gap-1",children:[(0,t.jsx)(I,{className:"h-3.5 w-3.5"}),"Tables"]}),(0,t.jsxs)(d.SP,{value:"fields",className:"flex items-center gap-1",children:[(0,t.jsx)(C.Z,{className:"h-3.5 w-3.5"}),"Fields",E.summary.collectionsWithFieldDiffs>0&&(0,t.jsx)(o.C,{variant:"secondary",className:"ml-1 h-5 px-1.5",children:E.summary.collectionsWithFieldDiffs})]}),(0,t.jsxs)(d.SP,{value:"indexes",className:"flex items-center gap-1",children:[(0,t.jsx)(D.Z,{className:"h-3.5 w-3.5"}),"Indexes",E.summary.collectionsWithIndexDiffs>0&&(0,t.jsx)(o.C,{variant:"secondary",className:"ml-1 h-5 px-1.5",children:E.summary.collectionsWithIndexDiffs})]})]}),(0,t.jsx)(Z.t,{value:h,onChange:j})]}),(0,t.jsx)(d.nU,{value:"overview",className:"space-y-4 mt-4",children:(0,t.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4",children:[(0,t.jsxs)(r.Zb,{children:[(0,t.jsxs)(r.Ol,{className:"pb-3",children:[(0,t.jsxs)(r.ll,{className:"text-base flex items-center gap-2",children:[(0,t.jsx)(b.Z,{className:"h-4 w-4 text-blue-500"}),"Tables Only in Schema"]}),(0,t.jsx)(r.SZ,{children:"Defined in schema but no corresponding database table exists."})]}),(0,t.jsx)(r.aY,{children:0===H.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:0===E.summary.tablesOnlyInSchemaCount?"No mismatches":"No results match your search"}):(0,t.jsx)(m.x,{className:H.length>10?"h-[300px]":"",children:(0,t.jsx)("div",{className:"space-y-1",children:H.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(I,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-mono text-sm",children:e})]}),(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>W(e),title:"Remove from schema",children:(0,t.jsx)(v.Z,{className:"h-3.5 w-3.5"})})]},e))})})})]}),(0,t.jsxs)(r.Zb,{children:[(0,t.jsxs)(r.Ol,{className:"pb-3",children:[(0,t.jsxs)(r.ll,{className:"text-base flex items-center gap-2",children:[(0,t.jsx)(g.Z,{className:"h-4 w-4 text-orange-500"}),"Tables Only in Database"]}),(0,t.jsx)(r.SZ,{children:"Exist in the database but have no schema definition."})]}),(0,t.jsx)(r.aY,{children:0===$.length?(0,t.jsx)("p",{className:"text-sm text-muted-foreground py-4 text-center",children:0===E.summary.tablesOnlyInDbCount?"No mismatches":"No results match your search"}):(0,t.jsx)(m.x,{className:$.length>10?"h-[300px]":"",children:(0,t.jsx)("div",{className:"space-y-1",children:$.map(e=>(0,t.jsxs)("div",{className:"flex items-center justify-between rounded-md border px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(I,{className:"h-4 w-4 text-muted-foreground"}),(0,t.jsx)("span",{className:"font-mono text-sm",children:e})]}),(0,t.jsx)(c.z,{variant:"ghost",size:"icon",className:"h-7 w-7 text-destructive hover:text-destructive hover:bg-destructive/10",onClick:()=>_(e),title:"Drop from database",children:(0,t.jsx)(v.Z,{className:"h-3.5 w-3.5"})})]},e))})})})]})]})}),(0,t.jsx)(d.nU,{value:"fields",className:"space-y-3 mt-4",children:0===B.length?(0,t.jsx)(r.Zb,{children:(0,t.jsx)(r.aY,{className:"py-8 text-center text-sm text-muted-foreground",children:0===E.summary.collectionsWithFieldDiffs?"All fields are in sync across schema and database.":"No results match your search."})}):(0,t.jsx)("div",{className:"space-y-2",children:B.map(e=>(0,t.jsx)(R,{diff:e,onDeleteField:P},e.collection))})}),(0,t.jsxs)(d.nU,{value:"indexes",className:"space-y-3 mt-4",children:[E.summary.totalMissingIndexes>0&&(0,t.jsx)("div",{className:"flex justify-end",children:(0,t.jsxs)(c.z,{size:"sm",onClick:()=>{A({open:!0,title:"Create all missing indexes?",description:"This will create all missing indexes (both schema-defined and foreign key indexes) across all collections. This is safe and non-destructive.",action:()=>{q({url:"".concat(s,"/schemas/indexes/migrate"),method:"post",values:{}},{onSuccess:e=>{var s;let n=null==e?void 0:null===(s=e.data)||void 0===s?void 0:s.summary;i.Am.success("Index migration complete: ".concat((null==n?void 0:n.created)||0," created, ").concat((null==n?void 0:n.skipped)||0," skipped, ").concat((null==n?void 0:n.errors)||0," errors")),z()},onError:e=>{i.Am.error((null==e?void 0:e.message)||"Failed to migrate indexes")}})}})},disabled:V,children:[V?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):(0,t.jsx)(O.Z,{className:"h-4 w-4 mr-2"}),"Create Missing Indexes"]})}),0===Q.length?(0,t.jsx)(r.Zb,{children:(0,t.jsx)(r.aY,{className:"py-8 text-center text-sm text-muted-foreground",children:0===E.summary.collectionsWithIndexDiffs?"All indexes are in sync across schema and database.":"No results match your search."})}):(0,t.jsx)("div",{className:"space-y-2",children:Q.map(e=>(0,t.jsx)(T,{diff:e},e.collection))})]})]}),(0,t.jsx)(f.aR,{open:p.open,onOpenChange:e=>A(s=>({...s,open:e})),children:(0,t.jsxs)(f._T,{children:[(0,t.jsxs)(f.fY,{children:[(0,t.jsx)(f.f$,{children:p.title}),(0,t.jsx)(f.yT,{children:p.description})]}),(0,t.jsxs)(f.xo,{children:[(0,t.jsx)(f.le,{children:"Cancel"}),(0,t.jsxs)(f.OL,{className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",onClick:()=>{p.action(),A(e=>({...e,open:!1}))},disabled:U,children:[U?(0,t.jsx)(y.Z,{className:"h-4 w-4 mr-2 animate-spin"}):null,"Confirm"]})]})]})})]})};var F=()=>(0,t.jsx)(A,{})},30767:function(e,s,n){"use strict";n.d(s,{OL:function(){return p},_T:function(){return u},aR:function(){return c},f$:function(){return f},fY:function(){return x},le:function(){return b},vW:function(){return o},xo:function(){return h},yT:function(){return j}});var t=n(57437),a=n(2265),l=n(16720),i=n(93448),r=n(12381);let c=l.fC,o=l.xz,d=l.h_,m=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.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",n),...a,ref:s})});m.displayName="AlertDialogOverlay";let u=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsxs)(d,{children:[(0,t.jsx)(m,{}),(0,t.jsx)(l.VY,{ref:s,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",n),...a})]})});u.displayName="AlertDialogContent";let x=e=>{let{className:s,...n}=e;return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col space-y-2 text-center sm:text-left",s),...n})};x.displayName="AlertDialogHeader";let h=e=>{let{className:s,...n}=e;return(0,t.jsx)("div",{className:(0,i.cn)("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",s),...n})};h.displayName="AlertDialogFooter";let f=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.Dx,{ref:s,className:(0,i.cn)("text-lg font-semibold",n),...a})});f.displayName="AlertDialogTitle";let j=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.dk,{ref:s,className:(0,i.cn)("text-sm text-muted-foreground",n),...a})});j.displayName="AlertDialogDescription";let p=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.aU,{ref:s,className:(0,i.cn)((0,r.d)(),n),...a})});p.displayName="AlertDialogAction";let b=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.$j,{ref:s,className:(0,i.cn)((0,r.d)({variant:"outline"}),"mt-2 sm:mt-0",n),...a})});b.displayName="AlertDialogCancel"},8227:function(e,s,n){"use strict";n.d(s,{Fw:function(){return i},wy:function(){return l},zF:function(){return a}}),n(2265);var t=n(962);let a=t.fC,l=t.wy,i=t.Fw},69140:function(e,s,n){"use strict";n.d(s,{O:function(){return l}});var t=n(57437),a=n(93448);function l(e){let{className:s,...n}=e;return(0,t.jsx)("div",{className:(0,a.cn)("animate-pulse rounded-md bg-muted",s),...n})}},17168:function(e,s,n){"use strict";n.d(s,{SP:function(){return o},dr:function(){return c},mQ:function(){return r},nU:function(){return d}});var t=n(57437),a=n(2265),l=n(20271),i=n(93448);let r=l.fC,c=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.aV,{ref:s,className:(0,i.cn)("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...a})});c.displayName=l.aV.displayName;let o=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.xz,{ref:s,className:(0,i.cn)("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm",n),...a})});o.displayName=l.xz.displayName;let d=a.forwardRef((e,s)=>{let{className:n,...a}=e;return(0,t.jsx)(l.VY,{ref:s,className:(0,i.cn)("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a})});d.displayName=l.VY.displayName},62484:function(e,s,n){"use strict";function t(e,[s,n]){return Math.min(n,Math.max(s,e))}n.d(s,{u:function(){return t}})},962:function(e,s,n){"use strict";n.d(s,{Fw:function(){return N},VY:function(){return I},fC:function(){return D},p_:function(){return f},wy:function(){return v},xz:function(){return k}});var t=n(2265),a=n(6741),l=n(73966),i=n(80886),r=n(61188),c=n(98575),o=n(82912),d=n(71599),m=n(99255),u=n(57437),x="Collapsible",[h,f]=(0,l.b)(x),[j,p]=h(x),b=t.forwardRef((e,s)=>{let{__scopeCollapsible:n,open:a,defaultOpen:l,disabled:r,onOpenChange:c,...d}=e,[h,f]=(0,i.T)({prop:a,defaultProp:null!=l&&l,onChange:c,caller:x});return(0,u.jsx)(j,{scope:n,disabled:r,contentId:(0,m.M)(),open:h,onOpenToggle:t.useCallback(()=>f(e=>!e),[f]),children:(0,u.jsx)(o.WV.div,{"data-state":C(h),"data-disabled":r?"":void 0,...d,ref:s})})});b.displayName=x;var g="CollapsibleTrigger",v=t.forwardRef((e,s)=>{let{__scopeCollapsible:n,...t}=e,l=p(g,n);return(0,u.jsx)(o.WV.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":C(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...t,ref:s,onClick:(0,a.Mj)(e.onClick,l.onOpenToggle)})});v.displayName=g;var y="CollapsibleContent",N=t.forwardRef((e,s)=>{let{forceMount:n,...t}=e,a=p(y,e.__scopeCollapsible);return(0,u.jsx)(d.z,{present:n||a.open,children:e=>{let{present:n}=e;return(0,u.jsx)(w,{...t,ref:s,present:n})}})});N.displayName=y;var w=t.forwardRef((e,s)=>{let{__scopeCollapsible:n,present:a,children:l,...i}=e,d=p(y,n),[m,x]=t.useState(a),h=t.useRef(null),f=(0,c.e)(s,h),j=t.useRef(0),b=j.current,g=t.useRef(0),v=g.current,N=d.open||m,w=t.useRef(N),D=t.useRef(void 0);return t.useEffect(()=>{let e=requestAnimationFrame(()=>w.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,r.b)(()=>{let e=h.current;if(e){D.current=D.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration="0s",e.style.animationName="none";let s=e.getBoundingClientRect();j.current=s.height,g.current=s.width,w.current||(e.style.transitionDuration=D.current.transitionDuration,e.style.animationName=D.current.animationName),x(a)}},[d.open,a]),(0,u.jsx)(o.WV.div,{"data-state":C(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!N,...i,ref:f,style:{"--radix-collapsible-content-height":b?"".concat(b,"px"):void 0,"--radix-collapsible-content-width":v?"".concat(v,"px"):void 0,...e.style},children:N&&l})});function C(e){return e?"open":"closed"}var D=b,k=v,I=N}},function(e){e.O(0,[7999,5094,4438,6530,4475,926,600,3563,4766,2667,2971,2117,1744],function(){return e(e.s=87949)}),_N_E=e.O()}]);