PHP 8.2.31
Preview: plugins.js Size: 11.67 KB
/home/nshryvcy/taramarriagebureau.com/wp-includes/js/dist/plugins.js

"use strict";
var wp;
(wp ||= {}).plugins = (() => {
  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 __commonJS = (cb, mod) => function __require() {
    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 __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
  ));
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);

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

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

  // package-external:@wordpress/is-shallow-equal
  var require_is_shallow_equal = __commonJS({
    "package-external:@wordpress/is-shallow-equal"(exports, module) {
      module.exports = window.wp.isShallowEqual;
    }
  });

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

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

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

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

  // packages/plugins/build-module/index.mjs
  var index_exports = {};
  __export(index_exports, {
    PluginArea: () => plugin_area_default,
    getPlugin: () => getPlugin,
    getPlugins: () => getPlugins,
    registerPlugin: () => registerPlugin,
    unregisterPlugin: () => unregisterPlugin,
    usePluginContext: () => usePluginContext,
    withPluginContext: () => withPluginContext
  });

  // node_modules/memize/dist/index.js
  function memize(fn, options) {
    var size = 0;
    var head;
    var tail;
    options = options || {};
    function memoized() {
      var node = head, len = arguments.length, args, i;
      searchCache: while (node) {
        if (node.args.length !== arguments.length) {
          node = node.next;
          continue;
        }
        for (i = 0; i < len; i++) {
          if (node.args[i] !== arguments[i]) {
            node = node.next;
            continue searchCache;
          }
        }
        if (node !== head) {
          if (node === tail) {
            tail = node.prev;
          }
          node.prev.next = node.next;
          if (node.next) {
            node.next.prev = node.prev;
          }
          node.next = head;
          node.prev = null;
          head.prev = node;
          head = node;
        }
        return node.val;
      }
      args = new Array(len);
      for (i = 0; i < len; i++) {
        args[i] = arguments[i];
      }
      node = {
        args,
        // Generate the result from original function
        val: fn.apply(null, args)
      };
      if (head) {
        head.prev = node;
        node.next = head;
      } else {
        tail = node;
      }
      if (size === /** @type {MemizeOptions} */
      options.maxSize) {
        tail = /** @type {MemizeCacheNode} */
        tail.prev;
        tail.next = null;
      } else {
        size++;
      }
      head = node;
      return node.val;
    }
    memoized.clear = function() {
      head = null;
      tail = null;
      size = 0;
    };
    return memoized;
  }

  // packages/plugins/build-module/components/plugin-area/index.mjs
  var import_element3 = __toESM(require_element(), 1);
  var import_hooks2 = __toESM(require_hooks(), 1);
  var import_is_shallow_equal = __toESM(require_is_shallow_equal(), 1);

  // packages/plugins/build-module/components/plugin-context/index.mjs
  var import_element = __toESM(require_element(), 1);
  var import_compose = __toESM(require_compose(), 1);
  var import_deprecated = __toESM(require_deprecated(), 1);
  var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
  var Context = (0, import_element.createContext)({
    name: null,
    icon: null
  });
  Context.displayName = "PluginContext";
  var PluginContextProvider = Context.Provider;
  function usePluginContext() {
    return (0, import_element.useContext)(Context);
  }
  var withPluginContext = (mapContextToProps) => (0, import_compose.createHigherOrderComponent)((OriginalComponent) => {
    (0, import_deprecated.default)("wp.plugins.withPluginContext", {
      since: "6.8.0",
      alternative: "wp.plugins.usePluginContext"
    });
    return (props) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Context.Consumer, { children: (context) => /* @__PURE__ */ (0, import_jsx_runtime.jsx)(
      OriginalComponent,
      {
        ...props,
        ...mapContextToProps(context, props)
      }
    ) });
  }, "withPluginContext");

  // packages/plugins/build-module/components/plugin-error-boundary/index.mjs
  var import_element2 = __toESM(require_element(), 1);
  var PluginErrorBoundary = class extends import_element2.Component {
    constructor(props) {
      super(props);
      this.state = {
        hasError: false
      };
    }
    static getDerivedStateFromError() {
      return { hasError: true };
    }
    componentDidCatch(error) {
      const { name, onError } = this.props;
      if (onError) {
        onError(name, error);
      }
    }
    render() {
      if (!this.state.hasError) {
        return this.props.children;
      }
      return null;
    }
  };

  // packages/plugins/build-module/api/index.mjs
  var import_hooks = __toESM(require_hooks(), 1);

  // packages/icons/build-module/library/plugins.mjs
  var import_primitives = __toESM(require_primitives(), 1);
  var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
  var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.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" }) });

  // packages/plugins/build-module/api/index.mjs
  var plugins = {};
  function registerPlugin(name, settings) {
    if (typeof settings !== "object") {
      console.error("No settings object provided!");
      return null;
    }
    if (typeof name !== "string") {
      console.error("Plugin name must be string.");
      return null;
    }
    if (!/^[a-z][a-z0-9-]*$/.test(name)) {
      console.error(
        'Plugin name must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-plugin".'
      );
      return null;
    }
    if (plugins[name]) {
      console.error(`Plugin "${name}" is already registered.`);
    }
    settings = (0, import_hooks.applyFilters)(
      "plugins.registerPlugin",
      settings,
      name
    );
    const { render, scope } = settings;
    if (typeof render !== "function") {
      console.error(
        'The "render" property must be specified and must be a valid function.'
      );
      return null;
    }
    if (scope) {
      if (typeof scope !== "string") {
        console.error("Plugin scope must be string.");
        return null;
      }
      if (!/^[a-z][a-z0-9-]*$/.test(scope)) {
        console.error(
          'Plugin scope must include only lowercase alphanumeric characters or dashes, and start with a letter. Example: "my-page".'
        );
        return null;
      }
    }
    plugins[name] = {
      name,
      icon: plugins_default,
      ...settings
    };
    (0, import_hooks.doAction)("plugins.pluginRegistered", settings, name);
    return settings;
  }
  function unregisterPlugin(name) {
    if (!plugins[name]) {
      console.error('Plugin "' + name + '" is not registered.');
      return;
    }
    const oldPlugin = plugins[name];
    delete plugins[name];
    (0, import_hooks.doAction)("plugins.pluginUnregistered", oldPlugin, name);
    return oldPlugin;
  }
  function getPlugin(name) {
    return plugins[name];
  }
  function getPlugins(scope) {
    return Object.values(plugins).filter(
      (plugin) => plugin.scope === scope
    );
  }

  // packages/plugins/build-module/components/plugin-area/index.mjs
  var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
  var getPluginContext = memize(
    (icon, name) => ({
      icon,
      name
    })
  );
  function PluginArea({
    scope,
    onError
  }) {
    const store = (0, import_element3.useMemo)(() => {
      let lastValue = [];
      return {
        subscribe(listener) {
          (0, import_hooks2.addAction)(
            "plugins.pluginRegistered",
            "core/plugins/plugin-area/plugins-registered",
            listener
          );
          (0, import_hooks2.addAction)(
            "plugins.pluginUnregistered",
            "core/plugins/plugin-area/plugins-unregistered",
            listener
          );
          return () => {
            (0, import_hooks2.removeAction)(
              "plugins.pluginRegistered",
              "core/plugins/plugin-area/plugins-registered"
            );
            (0, import_hooks2.removeAction)(
              "plugins.pluginUnregistered",
              "core/plugins/plugin-area/plugins-unregistered"
            );
          };
        },
        getValue() {
          const nextValue = getPlugins(scope);
          if (!(0, import_is_shallow_equal.isShallowEqual)(lastValue, nextValue)) {
            lastValue = nextValue;
          }
          return lastValue;
        }
      };
    }, [scope]);
    const plugins2 = (0, import_element3.useSyncExternalStore)(
      store.subscribe,
      store.getValue,
      store.getValue
    );
    return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { style: { display: "none" }, children: plugins2.map(({ icon, name, render: Plugin }) => /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
      PluginContextProvider,
      {
        value: getPluginContext(icon, name),
        children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(PluginErrorBoundary, { name, onError, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(Plugin, {}) })
      },
      name
    )) });
  }
  var plugin_area_default = PluginArea;
  return __toCommonJS(index_exports);
})();

