var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, {
  get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2]
}) : x2)(function(x2) {
  if (typeof require !== "undefined") return require.apply(this, arguments);
  throw Error('Dynamic require of "' + x2 + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
  return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
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 __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
  // If the importer is in node compatibility mode or this is not an ESM
  // file that has been converted to a CommonJS file using a Babel-
  // compatible transform (i.e. "__esModule" has not been set), then set
  // "default" to the CommonJS "module.exports" for node compatibility.
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
  mod
));

// ../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js
var require_ms = __commonJS({
  "../../../node_modules/.pnpm/ms@2.1.3/node_modules/ms/index.js"(exports, module) {
    var s2 = 1e3;
    var m2 = s2 * 60;
    var h2 = m2 * 60;
    var d2 = h2 * 24;
    var w2 = d2 * 7;
    var y2 = d2 * 365.25;
    module.exports = function(val, options) {
      options = options || {};
      var type = typeof val;
      if (type === "string" && val.length > 0) {
        return parse(val);
      } else if (type === "number" && isFinite(val)) {
        return options.long ? fmtLong(val) : fmtShort(val);
      }
      throw new Error(
        "val is not a non-empty string or a valid number. val=" + JSON.stringify(val)
      );
    };
    function parse(str) {
      str = String(str);
      if (str.length > 100) {
        return;
      }
      var match2 = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
        str
      );
      if (!match2) {
        return;
      }
      var n2 = parseFloat(match2[1]);
      var type = (match2[2] || "ms").toLowerCase();
      switch (type) {
        case "years":
        case "year":
        case "yrs":
        case "yr":
        case "y":
          return n2 * y2;
        case "weeks":
        case "week":
        case "w":
          return n2 * w2;
        case "days":
        case "day":
        case "d":
          return n2 * d2;
        case "hours":
        case "hour":
        case "hrs":
        case "hr":
        case "h":
          return n2 * h2;
        case "minutes":
        case "minute":
        case "mins":
        case "min":
        case "m":
          return n2 * m2;
        case "seconds":
        case "second":
        case "secs":
        case "sec":
        case "s":
          return n2 * s2;
        case "milliseconds":
        case "millisecond":
        case "msecs":
        case "msec":
        case "ms":
          return n2;
        default:
          return void 0;
      }
    }
    function fmtShort(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d2) {
        return Math.round(ms / d2) + "d";
      }
      if (msAbs >= h2) {
        return Math.round(ms / h2) + "h";
      }
      if (msAbs >= m2) {
        return Math.round(ms / m2) + "m";
      }
      if (msAbs >= s2) {
        return Math.round(ms / s2) + "s";
      }
      return ms + "ms";
    }
    function fmtLong(ms) {
      var msAbs = Math.abs(ms);
      if (msAbs >= d2) {
        return plural(ms, msAbs, d2, "day");
      }
      if (msAbs >= h2) {
        return plural(ms, msAbs, h2, "hour");
      }
      if (msAbs >= m2) {
        return plural(ms, msAbs, m2, "minute");
      }
      if (msAbs >= s2) {
        return plural(ms, msAbs, s2, "second");
      }
      return ms + " ms";
    }
    function plural(ms, msAbs, n2, name) {
      var isPlural = msAbs >= n2 * 1.5;
      return Math.round(ms / n2) + " " + name + (isPlural ? "s" : "");
    }
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js
var require_common = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/common.js"(exports, module) {
    function setup2(env) {
      createDebug.debug = createDebug;
      createDebug.default = createDebug;
      createDebug.coerce = coerce;
      createDebug.disable = disable;
      createDebug.enable = enable;
      createDebug.enabled = enabled;
      createDebug.humanize = require_ms();
      createDebug.destroy = destroy;
      Object.keys(env).forEach((key) => {
        createDebug[key] = env[key];
      });
      createDebug.names = [];
      createDebug.skips = [];
      createDebug.formatters = {};
      function selectColor(namespace) {
        let hash = 0;
        for (let i2 = 0; i2 < namespace.length; i2++) {
          hash = (hash << 5) - hash + namespace.charCodeAt(i2);
          hash |= 0;
        }
        return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
      }
      createDebug.selectColor = selectColor;
      function createDebug(namespace) {
        let prevTime;
        let enableOverride = null;
        let namespacesCache;
        let enabledCache;
        function debug5(...args) {
          if (!debug5.enabled) {
            return;
          }
          const self2 = debug5;
          const curr = Number(/* @__PURE__ */ new Date());
          const ms = curr - (prevTime || curr);
          self2.diff = ms;
          self2.prev = prevTime;
          self2.curr = curr;
          prevTime = curr;
          args[0] = createDebug.coerce(args[0]);
          if (typeof args[0] !== "string") {
            args.unshift("%O");
          }
          let index = 0;
          args[0] = args[0].replace(/%([a-zA-Z%])/g, (match2, format6) => {
            if (match2 === "%%") {
              return "%";
            }
            index++;
            const formatter = createDebug.formatters[format6];
            if (typeof formatter === "function") {
              const val = args[index];
              match2 = formatter.call(self2, val);
              args.splice(index, 1);
              index--;
            }
            return match2;
          });
          createDebug.formatArgs.call(self2, args);
          const logFn = self2.log || createDebug.log;
          logFn.apply(self2, args);
        }
        debug5.namespace = namespace;
        debug5.useColors = createDebug.useColors();
        debug5.color = createDebug.selectColor(namespace);
        debug5.extend = extend;
        debug5.destroy = createDebug.destroy;
        Object.defineProperty(debug5, "enabled", {
          enumerable: true,
          configurable: false,
          get: () => {
            if (enableOverride !== null) {
              return enableOverride;
            }
            if (namespacesCache !== createDebug.namespaces) {
              namespacesCache = createDebug.namespaces;
              enabledCache = createDebug.enabled(namespace);
            }
            return enabledCache;
          },
          set: (v2) => {
            enableOverride = v2;
          }
        });
        if (typeof createDebug.init === "function") {
          createDebug.init(debug5);
        }
        return debug5;
      }
      function extend(namespace, delimiter) {
        const newDebug = createDebug(this.namespace + (typeof delimiter === "undefined" ? ":" : delimiter) + namespace);
        newDebug.log = this.log;
        return newDebug;
      }
      function enable(namespaces) {
        createDebug.save(namespaces);
        createDebug.namespaces = namespaces;
        createDebug.names = [];
        createDebug.skips = [];
        const split = (typeof namespaces === "string" ? namespaces : "").trim().replace(/\s+/g, ",").split(",").filter(Boolean);
        for (const ns of split) {
          if (ns[0] === "-") {
            createDebug.skips.push(ns.slice(1));
          } else {
            createDebug.names.push(ns);
          }
        }
      }
      function matchesTemplate(search, template) {
        let searchIndex = 0;
        let templateIndex = 0;
        let starIndex = -1;
        let matchIndex = 0;
        while (searchIndex < search.length) {
          if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === "*")) {
            if (template[templateIndex] === "*") {
              starIndex = templateIndex;
              matchIndex = searchIndex;
              templateIndex++;
            } else {
              searchIndex++;
              templateIndex++;
            }
          } else if (starIndex !== -1) {
            templateIndex = starIndex + 1;
            matchIndex++;
            searchIndex = matchIndex;
          } else {
            return false;
          }
        }
        while (templateIndex < template.length && template[templateIndex] === "*") {
          templateIndex++;
        }
        return templateIndex === template.length;
      }
      function disable() {
        const namespaces = [
          ...createDebug.names,
          ...createDebug.skips.map((namespace) => "-" + namespace)
        ].join(",");
        createDebug.enable("");
        return namespaces;
      }
      function enabled(name) {
        for (const skip of createDebug.skips) {
          if (matchesTemplate(name, skip)) {
            return false;
          }
        }
        for (const ns of createDebug.names) {
          if (matchesTemplate(name, ns)) {
            return true;
          }
        }
        return false;
      }
      function coerce(val) {
        if (val instanceof Error) {
          return val.stack || val.message;
        }
        return val;
      }
      function destroy() {
        console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
      }
      createDebug.enable(createDebug.load());
      return createDebug;
    }
    module.exports = setup2;
  }
});

// ../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js
var require_browser = __commonJS({
  "../../../node_modules/.pnpm/debug@4.4.3/node_modules/debug/src/browser.js"(exports, module) {
    exports.formatArgs = formatArgs;
    exports.save = save;
    exports.load = load;
    exports.useColors = useColors;
    exports.storage = localstorage();
    exports.destroy = /* @__PURE__ */ (() => {
      let warned = false;
      return () => {
        if (!warned) {
          warned = true;
          console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");
        }
      };
    })();
    exports.colors = [
      "#0000CC",
      "#0000FF",
      "#0033CC",
      "#0033FF",
      "#0066CC",
      "#0066FF",
      "#0099CC",
      "#0099FF",
      "#00CC00",
      "#00CC33",
      "#00CC66",
      "#00CC99",
      "#00CCCC",
      "#00CCFF",
      "#3300CC",
      "#3300FF",
      "#3333CC",
      "#3333FF",
      "#3366CC",
      "#3366FF",
      "#3399CC",
      "#3399FF",
      "#33CC00",
      "#33CC33",
      "#33CC66",
      "#33CC99",
      "#33CCCC",
      "#33CCFF",
      "#6600CC",
      "#6600FF",
      "#6633CC",
      "#6633FF",
      "#66CC00",
      "#66CC33",
      "#9900CC",
      "#9900FF",
      "#9933CC",
      "#9933FF",
      "#99CC00",
      "#99CC33",
      "#CC0000",
      "#CC0033",
      "#CC0066",
      "#CC0099",
      "#CC00CC",
      "#CC00FF",
      "#CC3300",
      "#CC3333",
      "#CC3366",
      "#CC3399",
      "#CC33CC",
      "#CC33FF",
      "#CC6600",
      "#CC6633",
      "#CC9900",
      "#CC9933",
      "#CCCC00",
      "#CCCC33",
      "#FF0000",
      "#FF0033",
      "#FF0066",
      "#FF0099",
      "#FF00CC",
      "#FF00FF",
      "#FF3300",
      "#FF3333",
      "#FF3366",
      "#FF3399",
      "#FF33CC",
      "#FF33FF",
      "#FF6600",
      "#FF6633",
      "#FF9900",
      "#FF9933",
      "#FFCC00",
      "#FFCC33"
    ];
    function useColors() {
      if (typeof window !== "undefined" && window.process && (window.process.type === "renderer" || window.process.__nwjs)) {
        return true;
      }
      if (typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
        return false;
      }
      let m2;
      return typeof document !== "undefined" && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance || // Is firebug? http://stackoverflow.com/a/398120/376773
      typeof window !== "undefined" && window.console && (window.console.firebug || window.console.exception && window.console.table) || // Is firefox >= v31?
      // https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
      typeof navigator !== "undefined" && navigator.userAgent && (m2 = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m2[1], 10) >= 31 || // Double check webkit in userAgent just in case we are in a worker
      typeof navigator !== "undefined" && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/);
    }
    function formatArgs(args) {
      args[0] = (this.useColors ? "%c" : "") + this.namespace + (this.useColors ? " %c" : " ") + args[0] + (this.useColors ? "%c " : " ") + "+" + module.exports.humanize(this.diff);
      if (!this.useColors) {
        return;
      }
      const c2 = "color: " + this.color;
      args.splice(1, 0, c2, "color: inherit");
      let index = 0;
      let lastC = 0;
      args[0].replace(/%[a-zA-Z%]/g, (match2) => {
        if (match2 === "%%") {
          return;
        }
        index++;
        if (match2 === "%c") {
          lastC = index;
        }
      });
      args.splice(lastC, 0, c2);
    }
    exports.log = console.debug || console.log || (() => {
    });
    function save(namespaces) {
      try {
        if (namespaces) {
          exports.storage.setItem("debug", namespaces);
        } else {
          exports.storage.removeItem("debug");
        }
      } catch (error2) {
      }
    }
    function load() {
      let r3;
      try {
        r3 = exports.storage.getItem("debug") || exports.storage.getItem("DEBUG");
      } catch (error2) {
      }
      if (!r3 && typeof process !== "undefined" && "env" in process) {
        r3 = process.env.DEBUG;
      }
      return r3;
    }
    function localstorage() {
      try {
        return localStorage;
      } catch (error2) {
      }
    }
    module.exports = require_common()(exports);
    var { formatters: formatters2 } = module.exports;
    formatters2.j = function(v2) {
      try {
        return JSON.stringify(v2);
      } catch (error2) {
        return "[UnexpectedJSONParseError]: " + error2.message;
      }
    };
  }
});

// package-external:@wordpress/date
var require_date = __commonJS({
  "package-external:@wordpress/date"(exports, module) {
    module.exports = window.wp.date;
  }
});

// package-external:@wordpress/i18n
var require_i18n = __commonJS({
  "package-external:@wordpress/i18n"(exports, module) {
    module.exports = window.wp.i18n;
  }
});

// package-external:@wordpress/components
var require_components = __commonJS({
  "package-external:@wordpress/components"(exports, module) {
    module.exports = window.wp.components;
  }
});

// vendor-external:react/jsx-runtime
var require_jsx_runtime = __commonJS({
  "vendor-external:react/jsx-runtime"(exports, module) {
    module.exports = window.ReactJSXRuntime;
  }
});

// package-external:@wordpress/element
var require_element = __commonJS({
  "package-external:@wordpress/element"(exports, module) {
    module.exports = window.wp.element;
  }
});

// vendor-external:react
var require_react = __commonJS({
  "vendor-external:react"(exports, module) {
    module.exports = window.React;
  }
});

// vendor-external:react-dom
var require_react_dom = __commonJS({
  "vendor-external:react-dom"(exports, module) {
    module.exports = window.ReactDOM;
  }
});

// ../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js
var require_use_sync_external_store_shim_development = __commonJS({
  "../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) {
    "use strict";
    (function() {
      function is(x2, y2) {
        return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2;
      }
      function useSyncExternalStore$2(subscribe2, getSnapshot) {
        didWarnOld18Alpha || void 0 === React35.startTransition || (didWarnOld18Alpha = true, console.error(
          "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
        ));
        var value = getSnapshot();
        if (!didWarnUncachedGetSnapshot) {
          var cachedValue = getSnapshot();
          objectIs(value, cachedValue) || (console.error(
            "The result of getSnapshot should be cached to avoid an infinite loop"
          ), didWarnUncachedGetSnapshot = true);
        }
        cachedValue = useState56({
          inst: { value, getSnapshot }
        });
        var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
        useLayoutEffect5(
          function() {
            inst.value = value;
            inst.getSnapshot = getSnapshot;
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
          },
          [subscribe2, value, getSnapshot]
        );
        useEffect43(
          function() {
            checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            return subscribe2(function() {
              checkIfSnapshotChanged(inst) && forceUpdate({ inst });
            });
          },
          [subscribe2]
        );
        useDebugValue(value);
        return value;
      }
      function checkIfSnapshotChanged(inst) {
        var latestGetSnapshot = inst.getSnapshot;
        inst = inst.value;
        try {
          var nextValue = latestGetSnapshot();
          return !objectIs(inst, nextValue);
        } catch (error2) {
          return true;
        }
      }
      function useSyncExternalStore$1(subscribe2, getSnapshot) {
        return getSnapshot();
      }
      "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
      var React35 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState56 = React35.useState, useEffect43 = React35.useEffect, useLayoutEffect5 = React35.useLayoutEffect, useDebugValue = React35.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
      exports.useSyncExternalStore = void 0 !== React35.useSyncExternalStore ? React35.useSyncExternalStore : shim;
      "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
    })();
  }
});

// ../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js
var require_shim = __commonJS({
  "../../../node_modules/.pnpm/use-sync-external-store@1.6.0_react@18.3.1/node_modules/use-sync-external-store/shim/index.js"(exports, module) {
    "use strict";
    if (false) {
      module.exports = null;
    } else {
      module.exports = require_use_sync_external_store_shim_development();
    }
  }
});

// package-external:@wordpress/primitives
var require_primitives = __commonJS({
  "package-external:@wordpress/primitives"(exports, module) {
    module.exports = window.wp.primitives;
  }
});

// package-external:@wordpress/private-apis
var require_private_apis = __commonJS({
  "package-external:@wordpress/private-apis"(exports, module) {
    module.exports = window.wp.privateApis;
  }
});

// package-external:@wordpress/compose
var require_compose = __commonJS({
  "package-external:@wordpress/compose"(exports, module) {
    module.exports = window.wp.compose;
  }
});

// package-external:@wordpress/data
var require_data = __commonJS({
  "package-external:@wordpress/data"(exports, module) {
    module.exports = window.wp.data;
  }
});

// package-external:@wordpress/keycodes
var require_keycodes = __commonJS({
  "package-external:@wordpress/keycodes"(exports, module) {
    module.exports = window.wp.keycodes;
  }
});

// ../../../node_modules/.pnpm/remove-accents@0.5.0/node_modules/remove-accents/index.js
var require_remove_accents = __commonJS({
  "../../../node_modules/.pnpm/remove-accents@0.5.0/node_modules/remove-accents/index.js"(exports, module) {
    var characterMap = {
      "\xC0": "A",
      "\xC1": "A",
      "\xC2": "A",
      "\xC3": "A",
      "\xC4": "A",
      "\xC5": "A",
      "\u1EA4": "A",
      "\u1EAE": "A",
      "\u1EB2": "A",
      "\u1EB4": "A",
      "\u1EB6": "A",
      "\xC6": "AE",
      "\u1EA6": "A",
      "\u1EB0": "A",
      "\u0202": "A",
      "\u1EA2": "A",
      "\u1EA0": "A",
      "\u1EA8": "A",
      "\u1EAA": "A",
      "\u1EAC": "A",
      "\xC7": "C",
      "\u1E08": "C",
      "\xC8": "E",
      "\xC9": "E",
      "\xCA": "E",
      "\xCB": "E",
      "\u1EBE": "E",
      "\u1E16": "E",
      "\u1EC0": "E",
      "\u1E14": "E",
      "\u1E1C": "E",
      "\u0206": "E",
      "\u1EBA": "E",
      "\u1EBC": "E",
      "\u1EB8": "E",
      "\u1EC2": "E",
      "\u1EC4": "E",
      "\u1EC6": "E",
      "\xCC": "I",
      "\xCD": "I",
      "\xCE": "I",
      "\xCF": "I",
      "\u1E2E": "I",
      "\u020A": "I",
      "\u1EC8": "I",
      "\u1ECA": "I",
      "\xD0": "D",
      "\xD1": "N",
      "\xD2": "O",
      "\xD3": "O",
      "\xD4": "O",
      "\xD5": "O",
      "\xD6": "O",
      "\xD8": "O",
      "\u1ED0": "O",
      "\u1E4C": "O",
      "\u1E52": "O",
      "\u020E": "O",
      "\u1ECE": "O",
      "\u1ECC": "O",
      "\u1ED4": "O",
      "\u1ED6": "O",
      "\u1ED8": "O",
      "\u1EDC": "O",
      "\u1EDE": "O",
      "\u1EE0": "O",
      "\u1EDA": "O",
      "\u1EE2": "O",
      "\xD9": "U",
      "\xDA": "U",
      "\xDB": "U",
      "\xDC": "U",
      "\u1EE6": "U",
      "\u1EE4": "U",
      "\u1EEC": "U",
      "\u1EEE": "U",
      "\u1EF0": "U",
      "\xDD": "Y",
      "\xE0": "a",
      "\xE1": "a",
      "\xE2": "a",
      "\xE3": "a",
      "\xE4": "a",
      "\xE5": "a",
      "\u1EA5": "a",
      "\u1EAF": "a",
      "\u1EB3": "a",
      "\u1EB5": "a",
      "\u1EB7": "a",
      "\xE6": "ae",
      "\u1EA7": "a",
      "\u1EB1": "a",
      "\u0203": "a",
      "\u1EA3": "a",
      "\u1EA1": "a",
      "\u1EA9": "a",
      "\u1EAB": "a",
      "\u1EAD": "a",
      "\xE7": "c",
      "\u1E09": "c",
      "\xE8": "e",
      "\xE9": "e",
      "\xEA": "e",
      "\xEB": "e",
      "\u1EBF": "e",
      "\u1E17": "e",
      "\u1EC1": "e",
      "\u1E15": "e",
      "\u1E1D": "e",
      "\u0207": "e",
      "\u1EBB": "e",
      "\u1EBD": "e",
      "\u1EB9": "e",
      "\u1EC3": "e",
      "\u1EC5": "e",
      "\u1EC7": "e",
      "\xEC": "i",
      "\xED": "i",
      "\xEE": "i",
      "\xEF": "i",
      "\u1E2F": "i",
      "\u020B": "i",
      "\u1EC9": "i",
      "\u1ECB": "i",
      "\xF0": "d",
      "\xF1": "n",
      "\xF2": "o",
      "\xF3": "o",
      "\xF4": "o",
      "\xF5": "o",
      "\xF6": "o",
      "\xF8": "o",
      "\u1ED1": "o",
      "\u1E4D": "o",
      "\u1E53": "o",
      "\u020F": "o",
      "\u1ECF": "o",
      "\u1ECD": "o",
      "\u1ED5": "o",
      "\u1ED7": "o",
      "\u1ED9": "o",
      "\u1EDD": "o",
      "\u1EDF": "o",
      "\u1EE1": "o",
      "\u1EDB": "o",
      "\u1EE3": "o",
      "\xF9": "u",
      "\xFA": "u",
      "\xFB": "u",
      "\xFC": "u",
      "\u1EE7": "u",
      "\u1EE5": "u",
      "\u1EED": "u",
      "\u1EEF": "u",
      "\u1EF1": "u",
      "\xFD": "y",
      "\xFF": "y",
      "\u0100": "A",
      "\u0101": "a",
      "\u0102": "A",
      "\u0103": "a",
      "\u0104": "A",
      "\u0105": "a",
      "\u0106": "C",
      "\u0107": "c",
      "\u0108": "C",
      "\u0109": "c",
      "\u010A": "C",
      "\u010B": "c",
      "\u010C": "C",
      "\u010D": "c",
      "C\u0306": "C",
      "c\u0306": "c",
      "\u010E": "D",
      "\u010F": "d",
      "\u0110": "D",
      "\u0111": "d",
      "\u0112": "E",
      "\u0113": "e",
      "\u0114": "E",
      "\u0115": "e",
      "\u0116": "E",
      "\u0117": "e",
      "\u0118": "E",
      "\u0119": "e",
      "\u011A": "E",
      "\u011B": "e",
      "\u011C": "G",
      "\u01F4": "G",
      "\u011D": "g",
      "\u01F5": "g",
      "\u011E": "G",
      "\u011F": "g",
      "\u0120": "G",
      "\u0121": "g",
      "\u0122": "G",
      "\u0123": "g",
      "\u0124": "H",
      "\u0125": "h",
      "\u0126": "H",
      "\u0127": "h",
      "\u1E2A": "H",
      "\u1E2B": "h",
      "\u0128": "I",
      "\u0129": "i",
      "\u012A": "I",
      "\u012B": "i",
      "\u012C": "I",
      "\u012D": "i",
      "\u012E": "I",
      "\u012F": "i",
      "\u0130": "I",
      "\u0131": "i",
      "\u0132": "IJ",
      "\u0133": "ij",
      "\u0134": "J",
      "\u0135": "j",
      "\u0136": "K",
      "\u0137": "k",
      "\u1E30": "K",
      "\u1E31": "k",
      "K\u0306": "K",
      "k\u0306": "k",
      "\u0139": "L",
      "\u013A": "l",
      "\u013B": "L",
      "\u013C": "l",
      "\u013D": "L",
      "\u013E": "l",
      "\u013F": "L",
      "\u0140": "l",
      "\u0141": "l",
      "\u0142": "l",
      "\u1E3E": "M",
      "\u1E3F": "m",
      "M\u0306": "M",
      "m\u0306": "m",
      "\u0143": "N",
      "\u0144": "n",
      "\u0145": "N",
      "\u0146": "n",
      "\u0147": "N",
      "\u0148": "n",
      "\u0149": "n",
      "N\u0306": "N",
      "n\u0306": "n",
      "\u014C": "O",
      "\u014D": "o",
      "\u014E": "O",
      "\u014F": "o",
      "\u0150": "O",
      "\u0151": "o",
      "\u0152": "OE",
      "\u0153": "oe",
      "P\u0306": "P",
      "p\u0306": "p",
      "\u0154": "R",
      "\u0155": "r",
      "\u0156": "R",
      "\u0157": "r",
      "\u0158": "R",
      "\u0159": "r",
      "R\u0306": "R",
      "r\u0306": "r",
      "\u0212": "R",
      "\u0213": "r",
      "\u015A": "S",
      "\u015B": "s",
      "\u015C": "S",
      "\u015D": "s",
      "\u015E": "S",
      "\u0218": "S",
      "\u0219": "s",
      "\u015F": "s",
      "\u0160": "S",
      "\u0161": "s",
      "\u0162": "T",
      "\u0163": "t",
      "\u021B": "t",
      "\u021A": "T",
      "\u0164": "T",
      "\u0165": "t",
      "\u0166": "T",
      "\u0167": "t",
      "T\u0306": "T",
      "t\u0306": "t",
      "\u0168": "U",
      "\u0169": "u",
      "\u016A": "U",
      "\u016B": "u",
      "\u016C": "U",
      "\u016D": "u",
      "\u016E": "U",
      "\u016F": "u",
      "\u0170": "U",
      "\u0171": "u",
      "\u0172": "U",
      "\u0173": "u",
      "\u0216": "U",
      "\u0217": "u",
      "V\u0306": "V",
      "v\u0306": "v",
      "\u0174": "W",
      "\u0175": "w",
      "\u1E82": "W",
      "\u1E83": "w",
      "X\u0306": "X",
      "x\u0306": "x",
      "\u0176": "Y",
      "\u0177": "y",
      "\u0178": "Y",
      "Y\u0306": "Y",
      "y\u0306": "y",
      "\u0179": "Z",
      "\u017A": "z",
      "\u017B": "Z",
      "\u017C": "z",
      "\u017D": "Z",
      "\u017E": "z",
      "\u017F": "s",
      "\u0192": "f",
      "\u01A0": "O",
      "\u01A1": "o",
      "\u01AF": "U",
      "\u01B0": "u",
      "\u01CD": "A",
      "\u01CE": "a",
      "\u01CF": "I",
      "\u01D0": "i",
      "\u01D1": "O",
      "\u01D2": "o",
      "\u01D3": "U",
      "\u01D4": "u",
      "\u01D5": "U",
      "\u01D6": "u",
      "\u01D7": "U",
      "\u01D8": "u",
      "\u01D9": "U",
      "\u01DA": "u",
      "\u01DB": "U",
      "\u01DC": "u",
      "\u1EE8": "U",
      "\u1EE9": "u",
      "\u1E78": "U",
      "\u1E79": "u",
      "\u01FA": "A",
      "\u01FB": "a",
      "\u01FC": "AE",
      "\u01FD": "ae",
      "\u01FE": "O",
      "\u01FF": "o",
      "\xDE": "TH",
      "\xFE": "th",
      "\u1E54": "P",
      "\u1E55": "p",
      "\u1E64": "S",
      "\u1E65": "s",
      "X\u0301": "X",
      "x\u0301": "x",
      "\u0403": "\u0413",
      "\u0453": "\u0433",
      "\u040C": "\u041A",
      "\u045C": "\u043A",
      "A\u030B": "A",
      "a\u030B": "a",
      "E\u030B": "E",
      "e\u030B": "e",
      "I\u030B": "I",
      "i\u030B": "i",
      "\u01F8": "N",
      "\u01F9": "n",
      "\u1ED2": "O",
      "\u1ED3": "o",
      "\u1E50": "O",
      "\u1E51": "o",
      "\u1EEA": "U",
      "\u1EEB": "u",
      "\u1E80": "W",
      "\u1E81": "w",
      "\u1EF2": "Y",
      "\u1EF3": "y",
      "\u0200": "A",
      "\u0201": "a",
      "\u0204": "E",
      "\u0205": "e",
      "\u0208": "I",
      "\u0209": "i",
      "\u020C": "O",
      "\u020D": "o",
      "\u0210": "R",
      "\u0211": "r",
      "\u0214": "U",
      "\u0215": "u",
      "B\u030C": "B",
      "b\u030C": "b",
      "\u010C\u0323": "C",
      "\u010D\u0323": "c",
      "\xCA\u030C": "E",
      "\xEA\u030C": "e",
      "F\u030C": "F",
      "f\u030C": "f",
      "\u01E6": "G",
      "\u01E7": "g",
      "\u021E": "H",
      "\u021F": "h",
      "J\u030C": "J",
      "\u01F0": "j",
      "\u01E8": "K",
      "\u01E9": "k",
      "M\u030C": "M",
      "m\u030C": "m",
      "P\u030C": "P",
      "p\u030C": "p",
      "Q\u030C": "Q",
      "q\u030C": "q",
      "\u0158\u0329": "R",
      "\u0159\u0329": "r",
      "\u1E66": "S",
      "\u1E67": "s",
      "V\u030C": "V",
      "v\u030C": "v",
      "W\u030C": "W",
      "w\u030C": "w",
      "X\u030C": "X",
      "x\u030C": "x",
      "Y\u030C": "Y",
      "y\u030C": "y",
      "A\u0327": "A",
      "a\u0327": "a",
      "B\u0327": "B",
      "b\u0327": "b",
      "\u1E10": "D",
      "\u1E11": "d",
      "\u0228": "E",
      "\u0229": "e",
      "\u0190\u0327": "E",
      "\u025B\u0327": "e",
      "\u1E28": "H",
      "\u1E29": "h",
      "I\u0327": "I",
      "i\u0327": "i",
      "\u0197\u0327": "I",
      "\u0268\u0327": "i",
      "M\u0327": "M",
      "m\u0327": "m",
      "O\u0327": "O",
      "o\u0327": "o",
      "Q\u0327": "Q",
      "q\u0327": "q",
      "U\u0327": "U",
      "u\u0327": "u",
      "X\u0327": "X",
      "x\u0327": "x",
      "Z\u0327": "Z",
      "z\u0327": "z",
      "\u0439": "\u0438",
      "\u0419": "\u0418",
      "\u0451": "\u0435",
      "\u0401": "\u0415"
    };
    var chars = Object.keys(characterMap).join("|");
    var allAccents = new RegExp(chars, "g");
    var firstAccent = new RegExp(chars, "");
    function matcher(match2) {
      return characterMap[match2];
    }
    var removeAccents2 = function(string) {
      return string.replace(allAccents, matcher);
    };
    var hasAccents = function(string) {
      return !!string.match(firstAccent);
    };
    module.exports = removeAccents2;
    module.exports.has = hasAccents;
    module.exports.remove = removeAccents2;
  }
});

// ../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js
var require_es6 = __commonJS({
  "../../../node_modules/.pnpm/fast-deep-equal@3.1.3/node_modules/fast-deep-equal/es6/index.js"(exports, module) {
    "use strict";
    module.exports = function equal(a2, b2) {
      if (a2 === b2) return true;
      if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") {
        if (a2.constructor !== b2.constructor) return false;
        var length, i2, keys;
        if (Array.isArray(a2)) {
          length = a2.length;
          if (length != b2.length) return false;
          for (i2 = length; i2-- !== 0; )
            if (!equal(a2[i2], b2[i2])) return false;
          return true;
        }
        if (a2 instanceof Map && b2 instanceof Map) {
          if (a2.size !== b2.size) return false;
          for (i2 of a2.entries())
            if (!b2.has(i2[0])) return false;
          for (i2 of a2.entries())
            if (!equal(i2[1], b2.get(i2[0]))) return false;
          return true;
        }
        if (a2 instanceof Set && b2 instanceof Set) {
          if (a2.size !== b2.size) return false;
          for (i2 of a2.entries())
            if (!b2.has(i2[0])) return false;
          return true;
        }
        if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) {
          length = a2.length;
          if (length != b2.length) return false;
          for (i2 = length; i2-- !== 0; )
            if (a2[i2] !== b2[i2]) return false;
          return true;
        }
        if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags;
        if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf();
        if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString();
        keys = Object.keys(a2);
        length = keys.length;
        if (length !== Object.keys(b2).length) return false;
        for (i2 = length; i2-- !== 0; )
          if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false;
        for (i2 = length; i2-- !== 0; ) {
          var key = keys[i2];
          if (!equal(a2[key], b2[key])) return false;
        }
        return true;
      }
      return a2 !== a2 && b2 !== b2;
    };
  }
});

// package-external:@wordpress/warning
var require_warning = __commonJS({
  "package-external:@wordpress/warning"(exports, module) {
    module.exports = window.wp.warning;
  }
});

// ../../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js
var require_events = __commonJS({
  "../../../node_modules/.pnpm/events@3.3.0/node_modules/events/events.js"(exports, module) {
    "use strict";
    var R = typeof Reflect === "object" ? Reflect : null;
    var ReflectApply = R && typeof R.apply === "function" ? R.apply : function ReflectApply2(target, receiver, args) {
      return Function.prototype.apply.call(target, receiver, args);
    };
    var ReflectOwnKeys;
    if (R && typeof R.ownKeys === "function") {
      ReflectOwnKeys = R.ownKeys;
    } else if (Object.getOwnPropertySymbols) {
      ReflectOwnKeys = function ReflectOwnKeys2(target) {
        return Object.getOwnPropertyNames(target).concat(Object.getOwnPropertySymbols(target));
      };
    } else {
      ReflectOwnKeys = function ReflectOwnKeys2(target) {
        return Object.getOwnPropertyNames(target);
      };
    }
    function ProcessEmitWarning(warning2) {
      if (console && console.warn) console.warn(warning2);
    }
    var NumberIsNaN = Number.isNaN || function NumberIsNaN2(value) {
      return value !== value;
    };
    function EventEmitter2() {
      EventEmitter2.init.call(this);
    }
    module.exports = EventEmitter2;
    module.exports.once = once;
    EventEmitter2.EventEmitter = EventEmitter2;
    EventEmitter2.prototype._events = void 0;
    EventEmitter2.prototype._eventsCount = 0;
    EventEmitter2.prototype._maxListeners = void 0;
    var defaultMaxListeners = 10;
    function checkListener(listener) {
      if (typeof listener !== "function") {
        throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof listener);
      }
    }
    Object.defineProperty(EventEmitter2, "defaultMaxListeners", {
      enumerable: true,
      get: function() {
        return defaultMaxListeners;
      },
      set: function(arg) {
        if (typeof arg !== "number" || arg < 0 || NumberIsNaN(arg)) {
          throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + arg + ".");
        }
        defaultMaxListeners = arg;
      }
    });
    EventEmitter2.init = function() {
      if (this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) {
        this._events = /* @__PURE__ */ Object.create(null);
        this._eventsCount = 0;
      }
      this._maxListeners = this._maxListeners || void 0;
    };
    EventEmitter2.prototype.setMaxListeners = function setMaxListeners(n2) {
      if (typeof n2 !== "number" || n2 < 0 || NumberIsNaN(n2)) {
        throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + n2 + ".");
      }
      this._maxListeners = n2;
      return this;
    };
    function _getMaxListeners(that) {
      if (that._maxListeners === void 0)
        return EventEmitter2.defaultMaxListeners;
      return that._maxListeners;
    }
    EventEmitter2.prototype.getMaxListeners = function getMaxListeners() {
      return _getMaxListeners(this);
    };
    EventEmitter2.prototype.emit = function emit(type) {
      var args = [];
      for (var i2 = 1; i2 < arguments.length; i2++) args.push(arguments[i2]);
      var doError = type === "error";
      var events = this._events;
      if (events !== void 0)
        doError = doError && events.error === void 0;
      else if (!doError)
        return false;
      if (doError) {
        var er;
        if (args.length > 0)
          er = args[0];
        if (er instanceof Error) {
          throw er;
        }
        var err = new Error("Unhandled error." + (er ? " (" + er.message + ")" : ""));
        err.context = er;
        throw err;
      }
      var handler = events[type];
      if (handler === void 0)
        return false;
      if (typeof handler === "function") {
        ReflectApply(handler, this, args);
      } else {
        var len = handler.length;
        var listeners = arrayClone(handler, len);
        for (var i2 = 0; i2 < len; ++i2)
          ReflectApply(listeners[i2], this, args);
      }
      return true;
    };
    function _addListener(target, type, listener, prepend) {
      var m2;
      var events;
      var existing;
      checkListener(listener);
      events = target._events;
      if (events === void 0) {
        events = target._events = /* @__PURE__ */ Object.create(null);
        target._eventsCount = 0;
      } else {
        if (events.newListener !== void 0) {
          target.emit(
            "newListener",
            type,
            listener.listener ? listener.listener : listener
          );
          events = target._events;
        }
        existing = events[type];
      }
      if (existing === void 0) {
        existing = events[type] = listener;
        ++target._eventsCount;
      } else {
        if (typeof existing === "function") {
          existing = events[type] = prepend ? [listener, existing] : [existing, listener];
        } else if (prepend) {
          existing.unshift(listener);
        } else {
          existing.push(listener);
        }
        m2 = _getMaxListeners(target);
        if (m2 > 0 && existing.length > m2 && !existing.warned) {
          existing.warned = true;
          var w2 = new Error("Possible EventEmitter memory leak detected. " + existing.length + " " + String(type) + " listeners added. Use emitter.setMaxListeners() to increase limit");
          w2.name = "MaxListenersExceededWarning";
          w2.emitter = target;
          w2.type = type;
          w2.count = existing.length;
          ProcessEmitWarning(w2);
        }
      }
      return target;
    }
    EventEmitter2.prototype.addListener = function addListener(type, listener) {
      return _addListener(this, type, listener, false);
    };
    EventEmitter2.prototype.on = EventEmitter2.prototype.addListener;
    EventEmitter2.prototype.prependListener = function prependListener(type, listener) {
      return _addListener(this, type, listener, true);
    };
    function onceWrapper() {
      if (!this.fired) {
        this.target.removeListener(this.type, this.wrapFn);
        this.fired = true;
        if (arguments.length === 0)
          return this.listener.call(this.target);
        return this.listener.apply(this.target, arguments);
      }
    }
    function _onceWrap(target, type, listener) {
      var state = { fired: false, wrapFn: void 0, target, type, listener };
      var wrapped = onceWrapper.bind(state);
      wrapped.listener = listener;
      state.wrapFn = wrapped;
      return wrapped;
    }
    EventEmitter2.prototype.once = function once2(type, listener) {
      checkListener(listener);
      this.on(type, _onceWrap(this, type, listener));
      return this;
    };
    EventEmitter2.prototype.prependOnceListener = function prependOnceListener(type, listener) {
      checkListener(listener);
      this.prependListener(type, _onceWrap(this, type, listener));
      return this;
    };
    EventEmitter2.prototype.removeListener = function removeListener(type, listener) {
      var list, events, position, i2, originalListener;
      checkListener(listener);
      events = this._events;
      if (events === void 0)
        return this;
      list = events[type];
      if (list === void 0)
        return this;
      if (list === listener || list.listener === listener) {
        if (--this._eventsCount === 0)
          this._events = /* @__PURE__ */ Object.create(null);
        else {
          delete events[type];
          if (events.removeListener)
            this.emit("removeListener", type, list.listener || listener);
        }
      } else if (typeof list !== "function") {
        position = -1;
        for (i2 = list.length - 1; i2 >= 0; i2--) {
          if (list[i2] === listener || list[i2].listener === listener) {
            originalListener = list[i2].listener;
            position = i2;
            break;
          }
        }
        if (position < 0)
          return this;
        if (position === 0)
          list.shift();
        else {
          spliceOne(list, position);
        }
        if (list.length === 1)
          events[type] = list[0];
        if (events.removeListener !== void 0)
          this.emit("removeListener", type, originalListener || listener);
      }
      return this;
    };
    EventEmitter2.prototype.off = EventEmitter2.prototype.removeListener;
    EventEmitter2.prototype.removeAllListeners = function removeAllListeners(type) {
      var listeners, events, i2;
      events = this._events;
      if (events === void 0)
        return this;
      if (events.removeListener === void 0) {
        if (arguments.length === 0) {
          this._events = /* @__PURE__ */ Object.create(null);
          this._eventsCount = 0;
        } else if (events[type] !== void 0) {
          if (--this._eventsCount === 0)
            this._events = /* @__PURE__ */ Object.create(null);
          else
            delete events[type];
        }
        return this;
      }
      if (arguments.length === 0) {
        var keys = Object.keys(events);
        var key;
        for (i2 = 0; i2 < keys.length; ++i2) {
          key = keys[i2];
          if (key === "removeListener") continue;
          this.removeAllListeners(key);
        }
        this.removeAllListeners("removeListener");
        this._events = /* @__PURE__ */ Object.create(null);
        this._eventsCount = 0;
        return this;
      }
      listeners = events[type];
      if (typeof listeners === "function") {
        this.removeListener(type, listeners);
      } else if (listeners !== void 0) {
        for (i2 = listeners.length - 1; i2 >= 0; i2--) {
          this.removeListener(type, listeners[i2]);
        }
      }
      return this;
    };
    function _listeners(target, type, unwrap) {
      var events = target._events;
      if (events === void 0)
        return [];
      var evlistener = events[type];
      if (evlistener === void 0)
        return [];
      if (typeof evlistener === "function")
        return unwrap ? [evlistener.listener || evlistener] : [evlistener];
      return unwrap ? unwrapListeners(evlistener) : arrayClone(evlistener, evlistener.length);
    }
    EventEmitter2.prototype.listeners = function listeners(type) {
      return _listeners(this, type, true);
    };
    EventEmitter2.prototype.rawListeners = function rawListeners(type) {
      return _listeners(this, type, false);
    };
    EventEmitter2.listenerCount = function(emitter, type) {
      if (typeof emitter.listenerCount === "function") {
        return emitter.listenerCount(type);
      } else {
        return listenerCount.call(emitter, type);
      }
    };
    EventEmitter2.prototype.listenerCount = listenerCount;
    function listenerCount(type) {
      var events = this._events;
      if (events !== void 0) {
        var evlistener = events[type];
        if (typeof evlistener === "function") {
          return 1;
        } else if (evlistener !== void 0) {
          return evlistener.length;
        }
      }
      return 0;
    }
    EventEmitter2.prototype.eventNames = function eventNames() {
      return this._eventsCount > 0 ? ReflectOwnKeys(this._events) : [];
    };
    function arrayClone(arr, n2) {
      var copy = new Array(n2);
      for (var i2 = 0; i2 < n2; ++i2)
        copy[i2] = arr[i2];
      return copy;
    }
    function spliceOne(list, index) {
      for (; index + 1 < list.length; index++)
        list[index] = list[index + 1];
      list.pop();
    }
    function unwrapListeners(arr) {
      var ret = new Array(arr.length);
      for (var i2 = 0; i2 < ret.length; ++i2) {
        ret[i2] = arr[i2].listener || arr[i2];
      }
      return ret;
    }
    function once(emitter, name) {
      return new Promise(function(resolve, reject) {
        function errorListener(err) {
          emitter.removeListener(name, resolver);
          reject(err);
        }
        function resolver() {
          if (typeof emitter.removeListener === "function") {
            emitter.removeListener("error", errorListener);
          }
          resolve([].slice.call(arguments));
        }
        ;
        eventTargetAgnosticAddListener(emitter, name, resolver, { once: true });
        if (name !== "error") {
          addErrorHandlerIfEventEmitter(emitter, errorListener, { once: true });
        }
      });
    }
    function addErrorHandlerIfEventEmitter(emitter, handler, flags) {
      if (typeof emitter.on === "function") {
        eventTargetAgnosticAddListener(emitter, "error", handler, flags);
      }
    }
    function eventTargetAgnosticAddListener(emitter, name, listener, flags) {
      if (typeof emitter.on === "function") {
        if (flags.once) {
          emitter.once(name, listener);
        } else {
          emitter.on(name, listener);
        }
      } else if (typeof emitter.addEventListener === "function") {
        emitter.addEventListener(name, function wrapListener(arg) {
          if (flags.once) {
            emitter.removeEventListener(name, wrapListener);
          }
          listener(arg);
        });
      } else {
        throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof emitter);
      }
    }
  }
});

// package-external:@wordpress/api-fetch
var require_api_fetch = __commonJS({
  "package-external:@wordpress/api-fetch"(exports, module) {
    module.exports = window.wp.apiFetch;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js
var require_constants = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/constants.js"(exports, module) {
    "use strict";
    var SEMVER_SPEC_VERSION = "2.0.0";
    var MAX_LENGTH = 256;
    var MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER || /* istanbul ignore next */
    9007199254740991;
    var MAX_SAFE_COMPONENT_LENGTH = 16;
    var MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6;
    var RELEASE_TYPES = [
      "major",
      "premajor",
      "minor",
      "preminor",
      "patch",
      "prepatch",
      "prerelease"
    ];
    module.exports = {
      MAX_LENGTH,
      MAX_SAFE_COMPONENT_LENGTH,
      MAX_SAFE_BUILD_LENGTH,
      MAX_SAFE_INTEGER,
      RELEASE_TYPES,
      SEMVER_SPEC_VERSION,
      FLAG_INCLUDE_PRERELEASE: 1,
      FLAG_LOOSE: 2
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js
var require_debug = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/debug.js"(exports, module) {
    "use strict";
    var debug5 = typeof process === "object" && process.env && process.env.NODE_DEBUG && /\bsemver\b/i.test(process.env.NODE_DEBUG) ? (...args) => console.error("SEMVER", ...args) : () => {
    };
    module.exports = debug5;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js
var require_re = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/re.js"(exports, module) {
    "use strict";
    var {
      MAX_SAFE_COMPONENT_LENGTH,
      MAX_SAFE_BUILD_LENGTH,
      MAX_LENGTH
    } = require_constants();
    var debug5 = require_debug();
    exports = module.exports = {};
    var re = exports.re = [];
    var safeRe = exports.safeRe = [];
    var src = exports.src = [];
    var safeSrc = exports.safeSrc = [];
    var t2 = exports.t = {};
    var R = 0;
    var LETTERDASHNUMBER = "[a-zA-Z0-9-]";
    var safeRegexReplacements = [
      ["\\s", 1],
      ["\\d", MAX_LENGTH],
      [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH]
    ];
    var makeSafeRegex = (value) => {
      for (const [token, max] of safeRegexReplacements) {
        value = value.split(`${token}*`).join(`${token}{0,${max}}`).split(`${token}+`).join(`${token}{1,${max}}`);
      }
      return value;
    };
    var createToken = (name, value, isGlobal) => {
      const safe = makeSafeRegex(value);
      const index = R++;
      debug5(name, index, value);
      t2[name] = index;
      src[index] = value;
      safeSrc[index] = safe;
      re[index] = new RegExp(value, isGlobal ? "g" : void 0);
      safeRe[index] = new RegExp(safe, isGlobal ? "g" : void 0);
    };
    createToken("NUMERICIDENTIFIER", "0|[1-9]\\d*");
    createToken("NUMERICIDENTIFIERLOOSE", "\\d+");
    createToken("NONNUMERICIDENTIFIER", `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`);
    createToken("MAINVERSION", `(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})\\.(${src[t2.NUMERICIDENTIFIER]})`);
    createToken("MAINVERSIONLOOSE", `(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})\\.(${src[t2.NUMERICIDENTIFIERLOOSE]})`);
    createToken("PRERELEASEIDENTIFIER", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIER]})`);
    createToken("PRERELEASEIDENTIFIERLOOSE", `(?:${src[t2.NONNUMERICIDENTIFIER]}|${src[t2.NUMERICIDENTIFIERLOOSE]})`);
    createToken("PRERELEASE", `(?:-(${src[t2.PRERELEASEIDENTIFIER]}(?:\\.${src[t2.PRERELEASEIDENTIFIER]})*))`);
    createToken("PRERELEASELOOSE", `(?:-?(${src[t2.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${src[t2.PRERELEASEIDENTIFIERLOOSE]})*))`);
    createToken("BUILDIDENTIFIER", `${LETTERDASHNUMBER}+`);
    createToken("BUILD", `(?:\\+(${src[t2.BUILDIDENTIFIER]}(?:\\.${src[t2.BUILDIDENTIFIER]})*))`);
    createToken("FULLPLAIN", `v?${src[t2.MAINVERSION]}${src[t2.PRERELEASE]}?${src[t2.BUILD]}?`);
    createToken("FULL", `^${src[t2.FULLPLAIN]}$`);
    createToken("LOOSEPLAIN", `[v=\\s]*${src[t2.MAINVERSIONLOOSE]}${src[t2.PRERELEASELOOSE]}?${src[t2.BUILD]}?`);
    createToken("LOOSE", `^${src[t2.LOOSEPLAIN]}$`);
    createToken("GTLT", "((?:<|>)?=?)");
    createToken("XRANGEIDENTIFIERLOOSE", `${src[t2.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);
    createToken("XRANGEIDENTIFIER", `${src[t2.NUMERICIDENTIFIER]}|x|X|\\*`);
    createToken("XRANGEPLAIN", `[v=\\s]*(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:\\.(${src[t2.XRANGEIDENTIFIER]})(?:${src[t2.PRERELEASE]})?${src[t2.BUILD]}?)?)?`);
    createToken("XRANGEPLAINLOOSE", `[v=\\s]*(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:\\.(${src[t2.XRANGEIDENTIFIERLOOSE]})(?:${src[t2.PRERELEASELOOSE]})?${src[t2.BUILD]}?)?)?`);
    createToken("XRANGE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAIN]}$`);
    createToken("XRANGELOOSE", `^${src[t2.GTLT]}\\s*${src[t2.XRANGEPLAINLOOSE]}$`);
    createToken("COERCEPLAIN", `${"(^|[^\\d])(\\d{1,"}${MAX_SAFE_COMPONENT_LENGTH}})(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`);
    createToken("COERCE", `${src[t2.COERCEPLAIN]}(?:$|[^\\d])`);
    createToken("COERCEFULL", src[t2.COERCEPLAIN] + `(?:${src[t2.PRERELEASE]})?(?:${src[t2.BUILD]})?(?:$|[^\\d])`);
    createToken("COERCERTL", src[t2.COERCE], true);
    createToken("COERCERTLFULL", src[t2.COERCEFULL], true);
    createToken("LONETILDE", "(?:~>?)");
    createToken("TILDETRIM", `(\\s*)${src[t2.LONETILDE]}\\s+`, true);
    exports.tildeTrimReplace = "$1~";
    createToken("TILDE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAIN]}$`);
    createToken("TILDELOOSE", `^${src[t2.LONETILDE]}${src[t2.XRANGEPLAINLOOSE]}$`);
    createToken("LONECARET", "(?:\\^)");
    createToken("CARETTRIM", `(\\s*)${src[t2.LONECARET]}\\s+`, true);
    exports.caretTrimReplace = "$1^";
    createToken("CARET", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAIN]}$`);
    createToken("CARETLOOSE", `^${src[t2.LONECARET]}${src[t2.XRANGEPLAINLOOSE]}$`);
    createToken("COMPARATORLOOSE", `^${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]})$|^$`);
    createToken("COMPARATOR", `^${src[t2.GTLT]}\\s*(${src[t2.FULLPLAIN]})$|^$`);
    createToken("COMPARATORTRIM", `(\\s*)${src[t2.GTLT]}\\s*(${src[t2.LOOSEPLAIN]}|${src[t2.XRANGEPLAIN]})`, true);
    exports.comparatorTrimReplace = "$1$2$3";
    createToken("HYPHENRANGE", `^\\s*(${src[t2.XRANGEPLAIN]})\\s+-\\s+(${src[t2.XRANGEPLAIN]})\\s*$`);
    createToken("HYPHENRANGELOOSE", `^\\s*(${src[t2.XRANGEPLAINLOOSE]})\\s+-\\s+(${src[t2.XRANGEPLAINLOOSE]})\\s*$`);
    createToken("STAR", "(<|>)?=?\\s*\\*");
    createToken("GTE0", "^\\s*>=\\s*0\\.0\\.0\\s*$");
    createToken("GTE0PRE", "^\\s*>=\\s*0\\.0\\.0-0\\s*$");
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js
var require_parse_options = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/parse-options.js"(exports, module) {
    "use strict";
    var looseOption = Object.freeze({ loose: true });
    var emptyOpts = Object.freeze({});
    var parseOptions = (options) => {
      if (!options) {
        return emptyOpts;
      }
      if (typeof options !== "object") {
        return looseOption;
      }
      return options;
    };
    module.exports = parseOptions;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js
var require_identifiers = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/identifiers.js"(exports, module) {
    "use strict";
    var numeric = /^[0-9]+$/;
    var compareIdentifiers = (a2, b2) => {
      if (typeof a2 === "number" && typeof b2 === "number") {
        return a2 === b2 ? 0 : a2 < b2 ? -1 : 1;
      }
      const anum = numeric.test(a2);
      const bnum = numeric.test(b2);
      if (anum && bnum) {
        a2 = +a2;
        b2 = +b2;
      }
      return a2 === b2 ? 0 : anum && !bnum ? -1 : bnum && !anum ? 1 : a2 < b2 ? -1 : 1;
    };
    var rcompareIdentifiers = (a2, b2) => compareIdentifiers(b2, a2);
    module.exports = {
      compareIdentifiers,
      rcompareIdentifiers
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js
var require_semver = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/semver.js"(exports, module) {
    "use strict";
    var debug5 = require_debug();
    var { MAX_LENGTH, MAX_SAFE_INTEGER } = require_constants();
    var { safeRe: re, t: t2 } = require_re();
    var parseOptions = require_parse_options();
    var { compareIdentifiers } = require_identifiers();
    var SemVer = class _SemVer {
      constructor(version2, options) {
        options = parseOptions(options);
        if (version2 instanceof _SemVer) {
          if (version2.loose === !!options.loose && version2.includePrerelease === !!options.includePrerelease) {
            return version2;
          } else {
            version2 = version2.version;
          }
        } else if (typeof version2 !== "string") {
          throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version2}".`);
        }
        if (version2.length > MAX_LENGTH) {
          throw new TypeError(
            `version is longer than ${MAX_LENGTH} characters`
          );
        }
        debug5("SemVer", version2, options);
        this.options = options;
        this.loose = !!options.loose;
        this.includePrerelease = !!options.includePrerelease;
        const m2 = version2.trim().match(options.loose ? re[t2.LOOSE] : re[t2.FULL]);
        if (!m2) {
          throw new TypeError(`Invalid Version: ${version2}`);
        }
        this.raw = version2;
        this.major = +m2[1];
        this.minor = +m2[2];
        this.patch = +m2[3];
        if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
          throw new TypeError("Invalid major version");
        }
        if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
          throw new TypeError("Invalid minor version");
        }
        if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
          throw new TypeError("Invalid patch version");
        }
        if (!m2[4]) {
          this.prerelease = [];
        } else {
          this.prerelease = m2[4].split(".").map((id) => {
            if (/^[0-9]+$/.test(id)) {
              const num = +id;
              if (num >= 0 && num < MAX_SAFE_INTEGER) {
                return num;
              }
            }
            return id;
          });
        }
        this.build = m2[5] ? m2[5].split(".") : [];
        this.format();
      }
      format() {
        this.version = `${this.major}.${this.minor}.${this.patch}`;
        if (this.prerelease.length) {
          this.version += `-${this.prerelease.join(".")}`;
        }
        return this.version;
      }
      toString() {
        return this.version;
      }
      compare(other) {
        debug5("SemVer.compare", this.version, this.options, other);
        if (!(other instanceof _SemVer)) {
          if (typeof other === "string" && other === this.version) {
            return 0;
          }
          other = new _SemVer(other, this.options);
        }
        if (other.version === this.version) {
          return 0;
        }
        return this.compareMain(other) || this.comparePre(other);
      }
      compareMain(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        if (this.major < other.major) {
          return -1;
        }
        if (this.major > other.major) {
          return 1;
        }
        if (this.minor < other.minor) {
          return -1;
        }
        if (this.minor > other.minor) {
          return 1;
        }
        if (this.patch < other.patch) {
          return -1;
        }
        if (this.patch > other.patch) {
          return 1;
        }
        return 0;
      }
      comparePre(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        if (this.prerelease.length && !other.prerelease.length) {
          return -1;
        } else if (!this.prerelease.length && other.prerelease.length) {
          return 1;
        } else if (!this.prerelease.length && !other.prerelease.length) {
          return 0;
        }
        let i2 = 0;
        do {
          const a2 = this.prerelease[i2];
          const b2 = other.prerelease[i2];
          debug5("prerelease compare", i2, a2, b2);
          if (a2 === void 0 && b2 === void 0) {
            return 0;
          } else if (b2 === void 0) {
            return 1;
          } else if (a2 === void 0) {
            return -1;
          } else if (a2 === b2) {
            continue;
          } else {
            return compareIdentifiers(a2, b2);
          }
        } while (++i2);
      }
      compareBuild(other) {
        if (!(other instanceof _SemVer)) {
          other = new _SemVer(other, this.options);
        }
        let i2 = 0;
        do {
          const a2 = this.build[i2];
          const b2 = other.build[i2];
          debug5("build compare", i2, a2, b2);
          if (a2 === void 0 && b2 === void 0) {
            return 0;
          } else if (b2 === void 0) {
            return 1;
          } else if (a2 === void 0) {
            return -1;
          } else if (a2 === b2) {
            continue;
          } else {
            return compareIdentifiers(a2, b2);
          }
        } while (++i2);
      }
      // preminor will bump the version up to the next minor release, and immediately
      // down to pre-release. premajor and prepatch work the same way.
      inc(release, identifier, identifierBase) {
        if (release.startsWith("pre")) {
          if (!identifier && identifierBase === false) {
            throw new Error("invalid increment argument: identifier is empty");
          }
          if (identifier) {
            const match2 = `-${identifier}`.match(this.options.loose ? re[t2.PRERELEASELOOSE] : re[t2.PRERELEASE]);
            if (!match2 || match2[1] !== identifier) {
              throw new Error(`invalid identifier: ${identifier}`);
            }
          }
        }
        switch (release) {
          case "premajor":
            this.prerelease.length = 0;
            this.patch = 0;
            this.minor = 0;
            this.major++;
            this.inc("pre", identifier, identifierBase);
            break;
          case "preminor":
            this.prerelease.length = 0;
            this.patch = 0;
            this.minor++;
            this.inc("pre", identifier, identifierBase);
            break;
          case "prepatch":
            this.prerelease.length = 0;
            this.inc("patch", identifier, identifierBase);
            this.inc("pre", identifier, identifierBase);
            break;
          // If the input is a non-prerelease version, this acts the same as
          // prepatch.
          case "prerelease":
            if (this.prerelease.length === 0) {
              this.inc("patch", identifier, identifierBase);
            }
            this.inc("pre", identifier, identifierBase);
            break;
          case "release":
            if (this.prerelease.length === 0) {
              throw new Error(`version ${this.raw} is not a prerelease`);
            }
            this.prerelease.length = 0;
            break;
          case "major":
            if (this.minor !== 0 || this.patch !== 0 || this.prerelease.length === 0) {
              this.major++;
            }
            this.minor = 0;
            this.patch = 0;
            this.prerelease = [];
            break;
          case "minor":
            if (this.patch !== 0 || this.prerelease.length === 0) {
              this.minor++;
            }
            this.patch = 0;
            this.prerelease = [];
            break;
          case "patch":
            if (this.prerelease.length === 0) {
              this.patch++;
            }
            this.prerelease = [];
            break;
          // This probably shouldn't be used publicly.
          // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
          case "pre": {
            const base = Number(identifierBase) ? 1 : 0;
            if (this.prerelease.length === 0) {
              this.prerelease = [base];
            } else {
              let i2 = this.prerelease.length;
              while (--i2 >= 0) {
                if (typeof this.prerelease[i2] === "number") {
                  this.prerelease[i2]++;
                  i2 = -2;
                }
              }
              if (i2 === -1) {
                if (identifier === this.prerelease.join(".") && identifierBase === false) {
                  throw new Error("invalid increment argument: identifier already exists");
                }
                this.prerelease.push(base);
              }
            }
            if (identifier) {
              let prerelease = [identifier, base];
              if (identifierBase === false) {
                prerelease = [identifier];
              }
              if (compareIdentifiers(this.prerelease[0], identifier) === 0) {
                if (isNaN(this.prerelease[1])) {
                  this.prerelease = prerelease;
                }
              } else {
                this.prerelease = prerelease;
              }
            }
            break;
          }
          default:
            throw new Error(`invalid increment argument: ${release}`);
        }
        this.raw = this.format();
        if (this.build.length) {
          this.raw += `+${this.build.join(".")}`;
        }
        return this;
      }
    };
    module.exports = SemVer;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js
var require_parse = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/parse.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var parse = (version2, options, throwErrors = false) => {
      if (version2 instanceof SemVer) {
        return version2;
      }
      try {
        return new SemVer(version2, options);
      } catch (er) {
        if (!throwErrors) {
          return null;
        }
        throw er;
      }
    };
    module.exports = parse;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js
var require_valid = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/valid.js"(exports, module) {
    "use strict";
    var parse = require_parse();
    var valid = (version2, options) => {
      const v2 = parse(version2, options);
      return v2 ? v2.version : null;
    };
    module.exports = valid;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js
var require_clean = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/clean.js"(exports, module) {
    "use strict";
    var parse = require_parse();
    var clean = (version2, options) => {
      const s2 = parse(version2.trim().replace(/^[=v]+/, ""), options);
      return s2 ? s2.version : null;
    };
    module.exports = clean;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js
var require_inc = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/inc.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var inc = (version2, release, options, identifier, identifierBase) => {
      if (typeof options === "string") {
        identifierBase = identifier;
        identifier = options;
        options = void 0;
      }
      try {
        return new SemVer(
          version2 instanceof SemVer ? version2.version : version2,
          options
        ).inc(release, identifier, identifierBase).version;
      } catch (er) {
        return null;
      }
    };
    module.exports = inc;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js
var require_diff = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/diff.js"(exports, module) {
    "use strict";
    var parse = require_parse();
    var diff = (version1, version2) => {
      const v1 = parse(version1, null, true);
      const v2 = parse(version2, null, true);
      const comparison = v1.compare(v2);
      if (comparison === 0) {
        return null;
      }
      const v1Higher = comparison > 0;
      const highVersion = v1Higher ? v1 : v2;
      const lowVersion = v1Higher ? v2 : v1;
      const highHasPre = !!highVersion.prerelease.length;
      const lowHasPre = !!lowVersion.prerelease.length;
      if (lowHasPre && !highHasPre) {
        if (!lowVersion.patch && !lowVersion.minor) {
          return "major";
        }
        if (lowVersion.compareMain(highVersion) === 0) {
          if (lowVersion.minor && !lowVersion.patch) {
            return "minor";
          }
          return "patch";
        }
      }
      const prefix = highHasPre ? "pre" : "";
      if (v1.major !== v2.major) {
        return prefix + "major";
      }
      if (v1.minor !== v2.minor) {
        return prefix + "minor";
      }
      if (v1.patch !== v2.patch) {
        return prefix + "patch";
      }
      return "prerelease";
    };
    module.exports = diff;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js
var require_major = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/major.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var major = (a2, loose) => new SemVer(a2, loose).major;
    module.exports = major;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js
var require_minor = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/minor.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var minor = (a2, loose) => new SemVer(a2, loose).minor;
    module.exports = minor;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js
var require_patch = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/patch.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var patch = (a2, loose) => new SemVer(a2, loose).patch;
    module.exports = patch;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js
var require_prerelease = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/prerelease.js"(exports, module) {
    "use strict";
    var parse = require_parse();
    var prerelease = (version2, options) => {
      const parsed = parse(version2, options);
      return parsed && parsed.prerelease.length ? parsed.prerelease : null;
    };
    module.exports = prerelease;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js
var require_compare = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var compare = (a2, b2, loose) => new SemVer(a2, loose).compare(new SemVer(b2, loose));
    module.exports = compare;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js
var require_rcompare = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rcompare.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var rcompare = (a2, b2, loose) => compare(b2, a2, loose);
    module.exports = rcompare;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js
var require_compare_loose = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-loose.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var compareLoose = (a2, b2) => compare(a2, b2, true);
    module.exports = compareLoose;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js
var require_compare_build = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/compare-build.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var compareBuild = (a2, b2, loose) => {
      const versionA = new SemVer(a2, loose);
      const versionB = new SemVer(b2, loose);
      return versionA.compare(versionB) || versionA.compareBuild(versionB);
    };
    module.exports = compareBuild;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js
var require_sort = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/sort.js"(exports, module) {
    "use strict";
    var compareBuild = require_compare_build();
    var sort7 = (list, loose) => list.sort((a2, b2) => compareBuild(a2, b2, loose));
    module.exports = sort7;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js
var require_rsort = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/rsort.js"(exports, module) {
    "use strict";
    var compareBuild = require_compare_build();
    var rsort = (list, loose) => list.sort((a2, b2) => compareBuild(b2, a2, loose));
    module.exports = rsort;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js
var require_gt = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gt.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var gt = (a2, b2, loose) => compare(a2, b2, loose) > 0;
    module.exports = gt;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js
var require_lt = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lt.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var lt = (a2, b2, loose) => compare(a2, b2, loose) < 0;
    module.exports = lt;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js
var require_eq = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/eq.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var eq = (a2, b2, loose) => compare(a2, b2, loose) === 0;
    module.exports = eq;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js
var require_neq = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/neq.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var neq = (a2, b2, loose) => compare(a2, b2, loose) !== 0;
    module.exports = neq;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js
var require_gte = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/gte.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var gte = (a2, b2, loose) => compare(a2, b2, loose) >= 0;
    module.exports = gte;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js
var require_lte = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/lte.js"(exports, module) {
    "use strict";
    var compare = require_compare();
    var lte = (a2, b2, loose) => compare(a2, b2, loose) <= 0;
    module.exports = lte;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js
var require_cmp = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/cmp.js"(exports, module) {
    "use strict";
    var eq = require_eq();
    var neq = require_neq();
    var gt = require_gt();
    var gte = require_gte();
    var lt = require_lt();
    var lte = require_lte();
    var cmp = (a2, op, b2, loose) => {
      switch (op) {
        case "===":
          if (typeof a2 === "object") {
            a2 = a2.version;
          }
          if (typeof b2 === "object") {
            b2 = b2.version;
          }
          return a2 === b2;
        case "!==":
          if (typeof a2 === "object") {
            a2 = a2.version;
          }
          if (typeof b2 === "object") {
            b2 = b2.version;
          }
          return a2 !== b2;
        case "":
        case "=":
        case "==":
          return eq(a2, b2, loose);
        case "!=":
          return neq(a2, b2, loose);
        case ">":
          return gt(a2, b2, loose);
        case ">=":
          return gte(a2, b2, loose);
        case "<":
          return lt(a2, b2, loose);
        case "<=":
          return lte(a2, b2, loose);
        default:
          throw new TypeError(`Invalid operator: ${op}`);
      }
    };
    module.exports = cmp;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js
var require_coerce = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/coerce.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var parse = require_parse();
    var { safeRe: re, t: t2 } = require_re();
    var coerce = (version2, options) => {
      if (version2 instanceof SemVer) {
        return version2;
      }
      if (typeof version2 === "number") {
        version2 = String(version2);
      }
      if (typeof version2 !== "string") {
        return null;
      }
      options = options || {};
      let match2 = null;
      if (!options.rtl) {
        match2 = version2.match(options.includePrerelease ? re[t2.COERCEFULL] : re[t2.COERCE]);
      } else {
        const coerceRtlRegex = options.includePrerelease ? re[t2.COERCERTLFULL] : re[t2.COERCERTL];
        let next;
        while ((next = coerceRtlRegex.exec(version2)) && (!match2 || match2.index + match2[0].length !== version2.length)) {
          if (!match2 || next.index + next[0].length !== match2.index + match2[0].length) {
            match2 = next;
          }
          coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length;
        }
        coerceRtlRegex.lastIndex = -1;
      }
      if (match2 === null) {
        return null;
      }
      const major = match2[2];
      const minor = match2[3] || "0";
      const patch = match2[4] || "0";
      const prerelease = options.includePrerelease && match2[5] ? `-${match2[5]}` : "";
      const build = options.includePrerelease && match2[6] ? `+${match2[6]}` : "";
      return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options);
    };
    module.exports = coerce;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js
var require_lrucache = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/internal/lrucache.js"(exports, module) {
    "use strict";
    var LRUCache = class {
      constructor() {
        this.max = 1e3;
        this.map = /* @__PURE__ */ new Map();
      }
      get(key) {
        const value = this.map.get(key);
        if (value === void 0) {
          return void 0;
        } else {
          this.map.delete(key);
          this.map.set(key, value);
          return value;
        }
      }
      delete(key) {
        return this.map.delete(key);
      }
      set(key, value) {
        const deleted = this.delete(key);
        if (!deleted && value !== void 0) {
          if (this.map.size >= this.max) {
            const firstKey = this.map.keys().next().value;
            this.delete(firstKey);
          }
          this.map.set(key, value);
        }
        return this;
      }
    };
    module.exports = LRUCache;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js
var require_range = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/range.js"(exports, module) {
    "use strict";
    var SPACE_CHARACTERS = /\s+/g;
    var Range = class _Range {
      constructor(range, options) {
        options = parseOptions(options);
        if (range instanceof _Range) {
          if (range.loose === !!options.loose && range.includePrerelease === !!options.includePrerelease) {
            return range;
          } else {
            return new _Range(range.raw, options);
          }
        }
        if (range instanceof Comparator) {
          this.raw = range.value;
          this.set = [[range]];
          this.formatted = void 0;
          return this;
        }
        this.options = options;
        this.loose = !!options.loose;
        this.includePrerelease = !!options.includePrerelease;
        this.raw = range.trim().replace(SPACE_CHARACTERS, " ");
        this.set = this.raw.split("||").map((r3) => this.parseRange(r3.trim())).filter((c2) => c2.length);
        if (!this.set.length) {
          throw new TypeError(`Invalid SemVer Range: ${this.raw}`);
        }
        if (this.set.length > 1) {
          const first = this.set[0];
          this.set = this.set.filter((c2) => !isNullSet(c2[0]));
          if (this.set.length === 0) {
            this.set = [first];
          } else if (this.set.length > 1) {
            for (const c2 of this.set) {
              if (c2.length === 1 && isAny(c2[0])) {
                this.set = [c2];
                break;
              }
            }
          }
        }
        this.formatted = void 0;
      }
      get range() {
        if (this.formatted === void 0) {
          this.formatted = "";
          for (let i2 = 0; i2 < this.set.length; i2++) {
            if (i2 > 0) {
              this.formatted += "||";
            }
            const comps = this.set[i2];
            for (let k = 0; k < comps.length; k++) {
              if (k > 0) {
                this.formatted += " ";
              }
              this.formatted += comps[k].toString().trim();
            }
          }
        }
        return this.formatted;
      }
      format() {
        return this.range;
      }
      toString() {
        return this.range;
      }
      parseRange(range) {
        const memoOpts = (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) | (this.options.loose && FLAG_LOOSE);
        const memoKey = memoOpts + ":" + range;
        const cached = cache.get(memoKey);
        if (cached) {
          return cached;
        }
        const loose = this.options.loose;
        const hr = loose ? re[t2.HYPHENRANGELOOSE] : re[t2.HYPHENRANGE];
        range = range.replace(hr, hyphenReplace(this.options.includePrerelease));
        debug5("hyphen replace", range);
        range = range.replace(re[t2.COMPARATORTRIM], comparatorTrimReplace);
        debug5("comparator trim", range);
        range = range.replace(re[t2.TILDETRIM], tildeTrimReplace);
        debug5("tilde trim", range);
        range = range.replace(re[t2.CARETTRIM], caretTrimReplace);
        debug5("caret trim", range);
        let rangeList = range.split(" ").map((comp) => parseComparator(comp, this.options)).join(" ").split(/\s+/).map((comp) => replaceGTE0(comp, this.options));
        if (loose) {
          rangeList = rangeList.filter((comp) => {
            debug5("loose invalid filter", comp, this.options);
            return !!comp.match(re[t2.COMPARATORLOOSE]);
          });
        }
        debug5("range list", rangeList);
        const rangeMap = /* @__PURE__ */ new Map();
        const comparators = rangeList.map((comp) => new Comparator(comp, this.options));
        for (const comp of comparators) {
          if (isNullSet(comp)) {
            return [comp];
          }
          rangeMap.set(comp.value, comp);
        }
        if (rangeMap.size > 1 && rangeMap.has("")) {
          rangeMap.delete("");
        }
        const result = [...rangeMap.values()];
        cache.set(memoKey, result);
        return result;
      }
      intersects(range, options) {
        if (!(range instanceof _Range)) {
          throw new TypeError("a Range is required");
        }
        return this.set.some((thisComparators) => {
          return isSatisfiable(thisComparators, options) && range.set.some((rangeComparators) => {
            return isSatisfiable(rangeComparators, options) && thisComparators.every((thisComparator) => {
              return rangeComparators.every((rangeComparator) => {
                return thisComparator.intersects(rangeComparator, options);
              });
            });
          });
        });
      }
      // if ANY of the sets match ALL of its comparators, then pass
      test(version2) {
        if (!version2) {
          return false;
        }
        if (typeof version2 === "string") {
          try {
            version2 = new SemVer(version2, this.options);
          } catch (er) {
            return false;
          }
        }
        for (let i2 = 0; i2 < this.set.length; i2++) {
          if (testSet(this.set[i2], version2, this.options)) {
            return true;
          }
        }
        return false;
      }
    };
    module.exports = Range;
    var LRU = require_lrucache();
    var cache = new LRU();
    var parseOptions = require_parse_options();
    var Comparator = require_comparator();
    var debug5 = require_debug();
    var SemVer = require_semver();
    var {
      safeRe: re,
      t: t2,
      comparatorTrimReplace,
      tildeTrimReplace,
      caretTrimReplace
    } = require_re();
    var { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require_constants();
    var isNullSet = (c2) => c2.value === "<0.0.0-0";
    var isAny = (c2) => c2.value === "";
    var isSatisfiable = (comparators, options) => {
      let result = true;
      const remainingComparators = comparators.slice();
      let testComparator = remainingComparators.pop();
      while (result && remainingComparators.length) {
        result = remainingComparators.every((otherComparator) => {
          return testComparator.intersects(otherComparator, options);
        });
        testComparator = remainingComparators.pop();
      }
      return result;
    };
    var parseComparator = (comp, options) => {
      comp = comp.replace(re[t2.BUILD], "");
      debug5("comp", comp, options);
      comp = replaceCarets(comp, options);
      debug5("caret", comp);
      comp = replaceTildes(comp, options);
      debug5("tildes", comp);
      comp = replaceXRanges(comp, options);
      debug5("xrange", comp);
      comp = replaceStars(comp, options);
      debug5("stars", comp);
      return comp;
    };
    var isX = (id) => !id || id.toLowerCase() === "x" || id === "*";
    var replaceTildes = (comp, options) => {
      return comp.trim().split(/\s+/).map((c2) => replaceTilde(c2, options)).join(" ");
    };
    var replaceTilde = (comp, options) => {
      const r3 = options.loose ? re[t2.TILDELOOSE] : re[t2.TILDE];
      return comp.replace(r3, (_, M2, m2, p2, pr) => {
        debug5("tilde", comp, _, M2, m2, p2, pr);
        let ret;
        if (isX(M2)) {
          ret = "";
        } else if (isX(m2)) {
          ret = `>=${M2}.0.0 <${+M2 + 1}.0.0-0`;
        } else if (isX(p2)) {
          ret = `>=${M2}.${m2}.0 <${M2}.${+m2 + 1}.0-0`;
        } else if (pr) {
          debug5("replaceTilde pr", pr);
          ret = `>=${M2}.${m2}.${p2}-${pr} <${M2}.${+m2 + 1}.0-0`;
        } else {
          ret = `>=${M2}.${m2}.${p2} <${M2}.${+m2 + 1}.0-0`;
        }
        debug5("tilde return", ret);
        return ret;
      });
    };
    var replaceCarets = (comp, options) => {
      return comp.trim().split(/\s+/).map((c2) => replaceCaret(c2, options)).join(" ");
    };
    var replaceCaret = (comp, options) => {
      debug5("caret", comp, options);
      const r3 = options.loose ? re[t2.CARETLOOSE] : re[t2.CARET];
      const z = options.includePrerelease ? "-0" : "";
      return comp.replace(r3, (_, M2, m2, p2, pr) => {
        debug5("caret", comp, _, M2, m2, p2, pr);
        let ret;
        if (isX(M2)) {
          ret = "";
        } else if (isX(m2)) {
          ret = `>=${M2}.0.0${z} <${+M2 + 1}.0.0-0`;
        } else if (isX(p2)) {
          if (M2 === "0") {
            ret = `>=${M2}.${m2}.0${z} <${M2}.${+m2 + 1}.0-0`;
          } else {
            ret = `>=${M2}.${m2}.0${z} <${+M2 + 1}.0.0-0`;
          }
        } else if (pr) {
          debug5("replaceCaret pr", pr);
          if (M2 === "0") {
            if (m2 === "0") {
              ret = `>=${M2}.${m2}.${p2}-${pr} <${M2}.${m2}.${+p2 + 1}-0`;
            } else {
              ret = `>=${M2}.${m2}.${p2}-${pr} <${M2}.${+m2 + 1}.0-0`;
            }
          } else {
            ret = `>=${M2}.${m2}.${p2}-${pr} <${+M2 + 1}.0.0-0`;
          }
        } else {
          debug5("no pr");
          if (M2 === "0") {
            if (m2 === "0") {
              ret = `>=${M2}.${m2}.${p2}${z} <${M2}.${m2}.${+p2 + 1}-0`;
            } else {
              ret = `>=${M2}.${m2}.${p2}${z} <${M2}.${+m2 + 1}.0-0`;
            }
          } else {
            ret = `>=${M2}.${m2}.${p2} <${+M2 + 1}.0.0-0`;
          }
        }
        debug5("caret return", ret);
        return ret;
      });
    };
    var replaceXRanges = (comp, options) => {
      debug5("replaceXRanges", comp, options);
      return comp.split(/\s+/).map((c2) => replaceXRange(c2, options)).join(" ");
    };
    var replaceXRange = (comp, options) => {
      comp = comp.trim();
      const r3 = options.loose ? re[t2.XRANGELOOSE] : re[t2.XRANGE];
      return comp.replace(r3, (ret, gtlt, M2, m2, p2, pr) => {
        debug5("xRange", comp, ret, gtlt, M2, m2, p2, pr);
        const xM = isX(M2);
        const xm = xM || isX(m2);
        const xp = xm || isX(p2);
        const anyX = xp;
        if (gtlt === "=" && anyX) {
          gtlt = "";
        }
        pr = options.includePrerelease ? "-0" : "";
        if (xM) {
          if (gtlt === ">" || gtlt === "<") {
            ret = "<0.0.0-0";
          } else {
            ret = "*";
          }
        } else if (gtlt && anyX) {
          if (xm) {
            m2 = 0;
          }
          p2 = 0;
          if (gtlt === ">") {
            gtlt = ">=";
            if (xm) {
              M2 = +M2 + 1;
              m2 = 0;
              p2 = 0;
            } else {
              m2 = +m2 + 1;
              p2 = 0;
            }
          } else if (gtlt === "<=") {
            gtlt = "<";
            if (xm) {
              M2 = +M2 + 1;
            } else {
              m2 = +m2 + 1;
            }
          }
          if (gtlt === "<") {
            pr = "-0";
          }
          ret = `${gtlt + M2}.${m2}.${p2}${pr}`;
        } else if (xm) {
          ret = `>=${M2}.0.0${pr} <${+M2 + 1}.0.0-0`;
        } else if (xp) {
          ret = `>=${M2}.${m2}.0${pr} <${M2}.${+m2 + 1}.0-0`;
        }
        debug5("xRange return", ret);
        return ret;
      });
    };
    var replaceStars = (comp, options) => {
      debug5("replaceStars", comp, options);
      return comp.trim().replace(re[t2.STAR], "");
    };
    var replaceGTE0 = (comp, options) => {
      debug5("replaceGTE0", comp, options);
      return comp.trim().replace(re[options.includePrerelease ? t2.GTE0PRE : t2.GTE0], "");
    };
    var hyphenReplace = (incPr) => ($0, from, fM, fm, fp, fpr, fb, to, tM, tm, tp, tpr) => {
      if (isX(fM)) {
        from = "";
      } else if (isX(fm)) {
        from = `>=${fM}.0.0${incPr ? "-0" : ""}`;
      } else if (isX(fp)) {
        from = `>=${fM}.${fm}.0${incPr ? "-0" : ""}`;
      } else if (fpr) {
        from = `>=${from}`;
      } else {
        from = `>=${from}${incPr ? "-0" : ""}`;
      }
      if (isX(tM)) {
        to = "";
      } else if (isX(tm)) {
        to = `<${+tM + 1}.0.0-0`;
      } else if (isX(tp)) {
        to = `<${tM}.${+tm + 1}.0-0`;
      } else if (tpr) {
        to = `<=${tM}.${tm}.${tp}-${tpr}`;
      } else if (incPr) {
        to = `<${tM}.${tm}.${+tp + 1}-0`;
      } else {
        to = `<=${to}`;
      }
      return `${from} ${to}`.trim();
    };
    var testSet = (set3, version2, options) => {
      for (let i2 = 0; i2 < set3.length; i2++) {
        if (!set3[i2].test(version2)) {
          return false;
        }
      }
      if (version2.prerelease.length && !options.includePrerelease) {
        for (let i2 = 0; i2 < set3.length; i2++) {
          debug5(set3[i2].semver);
          if (set3[i2].semver === Comparator.ANY) {
            continue;
          }
          if (set3[i2].semver.prerelease.length > 0) {
            const allowed = set3[i2].semver;
            if (allowed.major === version2.major && allowed.minor === version2.minor && allowed.patch === version2.patch) {
              return true;
            }
          }
        }
        return false;
      }
      return true;
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js
var require_comparator = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/classes/comparator.js"(exports, module) {
    "use strict";
    var ANY = /* @__PURE__ */ Symbol("SemVer ANY");
    var Comparator = class _Comparator {
      static get ANY() {
        return ANY;
      }
      constructor(comp, options) {
        options = parseOptions(options);
        if (comp instanceof _Comparator) {
          if (comp.loose === !!options.loose) {
            return comp;
          } else {
            comp = comp.value;
          }
        }
        comp = comp.trim().split(/\s+/).join(" ");
        debug5("comparator", comp, options);
        this.options = options;
        this.loose = !!options.loose;
        this.parse(comp);
        if (this.semver === ANY) {
          this.value = "";
        } else {
          this.value = this.operator + this.semver.version;
        }
        debug5("comp", this);
      }
      parse(comp) {
        const r3 = this.options.loose ? re[t2.COMPARATORLOOSE] : re[t2.COMPARATOR];
        const m2 = comp.match(r3);
        if (!m2) {
          throw new TypeError(`Invalid comparator: ${comp}`);
        }
        this.operator = m2[1] !== void 0 ? m2[1] : "";
        if (this.operator === "=") {
          this.operator = "";
        }
        if (!m2[2]) {
          this.semver = ANY;
        } else {
          this.semver = new SemVer(m2[2], this.options.loose);
        }
      }
      toString() {
        return this.value;
      }
      test(version2) {
        debug5("Comparator.test", version2, this.options.loose);
        if (this.semver === ANY || version2 === ANY) {
          return true;
        }
        if (typeof version2 === "string") {
          try {
            version2 = new SemVer(version2, this.options);
          } catch (er) {
            return false;
          }
        }
        return cmp(version2, this.operator, this.semver, this.options);
      }
      intersects(comp, options) {
        if (!(comp instanceof _Comparator)) {
          throw new TypeError("a Comparator is required");
        }
        if (this.operator === "") {
          if (this.value === "") {
            return true;
          }
          return new Range(comp.value, options).test(this.value);
        } else if (comp.operator === "") {
          if (comp.value === "") {
            return true;
          }
          return new Range(this.value, options).test(comp.semver);
        }
        options = parseOptions(options);
        if (options.includePrerelease && (this.value === "<0.0.0-0" || comp.value === "<0.0.0-0")) {
          return false;
        }
        if (!options.includePrerelease && (this.value.startsWith("<0.0.0") || comp.value.startsWith("<0.0.0"))) {
          return false;
        }
        if (this.operator.startsWith(">") && comp.operator.startsWith(">")) {
          return true;
        }
        if (this.operator.startsWith("<") && comp.operator.startsWith("<")) {
          return true;
        }
        if (this.semver.version === comp.semver.version && this.operator.includes("=") && comp.operator.includes("=")) {
          return true;
        }
        if (cmp(this.semver, "<", comp.semver, options) && this.operator.startsWith(">") && comp.operator.startsWith("<")) {
          return true;
        }
        if (cmp(this.semver, ">", comp.semver, options) && this.operator.startsWith("<") && comp.operator.startsWith(">")) {
          return true;
        }
        return false;
      }
    };
    module.exports = Comparator;
    var parseOptions = require_parse_options();
    var { safeRe: re, t: t2 } = require_re();
    var cmp = require_cmp();
    var debug5 = require_debug();
    var SemVer = require_semver();
    var Range = require_range();
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js
var require_satisfies = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/functions/satisfies.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var satisfies = (version2, range, options) => {
      try {
        range = new Range(range, options);
      } catch (er) {
        return false;
      }
      return range.test(version2);
    };
    module.exports = satisfies;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js
var require_to_comparators = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/to-comparators.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var toComparators = (range, options) => new Range(range, options).set.map((comp) => comp.map((c2) => c2.value).join(" ").trim().split(" "));
    module.exports = toComparators;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js
var require_max_satisfying = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/max-satisfying.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Range = require_range();
    var maxSatisfying = (versions, range, options) => {
      let max = null;
      let maxSV = null;
      let rangeObj = null;
      try {
        rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach((v2) => {
        if (rangeObj.test(v2)) {
          if (!max || maxSV.compare(v2) === -1) {
            max = v2;
            maxSV = new SemVer(max, options);
          }
        }
      });
      return max;
    };
    module.exports = maxSatisfying;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js
var require_min_satisfying = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-satisfying.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Range = require_range();
    var minSatisfying = (versions, range, options) => {
      let min = null;
      let minSV = null;
      let rangeObj = null;
      try {
        rangeObj = new Range(range, options);
      } catch (er) {
        return null;
      }
      versions.forEach((v2) => {
        if (rangeObj.test(v2)) {
          if (!min || minSV.compare(v2) === 1) {
            min = v2;
            minSV = new SemVer(min, options);
          }
        }
      });
      return min;
    };
    module.exports = minSatisfying;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js
var require_min_version = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/min-version.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Range = require_range();
    var gt = require_gt();
    var minVersion = (range, loose) => {
      range = new Range(range, loose);
      let minver = new SemVer("0.0.0");
      if (range.test(minver)) {
        return minver;
      }
      minver = new SemVer("0.0.0-0");
      if (range.test(minver)) {
        return minver;
      }
      minver = null;
      for (let i2 = 0; i2 < range.set.length; ++i2) {
        const comparators = range.set[i2];
        let setMin = null;
        comparators.forEach((comparator) => {
          const compver = new SemVer(comparator.semver.version);
          switch (comparator.operator) {
            case ">":
              if (compver.prerelease.length === 0) {
                compver.patch++;
              } else {
                compver.prerelease.push(0);
              }
              compver.raw = compver.format();
            /* fallthrough */
            case "":
            case ">=":
              if (!setMin || gt(compver, setMin)) {
                setMin = compver;
              }
              break;
            case "<":
            case "<=":
              break;
            /* istanbul ignore next */
            default:
              throw new Error(`Unexpected operation: ${comparator.operator}`);
          }
        });
        if (setMin && (!minver || gt(minver, setMin))) {
          minver = setMin;
        }
      }
      if (minver && range.test(minver)) {
        return minver;
      }
      return null;
    };
    module.exports = minVersion;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js
var require_valid2 = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/valid.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var validRange = (range, options) => {
      try {
        return new Range(range, options).range || "*";
      } catch (er) {
        return null;
      }
    };
    module.exports = validRange;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js
var require_outside = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/outside.js"(exports, module) {
    "use strict";
    var SemVer = require_semver();
    var Comparator = require_comparator();
    var { ANY } = Comparator;
    var Range = require_range();
    var satisfies = require_satisfies();
    var gt = require_gt();
    var lt = require_lt();
    var lte = require_lte();
    var gte = require_gte();
    var outside = (version2, range, hilo, options) => {
      version2 = new SemVer(version2, options);
      range = new Range(range, options);
      let gtfn, ltefn, ltfn, comp, ecomp;
      switch (hilo) {
        case ">":
          gtfn = gt;
          ltefn = lte;
          ltfn = lt;
          comp = ">";
          ecomp = ">=";
          break;
        case "<":
          gtfn = lt;
          ltefn = gte;
          ltfn = gt;
          comp = "<";
          ecomp = "<=";
          break;
        default:
          throw new TypeError('Must provide a hilo val of "<" or ">"');
      }
      if (satisfies(version2, range, options)) {
        return false;
      }
      for (let i2 = 0; i2 < range.set.length; ++i2) {
        const comparators = range.set[i2];
        let high = null;
        let low = null;
        comparators.forEach((comparator) => {
          if (comparator.semver === ANY) {
            comparator = new Comparator(">=0.0.0");
          }
          high = high || comparator;
          low = low || comparator;
          if (gtfn(comparator.semver, high.semver, options)) {
            high = comparator;
          } else if (ltfn(comparator.semver, low.semver, options)) {
            low = comparator;
          }
        });
        if (high.operator === comp || high.operator === ecomp) {
          return false;
        }
        if ((!low.operator || low.operator === comp) && ltefn(version2, low.semver)) {
          return false;
        } else if (low.operator === ecomp && ltfn(version2, low.semver)) {
          return false;
        }
      }
      return true;
    };
    module.exports = outside;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js
var require_gtr = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/gtr.js"(exports, module) {
    "use strict";
    var outside = require_outside();
    var gtr = (version2, range, options) => outside(version2, range, ">", options);
    module.exports = gtr;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js
var require_ltr = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/ltr.js"(exports, module) {
    "use strict";
    var outside = require_outside();
    var ltr = (version2, range, options) => outside(version2, range, "<", options);
    module.exports = ltr;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js
var require_intersects = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/intersects.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var intersects = (r1, r22, options) => {
      r1 = new Range(r1, options);
      r22 = new Range(r22, options);
      return r1.intersects(r22, options);
    };
    module.exports = intersects;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js
var require_simplify = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/simplify.js"(exports, module) {
    "use strict";
    var satisfies = require_satisfies();
    var compare = require_compare();
    module.exports = (versions, range, options) => {
      const set3 = [];
      let first = null;
      let prev = null;
      const v2 = versions.sort((a2, b2) => compare(a2, b2, options));
      for (const version2 of v2) {
        const included = satisfies(version2, range, options);
        if (included) {
          prev = version2;
          if (!first) {
            first = version2;
          }
        } else {
          if (prev) {
            set3.push([first, prev]);
          }
          prev = null;
          first = null;
        }
      }
      if (first) {
        set3.push([first, null]);
      }
      const ranges = [];
      for (const [min, max] of set3) {
        if (min === max) {
          ranges.push(min);
        } else if (!max && min === v2[0]) {
          ranges.push("*");
        } else if (!max) {
          ranges.push(`>=${min}`);
        } else if (min === v2[0]) {
          ranges.push(`<=${max}`);
        } else {
          ranges.push(`${min} - ${max}`);
        }
      }
      const simplified = ranges.join(" || ");
      const original = typeof range.raw === "string" ? range.raw : String(range);
      return simplified.length < original.length ? simplified : range;
    };
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js
var require_subset = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/ranges/subset.js"(exports, module) {
    "use strict";
    var Range = require_range();
    var Comparator = require_comparator();
    var { ANY } = Comparator;
    var satisfies = require_satisfies();
    var compare = require_compare();
    var subset = (sub, dom, options = {}) => {
      if (sub === dom) {
        return true;
      }
      sub = new Range(sub, options);
      dom = new Range(dom, options);
      let sawNonNull = false;
      OUTER: for (const simpleSub of sub.set) {
        for (const simpleDom of dom.set) {
          const isSub = simpleSubset(simpleSub, simpleDom, options);
          sawNonNull = sawNonNull || isSub !== null;
          if (isSub) {
            continue OUTER;
          }
        }
        if (sawNonNull) {
          return false;
        }
      }
      return true;
    };
    var minimumVersionWithPreRelease = [new Comparator(">=0.0.0-0")];
    var minimumVersion = [new Comparator(">=0.0.0")];
    var simpleSubset = (sub, dom, options) => {
      if (sub === dom) {
        return true;
      }
      if (sub.length === 1 && sub[0].semver === ANY) {
        if (dom.length === 1 && dom[0].semver === ANY) {
          return true;
        } else if (options.includePrerelease) {
          sub = minimumVersionWithPreRelease;
        } else {
          sub = minimumVersion;
        }
      }
      if (dom.length === 1 && dom[0].semver === ANY) {
        if (options.includePrerelease) {
          return true;
        } else {
          dom = minimumVersion;
        }
      }
      const eqSet = /* @__PURE__ */ new Set();
      let gt, lt;
      for (const c2 of sub) {
        if (c2.operator === ">" || c2.operator === ">=") {
          gt = higherGT(gt, c2, options);
        } else if (c2.operator === "<" || c2.operator === "<=") {
          lt = lowerLT(lt, c2, options);
        } else {
          eqSet.add(c2.semver);
        }
      }
      if (eqSet.size > 1) {
        return null;
      }
      let gtltComp;
      if (gt && lt) {
        gtltComp = compare(gt.semver, lt.semver, options);
        if (gtltComp > 0) {
          return null;
        } else if (gtltComp === 0 && (gt.operator !== ">=" || lt.operator !== "<=")) {
          return null;
        }
      }
      for (const eq of eqSet) {
        if (gt && !satisfies(eq, String(gt), options)) {
          return null;
        }
        if (lt && !satisfies(eq, String(lt), options)) {
          return null;
        }
        for (const c2 of dom) {
          if (!satisfies(eq, String(c2), options)) {
            return false;
          }
        }
        return true;
      }
      let higher, lower;
      let hasDomLT, hasDomGT;
      let needDomLTPre = lt && !options.includePrerelease && lt.semver.prerelease.length ? lt.semver : false;
      let needDomGTPre = gt && !options.includePrerelease && gt.semver.prerelease.length ? gt.semver : false;
      if (needDomLTPre && needDomLTPre.prerelease.length === 1 && lt.operator === "<" && needDomLTPre.prerelease[0] === 0) {
        needDomLTPre = false;
      }
      for (const c2 of dom) {
        hasDomGT = hasDomGT || c2.operator === ">" || c2.operator === ">=";
        hasDomLT = hasDomLT || c2.operator === "<" || c2.operator === "<=";
        if (gt) {
          if (needDomGTPre) {
            if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomGTPre.major && c2.semver.minor === needDomGTPre.minor && c2.semver.patch === needDomGTPre.patch) {
              needDomGTPre = false;
            }
          }
          if (c2.operator === ">" || c2.operator === ">=") {
            higher = higherGT(gt, c2, options);
            if (higher === c2 && higher !== gt) {
              return false;
            }
          } else if (gt.operator === ">=" && !satisfies(gt.semver, String(c2), options)) {
            return false;
          }
        }
        if (lt) {
          if (needDomLTPre) {
            if (c2.semver.prerelease && c2.semver.prerelease.length && c2.semver.major === needDomLTPre.major && c2.semver.minor === needDomLTPre.minor && c2.semver.patch === needDomLTPre.patch) {
              needDomLTPre = false;
            }
          }
          if (c2.operator === "<" || c2.operator === "<=") {
            lower = lowerLT(lt, c2, options);
            if (lower === c2 && lower !== lt) {
              return false;
            }
          } else if (lt.operator === "<=" && !satisfies(lt.semver, String(c2), options)) {
            return false;
          }
        }
        if (!c2.operator && (lt || gt) && gtltComp !== 0) {
          return false;
        }
      }
      if (gt && hasDomLT && !lt && gtltComp !== 0) {
        return false;
      }
      if (lt && hasDomGT && !gt && gtltComp !== 0) {
        return false;
      }
      if (needDomGTPre || needDomLTPre) {
        return false;
      }
      return true;
    };
    var higherGT = (a2, b2, options) => {
      if (!a2) {
        return b2;
      }
      const comp = compare(a2.semver, b2.semver, options);
      return comp > 0 ? a2 : comp < 0 ? b2 : b2.operator === ">" && a2.operator === ">=" ? b2 : a2;
    };
    var lowerLT = (a2, b2, options) => {
      if (!a2) {
        return b2;
      }
      const comp = compare(a2.semver, b2.semver, options);
      return comp < 0 ? a2 : comp > 0 ? b2 : b2.operator === "<" && a2.operator === "<=" ? b2 : a2;
    };
    module.exports = subset;
  }
});

// ../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js
var require_semver2 = __commonJS({
  "../../../node_modules/.pnpm/semver@7.7.3/node_modules/semver/index.js"(exports, module) {
    "use strict";
    var internalRe = require_re();
    var constants = require_constants();
    var SemVer = require_semver();
    var identifiers = require_identifiers();
    var parse = require_parse();
    var valid = require_valid();
    var clean = require_clean();
    var inc = require_inc();
    var diff = require_diff();
    var major = require_major();
    var minor = require_minor();
    var patch = require_patch();
    var prerelease = require_prerelease();
    var compare = require_compare();
    var rcompare = require_rcompare();
    var compareLoose = require_compare_loose();
    var compareBuild = require_compare_build();
    var sort7 = require_sort();
    var rsort = require_rsort();
    var gt = require_gt();
    var lt = require_lt();
    var eq = require_eq();
    var neq = require_neq();
    var gte = require_gte();
    var lte = require_lte();
    var cmp = require_cmp();
    var coerce = require_coerce();
    var Comparator = require_comparator();
    var Range = require_range();
    var satisfies = require_satisfies();
    var toComparators = require_to_comparators();
    var maxSatisfying = require_max_satisfying();
    var minSatisfying = require_min_satisfying();
    var minVersion = require_min_version();
    var validRange = require_valid2();
    var outside = require_outside();
    var gtr = require_gtr();
    var ltr = require_ltr();
    var intersects = require_intersects();
    var simplifyRange = require_simplify();
    var subset = require_subset();
    module.exports = {
      parse,
      valid,
      clean,
      inc,
      diff,
      major,
      minor,
      patch,
      prerelease,
      compare,
      rcompare,
      compareLoose,
      compareBuild,
      sort: sort7,
      rsort,
      gt,
      lt,
      eq,
      neq,
      gte,
      lte,
      cmp,
      coerce,
      Comparator,
      Range,
      satisfies,
      toComparators,
      maxSatisfying,
      minSatisfying,
      minVersion,
      validRange,
      outside,
      gtr,
      ltr,
      intersects,
      simplifyRange,
      subset,
      SemVer,
      re: internalRe.re,
      src: internalRe.src,
      tokens: internalRe.t,
      SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
      RELEASE_TYPES: constants.RELEASE_TYPES,
      compareIdentifiers: identifiers.compareIdentifiers,
      rcompareIdentifiers: identifiers.rcompareIdentifiers
    };
  }
});

// ../../../node_modules/.pnpm/gridicons@3.4.2_react@18.3.1/node_modules/gridicons/dist/notice-outline.js
var require_notice_outline = __commonJS({
  "../../../node_modules/.pnpm/gridicons@3.4.2_react@18.3.1/node_modules/gridicons/dist/notice-outline.js"(exports) {
    "use strict";
    Object.defineProperty(exports, "__esModule", { value: true }), exports["default"] = _default;
    var _react = _interopRequireDefault(require_react());
    var _excluded = ["size", "onClick", "icon", "className"];
    function _interopRequireDefault(a2) {
      return a2 && a2.__esModule ? a2 : { default: a2 };
    }
    function _extends() {
      return _extends = Object.assign ? Object.assign.bind() : function(a2) {
        for (var b2, c2 = 1; c2 < arguments.length; c2++) for (var d2 in b2 = arguments[c2], b2) Object.prototype.hasOwnProperty.call(b2, d2) && (a2[d2] = b2[d2]);
        return a2;
      }, _extends.apply(this, arguments);
    }
    function _objectWithoutProperties(a2, b2) {
      if (null == a2) return {};
      var c2, d2, e2 = _objectWithoutPropertiesLoose(a2, b2);
      if (Object.getOwnPropertySymbols) {
        var f2 = Object.getOwnPropertySymbols(a2);
        for (d2 = 0; d2 < f2.length; d2++) c2 = f2[d2], 0 <= b2.indexOf(c2) || Object.prototype.propertyIsEnumerable.call(a2, c2) && (e2[c2] = a2[c2]);
      }
      return e2;
    }
    function _objectWithoutPropertiesLoose(a2, b2) {
      if (null == a2) return {};
      var c2, d2, e2 = {}, f2 = Object.keys(a2);
      for (d2 = 0; d2 < f2.length; d2++) c2 = f2[d2], 0 <= b2.indexOf(c2) || (e2[c2] = a2[c2]);
      return e2;
    }
    function _default(a2) {
      var b2 = a2.size, c2 = void 0 === b2 ? 24 : b2, d2 = a2.onClick, e2 = a2.icon, f2 = a2.className, g2 = _objectWithoutProperties(a2, _excluded), h2 = ["gridicon", "gridicons-notice-outline", f2, !!(function isModulo18(a3) {
        return 0 == a3 % 18;
      })(c2) && "needs-offset", false, false].filter(Boolean).join(" ");
      return _react["default"].createElement("svg", _extends({ className: h2, height: c2, width: c2, onClick: d2 }, g2, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" }), _react["default"].createElement("g", null, _react["default"].createElement("path", { d: "M12 4c4.411 0 8 3.589 8 8s-3.589 8-8 8-8-3.589-8-8 3.589-8 8-8m0-2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm1 13h-2v2h2v-2zm-2-2h2l.5-6h-3l.5 6z" })));
    }
  }
});

// package-external:@wordpress/notices
var require_notices = __commonJS({
  "package-external:@wordpress/notices"(exports, module) {
    module.exports = window.wp.notices;
  }
});

// package-external:@wordpress/url
var require_url = __commonJS({
  "package-external:@wordpress/url"(exports, module) {
    module.exports = window.wp.url;
  }
});

// package-external:@wordpress/core-data
var require_core_data = __commonJS({
  "package-external:@wordpress/core-data"(exports, module) {
    module.exports = window.wp.coreData;
  }
});

// package-external:@wordpress/html-entities
var require_html_entities = __commonJS({
  "package-external:@wordpress/html-entities"(exports, module) {
    module.exports = window.wp.htmlEntities;
  }
});

// ../../js-packages/config/src/index.js
var require_src = __commonJS({
  "../../js-packages/config/src/index.js"(exports, module) {
    var jetpackConfig = {};
    try {
      jetpackConfig = __require("jetpackConfig");
    } catch {
      console.error(
        "jetpackConfig is missing in your webpack config file. See @automattic/jetpack-config"
      );
      jetpackConfig = { missingConfig: true };
    }
    var jetpackConfigHas2 = (key) => {
      return Object.hasOwn(jetpackConfig, key);
    };
    var jetpackConfigGet2 = (key) => {
      if (!jetpackConfigHas2(key)) {
        throw 'This app requires the "' + key + '" Jetpack Config to be defined in your webpack configuration file. See details in @automattic/jetpack-config package docs.';
      }
      return jetpackConfig[key];
    };
    module.exports = {
      jetpackConfigHas: jetpackConfigHas2,
      jetpackConfigGet: jetpackConfigGet2
    };
  }
});

// package-external:@wordpress/plugins
var require_plugins = __commonJS({
  "package-external:@wordpress/plugins"(exports, module) {
    module.exports = window.wp.plugins;
  }
});

// package-external:@wordpress/hooks
var require_hooks = __commonJS({
  "package-external:@wordpress/hooks"(exports, module) {
    module.exports = window.wp.hooks;
  }
});

// package-external:@wordpress/dom-ready
var require_dom_ready = __commonJS({
  "package-external:@wordpress/dom-ready"(exports, module) {
    module.exports = window.wp.domReady;
  }
});

// ../../js-packages/analytics/index.jsx
var import_debug = __toESM(require_browser(), 1);
var debug = (0, import_debug.default)("dops:analytics");
var _superProps;
var _user;
window._tkq = window._tkq || [];
window.ga = window.ga || function() {
  (window.ga.q = window.ga.q || []).push(arguments);
};
window.ga.l = +/* @__PURE__ */ new Date();
function buildQuerystring(group, name) {
  let uriComponent = "";
  if ("object" === typeof group) {
    for (const key in group) {
      uriComponent += "&x_" + encodeURIComponent(key) + "=" + encodeURIComponent(group[key]);
    }
    debug("Bumping stats %o", group);
  } else {
    uriComponent = "&x_" + encodeURIComponent(group) + "=" + encodeURIComponent(name);
    debug('Bumping stat "%s" in group "%s"', name, group);
  }
  return uriComponent;
}
function buildQuerystringNoPrefix(group, name) {
  let uriComponent = "";
  if ("object" === typeof group) {
    for (const key in group) {
      uriComponent += "&" + encodeURIComponent(key) + "=" + encodeURIComponent(group[key]);
    }
    debug("Built stats %o", group);
  } else {
    uriComponent = "&" + encodeURIComponent(group) + "=" + encodeURIComponent(name);
    debug('Built stat "%s" in group "%s"', name, group);
  }
  return uriComponent;
}
var analytics = {
  initialize: function(userId, username, superProps) {
    analytics.setUser(userId, username);
    analytics.setSuperProps(superProps);
    analytics.identifyUser();
  },
  setGoogleAnalyticsEnabled: function(googleAnalyticsEnabled, googleAnalyticsKey = null) {
    this.googleAnalyticsEnabled = googleAnalyticsEnabled;
    this.googleAnalyticsKey = googleAnalyticsKey;
  },
  setMcAnalyticsEnabled: function(mcAnalyticsEnabled) {
    this.mcAnalyticsEnabled = mcAnalyticsEnabled;
  },
  setUser: function(userId, username) {
    _user = { ID: userId, username };
  },
  setSuperProps: function(superProps) {
    _superProps = superProps;
  },
  /**
   * Add global properties to be applied to all "tracks" events.
   * This function will add the new properties, overwrite the existing one.
   * Unlike `setSuperProps()`, it will not replace the whole object.
   *
   * @param {object} props - Super props to add.
   */
  assignSuperProps: function(props) {
    _superProps = Object.assign(_superProps || {}, props);
  },
  mc: {
    bumpStat: function(group, name) {
      const uriComponent = buildQuerystring(group, name);
      if (analytics.mcAnalyticsEnabled) {
        new Image().src = document.location.protocol + "//pixel.wp.com/g.gif?v=wpcom-no-pv" + uriComponent + "&t=" + Math.random();
      }
    },
    bumpStatWithPageView: function(group, name) {
      const uriComponent = buildQuerystringNoPrefix(group, name);
      if (analytics.mcAnalyticsEnabled) {
        new Image().src = document.location.protocol + "//pixel.wp.com/g.gif?v=wpcom" + uriComponent + "&t=" + Math.random();
      }
    }
  },
  // pageView is a wrapper for pageview events across Tracks and GA
  pageView: {
    record: function(urlPath, pageTitle) {
      analytics.tracks.recordPageView(urlPath);
      analytics.ga.recordPageView(urlPath, pageTitle);
    }
  },
  purchase: {
    record: function(transactionId, itemName, itemId, revenue, price, qty, currency) {
      analytics.ga.recordPurchase(transactionId, itemName, itemId, revenue, price, qty, currency);
    }
  },
  tracks: {
    recordEvent: function(eventName, eventProperties) {
      eventProperties = eventProperties || {};
      if (eventName.indexOf("akismet_") !== 0 && eventName.indexOf("jetpack_") !== 0) {
        debug('- Event name must be prefixed by "akismet_" or "jetpack_"');
        return;
      }
      if (_superProps) {
        debug("- Super Props: %o", _superProps);
        eventProperties = Object.assign(eventProperties, _superProps);
      }
      debug(
        'Record event "%s" called with props %s',
        eventName,
        JSON.stringify(eventProperties)
      );
      window._tkq.push(["recordEvent", eventName, eventProperties]);
    },
    recordJetpackClick: function(target) {
      const props = "object" === typeof target ? target : { target };
      analytics.tracks.recordEvent("jetpack_wpa_click", props);
    },
    recordPageView: function(urlPath) {
      analytics.tracks.recordEvent("akismet_page_view", {
        path: urlPath
      });
    },
    setOptOut: function(isOptingOut) {
      debug("Pushing setOptOut: %o", isOptingOut);
      window._tkq.push(["setOptOut", isOptingOut]);
    }
  },
  // Google Analytics usage and event stat tracking
  ga: {
    initialized: false,
    initialize: function() {
      let parameters = {};
      if (!analytics.ga.initialized) {
        if (_user) {
          parameters = {
            userId: "u-" + _user.ID
          };
        }
        window.ga("create", this.googleAnalyticsKey, "auto", parameters);
        analytics.ga.initialized = true;
      }
    },
    recordPageView: function(urlPath, pageTitle) {
      analytics.ga.initialize();
      debug("Recording Page View ~ [URL: " + urlPath + "] [Title: " + pageTitle + "]");
      if (this.googleAnalyticsEnabled) {
        window.ga("set", "page", urlPath);
        window.ga("send", {
          hitType: "pageview",
          page: urlPath,
          title: pageTitle
        });
      }
    },
    recordEvent: function(category, action, label, value) {
      analytics.ga.initialize();
      let debugText = "Recording Event ~ [Category: " + category + "] [Action: " + action + "]";
      if ("undefined" !== typeof label) {
        debugText += " [Option Label: " + label + "]";
      }
      if ("undefined" !== typeof value) {
        debugText += " [Option Value: " + value + "]";
      }
      debug(debugText);
      if (this.googleAnalyticsEnabled) {
        window.ga("send", "event", category, action, label, value);
      }
    },
    recordPurchase: function(transactionId, itemName, itemId, revenue, price, qty, currency) {
      window.ga("require", "ecommerce");
      window.ga("ecommerce:addTransaction", {
        id: transactionId,
        // Transaction ID. Required.
        // 'affiliation': 'Acme Clothing',   // Affiliation or store name.
        revenue,
        // Grand Total.
        // 'tax': '1.29',                     // Tax.
        currency
        // local currency code.
      });
      window.ga("ecommerce:addItem", {
        id: transactionId,
        // Transaction ID. Required.
        name: itemName,
        // Product name. Required.
        sku: itemId,
        // SKU/code.
        // 'category': 'Party Toys',         // Category or variation.
        price,
        // Unit price.
        quantity: qty
        // Quantity.
      });
      window.ga("ecommerce:send");
    }
  },
  identifyUser: function() {
    if (_user) {
      window._tkq.push(["identifyUser", _user.ID, _user.username]);
    }
  },
  setProperties: function(properties) {
    window._tkq.push(["setProperties", properties]);
  },
  clearedIdentity: function() {
    window._tkq.push(["clearIdentity"]);
  }
};
var analytics_default = analytics;

// ../../js-packages/number-formatters/dist/esm/constants.js
var constants_exports = {};
__export(constants_exports, {
  FALLBACK_CURRENCY: () => FALLBACK_CURRENCY,
  FALLBACK_LOCALE: () => FALLBACK_LOCALE
});
__reExport(constants_exports, __toESM(require_date(), 1));
var FALLBACK_LOCALE = "en";
var FALLBACK_CURRENCY = "USD";

// ../../js-packages/number-formatters/dist/esm/number-format-currency/index.js
var import_debug3 = __toESM(require_browser(), 1);

// ../../js-packages/number-formatters/dist/esm/get-cached-formatter.js
var import_debug2 = __toESM(require_browser(), 1);
var debug2 = (0, import_debug2.default)("number-formatters:get-cached-formatter");
var formatterCache = /* @__PURE__ */ new Map();
function getCachedFormatter({ locale, fallbackLocale = FALLBACK_LOCALE, options, retries = 1 }) {
  const cacheKey = JSON.stringify([locale, options]);
  try {
    return formatterCache.get(cacheKey) ?? formatterCache.set(cacheKey, new Intl.NumberFormat(locale, options)).get(cacheKey);
  } catch (error2) {
    debug2(`Intl.NumberFormat was called with a non-existent locale "${locale}"; falling back to ${fallbackLocale}`);
    if (retries) {
      return getCachedFormatter({
        locale: fallbackLocale,
        options,
        retries: retries - 1
      });
    }
    throw error2;
  }
}

// ../../js-packages/number-formatters/dist/esm/number-format-currency/currencies.js
var defaultCurrencyOverrides = {
  AED: {
    symbol: "\u062F.\u0625.\u200F"
  },
  AFN: {
    symbol: "\u060B"
  },
  ALL: {
    symbol: "Lek"
  },
  AMD: {
    symbol: "\u058F"
  },
  ANG: {
    symbol: "\u0192"
  },
  AOA: {
    symbol: "Kz"
  },
  ARS: {
    symbol: "$"
  },
  AUD: {
    symbol: "A$"
  },
  AWG: {
    symbol: "\u0192"
  },
  AZN: {
    symbol: "\u20BC"
  },
  BAM: {
    symbol: "\u041A\u041C"
  },
  BBD: {
    symbol: "Bds$"
  },
  BDT: {
    symbol: "\u09F3"
  },
  BGN: {
    symbol: "\u043B\u0432."
  },
  BHD: {
    symbol: "\u062F.\u0628.\u200F"
  },
  BIF: {
    symbol: "FBu"
  },
  BMD: {
    symbol: "$"
  },
  BND: {
    symbol: "$"
  },
  BOB: {
    symbol: "Bs"
  },
  BRL: {
    symbol: "R$"
  },
  BSD: {
    symbol: "$"
  },
  BTC: {
    symbol: "\u0243"
  },
  BTN: {
    symbol: "Nu."
  },
  BWP: {
    symbol: "P"
  },
  BYR: {
    symbol: "\u0440."
  },
  BZD: {
    symbol: "BZ$"
  },
  CAD: {
    symbol: "C$"
  },
  CDF: {
    symbol: "FC"
  },
  CHF: {
    symbol: "CHF"
  },
  CLP: {
    symbol: "$"
  },
  CNY: {
    symbol: "\xA5"
  },
  COP: {
    symbol: "$"
  },
  CRC: {
    symbol: "\u20A1"
  },
  CUC: {
    symbol: "CUC"
  },
  CUP: {
    symbol: "$MN"
  },
  CVE: {
    symbol: "$"
  },
  CZK: {
    symbol: "K\u010D"
  },
  DJF: {
    symbol: "Fdj"
  },
  DKK: {
    symbol: "kr."
  },
  DOP: {
    symbol: "RD$"
  },
  DZD: {
    symbol: "\u062F.\u062C.\u200F"
  },
  EGP: {
    symbol: "\u062C.\u0645.\u200F"
  },
  ERN: {
    symbol: "Nfk"
  },
  ETB: {
    symbol: "ETB"
  },
  EUR: {
    symbol: "\u20AC"
  },
  FJD: {
    symbol: "FJ$"
  },
  FKP: {
    symbol: "\xA3"
  },
  GBP: {
    symbol: "\xA3"
  },
  GEL: {
    symbol: "Lari"
  },
  GHS: {
    symbol: "\u20B5"
  },
  GIP: {
    symbol: "\xA3"
  },
  GMD: {
    symbol: "D"
  },
  GNF: {
    symbol: "FG"
  },
  GTQ: {
    symbol: "Q"
  },
  GYD: {
    symbol: "G$"
  },
  HKD: {
    symbol: "HK$"
  },
  HNL: {
    symbol: "L."
  },
  HRK: {
    symbol: "kn"
  },
  HTG: {
    symbol: "G"
  },
  HUF: {
    symbol: "Ft"
  },
  IDR: {
    symbol: "Rp"
  },
  ILS: {
    symbol: "\u20AA"
  },
  INR: {
    symbol: "\u20B9"
  },
  IQD: {
    symbol: "\u062F.\u0639.\u200F"
  },
  IRR: {
    symbol: "\uFDFC"
  },
  ISK: {
    symbol: "kr."
  },
  JMD: {
    symbol: "J$"
  },
  JOD: {
    symbol: "\u062F.\u0627.\u200F"
  },
  JPY: {
    symbol: "\xA5"
  },
  KES: {
    symbol: "S"
  },
  KGS: {
    symbol: "\u0441\u043E\u043C"
  },
  KHR: {
    symbol: "\u17DB"
  },
  KMF: {
    symbol: "CF"
  },
  KPW: {
    symbol: "\u20A9"
  },
  KRW: {
    symbol: "\u20A9"
  },
  KWD: {
    symbol: "\u062F.\u0643.\u200F"
  },
  KYD: {
    symbol: "$"
  },
  KZT: {
    symbol: "\u20B8"
  },
  LAK: {
    symbol: "\u20AD"
  },
  LBP: {
    symbol: "\u0644.\u0644.\u200F"
  },
  LKR: {
    symbol: "\u20A8"
  },
  LRD: {
    symbol: "L$"
  },
  LSL: {
    symbol: "M"
  },
  LYD: {
    symbol: "\u062F.\u0644.\u200F"
  },
  MAD: {
    symbol: "\u062F.\u0645.\u200F"
  },
  MDL: {
    symbol: "lei"
  },
  MGA: {
    symbol: "Ar"
  },
  MKD: {
    symbol: "\u0434\u0435\u043D."
  },
  MMK: {
    symbol: "K"
  },
  MNT: {
    symbol: "\u20AE"
  },
  MOP: {
    symbol: "MOP$"
  },
  MRO: {
    symbol: "UM"
  },
  MTL: {
    symbol: "\u20A4"
  },
  MUR: {
    symbol: "\u20A8"
  },
  MVR: {
    symbol: "MVR"
  },
  MWK: {
    symbol: "MK"
  },
  MXN: {
    symbol: "MX$"
  },
  MYR: {
    symbol: "RM"
  },
  MZN: {
    symbol: "MT"
  },
  NAD: {
    symbol: "N$"
  },
  NGN: {
    symbol: "\u20A6"
  },
  NIO: {
    symbol: "C$"
  },
  NOK: {
    symbol: "kr"
  },
  NPR: {
    symbol: "\u20A8"
  },
  NZD: {
    symbol: "NZ$"
  },
  OMR: {
    symbol: "\uFDFC"
  },
  PAB: {
    symbol: "B/."
  },
  PEN: {
    symbol: "S/."
  },
  PGK: {
    symbol: "K"
  },
  PHP: {
    symbol: "\u20B1"
  },
  PKR: {
    symbol: "\u20A8"
  },
  PLN: {
    symbol: "z\u0142"
  },
  PYG: {
    symbol: "\u20B2"
  },
  QAR: {
    symbol: "\uFDFC"
  },
  RON: {
    symbol: "lei"
  },
  RSD: {
    symbol: "\u0414\u0438\u043D."
  },
  RUB: {
    symbol: "\u20BD"
  },
  RWF: {
    symbol: "RWF"
  },
  SAR: {
    symbol: "\uFDFC"
  },
  SBD: {
    symbol: "S$"
  },
  SCR: {
    symbol: "\u20A8"
  },
  SDD: {
    symbol: "LSd"
  },
  SDG: {
    symbol: "\xA3\u200F"
  },
  SEK: {
    symbol: "kr"
  },
  SGD: {
    symbol: "S$"
  },
  SHP: {
    symbol: "\xA3"
  },
  SLL: {
    symbol: "Le"
  },
  SOS: {
    symbol: "S"
  },
  SRD: {
    symbol: "$"
  },
  STD: {
    symbol: "Db"
  },
  SVC: {
    symbol: "\u20A1"
  },
  SYP: {
    symbol: "\xA3"
  },
  SZL: {
    symbol: "E"
  },
  THB: {
    symbol: "\u0E3F"
  },
  TJS: {
    symbol: "TJS"
  },
  TMT: {
    symbol: "m"
  },
  TND: {
    symbol: "\u062F.\u062A.\u200F"
  },
  TOP: {
    symbol: "T$"
  },
  TRY: {
    symbol: "TL"
  },
  TTD: {
    symbol: "TT$"
  },
  TVD: {
    symbol: "$T"
  },
  TWD: {
    symbol: "NT$"
  },
  TZS: {
    symbol: "TSh"
  },
  UAH: {
    symbol: "\u20B4"
  },
  UGX: {
    symbol: "USh"
  },
  USD: {
    // No override. Do what the locale thinks is best.
  },
  UYU: {
    symbol: "$U"
  },
  UZS: {
    symbol: "\u0441\u045E\u043C"
  },
  VEB: {
    symbol: "Bs."
  },
  VEF: {
    symbol: "Bs. F."
  },
  VND: {
    symbol: "\u20AB"
  },
  VUV: {
    symbol: "VT"
  },
  WST: {
    symbol: "WS$"
  },
  XAF: {
    symbol: "F"
  },
  XCD: {
    symbol: "$"
  },
  XOF: {
    symbol: "F"
  },
  XPF: {
    symbol: "F"
  },
  YER: {
    symbol: "\uFDFC"
  },
  ZAR: {
    symbol: "R"
  },
  ZMW: {
    symbol: "ZK"
  },
  WON: {
    symbol: "\u20A9"
  }
};

// ../../js-packages/number-formatters/dist/esm/number-format-currency/index.js
var debug3 = (0, import_debug3.default)("number-formatters:number-format-currency");
function getCurrencyOverride(currency, geoLocation) {
  if (currency === "USD" && geoLocation && geoLocation !== "" && geoLocation !== "US") {
    return { symbol: "US$" };
  }
  return defaultCurrencyOverrides[currency];
}
function getValidCurrency(currency, geoLocation) {
  if (!getCurrencyOverride(currency, geoLocation)) {
    debug3(`getValidCurrency was called with a non-existent currency "${currency}"; falling back to ${FALLBACK_CURRENCY}`);
    return FALLBACK_CURRENCY;
  }
  return currency;
}
function getCurrencyFormatter({ number, currency, browserSafeLocale, forceLatin = true, stripZeros, signForPositive }) {
  const locale = `${browserSafeLocale}${forceLatin ? "-u-nu-latn" : ""}`;
  const numberFormatOptions = {
    style: "currency",
    currency,
    ...stripZeros && Number.isInteger(number) && {
      /**
       * There's an option called `trailingZeroDisplay` but it does not yet work
       * in FF so we have to strip zeros manually.
       */
      maximumFractionDigits: 0,
      minimumFractionDigits: 0
    },
    ...signForPositive && { signDisplay: "exceptZero" }
  };
  return getCachedFormatter({
    locale,
    options: numberFormatOptions
  });
}
function getPrecisionForLocaleAndCurrency(browserSafeLocale, currency, forceLatin) {
  const formatter = getCurrencyFormatter({ number: 0, currency, browserSafeLocale, forceLatin });
  return formatter.resolvedOptions().maximumFractionDigits;
}
function scaleNumberForPrecision(number, currencyPrecision) {
  const scale = Math.pow(10, currencyPrecision);
  return Math.round(number * scale) / scale;
}
function prepareNumberForFormatting(number, currencyPrecision, isSmallestUnit) {
  if (isNaN(number)) {
    debug3("formatCurrency was called with NaN");
    return 0;
  }
  if (isSmallestUnit) {
    if (!Number.isInteger(number)) {
      debug3("formatCurrency was called with isSmallestUnit and a float which will be rounded", number);
    }
    const smallestUnitDivisor = 10 ** currencyPrecision;
    return scaleNumberForPrecision(Math.round(number) / smallestUnitDivisor, currencyPrecision);
  }
  return scaleNumberForPrecision(number, currencyPrecision);
}
var numberFormatCurrency = ({ number, browserSafeLocale, currency, stripZeros, isSmallestUnit, signForPositive, geoLocation, forceLatin }) => {
  const validCurrency = getValidCurrency(currency, geoLocation);
  const currencyOverride = getCurrencyOverride(validCurrency, geoLocation);
  const currencyPrecision = getPrecisionForLocaleAndCurrency(browserSafeLocale, validCurrency, forceLatin);
  if (isSmallestUnit && typeof currencyPrecision === "undefined") {
    throw new Error(`Could not determine currency precision for ${validCurrency} in ${browserSafeLocale}`);
  }
  const numberAsFloat = prepareNumberForFormatting(number, currencyPrecision ?? 0, isSmallestUnit);
  const formatter = getCurrencyFormatter({
    number: numberAsFloat,
    currency: validCurrency,
    browserSafeLocale,
    forceLatin,
    stripZeros,
    signForPositive
  });
  const parts = formatter.formatToParts(numberAsFloat);
  return parts.reduce((formatted, part) => {
    switch (part.type) {
      case "currency":
        if (currencyOverride?.symbol) {
          return formatted + currencyOverride.symbol;
        }
        return formatted + part.value;
      default:
        return formatted + part.value;
    }
  }, "");
};
var getCurrencyObject = ({ number, browserSafeLocale, currency, stripZeros, isSmallestUnit, signForPositive, geoLocation, forceLatin }) => {
  const validCurrency = getValidCurrency(currency, geoLocation);
  const currencyOverride = getCurrencyOverride(validCurrency, geoLocation);
  const currencyPrecision = getPrecisionForLocaleAndCurrency(browserSafeLocale, validCurrency, forceLatin);
  const numberAsFloat = prepareNumberForFormatting(number, currencyPrecision ?? 0, isSmallestUnit);
  const formatter = getCurrencyFormatter({
    number: numberAsFloat,
    currency: validCurrency,
    browserSafeLocale,
    forceLatin,
    stripZeros,
    signForPositive
  });
  const parts = formatter.formatToParts(numberAsFloat);
  let sign = "";
  let symbol3 = "$";
  let symbolPosition = "before";
  let hasAmountBeenSet = false;
  let hasDecimalBeenSet = false;
  let integer = "";
  let fraction = "";
  parts.forEach((part) => {
    switch (part.type) {
      case "currency":
        symbol3 = currencyOverride?.symbol ?? part.value;
        if (hasAmountBeenSet) {
          symbolPosition = "after";
        }
        return;
      case "group":
        integer += part.value;
        hasAmountBeenSet = true;
        return;
      case "decimal":
        fraction += part.value;
        hasAmountBeenSet = true;
        hasDecimalBeenSet = true;
        return;
      case "integer":
        integer += part.value;
        hasAmountBeenSet = true;
        return;
      case "fraction":
        fraction += part.value;
        hasAmountBeenSet = true;
        hasDecimalBeenSet = true;
        return;
      case "minusSign":
        sign = "-";
        return;
      case "plusSign":
        sign = "+";
    }
  });
  const hasNonZeroFraction = !Number.isInteger(numberAsFloat) && hasDecimalBeenSet;
  return {
    sign,
    symbol: symbol3,
    symbolPosition,
    integer,
    fraction,
    hasNonZeroFraction,
    floatValue: numberAsFloat
  };
};

// ../../js-packages/number-formatters/dist/esm/number-format.js
var numberFormat = ({ browserSafeLocale, decimals = 0, forceLatin = true, numberFormatOptions = {} }) => {
  const locale = `${browserSafeLocale}${forceLatin ? "-u-nu-latn" : ""}`;
  const options = {
    minimumFractionDigits: decimals,
    // minimumFractionDigits default is 0
    maximumFractionDigits: decimals,
    // maximumFractionDigits default is the greater between minimumFractionDigits and 3
    ...numberFormatOptions
  };
  return getCachedFormatter({ locale, options });
};
var numberFormatCompact = ({ numberFormatOptions = {}, ...params }) => numberFormat({
  ...params,
  numberFormatOptions: {
    notation: "compact",
    maximumFractionDigits: 1,
    ...numberFormatOptions
  }
});

// ../../js-packages/number-formatters/dist/esm/create-number-formatters.js
function createNumberFormatters() {
  let localeState;
  let geoLocationState;
  const setLocale2 = (locale) => {
    localeState = locale;
  };
  const getBrowserSafeLocale = () => {
    const localeFromUserSettings = typeof window !== "undefined" ? window.wp?.date?.getSettings?.()?.l10n?.locale : void 0;
    const localeFromNavigator = typeof window !== "undefined" ? window?.navigator?.language : void 0;
    return (localeState ?? (localeFromUserSettings || localeFromNavigator) ?? FALLBACK_LOCALE).split("_")[0];
  };
  const setGeoLocation2 = (geoLocation) => {
    geoLocationState = geoLocation;
  };
  const formatNumber2 = (number, { decimals = 0, forceLatin = true, numberFormatOptions = {} } = {}) => {
    try {
      const formatter = numberFormat({
        browserSafeLocale: getBrowserSafeLocale(),
        decimals,
        forceLatin,
        numberFormatOptions
      });
      return formatter.format(number);
    } catch {
      return String(number);
    }
  };
  const formatNumberCompact2 = (number, { decimals = 0, forceLatin = true, numberFormatOptions = {} } = {}) => {
    try {
      const formatter = numberFormatCompact({
        browserSafeLocale: getBrowserSafeLocale(),
        decimals,
        forceLatin,
        numberFormatOptions
      });
      return formatter.format(number);
    } catch {
      return String(number);
    }
  };
  const formatCurrency2 = (number, currency, { stripZeros = false, isSmallestUnit = false, signForPositive = false, forceLatin = true } = {}) => {
    return numberFormatCurrency({
      number,
      currency,
      browserSafeLocale: getBrowserSafeLocale(),
      stripZeros,
      isSmallestUnit,
      signForPositive,
      geoLocation: geoLocationState,
      forceLatin
    });
  };
  const getCurrencyObject3 = (number, currency, { stripZeros = false, isSmallestUnit = false, signForPositive = false, forceLatin = true } = {}) => {
    return getCurrencyObject({
      number,
      currency,
      browserSafeLocale: getBrowserSafeLocale(),
      stripZeros,
      isSmallestUnit,
      signForPositive,
      geoLocation: geoLocationState,
      forceLatin
    });
  };
  return {
    setLocale: setLocale2,
    setGeoLocation: setGeoLocation2,
    formatNumber: formatNumber2,
    formatNumberCompact: formatNumberCompact2,
    formatCurrency: formatCurrency2,
    getCurrencyObject: getCurrencyObject3
  };
}
var create_number_formatters_default = createNumberFormatters;

// ../../js-packages/number-formatters/dist/esm/index.js
var defaultFormatter = create_number_formatters_default();
var { setLocale, setGeoLocation, formatNumber, formatNumberCompact, formatCurrency, getCurrencyObject: getCurrencyObject2 } = defaultFormatter;

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.11.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/admin-ui/build-module/breadcrumbs/index.mjs
var import_i18n = __toESM(require_i18n(), 1);
var import_components = __toESM(require_components(), 1);
var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
import { Link } from "@wordpress/route";
var Breadcrumbs = ({ items }) => {
  if (!items.length) {
    return null;
  }
  const precedingItems = items.slice(0, -1);
  const lastItem = items[items.length - 1];
  if (true) {
    const invalidItem = precedingItems.find((item) => !item.to);
    if (invalidItem) {
      throw new Error(
        `Breadcrumbs: item "${invalidItem.label}" is missing a \`to\` prop. All items except the last one must have a \`to\` prop.`
      );
    }
  }
  return /* @__PURE__ */ (0, import_jsx_runtime.jsx)("nav", { "aria-label": (0, import_i18n.__)("Breadcrumbs"), children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
    import_components.__experimentalHStack,
    {
      as: "ul",
      className: "admin-ui-breadcrumbs__list",
      spacing: 0,
      justify: "flex-start",
      alignment: "center",
      children: [
        precedingItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { to: item.to, children: item.label }) }, index)),
        /* @__PURE__ */ (0, import_jsx_runtime.jsx)("li", { children: lastItem.to ? /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Link, { to: lastItem.to, children: lastItem.label }) : /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_components.__experimentalHeading, { level: 1, truncate: true, children: lastItem.label }) })
      ]
    }
  ) });
};
var breadcrumbs_default = Breadcrumbs;

// ../../../node_modules/.pnpm/clsx@2.1.1/node_modules/clsx/dist/clsx.mjs
function r(e2) {
  var t2, f2, n2 = "";
  if ("string" == typeof e2 || "number" == typeof e2) n2 += e2;
  else if ("object" == typeof e2) if (Array.isArray(e2)) {
    var o2 = e2.length;
    for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2);
  } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2);
  return n2;
}
function clsx() {
  for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2);
  return n2;
}
var clsx_default = clsx;

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.11.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/admin-ui/build-module/navigable-region/index.mjs
var import_element = __toESM(require_element(), 1);
var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
var NavigableRegion = (0, import_element.forwardRef)(
  ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => {
    return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(
      Tag,
      {
        ref,
        className: clsx_default("admin-ui-navigable-region", className),
        "aria-label": ariaLabel,
        role: "region",
        tabIndex: "-1",
        ...props,
        children
      }
    );
  }
);
NavigableRegion.displayName = "NavigableRegion";
var navigable_region_default = NavigableRegion;

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useControlled.js
var React = __toESM(require_react(), 1);
function useControlled({
  controlled,
  default: defaultProp,
  name,
  state = "value"
}) {
  const {
    current: isControlled
  } = React.useRef(controlled !== void 0);
  const [valueState, setValue] = React.useState(defaultProp);
  const value = isControlled ? controlled : valueState;
  if (true) {
    React.useEffect(() => {
      if (isControlled !== (controlled !== void 0)) {
        console.error([`Base UI: A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
      }
    }, [state, name, controlled]);
    const {
      current: defaultValue2
    } = React.useRef(defaultProp);
    React.useEffect(() => {
      if (!isControlled && JSON.stringify(defaultValue2) !== JSON.stringify(defaultProp)) {
        console.error([`Base UI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n"));
      }
    }, [JSON.stringify(defaultProp)]);
  }
  const setValueIfUncontrolled = React.useCallback((newValue) => {
    if (!isControlled) {
      setValue(newValue);
    }
  }, []);
  return [value, setValueIfUncontrolled];
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useStableCallback.js
var React3 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useRefWithInit.js
var React2 = __toESM(require_react(), 1);
var UNINITIALIZED = {};
function useRefWithInit(init2, initArg) {
  const ref = React2.useRef(UNINITIALIZED);
  if (ref.current === UNINITIALIZED) {
    ref.current = init2(initArg);
  }
  return ref;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useStableCallback.js
var useInsertionEffect = React3[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)];
var useSafeInsertionEffect = (
  // React 17 doesn't have useInsertionEffect.
  useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
  useInsertionEffect !== React3.useLayoutEffect ? useInsertionEffect : (fn) => fn()
);
function useStableCallback(callback) {
  const stable = useRefWithInit(createStableCallback).current;
  stable.next = callback;
  useSafeInsertionEffect(stable.effect);
  return stable.trampoline;
}
function createStableCallback() {
  const stable = {
    next: void 0,
    callback: assertNotCalled,
    trampoline: (...args) => stable.callback?.(...args),
    effect: () => {
      stable.callback = stable.next;
    }
  };
  return stable;
}
function assertNotCalled() {
  if (true) {
    throw (
      /* minify-error-disabled */
      new Error("Base UI: Cannot call an event handler while rendering.")
    );
  }
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js
var React4 = __toESM(require_react(), 1);
var noop = () => {
};
var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop;

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/warn.js
var set;
if (true) {
  set = /* @__PURE__ */ new Set();
}
function warn(...messages) {
  if (true) {
    const messageKey = messages.join(" ");
    if (!set.has(messageKey)) {
      set.add(messageKey);
      console.warn(`Base UI: ${messageKey}`);
    }
  }
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/CompositeList.js
var React6 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/CompositeListContext.js
var React5 = __toESM(require_react(), 1);
var CompositeListContext = /* @__PURE__ */ React5.createContext({
  register: () => {
  },
  unregister: () => {
  },
  subscribeMapChange: () => {
    return () => {
    };
  },
  elementsRef: {
    current: []
  },
  nextIndexRef: {
    current: 0
  }
});
if (true) CompositeListContext.displayName = "CompositeListContext";
function useCompositeListContext() {
  return React5.useContext(CompositeListContext);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/CompositeList.js
var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
function CompositeList(props) {
  const {
    children,
    elementsRef,
    labelsRef,
    onMapChange: onMapChangeProp
  } = props;
  const onMapChange = useStableCallback(onMapChangeProp);
  const nextIndexRef = React6.useRef(0);
  const listeners = useRefWithInit(createListeners).current;
  const map = useRefWithInit(createMap).current;
  const [mapTick, setMapTick] = React6.useState(0);
  const lastTickRef = React6.useRef(mapTick);
  const register6 = useStableCallback((node, metadata) => {
    map.set(node, metadata ?? null);
    lastTickRef.current += 1;
    setMapTick(lastTickRef.current);
  });
  const unregister = useStableCallback((node) => {
    map.delete(node);
    lastTickRef.current += 1;
    setMapTick(lastTickRef.current);
  });
  const sortedMap = React6.useMemo(() => {
    disableEslintWarning(mapTick);
    const newMap = /* @__PURE__ */ new Map();
    const sortedNodes = Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition);
    sortedNodes.forEach((node, index) => {
      const metadata = map.get(node) ?? {};
      newMap.set(node, {
        ...metadata,
        index
      });
    });
    return newMap;
  }, [map, mapTick]);
  useIsoLayoutEffect(() => {
    if (typeof MutationObserver !== "function" || sortedMap.size === 0) {
      return void 0;
    }
    const mutationObserver = new MutationObserver((entries) => {
      const diff = /* @__PURE__ */ new Set();
      const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
      entries.forEach((entry) => {
        entry.removedNodes.forEach(updateDiff);
        entry.addedNodes.forEach(updateDiff);
      });
      if (diff.size === 0) {
        lastTickRef.current += 1;
        setMapTick(lastTickRef.current);
      }
    });
    sortedMap.forEach((_, node) => {
      if (node.parentElement) {
        mutationObserver.observe(node.parentElement, {
          childList: true
        });
      }
    });
    return () => {
      mutationObserver.disconnect();
    };
  }, [sortedMap]);
  useIsoLayoutEffect(() => {
    const shouldUpdateLengths = lastTickRef.current === mapTick;
    if (shouldUpdateLengths) {
      if (elementsRef.current.length !== sortedMap.size) {
        elementsRef.current.length = sortedMap.size;
      }
      if (labelsRef && labelsRef.current.length !== sortedMap.size) {
        labelsRef.current.length = sortedMap.size;
      }
      nextIndexRef.current = sortedMap.size;
    }
    onMapChange(sortedMap);
  }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]);
  useIsoLayoutEffect(() => {
    return () => {
      elementsRef.current = [];
    };
  }, [elementsRef]);
  useIsoLayoutEffect(() => {
    return () => {
      if (labelsRef) {
        labelsRef.current = [];
      }
    };
  }, [labelsRef]);
  const subscribeMapChange = useStableCallback((fn) => {
    listeners.add(fn);
    return () => {
      listeners.delete(fn);
    };
  });
  useIsoLayoutEffect(() => {
    listeners.forEach((l2) => l2(sortedMap));
  }, [listeners, sortedMap]);
  const contextValue = React6.useMemo(() => ({
    register: register6,
    unregister,
    subscribeMapChange,
    elementsRef,
    labelsRef,
    nextIndexRef
  }), [register6, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]);
  return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CompositeListContext.Provider, {
    value: contextValue,
    children
  });
}
function createMap() {
  return /* @__PURE__ */ new Map();
}
function createListeners() {
  return /* @__PURE__ */ new Set();
}
function sortByDocumentPosition(a2, b2) {
  const position = a2.compareDocumentPosition(b2);
  if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
    return -1;
  }
  if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
    return 1;
  }
  return 0;
}
function disableEslintWarning(_) {
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/direction-provider/DirectionContext.js
var React7 = __toESM(require_react(), 1);
var DirectionContext = /* @__PURE__ */ React7.createContext(void 0);
if (true) DirectionContext.displayName = "DirectionContext";
function useDirection() {
  const context = React7.useContext(DirectionContext);
  return context?.direction ?? "ltr";
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
var React10 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useMergedRefs.js
function useMergedRefs(a2, b2, c2, d2) {
  const forkRef = useRefWithInit(createForkRef).current;
  if (didChange(forkRef, a2, b2, c2, d2)) {
    update(forkRef, [a2, b2, c2, d2]);
  }
  return forkRef.callback;
}
function useMergedRefsN(refs) {
  const forkRef = useRefWithInit(createForkRef).current;
  if (didChangeN(forkRef, refs)) {
    update(forkRef, refs);
  }
  return forkRef.callback;
}
function createForkRef() {
  return {
    callback: null,
    cleanup: null,
    refs: []
  };
}
function didChange(forkRef, a2, b2, c2, d2) {
  return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d2;
}
function didChangeN(forkRef, newRefs) {
  return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
}
function update(forkRef, refs) {
  forkRef.refs = refs;
  if (refs.every((ref) => ref == null)) {
    forkRef.callback = null;
    return;
  }
  forkRef.callback = (instance) => {
    if (forkRef.cleanup) {
      forkRef.cleanup();
      forkRef.cleanup = null;
    }
    if (instance != null) {
      const cleanupCallbacks = Array(refs.length).fill(null);
      for (let i2 = 0; i2 < refs.length; i2 += 1) {
        const ref = refs[i2];
        if (ref == null) {
          continue;
        }
        switch (typeof ref) {
          case "function": {
            const refCleanup = ref(instance);
            if (typeof refCleanup === "function") {
              cleanupCallbacks[i2] = refCleanup;
            }
            break;
          }
          case "object": {
            ref.current = instance;
            break;
          }
          default:
        }
      }
      forkRef.cleanup = () => {
        for (let i2 = 0; i2 < refs.length; i2 += 1) {
          const ref = refs[i2];
          if (ref == null) {
            continue;
          }
          switch (typeof ref) {
            case "function": {
              const cleanupCallback = cleanupCallbacks[i2];
              if (typeof cleanupCallback === "function") {
                cleanupCallback();
              } else {
                ref(null);
              }
              break;
            }
            case "object": {
              ref.current = null;
              break;
            }
            default:
          }
        }
      };
    }
  };
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
var React9 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/reactVersion.js
var React8 = __toESM(require_react(), 1);
var majorVersion = parseInt(React8.version, 10);
function isReactVersionAtLeast(reactVersionToCheck) {
  return majorVersion >= reactVersionToCheck;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/getReactElementRef.js
function getReactElementRef(element) {
  if (!/* @__PURE__ */ React9.isValidElement(element)) {
    return null;
  }
  const reactElement = element;
  const propsWithRef = reactElement.props;
  return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/mergeObjects.js
function mergeObjects(a2, b2) {
  if (a2 && !b2) {
    return a2;
  }
  if (!a2 && b2) {
    return b2;
  }
  if (a2 || b2) {
    return {
      ...a2,
      ...b2
    };
  }
  return void 0;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js
function getStateAttributesProps(state, customMapping) {
  const props = {};
  for (const key in state) {
    const value = state[key];
    if (customMapping?.hasOwnProperty(key)) {
      const customProps = customMapping[key](value);
      if (customProps != null) {
        Object.assign(props, customProps);
      }
      continue;
    }
    if (value === true) {
      props[`data-${key.toLowerCase()}`] = "";
    } else if (value) {
      props[`data-${key.toLowerCase()}`] = value.toString();
    }
  }
  return props;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveClassName.js
function resolveClassName(className, state) {
  return typeof className === "function" ? className(state) : className;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveStyle.js
function resolveStyle(style, state) {
  return typeof style === "function" ? style(state) : style;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/merge-props/mergeProps.js
var EMPTY_PROPS = {};
function mergeProps(a2, b2, c2, d2, e2) {
  let merged = {
    ...resolvePropsGetter(a2, EMPTY_PROPS)
  };
  if (b2) {
    merged = mergeOne(merged, b2);
  }
  if (c2) {
    merged = mergeOne(merged, c2);
  }
  if (d2) {
    merged = mergeOne(merged, d2);
  }
  if (e2) {
    merged = mergeOne(merged, e2);
  }
  return merged;
}
function mergePropsN(props) {
  if (props.length === 0) {
    return EMPTY_PROPS;
  }
  if (props.length === 1) {
    return resolvePropsGetter(props[0], EMPTY_PROPS);
  }
  let merged = {
    ...resolvePropsGetter(props[0], EMPTY_PROPS)
  };
  for (let i2 = 1; i2 < props.length; i2 += 1) {
    merged = mergeOne(merged, props[i2]);
  }
  return merged;
}
function mergeOne(merged, inputProps) {
  if (isPropsGetter(inputProps)) {
    return inputProps(merged);
  }
  return mutablyMergeInto(merged, inputProps);
}
function mutablyMergeInto(mergedProps, externalProps) {
  if (!externalProps) {
    return mergedProps;
  }
  for (const propName in externalProps) {
    const externalPropValue = externalProps[propName];
    switch (propName) {
      case "style": {
        mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
        break;
      }
      case "className": {
        mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
        break;
      }
      default: {
        if (isEventHandler(propName, externalPropValue)) {
          mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
        } else {
          mergedProps[propName] = externalPropValue;
        }
      }
    }
  }
  return mergedProps;
}
function isEventHandler(key, value) {
  const code0 = key.charCodeAt(0);
  const code1 = key.charCodeAt(1);
  const code2 = key.charCodeAt(2);
  return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
}
function isPropsGetter(inputProps) {
  return typeof inputProps === "function";
}
function resolvePropsGetter(inputProps, previousProps) {
  if (isPropsGetter(inputProps)) {
    return inputProps(previousProps);
  }
  return inputProps ?? EMPTY_PROPS;
}
function mergeEventHandlers(ourHandler, theirHandler) {
  if (!theirHandler) {
    return ourHandler;
  }
  if (!ourHandler) {
    return theirHandler;
  }
  return (event) => {
    if (isSyntheticEvent(event)) {
      const baseUIEvent = event;
      makeEventPreventable(baseUIEvent);
      const result2 = theirHandler(baseUIEvent);
      if (!baseUIEvent.baseUIHandlerPrevented) {
        ourHandler?.(baseUIEvent);
      }
      return result2;
    }
    const result = theirHandler(event);
    ourHandler?.(event);
    return result;
  };
}
function makeEventPreventable(event) {
  event.preventBaseUIHandler = () => {
    event.baseUIHandlerPrevented = true;
  };
  return event;
}
function mergeClassNames(ourClassName, theirClassName) {
  if (theirClassName) {
    if (ourClassName) {
      return theirClassName + " " + ourClassName;
    }
    return theirClassName;
  }
  return ourClassName;
}
function isSyntheticEvent(event) {
  return event != null && typeof event === "object" && "nativeEvent" in event;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/empty.js
var EMPTY_ARRAY = Object.freeze([]);
var EMPTY_OBJECT = Object.freeze({});

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/constants.js
var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore";
var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore";
var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`;
var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`;

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useRenderElement.js
var import_react = __toESM(require_react(), 1);
function useRenderElement(element, componentProps, params = {}) {
  const renderProp = componentProps.render;
  const outProps = useRenderElementProps(componentProps, params);
  if (params.enabled === false) {
    return null;
  }
  const state = params.state ?? EMPTY_OBJECT;
  return evaluateRenderProp(element, renderProp, outProps, state);
}
function useRenderElementProps(componentProps, params = {}) {
  const {
    className: classNameProp,
    style: styleProp,
    render: renderProp
  } = componentProps;
  const {
    state = EMPTY_OBJECT,
    ref,
    props,
    stateAttributesMapping: stateAttributesMapping3,
    enabled = true
  } = params;
  const className = enabled ? resolveClassName(classNameProp, state) : void 0;
  const style = enabled ? resolveStyle(styleProp, state) : void 0;
  const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT;
  const outProps = enabled ? mergeObjects(stateProps, Array.isArray(props) ? mergePropsN(props) : props) ?? EMPTY_OBJECT : EMPTY_OBJECT;
  if (typeof document !== "undefined") {
    if (!enabled) {
      useMergedRefs(null, null);
    } else if (Array.isArray(ref)) {
      outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
    } else {
      outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
    }
  }
  if (!enabled) {
    return EMPTY_OBJECT;
  }
  if (className !== void 0) {
    outProps.className = mergeClassNames(outProps.className, className);
  }
  if (style !== void 0) {
    outProps.style = mergeObjects(outProps.style, style);
  }
  return outProps;
}
var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
function evaluateRenderProp(element, render4, props, state) {
  if (render4) {
    if (typeof render4 === "function") {
      if (true) {
        warnIfRenderPropLooksLikeComponent(render4);
      }
      return render4(props, state);
    }
    const mergedProps = mergeProps(props, render4.props);
    mergedProps.ref = props.ref;
    let newElement = render4;
    if (newElement?.$$typeof === REACT_LAZY_TYPE) {
      const children = React10.Children.toArray(render4);
      newElement = children[0];
    }
    if (true) {
      if (!/* @__PURE__ */ React10.isValidElement(newElement)) {
        throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
      }
    }
    return /* @__PURE__ */ React10.cloneElement(newElement, mergedProps);
  }
  if (element) {
    if (typeof element === "string") {
      return renderTag(element, props);
    }
  }
  throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
}
function warnIfRenderPropLooksLikeComponent(renderFn) {
  const functionName = renderFn.name;
  if (functionName.length === 0) {
    return;
  }
  const firstCharacterCode = functionName.charCodeAt(0);
  if (firstCharacterCode < 65 || firstCharacterCode > 90) {
    return;
  }
  warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
}
function renderTag(Tag, props) {
  if (Tag === "button") {
    return /* @__PURE__ */ (0, import_react.createElement)("button", {
      type: "button",
      ...props,
      key: props.key
    });
  }
  if (Tag === "img") {
    return /* @__PURE__ */ (0, import_react.createElement)("img", {
      alt: "",
      ...props,
      key: props.key
    });
  }
  return /* @__PURE__ */ React10.createElement(Tag, props);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/reason-parts.js
var reason_parts_exports = {};
__export(reason_parts_exports, {
  cancelOpen: () => cancelOpen,
  chipRemovePress: () => chipRemovePress,
  clearPress: () => clearPress,
  closePress: () => closePress,
  closeWatcher: () => closeWatcher,
  decrementPress: () => decrementPress,
  disabled: () => disabled,
  drag: () => drag,
  escapeKey: () => escapeKey,
  focusOut: () => focusOut,
  imperativeAction: () => imperativeAction,
  incrementPress: () => incrementPress,
  inputBlur: () => inputBlur,
  inputChange: () => inputChange,
  inputClear: () => inputClear,
  inputPaste: () => inputPaste,
  inputPress: () => inputPress,
  itemPress: () => itemPress,
  keyboard: () => keyboard,
  linkPress: () => linkPress,
  listNavigation: () => listNavigation,
  none: () => none,
  outsidePress: () => outsidePress,
  pointer: () => pointer,
  scrub: () => scrub,
  siblingOpen: () => siblingOpen,
  swipe: () => swipe,
  trackPress: () => trackPress,
  triggerFocus: () => triggerFocus,
  triggerHover: () => triggerHover,
  triggerPress: () => triggerPress,
  wheel: () => wheel,
  windowResize: () => windowResize
});
var none = "none";
var triggerPress = "trigger-press";
var triggerHover = "trigger-hover";
var triggerFocus = "trigger-focus";
var outsidePress = "outside-press";
var itemPress = "item-press";
var closePress = "close-press";
var linkPress = "link-press";
var clearPress = "clear-press";
var chipRemovePress = "chip-remove-press";
var trackPress = "track-press";
var incrementPress = "increment-press";
var decrementPress = "decrement-press";
var inputChange = "input-change";
var inputClear = "input-clear";
var inputBlur = "input-blur";
var inputPaste = "input-paste";
var inputPress = "input-press";
var focusOut = "focus-out";
var escapeKey = "escape-key";
var closeWatcher = "close-watcher";
var listNavigation = "list-navigation";
var keyboard = "keyboard";
var pointer = "pointer";
var drag = "drag";
var wheel = "wheel";
var scrub = "scrub";
var cancelOpen = "cancel-open";
var siblingOpen = "sibling-open";
var disabled = "disabled";
var imperativeAction = "imperative-action";
var swipe = "swipe";
var windowResize = "window-resize";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/createBaseUIEventDetails.js
function createChangeEventDetails(reason, event, trigger, customProperties) {
  let canceled = false;
  let allowPropagation = false;
  const custom = customProperties ?? EMPTY_OBJECT;
  const details = {
    reason,
    event: event ?? new Event("base-ui"),
    cancel() {
      canceled = true;
    },
    allowPropagation() {
      allowPropagation = true;
    },
    get isCanceled() {
      return canceled;
    },
    get isPropagationAllowed() {
      return allowPropagation;
    },
    trigger,
    ...custom
  };
  return details;
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useId.js
var React12 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/safeReact.js
var React11 = __toESM(require_react(), 1);
var SafeReact = {
  ...React11
};

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useId.js
var globalId = 0;
function useGlobalId(idOverride, prefix = "mui") {
  const [defaultId, setDefaultId] = React12.useState(idOverride);
  const id = idOverride || defaultId;
  React12.useEffect(() => {
    if (defaultId == null) {
      globalId += 1;
      setDefaultId(`${prefix}-${globalId}`);
    }
  }, [defaultId, prefix]);
  return id;
}
var maybeReactUseId = SafeReact.useId;
function useId(idOverride, prefix) {
  if (maybeReactUseId !== void 0) {
    const reactId = maybeReactUseId();
    return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
  }
  return useGlobalId(idOverride, prefix);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useBaseUiId.js
function useBaseUiId(idOverride) {
  return useId(idOverride, "base-ui");
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useAnimationsFinished.js
var ReactDOM = __toESM(require_react_dom(), 1);

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useOnMount.js
var React13 = __toESM(require_react(), 1);
var EMPTY = [];
function useOnMount(fn) {
  React13.useEffect(fn, EMPTY);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useAnimationFrame.js
var EMPTY2 = null;
var LAST_RAF = globalThis.requestAnimationFrame;
var Scheduler = class {
  /* This implementation uses an array as a backing data-structure for frame callbacks.
   * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
   * never calls the native `cancelAnimationFrame` if there are no frames left. This can
   * be much more efficient if there is a call pattern that alterns as
   * "request-cancel-request-cancel-…".
   * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
   * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
  callbacks = [];
  callbacksCount = 0;
  nextId = 1;
  startId = 1;
  isScheduled = false;
  tick = (timestamp) => {
    this.isScheduled = false;
    const currentCallbacks = this.callbacks;
    const currentCallbacksCount = this.callbacksCount;
    this.callbacks = [];
    this.callbacksCount = 0;
    this.startId = this.nextId;
    if (currentCallbacksCount > 0) {
      for (let i2 = 0; i2 < currentCallbacks.length; i2 += 1) {
        currentCallbacks[i2]?.(timestamp);
      }
    }
  };
  request(fn) {
    const id = this.nextId;
    this.nextId += 1;
    this.callbacks.push(fn);
    this.callbacksCount += 1;
    const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true);
    if (!this.isScheduled || didRAFChange) {
      requestAnimationFrame(this.tick);
      this.isScheduled = true;
    }
    return id;
  }
  cancel(id) {
    const index = id - this.startId;
    if (index < 0 || index >= this.callbacks.length) {
      return;
    }
    this.callbacks[index] = null;
    this.callbacksCount -= 1;
  }
};
var scheduler = new Scheduler();
var AnimationFrame = class _AnimationFrame {
  static create() {
    return new _AnimationFrame();
  }
  static request(fn) {
    return scheduler.request(fn);
  }
  static cancel(id) {
    return scheduler.cancel(id);
  }
  currentId = EMPTY2;
  /**
   * Executes `fn` after `delay`, clearing any previously scheduled call.
   */
  request(fn) {
    this.cancel();
    this.currentId = scheduler.request(() => {
      this.currentId = EMPTY2;
      fn();
    });
  }
  cancel = () => {
    if (this.currentId !== EMPTY2) {
      scheduler.cancel(this.currentId);
      this.currentId = EMPTY2;
    }
  };
  disposeEffect = () => {
    return this.cancel;
  };
};
function useAnimationFrame() {
  const timeout = useRefWithInit(AnimationFrame.create).current;
  useOnMount(timeout.disposeEffect);
  return timeout;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/resolveRef.js
function resolveRef(maybeRef) {
  if (maybeRef == null) {
    return maybeRef;
  }
  return "current" in maybeRef ? maybeRef.current : maybeRef;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/stateAttributesMapping.js
var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) {
  TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style";
  TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style";
  return TransitionStatusDataAttributes2;
})({});
var STARTING_HOOK = {
  [TransitionStatusDataAttributes.startingStyle]: ""
};
var ENDING_HOOK = {
  [TransitionStatusDataAttributes.endingStyle]: ""
};
var transitionStatusMapping = {
  transitionStatus(value) {
    if (value === "starting") {
      return STARTING_HOOK;
    }
    if (value === "ending") {
      return ENDING_HOOK;
    }
    return null;
  }
};

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useAnimationsFinished.js
function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {
  const frame = useAnimationFrame();
  return useStableCallback((fnToExecute, signal = null) => {
    frame.cancel();
    function done() {
      ReactDOM.flushSync(fnToExecute);
    }
    const element = resolveRef(elementOrRef);
    if (element == null) {
      return;
    }
    const resolvedElement = element;
    if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
      fnToExecute();
    } else {
      let execWaitForStartingStyleRemoved = function() {
        const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;
        if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
          frame.request(exec);
          return;
        }
        const attributeObserver = new MutationObserver(() => {
          if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
            attributeObserver.disconnect();
            exec();
          }
        });
        attributeObserver.observe(resolvedElement, {
          attributes: true,
          attributeFilter: [startingStyleAttribute]
        });
        signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
          once: true
        });
      }, exec = function() {
        Promise.all(resolvedElement.getAnimations().map((anim) => anim.finished)).then(() => {
          if (signal?.aborted) {
            return;
          }
          done();
        }).catch(() => {
          const currentAnimations = resolvedElement.getAnimations();
          if (treatAbortedAsFinished) {
            if (signal?.aborted) {
              return;
            }
            done();
          } else if (currentAnimations.length > 0 && currentAnimations.some((anim) => anim.pending || anim.playState !== "finished")) {
            exec();
          }
        });
      };
      if (waitForStartingStyleRemoved) {
        execWaitForStartingStyleRemoved();
        return;
      }
      frame.request(exec);
    }
  });
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useTransitionStatus.js
var React14 = __toESM(require_react(), 1);
function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {
  const [transitionStatus, setTransitionStatus] = React14.useState(open && enableIdleState ? "idle" : void 0);
  const [mounted, setMounted] = React14.useState(open);
  if (open && !mounted) {
    setMounted(true);
    setTransitionStatus("starting");
  }
  if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) {
    setTransitionStatus("ending");
  }
  if (!open && !mounted && transitionStatus === "ending") {
    setTransitionStatus(void 0);
  }
  useIsoLayoutEffect(() => {
    if (!open && mounted && transitionStatus !== "ending" && deferEndingState) {
      const frame = AnimationFrame.request(() => {
        setTransitionStatus("ending");
      });
      return () => {
        AnimationFrame.cancel(frame);
      };
    }
    return void 0;
  }, [open, mounted, transitionStatus, deferEndingState]);
  useIsoLayoutEffect(() => {
    if (!open || enableIdleState) {
      return void 0;
    }
    const frame = AnimationFrame.request(() => {
      setTransitionStatus(void 0);
    });
    return () => {
      AnimationFrame.cancel(frame);
    };
  }, [enableIdleState, open]);
  useIsoLayoutEffect(() => {
    if (!open || !enableIdleState) {
      return void 0;
    }
    if (open && mounted && transitionStatus !== "idle") {
      setTransitionStatus("starting");
    }
    const frame = AnimationFrame.request(() => {
      setTransitionStatus("idle");
    });
    return () => {
      AnimationFrame.cancel(frame);
    };
  }, [enableIdleState, open, mounted, setTransitionStatus, transitionStatus]);
  return React14.useMemo(() => ({
    mounted,
    setMounted,
    transitionStatus
  }), [mounted, transitionStatus]);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/list/useCompositeListItem.js
var React15 = __toESM(require_react(), 1);
var IndexGuessBehavior = /* @__PURE__ */ (function(IndexGuessBehavior2) {
  IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None";
  IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder";
  return IndexGuessBehavior2;
})({});
function useCompositeListItem(params = {}) {
  const {
    label,
    metadata,
    textRef,
    indexGuessBehavior,
    index: externalIndex
  } = params;
  const {
    register: register6,
    unregister,
    subscribeMapChange,
    elementsRef,
    labelsRef,
    nextIndexRef
  } = useCompositeListContext();
  const indexRef = React15.useRef(-1);
  const [index, setIndex] = React15.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
    if (indexRef.current === -1) {
      const newIndex = nextIndexRef.current;
      nextIndexRef.current += 1;
      indexRef.current = newIndex;
    }
    return indexRef.current;
  } : -1));
  const componentRef = React15.useRef(null);
  const ref = React15.useCallback((node) => {
    componentRef.current = node;
    if (index !== -1 && node !== null) {
      elementsRef.current[index] = node;
      if (labelsRef) {
        const isLabelDefined = label !== void 0;
        labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
      }
    }
  }, [index, elementsRef, labelsRef, label, textRef]);
  useIsoLayoutEffect(() => {
    if (externalIndex != null) {
      return void 0;
    }
    const node = componentRef.current;
    if (node) {
      register6(node, metadata);
      return () => {
        unregister(node);
      };
    }
    return void 0;
  }, [externalIndex, register6, unregister, metadata]);
  useIsoLayoutEffect(() => {
    if (externalIndex != null) {
      return void 0;
    }
    return subscribeMapChange((map) => {
      const i2 = componentRef.current ? map.get(componentRef.current)?.index : null;
      if (i2 != null) {
        setIndex(i2);
      }
    });
  }, [externalIndex, subscribeMapChange, setIndex]);
  return React15.useMemo(() => ({
    ref,
    index
  }), [index, ref]);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/isElementDisabled.js
function isElementDisabled(element) {
  return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-button/useButton.js
var React18 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
function hasWindow() {
  return typeof window !== "undefined";
}
function getWindow(node) {
  var _node$ownerDocument;
  return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
}
function isHTMLElement(value) {
  if (!hasWindow()) {
    return false;
  }
  return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
}
function isShadowRoot(value) {
  if (!hasWindow() || typeof ShadowRoot === "undefined") {
    return false;
  }
  return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
}
function getComputedStyle2(element) {
  return getWindow(element).getComputedStyle(element);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/error.js
var set2;
if (true) {
  set2 = /* @__PURE__ */ new Set();
}
function error(...messages) {
  if (true) {
    const messageKey = messages.join(" ");
    if (!set2.has(messageKey)) {
      set2.add(messageKey);
      console.error(`Base UI: ${messageKey}`);
    }
  }
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/CompositeRootContext.js
var React16 = __toESM(require_react(), 1);
var CompositeRootContext = /* @__PURE__ */ React16.createContext(void 0);
if (true) CompositeRootContext.displayName = "CompositeRootContext";
function useCompositeRootContext(optional = false) {
  const context = React16.useContext(CompositeRootContext);
  if (context === void 0 && !optional) {
    throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
  }
  return context;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js
var React17 = __toESM(require_react(), 1);
function useFocusableWhenDisabled(parameters) {
  const {
    focusableWhenDisabled,
    disabled: disabled2,
    composite = false,
    tabIndex: tabIndexProp = 0,
    isNativeButton
  } = parameters;
  const isFocusableComposite = composite && focusableWhenDisabled !== false;
  const isNonFocusableComposite = composite && focusableWhenDisabled === false;
  const props = React17.useMemo(() => {
    const additionalProps = {
      // allow Tabbing away from focusableWhenDisabled elements
      onKeyDown(event) {
        if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
          event.preventDefault();
        }
      }
    };
    if (!composite) {
      additionalProps.tabIndex = tabIndexProp;
      if (!isNativeButton && disabled2) {
        additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1;
      }
    }
    if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) {
      additionalProps["aria-disabled"] = disabled2;
    }
    if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) {
      additionalProps.disabled = disabled2;
    }
    return additionalProps;
  }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]);
  return {
    props
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-button/useButton.js
function useButton(parameters = {}) {
  const {
    disabled: disabled2 = false,
    focusableWhenDisabled,
    tabIndex = 0,
    native: isNativeButton = true,
    composite: compositeProp
  } = parameters;
  const elementRef = React18.useRef(null);
  const compositeRootContext = useCompositeRootContext(true);
  const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
  const {
    props: focusableWhenDisabledProps
  } = useFocusableWhenDisabled({
    focusableWhenDisabled,
    disabled: disabled2,
    composite: isCompositeItem,
    tabIndex,
    isNativeButton
  });
  if (true) {
    React18.useEffect(() => {
      if (!elementRef.current) {
        return;
      }
      const isButtonTag = isButtonElement(elementRef.current);
      if (isNativeButton) {
        if (!isButtonTag) {
          const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
          const message2 = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`.";
          error(`${message2}${ownerStackMessage}`);
        }
      } else if (isButtonTag) {
        const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
        const message2 = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`.";
        error(`${message2}${ownerStackMessage}`);
      }
    }, [isNativeButton]);
  }
  const updateDisabled = React18.useCallback(() => {
    const element = elementRef.current;
    if (!isButtonElement(element)) {
      return;
    }
    if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) {
      element.disabled = false;
    }
  }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
  useIsoLayoutEffect(updateDisabled, [updateDisabled]);
  const getButtonProps = React18.useCallback((externalProps = {}) => {
    const {
      onClick: externalOnClick,
      onMouseDown: externalOnMouseDown,
      onKeyUp: externalOnKeyUp,
      onKeyDown: externalOnKeyDown,
      onPointerDown: externalOnPointerDown,
      ...otherExternalProps
    } = externalProps;
    const type = isNativeButton ? "button" : void 0;
    return mergeProps({
      type,
      onClick(event) {
        if (disabled2) {
          event.preventDefault();
          return;
        }
        externalOnClick?.(event);
      },
      onMouseDown(event) {
        if (!disabled2) {
          externalOnMouseDown?.(event);
        }
      },
      onKeyDown(event) {
        if (disabled2) {
          return;
        }
        makeEventPreventable(event);
        externalOnKeyDown?.(event);
        if (event.baseUIHandlerPrevented) {
          return;
        }
        const isCurrentTarget = event.target === event.currentTarget;
        const currentTarget = event.currentTarget;
        const isButton2 = isButtonElement(currentTarget);
        const isLink = !isNativeButton && isValidLinkElement(currentTarget);
        const shouldClick = isCurrentTarget && (isNativeButton ? isButton2 : !isLink);
        const isEnterKey = event.key === "Enter";
        const isSpaceKey = event.key === " ";
        const role = currentTarget.getAttribute("role");
        const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell";
        if (isCurrentTarget && isCompositeItem && isSpaceKey) {
          if (event.defaultPrevented && isTextNavigationRole) {
            return;
          }
          event.preventDefault();
          if (isLink || isNativeButton && isButton2) {
            currentTarget.click();
            event.preventBaseUIHandler();
          } else if (shouldClick) {
            externalOnClick?.(event);
            event.preventBaseUIHandler();
          }
          return;
        }
        if (shouldClick) {
          if (!isNativeButton && (isSpaceKey || isEnterKey)) {
            event.preventDefault();
          }
          if (!isNativeButton && isEnterKey) {
            externalOnClick?.(event);
          }
        }
      },
      onKeyUp(event) {
        if (disabled2) {
          return;
        }
        makeEventPreventable(event);
        externalOnKeyUp?.(event);
        if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") {
          event.preventDefault();
          return;
        }
        if (event.baseUIHandlerPrevented) {
          return;
        }
        if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") {
          externalOnClick?.(event);
        }
      },
      onPointerDown(event) {
        if (disabled2) {
          event.preventDefault();
          return;
        }
        externalOnPointerDown?.(event);
      }
    }, !isNativeButton ? {
      role: "button"
    } : void 0, focusableWhenDisabledProps, otherExternalProps);
  }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]);
  const buttonRef = useStableCallback((element) => {
    elementRef.current = element;
    updateDisabled();
  });
  return {
    getButtonProps,
    buttonRef
  };
}
function isButtonElement(elem) {
  return isHTMLElement(elem) && elem.tagName === "BUTTON";
}
function isValidLinkElement(elem) {
  return Boolean(elem?.tagName === "A" && elem?.href);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js
var ARROW_LEFT = "ArrowLeft";
var ARROW_RIGHT = "ArrowRight";
var ARROW_UP = "ArrowUp";
var ARROW_DOWN = "ArrowDown";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js
function activeElement(doc) {
  let element = doc.activeElement;
  while (element?.shadowRoot?.activeElement != null) {
    element = element.shadowRoot.activeElement;
  }
  return element;
}
function contains(parent, child) {
  if (!parent || !child) {
    return false;
  }
  const rootNode = child.getRootNode?.();
  if (parent.contains(child)) {
    return true;
  }
  if (rootNode && isShadowRoot(rootNode)) {
    let next = child;
    while (next) {
      if (parent === next) {
        return true;
      }
      next = next.parentNode || next.host;
    }
  }
  return false;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/event.js
function stopEvent(event) {
  event.preventDefault();
  event.stopPropagation();
}

// ../../../node_modules/.pnpm/@floating-ui+utils@0.2.11/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
var round = Math.round;
var floor = Math.floor;

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js
function isDifferentGridRow(index, cols, prevRow) {
  return Math.floor(index / cols) !== prevRow;
}
function isIndexOutOfListBounds(listRef, index) {
  return index < 0 || index >= listRef.current.length;
}
function getMinListIndex(listRef, disabledIndices) {
  return findNonDisabledListIndex(listRef, {
    disabledIndices
  });
}
function getMaxListIndex(listRef, disabledIndices) {
  return findNonDisabledListIndex(listRef, {
    decrement: true,
    startingIndex: listRef.current.length,
    disabledIndices
  });
}
function findNonDisabledListIndex(listRef, {
  startingIndex = -1,
  decrement = false,
  disabledIndices,
  amount = 1
} = {}) {
  let index = startingIndex;
  do {
    index += decrement ? -amount : amount;
  } while (index >= 0 && index <= listRef.current.length - 1 && isListIndexDisabled(listRef, index, disabledIndices));
  return index;
}
function getGridNavigatedIndex(listRef, {
  event,
  orientation,
  loopFocus,
  rtl,
  cols,
  disabledIndices,
  minIndex,
  maxIndex,
  prevIndex,
  stopEvent: stop = false
}) {
  let nextIndex = prevIndex;
  let verticalDirection;
  if (event.key === ARROW_UP) {
    verticalDirection = "up";
  } else if (event.key === ARROW_DOWN) {
    verticalDirection = "down";
  }
  if (verticalDirection) {
    const rows = [];
    const rowIndexMap = [];
    let hasRoleRow = false;
    let visibleItemCount = 0;
    {
      let currentRowEl = null;
      let currentRowIndex = -1;
      listRef.current.forEach((el, idx) => {
        if (el == null) {
          return;
        }
        visibleItemCount += 1;
        const rowEl = el.closest('[role="row"]');
        if (rowEl) {
          hasRoleRow = true;
        }
        if (rowEl !== currentRowEl || currentRowIndex === -1) {
          currentRowEl = rowEl;
          currentRowIndex += 1;
          rows[currentRowIndex] = [];
        }
        rows[currentRowIndex].push(idx);
        rowIndexMap[idx] = currentRowIndex;
      });
    }
    let hasDomRows = false;
    let inferredDomCols = 0;
    if (hasRoleRow) {
      for (const row of rows) {
        const rowLength = row.length;
        if (rowLength > inferredDomCols) {
          inferredDomCols = rowLength;
        }
        if (rowLength !== cols) {
          hasDomRows = true;
        }
      }
    }
    const hasVirtualizedGaps = hasDomRows && visibleItemCount < listRef.current.length;
    const verticalCols = inferredDomCols || cols;
    const navigateVertically = (direction) => {
      if (!hasDomRows || prevIndex === -1) {
        return void 0;
      }
      const currentRow = rowIndexMap[prevIndex];
      if (currentRow == null) {
        return void 0;
      }
      const colInRow = rows[currentRow].indexOf(prevIndex);
      const step = direction === "up" ? -1 : 1;
      for (let nextRow = currentRow + step, i2 = 0; i2 < rows.length; i2 += 1, nextRow += step) {
        if (nextRow < 0 || nextRow >= rows.length) {
          if (!loopFocus || hasVirtualizedGaps) {
            return void 0;
          }
          nextRow = nextRow < 0 ? rows.length - 1 : 0;
        }
        const targetRow = rows[nextRow];
        for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {
          const candidate = targetRow[col];
          if (!isListIndexDisabled(listRef, candidate, disabledIndices)) {
            return candidate;
          }
        }
      }
      return void 0;
    };
    const navigateVerticallyWithInferredRows = (direction) => {
      if (!hasVirtualizedGaps || prevIndex === -1) {
        return void 0;
      }
      const colInRow = prevIndex % verticalCols;
      const rowStep = direction === "up" ? -verticalCols : verticalCols;
      const lastRowStart = maxIndex - maxIndex % verticalCols;
      const rowCount = floor(maxIndex / verticalCols) + 1;
      for (let rowStart = prevIndex - colInRow + rowStep, i2 = 0; i2 < rowCount; i2 += 1, rowStart += rowStep) {
        if (rowStart < 0 || rowStart > maxIndex) {
          if (!loopFocus) {
            return void 0;
          }
          rowStart = rowStart < 0 ? lastRowStart : 0;
        }
        const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);
        for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {
          if (!isListIndexDisabled(listRef, candidate, disabledIndices)) {
            return candidate;
          }
        }
      }
      return void 0;
    };
    if (stop) {
      stopEvent(event);
    }
    const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);
    if (verticalCandidate !== void 0) {
      nextIndex = verticalCandidate;
    } else if (prevIndex === -1) {
      nextIndex = verticalDirection === "up" ? maxIndex : minIndex;
    } else {
      nextIndex = findNonDisabledListIndex(listRef, {
        startingIndex: prevIndex,
        amount: verticalCols,
        decrement: verticalDirection === "up",
        disabledIndices
      });
      if (loopFocus) {
        if (verticalDirection === "up" && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {
          const col = prevIndex % verticalCols;
          const maxCol = maxIndex % verticalCols;
          const offset = maxIndex - (maxCol - col);
          if (maxCol === col) {
            nextIndex = maxIndex;
          } else {
            nextIndex = maxCol > col ? offset : offset - verticalCols;
          }
        }
        if (verticalDirection === "down" && prevIndex + verticalCols > maxIndex) {
          nextIndex = findNonDisabledListIndex(listRef, {
            startingIndex: prevIndex % verticalCols - verticalCols,
            amount: verticalCols,
            disabledIndices
          });
        }
      }
    }
    if (isIndexOutOfListBounds(listRef, nextIndex)) {
      nextIndex = prevIndex;
    }
  }
  if (orientation === "both") {
    const prevRow = floor(prevIndex / cols);
    if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {
      if (stop) {
        stopEvent(event);
      }
      if (prevIndex % cols !== cols - 1) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex,
          disabledIndices
        });
        if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
          nextIndex = findNonDisabledListIndex(listRef, {
            startingIndex: prevIndex - prevIndex % cols - 1,
            disabledIndices
          });
        }
      } else if (loopFocus) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex - prevIndex % cols - 1,
          disabledIndices
        });
      }
      if (isDifferentGridRow(nextIndex, cols, prevRow)) {
        nextIndex = prevIndex;
      }
    }
    if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {
      if (stop) {
        stopEvent(event);
      }
      if (prevIndex % cols !== 0) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex,
          decrement: true,
          disabledIndices
        });
        if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
          nextIndex = findNonDisabledListIndex(listRef, {
            startingIndex: prevIndex + (cols - prevIndex % cols),
            decrement: true,
            disabledIndices
          });
        }
      } else if (loopFocus) {
        nextIndex = findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex + (cols - prevIndex % cols),
          decrement: true,
          disabledIndices
        });
      }
      if (isDifferentGridRow(nextIndex, cols, prevRow)) {
        nextIndex = prevIndex;
      }
    }
    const lastRow = floor(maxIndex / cols) === prevRow;
    if (isIndexOutOfListBounds(listRef, nextIndex)) {
      if (loopFocus && lastRow) {
        nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(listRef, {
          startingIndex: prevIndex - prevIndex % cols - 1,
          disabledIndices
        });
      } else {
        nextIndex = prevIndex;
      }
    }
  }
  return nextIndex;
}
function createGridCellMap(sizes, cols, dense) {
  const cellMap = [];
  let startIndex = 0;
  sizes.forEach(({
    width,
    height
  }, index) => {
    if (width > cols) {
      if (true) {
        throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);
      }
    }
    let itemPlaced = false;
    if (dense) {
      startIndex = 0;
    }
    while (!itemPlaced) {
      const targetCells = [];
      for (let i2 = 0; i2 < width; i2 += 1) {
        for (let j2 = 0; j2 < height; j2 += 1) {
          targetCells.push(startIndex + i2 + j2 * cols);
        }
      }
      if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) {
        targetCells.forEach((cell) => {
          cellMap[cell] = index;
        });
        itemPlaced = true;
      } else {
        startIndex += 1;
      }
    }
  });
  return [...cellMap];
}
function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {
  if (index === -1) {
    return -1;
  }
  const firstCellIndex = cellMap.indexOf(index);
  const sizeItem = sizes[index];
  switch (corner) {
    case "tl":
      return firstCellIndex;
    case "tr":
      if (!sizeItem) {
        return firstCellIndex;
      }
      return firstCellIndex + sizeItem.width - 1;
    case "bl":
      if (!sizeItem) {
        return firstCellIndex;
      }
      return firstCellIndex + (sizeItem.height - 1) * cols;
    case "br":
      return cellMap.lastIndexOf(index);
    default:
      return -1;
  }
}
function getGridCellIndices(indices, cellMap) {
  return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);
}
function isListIndexDisabled(listRef, index, disabledIndices) {
  const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;
  if (isExplicitlyDisabled) {
    return true;
  }
  const element = listRef.current[index];
  if (!element) {
    return false;
  }
  if (!isElementVisible(element)) {
    return true;
  }
  return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
}
function isElementVisible(element) {
  return getComputedStyle2(element).display !== "none";
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/owner.js
function ownerDocument(node) {
  return node?.ownerDocument || document;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/composite.js
var ARROW_UP2 = "ArrowUp";
var ARROW_DOWN2 = "ArrowDown";
var ARROW_LEFT2 = "ArrowLeft";
var ARROW_RIGHT2 = "ArrowRight";
var HOME = "Home";
var END = "End";
var HORIZONTAL_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT2, ARROW_RIGHT2]);
var HORIZONTAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT2, ARROW_RIGHT2, HOME, END]);
var VERTICAL_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2]);
var VERTICAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2, HOME, END]);
var ARROW_KEYS = /* @__PURE__ */ new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);
var ALL_KEYS = /* @__PURE__ */ new Set([...ARROW_KEYS, HOME, END]);
var SHIFT = "Shift";
var CONTROL = "Control";
var ALT = "Alt";
var META = "Meta";
var MODIFIER_KEYS = /* @__PURE__ */ new Set([SHIFT, CONTROL, ALT, META]);
function isInputElement(element) {
  return isHTMLElement(element) && element.tagName === "INPUT";
}
function isNativeInput(element) {
  if (isInputElement(element) && element.selectionStart != null) {
    return true;
  }
  if (isHTMLElement(element) && element.tagName === "TEXTAREA") {
    return true;
  }
  return false;
}
function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) {
  if (!scrollContainer || !element || !element.scrollTo) {
    return;
  }
  let targetX = scrollContainer.scrollLeft;
  let targetY = scrollContainer.scrollTop;
  const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth;
  const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight;
  if (isOverflowingX && orientation !== "vertical") {
    const elementOffsetLeft = getOffset(scrollContainer, element, "left");
    const containerStyles = getStyles(scrollContainer);
    const elementStyles = getStyles(element);
    if (direction === "ltr") {
      if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
        targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
      } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
        targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
      }
    }
    if (direction === "rtl") {
      if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
        targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
      } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
        targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
      }
    }
  }
  if (isOverflowingY && orientation !== "horizontal") {
    const elementOffsetTop = getOffset(scrollContainer, element, "top");
    const containerStyles = getStyles(scrollContainer);
    const elementStyles = getStyles(element);
    if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) {
      targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop;
    } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) {
      targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom;
    }
  }
  scrollContainer.scrollTo({
    left: targetX,
    top: targetY,
    behavior: "auto"
  });
}
function getOffset(ancestor, element, side) {
  const propName = side === "left" ? "offsetLeft" : "offsetTop";
  let result = 0;
  while (element.offsetParent) {
    result += element[propName];
    if (element.offsetParent === ancestor) {
      break;
    }
    element = element.offsetParent;
  }
  return result;
}
function getStyles(element) {
  const styles = getComputedStyle(element);
  return {
    scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0,
    scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0,
    scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0,
    scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0,
    scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0,
    scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0,
    scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0,
    scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/useOpenChangeComplete.js
var React19 = __toESM(require_react(), 1);
function useOpenChangeComplete(parameters) {
  const {
    enabled = true,
    open,
    ref,
    onComplete: onCompleteParam
  } = parameters;
  const onComplete = useStableCallback(onCompleteParam);
  const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false);
  React19.useEffect(() => {
    if (!enabled) {
      return void 0;
    }
    const abortController = new AbortController();
    runOnceAnimationsFinish(onComplete, abortController.signal);
    return () => {
      abortController.abort();
    };
  }, [enabled, open, onComplete, runOnceAnimationsFinish]);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useForcedRerendering.js
var React20 = __toESM(require_react(), 1);
function useForcedRerendering() {
  const [, setState] = React20.useState({});
  return React20.useCallback(() => {
    setState({});
  }, []);
}

// ../../../node_modules/.pnpm/@base-ui+utils@0.2.6_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/inertValue.js
function inertValue(value) {
  if (isReactVersionAtLeast(19)) {
    return value;
  }
  return value ? "true" : void 0;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/item/useCompositeItem.js
var React21 = __toESM(require_react(), 1);
function useCompositeItem(params = {}) {
  const {
    highlightItemOnHover,
    highlightedIndex,
    onHighlightedIndexChange
  } = useCompositeRootContext();
  const {
    ref,
    index
  } = useCompositeListItem(params);
  const isHighlighted = highlightedIndex === index;
  const itemRef = React21.useRef(null);
  const mergedRef = useMergedRefs(ref, itemRef);
  const compositeProps = React21.useMemo(() => ({
    tabIndex: isHighlighted ? 0 : -1,
    onFocus() {
      onHighlightedIndexChange(index);
    },
    onMouseMove() {
      const item = itemRef.current;
      if (!highlightItemOnHover || !item) {
        return;
      }
      const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true";
      if (!isHighlighted && !disabled2) {
        item.focus();
      }
    }
  }), [isHighlighted, onHighlightedIndexChange, index, highlightItemOnHover]);
  return {
    compositeProps,
    compositeRef: mergedRef,
    index
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/utils/getCssDimensions.js
function getCssDimensions(element) {
  const css = getComputedStyle2(element);
  let width = parseFloat(css.width) || 0;
  let height = parseFloat(css.height) || 0;
  const hasOffset = isHTMLElement(element);
  const offsetWidth = hasOffset ? element.offsetWidth : width;
  const offsetHeight = hasOffset ? element.offsetHeight : height;
  const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
  if (shouldFallback) {
    width = offsetWidth;
    height = offsetHeight;
  }
  return {
    width,
    height
  };
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/csp-provider/CSPContext.js
var React22 = __toESM(require_react(), 1);
var CSPContext = /* @__PURE__ */ React22.createContext(void 0);
if (true) CSPContext.displayName = "CSPContext";
var DEFAULT_CSP_CONTEXT_VALUE = {
  disableStyleElements: false
};
function useCSPContext() {
  return React22.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/CompositeRoot.js
var React24 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/useCompositeRoot.js
var React23 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/constants.js
var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/useCompositeRoot.js
var EMPTY_ARRAY2 = [];
function useCompositeRoot(params) {
  const {
    itemSizes,
    cols = 1,
    loopFocus = true,
    dense = false,
    orientation = "both",
    direction,
    highlightedIndex: externalHighlightedIndex,
    onHighlightedIndexChange: externalSetHighlightedIndex,
    rootRef: externalRef,
    enableHomeAndEndKeys = false,
    stopEventPropagation = false,
    disabledIndices,
    modifierKeys = EMPTY_ARRAY2
  } = params;
  const [internalHighlightedIndex, internalSetHighlightedIndex] = React23.useState(0);
  const isGrid2 = cols > 1;
  const rootRef = React23.useRef(null);
  const mergedRef = useMergedRefs(rootRef, externalRef);
  const elementsRef = React23.useRef([]);
  const hasSetDefaultIndexRef = React23.useRef(false);
  const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
  const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
    (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
    if (shouldScrollIntoView) {
      const newActiveItem = elementsRef.current[index];
      scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
    }
  });
  const onMapChange = useStableCallback((map) => {
    if (map.size === 0 || hasSetDefaultIndexRef.current) {
      return;
    }
    hasSetDefaultIndexRef.current = true;
    const sortedElements = Array.from(map.keys());
    const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
    const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
    if (activeIndex !== -1) {
      onHighlightedIndexChange(activeIndex);
    }
    scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
  });
  const props = React23.useMemo(() => ({
    "aria-orientation": orientation === "both" ? void 0 : orientation,
    ref: mergedRef,
    onFocus(event) {
      const element = rootRef.current;
      if (!element || !isNativeInput(event.target)) {
        return;
      }
      event.target.setSelectionRange(0, event.target.value.length ?? 0);
    },
    onKeyDown(event) {
      const RELEVANT_KEYS = enableHomeAndEndKeys ? ALL_KEYS : ARROW_KEYS;
      if (!RELEVANT_KEYS.has(event.key)) {
        return;
      }
      if (isModifierKeySet(event, modifierKeys)) {
        return;
      }
      const element = rootRef.current;
      if (!element) {
        return;
      }
      const isRtl = direction === "rtl";
      const horizontalForwardKey = isRtl ? ARROW_LEFT2 : ARROW_RIGHT2;
      const forwardKey = {
        horizontal: horizontalForwardKey,
        vertical: ARROW_DOWN2,
        both: horizontalForwardKey
      }[orientation];
      const horizontalBackwardKey = isRtl ? ARROW_RIGHT2 : ARROW_LEFT2;
      const backwardKey = {
        horizontal: horizontalBackwardKey,
        vertical: ARROW_UP2,
        both: horizontalBackwardKey
      }[orientation];
      if (isNativeInput(event.target) && !isElementDisabled(event.target)) {
        const selectionStart = event.target.selectionStart;
        const selectionEnd = event.target.selectionEnd;
        const textContent = event.target.value ?? "";
        if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
          return;
        }
        if (event.key !== backwardKey && selectionStart < textContent.length) {
          return;
        }
        if (event.key !== forwardKey && selectionStart > 0) {
          return;
        }
      }
      let nextIndex = highlightedIndex;
      const minIndex = getMinListIndex(elementsRef, disabledIndices);
      const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
      if (isGrid2) {
        const sizes = itemSizes || Array.from({
          length: elementsRef.current.length
        }, () => ({
          width: 1,
          height: 1
        }));
        const cellMap = createGridCellMap(sizes, cols, dense);
        const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef, index, disabledIndices));
        const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef, index, disabledIndices) ? cellIndex : foundIndex, -1);
        nextIndex = cellMap[getGridNavigatedIndex({
          current: cellMap.map((itemIndex) => itemIndex ? elementsRef.current[itemIndex] : null)
        }, {
          event,
          orientation,
          loopFocus,
          cols,
          // treat undefined (empty grid spaces) as disabled indices so we
          // don't end up in them
          disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef, index) ? index : void 0), void 0], cellMap),
          minIndex: minGridIndex,
          maxIndex: maxGridIndex,
          prevIndex: getGridCellIndexOfCorner(
            highlightedIndex > maxIndex ? minIndex : highlightedIndex,
            sizes,
            cellMap,
            cols,
            // use a corner matching the edge closest to the direction we're
            // moving in so we don't end up in the same item. Prefer
            // top/left over bottom/right.
            // eslint-disable-next-line no-nested-ternary
            event.key === ARROW_DOWN2 ? "bl" : event.key === ARROW_RIGHT2 ? "tr" : "tl"
          ),
          rtl: isRtl
        })];
      }
      const forwardKeys = {
        horizontal: [horizontalForwardKey],
        vertical: [ARROW_DOWN2],
        both: [horizontalForwardKey, ARROW_DOWN2]
      }[orientation];
      const backwardKeys = {
        horizontal: [horizontalBackwardKey],
        vertical: [ARROW_UP2],
        both: [horizontalBackwardKey, ARROW_UP2]
      }[orientation];
      const preventedKeys = isGrid2 ? RELEVANT_KEYS : {
        horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
        vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
        both: RELEVANT_KEYS
      }[orientation];
      if (enableHomeAndEndKeys) {
        if (event.key === HOME) {
          nextIndex = minIndex;
        } else if (event.key === END) {
          nextIndex = maxIndex;
        }
      }
      if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {
        if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
          nextIndex = minIndex;
        } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
          nextIndex = maxIndex;
        } else {
          nextIndex = findNonDisabledListIndex(elementsRef, {
            startingIndex: nextIndex,
            decrement: backwardKeys.includes(event.key),
            disabledIndices
          });
        }
      }
      if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef, nextIndex)) {
        if (stopEventPropagation) {
          event.stopPropagation();
        }
        if (preventedKeys.has(event.key)) {
          event.preventDefault();
        }
        onHighlightedIndexChange(nextIndex, true);
        queueMicrotask(() => {
          elementsRef.current[nextIndex]?.focus();
        });
      }
    }
  }), [cols, dense, direction, disabledIndices, elementsRef, enableHomeAndEndKeys, highlightedIndex, isGrid2, itemSizes, loopFocus, mergedRef, modifierKeys, onHighlightedIndexChange, orientation, stopEventPropagation]);
  return React23.useMemo(() => ({
    props,
    highlightedIndex,
    onHighlightedIndexChange,
    elementsRef,
    disabledIndices,
    onMapChange,
    relayKeyboardEvent: props.onKeyDown
  }), [props, highlightedIndex, onHighlightedIndexChange, elementsRef, disabledIndices, onMapChange]);
}
function isModifierKeySet(event, ignoredModifierKeys) {
  for (const key of MODIFIER_KEYS.values()) {
    if (ignoredModifierKeys.includes(key)) {
      continue;
    }
    if (event.getModifierState(key)) {
      return true;
    }
  }
  return false;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/composite/root/CompositeRoot.js
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
function CompositeRoot(componentProps) {
  const {
    render: render4,
    className,
    refs = EMPTY_ARRAY,
    props = EMPTY_ARRAY,
    state = EMPTY_OBJECT,
    stateAttributesMapping: stateAttributesMapping3,
    highlightedIndex: highlightedIndexProp,
    onHighlightedIndexChange: onHighlightedIndexChangeProp,
    orientation,
    dense,
    itemSizes,
    loopFocus,
    cols,
    enableHomeAndEndKeys,
    onMapChange: onMapChangeProp,
    stopEventPropagation = true,
    rootRef,
    disabledIndices,
    modifierKeys,
    highlightItemOnHover = false,
    tag = "div",
    ...elementProps
  } = componentProps;
  const direction = useDirection();
  const {
    props: defaultProps,
    highlightedIndex,
    onHighlightedIndexChange,
    elementsRef,
    onMapChange: onMapChangeUnwrapped,
    relayKeyboardEvent
  } = useCompositeRoot({
    itemSizes,
    cols,
    loopFocus,
    dense,
    orientation,
    highlightedIndex: highlightedIndexProp,
    onHighlightedIndexChange: onHighlightedIndexChangeProp,
    rootRef,
    stopEventPropagation,
    enableHomeAndEndKeys,
    direction,
    disabledIndices,
    modifierKeys
  });
  const element = useRenderElement(tag, componentProps, {
    state,
    ref: refs,
    props: [defaultProps, ...props, elementProps],
    stateAttributesMapping: stateAttributesMapping3
  });
  const contextValue = React24.useMemo(() => ({
    highlightedIndex,
    onHighlightedIndexChange,
    highlightItemOnHover,
    relayKeyboardEvent
  }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
  return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CompositeRootContext.Provider, {
    value: contextValue,
    children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(CompositeList, {
      elementsRef,
      onMapChange: (newMap) => {
        onMapChangeProp?.(newMap);
        onMapChangeUnwrapped(newMap);
      },
      children: element
    })
  });
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/index.parts.js
var index_parts_exports = {};
__export(index_parts_exports, {
  Indicator: () => TabsIndicator,
  List: () => TabsList,
  Panel: () => TabsPanel,
  Root: () => TabsRoot,
  Tab: () => TabsTab
});

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
var React26 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js
var React25 = __toESM(require_react(), 1);
var TabsRootContext = /* @__PURE__ */ React25.createContext(void 0);
if (true) TabsRootContext.displayName = "TabsRootContext";
function useTabsRootContext() {
  const context = React25.useContext(TabsRootContext);
  if (context === void 0) {
    throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64));
  }
  return context;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js
var TabsRootDataAttributes = /* @__PURE__ */ (function(TabsRootDataAttributes2) {
  TabsRootDataAttributes2["activationDirection"] = "data-activation-direction";
  TabsRootDataAttributes2["orientation"] = "data-orientation";
  return TabsRootDataAttributes2;
})({});

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js
var tabsStateAttributesMapping = {
  tabActivationDirection: (dir) => ({
    [TabsRootDataAttributes.activationDirection]: dir
  })
};

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
var TabsRoot = /* @__PURE__ */ React26.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
  const {
    className,
    defaultValue: defaultValueProp = 0,
    onValueChange: onValueChangeProp,
    orientation = "horizontal",
    render: render4,
    value: valueProp,
    ...elementProps
  } = componentProps;
  const direction = useDirection();
  const hasExplicitDefaultValueProp = Object.hasOwn(componentProps, "defaultValue");
  const tabPanelRefs = React26.useRef([]);
  const [mountedTabPanels, setMountedTabPanels] = React26.useState(() => /* @__PURE__ */ new Map());
  const [value, setValue] = useControlled({
    controlled: valueProp,
    default: defaultValueProp,
    name: "Tabs",
    state: "value"
  });
  const isControlled = valueProp !== void 0;
  const [tabMap, setTabMap] = React26.useState(() => /* @__PURE__ */ new Map());
  const [tabActivationDirection, setTabActivationDirection] = React26.useState("none");
  const onValueChange = useStableCallback((newValue, eventDetails) => {
    onValueChangeProp?.(newValue, eventDetails);
    if (eventDetails.isCanceled) {
      return;
    }
    setValue(newValue);
    setTabActivationDirection(eventDetails.activationDirection);
  });
  const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
    setMountedTabPanels((prev) => {
      if (prev.get(panelValue) === panelId) {
        return prev;
      }
      const next = new Map(prev);
      next.set(panelValue, panelId);
      return next;
    });
  });
  const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
    setMountedTabPanels((prev) => {
      if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) {
        return prev;
      }
      const next = new Map(prev);
      next.delete(panelValue);
      return next;
    });
  });
  const getTabPanelIdByValue = React26.useCallback((tabValue) => {
    return mountedTabPanels.get(tabValue);
  }, [mountedTabPanels]);
  const getTabIdByPanelValue = React26.useCallback((tabPanelValue) => {
    for (const tabMetadata of tabMap.values()) {
      if (tabPanelValue === tabMetadata?.value) {
        return tabMetadata?.id;
      }
    }
    return void 0;
  }, [tabMap]);
  const getTabElementBySelectedValue = React26.useCallback((selectedValue) => {
    if (selectedValue === void 0) {
      return null;
    }
    for (const [tabElement, tabMetadata] of tabMap.entries()) {
      if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) {
        return tabElement;
      }
    }
    return null;
  }, [tabMap]);
  const tabsContextValue = React26.useMemo(() => ({
    direction,
    getTabElementBySelectedValue,
    getTabIdByPanelValue,
    getTabPanelIdByValue,
    onValueChange,
    orientation,
    registerMountedTabPanel,
    setTabMap,
    unregisterMountedTabPanel,
    tabActivationDirection,
    value
  }), [direction, getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, unregisterMountedTabPanel, tabActivationDirection, value]);
  const selectedTabMetadata = React26.useMemo(() => {
    for (const tabMetadata of tabMap.values()) {
      if (tabMetadata != null && tabMetadata.value === value) {
        return tabMetadata;
      }
    }
    return void 0;
  }, [tabMap, value]);
  const firstEnabledTabValue = React26.useMemo(() => {
    for (const tabMetadata of tabMap.values()) {
      if (tabMetadata != null && !tabMetadata.disabled) {
        return tabMetadata.value;
      }
    }
    return void 0;
  }, [tabMap]);
  useIsoLayoutEffect(() => {
    if (isControlled || tabMap.size === 0) {
      return;
    }
    const selectionIsDisabled = selectedTabMetadata?.disabled;
    const selectionIsMissing = selectedTabMetadata == null && value !== null;
    const shouldHonorExplicitDefaultSelection = hasExplicitDefaultValueProp && selectionIsDisabled && value === defaultValueProp;
    if (shouldHonorExplicitDefaultSelection) {
      return;
    }
    if (!selectionIsDisabled && !selectionIsMissing) {
      return;
    }
    const fallbackValue = firstEnabledTabValue ?? null;
    if (value === fallbackValue) {
      return;
    }
    setValue(fallbackValue);
    setTabActivationDirection("none");
  }, [defaultValueProp, firstEnabledTabValue, hasExplicitDefaultValueProp, isControlled, selectedTabMetadata, setTabActivationDirection, setValue, tabMap, value]);
  const state = {
    orientation,
    tabActivationDirection
  };
  const element = useRenderElement("div", componentProps, {
    state,
    ref: forwardedRef,
    props: elementProps,
    stateAttributesMapping: tabsStateAttributesMapping
  });
  return /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(TabsRootContext.Provider, {
    value: tabsContextValue,
    children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(CompositeList, {
      elementsRef: tabPanelRefs,
      children: element
    })
  });
});
if (true) TabsRoot.displayName = "TabsRoot";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
var React28 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js
var React27 = __toESM(require_react(), 1);
var TabsListContext = /* @__PURE__ */ React27.createContext(void 0);
if (true) TabsListContext.displayName = "TabsListContext";
function useTabsListContext() {
  const context = React27.useContext(TabsListContext);
  if (context === void 0) {
    throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65));
  }
  return context;
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
var TabsTab = /* @__PURE__ */ React28.forwardRef(function TabsTab2(componentProps, forwardedRef) {
  const {
    className,
    disabled: disabled2 = false,
    render: render4,
    value,
    id: idProp,
    nativeButton = true,
    ...elementProps
  } = componentProps;
  const {
    value: activeTabValue,
    getTabPanelIdByValue,
    orientation
  } = useTabsRootContext();
  const {
    activateOnFocus,
    highlightedTabIndex,
    onTabActivation,
    registerTabResizeObserverElement,
    setHighlightedTabIndex,
    tabsListElement
  } = useTabsListContext();
  const id = useBaseUiId(idProp);
  const tabMetadata = React28.useMemo(() => ({
    disabled: disabled2,
    id,
    value
  }), [disabled2, id, value]);
  const {
    compositeProps,
    compositeRef,
    index
    // hook is used instead of the CompositeItem component
    // because the index is needed for Tab internals
  } = useCompositeItem({
    metadata: tabMetadata
  });
  const active = value === activeTabValue;
  const isNavigatingRef = React28.useRef(false);
  const tabElementRef = React28.useRef(null);
  React28.useEffect(() => {
    const tabElement = tabElementRef.current;
    if (!tabElement) {
      return void 0;
    }
    return registerTabResizeObserverElement(tabElement);
  }, [registerTabResizeObserverElement]);
  useIsoLayoutEffect(() => {
    if (isNavigatingRef.current) {
      isNavigatingRef.current = false;
      return;
    }
    if (!(active && index > -1 && highlightedTabIndex !== index)) {
      return;
    }
    const listElement = tabsListElement;
    if (listElement != null) {
      const activeEl = activeElement(ownerDocument(listElement));
      if (activeEl && contains(listElement, activeEl)) {
        return;
      }
    }
    if (!disabled2) {
      setHighlightedTabIndex(index);
    }
  }, [active, index, highlightedTabIndex, setHighlightedTabIndex, disabled2, tabsListElement]);
  const {
    getButtonProps,
    buttonRef
  } = useButton({
    disabled: disabled2,
    native: nativeButton,
    focusableWhenDisabled: true
  });
  const tabPanelId = getTabPanelIdByValue(value);
  const isPressingRef = React28.useRef(false);
  const isMainButtonRef = React28.useRef(false);
  function onClick(event) {
    if (active || disabled2) {
      return;
    }
    onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
      activationDirection: "none"
    }));
  }
  function onFocus(event) {
    if (active) {
      return;
    }
    if (index > -1 && !disabled2) {
      setHighlightedTabIndex(index);
    }
    if (disabled2) {
      return;
    }
    if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus
    isPressingRef.current && isMainButtonRef.current)) {
      onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
        activationDirection: "none"
      }));
    }
  }
  function onPointerDown(event) {
    if (active || disabled2) {
      return;
    }
    isPressingRef.current = true;
    function handlePointerUp() {
      isPressingRef.current = false;
      isMainButtonRef.current = false;
    }
    if (!event.button || event.button === 0) {
      isMainButtonRef.current = true;
      const doc = ownerDocument(event.currentTarget);
      doc.addEventListener("pointerup", handlePointerUp, {
        once: true
      });
    }
  }
  const state = {
    disabled: disabled2,
    active,
    orientation
  };
  const element = useRenderElement("button", componentProps, {
    state,
    ref: [forwardedRef, buttonRef, compositeRef, tabElementRef],
    props: [compositeProps, {
      role: "tab",
      "aria-controls": tabPanelId,
      "aria-selected": active,
      id,
      onClick,
      onFocus,
      onPointerDown,
      [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
      onKeyDownCapture() {
        isNavigatingRef.current = true;
      }
    }, elementProps, getButtonProps]
  });
  return element;
});
if (true) TabsTab.displayName = "TabsTab";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js
var React29 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/prehydrationScript.min.js
var script = '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();';

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicatorCssVars.js
var TabsIndicatorCssVars = /* @__PURE__ */ (function(TabsIndicatorCssVars2) {
  TabsIndicatorCssVars2["activeTabLeft"] = "--active-tab-left";
  TabsIndicatorCssVars2["activeTabRight"] = "--active-tab-right";
  TabsIndicatorCssVars2["activeTabTop"] = "--active-tab-top";
  TabsIndicatorCssVars2["activeTabBottom"] = "--active-tab-bottom";
  TabsIndicatorCssVars2["activeTabWidth"] = "--active-tab-width";
  TabsIndicatorCssVars2["activeTabHeight"] = "--active-tab-height";
  return TabsIndicatorCssVars2;
})({});

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js
var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
var stateAttributesMapping = {
  ...tabsStateAttributesMapping,
  activeTabPosition: () => null,
  activeTabSize: () => null
};
var TabsIndicator = /* @__PURE__ */ React29.forwardRef(function TabIndicator(componentProps, forwardedRef) {
  const {
    className,
    render: render4,
    renderBeforeHydration = false,
    ...elementProps
  } = componentProps;
  const {
    nonce
  } = useCSPContext();
  const {
    getTabElementBySelectedValue,
    orientation,
    tabActivationDirection,
    value
  } = useTabsRootContext();
  const {
    tabsListElement,
    registerIndicatorUpdateListener
  } = useTabsListContext();
  const [isMounted, setIsMounted] = React29.useState(false);
  useOnMount(() => setIsMounted(true));
  const rerender = useForcedRerendering();
  React29.useEffect(() => {
    return registerIndicatorUpdateListener(rerender);
  }, [registerIndicatorUpdateListener, rerender]);
  let left = 0;
  let right = 0;
  let top = 0;
  let bottom = 0;
  let width = 0;
  let height = 0;
  let isTabSelected = false;
  if (value != null && tabsListElement != null) {
    const activeTab = getTabElementBySelectedValue(value);
    isTabSelected = true;
    if (activeTab != null) {
      const {
        width: computedWidth,
        height: computedHeight
      } = getCssDimensions(activeTab);
      const {
        width: tabListWidth,
        height: tabListHeight
      } = getCssDimensions(tabsListElement);
      const tabRect = activeTab.getBoundingClientRect();
      const tabsListRect = tabsListElement.getBoundingClientRect();
      const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;
      const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;
      const hasNonZeroScale = Math.abs(scaleX) > Number.EPSILON && Math.abs(scaleY) > Number.EPSILON;
      if (hasNonZeroScale) {
        const tabLeftDelta = tabRect.left - tabsListRect.left;
        const tabTopDelta = tabRect.top - tabsListRect.top;
        left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
        top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
      } else {
        left = activeTab.offsetLeft;
        top = activeTab.offsetTop;
      }
      width = computedWidth;
      height = computedHeight;
      right = tabsListElement.scrollWidth - left - width;
      bottom = tabsListElement.scrollHeight - top - height;
    }
  }
  const activeTabPosition = React29.useMemo(() => isTabSelected ? {
    left,
    right,
    top,
    bottom
  } : null, [left, right, top, bottom, isTabSelected]);
  const activeTabSize = React29.useMemo(() => isTabSelected ? {
    width,
    height
  } : null, [width, height, isTabSelected]);
  const style = React29.useMemo(() => {
    if (!isTabSelected) {
      return void 0;
    }
    return {
      [TabsIndicatorCssVars.activeTabLeft]: `${left}px`,
      [TabsIndicatorCssVars.activeTabRight]: `${right}px`,
      [TabsIndicatorCssVars.activeTabTop]: `${top}px`,
      [TabsIndicatorCssVars.activeTabBottom]: `${bottom}px`,
      [TabsIndicatorCssVars.activeTabWidth]: `${width}px`,
      [TabsIndicatorCssVars.activeTabHeight]: `${height}px`
    };
  }, [left, right, top, bottom, width, height, isTabSelected]);
  const displayIndicator = isTabSelected && width > 0 && height > 0;
  const state = {
    orientation,
    activeTabPosition,
    activeTabSize,
    tabActivationDirection
  };
  const element = useRenderElement("span", componentProps, {
    state,
    ref: forwardedRef,
    props: [{
      role: "presentation",
      style,
      hidden: !displayIndicator
      // do not display the indicator before the layout is settled
    }, elementProps, {
      suppressHydrationWarning: true
    }],
    stateAttributesMapping
  });
  if (value == null) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React29.Fragment, {
    children: [element, !isMounted && renderBeforeHydration && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)("script", {
      nonce,
      dangerouslySetInnerHTML: {
        __html: script
      },
      suppressHydrationWarning: true
    })]
  });
});
if (true) TabsIndicator.displayName = "TabsIndicator";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
var React30 = __toESM(require_react(), 1);

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js
var TabsPanelDataAttributes = (function(TabsPanelDataAttributes2) {
  TabsPanelDataAttributes2["index"] = "data-index";
  TabsPanelDataAttributes2["activationDirection"] = "data-activation-direction";
  TabsPanelDataAttributes2["orientation"] = "data-orientation";
  TabsPanelDataAttributes2["hidden"] = "data-hidden";
  TabsPanelDataAttributes2[TabsPanelDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
  TabsPanelDataAttributes2[TabsPanelDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
  return TabsPanelDataAttributes2;
})({});

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
var stateAttributesMapping2 = {
  ...tabsStateAttributesMapping,
  ...transitionStatusMapping
};
var TabsPanel = /* @__PURE__ */ React30.forwardRef(function TabPanel(componentProps, forwardedRef) {
  const {
    className,
    value,
    render: render4,
    keepMounted = false,
    ...elementProps
  } = componentProps;
  const {
    value: selectedValue,
    getTabIdByPanelValue,
    orientation,
    tabActivationDirection,
    registerMountedTabPanel,
    unregisterMountedTabPanel
  } = useTabsRootContext();
  const id = useBaseUiId();
  const metadata = React30.useMemo(() => ({
    id,
    value
  }), [id, value]);
  const {
    ref: listItemRef,
    index
  } = useCompositeListItem({
    metadata
  });
  const open = value === selectedValue;
  const {
    mounted,
    transitionStatus,
    setMounted
  } = useTransitionStatus(open);
  const hidden = !mounted;
  const correspondingTabId = getTabIdByPanelValue(value);
  const state = {
    hidden,
    orientation,
    tabActivationDirection,
    transitionStatus
  };
  const panelRef = React30.useRef(null);
  const element = useRenderElement("div", componentProps, {
    state,
    ref: [forwardedRef, listItemRef, panelRef],
    props: [{
      "aria-labelledby": correspondingTabId,
      hidden,
      id,
      role: "tabpanel",
      tabIndex: open ? 0 : -1,
      inert: inertValue(!open),
      [TabsPanelDataAttributes.index]: index
    }, elementProps],
    stateAttributesMapping: stateAttributesMapping2
  });
  useOpenChangeComplete({
    open,
    ref: panelRef,
    onComplete() {
      if (!open) {
        setMounted(false);
      }
    }
  });
  useIsoLayoutEffect(() => {
    if (hidden && !keepMounted) {
      return void 0;
    }
    if (id == null) {
      return void 0;
    }
    registerMountedTabPanel(value, id);
    return () => {
      unregisterMountedTabPanel(value, id);
    };
  }, [hidden, keepMounted, value, id, registerMountedTabPanel, unregisterMountedTabPanel]);
  const shouldRender = keepMounted || mounted;
  if (!shouldRender) {
    return null;
  }
  return element;
});
if (true) TabsPanel.displayName = "TabsPanel";

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/tabs/list/TabsList.js
var React31 = __toESM(require_react(), 1);
var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
var TabsList = /* @__PURE__ */ React31.forwardRef(function TabsList2(componentProps, forwardedRef) {
  const {
    activateOnFocus = false,
    className,
    loopFocus = true,
    render: render4,
    ...elementProps
  } = componentProps;
  const {
    getTabElementBySelectedValue,
    onValueChange,
    orientation,
    value,
    setTabMap,
    tabActivationDirection
  } = useTabsRootContext();
  const [highlightedTabIndex, setHighlightedTabIndex] = React31.useState(0);
  const [tabsListElement, setTabsListElement] = React31.useState(null);
  const indicatorUpdateListenersRef = React31.useRef(/* @__PURE__ */ new Set());
  const tabResizeObserverElementsRef = React31.useRef(/* @__PURE__ */ new Set());
  const resizeObserverRef = React31.useRef(null);
  const notifyIndicatorUpdateListeners = useStableCallback(() => {
    indicatorUpdateListenersRef.current.forEach((listener) => {
      listener();
    });
  });
  React31.useEffect(() => {
    if (typeof ResizeObserver === "undefined") {
      return void 0;
    }
    const resizeObserver = new ResizeObserver(() => {
      if (!indicatorUpdateListenersRef.current.size) {
        return;
      }
      notifyIndicatorUpdateListeners();
    });
    resizeObserverRef.current = resizeObserver;
    if (tabsListElement) {
      resizeObserver.observe(tabsListElement);
    }
    tabResizeObserverElementsRef.current.forEach((element) => {
      resizeObserver.observe(element);
    });
    return () => {
      resizeObserver.disconnect();
      resizeObserverRef.current = null;
    };
  }, [tabsListElement, notifyIndicatorUpdateListeners]);
  const registerIndicatorUpdateListener = useStableCallback((listener) => {
    indicatorUpdateListenersRef.current.add(listener);
    return () => {
      indicatorUpdateListenersRef.current.delete(listener);
    };
  });
  const registerTabResizeObserverElement = useStableCallback((element) => {
    tabResizeObserverElementsRef.current.add(element);
    resizeObserverRef.current?.observe(element);
    return () => {
      tabResizeObserverElementsRef.current.delete(element);
      resizeObserverRef.current?.unobserve(element);
    };
  });
  const detectActivationDirection = useActivationDirectionDetector(
    value,
    // the old value
    orientation,
    tabsListElement,
    getTabElementBySelectedValue
  );
  const onTabActivation = useStableCallback((newValue, eventDetails) => {
    if (newValue !== value) {
      const activationDirection = detectActivationDirection(newValue);
      eventDetails.activationDirection = activationDirection;
      onValueChange(newValue, eventDetails);
    }
  });
  const state = {
    orientation,
    tabActivationDirection
  };
  const defaultProps = {
    "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
    role: "tablist"
  };
  const tabsListContextValue = React31.useMemo(() => ({
    activateOnFocus,
    highlightedTabIndex,
    registerIndicatorUpdateListener,
    registerTabResizeObserverElement,
    onTabActivation,
    setHighlightedTabIndex,
    tabsListElement
  }), [activateOnFocus, highlightedTabIndex, registerIndicatorUpdateListener, registerTabResizeObserverElement, onTabActivation, setHighlightedTabIndex, tabsListElement]);
  return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TabsListContext.Provider, {
    value: tabsListContextValue,
    children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(CompositeRoot, {
      render: render4,
      className,
      state,
      refs: [forwardedRef, setTabsListElement],
      props: [defaultProps, elementProps],
      stateAttributesMapping: tabsStateAttributesMapping,
      highlightedIndex: highlightedTabIndex,
      enableHomeAndEndKeys: true,
      loopFocus,
      orientation,
      onHighlightedIndexChange: setHighlightedTabIndex,
      onMapChange: setTabMap,
      disabledIndices: EMPTY_ARRAY
    })
  });
});
if (true) TabsList.displayName = "TabsList";
function getInset(tab, tabsList) {
  const {
    left: tabLeft,
    top: tabTop
  } = tab.getBoundingClientRect();
  const {
    left: listLeft,
    top: listTop
  } = tabsList.getBoundingClientRect();
  const left = tabLeft - listLeft;
  const top = tabTop - listTop;
  return {
    left,
    top
  };
}
function useActivationDirectionDetector(activeTabValue, orientation, tabsListElement, getTabElement) {
  const [previousTabEdge, setPreviousTabEdge] = React31.useState(null);
  useIsoLayoutEffect(() => {
    if (activeTabValue == null || tabsListElement == null) {
      setPreviousTabEdge(null);
      return;
    }
    const activeTab = getTabElement(activeTabValue);
    if (activeTab == null) {
      setPreviousTabEdge(null);
      return;
    }
    const {
      left,
      top
    } = getInset(activeTab, tabsListElement);
    setPreviousTabEdge(orientation === "horizontal" ? left : top);
  }, [orientation, getTabElement, tabsListElement, activeTabValue]);
  return React31.useCallback((newValue) => {
    if (newValue === activeTabValue) {
      return "none";
    }
    if (newValue == null) {
      setPreviousTabEdge(null);
      return "none";
    }
    if (newValue != null && tabsListElement != null) {
      const activeTabElement = getTabElement(newValue);
      if (activeTabElement != null) {
        const {
          left,
          top
        } = getInset(activeTabElement, tabsListElement);
        if (previousTabEdge == null) {
          setPreviousTabEdge(orientation === "horizontal" ? left : top);
          return "none";
        }
        if (orientation === "horizontal") {
          if (left < previousTabEdge) {
            setPreviousTabEdge(left);
            return "left";
          }
          if (left > previousTabEdge) {
            setPreviousTabEdge(left);
            return "right";
          }
        } else if (top < previousTabEdge) {
          setPreviousTabEdge(top);
          return "up";
        } else if (top > previousTabEdge) {
          setPreviousTabEdge(top);
          return "down";
        }
      }
    }
    return "none";
  }, [getTabElement, orientation, previousTabEdge, tabsListElement, activeTabValue]);
}

// ../../../node_modules/.pnpm/@base-ui+react@1.3.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/react/esm/use-render/useRender.js
function useRender(params) {
  return useRenderElement(params.defaultTagName ?? "div", params, params);
}

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/badge/badge.mjs
var import_element2 = __toESM(require_element(), 1);
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='a407d6dd3d']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "a407d6dd3d");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-sm,12px);font-weight:var(--wpds-font-weight-regular,400);line-height:var(--wpds-font-line-height-xs,16px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6bd);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee994);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c5f7cc);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f0f0f0);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#d8d8d8);color:var(--wpds-color-fg-content-neutral,#1e1e1e);padding-block:calc(var(--wpds-dimension-padding-xs, 4px) - var(--wpds-border-width-xs, 1px));padding-inline:calc(var(--wpds-dimension-padding-sm, 8px) - var(--wpds-border-width-xs, 1px))}}'));
  document.head.appendChild(style);
}
var style_default = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" };
var Badge = (0, import_element2.forwardRef)(function Badge2({ children, intent = "none", render: render4, className, ...props }, ref) {
  const element = useRender({
    render: render4,
    defaultTagName: "span",
    ref,
    props: mergeProps(props, {
      className: clsx_default(
        style_default.badge,
        style_default[`is-${intent}-intent`],
        className
      ),
      children
    })
  });
  return element;
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/icon/icon.mjs
var import_element3 = __toESM(require_element(), 1);
var import_primitives = __toESM(require_primitives(), 1);
var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
var Icon = (0, import_element3.forwardRef)(function Icon2({ icon, size = 24, ...restProps }, ref) {
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
    import_primitives.SVG,
    {
      ref,
      fill: "currentColor",
      ...icon.props,
      ...restProps,
      width: size,
      height: size
    }
  );
});

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-down.mjs
var import_primitives2 = __toESM(require_primitives(), 1);
var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
var arrow_down_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives2.Path, { d: "m16.5 13.5-3.7 3.7V4h-1.5v13.2l-3.8-3.7-1 1 5.5 5.6 5.5-5.6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-left.mjs
var import_primitives3 = __toESM(require_primitives(), 1);
var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
var arrow_left_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives3.Path, { d: "M20 11.2H6.8l3.7-3.7-1-1L3.9 12l5.6 5.5 1-1-3.7-3.7H20z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-right.mjs
var import_primitives4 = __toESM(require_primitives(), 1);
var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
var arrow_right_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives4.Path, { d: "m14.5 6.5-1 1 3.7 3.7H4v1.6h13.2l-3.7 3.7 1 1 5.6-5.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/arrow-up.mjs
var import_primitives5 = __toESM(require_primitives(), 1);
var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
var arrow_up_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives5.Path, { d: "M12 3.9 6.5 9.5l1 1 3.8-3.7V20h1.5V6.8l3.7 3.7 1-1z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/block-table.mjs
var import_primitives6 = __toESM(require_primitives(), 1);
var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives6.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/category.mjs
var import_primitives7 = __toESM(require_primitives(), 1);
var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
var category_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives7.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM4 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm11-.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5h-3a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM13 6a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2h-3a2 2 0 01-2-2V6zm5 8.5h-3a.5.5 0 00-.5.5v3a.5.5 0 00.5.5h3a.5.5 0 00.5-.5v-3a.5.5 0 00-.5-.5zM15 13a2 2 0 00-2 2v3a2 2 0 002 2h3a2 2 0 002-2v-3a2 2 0 00-2-2h-3zm-9 1.5h3a.5.5 0 01.5.5v3a.5.5 0 01-.5.5H6a.5.5 0 01-.5-.5v-3a.5.5 0 01.5-.5zM4 15a2 2 0 012-2h3a2 2 0 012 2v3a2 2 0 01-2 2H6a2 2 0 01-2-2v-3z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/check.mjs
var import_primitives8 = __toESM(require_primitives(), 1);
var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
var check_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives8.Path, { d: "M16.5 7.5 10 13.9l-2.5-2.4-1 1 3.5 3.6 7.5-7.6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/chevron-down.mjs
var import_primitives9 = __toESM(require_primitives(), 1);
var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives9.Path, { d: "M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/chevron-right.mjs
var import_primitives10 = __toESM(require_primitives(), 1);
var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives10.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/chevron-up.mjs
var import_primitives11 = __toESM(require_primitives(), 1);
var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives11.Path, { d: "M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/close-small.mjs
var import_primitives12 = __toESM(require_primitives(), 1);
var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives12.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/cog.mjs
var import_primitives13 = __toESM(require_primitives(), 1);
var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
var cog_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives13.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10.289 4.836A1 1 0 0111.275 4h1.306a1 1 0 01.987.836l.244 1.466c.787.26 1.503.679 2.108 1.218l1.393-.522a1 1 0 011.216.437l.653 1.13a1 1 0 01-.23 1.273l-1.148.944a6.025 6.025 0 010 2.435l1.149.946a1 1 0 01.23 1.272l-.653 1.13a1 1 0 01-1.216.437l-1.394-.522c-.605.54-1.32.958-2.108 1.218l-.244 1.466a1 1 0 01-.987.836h-1.306a1 1 0 01-.986-.836l-.244-1.466a5.995 5.995 0 01-2.108-1.218l-1.394.522a1 1 0 01-1.217-.436l-.653-1.131a1 1 0 01.23-1.272l1.149-.946a6.026 6.026 0 010-2.435l-1.148-.944a1 1 0 01-.23-1.272l.653-1.131a1 1 0 011.217-.437l1.393.522a5.994 5.994 0 012.108-1.218l.244-1.466zM14.929 12a3 3 0 11-6 0 3 3 0 016 0z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/download.mjs
var import_primitives14 = __toESM(require_primitives(), 1);
var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
var download_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives14.Path, { d: "M18 11.3l-1-1.1-4 4V3h-1.5v11.3L7 10.2l-1 1.1 6.2 5.8 5.8-5.8zm.5 3.7v3.5h-13V15H4v5h16v-5h-1.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/envelope.mjs
var import_primitives15 = __toESM(require_primitives(), 1);
var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
var envelope_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives15.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M3 7c0-1.1.9-2 2-2h14a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Zm2-.5h14c.3 0 .5.2.5.5v1L12 13.5 4.5 7.9V7c0-.3.2-.5.5-.5Zm-.5 3.3V17c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V9.8L12 15.4 4.5 9.8Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/error.mjs
var import_primitives16 = __toESM(require_primitives(), 1);
var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
var error_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives16.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/format-list-bullets-rtl.mjs
var import_primitives17 = __toESM(require_primitives(), 1);
var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives17.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/format-list-bullets.mjs
var import_primitives18 = __toESM(require_primitives(), 1);
var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives18.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/funnel.mjs
var import_primitives19 = __toESM(require_primitives(), 1);
var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
var funnel_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives19.Path, { d: "M10 17.5H14V16H10V17.5ZM6 6V7.5H18V6H6ZM8 12.5H16V11H8V12.5Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/link.mjs
var import_primitives20 = __toESM(require_primitives(), 1);
var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
var link_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives20.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/mobile.mjs
var import_primitives21 = __toESM(require_primitives(), 1);
var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
var mobile_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives21.Path, { d: "M15 4H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h6c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h6c.3 0 .5.2.5.5v12zm-4.5-.5h2V16h-2v1.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/more-vertical.mjs
var import_primitives22 = __toESM(require_primitives(), 1);
var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives22.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/next.mjs
var import_primitives23 = __toESM(require_primitives(), 1);
var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
var next_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives23.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/plugins.mjs
var import_primitives24 = __toESM(require_primitives(), 1);
var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives24.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/plus.mjs
var import_primitives25 = __toESM(require_primitives(), 1);
var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
var plus_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives25.Path, { d: "M11 12.5V17.5H12.5V12.5H17.5V11H12.5V6H11V11H6V12.5H11Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/previous.mjs
var import_primitives26 = __toESM(require_primitives(), 1);
var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
var previous_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives26.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/scheduled.mjs
var import_primitives27 = __toESM(require_primitives(), 1);
var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
var scheduled_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives27.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm9 1V8h-1.5v3.5h-2V13H13Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/search.mjs
var import_primitives28 = __toESM(require_primitives(), 1);
var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
var search_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives28.Path, { d: "M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/seen.mjs
var import_primitives29 = __toESM(require_primitives(), 1);
var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
var seen_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives29.Path, { d: "M3.99961 13C4.67043 13.3354 4.6703 13.3357 4.67017 13.3359L4.67298 13.3305C4.67621 13.3242 4.68184 13.3135 4.68988 13.2985C4.70595 13.2686 4.7316 13.2218 4.76695 13.1608C4.8377 13.0385 4.94692 12.8592 5.09541 12.6419C5.39312 12.2062 5.84436 11.624 6.45435 11.0431C7.67308 9.88241 9.49719 8.75 11.9996 8.75C14.502 8.75 16.3261 9.88241 17.5449 11.0431C18.1549 11.624 18.6061 12.2062 18.9038 12.6419C19.0523 12.8592 19.1615 13.0385 19.2323 13.1608C19.2676 13.2218 19.2933 13.2686 19.3093 13.2985C19.3174 13.3135 19.323 13.3242 19.3262 13.3305L19.3291 13.3359C19.3289 13.3357 19.3288 13.3354 19.9996 13C20.6704 12.6646 20.6703 12.6643 20.6701 12.664L20.6697 12.6632L20.6688 12.6614L20.6662 12.6563L20.6583 12.6408C20.6517 12.6282 20.6427 12.6108 20.631 12.5892C20.6078 12.5459 20.5744 12.4852 20.5306 12.4096C20.4432 12.2584 20.3141 12.0471 20.1423 11.7956C19.7994 11.2938 19.2819 10.626 18.5794 9.9569C17.1731 8.61759 14.9972 7.25 11.9996 7.25C9.00203 7.25 6.82614 8.61759 5.41987 9.9569C4.71736 10.626 4.19984 11.2938 3.85694 11.7956C3.68511 12.0471 3.55605 12.2584 3.4686 12.4096C3.42484 12.4852 3.39142 12.5459 3.36818 12.5892C3.35656 12.6108 3.34748 12.6282 3.34092 12.6408L3.33297 12.6563L3.33041 12.6614L3.32948 12.6632L3.32911 12.664C3.32894 12.6643 3.32879 12.6646 3.99961 13ZM11.9996 16C13.9326 16 15.4996 14.433 15.4996 12.5C15.4996 10.567 13.9326 9 11.9996 9C10.0666 9 8.49961 10.567 8.49961 12.5C8.49961 14.433 10.0666 16 11.9996 16Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/trash.mjs
var import_primitives30 = __toESM(require_primitives(), 1);
var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
var trash_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives30.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" }) });

// ../../../node_modules/.pnpm/@wordpress+icons@12.1.0_react@18.3.1/node_modules/@wordpress/icons/build-module/library/unseen.mjs
var import_primitives31 = __toESM(require_primitives(), 1);
var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
var unseen_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives31.Path, { d: "M20.7 12.7s0-.1-.1-.2c0-.2-.2-.4-.4-.6-.3-.5-.9-1.2-1.6-1.8-.7-.6-1.5-1.3-2.6-1.8l-.6 1.4c.9.4 1.6 1 2.1 1.5.6.6 1.1 1.2 1.4 1.6.1.2.3.4.3.5v.1l.7-.3.7-.3Zm-5.2-9.3-1.8 4c-.5-.1-1.1-.2-1.7-.2-3 0-5.2 1.4-6.6 2.7-.7.7-1.2 1.3-1.6 1.8-.2.3-.3.5-.4.6 0 0 0 .1-.1.2s0 0 .7.3l.7.3V13c0-.1.2-.3.3-.5.3-.4.7-1 1.4-1.6 1.2-1.2 3-2.3 5.5-2.3H13v.3c-.4 0-.8-.1-1.1-.1-1.9 0-3.5 1.6-3.5 3.5s.6 2.3 1.6 2.9l-2 4.4.9.4 7.6-16.2-.9-.4Zm-3 12.6c1.7-.2 3-1.7 3-3.5s-.2-1.4-.6-1.9L12.4 16Z" }) });

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/stack/stack.mjs
var import_element4 = __toESM(require_element(), 1);
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='b51ff41489']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "b51ff41489");
  style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}"));
  document.head.appendChild(style);
}
var style_default2 = { "stack": "_19ce0419607e1896__stack" };
var gapTokens = {
  xs: "var(--wpds-dimension-gap-xs, 4px)",
  sm: "var(--wpds-dimension-gap-sm, 8px)",
  md: "var(--wpds-dimension-gap-md, 12px)",
  lg: "var(--wpds-dimension-gap-lg, 16px)",
  xl: "var(--wpds-dimension-gap-xl, 24px)",
  "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
  "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
};
var Stack = (0, import_element4.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render: render4, ...props }, ref) {
  const style = {
    gap: gap && gapTokens[gap],
    alignItems: align,
    justifyContent: justify,
    flexDirection: direction,
    flexWrap: wrap
  };
  const element = useRender({
    render: render4,
    ref,
    props: mergeProps(props, { style, className: style_default2.stack })
  });
  return element;
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/index.mjs
var tabs_exports = {};
__export(tabs_exports, {
  List: () => List,
  Panel: () => Panel,
  Root: () => Root,
  Tab: () => Tab
});

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/list.mjs
var import_element5 = __toESM(require_element(), 1);
var import_compose = __toESM(require_compose(), 1);
var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='abbf48f53e']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "abbf48f53e");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6c6c6c);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n		&[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled,#8a8a8a);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n			[role=tab]:is([aria-selected=true])\n			&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:2px solid #0000;outline-offset:0}}}'));
  document.head.appendChild(style);
}
var style_default3 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
var SCROLL_EPSILON = 1;
var List = (0, import_element5.forwardRef)(
  function TabList({
    children,
    variant = "default",
    className,
    activateOnFocus,
    render: render4,
    ...otherProps
  }, forwardedRef) {
    const [listEl, setListEl] = (0, import_element5.useState)(null);
    const [overflow, setOverflow] = (0, import_element5.useState)({
      first: false,
      last: false,
      isScrolling: false
    });
    (0, import_element5.useEffect)(() => {
      if (!listEl) {
        return;
      }
      const measureOverflow = () => {
        const { scrollWidth, clientWidth, scrollLeft } = listEl;
        const maxScroll = Math.max(scrollWidth - clientWidth, 0);
        const direction = listEl.dir || (typeof window !== "undefined" ? window.getComputedStyle(listEl).direction : "ltr");
        const scrollFromStart = direction === "rtl" && scrollLeft < 0 ? (
          // In RTL layouts, scrollLeft is typically 0 at the visual "start"
          // (right edge) and becomes negative toward the "end" (left edge).
          // Normalize value for correct first/last detection logic.
          -scrollLeft
        ) : scrollLeft;
        setOverflow({
          first: scrollFromStart > SCROLL_EPSILON,
          last: scrollFromStart < maxScroll - SCROLL_EPSILON,
          isScrolling: scrollWidth > clientWidth
        });
      };
      const resizeObserver = new ResizeObserver(measureOverflow);
      resizeObserver.observe(listEl);
      let scrollTick = false;
      const throttleMeasureOverflowOnScroll = () => {
        if (!scrollTick) {
          requestAnimationFrame(() => {
            measureOverflow();
            scrollTick = false;
          });
          scrollTick = true;
        }
      };
      listEl.addEventListener(
        "scroll",
        throttleMeasureOverflowOnScroll,
        { passive: true }
      );
      measureOverflow();
      return () => {
        listEl.removeEventListener(
          "scroll",
          throttleMeasureOverflowOnScroll
        );
        resizeObserver.disconnect();
      };
    }, [listEl]);
    const mergedListRef = (0, import_compose.useMergeRefs)([
      forwardedRef,
      (el) => setListEl(el)
    ]);
    return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
      index_parts_exports.List,
      {
        ref: mergedListRef,
        activateOnFocus,
        "data-select-on-move": activateOnFocus ? "true" : "false",
        className: clsx_default(
          style_default3.tablist,
          overflow.first && style_default3["is-overflowing-first"],
          overflow.last && style_default3["is-overflowing-last"],
          style_default3[`is-${variant}-variant`],
          className
        ),
        ...otherProps,
        tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
        children: [
          children,
          /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(index_parts_exports.Indicator, { className: style_default3.indicator })
        ]
      }
    );
  }
);

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/panel.mjs
var import_element7 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/context.mjs
var import_element6 = __toESM(require_element(), 1);
var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
var VALIDATION_ENABLED = true;
var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element6.createContext)(null) : null;
function useRegisterTabDev() {
  const context = (0, import_element6.useContext)(TabsValidationContext);
  (0, import_element6.useEffect)(() => {
    if (context) {
      return context.registerTab();
    }
    return void 0;
  }, [context]);
}
function useRegisterTabProd() {
}
var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd;
function useRegisterPanelDev() {
  const context = (0, import_element6.useContext)(TabsValidationContext);
  (0, import_element6.useEffect)(() => {
    if (context) {
      return context.registerPanel();
    }
    return void 0;
  }, [context]);
}
function useRegisterPanelProd() {
}
var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd;
function TabsValidationProviderDev({
  children
}) {
  const tabCountRef = (0, import_element6.useRef)(0);
  const panelCountRef = (0, import_element6.useRef)(0);
  const validationScheduledRef = (0, import_element6.useRef)(null);
  const scheduleValidation = (0, import_element6.useCallback)(() => {
    if (validationScheduledRef.current) {
      clearTimeout(validationScheduledRef.current);
    }
    validationScheduledRef.current = setTimeout(() => {
      const tabCount = tabCountRef.current;
      const panelCount = panelCountRef.current;
      if (tabCount !== panelCount) {
        throw new Error(
          `Tabs: Tab/Panel count mismatch (${tabCount} Tabs, ${panelCount} Panels). Each Tab must be associated with exactly one Panel. Mismatched or missing associations can break screen reader navigation and violate WAI-ARIA Tabs pattern requirements.`
        );
      }
      validationScheduledRef.current = null;
    }, 0);
  }, []);
  const registerTab = (0, import_element6.useCallback)(() => {
    tabCountRef.current += 1;
    scheduleValidation();
    return () => {
      tabCountRef.current -= 1;
      scheduleValidation();
    };
  }, [scheduleValidation]);
  const registerPanel = (0, import_element6.useCallback)(() => {
    panelCountRef.current += 1;
    scheduleValidation();
    return () => {
      panelCountRef.current -= 1;
      scheduleValidation();
    };
  }, [scheduleValidation]);
  (0, import_element6.useEffect)(() => {
    return () => {
      if (validationScheduledRef.current) {
        clearTimeout(validationScheduledRef.current);
      }
    };
  }, []);
  const contextValue = (0, import_element6.useMemo)(
    () => ({
      registerTab,
      registerPanel
    }),
    [registerTab, registerPanel]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(TabsValidationContext.Provider, { value: contextValue, children });
}
function TabsValidationProviderProd({
  children
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_jsx_runtime40.Fragment, { children });
}
var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd;

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/panel.mjs
var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='abbf48f53e']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "abbf48f53e");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6c6c6c);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n		&[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled,#8a8a8a);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n			[role=tab]:is([aria-selected=true])\n			&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:2px solid #0000;outline-offset:0}}}'));
  document.head.appendChild(style);
}
var style_default4 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
var Panel = (0, import_element7.forwardRef)(
  function TabPanel2({ className, ...otherProps }, forwardedRef) {
    useRegisterPanel();
    return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
      index_parts_exports.Panel,
      {
        ref: forwardedRef,
        className: clsx_default(style_default4.tabpanel, className),
        ...otherProps
      }
    );
  }
);

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/root.mjs
var import_element8 = __toESM(require_element(), 1);
var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
var Root = (0, import_element8.forwardRef)(
  function TabsRoot3({ ...otherProps }, forwardedRef) {
    return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(index_parts_exports.Root, { ref: forwardedRef, ...otherProps }) });
  }
);

// ../../../node_modules/.pnpm/@wordpress+ui@0.10.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/ui/build-module/tabs/tab.mjs
var import_element9 = __toESM(require_element(), 1);
var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='abbf48f53e']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "abbf48f53e");
  style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:#0000 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,#0000 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid #0000;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6c6c6c);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active,#eaeaea);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n		&[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:#0000;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled,#8a8a8a);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n			[role=tab]:is([aria-selected=true])\n			&{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}._49f4bf715948892a__tabpanel{&:focus{box-shadow:none;outline:none}&:focus-visible{box-shadow:0 0 0 var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:2px solid #0000;outline-offset:0}}}'));
  document.head.appendChild(style);
}
var style_default5 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron", "tabpanel": "_49f4bf715948892a__tabpanel" };
var Tab = (0, import_element9.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
  useRegisterTab();
  return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(
    index_parts_exports.Tab,
    {
      ref: forwardedRef,
      className: clsx_default(style_default5.tab, className),
      ...otherProps,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: style_default5["tab-children"], children }),
        /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(Icon, { icon: chevron_right_default, className: style_default5["tab-chevron"] })
      ]
    }
  );
});

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.11.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/admin-ui/build-module/page/sidebar-toggle-slot.mjs
var import_components2 = __toESM(require_components(), 1);
var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components2.createSlotFill)("SidebarToggle");

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.11.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/admin-ui/build-module/page/header.mjs
var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
function Header({
  headingLevel = 2,
  breadcrumbs,
  badges,
  title,
  subTitle,
  actions: actions2,
  showSidebarToggle = true
}) {
  const HeadingTag = `h${headingLevel}`;
  return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(
    Stack,
    {
      direction: "column",
      className: "admin-ui-page__header",
      render: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("header", {}),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Stack, { direction: "row", justify: "space-between", gap: "sm", children: [
          /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [
            showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
              SidebarToggleSlot,
              {
                bubblesVirtually: true,
                className: "admin-ui-page__sidebar-toggle-slot"
              }
            ),
            title && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(HeadingTag, { className: "admin-ui-page__header-title", children: title }),
            breadcrumbs,
            badges
          ] }),
          /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
            Stack,
            {
              direction: "row",
              gap: "sm",
              style: { width: "auto", flexShrink: 0 },
              className: "admin-ui-page__header-actions",
              align: "center",
              children: actions2
            }
          )
        ] }),
        subTitle && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("p", { className: "admin-ui-page__header-subtitle", children: subTitle })
      ]
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+admin-ui@1.11.0_@types+react@18.3.28_react-dom@18.3.1_react@18.3.1__react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/admin-ui/build-module/page/index.mjs
var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
function Page({
  headingLevel,
  breadcrumbs,
  badges,
  title,
  subTitle,
  children,
  className,
  actions: actions2,
  ariaLabel,
  hasPadding = false,
  showSidebarToggle = true
}) {
  const classes = clsx_default("admin-ui-page", className);
  const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : "");
  return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [
    (title || breadcrumbs || badges || actions2) && /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
      Header,
      {
        headingLevel,
        breadcrumbs,
        badges,
        title,
        subTitle,
        actions: actions2,
        showSidebarToggle
      }
    ),
    hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: "admin-ui-page__content has-padding", children }) : children
  ] });
}
Page.SidebarToggleFill = SidebarToggleFill;
var page_default = Page;

// routes/forms/stage.tsx
var import_components77 = __toESM(require_components());
var import_data37 = __toESM(require_data());

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/dataviews/index.mjs
var import_element64 = __toESM(require_element(), 1);
var import_compose13 = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.mjs
var import_element10 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/constants.mjs
var import_i18n2 = __toESM(require_i18n(), 1);
var OPERATOR_IS_ANY = "isAny";
var OPERATOR_IS_NONE = "isNone";
var OPERATOR_IS_ALL = "isAll";
var OPERATOR_IS_NOT_ALL = "isNotAll";
var OPERATOR_BETWEEN = "between";
var OPERATOR_IN_THE_PAST = "inThePast";
var OPERATOR_OVER = "over";
var OPERATOR_IS = "is";
var OPERATOR_IS_NOT = "isNot";
var OPERATOR_LESS_THAN = "lessThan";
var OPERATOR_GREATER_THAN = "greaterThan";
var OPERATOR_LESS_THAN_OR_EQUAL = "lessThanOrEqual";
var OPERATOR_GREATER_THAN_OR_EQUAL = "greaterThanOrEqual";
var OPERATOR_BEFORE = "before";
var OPERATOR_AFTER = "after";
var OPERATOR_BEFORE_INC = "beforeInc";
var OPERATOR_AFTER_INC = "afterInc";
var OPERATOR_CONTAINS = "contains";
var OPERATOR_NOT_CONTAINS = "notContains";
var OPERATOR_STARTS_WITH = "startsWith";
var OPERATOR_ON = "on";
var OPERATOR_NOT_ON = "notOn";
var SORTING_DIRECTIONS = ["asc", "desc"];
var sortArrows = { asc: "\u2191", desc: "\u2193" };
var sortValues = { asc: "ascending", desc: "descending" };
var sortLabels = {
  asc: (0, import_i18n2.__)("Sort ascending"),
  desc: (0, import_i18n2.__)("Sort descending")
};
var sortIcons = {
  asc: arrow_up_default,
  desc: arrow_down_default
};
var LAYOUT_TABLE = "table";
var LAYOUT_GRID = "grid";
var LAYOUT_LIST = "list";
var LAYOUT_ACTIVITY = "activity";
var LAYOUT_PICKER_GRID = "pickerGrid";
var LAYOUT_PICKER_TABLE = "pickerTable";

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-context/index.mjs
var DataViewsContext = (0, import_element10.createContext)({
  view: { type: LAYOUT_TABLE },
  onChangeView: () => {
  },
  fields: [],
  data: [],
  paginationInfo: {
    totalItems: 0,
    totalPages: 0
  },
  selection: [],
  onChangeSelection: () => {
  },
  setOpenedFilter: () => {
  },
  openedFilter: null,
  getItemId: (item) => item.id,
  isItemClickable: () => true,
  renderItemLink: void 0,
  containerWidth: 0,
  containerRef: (0, import_element10.createRef)(),
  resizeObserverRef: () => {
  },
  defaultLayouts: { list: {}, grid: {}, table: {} },
  filters: [],
  isShowingFilter: false,
  setIsShowingFilter: () => {
  },
  hasInitiallyLoaded: false,
  config: {
    perPageSizes: []
  },
  intersectionObserver: null
});
DataViewsContext.displayName = "DataViewsContext";
var dataviews_context_default = DataViewsContext;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/index.mjs
var import_i18n22 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/index.mjs
var import_i18n10 = __toESM(require_i18n(), 1);
var import_components8 = __toESM(require_components(), 1);
var import_element18 = __toESM(require_element(), 1);
var import_keycodes = __toESM(require_keycodes(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-selection-checkbox/index.mjs
var import_components3 = __toESM(require_components(), 1);
var import_i18n3 = __toESM(require_i18n(), 1);
var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
function DataViewsSelectionCheckbox({
  selection,
  onChangeSelection,
  item,
  getItemId,
  titleField,
  disabled: disabled2,
  ...extraProps
}) {
  const id = getItemId(item);
  const isInSelectionArray = selection.includes(id);
  const checked = !disabled2 && isInSelectionArray;
  const selectionLabel = titleField?.getValue?.({ item }) || (0, import_i18n3.__)("(no title)");
  return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
    import_components3.CheckboxControl,
    {
      className: "dataviews-selection-checkbox",
      "aria-label": selectionLabel,
      "aria-disabled": disabled2,
      checked,
      onChange: () => {
        if (disabled2) {
          return;
        }
        onChangeSelection(
          isInSelectionArray ? selection.filter((itemId) => id !== itemId) : [...selection, id]
        );
      },
      ...extraProps
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.mjs
var import_components4 = __toESM(require_components(), 1);
var import_i18n4 = __toESM(require_i18n(), 1);
var import_element11 = __toESM(require_element(), 1);
var import_data = __toESM(require_data(), 1);
var import_compose2 = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/lock-unlock.mjs
var import_private_apis = __toESM(require_private_apis(), 1);
var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
  "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
  "@wordpress/dataviews"
);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-item-actions/index.mjs
var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
var { Menu, kebabCase } = unlock(import_components4.privateApis);
function ButtonTrigger({
  action,
  onClick,
  items,
  variant
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
    import_components4.Button,
    {
      disabled: !!action.disabled,
      accessibleWhenDisabled: true,
      size: "compact",
      variant,
      onClick,
      children: label
    }
  );
}
function MenuItemTrigger({
  action,
  onClick,
  items
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Menu.Item, { disabled: action.disabled, onClick, children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Menu.ItemLabel, { children: label }) });
}
function ActionModal({
  action,
  items,
  closeModal
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  const modalHeader = typeof action.modalHeader === "function" ? action.modalHeader(items) : action.modalHeader;
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
    import_components4.Modal,
    {
      title: modalHeader || label,
      __experimentalHideHeader: !!action.hideModalHeader,
      onRequestClose: closeModal,
      focusOnMount: action.modalFocusOnMount ?? true,
      size: action.modalSize || "medium",
      overlayClassName: `dataviews-action-modal dataviews-action-modal__${kebabCase(
        action.id
      )}`,
      children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(action.RenderModal, { items, closeModal })
    }
  );
}
function ActionsMenuGroup({
  actions: actions2,
  item,
  registry,
  setActiveModalAction
}) {
  const { primaryActions, regularActions } = (0, import_element11.useMemo)(() => {
    return actions2.reduce(
      (acc, action) => {
        (action.isPrimary ? acc.primaryActions : acc.regularActions).push(action);
        return acc;
      },
      {
        primaryActions: [],
        regularActions: []
      }
    );
  }, [actions2]);
  const renderActionGroup = (actionList) => actionList.map((action) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
    MenuItemTrigger,
    {
      action,
      onClick: () => {
        if ("RenderModal" in action) {
          setActiveModalAction(action);
          return;
        }
        action.callback([item], { registry });
      },
      items: [item]
    },
    action.id
  ));
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Menu.Group, { children: [
    renderActionGroup(primaryActions),
    renderActionGroup(regularActions)
  ] });
}
function ItemActions({
  item,
  actions: actions2,
  isCompact
}) {
  const registry = (0, import_data.useRegistry)();
  const { primaryActions, eligibleActions } = (0, import_element11.useMemo)(() => {
    const _eligibleActions = actions2.filter(
      (action) => !action.isEligible || action.isEligible(item)
    );
    const _primaryActions = _eligibleActions.filter(
      (action) => action.isPrimary
    );
    return {
      primaryActions: _primaryActions,
      eligibleActions: _eligibleActions
    };
  }, [actions2, item]);
  const isMobileViewport = (0, import_compose2.useViewportMatch)("medium", "<");
  if (isCompact) {
    return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
      CompactItemActions,
      {
        item,
        actions: eligibleActions,
        isSmall: true,
        registry
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(
    Stack,
    {
      direction: "row",
      justify: "flex-end",
      className: "dataviews-item-actions",
      style: {
        flexShrink: 0,
        width: "auto"
      },
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
          PrimaryActions,
          {
            item,
            actions: primaryActions,
            registry
          }
        ),
        (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu
        // there if there are any actions at all.
        isMobileViewport) && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
          CompactItemActions,
          {
            item,
            actions: eligibleActions,
            registry
          }
        )
      ]
    }
  );
}
function CompactItemActions({
  item,
  actions: actions2,
  isSmall,
  registry
}) {
  const [activeModalAction, setActiveModalAction] = (0, import_element11.useState)(
    null
  );
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(Menu, { placement: "bottom-end", children: [
      /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
        Menu.TriggerButton,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
            import_components4.Button,
            {
              size: isSmall ? "small" : "compact",
              icon: more_vertical_default,
              label: (0, import_i18n4.__)("Actions"),
              accessibleWhenDisabled: true,
              disabled: !actions2.length,
              className: "dataviews-all-actions-button"
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(Menu.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
        ActionsMenuGroup,
        {
          actions: actions2,
          item,
          registry,
          setActiveModalAction
        }
      ) })
    ] }),
    !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
      ActionModal,
      {
        action: activeModalAction,
        items: [item],
        closeModal: () => setActiveModalAction(null)
      }
    )
  ] });
}
function PrimaryActions({
  item,
  actions: actions2,
  registry,
  buttonVariant
}) {
  const [activeModalAction, setActiveModalAction] = (0, import_element11.useState)(null);
  const isMobileViewport = (0, import_compose2.useViewportMatch)("medium", "<");
  if (isMobileViewport) {
    return null;
  }
  if (!Array.isArray(actions2) || actions2.length === 0) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_jsx_runtime47.Fragment, { children: [
    actions2.map((action) => /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
      ButtonTrigger,
      {
        action,
        onClick: () => {
          if ("RenderModal" in action) {
            setActiveModalAction(action);
            return;
          }
          action.callback([item], { registry });
        },
        items: [item],
        variant: buttonVariant
      },
      action.id
    )),
    !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(
      ActionModal,
      {
        action: activeModalAction,
        items: [item],
        closeModal: () => setActiveModalAction(null)
      }
    )
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.mjs
var import_components5 = __toESM(require_components(), 1);
var import_i18n6 = __toESM(require_i18n(), 1);
var import_element12 = __toESM(require_element(), 1);
var import_data2 = __toESM(require_data(), 1);
var import_compose3 = __toESM(require_compose(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/utils/get-footer-message.mjs
var import_i18n5 = __toESM(require_i18n(), 1);
function getFooterMessage(selectionCount, itemsCount, totalItems, onlyTotalCount = false) {
  if (selectionCount > 0) {
    return (0, import_i18n5.sprintf)(
      /* translators: %d: number of items. */
      (0, import_i18n5._n)("%d Item selected", "%d Items selected", selectionCount),
      selectionCount
    );
  }
  if (onlyTotalCount || totalItems <= itemsCount) {
    return (0, import_i18n5.sprintf)(
      /* translators: %d: number of items. */
      (0, import_i18n5._n)("%d Item", "%d Items", totalItems),
      totalItems
    );
  }
  return (0, import_i18n5.sprintf)(
    /* translators: %1$d: number of items. %2$d: total number of items. */
    (0, import_i18n5._n)("%1$d of %2$d Item", "%1$d of %2$d Items", totalItems),
    itemsCount,
    totalItems
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-bulk-actions/index.mjs
var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
function ActionWithModal({
  action,
  items,
  ActionTriggerComponent
}) {
  const [isModalOpen, setIsModalOpen] = (0, import_element12.useState)(false);
  const actionTriggerProps = {
    action,
    onClick: () => {
      setIsModalOpen(true);
    },
    items
  };
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(ActionTriggerComponent, { ...actionTriggerProps }),
    isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      ActionModal,
      {
        action,
        items,
        closeModal: () => setIsModalOpen(false)
      }
    )
  ] });
}
function useHasAPossibleBulkAction(actions2, item) {
  return (0, import_element12.useMemo)(() => {
    return actions2.some((action) => {
      return action.supportsBulk && (!action.isEligible || action.isEligible(item));
    });
  }, [actions2, item]);
}
function useSomeItemHasAPossibleBulkAction(actions2, data) {
  return (0, import_element12.useMemo)(() => {
    return data.some((item) => {
      return actions2.some((action) => {
        return action.supportsBulk && (!action.isEligible || action.isEligible(item));
      });
    });
  }, [actions2, data]);
}
function BulkSelectionCheckbox({
  selection,
  onChangeSelection,
  data,
  actions: actions2,
  getItemId,
  disableSelectAll = false
}) {
  const selectableItems = (0, import_element12.useMemo)(() => {
    return data.filter((item) => {
      return actions2.some(
        (action) => action.supportsBulk && (!action.isEligible || action.isEligible(item))
      );
    });
  }, [data, actions2]);
  const selectedItems = data.filter(
    (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
  );
  const hasSelection = selection.length > 0;
  const areAllSelected = selectedItems.length === selectableItems.length;
  if (disableSelectAll) {
    return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      import_components5.CheckboxControl,
      {
        className: "dataviews-view-table-selection-checkbox",
        checked: hasSelection,
        disabled: !hasSelection,
        onChange: () => {
          onChangeSelection([]);
        },
        "aria-label": (0, import_i18n6.__)("Deselect all")
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    import_components5.CheckboxControl,
    {
      className: "dataviews-view-table-selection-checkbox",
      checked: areAllSelected,
      indeterminate: !areAllSelected && !!selectedItems.length,
      onChange: () => {
        if (areAllSelected) {
          onChangeSelection([]);
        } else {
          onChangeSelection(
            selectableItems.map((item) => getItemId(item))
          );
        }
      },
      "aria-label": areAllSelected ? (0, import_i18n6.__)("Deselect all") : (0, import_i18n6.__)("Select all")
    }
  );
}
function ActionTrigger({
  action,
  onClick,
  isBusy,
  items
}) {
  const label = typeof action.label === "string" ? action.label : action.label(items);
  const isMobile = (0, import_compose3.useViewportMatch)("medium", "<");
  if (isMobile) {
    return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      import_components5.Button,
      {
        disabled: isBusy,
        accessibleWhenDisabled: true,
        label,
        icon: action.icon,
        size: "compact",
        onClick,
        isBusy
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    import_components5.Button,
    {
      disabled: isBusy,
      accessibleWhenDisabled: true,
      size: "compact",
      onClick,
      isBusy,
      children: label
    }
  );
}
var EMPTY_ARRAY3 = [];
function ActionButton({
  action,
  selectedItems,
  actionInProgress,
  setActionInProgress
}) {
  const registry = (0, import_data2.useRegistry)();
  const selectedEligibleItems = (0, import_element12.useMemo)(() => {
    return selectedItems.filter((item) => {
      return !action.isEligible || action.isEligible(item);
    });
  }, [action, selectedItems]);
  if ("RenderModal" in action) {
    return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
      ActionWithModal,
      {
        action,
        items: selectedEligibleItems,
        ActionTriggerComponent: ActionTrigger
      },
      action.id
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    ActionTrigger,
    {
      action,
      onClick: async () => {
        setActionInProgress(action.id);
        await action.callback(selectedItems, {
          registry
        });
        setActionInProgress(null);
      },
      items: selectedEligibleItems,
      isBusy: actionInProgress === action.id
    },
    action.id
  );
}
function renderFooterContent(data, actions2, getItemId, isInfiniteScroll, selection, actionsToShow, selectedItems, actionInProgress, setActionInProgress, onChangeSelection, paginationInfo) {
  const message2 = getFooterMessage(
    selection.length,
    data.length,
    paginationInfo.totalItems,
    isInfiniteScroll
  );
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
    Stack,
    {
      direction: "row",
      className: "dataviews-bulk-actions-footer__container",
      gap: "md",
      align: "center",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
          BulkSelectionCheckbox,
          {
            selection,
            onChangeSelection,
            data,
            actions: actions2,
            getItemId,
            disableSelectAll: isInfiniteScroll
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: "dataviews-bulk-actions-footer__item-count", children: message2 }),
        /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(
          Stack,
          {
            direction: "row",
            className: "dataviews-bulk-actions-footer__action-buttons",
            gap: "xs",
            children: [
              actionsToShow.map((action) => {
                return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                  ActionButton,
                  {
                    action,
                    selectedItems,
                    actionInProgress,
                    setActionInProgress
                  },
                  action.id
                );
              }),
              selectedItems.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
                import_components5.Button,
                {
                  icon: close_small_default,
                  showTooltip: true,
                  tooltipPosition: "top",
                  size: "compact",
                  label: (0, import_i18n6.__)("Cancel"),
                  disabled: !!actionInProgress,
                  accessibleWhenDisabled: false,
                  onClick: () => {
                    onChangeSelection(EMPTY_ARRAY3);
                  }
                }
              )
            ]
          }
        )
      ]
    }
  );
}
function FooterContent({
  selection,
  actions: actions2,
  onChangeSelection,
  data,
  getItemId,
  isInfiniteScroll,
  paginationInfo
}) {
  const [actionInProgress, setActionInProgress] = (0, import_element12.useState)(
    null
  );
  const footerContentRef = (0, import_element12.useRef)(void 0);
  const isMobile = (0, import_compose3.useViewportMatch)("medium", "<");
  const bulkActions = (0, import_element12.useMemo)(
    () => actions2.filter((action) => action.supportsBulk),
    [actions2]
  );
  const selectableItems = (0, import_element12.useMemo)(() => {
    return data.filter((item) => {
      return bulkActions.some(
        (action) => !action.isEligible || action.isEligible(item)
      );
    });
  }, [data, bulkActions]);
  const selectedItems = (0, import_element12.useMemo)(() => {
    return data.filter(
      (item) => selection.includes(getItemId(item)) && selectableItems.includes(item)
    );
  }, [selection, data, getItemId, selectableItems]);
  const actionsToShow = (0, import_element12.useMemo)(
    () => actions2.filter((action) => {
      return action.supportsBulk && (!isMobile || action.icon) && selectedItems.some(
        (item) => !action.isEligible || action.isEligible(item)
      );
    }),
    [actions2, selectedItems, isMobile]
  );
  if (!actionInProgress) {
    if (footerContentRef.current) {
      footerContentRef.current = void 0;
    }
    return renderFooterContent(
      data,
      actions2,
      getItemId,
      isInfiniteScroll,
      selection,
      actionsToShow,
      selectedItems,
      actionInProgress,
      setActionInProgress,
      onChangeSelection,
      paginationInfo
    );
  } else if (!footerContentRef.current) {
    footerContentRef.current = renderFooterContent(
      data,
      actions2,
      getItemId,
      isInfiniteScroll,
      selection,
      actionsToShow,
      selectedItems,
      actionInProgress,
      setActionInProgress,
      onChangeSelection,
      paginationInfo
    );
  }
  return footerContentRef.current;
}
function BulkActionsFooter() {
  const {
    data,
    selection,
    actions: actions2 = EMPTY_ARRAY3,
    onChangeSelection,
    getItemId,
    paginationInfo,
    view
  } = (0, import_element12.useContext)(dataviews_context_default);
  return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(
    FooterContent,
    {
      selection,
      onChangeSelection,
      data,
      actions: actions2,
      getItemId,
      isInfiniteScroll: !!view.infiniteScrollEnabled,
      paginationInfo
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs
var import_i18n7 = __toESM(require_i18n(), 1);
var import_components6 = __toESM(require_components(), 1);
var import_element13 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/utils/get-hideable-fields.mjs
function getHideableFields(view, fields) {
  const togglableFields = [
    view?.titleField,
    view?.mediaField,
    view?.descriptionField
  ].filter(Boolean);
  return fields.filter(
    (f2) => !togglableFields.includes(f2.id) && f2.type !== "media" && f2.enableHiding !== false
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/column-header-menu.mjs
var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu2 } = unlock(import_components6.privateApis);
function WithMenuSeparators({ children }) {
  return import_element13.Children.toArray(children).filter(Boolean).map((child, i2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_element13.Fragment, { children: [
    i2 > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.Separator, {}),
    child
  ] }, i2));
}
var _HeaderMenu = (0, import_element13.forwardRef)(function HeaderMenu({
  fieldId,
  view,
  fields,
  onChangeView,
  onHide,
  setOpenedFilter,
  canMove = true,
  canInsertLeft = true,
  canInsertRight = true
}, ref) {
  const visibleFieldIds = view.fields ?? [];
  const index = visibleFieldIds?.indexOf(fieldId);
  const isSorted = view.sort?.field === fieldId;
  let isHidable = false;
  let isSortable = false;
  let canAddFilter = false;
  let operators = [];
  const field = fields.find((f2) => f2.id === fieldId);
  const { setIsShowingFilter } = (0, import_element13.useContext)(dataviews_context_default);
  if (!field) {
    return null;
  }
  isHidable = field.enableHiding !== false;
  isSortable = field.enableSorting !== false;
  const header = field.header;
  operators = !!field.filterBy && field.filterBy?.operators || [];
  canAddFilter = !view.filters?.some((_filter) => fieldId === _filter.field) && !!(field.hasElements || field.Edit) && field.filterBy !== false && !field.filterBy?.isPrimary;
  if (!isSortable && !canMove && !isHidable && !canAddFilter) {
    return header;
  }
  const hiddenFields = getHideableFields(view, fields).filter(
    (f2) => !visibleFieldIds.includes(f2.id)
  );
  const canInsert = (canInsertLeft || canInsertRight) && !!hiddenFields.length;
  const isRtl = (0, import_i18n7.isRTL)();
  return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Menu2, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(
      Menu2.TriggerButton,
      {
        render: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          import_components6.Button,
          {
            size: "compact",
            className: "dataviews-view-table-header-button",
            ref,
            variant: "tertiary"
          }
        ),
        children: [
          header,
          view.sort && isSorted && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("span", { "aria-hidden": "true", children: sortArrows[view.sort.direction] })
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.Popover, { style: { minWidth: "240px" }, children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(WithMenuSeparators, { children: [
      isSortable && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.Group, { children: SORTING_DIRECTIONS.map(
        (direction) => {
          const isChecked = view.sort && isSorted && view.sort.direction === direction;
          const value = `${fieldId}-${direction}`;
          return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
            Menu2.RadioItem,
            {
              name: "view-table-sorting",
              value,
              checked: isChecked,
              onChange: () => {
                onChangeView({
                  ...view,
                  sort: {
                    field: fieldId,
                    direction
                  },
                  showLevels: false
                });
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: sortLabels[direction] })
            },
            value
          );
        }
      ) }),
      canAddFilter && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.Group, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
        Menu2.Item,
        {
          prefix: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components6.Icon, { icon: funnel_default }),
          onClick: () => {
            setOpenedFilter(fieldId);
            setIsShowingFilter(true);
            onChangeView({
              ...view,
              page: 1,
              filters: [
                ...view.filters || [],
                {
                  field: fieldId,
                  value: void 0,
                  operator: operators[0]
                }
              ]
            });
          },
          children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Add filter") })
        }
      ) }),
      (canMove || isHidable || canInsert) && field && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Menu2.Group, { children: [
        canMove && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          Menu2.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components6.Icon, { icon: arrow_left_default }),
            disabled: isRtl ? index >= visibleFieldIds.length - 1 : index < 1,
            onClick: () => {
              const targetIndex = isRtl ? index + 1 : index - 1;
              const newFields = [
                ...visibleFieldIds
              ];
              newFields.splice(index, 1);
              newFields.splice(
                targetIndex,
                0,
                fieldId
              );
              onChangeView({
                ...view,
                fields: newFields
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Move left") })
          }
        ),
        canMove && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          Menu2.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components6.Icon, { icon: arrow_right_default }),
            disabled: isRtl ? index < 1 : index >= visibleFieldIds.length - 1,
            onClick: () => {
              const targetIndex = isRtl ? index - 1 : index + 1;
              const newFields = [
                ...visibleFieldIds
              ];
              newFields.splice(index, 1);
              newFields.splice(
                targetIndex,
                0,
                fieldId
              );
              onChangeView({
                ...view,
                fields: newFields
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Move right") })
          }
        ),
        canInsertLeft && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Menu2, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Insert left") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.Popover, { children: hiddenFields.map((hiddenField) => {
            const insertIndex = isRtl ? index + 1 : index;
            return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
              Menu2.Item,
              {
                onClick: () => {
                  onChangeView({
                    ...view,
                    fields: [
                      ...visibleFieldIds.slice(
                        0,
                        insertIndex
                      ),
                      hiddenField.id,
                      ...visibleFieldIds.slice(
                        insertIndex
                      )
                    ]
                  });
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: hiddenField.label })
              },
              hiddenField.id
            );
          }) })
        ] }),
        canInsertRight && !!hiddenFields.length && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Menu2, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.SubmenuTriggerItem, { children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Insert right") }) }),
          /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.Popover, { children: hiddenFields.map((hiddenField) => {
            const insertIndex = isRtl ? index : index + 1;
            return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
              Menu2.Item,
              {
                onClick: () => {
                  onChangeView({
                    ...view,
                    fields: [
                      ...visibleFieldIds.slice(
                        0,
                        insertIndex
                      ),
                      hiddenField.id,
                      ...visibleFieldIds.slice(
                        insertIndex
                      )
                    ]
                  });
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: hiddenField.label })
              },
              hiddenField.id
            );
          }) })
        ] }),
        isHidable && field && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
          Menu2.Item,
          {
            prefix: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components6.Icon, { icon: unseen_default }),
            onClick: () => {
              onHide(field);
              onChangeView({
                ...view,
                fields: visibleFieldIds.filter(
                  (id) => id !== fieldId
                )
              });
            },
            children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Menu2.ItemLabel, { children: (0, import_i18n7.__)("Hide column") })
          }
        )
      ] })
    ] }) })
  ] });
});
var ColumnHeaderMenu = _HeaderMenu;
var column_header_menu_default = ColumnHeaderMenu;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/item-click-wrapper.mjs
var import_element14 = __toESM(require_element(), 1);
var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
function getClickableItemProps({
  item,
  isItemClickable,
  onClickItem,
  className
}) {
  if (!isItemClickable(item) || !onClickItem) {
    return { className };
  }
  return {
    className: className ? `${className} ${className}--clickable` : void 0,
    role: "button",
    tabIndex: 0,
    onClick: (event) => {
      event.stopPropagation();
      onClickItem(item);
    },
    onKeyDown: (event) => {
      if (event.key === "Enter" || event.key === "" || event.key === " ") {
        event.stopPropagation();
        onClickItem(item);
      }
    }
  };
}
function ItemClickWrapper({
  item,
  isItemClickable,
  onClickItem,
  renderItemLink,
  className,
  children,
  ...extraProps
}) {
  if (!isItemClickable(item)) {
    return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className, ...extraProps, children });
  }
  if (renderItemLink) {
    const renderedElement = renderItemLink({
      item,
      className: `${className} ${className}--clickable`,
      ...extraProps,
      children
    });
    return (0, import_element14.cloneElement)(renderedElement, {
      onClick: (event) => {
        event.stopPropagation();
        if (renderedElement.props.onClick) {
          renderedElement.props.onClick(event);
        }
      },
      onKeyDown: (event) => {
        if (event.key === "Enter" || event.key === "" || event.key === " ") {
          event.stopPropagation();
          if (renderedElement.props.onKeyDown) {
            renderedElement.props.onKeyDown(event);
          }
        }
      }
    });
  }
  const clickProps = getClickableItemProps({
    item,
    isItemClickable,
    onClickItem,
    className
  });
  return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { ...clickProps, ...extraProps, children });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/column-primary.mjs
var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
function ColumnPrimary({
  item,
  level,
  titleField,
  mediaField,
  descriptionField,
  onClickItem,
  renderItemLink,
  isItemClickable
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(Stack, { direction: "row", gap: "md", align: "flex-start", justify: "flex-start", children: [
    mediaField && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
      ItemClickWrapper,
      {
        item,
        isItemClickable,
        onClickItem,
        renderItemLink,
        className: "dataviews-view-table__cell-content-wrapper dataviews-column-primary__media",
        "aria-label": isItemClickable(item) && (!!onClickItem || !!renderItemLink) && !!titleField ? titleField.getValue?.({ item }) : void 0,
        children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
          mediaField.render,
          {
            item,
            field: mediaField,
            config: { sizes: "32px" }
          }
        )
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
      Stack,
      {
        direction: "column",
        align: "flex-start",
        className: "dataviews-view-table__primary-column-content",
        children: [
          titleField && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(
            ItemClickWrapper,
            {
              item,
              isItemClickable,
              onClickItem,
              renderItemLink,
              className: "dataviews-view-table__cell-content-wrapper dataviews-title-field",
              children: [
                level !== void 0 && level > 0 && /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)("span", { className: "dataviews-view-table__level", children: [
                  Array(level).fill("\u2014").join(" "),
                  "\xA0"
                ] }),
                /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(titleField.render, { item, field: titleField })
              ]
            }
          ),
          descriptionField && /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(
            descriptionField.render,
            {
              item,
              field: descriptionField
            }
          )
        ]
      }
    )
  ] });
}
var column_primary_default = ColumnPrimary;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/use-scroll-state.mjs
var import_element15 = __toESM(require_element(), 1);
var import_i18n8 = __toESM(require_i18n(), 1);
var isScrolledToEnd = (element) => {
  if ((0, import_i18n8.isRTL)()) {
    const scrollLeft = Math.abs(element.scrollLeft);
    return scrollLeft <= 1;
  }
  return element.scrollLeft + element.clientWidth >= element.scrollWidth - 1;
};
function useScrollState({
  scrollContainerRef,
  enabledHorizontal = false
}) {
  const [isHorizontalScrollEnd, setIsHorizontalScrollEnd] = (0, import_element15.useState)(false);
  const [isVerticallyScrolled, setIsVerticallyScrolled] = (0, import_element15.useState)(false);
  const handleScroll = (0, import_element15.useCallback)(() => {
    const scrollContainer = scrollContainerRef.current;
    if (!scrollContainer) {
      return;
    }
    if (enabledHorizontal) {
      setIsHorizontalScrollEnd(isScrolledToEnd(scrollContainer));
    }
    setIsVerticallyScrolled(scrollContainer.scrollTop > 0);
  }, [scrollContainerRef, enabledHorizontal]);
  (0, import_element15.useEffect)(() => {
    if (typeof window === "undefined" || !scrollContainerRef.current) {
      return () => {
      };
    }
    const scrollContainer = scrollContainerRef.current;
    handleScroll();
    scrollContainer.addEventListener("scroll", handleScroll);
    window.addEventListener("resize", handleScroll);
    return () => {
      scrollContainer.removeEventListener("scroll", handleScroll);
      window.removeEventListener("resize", handleScroll);
    };
  }, [scrollContainerRef, enabledHorizontal, handleScroll]);
  return { isHorizontalScrollEnd, isVerticallyScrolled };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/get-data-by-group.mjs
function getDataByGroup(data, groupByField) {
  return data.reduce((groups, item) => {
    const groupName = groupByField.getValue({ item });
    if (!groups.has(groupName)) {
      groups.set(groupName, []);
    }
    groups.get(groupName)?.push(item);
    return groups;
  }, /* @__PURE__ */ new Map());
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/properties-section.mjs
var import_components7 = __toESM(require_components(), 1);
var import_i18n9 = __toESM(require_i18n(), 1);
var import_element16 = __toESM(require_element(), 1);
var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
function FieldItem({
  field,
  isVisible: isVisible2,
  onToggleVisibility
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components7.__experimentalItem, { onClick: field.enableHiding ? onToggleVisibility : void 0, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { direction: "row", gap: "sm", justify: "flex-start", align: "center", children: [
    /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { style: { height: 24, width: 24 }, children: isVisible2 && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components7.Icon, { icon: check_default }) }),
    /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("span", { className: "dataviews-view-config__label", children: field.label })
  ] }) });
}
function isDefined(item) {
  return !!item;
}
function PropertiesSection({
  showLabel = true
}) {
  const { view, fields, onChangeView } = (0, import_element16.useContext)(dataviews_context_default);
  const regularFields = getHideableFields(view, fields);
  if (!regularFields?.length) {
    return null;
  }
  const titleField = fields.find((f2) => f2.id === view.titleField);
  const previewField = fields.find((f2) => f2.id === view.mediaField);
  const descriptionField = fields.find(
    (f2) => f2.id === view.descriptionField
  );
  const lockedFields = [
    {
      field: titleField,
      isVisibleFlag: "showTitle"
    },
    {
      field: previewField,
      isVisibleFlag: "showMedia"
    },
    {
      field: descriptionField,
      isVisibleFlag: "showDescription"
    }
  ].filter(({ field }) => isDefined(field));
  const visibleFieldIds = view.fields ?? [];
  const visibleRegularFieldsCount = regularFields.filter(
    (f2) => visibleFieldIds.includes(f2.id)
  ).length;
  const visibleLockedFields = lockedFields.filter(
    ({ isVisibleFlag }) => (
      // @ts-expect-error
      view[isVisibleFlag] ?? true
    )
  );
  const totalVisibleFields = visibleLockedFields.length + visibleRegularFieldsCount;
  const isSingleVisibleLockedField = totalVisibleFields === 1 && visibleLockedFields.length === 1;
  return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(Stack, { direction: "column", className: "dataviews-field-control", children: [
    showLabel && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components7.BaseControl.VisualLabel, { children: (0, import_i18n9.__)("Properties") }),
    /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
      Stack,
      {
        direction: "column",
        className: "dataviews-view-config__properties",
        children: /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components7.__experimentalItemGroup, { isBordered: true, isSeparated: true, size: "medium", children: [
          lockedFields.map(({ field, isVisibleFlag }) => {
            const isVisible2 = view[isVisibleFlag] ?? true;
            const fieldToRender = isSingleVisibleLockedField && isVisible2 ? { ...field, enableHiding: false } : field;
            return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
              FieldItem,
              {
                field: fieldToRender,
                isVisible: isVisible2,
                onToggleVisibility: () => {
                  onChangeView({
                    ...view,
                    [isVisibleFlag]: !isVisible2
                  });
                }
              },
              field.id
            );
          }),
          regularFields.map((field) => {
            const isVisible2 = visibleFieldIds.includes(field.id);
            const fieldToRender = totalVisibleFields === 1 && isVisible2 ? { ...field, enableHiding: false } : field;
            return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
              FieldItem,
              {
                field: fieldToRender,
                isVisible: isVisible2,
                onToggleVisibility: () => {
                  onChangeView({
                    ...view,
                    fields: isVisible2 ? visibleFieldIds.filter(
                      (fieldId) => fieldId !== field.id
                    ) : [...visibleFieldIds, field.id]
                  });
                }
              },
              field.id
            );
          })
        ] })
      }
    )
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/hooks/use-delayed-loading.mjs
var import_element17 = __toESM(require_element(), 1);
function useDelayedLoading(isLoading, options = { delay: 400 }) {
  const [showLoader, setShowLoader] = (0, import_element17.useState)(false);
  (0, import_element17.useEffect)(() => {
    if (!isLoading) {
      return;
    }
    const timeout = setTimeout(() => {
      setShowLoader(true);
    }, options.delay);
    return () => {
      clearTimeout(timeout);
      setShowLoader(false);
    };
  }, [isLoading, options.delay]);
  return showLoader;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/table/index.mjs
var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
function getEffectiveAlign(explicitAlign, fieldType) {
  if (explicitAlign) {
    return explicitAlign;
  }
  if (fieldType === "integer" || fieldType === "number") {
    return "end";
  }
  return void 0;
}
function TableColumnField({
  item,
  fields,
  column,
  align
}) {
  const field = fields.find((f2) => f2.id === column);
  if (!field) {
    return null;
  }
  const className = clsx_default("dataviews-view-table__cell-content-wrapper", {
    "dataviews-view-table__cell-align-end": align === "end",
    "dataviews-view-table__cell-align-center": align === "center"
  });
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(field.render, { item, field }) });
}
function TableRow({
  hasBulkActions,
  item,
  level,
  actions: actions2,
  fields,
  id,
  view,
  titleField,
  mediaField,
  descriptionField,
  selection,
  getItemId,
  isItemClickable,
  onClickItem,
  renderItemLink,
  onChangeSelection,
  isActionsColumnSticky,
  posinset
}) {
  const { paginationInfo } = (0, import_element18.useContext)(dataviews_context_default);
  const hasPossibleBulkAction = useHasAPossibleBulkAction(actions2, item);
  const isSelected2 = hasPossibleBulkAction && selection.includes(id);
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const isTouchDeviceRef = (0, import_element18.useRef)(false);
  const columns = view.fields ?? [];
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
    "tr",
    {
      className: clsx_default("dataviews-view-table__row", {
        "is-selected": hasPossibleBulkAction && isSelected2,
        "has-bulk-actions": hasPossibleBulkAction
      }),
      onTouchStart: () => {
        isTouchDeviceRef.current = true;
      },
      "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
      "aria-posinset": posinset,
      role: infiniteScrollEnabled ? "article" : void 0,
      onMouseDown: (event) => {
        const isMetaClick = (0, import_keycodes.isAppleOS)() ? event.metaKey : event.ctrlKey;
        if (event.button === 0 && isMetaClick && window.navigator.userAgent.toLowerCase().includes("firefox")) {
          event?.preventDefault();
        }
      },
      onClick: (event) => {
        if (!hasPossibleBulkAction) {
          return;
        }
        const isModifierKeyPressed = (0, import_keycodes.isAppleOS)() ? event.metaKey : event.ctrlKey;
        if (isModifierKeyPressed && !isTouchDeviceRef.current && document.getSelection()?.type !== "Range") {
          onChangeSelection(
            selection.includes(id) ? selection.filter((itemId) => id !== itemId) : [...selection, id]
          );
        }
      },
      children: [
        hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("td", { className: "dataviews-view-table__checkbox-column", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          DataViewsSelectionCheckbox,
          {
            item,
            selection,
            onChangeSelection,
            getItemId,
            titleField,
            disabled: !hasPossibleBulkAction
          }
        ) }) }),
        hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("td", { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          column_primary_default,
          {
            item,
            level,
            titleField: showTitle ? titleField : void 0,
            mediaField: showMedia ? mediaField : void 0,
            descriptionField: showDescription ? descriptionField : void 0,
            isItemClickable,
            onClickItem,
            renderItemLink
          }
        ) }),
        columns.map((column) => {
          const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
          const field = fields.find((f2) => f2.id === column);
          const effectiveAlign = getEffectiveAlign(align, field?.type);
          return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
            "td",
            {
              style: {
                width,
                maxWidth,
                minWidth
              },
              children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                TableColumnField,
                {
                  fields,
                  item,
                  column,
                  align: effectiveAlign
                }
              )
            },
            column
          );
        }),
        !!actions2?.length && // Disable reason: we are not making the element interactive,
        // but preventing any click events from bubbling up to the
        // table row. This allows us to add a click handler to the row
        // itself (to toggle row selection) without erroneously
        // intercepting click events from ItemActions.
        /* eslint-disable jsx-a11y/no-noninteractive-element-interactions, jsx-a11y/click-events-have-key-events */
        /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
          "td",
          {
            className: clsx_default("dataviews-view-table__actions-column", {
              "dataviews-view-table__actions-column--sticky": true,
              "dataviews-view-table__actions-column--stuck": isActionsColumnSticky
            }),
            onClick: (e2) => e2.stopPropagation(),
            children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ItemActions, { item, actions: actions2 })
          }
        )
      ]
    }
  );
}
function ViewTable({
  actions: actions2,
  data,
  fields,
  getItemId,
  getItemLevel,
  isLoading = false,
  onChangeView,
  onChangeSelection,
  selection,
  setOpenedFilter,
  onClickItem,
  isItemClickable,
  renderItemLink,
  view,
  className,
  empty
}) {
  const { containerRef } = (0, import_element18.useContext)(dataviews_context_default);
  const isDelayedLoading = useDelayedLoading(isLoading);
  const headerMenuRefs = (0, import_element18.useRef)(/* @__PURE__ */ new Map());
  const headerMenuToFocusRef = (0, import_element18.useRef)(void 0);
  const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element18.useState)();
  const [contextMenuAnchor, setContextMenuAnchor] = (0, import_element18.useState)(null);
  (0, import_element18.useEffect)(() => {
    if (headerMenuToFocusRef.current) {
      headerMenuToFocusRef.current.focus();
      headerMenuToFocusRef.current = void 0;
    }
  });
  const tableNoticeId = (0, import_element18.useId)();
  const { isHorizontalScrollEnd, isVerticallyScrolled } = useScrollState({
    scrollContainerRef: containerRef,
    enabledHorizontal: !!actions2?.length
  });
  const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions2, data);
  if (nextHeaderMenuToFocus) {
    headerMenuToFocusRef.current = nextHeaderMenuToFocus;
    setNextHeaderMenuToFocus(void 0);
    return;
  }
  const onHide = (field) => {
    const hidden = headerMenuRefs.current.get(field.id);
    const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
    setNextHeaderMenuToFocus(fallback?.node);
  };
  const handleHeaderContextMenu = (event) => {
    event.preventDefault();
    event.stopPropagation();
    const virtualAnchor = {
      getBoundingClientRect: () => ({
        x: event.clientX,
        y: event.clientY,
        top: event.clientY,
        left: event.clientX,
        right: event.clientX,
        bottom: event.clientY,
        width: 0,
        height: 0,
        toJSON: () => ({})
      })
    };
    window.requestAnimationFrame(() => {
      setContextMenuAnchor(virtualAnchor);
    });
  };
  const hasData = !!data?.length;
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  const columns = view.fields ?? [];
  const headerMenuRef = (column, index) => (node) => {
    if (node) {
      headerMenuRefs.current.set(column, {
        node,
        fallback: columns[index > 0 ? index - 1 : 1]
      });
    } else {
      headerMenuRefs.current.delete(column);
    }
  };
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  const isRtl = (0, import_i18n10.isRTL)();
  if (!hasData) {
    return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
      "div",
      {
        className: clsx_default("dataviews-no-results", {
          "is-refreshing": isDelayedLoading
        }),
        id: tableNoticeId,
        children: empty
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_jsx_runtime53.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(
      "table",
      {
        className: clsx_default("dataviews-view-table", className, {
          [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
            view.layout.density
          ),
          "has-bulk-actions": hasBulkActions,
          "is-refreshing": !isInfiniteScroll && isDelayedLoading
        }),
        "aria-busy": isLoading,
        "aria-describedby": tableNoticeId,
        role: isInfiniteScroll ? "feed" : void 0,
        inert: !isInfiniteScroll && isLoading ? "true" : void 0,
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("colgroup", { children: [
            hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("col", { className: "dataviews-view-table__col-checkbox" }),
            hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("col", { className: "dataviews-view-table__col-first-data" }),
            columns.map((column, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
              "col",
              {
                className: clsx_default(
                  `dataviews-view-table__col-${column}`,
                  {
                    "dataviews-view-table__col-expand": !hasPrimaryColumn && index === columns.length - 1
                  }
                )
              },
              `col-${column}`
            )),
            !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("col", { className: "dataviews-view-table__col-actions" })
          ] }),
          contextMenuAnchor && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
            import_components8.Popover,
            {
              anchor: contextMenuAnchor,
              onClose: () => setContextMenuAnchor(null),
              placement: "bottom-start",
              children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PropertiesSection, { showLabel: false })
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
            "thead",
            {
              className: clsx_default({
                "dataviews-view-table__thead--stuck": isVerticallyScrolled
              }),
              onContextMenu: handleHeaderContextMenu,
              children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("tr", { className: "dataviews-view-table__row", children: [
                hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                  "th",
                  {
                    className: "dataviews-view-table__checkbox-column",
                    scope: "col",
                    onContextMenu: handleHeaderContextMenu,
                    children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                      BulkSelectionCheckbox,
                      {
                        selection,
                        onChangeSelection,
                        data,
                        actions: actions2,
                        getItemId
                      }
                    )
                  }
                ),
                hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("th", { scope: "col", children: titleField && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                  column_header_menu_default,
                  {
                    ref: headerMenuRef(
                      titleField.id,
                      0
                    ),
                    fieldId: titleField.id,
                    view,
                    fields,
                    onChangeView,
                    onHide,
                    setOpenedFilter,
                    canMove: false,
                    canInsertLeft: isRtl ? view.layout?.enableMoving ?? true : false,
                    canInsertRight: isRtl ? false : view.layout?.enableMoving ?? true
                  }
                ) }),
                columns.map((column, index) => {
                  const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
                  const field = fields.find(
                    (f2) => f2.id === column
                  );
                  const effectiveAlign = getEffectiveAlign(
                    align,
                    field?.type
                  );
                  const canInsertOrMove = view.layout?.enableMoving ?? true;
                  return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                    "th",
                    {
                      style: {
                        width,
                        maxWidth,
                        minWidth,
                        textAlign: effectiveAlign
                      },
                      "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
                      scope: "col",
                      children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                        column_header_menu_default,
                        {
                          ref: headerMenuRef(column, index),
                          fieldId: column,
                          view,
                          fields,
                          onChangeView,
                          onHide,
                          setOpenedFilter,
                          canMove: canInsertOrMove,
                          canInsertLeft: canInsertOrMove,
                          canInsertRight: canInsertOrMove
                        }
                      )
                    },
                    column
                  );
                }),
                !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                  "th",
                  {
                    className: clsx_default(
                      "dataviews-view-table__actions-column",
                      {
                        "dataviews-view-table__actions-column--sticky": true,
                        "dataviews-view-table__actions-column--stuck": !isHorizontalScrollEnd
                      }
                    ),
                    children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("span", { className: "dataviews-view-table-header", children: (0, import_i18n10.__)("Actions") })
                  }
                )
              ] })
            }
          ),
          hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("tbody", { children: [
              /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("tr", { className: "dataviews-view-table__group-header-row", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                "td",
                {
                  colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + (hasBulkActions ? 1 : 0) + (actions2?.length ? 1 : 0),
                  className: "dataviews-view-table__group-header-cell",
                  children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n10.sprintf)(
                    // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                    (0, import_i18n10.__)("%1$s: %2$s"),
                    groupField.label,
                    groupName
                  )
                }
              ) }),
              groupItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
                TableRow,
                {
                  item,
                  level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
                  hasBulkActions,
                  actions: actions2,
                  fields,
                  id: getItemId(item) || index.toString(),
                  view,
                  titleField,
                  mediaField,
                  descriptionField,
                  selection,
                  getItemId,
                  onChangeSelection,
                  onClickItem,
                  renderItemLink,
                  isItemClickable,
                  isActionsColumnSticky: !isHorizontalScrollEnd
                },
                getItemId(item)
              ))
            ] }, `group-${groupName}`)
          ) : /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("tbody", { children: hasData && data.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(
            TableRow,
            {
              item,
              level: view.showLevels && typeof getItemLevel === "function" ? getItemLevel(item) : void 0,
              hasBulkActions,
              actions: actions2,
              fields,
              id: getItemId(item) || index.toString(),
              view,
              titleField,
              mediaField,
              descriptionField,
              selection,
              getItemId,
              onChangeSelection,
              onClickItem,
              renderItemLink,
              isItemClickable,
              isActionsColumnSticky: !isHorizontalScrollEnd,
              posinset: isInfiniteScroll ? index + 1 : void 0
            },
            getItemId(item)
          )) })
        ]
      }
    ),
    isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "dataviews-loading", id: tableNoticeId, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components8.Spinner, {}) }) })
  ] });
}
var table_default = ViewTable;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/index.mjs
var import_components11 = __toESM(require_components(), 1);
var import_i18n13 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs
var import_components10 = __toESM(require_components(), 1);
var import_i18n12 = __toESM(require_i18n(), 1);
var import_compose4 = __toESM(require_compose(), 1);
var import_keycodes2 = __toESM(require_keycodes(), 1);
var import_element22 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/preview-size-picker.mjs
var import_components9 = __toESM(require_components(), 1);
var import_i18n11 = __toESM(require_i18n(), 1);
var import_element19 = __toESM(require_element(), 1);
var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
var imageSizes = [
  {
    value: 120,
    breakpoint: 1
  },
  {
    value: 170,
    breakpoint: 1
  },
  {
    value: 230,
    breakpoint: 1
  },
  {
    value: 290,
    breakpoint: 1112
    // at minimum image width, 4 images display at this container size
  },
  {
    value: 350,
    breakpoint: 1636
    // at minimum image width, 6 images display at this container size
  },
  {
    value: 430,
    breakpoint: 588
    // at minimum image width, 2 images display at this container size
  }
];
var DEFAULT_PREVIEW_SIZE = imageSizes[2].value;
function useGridColumns() {
  const context = (0, import_element19.useContext)(dataviews_context_default);
  const view = context.view;
  return (0, import_element19.useMemo)(() => {
    const containerWidth = context.containerWidth;
    const gap = 32;
    const previewSize = view.layout?.previewSize ?? DEFAULT_PREVIEW_SIZE;
    const columns = Math.floor(
      (containerWidth + gap) / (previewSize + gap)
    );
    return Math.max(1, columns);
  }, [context.containerWidth, view.layout?.previewSize]);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/grid-items.mjs
var import_element20 = __toESM(require_element(), 1);
var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
var GridItems = (0, import_element20.forwardRef)(({ className, previewSize, ...props }, ref) => {
  return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
    "div",
    {
      ref,
      className: clsx_default("dataviews-view-grid-items", className),
      style: {
        gridTemplateColumns: previewSize && `repeat(auto-fill, minmax(${previewSize}px, 1fr))`
      },
      ...props
    }
  );
});

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/use-infinite-scroll.mjs
var import_element21 = __toESM(require_element(), 1);
function useIntersectionObserver(elementRef, posinset) {
  const { intersectionObserver } = (0, import_element21.useContext)(dataviews_context_default);
  (0, import_element21.useEffect)(() => {
    const element = elementRef.current;
    if (!element || posinset === void 0 || !intersectionObserver) {
      return;
    }
    intersectionObserver.observe(element);
    return () => {
      intersectionObserver.unobserve(element);
    };
  }, [elementRef, intersectionObserver, posinset]);
}
function usePlaceholdersNeeded(data, isInfiniteScroll, gridColumns) {
  const hasData = !!data?.length;
  const firstItemPosition = hasData && isInfiniteScroll ? data[0].position : void 0;
  return firstItemPosition && gridColumns ? (firstItemPosition - 1) % gridColumns : 0;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/composite-grid.mjs
var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
var { Badge: Badge3 } = unlock(import_components10.privateApis);
function chunk(array, size) {
  const chunks = [];
  for (let i2 = 0, j2 = array.length; i2 < j2; i2 += size) {
    chunks.push(array.slice(i2, i2 + size));
  }
  return chunks;
}
var GridItem = (0, import_element22.forwardRef)(
  function GridItem2({
    view,
    selection,
    onChangeSelection,
    onClickItem,
    isItemClickable,
    renderItemLink,
    getItemId,
    item,
    actions: actions2,
    mediaField,
    titleField,
    descriptionField,
    regularFields,
    badgeFields,
    hasBulkActions,
    config,
    posinset,
    setsize,
    ...props
  }, forwardedRef) {
    const {
      showTitle = true,
      showMedia = true,
      showDescription = true
    } = view;
    const hasBulkAction = useHasAPossibleBulkAction(actions2, item);
    const id = getItemId(item);
    const elementRef = (0, import_element22.useRef)(null);
    const setRefs = (0, import_element22.useCallback)(
      (node) => {
        elementRef.current = node;
        if (typeof forwardedRef === "function") {
          forwardedRef(node);
        } else if (forwardedRef) {
          forwardedRef.current = node;
        }
      },
      [forwardedRef]
    );
    useIntersectionObserver(elementRef, posinset);
    const instanceId = (0, import_compose4.useInstanceId)(GridItem2);
    const isSelected2 = selection.includes(id);
    const mediaPlaceholder = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("span", { className: "dataviews-view-grid__media-placeholder" });
    const rendersMediaField = showMedia && mediaField?.render;
    const renderedMediaField = rendersMediaField ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
      mediaField.render,
      {
        item,
        field: mediaField,
        config
      }
    ) : mediaPlaceholder;
    const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(titleField.render, { item, field: titleField }) : null;
    let mediaA11yProps;
    let titleA11yProps;
    if (isItemClickable(item) && onClickItem) {
      if (renderedTitleField) {
        mediaA11yProps = {
          "aria-labelledby": `dataviews-view-grid__title-field-${instanceId}`
        };
        titleA11yProps = {
          id: `dataviews-view-grid__title-field-${instanceId}`
        };
      } else {
        mediaA11yProps = {
          "aria-label": (0, import_i18n12.__)("Navigate to item")
        };
      }
    }
    return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
      Stack,
      {
        direction: "column",
        ...props,
        ref: setRefs,
        "aria-setsize": setsize,
        "aria-posinset": posinset,
        className: clsx_default(
          props.className,
          "dataviews-view-grid__row__gridcell",
          "dataviews-view-grid__card",
          {
            "is-selected": hasBulkAction && isSelected2
          }
        ),
        onClickCapture: (event) => {
          props.onClickCapture?.(event);
          if ((0, import_keycodes2.isAppleOS)() ? event.metaKey : event.ctrlKey) {
            event.stopPropagation();
            event.preventDefault();
            if (!hasBulkAction) {
              return;
            }
            onChangeSelection(
              isSelected2 ? selection.filter(
                (itemId) => id !== itemId
              ) : [...selection, id]
            );
          }
        },
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            ItemClickWrapper,
            {
              item,
              isItemClickable,
              onClickItem,
              renderItemLink,
              className: clsx_default("dataviews-view-grid__media", {
                "dataviews-view-grid__media--placeholder": !rendersMediaField
              }),
              ...mediaA11yProps,
              children: renderedMediaField
            }
          ),
          hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            DataViewsSelectionCheckbox,
            {
              item,
              selection,
              onChangeSelection,
              getItemId,
              titleField,
              disabled: !hasBulkAction
            }
          ),
          !!actions2?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "dataviews-view-grid__media-actions", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            ItemActions,
            {
              item,
              actions: actions2,
              isCompact: true
            }
          ) }),
          showTitle && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", { className: "dataviews-view-grid__title", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            ItemClickWrapper,
            {
              item,
              isItemClickable,
              onClickItem,
              renderItemLink,
              className: "dataviews-view-grid__title-field dataviews-title-field",
              ...titleA11yProps,
              title: titleField?.getValueFormatted({
                item,
                field: titleField
              }) || void 0,
              children: renderedTitleField
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(Stack, { direction: "column", gap: "xs", children: [
            showDescription && descriptionField?.render && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
              descriptionField.render,
              {
                item,
                field: descriptionField
              }
            ),
            !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
              Stack,
              {
                direction: "row",
                className: "dataviews-view-grid__badge-fields",
                gap: "sm",
                wrap: "wrap",
                align: "top",
                justify: "flex-start",
                children: badgeFields.map((field) => {
                  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                    Badge3,
                    {
                      className: "dataviews-view-grid__field-value",
                      children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                        field.render,
                        {
                          item,
                          field
                        }
                      )
                    },
                    field.id
                  );
                })
              }
            ),
            !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
              Stack,
              {
                direction: "column",
                className: "dataviews-view-grid__fields",
                gap: "xs",
                children: regularFields.map((field) => {
                  return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                    import_components10.Flex,
                    {
                      className: "dataviews-view-grid__field",
                      gap: 1,
                      justify: "flex-start",
                      expanded: true,
                      style: { height: "auto" },
                      direction: "row",
                      children: /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
                        /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components10.Tooltip, { text: field.label, children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_components10.FlexItem, { className: "dataviews-view-grid__field-name", children: field.header }) }),
                        /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                          import_components10.FlexItem,
                          {
                            className: "dataviews-view-grid__field-value",
                            style: { maxHeight: "none" },
                            children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                              field.render,
                              {
                                item,
                                field
                              }
                            )
                          }
                        )
                      ] })
                    },
                    field.id
                  );
                })
              }
            )
          ] })
        ]
      }
    );
  }
);
function CompositeGrid({
  data,
  isInfiniteScroll,
  className,
  inert,
  isLoading,
  view,
  fields,
  selection,
  onChangeSelection,
  onClickItem,
  isItemClickable,
  renderItemLink,
  getItemId,
  actions: actions2
}) {
  const { paginationInfo, resizeObserverRef } = (0, import_element22.useContext)(dataviews_context_default);
  const gridColumns = useGridColumns();
  const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions2, data);
  const titleField = fields.find(
    (field) => field.id === view?.titleField
  );
  const mediaField = fields.find(
    (field) => field.id === view?.mediaField
  );
  const descriptionField = fields.find(
    (field) => field.id === view?.descriptionField
  );
  const otherFields = view.fields ?? [];
  const { regularFields, badgeFields } = otherFields.reduce(
    (accumulator, fieldId) => {
      const field = fields.find((f2) => f2.id === fieldId);
      if (!field) {
        return accumulator;
      }
      const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
      accumulator[key].push(field);
      return accumulator;
    },
    { regularFields: [], badgeFields: [] }
  );
  const size = "900px";
  const totalRows = Math.ceil(data.length / gridColumns);
  const placeholdersNeeded = usePlaceholdersNeeded(
    data,
    isInfiniteScroll,
    gridColumns
  );
  return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, {
    // Render infinite scroll layout (no rows, feed semantics)
    children: [
      isInfiniteScroll && /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(
        import_components10.Composite,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            GridItems,
            {
              className: clsx_default(
                "dataviews-view-grid-infinite-scroll",
                className,
                {
                  [`has-${view.layout?.density}-density`]: view.layout?.density && [
                    "compact",
                    "comfortable"
                  ].includes(view.layout.density)
                }
              ),
              previewSize: view.layout?.previewSize,
              "aria-busy": isLoading,
              ref: resizeObserverRef
            }
          ),
          role: "feed",
          focusWrap: true,
          inert,
          children: [
            Array.from({ length: placeholdersNeeded }).map(
              (_, index) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                import_components10.Composite.Item,
                {
                  render: (props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                    Stack,
                    {
                      ...props,
                      direction: "column",
                      role: "article",
                      className: "dataviews-view-grid__row__gridcell dataviews-view-grid__card dataviews-view-grid__placeholder"
                    }
                  ),
                  "aria-hidden": true,
                  tabIndex: -1
                },
                `placeholder-${index}`
              )
            ),
            data.map((item) => {
              const itemId = getItemId(item);
              const stablePosition = item.position;
              return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                import_components10.Composite.Item,
                {
                  render: (props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                    GridItem,
                    {
                      ...props,
                      id: itemId,
                      role: "article",
                      view,
                      selection,
                      onChangeSelection,
                      onClickItem,
                      isItemClickable,
                      renderItemLink,
                      getItemId,
                      item,
                      actions: actions2,
                      mediaField,
                      titleField,
                      descriptionField,
                      regularFields,
                      badgeFields,
                      hasBulkActions,
                      posinset: stablePosition,
                      setsize: paginationInfo.totalItems,
                      config: {
                        sizes: size
                      }
                    }
                  )
                },
                itemId
              );
            })
          ]
        }
      ),
      // Render standard grid layout (with rows, grid semantics)
      !isInfiniteScroll && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
        import_components10.Composite,
        {
          role: "grid",
          className: clsx_default("dataviews-view-grid", className, {
            [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
              view.layout.density
            )
          }),
          focusWrap: true,
          "aria-busy": isLoading,
          "aria-rowcount": totalRows,
          ref: resizeObserverRef,
          inert,
          children: chunk(data, gridColumns).map((row, i2) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
            import_components10.Composite.Row,
            {
              render: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                "div",
                {
                  role: "row",
                  "aria-rowindex": i2 + 1,
                  "aria-label": (0, import_i18n12.sprintf)(
                    /* translators: %d: The row number in the grid */
                    (0, import_i18n12.__)("Row %d"),
                    i2 + 1
                  ),
                  className: "dataviews-view-grid__row",
                  style: {
                    gridTemplateColumns: `repeat( ${gridColumns}, minmax(0, 1fr) )`
                  }
                }
              ),
              children: row.map((item) => {
                const itemId = getItemId(item);
                return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                  import_components10.Composite.Item,
                  {
                    render: (props) => /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
                      GridItem,
                      {
                        ...props,
                        id: itemId,
                        role: "gridcell",
                        view,
                        selection,
                        onChangeSelection,
                        onClickItem,
                        isItemClickable,
                        renderItemLink,
                        getItemId,
                        item,
                        actions: actions2,
                        mediaField,
                        titleField,
                        descriptionField,
                        regularFields,
                        badgeFields,
                        hasBulkActions,
                        config: {
                          sizes: size
                        }
                      }
                    )
                  },
                  itemId
                );
              })
            },
            i2
          ))
        }
      )
    ]
  });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/grid/index.mjs
var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
function ViewGrid({
  actions: actions2,
  data,
  fields,
  getItemId,
  isLoading,
  onChangeSelection,
  onClickItem,
  isItemClickable,
  renderItemLink,
  selection,
  view,
  className,
  empty
}) {
  const isDelayedLoading = useDelayedLoading(!!isLoading);
  const hasData = !!data?.length;
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  if (!hasData) {
    return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
      "div",
      {
        className: clsx_default("dataviews-no-results", {
          "is-refreshing": isDelayedLoading
        }),
        children: empty
      }
    );
  }
  const gridProps = {
    className: clsx_default(className, {
      "is-refreshing": !isInfiniteScroll && isDelayedLoading
    }),
    inert: !isInfiniteScroll && !!isLoading ? "true" : void 0,
    isLoading,
    view,
    fields,
    selection,
    onChangeSelection,
    onClickItem,
    isItemClickable,
    renderItemLink,
    getItemId,
    actions: actions2
  };
  return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(import_jsx_runtime57.Fragment, {
    // Render multiple groups.
    children: [
      hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(Stack, { direction: "column", gap: "lg", children: Array.from(dataByGroup.entries()).map(
        ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(
          Stack,
          {
            direction: "column",
            gap: "sm",
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("h3", { className: "dataviews-view-grid__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n13.sprintf)(
                // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                (0, import_i18n13.__)("%1$s: %2$s"),
                groupField.label,
                groupName
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
                CompositeGrid,
                {
                  ...gridProps,
                  data: groupItems,
                  isInfiniteScroll: false
                }
              )
            ]
          },
          groupName
        )
      ) }),
      // Render a single grid with all data.
      !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
        CompositeGrid,
        {
          ...gridProps,
          data,
          isInfiniteScroll: !!isInfiniteScroll
        }
      ),
      isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_components11.Spinner, {}) })
    ]
  });
}
var grid_default = ViewGrid;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/list/index.mjs
var import_compose5 = __toESM(require_compose(), 1);
var import_components12 = __toESM(require_components(), 1);
var import_element23 = __toESM(require_element(), 1);
var import_i18n14 = __toESM(require_i18n(), 1);
var import_data3 = __toESM(require_data(), 1);
var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu3 } = unlock(import_components12.privateApis);
function generateItemWrapperCompositeId(idPrefix) {
  return `${idPrefix}-item-wrapper`;
}
function generatePrimaryActionCompositeId(idPrefix, primaryActionId) {
  return `${idPrefix}-primary-action-${primaryActionId}`;
}
function generateDropdownTriggerCompositeId(idPrefix) {
  return `${idPrefix}-dropdown`;
}
function PrimaryActionGridCell({
  idPrefix,
  primaryAction,
  item
}) {
  const registry = (0, import_data3.useRegistry)();
  const [isModalOpen, setIsModalOpen] = (0, import_element23.useState)(false);
  const compositeItemId = generatePrimaryActionCompositeId(
    idPrefix,
    primaryAction.id
  );
  const label = typeof primaryAction.label === "string" ? primaryAction.label : primaryAction.label([item]);
  return "RenderModal" in primaryAction ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    import_components12.Composite.Item,
    {
      id: compositeItemId,
      render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
        import_components12.Button,
        {
          disabled: !!primaryAction.disabled,
          accessibleWhenDisabled: true,
          text: label,
          size: "small",
          onClick: () => setIsModalOpen(true)
        }
      ),
      children: isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
        ActionModal,
        {
          action: primaryAction,
          items: [item],
          closeModal: () => setIsModalOpen(false)
        }
      )
    }
  ) }, primaryAction.id) : /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    import_components12.Composite.Item,
    {
      id: compositeItemId,
      render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
        import_components12.Button,
        {
          disabled: !!primaryAction.disabled,
          accessibleWhenDisabled: true,
          size: "small",
          onClick: () => {
            primaryAction.callback([item], { registry });
          },
          children: label
        }
      )
    }
  ) }, primaryAction.id);
}
function ListItem({
  view,
  actions: actions2,
  idPrefix,
  isSelected: isSelected2,
  item,
  titleField,
  mediaField,
  descriptionField,
  onSelect,
  otherFields,
  onDropdownTriggerKeyDown,
  posinset
}) {
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const itemRef = (0, import_element23.useRef)(null);
  const labelId = `${idPrefix}-label`;
  const descriptionId = `${idPrefix}-description`;
  const registry = (0, import_data3.useRegistry)();
  const [isHovered, setIsHovered] = (0, import_element23.useState)(false);
  const [activeModalAction, setActiveModalAction] = (0, import_element23.useState)(
    null
  );
  const handleHover = ({ type }) => {
    const isHover = type === "mouseenter";
    setIsHovered(isHover);
  };
  const { paginationInfo } = (0, import_element23.useContext)(dataviews_context_default);
  (0, import_element23.useEffect)(() => {
    if (isSelected2) {
      itemRef.current?.scrollIntoView({
        behavior: "auto",
        block: "nearest",
        inline: "nearest"
      });
    }
  }, [isSelected2]);
  const { primaryAction, eligibleActions } = (0, import_element23.useMemo)(() => {
    const _eligibleActions = actions2.filter(
      (action) => !action.isEligible || action.isEligible(item)
    );
    const _primaryActions = _eligibleActions.filter(
      (action) => action.isPrimary
    );
    return {
      primaryAction: _primaryActions[0],
      eligibleActions: _eligibleActions
    };
  }, [actions2, item]);
  const hasOnlyOnePrimaryAction = primaryAction && actions2.length === 1;
  const renderedMediaField = showMedia && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "dataviews-view-list__media-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config: { sizes: "52px" }
    }
  ) }) : null;
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(titleField.render, { item, field: titleField }) : null;
  const renderDescription = showDescription && descriptionField?.render;
  const hasOnlyMediaAndTitle = !!renderedMediaField && !renderDescription && !otherFields.length;
  const usedActions = eligibleActions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
    Stack,
    {
      direction: "row",
      gap: "md",
      className: "dataviews-view-list__item-actions",
      children: [
        primaryAction && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
          PrimaryActionGridCell,
          {
            idPrefix,
            primaryAction,
            item
          }
        ),
        !hasOnlyOnePrimaryAction && /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)("div", { role: "gridcell", children: [
          /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Menu3, { placement: "bottom-end", children: [
            /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
              Menu3.TriggerButton,
              {
                render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                  import_components12.Composite.Item,
                  {
                    id: generateDropdownTriggerCompositeId(
                      idPrefix
                    ),
                    render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                      import_components12.Button,
                      {
                        size: "small",
                        icon: more_vertical_default,
                        label: (0, import_i18n14.__)("Actions"),
                        accessibleWhenDisabled: true,
                        disabled: !actions2.length,
                        onKeyDown: onDropdownTriggerKeyDown
                      }
                    )
                  }
                )
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(Menu3.Popover, { children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
              ActionsMenuGroup,
              {
                actions: eligibleActions,
                item,
                registry,
                setActiveModalAction
              }
            ) })
          ] }),
          !!activeModalAction && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
            ActionModal,
            {
              action: activeModalAction,
              items: [item],
              closeModal: () => setActiveModalAction(null)
            }
          )
        ] })
      ]
    }
  );
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
    import_components12.Composite.Row,
    {
      ref: itemRef,
      render: (
        /* aria-posinset breaks Composite.Row if passed to it directly. */
        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
          "div",
          {
            "aria-posinset": posinset,
            "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0
          }
        )
      ),
      role: infiniteScrollEnabled ? "article" : "row",
      className: clsx_default({
        "is-selected": isSelected2,
        "is-hovered": isHovered
      }),
      onMouseEnter: handleHover,
      onMouseLeave: handleHover,
      children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
        Stack,
        {
          direction: "row",
          className: "dataviews-view-list__item-wrapper",
          children: [
            /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { role: "gridcell", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
              import_components12.Composite.Item,
              {
                id: generateItemWrapperCompositeId(idPrefix),
                "aria-pressed": isSelected2,
                "aria-labelledby": labelId,
                "aria-describedby": descriptionId,
                className: "dataviews-view-list__item",
                onClick: () => onSelect(item)
              }
            ) }),
            /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "md",
                justify: "start",
                align: hasOnlyMediaAndTitle ? "center" : "flex-start",
                style: { flex: 1, minWidth: 0 },
                children: [
                  renderedMediaField,
                  /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                    Stack,
                    {
                      direction: "column",
                      gap: "xs",
                      className: "dataviews-view-list__field-wrapper",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(Stack, { direction: "row", align: "center", children: [
                          /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                            "div",
                            {
                              className: "dataviews-title-field dataviews-view-list__title-field",
                              id: labelId,
                              children: renderedTitleField
                            }
                          ),
                          usedActions
                        ] }),
                        renderDescription && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", { className: "dataviews-view-list__field", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                          descriptionField.render,
                          {
                            item,
                            field: descriptionField
                          }
                        ) }),
                        /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                          "div",
                          {
                            className: "dataviews-view-list__fields",
                            id: descriptionId,
                            children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                              "div",
                              {
                                className: "dataviews-view-list__field",
                                children: [
                                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                                    import_components12.VisuallyHidden,
                                    {
                                      as: "span",
                                      className: "dataviews-view-list__field-label",
                                      children: field.label
                                    }
                                  ),
                                  /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("span", { className: "dataviews-view-list__field-value", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                                    field.render,
                                    {
                                      item,
                                      field
                                    }
                                  ) })
                                ]
                              },
                              field.id
                            ))
                          }
                        )
                      ]
                    }
                  )
                ]
              }
            )
          ]
        }
      )
    }
  );
}
function isDefined2(item) {
  return !!item;
}
function ViewList(props) {
  const {
    actions: actions2,
    data,
    fields,
    getItemId,
    isLoading,
    onChangeSelection,
    selection,
    view,
    className,
    empty
  } = props;
  const baseId = (0, import_compose5.useInstanceId)(ViewList, "view-list");
  const isDelayedLoading = useDelayedLoading(!!isLoading);
  const selectedItem = data?.findLast(
    (item) => selection.includes(getItemId(item))
  );
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f2) => fieldId === f2.id)).filter(isDefined2);
  const onSelect = (item) => onChangeSelection([getItemId(item)]);
  const generateCompositeItemIdPrefix = (0, import_element23.useCallback)(
    (item) => `${baseId}-${getItemId(item)}`,
    [baseId, getItemId]
  );
  const isActiveCompositeItem = (0, import_element23.useCallback)(
    (item, idToCheck) => {
      return idToCheck.startsWith(
        generateCompositeItemIdPrefix(item)
      );
    },
    [generateCompositeItemIdPrefix]
  );
  const [activeCompositeId, setActiveCompositeId] = (0, import_element23.useState)(void 0);
  const compositeRef = (0, import_element23.useRef)(null);
  (0, import_element23.useEffect)(() => {
    if (selectedItem) {
      setActiveCompositeId(
        generateItemWrapperCompositeId(
          generateCompositeItemIdPrefix(selectedItem)
        )
      );
    }
  }, [selectedItem, generateCompositeItemIdPrefix]);
  const activeItemIndex = data.findIndex(
    (item) => isActiveCompositeItem(item, activeCompositeId ?? "")
  );
  const previousActiveItemIndex = (0, import_compose5.usePrevious)(activeItemIndex);
  const isActiveIdInList = activeItemIndex !== -1;
  const selectCompositeItem = (0, import_element23.useCallback)(
    (targetIndex, generateCompositeId) => {
      const clampedIndex = Math.min(
        data.length - 1,
        Math.max(0, targetIndex)
      );
      if (!data[clampedIndex]) {
        return;
      }
      const itemIdPrefix = generateCompositeItemIdPrefix(
        data[clampedIndex]
      );
      const targetCompositeItemId = generateCompositeId(itemIdPrefix);
      setActiveCompositeId(targetCompositeItemId);
      if (compositeRef.current?.contains(
        compositeRef.current.ownerDocument.activeElement
      )) {
        document.getElementById(targetCompositeItemId)?.focus();
      }
    },
    [data, generateCompositeItemIdPrefix]
  );
  (0, import_element23.useEffect)(() => {
    const wasActiveIdInList = previousActiveItemIndex !== void 0 && previousActiveItemIndex !== -1;
    if (!isActiveIdInList && wasActiveIdInList) {
      selectCompositeItem(
        previousActiveItemIndex,
        generateItemWrapperCompositeId
      );
    }
  }, [isActiveIdInList, selectCompositeItem, previousActiveItemIndex]);
  const onDropdownTriggerKeyDown = (0, import_element23.useCallback)(
    (event) => {
      if (event.key === "ArrowDown") {
        event.preventDefault();
        selectCompositeItem(
          activeItemIndex + 1,
          generateDropdownTriggerCompositeId
        );
      }
      if (event.key === "ArrowUp") {
        event.preventDefault();
        selectCompositeItem(
          activeItemIndex - 1,
          generateDropdownTriggerCompositeId
        );
      }
    },
    [selectCompositeItem, activeItemIndex]
  );
  const hasData = !!data?.length;
  const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null;
  const dataByGroup = hasData && groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  if (!hasData) {
    return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
      "div",
      {
        className: clsx_default("dataviews-no-results", {
          "is-refreshing": isDelayedLoading
        }),
        children: empty
      }
    );
  }
  if (hasData && groupField && dataByGroup) {
    return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
      import_components12.Composite,
      {
        ref: compositeRef,
        id: `${baseId}`,
        render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {}),
        className: "dataviews-view-list__group",
        role: "grid",
        activeId: activeCompositeId,
        setActiveId: setActiveCompositeId,
        children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
          Stack,
          {
            direction: "column",
            gap: "lg",
            className: clsx_default("dataviews-view-list", className),
            children: Array.from(dataByGroup.entries()).map(
              ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(
                Stack,
                {
                  direction: "column",
                  gap: "sm",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("h3", { className: "dataviews-view-list__group-header", children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n14.sprintf)(
                      // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                      (0, import_i18n14.__)("%1$s: %2$s"),
                      groupField.label,
                      groupName
                    ) }),
                    groupItems.map((item) => {
                      const id = generateCompositeItemIdPrefix(item);
                      return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
                        ListItem,
                        {
                          view,
                          idPrefix: id,
                          actions: actions2,
                          item,
                          isSelected: item === selectedItem,
                          onSelect,
                          mediaField,
                          titleField,
                          descriptionField,
                          otherFields,
                          onDropdownTriggerKeyDown
                        },
                        id
                      );
                    })
                  ]
                },
                groupName
              )
            )
          }
        )
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
      import_components12.Composite,
      {
        ref: compositeRef,
        id: baseId,
        render: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("div", {}),
        className: clsx_default("dataviews-view-list", className, {
          [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
            view.layout.density
          ),
          "is-refreshing": !isInfiniteScroll && isDelayedLoading
        }),
        role: view.infiniteScrollEnabled ? "feed" : "grid",
        activeId: activeCompositeId,
        setActiveId: setActiveCompositeId,
        inert: !isInfiniteScroll && !!isLoading ? "true" : void 0,
        children: data.map((item, index) => {
          const id = generateCompositeItemIdPrefix(item);
          return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
            ListItem,
            {
              view,
              idPrefix: id,
              actions: actions2,
              item,
              isSelected: item === selectedItem,
              onSelect,
              mediaField,
              titleField,
              descriptionField,
              otherFields,
              onDropdownTriggerKeyDown,
              posinset: view.infiniteScrollEnabled ? index + 1 : void 0
            },
            id
          );
        })
      }
    ),
    isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_components12.Spinner, {}) })
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/index.mjs
var import_components14 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/activity-group.mjs
var import_i18n15 = __toESM(require_i18n(), 1);
var import_element24 = __toESM(require_element(), 1);
var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
function ActivityGroup({
  groupName,
  groupData,
  groupField,
  showLabel = true,
  children
}) {
  const groupHeader = showLabel ? (0, import_element24.createInterpolateElement)(
    // translators: %s: The label of the field e.g. "Status".
    (0, import_i18n15.sprintf)((0, import_i18n15.__)("%s: <groupName />"), groupField.label).trim(),
    {
      groupName: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
        groupField.render,
        {
          item: groupData[0],
          field: groupField
        }
      )
    }
  ) : /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(groupField.render, { item: groupData[0], field: groupField });
  return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(
    Stack,
    {
      direction: "column",
      className: "dataviews-view-activity__group",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime59.jsx)("h3", { className: "dataviews-view-activity__group-header", children: groupHeader }),
        children
      ]
    },
    groupName
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/activity-item.mjs
var import_components13 = __toESM(require_components(), 1);
var import_element25 = __toESM(require_element(), 1);
var import_data4 = __toESM(require_data(), 1);
var import_compose6 = __toESM(require_compose(), 1);
var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
function ActivityItem(props) {
  const {
    view,
    actions: actions2,
    item,
    titleField,
    mediaField,
    descriptionField,
    otherFields,
    posinset,
    onClickItem,
    renderItemLink,
    isItemClickable
  } = props;
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const itemRef = (0, import_element25.useRef)(null);
  const registry = (0, import_data4.useRegistry)();
  const { paginationInfo } = (0, import_element25.useContext)(dataviews_context_default);
  const { primaryActions, eligibleActions } = (0, import_element25.useMemo)(() => {
    const _eligibleActions = actions2.filter(
      (action) => !action.isEligible || action.isEligible(item)
    );
    const _primaryActions = _eligibleActions.filter(
      (action) => action.isPrimary
    );
    return {
      primaryActions: _primaryActions,
      eligibleActions: _eligibleActions
    };
  }, [actions2, item]);
  const isMobileViewport = (0, import_compose6.useViewportMatch)("medium", "<");
  const density = view.layout?.density ?? "balanced";
  const mediaContent = showMedia && density !== "compact" && mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config: {
        sizes: density === "comfortable" ? "32px" : "24px"
      }
    }
  ) : null;
  const renderedMediaField = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-type-icon", children: mediaContent || /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
    "span",
    {
      className: "dataviews-view-activity__item-bullet",
      "aria-hidden": "true"
    }
  ) });
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(titleField.render, { item, field: titleField }) : null;
  const verticalGap = (0, import_element25.useMemo)(() => {
    switch (density) {
      case "comfortable":
        return "md";
      default:
        return "sm";
    }
  }, [density]);
  return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
    "div",
    {
      ref: itemRef,
      role: infiniteScrollEnabled ? "article" : void 0,
      "aria-posinset": posinset,
      "aria-setsize": infiniteScrollEnabled ? paginationInfo.totalItems : void 0,
      className: clsx_default(
        "dataviews-view-activity__item",
        density === "compact" && "is-compact",
        density === "balanced" && "is-balanced",
        density === "comfortable" && "is-comfortable"
      ),
      children: /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(Stack, { direction: "row", gap: "lg", justify: "start", align: "flex-start", children: [
        /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
          Stack,
          {
            direction: "column",
            gap: "xs",
            align: "center",
            className: "dataviews-view-activity__item-type",
            children: renderedMediaField
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
          Stack,
          {
            direction: "column",
            gap: verticalGap,
            align: "flex-start",
            className: "dataviews-view-activity__item-content",
            children: [
              renderedTitleField && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                ItemClickWrapper,
                {
                  item,
                  isItemClickable,
                  onClickItem,
                  renderItemLink,
                  className: "dataviews-view-activity__item-title",
                  children: renderedTitleField
                }
              ),
              showDescription && descriptionField && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-description", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                descriptionField.render,
                {
                  item,
                  field: descriptionField
                }
              ) }),
              /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-fields", children: otherFields.map((field) => /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(
                "div",
                {
                  className: "dataviews-view-activity__item-field",
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                      import_components13.VisuallyHidden,
                      {
                        as: "span",
                        className: "dataviews-view-activity__item-field-label",
                        children: field.label
                      }
                    ),
                    /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("span", { className: "dataviews-view-activity__item-field-value", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                      field.render,
                      {
                        item,
                        field
                      }
                    ) })
                  ]
                },
                field.id
              )) }),
              !!primaryActions?.length && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
                PrimaryActions,
                {
                  item,
                  actions: primaryActions,
                  registry,
                  buttonVariant: "secondary"
                }
              )
            ]
          }
        ),
        (primaryActions.length < eligibleActions.length || // Since we hide primary actions on mobile, we need to show the menu
        // there if there are any actions at all.
        isMobileViewport && // At the same time, only show the menu if there are actions to show.
        eligibleActions.length > 0) && /* @__PURE__ */ (0, import_jsx_runtime60.jsx)("div", { className: "dataviews-view-activity__item-actions", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
          ItemActions,
          {
            item,
            actions: eligibleActions,
            isCompact: true
          }
        ) })
      ] })
    }
  );
}
var activity_item_default = ActivityItem;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/activity-items.mjs
var import_react4 = __toESM(require_react(), 1);
function isDefined3(item) {
  return !!item;
}
function ActivityItems(props) {
  const { data, fields, getItemId, view } = props;
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const otherFields = (view?.fields ?? []).map((fieldId) => fields.find((f2) => fieldId === f2.id)).filter(isDefined3);
  return data.map((item, index) => {
    return /* @__PURE__ */ (0, import_react4.createElement)(
      activity_item_default,
      {
        ...props,
        key: getItemId(item),
        item,
        mediaField,
        titleField,
        descriptionField,
        otherFields,
        posinset: view.infiniteScrollEnabled ? index + 1 : void 0
      }
    );
  });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/activity/index.mjs
var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
function ViewActivity(props) {
  const { empty, data, fields, isLoading, view, className } = props;
  const isDelayedLoading = useDelayedLoading(!!isLoading);
  const hasData = !!data?.length;
  const groupField = view.groupBy?.field ? fields.find((field) => field.id === view.groupBy?.field) : null;
  const dataByGroup = hasData && groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  if (!hasData) {
    return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
      "div",
      {
        className: clsx_default("dataviews-no-results", {
          "is-refreshing": isDelayedLoading
        }),
        children: empty
      }
    );
  }
  const isInert = !isInfiniteScroll && !!isLoading;
  const wrapperClassName = clsx_default("dataviews-view-activity", className, {
    "is-refreshing": !isInfiniteScroll && isDelayedLoading
  });
  const groupedEntries = dataByGroup ? Array.from(dataByGroup.entries()) : [];
  if (hasData && groupField && dataByGroup) {
    return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
      Stack,
      {
        direction: "column",
        gap: "sm",
        className: wrapperClassName,
        inert: isInert ? "true" : void 0,
        children: groupedEntries.map(
          ([groupName, groupData]) => /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
            ActivityGroup,
            {
              groupName,
              groupData,
              groupField,
              showLabel: view.groupBy?.showLabel !== false,
              children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
                ActivityItems,
                {
                  ...props,
                  data: groupData
                }
              )
            },
            groupName
          )
        )
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
      "div",
      {
        className: wrapperClassName,
        role: view.infiniteScrollEnabled ? "feed" : void 0,
        inert: isInert ? "true" : void 0,
        children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(ActivityItems, { ...props })
      }
    ),
    isInfiniteScroll && isLoading && /* @__PURE__ */ (0, import_jsx_runtime61.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_components14.Spinner, {}) })
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs
var import_components17 = __toESM(require_components(), 1);
var import_i18n18 = __toESM(require_i18n(), 1);
var import_compose7 = __toESM(require_compose(), 1);
var import_element28 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-picker-footer/index.mjs
var import_components16 = __toESM(require_components(), 1);
var import_data5 = __toESM(require_data(), 1);
var import_element27 = __toESM(require_element(), 1);
var import_i18n17 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-pagination/index.mjs
var import_components15 = __toESM(require_components(), 1);
var import_element26 = __toESM(require_element(), 1);
var import_i18n16 = __toESM(require_i18n(), 1);
var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
function DataViewsPagination() {
  const {
    view,
    onChangeView,
    paginationInfo: { totalItems = 0, totalPages }
  } = (0, import_element26.useContext)(dataviews_context_default);
  if (!totalItems || !totalPages || view.infiniteScrollEnabled) {
    return null;
  }
  const currentPage = view.page ?? 1;
  const pageSelectOptions = Array.from(Array(totalPages)).map(
    (_, i2) => {
      const page = i2 + 1;
      return {
        value: page.toString(),
        label: page.toString(),
        "aria-label": currentPage === page ? (0, import_i18n16.sprintf)(
          // translators: 1: current page number. 2: total number of pages.
          (0, import_i18n16.__)("Page %1$d of %2$d"),
          currentPage,
          totalPages
        ) : page.toString()
      };
    }
  );
  return !!totalItems && totalPages !== 1 && /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(
    Stack,
    {
      direction: "row",
      className: "dataviews-pagination",
      justify: "end",
      align: "center",
      gap: "xl",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
          Stack,
          {
            direction: "row",
            justify: "flex-start",
            align: "center",
            gap: "xs",
            className: "dataviews-pagination__page-select",
            children: (0, import_element26.createInterpolateElement)(
              (0, import_i18n16.sprintf)(
                // translators: 1: Current page number, 2: Total number of pages.
                (0, import_i18n16._x)(
                  "<div>Page</div>%1$s<div>of %2$d</div>",
                  "paging"
                ),
                "<CurrentPage />",
                totalPages
              ),
              {
                div: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)("div", { "aria-hidden": true }),
                CurrentPage: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
                  import_components15.SelectControl,
                  {
                    "aria-label": (0, import_i18n16.__)("Current page"),
                    value: currentPage.toString(),
                    options: pageSelectOptions,
                    onChange: (newValue) => {
                      onChangeView({
                        ...view,
                        page: +newValue
                      });
                    },
                    size: "small",
                    variant: "minimal"
                  }
                )
              }
            )
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(Stack, { direction: "row", gap: "xs", align: "center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
            import_components15.Button,
            {
              onClick: () => onChangeView({
                ...view,
                page: currentPage - 1
              }),
              disabled: currentPage === 1,
              accessibleWhenDisabled: true,
              label: (0, import_i18n16.__)("Previous page"),
              icon: (0, import_i18n16.isRTL)() ? next_default : previous_default,
              showTooltip: true,
              size: "compact",
              tooltipPosition: "top"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
            import_components15.Button,
            {
              onClick: () => onChangeView({ ...view, page: currentPage + 1 }),
              disabled: currentPage >= totalPages,
              accessibleWhenDisabled: true,
              label: (0, import_i18n16.__)("Next page"),
              icon: (0, import_i18n16.isRTL)() ? previous_default : next_default,
              showTooltip: true,
              size: "compact",
              tooltipPosition: "top"
            }
          )
        ] })
      ]
    }
  );
}
var dataviews_pagination_default = (0, import_element26.memo)(DataViewsPagination);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-picker-footer/index.mjs
var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
function useIsMultiselectPicker(actions2) {
  return (0, import_element27.useMemo)(() => {
    return actions2?.every((action) => action.supportsBulk);
  }, [actions2]);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/picker-grid/index.mjs
var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
var { Badge: Badge4 } = unlock(import_components17.privateApis);
function GridItem3({
  view,
  multiselect,
  selection,
  onChangeSelection,
  getItemId,
  item,
  mediaField,
  titleField,
  descriptionField,
  regularFields,
  badgeFields,
  config,
  posinset,
  setsize
}) {
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const id = getItemId(item);
  const elementRef = (0, import_element28.useRef)(null);
  const isSelected2 = selection.includes(id);
  const setElementRef = (element) => {
    elementRef.current = element;
  };
  useIntersectionObserver(elementRef, posinset);
  const renderedMediaField = mediaField?.render ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
    mediaField.render,
    {
      item,
      field: mediaField,
      config
    }
  ) : null;
  const renderedTitleField = showTitle && titleField?.render ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(titleField.render, { item, field: titleField }) : null;
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
    import_components17.Composite.Item,
    {
      ref: setElementRef,
      "aria-label": titleField ? titleField.getValue({ item }) || (0, import_i18n18.__)("(no title)") : void 0,
      render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(Stack, { direction: "column", children, ...props }),
      role: "option",
      "aria-posinset": posinset,
      "aria-setsize": setsize,
      className: clsx_default("dataviews-view-picker-grid__card", {
        "is-selected": isSelected2
      }),
      "aria-selected": isSelected2,
      onClick: () => {
        if (isSelected2) {
          onChangeSelection(
            selection.filter((itemId) => id !== itemId)
          );
        } else {
          const newSelection = multiselect ? [...selection, id] : [id];
          onChangeSelection(newSelection);
        }
      },
      children: [
        showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "dataviews-view-picker-grid__media", children: renderedMediaField }),
        showMedia && renderedMediaField && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          DataViewsSelectionCheckbox,
          {
            item,
            selection,
            onChangeSelection,
            getItemId,
            titleField,
            disabled: false,
            "aria-hidden": true,
            tabIndex: -1
          }
        ),
        showTitle && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          Stack,
          {
            direction: "row",
            justify: "space-between",
            className: "dataviews-view-picker-grid__title-actions",
            children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("div", { className: "dataviews-view-picker-grid__title-field dataviews-title-field", children: renderedTitleField })
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(Stack, { direction: "column", gap: "xs", children: [
          showDescription && descriptionField?.render && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            descriptionField.render,
            {
              item,
              field: descriptionField
            }
          ),
          !!badgeFields?.length && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            Stack,
            {
              direction: "row",
              className: "dataviews-view-picker-grid__badge-fields",
              gap: "sm",
              wrap: "wrap",
              align: "top",
              justify: "flex-start",
              children: badgeFields.map((field) => {
                return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                  Badge4,
                  {
                    className: "dataviews-view-picker-grid__field-value",
                    children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                      field.render,
                      {
                        item,
                        field
                      }
                    )
                  },
                  field.id
                );
              })
            }
          ),
          !!regularFields?.length && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            Stack,
            {
              direction: "column",
              className: "dataviews-view-picker-grid__fields",
              gap: "xs",
              children: regularFields.map((field) => {
                return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                  import_components17.Flex,
                  {
                    className: "dataviews-view-picker-grid__field",
                    gap: 1,
                    justify: "flex-start",
                    expanded: true,
                    style: { height: "auto" },
                    direction: "row",
                    children: /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, { children: [
                      /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components17.FlexItem, { className: "dataviews-view-picker-grid__field-name", children: field.header }),
                      /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                        import_components17.FlexItem,
                        {
                          className: "dataviews-view-picker-grid__field-value",
                          style: { maxHeight: "none" },
                          children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                            field.render,
                            {
                              item,
                              field
                            }
                          )
                        }
                      )
                    ] })
                  },
                  field.id
                );
              })
            }
          )
        ] })
      ]
    },
    id
  );
}
function GridGroup({
  groupName,
  groupField,
  showLabel = true,
  children
}) {
  const headerId = (0, import_compose7.useInstanceId)(
    GridGroup,
    "dataviews-view-picker-grid-group__header"
  );
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
    Stack,
    {
      direction: "column",
      gap: "sm",
      role: "group",
      "aria-labelledby": headerId,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
          "h3",
          {
            className: "dataviews-view-picker-grid-group__header",
            id: headerId,
            children: showLabel ? (0, import_i18n18.sprintf)(
              // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
              (0, import_i18n18.__)("%1$s: %2$s"),
              groupField.label,
              groupName
            ) : groupName
          }
        ),
        children
      ]
    },
    groupName
  );
}
function ViewPickerGrid({
  actions: actions2,
  data,
  fields,
  getItemId,
  isLoading,
  onChangeSelection,
  selection,
  view,
  className,
  empty
}) {
  const { resizeObserverRef, paginationInfo, itemListLabel } = (0, import_element28.useContext)(dataviews_context_default);
  const titleField = fields.find(
    (field) => field.id === view?.titleField
  );
  const mediaField = fields.find(
    (field) => field.id === view?.mediaField
  );
  const descriptionField = fields.find(
    (field) => field.id === view?.descriptionField
  );
  const otherFields = view.fields ?? [];
  const { regularFields, badgeFields } = otherFields.reduce(
    (accumulator, fieldId) => {
      const field = fields.find((f2) => f2.id === fieldId);
      if (!field) {
        return accumulator;
      }
      const key = view.layout?.badgeFields?.includes(fieldId) ? "badgeFields" : "regularFields";
      accumulator[key].push(field);
      return accumulator;
    },
    { regularFields: [], badgeFields: [] }
  );
  const hasData = !!data?.length;
  const usedPreviewSize = view.layout?.previewSize;
  const isMultiselect = useIsMultiselectPicker(actions2);
  const size = "900px";
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = (view.infiniteScrollEnabled && !dataByGroup) ?? false;
  const currentPage = view?.page ?? 1;
  const perPage = view?.perPage ?? 0;
  const setSize = isInfiniteScroll ? paginationInfo?.totalItems : void 0;
  const gridColumns = useGridColumns();
  const placeholdersNeeded = usePlaceholdersNeeded(
    data,
    isInfiniteScroll,
    gridColumns
  );
  return /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(import_jsx_runtime64.Fragment, {
    // Render multiple groups.
    children: [
      hasData && groupField && dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
        import_components17.Composite,
        {
          virtualFocus: true,
          orientation: "horizontal",
          role: "listbox",
          "aria-multiselectable": isMultiselect,
          className: clsx_default(
            "dataviews-view-picker-grid",
            className,
            {
              [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
                view.layout.density
              )
            }
          ),
          "aria-label": itemListLabel,
          render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            Stack,
            {
              direction: "column",
              gap: "lg",
              children,
              ...props
            }
          ),
          children: Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
              GridGroup,
              {
                groupName,
                groupField,
                showLabel: view.groupBy?.showLabel !== false,
                children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                  GridItems,
                  {
                    previewSize: usedPreviewSize,
                    style: {
                      gridTemplateColumns: usedPreviewSize && `repeat(auto-fill, minmax(${usedPreviewSize}px, 1fr))`
                    },
                    "aria-busy": isLoading,
                    ref: resizeObserverRef,
                    children: groupItems.map((item) => {
                      const posInSet = item.position ?? (currentPage - 1) * perPage + data.indexOf(item) + 1;
                      return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                        GridItem3,
                        {
                          view,
                          multiselect: isMultiselect,
                          selection,
                          onChangeSelection,
                          getItemId,
                          item,
                          mediaField,
                          titleField,
                          descriptionField,
                          regularFields,
                          badgeFields,
                          config: {
                            sizes: size
                          },
                          posinset: posInSet,
                          setsize: setSize
                        },
                        getItemId(item)
                      );
                    })
                  }
                )
              },
              groupName
            )
          )
        }
      ),
      // Render a single grid with all data.
      hasData && !dataByGroup && /* @__PURE__ */ (0, import_jsx_runtime64.jsxs)(
        import_components17.Composite,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
            GridItems,
            {
              className: clsx_default(
                "dataviews-view-picker-grid",
                className,
                {
                  [`has-${view.layout?.density}-density`]: view.layout?.density && [
                    "compact",
                    "comfortable"
                  ].includes(view.layout.density)
                }
              ),
              previewSize: usedPreviewSize,
              "aria-busy": isLoading,
              ref: resizeObserverRef
            }
          ),
          virtualFocus: true,
          orientation: "horizontal",
          role: "listbox",
          "aria-multiselectable": isMultiselect,
          "aria-label": itemListLabel,
          children: [
            Array.from({ length: placeholdersNeeded }).map(
              (_, index) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                import_components17.Composite.Item,
                {
                  render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                    Stack,
                    {
                      direction: "column",
                      children,
                      ...props
                    }
                  ),
                  role: "option",
                  "aria-hidden": true,
                  tabIndex: -1,
                  className: "dataviews-view-picker-grid__card dataviews-view-picker-grid__placeholder"
                },
                `placeholder-${index}`
              )
            ),
            data.map((item) => {
              const posinset = item.position;
              return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
                GridItem3,
                {
                  view,
                  multiselect: isMultiselect,
                  selection,
                  onChangeSelection,
                  getItemId,
                  item,
                  mediaField,
                  titleField,
                  descriptionField,
                  regularFields,
                  badgeFields,
                  config: {
                    sizes: size
                  },
                  posinset,
                  setsize: setSize
                },
                getItemId(item)
              );
            })
          ]
        }
      ),
      // Render empty state.
      !hasData && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
        "div",
        {
          className: clsx_default({
            "dataviews-loading": isLoading,
            "dataviews-no-results": !isLoading
          }),
          children: isLoading ? /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components17.Spinner, {}) }) : empty
        }
      ),
      hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime64.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_components17.Spinner, {}) })
    ]
  });
}
var picker_grid_default = ViewPickerGrid;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/picker-table/index.mjs
var import_i18n19 = __toESM(require_i18n(), 1);
var import_components18 = __toESM(require_components(), 1);
var import_element29 = __toESM(require_element(), 1);
var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
function TableColumnField2({
  item,
  fields,
  column,
  align
}) {
  const field = fields.find((f2) => f2.id === column);
  if (!field) {
    return null;
  }
  const className = clsx_default("dataviews-view-table__cell-content-wrapper", {
    "dataviews-view-table__cell-align-end": align === "end",
    "dataviews-view-table__cell-align-center": align === "center"
  });
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className, children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(field.render, { item, field }) });
}
function TableRow2({
  item,
  fields,
  id,
  view,
  titleField,
  mediaField,
  descriptionField,
  selection,
  getItemId,
  onChangeSelection,
  multiselect,
  posinset
}) {
  const { paginationInfo } = (0, import_element29.useContext)(dataviews_context_default);
  const isSelected2 = selection.includes(id);
  const [isHovered, setIsHovered] = (0, import_element29.useState)(false);
  const elementRef = (0, import_element29.useRef)(null);
  const setElementRef = (element) => {
    elementRef.current = element;
  };
  useIntersectionObserver(elementRef, posinset);
  const {
    showTitle = true,
    showMedia = true,
    showDescription = true,
    infiniteScrollEnabled
  } = view;
  const handleMouseEnter = () => {
    setIsHovered(true);
  };
  const handleMouseLeave = () => {
    setIsHovered(false);
  };
  const columns = view.fields ?? [];
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
    import_components18.Composite.Item,
    {
      ref: setElementRef,
      render: ({ children, ...props }) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
        "tr",
        {
          className: clsx_default("dataviews-view-table__row", {
            "is-selected": isSelected2,
            "is-hovered": isHovered
          }),
          onMouseEnter: handleMouseEnter,
          onMouseLeave: handleMouseLeave,
          children,
          ...props
        }
      ),
      "aria-selected": isSelected2,
      "aria-setsize": paginationInfo.totalItems || void 0,
      "aria-posinset": posinset,
      role: infiniteScrollEnabled ? "article" : "option",
      onClick: () => {
        if (isSelected2) {
          onChangeSelection(
            selection.filter((itemId) => id !== itemId)
          );
        } else {
          const newSelection = multiselect ? [...selection, id] : [id];
          onChangeSelection(newSelection);
        }
      },
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          "td",
          {
            className: "dataviews-view-table__checkbox-column",
            role: "presentation",
            children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "dataviews-view-table__cell-content-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
              DataViewsSelectionCheckbox,
              {
                item,
                selection,
                onChangeSelection,
                getItemId,
                titleField,
                disabled: false,
                "aria-hidden": true,
                tabIndex: -1
              }
            ) })
          }
        ),
        hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("td", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
          column_primary_default,
          {
            item,
            titleField: showTitle ? titleField : void 0,
            mediaField: showMedia ? mediaField : void 0,
            descriptionField: showDescription ? descriptionField : void 0,
            isItemClickable: () => false
          }
        ) }),
        columns.map((column) => {
          const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
          return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            "td",
            {
              style: {
                width,
                maxWidth,
                minWidth
              },
              role: "presentation",
              children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                TableColumnField2,
                {
                  fields,
                  item,
                  column,
                  align
                }
              )
            },
            column
          );
        })
      ]
    },
    id
  );
}
function ViewPickerTable({
  actions: actions2,
  data,
  fields,
  getItemId,
  isLoading = false,
  onChangeView,
  onChangeSelection,
  selection,
  setOpenedFilter,
  view,
  className,
  empty
}) {
  const headerMenuRefs = (0, import_element29.useRef)(/* @__PURE__ */ new Map());
  const headerMenuToFocusRef = (0, import_element29.useRef)(void 0);
  const [nextHeaderMenuToFocus, setNextHeaderMenuToFocus] = (0, import_element29.useState)();
  const isMultiselect = useIsMultiselectPicker(actions2) ?? false;
  (0, import_element29.useEffect)(() => {
    if (headerMenuToFocusRef.current) {
      headerMenuToFocusRef.current.focus();
      headerMenuToFocusRef.current = void 0;
    }
  });
  const groupField = view.groupBy?.field ? fields.find((f2) => f2.id === view.groupBy?.field) : null;
  const dataByGroup = groupField ? getDataByGroup(data, groupField) : null;
  const isInfiniteScroll = view.infiniteScrollEnabled && !dataByGroup;
  const tableNoticeId = (0, import_element29.useId)();
  if (nextHeaderMenuToFocus) {
    headerMenuToFocusRef.current = nextHeaderMenuToFocus;
    setNextHeaderMenuToFocus(void 0);
    return;
  }
  const onHide = (field) => {
    const hidden = headerMenuRefs.current.get(field.id);
    const fallback = hidden ? headerMenuRefs.current.get(hidden.fallback) : void 0;
    setNextHeaderMenuToFocus(fallback?.node);
  };
  const hasData = !!data?.length;
  const titleField = fields.find((field) => field.id === view.titleField);
  const mediaField = fields.find((field) => field.id === view.mediaField);
  const descriptionField = fields.find(
    (field) => field.id === view.descriptionField
  );
  const { showTitle = true, showMedia = true, showDescription = true } = view;
  const hasPrimaryColumn = titleField && showTitle || mediaField && showMedia || descriptionField && showDescription;
  const columns = view.fields ?? [];
  const headerMenuRef = (column, index) => (node) => {
    if (node) {
      headerMenuRefs.current.set(column, {
        node,
        fallback: columns[index > 0 ? index - 1 : 1]
      });
    } else {
      headerMenuRefs.current.delete(column);
    }
  };
  return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(import_jsx_runtime65.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
      "table",
      {
        className: clsx_default(
          "dataviews-view-table",
          "dataviews-view-picker-table",
          className,
          {
            [`has-${view.layout?.density}-density`]: view.layout?.density && ["compact", "comfortable"].includes(
              view.layout.density
            )
          }
        ),
        "aria-busy": isLoading,
        "aria-describedby": tableNoticeId,
        role: isInfiniteScroll ? "feed" : "listbox",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("thead", { role: "presentation", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
            "tr",
            {
              className: "dataviews-view-table__row",
              role: "presentation",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("th", { className: "dataviews-view-table__checkbox-column", children: isMultiselect && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                  BulkSelectionCheckbox,
                  {
                    selection,
                    onChangeSelection,
                    data,
                    actions: actions2,
                    getItemId,
                    disableSelectAll: isInfiniteScroll
                  }
                ) }),
                hasPrimaryColumn && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("th", { children: titleField && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                  column_header_menu_default,
                  {
                    ref: headerMenuRef(
                      titleField.id,
                      0
                    ),
                    fieldId: titleField.id,
                    view,
                    fields,
                    onChangeView,
                    onHide,
                    setOpenedFilter,
                    canMove: false
                  }
                ) }),
                columns.map((column, index) => {
                  const { width, maxWidth, minWidth, align } = view.layout?.styles?.[column] ?? {};
                  return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                    "th",
                    {
                      style: {
                        width,
                        maxWidth,
                        minWidth,
                        textAlign: align
                      },
                      "aria-sort": view.sort?.direction && view.sort?.field === column ? sortValues[view.sort.direction] : void 0,
                      scope: "col",
                      children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                        column_header_menu_default,
                        {
                          ref: headerMenuRef(column, index),
                          fieldId: column,
                          view,
                          fields,
                          onChangeView,
                          onHide,
                          setOpenedFilter,
                          canMove: view.layout?.enableMoving ?? true
                        }
                      )
                    },
                    column
                  );
                })
              ]
            }
          ) }),
          hasData && groupField && dataByGroup ? Array.from(dataByGroup.entries()).map(
            ([groupName, groupItems]) => /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
              import_components18.Composite,
              {
                virtualFocus: true,
                orientation: "vertical",
                render: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tbody", { role: "group" }),
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                    "tr",
                    {
                      className: "dataviews-view-table__group-header-row",
                      role: "presentation",
                      children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                        "td",
                        {
                          colSpan: columns.length + (hasPrimaryColumn ? 1 : 0) + 1,
                          className: "dataviews-view-table__group-header-cell",
                          role: "presentation",
                          children: view.groupBy?.showLabel === false ? groupName : (0, import_i18n19.sprintf)(
                            // translators: 1: The label of the field e.g. "Date". 2: The value of the field, e.g.: "May 2022".
                            (0, import_i18n19.__)("%1$s: %2$s"),
                            groupField.label,
                            groupName
                          )
                        }
                      )
                    }
                  ),
                  groupItems.map((item, index) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                    TableRow2,
                    {
                      item,
                      fields,
                      id: getItemId(item) || index.toString(),
                      view,
                      titleField,
                      mediaField,
                      descriptionField,
                      selection,
                      getItemId,
                      onChangeSelection,
                      multiselect: isMultiselect
                    },
                    getItemId(item)
                  ))
                ]
              },
              `group-${groupName}`
            )
          ) : /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
            import_components18.Composite,
            {
              render: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("tbody", { role: "presentation" }),
              virtualFocus: true,
              orientation: "vertical",
              children: hasData && data.map((item, index) => {
                const itemId = getItemId(item);
                const posinset = item.position;
                return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
                  TableRow2,
                  {
                    item,
                    fields,
                    id: itemId || index.toString(),
                    view,
                    titleField,
                    mediaField,
                    descriptionField,
                    selection,
                    getItemId,
                    onChangeSelection,
                    multiselect: isMultiselect,
                    posinset
                  },
                  itemId
                );
              })
            }
          )
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)(
      "div",
      {
        className: clsx_default({
          "dataviews-loading": isLoading,
          "dataviews-no-results": !hasData && !isLoading
        }),
        id: tableNoticeId,
        children: [
          !hasData && (isLoading ? /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components18.Spinner, {}) }) : empty),
          hasData && isLoading && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("p", { className: "dataviews-loading-more", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components18.Spinner, {}) })
        ]
      }
    )
  ] });
}
var picker_table_default = ViewPickerTable;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/density-picker.mjs
var import_components19 = __toESM(require_components(), 1);
var import_i18n20 = __toESM(require_i18n(), 1);
var import_element30 = __toESM(require_element(), 1);
var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
function DensityPicker() {
  const context = (0, import_element30.useContext)(dataviews_context_default);
  const view = context.view;
  return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(
    import_components19.__experimentalToggleGroupControl,
    {
      size: "__unstable-large",
      label: (0, import_i18n20.__)("Density"),
      value: view.layout?.density || "balanced",
      onChange: (value) => {
        context.onChangeView({
          ...view,
          layout: {
            ...view.layout,
            density: value
          }
        });
      },
      isBlock: true,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
          import_components19.__experimentalToggleGroupControlOption,
          {
            value: "comfortable",
            label: (0, import_i18n20._x)(
              "Comfortable",
              "Density option for DataView layout"
            )
          },
          "comfortable"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
          import_components19.__experimentalToggleGroupControlOption,
          {
            value: "balanced",
            label: (0, import_i18n20._x)("Balanced", "Density option for DataView layout")
          },
          "balanced"
        ),
        /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
          import_components19.__experimentalToggleGroupControlOption,
          {
            value: "compact",
            label: (0, import_i18n20._x)("Compact", "Density option for DataView layout")
          },
          "compact"
        )
      ]
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/preview-size-picker.mjs
var import_components20 = __toESM(require_components(), 1);
var import_i18n21 = __toESM(require_i18n(), 1);
var import_element31 = __toESM(require_element(), 1);
var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
var imageSizes2 = [
  {
    value: 120,
    breakpoint: 1
  },
  {
    value: 170,
    breakpoint: 1
  },
  {
    value: 230,
    breakpoint: 1
  },
  {
    value: 290,
    breakpoint: 1112
    // at minimum image width, 4 images display at this container size
  },
  {
    value: 350,
    breakpoint: 1636
    // at minimum image width, 6 images display at this container size
  },
  {
    value: 430,
    breakpoint: 588
    // at minimum image width, 2 images display at this container size
  }
];
function PreviewSizePicker() {
  const context = (0, import_element31.useContext)(dataviews_context_default);
  const view = context.view;
  const breakValues = imageSizes2.filter((size) => {
    return context.containerWidth >= size.breakpoint;
  });
  const layoutPreviewSize = view.layout?.previewSize ?? 230;
  const previewSizeToUse = breakValues.map((size, index) => ({ ...size, index })).filter((size) => size.value <= layoutPreviewSize).sort((a2, b2) => b2.value - a2.value)[0]?.index ?? 0;
  const marks = breakValues.map((size, index) => {
    return {
      value: index
    };
  });
  return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
    import_components20.RangeControl,
    {
      __next40pxDefaultSize: true,
      showTooltip: false,
      label: (0, import_i18n21.__)("Preview size"),
      value: previewSizeToUse,
      min: 0,
      max: breakValues.length - 1,
      withInputField: false,
      onChange: (value = 0) => {
        context.onChangeView({
          ...view,
          layout: {
            ...view.layout,
            previewSize: breakValues[value].value
          }
        });
      },
      step: 1,
      marks
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/utils/grid-config-options.mjs
var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
function GridConfigOptions() {
  return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(DensityPicker, {}),
    /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(PreviewSizePicker, {})
  ] });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layouts/index.mjs
var VIEW_LAYOUTS = [
  {
    type: LAYOUT_TABLE,
    label: (0, import_i18n22.__)("Table"),
    component: table_default,
    icon: block_table_default,
    viewConfigOptions: DensityPicker
  },
  {
    type: LAYOUT_GRID,
    label: (0, import_i18n22.__)("Grid"),
    component: grid_default,
    icon: category_default,
    viewConfigOptions: GridConfigOptions
  },
  {
    type: LAYOUT_LIST,
    label: (0, import_i18n22.__)("List"),
    component: ViewList,
    icon: (0, import_i18n22.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default,
    viewConfigOptions: DensityPicker
  },
  {
    type: LAYOUT_ACTIVITY,
    label: (0, import_i18n22.__)("Activity"),
    component: ViewActivity,
    icon: scheduled_default,
    viewConfigOptions: DensityPicker
  },
  {
    type: LAYOUT_PICKER_GRID,
    label: (0, import_i18n22.__)("Grid"),
    component: picker_grid_default,
    icon: category_default,
    viewConfigOptions: GridConfigOptions,
    isPicker: true
  },
  {
    type: LAYOUT_PICKER_TABLE,
    label: (0, import_i18n22.__)("Table"),
    component: picker_table_default,
    icon: block_table_default,
    viewConfigOptions: DensityPicker,
    isPicker: true
  }
];

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.mjs
var import_element39 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.mjs
var import_components23 = __toESM(require_components(), 1);
var import_i18n25 = __toESM(require_i18n(), 1);
var import_element36 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/UWJK2WK2.js
function noop2(..._) {
}
function applyState(argument, currentValue) {
  if (isUpdater(argument)) {
    const value = isLazyValue(currentValue) ? currentValue() : currentValue;
    return argument(value);
  }
  return argument;
}
function isUpdater(argument) {
  return typeof argument === "function";
}
function isLazyValue(value) {
  return typeof value === "function";
}
function hasOwnProperty(object, prop) {
  if (typeof Object.hasOwn === "function") {
    return Object.hasOwn(object, prop);
  }
  return Object.prototype.hasOwnProperty.call(object, prop);
}
function chain(...fns) {
  return (...args) => {
    for (const fn of fns) {
      if (typeof fn === "function") {
        fn(...args);
      }
    }
  };
}
function normalizeString(str) {
  return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
}
function omit(object, keys) {
  const result = { ...object };
  for (const key of keys) {
    if (hasOwnProperty(result, key)) {
      delete result[key];
    }
  }
  return result;
}
function pick(object, paths) {
  const result = {};
  for (const key of paths) {
    if (hasOwnProperty(object, key)) {
      result[key] = object[key];
    }
  }
  return result;
}
function identity(value) {
  return value;
}
function invariant(condition, message2) {
  if (condition) return;
  if (typeof message2 !== "string") throw new Error("Invariant failed");
  throw new Error(message2);
}
function getKeys(obj) {
  return Object.keys(obj);
}
function isFalsyBooleanCallback(booleanOrCallback, ...args) {
  const result = typeof booleanOrCallback === "function" ? booleanOrCallback(...args) : booleanOrCallback;
  if (result == null) return false;
  return !result;
}
function disabledFromProps(props) {
  return props.disabled || props["aria-disabled"] === true || props["aria-disabled"] === "true";
}
function removeUndefinedValues(obj) {
  const result = {};
  for (const key in obj) {
    if (obj[key] !== void 0) {
      result[key] = obj[key];
    }
  }
  return result;
}
function defaultValue(...values) {
  for (const value of values) {
    if (value !== void 0) return value;
  }
  return void 0;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/YXGXYGQX.js
var import_react5 = __toESM(require_react(), 1);
function setRef(ref, value) {
  if (typeof ref === "function") {
    ref(value);
  } else if (ref) {
    ref.current = value;
  }
}
function isValidElementWithRef(element) {
  if (!element) return false;
  if (!(0, import_react5.isValidElement)(element)) return false;
  if ("ref" in element.props) return true;
  if ("ref" in element) return true;
  return false;
}
function getRefProperty(element) {
  if (!isValidElementWithRef(element)) return null;
  const props = { ...element.props };
  return props.ref || element.ref;
}
function mergeProps2(base, overrides) {
  const props = { ...base };
  for (const key in overrides) {
    if (!hasOwnProperty(overrides, key)) continue;
    if (key === "className") {
      const prop = "className";
      props[prop] = base[prop] ? `${base[prop]} ${overrides[prop]}` : overrides[prop];
      continue;
    }
    if (key === "style") {
      const prop = "style";
      props[prop] = base[prop] ? { ...base[prop], ...overrides[prop] } : overrides[prop];
      continue;
    }
    const overrideValue = overrides[key];
    if (typeof overrideValue === "function" && key.startsWith("on")) {
      const baseValue = base[key];
      if (typeof baseValue === "function") {
        props[key] = (...args) => {
          overrideValue(...args);
          baseValue(...args);
        };
        continue;
      }
    }
    props[key] = overrideValue;
  }
  return props;
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/G7XPWBXK.js
var canUseDOM = checkIsBrowser();
function checkIsBrowser() {
  var _a;
  return typeof window !== "undefined" && !!((_a = window.document) == null ? void 0 : _a.createElement);
}
function getDocument(node) {
  if (!node) return document;
  if ("self" in node) return node.document;
  return node.ownerDocument || document;
}
function getActiveElement(node, activeDescendant = false) {
  var _a;
  const { activeElement: activeElement2 } = getDocument(node);
  if (!(activeElement2 == null ? void 0 : activeElement2.nodeName)) {
    return null;
  }
  if (isFrame(activeElement2) && ((_a = activeElement2.contentDocument) == null ? void 0 : _a.body)) {
    return getActiveElement(
      activeElement2.contentDocument.body,
      activeDescendant
    );
  }
  if (activeDescendant) {
    const id = activeElement2.getAttribute("aria-activedescendant");
    if (id) {
      const element = getDocument(activeElement2).getElementById(id);
      if (element) {
        return element;
      }
    }
  }
  return activeElement2;
}
function contains2(parent, child) {
  return parent === child || parent.contains(child);
}
function isFrame(element) {
  return element.tagName === "IFRAME";
}
function isButton(element) {
  const tagName = element.tagName.toLowerCase();
  if (tagName === "button") return true;
  if (tagName === "input" && element.type) {
    return buttonInputTypes.indexOf(element.type) !== -1;
  }
  return false;
}
var buttonInputTypes = [
  "button",
  "color",
  "file",
  "image",
  "reset",
  "submit"
];
function isVisible(element) {
  if (typeof element.checkVisibility === "function") {
    return element.checkVisibility();
  }
  const htmlElement = element;
  return htmlElement.offsetWidth > 0 || htmlElement.offsetHeight > 0 || element.getClientRects().length > 0;
}
function isTextField(element) {
  try {
    const isTextInput = element instanceof HTMLInputElement && element.selectionStart !== null;
    const isTextArea = element.tagName === "TEXTAREA";
    return isTextInput || isTextArea || false;
  } catch (_error) {
    return false;
  }
}
function isTextbox(element) {
  return element.isContentEditable || isTextField(element);
}
function getTextboxValue(element) {
  if (isTextField(element)) {
    return element.value;
  }
  if (element.isContentEditable) {
    const range = getDocument(element).createRange();
    range.selectNodeContents(element);
    return range.toString();
  }
  return "";
}
function getTextboxSelection(element) {
  let start = 0;
  let end = 0;
  if (isTextField(element)) {
    start = element.selectionStart || 0;
    end = element.selectionEnd || 0;
  } else if (element.isContentEditable) {
    const selection = getDocument(element).getSelection();
    if ((selection == null ? void 0 : selection.rangeCount) && selection.anchorNode && contains2(element, selection.anchorNode) && selection.focusNode && contains2(element, selection.focusNode)) {
      const range = selection.getRangeAt(0);
      const nextRange = range.cloneRange();
      nextRange.selectNodeContents(element);
      nextRange.setEnd(range.startContainer, range.startOffset);
      start = nextRange.toString().length;
      nextRange.setEnd(range.endContainer, range.endOffset);
      end = nextRange.toString().length;
    }
  }
  return { start, end };
}
function getPopupRole(element, fallback) {
  const allowedPopupRoles = ["dialog", "menu", "listbox", "tree", "grid"];
  const role = element == null ? void 0 : element.getAttribute("role");
  if (role && allowedPopupRoles.indexOf(role) !== -1) {
    return role;
  }
  return fallback;
}
function getScrollingElement(element) {
  if (!element) return null;
  const isScrollableOverflow = (overflow) => {
    if (overflow === "auto") return true;
    if (overflow === "scroll") return true;
    return false;
  };
  if (element.clientHeight && element.scrollHeight > element.clientHeight) {
    const { overflowY } = getComputedStyle(element);
    if (isScrollableOverflow(overflowY)) return element;
  } else if (element.clientWidth && element.scrollWidth > element.clientWidth) {
    const { overflowX } = getComputedStyle(element);
    if (isScrollableOverflow(overflowX)) return element;
  }
  return getScrollingElement(element.parentElement) || document.scrollingElement || document.body;
}
function setSelectionRange(element, ...args) {
  if (/text|search|password|tel|url/i.test(element.type)) {
    element.setSelectionRange(...args);
  }
}
function sortBasedOnDOMPosition(items, getElement) {
  const pairs = items.map((item, index) => [index, item]);
  let isOrderDifferent = false;
  pairs.sort(([indexA, a2], [indexB, b2]) => {
    const elementA = getElement(a2);
    const elementB = getElement(b2);
    if (elementA === elementB) return 0;
    if (!elementA || !elementB) return 0;
    if (isElementPreceding(elementA, elementB)) {
      if (indexA > indexB) {
        isOrderDifferent = true;
      }
      return -1;
    }
    if (indexA < indexB) {
      isOrderDifferent = true;
    }
    return 1;
  });
  if (isOrderDifferent) {
    return pairs.map(([_, item]) => item);
  }
  return items;
}
function isElementPreceding(a2, b2) {
  return Boolean(
    b2.compareDocumentPosition(a2) & Node.DOCUMENT_POSITION_PRECEDING
  );
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/GMGLSF2B.js
function isTouchDevice() {
  return canUseDOM && !!navigator.maxTouchPoints;
}
function isApple() {
  if (!canUseDOM) return false;
  return /mac|iphone|ipad|ipod/i.test(navigator.platform);
}
function isSafari() {
  return canUseDOM && isApple() && /apple/i.test(navigator.vendor);
}
function isFirefox() {
  return canUseDOM && /firefox\//i.test(navigator.userAgent);
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/utils/events.js
function isPortalEvent(event) {
  return Boolean(
    event.currentTarget && !contains2(event.currentTarget, event.target)
  );
}
function isSelfTarget(event) {
  return event.target === event.currentTarget;
}
function isOpeningInNewTab(event) {
  const element = event.currentTarget;
  if (!element) return false;
  const isAppleDevice = isApple();
  if (isAppleDevice && !event.metaKey) return false;
  if (!isAppleDevice && !event.ctrlKey) return false;
  const tagName = element.tagName.toLowerCase();
  if (tagName === "a") return true;
  if (tagName === "button" && element.type === "submit") return true;
  if (tagName === "input" && element.type === "submit") return true;
  return false;
}
function isDownloading(event) {
  const element = event.currentTarget;
  if (!element) return false;
  const tagName = element.tagName.toLowerCase();
  if (!event.altKey) return false;
  if (tagName === "a") return true;
  if (tagName === "button" && element.type === "submit") return true;
  if (tagName === "input" && element.type === "submit") return true;
  return false;
}
function fireBlurEvent(element, eventInit) {
  const event = new FocusEvent("blur", eventInit);
  const defaultAllowed = element.dispatchEvent(event);
  const bubbleInit = { ...eventInit, bubbles: true };
  element.dispatchEvent(new FocusEvent("focusout", bubbleInit));
  return defaultAllowed;
}
function fireKeyboardEvent(element, type, eventInit) {
  const event = new KeyboardEvent(type, eventInit);
  return element.dispatchEvent(event);
}
function fireClickEvent(element, eventInit) {
  const event = new MouseEvent("click", eventInit);
  return element.dispatchEvent(event);
}
function isFocusEventOutside(event, container) {
  const containerElement = container || event.currentTarget;
  const relatedTarget = event.relatedTarget;
  return !relatedTarget || !contains2(containerElement, relatedTarget);
}
function queueBeforeEvent(element, type, callback, timeout) {
  const createTimer = (callback2) => {
    if (timeout) {
      const timerId2 = setTimeout(callback2, timeout);
      return () => clearTimeout(timerId2);
    }
    const timerId = requestAnimationFrame(callback2);
    return () => cancelAnimationFrame(timerId);
  };
  const cancelTimer = createTimer(() => {
    element.removeEventListener(type, callSync, true);
    callback();
  });
  const callSync = () => {
    cancelTimer();
    callback();
  };
  element.addEventListener(type, callSync, { once: true, capture: true });
  return cancelTimer;
}
function addGlobalEventListener(type, listener, options, scope = window) {
  const children = [];
  try {
    scope.document.addEventListener(type, listener, options);
    for (const frame of Array.from(scope.frames)) {
      children.push(addGlobalEventListener(type, listener, options, frame));
    }
  } catch {
  }
  const removeEventListener = () => {
    try {
      scope.document.removeEventListener(type, listener, options);
    } catch {
    }
    for (const remove of children) {
      remove();
    }
  };
  return removeEventListener;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/CEM7J6TT.js
var React32 = __toESM(require_react(), 1);
var import_react6 = __toESM(require_react(), 1);
var _React = { ...React32 };
var useReactId = _React.useId;
var useReactDeferredValue = _React.useDeferredValue;
var useReactInsertionEffect = _React.useInsertionEffect;
var useSafeLayoutEffect = canUseDOM ? import_react6.useLayoutEffect : import_react6.useEffect;
function useInitialValue(value) {
  const [initialValue] = (0, import_react6.useState)(value);
  return initialValue;
}
function useLiveRef(value) {
  const ref = (0, import_react6.useRef)(value);
  useSafeLayoutEffect(() => {
    ref.current = value;
  });
  return ref;
}
function useEvent(callback) {
  const ref = (0, import_react6.useRef)(() => {
    throw new Error("Cannot call an event handler while rendering.");
  });
  if (useReactInsertionEffect) {
    useReactInsertionEffect(() => {
      ref.current = callback;
    });
  } else {
    ref.current = callback;
  }
  return (0, import_react6.useCallback)((...args) => {
    var _a;
    return (_a = ref.current) == null ? void 0 : _a.call(ref, ...args);
  }, []);
}
function useTransactionState(callback) {
  const [state, setState] = (0, import_react6.useState)(null);
  useSafeLayoutEffect(() => {
    if (state == null) return;
    if (!callback) return;
    let prevState = null;
    callback((prev) => {
      prevState = prev;
      return state;
    });
    return () => {
      callback(prevState);
    };
  }, [state, callback]);
  return [state, setState];
}
function useMergeRefs2(...refs) {
  return (0, import_react6.useMemo)(() => {
    if (!refs.some(Boolean)) return;
    return (value) => {
      for (const ref of refs) {
        setRef(ref, value);
      }
    };
  }, refs);
}
function useId4(defaultId) {
  if (useReactId) {
    const reactId = useReactId();
    if (defaultId) return defaultId;
    return reactId;
  }
  const [id, setId] = (0, import_react6.useState)(defaultId);
  useSafeLayoutEffect(() => {
    if (defaultId || id) return;
    const random = Math.random().toString(36).slice(2, 8);
    setId(`id-${random}`);
  }, [defaultId, id]);
  return defaultId || id;
}
function useTagName(refOrElement, type) {
  const stringOrUndefined = (type2) => {
    if (typeof type2 !== "string") return;
    return type2;
  };
  const [tagName, setTagName] = (0, import_react6.useState)(() => stringOrUndefined(type));
  useSafeLayoutEffect(() => {
    const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
    setTagName((element == null ? void 0 : element.tagName.toLowerCase()) || stringOrUndefined(type));
  }, [refOrElement, type]);
  return tagName;
}
function useAttribute(refOrElement, attributeName, defaultValue2) {
  const initialValue = useInitialValue(defaultValue2);
  const [attribute, setAttribute] = (0, import_react6.useState)(initialValue);
  (0, import_react6.useEffect)(() => {
    const element = refOrElement && "current" in refOrElement ? refOrElement.current : refOrElement;
    if (!element) return;
    const callback = () => {
      const value = element.getAttribute(attributeName);
      setAttribute(value == null ? initialValue : value);
    };
    const observer = new MutationObserver(callback);
    observer.observe(element, { attributeFilter: [attributeName] });
    callback();
    return () => observer.disconnect();
  }, [refOrElement, attributeName, initialValue]);
  return attribute;
}
function useUpdateEffect(effect, deps) {
  const mounted = (0, import_react6.useRef)(false);
  (0, import_react6.useEffect)(() => {
    if (mounted.current) {
      return effect();
    }
    mounted.current = true;
  }, deps);
  (0, import_react6.useEffect)(
    () => () => {
      mounted.current = false;
    },
    []
  );
}
function useUpdateLayoutEffect(effect, deps) {
  const mounted = (0, import_react6.useRef)(false);
  useSafeLayoutEffect(() => {
    if (mounted.current) {
      return effect();
    }
    mounted.current = true;
  }, deps);
  useSafeLayoutEffect(
    () => () => {
      mounted.current = false;
    },
    []
  );
}
function useForceUpdate() {
  return (0, import_react6.useReducer)(() => [], []);
}
function useBooleanEvent(booleanOrCallback) {
  return useEvent(
    typeof booleanOrCallback === "function" ? booleanOrCallback : () => booleanOrCallback
  );
}
function useWrapElement(props, callback, deps = []) {
  const wrapElement = (0, import_react6.useCallback)(
    (element) => {
      if (props.wrapElement) {
        element = props.wrapElement(element);
      }
      return callback(element);
    },
    // oxlint-disable-next-line exhaustive-deps
    [...deps, props.wrapElement]
  );
  return { ...props, wrapElement };
}
function useMetadataProps(props, key, value) {
  const parent = props.onLoadedMetadataCapture;
  const onLoadedMetadataCapture = (0, import_react6.useMemo)(() => {
    return Object.assign(
      () => {
      },
      parent,
      ...value !== void 0 ? [{ [key]: value }] : []
    );
  }, [parent, key, value]);
  return [parent == null ? void 0 : parent[key], { onLoadedMetadataCapture }];
}
var hasInstalledGlobalEventListeners = false;
function useIsMouseMoving() {
  (0, import_react6.useEffect)(() => {
    if (hasInstalledGlobalEventListeners) return;
    addGlobalEventListener("mousemove", setMouseMoving, true);
    addGlobalEventListener("mousedown", resetMouseMoving, true);
    addGlobalEventListener("mouseup", resetMouseMoving, true);
    addGlobalEventListener("keydown", resetMouseMoving, true);
    addGlobalEventListener("scroll", resetMouseMoving, true);
    hasInstalledGlobalEventListeners = true;
  }, []);
  const isMouseMoving = useEvent(() => mouseMoving);
  return isMouseMoving;
}
var mouseMoving = false;
var previousScreenX = 0;
var previousScreenY = 0;
function hasMouseMovement(event) {
  const movementX = event.movementX || event.screenX - previousScreenX;
  const movementY = event.movementY || event.screenY - previousScreenY;
  previousScreenX = event.screenX;
  previousScreenY = event.screenY;
  return movementX || movementY || false;
}
function setMouseMoving(event) {
  if (!hasMouseMovement(event)) return;
  mouseMoving = true;
}
function resetMouseMoving() {
  mouseMoving = false;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/TVXRYIJB.js
var React33 = __toESM(require_react(), 1);
var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
function forwardRef22(render4) {
  const Role = React33.forwardRef(
    // @ts-ignore Incompatible with React 19 types. Ignore for now.
    (props, ref) => render4({ ...props, ref })
  );
  Role.displayName = render4.displayName || render4.name;
  return Role;
}
function memo22(Component, propsAreEqual) {
  return React33.memo(Component, propsAreEqual);
}
function createElement3(Type, props) {
  const { wrapElement, render: render4, ...rest } = props;
  const mergedRef = useMergeRefs2(props.ref, getRefProperty(render4));
  let element;
  if (React33.isValidElement(render4)) {
    const renderProps = {
      // @ts-ignore Incompatible with React 19 types. Ignore for now.
      ...render4.props,
      ref: mergedRef
    };
    element = React33.cloneElement(render4, mergeProps2(rest, renderProps));
  } else if (render4) {
    element = render4(rest);
  } else {
    element = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Type, { ...rest });
  }
  if (wrapElement) {
    return wrapElement(element);
  }
  return element;
}
function createHook(useProps) {
  const useRole = (props = {}) => {
    return useProps(props);
  };
  useRole.displayName = useProps.name;
  return useRole;
}
function createStoreContext(providers = [], scopedProviders = []) {
  const context = React33.createContext(void 0);
  const scopedContext = React33.createContext(void 0);
  const useContext210 = () => React33.useContext(context);
  const useScopedContext = (onlyScoped = false) => {
    const scoped = React33.useContext(scopedContext);
    const store5 = useContext210();
    if (onlyScoped) return scoped;
    return scoped || store5;
  };
  const useProviderContext = () => {
    const scoped = React33.useContext(scopedContext);
    const store5 = useContext210();
    if (scoped && scoped === store5) return;
    return store5;
  };
  const ContextProvider = (props) => {
    return providers.reduceRight(
      (children, Provider) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Provider, { ...props, children }),
      /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(context.Provider, { ...props })
    );
  };
  const ScopedContextProvider = (props) => {
    return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(ContextProvider, { ...props, children: scopedProviders.reduceRight(
      (children, Provider) => /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Provider, { ...props, children }),
      /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(scopedContext.Provider, { ...props })
    ) });
  };
  return {
    context,
    scopedContext,
    useContext: useContext210,
    useScopedContext,
    useProviderContext,
    ContextProvider,
    ScopedContextProvider
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/FQHJBBMI.js
var ctx = createStoreContext();
var useCollectionContext = ctx.useContext;
var useCollectionScopedContext = ctx.useScopedContext;
var useCollectionProviderContext = ctx.useProviderContext;
var CollectionContextProvider = ctx.ContextProvider;
var CollectionScopedContextProvider = ctx.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/55FNNNML.js
var import_react7 = __toESM(require_react(), 1);
var ctx2 = createStoreContext(
  [CollectionContextProvider],
  [CollectionScopedContextProvider]
);
var useCompositeContext = ctx2.useContext;
var useCompositeScopedContext = ctx2.useScopedContext;
var useCompositeProviderContext = ctx2.useProviderContext;
var CompositeContextProvider = ctx2.ContextProvider;
var CompositeScopedContextProvider = ctx2.ScopedContextProvider;
var CompositeItemContext = (0, import_react7.createContext)(
  void 0
);
var CompositeRowContext = (0, import_react7.createContext)(
  void 0
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/7NJRHOSP.js
function findFirstEnabledItem(items, excludeId) {
  return items.find((item) => {
    if (excludeId) {
      return !item.disabled && item.id !== excludeId;
    }
    return !item.disabled;
  });
}
function getEnabledItem(store5, id) {
  if (!id) return null;
  return store5.item(id) || null;
}
function groupItemsByRows(items) {
  const rows = [];
  for (const item of items) {
    const row = rows.find((currentRow) => {
      var _a;
      return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
    });
    if (row) {
      row.push(item);
    } else {
      rows.push([item]);
    }
  }
  return rows;
}
function selectTextField(element, collapseToEnd = false) {
  if (isTextField(element)) {
    element.setSelectionRange(
      collapseToEnd ? element.value.length : 0,
      element.value.length
    );
  } else if (element.isContentEditable) {
    const selection = getDocument(element).getSelection();
    selection == null ? void 0 : selection.selectAllChildren(element);
    if (collapseToEnd) {
      selection == null ? void 0 : selection.collapseToEnd();
    }
  }
}
var FOCUS_SILENTLY = /* @__PURE__ */ Symbol("FOCUS_SILENTLY");
function focusSilently(element) {
  element[FOCUS_SILENTLY] = true;
  element.focus({ preventScroll: true });
}
function silentlyFocused(element) {
  const isSilentlyFocused = element[FOCUS_SILENTLY];
  delete element[FOCUS_SILENTLY];
  return isSilentlyFocused;
}
function isItem(store5, element, exclude) {
  if (!element) return false;
  if (element === exclude) return false;
  const item = store5.item(element.id);
  if (!item) return false;
  if (exclude && item.element === exclude) return false;
  return true;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/IKWLDXMV.js
var import_react8 = __toESM(require_react(), 1);
var TagName = "div";
var useCollectionItem = createHook(
  function useCollectionItem2({
    store: store5,
    shouldRegisterItem = true,
    getItem = identity,
    // @ts-expect-error This prop may come from a collection renderer.
    element,
    ...props
  }) {
    const context = useCollectionContext();
    store5 = store5 || context;
    const id = useId4(props.id);
    const ref = (0, import_react8.useRef)(element);
    (0, import_react8.useEffect)(() => {
      const element2 = ref.current;
      if (!id) return;
      if (!element2) return;
      if (!shouldRegisterItem) return;
      const item = getItem({ id, element: element2 });
      return store5 == null ? void 0 : store5.renderItem(item);
    }, [id, shouldRegisterItem, getItem, store5]);
    props = {
      ...props,
      ref: useMergeRefs2(ref, props.ref)
    };
    return removeUndefinedValues(props);
  }
);
var CollectionItem = forwardRef22(function CollectionItem2(props) {
  const htmlProps = useCollectionItem(props);
  return createElement3(TagName, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/SWN3JYXT.js
var import_react9 = __toESM(require_react(), 1);
var FocusableContext = (0, import_react9.createContext)(true);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/utils/focus.js
var selector = "input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], summary, iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false'])";
function isFocusable(element) {
  if (!element.matches(selector)) return false;
  if (!isVisible(element)) return false;
  if (element.closest("[inert]")) return false;
  return true;
}
function hasFocus(element) {
  const activeElement2 = getActiveElement(element);
  if (!activeElement2) return false;
  if (activeElement2 === element) return true;
  const activeDescendant = activeElement2.getAttribute("aria-activedescendant");
  if (!activeDescendant) return false;
  return activeDescendant === element.id;
}
function hasFocusWithin(element) {
  const activeElement2 = getActiveElement(element);
  if (!activeElement2) return false;
  if (contains2(element, activeElement2)) return true;
  const activeDescendant = activeElement2.getAttribute("aria-activedescendant");
  if (!activeDescendant) return false;
  if (!("id" in element)) return false;
  if (activeDescendant === element.id) return true;
  return !!element.querySelector(`#${CSS.escape(activeDescendant)}`);
}
function focusIntoView(element, options) {
  if (!("scrollIntoView" in element)) {
    element.focus();
  } else {
    element.focus({ preventScroll: true });
    element.scrollIntoView({ block: "nearest", inline: "nearest", ...options });
  }
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/GR523XJ6.js
var import_react10 = __toESM(require_react(), 1);
var TagName2 = "div";
var accessibleWhenDisabledSymbol = /* @__PURE__ */ Symbol("accessibleWhenDisabled");
var isSafariBrowser = isSafari();
var alwaysFocusVisibleInputTypes = [
  "text",
  "search",
  "url",
  "tel",
  "email",
  "password",
  "number",
  "date",
  "month",
  "week",
  "time",
  "datetime",
  "datetime-local"
];
function isAlwaysFocusVisible(element) {
  const { tagName, readOnly, type } = element;
  if (tagName === "TEXTAREA" && !readOnly) return true;
  if (tagName === "SELECT" && !readOnly) return true;
  if (tagName === "INPUT" && !readOnly) {
    return alwaysFocusVisibleInputTypes.includes(type);
  }
  if (element.isContentEditable) return true;
  const role = element.getAttribute("role");
  if (role === "combobox" && element.dataset.name) {
    return true;
  }
  return false;
}
function isNativeTabbable(tagName) {
  if (!tagName) return true;
  return tagName === "button" || tagName === "summary" || tagName === "input" || tagName === "select" || tagName === "textarea" || tagName === "a";
}
function supportsDisabledAttribute(tagName) {
  if (!tagName) return true;
  return tagName === "button" || tagName === "input" || tagName === "select" || tagName === "textarea";
}
var buttonInputTypes2 = [
  "button",
  "color",
  "file",
  "image",
  "reset",
  "submit"
];
function needsSafariTabIndex(tagName, inputType) {
  if (tagName === "button") return true;
  if (tagName === "input" && inputType) {
    if (inputType === "checkbox" || inputType === "radio") return true;
    return buttonInputTypes2.includes(inputType);
  }
  return false;
}
function getTabIndex({
  focusable,
  trulyDisabled,
  nativeTabbable,
  supportsDisabled,
  safariTabIndex,
  tabIndexProp
}) {
  if (!focusable) return tabIndexProp;
  if (trulyDisabled) {
    if (nativeTabbable && !supportsDisabled) {
      return -1;
    }
    return;
  }
  if (nativeTabbable) {
    if (safariTabIndex && tabIndexProp == null) {
      return 0;
    }
    return tabIndexProp;
  }
  return tabIndexProp != null ? tabIndexProp : 0;
}
function useDisableEvent(onEvent, disabled2) {
  return useEvent((event) => {
    onEvent == null ? void 0 : onEvent(event);
    if (event.defaultPrevented) return;
    if (disabled2) {
      event.stopPropagation();
      event.preventDefault();
    }
  });
}
var hasInstalledGlobalEventListeners2 = false;
var isKeyboardModality = true;
function onGlobalMouseDown(event) {
  const target = event.target;
  if (target && "hasAttribute" in target) {
    if (!target.hasAttribute("data-focus-visible")) {
      isKeyboardModality = false;
    }
  }
}
function onGlobalKeyDown(event) {
  if (event.metaKey) return;
  if (event.ctrlKey) return;
  if (event.altKey) return;
  isKeyboardModality = true;
}
var useFocusable = createHook(
  function useFocusable2({
    focusable = true,
    accessibleWhenDisabled,
    autoFocus,
    onFocusVisible,
    ...props
  }) {
    const ref = (0, import_react10.useRef)(null);
    const [parentAccessibleWhenDisabled, metadataProps] = useMetadataProps(
      props,
      accessibleWhenDisabledSymbol,
      accessibleWhenDisabled
    );
    accessibleWhenDisabled != null ? accessibleWhenDisabled : accessibleWhenDisabled = parentAccessibleWhenDisabled;
    (0, import_react10.useEffect)(() => {
      if (!focusable) return;
      if (hasInstalledGlobalEventListeners2) return;
      addGlobalEventListener("mousedown", onGlobalMouseDown, true);
      addGlobalEventListener("keydown", onGlobalKeyDown, true);
      hasInstalledGlobalEventListeners2 = true;
    }, [focusable]);
    const disabled2 = focusable && disabledFromProps(props);
    const trulyDisabled = !!disabled2 && !accessibleWhenDisabled;
    const [focusVisible, setFocusVisible] = (0, import_react10.useState)(false);
    (0, import_react10.useEffect)(() => {
      if (!focusable) return;
      if (trulyDisabled && focusVisible) {
        setFocusVisible(false);
      }
    }, [focusable, trulyDisabled, focusVisible]);
    (0, import_react10.useEffect)(() => {
      if (!focusable) return;
      if (!focusVisible) return;
      const element = ref.current;
      if (!element) return;
      if (typeof IntersectionObserver === "undefined") return;
      const observer = new IntersectionObserver(() => {
        if (!isFocusable(element)) {
          setFocusVisible(false);
        }
      });
      observer.observe(element);
      return () => observer.disconnect();
    }, [focusable, focusVisible]);
    const onKeyPressCapture = useDisableEvent(
      props.onKeyPressCapture,
      disabled2
    );
    const onMouseDownCapture = useDisableEvent(
      props.onMouseDownCapture,
      disabled2
    );
    const onClickCapture = useDisableEvent(props.onClickCapture, disabled2);
    const handleFocusVisible = (event, currentTarget) => {
      if (currentTarget) {
        event.currentTarget = currentTarget;
      }
      if (!focusable) return;
      const element = event.currentTarget;
      if (!element) return;
      if (!hasFocus(element)) return;
      onFocusVisible == null ? void 0 : onFocusVisible(event);
      if (event.defaultPrevented) return;
      element.dataset.focusVisible = "true";
      setFocusVisible(true);
    };
    const onKeyDownCaptureProp = props.onKeyDownCapture;
    const onKeyDownCapture = useEvent((event) => {
      onKeyDownCaptureProp == null ? void 0 : onKeyDownCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!focusable) return;
      if (focusVisible) return;
      if (event.metaKey) return;
      if (event.altKey) return;
      if (event.ctrlKey) return;
      if (!isSelfTarget(event)) return;
      const element = event.currentTarget;
      const applyFocusVisible = () => handleFocusVisible(event, element);
      queueBeforeEvent(element, "focusout", applyFocusVisible);
    });
    const onFocusCaptureProp = props.onFocusCapture;
    const onFocusCapture = useEvent((event) => {
      onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!focusable) return;
      if (!isSelfTarget(event)) {
        setFocusVisible(false);
        return;
      }
      const element = event.currentTarget;
      const applyFocusVisible = () => handleFocusVisible(event, element);
      if (isKeyboardModality || isAlwaysFocusVisible(event.target)) {
        queueBeforeEvent(event.target, "focusout", applyFocusVisible);
      } else {
        setFocusVisible(false);
      }
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      onBlurProp == null ? void 0 : onBlurProp(event);
      if (!focusable) return;
      if (!isFocusEventOutside(event)) return;
      event.currentTarget.removeAttribute("data-focus-visible");
      setFocusVisible(false);
    });
    const autoFocusOnShow = (0, import_react10.useContext)(FocusableContext);
    const autoFocusRef = useEvent((element) => {
      if (!focusable) return;
      if (!autoFocus) return;
      if (!element) return;
      if (!autoFocusOnShow) return;
      queueMicrotask(() => {
        if (hasFocus(element)) return;
        if (!isFocusable(element)) return;
        element.focus();
      });
    });
    const tagName = useTagName(ref);
    const nativeTabbable = focusable && isNativeTabbable(tagName);
    const supportsDisabled = focusable && supportsDisabledAttribute(tagName);
    const [safariTabIndex, setSafariTabIndex] = (0, import_react10.useState)(false);
    if (isSafariBrowser) {
      (0, import_react10.useEffect)(() => {
        if (!focusable) return;
        const element = ref.current;
        if (!element) return;
        const tag = element.tagName.toLowerCase();
        const type = element.type;
        setSafariTabIndex(needsSafariTabIndex(tag, type));
      }, [focusable]);
    }
    const styleProp = props.style;
    const style = (0, import_react10.useMemo)(() => {
      if (trulyDisabled) {
        return { pointerEvents: "none", ...styleProp };
      }
      return styleProp;
    }, [trulyDisabled, styleProp]);
    props = {
      "data-focus-visible": focusable && focusVisible || void 0,
      "data-autofocus": autoFocus || void 0,
      "aria-disabled": disabled2 || void 0,
      ...props,
      ...metadataProps,
      ref: useMergeRefs2(ref, autoFocusRef, props.ref),
      style,
      tabIndex: getTabIndex({
        focusable,
        trulyDisabled,
        nativeTabbable,
        supportsDisabled,
        safariTabIndex,
        tabIndexProp: props.tabIndex
      }),
      disabled: supportsDisabled && trulyDisabled ? true : void 0,
      // TODO: Test Focusable contentEditable.
      contentEditable: disabled2 ? void 0 : props.contentEditable,
      onKeyPressCapture,
      onClickCapture,
      onMouseDownCapture,
      onKeyDownCapture,
      onFocusCapture,
      onBlur
    };
    return removeUndefinedValues(props);
  }
);
var Focusable = forwardRef22(function Focusable2(props) {
  const htmlProps = useFocusable(props);
  return createElement3(TagName2, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/GHQLK2M5.js
var import_react11 = __toESM(require_react(), 1);
var TagName3 = "button";
function isNativeClick(event) {
  if (!event.isTrusted) return false;
  const element = event.currentTarget;
  if (event.key === "Enter") {
    return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "A";
  }
  if (event.key === " ") {
    return isButton(element) || element.tagName === "SUMMARY" || element.tagName === "INPUT" || element.tagName === "SELECT";
  }
  return false;
}
var symbol = /* @__PURE__ */ Symbol("command");
var useCommand = createHook(
  function useCommand2({ clickOnEnter = true, clickOnSpace = true, ...props }) {
    const ref = (0, import_react11.useRef)(null);
    const [isNativeButton, setIsNativeButton] = (0, import_react11.useState)(false);
    (0, import_react11.useEffect)(() => {
      if (!ref.current) return;
      setIsNativeButton(isButton(ref.current));
    }, []);
    const [active, setActive] = (0, import_react11.useState)(false);
    const activeRef = (0, import_react11.useRef)(false);
    const disabled2 = disabledFromProps(props);
    const [isDuplicate, metadataProps] = useMetadataProps(props, symbol, true);
    const onKeyDownProp = props.onKeyDown;
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      const element = event.currentTarget;
      if (event.defaultPrevented) return;
      if (isDuplicate) return;
      if (disabled2) return;
      if (!isSelfTarget(event)) return;
      if (isTextField(element)) return;
      if (element.isContentEditable) return;
      const isEnter = clickOnEnter && event.key === "Enter";
      const isSpace = clickOnSpace && event.key === " ";
      const shouldPreventEnter = event.key === "Enter" && !clickOnEnter;
      const shouldPreventSpace = event.key === " " && !clickOnSpace;
      if (shouldPreventEnter || shouldPreventSpace) {
        event.preventDefault();
        return;
      }
      if (isEnter || isSpace) {
        const nativeClick = isNativeClick(event);
        if (isEnter) {
          if (!nativeClick) {
            event.preventDefault();
            const { view, ...eventInit } = event;
            const click = () => fireClickEvent(element, eventInit);
            if (isFirefox()) {
              queueBeforeEvent(element, "keyup", click);
            } else {
              queueMicrotask(click);
            }
          }
        } else if (isSpace) {
          activeRef.current = true;
          if (!nativeClick) {
            event.preventDefault();
            setActive(true);
          }
        }
      }
    });
    const onKeyUpProp = props.onKeyUp;
    const onKeyUp = useEvent((event) => {
      onKeyUpProp == null ? void 0 : onKeyUpProp(event);
      if (event.defaultPrevented) return;
      if (isDuplicate) return;
      if (disabled2) return;
      if (event.metaKey) return;
      const isSpace = clickOnSpace && event.key === " ";
      if (activeRef.current && isSpace) {
        activeRef.current = false;
        if (!isNativeClick(event)) {
          event.preventDefault();
          setActive(false);
          const element = event.currentTarget;
          const { view, ...eventInit } = event;
          queueMicrotask(() => fireClickEvent(element, eventInit));
        }
      }
    });
    props = {
      "data-active": active || void 0,
      type: isNativeButton ? "button" : void 0,
      ...metadataProps,
      ...props,
      ref: useMergeRefs2(ref, props.ref),
      onKeyDown,
      onKeyUp
    };
    props = useFocusable(props);
    return props;
  }
);
var Command = forwardRef22(function Command2(props) {
  const htmlProps = useCommand(props);
  return createElement3(TagName3, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/XTZ53NXG.js
function getInternal(store5, key) {
  const internals = store5.__unstableInternals;
  invariant(internals, "Invalid store");
  return internals[key];
}
function createStore(initialState4, ...stores) {
  let state = initialState4;
  let prevStateBatch = state;
  let lastUpdate = /* @__PURE__ */ Symbol();
  let destroy = noop2;
  const instances = /* @__PURE__ */ new Set();
  const updatedKeys = /* @__PURE__ */ new Set();
  const setups = /* @__PURE__ */ new Set();
  const listeners = /* @__PURE__ */ new Set();
  const batchListeners = /* @__PURE__ */ new Set();
  const disposables = /* @__PURE__ */ new WeakMap();
  const listenerKeys = /* @__PURE__ */ new WeakMap();
  const storeSetup = (callback) => {
    setups.add(callback);
    return () => setups.delete(callback);
  };
  const storeInit = () => {
    const initialized = instances.size;
    const instance = /* @__PURE__ */ Symbol();
    instances.add(instance);
    const maybeDestroy = () => {
      instances.delete(instance);
      if (instances.size) return;
      destroy();
    };
    if (initialized) return maybeDestroy;
    const desyncs = getKeys(state).map(
      (key) => chain(
        ...stores.map((store5) => {
          var _a;
          const storeState = (_a = store5 == null ? void 0 : store5.getState) == null ? void 0 : _a.call(store5);
          if (!storeState) return;
          if (!hasOwnProperty(storeState, key)) return;
          return sync(store5, [key], (state2) => {
            setState(
              key,
              state2[key],
              // @ts-expect-error - Not public API. This is just to prevent
              // infinite loops.
              true
            );
          });
        })
      )
    );
    const teardowns = [];
    for (const setup2 of setups) {
      teardowns.push(setup2());
    }
    const cleanups = stores.map(init);
    destroy = chain(...desyncs, ...teardowns, ...cleanups);
    return maybeDestroy;
  };
  const sub = (keys, listener, set3 = listeners) => {
    set3.add(listener);
    listenerKeys.set(listener, keys);
    return () => {
      var _a;
      (_a = disposables.get(listener)) == null ? void 0 : _a();
      disposables.delete(listener);
      listenerKeys.delete(listener);
      set3.delete(listener);
    };
  };
  const storeSubscribe = (keys, listener) => sub(keys, listener);
  const storeSync = (keys, listener) => {
    disposables.set(listener, listener(state, state));
    return sub(keys, listener);
  };
  const storeBatch = (keys, listener) => {
    disposables.set(listener, listener(state, prevStateBatch));
    return sub(keys, listener, batchListeners);
  };
  const storePick = (keys) => createStore(pick(state, keys), finalStore);
  const storeOmit = (keys) => createStore(omit(state, keys), finalStore);
  const getState = () => state;
  const setState = (key, value, fromStores = false) => {
    var _a;
    if (!hasOwnProperty(state, key)) return;
    const nextValue = applyState(value, state[key]);
    if (nextValue === state[key]) return;
    if (!fromStores) {
      for (const store5 of stores) {
        (_a = store5 == null ? void 0 : store5.setState) == null ? void 0 : _a.call(store5, key, nextValue);
      }
    }
    const prevState = state;
    state = { ...state, [key]: nextValue };
    const thisUpdate = /* @__PURE__ */ Symbol();
    lastUpdate = thisUpdate;
    updatedKeys.add(key);
    const run = (listener, prev, uKeys) => {
      var _a2;
      const keys = listenerKeys.get(listener);
      const updated = (k) => uKeys ? uKeys.has(k) : k === key;
      if (!keys || keys.some(updated)) {
        (_a2 = disposables.get(listener)) == null ? void 0 : _a2();
        disposables.set(listener, listener(state, prev));
      }
    };
    for (const listener of listeners) {
      run(listener, prevState);
    }
    queueMicrotask(() => {
      if (lastUpdate !== thisUpdate) return;
      const snapshot = state;
      for (const listener of batchListeners) {
        run(listener, prevStateBatch, updatedKeys);
      }
      prevStateBatch = snapshot;
      updatedKeys.clear();
    });
  };
  const finalStore = {
    getState,
    setState,
    __unstableInternals: {
      setup: storeSetup,
      init: storeInit,
      subscribe: storeSubscribe,
      sync: storeSync,
      batch: storeBatch,
      pick: storePick,
      omit: storeOmit
    }
  };
  return finalStore;
}
function setup(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "setup")(...args);
}
function init(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "init")(...args);
}
function subscribe(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "subscribe")(...args);
}
function sync(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "sync")(...args);
}
function batch(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "batch")(...args);
}
function omit2(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "omit")(...args);
}
function pick2(store5, ...args) {
  if (!store5) return;
  return getInternal(store5, "pick")(...args);
}
function mergeStore(...stores) {
  var _a;
  const initialState4 = {};
  for (const store22 of stores) {
    const nextState = (_a = store22 == null ? void 0 : store22.getState) == null ? void 0 : _a.call(store22);
    if (nextState) {
      Object.assign(initialState4, nextState);
    }
  }
  const store5 = createStore(initialState4, ...stores);
  return Object.assign({}, ...stores, store5);
}
function throwOnConflictingProps(props, store5) {
  if (false) return;
  if (!store5) return;
  const defaultKeys = Object.entries(props).filter(([key, value]) => key.startsWith("default") && value !== void 0).map(([key]) => {
    var _a;
    const stateKey = key.replace("default", "");
    return `${((_a = stateKey[0]) == null ? void 0 : _a.toLowerCase()) || ""}${stateKey.slice(1)}`;
  });
  if (!defaultKeys.length) return;
  const storeState = store5.getState();
  const conflictingProps = defaultKeys.filter(
    (key) => hasOwnProperty(storeState, key)
  );
  if (!conflictingProps.length) return;
  throw new Error(
    `Passing a store prop in conjunction with a default state is not supported.

const store = useSelectStore();
<SelectProvider store={store} defaultValue="Apple" />
                ^             ^

Instead, pass the default state to the topmost store:

const store = useSelectStore({ defaultValue: "Apple" });
<SelectProvider store={store} />

See https://github.com/ariakit/ariakit/pull/2745 for more details.

If there's a particular need for this, please submit a feature request at https://github.com/ariakit/ariakit
`
  );
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/YAS7X7HB.js
var React34 = __toESM(require_react(), 1);
var import_shim = __toESM(require_shim(), 1);
var noopSubscribe = () => () => {
};
function useStoreState(store5, keyOrSelector = identity) {
  const storeSubscribe = React34.useCallback(
    (callback) => {
      if (!store5) return noopSubscribe();
      return subscribe(store5, null, callback);
    },
    [store5]
  );
  const getSnapshot = () => {
    const key = typeof keyOrSelector === "string" ? keyOrSelector : null;
    const selector2 = typeof keyOrSelector === "function" ? keyOrSelector : null;
    const state = store5 == null ? void 0 : store5.getState();
    if (selector2) return selector2(state);
    if (!state) return;
    if (!key) return;
    if (!hasOwnProperty(state, key)) return;
    return state[key];
  };
  return (0, import_shim.useSyncExternalStore)(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreStateObject(store5, object) {
  const objRef = React34.useRef(
    {}
  );
  const storeSubscribe = React34.useCallback(
    (callback) => {
      if (!store5) return noopSubscribe();
      return subscribe(store5, null, callback);
    },
    [store5]
  );
  const getSnapshot = () => {
    const state = store5 == null ? void 0 : store5.getState();
    let updated = false;
    const obj = objRef.current;
    for (const prop in object) {
      const keyOrSelector = object[prop];
      if (typeof keyOrSelector === "function") {
        const value = keyOrSelector(state);
        if (value !== obj[prop]) {
          obj[prop] = value;
          updated = true;
        }
      }
      if (typeof keyOrSelector === "string") {
        if (!state) continue;
        if (!hasOwnProperty(state, keyOrSelector)) continue;
        const value = state[keyOrSelector];
        if (value !== obj[prop]) {
          obj[prop] = value;
          updated = true;
        }
      }
    }
    if (updated) {
      objRef.current = { ...obj };
    }
    return objRef.current;
  };
  return (0, import_shim.useSyncExternalStore)(storeSubscribe, getSnapshot, getSnapshot);
}
function useStoreProps(store5, props, key, setKey) {
  const value = hasOwnProperty(props, key) ? props[key] : void 0;
  const setValue = setKey ? props[setKey] : void 0;
  const propsRef = useLiveRef({ value, setValue });
  useSafeLayoutEffect(() => {
    return sync(store5, [key], (state, prev) => {
      const { value: value2, setValue: setValue2 } = propsRef.current;
      if (!setValue2) return;
      if (state[key] === prev[key]) return;
      if (state[key] === value2) return;
      setValue2(state[key]);
    });
  }, [store5, key]);
  useSafeLayoutEffect(() => {
    if (value === void 0) return;
    store5.setState(key, value);
    return batch(store5, [key], () => {
      if (value === void 0) return;
      store5.setState(key, value);
    });
  });
}
function useStore(createStore2, props) {
  const [store5, setStore] = React34.useState(() => createStore2(props));
  useSafeLayoutEffect(() => init(store5), [store5]);
  const useState210 = React34.useCallback(
    (keyOrSelector) => useStoreState(store5, keyOrSelector),
    [store5]
  );
  const memoizedStore = React34.useMemo(
    () => ({ ...store5, useState: useState210 }),
    [store5, useState210]
  );
  const updateStore = useEvent(() => {
    setStore((store22) => createStore2({ ...props, ...store22.getState() }));
  });
  return [memoizedStore, updateStore];
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/ZCYMVQGT.js
var import_react12 = __toESM(require_react(), 1);
var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
var TagName4 = "button";
function isEditableElement(element) {
  if (isTextbox(element)) return true;
  return element.tagName === "INPUT" && !isButton(element);
}
function getNextPageOffset(scrollingElement, pageUp = false) {
  const height = scrollingElement.clientHeight;
  const { top } = scrollingElement.getBoundingClientRect();
  const pageSize = Math.max(height * 0.875, height - 40) * 1.5;
  const pageOffset = pageUp ? height - pageSize + top : pageSize + top;
  if (scrollingElement.tagName === "HTML") {
    return pageOffset + scrollingElement.scrollTop;
  }
  return pageOffset;
}
function getItemOffset(itemElement, pageUp = false) {
  const { top } = itemElement.getBoundingClientRect();
  if (pageUp) {
    return top + itemElement.clientHeight;
  }
  return top;
}
function findNextPageItemId(element, store5, next, pageUp = false) {
  var _a;
  if (!store5) return;
  if (!next) return;
  const { renderedItems } = store5.getState();
  const scrollingElement = getScrollingElement(element);
  if (!scrollingElement) return;
  const nextPageOffset = getNextPageOffset(scrollingElement, pageUp);
  let id;
  let prevDifference;
  for (let i2 = 0; i2 < renderedItems.length; i2 += 1) {
    const previousId = id;
    id = next(i2);
    if (!id) break;
    if (id === previousId) continue;
    const itemElement = (_a = getEnabledItem(store5, id)) == null ? void 0 : _a.element;
    if (!itemElement) continue;
    const itemOffset = getItemOffset(itemElement, pageUp);
    const difference = itemOffset - nextPageOffset;
    const absDifference = Math.abs(difference);
    if (pageUp && difference <= 0 || !pageUp && difference >= 0) {
      if (prevDifference !== void 0 && prevDifference < absDifference) {
        id = previousId;
      }
      break;
    }
    prevDifference = absDifference;
  }
  return id;
}
function targetIsAnotherItem(event, store5) {
  if (isSelfTarget(event)) return false;
  return isItem(store5, event.target);
}
var useCompositeItem2 = createHook(
  function useCompositeItem22({
    store: store5,
    rowId: rowIdProp,
    preventScrollOnKeyDown = false,
    moveOnKeyPress = true,
    tabbable = false,
    getItem: getItemProp,
    "aria-setsize": ariaSetSizeProp,
    "aria-posinset": ariaPosInSetProp,
    ...props
  }) {
    const context = useCompositeContext();
    store5 = store5 || context;
    const id = useId4(props.id);
    const ref = (0, import_react12.useRef)(null);
    const row = (0, import_react12.useContext)(CompositeRowContext);
    const disabled2 = disabledFromProps(props);
    const trulyDisabled = disabled2 && !props.accessibleWhenDisabled;
    const {
      rowId,
      baseElement,
      isActiveItem,
      ariaSetSize,
      ariaPosInSet,
      isTabbable
    } = useStoreStateObject(store5, {
      rowId(state) {
        if (rowIdProp) return rowIdProp;
        if (!state) return;
        if (!(row == null ? void 0 : row.baseElement)) return;
        if (row.baseElement !== state.baseElement) return;
        return row.id;
      },
      baseElement(state) {
        return (state == null ? void 0 : state.baseElement) || void 0;
      },
      isActiveItem(state) {
        return !!state && state.activeId === id;
      },
      ariaSetSize(state) {
        if (ariaSetSizeProp != null) return ariaSetSizeProp;
        if (!state) return;
        if (!(row == null ? void 0 : row.ariaSetSize)) return;
        if (row.baseElement !== state.baseElement) return;
        return row.ariaSetSize;
      },
      ariaPosInSet(state) {
        if (ariaPosInSetProp != null) return ariaPosInSetProp;
        if (!state) return;
        if (!(row == null ? void 0 : row.ariaPosInSet)) return;
        if (row.baseElement !== state.baseElement) return;
        const itemsInRow = state.renderedItems.filter(
          (item) => item.rowId === rowId
        );
        return row.ariaPosInSet + itemsInRow.findIndex((item) => item.id === id);
      },
      isTabbable(state) {
        if (!(state == null ? void 0 : state.renderedItems.length)) return true;
        if (state.virtualFocus) return false;
        if (tabbable) return true;
        if (state.activeId === null) return false;
        const item = store5 == null ? void 0 : store5.item(state.activeId);
        if (item == null ? void 0 : item.disabled) return true;
        if (!(item == null ? void 0 : item.element)) return true;
        return state.activeId === id;
      }
    });
    const getItem = (0, import_react12.useCallback)(
      (item) => {
        var _a;
        const nextItem = {
          ...item,
          id: id || item.id,
          rowId,
          disabled: !!trulyDisabled,
          children: (_a = item.element) == null ? void 0 : _a.textContent
        };
        if (getItemProp) {
          return getItemProp(nextItem);
        }
        return nextItem;
      },
      [id, rowId, trulyDisabled, getItemProp]
    );
    const onFocusProp = props.onFocus;
    const hasFocusedComposite = (0, import_react12.useRef)(false);
    const onFocus = useEvent((event) => {
      onFocusProp == null ? void 0 : onFocusProp(event);
      if (event.defaultPrevented) return;
      if (isPortalEvent(event)) return;
      if (!id) return;
      if (!store5) return;
      if (targetIsAnotherItem(event, store5)) return;
      const { virtualFocus, baseElement: baseElement2 } = store5.getState();
      store5.setActiveId(id);
      if (isTextbox(event.currentTarget)) {
        selectTextField(event.currentTarget);
      }
      if (!virtualFocus) return;
      if (!isSelfTarget(event)) return;
      if (isEditableElement(event.currentTarget)) return;
      if (!(baseElement2 == null ? void 0 : baseElement2.isConnected)) return;
      if (isSafari() && event.currentTarget.hasAttribute("data-autofocus")) {
        event.currentTarget.scrollIntoView({
          block: "nearest",
          inline: "nearest"
        });
      }
      hasFocusedComposite.current = true;
      const fromComposite = event.relatedTarget === baseElement2 || isItem(store5, event.relatedTarget);
      if (fromComposite) {
        focusSilently(baseElement2);
      } else {
        baseElement2.focus();
      }
    });
    const onBlurCaptureProp = props.onBlurCapture;
    const onBlurCapture = useEvent((event) => {
      onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
      if (event.defaultPrevented) return;
      const state = store5 == null ? void 0 : store5.getState();
      if ((state == null ? void 0 : state.virtualFocus) && hasFocusedComposite.current) {
        hasFocusedComposite.current = false;
        event.preventDefault();
        event.stopPropagation();
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const preventScrollOnKeyDownProp = useBooleanEvent(preventScrollOnKeyDown);
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (event.defaultPrevented) return;
      if (!isSelfTarget(event)) return;
      if (!store5) return;
      const { currentTarget } = event;
      const state = store5.getState();
      const item = store5.item(id);
      const isGrid2 = !!(item == null ? void 0 : item.rowId);
      const isVertical = state.orientation !== "horizontal";
      const isHorizontal = state.orientation !== "vertical";
      const canHomeEnd = () => {
        if (isGrid2) return true;
        if (isHorizontal) return true;
        if (!state.baseElement) return true;
        if (!isTextField(state.baseElement)) return true;
        return false;
      };
      const keyMap = {
        ArrowUp: (isGrid2 || isVertical) && store5.up,
        ArrowRight: (isGrid2 || isHorizontal) && store5.next,
        ArrowDown: (isGrid2 || isVertical) && store5.down,
        ArrowLeft: (isGrid2 || isHorizontal) && store5.previous,
        Home: () => {
          if (!canHomeEnd()) return;
          if (!isGrid2 || event.ctrlKey) {
            return store5 == null ? void 0 : store5.first();
          }
          return store5 == null ? void 0 : store5.previous(-1);
        },
        End: () => {
          if (!canHomeEnd()) return;
          if (!isGrid2 || event.ctrlKey) {
            return store5 == null ? void 0 : store5.last();
          }
          return store5 == null ? void 0 : store5.next(-1);
        },
        PageUp: () => {
          return findNextPageItemId(currentTarget, store5, store5 == null ? void 0 : store5.up, true);
        },
        PageDown: () => {
          return findNextPageItemId(currentTarget, store5, store5 == null ? void 0 : store5.down);
        }
      };
      const action = keyMap[event.key];
      if (action) {
        if (isTextbox(currentTarget)) {
          const selection = getTextboxSelection(currentTarget);
          const isLeft = isHorizontal && event.key === "ArrowLeft";
          const isRight = isHorizontal && event.key === "ArrowRight";
          const isUp = isVertical && event.key === "ArrowUp";
          const isDown = isVertical && event.key === "ArrowDown";
          if (isRight || isDown) {
            const { length: valueLength } = getTextboxValue(currentTarget);
            if (selection.end !== valueLength) return;
          } else if ((isLeft || isUp) && selection.start !== 0) return;
        }
        const nextId = action();
        if (preventScrollOnKeyDownProp(event) || nextId !== void 0) {
          if (!moveOnKeyPressProp(event)) return;
          event.preventDefault();
          store5.move(nextId);
        }
      }
    });
    const providerValue = (0, import_react12.useMemo)(
      () => ({ id, baseElement }),
      [id, baseElement]
    );
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(CompositeItemContext.Provider, { value: providerValue, children: element }),
      [providerValue]
    );
    props = {
      "data-active-item": isActiveItem || void 0,
      ...props,
      id,
      ref: useMergeRefs2(ref, props.ref),
      tabIndex: isTabbable ? props.tabIndex : -1,
      onFocus,
      onBlurCapture,
      onKeyDown
    };
    props = useCommand(props);
    props = useCollectionItem({
      store: store5,
      ...props,
      getItem,
      shouldRegisterItem: id ? props.shouldRegisterItem : false
    });
    return removeUndefinedValues({
      ...props,
      "aria-setsize": ariaSetSize,
      "aria-posinset": ariaPosInSet
    });
  }
);
var CompositeItem = memo22(
  forwardRef22(function CompositeItem2(props) {
    const htmlProps = useCompositeItem2(props);
    return createElement3(TagName4, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/7PRQYBBV.js
function toArray(arg) {
  if (Array.isArray(arg)) {
    return arg;
  }
  return typeof arg !== "undefined" ? [arg] : [];
}
function flatten2DArray(array) {
  const flattened = [];
  for (const row of array) {
    flattened.push(...row);
  }
  return flattened;
}
function reverseArray(array) {
  return array.slice().reverse();
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/6PX47O7P.js
var import_react13 = __toESM(require_react(), 1);
var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1);
var TagName5 = "div";
function isGrid(items) {
  return items.some((item) => !!item.rowId);
}
function isPrintableKey(event) {
  const target = event.target;
  if (target && !isTextField(target)) return false;
  return event.key.length === 1 && !event.ctrlKey && !event.metaKey;
}
function isModifierKey(event) {
  return event.key === "Shift" || event.key === "Control" || event.key === "Alt" || event.key === "Meta";
}
function useKeyboardEventProxy(store5, onKeyboardEvent, previousElementRef) {
  return useEvent((event) => {
    var _a;
    onKeyboardEvent == null ? void 0 : onKeyboardEvent(event);
    if (event.defaultPrevented) return;
    if (event.isPropagationStopped()) return;
    if (!isSelfTarget(event)) return;
    if (isModifierKey(event)) return;
    if (isPrintableKey(event)) return;
    const state = store5.getState();
    const activeElement2 = (_a = getEnabledItem(store5, state.activeId)) == null ? void 0 : _a.element;
    if (!activeElement2) return;
    const { view, ...eventInit } = event;
    const previousElement = previousElementRef == null ? void 0 : previousElementRef.current;
    if (activeElement2 !== previousElement) {
      activeElement2.focus();
    }
    if (!fireKeyboardEvent(activeElement2, event.type, eventInit)) {
      event.preventDefault();
    }
    if (event.currentTarget.contains(activeElement2)) {
      event.stopPropagation();
    }
  });
}
function findFirstEnabledItemInTheLastRow(items) {
  return findFirstEnabledItem(
    flatten2DArray(reverseArray(groupItemsByRows(items)))
  );
}
function withBaseScrollPreserved(store5, callback) {
  const { virtualFocus, baseElement } = store5.getState();
  if (!virtualFocus || !baseElement || !isTextField(baseElement)) {
    callback();
    return;
  }
  const savedScrollLeft = baseElement.scrollLeft;
  const savedScrollTop = baseElement.scrollTop;
  callback();
  baseElement.scrollLeft = savedScrollLeft;
  baseElement.scrollTop = savedScrollTop;
}
function useScheduleFocus(store5) {
  const [scheduled, setScheduled] = (0, import_react13.useState)(false);
  const schedule = (0, import_react13.useCallback)(() => setScheduled(true), []);
  const activeItem = useStoreState(
    store5,
    (state) => getEnabledItem(store5, state.activeId)
  );
  (0, import_react13.useEffect)(() => {
    const activeElement2 = activeItem == null ? void 0 : activeItem.element;
    if (!scheduled) return;
    if (!activeElement2) return;
    setScheduled(false);
    withBaseScrollPreserved(store5, () => {
      activeElement2.focus({ preventScroll: true });
    });
  }, [store5, activeItem, scheduled]);
  return schedule;
}
var useComposite = createHook(
  function useComposite2({
    store: store5,
    composite = true,
    focusOnMove = composite,
    moveOnKeyPress = true,
    ...props
  }) {
    const context = useCompositeProviderContext();
    store5 = store5 || context;
    invariant(
      store5,
      "Composite must receive a `store` prop or be wrapped in a CompositeProvider component."
    );
    const ref = (0, import_react13.useRef)(null);
    const previousElementRef = (0, import_react13.useRef)(null);
    const scheduleFocus = useScheduleFocus(store5);
    const moves = useStoreState(store5, "moves");
    const [, setBaseElement] = useTransactionState(
      composite ? store5.setBaseElement : null
    );
    (0, import_react13.useEffect)(() => {
      var _a;
      if (!store5) return;
      if (!moves) return;
      if (!composite) return;
      if (!focusOnMove) return;
      const { activeId: activeId2 } = store5.getState();
      const itemElement = (_a = getEnabledItem(store5, activeId2)) == null ? void 0 : _a.element;
      if (!itemElement) return;
      withBaseScrollPreserved(store5, () => focusIntoView(itemElement));
    }, [store5, moves, composite, focusOnMove]);
    useSafeLayoutEffect(() => {
      if (!store5) return;
      if (!moves) return;
      if (!composite) return;
      const { baseElement, activeId: activeId2 } = store5.getState();
      const isSelfAcive = activeId2 === null;
      if (!isSelfAcive) return;
      if (!baseElement) return;
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (previousElement) {
        fireBlurEvent(previousElement, { relatedTarget: baseElement });
      }
      if (!hasFocus(baseElement)) {
        baseElement.focus();
      }
    }, [store5, moves, composite]);
    const activeId = useStoreState(store5, "activeId");
    const virtualFocus = useStoreState(store5, "virtualFocus");
    useSafeLayoutEffect(() => {
      var _a;
      if (!store5) return;
      if (!composite) return;
      if (!virtualFocus) return;
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (!previousElement) return;
      const activeElement2 = (_a = getEnabledItem(store5, activeId)) == null ? void 0 : _a.element;
      const relatedTarget = activeElement2 || getActiveElement(previousElement);
      if (relatedTarget === previousElement) return;
      fireBlurEvent(previousElement, { relatedTarget });
    }, [store5, activeId, virtualFocus, composite]);
    const onKeyDownCapture = useKeyboardEventProxy(
      store5,
      props.onKeyDownCapture,
      previousElementRef
    );
    const onKeyUpCapture = useKeyboardEventProxy(
      store5,
      props.onKeyUpCapture,
      previousElementRef
    );
    const onFocusCaptureProp = props.onFocusCapture;
    const onFocusCapture = useEvent((event) => {
      onFocusCaptureProp == null ? void 0 : onFocusCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!store5) return;
      const { virtualFocus: virtualFocus2 } = store5.getState();
      if (!virtualFocus2) return;
      const previousActiveElement = event.relatedTarget;
      const isSilentlyFocused = silentlyFocused(event.currentTarget);
      if (isSelfTarget(event) && isSilentlyFocused) {
        event.stopPropagation();
        previousElementRef.current = previousActiveElement;
      }
    });
    const onFocusProp = props.onFocus;
    const onFocus = useEvent((event) => {
      onFocusProp == null ? void 0 : onFocusProp(event);
      if (event.defaultPrevented) return;
      if (!composite) return;
      if (!store5) return;
      const { relatedTarget } = event;
      const { virtualFocus: virtualFocus2 } = store5.getState();
      if (virtualFocus2) {
        if (isSelfTarget(event) && !isItem(store5, relatedTarget)) {
          queueMicrotask(scheduleFocus);
        }
      } else if (isSelfTarget(event)) {
        store5.setActiveId(null);
      }
    });
    const onBlurCaptureProp = props.onBlurCapture;
    const onBlurCapture = useEvent((event) => {
      var _a;
      onBlurCaptureProp == null ? void 0 : onBlurCaptureProp(event);
      if (event.defaultPrevented) return;
      if (!store5) return;
      const { virtualFocus: virtualFocus2, activeId: activeId2 } = store5.getState();
      if (!virtualFocus2) return;
      const activeElement2 = (_a = getEnabledItem(store5, activeId2)) == null ? void 0 : _a.element;
      const nextActiveElement = event.relatedTarget;
      const nextActiveElementIsItem = isItem(store5, nextActiveElement);
      const previousElement = previousElementRef.current;
      previousElementRef.current = null;
      if (isSelfTarget(event) && nextActiveElementIsItem) {
        if (nextActiveElement === activeElement2) {
          if (previousElement && previousElement !== nextActiveElement) {
            fireBlurEvent(previousElement, event);
          }
        } else if (activeElement2) {
          fireBlurEvent(activeElement2, event);
        } else if (previousElement) {
          fireBlurEvent(previousElement, event);
        }
        event.stopPropagation();
      } else {
        const targetIsItem = isItem(store5, event.target);
        if (!targetIsItem && activeElement2) {
          fireBlurEvent(activeElement2, event);
        }
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    const onKeyDown = useEvent((event) => {
      var _a;
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (event.nativeEvent.isComposing) return;
      if (event.defaultPrevented) return;
      if (!store5) return;
      if (!isSelfTarget(event)) return;
      const { orientation, renderedItems, activeId: activeId2 } = store5.getState();
      const activeItem = getEnabledItem(store5, activeId2);
      if ((_a = activeItem == null ? void 0 : activeItem.element) == null ? void 0 : _a.isConnected) return;
      const isVertical = orientation !== "horizontal";
      const isHorizontal = orientation !== "vertical";
      const grid = isGrid(renderedItems);
      const isHorizontalKey = event.key === "ArrowLeft" || event.key === "ArrowRight" || event.key === "Home" || event.key === "End";
      if (isHorizontalKey && isTextField(event.currentTarget)) return;
      const up = () => {
        if (grid) {
          const item = findFirstEnabledItemInTheLastRow(renderedItems);
          return item == null ? void 0 : item.id;
        }
        return store5 == null ? void 0 : store5.last();
      };
      const keyMap = {
        ArrowUp: (grid || isVertical) && up,
        ArrowRight: (grid || isHorizontal) && store5.first,
        ArrowDown: (grid || isVertical) && store5.first,
        ArrowLeft: (grid || isHorizontal) && store5.last,
        Home: store5.first,
        End: store5.last,
        PageUp: store5.first,
        PageDown: store5.last
      };
      const action = keyMap[event.key];
      if (action) {
        const id = action();
        if (id !== void 0) {
          if (!moveOnKeyPressProp(event)) return;
          event.preventDefault();
          store5.move(id);
        }
      }
    });
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(CompositeContextProvider, { value: store5, children: element }),
      [store5]
    );
    const activeDescendant = useStoreState(store5, (state) => {
      var _a;
      if (!store5) return;
      if (!composite) return;
      if (!state.virtualFocus) return;
      return (_a = getEnabledItem(store5, state.activeId)) == null ? void 0 : _a.id;
    });
    props = {
      "aria-activedescendant": activeDescendant,
      ...props,
      ref: useMergeRefs2(ref, setBaseElement, props.ref),
      onKeyDownCapture,
      onKeyUpCapture,
      onFocusCapture,
      onFocus,
      onBlurCapture,
      onKeyDown
    };
    const focusable = useStoreState(
      store5,
      (state) => composite && (state.virtualFocus || state.activeId === null)
    );
    props = useFocusable({ focusable, ...props });
    return props;
  }
);
var Composite5 = forwardRef22(function Composite22(props) {
  const htmlProps = useComposite(props);
  return createElement3(TagName5, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/SF4KD2LD.js
var ctx3 = createStoreContext();
var useDisclosureContext = ctx3.useContext;
var useDisclosureScopedContext = ctx3.useScopedContext;
var useDisclosureProviderContext = ctx3.useProviderContext;
var DisclosureContextProvider = ctx3.ContextProvider;
var DisclosureScopedContextProvider = ctx3.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/W43ISTP6.js
var import_react14 = __toESM(require_react(), 1);
var ctx4 = createStoreContext(
  [DisclosureContextProvider],
  [DisclosureScopedContextProvider]
);
var useDialogContext = ctx4.useContext;
var useDialogScopedContext = ctx4.useScopedContext;
var useDialogProviderContext = ctx4.useProviderContext;
var DialogContextProvider = ctx4.ContextProvider;
var DialogScopedContextProvider = ctx4.ScopedContextProvider;
var DialogHeadingContext = (0, import_react14.createContext)(void 0);
var DialogDescriptionContext = (0, import_react14.createContext)(void 0);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/WLLNEL2X.js
var import_react15 = __toESM(require_react(), 1);
var import_react_dom = __toESM(require_react_dom(), 1);
var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1);
var TagName6 = "div";
function afterTimeout(timeoutMs, cb) {
  const timeoutId = setTimeout(cb, timeoutMs);
  return () => clearTimeout(timeoutId);
}
function afterPaint2(cb) {
  let raf = requestAnimationFrame(() => {
    raf = requestAnimationFrame(cb);
  });
  return () => cancelAnimationFrame(raf);
}
function parseCSSTime(...times) {
  return times.join(", ").split(", ").reduce((longestTime, currentTimeString) => {
    const multiplier = currentTimeString.endsWith("ms") ? 1 : 1e3;
    const currentTime = Number.parseFloat(currentTimeString || "0s") * multiplier;
    if (currentTime > longestTime) return currentTime;
    return longestTime;
  }, 0);
}
function isHidden(mounted, hidden, alwaysVisible) {
  return !alwaysVisible && hidden !== false && (!mounted || !!hidden);
}
var useDisclosureContent = createHook(function useDisclosureContent2({ store: store5, alwaysVisible, ...props }) {
  const context = useDisclosureProviderContext();
  store5 = store5 || context;
  invariant(
    store5,
    "DisclosureContent must receive a `store` prop or be wrapped in a DisclosureProvider component."
  );
  const ref = (0, import_react15.useRef)(null);
  const id = useId4(props.id);
  const [transition, setTransition] = (0, import_react15.useState)(null);
  const open = useStoreState(store5, "open");
  const mounted = useStoreState(store5, "mounted");
  const animated = useStoreState(store5, "animated");
  const contentElement = useStoreState(store5, "contentElement");
  const otherElement = useStoreState(store5.disclosure, "contentElement");
  useSafeLayoutEffect(() => {
    if (!ref.current) return;
    store5 == null ? void 0 : store5.setContentElement(ref.current);
  }, [store5]);
  useSafeLayoutEffect(() => {
    let previousAnimated;
    store5 == null ? void 0 : store5.setState("animated", (animated2) => {
      previousAnimated = animated2;
      return true;
    });
    return () => {
      if (previousAnimated === void 0) return;
      store5 == null ? void 0 : store5.setState("animated", previousAnimated);
    };
  }, [store5]);
  useSafeLayoutEffect(() => {
    if (!animated) return;
    if (!(contentElement == null ? void 0 : contentElement.isConnected)) {
      setTransition(null);
      return;
    }
    return afterPaint2(() => {
      setTransition(open ? "enter" : mounted ? "leave" : null);
    });
  }, [animated, contentElement, open, mounted]);
  useSafeLayoutEffect(() => {
    if (!store5) return;
    if (!animated) return;
    if (!transition) return;
    if (!contentElement) return;
    const stopAnimation = () => store5 == null ? void 0 : store5.setState("animating", false);
    const stopAnimationSync = () => (0, import_react_dom.flushSync)(stopAnimation);
    if (transition === "leave" && open) return;
    if (transition === "enter" && !open) return;
    if (typeof animated === "number") {
      const timeout2 = animated;
      return afterTimeout(timeout2, stopAnimationSync);
    }
    const {
      transitionDuration,
      animationDuration,
      transitionDelay,
      animationDelay
    } = getComputedStyle(contentElement);
    const {
      transitionDuration: transitionDuration2 = "0",
      animationDuration: animationDuration2 = "0",
      transitionDelay: transitionDelay2 = "0",
      animationDelay: animationDelay2 = "0"
    } = otherElement ? getComputedStyle(otherElement) : {};
    const delay = parseCSSTime(
      transitionDelay,
      animationDelay,
      transitionDelay2,
      animationDelay2
    );
    const duration = parseCSSTime(
      transitionDuration,
      animationDuration,
      transitionDuration2,
      animationDuration2
    );
    const timeout = delay + duration;
    if (!timeout) {
      if (transition === "enter") {
        store5.setState("animated", false);
      }
      stopAnimation();
      return;
    }
    const frameRate = 1e3 / 60;
    const maxTimeout = Math.max(timeout - frameRate, 0);
    return afterTimeout(maxTimeout, stopAnimationSync);
  }, [store5, animated, contentElement, otherElement, open, transition]);
  props = useWrapElement(
    props,
    (element) => /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DialogScopedContextProvider, { value: store5, children: element }),
    [store5]
  );
  const hidden = isHidden(mounted, props.hidden, alwaysVisible);
  const styleProp = props.style;
  const style = (0, import_react15.useMemo)(() => {
    if (hidden) {
      return { ...styleProp, display: "none" };
    }
    return styleProp;
  }, [hidden, styleProp]);
  props = {
    "data-open": open || void 0,
    "data-enter": transition === "enter" || void 0,
    "data-leave": transition === "leave" || void 0,
    hidden,
    ...props,
    id,
    ref: useMergeRefs2(id ? store5.setContentElement : null, ref, props.ref),
    style
  };
  return removeUndefinedValues(props);
});
var DisclosureContentImpl = forwardRef22(function DisclosureContentImpl2(props) {
  const htmlProps = useDisclosureContent(props);
  return createElement3(TagName6, htmlProps);
});
var DisclosureContent = forwardRef22(function DisclosureContent2({
  unmountOnHide,
  ...props
}) {
  const context = useDisclosureProviderContext();
  const store5 = props.store || context;
  const mounted = useStoreState(
    store5,
    (state) => !unmountOnHide || (state == null ? void 0 : state.mounted)
  );
  if (mounted === false) return null;
  return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(DisclosureContentImpl, { ...props });
});

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/IHNLLH3I.js
function createDisclosureStore(props = {}) {
  const store5 = mergeStore(
    props.store,
    omit2(props.disclosure, ["contentElement", "disclosureElement"])
  );
  throwOnConflictingProps(props, store5);
  const syncState = store5 == null ? void 0 : store5.getState();
  const open = defaultValue(
    props.open,
    syncState == null ? void 0 : syncState.open,
    props.defaultOpen,
    false
  );
  const animated = defaultValue(props.animated, syncState == null ? void 0 : syncState.animated, false);
  const initialState4 = {
    open,
    animated,
    animating: !!animated && open,
    mounted: open,
    contentElement: defaultValue(syncState == null ? void 0 : syncState.contentElement, null),
    disclosureElement: defaultValue(syncState == null ? void 0 : syncState.disclosureElement, null)
  };
  const disclosure = createStore(initialState4, store5);
  setup(
    disclosure,
    () => sync(disclosure, ["animated", "animating"], (state) => {
      if (state.animated) return;
      disclosure.setState("animating", false);
    })
  );
  setup(
    disclosure,
    () => subscribe(disclosure, ["open"], () => {
      if (!disclosure.getState().animated) return;
      disclosure.setState("animating", true);
    })
  );
  setup(
    disclosure,
    () => sync(disclosure, ["open", "animating"], (state) => {
      disclosure.setState("mounted", state.open || state.animating);
    })
  );
  return {
    ...disclosure,
    disclosure: props.disclosure,
    setOpen: (value) => disclosure.setState("open", value),
    show: () => disclosure.setState("open", true),
    hide: () => disclosure.setState("open", false),
    toggle: () => disclosure.setState("open", (open2) => !open2),
    stopAnimation: () => disclosure.setState("animating", false),
    setContentElement: (value) => disclosure.setState("contentElement", value),
    setDisclosureElement: (value) => disclosure.setState("disclosureElement", value)
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/FL7NPBCY.js
function useDisclosureStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.store, props.disclosure]);
  useStoreProps(store5, props, "open", "setOpen");
  useStoreProps(store5, props, "mounted", "setMounted");
  useStoreProps(store5, props, "animated");
  return Object.assign(store5, { disclosure: props.disclosure });
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/E4DZA6YM.js
var ctx5 = createStoreContext(
  [DialogContextProvider],
  [DialogScopedContextProvider]
);
var usePopoverContext = ctx5.useContext;
var usePopoverScopedContext = ctx5.useScopedContext;
var usePopoverProviderContext = ctx5.useProviderContext;
var PopoverContextProvider = ctx5.ContextProvider;
var PopoverScopedContextProvider = ctx5.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/KZX46JDB.js
function getCommonParent(items) {
  var _a, _b;
  const firstItem = items.find((item) => !!item.element);
  const lastElement = (_a = [...items].reverse().find((item) => !!item.element)) == null ? void 0 : _a.element;
  let parentElement = (_b = firstItem == null ? void 0 : firstItem.element) == null ? void 0 : _b.parentElement;
  if (!lastElement) {
    return getDocument(parentElement).body;
  }
  while (parentElement) {
    const parent = parentElement;
    if (parent.contains(lastElement)) {
      return parentElement;
    }
    parentElement = parentElement.parentElement;
  }
  return getDocument(parentElement).body;
}
function getPrivateStore(store5) {
  return store5 == null ? void 0 : store5.__unstablePrivateStore;
}
function createCollectionStore(props = {}) {
  var _a;
  throwOnConflictingProps(props, props.store);
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
  const items = defaultValue(
    props.items,
    syncState == null ? void 0 : syncState.items,
    props.defaultItems,
    []
  );
  const itemsMap = new Map(items.map((item) => [item.id, item]));
  const initialState4 = {
    items,
    renderedItems: defaultValue(syncState == null ? void 0 : syncState.renderedItems, [])
  };
  const syncPrivateStore = getPrivateStore(props.store);
  const privateStore = createStore(
    { items, renderedItems: initialState4.renderedItems },
    syncPrivateStore
  );
  const collection = createStore(initialState4, props.store);
  const sortItems = (renderedItems) => {
    const sortedItems = sortBasedOnDOMPosition(renderedItems, (i2) => i2.element);
    privateStore.setState("renderedItems", sortedItems);
    collection.setState("renderedItems", sortedItems);
  };
  setup(collection, () => init(privateStore));
  setup(privateStore, () => {
    return batch(privateStore, ["items"], (state) => {
      collection.setState("items", state.items);
    });
  });
  setup(privateStore, () => {
    return batch(privateStore, ["renderedItems"], (state) => {
      let firstRun = true;
      let raf = requestAnimationFrame(() => {
        const { renderedItems } = collection.getState();
        if (state.renderedItems === renderedItems) return;
        sortItems(state.renderedItems);
      });
      if (typeof IntersectionObserver !== "function") {
        return () => cancelAnimationFrame(raf);
      }
      const ioCallback = () => {
        if (firstRun) {
          firstRun = false;
          return;
        }
        cancelAnimationFrame(raf);
        raf = requestAnimationFrame(() => sortItems(state.renderedItems));
      };
      const root = getCommonParent(state.renderedItems);
      const observer = new IntersectionObserver(ioCallback, { root });
      for (const item of state.renderedItems) {
        if (!item.element) continue;
        observer.observe(item.element);
      }
      return () => {
        cancelAnimationFrame(raf);
        observer.disconnect();
      };
    });
  });
  const mergeItem = (item, setItems, canDeleteFromMap = false) => {
    let prevItem;
    setItems((items2) => {
      const index = items2.findIndex(({ id }) => id === item.id);
      const nextItems = items2.slice();
      if (index !== -1) {
        prevItem = items2[index];
        const nextItem = { ...prevItem, ...item };
        nextItems[index] = nextItem;
        itemsMap.set(item.id, nextItem);
      } else {
        nextItems.push(item);
        itemsMap.set(item.id, item);
      }
      return nextItems;
    });
    const unmergeItem = () => {
      setItems((items2) => {
        if (!prevItem) {
          if (canDeleteFromMap) {
            itemsMap.delete(item.id);
          }
          return items2.filter(({ id }) => id !== item.id);
        }
        const index = items2.findIndex(({ id }) => id === item.id);
        if (index === -1) return items2;
        const nextItems = items2.slice();
        nextItems[index] = prevItem;
        itemsMap.set(item.id, prevItem);
        return nextItems;
      });
    };
    return unmergeItem;
  };
  const registerItem = (item) => mergeItem(
    item,
    (getItems) => privateStore.setState("items", getItems),
    true
  );
  return {
    ...collection,
    registerItem,
    renderItem: (item) => chain(
      registerItem(item),
      mergeItem(
        item,
        (getItems) => privateStore.setState("renderedItems", getItems)
      )
    ),
    item: (id) => {
      if (!id) return null;
      let item = itemsMap.get(id);
      if (!item) {
        const { items: items2 } = privateStore.getState();
        item = items2.find((item2) => item2.id === id);
        if (item) {
          itemsMap.set(id, item);
        }
      }
      return item || null;
    },
    // @ts-expect-error Internal
    __unstablePrivateStore: privateStore
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/6S37ITHJ.js
function useCollectionStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.store]);
  useStoreProps(store5, props, "items", "setItems");
  return store5;
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/UNDE2QJS.js
var NULL_ITEM = { id: null };
function findFirstEnabledItem2(items, excludeId) {
  return items.find((item) => {
    if (excludeId) {
      return !item.disabled && item.id !== excludeId;
    }
    return !item.disabled;
  });
}
function getEnabledItems(items, excludeId) {
  return items.filter((item) => {
    if (excludeId) {
      return !item.disabled && item.id !== excludeId;
    }
    return !item.disabled;
  });
}
function getItemsInRow(items, rowId) {
  return items.filter((item) => item.rowId === rowId);
}
function flipItems(items, activeId, shouldInsertNullItem = false) {
  const index = items.findIndex((item) => item.id === activeId);
  return [
    ...items.slice(index + 1),
    ...shouldInsertNullItem ? [NULL_ITEM] : [],
    ...items.slice(0, index)
  ];
}
function groupItemsByRows2(items) {
  const rows = [];
  for (const item of items) {
    const row = rows.find((currentRow) => {
      var _a;
      return ((_a = currentRow[0]) == null ? void 0 : _a.rowId) === item.rowId;
    });
    if (row) {
      row.push(item);
    } else {
      rows.push([item]);
    }
  }
  return rows;
}
function getMaxRowLength(array) {
  let maxLength = 0;
  for (const { length } of array) {
    if (length > maxLength) {
      maxLength = length;
    }
  }
  return maxLength;
}
function createEmptyItem(rowId) {
  return {
    id: "__EMPTY_ITEM__",
    disabled: true,
    rowId
  };
}
function normalizeRows(rows, activeId, focusShift) {
  const maxLength = getMaxRowLength(rows);
  for (const row of rows) {
    for (let i2 = 0; i2 < maxLength; i2 += 1) {
      const item = row[i2];
      if (!item || focusShift && item.disabled) {
        const isFirst = i2 === 0;
        const previousItem = isFirst && focusShift ? findFirstEnabledItem2(row) : row[i2 - 1];
        row[i2] = previousItem && activeId !== previousItem.id && focusShift ? previousItem : createEmptyItem(previousItem == null ? void 0 : previousItem.rowId);
      }
    }
  }
  return rows;
}
function verticalizeItems(items) {
  const rows = groupItemsByRows2(items);
  const maxLength = getMaxRowLength(rows);
  const verticalized = [];
  for (let i2 = 0; i2 < maxLength; i2 += 1) {
    for (const row of rows) {
      const item = row[i2];
      if (item) {
        verticalized.push({
          ...item,
          // If there's no rowId, it means that it's not a grid composite, but
          // a single row instead. So, instead of verticalizing it, that is,
          // assigning a different rowId based on the column index, we keep it
          // undefined so they will be part of the same row. This is useful
          // when using up/down on one-dimensional composites.
          rowId: item.rowId ? `${i2}` : void 0
        });
      }
    }
  }
  return verticalized;
}
function createCompositeStore(props = {}) {
  var _a;
  const syncState = (_a = props.store) == null ? void 0 : _a.getState();
  const collection = createCollectionStore(props);
  const activeId = defaultValue(
    props.activeId,
    syncState == null ? void 0 : syncState.activeId,
    props.defaultActiveId
  );
  const initialState4 = {
    ...collection.getState(),
    id: defaultValue(
      props.id,
      syncState == null ? void 0 : syncState.id,
      `id-${Math.random().toString(36).slice(2, 8)}`
    ),
    activeId,
    baseElement: defaultValue(syncState == null ? void 0 : syncState.baseElement, null),
    includesBaseElement: defaultValue(
      props.includesBaseElement,
      syncState == null ? void 0 : syncState.includesBaseElement,
      activeId === null
    ),
    moves: defaultValue(syncState == null ? void 0 : syncState.moves, 0),
    orientation: defaultValue(
      props.orientation,
      syncState == null ? void 0 : syncState.orientation,
      "both"
    ),
    rtl: defaultValue(props.rtl, syncState == null ? void 0 : syncState.rtl, false),
    virtualFocus: defaultValue(
      props.virtualFocus,
      syncState == null ? void 0 : syncState.virtualFocus,
      false
    ),
    focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, false),
    focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, false),
    focusShift: defaultValue(props.focusShift, syncState == null ? void 0 : syncState.focusShift, false)
  };
  const composite = createStore(initialState4, collection, props.store);
  setup(
    composite,
    () => sync(composite, ["renderedItems", "activeId"], (state) => {
      composite.setState("activeId", (activeId2) => {
        var _a2;
        if (activeId2 !== void 0) return activeId2;
        return (_a2 = findFirstEnabledItem2(state.renderedItems)) == null ? void 0 : _a2.id;
      });
    })
  );
  const getNextId = (direction = "next", options = {}) => {
    var _a2, _b;
    const defaultState2 = composite.getState();
    const {
      skip = 0,
      activeId: activeId2 = defaultState2.activeId,
      focusShift = defaultState2.focusShift,
      focusLoop = defaultState2.focusLoop,
      focusWrap = defaultState2.focusWrap,
      includesBaseElement = defaultState2.includesBaseElement,
      renderedItems = defaultState2.renderedItems,
      rtl = defaultState2.rtl
    } = options;
    const isVerticalDirection = direction === "up" || direction === "down";
    const isNextDirection = direction === "next" || direction === "down";
    const canReverse = isNextDirection ? rtl && !isVerticalDirection : !rtl || isVerticalDirection;
    const canShift = focusShift && !skip;
    let items = !isVerticalDirection ? renderedItems : flatten2DArray(
      normalizeRows(groupItemsByRows2(renderedItems), activeId2, canShift)
    );
    items = canReverse ? reverseArray(items) : items;
    items = isVerticalDirection ? verticalizeItems(items) : items;
    if (activeId2 == null) {
      return (_a2 = findFirstEnabledItem2(items)) == null ? void 0 : _a2.id;
    }
    const activeItem = items.find((item) => item.id === activeId2);
    if (!activeItem) {
      return (_b = findFirstEnabledItem2(items)) == null ? void 0 : _b.id;
    }
    const isGrid2 = items.some((item) => item.rowId);
    const activeIndex = items.indexOf(activeItem);
    const nextItems = items.slice(activeIndex + 1);
    const nextItemsInRow = getItemsInRow(nextItems, activeItem.rowId);
    if (skip) {
      const nextEnabledItemsInRow = getEnabledItems(nextItemsInRow, activeId2);
      const nextItem2 = nextEnabledItemsInRow.slice(skip)[0] || // If we can't find an item, just return the last one.
      nextEnabledItemsInRow[nextEnabledItemsInRow.length - 1];
      return nextItem2 == null ? void 0 : nextItem2.id;
    }
    const canLoop = focusLoop && (isVerticalDirection ? focusLoop !== "horizontal" : focusLoop !== "vertical");
    const canWrap = isGrid2 && focusWrap && (isVerticalDirection ? focusWrap !== "horizontal" : focusWrap !== "vertical");
    const hasNullItem = isNextDirection ? (!isGrid2 || isVerticalDirection) && canLoop && includesBaseElement : isVerticalDirection ? includesBaseElement : false;
    if (canLoop) {
      const loopItems = canWrap && !hasNullItem ? items : getItemsInRow(items, activeItem.rowId);
      const sortedItems = flipItems(loopItems, activeId2, hasNullItem);
      const nextItem2 = findFirstEnabledItem2(sortedItems, activeId2);
      return nextItem2 == null ? void 0 : nextItem2.id;
    }
    if (canWrap) {
      const nextItem2 = findFirstEnabledItem2(
        // We can use nextItems, which contains all the next items, including
        // items from other rows, to wrap between rows. However, if there is a
        // null item (the composite container), we'll only use the next items in
        // the row. So moving next from the last item will focus on the
        // composite container. On grid composites, horizontal navigation never
        // focuses on the composite container, only vertical.
        hasNullItem ? nextItemsInRow : nextItems,
        activeId2
      );
      const nextId = hasNullItem ? (nextItem2 == null ? void 0 : nextItem2.id) || null : nextItem2 == null ? void 0 : nextItem2.id;
      return nextId;
    }
    const nextItem = findFirstEnabledItem2(nextItemsInRow, activeId2);
    if (!nextItem && hasNullItem) {
      return null;
    }
    return nextItem == null ? void 0 : nextItem.id;
  };
  return {
    ...collection,
    ...composite,
    setBaseElement: (element) => composite.setState("baseElement", element),
    setActiveId: (id) => composite.setState("activeId", id),
    move: (id) => {
      if (id === void 0) return;
      composite.setState("activeId", id);
      composite.setState("moves", (moves) => moves + 1);
    },
    first: () => {
      var _a2;
      return (_a2 = findFirstEnabledItem2(composite.getState().renderedItems)) == null ? void 0 : _a2.id;
    },
    last: () => {
      var _a2;
      return (_a2 = findFirstEnabledItem2(reverseArray(composite.getState().renderedItems))) == null ? void 0 : _a2.id;
    },
    next: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("next", options);
    },
    previous: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("previous", options);
    },
    down: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("down", options);
    },
    up: (options) => {
      if (options !== void 0 && typeof options === "number") {
        options = { skip: options };
      }
      return getNextId("up", options);
    }
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/ZJG6VNPS.js
function useCompositeStoreOptions(props) {
  const id = useId4(props.id);
  return { id, ...props };
}
function useCompositeStoreProps(store5, update2, props) {
  store5 = useCollectionStoreProps(store5, update2, props);
  useStoreProps(store5, props, "activeId", "setActiveId");
  useStoreProps(store5, props, "includesBaseElement");
  useStoreProps(store5, props, "virtualFocus");
  useStoreProps(store5, props, "orientation");
  useStoreProps(store5, props, "rtl");
  useStoreProps(store5, props, "focusLoop");
  useStoreProps(store5, props, "focusWrap");
  useStoreProps(store5, props, "focusShift");
  return store5;
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/H55QERR5.js
var import_react16 = __toESM(require_react(), 1);
var ComboboxListRoleContext = (0, import_react16.createContext)(
  void 0
);
var ctx6 = createStoreContext(
  [PopoverContextProvider, CompositeContextProvider],
  [PopoverScopedContextProvider, CompositeScopedContextProvider]
);
var useComboboxContext = ctx6.useContext;
var useComboboxScopedContext = ctx6.useScopedContext;
var useComboboxProviderContext = ctx6.useProviderContext;
var ComboboxContextProvider = ctx6.ContextProvider;
var ComboboxScopedContextProvider = ctx6.ScopedContextProvider;
var ComboboxItemValueContext = (0, import_react16.createContext)(
  void 0
);
var ComboboxItemCheckedContext = (0, import_react16.createContext)(false);

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/7KNZCZ55.js
function createDialogStore(props = {}) {
  return createDisclosureStore(props);
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/EX4LS7ZU.js
function useDialogStoreProps(store5, update2, props) {
  return useDisclosureStoreProps(store5, update2, props);
}

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/__chunks/MJ4ZJEIM.js
function createPopoverStore({
  popover: otherPopover,
  ...props
} = {}) {
  const store5 = mergeStore(
    props.store,
    omit2(otherPopover, [
      "arrowElement",
      "anchorElement",
      "contentElement",
      "popoverElement",
      "disclosureElement"
    ])
  );
  throwOnConflictingProps(props, store5);
  const syncState = store5 == null ? void 0 : store5.getState();
  const dialog = createDialogStore({ ...props, store: store5 });
  const placement = defaultValue(
    props.placement,
    syncState == null ? void 0 : syncState.placement,
    "bottom"
  );
  const initialState4 = {
    ...dialog.getState(),
    placement,
    currentPlacement: placement,
    anchorElement: defaultValue(syncState == null ? void 0 : syncState.anchorElement, null),
    popoverElement: defaultValue(syncState == null ? void 0 : syncState.popoverElement, null),
    arrowElement: defaultValue(syncState == null ? void 0 : syncState.arrowElement, null),
    rendered: /* @__PURE__ */ Symbol("rendered")
  };
  const popover = createStore(initialState4, dialog, store5);
  return {
    ...dialog,
    ...popover,
    setAnchorElement: (element) => popover.setState("anchorElement", element),
    setPopoverElement: (element) => popover.setState("popoverElement", element),
    setArrowElement: (element) => popover.setState("arrowElement", element),
    render: () => popover.setState("rendered", /* @__PURE__ */ Symbol("rendered"))
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/RPKQBJCW.js
function usePopoverStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.popover]);
  useStoreProps(store5, props, "placement");
  return useDialogStoreProps(store5, update2, props);
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/BLCLYOQG.js
var TagName7 = "div";
var usePopoverAnchor = createHook(
  function usePopoverAnchor2({ store: store5, ...props }) {
    const context = usePopoverProviderContext();
    store5 = store5 || context;
    props = {
      ...props,
      ref: useMergeRefs2(store5 == null ? void 0 : store5.setAnchorElement, props.ref)
    };
    return props;
  }
);
var PopoverAnchor = forwardRef22(function PopoverAnchor2(props) {
  const htmlProps = usePopoverAnchor(props);
  return createElement3(TagName7, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/CI3WD73H.js
var import_react17 = __toESM(require_react(), 1);
var TagName8 = "div";
function getMouseDestination(event) {
  const relatedTarget = event.relatedTarget;
  if ((relatedTarget == null ? void 0 : relatedTarget.nodeType) === Node.ELEMENT_NODE) {
    return relatedTarget;
  }
  return null;
}
function hoveringInside(event) {
  const nextElement = getMouseDestination(event);
  if (!nextElement) return false;
  return contains2(event.currentTarget, nextElement);
}
var symbol2 = /* @__PURE__ */ Symbol("composite-hover");
function movingToAnotherItem(event) {
  let dest = getMouseDestination(event);
  if (!dest) return false;
  do {
    if (hasOwnProperty(dest, symbol2) && dest[symbol2]) return true;
    dest = dest.parentElement;
  } while (dest);
  return false;
}
var useCompositeHover = createHook(
  function useCompositeHover2({
    store: store5,
    focusOnHover = true,
    blurOnHoverEnd = !!focusOnHover,
    ...props
  }) {
    const context = useCompositeContext();
    store5 = store5 || context;
    invariant(
      store5,
      "CompositeHover must be wrapped in a Composite component."
    );
    const isMouseMoving = useIsMouseMoving();
    const onMouseMoveProp = props.onMouseMove;
    const focusOnHoverProp = useBooleanEvent(focusOnHover);
    const onMouseMove = useEvent((event) => {
      onMouseMoveProp == null ? void 0 : onMouseMoveProp(event);
      if (event.defaultPrevented) return;
      if (!isMouseMoving()) return;
      if (!focusOnHoverProp(event)) return;
      if (!hasFocusWithin(event.currentTarget)) {
        const baseElement = store5 == null ? void 0 : store5.getState().baseElement;
        if (baseElement && !hasFocus(baseElement)) {
          baseElement.focus();
        }
      }
      store5 == null ? void 0 : store5.setActiveId(event.currentTarget.id);
    });
    const onMouseLeaveProp = props.onMouseLeave;
    const blurOnHoverEndProp = useBooleanEvent(blurOnHoverEnd);
    const onMouseLeave = useEvent((event) => {
      var _a;
      onMouseLeaveProp == null ? void 0 : onMouseLeaveProp(event);
      if (event.defaultPrevented) return;
      if (!isMouseMoving()) return;
      if (hoveringInside(event)) return;
      if (movingToAnotherItem(event)) return;
      if (!focusOnHoverProp(event)) return;
      if (!blurOnHoverEndProp(event)) return;
      store5 == null ? void 0 : store5.setActiveId(null);
      (_a = store5 == null ? void 0 : store5.getState().baseElement) == null ? void 0 : _a.focus();
    });
    const ref = (0, import_react17.useCallback)((element) => {
      if (!element) return;
      element[symbol2] = true;
    }, []);
    props = {
      ...props,
      ref: useMergeRefs2(ref, props.ref),
      onMouseMove,
      onMouseLeave
    };
    return removeUndefinedValues(props);
  }
);
var CompositeHover = memo22(
  forwardRef22(function CompositeHover2(props) {
    const htmlProps = useCompositeHover(props);
    return createElement3(TagName8, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox.js
var import_react18 = __toESM(require_react(), 1);
var TagName9 = "input";
function isFirstItemAutoSelected(items, activeValue, autoSelect) {
  if (!autoSelect) return false;
  const firstItem = items.find((item) => !item.disabled && item.value);
  return (firstItem == null ? void 0 : firstItem.value) === activeValue;
}
function hasCompletionString(value, activeValue) {
  if (!activeValue) return false;
  if (value == null) return false;
  value = normalizeString(value);
  return activeValue.length > value.length && activeValue.toLowerCase().indexOf(value.toLowerCase()) === 0;
}
function isInputEvent(event) {
  return event.type === "input";
}
function isAriaAutoCompleteValue(value) {
  return value === "inline" || value === "list" || value === "both" || value === "none";
}
function getDefaultAutoSelectId(items) {
  const item = items.find((item2) => {
    var _a;
    if (item2.disabled) return false;
    return ((_a = item2.element) == null ? void 0 : _a.getAttribute("role")) !== "tab";
  });
  return item == null ? void 0 : item.id;
}
var useCombobox = createHook(
  function useCombobox2({
    store: store5,
    focusable = true,
    autoSelect: autoSelectProp = false,
    getAutoSelectId,
    setValueOnChange,
    showMinLength = 0,
    showOnChange,
    showOnMouseDown,
    showOnClick = showOnMouseDown,
    showOnKeyDown,
    showOnKeyPress = showOnKeyDown,
    blurActiveItemOnClick,
    setValueOnClick = true,
    moveOnKeyPress = true,
    autoComplete = "list",
    ...props
  }) {
    const context = useComboboxProviderContext();
    store5 = store5 || context;
    invariant(
      store5,
      "Combobox must receive a `store` prop or be wrapped in a ComboboxProvider component."
    );
    const ref = (0, import_react18.useRef)(null);
    const [valueUpdated, forceValueUpdate] = useForceUpdate();
    const canAutoSelectRef = (0, import_react18.useRef)(false);
    const composingRef = (0, import_react18.useRef)(false);
    const autoSelect = useStoreState(
      store5,
      (state) => state.virtualFocus && autoSelectProp
    );
    const inline = autoComplete === "inline" || autoComplete === "both";
    const [canInline, setCanInline] = (0, import_react18.useState)(inline);
    useUpdateLayoutEffect(() => {
      if (!inline) return;
      setCanInline(true);
    }, [inline]);
    const storeValue = useStoreState(store5, "value");
    const prevSelectedValueRef = (0, import_react18.useRef)(void 0);
    (0, import_react18.useEffect)(() => {
      return sync(store5, ["selectedValue", "activeId"], (_, prev) => {
        prevSelectedValueRef.current = prev.selectedValue;
      });
    }, [store5]);
    const inlineActiveValue = useStoreState(store5, (state) => {
      var _a;
      if (!inline) return;
      if (!canInline) return;
      if (state.activeValue && Array.isArray(state.selectedValue)) {
        if (state.selectedValue.includes(state.activeValue)) return;
        if ((_a = prevSelectedValueRef.current) == null ? void 0 : _a.includes(state.activeValue)) return;
      }
      return state.activeValue;
    });
    const items = useStoreState(store5, "renderedItems");
    const open = useStoreState(store5, "open");
    const contentElement = useStoreState(store5, "contentElement");
    const value = (0, import_react18.useMemo)(() => {
      if (!inline) return storeValue;
      if (!canInline) return storeValue;
      const firstItemAutoSelected = isFirstItemAutoSelected(
        items,
        inlineActiveValue,
        autoSelect
      );
      if (firstItemAutoSelected) {
        if (hasCompletionString(storeValue, inlineActiveValue)) {
          const slice = (inlineActiveValue == null ? void 0 : inlineActiveValue.slice(storeValue.length)) || "";
          return storeValue + slice;
        }
        return storeValue;
      }
      return inlineActiveValue || storeValue;
    }, [inline, canInline, items, inlineActiveValue, autoSelect, storeValue]);
    (0, import_react18.useEffect)(() => {
      const element = ref.current;
      if (!element) return;
      const onCompositeItemMove = () => setCanInline(true);
      element.addEventListener("combobox-item-move", onCompositeItemMove);
      return () => {
        element.removeEventListener("combobox-item-move", onCompositeItemMove);
      };
    }, []);
    (0, import_react18.useEffect)(() => {
      if (!inline) return;
      if (!canInline) return;
      if (!inlineActiveValue) return;
      const firstItemAutoSelected = isFirstItemAutoSelected(
        items,
        inlineActiveValue,
        autoSelect
      );
      if (!firstItemAutoSelected) return;
      if (!hasCompletionString(storeValue, inlineActiveValue)) return;
      let cleanup = noop2;
      queueMicrotask(() => {
        const element = ref.current;
        if (!element) return;
        const { start: prevStart, end: prevEnd } = getTextboxSelection(element);
        const nextStart = storeValue.length;
        const nextEnd = inlineActiveValue.length;
        setSelectionRange(element, nextStart, nextEnd);
        cleanup = () => {
          if (!hasFocus(element)) return;
          const { start, end } = getTextboxSelection(element);
          if (start !== nextStart) return;
          if (end !== nextEnd) return;
          setSelectionRange(element, prevStart, prevEnd);
        };
      });
      return () => cleanup();
    }, [
      valueUpdated,
      inline,
      canInline,
      inlineActiveValue,
      items,
      autoSelect,
      storeValue
    ]);
    const scrollingElementRef = (0, import_react18.useRef)(null);
    const getAutoSelectIdProp = useEvent(getAutoSelectId);
    const autoSelectIdRef = (0, import_react18.useRef)(null);
    const userScrolledRef = (0, import_react18.useRef)(false);
    const isAutoScrollingRef = (0, import_react18.useRef)(false);
    (0, import_react18.useEffect)(() => {
      if (!open) return;
      if (!contentElement) return;
      const scrollingElement = getScrollingElement(contentElement);
      if (!scrollingElement) return;
      scrollingElementRef.current = scrollingElement;
      const onUserScroll = () => {
        canAutoSelectRef.current = false;
        userScrolledRef.current = true;
      };
      const onScroll = () => {
        if (!isAutoScrollingRef.current) {
          userScrolledRef.current = true;
        }
        if (!store5) return;
        if (!canAutoSelectRef.current) return;
        const { activeId } = store5.getState();
        if (activeId === null) return;
        if (activeId === autoSelectIdRef.current) return;
        canAutoSelectRef.current = false;
      };
      const options = { passive: true, capture: true };
      scrollingElement.addEventListener("wheel", onUserScroll, options);
      scrollingElement.addEventListener("touchmove", onUserScroll, options);
      scrollingElement.addEventListener("scroll", onScroll, options);
      return () => {
        scrollingElement.removeEventListener("wheel", onUserScroll, true);
        scrollingElement.removeEventListener("touchmove", onUserScroll, true);
        scrollingElement.removeEventListener("scroll", onScroll, true);
      };
    }, [open, contentElement, store5]);
    useSafeLayoutEffect(() => {
      userScrolledRef.current = false;
      if (!storeValue) return;
      if (composingRef.current) return;
      canAutoSelectRef.current = true;
    }, [storeValue]);
    useSafeLayoutEffect(() => {
      if (autoSelect !== "always" && open) return;
      canAutoSelectRef.current = open;
    }, [autoSelect, open]);
    const resetValueOnSelect = useStoreState(store5, "resetValueOnSelect");
    useUpdateEffect(() => {
      var _a, _b;
      const canAutoSelect = canAutoSelectRef.current;
      if (!store5) return;
      if (!open) return;
      if (!canAutoSelect && (!resetValueOnSelect || userScrolledRef.current))
        return;
      const { baseElement, contentElement: contentElement2, activeId } = store5.getState();
      if (baseElement && !hasFocus(baseElement)) return;
      if (contentElement2 == null ? void 0 : contentElement2.hasAttribute("data-placing")) {
        const observer = new MutationObserver(forceValueUpdate);
        observer.observe(contentElement2, { attributeFilter: ["data-placing"] });
        return () => observer.disconnect();
      }
      if (autoSelect && canAutoSelect) {
        const userAutoSelectId = getAutoSelectIdProp(items);
        const autoSelectId = userAutoSelectId !== void 0 ? userAutoSelectId : (_a = getDefaultAutoSelectId(items)) != null ? _a : store5.first();
        autoSelectIdRef.current = autoSelectId;
        store5.move(autoSelectId != null ? autoSelectId : null);
      } else {
        const element = (_b = store5.item(activeId || store5.first())) == null ? void 0 : _b.element;
        if (element && "scrollIntoView" in element) {
          isAutoScrollingRef.current = true;
          element.scrollIntoView({ block: "nearest", inline: "nearest" });
          requestAnimationFrame(() => {
            isAutoScrollingRef.current = false;
          });
        }
      }
      return;
    }, [
      store5,
      open,
      valueUpdated,
      storeValue,
      autoSelect,
      resetValueOnSelect,
      getAutoSelectIdProp,
      items
    ]);
    (0, import_react18.useEffect)(() => {
      if (!inline) return;
      const combobox = ref.current;
      if (!combobox) return;
      const elements = [combobox, contentElement].filter(
        (value2) => !!value2
      );
      const onBlur2 = (event) => {
        if (elements.every((el) => isFocusEventOutside(event, el))) {
          store5 == null ? void 0 : store5.setValue(value);
        }
      };
      for (const element of elements) {
        element.addEventListener("focusout", onBlur2);
      }
      return () => {
        for (const element of elements) {
          element.removeEventListener("focusout", onBlur2);
        }
      };
    }, [inline, contentElement, store5, value]);
    const canShow = (event) => {
      const currentTarget = event.currentTarget;
      return currentTarget.value.length >= showMinLength;
    };
    const onChangeProp = props.onChange;
    const showOnChangeProp = useBooleanEvent(showOnChange != null ? showOnChange : canShow);
    const setValueOnChangeProp = useBooleanEvent(
      // If the combobox is combined with tags, the value will be set by the tag
      // input component.
      setValueOnChange != null ? setValueOnChange : !store5.tag
    );
    const onChange = useEvent((event) => {
      onChangeProp == null ? void 0 : onChangeProp(event);
      if (event.defaultPrevented) return;
      if (!store5) return;
      const currentTarget = event.currentTarget;
      const { value: value2, selectionStart, selectionEnd } = currentTarget;
      const nativeEvent = event.nativeEvent;
      canAutoSelectRef.current = true;
      if (isInputEvent(nativeEvent)) {
        if (nativeEvent.isComposing) {
          canAutoSelectRef.current = false;
          composingRef.current = true;
        }
        if (inline) {
          const textInserted = nativeEvent.inputType === "insertText" || nativeEvent.inputType === "insertCompositionText";
          const caretAtEnd = selectionStart === value2.length;
          setCanInline(textInserted && caretAtEnd);
        }
      }
      if (setValueOnChangeProp(event)) {
        const isSameValue = value2 === store5.getState().value;
        store5.setValue(value2);
        queueMicrotask(() => {
          setSelectionRange(currentTarget, selectionStart, selectionEnd);
        });
        if (inline && autoSelect && isSameValue) {
          forceValueUpdate();
        }
      }
      if (showOnChangeProp(event)) {
        store5.show();
      }
      if (!autoSelect || !canAutoSelectRef.current) {
        store5.setActiveId(null);
      }
    });
    const onCompositionEndProp = props.onCompositionEnd;
    const onCompositionEnd = useEvent((event) => {
      canAutoSelectRef.current = true;
      composingRef.current = false;
      onCompositionEndProp == null ? void 0 : onCompositionEndProp(event);
      if (event.defaultPrevented) return;
      if (!autoSelect) return;
      forceValueUpdate();
    });
    const onMouseDownProp = props.onMouseDown;
    const blurActiveItemOnClickProp = useBooleanEvent(
      blurActiveItemOnClick != null ? blurActiveItemOnClick : (() => !!(store5 == null ? void 0 : store5.getState().includesBaseElement))
    );
    const setValueOnClickProp = useBooleanEvent(setValueOnClick);
    const showOnClickProp = useBooleanEvent(showOnClick != null ? showOnClick : canShow);
    const onMouseDown = useEvent((event) => {
      onMouseDownProp == null ? void 0 : onMouseDownProp(event);
      if (event.defaultPrevented) return;
      if (event.button) return;
      if (event.ctrlKey) return;
      if (!store5) return;
      if (blurActiveItemOnClickProp(event)) {
        store5.setActiveId(null);
      }
      if (setValueOnClickProp(event)) {
        store5.setValue(value);
      }
      if (showOnClickProp(event)) {
        queueBeforeEvent(event.currentTarget, "mouseup", store5.show);
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const showOnKeyPressProp = useBooleanEvent(showOnKeyPress != null ? showOnKeyPress : canShow);
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (!event.repeat) {
        canAutoSelectRef.current = false;
      }
      if (event.defaultPrevented) return;
      if (event.ctrlKey) return;
      if (event.altKey) return;
      if (event.shiftKey) return;
      if (event.metaKey) return;
      if (!store5) return;
      const { open: open2 } = store5.getState();
      if (open2) return;
      if (event.key === "ArrowUp" || event.key === "ArrowDown") {
        if (showOnKeyPressProp(event)) {
          event.preventDefault();
          store5.show();
        }
      }
    });
    const onBlurProp = props.onBlur;
    const onBlur = useEvent((event) => {
      canAutoSelectRef.current = false;
      onBlurProp == null ? void 0 : onBlurProp(event);
      if (event.defaultPrevented) return;
    });
    const id = useId4(props.id);
    const ariaAutoComplete = isAriaAutoCompleteValue(autoComplete) ? autoComplete : void 0;
    const isActiveItem = useStoreState(
      store5,
      (state) => state.activeId === null
    );
    props = {
      role: "combobox",
      "aria-autocomplete": ariaAutoComplete,
      "aria-haspopup": getPopupRole(contentElement, "listbox"),
      "aria-expanded": open,
      "aria-controls": contentElement == null ? void 0 : contentElement.id,
      "data-active-item": isActiveItem || void 0,
      value,
      ...props,
      id,
      ref: useMergeRefs2(ref, props.ref),
      onChange,
      onCompositionEnd,
      onMouseDown,
      onKeyDown,
      onBlur
    };
    props = useComposite({
      store: store5,
      focusable,
      ...props,
      // Enable inline autocomplete when the user moves from the combobox input
      // to an item.
      moveOnKeyPress: (event) => {
        if (isFalsyBooleanCallback(moveOnKeyPress, event)) return false;
        if (inline) setCanInline(true);
        return true;
      }
    });
    props = usePopoverAnchor({ store: store5, ...props });
    return { autoComplete: "off", ...props };
  }
);
var Combobox = forwardRef22(function Combobox2(props) {
  const htmlProps = useCombobox(props);
  return createElement3(TagName9, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/CRB22UI4.js
var import_react19 = __toESM(require_react(), 1);
var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1);
var TagName10 = "div";
function isSelected(storeValue, itemValue) {
  if (itemValue == null) return;
  if (storeValue == null) return false;
  if (Array.isArray(storeValue)) {
    return storeValue.includes(itemValue);
  }
  return storeValue === itemValue;
}
function getItemRole(popupRole) {
  var _a;
  const itemRoleByPopupRole = {
    menu: "menuitem",
    listbox: "option",
    tree: "treeitem"
  };
  const key = popupRole;
  return (_a = itemRoleByPopupRole[key]) != null ? _a : "option";
}
var useComboboxItem = createHook(
  function useComboboxItem2({
    store: store5,
    value,
    hideOnClick,
    setValueOnClick,
    selectValueOnClick = true,
    resetValueOnSelect,
    focusOnHover = false,
    moveOnKeyPress = true,
    getItem: getItemProp,
    ...props
  }) {
    var _a;
    const context = useComboboxScopedContext();
    store5 = store5 || context;
    invariant(
      store5,
      "ComboboxItem must be wrapped in a ComboboxList or ComboboxPopover component."
    );
    const { resetValueOnSelectState, multiSelectable, selected } = useStoreStateObject(store5, {
      resetValueOnSelectState: "resetValueOnSelect",
      multiSelectable(state) {
        return Array.isArray(state.selectedValue);
      },
      selected(state) {
        return isSelected(state.selectedValue, value);
      }
    });
    const getItem = (0, import_react19.useCallback)(
      (item) => {
        const nextItem = { ...item, value };
        if (getItemProp) {
          return getItemProp(nextItem);
        }
        return nextItem;
      },
      [value, getItemProp]
    );
    setValueOnClick = setValueOnClick != null ? setValueOnClick : !multiSelectable;
    hideOnClick = hideOnClick != null ? hideOnClick : value != null && !multiSelectable;
    const onClickProp = props.onClick;
    const setValueOnClickProp = useBooleanEvent(setValueOnClick);
    const selectValueOnClickProp = useBooleanEvent(selectValueOnClick);
    const resetValueOnSelectProp = useBooleanEvent(
      (_a = resetValueOnSelect != null ? resetValueOnSelect : resetValueOnSelectState) != null ? _a : multiSelectable
    );
    const hideOnClickProp = useBooleanEvent(hideOnClick);
    const onClick = useEvent((event) => {
      onClickProp == null ? void 0 : onClickProp(event);
      if (event.defaultPrevented) return;
      if (isDownloading(event)) return;
      if (isOpeningInNewTab(event)) return;
      if (value != null) {
        if (selectValueOnClickProp(event)) {
          if (resetValueOnSelectProp(event)) {
            store5 == null ? void 0 : store5.resetValue();
          }
          store5 == null ? void 0 : store5.setSelectedValue((prevValue) => {
            if (!Array.isArray(prevValue)) return value;
            if (prevValue.includes(value)) {
              return prevValue.filter((v2) => v2 !== value);
            }
            return [...prevValue, value];
          });
        }
        if (setValueOnClickProp(event)) {
          store5 == null ? void 0 : store5.setValue(value);
        }
      }
      if (hideOnClickProp(event)) {
        store5 == null ? void 0 : store5.hide();
      }
    });
    const onKeyDownProp = props.onKeyDown;
    const onKeyDown = useEvent((event) => {
      onKeyDownProp == null ? void 0 : onKeyDownProp(event);
      if (event.defaultPrevented) return;
      const baseElement = store5 == null ? void 0 : store5.getState().baseElement;
      if (!baseElement) return;
      if (hasFocus(baseElement)) return;
      const printable = event.key.length === 1;
      if (printable || event.key === "Backspace" || event.key === "Delete") {
        queueMicrotask(() => baseElement.focus());
        if (isTextField(baseElement)) {
          store5 == null ? void 0 : store5.setValue(baseElement.value);
        }
      }
    });
    if (multiSelectable && selected != null) {
      props = {
        "aria-selected": selected,
        ...props
      };
    }
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ComboboxItemValueContext.Provider, { value, children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(ComboboxItemCheckedContext.Provider, { value: selected != null ? selected : false, children: element }) }),
      [value, selected]
    );
    const popupRole = (0, import_react19.useContext)(ComboboxListRoleContext);
    props = {
      role: getItemRole(popupRole),
      children: value,
      ...props,
      onClick,
      onKeyDown
    };
    const moveOnKeyPressProp = useBooleanEvent(moveOnKeyPress);
    props = useCompositeItem2({
      store: store5,
      ...props,
      getItem,
      // Dispatch a custom event on the combobox input when moving to an item
      // with the keyboard so the Combobox component can enable inline
      // autocompletion.
      moveOnKeyPress: (event) => {
        if (!moveOnKeyPressProp(event)) return false;
        const moveEvent = new Event("combobox-item-move");
        const baseElement = store5 == null ? void 0 : store5.getState().baseElement;
        baseElement == null ? void 0 : baseElement.dispatchEvent(moveEvent);
        return true;
      }
    });
    props = useCompositeHover({ store: store5, focusOnHover, ...props });
    return props;
  }
);
var ComboboxItem = memo22(
  forwardRef22(function ComboboxItem2(props) {
    const htmlProps = useComboboxItem(props);
    return createElement3(TagName10, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox-item-value.js
var import_react20 = __toESM(require_react(), 1);
var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1);
var TagName11 = "span";
function normalizeValue(value) {
  return normalizeString(value).toLowerCase();
}
function getOffsets(string, values) {
  const offsets = [];
  for (const value of values) {
    let pos = 0;
    const length = value.length;
    while (string.indexOf(value, pos) !== -1) {
      const index = string.indexOf(value, pos);
      if (index !== -1) {
        offsets.push([index, length]);
      }
      pos = index + 1;
    }
  }
  return offsets;
}
function filterOverlappingOffsets(offsets) {
  return offsets.filter(([offset, length], i2, arr) => {
    return !arr.some(
      ([o2, l2], j2) => j2 !== i2 && o2 <= offset && o2 + l2 >= offset + length
    );
  });
}
function sortOffsets(offsets) {
  return offsets.sort(([a2], [b2]) => a2 - b2);
}
function splitValue(itemValue, userValue) {
  if (!itemValue) return itemValue;
  if (!userValue) return itemValue;
  const userValues = toArray(userValue).filter(Boolean).map(normalizeValue);
  const parts = [];
  const span = (value, autocomplete = false) => /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(
    "span",
    {
      "data-autocomplete-value": autocomplete ? "" : void 0,
      "data-user-value": autocomplete ? void 0 : "",
      children: value
    },
    parts.length
  );
  const offsets = sortOffsets(
    filterOverlappingOffsets(
      // Convert userValues into a set to avoid duplicates
      getOffsets(normalizeValue(itemValue), new Set(userValues))
    )
  );
  const firstEntry = offsets[0];
  if (!firstEntry) {
    parts.push(span(itemValue, true));
    return parts;
  }
  const [firstOffset] = firstEntry;
  const values = [
    itemValue.slice(0, firstOffset),
    ...offsets.flatMap(([offset, length], i2) => {
      var _a;
      const value = itemValue.slice(offset, offset + length);
      const nextOffset = (_a = offsets[i2 + 1]) == null ? void 0 : _a[0];
      const nextValue = itemValue.slice(offset + length, nextOffset);
      return [value, nextValue];
    })
  ];
  values.forEach((value, i2) => {
    if (!value) return;
    parts.push(span(value, i2 % 2 === 0));
  });
  return parts;
}
var useComboboxItemValue = createHook(function useComboboxItemValue2({ store: store5, value, userValue, ...props }) {
  const context = useComboboxScopedContext();
  store5 = store5 || context;
  const itemContext = (0, import_react20.useContext)(ComboboxItemValueContext);
  const itemValue = value != null ? value : itemContext;
  const inputValue = useStoreState(store5, (state) => userValue != null ? userValue : state == null ? void 0 : state.value);
  const children = (0, import_react20.useMemo)(() => {
    if (!itemValue) return;
    if (!inputValue) return itemValue;
    return splitValue(itemValue, inputValue);
  }, [itemValue, inputValue]);
  props = {
    children,
    ...props
  };
  return removeUndefinedValues(props);
});
var ComboboxItemValue = forwardRef22(function ComboboxItemValue2(props) {
  const htmlProps = useComboboxItemValue(props);
  return createElement3(TagName11, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox-label.js
var TagName12 = "label";
var useComboboxLabel = createHook(
  function useComboboxLabel2({ store: store5, ...props }) {
    const context = useComboboxProviderContext();
    store5 = store5 || context;
    invariant(
      store5,
      "ComboboxLabel must receive a `store` prop or be wrapped in a ComboboxProvider component."
    );
    const comboboxId = useStoreState(store5, (state) => {
      var _a;
      return (_a = state.baseElement) == null ? void 0 : _a.id;
    });
    props = {
      htmlFor: comboboxId,
      ...props
    };
    return removeUndefinedValues(props);
  }
);
var ComboboxLabel = memo22(
  forwardRef22(function ComboboxLabel2(props) {
    const htmlProps = useComboboxLabel(props);
    return createElement3(TagName12, htmlProps);
  })
);

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/ZJYMN66B.js
var import_react21 = __toESM(require_react(), 1);
var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1);
var TagName13 = "div";
var useComboboxList = createHook(
  function useComboboxList2({ store: store5, alwaysVisible, ...props }) {
    const scopedContext = useComboboxScopedContext(true);
    const context = useComboboxContext();
    store5 = store5 || context;
    const scopedContextSameStore = !!store5 && store5 === scopedContext;
    invariant(
      store5,
      "ComboboxList must receive a `store` prop or be wrapped in a ComboboxProvider component."
    );
    const ref = (0, import_react21.useRef)(null);
    const id = useId4(props.id);
    const mounted = useStoreState(store5, "mounted");
    const hidden = isHidden(mounted, props.hidden, alwaysVisible);
    const style = hidden ? { ...props.style, display: "none" } : props.style;
    const multiSelectable = useStoreState(
      store5,
      (state) => Array.isArray(state.selectedValue)
    );
    const role = useAttribute(ref, "role", props.role);
    const isCompositeRole = role === "listbox" || role === "tree" || role === "grid";
    const ariaMultiSelectable = isCompositeRole ? multiSelectable || void 0 : void 0;
    const [hasListboxInside, setHasListboxInside] = (0, import_react21.useState)(false);
    const contentElement = useStoreState(store5, "contentElement");
    useSafeLayoutEffect(() => {
      if (!mounted) return;
      const element = ref.current;
      if (!element) return;
      if (contentElement !== element) return;
      const callback = () => {
        setHasListboxInside(!!element.querySelector("[role='listbox']"));
      };
      const observer = new MutationObserver(callback);
      observer.observe(element, {
        subtree: true,
        childList: true,
        attributeFilter: ["role"]
      });
      callback();
      return () => observer.disconnect();
    }, [mounted, contentElement]);
    if (!hasListboxInside) {
      props = {
        role: "listbox",
        "aria-multiselectable": ariaMultiSelectable,
        ...props
      };
    }
    props = useWrapElement(
      props,
      (element) => /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ComboboxScopedContextProvider, { value: store5, children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(ComboboxListRoleContext.Provider, { value: role, children: element }) }),
      [store5, role]
    );
    const setContentElement = id && (!scopedContext || !scopedContextSameStore) ? store5.setContentElement : null;
    props = {
      hidden,
      ...props,
      id,
      ref: useMergeRefs2(setContentElement, ref, props.ref),
      style
    };
    return removeUndefinedValues(props);
  }
);
var ComboboxList = forwardRef22(function ComboboxList2(props) {
  const htmlProps = useComboboxList(props);
  return createElement3(TagName13, htmlProps);
});

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/KR5NJL64.js
var import_react22 = __toESM(require_react(), 1);
var TagValueContext = (0, import_react22.createContext)(null);
var TagRemoveIdContext = (0, import_react22.createContext)(
  null
);
var ctx7 = createStoreContext(
  [CompositeContextProvider],
  [CompositeScopedContextProvider]
);
var useTagContext = ctx7.useContext;
var useTagScopedContext = ctx7.useScopedContext;
var useTagProviderContext = ctx7.useProviderContext;
var TagContextProvider = ctx7.ContextProvider;
var TagScopedContextProvider = ctx7.ScopedContextProvider;

// ../../../node_modules/.pnpm/@ariakit+core@0.4.19/node_modules/@ariakit/core/esm/combobox/combobox-store.js
var isTouchSafari = isSafari() && isTouchDevice();
function createComboboxStore({
  tag,
  ...props
} = {}) {
  const store5 = mergeStore(props.store, pick2(tag, ["value", "rtl"]));
  throwOnConflictingProps(props, store5);
  const tagState = tag == null ? void 0 : tag.getState();
  const syncState = store5 == null ? void 0 : store5.getState();
  const activeId = defaultValue(
    props.activeId,
    syncState == null ? void 0 : syncState.activeId,
    props.defaultActiveId,
    null
  );
  const composite = createCompositeStore({
    ...props,
    activeId,
    includesBaseElement: defaultValue(
      props.includesBaseElement,
      syncState == null ? void 0 : syncState.includesBaseElement,
      true
    ),
    orientation: defaultValue(
      props.orientation,
      syncState == null ? void 0 : syncState.orientation,
      "vertical"
    ),
    focusLoop: defaultValue(props.focusLoop, syncState == null ? void 0 : syncState.focusLoop, true),
    focusWrap: defaultValue(props.focusWrap, syncState == null ? void 0 : syncState.focusWrap, true),
    virtualFocus: defaultValue(
      props.virtualFocus,
      syncState == null ? void 0 : syncState.virtualFocus,
      true
    )
  });
  const popover = createPopoverStore({
    ...props,
    placement: defaultValue(
      props.placement,
      syncState == null ? void 0 : syncState.placement,
      "bottom-start"
    )
  });
  const value = defaultValue(
    props.value,
    syncState == null ? void 0 : syncState.value,
    props.defaultValue,
    ""
  );
  const selectedValue = defaultValue(
    props.selectedValue,
    syncState == null ? void 0 : syncState.selectedValue,
    tagState == null ? void 0 : tagState.values,
    props.defaultSelectedValue,
    ""
  );
  const multiSelectable = Array.isArray(selectedValue);
  const initialState4 = {
    ...composite.getState(),
    ...popover.getState(),
    value,
    selectedValue,
    resetValueOnSelect: defaultValue(
      props.resetValueOnSelect,
      syncState == null ? void 0 : syncState.resetValueOnSelect,
      multiSelectable
    ),
    resetValueOnHide: defaultValue(
      props.resetValueOnHide,
      syncState == null ? void 0 : syncState.resetValueOnHide,
      multiSelectable && !tag
    ),
    activeValue: syncState == null ? void 0 : syncState.activeValue
  };
  const combobox = createStore(initialState4, composite, popover, store5);
  if (isTouchSafari) {
    setup(
      combobox,
      () => sync(combobox, ["virtualFocus"], () => {
        combobox.setState("virtualFocus", false);
      })
    );
  }
  setup(combobox, () => {
    if (!tag) return;
    return chain(
      sync(combobox, ["selectedValue"], (state) => {
        if (!Array.isArray(state.selectedValue)) return;
        tag.setValues(state.selectedValue);
      }),
      sync(tag, ["values"], (state) => {
        combobox.setState("selectedValue", state.values);
      })
    );
  });
  setup(
    combobox,
    () => sync(combobox, ["resetValueOnHide", "mounted"], (state) => {
      if (!state.resetValueOnHide) return;
      if (state.mounted) return;
      combobox.setState("value", value);
    })
  );
  setup(
    combobox,
    () => sync(combobox, ["open"], (state) => {
      if (state.open) return;
      combobox.setState("activeId", activeId);
      combobox.setState("moves", 0);
    })
  );
  setup(
    combobox,
    () => sync(combobox, ["moves", "activeId"], (state, prevState) => {
      if (state.moves === prevState.moves) {
        combobox.setState("activeValue", void 0);
      }
    })
  );
  setup(
    combobox,
    () => batch(combobox, ["moves", "renderedItems"], (state, prev) => {
      if (state.moves === prev.moves) return;
      const { activeId: activeId2 } = combobox.getState();
      const activeItem = composite.item(activeId2);
      combobox.setState("activeValue", activeItem == null ? void 0 : activeItem.value);
    })
  );
  return {
    ...popover,
    ...composite,
    ...combobox,
    tag,
    setValue: (value2) => combobox.setState("value", value2),
    resetValue: () => combobox.setState("value", initialState4.value),
    setSelectedValue: (selectedValue2) => combobox.setState("selectedValue", selectedValue2)
  };
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/__chunks/KQS2CH22.js
function useComboboxStoreOptions(props) {
  const tag = useTagContext();
  props = {
    ...props,
    tag: props.tag !== void 0 ? props.tag : tag
  };
  return useCompositeStoreOptions(props);
}
function useComboboxStoreProps(store5, update2, props) {
  useUpdateEffect(update2, [props.tag]);
  useStoreProps(store5, props, "value", "setValue");
  useStoreProps(store5, props, "selectedValue", "setSelectedValue");
  useStoreProps(store5, props, "resetValueOnHide");
  useStoreProps(store5, props, "resetValueOnSelect");
  return Object.assign(
    useCompositeStoreProps(
      usePopoverStoreProps(store5, update2, props),
      update2,
      props
    ),
    { tag: props.tag }
  );
}
function useComboboxStore(props = {}) {
  props = useComboboxStoreOptions(props);
  const [store5, update2] = useStore(createComboboxStore, props);
  return useComboboxStoreProps(store5, update2, props);
}

// ../../../node_modules/.pnpm/@ariakit+react-core@0.4.25_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@ariakit/react-core/esm/combobox/combobox-provider.js
var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1);
function ComboboxProvider(props = {}) {
  const store5 = useComboboxStore(props);
  return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(ComboboxContextProvider, { value: store5, children: props.children });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.mjs
var import_remove_accents = __toESM(require_remove_accents(), 1);
var import_compose8 = __toESM(require_compose(), 1);
var import_i18n23 = __toESM(require_i18n(), 1);
var import_element33 = __toESM(require_element(), 1);
var import_components21 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/utils.mjs
var EMPTY_ARRAY4 = [];
var getCurrentValue = (filterDefinition, currentFilter) => {
  if (filterDefinition.singleSelection) {
    return currentFilter?.value;
  }
  if (Array.isArray(currentFilter?.value)) {
    return currentFilter.value;
  }
  if (!Array.isArray(currentFilter?.value) && !!currentFilter?.value) {
    return [currentFilter.value];
  }
  return EMPTY_ARRAY4;
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/hooks/use-elements.mjs
var import_element32 = __toESM(require_element(), 1);
var EMPTY_ARRAY5 = [];
function useElements({
  elements,
  getElements
}) {
  const staticElements = Array.isArray(elements) && elements.length > 0 ? elements : EMPTY_ARRAY5;
  const [records, setRecords] = (0, import_element32.useState)(staticElements);
  const [isLoading, setIsLoading2] = (0, import_element32.useState)(false);
  (0, import_element32.useEffect)(() => {
    if (!getElements) {
      setRecords(staticElements);
      return;
    }
    let cancelled = false;
    setIsLoading2(true);
    getElements().then((fetchedElements) => {
      if (!cancelled) {
        const dynamicElements = Array.isArray(fetchedElements) && fetchedElements.length > 0 ? fetchedElements : staticElements;
        setRecords(dynamicElements);
      }
    }).catch(() => {
      if (!cancelled) {
        setRecords(staticElements);
      }
    }).finally(() => {
      if (!cancelled) {
        setIsLoading2(false);
      }
    });
    return () => {
      cancelled = true;
    };
  }, [getElements, staticElements]);
  return {
    elements: records,
    isLoading
  };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/search-widget.mjs
var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1);
function normalizeSearchInput(input = "") {
  return (0, import_remove_accents.default)(input.trim().toLowerCase());
}
var getNewValue = (filterDefinition, currentFilter, value) => {
  if (filterDefinition.singleSelection) {
    return value;
  }
  if (Array.isArray(currentFilter?.value)) {
    return currentFilter.value.includes(value) ? currentFilter.value.filter((v2) => v2 !== value) : [...currentFilter.value, value];
  }
  return [value];
};
function generateFilterElementCompositeItemId(prefix, filterElementValue) {
  return `${prefix}-${filterElementValue}`;
}
var MultiSelectionOption = ({ selected }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
    "span",
    {
      className: clsx_default(
        "dataviews-filters__search-widget-listitem-multi-selection",
        { "is-selected": selected }
      ),
      children: selected && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components21.Icon, { icon: check_default })
    }
  );
};
var SingleSelectionOption = ({ selected }) => {
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
    "span",
    {
      className: clsx_default(
        "dataviews-filters__search-widget-listitem-single-selection",
        { "is-selected": selected }
      )
    }
  );
};
function ListBox({ view, filter, onChangeView }) {
  const baseId = (0, import_compose8.useInstanceId)(ListBox, "dataviews-filter-list-box");
  const [activeCompositeId, setActiveCompositeId] = (0, import_element33.useState)(
    // When there are one or less operators, the first item is set as active
    // (by setting the initial `activeId` to `undefined`).
    // With 2 or more operators, the focus is moved on the operators control
    // (by setting the initial `activeId` to `null`), meaning that there won't
    // be an active item initially. Focus is then managed via the
    // `onFocusVisible` callback.
    filter.operators?.length === 1 ? void 0 : null
  );
  const currentFilter = view.filters?.find(
    (f2) => f2.field === filter.field
  );
  const currentValue = getCurrentValue(filter, currentFilter);
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
    import_components21.Composite,
    {
      virtualFocus: true,
      focusLoop: true,
      activeId: activeCompositeId,
      setActiveId: setActiveCompositeId,
      role: "listbox",
      className: "dataviews-filters__search-widget-listbox",
      "aria-label": (0, import_i18n23.sprintf)(
        /* translators: List of items for a filter. 1: Filter name. e.g.: "List of: Author". */
        (0, import_i18n23.__)("List of: %1$s"),
        filter.name
      ),
      onFocusVisible: () => {
        if (!activeCompositeId && filter.elements.length) {
          setActiveCompositeId(
            generateFilterElementCompositeItemId(
              baseId,
              filter.elements[0].value
            )
          );
        }
      },
      render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components21.Composite.Typeahead, {}),
      children: filter.elements.map((element) => /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
        import_components21.Composite.Hover,
        {
          render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            import_components21.Composite.Item,
            {
              id: generateFilterElementCompositeItemId(
                baseId,
                element.value
              ),
              render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                "div",
                {
                  "aria-label": element.label,
                  role: "option",
                  className: "dataviews-filters__search-widget-listitem"
                }
              ),
              onClick: () => {
                const newFilters = currentFilter ? [
                  ...(view.filters ?? []).map(
                    (_filter) => {
                      if (_filter.field === filter.field) {
                        return {
                          ..._filter,
                          operator: currentFilter.operator || filter.operators[0],
                          value: getNewValue(
                            filter,
                            currentFilter,
                            element.value
                          )
                        };
                      }
                      return _filter;
                    }
                  )
                ] : [
                  ...view.filters ?? [],
                  {
                    field: filter.field,
                    operator: filter.operators[0],
                    value: getNewValue(
                      filter,
                      currentFilter,
                      element.value
                    )
                  }
                ];
                onChangeView({
                  ...view,
                  page: 1,
                  filters: newFilters
                });
              }
            }
          ),
          children: [
            filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
              SingleSelectionOption,
              {
                selected: currentValue === element.value
              }
            ),
            !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
              MultiSelectionOption,
              {
                selected: currentValue.includes(element.value)
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
              "span",
              {
                className: "dataviews-filters__search-widget-listitem-value",
                title: element.label,
                children: element.label
              }
            )
          ]
        },
        element.value
      ))
    }
  );
}
function ComboboxList22({ view, filter, onChangeView }) {
  const [searchValue, setSearchValue] = (0, import_element33.useState)("");
  const deferredSearchValue = (0, import_element33.useDeferredValue)(searchValue);
  const currentFilter = view.filters?.find(
    (_filter) => _filter.field === filter.field
  );
  const currentValue = getCurrentValue(filter, currentFilter);
  const matches = (0, import_element33.useMemo)(() => {
    const normalizedSearch = normalizeSearchInput(deferredSearchValue);
    return filter.elements.filter(
      (item) => normalizeSearchInput(item.label).includes(normalizedSearch)
    );
  }, [filter.elements, deferredSearchValue]);
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
    ComboboxProvider,
    {
      selectedValue: currentValue,
      setSelectedValue: (value) => {
        const newFilters = currentFilter ? [
          ...(view.filters ?? []).map((_filter) => {
            if (_filter.field === filter.field) {
              return {
                ..._filter,
                operator: currentFilter.operator || filter.operators[0],
                value
              };
            }
            return _filter;
          })
        ] : [
          ...view.filters ?? [],
          {
            field: filter.field,
            operator: filter.operators[0],
            value
          }
        ];
        onChangeView({
          ...view,
          page: 1,
          filters: newFilters
        });
      },
      setValue: setSearchValue,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "dataviews-filters__search-widget-filter-combobox__wrapper", children: [
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            ComboboxLabel,
            {
              render: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components21.VisuallyHidden, { children: (0, import_i18n23.__)("Search items") }),
              children: (0, import_i18n23.__)("Search items")
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
            Combobox,
            {
              autoSelect: "always",
              placeholder: (0, import_i18n23.__)("Search"),
              className: "dataviews-filters__search-widget-filter-combobox__input"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "dataviews-filters__search-widget-filter-combobox__icon", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components21.Icon, { icon: search_default }) })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
          ComboboxList,
          {
            className: "dataviews-filters__search-widget-filter-combobox-list",
            alwaysVisible: true,
            children: [
              matches.map((element) => {
                return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
                  ComboboxItem,
                  {
                    resetValueOnSelect: false,
                    value: element.value,
                    className: "dataviews-filters__search-widget-listitem",
                    hideOnClick: false,
                    setValueOnClick: false,
                    focusOnHover: true,
                    children: [
                      filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                        SingleSelectionOption,
                        {
                          selected: currentValue === element.value
                        }
                      ),
                      !filter.singleSelection && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                        MultiSelectionOption,
                        {
                          selected: currentValue.includes(
                            element.value
                          )
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(
                        "span",
                        {
                          className: "dataviews-filters__search-widget-listitem-value",
                          title: element.label,
                          children: [
                            /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(
                              ComboboxItemValue,
                              {
                                className: "dataviews-filters__search-widget-filter-combobox-item-value",
                                value: element.label
                              }
                            ),
                            !!element.description && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("span", { className: "dataviews-filters__search-widget-listitem-description", children: element.description })
                          ]
                        }
                      )
                    ]
                  },
                  element.value
                );
              }),
              !matches.length && /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("p", { children: (0, import_i18n23.__)("No results found") })
            ]
          }
        )
      ]
    }
  );
}
function SearchWidget(props) {
  const { elements, isLoading } = useElements({
    elements: props.filter.elements,
    getElements: props.filter.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_components21.Spinner, {}) });
  }
  if (elements.length === 0) {
    return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "dataviews-filters__search-widget-no-elements", children: (0, import_i18n23.__)("No elements found") });
  }
  const Widget = elements.length > 10 ? ComboboxList22 : ListBox;
  return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(Widget, { ...props, filter: { ...props.filter, elements } });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/input-widget.mjs
var import_es6 = __toESM(require_es6(), 1);
var import_compose9 = __toESM(require_compose(), 1);
var import_element34 = __toESM(require_element(), 1);
var import_components22 = __toESM(require_components(), 1);
var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1);
function InputWidget({
  filter,
  view,
  onChangeView,
  fields
}) {
  const currentFilter = view.filters?.find(
    (f2) => f2.field === filter.field
  );
  const currentValue = getCurrentValue(filter, currentFilter);
  const field = (0, import_element34.useMemo)(() => {
    const currentField = fields.find((f2) => f2.id === filter.field);
    if (currentField) {
      return {
        ...currentField,
        // Deactivate validation for filters.
        isValid: {},
        // Configure getValue/setValue as if Item was a plain object.
        getValue: ({ item }) => item[currentField.id],
        setValue: ({ value }) => ({
          [currentField.id]: value
        })
      };
    }
    return currentField;
  }, [fields, filter.field]);
  const data = (0, import_element34.useMemo)(() => {
    return (view.filters ?? []).reduce(
      (acc, activeFilter) => {
        acc[activeFilter.field] = activeFilter.value;
        return acc;
      },
      {}
    );
  }, [view.filters]);
  const handleChange = (0, import_compose9.useEvent)((updatedData) => {
    if (!field || !currentFilter) {
      return;
    }
    const nextValue = field.getValue({ item: updatedData });
    if ((0, import_es6.default)(nextValue, currentValue)) {
      return;
    }
    onChangeView({
      ...view,
      filters: (view.filters ?? []).map(
        (_filter) => _filter.field === filter.field ? {
          ..._filter,
          operator: currentFilter.operator || filter.operators[0],
          // Consider empty strings as undefined:
          //
          // - undefined as value means the filter is unset: the filter widget displays no value and the search returns all records
          // - empty string as value means "search empty string": returns only the records that have an empty string as value
          //
          // In practice, this means the filter will not be able to find an empty string as the value.
          value: nextValue === "" ? void 0 : nextValue
        } : _filter
      )
    });
  });
  if (!field || !field.Edit || !currentFilter) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
    import_components22.Flex,
    {
      className: "dataviews-filters__user-input-widget",
      gap: 2.5,
      direction: "column",
      children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(
        field.Edit,
        {
          hideLabelFromVision: true,
          data,
          field,
          operator: currentFilter.operator,
          onChange: handleChange
        }
      )
    }
  );
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constants.js
var daysInYear = 365.2425;
var maxTime = Math.pow(10, 8) * 24 * 60 * 60 * 1e3;
var minTime = -maxTime;
var millisecondsInWeek = 6048e5;
var millisecondsInDay = 864e5;
var secondsInHour = 3600;
var secondsInDay = secondsInHour * 24;
var secondsInWeek = secondsInDay * 7;
var secondsInYear = secondsInDay * daysInYear;
var secondsInMonth = secondsInYear / 12;
var secondsInQuarter = secondsInMonth * 3;
var constructFromSymbol = /* @__PURE__ */ Symbol.for("constructDateFrom");

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/constructFrom.js
function constructFrom(date, value) {
  if (typeof date === "function") return date(value);
  if (date && typeof date === "object" && constructFromSymbol in date)
    return date[constructFromSymbol](value);
  if (date instanceof Date) return new date.constructor(value);
  return new Date(value);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/toDate.js
function toDate(argument, context) {
  return constructFrom(context || argument, argument);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addDays.js
function addDays(date, amount, options) {
  const _date = toDate(date, options?.in);
  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
  if (!amount) return _date;
  _date.setDate(_date.getDate() + amount);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addMonths.js
function addMonths(date, amount, options) {
  const _date = toDate(date, options?.in);
  if (isNaN(amount)) return constructFrom(options?.in || date, NaN);
  if (!amount) {
    return _date;
  }
  const dayOfMonth = _date.getDate();
  const endOfDesiredMonth = constructFrom(options?.in || date, _date.getTime());
  endOfDesiredMonth.setMonth(_date.getMonth() + amount + 1, 0);
  const daysInMonth = endOfDesiredMonth.getDate();
  if (dayOfMonth >= daysInMonth) {
    return endOfDesiredMonth;
  } else {
    _date.setFullYear(
      endOfDesiredMonth.getFullYear(),
      endOfDesiredMonth.getMonth(),
      dayOfMonth
    );
    return _date;
  }
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/defaultOptions.js
var defaultOptions = {};
function getDefaultOptions() {
  return defaultOptions;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeek.js
function startOfWeek(date, options) {
  const defaultOptions2 = getDefaultOptions();
  const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
  const _date = toDate(date, options?.in);
  const day = _date.getDay();
  const diff = (day < weekStartsOn ? 7 : 0) + day - weekStartsOn;
  _date.setDate(_date.getDate() - diff);
  _date.setHours(0, 0, 0, 0);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeek.js
function startOfISOWeek(date, options) {
  return startOfWeek(date, { ...options, weekStartsOn: 1 });
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeekYear.js
function getISOWeekYear(date, options) {
  const _date = toDate(date, options?.in);
  const year = _date.getFullYear();
  const fourthOfJanuaryOfNextYear = constructFrom(_date, 0);
  fourthOfJanuaryOfNextYear.setFullYear(year + 1, 0, 4);
  fourthOfJanuaryOfNextYear.setHours(0, 0, 0, 0);
  const startOfNextYear = startOfISOWeek(fourthOfJanuaryOfNextYear);
  const fourthOfJanuaryOfThisYear = constructFrom(_date, 0);
  fourthOfJanuaryOfThisYear.setFullYear(year, 0, 4);
  fourthOfJanuaryOfThisYear.setHours(0, 0, 0, 0);
  const startOfThisYear = startOfISOWeek(fourthOfJanuaryOfThisYear);
  if (_date.getTime() >= startOfNextYear.getTime()) {
    return year + 1;
  } else if (_date.getTime() >= startOfThisYear.getTime()) {
    return year;
  } else {
    return year - 1;
  }
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js
function getTimezoneOffsetInMilliseconds(date) {
  const _date = toDate(date);
  const utcDate = new Date(
    Date.UTC(
      _date.getFullYear(),
      _date.getMonth(),
      _date.getDate(),
      _date.getHours(),
      _date.getMinutes(),
      _date.getSeconds(),
      _date.getMilliseconds()
    )
  );
  utcDate.setUTCFullYear(_date.getFullYear());
  return +date - +utcDate;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/normalizeDates.js
function normalizeDates(context, ...dates) {
  const normalize = constructFrom.bind(
    null,
    context || dates.find((date) => typeof date === "object")
  );
  return dates.map(normalize);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfDay.js
function startOfDay(date, options) {
  const _date = toDate(date, options?.in);
  _date.setHours(0, 0, 0, 0);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/differenceInCalendarDays.js
function differenceInCalendarDays(laterDate, earlierDate, options) {
  const [laterDate_, earlierDate_] = normalizeDates(
    options?.in,
    laterDate,
    earlierDate
  );
  const laterStartOfDay = startOfDay(laterDate_);
  const earlierStartOfDay = startOfDay(earlierDate_);
  const laterTimestamp = +laterStartOfDay - getTimezoneOffsetInMilliseconds(laterStartOfDay);
  const earlierTimestamp = +earlierStartOfDay - getTimezoneOffsetInMilliseconds(earlierStartOfDay);
  return Math.round((laterTimestamp - earlierTimestamp) / millisecondsInDay);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfISOWeekYear.js
function startOfISOWeekYear(date, options) {
  const year = getISOWeekYear(date, options);
  const fourthOfJanuary = constructFrom(options?.in || date, 0);
  fourthOfJanuary.setFullYear(year, 0, 4);
  fourthOfJanuary.setHours(0, 0, 0, 0);
  return startOfISOWeek(fourthOfJanuary);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addWeeks.js
function addWeeks(date, amount, options) {
  return addDays(date, amount * 7, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/addYears.js
function addYears(date, amount, options) {
  return addMonths(date, amount * 12, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isDate.js
function isDate(value) {
  return value instanceof Date || typeof value === "object" && Object.prototype.toString.call(value) === "[object Date]";
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/isValid.js
function isValid(date) {
  return !(!isDate(date) && typeof date !== "number" || isNaN(+toDate(date)));
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfMonth.js
function startOfMonth(date, options) {
  const _date = toDate(date, options?.in);
  _date.setDate(1);
  _date.setHours(0, 0, 0, 0);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfYear.js
function startOfYear(date, options) {
  const date_ = toDate(date, options?.in);
  date_.setFullYear(date_.getFullYear(), 0, 1);
  date_.setHours(0, 0, 0, 0);
  return date_;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatDistance.js
var formatDistanceLocale = {
  lessThanXSeconds: {
    one: "less than a second",
    other: "less than {{count}} seconds"
  },
  xSeconds: {
    one: "1 second",
    other: "{{count}} seconds"
  },
  halfAMinute: "half a minute",
  lessThanXMinutes: {
    one: "less than a minute",
    other: "less than {{count}} minutes"
  },
  xMinutes: {
    one: "1 minute",
    other: "{{count}} minutes"
  },
  aboutXHours: {
    one: "about 1 hour",
    other: "about {{count}} hours"
  },
  xHours: {
    one: "1 hour",
    other: "{{count}} hours"
  },
  xDays: {
    one: "1 day",
    other: "{{count}} days"
  },
  aboutXWeeks: {
    one: "about 1 week",
    other: "about {{count}} weeks"
  },
  xWeeks: {
    one: "1 week",
    other: "{{count}} weeks"
  },
  aboutXMonths: {
    one: "about 1 month",
    other: "about {{count}} months"
  },
  xMonths: {
    one: "1 month",
    other: "{{count}} months"
  },
  aboutXYears: {
    one: "about 1 year",
    other: "about {{count}} years"
  },
  xYears: {
    one: "1 year",
    other: "{{count}} years"
  },
  overXYears: {
    one: "over 1 year",
    other: "over {{count}} years"
  },
  almostXYears: {
    one: "almost 1 year",
    other: "almost {{count}} years"
  }
};
var formatDistance = (token, count, options) => {
  let result;
  const tokenValue = formatDistanceLocale[token];
  if (typeof tokenValue === "string") {
    result = tokenValue;
  } else if (count === 1) {
    result = tokenValue.one;
  } else {
    result = tokenValue.other.replace("{{count}}", count.toString());
  }
  if (options?.addSuffix) {
    if (options.comparison && options.comparison > 0) {
      return "in " + result;
    } else {
      return result + " ago";
    }
  }
  return result;
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
  return (options = {}) => {
    const width = options.width ? String(options.width) : args.defaultWidth;
    const format6 = args.formats[width] || args.formats[args.defaultWidth];
    return format6;
  };
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatLong.js
var dateFormats = {
  full: "EEEE, MMMM do, y",
  long: "MMMM do, y",
  medium: "MMM d, y",
  short: "MM/dd/yyyy"
};
var timeFormats = {
  full: "h:mm:ss a zzzz",
  long: "h:mm:ss a z",
  medium: "h:mm:ss a",
  short: "h:mm a"
};
var dateTimeFormats = {
  full: "{{date}} 'at' {{time}}",
  long: "{{date}} 'at' {{time}}",
  medium: "{{date}}, {{time}}",
  short: "{{date}}, {{time}}"
};
var formatLong = {
  date: buildFormatLongFn({
    formats: dateFormats,
    defaultWidth: "full"
  }),
  time: buildFormatLongFn({
    formats: timeFormats,
    defaultWidth: "full"
  }),
  dateTime: buildFormatLongFn({
    formats: dateTimeFormats,
    defaultWidth: "full"
  })
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/formatRelative.js
var formatRelativeLocale = {
  lastWeek: "'last' eeee 'at' p",
  yesterday: "'yesterday at' p",
  today: "'today at' p",
  tomorrow: "'tomorrow at' p",
  nextWeek: "eeee 'at' p",
  other: "P"
};
var formatRelative = (token, _date, _baseDate, _options) => formatRelativeLocale[token];

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
  return (value, options) => {
    const context = options?.context ? String(options.context) : "standalone";
    let valuesArray;
    if (context === "formatting" && args.formattingValues) {
      const defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
      const width = options?.width ? String(options.width) : defaultWidth;
      valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
    } else {
      const defaultWidth = args.defaultWidth;
      const width = options?.width ? String(options.width) : args.defaultWidth;
      valuesArray = args.values[width] || args.values[defaultWidth];
    }
    const index = args.argumentCallback ? args.argumentCallback(value) : value;
    return valuesArray[index];
  };
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/localize.js
var eraValues = {
  narrow: ["B", "A"],
  abbreviated: ["BC", "AD"],
  wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
  narrow: ["1", "2", "3", "4"],
  abbreviated: ["Q1", "Q2", "Q3", "Q4"],
  wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
  narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
  abbreviated: [
    "Jan",
    "Feb",
    "Mar",
    "Apr",
    "May",
    "Jun",
    "Jul",
    "Aug",
    "Sep",
    "Oct",
    "Nov",
    "Dec"
  ],
  wide: [
    "January",
    "February",
    "March",
    "April",
    "May",
    "June",
    "July",
    "August",
    "September",
    "October",
    "November",
    "December"
  ]
};
var dayValues = {
  narrow: ["S", "M", "T", "W", "T", "F", "S"],
  short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
  abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
  wide: [
    "Sunday",
    "Monday",
    "Tuesday",
    "Wednesday",
    "Thursday",
    "Friday",
    "Saturday"
  ]
};
var dayPeriodValues = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "morning",
    afternoon: "afternoon",
    evening: "evening",
    night: "night"
  }
};
var formattingDayPeriodValues = {
  narrow: {
    am: "a",
    pm: "p",
    midnight: "mi",
    noon: "n",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  abbreviated: {
    am: "AM",
    pm: "PM",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  },
  wide: {
    am: "a.m.",
    pm: "p.m.",
    midnight: "midnight",
    noon: "noon",
    morning: "in the morning",
    afternoon: "in the afternoon",
    evening: "in the evening",
    night: "at night"
  }
};
var ordinalNumber = (dirtyNumber, _options) => {
  const number = Number(dirtyNumber);
  const rem100 = number % 100;
  if (rem100 > 20 || rem100 < 10) {
    switch (rem100 % 10) {
      case 1:
        return number + "st";
      case 2:
        return number + "nd";
      case 3:
        return number + "rd";
    }
  }
  return number + "th";
};
var localize = {
  ordinalNumber,
  era: buildLocalizeFn({
    values: eraValues,
    defaultWidth: "wide"
  }),
  quarter: buildLocalizeFn({
    values: quarterValues,
    defaultWidth: "wide",
    argumentCallback: (quarter) => quarter - 1
  }),
  month: buildLocalizeFn({
    values: monthValues,
    defaultWidth: "wide"
  }),
  day: buildLocalizeFn({
    values: dayValues,
    defaultWidth: "wide"
  }),
  dayPeriod: buildLocalizeFn({
    values: dayPeriodValues,
    defaultWidth: "wide",
    formattingValues: formattingDayPeriodValues,
    defaultFormattingWidth: "wide"
  })
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
  return (string, options = {}) => {
    const width = options.width;
    const matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
    const matchResult = string.match(matchPattern);
    if (!matchResult) {
      return null;
    }
    const matchedString = matchResult[0];
    const parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
    const key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, (pattern) => pattern.test(matchedString)) : (
      // [TODO] -- I challenge you to fix the type
      findKey(parsePatterns, (pattern) => pattern.test(matchedString))
    );
    let value;
    value = args.valueCallback ? args.valueCallback(key) : key;
    value = options.valueCallback ? (
      // [TODO] -- I challenge you to fix the type
      options.valueCallback(value)
    ) : value;
    const rest = string.slice(matchedString.length);
    return { value, rest };
  };
}
function findKey(object, predicate) {
  for (const key in object) {
    if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
      return key;
    }
  }
  return void 0;
}
function findIndex(array, predicate) {
  for (let key = 0; key < array.length; key++) {
    if (predicate(array[key])) {
      return key;
    }
  }
  return void 0;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
  return (string, options = {}) => {
    const matchResult = string.match(args.matchPattern);
    if (!matchResult) return null;
    const matchedString = matchResult[0];
    const parseResult = string.match(args.parsePattern);
    if (!parseResult) return null;
    let value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
    value = options.valueCallback ? options.valueCallback(value) : value;
    const rest = string.slice(matchedString.length);
    return { value, rest };
  };
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
  narrow: /^(b|a)/i,
  abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
  wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
  any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
  narrow: /^[1234]/i,
  abbreviated: /^q[1234]/i,
  wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
  any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
  narrow: /^[jfmasond]/i,
  abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
  wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
  narrow: [
    /^j/i,
    /^f/i,
    /^m/i,
    /^a/i,
    /^m/i,
    /^j/i,
    /^j/i,
    /^a/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ],
  any: [
    /^ja/i,
    /^f/i,
    /^mar/i,
    /^ap/i,
    /^may/i,
    /^jun/i,
    /^jul/i,
    /^au/i,
    /^s/i,
    /^o/i,
    /^n/i,
    /^d/i
  ]
};
var matchDayPatterns = {
  narrow: /^[smtwf]/i,
  short: /^(su|mo|tu|we|th|fr|sa)/i,
  abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
  wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
  narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
  any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
  narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
  any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
  any: {
    am: /^a/i,
    pm: /^p/i,
    midnight: /^mi/i,
    noon: /^no/i,
    morning: /morning/i,
    afternoon: /afternoon/i,
    evening: /evening/i,
    night: /night/i
  }
};
var match = {
  ordinalNumber: buildMatchPatternFn({
    matchPattern: matchOrdinalNumberPattern,
    parsePattern: parseOrdinalNumberPattern,
    valueCallback: (value) => parseInt(value, 10)
  }),
  era: buildMatchFn({
    matchPatterns: matchEraPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseEraPatterns,
    defaultParseWidth: "any"
  }),
  quarter: buildMatchFn({
    matchPatterns: matchQuarterPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseQuarterPatterns,
    defaultParseWidth: "any",
    valueCallback: (index) => index + 1
  }),
  month: buildMatchFn({
    matchPatterns: matchMonthPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseMonthPatterns,
    defaultParseWidth: "any"
  }),
  day: buildMatchFn({
    matchPatterns: matchDayPatterns,
    defaultMatchWidth: "wide",
    parsePatterns: parseDayPatterns,
    defaultParseWidth: "any"
  }),
  dayPeriod: buildMatchFn({
    matchPatterns: matchDayPeriodPatterns,
    defaultMatchWidth: "any",
    parsePatterns: parseDayPeriodPatterns,
    defaultParseWidth: "any"
  })
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/locale/en-US.js
var enUS = {
  code: "en-US",
  formatDistance,
  formatLong,
  formatRelative,
  localize,
  match,
  options: {
    weekStartsOn: 0,
    firstWeekContainsDate: 1
  }
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getDayOfYear.js
function getDayOfYear(date, options) {
  const _date = toDate(date, options?.in);
  const diff = differenceInCalendarDays(_date, startOfYear(_date));
  const dayOfYear = diff + 1;
  return dayOfYear;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getISOWeek.js
function getISOWeek(date, options) {
  const _date = toDate(date, options?.in);
  const diff = +startOfISOWeek(_date) - +startOfISOWeekYear(_date);
  return Math.round(diff / millisecondsInWeek) + 1;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeekYear.js
function getWeekYear(date, options) {
  const _date = toDate(date, options?.in);
  const year = _date.getFullYear();
  const defaultOptions2 = getDefaultOptions();
  const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
  const firstWeekOfNextYear = constructFrom(options?.in || date, 0);
  firstWeekOfNextYear.setFullYear(year + 1, 0, firstWeekContainsDate);
  firstWeekOfNextYear.setHours(0, 0, 0, 0);
  const startOfNextYear = startOfWeek(firstWeekOfNextYear, options);
  const firstWeekOfThisYear = constructFrom(options?.in || date, 0);
  firstWeekOfThisYear.setFullYear(year, 0, firstWeekContainsDate);
  firstWeekOfThisYear.setHours(0, 0, 0, 0);
  const startOfThisYear = startOfWeek(firstWeekOfThisYear, options);
  if (+_date >= +startOfNextYear) {
    return year + 1;
  } else if (+_date >= +startOfThisYear) {
    return year;
  } else {
    return year - 1;
  }
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/startOfWeekYear.js
function startOfWeekYear(date, options) {
  const defaultOptions2 = getDefaultOptions();
  const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
  const year = getWeekYear(date, options);
  const firstWeek = constructFrom(options?.in || date, 0);
  firstWeek.setFullYear(year, 0, firstWeekContainsDate);
  firstWeek.setHours(0, 0, 0, 0);
  const _date = startOfWeek(firstWeek, options);
  return _date;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/getWeek.js
function getWeek(date, options) {
  const _date = toDate(date, options?.in);
  const diff = +startOfWeek(_date, options) - +startOfWeekYear(_date, options);
  return Math.round(diff / millisecondsInWeek) + 1;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/addLeadingZeros.js
function addLeadingZeros(number, targetLength) {
  const sign = number < 0 ? "-" : "";
  const output = Math.abs(number).toString().padStart(targetLength, "0");
  return sign + output;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/lightFormatters.js
var lightFormatters = {
  // Year
  y(date, token) {
    const signedYear = date.getFullYear();
    const year = signedYear > 0 ? signedYear : 1 - signedYear;
    return addLeadingZeros(token === "yy" ? year % 100 : year, token.length);
  },
  // Month
  M(date, token) {
    const month = date.getMonth();
    return token === "M" ? String(month + 1) : addLeadingZeros(month + 1, 2);
  },
  // Day of the month
  d(date, token) {
    return addLeadingZeros(date.getDate(), token.length);
  },
  // AM or PM
  a(date, token) {
    const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return dayPeriodEnumValue.toUpperCase();
      case "aaa":
        return dayPeriodEnumValue;
      case "aaaaa":
        return dayPeriodEnumValue[0];
      case "aaaa":
      default:
        return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
    }
  },
  // Hour [1-12]
  h(date, token) {
    return addLeadingZeros(date.getHours() % 12 || 12, token.length);
  },
  // Hour [0-23]
  H(date, token) {
    return addLeadingZeros(date.getHours(), token.length);
  },
  // Minute
  m(date, token) {
    return addLeadingZeros(date.getMinutes(), token.length);
  },
  // Second
  s(date, token) {
    return addLeadingZeros(date.getSeconds(), token.length);
  },
  // Fraction of second
  S(date, token) {
    const numberOfDigits = token.length;
    const milliseconds = date.getMilliseconds();
    const fractionalSeconds = Math.trunc(
      milliseconds * Math.pow(10, numberOfDigits - 3)
    );
    return addLeadingZeros(fractionalSeconds, token.length);
  }
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/formatters.js
var dayPeriodEnum = {
  am: "am",
  pm: "pm",
  midnight: "midnight",
  noon: "noon",
  morning: "morning",
  afternoon: "afternoon",
  evening: "evening",
  night: "night"
};
var formatters = {
  // Era
  G: function(date, token, localize2) {
    const era = date.getFullYear() > 0 ? 1 : 0;
    switch (token) {
      // AD, BC
      case "G":
      case "GG":
      case "GGG":
        return localize2.era(era, { width: "abbreviated" });
      // A, B
      case "GGGGG":
        return localize2.era(era, { width: "narrow" });
      // Anno Domini, Before Christ
      case "GGGG":
      default:
        return localize2.era(era, { width: "wide" });
    }
  },
  // Year
  y: function(date, token, localize2) {
    if (token === "yo") {
      const signedYear = date.getFullYear();
      const year = signedYear > 0 ? signedYear : 1 - signedYear;
      return localize2.ordinalNumber(year, { unit: "year" });
    }
    return lightFormatters.y(date, token);
  },
  // Local week-numbering year
  Y: function(date, token, localize2, options) {
    const signedWeekYear = getWeekYear(date, options);
    const weekYear = signedWeekYear > 0 ? signedWeekYear : 1 - signedWeekYear;
    if (token === "YY") {
      const twoDigitYear = weekYear % 100;
      return addLeadingZeros(twoDigitYear, 2);
    }
    if (token === "Yo") {
      return localize2.ordinalNumber(weekYear, { unit: "year" });
    }
    return addLeadingZeros(weekYear, token.length);
  },
  // ISO week-numbering year
  R: function(date, token) {
    const isoWeekYear = getISOWeekYear(date);
    return addLeadingZeros(isoWeekYear, token.length);
  },
  // Extended year. This is a single number designating the year of this calendar system.
  // The main difference between `y` and `u` localizers are B.C. years:
  // | Year | `y` | `u` |
  // |------|-----|-----|
  // | AC 1 |   1 |   1 |
  // | BC 1 |   1 |   0 |
  // | BC 2 |   2 |  -1 |
  // Also `yy` always returns the last two digits of a year,
  // while `uu` pads single digit years to 2 characters and returns other years unchanged.
  u: function(date, token) {
    const year = date.getFullYear();
    return addLeadingZeros(year, token.length);
  },
  // Quarter
  Q: function(date, token, localize2) {
    const quarter = Math.ceil((date.getMonth() + 1) / 3);
    switch (token) {
      // 1, 2, 3, 4
      case "Q":
        return String(quarter);
      // 01, 02, 03, 04
      case "QQ":
        return addLeadingZeros(quarter, 2);
      // 1st, 2nd, 3rd, 4th
      case "Qo":
        return localize2.ordinalNumber(quarter, { unit: "quarter" });
      // Q1, Q2, Q3, Q4
      case "QQQ":
        return localize2.quarter(quarter, {
          width: "abbreviated",
          context: "formatting"
        });
      // 1, 2, 3, 4 (narrow quarter; could be not numerical)
      case "QQQQQ":
        return localize2.quarter(quarter, {
          width: "narrow",
          context: "formatting"
        });
      // 1st quarter, 2nd quarter, ...
      case "QQQQ":
      default:
        return localize2.quarter(quarter, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone quarter
  q: function(date, token, localize2) {
    const quarter = Math.ceil((date.getMonth() + 1) / 3);
    switch (token) {
      // 1, 2, 3, 4
      case "q":
        return String(quarter);
      // 01, 02, 03, 04
      case "qq":
        return addLeadingZeros(quarter, 2);
      // 1st, 2nd, 3rd, 4th
      case "qo":
        return localize2.ordinalNumber(quarter, { unit: "quarter" });
      // Q1, Q2, Q3, Q4
      case "qqq":
        return localize2.quarter(quarter, {
          width: "abbreviated",
          context: "standalone"
        });
      // 1, 2, 3, 4 (narrow quarter; could be not numerical)
      case "qqqqq":
        return localize2.quarter(quarter, {
          width: "narrow",
          context: "standalone"
        });
      // 1st quarter, 2nd quarter, ...
      case "qqqq":
      default:
        return localize2.quarter(quarter, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // Month
  M: function(date, token, localize2) {
    const month = date.getMonth();
    switch (token) {
      case "M":
      case "MM":
        return lightFormatters.M(date, token);
      // 1st, 2nd, ..., 12th
      case "Mo":
        return localize2.ordinalNumber(month + 1, { unit: "month" });
      // Jan, Feb, ..., Dec
      case "MMM":
        return localize2.month(month, {
          width: "abbreviated",
          context: "formatting"
        });
      // J, F, ..., D
      case "MMMMM":
        return localize2.month(month, {
          width: "narrow",
          context: "formatting"
        });
      // January, February, ..., December
      case "MMMM":
      default:
        return localize2.month(month, { width: "wide", context: "formatting" });
    }
  },
  // Stand-alone month
  L: function(date, token, localize2) {
    const month = date.getMonth();
    switch (token) {
      // 1, 2, ..., 12
      case "L":
        return String(month + 1);
      // 01, 02, ..., 12
      case "LL":
        return addLeadingZeros(month + 1, 2);
      // 1st, 2nd, ..., 12th
      case "Lo":
        return localize2.ordinalNumber(month + 1, { unit: "month" });
      // Jan, Feb, ..., Dec
      case "LLL":
        return localize2.month(month, {
          width: "abbreviated",
          context: "standalone"
        });
      // J, F, ..., D
      case "LLLLL":
        return localize2.month(month, {
          width: "narrow",
          context: "standalone"
        });
      // January, February, ..., December
      case "LLLL":
      default:
        return localize2.month(month, { width: "wide", context: "standalone" });
    }
  },
  // Local week of year
  w: function(date, token, localize2, options) {
    const week = getWeek(date, options);
    if (token === "wo") {
      return localize2.ordinalNumber(week, { unit: "week" });
    }
    return addLeadingZeros(week, token.length);
  },
  // ISO week of year
  I: function(date, token, localize2) {
    const isoWeek = getISOWeek(date);
    if (token === "Io") {
      return localize2.ordinalNumber(isoWeek, { unit: "week" });
    }
    return addLeadingZeros(isoWeek, token.length);
  },
  // Day of the month
  d: function(date, token, localize2) {
    if (token === "do") {
      return localize2.ordinalNumber(date.getDate(), { unit: "date" });
    }
    return lightFormatters.d(date, token);
  },
  // Day of year
  D: function(date, token, localize2) {
    const dayOfYear = getDayOfYear(date);
    if (token === "Do") {
      return localize2.ordinalNumber(dayOfYear, { unit: "dayOfYear" });
    }
    return addLeadingZeros(dayOfYear, token.length);
  },
  // Day of week
  E: function(date, token, localize2) {
    const dayOfWeek = date.getDay();
    switch (token) {
      // Tue
      case "E":
      case "EE":
      case "EEE":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "EEEEE":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "EEEEEE":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "EEEE":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Local day of week
  e: function(date, token, localize2, options) {
    const dayOfWeek = date.getDay();
    const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      // Numerical value (Nth day of week with current locale or weekStartsOn)
      case "e":
        return String(localDayOfWeek);
      // Padded numerical value
      case "ee":
        return addLeadingZeros(localDayOfWeek, 2);
      // 1st, 2nd, ..., 7th
      case "eo":
        return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
      case "eee":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "eeeee":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "eeeeee":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "eeee":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Stand-alone local day of week
  c: function(date, token, localize2, options) {
    const dayOfWeek = date.getDay();
    const localDayOfWeek = (dayOfWeek - options.weekStartsOn + 8) % 7 || 7;
    switch (token) {
      // Numerical value (same as in `e`)
      case "c":
        return String(localDayOfWeek);
      // Padded numerical value
      case "cc":
        return addLeadingZeros(localDayOfWeek, token.length);
      // 1st, 2nd, ..., 7th
      case "co":
        return localize2.ordinalNumber(localDayOfWeek, { unit: "day" });
      case "ccc":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "standalone"
        });
      // T
      case "ccccc":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "standalone"
        });
      // Tu
      case "cccccc":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "standalone"
        });
      // Tuesday
      case "cccc":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "standalone"
        });
    }
  },
  // ISO day of week
  i: function(date, token, localize2) {
    const dayOfWeek = date.getDay();
    const isoDayOfWeek = dayOfWeek === 0 ? 7 : dayOfWeek;
    switch (token) {
      // 2
      case "i":
        return String(isoDayOfWeek);
      // 02
      case "ii":
        return addLeadingZeros(isoDayOfWeek, token.length);
      // 2nd
      case "io":
        return localize2.ordinalNumber(isoDayOfWeek, { unit: "day" });
      // Tue
      case "iii":
        return localize2.day(dayOfWeek, {
          width: "abbreviated",
          context: "formatting"
        });
      // T
      case "iiiii":
        return localize2.day(dayOfWeek, {
          width: "narrow",
          context: "formatting"
        });
      // Tu
      case "iiiiii":
        return localize2.day(dayOfWeek, {
          width: "short",
          context: "formatting"
        });
      // Tuesday
      case "iiii":
      default:
        return localize2.day(dayOfWeek, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM or PM
  a: function(date, token, localize2) {
    const hours = date.getHours();
    const dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    switch (token) {
      case "a":
      case "aa":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "aaa":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "aaaaa":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "aaaa":
      default:
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // AM, PM, midnight, noon
  b: function(date, token, localize2) {
    const hours = date.getHours();
    let dayPeriodEnumValue;
    if (hours === 12) {
      dayPeriodEnumValue = dayPeriodEnum.noon;
    } else if (hours === 0) {
      dayPeriodEnumValue = dayPeriodEnum.midnight;
    } else {
      dayPeriodEnumValue = hours / 12 >= 1 ? "pm" : "am";
    }
    switch (token) {
      case "b":
      case "bb":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "bbb":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        }).toLowerCase();
      case "bbbbb":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "bbbb":
      default:
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // in the morning, in the afternoon, in the evening, at night
  B: function(date, token, localize2) {
    const hours = date.getHours();
    let dayPeriodEnumValue;
    if (hours >= 17) {
      dayPeriodEnumValue = dayPeriodEnum.evening;
    } else if (hours >= 12) {
      dayPeriodEnumValue = dayPeriodEnum.afternoon;
    } else if (hours >= 4) {
      dayPeriodEnumValue = dayPeriodEnum.morning;
    } else {
      dayPeriodEnumValue = dayPeriodEnum.night;
    }
    switch (token) {
      case "B":
      case "BB":
      case "BBB":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "abbreviated",
          context: "formatting"
        });
      case "BBBBB":
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "narrow",
          context: "formatting"
        });
      case "BBBB":
      default:
        return localize2.dayPeriod(dayPeriodEnumValue, {
          width: "wide",
          context: "formatting"
        });
    }
  },
  // Hour [1-12]
  h: function(date, token, localize2) {
    if (token === "ho") {
      let hours = date.getHours() % 12;
      if (hours === 0) hours = 12;
      return localize2.ordinalNumber(hours, { unit: "hour" });
    }
    return lightFormatters.h(date, token);
  },
  // Hour [0-23]
  H: function(date, token, localize2) {
    if (token === "Ho") {
      return localize2.ordinalNumber(date.getHours(), { unit: "hour" });
    }
    return lightFormatters.H(date, token);
  },
  // Hour [0-11]
  K: function(date, token, localize2) {
    const hours = date.getHours() % 12;
    if (token === "Ko") {
      return localize2.ordinalNumber(hours, { unit: "hour" });
    }
    return addLeadingZeros(hours, token.length);
  },
  // Hour [1-24]
  k: function(date, token, localize2) {
    let hours = date.getHours();
    if (hours === 0) hours = 24;
    if (token === "ko") {
      return localize2.ordinalNumber(hours, { unit: "hour" });
    }
    return addLeadingZeros(hours, token.length);
  },
  // Minute
  m: function(date, token, localize2) {
    if (token === "mo") {
      return localize2.ordinalNumber(date.getMinutes(), { unit: "minute" });
    }
    return lightFormatters.m(date, token);
  },
  // Second
  s: function(date, token, localize2) {
    if (token === "so") {
      return localize2.ordinalNumber(date.getSeconds(), { unit: "second" });
    }
    return lightFormatters.s(date, token);
  },
  // Fraction of second
  S: function(date, token) {
    return lightFormatters.S(date, token);
  },
  // Timezone (ISO-8601. If offset is 0, output is always `'Z'`)
  X: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    if (timezoneOffset === 0) {
      return "Z";
    }
    switch (token) {
      // Hours and optional minutes
      case "X":
        return formatTimezoneWithOptionalMinutes(timezoneOffset);
      // Hours, minutes and optional seconds without `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `XX`
      case "XXXX":
      case "XX":
        return formatTimezone(timezoneOffset);
      // Hours, minutes and optional seconds with `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `XXX`
      case "XXXXX":
      case "XXX":
      // Hours and minutes with `:` delimiter
      default:
        return formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (ISO-8601. If offset is 0, output is `'+00:00'` or equivalent)
  x: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    switch (token) {
      // Hours and optional minutes
      case "x":
        return formatTimezoneWithOptionalMinutes(timezoneOffset);
      // Hours, minutes and optional seconds without `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `xx`
      case "xxxx":
      case "xx":
        return formatTimezone(timezoneOffset);
      // Hours, minutes and optional seconds with `:` delimiter
      // Note: neither ISO-8601 nor JavaScript supports seconds in timezone offsets
      // so this token always has the same output as `xxx`
      case "xxxxx":
      case "xxx":
      // Hours and minutes with `:` delimiter
      default:
        return formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (GMT)
  O: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    switch (token) {
      // Short
      case "O":
      case "OO":
      case "OOO":
        return "GMT" + formatTimezoneShort(timezoneOffset, ":");
      // Long
      case "OOOO":
      default:
        return "GMT" + formatTimezone(timezoneOffset, ":");
    }
  },
  // Timezone (specific non-location)
  z: function(date, token, _localize) {
    const timezoneOffset = date.getTimezoneOffset();
    switch (token) {
      // Short
      case "z":
      case "zz":
      case "zzz":
        return "GMT" + formatTimezoneShort(timezoneOffset, ":");
      // Long
      case "zzzz":
      default:
        return "GMT" + formatTimezone(timezoneOffset, ":");
    }
  },
  // Seconds timestamp
  t: function(date, token, _localize) {
    const timestamp = Math.trunc(+date / 1e3);
    return addLeadingZeros(timestamp, token.length);
  },
  // Milliseconds timestamp
  T: function(date, token, _localize) {
    return addLeadingZeros(+date, token.length);
  }
};
function formatTimezoneShort(offset, delimiter = "") {
  const sign = offset > 0 ? "-" : "+";
  const absOffset = Math.abs(offset);
  const hours = Math.trunc(absOffset / 60);
  const minutes = absOffset % 60;
  if (minutes === 0) {
    return sign + String(hours);
  }
  return sign + String(hours) + delimiter + addLeadingZeros(minutes, 2);
}
function formatTimezoneWithOptionalMinutes(offset, delimiter) {
  if (offset % 60 === 0) {
    const sign = offset > 0 ? "-" : "+";
    return sign + addLeadingZeros(Math.abs(offset) / 60, 2);
  }
  return formatTimezone(offset, delimiter);
}
function formatTimezone(offset, delimiter = "") {
  const sign = offset > 0 ? "-" : "+";
  const absOffset = Math.abs(offset);
  const hours = addLeadingZeros(Math.trunc(absOffset / 60), 2);
  const minutes = addLeadingZeros(absOffset % 60, 2);
  return sign + hours + delimiter + minutes;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/format/longFormatters.js
var dateLongFormatter = (pattern, formatLong2) => {
  switch (pattern) {
    case "P":
      return formatLong2.date({ width: "short" });
    case "PP":
      return formatLong2.date({ width: "medium" });
    case "PPP":
      return formatLong2.date({ width: "long" });
    case "PPPP":
    default:
      return formatLong2.date({ width: "full" });
  }
};
var timeLongFormatter = (pattern, formatLong2) => {
  switch (pattern) {
    case "p":
      return formatLong2.time({ width: "short" });
    case "pp":
      return formatLong2.time({ width: "medium" });
    case "ppp":
      return formatLong2.time({ width: "long" });
    case "pppp":
    default:
      return formatLong2.time({ width: "full" });
  }
};
var dateTimeLongFormatter = (pattern, formatLong2) => {
  const matchResult = pattern.match(/(P+)(p+)?/) || [];
  const datePattern = matchResult[1];
  const timePattern = matchResult[2];
  if (!timePattern) {
    return dateLongFormatter(pattern, formatLong2);
  }
  let dateTimeFormat;
  switch (datePattern) {
    case "P":
      dateTimeFormat = formatLong2.dateTime({ width: "short" });
      break;
    case "PP":
      dateTimeFormat = formatLong2.dateTime({ width: "medium" });
      break;
    case "PPP":
      dateTimeFormat = formatLong2.dateTime({ width: "long" });
      break;
    case "PPPP":
    default:
      dateTimeFormat = formatLong2.dateTime({ width: "full" });
      break;
  }
  return dateTimeFormat.replace("{{date}}", dateLongFormatter(datePattern, formatLong2)).replace("{{time}}", timeLongFormatter(timePattern, formatLong2));
};
var longFormatters = {
  p: timeLongFormatter,
  P: dateTimeLongFormatter
};

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/_lib/protectedTokens.js
var dayOfYearTokenRE = /^D+$/;
var weekYearTokenRE = /^Y+$/;
var throwTokens = ["D", "DD", "YY", "YYYY"];
function isProtectedDayOfYearToken(token) {
  return dayOfYearTokenRE.test(token);
}
function isProtectedWeekYearToken(token) {
  return weekYearTokenRE.test(token);
}
function warnOrThrowProtectedError(token, format6, input) {
  const _message = message(token, format6, input);
  console.warn(_message);
  if (throwTokens.includes(token)) throw new RangeError(_message);
}
function message(token, format6, input) {
  const subject = token[0] === "Y" ? "years" : "days of the month";
  return `Use \`${token.toLowerCase()}\` instead of \`${token}\` (in \`${format6}\`) for formatting ${subject} to the input \`${input}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`;
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/format.js
var formattingTokensRegExp = /[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g;
var longFormattingTokensRegExp = /P+p+|P+|p+|''|'(''|[^'])+('|$)|./g;
var escapedStringRegExp = /^'([^]*?)'?$/;
var doubleQuoteRegExp = /''/g;
var unescapedLatinCharacterRegExp = /[a-zA-Z]/;
function format(date, formatStr, options) {
  const defaultOptions2 = getDefaultOptions();
  const locale = options?.locale ?? defaultOptions2.locale ?? enUS;
  const firstWeekContainsDate = options?.firstWeekContainsDate ?? options?.locale?.options?.firstWeekContainsDate ?? defaultOptions2.firstWeekContainsDate ?? defaultOptions2.locale?.options?.firstWeekContainsDate ?? 1;
  const weekStartsOn = options?.weekStartsOn ?? options?.locale?.options?.weekStartsOn ?? defaultOptions2.weekStartsOn ?? defaultOptions2.locale?.options?.weekStartsOn ?? 0;
  const originalDate = toDate(date, options?.in);
  if (!isValid(originalDate)) {
    throw new RangeError("Invalid time value");
  }
  let parts = formatStr.match(longFormattingTokensRegExp).map((substring) => {
    const firstCharacter = substring[0];
    if (firstCharacter === "p" || firstCharacter === "P") {
      const longFormatter = longFormatters[firstCharacter];
      return longFormatter(substring, locale.formatLong);
    }
    return substring;
  }).join("").match(formattingTokensRegExp).map((substring) => {
    if (substring === "''") {
      return { isToken: false, value: "'" };
    }
    const firstCharacter = substring[0];
    if (firstCharacter === "'") {
      return { isToken: false, value: cleanEscapedString(substring) };
    }
    if (formatters[firstCharacter]) {
      return { isToken: true, value: substring };
    }
    if (firstCharacter.match(unescapedLatinCharacterRegExp)) {
      throw new RangeError(
        "Format string contains an unescaped latin alphabet character `" + firstCharacter + "`"
      );
    }
    return { isToken: false, value: substring };
  });
  if (locale.localize.preprocessor) {
    parts = locale.localize.preprocessor(originalDate, parts);
  }
  const formatterOptions = {
    firstWeekContainsDate,
    weekStartsOn,
    locale
  };
  return parts.map((part) => {
    if (!part.isToken) return part.value;
    const token = part.value;
    if (!options?.useAdditionalWeekYearTokens && isProtectedWeekYearToken(token) || !options?.useAdditionalDayOfYearTokens && isProtectedDayOfYearToken(token)) {
      warnOrThrowProtectedError(token, formatStr, String(date));
    }
    const formatter = formatters[token[0]];
    return formatter(originalDate, token, locale.localize, formatterOptions);
  }).join("");
}
function cleanEscapedString(input) {
  const matched = input.match(escapedStringRegExp);
  if (!matched) {
    return input;
  }
  return matched[1].replace(doubleQuoteRegExp, "'");
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subDays.js
function subDays(date, amount, options) {
  return addDays(date, -amount, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subMonths.js
function subMonths(date, amount, options) {
  return addMonths(date, -amount, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subWeeks.js
function subWeeks(date, amount, options) {
  return addWeeks(date, -amount, options);
}

// ../../../node_modules/.pnpm/date-fns@4.1.0/node_modules/date-fns/subYears.js
function subYears(date, amount, options) {
  return addYears(date, -amount, options);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/utils/operators.mjs
var import_i18n24 = __toESM(require_i18n(), 1);
var import_element35 = __toESM(require_element(), 1);
var import_date = __toESM(require_date(), 1);
var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1);
var filterTextWrappers = {
  Name: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "dataviews-filters__summary-filter-text-name" }),
  Value: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("span", { className: "dataviews-filters__summary-filter-text-value" })
};
function getRelativeDate(value, unit) {
  switch (unit) {
    case "days":
      return subDays(/* @__PURE__ */ new Date(), value);
    case "weeks":
      return subWeeks(/* @__PURE__ */ new Date(), value);
    case "months":
      return subMonths(/* @__PURE__ */ new Date(), value);
    case "years":
      return subYears(/* @__PURE__ */ new Date(), value);
    default:
      return /* @__PURE__ */ new Date();
  }
}
var isNoneOperatorDefinition = {
  /* translators: DataViews operator name */
  label: (0, import_i18n24.__)("Is none of"),
  filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
    (0, import_i18n24.sprintf)(
      /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is none of: Admin, Editor". */
      (0, import_i18n24.__)("<Name>%1$s is none of: </Name><Value>%2$s</Value>"),
      filter.name,
      activeElements.map((element) => element.label).join(", ")
    ),
    filterTextWrappers
  ),
  filter: ((item, field, filterValue) => {
    if (!filterValue?.length) {
      return true;
    }
    const fieldValue = field.getValue({ item });
    if (Array.isArray(fieldValue)) {
      return !filterValue.some(
        (fv) => fieldValue.includes(fv)
      );
    } else if (typeof fieldValue === "string") {
      return !filterValue.includes(fieldValue);
    }
    return false;
  }),
  selection: "multi"
};
var OPERATORS = [
  {
    name: OPERATOR_IS_ANY,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Includes"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is any: Admin, Editor". */
        (0, import_i18n24.__)("<Name>%1$s includes: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements.map((element) => element.label).join(", ")
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (!filterValue?.length) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      if (Array.isArray(fieldValue)) {
        return filterValue.some(
          (fv) => fieldValue.includes(fv)
        );
      } else if (typeof fieldValue === "string") {
        return filterValue.includes(fieldValue);
      }
      return false;
    },
    selection: "multi"
  },
  {
    name: OPERATOR_IS_NONE,
    ...isNoneOperatorDefinition
  },
  {
    name: OPERATOR_IS_ALL,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Includes all"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author includes all: Admin, Editor". */
        (0, import_i18n24.__)("<Name>%1$s includes all: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements.map((element) => element.label).join(", ")
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (!filterValue?.length) {
        return true;
      }
      return filterValue.every((value) => {
        return field.getValue({ item })?.includes(value);
      });
    },
    selection: "multi"
  },
  {
    name: OPERATOR_IS_NOT_ALL,
    ...isNoneOperatorDefinition
  },
  {
    name: OPERATOR_BETWEEN,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Between (inc)"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Item count"). 2: Filter value min. 3: Filter value max. e.g.: "Item count between (inc): 10 and 180". */
        (0, import_i18n24.__)(
          "<Name>%1$s between (inc): </Name><Value>%2$s and %3$s</Value>"
        ),
        filter.name,
        activeElements[0].label[0],
        activeElements[0].label[1]
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (!Array.isArray(filterValue) || filterValue.length !== 2 || filterValue[0] === void 0 || filterValue[1] === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      if (typeof fieldValue === "number" || fieldValue instanceof Date || typeof fieldValue === "string") {
        return fieldValue >= filterValue[0] && fieldValue <= filterValue[1];
      }
      return false;
    },
    selection: "custom"
  },
  {
    name: OPERATOR_IN_THE_PAST,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("In the past"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is in the past: 7 days". */
        (0, import_i18n24.__)(
          "<Name>%1$s is in the past: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        `${activeElements[0].value.value} ${activeElements[0].value.unit}`
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue?.value === void 0 || filterValue?.unit === void 0) {
        return true;
      }
      const targetDate = getRelativeDate(
        filterValue.value,
        filterValue.unit
      );
      const fieldValue = (0, import_date.getDate)(field.getValue({ item }));
      return fieldValue >= targetDate && fieldValue <= /* @__PURE__ */ new Date();
    },
    selection: "custom"
  },
  {
    name: OPERATOR_OVER,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Over"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "7 days"): "Date is over: 7 days". */
        (0, import_i18n24.__)("<Name>%1$s is over: </Name><Value>%2$s</Value>"),
        filter.name,
        `${activeElements[0].value.value} ${activeElements[0].value.unit}`
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue?.value === void 0 || filterValue?.unit === void 0) {
        return true;
      }
      const targetDate = getRelativeDate(
        filterValue.value,
        filterValue.unit
      );
      const fieldValue = (0, import_date.getDate)(field.getValue({ item }));
      return fieldValue < targetDate;
    },
    selection: "custom"
  },
  {
    name: OPERATOR_IS,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Is"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is: Admin". */
        (0, import_i18n24.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      return filterValue === field.getValue({ item }) || filterValue === void 0;
    },
    selection: "single"
  },
  {
    name: OPERATOR_IS_NOT,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Is not"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Author"). 2: Filter value (e.g. "Admin"): "Author is not: Admin". */
        (0, import_i18n24.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      return filterValue !== field.getValue({ item });
    },
    selection: "single"
  },
  {
    name: OPERATOR_LESS_THAN,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Less than"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than: 10". */
        (0, import_i18n24.__)("<Name>%1$s is less than: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue < filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_GREATER_THAN,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Greater than"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than: 10". */
        (0, import_i18n24.__)(
          "<Name>%1$s is greater than: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue > filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_LESS_THAN_OR_EQUAL,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Less than or equal"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is less than or equal to: 10". */
        (0, import_i18n24.__)(
          "<Name>%1$s is less than or equal to: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue <= filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_GREATER_THAN_OR_EQUAL,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Greater than or equal"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Count"). 2: Filter value (e.g. "10"): "Count is greater than or equal to: 10". */
        (0, import_i18n24.__)(
          "<Name>%1$s is greater than or equal to: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return fieldValue >= filterValue;
    },
    selection: "single"
  },
  {
    name: OPERATOR_BEFORE,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Before"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is before: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is before: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date.getDate)(filterValue);
      const fieldDate = (0, import_date.getDate)(field.getValue({ item }));
      return fieldDate < filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_AFTER,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("After"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is after: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is after: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date.getDate)(filterValue);
      const fieldDate = (0, import_date.getDate)(field.getValue({ item }));
      return fieldDate > filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_BEFORE_INC,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Before (inc)"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or before: 2024-01-01". */
        (0, import_i18n24.__)(
          "<Name>%1$s is on or before: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date.getDate)(filterValue);
      const fieldDate = (0, import_date.getDate)(field.getValue({ item }));
      return fieldDate <= filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_AFTER_INC,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("After (inc)"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is on or after: 2024-01-01". */
        (0, import_i18n24.__)(
          "<Name>%1$s is on or after: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date.getDate)(filterValue);
      const fieldDate = (0, import_date.getDate)(field.getValue({ item }));
      return fieldDate >= filterDate;
    },
    selection: "single"
  },
  {
    name: OPERATOR_CONTAINS,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Contains"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title contains: Hello". */
        (0, import_i18n24.__)("<Name>%1$s contains: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().includes(String(filterValue).toLowerCase());
    },
    selection: "single"
  },
  {
    name: OPERATOR_NOT_CONTAINS,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Doesn't contain"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title doesn't contain: Hello". */
        (0, import_i18n24.__)(
          "<Name>%1$s doesn't contain: </Name><Value>%2$s</Value>"
        ),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return typeof fieldValue === "string" && filterValue && !fieldValue.toLowerCase().includes(String(filterValue).toLowerCase());
    },
    selection: "single"
  },
  {
    name: OPERATOR_STARTS_WITH,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Starts with"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Title"). 2: Filter value (e.g. "Hello"): "Title starts with: Hello". */
        (0, import_i18n24.__)("<Name>%1$s starts with: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const fieldValue = field.getValue({ item });
      return typeof fieldValue === "string" && filterValue && fieldValue.toLowerCase().startsWith(String(filterValue).toLowerCase());
    },
    selection: "single"
  },
  {
    name: OPERATOR_ON,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("On"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date.getDate)(filterValue);
      const fieldDate = (0, import_date.getDate)(field.getValue({ item }));
      return filterDate.getTime() === fieldDate.getTime();
    },
    selection: "single"
  },
  {
    name: OPERATOR_NOT_ON,
    /* translators: DataViews operator name */
    label: (0, import_i18n24.__)("Not on"),
    filterText: (filter, activeElements) => (0, import_element35.createInterpolateElement)(
      (0, import_i18n24.sprintf)(
        /* translators: 1: Filter name (e.g. "Date"). 2: Filter value (e.g. "2024-01-01"): "Date is not: 2024-01-01". */
        (0, import_i18n24.__)("<Name>%1$s is not: </Name><Value>%2$s</Value>"),
        filter.name,
        activeElements[0].label
      ),
      filterTextWrappers
    ),
    filter(item, field, filterValue) {
      if (filterValue === void 0) {
        return true;
      }
      const filterDate = (0, import_date.getDate)(filterValue);
      const fieldDate = (0, import_date.getDate)(field.getValue({ item }));
      return filterDate.getTime() !== fieldDate.getTime();
    },
    selection: "single"
  }
];
var getOperatorByName = (name) => OPERATORS.find((op) => op.name === name);
var getAllOperatorNames = () => OPERATORS.map((op) => op.name);
var isSingleSelectionOperator = (name) => OPERATORS.filter((op) => op.selection === "single").some(
  (op) => op.name === name
);
var isRegisteredOperator = (name) => OPERATORS.some((op) => op.name === name);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filter.mjs
var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1);
var ENTER = "Enter";
var SPACE = " ";
var FilterText = ({
  activeElements,
  filterInView,
  filter
}) => {
  if (activeElements === void 0 || activeElements.length === 0) {
    return filter.name;
  }
  const operator = getOperatorByName(filterInView?.operator);
  if (operator !== void 0) {
    return operator.filterText(filter, activeElements);
  }
  return (0, import_i18n25.sprintf)(
    /* translators: 1: Filter name e.g.: "Unknown status for Author". */
    (0, import_i18n25.__)("Unknown status for %1$s"),
    filter.name
  );
};
function OperatorSelector({
  filter,
  view,
  onChangeView
}) {
  const operatorOptions = filter.operators?.map((operator) => ({
    value: operator,
    label: getOperatorByName(operator)?.label || operator
  }));
  const currentFilter = view.filters?.find(
    (_filter) => _filter.field === filter.field
  );
  const value = currentFilter?.operator || filter.operators[0];
  return operatorOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(
    Stack,
    {
      direction: "row",
      gap: "sm",
      justify: "flex-start",
      className: "dataviews-filters__summary-operators-container",
      align: "center",
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components23.FlexItem, { className: "dataviews-filters__summary-operators-filter-name", children: filter.name }),
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          import_components23.SelectControl,
          {
            className: "dataviews-filters__summary-operators-filter-select",
            label: (0, import_i18n25.__)("Conditions"),
            value,
            options: operatorOptions,
            onChange: (newValue) => {
              const newOperator = newValue;
              const currentOperator = currentFilter?.operator;
              const newFilters = currentFilter ? [
                ...(view.filters ?? []).map(
                  (_filter) => {
                    if (_filter.field === filter.field) {
                      const currentOpSelectionModel = getOperatorByName(
                        currentOperator
                      )?.selection;
                      const newOpSelectionModel = getOperatorByName(
                        newOperator
                      )?.selection;
                      const shouldResetValue = currentOpSelectionModel !== newOpSelectionModel || [
                        currentOpSelectionModel,
                        newOpSelectionModel
                      ].includes("custom");
                      return {
                        ..._filter,
                        value: shouldResetValue ? void 0 : _filter.value,
                        operator: newOperator
                      };
                    }
                    return _filter;
                  }
                )
              ] : [
                ...view.filters ?? [],
                {
                  field: filter.field,
                  operator: newOperator,
                  value: void 0
                }
              ];
              onChangeView({
                ...view,
                page: 1,
                filters: newFilters
              });
            },
            size: "small",
            variant: "minimal",
            hideLabelFromVision: true
          }
        )
      ]
    }
  );
}
function Filter({
  addFilterRef,
  openedFilter,
  fields,
  ...commonProps
}) {
  const toggleRef = (0, import_element36.useRef)(null);
  const { filter, view, onChangeView } = commonProps;
  const filterInView = view.filters?.find(
    (f2) => f2.field === filter.field
  );
  let activeElements = [];
  const field = (0, import_element36.useMemo)(() => {
    const currentField = fields.find((f2) => f2.id === filter.field);
    if (currentField) {
      return {
        ...currentField,
        // Configure getValue as if Item was a plain object.
        // See related input-widget.tsx
        getValue: ({ item }) => item[currentField.id]
      };
    }
    return currentField;
  }, [fields, filter.field]);
  const { elements } = useElements({
    elements: filter.elements,
    getElements: filter.getElements
  });
  if (elements.length > 0) {
    activeElements = elements.filter((element) => {
      if (filter.singleSelection) {
        return element.value === filterInView?.value;
      }
      return filterInView?.value?.includes(element.value);
    });
  } else if (Array.isArray(filterInView?.value)) {
    const label = filterInView.value.map((v2) => {
      const formattedValue = field?.getValueFormatted({
        item: { [field.id]: v2 },
        field
      });
      return formattedValue || String(v2);
    });
    activeElements = [
      {
        value: filterInView.value,
        // @ts-ignore
        label
      }
    ];
  } else if (typeof filterInView?.value === "object") {
    activeElements = [
      { value: filterInView.value, label: filterInView.value }
    ];
  } else if (filterInView?.value !== void 0) {
    const label = field !== void 0 ? field.getValueFormatted({
      item: { [field.id]: filterInView.value },
      field
    }) : String(filterInView.value);
    activeElements = [
      {
        value: filterInView.value,
        label
      }
    ];
  }
  const isPrimary = filter.isPrimary;
  const isLocked = filterInView?.isLocked;
  const hasValues = !isLocked && filterInView?.value !== void 0;
  const canResetOrRemove = !isLocked && (!isPrimary || hasValues);
  return /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
    import_components23.Dropdown,
    {
      defaultOpen: openedFilter === filter.field,
      contentClassName: "dataviews-filters__summary-popover",
      popoverProps: { placement: "bottom-start", role: "dialog" },
      onClose: () => {
        toggleRef.current?.focus();
      },
      renderToggle: ({ isOpen, onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)("div", { className: "dataviews-filters__summary-chip-container", children: [
        /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          import_components23.Tooltip,
          {
            text: (0, import_i18n25.sprintf)(
              /* translators: 1: Filter name. */
              (0, import_i18n25.__)("Filter by: %1$s"),
              filter.name.toLowerCase()
            ),
            placement: "top",
            children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              "div",
              {
                className: clsx_default(
                  "dataviews-filters__summary-chip",
                  {
                    "has-reset": canResetOrRemove,
                    "has-values": hasValues,
                    "is-not-clickable": isLocked
                  }
                ),
                role: "button",
                tabIndex: isLocked ? -1 : 0,
                onClick: () => {
                  if (!isLocked) {
                    onToggle();
                  }
                },
                onKeyDown: (event) => {
                  if (!isLocked && [ENTER, SPACE].includes(event.key)) {
                    onToggle();
                    event.preventDefault();
                  }
                },
                "aria-disabled": isLocked,
                "aria-pressed": isOpen,
                "aria-expanded": isOpen,
                ref: toggleRef,
                children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
                  FilterText,
                  {
                    activeElements,
                    filterInView,
                    filter
                  }
                )
              }
            )
          }
        ),
        canResetOrRemove && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
          import_components23.Tooltip,
          {
            text: isPrimary ? (0, import_i18n25.__)("Reset") : (0, import_i18n25.__)("Remove"),
            placement: "top",
            children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
              "button",
              {
                className: clsx_default(
                  "dataviews-filters__summary-chip-remove",
                  { "has-values": hasValues }
                ),
                onClick: () => {
                  onChangeView({
                    ...view,
                    page: 1,
                    filters: view.filters?.filter(
                      (_filter) => _filter.field !== filter.field
                    )
                  });
                  if (!isPrimary) {
                    addFilterRef.current?.focus();
                  } else {
                    toggleRef.current?.focus();
                  }
                },
                children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components23.Icon, { icon: close_small_default })
              }
            )
          }
        )
      ] }),
      renderContent: () => {
        return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(Stack, { direction: "column", justify: "flex-start", children: [
          /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(OperatorSelector, { ...commonProps }),
          commonProps.filter.hasElements ? /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(
            SearchWidget,
            {
              ...commonProps,
              filter: {
                ...commonProps.filter,
                elements
              }
            }
          ) : /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(InputWidget, { ...commonProps, fields })
        ] });
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/add-filter.mjs
var import_components24 = __toESM(require_components(), 1);
var import_i18n26 = __toESM(require_i18n(), 1);
var import_element37 = __toESM(require_element(), 1);
var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu4 } = unlock(import_components24.privateApis);
function AddFilterMenu({
  filters: filters2,
  view,
  onChangeView,
  setOpenedFilter,
  triggerProps
}) {
  const inactiveFilters = filters2.filter((filter) => !filter.isVisible);
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(Menu4, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Menu4.TriggerButton, { ...triggerProps }),
    /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Menu4.Popover, { children: inactiveFilters.map((filter) => {
      return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
        Menu4.Item,
        {
          onClick: () => {
            setOpenedFilter(filter.field);
            onChangeView({
              ...view,
              page: 1,
              filters: [
                ...view.filters || [],
                {
                  field: filter.field,
                  value: void 0,
                  operator: filter.operators[0]
                }
              ]
            });
          },
          children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(Menu4.ItemLabel, { children: filter.name })
        },
        filter.field
      );
    }) })
  ] });
}
function AddFilter({ filters: filters2, view, onChangeView, setOpenedFilter }, ref) {
  if (!filters2.length || filters2.every(({ isPrimary }) => isPrimary)) {
    return null;
  }
  const inactiveFilters = filters2.filter((filter) => !filter.isVisible);
  return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
    AddFilterMenu,
    {
      triggerProps: {
        render: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(
          import_components24.Button,
          {
            accessibleWhenDisabled: true,
            size: "compact",
            className: "dataviews-filters-button",
            variant: "tertiary",
            disabled: !inactiveFilters.length,
            ref
          }
        ),
        children: (0, import_i18n26.__)("Add filter")
      },
      ...{ filters: filters2, view, onChangeView, setOpenedFilter }
    }
  );
}
var add_filter_default = (0, import_element37.forwardRef)(AddFilter);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/reset-filters.mjs
var import_components25 = __toESM(require_components(), 1);
var import_i18n27 = __toESM(require_i18n(), 1);
var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1);
function ResetFilter({
  filters: filters2,
  view,
  onChangeView
}) {
  const isPrimary = (field) => filters2.some(
    (_filter) => _filter.field === field && _filter.isPrimary
  );
  const isDisabled = !view.search && !view.filters?.some(
    (_filter) => !_filter.isLocked && (_filter.value !== void 0 || !isPrimary(_filter.field))
  );
  return /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(
    import_components25.Button,
    {
      disabled: isDisabled,
      accessibleWhenDisabled: true,
      size: "compact",
      variant: "tertiary",
      className: "dataviews-filters__reset-button",
      onClick: () => {
        onChangeView({
          ...view,
          page: 1,
          search: "",
          filters: view.filters?.filter((f2) => !!f2.isLocked) || []
        });
      },
      children: (0, import_i18n27.__)("Reset")
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/use-filters.mjs
var import_element38 = __toESM(require_element(), 1);
function useFilters(fields, view) {
  return (0, import_element38.useMemo)(() => {
    const filters2 = [];
    fields.forEach((field) => {
      if (field.filterBy === false || !field.hasElements && !field.Edit) {
        return;
      }
      const operators = field.filterBy.operators;
      const isPrimary = !!field.filterBy?.isPrimary;
      const isLocked = view.filters?.some(
        (f2) => f2.field === field.id && !!f2.isLocked
      ) ?? false;
      filters2.push({
        field: field.id,
        name: field.label,
        elements: field.elements,
        getElements: field.getElements,
        hasElements: field.hasElements,
        singleSelection: operators.some(
          (op) => isSingleSelectionOperator(op)
        ),
        operators,
        isVisible: isLocked || isPrimary || !!view.filters?.some(
          (f2) => f2.field === field.id && isRegisteredOperator(f2.operator)
        ),
        isPrimary,
        isLocked
      });
    });
    filters2.sort((a2, b2) => {
      if (a2.isLocked && !b2.isLocked) {
        return -1;
      }
      if (!a2.isLocked && b2.isLocked) {
        return 1;
      }
      if (a2.isPrimary && !b2.isPrimary) {
        return -1;
      }
      if (!a2.isPrimary && b2.isPrimary) {
        return 1;
      }
      return a2.name.localeCompare(b2.name);
    });
    return filters2;
  }, [fields, view]);
}
var use_filters_default = useFilters;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters.mjs
var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1);
function Filters({ className }) {
  const { fields, view, onChangeView, openedFilter, setOpenedFilter } = (0, import_element39.useContext)(dataviews_context_default);
  const addFilterRef = (0, import_element39.useRef)(null);
  const filters2 = use_filters_default(fields, view);
  const addFilter = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
    add_filter_default,
    {
      filters: filters2,
      view,
      onChangeView,
      ref: addFilterRef,
      setOpenedFilter
    },
    "add-filter"
  );
  const visibleFilters = filters2.filter((filter) => filter.isVisible);
  if (visibleFilters.length === 0) {
    return null;
  }
  const filterComponents = [
    ...visibleFilters.map((filter) => {
      return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
        Filter,
        {
          filter,
          view,
          fields,
          onChangeView,
          addFilterRef,
          openedFilter
        },
        filter.field
      );
    }),
    addFilter
  ];
  filterComponents.push(
    /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
      ResetFilter,
      {
        filters: filters2,
        view,
        onChangeView
      },
      "reset-filters"
    )
  );
  return /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(
    Stack,
    {
      direction: "row",
      justify: "flex-start",
      gap: "sm",
      style: { width: "fit-content" },
      wrap: "wrap",
      className,
      children: filterComponents
    }
  );
}
var filters_default = (0, import_element39.memo)(Filters);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/toggle.mjs
var import_element40 = __toESM(require_element(), 1);
var import_components26 = __toESM(require_components(), 1);
var import_i18n28 = __toESM(require_i18n(), 1);
var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1);
function FiltersToggle() {
  const {
    filters: filters2,
    view,
    onChangeView,
    setOpenedFilter,
    isShowingFilter,
    setIsShowingFilter
  } = (0, import_element40.useContext)(dataviews_context_default);
  const buttonRef = (0, import_element40.useRef)(null);
  const onChangeViewWithFilterVisibility = (0, import_element40.useCallback)(
    (_view) => {
      onChangeView(_view);
      setIsShowingFilter(true);
    },
    [onChangeView, setIsShowingFilter]
  );
  if (filters2.length === 0) {
    return null;
  }
  const hasVisibleFilters = filters2.some((filter) => filter.isVisible);
  const addFilterButtonProps = {
    label: (0, import_i18n28.__)("Add filter"),
    "aria-expanded": false,
    isPressed: false
  };
  const toggleFiltersButtonProps = {
    label: (0, import_i18n28._x)("Filter", "verb"),
    "aria-expanded": isShowingFilter,
    isPressed: isShowingFilter,
    onClick: () => {
      if (!isShowingFilter) {
        setOpenedFilter(null);
      }
      setIsShowingFilter(!isShowingFilter);
    }
  };
  const hasPrimaryOrLockedFilters = filters2.some(
    (filter) => filter.isPrimary || filter.isLocked
  );
  const buttonComponent = /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
    import_components26.Button,
    {
      ref: buttonRef,
      className: "dataviews-filters__visibility-toggle",
      size: "compact",
      icon: funnel_default,
      disabled: hasPrimaryOrLockedFilters,
      accessibleWhenDisabled: true,
      ...hasVisibleFilters ? toggleFiltersButtonProps : addFilterButtonProps
    }
  );
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "dataviews-filters__container-visibility-toggle", children: !hasVisibleFilters ? /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
    AddFilterMenu,
    {
      filters: filters2,
      view,
      onChangeView: onChangeViewWithFilterVisibility,
      setOpenedFilter,
      triggerProps: { render: buttonComponent }
    }
  ) : /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(
    FilterVisibilityToggle,
    {
      buttonRef,
      filtersCount: view.filters?.length,
      children: buttonComponent
    }
  ) });
}
function FilterVisibilityToggle({
  buttonRef,
  filtersCount,
  children
}) {
  (0, import_element40.useEffect)(
    () => () => {
      buttonRef.current?.focus();
    },
    [buttonRef]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_jsx_runtime84.Fragment, { children: [
    children,
    !!filtersCount && /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("span", { className: "dataviews-filters-toggle__count", children: filtersCount })
  ] });
}
var toggle_default = FiltersToggle;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-filters/filters-toggled.mjs
var import_element41 = __toESM(require_element(), 1);
var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1);
function FiltersToggled(props) {
  const { isShowingFilter } = (0, import_element41.useContext)(dataviews_context_default);
  if (!isShowingFilter) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(filters_default, { ...props });
}
var filters_toggled_default = FiltersToggled;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-layout/index.mjs
var import_element42 = __toESM(require_element(), 1);
var import_components27 = __toESM(require_components(), 1);
var import_i18n29 = __toESM(require_i18n(), 1);
var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1);
function DataViewsLayout({ className }) {
  const {
    actions: actions2 = [],
    data,
    fields,
    getItemId,
    getItemLevel,
    hasInitiallyLoaded,
    isLoading,
    view,
    onChangeView,
    selection,
    onChangeSelection,
    setOpenedFilter,
    onClickItem,
    isItemClickable,
    renderItemLink,
    defaultLayouts: defaultLayouts2,
    containerRef,
    empty = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: (0, import_i18n29.__)("No results") })
  } = (0, import_element42.useContext)(dataviews_context_default);
  const isDelayedInitialLoading = useDelayedLoading(!hasInitiallyLoaded, {
    delay: 200
  });
  if (!hasInitiallyLoaded) {
    if (!isDelayedInitialLoading) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "dataviews-loading", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_components27.Spinner, {}) }) });
  }
  const ViewComponent = VIEW_LAYOUTS.find(
    (v2) => v2.type === view.type && defaultLayouts2[v2.type]
  )?.component;
  return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)("div", { className: "dataviews-layout__container", ref: containerRef, children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(
    ViewComponent,
    {
      className,
      actions: actions2,
      data,
      fields,
      getItemId,
      getItemLevel,
      isLoading,
      onChangeView,
      onChangeSelection,
      selection,
      setOpenedFilter,
      onClickItem,
      renderItemLink,
      isItemClickable,
      view,
      empty
    }
  ) });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-footer/index.mjs
var import_element43 = __toESM(require_element(), 1);
var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1);
var EMPTY_ARRAY6 = [];
function DataViewsFooter() {
  const {
    view,
    paginationInfo: { totalItems = 0, totalPages },
    data,
    actions: actions2 = EMPTY_ARRAY6,
    isLoading,
    hasInitiallyLoaded
  } = (0, import_element43.useContext)(dataviews_context_default);
  const isRefreshing = !!isLoading && hasInitiallyLoaded && !!data?.length;
  const isDelayedRefreshing = useDelayedLoading(!!isRefreshing);
  const hasBulkActions = useSomeItemHasAPossibleBulkAction(actions2, data) && [LAYOUT_TABLE, LAYOUT_GRID].includes(view.type);
  if (!isRefreshing && (!totalItems || !totalPages || totalPages <= 1 && !hasBulkActions)) {
    return null;
  }
  return (!!totalItems || isRefreshing) && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(
    "div",
    {
      className: "dataviews-footer",
      inert: isRefreshing ? "true" : void 0,
      children: /* @__PURE__ */ (0, import_jsx_runtime87.jsxs)(
        Stack,
        {
          direction: "row",
          justify: "end",
          align: "center",
          className: clsx_default("dataviews-footer__content", {
            "is-refreshing": isDelayedRefreshing
          }),
          gap: "sm",
          children: [
            hasBulkActions && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(BulkActionsFooter, {}),
            /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(dataviews_pagination_default, {})
          ]
        }
      )
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-search/index.mjs
var import_i18n30 = __toESM(require_i18n(), 1);
var import_element44 = __toESM(require_element(), 1);
var import_components28 = __toESM(require_components(), 1);
var import_compose10 = __toESM(require_compose(), 1);
var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1);
var DataViewsSearch = (0, import_element44.memo)(function Search({ label }) {
  const { view, onChangeView } = (0, import_element44.useContext)(dataviews_context_default);
  const [search, setSearch, debouncedSearch] = (0, import_compose10.useDebouncedInput)(
    view.search
  );
  (0, import_element44.useEffect)(() => {
    if (view.search !== debouncedSearch) {
      setSearch(view.search ?? "");
    }
  }, [view.search, setSearch]);
  const onChangeViewRef = (0, import_element44.useRef)(onChangeView);
  const viewRef = (0, import_element44.useRef)(view);
  (0, import_element44.useEffect)(() => {
    onChangeViewRef.current = onChangeView;
    viewRef.current = view;
  }, [onChangeView, view]);
  (0, import_element44.useEffect)(() => {
    if (debouncedSearch !== viewRef.current?.search) {
      onChangeViewRef.current({
        ...viewRef.current,
        page: view.page ? 1 : void 0,
        startPosition: view.startPosition ? 1 : void 0,
        search: debouncedSearch
      });
    }
  }, [debouncedSearch]);
  const searchLabel = label || (0, import_i18n30.__)("Search");
  return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(
    import_components28.SearchControl,
    {
      className: "dataviews-search",
      onChange: setSearch,
      value: search,
      label: searchLabel,
      placeholder: searchLabel,
      size: "compact"
    }
  );
});
var dataviews_search_default = DataViewsSearch;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataviews-view-config/index.mjs
var import_components29 = __toESM(require_components(), 1);
var import_i18n31 = __toESM(require_i18n(), 1);
var import_element45 = __toESM(require_element(), 1);
var import_warning = __toESM(require_warning(), 1);
var import_compose11 = __toESM(require_compose(), 1);
var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1);
var { Menu: Menu5 } = unlock(import_components29.privateApis);
var DATAVIEWS_CONFIG_POPOVER_PROPS = {
  className: "dataviews-config__popover",
  placement: "bottom-end",
  offset: 9
};
function ViewTypeMenu() {
  const { view, onChangeView, defaultLayouts: defaultLayouts2 } = (0, import_element45.useContext)(dataviews_context_default);
  const availableLayouts = Object.keys(defaultLayouts2);
  if (availableLayouts.length <= 1) {
    return null;
  }
  const activeView = VIEW_LAYOUTS.find((v2) => view.type === v2.type);
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Menu5, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
      Menu5.TriggerButton,
      {
        render: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
          import_components29.Button,
          {
            size: "compact",
            icon: activeView?.icon,
            label: (0, import_i18n31.__)("Layout")
          }
        )
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Menu5.Popover, { children: availableLayouts.map((layout) => {
      const config = VIEW_LAYOUTS.find(
        (v2) => v2.type === layout
      );
      if (!config) {
        return null;
      }
      return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
        Menu5.RadioItem,
        {
          value: layout,
          name: "view-actions-available-view",
          checked: layout === view.type,
          hideOnClick: true,
          onChange: (e2) => {
            switch (e2.target.value) {
              case "list":
              case "grid":
              case "table":
              case "pickerGrid":
              case "pickerTable":
              case "activity":
                const viewWithoutLayout = { ...view };
                if ("layout" in viewWithoutLayout) {
                  delete viewWithoutLayout.layout;
                }
                return onChangeView({
                  ...viewWithoutLayout,
                  type: e2.target.value,
                  ...defaultLayouts2[e2.target.value]
                });
            }
            (0, import_warning.default)("Invalid dataview");
          },
          children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Menu5.ItemLabel, { children: config.label })
        },
        layout
      );
    }) })
  ] });
}
function SortFieldControl() {
  const { view, fields, onChangeView } = (0, import_element45.useContext)(dataviews_context_default);
  const orderOptions = (0, import_element45.useMemo)(() => {
    const sortableFields = fields.filter(
      (field) => field.enableSorting !== false
    );
    return sortableFields.map((field) => {
      return {
        label: field.label,
        value: field.id
      };
    });
  }, [fields]);
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
    import_components29.SelectControl,
    {
      __next40pxDefaultSize: true,
      label: (0, import_i18n31.__)("Sort by"),
      value: view.sort?.field,
      options: orderOptions,
      onChange: (value) => {
        onChangeView({
          ...view,
          sort: {
            direction: view?.sort?.direction || "desc",
            field: value
          },
          showLevels: false
        });
      }
    }
  );
}
function SortDirectionControl() {
  const { view, fields, onChangeView } = (0, import_element45.useContext)(dataviews_context_default);
  const sortableFields = fields.filter(
    (field) => field.enableSorting !== false
  );
  if (sortableFields.length === 0) {
    return null;
  }
  let value = view.sort?.direction;
  if (!value && view.sort?.field) {
    value = "desc";
  }
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
    import_components29.__experimentalToggleGroupControl,
    {
      className: "dataviews-view-config__sort-direction",
      __next40pxDefaultSize: true,
      isBlock: true,
      label: (0, import_i18n31.__)("Order"),
      value,
      onChange: (newDirection) => {
        if (newDirection === "asc" || newDirection === "desc") {
          onChangeView({
            ...view,
            sort: {
              direction: newDirection,
              field: view.sort?.field || // If there is no field assigned as the sorting field assign the first sortable field.
              fields.find(
                (field) => field.enableSorting !== false
              )?.id || ""
            },
            showLevels: false
          });
          return;
        }
        (0, import_warning.default)("Invalid direction");
      },
      children: SORTING_DIRECTIONS.map((direction) => {
        return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
          import_components29.__experimentalToggleGroupControlOptionIcon,
          {
            value: direction,
            icon: sortIcons[direction],
            label: sortLabels[direction]
          },
          direction
        );
      })
    }
  );
}
function ItemsPerPageControl() {
  const { view, config, onChangeView } = (0, import_element45.useContext)(dataviews_context_default);
  const { infiniteScrollEnabled } = view;
  if (!config || !config.perPageSizes || config.perPageSizes.length < 2 || config.perPageSizes.length > 6 || infiniteScrollEnabled) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
    import_components29.__experimentalToggleGroupControl,
    {
      __next40pxDefaultSize: true,
      isBlock: true,
      label: (0, import_i18n31.__)("Items per page"),
      value: view.perPage || 10,
      disabled: !view?.sort?.field,
      onChange: (newItemsPerPage) => {
        const newItemsPerPageNumber = typeof newItemsPerPage === "number" || newItemsPerPage === void 0 ? newItemsPerPage : parseInt(newItemsPerPage, 10);
        onChangeView({
          ...view,
          perPage: newItemsPerPageNumber,
          page: 1
        });
      },
      children: config.perPageSizes.map((value) => {
        return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
          import_components29.__experimentalToggleGroupControlOption,
          {
            value,
            label: value.toString()
          },
          value
        );
      })
    }
  );
}
function ResetViewButton() {
  const { onReset } = (0, import_element45.useContext)(dataviews_context_default);
  if (onReset === void 0) {
    return null;
  }
  const isDisabled = onReset === false;
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
    import_components29.Button,
    {
      variant: "tertiary",
      size: "compact",
      disabled: isDisabled,
      accessibleWhenDisabled: true,
      className: "dataviews-view-config__reset-button",
      onClick: () => {
        if (typeof onReset === "function") {
          onReset();
        }
      },
      children: (0, import_i18n31.__)("Reset view")
    }
  );
}
function DataviewsViewConfigDropdown() {
  const { view, onReset } = (0, import_element45.useContext)(dataviews_context_default);
  const popoverId = (0, import_compose11.useInstanceId)(
    _DataViewsViewConfig,
    "dataviews-view-config-dropdown"
  );
  const activeLayout = VIEW_LAYOUTS.find(
    (layout) => layout.type === view.type
  );
  const isModified = typeof onReset === "function";
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
    import_components29.Dropdown,
    {
      expandOnMobile: true,
      popoverProps: {
        ...DATAVIEWS_CONFIG_POPOVER_PROPS,
        id: popoverId
      },
      renderToggle: ({ onToggle, isOpen }) => {
        return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)("div", { className: "dataviews-view-config__toggle-wrapper", children: [
          /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
            import_components29.Button,
            {
              size: "compact",
              icon: cog_default,
              label: (0, import_i18n31._x)(
                "View options",
                "View is used as a noun"
              ),
              onClick: onToggle,
              "aria-expanded": isOpen ? "true" : "false",
              "aria-controls": popoverId
            }
          ),
          isModified && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("span", { className: "dataviews-view-config__modified-indicator" })
        ] });
      },
      renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
        import_components29.__experimentalDropdownContentWrapper,
        {
          paddingSize: "medium",
          className: "dataviews-config__popover-content-wrapper",
          children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
            Stack,
            {
              direction: "column",
              className: "dataviews-view-config",
              gap: "xl",
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
                  Stack,
                  {
                    direction: "row",
                    justify: "space-between",
                    align: "center",
                    className: "dataviews-view-config__header",
                    children: [
                      /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(
                        import_components29.__experimentalHeading,
                        {
                          level: 2,
                          className: "dataviews-settings-section__title",
                          children: (0, import_i18n31.__)("Appearance")
                        }
                      ),
                      /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ResetViewButton, {})
                    ]
                  }
                ),
                /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(Stack, { direction: "column", gap: "lg", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(
                    Stack,
                    {
                      direction: "row",
                      gap: "sm",
                      className: "dataviews-view-config__sort-controls",
                      children: [
                        /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SortFieldControl, {}),
                        /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(SortDirectionControl, {})
                      ]
                    }
                  ),
                  !!activeLayout?.viewConfigOptions && /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(activeLayout.viewConfigOptions, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ItemsPerPageControl, {}),
                  /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(PropertiesSection, {})
                ] })
              ]
            }
          )
        }
      )
    }
  );
}
function _DataViewsViewConfig() {
  return /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_jsx_runtime89.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ViewTypeMenu, {}),
    /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(DataviewsViewConfigDropdown, {})
  ] });
}
var DataViewsViewConfig = (0, import_element45.memo)(_DataViewsViewConfig);
var dataviews_view_config_default = DataViewsViewConfig;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/checkbox.mjs
var import_components30 = __toESM(require_components(), 1);
var import_element46 = __toESM(require_element(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/get-custom-validity.mjs
function getCustomValidity(isValid2, validity) {
  let customValidity;
  if (isValid2?.required && validity?.required) {
    customValidity = validity?.required?.message ? validity.required : void 0;
  } else if (isValid2?.pattern && validity?.pattern) {
    customValidity = validity.pattern;
  } else if (isValid2?.min && validity?.min) {
    customValidity = validity.min;
  } else if (isValid2?.max && validity?.max) {
    customValidity = validity.max;
  } else if (isValid2?.minLength && validity?.minLength) {
    customValidity = validity.minLength;
  } else if (isValid2?.maxLength && validity?.maxLength) {
    customValidity = validity.maxLength;
  } else if (isValid2?.elements && validity?.elements) {
    customValidity = validity.elements;
  } else if (validity?.custom) {
    customValidity = validity.custom;
  }
  return customValidity;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/checkbox.mjs
var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1);
var { ValidatedCheckboxControl } = unlock(import_components30.privateApis);
function Checkbox({
  field,
  onChange,
  data,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { getValue, setValue, label, description, isValid: isValid2 } = field;
  const onChangeControl = (0, import_element46.useCallback)(() => {
    onChange(
      setValue({ item: data, value: !getValue({ item: data }) })
    );
  }, [data, getValue, onChange, setValue]);
  return /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(
    ValidatedCheckboxControl,
    {
      required: !!field.isValid?.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      hidden: hideLabelFromVision,
      label,
      help: description,
      checked: getValue({ item: data }),
      onChange: onChangeControl
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/combobox.mjs
var import_components31 = __toESM(require_components(), 1);
var import_element47 = __toESM(require_element(), 1);
var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1);
var { ValidatedComboboxControl } = unlock(import_components31.privateApis);
function Combobox3({
  data,
  field,
  onChange,
  hideLabelFromVision,
  validity
}) {
  const { label, description, placeholder, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data }) ?? "";
  const onChangeControl = (0, import_element47.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue ?? "" })),
    [data, onChange, setValue]
  );
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_components31.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(
    ValidatedComboboxControl,
    {
      required: !!field.isValid?.required,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      value,
      help: description,
      placeholder,
      options: elements,
      onChange: onChangeControl,
      hideLabelFromVision,
      allowReset: true,
      expandOnFocus: true
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/datetime.mjs
var import_components33 = __toESM(require_components(), 1);
var import_element49 = __toESM(require_element(), 1);
var import_i18n33 = __toESM(require_i18n(), 1);
var import_date3 = __toESM(require_date(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/relative-date-control.mjs
var import_components32 = __toESM(require_components(), 1);
var import_element48 = __toESM(require_element(), 1);
var import_i18n32 = __toESM(require_i18n(), 1);
var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1);
var TIME_UNITS_OPTIONS = {
  [OPERATOR_IN_THE_PAST]: [
    { value: "days", label: (0, import_i18n32.__)("Days") },
    { value: "weeks", label: (0, import_i18n32.__)("Weeks") },
    { value: "months", label: (0, import_i18n32.__)("Months") },
    { value: "years", label: (0, import_i18n32.__)("Years") }
  ],
  [OPERATOR_OVER]: [
    { value: "days", label: (0, import_i18n32.__)("Days ago") },
    { value: "weeks", label: (0, import_i18n32.__)("Weeks ago") },
    { value: "months", label: (0, import_i18n32.__)("Months ago") },
    { value: "years", label: (0, import_i18n32.__)("Years ago") }
  ]
};
function RelativeDateControl({
  className,
  data,
  field,
  onChange,
  hideLabelFromVision,
  operator
}) {
  const options = TIME_UNITS_OPTIONS[operator === OPERATOR_IN_THE_PAST ? "inThePast" : "over"];
  const { id, label, description, getValue, setValue } = field;
  const fieldValue = getValue({ item: data });
  const { value: relValue = "", unit = options[0].value } = fieldValue && typeof fieldValue === "object" ? fieldValue : {};
  const onChangeValue = (0, import_element48.useCallback)(
    (newValue) => onChange(
      setValue({
        item: data,
        value: { value: Number(newValue), unit }
      })
    ),
    [onChange, setValue, data, unit]
  );
  const onChangeUnit = (0, import_element48.useCallback)(
    (newUnit) => onChange(
      setValue({
        item: data,
        value: { value: relValue, unit: newUnit }
      })
    ),
    [onChange, setValue, data, relValue]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
    import_components32.BaseControl,
    {
      id,
      className: clsx_default(className, "dataviews-controls__relative-date"),
      label,
      hideLabelFromVision,
      help: description,
      children: /* @__PURE__ */ (0, import_jsx_runtime92.jsxs)(Stack, { direction: "row", gap: "sm", children: [
        /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
          import_components32.__experimentalNumberControl,
          {
            __next40pxDefaultSize: true,
            className: "dataviews-controls__relative-date-number",
            spinControls: "none",
            min: 1,
            step: 1,
            value: relValue,
            onChange: onChangeValue
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(
          import_components32.SelectControl,
          {
            className: "dataviews-controls__relative-date-unit",
            __next40pxDefaultSize: true,
            label: (0, import_i18n32.__)("Unit"),
            value: unit,
            options,
            onChange: onChangeUnit,
            hideLabelFromVision: true
          }
        )
      ] })
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/parse-date-time.mjs
var import_date2 = __toESM(require_date(), 1);
function parseDateTime(dateTimeString) {
  if (!dateTimeString) {
    return null;
  }
  const parsed = (0, import_date2.getDate)(dateTimeString);
  return parsed && isValid(parsed) ? parsed : null;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/datetime.mjs
var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1);
var { DateCalendar, ValidatedInputControl } = unlock(import_components33.privateApis);
var formatDateTime = (value) => {
  if (!value) {
    return "";
  }
  return (0, import_date3.dateI18n)("Y-m-d\\TH:i", (0, import_date3.getDate)(value));
};
function CalendarDateTimeControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity,
  config
}) {
  const { compact } = config || {};
  const { id, label, description, setValue, getValue, isValid: isValid2 } = field;
  const fieldValue = getValue({ item: data });
  const value = typeof fieldValue === "string" ? fieldValue : void 0;
  const [calendarMonth, setCalendarMonth] = (0, import_element49.useState)(() => {
    const parsedDate = parseDateTime(value);
    return parsedDate || /* @__PURE__ */ new Date();
  });
  const inputControlRef = (0, import_element49.useRef)(null);
  const validationTimeoutRef = (0, import_element49.useRef)(void 0);
  const previousFocusRef = (0, import_element49.useRef)(null);
  const onChangeCallback = (0, import_element49.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  (0, import_element49.useEffect)(() => {
    return () => {
      if (validationTimeoutRef.current) {
        clearTimeout(validationTimeoutRef.current);
      }
    };
  }, []);
  const onSelectDate = (0, import_element49.useCallback)(
    (newDate) => {
      let dateTimeValue;
      if (newDate) {
        const wpDate = (0, import_date3.dateI18n)("Y-m-d", newDate);
        let wpTime;
        if (value) {
          wpTime = (0, import_date3.dateI18n)("H:i", (0, import_date3.getDate)(value));
        } else {
          wpTime = (0, import_date3.dateI18n)("H:i", newDate);
        }
        const finalDateTime = (0, import_date3.getDate)(`${wpDate}T${wpTime}`);
        dateTimeValue = finalDateTime.toISOString();
        onChangeCallback(dateTimeValue);
        if (validationTimeoutRef.current) {
          clearTimeout(validationTimeoutRef.current);
        }
      } else {
        onChangeCallback(void 0);
      }
      previousFocusRef.current = inputControlRef.current && inputControlRef.current.ownerDocument.activeElement;
      validationTimeoutRef.current = setTimeout(() => {
        if (inputControlRef.current) {
          inputControlRef.current.focus();
          inputControlRef.current.blur();
          onChangeCallback(dateTimeValue);
          if (previousFocusRef.current && previousFocusRef.current instanceof HTMLElement) {
            previousFocusRef.current.focus();
          }
        }
      }, 0);
    },
    [onChangeCallback, value]
  );
  const handleManualDateTimeChange = (0, import_element49.useCallback)(
    (newValue) => {
      if (newValue) {
        const dateTime = (0, import_date3.getDate)(newValue);
        onChangeCallback(dateTime.toISOString());
        const parsedDate = parseDateTime(dateTime.toISOString());
        if (parsedDate) {
          setCalendarMonth(parsedDate);
        }
      } else {
        onChangeCallback(void 0);
      }
    },
    [onChangeCallback]
  );
  const { format: fieldFormat } = field;
  const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date3.getSettings)().l10n.startOfWeek;
  const {
    timezone: { string: timezoneString }
  } = (0, import_date3.getSettings)();
  let displayLabel = label;
  if (isValid2?.required && !markWhenOptional && !hideLabelFromVision) {
    displayLabel = `${label} (${(0, import_i18n33.__)("Required")})`;
  } else if (!isValid2?.required && markWhenOptional && !hideLabelFromVision) {
    displayLabel = `${label} (${(0, import_i18n33.__)("Optional")})`;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
    import_components33.BaseControl,
    {
      id,
      label: displayLabel,
      help: description,
      hideLabelFromVision,
      children: /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(Stack, { direction: "column", gap: "lg", children: [
        /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          ValidatedInputControl,
          {
            ref: inputControlRef,
            __next40pxDefaultSize: true,
            required: !!isValid2?.required,
            customValidity: getCustomValidity(isValid2, validity),
            type: "datetime-local",
            label: (0, import_i18n33.__)("Date time"),
            hideLabelFromVision: true,
            value: formatDateTime(value),
            onChange: handleManualDateTimeChange
          }
        ),
        !compact && /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
          DateCalendar,
          {
            style: { width: "100%" },
            selected: value ? parseDateTime(value) || void 0 : void 0,
            onSelect: onSelectDate,
            month: calendarMonth,
            onMonthChange: setCalendarMonth,
            timeZone: timezoneString || void 0,
            weekStartsOn
          }
        )
      ] })
    }
  );
}
function DateTime({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  operator,
  validity,
  config
}) {
  if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
    return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
      RelativeDateControl,
      {
        className: "dataviews-controls__datetime",
        data,
        field,
        onChange,
        hideLabelFromVision,
        operator
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(
    CalendarDateTimeControl,
    {
      data,
      field,
      onChange,
      hideLabelFromVision,
      markWhenOptional,
      validity,
      config
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/date.mjs
var import_components34 = __toESM(require_components(), 1);
var import_element50 = __toESM(require_element(), 1);
var import_i18n34 = __toESM(require_i18n(), 1);
var import_date4 = __toESM(require_date(), 1);
var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1);
var { DateCalendar: DateCalendar2, DateRangeCalendar } = unlock(import_components34.privateApis);
var DATE_PRESETS = [
  {
    id: "today",
    label: (0, import_i18n34.__)("Today"),
    getValue: () => (0, import_date4.getDate)(null)
  },
  {
    id: "yesterday",
    label: (0, import_i18n34.__)("Yesterday"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return subDays(today, 1);
    }
  },
  {
    id: "past-week",
    label: (0, import_i18n34.__)("Past week"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return subDays(today, 7);
    }
  },
  {
    id: "past-month",
    label: (0, import_i18n34.__)("Past month"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return subMonths(today, 1);
    }
  }
];
var DATE_RANGE_PRESETS = [
  {
    id: "last-7-days",
    label: (0, import_i18n34.__)("Last 7 days"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return [subDays(today, 7), today];
    }
  },
  {
    id: "last-30-days",
    label: (0, import_i18n34.__)("Last 30 days"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return [subDays(today, 30), today];
    }
  },
  {
    id: "month-to-date",
    label: (0, import_i18n34.__)("Month to date"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return [startOfMonth(today), today];
    }
  },
  {
    id: "last-year",
    label: (0, import_i18n34.__)("Last year"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return [subYears(today, 1), today];
    }
  },
  {
    id: "year-to-date",
    label: (0, import_i18n34.__)("Year to date"),
    getValue: () => {
      const today = (0, import_date4.getDate)(null);
      return [startOfYear(today), today];
    }
  }
];
var parseDate = (dateString) => {
  if (!dateString) {
    return null;
  }
  const parsed = (0, import_date4.getDate)(dateString);
  return parsed && isValid(parsed) ? parsed : null;
};
var formatDate = (date) => {
  if (!date) {
    return "";
  }
  return typeof date === "string" ? date : format(date, "yyyy-MM-dd");
};
function ValidatedDateControl({
  field,
  validity,
  inputRefs,
  isTouched,
  setIsTouched,
  children
}) {
  const { isValid: isValid2 } = field;
  const [customValidity, setCustomValidity] = (0, import_element50.useState)(void 0);
  const validateRefs = (0, import_element50.useCallback)(() => {
    const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
    for (const ref of refs) {
      const input = ref.current;
      if (input && !input.validity.valid) {
        setCustomValidity({
          type: "invalid",
          message: input.validationMessage
        });
        return;
      }
    }
    setCustomValidity(void 0);
  }, [inputRefs]);
  (0, import_element50.useEffect)(() => {
    const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
    const result = validity ? getCustomValidity(isValid2, validity) : void 0;
    for (const ref of refs) {
      const input = ref.current;
      if (input) {
        input.setCustomValidity(
          result?.type === "invalid" && result.message ? result.message : ""
        );
      }
    }
  }, [inputRefs, isValid2, validity]);
  (0, import_element50.useEffect)(() => {
    const refs = Array.isArray(inputRefs) ? inputRefs : [inputRefs];
    const handleInvalid = (event) => {
      event.preventDefault();
      setIsTouched(true);
    };
    for (const ref of refs) {
      ref.current?.addEventListener("invalid", handleInvalid);
    }
    return () => {
      for (const ref of refs) {
        ref.current?.removeEventListener("invalid", handleInvalid);
      }
    };
  }, [inputRefs, setIsTouched]);
  (0, import_element50.useEffect)(() => {
    if (!isTouched) {
      return;
    }
    const result = validity ? getCustomValidity(isValid2, validity) : void 0;
    if (result) {
      setCustomValidity(result);
    } else {
      validateRefs();
    }
  }, [isTouched, isValid2, validity, validateRefs]);
  const onBlur = (event) => {
    if (isTouched) {
      return;
    }
    if (!event.relatedTarget || !event.currentTarget.contains(event.relatedTarget)) {
      setIsTouched(true);
    }
  };
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)("div", { onBlur, children: [
    children,
    /* @__PURE__ */ (0, import_jsx_runtime94.jsx)("div", { "aria-live": "polite", children: customValidity && /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
      "p",
      {
        className: clsx_default(
          "components-validated-control__indicator",
          customValidity.type === "invalid" ? "is-invalid" : void 0
        ),
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
            import_components34.Icon,
            {
              className: "components-validated-control__indicator-icon",
              icon: error_default,
              size: 16,
              fill: "currentColor"
            }
          ),
          customValidity.message
        ]
      }
    ) })
  ] });
}
function CalendarDateControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const {
    id,
    label,
    description,
    setValue,
    getValue,
    isValid: isValid2,
    format: fieldFormat
  } = field;
  const [selectedPresetId, setSelectedPresetId] = (0, import_element50.useState)(
    null
  );
  const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date4.getSettings)().l10n.startOfWeek;
  const fieldValue = getValue({ item: data });
  const value = typeof fieldValue === "string" ? fieldValue : void 0;
  const [calendarMonth, setCalendarMonth] = (0, import_element50.useState)(() => {
    const parsedDate = parseDate(value);
    return parsedDate || /* @__PURE__ */ new Date();
  });
  const [isTouched, setIsTouched] = (0, import_element50.useState)(false);
  const validityTargetRef = (0, import_element50.useRef)(null);
  const onChangeCallback = (0, import_element50.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  const onSelectDate = (0, import_element50.useCallback)(
    (newDate) => {
      const dateValue = newDate ? format(newDate, "yyyy-MM-dd") : void 0;
      onChangeCallback(dateValue);
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [onChangeCallback]
  );
  const handlePresetClick = (0, import_element50.useCallback)(
    (preset) => {
      const presetDate = preset.getValue();
      const dateValue = formatDate(presetDate);
      setCalendarMonth(presetDate);
      onChangeCallback(dateValue);
      setSelectedPresetId(preset.id);
      setIsTouched(true);
    },
    [onChangeCallback]
  );
  const handleManualDateChange = (0, import_element50.useCallback)(
    (newValue) => {
      onChangeCallback(newValue);
      if (newValue) {
        const parsedDate = parseDate(newValue);
        if (parsedDate) {
          setCalendarMonth(parsedDate);
        }
      }
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [onChangeCallback]
  );
  const {
    timezone: { string: timezoneString }
  } = (0, import_date4.getSettings)();
  let displayLabel = label;
  if (isValid2?.required && !markWhenOptional) {
    displayLabel = `${label} (${(0, import_i18n34.__)("Required")})`;
  } else if (!isValid2?.required && markWhenOptional) {
    displayLabel = `${label} (${(0, import_i18n34.__)("Optional")})`;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
    ValidatedDateControl,
    {
      field,
      validity,
      inputRefs: validityTargetRef,
      isTouched,
      setIsTouched,
      children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
        import_components34.BaseControl,
        {
          id,
          className: "dataviews-controls__date",
          label: displayLabel,
          help: description,
          hideLabelFromVision,
          children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Stack, { direction: "column", gap: "lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "sm",
                wrap: "wrap",
                justify: "flex-start",
                children: [
                  DATE_PRESETS.map((preset) => {
                    const isSelected2 = selectedPresetId === preset.id;
                    return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                      import_components34.Button,
                      {
                        className: "dataviews-controls__date-preset",
                        variant: "tertiary",
                        isPressed: isSelected2,
                        size: "small",
                        onClick: () => handlePresetClick(preset),
                        children: preset.label
                      },
                      preset.id
                    );
                  }),
                  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                    import_components34.Button,
                    {
                      className: "dataviews-controls__date-preset",
                      variant: "tertiary",
                      isPressed: !selectedPresetId,
                      size: "small",
                      disabled: !!selectedPresetId,
                      accessibleWhenDisabled: false,
                      children: (0, import_i18n34.__)("Custom")
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
              import_components34.__experimentalInputControl,
              {
                __next40pxDefaultSize: true,
                ref: validityTargetRef,
                type: "date",
                label: (0, import_i18n34.__)("Date"),
                hideLabelFromVision: true,
                value,
                onChange: handleManualDateChange,
                required: !!field.isValid?.required
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
              DateCalendar2,
              {
                style: { width: "100%" },
                selected: value ? parseDate(value) || void 0 : void 0,
                onSelect: onSelectDate,
                month: calendarMonth,
                onMonthChange: setCalendarMonth,
                timeZone: timezoneString || void 0,
                weekStartsOn
              }
            )
          ] })
        }
      )
    }
  );
}
function CalendarDateRangeControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const {
    id,
    label,
    description,
    getValue,
    setValue,
    format: fieldFormat
  } = field;
  let value;
  const fieldValue = getValue({ item: data });
  if (Array.isArray(fieldValue) && fieldValue.length === 2 && fieldValue.every((date) => typeof date === "string")) {
    value = fieldValue;
  }
  const weekStartsOn = fieldFormat.weekStartsOn ?? (0, import_date4.getSettings)().l10n.startOfWeek;
  const onChangeCallback = (0, import_element50.useCallback)(
    (newValue) => {
      onChange(
        setValue({
          item: data,
          value: newValue
        })
      );
    },
    [data, onChange, setValue]
  );
  const [selectedPresetId, setSelectedPresetId] = (0, import_element50.useState)(
    null
  );
  const selectedRange = (0, import_element50.useMemo)(() => {
    if (!value) {
      return { from: void 0, to: void 0 };
    }
    const [from, to] = value;
    return {
      from: parseDate(from) || void 0,
      to: parseDate(to) || void 0
    };
  }, [value]);
  const [calendarMonth, setCalendarMonth] = (0, import_element50.useState)(() => {
    return selectedRange.from || /* @__PURE__ */ new Date();
  });
  const [isTouched, setIsTouched] = (0, import_element50.useState)(false);
  const fromInputRef = (0, import_element50.useRef)(null);
  const toInputRef = (0, import_element50.useRef)(null);
  const updateDateRange = (0, import_element50.useCallback)(
    (fromDate, toDate2) => {
      if (fromDate && toDate2) {
        onChangeCallback([
          formatDate(fromDate),
          formatDate(toDate2)
        ]);
      } else if (!fromDate && !toDate2) {
        onChangeCallback(void 0);
      }
    },
    [onChangeCallback]
  );
  const onSelectCalendarRange = (0, import_element50.useCallback)(
    (newRange) => {
      updateDateRange(newRange?.from, newRange?.to);
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [updateDateRange]
  );
  const handlePresetClick = (0, import_element50.useCallback)(
    (preset) => {
      const [startDate, endDate] = preset.getValue();
      setCalendarMonth(startDate);
      updateDateRange(startDate, endDate);
      setSelectedPresetId(preset.id);
      setIsTouched(true);
    },
    [updateDateRange]
  );
  const handleManualDateChange = (0, import_element50.useCallback)(
    (fromOrTo, newValue) => {
      const [currentFrom, currentTo] = value || [
        void 0,
        void 0
      ];
      const updatedFrom = fromOrTo === "from" ? newValue : currentFrom;
      const updatedTo = fromOrTo === "to" ? newValue : currentTo;
      updateDateRange(updatedFrom, updatedTo);
      if (newValue) {
        const parsedDate = parseDate(newValue);
        if (parsedDate) {
          setCalendarMonth(parsedDate);
        }
      }
      setSelectedPresetId(null);
      setIsTouched(true);
    },
    [value, updateDateRange]
  );
  const { timezone } = (0, import_date4.getSettings)();
  let displayLabel = label;
  if (field.isValid?.required && !markWhenOptional) {
    displayLabel = `${label} (${(0, import_i18n34.__)("Required")})`;
  } else if (!field.isValid?.required && markWhenOptional) {
    displayLabel = `${label} (${(0, import_i18n34.__)("Optional")})`;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
    ValidatedDateControl,
    {
      field,
      validity,
      inputRefs: [fromInputRef, toInputRef],
      isTouched,
      setIsTouched,
      children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
        import_components34.BaseControl,
        {
          id,
          className: "dataviews-controls__date",
          label: displayLabel,
          help: description,
          hideLabelFromVision,
          children: /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(Stack, { direction: "column", gap: "lg", children: [
            /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "sm",
                wrap: "wrap",
                justify: "flex-start",
                children: [
                  DATE_RANGE_PRESETS.map((preset) => {
                    const isSelected2 = selectedPresetId === preset.id;
                    return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                      import_components34.Button,
                      {
                        className: "dataviews-controls__date-preset",
                        variant: "tertiary",
                        isPressed: isSelected2,
                        size: "small",
                        onClick: () => handlePresetClick(preset),
                        children: preset.label
                      },
                      preset.id
                    );
                  }),
                  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                    import_components34.Button,
                    {
                      className: "dataviews-controls__date-preset",
                      variant: "tertiary",
                      isPressed: !selectedPresetId,
                      size: "small",
                      accessibleWhenDisabled: false,
                      disabled: !!selectedPresetId,
                      children: (0, import_i18n34.__)("Custom")
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(
              Stack,
              {
                direction: "row",
                gap: "sm",
                justify: "space-between",
                className: "dataviews-controls__date-range-inputs",
                children: [
                  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                    import_components34.__experimentalInputControl,
                    {
                      __next40pxDefaultSize: true,
                      ref: fromInputRef,
                      type: "date",
                      label: (0, import_i18n34.__)("From"),
                      hideLabelFromVision: true,
                      value: value?.[0],
                      onChange: (newValue) => handleManualDateChange("from", newValue),
                      required: !!field.isValid?.required
                    }
                  ),
                  /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
                    import_components34.__experimentalInputControl,
                    {
                      __next40pxDefaultSize: true,
                      ref: toInputRef,
                      type: "date",
                      label: (0, import_i18n34.__)("To"),
                      hideLabelFromVision: true,
                      value: value?.[1],
                      onChange: (newValue) => handleManualDateChange("to", newValue),
                      required: !!field.isValid?.required
                    }
                  )
                ]
              }
            ),
            /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
              DateRangeCalendar,
              {
                style: { width: "100%" },
                selected: selectedRange,
                onSelect: onSelectCalendarRange,
                month: calendarMonth,
                onMonthChange: setCalendarMonth,
                timeZone: timezone.string || void 0,
                weekStartsOn
              }
            )
          ] })
        }
      )
    }
  );
}
function DateControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  operator,
  validity
}) {
  if (operator === OPERATOR_IN_THE_PAST || operator === OPERATOR_OVER) {
    return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
      RelativeDateControl,
      {
        className: "dataviews-controls__date",
        data,
        field,
        onChange,
        hideLabelFromVision,
        operator
      }
    );
  }
  if (operator === OPERATOR_BETWEEN) {
    return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
      CalendarDateRangeControl,
      {
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(
    CalendarDateControl,
    {
      data,
      field,
      onChange,
      hideLabelFromVision,
      markWhenOptional,
      validity
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/select.mjs
var import_components35 = __toESM(require_components(), 1);
var import_element51 = __toESM(require_element(), 1);
var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1);
var { ValidatedSelectControl } = unlock(import_components35.privateApis);
function Select({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { type, label, description, getValue, setValue, isValid: isValid2 } = field;
  const isMultiple = type === "array";
  const value = getValue({ item: data }) ?? (isMultiple ? [] : "");
  const onChangeControl = (0, import_element51.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_components35.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(
    ValidatedSelectControl,
    {
      required: !!field.isValid?.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      value,
      help: description,
      options: elements,
      onChange: onChangeControl,
      __next40pxDefaultSize: true,
      hideLabelFromVision,
      multiple: isMultiple
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/adaptive-select.mjs
var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1);
var ELEMENTS_THRESHOLD = 10;
function AdaptiveSelect(props) {
  const { field } = props;
  const { elements } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (elements.length >= ELEMENTS_THRESHOLD) {
    return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Combobox3, { ...props });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(Select, { ...props });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/email.mjs
var import_components37 = __toESM(require_components(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/validated-input.mjs
var import_components36 = __toESM(require_components(), 1);
var import_element52 = __toESM(require_element(), 1);
var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1);
var { ValidatedInputControl: ValidatedInputControl2 } = unlock(import_components36.privateApis);
function ValidatedText({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  type,
  prefix,
  suffix,
  validity
}) {
  const { label, placeholder, description, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data });
  const onChangeControl = (0, import_element52.useCallback)(
    (newValue) => onChange(
      setValue({
        item: data,
        value: newValue
      })
    ),
    [data, setValue, onChange]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(
    ValidatedInputControl2,
    {
      required: !!isValid2.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      placeholder,
      value: value ?? "",
      help: description,
      onChange: onChangeControl,
      hideLabelFromVision,
      type,
      prefix,
      suffix,
      pattern: isValid2.pattern ? isValid2.pattern.constraint : void 0,
      minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0,
      maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0,
      __next40pxDefaultSize: true
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/email.mjs
var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1);
function Email({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity,
        type: "email",
        prefix: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components37.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_components37.Icon, { icon: envelope_default }) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/telephone.mjs
var import_components38 = __toESM(require_components(), 1);
var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1);
function Telephone({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity,
        type: "tel",
        prefix: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components38.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_components38.Icon, { icon: mobile_default }) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/url.mjs
var import_components39 = __toESM(require_components(), 1);
var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1);
function Url({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity,
        type: "url",
        prefix: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components39.__experimentalInputControlPrefixWrapper, { variant: "icon", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_components39.Icon, { icon: link_default }) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/utils/validated-number.mjs
var import_components40 = __toESM(require_components(), 1);
var import_element53 = __toESM(require_element(), 1);
var import_i18n35 = __toESM(require_i18n(), 1);
var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1);
var { ValidatedNumberControl } = unlock(import_components40.privateApis);
function toNumberOrEmpty(value) {
  if (value === "" || value === void 0) {
    return "";
  }
  const number = Number(value);
  return Number.isFinite(number) ? number : "";
}
function BetweenControls({
  value,
  onChange,
  hideLabelFromVision,
  step
}) {
  const [min = "", max = ""] = value;
  const onChangeMin = (0, import_element53.useCallback)(
    (newValue) => onChange([toNumberOrEmpty(newValue), max]),
    [onChange, max]
  );
  const onChangeMax = (0, import_element53.useCallback)(
    (newValue) => onChange([min, toNumberOrEmpty(newValue)]),
    [onChange, min]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
    import_components40.BaseControl,
    {
      help: (0, import_i18n35.__)("The max. value must be greater than the min. value."),
      children: /* @__PURE__ */ (0, import_jsx_runtime101.jsxs)(import_components40.Flex, { direction: "row", gap: 4, children: [
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          import_components40.__experimentalNumberControl,
          {
            label: (0, import_i18n35.__)("Min."),
            value: min,
            max: max ? Number(max) - step : void 0,
            onChange: onChangeMin,
            __next40pxDefaultSize: true,
            hideLabelFromVision,
            step
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
          import_components40.__experimentalNumberControl,
          {
            label: (0, import_i18n35.__)("Max."),
            value: max,
            min: min ? Number(min) + step : void 0,
            onChange: onChangeMax,
            __next40pxDefaultSize: true,
            hideLabelFromVision,
            step
          }
        )
      ] })
    }
  );
}
function ValidatedNumber({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  operator,
  validity
}) {
  const decimals = field.format?.decimals ?? 0;
  const step = Math.pow(10, Math.abs(decimals) * -1);
  const { label, description, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data }) ?? "";
  const onChangeControl = (0, import_element53.useCallback)(
    (newValue) => {
      onChange(
        setValue({
          item: data,
          // Do not convert an empty string or undefined to a number,
          // otherwise there's a mismatch between the UI control (empty)
          // and the data relied by onChange (0).
          value: ["", void 0].includes(newValue) ? void 0 : Number(newValue)
        })
      );
    },
    [data, onChange, setValue]
  );
  const onChangeBetweenControls = (0, import_element53.useCallback)(
    (newValue) => {
      onChange(
        setValue({
          item: data,
          value: newValue
        })
      );
    },
    [data, onChange, setValue]
  );
  if (operator === OPERATOR_BETWEEN) {
    let valueBetween = ["", ""];
    if (Array.isArray(value) && value.length === 2 && value.every(
      (element) => typeof element === "number" || element === ""
    )) {
      valueBetween = value;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
      BetweenControls,
      {
        value: valueBetween,
        onChange: onChangeBetweenControls,
        hideLabelFromVision,
        step
      }
    );
  }
  return /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(
    ValidatedNumberControl,
    {
      required: !!isValid2.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      help: description,
      value,
      onChange: onChangeControl,
      __next40pxDefaultSize: true,
      hideLabelFromVision,
      step,
      min: isValid2.min ? isValid2.min.constraint : void 0,
      max: isValid2.max ? isValid2.max.constraint : void 0
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/integer.mjs
var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1);
function Integer(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(ValidatedNumber, { ...props });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/number.mjs
var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1);
function Number2(props) {
  return /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(ValidatedNumber, { ...props });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/radio.mjs
var import_components41 = __toESM(require_components(), 1);
var import_element54 = __toESM(require_element(), 1);
var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1);
var { ValidatedRadioControl } = unlock(import_components41.privateApis);
function Radio({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { label, description, getValue, setValue, isValid: isValid2 } = field;
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  const value = getValue({ item: data });
  const onChangeControl = (0, import_element54.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_components41.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(
    ValidatedRadioControl,
    {
      required: !!field.isValid?.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      help: description,
      onChange: onChangeControl,
      options: elements,
      selected: value,
      hideLabelFromVision
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/text.mjs
var import_element55 = __toESM(require_element(), 1);
var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1);
function Text({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  config,
  validity
}) {
  const { prefix, suffix } = config || {};
  return /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity,
        prefix: prefix ? (0, import_element55.createElement)(prefix) : void 0,
        suffix: suffix ? (0, import_element55.createElement)(suffix) : void 0
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/toggle.mjs
var import_components42 = __toESM(require_components(), 1);
var import_element56 = __toESM(require_element(), 1);
var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1);
var { ValidatedToggleControl } = unlock(import_components42.privateApis);
function Toggle({
  field,
  onChange,
  data,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { label, description, getValue, setValue, isValid: isValid2 } = field;
  const onChangeControl = (0, import_element56.useCallback)(() => {
    onChange(
      setValue({ item: data, value: !getValue({ item: data }) })
    );
  }, [onChange, setValue, data, getValue]);
  return /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(
    ValidatedToggleControl,
    {
      required: !!isValid2.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      hidden: hideLabelFromVision,
      label,
      help: description,
      checked: getValue({ item: data }),
      onChange: onChangeControl
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/textarea.mjs
var import_components43 = __toESM(require_components(), 1);
var import_element57 = __toESM(require_element(), 1);
var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1);
var { ValidatedTextareaControl } = unlock(import_components43.privateApis);
function Textarea({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  config,
  validity
}) {
  const { rows = 4 } = config || {};
  const { label, placeholder, description, setValue, isValid: isValid2 } = field;
  const value = field.getValue({ item: data });
  const onChangeControl = (0, import_element57.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(
    ValidatedTextareaControl,
    {
      required: !!isValid2.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      placeholder,
      value: value ?? "",
      help: description,
      onChange: onChangeControl,
      rows,
      minLength: isValid2.minLength ? isValid2.minLength.constraint : void 0,
      maxLength: isValid2.maxLength ? isValid2.maxLength.constraint : void 0,
      __next40pxDefaultSize: true,
      hideLabelFromVision
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/toggle-group.mjs
var import_components44 = __toESM(require_components(), 1);
var import_element58 = __toESM(require_element(), 1);
var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1);
var { ValidatedToggleGroupControl } = unlock(import_components44.privateApis);
function ToggleGroup({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data });
  const onChangeControl = (0, import_element58.useCallback)(
    (newValue) => onChange(setValue({ item: data, value: newValue })),
    [data, onChange, setValue]
  );
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_components44.Spinner, {});
  }
  if (elements.length === 0) {
    return null;
  }
  const selectedOption = elements.find((el) => el.value === value);
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
    ValidatedToggleGroupControl,
    {
      required: !!field.isValid?.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      __next40pxDefaultSize: true,
      isBlock: true,
      label: field.label,
      help: selectedOption?.description || field.description,
      onChange: onChangeControl,
      value,
      hideLabelFromVision,
      children: elements.map((el) => /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
        import_components44.__experimentalToggleGroupControlOption,
        {
          label: el.label,
          value: el.value
        },
        el.value
      ))
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/array.mjs
var import_components45 = __toESM(require_components(), 1);
var import_element59 = __toESM(require_element(), 1);
var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1);
var { ValidatedFormTokenField } = unlock(import_components45.privateApis);
function ArrayControl({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { label, placeholder, getValue, setValue, isValid: isValid2 } = field;
  const value = getValue({ item: data });
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  const arrayValueAsElements = (0, import_element59.useMemo)(
    () => Array.isArray(value) ? value.map((token) => {
      const element = elements?.find(
        (suggestion) => suggestion.value === token
      );
      return element || { value: token, label: token };
    }) : [],
    [value, elements]
  );
  const onChangeControl = (0, import_element59.useCallback)(
    (tokens) => {
      const valueTokens = tokens.map((token) => {
        if (typeof token === "object" && "value" in token) {
          return token.value;
        }
        return token;
      });
      onChange(setValue({ item: data, value: valueTokens }));
    },
    [onChange, setValue, data]
  );
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_components45.Spinner, {});
  }
  return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(
    ValidatedFormTokenField,
    {
      required: !!isValid2?.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label: hideLabelFromVision ? void 0 : label,
      value: arrayValueAsElements,
      onChange: onChangeControl,
      placeholder,
      suggestions: elements?.map((element) => element.value),
      __experimentalValidateInput: (token) => {
        if (field.isValid?.elements && elements) {
          return elements.some(
            (element) => element.value === token || element.label === token
          );
        }
        return true;
      },
      __experimentalExpandOnFocus: elements && elements.length > 0,
      __experimentalShowHowTo: !field.isValid?.elements,
      displayTransform: (token) => {
        if (typeof token === "object" && "label" in token) {
          return token.label;
        }
        if (typeof token === "string" && elements) {
          const element = elements.find(
            (el) => el.value === token
          );
          return element?.label || token;
        }
        return token;
      },
      __experimentalRenderItem: ({ item }) => {
        if (typeof item === "string" && elements) {
          const element = elements.find(
            (el) => el.value === item
          );
          return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: element?.label || item });
        }
        return /* @__PURE__ */ (0, import_jsx_runtime109.jsx)("span", { children: item });
      }
    }
  );
}

// ../../../node_modules/.pnpm/colord@2.9.3/node_modules/colord/index.mjs
var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) };
var t = function(r3) {
  return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3;
};
var n = function(r3, t2, n2) {
  return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = Math.pow(10, t2)), Math.round(n2 * r3) / n2 + 0;
};
var e = function(r3, t2, n2) {
  return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t2 ? r3 : t2;
};
var u = function(r3) {
  return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360;
};
var a = function(r3) {
  return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) };
};
var o = function(r3) {
  return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) };
};
var i = /^#([0-9a-f]{3,8})$/i;
var s = function(r3) {
  var t2 = r3.toString(16);
  return t2.length < 2 ? "0" + t2 : t2;
};
var h = function(r3) {
  var t2 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t2, n2, e2), o2 = a2 - Math.min(t2, n2, e2), i2 = o2 ? a2 === t2 ? (n2 - e2) / o2 : a2 === n2 ? 2 + (e2 - t2) / o2 : 4 + (t2 - n2) / o2 : 0;
  return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o2 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 };
};
var b = function(r3) {
  var t2 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a;
  t2 = t2 / 360 * 6, n2 /= 100, e2 /= 100;
  var a2 = Math.floor(t2), o2 = e2 * (1 - n2), i2 = e2 * (1 - (t2 - a2) * n2), s2 = e2 * (1 - (1 - t2 + a2) * n2), h2 = a2 % 6;
  return { r: 255 * [e2, i2, o2, o2, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o2, o2][h2], b: 255 * [o2, o2, s2, e2, e2, i2][h2], a: u2 };
};
var g = function(r3) {
  return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) };
};
var d = function(r3) {
  return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) };
};
var f = function(r3) {
  return b((n2 = (t2 = r3).s, { h: t2.h, s: (n2 *= ((e2 = t2.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t2.a }));
  var t2, n2, e2;
};
var c = function(r3) {
  return { h: (t2 = h(r3)).h, s: (u2 = (200 - (n2 = t2.s)) * (e2 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a };
  var t2, n2, e2, u2;
};
var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i;
var y = { string: [[function(r3) {
  var t2 = i.exec(r3);
  return t2 ? (r3 = t2[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null;
}, "hex"], [function(r3) {
  var t2 = v.exec(r3) || m.exec(r3);
  return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null;
}, "rgb"], [function(t2) {
  var n2 = l.exec(t2) || p.exec(t2);
  if (!n2) return null;
  var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) });
  return f(a2);
}, "hsl"]], object: [[function(r3) {
  var n2 = r3.r, e2 = r3.g, u2 = r3.b, o2 = r3.a, i2 = void 0 === o2 ? 1 : o2;
  return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null;
}, "rgb"], [function(r3) {
  var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o2 = void 0 === a2 ? 1 : a2;
  if (!t(n2) || !t(e2) || !t(u2)) return null;
  var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o2) });
  return f(i2);
}, "hsl"], [function(r3) {
  var n2 = r3.h, a2 = r3.s, o2 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2;
  if (!t(n2) || !t(a2) || !t(o2)) return null;
  var h2 = (function(r4) {
    return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) };
  })({ h: Number(n2), s: Number(a2), v: Number(o2), a: Number(s2) });
  return b(h2);
}, "hsv"]] };
var N = function(r3, t2) {
  for (var n2 = 0; n2 < t2.length; n2++) {
    var e2 = t2[n2][0](r3);
    if (e2) return [e2, t2[n2][1]];
  }
  return [null, void 0];
};
var x = function(r3) {
  return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0];
};
var M = function(r3, t2) {
  var n2 = c(r3);
  return { h: n2.h, s: e(n2.s + 100 * t2, 0, 100), l: n2.l, a: n2.a };
};
var H = function(r3) {
  return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255;
};
var $ = function(r3, t2) {
  var n2 = c(r3);
  return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t2, 0, 100), a: n2.a };
};
var j = (function() {
  function r3(r4) {
    this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 };
  }
  return r3.prototype.isValid = function() {
    return null !== this.parsed;
  }, r3.prototype.brightness = function() {
    return n(H(this.rgba), 2);
  }, r3.prototype.isDark = function() {
    return H(this.rgba) < 0.5;
  }, r3.prototype.isLight = function() {
    return H(this.rgba) >= 0.5;
  }, r3.prototype.toHex = function() {
    return r4 = o(this.rgba), t2 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t2) + s(e2) + s(u2) + i2;
    var r4, t2, e2, u2, a2, i2;
  }, r3.prototype.toRgb = function() {
    return o(this.rgba);
  }, r3.prototype.toRgbString = function() {
    return r4 = o(this.rgba), t2 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t2 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t2 + ", " + n2 + ", " + e2 + ")";
    var r4, t2, n2, e2, u2;
  }, r3.prototype.toHsl = function() {
    return d(c(this.rgba));
  }, r3.prototype.toHslString = function() {
    return r4 = d(c(this.rgba)), t2 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t2 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t2 + ", " + n2 + "%, " + e2 + "%)";
    var r4, t2, n2, e2, u2;
  }, r3.prototype.toHsv = function() {
    return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) };
    var r4;
  }, r3.prototype.invert = function() {
    return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a });
    var r4;
  }, r3.prototype.saturate = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4));
  }, r3.prototype.desaturate = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4));
  }, r3.prototype.grayscale = function() {
    return w(M(this.rgba, -1));
  }, r3.prototype.lighten = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4));
  }, r3.prototype.darken = function(r4) {
    return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4));
  }, r3.prototype.rotate = function(r4) {
    return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4);
  }, r3.prototype.alpha = function(r4) {
    return "number" == typeof r4 ? w({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r4 }) : n(this.rgba.a, 3);
    var t2;
  }, r3.prototype.hue = function(r4) {
    var t2 = c(this.rgba);
    return "number" == typeof r4 ? w({ h: r4, s: t2.s, l: t2.l, a: t2.a }) : n(t2.h);
  }, r3.prototype.isEqual = function(r4) {
    return this.toHex() === w(r4).toHex();
  }, r3;
})();
var w = function(r3) {
  return r3 instanceof j ? r3 : new j(r3);
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/color.mjs
var import_components46 = __toESM(require_components(), 1);
var import_element60 = __toESM(require_element(), 1);
var import_i18n36 = __toESM(require_i18n(), 1);
var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1);
var { ValidatedInputControl: ValidatedInputControl3 } = unlock(import_components46.privateApis);
var ColorPickerDropdown = ({
  color,
  onColorChange
}) => {
  const validColor = color && w(color).isValid() ? color : "#ffffff";
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
    import_components46.Dropdown,
    {
      className: "dataviews-controls__color-picker-dropdown",
      popoverProps: { resize: false },
      renderToggle: ({ onToggle }) => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
        import_components46.Button,
        {
          onClick: onToggle,
          "aria-label": (0, import_i18n36.__)("Open color picker"),
          size: "small",
          icon: () => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components46.ColorIndicator, { colorValue: validColor })
        }
      ),
      renderContent: () => /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components46.__experimentalDropdownContentWrapper, { paddingSize: "none", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
        import_components46.ColorPicker,
        {
          color: validColor,
          onChange: onColorChange,
          enableAlpha: true
        }
      ) })
    }
  );
};
function Color({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const { label, placeholder, description, setValue, isValid: isValid2 } = field;
  const value = field.getValue({ item: data }) || "";
  const handleColorChange = (0, import_element60.useCallback)(
    (newColor) => {
      onChange(setValue({ item: data, value: newColor }));
    },
    [data, onChange, setValue]
  );
  const handleInputChange = (0, import_element60.useCallback)(
    (newValue) => {
      onChange(setValue({ item: data, value: newValue || "" }));
    },
    [data, onChange, setValue]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
    ValidatedInputControl3,
    {
      required: !!field.isValid?.required,
      markWhenOptional,
      customValidity: getCustomValidity(isValid2, validity),
      label,
      placeholder,
      value,
      help: description,
      onChange: handleInputChange,
      hideLabelFromVision,
      type: "text",
      prefix: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_components46.__experimentalInputControlPrefixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(
        ColorPickerDropdown,
        {
          color: value,
          onColorChange: handleColorChange
        }
      ) })
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/password.mjs
var import_components47 = __toESM(require_components(), 1);
var import_element61 = __toESM(require_element(), 1);
var import_i18n37 = __toESM(require_i18n(), 1);
var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1);
function Password({
  data,
  field,
  onChange,
  hideLabelFromVision,
  markWhenOptional,
  validity
}) {
  const [isVisible2, setIsVisible] = (0, import_element61.useState)(false);
  const toggleVisibility = (0, import_element61.useCallback)(() => {
    setIsVisible((prev) => !prev);
  }, []);
  return /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
    ValidatedText,
    {
      ...{
        data,
        field,
        onChange,
        hideLabelFromVision,
        markWhenOptional,
        validity,
        type: isVisible2 ? "text" : "password",
        suffix: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_components47.__experimentalInputControlSuffixWrapper, { variant: "control", children: /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(
          import_components47.Button,
          {
            icon: isVisible2 ? unseen_default : seen_default,
            onClick: toggleVisibility,
            size: "small",
            label: isVisible2 ? (0, import_i18n37.__)("Hide password") : (0, import_i18n37.__)("Show password")
          }
        ) })
      }
    }
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/has-elements.mjs
function hasElements(field) {
  return Array.isArray(field.elements) && field.elements.length > 0 || typeof field.getElements === "function";
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/components/dataform-controls/index.mjs
var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1);
var FORM_CONTROLS = {
  adaptiveSelect: AdaptiveSelect,
  array: ArrayControl,
  checkbox: Checkbox,
  color: Color,
  combobox: Combobox3,
  datetime: DateTime,
  date: DateControl,
  email: Email,
  telephone: Telephone,
  url: Url,
  integer: Integer,
  number: Number2,
  password: Password,
  radio: Radio,
  select: Select,
  text: Text,
  toggle: Toggle,
  textarea: Textarea,
  toggleGroup: ToggleGroup
};
function isEditConfig(value) {
  return value && typeof value === "object" && typeof value.control === "string";
}
function createConfiguredControl(config) {
  const { control, ...controlConfig } = config;
  const BaseControlType = getControlByType(control);
  if (BaseControlType === null) {
    return null;
  }
  return function ConfiguredControl(props) {
    return /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(BaseControlType, { ...props, config: controlConfig });
  };
}
function getControl(field, fallback) {
  if (typeof field.Edit === "function") {
    return field.Edit;
  }
  if (typeof field.Edit === "string") {
    return getControlByType(field.Edit);
  }
  if (isEditConfig(field.Edit)) {
    return createConfiguredControl(field.Edit);
  }
  if (hasElements(field) && field.type !== "array") {
    return getControlByType("adaptiveSelect");
  }
  if (fallback === null) {
    return null;
  }
  return getControlByType(fallback);
}
function getControlByType(type) {
  if (Object.keys(FORM_CONTROLS).includes(type)) {
    return FORM_CONTROLS[type];
  }
  return null;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-filter-by.mjs
function getFilterBy(field, defaultOperators, validOperators) {
  if (field.filterBy === false) {
    return false;
  }
  const operators = field.filterBy?.operators?.filter(
    (op) => validOperators.includes(op)
  ) ?? defaultOperators;
  if (operators.length === 0) {
    return false;
  }
  return {
    isPrimary: !!field.filterBy?.isPrimary,
    operators
  };
}
var get_filter_by_default = getFilterBy;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-value-from-id.mjs
var getValueFromId = (id) => ({ item }) => {
  const path = id.split(".");
  let value = item;
  for (const segment of path) {
    if (value.hasOwnProperty(segment)) {
      value = value[segment];
    } else {
      value = void 0;
    }
  }
  return value;
};
var get_value_from_id_default = getValueFromId;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/set-value-from-id.mjs
var setValueFromId = (id) => ({ value }) => {
  const path = id.split(".");
  const result = {};
  let current = result;
  for (const segment of path.slice(0, -1)) {
    current[segment] = {};
    current = current[segment];
  }
  current[path.at(-1)] = value;
  return result;
};
var set_value_from_id_default = setValueFromId;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/email.mjs
var import_i18n38 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/render-from-elements.mjs
function RenderFromElements({
  item,
  field
}) {
  const { elements, isLoading } = useElements({
    elements: field.elements,
    getElements: field.getElements
  });
  const value = field.getValue({ item });
  if (isLoading) {
    return value;
  }
  if (elements.length === 0) {
    return value;
  }
  return elements?.find((element) => element.value === value)?.label || field.getValue({ item });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/render-default.mjs
var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1);
function render({
  item,
  field
}) {
  if (field.hasElements) {
    return /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(RenderFromElements, { item, field });
  }
  return field.getValueFormatted({ item, field });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/sort-text.mjs
var sort_text_default = (a2, b2, direction) => {
  return direction === "asc" ? a2.localeCompare(b2) : b2.localeCompare(a2);
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-required.mjs
function isValidRequired(item, field) {
  const value = field.getValue({ item });
  return ![void 0, "", null].includes(value);
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-min-length.mjs
function isValidMinLength(item, field) {
  if (typeof field.isValid.minLength?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return String(value).length >= field.isValid.minLength.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-max-length.mjs
function isValidMaxLength(item, field) {
  if (typeof field.isValid.maxLength?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return String(value).length <= field.isValid.maxLength.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-pattern.mjs
function isValidPattern(item, field) {
  if (field.isValid.pattern?.constraint === void 0) {
    return true;
  }
  try {
    const regexp = new RegExp(field.isValid.pattern.constraint);
    const value = field.getValue({ item });
    if ([void 0, "", null].includes(value)) {
      return true;
    }
    return regexp.test(String(value));
  } catch {
    return false;
  }
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-elements.mjs
function isValidElements(item, field) {
  const elements = field.elements ?? [];
  const validValues = elements.map((el) => el.value);
  if (validValues.length === 0) {
    return true;
  }
  const value = field.getValue({ item });
  return [].concat(value).every((v2) => validValues.includes(v2));
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-value-formatted-default.mjs
function getValueFormatted({
  item,
  field
}) {
  return field.getValue({ item });
}
var get_value_formatted_default_default = getValueFormatted;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/email.mjs
var emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/;
function isValidCustom(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !emailRegex.test(value)) {
    return (0, import_i18n38.__)("Value must be a valid email address.");
  }
  return null;
}
var email_default = {
  type: "email",
  render,
  Edit: "email",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements,
    custom: isValidCustom
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/integer.mjs
var import_i18n39 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/sort-number.mjs
var sort_number_default = (a2, b2, direction) => {
  return direction === "asc" ? a2 - b2 : b2 - a2;
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-min.mjs
function isValidMin(item, field) {
  if (typeof field.isValid.min?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return Number(value) >= field.isValid.min.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-max.mjs
function isValidMax(item, field) {
  if (typeof field.isValid.max?.constraint !== "number") {
    return false;
  }
  const value = field.getValue({ item });
  if ([void 0, "", null].includes(value)) {
    return true;
  }
  return Number(value) <= field.isValid.max.constraint;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/integer.mjs
var format2 = {
  separatorThousand: ","
};
function getValueFormatted2({
  item,
  field
}) {
  let value = field.getValue({ item });
  if (value === null || value === void 0) {
    return "";
  }
  value = Number(value);
  if (!Number.isFinite(value)) {
    return String(value);
  }
  let formatInteger;
  if (field.type !== "integer") {
    formatInteger = format2;
  } else {
    formatInteger = field.format;
  }
  const { separatorThousand } = formatInteger;
  const integerValue = Math.trunc(value);
  if (!separatorThousand) {
    return String(integerValue);
  }
  return String(integerValue).replace(
    /\B(?=(\d{3})+(?!\d))/g,
    separatorThousand
  );
}
function isValidCustom2(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !Number.isInteger(value)) {
    return (0, import_i18n39.__)("Value must be an integer.");
  }
  return null;
}
var integer_default = {
  type: "integer",
  render,
  Edit: "integer",
  sort: sort_number_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN
  ],
  validOperators: [
    // Single-selection
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN,
    // Multiple-selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: format2,
  getValueFormatted: getValueFormatted2,
  validate: {
    required: isValidRequired,
    min: isValidMin,
    max: isValidMax,
    elements: isValidElements,
    custom: isValidCustom2
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/number.mjs
var import_i18n40 = __toESM(require_i18n(), 1);
var format3 = {
  separatorThousand: ",",
  separatorDecimal: ".",
  decimals: 2
};
function getValueFormatted3({
  item,
  field
}) {
  let value = field.getValue({ item });
  if (value === null || value === void 0) {
    return "";
  }
  value = Number(value);
  if (!Number.isFinite(value)) {
    return String(value);
  }
  let formatNumber2;
  if (field.type !== "number") {
    formatNumber2 = format3;
  } else {
    formatNumber2 = field.format;
  }
  const { separatorThousand, separatorDecimal, decimals } = formatNumber2;
  const fixedValue = value.toFixed(decimals);
  const [integerPart, decimalPart] = fixedValue.split(".");
  const formattedInteger = separatorThousand ? integerPart.replace(/\B(?=(\d{3})+(?!\d))/g, separatorThousand) : integerPart;
  return decimals === 0 ? formattedInteger : formattedInteger + separatorDecimal + decimalPart;
}
function isEmpty2(value) {
  return value === "" || value === void 0 || value === null;
}
function isValidCustom3(item, field) {
  const value = field.getValue({ item });
  if (!isEmpty2(value) && !Number.isFinite(value)) {
    return (0, import_i18n40.__)("Value must be a number.");
  }
  return null;
}
var number_default = {
  type: "number",
  render,
  Edit: "number",
  sort: sort_number_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN
  ],
  validOperators: [
    // Single-selection
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_LESS_THAN,
    OPERATOR_GREATER_THAN,
    OPERATOR_LESS_THAN_OR_EQUAL,
    OPERATOR_GREATER_THAN_OR_EQUAL,
    OPERATOR_BETWEEN,
    // Multiple-selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: format3,
  getValueFormatted: getValueFormatted3,
  validate: {
    required: isValidRequired,
    min: isValidMin,
    max: isValidMax,
    elements: isValidElements,
    custom: isValidCustom3
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/text.mjs
var text_default = {
  type: "text",
  render,
  Edit: "text",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    // Single selection
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/datetime.mjs
var import_date6 = __toESM(require_date(), 1);
var format4 = {
  datetime: (0, import_date6.getSettings)().formats.datetime,
  weekStartsOn: (0, import_date6.getSettings)().l10n.startOfWeek
};
function getValueFormatted4({
  item,
  field
}) {
  const value = field.getValue({ item });
  if (["", void 0, null].includes(value)) {
    return "";
  }
  let formatDatetime;
  if (field.type !== "datetime") {
    formatDatetime = format4;
  } else {
    formatDatetime = field.format;
  }
  return (0, import_date6.dateI18n)(formatDatetime.datetime, (0, import_date6.getDate)(value));
}
var sort = (a2, b2, direction) => {
  const timeA = new Date(a2).getTime();
  const timeB = new Date(b2).getTime();
  return direction === "asc" ? timeA - timeB : timeB - timeA;
};
var datetime_default = {
  type: "datetime",
  render,
  Edit: "datetime",
  sort,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER
  ],
  validOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER
  ],
  format: format4,
  getValueFormatted: getValueFormatted4,
  validate: {
    required: isValidRequired,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/date.mjs
var import_date7 = __toESM(require_date(), 1);
var format5 = {
  date: (0, import_date7.getSettings)().formats.date,
  weekStartsOn: (0, import_date7.getSettings)().l10n.startOfWeek
};
function getValueFormatted5({
  item,
  field
}) {
  const value = field.getValue({ item });
  if (["", void 0, null].includes(value)) {
    return "";
  }
  let formatDate2;
  if (field.type !== "date") {
    formatDate2 = format5;
  } else {
    formatDate2 = field.format;
  }
  return (0, import_date7.dateI18n)(formatDate2.date, (0, import_date7.getDate)(value));
}
var sort2 = (a2, b2, direction) => {
  const timeA = new Date(a2).getTime();
  const timeB = new Date(b2).getTime();
  return direction === "asc" ? timeA - timeB : timeB - timeA;
};
var date_default = {
  type: "date",
  render,
  Edit: "date",
  sort: sort2,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER,
    OPERATOR_BETWEEN
  ],
  validOperators: [
    OPERATOR_ON,
    OPERATOR_NOT_ON,
    OPERATOR_BEFORE,
    OPERATOR_AFTER,
    OPERATOR_BEFORE_INC,
    OPERATOR_AFTER_INC,
    OPERATOR_IN_THE_PAST,
    OPERATOR_OVER,
    OPERATOR_BETWEEN
  ],
  format: format5,
  getValueFormatted: getValueFormatted5,
  validate: {
    required: isValidRequired,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/boolean.mjs
var import_i18n41 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-required-for-bool.mjs
function isValidRequiredForBool(item, field) {
  const value = field.getValue({ item });
  return value === true;
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/boolean.mjs
function getValueFormatted6({
  item,
  field
}) {
  const value = field.getValue({ item });
  if (value === true) {
    return (0, import_i18n41.__)("True");
  }
  if (value === false) {
    return (0, import_i18n41.__)("False");
  }
  return "";
}
function isValidCustom4(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && ![true, false].includes(value)) {
    return (0, import_i18n41.__)("Value must be true, false, or undefined");
  }
  return null;
}
var sort3 = (a2, b2, direction) => {
  const boolA = Boolean(a2);
  const boolB = Boolean(b2);
  if (boolA === boolB) {
    return 0;
  }
  if (direction === "asc") {
    return boolA ? 1 : -1;
  }
  return boolA ? -1 : 1;
};
var boolean_default = {
  type: "boolean",
  render,
  Edit: "checkbox",
  sort: sort3,
  validate: {
    required: isValidRequiredForBool,
    elements: isValidElements,
    custom: isValidCustom4
  },
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
  validOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
  format: {},
  getValueFormatted: getValueFormatted6
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/media.mjs
var media_default = {
  type: "media",
  render: () => null,
  Edit: null,
  sort: () => 0,
  enableSorting: false,
  enableGlobalSearch: false,
  defaultOperators: [],
  validOperators: [],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  // cannot validate any constraint, so
  // the only available validation for the field author
  // would be providing a custom validator.
  validate: {}
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/array.mjs
var import_i18n42 = __toESM(require_i18n(), 1);

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/is-valid-required-for-array.mjs
function isValidRequiredForArray(item, field) {
  const value = field.getValue({ item });
  return Array.isArray(value) && value.length > 0 && value.every(
    (element) => ![void 0, "", null].includes(element)
  );
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/array.mjs
function getValueFormatted7({
  item,
  field
}) {
  const value = field.getValue({ item });
  const arr = Array.isArray(value) ? value : [];
  return arr.join(", ");
}
function render2({ item, field }) {
  return getValueFormatted7({ item, field });
}
function isValidCustom5(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !Array.isArray(value)) {
    return (0, import_i18n42.__)("Value must be an array.");
  }
  if (!value.every((v2) => typeof v2 === "string")) {
    return (0, import_i18n42.__)("Every value must be a string.");
  }
  return null;
}
var sort4 = (a2, b2, direction) => {
  const arrA = Array.isArray(a2) ? a2 : [];
  const arrB = Array.isArray(b2) ? b2 : [];
  if (arrA.length !== arrB.length) {
    return direction === "asc" ? arrA.length - arrB.length : arrB.length - arrA.length;
  }
  const joinedA = arrA.join(",");
  const joinedB = arrB.join(",");
  return direction === "asc" ? joinedA.localeCompare(joinedB) : joinedB.localeCompare(joinedA);
};
var array_default = {
  type: "array",
  render: render2,
  Edit: "array",
  sort: sort4,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: getValueFormatted7,
  validate: {
    required: isValidRequiredForArray,
    elements: isValidElements,
    custom: isValidCustom5
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/password.mjs
function getValueFormatted8({
  item,
  field
}) {
  return field.getValue({ item }) ? "\u2022\u2022\u2022\u2022\u2022\u2022\u2022\u2022" : "";
}
var password_default = {
  type: "password",
  render,
  Edit: "password",
  sort: () => 0,
  // Passwords should not be sortable for security reasons
  enableSorting: false,
  enableGlobalSearch: false,
  defaultOperators: [],
  validOperators: [],
  format: {},
  getValueFormatted: getValueFormatted8,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/telephone.mjs
var telephone_default = {
  type: "telephone",
  render,
  Edit: "telephone",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/color.mjs
var import_i18n43 = __toESM(require_i18n(), 1);
var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1);
function render3({ item, field }) {
  if (field.hasElements) {
    return /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(RenderFromElements, { item, field });
  }
  const value = get_value_formatted_default_default({ item, field });
  if (!value || !w(value).isValid()) {
    return value;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime114.jsxs)("div", { style: { display: "flex", alignItems: "center", gap: "8px" }, children: [
    /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(
      "div",
      {
        style: {
          width: "16px",
          height: "16px",
          borderRadius: "50%",
          backgroundColor: value,
          border: "1px solid #ddd",
          flexShrink: 0
        }
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime114.jsx)("span", { children: value })
  ] });
}
function isValidCustom6(item, field) {
  const value = field.getValue({ item });
  if (![void 0, "", null].includes(value) && !w(value).isValid()) {
    return (0, import_i18n43.__)("Value must be a valid color.");
  }
  return null;
}
var sort5 = (a2, b2, direction) => {
  const colorA = w(a2);
  const colorB = w(b2);
  if (!colorA.isValid() && !colorB.isValid()) {
    return 0;
  }
  if (!colorA.isValid()) {
    return direction === "asc" ? 1 : -1;
  }
  if (!colorB.isValid()) {
    return direction === "asc" ? -1 : 1;
  }
  const hslA = colorA.toHsl();
  const hslB = colorB.toHsl();
  if (hslA.h !== hslB.h) {
    return direction === "asc" ? hslA.h - hslB.h : hslB.h - hslA.h;
  }
  if (hslA.s !== hslB.s) {
    return direction === "asc" ? hslA.s - hslB.s : hslB.s - hslA.s;
  }
  return direction === "asc" ? hslA.l - hslB.l : hslB.l - hslA.l;
};
var color_default = {
  type: "color",
  render: render3,
  Edit: "color",
  sort: sort5,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    elements: isValidElements,
    custom: isValidCustom6
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/url.mjs
var url_default = {
  type: "url",
  render,
  Edit: "url",
  sort: sort_text_default,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS_ANY, OPERATOR_IS_NONE],
  validOperators: [
    OPERATOR_IS,
    OPERATOR_IS_NOT,
    OPERATOR_CONTAINS,
    OPERATOR_NOT_CONTAINS,
    OPERATOR_STARTS_WITH,
    // Multiple selection
    OPERATOR_IS_ANY,
    OPERATOR_IS_NONE,
    OPERATOR_IS_ALL,
    OPERATOR_IS_NOT_ALL
  ],
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    pattern: isValidPattern,
    minLength: isValidMinLength,
    maxLength: isValidMaxLength,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/no-type.mjs
var sort6 = (a2, b2, direction) => {
  if (typeof a2 === "number" && typeof b2 === "number") {
    return sort_number_default(a2, b2, direction);
  }
  return sort_text_default(a2, b2, direction);
};
var no_type_default = {
  // type: no type for this one
  render,
  Edit: null,
  sort: sort6,
  enableSorting: true,
  enableGlobalSearch: false,
  defaultOperators: [OPERATOR_IS, OPERATOR_IS_NOT],
  validOperators: getAllOperatorNames(),
  format: {},
  getValueFormatted: get_value_formatted_default_default,
  validate: {
    required: isValidRequired,
    elements: isValidElements
  }
};

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-is-valid.mjs
function getIsValid(field, fieldType) {
  let required;
  if (field.isValid?.required === true && fieldType.validate.required !== void 0) {
    required = {
      constraint: true,
      validate: fieldType.validate.required
    };
  }
  let elements;
  if ((field.isValid?.elements === true || // elements is enabled unless the field opts-out
  field.isValid?.elements === void 0 && (!!field.elements || !!field.getElements)) && fieldType.validate.elements !== void 0) {
    elements = {
      constraint: true,
      validate: fieldType.validate.elements
    };
  }
  let min;
  if (typeof field.isValid?.min === "number" && fieldType.validate.min !== void 0) {
    min = {
      constraint: field.isValid.min,
      validate: fieldType.validate.min
    };
  }
  let max;
  if (typeof field.isValid?.max === "number" && fieldType.validate.max !== void 0) {
    max = {
      constraint: field.isValid.max,
      validate: fieldType.validate.max
    };
  }
  let minLength;
  if (typeof field.isValid?.minLength === "number" && fieldType.validate.minLength !== void 0) {
    minLength = {
      constraint: field.isValid.minLength,
      validate: fieldType.validate.minLength
    };
  }
  let maxLength;
  if (typeof field.isValid?.maxLength === "number" && fieldType.validate.maxLength !== void 0) {
    maxLength = {
      constraint: field.isValid.maxLength,
      validate: fieldType.validate.maxLength
    };
  }
  let pattern;
  if (field.isValid?.pattern !== void 0 && fieldType.validate.pattern !== void 0) {
    pattern = {
      constraint: field.isValid?.pattern,
      validate: fieldType.validate.pattern
    };
  }
  const custom = field.isValid?.custom ?? fieldType.validate.custom;
  return {
    required,
    elements,
    min,
    max,
    minLength,
    maxLength,
    pattern,
    custom
  };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-filter.mjs
function getFilter(fieldType) {
  return fieldType.validOperators.reduce((accumulator, operator) => {
    const operatorObj = getOperatorByName(operator);
    if (operatorObj?.filter) {
      accumulator[operator] = operatorObj.filter;
    }
    return accumulator;
  }, {});
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/utils/get-format.mjs
function getFormat(field, fieldType) {
  return {
    ...fieldType.format,
    ...field.format
  };
}
var get_format_default = getFormat;

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/field-types/index.mjs
function getFieldTypeByName(type) {
  const found = [
    email_default,
    integer_default,
    number_default,
    text_default,
    datetime_default,
    date_default,
    boolean_default,
    media_default,
    array_default,
    password_default,
    telephone_default,
    color_default,
    url_default
  ].find((fieldType) => fieldType?.type === type);
  if (!!found) {
    return found;
  }
  return no_type_default;
}
function normalizeFields(fields) {
  return fields.map((field) => {
    const fieldType = getFieldTypeByName(field.type);
    const getValue = field.getValue || get_value_from_id_default(field.id);
    const sort7 = function(a2, b2, direction) {
      const aValue = getValue({ item: a2 });
      const bValue = getValue({ item: b2 });
      return field.sort ? field.sort(aValue, bValue, direction) : fieldType.sort(aValue, bValue, direction);
    };
    return {
      id: field.id,
      label: field.label || field.id,
      header: field.header || field.label || field.id,
      description: field.description,
      placeholder: field.placeholder,
      getValue,
      setValue: field.setValue || set_value_from_id_default(field.id),
      elements: field.elements,
      getElements: field.getElements,
      hasElements: hasElements(field),
      isVisible: field.isVisible,
      enableHiding: field.enableHiding ?? true,
      readOnly: field.readOnly ?? false,
      // The type provides defaults for the following props
      type: fieldType.type,
      render: field.render ?? fieldType.render,
      Edit: getControl(field, fieldType.Edit),
      sort: sort7,
      enableSorting: field.enableSorting ?? fieldType.enableSorting,
      enableGlobalSearch: field.enableGlobalSearch ?? fieldType.enableGlobalSearch,
      isValid: getIsValid(field, fieldType),
      filterBy: get_filter_by_default(
        field,
        fieldType.defaultOperators,
        fieldType.validOperators
      ),
      filter: getFilter(fieldType),
      format: get_format_default(field, fieldType),
      getValueFormatted: field.getValueFormatted ?? fieldType.getValueFormatted
    };
  });
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/hooks/use-data.mjs
var import_element62 = __toESM(require_element(), 1);
function useData({
  view,
  data: shownData,
  getItemId,
  isLoading,
  paginationInfo,
  selection
}) {
  const isInfiniteScrollEnabled = view.infiniteScrollEnabled;
  const [hasInitiallyLoaded, setHasInitiallyLoaded] = (0, import_element62.useState)(
    !isLoading
  );
  (0, import_element62.useEffect)(() => {
    if (!isLoading) {
      setHasInitiallyLoaded(true);
    }
  }, [isLoading]);
  const previousDataRef = (0, import_element62.useRef)(shownData);
  const previousPaginationInfoRef = (0, import_element62.useRef)(paginationInfo);
  (0, import_element62.useEffect)(() => {
    if (!isLoading) {
      previousDataRef.current = shownData;
      previousPaginationInfoRef.current = paginationInfo;
    }
  }, [shownData, isLoading, paginationInfo]);
  const [visibleEntries, setVisibleEntries] = (0, import_element62.useState)([]);
  const positionMapRef = (0, import_element62.useRef)(/* @__PURE__ */ new Map());
  const allLoadedRecordsRef = (0, import_element62.useRef)([]);
  const prevViewParamsRef = (0, import_element62.useRef)({
    search: void 0,
    filters: void 0,
    perPage: void 0
  });
  const scrollDirectionRef = (0, import_element62.useRef)(void 0);
  const prevStartPositionRef = (0, import_element62.useRef)(void 0);
  const hasInitializedRef = (0, import_element62.useRef)(false);
  const allLoadedRecords = (0, import_element62.useMemo)(() => {
    if (view.startPosition !== void 0 && prevStartPositionRef.current !== void 0) {
      if (view.startPosition < prevStartPositionRef.current) {
        scrollDirectionRef.current = "up";
      } else if (view.startPosition > prevStartPositionRef.current) {
        scrollDirectionRef.current = "down";
      }
    }
    prevStartPositionRef.current = view.startPosition;
    const currentFiltersKey = JSON.stringify(view.filters ?? []);
    const prevFiltersKey = prevViewParamsRef.current.filters;
    const shouldReset = !hasInitializedRef.current || !view.infiniteScrollEnabled || view.search !== prevViewParamsRef.current.search || currentFiltersKey !== prevFiltersKey || view.perPage !== prevViewParamsRef.current.perPage;
    hasInitializedRef.current = true;
    prevViewParamsRef.current = {
      search: view.search,
      filters: currentFiltersKey,
      perPage: view.perPage
    };
    if (shouldReset) {
      positionMapRef.current.clear();
      scrollDirectionRef.current = void 0;
      const startPosition = view.search ? 1 : view.startPosition ?? 1;
      const records = shownData.map((record, index) => {
        const position = startPosition + index;
        positionMapRef.current.set(getItemId(record), position);
        return {
          ...record,
          position
        };
      });
      allLoadedRecordsRef.current = records;
      return records;
    }
    const prev = allLoadedRecordsRef.current;
    const shownDataIds = new Set(shownData.map(getItemId));
    const scrollDirection = scrollDirectionRef.current;
    const basePosition = view.search ? 1 : view.startPosition ?? 1;
    const newRecords = shownData.map((record, index) => {
      const itemId = getItemId(record);
      const position = view.infiniteScrollEnabled ? basePosition + index : void 0;
      if (position !== void 0) {
        positionMapRef.current.set(itemId, position);
      }
      return {
        ...record,
        position
      };
    });
    if (newRecords.length === 0) {
      return prev;
    }
    const prevWithoutDuplicates = prev.filter(
      (record) => !shownDataIds.has(getItemId(record))
    );
    const allRecords = scrollDirection === "up" ? [...newRecords, ...prevWithoutDuplicates] : [...prevWithoutDuplicates, ...newRecords];
    allRecords.sort((a2, b2) => {
      const posA = a2.position;
      const posB = b2.position;
      return posA - posB;
    });
    let result = allRecords;
    if (visibleEntries.length > 0) {
      const visibleMin = Math.min(...visibleEntries);
      const visibleMax = Math.max(...visibleEntries);
      const buffer = 20;
      const recordPositions = allRecords.map(
        (r3) => r3.position
      );
      const minRecordPos = Math.min(...recordPositions);
      const maxRecordPos = Math.max(...recordPositions);
      const hasOverlap = !(maxRecordPos < visibleMin - buffer || minRecordPos > visibleMax + buffer);
      if (hasOverlap) {
        result = allRecords.filter((record) => {
          const itemId = getItemId(record);
          const isSelected2 = selection?.includes(itemId);
          if (isSelected2) {
            return true;
          }
          const itemPosition = record.position;
          if (scrollDirection === "up") {
            return itemPosition <= visibleMax + buffer;
          } else if (scrollDirection === "down") {
            return itemPosition >= visibleMin - buffer;
          }
          return itemPosition >= visibleMin - buffer && itemPosition <= visibleMax + buffer;
        });
      }
    }
    allLoadedRecordsRef.current = result;
    return result;
  }, [
    shownData,
    view.search,
    view.filters,
    view.perPage,
    view.startPosition,
    view.infiniteScrollEnabled,
    visibleEntries,
    selection,
    getItemId
  ]);
  if (!isInfiniteScrollEnabled) {
    const dataToReturn = isLoading && previousDataRef.current?.length ? previousDataRef.current : shownData;
    return {
      data: dataToReturn.map((item) => ({
        ...item,
        position: void 0
      })),
      paginationInfo: isLoading && previousDataRef.current?.length ? previousPaginationInfoRef.current : paginationInfo,
      hasInitiallyLoaded,
      setVisibleEntries: void 0
    };
  }
  return {
    data: allLoadedRecords,
    paginationInfo,
    hasInitiallyLoaded,
    setVisibleEntries
  };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/hooks/use-infinite-scroll.mjs
var import_element63 = __toESM(require_element(), 1);
var import_compose12 = __toESM(require_compose(), 1);
function captureAnchorElement(container, anchorElementRef, direction) {
  const containerRect = container.getBoundingClientRect();
  const centerY = containerRect.top + containerRect.height / 2;
  const items = Array.from(container.querySelectorAll("[aria-posinset]"));
  if (items.length === 0) {
    return false;
  }
  const bestAnchor = items.reduce((best, item) => {
    const itemRect = item.getBoundingClientRect();
    const itemCenterY = itemRect.top + itemRect.height / 2;
    const distance = Math.abs(itemCenterY - centerY);
    const bestRect = best.getBoundingClientRect();
    const bestCenterY = bestRect.top + bestRect.height / 2;
    const bestDistance = Math.abs(bestCenterY - centerY);
    return distance < bestDistance ? item : best;
  });
  const posinset = Number(bestAnchor.getAttribute("aria-posinset"));
  const anchorRect = bestAnchor.getBoundingClientRect();
  anchorElementRef.current = {
    posinset,
    viewportOffset: anchorRect.top - containerRect.top,
    direction
  };
  return true;
}
function useInfiniteScroll({
  view,
  onChangeView,
  isLoading,
  paginationInfo,
  containerRef,
  setVisibleEntries
}) {
  const anchorElementRef = (0, import_element63.useRef)(null);
  const viewRef = (0, import_element63.useRef)(view);
  const isLoadingRef = (0, import_element63.useRef)(isLoading);
  const onChangeViewRef = (0, import_element63.useRef)(onChangeView);
  const totalItemsRef = (0, import_element63.useRef)(paginationInfo.totalItems);
  (0, import_element63.useLayoutEffect)(() => {
    viewRef.current = view;
    isLoadingRef.current = isLoading;
    onChangeViewRef.current = onChangeView;
    totalItemsRef.current = paginationInfo.totalItems;
  }, [view, isLoading, onChangeView, paginationInfo.totalItems]);
  const intersectionObserverCallback = (0, import_element63.useCallback)(
    (entries) => {
      if (!setVisibleEntries) {
        return;
      }
      setVisibleEntries((prev) => {
        const newVisibleEntries = new Set(prev);
        let hasChanged = false;
        entries.forEach((entry) => {
          const posInSet = Number(
            entry.target?.attributes?.getNamedItem(
              "aria-posinset"
            )?.value
          );
          if (isNaN(posInSet)) {
            return;
          }
          if (entry.isIntersecting) {
            if (!newVisibleEntries.has(posInSet)) {
              newVisibleEntries.add(posInSet);
              hasChanged = true;
            }
          } else if (newVisibleEntries.has(posInSet)) {
            newVisibleEntries.delete(posInSet);
            hasChanged = true;
          }
        });
        return hasChanged ? Array.from(newVisibleEntries).sort() : prev;
      });
    },
    [setVisibleEntries]
  );
  (0, import_element63.useLayoutEffect)(() => {
    const container = containerRef.current;
    const anchor = anchorElementRef.current;
    if (!container || !view.infiniteScrollEnabled || !anchor || isLoading) {
      return;
    }
    const anchorElement = container.querySelector(
      `[aria-posinset="${anchor.posinset}"]`
    );
    if (anchorElement) {
      const containerRect = container.getBoundingClientRect();
      const anchorRect = anchorElement.getBoundingClientRect();
      const currentOffset = anchorRect.top - containerRect.top;
      const scrollAdjustment = currentOffset - anchor.viewportOffset;
      if (Math.abs(scrollAdjustment) > 1) {
        container.scrollTop += scrollAdjustment;
      }
    }
    anchorElementRef.current = null;
  }, [containerRef, isLoading, view.infiniteScrollEnabled]);
  const intersectionObserverRef = (0, import_element63.useRef)(
    null
  );
  (0, import_element63.useEffect)(() => {
    if (!view.infiniteScrollEnabled || !intersectionObserverCallback) {
      if (intersectionObserverRef.current) {
        intersectionObserverRef.current.disconnect();
        intersectionObserverRef.current = null;
      }
      return;
    }
    intersectionObserverRef.current = new IntersectionObserver(
      intersectionObserverCallback,
      { root: null, rootMargin: "0px", threshold: 0.1 }
    );
    return () => {
      if (intersectionObserverRef.current) {
        intersectionObserverRef.current.disconnect();
        intersectionObserverRef.current = null;
      }
    };
  }, [view.infiniteScrollEnabled, intersectionObserverCallback]);
  (0, import_element63.useEffect)(() => {
    if (!view.infiniteScrollEnabled || !containerRef.current) {
      return;
    }
    let lastScrollTop = 0;
    const BOTTOM_THRESHOLD = 600;
    const TOP_THRESHOLD = 800;
    const handleScroll = (0, import_compose12.throttle)((event) => {
      const currentView = viewRef.current;
      const totalItems = totalItemsRef.current;
      const target = event.target;
      const scrollTop = target.scrollTop;
      const scrollHeight = target.scrollHeight;
      const clientHeight = target.clientHeight;
      const scrollDirection = scrollTop > lastScrollTop ? "down" : "up";
      lastScrollTop = scrollTop;
      if (isLoadingRef.current) {
        return;
      }
      const currentStartPosition = currentView.startPosition || 1;
      const batchSize = currentView.perPage || 10;
      const currentEndPosition = Math.min(
        currentStartPosition + batchSize,
        totalItems
      );
      if (scrollDirection === "down" && scrollTop + clientHeight >= scrollHeight - BOTTOM_THRESHOLD) {
        if (currentEndPosition < totalItems) {
          const newStartPosition = currentEndPosition;
          captureAnchorElement(target, anchorElementRef, "down");
          onChangeViewRef.current({
            ...currentView,
            startPosition: newStartPosition
          });
        }
      }
      if (scrollDirection === "up" && scrollTop <= TOP_THRESHOLD) {
        if (currentStartPosition > 1) {
          const calculatedStartPosition = currentStartPosition - batchSize;
          const newStartPosition = calculatedStartPosition < 6 ? 1 : calculatedStartPosition;
          captureAnchorElement(target, anchorElementRef, "up");
          onChangeViewRef.current({
            ...currentView,
            startPosition: newStartPosition
          });
        }
      }
    }, 50);
    const container = containerRef.current;
    container.addEventListener("scroll", handleScroll);
    return () => {
      container.removeEventListener("scroll", handleScroll);
      handleScroll.cancel();
    };
  }, [containerRef, view.infiniteScrollEnabled]);
  return {
    intersectionObserver: intersectionObserverRef.current
  };
}

// ../../../node_modules/.pnpm/@wordpress+dataviews@14.0.0_@types+react@18.3.28_react@18.3.1_stylelint@17.7.0/node_modules/@wordpress/dataviews/build-module/dataviews/index.mjs
var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1);
var defaultGetItemId = (item) => item.id;
var defaultIsItemClickable = () => true;
var EMPTY_ARRAY7 = [];
var dataViewsLayouts = VIEW_LAYOUTS.filter(
  (viewLayout) => !viewLayout.isPicker
);
function DefaultUI({
  header,
  search = true,
  searchLabel = void 0
}) {
  const { view } = (0, import_element64.useContext)(dataviews_context_default);
  const isInfiniteScroll = view.infiniteScrollEnabled;
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(import_jsx_runtime115.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
      Stack,
      {
        direction: "row",
        align: "top",
        justify: "space-between",
        className: clsx_default("dataviews__view-actions", {
          "dataviews__view-actions--infinite-scroll": isInfiniteScroll
        }),
        gap: "xs",
        children: [
          /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(
            Stack,
            {
              direction: "row",
              justify: "start",
              gap: "sm",
              className: "dataviews__search",
              children: [
                search && /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(dataviews_search_default, { label: searchLabel }),
                /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(toggle_default, {})
              ]
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime115.jsxs)(Stack, { direction: "row", gap: "xs", style: { flexShrink: 0 }, children: [
            /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(dataviews_view_config_default, {}),
            header
          ] })
        ]
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(filters_toggled_default, { className: "dataviews-filters__container" }),
    /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DataViewsLayout, {}),
    /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(DataViewsFooter, {})
  ] });
}
function DataViews({
  view,
  onChangeView,
  fields,
  search = true,
  searchLabel = void 0,
  actions: actions2 = EMPTY_ARRAY7,
  data,
  getItemId = defaultGetItemId,
  getItemLevel,
  isLoading = false,
  paginationInfo,
  defaultLayouts: defaultLayoutsProperty,
  selection: selectionProperty,
  onChangeSelection,
  onClickItem,
  renderItemLink,
  isItemClickable = defaultIsItemClickable,
  header,
  children,
  config = { perPageSizes: [10, 20, 50, 100] },
  empty,
  onReset
}) {
  const [selectionState, setSelectionState] = (0, import_element64.useState)([]);
  const isUncontrolled = selectionProperty === void 0 || onChangeSelection === void 0;
  const selection = isUncontrolled ? selectionState : selectionProperty;
  const {
    data: displayData,
    paginationInfo: displayPaginationInfo,
    hasInitiallyLoaded,
    setVisibleEntries
  } = useData({
    view,
    data,
    getItemId,
    isLoading,
    selection,
    paginationInfo
  });
  const containerRef = (0, import_element64.useRef)(null);
  const [containerWidth, setContainerWidth] = (0, import_element64.useState)(0);
  const resizeObserverRef = (0, import_compose13.useResizeObserver)(
    (resizeObserverEntries) => {
      setContainerWidth(
        resizeObserverEntries[0].borderBoxSize[0].inlineSize
      );
    },
    { box: "border-box" }
  );
  const [openedFilter, setOpenedFilter] = (0, import_element64.useState)(null);
  function setSelectionWithChange(value) {
    const newValue = typeof value === "function" ? value(selection) : value;
    if (isUncontrolled) {
      setSelectionState(newValue);
    }
    if (onChangeSelection) {
      onChangeSelection(newValue);
    }
  }
  const _fields = (0, import_element64.useMemo)(() => normalizeFields(fields), [fields]);
  const _selection = (0, import_element64.useMemo)(() => {
    if (view.infiniteScrollEnabled) {
      return selection;
    }
    return selection.filter(
      (id) => data.some((item) => getItemId(item) === id)
    );
  }, [selection, data, getItemId, view.infiniteScrollEnabled]);
  const filters2 = use_filters_default(_fields, view);
  const hasPrimaryOrLockedFilters = (0, import_element64.useMemo)(
    () => (filters2 || []).some(
      (filter) => filter.isPrimary || filter.isLocked
    ),
    [filters2]
  );
  const [isShowingFilter, setIsShowingFilter] = (0, import_element64.useState)(
    hasPrimaryOrLockedFilters
  );
  const { intersectionObserver } = useInfiniteScroll({
    view,
    onChangeView,
    isLoading,
    paginationInfo,
    containerRef,
    setVisibleEntries
  });
  (0, import_element64.useEffect)(() => {
    if (hasPrimaryOrLockedFilters && !isShowingFilter) {
      setIsShowingFilter(true);
    }
  }, [hasPrimaryOrLockedFilters, isShowingFilter]);
  const defaultLayouts2 = (0, import_element64.useMemo)(
    () => Object.fromEntries(
      Object.entries(defaultLayoutsProperty).filter(
        ([layoutType]) => {
          return dataViewsLayouts.some(
            (viewLayout) => viewLayout.type === layoutType
          );
        }
      )
    ),
    [defaultLayoutsProperty]
  );
  if (!defaultLayouts2[view.type]) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
    dataviews_context_default.Provider,
    {
      value: {
        view,
        onChangeView,
        fields: _fields,
        actions: actions2,
        data: displayData,
        isLoading,
        paginationInfo: displayPaginationInfo,
        selection: _selection,
        onChangeSelection: setSelectionWithChange,
        openedFilter,
        setOpenedFilter,
        getItemId,
        getItemLevel,
        isItemClickable,
        onClickItem,
        renderItemLink,
        containerWidth,
        containerRef,
        resizeObserverRef,
        defaultLayouts: defaultLayouts2,
        filters: filters2,
        isShowingFilter,
        setIsShowingFilter,
        config,
        empty,
        hasInitiallyLoaded,
        onReset,
        intersectionObserver
      },
      children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)("div", { className: "dataviews-wrapper", children: children ?? /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(
        DefaultUI,
        {
          header,
          search,
          searchLabel
        }
      ) })
    }
  );
}
var DataViewsSubComponents = DataViews;
DataViewsSubComponents.BulkActionToolbar = BulkActionsFooter;
DataViewsSubComponents.Filters = filters_default;
DataViewsSubComponents.FiltersToggled = filters_toggled_default;
DataViewsSubComponents.FiltersToggle = toggle_default;
DataViewsSubComponents.Layout = DataViewsLayout;
DataViewsSubComponents.LayoutSwitcher = ViewTypeMenu;
DataViewsSubComponents.Pagination = DataViewsPagination;
DataViewsSubComponents.Search = dataviews_search_default;
DataViewsSubComponents.ViewConfig = DataviewsViewConfigDropdown;
DataViewsSubComponents.Footer = DataViewsFooter;
var dataviews_default = DataViewsSubComponents;

// routes/forms/stage.tsx
var import_date9 = __toESM(require_date());
var import_element102 = __toESM(require_element());
var import_i18n88 = __toESM(require_i18n());
import { useSearch as useSearch2, useNavigate as useNavigate4 } from "@wordpress/route";

// src/blocks/contact-form/components/jetpack-integrations-modal/index.tsx
var import_components61 = __toESM(require_components(), 1);
var import_i18n60 = __toESM(require_i18n(), 1);

// src/blocks/contact-form/components/jetpack-integrations-modal/integrations-list.tsx
var import_element74 = __toESM(require_element(), 1);

// ../../js-packages/components/build/tools/jp-redirect/index.js
function getRedirectUrl(source, args = {}) {
  const queryVars = {};
  let calypsoEnv;
  if (typeof window !== "undefined") {
    calypsoEnv = window?.JP_CONNECTION_INITIAL_STATE?.calypsoEnv;
  }
  if (source.search("https://") === 0) {
    const parsedUrl = new URL(source);
    source = `https://${parsedUrl.host}${parsedUrl.pathname}`;
    queryVars.url = encodeURIComponent(source);
  } else {
    queryVars.source = encodeURIComponent(source);
  }
  for (const argName in args) {
    queryVars[argName] = encodeURIComponent(args[argName]);
  }
  if (!Object.keys(queryVars).includes("site") && typeof jetpack_redirects !== "undefined" && Object.hasOwn(jetpack_redirects, "currentSiteRawUrl")) {
    queryVars.site = jetpack_redirects.currentBlogID ?? jetpack_redirects.currentSiteRawUrl;
  }
  if (calypsoEnv) {
    queryVars.calypso_env = calypsoEnv;
  }
  const queryString = Object.keys(queryVars).map((key) => key + "=" + queryVars[key]).join("&");
  return `https://jetpack.com/redirect/?` + queryString;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/akismet.tsx
var import_components48 = __toESM(require_components(), 1);
var import_element65 = __toESM(require_element(), 1);
var import_i18n45 = __toESM(require_i18n(), 1);

// src/icons/akismet.tsx
var import_i18n44 = __toESM(require_i18n(), 1);
var import_primitives32 = __toESM(require_primitives(), 1);
var import_jsx_runtime116 = __toESM(require_jsx_runtime(), 1);
var AkismetIcon = (props) => {
  return /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(
    import_primitives32.SVG,
    {
      width: props.width || 46,
      height: props.height || 46,
      viewBox: "0 0 46 46",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      role: "img",
      "aria-label": (0, import_i18n44.__)("Akismet icon", "jetpack-forms"),
      ...props,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives32.Rect, { width: "46", height: "46", rx: "8", fill: "#357B49" }),
        /* @__PURE__ */ (0, import_jsx_runtime116.jsxs)(import_primitives32.G, { clipPath: "url(#clip0_3308_44290)", children: [
          /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
            import_primitives32.Path,
            {
              d: "M24.4162 12.0335L31.0989 29.5939C31.6753 31.0964 32.5607 31.641 34.0748 31.7683C34.1301 31.7708 34.1843 31.7847 34.2341 31.8089C34.2839 31.8332 34.3281 31.8675 34.3641 31.9095C34.4001 31.9515 34.4271 32.0005 34.4435 32.0534C34.4598 32.1063 34.4651 32.162 34.459 32.217C34.4613 32.2738 34.4522 32.3305 34.4324 32.3837C34.4125 32.437 34.3823 32.4858 34.3435 32.5274C34.3046 32.5689 34.2579 32.6023 34.2061 32.6257C34.1542 32.6491 34.0982 32.6619 34.0414 32.6635H26.7218C26.6626 32.665 26.6037 32.6544 26.5488 32.6325C26.4938 32.6106 26.4438 32.5778 26.4019 32.536C26.3599 32.4943 26.3268 32.4445 26.3047 32.3897C26.2825 32.3349 26.2716 32.2761 26.2728 32.217C26.2684 32.1596 26.276 32.1019 26.2951 32.0476C26.3141 31.9933 26.3442 31.9435 26.3834 31.9014C26.4227 31.8593 26.4702 31.8257 26.523 31.8028C26.5758 31.7799 26.6328 31.7681 26.6904 31.7683C27.4255 31.7683 28.2588 31.5763 28.2588 30.6811C28.2523 30.3078 28.1758 29.939 28.0332 29.5939L26.4294 25.3389C26.3646 25.1469 26.3333 25.0822 26.1412 25.0822H20.0328C19.0722 25.0822 17.8881 25.0822 17.3431 26.2988L15.8812 29.5939C15.7326 29.8928 15.6452 30.2185 15.6244 30.5517C15.6244 31.7036 17.13 31.7683 17.9215 31.7683C17.9791 31.7681 18.0361 31.7799 18.0889 31.8028C18.1418 31.8257 18.1893 31.8593 18.2285 31.9014C18.2677 31.9435 18.2978 31.9933 18.3169 32.0476C18.3359 32.1019 18.3435 32.1596 18.3392 32.217C18.3404 32.2762 18.3294 32.335 18.3071 32.3899C18.2848 32.4448 18.2515 32.4945 18.2093 32.5361C18.1671 32.5777 18.1168 32.6103 18.0616 32.6318C18.0064 32.6534 17.9474 32.6635 17.8881 32.6615H11.3934C11.3343 32.6629 11.2756 32.6523 11.2207 32.6304C11.1658 32.6084 11.116 32.5756 11.0742 32.5338C11.0324 32.4921 10.9995 32.4423 10.9776 32.3875C10.9556 32.3326 10.9451 32.2739 10.9465 32.2149C10.9422 32.1575 10.9498 32.0998 10.9688 32.0455C10.9879 31.9912 11.0179 31.9414 11.0572 31.8993C11.0964 31.8572 11.1439 31.8236 11.1967 31.8007C11.2496 31.7778 11.3066 31.7661 11.3642 31.7662C12.9325 31.6702 13.4525 30.9315 14.0518 29.5918L21.7661 12.7033C22.1191 11.9667 22.8876 11.3281 23.5913 11.3281C24.0967 11.3302 24.2575 11.6182 24.4162 12.0335ZM18.5689 23.4837C18.5302 23.5406 18.5078 23.607 18.5042 23.6757C18.5042 23.7404 18.5689 23.7717 18.6963 23.7717H25.0344C25.4813 23.7717 25.6734 23.6757 25.6734 23.3877C25.6728 23.2432 25.64 23.1006 25.5773 22.9704L23.8169 18.2354C23.3992 17.1482 22.7936 15.7104 22.6015 14.5251C22.6015 14.4625 22.5681 14.4291 22.5367 14.4291C22.5054 14.4291 22.4741 14.4625 22.4741 14.5251C22.2337 15.3401 21.9228 16.1326 21.5448 16.8936L18.5689 23.4837Z",
              fill: "white"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
            import_primitives32.Path,
            {
              d: "M24.4162 12.0335L31.0989 29.5939C31.6753 31.0964 32.5607 31.641 34.0748 31.7683C34.1301 31.7708 34.1843 31.7847 34.2341 31.809C34.2839 31.8332 34.3281 31.8675 34.3641 31.9095C34.4001 31.9516 34.4271 32.0005 34.4435 32.0534C34.4598 32.1063 34.4651 32.162 34.459 32.217C34.4613 32.2738 34.4522 32.3305 34.4324 32.3837C34.4125 32.437 34.3823 32.4858 34.3435 32.5274C34.3046 32.5689 34.2579 32.6023 34.2061 32.6257C34.1542 32.6491 34.0982 32.6619 34.0414 32.6636H26.7218C26.6626 32.665 26.6037 32.6544 26.5488 32.6325C26.4938 32.6106 26.4438 32.5778 26.4019 32.536C26.3599 32.4943 26.3268 32.4445 26.3047 32.3897C26.2825 32.3349 26.2716 32.2761 26.2728 32.217C26.2684 32.1596 26.276 32.1019 26.2951 32.0476C26.3141 31.9933 26.3442 31.9435 26.3834 31.9014C26.4227 31.8593 26.4702 31.8257 26.523 31.8028C26.5758 31.7799 26.6328 31.7682 26.6904 31.7683C27.4255 31.7683 28.2588 31.5763 28.2588 30.6811C28.2523 30.3078 28.1758 29.939 28.0332 29.5939L26.4294 25.3389C26.3647 25.1469 26.3333 25.0822 26.1412 25.0822H20.0328C19.0722 25.0822 17.8881 25.0822 17.3431 26.2988L15.8812 29.5939C15.7326 29.8929 15.6452 30.2185 15.6244 30.5517C15.6244 31.7036 17.13 31.7683 17.9215 31.7683C17.9791 31.7682 18.0361 31.7799 18.0889 31.8028C18.1418 31.8257 18.1893 31.8593 18.2285 31.9014C18.2677 31.9435 18.2978 31.9933 18.3169 32.0476C18.3359 32.1019 18.3435 32.1596 18.3392 32.217C18.3404 32.2762 18.3294 32.335 18.3071 32.3899C18.2848 32.4448 18.2515 32.4945 18.2093 32.5361C18.1671 32.5777 18.1168 32.6103 18.0616 32.6318C18.0064 32.6534 17.9474 32.6635 17.8881 32.6615H11.3934C11.3343 32.6629 11.2756 32.6523 11.2207 32.6304C11.1658 32.6084 11.116 32.5756 11.0742 32.5339C11.0324 32.4921 10.9995 32.4423 10.9776 32.3875C10.9556 32.3326 10.9451 32.2739 10.9465 32.2149C10.9422 32.1575 10.9498 32.0999 10.9688 32.0455C10.9879 31.9912 11.0179 31.9415 11.0572 31.8993C11.0964 31.8572 11.1439 31.8236 11.1967 31.8007C11.2496 31.7778 11.3066 31.7661 11.3642 31.7662C12.9325 31.6702 13.4525 30.9315 14.0518 29.5918L21.7661 12.7033C22.1191 11.9667 22.8876 11.3281 23.5913 11.3281C24.0967 11.3302 24.2575 11.6182 24.4162 12.0335ZM18.5689 23.4837C18.5302 23.5406 18.5078 23.607 18.5042 23.6757C18.5042 23.7404 18.5689 23.7717 18.6963 23.7717H25.0344C25.4813 23.7717 25.6734 23.6757 25.6734 23.3877C25.6728 23.2432 25.64 23.1006 25.5774 22.9704L23.8169 18.2354C23.3992 17.1482 22.7936 15.7104 22.6015 14.5251C22.6015 14.4625 22.5681 14.4291 22.5367 14.4291C22.5054 14.4291 22.4741 14.4625 22.4741 14.5251C22.2337 15.3401 21.9228 16.1326 21.5448 16.8936L18.5689 23.4837Z",
              fill: "white"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
            import_primitives32.Path,
            {
              d: "M36.4557 22.7333C36.4557 23.5555 35.99 24.0209 35.1484 24.0209C34.3068 24.0209 33.9727 23.5931 33.9727 22.9399C33.9727 22.1177 34.4592 21.6523 35.28 21.6523C36.1007 21.6523 36.4557 22.0989 36.4557 22.7333Z",
              fill: "white"
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
            import_primitives32.Path,
            {
              d: "M11.3739 22.7588C11.3739 23.5789 10.9061 24.0464 10.0666 24.0464C9.22712 24.0464 8.88672 23.6165 8.88672 22.9633C8.88672 22.1432 9.3733 21.6758 10.194 21.6758C11.0147 21.6758 11.3739 22.1244 11.3739 22.7588Z",
              fill: "white"
            }
          )
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives32.Defs, { children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)("clipPath", { id: "clip0_3308_44290", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(
          import_primitives32.Rect,
          {
            width: "27.5556",
            height: "21.3333",
            fill: "white",
            transform: "translate(8.89062 11.332)"
          }
        ) }) })
      ]
    }
  );
};
var akismet_default = AkismetIcon;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/akismet.tsx
var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1);
function buildAkismetCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers
}) {
  const isConnected = !!integration.isConnected;
  const settingsUrl = integration.settingsUrl || "";
  const marketingUrl = integration.marketingUrl || "";
  const details = integration.details || {};
  const spamUrl = details.formSubmissionsSpamUrl || "";
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(akismet_default, { width: 28, height: 28 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      headerToggleValue: isConnected,
      isHeaderToggleEnabled: false,
      notInstalledMessage: (0, import_element65.createInterpolateElement)(
        (0, import_i18n45.__)(
          "Add one-click spam protection for your forms with <a>Akismet</a>. Simply install the plugin and you're set.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components48.ExternalLink, { href: marketingUrl, children: null }) }
      ),
      notActivatedMessage: (0, import_i18n45.__)(
        "Akismet is installed. Just activate the plugin to start blocking spam.",
        "jetpack-forms"
      ),
      trackEventName: "jetpack_forms_upsell_akismet_click"
    },
    toggleTooltip: (0, import_i18n45.__)("We keep your forms protected", "jetpack-forms"),
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("p", { className: "integration-card__description", children: (0, import_element65.createInterpolateElement)(
        (0, import_i18n45.__)(
          "Akismet is active. There is one step left. Please add your <a>Akismet key</a>.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components48.ExternalLink, { href: settingsUrl, children: null }) }
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(
        import_components48.Button,
        {
          variant: "secondary",
          href: settingsUrl,
          target: "_blank",
          rel: "noopener noreferrer",
          __next40pxDefaultSize: true,
          children: (0, import_i18n45.__)("Add Akismet key", "jetpack-forms")
        }
      )
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("p", { className: "integration-card__description", children: (0, import_i18n45.__)("Your forms are automatically protected with Akismet.", "jetpack-forms") }),
      /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_components48.__experimentalHStack, { spacing: "2", justify: "start", className: "integration-card__links", children: [
        context === "dashboard" && handlers?.goToSpam ? /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components48.Button, { variant: "link", onClick: handlers.goToSpam, children: (0, import_i18n45.__)("View spam", "jetpack-forms") }) : /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components48.Button, { variant: "link", href: spamUrl, target: "_blank", rel: "noopener noreferrer", children: (0, import_i18n45.__)("View spam", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { children: "|" }),
        settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime117.jsxs)(import_jsx_runtime117.Fragment, { children: [
          /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components48.Button, { variant: "link", href: settingsUrl, target: "_blank", rel: "noopener noreferrer", children: (0, import_i18n45.__)("View stats and settings", "jetpack-forms") }),
          /* @__PURE__ */ (0, import_jsx_runtime117.jsx)("span", { children: "|" })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_components48.ExternalLink, { href: getRedirectUrl("akismet-jetpack-forms-docs"), children: (0, import_i18n45.__)("Learn about Akismet", "jetpack-forms") })
      ] })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/google-drive.tsx
var import_components51 = __toESM(require_components(), 1);
var import_i18n48 = __toESM(require_i18n(), 1);

// src/icons/google-sheets.tsx
var import_primitives33 = __toESM(require_primitives(), 1);
var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1);
var GoogleSheetsIcon = (props) => {
  return /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_primitives33.SVG, { viewBox: "0 0 64 88", width: props.width || 28, height: props.height || 28, ...props, children: [
    /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives33.Path, { d: "M 42,0 64,22 53,24 42,22 40,11 Z", fill: "#188038" }),
    /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
      import_primitives33.Path,
      {
        d: "M 42,22 V 0 H 6 C 2.685,0 0,2.685 0,6 v 76 c 0,3.315 2.685,6 6,6 h 52 c 3.315,0 6,-2.685 6,-6 V 22 Z",
        fill: "#34a853"
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(
      import_primitives33.Path,
      {
        d: "M 12,34 V 63 H 52 V 34 Z M 29.5,58 H 17 v -7 h 12.5 z m 0,-12 H 17 V 39 H 29.5 Z M 47,58 H 34.5 V 51 H 47 Z M 47,46 H 34.5 V 39 H 47 Z",
        fill: "#fff"
      }
    )
  ] });
};
var google_sheets_default = GoogleSheetsIcon;

// ../../../node_modules/.pnpm/@automattic+popup-monitor@1.0.2/node_modules/@automattic/popup-monitor/dist/esm/index.js
var import_events8 = __toESM(require_events());
function Emitter(prototype) {
  Object.assign(prototype, import_events8.EventEmitter.prototype);
  prototype.emitChange = function() {
    this.emit("change");
  };
  prototype.off = prototype.removeListener;
}
function PopupMonitor() {
  this.intervals = {};
  this.monitorInterval = null;
  this.windowInstance = null;
  this.onMessage = (messageEvent) => {
    if (messageEvent.source === this.windowInstance) {
      this.emit("message", messageEvent.data);
    }
  };
}
Emitter(PopupMonitor.prototype);
PopupMonitor.prototype.open = function(url, name, specs) {
  name = name || Date.now();
  this.windowInstance = window.open(url, name, specs);
  this.startMonitoring(name, this.windowInstance);
  window.addEventListener("message", this.onMessage, false);
  return this;
};
PopupMonitor.prototype.getScreenCenterSpecs = function(width, height) {
  const screenTop = typeof window.screenTop !== "undefined" ? window.screenTop : window.screenY;
  const screenLeft = typeof window.screenLeft !== "undefined" ? window.screenLeft : window.screenX;
  return ["width=" + width, "height=" + height, "top=" + (screenTop + window.innerHeight / 2 - height / 2), "left=" + (screenLeft + window.innerWidth / 2 - width / 2)].join();
};
PopupMonitor.prototype.isOpen = function(name) {
  let isClosed = false;
  try {
    isClosed = this.intervals[name] && this.intervals[name].closed;
  } catch (e2) {
  }
  return !isClosed;
};
PopupMonitor.prototype.checkStatus = function() {
  for (const name in this.intervals) {
    if (this.intervals.hasOwnProperty(name) && !this.isOpen(name)) {
      this.emit("close", name);
      delete this.intervals[name];
    }
  }
  if (0 === Object.keys(this.intervals).length) {
    clearInterval(this.monitorInterval);
    delete this.monitorInterval;
    window.removeEventListener("message", this.onMessage);
  }
};
PopupMonitor.prototype.startMonitoring = function(name, windowInstance) {
  if (!this.monitorInterval) {
    this.monitorInterval = setInterval(this.checkStatus.bind(this), 100);
  }
  this.intervals[name] = windowInstance;
};
var esm_default = PopupMonitor;

// ../../../node_modules/.pnpm/@automattic+request-external-access@1.0.1/node_modules/@automattic/request-external-access/dist/esm/index.js
var requestExternalAccess = (url, cb) => {
  const popupMonitor = new esm_default();
  let lastMessage;
  popupMonitor.open(url, null, "toolbar=0,location=0,status=0,menubar=0," + popupMonitor.getScreenCenterSpecs(780, 700));
  popupMonitor.once("close", () => {
    const result = {};
    if (lastMessage && lastMessage.keyring_id) {
      result.keyring_id = Number(lastMessage.keyring_id);
      result.id_token = lastMessage.id_token;
      result.user = lastMessage.user;
    }
    cb(result);
  });
  popupMonitor.on("message", (message2) => lastMessage = message2);
};
var esm_default2 = requestExternalAccess;

// src/blocks/contact-form/components/jetpack-integrations-modal/components/google-drive-connect-button.tsx
var import_components49 = __toESM(require_components(), 1);
var import_element66 = __toESM(require_element(), 1);
var import_i18n46 = __toESM(require_i18n(), 1);
var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1);
function GoogleDriveConnectButton({
  settingsUrl,
  onConnected,
  isConnected
}) {
  const connectingText = (0, import_i18n46.__)("Connecting\u2026", "jetpack-forms");
  const connectText = (0, import_i18n46.__)("Connect to Google Drive", "jetpack-forms");
  const [isToggling, setIsToggling] = (0, import_element66.useState)(false);
  (0, import_element66.useEffect)(() => {
    setIsToggling(false);
  }, [isConnected]);
  const handleClick = () => {
    if (!settingsUrl) return;
    setIsToggling(true);
    esm_default2(settingsUrl, ({ keyring_id: keyringId }) => {
      if (keyringId) {
        onConnected();
      } else {
        setIsToggling(false);
      }
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(
    import_components49.Button,
    {
      variant: "secondary",
      onClick: handleClick,
      __next40pxDefaultSize: true,
      disabled: !settingsUrl || isToggling,
      children: isToggling ? connectingText : connectText
    }
  );
}

// src/blocks/contact-form/components/jetpack-integrations-modal/components/google-drive-disconnect-button.tsx
var import_api_fetch = __toESM(require_api_fetch(), 1);
var import_components50 = __toESM(require_components(), 1);
var import_element67 = __toESM(require_element(), 1);
var import_i18n47 = __toESM(require_i18n(), 1);
var import_jsx_runtime120 = __toESM(require_jsx_runtime(), 1);
function GoogleDriveDisconnectButton({ onDisconnected, isConnected }) {
  const disconnectingText = (0, import_i18n47.__)("Disconnecting\u2026", "jetpack-forms");
  const disconnectText = (0, import_i18n47.__)("Disconnect Google Drive", "jetpack-forms");
  const [isToggling, setIsToggling] = (0, import_element67.useState)(false);
  (0, import_element67.useEffect)(() => {
    setIsToggling(false);
  }, [isConnected]);
  const handleClick = () => {
    setIsToggling(true);
    (0, import_api_fetch.default)({ method: "DELETE", path: "/wp/v2/feedback/integrations/google-drive" }).then((response) => {
      if (response.deleted) {
        onDisconnected();
      }
    }).finally(() => {
      setIsToggling(false);
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_components50.Button, { variant: "link", onClick: handleClick, disabled: isToggling, children: isToggling ? disconnectingText : disconnectText });
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/google-drive.tsx
var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1);
function buildGoogleDriveCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers
}) {
  const isConnected = !!integration.isConnected;
  const settingsUrl = integration.settingsUrl;
  const defaultResponsesUrl = "/wp-admin/admin.php?page=jetpack-forms-admin";
  const responsesUrl = window.jpFormsBlocks?.defaults?.formsResponsesUrl || defaultResponsesUrl;
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(google_sheets_default, { className: "google-sheets-icon" }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      slug: "google-sheets",
      showHeaderToggle: false,
      isActive: !!integration.isConnected,
      trackEventName: "jetpack_forms_upsell_googledrive_click"
    },
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "integration-card__description", children: (0, import_i18n48.__)(
        "Connect your site to Google Drive to export form responses directly to Google Sheets.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
        GoogleDriveConnectButton,
        {
          settingsUrl,
          onConnected: refreshIntegrations2,
          isConnected
        }
      )
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("p", { className: "integration-card__description", children: (0, import_i18n48.__)(
        "Google Sheets is connected. You can export your form responses from the form responses page.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_components51.__experimentalHStack, { spacing: "2", justify: "start", className: "integration-card__links", children: [
        context === "dashboard" && handlers?.goToResponses ? /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_components51.Button, { variant: "link", onClick: handlers.goToResponses, children: (0, import_i18n48.__)("View form responses", "jetpack-forms") }) : /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_components51.Button, { variant: "link", href: responsesUrl, target: "_blank", rel: "noopener noreferrer", children: (0, import_i18n48.__)("View form responses", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime121.jsx)("span", { children: "|" }),
        /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(
          GoogleDriveDisconnectButton,
          {
            onDisconnected: refreshIntegrations2,
            isConnected
          }
        )
      ] })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/hostinger-reach.tsx
var import_components52 = __toESM(require_components(), 1);
var import_element68 = __toESM(require_element(), 1);
var import_i18n50 = __toESM(require_i18n(), 1);

// src/icons/hostinger-reach.tsx
var import_i18n49 = __toESM(require_i18n(), 1);
var import_primitives34 = __toESM(require_primitives(), 1);
var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1);
var HostingerReachIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
  import_primitives34.SVG,
  {
    ...props,
    width: props.width || 30,
    height: props.height || 30,
    viewBox: "7.002 8.287 148.203 175.426",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    role: "img",
    "aria-label": (0, import_i18n49.__)("Hostinger Reach icon", "jetpack-forms"),
    children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(
      import_primitives34.Path,
      {
        d: "m7.002 8.287 39.319 21.172v39.32h57.467l36.295 21.172h-133.081zm148.203 75.615v-54.443l-42.344-21.172v51.418zm0 99.811-39.319-21.172v-39.32h-57.467l-36.295-21.172h133.081zm-148.203-75.615v54.443l42.343 21.172v-51.418z",
        fill: "#6747c7",
        fillRule: "evenodd",
        clipRule: "evenodd"
      }
    )
  }
);
var hostinger_reach_default = HostingerReachIcon;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/hostinger-reach.tsx
var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1);
function buildHostingerReachCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes,
  components
}) {
  const ConsentToggle = components?.ConsentToggle;
  const { isConnected = false, settingsUrl = "" } = integration || {};
  const enabledForForm = !!attributes?.hostingerReach?.enabledForForm;
  const groupName = attributes?.hostingerReach?.groupName ?? "";
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(hostinger_reach_default, { width: 28, height: 28 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: enabledForForm,
        isHeaderToggleEnabled: isConnected,
        onHeaderToggleChange: (value) => setAttributes?.({
          hostingerReach: {
            ...attributes?.hostingerReach ?? {},
            enabledForForm: value
          }
        })
      },
      notInstalledMessage: (0, import_element68.createInterpolateElement)(
        (0, import_i18n50.__)(
          "Add powerful email marketing to your forms with <a>Hostinger Reach</a>. Simply install the plugin to start sending emails.",
          "jetpack-forms"
        ),
        {
          a: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components52.ExternalLink, { href: integration.marketingUrl || "", children: null })
        }
      ),
      notActivatedMessage: (0, import_i18n50.__)(
        "Hostinger Reach is installed. Just activate the plugin to start sending emails.",
        "jetpack-forms"
      ),
      trackEventName: "jetpack_forms_upsell_hostinger_reach_click"
    },
    toggleTooltip: (0, import_i18n50.__)("Grow your audience with Hostinger Reach", "jetpack-forms"),
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
      /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "integration-card__description", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components52.ExternalLink, { href: settingsUrl, children: (0, import_i18n50.__)(
        "Hostinger Reach is active. There is one step left. Please complete Hostinger Reach setup.",
        "jetpack-forms"
      ) }) }),
      /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_components52.__experimentalHStack, { spacing: "3", justify: "start", children: [
        /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
          import_components52.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n50.__)("Complete Hostinger Reach setup", "jetpack-forms")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components52.Button, { variant: "tertiary", onClick: refreshIntegrations2, __next40pxDefaultSize: true, children: (0, import_i18n50.__)("Refresh status", "jetpack-forms") })
      ] })
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime123.jsxs)(import_jsx_runtime123.Fragment, { children: [
      context === "block-editor" && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("div", { className: "integration-card__section", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(
        import_components52.TextControl,
        {
          label: (0, import_i18n50.__)("Group name (optional)", "jetpack-forms"),
          help: (0, import_i18n50.__)(
            'If empty, contacts will be added under "Jetpack Forms".',
            "jetpack-forms"
          ),
          value: groupName,
          onChange: (newName) => setAttributes?.({
            hostingerReach: {
              ...attributes?.hostingerReach ?? {},
              groupName: newName
            }
          }),
          __nextHasNoMarginBottom: true
        }
      ) }),
      context === "block-editor" && ConsentToggle && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(ConsentToggle, {}),
      settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime123.jsx)("p", { className: "integration-card__description", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_components52.ExternalLink, { href: settingsUrl, children: (0, import_i18n50.__)("View Hostinger Reach dashboard", "jetpack-forms") }) })
    ] })
  };
  return base;
}

// ../../../node_modules/.pnpm/@automattic+color-studio@4.1.0/node_modules/@automattic/color-studio/dist/colors.json
var colors_default = {
  version: "4.1.0",
  colors: {
    White: "#fff",
    Black: "#000",
    "Gray 0": "#f6f7f7",
    "Gray 5": "#dcdcde",
    "Gray 10": "#c3c4c7",
    "Gray 20": "#a7aaad",
    "Gray 30": "#8c8f94",
    "Gray 40": "#787c82",
    "Gray 50": "#646970",
    "Gray 60": "#50575e",
    "Gray 70": "#3c434a",
    "Gray 80": "#2c3338",
    "Gray 90": "#1d2327",
    "Gray 100": "#101517",
    Gray: "#646970",
    "Blue 0": "#fbfcfe",
    "Blue 5": "#f7f8fe",
    "Blue 10": "#d6ddf9",
    "Blue 20": "#adbaf3",
    "Blue 30": "#7b90ff",
    "Blue 40": "#546ff3",
    "Blue 50": "#3858e9",
    "Blue 60": "#2a46ce",
    "Blue 70": "#1d35b4",
    "Blue 80": "#1f3286",
    "Blue 90": "#14215a",
    "Blue 100": "#0a112d",
    Blue: "#3858e9",
    "WordPress Blue 0": "#fbfcfe",
    "WordPress Blue 5": "#f7f8fe",
    "WordPress Blue 10": "#d6ddf9",
    "WordPress Blue 20": "#adbaf3",
    "WordPress Blue 30": "#7b90ff",
    "WordPress Blue 40": "#546ff3",
    "WordPress Blue 50": "#3858e9",
    "WordPress Blue 60": "#2a46ce",
    "WordPress Blue 70": "#1d35b4",
    "WordPress Blue 80": "#1f3286",
    "WordPress Blue 90": "#14215a",
    "WordPress Blue 100": "#0a112d",
    "WordPress Blue": "#3858e9",
    "Purple 0": "#f2e9ed",
    "Purple 5": "#ebcee0",
    "Purple 10": "#e3afd5",
    "Purple 20": "#d48fc8",
    "Purple 30": "#c475bd",
    "Purple 40": "#b35eb1",
    "Purple 50": "#984a9c",
    "Purple 60": "#7c3982",
    "Purple 70": "#662c6e",
    "Purple 80": "#4d2054",
    "Purple 90": "#35163b",
    "Purple 100": "#1e0c21",
    Purple: "#984a9c",
    "Pink 0": "#f5e9ed",
    "Pink 5": "#f2ceda",
    "Pink 10": "#f7a8c3",
    "Pink 20": "#f283aa",
    "Pink 30": "#eb6594",
    "Pink 40": "#e34c84",
    "Pink 50": "#c9356e",
    "Pink 60": "#ab235a",
    "Pink 70": "#8c1749",
    "Pink 80": "#700f3b",
    "Pink 90": "#4f092a",
    "Pink 100": "#260415",
    Pink: "#c9356e",
    "Red 0": "#f7ebec",
    "Red 5": "#facfd2",
    "Red 10": "#ffabaf",
    "Red 20": "#ff8085",
    "Red 30": "#f86368",
    "Red 40": "#e65054",
    "Red 50": "#d63638",
    "Red 60": "#b32d2e",
    "Red 70": "#8a2424",
    "Red 80": "#691c1c",
    "Red 90": "#451313",
    "Red 100": "#240a0a",
    Red: "#d63638",
    "Orange 0": "#f5ece6",
    "Orange 5": "#f7dcc6",
    "Orange 10": "#ffbf86",
    "Orange 20": "#faa754",
    "Orange 30": "#e68b28",
    "Orange 40": "#d67709",
    "Orange 50": "#b26200",
    "Orange 60": "#8a4d00",
    "Orange 70": "#704000",
    "Orange 80": "#543100",
    "Orange 90": "#361f00",
    "Orange 100": "#1f1200",
    Orange: "#b26200",
    "Yellow 0": "#f5f1e1",
    "Yellow 5": "#f5e6b3",
    "Yellow 10": "#f2d76b",
    "Yellow 20": "#f0c930",
    "Yellow 30": "#deb100",
    "Yellow 40": "#c08c00",
    "Yellow 50": "#9d6e00",
    "Yellow 60": "#7d5600",
    "Yellow 70": "#674600",
    "Yellow 80": "#4f3500",
    "Yellow 90": "#320",
    "Yellow 100": "#1c1300",
    Yellow: "#9d6e00",
    "Green 0": "#e6f2e8",
    "Green 5": "#b8e6bf",
    "Green 10": "#68de86",
    "Green 20": "#1ed15a",
    "Green 30": "#00ba37",
    "Green 40": "#00a32a",
    "Green 50": "#008a20",
    "Green 60": "#007017",
    "Green 70": "#005c12",
    "Green 80": "#00450c",
    "Green 90": "#003008",
    "Green 100": "#001c05",
    Green: "#008a20",
    "Celadon 0": "#e4f2ed",
    "Celadon 5": "#a7e8d3",
    "Celadon 10": "#66deb9",
    "Celadon 20": "#31cc9f",
    "Celadon 30": "#09b585",
    "Celadon 40": "#009e73",
    "Celadon 50": "#008763",
    "Celadon 60": "#007053",
    "Celadon 70": "#005c44",
    "Celadon 80": "#004533",
    "Celadon 90": "#003024",
    "Celadon 100": "#001c15",
    Celadon: "#008763",
    "Automattic Blue 0": "#ebf4fa",
    "Automattic Blue 5": "#c4e2f5",
    "Automattic Blue 10": "#88ccf2",
    "Automattic Blue 20": "#5ab7e8",
    "Automattic Blue 30": "#24a3e0",
    "Automattic Blue 40": "#1490c7",
    "Automattic Blue 50": "#0277a8",
    "Automattic Blue 60": "#036085",
    "Automattic Blue 70": "#02506e",
    "Automattic Blue 80": "#02384d",
    "Automattic Blue 90": "#022836",
    "Automattic Blue 100": "#021b24",
    "Automattic Blue": "#24a3e0",
    "Simplenote Blue 0": "#e9ecf5",
    "Simplenote Blue 5": "#ced9f2",
    "Simplenote Blue 10": "#abc1f5",
    "Simplenote Blue 20": "#84a4f0",
    "Simplenote Blue 30": "#618df2",
    "Simplenote Blue 40": "#4678eb",
    "Simplenote Blue 50": "#3361cc",
    "Simplenote Blue 60": "#1d4fc4",
    "Simplenote Blue 70": "#113ead",
    "Simplenote Blue 80": "#0d2f85",
    "Simplenote Blue 90": "#09205c",
    "Simplenote Blue 100": "#05102e",
    "Simplenote Blue": "#3361cc",
    "WooCommerce Purple 0": "#f2edff",
    "WooCommerce Purple 5": "#e1d7ff",
    "WooCommerce Purple 10": "#d1c1ff",
    "WooCommerce Purple 20": "#b999ff",
    "WooCommerce Purple 30": "#a77eff",
    "WooCommerce Purple 40": "#873eff",
    "WooCommerce Purple 50": "#720eec",
    "WooCommerce Purple 60": "#6108ce",
    "WooCommerce Purple 70": "#5007aa",
    "WooCommerce Purple 80": "#3c087e",
    "WooCommerce Purple 90": "#2c045d",
    "WooCommerce Purple 100": "#1f0342",
    "WooCommerce Purple": "#720eec",
    "Jetpack Green 0": "#f0f2eb",
    "Jetpack Green 5": "#d0e6b8",
    "Jetpack Green 10": "#9dd977",
    "Jetpack Green 20": "#64ca43",
    "Jetpack Green 30": "#2fb41f",
    "Jetpack Green 40": "#069e08",
    "Jetpack Green 50": "#008710",
    "Jetpack Green 60": "#007117",
    "Jetpack Green 70": "#005b18",
    "Jetpack Green 80": "#004515",
    "Jetpack Green 90": "#003010",
    "Jetpack Green 100": "#001c09",
    "Jetpack Green": "#069e08"
  }
};

// ../../js-packages/components/build/components/jetpack-logo/index.js
var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1);
var import_i18n51 = __toESM(require_i18n(), 1);
var JetpackLogo = ({ logoColor = "#069e08", showText = true, className, height = 32, title, ...otherProps }) => {
  const viewBox = showText ? "0 0 118 32" : "0 0 32 32";
  const logoTitle = title ?? (0, import_i18n51.__)("Jetpack Logo", "jetpack-components");
  return (0, import_jsx_runtime124.jsxs)("svg", {
    xmlns: "http://www.w3.org/2000/svg",
    x: "0px",
    y: "0px",
    viewBox,
    className: clsx_default("jetpack-logo", className),
    "aria-labelledby": "jetpack-logo-title",
    height,
    ...otherProps,
    // role="img" is required to prevent VoiceOver on Safari reading the content of the SVG
    role: "img",
    children: [
      (0, import_jsx_runtime124.jsx)("title", { id: "jetpack-logo-title", children: logoTitle }),
      (0, import_jsx_runtime124.jsx)("path", { fill: logoColor, d: "M16,0C7.2,0,0,7.2,0,16s7.2,16,16,16s16-7.2,16-16S24.8,0,16,0z M15,19H7l8-16V19z M17,29V13h8L17,29z" }),
      showText && (0, import_jsx_runtime124.jsxs)(import_jsx_runtime124.Fragment, { children: [
        (0, import_jsx_runtime124.jsx)("path", { d: "M41.3,26.6c-0.5-0.7-0.9-1.4-1.3-2.1c2.3-1.4,3-2.5,3-4.6V8h-3V6h6v13.4C46,22.8,45,24.8,41.3,26.6z" }),
        (0, import_jsx_runtime124.jsx)("path", { d: "M65,18.4c0,1.1,0.8,1.3,1.4,1.3c0.5,0,2-0.2,2.6-0.4v2.1c-0.9,0.3-2.5,0.5-3.7,0.5c-1.5,0-3.2-0.5-3.2-3.1V12H60v-2h2.1V7.1 H65V10h4v2h-4V18.4z" }),
        (0, import_jsx_runtime124.jsx)("path", { d: "M71,10h3v1.3c1.1-0.8,1.9-1.3,3.3-1.3c2.5,0,4.5,1.8,4.5,5.6s-2.2,6.3-5.8,6.3c-0.9,0-1.3-0.1-2-0.3V28h-3V10z M76.5,12.3 c-0.8,0-1.6,0.4-2.5,1.2v5.9c0.6,0.1,0.9,0.2,1.8,0.2c2,0,3.2-1.3,3.2-3.9C79,13.4,78.1,12.3,76.5,12.3z" }),
        (0, import_jsx_runtime124.jsx)("path", { d: "M93,22h-3v-1.5c-0.9,0.7-1.9,1.5-3.5,1.5c-1.5,0-3.1-1.1-3.1-3.2c0-2.9,2.5-3.4,4.2-3.7l2.4-0.3v-0.3c0-1.5-0.5-2.3-2-2.3 c-0.7,0-2.3,0.5-3.7,1.1L84,11c1.2-0.4,3-1,4.4-1c2.7,0,4.6,1.4,4.6,4.7L93,22z M90,16.4l-2.2,0.4c-0.7,0.1-1.4,0.5-1.4,1.6 c0,0.9,0.5,1.4,1.3,1.4s1.5-0.5,2.3-1V16.4z" }),
        (0, import_jsx_runtime124.jsx)("path", { d: "M104.5,21.3c-1.1,0.4-2.2,0.6-3.5,0.6c-4.2,0-5.9-2.4-5.9-5.9c0-3.7,2.3-6,6.1-6c1.4,0,2.3,0.2,3.2,0.5V13 c-0.8-0.3-2-0.6-3.2-0.6c-1.7,0-3.2,0.9-3.2,3.6c0,2.9,1.5,3.8,3.3,3.8c0.9,0,1.9-0.2,3.2-0.7V21.3z" }),
        (0, import_jsx_runtime124.jsx)("path", { d: "M110,15.2c0.2-0.3,0.2-0.8,3.8-5.2h3.7l-4.6,5.7l5,6.3h-3.7l-4.2-5.8V22h-3V6h3V15.2z" }),
        (0, import_jsx_runtime124.jsx)("path", { d: "M58.5,21.3c-1.5,0.5-2.7,0.6-4.2,0.6c-3.6,0-5.8-1.8-5.8-6c0-3.1,1.9-5.9,5.5-5.9s4.9,2.5,4.9,4.9c0,0.8,0,1.5-0.1,2h-7.3 c0.1,2.5,1.5,2.8,3.6,2.8c1.1,0,2.2-0.3,3.4-0.7C58.5,19,58.5,21.3,58.5,21.3z M56,15c0-1.4-0.5-2.9-2-2.9c-1.4,0-2.3,1.3-2.4,2.9 C51.6,15,56,15,56,15z" })
      ] })
    ]
  });
};
var jetpack_logo_default = JetpackLogo;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/jetpack-crm.tsx
var import_components53 = __toESM(require_components(), 1);
var import_element69 = __toESM(require_element(), 1);
var import_i18n52 = __toESM(require_i18n(), 1);
var import_semver = __toESM(require_semver2(), 1);
var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1);
var COLOR_JETPACK = colors_default.colors["Jetpack Green 40"];
function buildJetpackCrmCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes
}) {
  const { settingsUrl = "", marketingUrl = "", version: version2 = "", details = {} } = integration || {};
  const { hasExtension = false, canActivateExtension = false } = details;
  const crmVersion = import_semver.default.coerce(version2);
  const isRecentVersion = crmVersion && import_semver.default.gte(crmVersion, "4.9.1");
  const connectedMsgEditor = (0, import_i18n52.__)("This form is connected to Jetpack CRM.", "jetpack-forms");
  const connectedMsgDashboard = (0, import_i18n52.__)("Jetpack CRM is connected.", "jetpack-forms");
  const renderBody = () => {
    if (!isRecentVersion) {
      return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { className: "integration-card__description", children: (0, import_i18n52.__)(
          "Please update to the latest version of the Jetpack CRM plugin to integrate your contact form with your CRM.",
          "jetpack-forms"
        ) }),
        /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
          import_components53.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n52.__)("Update Jetpack CRM", "jetpack-forms")
          }
        )
      ] });
    }
    if (!hasExtension) {
      return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { children: [
        /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { className: "integration-card__description", children: (0, import_element69.createInterpolateElement)(
          (0, import_i18n52.__)(
            "You can integrate this contact form with Jetpack CRM by enabling Jetpack CRM's <a>Jetpack Forms extension</a>.",
            "jetpack-forms"
          ),
          {
            a: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
              import_components53.Button,
              {
                variant: "link",
                href: settingsUrl,
                target: "_blank",
                rel: "noopener noreferrer"
              }
            )
          }
        ) }),
        !canActivateExtension && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { children: (0, import_i18n52.__)(
          "A site administrator must enable the CRM Jetpack Forms extension.",
          "jetpack-forms"
        ) }),
        canActivateExtension && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(
          import_components53.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n52.__)("Enable Jetpack Forms extension", "jetpack-forms")
          }
        )
      ] });
    }
    return /* @__PURE__ */ (0, import_jsx_runtime125.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime125.jsx)("p", { className: "integration-card__description", children: context === "block-editor" ? connectedMsgEditor : connectedMsgDashboard }),
      settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_components53.ExternalLink, { href: settingsUrl, children: (0, import_i18n52.__)("Open Jetpack CRM settings", "jetpack-forms") })
    ] });
  };
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(jetpack_logo_default, { showText: false, logoColor: COLOR_JETPACK }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: !!attributes?.jetpackCRM,
        isHeaderToggleEnabled: true,
        onHeaderToggleChange: (value) => {
          setAttributes?.({ jetpackCRM: value });
        }
      },
      trackEventName: "jetpack_forms_upsell_crm_click",
      notInstalledMessage: (0, import_element69.createInterpolateElement)(
        (0, import_i18n52.__)(
          "You can save your form contacts in <a>Jetpack CRM</a>. To get started, please install the plugin.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_components53.ExternalLink, { href: marketingUrl, children: null }) }
      ),
      notActivatedMessage: (0, import_i18n52.__)(
        "Jetpack CRM is installed. To start saving contacts, simply activate the plugin.",
        "jetpack-forms"
      )
    },
    body: renderBody()
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/mailpoet.tsx
var import_components54 = __toESM(require_components(), 1);
var import_element70 = __toESM(require_element(), 1);
var import_i18n54 = __toESM(require_i18n(), 1);

// src/icons/mailpoet.tsx
var import_i18n53 = __toESM(require_i18n(), 1);
var import_primitives35 = __toESM(require_primitives(), 1);
var import_jsx_runtime126 = __toESM(require_jsx_runtime(), 1);
var MailPoetIcon = (props) => {
  return /* @__PURE__ */ (0, import_jsx_runtime126.jsxs)(
    import_primitives35.SVG,
    {
      width: props.width || 32,
      height: props.height || 32,
      viewBox: "0 0 152.02 156.4",
      fill: "none",
      xmlns: "http://www.w3.org/2000/svg",
      role: "img",
      "aria-label": (0, import_i18n53.__)("MailPoet icon", "jetpack-forms"),
      ...props,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
          import_primitives35.Path,
          {
            d: "M37.71,89.1c3.5,0,5.9-.8,7.2-2.3a8,8,0,0,0,2-5.4V35.7l17,45.1a12.68,12.68,0,0,0,3.7,5.4c1.6,1.3,4,2,7.2,2a12.54,12.54,0,0,0,5.9-1.4,8.41,8.41,0,0,0,3.9-5l18.1-50V81a8.53,8.53,0,0,0,2.1,6.1c1.4,1.4,3.7,2.2,6.9,2.2,3.5,0,5.9-.8,7.2-2.3a8,8,0,0,0,2-5.4V8.7a7.48,7.48,0,0,0-3.3-6.6c-2.1-1.4-5-2.1-8.6-2.1a19.3,19.3,0,0,0-9.4,2,11.63,11.63,0,0,0-5.1,6.8L74.91,67.1,54.41,8.4a12.4,12.4,0,0,0-4.5-6.2c-2.1-1.5-5-2.2-8.8-2.2a16.51,16.51,0,0,0-8.9,2.1c-2.3,1.5-3.5,3.9-3.5,7.2V80.8c0,2.8.7,4.8,2,6.2C32.21,88.4,34.41,89.1,37.71,89.1Z",
            fill: "#FF5301"
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(
          import_primitives35.Path,
          {
            d: "M149,116.6l-2.4-1.9a7.4,7.4,0,0,0-9.4.3,19.65,19.65,0,0,1-12.5,4.6h-21.4A37.08,37.08,0,0,0,77,130.5l-1.1,1.2-1.1-1.1a37.25,37.25,0,0,0-26.3-10.9H27a19.59,19.59,0,0,1-12.4-4.6,7.28,7.28,0,0,0-9.4-.3l-2.4,1.9A7.43,7.43,0,0,0,0,122.2a7.14,7.14,0,0,0,2.4,5.7A37.28,37.28,0,0,0,27,137.4h21.6a19.59,19.59,0,0,1,18.9,14.4v.2c.1.7,1.2,4.4,8.5,4.4s8.4-3.7,8.5-4.4v-.2a19.59,19.59,0,0,1,18.9-14.4H125a37.28,37.28,0,0,0,24.6-9.5,7.42,7.42,0,0,0,2.4-5.7A7.86,7.86,0,0,0,149,116.6Z",
            fill: "#FF5301"
          }
        )
      ]
    }
  );
};
var mailpoet_default = MailPoetIcon;

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/mailpoet.tsx
var import_jsx_runtime127 = __toESM(require_jsx_runtime(), 1);
function buildMailPoetCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes,
  components
}) {
  const ConsentToggle = components?.ConsentToggle;
  const {
    isConnected = false,
    settingsUrl = "",
    marketingUrl = ""
  } = integration || {};
  const lists = Array.isArray(integration.details?.lists) ? integration.details?.lists : [];
  const enabledForForm = !!attributes?.mailpoet?.enabledForForm;
  const selectedListId = attributes?.mailpoet?.listId ?? "";
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(mailpoet_default, { width: 28, height: 28 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: enabledForForm,
        isHeaderToggleEnabled: isConnected,
        onHeaderToggleChange: (value) => setAttributes?.({
          mailpoet: {
            ...attributes?.mailpoet ?? {},
            enabledForForm: value
          }
        })
      },
      notInstalledMessage: (0, import_element70.createInterpolateElement)(
        (0, import_i18n54.__)(
          "Add powerful email marketing to your forms with <a>MailPoet</a>. Simply install the plugin to start sending emails.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components54.ExternalLink, { href: marketingUrl, children: null }) }
      ),
      notActivatedMessage: (0, import_i18n54.__)(
        "MailPoet is installed. Just activate the plugin to start sending emails.",
        "jetpack-forms"
      ),
      trackEventName: "jetpack_forms_upsell_mailpoet_click"
    },
    toggleTooltip: (0, import_i18n54.__)("Grow your audience with MailPoet", "jetpack-forms"),
    body: !isConnected ? /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "integration-card__description", children: (0, import_element70.createInterpolateElement)(
        (0, import_i18n54.__)(
          "MailPoet is active. There is one step left. Please complete <a>MailPoet setup</a>.",
          "jetpack-forms"
        ),
        { a: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components54.ExternalLink, { href: settingsUrl, children: null }) }
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)(import_components54.__experimentalHStack, { spacing: "3", justify: "start", children: [
        /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
          import_components54.Button,
          {
            variant: "secondary",
            href: settingsUrl,
            target: "_blank",
            rel: "noopener noreferrer",
            __next40pxDefaultSize: true,
            children: (0, import_i18n54.__)("Complete MailPoet setup", "jetpack-forms")
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components54.Button, { variant: "tertiary", onClick: refreshIntegrations2, __next40pxDefaultSize: true, children: (0, import_i18n54.__)("Refresh status", "jetpack-forms") })
      ] })
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime127.jsxs)("div", { children: [
      context === "block-editor" && (lists.length ? /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(
        import_components54.SelectControl,
        {
          label: (0, import_i18n54.__)("Which email list should contacts be added to?", "jetpack-forms"),
          value: selectedListId,
          options: lists.map((list) => ({ label: list.name, value: list.id })),
          onChange: (newId) => setAttributes?.({
            mailpoet: {
              ...attributes?.mailpoet ?? {},
              listId: newId
            }
          }),
          __next40pxDefaultSize: true,
          __nextHasNoMarginBottom: true
        }
      ) : /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "integration-card__description", children: (0, import_i18n54.__)(
        'You do not have any MailPoet lists yet. Click the dashboard button below to create one, or contacts will be added to a "Jetpack Forms Subscribers" list.',
        "jetpack-forms"
      ) })),
      context === "block-editor" && ConsentToggle && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(ConsentToggle, {}),
      settingsUrl && /* @__PURE__ */ (0, import_jsx_runtime127.jsx)("p", { className: "integration-card__description", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_components54.ExternalLink, { href: settingsUrl, children: (0, import_i18n54.__)("View dashboard", "jetpack-forms") }) })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/salesforce.tsx
var import_components56 = __toESM(require_components(), 1);
var import_i18n57 = __toESM(require_i18n(), 1);

// src/icons/salesforce.tsx
var import_primitives36 = __toESM(require_primitives(), 1);
var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1);
var SalesforceIcon = (props) => /* @__PURE__ */ (0, import_jsx_runtime128.jsxs)(
  import_primitives36.SVG,
  {
    width: props.width || 46,
    height: props.height || 32,
    viewBox: "0 0 46 32",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    role: "img",
    ...props,
    children: [
      /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
        import_primitives36.Path,
        {
          fillRule: "evenodd",
          clipRule: "evenodd",
          d: "M19.0191 3.48472C20.4938 1.94961 22.5462 0.998992 24.8136 0.998992C27.8367 0.998992 30.4568 2.67854 31.8677 5.18105C33.12 4.62122 34.4764 4.33219 35.8482 4.33289C41.2899 4.33289 45.7071 8.78367 45.7071 14.2758C45.7071 19.7679 41.2899 24.2187 35.8482 24.2187C35.1831 24.2187 34.5348 24.1518 33.8999 24.0255C32.6654 26.2257 30.3057 27.7205 27.6184 27.7205C26.5243 27.7227 25.4443 27.4745 24.4609 26.995C23.2096 29.9342 20.2956 32 16.9029 32C13.3591 32 10.3527 29.7662 9.19382 26.6255C8.67803 26.7343 8.15228 26.789 7.62513 26.7887C3.40947 26.7887 0 23.3289 0 19.0796C0 16.2244 1.5351 13.7387 3.81256 12.395C3.3294 11.282 3.0807 10.0814 3.08196 8.86799C3.08196 3.96372 7.06248 0 11.9667 0C14.8388 0 17.4085 1.36883 19.0208 3.49345",
          fill: "#00A1E0"
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(
        import_primitives36.Path,
        {
          d: "M26.6607 11.1632C26.7813 11.1619 26.9021 11.1717 27.021 11.1915C27.1093 11.2069 27.1969 11.2271 27.2827 11.253C27.3016 11.2605 27.3524 11.2861 27.3316 11.3458L27.1284 11.9015C27.1115 11.9433 27.1003 11.9687 27.0142 11.9425C26.9927 11.9361 26.9605 11.9268 26.8784 11.9093C26.8188 11.8969 26.7404 11.8878 26.6607 11.8878C26.5644 11.8865 26.4685 11.9004 26.3765 11.9288C26.2927 11.9563 26.2165 12.0035 26.1548 12.0665C26.0886 12.1329 26.0098 12.23 25.9683 12.3497C25.8711 12.6301 25.8328 12.9282 25.8286 12.9474H26.6753C26.7462 12.947 26.7691 12.9796 26.7622 13.0323L26.6636 13.5831C26.6487 13.661 26.5781 13.6603 26.5747 13.6603H25.7017L25.105 17.0382C25.0424 17.3871 24.9644 17.6866 24.8726 17.9278C24.7797 18.1714 24.6822 18.3501 24.5279 18.5206C24.3852 18.6786 24.2239 18.7954 24.0386 18.8624C23.8544 18.9289 23.632 18.963 23.3882 18.963C23.2718 18.963 23.147 18.9607 22.9995 18.9259C22.8938 18.901 22.8359 18.8833 22.7583 18.8556C22.7251 18.8437 22.6987 18.8024 22.7173 18.7501C22.7358 18.697 22.8916 18.2673 22.9136 18.2111C22.9407 18.1424 23.0093 18.1691 23.0093 18.1691C23.0563 18.1888 23.0892 18.2026 23.1519 18.215C23.2149 18.2276 23.3006 18.2384 23.3648 18.2384C23.4799 18.2384 23.585 18.2242 23.6763 18.1935C23.7869 18.1564 23.8508 18.0924 23.9185 18.006C23.9884 17.9166 24.0459 17.7933 24.104 17.629C24.1629 17.4627 24.2158 17.2433 24.2622 16.9767L24.856 13.6603H24.271C24.2006 13.6606 24.1783 13.6279 24.1851 13.5753L24.2837 13.0245C24.2992 12.9444 24.3726 12.9474 24.3726 12.9474H24.9742L25.0064 12.7677C25.0962 12.2358 25.2753 11.8309 25.5386 11.5655C25.8038 11.2983 26.1817 11.1632 26.6607 11.1632ZM8.31985 12.8527C8.82364 12.8527 9.31095 12.999 9.6636 13.214C9.69558 13.2332 9.72627 13.2704 9.70853 13.3195C9.69138 13.3674 9.53518 13.7854 9.51712 13.8331C9.48403 13.921 9.3931 13.8624 9.3931 13.8624C9.0858 13.6927 8.60568 13.5588 8.20267 13.5587C7.83989 13.5587 7.60403 13.7518 7.60403 14.0138V14.0294C7.6043 14.3349 8.00614 14.4665 8.47122 14.6173L8.5513 14.6427C9.16597 14.8358 9.82465 15.1065 9.82474 15.8487V15.8644C9.82474 16.6672 9.24141 17.1661 8.30423 17.1661C7.84427 17.1661 7.4047 17.0935 6.93802 16.8468C6.85071 16.7963 6.76308 16.7517 6.67728 16.6896C6.66805 16.6763 6.62924 16.6607 6.65774 16.5861L6.65677 16.5841L6.84134 16.0704C6.87056 15.9824 6.93849 16.0121 6.96536 16.0284C7.01606 16.0594 7.05384 16.0868 7.11966 16.1251C7.66551 16.4701 8.16962 16.4728 8.32767 16.4728C8.73377 16.4726 8.98676 16.2563 8.98685 15.9659V15.9503C8.98685 15.6346 8.59712 15.5135 8.147 15.3751L8.04837 15.3448C7.4303 15.1685 6.7681 14.9127 6.7681 14.13V14.1144C6.76812 13.372 7.36788 12.8527 8.2261 12.8527H8.31985ZM22.0396 12.8517C22.5433 12.8517 23.0307 12.9972 23.3833 13.212C23.4151 13.2311 23.4468 13.2686 23.4292 13.3175C23.4141 13.3645 23.2566 13.7846 23.2388 13.8321C23.2064 13.917 23.1199 13.8646 23.1148 13.8614C22.8058 13.6917 22.3274 13.5568 21.9243 13.5568C21.5617 13.5568 21.3259 13.75 21.3257 14.0118V14.0275C21.3257 14.3331 21.7277 14.4645 22.1929 14.6153L22.273 14.6417C22.8894 14.8349 23.5464 15.1054 23.5464 15.8478V15.8634C23.5464 16.6662 22.9631 17.1652 22.0259 17.1652C21.5658 17.1651 21.1255 17.0927 20.6587 16.8458C20.5716 16.7954 20.4842 16.7505 20.399 16.6886C20.3894 16.6753 20.3497 16.659 20.3784 16.5841L20.3765 16.5831L20.562 16.0695C20.5891 15.9855 20.6681 16.0157 20.6851 16.0265C20.7351 16.0587 20.7734 16.0857 20.8394 16.1241C21.3836 16.4691 21.889 16.4718 22.0474 16.4718C22.4536 16.4717 22.7075 16.2545 22.7075 15.964V15.9484C22.7073 15.6329 22.3192 15.5125 21.8677 15.3741L21.7681 15.3429C21.1501 15.1665 20.4878 14.9116 20.4878 14.129V14.1134C20.4878 13.3711 21.0877 12.8518 21.9458 12.8517H22.0396ZM28.7339 12.8663C29.0529 12.8663 29.3353 12.9227 29.5738 13.0343C29.8139 13.1451 30.0156 13.2999 30.1753 13.4913C30.3348 13.6827 30.4547 13.9108 30.5318 14.171H30.5298C30.6061 14.4297 30.645 14.7139 30.645 15.0128C30.645 15.3132 30.606 15.5952 30.5298 15.8536C30.4526 16.114 30.3328 16.3428 30.1734 16.5343C30.0139 16.7256 29.811 16.8786 29.5728 16.9874C29.3343 17.0963 29.0514 17.1525 28.7339 17.1525C28.4166 17.1524 28.1341 17.0962 27.8941 16.9874C27.6558 16.8783 27.4531 16.7256 27.2935 16.5343C27.1339 16.3428 27.0138 16.114 26.937 15.8536C26.8607 15.5952 26.8218 15.3132 26.8218 15.0128C26.8218 14.7122 26.8606 14.4297 26.937 14.171C27.0143 13.9108 27.1343 13.6827 27.2935 13.4913C27.4529 13.3 27.6558 13.1458 27.8941 13.0343C28.1341 12.923 28.415 12.8664 28.7339 12.8663ZM18.1538 12.8634C18.4146 12.8629 18.6726 12.9157 18.9126 13.0177C19.0789 13.0882 19.2452 13.2175 19.4165 13.4005C19.524 13.5163 19.6898 13.7695 19.7564 14.0196L19.7583 14.0206C19.9284 14.6168 19.8403 15.133 19.8374 15.1612C19.8302 15.2277 19.7632 15.2295 19.7603 15.2296L17.107 15.2277C17.1221 15.6306 17.2189 15.9147 17.4136 16.1095C17.6051 16.2998 17.911 16.4213 18.3208 16.422C18.9501 16.4237 19.219 16.2966 19.4087 16.2257C19.4087 16.2257 19.4826 16.1992 19.5093 16.2716L19.6822 16.757C19.7169 16.8387 19.6889 16.8674 19.6597 16.8839C19.495 16.9763 19.0914 17.146 18.3257 17.1486C17.9531 17.1497 17.6307 17.0965 17.3638 16.9933C17.0951 16.8892 16.8715 16.7416 16.6968 16.5519C16.5238 16.3638 16.3943 16.1367 16.314 15.878C16.2339 15.6211 16.1939 15.337 16.1939 15.0314C16.1939 14.7325 16.233 14.4469 16.3101 14.1866C16.3874 13.9231 16.5088 13.6929 16.6695 13.4982C16.8306 13.3035 17.0354 13.1478 17.2788 13.0333C17.5224 12.9196 17.823 12.8634 18.1538 12.8634ZM39.3667 12.8634C39.6275 12.863 39.8855 12.9156 40.1255 13.0177C40.2918 13.0882 40.4581 13.2174 40.6294 13.4005C40.7369 13.5164 40.9026 13.7695 40.9693 14.0196L40.9722 14.0206C41.1421 14.6168 41.0542 15.133 41.0513 15.1612C41.0439 15.2291 40.9742 15.2296 40.9742 15.2296L38.3208 15.2277C38.3359 15.6307 38.4336 15.9147 38.6284 16.1095C38.8199 16.2996 39.1235 16.4213 39.5347 16.422C40.1645 16.4237 40.4338 16.2966 40.6236 16.2257C40.6273 16.2244 40.6973 16.2011 40.7232 16.2716L40.896 16.757C40.9306 16.8387 40.903 16.8674 40.8736 16.8839C40.7089 16.9763 40.3053 17.146 39.5396 17.1486C39.1686 17.1497 38.8446 17.0965 38.5777 16.9933C38.309 16.8892 38.0853 16.7416 37.9107 16.5519C37.736 16.3638 37.6064 16.1367 37.5259 15.878C37.4463 15.6211 37.4058 15.337 37.4058 15.0314C37.4058 14.7325 37.4448 14.4469 37.522 14.1866C37.5992 13.9231 37.7204 13.6929 37.8814 13.4982C38.0426 13.3033 38.2482 13.1479 38.4917 13.0333C38.7352 12.9196 39.0359 12.8634 39.3667 12.8634ZM35.9605 12.8556C36.1821 12.8556 36.3788 12.8688 36.5484 12.8946C36.7297 12.922 36.9694 12.9869 37.0708 13.0265C37.0896 13.0338 37.1401 13.0591 37.1197 13.1183C37.046 13.3265 36.995 13.4628 36.9263 13.6525C36.8972 13.7323 36.8368 13.7077 36.8355 13.7071C36.5768 13.6262 36.3298 13.588 36.0074 13.588C35.6212 13.5881 35.3289 13.7199 35.1392 13.9718C34.947 14.227 34.8396 14.5598 34.8384 15.003C34.8368 15.4898 34.9578 15.8491 35.1743 16.0724C35.3893 16.2956 35.692 16.4083 36.0699 16.4083C36.2225 16.4083 36.3674 16.3985 36.4976 16.378C36.6269 16.3579 36.7491 16.3171 36.8628 16.2736C36.8683 16.2716 36.9377 16.2483 36.9624 16.3214H36.9634L37.1558 16.8517C37.1792 16.9146 37.1291 16.9421 37.1245 16.9445C36.829 17.0615 36.4175 17.1426 36.0161 17.1427C35.3376 17.1427 34.8162 16.9479 34.4702 16.5616C34.1244 16.1771 33.9497 15.6512 33.9497 15.003C33.9498 14.7025 33.9929 14.4188 34.0777 14.1603C34.1633 13.8999 34.2906 13.6711 34.4585 13.4796C34.6265 13.2882 34.8382 13.1339 35.0884 13.0226C35.3387 12.9111 35.6313 12.8556 35.9605 12.8556ZM12.0904 12.8575C12.6194 12.8575 13.0284 12.9802 13.3072 13.2237C13.5867 13.4673 13.7281 13.8622 13.7281 14.3927L13.73 16.8107C13.73 16.8107 13.7348 16.8809 13.6695 16.8976C13.6695 16.8976 13.5713 16.9241 13.4829 16.9445C13.2616 16.9924 13.0391 17.0358 12.8159 17.0743C12.554 17.1185 12.2833 17.1417 12.0113 17.1417C11.7528 17.1417 11.5173 17.117 11.3091 17.0695C11.0994 17.0224 10.9172 16.9431 10.77 16.8361C10.6222 16.7288 10.5033 16.5858 10.4243 16.421C10.3439 16.2548 10.3033 16.0515 10.3033 15.8165C10.3033 15.5849 10.351 15.3798 10.4449 15.2052C10.5379 15.0322 10.6697 14.8828 10.8296 14.7687C10.9891 14.6539 11.1759 14.5676 11.3824 14.5118C11.5872 14.4565 11.8071 14.4278 12.0337 14.4278C12.1999 14.4279 12.3393 14.4317 12.4468 14.4396L12.4497 14.4464C12.4606 14.4474 12.6656 14.4661 12.8863 14.4982V14.3859C12.8862 14.0333 12.8121 13.865 12.6675 13.754C12.5197 13.6408 12.2976 13.5831 12.0122 13.5831C11.9944 13.5829 11.3606 13.5786 10.8589 13.8517C10.8354 13.8656 10.815 13.8741 10.815 13.8741C10.8096 13.8759 10.7504 13.8932 10.7281 13.8312L10.5406 13.3273C10.5128 13.2562 10.5613 13.2235 10.564 13.2218C10.8025 13.035 11.3804 12.923 11.3804 12.923C11.5718 12.8845 11.8922 12.8576 12.0904 12.8575ZM15.3706 11.2491C15.4146 11.2494 15.4456 11.2844 15.4458 11.3282V16.9835C15.4457 17.0276 15.4147 17.0634 15.3706 17.0636H14.6675C14.6231 17.0635 14.5914 17.0277 14.5913 16.9835V11.3282C14.5915 11.2843 14.6232 11.2492 14.6675 11.2491H15.3706ZM33.2935 12.9034C33.4659 12.9142 33.6907 12.9614 33.7368 12.9786C33.7458 12.9821 33.7544 12.9876 33.7613 12.9943C33.7682 13.001 33.7732 13.0098 33.7769 13.0187C33.7805 13.0274 33.7827 13.0366 33.7827 13.046L33.7788 13.0636C33.7537 13.1358 33.6242 13.498 33.5786 13.6193C33.5613 13.6653 33.533 13.6963 33.482 13.6905C33.4759 13.6891 33.3275 13.6555 33.1919 13.6554C33.0715 13.6554 32.9512 13.672 32.8355 13.7052C32.7123 13.7434 32.6001 13.8109 32.5083 13.9015C32.4122 13.9955 32.3333 14.1269 32.2759 14.2911C32.2176 14.4574 32.189 14.7221 32.189 14.9874V16.9689C32.189 16.99 32.1804 17.0105 32.1656 17.0255C32.1505 17.0406 32.1292 17.0489 32.1079 17.0489H31.4126C31.3914 17.0488 31.371 17.0405 31.356 17.0255C31.341 17.0105 31.3326 16.9901 31.3325 16.9689V13.0216C31.3327 12.9774 31.3648 12.9415 31.4087 12.9415H32.0874C32.1318 12.9417 32.1625 12.9775 32.1626 13.0216L32.1636 13.3448C32.2643 13.2072 32.4457 13.0879 32.6099 13.0138C32.7761 12.9392 32.9611 12.8827 33.2935 12.9034ZM12.1656 15.0987C11.6392 15.0923 11.4073 15.2806 11.397 15.2902C11.2374 15.4027 11.1597 15.5711 11.1597 15.8028C11.1597 15.9503 11.1864 16.0655 11.2388 16.1466C11.2732 16.2005 11.2883 16.2209 11.3921 16.3038L11.3931 16.3048C11.3928 16.3054 11.6319 16.4924 12.1695 16.4601C12.549 16.4372 12.8853 16.3644 12.8853 16.3644H12.8843V15.1603C12.6464 15.1238 12.4062 15.1031 12.1656 15.0987ZM28.7359 13.5851C28.3866 13.5851 28.1396 13.7047 27.9771 13.9532C27.8136 14.2035 27.73 14.5594 27.73 15.0128C27.73 15.4662 27.813 15.8254 27.9771 16.0773C28.14 16.3268 28.3883 16.4483 28.7359 16.4484C29.0835 16.4484 29.3333 16.3256 29.4986 16.0753C29.6433 15.8535 29.7262 15.5522 29.7447 15.1769L29.7486 15.0128C29.7486 14.5595 29.665 14.2035 29.4986 13.9532C29.334 13.7058 29.0852 13.5851 28.7359 13.5851ZM39.3042 13.5646C38.9566 13.5646 38.7088 13.7008 38.5464 13.9493C38.438 14.1122 38.369 14.3225 38.3316 14.5743H40.2212C40.2034 14.3308 40.1556 14.1131 40.0464 13.9493C39.8818 13.7016 39.6518 13.5646 39.3042 13.5646ZM18.0913 13.5646C17.744 13.5647 17.497 13.701 17.3345 13.9493C17.2262 14.1122 17.1571 14.3224 17.1197 14.5743H19.0083C18.9904 14.3308 18.9435 14.1131 18.8345 13.9493C18.6699 13.7014 18.439 13.5646 18.0913 13.5646Z",
          fill: "#FFFFFE"
        }
      )
    ]
  }
);
var salesforce_default = SalesforceIcon;

// src/blocks/contact-form/components/help-message/index.jsx
var import_notice_outline = __toESM(require_notice_outline(), 1);

// src/blocks/contact-form/components/help-message/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='cbfaa72d72']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "cbfaa72d72");
  style.appendChild(document.createTextNode(".help-message{display:flex;font-size:13px;line-height:1.4;margin-bottom:1em;margin-top:-.5em}.help-message svg{margin-right:5px;min-width:24px}.help-message>span{margin-top:2px}.help-message.help-message-is-error{color:var(--color-error)}.help-message.help-message-is-error svg{fill:var(--color-error)}"));
  document.head.appendChild(style);
}

// src/blocks/contact-form/components/help-message/index.jsx
var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1);
var GridiconNoticeOutline = import_notice_outline.default.default || import_notice_outline.default;
var help_message_default = ({ children = null, isError = false, ...props }) => {
  const classes = clsx_default("help-message", {
    "help-message-is-error": isError
  });
  return children && /* @__PURE__ */ (0, import_jsx_runtime129.jsxs)("div", { className: classes, ...props, children: [
    isError && /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(GridiconNoticeOutline, { size: "24", "aria-hidden": "true", role: "img", focusable: "false" }),
    /* @__PURE__ */ (0, import_jsx_runtime129.jsx)("span", { children })
  ] });
};

// src/blocks/contact-form/components/jetpack-integrations-modal/components/create-salesforce-lead-form-button.tsx
var import_components55 = __toESM(require_components(), 1);
var import_i18n56 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-create-form.ts
var import_element71 = __toESM(require_element(), 1);

// src/hooks/use-config-value.ts
var import_data7 = __toESM(require_data(), 1);

// src/store/config/index.ts
var import_data6 = __toESM(require_data(), 1);

// src/store/config/actions.ts
var actions_exports = {};
__export(actions_exports, {
  invalidateConfig: () => invalidateConfig,
  receiveConfig: () => receiveConfig,
  receiveConfigValue: () => receiveConfigValue,
  refreshConfig: () => refreshConfig,
  setConfigError: () => setConfigError,
  setConfigLoading: () => setConfigLoading
});

// src/store/config/action-types.ts
var RECEIVE_CONFIG = "RECEIVE_CONFIG";
var RECEIVE_CONFIG_VALUE = "RECEIVE_CONFIG_VALUE";
var INVALIDATE_CONFIG = "INVALIDATE_CONFIG";
var SET_CONFIG_LOADING = "SET_CONFIG_LOADING";
var SET_CONFIG_ERROR = "SET_CONFIG_ERROR";

// src/store/config/resolvers.ts
var resolvers_exports = {};
__export(resolvers_exports, {
  getConfig: () => getConfig
});
var import_api_fetch2 = __toESM(require_api_fetch(), 1);

// src/store/constants.ts
var import_i18n55 = __toESM(require_i18n(), 1);
var UNKNOWN_ERROR_MESSAGE = (0, import_i18n55.__)("Unknown error", "jetpack-forms");

// src/store/config/resolvers.ts
var fetchConfigData = async (dispatch4) => {
  dispatch4(setConfigLoading(true));
  try {
    const result = await (0, import_api_fetch2.default)({
      path: "/wp/v2/feedback/config"
    });
    dispatch4(receiveConfig(result));
  } catch (e2) {
    const message2 = e2 instanceof Error ? e2.message : UNKNOWN_ERROR_MESSAGE;
    dispatch4(setConfigError(message2));
  } finally {
    dispatch4(setConfigLoading(false));
  }
};
function getConfig() {
  return async ({ dispatch: dispatch4 }) => {
    await fetchConfigData(dispatch4);
  };
}
getConfig.isFulfilled = (state) => {
  return state.config !== null || state.isLoading;
};
getConfig.shouldInvalidate = (action) => {
  return action.type === INVALIDATE_CONFIG;
};

// src/store/config/actions.ts
var receiveConfig = (config) => ({
  type: RECEIVE_CONFIG,
  config
});
var receiveConfigValue = (key, value) => ({
  type: RECEIVE_CONFIG_VALUE,
  key,
  value
});
var invalidateConfig = () => ({
  type: INVALIDATE_CONFIG
});
var setConfigLoading = (isLoading) => ({
  type: SET_CONFIG_LOADING,
  isLoading
});
var setConfigError = (error2) => ({
  type: SET_CONFIG_ERROR,
  error: error2
});
var refreshConfig = () => getConfig();

// src/store/config/reducer.ts
var DEFAULT_STATE = {
  config: null,
  isLoading: false,
  error: null
};
function reducer(state = DEFAULT_STATE, action) {
  switch (action.type) {
    case SET_CONFIG_LOADING:
      return {
        ...state,
        isLoading: !!action.isLoading,
        error: action.isLoading ? null : state.error
      };
    case SET_CONFIG_ERROR:
      return {
        ...state,
        isLoading: false,
        error: action.error ?? UNKNOWN_ERROR_MESSAGE
      };
    case RECEIVE_CONFIG:
      return {
        ...state,
        config: action.config ?? null,
        isLoading: false,
        error: null
      };
    case RECEIVE_CONFIG_VALUE:
      return {
        ...state,
        config: {
          ...state.config ?? {},
          [action.key]: action.value
        }
      };
    case INVALIDATE_CONFIG:
      return {
        ...state,
        config: null,
        isLoading: false
      };
    default:
      return state;
  }
}

// src/store/config/selectors.ts
var selectors_exports = {};
__export(selectors_exports, {
  getConfig: () => getConfig2,
  getConfigError: () => getConfigError,
  getConfigValue: () => getConfigValue,
  isConfigLoading: () => isConfigLoading
});
var getConfig2 = (state) => state.config;
var getConfigValue = (state, key) => state.config?.[key];
var isConfigLoading = (state) => state.isLoading;
var getConfigError = (state) => state.error;

// src/store/config/index.ts
var CONFIG_STORE = "jetpack/forms/config";
var store = (0, import_data6.createReduxStore)(CONFIG_STORE, {
  reducer,
  actions: actions_exports,
  selectors: selectors_exports,
  resolvers: resolvers_exports
});
(0, import_data6.register)(store);

// src/hooks/use-config-value.ts
function useConfigValue(key) {
  return (0, import_data7.useSelect)(
    (select3) => {
      const configSelect = select3(CONFIG_STORE);
      const config = configSelect.getConfig();
      return config?.[key];
    },
    [key]
  );
}

// src/dashboard/hooks/use-create-form.ts
var openFormLink = (url) => {
  const link = document.createElement("a");
  link.setAttribute("href", url);
  link.style.display = "none";
  document.body.appendChild(link);
  link.click();
  document.body.removeChild(link);
};
function useCreateForm() {
  const newFormNonce = useConfigValue("newFormNonce");
  const isCentralFormManagementEnabled = useConfigValue("isCentralFormManagementEnabled");
  const adminUrl = useConfigValue("adminUrl");
  const ajaxUrl = useConfigValue("ajaxUrl");
  const createForm = (0, import_element71.useCallback)(
    async (formPattern) => {
      const data = new FormData();
      data.append("action", "create_new_form");
      data.append("newFormNonce", newFormNonce);
      if (formPattern) {
        data.append("pattern", formPattern);
      }
      const fetchUrl = ajaxUrl || window.ajaxurl;
      const response = await fetch(fetchUrl, { method: "POST", body: data });
      const {
        success,
        post_url: postUrl,
        data: message2
      } = await response.json();
      if (success === false) {
        throw new Error(message2);
      }
      return postUrl;
    },
    [newFormNonce, ajaxUrl]
  );
  const openNewForm = (0, import_element71.useCallback)(
    async ({ formPattern, formTitle, showPatterns, analyticsEvent }) => {
      try {
        if (isCentralFormManagementEnabled === true) {
          analyticsEvent?.({ formPattern: formPattern ?? "" });
          let url = `${adminUrl || ""}post-new.php?post_type=jetpack_form`;
          const trimmedFormTitle = formTitle?.trim();
          if (trimmedFormTitle) {
            url += `&post_title=${encodeURIComponent(trimmedFormTitle)}`;
          }
          openFormLink(url);
          return;
        }
        const postUrl = await createForm(formPattern);
        if (postUrl) {
          analyticsEvent?.({ formPattern });
          const url = `${postUrl}${showPatterns && !formPattern ? "&showJetpackFormsPatterns" : ""}`;
          openFormLink(url);
        }
      } catch (error2) {
        console.error(error2.message);
      }
    },
    [createForm, isCentralFormManagementEnabled, adminUrl]
  );
  return { createForm, openNewForm };
}

// src/blocks/contact-form/components/jetpack-integrations-modal/components/create-salesforce-lead-form-button.tsx
var import_jsx_runtime130 = __toESM(require_jsx_runtime(), 1);
function CreateSalesforceLeadFormButton({ className }) {
  const { openNewForm } = useCreateForm();
  const handleClick = () => {
    openNewForm({
      formPattern: "salesforce-lead-form",
      analyticsEvent: () => {
        if (window.jetpackAnalytics?.tracks) {
          window.jetpackAnalytics.tracks.recordEvent("jetpack_forms_salesforce_lead_form_click");
        }
      }
    });
  };
  return /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_components55.Button, { variant: "primary", onClick: handleClick, className, children: (0, import_i18n56.__)("Create Salesforce lead form", "jetpack-forms") });
}

// src/blocks/contact-form/components/jetpack-integrations-modal/helpers/salesforce.tsx
var import_jsx_runtime131 = __toESM(require_jsx_runtime(), 1);
var isValidSalesforceOrgId = (id) => typeof id === "string" && /^[a-zA-Z0-9]{15,18}$/.test(id.trim());
function buildSalesforceCard({
  integration,
  refreshIntegrations: refreshIntegrations2,
  context,
  attributes,
  setAttributes
}) {
  const organizationId = attributes?.salesforceData?.organizationId ?? "";
  const sendToSalesforce = !!attributes?.salesforceData?.sendToSalesforce;
  const base = {
    id: integration.id,
    title: integration.title,
    description: integration.subtitle,
    icon: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(salesforce_default, { width: 32, height: 32 }),
    cardData: {
      ...integration,
      isLoading: typeof integration.isInstalled === "undefined",
      refreshStatus: refreshIntegrations2,
      showHeaderToggle: context === "block-editor",
      ...context === "block-editor" && {
        headerToggleValue: sendToSalesforce,
        isHeaderToggleEnabled: isValidSalesforceOrgId(organizationId),
        onHeaderToggleChange: (value) => setAttributes?.({
          salesforceData: {
            ...attributes?.salesforceData ?? {},
            sendToSalesforce: value
          }
        }),
        toggleDisabledTooltip: !isValidSalesforceOrgId(organizationId) ? (0, import_i18n57.__)("Enter a Salesforce Organization ID to enable.", "jetpack-forms") : void 0,
        isConnected: isValidSalesforceOrgId(organizationId)
      },
      setupBadge: context === "dashboard" ? /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Badge, { intent: "stable", className: "integration-card__setup-badge", children: (0, import_i18n57.__)("Configured per form", "jetpack-forms") }) : /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(Badge, { intent: "draft", className: "integration-card__setup-badge", children: (0, import_i18n57.__)("Enter organization ID", "jetpack-forms") })
    },
    body: context === "block-editor" ? /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)(import_components56.BaseControl, { __nextHasNoMarginBottom: true, children: [
      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(
        import_components56.TextControl,
        {
          label: (0, import_i18n57.__)("Organization ID", "jetpack-forms"),
          value: organizationId,
          onChange: (newId) => setAttributes?.({
            salesforceData: {
              ...attributes?.salesforceData ?? {},
              organizationId: newId.trim()
            }
          }),
          __nextHasNoMarginBottom: true,
          __next40pxDefaultSize: true,
          style: { maxWidth: "300px" }
        }
      ),
      organizationId && !isValidSalesforceOrgId(organizationId) && /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(help_message_default, { isError: true, style: { marginTop: "8px" }, children: (0, import_i18n57.__)(
        "Invalid Organization ID. Should be a 15\u201318 characters long alphanumeric string.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_components56.ExternalLink, { href: "https://help.salesforce.com/s/articleView?id=000325251&type=1", children: (0, import_i18n57.__)("Where to find your Salesforce Organization ID", "jetpack-forms") }) }),
      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("div", { style: { marginTop: "20px", marginBottom: "20px" }, children: (0, import_i18n57.__)(
        "For integration with Salesforce to work, you must add specific fields with specific field IDs that match Salesforce.",
        "jetpack-forms"
      ) })
    ] }) : /* @__PURE__ */ (0, import_jsx_runtime131.jsxs)("div", { children: [
      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)("p", { className: "integration-card__description", children: (0, import_i18n57.__)(
        "Salesforce connections are managed for each form individually in the block editor.",
        "jetpack-forms"
      ) }),
      /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(CreateSalesforceLeadFormButton, { className: "jp-forms__create-form-button--large-green" })
    ] })
  };
  return base;
}

// src/blocks/contact-form/components/jetpack-integrations-modal/hooks/use-integration-cards-data.tsx
var useIntegrationCardsData = ({
  integrations = [],
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers,
  attributes,
  setAttributes,
  components
}) => {
  return integrations.map((integration) => {
    const base = {
      id: integration.id,
      title: integration.title,
      description: integration.subtitle,
      cardData: {
        ...integration,
        isLoading: typeof integration.isInstalled === "undefined",
        refreshStatus: refreshIntegrations2
      }
    };
    switch (integration.id) {
      case "akismet":
        return buildAkismetCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          handlers
        });
      case "google-drive":
        return buildGoogleDriveCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          handlers
        });
      case "zero-bs-crm":
        return buildJetpackCrmCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes
        });
      case "mailpoet":
        return buildMailPoetCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes,
          components
        });
      case "hostinger-reach":
        return buildHostingerReachCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes,
          components
        });
      case "salesforce":
        return buildSalesforceCard({
          integration,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes
        });
      default:
        return base;
    }
  });
};
var use_integration_cards_data_default = useIntegrationCardsData;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/index.tsx
var import_components60 = __toESM(require_components(), 1);

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/integration-card-body.tsx
var import_components57 = __toESM(require_components(), 1);
var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1);
var IntegrationCardBody = ({
  isExpanded,
  children,
  cardData = {}
}) => {
  if (!isExpanded) {
    return null;
  }
  const {
    notInstalledMessage,
    notActivatedMessage,
    isInstalled,
    isActive,
    isLoading,
    type,
    __isPartial
  } = cardData;
  const isPlugin = type === "plugin";
  const isService = type === "service";
  const showPluginInstallMessage = !__isPartial && isPlugin && !isInstalled;
  const showPluginActivateMessage = !__isPartial && isPlugin && isInstalled && !isActive;
  const showContent = !__isPartial && (isPlugin && isInstalled && isActive || isService);
  if (isLoading) {
    return /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components57.CardBody, { children: /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_components57.Spinner, {}) });
  }
  return /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_components57.CardBody, { children: [
    showPluginInstallMessage && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "integration-card__description", children: notInstalledMessage }),
    showPluginActivateMessage && /* @__PURE__ */ (0, import_jsx_runtime132.jsx)("p", { className: "integration-card__description", children: notActivatedMessage }),
    showContent && children
  ] });
};
var integration_card_body_default = IntegrationCardBody;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/integration-card-header.tsx
var import_components59 = __toESM(require_components(), 1);
var import_i18n59 = __toESM(require_i18n(), 1);

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/plugin-action-button.tsx
var import_components58 = __toESM(require_components(), 1);
var import_element73 = __toESM(require_element(), 1);
var import_i18n58 = __toESM(require_i18n(), 1);

// src/hooks/use-plugin-installation.ts
var import_data8 = __toESM(require_data(), 1);
var import_element72 = __toESM(require_element(), 1);
var import_notices = __toESM(require_notices(), 1);

// ../../js-packages/script-data/src/utils.ts
function getScriptData() {
  return window.JetpackScriptData;
}
function isSimpleSite() {
  return getScriptData()?.site?.host === "wpcom";
}

// src/blocks/contact-form/util/plugin-management.js
var import_api_fetch3 = __toESM(require_api_fetch(), 1);
async function installAndActivatePlugin(slug) {
  if (isSimpleSite()) {
    return Promise.reject();
  }
  try {
    const attemptInstall = await (0, import_api_fetch3.default)({
      path: "/jetpack/v4/plugins",
      method: "POST",
      data: {
        slug,
        status: "active",
        source: "block-editor"
      }
    });
    return attemptInstall;
  } catch (error2) {
    return Promise.reject(error2.message);
  }
}
async function activatePlugin(pluginFile) {
  if (isSimpleSite()) {
    return Promise.reject();
  }
  try {
    const attemptActivate = await (0, import_api_fetch3.default)({
      path: `/jetpack/v4/plugins/${pluginFile}`,
      method: "POST",
      data: {
        status: "active",
        source: "block-editor"
      }
    });
    return attemptActivate;
  } catch (error2) {
    return Promise.reject(error2.message);
  }
}

// src/hooks/use-plugin-installation.ts
var usePluginInstallation = ({
  slug,
  pluginPath,
  isInstalled,
  trackEventName,
  trackEventProps = {},
  onSuccess,
  successNotices,
  errorNotice
}) => {
  const [isInstalling, setIsInstalling] = (0, import_element72.useState)(false);
  const { createSuccessNotice, createErrorNotice } = (0, import_data8.useDispatch)(import_notices.store);
  const canInstallPlugins = useConfigValue("canInstallPlugins");
  const canActivatePlugins = useConfigValue("canActivatePlugins");
  const installPlugin = (0, import_element72.useCallback)(async () => {
    setIsInstalling(true);
    if (trackEventName) {
      analytics_default.tracks.recordEvent(trackEventName, {
        intent: isInstalled ? "activate-plugin" : "install-plugin",
        ...trackEventProps ?? {}
      });
    }
    try {
      if (isInstalled) {
        if (!canActivatePlugins) {
          return false;
        }
        await activatePlugin(pluginPath);
      } else {
        if (!canInstallPlugins) {
          return false;
        }
        await installAndActivatePlugin(slug);
      }
      const successNoticeConfig = isInstalled ? successNotices?.activate : successNotices?.install;
      if (successNoticeConfig?.message) {
        createSuccessNotice(successNoticeConfig.message, successNoticeConfig.options);
      }
      if (onSuccess) {
        await onSuccess();
      }
      return true;
    } catch (error2) {
      if (errorNotice) {
        const noticeMessage = errorNotice.message || (error2 instanceof Error ? error2.message : void 0);
        if (noticeMessage) {
          createErrorNotice(noticeMessage, errorNotice.options);
        }
      }
      return false;
    } finally {
      setIsInstalling(false);
    }
  }, [
    trackEventName,
    isInstalled,
    trackEventProps,
    successNotices?.activate,
    successNotices?.install,
    onSuccess,
    canActivatePlugins,
    pluginPath,
    canInstallPlugins,
    slug,
    createSuccessNotice,
    errorNotice,
    createErrorNotice
  ]);
  return {
    isInstalling,
    installPlugin,
    canInstallPlugins,
    canActivatePlugins
  };
};

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/plugin-action-button.tsx
var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1);
var PluginActionButton = ({
  slug,
  pluginFile,
  isInstalled,
  isActive,
  refreshStatus,
  trackEventName
}) => {
  const trackEventProps = {
    screen: "block-editor"
  };
  const { isInstalling, installPlugin, canInstallPlugins, canActivatePlugins } = usePluginInstallation({
    slug,
    pluginPath: pluginFile,
    isInstalled,
    trackEventName,
    trackEventProps
  });
  const canPerformAction = isInstalled ? canActivatePlugins : canInstallPlugins;
  const [isReconcilingStatus, setIsReconcilingStatus] = (0, import_element73.useState)(false);
  const isDisabled = isInstalling || isReconcilingStatus || !canPerformAction;
  const handleAction = async (event) => {
    event.stopPropagation();
    if (isDisabled) {
      return;
    }
    const success = await installPlugin();
    if (success && refreshStatus) {
      setIsReconcilingStatus(true);
      refreshStatus();
    }
  };
  (0, import_element73.useEffect)(() => {
    if (isReconcilingStatus && isActive) {
      setIsReconcilingStatus(false);
    }
  }, [isReconcilingStatus, isActive]);
  const getButtonText = () => {
    return (isInstalling || isReconcilingStatus) && isInstalled && (0, import_i18n58.__)("Activating\u2026", "jetpack-forms") || (isInstalling || isReconcilingStatus) && (0, import_i18n58.__)("Installing\u2026", "jetpack-forms") || isInstalled && (0, import_i18n58.__)("Activate", "jetpack-forms") || (0, import_i18n58.__)("Install", "jetpack-forms");
  };
  const tooltipTextActivate = (0, import_i18n58.__)("Activate this plugin", "jetpack-forms");
  const tooltipTextInstall = (0, import_i18n58.__)("Install this plugin", "jetpack-forms");
  const tooltipTextNoInstallPerms = (0, import_i18n58.__)(
    "You do not have permission to install plugins.",
    "jetpack-forms"
  );
  const tooltipTextNoActivatePerms = (0, import_i18n58.__)(
    "You do not have permission to activate plugins.",
    "jetpack-forms"
  );
  const getTooltipText = () => {
    if (isInstalled && !canActivatePlugins) {
      return tooltipTextNoActivatePerms;
    }
    if (!isInstalled && !canInstallPlugins) {
      return tooltipTextNoInstallPerms;
    }
    return String(isInstalled ? tooltipTextActivate : tooltipTextInstall);
  };
  return /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_components58.Tooltip, { text: getTooltipText(), children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)("span", { style: { display: "inline-flex" }, children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(
    import_components58.Button,
    {
      variant: "primary",
      onClick: handleAction,
      disabled: isDisabled,
      style: isDisabled ? { pointerEvents: "none" } : void 0,
      icon: isInstalling || isReconcilingStatus ? /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_components58.Spinner, {}) : void 0,
      __next40pxDefaultSize: true,
      children: getButtonText()
    }
  ) }) });
};
var plugin_action_button_default = PluginActionButton;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/integration-card-header.tsx
var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1);
var noop3 = () => {
};
var IntegrationCardHeader = ({
  title,
  description,
  isExpanded,
  onToggle,
  cardData = {},
  toggleTooltip
}) => {
  const {
    isInstalled,
    isActive,
    isConnected,
    needsConnection,
    type,
    showHeaderToggle,
    headerToggleValue,
    isHeaderToggleEnabled,
    onHeaderToggleChange,
    toggleDisabledTooltip,
    setupBadge,
    __isPartial
  } = cardData;
  const showPluginAction = !__isPartial && type === "plugin" && (!isInstalled || !isActive);
  const showConnectedBadge = !__isPartial && (isConnected || isActive && !needsConnection);
  const disableFormText = (0, import_i18n59.__)("Disable for this form", "jetpack-forms");
  const enableFormText = (0, import_i18n59.__)("Enable for this form", "jetpack-forms");
  const showPendingBadge = !__isPartial && !showPluginAction && !isConnected && needsConnection;
  const installPluginActionLabel = (0, import_i18n59.__)("Plugin needs install", "jetpack-forms");
  const activatePluginActionLabel = (0, import_i18n59.__)("Plugin needs activation", "jetpack-forms");
  const pluginActionLabel = !isInstalled ? installPluginActionLabel : activatePluginActionLabel;
  const getTooltipText = (checked) => {
    if (toggleTooltip) {
      return toggleTooltip;
    }
    if (checked) {
      return disableFormText;
    }
    return enableFormText;
  };
  const handleToggleChange = (value) => {
    analytics_default.tracks.recordEvent("jetpack_forms_integrations_card_toggle", {
      card: cardData.id,
      origin: "block-editor",
      enabled: value
    });
    if (onHeaderToggleChange) {
      onHeaderToggleChange(value);
    }
  };
  const handleHeaderClick = (e2) => {
    if (e2.target.closest(".components-form-toggle")) {
      return;
    }
    onToggle();
  };
  const isHeaderToggleEnabledFinal = isHeaderToggleEnabled && !__isPartial;
  const showHeaderToggleFinal = showHeaderToggle && !__isPartial;
  const showIntegrationIcons = useConfigValue("showIntegrationIcons");
  return /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
    import_components59.CardHeader,
    {
      onClick: __isPartial ? noop3 : handleHeaderClick,
      className: clsx_default("integration-card__header", { "is-clickable": !__isPartial }),
      children: /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "integration-card__header-content", children: [
        /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "integration-card__header-main", children: [
          showIntegrationIcons !== false && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("div", { className: "integration-card__service-icon-container", children: cardData?.iconUrl ? /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
            "img",
            {
              src: cardData.iconUrl,
              alt: "",
              "aria-hidden": true,
              width: 30,
              height: 30,
              className: clsx_default(
                "integration-card__service-icon",
                cardData.slug && `integration-card__service-icon--${cardData.slug}`
              )
            }
          ) : /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
            import_components59.Icon,
            {
              icon: plugins_default,
              className: clsx_default(
                "integration-card__service-icon",
                cardData.slug && `integration-card__service-icon--${cardData.slug}`
              ),
              size: 30,
              "aria-hidden": true
            }
          ) }),
          /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)("div", { className: "integration-card__title-section", children: [
            /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("h3", { className: "integration-card__title", children: title }),
            description && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "integration-card__description", children: description }),
            __isPartial && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_components59.Animate, { type: "loading", children: ({ className }) => /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
              Badge,
              {
                intent: "draft",
                className: clsx_default("integration-card__plugin-badge", className),
                children: " "
              }
            ) }),
            showPluginAction && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
              Badge,
              {
                intent: isInstalled && !isActive ? "low" : "draft",
                className: "integration-card__plugin-badge",
                children: pluginActionLabel
              }
            ),
            showConnectedBadge && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Badge, { intent: "stable", className: "integration-card__connected-badge", children: (0, import_i18n59.__)("Enabled", "jetpack-forms") }),
            showPendingBadge && (setupBadge || /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(Badge, { intent: "low", className: "integration-card__setup-badge", children: (0, import_i18n59.__)("Needs connection", "jetpack-forms") }))
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime134.jsxs)(
          import_components59.__experimentalHStack,
          {
            className: "integration-card__header-actions",
            spacing: "3",
            alignment: "center",
            justify: "end",
            expanded: false,
            children: [
              showPluginAction && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
                plugin_action_button_default,
                {
                  slug: cardData.slug,
                  pluginFile: cardData.pluginFile,
                  isInstalled,
                  isActive,
                  refreshStatus: cardData.refreshStatus,
                  trackEventName: cardData.trackEventName
                }
              ),
              !showPluginAction && showHeaderToggleFinal && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
                import_components59.Tooltip,
                {
                  text: !isHeaderToggleEnabledFinal && toggleDisabledTooltip ? toggleDisabledTooltip : getTooltipText(headerToggleValue),
                  children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)("span", { className: "integration-card__toggle-tooltip-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(
                    import_components59.ToggleControl,
                    {
                      checked: headerToggleValue && (isActive || isConnected),
                      onChange: handleToggleChange,
                      disabled: !isHeaderToggleEnabledFinal || !(isActive || isConnected),
                      __nextHasNoMarginBottom: true
                    }
                  ) })
                }
              ),
              !__isPartial && /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_components59.Icon, { icon: isExpanded ? chevron_up_default : chevron_down_default })
            ]
          }
        )
      ] })
    }
  );
};
var integration_card_header_default = IntegrationCardHeader;

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='41215a7f4f']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "41215a7f4f");
  style.appendChild(document.createTextNode(".integration-card__header.is-clickable{cursor:pointer}.integration-card__header-content{align-items:center;display:flex;gap:16px;justify-content:space-between;width:100%}@media (max-width:782px){.integration-card__header-content{align-items:flex-start;gap:10px}}.integration-card__header-main{align-items:center;display:flex;gap:16px}@media (max-width:782px){.integration-card__header-main{align-items:flex-start;gap:10px;width:100%}.integration-card__header-actions button{height:auto;padding:10px 12px}}.integration-card__title-section{align-items:center;display:flex;flex-direction:row;flex-wrap:wrap;gap:4px 12px}@media (max-width:782px){.integration-card__title-section{gap:2px 12px}}.integration-card__service-icon-container{align-items:center;background-color:var(--jp-gray-0);border-radius:4px;display:flex;justify-content:center;padding:8px}@media (max-width:782px){.integration-card__service-icon-container{padding:4px}}.integration-card__service-icon{flex-shrink:0;margin-top:0}.integration-card__title{font-size:15px;font-weight:400;line-height:1.4;margin:0;order:1}.integration-card__connected-badge,.integration-card__plugin-badge,.integration-card__setup-badge{min-width:60px;order:2}@media (max-width:782px){.integration-card__connected-badge,.integration-card__plugin-badge,.integration-card__setup-badge{order:3}}.integration-card__description{color:var(--jp-gray-50);font-size:13px;line-height:1.5;order:3;width:100%}.integration-card__description:first-of-type{margin-top:0}@media (max-width:782px){.integration-card__description{order:2;padding-bottom:3px;text-wrap:balance}}.integration-card__section{margin:12px 0}@media (max-width:480px){.integration-card__links.components-h-stack{align-items:flex-start;flex-direction:column}.integration-card__links.components-h-stack span{display:none}}.integration-card .components-button .components-spinner{height:16px;margin:0 8px;width:16px}.integration-card .components-card__body{padding:8px 40px 24px 60px}@media (max-width:782px){.integration-card .components-card__body{padding-left:46px;padding-right:20px}}.integration-card .components-card-header{padding-left:0;padding-right:0}.integration-card p{text-wrap:balance;text-wrap:pretty}.integration-card__service-icon--google-sheets,.integration-card__service-icon--hostinger-reach,.integration-card__service-icon--mailpoet{border-radius:0!important}.integration-card:last-child{border-bottom:none}"));
  document.head.appendChild(style);
}

// src/blocks/contact-form/components/jetpack-integrations-modal/integration-card/index.tsx
var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1);
var IntegrationCard = ({
  title,
  description,
  isExpanded,
  onToggle,
  children,
  cardData = {},
  toggleTooltip,
  borderBottom = true
}) => {
  return /* @__PURE__ */ (0, import_jsx_runtime135.jsxs)(
    import_components60.Card,
    {
      className: "integration-card",
      isBorderless: true,
      borderBottom,
      isRounded: false,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(
          integration_card_header_default,
          {
            title,
            description,
            isExpanded,
            onToggle,
            cardData,
            toggleTooltip
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(integration_card_body_default, { isExpanded, cardData, children })
      ]
    }
  );
};
var integration_card_default = IntegrationCard;

// src/blocks/contact-form/components/jetpack-integrations-modal/integrations-list.tsx
var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1);
var IntegrationsList = ({
  integrations = [],
  refreshIntegrations: refreshIntegrations2,
  context,
  handlers,
  attributes,
  setAttributes,
  components
}) => {
  const items = use_integration_cards_data_default({
    integrations,
    refreshIntegrations: refreshIntegrations2,
    context,
    handlers,
    attributes,
    setAttributes,
    components
  });
  const initialCardsExpandedState = (0, import_element74.useMemo)(() => {
    const state = {};
    integrations.forEach((integration) => {
      state[integration.id] = false;
    });
    return state;
  }, [integrations]);
  const [expandedCards, setExpandedCards] = (0, import_element74.useState)(initialCardsExpandedState);
  const toggleCard = (0, import_element74.useCallback)(
    (id) => {
      setExpandedCards((prev) => {
        const isExpanding = !prev[id];
        if (isExpanding) {
          analytics_default.tracks.recordEvent("jetpack_forms_integrations_card_expand", {
            card: id,
            origin: context
          });
        }
        return { ...prev, [id]: isExpanding };
      });
    },
    [context]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_jsx_runtime136.Fragment, { children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(
    integration_card_default,
    {
      title: item.title,
      description: item.description,
      isExpanded: !!expandedCards[item.id],
      onToggle: () => toggleCard(item.id),
      cardData: item.cardData,
      toggleTooltip: item.toggleTooltip,
      children: item.body
    },
    item.id
  )) });
};
var integrations_list_default = IntegrationsList;

// src/blocks/contact-form/components/jetpack-integrations-modal/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='c629c83777']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "c629c83777");
  style.appendChild(document.createTextNode(':root{--wpds-border-radius-lg:8px;--wpds-border-radius-md:4px;--wpds-border-radius-sm:2px;--wpds-border-radius-xs:1px;--wpds-border-width-focus:2px;--wpds-border-width-lg:8px;--wpds-border-width-md:4px;--wpds-border-width-sm:2px;--wpds-border-width-xs:1px;--wpds-color-bg-interactive-brand-strong:#3858e9;--wpds-color-bg-interactive-brand-strong-active:#2e49d9;--wpds-color-bg-interactive-brand-weak:#0000;--wpds-color-bg-interactive-brand-weak-active:#e6eaf4;--wpds-color-bg-interactive-error:#0000;--wpds-color-bg-interactive-error-active:#fff6f4;--wpds-color-bg-interactive-error-strong:#cc1818;--wpds-color-bg-interactive-error-strong-active:#b90000;--wpds-color-bg-interactive-error-weak:#0000;--wpds-color-bg-interactive-error-weak-active:#f6e6e3;--wpds-color-bg-interactive-neutral-strong:#2d2d2d;--wpds-color-bg-interactive-neutral-strong-active:#1e1e1e;--wpds-color-bg-interactive-neutral-strong-disabled:#e2e2e2;--wpds-color-bg-interactive-neutral-weak:#0000;--wpds-color-bg-interactive-neutral-weak-active:#eaeaea;--wpds-color-bg-interactive-neutral-weak-disabled:#0000;--wpds-color-bg-surface-brand:#ecf0f9;--wpds-color-bg-surface-caution:#fee994;--wpds-color-bg-surface-caution-weak:#fff9c9;--wpds-color-bg-surface-error:#f6e6e3;--wpds-color-bg-surface-error-weak:#fff6f4;--wpds-color-bg-surface-info:#deebfa;--wpds-color-bg-surface-info-weak:#f2f9ff;--wpds-color-bg-surface-neutral:#f8f8f8;--wpds-color-bg-surface-neutral-strong:#fff;--wpds-color-bg-surface-neutral-weak:#f0f0f0;--wpds-color-bg-surface-success:#c5f7cc;--wpds-color-bg-surface-success-weak:#eaffed;--wpds-color-bg-surface-warning:#fde6bd;--wpds-color-bg-surface-warning-weak:#fff7e0;--wpds-color-bg-thumb-brand:#3858e9;--wpds-color-bg-thumb-brand-active:#3858e9;--wpds-color-bg-thumb-neutral-disabled:#d8d8d8;--wpds-color-bg-thumb-neutral-weak:#8a8a8a;--wpds-color-bg-thumb-neutral-weak-active:#6c6c6c;--wpds-color-bg-track-neutral:#d8d8d8;--wpds-color-bg-track-neutral-weak:#e0e0e0;--wpds-color-fg-content-caution:#281d00;--wpds-color-fg-content-caution-weak:#826a00;--wpds-color-fg-content-error:#470000;--wpds-color-fg-content-error-weak:#cc1818;--wpds-color-fg-content-info:#001b4f;--wpds-color-fg-content-info-weak:#006bd7;--wpds-color-fg-content-neutral:#1e1e1e;--wpds-color-fg-content-neutral-weak:#6d6d6d;--wpds-color-fg-content-success:#002900;--wpds-color-fg-content-success-weak:#007f30;--wpds-color-fg-content-warning:#2e1900;--wpds-color-fg-content-warning-weak:#926300;--wpds-color-fg-interactive-brand:#3858e9;--wpds-color-fg-interactive-brand-active:#3858e9;--wpds-color-fg-interactive-brand-strong:#eff0f2;--wpds-color-fg-interactive-brand-strong-active:#eff0f2;--wpds-color-fg-interactive-error:#cc1818;--wpds-color-fg-interactive-error-active:#cc1818;--wpds-color-fg-interactive-error-strong:#f2efef;--wpds-color-fg-interactive-error-strong-active:#f2efef;--wpds-color-fg-interactive-neutral:#1e1e1e;--wpds-color-fg-interactive-neutral-active:#1e1e1e;--wpds-color-fg-interactive-neutral-disabled:#8a8a8a;--wpds-color-fg-interactive-neutral-strong:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-active:#f0f0f0;--wpds-color-fg-interactive-neutral-strong-disabled:#8a8a8a;--wpds-color-fg-interactive-neutral-weak:#6d6d6d;--wpds-color-fg-interactive-neutral-weak-disabled:#8a8a8a;--wpds-color-stroke-focus-brand:#3858e9;--wpds-color-stroke-interactive-brand:#3858e9;--wpds-color-stroke-interactive-brand-active:#2337c8;--wpds-color-stroke-interactive-error:#cc1818;--wpds-color-stroke-interactive-error-active:#9d0000;--wpds-color-stroke-interactive-error-strong:#cc1818;--wpds-color-stroke-interactive-neutral:#8a8a8a;--wpds-color-stroke-interactive-neutral-active:#6c6c6c;--wpds-color-stroke-interactive-neutral-disabled:#d8d8d8;--wpds-color-stroke-interactive-neutral-strong:#6c6c6c;--wpds-color-stroke-surface-brand:#a3b1d4;--wpds-color-stroke-surface-brand-strong:#3858e9;--wpds-color-stroke-surface-error:#daa39b;--wpds-color-stroke-surface-error-strong:#cc1818;--wpds-color-stroke-surface-info:#9fbcdc;--wpds-color-stroke-surface-info-strong:#006bd7;--wpds-color-stroke-surface-neutral:#d8d8d8;--wpds-color-stroke-surface-neutral-strong:#8a8a8a;--wpds-color-stroke-surface-neutral-weak:#e0e0e0;--wpds-color-stroke-surface-success:#8ac894;--wpds-color-stroke-surface-success-strong:#007f30;--wpds-color-stroke-surface-warning:#d0b381;--wpds-color-stroke-surface-warning-strong:#926300;--wpds-cursor-control:pointer;--wpds-dimension-base:4px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-xs:4px;--wpds-dimension-surface-width-2xl:960px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-xs:240px;--wpds-elevation-lg:0 5px 15px 0 #00000014,0 15px 27px 0 #00000012,0 30px 36px 0 #0000000a,0 50px 43px 0 #00000005;--wpds-elevation-md:0 2px 3px 0 #0000000d,0 4px 5px 0 #0000000a,0 12px 12px 0 #00000008,0 16px 16px 0 #00000005;--wpds-elevation-sm:0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005;--wpds-elevation-xs:0 1px 1px 0 #00000008,0 1px 2px 0 #00000005,0 3px 3px 0 #00000005,0 4px 4px 0 #00000003;--wpds-font-family-body:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-font-family-heading:-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif;--wpds-font-family-mono:"Menlo","Consolas",monaco,monospace;--wpds-font-line-height-2xl:40px;--wpds-font-line-height-lg:28px;--wpds-font-line-height-md:24px;--wpds-font-line-height-sm:20px;--wpds-font-line-height-xl:32px;--wpds-font-line-height-xs:16px;--wpds-font-size-2xl:32px;--wpds-font-size-lg:15px;--wpds-font-size-md:13px;--wpds-font-size-sm:12px;--wpds-font-size-xl:20px;--wpds-font-size-xs:11px;--wpds-font-weight-medium:499;--wpds-font-weight-regular:400}[data-wpds-theme-provider-id][data-wpds-density=compact]{--wpds-dimension-gap-2xl:24px;--wpds-dimension-gap-3xl:32px;--wpds-dimension-gap-lg:12px;--wpds-dimension-gap-md:8px;--wpds-dimension-gap-sm:4px;--wpds-dimension-gap-xl:20px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-2xl:20px;--wpds-dimension-padding-3xl:24px;--wpds-dimension-padding-lg:12px;--wpds-dimension-padding-md:8px;--wpds-dimension-padding-sm:4px;--wpds-dimension-padding-xl:16px;--wpds-dimension-padding-xs:4px}[data-wpds-theme-provider-id][data-wpds-density=comfortable]{--wpds-dimension-gap-2xl:40px;--wpds-dimension-gap-3xl:48px;--wpds-dimension-gap-lg:20px;--wpds-dimension-gap-md:16px;--wpds-dimension-gap-sm:12px;--wpds-dimension-gap-xl:32px;--wpds-dimension-gap-xs:8px;--wpds-dimension-padding-2xl:32px;--wpds-dimension-padding-3xl:40px;--wpds-dimension-padding-lg:20px;--wpds-dimension-padding-md:16px;--wpds-dimension-padding-sm:12px;--wpds-dimension-padding-xl:24px;--wpds-dimension-padding-xs:8px}[data-wpds-theme-provider-id][data-wpds-density=default]{--wpds-dimension-base:4px;--wpds-dimension-gap-2xl:32px;--wpds-dimension-gap-3xl:40px;--wpds-dimension-gap-lg:16px;--wpds-dimension-gap-md:12px;--wpds-dimension-gap-sm:8px;--wpds-dimension-gap-xl:24px;--wpds-dimension-gap-xs:4px;--wpds-dimension-padding-2xl:24px;--wpds-dimension-padding-3xl:32px;--wpds-dimension-padding-lg:16px;--wpds-dimension-padding-md:12px;--wpds-dimension-padding-sm:8px;--wpds-dimension-padding-xl:20px;--wpds-dimension-padding-xs:4px;--wpds-dimension-surface-width-2xl:960px;--wpds-dimension-surface-width-lg:560px;--wpds-dimension-surface-width-md:400px;--wpds-dimension-surface-width-sm:320px;--wpds-dimension-surface-width-xl:720px;--wpds-dimension-surface-width-xs:240px}@media (-webkit-min-device-pixel-ratio:2),(min-resolution:192dpi){:root{--wpds-border-width-focus:1.5px}}.jetpack-forms-integrations-modal .components-modal__header-heading{font-weight:400}'));
  document.head.appendChild(style);
}

// src/blocks/contact-form/components/jetpack-integrations-modal/index.tsx
var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1);
var IntegrationsModal = ({
  isOpen,
  onClose,
  attributes,
  setAttributes,
  integrationsData,
  refreshIntegrations: refreshIntegrations2,
  context = "block-editor",
  components
}) => {
  if (!isOpen) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
    import_components61.Modal,
    {
      title: (0, import_i18n60.__)("Manage integrations", "jetpack-forms"),
      onRequestClose: onClose,
      size: "large",
      className: "jetpack-forms-integrations-modal",
      children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_components61.__experimentalVStack, { spacing: "4", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(
        integrations_list_default,
        {
          integrations: integrationsData,
          refreshIntegrations: refreshIntegrations2,
          context,
          attributes,
          setAttributes,
          components
        }
      ) })
    }
  );
};
var jetpack_integrations_modal_default = IntegrationsModal;

// src/dashboard/components/create-form-button/index.tsx
var import_components63 = __toESM(require_components(), 1);
var import_element76 = __toESM(require_element(), 1);
var import_i18n62 = __toESM(require_i18n(), 1);

// src/dashboard/components/form-name-modal/index.tsx
var import_components62 = __toESM(require_components(), 1);
var import_element75 = __toESM(require_element(), 1);
var import_i18n61 = __toESM(require_i18n(), 1);

// src/dashboard/components/form-name-modal/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='e3be9dcb8f']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "e3be9dcb8f");
  style.appendChild(document.createTextNode(".jp-forms-name-modal__buttons{display:flex;gap:8px;justify-content:flex-end;margin-block-start:16px}"));
  document.head.appendChild(style);
}

// src/dashboard/components/form-name-modal/index.tsx
var import_jsx_runtime138 = __toESM(require_jsx_runtime(), 1);
function FormNameModal({
  isOpen,
  onClose,
  onSave,
  title,
  initialValue = "",
  primaryButtonLabel,
  secondaryButtonLabel,
  placeholder,
  inputLabel,
  fallbackName
}) {
  const [name, setName] = (0, import_element75.useState)(initialValue);
  const [isSaving, setIsSaving] = (0, import_element75.useState)(false);
  (0, import_element75.useEffect)(() => {
    if (isOpen) {
      setName(initialValue);
    }
  }, [isOpen, initialValue]);
  const handleClose = (0, import_element75.useCallback)(() => {
    if (!isSaving) {
      onClose();
    }
  }, [isSaving, onClose]);
  const handleConfirm = (0, import_element75.useCallback)(async () => {
    if (isSaving) {
      return;
    }
    setIsSaving(true);
    const finalName = name.trim() || fallbackName || (0, import_i18n61.__)("Untitled Form", "jetpack-forms");
    try {
      await onSave(finalName);
      onClose();
    } catch {
    } finally {
      setIsSaving(false);
    }
  }, [name, fallbackName, isSaving, onSave, onClose]);
  const onSubmitForm = (0, import_element75.useCallback)(
    (event) => {
      event.preventDefault();
      handleConfirm();
    },
    [handleConfirm]
  );
  if (!isOpen) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_components62.Modal, { title, onRequestClose: handleClose, size: "medium", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("form", { onSubmit: onSubmitForm, children: [
    /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(
      import_components62.TextControl,
      {
        label: inputLabel || (0, import_i18n61.__)("Name", "jetpack-forms"),
        value: name,
        onChange: setName,
        __next40pxDefaultSize: true,
        placeholder,
        disabled: isSaving
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime138.jsxs)("div", { className: "jp-forms-name-modal__buttons", children: [
      /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_components62.Button, { variant: "tertiary", onClick: handleClose, disabled: isSaving, children: secondaryButtonLabel || (0, import_i18n61.__)("Cancel", "jetpack-forms") }),
      /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_components62.Button, { "aria-disabled": isSaving, isBusy: isSaving, variant: "primary", type: "submit", children: primaryButtonLabel || (0, import_i18n61.__)("Save", "jetpack-forms") })
    ] })
  ] }) });
}

// src/dashboard/components/create-form-button/index.tsx
var import_jsx_runtime139 = __toESM(require_jsx_runtime(), 1);
function CreateFormButton({
  label = (0, import_i18n62.__)("Create a form", "jetpack-forms"),
  showPatterns = false,
  variant = "secondary",
  showIcon = true,
  showNameModal = false
}) {
  const { openNewForm } = useCreateForm();
  const [isModalOpen, setIsModalOpen] = (0, import_element76.useState)(false);
  const onButtonClickHandler = (0, import_element76.useCallback)(() => {
    if (showNameModal) {
      setIsModalOpen(true);
      return;
    }
    openNewForm({
      showPatterns,
      analyticsEvent: () => {
        analytics_default.tracks.recordEvent("jetpack_wpa_forms_landing_page_cta_click", {
          button: "forms"
        });
      }
    });
  }, [showNameModal, openNewForm, showPatterns]);
  const handleModalClose = (0, import_element76.useCallback)(() => {
    setIsModalOpen(false);
  }, []);
  const handleModalSave = (0, import_element76.useCallback)(
    async (formTitle) => {
      await openNewForm({
        showPatterns,
        formTitle,
        analyticsEvent: () => {
          analytics_default.tracks.recordEvent("jetpack_wpa_forms_landing_page_cta_click", {
            button: "forms"
          });
        }
      });
    },
    [openNewForm, showPatterns]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime139.jsxs)(import_jsx_runtime139.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
      import_components63.Button,
      {
        size: "compact",
        variant,
        onClick: onButtonClickHandler,
        icon: showIcon ? plus_default : void 0,
        className: "create-form-button",
        children: label
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(
      FormNameModal,
      {
        isOpen: isModalOpen,
        onClose: handleModalClose,
        onSave: handleModalSave,
        title: (0, import_i18n62.__)("Create form", "jetpack-forms"),
        primaryButtonLabel: (0, import_i18n62.__)("Create", "jetpack-forms"),
        secondaryButtonLabel: (0, import_i18n62.__)("Cancel", "jetpack-forms"),
        placeholder: (0, import_i18n62.__)("Enter form title", "jetpack-forms")
      }
    )
  ] });
}

// src/dashboard/components/empty-responses/index.tsx
var import_components64 = __toESM(require_components(), 1);
var import_data10 = __toESM(require_data(), 1);
var import_element77 = __toESM(require_element(), 1);
var import_i18n63 = __toESM(require_i18n(), 1);

// src/store/integrations/index.ts
var import_data9 = __toESM(require_data(), 1);

// src/store/integrations/actions.ts
var actions_exports2 = {};
__export(actions_exports2, {
  invalidateIntegrations: () => invalidateIntegrations,
  receiveIntegrations: () => receiveIntegrations,
  refreshIntegrations: () => refreshIntegrations,
  setIntegrationsError: () => setIntegrationsError,
  setIntegrationsLoading: () => setIntegrationsLoading
});

// src/store/integrations/action-types.ts
var RECEIVE_INTEGRATIONS = "RECEIVE_INTEGRATIONS";
var INVALIDATE_INTEGRATIONS = "INVALIDATE_INTEGRATIONS";
var SET_INTEGRATIONS_LOADING = "SET_INTEGRATIONS_LOADING";
var SET_INTEGRATIONS_ERROR = "SET_INTEGRATIONS_ERROR";

// src/store/integrations/resolvers.ts
var resolvers_exports2 = {};
__export(resolvers_exports2, {
  getIntegrations: () => getIntegrations,
  resetMetadataFlag: () => resetMetadataFlag
});
var import_api_fetch4 = __toESM(require_api_fetch(), 1);
var import_url3 = __toESM(require_url(), 1);
var hasLoadedMeta = false;
var resetMetadataFlag = () => {
  hasLoadedMeta = false;
};
var fetchIntegrationsMetadata = () => async ({ dispatch: dispatch4 }) => {
  const metadataPath = "/wp/v2/feedback/integrations-metadata";
  const metadata = await (0, import_api_fetch4.default)({ path: metadataPath });
  const partialIntegrations = metadata.map((meta) => ({
    ...meta,
    pluginFile: null,
    isInstalled: false,
    isActive: false,
    isConnected: false,
    needsConnection: meta.type === "service",
    version: null,
    settingsUrl: null,
    details: {},
    __isPartial: true
    // Flag to indicate this is metadata-only
  }));
  dispatch4(receiveIntegrations(partialIntegrations));
};
var fetchFullIntegrations = () => async ({ dispatch: dispatch4 }) => {
  const fullPath = (0, import_url3.addQueryArgs)("/wp/v2/feedback/integrations", { version: 2 });
  const fullIntegrations = await (0, import_api_fetch4.default)({ path: fullPath });
  dispatch4(receiveIntegrations(fullIntegrations));
};
var getIntegrations = () => async ({ dispatch: dispatch4 }) => {
  dispatch4(setIntegrationsLoading(true));
  try {
    if (!hasLoadedMeta) {
      await fetchIntegrationsMetadata()({ dispatch: dispatch4 });
      hasLoadedMeta = true;
    }
    await fetchFullIntegrations()({ dispatch: dispatch4 });
  } catch (e2) {
    const message2 = e2 instanceof Error ? e2.message : UNKNOWN_ERROR_MESSAGE;
    dispatch4(setIntegrationsError(message2));
  } finally {
    dispatch4(setIntegrationsLoading(false));
  }
};
getIntegrations.shouldInvalidate = (action) => action.type === INVALIDATE_INTEGRATIONS;

// src/store/integrations/actions.ts
var receiveIntegrations = (items) => ({
  type: RECEIVE_INTEGRATIONS,
  items
});
var invalidateIntegrations = () => ({
  type: INVALIDATE_INTEGRATIONS
});
var setIntegrationsLoading = (isLoading) => ({
  type: SET_INTEGRATIONS_LOADING,
  isLoading
});
var setIntegrationsError = (error2) => ({
  type: SET_INTEGRATIONS_ERROR,
  error: error2
});
var refreshIntegrations = () => getIntegrations();

// src/store/integrations/reducer.ts
var DEFAULT_STATE2 = {
  items: null,
  isLoading: false,
  error: null
};
function reducer2(state = DEFAULT_STATE2, action) {
  switch (action.type) {
    case SET_INTEGRATIONS_LOADING:
      return {
        ...state,
        isLoading: !!action.isLoading,
        error: action.isLoading ? null : state.error
      };
    case SET_INTEGRATIONS_ERROR:
      return {
        ...state,
        isLoading: false,
        error: action.error ?? UNKNOWN_ERROR_MESSAGE
      };
    case RECEIVE_INTEGRATIONS:
      return {
        ...state,
        items: action.items,
        isLoading: false,
        error: null
      };
    case INVALIDATE_INTEGRATIONS:
      return {
        ...state,
        items: null,
        isLoading: false
      };
    default:
      return state;
  }
}

// src/store/integrations/selectors.ts
var selectors_exports2 = {};
__export(selectors_exports2, {
  getIntegrations: () => getIntegrations2,
  getIntegrationsError: () => getIntegrationsError,
  isIntegrationsLoading: () => isIntegrationsLoading
});
var getIntegrations2 = (state) => state.items;
var isIntegrationsLoading = (state) => state.isLoading;
var getIntegrationsError = (state) => state.error;

// src/store/integrations/index.ts
var INTEGRATIONS_STORE = "jetpack/forms/integrations";
var store2 = (0, import_data9.createReduxStore)(INTEGRATIONS_STORE, {
  reducer: reducer2,
  actions: actions_exports2,
  selectors: selectors_exports2,
  resolvers: resolvers_exports2
});
(0, import_data9.register)(store2);

// src/dashboard/components/empty-responses/index.tsx
var import_jsx_runtime140 = __toESM(require_jsx_runtime(), 1);
var EmptyWrapper = ({ heading = "", body = "", actions: actions2 = null }) => /* @__PURE__ */ (0, import_jsx_runtime140.jsxs)(import_components64.__experimentalVStack, { alignment: "center", spacing: "2", children: [
  heading && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_components64.__experimentalText, { as: "h3", weight: "500", size: "15", children: heading }),
  body && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_components64.__experimentalText, { variant: "muted", children: body }),
  actions2 && /* @__PURE__ */ (0, import_jsx_runtime140.jsx)("span", { style: { marginBlockStart: "16px" }, children: actions2 })
] });
var NoResults = () => /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(
  EmptyWrapper,
  {
    heading: (0, import_i18n63.__)("No results found", "jetpack-forms"),
    body: (0, import_i18n63.__)(
      "Try adjusting your search or filters to find what you're looking for.",
      "jetpack-forms"
    )
  }
);

// src/dashboard/constants.ts
var import_i18n64 = __toESM(require_i18n(), 1);
var FORM_STATUSES = [
  "all",
  "publish",
  "draft",
  "pending",
  "future",
  "private",
  "trash"
];
var NON_TRASH_FORM_STATUSES = FORM_STATUSES.filter(
  (s2) => s2 !== "all" && s2 !== "trash"
).join(",");
function getFormStatusLabel(status) {
  switch (status) {
    case "all":
      return (0, import_i18n64.__)("All", "jetpack-forms");
    case "publish":
      return (0, import_i18n64.__)("Published", "jetpack-forms");
    case "draft":
      return (0, import_i18n64.__)("Draft", "jetpack-forms");
    case "pending":
      return (0, import_i18n64.__)("Pending review", "jetpack-forms");
    case "future":
      return (0, import_i18n64.__)("Scheduled", "jetpack-forms");
    case "private":
      return (0, import_i18n64.__)("Private", "jetpack-forms");
    case "trash":
      return (0, import_i18n64.__)("Trash", "jetpack-forms");
    default:
      return status;
  }
}

// src/dashboard/hooks/use-delete-form.ts
var import_data13 = __toESM(require_data(), 1);
var import_element79 = __toESM(require_element(), 1);
var import_i18n65 = __toESM(require_i18n(), 1);
var import_notices2 = __toESM(require_notices(), 1);

// src/dashboard/store/index.js
var import_data12 = __toESM(require_data(), 1);

// src/dashboard/store/actions.js
var actions_exports3 = {};
__export(actions_exports3, {
  addPendingAction: () => addPendingAction,
  clearInvalidRecords: () => clearInvalidRecords,
  doBulkAction: () => doBulkAction,
  invalidateCounts: () => invalidateCounts,
  invalidateFilters: () => invalidateFilters,
  invalidateFormStatusCounts: () => invalidateFormStatusCounts,
  markRecordsAsInvalid: () => markRecordsAsInvalid,
  receiveFilters: () => receiveFilters,
  removePendingAction: () => removePendingAction,
  setCounts: () => setCounts,
  setCurrentQuery: () => setCurrentQuery,
  setFormStatusCounts: () => setFormStatusCounts,
  setSelectedResponses: () => setSelectedResponses,
  updateCountsOptimistically: () => updateCountsOptimistically
});
var import_api_fetch5 = __toESM(require_api_fetch(), 1);

// src/dashboard/store/action-types.js
var RECEIVE_FILTERS = "RECEIVE_FILTERS";
var INVALIDATE_FILTERS = "INVALIDATE_FILTERS";
var SET_CURRENT_QUERY = "SET_CURRENT_QUERY";
var SET_SELECTED_RESPONSES = "SET_SELECTED_RESPONSES";
var SET_COUNTS = "SET_COUNTS";
var UPDATE_COUNTS_OPTIMISTICALLY = "UPDATE_COUNTS_OPTIMISTICALLY";
var INVALIDATE_COUNTS = "INVALIDATE_COUNTS";
var MARK_RECORDS_AS_INVALID = "MARK_RECORDS_AS_INVALID";
var CLEAR_INVALID_RECORDS = "CLEAR_INVALID_RECORDS";
var ADD_PENDING_ACTION = "ADD_PENDING_ACTION";
var REMOVE_PENDING_ACTION = "REMOVE_PENDING_ACTION";
var SET_FORM_STATUS_COUNTS = "SET_FORM_STATUS_COUNTS";
var INVALIDATE_FORM_STATUS_COUNTS = "INVALIDATE_FORM_STATUS_COUNTS";

// src/dashboard/store/actions.js
function receiveFilters(filters2) {
  return {
    type: RECEIVE_FILTERS,
    filters: filters2
  };
}
var invalidateFilters = () => {
  return { type: INVALIDATE_FILTERS };
};
var invalidateCounts = () => {
  return { type: INVALIDATE_COUNTS };
};
var setSelectedResponses = (selectedResponses) => ({
  type: SET_SELECTED_RESPONSES,
  selectedResponses
});
function setCurrentQuery(currentQuery2) {
  return ({ dispatch: dispatch4, select: select3, registry }) => {
    const previousQuery = select3.getCurrentQuery();
    const queryWithFormat = {
      ...currentQuery2,
      fields_format: currentQuery2.fields_format ?? previousQuery.fields_format ?? "collection"
    };
    const filtersChanged = previousQuery.status !== queryWithFormat.status || previousQuery.search !== queryWithFormat.search || previousQuery.is_unread !== queryWithFormat.is_unread || previousQuery.parent !== queryWithFormat.parent || previousQuery.source !== queryWithFormat.source || previousQuery.before !== queryWithFormat.before || previousQuery.after !== queryWithFormat.after;
    if (filtersChanged) {
      dispatch4(clearInvalidRecords());
      if (registry && registry.dispatch("core")) {
        registry.dispatch("core").invalidateResolution("getEntityRecords", ["postType", "feedback", queryWithFormat]);
      }
    }
    dispatch4({
      type: SET_CURRENT_QUERY,
      currentQuery: queryWithFormat
    });
  };
}
function setCounts(counts2, queryParams = {}) {
  return {
    type: SET_COUNTS,
    counts: counts2,
    queryParams
  };
}
function updateCountsOptimistically(fromStatus, toStatus, count = 1, queryParams = {}) {
  return {
    type: UPDATE_COUNTS_OPTIMISTICALLY,
    fromStatus,
    toStatus,
    count,
    queryParams
  };
}
function markRecordsAsInvalid(recordIds) {
  return {
    type: MARK_RECORDS_AS_INVALID,
    recordIds
  };
}
function clearInvalidRecords() {
  return {
    type: CLEAR_INVALID_RECORDS
  };
}
function addPendingAction(actionId) {
  return {
    type: ADD_PENDING_ACTION,
    actionId
  };
}
function removePendingAction(actionId) {
  return {
    type: REMOVE_PENDING_ACTION,
    actionId
  };
}
function setFormStatusCounts(formStatusCounts2) {
  return {
    type: SET_FORM_STATUS_COUNTS,
    formStatusCounts: formStatusCounts2
  };
}
var invalidateFormStatusCounts = () => {
  return { type: INVALIDATE_FORM_STATUS_COUNTS };
};
var doBulkAction = (ids, action) => async () => {
  try {
    await (0, import_api_fetch5.default)({
      path: `wp/v2/feedback/bulk_actions`,
      method: "POST",
      data: {
        action,
        post_ids: ids
      }
    });
  } catch {
  }
};

// src/dashboard/store/reducer.js
var import_data11 = __toESM(require_data(), 1);
var filters = (state = {}, action) => {
  if (action.type === RECEIVE_FILTERS) {
    return action.filters;
  }
  return state;
};
var currentQuery = (state = {
  order: "desc",
  orderby: "date",
  page: 1,
  per_page: 20,
  status: "draft,publish",
  fields_format: "collection"
}, action) => {
  if (action.type === SET_CURRENT_QUERY) {
    return action.currentQuery;
  }
  return state;
};
var selectedResponsesFromCurrentDataset = (state = [], action) => {
  if (action.type === SET_SELECTED_RESPONSES) {
    return action.selectedResponses;
  }
  return state;
};
var normalizeValue2 = (value) => {
  if (Array.isArray(value)) {
    return value.slice().sort().join(",");
  }
  if (typeof value === "boolean") {
    return value ? "1" : "0";
  }
  return String(value);
};
var getCacheKey = (queryParams = {}) => {
  const keys = ["search", "parent", "source", "before", "after", "is_unread"];
  const parts = keys.filter((key) => queryParams[key] !== void 0).map((key) => `${key}:${normalizeValue2(queryParams[key])}`);
  return parts.length > 0 ? parts.join("|") : "default";
};
var counts = (state = {}, action) => {
  if (action.type === SET_COUNTS) {
    const cacheKey = getCacheKey(action.queryParams);
    return {
      ...state,
      [cacheKey]: action.counts
    };
  }
  if (action.type === UPDATE_COUNTS_OPTIMISTICALLY) {
    const { fromStatus, toStatus, count, queryParams } = action;
    const cacheKey = getCacheKey(queryParams);
    const currentCounts = state[cacheKey] || { inbox: 0, spam: 0, trash: 0 };
    const newCounts = { ...currentCounts };
    if (fromStatus === "inbox" || fromStatus === "publish" || fromStatus === "draft") {
      newCounts.inbox = Math.max(0, newCounts.inbox - count);
    } else if (fromStatus === "spam") {
      newCounts.spam = Math.max(0, newCounts.spam - count);
    } else if (fromStatus === "trash") {
      newCounts.trash = Math.max(0, newCounts.trash - count);
    }
    if (toStatus === "publish" || toStatus === "draft") {
      newCounts.inbox += count;
    } else if (toStatus === "spam") {
      newCounts.spam += count;
    } else if (toStatus === "trash") {
      newCounts.trash += count;
    }
    return {
      ...state,
      [cacheKey]: newCounts
    };
  }
  return state;
};
var invalidRecords = (state = /* @__PURE__ */ new Set(), action) => {
  if (action.type === MARK_RECORDS_AS_INVALID) {
    return /* @__PURE__ */ new Set([...state, ...action.recordIds]);
  }
  if (action.type === CLEAR_INVALID_RECORDS) {
    return /* @__PURE__ */ new Set();
  }
  return state;
};
var pendingActions = (state = /* @__PURE__ */ new Set(), action) => {
  if (action.type === ADD_PENDING_ACTION) {
    return /* @__PURE__ */ new Set([...state, action.actionId]);
  }
  if (action.type === REMOVE_PENDING_ACTION) {
    const newState = new Set(state);
    newState.delete(action.actionId);
    return newState;
  }
  return state;
};
var formStatusCounts = (state = null, action) => {
  if (action.type === SET_FORM_STATUS_COUNTS) {
    return action.formStatusCounts;
  }
  return state;
};
var reducer_default = (0, import_data11.combineReducers)({
  selectedResponsesFromCurrentDataset,
  filters,
  currentQuery,
  counts,
  invalidRecords,
  pendingActions,
  formStatusCounts
});

// src/dashboard/store/resolvers.js
var resolvers_exports3 = {};
__export(resolvers_exports3, {
  getCounts: () => getCounts,
  getFilters: () => getFilters,
  getFormStatusCounts: () => getFormStatusCounts
});
var import_api_fetch6 = __toESM(require_api_fetch(), 1);
var import_url4 = __toESM(require_url(), 1);
var getFilters = () => async ({ dispatch: dispatch4 }) => {
  const results = await (0, import_api_fetch6.default)({
    path: "/wp/v2/feedback/filters"
  });
  dispatch4.receiveFilters(results);
};
getFilters.shouldInvalidate = (action) => action.type === INVALIDATE_FILTERS;
var getCounts = (queryParams = {}) => async ({ dispatch: dispatch4 }) => {
  const params = {};
  if (queryParams?.search) {
    params.search = queryParams.search;
  }
  if (queryParams?.parent) {
    params.parent = queryParams.parent;
  }
  if (queryParams?.source) {
    params.source = queryParams.source;
  }
  if (queryParams?.before) {
    params.before = queryParams.before;
  }
  if (queryParams?.after) {
    params.after = queryParams.after;
  }
  if (queryParams?.is_unread !== void 0) {
    params.is_unread = queryParams.is_unread;
  }
  const path = (0, import_url4.addQueryArgs)("/wp/v2/feedback/counts", params);
  const response = await (0, import_api_fetch6.default)({ path });
  dispatch4.setCounts(response, queryParams);
};
getCounts.shouldInvalidate = (action) => action.type === INVALIDATE_COUNTS;
var getFormStatusCounts = () => async ({ dispatch: dispatch4 }) => {
  const response = await (0, import_api_fetch6.default)({ path: "/wp/v2/jetpack-forms/status-counts" });
  dispatch4.setFormStatusCounts(response);
};
getFormStatusCounts.shouldInvalidate = (action) => action.type === INVALIDATE_FORM_STATUS_COUNTS;

// src/dashboard/store/selectors.js
var selectors_exports3 = {};
__export(selectors_exports3, {
  getCounts: () => getCounts2,
  getCurrentQuery: () => getCurrentQuery,
  getCurrentStatus: () => getCurrentStatus,
  getFilters: () => getFilters2,
  getFormStatusCounts: () => getFormStatusCounts2,
  getInboxCount: () => getInboxCount,
  getInvalidRecords: () => getInvalidRecords,
  getPendingActions: () => getPendingActions,
  getSelectedResponsesCount: () => getSelectedResponsesCount,
  getSelectedResponsesFromCurrentDataset: () => getSelectedResponsesFromCurrentDataset,
  getSpamCount: () => getSpamCount,
  getTrashCount: () => getTrashCount,
  hasPendingActions: () => hasPendingActions,
  isRecordInvalid: () => isRecordInvalid
});
var getFilters2 = (state) => state.filters;
var getCurrentQuery = (state) => state.currentQuery;
var getCurrentStatus = (state) => state.currentQuery?.status ?? "draft,publish";
var getSelectedResponsesFromCurrentDataset = (state) => state.selectedResponsesFromCurrentDataset;
var getSelectedResponsesCount = (state) => state.selectedResponsesFromCurrentDataset.length;
var getCounts2 = (state, queryParams = {}) => {
  const cacheKey = getCacheKey(queryParams);
  return state.counts[cacheKey] || { inbox: 0, spam: 0, trash: 0 };
};
var getInboxCount = (state, queryParams = {}) => {
  const counts2 = getCounts2(state, queryParams);
  return counts2.inbox;
};
var getSpamCount = (state, queryParams = {}) => {
  const counts2 = getCounts2(state, queryParams);
  return counts2.spam;
};
var getTrashCount = (state, queryParams = {}) => {
  const counts2 = getCounts2(state, queryParams);
  return counts2.trash;
};
var getInvalidRecords = (state) => {
  return state.invalidRecords || /* @__PURE__ */ new Set();
};
var isRecordInvalid = (state, recordId) => {
  return state.invalidRecords?.has(recordId) || false;
};
var getPendingActions = (state) => {
  return state.pendingActions || /* @__PURE__ */ new Set();
};
var hasPendingActions = (state) => {
  return (state.pendingActions?.size ?? 0) > 0;
};
var getFormStatusCounts2 = (state) => {
  return state.formStatusCounts;
};

// src/dashboard/store/index.js
var STORE_NAME = "FORM_RESPONSES";
var store3 = (0, import_data12.createReduxStore)(STORE_NAME, {
  actions: actions_exports3,
  reducer: reducer_default,
  selectors: selectors_exports3,
  resolvers: resolvers_exports3
});
(0, import_data12.register)(store3);

// src/dashboard/hooks/use-forms-data.ts
var import_core_data = __toESM(require_core_data(), 1);
var import_element78 = __toESM(require_element(), 1);
var import_html_entities = __toESM(require_html_entities(), 1);
function getFormsListQuery(page, perPage, search, status, hasResponses) {
  const queryParams = {
    context: "edit",
    jetpack_forms_context: "dashboard",
    order: "desc",
    orderby: "modified",
    page,
    per_page: perPage,
    status
  };
  if (search) {
    queryParams.search = search;
  }
  if (hasResponses) {
    queryParams.has_responses = hasResponses;
  }
  return queryParams;
}
function useFormsData(page, perPage, search, status, hasResponses) {
  const query = (0, import_element78.useMemo)(() => {
    return getFormsListQuery(page, perPage, search, status, hasResponses);
  }, [page, perPage, search, status, hasResponses]);
  const {
    records: rawRecords,
    hasResolved,
    totalItems,
    totalPages
  } = (0, import_core_data.useEntityRecords)("postType", "jetpack_form", query);
  const records = (0, import_element78.useMemo)(() => {
    const seen = /* @__PURE__ */ new Set();
    const items = [];
    for (const item of rawRecords || []) {
      const typedItem = item;
      if (seen.has(typedItem.id)) {
        continue;
      }
      seen.add(typedItem.id);
      items.push({
        id: typedItem.id,
        title: (0, import_html_entities.decodeEntities)(typedItem.title?.rendered || ""),
        status: typedItem.status,
        modified: typedItem.modified,
        entriesCount: typedItem.entries_count ?? 0,
        editUrl: typedItem.edit_url
      });
    }
    return items;
  }, [rawRecords]);
  return {
    records,
    isLoading: !hasResolved,
    totalItems: totalItems ?? 0,
    totalPages: totalPages ?? 0
  };
}

// src/dashboard/hooks/use-delete-form.ts
function useDeleteForm({
  view,
  setView,
  recordsLength,
  statusQuery
}) {
  const [isDeleting, setIsDeleting] = (0, import_element79.useState)(false);
  const [isPermanentDeleteConfirmOpen, setIsPermanentDeleteConfirmOpen] = (0, import_element79.useState)(false);
  const [permanentDeleteItems, setPermanentDeleteItems] = (0, import_element79.useState)([]);
  const { saveEntityRecord, deleteEntityRecord, invalidateResolution } = (0, import_data13.useDispatch)(
    "core"
  );
  const { createSuccessNotice, createErrorNotice } = (0, import_data13.useDispatch)(import_notices2.store);
  const { invalidateFormStatusCounts: invalidateFormStatusCounts2 } = (0, import_data13.useDispatch)(store3);
  const page = view.page ?? 1;
  const perPage = view.perPage ?? 20;
  const search = view.search ?? "";
  const currentQuery2 = (0, import_element79.useMemo)(
    () => getFormsListQuery(page, perPage, search, statusQuery),
    [page, perPage, search, statusQuery]
  );
  const invalidateListQueries = (0, import_element79.useCallback)(
    (query) => {
      invalidateResolution("getEntityRecords", ["postType", "jetpack_form", query]);
      invalidateResolution("getEntityRecords", [
        "postType",
        "jetpack_form",
        { ...query, per_page: 1, _fields: "id" }
      ]);
    },
    [invalidateResolution]
  );
  const restoreItemsToDraft = (0, import_element79.useCallback)(
    async (items, {
      successNoticeIdPrefix,
      errorNoticeIdPrefix
    }) => {
      const promises = await Promise.allSettled(
        items.map(
          (item) => saveEntityRecord(
            "postType",
            "jetpack_form",
            { id: item.id, status: "draft" },
            { throwOnError: true }
          )
        )
      );
      const restoredCount = promises.filter((p2) => p2.status === "fulfilled").length;
      const failedCount = promises.length - restoredCount;
      if (restoredCount) {
        const successMessage = restoredCount === 1 ? (0, import_i18n65.__)("Form restored as draft.", "jetpack-forms") : (0, import_i18n65.sprintf)(
          /* translators: %d: number of forms. */
          (0, import_i18n65._n)(
            "%d form restored as draft.",
            "%d forms restored as draft.",
            restoredCount,
            "jetpack-forms"
          ),
          restoredCount
        );
        createSuccessNotice(successMessage, {
          type: "snackbar",
          id: `${successNoticeIdPrefix}-${Date.now()}`
        });
      }
      if (failedCount) {
        createErrorNotice(
          (0, import_i18n65.sprintf)(
            /* translators: %d: number of forms. */
            (0, import_i18n65._n)(
              "Could not restore %d form.",
              "Could not restore %d forms.",
              failedCount,
              "jetpack-forms"
            ),
            failedCount
          ),
          { type: "snackbar", id: `${errorNoticeIdPrefix}-${Date.now()}` }
        );
      }
      return { restoredCount, failedCount };
    },
    [createErrorNotice, createSuccessNotice, saveEntityRecord]
  );
  const restoreForms = (0, import_element79.useCallback)(
    async (items) => {
      if (isDeleting || !items?.length) {
        return;
      }
      setIsDeleting(true);
      const currentQuerySnapshot = currentQuery2;
      let shouldNavigateToPreviousPage = false;
      try {
        const { restoredCount } = await restoreItemsToDraft(items, {
          successNoticeIdPrefix: "restore-forms",
          errorNoticeIdPrefix: "restore-forms-error"
        });
        shouldNavigateToPreviousPage = page > 1 && restoredCount >= recordsLength;
        if (restoredCount && shouldNavigateToPreviousPage) {
          setView({ ...view, page: page - 1 });
        }
      } finally {
        setIsDeleting(false);
        invalidateListQueries(currentQuerySnapshot);
        invalidateFormStatusCounts2();
        if (shouldNavigateToPreviousPage) {
          invalidateListQueries(
            getFormsListQuery(page - 1, perPage, search, statusQuery)
          );
        }
      }
    },
    [
      currentQuery2,
      invalidateFormStatusCounts2,
      invalidateListQueries,
      isDeleting,
      page,
      perPage,
      recordsLength,
      restoreItemsToDraft,
      search,
      setView,
      statusQuery,
      view
    ]
  );
  const undoTrashForms = (0, import_element79.useCallback)(
    async (items) => {
      if (isDeleting || !items?.length) {
        return;
      }
      setIsDeleting(true);
      const currentQuerySnapshot = currentQuery2;
      try {
        await restoreItemsToDraft(items, {
          successNoticeIdPrefix: "undo-trash-forms",
          errorNoticeIdPrefix: "undo-trash-forms-error"
        });
      } finally {
        setIsDeleting(false);
        invalidateListQueries(currentQuerySnapshot);
        invalidateFormStatusCounts2();
      }
    },
    [
      currentQuery2,
      invalidateFormStatusCounts2,
      invalidateListQueries,
      isDeleting,
      restoreItemsToDraft
    ]
  );
  const trashForms = (0, import_element79.useCallback)(
    async (items) => {
      if (isDeleting || !items?.length) {
        return;
      }
      setIsDeleting(true);
      const currentQuerySnapshot = currentQuery2;
      let shouldNavigateToPreviousPage = false;
      try {
        const promises = await Promise.allSettled(
          items.map(
            (item) => deleteEntityRecord(
              "postType",
              "jetpack_form",
              item.id,
              { force: false },
              { throwOnError: true }
            )
          )
        );
        const trashedItems = items.filter(
          (_, index) => promises[index]?.status === "fulfilled"
        );
        const trashedCount = trashedItems.length;
        const failedCount = items.length - trashedCount;
        if (trashedCount) {
          const successMessage = trashedCount === 1 ? (0, import_i18n65.__)("Form moved to trash.", "jetpack-forms") : (0, import_i18n65.sprintf)(
            /* translators: %d: number of forms. */
            (0, import_i18n65._n)(
              "%d form moved to trash.",
              "%d forms moved to trash.",
              trashedCount,
              "jetpack-forms"
            ),
            trashedCount
          );
          createSuccessNotice(successMessage, {
            type: "snackbar",
            id: `trash-forms-${Date.now()}`,
            actions: [
              {
                label: (0, import_i18n65.__)("Undo", "jetpack-forms"),
                onClick: () => void undoTrashForms(trashedItems)
              }
            ]
          });
          shouldNavigateToPreviousPage = page > 1 && trashedCount >= recordsLength;
          if (shouldNavigateToPreviousPage) {
            setView({ ...view, page: page - 1 });
          }
        }
        if (failedCount) {
          createErrorNotice(
            (0, import_i18n65.sprintf)(
              /* translators: %d: number of forms. */
              (0, import_i18n65._n)(
                "Could not move %d form to trash.",
                "Could not move %d forms to trash.",
                failedCount,
                "jetpack-forms"
              ),
              failedCount
            ),
            { type: "snackbar", id: `trash-forms-error-${Date.now()}` }
          );
        }
      } finally {
        setIsDeleting(false);
        invalidateListQueries(currentQuerySnapshot);
        invalidateFormStatusCounts2();
        if (shouldNavigateToPreviousPage) {
          invalidateListQueries(
            getFormsListQuery(page - 1, perPage, search, statusQuery)
          );
        }
      }
    },
    [
      createErrorNotice,
      createSuccessNotice,
      currentQuery2,
      deleteEntityRecord,
      invalidateFormStatusCounts2,
      invalidateListQueries,
      isDeleting,
      page,
      perPage,
      recordsLength,
      search,
      setView,
      statusQuery,
      undoTrashForms,
      view
    ]
  );
  const openPermanentDeleteConfirm = (0, import_element79.useCallback)((items) => {
    setPermanentDeleteItems(items || []);
    setIsPermanentDeleteConfirmOpen(true);
  }, []);
  const closePermanentDeleteConfirm = (0, import_element79.useCallback)(() => {
    setIsPermanentDeleteConfirmOpen(false);
    setPermanentDeleteItems([]);
  }, []);
  const confirmPermanentDelete = (0, import_element79.useCallback)(async () => {
    if (!permanentDeleteItems.length || isDeleting) {
      return;
    }
    setIsPermanentDeleteConfirmOpen(false);
    setIsDeleting(true);
    const currentQuerySnapshot = currentQuery2;
    let shouldNavigateToPreviousPage = false;
    try {
      const promises = await Promise.allSettled(
        permanentDeleteItems.map(
          (item) => deleteEntityRecord(
            "postType",
            "jetpack_form",
            item.id,
            { force: true },
            { throwOnError: true }
          )
        )
      );
      const deletedCount = promises.filter((p2) => p2.status === "fulfilled").length;
      const failedCount = promises.length - deletedCount;
      if (deletedCount) {
        const successMessage = deletedCount === 1 ? (0, import_i18n65.__)("Form deleted permanently.", "jetpack-forms") : (0, import_i18n65.sprintf)(
          /* translators: %d: number of forms. */
          (0, import_i18n65._n)(
            "%d form deleted permanently.",
            "%d forms deleted permanently.",
            deletedCount,
            "jetpack-forms"
          ),
          deletedCount
        );
        createSuccessNotice(successMessage, {
          type: "snackbar",
          id: `delete-forms-permanently-${Date.now()}`
        });
        shouldNavigateToPreviousPage = page > 1 && deletedCount >= recordsLength;
        if (shouldNavigateToPreviousPage) {
          setView({ ...view, page: page - 1 });
        }
      }
      if (failedCount) {
        createErrorNotice(
          (0, import_i18n65.sprintf)(
            /* translators: %d: number of forms. */
            (0, import_i18n65._n)(
              "Could not permanently delete %d form.",
              "Could not permanently delete %d forms.",
              failedCount,
              "jetpack-forms"
            ),
            failedCount
          ),
          { type: "snackbar", id: `delete-forms-permanently-error-${Date.now()}` }
        );
      }
    } catch {
      createErrorNotice((0, import_i18n65.__)("Could not delete forms permanently.", "jetpack-forms"), {
        type: "snackbar",
        id: `delete-forms-permanently-error-${Date.now()}`
      });
    } finally {
      setIsDeleting(false);
      setPermanentDeleteItems([]);
      invalidateListQueries(currentQuerySnapshot);
      invalidateFormStatusCounts2();
      if (shouldNavigateToPreviousPage) {
        invalidateListQueries(
          getFormsListQuery(page - 1, perPage, search, statusQuery)
        );
      }
    }
  }, [
    createErrorNotice,
    createSuccessNotice,
    currentQuery2,
    deleteEntityRecord,
    invalidateFormStatusCounts2,
    invalidateListQueries,
    isDeleting,
    page,
    perPage,
    permanentDeleteItems,
    recordsLength,
    search,
    setView,
    statusQuery,
    view
  ]);
  return {
    isDeleting,
    trashForms,
    restoreForms,
    isPermanentDeleteConfirmOpen,
    openPermanentDeleteConfirm,
    closePermanentDeleteConfirm,
    confirmPermanentDelete
  };
}

// src/dashboard/hooks/use-form-status-counts.ts
var import_data14 = __toESM(require_data(), 1);
var DEFAULT_COUNTS = {
  all: 0,
  publish: 0,
  draft: 0,
  pending: 0,
  future: 0,
  private: 0,
  trash: 0
};
function useFormStatusCounts() {
  return (0, import_data14.useSelect)(
    (select3) => select3(store3).getFormStatusCounts() ?? DEFAULT_COUNTS,
    []
  );
}

// src/dashboard/router/wp-route-dashboard-search-params-provider.tsx
var import_element81 = __toESM(require_element(), 1);
import { useSearch, useNavigate } from "@wordpress/route";

// src/dashboard/router/dashboard-search-params-context.tsx
var import_element80 = __toESM(require_element(), 1);
var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1);
var DashboardSearchParamsContext = (0, import_element80.createContext)(null);
function DashboardSearchParamsProvider({
  value,
  children
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(DashboardSearchParamsContext.Provider, { value, children });
}
function useDashboardSearchParams() {
  const ctx8 = (0, import_element80.useContext)(DashboardSearchParamsContext);
  if (!ctx8) {
    throw new Error(
      "useDashboardSearchParams must be used within a DashboardSearchParamsProvider."
    );
  }
  return ctx8;
}

// src/dashboard/router/wp-route-dashboard-search-params-provider.tsx
var import_jsx_runtime142 = __toESM(require_jsx_runtime(), 1);
function searchRecordToUrlSearchParams(search) {
  const params = new URLSearchParams();
  for (const [key, value] of Object.entries(search || {})) {
    if (value === void 0 || value === null) {
      continue;
    }
    if (Array.isArray(value)) {
      for (const v2 of value) {
        if (v2 === void 0 || v2 === null) {
          continue;
        }
        params.append(key, String(v2));
      }
      continue;
    }
    params.set(key, String(value));
  }
  return params;
}
function urlSearchParamsToSearchRecord(params, options = {}) {
  const { arrayKeys = /* @__PURE__ */ new Set() } = options;
  const out = {};
  for (const key of params.keys()) {
    const values = params.getAll(key);
    if (values.length < 1) {
      continue;
    }
    if (arrayKeys.has(key)) {
      out[key] = values;
      continue;
    }
    out[key] = values[values.length - 1];
  }
  return out;
}
function WpRouteDashboardSearchParamsProvider({
  from,
  children
}) {
  const search = useSearch({
    // In this build, the router type isn't registered, so `@wordpress/route` models `from` as `never`.
    // We still want to pass the runtime route id through.
    from,
    strict: false
  });
  const navigate = useNavigate();
  const searchParams = (0, import_element81.useMemo)(() => searchRecordToUrlSearchParams(search), [search]);
  const setSearchParams = (0, import_element81.useCallback)(
    (next) => {
      const resolved = typeof next === "function" ? next(searchParams) : next;
      const nextSearch = urlSearchParamsToSearchRecord(resolved, {
        arrayKeys: /* @__PURE__ */ new Set(["responseIds"])
      });
      const replaceSearch = (() => nextSearch);
      navigate({ search: replaceSearch });
    },
    [navigate, searchParams]
  );
  const value = (0, import_element81.useMemo)(
    () => [searchParams, setSearchParams],
    [searchParams, setSearchParams]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(DashboardSearchParamsProvider, { value, children });
}

// src/dashboard/utils.ts
function getFormEditUrl(formId, adminUrl) {
  return `${adminUrl ?? ""}post.php?post=${formId}&action=edit`;
}

// src/dashboard/wp-build/components/dataviews-header-row/index.tsx
var import_data15 = __toESM(require_data(), 1);
var import_element83 = __toESM(require_element(), 1);
var import_i18n67 = __toESM(require_i18n(), 1);
import { useNavigate as useNavigate2 } from "@wordpress/route";

// src/dashboard/wp-build/components/inbox-status-toggle/index.tsx
var import_element82 = __toESM(require_element(), 1);
var import_i18n66 = __toESM(require_i18n(), 1);
var import_jsx_runtime143 = __toESM(require_jsx_runtime(), 1);
var getLabel = (status, count) => {
  let label;
  switch (status) {
    case "inbox":
      label = (0, import_i18n66.__)("Inbox", "jetpack-forms");
      break;
    case "spam":
      label = (0, import_i18n66.__)("Spam", "jetpack-forms");
      break;
    case "trash":
      label = (0, import_i18n66._x)("Trash", "noun", "jetpack-forms");
      break;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime143.jsxs)("span", { children: [
    label,
    /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(Badge, { intent: "draft", className: "jp-forms-tabs-count", children: formatNumberCompact(count || 0) })
  ] });
};
function InboxStatusToggle({
  activeStatus,
  counts: counts2,
  onChange
}) {
  const handleChange = (0, import_element82.useCallback)(
    (nextStatus) => {
      if (nextStatus === activeStatus) {
        return;
      }
      onChange(nextStatus);
    },
    [activeStatus, onChange]
  );
  const statusTabs = (0, import_element82.useMemo)(
    () => [
      { value: "inbox", label: getLabel("inbox", counts2.inbox) },
      { value: "spam", label: getLabel("spam", counts2.spam) },
      { value: "trash", label: getLabel("trash", counts2.trash) }
    ],
    [counts2.inbox, counts2.spam, counts2.trash]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(tabs_exports.Root, { value: activeStatus, onValueChange: handleChange, children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(tabs_exports.List, { variant: "minimal", children: statusTabs.map((option) => /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(tabs_exports.Tab, { value: option.value, children: option.label }, option.value)) }) });
}

// src/dashboard/wp-build/components/dataviews-header-row/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='91fe84646d']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "91fe84646d");
  style.appendChild(document.createTextNode(".jp-forms-dataviews__view-actions{border-bottom:1px solid var(--wpds-color-stroke-surface-neutral,#e0e0e0);box-sizing:border-box;container-type:inline-size;flex-shrink:0;overflow-x:auto;padding-inline:20px;width:100%}@container (width < 500px){.jp-forms-dataviews__view-actions{--wp-ui-stack-justify:flex-start;align-items:flex-start;flex-direction:column}}.jp-forms-dataviews__view-actions>div:not(:empty){min-height:48px}.jp-forms-dataviews-filters__container,.jp-forms-dataviews-filters__container:not(:empty){padding:0}.jp-forms-dataviews-filters__container:not(:empty){padding-block:12px;padding-inline:20px}.jp-forms-tabs-count{margin-inline-start:4px;vertical-align:middle}"));
  document.head.appendChild(style);
}

// src/dashboard/wp-build/components/dataviews-header-row/index.tsx
var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1);
function DataViewsHeaderRow({
  activeTab,
  isSingleFormView = false,
  activeStatus,
  statusCounts,
  onStatusChange
}) {
  const navigate = useNavigate2();
  const isCFMEnabled = useConfigValue("isCentralFormManagementEnabled");
  const { all: formsCount } = useFormStatusCounts();
  const responsesInboxCount = (0, import_data15.useSelect)((select3) => {
    select3(store3).getCounts({});
    return select3(store3).getInboxCount({}) ?? 0;
  }, []);
  const onTabChange = (0, import_element83.useCallback)(
    (nextValue) => {
      if (nextValue === "forms") {
        navigate({ href: "/forms" });
        return;
      }
      navigate({ href: "/responses/inbox" });
    },
    [navigate]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(import_jsx_runtime144.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(Stack, { className: "jp-forms-dataviews__view-actions", justify: "space-between", children: [
      /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Stack, { align: "center", gap: "sm", children: isSingleFormView ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(
        InboxStatusToggle,
        {
          activeStatus: activeStatus ?? "inbox",
          counts: statusCounts ?? { inbox: 0, spam: 0, trash: 0 },
          onChange: onStatusChange ?? (() => {
          })
        }
      ) : isCFMEnabled && /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(tabs_exports.Root, { value: activeTab, onValueChange: onTabChange, children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(tabs_exports.List, { variant: "minimal", children: [
        /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(tabs_exports.Tab, { value: "forms", children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("span", { children: [
          (0, import_i18n67.__)("Forms", "jetpack-forms"),
          /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Badge, { intent: "draft", className: "jp-forms-tabs-count", children: formatNumberCompact(formsCount || 0) })
        ] }) }),
        /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(tabs_exports.Tab, { value: "responses", children: /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)("span", { children: [
          (0, import_i18n67.__)("Responses", "jetpack-forms"),
          /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(Badge, { intent: "draft", className: "jp-forms-tabs-count", children: formatNumberCompact(responsesInboxCount || 0) })
        ] }) })
      ] }) }) }),
      /* @__PURE__ */ (0, import_jsx_runtime144.jsxs)(Stack, { align: "center", gap: "sm", children: [
        /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(dataviews_default.Search, {}),
        isSingleFormView ? /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(dataviews_default.FiltersToggle, {}) : null,
        /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(dataviews_default.ViewConfig, {})
      ] })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(dataviews_default.FiltersToggled, { className: "jp-forms-dataviews-filters__container" })
  ] });
}

// src/dashboard/wp-build/components/forms-help-modal/index.tsx
var import_api_fetch7 = __toESM(require_api_fetch(), 1);
var import_components65 = __toESM(require_components(), 1);
var import_data16 = __toESM(require_data(), 1);
var import_element84 = __toESM(require_element(), 1);
var import_i18n68 = __toESM(require_i18n(), 1);
var import_jsx_runtime145 = __toESM(require_jsx_runtime(), 1);
function FormsHelpModal({ isOpen, onClose }) {
  const [dontShowAgain, setDontShowAgain] = (0, import_element84.useState)(false);
  const { receiveConfigValue: receiveConfigValue2 } = (0, import_data16.useDispatch)(CONFIG_STORE);
  const handleClose = (0, import_element84.useCallback)(() => {
    setDontShowAgain(false);
    onClose();
  }, [onClose]);
  const handleSubmit = (0, import_element84.useCallback)(() => {
    if (dontShowAgain) {
      receiveConfigValue2("hasClassicForms", false);
      (0, import_api_fetch7.default)({
        path: "/wp/v2/feedback/dismiss-classic-forms-notice",
        method: "POST"
      });
    }
    handleClose();
  }, [dontShowAgain, handleClose, receiveConfigValue2]);
  if (!isOpen) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
    import_components65.Modal,
    {
      title: (0, import_i18n68.__)("Not seeing all your forms?", "jetpack-forms"),
      onRequestClose: handleClose,
      children: /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_components65.__experimentalVStack, { spacing: "4", children: [
        /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_components65.__experimentalText, { children: (0, import_i18n68.__)("The Forms list shows reusable forms, not simple form blocks.", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("div", { children: [
          /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_components65.__experimentalText, { as: "p", weight: "500", children: (0, import_i18n68.__)("To convert a form block to a reusable form:", "jetpack-forms") }),
          /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)("ol", { children: [
            /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("li", { children: (0, import_i18n68.__)("Open the page or post where your form block is embedded.", "jetpack-forms") }),
            /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("li", { children: (0, import_i18n68.__)("Select the form block.", "jetpack-forms") }),
            /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("li", { children: (0, import_i18n68.__)('Click "Edit Form" in the block toolbar to convert it.', "jetpack-forms") }),
            /* @__PURE__ */ (0, import_jsx_runtime145.jsx)("li", { children: (0, import_i18n68.__)("Save the page or post.", "jetpack-forms") })
          ] })
        ] }),
        /* @__PURE__ */ (0, import_jsx_runtime145.jsxs)(import_components65.__experimentalHStack, { justify: "space-between", alignment: "center", children: [
          /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(
            import_components65.CheckboxControl,
            {
              __nextHasNoMarginBottom: true,
              label: (0, import_i18n68.__)("Don't show this again", "jetpack-forms"),
              checked: dontShowAgain,
              onChange: setDontShowAgain
            }
          ),
          /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_components65.Button, { variant: "primary", onClick: handleSubmit, children: (0, import_i18n68.__)("Got it", "jetpack-forms") })
        ] })
      ] })
    }
  );
}

// src/dashboard/wp-build/hooks/use-form-item-actions.ts
var import_api_fetch8 = __toESM(require_api_fetch(), 1);
var import_data18 = __toESM(require_data(), 1);
var import_element86 = __toESM(require_element(), 1);
var import_i18n71 = __toESM(require_i18n(), 1);
var import_notices4 = __toESM(require_notices(), 1);

// src/blocks/shared/util/constants.js
var import_i18n69 = __toESM(require_i18n(), 1);
var currentYear = (/* @__PURE__ */ new Date()).getFullYear();
var DATE_FORMATS = [
  {
    value: "mm/dd/yy",
    /* translators: date format. DD is the day of the month, MM the month, and YYYY the year (e.g., 12/31/2023). */
    label: (0, import_i18n69.__)("MM/DD/YYYY", "jetpack-forms"),
    example: `12/31/${currentYear}`
  },
  {
    value: "dd/mm/yy",
    /* translators: date format. DD is the day of the month, MM the month, and YYYY the year (e.g., 31/12/2023). */
    label: (0, import_i18n69.__)("DD/MM/YYYY", "jetpack-forms"),
    example: `21/12/${currentYear}`
  },
  {
    value: "yy-mm-dd",
    /* translators: date format. DD is the day of the month, MM the month, and YYYY the year (e.g., 2023-12-31). */
    label: (0, import_i18n69.__)("YYYY-MM-DD", "jetpack-forms"),
    example: `${currentYear}-12-31`
  }
];
var DATE_FORMAT_OPTIONS = DATE_FORMATS.map(
  ({ value, label: optionLabel, example }) => ({
    label: `${optionLabel} (${example})`,
    value
  })
);
var FORM_POST_TYPE = "jetpack_form";
var FORM_SOURCE_META_KEY = "_jetpack_forms_source_post_id";

// src/blocks/shared/util/embed-codes.ts
var getEmbedCode = (postId) => `<!-- wp:jetpack/contact-form {"ref":${postId}} /-->`;
var getShortcode = (postId) => `[contact-form ref="${postId}"]`;

// src/dashboard/wp-build/hooks/use-duplicate-form.ts
var import_data17 = __toESM(require_data(), 1);
var import_element85 = __toESM(require_element(), 1);
var import_i18n70 = __toESM(require_i18n(), 1);
var import_notices3 = __toESM(require_notices(), 1);
function useDuplicateForm() {
  const [isDuplicating, setIsDuplicating] = (0, import_element85.useState)(false);
  const { createSuccessNotice, createErrorNotice } = (0, import_data17.useDispatch)(import_notices3.store);
  const { saveEntityRecord } = (0, import_data17.useDispatch)("core");
  const { invalidateFormStatusCounts: invalidateFormStatusCounts2 } = (0, import_data17.useDispatch)(store3);
  const adminUrl = useConfigValue("adminUrl") || "";
  const duplicateForm = (0, import_element85.useCallback)(
    async (item) => {
      if (isDuplicating) {
        return;
      }
      if (!item?.id) {
        return;
      }
      setIsDuplicating(true);
      try {
        const original = await (0, import_data17.resolveSelect)("core").getEntityRecord(
          "postType",
          "jetpack_form",
          item.id,
          { context: "edit" }
        );
        if (!original) {
          createErrorNotice(
            (0, import_i18n70.__)("Could not load the form to duplicate. Please try again.", "jetpack-forms"),
            {
              type: "snackbar"
            }
          );
          return;
        }
        const typedOriginal = original;
        const raw = typedOriginal.content?.raw;
        const originalContentRaw = typeof raw === "string" ? raw : "";
        const originalTitle = item.title || (0, import_i18n70.__)("Untitled Form", "jetpack-forms");
        const newTitle = (0, import_i18n70.sprintf)(
          /* translators: %s: original form title */
          (0, import_i18n70.__)("%s Copy", "jetpack-forms"),
          originalTitle
        );
        const created = await saveEntityRecord(
          "postType",
          "jetpack_form",
          {
            title: newTitle,
            // Duplicate the raw block content so the form is an exact copy.
            content: originalContentRaw,
            status: typedOriginal.status === "publish" ? "draft" : typedOriginal.status,
            meta: {
              [FORM_SOURCE_META_KEY]: item.id
            }
          },
          { throwOnError: true }
        );
        const createdId = created?.id;
        if (!createdId) {
          createErrorNotice((0, import_i18n70.__)("Could not duplicate form. Please try again.", "jetpack-forms"), {
            type: "snackbar"
          });
          return;
        }
        createSuccessNotice((0, import_i18n70.__)("Form duplicated.", "jetpack-forms"), {
          type: "snackbar",
          actions: [
            {
              label: (0, import_i18n70.__)("Edit", "jetpack-forms"),
              onClick: () => {
                if (adminUrl) {
                  window.location.href = getFormEditUrl(createdId, adminUrl);
                }
              }
            }
          ]
        });
      } catch {
        createErrorNotice((0, import_i18n70.__)("Could not duplicate form. Please try again.", "jetpack-forms"), {
          type: "snackbar"
        });
      } finally {
        setIsDuplicating(false);
        invalidateFormStatusCounts2();
      }
    },
    [
      createErrorNotice,
      createSuccessNotice,
      adminUrl,
      invalidateFormStatusCounts2,
      isDuplicating,
      saveEntityRecord
    ]
  );
  return { duplicateForm, isDuplicating };
}

// src/dashboard/wp-build/hooks/use-form-item-actions.ts
function useFormItemActions() {
  const { createSuccessNotice, createErrorNotice } = (0, import_data18.useDispatch)(import_notices4.store);
  const { duplicateForm, isDuplicating } = useDuplicateForm();
  const [isUpdatingStatus, setIsUpdatingStatus] = (0, import_element86.useState)(false);
  const isUpdatingStatusRef = (0, import_element86.useRef)(false);
  const { saveEntityRecord, invalidateResolution } = (0, import_data18.useDispatch)("core");
  const previewForm = (0, import_element86.useCallback)(async (item) => {
    try {
      const response = await (0, import_api_fetch8.default)({
        path: `/wp/v2/jetpack-forms/${item.id}/preview-url`
      });
      window.open(response.preview_url, "_blank");
    } catch (error2) {
      console.error("Failed to get preview URL:", error2);
    }
  }, []);
  const copyEmbed = (0, import_element86.useCallback)(
    async (item) => {
      const embedCode = getEmbedCode(item.id);
      try {
        await navigator.clipboard.writeText(embedCode);
        createSuccessNotice((0, import_i18n71.__)("Embed code copied to clipboard.", "jetpack-forms"), {
          type: "snackbar"
        });
      } catch {
        createErrorNotice((0, import_i18n71.__)("Failed to copy embed code. Please try again.", "jetpack-forms"), {
          type: "snackbar"
        });
      }
    },
    [createErrorNotice, createSuccessNotice]
  );
  const copyShortcode = (0, import_element86.useCallback)(
    async (item) => {
      const shortcode = getShortcode(item.id);
      try {
        await navigator.clipboard.writeText(shortcode);
        createSuccessNotice((0, import_i18n71.__)("Shortcode copied to clipboard.", "jetpack-forms"), {
          type: "snackbar"
        });
      } catch {
        createErrorNotice((0, import_i18n71.__)("Failed to copy shortcode. Please try again.", "jetpack-forms"), {
          type: "snackbar"
        });
      }
    },
    [createErrorNotice, createSuccessNotice]
  );
  const invalidateListQuery = (0, import_element86.useCallback)(
    (query) => {
      invalidateResolution("getEntityRecords", ["postType", FORM_POST_TYPE, query]);
      invalidateResolution("getEntityRecords", [
        "postType",
        FORM_POST_TYPE,
        { ...query, per_page: 1, _fields: "id" }
      ]);
    },
    [invalidateResolution]
  );
  const updateStatus = (0, import_element86.useCallback)(
    async (items, nextStatus, options = {}) => {
      if (isUpdatingStatusRef.current || !items?.length) {
        return;
      }
      isUpdatingStatusRef.current = true;
      setIsUpdatingStatus(true);
      try {
        const previousStatuses = new Map(items.map((item) => [item.id, item.status]));
        const promises = await Promise.allSettled(
          items.map(
            (item) => saveEntityRecord(
              "postType",
              FORM_POST_TYPE,
              { id: item.id, status: nextStatus },
              { throwOnError: true }
            )
          )
        );
        const updatedCount = promises.filter((p2) => p2.status === "fulfilled").length;
        const failedCount = promises.length - updatedCount;
        if (updatedCount) {
          const message2 = nextStatus === "publish" ? (0, import_i18n71.sprintf)(
            /* translators: %d: number of forms */
            (0, import_i18n71._n)("%d form published.", "%d forms published.", updatedCount, "jetpack-forms"),
            updatedCount
          ) : (0, import_i18n71.sprintf)(
            /* translators: %d: number of forms */
            (0, import_i18n71._n)(
              "%d form set to draft.",
              "%d forms set to draft.",
              updatedCount,
              "jetpack-forms"
            ),
            updatedCount
          );
          const fallbackStatus = nextStatus === "publish" ? "draft" : "publish";
          createSuccessNotice(message2, {
            type: "snackbar",
            actions: [
              {
                label: (0, import_i18n71.__)("Undo", "jetpack-forms"),
                onClick: async () => {
                  if (isUpdatingStatusRef.current) {
                    return;
                  }
                  isUpdatingStatusRef.current = true;
                  setIsUpdatingStatus(true);
                  try {
                    await Promise.allSettled(
                      items.map(
                        (item) => saveEntityRecord(
                          "postType",
                          FORM_POST_TYPE,
                          {
                            id: item.id,
                            status: previousStatuses.get(item.id) || fallbackStatus
                          },
                          { throwOnError: true }
                        )
                      )
                    );
                    const undoQueries = options.invalidateQueries?.length ? options.invalidateQueries : [
                      getFormsListQuery(1, 20, "", NON_TRASH_FORM_STATUSES)
                    ];
                    undoQueries.forEach(invalidateListQuery);
                  } finally {
                    isUpdatingStatusRef.current = false;
                    setIsUpdatingStatus(false);
                  }
                }
              }
            ]
          });
        }
        if (failedCount) {
          const errorMessage = nextStatus === "publish" ? (0, import_i18n71.sprintf)(
            /* translators: %d: number of forms */
            (0, import_i18n71._n)(
              "Could not publish %d form.",
              "Could not publish %d forms.",
              failedCount,
              "jetpack-forms"
            ),
            failedCount
          ) : (0, import_i18n71.sprintf)(
            /* translators: %d: number of forms */
            (0, import_i18n71._n)(
              "Could not set %d form to draft.",
              "Could not set %d forms to draft.",
              failedCount,
              "jetpack-forms"
            ),
            failedCount
          );
          createErrorNotice(errorMessage, {
            type: "snackbar"
          });
        }
        const invalidateQueries = options.invalidateQueries?.length ? options.invalidateQueries : [
          getFormsListQuery(1, 20, "", NON_TRASH_FORM_STATUSES)
        ];
        invalidateQueries.forEach(invalidateListQuery);
      } finally {
        isUpdatingStatusRef.current = false;
        setIsUpdatingStatus(false);
      }
    },
    [createErrorNotice, createSuccessNotice, invalidateListQuery, saveEntityRecord]
  );
  const publishForms = (0, import_element86.useCallback)(
    async (items, options) => {
      await updateStatus(items, "publish", options);
    },
    [updateStatus]
  );
  const setFormsToDraft = (0, import_element86.useCallback)(
    async (items, options) => {
      await updateStatus(items, "draft", options);
    },
    [updateStatus]
  );
  return {
    duplicateForm,
    previewForm,
    copyEmbed,
    copyShortcode,
    isDuplicating,
    isUpdatingStatus,
    publishForms,
    setFormsToDraft
  };
}

// ../../js-packages/api/index.jsx
var import_jetpack_config = __toESM(require_src(), 1);
var import_url5 = __toESM(require_url(), 1);
function createCustomError(name) {
  class CustomError extends Error {
    constructor(...args) {
      super(...args);
      this.name = name;
    }
  }
  return CustomError;
}
var JsonParseError = createCustomError("JsonParseError");
var JsonParseAfterRedirectError = createCustomError("JsonParseAfterRedirectError");
var Api404Error = createCustomError("Api404Error");
var Api404AfterRedirectError = createCustomError("Api404AfterRedirectError");
var FetchNetworkError = createCustomError("FetchNetworkError");
function JetpackRestApiClient(root, nonce) {
  let apiRoot = root, wpcomOriginApiUrl = root, headers = {
    "X-WP-Nonce": nonce
  }, getParams = {
    credentials: "same-origin",
    headers
  }, postParams = {
    method: "post",
    credentials: "same-origin",
    headers: Object.assign({}, headers, {
      "Content-type": "application/json"
    })
  }, cacheBusterCallback = addCacheBuster;
  const methods = {
    setApiRoot(newRoot) {
      apiRoot = newRoot;
    },
    /**
     * Sets API root for search endpoints.
     * They are routed through wpcom API for wpcom simple sites,
     * so we add `/wp-json/wpcom-origin/` to this path on wpcom.
     * For non-wpcom sites, this is the same as apiRoot.
     *
     * @param {string} newRoot - API root for search endpoints.
     */
    setWpcomOriginApiUrl(newRoot) {
      wpcomOriginApiUrl = newRoot;
    },
    setApiNonce(newNonce) {
      headers = {
        "X-WP-Nonce": newNonce
      };
      getParams = {
        credentials: "same-origin",
        headers
      };
      postParams = {
        method: "post",
        credentials: "same-origin",
        headers: Object.assign({}, headers, {
          "Content-type": "application/json"
        })
      };
    },
    setCacheBusterCallback: (callback) => {
      cacheBusterCallback = callback;
    },
    registerSite: (deprecated, redirectUri, from) => {
      const params = {};
      if ((0, import_jetpack_config.jetpackConfigHas)("consumer_slug")) {
        params.plugin_slug = (0, import_jetpack_config.jetpackConfigGet)("consumer_slug");
      }
      if (null !== redirectUri) {
        params.redirect_uri = redirectUri;
      }
      if (from) {
        params.from = from;
      }
      return postRequest(`${apiRoot}jetpack/v4/connection/register`, postParams, {
        body: JSON.stringify(params)
      }).then(checkStatus).then(parseJsonResponse);
    },
    fetchAuthorizationUrl: (redirectUri) => getRequest(
      (0, import_url5.addQueryArgs)(`${apiRoot}jetpack/v4/connection/authorize_url`, {
        no_iframe: "1",
        redirect_uri: redirectUri
      }),
      getParams
    ).then(checkStatus).then(parseJsonResponse),
    fetchSiteConnectionData: () => getRequest(`${apiRoot}jetpack/v4/connection/data`, getParams).then(parseJsonResponse),
    fetchSiteConnectionStatus: () => getRequest(`${apiRoot}jetpack/v4/connection`, getParams).then(parseJsonResponse),
    fetchSiteConnectionTest: () => getRequest(`${apiRoot}jetpack/v4/connection/test`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchUserConnectionData: () => getRequest(`${apiRoot}jetpack/v4/connection/data`, getParams).then(parseJsonResponse),
    fetchUserTrackingSettings: () => getRequest(`${apiRoot}jetpack/v4/tracking/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateUserTrackingSettings: (newSettings) => postRequest(`${apiRoot}jetpack/v4/tracking/settings`, postParams, {
      body: JSON.stringify(newSettings)
    }).then(checkStatus).then(parseJsonResponse),
    disconnectSite: () => postRequest(`${apiRoot}jetpack/v4/connection`, postParams, {
      body: JSON.stringify({ isActive: false })
    }).then(checkStatus).then(parseJsonResponse),
    fetchConnectUrl: () => getRequest(`${apiRoot}jetpack/v4/connection/url`, getParams).then(checkStatus).then(parseJsonResponse),
    unlinkUser: (force = false, options = {}) => {
      const params = {
        linked: false,
        force: !!force
      };
      if (options.disconnectAllUsers) {
        params["disconnect-all-users"] = true;
      }
      return postRequest(`${apiRoot}jetpack/v4/connection/user`, postParams, {
        body: JSON.stringify(params)
      }).then(checkStatus).then(parseJsonResponse);
    },
    reconnect: () => postRequest(`${apiRoot}jetpack/v4/connection/reconnect`, postParams).then(checkStatus).then(parseJsonResponse),
    fetchConnectedPlugins: () => getRequest(`${apiRoot}jetpack/v4/connection/plugins`, getParams).then(checkStatus).then(parseJsonResponse),
    setHasSeenWCConnectionModal: () => postRequest(`${apiRoot}jetpack/v4/seen-wc-connection-modal`, postParams).then(checkStatus).then(parseJsonResponse),
    fetchModules: () => getRequest(`${apiRoot}jetpack/v4/module/all`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchModule: (slug) => getRequest(`${apiRoot}jetpack/v4/module/${slug}`, getParams).then(checkStatus).then(parseJsonResponse),
    activateModule: (slug) => postRequest(`${apiRoot}jetpack/v4/module/${slug}/active`, postParams, {
      body: JSON.stringify({ active: true })
    }).then(checkStatus).then(parseJsonResponse),
    deactivateModule: (slug) => postRequest(`${apiRoot}jetpack/v4/module/${slug}/active`, postParams, {
      body: JSON.stringify({ active: false })
    }),
    updateModuleOptions: (slug, newOptionValues) => postRequest(`${apiRoot}jetpack/v4/module/${slug}`, postParams, {
      body: JSON.stringify(newOptionValues)
    }).then(checkStatus).then(parseJsonResponse),
    updateSettings: (newOptionValues) => postRequest(`${apiRoot}jetpack/v4/settings`, postParams, {
      body: JSON.stringify(newOptionValues)
    }).then(checkStatus).then(parseJsonResponse),
    getProtectCount: () => getRequest(`${apiRoot}jetpack/v4/module/protect/data`, getParams).then(checkStatus).then(parseJsonResponse),
    resetOptions: (options) => postRequest(`${apiRoot}jetpack/v4/options/${options}`, postParams, {
      body: JSON.stringify({ reset: true })
    }).then(checkStatus).then(parseJsonResponse),
    activateVaultPress: () => postRequest(`${apiRoot}jetpack/v4/plugins`, postParams, {
      body: JSON.stringify({ slug: "vaultpress", status: "active" })
    }).then(checkStatus).then(parseJsonResponse),
    getVaultPressData: () => getRequest(`${apiRoot}jetpack/v4/module/vaultpress/data`, getParams).then(checkStatus).then(parseJsonResponse),
    installPlugin: (slug, source) => {
      const props = { slug, status: "active" };
      if (source) {
        props.source = source;
      }
      return postRequest(`${apiRoot}jetpack/v4/plugins`, postParams, {
        body: JSON.stringify(props)
      }).then(checkStatus).then(parseJsonResponse);
    },
    activateAkismet: () => postRequest(`${apiRoot}jetpack/v4/plugins`, postParams, {
      body: JSON.stringify({ slug: "akismet", status: "active" })
    }).then(checkStatus).then(parseJsonResponse),
    getAkismetData: () => getRequest(`${apiRoot}jetpack/v4/module/akismet/data`, getParams).then(checkStatus).then(parseJsonResponse),
    checkAkismetKey: () => getRequest(`${apiRoot}jetpack/v4/module/akismet/key/check`, getParams).then(checkStatus).then(parseJsonResponse),
    checkAkismetKeyTyped: (apiKey) => postRequest(`${apiRoot}jetpack/v4/module/akismet/key/check`, postParams, {
      body: JSON.stringify({ api_key: apiKey })
    }).then(checkStatus).then(parseJsonResponse),
    getFeatureTypeStatus: (customContentType) => getRequest(`${apiRoot}jetpack/v4/feature/${customContentType}`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchStatsData: (range) => getRequest(statsDataUrl(range), getParams).then(checkStatus).then(parseJsonResponse).then(handleStatsResponseError),
    getPluginUpdates: () => getRequest(`${apiRoot}jetpack/v4/updates/plugins`, getParams).then(checkStatus).then(parseJsonResponse),
    getPlans: () => getRequest(`${apiRoot}jetpack/v4/plans`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchSettings: () => getRequest(`${apiRoot}jetpack/v4/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateSetting: (updatedSetting) => postRequest(`${apiRoot}jetpack/v4/settings`, postParams, {
      body: JSON.stringify(updatedSetting)
    }).then(checkStatus).then(parseJsonResponse),
    fetchSiteData: () => getRequest(`${apiRoot}jetpack/v4/site`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteFeatures: () => getRequest(`${apiRoot}jetpack/v4/site/features`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteProducts: () => getRequest(`${apiRoot}jetpack/v4/site/products`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchSitePurchases: () => getRequest(`${apiRoot}jetpack/v4/site/purchases`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteBenefits: () => getRequest(`${apiRoot}jetpack/v4/site/benefits`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchSiteDiscount: () => getRequest(`${apiRoot}jetpack/v4/site/discount`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => body.data),
    fetchSetupQuestionnaire: () => getRequest(`${apiRoot}jetpack/v4/setup/questionnaire`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsData: () => getRequest(`${apiRoot}jetpack/v4/recommendations/data`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsProductSuggestions: () => getRequest(`${apiRoot}jetpack/v4/recommendations/product-suggestions`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsUpsell: () => getRequest(`${apiRoot}jetpack/v4/recommendations/upsell`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRecommendationsConditional: () => getRequest(`${apiRoot}jetpack/v4/recommendations/conditional`, getParams).then(checkStatus).then(parseJsonResponse),
    saveRecommendationsData: (data) => postRequest(`${apiRoot}jetpack/v4/recommendations/data`, postParams, {
      body: JSON.stringify({ data })
    }).then(checkStatus),
    fetchProducts: () => getRequest(`${apiRoot}jetpack/v4/products`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchRewindStatus: () => getRequest(`${apiRoot}jetpack/v4/rewind`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    fetchScanStatus: () => getRequest(`${apiRoot}jetpack/v4/scan`, getParams).then(checkStatus).then(parseJsonResponse).then((body) => JSON.parse(body.data)),
    dismissJetpackNotice: (notice) => postRequest(`${apiRoot}jetpack/v4/notice/${notice}`, postParams, {
      body: JSON.stringify({ dismissed: true })
    }).then(checkStatus).then(parseJsonResponse),
    fetchPluginsData: () => getRequest(`${apiRoot}jetpack/v4/plugins`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchIntroOffers: () => getRequest(`${apiRoot}jetpack/v4/intro-offers`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchVerifySiteGoogleStatus: (keyringId) => {
      const request = keyringId !== null ? getRequest(`${apiRoot}jetpack/v4/verify-site/google/${keyringId}`, getParams) : getRequest(`${apiRoot}jetpack/v4/verify-site/google`, getParams);
      return request.then(checkStatus).then(parseJsonResponse);
    },
    verifySiteGoogle: (keyringId) => postRequest(`${apiRoot}jetpack/v4/verify-site/google`, postParams, {
      body: JSON.stringify({ keyring_id: keyringId })
    }).then(checkStatus).then(parseJsonResponse),
    submitSurvey: (surveyResponse) => postRequest(`${apiRoot}jetpack/v4/marketing/survey`, postParams, {
      body: JSON.stringify(surveyResponse)
    }).then(checkStatus).then(parseJsonResponse),
    saveSetupQuestionnaire: (props) => postRequest(`${apiRoot}jetpack/v4/setup/questionnaire`, postParams, {
      body: JSON.stringify(props)
    }).then(checkStatus).then(parseJsonResponse),
    updateLicensingError: (props) => postRequest(`${apiRoot}jetpack/v4/licensing/error`, postParams, {
      body: JSON.stringify(props)
    }).then(checkStatus).then(parseJsonResponse),
    updateLicenseKey: (license) => postRequest(`${apiRoot}jetpack/v4/licensing/set-license`, postParams, {
      body: JSON.stringify({ license })
    }).then(checkStatus).then(parseJsonResponse),
    getUserLicensesCounts: () => getRequest(`${apiRoot}jetpack/v4/licensing/user/counts`, getParams).then(checkStatus).then(parseJsonResponse),
    getUserLicenses: () => getRequest(`${apiRoot}jetpack/v4/licensing/user/licenses`, getParams).then(checkStatus).then(parseJsonResponse),
    updateLicensingActivationNoticeDismiss: (lastDetachedCount) => postRequest(`${apiRoot}jetpack/v4/licensing/user/activation-notice-dismiss`, postParams, {
      body: JSON.stringify({ last_detached_count: lastDetachedCount })
    }).then(checkStatus).then(parseJsonResponse),
    updateRecommendationsStep: (step) => postRequest(`${apiRoot}jetpack/v4/recommendations/step`, postParams, {
      body: JSON.stringify({ step })
    }).then(checkStatus),
    confirmIDCSafeMode: () => postRequest(`${apiRoot}jetpack/v4/identity-crisis/confirm-safe-mode`, postParams).then(
      checkStatus
    ),
    startIDCFresh: (redirectUri) => postRequest(`${apiRoot}jetpack/v4/identity-crisis/start-fresh`, postParams, {
      body: JSON.stringify({ redirect_uri: redirectUri })
    }).then(checkStatus).then(parseJsonResponse),
    migrateIDC: () => postRequest(`${apiRoot}jetpack/v4/identity-crisis/migrate`, postParams).then(
      checkStatus
    ),
    attachLicenses: (licenses) => postRequest(`${apiRoot}jetpack/v4/licensing/attach-licenses`, postParams, {
      body: JSON.stringify({ licenses })
    }).then(checkStatus).then(parseJsonResponse),
    fetchSearchPlanInfo: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/plan`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchSearchSettings: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateSearchSettings: (newSettings) => postRequest(`${wpcomOriginApiUrl}jetpack/v4/search/settings`, postParams, {
      body: JSON.stringify(newSettings)
    }).then(checkStatus).then(parseJsonResponse),
    fetchSearchStats: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/stats`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchWafSettings: () => getRequest(`${apiRoot}jetpack/v4/waf`, getParams).then(checkStatus).then(parseJsonResponse),
    updateWafSettings: (newSettings) => postRequest(`${apiRoot}jetpack/v4/waf`, postParams, {
      body: JSON.stringify(newSettings)
    }).then(checkStatus).then(parseJsonResponse),
    fetchWordAdsSettings: () => getRequest(`${apiRoot}jetpack/v4/wordads/settings`, getParams).then(checkStatus).then(parseJsonResponse),
    updateWordAdsSettings: (newSettings) => postRequest(`${apiRoot}jetpack/v4/wordads/settings`, postParams, {
      body: JSON.stringify(newSettings)
    }),
    fetchSearchPricing: () => getRequest(`${wpcomOriginApiUrl}jetpack/v4/search/pricing`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchMigrationStatus: () => getRequest(`${apiRoot}jetpack/v4/migration/status`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchBackupUndoEvent: () => getRequest(`${apiRoot}jetpack/v4/site/backup/undo-event`, getParams).then(checkStatus).then(parseJsonResponse),
    fetchBackupPreflightStatus: () => getRequest(`${apiRoot}jetpack/v4/site/backup/preflight`, getParams).then(checkStatus).then(parseJsonResponse)
  };
  function addCacheBuster(route) {
    const parts = route.split("?"), query = parts.length > 1 ? parts[1] : "", args = query.length ? query.split("&") : [];
    args.push("_cacheBuster=" + (/* @__PURE__ */ new Date()).getTime());
    return parts[0] + "?" + args.join("&");
  }
  function getRequest(route, params) {
    return fetch(cacheBusterCallback(route), params);
  }
  function postRequest(route, params, body) {
    return fetch(route, Object.assign({}, params, body)).catch(catchNetworkErrors);
  }
  function statsDataUrl(range) {
    let url = `${apiRoot}jetpack/v4/module/stats/data`;
    if (url.indexOf("?") !== -1) {
      url = url + `&range=${encodeURIComponent(range)}`;
    } else {
      url = url + `?range=${encodeURIComponent(range)}`;
    }
    return url;
  }
  function handleStatsResponseError(statsData) {
    const responseOk = statsData.general && statsData.general.response === void 0 || statsData.week && statsData.week.response === void 0 || statsData.month && statsData.month.response === void 0;
    return responseOk ? statsData : {};
  }
  Object.assign(this, methods);
}
var restApi = new JetpackRestApiClient();
var api_default = restApi;
function checkStatus(response) {
  if (response.status >= 200 && response.status < 300) {
    return response;
  }
  if (response.status === 404) {
    return new Promise(() => {
      const err = response.redirected ? new Api404AfterRedirectError(response.redirected) : new Api404Error();
      throw err;
    });
  }
  return response.json().catch((e2) => catchJsonParseError(e2)).then((json) => {
    const error2 = new Error(`${json.message} (Status ${response.status})`);
    error2.response = json;
    error2.name = "ApiError";
    throw error2;
  });
}
function parseJsonResponse(response) {
  return response.json().catch((e2) => catchJsonParseError(e2, response.redirected, response.url));
}
function catchJsonParseError(e2, redirected, url) {
  const err = redirected ? new JsonParseAfterRedirectError(url) : new JsonParseError();
  throw err;
}
function catchNetworkErrors() {
  throw new FetchNetworkError();
}

// ../../js-packages/components/build/components/layout/use-breakpoint-match/index.js
var import_compose14 = __toESM(require_compose(), 1);

// ../../js-packages/components/build/components/layout/breakpoints.module.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='da39a3ee5e']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "da39a3ee5e");
  style.appendChild(document.createTextNode(""));
  document.head.appendChild(style);
}
var breakpoints_module_default = { "sm": "(max-width: 599px)", "md": "(min-width: 600px) and (max-width: 959px)", "lg": "(min-width: 960px)" };

// ../../js-packages/components/build/components/layout/use-breakpoint-match/index.js
var BREAKPOINTS = ["sm", "md", "lg"];
var getMediaByOperator = (breakpoint, operator, matches) => {
  const breakpointIndex = BREAKPOINTS.indexOf(breakpoint);
  const breakpointIndexPlusOne = breakpointIndex + 1;
  const isEqual = operator.includes("=");
  let allNeededBreakpoints = [];
  if (operator.startsWith("<")) {
    allNeededBreakpoints = BREAKPOINTS.slice(0, isEqual ? breakpointIndexPlusOne : breakpointIndex);
  }
  if (operator.startsWith(">")) {
    allNeededBreakpoints = BREAKPOINTS.slice(isEqual ? breakpointIndex : breakpointIndexPlusOne);
  }
  return allNeededBreakpoints?.length ? allNeededBreakpoints.some((brk) => matches[brk]) : matches[breakpoint];
};
var useBreakpointMatch = (breakpointToMatch, operatorToMatch) => {
  const breakpoints = Array.isArray(breakpointToMatch) ? breakpointToMatch : [breakpointToMatch];
  const operators = Array.isArray(operatorToMatch) ? operatorToMatch : [operatorToMatch];
  const [smKey, mdKey, lgKey] = BREAKPOINTS;
  const sm = (0, import_compose14.useMediaQuery)(breakpoints_module_default[smKey]);
  const md = (0, import_compose14.useMediaQuery)(breakpoints_module_default[mdKey]);
  const lg = (0, import_compose14.useMediaQuery)(breakpoints_module_default[lgKey]);
  const matches = { sm, md, lg };
  return breakpoints.map((breakpoint, idx) => {
    const operator = operators[idx];
    return operator ? getMediaByOperator(breakpoint, operator, matches) : matches[breakpoint];
  });
};
var use_breakpoint_match_default = useBreakpointMatch;

// src/dashboard/wp-build/hooks/use-page-header-details.tsx
var import_components76 = __toESM(require_components(), 1);
var import_core_data7 = __toESM(require_core_data(), 1);
var import_data36 = __toESM(require_data(), 1);
var import_element101 = __toESM(require_element(), 1);
var import_html_entities4 = __toESM(require_html_entities(), 1);
var import_i18n87 = __toESM(require_i18n(), 1);
var import_notices8 = __toESM(require_notices(), 1);
import { useNavigate as useNavigate3 } from "@wordpress/route";

// src/dashboard/components/edit-form-button/index.tsx
var import_components66 = __toESM(require_components(), 1);
var import_element87 = __toESM(require_element(), 1);
var import_i18n72 = __toESM(require_i18n(), 1);
var import_jsx_runtime146 = __toESM(require_jsx_runtime(), 1);
function EditFormButton({
  formId,
  onClick: onClickProp
}) {
  const adminUrl = useConfigValue("adminUrl") || "";
  const onClick = (0, import_element87.useCallback)(() => {
    onClickProp?.();
    window.location.href = getFormEditUrl(formId, adminUrl);
  }, [adminUrl, formId, onClickProp]);
  return /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_components66.Button, { size: "compact", variant: "secondary", onClick, children: (0, import_i18n72.__)("Edit form", "jetpack-forms") });
}

// src/dashboard/components/empty-spam-button/index.tsx
var import_components68 = __toESM(require_components(), 1);
var import_i18n75 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-empty-spam.ts
var import_api_fetch9 = __toESM(require_api_fetch(), 1);
var import_core_data3 = __toESM(require_core_data(), 1);
var import_data20 = __toESM(require_data(), 1);
var import_element89 = __toESM(require_element(), 1);
var import_i18n73 = __toESM(require_i18n(), 1);
var import_notices5 = __toESM(require_notices(), 1);

// src/dashboard/hooks/use-inbox-data.ts
var import_core_data2 = __toESM(require_core_data(), 1);
var import_data19 = __toESM(require_data(), 1);
var import_element88 = __toESM(require_element(), 1);
var import_html_entities3 = __toESM(require_html_entities(), 1);

// src/dashboard/components/inspector/utils.ts
var import_html_entities2 = __toESM(require_html_entities(), 1);
var isCollectionFormatField = (item) => {
  return item !== null && typeof item === "object" && "label" in item && "value" in item && "key" in item;
};

// src/dashboard/hooks/use-inbox-data.ts
function getStatusFilter(urlStatus) {
  const statusFilter = ["inbox", "spam", "trash"].includes(urlStatus) ? urlStatus : "inbox";
  return statusFilter === "inbox" ? "draft,publish" : statusFilter;
}
var formatFieldName = (fieldName) => {
  const match2 = fieldName.match(/^(\d+_)?(.*)/i);
  if (match2) {
    return match2[2];
  }
  return fieldName;
};
var isEmpty3 = (obj) => [Object, Array].includes((obj || {}).constructor) && !Object.entries(obj || {}).length;
var formatFieldValue = (fieldValue) => {
  if (!fieldValue || isEmpty3(fieldValue)) {
    return "-";
  }
  if (Array.isArray(fieldValue)) {
    return fieldValue.join(", ");
  }
  return fieldValue;
};
var decodeValue = (value) => {
  if (typeof value === "string") {
    return (0, import_html_entities3.decodeEntities)(value);
  }
  if (Array.isArray(value)) {
    return value.map((v2) => typeof v2 === "string" ? (0, import_html_entities3.decodeEntities)(v2) : v2);
  }
  return value;
};
var hasOwn = (obj, key) => Object.prototype.hasOwnProperty.call(obj, key);
var normalizeFieldsForDisplay = (fields) => {
  if (!fields || !Array.isArray(fields)) {
    return /* @__PURE__ */ Object.create(null);
  }
  if (isCollectionFormatField(fields[0])) {
    return fields;
  }
  return Object.entries(fields || {}).reduce(
    (accumulator, [key, value]) => {
      let _key = formatFieldName(key);
      let counter = 2;
      while (hasOwn(accumulator, _key)) {
        _key = `${formatFieldName(key)} (${counter})`;
        counter++;
      }
      accumulator[_key] = formatFieldValue(decodeValue(value));
      return accumulator;
    },
    /* @__PURE__ */ Object.create(null)
  );
};
function useInboxData(options = {}) {
  const [searchParams] = useDashboardSearchParams();
  const { setCurrentQuery: setCurrentQuery2, setSelectedResponses: setSelectedResponses2 } = (0, import_data19.useDispatch)(store3);
  const urlStatus = options.status ?? searchParams.get("status");
  const statusFilter = getStatusFilter(urlStatus);
  const {
    selectedResponsesCount,
    currentStatus,
    currentQuery: currentQuery2,
    filterOptions,
    invalidRecords: invalidRecords2,
    hasPendingActions: hasPendingActions2
  } = (0, import_data19.useSelect)(
    (select3) => ({
      selectedResponsesCount: select3(store3).getSelectedResponsesCount(),
      currentStatus: select3(store3).getCurrentStatus(),
      currentQuery: select3(store3).getCurrentQuery(),
      filterOptions: select3(store3).getFilters(),
      invalidRecords: select3(store3).getInvalidRecords(),
      hasPendingActions: select3(store3).hasPendingActions()
    }),
    []
  );
  const [frozenInvalidIds, setFrozenInvalidIds] = (0, import_element88.useState)([]);
  const currentPageRef = (0, import_element88.useRef)(currentQuery2?.page || 1);
  (0, import_element88.useEffect)(() => {
    const newPage = currentQuery2?.page || 1;
    const hasUnreadFilter = currentQuery2?.is_unread === true;
    if (newPage !== currentPageRef.current) {
      currentPageRef.current = newPage;
      if (hasUnreadFilter) {
        setFrozenInvalidIds(Array.from(invalidRecords2 || /* @__PURE__ */ new Set()));
      } else {
        setFrozenInvalidIds([]);
      }
    }
  }, [currentQuery2?.page, currentQuery2?.is_unread, invalidRecords2]);
  const queryWithInvalidIds = (0, import_element88.useMemo)(() => {
    if (frozenInvalidIds.length > 0) {
      return {
        ...currentQuery2,
        invalid_ids: frozenInvalidIds
      };
    }
    return currentQuery2;
  }, [currentQuery2, frozenInvalidIds]);
  const {
    records: rawRecords,
    hasResolved,
    totalItems,
    totalPages
  } = (0, import_core_data2.useEntityRecords)("postType", "feedback", queryWithInvalidIds);
  const editedRecords = (0, import_data19.useSelect)(
    (select3) => {
      return (rawRecords || []).map((record) => {
        const editedRecord = select3(import_core_data2.store).getEditedEntityRecord(
          "postType",
          "feedback",
          record.id
        );
        return editedRecord || record;
      });
    },
    [rawRecords]
  );
  const statusMatchesFilter = (status, filter) => {
    if (filter.includes(",")) {
      return filter.split(",").includes(status);
    }
    return status === filter;
  };
  const records = (0, import_element88.useMemo)(() => {
    const filteredRecords = (editedRecords || []).filter((record) => {
      return statusMatchesFilter(record.status, statusFilter);
    });
    return filteredRecords.map((record) => {
      const formResponse = record;
      return {
        ...formResponse,
        fields: normalizeFieldsForDisplay(formResponse.fields)
      };
    });
  }, [editedRecords, statusFilter]);
  const countsQueryParams = (0, import_element88.useMemo)(() => {
    const params = {};
    if (currentQuery2?.search) {
      params.search = currentQuery2.search;
    }
    if (currentQuery2?.parent) {
      params.parent = currentQuery2.parent;
    }
    if (currentQuery2?.source) {
      params.source = currentQuery2.source;
    }
    if (currentQuery2?.before) {
      params.before = currentQuery2.before;
    }
    if (currentQuery2?.after) {
      params.after = currentQuery2.after;
    }
    if (currentQuery2?.is_unread !== void 0) {
      params.is_unread = currentQuery2.is_unread;
    }
    return params;
  }, [currentQuery2]);
  const { totalItemsInbox, totalItemsSpam, totalItemsTrash } = (0, import_data19.useSelect)(
    (select3) => {
      select3(store3).getCounts(countsQueryParams);
      return {
        totalItemsInbox: select3(store3).getInboxCount(countsQueryParams),
        totalItemsSpam: select3(store3).getSpamCount(countsQueryParams),
        totalItemsTrash: select3(store3).getTrashCount(countsQueryParams)
      };
    },
    [countsQueryParams]
  );
  const isLoadingData = !rawRecords?.length && !hasResolved || !records?.length && hasPendingActions2;
  return {
    totalItemsInbox,
    totalItemsSpam,
    totalItemsTrash,
    records,
    isLoadingData,
    totalItems,
    totalPages,
    selectedResponsesCount,
    setSelectedResponses: setSelectedResponses2,
    statusFilter,
    currentStatus,
    currentQuery: currentQuery2,
    setCurrentQuery: setCurrentQuery2,
    filterOptions
  };
}

// src/dashboard/hooks/use-empty-spam.ts
function useEmptySpam({
  totalItemsSpam: totalItemsSpamProp
} = {}) {
  const [isConfirmDialogOpen, setConfirmDialogOpen] = (0, import_element89.useState)(false);
  const [isEmptying, setIsEmptying] = (0, import_element89.useState)(false);
  const [isEmpty4, setIsEmpty] = (0, import_element89.useState)(true);
  const { createSuccessNotice, createErrorNotice } = (0, import_data20.useDispatch)(import_notices5.store);
  const { invalidateResolutionForStoreSelector } = (0, import_data20.useDispatch)(import_core_data3.store);
  const { invalidateCounts: invalidateCounts2 } = (0, import_data20.useDispatch)(store3);
  const hookData = useInboxData();
  const totalItemsSpam = totalItemsSpamProp ?? hookData.totalItemsSpam ?? 0;
  const { selectedResponsesCount } = hookData;
  (0, import_element89.useEffect)(() => {
    setIsEmpty(!totalItemsSpam);
  }, [totalItemsSpam]);
  const openConfirmDialog = (0, import_element89.useCallback)(() => setConfirmDialogOpen(true), []);
  const closeConfirmDialog = (0, import_element89.useCallback)(() => setConfirmDialogOpen(false), []);
  const onConfirmEmptying = (0, import_element89.useCallback)(async () => {
    if (isEmptying || isEmpty4) {
      return;
    }
    closeConfirmDialog();
    setIsEmptying(true);
    analytics_default.tracks.recordEvent("jetpack_forms_empty_spam_click");
    (0, import_api_fetch9.default)({
      method: "DELETE",
      path: `/wp/v2/feedback/trash?status=spam`
    }).then((response) => {
      const deleted = response?.deleted ?? 0;
      const successMessage = deleted === 1 ? (0, import_i18n73.__)("Response deleted permanently.", "jetpack-forms") : (0, import_i18n73.sprintf)(
        /* translators: %s: The number of responses. */
        (0, import_i18n73._n)(
          "%s response deleted permanently.",
          "%s responses deleted permanently.",
          deleted,
          "jetpack-forms"
        ),
        formatNumber(deleted)
      );
      createSuccessNotice(successMessage, { type: "snackbar", id: "empty-spam" });
    }).catch(() => {
      createErrorNotice((0, import_i18n73.__)("Could not empty spam.", "jetpack-forms"), {
        type: "snackbar",
        id: "empty-spam-error"
      });
    }).finally(() => {
      setIsEmptying(false);
      invalidateCounts2();
      invalidateResolutionForStoreSelector("getEntityRecords");
    });
  }, [
    closeConfirmDialog,
    createErrorNotice,
    createSuccessNotice,
    invalidateResolutionForStoreSelector,
    invalidateCounts2,
    isEmpty4,
    isEmptying
  ]);
  return {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsSpam,
    selectedResponsesCount
  };
}

// src/dashboard/components/empty-spam-button/confirmation-modal.tsx
var import_components67 = __toESM(require_components(), 1);
var import_i18n74 = __toESM(require_i18n(), 1);
var import_jsx_runtime147 = __toESM(require_jsx_runtime(), 1);
function EmptySpamConfirmationModal({
  isOpen,
  onCancel,
  onConfirm,
  totalItemsSpam,
  selectedResponsesCount
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime147.jsxs)(
    import_components67.__experimentalConfirmDialog,
    {
      onCancel,
      onConfirm,
      isOpen,
      confirmButtonText: (0, import_i18n74.__)("Delete", "jetpack-forms"),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("h3", { children: (0, import_i18n74.__)("Delete forever", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime147.jsx)("p", { children: selectedResponsesCount > 0 ? (0, import_i18n74.sprintf)(
          // translators: %s: the number of responses in spam
          (0, import_i18n74._n)(
            "%s response in spam will be deleted forever. This action cannot be undone.",
            "All %s responses in spam will be deleted forever. This action cannot be undone.",
            totalItemsSpam || 0,
            "jetpack-forms"
          ),
          formatNumber(totalItemsSpam)
        ) : (0, import_i18n74.__)(
          "All responses in spam will be deleted forever. This action cannot be undone.",
          "jetpack-forms"
        ) })
      ]
    }
  );
}

// src/dashboard/components/empty-spam-button/index.tsx
var import_jsx_runtime148 = __toESM(require_jsx_runtime(), 1);
var EmptySpamButton = ({
  totalItemsSpam: totalItemsSpamProp
} = {}) => {
  const {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsSpam,
    selectedResponsesCount
  } = useEmptySpam({
    totalItemsSpam: totalItemsSpamProp
  });
  return /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_jsx_runtime148.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
      import_components68.Button,
      {
        size: "compact",
        accessibleWhenDisabled: true,
        disabled: isEmpty4 || isEmptying,
        icon: trash_default,
        isBusy: isEmptying,
        label: isEmpty4 ? (0, import_i18n75.__)("Spam is already empty.", "jetpack-forms") : "",
        onClick: openConfirmDialog,
        showTooltip: isEmpty4,
        variant: "primary",
        children: (0, import_i18n75.__)("Delete spam", "jetpack-forms")
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(
      EmptySpamConfirmationModal,
      {
        isOpen: isConfirmDialogOpen,
        onCancel: closeConfirmDialog,
        onConfirm: onConfirmEmptying,
        totalItemsSpam,
        selectedResponsesCount
      }
    )
  ] });
};
var empty_spam_button_default = EmptySpamButton;

// src/dashboard/components/empty-trash-button/index.tsx
var import_components70 = __toESM(require_components(), 1);
var import_i18n78 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-empty-trash.ts
var import_api_fetch10 = __toESM(require_api_fetch(), 1);
var import_core_data4 = __toESM(require_core_data(), 1);
var import_data21 = __toESM(require_data(), 1);
var import_element90 = __toESM(require_element(), 1);
var import_i18n76 = __toESM(require_i18n(), 1);
var import_notices6 = __toESM(require_notices(), 1);
function useEmptyTrash({
  totalItemsTrash: totalItemsTrashProp
} = {}) {
  const [isConfirmDialogOpen, setConfirmDialogOpen] = (0, import_element90.useState)(false);
  const [isEmptying, setIsEmptying] = (0, import_element90.useState)(false);
  const [isEmpty4, setIsEmpty] = (0, import_element90.useState)(true);
  const { createSuccessNotice, createErrorNotice } = (0, import_data21.useDispatch)(import_notices6.store);
  const { invalidateResolutionForStoreSelector } = (0, import_data21.useDispatch)(import_core_data4.store);
  const { invalidateCounts: invalidateCounts2 } = (0, import_data21.useDispatch)(store3);
  const hookData = useInboxData();
  const totalItemsTrash = totalItemsTrashProp ?? hookData.totalItemsTrash ?? 0;
  const { selectedResponsesCount } = hookData;
  (0, import_element90.useEffect)(() => {
    setIsEmpty(!totalItemsTrash);
  }, [totalItemsTrash]);
  const openConfirmDialog = (0, import_element90.useCallback)(() => setConfirmDialogOpen(true), []);
  const closeConfirmDialog = (0, import_element90.useCallback)(() => setConfirmDialogOpen(false), []);
  const onConfirmEmptying = (0, import_element90.useCallback)(async () => {
    if (isEmptying || isEmpty4) {
      return;
    }
    closeConfirmDialog();
    setIsEmptying(true);
    analytics_default.tracks.recordEvent("jetpack_forms_empty_trash_click");
    (0, import_api_fetch10.default)({
      method: "DELETE",
      path: `/wp/v2/feedback/trash`
    }).then((response) => {
      const deleted = response?.deleted ?? 0;
      const successMessage = deleted === 1 ? (0, import_i18n76.__)("Response deleted permanently.", "jetpack-forms") : (0, import_i18n76.sprintf)(
        /* translators: %s: the number of responses deleted permanently. */
        (0, import_i18n76._n)(
          "%s response deleted permanently.",
          "%s responses deleted permanently.",
          deleted,
          "jetpack-forms"
        ),
        formatNumber(deleted)
      );
      createSuccessNotice(successMessage, { type: "snackbar", id: "empty-trash" });
    }).catch(() => {
      createErrorNotice((0, import_i18n76.__)("Could not empty trash.", "jetpack-forms"), {
        type: "snackbar",
        id: "empty-trash-error"
      });
    }).finally(() => {
      setIsEmptying(false);
      invalidateCounts2();
      invalidateResolutionForStoreSelector("getEntityRecords");
    });
  }, [
    closeConfirmDialog,
    createErrorNotice,
    createSuccessNotice,
    invalidateResolutionForStoreSelector,
    invalidateCounts2,
    isEmpty4,
    isEmptying
  ]);
  return {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsTrash,
    selectedResponsesCount
  };
}

// src/dashboard/components/empty-trash-button/confirmation-modal.tsx
var import_components69 = __toESM(require_components(), 1);
var import_i18n77 = __toESM(require_i18n(), 1);
var import_jsx_runtime149 = __toESM(require_jsx_runtime(), 1);
function EmptyTrashConfirmationModal({
  isOpen,
  onCancel,
  onConfirm,
  totalItemsTrash,
  selectedResponsesCount
}) {
  return /* @__PURE__ */ (0, import_jsx_runtime149.jsxs)(
    import_components69.__experimentalConfirmDialog,
    {
      onCancel,
      onConfirm,
      isOpen,
      confirmButtonText: (0, import_i18n77.__)("Delete", "jetpack-forms"),
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("h3", { children: (0, import_i18n77.__)("Delete forever", "jetpack-forms") }),
        /* @__PURE__ */ (0, import_jsx_runtime149.jsx)("p", { children: selectedResponsesCount > 0 ? (0, import_i18n77.sprintf)(
          // translators: %s: the number of responses in the trash.
          (0, import_i18n77._n)(
            "%s response in trash will be deleted forever. This action cannot be undone.",
            "All %s responses in trash will be deleted forever. This action cannot be undone.",
            totalItemsTrash || 0,
            "jetpack-forms"
          ),
          formatNumber(totalItemsTrash)
        ) : (0, import_i18n77.__)(
          "All responses in trash will be deleted forever. This action cannot be undone.",
          "jetpack-forms"
        ) })
      ]
    }
  );
}

// src/dashboard/components/empty-trash-button/index.tsx
var import_jsx_runtime150 = __toESM(require_jsx_runtime(), 1);
var EmptyTrashButton = ({
  totalItemsTrash: totalItemsTrashProp
} = {}) => {
  const {
    isConfirmDialogOpen,
    openConfirmDialog,
    closeConfirmDialog,
    onConfirmEmptying,
    isEmpty: isEmpty4,
    isEmptying,
    totalItemsTrash,
    selectedResponsesCount
  } = useEmptyTrash({
    totalItemsTrash: totalItemsTrashProp
  });
  return /* @__PURE__ */ (0, import_jsx_runtime150.jsxs)(import_jsx_runtime150.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
      import_components70.Button,
      {
        size: "compact",
        accessibleWhenDisabled: true,
        disabled: isEmpty4 || isEmptying,
        icon: trash_default,
        isBusy: isEmptying,
        label: isEmpty4 ? (0, import_i18n78.__)("Trash is already empty.", "jetpack-forms") : "",
        onClick: openConfirmDialog,
        showTooltip: isEmpty4,
        variant: "primary",
        children: (0, import_i18n78.__)("Empty trash", "jetpack-forms")
      }
    ),
    /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(
      EmptyTrashConfirmationModal,
      {
        isOpen: isConfirmDialogOpen,
        onCancel: closeConfirmDialog,
        onConfirm: onConfirmEmptying,
        totalItemsTrash,
        selectedResponsesCount
      }
    )
  ] });
};
var empty_trash_button_default = EmptyTrashButton;

// src/dashboard/components/export-responses/button.tsx
var import_components74 = __toESM(require_components(), 1);
var import_element99 = __toESM(require_element(), 1);
var import_i18n84 = __toESM(require_i18n(), 1);

// src/dashboard/hooks/use-export-responses.ts
var import_core_data5 = __toESM(require_core_data(), 1);
var import_data22 = __toESM(require_data(), 1);
var import_element91 = __toESM(require_element(), 1);
var import_i18n79 = __toESM(require_i18n(), 1);
function useExportResponses() {
  const [isSm] = use_breakpoint_match_default("sm");
  const [showExportModal, setShowExportModal] = (0, import_element91.useState)(false);
  const closeModal = (0, import_element91.useCallback)(() => setShowExportModal(false), [setShowExportModal]);
  const [autoConnectGdrive, setAutoConnectGdrive] = (0, import_element91.useState)(false);
  const { selectedResponsesCount, currentStatus } = (0, import_data22.useSelect)(
    (select3) => ({
      selectedResponsesCount: select3(store3).getSelectedResponsesCount(),
      currentStatus: select3(store3).getCurrentStatus()
    }),
    []
  );
  const isSpam = currentStatus.includes("spam");
  const isTrash = currentStatus.includes("trash");
  let statusLabel = (0, import_i18n79.__)("Export", "jetpack-forms");
  if (isSpam) {
    statusLabel = (0, import_i18n79.__)("Export spam", "jetpack-forms");
  } else if (isTrash) {
    statusLabel = (0, import_i18n79.__)("Export trash", "jetpack-forms");
  }
  const exportLabel = selectedResponsesCount > 0 ? `${statusLabel} (${formatNumber(selectedResponsesCount)})` : statusLabel;
  const openModal = (0, import_element91.useCallback)(() => {
    setShowExportModal(true);
    analytics_default.tracks.recordEvent("jetpack_forms_export_responses_modal_open", {
      viewport: isSm ? "mobile" : "desktop"
    });
  }, [isSm]);
  const userCanExport = (0, import_data22.useSelect)(
    (select3) => select3(import_core_data5.store).canUser("update", "settings"),
    []
  );
  const { selected, currentQuery: currentQuery2 } = (0, import_data22.useSelect)((select3) => {
    const { getSelectedResponsesFromCurrentDataset: getSelectedResponsesFromCurrentDataset2, getCurrentQuery: getCurrentQuery2 } = select3(store3);
    return { selected: getSelectedResponsesFromCurrentDataset2(), currentQuery: getCurrentQuery2() };
  }, []);
  const exportNonce = useConfigValue("exportNonce");
  const onExport = (0, import_element91.useCallback)(
    (action, nonceName) => {
      const data = new FormData();
      data.append("action", action);
      data.append(nonceName, exportNonce);
      selected.forEach((id) => data.append("selected[]", id));
      data.append("post", currentQuery2.parent || "all");
      data.append("search", currentQuery2.search || "");
      data.append("status", currentQuery2.status);
      if (currentQuery2.before && currentQuery2.after) {
        data.append("before", currentQuery2.before);
        data.append("after", currentQuery2.after);
      }
      return fetch(window.ajaxurl, { method: "POST", body: data });
    },
    [currentQuery2, selected, exportNonce]
  );
  (0, import_element91.useEffect)(() => {
    const url = new URL(window.location.href);
    if (url.searchParams.get("connect-gdrive") === "true") {
      setAutoConnectGdrive(true);
      openModal();
      url.searchParams.delete("connect-gdrive");
      window.history.replaceState({}, "", url);
    }
  }, [openModal]);
  return {
    showExportModal,
    openModal,
    closeModal,
    autoConnectGdrive,
    userCanExport,
    onExport,
    selectedResponsesCount,
    currentStatus,
    exportLabel
  };
}

// src/dashboard/components/export-responses/modal.tsx
var import_components73 = __toESM(require_components(), 1);
var import_data34 = __toESM(require_data(), 1);
var import_i18n83 = __toESM(require_i18n(), 1);

// ../../js-packages/shared-extension-utils/src/get-jetpack-data.js
var JETPACK_DATA_PATH = "Jetpack_Editor_Initial_State";
function getJetpackData() {
  return "object" === typeof window ? window?.[JETPACK_DATA_PATH] ?? null : null;
}

// ../../js-packages/shared-extension-utils/src/register-jetpack-plugin.js
var import_plugins2 = __toESM(require_plugins());

// ../../js-packages/shared-extension-utils/src/with-has-warning-is-interactive-class-names/index.jsx
var import_compose15 = __toESM(require_compose());

// ../../js-packages/shared-extension-utils/src/with-has-warning-is-interactive-class-names/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='977d89d9b0']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "977d89d9b0");
  style.appendChild(document.createTextNode(".block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-interactive>*{pointer-events:auto;user-select:auto}.block-editor-block-list__layout .block-editor-block-list__block.has-warning.is-interactive:after{content:none}"));
  document.head.appendChild(style);
}

// ../../js-packages/shared-extension-utils/src/with-has-warning-is-interactive-class-names/index.jsx
var import_jsx_runtime151 = __toESM(require_jsx_runtime());

// ../../js-packages/shared-extension-utils/src/plan-utils.js
var import_i18n80 = __toESM(require_i18n());
var import_url6 = __toESM(require_url());
var usableBlockWithFreePlan = [
  {
    name: "core/cover",
    mediaPlaceholder: true,
    mediaReplaceFlow: true,
    fileType: "video",
    description: (0, import_i18n80.__)("Upgrade your plan to use video covers", "jetpack-shared-extension-utils")
  },
  {
    name: "core/audio",
    mediaPlaceholder: true,
    mediaReplaceFlow: true,
    fileType: "audio",
    description: (0, import_i18n80.__)("Upgrade your plan to upload audio", "jetpack-shared-extension-utils")
  }
];

// ../../js-packages/connection/components/use-connection/index.ts
var import_data27 = __toESM(require_data(), 1);
var import_react23 = __toESM(require_react(), 1);

// ../../js-packages/connection/state/actions.jsx
var SET_CONNECTION_STATUS = "SET_CONNECTION_STATUS";
var SET_CONNECTION_STATUS_IS_FETCHING = "SET_CONNECTION_STATUS_IS_FETCHING";
var FETCH_CONNECTION_STATUS = "FETCH_CONNECTION_STATUS";
var SET_SITE_IS_REGISTERING = "SET_SITE_IS_REGISTERING";
var SET_USER_IS_CONNECTING = "SET_USER_IS_CONNECTING";
var SET_REGISTRATION_ERROR = "SET_REGISTRATION_ERROR";
var CLEAR_REGISTRATION_ERROR = "CLEAR_REGISTRATION_ERROR";
var REGISTER_SITE = "REGISTER_SITE";
var SET_AUTHORIZATION_URL = "SET_AUTHORIZATION_URL";
var CONNECT_USER = "CONNECT_USER";
var DISCONNECT_USER_SUCCESS = "DISCONNECT_USER_SUCCESS";
var FETCH_AUTHORIZATION_URL = "FETCH_AUTHORIZATION_URL";
var SET_CONNECTED_PLUGINS = "SET_CONNECTED_PLUGINS";
var SET_CONNECTION_ERRORS = "SET_CONNECTION_ERRORS";
var SET_IS_OFFLINE_MODE = "SET_IS_OFFLINE_MODE";
var setConnectionStatus = (connectionStatus2) => {
  return { type: SET_CONNECTION_STATUS, connectionStatus: connectionStatus2 };
};
var setConnectionStatusIsFetching = (isFetching) => {
  return { type: SET_CONNECTION_STATUS_IS_FETCHING, isFetching };
};
var fetchConnectionStatus = () => {
  return { type: FETCH_CONNECTION_STATUS };
};
var setSiteIsRegistering = (isRegistering) => {
  return { type: SET_SITE_IS_REGISTERING, isRegistering };
};
var setUserIsConnecting = (isConnecting) => {
  return { type: SET_USER_IS_CONNECTING, isConnecting };
};
var disconnectUserSuccess = () => {
  return { type: DISCONNECT_USER_SUCCESS };
};
var setRegistrationError = (registrationError2) => {
  return { type: SET_REGISTRATION_ERROR, registrationError: registrationError2 };
};
var clearRegistrationError = () => {
  return { type: CLEAR_REGISTRATION_ERROR };
};
var setAuthorizationUrl = (authorizationUrl2) => {
  return { type: SET_AUTHORIZATION_URL, authorizationUrl: authorizationUrl2 };
};
var fetchAuthorizationUrl = (redirectUri) => {
  return { type: FETCH_AUTHORIZATION_URL, redirectUri };
};
var setConnectedPlugins = (connectedPlugins2) => {
  return { type: SET_CONNECTED_PLUGINS, connectedPlugins: connectedPlugins2 };
};
var setConnectionErrors = (connectionErrors2) => {
  return { type: SET_CONNECTION_ERRORS, connectionErrors: connectionErrors2 };
};
var setIsOfflineMode = (isOfflineMode2) => {
  return { type: SET_IS_OFFLINE_MODE, isOfflineMode: isOfflineMode2 };
};
function* connectUser({ from, redirectFunc, redirectUri, skipPricingPage } = {}) {
  yield setUserIsConnecting(true);
  yield { type: CONNECT_USER, from, redirectFunc, redirectUri, skipPricingPage };
}
function* registerSite({ registrationNonce, redirectUri, from = "" }) {
  yield clearRegistrationError();
  yield setSiteIsRegistering(true);
  try {
    const response = yield { type: REGISTER_SITE, registrationNonce, redirectUri, from };
    yield setConnectionStatus({ isRegistered: true });
    yield setAuthorizationUrl(response.authorizeUrl);
    yield setSiteIsRegistering(false);
    return Promise.resolve(response);
  } catch (error2) {
    yield setRegistrationError(error2);
    yield setSiteIsRegistering(false);
    return Promise.reject(error2);
  }
}
var refreshConnectedPlugins = () => async ({ dispatch: dispatch4 }) => {
  return await new Promise((resolve) => {
    return api_default.fetchConnectedPlugins().then((data) => {
      dispatch4(setConnectedPlugins(data));
      resolve(data);
    });
  });
};
var actions = {
  setConnectionStatus,
  setConnectionStatusIsFetching,
  fetchConnectionStatus,
  fetchAuthorizationUrl,
  setSiteIsRegistering,
  setUserIsConnecting,
  setRegistrationError,
  clearRegistrationError,
  setAuthorizationUrl,
  registerSite,
  connectUser,
  disconnectUserSuccess,
  setConnectedPlugins,
  refreshConnectedPlugins,
  setConnectionErrors,
  setIsOfflineMode
};

// ../../js-packages/connection/state/controls.jsx
var import_data23 = __toESM(require_data(), 1);

// ../../js-packages/connection/state/assignLocation.jsx
function assignLocation(url) {
  return window.location.assign(url);
}

// ../../js-packages/connection/state/store-id.jsx
var STORE_ID = "jetpack-connection";
var store_id_default = STORE_ID;

// ../../js-packages/connection/state/controls.jsx
var REGISTER_SITE2 = ({ redirectUri, from }) => api_default.registerSite(null, redirectUri, from);
var CONNECT_USER2 = (0, import_data23.createRegistryControl)(
  ({ resolveSelect: resolveSelect2 }) => ({ from, redirectFunc, redirectUri, skipPricingPage } = {}) => {
    return new Promise((resolve, reject) => {
      resolveSelect2(store_id_default).getAuthorizationUrl(redirectUri).then((authorizationUrl2) => {
        const redirect = redirectFunc || ((url2) => assignLocation(url2));
        const url = new URL(authorizationUrl2);
        if (skipPricingPage) {
          url.searchParams.set("skip_pricing", "true");
        }
        if (from) {
          url.searchParams.set("from", encodeURIComponent(from));
        }
        const finalUrl = url.toString();
        redirect(finalUrl);
        resolve(finalUrl);
      }).catch((error2) => {
        reject(error2);
      });
    });
  }
);
var FETCH_AUTHORIZATION_URL2 = ({ redirectUri }) => api_default.fetchAuthorizationUrl(redirectUri);
var controls_default = {
  FETCH_AUTHORIZATION_URL: FETCH_AUTHORIZATION_URL2,
  REGISTER_SITE: REGISTER_SITE2,
  CONNECT_USER: CONNECT_USER2
};

// ../../js-packages/connection/state/reducers.jsx
var import_data24 = __toESM(require_data(), 1);
var connectionStatus = (state = {}, action) => {
  switch (action.type) {
    case SET_CONNECTION_STATUS:
      return { ...state, ...action.connectionStatus };
    case DISCONNECT_USER_SUCCESS:
      return { ...state, isUserConnected: false };
  }
  return state;
};
var connectedPlugins = (state = {}, action) => {
  switch (action.type) {
    case SET_CONNECTED_PLUGINS:
      return action.connectedPlugins;
  }
  return state;
};
var connectionStatusIsFetching = (state = false, action) => {
  switch (action.type) {
    case SET_CONNECTION_STATUS_IS_FETCHING:
      return action.isFetching;
  }
  return state;
};
var siteIsRegistering = (state = false, action) => {
  switch (action.type) {
    case SET_SITE_IS_REGISTERING:
      return action.isRegistering;
  }
  return state;
};
var userIsConnecting = (state = false, action) => {
  switch (action.type) {
    case SET_USER_IS_CONNECTING:
      return action.isConnecting;
  }
  return state;
};
var registrationError = (state, action) => {
  switch (action.type) {
    case CLEAR_REGISTRATION_ERROR:
      return false;
    case SET_REGISTRATION_ERROR:
      return action.registrationError;
    default:
      return state;
  }
};
var authorizationUrl = (state, action) => {
  switch (action.type) {
    case SET_AUTHORIZATION_URL:
      return action.authorizationUrl;
    default:
      return state;
  }
};
var userConnectionData = (state, action) => {
  switch (action.type) {
    default:
      return state;
  }
};
var connectionErrors = (state = {}, action) => {
  switch (action.type) {
    case SET_CONNECTION_ERRORS:
      return action.connectionErrors;
  }
  return state;
};
var isOfflineMode = (state = false, action) => {
  switch (action.type) {
    case SET_IS_OFFLINE_MODE:
      return action.isConnecting;
  }
  return state;
};
var reducers = (0, import_data24.combineReducers)({
  connectionStatus,
  connectionStatusIsFetching,
  siteIsRegistering,
  userIsConnecting,
  registrationError,
  authorizationUrl,
  userConnectionData,
  connectedPlugins,
  connectionErrors,
  isOfflineMode
});
var reducers_default = reducers;

// ../../js-packages/connection/state/resolvers.jsx
var import_data25 = __toESM(require_data(), 1);
var connectionResolvers = {
  getAuthorizationUrl: {
    isFulfilled: (state, ...args) => {
      const hasAuthorization = Boolean(state.authorizationUrl);
      const hasFinishedResolution = (0, import_data25.select)(store_id_default).hasFinishedResolution(
        "getAuthorizationUrl",
        args
      );
      if (hasAuthorization && !hasFinishedResolution) {
        (0, import_data25.dispatch)(store_id_default).finishResolution("getAuthorizationUrl", args);
      }
      return hasAuthorization;
    },
    *fulfill(redirectUri) {
      const response = yield actions.fetchAuthorizationUrl(redirectUri);
      yield actions.setAuthorizationUrl(response.authorizeUrl);
    }
  }
};
var resolvers_default = {
  ...connectionResolvers
};

// ../../js-packages/connection/state/selectors.jsx
var getWpcomUser = (state) => {
  return state?.userConnectionData?.currentUser?.wpcomUser;
};
var getBlogId = (state) => {
  return state?.userConnectionData?.currentUser?.blogId;
};
var connectionSelectors = {
  getConnectionStatus: (state) => state.connectionStatus || {},
  /**
   * Checks whether the store is fetching the connection status from the server
   *
   * @deprecated since 0.14.0
   * @return {boolean} Is the store is fetching the connection status from the server?
   */
  getConnectionStatusIsFetching: () => false,
  getSiteIsRegistering: (state) => state.siteIsRegistering || false,
  getUserIsConnecting: (state) => state.userIsConnecting || false,
  getRegistrationError: (state) => state.registrationError || false,
  getAuthorizationUrl: (state) => state.authorizationUrl || false,
  getUserConnectionData: (state) => state.userConnectionData || false,
  getConnectedPlugins: (state) => state.connectedPlugins || [],
  getConnectionErrors: (state) => state.connectionErrors || [],
  getIsOfflineMode: (state) => state.isOfflineMode || false,
  getWpcomUser,
  getBlogId
};
var selectors = {
  ...connectionSelectors
};
var selectors_default = selectors;

// ../../js-packages/connection/state/store-holder.jsx
var import_data26 = __toESM(require_data(), 1);
var storeHolder = class _storeHolder {
  static store = null;
  static mayBeInit(storeId, storeConfig) {
    if (null === _storeHolder.store) {
      _storeHolder.store = (0, import_data26.createReduxStore)(storeId, storeConfig);
      (0, import_data26.register)(_storeHolder.store);
    }
  }
};
var store_holder_default = storeHolder;

// ../../js-packages/connection/state/store.jsx
var initialState = window.JP_CONNECTION_INITIAL_STATE || getScriptData()?.connection;
if (!initialState) {
  console.error(
    "Jetpack Connection package: Initial state is missing. Check documentation to see how to use the Connection composer package to set up the initial state."
  );
}
store_holder_default.mayBeInit(store_id_default, {
  __experimentalUseThunks: true,
  reducer: reducers_default,
  actions,
  selectors: selectors_default,
  resolvers: resolvers_default,
  controls: controls_default,
  initialState: initialState || {}
});

// ../../js-packages/connection/components/use-connection/index.ts
var initialState2 = window?.JP_CONNECTION_INITIAL_STATE || getScriptData()?.connection || {};
function useConnection({
  registrationNonce = initialState2.registrationNonce,
  apiRoot = initialState2.apiRoot,
  apiNonce = initialState2.apiNonce,
  redirectUri,
  autoTrigger,
  from,
  skipUserConnection,
  skipPricingPage
} = {}) {
  const { registerSite: registerSite2, connectUser: connectUser2, refreshConnectedPlugins: refreshConnectedPlugins2 } = (0, import_data27.useDispatch)(store_id_default);
  const registrationError2 = (0, import_data27.useSelect)(
    (select3) => select3(store_id_default).getRegistrationError(),
    []
  );
  const {
    siteIsRegistering: siteIsRegistering2,
    userIsConnecting: userIsConnecting2,
    userConnectionData: userConnectionData2,
    connectedPlugins: connectedPlugins2,
    connectionErrors: connectionErrors2,
    isRegistered,
    isUserConnected,
    hasConnectedOwner,
    isOfflineMode: isOfflineMode2
  } = (0, import_data27.useSelect)((select3) => {
    const connectionStatus2 = select3(store_id_default).getConnectionStatus();
    return {
      siteIsRegistering: select3(store_id_default).getSiteIsRegistering(),
      userIsConnecting: select3(store_id_default).getUserIsConnecting(),
      userConnectionData: select3(store_id_default).getUserConnectionData() || {},
      connectedPlugins: select3(store_id_default).getConnectedPlugins(),
      connectionErrors: select3(store_id_default).getConnectionErrors(),
      isOfflineMode: select3(store_id_default).getIsOfflineMode(),
      isRegistered: connectionStatus2.isRegistered ?? false,
      isUserConnected: connectionStatus2.isUserConnected ?? false,
      hasConnectedOwner: connectionStatus2.hasConnectedOwner ?? false
    };
  }, []);
  const handleConnectUser = () => {
    if (!skipUserConnection) {
      return connectUser2({ from, redirectUri, skipPricingPage });
    } else if (redirectUri) {
      window.location.href = redirectUri;
      return Promise.resolve(redirectUri);
    }
    return Promise.resolve();
  };
  const handleRegisterSite = (e2) => {
    e2 && e2.preventDefault();
    if (isRegistered) {
      return handleConnectUser();
    }
    return registerSite2({ registrationNonce, redirectUri, from }).then(() => {
      return handleConnectUser();
    });
  };
  (0, import_react23.useEffect)(() => {
    api_default.setApiRoot(apiRoot);
    api_default.setApiNonce(apiNonce);
  }, [apiRoot, apiNonce]);
  (0, import_react23.useEffect)(() => {
    if (autoTrigger && !siteIsRegistering2 && !userIsConnecting2) {
      handleRegisterSite();
    }
  }, []);
  return {
    handleRegisterSite,
    handleConnectUser,
    refreshConnectedPlugins: refreshConnectedPlugins2,
    isRegistered,
    isUserConnected,
    siteIsRegistering: siteIsRegistering2,
    userIsConnecting: userIsConnecting2,
    registrationError: registrationError2,
    userConnectionData: userConnectionData2,
    hasConnectedOwner,
    connectedPlugins: connectedPlugins2,
    connectionErrors: connectionErrors2,
    isOfflineMode: isOfflineMode2
  };
}

// ../../js-packages/shared-extension-utils/src/hooks/use-analytics.js
var import_element92 = __toESM(require_element());
var { tracks } = analytics_default;
var { recordEvent } = tracks;
var useAnalytics = ({
  pageViewEventName = null,
  pageViewNamespace = "jetpack",
  pageViewSuffix = "page_view",
  pageViewEventProperties = {}
} = {}) => {
  const [pageViewRecorded, setPageViewRecorded] = (0, import_element92.useState)(false);
  const { isUserConnected, isRegistered, userConnectionData: userConnectionData2 = {} } = useConnection();
  const { wpcomUser: { login, ID } = {}, blogId } = userConnectionData2.currentUser || {};
  const recordEventAsync = (0, import_element92.useCallback)(
    async (event, properties = {}) => {
      if (!(isUserConnected && ID && login)) {
        return;
      }
      recordEvent(event, properties);
    },
    [isUserConnected, ID, login]
  );
  (0, import_element92.useEffect)(() => {
    if (!isUserConnected || !ID || !login || !blogId) {
      return;
    }
    analytics_default.initialize(ID, login, {
      blog_id: blogId
    });
  }, [blogId, ID, login, isUserConnected]);
  (0, import_element92.useEffect)(() => {
    const pageViewEvent = pageViewEventName ? `${pageViewNamespace}_${pageViewEventName}_${pageViewSuffix}` : null;
    if (!isRegistered) {
      return;
    }
    if (!pageViewEvent) {
      return;
    }
    if (!pageViewRecorded) {
      recordEventAsync(pageViewEvent, pageViewEventProperties);
      setPageViewRecorded(true);
    }
  }, [
    pageViewRecorded,
    pageViewNamespace,
    pageViewEventName,
    pageViewSuffix,
    isRegistered,
    pageViewEventProperties,
    recordEventAsync
  ]);
  return {
    recordEvent: recordEventAsync,
    tracks
  };
};
var use_analytics_default = useAnalytics;

// ../../js-packages/shared-extension-utils/src/hooks/use-autosave-and-redirect/index.ts
var import_data28 = __toESM(require_data());
var import_element93 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/hooks/use-ref-interval.ts
var import_element94 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/hooks/use-module-status/index.js
var import_data31 = __toESM(require_data());
var import_element95 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/modules-state/index.js
var import_data30 = __toESM(require_data());

// ../../js-packages/shared-extension-utils/src/modules-state/actions.js
var import_data29 = __toESM(require_data());

// ../../js-packages/shared-extension-utils/src/modules-state/controls.js
var import_api_fetch11 = __toESM(require_api_fetch());
var FETCH_JETPACK_MODULES = "FETCH_JETPACK_MODULES";
var UPDATE_JETPACK_MODULE_STATUS = "UPDATE_JETPACK_MODULE_STATUS";
var fetchJetpackModules = () => {
  return {
    type: FETCH_JETPACK_MODULES
  };
};
var updateJetpackModuleStatus = (settings) => {
  return {
    type: UPDATE_JETPACK_MODULE_STATUS,
    settings
  };
};
var controls_default2 = {
  [FETCH_JETPACK_MODULES]: function() {
    return (0, import_api_fetch11.default)({
      path: `/jetpack/v4/module/all`,
      method: "GET"
    });
  },
  [UPDATE_JETPACK_MODULE_STATUS]: function({ settings }) {
    return (0, import_api_fetch11.default)({
      path: `/jetpack/v4/module/${settings.name}/active`,
      method: "POST",
      data: {
        active: settings.active
      }
    });
  }
};

// ../../js-packages/shared-extension-utils/src/modules-state/actions.js
var SET_JETPACK_MODULES = "SET_JETPACK_MODULES";
var SET_MODULE_UPDATING = "SET_MODULE_UPDATING";
function* updateJetpackModuleStatus2(settings) {
  try {
    yield setIsUpdating(settings.name, true);
    yield updateJetpackModuleStatus(settings);
    const data = yield fetchJetpackModules();
    yield setJetpackModules({ data });
    return true;
  } catch {
    const oldSettings = (0, import_data29.select)(JETPACK_MODULES_STORE_ID).getJetpackModules();
    yield setJetpackModules(oldSettings);
    return false;
  } finally {
    yield setIsUpdating(settings.name, false);
  }
}
function* fetchModules() {
  if (isSimpleSite()) {
    return true;
  }
  try {
    yield setIsLoading(true);
    const data = yield fetchJetpackModules();
    yield setJetpackModules({ data });
    return true;
  } catch {
    const oldSettings = (0, import_data29.select)(JETPACK_MODULES_STORE_ID).getJetpackModules();
    yield setJetpackModules(oldSettings);
    return false;
  } finally {
    yield setIsLoading(false);
  }
}
function setIsLoading(isLoading) {
  return setJetpackModules({ isLoading });
}
function setIsUpdating(name, isUpdating) {
  return { type: SET_MODULE_UPDATING, name, isUpdating };
}
function setJetpackModules(options) {
  return { type: SET_JETPACK_MODULES, options };
}
var actions_default = { updateJetpackModuleStatus: updateJetpackModuleStatus2, setJetpackModules, fetchModules };

// ../../js-packages/shared-extension-utils/src/modules-state/reducer.js
var defaultState = {
  isLoading: false,
  isUpdating: {},
  data: {}
};
var setModulesData = (state = defaultState, action) => {
  switch (action.type) {
    case "SET_JETPACK_MODULES":
      return {
        ...state,
        ...action.options
      };
    case "SET_MODULE_UPDATING":
      return {
        ...state,
        ...{
          isUpdating: {
            ...state.isUpdating,
            [action.name]: action.isUpdating
          }
        }
      };
  }
  return state;
};
var reducer_default2 = setModulesData;

// ../../js-packages/shared-extension-utils/src/modules-state/resolvers.js
function* getJetpackModules() {
  try {
    yield setIsLoading(true);
    const data = yield fetchJetpackModules();
    if (data) {
      return setJetpackModules({ data });
    }
  } catch (e2) {
    console.error(e2);
  } finally {
    yield setIsLoading(false);
  }
}
var resolvers_default2 = { getJetpackModules };

// ../../js-packages/shared-extension-utils/src/modules-state/selectors.js
var jetpackModulesSelectors = {
  getJetpackModules: (state) => state.data,
  // We consider simple sites to have all modules active
  // TODO: we would remove this when wrapping logic with hooks
  isModuleActive: (state, moduleName) => isSimpleSite() || (state?.data?.[moduleName]?.activated ?? false),
  areModulesLoading: (state) => state.isLoading ?? false,
  isModuleUpdating: (state, moduleName) => state?.isUpdating?.[moduleName] ?? false
};
var selectors_default2 = jetpackModulesSelectors;

// ../../js-packages/shared-extension-utils/src/modules-state/index.js
var JETPACK_MODULES_STORE_ID = "jetpack-modules";
var store4 = (0, import_data30.createReduxStore)(JETPACK_MODULES_STORE_ID, {
  reducer: reducer_default2,
  actions: actions_default,
  controls: controls_default2,
  resolvers: resolvers_default2,
  selectors: selectors_default2
});
(0, import_data30.register)(store4);
var initialData = window?.Initial_State?.getModules || // Jetpack Dashboard
window?.Jetpack_Editor_Initial_State?.modules || // Gutenberg
null;
if (initialData !== null) {
  (0, import_data30.dispatch)(JETPACK_MODULES_STORE_ID).setJetpackModules({
    data: { ...initialData }
  });
}

// ../../js-packages/shared-extension-utils/src/get-block-icon-from-metadata.js
var import_element96 = __toESM(require_element());

// ../../js-packages/shared-extension-utils/src/libs/connection/index.ts
var import_debug4 = __toESM(require_browser());
var initialState3 = window?.JP_CONNECTION_INITIAL_STATE;
var debug4 = (0, import_debug4.default)("shared-extension-utils:connection");

// ../../js-packages/shared-extension-utils/src/hooks/use-upgrade-flow/index.js
var import_data32 = __toESM(require_data());
var import_hooks = __toESM(require_hooks());

// ../../js-packages/shared-extension-utils/src/block-editor-actions.js
var import_dom_ready = __toESM(require_dom_ready());

// src/dashboard/components/export-responses/csv.tsx
var import_components71 = __toESM(require_components(), 1);
var import_element97 = __toESM(require_element(), 1);
var import_i18n81 = __toESM(require_i18n(), 1);
var import_jsx_runtime152 = __toESM(require_jsx_runtime(), 1);
var CSVExport = ({ onExport }) => {
  const { tracks: tracks2 } = use_analytics_default();
  const downloadCSV = (0, import_element97.useCallback)(() => {
    tracks2.recordEvent("jetpack_forms_export_click", {
      destination: "csv",
      screen: "form-responses-inbox"
    });
    onExport("feedback_export", "feedback_export_nonce_csv").then(async (response) => {
      const blob = await response.blob();
      const a2 = document.createElement("a");
      a2.href = window.URL.createObjectURL(blob);
      const contentDispositionHeader = response.headers.get("Content-Disposition") ?? "";
      a2.download = contentDispositionHeader.split("filename=")[1] || "Jetpack Form Responses.csv";
      document.body.appendChild(a2);
      a2.click();
      document.body.removeChild(a2);
      window.URL.revokeObjectURL(a2.href);
    });
  }, [onExport, tracks2]);
  const buttonClasses = clsx_default("button", "export-button", "export-csv");
  return /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "jp-forms__export-modal-card", children: [
    /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "jp-forms__export-modal-card-header", children: [
      /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
        import_components71.SVG,
        {
          width: "22",
          height: "20",
          viewBox: "0 0 22 20",
          fill: "none",
          xmlns: "http://www.w3.org/2000/SVG",
          children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(
            import_components71.Path,
            {
              fillRule: "evenodd",
              clipRule: "evenodd",
              d: "M11.2309 5.04199L10.0797 2.73945C9.98086 2.54183 9.77887 2.41699 9.55792 2.41699H2.83333C2.51117 2.41699 2.25 2.67816 2.25 3.00033V16.7087C2.25 17.0308 2.51117 17.292 2.83333 17.292H19.1667C19.4888 17.292 19.75 17.0308 19.75 16.7087V5.62533C19.75 5.30316 19.4888 5.04199 19.1667 5.04199H11.2309ZM12.3125 3.29199L11.6449 1.95683C11.2497 1.16633 10.4417 0.666992 9.55792 0.666992H2.83333C1.54467 0.666992 0.5 1.71166 0.5 3.00033V16.7087C0.5 17.9973 1.54467 19.042 2.83333 19.042H19.1667C20.4553 19.042 21.5 17.9973 21.5 16.7087V5.62533C21.5 4.33666 20.4553 3.29199 19.1667 3.29199H12.3125Z",
              fill: "#008710"
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "jp-forms__export-modal-card-header-title", children: (0, import_i18n81.__)("CSV File", "jetpack-forms") })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime152.jsxs)("div", { className: "jp-forms__export-modal-card-body", children: [
      /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "jp-forms__export-modal-card-body-description", children: (0, import_i18n81.__)("Download your form response data as a CSV file.", "jetpack-forms") }),
      /* @__PURE__ */ (0, import_jsx_runtime152.jsx)("div", { className: "jp-forms__export-modal-card-body-cta", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_components71.Button, { variant: "primary", className: buttonClasses, onClick: downloadCSV, children: (0, import_i18n81.__)("Download", "jetpack-forms") }) })
    ] })
  ] });
};
var csv_default = CSVExport;

// src/dashboard/components/export-responses/google-drive.tsx
var import_components72 = __toESM(require_components(), 1);
var import_data33 = __toESM(require_data(), 1);
var import_element98 = __toESM(require_element(), 1);
var import_i18n82 = __toESM(require_i18n(), 1);

// src/util/get-preferred-responses-view.js
var PARTIAL_RESPONSES_PATH = "admin.php?page=jetpack-forms-admin";
var FULL_RESPONSES_PATH = getJetpackData()?.adminUrl + PARTIAL_RESPONSES_PATH;

// src/dashboard/components/export-responses/google-drive.tsx
var import_jsx_runtime153 = __toESM(require_jsx_runtime(), 1);
var GoogleDriveExport = ({ onExport, autoConnect = false }) => {
  const [isExporting, setIsExporting] = (0, import_element98.useState)(false);
  const { integration } = (0, import_data33.useSelect)((select3) => {
    const store5 = select3(INTEGRATIONS_STORE);
    const list = store5.getIntegrations() || [];
    return { integration: list.find((i2) => i2.id === "google-drive") };
  }, []);
  const { refreshIntegrations: refreshIntegrations2 } = (0, import_data33.useDispatch)(INTEGRATIONS_STORE);
  const isConnectedToGoogleDrive = !!integration?.isConnected;
  const gdriveConnectSupportURL = useConfigValue("gdriveConnectSupportURL");
  const { tracks: tracks2 } = use_analytics_default();
  const autoConnectOpened = (0, import_element98.useRef)(false);
  const [isTogglingConnection, setIsTogglingConnection] = (0, import_element98.useState)(false);
  const { isUserConnected, handleConnectUser, userIsConnecting: userIsConnecting2, isOfflineMode: isOfflineMode2 } = useConnection({
    redirectUri: PARTIAL_RESPONSES_PATH + "&connect-gdrive=true"
  });
  const needsUserConnection = !isSimpleSite() && !isUserConnected;
  const exportToGoogleDrive = (0, import_element98.useCallback)(() => {
    if (isExporting) {
      return;
    }
    setIsExporting(true);
    tracks2.recordEvent("jetpack_forms_export_click", {
      destination: "google-drive",
      screen: "form-responses-inbox"
    });
    onExport("grunion_export_to_gdrive", "feedback_export_nonce_gdrive").then((response) => response.json()).then(({ data }) => {
      window.open(data.sheet_link, "_blank");
    }).finally(() => {
      setIsExporting(false);
    });
  }, [tracks2, onExport, isExporting]);
  const handleConnectClick = (0, import_element98.useCallback)(() => {
    if (!integration?.settingsUrl) return;
    tracks2.recordEvent("jetpack_forms_upsell_googledrive_click", {
      screen: "form-responses-inbox"
    });
    setIsTogglingConnection(true);
    esm_default2(integration?.settingsUrl, ({ keyring_id: keyringId }) => {
      if (keyringId) {
        refreshIntegrations2();
      } else {
        setIsTogglingConnection(false);
      }
    });
  }, [tracks2, integration?.settingsUrl, refreshIntegrations2]);
  if (isOfflineMode2) {
    return null;
  }
  const buttonClasses = clsx_default("button", "export-button", "export-gdrive");
  return /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "jp-forms__export-modal-card", children: [
    /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "jp-forms__export-modal-card-header", children: [
      /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
        import_components72.SVG,
        {
          width: "18",
          height: "24",
          viewBox: "0 0 18 24",
          fill: "none",
          xmlns: "http://www.w3.org/2000/SVG",
          children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
            import_components72.Path,
            {
              d: "M11.8387 1.16016H2C1.44772 1.16016 1 1.60787 1 2.16016V21.8053V21.8376C1 22.3899 1.44772 22.8376 2 22.8376H16C16.5523 22.8376 17 22.3899 17 21.8376V5.80532M11.8387 1.16016V5.80532H17M11.8387 1.16016L17 5.80532M4.6129 13.0311V16.1279H9.25806M4.6129 13.0311V9.93435H9.25806M4.6129 13.0311H13.9032M13.9032 13.0311V9.93435H9.25806M13.9032 13.0311V16.1279H9.25806M9.25806 9.93435V16.1279",
              stroke: "#008710",
              strokeWidth: "1.5"
            }
          )
        }
      ),
      /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "jp-forms__export-modal-card-header-title", children: (0, import_i18n82.__)("Google Sheets", "jetpack-forms") })
    ] }),
    /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { className: "jp-forms__export-modal-card-body", children: [
      /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "jp-forms__export-modal-card-body-description", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)("div", { children: [
        (0, import_i18n82.__)("Export your data into a Google Sheets file.", "jetpack-forms"),
        !isConnectedToGoogleDrive && /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(import_jsx_runtime153.Fragment, { children: [
          "\xA0",
          /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
            "a",
            {
              href: gdriveConnectSupportURL,
              title: (0, import_i18n82.__)("Connect to Google Drive", "jetpack-forms"),
              target: "_blank",
              rel: "noopener noreferrer",
              children: (0, import_i18n82.__)("You need to connect to Google Drive.", "jetpack-forms")
            }
          )
        ] })
      ] }) }),
      /* @__PURE__ */ (0, import_jsx_runtime153.jsx)("div", { className: "jp-forms__export-modal-card-body-cta", children: !integration ? /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_components72.Spinner, {}) : /* @__PURE__ */ (0, import_jsx_runtime153.jsxs)(import_jsx_runtime153.Fragment, { children: [
        isConnectedToGoogleDrive && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
          import_components72.Button,
          {
            className: buttonClasses,
            variant: "primary",
            onClick: exportToGoogleDrive,
            isBusy: isExporting,
            children: (0, import_i18n82.__)("Export", "jetpack-forms")
          }
        ),
        !isConnectedToGoogleDrive && needsUserConnection && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
          import_components72.Button,
          {
            className: buttonClasses,
            variant: "primary",
            rel: "noopener noreferrer",
            target: "_blank",
            onClick: handleConnectUser,
            isBusy: userIsConnecting2,
            children: (0, import_i18n82.__)("Connect Jetpack user account", "jetpack-forms")
          }
        ),
        !isConnectedToGoogleDrive && !needsUserConnection && /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(
          import_components72.Button,
          {
            className: buttonClasses,
            variant: "primary",
            rel: "noopener noreferrer",
            target: "_blank",
            onClick: handleConnectClick,
            disabled: !integration?.settingsUrl || isTogglingConnection,
            ref: (el) => {
              if (autoConnect && !autoConnectOpened.current) {
                el?.click();
                autoConnectOpened.current = true;
              }
            },
            children: isTogglingConnection ? (0, import_i18n82.__)("Connecting\u2026", "jetpack-forms") : (0, import_i18n82._x)(
              "Connect to Google Drive",
              "",
              // Dummy context to avoid bad minification. See https://github.com/Automattic/jetpack/tree/e3f007ec7ac80715f3d82db33c9ed8098a7b45b4/projects/js-packages/i18n-check-webpack-plugin#conditional-function-call-compaction
              "jetpack-forms"
            )
          }
        )
      ] }) })
    ] })
  ] });
};
var google_drive_default = GoogleDriveExport;

// src/dashboard/components/export-responses/modal.tsx
var import_jsx_runtime154 = __toESM(require_jsx_runtime(), 1);
var ExportResponsesModal = ({
  onRequestClose,
  onExport,
  autoConnectGdrive
}) => {
  const { integrations } = (0, import_data34.useSelect)((select3) => {
    const store5 = select3(INTEGRATIONS_STORE);
    return {
      integrations: store5.getIntegrations() || []
    };
  }, []);
  const isGoogleDriveEnabled = integrations.some(
    (integration) => integration.id === "google-drive"
  );
  return /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(
    import_components73.Modal,
    {
      title: (0, import_i18n83.__)("Export responses", "jetpack-forms"),
      onRequestClose,
      size: "large",
      children: /* @__PURE__ */ (0, import_jsx_runtime154.jsxs)(import_components73.__experimentalVStack, { spacing: 8, children: [
        /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(csv_default, { onExport }),
        isGoogleDriveEnabled && /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(google_drive_default, { onExport, autoConnect: autoConnectGdrive })
      ] })
    }
  );
};
var modal_default = ExportResponsesModal;

// src/dashboard/components/export-responses/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='e4a3af377d']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "e4a3af377d");
  style.appendChild(document.createTextNode(".jp-forms__export-modal-card{border-radius:var(--jp-border-radius,4px);box-shadow:0 0 0 1px var(--jp-gray-10,#c3c4c7) inset;display:flex;flex-direction:column;isolation:isolate;padding:24px}.jp-forms__export-modal-card-body,.jp-forms__export-modal-card-header{display:flex}.jp-forms__export-modal-card-header{align-items:center;gap:16px;margin-bottom:16px}.jp-forms__export-modal-card-header-title{font-size:20px;font-style:normal;font-weight:700;line-height:30px}.jp-forms__export-modal-card-body{align-items:flex-start;flex-direction:column;gap:20px}@media (min-width:783px){.jp-forms__export-modal-card-body{align-items:center;flex-direction:row;gap:32px;justify-content:space-between}}.jp-forms__export-modal-card-body-description{color:#000;flex-grow:1;font-size:14px;font-style:normal;font-weight:400;letter-spacing:-.02em;line-height:24px;max-width:100%}@media (min-width:783px){.jp-forms__export-modal-card-body-description{max-width:60%}}.jp-forms__export-modal-card-body-description a{color:inherit}.jp-forms__export-modal-card-body-cta{align-self:flex-start}@media (min-width:783px){.jp-forms__export-modal-card-body-cta{align-self:flex-end}}.jp-forms__export-modal-card-body-cta a.export-gdrive{display:flex}"));
  document.head.appendChild(style);
}

// src/dashboard/components/export-responses/button.tsx
var import_jsx_runtime155 = __toESM(require_jsx_runtime(), 1);
var ExportResponsesButton = ({
  isPrimary = false,
  showIcon = true,
  onClick: onClickProp
}) => {
  const {
    showExportModal,
    openModal,
    closeModal,
    userCanExport,
    onExport,
    autoConnectGdrive,
    exportLabel
  } = useExportResponses();
  const { totalItems, isLoadingData } = useInboxData();
  const isEmpty4 = isLoadingData || totalItems === 0;
  const isDisabled = isEmpty4 || userCanExport === false;
  const handleClick = (0, import_element99.useCallback)(() => {
    onClickProp?.();
    openModal();
  }, [onClickProp, openModal]);
  if (userCanExport === false) {
    return null;
  }
  return /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(import_jsx_runtime155.Fragment, { children: [
    /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
      import_components74.Button,
      {
        size: "compact",
        variant: isPrimary ? "primary" : "secondary",
        icon: showIcon ? download_default : void 0,
        onClick: handleClick,
        accessibleWhenDisabled: true,
        disabled: isDisabled,
        label: isEmpty4 ? (0, import_i18n84.__)("Nothing to export.", "jetpack-forms") : "",
        showTooltip: isEmpty4,
        children: exportLabel
      }
    ),
    showExportModal && /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(
      modal_default,
      {
        onRequestClose: closeModal,
        onExport,
        autoConnectGdrive
      }
    )
  ] });
};
var button_default = ExportResponsesButton;

// src/dashboard/wp-build/components/manage-integrations-button/index.tsx
var import_components75 = __toESM(require_components(), 1);
var import_i18n85 = __toESM(require_i18n(), 1);
var import_jsx_runtime156 = __toESM(require_jsx_runtime(), 1);
function ManageIntegrationsButton({ onClick }) {
  return /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(import_components75.Button, { size: "compact", variant: "secondary", onClick, children: (0, import_i18n85.__)("Manage integrations", "jetpack-forms") });
}

// src/dashboard/wp-build/hooks/use-rename-form.ts
var import_core_data6 = __toESM(require_core_data(), 1);
var import_data35 = __toESM(require_data(), 1);
var import_element100 = __toESM(require_element(), 1);
var import_i18n86 = __toESM(require_i18n(), 1);
var import_notices7 = __toESM(require_notices(), 1);
function useRenameForm() {
  const [renameFormItem, setRenameFormItem] = (0, import_element100.useState)(null);
  const { saveEntityRecord } = (0, import_data35.useDispatch)(import_core_data6.store);
  const { createSuccessNotice, createErrorNotice } = (0, import_data35.useDispatch)(import_notices7.store);
  const openRenameModal = (0, import_element100.useCallback)((item) => {
    setRenameFormItem(item);
  }, []);
  const closeRenameModal = (0, import_element100.useCallback)(() => {
    setRenameFormItem(null);
  }, []);
  const handleRename = (0, import_element100.useCallback)(
    async (newTitle) => {
      if (!renameFormItem) {
        return;
      }
      try {
        await saveEntityRecord(
          "postType",
          FORM_POST_TYPE,
          {
            id: renameFormItem.id,
            title: newTitle
          },
          { throwOnError: true }
        );
        createSuccessNotice((0, import_i18n86.__)("Form renamed.", "jetpack-forms"), { type: "snackbar" });
      } catch (error2) {
        createErrorNotice((0, import_i18n86.__)("Failed to rename form.", "jetpack-forms"), {
          type: "snackbar"
        });
        console.error("Failed to rename form:", error2);
        throw error2;
      }
    },
    [renameFormItem, saveEntityRecord, createSuccessNotice, createErrorNotice]
  );
  return {
    renameFormItem,
    openRenameModal,
    closeRenameModal,
    handleRename
  };
}

// src/dashboard/wp-build/hooks/use-page-header-details.tsx
var import_jsx_runtime157 = __toESM(require_jsx_runtime(), 1);
function usePageHeaderDetails(props) {
  const {
    screen,
    sourceId,
    hasClassicForms,
    isIntegrationsEnabled,
    showDashboardIntegrations,
    onOpenIntegrations,
    onOpenFormsHelp
  } = props;
  const adminUrl = useConfigValue("adminUrl") || "";
  const statusView = props.statusView ?? "inbox";
  const sourceIdNumber = (0, import_element101.useMemo)(() => {
    const value = sourceId;
    const numberValue = typeof value === "number" ? value : Number(value);
    return Number.isFinite(numberValue) && numberValue > 0 ? numberValue : null;
  }, [sourceId]);
  const [isSm] = use_breakpoint_match_default("sm");
  const navigate = useNavigate3();
  const isFormsScreen = screen === "forms";
  const isSingleFormScreen = screen === "responses" && sourceIdNumber !== null;
  const { openNewForm } = useCreateForm();
  const [isCreateFormModalOpen, setIsCreateFormModalOpen] = (0, import_element101.useState)(false);
  const handleCreateFormClick = (0, import_element101.useCallback)(() => {
    setIsCreateFormModalOpen(true);
  }, []);
  const closeCreateFormModal = (0, import_element101.useCallback)(() => setIsCreateFormModalOpen(false), []);
  const handleCreateFormSave = (0, import_element101.useCallback)(
    async (formName) => {
      await openNewForm({ formTitle: formName });
    },
    [openNewForm]
  );
  const {
    showExportModal,
    openModal: openExportModal,
    closeModal: closeExportModal,
    onExport,
    autoConnectGdrive,
    exportLabel
  } = useExportResponses();
  const { totalItems, isLoadingData } = useInboxData();
  const hasResponses = !isLoadingData && totalItems > 0;
  const emptySpam = useEmptySpam();
  const emptyTrash = useEmptyTrash();
  const [isPermanentDeleteConfirmOpen, setIsPermanentDeleteConfirmOpen] = (0, import_element101.useState)(false);
  const permanentDeleteItemRef = (0, import_element101.useRef)(null);
  const { renameFormItem, openRenameModal, closeRenameModal, handleRename } = useRenameForm();
  const { saveEntityRecord, deleteEntityRecord } = (0, import_data36.useDispatch)(import_core_data7.store);
  const { createSuccessNotice, createErrorNotice } = (0, import_data36.useDispatch)(import_notices8.store);
  const { invalidateFormStatusCounts: invalidateFormStatusCounts2 } = (0, import_data36.useDispatch)(store3);
  const formRecord = (0, import_data36.useSelect)(
    (select3) => {
      if (!sourceIdNumber) {
        return void 0;
      }
      const record = select3(import_core_data7.store).getEntityRecord(
        "postType",
        "jetpack_form",
        sourceIdNumber
      );
      return record;
    },
    [sourceIdNumber]
  );
  const formTitle = (0, import_element101.useMemo)(() => {
    const rendered = formRecord?.title?.rendered || "";
    return (0, import_html_entities4.decodeEntities)(rendered);
  }, [formRecord?.title?.rendered]);
  const trashForm = (0, import_element101.useCallback)(
    async (item) => {
      const previousStatus = formRecord?.status || "draft";
      try {
        await deleteEntityRecord(
          "postType",
          FORM_POST_TYPE,
          item.id,
          { force: false },
          { throwOnError: true }
        );
        invalidateFormStatusCounts2();
        createSuccessNotice((0, import_i18n87.__)("Form moved to trash.", "jetpack-forms"), {
          type: "snackbar",
          actions: [
            {
              label: (0, import_i18n87.__)("Undo", "jetpack-forms"),
              onClick: () => {
                saveEntityRecord(
                  "postType",
                  FORM_POST_TYPE,
                  { id: item.id, status: previousStatus },
                  { throwOnError: true }
                ).then(() => {
                  invalidateFormStatusCounts2();
                  createSuccessNotice((0, import_i18n87.__)("Form restored.", "jetpack-forms"), {
                    type: "snackbar"
                  });
                }).catch(() => {
                  createErrorNotice((0, import_i18n87.__)("Could not restore form.", "jetpack-forms"), {
                    type: "snackbar"
                  });
                });
              }
            }
          ]
        });
        navigate({ to: "/forms" });
      } catch (error2) {
        createErrorNotice((0, import_i18n87.__)("Failed to move form to trash.", "jetpack-forms"), {
          type: "snackbar"
        });
        console.error("Failed to trash form:", error2);
      }
    },
    [
      deleteEntityRecord,
      formRecord?.status,
      invalidateFormStatusCounts2,
      createSuccessNotice,
      createErrorNotice,
      saveEntityRecord,
      navigate
    ]
  );
  const restoreForm = (0, import_element101.useCallback)(
    async (item) => {
      try {
        await saveEntityRecord(
          "postType",
          FORM_POST_TYPE,
          { id: item.id, status: "publish" },
          { throwOnError: true }
        );
        invalidateFormStatusCounts2();
        createSuccessNotice((0, import_i18n87.__)("Form restored.", "jetpack-forms"), {
          type: "snackbar"
        });
      } catch (error2) {
        createErrorNotice((0, import_i18n87.__)("Could not restore form.", "jetpack-forms"), {
          type: "snackbar"
        });
        console.error("Failed to restore form:", error2);
      }
    },
    [saveEntityRecord, invalidateFormStatusCounts2, createSuccessNotice, createErrorNotice]
  );
  const openPermanentDeleteConfirm = (0, import_element101.useCallback)((item) => {
    permanentDeleteItemRef.current = item;
    setIsPermanentDeleteConfirmOpen(true);
  }, []);
  const closePermanentDeleteConfirm = (0, import_element101.useCallback)(() => {
    setIsPermanentDeleteConfirmOpen(false);
    permanentDeleteItemRef.current = null;
  }, []);
  const confirmPermanentDelete = (0, import_element101.useCallback)(async () => {
    const item = permanentDeleteItemRef.current;
    if (!item) {
      return;
    }
    setIsPermanentDeleteConfirmOpen(false);
    permanentDeleteItemRef.current = null;
    try {
      await deleteEntityRecord(
        "postType",
        FORM_POST_TYPE,
        item.id,
        { force: true },
        { throwOnError: true }
      );
      invalidateFormStatusCounts2();
      createSuccessNotice((0, import_i18n87.__)("Form deleted permanently.", "jetpack-forms"), {
        type: "snackbar"
      });
      navigate({ to: "/forms" });
    } catch (error2) {
      createErrorNotice((0, import_i18n87.__)("Could not delete form.", "jetpack-forms"), {
        type: "snackbar"
      });
      console.error("Failed to permanently delete form:", error2);
    }
  }, [
    deleteEntityRecord,
    invalidateFormStatusCounts2,
    createSuccessNotice,
    createErrorNotice,
    navigate
  ]);
  const formStatus = formRecord?.status;
  const statusLabel = formStatus ? getFormStatusLabel(formStatus) : void 0;
  const badges = (0, import_element101.useMemo)(() => {
    if (!isSingleFormScreen || !formStatus || formStatus === "publish") {
      return void 0;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(Badge, { intent: "draft", children: statusLabel });
  }, [isSingleFormScreen, formStatus, statusLabel]);
  const {
    duplicateForm,
    previewForm,
    copyEmbed,
    copyShortcode,
    publishForms,
    setFormsToDraft,
    isUpdatingStatus
  } = useFormItemActions();
  const trackAction = (0, import_element101.useCallback)((eventName, source = "form_header") => {
    analytics_default.tracks.recordEvent(eventName, {
      source
    });
  }, []);
  const formItemControls = (0, import_element101.useMemo)(() => {
    if (!sourceIdNumber) {
      return [];
    }
    const formItem = { id: sourceIdNumber, title: formTitle, status: formRecord?.status };
    if (formRecord?.status === "trash") {
      return [
        {
          title: (0, import_i18n87.__)("Restore", "jetpack-forms"),
          onClick: () => {
            trackAction("jetpack_forms_form_restore_click");
            restoreForm(formItem);
          }
        },
        {
          title: (0, import_i18n87.__)("Delete permanently", "jetpack-forms"),
          onClick: () => {
            trackAction("jetpack_forms_form_delete_permanently_click");
            openPermanentDeleteConfirm(formItem);
          }
        }
      ];
    }
    const controls = [
      {
        title: (0, import_i18n87.__)("Preview", "jetpack-forms"),
        onClick: () => {
          trackAction("jetpack_forms_form_preview_click");
          previewForm(formItem);
        }
      }
    ];
    if (navigator?.clipboard) {
      controls.push(
        {
          title: (0, import_i18n87.__)("Copy embed", "jetpack-forms"),
          onClick: () => {
            trackAction("jetpack_forms_form_copy_embed_click");
            copyEmbed(formItem);
          }
        },
        {
          title: (0, import_i18n87.__)("Copy shortcode", "jetpack-forms"),
          onClick: () => {
            trackAction("jetpack_forms_form_copy_shortcode_click");
            copyShortcode(formItem);
          }
        }
      );
    }
    if (formRecord?.status === "publish") {
      controls.push({
        title: (0, import_i18n87.__)("Unpublish", "jetpack-forms"),
        onClick: () => {
          if (!isUpdatingStatus) {
            trackAction("jetpack_forms_form_unpublish_click");
            setFormsToDraft([formItem]);
          }
        }
      });
    } else {
      controls.push({
        title: (0, import_i18n87.__)("Publish", "jetpack-forms"),
        onClick: () => {
          if (!isUpdatingStatus) {
            trackAction("jetpack_forms_form_publish_click");
            publishForms([formItem]);
          }
        }
      });
    }
    controls.push(
      {
        title: (0, import_i18n87.__)("Rename", "jetpack-forms"),
        onClick: () => {
          trackAction("jetpack_forms_form_rename_click");
          openRenameModal(formItem);
        }
      },
      {
        title: (0, import_i18n87.__)("Duplicate", "jetpack-forms"),
        onClick: () => {
          trackAction("jetpack_forms_form_duplicate_click");
          duplicateForm(formItem);
        }
      },
      {
        title: (0, import_i18n87.__)("Trash", "jetpack-forms"),
        onClick: () => {
          trackAction("jetpack_forms_form_trash_click");
          trashForm(formItem);
        }
      }
    );
    return controls;
  }, [
    copyEmbed,
    copyShortcode,
    duplicateForm,
    trashForm,
    restoreForm,
    openPermanentDeleteConfirm,
    formRecord?.status,
    formTitle,
    isUpdatingStatus,
    publishForms,
    previewForm,
    setFormsToDraft,
    sourceIdNumber,
    openRenameModal,
    trackAction
  ]);
  const WrapWithJetpackLogo = ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(Stack, { align: "center", gap: "xs", children: [
    /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(jetpack_logo_default, { showText: false, width: 20 }),
    children
  ] });
  const ariaLabel = (0, import_element101.useMemo)(() => {
    if (isSingleFormScreen) {
      return formTitle || (0, import_i18n87.__)("Form responses", "jetpack-forms");
    }
    return "Jetpack Forms";
  }, [isSingleFormScreen, formTitle]);
  const title = (0, import_element101.useMemo)(() => {
    if (isSingleFormScreen) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(WrapWithJetpackLogo, { children: "Forms" });
  }, [isSingleFormScreen]);
  const breadcrumbs = (0, import_element101.useMemo)(() => {
    if (!isSingleFormScreen) {
      return null;
    }
    return /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(WrapWithJetpackLogo, { children: /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
      breadcrumbs_default,
      {
        items: [
          { label: (0, import_i18n87.__)("Forms", "jetpack-forms"), to: "/forms" },
          { label: formTitle || (0, import_i18n87.__)("Form responses", "jetpack-forms") }
        ]
      }
    ) });
  }, [isSingleFormScreen, formTitle]);
  const subtitle = (0, import_element101.useMemo)(() => {
    if (isFormsScreen) {
      const shortMessage = (0, import_i18n87.__)("View and manage all your forms.", "jetpack-forms");
      const longMessage = (0, import_i18n87.__)("View and manage all your forms in one place.", "jetpack-forms");
      return hasClassicForms ? /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(import_jsx_runtime157.Fragment, { children: [
        shortMessage,
        " ",
        /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_components76.Button, { variant: "link", onClick: onOpenFormsHelp, children: (0, import_i18n87.__)("Not seeing all your forms?", "jetpack-forms") })
      ] }) : longMessage;
    }
    if (isSingleFormScreen) {
      if (formTitle) {
        return (0, import_i18n87.sprintf)(
          /* translators: %s: form name */
          (0, import_i18n87.__)("View responses for %s.", "jetpack-forms"),
          formTitle
        );
      }
      return (0, import_i18n87.__)("View responses for this form.", "jetpack-forms");
    }
    return (0, import_i18n87.__)("View and manage all your form responses in one place.", "jetpack-forms");
  }, [formTitle, isFormsScreen, isSingleFormScreen, onOpenFormsHelp, hasClassicForms]);
  const trackEditFormClick = (0, import_element101.useCallback)(
    () => trackAction("jetpack_forms_form_edit_form_click"),
    [trackAction]
  );
  const trackExportClick = (0, import_element101.useCallback)(
    () => trackAction("jetpack_forms_form_export_click"),
    [trackAction]
  );
  const trackExportClickResponsesList = (0, import_element101.useCallback)(
    () => trackAction("jetpack_forms_form_export_click", "responses_list"),
    [trackAction]
  );
  const actions2 = (0, import_element101.useMemo)(() => {
    if (isSm) {
      const dropdownControls = [];
      if (isFormsScreen) {
        if (isIntegrationsEnabled && showDashboardIntegrations) {
          dropdownControls.push({
            onClick: onOpenIntegrations,
            title: (0, import_i18n87.__)("Manage integrations", "jetpack-forms")
          });
        }
        dropdownControls.push({
          onClick: handleCreateFormClick,
          title: (0, import_i18n87.__)("Create a form", "jetpack-forms")
        });
      } else if (isSingleFormScreen) {
        if (statusView === "inbox" && sourceIdNumber) {
          dropdownControls.push({
            onClick: () => {
              trackAction("jetpack_forms_form_edit_form_click");
              window.location.href = getFormEditUrl(sourceIdNumber, adminUrl);
            },
            title: (0, import_i18n87.__)("Edit form", "jetpack-forms")
          });
        }
        dropdownControls.push({
          onClick: () => {
            trackAction("jetpack_forms_form_export_click");
            openExportModal();
          },
          title: exportLabel,
          isDisabled: !hasResponses
        });
        if (statusView === "trash") {
          dropdownControls.push({
            onClick: emptyTrash.openConfirmDialog,
            title: (0, import_i18n87.__)("Empty trash", "jetpack-forms"),
            isDisabled: emptyTrash.isEmpty || emptyTrash.isEmptying
          });
        }
        if (statusView === "spam") {
          dropdownControls.push({
            onClick: emptySpam.openConfirmDialog,
            title: (0, import_i18n87.__)("Delete spam", "jetpack-forms"),
            isDisabled: emptySpam.isEmpty || emptySpam.isEmptying
          });
        }
        dropdownControls.push(...formItemControls);
      } else {
        if (statusView === "inbox" && isIntegrationsEnabled && showDashboardIntegrations) {
          dropdownControls.push({
            onClick: onOpenIntegrations,
            title: (0, import_i18n87.__)("Manage integrations", "jetpack-forms")
          });
        }
        if (statusView === "inbox") {
          dropdownControls.push({
            onClick: handleCreateFormClick,
            title: (0, import_i18n87.__)("Create a form", "jetpack-forms")
          });
        }
        dropdownControls.push({
          onClick: () => {
            trackAction("jetpack_forms_form_export_click", "responses_list");
            openExportModal();
          },
          title: exportLabel,
          isDisabled: !hasResponses
        });
        if (statusView === "trash") {
          dropdownControls.push({
            onClick: emptyTrash.openConfirmDialog,
            title: (0, import_i18n87.__)("Empty trash", "jetpack-forms"),
            isDisabled: emptyTrash.isEmpty || emptyTrash.isEmptying
          });
        }
        if (statusView === "spam") {
          dropdownControls.push({
            onClick: emptySpam.openConfirmDialog,
            title: (0, import_i18n87.__)("Delete spam", "jetpack-forms"),
            isDisabled: emptySpam.isEmpty || emptySpam.isEmptying
          });
        }
      }
      if (dropdownControls.length === 0) {
        return null;
      }
      return [
        /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
          import_components76.DropdownMenu,
          {
            controls: dropdownControls,
            icon: more_vertical_default,
            label: (0, import_i18n87.__)("More actions", "jetpack-forms"),
            toggleProps: { size: "compact" }
          },
          "actions-menu"
        ),
        // Include modals when on mobile
        ...isCreateFormModalOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            FormNameModal,
            {
              isOpen: isCreateFormModalOpen,
              onClose: closeCreateFormModal,
              onSave: handleCreateFormSave,
              title: (0, import_i18n87.__)("Create form", "jetpack-forms"),
              primaryButtonLabel: (0, import_i18n87.__)("Create", "jetpack-forms"),
              secondaryButtonLabel: (0, import_i18n87.__)("Cancel", "jetpack-forms"),
              placeholder: (0, import_i18n87.__)("Enter form title", "jetpack-forms")
            },
            "create-form-modal"
          )
        ] : [],
        ...showExportModal ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            modal_default,
            {
              onRequestClose: closeExportModal,
              onExport,
              autoConnectGdrive
            },
            "export-modal"
          )
        ] : [],
        ...emptyTrash.isConfirmDialogOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            EmptyTrashConfirmationModal,
            {
              isOpen: emptyTrash.isConfirmDialogOpen,
              onCancel: emptyTrash.closeConfirmDialog,
              onConfirm: emptyTrash.onConfirmEmptying,
              totalItemsTrash: emptyTrash.totalItemsTrash,
              selectedResponsesCount: emptyTrash.selectedResponsesCount
            },
            "empty-trash-confirm"
          )
        ] : [],
        ...emptySpam.isConfirmDialogOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            EmptySpamConfirmationModal,
            {
              isOpen: emptySpam.isConfirmDialogOpen,
              onCancel: emptySpam.closeConfirmDialog,
              onConfirm: emptySpam.onConfirmEmptying,
              totalItemsSpam: emptySpam.totalItemsSpam,
              selectedResponsesCount: emptySpam.selectedResponsesCount
            },
            "empty-spam-confirm"
          )
        ] : [],
        ...renameFormItem ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            FormNameModal,
            {
              isOpen: !!renameFormItem,
              onClose: closeRenameModal,
              onSave: handleRename,
              title: (0, import_i18n87.__)("Rename form", "jetpack-forms"),
              initialValue: renameFormItem?.title || ""
            },
            "rename-form-modal"
          )
        ] : [],
        ...isPermanentDeleteConfirmOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
            import_components76.__experimentalConfirmDialog,
            {
              onCancel: closePermanentDeleteConfirm,
              onConfirm: confirmPermanentDelete,
              isOpen: isPermanentDeleteConfirmOpen,
              confirmButtonText: (0, import_i18n87.__)("Delete permanently", "jetpack-forms"),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("h3", { children: (0, import_i18n87.__)("Delete permanently", "jetpack-forms") }),
                /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { children: (0, import_i18n87.__)(
                  "This will permanently delete this form. This action cannot be undone.",
                  "jetpack-forms"
                ) })
              ]
            },
            "permanent-delete-confirm"
          )
        ] : []
      ];
    }
    if (isFormsScreen) {
      return [
        ...isIntegrationsEnabled && showDashboardIntegrations ? [/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(ManageIntegrationsButton, { onClick: onOpenIntegrations }, "integrations")] : [],
        /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(CreateFormButton, { variant: "primary", showIcon: false, showNameModal: true }, "create")
      ];
    }
    if (isSingleFormScreen) {
      return [
        ...sourceIdNumber && formStatus !== "trash" ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            EditFormButton,
            {
              formId: sourceIdNumber,
              onClick: trackEditFormClick
            },
            "edit-form"
          )
        ] : [],
        /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
          button_default,
          {
            isPrimary: statusView === "inbox",
            showIcon: false,
            onClick: trackExportClick
          },
          "export"
        ),
        ...statusView === "trash" ? [/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(empty_trash_button_default, {}, "empty-trash")] : [],
        ...statusView === "spam" ? [/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(empty_spam_button_default, {}, "empty-spam")] : [],
        ...formItemControls.length > 0 ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            import_components76.DropdownMenu,
            {
              controls: formItemControls,
              icon: more_vertical_default,
              label: (0, import_i18n87.__)("More actions", "jetpack-forms"),
              toggleProps: { size: "compact" }
            },
            "form-actions-menu"
          )
        ] : [],
        ...renameFormItem ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
            FormNameModal,
            {
              isOpen: !!renameFormItem,
              onClose: closeRenameModal,
              onSave: handleRename,
              title: (0, import_i18n87.__)("Rename form", "jetpack-forms"),
              initialValue: renameFormItem?.title || ""
            },
            "rename-form-modal"
          )
        ] : [],
        ...isPermanentDeleteConfirmOpen ? [
          /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(
            import_components76.__experimentalConfirmDialog,
            {
              onCancel: closePermanentDeleteConfirm,
              onConfirm: confirmPermanentDelete,
              isOpen: isPermanentDeleteConfirmOpen,
              confirmButtonText: (0, import_i18n87.__)("Delete permanently", "jetpack-forms"),
              children: [
                /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("h3", { children: (0, import_i18n87.__)("Delete permanently", "jetpack-forms") }),
                /* @__PURE__ */ (0, import_jsx_runtime157.jsx)("p", { children: (0, import_i18n87.__)(
                  "This will permanently delete this form. This action cannot be undone.",
                  "jetpack-forms"
                ) })
              ]
            },
            "permanent-delete-confirm"
          )
        ] : []
      ];
    }
    return [
      ...statusView === "inbox" && isIntegrationsEnabled && showDashboardIntegrations ? [/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(ManageIntegrationsButton, { onClick: onOpenIntegrations }, "integrations")] : [],
      ...statusView === "inbox" ? [
        /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
          CreateFormButton,
          {
            variant: "secondary",
            showPatterns: false,
            showIcon: false,
            showNameModal: true
          },
          "create"
        )
      ] : [],
      /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(
        button_default,
        {
          isPrimary: statusView === "inbox",
          showIcon: false,
          onClick: trackExportClickResponsesList
        },
        "export"
      ),
      ...statusView === "trash" ? [/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(empty_trash_button_default, {}, "empty-trash")] : [],
      ...statusView === "spam" ? [/* @__PURE__ */ (0, import_jsx_runtime157.jsx)(empty_spam_button_default, {}, "empty-spam")] : []
    ];
  }, [
    adminUrl,
    isSm,
    isIntegrationsEnabled,
    onOpenIntegrations,
    showDashboardIntegrations,
    sourceIdNumber,
    isFormsScreen,
    isSingleFormScreen,
    formItemControls,
    statusView,
    handleCreateFormClick,
    isCreateFormModalOpen,
    closeCreateFormModal,
    handleCreateFormSave,
    openExportModal,
    showExportModal,
    closeExportModal,
    onExport,
    autoConnectGdrive,
    hasResponses,
    exportLabel,
    emptyTrash.openConfirmDialog,
    emptyTrash.isEmpty,
    emptyTrash.isEmptying,
    emptyTrash.isConfirmDialogOpen,
    emptyTrash.closeConfirmDialog,
    emptyTrash.onConfirmEmptying,
    emptyTrash.totalItemsTrash,
    emptyTrash.selectedResponsesCount,
    emptySpam.openConfirmDialog,
    emptySpam.isEmpty,
    emptySpam.isEmptying,
    emptySpam.isConfirmDialogOpen,
    emptySpam.closeConfirmDialog,
    emptySpam.onConfirmEmptying,
    emptySpam.totalItemsSpam,
    emptySpam.selectedResponsesCount,
    renameFormItem,
    closeRenameModal,
    handleRename,
    isPermanentDeleteConfirmOpen,
    closePermanentDeleteConfirm,
    confirmPermanentDelete,
    formStatus,
    trackAction,
    trackEditFormClick,
    trackExportClick,
    trackExportClickResponsesList
  ]);
  return { ariaLabel, breadcrumbs, title, badges, subtitle, actions: actions2 };
}

// src/dashboard/wp-build/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='9e67ad1e64']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "9e67ad1e64");
  style.appendChild(document.createTextNode("body.jetpack-forms-responses .admin-ui-breadcrumbs__list li,body.jetpack_page_jetpack-forms-responses-wp-admin .admin-ui-breadcrumbs__list li{margin-bottom:0}body.jetpack-forms-responses .admin-ui-breadcrumbs__list li:first-of-type,body.jetpack_page_jetpack-forms-responses-wp-admin .admin-ui-breadcrumbs__list li:first-of-type{margin-inline-start:4px}body.jetpack-forms-responses .admin-ui-breadcrumbs__list li a,body.jetpack_page_jetpack-forms-responses-wp-admin .admin-ui-breadcrumbs__list li a{color:var(--wp-components-color-foreground,#1e1e1e);font-weight:600}body.jetpack-forms-responses .dataviews-search .components-base-control__field,body.jetpack_page_jetpack-forms-responses-wp-admin .dataviews-search .components-base-control__field{margin-bottom:0}"));
  document.head.appendChild(style);
}

// routes/forms/style.scss
if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='2cf0b0b6f3']")) {
  const style = document.createElement("style");
  style.setAttribute("data-wp-hash", "2cf0b0b6f3");
  style.appendChild(document.createTextNode('.admin-ui-page{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;text-wrap:pretty;z-index:1}.admin-ui-page__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-bottom:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#e0e0e0);padding:var(--wpds-dimension-padding-md,12px) var(--wpds-dimension-padding-2xl,24px);position:sticky;top:0;z-index:1}.admin-ui-page__header-title{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-lg,15px);font-weight:var(--wpds-font-weight-medium,499);line-height:var(--wpds-font-line-height-lg,28px);margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.admin-ui-page__sidebar-toggle-slot:empty{display:none}.admin-ui-page__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#6d6d6d);font-size:var(--wpds-font-size-md,13px);line-height:var(--wpds-font-line-height-md,24px);margin:0;padding-block-end:var(--wpds-dimension-padding-xs,4px)}.admin-ui-page__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto}.admin-ui-page__content.has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon{padding:0 var(--wpds-dimension-padding-xs,4px);width:auto}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon svg{display:none}.show-icon-labels .admin-ui-page__header-actions .components-button.has-icon:after{content:attr(aria-label);font-size:var(--wpds-font-size-sm,12px)}.admin-ui-breadcrumbs__list{font-family:var(--wpds-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-font-size-lg,15px);font-weight:var(--wpds-font-weight-medium,499);gap:0;line-height:var(--wpds-font-line-height-lg,28px);list-style:none;margin:0;min-height:32px;padding:0}.admin-ui-breadcrumbs__list li:not(:last-child):after{content:"/";margin:0 8px}.admin-ui-breadcrumbs__list h1{font-size:inherit;line-height:inherit}.dataviews-picker-wrapper,.dataviews-wrapper{background-color:var(--wp-dataviews-color-background,#fff);box-sizing:border-box;container:dataviews-wrapper/inline-size;display:flex;flex-direction:column;font-size:13px;height:100%;line-height:1.4;scroll-padding-bottom:64px}.dataviews-filters__container,.dataviews__view-actions{background-color:inherit;box-sizing:border-box;flex-shrink:0;left:0;padding:16px 24px;position:sticky}@media not (prefers-reduced-motion){.dataviews-filters__container,.dataviews__view-actions{transition:padding .1s ease-out}}.dataviews-loading,.dataviews-no-results{align-items:center;display:flex;flex-grow:1;justify-content:center;padding:0 24px}@media not (prefers-reduced-motion){.dataviews-loading,.dataviews-no-results{transition:padding .1s ease-out}}.dataviews-no-results.is-refreshing{opacity:.5;pointer-events:none}@media not (prefers-reduced-motion){.dataviews-no-results.is-refreshing{animation:dataviews-pulse 1s ease-in-out infinite;opacity:1}}@keyframes dataviews-pulse{0%,to{opacity:1}50%{opacity:.5}}.dataviews-loading-more{text-align:center}@container (max-width: 430px){.dataviews-filters__container,.dataviews__view-actions{padding:12px 24px}}.dataviews-title-field{font-size:13px;font-weight:499;width:100%}.dataviews-title-field,.dataviews-title-field a{color:#2f2f2f;text-overflow:ellipsis;white-space:nowrap}.dataviews-title-field a{display:block;flex-grow:0;overflow:hidden;text-decoration:none}.dataviews-title-field a:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field a:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.dataviews-title-field button.components-button.is-link{color:#1e1e1e;display:block;font-weight:inherit;overflow:hidden;text-decoration:none;text-overflow:ellipsis;white-space:nowrap;width:100%}.dataviews-title-field button.components-button.is-link:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable{color:#2f2f2f;cursor:pointer}.dataviews-title-field--clickable:hover{color:var(--wp-admin-theme-color)}.dataviews-title-field--clickable:focus{border-radius:2px;box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color,#007cba);color:var(--wp-admin-theme-color--rgb)}.dataviews__view-actions--infinite-scroll{background-color:#fff;position:sticky;top:0;z-index:2}.dataviews-bulk-actions-footer__item-count{color:#1e1e1e}.dataviews-bulk-actions-footer__container{margin-right:auto;min-height:32px}.dataviews-layout__container{background-color:inherit;display:flex;flex:1;flex-direction:column;min-height:0;overflow:auto}.dataviews-filters__button{position:relative}.dataviews-filters__container{padding-top:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true],.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:hover{opacity:0}.dataviews-filters__reset-button.dataviews-filters__reset-button[aria-disabled=true]:focus{opacity:1}.dataviews-filters__summary-popover{font-size:13px;line-height:1.4}.dataviews-filters__summary-popover .components-popover__content{border-radius:4px;max-width:250px;min-width:230px;width:100%}.dataviews-filters__summary-popover.components-dropdown__content .components-popover__content{padding:0}.dataviews-filters__summary-operators-container{padding:8px 16px}.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-listbox),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__search-widget-no-elements),.dataviews-filters__summary-operators-container:has(+.dataviews-filters__user-input-widget){border-bottom:1px solid #e0e0e0}.dataviews-filters__summary-operators-container:empty{display:none}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-name{color:#757575;flex-shrink:0;max-width:calc(100% - 55px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataviews-filters__summary-operators-container .dataviews-filters__summary-operators-filter-select{overflow:hidden;white-space:nowrap;width:100%}.dataviews-filters__summary-chip-container{position:relative;white-space:pre-wrap}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip{align-items:center;background:#f0f0f0;border:1px solid #0000;border-radius:16px;box-sizing:border-box;color:#2f2f2f;cursor:pointer;display:flex;min-height:32px;padding:4px 12px;position:relative}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable{cursor:default}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-reset{padding-inline-end:28px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:hover:not(.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.is-not-clickable),.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip[aria-expanded=true]{background:#e0e0e0;color:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values{background:rgba(var(--wp-admin-theme-color--rgb),.04);color:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values:hover,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip.has-values[aria-expanded=true]{background:rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip .dataviews-filters-__summary-filter-text-name{font-weight:499}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove{align-items:center;background:#0000;border:0;border-radius:50%;cursor:pointer;display:flex;height:24px;justify-content:center;padding:0;position:absolute;right:4px;top:50%;transform:translateY(-50%);width:24px}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove svg{fill:#757575}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover{background:#e0e0e0}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus svg,.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:hover svg{fill:#1e1e1e}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values svg{fill:var(--wp-admin-theme-color)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove.has-values:hover{background:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-filters__summary-chip-container .dataviews-filters__summary-chip-remove:focus-visible{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:none}.dataviews-filters__search-widget-filter-combobox-list{border-top:1px solid #e0e0e0;max-height:184px;overflow:auto;padding:4px}.dataviews-filters__search-widget-filter-combobox-list .dataviews-filters__search-widget-filter-combobox-item-value [data-user-value]{font-weight:600}.dataviews-filters__search-widget-listbox{overflow:auto;padding:4px}.dataviews-filters__search-widget-listitem{align-items:center;border-radius:2px;box-sizing:border-box;cursor:default;display:flex;font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;gap:8px;line-height:20px;min-height:32px;padding:4px 12px}.dataviews-filters__search-widget-listitem:last-child{margin-block-end:0}.dataviews-filters__search-widget-listitem:focus,.dataviews-filters__search-widget-listitem:hover,.dataviews-filters__search-widget-listitem[data-active-item]{background-color:var(--wp-admin-theme-color);color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-description,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-description{color:#fff}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection{background:#fff;border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-single-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection{border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem:focus .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem:hover .dataviews-filters__search-widget-listitem-multi-selection.is-selected,.dataviews-filters__search-widget-listitem[data-active-item] .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color-darker-20,#183ad6);border-color:var(--wp-admin-theme-color-darker-20,#183ad6)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-value{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-description{color:#757575;display:block;font-size:12px;line-height:16px;overflow:hidden;text-overflow:ellipsis}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{border:1px solid #1e1e1e;border-radius:50%;height:24px;margin-right:12px;max-width:24px;min-width:24px;position:relative;transition:none;width:24px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{transition:box-shadow .1s linear}}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{height:16px;max-width:16px;min-width:16px;width:16px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{background-color:#fff;border:4px solid #fff;box-sizing:inherit;height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid #0000}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection:checked{background:var(--wp-admin-theme-color);border:none}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection{margin:0;padding:0}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{background-color:#fff;border:4px solid #fff;border-radius:50%;box-sizing:inherit;content:"";height:12px;left:50%;margin:0;position:absolute;top:50%;transform:translate(-50%,-50%);width:12px}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-single-selection.is-selected:before{height:8px;width:8px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:24px;border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 #0000;flex-shrink:0;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:16px;line-height:normal;margin-right:12px;padding:6px 8px;transition:none}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:box-shadow .1s linear}}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection::placeholder{color:#1e1e1e9e}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:focus{box-shadow:0 0 0 2px #fff,0 0 0 4px var(--wp-admin-theme-color);outline:2px solid #0000}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{color:#fff;margin:-3px -5px}@media (min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:checked:before,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{margin:-4px 0 0 -5px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]{background:var(--wp-admin-theme-color);border-color:var(--wp-admin-theme-color)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{content:"\\f460";display:inline-block;float:left;font:normal 30px/1 dashicons;vertical-align:middle;width:16px;speak:none;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}@media (min-width:782px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-checked=mixed]:before{float:none;font-size:21px}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection:disabled,.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection[aria-disabled=true]{background:#f0f0f0;border-color:#ddd;cursor:default;opacity:1}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{background:#fff;color:#1e1e1e;height:var(--checkbox-size);margin:0;padding:0;position:relative;width:var(--checkbox-size)}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{--checkbox-size:16px}}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection{transition:border-color .1s ease-in-out}}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected{background:var(--wp-admin-theme-color,#3858e9);border-color:var(--wp-admin-theme-color,#3858e9)}.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:var(--checkbox-size);fill:#fff;height:var(--checkmark-size);left:50%;position:absolute;top:50%;transform:translate(-50%,-50%);width:var(--checkmark-size)}@media (min-width:600px){.dataviews-filters__search-widget-listitem .dataviews-filters__search-widget-listitem-multi-selection.is-selected svg{--checkmark-size:calc(var(--checkbox-size) + 4px)}}.dataviews-filters__search-widget-filter-combobox__wrapper{padding:8px;position:relative}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{border:1px solid #949494;border-radius:2px;box-shadow:0 0 0 #0000;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;line-height:normal;padding:6px 8px}@media not (prefers-reduced-motion){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{transition:box-shadow .1s linear}}@media (min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px;line-height:normal}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{border-color:var(--wp-admin-theme-color);box-shadow:0 0 0 .5px var(--wp-admin-theme-color);outline:2px solid #0000}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::placeholder{color:#1e1e1e9e}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{display:block;font-size:16px;height:32px;margin-left:0;margin-right:0;padding:0 8px 0 32px;width:100%}@media (min-width:600px){.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input{font-size:13px}}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input:focus{background:#fff;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::placeholder{color:#757575}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-cancel-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-decoration,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-button,.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__input::-webkit-search-results-decoration{-webkit-appearance:none}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon{align-items:center;bottom:0;display:flex;inset-inline-start:12px;justify-content:center;position:absolute;top:0;width:24px}.dataviews-filters__search-widget-filter-combobox__wrapper .dataviews-filters__search-widget-filter-combobox__icon:dir(ltr){transform:scaleX(-1)}.dataviews-filters__container-visibility-toggle{flex-shrink:0;position:relative}.dataviews-filters-toggle__count{background:var(--wp-admin-theme-color,#3858e9);border-radius:8px;box-sizing:border-box;color:#fff;font-size:11px;height:16px;line-height:16px;min-width:16px;outline:var(--wp-admin-border-width-focus) solid #fff;padding:0 4px;position:absolute;right:0;text-align:center;top:0;transform:translate(50%,-50%)}.dataviews-search{width:fit-content}.dataviews-filters__user-input-widget{padding:16px}.dataviews-filters__user-input-widget .components-input-control__prefix{padding-left:8px}.dataviews-filters__search-widget-no-elements{align-items:center;display:flex;justify-content:center;padding:16px}.dataviews-footer{background-color:inherit;border-top:1px solid #f0f0f0;bottom:0;flex-shrink:0;left:0;padding:12px 24px;position:sticky}@media not (prefers-reduced-motion){.dataviews-footer{transition:padding .1s ease-out}}.dataviews-footer{z-index:2}.dataviews-footer .is-refreshing{opacity:.5;pointer-events:none}@media not (prefers-reduced-motion){.dataviews-footer .is-refreshing{animation:dataviews-pulse 1s ease-in-out infinite;opacity:1}}@container (max-width: 560px){.dataviews-footer__content{flex-direction:column!important}.dataviews-footer__content .dataviews-bulk-actions-footer__container{width:100%}.dataviews-footer__content .dataviews-bulk-actions-footer__item-count{flex-grow:1}.dataviews-footer__content .dataviews-pagination{justify-content:space-between;width:100%}}.dataviews-pagination__page-select{font-size:11px;font-weight:499;text-transform:uppercase}@media (min-width:600px){.dataviews-pagination__page-select .components-select-control__input{font-size:11px!important;font-weight:499}}.dataviews-action-modal{z-index:1000001}.dataviews-item-actions .components-button:not(.dataviews-all-actions-button){padding:0 4px}.dataviews-selection-checkbox{--checkbox-input-size:24px}@media (min-width:600px){.dataviews-selection-checkbox{--checkbox-input-size:16px}}.dataviews-selection-checkbox{flex-shrink:0;line-height:0}.dataviews-selection-checkbox .components-checkbox-control__input-container{margin:0}.dataviews-view-config{container-type:inline-size;font-size:13px;line-height:1.4;width:320px}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper{height:100%;overflow-y:scroll}.dataviews-config__popover.is-expanded .dataviews-config__popover-content-wrapper .dataviews-view-config{width:auto}.dataviews-view-config__sort-direction .components-toggle-group-control-option-base{text-transform:uppercase}.dataviews-settings-section__title.dataviews-settings-section__title{font-size:15px;line-height:24px}.dataviews-settings-section__sidebar{grid-column:span 4}.dataviews-settings-section__content,.dataviews-settings-section__content>*{grid-column:span 8}.dataviews-settings-section__content .is-divided-in-two{display:contents}.dataviews-settings-section__content .is-divided-in-two>*{grid-column:span 4}.dataviews-settings-section:has(.dataviews-settings-section__content:empty){display:none}@container (max-width: 500px){.dataviews-settings-section.dataviews-settings-section{grid-template-columns:repeat(2,1fr)}.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__content,.dataviews-settings-section.dataviews-settings-section .dataviews-settings-section__sidebar{grid-column:span 2}}.dataviews-view-config__sort-controls>*{flex:1}.dataviews-view-config__label{text-wrap:nowrap}.dataviews-view-config__toggle-wrapper{display:inline-flex;position:relative}.dataviews-view-config__modified-indicator{background:var(--wp-admin-theme-color,#3858e9);border-radius:50%;height:4px;pointer-events:none;position:absolute;right:4px;top:4px;width:4px}.dataviews-view-grid-items{container-type:inline-size;display:grid;gap:24px;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));grid-template-rows:max-content;margin-bottom:auto;padding:0 24px 24px}@media not (prefers-reduced-motion){.dataviews-view-grid-items{transition:padding .1s ease-out}}.dataviews-view-grid-items.has-compact-density{gap:16px}.dataviews-view-grid-items.has-comfortable-density{gap:32px}.dataviews-view-grid{container-type:inline-size;display:flex;flex-direction:column;gap:24px;margin-bottom:auto;padding:0 24px 24px}@media not (prefers-reduced-motion){.dataviews-view-grid{transition:padding .1s ease-out}}.dataviews-view-grid.has-compact-density,.dataviews-view-grid.has-compact-density .dataviews-view-grid__row{gap:16px}.dataviews-view-grid.has-comfortable-density,.dataviews-view-grid.has-comfortable-density .dataviews-view-grid__row{gap:32px}.dataviews-view-grid .dataviews-view-grid__row{display:grid;gap:24px}.dataviews-view-grid .dataviews-view-grid__row .dataviews-view-grid__row__gridcell{border-radius:4px;position:relative}.dataviews-view-grid .dataviews-view-grid__row .dataviews-view-grid__row__gridcell[data-focus-visible]:after{border-radius:4px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";height:100%;left:0;outline:2px solid #0000;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-grid .dataviews-view-grid__card,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__title{padding:8px 0 4px}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__title-field--clickable{width:fit-content}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card.is-selected .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{color:#1e1e1e}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after,.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__media:focus:after,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-grid .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card.is-selected .dataviews-view-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__card .dataviews-view-grid__media:focus:after,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__card .dataviews-view-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-grid .dataviews-view-grid__media,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;overflow:hidden;position:relative;width:100%}.dataviews-view-grid .dataviews-view-grid__media.dataviews-view-grid__media--placeholder,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__media.dataviews-view-grid__media--placeholder{aspect-ratio:3/1}.dataviews-view-grid .dataviews-view-grid__media img,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__media img{height:100%;object-fit:cover;width:100%}.dataviews-view-grid .dataviews-view-grid__media:after,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-grid .dataviews-view-grid__media .dataviews-view-grid__media-placeholder,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__media .dataviews-view-grid__media-placeholder{background:#f0f0f0;border-radius:4px;box-shadow:none;display:block;height:100%;width:100%}.dataviews-view-grid .dataviews-view-grid__fields,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-grid .dataviews-view-grid__fields:not(:empty),.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty),.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field{align-items:center;min-height:24px}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value,.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field .dataviews-view-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))),.dataviews-view-grid-infinite-scroll .dataviews-view-grid__fields .dataviews-view-grid__field:not(:has(.dataviews-view-grid__field-value:not(:empty))){display:none}.dataviews-view-grid .dataviews-view-grid__badge-fields:not(:empty),.dataviews-view-grid-infinite-scroll .dataviews-view-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-grid-infinite-scroll.is-refreshing,.dataviews-view-grid.is-refreshing{opacity:.5;pointer-events:none}@media not (prefers-reduced-motion){.dataviews-view-grid-infinite-scroll.is-refreshing,.dataviews-view-grid.is-refreshing{animation:dataviews-pulse 1s ease-in-out infinite;opacity:1}}.dataviews-view-grid__field-value:empty,.dataviews-view-grid__field:empty{display:none}.dataviews-view-grid__card .dataviews-selection-checkbox{left:8px;opacity:0;position:absolute;top:-9999em;z-index:1}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-selection-checkbox{transition:opacity .1s linear}}@media (hover:none){.dataviews-view-grid__card .dataviews-selection-checkbox{opacity:1;top:8px}}.dataviews-view-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-grid__card:hover .dataviews-selection-checkbox{opacity:1;top:8px}.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:0;position:absolute;right:4px;top:4px;z-index:1}.dataviews-view-grid__card .dataviews-view-grid__media-actions .dataviews-all-actions-button{background-color:#fff}@media not (prefers-reduced-motion){.dataviews-view-grid__card .dataviews-view-grid__media-actions{transition:opacity .1s linear}}@media (hover:none){.dataviews-view-grid__card .dataviews-view-grid__media-actions{opacity:1;top:4px}}.dataviews-view-grid__card .dataviews-view-grid__media-actions:has(.dataviews-all-actions-button[aria-expanded=true]),.dataviews-view-grid__card:focus-within .dataviews-view-grid__media-actions,.dataviews-view-grid__card:hover .dataviews-view-grid__media-actions{opacity:1}.dataviews-view-grid__media--clickable{cursor:pointer}.dataviews-view-grid__group-header{color:#1e1e1e;container-type:inline-size;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 24px}div.dataviews-view-list{list-style-type:none}.dataviews-view-list{margin:0 0 auto}.dataviews-view-list div[role=article],.dataviews-view-list div[role=row]{border-top:1px solid #f0f0f0;margin:0}.dataviews-view-list div[role=article] .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row] .dataviews-view-list__item-wrapper{box-sizing:border-box;padding:16px 24px;position:relative}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions{display:flex;flex:0 0 auto;gap:4px;white-space:nowrap;width:max-content}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions .components-button,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions .components-button{position:relative;z-index:1}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>div,.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>div{height:24px}.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex:0;overflow:hidden;width:0}.dataviews-view-list div[role=article]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row]:where(.is-selected,.is-hovered,:focus-within) .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}@media (hover:none){.dataviews-view-list div[role=article] .dataviews-view-list__item-actions>:not(:last-child),.dataviews-view-list div[role=row] .dataviews-view-list__item-actions>:not(:last-child){flex-basis:min-content;overflow:unset;width:auto}}.dataviews-view-list div[role=article].is-selected.is-selected,.dataviews-view-list div[role=article].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=article].is-selected.is-selected+div[role=row],.dataviews-view-list div[role=row].is-selected.is-selected,.dataviews-view-list div[role=row].is-selected.is-selected+div[role=article],.dataviews-view-list div[role=row].is-selected.is-selected+div[role=row]{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered,.dataviews-view-list div[role=article]:not(.is-selected):focus-within,.dataviews-view-list div[role=article]:not(.is-selected):hover,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered,.dataviews-view-list div[role=row]:not(.is-selected):focus-within,.dataviews-view-list div[role=row]:not(.is-selected):hover{background-color:rgba(var(--wp-admin-theme-color--rgb),.04);border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12);color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered+div[role=article],.dataviews-view-list div[role=article]:not(.is-selected).is-hovered+div[role=row],.dataviews-view-list div[role=article]:not(.is-selected):focus-within+div[role=article],.dataviews-view-list div[role=article]:not(.is-selected):focus-within+div[role=row],.dataviews-view-list div[role=article]:not(.is-selected):hover+div[role=article],.dataviews-view-list div[role=article]:not(.is-selected):hover+div[role=row],.dataviews-view-list div[role=row]:not(.is-selected).is-hovered+div[role=article],.dataviews-view-list div[role=row]:not(.is-selected).is-hovered+div[role=row],.dataviews-view-list div[role=row]:not(.is-selected):focus-within+div[role=article],.dataviews-view-list div[role=row]:not(.is-selected):focus-within+div[role=row],.dataviews-view-list div[role=row]:not(.is-selected):hover+div[role=article],.dataviews-view-list div[role=row]:not(.is-selected):hover+div[role=row]{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-title-field,.dataviews-view-list div[role=article]:not(.is-selected).is-hovered .dataviews-view-list__field,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-title-field,.dataviews-view-list div[role=article]:not(.is-selected):focus-within .dataviews-view-list__field,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-title-field,.dataviews-view-list div[role=article]:not(.is-selected):hover .dataviews-view-list__field,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-title-field,.dataviews-view-list div[role=row]:not(.is-selected).is-hovered .dataviews-view-list__field,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-title-field,.dataviews-view-list div[role=row]:not(.is-selected):focus-within .dataviews-view-list__field,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-title-field,.dataviews-view-list div[role=row]:not(.is-selected):hover .dataviews-view-list__field{color:var(--wp-admin-theme-color)}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper{background-color:rgba(var(--wp-admin-theme-color--rgb),.08);color:#1e1e1e}.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=article].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__field,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=article].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__field,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=row].is-selected .dataviews-view-list__item-wrapper .dataviews-view-list__field,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-title-field,.dataviews-view-list div[role=row].is-selected:focus-within .dataviews-view-list__item-wrapper .dataviews-view-list__field{color:#1e1e1e}.dataviews-view-list .dataviews-view-list__item{appearance:none;background:none;border:none;cursor:pointer;inset:0;padding:0;position:absolute;scroll-margin:8px 0;z-index:1}.dataviews-view-list .dataviews-view-list__item:focus-visible{outline:none}.dataviews-view-list .dataviews-view-list__item:focus-visible:before{border-radius:2px;box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);content:"";inset:var(--wp-admin-border-width-focus);outline:2px solid #0000;position:absolute}.dataviews-view-list .dataviews-view-list__title-field{flex:1;line-height:24px;min-height:24px;overflow:hidden}.dataviews-view-list .dataviews-view-list__title-field:has(a,button){z-index:1}.dataviews-view-list .dataviews-view-list__media-wrapper{background-color:#fff;border-radius:4px;flex-shrink:0;height:52px;overflow:hidden;position:relative;width:52px}.dataviews-view-list .dataviews-view-list__media-wrapper img{height:100%;object-fit:cover;width:100%}.dataviews-view-list .dataviews-view-list__media-wrapper:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;position:absolute;top:0;width:100%}.dataviews-view-list .dataviews-view-list__field-wrapper{flex-grow:1;min-width:0}.dataviews-view-list .dataviews-view-list__field{color:#757575}.dataviews-view-list .dataviews-view-list__fields{display:flex;flex-wrap:wrap;font-size:12px;gap:12px;row-gap:4px}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field:has(.dataviews-view-list__field-value:empty),.dataviews-view-list .dataviews-view-list__fields:empty{display:none}.dataviews-view-list .dataviews-view-list__fields .dataviews-view-list__field-value{align-items:center;display:flex;line-height:20px;min-height:24px}.dataviews-view-list+.dataviews-pagination{justify-content:space-between}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__item-wrapper{padding:8px 24px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__title-field{line-height:16px;min-height:16px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__media-wrapper{height:32px;width:32px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__fields{gap:8px;row-gap:4px}.dataviews-view-list.has-compact-density div[role=row] .dataviews-view-list__fields .dataviews-view-list__field-value{line-height:16px;min-height:16px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__item-wrapper{padding:24px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__title-field{line-height:32px;min-height:32px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__media-wrapper{height:64px;width:64px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__fields{gap:16px;row-gap:8px}.dataviews-view-list.has-comfortable-density div[role=row] .dataviews-view-list__fields .dataviews-view-list__field-value{line-height:24px;min-height:32px}.dataviews-view-list.is-refreshing{opacity:.5;pointer-events:none}@media not (prefers-reduced-motion){.dataviews-view-list.is-refreshing{animation:dataviews-pulse 1s ease-in-out infinite;opacity:1}}.dataviews-view-list__group-header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 24px}.dataviews-view-table{background-color:inherit;border-collapse:collapse;border-color:inherit;color:#757575;margin-bottom:auto;position:relative;text-indent:0;width:100%}.dataviews-view-table th{color:#1e1e1e;font-size:13px;font-weight:400;text-align:left}.dataviews-view-table td,.dataviews-view-table th{padding:12px}.dataviews-view-table td.dataviews-view-table__actions-column,.dataviews-view-table th.dataviews-view-table__actions-column{text-align:right}.dataviews-view-table td.dataviews-view-table__actions-column--sticky,.dataviews-view-table th.dataviews-view-table__actions-column--sticky{background-color:var(--wp-dataviews-color-background,#fff);position:sticky;right:0}.dataviews-view-table td.dataviews-view-table__actions-column--stuck:after,.dataviews-view-table th.dataviews-view-table__actions-column--stuck:after{background-color:#f0f0f0;bottom:0;content:"";display:block;left:0;position:absolute;top:0;width:1px}.dataviews-view-table td.dataviews-view-table__checkbox-column,.dataviews-view-table th.dataviews-view-table__checkbox-column{padding-right:0}.dataviews-view-table td.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper,.dataviews-view-table th.dataviews-view-table__checkbox-column .dataviews-view-table__cell-content-wrapper{max-width:auto;min-width:auto}.dataviews-view-table tr{background-color:inherit;border-top:1px solid #f0f0f0}.dataviews-view-table tr td:first-child,.dataviews-view-table tr th:first-child{padding-left:24px}.dataviews-view-table tr td:last-child,.dataviews-view-table tr th:last-child{padding-right:24px}.dataviews-view-table tr:last-child{border-bottom:0}.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:0}@media (hover:none){.dataviews-view-table tr .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}}.dataviews-view-table tr.is-selected{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff);color:#757575}.dataviews-view-table tr.is-selected,.dataviews-view-table tr.is-selected+tr{border-top:1px solid rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-table tr.is-selected .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff)}.dataviews-view-table tr.is-hovered .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:focus-within .dataviews-item-actions .components-button:not(.dataviews-all-actions-button),.dataviews-view-table tr:hover .dataviews-item-actions .components-button:not(.dataviews-all-actions-button){opacity:1}.dataviews-view-table.has-bulk-actions tr:focus-within .dataviews-view-table__actions-column--sticky,.dataviews-view-table.has-bulk-actions tr:hover .dataviews-view-table__actions-column--sticky{background-color:var(--wp-dataviews-color-background,#fff)}.dataviews-view-table.has-bulk-actions tr.is-selected .dataviews-view-table__actions-column--sticky,.dataviews-view-table.has-bulk-actions tr.is-selected:hover .dataviews-view-table__actions-column--sticky{background-color:color-mix(in srgb,rgb(var(--wp-admin-theme-color--rgb)) 4%,#fff)}.dataviews-view-table thead{background-color:inherit;inset-block-start:0;position:sticky;z-index:1}.dataviews-view-table thead.dataviews-view-table__thead--stuck:after{background-color:#f0f0f0;bottom:0;content:"";display:block;height:1px;left:0;position:absolute;right:0}.dataviews-view-table thead tr{border:0}.dataviews-view-table thead th{background-color:inherit;font-size:11px;font-weight:499;padding-bottom:8px;padding-top:8px;text-transform:uppercase}.dataviews-view-table thead th:has(.dataviews-view-table-header-button){padding-left:4px;padding-right:4px}.dataviews-view-table thead th:has(.dataviews-view-table-header-button) .dataviews-view-table-header-button{gap:4px}.dataviews-view-table thead th:has(.dataviews-view-table-header-button):first-child{padding-left:16px}.dataviews-view-table thead th:has(.dataviews-view-table-header-button):last-child{padding-right:16px}.dataviews-view-table tbody td{vertical-align:top}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper{align-items:center;display:flex;min-height:32px;white-space:nowrap}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-end{font-variant-numeric:tabular-nums;justify-content:flex-end}.dataviews-view-table tbody .dataviews-view-table__cell-content-wrapper.dataviews-view-table__cell-align-center{justify-content:center}.dataviews-view-table tbody .components-v-stack>.dataviews-view-table__cell-content-wrapper:not(:first-child){min-height:0}.dataviews-view-table .dataviews-view-table-header-button{font-size:11px;font-weight:499;padding:4px 8px;text-transform:uppercase}.dataviews-view-table .dataviews-view-table-header-button:not(:hover){color:#1e1e1e}.dataviews-view-table .dataviews-view-table-header-button span{speak:none}.dataviews-view-table .dataviews-view-table-header-button span:empty{display:none}.dataviews-view-table .dataviews-view-table-header{padding-left:4px}.dataviews-view-table .dataviews-view-table__actions-column{white-space:nowrap;width:auto}.dataviews-view-table.has-compact-density thead th:has(.dataviews-view-table-header-button):not(:first-child){padding-left:0}.dataviews-view-table.has-compact-density thead th:has(.dataviews-view-table-header-button):not(:last-child){padding-right:0}.dataviews-view-table.has-compact-density td,.dataviews-view-table.has-compact-density th{padding:4px 8px}.dataviews-view-table.has-comfortable-density td,.dataviews-view-table.has-comfortable-density th{padding:16px 12px}.dataviews-view-table.has-comfortable-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-comfortable-density th.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density td.dataviews-view-table__checkbox-column,.dataviews-view-table.has-compact-density th.dataviews-view-table__checkbox-column{padding-right:0}.dataviews-view-table-selection-checkbox{--checkbox-input-size:24px}@media (min-width:600px){.dataviews-view-table-selection-checkbox{--checkbox-input-size:16px}}.dataviews-column-primary__media{background-color:#fff;border-radius:4px;flex-shrink:0;max-width:60px;min-height:32px;min-width:32px;overflow:hidden;position:relative}.dataviews-column-primary__media img{height:32px;object-fit:cover;width:32px}.dataviews-column-primary__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;position:absolute;top:0;width:100%}.dataviews-view-table__cell-content-wrapper:not(.dataviews-column-primary__media),.dataviews-view-table__primary-column-content:not(.dataviews-column-primary__media){max-width:80ch;min-width:15ch}.dataviews-view-table__group-header-row .dataviews-view-table__group-header-cell{color:#1e1e1e;font-weight:499;padding:12px 24px}.dataviews-view-table col[class^=dataviews-view-table__col-]:not(.dataviews-view-table__col-first-data):not(.dataviews-view-table__col-expand){width:1%}.dataviews-view-table.is-refreshing{opacity:.5;pointer-events:none}@media not (prefers-reduced-motion){.dataviews-view-table.is-refreshing{animation:dataviews-pulse 1s ease-in-out infinite;opacity:1}}.dataviews-view-picker-grid.has-compact-density .dataviews-view-grid-items{gap:16px}.dataviews-view-picker-grid.has-comfortable-density .dataviews-view-grid-items{gap:32px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card{height:100%;justify-content:flex-start;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-actions{padding:8px 0 4px}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field{align-content:center;min-height:24px;overflow:hidden;text-align:start}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__title-field--clickable{width:fit-content}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{color:#1e1e1e}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after,.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card.is-selected .dataviews-view-picker-grid__media:after{box-shadow:inset 0 0 0 1px var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-view-picker-grid__card .dataviews-view-picker-grid__media:focus:after{box-shadow:inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color)}.dataviews-view-picker-grid:focus-visible[aria-activedescendant]{outline:none}.dataviews-view-picker-grid:focus-visible [data-active-item=true]{outline:2px solid var(--wp-admin-theme-color)}.dataviews-view-picker-grid .dataviews-selection-checkbox{top:8px!important}.dataviews-view-picker-grid .dataviews-selection-checkbox input{pointer-events:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__media{aspect-ratio:1/1;background-color:#fff;border-radius:4px;min-height:0;position:relative;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media img{height:100%;object-fit:cover;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__media:after{border-radius:4px;box-shadow:inset 0 0 0 1px #0000001a;content:"";height:100%;left:0;pointer-events:none;position:absolute;top:0;width:100%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields{font-size:12px;line-height:16px;position:relative}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields:not(:empty){padding:0 0 12px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field-value:not(:empty){line-height:20px;min-height:24px;padding-top:2px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field{align-items:center;min-height:24px}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-name{color:#757575;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:35%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field .dataviews-view-picker-grid__field-value{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;width:65%}.dataviews-view-picker-grid .dataviews-view-picker-grid__fields .dataviews-view-picker-grid__field:not(:has(.dataviews-view-picker-grid__field-value:not(:empty))){display:none}.dataviews-view-picker-grid .dataviews-view-picker-grid__badge-fields:not(:empty){padding-bottom:12px}.dataviews-view-picker-grid__field-value:empty,.dataviews-view-picker-grid__field:empty{display:none}.dataviews-view-picker-grid__card .dataviews-selection-checkbox{left:8px;position:absolute;top:-9999em;z-index:1}@media (hover:none){.dataviews-view-picker-grid__card .dataviews-selection-checkbox{top:8px}}.dataviews-view-picker-grid__card.is-selected .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:focus-within .dataviews-selection-checkbox,.dataviews-view-picker-grid__card:hover .dataviews-selection-checkbox{top:8px}.dataviews-view-picker-grid__media--clickable{cursor:pointer}.dataviews-view-picker-grid-group__header{color:#1e1e1e;font-size:15px;font-weight:499;margin:0 0 8px;padding:0 48px}.dataviews-view-picker-table{background-color:inherit}.dataviews-view-picker-table .dataviews-view-table__checkbox-column{width:48px}.dataviews-view-picker-table tbody:focus-visible[aria-activedescendant]{outline:none}.dataviews-view-picker-table tbody:focus-visible [data-active-item=true]{outline:2px solid var(--wp-admin-theme-color)}.dataviews-view-picker-table .dataviews-selection-checkbox .components-checkbox-control__input.components-checkbox-control__input{opacity:1;pointer-events:none}.dataviews-view-picker-table .dataviews-view-table__row{cursor:pointer}.dataviews-view-picker-table .dataviews-view-table__row.is-selected{background-color:rgba(var(--wp-admin-theme-color--rgb),.04)}.dataviews-view-picker-table .dataviews-view-table__row.is-hovered{background-color:rgba(var(--wp-admin-theme-color--rgb),.08)}.dataviews-view-picker-table .dataviews-view-table__row.is-selected.is-hovered{background-color:rgba(var(--wp-admin-theme-color--rgb),.12)}.dataviews-view-activity{margin:0 0 auto;padding:8px 24px}.dataviews-view-activity .dataviews-view-activity__group-header{color:#949494;font-size:15px;font-weight:499;margin:0 0 8px;padding:0}.dataviews-view-activity .dataviews-view-activity__item-actions{min-width:24px}.dataviews-view-activity .dataviews-view-activity__item-content{flex-grow:1}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-description,.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields,.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title{min-height:16px}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title{align-items:center;display:flex;flex:1;overflow:hidden;position:relative}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title--clickable{cursor:pointer}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-title--clickable:focus-visible{border-radius:2px;outline:var(--wp-admin-border-width-focus) solid var(--wp-admin-theme-color);outline-offset:var(--wp-admin-border-width-focus)}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__primary-actions{display:flex;flex:0 0 auto;width:max-content}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__primary-actions .components-button{position:relative;z-index:1}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields{color:#757575;display:flex;flex-wrap:wrap;gap:12px;row-gap:4px}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields .dataviews-view-activity__item-field:has(.dataviews-view-activity__item-field-value:empty),.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields:empty{display:none}.dataviews-view-activity .dataviews-view-activity__item-content .dataviews-view-activity__item-fields .dataviews-view-activity__item-field-value{align-items:center;display:flex}.dataviews-view-activity .dataviews-view-activity__item-type{align-self:stretch;flex-shrink:0}.dataviews-view-activity .dataviews-view-activity__item-type:after{background-color:#ddd;content:"";flex:1 1 auto;margin:0 auto;width:1px}.dataviews-view-activity .dataviews-view-activity__item-type:before{background-color:#ddd;content:"";flex:0 0 auto;margin:0 auto;width:1px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-type{width:8px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-type:before{height:12px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-type-icon{height:11px;width:11px}.dataviews-view-activity .dataviews-view-activity__item.is-compact .dataviews-view-activity__item-content{margin:12px 0}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-type{width:24px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-type:before{height:12px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-type-icon{height:25px;width:25px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-content{margin:12px 0;padding-top:8px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-type{width:32px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-type:before{height:8px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-type-icon{height:33px;width:33px}.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-content{margin:8px 0 16px;padding-top:12px}.dataviews-view-activity .dataviews-view-activity__item.is-balanced .dataviews-view-activity__item-bullet,.dataviews-view-activity .dataviews-view-activity__item.is-comfortable .dataviews-view-activity__item-bullet{height:9px;position:relative;top:50%;transform:translateY(-50%);width:9px}.dataviews-view-activity .dataviews-view-activity__item:first-child .dataviews-view-activity__item-type:before{visibility:hidden}.dataviews-view-activity .dataviews-view-activity__group:last-of-type>.dataviews-view-activity__item:last-of-type .dataviews-view-activity__item-type:after,.dataviews-view-activity>.dataviews-view-activity__item:last-child .dataviews-view-activity__item-type:after{background:linear-gradient(180deg,#ddd 0,#ddd3 60%,#ddd0)}.dataviews-view-activity .dataviews-view-activity__item-type-icon{background-color:#fff;flex-shrink:0;overflow:hidden}.dataviews-view-activity .dataviews-view-activity__item-type-icon .dataviews-view-activity__item-bullet,.dataviews-view-activity .dataviews-view-activity__item-type-icon img,.dataviews-view-activity .dataviews-view-activity__item-type-icon svg{border-radius:50%;box-shadow:inset 0 0 0 1px #ddd;box-sizing:border-box;display:block;height:100%;margin:0 auto;object-fit:cover;width:100%}.dataviews-view-activity .dataviews-view-activity__item-type-icon svg{padding:4px}.dataviews-view-activity .dataviews-view-activity__item-type-icon .dataviews-view-activity__item-bullet{background-color:#ddd;content:""}.dataviews-view-activity.is-refreshing{opacity:.5;pointer-events:none}@media not (prefers-reduced-motion){.dataviews-view-activity.is-refreshing{animation:dataviews-pulse 1s ease-in-out infinite;opacity:1}}.dataviews-view-activity+.dataviews-pagination{justify-content:space-between}.dataviews-picker-footer__bulk-selection{align-self:flex-start;height:32px}.dataviews-picker-footer__actions{align-self:flex-end}.dataviews-controls__datetime{border:none;padding:0}.dataviews-controls__relative-date-number,.dataviews-controls__relative-date-unit{flex:1 1 50%}.dataviews-controls__date input[type=date]::-webkit-calendar-picker-indicator,.dataviews-controls__date input[type=date]::-webkit-inner-spin-button{-webkit-appearance:none;display:none}.dataviews-controls__date-range-inputs>*{min-width:0}.dataviews-controls__color-picker-dropdown{display:flex}.dataviews-controls__date-preset{border:1px solid #ddd}.dataviews-controls__date-preset:active{background-color:#000}.dataforms-layouts-panel__field-trigger{align-items:flex-start;border-radius:2px;color:inherit;cursor:pointer;display:flex;isolation:isolate;min-height:24px;position:relative;width:100%}.dataforms-layouts-panel__field-trigger--label-side{flex-direction:row;gap:var(--wpds-dimension-gap-md,12px)}.dataforms-layouts-panel__field-trigger--label-top{display:grid;grid-template-columns:1fr auto}.dataforms-layouts-panel__field-trigger--label-none{align-items:center}.dataforms-layouts-panel__field-trigger:not(.is-disabled):hover{color:var(--wp-admin-theme-color)}.dataforms-layouts-panel__field-trigger:not(.is-disabled):hover .dataforms-layouts-panel__field-trigger-icon{opacity:1}.dataforms-layouts-panel__field-trigger:not(.is-disabled):hover .dataforms-layouts-panel__field-label{color:var(--wp-admin-theme-color)}.dataforms-layouts-panel__field-trigger.is-disabled{cursor:default}.dataforms-layouts-panel__field-trigger.is-disabled .dataforms-layouts-panel__field-control{color:#757575;font-weight:var(--wpds-font-weight-regular,400)}.dataforms-layouts-panel__field-trigger--edit-always .dataforms-layouts-panel__field-trigger-icon{fill:currentColor;opacity:1}.dataforms-layouts-panel__field-trigger--edit-always .dataforms-layouts-panel__field-trigger-icon:focus-visible,.dataforms-layouts-panel__field-trigger--edit-always .dataforms-layouts-panel__field-trigger-icon:hover{fill:var(--wp-admin-theme-color)}.dataforms-layouts-panel__field-trigger-icon{border-radius:var(--wpds-border-radius-xs,1px);color:var(--wp-admin-theme-color);flex:0 0 auto;opacity:0;padding:0}.dataforms-layouts-panel__field-trigger-icon:focus-visible{opacity:1;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wp-admin-theme-color)}.dataforms-layouts-panel__field-dropdown-anchor,.dataforms-layouts-panel__field-dropdown-anchor .components-dropdown{width:100%}.dataforms-layouts-panel__field-label{align-items:center;color:#757575;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:24px;text-transform:capitalize;width:38%}.dataforms-layouts-panel__field-label .components-base-control__label{display:inline;line-height:inherit;margin-bottom:0}.dataforms-layouts-panel__field-label.has-error{color:#cc1818}.dataforms-layouts-panel__field-label-error-content{align-items:center;cursor:help;display:inline-flex;fill:#cc1818;flex-direction:row;gap:4px;position:relative;z-index:1}.dataforms-layouts-panel__field-label-error-content svg{fill:currentColor}.dataforms-layouts-panel__field-control{align-items:center;display:flex;flex-grow:1;font-weight:var(--wpds-font-weight-medium,499);line-height:var(--wpds-font-line-height-md,24px);min-height:24px;min-width:0;overflow:hidden;word-break:break-word}.dataforms-layouts-panel__field-control>*{min-width:0}.dataforms-layouts-panel__field-trigger--label-top .dataforms-layouts-panel__field-label{width:100%}.dataforms-layouts-panel__field-trigger--label-top .dataforms-layouts-panel__field-control{grid-column:1/-1}.dataforms-layouts-panel__field-trigger--label-top .dataforms-layouts-panel__field-trigger-icon{grid-column:2;grid-row:1}.dataforms-layouts-panel__field-dropdown .components-popover__content{min-width:256px;padding:16px}.dataforms-layouts-panel__dropdown-header{margin-bottom:16px}.dataforms-layouts-panel__modal-footer{margin-top:16px}.components-popover.components-dropdown__content.dataforms-layouts-panel__field-dropdown{z-index:159990}.dataforms-layouts-regular__field{align-items:flex-start!important;justify-content:flex-start!important;min-height:32px;width:100%}.dataforms-layouts-regular__field .components-base-control__label,.dataforms-layouts-regular__field .components-form-token-field__label,.dataforms-layouts-regular__field .components-input-control__label{color:#1e1e1e}.dataforms-layouts-regular__field-label{align-items:center;display:flex;flex-shrink:0;hyphens:auto;line-height:20px;min-height:32px;width:38%}.dataforms-layouts-regular__field-label--label-position-side{align-self:center}.dataforms-layouts-regular__field-label .components-base-control__label{margin-bottom:0}.dataforms-layouts-regular__field-control{align-items:center;display:flex;flex-grow:1;min-height:32px}.dataforms-layouts-card__field{width:100%}.dataforms-layouts-card__field-header-content{min-height:24px}.dataforms-layouts-card__field-header-content-description{display:contents}.dataforms-layouts-card__field-description{color:#757575;display:block;font-size:13px;margin-bottom:16px}.dataforms-layouts-card__field-summary{align-items:center;display:flex;flex-direction:row;gap:16px}.dataforms-layouts-details__summary-content{display:inline-flex;min-height:24px}.dataforms-layouts-details__content{padding-top:12px}.dataforms-layouts-row__field-control{width:100%}.dataforms-layouts__wrapper{font-family:-apple-system,"system-ui",Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:400;line-height:20px}.jp-forms-dataviews__view-actions>div:not(:empty){min-height:48px}'));
  document.head.appendChild(style);
}

// routes/forms/stage.tsx
var import_jsx_runtime158 = __toESM(require_jsx_runtime());
var DEFAULT_VIEW = {
  type: "table",
  search: "",
  filters: [{ field: "status", operator: "is", value: "all" }],
  page: 1,
  perPage: 20,
  titleField: "title",
  fields: ["entries", "status", "modified"]
};
var defaultLayouts = {
  table: {},
  list: {}
};
function StageInner() {
  const navigate = useNavigate4();
  const searchParams = useSearch2({ from: "/forms" });
  const dateSettings = (0, import_date9.getSettings)();
  const [isIntegrationsModalOpen, setIsIntegrationsModalOpen] = (0, import_element102.useState)(false);
  const [isFormsHelpModalOpen, setIsFormsHelpModalOpen] = (0, import_element102.useState)(false);
  const integrations = (0, import_data37.useSelect)(
    (select3) => select3(INTEGRATIONS_STORE).getIntegrations?.() ?? [],
    []
  );
  const { refreshIntegrations: refreshIntegrations2 } = (0, import_data37.useDispatch)(INTEGRATIONS_STORE);
  const adminUrl = useConfigValue("adminUrl") || "";
  const isIntegrationsEnabled = useConfigValue("isIntegrationsEnabled");
  const showDashboardIntegrations = useConfigValue("showDashboardIntegrations");
  const hasClassicForms = useConfigValue("hasClassicForms");
  const [view, setView] = (0, import_element102.useState)(() => ({
    ...DEFAULT_VIEW,
    search: searchParams?.search || ""
  }));
  (0, import_element102.useEffect)(() => {
    const urlSearch = searchParams?.search || "";
    if (urlSearch !== view.search) {
      setView((previous) => ({ ...previous, search: urlSearch }));
    }
  }, [searchParams?.search]);
  const statusQuery = (0, import_element102.useMemo)(() => {
    const statusFilterValue2 = view.filters?.find((filter) => filter.field === "status")?.value;
    if (!statusFilterValue2 || statusFilterValue2 === "all") {
      return NON_TRASH_FORM_STATUSES;
    }
    return statusFilterValue2;
  }, [view.filters]);
  const isViewingTrash = (0, import_element102.useMemo)(() => {
    const statusFilterValue2 = view.filters?.find((filter) => filter.field === "status")?.value;
    return statusFilterValue2 === "trash";
  }, [view.filters]);
  const hasResponsesQuery = (0, import_element102.useMemo)(() => {
    const entriesFilterValue = view.filters?.find((filter) => filter.field === "entries")?.value;
    if (entriesFilterValue === "has_responses") {
      return "true";
    }
    if (entriesFilterValue === "no_responses") {
      return "false";
    }
    return void 0;
  }, [view.filters]);
  const statusCounts = useFormStatusCounts();
  const { records, isLoading, totalItems, totalPages } = useFormsData(
    view.page ?? 1,
    view.perPage ?? 20,
    view.search ?? "",
    statusQuery,
    hasResponsesQuery
  );
  const {
    duplicateForm,
    previewForm,
    copyEmbed,
    copyShortcode,
    publishForms,
    setFormsToDraft,
    isUpdatingStatus
  } = useFormItemActions();
  const {
    isDeleting,
    trashForms,
    restoreForms,
    isPermanentDeleteConfirmOpen,
    openPermanentDeleteConfirm,
    closePermanentDeleteConfirm,
    confirmPermanentDelete
  } = useDeleteForm({
    view,
    setView,
    recordsLength: records?.length ?? 0,
    statusQuery
  });
  const [selection, setSelection] = (0, import_element102.useState)([]);
  const [pendingPermanentDeleteCount, setPendingPermanentDeleteCount] = (0, import_element102.useState)(0);
  const { renameFormItem, openRenameModal, closeRenameModal, handleRename } = useRenameForm();
  (0, import_element102.useEffect)(() => {
    setSelection([]);
  }, [view.page, view.perPage, view.search, view.filters]);
  const onOpenPermanentDeleteConfirm = (0, import_element102.useCallback)(
    (items) => {
      setPendingPermanentDeleteCount(items?.length ?? 0);
      openPermanentDeleteConfirm(items);
    },
    [openPermanentDeleteConfirm]
  );
  const onClosePermanentDeleteConfirm = (0, import_element102.useCallback)(() => {
    setPendingPermanentDeleteCount(0);
    closePermanentDeleteConfirm();
  }, [closePermanentDeleteConfirm]);
  const onConfirmPermanentDelete = (0, import_element102.useCallback)(async () => {
    setPendingPermanentDeleteCount(0);
    try {
      await confirmPermanentDelete();
    } finally {
      setSelection([]);
    }
  }, [confirmPermanentDelete]);
  const fields = (0, import_element102.useMemo)(
    () => [
      {
        id: "title",
        label: (0, import_i18n88.__)("Form name", "jetpack-forms"),
        getValue: ({ item }) => item.title,
        render: ({ item }) => item.title || (0, import_i18n88.__)("(no title)", "jetpack-forms"),
        enableSorting: false,
        enableHiding: false
      },
      {
        id: "entries",
        label: (0, import_i18n88.__)("Responses", "jetpack-forms"),
        getValue: ({ item }) => (item.entriesCount ?? 0) > 0 ? "has_responses" : "no_responses",
        render: ({ item }) => formatNumber(item.entriesCount ?? 0),
        elements: [
          { label: (0, import_i18n88.__)("Has responses", "jetpack-forms"), value: "has_responses" },
          { label: (0, import_i18n88.__)("No responses", "jetpack-forms"), value: "no_responses" }
        ],
        filterBy: { operators: ["is"] },
        enableSorting: false
      },
      {
        id: "status",
        label: (0, import_i18n88.__)("Status", "jetpack-forms"),
        getValue: ({ item }) => item.status,
        render: ({ item }) => /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(Badge, { intent: "draft", children: getFormStatusLabel(item.status) }),
        elements: FORM_STATUSES.map((value) => ({
          value,
          label: (0, import_i18n88.sprintf)(
            /* translators: 1: status name, 2: form count */
            (0, import_i18n88.__)("%1$s (%2$s)", "jetpack-forms"),
            getFormStatusLabel(value),
            formatNumber(statusCounts[value])
          )
        })),
        filterBy: { operators: ["is"], isPrimary: true },
        enableSorting: false
      },
      {
        id: "modified",
        label: (0, import_i18n88.__)("Last updated", "jetpack-forms"),
        type: "date",
        render: ({ item }) => (0, import_date9.dateI18n)(dateSettings.formats.datetime, item.modified),
        enableSorting: false,
        filterBy: false
      }
    ],
    [dateSettings.formats.datetime, statusCounts]
  );
  const openSingleFormView = (0, import_element102.useCallback)(
    (formId) => {
      navigate({ href: `/responses/inbox?sourceId=${encodeURIComponent(String(formId))}` });
    },
    [navigate]
  );
  const actions2 = (0, import_element102.useMemo)(() => {
    const actionsList = [
      {
        id: "view-responses",
        isPrimary: true,
        label: (0, import_i18n88.__)("Responses", "jetpack-forms"),
        supportsBulk: false,
        callback(items) {
          analytics_default.tracks.recordEvent("jetpack_forms_form_view_responses_click", {
            source: "forms_list"
          });
          const [item] = items;
          if (!item) {
            return;
          }
          openSingleFormView(item.id);
        }
      }
    ];
    if (isViewingTrash) {
      actionsList.push({
        id: "restore-form",
        isPrimary: true,
        label: (0, import_i18n88.__)("Restore", "jetpack-forms"),
        supportsBulk: true,
        async callback(items) {
          analytics_default.tracks.recordEvent("jetpack_forms_form_restore_click", {
            source: "forms_list",
            multiple: items.length > 1
          });
          if (isDeleting) {
            return;
          }
          try {
            await restoreForms(items);
          } finally {
            setSelection([]);
          }
        }
      });
      actionsList.push({
        id: "delete-form-permanently",
        isPrimary: false,
        label: (0, import_i18n88.__)("Delete permanently", "jetpack-forms"),
        supportsBulk: true,
        async callback(items) {
          analytics_default.tracks.recordEvent("jetpack_forms_form_delete_permanently_click", {
            source: "forms_list",
            multiple: items.length > 1
          });
          if (isDeleting) {
            return;
          }
          if (!items?.length) {
            return;
          }
          onOpenPermanentDeleteConfirm(items);
        }
      });
      return actionsList;
    }
    actionsList.push({
      id: "edit-form",
      isPrimary: true,
      label: (0, import_i18n88.__)("Edit", "jetpack-forms"),
      supportsBulk: false,
      async callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_edit_form_click", {
          source: "forms_list"
        });
        const [item] = items;
        if (!item) {
          return;
        }
        const editUrl = item.editUrl || getFormEditUrl(item.id, adminUrl);
        window.location.href = editUrl;
      }
    });
    actionsList.push({
      id: "preview-form",
      isPrimary: false,
      label: (0, import_i18n88.__)("Preview", "jetpack-forms"),
      supportsBulk: false,
      async callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_preview_click", {
          source: "forms_list"
        });
        const [item] = items;
        if (item) {
          await previewForm(item);
        }
      }
    });
    if (navigator?.clipboard) {
      actionsList.push({
        id: "copy-embed",
        isPrimary: false,
        label: (0, import_i18n88.__)("Copy embed", "jetpack-forms"),
        supportsBulk: false,
        async callback(items) {
          analytics_default.tracks.recordEvent("jetpack_forms_form_copy_embed_click", {
            source: "forms_list"
          });
          const [item] = items;
          if (item) {
            await copyEmbed(item);
          }
        }
      });
      actionsList.push({
        id: "copy-shortcode",
        isPrimary: false,
        label: (0, import_i18n88.__)("Copy shortcode", "jetpack-forms"),
        supportsBulk: false,
        async callback(items) {
          analytics_default.tracks.recordEvent("jetpack_forms_form_copy_shortcode_click", {
            source: "forms_list"
          });
          const [item] = items;
          if (item) {
            await copyShortcode(item);
          }
        }
      });
    }
    const currentListQuery = getFormsListQuery(
      view.page ?? 1,
      view.perPage ?? 20,
      view.search ?? "",
      statusQuery
    );
    const statusUpdateOptions = { invalidateQueries: [currentListQuery] };
    actionsList.push({
      id: "publish-form",
      isPrimary: false,
      label: (0, import_i18n88.__)("Publish", "jetpack-forms"),
      isEligible: (item) => item.status !== "publish",
      supportsBulk: true,
      async callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_publish_click", {
          source: "forms_list",
          multiple: items.length > 1
        });
        if (isDeleting || isUpdatingStatus) {
          return;
        }
        const eligibleItems = (items || []).filter((item) => item.status !== "publish");
        if (!eligibleItems.length) {
          return;
        }
        try {
          await publishForms(eligibleItems, statusUpdateOptions);
        } finally {
          setSelection([]);
        }
      }
    });
    actionsList.push({
      id: "unpublish-form",
      isPrimary: false,
      label: (0, import_i18n88.__)("Unpublish", "jetpack-forms"),
      isEligible: (item) => item.status === "publish",
      supportsBulk: true,
      async callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_unpublish_click", {
          source: "forms_list",
          multiple: items.length > 1
        });
        if (isDeleting || isUpdatingStatus) {
          return;
        }
        const eligibleItems = (items || []).filter((item) => item.status === "publish");
        if (!eligibleItems.length) {
          return;
        }
        try {
          await setFormsToDraft(eligibleItems, statusUpdateOptions);
        } finally {
          setSelection([]);
        }
      }
    });
    actionsList.push({
      id: "rename-form",
      isPrimary: false,
      label: (0, import_i18n88.__)("Rename", "jetpack-forms"),
      supportsBulk: false,
      callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_rename_click", {
          source: "forms_list"
        });
        const [item] = items;
        if (!item) {
          return;
        }
        openRenameModal(item);
      }
    });
    actionsList.push({
      id: "duplicate-form",
      isPrimary: false,
      label: (0, import_i18n88.__)("Duplicate", "jetpack-forms"),
      supportsBulk: false,
      async callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_duplicate_click", {
          source: "forms_list"
        });
        const [item] = items;
        if (item) {
          await duplicateForm(item);
        }
      }
    });
    actionsList.push({
      id: "trash-form",
      isPrimary: false,
      label: (0, import_i18n88.__)("Trash", "jetpack-forms"),
      supportsBulk: true,
      async callback(items) {
        analytics_default.tracks.recordEvent("jetpack_forms_form_trash_click", {
          source: "forms_list",
          multiple: items.length > 1
        });
        if (isDeleting) {
          return;
        }
        try {
          await trashForms(items);
        } finally {
          setSelection([]);
        }
      }
    });
    return actionsList;
  }, [
    adminUrl,
    copyEmbed,
    copyShortcode,
    duplicateForm,
    isDeleting,
    isUpdatingStatus,
    isViewingTrash,
    onOpenPermanentDeleteConfirm,
    openRenameModal,
    openSingleFormView,
    publishForms,
    previewForm,
    restoreForms,
    setFormsToDraft,
    statusQuery,
    trashForms,
    view.page,
    view.perPage,
    view.search
  ]);
  const paginationInfo = (0, import_element102.useMemo)(
    () => ({
      totalItems: totalItems ?? 0,
      totalPages: totalPages ?? 0
    }),
    [totalItems, totalPages]
  );
  const onChangeView = (0, import_element102.useCallback)(
    (newView) => {
      setView(newView);
      if (newView.search !== view.search) {
        navigate({
          search: {
            ...searchParams,
            search: newView.search || void 0
          }
        });
      }
    },
    [navigate, searchParams, view.search]
  );
  const openIntegrationsModal = (0, import_element102.useCallback)(() => {
    setIsIntegrationsModalOpen(true);
  }, []);
  const closeIntegrationsModal = (0, import_element102.useCallback)(() => {
    setIsIntegrationsModalOpen(false);
  }, []);
  const openFormsHelpModal = (0, import_element102.useCallback)(() => {
    setIsFormsHelpModalOpen(true);
  }, []);
  const closeFormsHelpModal = (0, import_element102.useCallback)(() => {
    setIsFormsHelpModalOpen(false);
  }, []);
  const {
    title,
    ariaLabel,
    breadcrumbs,
    subtitle,
    actions: headerActions
  } = usePageHeaderDetails({
    screen: "forms",
    hasClassicForms: !!hasClassicForms,
    isIntegrationsEnabled: !!isIntegrationsEnabled,
    showDashboardIntegrations: !!showDashboardIntegrations,
    onOpenIntegrations: openIntegrationsModal,
    onOpenFormsHelp: openFormsHelpModal
  });
  const statusFilterValue = view.filters?.find((filter) => filter.field === "status")?.value;
  const hasActiveFilters = !!view.search?.trim() || !!statusFilterValue && statusFilterValue !== "all";
  const getItemId = (0, import_element102.useCallback)((item) => String(item.id), []);
  const onClickItem = (0, import_element102.useCallback)(
    (item) => {
      openSingleFormView(item.id);
    },
    [openSingleFormView]
  );
  return /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
    page_default,
    {
      breadcrumbs,
      title,
      ariaLabel,
      subTitle: subtitle,
      actions: headerActions,
      hasPadding: false,
      children: [
        /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
          dataviews_default,
          {
            paginationInfo,
            fields,
            actions: actions2,
            data: records || [],
            isLoading,
            empty: hasActiveFilters ? /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(NoResults, {}) : /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
              EmptyWrapper,
              {
                heading: (0, import_i18n88.__)("You're set up. No forms yet.", "jetpack-forms"),
                body: (0, import_i18n88.__)(
                  "Create a form to manage and reuse it across your site.",
                  "jetpack-forms"
                ),
                actions: /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_components77.__experimentalHStack, { justify: "center", spacing: "2", children: [
                  /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
                    CreateFormButton,
                    {
                      label: (0, import_i18n88.__)("Create a new form", "jetpack-forms"),
                      variant: "primary",
                      showNameModal: true
                    }
                  ),
                  hasClassicForms && /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(import_components77.Button, { size: "compact", variant: "secondary", onClick: openFormsHelpModal, children: (0, import_i18n88.__)("Not seeing all your forms?", "jetpack-forms") })
                ] })
              }
            ),
            view,
            onChangeView,
            selection,
            onChangeSelection: setSelection,
            onClickItem,
            getItemId,
            defaultLayouts,
            children: [
              /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(
                import_components77.__experimentalConfirmDialog,
                {
                  onCancel: onClosePermanentDeleteConfirm,
                  onConfirm: onConfirmPermanentDelete,
                  isOpen: isPermanentDeleteConfirmOpen,
                  confirmButtonText: (0, import_i18n88.__)("Delete permanently", "jetpack-forms"),
                  children: [
                    /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("h3", { children: (0, import_i18n88.__)("Delete permanently", "jetpack-forms") }),
                    /* @__PURE__ */ (0, import_jsx_runtime158.jsx)("p", { children: pendingPermanentDeleteCount === 1 ? (0, import_i18n88.__)(
                      "This will permanently delete this form. This action cannot be undone.",
                      "jetpack-forms"
                    ) : (0, import_i18n88.sprintf)(
                      /* translators: %d: number of forms */
                      (0, import_i18n88._n)(
                        "This will permanently delete %d form. This action cannot be undone.",
                        "This will permanently delete %d forms. This action cannot be undone.",
                        pendingPermanentDeleteCount,
                        "jetpack-forms"
                      ),
                      pendingPermanentDeleteCount
                    ) })
                  ]
                }
              ),
              /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(DataViewsHeaderRow, { activeTab: "forms" }),
              /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(dataviews_default.Layout, {}),
              /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(dataviews_default.Footer, {})
            ]
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
          FormNameModal,
          {
            isOpen: !!renameFormItem,
            onClose: closeRenameModal,
            onSave: handleRename,
            title: (0, import_i18n88.__)("Rename form", "jetpack-forms"),
            initialValue: renameFormItem?.title || ""
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(
          jetpack_integrations_modal_default,
          {
            isOpen: isIntegrationsModalOpen,
            onClose: closeIntegrationsModal,
            attributes: void 0,
            setAttributes: void 0,
            integrationsData: integrations,
            refreshIntegrations: refreshIntegrations2,
            context: "dashboard"
          }
        ),
        /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(FormsHelpModal, { isOpen: isFormsHelpModalOpen, onClose: closeFormsHelpModal })
      ]
    }
  );
}
var Stage = () => {
  return /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(WpRouteDashboardSearchParamsProvider, { from: "/forms", children: /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(StageInner, {}) });
};
export {
  Stage as stage
};
/*! Bundled license information:

use-sync-external-store/cjs/use-sync-external-store-shim.development.js:
  (**
   * @license React
   * use-sync-external-store-shim.development.js
   *
   * Copyright (c) Meta Platforms, Inc. and affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   *)
*/
