var __defProp = Object.defineProperty;
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
var __publicField = (obj, key, value) => {
  __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
  return value;
};
import { j as jsxRuntimeExports, r as reactExports, I as Icon, _ as _extends, g as getDefaultExportFromCjs, c as commonjsGlobal, u as useTranslation, R as RefIcon$3, a as ResourceMatcherValueType, C as Chip, b as RefIcon$4, d as ResourceProperty, e as card_default, f as card_header_default, h as radio_group_default, i as radio_default, k as card_body_default, B as Button, M as MatchResultType, l as execAll, T as Tooltip, m as input_default, s as splitPathIntoSegments, n as RefIcon$5, o as useUpdateEffect, p as Modal, q as useBakabaseContext, F as FileSystemEntryIcon, t as IconType, P as PopoverComponent, v as listbox_default, w as listbox_item_base_default, x as BusinessConstants, y as PropertySelector, z as PropertyPool, A as BApi, D as buildLayerBasedPathRegexString, E as badge_default, G as RefIcon$6, H as MdCheckCircle, J as React, K as useTraceUpdate, L as buildLogger, N as useUpdate, O as useTour, Q as useSortable, S as CSS, U as useSensors, V as useSensor, W as sortableKeyboardCoordinates, X as KeyboardSensor, Y as PointerSensor, Z as DndContext, $ as closestCenter, a0 as SortableContext, a1 as verticalListSortingStrategy, a2 as arrayMove, a3 as MediaPreviewer, a4 as serializeStandardValue, a5 as StandardValueType, a6 as PropertyType, a7 as SearchOperation, a8 as GroupCombinator, a9 as FilterDisplayMode, aa as Tabs, ab as Tab, ac as ResourceFilterController, ad as dayjs, ae as duration, af as propertyTypes, ag as ModalContent, ah as src_default, ai as FileNameModifierModal, aj as FolderSelector, ak as spinner_default, al as IwFsType, am as toast, an as MediaPlayer, ao as AfterFirstPlayOperationsModal, ap as AiOutlineWarning, aq as switch_default, ar as PathTree, as as PathMarkType, at as divider_default, au as Editor, av as BulkModificationProcessorValueType, aw as Editor$1, ax as Editor$2, ay as Editor$3, az as Editor$4, aA as Editor$5, aB as Editor$6, aC as Editor$7, aD as Editor$8, aE as getAvailableModesForPropertyType, aF as NullValueBehavior, aG as BriefProperty, aH as ComparisonMode, aI as RuleConfigPanel, aJ as PropertyPoolLabel, aK as PropertyTypeLabel, aL as getBizValueType, aM as getDbValueType, aN as PropertyValueRenderer, aO as ResourceStatus, aP as DataStatus, aQ as DataOrigin, aR as ResourceDataType, aS as useCoverResolution, aT as ResourceCoverMemo, aU as usePlayableItemResolution, aV as PlayControl, aW as ResourceAdditionalItem, aX as useUiOptionsStore, aY as QuickSetPropertyConfig, aZ as spacer_default, a_ as ErrorBoundary, a$ as List, b0 as ResourceTransferModal, b1 as useLocalStorage, b2 as button_default, b3 as ChevronRightIcon, b4 as FileSystemSelectorButton, b5 as Index, b6 as OrderSelector, b7 as Editor$9, b8 as DeprecatedChip, b9 as BetaChip, ba as PropertyMatcher } from "./index-gjctuIqV.js";
import { H as Hls } from "./hls-BVrUXCDN.js";
var ChevronLeftIcon = (props) => /* @__PURE__ */ jsxRuntimeExports.jsx(
  "svg",
  {
    "aria-hidden": "true",
    fill: "none",
    focusable: "false",
    height: "1em",
    role: "presentation",
    stroke: "currentColor",
    strokeLinecap: "round",
    strokeLinejoin: "round",
    strokeWidth: "1.5",
    viewBox: "0 0 24 24",
    width: "1em",
    ...props,
    children: /* @__PURE__ */ jsxRuntimeExports.jsx("path", { d: "m15 18-6-6 6-6" })
  }
);
var FieldBinaryOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M600 395.4h91V649h79V267c0-4.4-3.6-8-8-8h-48.2c-3.7 0-7 2.6-7.7 6.3-2.6 12.1-6.9 22.3-12.9 30.9a86.14 86.14 0 01-26.3 24.4c-10.3 6.2-22 10.5-35 12.9-10.4 1.9-21 3-32 3.1a8 8 0 00-7.9 8v42.8c0 4.4 3.6 8 8 8zM871 702H567c-4.4 0-8 3.6-8 8v48c0 4.4 3.6 8 8 8h304c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zM443.9 312.7c-16.1-19-34.4-32.4-55.2-40.4-21.3-8.2-44.1-12.3-68.4-12.3-23.9 0-46.4 4.1-67.7 12.3-20.8 8-39 21.4-54.8 40.3-15.9 19.1-28.7 44.7-38.3 77-9.6 32.5-14.5 73-14.5 121.5 0 49.9 4.9 91.4 14.5 124.4 9.6 32.8 22.4 58.7 38.3 77.7 15.8 18.9 34 32.3 54.8 40.3 21.3 8.2 43.8 12.3 67.7 12.3 24.4 0 47.2-4.1 68.4-12.3 20.8-8 39.2-21.4 55.2-40.4 16.1-19 29-44.9 38.6-77.7 9.6-33 14.5-74.5 14.5-124.4 0-48.4-4.9-88.9-14.5-121.5-9.5-32.1-22.4-57.7-38.6-76.8zm-29.5 251.7c-1 21.4-4.2 42-9.5 61.9-5.5 20.7-14.5 38.5-27 53.4-13.6 16.3-33.2 24.3-57.6 24.3-24 0-43.2-8.1-56.7-24.4-12.2-14.8-21.1-32.6-26.6-53.3-5.3-19.9-8.5-40.6-9.5-61.9-1-20.8-1.5-38.5-1.5-53.2 0-8.8.1-19.4.4-31.8.2-12.7 1.1-25.8 2.6-39.2 1.5-13.6 4-27.1 7.6-40.5 3.7-13.8 8.8-26.3 15.4-37.4 6.9-11.6 15.8-21.1 26.7-28.3 11.4-7.6 25.3-11.3 41.5-11.3 16.1 0 30.1 3.7 41.7 11.2a87.94 87.94 0 0127.4 28.2c6.9 11.2 12.1 23.8 15.6 37.7 3.3 13.2 5.8 26.6 7.5 40.1 1.8 13.5 2.8 26.6 3 39.4.2 12.4.4 23 .4 31.8.1 14.8-.4 32.5-1.4 53.3z" } }] }, "name": "field-binary", "theme": "outlined" };
var FieldBinaryOutlined = function FieldBinaryOutlined2(props, ref) {
  return /* @__PURE__ */ reactExports.createElement(Icon, _extends({}, props, {
    ref,
    icon: FieldBinaryOutlined$1
  }));
};
var RefIcon$2 = /* @__PURE__ */ reactExports.forwardRef(FieldBinaryOutlined);
var RetweetOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "0 0 1024 1024", "focusable": "false" }, "children": [{ "tag": "path", "attrs": { "d": "M136 552h63.6c4.4 0 8-3.6 8-8V288.7h528.6v72.6c0 1.9.6 3.7 1.8 5.2a8.3 8.3 0 0011.7 1.4L893 255.4c4.3-5 3.6-10.3 0-13.2L749.7 129.8a8.22 8.22 0 00-5.2-1.8c-4.6 0-8.4 3.8-8.4 8.4V209H199.7c-39.5 0-71.7 32.2-71.7 71.8V544c0 4.4 3.6 8 8 8zm752-80h-63.6c-4.4 0-8 3.6-8 8v255.3H287.8v-72.6c0-1.9-.6-3.7-1.8-5.2a8.3 8.3 0 00-11.7-1.4L131 768.6c-4.3 5-3.6 10.3 0 13.2l143.3 112.4c1.5 1.2 3.3 1.8 5.2 1.8 4.6 0 8.4-3.8 8.4-8.4V815h536.6c39.5 0 71.7-32.2 71.7-71.8V480c-.2-4.4-3.8-8-8.2-8z" } }] }, "name": "retweet", "theme": "outlined" };
var RetweetOutlined = function RetweetOutlined2(props, ref) {
  return /* @__PURE__ */ reactExports.createElement(Icon, _extends({}, props, {
    ref,
    icon: RetweetOutlined$1
  }));
};
var RefIcon$1 = /* @__PURE__ */ reactExports.forwardRef(RetweetOutlined);
var SisternodeOutlined$1 = { "icon": { "tag": "svg", "attrs": { "viewBox": "64 64 896 896", "focusable": "false" }, "children": [{ "tag": "defs", "attrs": {}, "children": [{ "tag": "style", "attrs": {} }] }, { "tag": "path", "attrs": { "d": "M672 432c-120.3 0-219.9 88.5-237.3 204H320c-15.5 0-28-12.5-28-28V244h291c14.2 35.2 48.7 60 89 60 53 0 96-43 96-96s-43-96-96-96c-40.3 0-74.8 24.8-89 60H112v72h108v364c0 55.2 44.8 100 100 100h114.7c17.4 115.5 117 204 237.3 204 132.5 0 240-107.5 240-240S804.5 432 672 432zm128 266c0 4.4-3.6 8-8 8h-86v86c0 4.4-3.6 8-8 8h-52c-4.4 0-8-3.6-8-8v-86h-86c-4.4 0-8-3.6-8-8v-52c0-4.4 3.6-8 8-8h86v-86c0-4.4 3.6-8 8-8h52c4.4 0 8 3.6 8 8v86h86c4.4 0 8 3.6 8 8v52z" } }] }, "name": "sisternode", "theme": "outlined" };
var SisternodeOutlined = function SisternodeOutlined2(props, ref) {
  return /* @__PURE__ */ reactExports.createElement(Icon, _extends({}, props, {
    ref,
    icon: SisternodeOutlined$1
  }));
};
var RefIcon = /* @__PURE__ */ reactExports.forwardRef(SisternodeOutlined);
var js_cookie = { exports: {} };
/*!
 * JavaScript Cookie v2.2.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */
(function(module, exports) {
  (function(factory) {
    var registeredInModuleLoader;
    {
      module.exports = factory();
      registeredInModuleLoader = true;
    }
    if (!registeredInModuleLoader) {
      var OldCookies = window.Cookies;
      var api = window.Cookies = factory();
      api.noConflict = function() {
        window.Cookies = OldCookies;
        return api;
      };
    }
  })(function() {
    function extend() {
      var i = 0;
      var result = {};
      for (; i < arguments.length; i++) {
        var attributes = arguments[i];
        for (var key in attributes) {
          result[key] = attributes[key];
        }
      }
      return result;
    }
    function decode(s) {
      return s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);
    }
    function init(converter) {
      function api() {
      }
      function set(key, value, attributes) {
        if (typeof document === "undefined") {
          return;
        }
        attributes = extend({
          path: "/"
        }, api.defaults, attributes);
        if (typeof attributes.expires === "number") {
          attributes.expires = new Date(/* @__PURE__ */ new Date() * 1 + attributes.expires * 864e5);
        }
        attributes.expires = attributes.expires ? attributes.expires.toUTCString() : "";
        try {
          var result = JSON.stringify(value);
          if (/^[\{\[]/.test(result)) {
            value = result;
          }
        } catch (e) {
        }
        value = converter.write ? converter.write(value, key) : encodeURIComponent(String(value)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);
        key = encodeURIComponent(String(key)).replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent).replace(/[\(\)]/g, escape);
        var stringifiedAttributes = "";
        for (var attributeName in attributes) {
          if (!attributes[attributeName]) {
            continue;
          }
          stringifiedAttributes += "; " + attributeName;
          if (attributes[attributeName] === true) {
            continue;
          }
          stringifiedAttributes += "=" + attributes[attributeName].split(";")[0];
        }
        return document.cookie = key + "=" + value + stringifiedAttributes;
      }
      function get(key, json) {
        if (typeof document === "undefined") {
          return;
        }
        var jar = {};
        var cookies = document.cookie ? document.cookie.split("; ") : [];
        var i = 0;
        for (; i < cookies.length; i++) {
          var parts = cookies[i].split("=");
          var cookie = parts.slice(1).join("=");
          if (!json && cookie.charAt(0) === '"') {
            cookie = cookie.slice(1, -1);
          }
          try {
            var name = decode(parts[0]);
            cookie = (converter.read || converter)(cookie, name) || decode(cookie);
            if (json) {
              try {
                cookie = JSON.parse(cookie);
              } catch (e) {
              }
            }
            jar[name] = cookie;
            if (key === name) {
              break;
            }
          } catch (e) {
          }
        }
        return key ? jar[key] : jar;
      }
      api.set = set;
      api.get = function(key) {
        return get(
          key,
          false
          /* read as raw */
        );
      };
      api.getJSON = function(key) {
        return get(
          key,
          true
          /* read as json */
        );
      };
      api.remove = function(key, attributes) {
        set(key, "", extend(attributes, {
          expires: -1
        }));
      };
      api.defaults = {};
      api.withConverter = init;
      return api;
    }
    return init(function() {
    });
  });
})(js_cookie);
var js_cookieExports = js_cookie.exports;
const Cookies = /* @__PURE__ */ getDefaultExportFromCjs(js_cookieExports);
var useCookie = function(cookieName) {
  var _a = reactExports.useState(function() {
    return Cookies.get(cookieName) || null;
  }), value = _a[0], setValue = _a[1];
  var updateCookie = reactExports.useCallback(function(newValue, options) {
    Cookies.set(cookieName, newValue, options);
    setValue(newValue);
  }, [cookieName]);
  var deleteCookie = reactExports.useCallback(function() {
    Cookies.remove(cookieName);
    setValue(null);
  }, [cookieName]);
  return [value, updateCookie, deleteCookie];
};
var main = { exports: {} };
(function(module, exports) {
  !function(e, t) {
    module.exports = t(reactExports);
  }(commonjsGlobal, function(e) {
    return function(e2) {
      var t = {};
      function n(a) {
        if (t[a])
          return t[a].exports;
        var r = t[a] = { i: a, l: false, exports: {} };
        return e2[a].call(r.exports, r, r.exports, n), r.l = true, r.exports;
      }
      return n.m = e2, n.c = t, n.d = function(e3, t2, a) {
        n.o(e3, t2) || Object.defineProperty(e3, t2, { enumerable: true, get: a });
      }, n.r = function(e3) {
        "undefined" != typeof Symbol && Symbol.toStringTag && Object.defineProperty(e3, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e3, "__esModule", { value: true });
      }, n.t = function(e3, t2) {
        if (1 & t2 && (e3 = n(e3)), 8 & t2)
          return e3;
        if (4 & t2 && "object" == typeof e3 && e3 && e3.__esModule)
          return e3;
        var a = /* @__PURE__ */ Object.create(null);
        if (n.r(a), Object.defineProperty(a, "default", { enumerable: true, value: e3 }), 2 & t2 && "string" != typeof e3)
          for (var r in e3)
            n.d(a, r, (function(t3) {
              return e3[t3];
            }).bind(null, r));
        return a;
      }, n.n = function(e3) {
        var t2 = e3 && e3.__esModule ? function() {
          return e3.default;
        } : function() {
          return e3;
        };
        return n.d(t2, "a", t2), t2;
      }, n.o = function(e3, t2) {
        return Object.prototype.hasOwnProperty.call(e3, t2);
      }, n.p = "", n(n.s = 48);
    }([function(t, n) {
      t.exports = e;
    }, function(e2, t) {
      var n = e2.exports = { version: "2.6.12" };
      "number" == typeof __e && (__e = n);
    }, function(e2, t, n) {
      var a = n(26)("wks"), r = n(17), o = n(3).Symbol, i = "function" == typeof o;
      (e2.exports = function(e3) {
        return a[e3] || (a[e3] = i && o[e3] || (i ? o : r)("Symbol." + e3));
      }).store = a;
    }, function(e2, t) {
      var n = e2.exports = "undefined" != typeof window && window.Math == Math ? window : "undefined" != typeof self && self.Math == Math ? self : Function("return this")();
      "number" == typeof __g && (__g = n);
    }, function(e2, t, n) {
      e2.exports = !n(8)(function() {
        return 7 != Object.defineProperty({}, "a", { get: function() {
          return 7;
        } }).a;
      });
    }, function(e2, t) {
      var n = {}.hasOwnProperty;
      e2.exports = function(e3, t2) {
        return n.call(e3, t2);
      };
    }, function(e2, t, n) {
      var a = n(7), r = n(16);
      e2.exports = n(4) ? function(e3, t2, n2) {
        return a.f(e3, t2, r(1, n2));
      } : function(e3, t2, n2) {
        return e3[t2] = n2, e3;
      };
    }, function(e2, t, n) {
      var a = n(10), r = n(35), o = n(23), i = Object.defineProperty;
      t.f = n(4) ? Object.defineProperty : function(e3, t2, n2) {
        if (a(e3), t2 = o(t2, true), a(n2), r)
          try {
            return i(e3, t2, n2);
          } catch (e4) {
          }
        if ("get" in n2 || "set" in n2)
          throw TypeError("Accessors not supported!");
        return "value" in n2 && (e3[t2] = n2.value), e3;
      };
    }, function(e2, t) {
      e2.exports = function(e3) {
        try {
          return !!e3();
        } catch (e4) {
          return true;
        }
      };
    }, function(e2, t, n) {
      var a = n(40), r = n(22);
      e2.exports = function(e3) {
        return a(r(e3));
      };
    }, function(e2, t, n) {
      var a = n(11);
      e2.exports = function(e3) {
        if (!a(e3))
          throw TypeError(e3 + " is not an object!");
        return e3;
      };
    }, function(e2, t) {
      e2.exports = function(e3) {
        return "object" == typeof e3 ? null !== e3 : "function" == typeof e3;
      };
    }, function(e2, t) {
      e2.exports = {};
    }, function(e2, t, n) {
      var a = n(39), r = n(27);
      e2.exports = Object.keys || function(e3) {
        return a(e3, r);
      };
    }, function(e2, t) {
      e2.exports = true;
    }, function(e2, t, n) {
      var a = n(3), r = n(1), o = n(53), i = n(6), s = n(5), c = function(e3, t2, n2) {
        var l, u, f, p = e3 & c.F, d = e3 & c.G, b = e3 & c.S, h = e3 & c.P, v = e3 & c.B, m = e3 & c.W, y = d ? r : r[t2] || (r[t2] = {}), g = y.prototype, E = d ? a : b ? a[t2] : (a[t2] || {}).prototype;
        for (l in d && (n2 = t2), n2)
          (u = !p && E && void 0 !== E[l]) && s(y, l) || (f = u ? E[l] : n2[l], y[l] = d && "function" != typeof E[l] ? n2[l] : v && u ? o(f, a) : m && E[l] == f ? function(e4) {
            var t3 = function(t4, n3, a2) {
              if (this instanceof e4) {
                switch (arguments.length) {
                  case 0:
                    return new e4();
                  case 1:
                    return new e4(t4);
                  case 2:
                    return new e4(t4, n3);
                }
                return new e4(t4, n3, a2);
              }
              return e4.apply(this, arguments);
            };
            return t3.prototype = e4.prototype, t3;
          }(f) : h && "function" == typeof f ? o(Function.call, f) : f, h && ((y.virtual || (y.virtual = {}))[l] = f, e3 & c.R && g && !g[l] && i(g, l, f)));
      };
      c.F = 1, c.G = 2, c.S = 4, c.P = 8, c.B = 16, c.W = 32, c.U = 64, c.R = 128, e2.exports = c;
    }, function(e2, t) {
      e2.exports = function(e3, t2) {
        return { enumerable: !(1 & e3), configurable: !(2 & e3), writable: !(4 & e3), value: t2 };
      };
    }, function(e2, t) {
      var n = 0, a = Math.random();
      e2.exports = function(e3) {
        return "Symbol(".concat(void 0 === e3 ? "" : e3, ")_", (++n + a).toString(36));
      };
    }, function(e2, t, n) {
      var a = n(22);
      e2.exports = function(e3) {
        return Object(a(e3));
      };
    }, function(e2, t) {
      t.f = {}.propertyIsEnumerable;
    }, function(e2, t, n) {
      var a = n(52)(true);
      n(34)(String, "String", function(e3) {
        this._t = String(e3), this._i = 0;
      }, function() {
        var e3, t2 = this._t, n2 = this._i;
        return n2 >= t2.length ? { value: void 0, done: true } : (e3 = a(t2, n2), this._i += e3.length, { value: e3, done: false });
      });
    }, function(e2, t) {
      var n = Math.ceil, a = Math.floor;
      e2.exports = function(e3) {
        return isNaN(e3 = +e3) ? 0 : (e3 > 0 ? a : n)(e3);
      };
    }, function(e2, t) {
      e2.exports = function(e3) {
        if (null == e3)
          throw TypeError("Can't call method on  " + e3);
        return e3;
      };
    }, function(e2, t, n) {
      var a = n(11);
      e2.exports = function(e3, t2) {
        if (!a(e3))
          return e3;
        var n2, r;
        if (t2 && "function" == typeof (n2 = e3.toString) && !a(r = n2.call(e3)))
          return r;
        if ("function" == typeof (n2 = e3.valueOf) && !a(r = n2.call(e3)))
          return r;
        if (!t2 && "function" == typeof (n2 = e3.toString) && !a(r = n2.call(e3)))
          return r;
        throw TypeError("Can't convert object to primitive value");
      };
    }, function(e2, t) {
      var n = {}.toString;
      e2.exports = function(e3) {
        return n.call(e3).slice(8, -1);
      };
    }, function(e2, t, n) {
      var a = n(26)("keys"), r = n(17);
      e2.exports = function(e3) {
        return a[e3] || (a[e3] = r(e3));
      };
    }, function(e2, t, n) {
      var a = n(1), r = n(3), o = r["__core-js_shared__"] || (r["__core-js_shared__"] = {});
      (e2.exports = function(e3, t2) {
        return o[e3] || (o[e3] = void 0 !== t2 ? t2 : {});
      })("versions", []).push({ version: a.version, mode: n(14) ? "pure" : "global", copyright: "© 2020 Denis Pushkarev (zloirock.ru)" });
    }, function(e2, t) {
      e2.exports = "constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",");
    }, function(e2, t, n) {
      var a = n(7).f, r = n(5), o = n(2)("toStringTag");
      e2.exports = function(e3, t2, n2) {
        e3 && !r(e3 = n2 ? e3 : e3.prototype, o) && a(e3, o, { configurable: true, value: t2 });
      };
    }, function(e2, t, n) {
      n(62);
      for (var a = n(3), r = n(6), o = n(12), i = n(2)("toStringTag"), s = "CSSRuleList,CSSStyleDeclaration,CSSValueList,ClientRectList,DOMRectList,DOMStringList,DOMTokenList,DataTransferItemList,FileList,HTMLAllCollection,HTMLCollection,HTMLFormElement,HTMLSelectElement,MediaList,MimeTypeArray,NamedNodeMap,NodeList,PaintRequestList,Plugin,PluginArray,SVGLengthList,SVGNumberList,SVGPathSegList,SVGPointList,SVGStringList,SVGTransformList,SourceBufferList,StyleSheetList,TextTrackCueList,TextTrackList,TouchList".split(","), c = 0; c < s.length; c++) {
        var l = s[c], u = a[l], f = u && u.prototype;
        f && !f[i] && r(f, i, l), o[l] = o.Array;
      }
    }, function(e2, t, n) {
      t.f = n(2);
    }, function(e2, t, n) {
      var a = n(3), r = n(1), o = n(14), i = n(30), s = n(7).f;
      e2.exports = function(e3) {
        var t2 = r.Symbol || (r.Symbol = o ? {} : a.Symbol || {});
        "_" == e3.charAt(0) || e3 in t2 || s(t2, e3, { value: i.f(e3) });
      };
    }, function(e2, t) {
      t.f = Object.getOwnPropertySymbols;
    }, function(e2, t) {
      e2.exports = function(e3, t2, n) {
        return Math.min(Math.max(e3, t2), n);
      };
    }, function(e2, t, n) {
      var a = n(14), r = n(15), o = n(37), i = n(6), s = n(12), c = n(55), l = n(28), u = n(61), f = n(2)("iterator"), p = !([].keys && "next" in [].keys()), d = function() {
        return this;
      };
      e2.exports = function(e3, t2, n2, b, h, v, m) {
        c(n2, t2, b);
        var y, g, E, j = function(e4) {
          if (!p && e4 in O)
            return O[e4];
          switch (e4) {
            case "keys":
            case "values":
              return function() {
                return new n2(this, e4);
              };
          }
          return function() {
            return new n2(this, e4);
          };
        }, x = t2 + " Iterator", _ = "values" == h, k = false, O = e3.prototype, C = O[f] || O["@@iterator"] || h && O[h], S = C || j(h), w = h ? _ ? j("entries") : S : void 0, A = "Array" == t2 && O.entries || C;
        if (A && (E = u(A.call(new e3()))) !== Object.prototype && E.next && (l(E, x, true), a || "function" == typeof E[f] || i(E, f, d)), _ && C && "values" !== C.name && (k = true, S = function() {
          return C.call(this);
        }), a && !m || !p && !k && O[f] || i(O, f, S), s[t2] = S, s[x] = d, h)
          if (y = { values: _ ? S : j("values"), keys: v ? S : j("keys"), entries: w }, m)
            for (g in y)
              g in O || o(O, g, y[g]);
          else
            r(r.P + r.F * (p || k), t2, y);
        return y;
      };
    }, function(e2, t, n) {
      e2.exports = !n(4) && !n(8)(function() {
        return 7 != Object.defineProperty(n(36)("div"), "a", { get: function() {
          return 7;
        } }).a;
      });
    }, function(e2, t, n) {
      var a = n(11), r = n(3).document, o = a(r) && a(r.createElement);
      e2.exports = function(e3) {
        return o ? r.createElement(e3) : {};
      };
    }, function(e2, t, n) {
      e2.exports = n(6);
    }, function(e2, t, n) {
      var a = n(10), r = n(56), o = n(27), i = n(25)("IE_PROTO"), s = function() {
      }, c = function() {
        var e3, t2 = n(36)("iframe"), a2 = o.length;
        for (t2.style.display = "none", n(60).appendChild(t2), t2.src = "javascript:", (e3 = t2.contentWindow.document).open(), e3.write("<script>document.F=Object<\/script>"), e3.close(), c = e3.F; a2--; )
          delete c.prototype[o[a2]];
        return c();
      };
      e2.exports = Object.create || function(e3, t2) {
        var n2;
        return null !== e3 ? (s.prototype = a(e3), n2 = new s(), s.prototype = null, n2[i] = e3) : n2 = c(), void 0 === t2 ? n2 : r(n2, t2);
      };
    }, function(e2, t, n) {
      var a = n(5), r = n(9), o = n(57)(false), i = n(25)("IE_PROTO");
      e2.exports = function(e3, t2) {
        var n2, s = r(e3), c = 0, l = [];
        for (n2 in s)
          n2 != i && a(s, n2) && l.push(n2);
        for (; t2.length > c; )
          a(s, n2 = t2[c++]) && (~o(l, n2) || l.push(n2));
        return l;
      };
    }, function(e2, t, n) {
      var a = n(24);
      e2.exports = Object("z").propertyIsEnumerable(0) ? Object : function(e3) {
        return "String" == a(e3) ? e3.split("") : Object(e3);
      };
    }, function(e2, t, n) {
      var a = n(39), r = n(27).concat("length", "prototype");
      t.f = Object.getOwnPropertyNames || function(e3) {
        return a(e3, r);
      };
    }, function(e2, t, n) {
      var a = n(24), r = n(2)("toStringTag"), o = "Arguments" == a(/* @__PURE__ */ function() {
        return arguments;
      }());
      e2.exports = function(e3) {
        var t2, n2, i;
        return void 0 === e3 ? "Undefined" : null === e3 ? "Null" : "string" == typeof (n2 = function(e4, t3) {
          try {
            return e4[t3];
          } catch (e5) {
          }
        }(t2 = Object(e3), r)) ? n2 : o ? a(t2) : "Object" == (i = a(t2)) && "function" == typeof t2.callee ? "Arguments" : i;
      };
    }, function(e2, t) {
      var n;
      n = /* @__PURE__ */ function() {
        return this;
      }();
      try {
        n = n || new Function("return this")();
      } catch (e3) {
        "object" == typeof window && (n = window);
      }
      e2.exports = n;
    }, function(e2, t) {
      var n = /-?\d+(\.\d+)?%?/g;
      e2.exports = function(e3) {
        return e3.match(n);
      };
    }, function(e2, t, n) {
      Object.defineProperty(t, "__esModule", { value: true }), t.getBase16Theme = t.createStyling = t.invertTheme = void 0;
      var a = d(n(49)), r = d(n(76)), o = d(n(81)), i = d(n(89)), s = d(n(93)), c = function(e3) {
        if (e3 && e3.__esModule)
          return e3;
        var t2 = {};
        if (null != e3)
          for (var n2 in e3)
            Object.prototype.hasOwnProperty.call(e3, n2) && (t2[n2] = e3[n2]);
        return t2.default = e3, t2;
      }(n(94)), l = d(n(132)), u = d(n(133)), f = d(n(138)), p = n(139);
      function d(e3) {
        return e3 && e3.__esModule ? e3 : { default: e3 };
      }
      var b = c.default, h = (0, i.default)(b), v = (0, f.default)(u.default, p.rgb2yuv, function(e3) {
        var t2, n2 = (0, o.default)(e3, 3), a2 = n2[0], r2 = n2[1], i2 = n2[2];
        return [(t2 = a2, t2 < 0.25 ? 1 : t2 < 0.5 ? 0.9 - t2 : 1.1 - t2), r2, i2];
      }, p.yuv2rgb, l.default), m = function(e3) {
        return function(t2) {
          return { className: [t2.className, e3.className].filter(Boolean).join(" "), style: (0, r.default)({}, t2.style || {}, e3.style || {}) };
        };
      }, y = function(e3, t2) {
        var n2 = (0, i.default)(t2);
        for (var o2 in e3)
          -1 === n2.indexOf(o2) && n2.push(o2);
        return n2.reduce(function(n3, o3) {
          return n3[o3] = function(e4, t3) {
            if (void 0 === e4)
              return t3;
            if (void 0 === t3)
              return e4;
            var n4 = void 0 === e4 ? "undefined" : (0, a.default)(e4), o4 = void 0 === t3 ? "undefined" : (0, a.default)(t3);
            switch (n4) {
              case "string":
                switch (o4) {
                  case "string":
                    return [t3, e4].filter(Boolean).join(" ");
                  case "object":
                    return m({ className: e4, style: t3 });
                  case "function":
                    return function(n5) {
                      for (var a2 = arguments.length, r2 = Array(a2 > 1 ? a2 - 1 : 0), o5 = 1; o5 < a2; o5++)
                        r2[o5 - 1] = arguments[o5];
                      return m({ className: e4 })(t3.apply(void 0, [n5].concat(r2)));
                    };
                }
              case "object":
                switch (o4) {
                  case "string":
                    return m({ className: t3, style: e4 });
                  case "object":
                    return (0, r.default)({}, t3, e4);
                  case "function":
                    return function(n5) {
                      for (var a2 = arguments.length, r2 = Array(a2 > 1 ? a2 - 1 : 0), o5 = 1; o5 < a2; o5++)
                        r2[o5 - 1] = arguments[o5];
                      return m({ style: e4 })(t3.apply(void 0, [n5].concat(r2)));
                    };
                }
              case "function":
                switch (o4) {
                  case "string":
                    return function(n5) {
                      for (var a2 = arguments.length, r2 = Array(a2 > 1 ? a2 - 1 : 0), o5 = 1; o5 < a2; o5++)
                        r2[o5 - 1] = arguments[o5];
                      return e4.apply(void 0, [m(n5)({ className: t3 })].concat(r2));
                    };
                  case "object":
                    return function(n5) {
                      for (var a2 = arguments.length, r2 = Array(a2 > 1 ? a2 - 1 : 0), o5 = 1; o5 < a2; o5++)
                        r2[o5 - 1] = arguments[o5];
                      return e4.apply(void 0, [m(n5)({ style: t3 })].concat(r2));
                    };
                  case "function":
                    return function(n5) {
                      for (var a2 = arguments.length, r2 = Array(a2 > 1 ? a2 - 1 : 0), o5 = 1; o5 < a2; o5++)
                        r2[o5 - 1] = arguments[o5];
                      return e4.apply(void 0, [t3.apply(void 0, [n5].concat(r2))].concat(r2));
                    };
                }
            }
          }(e3[o3], t2[o3]), n3;
        }, {});
      }, g = function(e3, t2) {
        for (var n2 = arguments.length, o2 = Array(n2 > 2 ? n2 - 2 : 0), s2 = 2; s2 < n2; s2++)
          o2[s2 - 2] = arguments[s2];
        if (null === t2)
          return e3;
        Array.isArray(t2) || (t2 = [t2]);
        var c2 = t2.map(function(t3) {
          return e3[t3];
        }).filter(Boolean), l2 = c2.reduce(function(e4, t3) {
          return "string" == typeof t3 ? e4.className = [e4.className, t3].filter(Boolean).join(" ") : "object" === (void 0 === t3 ? "undefined" : (0, a.default)(t3)) ? e4.style = (0, r.default)({}, e4.style, t3) : "function" == typeof t3 && (e4 = (0, r.default)({}, e4, t3.apply(void 0, [e4].concat(o2)))), e4;
        }, { className: "", style: {} });
        return l2.className || delete l2.className, 0 === (0, i.default)(l2.style).length && delete l2.style, l2;
      }, E = t.invertTheme = function(e3) {
        return (0, i.default)(e3).reduce(function(t2, n2) {
          return t2[n2] = /^base/.test(n2) ? v(e3[n2]) : "scheme" === n2 ? e3[n2] + ":inverted" : e3[n2], t2;
        }, {});
      }, j = (t.createStyling = (0, s.default)(function(e3) {
        for (var t2 = arguments.length, n2 = Array(t2 > 3 ? t2 - 3 : 0), a2 = 3; a2 < t2; a2++)
          n2[a2 - 3] = arguments[a2];
        var o2 = arguments.length > 1 && void 0 !== arguments[1] ? arguments[1] : {}, c2 = arguments.length > 2 && void 0 !== arguments[2] ? arguments[2] : {}, l2 = o2.defaultBase16, u2 = void 0 === l2 ? b : l2, f2 = o2.base16Themes, p2 = void 0 === f2 ? null : f2, d2 = j(c2, p2);
        d2 && (c2 = (0, r.default)({}, d2, c2));
        var v2 = h.reduce(function(e4, t3) {
          return e4[t3] = c2[t3] || u2[t3], e4;
        }, {}), m2 = (0, i.default)(c2).reduce(function(e4, t3) {
          return -1 === h.indexOf(t3) ? (e4[t3] = c2[t3], e4) : e4;
        }, {}), E2 = e3(v2), x = y(m2, E2);
        return (0, s.default)(g, 2).apply(void 0, [x].concat(n2));
      }, 3), t.getBase16Theme = function(e3, t2) {
        if (e3 && e3.extend && (e3 = e3.extend), "string" == typeof e3) {
          var n2 = e3.split(":"), a2 = (0, o.default)(n2, 2), r2 = a2[0], i2 = a2[1];
          e3 = (t2 || {})[r2] || c[r2], "inverted" === i2 && (e3 = E(e3));
        }
        return e3 && e3.hasOwnProperty("base00") ? e3 : void 0;
      });
    }, function(e2, t, n) {
      var a, r = "object" == typeof Reflect ? Reflect : null, o = r && "function" == typeof r.apply ? r.apply : function(e3, t2, n2) {
        return Function.prototype.apply.call(e3, t2, n2);
      };
      a = r && "function" == typeof r.ownKeys ? r.ownKeys : Object.getOwnPropertySymbols ? function(e3) {
        return Object.getOwnPropertyNames(e3).concat(Object.getOwnPropertySymbols(e3));
      } : function(e3) {
        return Object.getOwnPropertyNames(e3);
      };
      var i = Number.isNaN || function(e3) {
        return e3 != e3;
      };
      function s() {
        s.init.call(this);
      }
      e2.exports = s, e2.exports.once = function(e3, t2) {
        return new Promise(function(n2, a2) {
          function r2() {
            void 0 !== o2 && e3.removeListener("error", o2), n2([].slice.call(arguments));
          }
          var o2;
          "error" !== t2 && (o2 = function(n3) {
            e3.removeListener(t2, r2), a2(n3);
          }, e3.once("error", o2)), e3.once(t2, r2);
        });
      }, s.EventEmitter = s, s.prototype._events = void 0, s.prototype._eventsCount = 0, s.prototype._maxListeners = void 0;
      var c = 10;
      function l(e3) {
        if ("function" != typeof e3)
          throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof e3);
      }
      function u(e3) {
        return void 0 === e3._maxListeners ? s.defaultMaxListeners : e3._maxListeners;
      }
      function f(e3, t2, n2, a2) {
        var r2, o2, i2, s2;
        if (l(n2), void 0 === (o2 = e3._events) ? (o2 = e3._events = /* @__PURE__ */ Object.create(null), e3._eventsCount = 0) : (void 0 !== o2.newListener && (e3.emit("newListener", t2, n2.listener ? n2.listener : n2), o2 = e3._events), i2 = o2[t2]), void 0 === i2)
          i2 = o2[t2] = n2, ++e3._eventsCount;
        else if ("function" == typeof i2 ? i2 = o2[t2] = a2 ? [n2, i2] : [i2, n2] : a2 ? i2.unshift(n2) : i2.push(n2), (r2 = u(e3)) > 0 && i2.length > r2 && !i2.warned) {
          i2.warned = true;
          var c2 = new Error("Possible EventEmitter memory leak detected. " + i2.length + " " + String(t2) + " listeners added. Use emitter.setMaxListeners() to increase limit");
          c2.name = "MaxListenersExceededWarning", c2.emitter = e3, c2.type = t2, c2.count = i2.length, s2 = c2, console && console.warn && console.warn(s2);
        }
        return e3;
      }
      function p() {
        if (!this.fired)
          return this.target.removeListener(this.type, this.wrapFn), this.fired = true, 0 === arguments.length ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
      }
      function d(e3, t2, n2) {
        var a2 = { fired: false, wrapFn: void 0, target: e3, type: t2, listener: n2 }, r2 = p.bind(a2);
        return r2.listener = n2, a2.wrapFn = r2, r2;
      }
      function b(e3, t2, n2) {
        var a2 = e3._events;
        if (void 0 === a2)
          return [];
        var r2 = a2[t2];
        return void 0 === r2 ? [] : "function" == typeof r2 ? n2 ? [r2.listener || r2] : [r2] : n2 ? function(e4) {
          for (var t3 = new Array(e4.length), n3 = 0; n3 < t3.length; ++n3)
            t3[n3] = e4[n3].listener || e4[n3];
          return t3;
        }(r2) : v(r2, r2.length);
      }
      function h(e3) {
        var t2 = this._events;
        if (void 0 !== t2) {
          var n2 = t2[e3];
          if ("function" == typeof n2)
            return 1;
          if (void 0 !== n2)
            return n2.length;
        }
        return 0;
      }
      function v(e3, t2) {
        for (var n2 = new Array(t2), a2 = 0; a2 < t2; ++a2)
          n2[a2] = e3[a2];
        return n2;
      }
      Object.defineProperty(s, "defaultMaxListeners", { enumerable: true, get: function() {
        return c;
      }, set: function(e3) {
        if ("number" != typeof e3 || e3 < 0 || i(e3))
          throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + e3 + ".");
        c = e3;
      } }), s.init = function() {
        void 0 !== this._events && this._events !== Object.getPrototypeOf(this)._events || (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
      }, s.prototype.setMaxListeners = function(e3) {
        if ("number" != typeof e3 || e3 < 0 || i(e3))
          throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e3 + ".");
        return this._maxListeners = e3, this;
      }, s.prototype.getMaxListeners = function() {
        return u(this);
      }, s.prototype.emit = function(e3) {
        for (var t2 = [], n2 = 1; n2 < arguments.length; n2++)
          t2.push(arguments[n2]);
        var a2 = "error" === e3, r2 = this._events;
        if (void 0 !== r2)
          a2 = a2 && void 0 === r2.error;
        else if (!a2)
          return false;
        if (a2) {
          var i2;
          if (t2.length > 0 && (i2 = t2[0]), i2 instanceof Error)
            throw i2;
          var s2 = new Error("Unhandled error." + (i2 ? " (" + i2.message + ")" : ""));
          throw s2.context = i2, s2;
        }
        var c2 = r2[e3];
        if (void 0 === c2)
          return false;
        if ("function" == typeof c2)
          o(c2, this, t2);
        else {
          var l2 = c2.length, u2 = v(c2, l2);
          for (n2 = 0; n2 < l2; ++n2)
            o(u2[n2], this, t2);
        }
        return true;
      }, s.prototype.addListener = function(e3, t2) {
        return f(this, e3, t2, false);
      }, s.prototype.on = s.prototype.addListener, s.prototype.prependListener = function(e3, t2) {
        return f(this, e3, t2, true);
      }, s.prototype.once = function(e3, t2) {
        return l(t2), this.on(e3, d(this, e3, t2)), this;
      }, s.prototype.prependOnceListener = function(e3, t2) {
        return l(t2), this.prependListener(e3, d(this, e3, t2)), this;
      }, s.prototype.removeListener = function(e3, t2) {
        var n2, a2, r2, o2, i2;
        if (l(t2), void 0 === (a2 = this._events))
          return this;
        if (void 0 === (n2 = a2[e3]))
          return this;
        if (n2 === t2 || n2.listener === t2)
          0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : (delete a2[e3], a2.removeListener && this.emit("removeListener", e3, n2.listener || t2));
        else if ("function" != typeof n2) {
          for (r2 = -1, o2 = n2.length - 1; o2 >= 0; o2--)
            if (n2[o2] === t2 || n2[o2].listener === t2) {
              i2 = n2[o2].listener, r2 = o2;
              break;
            }
          if (r2 < 0)
            return this;
          0 === r2 ? n2.shift() : function(e4, t3) {
            for (; t3 + 1 < e4.length; t3++)
              e4[t3] = e4[t3 + 1];
            e4.pop();
          }(n2, r2), 1 === n2.length && (a2[e3] = n2[0]), void 0 !== a2.removeListener && this.emit("removeListener", e3, i2 || t2);
        }
        return this;
      }, s.prototype.off = s.prototype.removeListener, s.prototype.removeAllListeners = function(e3) {
        var t2, n2, a2;
        if (void 0 === (n2 = this._events))
          return this;
        if (void 0 === n2.removeListener)
          return 0 === arguments.length ? (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0) : void 0 !== n2[e3] && (0 == --this._eventsCount ? this._events = /* @__PURE__ */ Object.create(null) : delete n2[e3]), this;
        if (0 === arguments.length) {
          var r2, o2 = Object.keys(n2);
          for (a2 = 0; a2 < o2.length; ++a2)
            "removeListener" !== (r2 = o2[a2]) && this.removeAllListeners(r2);
          return this.removeAllListeners("removeListener"), this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0, this;
        }
        if ("function" == typeof (t2 = n2[e3]))
          this.removeListener(e3, t2);
        else if (void 0 !== t2)
          for (a2 = t2.length - 1; a2 >= 0; a2--)
            this.removeListener(e3, t2[a2]);
        return this;
      }, s.prototype.listeners = function(e3) {
        return b(this, e3, true);
      }, s.prototype.rawListeners = function(e3) {
        return b(this, e3, false);
      }, s.listenerCount = function(e3, t2) {
        return "function" == typeof e3.listenerCount ? e3.listenerCount(t2) : h.call(e3, t2);
      }, s.prototype.listenerCount = h, s.prototype.eventNames = function() {
        return this._eventsCount > 0 ? a(this._events) : [];
      };
    }, function(e2, t, n) {
      e2.exports.Dispatcher = n(140);
    }, function(e2, t, n) {
      e2.exports = n(142);
    }, function(e2, t, n) {
      t.__esModule = true;
      var a = i(n(50)), r = i(n(65)), o = "function" == typeof r.default && "symbol" == typeof a.default ? function(e3) {
        return typeof e3;
      } : function(e3) {
        return e3 && "function" == typeof r.default && e3.constructor === r.default && e3 !== r.default.prototype ? "symbol" : typeof e3;
      };
      function i(e3) {
        return e3 && e3.__esModule ? e3 : { default: e3 };
      }
      t.default = "function" == typeof r.default && "symbol" === o(a.default) ? function(e3) {
        return void 0 === e3 ? "undefined" : o(e3);
      } : function(e3) {
        return e3 && "function" == typeof r.default && e3.constructor === r.default && e3 !== r.default.prototype ? "symbol" : void 0 === e3 ? "undefined" : o(e3);
      };
    }, function(e2, t, n) {
      e2.exports = { default: n(51), __esModule: true };
    }, function(e2, t, n) {
      n(20), n(29), e2.exports = n(30).f("iterator");
    }, function(e2, t, n) {
      var a = n(21), r = n(22);
      e2.exports = function(e3) {
        return function(t2, n2) {
          var o, i, s = String(r(t2)), c = a(n2), l = s.length;
          return c < 0 || c >= l ? e3 ? "" : void 0 : (o = s.charCodeAt(c)) < 55296 || o > 56319 || c + 1 === l || (i = s.charCodeAt(c + 1)) < 56320 || i > 57343 ? e3 ? s.charAt(c) : o : e3 ? s.slice(c, c + 2) : i - 56320 + (o - 55296 << 10) + 65536;
        };
      };
    }, function(e2, t, n) {
      var a = n(54);
      e2.exports = function(e3, t2, n2) {
        if (a(e3), void 0 === t2)
          return e3;
        switch (n2) {
          case 1:
            return function(n3) {
              return e3.call(t2, n3);
            };
          case 2:
            return function(n3, a2) {
              return e3.call(t2, n3, a2);
            };
          case 3:
            return function(n3, a2, r) {
              return e3.call(t2, n3, a2, r);
            };
        }
        return function() {
          return e3.apply(t2, arguments);
        };
      };
    }, function(e2, t) {
      e2.exports = function(e3) {
        if ("function" != typeof e3)
          throw TypeError(e3 + " is not a function!");
        return e3;
      };
    }, function(e2, t, n) {
      var a = n(38), r = n(16), o = n(28), i = {};
      n(6)(i, n(2)("iterator"), function() {
        return this;
      }), e2.exports = function(e3, t2, n2) {
        e3.prototype = a(i, { next: r(1, n2) }), o(e3, t2 + " Iterator");
      };
    }, function(e2, t, n) {
      var a = n(7), r = n(10), o = n(13);
      e2.exports = n(4) ? Object.defineProperties : function(e3, t2) {
        r(e3);
        for (var n2, i = o(t2), s = i.length, c = 0; s > c; )
          a.f(e3, n2 = i[c++], t2[n2]);
        return e3;
      };
    }, function(e2, t, n) {
      var a = n(9), r = n(58), o = n(59);
      e2.exports = function(e3) {
        return function(t2, n2, i) {
          var s, c = a(t2), l = r(c.length), u = o(i, l);
          if (e3 && n2 != n2) {
            for (; l > u; )
              if ((s = c[u++]) != s)
                return true;
          } else
            for (; l > u; u++)
              if ((e3 || u in c) && c[u] === n2)
                return e3 || u || 0;
          return !e3 && -1;
        };
      };
    }, function(e2, t, n) {
      var a = n(21), r = Math.min;
      e2.exports = function(e3) {
        return e3 > 0 ? r(a(e3), 9007199254740991) : 0;
      };
    }, function(e2, t, n) {
      var a = n(21), r = Math.max, o = Math.min;
      e2.exports = function(e3, t2) {
        return (e3 = a(e3)) < 0 ? r(e3 + t2, 0) : o(e3, t2);
      };
    }, function(e2, t, n) {
      var a = n(3).document;
      e2.exports = a && a.documentElement;
    }, function(e2, t, n) {
      var a = n(5), r = n(18), o = n(25)("IE_PROTO"), i = Object.prototype;
      e2.exports = Object.getPrototypeOf || function(e3) {
        return e3 = r(e3), a(e3, o) ? e3[o] : "function" == typeof e3.constructor && e3 instanceof e3.constructor ? e3.constructor.prototype : e3 instanceof Object ? i : null;
      };
    }, function(e2, t, n) {
      var a = n(63), r = n(64), o = n(12), i = n(9);
      e2.exports = n(34)(Array, "Array", function(e3, t2) {
        this._t = i(e3), this._i = 0, this._k = t2;
      }, function() {
        var e3 = this._t, t2 = this._k, n2 = this._i++;
        return !e3 || n2 >= e3.length ? (this._t = void 0, r(1)) : r(0, "keys" == t2 ? n2 : "values" == t2 ? e3[n2] : [n2, e3[n2]]);
      }, "values"), o.Arguments = o.Array, a("keys"), a("values"), a("entries");
    }, function(e2, t) {
      e2.exports = function() {
      };
    }, function(e2, t) {
      e2.exports = function(e3, t2) {
        return { value: t2, done: !!e3 };
      };
    }, function(e2, t, n) {
      e2.exports = { default: n(66), __esModule: true };
    }, function(e2, t, n) {
      n(67), n(73), n(74), n(75), e2.exports = n(1).Symbol;
    }, function(e2, t, n) {
      var a = n(3), r = n(5), o = n(4), i = n(15), s = n(37), c = n(68).KEY, l = n(8), u = n(26), f = n(28), p = n(17), d = n(2), b = n(30), h = n(31), v = n(69), m = n(70), y = n(10), g = n(11), E = n(18), j = n(9), x = n(23), _ = n(16), k = n(38), O = n(71), C = n(72), S = n(32), w = n(7), A = n(13), M = C.f, P = w.f, F = O.f, D = a.Symbol, I = a.JSON, R = I && I.stringify, L = d("_hidden"), B = d("toPrimitive"), N = {}.propertyIsEnumerable, z = u("symbol-registry"), T = u("symbols"), q = u("op-symbols"), V = Object.prototype, K = "function" == typeof D && !!S.f, W = a.QObject, H = !W || !W.prototype || !W.prototype.findChild, U = o && l(function() {
        return 7 != k(P({}, "a", { get: function() {
          return P(this, "a", { value: 7 }).a;
        } })).a;
      }) ? function(e3, t2, n2) {
        var a2 = M(V, t2);
        a2 && delete V[t2], P(e3, t2, n2), a2 && e3 !== V && P(V, t2, a2);
      } : P, G = function(e3) {
        var t2 = T[e3] = k(D.prototype);
        return t2._k = e3, t2;
      }, J = K && "symbol" == typeof D.iterator ? function(e3) {
        return "symbol" == typeof e3;
      } : function(e3) {
        return e3 instanceof D;
      }, Y = function(e3, t2, n2) {
        return e3 === V && Y(q, t2, n2), y(e3), t2 = x(t2, true), y(n2), r(T, t2) ? (n2.enumerable ? (r(e3, L) && e3[L][t2] && (e3[L][t2] = false), n2 = k(n2, { enumerable: _(0, false) })) : (r(e3, L) || P(e3, L, _(1, {})), e3[L][t2] = true), U(e3, t2, n2)) : P(e3, t2, n2);
      }, $ = function(e3, t2) {
        y(e3);
        for (var n2, a2 = v(t2 = j(t2)), r2 = 0, o2 = a2.length; o2 > r2; )
          Y(e3, n2 = a2[r2++], t2[n2]);
        return e3;
      }, Q = function(e3) {
        var t2 = N.call(this, e3 = x(e3, true));
        return !(this === V && r(T, e3) && !r(q, e3)) && (!(t2 || !r(this, e3) || !r(T, e3) || r(this, L) && this[L][e3]) || t2);
      }, Z = function(e3, t2) {
        if (e3 = j(e3), t2 = x(t2, true), e3 !== V || !r(T, t2) || r(q, t2)) {
          var n2 = M(e3, t2);
          return !n2 || !r(T, t2) || r(e3, L) && e3[L][t2] || (n2.enumerable = true), n2;
        }
      }, X = function(e3) {
        for (var t2, n2 = F(j(e3)), a2 = [], o2 = 0; n2.length > o2; )
          r(T, t2 = n2[o2++]) || t2 == L || t2 == c || a2.push(t2);
        return a2;
      }, ee = function(e3) {
        for (var t2, n2 = e3 === V, a2 = F(n2 ? q : j(e3)), o2 = [], i2 = 0; a2.length > i2; )
          !r(T, t2 = a2[i2++]) || n2 && !r(V, t2) || o2.push(T[t2]);
        return o2;
      };
      K || (s((D = function() {
        if (this instanceof D)
          throw TypeError("Symbol is not a constructor!");
        var e3 = p(arguments.length > 0 ? arguments[0] : void 0), t2 = function(n2) {
          this === V && t2.call(q, n2), r(this, L) && r(this[L], e3) && (this[L][e3] = false), U(this, e3, _(1, n2));
        };
        return o && H && U(V, e3, { configurable: true, set: t2 }), G(e3);
      }).prototype, "toString", function() {
        return this._k;
      }), C.f = Z, w.f = Y, n(41).f = O.f = X, n(19).f = Q, S.f = ee, o && !n(14) && s(V, "propertyIsEnumerable", Q, true), b.f = function(e3) {
        return G(d(e3));
      }), i(i.G + i.W + i.F * !K, { Symbol: D });
      for (var te = "hasInstance,isConcatSpreadable,iterator,match,replace,search,species,split,toPrimitive,toStringTag,unscopables".split(","), ne = 0; te.length > ne; )
        d(te[ne++]);
      for (var ae = A(d.store), re = 0; ae.length > re; )
        h(ae[re++]);
      i(i.S + i.F * !K, "Symbol", { for: function(e3) {
        return r(z, e3 += "") ? z[e3] : z[e3] = D(e3);
      }, keyFor: function(e3) {
        if (!J(e3))
          throw TypeError(e3 + " is not a symbol!");
        for (var t2 in z)
          if (z[t2] === e3)
            return t2;
      }, useSetter: function() {
        H = true;
      }, useSimple: function() {
        H = false;
      } }), i(i.S + i.F * !K, "Object", { create: function(e3, t2) {
        return void 0 === t2 ? k(e3) : $(k(e3), t2);
      }, defineProperty: Y, defineProperties: $, getOwnPropertyDescriptor: Z, getOwnPropertyNames: X, getOwnPropertySymbols: ee });
      var oe = l(function() {
        S.f(1);
      });
      i(i.S + i.F * oe, "Object", { getOwnPropertySymbols: function(e3) {
        return S.f(E(e3));
      } }), I && i(i.S + i.F * (!K || l(function() {
        var e3 = D();
        return "[null]" != R([e3]) || "{}" != R({ a: e3 }) || "{}" != R(Object(e3));
      })), "JSON", { stringify: function(e3) {
        for (var t2, n2, a2 = [e3], r2 = 1; arguments.length > r2; )
          a2.push(arguments[r2++]);
        if (n2 = t2 = a2[1], (g(t2) || void 0 !== e3) && !J(e3))
          return m(t2) || (t2 = function(e4, t3) {
            if ("function" == typeof n2 && (t3 = n2.call(this, e4, t3)), !J(t3))
              return t3;
          }), a2[1] = t2, R.apply(I, a2);
      } }), D.prototype[B] || n(6)(D.prototype, B, D.prototype.valueOf), f(D, "Symbol"), f(Math, "Math", true), f(a.JSON, "JSON", true);
    }, function(e2, t, n) {
      var a = n(17)("meta"), r = n(11), o = n(5), i = n(7).f, s = 0, c = Object.isExtensible || function() {
        return true;
      }, l = !n(8)(function() {
        return c(Object.preventExtensions({}));
      }), u = function(e3) {
        i(e3, a, { value: { i: "O" + ++s, w: {} } });
      }, f = e2.exports = { KEY: a, NEED: false, fastKey: function(e3, t2) {
        if (!r(e3))
          return "symbol" == typeof e3 ? e3 : ("string" == typeof e3 ? "S" : "P") + e3;
        if (!o(e3, a)) {
          if (!c(e3))
            return "F";
          if (!t2)
            return "E";
          u(e3);
        }
        return e3[a].i;
      }, getWeak: function(e3, t2) {
        if (!o(e3, a)) {
          if (!c(e3))
            return true;
          if (!t2)
            return false;
          u(e3);
        }
        return e3[a].w;
      }, onFreeze: function(e3) {
        return l && f.NEED && c(e3) && !o(e3, a) && u(e3), e3;
      } };
    }, function(e2, t, n) {
      var a = n(13), r = n(32), o = n(19);
      e2.exports = function(e3) {
        var t2 = a(e3), n2 = r.f;
        if (n2)
          for (var i, s = n2(e3), c = o.f, l = 0; s.length > l; )
            c.call(e3, i = s[l++]) && t2.push(i);
        return t2;
      };
    }, function(e2, t, n) {
      var a = n(24);
      e2.exports = Array.isArray || function(e3) {
        return "Array" == a(e3);
      };
    }, function(e2, t, n) {
      var a = n(9), r = n(41).f, o = {}.toString, i = "object" == typeof window && window && Object.getOwnPropertyNames ? Object.getOwnPropertyNames(window) : [];
      e2.exports.f = function(e3) {
        return i && "[object Window]" == o.call(e3) ? function(e4) {
          try {
            return r(e4);
          } catch (e5) {
            return i.slice();
          }
        }(e3) : r(a(e3));
      };
    }, function(e2, t, n) {
      var a = n(19), r = n(16), o = n(9), i = n(23), s = n(5), c = n(35), l = Object.getOwnPropertyDescriptor;
      t.f = n(4) ? l : function(e3, t2) {
        if (e3 = o(e3), t2 = i(t2, true), c)
          try {
            return l(e3, t2);
          } catch (e4) {
          }
        if (s(e3, t2))
          return r(!a.f.call(e3, t2), e3[t2]);
      };
    }, function(e2, t) {
    }, function(e2, t, n) {
      n(31)("asyncIterator");
    }, function(e2, t, n) {
      n(31)("observable");
    }, function(e2, t, n) {
      t.__esModule = true;
      var a, r = n(77), o = (a = r) && a.__esModule ? a : { default: a };
      t.default = o.default || function(e3) {
        for (var t2 = 1; t2 < arguments.length; t2++) {
          var n2 = arguments[t2];
          for (var a2 in n2)
            Object.prototype.hasOwnProperty.call(n2, a2) && (e3[a2] = n2[a2]);
        }
        return e3;
      };
    }, function(e2, t, n) {
      e2.exports = { default: n(78), __esModule: true };
    }, function(e2, t, n) {
      n(79), e2.exports = n(1).Object.assign;
    }, function(e2, t, n) {
      var a = n(15);
      a(a.S + a.F, "Object", { assign: n(80) });
    }, function(e2, t, n) {
      var a = n(4), r = n(13), o = n(32), i = n(19), s = n(18), c = n(40), l = Object.assign;
      e2.exports = !l || n(8)(function() {
        var e3 = {}, t2 = {}, n2 = Symbol(), a2 = "abcdefghijklmnopqrst";
        return e3[n2] = 7, a2.split("").forEach(function(e4) {
          t2[e4] = e4;
        }), 7 != l({}, e3)[n2] || Object.keys(l({}, t2)).join("") != a2;
      }) ? function(e3, t2) {
        for (var n2 = s(e3), l2 = arguments.length, u = 1, f = o.f, p = i.f; l2 > u; )
          for (var d, b = c(arguments[u++]), h = f ? r(b).concat(f(b)) : r(b), v = h.length, m = 0; v > m; )
            d = h[m++], a && !p.call(b, d) || (n2[d] = b[d]);
        return n2;
      } : l;
    }, function(e2, t, n) {
      t.__esModule = true;
      var a = o(n(82)), r = o(n(85));
      function o(e3) {
        return e3 && e3.__esModule ? e3 : { default: e3 };
      }
      t.default = function(e3, t2) {
        if (Array.isArray(e3))
          return e3;
        if ((0, a.default)(Object(e3)))
          return function(e4, t3) {
            var n2 = [], a2 = true, o2 = false, i = void 0;
            try {
              for (var s, c = (0, r.default)(e4); !(a2 = (s = c.next()).done) && (n2.push(s.value), !t3 || n2.length !== t3); a2 = true)
                ;
            } catch (e5) {
              o2 = true, i = e5;
            } finally {
              try {
                !a2 && c.return && c.return();
              } finally {
                if (o2)
                  throw i;
              }
            }
            return n2;
          }(e3, t2);
        throw new TypeError("Invalid attempt to destructure non-iterable instance");
      };
    }, function(e2, t, n) {
      e2.exports = { default: n(83), __esModule: true };
    }, function(e2, t, n) {
      n(29), n(20), e2.exports = n(84);
    }, function(e2, t, n) {
      var a = n(42), r = n(2)("iterator"), o = n(12);
      e2.exports = n(1).isIterable = function(e3) {
        var t2 = Object(e3);
        return void 0 !== t2[r] || "@@iterator" in t2 || o.hasOwnProperty(a(t2));
      };
    }, function(e2, t, n) {
      e2.exports = { default: n(86), __esModule: true };
    }, function(e2, t, n) {
      n(29), n(20), e2.exports = n(87);
    }, function(e2, t, n) {
      var a = n(10), r = n(88);
      e2.exports = n(1).getIterator = function(e3) {
        var t2 = r(e3);
        if ("function" != typeof t2)
          throw TypeError(e3 + " is not iterable!");
        return a(t2.call(e3));
      };
    }, function(e2, t, n) {
      var a = n(42), r = n(2)("iterator"), o = n(12);
      e2.exports = n(1).getIteratorMethod = function(e3) {
        if (null != e3)
          return e3[r] || e3["@@iterator"] || o[a(e3)];
      };
    }, function(e2, t, n) {
      e2.exports = { default: n(90), __esModule: true };
    }, function(e2, t, n) {
      n(91), e2.exports = n(1).Object.keys;
    }, function(e2, t, n) {
      var a = n(18), r = n(13);
      n(92)("keys", function() {
        return function(e3) {
          return r(a(e3));
        };
      });
    }, function(e2, t, n) {
      var a = n(15), r = n(1), o = n(8);
      e2.exports = function(e3, t2) {
        var n2 = (r.Object || {})[e3] || Object[e3], i = {};
        i[e3] = t2(n2), a(a.S + a.F * o(function() {
          n2(1);
        }), "Object", i);
      };
    }, function(e2, t, n) {
      (function(t2) {
        var n2 = [["ary", 128], ["bind", 1], ["bindKey", 2], ["curry", 8], ["curryRight", 16], ["flip", 512], ["partial", 32], ["partialRight", 64], ["rearg", 256]], a = /^\s+|\s+$/g, r = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, o = /\{\n\/\* \[wrapped with (.+)\] \*/, i = /,? & /, s = /^[-+]0x[0-9a-f]+$/i, c = /^0b[01]+$/i, l = /^\[object .+?Constructor\]$/, u = /^0o[0-7]+$/i, f = /^(?:0|[1-9]\d*)$/, p = parseInt, d = "object" == typeof t2 && t2 && t2.Object === Object && t2, b = "object" == typeof self && self && self.Object === Object && self, h = d || b || Function("return this")();
        function v(e3, t3, n3) {
          switch (n3.length) {
            case 0:
              return e3.call(t3);
            case 1:
              return e3.call(t3, n3[0]);
            case 2:
              return e3.call(t3, n3[0], n3[1]);
            case 3:
              return e3.call(t3, n3[0], n3[1], n3[2]);
          }
          return e3.apply(t3, n3);
        }
        function m(e3, t3) {
          return !!(e3 ? e3.length : 0) && function(e4, t4, n3) {
            if (t4 != t4)
              return function(e5, t5, n4, a3) {
                var r3 = e5.length, o2 = n4 + -1;
                for (; ++o2 < r3; )
                  if (t5(e5[o2], o2, e5))
                    return o2;
                return -1;
              }(e4, y, n3);
            var a2 = n3 - 1, r2 = e4.length;
            for (; ++a2 < r2; )
              if (e4[a2] === t4)
                return a2;
            return -1;
          }(e3, t3, 0) > -1;
        }
        function y(e3) {
          return e3 != e3;
        }
        function g(e3, t3) {
          for (var n3 = e3.length, a2 = 0; n3--; )
            e3[n3] === t3 && a2++;
          return a2;
        }
        function E(e3, t3) {
          for (var n3 = -1, a2 = e3.length, r2 = 0, o2 = []; ++n3 < a2; ) {
            var i2 = e3[n3];
            i2 !== t3 && "__lodash_placeholder__" !== i2 || (e3[n3] = "__lodash_placeholder__", o2[r2++] = n3);
          }
          return o2;
        }
        var j, x, _, k = Function.prototype, O = Object.prototype, C = h["__core-js_shared__"], S = (j = /[^.]+$/.exec(C && C.keys && C.keys.IE_PROTO || "")) ? "Symbol(src)_1." + j : "", w = k.toString, A = O.hasOwnProperty, M = O.toString, P = RegExp("^" + w.call(A).replace(/[\\^$.*+?()[\]{}|]/g, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$"), F = Object.create, D = Math.max, I = Math.min, R = (x = H(Object, "defineProperty"), (_ = H.name) && _.length > 2 ? x : void 0);
        function L(e3) {
          return X(e3) ? F(e3) : {};
        }
        function B(e3) {
          return !(!X(e3) || function(e4) {
            return !!S && S in e4;
          }(e3)) && (function(e4) {
            var t3 = X(e4) ? M.call(e4) : "";
            return "[object Function]" == t3 || "[object GeneratorFunction]" == t3;
          }(e3) || function(e4) {
            var t3 = false;
            if (null != e4 && "function" != typeof e4.toString)
              try {
                t3 = !!(e4 + "");
              } catch (e5) {
              }
            return t3;
          }(e3) ? P : l).test(function(e4) {
            if (null != e4) {
              try {
                return w.call(e4);
              } catch (e5) {
              }
              try {
                return e4 + "";
              } catch (e5) {
              }
            }
            return "";
          }(e3));
        }
        function N(e3, t3, n3, a2) {
          for (var r2 = -1, o2 = e3.length, i2 = n3.length, s2 = -1, c2 = t3.length, l2 = D(o2 - i2, 0), u2 = Array(c2 + l2), f2 = !a2; ++s2 < c2; )
            u2[s2] = t3[s2];
          for (; ++r2 < i2; )
            (f2 || r2 < o2) && (u2[n3[r2]] = e3[r2]);
          for (; l2--; )
            u2[s2++] = e3[r2++];
          return u2;
        }
        function z(e3, t3, n3, a2) {
          for (var r2 = -1, o2 = e3.length, i2 = -1, s2 = n3.length, c2 = -1, l2 = t3.length, u2 = D(o2 - s2, 0), f2 = Array(u2 + l2), p2 = !a2; ++r2 < u2; )
            f2[r2] = e3[r2];
          for (var d2 = r2; ++c2 < l2; )
            f2[d2 + c2] = t3[c2];
          for (; ++i2 < s2; )
            (p2 || r2 < o2) && (f2[d2 + n3[i2]] = e3[r2++]);
          return f2;
        }
        function T(e3) {
          return function() {
            var t3 = arguments;
            switch (t3.length) {
              case 0:
                return new e3();
              case 1:
                return new e3(t3[0]);
              case 2:
                return new e3(t3[0], t3[1]);
              case 3:
                return new e3(t3[0], t3[1], t3[2]);
              case 4:
                return new e3(t3[0], t3[1], t3[2], t3[3]);
              case 5:
                return new e3(t3[0], t3[1], t3[2], t3[3], t3[4]);
              case 6:
                return new e3(t3[0], t3[1], t3[2], t3[3], t3[4], t3[5]);
              case 7:
                return new e3(t3[0], t3[1], t3[2], t3[3], t3[4], t3[5], t3[6]);
            }
            var n3 = L(e3.prototype), a2 = e3.apply(n3, t3);
            return X(a2) ? a2 : n3;
          };
        }
        function q(e3, t3, n3, a2, r2, o2, i2, s2, c2, l2) {
          var u2 = 128 & t3, f2 = 1 & t3, p2 = 2 & t3, d2 = 24 & t3, b2 = 512 & t3, v2 = p2 ? void 0 : T(e3);
          return function m2() {
            for (var y2 = arguments.length, j2 = Array(y2), x2 = y2; x2--; )
              j2[x2] = arguments[x2];
            if (d2)
              var _2 = W(m2), k2 = g(j2, _2);
            if (a2 && (j2 = N(j2, a2, r2, d2)), o2 && (j2 = z(j2, o2, i2, d2)), y2 -= k2, d2 && y2 < l2) {
              var O2 = E(j2, _2);
              return V(e3, t3, q, m2.placeholder, n3, j2, O2, s2, c2, l2 - y2);
            }
            var C2 = f2 ? n3 : this, S2 = p2 ? C2[e3] : e3;
            return y2 = j2.length, s2 ? j2 = Y(j2, s2) : b2 && y2 > 1 && j2.reverse(), u2 && c2 < y2 && (j2.length = c2), this && this !== h && this instanceof m2 && (S2 = v2 || T(S2)), S2.apply(C2, j2);
          };
        }
        function V(e3, t3, n3, a2, r2, o2, i2, s2, c2, l2) {
          var u2 = 8 & t3;
          t3 |= u2 ? 32 : 64, 4 & (t3 &= ~(u2 ? 64 : 32)) || (t3 &= -4);
          var f2 = n3(e3, t3, r2, u2 ? o2 : void 0, u2 ? i2 : void 0, u2 ? void 0 : o2, u2 ? void 0 : i2, s2, c2, l2);
          return f2.placeholder = a2, $(f2, e3, t3);
        }
        function K(e3, t3, n3, a2, r2, o2, i2, s2) {
          var c2 = 2 & t3;
          if (!c2 && "function" != typeof e3)
            throw new TypeError("Expected a function");
          var l2 = a2 ? a2.length : 0;
          if (l2 || (t3 &= -97, a2 = r2 = void 0), i2 = void 0 === i2 ? i2 : D(te(i2), 0), s2 = void 0 === s2 ? s2 : te(s2), l2 -= r2 ? r2.length : 0, 64 & t3) {
            var u2 = a2, f2 = r2;
            a2 = r2 = void 0;
          }
          var p2 = [e3, t3, n3, a2, r2, u2, f2, o2, i2, s2];
          if (e3 = p2[0], t3 = p2[1], n3 = p2[2], a2 = p2[3], r2 = p2[4], !(s2 = p2[9] = null == p2[9] ? c2 ? 0 : e3.length : D(p2[9] - l2, 0)) && 24 & t3 && (t3 &= -25), t3 && 1 != t3)
            d2 = 8 == t3 || 16 == t3 ? function(e4, t4, n4) {
              var a3 = T(e4);
              return function r3() {
                for (var o3 = arguments.length, i3 = Array(o3), s3 = o3, c3 = W(r3); s3--; )
                  i3[s3] = arguments[s3];
                var l3 = o3 < 3 && i3[0] !== c3 && i3[o3 - 1] !== c3 ? [] : E(i3, c3);
                if ((o3 -= l3.length) < n4)
                  return V(e4, t4, q, r3.placeholder, void 0, i3, l3, void 0, void 0, n4 - o3);
                var u3 = this && this !== h && this instanceof r3 ? a3 : e4;
                return v(u3, this, i3);
              };
            }(e3, t3, s2) : 32 != t3 && 33 != t3 || r2.length ? q.apply(void 0, p2) : function(e4, t4, n4, a3) {
              var r3 = 1 & t4, o3 = T(e4);
              return function t5() {
                for (var i3 = -1, s3 = arguments.length, c3 = -1, l3 = a3.length, u3 = Array(l3 + s3), f3 = this && this !== h && this instanceof t5 ? o3 : e4; ++c3 < l3; )
                  u3[c3] = a3[c3];
                for (; s3--; )
                  u3[c3++] = arguments[++i3];
                return v(f3, r3 ? n4 : this, u3);
              };
            }(e3, t3, n3, a2);
          else
            var d2 = function(e4, t4, n4) {
              var a3 = 1 & t4, r3 = T(e4);
              return function t5() {
                var o3 = this && this !== h && this instanceof t5 ? r3 : e4;
                return o3.apply(a3 ? n4 : this, arguments);
              };
            }(e3, t3, n3);
          return $(d2, e3, t3);
        }
        function W(e3) {
          return e3.placeholder;
        }
        function H(e3, t3) {
          var n3 = function(e4, t4) {
            return null == e4 ? void 0 : e4[t4];
          }(e3, t3);
          return B(n3) ? n3 : void 0;
        }
        function U(e3) {
          var t3 = e3.match(o);
          return t3 ? t3[1].split(i) : [];
        }
        function G(e3, t3) {
          var n3 = t3.length, a2 = n3 - 1;
          return t3[a2] = (n3 > 1 ? "& " : "") + t3[a2], t3 = t3.join(n3 > 2 ? ", " : " "), e3.replace(r, "{\n/* [wrapped with " + t3 + "] */\n");
        }
        function J(e3, t3) {
          return !!(t3 = null == t3 ? 9007199254740991 : t3) && ("number" == typeof e3 || f.test(e3)) && e3 > -1 && e3 % 1 == 0 && e3 < t3;
        }
        function Y(e3, t3) {
          for (var n3 = e3.length, a2 = I(t3.length, n3), r2 = function(e4, t4) {
            var n4 = -1, a3 = e4.length;
            for (t4 || (t4 = Array(a3)); ++n4 < a3; )
              t4[n4] = e4[n4];
            return t4;
          }(e3); a2--; ) {
            var o2 = t3[a2];
            e3[a2] = J(o2, n3) ? r2[o2] : void 0;
          }
          return e3;
        }
        var $ = R ? function(e3, t3, n3) {
          var a2, r2 = t3 + "";
          return R(e3, "toString", { configurable: true, enumerable: false, value: (a2 = G(r2, Q(U(r2), n3)), function() {
            return a2;
          }) });
        } : function(e3) {
          return e3;
        };
        function Q(e3, t3) {
          return function(e4, t4) {
            for (var n3 = -1, a2 = e4 ? e4.length : 0; ++n3 < a2 && false !== t4(e4[n3], n3, e4); )
              ;
          }(n2, function(n3) {
            var a2 = "_." + n3[0];
            t3 & n3[1] && !m(e3, a2) && e3.push(a2);
          }), e3.sort();
        }
        function Z(e3, t3, n3) {
          var a2 = K(e3, 8, void 0, void 0, void 0, void 0, void 0, t3 = n3 ? void 0 : t3);
          return a2.placeholder = Z.placeholder, a2;
        }
        function X(e3) {
          var t3 = typeof e3;
          return !!e3 && ("object" == t3 || "function" == t3);
        }
        function ee(e3) {
          return e3 ? (e3 = function(e4) {
            if ("number" == typeof e4)
              return e4;
            if (function(e5) {
              return "symbol" == typeof e5 || /* @__PURE__ */ function(e6) {
                return !!e6 && "object" == typeof e6;
              }(e5) && "[object Symbol]" == M.call(e5);
            }(e4))
              return NaN;
            if (X(e4)) {
              var t3 = "function" == typeof e4.valueOf ? e4.valueOf() : e4;
              e4 = X(t3) ? t3 + "" : t3;
            }
            if ("string" != typeof e4)
              return 0 === e4 ? e4 : +e4;
            e4 = e4.replace(a, "");
            var n3 = c.test(e4);
            return n3 || u.test(e4) ? p(e4.slice(2), n3 ? 2 : 8) : s.test(e4) ? NaN : +e4;
          }(e3)) === 1 / 0 || e3 === -1 / 0 ? 17976931348623157e292 * (e3 < 0 ? -1 : 1) : e3 == e3 ? e3 : 0 : 0 === e3 ? e3 : 0;
        }
        function te(e3) {
          var t3 = ee(e3), n3 = t3 % 1;
          return t3 == t3 ? n3 ? t3 - n3 : t3 : 0;
        }
        Z.placeholder = {}, e2.exports = Z;
      }).call(this, n(43));
    }, function(e2, t, n) {
      function a(e3) {
        return e3 && e3.__esModule ? e3.default : e3;
      }
      t.__esModule = true;
      var r = n(95);
      t.threezerotwofour = a(r);
      var o = n(96);
      t.apathy = a(o);
      var i = n(97);
      t.ashes = a(i);
      var s = n(98);
      t.atelierDune = a(s);
      var c = n(99);
      t.atelierForest = a(c);
      var l = n(100);
      t.atelierHeath = a(l);
      var u = n(101);
      t.atelierLakeside = a(u);
      var f = n(102);
      t.atelierSeaside = a(f);
      var p = n(103);
      t.bespin = a(p);
      var d = n(104);
      t.brewer = a(d);
      var b = n(105);
      t.bright = a(b);
      var h = n(106);
      t.chalk = a(h);
      var v = n(107);
      t.codeschool = a(v);
      var m = n(108);
      t.colors = a(m);
      var y = n(109);
      t.default = a(y);
      var g = n(110);
      t.eighties = a(g);
      var E = n(111);
      t.embers = a(E);
      var j = n(112);
      t.flat = a(j);
      var x = n(113);
      t.google = a(x);
      var _ = n(114);
      t.grayscale = a(_);
      var k = n(115);
      t.greenscreen = a(k);
      var O = n(116);
      t.harmonic = a(O);
      var C = n(117);
      t.hopscotch = a(C);
      var S = n(118);
      t.isotope = a(S);
      var w = n(119);
      t.marrakesh = a(w);
      var A = n(120);
      t.mocha = a(A);
      var M = n(121);
      t.monokai = a(M);
      var P = n(122);
      t.ocean = a(P);
      var F = n(123);
      t.paraiso = a(F);
      var D = n(124);
      t.pop = a(D);
      var I = n(125);
      t.railscasts = a(I);
      var R = n(126);
      t.shapeshifter = a(R);
      var L = n(127);
      t.solarized = a(L);
      var B = n(128);
      t.summerfruit = a(B);
      var N = n(129);
      t.tomorrow = a(N);
      var z = n(130);
      t.tube = a(z);
      var T = n(131);
      t.twilight = a(T);
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "threezerotwofour", author: "jan t. sott (http://github.com/idleberg)", base00: "#090300", base01: "#3a3432", base02: "#4a4543", base03: "#5c5855", base04: "#807d7c", base05: "#a5a2a2", base06: "#d6d5d4", base07: "#f7f7f7", base08: "#db2d20", base09: "#e8bbd0", base0A: "#fded02", base0B: "#01a252", base0C: "#b5e4f4", base0D: "#01a0e4", base0E: "#a16a94", base0F: "#cdab53" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "apathy", author: "jannik siebert (https://github.com/janniks)", base00: "#031A16", base01: "#0B342D", base02: "#184E45", base03: "#2B685E", base04: "#5F9C92", base05: "#81B5AC", base06: "#A7CEC8", base07: "#D2E7E4", base08: "#3E9688", base09: "#3E7996", base0A: "#3E4C96", base0B: "#883E96", base0C: "#963E4C", base0D: "#96883E", base0E: "#4C963E", base0F: "#3E965B" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "ashes", author: "jannik siebert (https://github.com/janniks)", base00: "#1C2023", base01: "#393F45", base02: "#565E65", base03: "#747C84", base04: "#ADB3BA", base05: "#C7CCD1", base06: "#DFE2E5", base07: "#F3F4F5", base08: "#C7AE95", base09: "#C7C795", base0A: "#AEC795", base0B: "#95C7AE", base0C: "#95AEC7", base0D: "#AE95C7", base0E: "#C795AE", base0F: "#C79595" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "atelier dune", author: "bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/dune)", base00: "#20201d", base01: "#292824", base02: "#6e6b5e", base03: "#7d7a68", base04: "#999580", base05: "#a6a28c", base06: "#e8e4cf", base07: "#fefbec", base08: "#d73737", base09: "#b65611", base0A: "#cfb017", base0B: "#60ac39", base0C: "#1fad83", base0D: "#6684e1", base0E: "#b854d4", base0F: "#d43552" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "atelier forest", author: "bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/forest)", base00: "#1b1918", base01: "#2c2421", base02: "#68615e", base03: "#766e6b", base04: "#9c9491", base05: "#a8a19f", base06: "#e6e2e0", base07: "#f1efee", base08: "#f22c40", base09: "#df5320", base0A: "#d5911a", base0B: "#5ab738", base0C: "#00ad9c", base0D: "#407ee7", base0E: "#6666ea", base0F: "#c33ff3" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "atelier heath", author: "bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/heath)", base00: "#1b181b", base01: "#292329", base02: "#695d69", base03: "#776977", base04: "#9e8f9e", base05: "#ab9bab", base06: "#d8cad8", base07: "#f7f3f7", base08: "#ca402b", base09: "#a65926", base0A: "#bb8a35", base0B: "#379a37", base0C: "#159393", base0D: "#516aec", base0E: "#7b59c0", base0F: "#cc33cc" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "atelier lakeside", author: "bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/lakeside/)", base00: "#161b1d", base01: "#1f292e", base02: "#516d7b", base03: "#5a7b8c", base04: "#7195a8", base05: "#7ea2b4", base06: "#c1e4f6", base07: "#ebf8ff", base08: "#d22d72", base09: "#935c25", base0A: "#8a8a0f", base0B: "#568c3b", base0C: "#2d8f6f", base0D: "#257fad", base0E: "#5d5db1", base0F: "#b72dd2" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "atelier seaside", author: "bram de haan (http://atelierbram.github.io/syntax-highlighting/atelier-schemes/seaside/)", base00: "#131513", base01: "#242924", base02: "#5e6e5e", base03: "#687d68", base04: "#809980", base05: "#8ca68c", base06: "#cfe8cf", base07: "#f0fff0", base08: "#e6193c", base09: "#87711d", base0A: "#c3c322", base0B: "#29a329", base0C: "#1999b3", base0D: "#3d62f5", base0E: "#ad2bee", base0F: "#e619c3" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "bespin", author: "jan t. sott", base00: "#28211c", base01: "#36312e", base02: "#5e5d5c", base03: "#666666", base04: "#797977", base05: "#8a8986", base06: "#9d9b97", base07: "#baae9e", base08: "#cf6a4c", base09: "#cf7d34", base0A: "#f9ee98", base0B: "#54be0d", base0C: "#afc4db", base0D: "#5ea6ea", base0E: "#9b859d", base0F: "#937121" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "brewer", author: "timothée poisot (http://github.com/tpoisot)", base00: "#0c0d0e", base01: "#2e2f30", base02: "#515253", base03: "#737475", base04: "#959697", base05: "#b7b8b9", base06: "#dadbdc", base07: "#fcfdfe", base08: "#e31a1c", base09: "#e6550d", base0A: "#dca060", base0B: "#31a354", base0C: "#80b1d3", base0D: "#3182bd", base0E: "#756bb1", base0F: "#b15928" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "bright", author: "chris kempson (http://chriskempson.com)", base00: "#000000", base01: "#303030", base02: "#505050", base03: "#b0b0b0", base04: "#d0d0d0", base05: "#e0e0e0", base06: "#f5f5f5", base07: "#ffffff", base08: "#fb0120", base09: "#fc6d24", base0A: "#fda331", base0B: "#a1c659", base0C: "#76c7b7", base0D: "#6fb3d2", base0E: "#d381c3", base0F: "#be643c" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "chalk", author: "chris kempson (http://chriskempson.com)", base00: "#151515", base01: "#202020", base02: "#303030", base03: "#505050", base04: "#b0b0b0", base05: "#d0d0d0", base06: "#e0e0e0", base07: "#f5f5f5", base08: "#fb9fb1", base09: "#eda987", base0A: "#ddb26f", base0B: "#acc267", base0C: "#12cfc0", base0D: "#6fc2ef", base0E: "#e1a3ee", base0F: "#deaf8f" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "codeschool", author: "brettof86", base00: "#232c31", base01: "#1c3657", base02: "#2a343a", base03: "#3f4944", base04: "#84898c", base05: "#9ea7a6", base06: "#a7cfa3", base07: "#b5d8f6", base08: "#2a5491", base09: "#43820d", base0A: "#a03b1e", base0B: "#237986", base0C: "#b02f30", base0D: "#484d79", base0E: "#c59820", base0F: "#c98344" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "colors", author: "mrmrs (http://clrs.cc)", base00: "#111111", base01: "#333333", base02: "#555555", base03: "#777777", base04: "#999999", base05: "#bbbbbb", base06: "#dddddd", base07: "#ffffff", base08: "#ff4136", base09: "#ff851b", base0A: "#ffdc00", base0B: "#2ecc40", base0C: "#7fdbff", base0D: "#0074d9", base0E: "#b10dc9", base0F: "#85144b" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "default", author: "chris kempson (http://chriskempson.com)", base00: "#181818", base01: "#282828", base02: "#383838", base03: "#585858", base04: "#b8b8b8", base05: "#d8d8d8", base06: "#e8e8e8", base07: "#f8f8f8", base08: "#ab4642", base09: "#dc9656", base0A: "#f7ca88", base0B: "#a1b56c", base0C: "#86c1b9", base0D: "#7cafc2", base0E: "#ba8baf", base0F: "#a16946" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "eighties", author: "chris kempson (http://chriskempson.com)", base00: "#2d2d2d", base01: "#393939", base02: "#515151", base03: "#747369", base04: "#a09f93", base05: "#d3d0c8", base06: "#e8e6df", base07: "#f2f0ec", base08: "#f2777a", base09: "#f99157", base0A: "#ffcc66", base0B: "#99cc99", base0C: "#66cccc", base0D: "#6699cc", base0E: "#cc99cc", base0F: "#d27b53" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "embers", author: "jannik siebert (https://github.com/janniks)", base00: "#16130F", base01: "#2C2620", base02: "#433B32", base03: "#5A5047", base04: "#8A8075", base05: "#A39A90", base06: "#BEB6AE", base07: "#DBD6D1", base08: "#826D57", base09: "#828257", base0A: "#6D8257", base0B: "#57826D", base0C: "#576D82", base0D: "#6D5782", base0E: "#82576D", base0F: "#825757" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "flat", author: "chris kempson (http://chriskempson.com)", base00: "#2C3E50", base01: "#34495E", base02: "#7F8C8D", base03: "#95A5A6", base04: "#BDC3C7", base05: "#e0e0e0", base06: "#f5f5f5", base07: "#ECF0F1", base08: "#E74C3C", base09: "#E67E22", base0A: "#F1C40F", base0B: "#2ECC71", base0C: "#1ABC9C", base0D: "#3498DB", base0E: "#9B59B6", base0F: "#be643c" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "google", author: "seth wright (http://sethawright.com)", base00: "#1d1f21", base01: "#282a2e", base02: "#373b41", base03: "#969896", base04: "#b4b7b4", base05: "#c5c8c6", base06: "#e0e0e0", base07: "#ffffff", base08: "#CC342B", base09: "#F96A38", base0A: "#FBA922", base0B: "#198844", base0C: "#3971ED", base0D: "#3971ED", base0E: "#A36AC7", base0F: "#3971ED" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "grayscale", author: "alexandre gavioli (https://github.com/alexx2/)", base00: "#101010", base01: "#252525", base02: "#464646", base03: "#525252", base04: "#ababab", base05: "#b9b9b9", base06: "#e3e3e3", base07: "#f7f7f7", base08: "#7c7c7c", base09: "#999999", base0A: "#a0a0a0", base0B: "#8e8e8e", base0C: "#868686", base0D: "#686868", base0E: "#747474", base0F: "#5e5e5e" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "green screen", author: "chris kempson (http://chriskempson.com)", base00: "#001100", base01: "#003300", base02: "#005500", base03: "#007700", base04: "#009900", base05: "#00bb00", base06: "#00dd00", base07: "#00ff00", base08: "#007700", base09: "#009900", base0A: "#007700", base0B: "#00bb00", base0C: "#005500", base0D: "#009900", base0E: "#00bb00", base0F: "#005500" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "harmonic16", author: "jannik siebert (https://github.com/janniks)", base00: "#0b1c2c", base01: "#223b54", base02: "#405c79", base03: "#627e99", base04: "#aabcce", base05: "#cbd6e2", base06: "#e5ebf1", base07: "#f7f9fb", base08: "#bf8b56", base09: "#bfbf56", base0A: "#8bbf56", base0B: "#56bf8b", base0C: "#568bbf", base0D: "#8b56bf", base0E: "#bf568b", base0F: "#bf5656" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "hopscotch", author: "jan t. sott", base00: "#322931", base01: "#433b42", base02: "#5c545b", base03: "#797379", base04: "#989498", base05: "#b9b5b8", base06: "#d5d3d5", base07: "#ffffff", base08: "#dd464c", base09: "#fd8b19", base0A: "#fdcc59", base0B: "#8fc13e", base0C: "#149b93", base0D: "#1290bf", base0E: "#c85e7c", base0F: "#b33508" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "isotope", author: "jan t. sott", base00: "#000000", base01: "#404040", base02: "#606060", base03: "#808080", base04: "#c0c0c0", base05: "#d0d0d0", base06: "#e0e0e0", base07: "#ffffff", base08: "#ff0000", base09: "#ff9900", base0A: "#ff0099", base0B: "#33ff00", base0C: "#00ffff", base0D: "#0066ff", base0E: "#cc00ff", base0F: "#3300ff" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "marrakesh", author: "alexandre gavioli (http://github.com/alexx2/)", base00: "#201602", base01: "#302e00", base02: "#5f5b17", base03: "#6c6823", base04: "#86813b", base05: "#948e48", base06: "#ccc37a", base07: "#faf0a5", base08: "#c35359", base09: "#b36144", base0A: "#a88339", base0B: "#18974e", base0C: "#75a738", base0D: "#477ca1", base0E: "#8868b3", base0F: "#b3588e" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "mocha", author: "chris kempson (http://chriskempson.com)", base00: "#3B3228", base01: "#534636", base02: "#645240", base03: "#7e705a", base04: "#b8afad", base05: "#d0c8c6", base06: "#e9e1dd", base07: "#f5eeeb", base08: "#cb6077", base09: "#d28b71", base0A: "#f4bc87", base0B: "#beb55b", base0C: "#7bbda4", base0D: "#8ab3b5", base0E: "#a89bb9", base0F: "#bb9584" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "monokai", author: "wimer hazenberg (http://www.monokai.nl)", base00: "#272822", base01: "#383830", base02: "#49483e", base03: "#75715e", base04: "#a59f85", base05: "#f8f8f2", base06: "#f5f4f1", base07: "#f9f8f5", base08: "#f92672", base09: "#fd971f", base0A: "#f4bf75", base0B: "#a6e22e", base0C: "#a1efe4", base0D: "#66d9ef", base0E: "#ae81ff", base0F: "#cc6633" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "ocean", author: "chris kempson (http://chriskempson.com)", base00: "#2b303b", base01: "#343d46", base02: "#4f5b66", base03: "#65737e", base04: "#a7adba", base05: "#c0c5ce", base06: "#dfe1e8", base07: "#eff1f5", base08: "#bf616a", base09: "#d08770", base0A: "#ebcb8b", base0B: "#a3be8c", base0C: "#96b5b4", base0D: "#8fa1b3", base0E: "#b48ead", base0F: "#ab7967" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "paraiso", author: "jan t. sott", base00: "#2f1e2e", base01: "#41323f", base02: "#4f424c", base03: "#776e71", base04: "#8d8687", base05: "#a39e9b", base06: "#b9b6b0", base07: "#e7e9db", base08: "#ef6155", base09: "#f99b15", base0A: "#fec418", base0B: "#48b685", base0C: "#5bc4bf", base0D: "#06b6ef", base0E: "#815ba4", base0F: "#e96ba8" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "pop", author: "chris kempson (http://chriskempson.com)", base00: "#000000", base01: "#202020", base02: "#303030", base03: "#505050", base04: "#b0b0b0", base05: "#d0d0d0", base06: "#e0e0e0", base07: "#ffffff", base08: "#eb008a", base09: "#f29333", base0A: "#f8ca12", base0B: "#37b349", base0C: "#00aabb", base0D: "#0e5a94", base0E: "#b31e8d", base0F: "#7a2d00" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "railscasts", author: "ryan bates (http://railscasts.com)", base00: "#2b2b2b", base01: "#272935", base02: "#3a4055", base03: "#5a647e", base04: "#d4cfc9", base05: "#e6e1dc", base06: "#f4f1ed", base07: "#f9f7f3", base08: "#da4939", base09: "#cc7833", base0A: "#ffc66d", base0B: "#a5c261", base0C: "#519f50", base0D: "#6d9cbe", base0E: "#b6b3eb", base0F: "#bc9458" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "shapeshifter", author: "tyler benziger (http://tybenz.com)", base00: "#000000", base01: "#040404", base02: "#102015", base03: "#343434", base04: "#555555", base05: "#ababab", base06: "#e0e0e0", base07: "#f9f9f9", base08: "#e92f2f", base09: "#e09448", base0A: "#dddd13", base0B: "#0ed839", base0C: "#23edda", base0D: "#3b48e3", base0E: "#f996e2", base0F: "#69542d" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "solarized", author: "ethan schoonover (http://ethanschoonover.com/solarized)", base00: "#002b36", base01: "#073642", base02: "#586e75", base03: "#657b83", base04: "#839496", base05: "#93a1a1", base06: "#eee8d5", base07: "#fdf6e3", base08: "#dc322f", base09: "#cb4b16", base0A: "#b58900", base0B: "#859900", base0C: "#2aa198", base0D: "#268bd2", base0E: "#6c71c4", base0F: "#d33682" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "summerfruit", author: "christopher corley (http://cscorley.github.io/)", base00: "#151515", base01: "#202020", base02: "#303030", base03: "#505050", base04: "#B0B0B0", base05: "#D0D0D0", base06: "#E0E0E0", base07: "#FFFFFF", base08: "#FF0086", base09: "#FD8900", base0A: "#ABA800", base0B: "#00C918", base0C: "#1faaaa", base0D: "#3777E6", base0E: "#AD00A1", base0F: "#cc6633" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "tomorrow", author: "chris kempson (http://chriskempson.com)", base00: "#1d1f21", base01: "#282a2e", base02: "#373b41", base03: "#969896", base04: "#b4b7b4", base05: "#c5c8c6", base06: "#e0e0e0", base07: "#ffffff", base08: "#cc6666", base09: "#de935f", base0A: "#f0c674", base0B: "#b5bd68", base0C: "#8abeb7", base0D: "#81a2be", base0E: "#b294bb", base0F: "#a3685a" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "london tube", author: "jan t. sott", base00: "#231f20", base01: "#1c3f95", base02: "#5a5758", base03: "#737171", base04: "#959ca1", base05: "#d9d8d8", base06: "#e7e7e8", base07: "#ffffff", base08: "#ee2e24", base09: "#f386a1", base0A: "#ffd204", base0B: "#00853e", base0C: "#85cebc", base0D: "#009ddc", base0E: "#98005d", base0F: "#b06110" }, e2.exports = t.default;
    }, function(e2, t, n) {
      t.__esModule = true, t.default = { scheme: "twilight", author: "david hart (http://hart-dev.com)", base00: "#1e1e1e", base01: "#323537", base02: "#464b50", base03: "#5f5a60", base04: "#838184", base05: "#a7a7a7", base06: "#c3c3c3", base07: "#ffffff", base08: "#cf6a4c", base09: "#cda869", base0A: "#f9ee98", base0B: "#8f9d6a", base0C: "#afc4db", base0D: "#7587a6", base0E: "#9b859d", base0F: "#9b703f" }, e2.exports = t.default;
    }, function(e2, t, n) {
      var a = n(33);
      function r(e3) {
        var t2 = Math.round(a(e3, 0, 255)).toString(16);
        return 1 == t2.length ? "0" + t2 : t2;
      }
      e2.exports = function(e3) {
        var t2 = 4 === e3.length ? r(255 * e3[3]) : "";
        return "#" + r(e3[0]) + r(e3[1]) + r(e3[2]) + t2;
      };
    }, function(e2, t, n) {
      var a = n(134), r = n(135), o = n(136), i = n(137);
      var s = { "#": r, hsl: function(e3) {
        var t2 = a(e3), n2 = i(t2);
        return 4 === t2.length && n2.push(t2[3]), n2;
      }, rgb: o };
      function c(e3) {
        for (var t2 in s)
          if (0 === e3.indexOf(t2))
            return s[t2](e3);
      }
      c.rgb = o, c.hsl = a, c.hex = r, e2.exports = c;
    }, function(e2, t, n) {
      var a = n(44), r = n(33);
      function o(e3, t2) {
        switch (e3 = parseFloat(e3), t2) {
          case 0:
            return r(e3, 0, 360);
          case 1:
          case 2:
            return r(e3, 0, 100);
          case 3:
            return r(e3, 0, 1);
        }
      }
      e2.exports = function(e3) {
        return a(e3).map(o);
      };
    }, function(e2, t) {
      e2.exports = function(e3) {
        4 !== e3.length && 5 !== e3.length || (e3 = function(e4) {
          for (var t3 = "#", n2 = 1; n2 < e4.length; n2++) {
            var a = e4.charAt(n2);
            t3 += a + a;
          }
          return t3;
        }(e3));
        var t2 = [parseInt(e3.substring(1, 3), 16), parseInt(e3.substring(3, 5), 16), parseInt(e3.substring(5, 7), 16)];
        if (9 === e3.length) {
          var n = parseFloat((parseInt(e3.substring(7, 9), 16) / 255).toFixed(2));
          t2.push(n);
        }
        return t2;
      };
    }, function(e2, t, n) {
      var a = n(44), r = n(33);
      function o(e3, t2) {
        return t2 < 3 ? -1 != e3.indexOf("%") ? Math.round(255 * r(parseInt(e3, 10), 0, 100) / 100) : r(parseInt(e3, 10), 0, 255) : r(parseFloat(e3), 0, 1);
      }
      e2.exports = function(e3) {
        return a(e3).map(o);
      };
    }, function(e2, t) {
      e2.exports = function(e3) {
        var t2, n, a, r, o, i = e3[0] / 360, s = e3[1] / 100, c = e3[2] / 100;
        if (0 == s)
          return [o = 255 * c, o, o];
        t2 = 2 * c - (n = c < 0.5 ? c * (1 + s) : c + s - c * s), r = [0, 0, 0];
        for (var l = 0; l < 3; l++)
          (a = i + 1 / 3 * -(l - 1)) < 0 && a++, a > 1 && a--, o = 6 * a < 1 ? t2 + 6 * (n - t2) * a : 2 * a < 1 ? n : 3 * a < 2 ? t2 + (n - t2) * (2 / 3 - a) * 6 : t2, r[l] = 255 * o;
        return r;
      };
    }, function(e2, t, n) {
      (function(t2) {
        var n2 = "object" == typeof t2 && t2 && t2.Object === Object && t2, a = "object" == typeof self && self && self.Object === Object && self, r = n2 || a || Function("return this")();
        function o(e3, t3, n3) {
          switch (n3.length) {
            case 0:
              return e3.call(t3);
            case 1:
              return e3.call(t3, n3[0]);
            case 2:
              return e3.call(t3, n3[0], n3[1]);
            case 3:
              return e3.call(t3, n3[0], n3[1], n3[2]);
          }
          return e3.apply(t3, n3);
        }
        function i(e3, t3) {
          for (var n3 = -1, a2 = t3.length, r2 = e3.length; ++n3 < a2; )
            e3[r2 + n3] = t3[n3];
          return e3;
        }
        var s = Object.prototype, c = s.hasOwnProperty, l = s.toString, u = r.Symbol, f = s.propertyIsEnumerable, p = u ? u.isConcatSpreadable : void 0, d = Math.max;
        function b(e3) {
          return h(e3) || function(e4) {
            return function(e5) {
              return /* @__PURE__ */ function(e6) {
                return !!e6 && "object" == typeof e6;
              }(e5) && function(e6) {
                return null != e6 && function(e7) {
                  return "number" == typeof e7 && e7 > -1 && e7 % 1 == 0 && e7 <= 9007199254740991;
                }(e6.length) && !function(e7) {
                  var t3 = function(e8) {
                    var t4 = typeof e8;
                    return !!e8 && ("object" == t4 || "function" == t4);
                  }(e7) ? l.call(e7) : "";
                  return "[object Function]" == t3 || "[object GeneratorFunction]" == t3;
                }(e6);
              }(e5);
            }(e4) && c.call(e4, "callee") && (!f.call(e4, "callee") || "[object Arguments]" == l.call(e4));
          }(e3) || !!(p && e3 && e3[p]);
        }
        var h = Array.isArray;
        var v, m, y, g = (m = function(e3) {
          var t3 = (e3 = function e4(t4, n4, a2, r2, o2) {
            var s2 = -1, c2 = t4.length;
            for (a2 || (a2 = b), o2 || (o2 = []); ++s2 < c2; ) {
              var l2 = t4[s2];
              a2(l2) ? i(o2, l2) : o2[o2.length] = l2;
            }
            return o2;
          }(e3)).length, n3 = t3;
          for (v; n3--; )
            if ("function" != typeof e3[n3])
              throw new TypeError("Expected a function");
          return function() {
            for (var n4 = 0, a2 = t3 ? e3[n4].apply(this, arguments) : arguments[0]; ++n4 < t3; )
              a2 = e3[n4].call(this, a2);
            return a2;
          };
        }, y = d(void 0 === y ? m.length - 1 : y, 0), function() {
          for (var e3 = arguments, t3 = -1, n3 = d(e3.length - y, 0), a2 = Array(n3); ++t3 < n3; )
            a2[t3] = e3[y + t3];
          t3 = -1;
          for (var r2 = Array(y + 1); ++t3 < y; )
            r2[t3] = e3[t3];
          return r2[y] = a2, o(m, this, r2);
        });
        e2.exports = g;
      }).call(this, n(43));
    }, function(e2, t, n) {
      Object.defineProperty(t, "__esModule", { value: true }), t.yuv2rgb = function(e3) {
        var t2, n2, a, r = e3[0], o = e3[1], i = e3[2];
        return t2 = 1 * r + 0 * o + 1.13983 * i, n2 = 1 * r + -0.39465 * o + -0.5806 * i, a = 1 * r + 2.02311 * o + 0 * i, t2 = Math.min(Math.max(0, t2), 1), n2 = Math.min(Math.max(0, n2), 1), a = Math.min(Math.max(0, a), 1), [255 * t2, 255 * n2, 255 * a];
      }, t.rgb2yuv = function(e3) {
        var t2 = e3[0] / 255, n2 = e3[1] / 255, a = e3[2] / 255;
        return [0.299 * t2 + 0.587 * n2 + 0.114 * a, -0.14713 * t2 + -0.28886 * n2 + 0.436 * a, 0.615 * t2 + -0.51499 * n2 + -0.10001 * a];
      };
    }, function(e2, t, n) {
      function a(e3, t2, n2) {
        return t2 in e3 ? Object.defineProperty(e3, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e3[t2] = n2, e3;
      }
      var r = n(141), o = function() {
        function e3() {
          a(this, "_callbacks", void 0), a(this, "_isDispatching", void 0), a(this, "_isHandled", void 0), a(this, "_isPending", void 0), a(this, "_lastID", void 0), a(this, "_pendingPayload", void 0), this._callbacks = {}, this._isDispatching = false, this._isHandled = {}, this._isPending = {}, this._lastID = 1;
        }
        var t2 = e3.prototype;
        return t2.register = function(e4) {
          var t3 = "ID_" + this._lastID++;
          return this._callbacks[t3] = e4, t3;
        }, t2.unregister = function(e4) {
          this._callbacks[e4] || r(false), delete this._callbacks[e4];
        }, t2.waitFor = function(e4) {
          this._isDispatching || r(false);
          for (var t3 = 0; t3 < e4.length; t3++) {
            var n2 = e4[t3];
            this._isPending[n2] ? this._isHandled[n2] || r(false) : (this._callbacks[n2] || r(false), this._invokeCallback(n2));
          }
        }, t2.dispatch = function(e4) {
          this._isDispatching && r(false), this._startDispatching(e4);
          try {
            for (var t3 in this._callbacks)
              this._isPending[t3] || this._invokeCallback(t3);
          } finally {
            this._stopDispatching();
          }
        }, t2.isDispatching = function() {
          return this._isDispatching;
        }, t2._invokeCallback = function(e4) {
          this._isPending[e4] = true, this._callbacks[e4](this._pendingPayload), this._isHandled[e4] = true;
        }, t2._startDispatching = function(e4) {
          for (var t3 in this._callbacks)
            this._isPending[t3] = false, this._isHandled[t3] = false;
          this._pendingPayload = e4, this._isDispatching = true;
        }, t2._stopDispatching = function() {
          delete this._pendingPayload, this._isDispatching = false;
        }, e3;
      }();
      e2.exports = o;
    }, function(e2, t, n) {
      e2.exports = function(e3, t2) {
        for (var n2 = arguments.length, r = new Array(n2 > 2 ? n2 - 2 : 0), o = 2; o < n2; o++)
          r[o - 2] = arguments[o];
        if (!e3) {
          var i;
          if (void 0 === t2)
            i = new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");
          else {
            var s = 0;
            (i = new Error(t2.replace(/%s/g, function() {
              return String(r[s++]);
            }))).name = "Invariant Violation";
          }
          throw i.framesToPop = 1, i;
        }
      };
    }, function(e2, t, n) {
      function a(e3, t2, n2) {
        return t2 in e3 ? Object.defineProperty(e3, t2, { value: n2, enumerable: true, configurable: true, writable: true }) : e3[t2] = n2, e3;
      }
      function r(e3, t2) {
        var n2 = Object.keys(e3);
        if (Object.getOwnPropertySymbols) {
          var a2 = Object.getOwnPropertySymbols(e3);
          t2 && (a2 = a2.filter(function(t3) {
            return Object.getOwnPropertyDescriptor(e3, t3).enumerable;
          })), n2.push.apply(n2, a2);
        }
        return n2;
      }
      function o(e3) {
        for (var t2 = 1; t2 < arguments.length; t2++) {
          var n2 = null != arguments[t2] ? arguments[t2] : {};
          t2 % 2 ? r(Object(n2), true).forEach(function(t3) {
            a(e3, t3, n2[t3]);
          }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e3, Object.getOwnPropertyDescriptors(n2)) : r(Object(n2)).forEach(function(t3) {
            Object.defineProperty(e3, t3, Object.getOwnPropertyDescriptor(n2, t3));
          });
        }
        return e3;
      }
      function i(e3, t2) {
        if (!(e3 instanceof t2))
          throw new TypeError("Cannot call a class as a function");
      }
      function s(e3, t2) {
        for (var n2 = 0; n2 < t2.length; n2++) {
          var a2 = t2[n2];
          a2.enumerable = a2.enumerable || false, a2.configurable = true, "value" in a2 && (a2.writable = true), Object.defineProperty(e3, a2.key, a2);
        }
      }
      function c(e3, t2, n2) {
        return t2 && s(e3.prototype, t2), n2 && s(e3, n2), e3;
      }
      function l(e3, t2) {
        return (l = Object.setPrototypeOf || function(e4, t3) {
          return e4.__proto__ = t3, e4;
        })(e3, t2);
      }
      function u(e3, t2) {
        if ("function" != typeof t2 && null !== t2)
          throw new TypeError("Super expression must either be null or a function");
        e3.prototype = Object.create(t2 && t2.prototype, { constructor: { value: e3, writable: true, configurable: true } }), t2 && l(e3, t2);
      }
      function f(e3) {
        return (f = Object.setPrototypeOf ? Object.getPrototypeOf : function(e4) {
          return e4.__proto__ || Object.getPrototypeOf(e4);
        })(e3);
      }
      function p(e3) {
        return (p = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(e4) {
          return typeof e4;
        } : function(e4) {
          return e4 && "function" == typeof Symbol && e4.constructor === Symbol && e4 !== Symbol.prototype ? "symbol" : typeof e4;
        })(e3);
      }
      function d(e3) {
        if (void 0 === e3)
          throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
        return e3;
      }
      function b(e3, t2) {
        return !t2 || "object" !== p(t2) && "function" != typeof t2 ? d(e3) : t2;
      }
      function h(e3) {
        var t2 = function() {
          if ("undefined" == typeof Reflect || !Reflect.construct)
            return false;
          if (Reflect.construct.sham)
            return false;
          if ("function" == typeof Proxy)
            return true;
          try {
            return Date.prototype.toString.call(Reflect.construct(Date, [], function() {
            })), true;
          } catch (e4) {
            return false;
          }
        }();
        return function() {
          var n2, a2 = f(e3);
          if (t2) {
            var r2 = f(this).constructor;
            n2 = Reflect.construct(a2, arguments, r2);
          } else
            n2 = a2.apply(this, arguments);
          return b(this, n2);
        };
      }
      n.r(t);
      var v = n(0), m = n.n(v);
      function y() {
        var e3 = this.constructor.getDerivedStateFromProps(this.props, this.state);
        null != e3 && this.setState(e3);
      }
      function g(e3) {
        this.setState((function(t2) {
          var n2 = this.constructor.getDerivedStateFromProps(e3, t2);
          return null != n2 ? n2 : null;
        }).bind(this));
      }
      function E(e3, t2) {
        try {
          var n2 = this.props, a2 = this.state;
          this.props = e3, this.state = t2, this.__reactInternalSnapshotFlag = true, this.__reactInternalSnapshot = this.getSnapshotBeforeUpdate(n2, a2);
        } finally {
          this.props = n2, this.state = a2;
        }
      }
      function j(e3) {
        var t2 = e3.prototype;
        if (!t2 || !t2.isReactComponent)
          throw new Error("Can only polyfill class components");
        if ("function" != typeof e3.getDerivedStateFromProps && "function" != typeof t2.getSnapshotBeforeUpdate)
          return e3;
        var n2 = null, a2 = null, r2 = null;
        if ("function" == typeof t2.componentWillMount ? n2 = "componentWillMount" : "function" == typeof t2.UNSAFE_componentWillMount && (n2 = "UNSAFE_componentWillMount"), "function" == typeof t2.componentWillReceiveProps ? a2 = "componentWillReceiveProps" : "function" == typeof t2.UNSAFE_componentWillReceiveProps && (a2 = "UNSAFE_componentWillReceiveProps"), "function" == typeof t2.componentWillUpdate ? r2 = "componentWillUpdate" : "function" == typeof t2.UNSAFE_componentWillUpdate && (r2 = "UNSAFE_componentWillUpdate"), null !== n2 || null !== a2 || null !== r2) {
          var o2 = e3.displayName || e3.name, i2 = "function" == typeof e3.getDerivedStateFromProps ? "getDerivedStateFromProps()" : "getSnapshotBeforeUpdate()";
          throw Error("Unsafe legacy lifecycles will not be called for components using new component APIs.\n\n" + o2 + " uses " + i2 + " but also contains the following legacy lifecycles:" + (null !== n2 ? "\n  " + n2 : "") + (null !== a2 ? "\n  " + a2 : "") + (null !== r2 ? "\n  " + r2 : "") + "\n\nThe above lifecycles should be removed. Learn more about this warning here:\nhttps://fb.me/react-async-component-lifecycle-hooks");
        }
        if ("function" == typeof e3.getDerivedStateFromProps && (t2.componentWillMount = y, t2.componentWillReceiveProps = g), "function" == typeof t2.getSnapshotBeforeUpdate) {
          if ("function" != typeof t2.componentDidUpdate)
            throw new Error("Cannot polyfill getSnapshotBeforeUpdate() for components that do not define componentDidUpdate() on the prototype");
          t2.componentWillUpdate = E;
          var s2 = t2.componentDidUpdate;
          t2.componentDidUpdate = function(e4, t3, n3) {
            var a3 = this.__reactInternalSnapshotFlag ? this.__reactInternalSnapshot : n3;
            s2.call(this, e4, t3, a3);
          };
        }
        return e3;
      }
      function x(e3, t2) {
        if (null == e3)
          return {};
        var n2, a2, r2 = function(e4, t3) {
          if (null == e4)
            return {};
          var n3, a3, r3 = {}, o3 = Object.keys(e4);
          for (a3 = 0; a3 < o3.length; a3++)
            n3 = o3[a3], t3.indexOf(n3) >= 0 || (r3[n3] = e4[n3]);
          return r3;
        }(e3, t2);
        if (Object.getOwnPropertySymbols) {
          var o2 = Object.getOwnPropertySymbols(e3);
          for (a2 = 0; a2 < o2.length; a2++)
            n2 = o2[a2], t2.indexOf(n2) >= 0 || Object.prototype.propertyIsEnumerable.call(e3, n2) && (r2[n2] = e3[n2]);
        }
        return r2;
      }
      function _(e3) {
        var t2 = function(e4) {
          return {}.toString.call(e4).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
        }(e3);
        return "number" === t2 && (t2 = isNaN(e3) ? "nan" : (0 | e3) != e3 ? "float" : "integer"), t2;
      }
      y.__suppressDeprecationWarning = true, g.__suppressDeprecationWarning = true, E.__suppressDeprecationWarning = true;
      var k = { scheme: "rjv-default", author: "mac gainor", base00: "rgba(0, 0, 0, 0)", base01: "rgb(245, 245, 245)", base02: "rgb(235, 235, 235)", base03: "#93a1a1", base04: "rgba(0, 0, 0, 0.3)", base05: "#586e75", base06: "#073642", base07: "#002b36", base08: "#d33682", base09: "#cb4b16", base0A: "#dc322f", base0B: "#859900", base0C: "#6c71c4", base0D: "#586e75", base0E: "#2aa198", base0F: "#268bd2" }, O = { scheme: "rjv-grey", author: "mac gainor", base00: "rgba(1, 1, 1, 0)", base01: "rgba(1, 1, 1, 0.1)", base02: "rgba(0, 0, 0, 0.2)", base03: "rgba(1, 1, 1, 0.3)", base04: "rgba(0, 0, 0, 0.4)", base05: "rgba(1, 1, 1, 0.5)", base06: "rgba(1, 1, 1, 0.6)", base07: "rgba(1, 1, 1, 0.7)", base08: "rgba(1, 1, 1, 0.8)", base09: "rgba(1, 1, 1, 0.8)", base0A: "rgba(1, 1, 1, 0.8)", base0B: "rgba(1, 1, 1, 0.8)", base0C: "rgba(1, 1, 1, 0.8)", base0D: "rgba(1, 1, 1, 0.8)", base0E: "rgba(1, 1, 1, 0.8)", base0F: "rgba(1, 1, 1, 0.8)" }, C = { globalFontFamily: "monospace", globalCursor: "default", braceFontWeight: "bold", braceCursor: "pointer", ellipsisFontSize: "18px", ellipsisLineHeight: "10px", ellipsisCursor: "pointer", keyMargin: "0px 5px", keyLetterSpacing: "0.5px", keyFontStyle: "none", keyVerticalAlign: "top", keyOpacity: "0.85", keyOpacityHover: "1", keyValPaddingTop: "3px", keyValPaddingBottom: "3px", keyValPaddingRight: "5px", keyValBorderLeft: "1px solid", keyValBorderHover: "2px solid", pushedContentMarginLeft: "6px", variableValuePaddingRight: "6px", nullFontSize: "11px", nullFontWeight: "bold", nullPadding: "1px 2px", nullBorderRadius: "3px", nanFontSize: "11px", nanFontWeight: "bold", nanPadding: "1px 2px", nanBorderRadius: "3px", undefinedFontSize: "11px", undefinedPadding: "1px 2px", undefinedBorderRadius: "3px", dataTypeFontSize: "11px", dataTypeMarginRight: "4px", datatypeOpacity: "0.8", objectSizeBorderRadius: "3px", objectSizeFontStyle: "italic", objectSizeMargin: "0px 6px 0px 0px", clipboardCursor: "pointer", clipboardCheckMarginLeft: "-12px", metaDataPadding: "0px 0px 0px 10px", arrayGroupMetaPadding: "0px 0px 0px 4px", iconContainerWidth: "17px", tooltipPadding: "4px", editInputMinWidth: "130px", editInputBorderRadius: "2px", editInputPadding: "5px", editInputMarginRight: "4px", editInputFontFamily: "monospace", iconCursor: "pointer", iconFontSize: "15px", iconPaddingRight: "1px", dateValueMarginLeft: "2px", iconMarginRight: "3px", detectedRowPaddingTop: "3px", addKeyCoverBackground: "rgba(255, 255, 255, 0.3)", addKeyCoverPosition: "absolute", addKeyCoverPositionPx: "0px", addKeyModalWidth: "200px", addKeyModalMargin: "auto", addKeyModalPadding: "10px", addKeyModalRadius: "3px" }, S = n(45), w = function(e3) {
        var t2 = function(e4) {
          return { backgroundColor: e4.base00, ellipsisColor: e4.base09, braceColor: e4.base07, expandedIcon: e4.base0D, collapsedIcon: e4.base0E, keyColor: e4.base07, arrayKeyColor: e4.base0C, objectSize: e4.base04, copyToClipboard: e4.base0F, copyToClipboardCheck: e4.base0D, objectBorder: e4.base02, dataTypes: { boolean: e4.base0E, date: e4.base0D, float: e4.base0B, function: e4.base0D, integer: e4.base0F, string: e4.base09, nan: e4.base08, null: e4.base0A, undefined: e4.base05, regexp: e4.base0A, background: e4.base02 }, editVariable: { editIcon: e4.base0E, cancelIcon: e4.base09, removeIcon: e4.base09, addIcon: e4.base0E, checkIcon: e4.base0E, background: e4.base01, color: e4.base0A, border: e4.base07 }, addKeyModal: { background: e4.base05, border: e4.base04, color: e4.base0A, labelColor: e4.base01 }, validationFailure: { background: e4.base09, iconColor: e4.base01, fontColor: e4.base01 } };
        }(e3);
        return { "app-container": { fontFamily: C.globalFontFamily, cursor: C.globalCursor, backgroundColor: t2.backgroundColor, position: "relative" }, ellipsis: { display: "inline-block", color: t2.ellipsisColor, fontSize: C.ellipsisFontSize, lineHeight: C.ellipsisLineHeight, cursor: C.ellipsisCursor }, "brace-row": { display: "inline-block", cursor: "pointer" }, brace: { display: "inline-block", cursor: C.braceCursor, fontWeight: C.braceFontWeight, color: t2.braceColor }, "expanded-icon": { color: t2.expandedIcon }, "collapsed-icon": { color: t2.collapsedIcon }, colon: { display: "inline-block", margin: C.keyMargin, color: t2.keyColor, verticalAlign: "top" }, objectKeyVal: function(e4, n2) {
          return { style: o({ paddingTop: C.keyValPaddingTop, paddingRight: C.keyValPaddingRight, paddingBottom: C.keyValPaddingBottom, borderLeft: C.keyValBorderLeft + " " + t2.objectBorder, ":hover": { paddingLeft: n2.paddingLeft - 1 + "px", borderLeft: C.keyValBorderHover + " " + t2.objectBorder } }, n2) };
        }, "object-key-val-no-border": { padding: C.keyValPadding }, "pushed-content": { marginLeft: C.pushedContentMarginLeft }, variableValue: function(e4, t3) {
          return { style: o({ display: "inline-block", paddingRight: C.variableValuePaddingRight, position: "relative" }, t3) };
        }, "object-name": { display: "inline-block", color: t2.keyColor, letterSpacing: C.keyLetterSpacing, fontStyle: C.keyFontStyle, verticalAlign: C.keyVerticalAlign, opacity: C.keyOpacity, ":hover": { opacity: C.keyOpacityHover } }, "array-key": { display: "inline-block", color: t2.arrayKeyColor, letterSpacing: C.keyLetterSpacing, fontStyle: C.keyFontStyle, verticalAlign: C.keyVerticalAlign, opacity: C.keyOpacity, ":hover": { opacity: C.keyOpacityHover } }, "object-size": { color: t2.objectSize, borderRadius: C.objectSizeBorderRadius, fontStyle: C.objectSizeFontStyle, margin: C.objectSizeMargin, cursor: "default" }, "data-type-label": { fontSize: C.dataTypeFontSize, marginRight: C.dataTypeMarginRight, opacity: C.datatypeOpacity }, boolean: { display: "inline-block", color: t2.dataTypes.boolean }, date: { display: "inline-block", color: t2.dataTypes.date }, "date-value": { marginLeft: C.dateValueMarginLeft }, float: { display: "inline-block", color: t2.dataTypes.float }, function: { display: "inline-block", color: t2.dataTypes.function, cursor: "pointer", whiteSpace: "pre-line" }, "function-value": { fontStyle: "italic" }, integer: { display: "inline-block", color: t2.dataTypes.integer }, string: { display: "inline-block", color: t2.dataTypes.string }, nan: { display: "inline-block", color: t2.dataTypes.nan, fontSize: C.nanFontSize, fontWeight: C.nanFontWeight, backgroundColor: t2.dataTypes.background, padding: C.nanPadding, borderRadius: C.nanBorderRadius }, null: { display: "inline-block", color: t2.dataTypes.null, fontSize: C.nullFontSize, fontWeight: C.nullFontWeight, backgroundColor: t2.dataTypes.background, padding: C.nullPadding, borderRadius: C.nullBorderRadius }, undefined: { display: "inline-block", color: t2.dataTypes.undefined, fontSize: C.undefinedFontSize, padding: C.undefinedPadding, borderRadius: C.undefinedBorderRadius, backgroundColor: t2.dataTypes.background }, regexp: { display: "inline-block", color: t2.dataTypes.regexp }, "copy-to-clipboard": { cursor: C.clipboardCursor }, "copy-icon": { color: t2.copyToClipboard, fontSize: C.iconFontSize, marginRight: C.iconMarginRight, verticalAlign: "top" }, "copy-icon-copied": { color: t2.copyToClipboardCheck, marginLeft: C.clipboardCheckMarginLeft }, "array-group-meta-data": { display: "inline-block", padding: C.arrayGroupMetaPadding }, "object-meta-data": { display: "inline-block", padding: C.metaDataPadding }, "icon-container": { display: "inline-block", width: C.iconContainerWidth }, tooltip: { padding: C.tooltipPadding }, removeVarIcon: { verticalAlign: "top", display: "inline-block", color: t2.editVariable.removeIcon, cursor: C.iconCursor, fontSize: C.iconFontSize, marginRight: C.iconMarginRight }, addVarIcon: { verticalAlign: "top", display: "inline-block", color: t2.editVariable.addIcon, cursor: C.iconCursor, fontSize: C.iconFontSize, marginRight: C.iconMarginRight }, editVarIcon: { verticalAlign: "top", display: "inline-block", color: t2.editVariable.editIcon, cursor: C.iconCursor, fontSize: C.iconFontSize, marginRight: C.iconMarginRight }, "edit-icon-container": { display: "inline-block", verticalAlign: "top" }, "check-icon": { display: "inline-block", cursor: C.iconCursor, color: t2.editVariable.checkIcon, fontSize: C.iconFontSize, paddingRight: C.iconPaddingRight }, "cancel-icon": { display: "inline-block", cursor: C.iconCursor, color: t2.editVariable.cancelIcon, fontSize: C.iconFontSize, paddingRight: C.iconPaddingRight }, "edit-input": { display: "inline-block", minWidth: C.editInputMinWidth, borderRadius: C.editInputBorderRadius, backgroundColor: t2.editVariable.background, color: t2.editVariable.color, padding: C.editInputPadding, marginRight: C.editInputMarginRight, fontFamily: C.editInputFontFamily }, "detected-row": { paddingTop: C.detectedRowPaddingTop }, "key-modal-request": { position: C.addKeyCoverPosition, top: C.addKeyCoverPositionPx, left: C.addKeyCoverPositionPx, right: C.addKeyCoverPositionPx, bottom: C.addKeyCoverPositionPx, backgroundColor: C.addKeyCoverBackground }, "key-modal": { width: C.addKeyModalWidth, backgroundColor: t2.addKeyModal.background, marginLeft: C.addKeyModalMargin, marginRight: C.addKeyModalMargin, padding: C.addKeyModalPadding, borderRadius: C.addKeyModalRadius, marginTop: "15px", position: "relative" }, "key-modal-label": { color: t2.addKeyModal.labelColor, marginLeft: "2px", marginBottom: "5px", fontSize: "11px" }, "key-modal-input-container": { overflow: "hidden" }, "key-modal-input": { width: "100%", padding: "3px 6px", fontFamily: "monospace", color: t2.addKeyModal.color, border: "none", boxSizing: "border-box", borderRadius: "2px" }, "key-modal-cancel": { backgroundColor: t2.editVariable.removeIcon, position: "absolute", top: "0px", right: "0px", borderRadius: "0px 3px 0px 3px", cursor: "pointer" }, "key-modal-cancel-icon": { color: t2.addKeyModal.labelColor, fontSize: C.iconFontSize, transform: "rotate(45deg)" }, "key-modal-submit": { color: t2.editVariable.addIcon, fontSize: C.iconFontSize, position: "absolute", right: "2px", top: "3px", cursor: "pointer" }, "function-ellipsis": { display: "inline-block", color: t2.ellipsisColor, fontSize: C.ellipsisFontSize, lineHeight: C.ellipsisLineHeight, cursor: C.ellipsisCursor }, "validation-failure": { float: "right", padding: "3px 6px", borderRadius: "2px", cursor: "pointer", color: t2.validationFailure.fontColor, backgroundColor: t2.validationFailure.background }, "validation-failure-label": { marginRight: "6px" }, "validation-failure-clear": { position: "relative", verticalAlign: "top", cursor: "pointer", color: t2.validationFailure.iconColor, fontSize: C.iconFontSize, transform: "rotate(45deg)" } };
      };
      function A(e3, t2, n2) {
        return e3 || console.error("theme has not been set"), function(e4) {
          var t3 = k;
          return false !== e4 && "none" !== e4 || (t3 = O), Object(S.createStyling)(w, { defaultBase16: t3 })(e4);
        }(e3)(t2, n2);
      }
      var M = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = (e4.rjvId, e4.type_name), n3 = e4.displayDataTypes, a2 = e4.theme;
          return n3 ? m.a.createElement("span", Object.assign({ className: "data-type-label" }, A(a2, "data-type-label")), t3) : null;
        } }]), n2;
      }(m.a.PureComponent), P = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props;
          return m.a.createElement("div", A(e4.theme, "boolean"), m.a.createElement(M, Object.assign({ type_name: "bool" }, e4)), e4.value ? "true" : "false");
        } }]), n2;
      }(m.a.PureComponent), F = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props;
          return m.a.createElement("div", A(e4.theme, "date"), m.a.createElement(M, Object.assign({ type_name: "date" }, e4)), m.a.createElement("span", Object.assign({ className: "date-value" }, A(e4.theme, "date-value")), e4.value.toLocaleTimeString("en-us", { weekday: "short", year: "numeric", month: "short", day: "numeric", hour: "2-digit", minute: "2-digit" })));
        } }]), n2;
      }(m.a.PureComponent), D = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props;
          return m.a.createElement("div", A(e4.theme, "float"), m.a.createElement(M, Object.assign({ type_name: "float" }, e4)), this.props.value);
        } }]), n2;
      }(m.a.PureComponent);
      function I(e3, t2) {
        (null == t2 || t2 > e3.length) && (t2 = e3.length);
        for (var n2 = 0, a2 = new Array(t2); n2 < t2; n2++)
          a2[n2] = e3[n2];
        return a2;
      }
      function R(e3, t2) {
        if (e3) {
          if ("string" == typeof e3)
            return I(e3, t2);
          var n2 = Object.prototype.toString.call(e3).slice(8, -1);
          return "Object" === n2 && e3.constructor && (n2 = e3.constructor.name), "Map" === n2 || "Set" === n2 ? Array.from(e3) : "Arguments" === n2 || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n2) ? I(e3, t2) : void 0;
        }
      }
      function L(e3, t2) {
        var n2;
        if ("undefined" == typeof Symbol || null == e3[Symbol.iterator]) {
          if (Array.isArray(e3) || (n2 = R(e3)) || t2) {
            n2 && (e3 = n2);
            var a2 = 0, r2 = function() {
            };
            return { s: r2, n: function() {
              return a2 >= e3.length ? { done: true } : { done: false, value: e3[a2++] };
            }, e: function(e4) {
              throw e4;
            }, f: r2 };
          }
          throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }
        var o2, i2 = true, s2 = false;
        return { s: function() {
          n2 = e3[Symbol.iterator]();
        }, n: function() {
          var e4 = n2.next();
          return i2 = e4.done, e4;
        }, e: function(e4) {
          s2 = true, o2 = e4;
        }, f: function() {
          try {
            i2 || null == n2.return || n2.return();
          } finally {
            if (s2)
              throw o2;
          }
        } };
      }
      function B(e3) {
        return function(e4) {
          if (Array.isArray(e4))
            return I(e4);
        }(e3) || function(e4) {
          if ("undefined" != typeof Symbol && Symbol.iterator in Object(e4))
            return Array.from(e4);
        }(e3) || R(e3) || function() {
          throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
        }();
      }
      var N = n(46), z = new (n(47)).Dispatcher(), T = new (function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          var e4;
          i(this, n2);
          for (var a2 = arguments.length, r2 = new Array(a2), s2 = 0; s2 < a2; s2++)
            r2[s2] = arguments[s2];
          return (e4 = t2.call.apply(t2, [this].concat(r2))).objects = {}, e4.set = function(t3, n3, a3, r3) {
            void 0 === e4.objects[t3] && (e4.objects[t3] = {}), void 0 === e4.objects[t3][n3] && (e4.objects[t3][n3] = {}), e4.objects[t3][n3][a3] = r3;
          }, e4.get = function(t3, n3, a3, r3) {
            return void 0 === e4.objects[t3] || void 0 === e4.objects[t3][n3] || null == e4.objects[t3][n3][a3] ? r3 : e4.objects[t3][n3][a3];
          }, e4.handleAction = function(t3) {
            var n3 = t3.rjvId, a3 = t3.data;
            switch (t3.name) {
              case "RESET":
                e4.emit("reset-" + n3);
                break;
              case "VARIABLE_UPDATED":
                t3.data.updated_src = e4.updateSrc(n3, a3), e4.set(n3, "action", "variable-update", o(o({}, a3), {}, { type: "variable-edited" })), e4.emit("variable-update-" + n3);
                break;
              case "VARIABLE_REMOVED":
                t3.data.updated_src = e4.updateSrc(n3, a3), e4.set(n3, "action", "variable-update", o(o({}, a3), {}, { type: "variable-removed" })), e4.emit("variable-update-" + n3);
                break;
              case "VARIABLE_ADDED":
                t3.data.updated_src = e4.updateSrc(n3, a3), e4.set(n3, "action", "variable-update", o(o({}, a3), {}, { type: "variable-added" })), e4.emit("variable-update-" + n3);
                break;
              case "ADD_VARIABLE_KEY_REQUEST":
                e4.set(n3, "action", "new-key-request", a3), e4.emit("add-key-request-" + n3);
            }
          }, e4.updateSrc = function(t3, n3) {
            var a3 = n3.name, r3 = n3.namespace, o2 = n3.new_value, i2 = (n3.existing_value, n3.variable_removed);
            r3.shift();
            var s3, c2 = e4.get(t3, "global", "src"), l2 = e4.deepCopy(c2, B(r3)), u2 = l2, f2 = L(r3);
            try {
              for (f2.s(); !(s3 = f2.n()).done; ) {
                u2 = u2[s3.value];
              }
            } catch (e5) {
              f2.e(e5);
            } finally {
              f2.f();
            }
            return i2 ? "array" == _(u2) ? u2.splice(a3, 1) : delete u2[a3] : null !== a3 ? u2[a3] = o2 : l2 = o2, e4.set(t3, "global", "src", l2), l2;
          }, e4.deepCopy = function(t3, n3) {
            var a3, r3 = _(t3), i2 = n3.shift();
            return "array" == r3 ? a3 = B(t3) : "object" == r3 && (a3 = o({}, t3)), void 0 !== i2 && (a3[i2] = e4.deepCopy(t3[i2], n3)), a3;
          }, e4;
        }
        return n2;
      }(N.EventEmitter))();
      z.register(T.handleAction.bind(T));
      var q = T, V = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).toggleCollapsed = function() {
            a2.setState({ collapsed: !a2.state.collapsed }, function() {
              q.set(a2.props.rjvId, a2.props.namespace, "collapsed", a2.state.collapsed);
            });
          }, a2.getFunctionDisplay = function(e5) {
            var t3 = d(a2).props;
            return e5 ? m.a.createElement("span", null, a2.props.value.toString().slice(9, -1).replace(/\{[\s\S]+/, ""), m.a.createElement("span", { className: "function-collapsed", style: { fontWeight: "bold" } }, m.a.createElement("span", null, "{"), m.a.createElement("span", A(t3.theme, "ellipsis"), "..."), m.a.createElement("span", null, "}"))) : a2.props.value.toString().slice(9, -1);
          }, a2.state = { collapsed: q.get(e4.rjvId, e4.namespace, "collapsed", true) }, a2;
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = this.state.collapsed;
          return m.a.createElement("div", A(e4.theme, "function"), m.a.createElement(M, Object.assign({ type_name: "function" }, e4)), m.a.createElement("span", Object.assign({}, A(e4.theme, "function-value"), { className: "rjv-function-container", onClick: this.toggleCollapsed }), this.getFunctionDisplay(t3)));
        } }]), n2;
      }(m.a.PureComponent), K = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          return m.a.createElement("div", A(this.props.theme, "nan"), "NaN");
        } }]), n2;
      }(m.a.PureComponent), W = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          return m.a.createElement("div", A(this.props.theme, "null"), "NULL");
        } }]), n2;
      }(m.a.PureComponent), H = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props;
          return m.a.createElement("div", A(e4.theme, "integer"), m.a.createElement(M, Object.assign({ type_name: "int" }, e4)), this.props.value);
        } }]), n2;
      }(m.a.PureComponent), U = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props;
          return m.a.createElement("div", A(e4.theme, "regexp"), m.a.createElement(M, Object.assign({ type_name: "regexp" }, e4)), this.props.value.toString());
        } }]), n2;
      }(m.a.PureComponent), G = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).toggleCollapsed = function() {
            a2.setState({ collapsed: !a2.state.collapsed }, function() {
              q.set(a2.props.rjvId, a2.props.namespace, "collapsed", a2.state.collapsed);
            });
          }, a2.state = { collapsed: q.get(e4.rjvId, e4.namespace, "collapsed", true) }, a2;
        }
        return c(n2, [{ key: "render", value: function() {
          this.state.collapsed;
          var e4 = this.props, t3 = e4.collapseStringsAfterLength, n3 = e4.theme, a2 = e4.value, r2 = { style: { cursor: "default" } };
          return "integer" === _(t3) && a2.length > t3 && (r2.style.cursor = "pointer", this.state.collapsed && (a2 = m.a.createElement("span", null, a2.substring(0, t3), m.a.createElement("span", A(n3, "ellipsis"), " ...")))), m.a.createElement("div", A(n3, "string"), m.a.createElement(M, Object.assign({ type_name: "string" }, e4)), m.a.createElement("span", Object.assign({ className: "string-value" }, r2, { onClick: this.toggleCollapsed }), '"', a2, '"'));
        } }]), n2;
      }(m.a.PureComponent), J = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          return m.a.createElement("div", A(this.props.theme, "undefined"), "undefined");
        } }]), n2;
      }(m.a.PureComponent);
      function Y() {
        return (Y = Object.assign || function(e3) {
          for (var t2 = 1; t2 < arguments.length; t2++) {
            var n2 = arguments[t2];
            for (var a2 in n2)
              Object.prototype.hasOwnProperty.call(n2, a2) && (e3[a2] = n2[a2]);
          }
          return e3;
        }).apply(this, arguments);
      }
      var $ = v.useLayoutEffect, Q = function(e3) {
        var t2 = Object(v.useRef)(e3);
        return $(function() {
          t2.current = e3;
        }), t2;
      }, Z = function(e3, t2) {
        "function" != typeof e3 ? e3.current = t2 : e3(t2);
      }, X = function(e3, t2) {
        var n2 = Object(v.useRef)();
        return Object(v.useCallback)(function(a2) {
          e3.current = a2, n2.current && Z(n2.current, null), n2.current = t2, t2 && Z(t2, a2);
        }, [t2]);
      }, ee = { "min-height": "0", "max-height": "none", height: "0", visibility: "hidden", overflow: "hidden", position: "absolute", "z-index": "-1000", top: "0", right: "0" }, te = function(e3) {
        Object.keys(ee).forEach(function(t2) {
          e3.style.setProperty(t2, ee[t2], "important");
        });
      }, ne = null;
      var ae = function() {
      }, re = ["borderBottomWidth", "borderLeftWidth", "borderRightWidth", "borderTopWidth", "boxSizing", "fontFamily", "fontSize", "fontStyle", "fontWeight", "letterSpacing", "lineHeight", "paddingBottom", "paddingLeft", "paddingRight", "paddingTop", "tabSize", "textIndent", "textRendering", "textTransform", "width"], oe = !!document.documentElement.currentStyle, ie = function(e3, t2) {
        var n2 = e3.cacheMeasurements, a2 = e3.maxRows, r2 = e3.minRows, o2 = e3.onChange, i2 = void 0 === o2 ? ae : o2, s2 = e3.onHeightChange, c2 = void 0 === s2 ? ae : s2, l2 = function(e4, t3) {
          if (null == e4)
            return {};
          var n3, a3, r3 = {}, o3 = Object.keys(e4);
          for (a3 = 0; a3 < o3.length; a3++)
            n3 = o3[a3], t3.indexOf(n3) >= 0 || (r3[n3] = e4[n3]);
          return r3;
        }(e3, ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"]);
        var u2, f2 = void 0 !== l2.value, p2 = Object(v.useRef)(null), d2 = X(p2, t2), b2 = Object(v.useRef)(0), h2 = Object(v.useRef)(), m2 = function() {
          var e4 = p2.current, t3 = n2 && h2.current ? h2.current : function(e5) {
            var t4 = window.getComputedStyle(e5);
            if (null === t4)
              return null;
            var n3, a3 = (n3 = t4, re.reduce(function(e6, t5) {
              return e6[t5] = n3[t5], e6;
            }, {})), r3 = a3.boxSizing;
            return "" === r3 ? null : (oe && "border-box" === r3 && (a3.width = parseFloat(a3.width) + parseFloat(a3.borderRightWidth) + parseFloat(a3.borderLeftWidth) + parseFloat(a3.paddingRight) + parseFloat(a3.paddingLeft) + "px"), { sizingStyle: a3, paddingSize: parseFloat(a3.paddingBottom) + parseFloat(a3.paddingTop), borderSize: parseFloat(a3.borderBottomWidth) + parseFloat(a3.borderTopWidth) });
          }(e4);
          if (t3) {
            h2.current = t3;
            var o3 = function(e5, t4, n3, a3) {
              void 0 === n3 && (n3 = 1), void 0 === a3 && (a3 = 1 / 0), ne || ((ne = document.createElement("textarea")).setAttribute("tab-index", "-1"), ne.setAttribute("aria-hidden", "true"), te(ne)), null === ne.parentNode && document.body.appendChild(ne);
              var r3 = e5.paddingSize, o4 = e5.borderSize, i4 = e5.sizingStyle, s4 = i4.boxSizing;
              Object.keys(i4).forEach(function(e6) {
                var t5 = e6;
                ne.style[t5] = i4[t5];
              }), te(ne), ne.value = t4;
              var c3 = function(e6, t5) {
                var n4 = e6.scrollHeight;
                return "border-box" === t5.sizingStyle.boxSizing ? n4 + t5.borderSize : n4 - t5.paddingSize;
              }(ne, e5);
              ne.value = "x";
              var l3 = ne.scrollHeight - r3, u3 = l3 * n3;
              "border-box" === s4 && (u3 = u3 + r3 + o4), c3 = Math.max(u3, c3);
              var f3 = l3 * a3;
              return "border-box" === s4 && (f3 = f3 + r3 + o4), [c3 = Math.min(f3, c3), l3];
            }(t3, e4.value || e4.placeholder || "x", r2, a2), i3 = o3[0], s3 = o3[1];
            b2.current !== i3 && (b2.current = i3, e4.style.setProperty("height", i3 + "px", "important"), c2(i3, { rowHeight: s3 }));
          }
        };
        return Object(v.useLayoutEffect)(m2), u2 = Q(m2), Object(v.useLayoutEffect)(function() {
          var e4 = function(e5) {
            u2.current(e5);
          };
          return window.addEventListener("resize", e4), function() {
            window.removeEventListener("resize", e4);
          };
        }, []), Object(v.createElement)("textarea", Y({}, l2, { onChange: function(e4) {
          f2 || m2(), i2(e4);
        }, ref: d2 }));
      }, se = Object(v.forwardRef)(ie);
      function ce(e3) {
        e3 = e3.trim();
        try {
          if ("[" === (e3 = JSON.stringify(JSON.parse(e3)))[0])
            return le("array", JSON.parse(e3));
          if ("{" === e3[0])
            return le("object", JSON.parse(e3));
          if (e3.match(/\-?\d+\.\d+/) && e3.match(/\-?\d+\.\d+/)[0] === e3)
            return le("float", parseFloat(e3));
          if (e3.match(/\-?\d+e-\d+/) && e3.match(/\-?\d+e-\d+/)[0] === e3)
            return le("float", Number(e3));
          if (e3.match(/\-?\d+/) && e3.match(/\-?\d+/)[0] === e3)
            return le("integer", parseInt(e3));
          if (e3.match(/\-?\d+e\+\d+/) && e3.match(/\-?\d+e\+\d+/)[0] === e3)
            return le("integer", Number(e3));
        } catch (e4) {
        }
        switch (e3 = e3.toLowerCase()) {
          case "undefined":
            return le("undefined", void 0);
          case "nan":
            return le("nan", NaN);
          case "null":
            return le("null", null);
          case "true":
            return le("boolean", true);
          case "false":
            return le("boolean", false);
          default:
            if (e3 = Date.parse(e3))
              return le("date", new Date(e3));
        }
        return le(false, null);
      }
      function le(e3, t2) {
        return { type: e3, value: t2 };
      }
      var ue = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 24 24", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("path", { d: "M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M7,13H17V11H7" })));
        } }]), n2;
      }(m.a.PureComponent), fe = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 24 24", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("path", { d: "M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20,12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10,10 0 0,0 12,2M13,7H11V11H7V13H11V17H13V13H17V11H13V7Z" })));
        } }]), n2;
      }(m.a.PureComponent), pe = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]), a2 = xe(t3).style;
          return m.a.createElement("span", n3, m.a.createElement("svg", { fill: a2.color, width: a2.height, height: a2.width, style: a2, viewBox: "0 0 1792 1792" }, m.a.createElement("path", { d: "M1344 800v64q0 14-9 23t-23 9h-832q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h832q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z" })));
        } }]), n2;
      }(m.a.PureComponent), de = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]), a2 = xe(t3).style;
          return m.a.createElement("span", n3, m.a.createElement("svg", { fill: a2.color, width: a2.height, height: a2.width, style: a2, viewBox: "0 0 1792 1792" }, m.a.createElement("path", { d: "M1344 800v64q0 14-9 23t-23 9h-352v352q0 14-9 23t-23 9h-64q-14 0-23-9t-9-23v-352h-352q-14 0-23-9t-9-23v-64q0-14 9-23t23-9h352v-352q0-14 9-23t23-9h64q14 0 23 9t9 23v352h352q14 0 23 9t9 23zm128 448v-832q0-66-47-113t-113-47h-832q-66 0-113 47t-47 113v832q0 66 47 113t113 47h832q66 0 113-47t47-113zm128-832v832q0 119-84.5 203.5t-203.5 84.5h-832q-119 0-203.5-84.5t-84.5-203.5v-832q0-119 84.5-203.5t203.5-84.5h832q119 0 203.5 84.5t84.5 203.5z" })));
        } }]), n2;
      }(m.a.PureComponent), be = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", { style: o(o({}, xe(t3).style), {}, { paddingLeft: "2px", verticalAlign: "top" }), viewBox: "0 0 15 15", fill: "currentColor" }, m.a.createElement("path", { d: "M0 14l6-6-6-6z" })));
        } }]), n2;
      }(m.a.PureComponent), he = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", { style: o(o({}, xe(t3).style), {}, { paddingLeft: "2px", verticalAlign: "top" }), viewBox: "0 0 15 15", fill: "currentColor" }, m.a.createElement("path", { d: "M0 5l6 6 6-6z" })));
        } }]), n2;
      }(m.a.PureComponent), ve = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 40 40", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("g", null, m.a.createElement("path", { d: "m30 35h-25v-22.5h25v7.5h2.5v-12.5c0-1.4-1.1-2.5-2.5-2.5h-7.5c0-2.8-2.2-5-5-5s-5 2.2-5 5h-7.5c-1.4 0-2.5 1.1-2.5 2.5v27.5c0 1.4 1.1 2.5 2.5 2.5h25c1.4 0 2.5-1.1 2.5-2.5v-5h-2.5v5z m-20-27.5h2.5s2.5-1.1 2.5-2.5 1.1-2.5 2.5-2.5 2.5 1.1 2.5 2.5 1.3 2.5 2.5 2.5h2.5s2.5 1.1 2.5 2.5h-20c0-1.5 1.1-2.5 2.5-2.5z m-2.5 20h5v-2.5h-5v2.5z m17.5-5v-5l-10 7.5 10 7.5v-5h12.5v-5h-12.5z m-17.5 10h7.5v-2.5h-7.5v2.5z m12.5-17.5h-12.5v2.5h12.5v-2.5z m-7.5 5h-5v2.5h5v-2.5z" }))));
        } }]), n2;
      }(m.a.PureComponent), me = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 40 40", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("g", null, m.a.createElement("path", { d: "m28.6 25q0-0.5-0.4-1l-4-4 4-4q0.4-0.5 0.4-1 0-0.6-0.4-1.1l-2-2q-0.4-0.4-1-0.4-0.6 0-1 0.4l-4.1 4.1-4-4.1q-0.4-0.4-1-0.4-0.6 0-1 0.4l-2 2q-0.5 0.5-0.5 1.1 0 0.5 0.5 1l4 4-4 4q-0.5 0.5-0.5 1 0 0.7 0.5 1.1l2 2q0.4 0.4 1 0.4 0.6 0 1-0.4l4-4.1 4.1 4.1q0.4 0.4 1 0.4 0.6 0 1-0.4l2-2q0.4-0.4 0.4-1z m8.7-5q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z" }))));
        } }]), n2;
      }(m.a.PureComponent), ye = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 40 40", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("g", null, m.a.createElement("path", { d: "m30.1 21.4v-2.8q0-0.6-0.4-1t-1-0.5h-5.7v-5.7q0-0.6-0.4-1t-1-0.4h-2.9q-0.6 0-1 0.4t-0.4 1v5.7h-5.7q-0.6 0-1 0.5t-0.5 1v2.8q0 0.6 0.5 1t1 0.5h5.7v5.7q0 0.5 0.4 1t1 0.4h2.9q0.6 0 1-0.4t0.4-1v-5.7h5.7q0.6 0 1-0.5t0.4-1z m7.2-1.4q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z" }))));
        } }]), n2;
      }(m.a.PureComponent), ge = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 40 40", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("g", null, m.a.createElement("path", { d: "m31.6 21.6h-10v10h-3.2v-10h-10v-3.2h10v-10h3.2v10h10v3.2z" }))));
        } }]), n2;
      }(m.a.PureComponent), Ee = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 40 40", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("g", null, m.a.createElement("path", { d: "m19.8 26.4l2.6-2.6-3.4-3.4-2.6 2.6v1.3h2.2v2.1h1.2z m9.8-16q-0.3-0.4-0.7 0l-7.8 7.8q-0.4 0.4 0 0.7t0.7 0l7.8-7.8q0.4-0.4 0-0.7z m1.8 13.2v4.3q0 2.6-1.9 4.5t-4.5 1.9h-18.6q-2.6 0-4.5-1.9t-1.9-4.5v-18.6q0-2.7 1.9-4.6t4.5-1.8h18.6q1.4 0 2.6 0.5 0.3 0.2 0.4 0.5 0.1 0.4-0.2 0.7l-1.1 1.1q-0.3 0.3-0.7 0.1-0.5-0.1-1-0.1h-18.6q-1.4 0-2.5 1.1t-1 2.5v18.6q0 1.4 1 2.5t2.5 1h18.6q1.5 0 2.5-1t1.1-2.5v-2.9q0-0.2 0.2-0.4l1.4-1.5q0.3-0.3 0.8-0.1t0.4 0.6z m-2.1-16.5l6.4 6.5-15 15h-6.4v-6.5z m9.9 3l-2.1 2-6.4-6.4 2.1-2q0.6-0.7 1.5-0.7t1.5 0.7l3.4 3.4q0.6 0.6 0.6 1.5t-0.6 1.5z" }))));
        } }]), n2;
      }(m.a.PureComponent), je = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.style, n3 = x(e4, ["style"]);
          return m.a.createElement("span", n3, m.a.createElement("svg", Object.assign({}, xe(t3), { viewBox: "0 0 40 40", fill: "currentColor", preserveAspectRatio: "xMidYMid meet" }), m.a.createElement("g", null, m.a.createElement("path", { d: "m31.7 16.4q0-0.6-0.4-1l-2.1-2.1q-0.4-0.4-1-0.4t-1 0.4l-9.1 9.1-5-5q-0.5-0.4-1-0.4t-1 0.4l-2.1 2q-0.4 0.4-0.4 1 0 0.6 0.4 1l8.1 8.1q0.4 0.4 1 0.4 0.6 0 1-0.4l12.2-12.1q0.4-0.4 0.4-1z m5.6 3.6q0 4.7-2.3 8.6t-6.3 6.2-8.6 2.3-8.6-2.3-6.2-6.2-2.3-8.6 2.3-8.6 6.2-6.2 8.6-2.3 8.6 2.3 6.3 6.2 2.3 8.6z" }))));
        } }]), n2;
      }(m.a.PureComponent);
      function xe(e3) {
        return e3 || (e3 = {}), { style: o(o({ verticalAlign: "middle" }, e3), {}, { color: e3.color ? e3.color : "#000000", height: "1em", width: "1em" }) };
      }
      var _e = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).copiedTimer = null, a2.handleCopy = function() {
            var e5 = document.createElement("textarea"), t3 = a2.props, n3 = t3.clickCallback, r2 = t3.src, o2 = t3.namespace;
            e5.innerHTML = JSON.stringify(a2.clipboardValue(r2), null, "  "), document.body.appendChild(e5), e5.select(), document.execCommand("copy"), document.body.removeChild(e5), a2.copiedTimer = setTimeout(function() {
              a2.setState({ copied: false });
            }, 5500), a2.setState({ copied: true }, function() {
              "function" == typeof n3 && n3({ src: r2, namespace: o2, name: o2[o2.length - 1] });
            });
          }, a2.getClippyIcon = function() {
            var e5 = a2.props.theme;
            return a2.state.copied ? m.a.createElement("span", null, m.a.createElement(ve, Object.assign({ className: "copy-icon" }, A(e5, "copy-icon"))), m.a.createElement("span", A(e5, "copy-icon-copied"), "✔")) : m.a.createElement(ve, Object.assign({ className: "copy-icon" }, A(e5, "copy-icon")));
          }, a2.clipboardValue = function(e5) {
            switch (_(e5)) {
              case "function":
              case "regexp":
                return e5.toString();
              default:
                return e5;
            }
          }, a2.state = { copied: false }, a2;
        }
        return c(n2, [{ key: "componentWillUnmount", value: function() {
          this.copiedTimer && (clearTimeout(this.copiedTimer), this.copiedTimer = null);
        } }, { key: "render", value: function() {
          var e4 = this.props, t3 = (e4.src, e4.theme), n3 = e4.hidden, a2 = e4.rowHovered, r2 = A(t3, "copy-to-clipboard").style, i2 = "inline";
          return n3 && (i2 = "none"), m.a.createElement("span", { className: "copy-to-clipboard-container", title: "Copy to clipboard", style: { verticalAlign: "top", display: a2 ? "inline-block" : "none" } }, m.a.createElement("span", { style: o(o({}, r2), {}, { display: i2 }), onClick: this.handleCopy }, this.getClippyIcon()));
        } }]), n2;
      }(m.a.PureComponent), ke = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).getEditIcon = function() {
            var e5 = a2.props, t3 = e5.variable, n3 = e5.theme;
            return m.a.createElement("div", { className: "click-to-edit", style: { verticalAlign: "top", display: a2.state.hovered ? "inline-block" : "none" } }, m.a.createElement(Ee, Object.assign({ className: "click-to-edit-icon" }, A(n3, "editVarIcon"), { onClick: function() {
              a2.prepopInput(t3);
            } })));
          }, a2.prepopInput = function(e5) {
            if (false !== a2.props.onEdit) {
              var t3 = function(e6) {
                var t4;
                switch (_(e6)) {
                  case "undefined":
                    t4 = "undefined";
                    break;
                  case "nan":
                    t4 = "NaN";
                    break;
                  case "string":
                    t4 = e6;
                    break;
                  case "date":
                  case "function":
                  case "regexp":
                    t4 = e6.toString();
                    break;
                  default:
                    try {
                      t4 = JSON.stringify(e6, null, "  ");
                    } catch (e7) {
                      t4 = "";
                    }
                }
                return t4;
              }(e5.value), n3 = ce(t3);
              a2.setState({ editMode: true, editValue: t3, parsedInput: { type: n3.type, value: n3.value } });
            }
          }, a2.getRemoveIcon = function() {
            var e5 = a2.props, t3 = e5.variable, n3 = e5.namespace, r2 = e5.theme, o2 = e5.rjvId;
            return m.a.createElement("div", { className: "click-to-remove", style: { verticalAlign: "top", display: a2.state.hovered ? "inline-block" : "none" } }, m.a.createElement(me, Object.assign({ className: "click-to-remove-icon" }, A(r2, "removeVarIcon"), { onClick: function() {
              z.dispatch({ name: "VARIABLE_REMOVED", rjvId: o2, data: { name: t3.name, namespace: n3, existing_value: t3.value, variable_removed: true } });
            } })));
          }, a2.getValue = function(e5, t3) {
            var n3 = !t3 && e5.type, r2 = d(a2).props;
            switch (n3) {
              case false:
                return a2.getEditInput();
              case "string":
                return m.a.createElement(G, Object.assign({ value: e5.value }, r2));
              case "integer":
                return m.a.createElement(H, Object.assign({ value: e5.value }, r2));
              case "float":
                return m.a.createElement(D, Object.assign({ value: e5.value }, r2));
              case "boolean":
                return m.a.createElement(P, Object.assign({ value: e5.value }, r2));
              case "function":
                return m.a.createElement(V, Object.assign({ value: e5.value }, r2));
              case "null":
                return m.a.createElement(W, r2);
              case "nan":
                return m.a.createElement(K, r2);
              case "undefined":
                return m.a.createElement(J, r2);
              case "date":
                return m.a.createElement(F, Object.assign({ value: e5.value }, r2));
              case "regexp":
                return m.a.createElement(U, Object.assign({ value: e5.value }, r2));
              default:
                return m.a.createElement("div", { className: "object-value" }, JSON.stringify(e5.value));
            }
          }, a2.getEditInput = function() {
            var e5 = a2.props.theme, t3 = a2.state.editValue;
            return m.a.createElement("div", null, m.a.createElement(se, Object.assign({ type: "text", inputRef: function(e6) {
              return e6 && e6.focus();
            }, value: t3, className: "variable-editor", onChange: function(e6) {
              var t4 = e6.target.value, n3 = ce(t4);
              a2.setState({ editValue: t4, parsedInput: { type: n3.type, value: n3.value } });
            }, onKeyDown: function(e6) {
              switch (e6.key) {
                case "Escape":
                  a2.setState({ editMode: false, editValue: "" });
                  break;
                case "Enter":
                  (e6.ctrlKey || e6.metaKey) && a2.submitEdit(true);
              }
              e6.stopPropagation();
            }, placeholder: "update this value", minRows: 2 }, A(e5, "edit-input"))), m.a.createElement("div", A(e5, "edit-icon-container"), m.a.createElement(me, Object.assign({ className: "edit-cancel" }, A(e5, "cancel-icon"), { onClick: function() {
              a2.setState({ editMode: false, editValue: "" });
            } })), m.a.createElement(je, Object.assign({ className: "edit-check string-value" }, A(e5, "check-icon"), { onClick: function() {
              a2.submitEdit();
            } })), m.a.createElement("div", null, a2.showDetected())));
          }, a2.submitEdit = function(e5) {
            var t3 = a2.props, n3 = t3.variable, r2 = t3.namespace, o2 = t3.rjvId, i2 = a2.state, s2 = i2.editValue, c2 = i2.parsedInput, l2 = s2;
            e5 && c2.type && (l2 = c2.value), a2.setState({ editMode: false }), z.dispatch({ name: "VARIABLE_UPDATED", rjvId: o2, data: { name: n3.name, namespace: r2, existing_value: n3.value, new_value: l2, variable_removed: false } });
          }, a2.showDetected = function() {
            var e5 = a2.props, t3 = e5.theme, n3 = (e5.variable, e5.namespace, e5.rjvId, a2.state.parsedInput), r2 = (n3.type, n3.value, a2.getDetectedInput());
            if (r2)
              return m.a.createElement("div", null, m.a.createElement("div", A(t3, "detected-row"), r2, m.a.createElement(je, { className: "edit-check detected", style: o({ verticalAlign: "top", paddingLeft: "3px" }, A(t3, "check-icon").style), onClick: function() {
                a2.submitEdit(true);
              } })));
          }, a2.getDetectedInput = function() {
            var e5 = a2.state.parsedInput, t3 = e5.type, n3 = e5.value, r2 = d(a2).props, i2 = r2.theme;
            if (false !== t3)
              switch (t3.toLowerCase()) {
                case "object":
                  return m.a.createElement("span", null, m.a.createElement("span", { style: o(o({}, A(i2, "brace").style), {}, { cursor: "default" }) }, "{"), m.a.createElement("span", { style: o(o({}, A(i2, "ellipsis").style), {}, { cursor: "default" }) }, "..."), m.a.createElement("span", { style: o(o({}, A(i2, "brace").style), {}, { cursor: "default" }) }, "}"));
                case "array":
                  return m.a.createElement("span", null, m.a.createElement("span", { style: o(o({}, A(i2, "brace").style), {}, { cursor: "default" }) }, "["), m.a.createElement("span", { style: o(o({}, A(i2, "ellipsis").style), {}, { cursor: "default" }) }, "..."), m.a.createElement("span", { style: o(o({}, A(i2, "brace").style), {}, { cursor: "default" }) }, "]"));
                case "string":
                  return m.a.createElement(G, Object.assign({ value: n3 }, r2));
                case "integer":
                  return m.a.createElement(H, Object.assign({ value: n3 }, r2));
                case "float":
                  return m.a.createElement(D, Object.assign({ value: n3 }, r2));
                case "boolean":
                  return m.a.createElement(P, Object.assign({ value: n3 }, r2));
                case "function":
                  return m.a.createElement(V, Object.assign({ value: n3 }, r2));
                case "null":
                  return m.a.createElement(W, r2);
                case "nan":
                  return m.a.createElement(K, r2);
                case "undefined":
                  return m.a.createElement(J, r2);
                case "date":
                  return m.a.createElement(F, Object.assign({ value: new Date(n3) }, r2));
              }
          }, a2.state = { editMode: false, editValue: "", hovered: false, renameKey: false, parsedInput: { type: false, value: null } }, a2;
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this, t3 = this.props, n3 = t3.variable, a2 = t3.singleIndent, r2 = t3.type, i2 = t3.theme, s2 = t3.namespace, c2 = t3.indentWidth, l2 = t3.enableClipboard, u2 = t3.onEdit, f2 = t3.onDelete, p2 = t3.onSelect, d2 = t3.displayArrayKey, b2 = t3.quotesOnKeys, h2 = this.state.editMode;
          return m.a.createElement("div", Object.assign({}, A(i2, "objectKeyVal", { paddingLeft: c2 * a2 }), { onMouseEnter: function() {
            return e4.setState(o(o({}, e4.state), {}, { hovered: true }));
          }, onMouseLeave: function() {
            return e4.setState(o(o({}, e4.state), {}, { hovered: false }));
          }, className: "variable-row", key: n3.name }), "array" == r2 ? d2 ? m.a.createElement("span", Object.assign({}, A(i2, "array-key"), { key: n3.name + "_" + s2 }), n3.name, m.a.createElement("div", A(i2, "colon"), ":")) : null : m.a.createElement("span", null, m.a.createElement("span", Object.assign({}, A(i2, "object-name"), { className: "object-key", key: n3.name + "_" + s2 }), !!b2 && m.a.createElement("span", { style: { verticalAlign: "top" } }, '"'), m.a.createElement("span", { style: { display: "inline-block" } }, n3.name), !!b2 && m.a.createElement("span", { style: { verticalAlign: "top" } }, '"')), m.a.createElement("span", A(i2, "colon"), ":")), m.a.createElement("div", Object.assign({ className: "variable-value", onClick: false === p2 && false === u2 ? null : function(t4) {
            var a3 = B(s2);
            (t4.ctrlKey || t4.metaKey) && false !== u2 ? e4.prepopInput(n3) : false !== p2 && (a3.shift(), p2(o(o({}, n3), {}, { namespace: a3 })));
          } }, A(i2, "variableValue", { cursor: false === p2 ? "default" : "pointer" })), this.getValue(n3, h2)), l2 ? m.a.createElement(_e, { rowHovered: this.state.hovered, hidden: h2, src: n3.value, clickCallback: l2, theme: i2, namespace: [].concat(B(s2), [n3.name]) }) : null, false !== u2 && 0 == h2 ? this.getEditIcon() : null, false !== f2 && 0 == h2 ? this.getRemoveIcon() : null);
        } }]), n2;
      }(m.a.PureComponent), Oe = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          var e4;
          i(this, n2);
          for (var a2 = arguments.length, r2 = new Array(a2), s2 = 0; s2 < a2; s2++)
            r2[s2] = arguments[s2];
          return (e4 = t2.call.apply(t2, [this].concat(r2))).getObjectSize = function() {
            var t3 = e4.props, n3 = t3.size, a3 = t3.theme;
            if (t3.displayObjectSize)
              return m.a.createElement("span", Object.assign({ className: "object-size" }, A(a3, "object-size")), n3, " item", 1 === n3 ? "" : "s");
          }, e4.getAddAttribute = function(t3) {
            var n3 = e4.props, a3 = n3.theme, r3 = n3.namespace, i2 = n3.name, s3 = n3.src, c2 = n3.rjvId, l2 = n3.depth;
            return m.a.createElement("span", { className: "click-to-add", style: { verticalAlign: "top", display: t3 ? "inline-block" : "none" } }, m.a.createElement(ye, Object.assign({ className: "click-to-add-icon" }, A(a3, "addVarIcon"), { onClick: function() {
              var e5 = { name: l2 > 0 ? i2 : null, namespace: r3.splice(0, r3.length - 1), existing_value: s3, variable_removed: false, key_name: null };
              "object" === _(s3) ? z.dispatch({ name: "ADD_VARIABLE_KEY_REQUEST", rjvId: c2, data: e5 }) : z.dispatch({ name: "VARIABLE_ADDED", rjvId: c2, data: o(o({}, e5), {}, { new_value: [].concat(B(s3), [null]) }) });
            } })));
          }, e4.getRemoveObject = function(t3) {
            var n3 = e4.props, a3 = n3.theme, r3 = (n3.hover, n3.namespace), o2 = n3.name, i2 = n3.src, s3 = n3.rjvId;
            if (1 !== r3.length)
              return m.a.createElement("span", { className: "click-to-remove", style: { display: t3 ? "inline-block" : "none" } }, m.a.createElement(me, Object.assign({ className: "click-to-remove-icon" }, A(a3, "removeVarIcon"), { onClick: function() {
                z.dispatch({ name: "VARIABLE_REMOVED", rjvId: s3, data: { name: o2, namespace: r3.splice(0, r3.length - 1), existing_value: i2, variable_removed: true } });
              } })));
          }, e4.render = function() {
            var t3 = e4.props, n3 = t3.theme, a3 = t3.onDelete, r3 = t3.onAdd, o2 = t3.enableClipboard, i2 = t3.src, s3 = t3.namespace, c2 = t3.rowHovered;
            return m.a.createElement("div", Object.assign({}, A(n3, "object-meta-data"), { className: "object-meta-data", onClick: function(e5) {
              e5.stopPropagation();
            } }), e4.getObjectSize(), o2 ? m.a.createElement(_e, { rowHovered: c2, clickCallback: o2, src: i2, theme: n3, namespace: s3 }) : null, false !== r3 ? e4.getAddAttribute(c2) : null, false !== a3 ? e4.getRemoveObject(c2) : null);
          }, e4;
        }
        return n2;
      }(m.a.PureComponent);
      function Ce(e3) {
        var t2 = e3.parent_type, n2 = e3.namespace, a2 = e3.quotesOnKeys, r2 = e3.theme, o2 = e3.jsvRoot, i2 = e3.name, s2 = e3.displayArrayKey, c2 = e3.name ? e3.name : "";
        return !o2 || false !== i2 && null !== i2 ? "array" == t2 ? s2 ? m.a.createElement("span", Object.assign({}, A(r2, "array-key"), { key: n2 }), m.a.createElement("span", { className: "array-key" }, c2), m.a.createElement("span", A(r2, "colon"), ":")) : m.a.createElement("span", null) : m.a.createElement("span", Object.assign({}, A(r2, "object-name"), { key: n2 }), m.a.createElement("span", { className: "object-key" }, a2 && m.a.createElement("span", { style: { verticalAlign: "top" } }, '"'), m.a.createElement("span", null, c2), a2 && m.a.createElement("span", { style: { verticalAlign: "top" } }, '"')), m.a.createElement("span", A(r2, "colon"), ":")) : m.a.createElement("span", null);
      }
      function Se(e3) {
        var t2 = e3.theme;
        switch (e3.iconStyle) {
          case "triangle":
            return m.a.createElement(he, Object.assign({}, A(t2, "expanded-icon"), { className: "expanded-icon" }));
          case "square":
            return m.a.createElement(pe, Object.assign({}, A(t2, "expanded-icon"), { className: "expanded-icon" }));
          default:
            return m.a.createElement(ue, Object.assign({}, A(t2, "expanded-icon"), { className: "expanded-icon" }));
        }
      }
      function we(e3) {
        var t2 = e3.theme;
        switch (e3.iconStyle) {
          case "triangle":
            return m.a.createElement(be, Object.assign({}, A(t2, "collapsed-icon"), { className: "collapsed-icon" }));
          case "square":
            return m.a.createElement(de, Object.assign({}, A(t2, "collapsed-icon"), { className: "collapsed-icon" }));
          default:
            return m.a.createElement(fe, Object.assign({}, A(t2, "collapsed-icon"), { className: "collapsed-icon" }));
        }
      }
      var Ae = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).toggleCollapsed = function(e5) {
            var t3 = [];
            for (var n3 in a2.state.expanded)
              t3.push(a2.state.expanded[n3]);
            t3[e5] = !t3[e5], a2.setState({ expanded: t3 });
          }, a2.state = { expanded: [] }, a2;
        }
        return c(n2, [{ key: "getExpandedIcon", value: function(e4) {
          var t3 = this.props, n3 = t3.theme, a2 = t3.iconStyle;
          return this.state.expanded[e4] ? m.a.createElement(Se, { theme: n3, iconStyle: a2 }) : m.a.createElement(we, { theme: n3, iconStyle: a2 });
        } }, { key: "render", value: function() {
          var e4 = this, t3 = this.props, n3 = t3.src, a2 = t3.groupArraysAfterLength, r2 = (t3.depth, t3.name), o2 = t3.theme, i2 = t3.jsvRoot, s2 = t3.namespace, c2 = (t3.parent_type, x(t3, ["src", "groupArraysAfterLength", "depth", "name", "theme", "jsvRoot", "namespace", "parent_type"])), l2 = 0, u2 = 5 * this.props.indentWidth;
          i2 || (l2 = 5 * this.props.indentWidth);
          var f2 = a2, p2 = Math.ceil(n3.length / f2);
          return m.a.createElement("div", Object.assign({ className: "object-key-val" }, A(o2, i2 ? "jsv-root" : "objectKeyVal", { paddingLeft: l2 })), m.a.createElement(Ce, this.props), m.a.createElement("span", null, m.a.createElement(Oe, Object.assign({ size: n3.length }, this.props))), B(Array(p2)).map(function(t4, a3) {
            return m.a.createElement("div", Object.assign({ key: a3, className: "object-key-val array-group" }, A(o2, "objectKeyVal", { marginLeft: 6, paddingLeft: u2 })), m.a.createElement("span", A(o2, "brace-row"), m.a.createElement("div", Object.assign({ className: "icon-container" }, A(o2, "icon-container"), { onClick: function(t5) {
              e4.toggleCollapsed(a3);
            } }), e4.getExpandedIcon(a3)), e4.state.expanded[a3] ? m.a.createElement(Fe, Object.assign({ key: r2 + a3, depth: 0, name: false, collapsed: false, groupArraysAfterLength: f2, index_offset: a3 * f2, src: n3.slice(a3 * f2, a3 * f2 + f2), namespace: s2, type: "array", parent_type: "array_group", theme: o2 }, c2)) : m.a.createElement("span", Object.assign({}, A(o2, "brace"), { onClick: function(t5) {
              e4.toggleCollapsed(a3);
            }, className: "array-group-brace" }), "[", m.a.createElement("div", Object.assign({}, A(o2, "array-group-meta-data"), { className: "array-group-meta-data" }), m.a.createElement("span", Object.assign({ className: "object-size" }, A(o2, "object-size")), a3 * f2, " - ", a3 * f2 + f2 > n3.length ? n3.length : a3 * f2 + f2)), "]")));
          }));
        } }]), n2;
      }(m.a.PureComponent), Me = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          i(this, n2), (a2 = t2.call(this, e4)).toggleCollapsed = function() {
            a2.setState({ expanded: !a2.state.expanded }, function() {
              q.set(a2.props.rjvId, a2.props.namespace, "expanded", a2.state.expanded);
            });
          }, a2.getObjectContent = function(e5, t3, n3) {
            return m.a.createElement("div", { className: "pushed-content object-container" }, m.a.createElement("div", Object.assign({ className: "object-content" }, A(a2.props.theme, "pushed-content")), a2.renderObjectContents(t3, n3)));
          }, a2.getEllipsis = function() {
            return 0 === a2.state.size ? null : m.a.createElement("div", Object.assign({}, A(a2.props.theme, "ellipsis"), { className: "node-ellipsis", onClick: a2.toggleCollapsed }), "...");
          }, a2.getObjectMetaData = function(e5) {
            var t3 = a2.props, n3 = (t3.rjvId, t3.theme, a2.state), r3 = n3.size, o2 = n3.hovered;
            return m.a.createElement(Oe, Object.assign({ rowHovered: o2, size: r3 }, a2.props));
          }, a2.renderObjectContents = function(e5, t3) {
            var n3, r3 = a2.props, o2 = r3.depth, i2 = r3.parent_type, s2 = r3.index_offset, c2 = r3.groupArraysAfterLength, l2 = r3.namespace, u2 = a2.state.object_type, f2 = [], p2 = Object.keys(e5 || {});
            return a2.props.sortKeys && "array" !== u2 && (p2 = p2.sort()), p2.forEach(function(r4) {
              if (n3 = new Pe(r4, e5[r4]), "array_group" === i2 && s2 && (n3.name = parseInt(n3.name) + s2), e5.hasOwnProperty(r4))
                if ("object" === n3.type)
                  f2.push(m.a.createElement(Fe, Object.assign({ key: n3.name, depth: o2 + 1, name: n3.name, src: n3.value, namespace: l2.concat(n3.name), parent_type: u2 }, t3)));
                else if ("array" === n3.type) {
                  var p3 = Fe;
                  c2 && n3.value.length > c2 && (p3 = Ae), f2.push(m.a.createElement(p3, Object.assign({ key: n3.name, depth: o2 + 1, name: n3.name, src: n3.value, namespace: l2.concat(n3.name), type: "array", parent_type: u2 }, t3)));
                } else
                  f2.push(m.a.createElement(ke, Object.assign({ key: n3.name + "_" + l2, variable: n3, singleIndent: 5, namespace: l2, type: a2.props.type }, t3)));
            }), f2;
          };
          var r2 = n2.getState(e4);
          return a2.state = o(o({}, r2), {}, { prevProps: {} }), a2;
        }
        return c(n2, [{ key: "getBraceStart", value: function(e4, t3) {
          var n3 = this, a2 = this.props, r2 = a2.src, o2 = a2.theme, i2 = a2.iconStyle;
          if ("array_group" === a2.parent_type)
            return m.a.createElement("span", null, m.a.createElement("span", A(o2, "brace"), "array" === e4 ? "[" : "{"), t3 ? this.getObjectMetaData(r2) : null);
          var s2 = t3 ? Se : we;
          return m.a.createElement("span", null, m.a.createElement("span", Object.assign({ onClick: function(e5) {
            n3.toggleCollapsed();
          } }, A(o2, "brace-row")), m.a.createElement("div", Object.assign({ className: "icon-container" }, A(o2, "icon-container")), m.a.createElement(s2, { theme: o2, iconStyle: i2 })), m.a.createElement(Ce, this.props), m.a.createElement("span", A(o2, "brace"), "array" === e4 ? "[" : "{")), t3 ? this.getObjectMetaData(r2) : null);
        } }, { key: "render", value: function() {
          var e4 = this, t3 = this.props, n3 = t3.depth, a2 = t3.src, r2 = (t3.namespace, t3.name, t3.type, t3.parent_type), i2 = t3.theme, s2 = t3.jsvRoot, c2 = t3.iconStyle, l2 = x(t3, ["depth", "src", "namespace", "name", "type", "parent_type", "theme", "jsvRoot", "iconStyle"]), u2 = this.state, f2 = u2.object_type, p2 = u2.expanded, d2 = {};
          return s2 || "array_group" === r2 ? "array_group" === r2 && (d2.borderLeft = 0, d2.display = "inline") : d2.paddingLeft = 5 * this.props.indentWidth, m.a.createElement("div", Object.assign({ className: "object-key-val", onMouseEnter: function() {
            return e4.setState(o(o({}, e4.state), {}, { hovered: true }));
          }, onMouseLeave: function() {
            return e4.setState(o(o({}, e4.state), {}, { hovered: false }));
          } }, A(i2, s2 ? "jsv-root" : "objectKeyVal", d2)), this.getBraceStart(f2, p2), p2 ? this.getObjectContent(n3, a2, o({ theme: i2, iconStyle: c2 }, l2)) : this.getEllipsis(), m.a.createElement("span", { className: "brace-row" }, m.a.createElement("span", { style: o(o({}, A(i2, "brace").style), {}, { paddingLeft: p2 ? "3px" : "0px" }) }, "array" === f2 ? "]" : "}"), p2 ? null : this.getObjectMetaData(a2)));
        } }], [{ key: "getDerivedStateFromProps", value: function(e4, t3) {
          var a2 = t3.prevProps;
          return e4.src !== a2.src || e4.collapsed !== a2.collapsed || e4.name !== a2.name || e4.namespace !== a2.namespace || e4.rjvId !== a2.rjvId ? o(o({}, n2.getState(e4)), {}, { prevProps: e4 }) : null;
        } }]), n2;
      }(m.a.PureComponent);
      Me.getState = function(e3) {
        var t2 = Object.keys(e3.src).length, n2 = (false === e3.collapsed || true !== e3.collapsed && e3.collapsed > e3.depth) && (!e3.shouldCollapse || false === e3.shouldCollapse({ name: e3.name, src: e3.src, type: _(e3.src), namespace: e3.namespace })) && 0 !== t2;
        return { expanded: q.get(e3.rjvId, e3.namespace, "expanded", n2), object_type: "array" === e3.type ? "array" : "object", parent_type: "array" === e3.type ? "array" : "object", size: t2, hovered: false };
      };
      var Pe = function e3(t2, n2) {
        i(this, e3), this.name = t2, this.value = n2, this.type = _(n2);
      };
      j(Me);
      var Fe = Me, De = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          var e4;
          i(this, n2);
          for (var a2 = arguments.length, r2 = new Array(a2), o2 = 0; o2 < a2; o2++)
            r2[o2] = arguments[o2];
          return (e4 = t2.call.apply(t2, [this].concat(r2))).render = function() {
            var t3 = d(e4).props, n3 = [t3.name], a3 = Fe;
            return Array.isArray(t3.src) && t3.groupArraysAfterLength && t3.src.length > t3.groupArraysAfterLength && (a3 = Ae), m.a.createElement("div", { className: "pretty-json-container object-container" }, m.a.createElement("div", { className: "object-content" }, m.a.createElement(a3, Object.assign({ namespace: n3, depth: 0, jsvRoot: true }, t3))));
          }, e4;
        }
        return n2;
      }(m.a.PureComponent), Ie = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).closeModal = function() {
            z.dispatch({ rjvId: a2.props.rjvId, name: "RESET" });
          }, a2.submit = function() {
            a2.props.submit(a2.state.input);
          }, a2.state = { input: e4.input ? e4.input : "" }, a2;
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this, t3 = this.props, n3 = t3.theme, a2 = t3.rjvId, r2 = t3.isValid, o2 = this.state.input, i2 = r2(o2);
          return m.a.createElement("div", Object.assign({ className: "key-modal-request" }, A(n3, "key-modal-request"), { onClick: this.closeModal }), m.a.createElement("div", Object.assign({}, A(n3, "key-modal"), { onClick: function(e5) {
            e5.stopPropagation();
          } }), m.a.createElement("div", A(n3, "key-modal-label"), "Key Name:"), m.a.createElement("div", { style: { position: "relative" } }, m.a.createElement("input", Object.assign({}, A(n3, "key-modal-input"), { className: "key-modal-input", ref: function(e5) {
            return e5 && e5.focus();
          }, spellCheck: false, value: o2, placeholder: "...", onChange: function(t4) {
            e4.setState({ input: t4.target.value });
          }, onKeyPress: function(t4) {
            i2 && "Enter" === t4.key ? e4.submit() : "Escape" === t4.key && e4.closeModal();
          } })), i2 ? m.a.createElement(je, Object.assign({}, A(n3, "key-modal-submit"), { className: "key-modal-submit", onClick: function(t4) {
            return e4.submit();
          } })) : null), m.a.createElement("span", A(n3, "key-modal-cancel"), m.a.createElement(ge, Object.assign({}, A(n3, "key-modal-cancel-icon"), { className: "key-modal-cancel", onClick: function() {
            z.dispatch({ rjvId: a2, name: "RESET" });
          } })))));
        } }]), n2;
      }(m.a.PureComponent), Re = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          var e4;
          i(this, n2);
          for (var a2 = arguments.length, r2 = new Array(a2), s2 = 0; s2 < a2; s2++)
            r2[s2] = arguments[s2];
          return (e4 = t2.call.apply(t2, [this].concat(r2))).isValid = function(t3) {
            var n3 = e4.props.rjvId, a3 = q.get(n3, "action", "new-key-request");
            return "" != t3 && -1 === Object.keys(a3.existing_value).indexOf(t3);
          }, e4.submit = function(t3) {
            var n3 = e4.props.rjvId, a3 = q.get(n3, "action", "new-key-request");
            a3.new_value = o({}, a3.existing_value), a3.new_value[t3] = e4.props.defaultValue, z.dispatch({ name: "VARIABLE_ADDED", rjvId: n3, data: a3 });
          }, e4;
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.active, n3 = e4.theme, a2 = e4.rjvId;
          return t3 ? m.a.createElement(Ie, { rjvId: a2, theme: n3, isValid: this.isValid, submit: this.submit }) : null;
        } }]), n2;
      }(m.a.PureComponent), Le = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2() {
          return i(this, n2), t2.apply(this, arguments);
        }
        return c(n2, [{ key: "render", value: function() {
          var e4 = this.props, t3 = e4.message, n3 = e4.active, a2 = e4.theme, r2 = e4.rjvId;
          return n3 ? m.a.createElement("div", Object.assign({ className: "validation-failure" }, A(a2, "validation-failure"), { onClick: function() {
            z.dispatch({ rjvId: r2, name: "RESET" });
          } }), m.a.createElement("span", A(a2, "validation-failure-label"), t3), m.a.createElement(ge, A(a2, "validation-failure-clear"))) : null;
        } }]), n2;
      }(m.a.PureComponent), Be = function(e3) {
        u(n2, e3);
        var t2 = h(n2);
        function n2(e4) {
          var a2;
          return i(this, n2), (a2 = t2.call(this, e4)).rjvId = Date.now().toString(), a2.getListeners = function() {
            return { reset: a2.resetState, "variable-update": a2.updateSrc, "add-key-request": a2.addKeyRequest };
          }, a2.updateSrc = function() {
            var e5, t3 = q.get(a2.rjvId, "action", "variable-update"), n3 = t3.name, r2 = t3.namespace, o2 = t3.new_value, i2 = t3.existing_value, s2 = (t3.variable_removed, t3.updated_src), c2 = t3.type, l2 = a2.props, u2 = l2.onEdit, f2 = l2.onDelete, p2 = l2.onAdd, d2 = { existing_src: a2.state.src, new_value: o2, updated_src: s2, name: n3, namespace: r2, existing_value: i2 };
            switch (c2) {
              case "variable-added":
                e5 = p2(d2);
                break;
              case "variable-edited":
                e5 = u2(d2);
                break;
              case "variable-removed":
                e5 = f2(d2);
            }
            false !== e5 ? (q.set(a2.rjvId, "global", "src", s2), a2.setState({ src: s2 })) : a2.setState({ validationFailure: true });
          }, a2.addKeyRequest = function() {
            a2.setState({ addKeyRequest: true });
          }, a2.resetState = function() {
            a2.setState({ validationFailure: false, addKeyRequest: false });
          }, a2.state = { addKeyRequest: false, editKeyRequest: false, validationFailure: false, src: n2.defaultProps.src, name: n2.defaultProps.name, theme: n2.defaultProps.theme, validationMessage: n2.defaultProps.validationMessage, prevSrc: n2.defaultProps.src, prevName: n2.defaultProps.name, prevTheme: n2.defaultProps.theme }, a2;
        }
        return c(n2, [{ key: "componentDidMount", value: function() {
          q.set(this.rjvId, "global", "src", this.state.src);
          var e4 = this.getListeners();
          for (var t3 in e4)
            q.on(t3 + "-" + this.rjvId, e4[t3]);
          this.setState({ addKeyRequest: false, editKeyRequest: false });
        } }, { key: "componentDidUpdate", value: function(e4, t3) {
          false !== t3.addKeyRequest && this.setState({ addKeyRequest: false }), false !== t3.editKeyRequest && this.setState({ editKeyRequest: false }), e4.src !== this.state.src && q.set(this.rjvId, "global", "src", this.state.src);
        } }, { key: "componentWillUnmount", value: function() {
          var e4 = this.getListeners();
          for (var t3 in e4)
            q.removeListener(t3 + "-" + this.rjvId, e4[t3]);
        } }, { key: "render", value: function() {
          var e4 = this.state, t3 = e4.validationFailure, n3 = e4.validationMessage, a2 = e4.addKeyRequest, r2 = e4.theme, i2 = e4.src, s2 = e4.name, c2 = this.props, l2 = c2.style, u2 = c2.defaultValue;
          return m.a.createElement("div", { className: "react-json-view", style: o(o({}, A(r2, "app-container").style), l2) }, m.a.createElement(Le, { message: n3, active: t3, theme: r2, rjvId: this.rjvId }), m.a.createElement(De, Object.assign({}, this.props, { src: i2, name: s2, theme: r2, type: _(i2), rjvId: this.rjvId })), m.a.createElement(Re, { active: a2, theme: r2, rjvId: this.rjvId, defaultValue: u2 }));
        } }], [{ key: "getDerivedStateFromProps", value: function(e4, t3) {
          if (e4.src !== t3.prevSrc || e4.name !== t3.prevName || e4.theme !== t3.prevTheme) {
            var a2 = { src: e4.src, name: e4.name, theme: e4.theme, validationMessage: e4.validationMessage, prevSrc: e4.src, prevName: e4.name, prevTheme: e4.theme };
            return n2.validateState(a2);
          }
          return null;
        } }]), n2;
      }(m.a.PureComponent);
      Be.defaultProps = { src: {}, name: "root", theme: "rjv-default", collapsed: false, collapseStringsAfterLength: false, shouldCollapse: false, sortKeys: false, quotesOnKeys: true, groupArraysAfterLength: 100, indentWidth: 4, enableClipboard: true, displayObjectSize: true, displayDataTypes: true, onEdit: false, onDelete: false, onAdd: false, onSelect: false, iconStyle: "triangle", style: {}, validationMessage: "Validation Error", defaultValue: null, displayArrayKey: true }, Be.validateState = function(e3) {
        var t2 = {};
        return "object" !== _(e3.theme) || function(e4) {
          var t3 = ["base00", "base01", "base02", "base03", "base04", "base05", "base06", "base07", "base08", "base09", "base0A", "base0B", "base0C", "base0D", "base0E", "base0F"];
          if ("object" === _(e4)) {
            for (var n2 = 0; n2 < t3.length; n2++)
              if (!(t3[n2] in e4))
                return false;
            return true;
          }
          return false;
        }(e3.theme) || (console.error("react-json-view error:", "theme prop must be a theme name or valid base-16 theme object.", 'defaulting to "rjv-default" theme'), t2.theme = "rjv-default"), "object" !== _(e3.src) && "array" !== _(e3.src) && (console.error("react-json-view error:", "src property must be a valid json object"), t2.name = "ERROR", t2.src = { message: "src property must be a valid json object" }), o(o({}, e3), t2);
      }, j(Be);
      t.default = Be;
    }]);
  });
})(main);
var mainExports = main.exports;
const ReactJson = /* @__PURE__ */ getDefaultExportFromCjs(mainExports);
const Tips = () => {
  const { t } = useTranslation();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "div",
    {
      className: "flex items-start gap-2 border-small px-2 py-1 rounded-small border-default-200 opacity-80",
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, { className: "leading-normal block" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "leading-normal", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: t(
            "You can set conventions on each path segments to fill the properties of resources."
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: t(
            "If your path layer isn't stable to root path but it is stable to resource, 'The xxx layer to the resource' is your better choice."
          ) })
        ] })
      ]
    }
  );
};
Tips.displayName = "Tips";
class PscMatcherValue {
  constructor(v) {
    __publicField(this, "valueType");
    __publicField(this, "layer");
    __publicField(this, "regex");
    __publicField(this, "fixedText");
    Object.assign(this, v);
  }
  static Layer(layer) {
    return new PscMatcherValue({
      valueType: ResourceMatcherValueType.Layer,
      layer
    });
  }
  static Regex(regex) {
    return new PscMatcherValue({
      valueType: ResourceMatcherValueType.Regex,
      regex
    });
  }
  static FixedText(fixedText) {
    return new PscMatcherValue({
      valueType: ResourceMatcherValueType.FixedText,
      fixedText
    });
  }
  static ToString(t, value) {
    switch (value.valueType) {
      case ResourceMatcherValueType.FixedText:
        return t("Fixed text: {{text}}", { text: value.fixedText });
      case ResourceMatcherValueType.Regex:
        return t("Regex: {{regex}}", { regex: value.regex });
      case ResourceMatcherValueType.Layer:
        if (value.layer && value.layer < 0) {
          return t("Layer: the {{layer}} layer to the last", {
            layer: -value.layer
          });
        } else {
          return t("Layer: the {{layer}} layer", {
            layer: value.layer
          });
        }
    }
  }
  equals(other) {
    if (this.valueType !== other.valueType) {
      return false;
    }
    switch (this.valueType) {
      case ResourceMatcherValueType.Layer:
        return this.layer === other.layer;
      case ResourceMatcherValueType.Regex:
        return this.regex === other.regex;
      case ResourceMatcherValueType.FixedText:
        return this.fixedText === other.fixedText;
    }
    return false;
  }
  buildDisplayText(t) {
    return PscMatcherValue.ToString(t, this);
  }
}
const Errors = ({ errors, value, onDeleteMatcherValue }) => {
  const { t } = useTranslation();
  if (errors && errors.length > 0) {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: "px-2 py-1 border-small rounded-small border-default-200 flex flex-col gap-1 text-sm relative",
        children: errors.map((e) => {
          var _a, _b;
          const v = (_b = (_a = value == null ? void 0 : value.filter((v2) => v2.property.equals(e.property))) == null ? void 0 : _a[e.valueIndex ?? 0]) == null ? void 0 : _b.value;
          return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Chip,
              {
                color: "danger",
                radius: "sm",
                size: "sm",
                startContent: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, { className: "text-sm" }),
                children: e.property.toString(t, e.valueIndex)
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs(
              Chip,
              {
                color: "danger",
                radius: "sm",
                size: "sm",
                variant: "light",
                onClose: e.deletable ? () => {
                  onDeleteMatcherValue(e.property, e.valueIndex ?? 0);
                } : void 0,
                children: [
                  v && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-bold mr-2", children: PscMatcherValue.ToString(t, v) }),
                  e.message
                ]
              }
            )
          ] });
        })
      }
    );
  }
  return null;
};
Errors.displayName = "Errors";
var PscPropertyType = /* @__PURE__ */ ((PscPropertyType2) => {
  PscPropertyType2[PscPropertyType2["RootPath"] = 1] = "RootPath";
  PscPropertyType2[PscPropertyType2["Resource"] = 2] = "Resource";
  PscPropertyType2[PscPropertyType2["ParentResource"] = 3] = "ParentResource";
  PscPropertyType2[PscPropertyType2["Rating"] = 4] = "Rating";
  PscPropertyType2[PscPropertyType2["Introduction"] = 5] = "Introduction";
  PscPropertyType2[PscPropertyType2["CustomProperty"] = 100] = "CustomProperty";
  return PscPropertyType2;
})(PscPropertyType || {});
const _PscProperty = class _PscProperty {
  constructor(p) {
    __publicField(this, "id");
    __publicField(this, "isCustom");
    __publicField(this, "name");
    __publicField(this, "equals", (other) => {
      return this.id === other.id && this.isCustom == other.isCustom;
    });
    Object.assign(this, p);
  }
  get key() {
    return `${this.isCustom ? "c" : "r"}-${this.id}`;
  }
  get type() {
    if (this.isCustom) {
      return PscPropertyType.CustomProperty;
    } else {
      const rp = this.id;
      switch (rp) {
        case ResourceProperty.RootPath:
          return PscPropertyType.RootPath;
        case ResourceProperty.ParentResource:
          return PscPropertyType.ParentResource;
        case ResourceProperty.Resource:
          return PscPropertyType.Resource;
        case ResourceProperty.Rating:
          return PscPropertyType.Rating;
        case ResourceProperty.Introduction:
          return PscPropertyType.Introduction;
        default:
          return;
      }
    }
  }
  get isRootPath() {
    return !this.isCustom && this.id == ResourceProperty.RootPath;
  }
  get isResource() {
    return !this.isCustom && this.id == ResourceProperty.Resource;
  }
  toString(t, index) {
    return `${this.isCustom ? this.name : t(ResourceProperty[this.id])}${index == void 0 ? "" : index + 1}`;
  }
  static fromPscType(type) {
    switch (type) {
      case PscPropertyType.Rating:
        return this.Rating;
      case PscPropertyType.Introduction:
        return this.Introduction;
      case PscPropertyType.RootPath:
        return this.RootPath;
      case PscPropertyType.Resource:
        return this.Resource;
      case PscPropertyType.ParentResource:
        return this.ParentResource;
      case PscPropertyType.CustomProperty:
        return this.CustomProperty;
    }
  }
};
__publicField(_PscProperty, "Resource", new _PscProperty({
  id: ResourceProperty.Resource,
  isCustom: false,
  name: ResourceProperty[ResourceProperty.Resource]
}));
__publicField(_PscProperty, "RootPath", new _PscProperty({
  id: ResourceProperty.RootPath,
  isCustom: false,
  name: ResourceProperty[ResourceProperty.RootPath]
}));
__publicField(_PscProperty, "ParentResource", new _PscProperty({
  id: ResourceProperty.ParentResource,
  isCustom: false,
  name: ResourceProperty[ResourceProperty.ParentResource]
}));
__publicField(_PscProperty, "Rating", new _PscProperty({
  id: ResourceProperty.Rating,
  isCustom: false,
  name: ResourceProperty[ResourceProperty.Rating]
}));
__publicField(_PscProperty, "Introduction", new _PscProperty({
  id: ResourceProperty.Introduction,
  isCustom: false,
  name: ResourceProperty[ResourceProperty.Introduction]
}));
__publicField(_PscProperty, "CustomProperty", new _PscProperty({
  id: ResourceProperty.CustomProperty,
  isCustom: true,
  name: ResourceProperty[ResourceProperty.CustomProperty]
}));
let PscProperty = _PscProperty;
const ByLayer = ({
  modeIsSelected,
  onSelectMode,
  onSelectLayer,
  selectedLayer,
  layers
}) => {
  const { t } = useTranslation();
  if (!layers || layers.length == 0) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
    card_default,
    {
      isHoverable: true,
      isPressable: true,
      className: "mb-2 cursor-pointer w-full",
      onPress: () => {
        onSelectMode();
      },
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "text-lg font-bold", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          radio_group_default,
          {
            value: modeIsSelected ? "layer" : "",
            onValueChange: onSelectMode,
            children: /* @__PURE__ */ jsxRuntimeExports.jsx(radio_default, { value: "layer", children: t("Set by {{thing}}", { thing: t("layer") }) })
          }
        ) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center flex-wrap gap-1", children: layers.map((layer) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              className: "",
              color: selectedLayer == layer ? "primary" : "default",
              size: "sm",
              variant: "bordered",
              onClick: () => {
                onSelectLayer(layer);
              },
              children: layer < 0 ? t("The {{layer}} layer to the resource", {
                layer: -layer
              }) : t("The {{layer}} layer after root path", {
                layer
              })
            },
            layer
          );
        }) }) })
      ]
    }
  );
};
ByLayer.displayName = "ByLayer";
class PscMatchResult {
  constructor(init) {
    __publicField(this, "type");
    __publicField(this, "layer");
    __publicField(this, "index");
    __publicField(this, "matches");
    Object.assign(this, init);
  }
  static OfLayer(layer, index) {
    return new PscMatchResult({
      type: MatchResultType.Layer,
      layer,
      index
    });
  }
  static OfRegex(matches) {
    return new PscMatchResult({
      type: MatchResultType.Regex,
      matches
    });
  }
}
class PscMatcher {
  constructor(init) {
    __publicField(this, "propertyType");
    __publicField(this, "multiple");
    __publicField(this, "valueType");
    __publicField(this, "isRequired");
    __publicField(this, "order");
    __publicField(this, "prerequisites", [
      PscPropertyType.Resource,
      PscPropertyType.RootPath
    ]);
    __publicField(this, "checkOrder");
    Object.assign(this, init);
  }
  /**
   * If regex value is applied, layer result will be returned if there is no matching group,
   * otherwise the matched groups will be returned
   * @param segments
   * @param value
   * @param startIndex starts from -1
   * @param endIndex ends to {@link segments.length}
   */
  static match(segments, value, startIndex, endIndex) {
    let result;
    if (value !== void 0) {
      switch (value.valueType) {
        case ResourceMatcherValueType.FixedText: {
          if (startIndex != void 0 && startIndex >= -1) {
            const subSegments = segments.slice(startIndex + 1);
            let str = "";
            for (let i = 0; i < subSegments.length; i++) {
              str += subSegments[i];
              if (str == value.fixedText) {
                const layer = i + 1;
                result = PscMatchResult.OfLayer(layer, startIndex + layer);
                break;
              }
              str += "/";
            }
          }
          break;
        }
        case ResourceMatcherValueType.Layer: {
          if (value.layer != void 0 && value.layer != 0) {
            if (value.layer > 0) {
              if (startIndex != void 0 && startIndex >= -1) {
                const idx = startIndex + value.layer;
                if (idx < segments.length) {
                  result = PscMatchResult.OfLayer(
                    value.layer,
                    value.layer + startIndex
                  );
                }
              }
            } else {
              if (endIndex != void 0 && endIndex <= segments.length && endIndex + value.layer >= 0) {
                result = PscMatchResult.OfLayer(
                  value.layer,
                  value.layer + endIndex
                );
              }
            }
          }
          break;
        }
        case ResourceMatcherValueType.Regex: {
          if (endIndex != void 0 && endIndex <= segments.length && startIndex != void 0 && startIndex >= -1 && endIndex > startIndex + 1) {
            const subPath = segments.slice(startIndex + 1, endIndex).join("/");
            const rr = getResultFromExecAll(value.regex, subPath);
            if (rr) {
              if (rr.groups) {
                result = PscMatchResult.OfRegex(rr.groups);
              } else {
                const length = subPath.indexOf(rr.text) + rr.text.length;
                const matchedText = subPath.substring(0, length);
                const layer = matchedText.split("/").length;
                result = PscMatchResult.OfLayer(layer, layer + startIndex);
              }
            }
          }
          break;
        }
      }
      console.log(
        "[Matcher]Matching",
        segments,
        `from ${startIndex} to ${endIndex}`,
        "with",
        value.toString(),
        "result:",
        result
      );
    }
    return result;
  }
  static matchAll(segments, values, rootIndex = -1, resourceIndex = -1, stopAtFirstMatch = false) {
    if (!values) {
      return [];
    }
    const results = [];
    for (let i = 0; i < values.length; i++) {
      const value = values[i];
      const result = this.match(segments, value, rootIndex, resourceIndex);
      if (result) {
        results.push(result);
        if (stopAtFirstMatch) {
          break;
        }
      } else {
        results.push(void 0);
      }
    }
    return results;
  }
  static matchFirst(segments, values, rootIndex = -1, resourceIndex = -1) {
    var _a;
    return (_a = this.matchAll(segments, values, rootIndex, resourceIndex, true)) == null ? void 0 : _a[0];
  }
}
const RootPathMatcher = new PscMatcher({
  propertyType: PscPropertyType.RootPath,
  multiple: false,
  isRequired: true,
  order: 0,
  prerequisites: []
});
const ResourceMatcher = new PscMatcher({
  propertyType: PscPropertyType.Resource,
  multiple: false,
  isRequired: true,
  order: 2,
  prerequisites: []
});
const allMatchers = [
  RootPathMatcher,
  new PscMatcher({
    propertyType: PscPropertyType.ParentResource,
    multiple: false,
    order: 1
  }),
  ResourceMatcher,
  new PscMatcher({
    propertyType: PscPropertyType.Rating,
    multiple: false,
    order: 1
  }),
  new PscMatcher({
    propertyType: PscPropertyType.Introduction,
    multiple: false,
    order: 1
  }),
  new PscMatcher({
    propertyType: PscPropertyType.CustomProperty,
    multiple: true,
    order: 1
  })
];
const notSetCheckOrderMatchers = allMatchers.slice();
const setCheckOrderMatchers = [];
while (setCheckOrderMatchers.length < notSetCheckOrderMatchers.length) {
  const doneCount = setCheckOrderMatchers.length;
  for (const m of notSetCheckOrderMatchers) {
    if (!setCheckOrderMatchers.includes(m)) {
      if (m.prerequisites.length == 0) {
        setCheckOrderMatchers.push(m);
      } else {
        if (m.prerequisites.every(
          (p) => setCheckOrderMatchers.some((m2) => m2.propertyType == p)
        )) {
          setCheckOrderMatchers.push(m);
        }
      }
    }
  }
  if (doneCount == setCheckOrderMatchers.length) {
    throw new Error("There is a loop in resource prerequisites");
  }
}
for (let i = 0; i < setCheckOrderMatchers.length; i++) {
  setCheckOrderMatchers[i].checkOrder = i;
}
console.log("[AllPathSegmentMatchers]", allMatchers);
const matchersAfter = allMatchers.reduce((s, t) => {
  s[t.propertyType] = allMatchers.filter((m) => m.order > t.order);
  return s;
}, {});
const matchersBefore = allMatchers.reduce((s, t) => {
  s[t.propertyType] = allMatchers.filter((m) => m.order < t.order);
  return s;
}, {});
const buildSimpleMatcherOrders = (data) => Object.keys(data).reduce((s, t) => {
  var _a;
  s[PscPropertyType[t]] = (_a = data[t]) == null ? void 0 : _a.map((m) => PscPropertyType[m.type]);
  return s;
}, {});
console.log("[MatchersAfter]", buildSimpleMatcherOrders(matchersAfter));
console.log("[MatchersBefore]", buildSimpleMatcherOrders(matchersBefore));
class SimplePscContextItem {
  constructor(property, valueIndex) {
    __publicField(this, "property");
    __publicField(this, "valueIndex");
    this.property = property;
    this.valueIndex = valueIndex;
  }
  toString(t) {
    return this.property.toString(t, this.valueIndex);
  }
}
class Segment {
  constructor(init) {
    __publicField(this, "text", "");
    __publicField(this, "matchResults", []);
    __publicField(this, "selectiveMatchers", []);
    /**
     * Not truly disabled, it displays as disabled
     */
    __publicField(this, "disabled", false);
    Object.assign(this, init);
  }
}
class SelectiveMatcher {
  constructor(init) {
    __publicField(this, "propertyType", 0);
    __publicField(this, "readonly", false);
    __publicField(this, "replaceCurrent", false);
    __publicField(this, "errors", []);
    __publicField(this, "matchModes", {
      oneClick: new CommonMatchMode(),
      regex: new RegexMatchMode(),
      layer: new LayerMatchMode()
    });
    Object.assign(this, init);
  }
  get isConfigurable() {
    return !this.readonly && Object.keys(this.matchModes).some(
      (s) => this.matchModes[s].available
    );
  }
  get useSmc() {
    return this.isConfigurable && !this.matchModes.oneClick.available;
  }
  buildModesData() {
    const data = new SegmentMatcherConfigurationModesData();
    if (this.matchModes.regex.available) {
      data.regex = {
        text: this.matchModes.regex.text
      };
    }
    if (this.matchModes.layer.available) {
      data.layers = this.matchModes.layer.layers;
    }
    return data;
  }
}
class CommonMatchMode {
  constructor() {
    __publicField(this, "available", false);
    __publicField(this, "errors", []);
  }
}
class RegexMatchMode extends CommonMatchMode {
  constructor() {
    super(...arguments);
    __publicField(this, "text");
  }
}
class LayerMatchMode extends CommonMatchMode {
  constructor() {
    super(...arguments);
    __publicField(this, "layers", []);
  }
}
class SimpleGlobalMatchResult extends SimplePscContextItem {
  constructor(property, valueIndex, matches) {
    super(property, valueIndex);
    __publicField(this, "matches");
    this.matches = matches;
  }
}
class SimpleMatchResult extends SimplePscContextItem {
  constructor(property, valueIndex, errors) {
    super(property, valueIndex);
    __publicField(this, "errors", []);
    __publicField(this, "readonly", false);
    this.errors = errors || [];
  }
}
class SimpleGlobalError extends SimplePscContextItem {
  constructor(property, valueIndex, message, deletable, preventSubmitting) {
    super(property, valueIndex);
    __publicField(this, "message");
    __publicField(this, "deletable");
    __publicField(this, "preventSubmitting");
    this.message = message;
    this.deletable = deletable;
    this.preventSubmitting = preventSubmitting;
  }
  equals(other) {
    return this.property.equals(other.property) && this.valueIndex == other.valueIndex && this.message == other.message;
  }
}
class PscContext {
  constructor() {
    __publicField(this, "segments", []);
    __publicField(this, "globalErrors", []);
    __publicField(this, "globalMatches", []);
  }
  get preventSubmitting() {
    var _a;
    const error = ((_a = this.globalErrors) == null ? void 0 : _a.filter((e) => e.preventSubmitting).length) > 0 || this.segments.some(
      (s) => {
        var _a2;
        return (_a2 = s.matchResults) == null ? void 0 : _a2.some((t) => t.errors && t.errors.length > 0);
      }
    );
    if (error) {
      return true;
    }
    const missingProperties = allMatchers.filter(
      (a) => a.isRequired && !this.segments.some(
        (e) => e.matchResults.some((r) => r.property.type == a.propertyType)
      )
    );
    return missingProperties.length > 0;
  }
}
function convertToPscValueFromPathConfigurationDto(pc) {
  const value = [];
  if (pc.path) {
    value.push({
      value: new PscMatcherValue({
        valueType: ResourceMatcherValueType.FixedText,
        fixedText: pc.path
      }),
      property: PscProperty.RootPath
    });
  }
  if (pc.rpmValues) {
    for (const segment of pc.rpmValues) {
      value.push({
        value: new PscMatcherValue({
          valueType: segment.valueType,
          fixedText: segment.fixedText ?? void 0,
          regex: segment.regex ?? void 0,
          layer: segment.layer ?? void 0
        }),
        property: new PscProperty({
          isCustom: segment.isCustomProperty,
          id: segment.propertyId
        })
      });
    }
  }
  console.log("Convert dto value to component value", pc, value);
  return value;
}
function convertToPathConfigurationDtoFromPscValue(pmvs) {
  var _a, _b;
  const rootPath = (_b = (_a = pmvs.filter((v) => v.property.isRootPath)[0]) == null ? void 0 : _a.value) == null ? void 0 : _b.fixedText;
  const dto = {
    path: rootPath,
    // regex: resourceRegex,
    rpmValues: pmvs.filter((v) => !v.property.isRootPath).map((v) => {
      return {
        propertyId: v.property.id,
        isCustomProperty: v.property.isCustom,
        fixedText: v.value.fixedText,
        layer: v.value.layer,
        regex: v.value.regex,
        valueType: v.value.valueType
      };
    })
  };
  console.log("Convert component value to dto value", pmvs, dto);
  return dto;
}
function getResultFromExecAll(regex, str) {
  const matches = execAll(regex, str);
  if (matches) {
    const capturedMap = {};
    let firstMatch;
    let index;
    for (const m of matches) {
      if (m.groups) {
        Object.keys(m.groups).forEach((key) => {
          const v = m.groups[key];
          if (v != void 0 && v.length > 0) {
            capturedMap[v] = true;
          }
        });
      }
      for (let i = 1; i < m.length; i++) {
        const v = m[i];
        if (v != void 0 && v.length > 0) {
          capturedMap[v] = true;
        }
      }
      if (firstMatch == void 0) {
        const v = m[0];
        if (v != void 0 && v.length > 0) {
          firstMatch = v;
          index = m.index;
        }
      }
    }
    const values = Object.keys(capturedMap);
    const result = {};
    if (values.length == 0) {
      if (firstMatch == void 0) {
        return null;
      }
      result.text = firstMatch;
      result.index = index;
    } else {
      result.groups = values;
    }
    return result;
  }
  return null;
}
const BuildPscContext = (segments, pmvs, visibleMatchers, configurableMatchers, t, log = console.log) => {
  const data = new PscContext();
  data.segments = segments.map((s) => new Segment({ text: s }));
  const allPropertyMatchResults = [];
  let rootSegmentIndex;
  let rootMatchResult;
  const rootPmv = pmvs.find((x) => x.property.isRootPath);
  if (rootPmv) {
    const rootMatcherValue = rootPmv.value;
    if (rootMatcherValue) {
      rootMatchResult = PscMatcher.match(
        segments,
        rootMatcherValue,
        -1,
        void 0
      );
      if (rootMatchResult) {
        rootSegmentIndex = rootMatchResult == null ? void 0 : rootMatchResult.index;
      }
    }
    allPropertyMatchResults.push({
      pmv: rootPmv,
      result: rootMatchResult
    });
  }
  let resourceSegmentIndex;
  let resourceMatchResult;
  const resourcePmv = pmvs.find((x) => x.property.isResource);
  if (resourcePmv) {
    const resourceMatcherValue = resourcePmv.value;
    if (resourceMatcherValue && rootSegmentIndex != void 0) {
      resourceMatchResult = PscMatcher.match(
        segments,
        resourceMatcherValue,
        rootSegmentIndex,
        segments.length
      );
      if (resourceMatchResult) {
        switch (resourceMatchResult.type) {
          case MatchResultType.Layer:
            resourceSegmentIndex = resourceMatchResult.index;
            break;
          case MatchResultType.Regex:
            data.globalErrors.push(
              new SimpleGlobalError(
                PscProperty.Resource,
                void 0,
                t(
                  "Resource matcher can not have a regex result(make sure you are not setting groups in regex)"
                ),
                true,
                true
              )
            );
            break;
        }
      }
      allPropertyMatchResults.push({
        pmv: resourcePmv,
        result: resourceMatchResult
      });
    }
  }
  log(
    `Root index: ${rootSegmentIndex}, resource index: ${resourceSegmentIndex}`
  );
  {
    const pmvIndexByPropertyMap = /* @__PURE__ */ new Map();
    const pmvIndexByPropertyKeyMapCounter = {};
    for (const pmv of pmvs) {
      const { key } = pmv.property;
      let index = pmvIndexByPropertyKeyMapCounter[key];
      if (index == void 0) {
        index = 0;
      }
      pmvIndexByPropertyKeyMapCounter[key] = index + 1;
      pmvIndexByPropertyMap.set(pmv, index);
    }
    for (const pmv of pmvs) {
      const { key } = pmv.property;
      const count = pmvIndexByPropertyKeyMapCounter[key];
      if (count == 1) {
        pmvIndexByPropertyMap.delete(pmv);
      }
    }
    pmvs.filter((v) => !v.property.isResource && !v.property.isRootPath).forEach((pmv) => {
      var _a;
      let endIndex = resourceSegmentIndex == void 0 ? void 0 : resourceSegmentIndex + 1;
      if (((_a = pmv.value) == null ? void 0 : _a.valueType) == ResourceMatcherValueType.Layer) {
        endIndex = endIndex == void 0 ? void 0 : endIndex - 1;
      }
      const result = PscMatcher.match(
        segments,
        pmv.value,
        rootSegmentIndex,
        endIndex
      );
      log("Match result for", pmv, "result", result);
      allPropertyMatchResults.push({
        pmv,
        result,
        indexByProperty: pmvIndexByPropertyMap.get(pmv)
      });
    });
  }
  log("All match results:", allPropertyMatchResults);
  for (const vm of visibleMatchers) {
    const propertyMatchResultsOfMatcher = allPropertyMatchResults.filter(
      (x) => x.pmv.property.type == vm.propertyType
    ) || [];
    if (vm.isRequired && propertyMatchResultsOfMatcher.length == 0) {
      data.globalErrors.push(
        new SimpleGlobalError(
          PscProperty.fromPscType(vm.propertyType),
          void 0,
          t("Missing"),
          false,
          true
        )
      );
    }
    const missingPrerequisites = vm.prerequisites.filter(
      (p) => allPropertyMatchResults.every((m) => m.pmv.property.type != p)
    );
    let missingPrerequisitesTip;
    if (missingPrerequisites.length > 0) {
      missingPrerequisitesTip = t(
        "[{{matchers}}] (is)are required to set this property",
        {
          matchers: missingPrerequisites.map((p) => t(PscPropertyType[p])).join(",")
        }
      );
      if (propertyMatchResultsOfMatcher.length > 0) {
        propertyMatchResultsOfMatcher.forEach((r) => {
          data.globalErrors.push(
            new SimpleGlobalError(
              r.pmv.property,
              r.indexByProperty,
              missingPrerequisitesTip,
              false,
              true
            )
          );
        });
      }
    }
    const orderCheckList = [
      matchersAfter[vm.propertyType].map((m) => m.propertyType),
      matchersBefore[vm.propertyType].map((m) => m.propertyType)
    ];
    log(
      `Checking order for ${PscPropertyType[vm.propertyType]} with list`,
      orderCheckList
    );
    const getInvalidOrderMatcherTips = (segmentIndex) => {
      const errors = [];
      for (let direction = 0; direction < orderCheckList.length; direction++) {
        const propertyTypes2 = orderCheckList[direction];
        const invalidOrderResultLabels = [];
        for (const pt of propertyTypes2) {
          const pmrs = allPropertyMatchResults.filter((r) => r.pmv.property.type == pt) || [];
          for (const pmr of pmrs) {
            if (pmr.result) {
              const mr = pmr.result;
              const si = mr.index;
              if (si != void 0 && (direction == 0 && si <= segmentIndex || direction == 1 && si >= segmentIndex)) {
                invalidOrderResultLabels.push(
                  pmr.pmv.property.toString(t, pmr.indexByProperty)
                );
              }
            }
          }
        }
        if (invalidOrderResultLabels.length > 0) {
          errors.push(
            t(
              `{{target}} should come ${direction == 1 ? "after" : "before"} {{invalidMatchers}}`,
              {
                target: t(PscPropertyType[vm.propertyType]),
                invalidMatchers: invalidOrderResultLabels.join(",")
              }
            )
          );
        }
      }
      return errors;
    };
    const readonly = !configurableMatchers.includes(vm);
    for (const pmr of propertyMatchResultsOfMatcher) {
      const r = pmr.result;
      log(
        `Checking result ${pmr.indexByProperty} of ${pmr.pmv.property.toString(t, pmr.indexByProperty)}`,
        r
      );
      if (r == void 0) {
        data.globalErrors.push(
          new SimpleGlobalError(
            pmr.pmv.property,
            pmr.indexByProperty,
            t("Match failed"),
            true,
            pmr.pmv.value.valueType != ResourceMatcherValueType.Regex
          )
        );
      } else {
        if (r.type == MatchResultType.Layer) {
          if (r.index != void 0) {
            const segmentIndex = r.index;
            const segment = data.segments[segmentIndex];
            let mr = segment.matchResults.find(
              (a) => a.property.equals(pmr.pmv.property) && a.valueIndex == pmr.indexByProperty
            );
            if (!mr) {
              mr = new SimpleMatchResult(pmr.pmv.property, pmr.indexByProperty);
              mr.readonly = readonly;
              segment.matchResults.push(mr);
            }
            const errors = getInvalidOrderMatcherTips(segmentIndex);
            for (const t2 of errors) {
              mr.errors.push(t2);
            }
          }
        } else {
          if (r.type == MatchResultType.Regex) {
            data.globalMatches.push(
              new SimpleGlobalMatchResult(
                pmr.pmv.property,
                pmr.indexByProperty,
                r.matches
              )
            );
          }
        }
      }
    }
    let resourceRegexTargetText = "";
    let commonRegexTargetText = "";
    if (rootSegmentIndex != void 0) {
      resourceRegexTargetText = segments.slice(rootSegmentIndex + 1).join("/");
      if (resourceSegmentIndex != void 0) {
        commonRegexTargetText = segments.slice(rootSegmentIndex + 1, resourceSegmentIndex + 1).join("/");
      }
    }
    log(
      `Resource regex target: [${resourceRegexTargetText}], Common regex target: [${commonRegexTargetText}]`
    );
    for (let i = 0; i < segments.length; i++) {
      const ds2 = data.segments[i];
      const sm = new SelectiveMatcher({
        propertyType: vm.propertyType,
        readonly,
        replaceCurrent: !vm.multiple && propertyMatchResultsOfMatcher.length > 0
      });
      if (!readonly) {
        if (missingPrerequisites.length == 0) {
          if (vm.propertyType != PscPropertyType.RootPath) {
            const r = sm.matchModes.regex;
            if ((commonRegexTargetText == null ? void 0 : commonRegexTargetText.length) > 0 || vm.propertyType == PscPropertyType.Resource && (resourceRegexTargetText == null ? void 0 : resourceRegexTargetText.length) > 0) {
              r.text = vm.propertyType == PscPropertyType.Resource ? resourceRegexTargetText : commonRegexTargetText;
              r.available = true;
            } else {
              r.errors.push(t("Match target is not found"));
            }
          }
          const errors = getInvalidOrderMatcherTips(i);
          if (vm.propertyType == PscPropertyType.RootPath) {
            const oc = sm.matchModes.oneClick;
            if (errors.length == 0) {
              oc.available = true;
            } else {
              for (const t2 of errors) {
                sm.errors.push(t2);
              }
            }
          } else {
            const l = sm.matchModes.layer;
            if (errors.length == 0) {
              const layers = [];
              if (rootSegmentIndex != void 0 && rootSegmentIndex > -1) {
                layers.push(i - rootSegmentIndex);
                if (resourceSegmentIndex != void 0 && resourceSegmentIndex > -1 && vm.propertyType != PscPropertyType.Resource) {
                  layers.push(i - resourceSegmentIndex);
                }
              }
              l.layers = layers;
              l.available = true;
            } else {
              for (const t2 of errors) {
                l.errors.push(t2);
              }
            }
          }
        } else {
          sm.errors.push(missingPrerequisitesTip);
        }
      } else {
        sm.errors.push(t("Readonly"));
      }
      ds2.selectiveMatchers.push(sm);
    }
  }
  data.segments.forEach((s) => {
    s.disabled = s.selectiveMatchers.length == 0 || s.selectiveMatchers.every((e) => !e.isConfigurable);
  });
  log("Context", data);
  return data;
};
const ByRegex = ({
  onRegexChange,
  modeIsSelected,
  onSelectMode,
  regex,
  textToBeMatched,
  isResourceProperty
}) => {
  const { t } = useTranslation();
  const [testResult, setTestResult] = reactExports.useState();
  const [value, setValue] = reactExports.useState(regex);
  if (!textToBeMatched) {
    return null;
  }
  const renderTestResult = () => {
    if (testResult) {
      if (!testResult.success) {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1", children: [
          testResult.error && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              Chip,
              {
                color: "danger",
                size: "sm",
                startContent: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, { className: "text-sm" }),
                variant: "light",
                children: testResult.error
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("br", {})
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { color: "danger", size: "sm", variant: "light", children: t("Test failed, please check your regex") })
        ] });
      } else {
        let { tip } = testResult;
        let values;
        if (testResult.groups != void 0) {
          values = testResult.groups;
        } else {
          if (testResult.text != void 0 && testResult.text.length > 0) {
            const sub = textToBeMatched.substring(
              0,
              testResult.index + testResult.text.length
            );
            const segments = splitPathIntoSegments(sub);
            const match = splitPathIntoSegments(textToBeMatched)[segments.length - 1];
            values = match == void 0 ? [] : [match];
          }
        }
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1", children: [
          tip && /* @__PURE__ */ jsxRuntimeExports.jsx(
            Chip,
            {
              color: "warning",
              size: "sm",
              startContent: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$5, { className: "text-sm" }),
              variant: "light",
              children: tip
            }
          ),
          values && values.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap gap-1 items-center", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold", children: t("Match result") }),
            values.map((v) => /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { radius: "sm", size: "sm", children: v }))
          ] })
        ] });
      }
    }
    return;
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { isHoverable: true, className: "mb-2 cursor-pointer w-full", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(card_header_default, { className: "text-lg font-bold", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        radio_group_default,
        {
          value: modeIsSelected ? "regex" : "",
          onValueChange: onSelectMode,
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(radio_default, { value: "regex", children: t("Set by {{thing}}", { thing: t("regex") }) })
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tooltip,
        {
          content: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
            t("/ is the directory separator always, not \\"),
            /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
            t(
              "The whole matched text will be ignored if capturing groups are used"
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsx("br", {}),
            t(
              "You should not use capturing groups on Resource property due to partial path is not available to match a file system entry"
            )
          ] }),
          children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$3, { className: "text-base ml-2" })
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2 mb-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: t("Text to be matched") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { color: "success", size: "sm", variant: "light", children: textToBeMatched })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          input_default,
          {
            isClearable: true,
            "aria-label": "please input",
            style: { width: "100%" },
            value,
            onClear: () => {
              setValue(void 0);
            },
            onClick: () => {
              if (!modeIsSelected) {
                onSelectMode();
              }
            },
            onValueChange: (v) => {
              setValue(v);
            }
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            disabled: value == void 0,
            onClick: () => {
              if (value) {
                try {
                  const v = getResultFromExecAll(
                    new RegExp(value),
                    textToBeMatched
                  );
                  console.log(v, isResourceProperty);
                  if (v && v.groups && v.groups.length > 0 && isResourceProperty) {
                    throw new Error(
                      t(
                        "Capturing groups are not allowed on Resource property"
                      )
                    );
                  }
                  let tip;
                  if (v) {
                    if (v.groups && v.groups.length > 0) {
                      tip = t(
                        "Capturing groups are used, only matched text will be applied"
                      );
                    } else {
                      if (v.text != void 0 && v.text.length > 0) {
                        tip = t(
                          "Whole segment will be applied if capturing group is not used"
                        );
                      }
                    }
                  } else {
                    tip = t(
                      "No text was matched, but you can still save the regular expression."
                    );
                  }
                  setTestResult({
                    success: true,
                    ...v,
                    tip
                  });
                  onRegexChange(value);
                } catch (e) {
                  setTestResult({
                    success: false,
                    error: e.message
                  });
                }
              }
            },
            children: t("Test")
          }
        )
      ] }),
      renderTestResult()
    ] }) })
  ] });
};
ByRegex.displayName = "ByRegex";
class SegmentMatcherConfigurationModesData {
  constructor(init) {
    __publicField(this, "layers", []);
    __publicField(this, "regex");
    Object.assign(this, init);
  }
  get isConfigurable() {
    var _a;
    return this.layers.length > 0 || ((_a = this.regex) == null ? void 0 : _a.text) != void 0;
  }
  get isFullConfigurable() {
    var _a;
    return this.layers.length > 0 && ((_a = this.regex) == null ? void 0 : _a.text) != void 0;
  }
}
const getDefaultValue = (modesData) => {
  if (modesData) {
    if (modesData.layers.length > 0) {
      return {
        layer: modesData.layers[0]
      };
    }
  }
  return;
};
const PathSegmentRenderOptions = {
  root: {
    color: "warning",
    tip: "Segment of root path"
  },
  resource: {
    color: "warning",
    tip: "Segment of resource"
  },
  current: {
    color: "primary",
    tip: "Current segment"
  }
};
const SegmentMatcherConfiguration = ({
  defaultValue,
  modesData = new SegmentMatcherConfigurationModesData(),
  onSubmit,
  property,
  segments,
  segmentMarkers,
  ...props
}) => {
  var _a;
  const { t } = useTranslation();
  const defaultMode = modesData.layers.length > 0 ? "layer" : Object.keys(modesData)[0];
  const [mode, setMode] = reactExports.useState(defaultMode);
  const [value, setValue] = reactExports.useState(
    defaultValue ?? getDefaultValue(modesData)
  );
  useUpdateEffect(() => {
    switch (mode) {
      case "layer":
        break;
      case "regex":
        setValue({
          ...value || {},
          layer: void 0
        });
        break;
    }
  }, [mode]);
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    Modal,
    {
      defaultVisible: true,
      footer: {
        actions: ["ok", "cancel"],
        okProps: {
          isDisabled: !value || mode == "layer" && !value.layer || mode == "regex" && !value.regex
        }
      },
      size: "lg",
      title: t("Configure [{{property}}] property for path segment", {
        property: property.name
      }),
      onDestroyed: props.onDestroyed,
      onOk: async () => {
        onSubmit == null ? void 0 : onSubmit(
          new PscMatcherValue({
            ...value,
            valueType: mode == "layer" ? ResourceMatcherValueType.Layer : ResourceMatcherValueType.Regex
          })
        );
      },
      children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold", children: t("Path segment") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-1 mb-2", children: segments.map((segment, index) => {
          const marker = segmentMarkers[index];
          const options = PathSegmentRenderOptions[marker];
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
            options != void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx(Tooltip, { content: t(options.tip), children: /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { color: options.color, variant: "light", children: segment }) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: segment }),
            index != segments.length - 1 && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "", children: "/" })
          ] });
        }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ByLayer,
          {
            layers: modesData.layers,
            modeIsSelected: mode == "layer",
            selectedLayer: value == null ? void 0 : value.layer,
            onSelectLayer: (layer) => {
              if (mode != "layer") {
                setMode("layer");
              }
              setValue({
                ...value,
                layer
              });
            },
            onSelectMode: () => {
              setMode("layer");
            }
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          ByRegex,
          {
            isResourceProperty: property.id == ResourceProperty.Resource && !property.isCustom,
            modeIsSelected: mode == "regex",
            regex: value == null ? void 0 : value.regex,
            textToBeMatched: (_a = modesData.regex) == null ? void 0 : _a.text,
            onRegexChange: (v) => {
              setValue({
                ...value,
                regex: v
              });
            },
            onSelectMode: () => {
              setMode("regex");
            }
          }
        )
      ] })
    }
  );
};
SegmentMatcherConfiguration.displayName = "SegmentMatcherConfiguration";
const Segments = ({
  segments,
  isDirectory,
  value,
  onChange,
  onDeleteMatcherValue,
  visibleMatchers
}) => {
  const { t } = useTranslation();
  const { createPortal } = useBakabaseContext();
  const rootDomRef = reactExports.useRef(null);
  const buildMatchModeTip = (name, icon, available, errors) => {
    const inner = /* @__PURE__ */ jsxRuntimeExports.jsx(
      Chip,
      {
        color: available ? "success" : "warning",
        radius: "sm",
        size: "sm",
        startContent: icon,
        variant: "faded",
        children: t(available ? "{{mode}} mode is available" : "{{mode}} mode is unavailable", {
          mode: name
        })
      }
    );
    if (available || errors.length == 0) {
      return inner;
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      Tooltip,
      {
        content: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: errors.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("ul", { children: errors.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e })) }) }),
        children: inner
      }
    );
  };
  const buildSelectiveMatcherRightContent = (m) => {
    const { layer: l, regex: r, oneClick: o } = m.matchModes;
    const showReplace = m.isConfigurable && m.replaceCurrent;
    const firstLineNodes = [
      buildMatchModeTip(
        t("Layer"),
        /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon, { className: "text-sm" }),
        l.available,
        l.errors
      ),
      buildMatchModeTip(
        t("Regex"),
        /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$2, { className: "text-sm" }),
        r.available,
        r.errors
      )
    ];
    if (showReplace) {
      firstLineNodes.push(
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Chip,
          {
            color: "warning",
            radius: "sm",
            size: "sm",
            startContent: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$1, { className: "text-sm" }),
            variant: "faded",
            children: t("Selected value will be replaced")
          }
        )
      );
    }
    return firstLineNodes;
  };
  const selectMatcher = (c, property, newValue) => {
    let pvs = value.filter((v) => v.property.equals(property));
    const nv = value.filter((v) => !pvs.includes(v));
    if (!c.multiple) {
      pvs.splice(0, pvs.length);
    }
    const sameValue = pvs.find((v) => {
      var _a;
      return v.property.equals(property) && ((_a = v.value) == null ? void 0 : _a.equals(newValue));
    });
    if (!sameValue) {
      pvs.push({
        property,
        value: newValue
      });
    }
    nv.push(...pvs);
    console.log("Changing value", nv, c, property, newValue, sameValue);
    onChange([...nv]);
  };
  const renderSegments = () => {
    if (segments.length > 0) {
      const elements = [];
      const rootPathSegmentIndex = segments.findIndex(
        (s) => s.matchResults.some((b) => b.property.isRootPath)
      );
      const resourceSegmentIndex = segments.findIndex(
        (s) => s.matchResults.some((b) => b.property.isResource)
      );
      for (let i = 0; i < segments.length; i++) {
        if (i > 0) {
          elements.push(
            /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-xl", style: { color: "var(--bakaui-warning)" }, children: "/" })
          );
        }
        const { text, selectiveMatchers = [], matchResults = [], disabled } = segments[i];
        const sc = /* @__PURE__ */ jsxRuntimeExports.jsxs(
          "div",
          {
            className: `${disabled ? "cursor-default opacity-60" : "cursor-pointer"} px-2 py-1 hover:bg-[var(--bakaui-default)] rounded`,
            children: [
              matchResults.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-start gap-1 flex-wrap", children: matchResults.map((mr) => {
                var _a;
                const { property, errors = [] } = mr;
                const hasError = errors.length > 0;
                const values = value.filter((v2) => v2.property.equals(mr.property));
                const v = (_a = values[mr.valueIndex ?? 0]) == null ? void 0 : _a.value;
                let colorKey = "primary";
                if (!mr.property.isCustom && (mr.property.id == ResourceProperty.Resource || mr.property.id == ResourceProperty.RootPath)) {
                  colorKey = "success";
                }
                if (hasError) {
                  colorKey = "danger";
                }
                const comp = /* @__PURE__ */ jsxRuntimeExports.jsxs(
                  Chip,
                  {
                    color: colorKey,
                    radius: "sm",
                    size: "sm",
                    variant: "bordered",
                    onClose: !mr.readonly ? () => {
                      onDeleteMatcherValue(mr.property, mr.valueIndex);
                    } : void 0,
                    children: [
                      hasError && /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, { className: "text-sm" }),
                      property.toString(t, mr.valueIndex),
                      " ",
                      v && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: PscMatcherValue.ToString(t, v) })
                    ]
                  }
                );
                if (hasError) {
                  return /* @__PURE__ */ jsxRuntimeExports.jsx(
                    Tooltip,
                    {
                      content: errors.map((e) => {
                        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
                          "div",
                          {
                            className: "error",
                            style: {
                              display: "flex",
                              alignItems: "center",
                              gap: 2,
                              color: "red"
                            },
                            children: [
                              /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$4, { className: "text-sm" }),
                              e
                            ]
                          }
                        );
                      }),
                      placement: "top",
                      children: comp
                    }
                  );
                } else {
                  return comp;
                }
              }) }),
              rootDomRef.current && /* @__PURE__ */ jsxRuntimeExports.jsx(
                PopoverComponent,
                {
                  portalContainer: rootDomRef.current,
                  trigger: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-lg", children: text }),
                  children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold text-xl", children: t("Mark this path segment as") }) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
                      listbox_default,
                      {
                        disabledKeys: selectiveMatchers.filter((m) => !m.isConfigurable).map((m) => selectiveMatchers.indexOf(m)).map((x) => x.toString()),
                        variant: "bordered",
                        onAction: (k) => {
                          console.log("on action", k);
                          const m = selectiveMatchers[k];
                          if (m.isConfigurable) {
                            const o = m.matchModes.oneClick;
                            if (o.available) {
                              selectMatcher(
                                visibleMatchers.find((t2) => t2.propertyType == m.propertyType),
                                PscProperty.fromPscType(m.propertyType),
                                new PscMatcherValue({
                                  valueType: ResourceMatcherValueType.FixedText,
                                  fixedText: segments.map((s) => s.text).slice(0, i + 1).join(BusinessConstants.pathSeparator)
                                })
                              );
                            } else {
                              if (m.useSmc) {
                                const props = {
                                  segments: segments.map((s) => s.text),
                                  segmentMarkers: {
                                    [rootPathSegmentIndex]: "root",
                                    [resourceSegmentIndex]: "resource",
                                    [i]: "current"
                                  },
                                  modesData: m.buildModesData()
                                };
                                switch (m.propertyType) {
                                  case PscPropertyType.RootPath:
                                  case PscPropertyType.ParentResource:
                                  case PscPropertyType.Resource:
                                  case PscPropertyType.Rating:
                                  case PscPropertyType.Introduction: {
                                    const property = PscProperty.fromPscType(m.propertyType);
                                    createPortal(SegmentMatcherConfiguration, {
                                      ...props,
                                      property,
                                      onSubmit: (value2) => {
                                        selectMatcher(
                                          visibleMatchers.find(
                                            (t2) => t2.propertyType == m.propertyType
                                          ),
                                          property,
                                          value2
                                        );
                                      }
                                    });
                                    break;
                                  }
                                  case PscPropertyType.CustomProperty: {
                                    createPortal(PropertySelector, {
                                      v2: true,
                                      pool: PropertyPool.Custom,
                                      multiple: false,
                                      addable: true,
                                      onSubmit: async (selection) => {
                                        const p = selection[0];
                                        const property = new PscProperty({
                                          id: p.id,
                                          isCustom: true,
                                          name: p.name
                                        });
                                        createPortal(SegmentMatcherConfiguration, {
                                          ...props,
                                          property,
                                          onSubmit: (value2) => {
                                            selectMatcher(
                                              visibleMatchers.find(
                                                (t2) => t2.propertyType == m.propertyType
                                              ),
                                              property,
                                              value2
                                            );
                                          }
                                        });
                                      }
                                    });
                                    break;
                                  }
                                }
                              }
                            }
                          }
                        },
                        children: selectiveMatchers.map((m, i2) => {
                          const rightContents = buildSelectiveMatcherRightContent(m);
                          return /* @__PURE__ */ jsxRuntimeExports.jsx(
                            listbox_item_base_default,
                            {
                              description: m.errors.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
                                "ul",
                                {
                                  className: "mt-1 flex flex-wrap gap-1",
                                  style: { color: "var(--bakaui-danger)" },
                                  children: m.errors.map((e) => /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: e }))
                                }
                              ),
                              children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-4", children: [
                                /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-base", children: t(PscPropertyType[m.propertyType]) }),
                                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: rightContents })
                              ] })
                            },
                            i2
                          );
                        })
                      }
                    ) }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "italic opacity-60 mt-1", children: t(
                      "Some properties may not able to set by layer, but you still can set it by regex."
                    ) })
                  ] })
                }
              )
            ]
          },
          i
        );
        elements.push(sc);
      }
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap items-center gap-1", children: elements });
    }
  };
  if (segments.length == 0) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(
    "div",
    {
      ref: rootDomRef,
      className: "path-segments-container flex items-center gap-2 border-small px-2 py-1 rounded-small border-default-200",
      children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-[24px] h-[24px] flex items-center justify-center", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          FileSystemEntryIcon,
          {
            path: segments.map((s) => s.text).join("/"),
            size: 24,
            type: isDirectory ? IconType.Directory : IconType.Dynamic
          }
        ) }),
        renderSegments()
      ]
    }
  );
};
Segments.displayName = "Segments";
const FileExtensionLoader = ({
  segments,
  value,
  isDirectory,
  matchers,
  onChange
}) => {
  var _a, _b;
  const { t } = useTranslation();
  const { createPortal } = useBakabaseContext();
  const [fileResource, setFileResource] = reactExports.useState();
  const [fileResourceExtensions, setFileResourceExtensions] = reactExports.useState();
  const [fileResourceExtensionCandidates, setFileResourceExtensionCandidates] = reactExports.useState([]);
  const [loadingFileResourceExtensions, setLoadingFileResourceExtensions] = reactExports.useState(false);
  const resourceMatcherMatchesLastLayerRef = reactExports.useRef(false);
  const fileSegments = (fileResource == null ? void 0 : fileResource.split(".")) ?? [];
  let currentFileExt;
  if ((fileSegments == null ? void 0 : fileSegments.length) > 1) {
    currentFileExt = `.${fileSegments[fileSegments.length - 1]}`;
  }
  reactExports.useEffect(() => {
    var _a2, _b2;
    if (!isDirectory) {
      if (matchers.some(
        (a) => a.propertyType == PscPropertyType.Resource && !a.readonly
      )) {
        const resourceMatcherValue = (_a2 = value[ResourceProperty.Resource]) == null ? void 0 : _a2[0];
        if (resourceMatcherValue) {
          const rootMatch = PscMatcher.matchFirst(
            segments,
            value.filter((v) => v.property.isRootPath && v.value != void 0).map((v) => v.value)
          );
          const rootSegmentIndex2 = (rootMatch == null ? void 0 : rootMatch.index) ?? -1;
          const resourceSegmentIndex = ((_b2 = PscMatcher.match(
            segments,
            resourceMatcherValue,
            rootSegmentIndex2,
            segments.length
          )) == null ? void 0 : _b2.index) ?? -1;
          if (resourceSegmentIndex > -1) {
            const resourceMatcherMatchesLastLayer = resourceSegmentIndex == segments.length - 1;
            if (resourceMatcherMatchesLastLayer != resourceMatcherMatchesLastLayerRef.current) {
              resourceMatcherMatchesLastLayerRef.current = resourceMatcherMatchesLastLayer;
              if (resourceMatcherMatchesLastLayer) {
                setFileResource(segments.join("/"));
              } else {
                setFileResource(void 0);
              }
            }
          }
        }
      }
    }
  }, [value]);
  useUpdateEffect(() => {
    if (fileResource == void 0) {
      setFileResourceExtensions(void 0);
      setFileResourceExtensionCandidates([]);
    }
  }, [fileResource]);
  if (fileResource == void 0) {
    return null;
  }
  const rootSegmentIndex = ((_b = PscMatcher == null ? void 0 : PscMatcher.match(
    segments,
    (_a = value.find((v) => v.property.isRootPath)) == null ? void 0 : _a.value,
    -1,
    void 0
  )) == null ? void 0 : _b.index) ?? -1;
  const rootPathIsSelected = rootSegmentIndex > -1;
  const loaderBtn = /* @__PURE__ */ jsxRuntimeExports.jsx(
    Button,
    {
      color: "primary",
      isDisabled: !rootPathIsSelected,
      isLoading: loadingFileResourceExtensions,
      onClick: () => {
        setLoadingFileResourceExtensions(true);
        BApi.file.getFileExtensionCounts({
          sampleFile: fileResource,
          rootPath: segments.slice(0, rootSegmentIndex + 1).join(BusinessConstants.pathSeparator)
        }).then((a) => {
          if (!a.code) {
            const counts = a.data ?? {};
            const list = Object.keys(counts).sort((x, y) => counts[y] - counts[x]).map((b) => ({
              ext: b,
              count: counts[b]
            }));
            setFileResourceExtensions(list);
            if (currentFileExt) {
              setFileResourceExtensionCandidates([currentFileExt]);
              const newRegex = buildLayerBasedPathRegexString(
                segments.length - rootSegmentIndex - 1,
                [currentFileExt]
              );
              const newValue = value.filter(
                (x) => !x.property.equals(PscProperty.Resource)
              );
              newValue.push({
                property: PscProperty.Resource,
                value: PscMatcherValue.Regex(newRegex)
              });
              onChange(newValue);
            }
          }
        }).finally(() => {
          setLoadingFileResourceExtensions(false);
        });
      },
      children: t("I need choose files with specific types as resources")
    }
  );
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "file-resource-helper psc-block", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "title", children: t("Match by file extensions") }),
    fileResourceExtensions == void 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Message, { type: "warning", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        t(
          "Please pay attention, you marked a file as a resource. We'll treat all files or folders with same path layer as resources by default. It may not be your actual design(if you chose a movie and its subtitle file has the same path layer, then the subtitle file will be another resource)."
        ),
        t(
          "If you want to mark resources with specific file types, you can click button below to load all file types and select some of them."
        )
      ] }) }),
      rootPathIsSelected ? loaderBtn : /* @__PURE__ */ jsxRuntimeExports.jsx(PopoverComponent, { align: "t", trigger: loaderBtn, triggerType: "hover", children: t("Please select root path first.") })
    ] }) : fileResourceExtensions.length > 0 ? /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Message, { type: "notice", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
        t("You can mark resources by file types."),
        fileResourceExtensionCandidates.length > 0 ? `${t("You selected {{count}} file types:", { count: fileResourceExtensionCandidates.length })}${fileResourceExtensionCandidates.join(", ")}` : t(
          "None of file types has been selected, we'll treat all files or folders with same path layer as your file as resources."
        )
      ] }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tag.Group, { style: { marginTop: 5 }, children: fileResourceExtensions.map((e) => {
        return /* @__PURE__ */ jsxRuntimeExports.jsxs(
          Tag.Selectable,
          {
            checked: fileResourceExtensionCandidates.indexOf(e.ext) > -1,
            size: "small",
            onChange: (c) => {
              const candidates = fileResourceExtensionCandidates || [];
              const idx = candidates.indexOf(e.ext);
              const apply = (candidates2) => {
                const newRegex = buildLayerBasedPathRegexString(
                  segments.length - rootSegmentIndex - 1,
                  candidates2
                );
                const newValue = value.filter(
                  (x) => !x.property.equals(PscProperty.Resource)
                );
                newValue.push({
                  property: PscProperty.Resource,
                  value: PscMatcherValue.Regex(newRegex)
                });
                setFileResourceExtensionCandidates([...candidates2]);
              };
              if (idx == -1) {
                candidates.push(e.ext);
              } else {
                if (e.ext == currentFileExt) {
                  createPortal(Modal, {
                    defaultVisible: true,
                    title: t(
                      "You are deselecting extension same as file you selected"
                    ),
                    children: t(
                      "After your deselection, the current file will not be treat as a resource, and you need reset the Resource part from path segments, are you sure to remove file type: {{ext}}?",
                      { ext: currentFileExt }
                    ),
                    onOk: () => async () => {
                      candidates.splice(idx, 1);
                      apply(candidates);
                    }
                  });
                  return;
                } else {
                  candidates.splice(idx, 1);
                }
              }
              apply(candidates);
            },
            children: [
              e.ext,
              " ",
              /* @__PURE__ */ jsxRuntimeExports.jsx(
                badge_default,
                {
                  count: e.count,
                  overflowCount: 99999999,
                  style: { backgroundColor: "#87d068" }
                }
              )
            ]
          }
        );
      }) })
    ] }) : /* @__PURE__ */ jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, { children: t("No known file type is found.") })
  ] });
};
FileExtensionLoader.displayName = "FileExtensionLoader";
const GlobalMatches = ({ matches, value, onDeleteMatcherValue }) => {
  const { t } = useTranslation();
  if (matches.length > 0) {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col mt-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-bold mb-1", children: t("Global matches") }),
      matches.map((gm) => {
        var _a, _b;
        const v = (_b = (_a = value == null ? void 0 : value.filter((v2) => v2.property.equals(gm.property))) == null ? void 0 : _a[gm.valueIndex ?? 0]) == null ? void 0 : _b.value;
        return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-center", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { radius: "sm", size: "sm", children: gm.property.toString(t, gm.valueIndex) }),
          v && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: PscMatcherValue.ToString(t, v) }),
          t("Matched {{count}} results", {
            count: gm.matches.length
          }),
          gm.matches.map((m) => /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { radius: "sm", size: "sm", children: m })),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              isIconOnly: true,
              color: "danger",
              size: "sm",
              variant: "light",
              onClick: () => {
                onDeleteMatcherValue(gm.property, gm.valueIndex);
              },
              children: /* @__PURE__ */ jsxRuntimeExports.jsx(RefIcon$6, { className: "text-base" })
            }
          )
        ] });
      })
    ] });
  }
  return null;
};
GlobalMatches.displayName = "GlobalMatches";
const Validate = ({ isDisabled, value }) => {
  const { t } = useTranslation();
  const [loading, setLoading] = reactExports.useState(false);
  const [result, setResult] = reactExports.useState();
  const buttonRef = reactExports.useRef(null);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Button,
      {
        ref: buttonRef,
        color: "primary",
        disabled: isDisabled,
        isLoading: loading,
        size: "small",
        onClick: () => {
          setLoading(true);
          BApi.mediaLibrary.validatePathConfiguration(
            convertToPathConfigurationDtoFromPscValue(value)
          ).then((t2) => {
            setResult(t2.data);
          }).finally(() => {
            setLoading(false);
          });
        },
        children: t("Validate")
      }
    ),
    buttonRef.current && /* @__PURE__ */ jsxRuntimeExports.jsx(
      Modal,
      {
        footer: {
          actions: ["cancel"],
          cancelProps: {
            children: t("Close")
          }
        },
        portalContainer: buttonRef.current,
        size: "xl",
        title: t(
          "Found top {{count}} resources. (shows up to 100 results)",
          { count: ((result == null ? void 0 : result.resources) || []).length }
        ),
        visible: !!result,
        onClose: () => {
          setResult(void 0);
        },
        children: /* @__PURE__ */ jsxRuntimeExports.jsx("section", { className: "mt-1", children: result && result.resources && result.resources.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mt-1 flex flex-col gap-1", children: result.resources.map((e, i) => {
          var _a, _b, _c, _d, _e;
          const {
            globalMatchedValues,
            isDirectory,
            segmentAndMatchedValues
          } = e;
          console.log(globalMatchedValues);
          const segments = [];
          for (let j = 0; j < (segmentAndMatchedValues == null ? void 0 : segmentAndMatchedValues.length); j++) {
            const ps = segmentAndMatchedValues[j];
            const matchLabels = [];
            if (j == segmentAndMatchedValues.length - 1) {
              matchLabels.push(
                t(ResourceProperty[ResourceProperty.Resource])
              );
            }
            if (((_a = ps.propertyKeys) == null ? void 0 : _a.length) > 0) {
              for (const p of ps.propertyKeys) {
                if (p.isCustom) {
                  const pName = (_c = (_b = result.customPropertyMap) == null ? void 0 : _b[p.id]) == null ? void 0 : _c.name;
                  matchLabels.push(
                    pName ?? t("Unknown property")
                  );
                } else {
                  matchLabels.push(t(ResourceProperty[p.id]));
                }
              }
            }
            segments.push(
              /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col", children: [
                matchLabels.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "div",
                  {
                    className: `text-sm ${matchLabels.length > 1 ? "conflict" : ""}`,
                    style: {
                      color: matchLabels.length > 1 ? "var(--bakaui-danger)" : "var(--bakaui-primary)"
                    },
                    children: matchLabels.join(", ")
                  }
                ),
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm", children: ps.segmentText })
              ] })
            );
            if (j != e.segmentAndMatchedValues.length - 1) {
              segments.push(
                /* @__PURE__ */ jsxRuntimeExports.jsx(
                  "span",
                  {
                    className: "",
                    style: { color: "var(--bakaui-warning)" },
                    children: "/"
                  }
                )
              );
            }
          }
          const globalMatchesElements = [];
          if (globalMatchedValues.length > 0) {
            for (const gmv of globalMatchedValues) {
              const { textValues, propertyKey } = gmv;
              const propertyLabel = propertyKey.isCustom ? ((_e = (_d = result.customPropertyMap) == null ? void 0 : _d[propertyKey.id]) == null ? void 0 : _e.name) ?? t("Unknown property") : t(ResourceProperty[propertyKey.id]);
              if ((textValues == null ? void 0 : textValues.length) > 0) {
                globalMatchesElements.push(
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-sm font-bold", children: propertyLabel }),
                    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-wrap gap-1", children: textValues.map((v) => /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { radius: "sm", size: "sm", children: v })) })
                  ] })
                );
              }
            }
          }
          return /* @__PURE__ */ jsxRuntimeExports.jsxs(
            "div",
            {
              className: "flex items-center p-1 rounded border-default-200",
              children: [
                /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "mr-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Chip, { radius: "sm", size: "sm", children: i + 1 }) }),
                /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grow flex flex-col gap-1", children: [
                  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-1", children: [
                    /* @__PURE__ */ jsxRuntimeExports.jsx(MdCheckCircle, { className: "text-base" }),
                    segments
                  ] }),
                  globalMatchesElements.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-start flex-wrap gap-1 border-default-200 pt-1", children: globalMatchesElements })
                ] })
              ]
            }
          );
        }) }) })
      }
    )
  ] });
};
Validate.displayName = "Validate";
const BottomOperations = ({ value, hasError }) => {
  const { t } = useTranslation();
  const { createPortal } = useBakabaseContext();
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Validate, { isDisabled: hasError, value }) });
};
BottomOperations.displayName = "BottomOperations";
class PathSegmentConfigurationPropsMatcherOptions {
  constructor(init) {
    __publicField(this, "propertyType");
    __publicField(this, "readonly", false);
    Object.assign(this, init);
  }
}
const PathSegmentsConfigurationInner = React.forwardRef(
  (props, ref) => {
    useTraceUpdate(props, "PathSegmentsConfiguration");
    const {
      segments = [],
      isDirectory,
      matchers = [],
      defaultValue,
      onChange = (v) => {
      }
    } = props;
    const log = buildLogger("PathSegmentsConfiguration");
    log("Rendering with props", props);
    const { t } = useTranslation();
    const forceUpdate = useUpdate();
    const { createPortal } = useBakabaseContext();
    const [value, setValue] = reactExports.useState(
      defaultValue ?? []
    );
    const valueRef = reactExports.useRef(value);
    const visibleMatchers = matchers.map((a) => allMatchers.find((b) => b.propertyType == a.propertyType)).filter((x) => x).sort((a, b) => a.checkOrder - b.checkOrder);
    const configurableMatchers = matchers.filter((a) => !a.readonly).map(
      (a) => visibleMatchers.find((b) => b.propertyType == a.propertyType)
    );
    const [customPropertyNameMap, setCustomPropertyNameMap] = reactExports.useState({});
    reactExports.useEffect(() => {
      valueRef.current = value;
      log("Changed:", JSON.parse(JSON.stringify(value)));
      onChange(value);
    }, [value]);
    useUpdateEffect(() => {
      value.forEach((v) => {
        var _a;
        if (v.property.isCustom) {
          (_a = v.property).name ?? (_a.name = customPropertyNameMap[v.property.id]);
        }
      });
      forceUpdate();
    }, [customPropertyNameMap]);
    reactExports.useEffect(() => {
      BApi.customProperty.getAllCustomProperties().then((x) => {
        const data = x.data ?? [];
        const pnMap = data.reduce((s, t2) => {
          s[t2.id] = t2.name;
          return s;
        }, {});
        setCustomPropertyNameMap(pnMap);
      });
    }, []);
    reactExports.useImperativeHandle(
      ref,
      () => ({
        get context() {
          return BuildPscContext(
            segments,
            value,
            visibleMatchers,
            configurableMatchers,
            t,
            log
          );
        }
      }),
      [segments, value, visibleMatchers, configurableMatchers]
    );
    const onDeleteMatcherValue = (property, valueIndex = 0) => {
      createPortal(Modal, {
        defaultVisible: true,
        title: t("Sure to delete this property?"),
        onOk: () => {
          var _a;
          const bad = (_a = value == null ? void 0 : value.filter((v) => v.property.equals(property))) == null ? void 0 : _a[valueIndex ?? 0];
          setValue(value.filter((v) => v != bad));
        }
      });
    };
    const ctx = BuildPscContext(
      segments,
      value,
      visibleMatchers,
      configurableMatchers,
      t,
      log
    );
    return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "path-segments-configuration flex flex-col gap-1", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tips, {}),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Errors,
        {
          errors: ctx.globalErrors,
          value,
          onDeleteMatcherValue
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Segments,
        {
          isDirectory,
          segments: ctx.segments,
          value,
          visibleMatchers,
          onChange: setValue,
          onDeleteMatcherValue
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        FileExtensionLoader,
        {
          isDirectory,
          matchers,
          segments,
          value,
          onChange: (v) => setValue(v)
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        GlobalMatches,
        {
          matches: ctx.globalMatches,
          value,
          onDeleteMatcherValue
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(BottomOperations, { hasError: ctx.preventSubmitting, value })
    ] });
  }
);
const PathSegmentsConfiguration = React.memo(PathSegmentsConfigurationInner);
PathSegmentsConfiguration.displayName = "PathSegmentsConfiguration";
const testData = {
  path: "D:/test",
  rpmValues: [
    {
      layer: 1,
      propertyId: 3,
      isReservedProperty: true,
      valueType: ResourceMatcherValueType.Layer
    }
    // {
    //   layer: 3,
    //   propertyId: 3,
    //   isReservedProperty: true,
    //   valueType: ResourceMatcherValueType.Layer,
    // },
    // {
    //   regex: '^[^\\/]+\\/[^\\/]+\\/[^\\/]+\\/[^\\/]+$',
    //   propertyId: 2,
    //   isReservedProperty: true,
    //   valueType: ResourceMatcherValueType.Regex,
    // },
  ]
};
const PscPage = () => {
  const { t } = useTranslation();
  const [samplePath, setSamplePath] = reactExports.useState(
    "D:\\test\\new-media-library-path-configuration\\a"
  );
  const [value, setValue] = reactExports.useState(
    convertToPscValueFromPathConfigurationDto(testData)
  );
  const segmentsRef = reactExports.useRef(samplePath.split("\\"));
  const { createPortal } = useBakabaseContext();
  const simpleMatchers = {
    [PscPropertyType.Resource]: false,
    [PscPropertyType.RootPath]: false,
    [PscPropertyType.ParentResource]: false,
    [PscPropertyType.Rating]: false,
    [PscPropertyType.Introduction]: false,
    [PscPropertyType.CustomProperty]: false
  };
  const matchers = Object.keys(simpleMatchers).reduce((ts, t2) => {
    ts.push(
      new PathSegmentConfigurationPropsMatcherOptions({
        propertyType: parseInt(t2, 10),
        readonly: simpleMatchers[t2]
      })
    );
    return ts;
  }, []);
  console.log(matchers, value);
  const matchersRef = reactExports.useRef(matchers);
  const onChangeCallback = reactExports.useCallback((v) => {
    setValue(v);
  }, []);
  const valueRef = reactExports.useRef(value);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "test-page", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "psc", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      PathSegmentsConfiguration,
      {
        defaultValue: valueRef.current,
        isDirectory: false,
        matchers: matchersRef.current,
        segments: segmentsRef.current,
        onChange: onChangeCallback
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Button,
      {
        size: "sm",
        onClick: () => {
          createPortal(SegmentMatcherConfiguration, {
            segments: samplePath.split("\\"),
            segmentMarkers: {},
            property: {
              id: 1,
              isCustom: false,
              name: t("Resource")
            },
            modesData: new SegmentMatcherConfigurationModesData({
              layers: [1],
              regex: {
                text: "new-media-library-path-configuration/a/bc/New Text Document.txt"
              }
            }),
            onSubmit: (value2) => {
            }
          });
        },
        children: "Simple SMC"
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ReactJson, { name: "Raw", src: value, theme: "monokai" }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        ReactJson,
        {
          name: "Dto",
          src: convertToPathConfigurationDtoFromPscValue(value),
          theme: "monokai"
        }
      ) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-2", children: value.map((m) => {
      return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        ReactJson,
        {
          name: m.property.toString(t, void 0),
          src: m.value,
          theme: "monokai"
        }
      ) });
    }) })
  ] }) });
};
PscPage.displayName = "PscPage";
function TourPage() {
  const { isOpen, currentStep, steps, setIsOpen, setCurrentStep, setSteps } = useTour();
  console.log("current steps", steps);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { children: isOpen ? "Welcome to the tour!" : "Thank you for participate!" }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "new-place-1", children: [
      "Now you are visiting the place ",
      currentStep + 1,
      " of ",
      steps.length
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("nav", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setIsOpen((o) => !o), children: "Toggle Tour" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setCurrentStep(3), children: "Take a fast way to 4th place" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        "button",
        {
          onClick: () => {
            setSteps([
              { selector: ".new-place-1", content: "New place 1" },
              { selector: ".new-place-2", content: "New place 2" }
            ]);
            setCurrentStep(1);
          },
          children: "Switch to a new set of places, starting from the last one!"
        }
      )
    ] })
  ] });
}
function SortableItem(props) {
  const { attributes, listeners, setNodeRef, transform, transition } = useSortable({ id: props.id });
  const style = {
    transform: CSS.Transform.toString(transform),
    transition
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: setNodeRef, style, ...attributes, ...listeners, children: "blablablabla" });
}
function SortablePage() {
  const [items, setItems] = reactExports.useState([1, 2, 3]);
  const sensors = useSensors(
    useSensor(PointerSensor),
    useSensor(KeyboardSensor, {
      coordinateGetter: sortableKeyboardCoordinates
    })
  );
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    DndContext,
    {
      collisionDetection: closestCenter,
      sensors,
      onDragEnd: handleDragEnd,
      children: /* @__PURE__ */ jsxRuntimeExports.jsx(SortableContext, { items, strategy: verticalListSortingStrategy, children: items.map((id) => /* @__PURE__ */ jsxRuntimeExports.jsx(SortableItem, { id }, id)) })
    }
  );
  function handleDragEnd(event) {
    const { active, over } = event;
    if (active.id !== over.id) {
      setItems((items2) => {
        const oldIndex = items2.indexOf(active.id);
        const newIndex = items2.indexOf(over.id);
        return arrayMove(items2, oldIndex, newIndex);
      });
    }
  }
}
const MediaPreviewerTest = () => {
  const [previewerVisible, setPreviewerVisible] = reactExports.useState(false);
  const hoverTimerRef = reactExports.useRef();
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    "div",
    {
      className: "media-previewer-container",
      onMouseLeave: () => {
        clearTimeout(hoverTimerRef.current);
        hoverTimerRef.current = void 0;
        if (previewerVisible) {
          setPreviewerVisible(false);
        }
      },
      onMouseOver: () => {
        if (!hoverTimerRef.current) {
          hoverTimerRef.current = setTimeout(() => {
            setPreviewerVisible(true);
          }, 1e3);
        }
      },
      children: previewerVisible && /* @__PURE__ */ jsxRuntimeExports.jsx(MediaPreviewer, { resourceId: 2501 })
    }
  );
};
MediaPreviewerTest.displayName = "MediaPreviewerTest";
dayjs.extend(duration);
const mockSingleLineTextProperty = {
  id: 1,
  pool: PropertyPool.Custom,
  name: "Title",
  type: PropertyType.SingleLineText,
  dbValueType: StandardValueType.String,
  bizValueType: StandardValueType.String,
  typeName: "SingleLineText",
  poolName: "Custom",
  order: 0
};
const mockMultilineTextProperty = {
  id: 2,
  pool: PropertyPool.Custom,
  name: "Description",
  type: PropertyType.MultilineText,
  dbValueType: StandardValueType.String,
  bizValueType: StandardValueType.String,
  typeName: "MultilineText",
  poolName: "Custom",
  order: 1
};
const mockSingleChoiceProperty = {
  id: 3,
  pool: PropertyPool.Custom,
  name: "Status",
  type: PropertyType.SingleChoice,
  dbValueType: StandardValueType.String,
  bizValueType: StandardValueType.String,
  typeName: "SingleChoice",
  poolName: "Custom",
  order: 2,
  options: {
    choices: [
      { value: "draft", label: "Draft", color: "#888888" },
      { value: "published", label: "Published", color: "#22c55e" },
      { value: "archived", label: "Archived", color: "#f59e0b" },
      { value: "pending", label: "Pending Review", color: "#3b82f6" },
      { value: "rejected", label: "Rejected", color: "#ef4444" },
      { value: "scheduled", label: "Scheduled", color: "#8b5cf6" },
      { value: "expired", label: "Expired", color: "#6b7280" },
      { value: "deleted", label: "Deleted", color: "#dc2626" },
      { value: "hidden", label: "Hidden", color: "#4b5563" },
      { value: "featured", label: "Featured", color: "#eab308" },
      { value: "pinned", label: "Pinned", color: "#14b8a6" },
      { value: "locked", label: "Locked", color: "#78716c" },
      { value: "unlisted", label: "Unlisted", color: "#a3a3a3" },
      { value: "processing", label: "Processing", color: "#06b6d4" },
      { value: "failed", label: "Failed", color: "#be123c" },
      { value: "queued", label: "Queued", color: "#7c3aed" },
      { value: "active", label: "Active", color: "#16a34a" },
      { value: "inactive", label: "Inactive", color: "#9ca3af" },
      { value: "suspended", label: "Suspended", color: "#ea580c" },
      { value: "banned", label: "Banned", color: "#991b1b" },
      { value: "verified", label: "Verified", color: "#059669" },
      { value: "unverified", label: "Unverified", color: "#d97706" },
      { value: "premium", label: "Premium", color: "#c026d3" },
      { value: "free", label: "Free", color: "#65a30d" },
      { value: "trial", label: "Trial", color: "#0891b2" },
      { value: "beta", label: "Beta", color: "#4f46e5" },
      { value: "alpha", label: "Alpha", color: "#7c2d12" },
      { value: "stable", label: "Stable", color: "#15803d" },
      { value: "deprecated", label: "Deprecated", color: "#71717a" },
      { value: "legacy", label: "Legacy", color: "#57534e" },
      { value: "experimental", label: "Experimental", color: "#db2777" },
      { value: "maintenance", label: "Maintenance", color: "#ca8a04" },
      { value: "readonly", label: "Read Only", color: "#0284c7" },
      { value: "restricted", label: "Restricted", color: "#b91c1c" },
      { value: "public", label: "Public", color: "#22c55e" }
    ]
  }
};
const mockSingleChoiceNoOptionsProperty = {
  id: 31,
  pool: PropertyPool.Custom,
  name: "Status (No Options)",
  type: PropertyType.SingleChoice,
  dbValueType: StandardValueType.String,
  bizValueType: StandardValueType.String,
  typeName: "SingleChoice",
  poolName: "Custom",
  order: 2
};
const mockMultipleChoiceProperty = {
  id: 4,
  pool: PropertyPool.Custom,
  name: "Categories",
  type: PropertyType.MultipleChoice,
  dbValueType: StandardValueType.ListString,
  bizValueType: StandardValueType.ListString,
  typeName: "MultipleChoice",
  poolName: "Custom",
  order: 3,
  options: {
    choices: [
      { value: "action", label: "Action", color: "#ef4444" },
      { value: "comedy", label: "Comedy", color: "#f59e0b" },
      { value: "drama", label: "Drama", color: "#3b82f6" },
      { value: "sci-fi", label: "Sci-Fi", color: "#8b5cf6" },
      { value: "horror", label: "Horror", color: "#1f2937" },
      { value: "romance", label: "Romance", color: "#ec4899" },
      { value: "thriller", label: "Thriller", color: "#dc2626" },
      { value: "mystery", label: "Mystery", color: "#4b5563" },
      { value: "fantasy", label: "Fantasy", color: "#7c3aed" },
      { value: "adventure", label: "Adventure", color: "#059669" },
      { value: "animation", label: "Animation", color: "#06b6d4" },
      { value: "documentary", label: "Documentary", color: "#78716c" },
      { value: "family", label: "Family", color: "#22c55e" },
      { value: "musical", label: "Musical", color: "#c026d3" },
      { value: "war", label: "War", color: "#991b1b" },
      { value: "western", label: "Western", color: "#b45309" },
      { value: "crime", label: "Crime", color: "#374151" },
      { value: "biography", label: "Biography", color: "#0891b2" },
      { value: "history", label: "History", color: "#92400e" },
      { value: "sport", label: "Sport", color: "#16a34a" },
      { value: "music", label: "Music", color: "#db2777" },
      { value: "news", label: "News", color: "#0284c7" },
      { value: "reality", label: "Reality TV", color: "#ca8a04" },
      { value: "talk-show", label: "Talk Show", color: "#7c2d12" },
      { value: "game-show", label: "Game Show", color: "#4f46e5" },
      { value: "soap", label: "Soap Opera", color: "#be185d" },
      { value: "short", label: "Short Film", color: "#6366f1" },
      { value: "adult", label: "Adult", color: "#be123c" },
      { value: "noir", label: "Film Noir", color: "#27272a" },
      { value: "superhero", label: "Superhero", color: "#2563eb" },
      { value: "martial-arts", label: "Martial Arts", color: "#ea580c" },
      { value: "disaster", label: "Disaster", color: "#b91c1c" },
      { value: "psychological", label: "Psychological", color: "#6b21a8" },
      { value: "supernatural", label: "Supernatural", color: "#5b21b6" },
      { value: "slice-of-life", label: "Slice of Life", color: "#65a30d" },
      { value: "isekai", label: "Isekai", color: "#0d9488" },
      { value: "mecha", label: "Mecha", color: "#475569" },
      { value: "harem", label: "Harem", color: "#f472b6" },
      { value: "ecchi", label: "Ecchi", color: "#fb7185" },
      { value: "shounen", label: "Shounen", color: "#f97316" }
    ]
  }
};
const mockMultipleChoiceNoOptionsProperty = {
  id: 41,
  pool: PropertyPool.Custom,
  name: "Categories (No Options)",
  type: PropertyType.MultipleChoice,
  dbValueType: StandardValueType.ListString,
  bizValueType: StandardValueType.ListString,
  typeName: "MultipleChoice",
  poolName: "Custom",
  order: 3
};
({
  pool: PropertyPool.Custom,
  type: PropertyType.Number,
  dbValueType: StandardValueType.Decimal,
  bizValueType: StandardValueType.Decimal
});
const mockPercentageProperty = {
  id: 6,
  pool: PropertyPool.Custom,
  name: "Progress",
  type: PropertyType.Percentage,
  dbValueType: StandardValueType.Decimal,
  bizValueType: StandardValueType.Decimal,
  typeName: "Percentage",
  poolName: "Custom",
  order: 5
};
const mockRatingProperty = {
  id: 7,
  pool: PropertyPool.Custom,
  name: "Rating",
  type: PropertyType.Rating,
  dbValueType: StandardValueType.Decimal,
  bizValueType: StandardValueType.Decimal,
  typeName: "Rating",
  poolName: "Custom",
  order: 6
};
const mockRatingValueProperty = {
  id: 7,
  pool: PropertyPool.Custom,
  name: "Rating",
  type: PropertyType.Number,
  dbValueType: StandardValueType.Decimal,
  bizValueType: StandardValueType.Decimal,
  typeName: "Number",
  poolName: "Custom",
  order: 6
};
const mockBooleanProperty = {
  id: 8,
  pool: PropertyPool.Custom,
  name: "Active",
  type: PropertyType.Boolean,
  dbValueType: StandardValueType.Boolean,
  bizValueType: StandardValueType.Boolean,
  typeName: "Boolean",
  poolName: "Custom",
  order: 7
};
const mockDateProperty = {
  id: 9,
  pool: PropertyPool.Custom,
  name: "Release Date",
  type: PropertyType.Date,
  dbValueType: StandardValueType.DateTime,
  bizValueType: StandardValueType.DateTime,
  typeName: "Date",
  poolName: "Custom",
  order: 8
};
const mockDateTimeProperty = {
  id: 10,
  pool: PropertyPool.Custom,
  name: "Created At",
  type: PropertyType.DateTime,
  dbValueType: StandardValueType.DateTime,
  bizValueType: StandardValueType.DateTime,
  typeName: "DateTime",
  poolName: "Custom",
  order: 9
};
const mockTimeProperty = {
  id: 11,
  pool: PropertyPool.Custom,
  name: "Duration",
  type: PropertyType.Time,
  dbValueType: StandardValueType.Time,
  bizValueType: StandardValueType.Time,
  typeName: "Time",
  poolName: "Custom",
  order: 10
};
const mockTagsProperty = {
  id: 12,
  pool: PropertyPool.Custom,
  name: "Tags",
  type: PropertyType.Tags,
  dbValueType: StandardValueType.ListString,
  bizValueType: StandardValueType.ListListString,
  typeName: "Tags",
  poolName: "Custom",
  order: 11,
  options: {
    tags: [
      // Priority group (6 tags)
      { value: "tag1", name: "Important", group: "Priority", color: "#ef4444" },
      { value: "tag2", name: "Urgent", group: "Priority", color: "#f59e0b" },
      { value: "tag3", name: "Critical", group: "Priority", color: "#dc2626" },
      { value: "tag4", name: "Low", group: "Priority", color: "#22c55e" },
      { value: "tag5", name: "Medium", group: "Priority", color: "#3b82f6" },
      { value: "tag6", name: "High", group: "Priority", color: "#ea580c" },
      // Category group (8 tags)
      { value: "tag7", name: "Work", group: "Category", color: "#0891b2" },
      { value: "tag8", name: "Personal", group: "Category", color: "#8b5cf6" },
      { value: "tag9", name: "Study", group: "Category", color: "#6366f1" },
      { value: "tag10", name: "Entertainment", group: "Category", color: "#ec4899" },
      { value: "tag11", name: "Health", group: "Category", color: "#10b981" },
      { value: "tag12", name: "Finance", group: "Category", color: "#84cc16" },
      { value: "tag13", name: "Travel", group: "Category", color: "#06b6d4" },
      { value: "tag14", name: "Shopping", group: "Category", color: "#f472b6" },
      // Status group (8 tags)
      { value: "tag15", name: "Todo", group: "Status", color: "#6b7280" },
      { value: "tag16", name: "In Progress", group: "Status", color: "#3b82f6" },
      { value: "tag17", name: "Done", group: "Status", color: "#22c55e" },
      { value: "tag18", name: "Blocked", group: "Status", color: "#ef4444" },
      { value: "tag19", name: "Review", group: "Status", color: "#f59e0b" },
      { value: "tag20", name: "Testing", group: "Status", color: "#8b5cf6" },
      { value: "tag21", name: "Deployed", group: "Status", color: "#059669" },
      { value: "tag22", name: "Cancelled", group: "Status", color: "#78716c" },
      // Type group (8 tags)
      { value: "tag23", name: "Bug", group: "Type", color: "#dc2626" },
      { value: "tag24", name: "Feature", group: "Type", color: "#2563eb" },
      { value: "tag25", name: "Enhancement", group: "Type", color: "#7c3aed" },
      { value: "tag26", name: "Documentation", group: "Type", color: "#0d9488" },
      { value: "tag27", name: "Refactor", group: "Type", color: "#ca8a04" },
      { value: "tag28", name: "Performance", group: "Type", color: "#16a34a" },
      { value: "tag29", name: "Security", group: "Type", color: "#be123c" },
      { value: "tag30", name: "UI/UX", group: "Type", color: "#c026d3" },
      // Platform group (6 tags)
      { value: "tag31", name: "Web", group: "Platform", color: "#3b82f6" },
      { value: "tag32", name: "Mobile", group: "Platform", color: "#22c55e" },
      { value: "tag33", name: "Desktop", group: "Platform", color: "#6366f1" },
      { value: "tag34", name: "iOS", group: "Platform", color: "#1f2937" },
      { value: "tag35", name: "Android", group: "Platform", color: "#84cc16" },
      { value: "tag36", name: "API", group: "Platform", color: "#0891b2" },
      // Misc group (6 tags)
      { value: "tag37", name: "Favorite", group: "Misc", color: "#f59e0b" },
      { value: "tag38", name: "Bookmark", group: "Misc", color: "#8b5cf6" },
      { value: "tag39", name: "Archive", group: "Misc", color: "#78716c" },
      { value: "tag40", name: "Pinned", group: "Misc", color: "#ef4444" },
      { value: "tag41", name: "Starred", group: "Misc", color: "#eab308" },
      { value: "tag42", name: "Flagged", group: "Misc", color: "#dc2626" }
    ]
  }
};
const mockTagsNoOptionsProperty = {
  id: 121,
  pool: PropertyPool.Custom,
  name: "Tags (No Options)",
  type: PropertyType.Tags,
  dbValueType: StandardValueType.ListString,
  bizValueType: StandardValueType.ListListString,
  typeName: "Tags",
  poolName: "Custom",
  order: 11
};
const mockMultilevelProperty = {
  id: 13,
  pool: PropertyPool.Custom,
  name: "Location",
  type: PropertyType.Multilevel,
  dbValueType: StandardValueType.ListString,
  bizValueType: StandardValueType.ListListString,
  typeName: "Multilevel",
  poolName: "Custom",
  order: 12,
  options: {
    data: [
      {
        value: "asia",
        label: "Asia",
        children: [
          {
            value: "china",
            label: "China",
            children: [
              { value: "beijing", label: "Beijing" },
              { value: "shanghai", label: "Shanghai" },
              { value: "guangzhou", label: "Guangzhou" },
              { value: "shenzhen", label: "Shenzhen" },
              { value: "hangzhou", label: "Hangzhou" },
              { value: "chengdu", label: "Chengdu" },
              { value: "wuhan", label: "Wuhan" },
              { value: "xian", label: "Xi'an" }
            ]
          },
          {
            value: "japan",
            label: "Japan",
            children: [
              { value: "tokyo", label: "Tokyo" },
              { value: "osaka", label: "Osaka" },
              { value: "kyoto", label: "Kyoto" },
              { value: "yokohama", label: "Yokohama" },
              { value: "nagoya", label: "Nagoya" },
              { value: "sapporo", label: "Sapporo" }
            ]
          },
          {
            value: "korea",
            label: "South Korea",
            children: [
              { value: "seoul", label: "Seoul" },
              { value: "busan", label: "Busan" },
              { value: "incheon", label: "Incheon" }
            ]
          },
          {
            value: "india",
            label: "India",
            children: [
              { value: "mumbai", label: "Mumbai" },
              { value: "delhi", label: "Delhi" },
              { value: "bangalore", label: "Bangalore" },
              { value: "chennai", label: "Chennai" }
            ]
          }
        ]
      },
      {
        value: "europe",
        label: "Europe",
        children: [
          {
            value: "uk",
            label: "United Kingdom",
            children: [
              { value: "london", label: "London" },
              { value: "manchester", label: "Manchester" },
              { value: "birmingham", label: "Birmingham" },
              { value: "edinburgh", label: "Edinburgh" }
            ]
          },
          {
            value: "germany",
            label: "Germany",
            children: [
              { value: "berlin", label: "Berlin" },
              { value: "munich", label: "Munich" },
              { value: "frankfurt", label: "Frankfurt" },
              { value: "hamburg", label: "Hamburg" }
            ]
          },
          {
            value: "france",
            label: "France",
            children: [
              { value: "paris", label: "Paris" },
              { value: "lyon", label: "Lyon" },
              { value: "marseille", label: "Marseille" }
            ]
          },
          {
            value: "italy",
            label: "Italy",
            children: [
              { value: "rome", label: "Rome" },
              { value: "milan", label: "Milan" },
              { value: "venice", label: "Venice" }
            ]
          }
        ]
      },
      {
        value: "north-america",
        label: "North America",
        children: [
          {
            value: "usa",
            label: "United States",
            children: [
              { value: "new-york", label: "New York" },
              { value: "los-angeles", label: "Los Angeles" },
              { value: "chicago", label: "Chicago" },
              { value: "houston", label: "Houston" },
              { value: "phoenix", label: "Phoenix" },
              { value: "seattle", label: "Seattle" },
              { value: "san-francisco", label: "San Francisco" }
            ]
          },
          {
            value: "canada",
            label: "Canada",
            children: [
              { value: "toronto", label: "Toronto" },
              { value: "vancouver", label: "Vancouver" },
              { value: "montreal", label: "Montreal" }
            ]
          }
        ]
      },
      {
        value: "oceania",
        label: "Oceania",
        children: [
          {
            value: "australia",
            label: "Australia",
            children: [
              { value: "sydney", label: "Sydney" },
              { value: "melbourne", label: "Melbourne" },
              { value: "brisbane", label: "Brisbane" }
            ]
          }
        ]
      }
    ]
  }
};
const mockMultilevelNoOptionsProperty = {
  id: 131,
  pool: PropertyPool.Custom,
  name: "Location (No Options)",
  type: PropertyType.Multilevel,
  dbValueType: StandardValueType.ListString,
  bizValueType: StandardValueType.ListListString,
  typeName: "Multilevel",
  poolName: "Custom",
  order: 12
};
const createComprehensiveFilterGroup = () => ({
  combinator: GroupCombinator.And,
  disabled: false,
  filters: [
    // SingleLineText - Contains
    {
      propertyId: 1,
      propertyPool: PropertyPool.Custom,
      operation: SearchOperation.Contains,
      property: mockSingleLineTextProperty,
      valueProperty: mockSingleLineTextProperty,
      dbValue: serializeStandardValue("keyword", StandardValueType.String),
      disabled: false
    },
    // MultilineText - Contains
    {
      propertyId: 2,
      propertyPool: PropertyPool.Custom,
      operation: SearchOperation.Contains,
      property: mockMultilineTextProperty,
      valueProperty: mockMultilineTextProperty,
      dbValue: serializeStandardValue("some long description text", StandardValueType.String),
      disabled: false
    },
    // Rating >= 3
    {
      propertyId: 7,
      propertyPool: PropertyPool.Custom,
      operation: SearchOperation.GreaterThanOrEquals,
      property: mockRatingProperty,
      valueProperty: mockRatingValueProperty,
      dbValue: serializeStandardValue(3, StandardValueType.Decimal),
      disabled: false
    },
    // Percentage <= 80
    {
      propertyId: 6,
      propertyPool: PropertyPool.Custom,
      operation: SearchOperation.LessThanOrEquals,
      property: mockPercentageProperty,
      valueProperty: mockPercentageProperty,
      dbValue: serializeStandardValue(80, StandardValueType.Decimal),
      disabled: false
    },
    // Boolean = true
    {
      propertyId: 8,
      propertyPool: PropertyPool.Custom,
      operation: SearchOperation.Equals,
      property: mockBooleanProperty,
      valueProperty: mockBooleanProperty,
      dbValue: serializeStandardValue(true, StandardValueType.Boolean),
      disabled: false
    }
  ],
  groups: [
    // GROUP 1: Status filters (OR combinator)
    {
      combinator: GroupCombinator.Or,
      disabled: false,
      filters: [
        // Status = published
        {
          propertyId: 3,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Equals,
          property: mockSingleChoiceProperty,
          valueProperty: mockSingleChoiceProperty,
          dbValue: serializeStandardValue("published", StandardValueType.String),
          disabled: false
        },
        // Status = draft
        {
          propertyId: 3,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Equals,
          property: mockSingleChoiceProperty,
          valueProperty: mockSingleChoiceProperty,
          dbValue: serializeStandardValue("draft", StandardValueType.String),
          disabled: false
        }
      ],
      groups: [
        // GROUP 1.1: Date range (AND combinator inside OR group - 3 levels deep)
        {
          combinator: GroupCombinator.And,
          disabled: false,
          filters: [
            // Release Date >= 2024-01-01
            {
              propertyId: 9,
              propertyPool: PropertyPool.Custom,
              operation: SearchOperation.GreaterThanOrEquals,
              property: mockDateProperty,
              valueProperty: mockDateProperty,
              dbValue: serializeStandardValue(dayjs("2024-01-01"), StandardValueType.DateTime),
              disabled: false
            },
            // Release Date <= 2024-12-31
            {
              propertyId: 9,
              propertyPool: PropertyPool.Custom,
              operation: SearchOperation.LessThanOrEquals,
              property: mockDateProperty,
              valueProperty: mockDateProperty,
              dbValue: serializeStandardValue(dayjs("2024-12-31"), StandardValueType.DateTime),
              disabled: false
            }
          ],
          groups: []
        }
      ]
    },
    // GROUP 2: Categories (OR combinator)
    {
      combinator: GroupCombinator.Or,
      disabled: false,
      filters: [
        // Categories contains action
        {
          propertyId: 4,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockMultipleChoiceProperty,
          valueProperty: mockMultipleChoiceProperty,
          dbValue: serializeStandardValue(["action"], StandardValueType.ListString),
          disabled: false
        },
        // Categories contains drama
        {
          propertyId: 4,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockMultipleChoiceProperty,
          valueProperty: mockMultipleChoiceProperty,
          dbValue: serializeStandardValue(["drama"], StandardValueType.ListString),
          disabled: false
        }
      ],
      groups: []
    },
    // GROUP 3: DateTime and Time (AND combinator)
    {
      combinator: GroupCombinator.And,
      disabled: false,
      filters: [
        // Created At <= 2024-12-31 23:59:59
        {
          propertyId: 10,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.LessThanOrEquals,
          property: mockDateTimeProperty,
          valueProperty: mockDateTimeProperty,
          dbValue: serializeStandardValue(dayjs("2024-12-31T23:59:59"), StandardValueType.DateTime),
          disabled: false
        },
        // Duration >= 01:30:00
        {
          propertyId: 11,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.GreaterThanOrEquals,
          property: mockTimeProperty,
          valueProperty: mockTimeProperty,
          dbValue: serializeStandardValue(dayjs.duration({ hours: 1, minutes: 30 }), StandardValueType.Time),
          disabled: false
        }
      ],
      groups: []
    },
    // GROUP 4: Tags and Location (OR combinator)
    {
      combinator: GroupCombinator.Or,
      disabled: false,
      filters: [
        // Tags contains
        {
          propertyId: 12,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockTagsProperty,
          valueProperty: mockTagsProperty,
          dbValue: serializeStandardValue(["tag1", "tag3"], StandardValueType.ListString),
          disabled: false
        },
        // Location contains beijing
        {
          propertyId: 13,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockMultilevelProperty,
          valueProperty: mockMultilevelProperty,
          dbValue: serializeStandardValue(["beijing"], StandardValueType.ListString),
          disabled: false
        }
      ],
      groups: []
    },
    // GROUP 5: Properties without options (AND combinator)
    {
      combinator: GroupCombinator.And,
      disabled: false,
      filters: [
        // SingleChoice without options
        {
          propertyId: 31,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Equals,
          property: mockSingleChoiceNoOptionsProperty,
          valueProperty: mockSingleChoiceNoOptionsProperty,
          dbValue: serializeStandardValue("some-value", StandardValueType.String),
          disabled: false
        },
        // MultipleChoice without options
        {
          propertyId: 41,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockMultipleChoiceNoOptionsProperty,
          valueProperty: mockMultipleChoiceNoOptionsProperty,
          dbValue: serializeStandardValue(["value1", "value2"], StandardValueType.ListString),
          disabled: false
        },
        // Tags without options
        {
          propertyId: 121,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockTagsNoOptionsProperty,
          valueProperty: mockTagsNoOptionsProperty,
          dbValue: serializeStandardValue(["tag-id-1"], StandardValueType.ListString),
          disabled: false
        },
        // Multilevel without options
        {
          propertyId: 131,
          propertyPool: PropertyPool.Custom,
          operation: SearchOperation.Contains,
          property: mockMultilevelNoOptionsProperty,
          valueProperty: mockMultilevelNoOptionsProperty,
          dbValue: serializeStandardValue(["node-id-1"], StandardValueType.ListString),
          disabled: false
        }
      ],
      groups: []
    }
  ]
});
const ResourceFilterPage = () => {
  var _a, _b;
  const [group, setGroup] = reactExports.useState(createComprehensiveFilterGroup);
  const [portalGroup, setPortalGroup] = reactExports.useState(createComprehensiveFilterGroup);
  const [portalKeyword, setPortalKeyword] = reactExports.useState("");
  const [portalMode, setPortalMode] = reactExports.useState(FilterDisplayMode.Simple);
  const [autoCreateGroupSimple, setAutoCreateGroupSimple] = reactExports.useState(void 0);
  const [autoCreateGroupAdvanced, setAutoCreateGroupAdvanced] = reactExports.useState(void 0);
  const keywordContainerRef = reactExports.useRef(null);
  const filterPortalContainerRef = reactExports.useRef(null);
  const filterGroupsContainerRef = reactExports.useRef(null);
  const [refsReady, setRefsReady] = reactExports.useState(false);
  reactExports.useEffect(() => {
    setRefsReady(true);
  }, []);
  const comprehensiveGroup = createComprehensiveFilterGroup();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-bold mb-2", children: "ResourceFilter Test Page" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-default-500 mb-4", children: "Comprehensive test: All property types + Nested groups (3 levels) + AND/OR combinators" }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(Tabs, { "aria-label": "Filter test sections", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: "All Modes Comparison", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-6 pt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-default-500", children: "Same comprehensive data shown in all 4 mode combinations. Includes: SingleLineText, Rating, Percentage, Boolean, SingleChoice, MultipleChoice, Date, DateTime, Time, Tags, and Multilevel properties with nested groups." }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Vertical + Simple" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Horizontal + Simple" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "horizontal",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Vertical + Advanced" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Horizontal + Advanced" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "horizontal",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] })
        ] })
      ] }) }, "comprehensive"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: "Interactive", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-6 pt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-default-500", children: "Interactive demo with the comprehensive filter group. Add, remove, and modify filters." }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Vertical + Simple (Interactive)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group,
                onGroupChange: setGroup,
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Horizontal + Simple (Interactive)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group,
                onGroupChange: setGroup,
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "horizontal",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Vertical + Advanced (Interactive)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group,
                onGroupChange: setGroup,
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Horizontal + Advanced (Interactive)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group,
                onGroupChange: setGroup,
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "horizontal",
                showRecentFilters: false,
                showTags: false
              }
            )
          ] })
        ] })
      ] }) }, "interactive"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: "Portal Demo", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-semibold", children: "Parts Rendered to Different Containers" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(card_body_default, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-default-500 mb-4", children: "This demo shows how ResourceFilterController can render different parts to separate containers. The keyword input, filter button, and filter groups are each rendered to different areas." }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-3 gap-4 mb-4", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded p-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-default-400 mb-2", children: "Keyword Container" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: keywordContainerRef })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded p-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-default-400 mb-2", children: "Filter Portal Container" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { ref: filterPortalContainerRef, className: "flex justify-center" })
            ] }),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded p-3", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-default-400 mb-2", children: "Current Mode" }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-lg font-semibold", children: portalMode === FilterDisplayMode.Simple ? "Simple" : "Advanced" })
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-default-400 mb-2", children: "Filter Groups Container (Scrollable)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              "div",
              {
                ref: filterGroupsContainerRef,
                className: "max-h-[200px] overflow-y-auto"
              }
            )
          ] }),
          refsReady && /* @__PURE__ */ jsxRuntimeExports.jsx(
            ResourceFilterController,
            {
              keyword: portalKeyword,
              onKeywordChange: setPortalKeyword,
              group: portalGroup,
              onGroupChange: setPortalGroup,
              filterDisplayMode: portalMode,
              onFilterDisplayModeChange: setPortalMode,
              filterLayout: "vertical",
              keywordContainer: keywordContainerRef.current,
              filterPortalContainer: filterPortalContainerRef.current,
              filterGroupsContainer: filterGroupsContainerRef.current,
              keywordClassName: "w-full"
            }
          )
        ] })
      ] }) }) }, "portal"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: "Auto-Create Filter", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-6 pt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-default-500", children: "Tests the autoCreateMediaLibraryFilter prop. When enabled and group is empty/undefined, a media library filter is automatically created and onChange is triggered." }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Simple Mode" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-400 mb-2", children: "Initial group: undefined. Should auto-create media library filter." }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: autoCreateGroupSimple,
                onGroupChange: setAutoCreateGroupSimple,
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false,
                autoCreateMediaLibraryFilter: true
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-xs text-default-500", children: [
              "Group state: ",
              autoCreateGroupSimple ? `${((_a = autoCreateGroupSimple.filters) == null ? void 0 : _a.length) ?? 0} filter(s)` : "undefined"
            ] })
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Advanced Mode" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-400 mb-2", children: "Initial group: undefined. Should auto-create media library filter." }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: autoCreateGroupAdvanced,
                onGroupChange: setAutoCreateGroupAdvanced,
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false,
                autoCreateMediaLibraryFilter: true
              }
            ),
            /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-xs text-default-500", children: [
              "Group state: ",
              autoCreateGroupAdvanced ? `${((_b = autoCreateGroupAdvanced.filters) == null ? void 0 : _b.length) ?? 0} filter(s)` : "undefined"
            ] })
          ] })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { children: "Auto-Created Filter Group JSON" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            ReactJson,
            {
              collapsed: 2,
              name: "autoCreateGroupSimple",
              src: autoCreateGroupSimple ?? {},
              theme: "monokai",
              style: { fontSize: 11 }
            }
          ) })
        ] })
      ] }) }, "auto-create"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: "Readonly Mode", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-6 pt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-default-500", children: "Readonly mode displays filters without any action buttons (delete, disable, add filter, edit operations). Useful for displaying filter criteria in a non-editable view." }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-4", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Vertical + Simple (Readonly)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false,
                isReadonly: true
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Horizontal + Simple (Readonly)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Simple,
                filterLayout: "horizontal",
                showRecentFilters: false,
                showTags: false,
                isReadonly: true
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-primary mb-2", children: "Vertical + Advanced (Readonly)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "vertical",
                showRecentFilters: false,
                showTags: false,
                isReadonly: true
              }
            )
          ] }),
          /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border border-default-200 rounded p-3", children: [
            /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-semibold text-secondary mb-2", children: "Horizontal + Advanced (Readonly)" }),
            /* @__PURE__ */ jsxRuntimeExports.jsx(
              ResourceFilterController,
              {
                group: comprehensiveGroup,
                onGroupChange: () => {
                },
                filterDisplayMode: FilterDisplayMode.Advanced,
                filterLayout: "horizontal",
                showRecentFilters: false,
                showTags: false,
                isReadonly: true
              }
            )
          ] })
        ] })
      ] }) }, "readonly"),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: "JSON Data", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-4", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { children: "Comprehensive Filter Group Structure" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          ReactJson,
          {
            collapsed: 2,
            name: "group",
            src: comprehensiveGroup,
            theme: "monokai",
            style: { fontSize: 11 }
          }
        ) })
      ] }) }) }, "json")
    ] })
  ] });
};
ResourceFilterPage.displayName = "ResourceFilterPage";
const TestProperties = [
  null,
  {
    type: 1,
    options: {},
    name: "single line"
  },
  {
    type: 2,
    options: {},
    name: "multiline"
  },
  {
    type: 3,
    options: {
      choices: [
        {
          label: "ddd",
          value: "6dd8bd77-0905-4533-9c6d-fd30b0c68f0a"
        },
        {
          label: "abc",
          value: "7706ec2d-ffd5-4eec-9652-6aa91c1eb9e0"
        },
        {
          label: "aaa",
          value: "9f32d5a8-b523-4804-80d1-9f82a4299d2c",
          color: "#ff0000"
        }
      ],
      tags: [],
      defaultValue: "7706ec2d-ffd5-4eec-9652-6aa91c1eb9e0"
    },
    name: "single choice"
  },
  {
    type: 4,
    options: {
      choices: [
        {
          label: "m1",
          value: "376e5984-6f18-4438-adaf-c9e9b8ebfbcf"
        },
        {
          label: "m2",
          value: "3f9e312c-c884-40b5-9e16-cece8a4fa84d",
          color: "#2c00ff"
        },
        {
          label: "m3",
          value: "9f96b64b-496c-4ad5-b260-cf38d4125d7a"
        }
      ],
      defaultValue: [
        "3f9e312c-c884-40b5-9e16-cece8a4fa84d",
        "9f96b64b-496c-4ad5-b260-cf38d4125d7a"
      ],
      tags: []
    },
    name: "multiple choice"
  },
  {
    type: 5,
    options: {
      precision: "2"
    },
    name: "number"
  },
  {
    type: 6,
    options: {
      precision: "2",
      showProgressbar: true
    },
    name: "percentage"
  },
  {
    type: 7,
    options: {
      maxValue: "10"
    },
    name: "rating"
  },
  {
    type: 8,
    options: {},
    name: "boolean"
  },
  {
    type: 9,
    options: {},
    name: "link"
  },
  {
    type: 10,
    options: {},
    name: "attachment"
  },
  {
    type: 11,
    options: {},
    name: "date"
  },
  {
    type: 12,
    options: {},
    name: "date time"
  },
  {
    type: 13,
    options: {},
    name: "time"
  },
  {
    type: 14,
    options: {},
    name: "formula"
  },
  {
    type: 15,
    options: {
      choices: [],
      tags: [],
      data: [
        {
          value: "f7f4ca9f-def6-406c-9bd9-73d9d5895895",
          label: "Untitled 1"
        },
        {
          value: "194a1fae-8c42-4d07-aca9-13cd0c9d7388",
          label: "Untitled 2",
          children: [
            {
              value: "a9892cc8-8c54-44a0-8cfa-e268417e3398",
              label: "Untitled 1",
              children: [
                {
                  value: "0282b692-a1d3-4747-9ef2-69d29fc7bf35",
                  label: "Untitled 1",
                  children: [
                    {
                      value: "4db5e616-ecc6-4479-926c-1d007b50d244",
                      label: "55",
                      children: [
                        {
                          value: "2df2ba16-7cd6-43d3-bd56-87843b743eeb",
                          label: "Untitled 1"
                        }
                      ],
                      color: "#e71111"
                    }
                  ]
                }
              ],
              color: "#4320ff"
            }
          ]
        },
        {
          value: "43ab5d2c-6712-4177-b8d7-b7403d768d39",
          label: "Untitled 3"
        },
        {
          value: "3bc96ed1-4612-4ae9-a208-defaf22aaf84",
          label: "Untitled 4"
        }
      ]
    },
    name: "multilevel"
  },
  {
    type: 16,
    options: {
      tags: [
        {
          value: "ab674378-b783-4953-8c89-90612f5f36a3",
          group: "g1",
          name: "t1"
        },
        {
          value: "271cef00-bfe2-4b8b-9c6b-8074aa5a5136",
          group: "g4",
          name: "t2"
        },
        {
          value: "85c0e730-a2f9-48c2-a6f5-0f69b2b52dc7",
          name: "t655"
        }
      ],
      choices: []
    },
    name: "tags"
  }
];
const PropertiesPage = () => {
  const [properties, setProperties] = reactExports.useState(TestProperties);
  console.log(properties);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-2", children: propertyTypes.map((pt) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: "flex items-center gap-1 p-1 border-b-1",
        style: { borderBottomColor: "rgba(255,255,255,0.2)" },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "!w-[120px] !min-w-[120px]", children: pt.label }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "!w-[480px] !min-w-[480px]", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            ModalContent,
            {
              validValueTypes: [pt.value],
              value: TestProperties[pt.value] ?? { type: pt.value },
              onChange: (p) => {
                properties[pt.value] = p;
                setProperties([...properties]);
              }
            }
          ) }),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            ReactJson,
            {
              name: "json",
              quotesOnKeys: false,
              src: properties[pt.value] ? properties[pt.value] : void 0,
              theme: "monokai"
            }
          ) })
        ]
      }
    );
  }) });
};
PropertiesPage.displayName = "PropertiesPage";
const LongTabsPage = () => {
  const generateTabs = () => {
    const tabs = [];
    for (let i = 1; i <= 50; i++) {
      tabs.push(
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Tab,
          {
            title: `Tab ${i} - This is a very long tab title to test how HeroUI handles long text in tabs`,
            children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4", children: [
              /* @__PURE__ */ jsxRuntimeExports.jsxs("h3", { children: [
                "Content for Tab ",
                i
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { children: [
                "This is the content for tab number ",
                i,
                ". This tab has a very long title to test how the UI handles overflow."
              ] }),
              /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." })
            ] })
          },
          `tab-${i}`
        )
      );
    }
    return tabs;
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "w-full space-y-8", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "mb-4", children: "Testing HeroUI Tabs with Many Long Titles" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mb-4 text-sm text-default-500", children: "This test case creates 50 tabs with very long titles to test how HeroUI handles overflow and scrolling behavior." }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 1: Default Style (may overflow)" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - default",
          className: "w-full",
          size: "lg",
          variant: "underlined",
          children: generateTabs()
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 2: With Horizontal Scroll Container" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - scrollable",
          className: "w-max min-w-full",
          size: "lg",
          variant: "underlined",
          children: generateTabs()
        }
      ) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 3: Solid Variant" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - solid",
          className: "w-full",
          size: "lg",
          variant: "solid",
          children: generateTabs()
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 4: Bordered Variant" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - bordered",
          className: "w-full",
          size: "lg",
          variant: "bordered",
          children: generateTabs()
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 5: Light Variant" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - light",
          className: "w-full",
          size: "lg",
          variant: "light",
          children: generateTabs()
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 6: Small Size" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - small",
          className: "w-full",
          size: "sm",
          variant: "underlined",
          children: generateTabs()
        }
      )
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mb-2", children: "Test 7: Medium Size" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Tabs,
        {
          "aria-label": "Long tabs test - medium",
          className: "w-full",
          size: "md",
          variant: "underlined",
          children: generateTabs()
        }
      )
    ] })
  ] });
};
LongTabsPage.displayName = "LongTabsPage";
const ReactPlayerCasePage = () => {
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    src_default,
    {
      autoPlay: true,
      controls: true,
      height: 600,
      src: "http://localhost:5000/file/play?fullname=Z%3A%5CAnime%5CAdded%20recently%5CArcane%20S01%5CS01E01%20-%20Welcome%20to%20the%20Playground.mkv",
      width: 800,
      onDuration: (e) => {
      },
      config: {
        file: {
          attributes: {
            preload: "auto"
            // 或 'metadata' 或 'none'
          }
        }
      }
    }
  );
};
ReactPlayerCasePage.displayName = "ReactPlayerCasePage";
function HlsPlayerPage({ src }) {
  const videoRef = reactExports.useRef(null);
  reactExports.useEffect(() => {
    if (Hls.isSupported()) {
      const hls = new Hls();
      hls.loadSource(src);
      hls.attachMedia(videoRef.current);
      return () => hls.destroy();
    } else if (videoRef.current.canPlayType("application/vnd.apple.mpegurl")) {
      videoRef.current.src = src;
    }
  }, [src]);
  return /* @__PURE__ */ jsxRuntimeExports.jsx("video", { ref: videoRef, controls: true, height: 600, width: 800 });
}
const FileNameModifierTestPage = () => {
  const { createPortal } = useBakabaseContext();
  const testFilePaths = [
    "C:/Users/Documents/Photos/Vacation/IMG_001.jpg",
    "C:/Users/Documents/Photos/Vacation/IMG_002.jpg",
    "C:/Users/Documents/Photos/Vacation/IMG_003.jpg",
    "C:/Users/Documents/Photos/Vacation/IMG_004.jpg",
    "C:/Users/Documents/Photos/Vacation/IMG_005.jpg",
    "C:/Users/Documents/Videos/Movies/Action_Movie_2023.mp4",
    "C:/Users/Documents/Videos/Movies/Comedy_Movie_2023.mp4",
    "C:/Users/Documents/Videos/Movies/Drama_Movie_2023.mp4",
    "C:/Users/Documents/Music/Playlist/Rock_Song_01.mp3",
    "C:/Users/Documents/Music/Playlist/Pop_Song_02.mp3",
    "C:/Users/Documents/Music/Playlist/Jazz_Song_03.mp3",
    "C:/Users/Documents/Downloads/Software/Setup_Program_v1.0.exe",
    "C:/Users/Documents/Downloads/Software/Update_Patch_v1.1.exe",
    "C:/Users/Documents/Work/Reports/Quarterly_Report_2023_Q1.pdf",
    "C:/Users/Documents/Work/Reports/Annual_Report_2023.pdf",
    "C:/Users/Documents/Work/Presentations/Project_Presentation.pptx",
    "C:/Users/Documents/Backup/Important_Files_Backup.zip",
    "C:/Users/Documents/Backup/System_Backup_2023-12-01.zip",
    "C:/Users/Documents/Projects/Web_Development/index.html",
    "C:/Users/Documents/Projects/Web_Development/style.css",
    "C:/Users/Documents/Projects/Web_Development/script.js",
    "C:/Users/Documents/Projects/Mobile_App/Android/app.apk",
    "C:/Users/Documents/Projects/Mobile_App/iOS/app.ipa",
    "C:/Users/Documents/Projects/Desktop_App/Windows/app.exe",
    "C:/Users/Documents/Projects/Desktop_App/Mac/app.dmg",
    "C:/Users/Documents/Projects/Desktop_App/Linux/app.deb",
    "C:/Users/Documents/Projects/Data_Analysis/dataset.csv",
    "C:/Users/Documents/Projects/Data_Analysis/analysis_report.xlsx",
    "C:/Users/Documents/Projects/Data_Analysis/visualization.py",
    "C:/Users/Documents/Projects/Machine_Learning/model.pkl",
    "C:/Users/Documents/Projects/Machine_Learning/training_data.csv",
    "C:/Users/Documents/Projects/Machine_Learning/test_data.csv",
    "C:/Users/Documents/Projects/Database/schema.sql",
    "C:/Users/Documents/Projects/Database/data_backup.sql",
    "C:/Users/Documents/Projects/API/swagger_documentation.json",
    "C:/Users/Documents/Projects/API/endpoints.yaml",
    "C:/Users/Documents/Projects/Cloud_Deployment/docker-compose.yml",
    "C:/Users/Documents/Projects/Cloud_Deployment/kubernetes.yaml",
    "C:/Users/Documents/Projects/Cloud_Deployment/terraform.tf",
    "C:/Users/Documents/Projects/Security/ssl_certificate.crt",
    "C:/Users/Documents/Projects/Security/private_key.key",
    "C:/Users/Documents/Projects/Security/firewall_rules.conf",
    "C:/Users/Documents/Projects/Testing/unit_tests.js",
    "C:/Users/Documents/Projects/Testing/integration_tests.js",
    "C:/Users/Documents/Projects/Testing/e2e_tests.js",
    "C:/Users/Documents/Projects/Documentation/README.md",
    "C:/Users/Documents/Projects/Documentation/API_Docs.md",
    "C:/Users/Documents/Projects/Documentation/User_Guide.pdf",
    "C:/Users/Documents/Projects/Assets/logo.png",
    "C:/Users/Documents/Projects/Assets/icon.ico",
    "C:/Users/Documents/Projects/Assets/banner.jpg",
    "C:/Users/Documents/Projects/Config/config.json",
    "C:/Users/Documents/Projects/Config/environment.env",
    "C:/Users/Documents/Projects/Config/settings.yaml",
    "C:/Users/Documents/Projects/Logs/application.log",
    "C:/Users/Documents/Projects/Logs/error.log",
    "C:/Users/Documents/Projects/Logs/access.log",
    "C:/Users/Documents/Projects/Temp/temporary_file.tmp",
    "C:/Users/Documents/Projects/Temp/cache.dat",
    "C:/Users/Documents/Projects/Temp/session.ses",
    "C:/Users/Documents/Projects/Archive/old_version_1.0.zip",
    "C:/Users/Documents/Projects/Archive/legacy_code_2022.zip",
    "C:/Users/Documents/Projects/Archive/deprecated_features.zip",
    "C:/Users/Documents/Projects/Shared/libraries.dll",
    "C:/Users/Documents/Projects/Shared/frameworks.fw",
    "C:/Users/Documents/Projects/Shared/plugins.plg",
    "C:/Users/Documents/Projects/Production/live_system.exe",
    "C:/Users/Documents/Projects/Production/database.db",
    "C:/Users/Documents/Projects/Production/webserver.conf",
    "C:/Users/Documents/Projects/Staging/test_environment.exe",
    "C:/Users/Documents/Projects/Staging/test_database.db",
    "C:/Users/Documents/Projects/Staging/test_webserver.conf",
    "C:/Users/Documents/Projects/Development/dev_branch.exe",
    "C:/Users/Documents/Projects/Development/dev_database.db",
    "C:/Users/Documents/Projects/Development/dev_webserver.conf"
  ];
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { padding: 24 }, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { children: "FileNameModifier" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      Button,
      {
        variant: "solid",
        onPress: () => {
          createPortal(FileNameModifierModal, {
            onClose: () => {
            },
            initialFilePaths: testFilePaths
          });
        },
        children: "Open with Test Files"
      }
    )
  ] });
};
const FolderSelectorTest = () => {
  const { createPortal } = useBakabaseContext();
  const [selectedPath, setSelectedPath] = reactExports.useState(void 0);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      "Selected Path: ",
      selectedPath
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onPress: () => {
      createPortal(FolderSelector, {
        sources: ["custom", "media library"],
        onSelect: (path) => {
          console.log(path);
          setSelectedPath(path);
        }
      });
    }, children: "Open" })
  ] });
};
const TEST_DIRECTORY$1 = "E:\\迅雷下载";
const MediaPlayerTest = () => {
  const [entries, setEntries] = reactExports.useState([]);
  const [loading, setLoading] = reactExports.useState(false);
  const [error, setError] = reactExports.useState(null);
  const [autoPlay, setAutoPlay] = reactExports.useState(false);
  const loadEntries = async () => {
    var _a;
    setLoading(true);
    setError(null);
    try {
      const rsp = await BApi.file.getChildrenIwFsInfo(
        { root: TEST_DIRECTORY$1 },
        {
          showErrorToast: (r) => {
            return r.code >= 404 || r.code < 200 && r.code !== 404;
          }
        }
      );
      if (rsp.code) {
        setError(rsp.message || "Failed to load entries");
        toast.danger(rsp.message || "Failed to load entries");
      } else {
        const loadedEntries = ((_a = rsp.data) == null ? void 0 : _a.entries) || [];
        setEntries(loadedEntries);
        if (loadedEntries.length === 0) {
          toast.default("No entries found in the directory");
        }
      }
    } catch (e) {
      const errorMsg = (e == null ? void 0 : e.message) || "An error occurred while loading entries";
      setError(errorMsg);
      toast.danger(errorMsg);
    } finally {
      setLoading(false);
    }
  };
  reactExports.useEffect(() => {
    loadEntries();
  }, []);
  const handleOpenMediaPlayer = () => {
    if (entries.length === 0) {
      toast.warning("No entries to display. Please load entries first.");
      return;
    }
    MediaPlayer.show({
      entries,
      defaultActiveIndex: 0,
      autoPlay
    });
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "media-player-test-container", style: { padding: "20px" }, children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        style: {
          marginBottom: "20px",
          display: "flex",
          gap: "10px",
          flexWrap: "wrap",
          alignItems: "center"
        },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              color: "primary",
              onClick: handleOpenMediaPlayer,
              isDisabled: loading || entries.length === 0,
              children: "Open Media Player"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            Button,
            {
              color: "secondary",
              onClick: loadEntries,
              isDisabled: loading,
              children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(spinner_default, { size: "sm" }) : "Reload Entries"
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsxs(
            Button,
            {
              color: autoPlay ? "success" : "default",
              variant: autoPlay ? "solid" : "bordered",
              onClick: () => {
                setAutoPlay(!autoPlay);
              },
              children: [
                "Auto Play: ",
                autoPlay ? "ON" : "OFF"
              ]
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { marginLeft: "20px", color: "#666", fontSize: "14px" }, children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Loading..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
            "Entries: ",
            entries.length,
            " items from ",
            TEST_DIRECTORY$1
          ] }) })
        ]
      }
    ),
    error && /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        style: {
          marginBottom: "20px",
          padding: "15px",
          background: "#fee",
          borderRadius: "8px",
          color: "#c33"
        },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Error:" }),
          " ",
          error
        ]
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "20px", padding: "15px", background: "#f5f5f5", borderRadius: "8px" }, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { style: { marginTop: 0, marginBottom: "10px" }, children: "Loaded Entries Preview:" }),
      loading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { textAlign: "center", padding: "20px" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(spinner_default, { size: "lg" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "10px", color: "#666" }, children: [
          "Loading entries from ",
          TEST_DIRECTORY$1,
          "..."
        ] })
      ] }) : entries.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { style: { color: "#666", textAlign: "center", padding: "20px" }, children: "No entries found. The directory might be empty or inaccessible." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { fontSize: "12px", color: "#666", maxHeight: "200px", overflowY: "auto" }, children: [
        entries.slice(0, 20).map((entry, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginBottom: "4px" }, children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { fontWeight: "bold" }, children: entry.name }),
          " - ",
          entry.path,
          entry.type === IwFsType.Directory && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "#0066cc", marginLeft: "8px" }, children: "[DIRECTORY]" }),
          entry.type === IwFsType.CompressedFileEntry && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { style: { color: "#cc6600", marginLeft: "8px" }, children: "[COMPRESSED]" })
        ] }, index)),
        entries.length > 20 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          "... and ",
          entries.length - 20,
          " more entries"
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style: { marginTop: "20px", padding: "15px", background: "#e8f4f8", borderRadius: "8px" }, children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { style: { marginTop: 0, marginBottom: "10px" }, children: "Features to Test:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { style: { margin: 0, paddingLeft: "20px", fontSize: "14px", color: "#555" }, children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Left panel: Collapsible thumbnail panel with all entries" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Thumbnails: Click to preview files, double-click directories/compressed files to open nested player" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Page counter: Shows current/total playable items at top of left panel" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Nested players: Double-click directories or compressed files to open new player above current" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Right panel: Vertical scrolling content area for media preview" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Media types: Images, videos, audios, text files" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Visual indicators: Directories and compressed files show badges" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Preloading: Next 3 image items are preloaded automatically" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Keyboard: Arrow keys to navigate, Escape to close (closes nested players first)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Flat structure: No tree expansion - all entries shown in flat list" })
      ] })
    ] })
  ] });
};
MediaPlayerTest.displayName = "MediaPlayerTest";
const TEST_DIRECTORY = "/Users/anobaka/git";
const WindowedMediaPlayerTest = () => {
  const { createWindow } = useBakabaseContext();
  const [entries, setEntries] = reactExports.useState([]);
  const [loading, setLoading] = reactExports.useState(false);
  const [error, setError] = reactExports.useState(null);
  const [autoPlay, setAutoPlay] = reactExports.useState(false);
  const [windowCount, setWindowCount] = reactExports.useState(0);
  const loadEntries = async () => {
    var _a;
    setLoading(true);
    setError(null);
    try {
      const rsp = await BApi.file.getChildrenIwFsInfo(
        { root: TEST_DIRECTORY },
        {
          showErrorToast: (r) => {
            return r.code >= 404 || r.code < 200 && r.code !== 404;
          }
        }
      );
      if (rsp.code) {
        setError(rsp.message || "Failed to load entries");
        toast.danger(rsp.message || "Failed to load entries");
      } else {
        const loadedEntries = ((_a = rsp.data) == null ? void 0 : _a.entries) || [];
        setEntries(loadedEntries);
        if (loadedEntries.length === 0) {
          toast.default("No entries found in the directory");
        }
      }
    } catch (e) {
      const errorMsg = (e == null ? void 0 : e.message) || "An error occurred while loading entries";
      setError(errorMsg);
      toast.danger(errorMsg);
    } finally {
      setLoading(false);
    }
  };
  reactExports.useEffect(() => {
    loadEntries();
  }, []);
  const handleOpenWindowedMediaPlayer = () => {
    if (entries.length === 0) {
      toast.warning("No entries to display. Please load entries first.");
      return;
    }
    const instanceId = windowCount + 1;
    setWindowCount(instanceId);
    createWindow(MediaPlayer, {
      entries,
      defaultActiveIndex: 0,
      autoPlay
    }, {
      title: `Media Player ${instanceId}`,
      persistent: true,
      afterClose: () => {
        setWindowCount((prev) => Math.max(0, prev - 1));
      }
    });
  };
  const handleOpenMultipleWindows = () => {
    if (entries.length === 0) {
      toast.warning("No entries to display. Please load entries first.");
      return;
    }
    for (let i = 0; i < 3; i++) {
      setTimeout(() => {
        const instanceId = windowCount + i + 1;
        setWindowCount((prev) => prev + 1);
        createWindow(MediaPlayer, {
          entries,
          defaultActiveIndex: i % Math.min(entries.length, 10),
          // Different starting index for each
          autoPlay
        }, {
          title: `Media Player ${instanceId}`,
          persistent: true,
          afterClose: () => {
            setWindowCount((prev) => Math.max(0, prev - 1));
          }
        });
      }, i * 100);
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "windowed-media-player-test-container p-5", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap gap-2.5 items-center mb-5", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          color: "primary",
          isDisabled: loading || entries.length === 0,
          onClick: handleOpenWindowedMediaPlayer,
          children: "Open Windowed Media Player"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        Button,
        {
          color: "secondary",
          isDisabled: loading || entries.length === 0,
          onClick: handleOpenMultipleWindows,
          children: "Open 3 Windows"
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { color: "secondary", isDisabled: loading, onClick: loadEntries, children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx(spinner_default, { size: "sm" }) : "Reload Entries" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(
        Button,
        {
          color: autoPlay ? "success" : "default",
          variant: autoPlay ? "solid" : "bordered",
          onClick: () => {
            setAutoPlay(!autoPlay);
          },
          children: [
            "Auto Play: ",
            autoPlay ? "ON" : "OFF"
          ]
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-5 text-gray-600 text-sm", children: loading ? /* @__PURE__ */ jsxRuntimeExports.jsx("span", { children: "Loading..." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
        "Entries: ",
        entries.length,
        " items from ",
        TEST_DIRECTORY
      ] }) }),
      windowCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "ml-5 px-3 py-1.5 bg-blue-100 dark:bg-blue-900 rounded text-blue-700 dark:text-blue-300 text-sm font-medium", children: [
        "Active Windows: ",
        windowCount
      ] })
    ] }),
    error && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-5 p-4 bg-red-50 dark:bg-red-900/20 rounded-lg text-red-700 dark:text-red-400", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Error:" }),
      " ",
      error
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 p-4 bg-gray-50 dark:bg-gray-800 rounded-lg", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "mt-0 mb-2.5 text-lg font-semibold", children: "Loaded Entries Preview:" }),
      loading ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-center py-5", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(spinner_default, { size: "lg" }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2.5 text-gray-600", children: [
          "Loading entries from ",
          TEST_DIRECTORY,
          "..."
        ] })
      ] }) : entries.length === 0 ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-gray-600 text-center py-5", children: "No entries found. The directory might be empty or inaccessible." }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-gray-600 dark:text-gray-400 max-h-[200px] overflow-y-auto", children: [
        entries.slice(0, 20).map((entry, index) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mb-1", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-bold", children: entry.name }),
          " - ",
          entry.path,
          entry.type === IwFsType.Directory && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-blue-600 dark:text-blue-400 ml-2", children: "[DIRECTORY]" }),
          entry.type === IwFsType.CompressedFileEntry && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-orange-600 dark:text-orange-400 ml-2", children: "[COMPRESSED]" })
        ] }, index)),
        entries.length > 20 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
          "... and ",
          entries.length - 20,
          " more entries"
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 p-4 bg-blue-50 dark:bg-blue-900/20 rounded-lg", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "mt-0 mb-2.5 text-base font-semibold", children: "Features to Test:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "m-0 pl-5 text-sm text-gray-700 dark:text-gray-300 space-y-1", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Multiple Instances:" }),
          ' Click "Open 3 Windows" to test multiple windows simultaneously'
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Drag:" }),
          " Click and hold the window header, then drag to move windows around"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Resize:" }),
          " Hover over window edges/corners and drag to resize"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Minimize:" }),
          " Click the minimize button (or double-click header) to minimize to title bar"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Maximize:" }),
          " Click the maximize button (or double-click header) to toggle full screen"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Close:" }),
          " Click the close button (X) to close windows"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Magnetic Snapping:" }),
          " Windows automatically snap to viewport edges and other windows when dragging/resizing"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Z-Index:" }),
          " Clicking a window brings it to the front"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Independent Control:" }),
          " Each window can be dragged, resized, minimized, and maximized independently"
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsxs("li", { children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "MediaPlayer Features:" }),
          " All MediaPlayer features work within windows (thumbnails, navigation, nested players, etc.)"
        ] })
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-5 p-4 bg-yellow-50 dark:bg-yellow-900/20 rounded-lg", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "mt-0 mb-2.5 text-base font-semibold", children: "Testing Tips:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("ul", { className: "m-0 pl-5 text-sm text-gray-700 dark:text-gray-300 space-y-1", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Open multiple windows and try dragging them near each other to see magnetic snapping" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Resize windows near viewport edges to see edge snapping" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Minimize some windows and maximize others to test different states" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Try overlapping windows and clicking on them to test z-index management" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("li", { children: "Test that each window maintains its own media playback state independently" })
      ] })
    ] })
  ] });
};
WindowedMediaPlayerTest.displayName = "WindowedMediaPlayerTest";
const AfterFirstPlayOperationsModalTest = () => {
  const { createPortal } = useBakabaseContext();
  return /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { onPress: () => {
    createPortal(AfterFirstPlayOperationsModal, {
      entry: { path: "/path/to/file" }
    });
  }, children: "Open" });
};
const createMockMark = (id, path, type, priority) => ({
  id,
  path,
  type,
  priority,
  syncStatus: 0,
  configJson: "",
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
  isDeleted: false
});
const mockGroups = [
  // === C: Drive - Mixed valid/invalid in nested structure ===
  // Valid parent
  {
    path: "C:/Users/Demo/Videos/Anime",
    marks: [createMockMark(1, "C:/Users/Demo/Videos/Anime", PathMarkType.Resource, 1)],
    exists: true
  },
  // Valid child under valid parent
  {
    path: "C:/Users/Demo/Videos/Anime/Subdir",
    marks: [createMockMark(6, "C:/Users/Demo/Videos/Anime/Subdir", PathMarkType.MediaLibrary, 10)],
    exists: true
  },
  // INVALID child under valid parent (deleted subfolder)
  {
    path: "C:/Users/Demo/Videos/Anime/DeletedSeason",
    marks: [createMockMark(8, "C:/Users/Demo/Videos/Anime/DeletedSeason", PathMarkType.Resource, 1)],
    exists: false
  },
  // Valid sibling
  {
    path: "C:/Users/Demo/Videos/Movies",
    marks: [
      createMockMark(2, "C:/Users/Demo/Videos/Movies", PathMarkType.Resource, 1),
      createMockMark(3, "C:/Users/Demo/Videos/Movies", PathMarkType.Property, 100)
    ],
    exists: true
  },
  // INVALID sibling (deleted folder at same level)
  {
    path: "C:/Users/Demo/Videos/DeletedCategory",
    marks: [createMockMark(9, "C:/Users/Demo/Videos/DeletedCategory", PathMarkType.Resource, 1)],
    exists: false
  },
  // Deep nested: valid -> valid -> INVALID
  {
    path: "C:/Users/Demo/Videos/Movies/Action",
    marks: [createMockMark(10, "C:/Users/Demo/Videos/Movies/Action", PathMarkType.Resource, 1)],
    exists: true
  },
  {
    path: "C:/Users/Demo/Videos/Movies/Action/2024",
    marks: [createMockMark(11, "C:/Users/Demo/Videos/Movies/Action/2024", PathMarkType.Resource, 1)],
    exists: true
  },
  {
    path: "C:/Users/Demo/Videos/Movies/Action/2024/Deleted",
    marks: [createMockMark(12, "C:/Users/Demo/Videos/Movies/Action/2024/Deleted", PathMarkType.Resource, 1)],
    exists: false
  },
  // Valid after invalid in same branch
  {
    path: "C:/Users/Demo/Videos/Movies/Action/2023",
    marks: [createMockMark(13, "C:/Users/Demo/Videos/Movies/Action/2023", PathMarkType.Resource, 1)],
    exists: true
  },
  // === D: Drive - Single invalid path ===
  {
    path: "D:/OldMedia/DeletedFolder",
    marks: [createMockMark(4, "D:/OldMedia/DeletedFolder", PathMarkType.Resource, 1)],
    exists: false
  },
  // === E: Drive - External drive not connected ===
  {
    path: "E:/ExternalDrive/NotConnected",
    marks: [createMockMark(5, "E:/ExternalDrive/NotConnected", PathMarkType.Property, 50)],
    exists: false
  },
  // Another path on same disconnected drive
  {
    path: "E:/ExternalDrive/AnotherFolder",
    marks: [createMockMark(14, "E:/ExternalDrive/AnotherFolder", PathMarkType.Resource, 1)],
    exists: false
  },
  // === F: Drive - Removed partition ===
  {
    path: "F:/RemovedPartition/Data",
    marks: [createMockMark(7, "F:/RemovedPartition/Data", PathMarkType.Resource, 1)],
    exists: false
  },
  // === H: Drive - Invalid nested in invalid ===
  // Parent invalid
  {
    path: "H:/DeletedDrive/Folder1",
    marks: [createMockMark(18, "H:/DeletedDrive/Folder1", PathMarkType.Resource, 1)],
    exists: false
  },
  // Child also invalid (parent folder was deleted)
  {
    path: "H:/DeletedDrive/Folder1/SubFolder",
    marks: [createMockMark(19, "H:/DeletedDrive/Folder1/SubFolder", PathMarkType.Resource, 1)],
    exists: false
  },
  // Deeper child also invalid
  {
    path: "H:/DeletedDrive/Folder1/SubFolder/DeepFolder",
    marks: [createMockMark(20, "H:/DeletedDrive/Folder1/SubFolder/DeepFolder", PathMarkType.Resource, 1)],
    exists: false
  },
  // Another branch, also all invalid
  {
    path: "H:/DeletedDrive/Folder2",
    marks: [createMockMark(21, "H:/DeletedDrive/Folder2", PathMarkType.Resource, 1)],
    exists: false
  },
  {
    path: "H:/DeletedDrive/Folder2/Data",
    marks: [createMockMark(22, "H:/DeletedDrive/Folder2/Data", PathMarkType.Property, 50)],
    exists: false
  },
  // === G: Drive - All valid for comparison ===
  {
    path: "G:/Backup/Media",
    marks: [createMockMark(15, "G:/Backup/Media", PathMarkType.Resource, 1)],
    exists: true
  },
  {
    path: "G:/Backup/Media/Photos",
    marks: [createMockMark(16, "G:/Backup/Media/Photos", PathMarkType.Resource, 1)],
    exists: true
  },
  {
    path: "G:/Backup/Media/Videos",
    marks: [createMockMark(17, "G:/Backup/Media/Videos", PathMarkType.Resource, 1)],
    exists: true
  }
];
const PathMarksInvalidPathsTest = () => {
  const { t } = useTranslation();
  const [showOnlyInvalid, setShowOnlyInvalid] = reactExports.useState(false);
  const invalidPathsCount = mockGroups.filter((g) => g.exists === false).length;
  const filteredGroups = showOnlyInvalid ? mockGroups.filter((g) => g.exists === false) : mockGroups;
  const handleConfigureSubPathMarks = reactExports.useCallback(
    (path) => {
      toast.success(`Configure sub-path marks: ${path} (In production this would open PathConfigModal)`);
      console.log("Configure sub-path marks", path);
    },
    []
  );
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "path-marks-page h-full flex flex-col", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-4 p-4 flex-1 min-h-0", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center justify-between", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "text-xl font-semibold", children: [
      t("pathMarks.title"),
      " - Mock Test"
    ] }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm text-default-500", children: [
      "This is a mock test showing how invalid paths are displayed. Total ",
      mockGroups.length,
      " paths, ",
      invalidPathsCount,
      " invalid."
    ] }),
    invalidPathsCount > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-3 p-3 bg-warning-50 border border-warning-200 rounded-lg", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(AiOutlineWarning, { className: "text-warning text-xl flex-shrink-0" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-warning-700", children: t("{{count}} path(s) no longer exist on the file system", { count: invalidPathsCount }) }) }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-sm text-default-600", children: t("pathMarks.label.showOnlyInvalid") }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          switch_default,
          {
            isSelected: showOnlyInvalid,
            size: "sm",
            onValueChange: setShowOnlyInvalid
          }
        )
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-auto flex-1 min-h-0 border border-default-200 rounded-lg p-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      PathTree,
      {
        groups: filteredGroups,
        onConfigureSubPathMarks: handleConfigureSubPathMarks,
        onDeleteMark: (path, mark) => {
          toast.success(`Deleted mark ${mark.id} from ${path} (mock)`);
          console.log("Delete mark", path, mark);
        },
        onDeletePathMarks: (path) => {
          toast.success(`Deleted all marks from ${path} (mock)`);
          console.log("Delete path marks", path);
        },
        onSaveMark: (path, mark, oldMark) => {
          toast.success(`Saved mark to ${path} (mock)`);
          console.log("Save mark", path, mark, oldMark);
        },
        onPasteMarks: (path, marks) => {
          toast.success(`Pasted ${marks.length} marks to ${path} (mock)`);
          console.log("Paste marks", path, marks);
        }
      }
    ) })
  ] }) });
};
const createMockProperty = (type, name, bizValueType, dbValueType) => ({
  id: Math.random(),
  pool: PropertyPool.Custom,
  poolName: "Custom",
  type,
  typeName: PropertyType[type],
  name,
  bizValueType,
  dbValueType,
  order: 0
});
const availableValueTypes = [
  BulkModificationProcessorValueType.ManuallyInput,
  BulkModificationProcessorValueType.Variable
];
const mockVariables = [
  {
    key: "var1",
    name: "Test Variable 1",
    propertyPool: PropertyPool.Custom,
    propertyId: 1,
    property: createMockProperty(
      PropertyType.SingleLineText,
      "Source Property",
      StandardValueType.String,
      StandardValueType.String
    ),
    scope: 1
  }
];
const noop = () => {
};
const BulkModificationProcessEditorsTest = () => {
  const multipleChoiceProperty = createMockProperty(
    PropertyType.MultipleChoice,
    "Test Multiple Choice",
    StandardValueType.ListString,
    StandardValueType.ListString
  );
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-4 p-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-xl font-bold", children: "Bulk Modification Process Editors Test" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-default-500", children: "This page demonstrates all available process editors for bulk modification." }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(divider_default, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "String (SingleLineText)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor,
          {
            availableValueTypes,
            propertyType: PropertyType.SingleLineText,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "Number" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$1,
          {
            availableValueTypes,
            propertyType: PropertyType.Number,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "Boolean" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$2,
          {
            availableValueTypes,
            propertyType: PropertyType.Boolean,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "DateTime" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$3,
          {
            availableValueTypes,
            propertyType: PropertyType.DateTime,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "Time" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$4,
          {
            availableValueTypes,
            propertyType: PropertyType.Time,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "Link" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$5,
          {
            availableValueTypes,
            propertyType: PropertyType.Link,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "ListString (MultipleChoice)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$6,
          {
            availableValueTypes,
            property: multipleChoiceProperty,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "ListListString (Multilevel)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$7,
          {
            availableValueTypes,
            propertyType: PropertyType.Multilevel,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { className: "font-semibold", children: "ListTag (Tags)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(
          Editor$8,
          {
            availableValueTypes,
            propertyType: PropertyType.Tags,
            variables: mockVariables,
            onChange: noop
          }
        ) })
      ] })
    ] })
  ] });
};
BulkModificationProcessEditorsTest.displayName = "BulkModificationProcessEditorsTest";
const AllPropertyTypes = [
  { type: PropertyType.SingleLineText, name: "SingleLineText" },
  { type: PropertyType.MultilineText, name: "MultilineText" },
  { type: PropertyType.SingleChoice, name: "SingleChoice" },
  { type: PropertyType.MultipleChoice, name: "MultipleChoice" },
  { type: PropertyType.Number, name: "Number" },
  { type: PropertyType.Percentage, name: "Percentage" },
  { type: PropertyType.Rating, name: "Rating" },
  { type: PropertyType.Boolean, name: "Boolean" },
  { type: PropertyType.Link, name: "Link" },
  { type: PropertyType.Attachment, name: "Attachment" },
  { type: PropertyType.Date, name: "Date" },
  { type: PropertyType.DateTime, name: "DateTime" },
  { type: PropertyType.Time, name: "Time" },
  { type: PropertyType.Formula, name: "Formula" },
  { type: PropertyType.Multilevel, name: "Multilevel" },
  { type: PropertyType.Tags, name: "Tags" }
];
const RuleTestPanel = ({ propertyType, propertyName }) => {
  const { t } = useTranslation();
  const availableModes = getAvailableModesForPropertyType(propertyType);
  const fakeProperty = {
    id: 1,
    pool: PropertyPool.Custom,
    name: propertyName,
    type: propertyType
  };
  const [config, setConfig] = reactExports.useState({
    propertyPool: PropertyPool.Custom,
    propertyId: 1,
    property: fakeProperty,
    mode: availableModes[0],
    weight: 1,
    isVeto: false,
    vetoThreshold: 1,
    oneNullBehavior: NullValueBehavior.Skip,
    bothNullBehavior: NullValueBehavior.Skip
  });
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "mb-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(card_header_default, { className: "flex items-center gap-2 pb-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx(
        BriefProperty,
        {
          property: { name: propertyName, pool: PropertyPool.Custom, type: propertyType }
        }
      ),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-default-400 ml-auto", children: [
        "Modes: ",
        availableModes.map((m) => ComparisonMode[m]).join(", ")
      ] })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { className: "pt-0", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
      RuleConfigPanel,
      {
        value: config,
        onChange: setConfig,
        showPropertySelector: false
      }
    ) })
  ] });
};
const ComparisonRuleTest = () => {
  const { t } = useTranslation();
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-4 p-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-xl font-bold", children: "Comparison Rule Configuration Test" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-default-500", children: "This page shows the real RuleConfigPanel component for all property types. Each property type has different available comparison modes." }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 lg:grid-cols-2 gap-4", children: AllPropertyTypes.map((pt) => /* @__PURE__ */ jsxRuntimeExports.jsx(
      RuleTestPanel,
      {
        propertyName: pt.name,
        propertyType: pt.type
      },
      pt.type
    )) })
  ] });
};
ComparisonRuleTest.displayName = "ComparisonRuleTest";
const createTestProperty = (type, options = {}) => ({
  id: type,
  name: PropertyTypeLabel[type],
  type,
  pool: PropertyPool.Custom,
  dbValueType: getDbValueType(type),
  bizValueType: getBizValueType(type),
  typeName: PropertyTypeLabel[type],
  poolName: PropertyPoolLabel[PropertyPool.Custom],
  order: type,
  options
});
const testProperties = [
  createTestProperty(PropertyType.SingleLineText),
  createTestProperty(PropertyType.MultilineText),
  createTestProperty(PropertyType.SingleChoice, {
    choices: [
      { label: "Option A", value: "opt-a", color: "#ff5733" },
      { label: "Option B", value: "opt-b", color: "#33ff57" },
      { label: "Option C", value: "opt-c", color: "#3357ff" }
    ]
  }),
  createTestProperty(PropertyType.MultipleChoice, {
    choices: [
      { label: "Choice 1", value: "ch-1", color: "#e91e63" },
      { label: "Choice 2", value: "ch-2", color: "#9c27b0" },
      { label: "Choice 3", value: "ch-3", color: "#673ab7" }
    ]
  }),
  createTestProperty(PropertyType.Number, { precision: 2 }),
  createTestProperty(PropertyType.Percentage, { precision: 1, showProgressbar: true }),
  createTestProperty(PropertyType.Rating, { maxValue: 5 }),
  createTestProperty(PropertyType.Boolean),
  createTestProperty(PropertyType.Link),
  createTestProperty(PropertyType.Attachment),
  createTestProperty(PropertyType.Date),
  createTestProperty(PropertyType.DateTime),
  createTestProperty(PropertyType.Time),
  createTestProperty(PropertyType.Formula),
  createTestProperty(PropertyType.Multilevel, {
    data: [
      {
        value: "ml-1",
        label: "Level 1",
        children: [
          {
            value: "ml-1-1",
            label: "Level 1-1",
            color: "#4caf50",
            children: [
              { value: "ml-1-1-1", label: "Level 1-1-1" }
            ]
          },
          { value: "ml-1-2", label: "Level 1-2" }
        ]
      },
      { value: "ml-2", label: "Level 2", color: "#2196f3" }
    ]
  }),
  createTestProperty(PropertyType.Tags, {
    tags: [
      { value: "tag-1", group: "Group A", name: "Tag 1" },
      { value: "tag-2", group: "Group A", name: "Tag 2" },
      { value: "tag-3", group: "Group B", name: "Tag 3" },
      { value: "tag-4", name: "Ungrouped Tag" }
    ]
  })
];
const getSampleValues = (propertyType) => {
  switch (propertyType) {
    case PropertyType.SingleLineText:
      return { dbValue: "Sample single line text" };
    case PropertyType.MultilineText:
      return { dbValue: "Line 1\nLine 2\nLine 3" };
    case PropertyType.SingleChoice:
      return { dbValue: "opt-a", bizValue: "Option A" };
    case PropertyType.MultipleChoice:
      return { dbValue: ["ch-1", "ch-2"], bizValue: ["Choice 1", "Choice 2"] };
    case PropertyType.Number:
      return { dbValue: 12345.67 };
    case PropertyType.Percentage:
      return { dbValue: 75.5 };
    case PropertyType.Rating:
      return { dbValue: 4 };
    case PropertyType.Boolean:
      return { dbValue: true };
    case PropertyType.Link:
      return { dbValue: { text: "Example Link", url: "https://example.com" } };
    case PropertyType.Attachment:
      return { dbValue: ["/path/to/file1.jpg", "/path/to/file2.png"] };
    case PropertyType.Date:
      return { dbValue: dayjs("2024-06-15") };
    case PropertyType.DateTime:
      return { dbValue: dayjs("2024-06-15T14:30:00") };
    case PropertyType.Time:
      return { dbValue: dayjs.duration({ hours: 2, minutes: 30, seconds: 45 }) };
    case PropertyType.Formula:
      return { dbValue: "=SUM(A1:A10)" };
    case PropertyType.Multilevel:
      return { dbValue: ["ml-1-1-1"], bizValue: [["Level 1", "Level 1-1", "Level 1-1-1"]] };
    case PropertyType.Tags:
      return {
        dbValue: ["tag-1", "tag-3"],
        bizValue: [
          { group: "Group A", name: "Tag 1" },
          { group: "Group B", name: "Tag 3" }
        ]
      };
    default:
      return { dbValue: void 0 };
  }
};
const getSerializedValues = (property, hasValue) => {
  if (!hasValue) {
    return { dbValue: void 0, bizValue: void 0 };
  }
  const { dbValue, bizValue } = getSampleValues(property.type);
  const dbValueType = getDbValueType(property.type);
  const bizValueType = getBizValueType(property.type);
  return {
    dbValue: serializeStandardValue(dbValue, dbValueType),
    bizValue: bizValue !== void 0 ? serializeStandardValue(bizValue, bizValueType) : void 0
  };
};
const variants = ["default", "light"];
const sizes = ["sm", "md", "lg"];
const hasValueOptions = [true, false];
const isReadonlyOptions = [false, true];
const isEditingOptions = [void 0, true, false];
const PropertyValueRendererTestPage = () => {
  const [changedValues, setChangedValues] = reactExports.useState({});
  const handleValueChange = (key) => (dbValue, bizValue) => {
    setChangedValues((prev) => ({
      ...prev,
      [key]: { dbValue, bizValue }
    }));
    console.log(`Value changed for ${key}:`, { dbValue, bizValue });
  };
  const renderCell = (property, variant, size, isReadonly, isEditing, hasValue) => {
    const key = `${property.type}-${variant}-${size}-${isReadonly}-${isEditing}-${hasValue}`;
    const hasChangedValue = key in changedValues;
    const changedValue = changedValues[key];
    const initialValues = getSerializedValues(property, hasValue);
    const dbValue = hasChangedValue ? changedValue.dbValue : initialValues.dbValue;
    const bizValue = hasChangedValue ? changedValue.bizValue : initialValues.bizValue;
    const props = {
      property,
      dbValue,
      bizValue,
      variant,
      size,
      isReadonly
    };
    if (isEditing !== void 0) {
      props.isEditing = isEditing;
    }
    if (!isReadonly) {
      props.onValueChange = handleValueChange(key);
    }
    return /* @__PURE__ */ jsxRuntimeExports.jsx(PropertyValueRenderer, { ...props }, key);
  };
  const renderSizeStack = (property, variant, isReadonly, isEditing, hasValue) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-2", children: sizes.map((size) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center gap-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gray-400 w-6 text-right", children: size }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex-1", children: renderCell(property, variant, size, isReadonly, isEditing, hasValue) })
    ] }, size)) });
  };
  const renderPropertyTable = (property) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "overflow-x-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsxs("table", { className: "border-collapse text-xs", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("thead", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { className: "bg-default-100", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "border p-1 text-left", children: "hasValue" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "border p-1 text-left", children: "isReadonly" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "border p-1 text-left", children: "isEditing" }),
      variants.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx("th", { className: "border p-1 text-center min-w-[200px]", children: variant }, variant))
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("tbody", { children: hasValueOptions.map(
      (hasValue) => isReadonlyOptions.map(
        (isReadonly, isReadonlyIdx) => isEditingOptions.map((isEditing, isEditingIdx) => /* @__PURE__ */ jsxRuntimeExports.jsxs("tr", { children: [
          isReadonlyIdx === 0 && isEditingIdx === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "td",
            {
              className: "border p-1 align-top font-medium",
              rowSpan: isReadonlyOptions.length * isEditingOptions.length,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: hasValue ? "text-blue-600" : "text-gray-400", children: hasValue ? "value" : "undefined" })
            }
          ),
          isEditingIdx === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx(
            "td",
            {
              className: "border p-1 align-top",
              rowSpan: isEditingOptions.length,
              children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: isReadonly ? "text-green-600" : "text-orange-600", children: isReadonly ? "true" : "false" })
            }
          ),
          /* @__PURE__ */ jsxRuntimeExports.jsx("td", { className: "border p-1", children: /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: isEditing === void 0 ? "text-purple-500" : "", children: isEditing === void 0 ? "undefined" : String(isEditing) }) }),
          variants.map((variant) => /* @__PURE__ */ jsxRuntimeExports.jsx(
            "td",
            {
              className: `border p-2 ${variant === "light" ? "bg-default-50" : ""}`,
              children: renderSizeStack(property, variant, isReadonly, isEditing, hasValue)
            },
            variant
          ))
        ] }, `${hasValue}-${isReadonly}-${isEditing}`))
      )
    ) })
  ] }) });
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col gap-4 p-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-2xl font-bold", children: "PropertyValueRenderer Test Cases" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-500", children: "Dimensions: hasValue x isReadonly x isEditing x size x variant" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-gray-400", children: 'Default values: variant="default", size="md", isReadonly=false' }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Tabs, { "aria-label": "Property Types", children: testProperties.map((property) => /* @__PURE__ */ jsxRuntimeExports.jsx(Tab, { title: property.name, children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "pt-4", children: renderPropertyTable(property) }) }, property.type)) }),
    Object.keys(changedValues).length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "fixed bottom-4 right-4 bg-default-100 p-4 rounded-lg shadow-lg max-w-md max-h-60 overflow-auto z-20", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold mb-2", children: "Changed Values:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-xs", children: JSON.stringify(changedValues, null, 2) })
    ] })
  ] });
};
PropertyValueRendererTestPage.displayName = "PropertyValueRendererTestPage";
const baseResource = (overrides = {}) => ({
  id: Math.floor(Math.random() * 1e5),
  mediaLibraryId: 1,
  categoryId: 1,
  status: ResourceStatus.Active,
  fileName: "test-resource",
  path: "/fake/path/test-resource",
  hasChildren: false,
  isFile: false,
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
  updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
  fileCreatedAt: (/* @__PURE__ */ new Date()).toISOString(),
  fileModifiedAt: (/* @__PURE__ */ new Date()).toISOString(),
  pinned: false,
  tags: [],
  ...overrides
});
const ds = (dataType, origin, status, resourceId = 1) => ({
  resourceId,
  dataType,
  origin,
  status
});
const pi = (origin, key, displayName) => ({
  origin,
  key,
  displayName
});
function useDiscoveryLog() {
  const [logs, setLogs] = reactExports.useState([]);
  const addLog = (msg) => {
    setLogs((prev) => [...prev, { time: (/* @__PURE__ */ new Date()).toLocaleTimeString(), msg }]);
  };
  const makeCoverCallbacks = () => ({
    onDiscoveryStart: (id, origin) => addLog(`SSE Start: rid=${id}, origin=${DataOrigin[origin]}`),
    onDiscoveryComplete: (id, origin, data, error) => {
      if (error) {
        addLog(`SSE Error: rid=${id}, origin=${DataOrigin[origin]}, ${error}`);
      } else {
        addLog(`SSE Done: rid=${id}, origin=${DataOrigin[origin]}, covers=${JSON.stringify((data == null ? void 0 : data.coverPaths) ?? null)}`);
      }
    }
  });
  const makePlayCallbacks = () => ({
    onDiscoveryStart: (id, origin) => addLog(`SSE Start: rid=${id}, origin=${DataOrigin[origin]}`),
    onDiscoveryComplete: (id, origin, data, error) => {
      var _a;
      if (error) {
        addLog(`SSE Error: rid=${id}, origin=${DataOrigin[origin]}, ${error}`);
      } else {
        const items = (_a = data == null ? void 0 : data.playableItems) == null ? void 0 : _a.map((i) => `${DataOrigin[i.origin]}:${i.key}`);
        addLog(`SSE Done: rid=${id}, origin=${DataOrigin[origin]}, items=[${(items == null ? void 0 : items.join(", ")) ?? ""}]`);
      }
    }
  });
  return { logs, addLog, makeCoverCallbacks, makePlayCallbacks };
}
const coverCases = [
  {
    title: "No dataStates, no covers",
    description: "Phase 1: dataStates null, covers null. Should trigger SSE.",
    resource: baseResource({ dataStates: void 0, covers: void 0 })
  },
  {
    title: "All cover providers NotStarted",
    description: "Providers exist but none ready. Should trigger SSE.",
    resource: baseResource({
      dataStates: [
        ds(ResourceDataType.Cover, DataOrigin.Manual, DataStatus.NotStarted),
        ds(ResourceDataType.Cover, DataOrigin.FileSystem, DataStatus.NotStarted)
      ]
    })
  },
  {
    title: "Manual cover Ready, has covers",
    description: "User set cover. Should display immediately, no SSE.",
    resource: baseResource({
      covers: ["/fake/cover/manual.jpg"],
      dataStates: [
        ds(ResourceDataType.Cover, DataOrigin.Manual, DataStatus.Ready),
        ds(ResourceDataType.Cover, DataOrigin.FileSystem, DataStatus.Ready)
      ]
    })
  },
  {
    title: "Steam cover Ready, has covers (with path)",
    description: "Steam cover downloaded. Resource has path so FileSystem CoverProvider applies. FileSystem NotStarted → SSE should trigger for FileSystem.",
    resource: baseResource({
      covers: ["/fake/cover/steam-header.jpg"],
      dataStates: [
        ds(ResourceDataType.Cover, DataOrigin.Manual, DataStatus.Ready),
        ds(ResourceDataType.Cover, DataOrigin.Steam, DataStatus.Ready),
        ds(ResourceDataType.Cover, DataOrigin.FileSystem, DataStatus.NotStarted)
      ]
    })
  },
  {
    title: "Steam cover Ready, has covers (no path)",
    description: "Steam cover downloaded. Resource has no path so FileSystem CoverProvider doesn't apply. No FileSystem dataState. No SSE should trigger.",
    resource: baseResource({
      path: void 0,
      covers: ["/fake/cover/steam-header.jpg"],
      dataStates: [
        ds(ResourceDataType.Cover, DataOrigin.Manual, DataStatus.Ready),
        ds(ResourceDataType.Cover, DataOrigin.Steam, DataStatus.Ready)
      ]
    })
  },
  {
    title: "All Ready, no covers found",
    description: "All checked, none found. Should show fallback.",
    resource: baseResource({
      covers: void 0,
      dataStates: [
        ds(ResourceDataType.Cover, DataOrigin.Manual, DataStatus.Ready),
        ds(ResourceDataType.Cover, DataOrigin.FileSystem, DataStatus.Ready)
      ]
    })
  },
  {
    title: "FileSystem Ready with cover",
    description: "Local discovery found cover. No SSE needed.",
    resource: baseResource({
      covers: ["/fake/cover/local.jpg"],
      dataStates: [
        ds(ResourceDataType.Cover, DataOrigin.Manual, DataStatus.Ready),
        ds(ResourceDataType.Cover, DataOrigin.FileSystem, DataStatus.Ready)
      ]
    })
  }
];
const playCases = [
  {
    title: "No dataStates, no playableItems",
    description: "Phase 1: nothing loaded yet.",
    resource: baseResource({ dataStates: void 0, playableItems: void 0 })
  },
  {
    title: "FS PlayableItem NotStarted",
    description: "FS not ready. Should idle then trigger SSE on hover.",
    resource: baseResource({
      dataStates: [ds(ResourceDataType.PlayableItem, DataOrigin.FileSystem, DataStatus.NotStarted)]
    })
  },
  {
    title: "FS PlayableItem Ready, has items",
    description: "FS cache ready. No SSE needed.",
    resource: baseResource({
      playableItems: [
        pi(DataOrigin.FileSystem, "/fake/path/video.mp4", "video.mp4"),
        pi(DataOrigin.FileSystem, "/fake/path/game.exe", "game.exe")
      ],
      dataStates: [ds(ResourceDataType.PlayableItem, DataOrigin.FileSystem, DataStatus.Ready)]
    })
  },
  {
    title: "Steam only",
    description: "Steam item, no FS items.",
    resource: baseResource({
      playableItems: [pi(DataOrigin.Steam, "12345", "Half-Life 3")],
      dataStates: [
        ds(ResourceDataType.PlayableItem, DataOrigin.Steam, DataStatus.Ready),
        ds(ResourceDataType.PlayableItem, DataOrigin.FileSystem, DataStatus.NotStarted)
      ]
    })
  },
  {
    title: "Steam + DLsite + FS all ready",
    description: "Multi-source. No SSE needed.",
    resource: baseResource({
      playableItems: [
        pi(DataOrigin.Steam, "12345", "Steam Game"),
        pi(DataOrigin.DLsite, "RJ123456", "DLsite Work"),
        pi(DataOrigin.FileSystem, "/fake/path/game.exe", "game.exe")
      ],
      dataStates: [
        ds(ResourceDataType.PlayableItem, DataOrigin.Steam, DataStatus.Ready),
        ds(ResourceDataType.PlayableItem, DataOrigin.DLsite, DataStatus.Ready),
        ds(ResourceDataType.PlayableItem, DataOrigin.FileSystem, DataStatus.Ready)
      ]
    })
  },
  {
    title: "All Ready, no items",
    description: "All checked, nothing found.",
    resource: baseResource({
      playableItems: void 0,
      dataStates: [ds(ResourceDataType.PlayableItem, DataOrigin.FileSystem, DataStatus.Ready)]
    })
  },
  {
    title: "File resource (isFile=true)",
    description: "Single file resource.",
    resource: baseResource({
      isFile: true,
      playableItems: [pi(DataOrigin.FileSystem, "/fake/path/movie.mkv", "movie.mkv")],
      dataStates: [ds(ResourceDataType.PlayableItem, DataOrigin.FileSystem, DataStatus.Ready)]
    })
  }
];
const TestPlayPortal = (props) => {
  const { status, sources, fsDiscoveryStatus } = props;
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-2 border rounded text-xs space-y-1", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Status:" }),
      " ",
      status
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "FS Discovery:" }),
      " ",
      fsDiscoveryStatus
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "Sources:" }),
      " ",
      sources.length === 0 ? "none" : sources.map((s) => `${DataOrigin[s.source]}(${s.items.length})`).join(", ")
    ] }),
    sources.map((s) => /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "ml-2", children: /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { size: "sm", onPress: () => props.onPlaySource(s.source), children: [
      "Play ",
      DataOrigin[s.source]
    ] }) }, s.source))
  ] });
};
const CoverStatusPanel = ({ resolution, logs }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-[10px] space-y-0.5", children: [
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-center", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `inline-block w-2 h-2 rounded-full ${resolution.status === "ready" ? "bg-success" : resolution.status === "loading" ? "bg-warning animate-pulse" : "bg-default-300"}` }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
      "Cover: ",
      /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: resolution.status })
    ] })
  ] }),
  logs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-default-100 rounded p-1 max-h-20 overflow-auto font-mono", children: logs.map((l, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-default-600", children: [
    "[",
    l.time,
    "] ",
    l.msg
  ] }, i)) })
] });
const PlayStatusPanel = ({ resolution, logs }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-2 text-[10px] space-y-0.5", children: [
  /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-center", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: `inline-block w-2 h-2 rounded-full ${resolution.overallStatus === "ready" ? "bg-success" : resolution.overallStatus === "loading" ? "bg-warning animate-pulse" : "bg-default-300"}` }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
      "Play: ",
      /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: resolution.overallStatus }),
      " (",
      resolution.groups.length,
      " groups)"
    ] })
  ] }),
  logs.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "bg-default-100 rounded p-1 max-h-20 overflow-auto font-mono", children: logs.map((l, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-default-600", children: [
    "[",
    l.time,
    "] ",
    l.msg
  ] }, i)) })
] });
const CoverTestCase = ({ tc }) => {
  const { logs, makeCoverCallbacks } = useDiscoveryLog();
  const resolution = useCoverResolution(tc.resource, makeCoverCallbacks());
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "p-4 space-y-2", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-sm", children: tc.title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-500", children: tc.description }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border rounded p-2 bg-default-50", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-40 h-56 relative", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceCoverMemo, { resource: tc.resource }) }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(CoverStatusPanel, { resolution, logs }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "text-xs", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("summary", { className: "cursor-pointer text-default-400", children: "DataStates" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-[10px] bg-default-100 p-1 rounded overflow-auto max-h-20", children: JSON.stringify(tc.resource.dataStates ?? "null", null, 2) })
    ] })
  ] });
};
const PlayTestCase = ({ tc }) => {
  const { logs, makePlayCallbacks } = useDiscoveryLog();
  const resolution = usePlayableItemResolution(tc.resource, makePlayCallbacks());
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "p-4 space-y-2", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-sm", children: tc.title }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-500", children: tc.description }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "border rounded p-2 bg-default-50", children: /* @__PURE__ */ jsxRuntimeExports.jsx(PlayControl, { resource: tc.resource, PortalComponent: TestPlayPortal }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(PlayStatusPanel, { resolution, logs }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("details", { className: "text-xs", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("summary", { className: "cursor-pointer text-default-400", children: "DataStates" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-[10px] bg-default-100 p-1 rounded overflow-auto max-h-20", children: JSON.stringify(tc.resource.dataStates ?? "null", null, 2) })
    ] })
  ] });
};
const LiveSseTest = () => {
  const [resourceId, setResourceId] = reactExports.useState("");
  const [resource, setResource] = reactExports.useState(null);
  const [loading, setLoading] = reactExports.useState(false);
  const [log, setLog] = reactExports.useState([]);
  const [testKey, setTestKey] = reactExports.useState(0);
  const addLog = (msg) => {
    setLog((prev) => [...prev, { time: (/* @__PURE__ */ new Date()).toLocaleTimeString(), msg }]);
  };
  const resetAndLoad = async () => {
    const id = parseInt(resourceId);
    if (isNaN(id) || id <= 0)
      return;
    setLoading(true);
    setResource(null);
    setLog([]);
    setTestKey((prev) => prev + 1);
    try {
      addLog("Loading resource...");
      addLog("Loading resource (additionalItems=None)...");
      const rsp = await BApi.resource.getResourcesByKeys({ ids: [id], additionalItems: ResourceAdditionalItem.None });
      const resources = (rsp == null ? void 0 : rsp.data) ?? [];
      if (resources.length === 0) {
        addLog("ERROR: Resource not found.");
        setLoading(false);
        return;
      }
      const r = resources[0];
      addLog(`Loaded: id=${r.id}, path=${r.path}`);
      addLog(`covers=${JSON.stringify(r.covers ?? null)}, dataStates=${JSON.stringify(r.dataStates ?? null)}`);
      addLog("Rendering...");
      setResource(r);
    } catch (e) {
      addLog(`ERROR: ${e.message}`);
    } finally {
      setLoading(false);
    }
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "text-lg font-bold", children: "Live SSE Discovery Test" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-xs text-default-500", children: 'Enter a real resource ID. "Reset & Test" clears cache and reloads without Cover/PlayableItem data. Repeatable.' }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2 items-end", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-default-500 block mb-1", children: "Resource ID" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          "input",
          {
            type: "number",
            value: resourceId,
            onChange: (e) => setResourceId(e.target.value),
            className: "border rounded px-2 py-1 w-32 text-sm",
            placeholder: "e.g. 123"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { color: "primary", isLoading: loading, onPress: resetAndLoad, isDisabled: !resourceId || loading, children: "Reset & Test" })
    ] }),
    resource && /* @__PURE__ */ jsxRuntimeExports.jsx(LiveSseTestCards, { resource, parentLog: log, addParentLog: addLog }, testKey),
    log.length > 0 && /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "p-3", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-xs mb-1", children: "Global Log" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("pre", { className: "text-[10px] bg-default-100 p-2 rounded max-h-48 overflow-auto font-mono", children: log.map((l, i) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
        "[",
        l.time,
        "] ",
        l.msg
      ] }, i)) })
    ] })
  ] });
};
const LiveSseTestCards = ({ resource, addParentLog }) => {
  const coverCallbacks = {
    onDiscoveryStart: (id, origin) => addParentLog(`[Cover SSE] Start: rid=${id}, origin=${DataOrigin[origin]}`),
    onDiscoveryComplete: (id, origin, data, error) => error ? addParentLog(`[Cover SSE] Error: origin=${DataOrigin[origin]}, ${error}`) : addParentLog(`[Cover SSE] Done: origin=${DataOrigin[origin]}, coverPaths=${JSON.stringify((data == null ? void 0 : data.coverPaths) ?? null)}`)
  };
  const playCallbacks = {
    onDiscoveryStart: (id, origin) => addParentLog(`[Play SSE] Start: rid=${id}, origin=${DataOrigin[origin]}`),
    onDiscoveryComplete: (id, origin, data, error) => {
      var _a;
      return error ? addParentLog(`[Play SSE] Error: origin=${DataOrigin[origin]}, ${error}`) : addParentLog(`[Play SSE] Done: origin=${DataOrigin[origin]}, items=${((_a = data == null ? void 0 : data.playableItems) == null ? void 0 : _a.length) ?? 0}`);
    }
  };
  const coverResolution = useCoverResolution(resource, coverCallbacks);
  const playResolution = usePlayableItemResolution(resource, playCallbacks);
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "p-4 space-y-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-sm", children: "ResourceCover" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(CoverStatusPanel, { resolution: coverResolution, logs: [] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "w-40 h-56 relative border rounded", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceCoverMemo, { resource }) })
    ] }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "p-4 space-y-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "font-semibold text-sm", children: "PlayControl" }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(PlayStatusPanel, { resolution: playResolution, logs: [] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(PlayControl, { resource, PortalComponent: TestPlayPortal })
    ] })
  ] });
};
const PlayControlAndCoverTest = () => {
  const [selectedSection, setSelectedSection] = reactExports.useState("cover");
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "p-4 space-y-4", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "text-xl font-bold", children: "PlayControl & ResourceCover Test Cases" }),
    /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex gap-2", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { color: selectedSection === "cover" ? "primary" : "default", onPress: () => setSelectedSection("cover"), children: [
        "Cover (",
        coverCases.length,
        ")"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs(Button, { color: selectedSection === "play" ? "primary" : "default", onPress: () => setSelectedSection("play"), children: [
        "PlayControl (",
        playCases.length,
        ")"
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { color: selectedSection === "live" ? "primary" : "default", onPress: () => setSelectedSection("live"), children: "Live SSE" })
    ] }),
    selectedSection === "live" ? /* @__PURE__ */ jsxRuntimeExports.jsx(LiveSseTest, {}) : selectedSection === "cover" ? /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: coverCases.map((tc, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(CoverTestCase, { tc }, idx)) }) : /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4", children: playCases.map((tc, idx) => /* @__PURE__ */ jsxRuntimeExports.jsx(PlayTestCase, { tc }, idx)) })
  ] });
};
const ContextMenuQuickSetTest = () => {
  var _a;
  const uiOptionsStore = useUiOptionsStore();
  const resourceOptions = (_a = uiOptionsStore.data) == null ? void 0 : _a.resource;
  const items = (resourceOptions == null ? void 0 : resourceOptions.customContextMenuItems) ?? [];
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-4", style: { maxWidth: 800 }, children: /* @__PURE__ */ jsxRuntimeExports.jsx(
    QuickSetPropertyConfig,
    {
      items,
      onChange: (newItems) => uiOptionsStore.patch({
        resource: { ...resourceOptions, customContextMenuItems: newItems }
      }),
      autoAddRecentPropertyValues: resourceOptions == null ? void 0 : resourceOptions.autoAddRecentPropertyValues,
      onAutoAddChange: (value) => uiOptionsStore.patch({
        resource: { ...resourceOptions, autoAddRecentPropertyValues: value }
      })
    }
  ) });
};
ContextMenuQuickSetTest.displayName = "ContextMenuQuickSetTest";
const BuggyComponent = ({ shouldThrow }) => {
  if (shouldThrow === "render") {
    throw new Error("Test error thrown during render!");
  }
  if (shouldThrow === "undefined") {
    const obj = void 0;
    return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: obj.nonExistent.property });
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: "Component is working fine!" });
};
const AsyncBuggyComponent = () => {
  const [shouldThrow, setShouldThrow] = reactExports.useState(false);
  if (shouldThrow) {
    throw new Error("Test error with component stack trace!");
  }
  return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "This component will throw an error when the button is clicked:" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { color: "danger", size: "sm", onClick: () => setShouldThrow(true), children: "Click to throw error" })
  ] });
};
const ErrorBoundaryTestPage = ({ onClose }) => {
  const [errorType, setErrorType] = reactExports.useState("");
  const triggerError = (type) => {
    setErrorType(type);
  };
  const reset = () => {
    setErrorType("");
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsxs(card_default, { className: "max-w-2xl mx-auto mt-8", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(card_header_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center w-full", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("h3", { className: "text-lg font-bold", children: "Error Boundary Test" }),
      onClose && /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", variant: "light", onClick: onClose, children: "Close" })
    ] }) }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(card_body_default, { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-4", children: [
      /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600", children: "Use these buttons to test different types of errors and see how the error boundary handles them:" }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-1 gap-3", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            color: "danger",
            variant: "flat",
            onClick: () => triggerError("render"),
            children: "Throw Error During Render"
          }
        ),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            color: "danger",
            variant: "flat",
            onClick: () => triggerError("undefined"),
            children: "Trigger Undefined Property Error"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(spacer_default, { y: 2 }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t pt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Interactive Error Test:" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-2", children: "This component is wrapped with ErrorBoundary - click to see the error modal:" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(AsyncBuggyComponent, {}) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsx(spacer_default, { y: 2 }),
      errorType && /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t pt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-between items-center mb-2", children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold", children: "Error Component with ErrorBoundary:" }),
          /* @__PURE__ */ jsxRuntimeExports.jsx(Button, { size: "sm", variant: "light", onClick: reset, children: "Reset" })
        ] }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-2", children: "This will trigger the enhanced error modal with stack traces:" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundary, { children: /* @__PURE__ */ jsxRuntimeExports.jsx(BuggyComponent, { shouldThrow: errorType }) })
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "border-t pt-4 mt-4", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("h4", { className: "font-semibold mb-2", children: "Async Error Test (Not Caught by ErrorBoundary):" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-gray-600 mb-2", children: "Error boundaries don't catch async errors - this will show up in console:" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx(
          Button,
          {
            color: "warning",
            variant: "flat",
            onClick: () => {
              setTimeout(() => {
                throw new Error(
                  "Async error - this won't be caught by error boundary"
                );
              }, 100);
            },
            children: "Trigger Async Error (Check Console)"
          }
        )
      ] }),
      /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-gray-500 mt-4 p-3 bg-blue-50 rounded", children: [
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: /* @__PURE__ */ jsxRuntimeExports.jsx("strong", { children: "How to test:" }) }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "1. Click the buttons above to trigger errors wrapped in ErrorBoundary" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "2. You should see your enhanced error modal with error details and stack traces" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "3. The async error will only appear in browser console (F12)" }),
        /* @__PURE__ */ jsxRuntimeExports.jsx("p", { children: "4. The main app ErrorBoundary in BasicLayout will catch any unhandled errors throughout the app" })
      ] })
    ] }) })
  ] });
};
const SimpleLabel = (props) => {
  const { children, status = "default", className, ...otherProps } = props;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    "span",
    {
      className: `simple-label ${status} ${className || ""}`,
      ...otherProps,
      children
    }
  );
};
SimpleLabel.displayName = "SimpleLabel";
const VirtualListPage = () => {
  const [items, setItems] = reactExports.useState([1, 2, 3, 4, 5]);
  const listRef = reactExports.useRef();
  const removeItem = (index) => {
    setItems((prevItems) => prevItems.filter((_, i) => i !== index));
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    List,
    {
      ref: listRef,
      height: 300,
      rowCount: items.length,
      rowHeight: 20,
      rowRenderer: ({ index, key, style }) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { style, children: [
        items[index],
        /* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => removeItem(index), children: "Remove" })
      ] }, key),
      width: 300
    }
  );
};
VirtualListPage.displayName = "VirtualListPage";
const ResourceTransferPage = () => {
  const { createPortal } = useBakabaseContext();
  const [resources, setResources] = reactExports.useState([]);
  reactExports.useEffect(() => {
    BApi.resource.searchResources({
      pageSize: 20,
      page: 1
    }).then((r) => {
      setResources(r.data || []);
    });
  }, []);
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    Button,
    {
      onClick: () => {
        createPortal(ResourceTransferModal, {
          fromResources: resources
        });
      },
      children: "Open"
    }
  );
};
ResourceTransferPage.displayName = "ResourceTransferPage";
const components = {
  ContextMenuQuickSet: /* @__PURE__ */ jsxRuntimeExports.jsx(ContextMenuQuickSetTest, {}),
  PlayControlAndCover: /* @__PURE__ */ jsxRuntimeExports.jsx(PlayControlAndCoverTest, {}),
  PropertyValueRenderer: /* @__PURE__ */ jsxRuntimeExports.jsx(PropertyValueRendererTestPage, {}),
  ComparisonRule: /* @__PURE__ */ jsxRuntimeExports.jsx(ComparisonRuleTest, {}),
  BulkModificationProcessEditors: /* @__PURE__ */ jsxRuntimeExports.jsx(BulkModificationProcessEditorsTest, {}),
  PathMarksInvalidPaths: /* @__PURE__ */ jsxRuntimeExports.jsx(PathMarksInvalidPathsTest, {}),
  AfterFirstPlayOperationsModalTest: /* @__PURE__ */ jsxRuntimeExports.jsx(AfterFirstPlayOperationsModalTest, {}),
  FolderSelectorTest: /* @__PURE__ */ jsxRuntimeExports.jsx(FolderSelectorTest, {}),
  WindowedMediaPlayer: /* @__PURE__ */ jsxRuntimeExports.jsx(WindowedMediaPlayerTest, {}),
  ErrorBoundaryTest: /* @__PURE__ */ jsxRuntimeExports.jsx(ErrorBoundaryTestPage, {}),
  FileNameModifierTest: /* @__PURE__ */ jsxRuntimeExports.jsx(FileNameModifierTestPage, {}),
  PropertyMatcher: /* @__PURE__ */ jsxRuntimeExports.jsx(PropertyMatcher, { name: "封面3", type: PropertyType.Attachment, onValueChanged: console.log }),
  BetaChip: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap gap-2 items-center", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(BetaChip, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx(BetaChip, { color: "primary", size: "md" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(BetaChip, { color: "success", size: "lg", variant: "solid" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(BetaChip, { color: "danger", tooltipContent: "Custom tooltip content", variant: "bordered" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(BetaChip, { showTooltip: false })
  ] }),
  DeprecatedChip: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap gap-2 items-center", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsx(DeprecatedChip, {}),
    /* @__PURE__ */ jsxRuntimeExports.jsx(DeprecatedChip, { color: "warning", size: "md" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(DeprecatedChip, { color: "danger", size: "lg", variant: "solid" }),
    /* @__PURE__ */ jsxRuntimeExports.jsx(
      DeprecatedChip,
      {
        color: "secondary",
        tooltipContent: "Custom deprecated message",
        variant: "bordered"
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx(DeprecatedChip, { showTooltip: false })
  ] }),
  Properties: /* @__PURE__ */ jsxRuntimeExports.jsx(PropertiesPage, {}),
  BulkModification: /* @__PURE__ */ jsxRuntimeExports.jsx(Editor$9, { valueType: StandardValueType.Boolean }),
  ResourceTransfer: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceTransferPage, {}),
  ResourceFilter: /* @__PURE__ */ jsxRuntimeExports.jsx(ResourceFilterPage, {}),
  VirtualList: /* @__PURE__ */ jsxRuntimeExports.jsx(VirtualListPage, {}),
  Psc: /* @__PURE__ */ jsxRuntimeExports.jsx(PscPage, {}),
  Tour: /* @__PURE__ */ jsxRuntimeExports.jsx(TourPage, {}),
  ResourceOrderSelector: /* @__PURE__ */ jsxRuntimeExports.jsx(OrderSelector, {}),
  Menu: /* @__PURE__ */ jsxRuntimeExports.jsx(Index, {}),
  Sortable: /* @__PURE__ */ jsxRuntimeExports.jsx(SortablePage, {}),
  LongTabs: /* @__PURE__ */ jsxRuntimeExports.jsx(LongTabsPage, {}),
  FileSelector: /* @__PURE__ */ jsxRuntimeExports.jsx(
    FileSystemSelectorButton,
    {
      fileSystemSelectorProps: {
        targetType: "file",
        defaultSelectedPath: "I:\\Test"
      }
    }
  ),
  FolderSelector: /* @__PURE__ */ jsxRuntimeExports.jsx(FileSystemSelectorButton, { defaultSelectedPath: "I:\\Test", targetType: "folder" }),
  SimpleLabel: ["dark", "light"].map((t) => {
    return /* @__PURE__ */ jsxRuntimeExports.jsx(
      "div",
      {
        className: `iw-theme-${t}`,
        style: {
          background: "var(--theme-body-background)",
          padding: 10
        },
        children: ["default", "primary", "success", "warning", "info", "danger"].map((s) => {
          return /* @__PURE__ */ jsxRuntimeExports.jsx(SimpleLabel, { status: s, children: s });
        })
      }
    );
  }),
  HlsPlayer: /* @__PURE__ */ jsxRuntimeExports.jsx(
    HlsPlayerPage,
    {
      src: "http://localhost:5000/file/play?fullname=Z%3A%5CAnime%5CAdded%20recently%5CArcane%20S01%5CS01E01%20-%20Welcome%20to%20the%20Playground.mkv"
    }
  ),
  ReactPlayer: /* @__PURE__ */ jsxRuntimeExports.jsx(ReactPlayerCasePage, {}),
  MediaPreviewer: /* @__PURE__ */ jsxRuntimeExports.jsx(MediaPreviewerTest, {}),
  MediaPlayer: /* @__PURE__ */ jsxRuntimeExports.jsx(MediaPlayerTest, {})
};
const SIDEBAR_COLLAPSED_KEY = "test-page-sidebar-collapsed";
const TestPage = () => {
  const { t } = useTranslation();
  const { createPortal } = useBakabaseContext();
  const [testingKey, setTestingKey] = useCookie("test-component-key");
  const [isCollapsed, setIsCollapsed] = useLocalStorage(SIDEBAR_COLLAPSED_KEY, false);
  reactExports.useEffect(() => {
    if (testingKey == null) {
      setTestingKey(Object.keys(components)[0]);
    }
  }, []);
  const toggleCollapsed = () => {
    setIsCollapsed(!isCollapsed);
  };
  return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start gap-2 max-h-full h-full", children: [
    /* @__PURE__ */ jsxRuntimeExports.jsxs(
      "div",
      {
        className: "border-small rounded-small border-default-200 dark:border-default-100 flex flex-col transition-all duration-200",
        style: { minWidth: isCollapsed ? "auto" : "200px" },
        children: [
          /* @__PURE__ */ jsxRuntimeExports.jsx(
            button_default,
            {
              isIconOnly: true,
              className: "self-end m-1",
              size: "sm",
              variant: "light",
              onPress: toggleCollapsed,
              children: isCollapsed ? /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronRightIcon, {}) : /* @__PURE__ */ jsxRuntimeExports.jsx(ChevronLeftIcon, {})
            }
          ),
          !isCollapsed && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "px-1 pb-2", children: /* @__PURE__ */ jsxRuntimeExports.jsx(
            listbox_default,
            {
              selectedKeys: testingKey ? [testingKey] : void 0,
              onAction: (k) => {
                setTestingKey(k);
              },
              children: Object.keys(components).sort().map((c) => {
                return /* @__PURE__ */ jsxRuntimeExports.jsx(listbox_item_base_default, { children: c }, c);
              })
            }
          ) })
        ]
      }
    ),
    /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "flex flex-col gap-2 grow max-h-full h-full overflow-auto", children: /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "", id: testingKey, children: components[testingKey] }) })
  ] }) });
};
TestPage.displayName = "TestPage";
export {
  TestPage as default
};