Directory Contents

Dirs: 3 × Files: 132

Name Size Perms Modified Actions
- drwxr-xr-x 2025-04-30 03:15:37
Edit Download
- drwxr-xr-x 2026-05-21 04:11:24
Edit Download
vendor DIR
- drwxr-xr-x 2026-05-21 04:11:25
Edit Download
5.45 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.41 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
15.13 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
5.58 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
17.46 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
6.29 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
9.73 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
5.47 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
48 B lrw-r--r-- 2026-05-21 04:11:24
Edit Download
40 B lrw-r--r-- 2026-05-21 04:11:25
Edit Download
2.30 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.13 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
55.67 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
21.92 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.70 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.01 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.57 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.09 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
6.54 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.36 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
50.48 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
10.34 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
381.06 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
180.58 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
151.71 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
63.10 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.83 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
786.24 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
80.84 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
28.21 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
28.68 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
11.83 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
612.03 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
210.43 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
91.57 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
36.58 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
4.13 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.74 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
82.78 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
25.88 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
176.34 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
141.18 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.04 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.25 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.47 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
783 B lrw-r--r-- 2026-05-21 04:11:24
Edit Download
34.61 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
12.62 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
117.40 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
49.07 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.69 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
684.42 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
160.25 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
61.83 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.50 MB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1,021.22 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
27.93 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
12.13 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.29 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.03 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
73.34 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
28.85 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
11.96 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
4.90 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.65 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
844 B lrw-r--r-- 2026-05-21 04:11:24
Edit Download
15.30 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
5.56 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.69 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.06 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
9.68 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.41 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
8.30 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.87 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
13.06 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
5.21 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
637.15 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
237.61 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
10.11 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
4.35 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
10.32 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.92 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
58.25 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
21.60 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
11.67 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
4.72 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
17.22 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
5.46 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
21.07 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
7.68 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
5.08 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.94 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
10.02 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.32 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
4.09 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.63 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.91 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.49 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
24.68 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
9.62 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
20.51 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
7.19 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
97.04 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
39.86 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
36.12 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
14.10 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
10.97 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.91 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
7.96 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
3.25 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
17.62 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
6.38 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
359.40 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
118.11 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
127.65 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
56.08 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
6.12 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.58 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
5.29 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.66 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
55.67 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
23.02 KB lrw-r--r-- 2026-05-21 04:11:25
Edit Download
23.39 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
10.09 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
6.61 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.21 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
1.52 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
720 B lrw-r--r-- 2026-05-21 04:11:24
Edit Download
50.08 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
20.79 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
6.93 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download
2.41 KB lrw-r--r-- 2026-05-21 04:11:24
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).