web-mojo 2.3.7 → 2.4.1

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 (109) hide show
  1. package/CHANGELOG.md +72 -0
  2. package/dist/admin-models.cjs.js +1 -1
  3. package/dist/admin-models.es.js +1 -1
  4. package/dist/admin.cjs.js +1 -1
  5. package/dist/admin.es.js +1 -1
  6. package/dist/auth.cjs.js +1 -1
  7. package/dist/auth.es.js +1 -1
  8. package/dist/charts.cjs.js +1 -1
  9. package/dist/charts.es.js +1 -1
  10. package/dist/chunks/{AssistantPanelView-B5tMna_t.js → AssistantPanelView-C2UrR8N7.js} +2 -2
  11. package/dist/chunks/{AssistantPanelView-B5tMna_t.js.map → AssistantPanelView-C2UrR8N7.js.map} +1 -1
  12. package/dist/chunks/{AssistantPanelView-BOdIQuqK.js → AssistantPanelView-DVeXmhzx.js} +2 -2
  13. package/dist/chunks/{AssistantPanelView-BOdIQuqK.js.map → AssistantPanelView-DVeXmhzx.js.map} +1 -1
  14. package/dist/chunks/{ChatView-BquP2SP_.js → ChatView-B0xHv7Nq.js} +2 -2
  15. package/dist/chunks/{ChatView-BquP2SP_.js.map → ChatView-B0xHv7Nq.js.map} +1 -1
  16. package/dist/chunks/{ChatView-rWg4ZSJy.js → ChatView-CUmRTKna.js} +2 -2
  17. package/dist/chunks/{ChatView-rWg4ZSJy.js.map → ChatView-CUmRTKna.js.map} +1 -1
  18. package/dist/chunks/{Collection-CtSGTegm.js → Collection-7F3lsq4z.js} +2 -2
  19. package/dist/chunks/{Collection-CtSGTegm.js.map → Collection-7F3lsq4z.js.map} +1 -1
  20. package/dist/chunks/{Collection-BtSHP_BV.js → Collection-Cgxbmj8G.js} +2 -2
  21. package/dist/chunks/{Collection-BtSHP_BV.js.map → Collection-Cgxbmj8G.js.map} +1 -1
  22. package/dist/chunks/{ContextMenu-DvQTJA49.js → ContextMenu-Ba4fjHxg.js} +2 -2
  23. package/dist/chunks/{ContextMenu-DvQTJA49.js.map → ContextMenu-Ba4fjHxg.js.map} +1 -1
  24. package/dist/chunks/{ContextMenu-0KtfqyQm.js → ContextMenu-afYD0lFk.js} +2 -2
  25. package/dist/chunks/{ContextMenu-0KtfqyQm.js.map → ContextMenu-afYD0lFk.js.map} +1 -1
  26. package/dist/chunks/{DataView-jHxX-6Gh.js → DataView-DFGIE3wK.js} +2 -2
  27. package/dist/chunks/{DataView-jHxX-6Gh.js.map → DataView-DFGIE3wK.js.map} +1 -1
  28. package/dist/chunks/{DataView-DJMOmlKN.js → DataView-fA6qQbvN.js} +2 -2
  29. package/dist/chunks/{DataView-DJMOmlKN.js.map → DataView-fA6qQbvN.js.map} +1 -1
  30. package/dist/chunks/FormView-CgnaTPkQ.js +2 -0
  31. package/dist/chunks/FormView-CgnaTPkQ.js.map +1 -0
  32. package/dist/chunks/FormView-LRb8scDI.js +2 -0
  33. package/dist/chunks/FormView-LRb8scDI.js.map +1 -0
  34. package/dist/chunks/{ListView-mr1Kmuj-.js → ListView-Cu6iQ0aG.js} +2 -2
  35. package/dist/chunks/{ListView-mr1Kmuj-.js.map → ListView-Cu6iQ0aG.js.map} +1 -1
  36. package/dist/chunks/{ListView-CjJ-4gD7.js → ListView-Dsezts8J.js} +2 -2
  37. package/dist/chunks/{ListView-CjJ-4gD7.js.map → ListView-Dsezts8J.js.map} +1 -1
  38. package/dist/chunks/{MetricsCountryMapView-D9J4Gwdi.js → MetricsCountryMapView-BkLDonK4.js} +2 -2
  39. package/dist/chunks/{MetricsCountryMapView-D9J4Gwdi.js.map → MetricsCountryMapView-BkLDonK4.js.map} +1 -1
  40. package/dist/chunks/{MetricsCountryMapView-BIsfmvE0.js → MetricsCountryMapView-BsJoEsUE.js} +2 -2
  41. package/dist/chunks/{MetricsCountryMapView-BIsfmvE0.js.map → MetricsCountryMapView-BsJoEsUE.js.map} +1 -1
  42. package/dist/chunks/{Modal-DYJadSN8.js → Modal-BRKy85bz.js} +3 -3
  43. package/dist/chunks/{Modal-DYJadSN8.js.map → Modal-BRKy85bz.js.map} +1 -1
  44. package/dist/chunks/{Modal-DF98u_sN.js → Modal-DKjxtaZI.js} +3 -3
  45. package/dist/chunks/{Modal-DF98u_sN.js.map → Modal-DKjxtaZI.js.map} +1 -1
  46. package/dist/chunks/{Passkeys-Dx5bduZJ.js → Passkeys-CMh9iSax.js} +2 -2
  47. package/dist/chunks/{Passkeys-C1m6avHh.js.map → Passkeys-CMh9iSax.js.map} +1 -1
  48. package/dist/chunks/{Passkeys-C1m6avHh.js → Passkeys-DF7mRGYj.js} +2 -2
  49. package/dist/chunks/{Passkeys-Dx5bduZJ.js.map → Passkeys-DF7mRGYj.js.map} +1 -1
  50. package/dist/chunks/{TokenManager-B-xR8zPl.js → TokenManager-CVR3ENIS.js} +2 -2
  51. package/dist/chunks/{TokenManager-B-xR8zPl.js.map → TokenManager-CVR3ENIS.js.map} +1 -1
  52. package/dist/chunks/{TokenManager-CZTL4OqZ.js → TokenManager-CWRL33UM.js} +2 -2
  53. package/dist/chunks/{TokenManager-CZTL4OqZ.js.map → TokenManager-CWRL33UM.js.map} +1 -1
  54. package/dist/chunks/{User-DRbw-wOB.js → User-BmS8zImI.js} +2 -2
  55. package/dist/chunks/{User-DRbw-wOB.js.map → User-BmS8zImI.js.map} +1 -1
  56. package/dist/chunks/{User-C6Tbn6vZ.js → User-CayBjzMG.js} +2 -2
  57. package/dist/chunks/{User-C6Tbn6vZ.js.map → User-CayBjzMG.js.map} +1 -1
  58. package/dist/chunks/{UserProfileView-CJKQNzSj.js → UserProfileView-B56WeGL1.js} +2 -2
  59. package/dist/chunks/{UserProfileView-CJKQNzSj.js.map → UserProfileView-B56WeGL1.js.map} +1 -1
  60. package/dist/chunks/{UserProfileView-AhUCUowp.js → UserProfileView-CrmACQjJ.js} +2 -2
  61. package/dist/chunks/{UserProfileView-AhUCUowp.js.map → UserProfileView-CrmACQjJ.js.map} +1 -1
  62. package/dist/chunks/{View-BWOE7WJm.js → View-IgBQlwd0.js} +2 -2
  63. package/dist/chunks/{View-BWOE7WJm.js.map → View-IgBQlwd0.js.map} +1 -1
  64. package/dist/chunks/{View-D6Ug7M6k.js → View-gAghvPMN.js} +2 -2
  65. package/dist/chunks/{View-D6Ug7M6k.js.map → View-gAghvPMN.js.map} +1 -1
  66. package/dist/chunks/{WebApp-By80XfTK.js → WebApp-B6wrmIaj.js} +2 -2
  67. package/dist/chunks/{WebApp-By80XfTK.js.map → WebApp-B6wrmIaj.js.map} +1 -1
  68. package/dist/chunks/{WebApp-CLTFSbto.js → WebApp-DeHPnmbD.js} +2 -2
  69. package/dist/chunks/{WebApp-CLTFSbto.js.map → WebApp-DeHPnmbD.js.map} +1 -1
  70. package/dist/chunks/{admin-D2CqCMaa.js → admin-D3DtCOgt.js} +2 -2
  71. package/dist/chunks/{admin-D2CqCMaa.js.map → admin-D3DtCOgt.js.map} +1 -1
  72. package/dist/chunks/{admin-Beq0Eckn.js → admin-oYYbqLlb.js} +2 -2
  73. package/dist/chunks/{admin-Beq0Eckn.js.map → admin-oYYbqLlb.js.map} +1 -1
  74. package/dist/chunks/{exportChart-DqydcfXz.js → exportChart-BK9mLt36.js} +2 -2
  75. package/dist/chunks/{exportChart-DqydcfXz.js.map → exportChart-BK9mLt36.js.map} +1 -1
  76. package/dist/chunks/{exportChart-Cn6owWxP.js → exportChart-mrfTf2Df.js} +2 -2
  77. package/dist/chunks/{exportChart-Cn6owWxP.js.map → exportChart-mrfTf2Df.js.map} +1 -1
  78. package/dist/chunks/{index-BKR6vFMH.js → index-DTXotoXw.js} +2 -2
  79. package/dist/chunks/{index-BKR6vFMH.js.map → index-DTXotoXw.js.map} +1 -1
  80. package/dist/chunks/{index-CMKYMKaH.js → index-NXnA6T-5.js} +2 -2
  81. package/dist/chunks/{index-CMKYMKaH.js.map → index-NXnA6T-5.js.map} +1 -1
  82. package/dist/chunks/{version-DQwtLRjN.js → version-Bpfg5FM3.js} +2 -2
  83. package/dist/chunks/{version-DQwtLRjN.js.map → version-Bpfg5FM3.js.map} +1 -1
  84. package/dist/chunks/{version-CBjwNXEK.js → version-CopJeO_u.js} +2 -2
  85. package/dist/chunks/{version-CBjwNXEK.js.map → version-CopJeO_u.js.map} +1 -1
  86. package/dist/css/web-mojo.css +1 -1
  87. package/dist/docit.cjs.js +1 -1
  88. package/dist/docit.es.js +1 -1
  89. package/dist/index.cjs.js +1 -1
  90. package/dist/index.cjs.js.map +1 -1
  91. package/dist/index.es.js +1 -1
  92. package/dist/index.es.js.map +1 -1
  93. package/dist/lightbox.cjs.js +1 -1
  94. package/dist/lightbox.es.js +1 -1
  95. package/dist/map.cjs.js +1 -1
  96. package/dist/map.es.js +1 -1
  97. package/dist/timeline.cjs.js +1 -1
  98. package/dist/timeline.es.js +1 -1
  99. package/dist/user-profile.cjs.js +1 -1
  100. package/dist/user-profile.es.js +1 -1
  101. package/dist/web-mojo.lite.iife.js +3507 -1562
  102. package/dist/web-mojo.lite.iife.js.map +1 -1
  103. package/dist/web-mojo.lite.iife.min.js +261 -327
  104. package/dist/web-mojo.lite.iife.min.js.map +1 -1
  105. package/package.json +1 -1
  106. package/dist/chunks/FormView-C_7xQuI4.js +0 -3
  107. package/dist/chunks/FormView-C_7xQuI4.js.map +0 -1
  108. package/dist/chunks/FormView-D8YrH2V4.js +0 -3
  109. package/dist/chunks/FormView-D8YrH2V4.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,78 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ### TimePicker / DateTimePicker — completes the picker rebuild
6
+
7
+ - New `timepicker` field type — HH:MM stepper with hour and minute
8
+ columns, `▲`/`▼` buttons, and direct numeric typing on the value.
9
+ Supports `format: '24h' | '12h'` (AM/PM toggle in 12h mode),
10
+ `step` (minute increment, e.g. `15`), and `min`/`max` clamping.
11
+ - New `datetimepicker` field type — Calendar on the left, time
12
+ stepper on the right, optional IANA timezone stacked full-width
13
+ below in one popover. Single field type with `timezone: false |
14
+ true` toggle (locked mockup variant A — single field type, the
15
+ TZ slot is part of the picker, not a separate field).
16
+ - Optional IANA timezone selector built on the existing `ComboBox`,
17
+ populated from `Intl.supportedValuesOf('timeZone')` with a curated
18
+ ~50-zone fallback. Default value is the user's local zone via
19
+ `Intl.DateTimeFormat().resolvedOptions().timeZone`. Inner field
20
+ name defaults to `'timezone'` so it lines up with backend
21
+ expectations.
22
+ - Time is **always stored as 24h canonical `'HH:MM'`** regardless of
23
+ display format. With timezone, the default storage is ISO-style
24
+ `'HH:MM±HH:MM'` (e.g. `'14:30-07:00'`); legacy `'HH:MM IANA/Zone'`
25
+ is opt-in via `outputFormat: 'iana'`; `outputFormat: 'object'`
26
+ yields `{ time, timezone }`.
27
+ - DateTime defaults to **ISO 8601** — `'2026-05-04T14:30:00'` without
28
+ timezone, `'2026-05-04T14:30:00-07:00'` with timezone. Backends
29
+ expecting JSON / Postgres-style timestamps handle this directly.
30
+ `outputFormat: 'iana'` falls back to `'YYYY-MM-DD HH:MM IANA/Zone'`,
31
+ and `outputFormat: 'object'` yields `{ date, time, timezone? }`.
32
+ - New `ianaOffset(zone, refDate)` helper resolves an IANA zone to its
33
+ current `±HH:MM` offset (DST-aware via `Intl.DateTimeFormat`).
34
+ - `parseDateTime` now also accepts ISO 8601 strings with offset
35
+ (`'2026-05-04T14:30:00-07:00'`, `'…Z'`, `'…+05:30'`) and round-trips
36
+ the offset back through the picker.
37
+ - New utilities in `dateFns.js`: `parseTime`, `formatTime`,
38
+ `compareTime`, `addMinutes`, `parseDateTime`, `formatDateTime`,
39
+ `formatDateTimeForDisplay`.
40
+ - Reuses `CalendarPopover` so the popover portal-mounts to
41
+ `document.body` and escapes clipping containers (modals,
42
+ overflow:hidden tables).
43
+ - Bootstrap-tokened theming. Light + dark from day one.
44
+ - Docs: new `docs/web-mojo/forms/inputs/TimePicker.md` and
45
+ `DateTimePicker.md`. Field-type tables and basic-types pointer
46
+ notes refreshed.
47
+ - Examples: new `TimePicker` and `DateTimePicker` example pages, and
48
+ the `DateTimeSuite` showcase grew two new cards covering the new
49
+ components.
50
+
51
+ ### DatePicker / DateRangePicker — in-house Calendar engine
52
+
53
+ - Replaced the prior Easepick-based pickers with an in-house `Calendar`
54
+ view that supports day, month, and year precision via a single
55
+ `precision` option. Same engine, three precisions — drill-down zoom
56
+ is the precision system (header click → month grid → year grid).
57
+ - New field-type aliases: `monthpicker`, `yearpicker`, `monthrange`,
58
+ `yearrange`. Existing `datepicker` and `daterange` configs keep
59
+ working unchanged with `precision` defaulting to `'day'`.
60
+ - DateRangePicker — best-in-class range selection: continuous range
61
+ fill, inward chevron anchors on start/end day cells, hover preview
62
+ between anchor and cursor, and **cross-page anchor persistence**
63
+ (click start in May, page to June, click end — no anchor loss).
64
+ Backwards selection auto-swaps start/end. Two-month side-by-side
65
+ default at day precision.
66
+ - Optional Stripe-style **preset sidebar** via `presets: 'default'`
67
+ with sensible defaults per precision (Today, Last 7 / 30 / 90 days,
68
+ This month, YTD, Last 12 months, etc.) or a custom array.
69
+ - No runtime CDN dependency, no native HTML5 fallback branch,
70
+ uniform behavior across all modern browsers.
71
+ - Bootstrap-tokened theming. Light + dark themes from day one — the
72
+ calendar reads `[data-bs-theme]` from the document root.
73
+ - New low-level utilities: `src/core/utils/dateFns.js` (parse / format
74
+ / compare / span counts at all three precisions; not a general-
75
+ purpose date library).
76
+
5
77
  ### TableView — Column `align` property
6
78
 
