@sonicjs-cms/core 3.0.0-beta.11 → 3.0.0-beta.12

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 (49) hide show
  1. package/dist/{chunk-ZUEIQFE5.js → chunk-ALNODOY4.js} +3 -3
  2. package/dist/{chunk-ZUEIQFE5.js.map → chunk-ALNODOY4.js.map} +1 -1
  3. package/dist/{chunk-YJEBDJDV.cjs → chunk-BYLQOBO6.cjs} +13 -13
  4. package/dist/{chunk-YJEBDJDV.cjs.map → chunk-BYLQOBO6.cjs.map} +1 -1
  5. package/dist/{chunk-3PU4WVU6.js → chunk-DMXDQ5YI.js} +4 -4
  6. package/dist/{chunk-3PU4WVU6.js.map → chunk-DMXDQ5YI.js.map} +1 -1
  7. package/dist/{chunk-6H66MSSL.js → chunk-INKP2WNU.js} +2 -2
  8. package/dist/{chunk-6H66MSSL.js.map → chunk-INKP2WNU.js.map} +1 -1
  9. package/dist/{chunk-ORF4CT74.cjs → chunk-KI5KMJH2.cjs} +2 -2
  10. package/dist/{chunk-ORF4CT74.cjs.map → chunk-KI5KMJH2.cjs.map} +1 -1
  11. package/dist/{chunk-QJNKSFDJ.cjs → chunk-LLWLHFTD.cjs} +2 -2
  12. package/dist/{chunk-QJNKSFDJ.cjs.map → chunk-LLWLHFTD.cjs.map} +1 -1
  13. package/dist/{chunk-UHRHZXVR.cjs → chunk-NYLWNR6T.cjs} +4 -4
  14. package/dist/{chunk-UHRHZXVR.cjs.map → chunk-NYLWNR6T.cjs.map} +1 -1
  15. package/dist/{chunk-PDYRDYXI.js → chunk-Q3P7Y5VO.js} +4 -4
  16. package/dist/{chunk-PDYRDYXI.js.map → chunk-Q3P7Y5VO.js.map} +1 -1
  17. package/dist/{chunk-SXLVXD2X.js → chunk-R2O6TTQS.js} +9 -20
  18. package/dist/{chunk-K342JMA3.cjs.map → chunk-R2O6TTQS.js.map} +1 -1
  19. package/dist/{chunk-QLFTG3QJ.js → chunk-SUHGXAII.js} +2 -2
  20. package/dist/{chunk-QLFTG3QJ.js.map → chunk-SUHGXAII.js.map} +1 -1
  21. package/dist/{chunk-MKKGA3C4.cjs → chunk-SY7CBACS.cjs} +10 -10
  22. package/dist/{chunk-MKKGA3C4.cjs.map → chunk-SY7CBACS.cjs.map} +1 -1
  23. package/dist/{chunk-K342JMA3.cjs → chunk-TV7LRFXH.cjs} +200 -211
  24. package/dist/{chunk-SXLVXD2X.js.map → chunk-TV7LRFXH.cjs.map} +1 -1
  25. package/dist/{chunk-KV3CM5RK.cjs → chunk-XGH2FVVR.cjs} +3 -3
  26. package/dist/{chunk-KV3CM5RK.cjs.map → chunk-XGH2FVVR.cjs.map} +1 -1
  27. package/dist/{chunk-HPAJKZAQ.js → chunk-XHBEFQJ3.js} +3 -3
  28. package/dist/{chunk-HPAJKZAQ.js.map → chunk-XHBEFQJ3.js.map} +1 -1
  29. package/dist/index.cjs +283 -252
  30. package/dist/index.cjs.map +1 -1
  31. package/dist/index.js +44 -13
  32. package/dist/index.js.map +1 -1
  33. package/dist/middleware.cjs +32 -32
  34. package/dist/middleware.js +3 -3
  35. package/dist/migrations-AFSCRO56.cjs +13 -0
  36. package/dist/{migrations-ZXJEUTFA.cjs.map → migrations-AFSCRO56.cjs.map} +1 -1
  37. package/dist/migrations-MLBACCPF.js +4 -0
  38. package/dist/{migrations-XQLBY7E5.js.map → migrations-MLBACCPF.js.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/migrations-XQLBY7E5.js +0 -4
  49. package/dist/migrations-ZXJEUTFA.cjs +0 -13
package/dist/index.cjs CHANGED
@@ -1,31 +1,32 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkNUKJ54GA_cjs = require('./chunk-NUKJ54GA.cjs');
4
- var chunkK342JMA3_cjs = require('./chunk-K342JMA3.cjs');
4
+ var chunkTV7LRFXH_cjs = require('./chunk-TV7LRFXH.cjs');
5
5
  require('./chunk-HIKBY7MS.cjs');
6
6
  require('./chunk-N32OWET6.cjs');
7
7
  var chunk4BTBSXMR_cjs = require('./chunk-4BTBSXMR.cjs');
8
8
  var chunkYA3TJ65D_cjs = require('./chunk-YA3TJ65D.cjs');
9
9
  var chunkYP7GW2G5_cjs = require('./chunk-YP7GW2G5.cjs');
10
- var chunkYJEBDJDV_cjs = require('./chunk-YJEBDJDV.cjs');
10
+ var chunkBYLQOBO6_cjs = require('./chunk-BYLQOBO6.cjs');
11
11
  var chunk2CB4KY7I_cjs = require('./chunk-2CB4KY7I.cjs');
12
12
  var chunkJEQ7FLOD_cjs = require('./chunk-JEQ7FLOD.cjs');
13
- var chunkQJNKSFDJ_cjs = require('./chunk-QJNKSFDJ.cjs');
14
- var chunkORF4CT74_cjs = require('./chunk-ORF4CT74.cjs');
13
+ var chunkLLWLHFTD_cjs = require('./chunk-LLWLHFTD.cjs');
14
+ var chunkKI5KMJH2_cjs = require('./chunk-KI5KMJH2.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 chunkMKKGA3C4_cjs = require('./chunk-MKKGA3C4.cjs');
19
- var chunkUHRHZXVR_cjs = require('./chunk-UHRHZXVR.cjs');
18
+ var chunkSY7CBACS_cjs = require('./chunk-SY7CBACS.cjs');
19
+ var chunkNYLWNR6T_cjs = require('./chunk-NYLWNR6T.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 chunkKV3CM5RK_cjs = require('./chunk-KV3CM5RK.cjs');
24
+ var chunkXGH2FVVR_cjs = require('./chunk-XGH2FVVR.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');
28
28
  var hono = require('hono');
29
+ var cors = require('hono/cors');
29
30
  var zod = require('zod');
30
31
  var cookie = require('hono/cookie');
31
32
  var html = require('hono/html');
@@ -573,7 +574,7 @@ function formatCellValue(value) {
573
574
  // src/plugins/core-plugins/database-tools-plugin/admin-routes.ts
574
575
  function createDatabaseToolsAdminRoutes() {
575
576
  const router3 = new hono.Hono();
576
- router3.use("*", chunkYJEBDJDV_cjs.requireAuth());
577
+ router3.use("*", chunkBYLQOBO6_cjs.requireAuth());
577
578
  router3.get("/api/stats", async (c) => {
578
579
  try {
579
580
  const user = c.get("user");
@@ -976,7 +977,7 @@ var SiteConfigService = class {
976
977
 
977
978
  // src/plugins/core-plugins/email-plugin/routes/admin.ts
978
979
  var adminRoutes = new hono.Hono();
979
- adminRoutes.use("*", chunkYJEBDJDV_cjs.requireAuth());
980
+ adminRoutes.use("*", chunkBYLQOBO6_cjs.requireAuth());
980
981
  adminRoutes.post("/settings", async (c) => {
981
982
  if (c.get("user")?.role !== "admin") {
982
983
  return c.json({ error: "admin role required" }, 403);
@@ -1014,7 +1015,7 @@ adminRoutes.post("/test", async (c) => {
1014
1015
  const { subject, html: html4, text } = renderTestEmail({ siteName });
1015
1016
  try {
1016
1017
  const settingsLoaded = await settings.load();
1017
- const result = await chunkK342JMA3_cjs.getEmailService().send({
1018
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1018
1019
  to,
1019
1020
  subject,
1020
1021
  html: html4,
@@ -1096,7 +1097,7 @@ function makeOnRegistrationCompleted(env) {
1096
1097
  siteName,
1097
1098
  loginUrl: siteConfig.buildLoginUrl(siteUrl)
1098
1099
  });
1099
- const result = await chunkK342JMA3_cjs.getEmailService().send({
1100
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1100
1101
  to: user.email,
1101
1102
  subject,
1102
1103
  html: html4,
@@ -1170,7 +1171,7 @@ function makeOnPasswordResetRequested(env) {
1170
1171
  expiresAt: Date.now() + DEFAULT_EXPIRY_MS,
1171
1172
  siteName
1172
1173
  });
1173
- const result = await chunkK342JMA3_cjs.getEmailService().send({
1174
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1174
1175
  to: user.email,
1175
1176
  subject,
1176
1177
  html: html4,
@@ -1238,7 +1239,7 @@ function makeOnPasswordResetCompleted(env) {
1238
1239
  supportEmail,
1239
1240
  when: Date.now()
1240
1241
  });
1241
- const result = await chunkK342JMA3_cjs.getEmailService().send({
1242
+ const result = await chunkTV7LRFXH_cjs.getEmailService().send({
1242
1243
  to: user.email,
1243
1244
  subject,
1244
1245
  html: html4,
@@ -1970,7 +1971,7 @@ var CloudflareEmailProvider = class {
1970
1971
  }
1971
1972
  }
1972
1973
  };
1973
- var emailPluginV3 = chunkUHRHZXVR_cjs.definePlugin({
1974
+ var emailPluginV3 = chunkNYLWNR6T_cjs.definePlugin({
1974
1975
  id: "email",
1975
1976
  version: "1.0.0",
1976
1977
  name: "Email",
@@ -1984,7 +1985,7 @@ var emailPluginV3 = chunkUHRHZXVR_cjs.definePlugin({
1984
1985
  const db = env.DB;
1985
1986
  if (db) {
1986
1987
  try {
1987
- const typeRegistry = new chunkYJEBDJDV_cjs.DocumentTypeRegistry(db);
1988
+ const typeRegistry = new chunkBYLQOBO6_cjs.DocumentTypeRegistry(db);
1988
1989
  await typeRegistry.register({
1989
1990
  id: "email_log",
1990
1991
  name: "email_log",
@@ -1999,7 +2000,7 @@ var emailPluginV3 = chunkUHRHZXVR_cjs.definePlugin({
1999
2000
  } catch {
2000
2001
  }
2001
2002
  }
2002
- if (!chunkK342JMA3_cjs.hasEmailService()) {
2003
+ if (!chunkTV7LRFXH_cjs.hasEmailService()) {
2003
2004
  const settings = db ? await new EmailSettingsService(db).load() : {};
2004
2005
  const envResendKey = typeof env.RESEND_API_KEY === "string" && env.RESEND_API_KEY ? env.RESEND_API_KEY : void 0;
2005
2006
  const cfEmailBinding = env.EMAIL;
@@ -2017,7 +2018,7 @@ var emailPluginV3 = chunkUHRHZXVR_cjs.definePlugin({
2017
2018
  } else {
2018
2019
  provider = resolveEmailProvider({ env });
2019
2020
  }
2020
- chunkK342JMA3_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2021
+ chunkTV7LRFXH_cjs.setEmailService(new EmailService({ ...serviceOpts, provider }));
2021
2022
  }
2022
2023
  ctx.hooks.on("auth:registration:completed", makeOnRegistrationCompleted(env));
2023
2024
  ctx.hooks.on("auth:password-reset:requested", makeOnPasswordResetRequested(env));
@@ -2028,7 +2029,7 @@ var emailPluginV3 = chunkUHRHZXVR_cjs.definePlugin({
2028
2029
  var BATCH_SIZE = 100;
2029
2030
  ({
2030
2031
  schema: zod.z.record(zod.z.string(), zod.z.unknown())});
2031
- var emailReconciliationPlugin = chunkUHRHZXVR_cjs.definePlugin({
2032
+ var emailReconciliationPlugin = chunkNYLWNR6T_cjs.definePlugin({
2032
2033
  id: "email-reconciliation",
2033
2034
  version: "1.0.0",
2034
2035
  description: "Hourly cron that backfills email delivery state from provider status APIs. Only active for providers that implement EmailProvider.reconcile().",
@@ -2049,11 +2050,11 @@ var emailReconciliationPlugin = chunkUHRHZXVR_cjs.definePlugin({
2049
2050
  console.warn("[email-reconciliation] No DB binding in cron env \u2014 skipping.");
2050
2051
  return;
2051
2052
  }
2052
- if (!chunkK342JMA3_cjs.hasEmailService()) {
2053
+ if (!chunkTV7LRFXH_cjs.hasEmailService()) {
2053
2054
  console.warn("[email-reconciliation] EmailService not initialized \u2014 skipping.");
2054
2055
  return;
2055
2056
  }
2056
- const emailService = chunkK342JMA3_cjs.getEmailService();
2057
+ const emailService = chunkTV7LRFXH_cjs.getEmailService();
2057
2058
  let rows = [];
2058
2059
  try {
2059
2060
  const result = await db.prepare(
@@ -2539,8 +2540,8 @@ function buildOtpApi() {
2539
2540
  loginUrl: settings.loginUrl || "",
2540
2541
  loginButtonText: settings.loginButtonText || ""
2541
2542
  });
2542
- if (chunkK342JMA3_cjs.hasEmailService()) {
2543
- const sent = await chunkK342JMA3_cjs.getEmailService().send({
2543
+ if (chunkTV7LRFXH_cjs.hasEmailService()) {
2544
+ const sent = await chunkTV7LRFXH_cjs.getEmailService().send({
2544
2545
  to: normalizedEmail,
2545
2546
  subject: `Your login code for ${siteName}`,
2546
2547
  flow: "otp",
@@ -2642,21 +2643,21 @@ function buildOtpApi() {
2642
2643
  error: "Account is deactivated"
2643
2644
  }, 403);
2644
2645
  }
2645
- const tokenTtl = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(db, c.env);
2646
- const token = await chunkYJEBDJDV_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2646
+ const tokenTtl = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(db, c.env);
2647
+ const token = await chunkBYLQOBO6_cjs.AuthManager.generateToken(user.id, user.email, user.role, c.env.JWT_SECRET, tokenTtl);
2647
2648
  cookie.setCookie(c, "auth_token", token, {
2648
2649
  httpOnly: true,
2649
2650
  secure: true,
2650
2651
  sameSite: "Strict",
2651
2652
  maxAge: tokenTtl
2652
2653
  });
2653
- chunkK342JMA3_cjs.dispatchHookEvent(
2654
+ chunkTV7LRFXH_cjs.dispatchHookEvent(
2654
2655
  c,
2655
2656
  "auth:otp:verified",
2656
2657
  { user: { id: user.id, email: user.email, role: user.role } },
2657
2658
  "fire-and-forget"
2658
2659
  );
2659
- const customData = await chunkK342JMA3_cjs.getCustomData(db, user.id);
2660
+ const customData = await chunkTV7LRFXH_cjs.getCustomData(db, user.id);
2660
2661
  const { is_active: _isActive, ...publicUser } = user;
2661
2662
  return c.json({
2662
2663
  success: true,
@@ -2701,7 +2702,7 @@ function buildOtpApi() {
2701
2702
  });
2702
2703
  return otpAPI;
2703
2704
  }
2704
- var otpLoginPlugin = chunkUHRHZXVR_cjs.definePlugin({
2705
+ var otpLoginPlugin = chunkNYLWNR6T_cjs.definePlugin({
2705
2706
  id: "otp-login",
2706
2707
  version: "1.0.0",
2707
2708
  name: "OTP Login",
@@ -3098,15 +3099,15 @@ function buildOauthApi() {
3098
3099
  if (!user || !user.is_active) {
3099
3100
  return c.redirect("/auth/login?error=Account is deactivated");
3100
3101
  }
3101
- const tokenTtl2 = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3102
- const jwt2 = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
3102
+ const tokenTtl2 = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3103
+ const jwt2 = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
3103
3104
  user.id,
3104
3105
  user.email,
3105
3106
  user.role,
3106
3107
  c.env.JWT_SECRET,
3107
3108
  tokenTtl2
3108
3109
  );
3109
- chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3110
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3110
3111
  return c.redirect("/admin");
3111
3112
  }
3112
3113
  const existingUser = await oauthService.findUserByEmail(profile.email);
@@ -3123,15 +3124,15 @@ function buildOauthApi() {
3123
3124
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3124
3125
  profileData: JSON.stringify(profile)
3125
3126
  });
3126
- const tokenTtl2 = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3127
- const jwt2 = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
3127
+ const tokenTtl2 = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3128
+ const jwt2 = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
3128
3129
  existingUser.id,
3129
3130
  existingUser.email,
3130
3131
  existingUser.role,
3131
3132
  c.env.JWT_SECRET,
3132
3133
  tokenTtl2
3133
3134
  );
3134
- chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3135
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwt2, { sameSite: "Lax", maxAge: tokenTtl2 });
3135
3136
  return c.redirect("/admin");
3136
3137
  }
3137
3138
  const newUserId = await oauthService.createUserFromOAuth(profile);
@@ -3144,15 +3145,15 @@ function buildOauthApi() {
3144
3145
  tokenExpiresAt: tokenExpiresAt ?? void 0,
3145
3146
  profileData: JSON.stringify(profile)
3146
3147
  });
3147
- const tokenTtl = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3148
- const jwt = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
3148
+ const tokenTtl = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
3149
+ const jwt = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
3149
3150
  newUserId,
3150
3151
  profile.email.toLowerCase(),
3151
3152
  "viewer",
3152
3153
  c.env.JWT_SECRET,
3153
3154
  tokenTtl
3154
3155
  );
3155
- chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3156
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwt, { sameSite: "Lax", maxAge: tokenTtl });
3156
3157
  return c.redirect("/admin");
3157
3158
  } catch (error) {
3158
3159
  console.error("OAuth callback error:", error);
@@ -3247,7 +3248,7 @@ function buildOauthApi() {
3247
3248
  });
3248
3249
  return oauthAPI;
3249
3250
  }
3250
- var oauthProvidersPlugin = chunkUHRHZXVR_cjs.definePlugin({
3251
+ var oauthProvidersPlugin = chunkNYLWNR6T_cjs.definePlugin({
3251
3252
  id: "oauth-providers",
3252
3253
  version: "1.0.0",
3253
3254
  name: "OAuth Providers",
@@ -3824,7 +3825,7 @@ var AISearchService = class {
3824
3825
  */
3825
3826
  async detectNewCollections() {
3826
3827
  try {
3827
- const allCollections = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3828
+ const allCollections = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => ({
3828
3829
  id: r.id,
3829
3830
  name: r.name,
3830
3831
  display_name: r.displayName,
@@ -3876,7 +3877,7 @@ var AISearchService = class {
3876
3877
  */
3877
3878
  async getAllCollections() {
3878
3879
  try {
3879
- const allCollections = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
3880
+ const allCollections = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).sort((a, b) => a.displayName.localeCompare(b.displayName)).map((r) => ({
3880
3881
  id: r.id,
3881
3882
  name: r.name,
3882
3883
  display_name: r.displayName,
@@ -4212,7 +4213,7 @@ var IndexManager = class {
4212
4213
  */
4213
4214
  async indexCollection(collectionId) {
4214
4215
  try {
4215
- const registry = chunkQJNKSFDJ_cjs.getCollectionRegistry();
4216
+ const registry = chunkLLWLHFTD_cjs.getCollectionRegistry();
4216
4217
  const record = registry.getById(collectionId) ?? registry.getByName(collectionId);
4217
4218
  if (!record) {
4218
4219
  throw new Error(`Collection ${collectionId} not found`);
@@ -4839,7 +4840,7 @@ function renderSettingsPage(data) {
4839
4840
 
4840
4841
  // src/plugins/core-plugins/ai-search-plugin/routes/admin.ts
4841
4842
  var adminRoutes2 = new hono.Hono();
4842
- adminRoutes2.use("*", chunkYJEBDJDV_cjs.requireAuth());
4843
+ adminRoutes2.use("*", chunkBYLQOBO6_cjs.requireAuth());
4843
4844
  adminRoutes2.get("/", async (c) => {
4844
4845
  try {
4845
4846
  const user = c.get("user");
@@ -5080,7 +5081,7 @@ var manifest_default = {
5080
5081
  author: "SonicJS"};
5081
5082
 
5082
5083
  // src/plugins/core-plugins/ai-search-plugin/index.ts
5083
- var aiSearchPlugin = chunkUHRHZXVR_cjs.definePlugin({
5084
+ var aiSearchPlugin = chunkNYLWNR6T_cjs.definePlugin({
5084
5085
  id: manifest_default.id,
5085
5086
  version: manifest_default.version,
5086
5087
  name: manifest_default.name,
@@ -5951,7 +5952,7 @@ function renderSecuritySettingsPage(data) {
5951
5952
 
5952
5953
  // src/plugins/core-plugins/security-audit-plugin/routes/admin.ts
5953
5954
  var adminRoutes3 = new hono.Hono();
5954
- adminRoutes3.use("*", chunkYJEBDJDV_cjs.requireAuth());
5955
+ adminRoutes3.use("*", chunkBYLQOBO6_cjs.requireAuth());
5955
5956
  adminRoutes3.use("*", async (c, next) => {
5956
5957
  const user = c.get("user");
5957
5958
  if (user?.role !== "admin") {
@@ -5961,7 +5962,7 @@ adminRoutes3.use("*", async (c, next) => {
5961
5962
  });
5962
5963
  async function getSettings(db) {
5963
5964
  try {
5964
- const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
5965
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
5965
5966
  const plugin2 = await pluginService.getPlugin("security-audit");
5966
5967
  if (plugin2?.settings) {
5967
5968
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6066,7 +6067,7 @@ adminRoutes3.post("/settings", async (c) => {
6066
6067
  autoPurge: body["retention.autoPurge"] === "true"
6067
6068
  }
6068
6069
  };
6069
- const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
6070
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
6070
6071
  await pluginService.updatePluginSettings("security-audit", settings);
6071
6072
  if (c.req.header("HX-Request")) {
6072
6073
  return c.json({ success: true });
@@ -6227,7 +6228,7 @@ var BruteForceDetector = class {
6227
6228
 
6228
6229
  // src/plugins/core-plugins/security-audit-plugin/routes/api.ts
6229
6230
  var apiRoutes2 = new hono.Hono();
6230
- apiRoutes2.use("*", chunkYJEBDJDV_cjs.requireAuth());
6231
+ apiRoutes2.use("*", chunkBYLQOBO6_cjs.requireAuth());
6231
6232
  apiRoutes2.use("*", async (c, next) => {
6232
6233
  const user = c.get("user");
6233
6234
  if (user?.role !== "admin") {
@@ -6237,7 +6238,7 @@ apiRoutes2.use("*", async (c, next) => {
6237
6238
  });
6238
6239
  async function getSettings2(db) {
6239
6240
  try {
6240
- const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
6241
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
6241
6242
  const plugin2 = await pluginService.getPlugin("security-audit");
6242
6243
  if (plugin2?.settings) {
6243
6244
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6385,7 +6386,7 @@ function generateFingerprint(ip, userAgent) {
6385
6386
  }
6386
6387
  async function getPluginSettings(db) {
6387
6388
  try {
6388
- const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
6389
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
6389
6390
  const plugin2 = await pluginService.getPlugin("security-audit");
6390
6391
  if (plugin2?.settings) {
6391
6392
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -6616,7 +6617,7 @@ async function logAuthEvent(c, db, settings, ip, userAgent, countryCode, fingerp
6616
6617
 
6617
6618
  // src/plugins/core-plugins/security-audit-plugin/index.ts
6618
6619
  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>`;
6619
- var securityAuditPlugin = chunkUHRHZXVR_cjs.definePlugin({
6620
+ var securityAuditPlugin = chunkNYLWNR6T_cjs.definePlugin({
6620
6621
  id: "security-audit",
6621
6622
  version: "1.0.0",
6622
6623
  name: "Security Audit",
@@ -7372,7 +7373,7 @@ var DEFAULT_SETTINGS3 = {
7372
7373
 
7373
7374
  // src/plugins/core-plugins/stripe-plugin/routes/admin.ts
7374
7375
  var adminRoutes4 = new hono.Hono();
7375
- adminRoutes4.use("*", chunkYJEBDJDV_cjs.requireAuth());
7376
+ adminRoutes4.use("*", chunkBYLQOBO6_cjs.requireAuth());
7376
7377
  adminRoutes4.use("*", async (c, next) => {
7377
7378
  const user = c.get("user");
7378
7379
  if (user?.role !== "admin") {
@@ -7382,7 +7383,7 @@ adminRoutes4.use("*", async (c, next) => {
7382
7383
  });
7383
7384
  async function getSettings3(db) {
7384
7385
  try {
7385
- const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
7386
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
7386
7387
  const plugin2 = await pluginService.getPlugin("stripe");
7387
7388
  if (plugin2?.settings) {
7388
7389
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -7704,7 +7705,7 @@ function timingSafeEqual(a, b) {
7704
7705
  var apiRoutes3 = new hono.Hono();
7705
7706
  async function getSettings4(db) {
7706
7707
  try {
7707
- const pluginService = new chunkQJNKSFDJ_cjs.PluginService(db);
7708
+ const pluginService = new chunkLLWLHFTD_cjs.PluginService(db);
7708
7709
  const plugin2 = await pluginService.getPlugin("stripe");
7709
7710
  if (plugin2?.settings) {
7710
7711
  const settings = typeof plugin2.settings === "string" ? JSON.parse(plugin2.settings) : plugin2.settings;
@@ -7855,7 +7856,7 @@ apiRoutes3.post("/webhook", async (c) => {
7855
7856
  }
7856
7857
  return c.json({ received: true });
7857
7858
  });
7858
- apiRoutes3.post("/create-checkout-session", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7859
+ apiRoutes3.post("/create-checkout-session", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7859
7860
  const db = c.env.DB;
7860
7861
  const user = c.get("user");
7861
7862
  if (!user) return c.json({ error: "Unauthorized" }, 401);
@@ -7895,7 +7896,7 @@ apiRoutes3.post("/create-checkout-session", chunkYJEBDJDV_cjs.requireAuth(), asy
7895
7896
  });
7896
7897
  return c.json({ sessionId: session.id, url: session.url });
7897
7898
  });
7898
- apiRoutes3.get("/subscription", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7899
+ apiRoutes3.get("/subscription", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7899
7900
  const user = c.get("user");
7900
7901
  if (!user) return c.json({ error: "Unauthorized" }, 401);
7901
7902
  const db = c.env.DB;
@@ -7907,7 +7908,7 @@ apiRoutes3.get("/subscription", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7907
7908
  }
7908
7909
  return c.json({ subscription });
7909
7910
  });
7910
- apiRoutes3.get("/subscriptions", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7911
+ apiRoutes3.get("/subscriptions", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7911
7912
  const user = c.get("user");
7912
7913
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7913
7914
  const db = c.env.DB;
@@ -7923,7 +7924,7 @@ apiRoutes3.get("/subscriptions", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7923
7924
  const result = await subscriptionService.list(filters);
7924
7925
  return c.json(result);
7925
7926
  });
7926
- apiRoutes3.get("/stats", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7927
+ apiRoutes3.get("/stats", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7927
7928
  const user = c.get("user");
7928
7929
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7929
7930
  const db = c.env.DB;
@@ -7932,7 +7933,7 @@ apiRoutes3.get("/stats", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7932
7933
  const stats = await subscriptionService.getStats();
7933
7934
  return c.json(stats);
7934
7935
  });
7935
- apiRoutes3.post("/sync-subscriptions", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7936
+ apiRoutes3.post("/sync-subscriptions", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7936
7937
  const user = c.get("user");
7937
7938
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7938
7939
  const db = c.env.DB;
@@ -7980,7 +7981,7 @@ apiRoutes3.post("/sync-subscriptions", chunkYJEBDJDV_cjs.requireAuth(), async (c
7980
7981
  }, 500);
7981
7982
  }
7982
7983
  });
7983
- apiRoutes3.get("/events", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
7984
+ apiRoutes3.get("/events", chunkBYLQOBO6_cjs.requireAuth(), async (c) => {
7984
7985
  const user = c.get("user");
7985
7986
  if (user?.role !== "admin") return c.json({ error: "Access denied" }, 403);
7986
7987
  const db = c.env.DB;
@@ -8003,7 +8004,7 @@ apiRoutes3.get("/events", chunkYJEBDJDV_cjs.requireAuth(), async (c) => {
8003
8004
 
8004
8005
  // src/plugins/core-plugins/stripe-plugin/index.ts
8005
8006
  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>`;
8006
- var stripePlugin = chunkUHRHZXVR_cjs.definePlugin({
8007
+ var stripePlugin = chunkNYLWNR6T_cjs.definePlugin({
8007
8008
  id: "stripe",
8008
8009
  version: "1.0.0",
8009
8010
  name: "Stripe",
@@ -8276,7 +8277,7 @@ function renderFormsListPage(data) {
8276
8277
 
8277
8278
  <!-- Forms Table -->
8278
8279
  <div class="bg-white dark:bg-zinc-900 rounded-lg border border-zinc-950/5 dark:border-white/10 overflow-hidden">
8279
- ${chunkK342JMA3_cjs.renderTable(tableData)}
8280
+ ${chunkTV7LRFXH_cjs.renderTable(tableData)}
8280
8281
  </div>
8281
8282
  </div>
8282
8283
  `;
@@ -9704,8 +9705,9 @@ function renderFormCreatePage(data) {
9704
9705
  }
9705
9706
 
9706
9707
  // src/routes/admin-forms.ts
9708
+ var isTableMissing = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: forms");
9707
9709
  var adminFormsRoutes = new hono.Hono();
9708
- adminFormsRoutes.use("*", chunkYJEBDJDV_cjs.requireAuth());
9710
+ adminFormsRoutes.use("*", chunkBYLQOBO6_cjs.requireAuth());
9709
9711
  adminFormsRoutes.get("/", async (c) => {
9710
9712
  try {
9711
9713
  const user = c.get("user");
@@ -9745,6 +9747,14 @@ adminFormsRoutes.get("/", async (c) => {
9745
9747
  };
9746
9748
  return c.html(renderFormsListPage(pageData));
9747
9749
  } catch (error) {
9750
+ if (isTableMissing(error)) {
9751
+ const user = c.get("user");
9752
+ return c.html(renderFormsListPage({
9753
+ forms: [],
9754
+ user: user ? { name: user.email, email: user.email, role: user.role } : void 0,
9755
+ version: c.get("appVersion")
9756
+ }));
9757
+ }
9748
9758
  console.error("Error listing forms:", error);
9749
9759
  return c.html("<p>Error loading forms</p>", 500);
9750
9760
  }
@@ -9855,6 +9865,7 @@ adminFormsRoutes.post("/", async (c) => {
9855
9865
  ).run();
9856
9866
  return c.redirect(`/admin/forms/${formId}/builder`);
9857
9867
  } catch (error) {
9868
+ if (isTableMissing(error)) return c.json({ error: "Forms storage not configured \u2014 run database migrations" }, 503);
9858
9869
  console.error("Error creating form:", error);
9859
9870
  return c.json({ error: "Failed to create form" }, 500);
9860
9871
  }
@@ -9869,7 +9880,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
9869
9880
  if (!form) {
9870
9881
  return c.html("<p>Form not found</p>", 404);
9871
9882
  }
9872
- const turnstileService = new chunkMKKGA3C4_cjs.TurnstileService(db);
9883
+ const turnstileService = new chunkSY7CBACS_cjs.TurnstileService(db);
9873
9884
  const turnstileSettings = await turnstileService.getSettings();
9874
9885
  const pageData = {
9875
9886
  id: form.id,
@@ -9892,6 +9903,7 @@ adminFormsRoutes.get("/:id/builder", async (c) => {
9892
9903
  };
9893
9904
  return c.html(renderFormBuilderPage(pageData));
9894
9905
  } catch (error) {
9906
+ if (isTableMissing(error)) return c.html("<p>Forms storage not configured \u2014 run database migrations</p>", 503);
9895
9907
  console.error("Error showing form builder:", error);
9896
9908
  return c.html("<p>Error loading form builder</p>", 500);
9897
9909
  }
@@ -9921,6 +9933,7 @@ adminFormsRoutes.put("/:id", async (c) => {
9921
9933
  ).run();
9922
9934
  return c.json({ success: true, message: "Form saved successfully" });
9923
9935
  } catch (error) {
9936
+ if (isTableMissing(error)) return c.json({ error: "Forms storage not configured \u2014 run database migrations" }, 503);
9924
9937
  console.error("Error updating form:", error);
9925
9938
  return c.json({ error: "Failed to save form" }, 500);
9926
9939
  }
@@ -9942,6 +9955,7 @@ adminFormsRoutes.delete("/:id", async (c) => {
9942
9955
  await db.prepare("DELETE FROM forms WHERE id = ?").bind(formId).run();
9943
9956
  return c.json({ success: true, message: "Form deleted successfully" });
9944
9957
  } catch (error) {
9958
+ if (isTableMissing(error)) return c.json({ error: "Forms storage not configured \u2014 run database migrations" }, 503);
9945
9959
  console.error("Error deleting form:", error);
9946
9960
  return c.json({ error: "Failed to delete form" }, 500);
9947
9961
  }
@@ -10002,6 +10016,7 @@ adminFormsRoutes.get("/:id/submissions", async (c) => {
10002
10016
  `;
10003
10017
  return c.html(html4);
10004
10018
  } catch (error) {
10019
+ if (isTableMissing(error)) return c.html("<p>Forms storage not configured \u2014 run database migrations</p>", 503);
10005
10020
  console.error("Error loading submissions:", error);
10006
10021
  return c.html("<p>Error loading submissions</p>", 500);
10007
10022
  }
@@ -10022,6 +10037,7 @@ function sanitizeDeep(value) {
10022
10037
  }
10023
10038
  return value;
10024
10039
  }
10040
+ var isTableMissing2 = (err) => String(err?.message ?? err?.cause?.message ?? "").includes("no such table: form");
10025
10041
  var publicFormsRoutes = new hono.Hono();
10026
10042
  publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10027
10043
  try {
@@ -10033,7 +10049,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10033
10049
  if (!form) {
10034
10050
  return c.json({ error: "Form not found" }, 404);
10035
10051
  }
10036
- const turnstileService = new chunkMKKGA3C4_cjs.TurnstileService(db);
10052
+ const turnstileService = new chunkSY7CBACS_cjs.TurnstileService(db);
10037
10053
  const globalSettings = await turnstileService.getSettings();
10038
10054
  const formSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10039
10055
  const enabled = form.turnstile_enabled === 1 || formSettings.inherit && globalSettings?.enabled;
@@ -10049,6 +10065,7 @@ publicFormsRoutes.get("/:identifier/turnstile-config", async (c) => {
10049
10065
  appearance: formSettings.appearance || globalSettings.appearance || "always"
10050
10066
  });
10051
10067
  } catch (error) {
10068
+ if (isTableMissing2(error)) return c.json({ enabled: false });
10052
10069
  console.error("Error fetching Turnstile config:", error);
10053
10070
  return c.json({ error: "Failed to fetch config" }, 500);
10054
10071
  }
@@ -10076,6 +10093,7 @@ publicFormsRoutes.get("/:identifier/schema", async (c) => {
10076
10093
  submitUrl: `/api/forms/${form.id}/submit`
10077
10094
  });
10078
10095
  } catch (error) {
10096
+ if (isTableMissing2(error)) return c.json({ error: "Form not found" }, 404);
10079
10097
  console.error("Error fetching form schema:", error);
10080
10098
  return c.json({ error: "Failed to fetch form schema" }, 500);
10081
10099
  }
@@ -10442,6 +10460,7 @@ publicFormsRoutes.get("/:name", async (c) => {
10442
10460
  `;
10443
10461
  return c.html(html4);
10444
10462
  } catch (error) {
10463
+ if (isTableMissing2(error)) return c.html("<h1>Form not found</h1><p>This form does not exist or is not publicly available.</p>", 404);
10445
10464
  console.error("Error rendering form:", error);
10446
10465
  return c.html("<p>Error loading form</p>", 500);
10447
10466
  }
@@ -10460,7 +10479,7 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
10460
10479
  const turnstileEnabled = form.turnstile_enabled === 1;
10461
10480
  const turnstileSettings = form.turnstile_settings ? JSON.parse(form.turnstile_settings) : { inherit: true };
10462
10481
  if (turnstileEnabled || turnstileSettings.inherit) {
10463
- const turnstileService = new chunkMKKGA3C4_cjs.TurnstileService(db);
10482
+ const turnstileService = new chunkSY7CBACS_cjs.TurnstileService(db);
10464
10483
  const globalEnabled = await turnstileService.isEnabled();
10465
10484
  if (globalEnabled || turnstileEnabled) {
10466
10485
  const turnstileToken = body.data?.turnstile || body.turnstile;
@@ -10515,13 +10534,14 @@ publicFormsRoutes.post("/:identifier/submit", async (c) => {
10515
10534
  message: "Form submitted successfully"
10516
10535
  });
10517
10536
  } catch (error) {
10537
+ if (isTableMissing2(error)) return c.json({ error: "Form not found" }, 404);
10518
10538
  console.error("Error submitting form:", error);
10519
10539
  return c.json({ error: "Failed to submit form" }, 500);
10520
10540
  }
10521
10541
  });
10522
10542
 
10523
10543
  // src/plugins/core-plugins/forms-plugin/index.ts
10524
- var formsPlugin = chunkUHRHZXVR_cjs.definePlugin({
10544
+ var formsPlugin = chunkNYLWNR6T_cjs.definePlugin({
10525
10545
  id: "forms",
10526
10546
  version: "1.0.0",
10527
10547
  name: "Forms",
@@ -10541,7 +10561,7 @@ var formsPlugin = chunkUHRHZXVR_cjs.definePlugin({
10541
10561
  });
10542
10562
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
10543
10563
  var adminRbacRoutes = new hono.Hono();
10544
- adminRbacRoutes.use("*", chunkYJEBDJDV_cjs.requireRbac("rbac", "manage"));
10564
+ adminRbacRoutes.use("*", chunkBYLQOBO6_cjs.requireRbac("rbac", "manage"));
10545
10565
  var esc = (s) => String(s).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
10546
10566
  var TABS2 = `
10547
10567
  <div class="border-b border-zinc-950/10 dark:border-white/10 mb-6">
@@ -10849,7 +10869,7 @@ adminRbacRoutes.get("/", async (c) => {
10849
10869
  title: "Roles & Permissions",
10850
10870
  pageTitle: "Roles & Permissions",
10851
10871
  currentPath: "/admin/users",
10852
- version: chunkKV3CM5RK_cjs.getCoreVersion(),
10872
+ version: chunkXGH2FVVR_cjs.getCoreVersion(),
10853
10873
  user: u ? { name: u.email || "Admin", email: u.email || "", role: u.role || "admin" } : void 0,
10854
10874
  content: content2
10855
10875
  })
@@ -10986,7 +11006,7 @@ adminRbacRoutes.get("/check", async (c) => {
10986
11006
  });
10987
11007
 
10988
11008
  // src/middleware/plugin-menu.ts
10989
- var REGISTRY_MENU_PLUGINS = Object.values(chunkQJNKSFDJ_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
11009
+ var REGISTRY_MENU_PLUGINS = Object.values(chunkLLWLHFTD_cjs.PLUGIN_REGISTRY).filter((p) => p.adminMenu !== null).map((p) => ({
10990
11010
  id: p.id,
10991
11011
  label: p.adminMenu.label,
10992
11012
  path: p.adminMenu.path,
@@ -11083,7 +11103,7 @@ function pluginMenuMiddleware() {
11083
11103
  }
11084
11104
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
11085
11105
  var adminRoutes5 = new hono.Hono();
11086
- adminRoutes5.use("*", chunkYJEBDJDV_cjs.requireAuth());
11106
+ adminRoutes5.use("*", chunkBYLQOBO6_cjs.requireAuth());
11087
11107
  adminRoutes5.use("*", async (c, next) => {
11088
11108
  const user = c.get("user");
11089
11109
  if (user?.role !== "admin") {
@@ -11438,7 +11458,7 @@ apiRoutes4.get("/stats", async (c) => {
11438
11458
  });
11439
11459
 
11440
11460
  // src/plugins/core-plugins/analytics/index.ts
11441
- var analyticsPlugin = chunkUHRHZXVR_cjs.definePlugin({
11461
+ var analyticsPlugin = chunkNYLWNR6T_cjs.definePlugin({
11442
11462
  id: "core-analytics",
11443
11463
  version: "1.0.0",
11444
11464
  name: "Analytics",
@@ -11585,7 +11605,7 @@ function esc2(s) {
11585
11605
  return (s || "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
11586
11606
  }
11587
11607
  async function getVariablesMap(db) {
11588
- let variables = chunkK342JMA3_cjs.getVariablesCached();
11608
+ let variables = chunkTV7LRFXH_cjs.getVariablesCached();
11589
11609
  if (variables) return variables;
11590
11610
  try {
11591
11611
  const { results } = await db.prepare(
@@ -11595,7 +11615,7 @@ async function getVariablesMap(db) {
11595
11615
  for (const row of results || []) {
11596
11616
  variables.set(row.key, row.value);
11597
11617
  }
11598
- chunkK342JMA3_cjs.setVariablesCache(variables);
11618
+ chunkTV7LRFXH_cjs.setVariablesCache(variables);
11599
11619
  return variables;
11600
11620
  } catch {
11601
11621
  return /* @__PURE__ */ new Map();
@@ -11664,7 +11684,7 @@ apiRoutes5.post("/", async (c) => {
11664
11684
  await db.prepare(
11665
11685
  "INSERT INTO global_variables (key, value, description, category, is_active) VALUES (?, ?, ?, ?, ?)"
11666
11686
  ).bind(key, value || "", description || "", category || "general", isActive !== false ? 1 : 0).run();
11667
- chunkK342JMA3_cjs.invalidateVariablesCache();
11687
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11668
11688
  const created = await db.prepare("SELECT * FROM global_variables WHERE key = ?").bind(key).first();
11669
11689
  return c.json({ success: true, data: formatVariable(created) }, 201);
11670
11690
  } catch {
@@ -11709,7 +11729,7 @@ apiRoutes5.put("/:id", async (c) => {
11709
11729
  updates.push("updated_at = strftime('%s', 'now')");
11710
11730
  params.push(id);
11711
11731
  await db.prepare(`UPDATE global_variables SET ${updates.join(", ")} WHERE id = ?`).bind(...params).run();
11712
- chunkK342JMA3_cjs.invalidateVariablesCache();
11732
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11713
11733
  const updated = await db.prepare("SELECT * FROM global_variables WHERE id = ?").bind(id).first();
11714
11734
  return c.json({ success: true, data: formatVariable(updated) });
11715
11735
  } catch {
@@ -11723,7 +11743,7 @@ apiRoutes5.delete("/:id", async (c) => {
11723
11743
  const existing = await db.prepare("SELECT id FROM global_variables WHERE id = ?").bind(id).first();
11724
11744
  if (!existing) return c.json({ error: "Variable not found" }, 404);
11725
11745
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(id).run();
11726
- chunkK342JMA3_cjs.invalidateVariablesCache();
11746
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11727
11747
  return c.json({ success: true });
11728
11748
  } catch {
11729
11749
  return c.json({ success: false, error: "Failed to delete variable" }, 500);
@@ -11783,7 +11803,7 @@ adminRoutes6.put("/:id", async (c) => {
11783
11803
  const value = body.value;
11784
11804
  if (value !== void 0) {
11785
11805
  await db.prepare("UPDATE global_variables SET value = ?, updated_at = strftime('%s', 'now') WHERE id = ?").bind(value, id).run();
11786
- chunkK342JMA3_cjs.invalidateVariablesCache();
11806
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11787
11807
  }
11788
11808
  return c.html('<span class="text-green-400 text-xs">Saved</span>');
11789
11809
  });
@@ -11791,7 +11811,7 @@ adminRoutes6.post("/:id/toggle", async (c) => {
11791
11811
  const db = c.env.DB;
11792
11812
  const id = c.req.param("id");
11793
11813
  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();
11794
- chunkK342JMA3_cjs.invalidateVariablesCache();
11814
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11795
11815
  c.header("HX-Redirect", "/admin/global-variables");
11796
11816
  return c.body(null, 204);
11797
11817
  });
@@ -11812,7 +11832,7 @@ adminRoutes6.post("/", async (c) => {
11812
11832
  await db.prepare(
11813
11833
  "INSERT INTO global_variables (key, value, description, category) VALUES (?, ?, ?, ?)"
11814
11834
  ).bind(key, value, description, category).run();
11815
- chunkK342JMA3_cjs.invalidateVariablesCache();
11835
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11816
11836
  c.header("HX-Redirect", "/admin/global-variables");
11817
11837
  return c.body(null, 204);
11818
11838
  });
@@ -11831,7 +11851,7 @@ adminRoutes6.post("/settings/editor-integration", async (c) => {
11831
11851
  adminRoutes6.delete("/:id", async (c) => {
11832
11852
  const db = c.env.DB;
11833
11853
  await db.prepare("DELETE FROM global_variables WHERE id = ?").bind(c.req.param("id")).run();
11834
- chunkK342JMA3_cjs.invalidateVariablesCache();
11854
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
11835
11855
  return c.html("");
11836
11856
  });
11837
11857
  function renderAdminPage(variables, editorStatus = { editorActive: false, activeEditorName: "", enableEditorIntegration: true }) {
@@ -12149,7 +12169,7 @@ function renderAdminPage(variables, editorStatus = { editorActive: false, active
12149
12169
  </div>
12150
12170
  ` });
12151
12171
  }
12152
- var globalVariablesPlugin = chunkUHRHZXVR_cjs.definePlugin({
12172
+ var globalVariablesPlugin = chunkNYLWNR6T_cjs.definePlugin({
12153
12173
  id: "global-variables",
12154
12174
  version: "1.1.0",
12155
12175
  name: "Global Variables",
@@ -12172,7 +12192,7 @@ var globalVariablesPlugin = chunkUHRHZXVR_cjs.definePlugin({
12172
12192
  if (!db || !data) return data;
12173
12193
  const variables = await getVariablesMap(db);
12174
12194
  if (variables.size === 0) return data;
12175
- return chunkK342JMA3_cjs.resolveVariablesInObject(data, variables);
12195
+ return chunkTV7LRFXH_cjs.resolveVariablesInObject(data, variables);
12176
12196
  } catch {
12177
12197
  return data;
12178
12198
  }
@@ -12190,7 +12210,7 @@ var globalVariablesPlugin = chunkUHRHZXVR_cjs.definePlugin({
12190
12210
  },
12191
12211
  activate: async () => console.info("[GlobalVariables] Plugin activated"),
12192
12212
  deactivate: async () => {
12193
- chunkK342JMA3_cjs.invalidateVariablesCache();
12213
+ chunkTV7LRFXH_cjs.invalidateVariablesCache();
12194
12214
  console.info("[GlobalVariables] Plugin deactivated, cache cleared");
12195
12215
  },
12196
12216
  uninstall: async (ctx) => {
@@ -12756,7 +12776,7 @@ function renderAdminPage2(shortcodes, editorStatus = { editorActive: false, acti
12756
12776
  </div>
12757
12777
  ` });
12758
12778
  }
12759
- var shortcodesPlugin = chunkUHRHZXVR_cjs.definePlugin({
12779
+ var shortcodesPlugin = chunkNYLWNR6T_cjs.definePlugin({
12760
12780
  id: "shortcodes",
12761
12781
  version: "1.0.0",
12762
12782
  name: "Shortcodes",
@@ -12840,7 +12860,7 @@ helloWorldRoutes.get("/", async (c) => {
12840
12860
  </html>
12841
12861
  `);
12842
12862
  });
12843
- var helloWorldPlugin = chunkUHRHZXVR_cjs.definePlugin({
12863
+ var helloWorldPlugin = chunkNYLWNR6T_cjs.definePlugin({
12844
12864
  id: "hello-world",
12845
12865
  version: "1.0.0",
12846
12866
  name: "Hello World",
@@ -13068,7 +13088,7 @@ function renderTenantForm(data) {
13068
13088
  // src/plugins/core-plugins/multi-tenant-plugin/templates/tenant-members.template.ts
13069
13089
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13070
13090
  function roleOptions(selected) {
13071
- return chunkK342JMA3_cjs.VALID_MEMBER_ROLES.map(
13091
+ return chunkTV7LRFXH_cjs.VALID_MEMBER_ROLES.map(
13072
13092
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13073
13093
  ).join("");
13074
13094
  }
@@ -13130,7 +13150,7 @@ function renderInvitations(slug, invitations) {
13130
13150
  <div>
13131
13151
  <label for="invite-role" class="mb-1 block text-xs font-medium text-zinc-500 dark:text-zinc-400">Role</label>
13132
13152
  <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">
13133
- ${chunkK342JMA3_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13153
+ ${chunkTV7LRFXH_cjs.VALID_MEMBER_ROLES.map((r) => `<option value="${r}" ${r === "viewer" ? "selected" : ""}>${r}</option>`).join("")}
13134
13154
  </select>
13135
13155
  </div>
13136
13156
  <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>
@@ -13226,7 +13246,7 @@ function renderTenantMembers(data) {
13226
13246
  // src/plugins/core-plugins/multi-tenant-plugin/templates/user-memberships.template.ts
13227
13247
  chunkK623Q6WD_cjs.init_admin_layout_catalyst_template();
13228
13248
  function roleOptions2(selected) {
13229
- return chunkK342JMA3_cjs.VALID_MEMBER_ROLES.map(
13249
+ return chunkTV7LRFXH_cjs.VALID_MEMBER_ROLES.map(
13230
13250
  (r) => `<option value="${r}" ${r === selected ? "selected" : ""}>${r}</option>`
13231
13251
  ).join("");
13232
13252
  }
@@ -13388,7 +13408,7 @@ function zodToFieldErrors(error) {
13388
13408
  }
13389
13409
  async function isMultiTenantActive(db) {
13390
13410
  try {
13391
- const plugin2 = await new chunkQJNKSFDJ_cjs.PluginService(db).getPlugin(chunkQJNKSFDJ_cjs.MULTI_TENANT_PLUGIN_ID);
13411
+ const plugin2 = await new chunkLLWLHFTD_cjs.PluginService(db).getPlugin(chunkLLWLHFTD_cjs.MULTI_TENANT_PLUGIN_ID);
13392
13412
  return plugin2?.status === "active";
13393
13413
  } catch {
13394
13414
  return false;
@@ -13396,7 +13416,7 @@ async function isMultiTenantActive(db) {
13396
13416
  }
13397
13417
  function createTenantAdminRoutes() {
13398
13418
  const routes2 = new hono.Hono();
13399
- routes2.use("*", chunkYJEBDJDV_cjs.requireAuth());
13419
+ routes2.use("*", chunkBYLQOBO6_cjs.requireAuth());
13400
13420
  routes2.use("*", async (c, next) => {
13401
13421
  const user = c.get("user");
13402
13422
  if (user?.role !== "admin") {
@@ -13410,7 +13430,7 @@ function createTenantAdminRoutes() {
13410
13430
  const form = await c.req.formData();
13411
13431
  const slug = String(form.get("tenant") ?? "").trim().toLowerCase();
13412
13432
  const redirect = String(form.get("redirect") ?? "");
13413
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13433
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13414
13434
  const tenant = await svc.getTenantBySlug(slug);
13415
13435
  if (!tenant || tenant.status !== "active") {
13416
13436
  return c.json({ error: "Unknown or inactive tenant" }, 400);
@@ -13420,7 +13440,7 @@ function createTenantAdminRoutes() {
13420
13440
  if (!user.isSuperAdmin && !await svc.isMember(user.userId, slug)) {
13421
13441
  return c.json({ error: "You are not a member of this tenant" }, 403);
13422
13442
  }
13423
- cookie.setCookie(c, chunkQJNKSFDJ_cjs.TENANT_COOKIE, slug, {
13443
+ cookie.setCookie(c, chunkLLWLHFTD_cjs.TENANT_COOKIE, slug, {
13424
13444
  path: "/",
13425
13445
  httpOnly: true,
13426
13446
  sameSite: "Lax",
@@ -13437,7 +13457,7 @@ function createTenantAdminRoutes() {
13437
13457
  if (!user) return c.redirect("/auth/login");
13438
13458
  const token = c.req.query("token") ?? "";
13439
13459
  try {
13440
- const { slug } = await new chunkK342JMA3_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
13460
+ const { slug } = await new chunkTV7LRFXH_cjs.TenantService(db).acceptInvitation(token, user.userId, user.email);
13441
13461
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation accepted`);
13442
13462
  } catch (error) {
13443
13463
  const message = error instanceof Error ? error.message : "Failed to accept invitation";
@@ -13465,7 +13485,7 @@ function createTenantAdminRoutes() {
13465
13485
  const userId = c.req.param("userId");
13466
13486
  const target = await db.prepare("SELECT id, email FROM auth_user WHERE id = ?").bind(userId).first();
13467
13487
  if (!target?.id) return c.redirect("/admin/users?message=User not found&type=error");
13468
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13488
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13469
13489
  const [memberships, allTenants] = await Promise.all([svc.listUserMemberships(userId), svc.listTenants()]);
13470
13490
  const memberSlugs = new Set(memberships.map((m) => m.slug));
13471
13491
  const availableTenants = allTenants.filter((t) => t.status === "active" && !memberSlugs.has(t.slug)).map((t) => ({ slug: t.slug, name: t.name }));
@@ -13490,10 +13510,10 @@ function createTenantAdminRoutes() {
13490
13510
  const slug = String(form.get("slug") ?? "").trim().toLowerCase();
13491
13511
  const role = String(form.get("role") ?? "viewer");
13492
13512
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13493
- if (!chunkK342JMA3_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
13513
+ if (!chunkTV7LRFXH_cjs.isValidMemberRole(role)) throw new Error(`Invalid role '${role}'`);
13494
13514
  const target = await db.prepare("SELECT email FROM auth_user WHERE id = ?").bind(userId).first();
13495
13515
  if (!target) throw new Error("User not found");
13496
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13516
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13497
13517
  if (!await svc.getTenantBySlug(slug)) throw new Error("Tenant not found");
13498
13518
  if (await svc.isMember(userId, slug)) throw new Error(`Already a member of '${slug}'`);
13499
13519
  await svc.addMember(slug, userId, role, target.email ?? null);
@@ -13512,7 +13532,7 @@ function createTenantAdminRoutes() {
13512
13532
  const form = await c.req.formData();
13513
13533
  const role = String(form.get("role") ?? "");
13514
13534
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13515
- await new chunkK342JMA3_cjs.TenantService(db).setMemberRole(slug, userId, role);
13535
+ await new chunkTV7LRFXH_cjs.TenantService(db).setMemberRole(slug, userId, role);
13516
13536
  return c.redirect(`${redirectTo}?message=Role updated`);
13517
13537
  } catch (error) {
13518
13538
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -13527,7 +13547,7 @@ function createTenantAdminRoutes() {
13527
13547
  try {
13528
13548
  const form = await c.req.formData();
13529
13549
  const redirectTo = String(form.get("_redirect") ?? "") || `/admin/tenants/users/${userId}`;
13530
- await new chunkK342JMA3_cjs.TenantService(db).removeMember(slug, userId);
13550
+ await new chunkTV7LRFXH_cjs.TenantService(db).removeMember(slug, userId);
13531
13551
  return c.redirect(`${redirectTo}?message=Removed from ${encodeURIComponent(slug)}`);
13532
13552
  } catch (error) {
13533
13553
  const message = error instanceof Error ? error.message : "Failed to remove membership";
@@ -13542,7 +13562,7 @@ function createTenantAdminRoutes() {
13542
13562
  return c.html(renderTenantsInactive({ user: userShape(cur), version }));
13543
13563
  }
13544
13564
  const roleName = c.req.param("roleName");
13545
- const assignments = await new chunkK342JMA3_cjs.TenantService(db).listAssignmentsByRole(roleName);
13565
+ const assignments = await new chunkTV7LRFXH_cjs.TenantService(db).listAssignmentsByRole(roleName);
13546
13566
  return c.html(renderRoleUsage({ roleName, assignments, user: userShape(cur), version }));
13547
13567
  });
13548
13568
  routes2.get("/", async (c) => {
@@ -13552,7 +13572,7 @@ function createTenantAdminRoutes() {
13552
13572
  if (!await isMultiTenantActive(db)) {
13553
13573
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13554
13574
  }
13555
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13575
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13556
13576
  await svc.ensureDefaultTenant();
13557
13577
  const tenants = await svc.listTenants();
13558
13578
  const [docRes, memberRes] = await db.batch([
@@ -13591,7 +13611,7 @@ function createTenantAdminRoutes() {
13591
13611
  formEntries = Object.fromEntries(form.entries());
13592
13612
  const validated = tenantFormSchema.parse(formEntries);
13593
13613
  if (!validated.slug) throw new zod.z.ZodError([{ code: "custom", message: "Slug is required", path: ["slug"] }]);
13594
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13614
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13595
13615
  await svc.createTenant({
13596
13616
  name: validated.name,
13597
13617
  slug: validated.slug,
@@ -13616,7 +13636,7 @@ function createTenantAdminRoutes() {
13616
13636
  if (!await isMultiTenantActive(db)) {
13617
13637
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13618
13638
  }
13619
- const tenant = await new chunkK342JMA3_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
13639
+ const tenant = await new chunkTV7LRFXH_cjs.TenantService(db).getTenantBySlug(c.req.param("slug"));
13620
13640
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
13621
13641
  return c.html(renderTenantForm({ tenant, isEdit: true, user: userShape(user), version }));
13622
13642
  });
@@ -13626,7 +13646,7 @@ function createTenantAdminRoutes() {
13626
13646
  const version = c.get("appVersion");
13627
13647
  const slug = c.req.param("slug");
13628
13648
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13629
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13649
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13630
13650
  try {
13631
13651
  const form = await c.req.formData();
13632
13652
  const validated = tenantFormSchema.parse(Object.fromEntries(form.entries()));
@@ -13651,7 +13671,7 @@ function createTenantAdminRoutes() {
13651
13671
  const slug = c.req.param("slug");
13652
13672
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13653
13673
  try {
13654
- await new chunkK342JMA3_cjs.TenantService(db).deleteTenant(slug);
13674
+ await new chunkTV7LRFXH_cjs.TenantService(db).deleteTenant(slug);
13655
13675
  return c.redirect("/admin/tenants?message=Tenant deleted successfully");
13656
13676
  } catch (error) {
13657
13677
  const message = error instanceof Error ? error.message : "Failed to delete tenant";
@@ -13666,7 +13686,7 @@ function createTenantAdminRoutes() {
13666
13686
  return c.html(renderTenantsInactive({ user: userShape(user), version }));
13667
13687
  }
13668
13688
  const slug = c.req.param("slug");
13669
- const svc = new chunkK342JMA3_cjs.TenantService(db);
13689
+ const svc = new chunkTV7LRFXH_cjs.TenantService(db);
13670
13690
  const tenant = await svc.getTenantBySlug(slug);
13671
13691
  if (!tenant) return c.redirect("/admin/tenants?message=Tenant not found&type=error");
13672
13692
  const [members, invitations] = await Promise.all([svc.listMembers(slug), svc.listInvitations(slug)]);
@@ -13692,7 +13712,7 @@ function createTenantAdminRoutes() {
13692
13712
  const form = await c.req.formData();
13693
13713
  const email = String(form.get("email") ?? "");
13694
13714
  const role = String(form.get("role") ?? "viewer");
13695
- await new chunkK342JMA3_cjs.TenantService(db).addMemberByEmail(slug, email, role);
13715
+ await new chunkTV7LRFXH_cjs.TenantService(db).addMemberByEmail(slug, email, role);
13696
13716
  return c.redirect(`/admin/tenants/${slug}/members?message=Member added`);
13697
13717
  } catch (error) {
13698
13718
  const message = error instanceof Error ? error.message : "Failed to add member";
@@ -13707,7 +13727,7 @@ function createTenantAdminRoutes() {
13707
13727
  try {
13708
13728
  const form = await c.req.formData();
13709
13729
  const role = String(form.get("role") ?? "");
13710
- await new chunkK342JMA3_cjs.TenantService(db).setMemberRole(slug, userId, role);
13730
+ await new chunkTV7LRFXH_cjs.TenantService(db).setMemberRole(slug, userId, role);
13711
13731
  return c.redirect(`/admin/tenants/${slug}/members?message=Role updated`);
13712
13732
  } catch (error) {
13713
13733
  const message = error instanceof Error ? error.message : "Failed to update role";
@@ -13720,7 +13740,7 @@ function createTenantAdminRoutes() {
13720
13740
  const userId = c.req.param("userId");
13721
13741
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13722
13742
  try {
13723
- await new chunkK342JMA3_cjs.TenantService(db).removeMember(slug, userId);
13743
+ await new chunkTV7LRFXH_cjs.TenantService(db).removeMember(slug, userId);
13724
13744
  return c.redirect(`/admin/tenants/${slug}/members?message=Member removed`);
13725
13745
  } catch (error) {
13726
13746
  const message = error instanceof Error ? error.message : "Failed to remove member";
@@ -13736,12 +13756,12 @@ function createTenantAdminRoutes() {
13736
13756
  const form = await c.req.formData();
13737
13757
  const email = String(form.get("email") ?? "");
13738
13758
  const role = String(form.get("role") ?? "viewer");
13739
- const token = await new chunkK342JMA3_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
13759
+ const token = await new chunkTV7LRFXH_cjs.TenantService(db).createInvitation(slug, email, role, user?.userId ?? null);
13740
13760
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
13741
13761
  const acceptUrl = `${origin}/join/invite?token=${encodeURIComponent(token)}`;
13742
13762
  let note;
13743
13763
  let noteType = "";
13744
- const svc2 = chunkK342JMA3_cjs.hasEmailService() ? chunkK342JMA3_cjs.getEmailService() : null;
13764
+ const svc2 = chunkTV7LRFXH_cjs.hasEmailService() ? chunkTV7LRFXH_cjs.getEmailService() : null;
13745
13765
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
13746
13766
  if (hasRealProvider) {
13747
13767
  const result = await svc2.send({
@@ -13782,7 +13802,7 @@ function createTenantAdminRoutes() {
13782
13802
  WHERE i.id = ? AND t.slug = ? AND i.status = 'pending'`
13783
13803
  ).bind(id, slug).first();
13784
13804
  if (!inv) throw new Error("Invitation not found or already used");
13785
- const svc2 = chunkK342JMA3_cjs.hasEmailService() ? chunkK342JMA3_cjs.getEmailService() : null;
13805
+ const svc2 = chunkTV7LRFXH_cjs.hasEmailService() ? chunkTV7LRFXH_cjs.getEmailService() : null;
13786
13806
  const hasRealProvider = !!svc2 && svc2.getProviderName() !== "console";
13787
13807
  if (!hasRealProvider) throw new Error("No email plugin active");
13788
13808
  const origin = c.req.header("origin") || new URL(c.req.url).origin;
@@ -13807,7 +13827,7 @@ function createTenantAdminRoutes() {
13807
13827
  const id = c.req.param("id");
13808
13828
  if (!await isMultiTenantActive(db)) return c.json({ error: "Multi-tenant plugin is not active" }, 403);
13809
13829
  try {
13810
- await new chunkK342JMA3_cjs.TenantService(db).revokeInvitation(slug, id);
13830
+ await new chunkTV7LRFXH_cjs.TenantService(db).revokeInvitation(slug, id);
13811
13831
  return c.redirect(`/admin/tenants/${slug}/members?message=Invitation revoked`);
13812
13832
  } catch (error) {
13813
13833
  const message = error instanceof Error ? error.message : "Failed to revoke invitation";
@@ -14037,7 +14057,7 @@ function createJoinRoutes() {
14037
14057
  if (existing) return rerender("An account with this email already exists. Please sign in instead.");
14038
14058
  try {
14039
14059
  const userId = crypto.randomUUID();
14040
- const passwordHash = await chunkYJEBDJDV_cjs.AuthManager.hashPassword(password);
14060
+ const passwordHash = await chunkBYLQOBO6_cjs.AuthManager.hashPassword(password);
14041
14061
  const now = Date.now();
14042
14062
  const nowSec = Math.floor(now / 1e3);
14043
14063
  await db.batch([
@@ -14050,7 +14070,7 @@ function createJoinRoutes() {
14050
14070
  VALUES (?, ?, ?, 'credential', ?, ?, ?)`
14051
14071
  ).bind(`cred-${userId}`, userId, userId, passwordHash, nowSec, nowSec)
14052
14072
  ]);
14053
- await new chunkK342JMA3_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14073
+ await new chunkTV7LRFXH_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14054
14074
  const auth = chunkNUKJ54GA_cjs.createAuth(c.env);
14055
14075
  const origin = new URL(c.req.url).origin;
14056
14076
  const baReq = new Request(`${origin}/auth/sign-in/email`, {
@@ -14118,7 +14138,7 @@ function createJoinRoutes() {
14118
14138
  const baBody = await baRes.json();
14119
14139
  const userId = baBody?.user?.id;
14120
14140
  if (!userId) return rerender("Sign-in succeeded but could not read user ID.");
14121
- await new chunkK342JMA3_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14141
+ await new chunkTV7LRFXH_cjs.TenantService(db).acceptInvitation(token, userId, inv.email);
14122
14142
  const headers = new Headers({ Location: "/admin?message=Welcome! You have joined " + encodeURIComponent(inv.tenantName) });
14123
14143
  copyBaCookies(baRes, headers);
14124
14144
  return new Response(null, { status: 302, headers });
@@ -14132,7 +14152,7 @@ function createJoinRoutes() {
14132
14152
 
14133
14153
  // src/plugins/core-plugins/multi-tenant-plugin/index.ts
14134
14154
  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>`;
14135
- var multiTenantPlugin = chunkUHRHZXVR_cjs.definePlugin({
14155
+ var multiTenantPlugin = chunkNYLWNR6T_cjs.definePlugin({
14136
14156
  id: manifest_default2.id,
14137
14157
  version: "1.0.0",
14138
14158
  name: manifest_default2.name,
@@ -14147,30 +14167,30 @@ var multiTenantPlugin = chunkUHRHZXVR_cjs.definePlugin({
14147
14167
  { label: "Tenants", path: "/admin/tenants", icon: TENANT_ICON, order: 80 }
14148
14168
  ],
14149
14169
  activate: async () => {
14150
- chunkQJNKSFDJ_cjs.invalidateTenantCache();
14170
+ chunkLLWLHFTD_cjs.invalidateTenantCache();
14151
14171
  console.info("\u2705 Multi-Tenant plugin activated");
14152
14172
  },
14153
14173
  deactivate: async () => {
14154
- chunkQJNKSFDJ_cjs.invalidateTenantCache();
14174
+ chunkLLWLHFTD_cjs.invalidateTenantCache();
14155
14175
  console.info("\u274C Multi-Tenant plugin deactivated");
14156
14176
  }
14157
14177
  });
14158
14178
  var routes = new hono.Hono();
14159
- routes.use("*", chunkYJEBDJDV_cjs.requireAuth());
14160
- routes.use("*", chunkYJEBDJDV_cjs.requireRole(["admin", "editor"]));
14179
+ routes.use("*", chunkBYLQOBO6_cjs.requireAuth());
14180
+ routes.use("*", chunkBYLQOBO6_cjs.requireRole(["admin", "editor"]));
14161
14181
  routes.get("/:rootId", async (c) => {
14162
14182
  const { rootId } = c.req.param();
14163
14183
  const db = c.env.DB;
14164
- const scope = await chunkK342JMA3_cjs.resolveDocScope(c, db, { rootId });
14184
+ const scope = await chunkTV7LRFXH_cjs.resolveDocScope(c, db, { rootId });
14165
14185
  if (!scope) {
14166
14186
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Document not found.</p>', 404);
14167
14187
  }
14168
14188
  if (!scope.docType?.settings?.versioning) {
14169
14189
  return c.html('<p class="text-zinc-500 dark:text-zinc-400 p-4">Versioning not enabled for this type.</p>', 404);
14170
14190
  }
14171
- const denied = await chunkK342JMA3_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14191
+ const denied = await chunkTV7LRFXH_cjs.denyIfNotAllowed(c, db, rootId, "read", scope.docType?.settings, scope.tenantId);
14172
14192
  if (denied) return denied;
14173
- const repo = new chunkK342JMA3_cjs.DocumentRepository(db, scope.tenantId);
14193
+ const repo = new chunkTV7LRFXH_cjs.DocumentRepository(db, scope.tenantId);
14174
14194
  const versions = await repo.getVersionHistory(rootId);
14175
14195
  const safeRootIdAttr = chunkMNWKYY5E_cjs.escapeHtml(rootId);
14176
14196
  const rows = versions.map((v) => {
@@ -14263,14 +14283,14 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14263
14283
  const { rootId, versionNumber } = c.req.param();
14264
14284
  const db = c.env.DB;
14265
14285
  const user = c.get("user");
14266
- const scope = await chunkK342JMA3_cjs.resolveDocScope(c, db, { rootId });
14286
+ const scope = await chunkTV7LRFXH_cjs.resolveDocScope(c, db, { rootId });
14267
14287
  if (!scope) {
14268
14288
  return c.json({ error: "Document not found" }, 404);
14269
14289
  }
14270
14290
  if (!scope.docType?.settings?.versioning) {
14271
14291
  return c.json({ error: "Versioning not enabled for this type" }, 404);
14272
14292
  }
14273
- const denied = await chunkK342JMA3_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14293
+ const denied = await chunkTV7LRFXH_cjs.denyIfNotAllowed(c, db, rootId, "update", scope.docType?.settings, scope.tenantId);
14274
14294
  if (denied) return denied;
14275
14295
  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();
14276
14296
  if (!row) {
@@ -14293,7 +14313,7 @@ routes.post("/:rootId/restore/:versionNumber", async (c) => {
14293
14313
  var routes_default = routes;
14294
14314
 
14295
14315
  // src/plugins/core-plugins/versioning-plugin/index.ts
14296
- var versioningPlugin = chunkUHRHZXVR_cjs.definePlugin({
14316
+ var versioningPlugin = chunkNYLWNR6T_cjs.definePlugin({
14297
14317
  id: "versioning",
14298
14318
  version: "1.0.0",
14299
14319
  name: "Versioning",
@@ -14370,8 +14390,8 @@ function createMagicLinkAuthPlugin() {
14370
14390
  const baseUrl = new URL(c.req.url).origin;
14371
14391
  const magicLink = `${baseUrl}/auth/magic-link/verify?token=${token}`;
14372
14392
  try {
14373
- if (chunkK342JMA3_cjs.hasEmailService()) {
14374
- await chunkK342JMA3_cjs.getEmailService().send({
14393
+ if (chunkTV7LRFXH_cjs.hasEmailService()) {
14394
+ await chunkTV7LRFXH_cjs.getEmailService().send({
14375
14395
  to: normalizedEmail,
14376
14396
  subject: "Your Magic Link to Sign In",
14377
14397
  flow: "magic-link",
@@ -14448,19 +14468,19 @@ function createMagicLinkAuthPlugin() {
14448
14468
  SET used = 1, used_at = ?
14449
14469
  WHERE id = ?
14450
14470
  `).bind(Date.now(), magicLink.id).run();
14451
- const tokenTtl = await chunkYJEBDJDV_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
14452
- const jwtToken = await chunkYJEBDJDV_cjs.AuthManager.generateToken(
14471
+ const tokenTtl = await chunkBYLQOBO6_cjs.getJwtExpirySecondsFromDb(c.env.DB, c.env);
14472
+ const jwtToken = await chunkBYLQOBO6_cjs.AuthManager.generateToken(
14453
14473
  user.id,
14454
14474
  user.email,
14455
14475
  user.role,
14456
14476
  c.env.JWT_SECRET,
14457
14477
  tokenTtl
14458
14478
  );
14459
- chunkYJEBDJDV_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
14479
+ chunkBYLQOBO6_cjs.AuthManager.setAuthCookie(c, jwtToken, { maxAge: tokenTtl });
14460
14480
  await db.prepare(`
14461
14481
  UPDATE auth_user SET last_login_at = ? WHERE id = ?
14462
14482
  `).bind(Date.now(), user.id).run();
14463
- chunkK342JMA3_cjs.dispatchHookEvent(
14483
+ chunkTV7LRFXH_cjs.dispatchHookEvent(
14464
14484
  c,
14465
14485
  "auth:magic-link:consumed",
14466
14486
  { user: { id: user.id, email: user.email, role: user.role } },
@@ -14945,7 +14965,7 @@ async function warmCollections(db) {
14945
14965
  const collectionCache = chunkYA3TJ65D_cjs.getCacheService(config);
14946
14966
  let count = 0;
14947
14967
  try {
14948
- const results = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().map(chunkQJNKSFDJ_cjs.collectionRecordToRow);
14968
+ const results = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().map(chunkLLWLHFTD_cjs.collectionRecordToRow);
14949
14969
  for (const collection of results) {
14950
14970
  const key = collectionCache.generateKey("item", collection.id);
14951
14971
  await collectionCache.set(key, collection);
@@ -15216,7 +15236,7 @@ function renderCacheDashboard(data) {
15216
15236
  </script>
15217
15237
 
15218
15238
  <!-- Confirmation Dialogs -->
15219
- ${chunkK342JMA3_cjs.renderConfirmationDialog({
15239
+ ${chunkTV7LRFXH_cjs.renderConfirmationDialog({
15220
15240
  id: "clear-all-cache-confirm",
15221
15241
  title: "Clear All Cache",
15222
15242
  message: "Are you sure you want to clear all cache entries? This cannot be undone.",
@@ -15227,7 +15247,7 @@ function renderCacheDashboard(data) {
15227
15247
  onConfirm: "performClearAllCaches()"
15228
15248
  })}
15229
15249
 
15230
- ${chunkK342JMA3_cjs.renderConfirmationDialog({
15250
+ ${chunkTV7LRFXH_cjs.renderConfirmationDialog({
15231
15251
  id: "clear-namespace-cache-confirm",
15232
15252
  title: "Clear Namespace Cache",
15233
15253
  message: "Clear cache for this namespace?",
@@ -15238,7 +15258,7 @@ function renderCacheDashboard(data) {
15238
15258
  onConfirm: "performClearNamespaceCache()"
15239
15259
  })}
15240
15260
 
15241
- ${chunkK342JMA3_cjs.getConfirmationDialogScript()}
15261
+ ${chunkTV7LRFXH_cjs.getConfirmationDialogScript()}
15242
15262
  `;
15243
15263
  const layoutData = {
15244
15264
  title: "Cache System",
@@ -15504,7 +15524,7 @@ app.get("/", async (c) => {
15504
15524
  const totalRequests = totalHits + totalMisses;
15505
15525
  const overallHitRate = totalRequests > 0 ? totalHits / totalRequests * 100 : 0;
15506
15526
  const DEFAULT_TTL = chunkYA3TJ65D_cjs.CACHE_CONFIGS.api?.ttl ?? 300;
15507
- const collections = chunkQJNKSFDJ_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
15527
+ const collections = chunkLLWLHFTD_cjs.getCollectionRegistry().listActive().filter((r) => !r.internal).map((r) => {
15508
15528
  const cacheOverride = r.cache;
15509
15529
  const cacheEnabled = cacheOverride?.enabled !== false;
15510
15530
  const hasCustomTtl = typeof cacheOverride?.ttl === "number";
@@ -16041,16 +16061,16 @@ var faviconSvg = `<?xml version="1.0" encoding="UTF-8" standalone="no"?>
16041
16061
  // src/app.ts
16042
16062
  function createSonicJSApp(config = {}) {
16043
16063
  const app2 = new hono.Hono();
16044
- const appVersion = config.version || chunkKV3CM5RK_cjs.getCoreVersion();
16064
+ const appVersion = config.version || chunkXGH2FVVR_cjs.getCoreVersion();
16045
16065
  const appName = config.name || "SonicJS AI";
16046
- const hookSystem = new chunkMKKGA3C4_cjs.HookSystemImpl();
16066
+ const hookSystem = new chunkSY7CBACS_cjs.HookSystemImpl();
16047
16067
  chunkJ6JTWD2A_cjs.setHookSystem(hookSystem);
16048
16068
  const magicLinkPlugin = createMagicLinkAuthPlugin();
16049
16069
  const corePluginsBeforeCatchAll = [
16050
16070
  securityAuditPlugin,
16051
16071
  aiSearchPlugin,
16052
16072
  oauthProvidersPlugin,
16053
- chunkK342JMA3_cjs.userProfilesPlugin,
16073
+ chunkTV7LRFXH_cjs.userProfilesPlugin,
16054
16074
  otpLoginPlugin,
16055
16075
  analyticsPlugin,
16056
16076
  stripePlugin,
@@ -16060,23 +16080,23 @@ function createSonicJSApp(config = {}) {
16060
16080
  shortcodesPlugin,
16061
16081
  helloWorldPlugin,
16062
16082
  multiTenantPlugin,
16063
- chunkK342JMA3_cjs.lexicalEditorPlugin,
16083
+ chunkTV7LRFXH_cjs.lexicalEditorPlugin,
16064
16084
  versioningPlugin
16065
16085
  ];
16066
16086
  const corePluginsAfterCatchAll = [emailPluginV3, magicLinkPlugin, emailReconciliationPlugin];
16067
- const wirePlugins = chunkMKKGA3C4_cjs.createPluginWirer(
16087
+ const wirePlugins = chunkSY7CBACS_cjs.createPluginWirer(
16068
16088
  () => [...corePluginsBeforeCatchAll, ...corePluginsAfterCatchAll, ...config.plugins?.register ?? []],
16069
16089
  // The capability-gated `ctx.cap.email` resolves to the app EmailService, which
16070
16090
  // is initialized (below) just before wiring on the first request.
16071
16091
  () => ({
16072
16092
  hooks: hookSystem,
16073
16093
  env: firstRequestEnv,
16074
- providers: { email: () => chunkK342JMA3_cjs.getEmailService() }
16094
+ providers: { email: () => chunkTV7LRFXH_cjs.getEmailService() }
16075
16095
  })
16076
16096
  );
16077
16097
  let firstRequestEnv;
16078
16098
  const initEmailService = async (env = {}) => {
16079
- if (chunkK342JMA3_cjs.hasEmailService()) return;
16099
+ if (chunkTV7LRFXH_cjs.hasEmailService()) return;
16080
16100
  let provider;
16081
16101
  let defaultFrom = config.email?.from;
16082
16102
  let defaultReplyTo;
@@ -16111,14 +16131,14 @@ function createSonicJSApp(config = {}) {
16111
16131
  }
16112
16132
  }
16113
16133
  defaultFrom = defaultFrom || env.DEFAULT_FROM_EMAIL || "noreply@sonicjs.local";
16114
- chunkK342JMA3_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16134
+ chunkTV7LRFXH_cjs.setEmailService(new EmailService({ provider, defaultFrom, defaultReplyTo, db: env.DB }));
16115
16135
  };
16116
16136
  app2.use("*", async (c, next) => {
16117
16137
  c.set("appVersion", appVersion);
16118
16138
  await next();
16119
16139
  });
16120
- app2.use("*", chunkYJEBDJDV_cjs.metricsMiddleware());
16121
- app2.use("*", chunkYJEBDJDV_cjs.bootstrapMiddleware(config));
16140
+ app2.use("*", chunkBYLQOBO6_cjs.metricsMiddleware());
16141
+ app2.use("*", chunkBYLQOBO6_cjs.bootstrapMiddleware(config));
16122
16142
  const boot = async (env) => {
16123
16143
  if (config.plugins?.disableAll) return;
16124
16144
  firstRequestEnv = env;
@@ -16145,8 +16165,19 @@ function createSonicJSApp(config = {}) {
16145
16165
  app2.use("*", async (_c, next) => {
16146
16166
  await next();
16147
16167
  });
16148
- app2.use("*", chunkYJEBDJDV_cjs.securityHeadersMiddleware());
16149
- app2.use("*", chunkYJEBDJDV_cjs.csrfProtection());
16168
+ app2.use("*", cors.cors({
16169
+ origin: (origin, c) => {
16170
+ const allowed = c.env?.CORS_ORIGINS;
16171
+ if (!allowed) return null;
16172
+ const list = allowed.split(",").map((s) => s.trim());
16173
+ return list.includes(origin) ? origin : null;
16174
+ },
16175
+ allowMethods: ["GET", "POST", "PUT", "DELETE", "OPTIONS"],
16176
+ allowHeaders: ["Content-Type", "Authorization", "X-API-Key"],
16177
+ credentials: true
16178
+ }));
16179
+ app2.use("*", chunkBYLQOBO6_cjs.securityHeadersMiddleware());
16180
+ app2.use("*", chunkBYLQOBO6_cjs.csrfProtection());
16150
16181
  app2.use("*", async (c, next) => {
16151
16182
  try {
16152
16183
  const reqUrl = new URL(c.req.url);
@@ -16183,9 +16214,9 @@ function createSonicJSApp(config = {}) {
16183
16214
  app2.use("*", middleware);
16184
16215
  }
16185
16216
  }
16186
- app2.use("*", chunkQJNKSFDJ_cjs.tenantMiddleware());
16187
- app2.use("/admin/*", chunkYJEBDJDV_cjs.requireAuth());
16188
- app2.use("/admin/*", chunkYJEBDJDV_cjs.requireRbac("portal", "access"));
16217
+ app2.use("*", chunkLLWLHFTD_cjs.tenantMiddleware());
16218
+ app2.use("/admin/*", chunkBYLQOBO6_cjs.requireAuth());
16219
+ app2.use("/admin/*", chunkBYLQOBO6_cjs.requireRbac("portal", "access"));
16189
16220
  app2.use("/admin/*", pluginMenuMiddleware());
16190
16221
  const NAV_LANDING = [
16191
16222
  { path: "/admin/content", perm: "content:read" },
@@ -16231,43 +16262,43 @@ function createSonicJSApp(config = {}) {
16231
16262
  });
16232
16263
  app2.route("/api/security-audit", apiRoutes2);
16233
16264
  app2.route("/admin/plugins/security-audit", adminRoutes3);
16234
- app2.route("/api/media", chunkK342JMA3_cjs.api_media_default);
16235
- app2.route("/api/system", chunkK342JMA3_cjs.api_system_default);
16236
- app2.route("/api/documents", chunkK342JMA3_cjs.apiDocumentsRoutes);
16237
- app2.route("/api", chunkK342JMA3_cjs.api_default);
16238
- app2.route("/admin/documents", chunkK342JMA3_cjs.adminDocumentsRoutes);
16239
- chunkMKKGA3C4_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16240
- app2.route("/admin/api", chunkK342JMA3_cjs.admin_api_default);
16241
- app2.route("/admin/collections", chunkK342JMA3_cjs.adminCollectionsRoutes);
16242
- app2.route("/admin/settings", chunkK342JMA3_cjs.adminSettingsRoutes);
16243
- app2.route("/admin/api-reference", chunkK342JMA3_cjs.router2);
16265
+ app2.route("/api/media", chunkTV7LRFXH_cjs.api_media_default);
16266
+ app2.route("/api/system", chunkTV7LRFXH_cjs.api_system_default);
16267
+ app2.route("/api/documents", chunkTV7LRFXH_cjs.apiDocumentsRoutes);
16268
+ app2.route("/api", chunkTV7LRFXH_cjs.api_default);
16269
+ app2.route("/admin/documents", chunkTV7LRFXH_cjs.adminDocumentsRoutes);
16270
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, [formsPlugin], { source: "core" });
16271
+ app2.route("/admin/api", chunkTV7LRFXH_cjs.admin_api_default);
16272
+ app2.route("/admin/collections", chunkTV7LRFXH_cjs.adminCollectionsRoutes);
16273
+ app2.route("/admin/settings", chunkTV7LRFXH_cjs.adminSettingsRoutes);
16274
+ app2.route("/admin/api-reference", chunkTV7LRFXH_cjs.router2);
16244
16275
  app2.route("/admin/database-tools", createDatabaseToolsAdminRoutes());
16245
- app2.route("/admin/content", chunkK342JMA3_cjs.admin_content_default);
16246
- app2.route("/admin/media", chunkK342JMA3_cjs.adminMediaRoutes);
16276
+ app2.route("/admin/content", chunkTV7LRFXH_cjs.admin_content_default);
16277
+ app2.route("/admin/media", chunkTV7LRFXH_cjs.adminMediaRoutes);
16247
16278
  app2.use("/auth/*", securityAuditMiddleware());
16248
16279
  if (!config.plugins?.disableAll) {
16249
- chunkMKKGA3C4_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16280
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, corePluginsBeforeCatchAll, { source: "core" });
16250
16281
  app2.route("/admin/cache", cache_default.getRoutes());
16251
16282
  if (config.plugins?.register && config.plugins.register.length > 0) {
16252
- chunkMKKGA3C4_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16283
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, config.plugins.register, { source: "user" });
16253
16284
  }
16254
16285
  }
16255
16286
  app2.route("/api/events", apiRoutes4);
16256
- app2.route("/admin/dashboard", chunkK342JMA3_cjs.router);
16257
- app2.route("/admin/plugins", chunkK342JMA3_cjs.adminPluginRoutes);
16258
- app2.route("/admin/logs", chunkK342JMA3_cjs.adminLogsRoutes);
16287
+ app2.route("/admin/dashboard", chunkTV7LRFXH_cjs.router);
16288
+ app2.route("/admin/plugins", chunkTV7LRFXH_cjs.adminPluginRoutes);
16289
+ app2.route("/admin/logs", chunkTV7LRFXH_cjs.adminLogsRoutes);
16259
16290
  app2.route("/admin/rbac", adminRbacRoutes);
16260
- app2.route("/admin", chunkK342JMA3_cjs.userRoutes);
16261
- app2.route("/auth", chunkK342JMA3_cjs.auth_default);
16291
+ app2.route("/admin", chunkTV7LRFXH_cjs.userRoutes);
16292
+ app2.route("/auth", chunkTV7LRFXH_cjs.auth_default);
16262
16293
  app2.on(["GET", "POST"], "/auth/*", (c) => {
16263
16294
  const reqUrl = new URL(c.req.url);
16264
16295
  const requestBaseURL = `${reqUrl.protocol}//${reqUrl.host}`;
16265
16296
  const auth = chunkNUKJ54GA_cjs.createAuth(c.env, config.auth?.extendBetterAuth, requestBaseURL);
16266
16297
  return auth.handler(c.req.raw);
16267
16298
  });
16268
- app2.route("/", chunkK342JMA3_cjs.test_cleanup_default);
16299
+ app2.route("/", chunkTV7LRFXH_cjs.test_cleanup_default);
16269
16300
  if (!config.plugins?.disableAll) {
16270
- chunkMKKGA3C4_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16301
+ chunkSY7CBACS_cjs.registerPluginRoutes(app2, corePluginsAfterCatchAll, { source: "core" });
16271
16302
  }
16272
16303
  if (!config.plugins?.disableAll) {
16273
16304
  const allMountedPlugins = [
@@ -16276,8 +16307,8 @@ function createSonicJSApp(config = {}) {
16276
16307
  ...corePluginsAfterCatchAll,
16277
16308
  ...config.plugins?.register ?? []
16278
16309
  ];
16279
- chunkMKKGA3C4_cjs.setPluginMenu(allMountedPlugins.flatMap((p) => p.menu ?? []));
16280
- chunkUHRHZXVR_cjs.setPluginDefinitions(allMountedPlugins);
16310
+ chunkSY7CBACS_cjs.setPluginMenu(allMountedPlugins.flatMap((p) => p.menu ?? []));
16311
+ chunkNYLWNR6T_cjs.setPluginDefinitions(allMountedPlugins);
16281
16312
  }
16282
16313
  app2.get("/favicon.svg", (c) => {
16283
16314
  return new Response(faviconSvg, {
@@ -19769,7 +19800,7 @@ function createRedirectApiRoutes() {
19769
19800
  });
19770
19801
  return api;
19771
19802
  }
19772
- var redirectPlugin = chunkUHRHZXVR_cjs.definePlugin({
19803
+ var redirectPlugin = chunkNYLWNR6T_cjs.definePlugin({
19773
19804
  id: manifest_default3.id,
19774
19805
  version: manifest_default3.version,
19775
19806
  name: manifest_default3.name,
@@ -19787,7 +19818,7 @@ var redirectPlugin = chunkUHRHZXVR_cjs.definePlugin({
19787
19818
  async onBoot(ctx) {
19788
19819
  const db = ctx.env?.DB;
19789
19820
  if (!db) return;
19790
- const registry = new chunkYJEBDJDV_cjs.DocumentTypeRegistry(db);
19821
+ const registry = new chunkBYLQOBO6_cjs.DocumentTypeRegistry(db);
19791
19822
  await registry.register({
19792
19823
  id: "redirect",
19793
19824
  name: "redirect",
@@ -19903,87 +19934,87 @@ function createDb(d1$1) {
19903
19934
  }
19904
19935
 
19905
19936
  // src/index.ts
19906
- var VERSION = chunkKV3CM5RK_cjs.package_default.version;
19937
+ var VERSION = chunkXGH2FVVR_cjs.package_default.version;
19907
19938
 
19908
19939
  Object.defineProperty(exports, "ROUTES_INFO", {
19909
19940
  enumerable: true,
19910
- get: function () { return chunkK342JMA3_cjs.ROUTES_INFO; }
19941
+ get: function () { return chunkTV7LRFXH_cjs.ROUTES_INFO; }
19911
19942
  });
19912
19943
  Object.defineProperty(exports, "adminApiRoutes", {
19913
19944
  enumerable: true,
19914
- get: function () { return chunkK342JMA3_cjs.admin_api_default; }
19945
+ get: function () { return chunkTV7LRFXH_cjs.admin_api_default; }
19915
19946
  });
19916
19947
  Object.defineProperty(exports, "adminCheckboxRoutes", {
19917
19948
  enumerable: true,
19918
- get: function () { return chunkK342JMA3_cjs.adminCheckboxRoutes; }
19949
+ get: function () { return chunkTV7LRFXH_cjs.adminCheckboxRoutes; }
19919
19950
  });
19920
19951
  Object.defineProperty(exports, "adminCollectionsRoutes", {
19921
19952
  enumerable: true,
19922
- get: function () { return chunkK342JMA3_cjs.adminCollectionsRoutes; }
19953
+ get: function () { return chunkTV7LRFXH_cjs.adminCollectionsRoutes; }
19923
19954
  });
19924
19955
  Object.defineProperty(exports, "adminContentRoutes", {
19925
19956
  enumerable: true,
19926
- get: function () { return chunkK342JMA3_cjs.admin_content_default; }
19957
+ get: function () { return chunkTV7LRFXH_cjs.admin_content_default; }
19927
19958
  });
19928
19959
  Object.defineProperty(exports, "adminDashboardRoutes", {
19929
19960
  enumerable: true,
19930
- get: function () { return chunkK342JMA3_cjs.router; }
19961
+ get: function () { return chunkTV7LRFXH_cjs.router; }
19931
19962
  });
19932
19963
  Object.defineProperty(exports, "adminLogsRoutes", {
19933
19964
  enumerable: true,
19934
- get: function () { return chunkK342JMA3_cjs.adminLogsRoutes; }
19965
+ get: function () { return chunkTV7LRFXH_cjs.adminLogsRoutes; }
19935
19966
  });
19936
19967
  Object.defineProperty(exports, "adminMediaRoutes", {
19937
19968
  enumerable: true,
19938
- get: function () { return chunkK342JMA3_cjs.adminMediaRoutes; }
19969
+ get: function () { return chunkTV7LRFXH_cjs.adminMediaRoutes; }
19939
19970
  });
19940
19971
  Object.defineProperty(exports, "adminPluginRoutes", {
19941
19972
  enumerable: true,
19942
- get: function () { return chunkK342JMA3_cjs.adminPluginRoutes; }
19973
+ get: function () { return chunkTV7LRFXH_cjs.adminPluginRoutes; }
19943
19974
  });
19944
19975
  Object.defineProperty(exports, "adminSettingsRoutes", {
19945
19976
  enumerable: true,
19946
- get: function () { return chunkK342JMA3_cjs.adminSettingsRoutes; }
19977
+ get: function () { return chunkTV7LRFXH_cjs.adminSettingsRoutes; }
19947
19978
  });
19948
19979
  Object.defineProperty(exports, "adminUsersRoutes", {
19949
19980
  enumerable: true,
19950
- get: function () { return chunkK342JMA3_cjs.userRoutes; }
19981
+ get: function () { return chunkTV7LRFXH_cjs.userRoutes; }
19951
19982
  });
19952
19983
  Object.defineProperty(exports, "apiContentCrudRoutes", {
19953
19984
  enumerable: true,
19954
- get: function () { return chunkK342JMA3_cjs.api_content_crud_default; }
19985
+ get: function () { return chunkTV7LRFXH_cjs.api_content_crud_default; }
19955
19986
  });
19956
19987
  Object.defineProperty(exports, "apiMediaRoutes", {
19957
19988
  enumerable: true,
19958
- get: function () { return chunkK342JMA3_cjs.api_media_default; }
19989
+ get: function () { return chunkTV7LRFXH_cjs.api_media_default; }
19959
19990
  });
19960
19991
  Object.defineProperty(exports, "apiRoutes", {
19961
19992
  enumerable: true,
19962
- get: function () { return chunkK342JMA3_cjs.api_default; }
19993
+ get: function () { return chunkTV7LRFXH_cjs.api_default; }
19963
19994
  });
19964
19995
  Object.defineProperty(exports, "apiSystemRoutes", {
19965
19996
  enumerable: true,
19966
- get: function () { return chunkK342JMA3_cjs.api_system_default; }
19997
+ get: function () { return chunkTV7LRFXH_cjs.api_system_default; }
19967
19998
  });
19968
19999
  Object.defineProperty(exports, "authRoutes", {
19969
20000
  enumerable: true,
19970
- get: function () { return chunkK342JMA3_cjs.auth_default; }
20001
+ get: function () { return chunkTV7LRFXH_cjs.auth_default; }
19971
20002
  });
19972
20003
  Object.defineProperty(exports, "createUserProfilesPlugin", {
19973
20004
  enumerable: true,
19974
- get: function () { return chunkK342JMA3_cjs.createUserProfilesPlugin; }
20005
+ get: function () { return chunkTV7LRFXH_cjs.createUserProfilesPlugin; }
19975
20006
  });
19976
20007
  Object.defineProperty(exports, "defineUserProfile", {
19977
20008
  enumerable: true,
19978
- get: function () { return chunkK342JMA3_cjs.defineUserProfile; }
20009
+ get: function () { return chunkTV7LRFXH_cjs.defineUserProfile; }
19979
20010
  });
19980
20011
  Object.defineProperty(exports, "getUserProfileConfig", {
19981
20012
  enumerable: true,
19982
- get: function () { return chunkK342JMA3_cjs.getUserProfileConfig; }
20013
+ get: function () { return chunkTV7LRFXH_cjs.getUserProfileConfig; }
19983
20014
  });
19984
20015
  Object.defineProperty(exports, "userProfilesPlugin", {
19985
20016
  enumerable: true,
19986
- get: function () { return chunkK342JMA3_cjs.userProfilesPlugin; }
20017
+ get: function () { return chunkTV7LRFXH_cjs.userProfilesPlugin; }
19987
20018
  });
19988
20019
  Object.defineProperty(exports, "Logger", {
19989
20020
  enumerable: true,
@@ -20139,87 +20170,87 @@ Object.defineProperty(exports, "workflowHistory", {
20139
20170
  });
20140
20171
  Object.defineProperty(exports, "AuthManager", {
20141
20172
  enumerable: true,
20142
- get: function () { return chunkYJEBDJDV_cjs.AuthManager; }
20173
+ get: function () { return chunkBYLQOBO6_cjs.AuthManager; }
20143
20174
  });
20144
20175
  Object.defineProperty(exports, "PermissionManager", {
20145
20176
  enumerable: true,
20146
- get: function () { return chunkYJEBDJDV_cjs.PermissionManager; }
20177
+ get: function () { return chunkBYLQOBO6_cjs.PermissionManager; }
20147
20178
  });
20148
20179
  Object.defineProperty(exports, "bootstrapDocumentTypes", {
20149
20180
  enumerable: true,
20150
- get: function () { return chunkYJEBDJDV_cjs.bootstrapDocumentTypes; }
20181
+ get: function () { return chunkBYLQOBO6_cjs.bootstrapDocumentTypes; }
20151
20182
  });
20152
20183
  Object.defineProperty(exports, "bootstrapMiddleware", {
20153
20184
  enumerable: true,
20154
- get: function () { return chunkYJEBDJDV_cjs.bootstrapMiddleware; }
20185
+ get: function () { return chunkBYLQOBO6_cjs.bootstrapMiddleware; }
20155
20186
  });
20156
20187
  Object.defineProperty(exports, "cacheHeaders", {
20157
20188
  enumerable: true,
20158
- get: function () { return chunkYJEBDJDV_cjs.cacheHeaders; }
20189
+ get: function () { return chunkBYLQOBO6_cjs.cacheHeaders; }
20159
20190
  });
20160
20191
  Object.defineProperty(exports, "compressionMiddleware", {
20161
20192
  enumerable: true,
20162
- get: function () { return chunkYJEBDJDV_cjs.compressionMiddleware; }
20193
+ get: function () { return chunkBYLQOBO6_cjs.compressionMiddleware; }
20163
20194
  });
20164
20195
  Object.defineProperty(exports, "detailedLoggingMiddleware", {
20165
20196
  enumerable: true,
20166
- get: function () { return chunkYJEBDJDV_cjs.detailedLoggingMiddleware; }
20197
+ get: function () { return chunkBYLQOBO6_cjs.detailedLoggingMiddleware; }
20167
20198
  });
20168
20199
  Object.defineProperty(exports, "getActivePlugins", {
20169
20200
  enumerable: true,
20170
- get: function () { return chunkYJEBDJDV_cjs.getActivePlugins; }
20201
+ get: function () { return chunkBYLQOBO6_cjs.getActivePlugins; }
20171
20202
  });
20172
20203
  Object.defineProperty(exports, "isPluginActive", {
20173
20204
  enumerable: true,
20174
- get: function () { return chunkYJEBDJDV_cjs.isPluginActive; }
20205
+ get: function () { return chunkBYLQOBO6_cjs.isPluginActive; }
20175
20206
  });
20176
20207
  Object.defineProperty(exports, "logActivity", {
20177
20208
  enumerable: true,
20178
- get: function () { return chunkYJEBDJDV_cjs.logActivity; }
20209
+ get: function () { return chunkBYLQOBO6_cjs.logActivity; }
20179
20210
  });
20180
20211
  Object.defineProperty(exports, "loggingMiddleware", {
20181
20212
  enumerable: true,
20182
- get: function () { return chunkYJEBDJDV_cjs.loggingMiddleware; }
20213
+ get: function () { return chunkBYLQOBO6_cjs.loggingMiddleware; }
20183
20214
  });
20184
20215
  Object.defineProperty(exports, "optionalAuth", {
20185
20216
  enumerable: true,
20186
- get: function () { return chunkYJEBDJDV_cjs.optionalAuth; }
20217
+ get: function () { return chunkBYLQOBO6_cjs.optionalAuth; }
20187
20218
  });
20188
20219
  Object.defineProperty(exports, "performanceLoggingMiddleware", {
20189
20220
  enumerable: true,
20190
- get: function () { return chunkYJEBDJDV_cjs.performanceLoggingMiddleware; }
20221
+ get: function () { return chunkBYLQOBO6_cjs.performanceLoggingMiddleware; }
20191
20222
  });
20192
20223
  Object.defineProperty(exports, "requireActivePlugin", {
20193
20224
  enumerable: true,
20194
- get: function () { return chunkYJEBDJDV_cjs.requireActivePlugin; }
20225
+ get: function () { return chunkBYLQOBO6_cjs.requireActivePlugin; }
20195
20226
  });
20196
20227
  Object.defineProperty(exports, "requireActivePlugins", {
20197
20228
  enumerable: true,
20198
- get: function () { return chunkYJEBDJDV_cjs.requireActivePlugins; }
20229
+ get: function () { return chunkBYLQOBO6_cjs.requireActivePlugins; }
20199
20230
  });
20200
20231
  Object.defineProperty(exports, "requireAnyPermission", {
20201
20232
  enumerable: true,
20202
- get: function () { return chunkYJEBDJDV_cjs.requireAnyPermission; }
20233
+ get: function () { return chunkBYLQOBO6_cjs.requireAnyPermission; }
20203
20234
  });
20204
20235
  Object.defineProperty(exports, "requireAuth", {
20205
20236
  enumerable: true,
20206
- get: function () { return chunkYJEBDJDV_cjs.requireAuth; }
20237
+ get: function () { return chunkBYLQOBO6_cjs.requireAuth; }
20207
20238
  });
20208
20239
  Object.defineProperty(exports, "requirePermission", {
20209
20240
  enumerable: true,
20210
- get: function () { return chunkYJEBDJDV_cjs.requirePermission; }
20241
+ get: function () { return chunkBYLQOBO6_cjs.requirePermission; }
20211
20242
  });
20212
20243
  Object.defineProperty(exports, "requireRole", {
20213
20244
  enumerable: true,
20214
- get: function () { return chunkYJEBDJDV_cjs.requireRole; }
20245
+ get: function () { return chunkBYLQOBO6_cjs.requireRole; }
20215
20246
  });
20216
20247
  Object.defineProperty(exports, "securityHeaders", {
20217
20248
  enumerable: true,
20218
- get: function () { return chunkYJEBDJDV_cjs.securityHeadersMiddleware; }
20249
+ get: function () { return chunkBYLQOBO6_cjs.securityHeadersMiddleware; }
20219
20250
  });
20220
20251
  Object.defineProperty(exports, "securityLoggingMiddleware", {
20221
20252
  enumerable: true,
20222
- get: function () { return chunkYJEBDJDV_cjs.securityLoggingMiddleware; }
20253
+ get: function () { return chunkBYLQOBO6_cjs.securityLoggingMiddleware; }
20223
20254
  });
20224
20255
  Object.defineProperty(exports, "RbacService", {
20225
20256
  enumerable: true,
@@ -20227,35 +20258,35 @@ Object.defineProperty(exports, "RbacService", {
20227
20258
  });
20228
20259
  Object.defineProperty(exports, "PluginBootstrapService", {
20229
20260
  enumerable: true,
20230
- get: function () { return chunkQJNKSFDJ_cjs.PluginBootstrapService; }
20261
+ get: function () { return chunkLLWLHFTD_cjs.PluginBootstrapService; }
20231
20262
  });
20232
20263
  Object.defineProperty(exports, "PluginServiceClass", {
20233
20264
  enumerable: true,
20234
- get: function () { return chunkQJNKSFDJ_cjs.PluginService; }
20265
+ get: function () { return chunkLLWLHFTD_cjs.PluginService; }
20235
20266
  });
20236
20267
  Object.defineProperty(exports, "getAvailableCollectionNames", {
20237
20268
  enumerable: true,
20238
- get: function () { return chunkQJNKSFDJ_cjs.getAvailableCollectionNames; }
20269
+ get: function () { return chunkLLWLHFTD_cjs.getAvailableCollectionNames; }
20239
20270
  });
20240
20271
  Object.defineProperty(exports, "loadCollectionConfig", {
20241
20272
  enumerable: true,
20242
- get: function () { return chunkQJNKSFDJ_cjs.loadCollectionConfig; }
20273
+ get: function () { return chunkLLWLHFTD_cjs.loadCollectionConfig; }
20243
20274
  });
20244
20275
  Object.defineProperty(exports, "loadCollectionConfigs", {
20245
20276
  enumerable: true,
20246
- get: function () { return chunkQJNKSFDJ_cjs.loadCollectionConfigs; }
20277
+ get: function () { return chunkLLWLHFTD_cjs.loadCollectionConfigs; }
20247
20278
  });
20248
20279
  Object.defineProperty(exports, "registerCollections", {
20249
20280
  enumerable: true,
20250
- get: function () { return chunkQJNKSFDJ_cjs.registerCollections; }
20281
+ get: function () { return chunkLLWLHFTD_cjs.registerCollections; }
20251
20282
  });
20252
20283
  Object.defineProperty(exports, "validateCollectionConfig", {
20253
20284
  enumerable: true,
20254
- get: function () { return chunkQJNKSFDJ_cjs.validateCollectionConfig; }
20285
+ get: function () { return chunkLLWLHFTD_cjs.validateCollectionConfig; }
20255
20286
  });
20256
20287
  Object.defineProperty(exports, "MigrationService", {
20257
20288
  enumerable: true,
20258
- get: function () { return chunkORF4CT74_cjs.MigrationService; }
20289
+ get: function () { return chunkKI5KMJH2_cjs.MigrationService; }
20259
20290
  });
20260
20291
  Object.defineProperty(exports, "renderFilterBar", {
20261
20292
  enumerable: true,
@@ -20295,99 +20326,99 @@ Object.defineProperty(exports, "renderAdminLayoutCatalyst", {
20295
20326
  });
20296
20327
  Object.defineProperty(exports, "HookSystemImpl", {
20297
20328
  enumerable: true,
20298
- get: function () { return chunkMKKGA3C4_cjs.HookSystemImpl; }
20329
+ get: function () { return chunkSY7CBACS_cjs.HookSystemImpl; }
20299
20330
  });
20300
20331
  Object.defineProperty(exports, "HookUtils", {
20301
20332
  enumerable: true,
20302
- get: function () { return chunkMKKGA3C4_cjs.HookUtils; }
20333
+ get: function () { return chunkSY7CBACS_cjs.HookUtils; }
20303
20334
  });
20304
20335
  Object.defineProperty(exports, "PluginDependencyCycleError", {
20305
20336
  enumerable: true,
20306
- get: function () { return chunkMKKGA3C4_cjs.PluginDependencyCycleError; }
20337
+ get: function () { return chunkSY7CBACS_cjs.PluginDependencyCycleError; }
20307
20338
  });
20308
20339
  Object.defineProperty(exports, "PluginManagerClass", {
20309
20340
  enumerable: true,
20310
- get: function () { return chunkMKKGA3C4_cjs.PluginManager; }
20341
+ get: function () { return chunkSY7CBACS_cjs.PluginManager; }
20311
20342
  });
20312
20343
  Object.defineProperty(exports, "PluginRegistryImpl", {
20313
20344
  enumerable: true,
20314
- get: function () { return chunkMKKGA3C4_cjs.PluginRegistryImpl; }
20345
+ get: function () { return chunkSY7CBACS_cjs.PluginRegistryImpl; }
20315
20346
  });
20316
20347
  Object.defineProperty(exports, "PluginValidatorClass", {
20317
20348
  enumerable: true,
20318
- get: function () { return chunkMKKGA3C4_cjs.PluginValidator; }
20349
+ get: function () { return chunkSY7CBACS_cjs.PluginValidator; }
20319
20350
  });
20320
20351
  Object.defineProperty(exports, "RegisterPluginsError", {
20321
20352
  enumerable: true,
20322
- get: function () { return chunkMKKGA3C4_cjs.RegisterPluginsError; }
20353
+ get: function () { return chunkSY7CBACS_cjs.RegisterPluginsError; }
20323
20354
  });
20324
20355
  Object.defineProperty(exports, "ScopedHookSystemClass", {
20325
20356
  enumerable: true,
20326
- get: function () { return chunkMKKGA3C4_cjs.ScopedHookSystem; }
20357
+ get: function () { return chunkSY7CBACS_cjs.ScopedHookSystem; }
20327
20358
  });
20328
20359
  Object.defineProperty(exports, "collectCronSchedules", {
20329
20360
  enumerable: true,
20330
- get: function () { return chunkMKKGA3C4_cjs.collectCronSchedules; }
20361
+ get: function () { return chunkSY7CBACS_cjs.collectCronSchedules; }
20331
20362
  });
20332
20363
  Object.defineProperty(exports, "collectCrons", {
20333
20364
  enumerable: true,
20334
- get: function () { return chunkMKKGA3C4_cjs.collectCrons; }
20365
+ get: function () { return chunkSY7CBACS_cjs.collectCrons; }
20335
20366
  });
20336
20367
  Object.defineProperty(exports, "createScheduledHandler", {
20337
20368
  enumerable: true,
20338
- get: function () { return chunkMKKGA3C4_cjs.createScheduledHandler; }
20369
+ get: function () { return chunkSY7CBACS_cjs.createScheduledHandler; }
20339
20370
  });
20340
20371
  Object.defineProperty(exports, "dispatchCronTick", {
20341
20372
  enumerable: true,
20342
- get: function () { return chunkMKKGA3C4_cjs.dispatchCronTick; }
20373
+ get: function () { return chunkSY7CBACS_cjs.dispatchCronTick; }
20343
20374
  });
20344
20375
  Object.defineProperty(exports, "getPluginMenu", {
20345
20376
  enumerable: true,
20346
- get: function () { return chunkMKKGA3C4_cjs.getPluginMenu; }
20377
+ get: function () { return chunkSY7CBACS_cjs.getPluginMenu; }
20347
20378
  });
20348
20379
  Object.defineProperty(exports, "registerPlugins", {
20349
20380
  enumerable: true,
20350
- get: function () { return chunkMKKGA3C4_cjs.registerPlugins; }
20381
+ get: function () { return chunkSY7CBACS_cjs.registerPlugins; }
20351
20382
  });
20352
20383
  Object.defineProperty(exports, "resetPluginMenu", {
20353
20384
  enumerable: true,
20354
- get: function () { return chunkMKKGA3C4_cjs.resetPluginMenu; }
20385
+ get: function () { return chunkSY7CBACS_cjs.resetPluginMenu; }
20355
20386
  });
20356
20387
  Object.defineProperty(exports, "resolvePluginMenuItems", {
20357
20388
  enumerable: true,
20358
- get: function () { return chunkMKKGA3C4_cjs.resolvePluginMenuItems; }
20389
+ get: function () { return chunkSY7CBACS_cjs.resolvePluginMenuItems; }
20359
20390
  });
20360
20391
  Object.defineProperty(exports, "setPluginMenu", {
20361
20392
  enumerable: true,
20362
- get: function () { return chunkMKKGA3C4_cjs.setPluginMenu; }
20393
+ get: function () { return chunkSY7CBACS_cjs.setPluginMenu; }
20363
20394
  });
20364
20395
  Object.defineProperty(exports, "topoSort", {
20365
20396
  enumerable: true,
20366
- get: function () { return chunkMKKGA3C4_cjs.topoSort; }
20397
+ get: function () { return chunkSY7CBACS_cjs.topoSort; }
20367
20398
  });
20368
20399
  Object.defineProperty(exports, "applySchemaDefaults", {
20369
20400
  enumerable: true,
20370
- get: function () { return chunkUHRHZXVR_cjs.applySchemaDefaults; }
20401
+ get: function () { return chunkNYLWNR6T_cjs.applySchemaDefaults; }
20371
20402
  });
20372
20403
  Object.defineProperty(exports, "definePlugin", {
20373
20404
  enumerable: true,
20374
- get: function () { return chunkUHRHZXVR_cjs.definePlugin; }
20405
+ get: function () { return chunkNYLWNR6T_cjs.definePlugin; }
20375
20406
  });
20376
20407
  Object.defineProperty(exports, "isDefinedPlugin", {
20377
20408
  enumerable: true,
20378
- get: function () { return chunkUHRHZXVR_cjs.isDefinedPlugin; }
20409
+ get: function () { return chunkNYLWNR6T_cjs.isDefinedPlugin; }
20379
20410
  });
20380
20411
  Object.defineProperty(exports, "parseConfigSchema", {
20381
20412
  enumerable: true,
20382
- get: function () { return chunkUHRHZXVR_cjs.parseConfigSchema; }
20413
+ get: function () { return chunkNYLWNR6T_cjs.parseConfigSchema; }
20383
20414
  });
20384
20415
  Object.defineProperty(exports, "parseFormDataToSettings", {
20385
20416
  enumerable: true,
20386
- get: function () { return chunkUHRHZXVR_cjs.parseFormDataToSettings; }
20417
+ get: function () { return chunkNYLWNR6T_cjs.parseFormDataToSettings; }
20387
20418
  });
20388
20419
  Object.defineProperty(exports, "renderSchemaFields", {
20389
20420
  enumerable: true,
20390
- get: function () { return chunkUHRHZXVR_cjs.renderSchemaFields; }
20421
+ get: function () { return chunkNYLWNR6T_cjs.renderSchemaFields; }
20391
20422
  });
20392
20423
  Object.defineProperty(exports, "getHookSystem", {
20393
20424
  enumerable: true,
@@ -20435,11 +20466,11 @@ Object.defineProperty(exports, "metricsTracker", {
20435
20466
  });
20436
20467
  Object.defineProperty(exports, "SONICJS_VERSION", {
20437
20468
  enumerable: true,
20438
- get: function () { return chunkKV3CM5RK_cjs.SONICJS_VERSION; }
20469
+ get: function () { return chunkXGH2FVVR_cjs.SONICJS_VERSION; }
20439
20470
  });
20440
20471
  Object.defineProperty(exports, "getCoreVersion", {
20441
20472
  enumerable: true,
20442
- get: function () { return chunkKV3CM5RK_cjs.getCoreVersion; }
20473
+ get: function () { return chunkXGH2FVVR_cjs.getCoreVersion; }
20443
20474
  });
20444
20475
  Object.defineProperty(exports, "escapeHtml", {
20445
20476
  enumerable: true,