@sonicjs-cms/core 3.0.0-beta.21 → 3.0.0-beta.22

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 (51) hide show
  1. package/dist/{chunk-5U75XP74.js → chunk-2FCKKOA5.js} +2 -2
  2. package/dist/{chunk-5U75XP74.js.map → chunk-2FCKKOA5.js.map} +1 -1
  3. package/dist/{chunk-OJC4G5JE.cjs → chunk-3CT3SUR4.cjs} +2 -2
  4. package/dist/{chunk-OJC4G5JE.cjs.map → chunk-3CT3SUR4.cjs.map} +1 -1
  5. package/dist/{chunk-ZP77LTN4.js → chunk-6KNTZ67K.js} +106 -11
  6. package/dist/chunk-6KNTZ67K.js.map +1 -0
  7. package/dist/{chunk-JEX3UPZL.js → chunk-73O4GPJ6.js} +3 -3
  8. package/dist/{chunk-JEX3UPZL.js.map → chunk-73O4GPJ6.js.map} +1 -1
  9. package/dist/{chunk-4UYJPHSV.js → chunk-CHWT5KBK.js} +5 -5
  10. package/dist/{chunk-4UYJPHSV.js.map → chunk-CHWT5KBK.js.map} +1 -1
  11. package/dist/{chunk-4LVVMVQI.js → chunk-DOMXI5PM.js} +2 -2
  12. package/dist/{chunk-4LVVMVQI.js.map → chunk-DOMXI5PM.js.map} +1 -1
  13. package/dist/{chunk-A4KUJ3LD.cjs → chunk-EUJAEB6W.cjs} +4 -4
  14. package/dist/{chunk-A4KUJ3LD.cjs.map → chunk-EUJAEB6W.cjs.map} +1 -1
  15. package/dist/{chunk-FCLKX2OS.cjs → chunk-FTXGZ3BF.cjs} +15 -15
  16. package/dist/{chunk-FCLKX2OS.cjs.map → chunk-FTXGZ3BF.cjs.map} +1 -1
  17. package/dist/{chunk-GICS5AIO.js → chunk-GB2Q2DNK.js} +4 -4
  18. package/dist/{chunk-GICS5AIO.js.map → chunk-GB2Q2DNK.js.map} +1 -1
  19. package/dist/{chunk-7OTOXWEB.js → chunk-I2DM27HP.js} +3 -3
  20. package/dist/{chunk-7OTOXWEB.js.map → chunk-I2DM27HP.js.map} +1 -1
  21. package/dist/{chunk-7RUW244J.cjs → chunk-JFLZHOQP.cjs} +299 -204
  22. package/dist/chunk-JFLZHOQP.cjs.map +1 -0
  23. package/dist/{chunk-5UXU3LP4.cjs → chunk-MGHHPNJN.cjs} +10 -10
  24. package/dist/{chunk-5UXU3LP4.cjs.map → chunk-MGHHPNJN.cjs.map} +1 -1
  25. package/dist/{chunk-KVBHB7QP.cjs → chunk-PYZYU7EK.cjs} +2 -2
  26. package/dist/{chunk-KVBHB7QP.cjs.map → chunk-PYZYU7EK.cjs.map} +1 -1
  27. package/dist/{chunk-AOUVUF32.cjs → chunk-QWSR4THH.cjs} +3 -3
  28. package/dist/{chunk-AOUVUF32.cjs.map → chunk-QWSR4THH.cjs.map} +1 -1
  29. package/dist/index.cjs +308 -265
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +62 -19
  32. package/dist/index.js.map +1 -1
  33. package/dist/middleware.cjs +33 -33
  34. package/dist/middleware.js +4 -4
  35. package/dist/migrations-HLK2QF4T.js +4 -0
  36. package/dist/{migrations-HMX5SPN2.js.map → migrations-HLK2QF4T.js.map} +1 -1
  37. package/dist/migrations-UIMA6ZL6.cjs +13 -0
  38. package/dist/{migrations-V73ARYV5.cjs.map → migrations-UIMA6ZL6.cjs.map} +1 -1
  39. package/dist/plugins.cjs +40 -40
  40. package/dist/plugins.js +3 -3
  41. package/dist/routes.cjs +26 -26
  42. package/dist/routes.js +6 -6
  43. package/dist/services.cjs +18 -18
  44. package/dist/services.js +2 -2
  45. package/dist/utils.cjs +3 -3
  46. package/dist/utils.js +1 -1
  47. package/package.json +1 -1
  48. package/dist/chunk-7RUW244J.cjs.map +0 -1
  49. package/dist/chunk-ZP77LTN4.js.map +0 -1
  50. package/dist/migrations-HMX5SPN2.js +0 -4
  51. package/dist/migrations-V73ARYV5.cjs +0 -13
package/dist/index.cjs CHANGED
@@ -1,27 +1,27 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkGMMCCIQO_cjs = require('./chunk-GMMCCIQO.cjs');
4
- var chunk7RUW244J_cjs = require('./chunk-7RUW244J.cjs');
4
+ var chunkJFLZHOQP_cjs = require('./chunk-JFLZHOQP.cjs');
5
5
  require('./chunk-XWVDSM2L.cjs');
6
6
  require('./chunk-N32OWET6.cjs');
7
7
  var chunk36Z3AKX3_cjs = require('./chunk-36Z3AKX3.cjs');
8
8
  var chunkYA3TJ65D_cjs = require('./chunk-YA3TJ65D.cjs');
9
9
  var chunkYP7GW2G5_cjs = require('./chunk-YP7GW2G5.cjs');
10
- var chunkFCLKX2OS_cjs = require('./chunk-FCLKX2OS.cjs');
10
+ var chunkFTXGZ3BF_cjs = require('./chunk-FTXGZ3BF.cjs');
11
11
  var chunkLTZ5WYOK_cjs = require('./chunk-LTZ5WYOK.cjs');
12
12
  var chunkKIGVVO6N_cjs = require('./chunk-KIGVVO6N.cjs');
13
- var chunkKVBHB7QP_cjs = require('./chunk-KVBHB7QP.cjs');
14
- var chunkOJC4G5JE_cjs = require('./chunk-OJC4G5JE.cjs');
13
+ var chunkPYZYU7EK_cjs = require('./chunk-PYZYU7EK.cjs');
14
+ var chunk3CT3SUR4_cjs = require('./chunk-3CT3SUR4.cjs');
15
15
  var chunkCRGUD4KC_cjs = require('./chunk-CRGUD4KC.cjs');
16
16
  var chunkPXNTCCPE_cjs = require('./chunk-PXNTCCPE.cjs');
17
17
  var chunkK623Q6WD_cjs = require('./chunk-K623Q6WD.cjs');
18
- var chunk5UXU3LP4_cjs = require('./chunk-5UXU3LP4.cjs');
19
- var chunkA4KUJ3LD_cjs = require('./chunk-A4KUJ3LD.cjs');
18
+ var chunkMGHHPNJN_cjs = require('./chunk-MGHHPNJN.cjs');
19
+ var chunkEUJAEB6W_cjs = require('./chunk-EUJAEB6W.cjs');
20
20
  var chunkJ6JTWD2A_cjs = require('./chunk-J6JTWD2A.cjs');
21
21
  var chunkIXUHXTHW_cjs = require('./chunk-IXUHXTHW.cjs');
22
22
  var chunkRCQ2HIQD_cjs = require('./chunk-RCQ2HIQD.cjs');
23
23
  require('./chunk-P3XDZL6Q.cjs');
24
- var chunkAOUVUF32_cjs = require('./chunk-AOUVUF32.cjs');
24
+ var chunkQWSR4THH_cjs = require('./chunk-QWSR4THH.cjs');
25
25
  var chunkMNWKYY5E_cjs = require('./chunk-MNWKYY5E.cjs');
26
26
  var chunkQTFKZBLC_cjs = require('./chunk-QTFKZBLC.cjs');
27
27
  require('./chunk-IGJUBJBW.cjs');
