"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

// src/shared/index.ts
var index_exports = {};
__export(index_exports, {
  ARRAY_METHODS: () => ARRAY_METHODS,
  ATTRS: () => ATTRS,
  COMMAND_ACTION: () => COMMAND_ACTION,
  EDITABLE_SOURCE_TYPES: () => EDITABLE_SOURCE_TYPES,
  EDIT_TYPE: () => EDIT_TYPE,
  EXCLUDED_COMPONENTS: () => EXCLUDED_COMPONENTS,
  MESSAGE_TYPE: () => MESSAGE_TYPE,
  MONITOR_ACTION: () => MONITOR_ACTION,
  PORTAL_SUFFIX_RE: () => PORTAL_SUFFIX_RE,
  RADIX_ROOTS: () => RADIX_ROOTS,
  READONLY_SOURCE_TYPES: () => READONLY_SOURCE_TYPES,
  REQUIRED_ATTRS: () => REQUIRED_ATTRS,
  SOURCE_TYPE: () => SOURCE_TYPE,
  WRAPPER_SPAN_ATTRS: () => WRAPPER_SPAN_ATTRS,
  WRAPPER_SPAN_STYLE: () => WRAPPER_SPAN_STYLE,
  isEditableSourceType: () => isEditableSourceType,
  isPortalishName: () => isPortalishName
});
module.exports = __toCommonJS(index_exports);

// src/shared/attributes.ts
var ATTRS = {
  FILE_NAME: "x-file-name",
  LINE_NUMBER: "x-line-number",
  COLUMN: "x-column",
  COMPONENT: "x-component",
  ID: "x-id",
  DYNAMIC: "x-dynamic",
  EXCLUDED: "x-excluded",
  SOURCE_TYPE: "x-source-type",
  SOURCE_VAR: "x-source-var",
  SOURCE_FILE: "x-source-file",
  SOURCE_FILE_ABS: "x-source-file-abs",
  SOURCE_LINE: "x-source-line",
  SOURCE_PATH: "x-source-path",
  SOURCE_EDITABLE: "x-source-editable",
  ARRAY_VAR: "x-array-var",
  ARRAY_FILE: "x-array-file",
  ARRAY_LINE: "x-array-line",
  ARRAY_ITEM_PARAM: "x-array-item-param",
  ARRAY_INLINE: "x-array-inline",
  VE_DYNAMIC: "data-ve-dynamic"
};
var REQUIRED_ATTRS = [
  ATTRS.FILE_NAME,
  ATTRS.LINE_NUMBER,
  ATTRS.COMPONENT
];

// src/shared/source-types.ts
var SOURCE_TYPE = {
  STATIC_LOCAL: "static-local",
  STATIC_IMPORTED: "static-imported",
  PROP: "prop",
  STATE: "state",
  COMPUTED: "computed",
  TEMPLATE: "template",
  EXTERNAL: "external",
  UNKNOWN: "unknown"
};
var EDITABLE_SOURCE_TYPES = /* @__PURE__ */ new Set([
  SOURCE_TYPE.STATIC_LOCAL,
  SOURCE_TYPE.STATIC_IMPORTED
]);
var READONLY_SOURCE_TYPES = /* @__PURE__ */ new Set([
  SOURCE_TYPE.PROP,
  SOURCE_TYPE.STATE,
  SOURCE_TYPE.COMPUTED,
  SOURCE_TYPE.EXTERNAL
]);
function isEditableSourceType(type, sourceEditable) {
  if (READONLY_SOURCE_TYPES.has(type)) return false;
  if (EDITABLE_SOURCE_TYPES.has(type)) return sourceEditable === "true";
  return false;
}

// src/shared/edit-types.ts
var EDIT_TYPE = {
  TEXT_CONTENT: "textContent",
  VARIABLE_EDIT: "variableEdit",
  READONLY: "readonly",
  SHARED_SOURCE: "sharedSource",
  CLASS_NAME: "className",
  CONTENT: "content"
};