7
79
  - New `align` property on column definitions: `'left'`, `'center'`,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Collection-CtSGTegm.js"),t=require("./chunks/User-DRbw-wOB.js");class LoginEvent extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/logins"})}}class LoginEventList extends e.Collection{constructor(e={}){super({ModelClass:LoginEvent,endpoint:"/api/account/logins",...e})}}class IncidentStats extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/stats",requiresId:!1})}}class IncidentEvent extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event"})}}class IncidentEventList extends e.Collection{constructor(e={}){super({ModelClass:IncidentEvent,endpoint:"/api/incident/event",size:10,...e})}}const a={edit:{title:"Edit Incident Event",fields:[{name:"category",type:"select",label:"Category",placeholder:"Select category",options:()=>Incident.COMPONENTS,editable:!0,force_top:!0,cols:6},{name:"incident",type:"text",label:"Incident",placeholder:"Enter Incident ID",cols:6},{name:"description",type:"textarea",label:"Description",placeholder:"Enter Description",cols:12},{name:"details",type:"textarea",label:"Details",placeholder:"Enter Details",cols:12},{name:"component",type:"text",label:"Component",placeholder:"Enter Component",cols:8},{name:"component_id",type:"text",label:"Component ID",placeholder:"Enter Component ID",cols:4}]}};class Incident extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/incident"})}}class IncidentList extends e.Collection{constructor(e={}){super({ModelClass:Incident,endpoint:"/api/incident/incident",size:10,...e})}}class IncidentRuleSet extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset"})}}class IncidentRuleSetList extends e.Collection{constructor(e={}){super({ModelClass:IncidentRuleSet,endpoint:"/api/incident/event/ruleset",size:10,...e})}}class IncidentRule extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset/rule"})}}class IncidentRuleList extends e.Collection{constructor(e={}){super({ModelClass:IncidentRule,endpoint:"/api/incident/event/ruleset/rule",size:10,...e})}}class IncidentHistory extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/incident/history"})}}class IncidentHistoryList extends e.Collection{constructor(e={}){super({ModelClass:IncidentHistory,endpoint:"/api/incident/incident/history",size:10,...e})}}const n=[{value:0,label:"No Bundling"},{value:1,label:"By Hostname"},{value:2,label:"By Model Name"},{value:3,label:"By Model Name + ID"},{value:4,label:"By Source IP"},{value:5,label:"By Hostname + Model Name"},{value:6,label:"By Hostname + Model Name + ID"},{value:7,label:"By Source IP + Model Name"},{value:8,label:"By Source IP + Model Name + ID"},{value:9,label:"By Source IP + Hostname"}],l=[{value:0,label:"ALL (must match all rules)"},{value:1,label:"ANY (match any rule)"}],s=[{value:"==",label:"Equal (==)"},{value:"eq",label:"Equal (eq)"},{value:">",label:"Greater Than (>)"},{value:">=",label:"Greater Than or Equal (>=)"},{value:"<",label:"Less Than (<)"},{value:"<=",label:"Less Than or Equal (<=)"},{value:"contains",label:"Contains"},{value:"regex",label:"Regular Expression"}],o=[{value:"str",label:"String"},{value:"int",label:"Integer"},{value:"float",label:"Float"},{value:"bool",label:"Boolean"}],i=[{value:"level",label:"Level",description:"Event level (error, warning, info, debug)",meta:{type:"str"}},{value:"source_ip",label:"Source IP Address",description:"IP address of the event source",meta:{type:"str"}},{value:"rule_id",label:"Rule ID",description:"Numeric rule identifier",meta:{type:"int"}},{value:"hostname",label:"Hostname",description:"Hostname where event occurred",meta:{type:"str"}},{value:"component",label:"Component",description:"System component name",meta:{type:"str"}},{value:"component_id",label:"Component ID",description:"Component identifier",meta:{type:"str"}},{value:"category",label:"Category",description:"Event category (ossec, auth, api_error, etc.)",meta:{type:"str"}},{value:"description",label:"Description",description:"Event description text",meta:{type:"str"}},{value:"details",label:"Details",description:"Additional event details",meta:{type:"str"}},{value:"alert_id",label:"Alert ID",description:"Numeric alert identifier",meta:{type:"int"}},{value:"severity",label:"Severity",description:"Numeric severity level",meta:{type:"int"}},{value:"user",label:"User",description:"Username associated with event",meta:{type:"str"}},{value:"action",label:"Action",description:"Action that triggered the event",meta:{type:"str"}},{value:"status",label:"Status",description:"Status value or code",meta:{type:"str"}},{value:"status_code",label:"Status Code",description:"Numeric status code (e.g., HTTP status)",meta:{type:"int"}},{value:"message",label:"Message",description:"Event message text",meta:{type:"str"}},{value:"path",label:"Path",description:"File path or URL path",meta:{type:"str"}},{value:"title",label:"Title",description:"OSSEC Title",meta:{type:"str"}},{value:"country_code",label:"Country Code",description:"Country code associated with event",meta:{type:"str"}},{value:"region",label:"Region",description:"Region associated with event",meta:{type:"str"}},{value:"city",label:"City",description:"City associated with event",meta:{type:"str"}},{value:"http_user_agent",label:"HTTP User Agent",description:"User agent string associated with event",meta:{type:"str"}},{value:"request_path",label:"Request Path",description:"Request path associated with event",meta:{type:"str"}},{value:"method",label:"Method",description:"HTTP method or function name",meta:{type:"str"}}],r=["global","account","ossec","api","realtime","auth","login:unknown","invalid_password","sms:login_unknown","totp:login_unknown","reset:unknown","magic:unknown","token:unknown","api_denied","unauthenticated","view_permission_denied","edit_permission_denied","group_member_permission_denied","user_permission_denied","security_alert","totp:confirm_failed","totp:login_failed","totp:recovery_used","sms:otp_failed","email:no_mailbox","email:send_failed","sms:send_failed","email_change:bad_password","email_change:requested","account:deactivate_requested","phone_verify:invalid","email_verify:invalid","oauth:unlink_guard_error","rest_error","mojo_rest_error","rest_value_error"],c=r;class RuleSet extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset"})}}class RuleSetList extends e.Collection{constructor(e={}){super({ModelClass:RuleSet,endpoint:"/api/incident/event/ruleset",...e})}}const u=[{value:0,label:"Disabled — each event gets its own incident"},{value:5,label:"5 minutes"},{value:10,label:"10 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"},{value:120,label:"2 hours"},{value:360,label:"6 hours"},{value:720,label:"12 hours"},{value:1440,label:"1 day"},{value:null,label:"No limit — bundle forever"}],d={create:{title:"Create RuleSet",size:"lg",fields:[{type:"tabset",name:"rulesetTabs",tabs:[{label:"General",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"e.g., Brute Force Detection",columns:6},{name:"match_by",type:"select",label:"Match Logic",value:0,options:l,tooltip:"ALL = every condition must match. ANY = at least one",columns:6},{name:"category",type:"combo",label:"Scope / Category",required:!0,options:r,allowCustom:!0,placeholder:"Type or select...",tooltip:"Scope or event category to match. Use * as a catch-all",columns:6},{name:"priority",type:"number",label:"Evaluation Priority",value:10,required:!0,tooltip:"Lower number = evaluated first",columns:6},{name:"is_active",type:"switch",label:"Active",value:!0,tooltip:"Inactive rules are skipped during event processing",columns:6},{name:"metadata.delete_on_resolution",type:"switch",label:"Delete on Resolution",value:!1,tooltip:"Incidents are permanently deleted when resolved or closed (CASCADE)",columns:6}]},{label:"Bundling",fields:[{name:"bundle_by",type:"select",label:"Bundle By",value:4,options:n,tooltip:"How to group related events into one incident",columns:6},{name:"bundle_minutes",type:"select",label:"Bundle Window",value:30,options:u,tooltip:"Events outside this window create a new incident",columns:6},{name:"bundle_by_rule_set",type:"switch",label:"Bundle by RuleSet",value:!0,tooltip:"Group events matched by this rule into the same incident",columns:6}]},{label:"Thresholds",fields:[{type:"html",columns:12,html:'<div class="alert alert-info small mb-3">\n <i class="bi bi-info-circle me-1"></i>\n <strong>How thresholds work:</strong> Events accumulate in "pending" status.\n Once trigger count is reached, the handler fires and the incident becomes "new".\n Leave empty to fire immediately on the first event.\n </div>'},{name:"trigger_count",type:"number",label:"Trigger Count",placeholder:"Empty = immediate",tooltip:"Number of events before the handler fires",columns:4},{name:"trigger_window",type:"number",label:"Trigger Window (min)",placeholder:"Empty = all events",tooltip:"Only count events within this many minutes",columns:4},{name:"retrigger_every",type:"number",label:"Re-trigger Every",placeholder:"Empty = once",tooltip:"Re-fire handler every N additional events after initial trigger",columns:4}]},{label:"Handler",fields:[{name:"handler",type:"text",label:"Handler Chain",placeholder:"e.g., block://?ttl=3600,ticket://?priority=8",tooltip:"Chain multiple handlers with commas",columns:12},{type:"html",columns:12,html:'<div class="alert alert-light border small mb-0">\n <code>block://?ttl=3600</code> — Block source IP<br>\n <code>ticket://?priority=8</code> — Create ticket<br>\n <code>email://perm@manage_security</code> — Email notification<br>\n <code>sms://perm@manage_security</code> — SMS notification<br>\n <code>notify://perm@manage_security</code> — In-app + push<br>\n <code>llm://</code> — LLM triage agent<br>\n <code>job://myapp.module.function</code> — Async job\n </div>'}]}]}]},edit:{title:"Edit RuleSet",size:"lg",fields:[{type:"tabset",name:"rulesetTabs",tabs:[{label:"General",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"e.g., Brute Force Detection",columns:6},{name:"match_by",type:"select",label:"Match Logic",options:l,tooltip:"ALL = every condition must match. ANY = at least one",columns:6},{name:"category",type:"combo",label:"Scope / Category",options:r,allowCustom:!0,required:!0,placeholder:"Type or select...",tooltip:"Scope or event category to match. Use * as a catch-all",columns:6},{name:"priority",type:"number",label:"Evaluation Priority",required:!0,tooltip:"Lower number = evaluated first",columns:6},{name:"is_active",type:"switch",label:"Active",tooltip:"Inactive rules are skipped during event processing",columns:6},{name:"metadata.delete_on_resolution",type:"switch",label:"Delete on Resolution",tooltip:"Incidents are permanently deleted when resolved or closed (CASCADE)",columns:6}]},{label:"Bundling",fields:[{name:"bundle_by",type:"select",label:"Bundle By",options:n,tooltip:"How to group related events into one incident",columns:6},{name:"bundle_minutes",type:"select",label:"Bundle Window",options:u,tooltip:"Events outside this window create a new incident",columns:6},{name:"bundle_by_rule_set",type:"switch",label:"Bundle by RuleSet",tooltip:"Group events matched by this rule into the same incident",columns:6}]},{label:"Thresholds",fields:[{type:"html",columns:12,html:'<div class="alert alert-info small mb-3">\n <i class="bi bi-info-circle me-1"></i>\n <strong>How thresholds work:</strong> Events accumulate in "pending" status.\n Once trigger count is reached, the handler fires and the incident becomes "new".\n Leave empty to fire immediately on the first event.\n </div>'},{name:"trigger_count",type:"number",label:"Trigger Count",placeholder:"Empty = immediate",tooltip:"Number of events before the handler fires",columns:4},{name:"trigger_window",type:"number",label:"Trigger Window (min)",placeholder:"Empty = all events",tooltip:"Only count events within this window toward the trigger count",columns:4},{name:"retrigger_every",type:"number",label:"Re-trigger Every",placeholder:"Empty = once",tooltip:"Re-fire handler every N additional events after initial trigger",columns:4}]},{label:"Handler",fields:[{name:"handler",type:"text",label:"Handler Chain",placeholder:"e.g., block://?ttl=3600,ticket://?priority=8",tooltip:"Chain multiple handlers with commas",columns:12},{type:"html",columns:12,html:'<div class="alert alert-light border small mb-0">\n <code>block://?ttl=3600</code> — Block source IP<br>\n <code>ticket://?priority=8</code> — Create ticket<br>\n <code>email://perm@manage_security</code> — Email notification<br>\n <code>sms://perm@manage_security</code> — SMS notification<br>\n <code>notify://perm@manage_security</code> — In-app + push<br>\n <code>llm://</code> — LLM triage agent<br>\n <code>job://myapp.module.function</code> — Async job\n </div>'}]}]}]}};class Rule extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset/rule"})}}class RuleList extends e.Collection{constructor(e={}){super({ModelClass:Rule,endpoint:"/api/incident/event/ruleset/rule",...e})}}const p={create:{title:"Create Rule",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"Enter rule name",cols:12},{name:"field_name",type:"combo",label:"Field Name",required:!0,placeholder:"Select or enter field name...",options:i,allowCustom:!0,showDescription:!0,help:"Select a common field or type a custom field name",cols:8},{name:"index",type:"select",label:"Index",required:!0,start:0,end:14,step:1,cols:4},{name:"comparator",type:"select",label:"Comparator",required:!0,options:s,cols:6},{name:"value_type",type:"select",label:"Value Type",required:!0,options:o,value:"str",cols:6},{name:"value",type:"textarea",label:"Value",required:!0,placeholder:"Enter comparison value",cols:12}]},edit:{title:"Edit Rule",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"Enter rule name",cols:12},{name:"field_name",type:"combo",label:"Field Name",required:!0,placeholder:"Select or enter field name...",options:i,allowCustom:!0,showDescription:!0,help:"Select a common field or type a custom field name",cols:12},{name:"comparator",type:"select",label:"Comparator",required:!0,options:s,cols:6},{name:"value_type",type:"select",label:"Value Type",required:!0,options:o,cols:6},{name:"value",type:"text",label:"Value",required:!0,placeholder:"Enter comparison value",cols:12}]}};RuleSet.EDIT_FORM=d.edit,RuleSet.ADD_FORM=d.create,RuleSet.CREATE_FORM=d.create,RuleSet.BundleByOptions=n,RuleSet.MatchByOptions=l,Rule.EDIT_FORM=p.edit,Rule.ADD_FORM=p.create,Rule.CREATE_FORM=p.create,Rule.ComparatorOptions=s,Rule.ValueTypeOptions=o;class PushDevice extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push"})}}class PushDeviceList extends e.Collection{constructor(e={}){super({ModelClass:PushDevice,endpoint:"/api/account/devices/push",...e})}}class PushTemplate extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push/templates"})}}class PushTemplateList extends e.Collection{constructor(e={}){super({ModelClass:PushTemplate,endpoint:"/api/account/devices/push/templates",...e})}}class PushConfig extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push/config"})}}class PushConfigList extends e.Collection{constructor(e={}){super({ModelClass:PushConfig,endpoint:"/api/account/devices/push/config",...e})}}class PushDelivery extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push/deliveries"})}}class PushDeliveryList extends e.Collection{constructor(e={}){super({ModelClass:PushDelivery,endpoint:"/api/account/devices/push/deliveries",...e})}}const m={create:{title:"Create Push Configuration",fields:[{name:"name",label:"Name",required:!0},{type:"collection",name:"group",label:"Group (optional)",Collection:t.GroupList,labelField:"name",valueField:"id"},{name:"fcm_service_account",label:"Service Account",type:"textarea",rows:10}]},edit:{title:"Edit Push Configuration",fields:[{name:"name",label:"Name",required:!0},{type:"collection",name:"group",label:"Group (optional)",Collection:t.GroupList,labelField:"name",valueField:"id"},{name:"fcm_service_account",label:"Service Account",type:"textarea",rows:10},{name:"is_active",label:"Is Active",type:"switch",value:!0}]}},b={edit:{title:"Edit Push Template",fields:[{name:"name",label:"Name",required:!0},{name:"category",label:"Category",required:!0},{type:"collection",name:"group",label:"Group (optional)",Collection:t.GroupList,labelField:"name",valueField:"id",defaultParams:{is_active:!0}},{name:"title_template",label:"Title Template",required:!0},{name:"body_template",label:"Body Template",type:"textarea",required:!0},{name:"action_url",label:"Action URL"},{name:"priority",label:"Priority",type:"select",options:["high","normal"]},{name:"variables",label:"Variables",type:"json",help:"JSON format"},{name:"is_active",label:"Is Active",type:"switch"}]}};m.create=m.edit,b.create=b.edit;class Ticket extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/ticket"})}}class TicketList extends e.Collection{constructor(e={}){super({ModelClass:Ticket,endpoint:"/api/incident/ticket",...e})}}const h={ticket:"Ticket",bug:"Bug",feature:"Feature Request",incident:"Incident",security:"Security Incident",fulfillment:"Fulfillment",new_user:"New User",new_group:"New Group",qa:"Quality Assurance"},y=Object.entries(h).map(([e,t])=>({value:e,label:t})),v={create:{title:"Create Ticket",fields:[{name:"title",type:"text",label:"Title",required:!0,cols:12},{name:"description",type:"textarea",label:"Description",required:!1,cols:12},{name:"category",type:"select",label:"Category",options:y,cols:12,value:"ticket"},{name:"priority",type:"number",label:"Priority",value:5,cols:6},{name:"status",type:"select",label:"Status",options:["new","open","paused","resolved","qa","ignored"],cols:6,value:"new"},{type:"collection",name:"assignee",label:"Assignee",Collection:t.UserList,labelField:"display_name",valueField:"id",cols:12},{type:"collection",name:"incident",label:"Incident",Collection:IncidentList,labelField:"title",valueField:"id",cols:12}]},edit:{title:"Edit Ticket",fields:[{name:"title",type:"text",label:"Title",required:!0,cols:12},{name:"description",type:"textarea",label:"Description",required:!1,cols:12},{name:"category",type:"select",label:"Category",options:y,cols:12},{name:"priority",type:"number",label:"Priority",cols:6},{name:"status",type:"select",label:"Status",options:["new","open","paused","resolved","qa","ignored"],cols:6},{type:"collection",name:"assignee",label:"Assignee",Collection:t.UserList,labelField:"display_name",valueField:"id",cols:12},{type:"collection",name:"incident",label:"Incident",Collection:IncidentList,labelField:"title",valueField:"id",cols:12}]}};class TicketNote extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/ticket/note"})}}class TicketNoteList extends e.Collection{constructor(e={}){super({ModelClass:TicketNote,endpoint:"/api/incident/ticket/note",...e})}}class AssistantConversation extends e.Model{constructor(e={}){super(e,{endpoint:"/api/assistant/conversation"})}}class AssistantConversationList extends e.Collection{constructor(e={}){super({ModelClass:AssistantConversation,endpoint:"/api/assistant/conversation",size:50,...e})}}class AssistantSkill extends e.Model{constructor(e={}){super(e,{endpoint:"/api/assistant/skill"})}}class AssistantSkillList extends e.Collection{constructor(e={}){super({ModelClass:AssistantSkill,endpoint:"/api/assistant/skill",size:50,...e})}}class Job extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/job"})}async cancel(){const e=await this.save({cancel_request:!0});return e.success&&e.data.status&&this.set("cancel_requested",!0),e}async retry(e=null){const t=e?{retry_request:{retry:!0,delay:e}}:{retry_request:!0},a=await this.save(t);return a.success&&a.data.status&&a.data.new_job_id?{...a,newJobId:a.data.new_job_id,originalJobId:a.data.original_job_id}:a}async getDetailedStatus(){const e=await this.save({get_status:!0});return e.success&&e.data.status&&this.set(e.data.data),e}async cloneJob(e={}){const t={publish_job:{payload:e,...e}},a=await this.save(t);return a.success&&a.data.status&&a.data.job_id?{...a,newJobId:a.data.job_id,templateJobId:a.data.template_job_id}:a}isActive(){const e=this.get("status");return["pending","running"].includes(e)}isTerminal(){const e=this.get("status");return["completed","failed","canceled","expired"].includes(e)}canRetry(){const e=this.get("status");return["failed","canceled","expired"].includes(e)&&!1!==this.get("is_retriable")}canCancel(){const e=this.get("status");return["pending","running"].includes(e)&&!this.get("cancel_requested")}getStatusBadgeClass(){return{pending:"bg-primary",running:"bg-success",completed:"bg-info",failed:"bg-danger",canceled:"bg-secondary",expired:"bg-warning"}[this.get("status")]||"bg-secondary"}getStatusIcon(){return{pending:"bi-hourglass",running:"bi-arrow-repeat",completed:"bi-check-circle",failed:"bi-x-octagon",canceled:"bi-x-circle",expired:"bi-clock"}[this.get("status")]||"bi-question-circle"}getEvents(){return this.get("recent_events")||[]}getFormattedDuration(){const e=this.get("duration_ms");return e&&0!==e?e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`:"N/A"}getQueuePosition(){return this.get("queue_position")}hasExpired(){const e=this.get("expires_at");return!!e&&new Date(e)</* @__PURE__ */new Date}getRunnerId(){return this.get("runner_id")}getPayload(){return this.get("payload")||{}}getMetadata(){return this.get("metadata")||{}}}class JobList extends e.Collection{constructor(e={}){super({ModelClass:Job,endpoint:"/api/jobs/job",...e})}async fetchByStatus(e,t={}){return this.fetch({status:e,...t})}async fetchByChannel(e,t={}){return this.fetch({channel:e,...t})}async fetchPending(e={}){return this.fetchByStatus("pending",e)}async fetchRunning(e={}){return this.fetchByStatus("running",e)}async fetchCompleted(e={}){return this.fetchByStatus("completed",e)}async fetchFailed(e={}){return this.fetchByStatus("failed",e)}async fetchScheduled(e={}){return this.fetch({scheduled:!0,...e})}}Job.publish=async function(t){return await e.rest.POST("/api/jobs/publish",t)},Job.getStats=async function(){const t=await e.rest.GET("/api/jobs/stats");return t.success?t.data:null},Job.getHealth=async function(t=null){const a=t?`/api/jobs/health/${t}`:"/api/jobs/health",n=e.rest.GET(a);return n.success?n.data:null},Job.test=async function(){return await e.rest.POST("/api/jobs/test",{})},Job.tests=async function(){return await e.rest.POST("/api/jobs/tests",{})},Job.clearStuck=async function(t=null){const a=t?{channel:t}:{};return await e.rest.POST("/api/jobs/control/clear-stuck",a)},Job.clearChannel=async function(t){return await e.rest.POST("/api/jobs/control/clear-queue",{channel:t,confirm:"yes"})},Job.cleanConsumers=async function(){return await e.rest.POST("/api/jobs/control/cleanup-consumers")},Job.purgeJobs=async function(t){return await e.rest.POST("/api/jobs/control/purge",{days_old:t})};class JobLog extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/logs"})}}class JobLogList extends e.Collection{constructor(e={}){super({endpoint:"/api/jobs/logs",model:JobLog,...e})}}class JobEvent extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/event"})}}class JobEventList extends e.Collection{constructor(e={}){super({endpoint:"/api/jobs/event",model:JobEvent,...e})}}class JobsEngineStats extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/stats",requiresId:!1})}}class EmailDomain extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/domain",...t})}async onboard(e={},t={}){if(!this.id)return await this.showError("Cannot onboard domain without ID"),{success:!1,status:400,error:"Missing domain id"};try{const a=`${this.buildUrl(this.id)}/onboard`;return await this.rest.POST(a,e,t.params)}catch(a){return{success:!1,status:a?.status||500,error:a?.message||"Failed to onboard domain"}}}async audit(e={}){if(!this.id)return await this.showError("Cannot audit domain without ID"),{success:!1,status:400,error:"Missing domain id"};const t=(e.method||"GET").toUpperCase(),a=`${this.buildUrl(this.id)}/audit`;try{return"POST"===t?await this.rest.POST(a,e.data||{},e.params):await this.rest.GET(a,e.params)}catch(n){return{success:!1,status:n?.status||500,error:n?.message||"Failed to audit domain"}}}async reconcile(e={},t={}){if(!this.id)return await this.showError("Cannot reconcile domain without ID"),{success:!1,status:400,error:"Missing domain id"};try{const a=`${this.buildUrl(this.id)}/reconcile`;return await this.rest.POST(a,e,t.params)}catch(a){return{success:!1,status:a?.status||500,error:a?.message||"Failed to reconcile domain"}}}static async onboardById(e,t={},a={}){const n=new EmailDomain({id:e},a);return await n.onboard(t,a)}static async auditById(e,t={}){const a=new EmailDomain({id:e},t);return await a.audit(t)}static async reconcileById(e,t={},a={}){const n=new EmailDomain({id:e},a);return await n.reconcile(t,a)}}class EmailDomainList extends e.Collection{constructor(e={}){super({ModelClass:EmailDomain,endpoint:"/api/aws/email/domain",size:10,...e})}}class Mailbox extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/mailbox",...t})}}Mailbox.sendEmail=async function(t){return await e.rest.POST("/api/aws/email/send",t)};class MailboxList extends e.Collection{constructor(e={}){super({ModelClass:Mailbox,endpoint:"/api/aws/email/mailbox",size:10,...e})}}const g={create:{title:"Add Mailbox",fields:[{type:"collection",name:"domain",label:"Domain",Collection:EmailDomainList,labelField:"name",valueField:"id",maxItems:10,placeholder:"Search domains...",emptyFetch:!1,required:!0,debounceMs:300,columns:12},{name:"email",type:"email",label:"Email Address",placeholder:"support@example.com",required:!0,columns:12},{name:"allow_inbound",type:"switch",label:"Allow Inbound",columns:6},{name:"allow_outbound",type:"switch",label:"Allow Outbound",defaultValue:!0,columns:6},{name:"is_system_default",type:"switch",label:"System Default",columns:6},{name:"is_domain_default",type:"switch",label:"Domain Default",columns:6},{name:"async_handler",type:"text",label:"Async Handler (optional)",placeholder:"myapp.handlers.process_support",columns:12,help:"Module:function to process inbound messages via task system"}]},edit:{title:"Edit Mailbox",fields:[{name:"email",type:"email",label:"Email Address",required:!0,columns:12},{name:"allow_inbound",type:"switch",label:"Allow Inbound",columns:6},{name:"allow_outbound",type:"switch",label:"Allow Outbound",columns:6},{name:"is_system_default",type:"switch",label:"System Default",columns:6},{name:"is_domain_default",type:"switch",label:"Domain Default",columns:6},{name:"async_handler",type:"text",label:"Async Handler (optional)",placeholder:"myapp.handlers.process_support",columns:12}]}};class SentMessage extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/sent",...t})}}class SentMessageList extends e.Collection{constructor(e={}){super({ModelClass:SentMessage,endpoint:"/api/aws/email/sent",size:10,...e})}}class EmailTemplate extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/template",...t})}}class EmailTemplateList extends e.Collection{constructor(e={}){super({ModelClass:EmailTemplate,endpoint:"/api/aws/email/template",size:10,...e})}}class PublicMessage extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/public_message"})}}class PublicMessageList extends e.Collection{constructor(e={}){super({ModelClass:PublicMessage,endpoint:"/api/account/public_message",size:25,...e})}}class PhoneNumber extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/phonehub/number",...t})}static async normalize(t,a="US"){const n={phone_number:t};a&&(n.country_code=a);const l=await e.rest.POST("/api/phonehub/number/normalize",n),s=l?.data??l;return!0===s?.status||!0===s?.success?{success:!0,phone_number:s?.data?.phone_number??s?.phone_number,data:s?.data??s,response:l}:{success:!1,error:s?.error||"Normalization failed",response:l}}static async lookup(t,a={}){const n=await e.rest.POST("/api/phonehub/number/lookup",{phone_number:t,...a}),l=n?.data??n;if(!0===l?.status||!0===l?.success){const e=l?.data??{};return{success:!0,model:new PhoneNumber(e,{endpoint:"/api/phonehub/number"}),data:e,response:n}}return{success:!1,error:l?.error||"Phone lookup failed",response:n}}}class PhoneNumberList extends e.Collection{constructor(e={}){super({ModelClass:PhoneNumber,endpoint:"/api/phonehub/number",size:10,...e})}}class SMS extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/phonehub/sms",...t})}static async send(t={}){const a=await e.rest.POST("/api/phonehub/sms/send",t),n=a?.data??a;if(!0===n?.status||!0===n?.success){const e=n?.data??{};return{success:!0,model:new SMS(e,{endpoint:"/api/phonehub/sms"}),data:e,response:a}}return{success:!1,error:n?.error||"Failed to send SMS",response:a}}}class SMSList extends e.Collection{constructor(e={}){super({ModelClass:SMS,endpoint:"/api/phonehub/sms",size:10,...e})}}const x={PhoneNumber:PhoneNumber,PhoneNumberList:PhoneNumberList,SMS:SMS,SMSList:SMSList};class JobRunner extends e.Model{constructor(e={}){e.runner_id&&!e.id&&(e.id=e.runner_id),super(e,{endpoint:"/api/jobs/runners",idAttribute:"runner_id"})}async ping(e=2){const t=this.getApp();if(!t||!t.rest)throw new Error("App or REST client not available");const a=await t.rest.POST("/api/jobs/runners/ping",{runner_id:this.get("runner_id"),timeout:e});return a.success&&a.data.status&&(this.set("last_heartbeat",/* @__PURE__ */(new Date).toISOString()),this.set("ping_status",a.data.ping_status||"success")),a}async shutdown(e=!0){const t=this.getApp();if(!t||!t.rest)throw new Error("App or REST client not available");const a=await t.rest.POST("/api/jobs/runners/shutdown",{runner_id:this.get("runner_id"),graceful:e});return a.success&&a.data.status&&this.set("alive",!1),a}getChannels(){return this.get("channels")||[]}getStatusBadgeClass(){return this.get("alive")?"bg-success":"bg-danger"}getStatusIcon(){return this.get("alive")?"bi-check-circle-fill":"bi-x-octagon-fill"}isActive(){return!0===this.get("alive")}isHealthy(){if(!this.isActive())return!1;const e=this.get("last_heartbeat");return!!e&&(Date.now()-new Date(e).getTime())/1e3<120}getFormattedHeartbeatAge(){const e=this.get("last_heartbeat");if(!e)return"Never";const t=(Date.now()-new Date(e).getTime())/1e3;return t<60?`${Math.round(t)}s ago`:t<3600?`${Math.round(t/60)}m ago`:`${Math.round(t/3600)}h ago`}getUtilization(){const e=(this.get("jobs_processed")||0)+(this.get("jobs_failed")||0);return e>10?100:Math.min(10*e,100)}getFormattedUptime(){const e=this.get("started");if(!e)return"Unknown";const t=new Date(e),a=/* @__PURE__ */new Date-t,n=Math.floor(a/1e3);return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}d`}getWorkerInfo(){const e=this.get("jobs_processed")||0,t=this.get("jobs_failed")||0;return{processed:e,failed:t,total:e+t,alive:this.get("alive"),utilization:this.getUtilization()}}getDisplayName(){const e=this.get("runner_id");if(!e)return"Unknown Runner";const t=e.split("-");return t.length>1?t[0]:e}canControl(){return!0===this.get("alive")}}class JobRunnerList extends e.Collection{constructor(e={}){super({ModelClass:JobRunner,endpoint:"/api/jobs/runners",...e})}getActive(){return this.where(e=>e.isActive())}getByChannel(e){return this.where(t=>t.getChannels().includes(e))}getHealthy(){return this.where(e=>e.isHealthy())}getTotalProcessed(){return this.models.reduce((e,t)=>e+(t.get("jobs_processed")||0),0)}getTotalFailed(){return this.models.reduce((e,t)=>e+(t.get("jobs_failed")||0),0)}getSystemHealth(){if(0===this.models.length)return 0;const e=this.models.filter(e=>e.get("alive")).length;return Math.round(e/this.models.length*100)}getAllChannels(){const e=/* @__PURE__ */new Set;return this.models.forEach(t=>{t.getChannels().forEach(t=>e.add(t))}),Array.from(e).sort()}}JobRunner.ping=async function(e,t=2){const a="undefined"!=typeof window&&window.app;if(!a||!a.rest)throw new Error("App or REST client not available");return await a.rest.POST("/api/jobs/runners/ping",{runner_id:e,timeout:t})},JobRunner.shutdown=async function(e,t=!0){const a="undefined"!=typeof window&&window.app;if(!a||!a.rest)throw new Error("App or REST client not available");return await a.rest.POST("/api/jobs/runners/shutdown",{runner_id:e,graceful:t})},JobRunner.broadcast=async function(e,t={},a=2){const n="undefined"!=typeof window&&window.app;if(!n||!n.rest)throw new Error("App or REST client not available");return await n.rest.POST("/api/jobs/runners/broadcast",{command:e,data:t,timeout:a})},JobRunner.broadcastStatus=async function(e=2){return JobRunner.broadcast("status",{},e)},JobRunner.broadcastShutdown=async function(e=2){return JobRunner.broadcast("shutdown",{},e)},JobRunner.broadcastPause=async function(e=2){return JobRunner.broadcast("pause",{},e)},JobRunner.broadcastResume=async function(e=2){return JobRunner.broadcast("resume",{},e)},JobRunner.broadcastReload=async function(e=2){return JobRunner.broadcast("reload",{},e)};class ScheduledTask extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/jobs/scheduled_task",...t})}}class ScheduledTaskList extends e.Collection{constructor(e={}){super({ModelClass:ScheduledTask,endpoint:"/api/jobs/scheduled_task",size:25,...e})}}class TaskResult extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/jobs/task_result",...t})}}class TaskResultList extends e.Collection{constructor(e={}){super({ModelClass:TaskResult,endpoint:"/api/jobs/task_result",size:25,...e})}}class BouncerDevice extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/account/bouncer/device",...t})}}class BouncerDeviceList extends e.Collection{constructor(e={}){super({ModelClass:BouncerDevice,endpoint:"/api/account/bouncer/device",size:25,...e})}}class BouncerSignal extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/account/bouncer/signal",...t})}}class BouncerSignalList extends e.Collection{constructor(e={}){super({ModelClass:BouncerSignal,endpoint:"/api/account/bouncer/signal",size:25,...e})}}class BouncerSignature extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/account/bouncer/signature",...t})}}class BouncerSignatureList extends e.Collection{constructor(e={}){super({ModelClass:BouncerSignature,endpoint:"/api/account/bouncer/signature",size:25,...e})}}const S=[{value:"country",label:"Country — Block all traffic from a country"},{value:"abuse",label:"Abuse Feed — Import known attacker IPs"},{value:"datacenter",label:"Datacenter — Block datacenter/hosting ranges"},{value:"custom",label:"Custom — Define your own CIDR list"}],f=[{value:"country",label:"Country"},{value:"abuse",label:"Abuse Feed"},{value:"datacenter",label:"Datacenter"},{value:"custom",label:"Custom"}],w=[{value:"ipdeny",label:"IPDeny (Country Zones)"},{value:"abuseipdb",label:"AbuseIPDB"},{value:"manual",label:"Manual"}],_=[{value:"cn",label:"China"},{value:"ru",label:"Russia"},{value:"kp",label:"North Korea"},{value:"ir",label:"Iran"},{value:"ng",label:"Nigeria"},{value:"ro",label:"Romania"},{value:"br",label:"Brazil"},{value:"in",label:"India"},{value:"pk",label:"Pakistan"},{value:"id",label:"Indonesia"},{value:"vn",label:"Vietnam"},{value:"ua",label:"Ukraine"},{value:"th",label:"Thailand"},{value:"ph",label:"Philippines"},{value:"bd",label:"Bangladesh"},{value:"eg",label:"Egypt"},{value:"tr",label:"Turkey"},{value:"mx",label:"Mexico"},{value:"ar",label:"Argentina"},{value:"co",label:"Colombia"}];class IPSet extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/ipset"})}}class IPSetList extends e.Collection{constructor(e={}){super({ModelClass:IPSet,endpoint:"/api/incident/ipset",...e})}}const C={create:{title:"Create IP Set",size:"md",fields:[{name:"kind",type:"select",label:"What do you want to block?",required:!0,options:S,value:"country",columns:12},{name:"country_code",type:"select",label:"Country",required:!0,options:_,help:"Select a country to block. CIDRs are fetched automatically from IPDeny.",columns:8,showWhen:{field:"kind",value:"country"}},{name:"source_key",type:"text",label:"API Key",required:!0,placeholder:"Your AbuseIPDB API key",help:"Get a free key at abuseipdb.com. Never stored in plaintext.",columns:12,showWhen:{field:"kind",value:"abuse"}},{name:"source_url",type:"url",label:"Source URL",required:!0,placeholder:"https://example.com/datacenter-ranges.txt",help:"URL to a plain text file with one CIDR per line.",columns:12,showWhen:{field:"kind",value:"datacenter"}},{name:"data",type:"textarea",label:"CIDR List",rows:8,placeholder:"# One CIDR per line\n192.0.2.0/24\n198.51.100.0/24\n203.0.113.0/24",help:"Enter IP ranges in CIDR notation. Lines starting with # are ignored.",columns:12,showWhen:{field:"kind",value:"custom"}},{name:"name",type:"text",label:"Name",required:!0,placeholder:"e.g., abuse_ips, dc_aws",help:"Unique identifier. Used as the kernel ipset name.",columns:6,showWhen:{field:"kind",value:"country",negate:!0}},{name:"description",type:"text",label:"Description",placeholder:"Human-readable label",columns:6,showWhen:{field:"kind",value:"country",negate:!0}},{name:"is_enabled",type:"switch",label:"Enable immediately",value:!0,help:"When enabled, CIDRs are synced to the fleet and traffic is blocked.",columns:4}]},edit:{title:"Edit IP Set",size:"md",fields:[{name:"name",type:"text",label:"Name",required:!0,columns:6},{name:"kind",type:"select",label:"Kind",options:f,disabled:!0,columns:3},{name:"is_enabled",type:"switch",label:"Enabled",columns:3},{name:"description",type:"text",label:"Description",columns:12},{name:"source",type:"select",label:"Source",options:w,columns:6},{name:"source_url",type:"url",label:"Source URL",columns:6},{name:"source_key",type:"text",label:"API Key",placeholder:"Leave blank to keep current key",help:"Write-only — current value is never shown.",columns:12}]}};IPSet.EDIT_FORM=C.edit;class S3Bucket extends e.Model{constructor(e={}){super(e,{endpoint:"/api/aws/s3/bucket"})}}class S3BucketList extends e.Collection{constructor(e={}){super({ModelClass:S3Bucket,endpoint:"/api/aws/s3/bucket",size:10,...e})}}exports.Assistant=AssistantConversation,exports.AssistantConversation=AssistantConversation,exports.AssistantConversationList=AssistantConversationList,exports.AssistantSkill=AssistantSkill,exports.AssistantSkillList=AssistantSkillList,exports.BouncerDevice=BouncerDevice,exports.BouncerDeviceList=BouncerDeviceList,exports.BouncerSignal=BouncerSignal,exports.BouncerSignalList=BouncerSignalList,exports.BouncerSignature=BouncerSignature,exports.BouncerSignatureForms={create:{title:"Create Signature",fields:[{name:"sig_type",type:"select",label:"Signature Type",required:!0,columns:6,options:[{value:"user_agent",label:"User Agent"},{value:"ip_pattern",label:"IP Pattern"},{value:"fingerprint",label:"Fingerprint"},{value:"behavior",label:"Behavior"},{value:"header",label:"Header"},{value:"cookie",label:"Cookie"}]},{name:"value",type:"text",label:"Value",required:!0,columns:6,help:"The pattern or value to match against."},{name:"confidence",type:"number",label:"Confidence",columns:6,default:80,min:0,max:100,help:"Confidence level from 0 to 100."},{name:"notes",type:"textarea",label:"Notes",columns:12,help:"Optional notes about this signature."},{name:"is_active",type:"switch",label:"Active",columns:6,default:!0}]},edit:{title:"Edit Signature",fields:[{name:"sig_type",type:"select",label:"Signature Type",required:!0,columns:6,options:[{value:"user_agent",label:"User Agent"},{value:"ip_pattern",label:"IP Pattern"},{value:"fingerprint",label:"Fingerprint"},{value:"behavior",label:"Behavior"},{value:"header",label:"Header"},{value:"cookie",label:"Cookie"}]},{name:"value",type:"text",label:"Value",required:!0,columns:6,help:"The pattern or value to match against."},{name:"confidence",type:"number",label:"Confidence",columns:6,default:80,min:0,max:100,help:"Confidence level from 0 to 100."},{name:"notes",type:"textarea",label:"Notes",columns:12,help:"Optional notes about this signature."},{name:"is_active",type:"switch",label:"Active",columns:6,default:!0}]}},exports.BouncerSignatureList=BouncerSignatureList,exports.BundleByOptions=n,exports.CommonBlockCountries=_,exports.CommonCategoryOptions=r,exports.CommonEventFields=i,exports.CommonScopeOptions=c,exports.ComparatorOptions=s,exports.DAY_LABELS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],exports.EmailDomain=EmailDomain,exports.EmailDomainForms={create:{title:"Add Email Domain",fields:[{name:"name",type:"text",label:"Domain Name",placeholder:"example.com",required:!0,columns:12,help:"Enter the root domain to verify with SES (no protocol)."},{name:"region",type:"text",label:"AWS Region (optional)",placeholder:"us-east-1",columns:12,help:"Optional. Defaults to project AWS_REGION if omitted."},{name:"aws_key",type:"text",label:"AWS Key (optional)",placeholder:"enter your AWS Key with SES permissions",columns:12,help:"Optional, AWS Key with SES permissions"},{name:"aws_secret",type:"text",label:"AWS Secret (optional)",placeholder:"enter your AWS Secret with SES permissions",columns:12,help:"Optional, AWS Secret with SES permissions"},{name:"receiving_enabled",type:"switch",label:"Enable Inbound Receiving",columns:12,help:"Catch-all SES receipt rule to S3 + SNS; routing is done in-app."}]},edit:{title:"Edit Email Domain",fields:[{name:"name",type:"text",label:"Domain Name",placeholder:"example.com",required:!0,columns:12,readonly:!0,help:"Domain name cannot be changed after creation."},{name:"region",type:"text",label:"AWS Region",placeholder:"us-east-1",columns:12},{name:"receiving_enabled",type:"switch",label:"Enable Inbound Receiving",columns:12},{name:"s3_inbound_bucket",type:"text",label:"Inbound S3 Bucket",placeholder:"my-inbound-bucket",columns:12},{name:"s3_inbound_prefix",type:"text",label:"Inbound S3 Prefix",placeholder:"inbound/example.com/",columns:12},{name:"dns_mode",type:"select",label:"DNS Mode",options:[{value:"manual",text:"Manual (show records)"},{value:"godaddy",text:"GoDaddy (apply via API)"}],columns:12}]},credentials:{fields:[{name:"region",type:"select",label:"AWS Region (optional)",placeholder:"us-east-1",options:[{value:"us-east-1",text:"US East (N. Virginia)"},{value:"us-east-2",text:"US East (Ohio)"},{value:"us-west-1",text:"US West (N. California)"},{value:"us-west-2",text:"US West (Oregon)"},{value:"ca-central-1",text:"Canada (Central)"},{value:"eu-west-1",text:"Europe (Ireland)"},{value:"eu-west-2",text:"Europe (London)"},{value:"eu-west-3",text:"Europe (Paris)"},{value:"eu-central-1",text:"Europe (Frankfurt)"},{value:"eu-north-1",text:"Europe (Stockholm)"},{value:"eu-south-1",text:"Europe (Milan)"},{value:"ap-southeast-2",text:"Asia Pacific (Sydney)"}],columns:12,help:"Optional. Defaults to project AWS_REGION if omitted."},{name:"aws_key",type:"text",label:"AWS Key (optional)",placeholder:"enter your AWS Key with SES permissions",columns:12,help:"Optional, AWS Key with SES permissions"},{name:"aws_secret",type:"text",label:"AWS Secret (optional)",placeholder:"enter your AWS Secret with SES permissions",columns:12,help:"Optional, AWS Secret with SES permissions"}]},onboard:{title:"Onboard Domain",fields:[{type:"header",text:"Receiving",level:6,className:"mt-2"},{name:"receiving_enabled",type:"switch",label:"Enable Inbound Receiving",columns:12},{name:"s3_inbound_bucket",type:"text",label:"Inbound S3 Bucket",placeholder:"my-inbound-bucket",columns:12,help:"Required if receiving is enabled."},{name:"s3_inbound_prefix",type:"text",label:"Inbound S3 Prefix",placeholder:"inbound/example.com/",columns:12},{type:"header",text:"MAIL FROM (optional)",level:6,className:"mt-3"},{name:"ensure_mail_from",type:"switch",label:"Ensure MAIL FROM Setup",columns:12},{name:"mail_from_subdomain",type:"text",label:"MAIL FROM Subdomain",placeholder:"feedback",columns:12},{type:"header",text:"DNS",level:6,className:"mt-3"},{name:"dns_mode",type:"select",label:"DNS Mode",options:[{value:"manual",text:"Manual (show records)"},{value:"godaddy",text:"GoDaddy (apply via API)"}],value:"manual",columns:12},{name:"godaddy_key",type:"text",label:"GoDaddy API Key",columns:12,help:"Required when DNS Mode = GoDaddy."},{name:"godaddy_secret",type:"password",label:"GoDaddy API Secret",columns:12},{type:"header",text:"Webhook Endpoints",level:6,className:"mt-3"},{name:"endpoints.bounce",type:"text",label:"Bounce Endpoint",placeholder:"https://portal.example.com/api/aws/sns/bounce",columns:12},{name:"endpoints.complaint",type:"text",label:"Complaint Endpoint",placeholder:"https://portal.example.com/api/aws/sns/complaint",columns:12},{name:"endpoints.delivery",type:"text",label:"Delivery Endpoint",placeholder:"https://portal.example.com/api/aws/sns/delivery",columns:12},{name:"endpoints.inbound",type:"text",label:"Inbound Endpoint",placeholder:"https://portal.example.com/api/aws/sns/inbound",columns:12}]}},exports.EmailDomainList=EmailDomainList,exports.EmailTemplate=EmailTemplate,exports.EmailTemplateForms={create:{title:"Add Email Template",fields:[{name:"name",type:"text",label:"Name",required:!0,cols:12},{name:"subject_template",type:"text",label:"Subject Template",cols:12},{type:"tabset",name:"settingsTabs",tabs:[{label:"HTML",fields:[{name:"html_template",type:"htmlpreview",label:"HTML Template",rows:16,cols:12}]},{label:"TEXT",fields:[{name:"text_template",type:"textarea",label:"Text Template",rows:16,cols:12}]}]}]},edit:{title:"Edit Email Template",fields:[{name:"name",type:"text",label:"Name",required:!0,cols:12},{name:"subject_template",type:"text",label:"Subject Template",cols:12},{type:"tabset",name:"settingsTabs",tabs:[{label:"HTML",fields:[{name:"html_template",type:"textarea",label:"HTML Template",rows:16,cols:12}]},{label:"TEXT",fields:[{name:"text_template",type:"textarea",label:"Text Template",rows:16,cols:12}]}]}]}},exports.EmailTemplateList=EmailTemplateList,exports.IPSet=IPSet,exports.IPSetForms=C,exports.IPSetKindBadgeOptions=f,exports.IPSetKindOptions=S,exports.IPSetList=IPSetList,exports.IPSetSourceOptions=w,exports.Incident=Incident,exports.IncidentEvent=IncidentEvent,exports.IncidentEventForms=a,exports.IncidentEventList=IncidentEventList,exports.IncidentForms={create:{title:"Create Incident",fields:[{type:"tabset",name:"settingsTabs",tabs:[{label:"General",fields:[{name:"title",type:"text",label:"Title",required:!0,columns:12},{name:"details",type:"textarea",label:"Details",required:!0,columns:12}]},{label:"Advanced",fields:[{name:"priority",type:"select",label:"Priority",options:["1","2","3","4","5","6","7","8","9","10"],value:5,columns:6},{name:"status",type:"select",label:"Status",value:"open",options:["open","investigating","resolved","closed","paused","ignored"],columns:6},{name:"category",type:"text",label:"Category",value:"manual",columns:6}]},{label:"Metadata",fields:[{name:"metadata",type:"json",label:"Metadata",value:{example:"hello world"},rows:15,columns:12}]}]}]},edit:{title:"Edit Incident",fields:[{name:"category",type:"text",label:"Category",cols:6},{name:"status",type:"select",label:"Status",placeholder:"Select Status",options:["open","investigating","resolved","closed","paused","ignored"],cols:3},{name:"priority",type:"text",label:"Priority"},{name:"details",type:"textarea",label:"Description",placeholder:"Enter Name",cols:12},{name:"model_name",type:"text",label:"Model",placeholder:"Enter Model",cols:8},{name:"model_id",type:"text",label:"Model ID",placeholder:"Enter Model ID",cols:4}]}},exports.IncidentHistory=IncidentHistory,exports.IncidentHistoryList=IncidentHistoryList,exports.IncidentList=IncidentList,exports.IncidentRule=IncidentRule,exports.IncidentRuleList=IncidentRuleList,exports.IncidentRuleSet=IncidentRuleSet,exports.IncidentRuleSetList=IncidentRuleSetList,exports.IncidentStats=IncidentStats,exports.Job=Job,exports.JobEvent=JobEvent,exports.JobEventList=JobEventList,exports.JobForms={publish:{title:"Publish New Job",fields:[{name:"func",type:"text",label:"Function",required:!0,placeholder:"myapp.jobs.send_email",help:"Module path to job function"},{name:"channel",type:"text",label:"Channel",value:"default",help:'Queue channel (default: "default")'},{name:"payload",type:"textarea",label:"Payload (JSON)",required:!0,rows:8,placeholder:'{\n "key": "value"\n}',help:"JSON data passed to the job function"},{name:"delay",type:"number",label:"Delay (seconds)",min:0,help:"Delay execution by specified seconds"},{name:"run_at",type:"datetime-local",label:"Run At",help:"Schedule for specific date/time"},{name:"max_retries",type:"number",label:"Max Retries",value:3,min:0,max:10},{name:"expires_in",type:"number",label:"Expires In (seconds)",value:900,min:60,help:"Job will expire if not completed in this time"},{name:"broadcast",type:"switch",label:"Broadcast to All Workers",help:"Execute on all available workers"}]},retry:{title:"Retry Job",fields:[{name:"delay",type:"number",label:"Delay (seconds)",value:0,min:0,help:"Delay before retry (0 = immediate)"}]},clone:{title:"Clone Job",fields:[{name:"channel",type:"text",label:"Channel",help:"Override channel for cloned job"},{name:"payload",type:"textarea",label:"Modified Payload (JSON)",rows:8,help:"Modified payload for cloned job"},{name:"delay",type:"number",label:"Delay (seconds)",min:0}]}},exports.JobList=JobList,exports.JobLog=JobLog,exports.JobLogList=JobLogList,exports.JobRunner=JobRunner,exports.JobRunnerForms={broadcast:{title:"Broadcast Command",fields:[{name:"command",type:"select",label:"Command",required:!0,options:[{value:"status",label:"Status Check"},{value:"pause",label:"Pause Processing"},{value:"resume",label:"Resume Processing"},{value:"reload",label:"Reload Configuration"},{value:"shutdown",label:"Shutdown All Runners"}],help:"Command to send to all runners"},{name:"timeout",type:"number",label:"Timeout (seconds)",value:2,min:.5,max:10,step:.5,help:"How long to wait for responses"}]}},exports.JobRunnerList=JobRunnerList,exports.JobsEngineStats=JobsEngineStats,exports.LoginEvent=LoginEvent,exports.LoginEventList=LoginEventList,exports.Mailbox=Mailbox,exports.MailboxForms=g,exports.MailboxList=MailboxList,exports.MatchByOptions=l,exports.PhoneNumber=PhoneNumber,exports.PhoneNumberList=PhoneNumberList,exports.Phonehub=x,exports.PublicMessage=PublicMessage,exports.PublicMessageCategoryOptions=[{value:"billing",label:"Billing"},{value:"account",label:"Account"},{value:"bug",label:"Bug"},{value:"other",label:"Other"}],exports.PublicMessageKindOptions=[{value:"contact_us",label:"Contact Us"},{value:"support",label:"Support"}],exports.PublicMessageList=PublicMessageList,exports.PublicMessageMetadataLabels={company:"Company",category:"Category",severity:"Severity",referrer:"Referrer",landing_page:"Landing Page",utm_source:"UTM Source",utm_medium:"UTM Medium",utm_campaign:"UTM Campaign",utm_term:"UTM Term",utm_content:"UTM Content"},exports.PublicMessageSeverityOptions=[{value:"low",label:"Low"},{value:"normal",label:"Normal"},{value:"high",label:"High"}],exports.PublicMessageStatusOptions=[{value:"open",label:"Open"},{value:"closed",label:"Closed"}],exports.PushConfig=PushConfig,exports.PushConfigForms=m,exports.PushConfigList=PushConfigList,exports.PushDelivery=PushDelivery,exports.PushDeliveryList=PushDeliveryList,exports.PushDevice=PushDevice,exports.PushDeviceList=PushDeviceList,exports.PushTemplate=PushTemplate,exports.PushTemplateForms=b,exports.PushTemplateList=PushTemplateList,exports.Rule=Rule,exports.RuleForms=p,exports.RuleList=RuleList,exports.RuleSet=RuleSet,exports.RuleSetForms=d,exports.RuleSetList=RuleSetList,exports.S3Bucket=S3Bucket,exports.S3BucketForms={create:{title:"Add S3 Bucket",fields:[{name:"bucket_name",type:"text",label:"Name",placeholder:"bucket name",help:"Enter a universally unique name for the bucket",required:!0,cols:12},{name:"is_public",type:"switch",label:"Is Public",cols:12}]},edit:{title:"Edit S3 Bucket",fields:[{name:"bucket_name",type:"text",label:"Name",placeholder:"bucket name",help:"Enter a universally unique name for the bucket",required:!0,cols:12},{name:"is_public",type:"switch",label:"Is Public",cols:12}]}},exports.S3BucketList=S3BucketList,exports.SMS=SMS,exports.SMSList=SMSList,exports.ScheduledTask=ScheduledTask,exports.ScheduledTaskForms={create:{title:"Create Scheduled Task",fields:[{name:"name",type:"text",label:"Name",placeholder:"Daily report",required:!0,columns:12},{name:"description",type:"textarea",label:"Description",placeholder:"What this task does...",columns:12},{name:"task_type",type:"select",label:"Task Type",required:!0,columns:6,options:[{value:"llm",label:"LLM Prompt"},{value:"job",label:"Backend Job"},{value:"webhook",label:"Webhook"}]},{name:"enabled",type:"switch",label:"Enabled",columns:6,value:!0},{name:"run_times",type:"text",label:"Run Times (HH:MM)",placeholder:"09:00",required:!0,columns:6,help:'Comma-separated 24h times, max 2. e.g. "09:00, 17:00"'},{name:"run_days",type:"text",label:"Run Days",placeholder:"0,1,2,3,4",columns:6,help:"Comma-separated day numbers (Mon=0). Leave empty for every day."},{name:"run_once",type:"switch",label:"Run Once",columns:6,help:"Task runs once then disables itself."},{name:"max_retries",type:"number",label:"Max Retries",columns:6,value:0},{name:"notify",type:"text",label:"Notify",placeholder:"in_app, email",columns:12,help:"Comma-separated: email, in_app, sms, push"}]},edit:{title:"Edit Scheduled Task",fields:[{name:"name",type:"text",label:"Name",required:!0,columns:12},{name:"description",type:"textarea",label:"Description",columns:12},{name:"enabled",type:"switch",label:"Enabled",columns:6},{name:"run_times",type:"text",label:"Run Times (HH:MM)",required:!0,columns:6,help:"Comma-separated 24h times, max 2."},{name:"run_days",type:"text",label:"Run Days",columns:6,help:"Comma-separated day numbers (Mon=0). Leave empty for every day."},{name:"run_once",type:"switch",label:"Run Once",columns:6},{name:"max_retries",type:"number",label:"Max Retries",columns:6},{name:"notify",type:"text",label:"Notify",placeholder:"in_app, email",columns:12,help:"Comma-separated: email, in_app, sms, push"}]}},exports.ScheduledTaskList=ScheduledTaskList,exports.SentMessage=SentMessage,exports.SentMessageForms={view:{title:"Sent Message Details",fields:[{name:"id",type:"text",label:"ID",readonly:!0,cols:6},{name:"ses_message_id",type:"text",label:"SES Message ID",readonly:!0,cols:6},{name:"from_email",type:"text",label:"From",readonly:!0,cols:12},{name:"to",type:"textarea",label:"To",readonly:!0,rows:2,cols:12},{name:"cc",type:"textarea",label:"CC",readonly:!0,rows:2,cols:12},{name:"bcc",type:"textarea",label:"BCC",readonly:!0,rows:2,cols:12},{name:"subject",type:"text",label:"Subject",readonly:!0,cols:12},{name:"status",type:"text",label:"Status",readonly:!0,cols:6},{name:"status_reason",type:"textarea",label:"Status Reason",readonly:!0,rows:3,cols:12},{name:"created",type:"text",label:"Created",readonly:!0,cols:6}]}},exports.SentMessageList=SentMessageList,exports.TaskResult=TaskResult,exports.TaskResultList=TaskResultList,exports.Ticket=Ticket,exports.TicketCategories=h,exports.TicketForms=v,exports.TicketList=TicketList,exports.TicketNote=TicketNote,exports.TicketNoteList=TicketNoteList,exports.ValueTypeOptions=o;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/Collection-7F3lsq4z.js"),t=require("./chunks/User-BmS8zImI.js");class LoginEvent extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/logins"})}}class LoginEventList extends e.Collection{constructor(e={}){super({ModelClass:LoginEvent,endpoint:"/api/account/logins",...e})}}class IncidentStats extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/stats",requiresId:!1})}}class IncidentEvent extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event"})}}class IncidentEventList extends e.Collection{constructor(e={}){super({ModelClass:IncidentEvent,endpoint:"/api/incident/event",size:10,...e})}}const a={edit:{title:"Edit Incident Event",fields:[{name:"category",type:"select",label:"Category",placeholder:"Select category",options:()=>Incident.COMPONENTS,editable:!0,force_top:!0,cols:6},{name:"incident",type:"text",label:"Incident",placeholder:"Enter Incident ID",cols:6},{name:"description",type:"textarea",label:"Description",placeholder:"Enter Description",cols:12},{name:"details",type:"textarea",label:"Details",placeholder:"Enter Details",cols:12},{name:"component",type:"text",label:"Component",placeholder:"Enter Component",cols:8},{name:"component_id",type:"text",label:"Component ID",placeholder:"Enter Component ID",cols:4}]}};class Incident extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/incident"})}}class IncidentList extends e.Collection{constructor(e={}){super({ModelClass:Incident,endpoint:"/api/incident/incident",size:10,...e})}}class IncidentRuleSet extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset"})}}class IncidentRuleSetList extends e.Collection{constructor(e={}){super({ModelClass:IncidentRuleSet,endpoint:"/api/incident/event/ruleset",size:10,...e})}}class IncidentRule extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset/rule"})}}class IncidentRuleList extends e.Collection{constructor(e={}){super({ModelClass:IncidentRule,endpoint:"/api/incident/event/ruleset/rule",size:10,...e})}}class IncidentHistory extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/incident/history"})}}class IncidentHistoryList extends e.Collection{constructor(e={}){super({ModelClass:IncidentHistory,endpoint:"/api/incident/incident/history",size:10,...e})}}const n=[{value:0,label:"No Bundling"},{value:1,label:"By Hostname"},{value:2,label:"By Model Name"},{value:3,label:"By Model Name + ID"},{value:4,label:"By Source IP"},{value:5,label:"By Hostname + Model Name"},{value:6,label:"By Hostname + Model Name + ID"},{value:7,label:"By Source IP + Model Name"},{value:8,label:"By Source IP + Model Name + ID"},{value:9,label:"By Source IP + Hostname"}],l=[{value:0,label:"ALL (must match all rules)"},{value:1,label:"ANY (match any rule)"}],s=[{value:"==",label:"Equal (==)"},{value:"eq",label:"Equal (eq)"},{value:">",label:"Greater Than (>)"},{value:">=",label:"Greater Than or Equal (>=)"},{value:"<",label:"Less Than (<)"},{value:"<=",label:"Less Than or Equal (<=)"},{value:"contains",label:"Contains"},{value:"regex",label:"Regular Expression"}],o=[{value:"str",label:"String"},{value:"int",label:"Integer"},{value:"float",label:"Float"},{value:"bool",label:"Boolean"}],i=[{value:"level",label:"Level",description:"Event level (error, warning, info, debug)",meta:{type:"str"}},{value:"source_ip",label:"Source IP Address",description:"IP address of the event source",meta:{type:"str"}},{value:"rule_id",label:"Rule ID",description:"Numeric rule identifier",meta:{type:"int"}},{value:"hostname",label:"Hostname",description:"Hostname where event occurred",meta:{type:"str"}},{value:"component",label:"Component",description:"System component name",meta:{type:"str"}},{value:"component_id",label:"Component ID",description:"Component identifier",meta:{type:"str"}},{value:"category",label:"Category",description:"Event category (ossec, auth, api_error, etc.)",meta:{type:"str"}},{value:"description",label:"Description",description:"Event description text",meta:{type:"str"}},{value:"details",label:"Details",description:"Additional event details",meta:{type:"str"}},{value:"alert_id",label:"Alert ID",description:"Numeric alert identifier",meta:{type:"int"}},{value:"severity",label:"Severity",description:"Numeric severity level",meta:{type:"int"}},{value:"user",label:"User",description:"Username associated with event",meta:{type:"str"}},{value:"action",label:"Action",description:"Action that triggered the event",meta:{type:"str"}},{value:"status",label:"Status",description:"Status value or code",meta:{type:"str"}},{value:"status_code",label:"Status Code",description:"Numeric status code (e.g., HTTP status)",meta:{type:"int"}},{value:"message",label:"Message",description:"Event message text",meta:{type:"str"}},{value:"path",label:"Path",description:"File path or URL path",meta:{type:"str"}},{value:"title",label:"Title",description:"OSSEC Title",meta:{type:"str"}},{value:"country_code",label:"Country Code",description:"Country code associated with event",meta:{type:"str"}},{value:"region",label:"Region",description:"Region associated with event",meta:{type:"str"}},{value:"city",label:"City",description:"City associated with event",meta:{type:"str"}},{value:"http_user_agent",label:"HTTP User Agent",description:"User agent string associated with event",meta:{type:"str"}},{value:"request_path",label:"Request Path",description:"Request path associated with event",meta:{type:"str"}},{value:"method",label:"Method",description:"HTTP method or function name",meta:{type:"str"}}],r=["global","account","ossec","api","realtime","auth","login:unknown","invalid_password","sms:login_unknown","totp:login_unknown","reset:unknown","magic:unknown","token:unknown","api_denied","unauthenticated","view_permission_denied","edit_permission_denied","group_member_permission_denied","user_permission_denied","security_alert","totp:confirm_failed","totp:login_failed","totp:recovery_used","sms:otp_failed","email:no_mailbox","email:send_failed","sms:send_failed","email_change:bad_password","email_change:requested","account:deactivate_requested","phone_verify:invalid","email_verify:invalid","oauth:unlink_guard_error","rest_error","mojo_rest_error","rest_value_error"],c=r;class RuleSet extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset"})}}class RuleSetList extends e.Collection{constructor(e={}){super({ModelClass:RuleSet,endpoint:"/api/incident/event/ruleset",...e})}}const u=[{value:0,label:"Disabled — each event gets its own incident"},{value:5,label:"5 minutes"},{value:10,label:"10 minutes"},{value:15,label:"15 minutes"},{value:30,label:"30 minutes"},{value:60,label:"1 hour"},{value:120,label:"2 hours"},{value:360,label:"6 hours"},{value:720,label:"12 hours"},{value:1440,label:"1 day"},{value:null,label:"No limit — bundle forever"}],d={create:{title:"Create RuleSet",size:"lg",fields:[{type:"tabset",name:"rulesetTabs",tabs:[{label:"General",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"e.g., Brute Force Detection",columns:6},{name:"match_by",type:"select",label:"Match Logic",value:0,options:l,tooltip:"ALL = every condition must match. ANY = at least one",columns:6},{name:"category",type:"combo",label:"Scope / Category",required:!0,options:r,allowCustom:!0,placeholder:"Type or select...",tooltip:"Scope or event category to match. Use * as a catch-all",columns:6},{name:"priority",type:"number",label:"Evaluation Priority",value:10,required:!0,tooltip:"Lower number = evaluated first",columns:6},{name:"is_active",type:"switch",label:"Active",value:!0,tooltip:"Inactive rules are skipped during event processing",columns:6},{name:"metadata.delete_on_resolution",type:"switch",label:"Delete on Resolution",value:!1,tooltip:"Incidents are permanently deleted when resolved or closed (CASCADE)",columns:6}]},{label:"Bundling",fields:[{name:"bundle_by",type:"select",label:"Bundle By",value:4,options:n,tooltip:"How to group related events into one incident",columns:6},{name:"bundle_minutes",type:"select",label:"Bundle Window",value:30,options:u,tooltip:"Events outside this window create a new incident",columns:6},{name:"bundle_by_rule_set",type:"switch",label:"Bundle by RuleSet",value:!0,tooltip:"Group events matched by this rule into the same incident",columns:6}]},{label:"Thresholds",fields:[{type:"html",columns:12,html:'<div class="alert alert-info small mb-3">\n <i class="bi bi-info-circle me-1"></i>\n <strong>How thresholds work:</strong> Events accumulate in "pending" status.\n Once trigger count is reached, the handler fires and the incident becomes "new".\n Leave empty to fire immediately on the first event.\n </div>'},{name:"trigger_count",type:"number",label:"Trigger Count",placeholder:"Empty = immediate",tooltip:"Number of events before the handler fires",columns:4},{name:"trigger_window",type:"number",label:"Trigger Window (min)",placeholder:"Empty = all events",tooltip:"Only count events within this many minutes",columns:4},{name:"retrigger_every",type:"number",label:"Re-trigger Every",placeholder:"Empty = once",tooltip:"Re-fire handler every N additional events after initial trigger",columns:4}]},{label:"Handler",fields:[{name:"handler",type:"text",label:"Handler Chain",placeholder:"e.g., block://?ttl=3600,ticket://?priority=8",tooltip:"Chain multiple handlers with commas",columns:12},{type:"html",columns:12,html:'<div class="alert alert-light border small mb-0">\n <code>block://?ttl=3600</code> — Block source IP<br>\n <code>ticket://?priority=8</code> — Create ticket<br>\n <code>email://perm@manage_security</code> — Email notification<br>\n <code>sms://perm@manage_security</code> — SMS notification<br>\n <code>notify://perm@manage_security</code> — In-app + push<br>\n <code>llm://</code> — LLM triage agent<br>\n <code>job://myapp.module.function</code> — Async job\n </div>'}]}]}]},edit:{title:"Edit RuleSet",size:"lg",fields:[{type:"tabset",name:"rulesetTabs",tabs:[{label:"General",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"e.g., Brute Force Detection",columns:6},{name:"match_by",type:"select",label:"Match Logic",options:l,tooltip:"ALL = every condition must match. ANY = at least one",columns:6},{name:"category",type:"combo",label:"Scope / Category",options:r,allowCustom:!0,required:!0,placeholder:"Type or select...",tooltip:"Scope or event category to match. Use * as a catch-all",columns:6},{name:"priority",type:"number",label:"Evaluation Priority",required:!0,tooltip:"Lower number = evaluated first",columns:6},{name:"is_active",type:"switch",label:"Active",tooltip:"Inactive rules are skipped during event processing",columns:6},{name:"metadata.delete_on_resolution",type:"switch",label:"Delete on Resolution",tooltip:"Incidents are permanently deleted when resolved or closed (CASCADE)",columns:6}]},{label:"Bundling",fields:[{name:"bundle_by",type:"select",label:"Bundle By",options:n,tooltip:"How to group related events into one incident",columns:6},{name:"bundle_minutes",type:"select",label:"Bundle Window",options:u,tooltip:"Events outside this window create a new incident",columns:6},{name:"bundle_by_rule_set",type:"switch",label:"Bundle by RuleSet",tooltip:"Group events matched by this rule into the same incident",columns:6}]},{label:"Thresholds",fields:[{type:"html",columns:12,html:'<div class="alert alert-info small mb-3">\n <i class="bi bi-info-circle me-1"></i>\n <strong>How thresholds work:</strong> Events accumulate in "pending" status.\n Once trigger count is reached, the handler fires and the incident becomes "new".\n Leave empty to fire immediately on the first event.\n </div>'},{name:"trigger_count",type:"number",label:"Trigger Count",placeholder:"Empty = immediate",tooltip:"Number of events before the handler fires",columns:4},{name:"trigger_window",type:"number",label:"Trigger Window (min)",placeholder:"Empty = all events",tooltip:"Only count events within this window toward the trigger count",columns:4},{name:"retrigger_every",type:"number",label:"Re-trigger Every",placeholder:"Empty = once",tooltip:"Re-fire handler every N additional events after initial trigger",columns:4}]},{label:"Handler",fields:[{name:"handler",type:"text",label:"Handler Chain",placeholder:"e.g., block://?ttl=3600,ticket://?priority=8",tooltip:"Chain multiple handlers with commas",columns:12},{type:"html",columns:12,html:'<div class="alert alert-light border small mb-0">\n <code>block://?ttl=3600</code> — Block source IP<br>\n <code>ticket://?priority=8</code> — Create ticket<br>\n <code>email://perm@manage_security</code> — Email notification<br>\n <code>sms://perm@manage_security</code> — SMS notification<br>\n <code>notify://perm@manage_security</code> — In-app + push<br>\n <code>llm://</code> — LLM triage agent<br>\n <code>job://myapp.module.function</code> — Async job\n </div>'}]}]}]}};class Rule extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/event/ruleset/rule"})}}class RuleList extends e.Collection{constructor(e={}){super({ModelClass:Rule,endpoint:"/api/incident/event/ruleset/rule",...e})}}const p={create:{title:"Create Rule",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"Enter rule name",cols:12},{name:"field_name",type:"combo",label:"Field Name",required:!0,placeholder:"Select or enter field name...",options:i,allowCustom:!0,showDescription:!0,help:"Select a common field or type a custom field name",cols:8},{name:"index",type:"select",label:"Index",required:!0,start:0,end:14,step:1,cols:4},{name:"comparator",type:"select",label:"Comparator",required:!0,options:s,cols:6},{name:"value_type",type:"select",label:"Value Type",required:!0,options:o,value:"str",cols:6},{name:"value",type:"textarea",label:"Value",required:!0,placeholder:"Enter comparison value",cols:12}]},edit:{title:"Edit Rule",fields:[{name:"name",type:"text",label:"Name",required:!0,placeholder:"Enter rule name",cols:12},{name:"field_name",type:"combo",label:"Field Name",required:!0,placeholder:"Select or enter field name...",options:i,allowCustom:!0,showDescription:!0,help:"Select a common field or type a custom field name",cols:12},{name:"comparator",type:"select",label:"Comparator",required:!0,options:s,cols:6},{name:"value_type",type:"select",label:"Value Type",required:!0,options:o,cols:6},{name:"value",type:"text",label:"Value",required:!0,placeholder:"Enter comparison value",cols:12}]}};RuleSet.EDIT_FORM=d.edit,RuleSet.ADD_FORM=d.create,RuleSet.CREATE_FORM=d.create,RuleSet.BundleByOptions=n,RuleSet.MatchByOptions=l,Rule.EDIT_FORM=p.edit,Rule.ADD_FORM=p.create,Rule.CREATE_FORM=p.create,Rule.ComparatorOptions=s,Rule.ValueTypeOptions=o;class PushDevice extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push"})}}class PushDeviceList extends e.Collection{constructor(e={}){super({ModelClass:PushDevice,endpoint:"/api/account/devices/push",...e})}}class PushTemplate extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push/templates"})}}class PushTemplateList extends e.Collection{constructor(e={}){super({ModelClass:PushTemplate,endpoint:"/api/account/devices/push/templates",...e})}}class PushConfig extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push/config"})}}class PushConfigList extends e.Collection{constructor(e={}){super({ModelClass:PushConfig,endpoint:"/api/account/devices/push/config",...e})}}class PushDelivery extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/devices/push/deliveries"})}}class PushDeliveryList extends e.Collection{constructor(e={}){super({ModelClass:PushDelivery,endpoint:"/api/account/devices/push/deliveries",...e})}}const m={create:{title:"Create Push Configuration",fields:[{name:"name",label:"Name",required:!0},{type:"collection",name:"group",label:"Group (optional)",Collection:t.GroupList,labelField:"name",valueField:"id"},{name:"fcm_service_account",label:"Service Account",type:"textarea",rows:10}]},edit:{title:"Edit Push Configuration",fields:[{name:"name",label:"Name",required:!0},{type:"collection",name:"group",label:"Group (optional)",Collection:t.GroupList,labelField:"name",valueField:"id"},{name:"fcm_service_account",label:"Service Account",type:"textarea",rows:10},{name:"is_active",label:"Is Active",type:"switch",value:!0}]}},b={edit:{title:"Edit Push Template",fields:[{name:"name",label:"Name",required:!0},{name:"category",label:"Category",required:!0},{type:"collection",name:"group",label:"Group (optional)",Collection:t.GroupList,labelField:"name",valueField:"id",defaultParams:{is_active:!0}},{name:"title_template",label:"Title Template",required:!0},{name:"body_template",label:"Body Template",type:"textarea",required:!0},{name:"action_url",label:"Action URL"},{name:"priority",label:"Priority",type:"select",options:["high","normal"]},{name:"variables",label:"Variables",type:"json",help:"JSON format"},{name:"is_active",label:"Is Active",type:"switch"}]}};m.create=m.edit,b.create=b.edit;class Ticket extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/ticket"})}}class TicketList extends e.Collection{constructor(e={}){super({ModelClass:Ticket,endpoint:"/api/incident/ticket",...e})}}const h={ticket:"Ticket",bug:"Bug",feature:"Feature Request",incident:"Incident",security:"Security Incident",fulfillment:"Fulfillment",new_user:"New User",new_group:"New Group",qa:"Quality Assurance"},y=Object.entries(h).map(([e,t])=>({value:e,label:t})),v={create:{title:"Create Ticket",fields:[{name:"title",type:"text",label:"Title",required:!0,cols:12},{name:"description",type:"textarea",label:"Description",required:!1,cols:12},{name:"category",type:"select",label:"Category",options:y,cols:12,value:"ticket"},{name:"priority",type:"number",label:"Priority",value:5,cols:6},{name:"status",type:"select",label:"Status",options:["new","open","paused","resolved","qa","ignored"],cols:6,value:"new"},{type:"collection",name:"assignee",label:"Assignee",Collection:t.UserList,labelField:"display_name",valueField:"id",cols:12},{type:"collection",name:"incident",label:"Incident",Collection:IncidentList,labelField:"title",valueField:"id",cols:12}]},edit:{title:"Edit Ticket",fields:[{name:"title",type:"text",label:"Title",required:!0,cols:12},{name:"description",type:"textarea",label:"Description",required:!1,cols:12},{name:"category",type:"select",label:"Category",options:y,cols:12},{name:"priority",type:"number",label:"Priority",cols:6},{name:"status",type:"select",label:"Status",options:["new","open","paused","resolved","qa","ignored"],cols:6},{type:"collection",name:"assignee",label:"Assignee",Collection:t.UserList,labelField:"display_name",valueField:"id",cols:12},{type:"collection",name:"incident",label:"Incident",Collection:IncidentList,labelField:"title",valueField:"id",cols:12}]}};class TicketNote extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/ticket/note"})}}class TicketNoteList extends e.Collection{constructor(e={}){super({ModelClass:TicketNote,endpoint:"/api/incident/ticket/note",...e})}}class AssistantConversation extends e.Model{constructor(e={}){super(e,{endpoint:"/api/assistant/conversation"})}}class AssistantConversationList extends e.Collection{constructor(e={}){super({ModelClass:AssistantConversation,endpoint:"/api/assistant/conversation",size:50,...e})}}class AssistantSkill extends e.Model{constructor(e={}){super(e,{endpoint:"/api/assistant/skill"})}}class AssistantSkillList extends e.Collection{constructor(e={}){super({ModelClass:AssistantSkill,endpoint:"/api/assistant/skill",size:50,...e})}}class Job extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/job"})}async cancel(){const e=await this.save({cancel_request:!0});return e.success&&e.data.status&&this.set("cancel_requested",!0),e}async retry(e=null){const t=e?{retry_request:{retry:!0,delay:e}}:{retry_request:!0},a=await this.save(t);return a.success&&a.data.status&&a.data.new_job_id?{...a,newJobId:a.data.new_job_id,originalJobId:a.data.original_job_id}:a}async getDetailedStatus(){const e=await this.save({get_status:!0});return e.success&&e.data.status&&this.set(e.data.data),e}async cloneJob(e={}){const t={publish_job:{payload:e,...e}},a=await this.save(t);return a.success&&a.data.status&&a.data.job_id?{...a,newJobId:a.data.job_id,templateJobId:a.data.template_job_id}:a}isActive(){const e=this.get("status");return["pending","running"].includes(e)}isTerminal(){const e=this.get("status");return["completed","failed","canceled","expired"].includes(e)}canRetry(){const e=this.get("status");return["failed","canceled","expired"].includes(e)&&!1!==this.get("is_retriable")}canCancel(){const e=this.get("status");return["pending","running"].includes(e)&&!this.get("cancel_requested")}getStatusBadgeClass(){return{pending:"bg-primary",running:"bg-success",completed:"bg-info",failed:"bg-danger",canceled:"bg-secondary",expired:"bg-warning"}[this.get("status")]||"bg-secondary"}getStatusIcon(){return{pending:"bi-hourglass",running:"bi-arrow-repeat",completed:"bi-check-circle",failed:"bi-x-octagon",canceled:"bi-x-circle",expired:"bi-clock"}[this.get("status")]||"bi-question-circle"}getEvents(){return this.get("recent_events")||[]}getFormattedDuration(){const e=this.get("duration_ms");return e&&0!==e?e<1e3?`${e}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:e<36e5?`${(e/6e4).toFixed(1)}m`:`${(e/36e5).toFixed(1)}h`:"N/A"}getQueuePosition(){return this.get("queue_position")}hasExpired(){const e=this.get("expires_at");return!!e&&new Date(e)</* @__PURE__ */new Date}getRunnerId(){return this.get("runner_id")}getPayload(){return this.get("payload")||{}}getMetadata(){return this.get("metadata")||{}}}class JobList extends e.Collection{constructor(e={}){super({ModelClass:Job,endpoint:"/api/jobs/job",...e})}async fetchByStatus(e,t={}){return this.fetch({status:e,...t})}async fetchByChannel(e,t={}){return this.fetch({channel:e,...t})}async fetchPending(e={}){return this.fetchByStatus("pending",e)}async fetchRunning(e={}){return this.fetchByStatus("running",e)}async fetchCompleted(e={}){return this.fetchByStatus("completed",e)}async fetchFailed(e={}){return this.fetchByStatus("failed",e)}async fetchScheduled(e={}){return this.fetch({scheduled:!0,...e})}}Job.publish=async function(t){return await e.rest.POST("/api/jobs/publish",t)},Job.getStats=async function(){const t=await e.rest.GET("/api/jobs/stats");return t.success?t.data:null},Job.getHealth=async function(t=null){const a=t?`/api/jobs/health/${t}`:"/api/jobs/health",n=e.rest.GET(a);return n.success?n.data:null},Job.test=async function(){return await e.rest.POST("/api/jobs/test",{})},Job.tests=async function(){return await e.rest.POST("/api/jobs/tests",{})},Job.clearStuck=async function(t=null){const a=t?{channel:t}:{};return await e.rest.POST("/api/jobs/control/clear-stuck",a)},Job.clearChannel=async function(t){return await e.rest.POST("/api/jobs/control/clear-queue",{channel:t,confirm:"yes"})},Job.cleanConsumers=async function(){return await e.rest.POST("/api/jobs/control/cleanup-consumers")},Job.purgeJobs=async function(t){return await e.rest.POST("/api/jobs/control/purge",{days_old:t})};class JobLog extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/logs"})}}class JobLogList extends e.Collection{constructor(e={}){super({endpoint:"/api/jobs/logs",model:JobLog,...e})}}class JobEvent extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/event"})}}class JobEventList extends e.Collection{constructor(e={}){super({endpoint:"/api/jobs/event",model:JobEvent,...e})}}class JobsEngineStats extends e.Model{constructor(e={}){super(e,{endpoint:"/api/jobs/stats",requiresId:!1})}}class EmailDomain extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/domain",...t})}async onboard(e={},t={}){if(!this.id)return await this.showError("Cannot onboard domain without ID"),{success:!1,status:400,error:"Missing domain id"};try{const a=`${this.buildUrl(this.id)}/onboard`;return await this.rest.POST(a,e,t.params)}catch(a){return{success:!1,status:a?.status||500,error:a?.message||"Failed to onboard domain"}}}async audit(e={}){if(!this.id)return await this.showError("Cannot audit domain without ID"),{success:!1,status:400,error:"Missing domain id"};const t=(e.method||"GET").toUpperCase(),a=`${this.buildUrl(this.id)}/audit`;try{return"POST"===t?await this.rest.POST(a,e.data||{},e.params):await this.rest.GET(a,e.params)}catch(n){return{success:!1,status:n?.status||500,error:n?.message||"Failed to audit domain"}}}async reconcile(e={},t={}){if(!this.id)return await this.showError("Cannot reconcile domain without ID"),{success:!1,status:400,error:"Missing domain id"};try{const a=`${this.buildUrl(this.id)}/reconcile`;return await this.rest.POST(a,e,t.params)}catch(a){return{success:!1,status:a?.status||500,error:a?.message||"Failed to reconcile domain"}}}static async onboardById(e,t={},a={}){const n=new EmailDomain({id:e},a);return await n.onboard(t,a)}static async auditById(e,t={}){const a=new EmailDomain({id:e},t);return await a.audit(t)}static async reconcileById(e,t={},a={}){const n=new EmailDomain({id:e},a);return await n.reconcile(t,a)}}class EmailDomainList extends e.Collection{constructor(e={}){super({ModelClass:EmailDomain,endpoint:"/api/aws/email/domain",size:10,...e})}}class Mailbox extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/mailbox",...t})}}Mailbox.sendEmail=async function(t){return await e.rest.POST("/api/aws/email/send",t)};class MailboxList extends e.Collection{constructor(e={}){super({ModelClass:Mailbox,endpoint:"/api/aws/email/mailbox",size:10,...e})}}const g={create:{title:"Add Mailbox",fields:[{type:"collection",name:"domain",label:"Domain",Collection:EmailDomainList,labelField:"name",valueField:"id",maxItems:10,placeholder:"Search domains...",emptyFetch:!1,required:!0,debounceMs:300,columns:12},{name:"email",type:"email",label:"Email Address",placeholder:"support@example.com",required:!0,columns:12},{name:"allow_inbound",type:"switch",label:"Allow Inbound",columns:6},{name:"allow_outbound",type:"switch",label:"Allow Outbound",defaultValue:!0,columns:6},{name:"is_system_default",type:"switch",label:"System Default",columns:6},{name:"is_domain_default",type:"switch",label:"Domain Default",columns:6},{name:"async_handler",type:"text",label:"Async Handler (optional)",placeholder:"myapp.handlers.process_support",columns:12,help:"Module:function to process inbound messages via task system"}]},edit:{title:"Edit Mailbox",fields:[{name:"email",type:"email",label:"Email Address",required:!0,columns:12},{name:"allow_inbound",type:"switch",label:"Allow Inbound",columns:6},{name:"allow_outbound",type:"switch",label:"Allow Outbound",columns:6},{name:"is_system_default",type:"switch",label:"System Default",columns:6},{name:"is_domain_default",type:"switch",label:"Domain Default",columns:6},{name:"async_handler",type:"text",label:"Async Handler (optional)",placeholder:"myapp.handlers.process_support",columns:12}]}};class SentMessage extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/sent",...t})}}class SentMessageList extends e.Collection{constructor(e={}){super({ModelClass:SentMessage,endpoint:"/api/aws/email/sent",size:10,...e})}}class EmailTemplate extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/aws/email/template",...t})}}class EmailTemplateList extends e.Collection{constructor(e={}){super({ModelClass:EmailTemplate,endpoint:"/api/aws/email/template",size:10,...e})}}class PublicMessage extends e.Model{constructor(e={}){super(e,{endpoint:"/api/account/public_message"})}}class PublicMessageList extends e.Collection{constructor(e={}){super({ModelClass:PublicMessage,endpoint:"/api/account/public_message",size:25,...e})}}class PhoneNumber extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/phonehub/number",...t})}static async normalize(t,a="US"){const n={phone_number:t};a&&(n.country_code=a);const l=await e.rest.POST("/api/phonehub/number/normalize",n),s=l?.data??l;return!0===s?.status||!0===s?.success?{success:!0,phone_number:s?.data?.phone_number??s?.phone_number,data:s?.data??s,response:l}:{success:!1,error:s?.error||"Normalization failed",response:l}}static async lookup(t,a={}){const n=await e.rest.POST("/api/phonehub/number/lookup",{phone_number:t,...a}),l=n?.data??n;if(!0===l?.status||!0===l?.success){const e=l?.data??{};return{success:!0,model:new PhoneNumber(e,{endpoint:"/api/phonehub/number"}),data:e,response:n}}return{success:!1,error:l?.error||"Phone lookup failed",response:n}}}class PhoneNumberList extends e.Collection{constructor(e={}){super({ModelClass:PhoneNumber,endpoint:"/api/phonehub/number",size:10,...e})}}class SMS extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/phonehub/sms",...t})}static async send(t={}){const a=await e.rest.POST("/api/phonehub/sms/send",t),n=a?.data??a;if(!0===n?.status||!0===n?.success){const e=n?.data??{};return{success:!0,model:new SMS(e,{endpoint:"/api/phonehub/sms"}),data:e,response:a}}return{success:!1,error:n?.error||"Failed to send SMS",response:a}}}class SMSList extends e.Collection{constructor(e={}){super({ModelClass:SMS,endpoint:"/api/phonehub/sms",size:10,...e})}}const x={PhoneNumber:PhoneNumber,PhoneNumberList:PhoneNumberList,SMS:SMS,SMSList:SMSList};class JobRunner extends e.Model{constructor(e={}){e.runner_id&&!e.id&&(e.id=e.runner_id),super(e,{endpoint:"/api/jobs/runners",idAttribute:"runner_id"})}async ping(e=2){const t=this.getApp();if(!t||!t.rest)throw new Error("App or REST client not available");const a=await t.rest.POST("/api/jobs/runners/ping",{runner_id:this.get("runner_id"),timeout:e});return a.success&&a.data.status&&(this.set("last_heartbeat",/* @__PURE__ */(new Date).toISOString()),this.set("ping_status",a.data.ping_status||"success")),a}async shutdown(e=!0){const t=this.getApp();if(!t||!t.rest)throw new Error("App or REST client not available");const a=await t.rest.POST("/api/jobs/runners/shutdown",{runner_id:this.get("runner_id"),graceful:e});return a.success&&a.data.status&&this.set("alive",!1),a}getChannels(){return this.get("channels")||[]}getStatusBadgeClass(){return this.get("alive")?"bg-success":"bg-danger"}getStatusIcon(){return this.get("alive")?"bi-check-circle-fill":"bi-x-octagon-fill"}isActive(){return!0===this.get("alive")}isHealthy(){if(!this.isActive())return!1;const e=this.get("last_heartbeat");return!!e&&(Date.now()-new Date(e).getTime())/1e3<120}getFormattedHeartbeatAge(){const e=this.get("last_heartbeat");if(!e)return"Never";const t=(Date.now()-new Date(e).getTime())/1e3;return t<60?`${Math.round(t)}s ago`:t<3600?`${Math.round(t/60)}m ago`:`${Math.round(t/3600)}h ago`}getUtilization(){const e=(this.get("jobs_processed")||0)+(this.get("jobs_failed")||0);return e>10?100:Math.min(10*e,100)}getFormattedUptime(){const e=this.get("started");if(!e)return"Unknown";const t=new Date(e),a=/* @__PURE__ */new Date-t,n=Math.floor(a/1e3);return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:`${Math.floor(n/86400)}d`}getWorkerInfo(){const e=this.get("jobs_processed")||0,t=this.get("jobs_failed")||0;return{processed:e,failed:t,total:e+t,alive:this.get("alive"),utilization:this.getUtilization()}}getDisplayName(){const e=this.get("runner_id");if(!e)return"Unknown Runner";const t=e.split("-");return t.length>1?t[0]:e}canControl(){return!0===this.get("alive")}}class JobRunnerList extends e.Collection{constructor(e={}){super({ModelClass:JobRunner,endpoint:"/api/jobs/runners",...e})}getActive(){return this.where(e=>e.isActive())}getByChannel(e){return this.where(t=>t.getChannels().includes(e))}getHealthy(){return this.where(e=>e.isHealthy())}getTotalProcessed(){return this.models.reduce((e,t)=>e+(t.get("jobs_processed")||0),0)}getTotalFailed(){return this.models.reduce((e,t)=>e+(t.get("jobs_failed")||0),0)}getSystemHealth(){if(0===this.models.length)return 0;const e=this.models.filter(e=>e.get("alive")).length;return Math.round(e/this.models.length*100)}getAllChannels(){const e=/* @__PURE__ */new Set;return this.models.forEach(t=>{t.getChannels().forEach(t=>e.add(t))}),Array.from(e).sort()}}JobRunner.ping=async function(e,t=2){const a="undefined"!=typeof window&&window.app;if(!a||!a.rest)throw new Error("App or REST client not available");return await a.rest.POST("/api/jobs/runners/ping",{runner_id:e,timeout:t})},JobRunner.shutdown=async function(e,t=!0){const a="undefined"!=typeof window&&window.app;if(!a||!a.rest)throw new Error("App or REST client not available");return await a.rest.POST("/api/jobs/runners/shutdown",{runner_id:e,graceful:t})},JobRunner.broadcast=async function(e,t={},a=2){const n="undefined"!=typeof window&&window.app;if(!n||!n.rest)throw new Error("App or REST client not available");return await n.rest.POST("/api/jobs/runners/broadcast",{command:e,data:t,timeout:a})},JobRunner.broadcastStatus=async function(e=2){return JobRunner.broadcast("status",{},e)},JobRunner.broadcastShutdown=async function(e=2){return JobRunner.broadcast("shutdown",{},e)},JobRunner.broadcastPause=async function(e=2){return JobRunner.broadcast("pause",{},e)},JobRunner.broadcastResume=async function(e=2){return JobRunner.broadcast("resume",{},e)},JobRunner.broadcastReload=async function(e=2){return JobRunner.broadcast("reload",{},e)};class ScheduledTask extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/jobs/scheduled_task",...t})}}class ScheduledTaskList extends e.Collection{constructor(e={}){super({ModelClass:ScheduledTask,endpoint:"/api/jobs/scheduled_task",size:25,...e})}}class TaskResult extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/jobs/task_result",...t})}}class TaskResultList extends e.Collection{constructor(e={}){super({ModelClass:TaskResult,endpoint:"/api/jobs/task_result",size:25,...e})}}class BouncerDevice extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/account/bouncer/device",...t})}}class BouncerDeviceList extends e.Collection{constructor(e={}){super({ModelClass:BouncerDevice,endpoint:"/api/account/bouncer/device",size:25,...e})}}class BouncerSignal extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/account/bouncer/signal",...t})}}class BouncerSignalList extends e.Collection{constructor(e={}){super({ModelClass:BouncerSignal,endpoint:"/api/account/bouncer/signal",size:25,...e})}}class BouncerSignature extends e.Model{constructor(e={},t={}){super(e,{endpoint:"/api/account/bouncer/signature",...t})}}class BouncerSignatureList extends e.Collection{constructor(e={}){super({ModelClass:BouncerSignature,endpoint:"/api/account/bouncer/signature",size:25,...e})}}const S=[{value:"country",label:"Country — Block all traffic from a country"},{value:"abuse",label:"Abuse Feed — Import known attacker IPs"},{value:"datacenter",label:"Datacenter — Block datacenter/hosting ranges"},{value:"custom",label:"Custom — Define your own CIDR list"}],f=[{value:"country",label:"Country"},{value:"abuse",label:"Abuse Feed"},{value:"datacenter",label:"Datacenter"},{value:"custom",label:"Custom"}],w=[{value:"ipdeny",label:"IPDeny (Country Zones)"},{value:"abuseipdb",label:"AbuseIPDB"},{value:"manual",label:"Manual"}],_=[{value:"cn",label:"China"},{value:"ru",label:"Russia"},{value:"kp",label:"North Korea"},{value:"ir",label:"Iran"},{value:"ng",label:"Nigeria"},{value:"ro",label:"Romania"},{value:"br",label:"Brazil"},{value:"in",label:"India"},{value:"pk",label:"Pakistan"},{value:"id",label:"Indonesia"},{value:"vn",label:"Vietnam"},{value:"ua",label:"Ukraine"},{value:"th",label:"Thailand"},{value:"ph",label:"Philippines"},{value:"bd",label:"Bangladesh"},{value:"eg",label:"Egypt"},{value:"tr",label:"Turkey"},{value:"mx",label:"Mexico"},{value:"ar",label:"Argentina"},{value:"co",label:"Colombia"}];class IPSet extends e.Model{constructor(e={}){super(e,{endpoint:"/api/incident/ipset"})}}class IPSetList extends e.Collection{constructor(e={}){super({ModelClass:IPSet,endpoint:"/api/incident/ipset",...e})}}const C={create:{title:"Create IP Set",size:"md",fields:[{name:"kind",type:"select",label:"What do you want to block?",required:!0,options:S,value:"country",columns:12},{name:"country_code",type:"select",label:"Country",required:!0,options:_,help:"Select a country to block. CIDRs are fetched automatically from IPDeny.",columns:8,showWhen:{field:"kind",value:"country"}},{name:"source_key",type:"text",label:"API Key",required:!0,placeholder:"Your AbuseIPDB API key",help:"Get a free key at abuseipdb.com. Never stored in plaintext.",columns:12,showWhen:{field:"kind",value:"abuse"}},{name:"source_url",type:"url",label:"Source URL",required:!0,placeholder:"https://example.com/datacenter-ranges.txt",help:"URL to a plain text file with one CIDR per line.",columns:12,showWhen:{field:"kind",value:"datacenter"}},{name:"data",type:"textarea",label:"CIDR List",rows:8,placeholder:"# One CIDR per line\n192.0.2.0/24\n198.51.100.0/24\n203.0.113.0/24",help:"Enter IP ranges in CIDR notation. Lines starting with # are ignored.",columns:12,showWhen:{field:"kind",value:"custom"}},{name:"name",type:"text",label:"Name",required:!0,placeholder:"e.g., abuse_ips, dc_aws",help:"Unique identifier. Used as the kernel ipset name.",columns:6,showWhen:{field:"kind",value:"country",negate:!0}},{name:"description",type:"text",label:"Description",placeholder:"Human-readable label",columns:6,showWhen:{field:"kind",value:"country",negate:!0}},{name:"is_enabled",type:"switch",label:"Enable immediately",value:!0,help:"When enabled, CIDRs are synced to the fleet and traffic is blocked.",columns:4}]},edit:{title:"Edit IP Set",size:"md",fields:[{name:"name",type:"text",label:"Name",required:!0,columns:6},{name:"kind",type:"select",label:"Kind",options:f,disabled:!0,columns:3},{name:"is_enabled",type:"switch",label:"Enabled",columns:3},{name:"description",type:"text",label:"Description",columns:12},{name:"source",type:"select",label:"Source",options:w,columns:6},{name:"source_url",type:"url",label:"Source URL",columns:6},{name:"source_key",type:"text",label:"API Key",placeholder:"Leave blank to keep current key",help:"Write-only — current value is never shown.",columns:12}]}};IPSet.EDIT_FORM=C.edit;class S3Bucket extends e.Model{constructor(e={}){super(e,{endpoint:"/api/aws/s3/bucket"})}}class S3BucketList extends e.Collection{constructor(e={}){super({ModelClass:S3Bucket,endpoint:"/api/aws/s3/bucket",size:10,...e})}}exports.Assistant=AssistantConversation,exports.AssistantConversation=AssistantConversation,exports.AssistantConversationList=AssistantConversationList,exports.AssistantSkill=AssistantSkill,exports.AssistantSkillList=AssistantSkillList,exports.BouncerDevice=BouncerDevice,exports.BouncerDeviceList=BouncerDeviceList,exports.BouncerSignal=BouncerSignal,exports.BouncerSignalList=BouncerSignalList,exports.BouncerSignature=BouncerSignature,exports.BouncerSignatureForms={create:{title:"Create Signature",fields:[{name:"sig_type",type:"select",label:"Signature Type",required:!0,columns:6,options:[{value:"user_agent",label:"User Agent"},{value:"ip_pattern",label:"IP Pattern"},{value:"fingerprint",label:"Fingerprint"},{value:"behavior",label:"Behavior"},{value:"header",label:"Header"},{value:"cookie",label:"Cookie"}]},{name:"value",type:"text",label:"Value",required:!0,columns:6,help:"The pattern or value to match against."},{name:"confidence",type:"number",label:"Confidence",columns:6,default:80,min:0,max:100,help:"Confidence level from 0 to 100."},{name:"notes",type:"textarea",label:"Notes",columns:12,help:"Optional notes about this signature."},{name:"is_active",type:"switch",label:"Active",columns:6,default:!0}]},edit:{title:"Edit Signature",fields:[{name:"sig_type",type:"select",label:"Signature Type",required:!0,columns:6,options:[{value:"user_agent",label:"User Agent"},{value:"ip_pattern",label:"IP Pattern"},{value:"fingerprint",label:"Fingerprint"},{value:"behavior",label:"Behavior"},{value:"header",label:"Header"},{value:"cookie",label:"Cookie"}]},{name:"value",type:"text",label:"Value",required:!0,columns:6,help:"The pattern or value to match against."},{name:"confidence",type:"number",label:"Confidence",columns:6,default:80,min:0,max:100,help:"Confidence level from 0 to 100."},{name:"notes",type:"textarea",label:"Notes",columns:12,help:"Optional notes about this signature."},{name:"is_active",type:"switch",label:"Active",columns:6,default:!0}]}},exports.BouncerSignatureList=BouncerSignatureList,exports.BundleByOptions=n,exports.CommonBlockCountries=_,exports.CommonCategoryOptions=r,exports.CommonEventFields=i,exports.CommonScopeOptions=c,exports.ComparatorOptions=s,exports.DAY_LABELS=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],exports.EmailDomain=EmailDomain,exports.EmailDomainForms={create:{title:"Add Email Domain",fields:[{name:"name",type:"text",label:"Domain Name",placeholder:"example.com",required:!0,columns:12,help:"Enter the root domain to verify with SES (no protocol)."},{name:"region",type:"text",label:"AWS Region (optional)",placeholder:"us-east-1",columns:12,help:"Optional. Defaults to project AWS_REGION if omitted."},{name:"aws_key",type:"text",label:"AWS Key (optional)",placeholder:"enter your AWS Key with SES permissions",columns:12,help:"Optional, AWS Key with SES permissions"},{name:"aws_secret",type:"text",label:"AWS Secret (optional)",placeholder:"enter your AWS Secret with SES permissions",columns:12,help:"Optional, AWS Secret with SES permissions"},{name:"receiving_enabled",type:"switch",label:"Enable Inbound Receiving",columns:12,help:"Catch-all SES receipt rule to S3 + SNS; routing is done in-app."}]},edit:{title:"Edit Email Domain",fields:[{name:"name",type:"text",label:"Domain Name",placeholder:"example.com",required:!0,columns:12,readonly:!0,help:"Domain name cannot be changed after creation."},{name:"region",type:"text",label:"AWS Region",placeholder:"us-east-1",columns:12},{name:"receiving_enabled",type:"switch",label:"Enable Inbound Receiving",columns:12},{name:"s3_inbound_bucket",type:"text",label:"Inbound S3 Bucket",placeholder:"my-inbound-bucket",columns:12},{name:"s3_inbound_prefix",type:"text",label:"Inbound S3 Prefix",placeholder:"inbound/example.com/",columns:12},{name:"dns_mode",type:"select",label:"DNS Mode",options:[{value:"manual",text:"Manual (show records)"},{value:"godaddy",text:"GoDaddy (apply via API)"}],columns:12}]},credentials:{fields:[{name:"region",type:"select",label:"AWS Region (optional)",placeholder:"us-east-1",options:[{value:"us-east-1",text:"US East (N. Virginia)"},{value:"us-east-2",text:"US East (Ohio)"},{value:"us-west-1",text:"US West (N. California)"},{value:"us-west-2",text:"US West (Oregon)"},{value:"ca-central-1",text:"Canada (Central)"},{value:"eu-west-1",text:"Europe (Ireland)"},{value:"eu-west-2",text:"Europe (London)"},{value:"eu-west-3",text:"Europe (Paris)"},{value:"eu-central-1",text:"Europe (Frankfurt)"},{value:"eu-north-1",text:"Europe (Stockholm)"},{value:"eu-south-1",text:"Europe (Milan)"},{value:"ap-southeast-2",text:"Asia Pacific (Sydney)"}],columns:12,help:"Optional. Defaults to project AWS_REGION if omitted."},{name:"aws_key",type:"text",label:"AWS Key (optional)",placeholder:"enter your AWS Key with SES permissions",columns:12,help:"Optional, AWS Key with SES permissions"},{name:"aws_secret",type:"text",label:"AWS Secret (optional)",placeholder:"enter your AWS Secret with SES permissions",columns:12,help:"Optional, AWS Secret with SES permissions"}]},onboard:{title:"Onboard Domain",fields:[{type:"header",text:"Receiving",level:6,className:"mt-2"},{name:"receiving_enabled",type:"switch",label:"Enable Inbound Receiving",columns:12},{name:"s3_inbound_bucket",type:"text",label:"Inbound S3 Bucket",placeholder:"my-inbound-bucket",columns:12,help:"Required if receiving is enabled."},{name:"s3_inbound_prefix",type:"text",label:"Inbound S3 Prefix",placeholder:"inbound/example.com/",columns:12},{type:"header",text:"MAIL FROM (optional)",level:6,className:"mt-3"},{name:"ensure_mail_from",type:"switch",label:"Ensure MAIL FROM Setup",columns:12},{name:"mail_from_subdomain",type:"text",label:"MAIL FROM Subdomain",placeholder:"feedback",columns:12},{type:"header",text:"DNS",level:6,className:"mt-3"},{name:"dns_mode",type:"select",label:"DNS Mode",options:[{value:"manual",text:"Manual (show records)"},{value:"godaddy",text:"GoDaddy (apply via API)"}],value:"manual",columns:12},{name:"godaddy_key",type:"text",label:"GoDaddy API Key",columns:12,help:"Required when DNS Mode = GoDaddy."},{name:"godaddy_secret",type:"password",label:"GoDaddy API Secret",columns:12},{type:"header",text:"Webhook Endpoints",level:6,className:"mt-3"},{name:"endpoints.bounce",type:"text",label:"Bounce Endpoint",placeholder:"https://portal.example.com/api/aws/sns/bounce",columns:12},{name:"endpoints.complaint",type:"text",label:"Complaint Endpoint",placeholder:"https://portal.example.com/api/aws/sns/complaint",columns:12},{name:"endpoints.delivery",type:"text",label:"Delivery Endpoint",placeholder:"https://portal.example.com/api/aws/sns/delivery",columns:12},{name:"endpoints.inbound",type:"text",label:"Inbound Endpoint",placeholder:"https://portal.example.com/api/aws/sns/inbound",columns:12}]}},exports.EmailDomainList=EmailDomainList,exports.EmailTemplate=EmailTemplate,exports.EmailTemplateForms={create:{title:"Add Email Template",fields:[{name:"name",type:"text",label:"Name",required:!0,cols:12},{name:"subject_template",type:"text",label:"Subject Template",cols:12},{type:"tabset",name:"settingsTabs",tabs:[{label:"HTML",fields:[{name:"html_template",type:"htmlpreview",label:"HTML Template",rows:16,cols:12}]},{label:"TEXT",fields:[{name:"text_template",type:"textarea",label:"Text Template",rows:16,cols:12}]}]}]},edit:{title:"Edit Email Template",fields:[{name:"name",type:"text",label:"Name",required:!0,cols:12},{name:"subject_template",type:"text",label:"Subject Template",cols:12},{type:"tabset",name:"settingsTabs",tabs:[{label:"HTML",fields:[{name:"html_template",type:"textarea",label:"HTML Template",rows:16,cols:12}]},{label:"TEXT",fields:[{name:"text_template",type:"textarea",label:"Text Template",rows:16,cols:12}]}]}]}},exports.EmailTemplateList=EmailTemplateList,exports.IPSet=IPSet,exports.IPSetForms=C,exports.IPSetKindBadgeOptions=f,exports.IPSetKindOptions=S,exports.IPSetList=IPSetList,exports.IPSetSourceOptions=w,exports.Incident=Incident,exports.IncidentEvent=IncidentEvent,exports.IncidentEventForms=a,exports.IncidentEventList=IncidentEventList,exports.IncidentForms={create:{title:"Create Incident",fields:[{type:"tabset",name:"settingsTabs",tabs:[{label:"General",fields:[{name:"title",type:"text",label:"Title",required:!0,columns:12},{name:"details",type:"textarea",label:"Details",required:!0,columns:12}]},{label:"Advanced",fields:[{name:"priority",type:"select",label:"Priority",options:["1","2","3","4","5","6","7","8","9","10"],value:5,columns:6},{name:"status",type:"select",label:"Status",value:"open",options:["open","investigating","resolved","closed","paused","ignored"],columns:6},{name:"category",type:"text",label:"Category",value:"manual",columns:6}]},{label:"Metadata",fields:[{name:"metadata",type:"json",label:"Metadata",value:{example:"hello world"},rows:15,columns:12}]}]}]},edit:{title:"Edit Incident",fields:[{name:"category",type:"text",label:"Category",cols:6},{name:"status",type:"select",label:"Status",placeholder:"Select Status",options:["open","investigating","resolved","closed","paused","ignored"],cols:3},{name:"priority",type:"text",label:"Priority"},{name:"details",type:"textarea",label:"Description",placeholder:"Enter Name",cols:12},{name:"model_name",type:"text",label:"Model",placeholder:"Enter Model",cols:8},{name:"model_id",type:"text",label:"Model ID",placeholder:"Enter Model ID",cols:4}]}},exports.IncidentHistory=IncidentHistory,exports.IncidentHistoryList=IncidentHistoryList,exports.IncidentList=IncidentList,exports.IncidentRule=IncidentRule,exports.IncidentRuleList=IncidentRuleList,exports.IncidentRuleSet=IncidentRuleSet,exports.IncidentRuleSetList=IncidentRuleSetList,exports.IncidentStats=IncidentStats,exports.Job=Job,exports.JobEvent=JobEvent,exports.JobEventList=JobEventList,exports.JobForms={publish:{title:"Publish New Job",fields:[{name:"func",type:"text",label:"Function",required:!0,placeholder:"myapp.jobs.send_email",help:"Module path to job function"},{name:"channel",type:"text",label:"Channel",value:"default",help:'Queue channel (default: "default")'},{name:"payload",type:"textarea",label:"Payload (JSON)",required:!0,rows:8,placeholder:'{\n "key": "value"\n}',help:"JSON data passed to the job function"},{name:"delay",type:"number",label:"Delay (seconds)",min:0,help:"Delay execution by specified seconds"},{name:"run_at",type:"datetime-local",label:"Run At",help:"Schedule for specific date/time"},{name:"max_retries",type:"number",label:"Max Retries",value:3,min:0,max:10},{name:"expires_in",type:"number",label:"Expires In (seconds)",value:900,min:60,help:"Job will expire if not completed in this time"},{name:"broadcast",type:"switch",label:"Broadcast to All Workers",help:"Execute on all available workers"}]},retry:{title:"Retry Job",fields:[{name:"delay",type:"number",label:"Delay (seconds)",value:0,min:0,help:"Delay before retry (0 = immediate)"}]},clone:{title:"Clone Job",fields:[{name:"channel",type:"text",label:"Channel",help:"Override channel for cloned job"},{name:"payload",type:"textarea",label:"Modified Payload (JSON)",rows:8,help:"Modified payload for cloned job"},{name:"delay",type:"number",label:"Delay (seconds)",min:0}]}},exports.JobList=JobList,exports.JobLog=JobLog,exports.JobLogList=JobLogList,exports.JobRunner=JobRunner,exports.JobRunnerForms={broadcast:{title:"Broadcast Command",fields:[{name:"command",type:"select",label:"Command",required:!0,options:[{value:"status",label:"Status Check"},{value:"pause",label:"Pause Processing"},{value:"resume",label:"Resume Processing"},{value:"reload",label:"Reload Configuration"},{value:"shutdown",label:"Shutdown All Runners"}],help:"Command to send to all runners"},{name:"timeout",type:"number",label:"Timeout (seconds)",value:2,min:.5,max:10,step:.5,help:"How long to wait for responses"}]}},exports.JobRunnerList=JobRunnerList,exports.JobsEngineStats=JobsEngineStats,exports.LoginEvent=LoginEvent,exports.LoginEventList=LoginEventList,exports.Mailbox=Mailbox,exports.MailboxForms=g,exports.MailboxList=MailboxList,exports.MatchByOptions=l,exports.PhoneNumber=PhoneNumber,exports.PhoneNumberList=PhoneNumberList,exports.Phonehub=x,exports.PublicMessage=PublicMessage,exports.PublicMessageCategoryOptions=[{value:"billing",label:"Billing"},{value:"account",label:"Account"},{value:"bug",label:"Bug"},{value:"other",label:"Other"}],exports.PublicMessageKindOptions=[{value:"contact_us",label:"Contact Us"},{value:"support",label:"Support"}],exports.PublicMessageList=PublicMessageList,exports.PublicMessageMetadataLabels={company:"Company",category:"Category",severity:"Severity",referrer:"Referrer",landing_page:"Landing Page",utm_source:"UTM Source",utm_medium:"UTM Medium",utm_campaign:"UTM Campaign",utm_term:"UTM Term",utm_content:"UTM Content"},exports.PublicMessageSeverityOptions=[{value:"low",label:"Low"},{value:"normal",label:"Normal"},{value:"high",label:"High"}],exports.PublicMessageStatusOptions=[{value:"open",label:"Open"},{value:"closed",label:"Closed"}],exports.PushConfig=PushConfig,exports.PushConfigForms=m,exports.PushConfigList=PushConfigList,exports.PushDelivery=PushDelivery,exports.PushDeliveryList=PushDeliveryList,exports.PushDevice=PushDevice,exports.PushDeviceList=PushDeviceList,exports.PushTemplate=PushTemplate,exports.PushTemplateForms=b,exports.PushTemplateList=PushTemplateList,exports.Rule=Rule,exports.RuleForms=p,exports.RuleList=RuleList,exports.RuleSet=RuleSet,exports.RuleSetForms=d,exports.RuleSetList=RuleSetList,exports.S3Bucket=S3Bucket,exports.S3BucketForms={create:{title:"Add S3 Bucket",fields:[{name:"bucket_name",type:"text",label:"Name",placeholder:"bucket name",help:"Enter a universally unique name for the bucket",required:!0,cols:12},{name:"is_public",type:"switch",label:"Is Public",cols:12}]},edit:{title:"Edit S3 Bucket",fields:[{name:"bucket_name",type:"text",label:"Name",placeholder:"bucket name",help:"Enter a universally unique name for the bucket",required:!0,cols:12},{name:"is_public",type:"switch",label:"Is Public",cols:12}]}},exports.S3BucketList=S3BucketList,exports.SMS=SMS,exports.SMSList=SMSList,exports.ScheduledTask=ScheduledTask,exports.ScheduledTaskForms={create:{title:"Create Scheduled Task",fields:[{name:"name",type:"text",label:"Name",placeholder:"Daily report",required:!0,columns:12},{name:"description",type:"textarea",label:"Description",placeholder:"What this task does...",columns:12},{name:"task_type",type:"select",label:"Task Type",required:!0,columns:6,options:[{value:"llm",label:"LLM Prompt"},{value:"job",label:"Backend Job"},{value:"webhook",label:"Webhook"}]},{name:"enabled",type:"switch",label:"Enabled",columns:6,value:!0},{name:"run_times",type:"text",label:"Run Times (HH:MM)",placeholder:"09:00",required:!0,columns:6,help:'Comma-separated 24h times, max 2. e.g. "09:00, 17:00"'},{name:"run_days",type:"text",label:"Run Days",placeholder:"0,1,2,3,4",columns:6,help:"Comma-separated day numbers (Mon=0). Leave empty for every day."},{name:"run_once",type:"switch",label:"Run Once",columns:6,help:"Task runs once then disables itself."},{name:"max_retries",type:"number",label:"Max Retries",columns:6,value:0},{name:"notify",type:"text",label:"Notify",placeholder:"in_app, email",columns:12,help:"Comma-separated: email, in_app, sms, push"}]},edit:{title:"Edit Scheduled Task",fields:[{name:"name",type:"text",label:"Name",required:!0,columns:12},{name:"description",type:"textarea",label:"Description",columns:12},{name:"enabled",type:"switch",label:"Enabled",columns:6},{name:"run_times",type:"text",label:"Run Times (HH:MM)",required:!0,columns:6,help:"Comma-separated 24h times, max 2."},{name:"run_days",type:"text",label:"Run Days",columns:6,help:"Comma-separated day numbers (Mon=0). Leave empty for every day."},{name:"run_once",type:"switch",label:"Run Once",columns:6},{name:"max_retries",type:"number",label:"Max Retries",columns:6},{name:"notify",type:"text",label:"Notify",placeholder:"in_app, email",columns:12,help:"Comma-separated: email, in_app, sms, push"}]}},exports.ScheduledTaskList=ScheduledTaskList,exports.SentMessage=SentMessage,exports.SentMessageForms={view:{title:"Sent Message Details",fields:[{name:"id",type:"text",label:"ID",readonly:!0,cols:6},{name:"ses_message_id",type:"text",label:"SES Message ID",readonly:!0,cols:6},{name:"from_email",type:"text",label:"From",readonly:!0,cols:12},{name:"to",type:"textarea",label:"To",readonly:!0,rows:2,cols:12},{name:"cc",type:"textarea",label:"CC",readonly:!0,rows:2,cols:12},{name:"bcc",type:"textarea",label:"BCC",readonly:!0,rows:2,cols:12},{name:"subject",type:"text",label:"Subject",readonly:!0,cols:12},{name:"status",type:"text",label:"Status",readonly:!0,cols:6},{name:"status_reason",type:"textarea",label:"Status Reason",readonly:!0,rows:3,cols:12},{name:"created",type:"text",label:"Created",readonly:!0,cols:6}]}},exports.SentMessageList=SentMessageList,exports.TaskResult=TaskResult,exports.TaskResultList=TaskResultList,exports.Ticket=Ticket,exports.TicketCategories=h,exports.TicketForms=v,exports.TicketList=TicketList,exports.TicketNote=TicketNote,exports.TicketNoteList=TicketNoteList,exports.ValueTypeOptions=o;
2
2
  //# sourceMappingURL=admin-models.cjs.js.map