@@ -701,7 +701,7 @@ function formatCellValue(value, colName) {
701
701
  // src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
702
702
  function createDatabaseToolsAdminRoutes() {
703
703
  const router3 = new hono.Hono();
704
- router3.use("*", chunkFCLKX2OS_cjs.requireAuth());
704
+ router3.use("*", chunkFTXGZ3BF_cjs.requireAuth());
705
705
  router3.get("/api/stats", async (c) => {
706
706
  try {
707
707
  const user = c.get("user");
@@ -1110,7 +1110,7 @@ var SiteConfigService = class {
1110
1110
 
1111
1111
  // src/plugins/core-plugins/email-plugin/routes/admin.ts
1112
1112
  var adminRoutes = new hono.Hono();
1113
- adminRoutes.use("*", chunkFCLKX2OS_cjs.requireAuth());
1113
+ adminRoutes.use("*", chunkFTXGZ3BF_cjs.requireAuth());
1114
1114
  adminRoutes.post("/settings", async (c) => {
1115
1115
  if (c.get("user")?.role !== "admin") {
1116
1116
  return c.json({ error: "admin role required" }, 403);
@@ -1148,7 +1148,7 @@ adminRoutes.post("/test", async (c) => {
1148
1148
  const { subject, html: html4, text } = renderTestEmail({ siteName });
1149
1149
  try {
1150
1150
  const settingsLoaded = await settings.load();
1151
- const result = await chunk7RUW244J_cjs.getEmailService().send({
1151
+ const result = await chunkJFLZHOQP_cjs.getEmailService().send({
1152
1152
  to,
1153
1153
  subject,
1154
1154
  html: html4,
@@ -1230,7 +1230,7 @@ function makeOnRegistrationCompleted(env) {
1230
1230
  siteName,
1231
1231
  loginUrl: siteConfig.buildLoginUrl(siteUrl)
1232
1232
  });
1233
- const result = await chunk7RUW244J_cjs.getEmailService().send({
1233
+ const result = await chunkJFLZHOQP_cjs.getEmailService().send({
1234
1234
  to: user.email,
1235
1235
  subject,
1236
1236
  html: html4,
@@ -1304,7 +1304,7 @@ function makeOnPasswordResetRequested(env) {
1304
1304
  expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
1305
1305
  siteName
1306
1306
  });
1307
- const result = await chunk7RUW244J_cjs.getEmailService().send({
1307
+ const result = await chunkJFLZHOQP_cjs.getEmailService().send({
1308
1308
  to: user.email,
1309
1309
  subject,
1310
1310
  html: html4,
@@ -1372,7 +1372,7 @@ function makeOnPasswordResetCompleted(env) {
1372
1372
  supportEmail,
1373
1373
  when: Date.now()
1374
1374
  });
1375
- const result = await chunk7RUW244J_cjs.getEmailService().send({
1375
+ const result = await chunkJFLZHOQP_cjs.getEmailService().send({
1376
1376
  to: user.email,
1377
1377
  subject,
1378
1378
  html: html4,
@@ -2113,7 +2113,7 @@ var CloudflareEmailProvider = class {
2113
2113
  }
2114
2114
  }
2115
2115
  };
2116
- var emailPluginV3 = chunkA4KUJ3LD_cjs.definePlugin({
2116
+ var emailPluginV3 = chunkEUJAEB6W_cjs.definePlugin({
2117
2117
  id: "email",
2118
2118
  version: "1.0.0",
2119
2119
  name: "Email",
@@ -2127,7 +2127,7 @@ var emailPluginV3 = chunkA4KUJ3LD_cjs.definePlugin({
2127
2127
  const db = env.DB;
2128
2128
  if (db) {
2129
2129
  try {
2130
- const typeRegistry = new chunkFCLKX2OS_cjs.DocumentTypeRegistry(db);
2130
+ const typeRegistry = new chunkFTXGZ3BF_cjs.DocumentTypeRegistry(db);
2131
2131
  await typeRegistry.register({
2132
2132
  id: "email_log",
2133
2133
  name: "email_log",
@@ -2142,7 +2142,7 @@ var emailPluginV3 = chunkA4KUJ3LD_cjs.definePlugin({
2142
2142
  } catch {
2143
2143
  }
2144
2144
  }
2145
- if (!chunk7RUW244J_cjs.hasEmailService()) {
2145
+ if (!chunkJFLZHOQP_cjs.hasEmailService()) {
2146
2146
  const settings = db ? await new EmailSettingsService(db).load() : {};
2147
2147
  const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
2148
2148
  const cfEmailBinding = env.EMAIL;
@@ -2160,7 +2160,7 @@ var emailPluginV3 = chunkA4KUJ3LD_cjs.definePlugin({
2160
2160
  } else {
2161
2161
  provider = resolveEmailProvider({ env });
2162
2162
  }
2163
- chunk7RUW244J_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2163
+ chunkJFLZHOQP_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2164
2164
  }
2165
2165
  ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
2166
2166
  ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
@@ -2171,7 +2171,7 @@ var emailPluginV3 = chunkA4KUJ3LD_cjs.definePlugin({
2171
2171
  var BATCH_SIZE = 100;
2172
2172
  ({
2173
2173
  schema: zod.z.record(zod.z.string(), zod.z.unknown())});
2174
- var emailReconciliationPlugin = chunkA4KUJ3LD_cjs.definePlugin({
2174
+ var emailReconciliationPlugin = chunkEUJAEB6W_cjs.definePlugin({
2175
2175
  id: "email-reconciliation",
2176
2176
  version: "1.0.0",
2177
2177
  description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
@@ -2192,11 +2192,11 @@ var emailReconciliationPlugin = chunkA4KUJ3LD_cjs.definePlugin({
2192
2192
  console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
2193
2193
  return;
2194
2194
  }
2195
- if (!chunk7RUW244J_cjs.hasEmailService()) {
2195
+ if (!chunkJFLZHOQP_cjs.hasEmailService()) {
2196
2196
  console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
2197
2197
  return;
2198
2198
  }
2199
- const emailService = chunk7RUW244J_cjs.getEmailService();
2199
+ const emailService = chunkJFLZHOQP_cjs.getEmailService();
2200
2200
  let rows = [];
2201
2201
  try {
2202
2202
  const result = await db.prepare(
@@ -2683,8 +2683,8 @@ function buildOtpApi() {
2683
2683
  loginUrl: settings.loginUrl || "",
2684
2684
  loginButtonText: settings.loginButtonText || ""
2685
2685
  });
2686
- if (chunk7RUW244J_cjs.hasEmailService()) {
2687
- const sent = await chunk7RUW244J_cjs.getEmailService().send({
2686
+ if (chunkJFLZHOQP_cjs.hasEmailService()) {
2687
+ const sent = await chunkJFLZHOQP_cjs.getEmailService().send({
2688
2688
  to: normalizedEmail,
2689
2689
  subject: `Your login code for ${siteName}`,
2690
2690
  flow: "otp",
@@ -2786,21 +2786,21 @@ function buildOtpApi() {
2786
2786
  error: "Account is deactivated"
2787
2787
  }, 403);
2788
2788
  }
2789
- const tokenTtl = await chunkFCLKX2OS_cjs.getJwtExpirySecondsFromDb(db, c.env);
2790
- const token = await chunkFCLKX2OS_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2789
+ const tokenTtl = await chunkFTXGZ3BF_cjs.getJwtExpirySecondsFromDb(db, c.env);
2790
+ const token = await chunkFTXGZ3BF_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2791
2791
  cookie.setCookie(c, "auth_token", token, {
2792
2792
  httpOnly: true,
2793
2793
  secure: true,
2794
2794
  sameSite: "Strict",
2795
2795
  maxAge: tokenTtl
2796
2796
  });
2797
- chunk7RUW244J_cjs.dispatchHookEvent(
2797
+ chunkJFLZHOQP_cjs.dispatchHookEvent(
2798
2798
  c,
2799
2799
  "auth:otp:verified",
2800
2800
  { user: { id: user.id, email: user.email, role: user.role } },
2801
2801
  "fire-and-forget"
2802
2802
  );
2803
- const customData = await chunk7RUW244J_cjs.getCustomData(db, user.id);
2803
+ const customData = await chunkJFLZHOQP_cjs.getCustomData(db, user.id);
2804
2804
  const { is_active: _isActive, ...publicUser } = user;
2805
2805
  return c.json({
2806
2806
  success: true,
@@ -2845,7 +2845,7 @@ function buildOtpApi() {
2845
2845
  });
2846
2846
  return otpAPI;
2847
2847
  }
2848
- var otpLoginPlugin = chunkA4KUJ3LD_cjs.definePlugin({
2848
+ var otpLoginPlugin = chunkEUJAEB6W_cjs.definePlugin({
2849
2849
  id: "otp-login",
2850
2850
  version: "1.0.0",
2851
2851
  name: "OTP Login",
@@ -3243,15 +3243,15 @@ function buildOauthApi() {
3243
3243
  if (!user || !user.is_active) {
3244
3244
  return c.redirect("/auth/login?error=Account is deactivated");
3245
3245
  }
3246
- const tokenTtl2 = await chunkFCLKX2OS_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3247
- const jwt2 = await chunkFCLKX2OS_cjs.AuthManager.generateToken(
3246
+ const tokenTtl2 = await chunkFTXGZ3BF_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3247
+ const jwt2 = await chunkFTXGZ3BF_cjs.AuthManager.generateToken(
3248
3248
  user.id,
3249
3249
  user.email,
3250
3250
  user.role,
3251
3251
  c.env.JWT_SECRET,
3252
3252
  tokenTtl2
3253
3253
  );
3254
- chunkFCLKX2OS_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3254
+ chunkFTXGZ3BF_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3255
3255
  return c.redirect("/admin");
3256
3256
  }
3257
3257
  const existingUser = await oauthService.findUserByEmail(profile.email);
@@ -3268,15 +3268,15 @@ function buildOauthApi() {
3268
3268
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3269
3269
  profileData: JSON.stringify(profile)
3270
3270
  });
3271
- const tokenTtl2 = await chunkFCLKX2OS_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3272
- const jwt2 = await chunkFCLKX2OS_cjs.AuthManager.generateToken(
3271
+ const tokenTtl2 = await chunkFTXGZ3BF_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3272
+ const jwt2 = await chunkFTXGZ3BF_cjs.AuthManager.generateToken(
3273
3273
  existingUser.id,
3274
3274
  existingUser.email,
3275
3275
  existingUser.role,
3276
3276
  c.env.JWT_SECRET,
3277
3277
  tokenTtl2
3278
3278
  );
3279
- chunkFCLKX2OS_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3279
+ chunkFTXGZ3BF_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3280
3280
  return c.redirect("/admin");
3281
3281
  }
3282
3282
  const newUserId = await oauthService.createUserFromOAuth(profile);
@@ -3289,15 +3289,15 @@ function buildOauthApi() {
3289
3289
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3290
3290
  profileData: JSON.stringify(profile)
3291
3291
  });
3292
- const tokenTtl = await chunkFCLKX2OS_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3293
- const jwt = await chunkFCLKX2OS_cjs.AuthManager.generateToken(
3292
+ const tokenTtl = await chunkFTXGZ3BF_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3293
+ const jwt = await chunkFTXGZ3BF_cjs.AuthManager.generateToken(
3294
3294
  newUserId,
3295
3295
  profile.email.toLowerCase(),
3296
3296
  "viewer",
3297
3297
  c.env.JWT_SECRET,
3298
3298
  tokenTtl
3299
3299
  );
3300
- chunkFCLKX2OS_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3300
+ chunkFTXGZ3BF_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3301
3301
  return c.redirect("/admin");
3302
3302
  } catch (error) {
3303
3303
  console.error("OAuth callback error:", error);
@@ -3392,7 +3392,7 @@ function buildOauthApi() {
3392
3392
  });
3393
3393
  return oauthAPI;
3394
3394
  }
3395
- var oauthProvidersPlugin = chunkA4KUJ3LD_cjs.definePlugin({
3395
+ var oauthProvidersPlugin = chunkEUJAEB6W_cjs.definePlugin({
3396
3396
  id: "oauth-providers",
3397
3397
  version: "1.0.0",
3398
3398
  name: "OAuth Providers",
@@ -3976,7 +3976,7 @@ var AISearchService = class {
3976
3976
  */
3977
3977
  async detectNewCollections() {
3978
3978
  try {
3979
- const allCollections = chunkKVBHB7QP_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3979
+ const allCollections = chunkPYZYU7EK_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3980
3980
  id: r.id,
3981
3981
  name: r.name,
3982
3982
  display_name: r.displayName,
@@ -4028,7 +4028,7 @@ var AISearchService = class {
4028
4028
  */
4029
4029
  async getAllCollections() {
4030
4030
  try {
4031
- const allCollections = chunkKVBHB7QP_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
4031
+ const allCollections = chunkPYZYU7EK_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
4032
4032
  id: r.id,
4033
4033
  name: r.name,
4034
4034
  display_name: r.displayName,
@@ -4367,7 +4367,7 @@ var IndexManager = class {
4367
4367
  */
4368
4368
  async indexCollection(collectionId) {
4369
4369
  try {
4370
- const registry = chunkKVBHB7QP_cjs.getCollectionRegistry();
4370
+ const registry = chunkPYZYU7EK_cjs.getCollectionRegistry();
4371
4371
  const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
4372
4372
  if (!record) {
4373
4373
  throw new Error(`Collection ${collectionId} not found`);
@@ -4994,7 +4994,7 @@ function renderSettingsPage(data) {
4994
4994
 
4995
4995
  // src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
4996
4996
  var adminRoutes2 = new hono.Hono();
4997
- adminRoutes2.use("*", chunkFCLKX2OS_cjs.requireAuth());
4997
+ adminRoutes2.use("*", chunkFTXGZ3BF_cjs.requireAuth());
4998
4998
  adminRoutes2.get("/", async (c) => {
4999
4999
  try {
5000
5000
  const user = c.get("user");
@@ -5235,7 +5235,7 @@ var manifest_default = {
5235
5235
  author: "SonicJS"};
5236
5236
 
5237
5237
  // src/plugins/core-plugins/ai-search-plugin/index.ts
5238
- var aiSearchPlugin = chunkA4KUJ3LD_cjs.definePlugin({
5238
+ var aiSearchPlugin = chunkEUJAEB6W_cjs.definePlugin({
5239
5239
  id: manifest_default.id,
5240
5240
  version: manifest_default.version,
5241
5241
  name: manifest_default.name,
@@ -6108,7 +6108,7 @@ function renderSecuritySettingsPage(data) {
6108
6108
 
6109
6109
  // src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
6110
6110
  var adminRoutes3 = new hono.Hono();
6111
- adminRoutes3.use("*", chunkFCLKX2OS_cjs.requireAuth());
6111
+ adminRoutes3.use("*", chunkFTXGZ3BF_cjs.requireAuth());
6112
6112
  adminRoutes3.use("*", async (c, next) => {
6113
6113
  const user = c.get("user");
6114
6114
  if (user?.role !== "admin") {
@@ -6118,7 +6118,7 @@ adminRoutes3.use("*", async (c, next) => {
6118
6118
  });
6119
6119
  async function getSettings(db) {
6120
6120
  try {
6121
- const pluginService = new chunkKVBHB7QP_cjs.PluginService(db);
6121
+ const pluginService = new chunkPYZYU7EK_cjs.PluginService(db);
6122
6122
  const plugin2 = await pluginService.getPlugin("security-audit");
6123
6123
  if (plugin2?.settings) {
6124
6124
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6223,7 +6223,7 @@ adminRoutes3.post("/settings", async (c) => {
6223
6223
  autoPurge: body["retention.autoPurge"] === "true"
6224
6224
  }
6225
6225
  };
6226
- const pluginService = new chunkKVBHB7QP_cjs.PluginService(db);
6226
+ const pluginService = new chunkPYZYU7EK_cjs.PluginService(db);
6227
6227
  await pluginService.updatePluginSettings("security-audit", settings);
6228
6228
  if (c.req.header("HX-Request")) {
6229
6229
  return c.json({ success: true });
@@ -6385,7 +6385,7 @@ var BruteForceDetector = class {
6385
6385
 
6386
6386
  // src/plugins/core-plugins/security-audit-plugin/routes/api.ts
6387
6387
  var apiRoutes2 = new hono.Hono();
6388
- apiRoutes2.use("*", chunkFCLKX2OS_cjs.requireAuth());
6388
+ apiRoutes2.use("*", chunkFTXGZ3BF_cjs.requireAuth());
6389
6389
  apiRoutes2.use("*", async (c, next) => {
6390
6390
  const user = c.get("user");
6391
6391
  if (user?.role !== "admin") {
@@ -6395,7 +6395,7 @@ apiRoutes2.use("*", async (c, next) => {
6395
6395
  });
6396
6396
  async function getSettings2(db) {
6397
6397
  try {
6398
- const pluginService = new chunkKVBHB7QP_cjs.PluginService(db);
6398
+ const pluginService = new chunkPYZYU7EK_cjs.PluginService(db);
6399
6399
  const plugin2 = await pluginService.getPlugin("security-audit");
6400
6400
  if (plugin2?.settings) {
6401
6401
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6543,7 +6543,7 @@ function generateFingerprint(ip, userAgent) {
6543
6543
  }
6544
6544
  async function getPluginSettings(db) {
6545
6545
  try {
6546
- const pluginService = new chunkKVBHB7QP_cjs.PluginService(db);
6546
+ const pluginService = new chunkPYZYU7EK_cjs.PluginService(db);
6547
6547
  const plugin2 = await pluginService.getPlugin("security-audit");
6548
6548
  if (plugin2?.settings) {
6549
6549
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6774,7 +6774,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
6774
6774
 
6775
6775
  // src/plugins/core-plugins/security-audit-plugin/index.ts
6776
6776
  var SECURITY_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12l2 2 4-4m5.618-4.016A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016z"/></svg>`;
6777
- var securityAuditPlugin = chunkA4KUJ3LD_cjs.definePlugin({
6777
+ var securityAuditPlugin = chunkEUJAEB6W_cjs.definePlugin({
6778
6778
  id: "security-audit",
6779
6779
  version: "1.0.0",
6780
6780
  name: "Security Audit",
@@ -6850,7 +6850,7 @@ var ApiKeyService = class {
6850
6850
  const prefix = secret.slice(0, DISPLAY_PREFIX_LEN);
6851
6851
  const expiresAt = input.expiresAt ?? null;
6852
6852
  const doc = await this.docService().create(
6853
- chunk7RUW244J_cjs.createDocumentSchema.parse({
6853
+ chunkJFLZHOQP_cjs.createDocumentSchema.parse({
6854
6854
  typeId: "api_key",
6855
6855
  tenantId: this.tenantId,
6856
6856
  title: name,
@@ -6995,14 +6995,18 @@ function renderApiKeysPage(data) {
6995
6995
 
6996
6996
  <!-- Newly-created secret banner (populated by JS, shown once) -->
6997
6997
  <div id="new-key-banner" class="hidden mb-6 rounded-xl bg-emerald-50 dark:bg-emerald-900/20 p-4 ring-1 ring-emerald-200 dark:ring-emerald-800">
6998
- <p class="text-sm font-medium text-emerald-800 dark:text-emerald-300 mb-2">
6999
- Copy your new key now \u2014 it will not be shown again.
7000
- </p>
6998
+ <div class="flex items-start justify-between mb-2">
6999
+ <p class="text-sm font-medium text-emerald-800 dark:text-emerald-300">
7000
+ Copy your new key now \u2014 it will not be shown again.
7001
+ </p>
7002
+ <button type="button" onclick="document.getElementById('new-key-banner').classList.add('hidden')"
7003
+ class="ml-4 text-emerald-600 dark:text-emerald-400 hover:text-emerald-800 dark:hover:text-emerald-200 text-lg leading-none">&times;</button>
7004
+ </div>
7001
7005
  <div class="flex items-center gap-2">
7002
7006
  <code id="new-key-value" class="flex-1 rounded-lg bg-white dark:bg-zinc-900 px-3 py-2 text-sm font-mono text-zinc-950 dark:text-white ring-1 ring-zinc-950/10 dark:ring-white/10 break-all"></code>
7003
7007
  <button type="button" onclick="copyNewKey()"
7004
7008
  class="rounded-lg bg-emerald-600 px-3 py-2 text-sm font-semibold text-white hover:bg-emerald-500 transition-colors">
7005
- Copy
7009
+ Copy &amp; dismiss
7006
7010
  </button>
7007
7011
  </div>
7008
7012
  </div>
@@ -7074,11 +7078,50 @@ function renderApiKeysPage(data) {
7074
7078
  document.getElementById('create-key-modal').classList.add('hidden')
7075
7079
  document.getElementById('new-key-value').textContent = apiKey.key
7076
7080
  document.getElementById('new-key-banner').classList.remove('hidden')
7077
- setTimeout(() => location.reload(), 1500)
7081
+ // Add new key row to table immediately so user can see it without reloading
7082
+ const tbody = document.getElementById('keys-tbody')
7083
+ const emptyRow = tbody.querySelector('td[colspan]')
7084
+ if (emptyRow) emptyRow.closest('tr').remove()
7085
+ const tr = document.createElement('tr')
7086
+ tr.className = 'border-t border-zinc-950/5 dark:border-white/10'
7087
+ tr.setAttribute('data-key-id', apiKey.id)
7088
+ const prefix = apiKey.prefix
7089
+ const today = new Date().toISOString().slice(0, 10)
7090
+ const expires = apiKey.expiresAt ? new Date(apiKey.expiresAt).toISOString().slice(0, 10) : 'Never'
7091
+ // Build row using DOM methods to avoid nested template-literal escaping issues
7092
+ const nameTd = document.createElement('td')
7093
+ nameTd.className = 'py-3 pr-4 text-sm font-medium text-zinc-950 dark:text-white'
7094
+ nameTd.textContent = apiKey.name
7095
+ const prefixTd = document.createElement('td')
7096
+ prefixTd.className = 'py-3 pr-4 text-sm font-mono text-zinc-500 dark:text-zinc-400'
7097
+ prefixTd.textContent = prefix + '\u2026'
7098
+ const createdTd = document.createElement('td')
7099
+ createdTd.className = 'py-3 pr-4 text-sm text-zinc-500 dark:text-zinc-400'
7100
+ createdTd.textContent = today
7101
+ const lastUsedTd = document.createElement('td')
7102
+ lastUsedTd.className = 'py-3 pr-4 text-sm text-zinc-500 dark:text-zinc-400'
7103
+ lastUsedTd.textContent = 'Never'
7104
+ const expiresTd = document.createElement('td')
7105
+ expiresTd.className = 'py-3 pr-4 text-sm text-zinc-500 dark:text-zinc-400'
7106
+ expiresTd.textContent = expires
7107
+ const actionsTd = document.createElement('td')
7108
+ actionsTd.className = 'py-3 text-right'
7109
+ const revokeBtn = document.createElement('button')
7110
+ revokeBtn.type = 'button'
7111
+ revokeBtn.className = 'rounded-lg bg-red-50 dark:bg-red-900/20 px-3 py-1.5 text-sm font-medium text-red-700 dark:text-red-400 hover:bg-red-100 dark:hover:bg-red-900/40 ring-1 ring-red-200 dark:ring-red-800 transition-colors'
7112
+ revokeBtn.textContent = 'Revoke'
7113
+ revokeBtn.addEventListener('click', () => revokeApiKey(apiKey.id, apiKey.name))
7114
+ actionsTd.appendChild(revokeBtn)
7115
+ tr.appendChild(nameTd); tr.appendChild(prefixTd); tr.appendChild(createdTd)
7116
+ tr.appendChild(lastUsedTd); tr.appendChild(expiresTd); tr.appendChild(actionsTd)
7117
+ tbody.appendChild(tr)
7078
7118
  }
7079
7119
  function copyNewKey() {
7080
7120
  const v = document.getElementById('new-key-value').textContent
7081
- navigator.clipboard.writeText(v).then(() => window.showNotification && window.showNotification('Copied', 'success'))
7121
+ navigator.clipboard.writeText(v).then(() => {
7122
+ window.showNotification && window.showNotification('Copied to clipboard', 'success')
7123
+ document.getElementById('new-key-banner').classList.add('hidden')
7124
+ })
7082
7125
  }
7083
7126
  async function revokeApiKey(id, name) {
7084
7127
  if (!confirm('Revoke "' + name + '"? This cannot be undone and will break any client using it.')) return
@@ -7120,7 +7163,7 @@ var createSchema = zod.z.object({
7120
7163
  });
7121
7164
  async function getSettings3(db) {
7122
7165
  try {
7123
- const plugin2 = await new chunkKVBHB7QP_cjs.PluginService(db).getPlugin("api-keys");
7166
+ const plugin2 = await new chunkPYZYU7EK_cjs.PluginService(db).getPlugin("api-keys");
7124
7167
  if (plugin2?.settings) {
7125
7168
  const s = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
7126
7169
  return { ...DEFAULT_SETTINGS3, ...s };
@@ -7129,7 +7172,7 @@ async function getSettings3(db) {
7129
7172
  }
7130
7173
  return DEFAULT_SETTINGS3;
7131
7174
  }
7132
- adminRoutes4.use("*", chunkFCLKX2OS_cjs.requireAuth());
7175
+ adminRoutes4.use("*", chunkFTXGZ3BF_cjs.requireAuth());
7133
7176
  adminRoutes4.use("*", async (c, next) => {
7134
7177
  const user = c.get("user");
7135
7178
  if (user?.role !== "admin") {
@@ -7214,7 +7257,7 @@ function apiKeyAuthMiddleware() {
7214
7257
 
7215
7258
  // src/plugins/core-plugins/api-keys-plugin/index.ts
7216
7259
  var KEY_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 7a2 2 0 012 2m4 0a6 6 0 01-7.743 5.743L11 17H9v2H7v2H4a1 1 0 01-1-1v-2.586a1 1 0 01.293-.707l5.964-5.964A6 6 0 1121 9z"/></svg>`;
7217
- var apiKeysPlugin = chunkA4KUJ3LD_cjs.definePlugin({
7260
+ var apiKeysPlugin = chunkEUJAEB6W_cjs.definePlugin({
7218
7261
  id: "api-keys",
7219
7262
  version: "1.0.0-beta.1",
7220
7263
  name: "API Keys",
@@ -7985,7 +8028,7 @@ var DEFAULT_SETTINGS4 = {
7985
8028
 
7986
8029
  // src/plugins/core-plugins/stripe-plugin/routes/admin.ts
7987
8030
  var adminRoutes5 = new hono.Hono();
7988
- adminRoutes5.use("*", chunkFCLKX2OS_cjs.requireAuth());
8031
+ adminRoutes5.use("*", chunkFTXGZ3BF_cjs.requireAuth());
7989
8032
  adminRoutes5.use("*", async (c, next) => {
7990
8033
  const user = c.get("user");
7991
8034
  if (user?.role !== "admin") {
@@ -7995,7 +8038,7 @@ adminRoutes5.use("*", async (c, next) => {
7995
8038
  });
7996
8039
  async function getSettings4(db) {
7997
8040
  try {
7998
- const pluginService = new chunkKVBHB7QP_cjs.PluginService(db);
8041
+ const pluginService = new chunkPYZYU7EK_cjs.PluginService(db);
7999
8042
  const plugin2 = await pluginService.getPlugin("stripe");
8000
8043
  if (plugin2?.settings) {
8001
8044
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -8318,7 +8361,7 @@ function timingSafeEqual(a, b) {
8318
8361
  var apiRoutes3 = new hono.Hono();
8319
8362
  async function getSettings5(db) {
8320
8363
  try {
8321
- const pluginService = new chunkKVBHB7QP_cjs.PluginService(db);
8364
+ const pluginService = new chunkPYZYU7EK_cjs.PluginService(db);
8322
8365
  const plugin2 = await pluginService.getPlugin("stripe");
8323
8366
  if (plugin2?.settings) {
8324
8367
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -8469,7 +8512,7 @@ apiRoutes3.post("/webhook", async (c) => {
8469
8512
  }
8470
8513
  return c.json({ received: true });
8471
8514
  });
8472
- apiRoutes3.post("/create-checkout-session", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8515
+ apiRoutes3.post("/create-checkout-session", chunkFTXGZ3BF_cjs.requireAuth(), async (c) => {
8473
8516
  const db = c.env.DB;
8474
8517
  const user = c.get("user");
8475
8518
  if (!user) return c.json({ error: "Unauthorized" }, 401);
@@ -8509,7 +8552,7 @@ apiRoutes3.post("/create-checkout-session", chunkFCLKX2OS_cjs.requireAuth(), asy
8509
8552
  });
8510
8553
  return c.json({ sessionId: session.id, url: session.url });
8511
8554
  });
8512
- apiRoutes3.get("/subscription", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8555
+ apiRoutes3.get("/subscription", chunkFTXGZ3BF_cjs.requireAuth(), async (c) => {
8513
8556
  const user = c.get("user");
8514
8557
  if (!user) return c.json({ error: "Unauthorized" }, 401);
8515
8558
  const db = c.env.DB;
@@ -8521,7 +8564,7 @@ apiRoutes3.get("/subscription", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8521
8564
  }
8522
8565
  return c.json({ subscription });
8523
8566
  });
8524
- apiRoutes3.get("/subscriptions", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8567
+ apiRoutes3.get("/subscriptions", chunkFTXGZ3BF_cjs.requireAuth(), async (c) => {
8525
8568
  const user = c.get("user");
8526
8569
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
8527
8570
  const db = c.env.DB;
@@ -8537,7 +8580,7 @@ apiRoutes3.get("/subscriptions", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8537
8580
  const result = await subscriptionService.list(filters);
8538
8581
  return c.json(result);
8539
8582
  });
8540
- apiRoutes3.get("/stats", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8583
+ apiRoutes3.get("/stats", chunkFTXGZ3BF_cjs.requireAuth(), async (c) => {
8541
8584
  const user = c.get("user");
8542
8585
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
8543
8586
  const db = c.env.DB;
@@ -8546,7 +8589,7 @@ apiRoutes3.get("/stats", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8546
8589
  const stats = await subscriptionService.getStats();
8547
8590
  return c.json(stats);
8548
8591
  });
8549
- apiRoutes3.post("/sync-subscriptions", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8592
+ apiRoutes3.post("/sync-subscriptions", chunkFTXGZ3BF_cjs.requireAuth(), async (c) => {
8550
8593
  const user = c.get("user");
8551
8594
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
8552
8595
  const db = c.env.DB;
@@ -8594,7 +8637,7 @@ apiRoutes3.post("/sync-subscriptions", chunkFCLKX2OS_cjs.requireAuth(), async (c
8594
8637
  }, 500);
8595
8638
  }
8596
8639
  });
8597
- apiRoutes3.get("/events", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8640
+ apiRoutes3.get("/events", chunkFTXGZ3BF_cjs.requireAuth(), async (c) => {
8598
8641
  const user = c.get("user");
8599
8642
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
8600
8643
  const db = c.env.DB;
@@ -8617,7 +8660,7 @@ apiRoutes3.get("/events", chunkFCLKX2OS_cjs.requireAuth(), async (c) => {
8617
8660
 
8618
8661
  // src/plugins/core-plugins/stripe-plugin/index.ts
8619
8662
  var STRIPE_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3 10h18M7 15h1m4 0h1m-7 4h12a3 3 0 003-3V8a3 3 0 00-3-3H6a3 3 0 00-3 3v8a3 3 0 003 3z"/></svg>`;
8620
- var stripePlugin = chunkA4KUJ3LD_cjs.definePlugin({
8663
+ var stripePlugin = chunkEUJAEB6W_cjs.definePlugin({
8621
8664
  id: "stripe",
8622
8665
  version: "1.0.0",
8623
8666
  name: "Stripe",
@@ -8890,7 +8933,7 @@ function renderFormsListPage(data) {
8890
8933
 
8891
8934
  <!-- Forms Table -->
8892
8935
  <div class="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-950/5 dark:border-white/10 overflow-hidden">
8893
- ${chunk7RUW244J_cjs.renderTable(tableData)}
8936
+ ${chunkJFLZHOQP_cjs.renderTable(tableData)}
8894
8937
  </div>
8895
8938
  </div>
8896
8939
  `;
@@ -10320,7 +10363,7 @@ function renderFormCreatePage(data) {
10320
10363
  // src/routes/admin-forms.ts
10321
10364
  var isTableMissing = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: forms");
10322
10365
  var adminFormsRoutes = new hono.Hono();
10323
- adminFormsRoutes.use("*", chunkFCLKX2OS_cjs.requireAuth());
10366
+ adminFormsRoutes.use("*", chunkFTXGZ3BF_cjs.requireAuth());
10324
10367
  adminFormsRoutes.get("/", async (c) => {
10325
10368
  try {
10326
10369
  const user = c.get("user");
@@ -10493,7 +10536,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
10493
10536
  if (!form) {
10494
10537
  return c.html("<p>Form not found</p>", 404);
10495
10538
  }
10496
- const turnstileService = new chunk5UXU3LP4_cjs.TurnstileService(db);
10539
+ const turnstileService = new chunkMGHHPNJN_cjs.TurnstileService(db);
10497
10540
  const turnstileSettings = await turnstileService.getSettings();
10498
10541
  const pageData = {
10499
10542
  id: form.id,
@@ -10662,7 +10705,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10662
10705
  if (!form) {
10663
10706
  return c.json({ error: "Form not found" }, 404);
10664
10707
  }
10665
- const turnstileService = new chunk5UXU3LP4_cjs.TurnstileService(db);
10708
+ const turnstileService = new chunkMGHHPNJN_cjs.TurnstileService(db);
10666
10709
  const globalSettings = await turnstileService.getSettings();
10667
10710
  const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10668
10711
  const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
@@ -11092,7 +11135,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
11092
11135
  const turnstileEnabled = form.turnstile_enabled === 1;
11093
11136
  const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
11094
11137
  if (turnstileEnabled || turnstileSettings.inherit) {
11095
- const turnstileService = new chunk5UXU3LP4_cjs.TurnstileService(db);
11138
+ const turnstileService = new chunkMGHHPNJN_cjs.TurnstileService(db);
11096
11139
  const globalEnabled = await turnstileService.isEnabled();
11097
11140
  if (globalEnabled || turnstileEnabled) {
11098
11141
  const turnstileToken = body.data?.turnstile || body.turnstile;
@@ -11154,7 +11197,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
11154
11197
  });
11155
11198
 
11156
11199
  // src/plugins/core-plugins/forms-plugin/index.ts
11157
- var formsPlugin = chunkA4KUJ3LD_cjs.definePlugin({
11200
+ var formsPlugin = chunkEUJAEB6W_cjs.definePlugin({
11158
11201
  id: "forms",
11159
11202
  version: "1.0.0",
11160
11203
  name: "Forms",
@@ -11174,7 +11217,7 @@ var formsPlugin = chunkA4KUJ3LD_cjs.definePlugin({
11174
11217
  });
11175
11218
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
11176
11219
  var adminRbacRoutes = new hono.Hono();
11177
- adminRbacRoutes.use("*", chunkFCLKX2OS_cjs.requireRbac("rbac", "manage"));
11220
+ adminRbacRoutes.use("*", chunkFTXGZ3BF_cjs.requireRbac("rbac", "manage"));
11178
11221
  var esc = (s) => String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
11179
11222
  var TABS2 = `
11180
11223
  <div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
@@ -11482,7 +11525,7 @@ adminRbacRoutes.get("/", async (c) => {
11482
11525
  title: "Roles & Permissions",
11483
11526
  pageTitle: "Roles & Permissions",
11484
11527
  currentPath: "/admin/users",
11485
- version: chunkAOUVUF32_cjs.getCoreVersion(),
11528
+ version: chunkQWSR4THH_cjs.getCoreVersion(),
11486
11529
  user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
11487
11530
  content: content2
11488
11531
  })
@@ -11619,7 +11662,7 @@ adminRbacRoutes.get("/check", async (c) => {
11619
11662
  });
11620
11663
 
11621
11664
  // src/middleware/plugin-menu.ts
11622
- var REGISTRY_MENU_PLUGINS = Object.values(chunkKVBHB7QP_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
11665
+ var REGISTRY_MENU_PLUGINS = Object.values(chunkPYZYU7EK_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
11623
11666
  id: p.id,
11624
11667
  label: p.adminMenu.label,
11625
11668
  path: p.adminMenu.path,
@@ -11698,7 +11741,7 @@ function pluginMenuMiddleware() {
11698
11741
  } catch {
11699
11742
  }
11700
11743
  const user = c.get("user");
11701
- const singletonItems = chunk5UXU3LP4_cjs.resolvePluginMenuItems(user ? { role: user.role } : void 0);
11744
+ const singletonItems = chunkMGHHPNJN_cjs.resolvePluginMenuItems(user ? { role: user.role } : void 0);
11702
11745
  const existingPaths = new Set(activeMenuItems.map((i) => i.path));
11703
11746
  for (const item of singletonItems) {
11704
11747
  if (!existingPaths.has(item.path)) {
@@ -11725,7 +11768,7 @@ function pluginMenuMiddleware() {
11725
11768
  }
11726
11769
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
11727
11770
  var adminRoutes6 = new hono.Hono();
11728
- adminRoutes6.use("*", chunkFCLKX2OS_cjs.requireAuth());
11771
+ adminRoutes6.use("*", chunkFTXGZ3BF_cjs.requireAuth());
11729
11772
  adminRoutes6.use("*", async (c, next) => {
11730
11773
  const user = c.get("user");
11731
11774
  if (user?.role !== "admin") {
@@ -12081,7 +12124,7 @@ apiRoutes4.get("/stats", async (c) => {
12081
12124
  });
12082
12125
 
12083
12126
  // src/plugins/core-plugins/analytics/index.ts
12084
- var analyticsPlugin = chunkA4KUJ3LD_cjs.definePlugin({
12127
+ var analyticsPlugin = chunkEUJAEB6W_cjs.definePlugin({
12085
12128
  id: "core-analytics",
12086
12129
  version: "1.0.0",
12087
12130
  name: "Analytics",
@@ -12228,7 +12271,7 @@ function esc2(s) {
12228
12271
  return (s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
12229
12272
  }
12230
12273
  async function getVariablesMap(db) {
12231
- let variables = chunk7RUW244J_cjs.getVariablesCached();
12274
+ let variables = chunkJFLZHOQP_cjs.getVariablesCached();
12232
12275
  if (variables) return variables;
12233
12276
  try {
12234
12277
  const { results } = await db.prepare(
@@ -12238,7 +12281,7 @@ async function getVariablesMap(db) {
12238
12281
  for (const row of results || []) {
12239
12282
  variables.set(row.key, row.value);
12240
12283
  }
12241
- chunk7RUW244J_cjs.setVariablesCache(variables);
12284
+ chunkJFLZHOQP_cjs.setVariablesCache(variables);
12242
12285
  return variables;
12243
12286
  } catch {
12244
12287
  return /* @__PURE__ */ new Map();
@@ -12307,7 +12350,7 @@ apiRoutes5.post("/", async (c) => {
12307
12350
  await db.prepare(
12308
12351
  "INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
12309
12352
  ).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
12310
- chunk7RUW244J_cjs.invalidateVariablesCache();
12353
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12311
12354
  const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
12312
12355
  return c.json({ success: true, data: formatVariable(created) }, 201);
12313
12356
  } catch {
@@ -12352,7 +12395,7 @@ apiRoutes5.put("/:id", async (c) => {
12352
12395
  updates.push("updated_at = strftime('%s', 'now')");
12353
12396
  params.push(id);
12354
12397
  await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
12355
- chunk7RUW244J_cjs.invalidateVariablesCache();
12398
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12356
12399
  const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
12357
12400
  return c.json({ success: true, data: formatVariable(updated) });
12358
12401
  } catch {
@@ -12366,7 +12409,7 @@ apiRoutes5.delete("/:id", async (c) => {
12366
12409
  const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
12367
12410
  if (!existing) return c.json({ error: "Variable not found" }, 404);
12368
12411
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
12369
- chunk7RUW244J_cjs.invalidateVariablesCache();
12412
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12370
12413
  return c.json({ success: true });
12371
12414
  } catch {
12372
12415
  return c.json({ success: false, error: "Failed to delete variable" }, 500);
@@ -12426,7 +12469,7 @@ adminRoutes7.put("/:id", async (c) => {
12426
12469
  const value = body.value;
12427
12470
  if (value !== void 0) {
12428
12471
  await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
12429
- chunk7RUW244J_cjs.invalidateVariablesCache();
12472
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12430
12473
  }
12431
12474
  return c.html('<span class="text-green-400 text-xs">Saved</span>');
12432
12475
  });
@@ -12434,7 +12477,7 @@ adminRoutes7.post("/:id/toggle", async (c) => {
12434
12477
  const db = c.env.DB;
12435
12478
  const id = c.req.param("id");
12436
12479
  await db.prepare("UPDATE global_variables SET is_active = CASE WHEN is_active = 1 THEN 0 ELSE 1 END, updated_at = strftime('%s', 'now') WHERE id = ?").bind(id).run();
12437
- chunk7RUW244J_cjs.invalidateVariablesCache();
12480
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12438
12481
  c.header("HX-Redirect", "/admin/global-variables");
12439
12482
  return c.body(null, 204);
12440
12483
  });
@@ -12455,7 +12498,7 @@ adminRoutes7.post("/", async (c) => {
12455
12498
  await db.prepare(
12456
12499
  "INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
12457
12500
  ).bind(key, value, description, category).run();
12458
- chunk7RUW244J_cjs.invalidateVariablesCache();
12501
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12459
12502
  c.header("HX-Redirect", "/admin/global-variables");
12460
12503
  return c.body(null, 204);
12461
12504
  });
@@ -12474,7 +12517,7 @@ adminRoutes7.post("/settings/editor-integration", async (c) => {
12474
12517
  adminRoutes7.delete("/:id", async (c) => {
12475
12518
  const db = c.env.DB;
12476
12519
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
12477
- chunk7RUW244J_cjs.invalidateVariablesCache();
12520
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12478
12521
  return c.html("");
12479
12522
  });
12480
12523
  function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
@@ -12792,7 +12835,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
12792
12835
  </div>
12793
12836
  ` });
12794
12837
  }
12795
- var globalVariablesPlugin = chunkA4KUJ3LD_cjs.definePlugin({
12838
+ var globalVariablesPlugin = chunkEUJAEB6W_cjs.definePlugin({
12796
12839
  id: "global-variables",
12797
12840
  version: "1.1.0",
12798
12841
  name: "Global Variables",
@@ -12815,7 +12858,7 @@ var globalVariablesPlugin = chunkA4KUJ3LD_cjs.definePlugin({
12815
12858
  if (!db || !data) return data;
12816
12859
  const variables = await getVariablesMap(db);
12817
12860
  if (variables.size === 0) return data;
12818
- return chunk7RUW244J_cjs.resolveVariablesInObject(data, variables);
12861
+ return chunkJFLZHOQP_cjs.resolveVariablesInObject(data, variables);
12819
12862
  } catch {
12820
12863
  return data;
12821
12864
  }
@@ -12833,7 +12876,7 @@ var globalVariablesPlugin = chunkA4KUJ3LD_cjs.definePlugin({
12833
12876
  },
12834
12877
  activate: async () => console.info("[GlobalVariables] Plugin activated"),
12835
12878
  deactivate: async () => {
12836
- chunk7RUW244J_cjs.invalidateVariablesCache();
12879
+ chunkJFLZHOQP_cjs.invalidateVariablesCache();
12837
12880
  console.info("[GlobalVariables] Plugin deactivated, cache cleared");
12838
12881
  },
12839
12882
  uninstall: async (ctx) => {
@@ -13399,7 +13442,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
13399
13442
  </div>
13400
13443
  ` });
13401
13444
  }
13402
- var shortcodesPlugin = chunkA4KUJ3LD_cjs.definePlugin({
13445
+ var shortcodesPlugin = chunkEUJAEB6W_cjs.definePlugin({
13403
13446
  id: "shortcodes",
13404
13447
  version: "1.0.0",
13405
13448
  name: "Shortcodes",
@@ -13483,7 +13526,7 @@ helloWorldRoutes.get("/", async (c) => {
13483
13526
  </html>
13484
13527
  `);
13485
13528
  });
13486
- var helloWorldPlugin = chunkA4KUJ3LD_cjs.definePlugin({
13529
+ var helloWorldPlugin = chunkEUJAEB6W_cjs.definePlugin({
13487
13530
  id: "hello-world",
13488
13531
  version: "1.0.0",
13489
13532
  name: "Hello World",
@@ -13714,7 +13757,7 @@ function renderTenantForm(data) {
13714
13757
  // src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
13715
13758
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13716
13759
  function roleOptions(selected) {
13717
- return chunk7RUW244J_cjs.VALID_MEMBER_ROLES.map(
13760
+ return chunkJFLZHOQP_cjs.VALID_MEMBER_ROLES.map(
13718
13761
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13719
13762
  ).join("");
13720
13763
  }
@@ -13776,7 +13819,7 @@ function renderInvitations(slug, invitations) {
13776
13819
  <div>
13777
13820
  <label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
13778
13821
  <select id="invite-role" name="role" class="rounded-lg border border-zinc-950/10 bg-white px-2 py-2 text-sm text-zinc-950 dark:border-white/10 dark:bg-zinc-800 dark:text-white">
13779
- ${chunk7RUW244J_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13822
+ ${chunkJFLZHOQP_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13780
13823
  </select>
13781
13824
  </div>
13782
13825
  <button type="submit" data-send-invite class="rounded-lg bg-zinc-950 px-3.5 py-2 text-sm font-semibold text-white hover:bg-zinc-800 dark:bg-white dark:text-zinc-950 dark:hover:bg-zinc-200">Invite</button>
@@ -13872,7 +13915,7 @@ function renderTenantMembers(data) {
13872
13915
  // src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
13873
13916
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13874
13917
  function roleOptions2(selected) {
13875
- return chunk7RUW244J_cjs.VALID_MEMBER_ROLES.map(
13918
+ return chunkJFLZHOQP_cjs.VALID_MEMBER_ROLES.map(
13876
13919
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13877
13920
  ).join("");
13878
13921
  }
@@ -14034,7 +14077,7 @@ function zodToFieldErrors(error) {
14034
14077
  }
14035
14078
  async function isMultiTenantActive(db) {
14036
14079
  try {
14037
- const plugin2 = await new chunkKVBHB7QP_cjs.PluginService(db).getPlugin(chunkKVBHB7QP_cjs.MULTI_TENANT_PLUGIN_ID);
14080
+ const plugin2 = await new chunkPYZYU7EK_cjs.PluginService(db).getPlugin(chunkPYZYU7EK_cjs.MULTI_TENANT_PLUGIN_ID);
14038
14081
  return plugin2?.status === "active";
14039
14082
  } catch {
14040
14083
  return false;
@@ -14042,7 +14085,7 @@ async function isMultiTenantActive(db) {
14042
14085
  }
14043
14086
  function createTenantAdminRoutes() {
14044
14087
  const routes2 = new hono.Hono();
14045
- routes2.use("*", chunkFCLKX2OS_cjs.requireAuth());
14088
+ routes2.use("*", chunkFTXGZ3BF_cjs.requireAuth());
14046
14089
  routes2.use("*", async (c, next) => {
14047
14090
  const user = c.get("user");
14048
14091
  if (user?.role !== "admin") {
@@ -14056,7 +14099,7 @@ function createTenantAdminRoutes() {
14056
14099
  const form = await c.req.formData();
14057
14100
  const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
14058
14101
  const redirect = String(form.get("redirect") ?? "");
14059
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14102
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14060
14103
  const tenant = await svc.getTenantBySlug(slug);
14061
14104
  if (!tenant || tenant.status !== "active") {
14062
14105
  return c.json({ error: "Unknown or inactive tenant" }, 400);
@@ -14066,7 +14109,7 @@ function createTenantAdminRoutes() {
14066
14109
  if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
14067
14110
  return c.json({ error: "You are not a member of this tenant" }, 403);
14068
14111
  }
14069
- cookie.setCookie(c, chunkKVBHB7QP_cjs.TENANT_COOKIE, slug, {
14112
+ cookie.setCookie(c, chunkPYZYU7EK_cjs.TENANT_COOKIE, slug, {
14070
14113
  path: "/",
14071
14114
  httpOnly: true,
14072
14115
  sameSite: "Lax",
@@ -14083,7 +14126,7 @@ function createTenantAdminRoutes() {
14083
14126
  if (!user) return c.redirect("/auth/login");
14084
14127
  const token = c.req.query("token") ?? "";
14085
14128
  try {
14086
- const { slug } = await new chunk7RUW244J_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
14129
+ const { slug } = await new chunkJFLZHOQP_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
14087
14130
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
14088
14131
  } catch (error) {
14089
14132
  const message = error instanceof Error ? error.message : "Failed to accept invitation";
@@ -14111,7 +14154,7 @@ function createTenantAdminRoutes() {
14111
14154
  const userId = c.req.param("userId");
14112
14155
  const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
14113
14156
  if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
14114
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14157
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14115
14158
  const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
14116
14159
  const memberSlugs = new Set(memberships.map((m) => m.slug));
14117
14160
  const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
@@ -14136,10 +14179,10 @@ function createTenantAdminRoutes() {
14136
14179
  const slug = String(form.get("slug") ?? "").trim().toLowerCase();
14137
14180
  const role = String(form.get("role") ?? "viewer");
14138
14181
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
14139
- if (!chunk7RUW244J_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
14182
+ if (!chunkJFLZHOQP_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
14140
14183
  const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
14141
14184
  if (!target) throw new Error("User not found");
14142
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14185
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14143
14186
  if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
14144
14187
  if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
14145
14188
  await svc.addMember(slug, userId, role, target.email ?? null);
@@ -14158,7 +14201,7 @@ function createTenantAdminRoutes() {
14158
14201
  const form = await c.req.formData();
14159
14202
  const role = String(form.get("role") ?? "");
14160
14203
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
14161
- await new chunk7RUW244J_cjs.TenantService(db).setMemberRole(slug, userId, role);
14204
+ await new chunkJFLZHOQP_cjs.TenantService(db).setMemberRole(slug, userId, role);
14162
14205
  return c.redirect(`${redirectTo}?message=Role updated`);
14163
14206
  } catch (error) {
14164
14207
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -14173,7 +14216,7 @@ function createTenantAdminRoutes() {
14173
14216
  try {
14174
14217
  const form = await c.req.formData();
14175
14218
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
14176
- await new chunk7RUW244J_cjs.TenantService(db).removeMember(slug, userId);
14219
+ await new chunkJFLZHOQP_cjs.TenantService(db).removeMember(slug, userId);
14177
14220
  return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
14178
14221
  } catch (error) {
14179
14222
  const message = error instanceof Error ? error.message : "Failed to remove membership";
@@ -14188,7 +14231,7 @@ function createTenantAdminRoutes() {
14188
14231
  return c.html(renderTenantsInactive({ user: userShape(cur), version }));
14189
14232
  }
14190
14233
  const roleName = c.req.param("roleName");
14191
- const assignments = await new chunk7RUW244J_cjs.TenantService(db).listAssignmentsByRole(roleName);
14234
+ const assignments = await new chunkJFLZHOQP_cjs.TenantService(db).listAssignmentsByRole(roleName);
14192
14235
  return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
14193
14236
  });
14194
14237
  routes2.get("/", async (c) => {
@@ -14198,7 +14241,7 @@ function createTenantAdminRoutes() {
14198
14241
  if (!await isMultiTenantActive(db)) {
14199
14242
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
14200
14243
  }
14201
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14244
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14202
14245
  await svc.ensureDefaultTenant();
14203
14246
  const tenants = await svc.listTenants();
14204
14247
  const [docRes, memberRes] = await db.batch([
@@ -14237,7 +14280,7 @@ function createTenantAdminRoutes() {
14237
14280
  formEntries = Object.fromEntries(form.entries());
14238
14281
  const validated = tenantFormSchema.parse(formEntries);
14239
14282
  if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
14240
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14283
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14241
14284
  await svc.createTenant({
14242
14285
  name: validated.name,
14243
14286
  slug: validated.slug,
@@ -14262,7 +14305,7 @@ function createTenantAdminRoutes() {
14262
14305
  if (!await isMultiTenantActive(db)) {
14263
14306
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
14264
14307
  }
14265
- const tenant = await new chunk7RUW244J_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
14308
+ const tenant = await new chunkJFLZHOQP_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
14266
14309
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
14267
14310
  return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
14268
14311
  });
@@ -14272,7 +14315,7 @@ function createTenantAdminRoutes() {
14272
14315
  const version = c.get("appVersion");
14273
14316
  const slug = c.req.param("slug");
14274
14317
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
14275
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14318
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14276
14319
  try {
14277
14320
  const form = await c.req.formData();
14278
14321
  const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
@@ -14297,7 +14340,7 @@ function createTenantAdminRoutes() {
14297
14340
  const slug = c.req.param("slug");
14298
14341
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
14299
14342
  try {
14300
- await new chunk7RUW244J_cjs.TenantService(db).deleteTenant(slug);
14343
+ await new chunkJFLZHOQP_cjs.TenantService(db).deleteTenant(slug);
14301
14344
  return c.redirect("/admin/tenants?message=Tenant deleted successfully");
14302
14345
  } catch (error) {
14303
14346
  const message = error instanceof Error ? error.message : "Failed to delete tenant";
@@ -14312,7 +14355,7 @@ function createTenantAdminRoutes() {
14312
14355
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
14313
14356
  }
14314
14357
  const slug = c.req.param("slug");
14315
- const svc = new chunk7RUW244J_cjs.TenantService(db);
14358
+ const svc = new chunkJFLZHOQP_cjs.TenantService(db);
14316
14359
  const tenant = await svc.getTenantBySlug(slug);
14317
14360
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
14318
14361
  const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
@@ -14338,7 +14381,7 @@ function createTenantAdminRoutes() {
14338
14381
  const form = await c.req.formData();
14339
14382
  const email = String(form.get("email") ?? "");
14340
14383
  const role = String(form.get("role") ?? "viewer");
14341
- await new chunk7RUW244J_cjs.TenantService(db).addMemberByEmail(slug, email, role);
14384
+ await new chunkJFLZHOQP_cjs.TenantService(db).addMemberByEmail(slug, email, role);
14342
14385
  return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
14343
14386
  } catch (error) {
14344
14387
  const message = error instanceof Error ? error.message : "Failed to add member";
@@ -14353,7 +14396,7 @@ function createTenantAdminRoutes() {
14353
14396
  try {
14354
14397
  const form = await c.req.formData();
14355
14398
  const role = String(form.get("role") ?? "");
14356
- await new chunk7RUW244J_cjs.TenantService(db).setMemberRole(slug, userId, role);
14399
+ await new chunkJFLZHOQP_cjs.TenantService(db).setMemberRole(slug, userId, role);
14357
14400
  return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
14358
14401
  } catch (error) {
14359
14402
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -14366,7 +14409,7 @@ function createTenantAdminRoutes() {
14366
14409
  const userId = c.req.param("userId");
14367
14410
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
14368
14411
  try {
14369
- await new chunk7RUW244J_cjs.TenantService(db).removeMember(slug, userId);
14412
+ await new chunkJFLZHOQP_cjs.TenantService(db).removeMember(slug, userId);
14370
14413
  return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
14371
14414
  } catch (error) {
14372
14415
  const message = error instanceof Error ? error.message : "Failed to remove member";
@@ -14382,12 +14425,12 @@ function createTenantAdminRoutes() {
14382
14425
  const form = await c.req.formData();
14383
14426
  const email = String(form.get("email") ?? "");
14384
14427
  const role = String(form.get("role") ?? "viewer");
14385
- const token = await new chunk7RUW244J_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
14428
+ const token = await new chunkJFLZHOQP_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
14386
14429
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
14387
14430
  const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
14388
14431
  let note;
14389
14432
  let noteType = "";
14390
- const svc2 = chunk7RUW244J_cjs.hasEmailService() ? chunk7RUW244J_cjs.getEmailService() : null;
14433
+ const svc2 = chunkJFLZHOQP_cjs.hasEmailService() ? chunkJFLZHOQP_cjs.getEmailService() : null;
14391
14434
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
14392
14435
  if (hasRealProvider) {
14393
14436
  const result = await svc2.send({
@@ -14428,7 +14471,7 @@ function createTenantAdminRoutes() {
14428
14471
  WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
14429
14472
  ).bind(id, slug).first();
14430
14473
  if (!inv) throw new Error("Invitation not found or already used");
14431
- const svc2 = chunk7RUW244J_cjs.hasEmailService() ? chunk7RUW244J_cjs.getEmailService() : null;
14474
+ const svc2 = chunkJFLZHOQP_cjs.hasEmailService() ? chunkJFLZHOQP_cjs.getEmailService() : null;
14432
14475
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
14433
14476
  if (!hasRealProvider) throw new Error("No email plugin active");
14434
14477
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
@@ -14453,7 +14496,7 @@ function createTenantAdminRoutes() {
14453
14496
  const id = c.req.param("id");
14454
14497
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
14455
14498
  try {
14456
- await new chunk7RUW244J_cjs.TenantService(db).revokeInvitation(slug, id);
14499
+ await new chunkJFLZHOQP_cjs.TenantService(db).revokeInvitation(slug, id);
14457
14500
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
14458
14501
  } catch (error) {
14459
14502
  const message = error instanceof Error ? error.message : "Failed to revoke invitation";
@@ -14683,7 +14726,7 @@ function createJoinRoutes() {
14683
14726
  if (existing) return rerender("An account with this email already exists. Please sign in instead.");
14684
14727
  try {
14685
14728
  const userId = crypto.randomUUID();
14686
- const passwordHash = await chunkFCLKX2OS_cjs.AuthManager.hashPassword(password);
14729
+ const passwordHash = await chunkFTXGZ3BF_cjs.AuthManager.hashPassword(password);
14687
14730
  const now = Date.now();
14688
14731
  const nowSec = Math.floor(now / 1e3);
14689
14732
  await db.batch([
@@ -14696,7 +14739,7 @@ function createJoinRoutes() {
14696
14739
  VALUES (?, ?, ?, 'credential', ?, ?, ?)`
14697
14740
  ).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
14698
14741
  ]);
14699
- await new chunk7RUW244J_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14742
+ await new chunkJFLZHOQP_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14700
14743
  const auth = chunkGMMCCIQO_cjs.createAuth(c.env);
14701
14744
  const origin = new URL(c.req.url).origin;
14702
14745
  const baReq = new Request(`${origin}/auth/sign-in/email`, {
@@ -14764,7 +14807,7 @@ function createJoinRoutes() {
14764
14807
  const baBody = await baRes.json();
14765
14808
  const userId = baBody?.user?.id;
14766
14809
  if (!userId) return rerender("Sign-in succeeded but could not read user ID.");
14767
- await new chunk7RUW244J_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14810
+ await new chunkJFLZHOQP_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14768
14811
  const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
14769
14812
  copyBaCookies(baRes, headers);
14770
14813
  return new Response(null, { status: 302, headers });
@@ -14778,7 +14821,7 @@ function createJoinRoutes() {
14778
14821
 
14779
14822
  // src/plugins/core-plugins/multi-tenant-plugin/index.ts
14780
14823
  var TENANT_ICON = `<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M9 6.75h1.5m-1.5 3h1.5m-1.5 3h1.5m3-6H15m-1.5 3H15m-1.5 3H15M9 21v-3.375c0-.621.504-1.125 1.125-1.125h3.75c.621 0 1.125.504 1.125 1.125V21"/></svg>`;
14781
- var multiTenantPlugin = chunkA4KUJ3LD_cjs.definePlugin({
14824
+ var multiTenantPlugin = chunkEUJAEB6W_cjs.definePlugin({
14782
14825
  id: manifest_default2.id,
14783
14826
  version: "1.0.0",
14784
14827
  name: manifest_default2.name,
@@ -14793,30 +14836,30 @@ var multiTenantPlugin = chunkA4KUJ3LD_cjs.definePlugin({
14793
14836
  { label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
14794
14837
  ],
14795
14838
  activate: async () => {
14796
- chunkKVBHB7QP_cjs.invalidateTenantCache();
14839
+ chunkPYZYU7EK_cjs.invalidateTenantCache();
14797
14840
  console.info("\u2705 Multi-Tenant plugin activated");
14798
14841
  },
14799
14842
  deactivate: async () => {
14800
- chunkKVBHB7QP_cjs.invalidateTenantCache();
14843
+ chunkPYZYU7EK_cjs.invalidateTenantCache();
14801
14844
  console.info("\u274C Multi-Tenant plugin deactivated");
14802
14845
  }
14803
14846
  });
14804
14847
  var routes = new hono.Hono();
14805
- routes.use("*", chunkFCLKX2OS_cjs.requireAuth());
14806
- routes.use("*", chunkFCLKX2OS_cjs.requireRole(["admin", "editor"]));
14848
+ routes.use("*", chunkFTXGZ3BF_cjs.requireAuth());
14849
+ routes.use("*", chunkFTXGZ3BF_cjs.requireRole(["admin", "editor"]));
14807
14850
  routes.get("/:rootId", async (c) => {
14808
14851
  const { rootId } = c.req.param();
14809
14852
  const db = c.env.DB;
14810
- const scope = await chunk7RUW244J_cjs.resolveDocScope(c, db, { rootId });
14853
+ const scope = await chunkJFLZHOQP_cjs.resolveDocScope(c, db, { rootId });
14811
14854
  if (!scope) {
14812
14855
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
14813
14856
  }
14814
14857
  if (!scope.docType?.settings?.versioning) {
14815
14858
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
14816
14859
  }
14817
- const denied = await chunk7RUW244J_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14860
+ const denied = await chunkJFLZHOQP_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14818
14861
  if (denied) return denied;
14819
- const repo = new chunk7RUW244J_cjs.DocumentRepository(db, scope.tenantId);
14862
+ const repo = new chunkJFLZHOQP_cjs.DocumentRepository(db, scope.tenantId);
14820
14863
  const versions = await repo.getVersionHistory(rootId);
14821
14864
  const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
14822
14865
  const rows = versions.map((v) => {
@@ -14909,14 +14952,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14909
14952
  const { rootId, versionNumber } = c.req.param();
14910
14953
  const db = c.env.DB;
14911
14954
  const user = c.get("user");
14912
- const scope = await chunk7RUW244J_cjs.resolveDocScope(c, db, { rootId });
14955
+ const scope = await chunkJFLZHOQP_cjs.resolveDocScope(c, db, { rootId });
14913
14956
  if (!scope) {
14914
14957
  return c.json({ error: "Document not found" }, 404);
14915
14958
  }
14916
14959
  if (!scope.docType?.settings?.versioning) {
14917
14960
  return c.json({ error: "Versioning not enabled for this type" }, 404);
14918
14961
  }
14919
- const denied = await chunk7RUW244J_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14962
+ const denied = await chunkJFLZHOQP_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14920
14963
  if (denied) return denied;
14921
14964
  const row = await db.prepare("SELECT * FROM documents WHERE root_id = ? AND tenant_id = ? AND version_number = ? LIMIT 1").bind(rootId, scope.tenantId, Number(versionNumber)).first();
14922
14965
  if (!row) {
@@ -14939,7 +14982,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14939
14982
  var routes_default = routes;
14940
14983
 
14941
14984
  // src/plugins/core-plugins/versioning-plugin/index.ts
14942
- var versioningPlugin = chunkA4KUJ3LD_cjs.definePlugin({
14985
+ var versioningPlugin = chunkEUJAEB6W_cjs.definePlugin({
14943
14986
  id: "versioning",
14944
14987
  version: "1.0.0",
14945
14988
  name: "Versioning",
@@ -15016,8 +15059,8 @@ function createMagicLinkAuthPlugin() {
15016
15059
  const baseUrl = new URL(c.req.url).origin;
15017
15060
  const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
15018
15061
  try {
15019
- if (chunk7RUW244J_cjs.hasEmailService()) {
15020
- await chunk7RUW244J_cjs.getEmailService().send({
15062
+ if (chunkJFLZHOQP_cjs.hasEmailService()) {
15063
+ await chunkJFLZHOQP_cjs.getEmailService().send({
15021
15064
  to: normalizedEmail,
15022
15065
  subject: "Your Magic Link to Sign In",
15023
15066
  flow: "magic-link",
@@ -15094,19 +15137,19 @@ function createMagicLinkAuthPlugin() {
15094
15137
  SET used = 1, used_at = ?
15095
15138
  WHERE id = ?
15096
15139
  `).bind(Date.now(), magicLink.id).run();
15097
- const tokenTtl = await chunkFCLKX2OS_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
15098
- const jwtToken = await chunkFCLKX2OS_cjs.AuthManager.generateToken(
15140
+ const tokenTtl = await chunkFTXGZ3BF_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
15141
+ const jwtToken = await chunkFTXGZ3BF_cjs.AuthManager.generateToken(
15099
15142
  user.id,
15100
15143
  user.email,
15101
15144
  user.role,
15102
15145
  c.env.JWT_SECRET,
15103
15146
  tokenTtl
15104
15147
  );
15105
- chunkFCLKX2OS_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
15148
+ chunkFTXGZ3BF_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
15106
15149
  await db.prepare(`
15107
15150
  UPDATE auth_user SET last_login_at = ? WHERE id = ?
15108
15151
  `).bind(Date.now(), user.id).run();
15109
- chunk7RUW244J_cjs.dispatchHookEvent(
15152
+ chunkJFLZHOQP_cjs.dispatchHookEvent(
15110
15153
  c,
15111
15154
  "auth:magic-link:consumed",
15112
15155
  { user: { id: user.id, email: user.email, role: user.role } },
@@ -15591,7 +15634,7 @@ async function warmCollections(db) {
15591
15634
  const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
15592
15635
  let count = 0;
15593
15636
  try {
15594
- const results = chunkKVBHB7QP_cjs.getCollectionRegistry().listActive().map(chunkKVBHB7QP_cjs.collectionRecordToRow);
15637
+ const results = chunkPYZYU7EK_cjs.getCollectionRegistry().listActive().map(chunkPYZYU7EK_cjs.collectionRecordToRow);
15595
15638
  for (const collection of results) {
15596
15639
  const key = collectionCache.generateKey("item", collection.id);
15597
15640
  await collectionCache.set(key, collection);
@@ -15862,7 +15905,7 @@ function renderCacheDashboard(data) {
15862
15905
  </script>
15863
15906
 
15864
15907
  <!-- Confirmation Dialogs -->
15865
- ${chunk7RUW244J_cjs.renderConfirmationDialog({
15908
+ ${chunkJFLZHOQP_cjs.renderConfirmationDialog({
15866
15909
  id: "clear-all-cache-confirm",
15867
15910
  title: "Clear All Cache",
15868
15911
  message: "Are you sure you want to clear all cache entries? This cannot be undone.",
@@ -15873,7 +15916,7 @@ function renderCacheDashboard(data) {
15873
15916
  onConfirm: "performClearAllCaches()"
15874
15917
  })}
15875
15918
 
15876
- ${chunk7RUW244J_cjs.renderConfirmationDialog({
15919
+ ${chunkJFLZHOQP_cjs.renderConfirmationDialog({
15877
15920
  id: "clear-namespace-cache-confirm",
15878
15921
  title: "Clear Namespace Cache",
15879
15922
  message: "Clear cache for this namespace?",
@@ -15884,7 +15927,7 @@ function renderCacheDashboard(data) {
15884
15927
  onConfirm: "performClearNamespaceCache()"
15885
15928
  })}
15886
15929
 
15887
- ${chunk7RUW244J_cjs.getConfirmationDialogScript()}
15930
+ ${chunkJFLZHOQP_cjs.getConfirmationDialogScript()}
15888
15931
  `;
15889
15932
  const layoutData = {
15890
15933
  title: "Cache System",
@@ -16150,7 +16193,7 @@ app.get("/", async (c) => {
16150
16193
  const totalRequests = totalHits + totalMisses;
16151
16194
  const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
16152
16195
  const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
16153
- const collections = chunkKVBHB7QP_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
16196
+ const collections = chunkPYZYU7EK_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
16154
16197
  const cacheOverride = r.cache;
16155
16198
  const cacheEnabled = cacheOverride?.enabled !== false;
16156
16199
  const hasCustomTtl = typeof cacheOverride?.ttl === "number";
@@ -16687,9 +16730,9 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
16687
16730
  // src/app.ts
16688
16731
  function createSonicJSApp(config = {}) {
16689
16732
  const app2 = new hono.Hono();
16690
- const appVersion = config.version || chunkAOUVUF32_cjs.getCoreVersion();
16733
+ const appVersion = config.version || chunkQWSR4THH_cjs.getCoreVersion();
16691
16734
  const appName = config.name || "SonicJS AI";
16692
- const hookSystem = new chunk5UXU3LP4_cjs.HookSystemImpl();
16735
+ const hookSystem = new chunkMGHHPNJN_cjs.HookSystemImpl();
16693
16736
  chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
16694
16737
  const magicLinkPlugin = createMagicLinkAuthPlugin();
16695
16738
  const corePluginsBeforeCatchAll = [
@@ -16697,7 +16740,7 @@ function createSonicJSApp(config = {}) {
16697
16740
  apiKeysPlugin,
16698
16741
  aiSearchPlugin,
16699
16742
  oauthProvidersPlugin,
16700
- chunk7RUW244J_cjs.userProfilesPlugin,
16743
+ chunkJFLZHOQP_cjs.userProfilesPlugin,
16701
16744
  otpLoginPlugin,
16702
16745
  analyticsPlugin,
16703
16746
  stripePlugin,
@@ -16707,23 +16750,23 @@ function createSonicJSApp(config = {}) {
16707
16750
  shortcodesPlugin,
16708
16751
  helloWorldPlugin,
16709
16752
  multiTenantPlugin,
16710
- chunk7RUW244J_cjs.lexicalEditorPlugin,
16753
+ chunkJFLZHOQP_cjs.lexicalEditorPlugin,
16711
16754
  versioningPlugin
16712
16755
  ];
16713
16756
  const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
16714
- const wirePlugins = chunk5UXU3LP4_cjs.createPluginWirer(
16757
+ const wirePlugins = chunkMGHHPNJN_cjs.createPluginWirer(
16715
16758
  () => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
16716
16759
  // The capability-gated `ctx.cap.email` resolves to the app EmailService, which
16717
16760
  // is initialized (below) just before wiring on the first request.
16718
16761
  () => ({
16719
16762
  hooks: hookSystem,
16720
16763
  env: firstRequestEnv,
16721
- providers: { email: () => chunk7RUW244J_cjs.getEmailService() }
16764
+ providers: { email: () => chunkJFLZHOQP_cjs.getEmailService() }
16722
16765
  })
16723
16766
  );
16724
16767
  let firstRequestEnv;
16725
16768
  const initEmailService = async (env = {}) => {
16726
- if (chunk7RUW244J_cjs.hasEmailService()) return;
16769
+ if (chunkJFLZHOQP_cjs.hasEmailService()) return;
16727
16770
  let provider;
16728
16771
  let defaultFrom = config.email?.from;
16729
16772
  let defaultReplyTo;
@@ -16758,14 +16801,14 @@ function createSonicJSApp(config = {}) {
16758
16801
  }
16759
16802
  }
16760
16803
  defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
16761
- chunk7RUW244J_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16804
+ chunkJFLZHOQP_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16762
16805
  };
16763
16806
  app2.use("*", async (c, next) => {
16764
16807
  c.set("appVersion", appVersion);
16765
16808
  await next();
16766
16809
  });
16767
- app2.use("*", chunkFCLKX2OS_cjs.metricsMiddleware());
16768
- app2.use("*", chunkFCLKX2OS_cjs.bootstrapMiddleware(config));
16810
+ app2.use("*", chunkFTXGZ3BF_cjs.metricsMiddleware());
16811
+ app2.use("*", chunkFTXGZ3BF_cjs.bootstrapMiddleware(config));
16769
16812
  const boot = async (env) => {
16770
16813
  if (config.plugins?.disableAll) return;
16771
16814
  firstRequestEnv = env;
@@ -16803,8 +16846,8 @@ function createSonicJSApp(config = {}) {
16803
16846
  allowHeaders: ["Content-Type", "Authorization", "X-API-Key"],
16804
16847
  credentials: true
16805
16848
  }));
16806
- app2.use("*", chunkFCLKX2OS_cjs.securityHeadersMiddleware());
16807
- app2.use("*", chunkFCLKX2OS_cjs.csrfProtection());
16849
+ app2.use("*", chunkFTXGZ3BF_cjs.securityHeadersMiddleware());
16850
+ app2.use("*", chunkFTXGZ3BF_cjs.csrfProtection());
16808
16851
  app2.use("*", async (c, next) => {
16809
16852
  try {
16810
16853
  const reqUrl = new URL(c.req.url);
@@ -16842,9 +16885,9 @@ function createSonicJSApp(config = {}) {
16842
16885
  app2.use("*", middleware);
16843
16886
  }
16844
16887
  }
16845
- app2.use("*", chunkKVBHB7QP_cjs.tenantMiddleware());
16846
- app2.use("/admin/*", chunkFCLKX2OS_cjs.requireAuth());
16847
- app2.use("/admin/*", chunkFCLKX2OS_cjs.requireRbac("portal", "access"));
16888
+ app2.use("*", chunkPYZYU7EK_cjs.tenantMiddleware());
16889
+ app2.use("/admin/*", chunkFTXGZ3BF_cjs.requireAuth());
16890
+ app2.use("/admin/*", chunkFTXGZ3BF_cjs.requireRbac("portal", "access"));
16848
16891
  app2.use("/admin/*", pluginMenuMiddleware());
16849
16892
  const NAV_LANDING = [
16850
16893
  { path: "/admin/content", perm: "content:read" },
@@ -16890,43 +16933,43 @@ function createSonicJSApp(config = {}) {
16890
16933
  });
16891
16934
  app2.route("/api/security-audit", apiRoutes2);
16892
16935
  app2.route("/admin/plugins/security-audit", adminRoutes3);
16893
- app2.route("/api/media", chunk7RUW244J_cjs.api_media_default);
16894
- app2.route("/api/system", chunk7RUW244J_cjs.api_system_default);
16895
- app2.route("/api/documents", chunk7RUW244J_cjs.apiDocumentsRoutes);
16896
- app2.route("/api", chunk7RUW244J_cjs.api_default);
16897
- app2.route("/admin/documents", chunk7RUW244J_cjs.adminDocumentsRoutes);
16898
- chunk5UXU3LP4_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16899
- app2.route("/admin/api", chunk7RUW244J_cjs.admin_api_default);
16900
- app2.route("/admin/collections", chunk7RUW244J_cjs.adminCollectionsRoutes);
16901
- app2.route("/admin/settings", chunk7RUW244J_cjs.adminSettingsRoutes);
16902
- app2.route("/admin/api-reference", chunk7RUW244J_cjs.router2);
16936
+ app2.route("/api/media", chunkJFLZHOQP_cjs.api_media_default);
16937
+ app2.route("/api/system", chunkJFLZHOQP_cjs.api_system_default);
16938
+ app2.route("/api/documents", chunkJFLZHOQP_cjs.apiDocumentsRoutes);
16939
+ app2.route("/api", chunkJFLZHOQP_cjs.api_default);
16940
+ app2.route("/admin/documents", chunkJFLZHOQP_cjs.adminDocumentsRoutes);
16941
+ chunkMGHHPNJN_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16942
+ app2.route("/admin/api", chunkJFLZHOQP_cjs.admin_api_default);
16943
+ app2.route("/admin/collections", chunkJFLZHOQP_cjs.adminCollectionsRoutes);
16944
+ app2.route("/admin/settings", chunkJFLZHOQP_cjs.adminSettingsRoutes);
16945
+ app2.route("/admin/api-reference", chunkJFLZHOQP_cjs.router2);
16903
16946
  app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
16904
- app2.route("/admin/content", chunk7RUW244J_cjs.admin_content_default);
16905
- app2.route("/admin/media", chunk7RUW244J_cjs.adminMediaRoutes);
16947
+ app2.route("/admin/content", chunkJFLZHOQP_cjs.admin_content_default);
16948
+ app2.route("/admin/media", chunkJFLZHOQP_cjs.adminMediaRoutes);
16906
16949
  app2.use("/auth/*", securityAuditMiddleware());
16907
16950
  if (!config.plugins?.disableAll) {
16908
- chunk5UXU3LP4_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16951
+ chunkMGHHPNJN_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16909
16952
  app2.route("/admin/cache", cache_default.getRoutes());
16910
16953
  if (config.plugins?.register && config.plugins.register.length > 0) {
16911
- chunk5UXU3LP4_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16954
+ chunkMGHHPNJN_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16912
16955
  }
16913
16956
  }
16914
16957
  app2.route("/api/events", apiRoutes4);
16915
- app2.route("/admin/dashboard", chunk7RUW244J_cjs.router);
16916
- app2.route("/admin/plugins", chunk7RUW244J_cjs.adminPluginRoutes);
16917
- app2.route("/admin/logs", chunk7RUW244J_cjs.adminLogsRoutes);
16958
+ app2.route("/admin/dashboard", chunkJFLZHOQP_cjs.router);
16959
+ app2.route("/admin/plugins", chunkJFLZHOQP_cjs.adminPluginRoutes);
16960
+ app2.route("/admin/logs", chunkJFLZHOQP_cjs.adminLogsRoutes);
16918
16961
  app2.route("/admin/rbac", adminRbacRoutes);
16919
- app2.route("/admin", chunk7RUW244J_cjs.userRoutes);
16920
- app2.route("/auth", chunk7RUW244J_cjs.auth_default);
16962
+ app2.route("/admin", chunkJFLZHOQP_cjs.userRoutes);
16963
+ app2.route("/auth", chunkJFLZHOQP_cjs.auth_default);
16921
16964
  app2.on(["GET", "POST"], "/auth/*", (c) => {
16922
16965
  const reqUrl = new URL(c.req.url);
16923
16966
  const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
16924
16967
  const auth = chunkGMMCCIQO_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
16925
16968
  return auth.handler(c.req.raw);
16926
16969
  });
16927
- app2.route("/", chunk7RUW244J_cjs.test_cleanup_default);
16970
+ app2.route("/", chunkJFLZHOQP_cjs.test_cleanup_default);
16928
16971
  if (!config.plugins?.disableAll) {
16929
- chunk5UXU3LP4_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16972
+ chunkMGHHPNJN_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16930
16973
  }
16931
16974
  if (!config.plugins?.disableAll) {
16932
16975
  const allMountedPlugins = [
@@ -16936,10 +16979,10 @@ function createSonicJSApp(config = {}) {
16936
16979
  ...config.plugins?.register ?? []
16937
16980
  ];
16938
16981
  const userPlugins = (config.plugins?.register ?? []).filter(
16939
- (p) => !chunkKVBHB7QP_cjs.PLUGIN_REGISTRY[p.id]
16982
+ (p) => !chunkPYZYU7EK_cjs.PLUGIN_REGISTRY[p.id]
16940
16983
  );
16941
- chunk5UXU3LP4_cjs.setPluginMenu(userPlugins.flatMap((p) => p.menu ?? []));
16942
- chunkA4KUJ3LD_cjs.setPluginDefinitions(allMountedPlugins);
16984
+ chunkMGHHPNJN_cjs.setPluginMenu(userPlugins.flatMap((p) => p.menu ?? []));
16985
+ chunkEUJAEB6W_cjs.setPluginDefinitions(allMountedPlugins);
16943
16986
  }
16944
16987
  app2.get("/favicon.svg", (c) => {
16945
16988
  return new Response(faviconSvg, {
@@ -20433,7 +20476,7 @@ function createRedirectApiRoutes() {
20433
20476
  });
20434
20477
  return api;
20435
20478
  }
20436
- var redirectPlugin = chunkA4KUJ3LD_cjs.definePlugin({
20479
+ var redirectPlugin = chunkEUJAEB6W_cjs.definePlugin({
20437
20480
  id: manifest_default3.id,
20438
20481
  version: manifest_default3.version,
20439
20482
  name: manifest_default3.name,
@@ -20451,7 +20494,7 @@ var redirectPlugin = chunkA4KUJ3LD_cjs.definePlugin({
20451
20494
  async onBoot(ctx) {
20452
20495
  const db = ctx.env?.DB;
20453
20496
  if (!db) return;
20454
- const registry = new chunkFCLKX2OS_cjs.DocumentTypeRegistry(db);
20497
+ const registry = new chunkFTXGZ3BF_cjs.DocumentTypeRegistry(db);
20455
20498
  await registry.register({
20456
20499
  id: "redirect",
20457
20500
  name: "redirect",
@@ -20567,91 +20610,91 @@ function createDb(d1$1) {
20567
20610
  }
20568
20611
 
20569
20612
  // src/index.ts
20570
- var VERSION = chunkAOUVUF32_cjs.package_default.version;
20613
+ var VERSION = chunkQWSR4THH_cjs.package_default.version;
20571
20614
 
20572
20615
  Object.defineProperty(exports, "DocumentRepository", {
20573
20616
  enumerable: true,
20574
- get: function () { return chunk7RUW244J_cjs.DocumentRepository; }
20617
+ get: function () { return chunkJFLZHOQP_cjs.DocumentRepository; }
20575
20618
  });
20576
20619
  Object.defineProperty(exports, "ROUTES_INFO", {
20577
20620
  enumerable: true,
20578
- get: function () { return chunk7RUW244J_cjs.ROUTES_INFO; }
20621
+ get: function () { return chunkJFLZHOQP_cjs.ROUTES_INFO; }
20579
20622
  });
20580
20623
  Object.defineProperty(exports, "adminApiRoutes", {
20581
20624
  enumerable: true,
20582
- get: function () { return chunk7RUW244J_cjs.admin_api_default; }
20625
+ get: function () { return chunkJFLZHOQP_cjs.admin_api_default; }
20583
20626
  });
20584
20627
  Object.defineProperty(exports, "adminCheckboxRoutes", {
20585
20628
  enumerable: true,
20586
- get: function () { return chunk7RUW244J_cjs.adminCheckboxRoutes; }
20629
+ get: function () { return chunkJFLZHOQP_cjs.adminCheckboxRoutes; }
20587
20630
  });
20588
20631
  Object.defineProperty(exports, "adminCollectionsRoutes", {
20589
20632
  enumerable: true,
20590
- get: function () { return chunk7RUW244J_cjs.adminCollectionsRoutes; }
20633
+ get: function () { return chunkJFLZHOQP_cjs.adminCollectionsRoutes; }
20591
20634
  });
20592
20635
  Object.defineProperty(exports, "adminContentRoutes", {
20593
20636
  enumerable: true,
20594
- get: function () { return chunk7RUW244J_cjs.admin_content_default; }
20637
+ get: function () { return chunkJFLZHOQP_cjs.admin_content_default; }
20595
20638
  });
20596
20639
  Object.defineProperty(exports, "adminDashboardRoutes", {
20597
20640
  enumerable: true,
20598
- get: function () { return chunk7RUW244J_cjs.router; }
20641
+ get: function () { return chunkJFLZHOQP_cjs.router; }
20599
20642
  });
20600
20643
  Object.defineProperty(exports, "adminLogsRoutes", {
20601
20644
  enumerable: true,
20602
- get: function () { return chunk7RUW244J_cjs.adminLogsRoutes; }
20645
+ get: function () { return chunkJFLZHOQP_cjs.adminLogsRoutes; }
20603
20646
  });
20604
20647
  Object.defineProperty(exports, "adminMediaRoutes", {
20605
20648
  enumerable: true,
20606
- get: function () { return chunk7RUW244J_cjs.adminMediaRoutes; }
20649
+ get: function () { return chunkJFLZHOQP_cjs.adminMediaRoutes; }
20607
20650
  });
20608
20651
  Object.defineProperty(exports, "adminPluginRoutes", {
20609
20652
  enumerable: true,
20610
- get: function () { return chunk7RUW244J_cjs.adminPluginRoutes; }
20653
+ get: function () { return chunkJFLZHOQP_cjs.adminPluginRoutes; }
20611
20654
  });
20612
20655
  Object.defineProperty(exports, "adminSettingsRoutes", {
20613
20656
  enumerable: true,
20614
- get: function () { return chunk7RUW244J_cjs.adminSettingsRoutes; }
20657
+ get: function () { return chunkJFLZHOQP_cjs.adminSettingsRoutes; }
20615
20658
  });
20616
20659
  Object.defineProperty(exports, "adminUsersRoutes", {
20617
20660
  enumerable: true,
20618
- get: function () { return chunk7RUW244J_cjs.userRoutes; }
20661
+ get: function () { return chunkJFLZHOQP_cjs.userRoutes; }
20619
20662
  });
20620
20663
  Object.defineProperty(exports, "apiContentCrudRoutes", {
20621
20664
  enumerable: true,
20622
- get: function () { return chunk7RUW244J_cjs.api_content_crud_default; }
20665
+ get: function () { return chunkJFLZHOQP_cjs.api_content_crud_default; }
20623
20666
  });
20624
20667
  Object.defineProperty(exports, "apiMediaRoutes", {
20625
20668
  enumerable: true,
20626
- get: function () { return chunk7RUW244J_cjs.api_media_default; }
20669
+ get: function () { return chunkJFLZHOQP_cjs.api_media_default; }
20627
20670
  });
20628
20671
  Object.defineProperty(exports, "apiRoutes", {
20629
20672
  enumerable: true,
20630
- get: function () { return chunk7RUW244J_cjs.api_default; }
20673
+ get: function () { return chunkJFLZHOQP_cjs.api_default; }
20631
20674
  });
20632
20675
  Object.defineProperty(exports, "apiSystemRoutes", {
20633
20676
  enumerable: true,
20634
- get: function () { return chunk7RUW244J_cjs.api_system_default; }
20677
+ get: function () { return chunkJFLZHOQP_cjs.api_system_default; }
20635
20678
  });
20636
20679
  Object.defineProperty(exports, "authRoutes", {
20637
20680
  enumerable: true,
20638
- get: function () { return chunk7RUW244J_cjs.auth_default; }
20681
+ get: function () { return chunkJFLZHOQP_cjs.auth_default; }
20639
20682
  });
20640
20683
  Object.defineProperty(exports, "createUserProfilesPlugin", {
20641
20684
  enumerable: true,
20642
- get: function () { return chunk7RUW244J_cjs.createUserProfilesPlugin; }
20685
+ get: function () { return chunkJFLZHOQP_cjs.createUserProfilesPlugin; }
20643
20686
  });
20644
20687
  Object.defineProperty(exports, "defineUserProfile", {
20645
20688
  enumerable: true,
20646
- get: function () { return chunk7RUW244J_cjs.defineUserProfile; }
20689
+ get: function () { return chunkJFLZHOQP_cjs.defineUserProfile; }
20647
20690
  });
20648
20691
  Object.defineProperty(exports, "getUserProfileConfig", {
20649
20692
  enumerable: true,
20650
- get: function () { return chunk7RUW244J_cjs.getUserProfileConfig; }
20693
+ get: function () { return chunkJFLZHOQP_cjs.getUserProfileConfig; }
20651
20694
  });
20652
20695
  Object.defineProperty(exports, "userProfilesPlugin", {
20653
20696
  enumerable: true,
20654
- get: function () { return chunk7RUW244J_cjs.userProfilesPlugin; }
20697
+ get: function () { return chunkJFLZHOQP_cjs.userProfilesPlugin; }
20655
20698
  });
20656
20699
  Object.defineProperty(exports, "Logger", {
20657
20700
  enumerable: true,
@@ -20807,87 +20850,87 @@ Object.defineProperty(exports, "workflowHistory", {
20807
20850
  });
20808
20851
  Object.defineProperty(exports, "AuthManager", {
20809
20852
  enumerable: true,
20810
- get: function () { return chunkFCLKX2OS_cjs.AuthManager; }
20853
+ get: function () { return chunkFTXGZ3BF_cjs.AuthManager; }
20811
20854
  });
20812
20855
  Object.defineProperty(exports, "PermissionManager", {
20813
20856
  enumerable: true,
20814
- get: function () { return chunkFCLKX2OS_cjs.PermissionManager; }
20857
+ get: function () { return chunkFTXGZ3BF_cjs.PermissionManager; }
20815
20858
  });
20816
20859
  Object.defineProperty(exports, "bootstrapDocumentTypes", {
20817
20860
  enumerable: true,
20818
- get: function () { return chunkFCLKX2OS_cjs.bootstrapDocumentTypes; }
20861
+ get: function () { return chunkFTXGZ3BF_cjs.bootstrapDocumentTypes; }
20819
20862
  });
20820
20863
  Object.defineProperty(exports, "bootstrapMiddleware", {
20821
20864
  enumerable: true,
20822
- get: function () { return chunkFCLKX2OS_cjs.bootstrapMiddleware; }
20865
+ get: function () { return chunkFTXGZ3BF_cjs.bootstrapMiddleware; }
20823
20866
  });
20824
20867
  Object.defineProperty(exports, "cacheHeaders", {
20825
20868
  enumerable: true,
20826
- get: function () { return chunkFCLKX2OS_cjs.cacheHeaders; }
20869
+ get: function () { return chunkFTXGZ3BF_cjs.cacheHeaders; }
20827
20870
  });
20828
20871
  Object.defineProperty(exports, "compressionMiddleware", {
20829
20872
  enumerable: true,
20830
- get: function () { return chunkFCLKX2OS_cjs.compressionMiddleware; }
20873
+ get: function () { return chunkFTXGZ3BF_cjs.compressionMiddleware; }
20831
20874
  });
20832
20875
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
20833
20876
  enumerable: true,
20834
- get: function () { return chunkFCLKX2OS_cjs.detailedLoggingMiddleware; }
20877
+ get: function () { return chunkFTXGZ3BF_cjs.detailedLoggingMiddleware; }
20835
20878
  });
20836
20879
  Object.defineProperty(exports, "getActivePlugins", {
20837
20880
  enumerable: true,
20838
- get: function () { return chunkFCLKX2OS_cjs.getActivePlugins; }
20881
+ get: function () { return chunkFTXGZ3BF_cjs.getActivePlugins; }
20839
20882
  });
20840
20883
  Object.defineProperty(exports, "isPluginActive", {
20841
20884
  enumerable: true,
20842
- get: function () { return chunkFCLKX2OS_cjs.isPluginActive; }
20885
+ get: function () { return chunkFTXGZ3BF_cjs.isPluginActive; }
20843
20886
  });
20844
20887
  Object.defineProperty(exports, "logActivity", {
20845
20888
  enumerable: true,
20846
- get: function () { return chunkFCLKX2OS_cjs.logActivity; }
20889
+ get: function () { return chunkFTXGZ3BF_cjs.logActivity; }
20847
20890
  });
20848
20891
  Object.defineProperty(exports, "loggingMiddleware", {
20849
20892
  enumerable: true,
20850
- get: function () { return chunkFCLKX2OS_cjs.loggingMiddleware; }
20893
+ get: function () { return chunkFTXGZ3BF_cjs.loggingMiddleware; }
20851
20894
  });
20852
20895
  Object.defineProperty(exports, "optionalAuth", {
20853
20896
  enumerable: true,
20854
- get: function () { return chunkFCLKX2OS_cjs.optionalAuth; }
20897
+ get: function () { return chunkFTXGZ3BF_cjs.optionalAuth; }
20855
20898
  });
20856
20899
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
20857
20900
  enumerable: true,
20858
- get: function () { return chunkFCLKX2OS_cjs.performanceLoggingMiddleware; }
20901
+ get: function () { return chunkFTXGZ3BF_cjs.performanceLoggingMiddleware; }
20859
20902
  });
20860
20903
  Object.defineProperty(exports, "requireActivePlugin", {
20861
20904
  enumerable: true,
20862
- get: function () { return chunkFCLKX2OS_cjs.requireActivePlugin; }
20905
+ get: function () { return chunkFTXGZ3BF_cjs.requireActivePlugin; }
20863
20906
  });
20864
20907
  Object.defineProperty(exports, "requireActivePlugins", {
20865
20908
  enumerable: true,
20866
- get: function () { return chunkFCLKX2OS_cjs.requireActivePlugins; }
20909
+ get: function () { return chunkFTXGZ3BF_cjs.requireActivePlugins; }
20867
20910
  });
20868
20911
  Object.defineProperty(exports, "requireAnyPermission", {
20869
20912
  enumerable: true,
20870
- get: function () { return chunkFCLKX2OS_cjs.requireAnyPermission; }
20913
+ get: function () { return chunkFTXGZ3BF_cjs.requireAnyPermission; }
20871
20914
  });
20872
20915
  Object.defineProperty(exports, "requireAuth", {
20873
20916
  enumerable: true,
20874
- get: function () { return chunkFCLKX2OS_cjs.requireAuth; }
20917
+ get: function () { return chunkFTXGZ3BF_cjs.requireAuth; }
20875
20918
  });
20876
20919
  Object.defineProperty(exports, "requirePermission", {
20877
20920
  enumerable: true,
20878
- get: function () { return chunkFCLKX2OS_cjs.requirePermission; }
20921
+ get: function () { return chunkFTXGZ3BF_cjs.requirePermission; }
20879
20922
  });
20880
20923
  Object.defineProperty(exports, "requireRole", {
20881
20924
  enumerable: true,
20882
- get: function () { return chunkFCLKX2OS_cjs.requireRole; }
20925
+ get: function () { return chunkFTXGZ3BF_cjs.requireRole; }
20883
20926
  });
20884
20927
  Object.defineProperty(exports, "securityHeaders", {
20885
20928
  enumerable: true,
20886
- get: function () { return chunkFCLKX2OS_cjs.securityHeadersMiddleware; }
20929
+ get: function () { return chunkFTXGZ3BF_cjs.securityHeadersMiddleware; }
20887
20930
  });
20888
20931
  Object.defineProperty(exports, "securityLoggingMiddleware", {
20889
20932
  enumerable: true,
20890
- get: function () { return chunkFCLKX2OS_cjs.securityLoggingMiddleware; }
20933
+ get: function () { return chunkFTXGZ3BF_cjs.securityLoggingMiddleware; }
20891
20934
  });
20892
20935
  Object.defineProperty(exports, "DocumentsService", {
20893
20936
  enumerable: true,
@@ -20899,35 +20942,35 @@ Object.defineProperty(exports, "RbacService", {
20899
20942
  });
20900
20943
  Object.defineProperty(exports, "PluginBootstrapService", {
20901
20944
  enumerable: true,
20902
- get: function () { return chunkKVBHB7QP_cjs.PluginBootstrapService; }
20945
+ get: function () { return chunkPYZYU7EK_cjs.PluginBootstrapService; }
20903
20946
  });
20904
20947
  Object.defineProperty(exports, "PluginServiceClass", {
20905
20948
  enumerable: true,
20906
- get: function () { return chunkKVBHB7QP_cjs.PluginService; }
20949
+ get: function () { return chunkPYZYU7EK_cjs.PluginService; }
20907
20950
  });
20908
20951
  Object.defineProperty(exports, "getAvailableCollectionNames", {
20909
20952
  enumerable: true,
20910
- get: function () { return chunkKVBHB7QP_cjs.getAvailableCollectionNames; }
20953
+ get: function () { return chunkPYZYU7EK_cjs.getAvailableCollectionNames; }
20911
20954
  });
20912
20955
  Object.defineProperty(exports, "loadCollectionConfig", {
20913
20956
  enumerable: true,
20914
- get: function () { return chunkKVBHB7QP_cjs.loadCollectionConfig; }
20957
+ get: function () { return chunkPYZYU7EK_cjs.loadCollectionConfig; }
20915
20958
  });
20916
20959
  Object.defineProperty(exports, "loadCollectionConfigs", {
20917
20960
  enumerable: true,
20918
- get: function () { return chunkKVBHB7QP_cjs.loadCollectionConfigs; }
20961
+ get: function () { return chunkPYZYU7EK_cjs.loadCollectionConfigs; }
20919
20962
  });
20920
20963
  Object.defineProperty(exports, "registerCollections", {
20921
20964
  enumerable: true,
20922
- get: function () { return chunkKVBHB7QP_cjs.registerCollections; }
20965
+ get: function () { return chunkPYZYU7EK_cjs.registerCollections; }
20923
20966
  });
20924
20967
  Object.defineProperty(exports, "validateCollectionConfig", {
20925
20968
  enumerable: true,
20926
- get: function () { return chunkKVBHB7QP_cjs.validateCollectionConfig; }
20969
+ get: function () { return chunkPYZYU7EK_cjs.validateCollectionConfig; }
20927
20970
  });
20928
20971
  Object.defineProperty(exports, "MigrationService", {
20929
20972
  enumerable: true,
20930
- get: function () { return chunkOJC4G5JE_cjs.MigrationService; }
20973
+ get: function () { return chunk3CT3SUR4_cjs.MigrationService; }
20931
20974
  });
20932
20975
  Object.defineProperty(exports, "renderFilterBar", {
20933
20976
  enumerable: true,
@@ -20967,99 +21010,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
20967
21010
  });
20968
21011
  Object.defineProperty(exports, "HookSystemImpl", {
20969
21012
  enumerable: true,
20970
- get: function () { return chunk5UXU3LP4_cjs.HookSystemImpl; }
21013
+ get: function () { return chunkMGHHPNJN_cjs.HookSystemImpl; }
20971
21014
  });
20972
21015
  Object.defineProperty(exports, "HookUtils", {
20973
21016
  enumerable: true,
20974
- get: function () { return chunk5UXU3LP4_cjs.HookUtils; }
21017
+ get: function () { return chunkMGHHPNJN_cjs.HookUtils; }
20975
21018
  });
20976
21019
  Object.defineProperty(exports, "PluginDependencyCycleError", {
20977
21020
  enumerable: true,
20978
- get: function () { return chunk5UXU3LP4_cjs.PluginDependencyCycleError; }
21021
+ get: function () { return chunkMGHHPNJN_cjs.PluginDependencyCycleError; }
20979
21022
  });
20980
21023
  Object.defineProperty(exports, "PluginManagerClass", {
20981
21024
  enumerable: true,
20982
- get: function () { return chunk5UXU3LP4_cjs.PluginManager; }
21025
+ get: function () { return chunkMGHHPNJN_cjs.PluginManager; }
20983
21026
  });
20984
21027
  Object.defineProperty(exports, "PluginRegistryImpl", {
20985
21028
  enumerable: true,
20986
- get: function () { return chunk5UXU3LP4_cjs.PluginRegistryImpl; }
21029
+ get: function () { return chunkMGHHPNJN_cjs.PluginRegistryImpl; }
20987
21030
  });
20988
21031
  Object.defineProperty(exports, "PluginValidatorClass", {
20989
21032
  enumerable: true,
20990
- get: function () { return chunk5UXU3LP4_cjs.PluginValidator; }
21033
+ get: function () { return chunkMGHHPNJN_cjs.PluginValidator; }
20991
21034
  });
20992
21035
  Object.defineProperty(exports, "RegisterPluginsError", {
20993
21036
  enumerable: true,
20994
- get: function () { return chunk5UXU3LP4_cjs.RegisterPluginsError; }
21037
+ get: function () { return chunkMGHHPNJN_cjs.RegisterPluginsError; }
20995
21038
  });
20996
21039
  Object.defineProperty(exports, "ScopedHookSystemClass", {
20997
21040
  enumerable: true,
20998
- get: function () { return chunk5UXU3LP4_cjs.ScopedHookSystem; }
21041
+ get: function () { return chunkMGHHPNJN_cjs.ScopedHookSystem; }
20999
21042
  });
21000
21043
  Object.defineProperty(exports, "collectCronSchedules", {
21001
21044
  enumerable: true,
21002
- get: function () { return chunk5UXU3LP4_cjs.collectCronSchedules; }
21045
+ get: function () { return chunkMGHHPNJN_cjs.collectCronSchedules; }
21003
21046
  });
21004
21047
  Object.defineProperty(exports, "collectCrons", {
21005
21048
  enumerable: true,
21006
- get: function () { return chunk5UXU3LP4_cjs.collectCrons; }
21049
+ get: function () { return chunkMGHHPNJN_cjs.collectCrons; }
21007
21050
  });
21008
21051
  Object.defineProperty(exports, "createScheduledHandler", {
21009
21052
  enumerable: true,
21010
- get: function () { return chunk5UXU3LP4_cjs.createScheduledHandler; }
21053
+ get: function () { return chunkMGHHPNJN_cjs.createScheduledHandler; }
21011
21054
  });
21012
21055
  Object.defineProperty(exports, "dispatchCronTick", {
21013
21056
  enumerable: true,
21014
- get: function () { return chunk5UXU3LP4_cjs.dispatchCronTick; }
21057
+ get: function () { return chunkMGHHPNJN_cjs.dispatchCronTick; }
21015
21058
  });
21016
21059
  Object.defineProperty(exports, "getPluginMenu", {
21017
21060
  enumerable: true,
21018
- get: function () { return chunk5UXU3LP4_cjs.getPluginMenu; }
21061
+ get: function () { return chunkMGHHPNJN_cjs.getPluginMenu; }
21019
21062
  });
21020
21063
  Object.defineProperty(exports, "registerPlugins", {
21021
21064
  enumerable: true,
21022
- get: function () { return chunk5UXU3LP4_cjs.registerPlugins; }
21065
+ get: function () { return chunkMGHHPNJN_cjs.registerPlugins; }
21023
21066
  });
21024
21067
  Object.defineProperty(exports, "resetPluginMenu", {
21025
21068
  enumerable: true,
21026
- get: function () { return chunk5UXU3LP4_cjs.resetPluginMenu; }
21069
+ get: function () { return chunkMGHHPNJN_cjs.resetPluginMenu; }
21027
21070
  });
21028
21071
  Object.defineProperty(exports, "resolvePluginMenuItems", {
21029
21072
  enumerable: true,
21030
- get: function () { return chunk5UXU3LP4_cjs.resolvePluginMenuItems; }
21073
+ get: function () { return chunkMGHHPNJN_cjs.resolvePluginMenuItems; }
21031
21074
  });
21032
21075
  Object.defineProperty(exports, "setPluginMenu", {
21033
21076
  enumerable: true,
21034
- get: function () { return chunk5UXU3LP4_cjs.setPluginMenu; }
21077
+ get: function () { return chunkMGHHPNJN_cjs.setPluginMenu; }
21035
21078
  });
21036
21079
  Object.defineProperty(exports, "topoSort", {
21037
21080
  enumerable: true,
21038
- get: function () { return chunk5UXU3LP4_cjs.topoSort; }
21081
+ get: function () { return chunkMGHHPNJN_cjs.topoSort; }
21039
21082
  });
21040
21083
  Object.defineProperty(exports, "applySchemaDefaults", {
21041
21084
  enumerable: true,
21042
- get: function () { return chunkA4KUJ3LD_cjs.applySchemaDefaults; }
21085
+ get: function () { return chunkEUJAEB6W_cjs.applySchemaDefaults; }
21043
21086
  });
21044
21087
  Object.defineProperty(exports, "definePlugin", {
21045
21088
  enumerable: true,
21046
- get: function () { return chunkA4KUJ3LD_cjs.definePlugin; }
21089
+ get: function () { return chunkEUJAEB6W_cjs.definePlugin; }
21047
21090
  });
21048
21091
  Object.defineProperty(exports, "isDefinedPlugin", {
21049
21092
  enumerable: true,
21050
- get: function () { return chunkA4KUJ3LD_cjs.isDefinedPlugin; }
21093
+ get: function () { return chunkEUJAEB6W_cjs.isDefinedPlugin; }
21051
21094
  });
21052
21095
  Object.defineProperty(exports, "parseConfigSchema", {
21053
21096
  enumerable: true,
21054
- get: function () { return chunkA4KUJ3LD_cjs.parseConfigSchema; }
21097
+ get: function () { return chunkEUJAEB6W_cjs.parseConfigSchema; }
21055
21098
  });
21056
21099
  Object.defineProperty(exports, "parseFormDataToSettings", {
21057
21100
  enumerable: true,
21058
- get: function () { return chunkA4KUJ3LD_cjs.parseFormDataToSettings; }
21101
+ get: function () { return chunkEUJAEB6W_cjs.parseFormDataToSettings; }
21059
21102
  });
21060
21103
  Object.defineProperty(exports, "renderSchemaFields", {
21061
21104
  enumerable: true,
21062
- get: function () { return chunkA4KUJ3LD_cjs.renderSchemaFields; }
21105
+ get: function () { return chunkEUJAEB6W_cjs.renderSchemaFields; }
21063
21106
  });
21064
21107
  Object.defineProperty(exports, "getHookSystem", {
21065
21108
  enumerable: true,
@@ -21107,11 +21150,11 @@ Object.defineProperty(exports, "metricsTracker", {
21107
21150
  });
21108
21151
  Object.defineProperty(exports, "SONICJS_VERSION", {
21109
21152
  enumerable: true,
21110
- get: function () { return chunkAOUVUF32_cjs.SONICJS_VERSION; }
21153
+ get: function () { return chunkQWSR4THH_cjs.SONICJS_VERSION; }
21111
21154
  });
21112
21155
  Object.defineProperty(exports, "getCoreVersion", {
21113
21156
  enumerable: true,
21114
- get: function () { return chunkAOUVUF32_cjs.getCoreVersion; }
21157
+ get: function () { return chunkQWSR4THH_cjs.getCoreVersion; }
21115
21158
  });
21116
21159
  Object.defineProperty(exports, "escapeHtml", {
21117
21160
  enumerable: true,