// src/shared/message-protocol.ts
var MONITOR_ACTION = {
  MODE_ACTIVATED: "DEBUG_MODE_ACTIVATED",
  MODE_DEACTIVATED: "DEBUG_MODE_DEACTIVATED",
  ELEMENT_SELECTED: "ELEMENT_SELECTED",
  ELEMENT_DESELECTED: "ELEMENT_DESELECTED",
  CHANGES_ERROR: "CHANGES_ERROR",
  INTERACTION_MODE_CHANGED: "INTERACTION_MODE_CHANGED",
  INLINE_EDIT_START: "INLINE_EDIT_START",
  INLINE_EDIT_CHANGE: "INLINE_EDIT_CHANGE",
  INLINE_EDIT_END: "INLINE_EDIT_END",
  INLINE_EDIT_ERROR: "INLINE_EDIT_ERROR"
};
var COMMAND_ACTION = {
  ACTIVATE: "ACTIVATE",
  DEACTIVATE: "DEACTIVATE",
  CLEAR_SELECTION: "CLEAR_SELECTION",
  APPLY_CHANGES: "APPLY_CHANGES",
  SET_INTERACTION_MODE: "SET_INTERACTION_MODE",
  ENABLE_INLINE_EDIT: "ENABLE_INLINE_EDIT",
  DISABLE_INLINE_EDIT: "DISABLE_INLINE_EDIT",
  FOCUS_ELEMENT: "FOCUS_ELEMENT",
  SET_ANNOTATION_MARKERS: "SET_ANNOTATION_MARKERS"
};
var MESSAGE_TYPE = {
  SITE_DEBUG: "SITE_DEBUG",
  DEBUG_COMMAND: "DEBUG_COMMAND"
};

// src/shared/wrapper-span.ts
var WRAPPER_SPAN_ATTRS = {
  [ATTRS.VE_DYNAMIC]: "true",
  [ATTRS.EXCLUDED]: "true"
};
var WRAPPER_SPAN_STYLE = "display:contents";

// src/shared/excluded-components.ts
var EXCLUDED_COMPONENTS = /* @__PURE__ */ new Set([
  // React Router
  "Route",
  "Routes",
  "Switch",
  "Redirect",
  "Navigate",
  // React built-ins
  "Fragment",
  "Suspense",
  "StrictMode",
  // Other framework components
  "ErrorBoundary",
  "Provider",
  "Consumer",
  "Outlet",
  "Link",
  "NavLink",
  // Portal-based primitives (Radix/Floating-UI)
  "Sheet",
  "SheetContent",
  "SheetOverlay",
  "SheetPortal",
  "Popover",
  "PopoverContent",
  "Tooltip",
  "TooltipContent",
  "DropdownMenu",
  "DropdownMenuContent",
  "DropdownMenuSubContent",
  "ContextMenu",
  "ContextMenuContent",
  "ContextMenuSubContent",
  "HoverCard",
  "HoverCardContent",
  "Select",
  "SelectContent",
  "Menubar",
  "MenubarContent",
  "MenubarSubContent",
  "MenubarPortal",
  "Drawer",
  "DrawerContent",
  "DrawerOverlay",
  "DrawerPortal",
  "Toast",
  "ToastViewport",
  "NavigationMenu",
  "NavigationMenuContent",
  "DropdownMenuPortal",
  "ContextMenuPortal",
  "Command",
  "CommandDialog",
  // Triggers & measured bits
  "PopoverTrigger",
  "TooltipTrigger",
  "DropdownMenuTrigger",
  "ContextMenuTrigger",
  "HoverCardTrigger",
  "SelectTrigger",
  "MenubarTrigger",
  "NavigationMenuTrigger",
  "SheetTrigger",
  "DrawerTrigger",
  "CommandInput",
  "Slot",
  // Icons (avoid wrapping)
  "X",
  "ChevronRight",
  "ChevronLeft",
  "ChevronUp",
  "ChevronDown",
  "Check",
  "Plus",
  "Minus",
  "Search",
  "Menu",
  "Settings",
  "User",
  "Home",
  "ArrowRight",
  "ArrowLeft"
]);
var RADIX_ROOTS = /* @__PURE__ */ new Set([
  "Dialog",
  "Popover",
  "Tooltip",
  "DropdownMenu",
  "ContextMenu",
  "AlertDialog",
  "HoverCard",
  "Select",
  "Menubar",
  "NavigationMenu",
  "Sheet",
  "Drawer",
  "Toast",
  "Command"
]);
var PORTAL_SUFFIX_RE = /(Trigger|Portal|Content|Overlay|Viewport|Anchor|Arrow)$/;
var ARRAY_METHODS = /* @__PURE__ */ new Set([
  "map",
  "forEach",
  "filter",
  "reduce",
  "reduceRight",
  "flatMap",
  "find",
  "findIndex",
  "some",
  "every"
]);
function isPortalishName(name) {
  if (!name) return false;
  return RADIX_ROOTS.has(name) || PORTAL_SUFFIX_RE.test(name);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
  ARRAY_METHODS,
  ATTRS,
  COMMAND_ACTION,
  EDITABLE_SOURCE_TYPES,
  EDIT_TYPE,
  EXCLUDED_COMPONENTS,
  MESSAGE_TYPE,
  MONITOR_ACTION,
  PORTAL_SUFFIX_RE,
  RADIX_ROOTS,
  READONLY_SOURCE_TYPES,
  REQUIRED_ATTRS,
  SOURCE_TYPE,
  WRAPPER_SPAN_ATTRS,
  WRAPPER_SPAN_STYLE,
  isEditableSourceType,
  isPortalishName
});
