app/assets/build/coco/book.js in coveragebook_components-0.14.0 vs app/assets/build/coco/book.js in coveragebook_components-0.15.0

- old
+ new

@@ -1,18512 +1,16548 @@ -(() => { - var __create = Object.create; - var __defProp = Object.defineProperty; - var __defProps = Object.defineProperties; - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; - var __getOwnPropDescs = Object.getOwnPropertyDescriptors; - var __getOwnPropNames = Object.getOwnPropertyNames; - var __getOwnPropSymbols = Object.getOwnPropertySymbols; - var __getProtoOf = Object.getPrototypeOf; - var __hasOwnProp = Object.prototype.hasOwnProperty; - var __propIsEnum = Object.prototype.propertyIsEnumerable; - var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; - var __spreadValues = (a3, b3) => { - for (var prop in b3 || (b3 = {})) - if (__hasOwnProp.call(b3, prop)) - __defNormalProp(a3, prop, b3[prop]); - if (__getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(b3)) { - if (__propIsEnum.call(b3, prop)) - __defNormalProp(a3, prop, b3[prop]); - } - return a3; - }; - var __spreadProps = (a3, b3) => __defProps(a3, __getOwnPropDescs(b3)); - var __objRest = (source, exclude) => { - var target = {}; - for (var prop in source) - if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) - target[prop] = source[prop]; - if (source != null && __getOwnPropSymbols) - for (var prop of __getOwnPropSymbols(source)) { - if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) - target[prop] = source[prop]; - } - return target; - }; - var __commonJS = (cb, mod3) => function __require() { - return mod3 || (0, cb[__getOwnPropNames(cb)[0]])((mod3 = { exports: {} }).exports, mod3), mod3.exports; - }; - var __export = (target, all) => { - for (var name in all) - __defProp(target, name, { get: all[name], enumerable: true }); - }; - var __copyProps = (to, from, except, desc) => { - if (from && typeof from === "object" || typeof from === "function") { - for (let key of __getOwnPropNames(from)) - if (!__hasOwnProp.call(to, key) && key !== except) - __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); - } - return to; - }; - var __toESM = (mod3, isNodeMode, target) => (target = mod3 != null ? __create(__getProtoOf(mod3)) : {}, __copyProps( - // If the importer is in node compatibility mode or this is not an ESM - // file that has been converted to a CommonJS file using a Babel- - // compatible transform (i.e. "__esModule" has not been set), then set - // "default" to the CommonJS "module.exports" for node compatibility. - isNodeMode || !mod3 || !mod3.__esModule ? __defProp(target, "default", { value: mod3, enumerable: true }) : target, - mod3 - )); +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); - // ../../../node_modules/lodash/lodash.js - var require_lodash = __commonJS({ - "../../../node_modules/lodash/lodash.js"(exports, module) { - (function() { - var undefined2; - var VERSION = "4.17.21"; - var LARGE_ARRAY_SIZE = 200; - var CORE_ERROR_TEXT = "Unsupported core-js use. Try https://npms.io/search?q=ponyfill.", FUNC_ERROR_TEXT = "Expected a function", INVALID_TEMPL_VAR_ERROR_TEXT = "Invalid `variable` option passed into `_.template`"; - var HASH_UNDEFINED = "__lodash_hash_undefined__"; - var MAX_MEMOIZE_SIZE = 500; - var PLACEHOLDER = "__lodash_placeholder__"; - var CLONE_DEEP_FLAG = 1, CLONE_FLAT_FLAG = 2, CLONE_SYMBOLS_FLAG = 4; - var COMPARE_PARTIAL_FLAG = 1, COMPARE_UNORDERED_FLAG = 2; - var WRAP_BIND_FLAG = 1, WRAP_BIND_KEY_FLAG = 2, WRAP_CURRY_BOUND_FLAG = 4, WRAP_CURRY_FLAG = 8, WRAP_CURRY_RIGHT_FLAG = 16, WRAP_PARTIAL_FLAG = 32, WRAP_PARTIAL_RIGHT_FLAG = 64, WRAP_ARY_FLAG = 128, WRAP_REARG_FLAG = 256, WRAP_FLIP_FLAG = 512; - var DEFAULT_TRUNC_LENGTH = 30, DEFAULT_TRUNC_OMISSION = "..."; - var HOT_COUNT = 800, HOT_SPAN = 16; - var LAZY_FILTER_FLAG = 1, LAZY_MAP_FLAG = 2, LAZY_WHILE_FLAG = 3; - var INFINITY = 1 / 0, MAX_SAFE_INTEGER = 9007199254740991, MAX_INTEGER = 17976931348623157e292, NAN = 0 / 0; - var MAX_ARRAY_LENGTH = 4294967295, MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1, HALF_MAX_ARRAY_LENGTH = MAX_ARRAY_LENGTH >>> 1; - var wrapFlags = [ - ["ary", WRAP_ARY_FLAG], - ["bind", WRAP_BIND_FLAG], - ["bindKey", WRAP_BIND_KEY_FLAG], - ["curry", WRAP_CURRY_FLAG], - ["curryRight", WRAP_CURRY_RIGHT_FLAG], - ["flip", WRAP_FLIP_FLAG], - ["partial", WRAP_PARTIAL_FLAG], - ["partialRight", WRAP_PARTIAL_RIGHT_FLAG], - ["rearg", WRAP_REARG_FLAG] - ]; - var argsTag = "[object Arguments]", arrayTag = "[object Array]", asyncTag = "[object AsyncFunction]", boolTag = "[object Boolean]", dateTag = "[object Date]", domExcTag = "[object DOMException]", errorTag = "[object Error]", funcTag = "[object Function]", genTag = "[object GeneratorFunction]", mapTag = "[object Map]", numberTag = "[object Number]", nullTag = "[object Null]", objectTag = "[object Object]", promiseTag = "[object Promise]", proxyTag = "[object Proxy]", regexpTag = "[object RegExp]", setTag = "[object Set]", stringTag = "[object String]", symbolTag = "[object Symbol]", undefinedTag = "[object Undefined]", weakMapTag = "[object WeakMap]", weakSetTag = "[object WeakSet]"; - var arrayBufferTag = "[object ArrayBuffer]", dataViewTag = "[object DataView]", float32Tag = "[object Float32Array]", float64Tag = "[object Float64Array]", int8Tag = "[object Int8Array]", int16Tag = "[object Int16Array]", int32Tag = "[object Int32Array]", uint8Tag = "[object Uint8Array]", uint8ClampedTag = "[object Uint8ClampedArray]", uint16Tag = "[object Uint16Array]", uint32Tag = "[object Uint32Array]"; - var reEmptyStringLeading = /\b__p \+= '';/g, reEmptyStringMiddle = /\b(__p \+=) '' \+/g, reEmptyStringTrailing = /(__e\(.*?\)|\b__t\)) \+\n'';/g; - var reEscapedHtml = /&(?:amp|lt|gt|quot|#39);/g, reUnescapedHtml = /[&<>"']/g, reHasEscapedHtml = RegExp(reEscapedHtml.source), reHasUnescapedHtml = RegExp(reUnescapedHtml.source); - var reEscape = /<%-([\s\S]+?)%>/g, reEvaluate = /<%([\s\S]+?)%>/g, reInterpolate = /<%=([\s\S]+?)%>/g; - var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, reIsPlainProp = /^\w*$/, rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; - var reRegExpChar = /[\\^$.*+?()[\]{}|]/g, reHasRegExpChar = RegExp(reRegExpChar.source); - var reTrimStart = /^\s+/; - var reWhitespace = /\s/; - var reWrapComment = /\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/, reWrapDetails = /\{\n\/\* \[wrapped with (.+)\] \*/, reSplitDetails = /,? & /; - var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; - var reForbiddenIdentifierChars = /[()=,{}\[\]\/\s]/; - var reEscapeChar = /\\(\\)?/g; - var reEsTemplate = /\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g; - var reFlags = /\w*$/; - var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - var reIsBinary = /^0b[01]+$/i; - var reIsHostCtor = /^\[object .+?Constructor\]$/; - var reIsOctal = /^0o[0-7]+$/i; - var reIsUint = /^(?:0|[1-9]\d*)$/; - var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; - var reNoMatch = /($^)/; - var reUnescapedString = /['\n\r\u2028\u2029\\]/g; - var rsAstralRange = "\\ud800-\\udfff", rsComboMarksRange = "\\u0300-\\u036f", reComboHalfMarksRange = "\\ufe20-\\ufe2f", rsComboSymbolsRange = "\\u20d0-\\u20ff", rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange, rsDingbatRange = "\\u2700-\\u27bf", rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff", rsMathOpRange = "\\xac\\xb1\\xd7\\xf7", rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf", rsPunctuationRange = "\\u2000-\\u206f", rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000", rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde", rsVarRange = "\\ufe0e\\ufe0f", rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; - var rsApos = "['\u2019]", rsAstral = "[" + rsAstralRange + "]", rsBreak = "[" + rsBreakRange + "]", rsCombo = "[" + rsComboRange + "]", rsDigits = "\\d+", rsDingbat = "[" + rsDingbatRange + "]", rsLower = "[" + rsLowerRange + "]", rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]", rsFitz = "\\ud83c[\\udffb-\\udfff]", rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")", rsNonAstral = "[^" + rsAstralRange + "]", rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}", rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]", rsUpper = "[" + rsUpperRange + "]", rsZWJ = "\\u200d"; - var rsMiscLower = "(?:" + rsLower + "|" + rsMisc + ")", rsMiscUpper = "(?:" + rsUpper + "|" + rsMisc + ")", rsOptContrLower = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?", rsOptContrUpper = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?", reOptMod = rsModifier + "?", rsOptVar = "[" + rsVarRange + "]?", rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*", rsOrdLower = "\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])", rsOrdUpper = "\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])", rsSeq = rsOptVar + reOptMod + rsOptJoin, rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq, rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; - var reApos = RegExp(rsApos, "g"); - var reComboMark = RegExp(rsCombo, "g"); - var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); - var reUnicodeWord = RegExp([ - rsUpper + "?" + rsLower + "+" + rsOptContrLower + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", - rsMiscUpper + "+" + rsOptContrUpper + "(?=" + [rsBreak, rsUpper + rsMiscLower, "$"].join("|") + ")", - rsUpper + "?" + rsMiscLower + "+" + rsOptContrLower, - rsUpper + "+" + rsOptContrUpper, - rsOrdUpper, - rsOrdLower, - rsDigits, - rsEmoji - ].join("|"), "g"); - var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + "]"); - var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; - var contextProps = [ - "Array", - "Buffer", - "DataView", - "Date", - "Error", - "Float32Array", - "Float64Array", - "Function", - "Int8Array", - "Int16Array", - "Int32Array", - "Map", - "Math", - "Object", - "Promise", - "RegExp", - "Set", - "String", - "Symbol", - "TypeError", - "Uint8Array", - "Uint8ClampedArray", - "Uint16Array", - "Uint32Array", - "WeakMap", - "_", - "clearTimeout", - "isFinite", - "parseInt", - "setTimeout" - ]; - var templateCounter = -1; - var typedArrayTags = {}; - typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; - typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; - var cloneableTags = {}; - cloneableTags[argsTag] = cloneableTags[arrayTag] = cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = cloneableTags[boolTag] = cloneableTags[dateTag] = cloneableTags[float32Tag] = cloneableTags[float64Tag] = cloneableTags[int8Tag] = cloneableTags[int16Tag] = cloneableTags[int32Tag] = cloneableTags[mapTag] = cloneableTags[numberTag] = cloneableTags[objectTag] = cloneableTags[regexpTag] = cloneableTags[setTag] = cloneableTags[stringTag] = cloneableTags[symbolTag] = cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; - cloneableTags[errorTag] = cloneableTags[funcTag] = cloneableTags[weakMapTag] = false; - var deburredLetters = { - // Latin-1 Supplement block. - "\xC0": "A", - "\xC1": "A", - "\xC2": "A", - "\xC3": "A", - "\xC4": "A", - "\xC5": "A", - "\xE0": "a", - "\xE1": "a", - "\xE2": "a", - "\xE3": "a", - "\xE4": "a", - "\xE5": "a", - "\xC7": "C", - "\xE7": "c", - "\xD0": "D", - "\xF0": "d", - "\xC8": "E", - "\xC9": "E", - "\xCA": "E", - "\xCB": "E", - "\xE8": "e", - "\xE9": "e", - "\xEA": "e", - "\xEB": "e", - "\xCC": "I", - "\xCD": "I", - "\xCE": "I", - "\xCF": "I", - "\xEC": "i", - "\xED": "i", - "\xEE": "i", - "\xEF": "i", - "\xD1": "N", - "\xF1": "n", - "\xD2": "O", - "\xD3": "O", - "\xD4": "O", - "\xD5": "O", - "\xD6": "O", - "\xD8": "O", - "\xF2": "o", - "\xF3": "o", - "\xF4": "o", - "\xF5": "o", - "\xF6": "o", - "\xF8": "o", - "\xD9": "U", - "\xDA": "U", - "\xDB": "U", - "\xDC": "U", - "\xF9": "u", - "\xFA": "u", - "\xFB": "u", - "\xFC": "u", - "\xDD": "Y", - "\xFD": "y", - "\xFF": "y", - "\xC6": "Ae", - "\xE6": "ae", - "\xDE": "Th", - "\xFE": "th", - "\xDF": "ss", - // Latin Extended-A block. - "\u0100": "A", - "\u0102": "A", - "\u0104": "A", - "\u0101": "a", - "\u0103": "a", - "\u0105": "a", - "\u0106": "C", - "\u0108": "C", - "\u010A": "C", - "\u010C": "C", - "\u0107": "c", - "\u0109": "c", - "\u010B": "c", - "\u010D": "c", - "\u010E": "D", - "\u0110": "D", - "\u010F": "d", - "\u0111": "d", - "\u0112": "E", - "\u0114": "E", - "\u0116": "E", - "\u0118": "E", - "\u011A": "E", - "\u0113": "e", - "\u0115": "e", - "\u0117": "e", - "\u0119": "e", - "\u011B": "e", - "\u011C": "G", - "\u011E": "G", - "\u0120": "G", - "\u0122": "G", - "\u011D": "g", - "\u011F": "g", - "\u0121": "g", - "\u0123": "g", - "\u0124": "H", - "\u0126": "H", - "\u0125": "h", - "\u0127": "h", - "\u0128": "I", - "\u012A": "I", - "\u012C": "I", - "\u012E": "I", - "\u0130": "I", - "\u0129": "i", - "\u012B": "i", - "\u012D": "i", - "\u012F": "i", - "\u0131": "i", - "\u0134": "J", - "\u0135": "j", - "\u0136": "K", - "\u0137": "k", - "\u0138": "k", - "\u0139": "L", - "\u013B": "L", - "\u013D": "L", - "\u013F": "L", - "\u0141": "L", - "\u013A": "l", - "\u013C": "l", - "\u013E": "l", - "\u0140": "l", - "\u0142": "l", - "\u0143": "N", - "\u0145": "N", - "\u0147": "N", - "\u014A": "N", - "\u0144": "n", - "\u0146": "n", - "\u0148": "n", - "\u014B": "n", - "\u014C": "O", - "\u014E": "O", - "\u0150": "O", - "\u014D": "o", - "\u014F": "o", - "\u0151": "o", - "\u0154": "R", - "\u0156": "R", - "\u0158": "R", - "\u0155": "r", - "\u0157": "r", - "\u0159": "r", - "\u015A": "S", - "\u015C": "S", - "\u015E": "S", - "\u0160": "S", - "\u015B": "s", - "\u015D": "s", - "\u015F": "s", - "\u0161": "s", - "\u0162": "T", - "\u0164": "T", - "\u0166": "T", - "\u0163": "t", - "\u0165": "t", - "\u0167": "t", - "\u0168": "U", - "\u016A": "U", - "\u016C": "U", - "\u016E": "U", - "\u0170": "U", - "\u0172": "U", - "\u0169": "u", - "\u016B": "u", - "\u016D": "u", - "\u016F": "u", - "\u0171": "u", - "\u0173": "u", - "\u0174": "W", - "\u0175": "w", - "\u0176": "Y", - "\u0177": "y", - "\u0178": "Y", - "\u0179": "Z", - "\u017B": "Z", - "\u017D": "Z", - "\u017A": "z", - "\u017C": "z", - "\u017E": "z", - "\u0132": "IJ", - "\u0133": "ij", - "\u0152": "Oe", - "\u0153": "oe", - "\u0149": "'n", - "\u017F": "s" +// ../../../node_modules/alpinejs/dist/module.cjs.js +var require_module_cjs = __commonJS({ + "../../../node_modules/alpinejs/dist/module.cjs.js"(exports, module) { + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __commonJS2 = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var require_shared_cjs = __commonJS2({ + "node_modules/@vue/shared/dist/shared.cjs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + function makeMap(str, expectsLowerCase) { + const map = /* @__PURE__ */ Object.create(null); + const list = str.split(","); + for (let i2 = 0; i2 < list.length; i2++) { + map[list[i2]] = true; + } + return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; + } + var PatchFlagNames = { + [ + 1 + /* TEXT */ + ]: `TEXT`, + [ + 2 + /* CLASS */ + ]: `CLASS`, + [ + 4 + /* STYLE */ + ]: `STYLE`, + [ + 8 + /* PROPS */ + ]: `PROPS`, + [ + 16 + /* FULL_PROPS */ + ]: `FULL_PROPS`, + [ + 32 + /* HYDRATE_EVENTS */ + ]: `HYDRATE_EVENTS`, + [ + 64 + /* STABLE_FRAGMENT */ + ]: `STABLE_FRAGMENT`, + [ + 128 + /* KEYED_FRAGMENT */ + ]: `KEYED_FRAGMENT`, + [ + 256 + /* UNKEYED_FRAGMENT */ + ]: `UNKEYED_FRAGMENT`, + [ + 512 + /* NEED_PATCH */ + ]: `NEED_PATCH`, + [ + 1024 + /* DYNAMIC_SLOTS */ + ]: `DYNAMIC_SLOTS`, + [ + 2048 + /* DEV_ROOT_FRAGMENT */ + ]: `DEV_ROOT_FRAGMENT`, + [ + -1 + /* HOISTED */ + ]: `HOISTED`, + [ + -2 + /* BAIL */ + ]: `BAIL` }; - var htmlEscapes = { - "&": "&amp;", - "<": "&lt;", - ">": "&gt;", - '"': "&quot;", - "'": "&#39;" + var slotFlagsText = { + [ + 1 + /* STABLE */ + ]: "STABLE", + [ + 2 + /* DYNAMIC */ + ]: "DYNAMIC", + [ + 3 + /* FORWARDED */ + ]: "FORWARDED" }; - var htmlUnescapes = { - "&amp;": "&", - "&lt;": "<", - "&gt;": ">", - "&quot;": '"', - "&#39;": "'" - }; - var stringEscapes = { - "\\": "\\", - "'": "'", - "\n": "n", - "\r": "r", - "\u2028": "u2028", - "\u2029": "u2029" - }; - var freeParseFloat = parseFloat, freeParseInt = parseInt; - var freeGlobal = typeof global == "object" && global && global.Object === Object && global; - var freeSelf = typeof self == "object" && self && self.Object === Object && self; - var root = freeGlobal || freeSelf || Function("return this")(); - var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; - var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; - var moduleExports = freeModule && freeModule.exports === freeExports; - var freeProcess = moduleExports && freeGlobal.process; - var nodeUtil = function() { - try { - var types = freeModule && freeModule.require && freeModule.require("util").types; - if (types) { - return types; + var GLOBALS_WHITE_LISTED = "Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt"; + var isGloballyWhitelisted = /* @__PURE__ */ makeMap(GLOBALS_WHITE_LISTED); + var range = 2; + function generateCodeFrame(source, start2 = 0, end = source.length) { + let lines = source.split(/(\r?\n)/); + const newlineSequences = lines.filter((_2, idx) => idx % 2 === 1); + lines = lines.filter((_2, idx) => idx % 2 === 0); + let count = 0; + const res = []; + for (let i2 = 0; i2 < lines.length; i2++) { + count += lines[i2].length + (newlineSequences[i2] && newlineSequences[i2].length || 0); + if (count >= start2) { + for (let j2 = i2 - range; j2 <= i2 + range || end > count; j2++) { + if (j2 < 0 || j2 >= lines.length) + continue; + const line = j2 + 1; + res.push(`${line}${" ".repeat(Math.max(3 - String(line).length, 0))}| ${lines[j2]}`); + const lineLength = lines[j2].length; + const newLineSeqLength = newlineSequences[j2] && newlineSequences[j2].length || 0; + if (j2 === i2) { + const pad = start2 - (count - (lineLength + newLineSeqLength)); + const length = Math.max(1, end > count ? lineLength - pad : end - start2); + res.push(` | ` + " ".repeat(pad) + "^".repeat(length)); + } else if (j2 > i2) { + if (end > count) { + const length = Math.max(Math.min(end - count, lineLength), 1); + res.push(` | ` + "^".repeat(length)); + } + count += lineLength + newLineSeqLength; + } + } + break; } - return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e3) { } - }(); - var nodeIsArrayBuffer = nodeUtil && nodeUtil.isArrayBuffer, nodeIsDate = nodeUtil && nodeUtil.isDate, nodeIsMap = nodeUtil && nodeUtil.isMap, nodeIsRegExp = nodeUtil && nodeUtil.isRegExp, nodeIsSet = nodeUtil && nodeUtil.isSet, nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; - function apply(func, thisArg, args) { - switch (args.length) { - case 0: - return func.call(thisArg); - case 1: - return func.call(thisArg, args[0]); - case 2: - return func.call(thisArg, args[0], args[1]); - case 3: - return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); + return res.join("\n"); } - function arrayAggregator(array, setter, iteratee, accumulator) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - var value = array[index]; - setter(accumulator, value, iteratee(value), array); + var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; + var isSpecialBooleanAttr = /* @__PURE__ */ makeMap(specialBooleanAttrs); + var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); + var unsafeAttrCharRE = /[>/="'\u0009\u000a\u000c\u0020]/; + var attrValidationCache = {}; + function isSSRSafeAttrName(name) { + if (attrValidationCache.hasOwnProperty(name)) { + return attrValidationCache[name]; } - return accumulator; + const isUnsafe = unsafeAttrCharRE.test(name); + if (isUnsafe) { + console.error(`unsafe attribute name: ${name}`); + } + return attrValidationCache[name] = !isUnsafe; } - function arrayEach(array, iteratee) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; + var propsToAttrMap = { + acceptCharset: "accept-charset", + className: "class", + htmlFor: "for", + httpEquiv: "http-equiv" + }; + var isNoUnitNumericStyleProp = /* @__PURE__ */ makeMap(`animation-iteration-count,border-image-outset,border-image-slice,border-image-width,box-flex,box-flex-group,box-ordinal-group,column-count,columns,flex,flex-grow,flex-positive,flex-shrink,flex-negative,flex-order,grid-row,grid-row-end,grid-row-span,grid-row-start,grid-column,grid-column-end,grid-column-span,grid-column-start,font-weight,line-clamp,line-height,opacity,order,orphans,tab-size,widows,z-index,zoom,fill-opacity,flood-opacity,stop-opacity,stroke-dasharray,stroke-dashoffset,stroke-miterlimit,stroke-opacity,stroke-width`); + var isKnownAttr = /* @__PURE__ */ makeMap(`accept,accept-charset,accesskey,action,align,allow,alt,async,autocapitalize,autocomplete,autofocus,autoplay,background,bgcolor,border,buffered,capture,challenge,charset,checked,cite,class,code,codebase,color,cols,colspan,content,contenteditable,contextmenu,controls,coords,crossorigin,csp,data,datetime,decoding,default,defer,dir,dirname,disabled,download,draggable,dropzone,enctype,enterkeyhint,for,form,formaction,formenctype,formmethod,formnovalidate,formtarget,headers,height,hidden,high,href,hreflang,http-equiv,icon,id,importance,integrity,ismap,itemprop,keytype,kind,label,lang,language,loading,list,loop,low,manifest,max,maxlength,minlength,media,min,multiple,muted,name,novalidate,open,optimum,pattern,ping,placeholder,poster,preload,radiogroup,readonly,referrerpolicy,rel,required,reversed,rows,rowspan,sandbox,scope,scoped,selected,shape,size,sizes,slot,span,spellcheck,src,srcdoc,srclang,srcset,start,step,style,summary,tabindex,target,title,translate,type,usemap,value,width,wrap`); + function normalizeStyle(value) { + if (isArray(value)) { + const res = {}; + for (let i2 = 0; i2 < value.length; i2++) { + const item = value[i2]; + const normalized = normalizeStyle(isString(item) ? parseStringStyle(item) : item); + if (normalized) { + for (const key in normalized) { + res[key] = normalized[key]; + } + } } + return res; + } else if (isObject2(value)) { + return value; } - return array; } - function arrayEachRight(array, iteratee) { - var length = array == null ? 0 : array.length; - while (length--) { - if (iteratee(array[length], length, array) === false) { - break; + var listDelimiterRE = /;(?![^(]*\))/g; + var propertyDelimiterRE = /:(.+)/; + function parseStringStyle(cssText) { + const ret = {}; + cssText.split(listDelimiterRE).forEach((item) => { + if (item) { + const tmp = item.split(propertyDelimiterRE); + tmp.length > 1 && (ret[tmp[0].trim()] = tmp[1].trim()); } - } - return array; + }); + return ret; } - function arrayEvery(array, predicate) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (!predicate(array[index], index, array)) { - return false; + function stringifyStyle(styles) { + let ret = ""; + if (!styles) { + return ret; + } + for (const key in styles) { + const value = styles[key]; + const normalizedKey = key.startsWith(`--`) ? key : hyphenate(key); + if (isString(value) || typeof value === "number" && isNoUnitNumericStyleProp(normalizedKey)) { + ret += `${normalizedKey}:${value};`; } } - return true; + return ret; } - function arrayFilter(array, predicate) { - var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result = []; - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result[resIndex++] = value; + function normalizeClass(value) { + let res = ""; + if (isString(value)) { + res = value; + } else if (isArray(value)) { + for (let i2 = 0; i2 < value.length; i2++) { + const normalized = normalizeClass(value[i2]); + if (normalized) { + res += normalized + " "; + } } + } else if (isObject2(value)) { + for (const name in value) { + if (value[name]) { + res += name + " "; + } + } } - return result; + return res.trim(); } - function arrayIncludes(array, value) { - var length = array == null ? 0 : array.length; - return !!length && baseIndexOf(array, value, 0) > -1; - } - function arrayIncludesWith(array, value, comparator) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (comparator(value, array[index])) { - return true; + var HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,hgroup,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,rtc,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot"; + var SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view"; + var VOID_TAGS = "area,base,br,col,embed,hr,img,input,link,meta,param,source,track,wbr"; + var isHTMLTag = /* @__PURE__ */ makeMap(HTML_TAGS); + var isSVGTag = /* @__PURE__ */ makeMap(SVG_TAGS); + var isVoidTag = /* @__PURE__ */ makeMap(VOID_TAGS); + var escapeRE = /["'&<>]/; + function escapeHtml(string) { + const str = "" + string; + const match = escapeRE.exec(str); + if (!match) { + return str; + } + let html = ""; + let escaped; + let index; + let lastIndex = 0; + for (index = match.index; index < str.length; index++) { + switch (str.charCodeAt(index)) { + case 34: + escaped = "&quot;"; + break; + case 38: + escaped = "&amp;"; + break; + case 39: + escaped = "&#39;"; + break; + case 60: + escaped = "&lt;"; + break; + case 62: + escaped = "&gt;"; + break; + default: + continue; } + if (lastIndex !== index) { + html += str.substring(lastIndex, index); + } + lastIndex = index + 1; + html += escaped; } - return false; + return lastIndex !== index ? html + str.substring(lastIndex, index) : html; } - function arrayMap(array, iteratee) { - var index = -1, length = array == null ? 0 : array.length, result = Array(length); - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; + var commentStripRE = /^-?>|<!--|-->|--!>|<!-$/g; + function escapeHtmlComment(src) { + return src.replace(commentStripRE, ""); } - function arrayPush(array, values) { - var index = -1, length = values.length, offset2 = array.length; - while (++index < length) { - array[offset2 + index] = values[index]; + function looseCompareArrays(a2, b2) { + if (a2.length !== b2.length) + return false; + let equal = true; + for (let i2 = 0; equal && i2 < a2.length; i2++) { + equal = looseEqual(a2[i2], b2[i2]); } - return array; + return equal; } - function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[++index]; + function looseEqual(a2, b2) { + if (a2 === b2) + return true; + let aValidType = isDate(a2); + let bValidType = isDate(b2); + if (aValidType || bValidType) { + return aValidType && bValidType ? a2.getTime() === b2.getTime() : false; } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); + aValidType = isArray(a2); + bValidType = isArray(b2); + if (aValidType || bValidType) { + return aValidType && bValidType ? looseCompareArrays(a2, b2) : false; } - return accumulator; - } - function arrayReduceRight(array, iteratee, accumulator, initAccum) { - var length = array == null ? 0 : array.length; - if (initAccum && length) { - accumulator = array[--length]; - } - while (length--) { - accumulator = iteratee(accumulator, array[length], length, array); - } - return accumulator; - } - function arraySome(array, predicate) { - var index = -1, length = array == null ? 0 : array.length; - while (++index < length) { - if (predicate(array[index], index, array)) { - return true; + aValidType = isObject2(a2); + bValidType = isObject2(b2); + if (aValidType || bValidType) { + if (!aValidType || !bValidType) { + return false; } - } - return false; - } - var asciiSize = baseProperty("length"); - function asciiToArray(string) { - return string.split(""); - } - function asciiWords(string) { - return string.match(reAsciiWord) || []; - } - function baseFindKey(collection, predicate, eachFunc) { - var result; - eachFunc(collection, function(value, key, collection2) { - if (predicate(value, key, collection2)) { - result = key; + const aKeysCount = Object.keys(a2).length; + const bKeysCount = Object.keys(b2).length; + if (aKeysCount !== bKeysCount) { return false; } - }); - return result; - } - function baseFindIndex(array, predicate, fromIndex, fromRight) { - var length = array.length, index = fromIndex + (fromRight ? 1 : -1); - while (fromRight ? index-- : ++index < length) { - if (predicate(array[index], index, array)) { - return index; + for (const key in a2) { + const aHasKey = a2.hasOwnProperty(key); + const bHasKey = b2.hasOwnProperty(key); + if (aHasKey && !bHasKey || !aHasKey && bHasKey || !looseEqual(a2[key], b2[key])) { + return false; + } } } - return -1; + return String(a2) === String(b2); } - function baseIndexOf(array, value, fromIndex) { - return value === value ? strictIndexOf(array, value, fromIndex) : baseFindIndex(array, baseIsNaN, fromIndex); + function looseIndexOf(arr, val) { + return arr.findIndex((item) => looseEqual(item, val)); } - function baseIndexOfWith(array, value, fromIndex, comparator) { - var index = fromIndex - 1, length = array.length; - while (++index < length) { - if (comparator(array[index], value)) { - return index; - } + var toDisplayString = (val) => { + return val == null ? "" : isObject2(val) ? JSON.stringify(val, replacer, 2) : String(val); + }; + var replacer = (_key, val) => { + if (isMap(val)) { + return { + [`Map(${val.size})`]: [...val.entries()].reduce((entries, [key, val2]) => { + entries[`${key} =>`] = val2; + return entries; + }, {}) + }; + } else if (isSet(val)) { + return { + [`Set(${val.size})`]: [...val.values()] + }; + } else if (isObject2(val) && !isArray(val) && !isPlainObject(val)) { + return String(val); } - return -1; - } - function baseIsNaN(value) { - return value !== value; - } - function baseMean(array, iteratee) { - var length = array == null ? 0 : array.length; - return length ? baseSum(array, iteratee) / length : NAN; - } - function baseProperty(key) { - return function(object) { - return object == null ? undefined2 : object[key]; + return val; + }; + var babelParserDefaultPlugins = [ + "bigInt", + "optionalChaining", + "nullishCoalescingOperator" + ]; + var EMPTY_OBJ = Object.freeze({}); + var EMPTY_ARR = Object.freeze([]); + var NOOP = () => { + }; + var NO = () => false; + var onRE = /^on[^a-z]/; + var isOn = (key) => onRE.test(key); + var isModelListener = (key) => key.startsWith("onUpdate:"); + var extend = Object.assign; + var remove = (arr, el) => { + const i2 = arr.indexOf(el); + if (i2 > -1) { + arr.splice(i2, 1); + } + }; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var hasOwn = (val, key) => hasOwnProperty.call(val, key); + var isArray = Array.isArray; + var isMap = (val) => toTypeString(val) === "[object Map]"; + var isSet = (val) => toTypeString(val) === "[object Set]"; + var isDate = (val) => val instanceof Date; + var isFunction = (val) => typeof val === "function"; + var isString = (val) => typeof val === "string"; + var isSymbol = (val) => typeof val === "symbol"; + var isObject2 = (val) => val !== null && typeof val === "object"; + var isPromise = (val) => { + return isObject2(val) && isFunction(val.then) && isFunction(val.catch); + }; + var objectToString = Object.prototype.toString; + var toTypeString = (value) => objectToString.call(value); + var toRawType = (value) => { + return toTypeString(value).slice(8, -1); + }; + var isPlainObject = (val) => toTypeString(val) === "[object Object]"; + var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; + var isReservedProp = /* @__PURE__ */ makeMap( + // the leading comma is intentional so empty string "" is also included + ",key,ref,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted" + ); + var cacheStringFunction = (fn) => { + const cache = /* @__PURE__ */ Object.create(null); + return (str) => { + const hit = cache[str]; + return hit || (cache[str] = fn(str)); }; - } - function basePropertyOf(object) { - return function(key) { - return object == null ? undefined2 : object[key]; - }; - } - function baseReduce(collection, iteratee, accumulator, initAccum, eachFunc) { - eachFunc(collection, function(value, index, collection2) { - accumulator = initAccum ? (initAccum = false, value) : iteratee(accumulator, value, index, collection2); - }); - return accumulator; - } - function baseSortBy(array, comparer) { - var length = array.length; - array.sort(comparer); - while (length--) { - array[length] = array[length].value; + }; + var camelizeRE = /-(\w)/g; + var camelize = cacheStringFunction((str) => { + return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : ""); + }); + var hyphenateRE = /\B([A-Z])/g; + var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); + var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); + var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``); + var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue); + var invokeArrayFns = (fns, arg) => { + for (let i2 = 0; i2 < fns.length; i2++) { + fns[i2](arg); } - return array; - } - function baseSum(array, iteratee) { - var result, index = -1, length = array.length; - while (++index < length) { - var current = iteratee(array[index]); - if (current !== undefined2) { - result = result === undefined2 ? current : result + current; - } - } - return result; - } - function baseTimes(n3, iteratee) { - var index = -1, result = Array(n3); - while (++index < n3) { - result[index] = iteratee(index); - } - return result; - } - function baseToPairs(object, props) { - return arrayMap(props, function(key) { - return [key, object[key]]; + }; + var def = (obj, key, value) => { + Object.defineProperty(obj, key, { + configurable: true, + enumerable: false, + value }); + }; + var toNumber = (val) => { + const n2 = parseFloat(val); + return isNaN(n2) ? val : n2; + }; + var _globalThis; + var getGlobalThis = () => { + return _globalThis || (_globalThis = typeof globalThis !== "undefined" ? globalThis : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : {}); + }; + exports2.EMPTY_ARR = EMPTY_ARR; + exports2.EMPTY_OBJ = EMPTY_OBJ; + exports2.NO = NO; + exports2.NOOP = NOOP; + exports2.PatchFlagNames = PatchFlagNames; + exports2.babelParserDefaultPlugins = babelParserDefaultPlugins; + exports2.camelize = camelize; + exports2.capitalize = capitalize; + exports2.def = def; + exports2.escapeHtml = escapeHtml; + exports2.escapeHtmlComment = escapeHtmlComment; + exports2.extend = extend; + exports2.generateCodeFrame = generateCodeFrame; + exports2.getGlobalThis = getGlobalThis; + exports2.hasChanged = hasChanged; + exports2.hasOwn = hasOwn; + exports2.hyphenate = hyphenate; + exports2.invokeArrayFns = invokeArrayFns; + exports2.isArray = isArray; + exports2.isBooleanAttr = isBooleanAttr2; + exports2.isDate = isDate; + exports2.isFunction = isFunction; + exports2.isGloballyWhitelisted = isGloballyWhitelisted; + exports2.isHTMLTag = isHTMLTag; + exports2.isIntegerKey = isIntegerKey; + exports2.isKnownAttr = isKnownAttr; + exports2.isMap = isMap; + exports2.isModelListener = isModelListener; + exports2.isNoUnitNumericStyleProp = isNoUnitNumericStyleProp; + exports2.isObject = isObject2; + exports2.isOn = isOn; + exports2.isPlainObject = isPlainObject; + exports2.isPromise = isPromise; + exports2.isReservedProp = isReservedProp; + exports2.isSSRSafeAttrName = isSSRSafeAttrName; + exports2.isSVGTag = isSVGTag; + exports2.isSet = isSet; + exports2.isSpecialBooleanAttr = isSpecialBooleanAttr; + exports2.isString = isString; + exports2.isSymbol = isSymbol; + exports2.isVoidTag = isVoidTag; + exports2.looseEqual = looseEqual; + exports2.looseIndexOf = looseIndexOf; + exports2.makeMap = makeMap; + exports2.normalizeClass = normalizeClass; + exports2.normalizeStyle = normalizeStyle; + exports2.objectToString = objectToString; + exports2.parseStringStyle = parseStringStyle; + exports2.propsToAttrMap = propsToAttrMap; + exports2.remove = remove; + exports2.slotFlagsText = slotFlagsText; + exports2.stringifyStyle = stringifyStyle; + exports2.toDisplayString = toDisplayString; + exports2.toHandlerKey = toHandlerKey; + exports2.toNumber = toNumber; + exports2.toRawType = toRawType; + exports2.toTypeString = toTypeString; + } + }); + var require_shared = __commonJS2({ + "node_modules/@vue/shared/index.js"(exports2, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_shared_cjs(); } - function baseTrim(string) { - return string ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, "") : string; + } + }); + var require_reactivity_cjs = __commonJS2({ + "node_modules/@vue/reactivity/dist/reactivity.cjs.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var shared = require_shared(); + var targetMap = /* @__PURE__ */ new WeakMap(); + var effectStack = []; + var activeEffect; + var ITERATE_KEY = Symbol("iterate"); + var MAP_KEY_ITERATE_KEY = Symbol("Map key iterate"); + function isEffect(fn) { + return fn && fn._isEffect === true; } - function baseUnary(func) { - return function(value) { - return func(value); - }; - } - function baseValues(object, props) { - return arrayMap(props, function(key) { - return object[key]; - }); - } - function cacheHas(cache, key) { - return cache.has(key); - } - function charsStartIndex(strSymbols, chrSymbols) { - var index = -1, length = strSymbols.length; - while (++index < length && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { + function effect3(fn, options = shared.EMPTY_OBJ) { + if (isEffect(fn)) { + fn = fn.raw; } - return index; - } - function charsEndIndex(strSymbols, chrSymbols) { - var index = strSymbols.length; - while (index-- && baseIndexOf(chrSymbols, strSymbols[index], 0) > -1) { + const effect4 = createReactiveEffect(fn, options); + if (!options.lazy) { + effect4(); } - return index; + return effect4; } - function countHolders(array, placeholder) { - var length = array.length, result = 0; - while (length--) { - if (array[length] === placeholder) { - ++result; + function stop2(effect4) { + if (effect4.active) { + cleanup(effect4); + if (effect4.options.onStop) { + effect4.options.onStop(); } + effect4.active = false; } - return result; } - var deburrLetter = basePropertyOf(deburredLetters); - var escapeHtmlChar = basePropertyOf(htmlEscapes); - function escapeStringChar(chr) { - return "\\" + stringEscapes[chr]; - } - function getValue(object, key) { - return object == null ? undefined2 : object[key]; - } - function hasUnicode(string) { - return reHasUnicode.test(string); - } - function hasUnicodeWord(string) { - return reHasUnicodeWord.test(string); - } - function iteratorToArray(iterator) { - var data2, result = []; - while (!(data2 = iterator.next()).done) { - result.push(data2.value); - } - return result; - } - function mapToArray(map) { - var index = -1, result = Array(map.size); - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; - } - function overArg(func, transform) { - return function(arg) { - return func(transform(arg)); - }; - } - function replaceHolders(array, placeholder) { - var index = -1, length = array.length, resIndex = 0, result = []; - while (++index < length) { - var value = array[index]; - if (value === placeholder || value === PLACEHOLDER) { - array[index] = PLACEHOLDER; - result[resIndex++] = index; + var uid = 0; + function createReactiveEffect(fn, options) { + const effect4 = function reactiveEffect() { + if (!effect4.active) { + return fn(); } - } - return result; - } - function setToArray(set3) { - var index = -1, result = Array(set3.size); - set3.forEach(function(value) { - result[++index] = value; - }); - return result; - } - function setToPairs(set3) { - var index = -1, result = Array(set3.size); - set3.forEach(function(value) { - result[++index] = [value, value]; - }); - return result; - } - function strictIndexOf(array, value, fromIndex) { - var index = fromIndex - 1, length = array.length; - while (++index < length) { - if (array[index] === value) { - return index; + if (!effectStack.includes(effect4)) { + cleanup(effect4); + try { + enableTracking(); + effectStack.push(effect4); + activeEffect = effect4; + return fn(); + } finally { + effectStack.pop(); + resetTracking(); + activeEffect = effectStack[effectStack.length - 1]; + } } - } - return -1; + }; + effect4.id = uid++; + effect4.allowRecurse = !!options.allowRecurse; + effect4._isEffect = true; + effect4.active = true; + effect4.raw = fn; + effect4.deps = []; + effect4.options = options; + return effect4; } - function strictLastIndexOf(array, value, fromIndex) { - var index = fromIndex + 1; - while (index--) { - if (array[index] === value) { - return index; + function cleanup(effect4) { + const { deps } = effect4; + if (deps.length) { + for (let i2 = 0; i2 < deps.length; i2++) { + deps[i2].delete(effect4); } + deps.length = 0; } - return index; } - function stringSize(string) { - return hasUnicode(string) ? unicodeSize(string) : asciiSize(string); + var shouldTrack = true; + var trackStack = []; + function pauseTracking() { + trackStack.push(shouldTrack); + shouldTrack = false; } - function stringToArray(string) { - return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); + function enableTracking() { + trackStack.push(shouldTrack); + shouldTrack = true; } - function trimmedEndIndex(string) { - var index = string.length; - while (index-- && reWhitespace.test(string.charAt(index))) { - } - return index; + function resetTracking() { + const last = trackStack.pop(); + shouldTrack = last === void 0 ? true : last; } - var unescapeHtmlChar = basePropertyOf(htmlUnescapes); - function unicodeSize(string) { - var result = reUnicode.lastIndex = 0; - while (reUnicode.test(string)) { - ++result; + function track(target, type, key) { + if (!shouldTrack || activeEffect === void 0) { + return; } - return result; - } - function unicodeToArray(string) { - return string.match(reUnicode) || []; - } - function unicodeWords(string) { - return string.match(reUnicodeWord) || []; - } - var runInContext = function runInContext2(context) { - context = context == null ? root : _3.defaults(root.Object(), context, _3.pick(root, contextProps)); - var Array2 = context.Array, Date2 = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; - var arrayProto = Array2.prototype, funcProto = Function2.prototype, objectProto = Object2.prototype; - var coreJsData = context["__core-js_shared__"]; - var funcToString = funcProto.toString; - var hasOwnProperty3 = objectProto.hasOwnProperty; - var idCounter2 = 0; - var maskSrcKey = function() { - var uid2 = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); - return uid2 ? "Symbol(src)_1." + uid2 : ""; - }(); - var nativeObjectToString = objectProto.toString; - var objectCtorString = funcToString.call(Object2); - var oldDash = root._; - var reIsNative = RegExp2( - "^" + funcToString.call(hasOwnProperty3).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" - ); - var Buffer2 = moduleExports ? context.Buffer : undefined2, Symbol2 = context.Symbol, Uint8Array2 = context.Uint8Array, allocUnsafe = Buffer2 ? Buffer2.allocUnsafe : undefined2, getPrototype = overArg(Object2.getPrototypeOf, Object2), objectCreate = Object2.create, propertyIsEnumerable = objectProto.propertyIsEnumerable, splice = arrayProto.splice, spreadableSymbol = Symbol2 ? Symbol2.isConcatSpreadable : undefined2, symIterator = Symbol2 ? Symbol2.iterator : undefined2, symToStringTag = Symbol2 ? Symbol2.toStringTag : undefined2; - var defineProperty = function() { - try { - var func = getNative(Object2, "defineProperty"); - func({}, "", {}); - return func; - } catch (e3) { - } - }(); - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date2 && Date2.now !== root.Date.now && Date2.now, ctxSetTimeout = context.setTimeout !== root.setTimeout && context.setTimeout; - var nativeCeil = Math2.ceil, nativeFloor = Math2.floor, nativeGetSymbols = Object2.getOwnPropertySymbols, nativeIsBuffer = Buffer2 ? Buffer2.isBuffer : undefined2, nativeIsFinite = context.isFinite, nativeJoin = arrayProto.join, nativeKeys = overArg(Object2.keys, Object2), nativeMax = Math2.max, nativeMin = Math2.min, nativeNow = Date2.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse; - var DataView = getNative(context, "DataView"), Map2 = getNative(context, "Map"), Promise2 = getNative(context, "Promise"), Set2 = getNative(context, "Set"), WeakMap2 = getNative(context, "WeakMap"), nativeCreate = getNative(Object2, "create"); - var metaMap = WeakMap2 && new WeakMap2(); - var realNames = {}; - var dataViewCtorString = toSource(DataView), mapCtorString = toSource(Map2), promiseCtorString = toSource(Promise2), setCtorString = toSource(Set2), weakMapCtorString = toSource(WeakMap2); - var symbolProto = Symbol2 ? Symbol2.prototype : undefined2, symbolValueOf = symbolProto ? symbolProto.valueOf : undefined2, symbolToString = symbolProto ? symbolProto.toString : undefined2; - function lodash(value) { - if (isObjectLike(value) && !isArray2(value) && !(value instanceof LazyWrapper)) { - if (value instanceof LodashWrapper) { - return value; - } - if (hasOwnProperty3.call(value, "__wrapped__")) { - return wrapperClone(value); - } - } - return new LodashWrapper(value); + let depsMap = targetMap.get(target); + if (!depsMap) { + targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); } - var baseCreate = /* @__PURE__ */ function() { - function object() { - } - return function(proto) { - if (!isObject3(proto)) { - return {}; - } - if (objectCreate) { - return objectCreate(proto); - } - object.prototype = proto; - var result2 = new object(); - object.prototype = undefined2; - return result2; - }; - }(); - function baseLodash() { + let dep = depsMap.get(key); + if (!dep) { + depsMap.set(key, dep = /* @__PURE__ */ new Set()); } - function LodashWrapper(value, chainAll) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__chain__ = !!chainAll; - this.__index__ = 0; - this.__values__ = undefined2; - } - lodash.templateSettings = { - /** - * Used to detect `data` property values to be HTML-escaped. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - "escape": reEscape, - /** - * Used to detect code to be evaluated. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - "evaluate": reEvaluate, - /** - * Used to detect `data` property values to inject. - * - * @memberOf _.templateSettings - * @type {RegExp} - */ - "interpolate": reInterpolate, - /** - * Used to reference the data object in the template text. - * - * @memberOf _.templateSettings - * @type {string} - */ - "variable": "", - /** - * Used to import variables into the compiled template. - * - * @memberOf _.templateSettings - * @type {Object} - */ - "imports": { - /** - * A reference to the `lodash` function. - * - * @memberOf _.templateSettings.imports - * @type {Function} - */ - "_": lodash - } - }; - lodash.prototype = baseLodash.prototype; - lodash.prototype.constructor = lodash; - LodashWrapper.prototype = baseCreate(baseLodash.prototype); - LodashWrapper.prototype.constructor = LodashWrapper; - function LazyWrapper(value) { - this.__wrapped__ = value; - this.__actions__ = []; - this.__dir__ = 1; - this.__filtered__ = false; - this.__iteratees__ = []; - this.__takeCount__ = MAX_ARRAY_LENGTH; - this.__views__ = []; - } - function lazyClone() { - var result2 = new LazyWrapper(this.__wrapped__); - result2.__actions__ = copyArray(this.__actions__); - result2.__dir__ = this.__dir__; - result2.__filtered__ = this.__filtered__; - result2.__iteratees__ = copyArray(this.__iteratees__); - result2.__takeCount__ = this.__takeCount__; - result2.__views__ = copyArray(this.__views__); - return result2; - } - function lazyReverse() { - if (this.__filtered__) { - var result2 = new LazyWrapper(this); - result2.__dir__ = -1; - result2.__filtered__ = true; - } else { - result2 = this.clone(); - result2.__dir__ *= -1; - } - return result2; - } - function lazyValue() { - var array = this.__wrapped__.value(), dir = this.__dir__, isArr = isArray2(array), isRight = dir < 0, arrLength = isArr ? array.length : 0, view = getView(0, arrLength, this.__views__), start3 = view.start, end2 = view.end, length = end2 - start3, index = isRight ? end2 : start3 - 1, iteratees = this.__iteratees__, iterLength = iteratees.length, resIndex = 0, takeCount = nativeMin(length, this.__takeCount__); - if (!isArr || !isRight && arrLength == length && takeCount == length) { - return baseWrapperValue(array, this.__actions__); - } - var result2 = []; - outer: - while (length-- && resIndex < takeCount) { - index += dir; - var iterIndex = -1, value = array[index]; - while (++iterIndex < iterLength) { - var data2 = iteratees[iterIndex], iteratee2 = data2.iteratee, type = data2.type, computed = iteratee2(value); - if (type == LAZY_MAP_FLAG) { - value = computed; - } else if (!computed) { - if (type == LAZY_FILTER_FLAG) { - continue outer; - } else { - break outer; - } - } - } - result2[resIndex++] = value; - } - return result2; - } - LazyWrapper.prototype = baseCreate(baseLodash.prototype); - LazyWrapper.prototype.constructor = LazyWrapper; - function Hash(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; - this.size = 0; - } - function hashDelete(key) { - var result2 = this.has(key) && delete this.__data__[key]; - this.size -= result2 ? 1 : 0; - return result2; - } - function hashGet(key) { - var data2 = this.__data__; - if (nativeCreate) { - var result2 = data2[key]; - return result2 === HASH_UNDEFINED ? undefined2 : result2; - } - return hasOwnProperty3.call(data2, key) ? data2[key] : undefined2; - } - function hashHas(key) { - var data2 = this.__data__; - return nativeCreate ? data2[key] !== undefined2 : hasOwnProperty3.call(data2, key); - } - function hashSet(key, value) { - var data2 = this.__data__; - this.size += this.has(key) ? 0 : 1; - data2[key] = nativeCreate && value === undefined2 ? HASH_UNDEFINED : value; - return this; - } - Hash.prototype.clear = hashClear; - Hash.prototype["delete"] = hashDelete; - Hash.prototype.get = hashGet; - Hash.prototype.has = hashHas; - Hash.prototype.set = hashSet; - function ListCache(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - function listCacheClear() { - this.__data__ = []; - this.size = 0; - } - function listCacheDelete(key) { - var data2 = this.__data__, index = assocIndexOf(data2, key); - if (index < 0) { - return false; - } - var lastIndex = data2.length - 1; - if (index == lastIndex) { - data2.pop(); - } else { - splice.call(data2, index, 1); - } - --this.size; - return true; - } - function listCacheGet(key) { - var data2 = this.__data__, index = assocIndexOf(data2, key); - return index < 0 ? undefined2 : data2[index][1]; - } - function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; - } - function listCacheSet(key, value) { - var data2 = this.__data__, index = assocIndexOf(data2, key); - if (index < 0) { - ++this.size; - data2.push([key, value]); - } else { - data2[index][1] = value; - } - return this; - } - ListCache.prototype.clear = listCacheClear; - ListCache.prototype["delete"] = listCacheDelete; - ListCache.prototype.get = listCacheGet; - ListCache.prototype.has = listCacheHas; - ListCache.prototype.set = listCacheSet; - function MapCache(entries) { - var index = -1, length = entries == null ? 0 : entries.length; - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } - } - function mapCacheClear() { - this.size = 0; - this.__data__ = { - "hash": new Hash(), - "map": new (Map2 || ListCache)(), - "string": new Hash() - }; - } - function mapCacheDelete(key) { - var result2 = getMapData(this, key)["delete"](key); - this.size -= result2 ? 1 : 0; - return result2; - } - function mapCacheGet(key) { - return getMapData(this, key).get(key); - } - function mapCacheHas(key) { - return getMapData(this, key).has(key); - } - function mapCacheSet(key, value) { - var data2 = getMapData(this, key), size3 = data2.size; - data2.set(key, value); - this.size += data2.size == size3 ? 0 : 1; - return this; - } - MapCache.prototype.clear = mapCacheClear; - MapCache.prototype["delete"] = mapCacheDelete; - MapCache.prototype.get = mapCacheGet; - MapCache.prototype.has = mapCacheHas; - MapCache.prototype.set = mapCacheSet; - function SetCache(values2) { - var index = -1, length = values2 == null ? 0 : values2.length; - this.__data__ = new MapCache(); - while (++index < length) { - this.add(values2[index]); - } - } - function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; - } - function setCacheHas(value) { - return this.__data__.has(value); - } - SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; - SetCache.prototype.has = setCacheHas; - function Stack(entries) { - var data2 = this.__data__ = new ListCache(entries); - this.size = data2.size; - } - function stackClear() { - this.__data__ = new ListCache(); - this.size = 0; - } - function stackDelete(key) { - var data2 = this.__data__, result2 = data2["delete"](key); - this.size = data2.size; - return result2; - } - function stackGet(key) { - return this.__data__.get(key); - } - function stackHas(key) { - return this.__data__.has(key); - } - function stackSet(key, value) { - var data2 = this.__data__; - if (data2 instanceof ListCache) { - var pairs = data2.__data__; - if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { - pairs.push([key, value]); - this.size = ++data2.size; - return this; - } - data2 = this.__data__ = new MapCache(pairs); - } - data2.set(key, value); - this.size = data2.size; - return this; - } - Stack.prototype.clear = stackClear; - Stack.prototype["delete"] = stackDelete; - Stack.prototype.get = stackGet; - Stack.prototype.has = stackHas; - Stack.prototype.set = stackSet; - function arrayLikeKeys(value, inherited) { - var isArr = isArray2(value), isArg = !isArr && isArguments(value), isBuff = !isArr && !isArg && isBuffer(value), isType2 = !isArr && !isArg && !isBuff && isTypedArray(value), skipIndexes = isArr || isArg || isBuff || isType2, result2 = skipIndexes ? baseTimes(value.length, String2) : [], length = result2.length; - for (var key in value) { - if ((inherited || hasOwnProperty3.call(value, key)) && !(skipIndexes && // Safari 9 has enumerable `arguments.length` in strict mode. - (key == "length" || // Node.js 0.10 has enumerable non-index properties on buffers. - isBuff && (key == "offset" || key == "parent") || // PhantomJS 2 has enumerable non-index properties on typed arrays. - isType2 && (key == "buffer" || key == "byteLength" || key == "byteOffset") || // Skip index properties. - isIndex(key, length)))) { - result2.push(key); - } - } - return result2; - } - function arraySample(array) { - var length = array.length; - return length ? array[baseRandom(0, length - 1)] : undefined2; - } - function arraySampleSize(array, n3) { - return shuffleSelf(copyArray(array), baseClamp(n3, 0, array.length)); - } - function arrayShuffle(array) { - return shuffleSelf(copyArray(array)); - } - function assignMergeValue(object, key, value) { - if (value !== undefined2 && !eq(object[key], value) || value === undefined2 && !(key in object)) { - baseAssignValue(object, key, value); - } - } - function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty3.call(object, key) && eq(objValue, value)) || value === undefined2 && !(key in object)) { - baseAssignValue(object, key, value); - } - } - function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; - } - function baseAggregator(collection, setter, iteratee2, accumulator) { - baseEach(collection, function(value, key, collection2) { - setter(accumulator, value, iteratee2(value), collection2); - }); - return accumulator; - } - function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); - } - function baseAssignIn(object, source) { - return object && copyObject(source, keysIn(source), object); - } - function baseAssignValue(object, key, value) { - if (key == "__proto__" && defineProperty) { - defineProperty(object, key, { - "configurable": true, - "enumerable": true, - "value": value, - "writable": true + if (!dep.has(activeEffect)) { + dep.add(activeEffect); + activeEffect.deps.push(dep); + if (activeEffect.options.onTrack) { + activeEffect.options.onTrack({ + effect: activeEffect, + target, + type, + key }); - } else { - object[key] = value; } } - function baseAt(object, paths) { - var index = -1, length = paths.length, result2 = Array2(length), skip = object == null; - while (++index < length) { - result2[index] = skip ? undefined2 : get3(object, paths[index]); - } - return result2; + } + function trigger(target, type, key, newValue, oldValue, oldTarget) { + const depsMap = targetMap.get(target); + if (!depsMap) { + return; } - function baseClamp(number, lower, upper) { - if (number === number) { - if (upper !== undefined2) { - number = number <= upper ? number : upper; - } - if (lower !== undefined2) { - number = number >= lower ? number : lower; - } - } - return number; - } - function baseClone(value, bitmask, customizer, key, object, stack) { - var result2, isDeep = bitmask & CLONE_DEEP_FLAG, isFlat = bitmask & CLONE_FLAT_FLAG, isFull = bitmask & CLONE_SYMBOLS_FLAG; - if (customizer) { - result2 = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result2 !== undefined2) { - return result2; - } - if (!isObject3(value)) { - return value; - } - var isArr = isArray2(value); - if (isArr) { - result2 = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result2); - } - } else { - var tag = getTag(value), isFunc = tag == funcTag || tag == genTag; - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || isFunc && !object) { - result2 = isFlat || isFunc ? {} : initCloneObject(value); - if (!isDeep) { - return isFlat ? copySymbolsIn(value, baseAssignIn(result2, value)) : copySymbols(value, baseAssign(result2, value)); + const effects = /* @__PURE__ */ new Set(); + const add2 = (effectsToAdd) => { + if (effectsToAdd) { + effectsToAdd.forEach((effect4) => { + if (effect4 !== activeEffect || effect4.allowRecurse) { + effects.add(effect4); } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result2 = initCloneByTag(value, tag, isDeep); - } - } - stack || (stack = new Stack()); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result2); - if (isSet(value)) { - value.forEach(function(subValue) { - result2.add(baseClone(subValue, bitmask, customizer, subValue, value, stack)); }); - } else if (isMap2(value)) { - value.forEach(function(subValue, key2) { - result2.set(key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); - }); } - var keysFunc = isFull ? isFlat ? getAllKeysIn : getAllKeys : isFlat ? keysIn : keys; - var props = isArr ? undefined2 : keysFunc(value); - arrayEach(props || value, function(subValue, key2) { - if (props) { - key2 = subValue; - subValue = value[key2]; + }; + if (type === "clear") { + depsMap.forEach(add2); + } else if (key === "length" && shared.isArray(target)) { + depsMap.forEach((dep, key2) => { + if (key2 === "length" || key2 >= newValue) { + add2(dep); } - assignValue(result2, key2, baseClone(subValue, bitmask, customizer, key2, value, stack)); }); - return result2; - } - function baseConforms(source) { - var props = keys(source); - return function(object) { - return baseConformsTo(object, source, props); - }; - } - function baseConformsTo(object, source, props) { - var length = props.length; - if (object == null) { - return !length; + } else { + if (key !== void 0) { + add2(depsMap.get(key)); } - object = Object2(object); - while (length--) { - var key = props[length], predicate = source[key], value = object[key]; - if (value === undefined2 && !(key in object) || !predicate(value)) { - return false; - } - } - return true; - } - function baseDelay(func, wait, args) { - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); - } - return setTimeout2(function() { - func.apply(undefined2, args); - }, wait); - } - function baseDifference(array, values2, iteratee2, comparator) { - var index = -1, includes2 = arrayIncludes, isCommon = true, length = array.length, result2 = [], valuesLength = values2.length; - if (!length) { - return result2; - } - if (iteratee2) { - values2 = arrayMap(values2, baseUnary(iteratee2)); - } - if (comparator) { - includes2 = arrayIncludesWith; - isCommon = false; - } else if (values2.length >= LARGE_ARRAY_SIZE) { - includes2 = cacheHas; - isCommon = false; - values2 = new SetCache(values2); - } - outer: - while (++index < length) { - var value = array[index], computed = iteratee2 == null ? value : iteratee2(value); - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values2[valuesIndex] === computed) { - continue outer; - } + switch (type) { + case "add": + if (!shared.isArray(target)) { + add2(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + add2(depsMap.get(MAP_KEY_ITERATE_KEY)); } - result2.push(value); - } else if (!includes2(values2, computed, comparator)) { - result2.push(value); + } else if (shared.isIntegerKey(key)) { + add2(depsMap.get("length")); } - } - return result2; - } - var baseEach = createBaseEach(baseForOwn); - var baseEachRight = createBaseEach(baseForOwnRight, true); - function baseEvery(collection, predicate) { - var result2 = true; - baseEach(collection, function(value, index, collection2) { - result2 = !!predicate(value, index, collection2); - return result2; - }); - return result2; - } - function baseExtremum(array, iteratee2, comparator) { - var index = -1, length = array.length; - while (++index < length) { - var value = array[index], current = iteratee2(value); - if (current != null && (computed === undefined2 ? current === current && !isSymbol2(current) : comparator(current, computed))) { - var computed = current, result2 = value; - } - } - return result2; - } - function baseFill(array, value, start3, end2) { - var length = array.length; - start3 = toInteger(start3); - if (start3 < 0) { - start3 = -start3 > length ? 0 : length + start3; - } - end2 = end2 === undefined2 || end2 > length ? length : toInteger(end2); - if (end2 < 0) { - end2 += length; - } - end2 = start3 > end2 ? 0 : toLength(end2); - while (start3 < end2) { - array[start3++] = value; - } - return array; - } - function baseFilter(collection, predicate) { - var result2 = []; - baseEach(collection, function(value, index, collection2) { - if (predicate(value, index, collection2)) { - result2.push(value); - } - }); - return result2; - } - function baseFlatten(array, depth, predicate, isStrict, result2) { - var index = -1, length = array.length; - predicate || (predicate = isFlattenable); - result2 || (result2 = []); - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - baseFlatten(value, depth - 1, predicate, isStrict, result2); - } else { - arrayPush(result2, value); + break; + case "delete": + if (!shared.isArray(target)) { + add2(depsMap.get(ITERATE_KEY)); + if (shared.isMap(target)) { + add2(depsMap.get(MAP_KEY_ITERATE_KEY)); + } } - } else if (!isStrict) { - result2[result2.length] = value; - } + break; + case "set": + if (shared.isMap(target)) { + add2(depsMap.get(ITERATE_KEY)); + } + break; } - return result2; } - var baseFor = createBaseFor(); - var baseForRight = createBaseFor(true); - function baseForOwn(object, iteratee2) { - return object && baseFor(object, iteratee2, keys); - } - function baseForOwnRight(object, iteratee2) { - return object && baseForRight(object, iteratee2, keys); - } - function baseFunctions(object, props) { - return arrayFilter(props, function(key) { - return isFunction(object[key]); - }); - } - function baseGet(object, path) { - path = castPath(path, object); - var index = 0, length = path.length; - while (object != null && index < length) { - object = object[toKey(path[index++])]; + const run = (effect4) => { + if (effect4.options.onTrigger) { + effect4.options.onTrigger({ + effect: effect4, + target, + key, + type, + newValue, + oldValue, + oldTarget + }); } - return index && index == length ? object : undefined2; - } - function baseGetAllKeys(object, keysFunc, symbolsFunc) { - var result2 = keysFunc(object); - return isArray2(object) ? result2 : arrayPush(result2, symbolsFunc(object)); - } - function baseGetTag(value) { - if (value == null) { - return value === undefined2 ? undefinedTag : nullTag; + if (effect4.options.scheduler) { + effect4.options.scheduler(effect4); + } else { + effect4(); } - return symToStringTag && symToStringTag in Object2(value) ? getRawTag(value) : objectToString2(value); - } - function baseGt(value, other) { - return value > other; - } - function baseHas(object, key) { - return object != null && hasOwnProperty3.call(object, key); - } - function baseHasIn(object, key) { - return object != null && key in Object2(object); - } - function baseInRange(number, start3, end2) { - return number >= nativeMin(start3, end2) && number < nativeMax(start3, end2); - } - function baseIntersection(arrays, iteratee2, comparator) { - var includes2 = comparator ? arrayIncludesWith : arrayIncludes, length = arrays[0].length, othLength = arrays.length, othIndex = othLength, caches = Array2(othLength), maxLength = Infinity, result2 = []; - while (othIndex--) { - var array = arrays[othIndex]; - if (othIndex && iteratee2) { - array = arrayMap(array, baseUnary(iteratee2)); + }; + effects.forEach(run); + } + var isNonTrackableKeys = /* @__PURE__ */ shared.makeMap(`__proto__,__v_isRef,__isVue`); + var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(shared.isSymbol)); + var get2 = /* @__PURE__ */ createGetter(); + var shallowGet = /* @__PURE__ */ createGetter(false, true); + var readonlyGet = /* @__PURE__ */ createGetter(true); + var shallowReadonlyGet = /* @__PURE__ */ createGetter(true, true); + var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); + function createArrayInstrumentations() { + const instrumentations = {}; + ["includes", "indexOf", "lastIndexOf"].forEach((key) => { + instrumentations[key] = function(...args) { + const arr = toRaw2(this); + for (let i2 = 0, l2 = this.length; i2 < l2; i2++) { + track(arr, "get", i2 + ""); } - maxLength = nativeMin(array.length, maxLength); - caches[othIndex] = !comparator && (iteratee2 || length >= 120 && array.length >= 120) ? new SetCache(othIndex && array) : undefined2; - } - array = arrays[0]; - var index = -1, seen = caches[0]; - outer: - while (++index < length && result2.length < maxLength) { - var value = array[index], computed = iteratee2 ? iteratee2(value) : value; - value = comparator || value !== 0 ? value : 0; - if (!(seen ? cacheHas(seen, computed) : includes2(result2, computed, comparator))) { - othIndex = othLength; - while (--othIndex) { - var cache = caches[othIndex]; - if (!(cache ? cacheHas(cache, computed) : includes2(arrays[othIndex], computed, comparator))) { - continue outer; - } - } - if (seen) { - seen.push(computed); - } - result2.push(value); - } + const res = arr[key](...args); + if (res === -1 || res === false) { + return arr[key](...args.map(toRaw2)); + } else { + return res; } - return result2; - } - function baseInverter(object, setter, iteratee2, accumulator) { - baseForOwn(object, function(value, key, object2) { - setter(accumulator, iteratee2(value), key, object2); - }); - return accumulator; - } - function baseInvoke(object, path, args) { - path = castPath(path, object); - object = parent(object, path); - var func = object == null ? object : object[toKey(last(path))]; - return func == null ? undefined2 : apply(func, object, args); - } - function baseIsArguments(value) { - return isObjectLike(value) && baseGetTag(value) == argsTag; - } - function baseIsArrayBuffer(value) { - return isObjectLike(value) && baseGetTag(value) == arrayBufferTag; - } - function baseIsDate(value) { - return isObjectLike(value) && baseGetTag(value) == dateTag; - } - function baseIsEqual(value, other, bitmask, customizer, stack) { - if (value === other) { - return true; + }; + }); + ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { + instrumentations[key] = function(...args) { + pauseTracking(); + const res = toRaw2(this)[key].apply(this, args); + resetTracking(); + return res; + }; + }); + return instrumentations; + } + function createGetter(isReadonly2 = false, shallow = false) { + return function get3(target, key, receiver) { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw" && receiver === (isReadonly2 ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { + return target; } - if (value == null || other == null || !isObjectLike(value) && !isObjectLike(other)) { - return value !== value && other !== other; + const targetIsArray = shared.isArray(target); + if (!isReadonly2 && targetIsArray && shared.hasOwn(arrayInstrumentations, key)) { + return Reflect.get(arrayInstrumentations, key, receiver); } - return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack); - } - function baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) { - var objIsArr = isArray2(object), othIsArr = isArray2(other), objTag = objIsArr ? arrayTag : getTag(object), othTag = othIsArr ? arrayTag : getTag(other); - objTag = objTag == argsTag ? objectTag : objTag; - othTag = othTag == argsTag ? objectTag : othTag; - var objIsObj = objTag == objectTag, othIsObj = othTag == objectTag, isSameTag = objTag == othTag; - if (isSameTag && isBuffer(object)) { - if (!isBuffer(other)) { - return false; - } - objIsArr = true; - objIsObj = false; + const res = Reflect.get(target, key, receiver); + if (shared.isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { + return res; } - if (isSameTag && !objIsObj) { - stack || (stack = new Stack()); - return objIsArr || isTypedArray(object) ? equalArrays(object, other, bitmask, customizer, equalFunc, stack) : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack); + if (!isReadonly2) { + track(target, "get", key); } - if (!(bitmask & COMPARE_PARTIAL_FLAG)) { - var objIsWrapped = objIsObj && hasOwnProperty3.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty3.call(other, "__wrapped__"); - if (objIsWrapped || othIsWrapped) { - var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; - stack || (stack = new Stack()); - return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack); - } + if (shallow) { + return res; } - if (!isSameTag) { - return false; + if (isRef(res)) { + const shouldUnwrap = !targetIsArray || !shared.isIntegerKey(key); + return shouldUnwrap ? res.value : res; } - stack || (stack = new Stack()); - return equalObjects(object, other, bitmask, customizer, equalFunc, stack); - } - function baseIsMap(value) { - return isObjectLike(value) && getTag(value) == mapTag; - } - function baseIsMatch(object, source, matchData, customizer) { - var index = matchData.length, length = index, noCustomizer = !customizer; - if (object == null) { - return !length; + if (shared.isObject(res)) { + return isReadonly2 ? readonly(res) : reactive3(res); } - object = Object2(object); - while (index--) { - var data2 = matchData[index]; - if (noCustomizer && data2[2] ? data2[1] !== object[data2[0]] : !(data2[0] in object)) { - return false; + return res; + }; + } + var set2 = /* @__PURE__ */ createSetter(); + var shallowSet = /* @__PURE__ */ createSetter(true); + function createSetter(shallow = false) { + return function set3(target, key, value, receiver) { + let oldValue = target[key]; + if (!shallow) { + value = toRaw2(value); + oldValue = toRaw2(oldValue); + if (!shared.isArray(target) && isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; } } - while (++index < length) { - data2 = matchData[index]; - var key = data2[0], objValue = object[key], srcValue = data2[1]; - if (noCustomizer && data2[2]) { - if (objValue === undefined2 && !(key in object)) { - return false; - } - } else { - var stack = new Stack(); - if (customizer) { - var result2 = customizer(objValue, srcValue, key, object, source, stack); - } - if (!(result2 === undefined2 ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack) : result2)) { - return false; - } + const hadKey = shared.isArray(target) && shared.isIntegerKey(key) ? Number(key) < target.length : shared.hasOwn(target, key); + const result = Reflect.set(target, key, value, receiver); + if (target === toRaw2(receiver)) { + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); } } - return true; + return result; + }; + } + function deleteProperty(target, key) { + const hadKey = shared.hasOwn(target, key); + const oldValue = target[key]; + const result = Reflect.deleteProperty(target, key); + if (result && hadKey) { + trigger(target, "delete", key, void 0, oldValue); } - function baseIsNative(value) { - if (!isObject3(value) || isMasked(value)) { - return false; - } - var pattern = isFunction(value) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); + return result; + } + function has(target, key) { + const result = Reflect.has(target, key); + if (!shared.isSymbol(key) || !builtInSymbols.has(key)) { + track(target, "has", key); } - function baseIsRegExp(value) { - return isObjectLike(value) && baseGetTag(value) == regexpTag; - } - function baseIsSet(value) { - return isObjectLike(value) && getTag(value) == setTag; - } - function baseIsTypedArray(value) { - return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[baseGetTag(value)]; - } - function baseIteratee(value) { - if (typeof value == "function") { - return value; + return result; + } + function ownKeys(target) { + track(target, "iterate", shared.isArray(target) ? "length" : ITERATE_KEY); + return Reflect.ownKeys(target); + } + var mutableHandlers = { + get: get2, + set: set2, + deleteProperty, + has, + ownKeys + }; + var readonlyHandlers = { + get: readonlyGet, + set(target, key) { + { + console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target); } - if (value == null) { - return identity; + return true; + }, + deleteProperty(target, key) { + { + console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); } - if (typeof value == "object") { - return isArray2(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); - } - return property(value); + return true; } - function baseKeys(object) { - if (!isPrototype(object)) { - return nativeKeys(object); - } - var result2 = []; - for (var key in Object2(object)) { - if (hasOwnProperty3.call(object, key) && key != "constructor") { - result2.push(key); - } - } - return result2; + }; + var shallowReactiveHandlers = /* @__PURE__ */ shared.extend({}, mutableHandlers, { + get: shallowGet, + set: shallowSet + }); + var shallowReadonlyHandlers = /* @__PURE__ */ shared.extend({}, readonlyHandlers, { + get: shallowReadonlyGet + }); + var toReactive = (value) => shared.isObject(value) ? reactive3(value) : value; + var toReadonly = (value) => shared.isObject(value) ? readonly(value) : value; + var toShallow = (value) => value; + var getProto = (v2) => Reflect.getPrototypeOf(v2); + function get$1(target, key, isReadonly2 = false, isShallow = false) { + target = target[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const rawKey = toRaw2(key); + if (key !== rawKey) { + !isReadonly2 && track(rawTarget, "get", key); } - function baseKeysIn(object) { - if (!isObject3(object)) { - return nativeKeysIn(object); - } - var isProto = isPrototype(object), result2 = []; - for (var key in object) { - if (!(key == "constructor" && (isProto || !hasOwnProperty3.call(object, key)))) { - result2.push(key); - } - } - return result2; + !isReadonly2 && track(rawTarget, "get", rawKey); + const { has: has2 } = getProto(rawTarget); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + if (has2.call(rawTarget, key)) { + return wrap(target.get(key)); + } else if (has2.call(rawTarget, rawKey)) { + return wrap(target.get(rawKey)); + } else if (target !== rawTarget) { + target.get(key); } - function baseLt(value, other) { - return value < other; + } + function has$1(key, isReadonly2 = false) { + const target = this[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const rawKey = toRaw2(key); + if (key !== rawKey) { + !isReadonly2 && track(rawTarget, "has", key); } - function baseMap(collection, iteratee2) { - var index = -1, result2 = isArrayLike(collection) ? Array2(collection.length) : []; - baseEach(collection, function(value, key, collection2) { - result2[++index] = iteratee2(value, key, collection2); - }); - return result2; + !isReadonly2 && track(rawTarget, "has", rawKey); + return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); + } + function size(target, isReadonly2 = false) { + target = target[ + "__v_raw" + /* RAW */ + ]; + !isReadonly2 && track(toRaw2(target), "iterate", ITERATE_KEY); + return Reflect.get(target, "size", target); + } + function add(value) { + value = toRaw2(value); + const target = toRaw2(this); + const proto = getProto(target); + const hadKey = proto.has.call(target, value); + if (!hadKey) { + target.add(value); + trigger(target, "add", value, value); } - function baseMatches(source) { - var matchData = getMatchData(source); - if (matchData.length == 1 && matchData[0][2]) { - return matchesStrictComparable(matchData[0][0], matchData[0][1]); - } - return function(object) { - return object === source || baseIsMatch(object, source, matchData); - }; + return this; + } + function set$1(key, value) { + value = toRaw2(value); + const target = toRaw2(this); + const { has: has2, get: get3 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw2(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); } - function baseMatchesProperty(path, srcValue) { - if (isKey(path) && isStrictComparable(srcValue)) { - return matchesStrictComparable(toKey(path), srcValue); - } - return function(object) { - var objValue = get3(object, path); - return objValue === undefined2 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG); - }; + const oldValue = get3.call(target, key); + target.set(key, value); + if (!hadKey) { + trigger(target, "add", key, value); + } else if (shared.hasChanged(value, oldValue)) { + trigger(target, "set", key, value, oldValue); } - function baseMerge(object, source, srcIndex, customizer, stack) { - if (object === source) { - return; - } - baseFor(source, function(srcValue, key) { - stack || (stack = new Stack()); - if (isObject3(srcValue)) { - baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack); - } else { - var newValue = customizer ? customizer(safeGet(object, key), srcValue, key + "", object, source, stack) : undefined2; - if (newValue === undefined2) { - newValue = srcValue; - } - assignMergeValue(object, key, newValue); - } - }, keysIn); + return this; + } + function deleteEntry(key) { + const target = toRaw2(this); + const { has: has2, get: get3 } = getProto(target); + let hadKey = has2.call(target, key); + if (!hadKey) { + key = toRaw2(key); + hadKey = has2.call(target, key); + } else { + checkIdentityKeys(target, has2, key); } - function baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) { - var objValue = safeGet(object, key), srcValue = safeGet(source, key), stacked = stack.get(srcValue); - if (stacked) { - assignMergeValue(object, key, stacked); - return; - } - var newValue = customizer ? customizer(objValue, srcValue, key + "", object, source, stack) : undefined2; - var isCommon = newValue === undefined2; - if (isCommon) { - var isArr = isArray2(srcValue), isBuff = !isArr && isBuffer(srcValue), isTyped = !isArr && !isBuff && isTypedArray(srcValue); - newValue = srcValue; - if (isArr || isBuff || isTyped) { - if (isArray2(objValue)) { - newValue = objValue; - } else if (isArrayLikeObject(objValue)) { - newValue = copyArray(objValue); - } else if (isBuff) { - isCommon = false; - newValue = cloneBuffer(srcValue, true); - } else if (isTyped) { - isCommon = false; - newValue = cloneTypedArray(srcValue, true); - } else { - newValue = []; - } - } else if (isPlainObject(srcValue) || isArguments(srcValue)) { - newValue = objValue; - if (isArguments(objValue)) { - newValue = toPlainObject(objValue); - } else if (!isObject3(objValue) || isFunction(objValue)) { - newValue = initCloneObject(srcValue); - } - } else { - isCommon = false; - } - } - if (isCommon) { - stack.set(srcValue, newValue); - mergeFunc(newValue, srcValue, srcIndex, customizer, stack); - stack["delete"](srcValue); - } - assignMergeValue(object, key, newValue); + const oldValue = get3 ? get3.call(target, key) : void 0; + const result = target.delete(key); + if (hadKey) { + trigger(target, "delete", key, void 0, oldValue); } - function baseNth(array, n3) { - var length = array.length; - if (!length) { - return; - } - n3 += n3 < 0 ? length : 0; - return isIndex(n3, length) ? array[n3] : undefined2; + return result; + } + function clear() { + const target = toRaw2(this); + const hadItems = target.size !== 0; + const oldTarget = shared.isMap(target) ? new Map(target) : new Set(target); + const result = target.clear(); + if (hadItems) { + trigger(target, "clear", void 0, void 0, oldTarget); } - function baseOrderBy(collection, iteratees, orders) { - if (iteratees.length) { - iteratees = arrayMap(iteratees, function(iteratee2) { - if (isArray2(iteratee2)) { - return function(value) { - return baseGet(value, iteratee2.length === 1 ? iteratee2[0] : iteratee2); - }; - } - return iteratee2; - }); - } else { - iteratees = [identity]; - } - var index = -1; - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - var result2 = baseMap(collection, function(value, key, collection2) { - var criteria = arrayMap(iteratees, function(iteratee2) { - return iteratee2(value); - }); - return { "criteria": criteria, "index": ++index, "value": value }; + return result; + } + function createForEach(isReadonly2, isShallow) { + return function forEach(callback, thisArg) { + const observed = this; + const target = observed[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track(rawTarget, "iterate", ITERATE_KEY); + return target.forEach((value, key) => { + return callback.call(thisArg, wrap(value), wrap(key), observed); }); - return baseSortBy(result2, function(object, other) { - return compareMultiple(object, other, orders); - }); - } - function basePick(object, paths) { - return basePickBy(object, paths, function(value, path) { - return hasIn(object, path); - }); - } - function basePickBy(object, paths, predicate) { - var index = -1, length = paths.length, result2 = {}; - while (++index < length) { - var path = paths[index], value = baseGet(object, path); - if (predicate(value, path)) { - baseSet(result2, castPath(path, object), value); + }; + } + function createIterableMethod(method, isReadonly2, isShallow) { + return function(...args) { + const target = this[ + "__v_raw" + /* RAW */ + ]; + const rawTarget = toRaw2(target); + const targetIsMap = shared.isMap(rawTarget); + const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; + const isKeyOnly = method === "keys" && targetIsMap; + const innerIterator = target[method](...args); + const wrap = isShallow ? toShallow : isReadonly2 ? toReadonly : toReactive; + !isReadonly2 && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); + return { + // iterator protocol + next() { + const { value, done } = innerIterator.next(); + return done ? { value, done } : { + value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), + done + }; + }, + // iterable protocol + [Symbol.iterator]() { + return this; } - } - return result2; - } - function basePropertyDeep(path) { - return function(object) { - return baseGet(object, path); }; - } - function basePullAll(array, values2, iteratee2, comparator) { - var indexOf2 = comparator ? baseIndexOfWith : baseIndexOf, index = -1, length = values2.length, seen = array; - if (array === values2) { - values2 = copyArray(values2); + }; + } + function createReadonlyMethod(type) { + return function(...args) { + { + const key = args[0] ? `on key "${args[0]}" ` : ``; + console.warn(`${shared.capitalize(type)} operation ${key}failed: target is readonly.`, toRaw2(this)); } - if (iteratee2) { - seen = arrayMap(array, baseUnary(iteratee2)); - } - while (++index < length) { - var fromIndex = 0, value = values2[index], computed = iteratee2 ? iteratee2(value) : value; - while ((fromIndex = indexOf2(seen, computed, fromIndex, comparator)) > -1) { - if (seen !== array) { - splice.call(seen, fromIndex, 1); - } - splice.call(array, fromIndex, 1); - } - } - return array; - } - function basePullAt(array, indexes) { - var length = array ? indexes.length : 0, lastIndex = length - 1; - while (length--) { - var index = indexes[length]; - if (length == lastIndex || index !== previous) { - var previous = index; - if (isIndex(index)) { - splice.call(array, index, 1); - } else { - baseUnset(array, index); - } - } - } - return array; - } - function baseRandom(lower, upper) { - return lower + nativeFloor(nativeRandom() * (upper - lower + 1)); - } - function baseRange(start3, end2, step, fromRight) { - var index = -1, length = nativeMax(nativeCeil((end2 - start3) / (step || 1)), 0), result2 = Array2(length); - while (length--) { - result2[fromRight ? length : ++index] = start3; - start3 += step; - } - return result2; - } - function baseRepeat(string, n3) { - var result2 = ""; - if (!string || n3 < 1 || n3 > MAX_SAFE_INTEGER) { - return result2; - } - do { - if (n3 % 2) { - result2 += string; - } - n3 = nativeFloor(n3 / 2); - if (n3) { - string += string; - } - } while (n3); - return result2; - } - function baseRest(func, start3) { - return setToString(overRest(func, start3, identity), func + ""); - } - function baseSample(collection) { - return arraySample(values(collection)); - } - function baseSampleSize(collection, n3) { - var array = values(collection); - return shuffleSelf(array, baseClamp(n3, 0, array.length)); - } - function baseSet(object, path, value, customizer) { - if (!isObject3(object)) { - return object; - } - path = castPath(path, object); - var index = -1, length = path.length, lastIndex = length - 1, nested = object; - while (nested != null && ++index < length) { - var key = toKey(path[index]), newValue = value; - if (key === "__proto__" || key === "constructor" || key === "prototype") { - return object; - } - if (index != lastIndex) { - var objValue = nested[key]; - newValue = customizer ? customizer(objValue, key, nested) : undefined2; - if (newValue === undefined2) { - newValue = isObject3(objValue) ? objValue : isIndex(path[index + 1]) ? [] : {}; - } - } - assignValue(nested, key, newValue); - nested = nested[key]; - } - return object; - } - var baseSetData = !metaMap ? identity : function(func, data2) { - metaMap.set(func, data2); - return func; + return type === "delete" ? false : this; }; - var baseSetToString = !defineProperty ? identity : function(func, string) { - return defineProperty(func, "toString", { - "configurable": true, - "enumerable": false, - "value": constant(string), - "writable": true - }); + } + function createInstrumentations() { + const mutableInstrumentations2 = { + get(key) { + return get$1(this, key); + }, + get size() { + return size(this); + }, + has: has$1, + add, + set: set$1, + delete: deleteEntry, + clear, + forEach: createForEach(false, false) }; - function baseShuffle(collection) { - return shuffleSelf(values(collection)); - } - function baseSlice(array, start3, end2) { - var index = -1, length = array.length; - if (start3 < 0) { - start3 = -start3 > length ? 0 : length + start3; + const shallowInstrumentations2 = { + get(key) { + return get$1(this, key, false, true); + }, + get size() { + return size(this); + }, + has: has$1, + add, + set: set$1, + delete: deleteEntry, + clear, + forEach: createForEach(false, true) + }; + const readonlyInstrumentations2 = { + get(key) { + return get$1(this, key, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod( + "add" + /* ADD */ + ), + set: createReadonlyMethod( + "set" + /* SET */ + ), + delete: createReadonlyMethod( + "delete" + /* DELETE */ + ), + clear: createReadonlyMethod( + "clear" + /* CLEAR */ + ), + forEach: createForEach(true, false) + }; + const shallowReadonlyInstrumentations2 = { + get(key) { + return get$1(this, key, true, true); + }, + get size() { + return size(this, true); + }, + has(key) { + return has$1.call(this, key, true); + }, + add: createReadonlyMethod( + "add" + /* ADD */ + ), + set: createReadonlyMethod( + "set" + /* SET */ + ), + delete: createReadonlyMethod( + "delete" + /* DELETE */ + ), + clear: createReadonlyMethod( + "clear" + /* CLEAR */ + ), + forEach: createForEach(true, true) + }; + const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; + iteratorMethods.forEach((method) => { + mutableInstrumentations2[method] = createIterableMethod(method, false, false); + readonlyInstrumentations2[method] = createIterableMethod(method, true, false); + shallowInstrumentations2[method] = createIterableMethod(method, false, true); + shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); + }); + return [ + mutableInstrumentations2, + readonlyInstrumentations2, + shallowInstrumentations2, + shallowReadonlyInstrumentations2 + ]; + } + var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); + function createInstrumentationGetter(isReadonly2, shallow) { + const instrumentations = shallow ? isReadonly2 ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly2 ? readonlyInstrumentations : mutableInstrumentations; + return (target, key, receiver) => { + if (key === "__v_isReactive") { + return !isReadonly2; + } else if (key === "__v_isReadonly") { + return isReadonly2; + } else if (key === "__v_raw") { + return target; } - end2 = end2 > length ? length : end2; - if (end2 < 0) { - end2 += length; - } - length = start3 > end2 ? 0 : end2 - start3 >>> 0; - start3 >>>= 0; - var result2 = Array2(length); - while (++index < length) { - result2[index] = array[index + start3]; - } - return result2; + return Reflect.get(shared.hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); + }; + } + var mutableCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, false) + }; + var shallowCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(false, true) + }; + var readonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, false) + }; + var shallowReadonlyCollectionHandlers = { + get: /* @__PURE__ */ createInstrumentationGetter(true, true) + }; + function checkIdentityKeys(target, has2, key) { + const rawKey = toRaw2(key); + if (rawKey !== key && has2.call(target, rawKey)) { + const type = shared.toRawType(target); + console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); } - function baseSome(collection, predicate) { - var result2; - baseEach(collection, function(value, index, collection2) { - result2 = predicate(value, index, collection2); - return !result2; - }); - return !!result2; - } - function baseSortedIndex(array, value, retHighest) { - var low = 0, high = array == null ? low : array.length; - if (typeof value == "number" && value === value && high <= HALF_MAX_ARRAY_LENGTH) { - while (low < high) { - var mid = low + high >>> 1, computed = array[mid]; - if (computed !== null && !isSymbol2(computed) && (retHighest ? computed <= value : computed < value)) { - low = mid + 1; - } else { - high = mid; - } - } - return high; - } - return baseSortedIndexBy(array, value, identity, retHighest); - } - function baseSortedIndexBy(array, value, iteratee2, retHighest) { - var low = 0, high = array == null ? 0 : array.length; - if (high === 0) { + } + var reactiveMap = /* @__PURE__ */ new WeakMap(); + var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); + var readonlyMap = /* @__PURE__ */ new WeakMap(); + var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); + function targetTypeMap(rawType) { + switch (rawType) { + case "Object": + case "Array": + return 1; + case "Map": + case "Set": + case "WeakMap": + case "WeakSet": + return 2; + default: return 0; - } - value = iteratee2(value); - var valIsNaN = value !== value, valIsNull = value === null, valIsSymbol = isSymbol2(value), valIsUndefined = value === undefined2; - while (low < high) { - var mid = nativeFloor((low + high) / 2), computed = iteratee2(array[mid]), othIsDefined = computed !== undefined2, othIsNull = computed === null, othIsReflexive = computed === computed, othIsSymbol = isSymbol2(computed); - if (valIsNaN) { - var setLow = retHighest || othIsReflexive; - } else if (valIsUndefined) { - setLow = othIsReflexive && (retHighest || othIsDefined); - } else if (valIsNull) { - setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull); - } else if (valIsSymbol) { - setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol); - } else if (othIsNull || othIsSymbol) { - setLow = false; - } else { - setLow = retHighest ? computed <= value : computed < value; - } - if (setLow) { - low = mid + 1; - } else { - high = mid; - } - } - return nativeMin(high, MAX_ARRAY_INDEX); } - function baseSortedUniq(array, iteratee2) { - var index = -1, length = array.length, resIndex = 0, result2 = []; - while (++index < length) { - var value = array[index], computed = iteratee2 ? iteratee2(value) : value; - if (!index || !eq(computed, seen)) { - var seen = computed; - result2[resIndex++] = value === 0 ? 0 : value; - } - } - return result2; + } + function getTargetType(value) { + return value[ + "__v_skip" + /* SKIP */ + ] || !Object.isExtensible(value) ? 0 : targetTypeMap(shared.toRawType(value)); + } + function reactive3(target) { + if (target && target[ + "__v_isReadonly" + /* IS_READONLY */ + ]) { + return target; } - function baseToNumber(value) { - if (typeof value == "number") { - return value; + return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); + } + function shallowReactive(target) { + return createReactiveObject(target, false, shallowReactiveHandlers, shallowCollectionHandlers, shallowReactiveMap); + } + function readonly(target) { + return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); + } + function shallowReadonly(target) { + return createReactiveObject(target, true, shallowReadonlyHandlers, shallowReadonlyCollectionHandlers, shallowReadonlyMap); + } + function createReactiveObject(target, isReadonly2, baseHandlers, collectionHandlers, proxyMap) { + if (!shared.isObject(target)) { + { + console.warn(`value cannot be made reactive: ${String(target)}`); } - if (isSymbol2(value)) { - return NAN; - } - return +value; + return target; } - function baseToString(value) { - if (typeof value == "string") { - return value; - } - if (isArray2(value)) { - return arrayMap(value, baseToString) + ""; - } - if (isSymbol2(value)) { - return symbolToString ? symbolToString.call(value) : ""; - } - var result2 = value + ""; - return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; + if (target[ + "__v_raw" + /* RAW */ + ] && !(isReadonly2 && target[ + "__v_isReactive" + /* IS_REACTIVE */ + ])) { + return target; } - function baseUniq(array, iteratee2, comparator) { - var index = -1, includes2 = arrayIncludes, length = array.length, isCommon = true, result2 = [], seen = result2; - if (comparator) { - isCommon = false; - includes2 = arrayIncludesWith; - } else if (length >= LARGE_ARRAY_SIZE) { - var set4 = iteratee2 ? null : createSet(array); - if (set4) { - return setToArray(set4); - } - isCommon = false; - includes2 = cacheHas; - seen = new SetCache(); - } else { - seen = iteratee2 ? [] : result2; - } - outer: - while (++index < length) { - var value = array[index], computed = iteratee2 ? iteratee2(value) : value; - value = comparator || value !== 0 ? value : 0; - if (isCommon && computed === computed) { - var seenIndex = seen.length; - while (seenIndex--) { - if (seen[seenIndex] === computed) { - continue outer; - } - } - if (iteratee2) { - seen.push(computed); - } - result2.push(value); - } else if (!includes2(seen, computed, comparator)) { - if (seen !== result2) { - seen.push(computed); - } - result2.push(value); - } - } - return result2; + const existingProxy = proxyMap.get(target); + if (existingProxy) { + return existingProxy; } - function baseUnset(object, path) { - path = castPath(path, object); - object = parent(object, path); - return object == null || delete object[toKey(last(path))]; + const targetType = getTargetType(target); + if (targetType === 0) { + return target; } - function baseUpdate(object, path, updater, customizer) { - return baseSet(object, path, updater(baseGet(object, path)), customizer); + const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); + proxyMap.set(target, proxy); + return proxy; + } + function isReactive2(value) { + if (isReadonly(value)) { + return isReactive2(value[ + "__v_raw" + /* RAW */ + ]); } - function baseWhile(array, predicate, isDrop, fromRight) { - var length = array.length, index = fromRight ? length : -1; - while ((fromRight ? index-- : ++index < length) && predicate(array[index], index, array)) { - } - return isDrop ? baseSlice(array, fromRight ? 0 : index, fromRight ? index + 1 : length) : baseSlice(array, fromRight ? index + 1 : 0, fromRight ? length : index); + return !!(value && value[ + "__v_isReactive" + /* IS_REACTIVE */ + ]); + } + function isReadonly(value) { + return !!(value && value[ + "__v_isReadonly" + /* IS_READONLY */ + ]); + } + function isProxy(value) { + return isReactive2(value) || isReadonly(value); + } + function toRaw2(observed) { + return observed && toRaw2(observed[ + "__v_raw" + /* RAW */ + ]) || observed; + } + function markRaw(value) { + shared.def(value, "__v_skip", true); + return value; + } + var convert = (val) => shared.isObject(val) ? reactive3(val) : val; + function isRef(r2) { + return Boolean(r2 && r2.__v_isRef === true); + } + function ref(value) { + return createRef(value); + } + function shallowRef(value) { + return createRef(value, true); + } + var RefImpl = class { + constructor(value, _shallow = false) { + this._shallow = _shallow; + this.__v_isRef = true; + this._rawValue = _shallow ? value : toRaw2(value); + this._value = _shallow ? value : convert(value); } - function baseWrapperValue(value, actions) { - var result2 = value; - if (result2 instanceof LazyWrapper) { - result2 = result2.value(); - } - return arrayReduce(actions, function(result3, action) { - return action.func.apply(action.thisArg, arrayPush([result3], action.args)); - }, result2); + get value() { + track(toRaw2(this), "get", "value"); + return this._value; } - function baseXor(arrays, iteratee2, comparator) { - var length = arrays.length; - if (length < 2) { - return length ? baseUniq(arrays[0]) : []; + set value(newVal) { + newVal = this._shallow ? newVal : toRaw2(newVal); + if (shared.hasChanged(newVal, this._rawValue)) { + this._rawValue = newVal; + this._value = this._shallow ? newVal : convert(newVal); + trigger(toRaw2(this), "set", "value", newVal); } - var index = -1, result2 = Array2(length); - while (++index < length) { - var array = arrays[index], othIndex = -1; - while (++othIndex < length) { - if (othIndex != index) { - result2[index] = baseDifference(result2[index] || array, arrays[othIndex], iteratee2, comparator); - } - } - } - return baseUniq(baseFlatten(result2, 1), iteratee2, comparator); } - function baseZipObject(props, values2, assignFunc) { - var index = -1, length = props.length, valsLength = values2.length, result2 = {}; - while (++index < length) { - var value = index < valsLength ? values2[index] : undefined2; - assignFunc(result2, props[index], value); - } - return result2; + }; + function createRef(rawValue, shallow = false) { + if (isRef(rawValue)) { + return rawValue; } - function castArrayLikeObject(value) { - return isArrayLikeObject(value) ? value : []; - } - function castFunction(value) { - return typeof value == "function" ? value : identity; - } - function castPath(value, object) { - if (isArray2(value)) { - return value; + return new RefImpl(rawValue, shallow); + } + function triggerRef(ref2) { + trigger(toRaw2(ref2), "set", "value", ref2.value); + } + function unref(ref2) { + return isRef(ref2) ? ref2.value : ref2; + } + var shallowUnwrapHandlers = { + get: (target, key, receiver) => unref(Reflect.get(target, key, receiver)), + set: (target, key, value, receiver) => { + const oldValue = target[key]; + if (isRef(oldValue) && !isRef(value)) { + oldValue.value = value; + return true; + } else { + return Reflect.set(target, key, value, receiver); } - return isKey(value, object) ? [value] : stringToPath(toString(value)); } - var castRest = baseRest; - function castSlice(array, start3, end2) { - var length = array.length; - end2 = end2 === undefined2 ? length : end2; - return !start3 && end2 >= length ? array : baseSlice(array, start3, end2); + }; + function proxyRefs(objectWithRefs) { + return isReactive2(objectWithRefs) ? objectWithRefs : new Proxy(objectWithRefs, shallowUnwrapHandlers); + } + var CustomRefImpl = class { + constructor(factory) { + this.__v_isRef = true; + const { get: get3, set: set3 } = factory(() => track(this, "get", "value"), () => trigger(this, "set", "value")); + this._get = get3; + this._set = set3; } - var clearTimeout2 = ctxClearTimeout || function(id) { - return root.clearTimeout(id); - }; - function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var length = buffer.length, result2 = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length); - buffer.copy(result2); - return result2; + get value() { + return this._get(); } - function cloneArrayBuffer(arrayBuffer) { - var result2 = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array2(result2).set(new Uint8Array2(arrayBuffer)); - return result2; + set value(newVal) { + this._set(newVal); } - function cloneDataView(dataView, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; - return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); + }; + function customRef(factory) { + return new CustomRefImpl(factory); + } + function toRefs(object) { + if (!isProxy(object)) { + console.warn(`toRefs() expects a reactive object but received a plain one.`); } - function cloneRegExp(regexp) { - var result2 = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result2.lastIndex = regexp.lastIndex; - return result2; + const ret = shared.isArray(object) ? new Array(object.length) : {}; + for (const key in object) { + ret[key] = toRef(object, key); } - function cloneSymbol(symbol) { - return symbolValueOf ? Object2(symbolValueOf.call(symbol)) : {}; + return ret; + } + var ObjectRefImpl = class { + constructor(_object, _key) { + this._object = _object; + this._key = _key; + this.__v_isRef = true; } - function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); + get value() { + return this._object[this._key]; } - function compareAscending(value, other) { - if (value !== other) { - var valIsDefined = value !== undefined2, valIsNull = value === null, valIsReflexive = value === value, valIsSymbol = isSymbol2(value); - var othIsDefined = other !== undefined2, othIsNull = other === null, othIsReflexive = other === other, othIsSymbol = isSymbol2(other); - if (!othIsNull && !othIsSymbol && !valIsSymbol && value > other || valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol || valIsNull && othIsDefined && othIsReflexive || !valIsDefined && othIsReflexive || !valIsReflexive) { - return 1; - } - if (!valIsNull && !valIsSymbol && !othIsSymbol && value < other || othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol || othIsNull && valIsDefined && valIsReflexive || !othIsDefined && valIsReflexive || !othIsReflexive) { - return -1; - } - } - return 0; + set value(newVal) { + this._object[this._key] = newVal; } - function compareMultiple(object, other, orders) { - var index = -1, objCriteria = object.criteria, othCriteria = other.criteria, length = objCriteria.length, ordersLength = orders.length; - while (++index < length) { - var result2 = compareAscending(objCriteria[index], othCriteria[index]); - if (result2) { - if (index >= ordersLength) { - return result2; + }; + function toRef(object, key) { + return isRef(object[key]) ? object[key] : new ObjectRefImpl(object, key); + } + var ComputedRefImpl = class { + constructor(getter, _setter, isReadonly2) { + this._setter = _setter; + this._dirty = true; + this.__v_isRef = true; + this.effect = effect3(getter, { + lazy: true, + scheduler: () => { + if (!this._dirty) { + this._dirty = true; + trigger(toRaw2(this), "set", "value"); } - var order2 = orders[index]; - return result2 * (order2 == "desc" ? -1 : 1); } - } - return object.index - other.index; - } - function composeArgs(args, partials, holders, isCurried) { - var argsIndex = -1, argsLength = args.length, holdersLength = holders.length, leftIndex = -1, leftLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(leftLength + rangeLength), isUncurried = !isCurried; - while (++leftIndex < leftLength) { - result2[leftIndex] = partials[leftIndex]; - } - while (++argsIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result2[holders[argsIndex]] = args[argsIndex]; - } - } - while (rangeLength--) { - result2[leftIndex++] = args[argsIndex++]; - } - return result2; - } - function composeArgsRight(args, partials, holders, isCurried) { - var argsIndex = -1, argsLength = args.length, holdersIndex = -1, holdersLength = holders.length, rightIndex = -1, rightLength = partials.length, rangeLength = nativeMax(argsLength - holdersLength, 0), result2 = Array2(rangeLength + rightLength), isUncurried = !isCurried; - while (++argsIndex < rangeLength) { - result2[argsIndex] = args[argsIndex]; - } - var offset2 = argsIndex; - while (++rightIndex < rightLength) { - result2[offset2 + rightIndex] = partials[rightIndex]; - } - while (++holdersIndex < holdersLength) { - if (isUncurried || argsIndex < argsLength) { - result2[offset2 + holders[holdersIndex]] = args[argsIndex++]; - } - } - return result2; - } - function copyArray(source, array) { - var index = -1, length = source.length; - array || (array = Array2(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; - } - function copyObject(source, props, object, customizer) { - var isNew = !object; - object || (object = {}); - var index = -1, length = props.length; - while (++index < length) { - var key = props[index]; - var newValue = customizer ? customizer(object[key], source[key], key, object, source) : undefined2; - if (newValue === undefined2) { - newValue = source[key]; - } - if (isNew) { - baseAssignValue(object, key, newValue); - } else { - assignValue(object, key, newValue); - } - } - return object; - } - function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); - } - function copySymbolsIn(source, object) { - return copyObject(source, getSymbolsIn(source), object); - } - function createAggregator(setter, initializer) { - return function(collection, iteratee2) { - var func = isArray2(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; - return func(collection, setter, getIteratee(iteratee2, 2), accumulator); - }; - } - function createAssigner(assigner) { - return baseRest(function(object, sources) { - var index = -1, length = sources.length, customizer = length > 1 ? sources[length - 1] : undefined2, guard = length > 2 ? sources[2] : undefined2; - customizer = assigner.length > 3 && typeof customizer == "function" ? (length--, customizer) : undefined2; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - customizer = length < 3 ? undefined2 : customizer; - length = 1; - } - object = Object2(object); - while (++index < length) { - var source = sources[index]; - if (source) { - assigner(object, source, index, customizer); - } - } - return object; }); + this[ + "__v_isReadonly" + /* IS_READONLY */ + ] = isReadonly2; } - function createBaseEach(eachFunc, fromRight) { - return function(collection, iteratee2) { - if (collection == null) { - return collection; - } - if (!isArrayLike(collection)) { - return eachFunc(collection, iteratee2); - } - var length = collection.length, index = fromRight ? length : -1, iterable = Object2(collection); - while (fromRight ? index-- : ++index < length) { - if (iteratee2(iterable[index], index, iterable) === false) { - break; - } - } - return collection; - }; - } - function createBaseFor(fromRight) { - return function(object, iteratee2, keysFunc) { - var index = -1, iterable = Object2(object), props = keysFunc(object), length = props.length; - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee2(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; - } - function createBind(func, bitmask, thisArg) { - var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); - function wrapper() { - var fn3 = this && this !== root && this instanceof wrapper ? Ctor : func; - return fn3.apply(isBind ? thisArg : this, arguments); + get value() { + const self2 = toRaw2(this); + if (self2._dirty) { + self2._value = this.effect(); + self2._dirty = false; } - return wrapper; + track(self2, "get", "value"); + return self2._value; } - function createCaseFirst(methodName) { - return function(string) { - string = toString(string); - var strSymbols = hasUnicode(string) ? stringToArray(string) : undefined2; - var chr = strSymbols ? strSymbols[0] : string.charAt(0); - var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); - return chr[methodName]() + trailing; - }; + set value(newValue) { + this._setter(newValue); } - function createCompounder(callback) { - return function(string) { - return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); + }; + function computed(getterOrOptions) { + let getter; + let setter; + if (shared.isFunction(getterOrOptions)) { + getter = getterOrOptions; + setter = () => { + console.warn("Write operation failed: computed value is readonly"); }; + } else { + getter = getterOrOptions.get; + setter = getterOrOptions.set; } - function createCtor(Ctor) { - return function() { - var args = arguments; - switch (args.length) { - case 0: - return new Ctor(); - case 1: - return new Ctor(args[0]); - case 2: - return new Ctor(args[0], args[1]); - case 3: - return new Ctor(args[0], args[1], args[2]); - case 4: - return new Ctor(args[0], args[1], args[2], args[3]); - case 5: - return new Ctor(args[0], args[1], args[2], args[3], args[4]); - case 6: - return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5]); - case 7: - return new Ctor(args[0], args[1], args[2], args[3], args[4], args[5], args[6]); - } - var thisBinding = baseCreate(Ctor.prototype), result2 = Ctor.apply(thisBinding, args); - return isObject3(result2) ? result2 : thisBinding; - }; + return new ComputedRefImpl(getter, setter, shared.isFunction(getterOrOptions) || !getterOrOptions.set); + } + exports2.ITERATE_KEY = ITERATE_KEY; + exports2.computed = computed; + exports2.customRef = customRef; + exports2.effect = effect3; + exports2.enableTracking = enableTracking; + exports2.isProxy = isProxy; + exports2.isReactive = isReactive2; + exports2.isReadonly = isReadonly; + exports2.isRef = isRef; + exports2.markRaw = markRaw; + exports2.pauseTracking = pauseTracking; + exports2.proxyRefs = proxyRefs; + exports2.reactive = reactive3; + exports2.readonly = readonly; + exports2.ref = ref; + exports2.resetTracking = resetTracking; + exports2.shallowReactive = shallowReactive; + exports2.shallowReadonly = shallowReadonly; + exports2.shallowRef = shallowRef; + exports2.stop = stop2; + exports2.toRaw = toRaw2; + exports2.toRef = toRef; + exports2.toRefs = toRefs; + exports2.track = track; + exports2.trigger = trigger; + exports2.triggerRef = triggerRef; + exports2.unref = unref; + } + }); + var require_reactivity = __commonJS2({ + "node_modules/@vue/reactivity/index.js"(exports2, module2) { + "use strict"; + if (false) { + module2.exports = null; + } else { + module2.exports = require_reactivity_cjs(); + } + } + }); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default + }); + module.exports = __toCommonJS(module_exports); + var flushPending = false; + var flushing = false; + var queue = []; + var lastFlushedIndex = -1; + function scheduler(callback) { + queueJob(callback); + } + function queueJob(job) { + if (!queue.includes(job)) + queue.push(job); + queueFlush(); + } + function dequeueJob(job) { + let index = queue.indexOf(job); + if (index !== -1 && index > lastFlushedIndex) + queue.splice(index, 1); + } + function queueFlush() { + if (!flushing && !flushPending) { + flushPending = true; + queueMicrotask(flushJobs); + } + } + function flushJobs() { + flushPending = false; + flushing = true; + for (let i2 = 0; i2 < queue.length; i2++) { + queue[i2](); + lastFlushedIndex = i2; + } + queue.length = 0; + lastFlushedIndex = -1; + flushing = false; + } + var reactive; + var effect; + var release; + var raw; + var shouldSchedule = true; + function disableEffectScheduling(callback) { + shouldSchedule = false; + callback(); + shouldSchedule = true; + } + function setReactivityEngine(engine) { + reactive = engine.reactive; + release = engine.release; + effect = (callback) => engine.effect(callback, { scheduler: (task) => { + if (shouldSchedule) { + scheduler(task); + } else { + task(); + } + } }); + raw = engine.raw; + } + function overrideEffect(override) { + effect = override; + } + function elementBoundEffect(el) { + let cleanup = () => { + }; + let wrappedEffect = (callback) => { + let effectReference = effect(callback); + if (!el._x_effects) { + el._x_effects = /* @__PURE__ */ new Set(); + el._x_runEffects = () => { + el._x_effects.forEach((i2) => i2()); + }; + } + el._x_effects.add(effectReference); + cleanup = () => { + if (effectReference === void 0) + return; + el._x_effects.delete(effectReference); + release(effectReference); + }; + return effectReference; + }; + return [wrappedEffect, () => { + cleanup(); + }]; + } + function dispatch(el, name, detail = {}) { + el.dispatchEvent( + new CustomEvent(name, { + detail, + bubbles: true, + // Allows events to pass the shadow DOM barrier. + composed: true, + cancelable: true + }) + ); + } + function walk(el, callback) { + if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) { + Array.from(el.children).forEach((el2) => walk(el2, callback)); + return; + } + let skip = false; + callback(el, () => skip = true); + if (skip) + return; + let node = el.firstElementChild; + while (node) { + walk(node, callback, false); + node = node.nextElementSibling; + } + } + function warn(message, ...args) { + console.warn(`Alpine Warning: ${message}`, ...args); + } + var started = false; + function start() { + if (started) + warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."); + started = true; + if (!document.body) + warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"); + dispatch(document, "alpine:init"); + dispatch(document, "alpine:initializing"); + startObservingMutations(); + onElAdded((el) => initTree(el, walk)); + onElRemoved((el) => destroyTree(el)); + onAttributesAdded((el, attrs) => { + directives(el, attrs).forEach((handle) => handle()); + }); + let outNestedComponents = (el) => !closestRoot(el.parentElement, true); + Array.from(document.querySelectorAll(allSelectors().join(","))).filter(outNestedComponents).forEach((el) => { + initTree(el); + }); + dispatch(document, "alpine:initialized"); + } + var rootSelectorCallbacks = []; + var initSelectorCallbacks = []; + function rootSelectors() { + return rootSelectorCallbacks.map((fn) => fn()); + } + function allSelectors() { + return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn) => fn()); + } + function addRootSelector(selectorCallback) { + rootSelectorCallbacks.push(selectorCallback); + } + function addInitSelector(selectorCallback) { + initSelectorCallbacks.push(selectorCallback); + } + function closestRoot(el, includeInitSelectors = false) { + return findClosest(el, (element) => { + const selectors = includeInitSelectors ? allSelectors() : rootSelectors(); + if (selectors.some((selector) => element.matches(selector))) + return true; + }); + } + function findClosest(el, callback) { + if (!el) + return; + if (callback(el)) + return el; + if (el._x_teleportBack) + el = el._x_teleportBack; + if (!el.parentElement) + return; + return findClosest(el.parentElement, callback); + } + function isRoot(el) { + return rootSelectors().some((selector) => el.matches(selector)); + } + var initInterceptors = []; + function interceptInit(callback) { + initInterceptors.push(callback); + } + function initTree(el, walker = walk, intercept = () => { + }) { + deferHandlingDirectives(() => { + walker(el, (el2, skip) => { + intercept(el2, skip); + initInterceptors.forEach((i2) => i2(el2, skip)); + directives(el2, el2.attributes).forEach((handle) => handle()); + el2._x_ignore && skip(); + }); + }); + } + function destroyTree(root) { + walk(root, (el) => { + cleanupAttributes(el); + cleanupElement(el); + }); + } + var onAttributeAddeds = []; + var onElRemoveds = []; + var onElAddeds = []; + function onElAdded(callback) { + onElAddeds.push(callback); + } + function onElRemoved(el, callback) { + if (typeof callback === "function") { + if (!el._x_cleanups) + el._x_cleanups = []; + el._x_cleanups.push(callback); + } else { + callback = el; + onElRemoveds.push(callback); + } + } + function onAttributesAdded(callback) { + onAttributeAddeds.push(callback); + } + function onAttributeRemoved(el, name, callback) { + if (!el._x_attributeCleanups) + el._x_attributeCleanups = {}; + if (!el._x_attributeCleanups[name]) + el._x_attributeCleanups[name] = []; + el._x_attributeCleanups[name].push(callback); + } + function cleanupAttributes(el, names) { + if (!el._x_attributeCleanups) + return; + Object.entries(el._x_attributeCleanups).forEach(([name, value]) => { + if (names === void 0 || names.includes(name)) { + value.forEach((i2) => i2()); + delete el._x_attributeCleanups[name]; + } + }); + } + function cleanupElement(el) { + if (el._x_cleanups) { + while (el._x_cleanups.length) + el._x_cleanups.pop()(); + } + } + var observer = new MutationObserver(onMutate); + var currentlyObserving = false; + function startObservingMutations() { + observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true }); + currentlyObserving = true; + } + function stopObservingMutations() { + flushObserver(); + observer.disconnect(); + currentlyObserving = false; + } + var recordQueue = []; + var willProcessRecordQueue = false; + function flushObserver() { + recordQueue = recordQueue.concat(observer.takeRecords()); + if (recordQueue.length && !willProcessRecordQueue) { + willProcessRecordQueue = true; + queueMicrotask(() => { + processRecordQueue(); + willProcessRecordQueue = false; + }); + } + } + function processRecordQueue() { + onMutate(recordQueue); + recordQueue.length = 0; + } + function mutateDom(callback) { + if (!currentlyObserving) + return callback(); + stopObservingMutations(); + let result = callback(); + startObservingMutations(); + return result; + } + var isCollecting = false; + var deferredMutations = []; + function deferMutations() { + isCollecting = true; + } + function flushAndStopDeferringMutations() { + isCollecting = false; + onMutate(deferredMutations); + deferredMutations = []; + } + function onMutate(mutations) { + if (isCollecting) { + deferredMutations = deferredMutations.concat(mutations); + return; + } + let addedNodes = []; + let removedNodes = []; + let addedAttributes = /* @__PURE__ */ new Map(); + let removedAttributes = /* @__PURE__ */ new Map(); + for (let i2 = 0; i2 < mutations.length; i2++) { + if (mutations[i2].target._x_ignoreMutationObserver) + continue; + if (mutations[i2].type === "childList") { + mutations[i2].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node)); + mutations[i2].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node)); + } + if (mutations[i2].type === "attributes") { + let el = mutations[i2].target; + let name = mutations[i2].attributeName; + let oldValue = mutations[i2].oldValue; + let add = () => { + if (!addedAttributes.has(el)) + addedAttributes.set(el, []); + addedAttributes.get(el).push({ name, value: el.getAttribute(name) }); + }; + let remove = () => { + if (!removedAttributes.has(el)) + removedAttributes.set(el, []); + removedAttributes.get(el).push(name); + }; + if (el.hasAttribute(name) && oldValue === null) { + add(); + } else if (el.hasAttribute(name)) { + remove(); + add(); + } else { + remove(); } - function createCurry(func, bitmask, arity) { - var Ctor = createCtor(func); - function wrapper() { - var length = arguments.length, args = Array2(length), index = length, placeholder = getHolder(wrapper); - while (index--) { - args[index] = arguments[index]; - } - var holders = length < 3 && args[0] !== placeholder && args[length - 1] !== placeholder ? [] : replaceHolders(args, placeholder); - length -= holders.length; - if (length < arity) { - return createRecurry( - func, - bitmask, - createHybrid, - wrapper.placeholder, - undefined2, - args, - holders, - undefined2, - undefined2, - arity - length - ); - } - var fn3 = this && this !== root && this instanceof wrapper ? Ctor : func; - return apply(fn3, this, args); + } + } + removedAttributes.forEach((attrs, el) => { + cleanupAttributes(el, attrs); + }); + addedAttributes.forEach((attrs, el) => { + onAttributeAddeds.forEach((i2) => i2(el, attrs)); + }); + for (let node of removedNodes) { + if (addedNodes.includes(node)) + continue; + onElRemoveds.forEach((i2) => i2(node)); + destroyTree(node); + } + addedNodes.forEach((node) => { + node._x_ignoreSelf = true; + node._x_ignore = true; + }); + for (let node of addedNodes) { + if (removedNodes.includes(node)) + continue; + if (!node.isConnected) + continue; + delete node._x_ignoreSelf; + delete node._x_ignore; + onElAddeds.forEach((i2) => i2(node)); + node._x_ignore = true; + node._x_ignoreSelf = true; + } + addedNodes.forEach((node) => { + delete node._x_ignoreSelf; + delete node._x_ignore; + }); + addedNodes = null; + removedNodes = null; + addedAttributes = null; + removedAttributes = null; + } + function scope(node) { + return mergeProxies(closestDataStack(node)); + } + function addScopeToNode(node, data2, referenceNode) { + node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)]; + return () => { + node._x_dataStack = node._x_dataStack.filter((i2) => i2 !== data2); + }; + } + function closestDataStack(node) { + if (node._x_dataStack) + return node._x_dataStack; + if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) { + return closestDataStack(node.host); + } + if (!node.parentNode) { + return []; + } + return closestDataStack(node.parentNode); + } + function mergeProxies(objects) { + return new Proxy({ objects }, mergeProxyTrap); + } + var mergeProxyTrap = { + ownKeys({ objects }) { + return Array.from( + new Set(objects.flatMap((i2) => Object.keys(i2))) + ); + }, + has({ objects }, name) { + if (name == Symbol.unscopables) + return false; + return objects.some( + (obj) => Object.prototype.hasOwnProperty.call(obj, name) + ); + }, + get({ objects }, name, thisProxy) { + if (name == "toJSON") + return collapseProxies; + return Reflect.get( + objects.find( + (obj) => Object.prototype.hasOwnProperty.call(obj, name) + ) || {}, + name, + thisProxy + ); + }, + set({ objects }, name, value, thisProxy) { + const target = objects.find( + (obj) => Object.prototype.hasOwnProperty.call(obj, name) + ) || objects[objects.length - 1]; + const descriptor = Object.getOwnPropertyDescriptor(target, name); + if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get)) + return Reflect.set(target, name, value, thisProxy); + return Reflect.set(target, name, value); + } + }; + function collapseProxies() { + let keys = Reflect.ownKeys(this); + return keys.reduce((acc, key) => { + acc[key] = Reflect.get(this, key); + return acc; + }, {}); + } + function initInterceptors2(data2) { + let isObject2 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null; + let recurse = (obj, basePath = "") => { + Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => { + if (enumerable === false || value === void 0) + return; + let path = basePath === "" ? key : `${basePath}.${key}`; + if (typeof value === "object" && value !== null && value._x_interceptor) { + obj[key] = value.initialize(data2, path, key); + } else { + if (isObject2(value) && value !== obj && !(value instanceof Element)) { + recurse(value, path); } - return wrapper; } - function createFind(findIndexFunc) { - return function(collection, predicate, fromIndex) { - var iterable = Object2(collection); - if (!isArrayLike(collection)) { - var iteratee2 = getIteratee(predicate, 3); - collection = keys(collection); - predicate = function(key) { - return iteratee2(iterable[key], key, iterable); - }; - } - var index = findIndexFunc(collection, predicate, fromIndex); - return index > -1 ? iterable[iteratee2 ? collection[index] : index] : undefined2; - }; + }); + }; + return recurse(data2); + } + function interceptor(callback, mutateObj = () => { + }) { + let obj = { + initialValue: void 0, + _x_interceptor: true, + initialize(data2, path, key) { + return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key); + } + }; + mutateObj(obj); + return (initialValue) => { + if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) { + let initialize = obj.initialize.bind(obj); + obj.initialize = (data2, path, key) => { + let innerValue = initialValue.initialize(data2, path, key); + obj.initialValue = innerValue; + return initialize(data2, path, key); + }; + } else { + obj.initialValue = initialValue; + } + return obj; + }; + } + function get(obj, path) { + return path.split(".").reduce((carry, segment) => carry[segment], obj); + } + function set(obj, path, value) { + if (typeof path === "string") + path = path.split("."); + if (path.length === 1) + obj[path[0]] = value; + else if (path.length === 0) + throw error; + else { + if (obj[path[0]]) + return set(obj[path[0]], path.slice(1), value); + else { + obj[path[0]] = {}; + return set(obj[path[0]], path.slice(1), value); + } + } + } + var magics = {}; + function magic(name, callback) { + magics[name] = callback; + } + function injectMagics(obj, el) { + Object.entries(magics).forEach(([name, callback]) => { + let memoizedUtilities = null; + function getUtilities() { + if (memoizedUtilities) { + return memoizedUtilities; + } else { + let [utilities, cleanup] = getElementBoundUtilities(el); + memoizedUtilities = { interceptor, ...utilities }; + onElRemoved(el, cleanup); + return memoizedUtilities; } - function createFlow(fromRight) { - return flatRest(function(funcs) { - var length = funcs.length, index = length, prereq = LodashWrapper.prototype.thru; - if (fromRight) { - funcs.reverse(); - } - while (index--) { - var func = funcs[index]; - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); - } - if (prereq && !wrapper && getFuncName(func) == "wrapper") { - var wrapper = new LodashWrapper([], true); - } - } - index = wrapper ? index : length; - while (++index < length) { - func = funcs[index]; - var funcName = getFuncName(func), data2 = funcName == "wrapper" ? getData2(func) : undefined2; - if (data2 && isLaziable(data2[0]) && data2[1] == (WRAP_ARY_FLAG | WRAP_CURRY_FLAG | WRAP_PARTIAL_FLAG | WRAP_REARG_FLAG) && !data2[4].length && data2[9] == 1) { - wrapper = wrapper[getFuncName(data2[0])].apply(wrapper, data2[3]); - } else { - wrapper = func.length == 1 && isLaziable(func) ? wrapper[funcName]() : wrapper.thru(func); - } - } - return function() { - var args = arguments, value = args[0]; - if (wrapper && args.length == 1 && isArray2(value)) { - return wrapper.plant(value).value(); - } - var index2 = 0, result2 = length ? funcs[index2].apply(this, args) : value; - while (++index2 < length) { - result2 = funcs[index2].call(this, result2); - } - return result2; - }; - }); + } + Object.defineProperty(obj, `$${name}`, { + get() { + return callback(el, getUtilities()); + }, + enumerable: false + }); + }); + return obj; + } + function tryCatch(el, expression, callback, ...args) { + try { + return callback(...args); + } catch (e2) { + handleError(e2, el, expression); + } + } + function handleError(error2, el, expression = void 0) { + Object.assign(error2, { el, expression }); + console.warn(`Alpine Expression Error: ${error2.message} + +${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); + setTimeout(() => { + throw error2; + }, 0); + } + var shouldAutoEvaluateFunctions = true; + function dontAutoEvaluateFunctions(callback) { + let cache = shouldAutoEvaluateFunctions; + shouldAutoEvaluateFunctions = false; + let result = callback(); + shouldAutoEvaluateFunctions = cache; + return result; + } + function evaluate(el, expression, extras = {}) { + let result; + evaluateLater(el, expression)((value) => result = value, extras); + return result; + } + function evaluateLater(...args) { + return theEvaluatorFunction(...args); + } + var theEvaluatorFunction = normalEvaluator; + function setEvaluator(newEvaluator) { + theEvaluatorFunction = newEvaluator; + } + function normalEvaluator(el, expression) { + let overriddenMagics = {}; + injectMagics(overriddenMagics, el); + let dataStack = [overriddenMagics, ...closestDataStack(el)]; + let evaluator = typeof expression === "function" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el); + return tryCatch.bind(null, el, expression, evaluator); + } + function generateEvaluatorFromFunction(dataStack, func) { + return (receiver = () => { + }, { scope: scope2 = {}, params = [] } = {}) => { + let result = func.apply(mergeProxies([scope2, ...dataStack]), params); + runIfTypeOfFunction(receiver, result); + }; + } + var evaluatorMemo = {}; + function generateFunctionFromString(expression, el) { + if (evaluatorMemo[expression]) { + return evaluatorMemo[expression]; + } + let AsyncFunction = Object.getPrototypeOf(async function() { + }).constructor; + let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression.trim()) || /^(let|const)\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression; + const safeAsyncFunction = () => { + try { + let func2 = new AsyncFunction( + ["__self", "scope"], + `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;` + ); + Object.defineProperty(func2, "name", { + value: `[Alpine] ${expression}` + }); + return func2; + } catch (error2) { + handleError(error2, el, expression); + return Promise.resolve(); + } + }; + let func = safeAsyncFunction(); + evaluatorMemo[expression] = func; + return func; + } + function generateEvaluatorFromString(dataStack, expression, el) { + let func = generateFunctionFromString(expression, el); + return (receiver = () => { + }, { scope: scope2 = {}, params = [] } = {}) => { + func.result = void 0; + func.finished = false; + let completeScope = mergeProxies([scope2, ...dataStack]); + if (typeof func === "function") { + let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression)); + if (func.finished) { + runIfTypeOfFunction(receiver, func.result, completeScope, params, el); + func.result = void 0; + } else { + promise.then((result) => { + runIfTypeOfFunction(receiver, result, completeScope, params, el); + }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0); } - function createHybrid(func, bitmask, thisArg, partials, holders, partialsRight, holdersRight, argPos, ary2, arity) { - var isAry = bitmask & WRAP_ARY_FLAG, isBind = bitmask & WRAP_BIND_FLAG, isBindKey = bitmask & WRAP_BIND_KEY_FLAG, isCurried = bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG), isFlip = bitmask & WRAP_FLIP_FLAG, Ctor = isBindKey ? undefined2 : createCtor(func); - function wrapper() { - var length = arguments.length, args = Array2(length), index = length; - while (index--) { - args[index] = arguments[index]; - } - if (isCurried) { - var placeholder = getHolder(wrapper), holdersCount = countHolders(args, placeholder); - } - if (partials) { - args = composeArgs(args, partials, holders, isCurried); - } - if (partialsRight) { - args = composeArgsRight(args, partialsRight, holdersRight, isCurried); - } - length -= holdersCount; - if (isCurried && length < arity) { - var newHolders = replaceHolders(args, placeholder); - return createRecurry( - func, - bitmask, - createHybrid, - wrapper.placeholder, - thisArg, - args, - newHolders, - argPos, - ary2, - arity - length - ); - } - var thisBinding = isBind ? thisArg : this, fn3 = isBindKey ? thisBinding[func] : func; - length = args.length; - if (argPos) { - args = reorder(args, argPos); - } else if (isFlip && length > 1) { - args.reverse(); - } - if (isAry && ary2 < length) { - args.length = ary2; - } - if (this && this !== root && this instanceof wrapper) { - fn3 = Ctor || createCtor(fn3); - } - return fn3.apply(thisBinding, args); - } - return wrapper; + } + }; + } + function runIfTypeOfFunction(receiver, value, scope2, params, el) { + if (shouldAutoEvaluateFunctions && typeof value === "function") { + let result = value.apply(scope2, params); + if (result instanceof Promise) { + result.then((i2) => runIfTypeOfFunction(receiver, i2, scope2, params)).catch((error2) => handleError(error2, el, value)); + } else { + receiver(result); + } + } else if (typeof value === "object" && value instanceof Promise) { + value.then((i2) => receiver(i2)); + } else { + receiver(value); + } + } + var prefixAsString = "x-"; + function prefix(subject = "") { + return prefixAsString + subject; + } + function setPrefix(newPrefix) { + prefixAsString = newPrefix; + } + var directiveHandlers = {}; + function directive(name, callback) { + directiveHandlers[name] = callback; + return { + before(directive2) { + if (!directiveHandlers[directive2]) { + console.warn( + "Cannot find directive `${directive}`. `${name}` will use the default order of execution" + ); + return; } - function createInverter(setter, toIteratee) { - return function(object, iteratee2) { - return baseInverter(object, setter, toIteratee(iteratee2), {}); + const pos = directiveOrder.indexOf(directive2); + directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf("DEFAULT"), 0, name); + } + }; + } + function directives(el, attributes, originalAttributeOverride) { + attributes = Array.from(attributes); + if (el._x_virtualDirectives) { + let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value })); + let staticAttributes = attributesOnly(vAttributes); + vAttributes = vAttributes.map((attribute) => { + if (staticAttributes.find((attr) => attr.name === attribute.name)) { + return { + name: `x-bind:${attribute.name}`, + value: `"${attribute.value}"` }; } - function createMathOperation(operator, defaultValue) { - return function(value, other) { - var result2; - if (value === undefined2 && other === undefined2) { - return defaultValue; - } - if (value !== undefined2) { - result2 = value; - } - if (other !== undefined2) { - if (result2 === undefined2) { - return other; - } - if (typeof value == "string" || typeof other == "string") { - value = baseToString(value); - other = baseToString(other); - } else { - value = baseToNumber(value); - other = baseToNumber(other); - } - result2 = operator(value, other); - } - return result2; - }; + return attribute; + }); + attributes = attributes.concat(vAttributes); + } + let transformedAttributeMap = {}; + let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority); + return directives2.map((directive2) => { + return getDirectiveHandler(el, directive2); + }); + } + function attributesOnly(attributes) { + return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr)); + } + var isDeferringHandlers = false; + var directiveHandlerStacks = /* @__PURE__ */ new Map(); + var currentHandlerStackKey = Symbol(); + function deferHandlingDirectives(callback) { + isDeferringHandlers = true; + let key = Symbol(); + currentHandlerStackKey = key; + directiveHandlerStacks.set(key, []); + let flushHandlers = () => { + while (directiveHandlerStacks.get(key).length) + directiveHandlerStacks.get(key).shift()(); + directiveHandlerStacks.delete(key); + }; + let stopDeferring = () => { + isDeferringHandlers = false; + flushHandlers(); + }; + callback(flushHandlers); + stopDeferring(); + } + function getElementBoundUtilities(el) { + let cleanups = []; + let cleanup = (callback) => cleanups.push(callback); + let [effect3, cleanupEffect] = elementBoundEffect(el); + cleanups.push(cleanupEffect); + let utilities = { + Alpine: alpine_default2, + effect: effect3, + cleanup, + evaluateLater: evaluateLater.bind(evaluateLater, el), + evaluate: evaluate.bind(evaluate, el) + }; + let doCleanup = () => cleanups.forEach((i2) => i2()); + return [utilities, doCleanup]; + } + function getDirectiveHandler(el, directive2) { + let noop = () => { + }; + let handler4 = directiveHandlers[directive2.type] || noop; + let [utilities, cleanup] = getElementBoundUtilities(el); + onAttributeRemoved(el, directive2.original, cleanup); + let fullHandler = () => { + if (el._x_ignore || el._x_ignoreSelf) + return; + handler4.inline && handler4.inline(el, directive2, utilities); + handler4 = handler4.bind(handler4, el, directive2, utilities); + isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4(); + }; + fullHandler.runCleanups = cleanup; + return fullHandler; + } + var startingWith = (subject, replacement) => ({ name, value }) => { + if (name.startsWith(subject)) + name = name.replace(subject, replacement); + return { name, value }; + }; + var into = (i2) => i2; + function toTransformedAttributes(callback = () => { + }) { + return ({ name, value }) => { + let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => { + return transform(carry); + }, { name, value }); + if (newName !== name) + callback(newName, name); + return { name: newName, value: newValue }; + }; + } + var attributeTransformers = []; + function mapAttributes(callback) { + attributeTransformers.push(callback); + } + function outNonAlpineAttributes({ name }) { + return alpineAttributeRegex().test(name); + } + var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`); + function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) { + return ({ name, value }) => { + let typeMatch = name.match(alpineAttributeRegex()); + let valueMatch = name.match(/:([a-zA-Z0-9\-_:]+)/); + let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || []; + let original = originalAttributeOverride || transformedAttributeMap[name] || name; + return { + type: typeMatch ? typeMatch[1] : null, + value: valueMatch ? valueMatch[1] : null, + modifiers: modifiers.map((i2) => i2.replace(".", "")), + expression: value, + original + }; + }; + } + var DEFAULT = "DEFAULT"; + var directiveOrder = [ + "ignore", + "ref", + "data", + "id", + "anchor", + "bind", + "init", + "for", + "model", + "modelable", + "transition", + "show", + "if", + DEFAULT, + "teleport" + ]; + function byPriority(a2, b2) { + let typeA = directiveOrder.indexOf(a2.type) === -1 ? DEFAULT : a2.type; + let typeB = directiveOrder.indexOf(b2.type) === -1 ? DEFAULT : b2.type; + return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB); + } + var tickStack = []; + var isHolding = false; + function nextTick(callback = () => { + }) { + queueMicrotask(() => { + isHolding || setTimeout(() => { + releaseNextTicks(); + }); + }); + return new Promise((res) => { + tickStack.push(() => { + callback(); + res(); + }); + }); + } + function releaseNextTicks() { + isHolding = false; + while (tickStack.length) + tickStack.shift()(); + } + function holdNextTicks() { + isHolding = true; + } + function setClasses(el, value) { + if (Array.isArray(value)) { + return setClassesFromString(el, value.join(" ")); + } else if (typeof value === "object" && value !== null) { + return setClassesFromObject(el, value); + } else if (typeof value === "function") { + return setClasses(el, value()); + } + return setClassesFromString(el, value); + } + function setClassesFromString(el, classString) { + let split = (classString2) => classString2.split(" ").filter(Boolean); + let missingClasses = (classString2) => classString2.split(" ").filter((i2) => !el.classList.contains(i2)).filter(Boolean); + let addClassesAndReturnUndo = (classes) => { + el.classList.add(...classes); + return () => { + el.classList.remove(...classes); + }; + }; + classString = classString === true ? classString = "" : classString || ""; + return addClassesAndReturnUndo(missingClasses(classString)); + } + function setClassesFromObject(el, classObject) { + let split = (classString) => classString.split(" ").filter(Boolean); + let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean); + let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean); + let added = []; + let removed = []; + forRemove.forEach((i2) => { + if (el.classList.contains(i2)) { + el.classList.remove(i2); + removed.push(i2); + } + }); + forAdd.forEach((i2) => { + if (!el.classList.contains(i2)) { + el.classList.add(i2); + added.push(i2); + } + }); + return () => { + removed.forEach((i2) => el.classList.add(i2)); + added.forEach((i2) => el.classList.remove(i2)); + }; + } + function setStyles(el, value) { + if (typeof value === "object" && value !== null) { + return setStylesFromObject(el, value); + } + return setStylesFromString(el, value); + } + function setStylesFromObject(el, value) { + let previousStyles = {}; + Object.entries(value).forEach(([key, value2]) => { + previousStyles[key] = el.style[key]; + if (!key.startsWith("--")) { + key = kebabCase2(key); + } + el.style.setProperty(key, value2); + }); + setTimeout(() => { + if (el.style.length === 0) { + el.removeAttribute("style"); + } + }); + return () => { + setStyles(el, previousStyles); + }; + } + function setStylesFromString(el, value) { + let cache = el.getAttribute("style", value); + el.setAttribute("style", value); + return () => { + el.setAttribute("style", cache || ""); + }; + } + function kebabCase2(subject) { + return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); + } + function once(callback, fallback = () => { + }) { + let called = false; + return function() { + if (!called) { + called = true; + callback.apply(this, arguments); + } else { + fallback.apply(this, arguments); + } + }; + } + directive("transition", (el, { value, modifiers, expression }, { evaluate: evaluate2 }) => { + if (typeof expression === "function") + expression = evaluate2(expression); + if (expression === false) + return; + if (!expression || typeof expression === "boolean") { + registerTransitionsFromHelper(el, modifiers, value); + } else { + registerTransitionsFromClassString(el, expression, value); + } + }); + function registerTransitionsFromClassString(el, classString, stage) { + registerTransitionObject(el, setClasses, ""); + let directiveStorageMap = { + "enter": (classes) => { + el._x_transition.enter.during = classes; + }, + "enter-start": (classes) => { + el._x_transition.enter.start = classes; + }, + "enter-end": (classes) => { + el._x_transition.enter.end = classes; + }, + "leave": (classes) => { + el._x_transition.leave.during = classes; + }, + "leave-start": (classes) => { + el._x_transition.leave.start = classes; + }, + "leave-end": (classes) => { + el._x_transition.leave.end = classes; + } + }; + directiveStorageMap[stage](classString); + } + function registerTransitionsFromHelper(el, modifiers, stage) { + registerTransitionObject(el, setStyles); + let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage; + let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage); + let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage); + if (modifiers.includes("in") && !doesntSpecify) { + modifiers = modifiers.filter((i2, index) => index < modifiers.indexOf("out")); + } + if (modifiers.includes("out") && !doesntSpecify) { + modifiers = modifiers.filter((i2, index) => index > modifiers.indexOf("out")); + } + let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale"); + let wantsOpacity = wantsAll || modifiers.includes("opacity"); + let wantsScale = wantsAll || modifiers.includes("scale"); + let opacityValue = wantsOpacity ? 0 : 1; + let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1; + let delay = modifierValue(modifiers, "delay", 0) / 1e3; + let origin = modifierValue(modifiers, "origin", "center"); + let property = "opacity, transform"; + let durationIn = modifierValue(modifiers, "duration", 150) / 1e3; + let durationOut = modifierValue(modifiers, "duration", 75) / 1e3; + let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`; + if (transitioningIn) { + el._x_transition.enter.during = { + transformOrigin: origin, + transitionDelay: `${delay}s`, + transitionProperty: property, + transitionDuration: `${durationIn}s`, + transitionTimingFunction: easing + }; + el._x_transition.enter.start = { + opacity: opacityValue, + transform: `scale(${scaleValue})` + }; + el._x_transition.enter.end = { + opacity: 1, + transform: `scale(1)` + }; + } + if (transitioningOut) { + el._x_transition.leave.during = { + transformOrigin: origin, + transitionDelay: `${delay}s`, + transitionProperty: property, + transitionDuration: `${durationOut}s`, + transitionTimingFunction: easing + }; + el._x_transition.leave.start = { + opacity: 1, + transform: `scale(1)` + }; + el._x_transition.leave.end = { + opacity: opacityValue, + transform: `scale(${scaleValue})` + }; + } + } + function registerTransitionObject(el, setFunction, defaultValue = {}) { + if (!el._x_transition) + el._x_transition = { + enter: { during: defaultValue, start: defaultValue, end: defaultValue }, + leave: { during: defaultValue, start: defaultValue, end: defaultValue }, + in(before = () => { + }, after = () => { + }) { + transition(el, setFunction, { + during: this.enter.during, + start: this.enter.start, + end: this.enter.end + }, before, after); + }, + out(before = () => { + }, after = () => { + }) { + transition(el, setFunction, { + during: this.leave.during, + start: this.leave.start, + end: this.leave.end + }, before, after); } - function createOver(arrayFunc) { - return flatRest(function(iteratees) { - iteratees = arrayMap(iteratees, baseUnary(getIteratee())); - return baseRest(function(args) { - var thisArg = this; - return arrayFunc(iteratees, function(iteratee2) { - return apply(iteratee2, thisArg, args); - }); - }); + }; + } + window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide) { + const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout; + let clickAwayCompatibleShow = () => nextTick2(show); + if (value) { + if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) { + el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow(); + } else { + el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow(); + } + return; + } + el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => { + el._x_transition.out(() => { + }, () => resolve(hide)); + el._x_transitioning && el._x_transitioning.beforeCancel(() => reject({ isFromCancelledTransition: true })); + }) : Promise.resolve(hide); + queueMicrotask(() => { + let closest = closestHide(el); + if (closest) { + if (!closest._x_hideChildren) + closest._x_hideChildren = []; + closest._x_hideChildren.push(el); + } else { + nextTick2(() => { + let hideAfterChildren = (el2) => { + let carry = Promise.all([ + el2._x_hidePromise, + ...(el2._x_hideChildren || []).map(hideAfterChildren) + ]).then(([i2]) => i2()); + delete el2._x_hidePromise; + delete el2._x_hideChildren; + return carry; + }; + hideAfterChildren(el).catch((e2) => { + if (!e2.isFromCancelledTransition) + throw e2; }); + }); + } + }); + }; + function closestHide(el) { + let parent = el.parentNode; + if (!parent) + return; + return parent._x_hidePromise ? parent : closestHide(parent); + } + function transition(el, setFunction, { during, start: start2, end } = {}, before = () => { + }, after = () => { + }) { + if (el._x_transitioning) + el._x_transitioning.cancel(); + if (Object.keys(during).length === 0 && Object.keys(start2).length === 0 && Object.keys(end).length === 0) { + before(); + after(); + return; + } + let undoStart, undoDuring, undoEnd; + performTransition(el, { + start() { + undoStart = setFunction(el, start2); + }, + during() { + undoDuring = setFunction(el, during); + }, + before, + end() { + undoStart(); + undoEnd = setFunction(el, end); + }, + after, + cleanup() { + undoDuring(); + undoEnd(); + } + }); + } + function performTransition(el, stages) { + let interrupted, reachedBefore, reachedEnd; + let finish = once(() => { + mutateDom(() => { + interrupted = true; + if (!reachedBefore) + stages.before(); + if (!reachedEnd) { + stages.end(); + releaseNextTicks(); } - function createPadding(length, chars) { - chars = chars === undefined2 ? " " : baseToString(chars); - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result2 = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return hasUnicode(chars) ? castSlice(stringToArray(result2), 0, length).join("") : result2.slice(0, length); + stages.after(); + if (el.isConnected) + stages.cleanup(); + delete el._x_transitioning; + }); + }); + el._x_transitioning = { + beforeCancels: [], + beforeCancel(callback) { + this.beforeCancels.push(callback); + }, + cancel: once(function() { + while (this.beforeCancels.length) { + this.beforeCancels.shift()(); } - function createPartial(func, bitmask, thisArg, partials) { - var isBind = bitmask & WRAP_BIND_FLAG, Ctor = createCtor(func); - function wrapper() { - var argsIndex = -1, argsLength = arguments.length, leftIndex = -1, leftLength = partials.length, args = Array2(leftLength + argsLength), fn3 = this && this !== root && this instanceof wrapper ? Ctor : func; - while (++leftIndex < leftLength) { - args[leftIndex] = partials[leftIndex]; - } - while (argsLength--) { - args[leftIndex++] = arguments[++argsIndex]; - } - return apply(fn3, isBind ? thisArg : this, args); - } - return wrapper; + ; + finish(); + }), + finish + }; + mutateDom(() => { + stages.start(); + stages.during(); + }); + holdNextTicks(); + requestAnimationFrame(() => { + if (interrupted) + return; + let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3; + let delay = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3; + if (duration === 0) + duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3; + mutateDom(() => { + stages.before(); + }); + reachedBefore = true; + requestAnimationFrame(() => { + if (interrupted) + return; + mutateDom(() => { + stages.end(); + }); + releaseNextTicks(); + setTimeout(el._x_transitioning.finish, duration + delay); + reachedEnd = true; + }); + }); + } + function modifierValue(modifiers, key, fallback) { + if (modifiers.indexOf(key) === -1) + return fallback; + const rawValue = modifiers[modifiers.indexOf(key) + 1]; + if (!rawValue) + return fallback; + if (key === "scale") { + if (isNaN(rawValue)) + return fallback; + } + if (key === "duration" || key === "delay") { + let match = rawValue.match(/([0-9]+)ms/); + if (match) + return match[1]; + } + if (key === "origin") { + if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) { + return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" "); + } + } + return rawValue; + } + var isCloning = false; + function skipDuringClone(callback, fallback = () => { + }) { + return (...args) => isCloning ? fallback(...args) : callback(...args); + } + function onlyDuringClone(callback) { + return (...args) => isCloning && callback(...args); + } + var interceptors = []; + function interceptClone(callback) { + interceptors.push(callback); + } + function cloneNode(from, to) { + interceptors.forEach((i2) => i2(from, to)); + isCloning = true; + dontRegisterReactiveSideEffects(() => { + initTree(to, (el, callback) => { + callback(el, () => { + }); + }); + }); + isCloning = false; + } + var isCloningLegacy = false; + function clone(oldEl, newEl) { + if (!newEl._x_dataStack) + newEl._x_dataStack = oldEl._x_dataStack; + isCloning = true; + isCloningLegacy = true; + dontRegisterReactiveSideEffects(() => { + cloneTree(newEl); + }); + isCloning = false; + isCloningLegacy = false; + } + function cloneTree(el) { + let hasRunThroughFirstEl = false; + let shallowWalker = (el2, callback) => { + walk(el2, (el3, skip) => { + if (hasRunThroughFirstEl && isRoot(el3)) + return skip(); + hasRunThroughFirstEl = true; + callback(el3, skip); + }); + }; + initTree(el, shallowWalker); + } + function dontRegisterReactiveSideEffects(callback) { + let cache = effect; + overrideEffect((callback2, el) => { + let storedEffect = cache(callback2); + release(storedEffect); + return () => { + }; + }); + callback(); + overrideEffect(cache); + } + function bind(el, name, value, modifiers = []) { + if (!el._x_bindings) + el._x_bindings = reactive({}); + el._x_bindings[name] = value; + name = modifiers.includes("camel") ? camelCase2(name) : name; + switch (name) { + case "value": + bindInputValue(el, value); + break; + case "style": + bindStyles(el, value); + break; + case "class": + bindClasses(el, value); + break; + case "selected": + case "checked": + bindAttributeAndProperty(el, name, value); + break; + default: + bindAttribute(el, name, value); + break; + } + } + function bindInputValue(el, value) { + if (el.type === "radio") { + if (el.attributes.value === void 0) { + el.value = value; + } + if (window.fromModel) { + if (typeof value === "boolean") { + el.checked = safeParseBoolean(el.value) === value; + } else { + el.checked = checkedAttrLooseCompare(el.value, value); } - function createRange(fromRight) { - return function(start3, end2, step) { - if (step && typeof step != "number" && isIterateeCall(start3, end2, step)) { - end2 = step = undefined2; - } - start3 = toFinite(start3); - if (end2 === undefined2) { - end2 = start3; - start3 = 0; - } else { - end2 = toFinite(end2); - } - step = step === undefined2 ? start3 < end2 ? 1 : -1 : toFinite(step); - return baseRange(start3, end2, step, fromRight); - }; + } + } else if (el.type === "checkbox") { + if (Number.isInteger(value)) { + el.value = value; + } else if (!Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) { + el.value = String(value); + } else { + if (Array.isArray(value)) { + el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value)); + } else { + el.checked = !!value; } - function createRelationalOperation(operator) { - return function(value, other) { - if (!(typeof value == "string" && typeof other == "string")) { - value = toNumber(value); - other = toNumber(other); - } - return operator(value, other); - }; + } + } else if (el.tagName === "SELECT") { + updateSelect(el, value); + } else { + if (el.value === value) + return; + el.value = value === void 0 ? "" : value; + } + } + function bindClasses(el, value) { + if (el._x_undoAddedClasses) + el._x_undoAddedClasses(); + el._x_undoAddedClasses = setClasses(el, value); + } + function bindStyles(el, value) { + if (el._x_undoAddedStyles) + el._x_undoAddedStyles(); + el._x_undoAddedStyles = setStyles(el, value); + } + function bindAttributeAndProperty(el, name, value) { + bindAttribute(el, name, value); + setPropertyIfChanged(el, name, value); + } + function bindAttribute(el, name, value) { + if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) { + el.removeAttribute(name); + } else { + if (isBooleanAttr(name)) + value = name; + setIfChanged(el, name, value); + } + } + function setIfChanged(el, attrName, value) { + if (el.getAttribute(attrName) != value) { + el.setAttribute(attrName, value); + } + } + function setPropertyIfChanged(el, propName, value) { + if (el[propName] !== value) { + el[propName] = value; + } + } + function updateSelect(el, value) { + const arrayWrappedValue = [].concat(value).map((value2) => { + return value2 + ""; + }); + Array.from(el.options).forEach((option) => { + option.selected = arrayWrappedValue.includes(option.value); + }); + } + function camelCase2(subject) { + return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase()); + } + function checkedAttrLooseCompare(valueA, valueB) { + return valueA == valueB; + } + function safeParseBoolean(rawValue) { + if ([1, "1", "true", "on", "yes", true].includes(rawValue)) { + return true; + } + if ([0, "0", "false", "off", "no", false].includes(rawValue)) { + return false; + } + return rawValue ? Boolean(rawValue) : null; + } + function isBooleanAttr(attrName) { + const booleanAttributes = [ + "disabled", + "checked", + "required", + "readonly", + "hidden", + "open", + "selected", + "autofocus", + "itemscope", + "multiple", + "novalidate", + "allowfullscreen", + "allowpaymentrequest", + "formnovalidate", + "autoplay", + "controls", + "loop", + "muted", + "playsinline", + "default", + "ismap", + "reversed", + "async", + "defer", + "nomodule" + ]; + return booleanAttributes.includes(attrName); + } + function attributeShouldntBePreservedIfFalsy(name) { + return !["aria-pressed", "aria-checked", "aria-expanded", "aria-selected"].includes(name); + } + function getBinding(el, name, fallback) { + if (el._x_bindings && el._x_bindings[name] !== void 0) + return el._x_bindings[name]; + return getAttributeBinding(el, name, fallback); + } + function extractProp(el, name, fallback, extract = true) { + if (el._x_bindings && el._x_bindings[name] !== void 0) + return el._x_bindings[name]; + if (el._x_inlineBindings && el._x_inlineBindings[name] !== void 0) { + let binding = el._x_inlineBindings[name]; + binding.extract = extract; + return dontAutoEvaluateFunctions(() => { + return evaluate(el, binding.expression); + }); + } + return getAttributeBinding(el, name, fallback); + } + function getAttributeBinding(el, name, fallback) { + let attr = el.getAttribute(name); + if (attr === null) + return typeof fallback === "function" ? fallback() : fallback; + if (attr === "") + return true; + if (isBooleanAttr(name)) { + return !![name, "true"].includes(attr); + } + return attr; + } + function debounce(func, wait) { + var timeout; + return function() { + var context = this, args = arguments; + var later = function() { + timeout = null; + func.apply(context, args); + }; + clearTimeout(timeout); + timeout = setTimeout(later, wait); + }; + } + function throttle(func, limit) { + let inThrottle; + return function() { + let context = this, args = arguments; + if (!inThrottle) { + func.apply(context, args); + inThrottle = true; + setTimeout(() => inThrottle = false, limit); + } + }; + } + function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) { + let firstRun = true; + let outerHash; + let reference = effect(() => { + const outer = outerGet(); + const inner = innerGet(); + if (firstRun) { + innerSet(cloneIfObject(outer)); + firstRun = false; + outerHash = JSON.stringify(outer); + } else { + const outerHashLatest = JSON.stringify(outer); + if (outerHashLatest !== outerHash) { + innerSet(cloneIfObject(outer)); + outerHash = outerHashLatest; + } else { + outerSet(cloneIfObject(inner)); + outerHash = JSON.stringify(inner); } - function createRecurry(func, bitmask, wrapFunc, placeholder, thisArg, partials, holders, argPos, ary2, arity) { - var isCurry = bitmask & WRAP_CURRY_FLAG, newHolders = isCurry ? holders : undefined2, newHoldersRight = isCurry ? undefined2 : holders, newPartials = isCurry ? partials : undefined2, newPartialsRight = isCurry ? undefined2 : partials; - bitmask |= isCurry ? WRAP_PARTIAL_FLAG : WRAP_PARTIAL_RIGHT_FLAG; - bitmask &= ~(isCurry ? WRAP_PARTIAL_RIGHT_FLAG : WRAP_PARTIAL_FLAG); - if (!(bitmask & WRAP_CURRY_BOUND_FLAG)) { - bitmask &= ~(WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG); - } - var newData = [ - func, - bitmask, - thisArg, - newPartials, - newHolders, - newPartialsRight, - newHoldersRight, - argPos, - ary2, - arity - ]; - var result2 = wrapFunc.apply(undefined2, newData); - if (isLaziable(func)) { - setData2(result2, newData); - } - result2.placeholder = placeholder; - return setWrapToString(result2, func, bitmask); - } - function createRound(methodName) { - var func = Math2[methodName]; - return function(number, precision) { - number = toNumber(number); - precision = precision == null ? 0 : nativeMin(toInteger(precision), 292); - if (precision && nativeIsFinite(number)) { - var pair = (toString(number) + "e").split("e"), value = func(pair[0] + "e" + (+pair[1] + precision)); - pair = (toString(value) + "e").split("e"); - return +(pair[0] + "e" + (+pair[1] - precision)); - } - return func(number); + } + JSON.stringify(innerGet()); + JSON.stringify(outerGet()); + }); + return () => { + release(reference); + }; + } + function cloneIfObject(value) { + return typeof value === "object" ? JSON.parse(JSON.stringify(value)) : value; + } + function plugin(callback) { + let callbacks = Array.isArray(callback) ? callback : [callback]; + callbacks.forEach((i2) => i2(alpine_default2)); + } + var stores = {}; + var isReactive = false; + function store(name, value) { + if (!isReactive) { + stores = reactive(stores); + isReactive = true; + } + if (value === void 0) { + return stores[name]; + } + stores[name] = value; + if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") { + stores[name].init(); + } + initInterceptors2(stores[name]); + } + function getStores() { + return stores; + } + var binds = {}; + function bind2(name, bindings) { + let getBindings = typeof bindings !== "function" ? () => bindings : bindings; + if (name instanceof Element) { + return applyBindingsObject(name, getBindings()); + } else { + binds[name] = getBindings; + } + return () => { + }; + } + function injectBindingProviders(obj) { + Object.entries(binds).forEach(([name, callback]) => { + Object.defineProperty(obj, name, { + get() { + return (...args) => { + return callback(...args); }; } - var createSet = !(Set2 && 1 / setToArray(new Set2([, -0]))[1] == INFINITY) ? noop : function(values2) { - return new Set2(values2); + }); + }); + return obj; + } + function applyBindingsObject(el, obj, original) { + let cleanupRunners = []; + while (cleanupRunners.length) + cleanupRunners.pop()(); + let attributes = Object.entries(obj).map(([name, value]) => ({ name, value })); + let staticAttributes = attributesOnly(attributes); + attributes = attributes.map((attribute) => { + if (staticAttributes.find((attr) => attr.name === attribute.name)) { + return { + name: `x-bind:${attribute.name}`, + value: `"${attribute.value}"` }; - function createToPairs(keysFunc) { - return function(object) { - var tag = getTag(object); - if (tag == mapTag) { - return mapToArray(object); - } - if (tag == setTag) { - return setToPairs(object); - } - return baseToPairs(object, keysFunc(object)); + } + return attribute; + }); + directives(el, attributes, original).map((handle) => { + cleanupRunners.push(handle.runCleanups); + handle(); + }); + return () => { + while (cleanupRunners.length) + cleanupRunners.pop()(); + }; + } + var datas = {}; + function data(name, callback) { + datas[name] = callback; + } + function injectDataProviders(obj, context) { + Object.entries(datas).forEach(([name, callback]) => { + Object.defineProperty(obj, name, { + get() { + return (...args) => { + return callback.bind(context)(...args); }; - } - function createWrap(func, bitmask, thisArg, partials, holders, argPos, ary2, arity) { - var isBindKey = bitmask & WRAP_BIND_KEY_FLAG; - if (!isBindKey && typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + }, + enumerable: false + }); + }); + return obj; + } + var Alpine3 = { + get reactive() { + return reactive; + }, + get release() { + return release; + }, + get effect() { + return effect; + }, + get raw() { + return raw; + }, + version: "3.13.3", + flushAndStopDeferringMutations, + dontAutoEvaluateFunctions, + disableEffectScheduling, + startObservingMutations, + stopObservingMutations, + setReactivityEngine, + onAttributeRemoved, + onAttributesAdded, + closestDataStack, + skipDuringClone, + onlyDuringClone, + addRootSelector, + addInitSelector, + interceptClone, + addScopeToNode, + deferMutations, + mapAttributes, + evaluateLater, + interceptInit, + setEvaluator, + mergeProxies, + extractProp, + findClosest, + onElRemoved, + closestRoot, + destroyTree, + interceptor, + // INTERNAL: not public API and is subject to change without major release. + transition, + // INTERNAL + setStyles, + // INTERNAL + mutateDom, + directive, + entangle, + throttle, + debounce, + evaluate, + initTree, + nextTick, + prefixed: prefix, + prefix: setPrefix, + plugin, + magic, + store, + start, + clone, + // INTERNAL + cloneNode, + // INTERNAL + bound: getBinding, + $data: scope, + walk, + data, + bind: bind2 + }; + var alpine_default2 = Alpine3; + var import_reactivity9 = __toESM2(require_reactivity()); + magic("nextTick", () => nextTick); + magic("dispatch", (el) => dispatch.bind(dispatch, el)); + magic("watch", (el, { evaluateLater: evaluateLater2, effect: effect3 }) => (key, callback) => { + let evaluate2 = evaluateLater2(key); + let firstTime = true; + let oldValue; + let effectReference = effect3(() => evaluate2((value) => { + JSON.stringify(value); + if (!firstTime) { + queueMicrotask(() => { + callback(value, oldValue); + oldValue = value; + }); + } else { + oldValue = value; + } + firstTime = false; + })); + el._x_effects.delete(effectReference); + }); + magic("store", getStores); + magic("data", (el) => scope(el)); + magic("root", (el) => closestRoot(el)); + magic("refs", (el) => { + if (el._x_refs_proxy) + return el._x_refs_proxy; + el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el)); + return el._x_refs_proxy; + }); + function getArrayOfRefObject(el) { + let refObjects = []; + let currentEl = el; + while (currentEl) { + if (currentEl._x_refs) + refObjects.push(currentEl._x_refs); + currentEl = currentEl.parentNode; + } + return refObjects; + } + var globalIdMemo = {}; + function findAndIncrementId(name) { + if (!globalIdMemo[name]) + globalIdMemo[name] = 0; + return ++globalIdMemo[name]; + } + function closestIdRoot(el, name) { + return findClosest(el, (element) => { + if (element._x_ids && element._x_ids[name]) + return true; + }); + } + function setIdRoot(el, name) { + if (!el._x_ids) + el._x_ids = {}; + if (!el._x_ids[name]) + el._x_ids[name] = findAndIncrementId(name); + } + magic("id", (el) => (name, key = null) => { + let root = closestIdRoot(el, name); + let id = root ? root._x_ids[name] : findAndIncrementId(name); + return key ? `${name}-${id}-${key}` : `${name}-${id}`; + }); + magic("el", (el) => el); + warnMissingPluginMagic("Focus", "focus", "focus"); + warnMissingPluginMagic("Persist", "persist", "persist"); + function warnMissingPluginMagic(name, magicName, slug) { + magic(magicName, (el) => warn(`You can't use [$${magicName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); + } + directive("modelable", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2, cleanup }) => { + let func = evaluateLater2(expression); + let innerGet = () => { + let result; + func((i2) => result = i2); + return result; + }; + let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`); + let innerSet = (val) => evaluateInnerSet(() => { + }, { scope: { "__placeholder": val } }); + let initialValue = innerGet(); + innerSet(initialValue); + queueMicrotask(() => { + if (!el._x_model) + return; + el._x_removeModelListeners["default"](); + let outerGet = el._x_model.get; + let outerSet = el._x_model.set; + let releaseEntanglement = entangle( + { + get() { + return outerGet(); + }, + set(value) { + outerSet(value); } - var length = partials ? partials.length : 0; - if (!length) { - bitmask &= ~(WRAP_PARTIAL_FLAG | WRAP_PARTIAL_RIGHT_FLAG); - partials = holders = undefined2; + }, + { + get() { + return innerGet(); + }, + set(value) { + innerSet(value); } - ary2 = ary2 === undefined2 ? ary2 : nativeMax(toInteger(ary2), 0); - arity = arity === undefined2 ? arity : toInteger(arity); - length -= holders ? holders.length : 0; - if (bitmask & WRAP_PARTIAL_RIGHT_FLAG) { - var partialsRight = partials, holdersRight = holders; - partials = holders = undefined2; - } - var data2 = isBindKey ? undefined2 : getData2(func); - var newData = [ - func, - bitmask, - thisArg, - partials, - holders, - partialsRight, - holdersRight, - argPos, - ary2, - arity - ]; - if (data2) { - mergeData(newData, data2); - } - func = newData[0]; - bitmask = newData[1]; - thisArg = newData[2]; - partials = newData[3]; - holders = newData[4]; - arity = newData[9] = newData[9] === undefined2 ? isBindKey ? 0 : func.length : nativeMax(newData[9] - length, 0); - if (!arity && bitmask & (WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG)) { - bitmask &= ~(WRAP_CURRY_FLAG | WRAP_CURRY_RIGHT_FLAG); - } - if (!bitmask || bitmask == WRAP_BIND_FLAG) { - var result2 = createBind(func, bitmask, thisArg); - } else if (bitmask == WRAP_CURRY_FLAG || bitmask == WRAP_CURRY_RIGHT_FLAG) { - result2 = createCurry(func, bitmask, arity); - } else if ((bitmask == WRAP_PARTIAL_FLAG || bitmask == (WRAP_BIND_FLAG | WRAP_PARTIAL_FLAG)) && !holders.length) { - result2 = createPartial(func, bitmask, thisArg, partials); - } else { - result2 = createHybrid.apply(undefined2, newData); - } - var setter = data2 ? baseSetData : setData2; - return setWrapToString(setter(result2, newData), func, bitmask); } - function customDefaultsAssignIn(objValue, srcValue, key, object) { - if (objValue === undefined2 || eq(objValue, objectProto[key]) && !hasOwnProperty3.call(object, key)) { - return srcValue; - } - return objValue; + ); + cleanup(releaseEntanglement); + }); + }); + directive("teleport", (el, { modifiers, expression }, { cleanup }) => { + if (el.tagName.toLowerCase() !== "template") + warn("x-teleport can only be used on a <template> tag", el); + let target = getTarget(expression); + let clone2 = el.content.cloneNode(true).firstElementChild; + el._x_teleport = clone2; + clone2._x_teleportBack = el; + el.setAttribute("data-teleport-template", true); + clone2.setAttribute("data-teleport-target", true); + if (el._x_forwardEvents) { + el._x_forwardEvents.forEach((eventName) => { + clone2.addEventListener(eventName, (e2) => { + e2.stopPropagation(); + el.dispatchEvent(new e2.constructor(e2.type, e2)); + }); + }); + } + addScopeToNode(clone2, {}, el); + let placeInDom = (clone3, target2, modifiers2) => { + if (modifiers2.includes("prepend")) { + target2.parentNode.insertBefore(clone3, target2); + } else if (modifiers2.includes("append")) { + target2.parentNode.insertBefore(clone3, target2.nextSibling); + } else { + target2.appendChild(clone3); + } + }; + mutateDom(() => { + placeInDom(clone2, target, modifiers); + initTree(clone2); + clone2._x_ignore = true; + }); + el._x_teleportPutBack = () => { + let target2 = getTarget(expression); + mutateDom(() => { + placeInDom(el._x_teleport, target2, modifiers); + }); + }; + cleanup(() => clone2.remove()); + }); + var teleportContainerDuringClone = document.createElement("div"); + function getTarget(expression) { + let target = skipDuringClone(() => { + return document.querySelector(expression); + }, () => { + return teleportContainerDuringClone; + })(); + if (!target) + warn(`Cannot find x-teleport element for selector: "${expression}"`); + return target; + } + var handler = () => { + }; + handler.inline = (el, { modifiers }, { cleanup }) => { + modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true; + cleanup(() => { + modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore; + }); + }; + directive("ignore", handler); + directive("effect", skipDuringClone((el, { expression }, { effect: effect3 }) => { + effect3(evaluateLater(el, expression)); + })); + function on(el, event, modifiers, callback) { + let listenerTarget = el; + let handler4 = (e2) => callback(e2); + let options = {}; + let wrapHandler = (callback2, wrapper) => (e2) => wrapper(callback2, e2); + if (modifiers.includes("dot")) + event = dotSyntax(event); + if (modifiers.includes("camel")) + event = camelCase22(event); + if (modifiers.includes("passive")) + options.passive = true; + if (modifiers.includes("capture")) + options.capture = true; + if (modifiers.includes("window")) + listenerTarget = window; + if (modifiers.includes("document")) + listenerTarget = document; + if (modifiers.includes("debounce")) { + let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait"; + let wait = isNumeric2(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; + handler4 = debounce(handler4, wait); + } + if (modifiers.includes("throttle")) { + let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait"; + let wait = isNumeric2(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; + handler4 = throttle(handler4, wait); + } + if (modifiers.includes("prevent")) + handler4 = wrapHandler(handler4, (next, e2) => { + e2.preventDefault(); + next(e2); + }); + if (modifiers.includes("stop")) + handler4 = wrapHandler(handler4, (next, e2) => { + e2.stopPropagation(); + next(e2); + }); + if (modifiers.includes("self")) + handler4 = wrapHandler(handler4, (next, e2) => { + e2.target === el && next(e2); + }); + if (modifiers.includes("away") || modifiers.includes("outside")) { + listenerTarget = document; + handler4 = wrapHandler(handler4, (next, e2) => { + if (el.contains(e2.target)) + return; + if (e2.target.isConnected === false) + return; + if (el.offsetWidth < 1 && el.offsetHeight < 1) + return; + if (el._x_isShown === false) + return; + next(e2); + }); + } + if (modifiers.includes("once")) { + handler4 = wrapHandler(handler4, (next, e2) => { + next(e2); + listenerTarget.removeEventListener(event, handler4, options); + }); + } + handler4 = wrapHandler(handler4, (next, e2) => { + if (isKeyEvent(event)) { + if (isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers)) { + return; } - function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { - if (isObject3(objValue) && isObject3(srcValue)) { - stack.set(srcValue, objValue); - baseMerge(objValue, srcValue, undefined2, customDefaultsMerge, stack); - stack["delete"](srcValue); + } + next(e2); + }); + listenerTarget.addEventListener(event, handler4, options); + return () => { + listenerTarget.removeEventListener(event, handler4, options); + }; + } + function dotSyntax(subject) { + return subject.replace(/-/g, "."); + } + function camelCase22(subject) { + return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase()); + } + function isNumeric2(subject) { + return !Array.isArray(subject) && !isNaN(subject); + } + function kebabCase22(subject) { + if ([" ", "_"].includes( + subject + )) + return subject; + return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase(); + } + function isKeyEvent(event) { + return ["keydown", "keyup"].includes(event); + } + function isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers) { + let keyModifiers = modifiers.filter((i2) => { + return !["window", "document", "prevent", "stop", "once", "capture"].includes(i2); + }); + if (keyModifiers.includes("debounce")) { + let debounceIndex = keyModifiers.indexOf("debounce"); + keyModifiers.splice(debounceIndex, isNumeric2((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); + } + if (keyModifiers.includes("throttle")) { + let debounceIndex = keyModifiers.indexOf("throttle"); + keyModifiers.splice(debounceIndex, isNumeric2((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); + } + if (keyModifiers.length === 0) + return false; + if (keyModifiers.length === 1 && keyToModifiers(e2.key).includes(keyModifiers[0])) + return false; + const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"]; + const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier)); + keyModifiers = keyModifiers.filter((i2) => !selectedSystemKeyModifiers.includes(i2)); + if (selectedSystemKeyModifiers.length > 0) { + const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => { + if (modifier === "cmd" || modifier === "super") + modifier = "meta"; + return e2[`${modifier}Key`]; + }); + if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) { + if (keyToModifiers(e2.key).includes(keyModifiers[0])) + return false; + } + } + return true; + } + function keyToModifiers(key) { + if (!key) + return []; + key = kebabCase22(key); + let modifierToKeyMap = { + "ctrl": "control", + "slash": "/", + "space": " ", + "spacebar": " ", + "cmd": "meta", + "esc": "escape", + "up": "arrow-up", + "down": "arrow-down", + "left": "arrow-left", + "right": "arrow-right", + "period": ".", + "equal": "=", + "minus": "-", + "underscore": "_" + }; + modifierToKeyMap[key] = key; + return Object.keys(modifierToKeyMap).map((modifier) => { + if (modifierToKeyMap[modifier] === key) + return modifier; + }).filter((modifier) => modifier); + } + directive("model", (el, { modifiers, expression }, { effect: effect3, cleanup }) => { + let scopeTarget = el; + if (modifiers.includes("parent")) { + scopeTarget = el.parentNode; + } + let evaluateGet = evaluateLater(scopeTarget, expression); + let evaluateSet; + if (typeof expression === "string") { + evaluateSet = evaluateLater(scopeTarget, `${expression} = __placeholder`); + } else if (typeof expression === "function" && typeof expression() === "string") { + evaluateSet = evaluateLater(scopeTarget, `${expression()} = __placeholder`); + } else { + evaluateSet = () => { + }; + } + let getValue = () => { + let result; + evaluateGet((value) => result = value); + return isGetterSetter(result) ? result.get() : result; + }; + let setValue = (value) => { + let result; + evaluateGet((value2) => result = value2); + if (isGetterSetter(result)) { + result.set(value); + } else { + evaluateSet(() => { + }, { + scope: { "__placeholder": value } + }); + } + }; + if (typeof expression === "string" && el.type === "radio") { + mutateDom(() => { + if (!el.hasAttribute("name")) + el.setAttribute("name", expression); + }); + } + var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input"; + let removeListener = isCloning ? () => { + } : on(el, event, modifiers, (e2) => { + setValue(getInputValue(el, modifiers, e2, getValue())); + }); + if (modifiers.includes("fill")) { + if ([null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) { + el.dispatchEvent(new Event(event, {})); + } + } + if (!el._x_removeModelListeners) + el._x_removeModelListeners = {}; + el._x_removeModelListeners["default"] = removeListener; + cleanup(() => el._x_removeModelListeners["default"]()); + if (el.form) { + let removeResetListener = on(el.form, "reset", [], (e2) => { + nextTick(() => el._x_model && el._x_model.set(el.value)); + }); + cleanup(() => removeResetListener()); + } + el._x_model = { + get() { + return getValue(); + }, + set(value) { + setValue(value); + } + }; + el._x_forceModelUpdate = (value) => { + if (value === void 0 && typeof expression === "string" && expression.match(/\./)) + value = ""; + window.fromModel = true; + mutateDom(() => bind(el, "value", value)); + delete window.fromModel; + }; + effect3(() => { + let value = getValue(); + if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el)) + return; + el._x_forceModelUpdate(value); + }); + }); + function getInputValue(el, modifiers, event, currentValue) { + return mutateDom(() => { + if (event instanceof CustomEvent && event.detail !== void 0) + return event.detail !== null && event.detail !== void 0 ? event.detail : event.target.value; + else if (el.type === "checkbox") { + if (Array.isArray(currentValue)) { + let newValue = null; + if (modifiers.includes("number")) { + newValue = safeParseNumber(event.target.value); + } else if (modifiers.includes("boolean")) { + newValue = safeParseBoolean(event.target.value); + } else { + newValue = event.target.value; } - return objValue; + return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue)); + } else { + return event.target.checked; } - function customOmitClone(value) { - return isPlainObject(value) ? undefined2 : value; + } else if (el.tagName.toLowerCase() === "select" && el.multiple) { + if (modifiers.includes("number")) { + return Array.from(event.target.selectedOptions).map((option) => { + let rawValue = option.value || option.text; + return safeParseNumber(rawValue); + }); + } else if (modifiers.includes("boolean")) { + return Array.from(event.target.selectedOptions).map((option) => { + let rawValue = option.value || option.text; + return safeParseBoolean(rawValue); + }); } - function equalArrays(array, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, arrLength = array.length, othLength = other.length; - if (arrLength != othLength && !(isPartial && othLength > arrLength)) { - return false; - } - var arrStacked = stack.get(array); - var othStacked = stack.get(other); - if (arrStacked && othStacked) { - return arrStacked == other && othStacked == array; - } - var index = -1, result2 = true, seen = bitmask & COMPARE_UNORDERED_FLAG ? new SetCache() : undefined2; - stack.set(array, other); - stack.set(other, array); - while (++index < arrLength) { - var arrValue = array[index], othValue = other[index]; - if (customizer) { - var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); - } - if (compared !== undefined2) { - if (compared) { - continue; - } - result2 = false; - break; - } - if (seen) { - if (!arraySome(other, function(othValue2, othIndex) { - if (!cacheHas(seen, othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, bitmask, customizer, stack))) { - return seen.push(othIndex); - } - })) { - result2 = false; - break; - } - } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) { - result2 = false; - break; - } - } - stack["delete"](array); - stack["delete"](other); - return result2; + return Array.from(event.target.selectedOptions).map((option) => { + return option.value || option.text; + }); + } else { + if (modifiers.includes("number")) { + return safeParseNumber(event.target.value); + } else if (modifiers.includes("boolean")) { + return safeParseBoolean(event.target.value); } - function equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) { - switch (tag) { - case dataViewTag: - if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { - return false; - } - object = object.buffer; - other = other.buffer; - case arrayBufferTag: - if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { - return false; - } - return true; - case boolTag: - case dateTag: - case numberTag: - return eq(+object, +other); - case errorTag: - return object.name == other.name && object.message == other.message; - case regexpTag: - case stringTag: - return object == other + ""; - case mapTag: - var convert = mapToArray; - case setTag: - var isPartial = bitmask & COMPARE_PARTIAL_FLAG; - convert || (convert = setToArray); - if (object.size != other.size && !isPartial) { - return false; - } - var stacked = stack.get(object); - if (stacked) { - return stacked == other; - } - bitmask |= COMPARE_UNORDERED_FLAG; - stack.set(object, other); - var result2 = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack); - stack["delete"](object); - return result2; - case symbolTag: - if (symbolValueOf) { - return symbolValueOf.call(object) == symbolValueOf.call(other); - } + return modifiers.includes("trim") ? event.target.value.trim() : event.target.value; + } + }); + } + function safeParseNumber(rawValue) { + let number = rawValue ? parseFloat(rawValue) : null; + return isNumeric22(number) ? number : rawValue; + } + function checkedAttrLooseCompare2(valueA, valueB) { + return valueA == valueB; + } + function isNumeric22(subject) { + return !Array.isArray(subject) && !isNaN(subject); + } + function isGetterSetter(value) { + return value !== null && typeof value === "object" && typeof value.get === "function" && typeof value.set === "function"; + } + directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak"))))); + addInitSelector(() => `[${prefix("init")}]`); + directive("init", skipDuringClone((el, { expression }, { evaluate: evaluate2 }) => { + if (typeof expression === "string") { + return !!expression.trim() && evaluate2(expression, {}, false); + } + return evaluate2(expression, {}, false); + })); + directive("text", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => { + let evaluate2 = evaluateLater2(expression); + effect3(() => { + evaluate2((value) => { + mutateDom(() => { + el.textContent = value; + }); + }); + }); + }); + directive("html", (el, { expression }, { effect: effect3, evaluateLater: evaluateLater2 }) => { + let evaluate2 = evaluateLater2(expression); + effect3(() => { + evaluate2((value) => { + mutateDom(() => { + el.innerHTML = value; + el._x_ignoreSelf = true; + initTree(el); + delete el._x_ignoreSelf; + }); + }); + }); + }); + mapAttributes(startingWith(":", into(prefix("bind:")))); + var handler2 = (el, { value, modifiers, expression, original }, { effect: effect3 }) => { + if (!value) { + let bindingProviders = {}; + injectBindingProviders(bindingProviders); + let getBindings = evaluateLater(el, expression); + getBindings((bindings) => { + applyBindingsObject(el, bindings, original); + }, { scope: bindingProviders }); + return; + } + if (value === "key") + return storeKeyForXFor(el, expression); + if (el._x_inlineBindings && el._x_inlineBindings[value] && el._x_inlineBindings[value].extract) { + return; + } + let evaluate2 = evaluateLater(el, expression); + effect3(() => evaluate2((result) => { + if (result === void 0 && typeof expression === "string" && expression.match(/\./)) { + result = ""; + } + mutateDom(() => bind(el, value, result, modifiers)); + })); + }; + handler2.inline = (el, { value, modifiers, expression }) => { + if (!value) + return; + if (!el._x_inlineBindings) + el._x_inlineBindings = {}; + el._x_inlineBindings[value] = { expression, extract: false }; + }; + directive("bind", handler2); + function storeKeyForXFor(el, expression) { + el._x_keyExpression = expression; + } + addRootSelector(() => `[${prefix("data")}]`); + directive("data", (el, { expression }, { cleanup }) => { + if (shouldSkipRegisteringDataDuringClone(el)) + return; + expression = expression === "" ? "{}" : expression; + let magicContext = {}; + injectMagics(magicContext, el); + let dataProviderContext = {}; + injectDataProviders(dataProviderContext, magicContext); + let data2 = evaluate(el, expression, { scope: dataProviderContext }); + if (data2 === void 0 || data2 === true) + data2 = {}; + injectMagics(data2, el); + let reactiveData = reactive(data2); + initInterceptors2(reactiveData); + let undo = addScopeToNode(el, reactiveData); + reactiveData["init"] && evaluate(el, reactiveData["init"]); + cleanup(() => { + reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]); + undo(); + }); + }); + interceptClone((from, to) => { + if (from._x_dataStack) { + to._x_dataStack = from._x_dataStack; + to.setAttribute("data-has-alpine-state", true); + } + }); + function shouldSkipRegisteringDataDuringClone(el) { + if (!isCloning) + return false; + if (isCloningLegacy) + return true; + return el.hasAttribute("data-has-alpine-state"); + } + directive("show", (el, { modifiers, expression }, { effect: effect3 }) => { + let evaluate2 = evaluateLater(el, expression); + if (!el._x_doHide) + el._x_doHide = () => { + mutateDom(() => { + el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0); + }); + }; + if (!el._x_doShow) + el._x_doShow = () => { + mutateDom(() => { + if (el.style.length === 1 && el.style.display === "none") { + el.removeAttribute("style"); + } else { + el.style.removeProperty("display"); } - return false; + }); + }; + let hide = () => { + el._x_doHide(); + el._x_isShown = false; + }; + let show = () => { + el._x_doShow(); + el._x_isShown = true; + }; + let clickAwayCompatibleShow = () => setTimeout(show); + let toggle = once( + (value) => value ? show() : hide(), + (value) => { + if (typeof el._x_toggleAndCascadeWithTransitions === "function") { + el._x_toggleAndCascadeWithTransitions(el, value, show, hide); + } else { + value ? clickAwayCompatibleShow() : hide(); } - function equalObjects(object, other, bitmask, customizer, equalFunc, stack) { - var isPartial = bitmask & COMPARE_PARTIAL_FLAG, objProps = getAllKeys(object), objLength = objProps.length, othProps = getAllKeys(other), othLength = othProps.length; - if (objLength != othLength && !isPartial) { - return false; - } - var index = objLength; - while (index--) { - var key = objProps[index]; - if (!(isPartial ? key in other : hasOwnProperty3.call(other, key))) { - return false; - } - } - var objStacked = stack.get(object); - var othStacked = stack.get(other); - if (objStacked && othStacked) { - return objStacked == other && othStacked == object; - } - var result2 = true; - stack.set(object, other); - stack.set(other, object); - var skipCtor = isPartial; - while (++index < objLength) { - key = objProps[index]; - var objValue = object[key], othValue = other[key]; - if (customizer) { - var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); - } - if (!(compared === undefined2 ? objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack) : compared)) { - result2 = false; - break; - } - skipCtor || (skipCtor = key == "constructor"); - } - if (result2 && !skipCtor) { - var objCtor = object.constructor, othCtor = other.constructor; - if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { - result2 = false; - } - } - stack["delete"](object); - stack["delete"](other); - return result2; + } + ); + let oldValue; + let firstTime = true; + effect3(() => evaluate2((value) => { + if (!firstTime && value === oldValue) + return; + if (modifiers.includes("immediate")) + value ? clickAwayCompatibleShow() : hide(); + toggle(value); + oldValue = value; + firstTime = false; + })); + }); + directive("for", (el, { expression }, { effect: effect3, cleanup }) => { + let iteratorNames = parseForExpression(expression); + let evaluateItems = evaluateLater(el, iteratorNames.items); + let evaluateKey = evaluateLater( + el, + // the x-bind:key expression is stored for our use instead of evaluated. + el._x_keyExpression || "index" + ); + el._x_prevKeys = []; + el._x_lookup = {}; + effect3(() => loop(el, iteratorNames, evaluateItems, evaluateKey)); + cleanup(() => { + Object.values(el._x_lookup).forEach((el2) => el2.remove()); + delete el._x_prevKeys; + delete el._x_lookup; + }); + }); + function loop(el, iteratorNames, evaluateItems, evaluateKey) { + let isObject2 = (i2) => typeof i2 === "object" && !Array.isArray(i2); + let templateEl = el; + evaluateItems((items) => { + if (isNumeric3(items) && items >= 0) { + items = Array.from(Array(items).keys(), (i2) => i2 + 1); + } + if (items === void 0) + items = []; + let lookup = el._x_lookup; + let prevKeys = el._x_prevKeys; + let scopes = []; + let keys = []; + if (isObject2(items)) { + items = Object.entries(items).map(([key, value]) => { + let scope2 = getIterationScopeVariables(iteratorNames, value, key, items); + evaluateKey((value2) => keys.push(value2), { scope: { index: key, ...scope2 } }); + scopes.push(scope2); + }); + } else { + for (let i2 = 0; i2 < items.length; i2++) { + let scope2 = getIterationScopeVariables(iteratorNames, items[i2], i2, items); + evaluateKey((value) => keys.push(value), { scope: { index: i2, ...scope2 } }); + scopes.push(scope2); } - function flatRest(func) { - return setToString(overRest(func, undefined2, flatten), func + ""); + } + let adds = []; + let moves = []; + let removes = []; + let sames = []; + for (let i2 = 0; i2 < prevKeys.length; i2++) { + let key = prevKeys[i2]; + if (keys.indexOf(key) === -1) + removes.push(key); + } + prevKeys = prevKeys.filter((key) => !removes.includes(key)); + let lastKey = "template"; + for (let i2 = 0; i2 < keys.length; i2++) { + let key = keys[i2]; + let prevIndex = prevKeys.indexOf(key); + if (prevIndex === -1) { + prevKeys.splice(i2, 0, key); + adds.push([lastKey, i2]); + } else if (prevIndex !== i2) { + let keyInSpot = prevKeys.splice(i2, 1)[0]; + let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0]; + prevKeys.splice(i2, 0, keyForSpot); + prevKeys.splice(prevIndex, 0, keyInSpot); + moves.push([keyInSpot, keyForSpot]); + } else { + sames.push(key); } - function getAllKeys(object) { - return baseGetAllKeys(object, keys, getSymbols); + lastKey = key; + } + for (let i2 = 0; i2 < removes.length; i2++) { + let key = removes[i2]; + if (!!lookup[key]._x_effects) { + lookup[key]._x_effects.forEach(dequeueJob); } - function getAllKeysIn(object) { - return baseGetAllKeys(object, keysIn, getSymbolsIn); - } - var getData2 = !metaMap ? noop : function(func) { - return metaMap.get(func); + lookup[key].remove(); + lookup[key] = null; + delete lookup[key]; + } + for (let i2 = 0; i2 < moves.length; i2++) { + let [keyInSpot, keyForSpot] = moves[i2]; + let elInSpot = lookup[keyInSpot]; + let elForSpot = lookup[keyForSpot]; + let marker = document.createElement("div"); + mutateDom(() => { + if (!elForSpot) + warn(`x-for ":key" is undefined or invalid`, templateEl); + elForSpot.after(marker); + elInSpot.after(elForSpot); + elForSpot._x_currentIfEl && elForSpot.after(elForSpot._x_currentIfEl); + marker.before(elInSpot); + elInSpot._x_currentIfEl && elInSpot.after(elInSpot._x_currentIfEl); + marker.remove(); + }); + elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)]); + } + for (let i2 = 0; i2 < adds.length; i2++) { + let [lastKey2, index] = adds[i2]; + let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2]; + if (lastEl._x_currentIfEl) + lastEl = lastEl._x_currentIfEl; + let scope2 = scopes[index]; + let key = keys[index]; + let clone2 = document.importNode(templateEl.content, true).firstElementChild; + let reactiveScope = reactive(scope2); + addScopeToNode(clone2, reactiveScope, templateEl); + clone2._x_refreshXForScope = (newScope) => { + Object.entries(newScope).forEach(([key2, value]) => { + reactiveScope[key2] = value; + }); }; - function getFuncName(func) { - var result2 = func.name + "", array = realNames[result2], length = hasOwnProperty3.call(realNames, result2) ? array.length : 0; - while (length--) { - var data2 = array[length], otherFunc = data2.func; - if (otherFunc == null || otherFunc == func) { - return data2.name; - } - } - return result2; + mutateDom(() => { + lastEl.after(clone2); + initTree(clone2); + }); + if (typeof key === "object") { + warn("x-for key cannot be an object, it must be a string or an integer", templateEl); } - function getHolder(func) { - var object = hasOwnProperty3.call(lodash, "placeholder") ? lodash : func; - return object.placeholder; - } - function getIteratee() { - var result2 = lodash.iteratee || iteratee; - result2 = result2 === iteratee ? baseIteratee : result2; - return arguments.length ? result2(arguments[0], arguments[1]) : result2; - } - function getMapData(map2, key) { - var data2 = map2.__data__; - return isKeyable(key) ? data2[typeof key == "string" ? "string" : "hash"] : data2.map; - } - function getMatchData(object) { - var result2 = keys(object), length = result2.length; - while (length--) { - var key = result2[length], value = object[key]; - result2[length] = [key, value, isStrictComparable(value)]; + lookup[key] = clone2; + } + for (let i2 = 0; i2 < sames.length; i2++) { + lookup[sames[i2]]._x_refreshXForScope(scopes[keys.indexOf(sames[i2])]); + } + templateEl._x_prevKeys = keys; + }); + } + function parseForExpression(expression) { + let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; + let stripParensRE = /^\s*\(|\)\s*$/g; + let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; + let inMatch = expression.match(forAliasRE); + if (!inMatch) + return; + let res = {}; + res.items = inMatch[2].trim(); + let item = inMatch[1].replace(stripParensRE, "").trim(); + let iteratorMatch = item.match(forIteratorRE); + if (iteratorMatch) { + res.item = item.replace(forIteratorRE, "").trim(); + res.index = iteratorMatch[1].trim(); + if (iteratorMatch[2]) { + res.collection = iteratorMatch[2].trim(); + } + } else { + res.item = item; + } + return res; + } + function getIterationScopeVariables(iteratorNames, item, index, items) { + let scopeVariables = {}; + if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) { + let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i2) => i2.trim()); + names.forEach((name, i2) => { + scopeVariables[name] = item[i2]; + }); + } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") { + let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i2) => i2.trim()); + names.forEach((name) => { + scopeVariables[name] = item[name]; + }); + } else { + scopeVariables[iteratorNames.item] = item; + } + if (iteratorNames.index) + scopeVariables[iteratorNames.index] = index; + if (iteratorNames.collection) + scopeVariables[iteratorNames.collection] = items; + return scopeVariables; + } + function isNumeric3(subject) { + return !Array.isArray(subject) && !isNaN(subject); + } + function handler3() { + } + handler3.inline = (el, { expression }, { cleanup }) => { + let root = closestRoot(el); + if (!root._x_refs) + root._x_refs = {}; + root._x_refs[expression] = el; + cleanup(() => delete root._x_refs[expression]); + }; + directive("ref", handler3); + directive("if", (el, { expression }, { effect: effect3, cleanup }) => { + if (el.tagName.toLowerCase() !== "template") + warn("x-if can only be used on a <template> tag", el); + let evaluate2 = evaluateLater(el, expression); + let show = () => { + if (el._x_currentIfEl) + return el._x_currentIfEl; + let clone2 = el.content.cloneNode(true).firstElementChild; + addScopeToNode(clone2, {}, el); + mutateDom(() => { + el.after(clone2); + initTree(clone2); + }); + el._x_currentIfEl = clone2; + el._x_undoIf = () => { + walk(clone2, (node) => { + if (!!node._x_effects) { + node._x_effects.forEach(dequeueJob); } - return result2; + }); + clone2.remove(); + delete el._x_currentIfEl; + }; + return clone2; + }; + let hide = () => { + if (!el._x_undoIf) + return; + el._x_undoIf(); + delete el._x_undoIf; + }; + effect3(() => evaluate2((value) => { + value ? show() : hide(); + })); + cleanup(() => el._x_undoIf && el._x_undoIf()); + }); + directive("id", (el, { expression }, { evaluate: evaluate2 }) => { + let names = evaluate2(expression); + names.forEach((name) => setIdRoot(el, name)); + }); + mapAttributes(startingWith("@", into(prefix("on:")))); + directive("on", skipDuringClone((el, { value, modifiers, expression }, { cleanup }) => { + let evaluate2 = expression ? evaluateLater(el, expression) : () => { + }; + if (el.tagName.toLowerCase() === "template") { + if (!el._x_forwardEvents) + el._x_forwardEvents = []; + if (!el._x_forwardEvents.includes(value)) + el._x_forwardEvents.push(value); + } + let removeListener = on(el, value, modifiers, (e2) => { + evaluate2(() => { + }, { scope: { "$event": e2 }, params: [e2] }); + }); + cleanup(() => removeListener()); + })); + warnMissingPluginDirective("Collapse", "collapse", "collapse"); + warnMissingPluginDirective("Intersect", "intersect", "intersect"); + warnMissingPluginDirective("Focus", "trap", "focus"); + warnMissingPluginDirective("Mask", "mask", "mask"); + function warnMissingPluginDirective(name, directiveName, slug) { + directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); + } + alpine_default2.setEvaluator(normalEvaluator); + alpine_default2.setReactivityEngine({ reactive: import_reactivity9.reactive, effect: import_reactivity9.effect, release: import_reactivity9.stop, raw: import_reactivity9.toRaw }); + var src_default = alpine_default2; + var module_default = src_default; + } +}); + +// ../../../node_modules/@alpinejs/morph/dist/module.cjs.js +var require_module_cjs2 = __commonJS({ + "../../../node_modules/@alpinejs/morph/dist/module.cjs.js"(exports, module) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default, + morph: () => morph2 + }); + module.exports = __toCommonJS(module_exports); + function morph2(from, toHtml, options) { + monkeyPatchDomSetAttributeToAllowAtSymbols(); + let fromEl; + let toEl; + let key, lookahead, updating, updated, removing, removed, adding, added; + function assignOptions(options2 = {}) { + let defaultGetKey = (el) => el.getAttribute("key"); + let noop = () => { + }; + updating = options2.updating || noop; + updated = options2.updated || noop; + removing = options2.removing || noop; + removed = options2.removed || noop; + adding = options2.adding || noop; + added = options2.added || noop; + key = options2.key || defaultGetKey; + lookahead = options2.lookahead || false; + } + function patch(from2, to) { + if (differentElementNamesTypesOrKeys(from2, to)) { + return swapElements(from2, to); + } + let updateChildrenOnly = false; + if (shouldSkip(updating, from2, to, () => updateChildrenOnly = true)) + return; + if (from2.nodeType === 1 && window.Alpine) { + window.Alpine.cloneNode(from2, to); + } + if (textOrComment(to)) { + patchNodeValue(from2, to); + updated(from2, to); + return; + } + if (!updateChildrenOnly) { + patchAttributes(from2, to); + } + updated(from2, to); + patchChildren(from2, to); + } + function differentElementNamesTypesOrKeys(from2, to) { + return from2.nodeType != to.nodeType || from2.nodeName != to.nodeName || getKey(from2) != getKey(to); + } + function swapElements(from2, to) { + if (shouldSkip(removing, from2)) + return; + let toCloned = to.cloneNode(true); + if (shouldSkip(adding, toCloned)) + return; + from2.replaceWith(toCloned); + removed(from2); + added(toCloned); + } + function patchNodeValue(from2, to) { + let value = to.nodeValue; + if (from2.nodeValue !== value) { + from2.nodeValue = value; + } + } + function patchAttributes(from2, to) { + if (from2._x_transitioning) + return; + if (from2._x_isShown && !to._x_isShown) { + return; + } + if (!from2._x_isShown && to._x_isShown) { + return; + } + let domAttributes = Array.from(from2.attributes); + let toAttributes = Array.from(to.attributes); + for (let i2 = domAttributes.length - 1; i2 >= 0; i2--) { + let name = domAttributes[i2].name; + if (!to.hasAttribute(name)) { + from2.removeAttribute(name); } - function getNative(object, key) { - var value = getValue(object, key); - return baseIsNative(value) ? value : undefined2; + } + for (let i2 = toAttributes.length - 1; i2 >= 0; i2--) { + let name = toAttributes[i2].name; + let value = toAttributes[i2].value; + if (from2.getAttribute(name) !== value) { + from2.setAttribute(name, value); } - function getRawTag(value) { - var isOwn = hasOwnProperty3.call(value, symToStringTag), tag = value[symToStringTag]; - try { - value[symToStringTag] = undefined2; - var unmasked = true; - } catch (e3) { - } - var result2 = nativeObjectToString.call(value); - if (unmasked) { - if (isOwn) { - value[symToStringTag] = tag; - } else { - delete value[symToStringTag]; + } + } + function patchChildren(from2, to) { + if (from2._x_teleport) + from2 = from2._x_teleport; + if (to._x_teleport) + to = to._x_teleport; + let fromKeys = keyToMap(from2.children); + let fromKeyHoldovers = {}; + let currentTo = getFirstNode(to); + let currentFrom = getFirstNode(from2); + while (currentTo) { + seedingMatchingId(currentTo, currentFrom); + let toKey = getKey(currentTo); + let fromKey = getKey(currentFrom); + if (!currentFrom) { + if (toKey && fromKeyHoldovers[toKey]) { + let holdover = fromKeyHoldovers[toKey]; + from2.appendChild(holdover); + currentFrom = holdover; + } else { + if (!shouldSkip(adding, currentTo)) { + let clone = currentTo.cloneNode(true); + from2.appendChild(clone); + added(clone); } + currentTo = getNextSibling(to, currentTo); + continue; } - return result2; } - var getSymbols = !nativeGetSymbols ? stubArray : function(object) { - if (object == null) { - return []; - } - object = Object2(object); - return arrayFilter(nativeGetSymbols(object), function(symbol) { - return propertyIsEnumerable.call(object, symbol); - }); - }; - var getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) { - var result2 = []; - while (object) { - arrayPush(result2, getSymbols(object)); - object = getPrototype(object); - } - return result2; - }; - var getTag = baseGetTag; - if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { - getTag = function(value) { - var result2 = baseGetTag(value), Ctor = result2 == objectTag ? value.constructor : undefined2, ctorString = Ctor ? toSource(Ctor) : ""; - if (ctorString) { - switch (ctorString) { - case dataViewCtorString: - return dataViewTag; - case mapCtorString: - return mapTag; - case promiseCtorString: - return promiseTag; - case setCtorString: - return setTag; - case weakMapCtorString: - return weakMapTag; - } + let isIf = (node) => node && node.nodeType === 8 && node.textContent === "[if BLOCK]><![endif]"; + let isEnd = (node) => node && node.nodeType === 8 && node.textContent === "[if ENDBLOCK]><![endif]"; + if (isIf(currentTo) && isIf(currentFrom)) { + let nestedIfCount = 0; + let fromBlockStart = currentFrom; + while (currentFrom) { + let next = getNextSibling(from2, currentFrom); + if (isIf(next)) { + nestedIfCount++; + } else if (isEnd(next) && nestedIfCount > 0) { + nestedIfCount--; + } else if (isEnd(next) && nestedIfCount === 0) { + currentFrom = next; + break; } - return result2; - }; - } - function getView(start3, end2, transforms) { - var index = -1, length = transforms.length; - while (++index < length) { - var data2 = transforms[index], size3 = data2.size; - switch (data2.type) { - case "drop": - start3 += size3; - break; - case "dropRight": - end2 -= size3; - break; - case "take": - end2 = nativeMin(end2, start3 + size3); - break; - case "takeRight": - start3 = nativeMax(start3, end2 - size3); - break; - } + currentFrom = next; } - return { "start": start3, "end": end2 }; - } - function getWrapDetails(source) { - var match = source.match(reWrapDetails); - return match ? match[1].split(reSplitDetails) : []; - } - function hasPath(object, path, hasFunc) { - path = castPath(path, object); - var index = -1, length = path.length, result2 = false; - while (++index < length) { - var key = toKey(path[index]); - if (!(result2 = object != null && hasFunc(object, key))) { + let fromBlockEnd = currentFrom; + nestedIfCount = 0; + let toBlockStart = currentTo; + while (currentTo) { + let next = getNextSibling(to, currentTo); + if (isIf(next)) { + nestedIfCount++; + } else if (isEnd(next) && nestedIfCount > 0) { + nestedIfCount--; + } else if (isEnd(next) && nestedIfCount === 0) { + currentTo = next; break; } - object = object[key]; + currentTo = next; } - if (result2 || ++index != length) { - return result2; - } - length = object == null ? 0 : object.length; - return !!length && isLength(length) && isIndex(key, length) && (isArray2(object) || isArguments(object)); + let toBlockEnd = currentTo; + let fromBlock = new Block(fromBlockStart, fromBlockEnd); + let toBlock = new Block(toBlockStart, toBlockEnd); + patchChildren(fromBlock, toBlock); + continue; } - function initCloneArray(array) { - var length = array.length, result2 = new array.constructor(length); - if (length && typeof array[0] == "string" && hasOwnProperty3.call(array, "index")) { - result2.index = array.index; - result2.input = array.input; + if (currentFrom.nodeType === 1 && lookahead && !currentFrom.isEqualNode(currentTo)) { + let nextToElementSibling = getNextSibling(to, currentTo); + let found = false; + while (!found && nextToElementSibling) { + if (nextToElementSibling.nodeType === 1 && currentFrom.isEqualNode(nextToElementSibling)) { + found = true; + currentFrom = addNodeBefore(from2, currentTo, currentFrom); + fromKey = getKey(currentFrom); + } + nextToElementSibling = getNextSibling(to, nextToElementSibling); } - return result2; } - function initCloneObject(object) { - return typeof object.constructor == "function" && !isPrototype(object) ? baseCreate(getPrototype(object)) : {}; - } - function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - case boolTag: - case dateTag: - return new Ctor(+object); - case dataViewTag: - return cloneDataView(object, isDeep); - case float32Tag: - case float64Tag: - case int8Tag: - case int16Tag: - case int32Tag: - case uint8Tag: - case uint8ClampedTag: - case uint16Tag: - case uint32Tag: - return cloneTypedArray(object, isDeep); - case mapTag: - return new Ctor(); - case numberTag: - case stringTag: - return new Ctor(object); - case regexpTag: - return cloneRegExp(object); - case setTag: - return new Ctor(); - case symbolTag: - return cloneSymbol(object); + if (toKey !== fromKey) { + if (!toKey && fromKey) { + fromKeyHoldovers[fromKey] = currentFrom; + currentFrom = addNodeBefore(from2, currentTo, currentFrom); + fromKeyHoldovers[fromKey].remove(); + currentFrom = getNextSibling(from2, currentFrom); + currentTo = getNextSibling(to, currentTo); + continue; } - } - function insertWrapDetails(source, details) { - var length = details.length; - if (!length) { - return source; - } - var lastIndex = length - 1; - details[lastIndex] = (length > 1 ? "& " : "") + details[lastIndex]; - details = details.join(length > 2 ? ", " : " "); - return source.replace(reWrapComment, "{\n/* [wrapped with " + details + "] */\n"); - } - function isFlattenable(value) { - return isArray2(value) || isArguments(value) || !!(spreadableSymbol && value && value[spreadableSymbol]); - } - function isIndex(value, length) { - var type = typeof value; - length = length == null ? MAX_SAFE_INTEGER : length; - return !!length && (type == "number" || type != "symbol" && reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); - } - function isIterateeCall(value, index, object) { - if (!isObject3(object)) { - return false; - } - var type = typeof index; - if (type == "number" ? isArrayLike(object) && isIndex(index, object.length) : type == "string" && index in object) { - return eq(object[index], value); - } - return false; - } - function isKey(value, object) { - if (isArray2(value)) { - return false; - } - var type = typeof value; - if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol2(value)) { - return true; - } - return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object2(object); - } - function isKeyable(value) { - var type = typeof value; - return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; - } - function isLaziable(func) { - var funcName = getFuncName(func), other = lodash[funcName]; - if (typeof other != "function" || !(funcName in LazyWrapper.prototype)) { - return false; - } - if (func === other) { - return true; - } - var data2 = getData2(other); - return !!data2 && func === data2[0]; - } - function isMasked(func) { - return !!maskSrcKey && maskSrcKey in func; - } - var isMaskable = coreJsData ? isFunction : stubFalse; - function isPrototype(value) { - var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; - return value === proto; - } - function isStrictComparable(value) { - return value === value && !isObject3(value); - } - function matchesStrictComparable(key, srcValue) { - return function(object) { - if (object == null) { - return false; + if (toKey && !fromKey) { + if (fromKeys[toKey]) { + currentFrom.replaceWith(fromKeys[toKey]); + currentFrom = fromKeys[toKey]; } - return object[key] === srcValue && (srcValue !== undefined2 || key in Object2(object)); - }; - } - function memoizeCapped(func) { - var result2 = memoize(func, function(key) { - if (cache.size === MAX_MEMOIZE_SIZE) { - cache.clear(); - } - return key; - }); - var cache = result2.cache; - return result2; - } - function mergeData(data2, source) { - var bitmask = data2[1], srcBitmask = source[1], newBitmask = bitmask | srcBitmask, isCommon = newBitmask < (WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG | WRAP_ARY_FLAG); - var isCombo = srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_CURRY_FLAG || srcBitmask == WRAP_ARY_FLAG && bitmask == WRAP_REARG_FLAG && data2[7].length <= source[8] || srcBitmask == (WRAP_ARY_FLAG | WRAP_REARG_FLAG) && source[7].length <= source[8] && bitmask == WRAP_CURRY_FLAG; - if (!(isCommon || isCombo)) { - return data2; } - if (srcBitmask & WRAP_BIND_FLAG) { - data2[2] = source[2]; - newBitmask |= bitmask & WRAP_BIND_FLAG ? 0 : WRAP_CURRY_BOUND_FLAG; - } - var value = source[3]; - if (value) { - var partials = data2[3]; - data2[3] = partials ? composeArgs(partials, value, source[4]) : value; - data2[4] = partials ? replaceHolders(data2[3], PLACEHOLDER) : source[4]; - } - value = source[5]; - if (value) { - partials = data2[5]; - data2[5] = partials ? composeArgsRight(partials, value, source[6]) : value; - data2[6] = partials ? replaceHolders(data2[5], PLACEHOLDER) : source[6]; - } - value = source[7]; - if (value) { - data2[7] = value; - } - if (srcBitmask & WRAP_ARY_FLAG) { - data2[8] = data2[8] == null ? source[8] : nativeMin(data2[8], source[8]); - } - if (data2[9] == null) { - data2[9] = source[9]; - } - data2[0] = source[0]; - data2[1] = newBitmask; - return data2; - } - function nativeKeysIn(object) { - var result2 = []; - if (object != null) { - for (var key in Object2(object)) { - result2.push(key); + if (toKey && fromKey) { + let fromKeyNode = fromKeys[toKey]; + if (fromKeyNode) { + fromKeyHoldovers[fromKey] = currentFrom; + currentFrom.replaceWith(fromKeyNode); + currentFrom = fromKeyNode; + } else { + fromKeyHoldovers[fromKey] = currentFrom; + currentFrom = addNodeBefore(from2, currentTo, currentFrom); + fromKeyHoldovers[fromKey].remove(); + currentFrom = getNextSibling(from2, currentFrom); + currentTo = getNextSibling(to, currentTo); + continue; } } - return result2; } - function objectToString2(value) { - return nativeObjectToString.call(value); + let currentFromNext = currentFrom && getNextSibling(from2, currentFrom); + patch(currentFrom, currentTo); + currentTo = currentTo && getNextSibling(to, currentTo); + currentFrom = currentFromNext; + } + let removals = []; + while (currentFrom) { + if (!shouldSkip(removing, currentFrom)) + removals.push(currentFrom); + currentFrom = getNextSibling(from2, currentFrom); + } + while (removals.length) { + let domForRemoval = removals.shift(); + domForRemoval.remove(); + removed(domForRemoval); + } + } + function getKey(el) { + return el && el.nodeType === 1 && key(el); + } + function keyToMap(els) { + let map = {}; + for (let el of els) { + let theKey = getKey(el); + if (theKey) { + map[theKey] = el; } - function overRest(func, start3, transform2) { - start3 = nativeMax(start3 === undefined2 ? func.length - 1 : start3, 0); - return function() { - var args = arguments, index = -1, length = nativeMax(args.length - start3, 0), array = Array2(length); - while (++index < length) { - array[index] = args[start3 + index]; - } - index = -1; - var otherArgs = Array2(start3 + 1); - while (++index < start3) { - otherArgs[index] = args[index]; - } - otherArgs[start3] = transform2(array); - return apply(func, this, otherArgs); - }; + } + return map; + } + function addNodeBefore(parent, node, beforeMe) { + if (!shouldSkip(adding, node)) { + let clone = node.cloneNode(true); + parent.insertBefore(clone, beforeMe); + added(clone); + return clone; + } + return node; + } + assignOptions(options); + fromEl = from; + toEl = typeof toHtml === "string" ? createElement(toHtml) : toHtml; + if (window.Alpine && window.Alpine.closestDataStack && !from._x_dataStack) { + toEl._x_dataStack = window.Alpine.closestDataStack(from); + toEl._x_dataStack && window.Alpine.cloneNode(from, toEl); + } + patch(from, toEl); + fromEl = void 0; + toEl = void 0; + return from; + } + morph2.step = () => { + }; + morph2.log = () => { + }; + function shouldSkip(hook, ...args) { + let skip = false; + hook(...args, () => skip = true); + return skip; + } + var patched = false; + function createElement(html) { + const template = document.createElement("template"); + template.innerHTML = html; + return template.content.firstElementChild; + } + function textOrComment(el) { + return el.nodeType === 3 || el.nodeType === 8; + } + var Block = class { + constructor(start, end) { + this.startComment = start; + this.endComment = end; + } + get children() { + let children = []; + let currentNode = this.startComment.nextSibling; + while (currentNode && currentNode !== this.endComment) { + children.push(currentNode); + currentNode = currentNode.nextSibling; + } + return children; + } + appendChild(child) { + this.endComment.before(child); + } + get firstChild() { + let first = this.startComment.nextSibling; + if (first === this.endComment) + return; + return first; + } + nextNode(reference) { + let next = reference.nextSibling; + if (next === this.endComment) + return; + return next; + } + insertBefore(newNode, reference) { + reference.before(newNode); + return newNode; + } + }; + function getFirstNode(parent) { + return parent.firstChild; + } + function getNextSibling(parent, reference) { + let next; + if (parent instanceof Block) { + next = parent.nextNode(reference); + } else { + next = reference.nextSibling; + } + return next; + } + function monkeyPatchDomSetAttributeToAllowAtSymbols() { + if (patched) + return; + patched = true; + let original = Element.prototype.setAttribute; + let hostDiv = document.createElement("div"); + Element.prototype.setAttribute = function newSetAttribute(name, value) { + if (!name.includes("@")) { + return original.call(this, name, value); + } + hostDiv.innerHTML = `<span ${name}="${value}"></span>`; + let attr = hostDiv.firstElementChild.getAttributeNode(name); + hostDiv.firstElementChild.removeAttributeNode(attr); + this.setAttributeNode(attr); + }; + } + function seedingMatchingId(to, from) { + let fromId = from && from._x_bindings && from._x_bindings.id; + if (!fromId) + return; + to.setAttribute("id", fromId); + to.id = fromId; + } + function src_default(Alpine3) { + Alpine3.morph = morph2; + } + var module_default = src_default; + } +}); + +// ../../../node_modules/@alpinejs/mask/dist/module.cjs.js +var require_module_cjs3 = __commonJS({ + "../../../node_modules/@alpinejs/mask/dist/module.cjs.js"(exports, module) { + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default, + stripDown: () => stripDown + }); + module.exports = __toCommonJS(module_exports); + function src_default(Alpine3) { + Alpine3.directive("mask", (el, { value, expression }, { effect, evaluateLater }) => { + let templateFn = () => expression; + let lastInputValue = ""; + queueMicrotask(() => { + if (["function", "dynamic"].includes(value)) { + let evaluator = evaluateLater(expression); + effect(() => { + templateFn = (input) => { + let result; + Alpine3.dontAutoEvaluateFunctions(() => { + evaluator((value2) => { + result = typeof value2 === "function" ? value2(input) : value2; + }, { scope: { + // These are "magics" we'll make available to the x-mask:function: + "$input": input, + "$money": formatMoney.bind({ el }) + } }); + }); + return result; + }; + processInputValue(el, false); + }); + } else { + processInputValue(el, false); } - function parent(object, path) { - return path.length < 2 ? object : baseGet(object, baseSlice(path, 0, -1)); + if (el._x_model) + el._x_model.set(el.value); + }); + el.addEventListener("input", () => processInputValue(el)); + el.addEventListener("blur", () => processInputValue(el, false)); + function processInputValue(el2, shouldRestoreCursor = true) { + let input = el2.value; + let template = templateFn(input); + if (!template || template === "false") + return false; + if (lastInputValue.length - el2.value.length === 1) { + return lastInputValue = el2.value; } - function reorder(array, indexes) { - var arrLength = array.length, length = nativeMin(indexes.length, arrLength), oldArray = copyArray(array); - while (length--) { - var index = indexes[length]; - array[length] = isIndex(index, arrLength) ? oldArray[index] : undefined2; - } - return array; - } - function safeGet(object, key) { - if (key === "constructor" && typeof object[key] === "function") { - return; - } - if (key == "__proto__") { - return; - } - return object[key]; - } - var setData2 = shortOut(baseSetData); - var setTimeout2 = ctxSetTimeout || function(func, wait) { - return root.setTimeout(func, wait); + let setInput = () => { + lastInputValue = el2.value = formatInput(input, template); }; - var setToString = shortOut(baseSetToString); - function setWrapToString(wrapper, reference2, bitmask) { - var source = reference2 + ""; - return setToString(wrapper, insertWrapDetails(source, updateWrapDetails(getWrapDetails(source), bitmask))); - } - function shortOut(func) { - var count = 0, lastCalled = 0; - return function() { - var stamp = nativeNow(), remaining = HOT_SPAN - (stamp - lastCalled); - lastCalled = stamp; - if (remaining > 0) { - if (++count >= HOT_COUNT) { - return arguments[0]; - } - } else { - count = 0; - } - return func.apply(undefined2, arguments); - }; - } - function shuffleSelf(array, size3) { - var index = -1, length = array.length, lastIndex = length - 1; - size3 = size3 === undefined2 ? length : size3; - while (++index < size3) { - var rand = baseRandom(index, lastIndex), value = array[rand]; - array[rand] = array[index]; - array[index] = value; - } - array.length = size3; - return array; - } - var stringToPath = memoizeCapped(function(string) { - var result2 = []; - if (string.charCodeAt(0) === 46) { - result2.push(""); - } - string.replace(rePropName, function(match, number, quote, subString) { - result2.push(quote ? subString.replace(reEscapeChar, "$1") : number || match); + if (shouldRestoreCursor) { + restoreCursorPosition(el2, template, () => { + setInput(); }); - return result2; - }); - function toKey(value) { - if (typeof value == "string" || isSymbol2(value)) { - return value; - } - var result2 = value + ""; - return result2 == "0" && 1 / value == -INFINITY ? "-0" : result2; + } else { + setInput(); } - function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e3) { - } - try { - return func + ""; - } catch (e3) { - } - } + } + function formatInput(input, template) { + if (input === "") return ""; + let strippedDownInput = stripDown(template, input); + let rebuiltInput = buildUp(template, strippedDownInput); + return rebuiltInput; + } + }).before("model"); + } + function restoreCursorPosition(el, template, callback) { + let cursorPosition = el.selectionStart; + let unformattedValue = el.value; + callback(); + let beforeLeftOfCursorBeforeFormatting = unformattedValue.slice(0, cursorPosition); + let newPosition = buildUp( + template, + stripDown( + template, + beforeLeftOfCursorBeforeFormatting + ) + ).length; + el.setSelectionRange(newPosition, newPosition); + } + function stripDown(template, input) { + let inputToBeStripped = input; + let output = ""; + let regexes = { + "9": /[0-9]/, + "a": /[a-zA-Z]/, + "*": /[a-zA-Z0-9]/ + }; + let wildcardTemplate = ""; + for (let i2 = 0; i2 < template.length; i2++) { + if (["9", "a", "*"].includes(template[i2])) { + wildcardTemplate += template[i2]; + continue; + } + for (let j2 = 0; j2 < inputToBeStripped.length; j2++) { + if (inputToBeStripped[j2] === template[i2]) { + inputToBeStripped = inputToBeStripped.slice(0, j2) + inputToBeStripped.slice(j2 + 1); + break; } - function updateWrapDetails(details, bitmask) { - arrayEach(wrapFlags, function(pair) { - var value = "_." + pair[0]; - if (bitmask & pair[1] && !arrayIncludes(details, value)) { - details.push(value); - } - }); - return details.sort(); + } + } + for (let i2 = 0; i2 < wildcardTemplate.length; i2++) { + let found = false; + for (let j2 = 0; j2 < inputToBeStripped.length; j2++) { + if (regexes[wildcardTemplate[i2]].test(inputToBeStripped[j2])) { + output += inputToBeStripped[j2]; + inputToBeStripped = inputToBeStripped.slice(0, j2) + inputToBeStripped.slice(j2 + 1); + found = true; + break; } - function wrapperClone(wrapper) { - if (wrapper instanceof LazyWrapper) { - return wrapper.clone(); - } - var result2 = new LodashWrapper(wrapper.__wrapped__, wrapper.__chain__); - result2.__actions__ = copyArray(wrapper.__actions__); - result2.__index__ = wrapper.__index__; - result2.__values__ = wrapper.__values__; - return result2; + } + if (!found) + break; + } + return output; + } + function buildUp(template, input) { + let clean = Array.from(input); + let output = ""; + for (let i2 = 0; i2 < template.length; i2++) { + if (!["9", "a", "*"].includes(template[i2])) { + output += template[i2]; + continue; + } + if (clean.length === 0) + break; + output += clean.shift(); + } + return output; + } + function formatMoney(input, delimiter = ".", thousands, precision = 2) { + if (input === "-") + return "-"; + if (/^\D+$/.test(input)) + return "9"; + if (thousands === null || thousands === void 0) { + thousands = delimiter === "," ? "." : ","; + } + let addThousands = (input2, thousands2) => { + let output = ""; + let counter = 0; + for (let i2 = input2.length - 1; i2 >= 0; i2--) { + if (input2[i2] === thousands2) + continue; + if (counter === 3) { + output = input2[i2] + thousands2 + output; + counter = 0; + } else { + output = input2[i2] + output; } - function chunk(array, size3, guard) { - if (guard ? isIterateeCall(array, size3, guard) : size3 === undefined2) { - size3 = 1; - } else { - size3 = nativeMax(toInteger(size3), 0); - } - var length = array == null ? 0 : array.length; - if (!length || size3 < 1) { - return []; - } - var index = 0, resIndex = 0, result2 = Array2(nativeCeil(length / size3)); - while (index < length) { - result2[resIndex++] = baseSlice(array, index, index += size3); - } - return result2; + counter++; + } + return output; + }; + let minus = input.startsWith("-") ? "-" : ""; + let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimiter}]`, "g"), ""); + let template = Array.from({ length: strippedInput.split(delimiter)[0].length }).fill("9").join(""); + template = `${minus}${addThousands(template, thousands)}`; + if (precision > 0 && input.includes(delimiter)) + template += `${delimiter}` + "9".repeat(precision); + queueMicrotask(() => { + if (this.el.value.endsWith(delimiter)) + return; + if (this.el.value[this.el.selectionStart - 1] === delimiter) { + this.el.setSelectionRange(this.el.selectionStart - 1, this.el.selectionStart - 1); + } + }); + return template; + } + var module_default = src_default; + } +}); + +// ../../../node_modules/@alpinejs/focus/dist/module.cjs.js +var require_module_cjs4 = __commonJS({ + "../../../node_modules/@alpinejs/focus/dist/module.cjs.js"(exports, module) { + var __create2 = Object.create; + var __defProp2 = Object.defineProperty; + var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor; + var __getOwnPropNames2 = Object.getOwnPropertyNames; + var __getProtoOf2 = Object.getPrototypeOf; + var __hasOwnProp2 = Object.prototype.hasOwnProperty; + var __commonJS2 = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + }; + var __export2 = (target, all) => { + for (var name in all) + __defProp2(target, name, { get: all[name], enumerable: true }); + }; + var __copyProps2 = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames2(from)) + if (!__hasOwnProp2.call(to, key) && key !== except) + __defProp2(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable }); + } + return to; + }; + var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", { value: mod, enumerable: true }) : target, + mod + )); + var __toCommonJS = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod); + var require_dist = __commonJS2({ + "node_modules/tabbable/dist/index.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; + var candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); + var NoElement = typeof Element === "undefined"; + var matches = NoElement ? function() { + } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; + var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { + return element.getRootNode(); + } : function(element) { + return element.ownerDocument; + }; + var getCandidates = function getCandidates2(el, includeContainer, filter) { + var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); + if (includeContainer && matches.call(el, candidateSelector)) { + candidates.unshift(el); } - function compact(array) { - var index = -1, length = array == null ? 0 : array.length, resIndex = 0, result2 = []; - while (++index < length) { - var value = array[index]; - if (value) { - result2[resIndex++] = value; + candidates = candidates.filter(filter); + return candidates; + }; + var getCandidatesIteratively = function getCandidatesIteratively2(elements, includeContainer, options) { + var candidates = []; + var elementsToCheck = Array.from(elements); + while (elementsToCheck.length) { + var element = elementsToCheck.shift(); + if (element.tagName === "SLOT") { + var assigned = element.assignedElements(); + var content2 = assigned.length ? assigned : element.children; + var nestedCandidates = getCandidatesIteratively2(content2, true, options); + if (options.flatten) { + candidates.push.apply(candidates, nestedCandidates); + } else { + candidates.push({ + scope: element, + candidates: nestedCandidates + }); } + } else { + var validCandidate = matches.call(element, candidateSelector); + if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) { + candidates.push(element); + } + var shadowRoot = element.shadowRoot || // check for an undisclosed shadow + typeof options.getShadowRoot === "function" && options.getShadowRoot(element); + var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element); + if (shadowRoot && validShadowRoot) { + var _nestedCandidates = getCandidatesIteratively2(shadowRoot === true ? element.children : shadowRoot.children, true, options); + if (options.flatten) { + candidates.push.apply(candidates, _nestedCandidates); + } else { + candidates.push({ + scope: element, + candidates: _nestedCandidates + }); + } + } else { + elementsToCheck.unshift.apply(elementsToCheck, element.children); + } } - return result2; } - function concat() { - var length = arguments.length; - if (!length) { - return []; + return candidates; + }; + var getTabindex = function getTabindex2(node, isScope) { + if (node.tabIndex < 0) { + if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { + return 0; } - var args = Array2(length - 1), array = arguments[0], index = length; - while (index--) { - args[index - 1] = arguments[index]; - } - return arrayPush(isArray2(array) ? copyArray(array) : [array], baseFlatten(args, 1)); } - var difference = baseRest(function(array, values2) { - return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true)) : []; + return node.tabIndex; + }; + var sortOrderedTabbables = function sortOrderedTabbables2(a2, b2) { + return a2.tabIndex === b2.tabIndex ? a2.documentOrder - b2.documentOrder : a2.tabIndex - b2.tabIndex; + }; + var isInput = function isInput2(node) { + return node.tagName === "INPUT"; + }; + var isHiddenInput = function isHiddenInput2(node) { + return isInput(node) && node.type === "hidden"; + }; + var isDetailsWithSummary = function isDetailsWithSummary2(node) { + var r2 = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + return child.tagName === "SUMMARY"; }); - var differenceBy = baseRest(function(array, values2) { - var iteratee2 = last(values2); - if (isArrayLikeObject(iteratee2)) { - iteratee2 = undefined2; + return r2; + }; + var getCheckedRadio = function getCheckedRadio2(nodes, form) { + for (var i2 = 0; i2 < nodes.length; i2++) { + if (nodes[i2].checked && nodes[i2].form === form) { + return nodes[i2]; } - return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)) : []; - }); - var differenceWith = baseRest(function(array, values2) { - var comparator = last(values2); - if (isArrayLikeObject(comparator)) { - comparator = undefined2; - } - return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : []; - }); - function drop(array, n3, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); - return baseSlice(array, n3 < 0 ? 0 : n3, length); } - function dropRight(array, n3, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); - n3 = length - n3; - return baseSlice(array, 0, n3 < 0 ? 0 : n3); + }; + var isTabbableRadio = function isTabbableRadio2(node) { + if (!node.name) { + return true; } - function dropRightWhile(array, predicate) { - return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; - } - function dropWhile(array, predicate) { - return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true) : []; - } - function fill(array, value, start3, end2) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; + var radioScope = node.form || getRootNode(node); + var queryRadios = function queryRadios2(name) { + return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); + }; + var radioSet; + if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { + radioSet = queryRadios(window.CSS.escape(node.name)); + } else { + try { + radioSet = queryRadios(node.name); + } catch (err) { + console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message); + return false; } - if (start3 && typeof start3 != "number" && isIterateeCall(array, value, start3)) { - start3 = 0; - end2 = length; - } - return baseFill(array, value, start3, end2); } - function findIndex3(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseFindIndex(array, getIteratee(predicate, 3), index); + var checked = getCheckedRadio(radioSet, node.form); + return !checked || checked === node; + }; + var isRadio = function isRadio2(node) { + return isInput(node) && node.type === "radio"; + }; + var isNonTabbableRadio = function isNonTabbableRadio2(node) { + return isRadio(node) && !isTabbableRadio(node); + }; + var isZeroArea = function isZeroArea2(node) { + var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; + return width === 0 && height === 0; + }; + var isHidden = function isHidden2(node, _ref) { + var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot; + if (getComputedStyle(node).visibility === "hidden") { + return true; } - function findLastIndex(array, predicate, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length - 1; - if (fromIndex !== undefined2) { - index = toInteger(fromIndex); - index = fromIndex < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return baseFindIndex(array, getIteratee(predicate, 3), index, true); + var isDirectSummary = matches.call(node, "details>summary:first-of-type"); + var nodeUnderDetails = isDirectSummary ? node.parentElement : node; + if (matches.call(nodeUnderDetails, "details:not([open]) *")) { + return true; } - function flatten(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, 1) : []; - } - function flattenDeep(array) { - var length = array == null ? 0 : array.length; - return length ? baseFlatten(array, INFINITY) : []; - } - function flattenDepth(array, depth) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - depth = depth === undefined2 ? 1 : toInteger(depth); - return baseFlatten(array, depth); - } - function fromPairs(pairs) { - var index = -1, length = pairs == null ? 0 : pairs.length, result2 = {}; - while (++index < length) { - var pair = pairs[index]; - result2[pair[0]] = pair[1]; - } - return result2; - } - function head(array) { - return array && array.length ? array[0] : undefined2; - } - function indexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = fromIndex == null ? 0 : toInteger(fromIndex); - if (index < 0) { - index = nativeMax(length + index, 0); - } - return baseIndexOf(array, value, index); - } - function initial(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 0, -1) : []; - } - var intersection = baseRest(function(arrays) { - var mapped = arrayMap(arrays, castArrayLikeObject); - return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped) : []; - }); - var intersectionBy = baseRest(function(arrays) { - var iteratee2 = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); - if (iteratee2 === last(mapped)) { - iteratee2 = undefined2; - } else { - mapped.pop(); - } - return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, getIteratee(iteratee2, 2)) : []; - }); - var intersectionWith = baseRest(function(arrays) { - var comparator = last(arrays), mapped = arrayMap(arrays, castArrayLikeObject); - comparator = typeof comparator == "function" ? comparator : undefined2; - if (comparator) { - mapped.pop(); - } - return mapped.length && mapped[0] === arrays[0] ? baseIntersection(mapped, undefined2, comparator) : []; - }); - function join(array, separator) { - return array == null ? "" : nativeJoin.call(array, separator); - } - function last(array) { - var length = array == null ? 0 : array.length; - return length ? array[length - 1] : undefined2; - } - function lastIndexOf(array, value, fromIndex) { - var length = array == null ? 0 : array.length; - if (!length) { - return -1; - } - var index = length; - if (fromIndex !== undefined2) { - index = toInteger(fromIndex); - index = index < 0 ? nativeMax(length + index, 0) : nativeMin(index, length - 1); - } - return value === value ? strictLastIndexOf(array, value, index) : baseFindIndex(array, baseIsNaN, index, true); - } - function nth(array, n3) { - return array && array.length ? baseNth(array, toInteger(n3)) : undefined2; - } - var pull = baseRest(pullAll); - function pullAll(array, values2) { - return array && array.length && values2 && values2.length ? basePullAll(array, values2) : array; - } - function pullAllBy(array, values2, iteratee2) { - return array && array.length && values2 && values2.length ? basePullAll(array, values2, getIteratee(iteratee2, 2)) : array; - } - function pullAllWith(array, values2, comparator) { - return array && array.length && values2 && values2.length ? basePullAll(array, values2, undefined2, comparator) : array; - } - var pullAt = flatRest(function(array, indexes) { - var length = array == null ? 0 : array.length, result2 = baseAt(array, indexes); - basePullAt(array, arrayMap(indexes, function(index) { - return isIndex(index, length) ? +index : index; - }).sort(compareAscending)); - return result2; - }); - function remove(array, predicate) { - var result2 = []; - if (!(array && array.length)) { - return result2; - } - var index = -1, indexes = [], length = array.length; - predicate = getIteratee(predicate, 3); - while (++index < length) { - var value = array[index]; - if (predicate(value, index, array)) { - result2.push(value); - indexes.push(index); + var nodeRootHost = getRootNode(node).host; + var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); + if (!displayCheck || displayCheck === "full") { + if (typeof getShadowRoot === "function") { + var originalNode = node; + while (node) { + var parentElement = node.parentElement; + var rootNode = getRootNode(node); + if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { + return isZeroArea(node); + } else if (node.assignedSlot) { + node = node.assignedSlot; + } else if (!parentElement && rootNode !== node.ownerDocument) { + node = rootNode.host; + } else { + node = parentElement; + } } + node = originalNode; } - basePullAt(array, indexes); - return result2; - } - function reverse(array) { - return array == null ? array : nativeReverse.call(array); - } - function slice(array, start3, end2) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; + if (nodeIsAttached) { + return !node.getClientRects().length; } - if (end2 && typeof end2 != "number" && isIterateeCall(array, start3, end2)) { - start3 = 0; - end2 = length; - } else { - start3 = start3 == null ? 0 : toInteger(start3); - end2 = end2 === undefined2 ? length : toInteger(end2); - } - return baseSlice(array, start3, end2); + } else if (displayCheck === "non-zero-area") { + return isZeroArea(node); } - function sortedIndex(array, value) { - return baseSortedIndex(array, value); - } - function sortedIndexBy(array, value, iteratee2) { - return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2)); - } - function sortedIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value); - if (index < length && eq(array[index], value)) { - return index; + return false; + }; + var isDisabledFromFieldset = function isDisabledFromFieldset2(node) { + if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { + var parentNode = node.parentElement; + while (parentNode) { + if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { + for (var i2 = 0; i2 < parentNode.children.length; i2++) { + var child = parentNode.children.item(i2); + if (child.tagName === "LEGEND") { + return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); + } + } + return true; } + parentNode = parentNode.parentElement; } - return -1; } - function sortedLastIndex(array, value) { - return baseSortedIndex(array, value, true); + return false; + }; + var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { + if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus + isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { + return false; } - function sortedLastIndexBy(array, value, iteratee2) { - return baseSortedIndexBy(array, value, getIteratee(iteratee2, 2), true); + return true; + }; + var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { + if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { + return false; } - function sortedLastIndexOf(array, value) { - var length = array == null ? 0 : array.length; - if (length) { - var index = baseSortedIndex(array, value, true) - 1; - if (eq(array[index], value)) { - return index; - } - } - return -1; + return true; + }; + var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNode) { + var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); + if (isNaN(tabIndex) || tabIndex >= 0) { + return true; } - function sortedUniq(array) { - return array && array.length ? baseSortedUniq(array) : []; - } - function sortedUniqBy(array, iteratee2) { - return array && array.length ? baseSortedUniq(array, getIteratee(iteratee2, 2)) : []; - } - function tail(array) { - var length = array == null ? 0 : array.length; - return length ? baseSlice(array, 1, length) : []; - } - function take(array, n3, guard) { - if (!(array && array.length)) { - return []; + return false; + }; + var sortByOrder = function sortByOrder2(candidates) { + var regularTabbables = []; + var orderedTabbables = []; + candidates.forEach(function(item, i2) { + var isScope = !!item.scope; + var element = isScope ? item.scope : item; + var candidateTabindex = getTabindex(element, isScope); + var elements = isScope ? sortByOrder2(item.candidates) : element; + if (candidateTabindex === 0) { + isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); + } else { + orderedTabbables.push({ + documentOrder: i2, + tabIndex: candidateTabindex, + item, + isScope, + content: elements + }); } - n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); - return baseSlice(array, 0, n3 < 0 ? 0 : n3); - } - function takeRight(array, n3, guard) { - var length = array == null ? 0 : array.length; - if (!length) { - return []; - } - n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); - n3 = length - n3; - return baseSlice(array, n3 < 0 ? 0 : n3, length); - } - function takeRightWhile(array, predicate) { - return array && array.length ? baseWhile(array, getIteratee(predicate, 3), false, true) : []; - } - function takeWhile(array, predicate) { - return array && array.length ? baseWhile(array, getIteratee(predicate, 3)) : []; - } - var union = baseRest(function(arrays) { - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); - var unionBy = baseRest(function(arrays) { - var iteratee2 = last(arrays); - if (isArrayLikeObject(iteratee2)) { - iteratee2 = undefined2; - } - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), getIteratee(iteratee2, 2)); - }); - var unionWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == "function" ? comparator : undefined2; - return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true), undefined2, comparator); - }); - function uniq(array) { - return array && array.length ? baseUniq(array) : []; - } - function uniqBy(array, iteratee2) { - return array && array.length ? baseUniq(array, getIteratee(iteratee2, 2)) : []; - } - function uniqWith(array, comparator) { - comparator = typeof comparator == "function" ? comparator : undefined2; - return array && array.length ? baseUniq(array, undefined2, comparator) : []; - } - function unzip(array) { - if (!(array && array.length)) { - return []; - } - var length = 0; - array = arrayFilter(array, function(group) { - if (isArrayLikeObject(group)) { - length = nativeMax(group.length, length); - return true; - } + return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { + sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); + return acc; + }, []).concat(regularTabbables); + }; + var tabbable = function tabbable2(el, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = getCandidatesIteratively([el], options.includeContainer, { + filter: isNodeMatchingSelectorTabbable.bind(null, options), + flatten: false, + getShadowRoot: options.getShadowRoot, + shadowRootFilter: isValidShadowRootTabbable }); - return baseTimes(length, function(index) { - return arrayMap(array, baseProperty(index)); - }); + } else { + candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options)); } - function unzipWith(array, iteratee2) { - if (!(array && array.length)) { - return []; - } - var result2 = unzip(array); - if (iteratee2 == null) { - return result2; - } - return arrayMap(result2, function(group) { - return apply(iteratee2, undefined2, group); + return sortByOrder(candidates); + }; + var focusable2 = function focusable3(el, options) { + options = options || {}; + var candidates; + if (options.getShadowRoot) { + candidates = getCandidatesIteratively([el], options.includeContainer, { + filter: isNodeMatchingSelectorFocusable.bind(null, options), + flatten: true, + getShadowRoot: options.getShadowRoot }); + } else { + candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options)); } - var without = baseRest(function(array, values2) { - return isArrayLikeObject(array) ? baseDifference(array, values2) : []; - }); - var xor = baseRest(function(arrays) { - return baseXor(arrayFilter(arrays, isArrayLikeObject)); - }); - var xorBy = baseRest(function(arrays) { - var iteratee2 = last(arrays); - if (isArrayLikeObject(iteratee2)) { - iteratee2 = undefined2; - } - return baseXor(arrayFilter(arrays, isArrayLikeObject), getIteratee(iteratee2, 2)); - }); - var xorWith = baseRest(function(arrays) { - var comparator = last(arrays); - comparator = typeof comparator == "function" ? comparator : undefined2; - return baseXor(arrayFilter(arrays, isArrayLikeObject), undefined2, comparator); - }); - var zip = baseRest(unzip); - function zipObject(props, values2) { - return baseZipObject(props || [], values2 || [], assignValue); + return candidates; + }; + var isTabbable = function isTabbable2(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); } - function zipObjectDeep(props, values2) { - return baseZipObject(props || [], values2 || [], baseSet); + if (matches.call(node, candidateSelector) === false) { + return false; } - var zipWith = baseRest(function(arrays) { - var length = arrays.length, iteratee2 = length > 1 ? arrays[length - 1] : undefined2; - iteratee2 = typeof iteratee2 == "function" ? (arrays.pop(), iteratee2) : undefined2; - return unzipWith(arrays, iteratee2); - }); - function chain(value) { - var result2 = lodash(value); - result2.__chain__ = true; - return result2; + return isNodeMatchingSelectorTabbable(options, node); + }; + var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); + var isFocusable2 = function isFocusable3(node, options) { + options = options || {}; + if (!node) { + throw new Error("No node provided"); } - function tap(value, interceptor2) { - interceptor2(value); - return value; + if (matches.call(node, focusableCandidateSelector) === false) { + return false; } - function thru(value, interceptor2) { - return interceptor2(value); + return isNodeMatchingSelectorFocusable(options, node); + }; + exports2.focusable = focusable2; + exports2.isFocusable = isFocusable2; + exports2.isTabbable = isTabbable; + exports2.tabbable = tabbable; + } + }); + var require_focus_trap = __commonJS2({ + "node_modules/focus-trap/dist/focus-trap.js"(exports2) { + "use strict"; + Object.defineProperty(exports2, "__esModule", { value: true }); + var tabbable = require_dist(); + function ownKeys(object, enumerableOnly) { + var keys = Object.keys(object); + if (Object.getOwnPropertySymbols) { + var symbols = Object.getOwnPropertySymbols(object); + enumerableOnly && (symbols = symbols.filter(function(sym) { + return Object.getOwnPropertyDescriptor(object, sym).enumerable; + })), keys.push.apply(keys, symbols); } - var wrapperAt = flatRest(function(paths) { - var length = paths.length, start3 = length ? paths[0] : 0, value = this.__wrapped__, interceptor2 = function(object) { - return baseAt(object, paths); - }; - if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start3)) { - return this.thru(interceptor2); - } - value = value.slice(start3, +start3 + (length ? 1 : 0)); - value.__actions__.push({ - "func": thru, - "args": [interceptor2], - "thisArg": undefined2 + return keys; + } + function _objectSpread2(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = null != arguments[i2] ? arguments[i2] : {}; + i2 % 2 ? ownKeys(Object(source), true).forEach(function(key) { + _defineProperty(target, key, source[key]); + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function(key) { + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); - return new LodashWrapper(value, this.__chain__).thru(function(array) { - if (length && !array.length) { - array.push(undefined2); - } - return array; + } + return target; + } + function _defineProperty(obj, key, value) { + if (key in obj) { + Object.defineProperty(obj, key, { + value, + enumerable: true, + configurable: true, + writable: true }); - }); - function wrapperChain() { - return chain(this); + } else { + obj[key] = value; } - function wrapperCommit() { - return new LodashWrapper(this.value(), this.__chain__); - } - function wrapperNext() { - if (this.__values__ === undefined2) { - this.__values__ = toArray(this.value()); - } - var done = this.__index__ >= this.__values__.length, value = done ? undefined2 : this.__values__[this.__index__++]; - return { "done": done, "value": value }; - } - function wrapperToIterator() { - return this; - } - function wrapperPlant(value) { - var result2, parent2 = this; - while (parent2 instanceof baseLodash) { - var clone3 = wrapperClone(parent2); - clone3.__index__ = 0; - clone3.__values__ = undefined2; - if (result2) { - previous.__wrapped__ = clone3; + return obj; + } + var activeFocusTraps = /* @__PURE__ */ function() { + var trapQueue = []; + return { + activateTrap: function activateTrap(trap) { + if (trapQueue.length > 0) { + var activeTrap = trapQueue[trapQueue.length - 1]; + if (activeTrap !== trap) { + activeTrap.pause(); + } + } + var trapIndex = trapQueue.indexOf(trap); + if (trapIndex === -1) { + trapQueue.push(trap); } else { - result2 = clone3; + trapQueue.splice(trapIndex, 1); + trapQueue.push(trap); } - var previous = clone3; - parent2 = parent2.__wrapped__; - } - previous.__wrapped__ = value; - return result2; - } - function wrapperReverse() { - var value = this.__wrapped__; - if (value instanceof LazyWrapper) { - var wrapped = value; - if (this.__actions__.length) { - wrapped = new LazyWrapper(this); + }, + deactivateTrap: function deactivateTrap(trap) { + var trapIndex = trapQueue.indexOf(trap); + if (trapIndex !== -1) { + trapQueue.splice(trapIndex, 1); } - wrapped = wrapped.reverse(); - wrapped.__actions__.push({ - "func": thru, - "args": [reverse], - "thisArg": undefined2 - }); - return new LodashWrapper(wrapped, this.__chain__); + if (trapQueue.length > 0) { + trapQueue[trapQueue.length - 1].unpause(); + } } - return this.thru(reverse); - } - function wrapperValue() { - return baseWrapperValue(this.__wrapped__, this.__actions__); - } - var countBy = createAggregator(function(result2, value, key) { - if (hasOwnProperty3.call(result2, key)) { - ++result2[key]; - } else { - baseAssignValue(result2, key, 1); + }; + }(); + var isSelectableInput = function isSelectableInput2(node) { + return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function"; + }; + var isEscapeEvent = function isEscapeEvent2(e2) { + return e2.key === "Escape" || e2.key === "Esc" || e2.keyCode === 27; + }; + var isTabEvent = function isTabEvent2(e2) { + return e2.key === "Tab" || e2.keyCode === 9; + }; + var delay = function delay2(fn) { + return setTimeout(fn, 0); + }; + var findIndex = function findIndex2(arr, fn) { + var idx = -1; + arr.every(function(value, i2) { + if (fn(value)) { + idx = i2; + return false; } + return true; }); - function every(collection, predicate, guard) { - var func = isArray2(collection) ? arrayEvery : baseEvery; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined2; - } - return func(collection, getIteratee(predicate, 3)); + return idx; + }; + var valueOrHandler = function valueOrHandler2(value) { + for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + params[_key - 1] = arguments[_key]; } - function filter(collection, predicate) { - var func = isArray2(collection) ? arrayFilter : baseFilter; - return func(collection, getIteratee(predicate, 3)); - } - var find = createFind(findIndex3); - var findLast = createFind(findLastIndex); - function flatMap(collection, iteratee2) { - return baseFlatten(map(collection, iteratee2), 1); - } - function flatMapDeep(collection, iteratee2) { - return baseFlatten(map(collection, iteratee2), INFINITY); - } - function flatMapDepth(collection, iteratee2, depth) { - depth = depth === undefined2 ? 1 : toInteger(depth); - return baseFlatten(map(collection, iteratee2), depth); - } - function forEach(collection, iteratee2) { - var func = isArray2(collection) ? arrayEach : baseEach; - return func(collection, getIteratee(iteratee2, 3)); - } - function forEachRight(collection, iteratee2) { - var func = isArray2(collection) ? arrayEachRight : baseEachRight; - return func(collection, getIteratee(iteratee2, 3)); - } - var groupBy = createAggregator(function(result2, value, key) { - if (hasOwnProperty3.call(result2, key)) { - result2[key].push(value); - } else { - baseAssignValue(result2, key, [value]); - } - }); - function includes(collection, value, fromIndex, guard) { - collection = isArrayLike(collection) ? collection : values(collection); - fromIndex = fromIndex && !guard ? toInteger(fromIndex) : 0; - var length = collection.length; - if (fromIndex < 0) { - fromIndex = nativeMax(length + fromIndex, 0); - } - return isString2(collection) ? fromIndex <= length && collection.indexOf(value, fromIndex) > -1 : !!length && baseIndexOf(collection, value, fromIndex) > -1; - } - var invokeMap = baseRest(function(collection, path, args) { - var index = -1, isFunc = typeof path == "function", result2 = isArrayLike(collection) ? Array2(collection.length) : []; - baseEach(collection, function(value) { - result2[++index] = isFunc ? apply(path, value, args) : baseInvoke(value, path, args); + return typeof value === "function" ? value.apply(void 0, params) : value; + }; + var getActualTarget = function getActualTarget2(event) { + return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target; + }; + var createFocusTrap2 = function createFocusTrap3(elements, userOptions) { + var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document; + var config = _objectSpread2({ + returnFocusOnDeactivate: true, + escapeDeactivates: true, + delayInitialFocus: true + }, userOptions); + var state = { + // containers given to createFocusTrap() + // @type {Array<HTMLElement>} + containers: [], + // list of objects identifying tabbable nodes in `containers` in the trap + // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap + // is active, but the trap should never get to a state where there isn't at least one group + // with at least one tabbable node in it (that would lead to an error condition that would + // result in an error being thrown) + // @type {Array<{ + // container: HTMLElement, + // tabbableNodes: Array<HTMLElement>, // empty if none + // focusableNodes: Array<HTMLElement>, // empty if none + // firstTabbableNode: HTMLElement|null, + // lastTabbableNode: HTMLElement|null, + // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined + // }>} + containerGroups: [], + // same order/length as `containers` list + // references to objects in `containerGroups`, but only those that actually have + // tabbable nodes in them + // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__ + // the same length + tabbableGroups: [], + nodeFocusedBeforeActivation: null, + mostRecentlyFocusedNode: null, + active: false, + paused: false, + // timer ID for when delayInitialFocus is true and initial focus in this trap + // has been delayed during activation + delayInitialFocusTimer: void 0 + }; + var trap; + var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) { + return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName]; + }; + var findContainerIndex = function findContainerIndex2(element) { + return state.containerGroups.findIndex(function(_ref) { + var container = _ref.container, tabbableNodes = _ref.tabbableNodes; + return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any + // web components if the `tabbableOptions.getShadowRoot` option was used for + // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't + // look inside web components even if open) + tabbableNodes.find(function(node) { + return node === element; + }); }); - return result2; - }); - var keyBy2 = createAggregator(function(result2, value, key) { - baseAssignValue(result2, key, value); - }); - function map(collection, iteratee2) { - var func = isArray2(collection) ? arrayMap : baseMap; - return func(collection, getIteratee(iteratee2, 3)); - } - function orderBy(collection, iteratees, orders, guard) { - if (collection == null) { - return []; - } - if (!isArray2(iteratees)) { - iteratees = iteratees == null ? [] : [iteratees]; - } - orders = guard ? undefined2 : orders; - if (!isArray2(orders)) { - orders = orders == null ? [] : [orders]; - } - return baseOrderBy(collection, iteratees, orders); - } - var partition = createAggregator(function(result2, value, key) { - result2[key ? 0 : 1].push(value); - }, function() { - return [[], []]; - }); - function reduce(collection, iteratee2, accumulator) { - var func = isArray2(collection) ? arrayReduce : baseReduce, initAccum = arguments.length < 3; - return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEach); - } - function reduceRight(collection, iteratee2, accumulator) { - var func = isArray2(collection) ? arrayReduceRight : baseReduce, initAccum = arguments.length < 3; - return func(collection, getIteratee(iteratee2, 4), accumulator, initAccum, baseEachRight); - } - function reject(collection, predicate) { - var func = isArray2(collection) ? arrayFilter : baseFilter; - return func(collection, negate(getIteratee(predicate, 3))); - } - function sample(collection) { - var func = isArray2(collection) ? arraySample : baseSample; - return func(collection); - } - function sampleSize(collection, n3, guard) { - if (guard ? isIterateeCall(collection, n3, guard) : n3 === undefined2) { - n3 = 1; - } else { - n3 = toInteger(n3); - } - var func = isArray2(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n3); - } - function shuffle(collection) { - var func = isArray2(collection) ? arrayShuffle : baseShuffle; - return func(collection); - } - function size2(collection) { - if (collection == null) { - return 0; - } - if (isArrayLike(collection)) { - return isString2(collection) ? stringSize(collection) : collection.length; - } - var tag = getTag(collection); - if (tag == mapTag || tag == setTag) { - return collection.size; - } - return baseKeys(collection).length; - } - function some(collection, predicate, guard) { - var func = isArray2(collection) ? arraySome : baseSome; - if (guard && isIterateeCall(collection, predicate, guard)) { - predicate = undefined2; - } - return func(collection, getIteratee(predicate, 3)); - } - var sortBy = baseRest(function(collection, iteratees) { - if (collection == null) { - return []; - } - var length = iteratees.length; - if (length > 1 && isIterateeCall(collection, iteratees[0], iteratees[1])) { - iteratees = []; - } else if (length > 2 && isIterateeCall(iteratees[0], iteratees[1], iteratees[2])) { - iteratees = [iteratees[0]]; - } - return baseOrderBy(collection, baseFlatten(iteratees, 1), []); - }); - var now = ctxNow || function() { - return root.Date.now(); }; - function after(n3, func) { - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); - } - n3 = toInteger(n3); - return function() { - if (--n3 < 1) { - return func.apply(this, arguments); + var getNodeForOption = function getNodeForOption2(optionName) { + var optionValue = config[optionName]; + if (typeof optionValue === "function") { + for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { + params[_key2 - 1] = arguments[_key2]; } - }; - } - function ary(func, n3, guard) { - n3 = guard ? undefined2 : n3; - n3 = func && n3 == null ? func.length : n3; - return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n3); - } - function before(n3, func) { - var result2; - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + optionValue = optionValue.apply(void 0, params); } - n3 = toInteger(n3); - return function() { - if (--n3 > 0) { - result2 = func.apply(this, arguments); - } - if (n3 <= 1) { - func = undefined2; - } - return result2; - }; - } - var bind3 = baseRest(function(func, thisArg, partials) { - var bitmask = WRAP_BIND_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bind3)); - bitmask |= WRAP_PARTIAL_FLAG; + if (optionValue === true) { + optionValue = void 0; } - return createWrap(func, bitmask, thisArg, partials, holders); - }); - var bindKey = baseRest(function(object, key, partials) { - var bitmask = WRAP_BIND_FLAG | WRAP_BIND_KEY_FLAG; - if (partials.length) { - var holders = replaceHolders(partials, getHolder(bindKey)); - bitmask |= WRAP_PARTIAL_FLAG; - } - return createWrap(key, bitmask, object, partials, holders); - }); - function curry(func, arity, guard) { - arity = guard ? undefined2 : arity; - var result2 = createWrap(func, WRAP_CURRY_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); - result2.placeholder = curry.placeholder; - return result2; - } - function curryRight(func, arity, guard) { - arity = guard ? undefined2 : arity; - var result2 = createWrap(func, WRAP_CURRY_RIGHT_FLAG, undefined2, undefined2, undefined2, undefined2, undefined2, arity); - result2.placeholder = curryRight.placeholder; - return result2; - } - function debounce4(func, wait, options) { - var lastArgs, lastThis, maxWait, result2, timerId, lastCallTime, lastInvokeTime = 0, leading = false, maxing = false, trailing = true; - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); - } - wait = toNumber(wait) || 0; - if (isObject3(options)) { - leading = !!options.leading; - maxing = "maxWait" in options; - maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait; - trailing = "trailing" in options ? !!options.trailing : trailing; - } - function invokeFunc(time) { - var args = lastArgs, thisArg = lastThis; - lastArgs = lastThis = undefined2; - lastInvokeTime = time; - result2 = func.apply(thisArg, args); - return result2; - } - function leadingEdge(time) { - lastInvokeTime = time; - timerId = setTimeout2(timerExpired, wait); - return leading ? invokeFunc(time) : result2; - } - function remainingWait(time) { - var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime, timeWaiting = wait - timeSinceLastCall; - return maxing ? nativeMin(timeWaiting, maxWait - timeSinceLastInvoke) : timeWaiting; - } - function shouldInvoke(time) { - var timeSinceLastCall = time - lastCallTime, timeSinceLastInvoke = time - lastInvokeTime; - return lastCallTime === undefined2 || timeSinceLastCall >= wait || timeSinceLastCall < 0 || maxing && timeSinceLastInvoke >= maxWait; - } - function timerExpired() { - var time = now(); - if (shouldInvoke(time)) { - return trailingEdge(time); + if (!optionValue) { + if (optionValue === void 0 || optionValue === false) { + return optionValue; } - timerId = setTimeout2(timerExpired, remainingWait(time)); + throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node")); } - function trailingEdge(time) { - timerId = undefined2; - if (trailing && lastArgs) { - return invokeFunc(time); + var node = optionValue; + if (typeof optionValue === "string") { + node = doc.querySelector(optionValue); + if (!node) { + throw new Error("`".concat(optionName, "` as selector refers to no known node")); } - lastArgs = lastThis = undefined2; - return result2; } - function cancel() { - if (timerId !== undefined2) { - clearTimeout2(timerId); - } - lastInvokeTime = 0; - lastArgs = lastCallTime = lastThis = timerId = undefined2; + return node; + }; + var getInitialFocusNode = function getInitialFocusNode2() { + var node = getNodeForOption("initialFocus"); + if (node === false) { + return false; } - function flush() { - return timerId === undefined2 ? result2 : trailingEdge(now()); - } - function debounced() { - var time = now(), isInvoking = shouldInvoke(time); - lastArgs = arguments; - lastThis = this; - lastCallTime = time; - if (isInvoking) { - if (timerId === undefined2) { - return leadingEdge(lastCallTime); - } - if (maxing) { - clearTimeout2(timerId); - timerId = setTimeout2(timerExpired, wait); - return invokeFunc(lastCallTime); - } + if (node === void 0) { + if (findContainerIndex(doc.activeElement) >= 0) { + node = doc.activeElement; + } else { + var firstTabbableGroup = state.tabbableGroups[0]; + var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; + node = firstTabbableNode || getNodeForOption("fallbackFocus"); } - if (timerId === undefined2) { - timerId = setTimeout2(timerExpired, wait); - } - return result2; } - debounced.cancel = cancel; - debounced.flush = flush; - return debounced; - } - var defer = baseRest(function(func, args) { - return baseDelay(func, 1, args); - }); - var delay3 = baseRest(function(func, wait, args) { - return baseDelay(func, toNumber(wait) || 0, args); - }); - function flip2(func) { - return createWrap(func, WRAP_FLIP_FLAG); - } - function memoize(func, resolver) { - if (typeof func != "function" || resolver != null && typeof resolver != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + if (!node) { + throw new Error("Your focus-trap needs to have at least one focusable element"); } - var memoized = function() { - var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; - if (cache.has(key)) { - return cache.get(key); - } - var result2 = func.apply(this, args); - memoized.cache = cache.set(key, result2) || cache; - return result2; - }; - memoized.cache = new (memoize.Cache || MapCache)(); - return memoized; - } - memoize.Cache = MapCache; - function negate(predicate) { - if (typeof predicate != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); - } - return function() { - var args = arguments; - switch (args.length) { - case 0: - return !predicate.call(this); - case 1: - return !predicate.call(this, args[0]); - case 2: - return !predicate.call(this, args[0], args[1]); - case 3: - return !predicate.call(this, args[0], args[1], args[2]); - } - return !predicate.apply(this, args); - }; - } - function once2(func) { - return before(2, func); - } - var overArgs = castRest(function(func, transforms) { - transforms = transforms.length == 1 && isArray2(transforms[0]) ? arrayMap(transforms[0], baseUnary(getIteratee())) : arrayMap(baseFlatten(transforms, 1), baseUnary(getIteratee())); - var funcsLength = transforms.length; - return baseRest(function(args) { - var index = -1, length = nativeMin(args.length, funcsLength); - while (++index < length) { - args[index] = transforms[index].call(this, args[index]); - } - return apply(func, this, args); + return node; + }; + var updateTabbableNodes = function updateTabbableNodes2() { + state.containerGroups = state.containers.map(function(container) { + var tabbableNodes = tabbable.tabbable(container, config.tabbableOptions); + var focusableNodes = tabbable.focusable(container, config.tabbableOptions); + return { + container, + tabbableNodes, + focusableNodes, + firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null, + lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null, + /** + * Finds the __tabbable__ node that follows the given node in the specified direction, + * in this container, if any. + * @param {HTMLElement} node + * @param {boolean} [forward] True if going in forward tab order; false if going + * in reverse. + * @returns {HTMLElement|undefined} The next tabbable node, if any. + */ + nextTabbableNode: function nextTabbableNode(node) { + var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; + var nodeIdx = focusableNodes.findIndex(function(n2) { + return n2 === node; + }); + if (nodeIdx < 0) { + return void 0; + } + if (forward) { + return focusableNodes.slice(nodeIdx + 1).find(function(n2) { + return tabbable.isTabbable(n2, config.tabbableOptions); + }); + } + return focusableNodes.slice(0, nodeIdx).reverse().find(function(n2) { + return tabbable.isTabbable(n2, config.tabbableOptions); + }); + } + }; }); - }); - var partial = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partial)); - return createWrap(func, WRAP_PARTIAL_FLAG, undefined2, partials, holders); - }); - var partialRight = baseRest(function(func, partials) { - var holders = replaceHolders(partials, getHolder(partialRight)); - return createWrap(func, WRAP_PARTIAL_RIGHT_FLAG, undefined2, partials, holders); - }); - var rearg = flatRest(function(func, indexes) { - return createWrap(func, WRAP_REARG_FLAG, undefined2, undefined2, undefined2, indexes); - }); - function rest(func, start3) { - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + state.tabbableGroups = state.containerGroups.filter(function(group) { + return group.tabbableNodes.length > 0; + }); + if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) { + throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times"); } - start3 = start3 === undefined2 ? start3 : toInteger(start3); - return baseRest(func, start3); - } - function spread(func, start3) { - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + }; + var tryFocus = function tryFocus2(node) { + if (node === false) { + return; } - start3 = start3 == null ? 0 : nativeMax(toInteger(start3), 0); - return baseRest(function(args) { - var array = args[start3], otherArgs = castSlice(args, 0, start3); - if (array) { - arrayPush(otherArgs, array); - } - return apply(func, this, otherArgs); - }); - } - function throttle2(func, wait, options) { - var leading = true, trailing = true; - if (typeof func != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + if (node === doc.activeElement) { + return; } - if (isObject3(options)) { - leading = "leading" in options ? !!options.leading : leading; - trailing = "trailing" in options ? !!options.trailing : trailing; + if (!node || !node.focus) { + tryFocus2(getInitialFocusNode()); + return; } - return debounce4(func, wait, { - "leading": leading, - "maxWait": wait, - "trailing": trailing + node.focus({ + preventScroll: !!config.preventScroll }); - } - function unary(func) { - return ary(func, 1); - } - function wrap(value, wrapper) { - return partial(castFunction(wrapper), value); - } - function castArray() { - if (!arguments.length) { - return []; + state.mostRecentlyFocusedNode = node; + if (isSelectableInput(node)) { + node.select(); } - var value = arguments[0]; - return isArray2(value) ? value : [value]; - } - function clone2(value) { - return baseClone(value, CLONE_SYMBOLS_FLAG); - } - function cloneWith(value, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined2; - return baseClone(value, CLONE_SYMBOLS_FLAG, customizer); - } - function cloneDeep(value) { - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG); - } - function cloneDeepWith(value, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined2; - return baseClone(value, CLONE_DEEP_FLAG | CLONE_SYMBOLS_FLAG, customizer); - } - function conformsTo(object, source) { - return source == null || baseConformsTo(object, source, keys(source)); - } - function eq(value, other) { - return value === other || value !== value && other !== other; - } - var gt = createRelationalOperation(baseGt); - var gte = createRelationalOperation(function(value, other) { - return value >= other; - }); - var isArguments = baseIsArguments(/* @__PURE__ */ function() { - return arguments; - }()) ? baseIsArguments : function(value) { - return isObjectLike(value) && hasOwnProperty3.call(value, "callee") && !propertyIsEnumerable.call(value, "callee"); }; - var isArray2 = Array2.isArray; - var isArrayBuffer = nodeIsArrayBuffer ? baseUnary(nodeIsArrayBuffer) : baseIsArrayBuffer; - function isArrayLike(value) { - return value != null && isLength(value.length) && !isFunction(value); - } - function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); - } - function isBoolean(value) { - return value === true || value === false || isObjectLike(value) && baseGetTag(value) == boolTag; - } - var isBuffer = nativeIsBuffer || stubFalse; - var isDate = nodeIsDate ? baseUnary(nodeIsDate) : baseIsDate; - function isElement3(value) { - return isObjectLike(value) && value.nodeType === 1 && !isPlainObject(value); - } - function isEmpty(value) { - if (value == null) { - return true; + var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) { + var node = getNodeForOption("setReturnFocus", previousActiveElement); + return node ? node : node === false ? false : previousActiveElement; + }; + var checkPointerDown = function checkPointerDown2(e2) { + var target = getActualTarget(e2); + if (findContainerIndex(target) >= 0) { + return; } - if (isArrayLike(value) && (isArray2(value) || typeof value == "string" || typeof value.splice == "function" || isBuffer(value) || isTypedArray(value) || isArguments(value))) { - return !value.length; + if (valueOrHandler(config.clickOutsideDeactivates, e2)) { + trap.deactivate({ + // if, on deactivation, we should return focus to the node originally-focused + // when the trap was activated (or the configured `setReturnFocus` node), + // then assume it's also OK to return focus to the outside node that was + // just clicked, causing deactivation, as long as that node is focusable; + // if it isn't focusable, then return focus to the original node focused + // on activation (or the configured `setReturnFocus` node) + // NOTE: by setting `returnFocus: false`, deactivate() will do nothing, + // which will result in the outside click setting focus to the node + // that was clicked, whether it's focusable or not; by setting + // `returnFocus: true`, we'll attempt to re-focus the node originally-focused + // on activation (or the configured `setReturnFocus` node) + returnFocus: config.returnFocusOnDeactivate && !tabbable.isFocusable(target, config.tabbableOptions) + }); + return; } - var tag = getTag(value); - if (tag == mapTag || tag == setTag) { - return !value.size; - } - if (isPrototype(value)) { - return !baseKeys(value).length; - } - for (var key in value) { - if (hasOwnProperty3.call(value, key)) { - return false; - } - } - return true; - } - function isEqual(value, other) { - return baseIsEqual(value, other); - } - function isEqualWith(value, other, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined2; - var result2 = customizer ? customizer(value, other) : undefined2; - return result2 === undefined2 ? baseIsEqual(value, other, undefined2, customizer) : !!result2; - } - function isError(value) { - if (!isObjectLike(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == errorTag || tag == domExcTag || typeof value.message == "string" && typeof value.name == "string" && !isPlainObject(value); - } - function isFinite(value) { - return typeof value == "number" && nativeIsFinite(value); - } - function isFunction(value) { - if (!isObject3(value)) { - return false; - } - var tag = baseGetTag(value); - return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag; - } - function isInteger(value) { - return typeof value == "number" && value == toInteger(value); - } - function isLength(value) { - return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; - } - function isObject3(value) { - var type = typeof value; - return value != null && (type == "object" || type == "function"); - } - function isObjectLike(value) { - return value != null && typeof value == "object"; - } - var isMap2 = nodeIsMap ? baseUnary(nodeIsMap) : baseIsMap; - function isMatch(object, source) { - return object === source || baseIsMatch(object, source, getMatchData(source)); - } - function isMatchWith(object, source, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined2; - return baseIsMatch(object, source, getMatchData(source), customizer); - } - function isNaN2(value) { - return isNumber(value) && value != +value; - } - function isNative(value) { - if (isMaskable(value)) { - throw new Error2(CORE_ERROR_TEXT); - } - return baseIsNative(value); - } - function isNull(value) { - return value === null; - } - function isNil(value) { - return value == null; - } - function isNumber(value) { - return typeof value == "number" || isObjectLike(value) && baseGetTag(value) == numberTag; - } - function isPlainObject(value) { - if (!isObjectLike(value) || baseGetTag(value) != objectTag) { - return false; - } - var proto = getPrototype(value); - if (proto === null) { - return true; - } - var Ctor = hasOwnProperty3.call(proto, "constructor") && proto.constructor; - return typeof Ctor == "function" && Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString; - } - var isRegExp = nodeIsRegExp ? baseUnary(nodeIsRegExp) : baseIsRegExp; - function isSafeInteger(value) { - return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER; - } - var isSet = nodeIsSet ? baseUnary(nodeIsSet) : baseIsSet; - function isString2(value) { - return typeof value == "string" || !isArray2(value) && isObjectLike(value) && baseGetTag(value) == stringTag; - } - function isSymbol2(value) { - return typeof value == "symbol" || isObjectLike(value) && baseGetTag(value) == symbolTag; - } - var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; - function isUndefined(value) { - return value === undefined2; - } - function isWeakMap(value) { - return isObjectLike(value) && getTag(value) == weakMapTag; - } - function isWeakSet(value) { - return isObjectLike(value) && baseGetTag(value) == weakSetTag; - } - var lt2 = createRelationalOperation(baseLt); - var lte = createRelationalOperation(function(value, other) { - return value <= other; - }); - function toArray(value) { - if (!value) { - return []; - } - if (isArrayLike(value)) { - return isString2(value) ? stringToArray(value) : copyArray(value); - } - if (symIterator && value[symIterator]) { - return iteratorToArray(value[symIterator]()); - } - var tag = getTag(value), func = tag == mapTag ? mapToArray : tag == setTag ? setToArray : values; - return func(value); - } - function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = value < 0 ? -1 : 1; - return sign * MAX_INTEGER; - } - return value === value ? value : 0; - } - function toInteger(value) { - var result2 = toFinite(value), remainder = result2 % 1; - return result2 === result2 ? remainder ? result2 - remainder : result2 : 0; - } - function toLength(value) { - return value ? baseClamp(toInteger(value), 0, MAX_ARRAY_LENGTH) : 0; - } - function toNumber(value) { - if (typeof value == "number") { - return value; - } - if (isSymbol2(value)) { - return NAN; - } - if (isObject3(value)) { - var other = typeof value.valueOf == "function" ? value.valueOf() : value; - value = isObject3(other) ? other + "" : other; - } - if (typeof value != "string") { - return value === 0 ? value : +value; - } - value = baseTrim(value); - var isBinary = reIsBinary.test(value); - return isBinary || reIsOctal.test(value) ? freeParseInt(value.slice(2), isBinary ? 2 : 8) : reIsBadHex.test(value) ? NAN : +value; - } - function toPlainObject(value) { - return copyObject(value, keysIn(value)); - } - function toSafeInteger(value) { - return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; - } - function toString(value) { - return value == null ? "" : baseToString(value); - } - var assign2 = createAssigner(function(object, source) { - if (isPrototype(source) || isArrayLike(source)) { - copyObject(source, keys(source), object); + if (valueOrHandler(config.allowOutsideClick, e2)) { return; } - for (var key in source) { - if (hasOwnProperty3.call(source, key)) { - assignValue(object, key, source[key]); + e2.preventDefault(); + }; + var checkFocusIn = function checkFocusIn2(e2) { + var target = getActualTarget(e2); + var targetContained = findContainerIndex(target) >= 0; + if (targetContained || target instanceof Document) { + if (targetContained) { + state.mostRecentlyFocusedNode = target; } + } else { + e2.stopImmediatePropagation(); + tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); } - }); - var assignIn = createAssigner(function(object, source) { - copyObject(source, keysIn(source), object); - }); - var assignInWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keysIn(source), object, customizer); - }); - var assignWith = createAssigner(function(object, source, srcIndex, customizer) { - copyObject(source, keys(source), object, customizer); - }); - var at2 = flatRest(baseAt); - function create(prototype, properties) { - var result2 = baseCreate(prototype); - return properties == null ? result2 : baseAssign(result2, properties); - } - var defaults = baseRest(function(object, sources) { - object = Object2(object); - var index = -1; - var length = sources.length; - var guard = length > 2 ? sources[2] : undefined2; - if (guard && isIterateeCall(sources[0], sources[1], guard)) { - length = 1; - } - while (++index < length) { - var source = sources[index]; - var props = keysIn(source); - var propsIndex = -1; - var propsLength = props.length; - while (++propsIndex < propsLength) { - var key = props[propsIndex]; - var value = object[key]; - if (value === undefined2 || eq(value, objectProto[key]) && !hasOwnProperty3.call(object, key)) { - object[key] = source[key]; + }; + var checkTab = function checkTab2(e2) { + var target = getActualTarget(e2); + updateTabbableNodes(); + var destinationNode = null; + if (state.tabbableGroups.length > 0) { + var containerIndex = findContainerIndex(target); + var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0; + if (containerIndex < 0) { + if (e2.shiftKey) { + destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode; + } else { + destinationNode = state.tabbableGroups[0].firstTabbableNode; } + } else if (e2.shiftKey) { + var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) { + var firstTabbableNode = _ref2.firstTabbableNode; + return target === firstTabbableNode; + }); + if (startOfGroupIndex < 0 && (containerGroup.container === target || tabbable.isFocusable(target, config.tabbableOptions) && !tabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) { + startOfGroupIndex = containerIndex; + } + if (startOfGroupIndex >= 0) { + var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1; + var destinationGroup = state.tabbableGroups[destinationGroupIndex]; + destinationNode = destinationGroup.lastTabbableNode; + } + } else { + var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) { + var lastTabbableNode = _ref3.lastTabbableNode; + return target === lastTabbableNode; + }); + if (lastOfGroupIndex < 0 && (containerGroup.container === target || tabbable.isFocusable(target, config.tabbableOptions) && !tabbable.isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) { + lastOfGroupIndex = containerIndex; + } + if (lastOfGroupIndex >= 0) { + var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1; + var _destinationGroup = state.tabbableGroups[_destinationGroupIndex]; + destinationNode = _destinationGroup.firstTabbableNode; + } } + } else { + destinationNode = getNodeForOption("fallbackFocus"); } - return object; - }); - var defaultsDeep = baseRest(function(args) { - args.push(undefined2, customDefaultsMerge); - return apply(mergeWith, undefined2, args); - }); - function findKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwn); - } - function findLastKey(object, predicate) { - return baseFindKey(object, getIteratee(predicate, 3), baseForOwnRight); - } - function forIn(object, iteratee2) { - return object == null ? object : baseFor(object, getIteratee(iteratee2, 3), keysIn); - } - function forInRight(object, iteratee2) { - return object == null ? object : baseForRight(object, getIteratee(iteratee2, 3), keysIn); - } - function forOwn(object, iteratee2) { - return object && baseForOwn(object, getIteratee(iteratee2, 3)); - } - function forOwnRight(object, iteratee2) { - return object && baseForOwnRight(object, getIteratee(iteratee2, 3)); - } - function functions(object) { - return object == null ? [] : baseFunctions(object, keys(object)); - } - function functionsIn(object) { - return object == null ? [] : baseFunctions(object, keysIn(object)); - } - function get3(object, path, defaultValue) { - var result2 = object == null ? undefined2 : baseGet(object, path); - return result2 === undefined2 ? defaultValue : result2; - } - function has2(object, path) { - return object != null && hasPath(object, path, baseHas); - } - function hasIn(object, path) { - return object != null && hasPath(object, path, baseHasIn); - } - var invert = createInverter(function(result2, value, key) { - if (value != null && typeof value.toString != "function") { - value = nativeObjectToString.call(value); + if (destinationNode) { + e2.preventDefault(); + tryFocus(destinationNode); } - result2[value] = key; - }, constant(identity)); - var invertBy = createInverter(function(result2, value, key) { - if (value != null && typeof value.toString != "function") { - value = nativeObjectToString.call(value); + }; + var checkKey = function checkKey2(e2) { + if (isEscapeEvent(e2) && valueOrHandler(config.escapeDeactivates, e2) !== false) { + e2.preventDefault(); + trap.deactivate(); + return; } - if (hasOwnProperty3.call(result2, value)) { - result2[value].push(key); - } else { - result2[value] = [key]; + if (isTabEvent(e2)) { + checkTab(e2); + return; } - }, getIteratee); - var invoke = baseRest(baseInvoke); - function keys(object) { - return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); - } - function keysIn(object) { - return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object); - } - function mapKeys(object, iteratee2) { - var result2 = {}; - iteratee2 = getIteratee(iteratee2, 3); - baseForOwn(object, function(value, key, object2) { - baseAssignValue(result2, iteratee2(value, key, object2), value); - }); - return result2; - } - function mapValues2(object, iteratee2) { - var result2 = {}; - iteratee2 = getIteratee(iteratee2, 3); - baseForOwn(object, function(value, key, object2) { - baseAssignValue(result2, key, iteratee2(value, key, object2)); - }); - return result2; - } - var merge = createAssigner(function(object, source, srcIndex) { - baseMerge(object, source, srcIndex); - }); - var mergeWith = createAssigner(function(object, source, srcIndex, customizer) { - baseMerge(object, source, srcIndex, customizer); - }); - var omit = flatRest(function(object, paths) { - var result2 = {}; - if (object == null) { - return result2; + }; + var checkClick = function checkClick2(e2) { + var target = getActualTarget(e2); + if (findContainerIndex(target) >= 0) { + return; } - var isDeep = false; - paths = arrayMap(paths, function(path) { - path = castPath(path, object); - isDeep || (isDeep = path.length > 1); - return path; - }); - copyObject(object, getAllKeysIn(object), result2); - if (isDeep) { - result2 = baseClone(result2, CLONE_DEEP_FLAG | CLONE_FLAT_FLAG | CLONE_SYMBOLS_FLAG, customOmitClone); + if (valueOrHandler(config.clickOutsideDeactivates, e2)) { + return; } - var length = paths.length; - while (length--) { - baseUnset(result2, paths[length]); + if (valueOrHandler(config.allowOutsideClick, e2)) { + return; } - return result2; - }); - function omitBy(object, predicate) { - return pickBy(object, negate(getIteratee(predicate))); - } - var pick = flatRest(function(object, paths) { - return object == null ? {} : basePick(object, paths); - }); - function pickBy(object, predicate) { - if (object == null) { - return {}; + e2.preventDefault(); + e2.stopImmediatePropagation(); + }; + var addListeners = function addListeners2() { + if (!state.active) { + return; } - var props = arrayMap(getAllKeysIn(object), function(prop) { - return [prop]; + activeFocusTraps.activateTrap(trap); + state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() { + tryFocus(getInitialFocusNode()); + }) : tryFocus(getInitialFocusNode()); + doc.addEventListener("focusin", checkFocusIn, true); + doc.addEventListener("mousedown", checkPointerDown, { + capture: true, + passive: false }); - predicate = getIteratee(predicate); - return basePickBy(object, props, function(value, path) { - return predicate(value, path[0]); + doc.addEventListener("touchstart", checkPointerDown, { + capture: true, + passive: false }); - } - function result(object, path, defaultValue) { - path = castPath(path, object); - var index = -1, length = path.length; - if (!length) { - length = 1; - object = undefined2; - } - while (++index < length) { - var value = object == null ? undefined2 : object[toKey(path[index])]; - if (value === undefined2) { - index = length; - value = defaultValue; - } - object = isFunction(value) ? value.call(object) : value; - } - return object; - } - function set3(object, path, value) { - return object == null ? object : baseSet(object, path, value); - } - function setWith(object, path, value, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined2; - return object == null ? object : baseSet(object, path, value, customizer); - } - var toPairs2 = createToPairs(keys); - var toPairsIn = createToPairs(keysIn); - function transform(object, iteratee2, accumulator) { - var isArr = isArray2(object), isArrLike = isArr || isBuffer(object) || isTypedArray(object); - iteratee2 = getIteratee(iteratee2, 4); - if (accumulator == null) { - var Ctor = object && object.constructor; - if (isArrLike) { - accumulator = isArr ? new Ctor() : []; - } else if (isObject3(object)) { - accumulator = isFunction(Ctor) ? baseCreate(getPrototype(object)) : {}; - } else { - accumulator = {}; - } - } - (isArrLike ? arrayEach : baseForOwn)(object, function(value, index, object2) { - return iteratee2(accumulator, value, index, object2); + doc.addEventListener("click", checkClick, { + capture: true, + passive: false }); - return accumulator; - } - function unset(object, path) { - return object == null ? true : baseUnset(object, path); - } - function update(object, path, updater) { - return object == null ? object : baseUpdate(object, path, castFunction(updater)); - } - function updateWith(object, path, updater, customizer) { - customizer = typeof customizer == "function" ? customizer : undefined2; - return object == null ? object : baseUpdate(object, path, castFunction(updater), customizer); - } - function values(object) { - return object == null ? [] : baseValues(object, keys(object)); - } - function valuesIn(object) { - return object == null ? [] : baseValues(object, keysIn(object)); - } - function clamp2(number, lower, upper) { - if (upper === undefined2) { - upper = lower; - lower = undefined2; + doc.addEventListener("keydown", checkKey, { + capture: true, + passive: false + }); + return trap; + }; + var removeListeners = function removeListeners2() { + if (!state.active) { + return; } - if (upper !== undefined2) { - upper = toNumber(upper); - upper = upper === upper ? upper : 0; - } - if (lower !== undefined2) { - lower = toNumber(lower); - lower = lower === lower ? lower : 0; - } - return baseClamp(toNumber(number), lower, upper); - } - function inRange(number, start3, end2) { - start3 = toFinite(start3); - if (end2 === undefined2) { - end2 = start3; - start3 = 0; - } else { - end2 = toFinite(end2); - } - number = toNumber(number); - return baseInRange(number, start3, end2); - } - function random(lower, upper, floating) { - if (floating && typeof floating != "boolean" && isIterateeCall(lower, upper, floating)) { - upper = floating = undefined2; - } - if (floating === undefined2) { - if (typeof upper == "boolean") { - floating = upper; - upper = undefined2; - } else if (typeof lower == "boolean") { - floating = lower; - lower = undefined2; + doc.removeEventListener("focusin", checkFocusIn, true); + doc.removeEventListener("mousedown", checkPointerDown, true); + doc.removeEventListener("touchstart", checkPointerDown, true); + doc.removeEventListener("click", checkClick, true); + doc.removeEventListener("keydown", checkKey, true); + return trap; + }; + trap = { + get active() { + return state.active; + }, + get paused() { + return state.paused; + }, + activate: function activate(activateOptions) { + if (state.active) { + return this; } - } - if (lower === undefined2 && upper === undefined2) { - lower = 0; - upper = 1; - } else { - lower = toFinite(lower); - if (upper === undefined2) { - upper = lower; - lower = 0; - } else { - upper = toFinite(upper); + var onActivate = getOption(activateOptions, "onActivate"); + var onPostActivate = getOption(activateOptions, "onPostActivate"); + var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap"); + if (!checkCanFocusTrap) { + updateTabbableNodes(); } - } - if (lower > upper) { - var temp = lower; - lower = upper; - upper = temp; - } - if (floating || lower % 1 || upper % 1) { - var rand = nativeRandom(); - return nativeMin(lower + rand * (upper - lower + freeParseFloat("1e-" + ((rand + "").length - 1))), upper); - } - return baseRandom(lower, upper); - } - var camelCase5 = createCompounder(function(result2, word, index) { - word = word.toLowerCase(); - return result2 + (index ? capitalize2(word) : word); - }); - function capitalize2(string) { - return upperFirst(toString(string).toLowerCase()); - } - function deburr(string) { - string = toString(string); - return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); - } - function endsWith(string, target, position) { - string = toString(string); - target = baseToString(target); - var length = string.length; - position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length); - var end2 = position; - position -= target.length; - return position >= 0 && string.slice(position, end2) == target; - } - function escape2(string) { - string = toString(string); - return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; - } - function escapeRegExp(string) { - string = toString(string); - return string && reHasRegExpChar.test(string) ? string.replace(reRegExpChar, "\\$&") : string; - } - var kebabCase4 = createCompounder(function(result2, word, index) { - return result2 + (index ? "-" : "") + word.toLowerCase(); - }); - var lowerCase = createCompounder(function(result2, word, index) { - return result2 + (index ? " " : "") + word.toLowerCase(); - }); - var lowerFirst = createCaseFirst("toLowerCase"); - function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return createPadding(nativeFloor(mid), chars) + string + createPadding(nativeCeil(mid), chars); - } - function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - var strLength = length ? stringSize(string) : 0; - return length && strLength < length ? string + createPadding(length - strLength, chars) : string; - } - function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - var strLength = length ? stringSize(string) : 0; - return length && strLength < length ? createPadding(length - strLength, chars) + string : string; - } - function parseInt2(string, radix, guard) { - if (guard || radix == null) { - radix = 0; - } else if (radix) { - radix = +radix; - } - return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0); - } - function repeat(string, n3, guard) { - if (guard ? isIterateeCall(string, n3, guard) : n3 === undefined2) { - n3 = 1; - } else { - n3 = toInteger(n3); - } - return baseRepeat(toString(string), n3); - } - function replace() { - var args = arguments, string = toString(args[0]); - return args.length < 3 ? string : string.replace(args[1], args[2]); - } - var snakeCase = createCompounder(function(result2, word, index) { - return result2 + (index ? "_" : "") + word.toLowerCase(); - }); - function split(string, separator, limit) { - if (limit && typeof limit != "number" && isIterateeCall(string, separator, limit)) { - separator = limit = undefined2; - } - limit = limit === undefined2 ? MAX_ARRAY_LENGTH : limit >>> 0; - if (!limit) { - return []; - } - string = toString(string); - if (string && (typeof separator == "string" || separator != null && !isRegExp(separator))) { - separator = baseToString(separator); - if (!separator && hasUnicode(string)) { - return castSlice(stringToArray(string), 0, limit); + state.active = true; + state.paused = false; + state.nodeFocusedBeforeActivation = doc.activeElement; + if (onActivate) { + onActivate(); } - } - return string.split(separator, limit); - } - var startCase = createCompounder(function(result2, word, index) { - return result2 + (index ? " " : "") + upperFirst(word); - }); - function startsWith(string, target, position) { - string = toString(string); - position = position == null ? 0 : baseClamp(toInteger(position), 0, string.length); - target = baseToString(target); - return string.slice(position, position + target.length) == target; - } - function template(string, options, guard) { - var settings = lodash.templateSettings; - if (guard && isIterateeCall(string, options, guard)) { - options = undefined2; - } - string = toString(string); - options = assignInWith({}, options, settings, customDefaultsAssignIn); - var imports = assignInWith({}, options.imports, settings.imports, customDefaultsAssignIn), importsKeys = keys(imports), importsValues = baseValues(imports, importsKeys); - var isEscaping, isEvaluating, index = 0, interpolate = options.interpolate || reNoMatch, source = "__p += '"; - var reDelimiters = RegExp2( - (options.escape || reNoMatch).source + "|" + interpolate.source + "|" + (interpolate === reInterpolate ? reEsTemplate : reNoMatch).source + "|" + (options.evaluate || reNoMatch).source + "|$", - "g" - ); - var sourceURL = "//# sourceURL=" + (hasOwnProperty3.call(options, "sourceURL") ? (options.sourceURL + "").replace(/\s/g, " ") : "lodash.templateSources[" + ++templateCounter + "]") + "\n"; - string.replace(reDelimiters, function(match, escapeValue, interpolateValue, esTemplateValue, evaluateValue, offset2) { - interpolateValue || (interpolateValue = esTemplateValue); - source += string.slice(index, offset2).replace(reUnescapedString, escapeStringChar); - if (escapeValue) { - isEscaping = true; - source += "' +\n__e(" + escapeValue + ") +\n'"; - } - if (evaluateValue) { - isEvaluating = true; - source += "';\n" + evaluateValue + ";\n__p += '"; - } - if (interpolateValue) { - source += "' +\n((__t = (" + interpolateValue + ")) == null ? '' : __t) +\n'"; - } - index = offset2 + match.length; - return match; - }); - source += "';\n"; - var variable = hasOwnProperty3.call(options, "variable") && options.variable; - if (!variable) { - source = "with (obj) {\n" + source + "\n}\n"; - } else if (reForbiddenIdentifierChars.test(variable)) { - throw new Error2(INVALID_TEMPL_VAR_ERROR_TEXT); - } - source = (isEvaluating ? source.replace(reEmptyStringLeading, "") : source).replace(reEmptyStringMiddle, "$1").replace(reEmptyStringTrailing, "$1;"); - source = "function(" + (variable || "obj") + ") {\n" + (variable ? "" : "obj || (obj = {});\n") + "var __t, __p = ''" + (isEscaping ? ", __e = _.escape" : "") + (isEvaluating ? ", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n" : ";\n") + source + "return __p\n}"; - var result2 = attempt(function() { - return Function2(importsKeys, sourceURL + "return " + source).apply(undefined2, importsValues); - }); - result2.source = source; - if (isError(result2)) { - throw result2; - } - return result2; - } - function toLower(value) { - return toString(value).toLowerCase(); - } - function toUpper(value) { - return toString(value).toUpperCase(); - } - function trim(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined2)) { - return baseTrim(string); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), chrSymbols = stringToArray(chars), start3 = charsStartIndex(strSymbols, chrSymbols), end2 = charsEndIndex(strSymbols, chrSymbols) + 1; - return castSlice(strSymbols, start3, end2).join(""); - } - function trimEnd(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined2)) { - return string.slice(0, trimmedEndIndex(string) + 1); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), end2 = charsEndIndex(strSymbols, stringToArray(chars)) + 1; - return castSlice(strSymbols, 0, end2).join(""); - } - function trimStart(string, chars, guard) { - string = toString(string); - if (string && (guard || chars === undefined2)) { - return string.replace(reTrimStart, ""); - } - if (!string || !(chars = baseToString(chars))) { - return string; - } - var strSymbols = stringToArray(string), start3 = charsStartIndex(strSymbols, stringToArray(chars)); - return castSlice(strSymbols, start3).join(""); - } - function truncate(string, options) { - var length = DEFAULT_TRUNC_LENGTH, omission = DEFAULT_TRUNC_OMISSION; - if (isObject3(options)) { - var separator = "separator" in options ? options.separator : separator; - length = "length" in options ? toInteger(options.length) : length; - omission = "omission" in options ? baseToString(options.omission) : omission; - } - string = toString(string); - var strLength = string.length; - if (hasUnicode(string)) { - var strSymbols = stringToArray(string); - strLength = strSymbols.length; - } - if (length >= strLength) { - return string; - } - var end2 = length - stringSize(omission); - if (end2 < 1) { - return omission; - } - var result2 = strSymbols ? castSlice(strSymbols, 0, end2).join("") : string.slice(0, end2); - if (separator === undefined2) { - return result2 + omission; - } - if (strSymbols) { - end2 += result2.length - end2; - } - if (isRegExp(separator)) { - if (string.slice(end2).search(separator)) { - var match, substring = result2; - if (!separator.global) { - separator = RegExp2(separator.source, toString(reFlags.exec(separator)) + "g"); + var finishActivation = function finishActivation2() { + if (checkCanFocusTrap) { + updateTabbableNodes(); } - separator.lastIndex = 0; - while (match = separator.exec(substring)) { - var newEnd = match.index; + addListeners(); + if (onPostActivate) { + onPostActivate(); } - result2 = result2.slice(0, newEnd === undefined2 ? end2 : newEnd); + }; + if (checkCanFocusTrap) { + checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation); + return this; } - } else if (string.indexOf(baseToString(separator), end2) != end2) { - var index = result2.lastIndexOf(separator); - if (index > -1) { - result2 = result2.slice(0, index); + finishActivation(); + return this; + }, + deactivate: function deactivate(deactivateOptions) { + if (!state.active) { + return this; } - } - return result2 + omission; - } - function unescape(string) { - string = toString(string); - return string && reHasEscapedHtml.test(string) ? string.replace(reEscapedHtml, unescapeHtmlChar) : string; - } - var upperCase = createCompounder(function(result2, word, index) { - return result2 + (index ? " " : "") + word.toUpperCase(); - }); - var upperFirst = createCaseFirst("toUpperCase"); - function words(string, pattern, guard) { - string = toString(string); - pattern = guard ? undefined2 : pattern; - if (pattern === undefined2) { - return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); - } - return string.match(pattern) || []; - } - var attempt = baseRest(function(func, args) { - try { - return apply(func, undefined2, args); - } catch (e3) { - return isError(e3) ? e3 : new Error2(e3); - } - }); - var bindAll = flatRest(function(object, methodNames) { - arrayEach(methodNames, function(key) { - key = toKey(key); - baseAssignValue(object, key, bind3(object[key], object)); - }); - return object; - }); - function cond(pairs) { - var length = pairs == null ? 0 : pairs.length, toIteratee = getIteratee(); - pairs = !length ? [] : arrayMap(pairs, function(pair) { - if (typeof pair[1] != "function") { - throw new TypeError2(FUNC_ERROR_TEXT); + var options = _objectSpread2({ + onDeactivate: config.onDeactivate, + onPostDeactivate: config.onPostDeactivate, + checkCanReturnFocus: config.checkCanReturnFocus + }, deactivateOptions); + clearTimeout(state.delayInitialFocusTimer); + state.delayInitialFocusTimer = void 0; + removeListeners(); + state.active = false; + state.paused = false; + activeFocusTraps.deactivateTrap(trap); + var onDeactivate = getOption(options, "onDeactivate"); + var onPostDeactivate = getOption(options, "onPostDeactivate"); + var checkCanReturnFocus = getOption(options, "checkCanReturnFocus"); + var returnFocus = getOption(options, "returnFocus", "returnFocusOnDeactivate"); + if (onDeactivate) { + onDeactivate(); } - return [toIteratee(pair[0]), pair[1]]; - }); - return baseRest(function(args) { - var index = -1; - while (++index < length) { - var pair = pairs[index]; - if (apply(pair[0], this, args)) { - return apply(pair[1], this, args); - } - } - }); - } - function conforms(source) { - return baseConforms(baseClone(source, CLONE_DEEP_FLAG)); - } - function constant(value) { - return function() { - return value; - }; - } - function defaultTo(value, defaultValue) { - return value == null || value !== value ? defaultValue : value; - } - var flow = createFlow(); - var flowRight = createFlow(true); - function identity(value) { - return value; - } - function iteratee(func) { - return baseIteratee(typeof func == "function" ? func : baseClone(func, CLONE_DEEP_FLAG)); - } - function matches2(source) { - return baseMatches(baseClone(source, CLONE_DEEP_FLAG)); - } - function matchesProperty(path, srcValue) { - return baseMatchesProperty(path, baseClone(srcValue, CLONE_DEEP_FLAG)); - } - var method = baseRest(function(path, args) { - return function(object) { - return baseInvoke(object, path, args); - }; - }); - var methodOf = baseRest(function(object, args) { - return function(path) { - return baseInvoke(object, path, args); - }; - }); - function mixin(object, source, options) { - var props = keys(source), methodNames = baseFunctions(source, props); - if (options == null && !(isObject3(source) && (methodNames.length || !props.length))) { - options = source; - source = object; - object = this; - methodNames = baseFunctions(source, keys(source)); - } - var chain2 = !(isObject3(options) && "chain" in options) || !!options.chain, isFunc = isFunction(object); - arrayEach(methodNames, function(methodName) { - var func = source[methodName]; - object[methodName] = func; - if (isFunc) { - object.prototype[methodName] = function() { - var chainAll = this.__chain__; - if (chain2 || chainAll) { - var result2 = object(this.__wrapped__), actions = result2.__actions__ = copyArray(this.__actions__); - actions.push({ "func": func, "args": arguments, "thisArg": object }); - result2.__chain__ = chainAll; - return result2; + var finishDeactivation = function finishDeactivation2() { + delay(function() { + if (returnFocus) { + tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)); } - return func.apply(object, arrayPush([this.value()], arguments)); - }; + if (onPostDeactivate) { + onPostDeactivate(); + } + }); + }; + if (returnFocus && checkCanReturnFocus) { + checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation); + return this; } - }); - return object; - } - function noConflict() { - if (root._ === this) { - root._ = oldDash; - } - return this; - } - function noop() { - } - function nthArg(n3) { - n3 = toInteger(n3); - return baseRest(function(args) { - return baseNth(args, n3); - }); - } - var over = createOver(arrayMap); - var overEvery = createOver(arrayEvery); - var overSome = createOver(arraySome); - function property(path) { - return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); - } - function propertyOf(object) { - return function(path) { - return object == null ? undefined2 : baseGet(object, path); - }; - } - var range = createRange(); - var rangeRight = createRange(true); - function stubArray() { - return []; - } - function stubFalse() { - return false; - } - function stubObject() { - return {}; - } - function stubString() { - return ""; - } - function stubTrue() { - return true; - } - function times(n3, iteratee2) { - n3 = toInteger(n3); - if (n3 < 1 || n3 > MAX_SAFE_INTEGER) { - return []; - } - var index = MAX_ARRAY_LENGTH, length = nativeMin(n3, MAX_ARRAY_LENGTH); - iteratee2 = getIteratee(iteratee2); - n3 -= MAX_ARRAY_LENGTH; - var result2 = baseTimes(length, iteratee2); - while (++index < n3) { - iteratee2(index); - } - return result2; - } - function toPath(value) { - if (isArray2(value)) { - return arrayMap(value, toKey); - } - return isSymbol2(value) ? [value] : copyArray(stringToPath(toString(value))); - } - function uniqueId(prefix2) { - var id = ++idCounter2; - return toString(prefix2) + id; - } - var add2 = createMathOperation(function(augend, addend) { - return augend + addend; - }, 0); - var ceil = createRound("ceil"); - var divide = createMathOperation(function(dividend, divisor) { - return dividend / divisor; - }, 1); - var floor2 = createRound("floor"); - function max2(array) { - return array && array.length ? baseExtremum(array, identity, baseGt) : undefined2; - } - function maxBy(array, iteratee2) { - return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseGt) : undefined2; - } - function mean(array) { - return baseMean(array, identity); - } - function meanBy(array, iteratee2) { - return baseMean(array, getIteratee(iteratee2, 2)); - } - function min2(array) { - return array && array.length ? baseExtremum(array, identity, baseLt) : undefined2; - } - function minBy(array, iteratee2) { - return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2; - } - var multiply = createMathOperation(function(multiplier, multiplicand) { - return multiplier * multiplicand; - }, 1); - var round3 = createRound("round"); - var subtract = createMathOperation(function(minuend, subtrahend) { - return minuend - subtrahend; - }, 0); - function sum(array) { - return array && array.length ? baseSum(array, identity) : 0; - } - function sumBy(array, iteratee2) { - return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; - } - lodash.after = after; - lodash.ary = ary; - lodash.assign = assign2; - lodash.assignIn = assignIn; - lodash.assignInWith = assignInWith; - lodash.assignWith = assignWith; - lodash.at = at2; - lodash.before = before; - lodash.bind = bind3; - lodash.bindAll = bindAll; - lodash.bindKey = bindKey; - lodash.castArray = castArray; - lodash.chain = chain; - lodash.chunk = chunk; - lodash.compact = compact; - lodash.concat = concat; - lodash.cond = cond; - lodash.conforms = conforms; - lodash.constant = constant; - lodash.countBy = countBy; - lodash.create = create; - lodash.curry = curry; - lodash.curryRight = curryRight; - lodash.debounce = debounce4; - lodash.defaults = defaults; - lodash.defaultsDeep = defaultsDeep; - lodash.defer = defer; - lodash.delay = delay3; - lodash.difference = difference; - lodash.differenceBy = differenceBy; - lodash.differenceWith = differenceWith; - lodash.drop = drop; - lodash.dropRight = dropRight; - lodash.dropRightWhile = dropRightWhile; - lodash.dropWhile = dropWhile; - lodash.fill = fill; - lodash.filter = filter; - lodash.flatMap = flatMap; - lodash.flatMapDeep = flatMapDeep; - lodash.flatMapDepth = flatMapDepth; - lodash.flatten = flatten; - lodash.flattenDeep = flattenDeep; - lodash.flattenDepth = flattenDepth; - lodash.flip = flip2; - lodash.flow = flow; - lodash.flowRight = flowRight; - lodash.fromPairs = fromPairs; - lodash.functions = functions; - lodash.functionsIn = functionsIn; - lodash.groupBy = groupBy; - lodash.initial = initial; - lodash.intersection = intersection; - lodash.intersectionBy = intersectionBy; - lodash.intersectionWith = intersectionWith; - lodash.invert = invert; - lodash.invertBy = invertBy; - lodash.invokeMap = invokeMap; - lodash.iteratee = iteratee; - lodash.keyBy = keyBy2; - lodash.keys = keys; - lodash.keysIn = keysIn; - lodash.map = map; - lodash.mapKeys = mapKeys; - lodash.mapValues = mapValues2; - lodash.matches = matches2; - lodash.matchesProperty = matchesProperty; - lodash.memoize = memoize; - lodash.merge = merge; - lodash.mergeWith = mergeWith; - lodash.method = method; - lodash.methodOf = methodOf; - lodash.mixin = mixin; - lodash.negate = negate; - lodash.nthArg = nthArg; - lodash.omit = omit; - lodash.omitBy = omitBy; - lodash.once = once2; - lodash.orderBy = orderBy; - lodash.over = over; - lodash.overArgs = overArgs; - lodash.overEvery = overEvery; - lodash.overSome = overSome; - lodash.partial = partial; - lodash.partialRight = partialRight; - lodash.partition = partition; - lodash.pick = pick; - lodash.pickBy = pickBy; - lodash.property = property; - lodash.propertyOf = propertyOf; - lodash.pull = pull; - lodash.pullAll = pullAll; - lodash.pullAllBy = pullAllBy; - lodash.pullAllWith = pullAllWith; - lodash.pullAt = pullAt; - lodash.range = range; - lodash.rangeRight = rangeRight; - lodash.rearg = rearg; - lodash.reject = reject; - lodash.remove = remove; - lodash.rest = rest; - lodash.reverse = reverse; - lodash.sampleSize = sampleSize; - lodash.set = set3; - lodash.setWith = setWith; - lodash.shuffle = shuffle; - lodash.slice = slice; - lodash.sortBy = sortBy; - lodash.sortedUniq = sortedUniq; - lodash.sortedUniqBy = sortedUniqBy; - lodash.split = split; - lodash.spread = spread; - lodash.tail = tail; - lodash.take = take; - lodash.takeRight = takeRight; - lodash.takeRightWhile = takeRightWhile; - lodash.takeWhile = takeWhile; - lodash.tap = tap; - lodash.throttle = throttle2; - lodash.thru = thru; - lodash.toArray = toArray; - lodash.toPairs = toPairs2; - lodash.toPairsIn = toPairsIn; - lodash.toPath = toPath; - lodash.toPlainObject = toPlainObject; - lodash.transform = transform; - lodash.unary = unary; - lodash.union = union; - lodash.unionBy = unionBy; - lodash.unionWith = unionWith; - lodash.uniq = uniq; - lodash.uniqBy = uniqBy; - lodash.uniqWith = uniqWith; - lodash.unset = unset; - lodash.unzip = unzip; - lodash.unzipWith = unzipWith; - lodash.update = update; - lodash.updateWith = updateWith; - lodash.values = values; - lodash.valuesIn = valuesIn; - lodash.without = without; - lodash.words = words; - lodash.wrap = wrap; - lodash.xor = xor; - lodash.xorBy = xorBy; - lodash.xorWith = xorWith; - lodash.zip = zip; - lodash.zipObject = zipObject; - lodash.zipObjectDeep = zipObjectDeep; - lodash.zipWith = zipWith; - lodash.entries = toPairs2; - lodash.entriesIn = toPairsIn; - lodash.extend = assignIn; - lodash.extendWith = assignInWith; - mixin(lodash, lodash); - lodash.add = add2; - lodash.attempt = attempt; - lodash.camelCase = camelCase5; - lodash.capitalize = capitalize2; - lodash.ceil = ceil; - lodash.clamp = clamp2; - lodash.clone = clone2; - lodash.cloneDeep = cloneDeep; - lodash.cloneDeepWith = cloneDeepWith; - lodash.cloneWith = cloneWith; - lodash.conformsTo = conformsTo; - lodash.deburr = deburr; - lodash.defaultTo = defaultTo; - lodash.divide = divide; - lodash.endsWith = endsWith; - lodash.eq = eq; - lodash.escape = escape2; - lodash.escapeRegExp = escapeRegExp; - lodash.every = every; - lodash.find = find; - lodash.findIndex = findIndex3; - lodash.findKey = findKey; - lodash.findLast = findLast; - lodash.findLastIndex = findLastIndex; - lodash.findLastKey = findLastKey; - lodash.floor = floor2; - lodash.forEach = forEach; - lodash.forEachRight = forEachRight; - lodash.forIn = forIn; - lodash.forInRight = forInRight; - lodash.forOwn = forOwn; - lodash.forOwnRight = forOwnRight; - lodash.get = get3; - lodash.gt = gt; - lodash.gte = gte; - lodash.has = has2; - lodash.hasIn = hasIn; - lodash.head = head; - lodash.identity = identity; - lodash.includes = includes; - lodash.indexOf = indexOf; - lodash.inRange = inRange; - lodash.invoke = invoke; - lodash.isArguments = isArguments; - lodash.isArray = isArray2; - lodash.isArrayBuffer = isArrayBuffer; - lodash.isArrayLike = isArrayLike; - lodash.isArrayLikeObject = isArrayLikeObject; - lodash.isBoolean = isBoolean; - lodash.isBuffer = isBuffer; - lodash.isDate = isDate; - lodash.isElement = isElement3; - lodash.isEmpty = isEmpty; - lodash.isEqual = isEqual; - lodash.isEqualWith = isEqualWith; - lodash.isError = isError; - lodash.isFinite = isFinite; - lodash.isFunction = isFunction; - lodash.isInteger = isInteger; - lodash.isLength = isLength; - lodash.isMap = isMap2; - lodash.isMatch = isMatch; - lodash.isMatchWith = isMatchWith; - lodash.isNaN = isNaN2; - lodash.isNative = isNative; - lodash.isNil = isNil; - lodash.isNull = isNull; - lodash.isNumber = isNumber; - lodash.isObject = isObject3; - lodash.isObjectLike = isObjectLike; - lodash.isPlainObject = isPlainObject; - lodash.isRegExp = isRegExp; - lodash.isSafeInteger = isSafeInteger; - lodash.isSet = isSet; - lodash.isString = isString2; - lodash.isSymbol = isSymbol2; - lodash.isTypedArray = isTypedArray; - lodash.isUndefined = isUndefined; - lodash.isWeakMap = isWeakMap; - lodash.isWeakSet = isWeakSet; - lodash.join = join; - lodash.kebabCase = kebabCase4; - lodash.last = last; - lodash.lastIndexOf = lastIndexOf; - lodash.lowerCase = lowerCase; - lodash.lowerFirst = lowerFirst; - lodash.lt = lt2; - lodash.lte = lte; - lodash.max = max2; - lodash.maxBy = maxBy; - lodash.mean = mean; - lodash.meanBy = meanBy; - lodash.min = min2; - lodash.minBy = minBy; - lodash.stubArray = stubArray; - lodash.stubFalse = stubFalse; - lodash.stubObject = stubObject; - lodash.stubString = stubString; - lodash.stubTrue = stubTrue; - lodash.multiply = multiply; - lodash.nth = nth; - lodash.noConflict = noConflict; - lodash.noop = noop; - lodash.now = now; - lodash.pad = pad; - lodash.padEnd = padEnd; - lodash.padStart = padStart; - lodash.parseInt = parseInt2; - lodash.random = random; - lodash.reduce = reduce; - lodash.reduceRight = reduceRight; - lodash.repeat = repeat; - lodash.replace = replace; - lodash.result = result; - lodash.round = round3; - lodash.runInContext = runInContext2; - lodash.sample = sample; - lodash.size = size2; - lodash.snakeCase = snakeCase; - lodash.some = some; - lodash.sortedIndex = sortedIndex; - lodash.sortedIndexBy = sortedIndexBy; - lodash.sortedIndexOf = sortedIndexOf; - lodash.sortedLastIndex = sortedLastIndex; - lodash.sortedLastIndexBy = sortedLastIndexBy; - lodash.sortedLastIndexOf = sortedLastIndexOf; - lodash.startCase = startCase; - lodash.startsWith = startsWith; - lodash.subtract = subtract; - lodash.sum = sum; - lodash.sumBy = sumBy; - lodash.template = template; - lodash.times = times; - lodash.toFinite = toFinite; - lodash.toInteger = toInteger; - lodash.toLength = toLength; - lodash.toLower = toLower; - lodash.toNumber = toNumber; - lodash.toSafeInteger = toSafeInteger; - lodash.toString = toString; - lodash.toUpper = toUpper; - lodash.trim = trim; - lodash.trimEnd = trimEnd; - lodash.trimStart = trimStart; - lodash.truncate = truncate; - lodash.unescape = unescape; - lodash.uniqueId = uniqueId; - lodash.upperCase = upperCase; - lodash.upperFirst = upperFirst; - lodash.each = forEach; - lodash.eachRight = forEachRight; - lodash.first = head; - mixin(lodash, function() { - var source = {}; - baseForOwn(lodash, function(func, methodName) { - if (!hasOwnProperty3.call(lodash.prototype, methodName)) { - source[methodName] = func; + finishDeactivation(); + return this; + }, + pause: function pause() { + if (state.paused || !state.active) { + return this; } - }); - return source; - }(), { "chain": false }); - lodash.VERSION = VERSION; - arrayEach(["bind", "bindKey", "curry", "curryRight", "partial", "partialRight"], function(methodName) { - lodash[methodName].placeholder = lodash; - }); - arrayEach(["drop", "take"], function(methodName, index) { - LazyWrapper.prototype[methodName] = function(n3) { - n3 = n3 === undefined2 ? 1 : nativeMax(toInteger(n3), 0); - var result2 = this.__filtered__ && !index ? new LazyWrapper(this) : this.clone(); - if (result2.__filtered__) { - result2.__takeCount__ = nativeMin(n3, result2.__takeCount__); - } else { - result2.__views__.push({ - "size": nativeMin(n3, MAX_ARRAY_LENGTH), - "type": methodName + (result2.__dir__ < 0 ? "Right" : "") - }); + state.paused = true; + removeListeners(); + return this; + }, + unpause: function unpause() { + if (!state.paused || !state.active) { + return this; } - return result2; - }; - LazyWrapper.prototype[methodName + "Right"] = function(n3) { - return this.reverse()[methodName](n3).reverse(); - }; - }); - arrayEach(["filter", "map", "takeWhile"], function(methodName, index) { - var type = index + 1, isFilter = type == LAZY_FILTER_FLAG || type == LAZY_WHILE_FLAG; - LazyWrapper.prototype[methodName] = function(iteratee2) { - var result2 = this.clone(); - result2.__iteratees__.push({ - "iteratee": getIteratee(iteratee2, 3), - "type": type + state.paused = false; + updateTabbableNodes(); + addListeners(); + return this; + }, + updateContainerElements: function updateContainerElements(containerElements) { + var elementsAsArray = [].concat(containerElements).filter(Boolean); + state.containers = elementsAsArray.map(function(element) { + return typeof element === "string" ? doc.querySelector(element) : element; }); - result2.__filtered__ = result2.__filtered__ || isFilter; - return result2; - }; - }); - arrayEach(["head", "last"], function(methodName, index) { - var takeName = "take" + (index ? "Right" : ""); - LazyWrapper.prototype[methodName] = function() { - return this[takeName](1).value()[0]; - }; - }); - arrayEach(["initial", "tail"], function(methodName, index) { - var dropName = "drop" + (index ? "" : "Right"); - LazyWrapper.prototype[methodName] = function() { - return this.__filtered__ ? new LazyWrapper(this) : this[dropName](1); - }; - }); - LazyWrapper.prototype.compact = function() { - return this.filter(identity); - }; - LazyWrapper.prototype.find = function(predicate) { - return this.filter(predicate).head(); - }; - LazyWrapper.prototype.findLast = function(predicate) { - return this.reverse().find(predicate); - }; - LazyWrapper.prototype.invokeMap = baseRest(function(path, args) { - if (typeof path == "function") { - return new LazyWrapper(this); + if (state.active) { + updateTabbableNodes(); + } + return this; } - return this.map(function(value) { - return baseInvoke(value, path, args); - }); - }); - LazyWrapper.prototype.reject = function(predicate) { - return this.filter(negate(getIteratee(predicate))); }; - LazyWrapper.prototype.slice = function(start3, end2) { - start3 = toInteger(start3); - var result2 = this; - if (result2.__filtered__ && (start3 > 0 || end2 < 0)) { - return new LazyWrapper(result2); + trap.updateContainerElements(elements); + return trap; + }; + exports2.createFocusTrap = createFocusTrap2; + } + }); + var module_exports = {}; + __export2(module_exports, { + default: () => module_default + }); + module.exports = __toCommonJS(module_exports); + var import_focus_trap = __toESM2(require_focus_trap()); + var import_tabbable = __toESM2(require_dist()); + function src_default(Alpine3) { + let lastFocused; + let currentFocused; + window.addEventListener("focusin", () => { + lastFocused = currentFocused; + currentFocused = document.activeElement; + }); + Alpine3.magic("focus", (el) => { + let within = el; + return { + __noscroll: false, + __wrapAround: false, + within(el2) { + within = el2; + return this; + }, + withoutScrolling() { + this.__noscroll = true; + return this; + }, + noscroll() { + this.__noscroll = true; + return this; + }, + withWrapAround() { + this.__wrapAround = true; + return this; + }, + wrap() { + return this.withWrapAround(); + }, + focusable(el2) { + return (0, import_tabbable.isFocusable)(el2); + }, + previouslyFocused() { + return lastFocused; + }, + lastFocused() { + return lastFocused; + }, + focused() { + return currentFocused; + }, + focusables() { + if (Array.isArray(within)) + return within; + return (0, import_tabbable.focusable)(within, { displayCheck: "none" }); + }, + all() { + return this.focusables(); + }, + isFirst(el2) { + let els = this.all(); + return els[0] && els[0].isSameNode(el2); + }, + isLast(el2) { + let els = this.all(); + return els.length && els.slice(-1)[0].isSameNode(el2); + }, + getFirst() { + return this.all()[0]; + }, + getLast() { + return this.all().slice(-1)[0]; + }, + getNext() { + let list = this.all(); + let current = document.activeElement; + if (list.indexOf(current) === -1) + return; + if (this.__wrapAround && list.indexOf(current) === list.length - 1) { + return list[0]; } - if (start3 < 0) { - result2 = result2.takeRight(-start3); - } else if (start3) { - result2 = result2.drop(start3); + return list[list.indexOf(current) + 1]; + }, + getPrevious() { + let list = this.all(); + let current = document.activeElement; + if (list.indexOf(current) === -1) + return; + if (this.__wrapAround && list.indexOf(current) === 0) { + return list.slice(-1)[0]; } - if (end2 !== undefined2) { - end2 = toInteger(end2); - result2 = end2 < 0 ? result2.dropRight(-end2) : result2.take(end2 - start3); - } - return result2; + return list[list.indexOf(current) - 1]; + }, + first() { + this.focus(this.getFirst()); + }, + last() { + this.focus(this.getLast()); + }, + next() { + this.focus(this.getNext()); + }, + previous() { + this.focus(this.getPrevious()); + }, + prev() { + return this.previous(); + }, + focus(el2) { + if (!el2) + return; + setTimeout(() => { + if (!el2.hasAttribute("tabindex")) + el2.setAttribute("tabindex", "0"); + el2.focus({ preventScroll: this._noscroll }); + }); + } + }; + }); + Alpine3.directive("trap", Alpine3.skipDuringClone( + (el, { expression, modifiers }, { effect, evaluateLater, cleanup }) => { + let evaluator = evaluateLater(expression); + let oldValue = false; + let options = { + escapeDeactivates: false, + allowOutsideClick: true, + fallbackFocus: () => el }; - LazyWrapper.prototype.takeRightWhile = function(predicate) { - return this.reverse().takeWhile(predicate).reverse(); + let autofocusEl = el.querySelector("[autofocus]"); + if (autofocusEl) + options.initialFocus = autofocusEl; + let trap = (0, import_focus_trap.createFocusTrap)(el, options); + let undoInert = () => { }; - LazyWrapper.prototype.toArray = function() { - return this.take(MAX_ARRAY_LENGTH); + let undoDisableScrolling = () => { }; - baseForOwn(LazyWrapper.prototype, function(func, methodName) { - var checkIteratee = /^(?:filter|find|map|reject)|While$/.test(methodName), isTaker = /^(?:head|last)$/.test(methodName), lodashFunc = lodash[isTaker ? "take" + (methodName == "last" ? "Right" : "") : methodName], retUnwrapped = isTaker || /^find/.test(methodName); - if (!lodashFunc) { - return; - } - lodash.prototype[methodName] = function() { - var value = this.__wrapped__, args = isTaker ? [1] : arguments, isLazy = value instanceof LazyWrapper, iteratee2 = args[0], useLazy = isLazy || isArray2(value); - var interceptor2 = function(value2) { - var result3 = lodashFunc.apply(lodash, arrayPush([value2], args)); - return isTaker && chainAll ? result3[0] : result3; - }; - if (useLazy && checkIteratee && typeof iteratee2 == "function" && iteratee2.length != 1) { - isLazy = useLazy = false; - } - var chainAll = this.__chain__, isHybrid = !!this.__actions__.length, isUnwrapped = retUnwrapped && !chainAll, onlyLazy = isLazy && !isHybrid; - if (!retUnwrapped && useLazy) { - value = onlyLazy ? value : new LazyWrapper(this); - var result2 = func.apply(value, args); - result2.__actions__.push({ "func": thru, "args": [interceptor2], "thisArg": undefined2 }); - return new LodashWrapper(result2, chainAll); - } - if (isUnwrapped && onlyLazy) { - return func.apply(this, args); - } - result2 = this.thru(interceptor2); - return isUnwrapped ? isTaker ? result2.value()[0] : result2.value() : result2; + const releaseFocus = () => { + undoInert(); + undoInert = () => { }; - }); - arrayEach(["pop", "push", "shift", "sort", "splice", "unshift"], function(methodName) { - var func = arrayProto[methodName], chainName = /^(?:push|sort|unshift)$/.test(methodName) ? "tap" : "thru", retUnwrapped = /^(?:pop|shift)$/.test(methodName); - lodash.prototype[methodName] = function() { - var args = arguments; - if (retUnwrapped && !this.__chain__) { - var value = this.value(); - return func.apply(isArray2(value) ? value : [], args); - } - return this[chainName](function(value2) { - return func.apply(isArray2(value2) ? value2 : [], args); - }); + undoDisableScrolling(); + undoDisableScrolling = () => { }; - }); - baseForOwn(LazyWrapper.prototype, function(func, methodName) { - var lodashFunc = lodash[methodName]; - if (lodashFunc) { - var key = lodashFunc.name + ""; - if (!hasOwnProperty3.call(realNames, key)) { - realNames[key] = []; - } - realNames[key].push({ "name": methodName, "func": lodashFunc }); + trap.deactivate({ + returnFocus: !modifiers.includes("noreturn") + }); + }; + effect(() => evaluator((value) => { + if (oldValue === value) + return; + if (value && !oldValue) { + if (modifiers.includes("noscroll")) + undoDisableScrolling = disableScrolling(); + if (modifiers.includes("inert")) + undoInert = setInert(el); + setTimeout(() => { + trap.activate(); + }, 15); } - }); - realNames[createHybrid(undefined2, WRAP_BIND_KEY_FLAG).name] = [{ - "name": "wrapper", - "func": undefined2 - }]; - LazyWrapper.prototype.clone = lazyClone; - LazyWrapper.prototype.reverse = lazyReverse; - LazyWrapper.prototype.value = lazyValue; - lodash.prototype.at = wrapperAt; - lodash.prototype.chain = wrapperChain; - lodash.prototype.commit = wrapperCommit; - lodash.prototype.next = wrapperNext; - lodash.prototype.plant = wrapperPlant; - lodash.prototype.reverse = wrapperReverse; - lodash.prototype.toJSON = lodash.prototype.valueOf = lodash.prototype.value = wrapperValue; - lodash.prototype.first = lodash.prototype.head; - if (symIterator) { - lodash.prototype[symIterator] = wrapperToIterator; - } - return lodash; - }; - var _3 = runInContext(); - if (typeof define == "function" && typeof define.amd == "object" && define.amd) { - root._ = _3; - define(function() { - return _3; - }); - } else if (freeModule) { - (freeModule.exports = _3)._ = _3; - freeExports._ = _3; - } else { - root._ = _3; + if (!value && oldValue) { + releaseFocus(); + } + oldValue = !!value; + })); + cleanup(releaseFocus); + }, + // When cloning, we only want to add aria-hidden attributes to the + // DOM and not try to actually trap, as trapping can mess with the + // live DOM and isn't just isolated to the cloned DOM. + (el, { expression, modifiers }, { evaluate }) => { + if (modifiers.includes("inert") && evaluate(expression)) + setInert(el); } - }).call(exports); + )); } - }); - - // helpers/alpine.js - function registerComponents(components) { - document.addEventListener("alpine:init", () => { - components.forEach((module) => { - if (module.default && module.default.component === true) { - Alpine.data(module.default.name, module.default); + function setInert(el) { + let undos = []; + crawlSiblingsUp(el, (sibling) => { + let cache = sibling.hasAttribute("aria-hidden"); + sibling.setAttribute("aria-hidden", "true"); + undos.push(() => cache || sibling.removeAttribute("aria-hidden")); + }); + return () => { + while (undos.length) + undos.pop()(); + }; + } + function crawlSiblingsUp(el, callback) { + if (el.isSameNode(document.body) || !el.parentNode) + return; + Array.from(el.parentNode.children).forEach((sibling) => { + if (sibling.isSameNode(el)) { + crawlSiblingsUp(el.parentNode, callback); + } else { + callback(sibling); } }); - }); - return components; - } - function getComponent(el, throwOnError = false) { - try { - return Alpine.$data(el); - } catch (error2) { - if (throwOnError) { - throw error2; - } else { - return null; - } } + function disableScrolling() { + let overflow = document.documentElement.style.overflow; + let paddingRight = document.documentElement.style.paddingRight; + let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; + document.documentElement.style.overflow = "hidden"; + document.documentElement.style.paddingRight = `${scrollbarWidth}px`; + return () => { + document.documentElement.style.overflow = overflow; + document.documentElement.style.paddingRight = paddingRight; + }; + } + var module_default = src_default; } - function getData(el) { - const root = Alpine.closestRoot(el); - return root ? Alpine.$data(root) : null; - } - function setData(el, newData) { - const data2 = getData(el); - return data2 ? Object.assign(data2, newData) : null; - } +}); - // ../../../package.json - var package_default = { - name: "coveragebook-components", - version: "0.14.0", - repository: "git@github.com:coveragebook/coco.git", - license: "NO LICENSE", - author: "Mark Perkins <mark@coveragebook.com>", - type: "module", - main: "index.js", - scripts: { - build: "npm run js:build && npm run css:build", - "build:dev": "npm run js:dev && npm run css:dev", - "css:build": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco", - "css:dev": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco --ext .dev.css", - "css:watch": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco --watch --ext .dev.css", - "js:build": "node esbuild.config.js", - "js:dev": "node esbuild.config.js --dev", - "js:watch": "node esbuild.config.js --watch", - "lint:fix": "bundle exec standardrb --fix && prettier --write .", - prepare: "husky install", - release: "release-it" - }, - "lint-staged": { - "**/*": [ - "prettier --write --ignore-unknown" - ], - "(**/*.(rb|rake))|Gemfile|Rakefile": [ - "standardrb --fix" - ] - }, - browserslist: [ - "defaults" - ], - prettier: { - semi: true, - singleQuote: false, - tabWidth: 2, - trailingComma: "es5" - }, - dependencies: { - "@alpinejs/collapse": "^3.13.3", - "@alpinejs/focus": "^3.13.2", - "@alpinejs/intersect": "^3.13.2", - "@alpinejs/mask": "^3.13.3", - "@alpinejs/morph": "^3.13.2", - "@jaames/iro": "^5.5.2", - "@percy/cli": "^1.27.3", - "@tailwindcss/container-queries": "^0.1.0", - "@tailwindcss/forms": "^0.5.6", - "alias-hq": "^6.2.2", - alpinejs: "^3.13.2", - autoprefixer: "^10.4.16", - "container-query-polyfill": "^1.0.2", - del: "^7.1.0", - esbuild: "^0.19.11", - "esbuild-plugin-copy": "^2.0.2", - "fast-glob": "^3.3.1", - "fast-sort": "^3.2.1", - html2canvas: "^1.4.1", - husky: "^8.0.3", - "js-cookie": "^3.0.5", - "lint-staged": "^15.2.0", - lodash: "^4.17.21", - "lucide-static": "^0.303.0", - postcss: "^8.4.31", - "postcss-cli": "^10.1.0", - "postcss-value-parser": "^4.2.0", - prettier: "^3.1.1", - "release-it": "^17.0.1", - svgo: "^3.0.2", - tailwindcss: "^3.4.0", - "tippy.js": "^6.3.7" - }, - "release-it": { - github: { - release: true - }, - npm: { - publish: false - }, - hooks: { - "before:init": [ - "npm install", - "bundle install", - "bundle exec rake coco:test" - ], - "after:bump": [ - "npm run lint:fix", - "npm run build" - ], - "after:version:bump": "bundle exec rake coco:gem:bump_version[${version}] && bundle && cd lookbook && bundle", - "after:release": "rake coco:gem:release[${version}]" +// ../../../node_modules/lodash.camelcase/index.js +var require_lodash = __commonJS({ + "../../../node_modules/lodash.camelcase/index.js"(exports, module) { + var INFINITY = 1 / 0; + var symbolTag = "[object Symbol]"; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var rsAstralRange = "\\ud800-\\udfff"; + var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23"; + var rsComboSymbolsRange = "\\u20d0-\\u20f0"; + var rsDingbatRange = "\\u2700-\\u27bf"; + var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff"; + var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7"; + var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"; + var rsPunctuationRange = "\\u2000-\\u206f"; + var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"; + var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde"; + var rsVarRange = "\\ufe0e\\ufe0f"; + var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + var rsApos = "['\u2019]"; + var rsAstral = "[" + rsAstralRange + "]"; + var rsBreak = "[" + rsBreakRange + "]"; + var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]"; + var rsDigits = "\\d+"; + var rsDingbat = "[" + rsDingbatRange + "]"; + var rsLower = "[" + rsLowerRange + "]"; + var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]"; + var rsFitz = "\\ud83c[\\udffb-\\udfff]"; + var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"; + var rsNonAstral = "[^" + rsAstralRange + "]"; + var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var rsUpper = "[" + rsUpperRange + "]"; + var rsZWJ = "\\u200d"; + var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")"; + var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")"; + var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?"; + var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?"; + var reOptMod = rsModifier + "?"; + var rsOptVar = "[" + rsVarRange + "]?"; + var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"; + var rsSeq = rsOptVar + reOptMod + rsOptJoin; + var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq; + var rsSymbol = "(?:" + [rsNonAstral + rsCombo + "?", rsCombo, rsRegional, rsSurrPair, rsAstral].join("|") + ")"; + var reApos = RegExp(rsApos, "g"); + var reComboMark = RegExp(rsCombo, "g"); + var reUnicode = RegExp(rsFitz + "(?=" + rsFitz + ")|" + rsSymbol + rsSeq, "g"); + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")", + rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr, + rsUpper + "+" + rsOptUpperContr, + rsDigits, + rsEmoji + ].join("|"), "g"); + var reHasUnicode = RegExp("[" + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + "]"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var deburredLetters = { + // Latin-1 Supplement block. + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "ss", + // Latin Extended-A block. + "\u0100": "A", + "\u0102": "A", + "\u0104": "A", + "\u0101": "a", + "\u0103": "a", + "\u0105": "a", + "\u0106": "C", + "\u0108": "C", + "\u010A": "C", + "\u010C": "C", + "\u0107": "c", + "\u0109": "c", + "\u010B": "c", + "\u010D": "c", + "\u010E": "D", + "\u0110": "D", + "\u010F": "d", + "\u0111": "d", + "\u0112": "E", + "\u0114": "E", + "\u0116": "E", + "\u0118": "E", + "\u011A": "E", + "\u0113": "e", + "\u0115": "e", + "\u0117": "e", + "\u0119": "e", + "\u011B": "e", + "\u011C": "G", + "\u011E": "G", + "\u0120": "G", + "\u0122": "G", + "\u011D": "g", + "\u011F": "g", + "\u0121": "g", + "\u0123": "g", + "\u0124": "H", + "\u0126": "H", + "\u0125": "h", + "\u0127": "h", + "\u0128": "I", + "\u012A": "I", + "\u012C": "I", + "\u012E": "I", + "\u0130": "I", + "\u0129": "i", + "\u012B": "i", + "\u012D": "i", + "\u012F": "i", + "\u0131": "i", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u0138": "k", + "\u0139": "L", + "\u013B": "L", + "\u013D": "L", + "\u013F": "L", + "\u0141": "L", + "\u013A": "l", + "\u013C": "l", + "\u013E": "l", + "\u0140": "l", + "\u0142": "l", + "\u0143": "N", + "\u0145": "N", + "\u0147": "N", + "\u014A": "N", + "\u0144": "n", + "\u0146": "n", + "\u0148": "n", + "\u014B": "n", + "\u014C": "O", + "\u014E": "O", + "\u0150": "O", + "\u014D": "o", + "\u014F": "o", + "\u0151": "o", + "\u0154": "R", + "\u0156": "R", + "\u0158": "R", + "\u0155": "r", + "\u0157": "r", + "\u0159": "r", + "\u015A": "S", + "\u015C": "S", + "\u015E": "S", + "\u0160": "S", + "\u015B": "s", + "\u015D": "s", + "\u015F": "s", + "\u0161": "s", + "\u0162": "T", + "\u0164": "T", + "\u0166": "T", + "\u0163": "t", + "\u0165": "t", + "\u0167": "t", + "\u0168": "U", + "\u016A": "U", + "\u016C": "U", + "\u016E": "U", + "\u0170": "U", + "\u0172": "U", + "\u0169": "u", + "\u016B": "u", + "\u016D": "u", + "\u016F": "u", + "\u0171": "u", + "\u0173": "u", + "\u0174": "W", + "\u0175": "w", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "\u0179": "Z", + "\u017B": "Z", + "\u017D": "Z", + "\u017A": "z", + "\u017C": "z", + "\u017E": "z", + "\u0132": "IJ", + "\u0133": "ij", + "\u0152": "Oe", + "\u0153": "oe", + "\u0149": "'n", + "\u017F": "ss" + }; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, length = array ? array.length : 0; + if (initAccum && length) { + accumulator = array[++index]; } - } - }; - - // ../../../node_modules/container-query-polyfill/dist/container-query-polyfill.modern.js - function e() { - return e = Object.assign ? Object.assign.bind() : function(e3) { - for (var t3 = 1; t3 < arguments.length; t3++) { - var n3 = arguments[t3]; - for (var r3 in n3) - Object.prototype.hasOwnProperty.call(n3, r3) && (e3[r3] = n3[r3]); + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); } - return e3; - }, e.apply(this, arguments); - } - function t(e3, t3) { - const n3 = t3.width, r3 = t3.height, u3 = t3.inlineSize, o3 = t3.blockSize; - switch (e3) { - case 1: - return null != n3 ? { type: 3, value: n3, unit: "px" } : { type: 1 }; - case 3: - return null != u3 ? { type: 3, value: u3, unit: "px" } : { type: 1 }; - case 2: - return null != r3 ? { type: 3, value: r3, unit: "px" } : { type: 1 }; - case 4: - return null != o3 ? { type: 3, value: o3, unit: "px" } : { type: 1 }; - case 5: - return null != n3 && null != r3 && r3 > 0 ? { type: 2, value: n3 / r3 } : { type: 1 }; - case 6: - return null != n3 && null != r3 ? { type: 4, value: r3 >= n3 ? "portrait" : "landscape" } : { type: 1 }; + return accumulator; } - } - function n(e3, t3) { - switch (e3.type) { - case 1: - case 2: - case 3: - case 4: - return i(e3, t3); - case 5: { - const n3 = t3.sizeFeatures.get(e3.feature); - return null == n3 ? { type: 1 } : n3; - } - case 6: - return e3.value; + function asciiToArray(string) { + return string.split(""); } - } - function r(e3) { - return { type: 5, value: e3 }; - } - function u(e3, t3, n3) { - return r(function(e4, t4, n4) { - switch (n4) { - case 1: - return e4 === t4; - case 2: - return e4 > t4; - case 3: - return e4 >= t4; - case 4: - return e4 < t4; - case 5: - return e4 <= t4; - } - }(e3, t3, n3)); - } - function o(e3, t3, n3) { - return null == e3 ? t3 : null == t3 ? e3 : n3(e3, t3); - } - function s(e3, t3) { - switch (e3) { - case "cqw": - return t3.cqw; - case "cqh": - return t3.cqh; - case "cqi": - return 0 === t3.writingAxis ? t3.cqw : t3.cqh; - case "cqb": - return 1 === t3.writingAxis ? t3.cqw : t3.cqh; - case "cqmin": - return o(s("cqi", t3), s("cqb", t3), Math.min); - case "cqmax": - return o(s("cqi", t3), s("cqb", t3), Math.max); + function asciiWords(string) { + return string.match(reAsciiWord) || []; } - } - function l(e3, { treeContext: t3 }) { - switch (e3.unit) { - case "px": - return e3.value; - case "rem": - return e3.value * t3.rootFontSize; - case "em": - return e3.value * t3.fontSize; - case "cqw": - case "cqh": - case "cqi": - case "cqb": - case "cqmin": - case "cqmax": - return o(e3.value, s(e3.unit, t3), (e4, t4) => e4 * t4); + function basePropertyOf(object) { + return function(key) { + return object == null ? void 0 : object[key]; + }; } - return null; - } - function c(e3, t3) { - switch (e3.type) { - case 2: - return 0 === e3.value ? 0 : null; - case 3: - return l(e3, t3); + var deburrLetter = basePropertyOf(deburredLetters); + function hasUnicode(string) { + return reHasUnicode.test(string); } - return null; - } - function i(e3, t3) { - switch (e3.type) { - case 4: - return function(e4, t4) { - const o3 = n(e4.left, t4), s3 = n(e4.right, t4), l2 = e4.operator; - if (4 === o3.type && 4 === s3.type || 5 === o3.type && 5 === s3.type) - return function(e5, t5, n3) { - return 1 === n3 ? r(e5.value === t5.value) : { type: 1 }; - }(o3, s3, l2); - if (3 === o3.type || 3 === s3.type) { - const e5 = c(o3, t4), n3 = c(s3, t4); - if (null != e5 && null != n3) - return u(e5, n3, l2); - } else if (2 === o3.type && 2 === s3.type) - return u(o3.value, s3.value, l2); - return { type: 1 }; - }(e3, t3); - case 2: - return function(e4, t4) { - const n3 = i(e4.left, t4); - return 5 !== n3.type || true !== n3.value ? n3 : i(e4.right, t4); - }(e3, t3); - case 3: - return function(e4, t4) { - const n3 = i(e4.left, t4); - return 5 === n3.type && true === n3.value ? n3 : i(e4.right, t4); - }(e3, t3); - case 1: { - const n3 = i(e3.value, t3); - return 5 === n3.type ? { type: 5, value: !n3.value } : { type: 1 }; - } - case 5: - return a(n(e3, t3)); - case 6: - return a(e3.value); + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); } - } - function a(e3) { - switch (e3.type) { - case 5: - return e3; - case 2: - case 3: - return { type: 5, value: e3.value > 0 }; + function stringToArray(string) { + return hasUnicode(string) ? unicodeToArray(string) : asciiToArray(string); } - return { type: 1 }; - } - var f = Array.from({ length: 4 }, () => Math.floor(256 * Math.random()).toString(16)).join(""); - var p = S("container"); - var y = S("container-type"); - var h = S("container-name"); - var v = `data-cqs-${f}`; - var d = `data-cqc-${f}`; - var m = S("cqw"); - var w = S("cqh"); - var g = S("cqi"); - var b = S("cqb"); - function S(e3) { - return `--cq-${e3}-${f}`; - } - var x = Symbol(); - function q(e3, t3) { - const n3 = { value: t3, errorIndices: [], index: -1, at(r3) { - const u3 = n3.index + r3; - return u3 >= e3.length ? t3 : e3[u3]; - }, consume: (e4) => (n3.index += e4, n3.value = n3.at(0), n3.value), reconsume() { - n3.index -= 1; - }, error() { - n3.errorIndices.push(n3.index); - } }; - return n3; - } - function C(e3) { - return q(e3, { type: 0 }); - } - function* $(e3) { - const t3 = []; - let n3 = false; - for (const r4 of e3) { - const e4 = r4.codePointAt(0); - n3 && 10 !== e4 && (n3 = false, t3.push(10)), 0 === e4 || e4 >= 55296 && e4 <= 57343 ? t3.push(65533) : 13 === e4 ? n3 = true : t3.push(e4); + function unicodeToArray(string) { + return string.match(reUnicode) || []; } - const r3 = q(t3, -1), { at: u3, consume: o3, error: s3, reconsume: l2 } = r3; - function c3() { - return String.fromCodePoint(r3.value); + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; } - function i3() { - return { type: 13, value: c3() }; - } - function a3() { - for (; z(u3(1)); ) - o3(1); - } - function f3() { - for (; -1 !== r3.value; ) - if (o3(1), 42 === u3(0) && 47 === u3(1)) - return void o3(1); - s3(); - } - function p2() { - const [e4, t4] = function() { - let e5 = 0, t5 = "", n5 = u3(1); - for (43 !== n5 && 45 !== n5 || (o3(1), t5 += c3()); k(u3(1)); ) - o3(1), t5 += c3(); - if (46 === u3(1) && k(u3(2))) - for (e5 = 1, o3(1), t5 += c3(); k(u3(1)); ) - o3(1), t5 += c3(); - if (n5 = u3(1), 69 === n5 || 101 === n5) { - const n6 = u3(2); - if (k(n6)) - for (e5 = 1, o3(1), t5 += c3(); k(u3(1)); ) - o3(1), t5 += c3(); - else if ((45 === n6 || 43 === n6) && k(u3(3))) - for (e5 = 1, o3(1), t5 += c3(), o3(1), t5 += c3(); k(u3(1)); ) - o3(1), t5 += c3(); - } - return [t5, e5]; - }(), n4 = u3(1); - return d3(n4, u3(1), u3(2)) ? { type: 15, value: e4, flag: t4, unit: w3() } : 37 === n4 ? (o3(1), { type: 16, value: e4 }) : { type: 17, value: e4, flag: t4 }; - } - function y3() { - const e4 = w3(); - let t4 = u3(1); - if ("url" === e4.toLowerCase() && 40 === t4) { - for (o3(1); z(u3(1)) && z(u3(2)); ) - o3(1); - t4 = u3(1); - const n4 = u3(2); - return 34 === t4 || 39 === t4 ? { type: 23, value: e4 } : !z(t4) || 34 !== n4 && 39 !== n4 ? function() { - let e5 = ""; - for (a3(); ; ) { - const n5 = o3(1); - if (41 === n5) - return { type: 20, value: e5 }; - if (-1 === n5) - return s3(), { type: 20, value: e5 }; - if (z(n5)) { - a3(); - const t6 = u3(1); - return 41 === t6 || -1 === t6 ? (o3(1), -1 === n5 && s3(), { type: 20, value: e5 }) : (g3(), { type: 21 }); - } - if (34 === n5 || 39 === n5 || 40 === n5 || (t5 = n5) >= 0 && t5 <= 8 || 11 === t5 || t5 >= 14 && t5 <= 31 || 127 === t5) - return s3(), g3(), { type: 21 }; - if (92 === n5) { - if (!j(n5, u3(1))) - return s3(), { type: 21 }; - e5 += v3(); - } else - e5 += c3(); - } - var t5; - }() : { type: 23, value: e4 }; + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var Symbol2 = root.Symbol; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function baseSlice(array, start, end) { + var index = -1, length = array.length; + if (start < 0) { + start = -start > length ? 0 : length + start; } - return 40 === t4 ? (o3(1), { type: 23, value: e4 }) : { type: 24, value: e4 }; - } - function h3(e4) { - let t4 = ""; - for (; ; ) { - const n4 = o3(1); - if (-1 === n4 || n4 === e4) - return -1 === n4 && s3(), { type: 2, value: t4 }; - if (E(n4)) - return s3(), l2(), { type: 3 }; - if (92 === n4) { - const e5 = u3(1); - if (-1 === e5) - continue; - E(e5) ? o3(1) : t4 += v3(); - } else - t4 += c3(); + end = end > length ? length : end; + if (end < 0) { + end += length; } + length = start > end ? 0 : end - start >>> 0; + start >>>= 0; + var result = Array(length); + while (++index < length) { + result[index] = array[index + start]; + } + return result; } - function v3() { - const e4 = o3(1); - if (A(e4)) { - const t4 = [e4]; - for (let e5 = 0; e5 < 5; e5++) { - const e6 = u3(1); - if (!A(e6)) - break; - t4.push(e6), o3(1); - } - z(u3(1)) && o3(1); - let n4 = parseInt(String.fromCodePoint(...t4), 16); - return (0 === n4 || n4 >= 55296 && n4 <= 57343 || n4 > 1114111) && (n4 = 65533), String.fromCodePoint(n4); + function baseToString(value) { + if (typeof value == "string") { + return value; } - return -1 === e4 ? (s3(), String.fromCodePoint(65533)) : c3(); + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; } - function d3(e4, t4, n4) { - return 45 === e4 ? L(t4) || 45 === t4 || j(t4, n4) : !!L(e4); + function castSlice(array, start, end) { + var length = array.length; + end = end === void 0 ? length : end; + return !start && end >= length ? array : baseSlice(array, start, end); } - function m3(e4, t4, n4) { - return 43 === e4 || 45 === e4 ? k(t4) || 46 === t4 && k(n4) : !(46 !== e4 || !k(t4)) || !!k(e4); + function createCaseFirst(methodName) { + return function(string) { + string = toString(string); + var strSymbols = hasUnicode(string) ? stringToArray(string) : void 0; + var chr = strSymbols ? strSymbols[0] : string.charAt(0); + var trailing = strSymbols ? castSlice(strSymbols, 1).join("") : string.slice(1); + return chr[methodName]() + trailing; + }; } - function w3() { - let e4 = ""; - for (; ; ) { - const t4 = o3(1); - if (M(t4)) - e4 += c3(); - else { - if (!j(t4, u3(1))) - return l2(), e4; - e4 += v3(); - } - } + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); + }; } - function g3() { - for (; ; ) { - const e4 = o3(1); - if (-1 === e4) - return; - j(e4, u3(1)) && v3(); - } + function isObjectLike(value) { + return !!value && typeof value == "object"; } - for (; ; ) { - const e4 = o3(1); - if (47 === e4 && 42 === u3(1)) - o3(2), f3(); - else if (z(e4)) - a3(), yield { type: 1 }; - else if (34 === e4) - yield h3(e4); - else if (35 === e4) { - const e5 = u3(1); - M(e5) || j(e5, u3(2)) ? yield { type: 14, flag: d3(u3(1), u3(2), u3(3)) ? 1 : 0, value: w3() } : yield i3(); - } else if (39 === e4) - yield h3(e4); - else if (40 === e4) - yield { type: 4 }; - else if (41 === e4) - yield { type: 5 }; - else if (43 === e4) - m3(e4, u3(1), u3(2)) ? (l2(), yield p2()) : yield i3(); - else if (44 === e4) - yield { type: 6 }; - else if (45 === e4) { - const t4 = u3(1), n4 = u3(2); - m3(e4, t4, n4) ? (l2(), yield p2()) : 45 === t4 && 62 === n4 ? (o3(2), yield { type: 19 }) : d3(e4, t4, n4) ? (l2(), yield y3()) : yield i3(); - } else if (46 === e4) - m3(e4, u3(1), u3(2)) ? (l2(), yield p2()) : yield i3(); - else if (58 === e4) - yield { type: 7 }; - else if (59 === e4) - yield { type: 8 }; - else if (60 === e4) - 33 === u3(1) && 45 === u3(2) && 45 === u3(3) ? yield { type: 18 } : yield i3(); - else if (64 === e4) - if (d3(u3(1), u3(2), u3(3))) { - const e5 = w3(); - yield { type: 22, value: e5 }; - } else - yield i3(); - else if (91 === e4) - yield { type: 9 }; - else if (92 === e4) - j(e4, u3(1)) ? (l2(), yield y3()) : (s3(), yield i3()); - else if (93 === e4) - yield { type: 10 }; - else if (123 === e4) - yield { type: 11 }; - else if (125 === e4) - yield { type: 12 }; - else if (k(e4)) - l2(), yield p2(); - else if (L(e4)) - l2(), yield y3(); - else { - if (-1 === e4) - return yield { type: 0 }, r3.errorIndices; - yield { type: 13, value: c3() }; - } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; } - } - function k(e3) { - return e3 >= 48 && e3 <= 57; - } - function A(e3) { - return k(e3) || e3 >= 65 && e3 <= 70 || e3 >= 97 && e3 <= 102; - } - function E(e3) { - return 10 === e3 || 13 === e3 || 12 === e3; - } - function z(e3) { - return E(e3) || 9 === e3 || 32 === e3; - } - function L(e3) { - return e3 >= 65 && e3 <= 90 || e3 >= 97 && e3 <= 122 || e3 >= 128 || 95 === e3; - } - function j(e3, t3) { - return 92 === e3 && !E(t3); - } - function M(e3) { - return L(e3) || k(e3) || 45 === e3; - } - var T = { 11: 12, 9: 10, 4: 5 }; - function P(t3, n3) { - const r3 = function(e3, t4) { - const n4 = []; - for (; ; ) - switch (e3.consume(1).type) { - case 1: - break; - case 0: - return { type: 3, value: n4 }; - case 18: - case 19: - if (false !== t4) { - e3.reconsume(); - const t5 = R(e3); - t5 !== x && n4.push(t5); - } - break; - case 22: - e3.reconsume(), n4.push(U(e3)); - break; - default: { - e3.reconsume(); - const t5 = R(e3); - t5 !== x && n4.push(t5); - break; - } - } - }(C(t3), true === n3); - return e({}, r3, { value: r3.value.map((t4) => 26 === t4.type ? function(t5, n4) { - return 0 === t5.value.value.type ? e({}, t5, { value: e({}, t5.value, { value: O(t5.value.value.value) }) }) : t5; - }(t4) : t4) }); - } - function N(e3) { - const t3 = C(e3), n3 = []; - for (; ; ) { - if (0 === t3.consume(1).type) - return n3; - t3.reconsume(), n3.push(Q(t3)); + function toString(value) { + return value == null ? "" : baseToString(value); } - } - function O(e3) { - return function(e4) { - const t3 = [], n3 = []; - for (; ; ) { - const r3 = e4.consume(1); - switch (r3.type) { - case 1: - case 8: - break; - case 0: - return { type: 1, value: [...n3, ...t3] }; - case 22: - e4.reconsume(), t3.push(U(e4)); - break; - case 24: { - const t4 = [r3]; - let u3 = e4.at(1); - for (; 8 !== u3.type && 0 !== u3.type; ) - t4.push(Q(e4)), u3 = e4.at(1); - const o3 = I(C(t4)); - o3 !== x && n3.push(o3); - break; - } - case 13: - if ("&" === r3.value) { - e4.reconsume(); - const n4 = R(e4); - n4 !== x && t3.push(n4); - break; - } - default: { - e4.error(), e4.reconsume(); - let t4 = e4.at(1); - for (; 8 !== t4.type && 0 !== t4.type; ) - Q(e4), t4 = e4.at(1); - break; - } - } + var camelCase2 = createCompounder(function(result, word, index) { + word = word.toLowerCase(); + return result + (index ? capitalize(word) : word); + }); + function capitalize(string) { + return upperFirst(toString(string).toLowerCase()); + } + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); + } + var upperFirst = createCaseFirst("toUpperCase"); + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? void 0 : pattern; + if (pattern === void 0) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } - }(C(e3)); - } - function F(e3) { - for (; 1 === e3.at(1).type; ) - e3.consume(1); - } - function U(e3) { - let t3 = e3.consume(1); - if (22 !== t3.type) - throw new Error(`Unexpected type ${t3.type}`); - const n3 = t3.value, r3 = []; - for (; ; ) - switch (t3 = e3.consume(1), t3.type) { - case 8: - return { type: 25, name: n3, prelude: r3, value: null }; - case 0: - return e3.error(), { type: 25, name: n3, prelude: r3, value: null }; - case 11: - return { type: 25, name: n3, prelude: r3, value: H(e3) }; - case 28: - if (11 === t3.source.type) - return { type: 25, name: n3, prelude: r3, value: t3 }; - default: - e3.reconsume(), r3.push(Q(e3)); - } - } - function R(e3) { - let t3 = e3.value; - const n3 = []; - for (; ; ) - switch (t3 = e3.consume(1), t3.type) { - case 0: - return e3.error(), x; - case 11: - return { type: 26, prelude: n3, value: H(e3) }; - case 28: - if (11 === t3.source.type) - return { type: 26, prelude: n3, value: t3 }; - default: - e3.reconsume(), n3.push(Q(e3)); - } - } - function I(e3) { - const t3 = e3.consume(1); - if (24 !== t3.type) - throw new Error(`Unexpected type ${t3.type}`); - const n3 = t3.value, r3 = []; - let u3 = false; - if (F(e3), 7 !== e3.at(1).type) - return e3.error(), x; - for (e3.consume(1), F(e3); 0 !== e3.at(1).type; ) - r3.push(Q(e3)); - const o3 = r3[r3.length - 2], s3 = r3[r3.length - 1]; - return o3 && 13 === o3.type && "!" === o3.value && 24 === s3.type && "important" === s3.value.toLowerCase() && (u3 = true, r3.splice(r3.length - 2)), { type: 29, name: n3, value: r3, important: u3 }; - } - function Q(e3) { - const t3 = e3.consume(1); - switch (t3.type) { - case 11: - case 9: - case 4: - return H(e3); - case 23: - return function(e4) { - let t4 = e4.value; - if (23 !== t4.type) - throw new Error(`Unexpected type ${t4.type}`); - const n3 = t4.value, r3 = []; - for (; ; ) - switch (t4 = e4.consume(1), t4.type) { - case 5: - return { type: 27, name: n3, value: r3 }; - case 0: - return e4.error(), { type: 27, name: n3, value: r3 }; - default: - e4.reconsume(), r3.push(Q(e4)); - } - }(e3); - default: - return t3; + return string.match(pattern) || []; } + module.exports = camelCase2; } - function H(e3) { - let t3 = e3.value; - const n3 = t3, r3 = T[n3.type]; - if (!r3) - throw new Error(`Unexpected type ${t3.type}`); - const u3 = []; - for (; ; ) - switch (t3 = e3.consume(1), t3.type) { - case r3: - return { type: 28, source: n3, value: { type: 0, value: u3 } }; - case 0: - return e3.error(), { type: 28, source: n3, value: { type: 0, value: u3 } }; - default: - e3.reconsume(), u3.push(Q(e3)); +}); + +// ../../../node_modules/lodash.kebabcase/index.js +var require_lodash2 = __commonJS({ + "../../../node_modules/lodash.kebabcase/index.js"(exports, module) { + var INFINITY = 1 / 0; + var symbolTag = "[object Symbol]"; + var reAsciiWord = /[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g; + var reLatin = /[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g; + var rsAstralRange = "\\ud800-\\udfff"; + var rsComboMarksRange = "\\u0300-\\u036f\\ufe20-\\ufe23"; + var rsComboSymbolsRange = "\\u20d0-\\u20f0"; + var rsDingbatRange = "\\u2700-\\u27bf"; + var rsLowerRange = "a-z\\xdf-\\xf6\\xf8-\\xff"; + var rsMathOpRange = "\\xac\\xb1\\xd7\\xf7"; + var rsNonCharRange = "\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf"; + var rsPunctuationRange = "\\u2000-\\u206f"; + var rsSpaceRange = " \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000"; + var rsUpperRange = "A-Z\\xc0-\\xd6\\xd8-\\xde"; + var rsVarRange = "\\ufe0e\\ufe0f"; + var rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange; + var rsApos = "['\u2019]"; + var rsBreak = "[" + rsBreakRange + "]"; + var rsCombo = "[" + rsComboMarksRange + rsComboSymbolsRange + "]"; + var rsDigits = "\\d+"; + var rsDingbat = "[" + rsDingbatRange + "]"; + var rsLower = "[" + rsLowerRange + "]"; + var rsMisc = "[^" + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + "]"; + var rsFitz = "\\ud83c[\\udffb-\\udfff]"; + var rsModifier = "(?:" + rsCombo + "|" + rsFitz + ")"; + var rsNonAstral = "[^" + rsAstralRange + "]"; + var rsRegional = "(?:\\ud83c[\\udde6-\\uddff]){2}"; + var rsSurrPair = "[\\ud800-\\udbff][\\udc00-\\udfff]"; + var rsUpper = "[" + rsUpperRange + "]"; + var rsZWJ = "\\u200d"; + var rsLowerMisc = "(?:" + rsLower + "|" + rsMisc + ")"; + var rsUpperMisc = "(?:" + rsUpper + "|" + rsMisc + ")"; + var rsOptLowerContr = "(?:" + rsApos + "(?:d|ll|m|re|s|t|ve))?"; + var rsOptUpperContr = "(?:" + rsApos + "(?:D|LL|M|RE|S|T|VE))?"; + var reOptMod = rsModifier + "?"; + var rsOptVar = "[" + rsVarRange + "]?"; + var rsOptJoin = "(?:" + rsZWJ + "(?:" + [rsNonAstral, rsRegional, rsSurrPair].join("|") + ")" + rsOptVar + reOptMod + ")*"; + var rsSeq = rsOptVar + reOptMod + rsOptJoin; + var rsEmoji = "(?:" + [rsDingbat, rsRegional, rsSurrPair].join("|") + ")" + rsSeq; + var reApos = RegExp(rsApos, "g"); + var reComboMark = RegExp(rsCombo, "g"); + var reUnicodeWord = RegExp([ + rsUpper + "?" + rsLower + "+" + rsOptLowerContr + "(?=" + [rsBreak, rsUpper, "$"].join("|") + ")", + rsUpperMisc + "+" + rsOptUpperContr + "(?=" + [rsBreak, rsUpper + rsLowerMisc, "$"].join("|") + ")", + rsUpper + "?" + rsLowerMisc + "+" + rsOptLowerContr, + rsUpper + "+" + rsOptUpperContr, + rsDigits, + rsEmoji + ].join("|"), "g"); + var reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/; + var deburredLetters = { + // Latin-1 Supplement block. + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\xC7": "C", + "\xE7": "c", + "\xD0": "D", + "\xF0": "d", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\xD1": "N", + "\xF1": "n", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\xDD": "Y", + "\xFD": "y", + "\xFF": "y", + "\xC6": "Ae", + "\xE6": "ae", + "\xDE": "Th", + "\xFE": "th", + "\xDF": "ss", + // Latin Extended-A block. + "\u0100": "A", + "\u0102": "A", + "\u0104": "A", + "\u0101": "a", + "\u0103": "a", + "\u0105": "a", + "\u0106": "C", + "\u0108": "C", + "\u010A": "C", + "\u010C": "C", + "\u0107": "c", + "\u0109": "c", + "\u010B": "c", + "\u010D": "c", + "\u010E": "D", + "\u0110": "D", + "\u010F": "d", + "\u0111": "d", + "\u0112": "E", + "\u0114": "E", + "\u0116": "E", + "\u0118": "E", + "\u011A": "E", + "\u0113": "e", + "\u0115": "e", + "\u0117": "e", + "\u0119": "e", + "\u011B": "e", + "\u011C": "G", + "\u011E": "G", + "\u0120": "G", + "\u0122": "G", + "\u011D": "g", + "\u011F": "g", + "\u0121": "g", + "\u0123": "g", + "\u0124": "H", + "\u0126": "H", + "\u0125": "h", + "\u0127": "h", + "\u0128": "I", + "\u012A": "I", + "\u012C": "I", + "\u012E": "I", + "\u0130": "I", + "\u0129": "i", + "\u012B": "i", + "\u012D": "i", + "\u012F": "i", + "\u0131": "i", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u0138": "k", + "\u0139": "L", + "\u013B": "L", + "\u013D": "L", + "\u013F": "L", + "\u0141": "L", + "\u013A": "l", + "\u013C": "l", + "\u013E": "l", + "\u0140": "l", + "\u0142": "l", + "\u0143": "N", + "\u0145": "N", + "\u0147": "N", + "\u014A": "N", + "\u0144": "n", + "\u0146": "n", + "\u0148": "n", + "\u014B": "n", + "\u014C": "O", + "\u014E": "O", + "\u0150": "O", + "\u014D": "o", + "\u014F": "o", + "\u0151": "o", + "\u0154": "R", + "\u0156": "R", + "\u0158": "R", + "\u0155": "r", + "\u0157": "r", + "\u0159": "r", + "\u015A": "S", + "\u015C": "S", + "\u015E": "S", + "\u0160": "S", + "\u015B": "s", + "\u015D": "s", + "\u015F": "s", + "\u0161": "s", + "\u0162": "T", + "\u0164": "T", + "\u0166": "T", + "\u0163": "t", + "\u0165": "t", + "\u0167": "t", + "\u0168": "U", + "\u016A": "U", + "\u016C": "U", + "\u016E": "U", + "\u0170": "U", + "\u0172": "U", + "\u0169": "u", + "\u016B": "u", + "\u016D": "u", + "\u016F": "u", + "\u0171": "u", + "\u0173": "u", + "\u0174": "W", + "\u0175": "w", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "\u0179": "Z", + "\u017B": "Z", + "\u017D": "Z", + "\u017A": "z", + "\u017C": "z", + "\u017E": "z", + "\u0132": "IJ", + "\u0133": "ij", + "\u0152": "Oe", + "\u0153": "oe", + "\u0149": "'n", + "\u017F": "ss" + }; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, length = array ? array.length : 0; + if (initAccum && length) { + accumulator = array[++index]; } - } - function V(e3) { - return F(e3), 0 === e3.at(1).type; - } - var D = { 11: ["{", "}"], 9: ["[", "]"], 4: ["(", ")"] }; - function W(e3, t3) { - switch (e3.type) { - case 25: - return `@${CSS.escape(e3.name)} ${e3.prelude.map((e4) => W(e4)).join("")}${e3.value ? W(e3.value) : ";"}`; - case 26: - return `${e3.prelude.map((e4) => W(e4)).join("")}${W(e3.value)}`; - case 28: { - const [t4, n3] = D[e3.source.type]; - return `${t4}${_(e3.value)}${n3}`; + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); } - case 27: - return `${CSS.escape(e3.name)}(${e3.value.map((e4) => W(e4)).join("")})`; - case 29: - return `${CSS.escape(e3.name)}:${e3.value.map((e4) => W(e4)).join("")}${e3.important ? " !important" : ""}`; - case 1: - return " "; - case 8: - return ";"; - case 7: - return ":"; - case 14: - return "#" + CSS.escape(e3.value); - case 24: - return CSS.escape(e3.value); - case 15: - return e3.value + CSS.escape(e3.unit); - case 13: - case 17: - return e3.value; - case 2: - return `"${CSS.escape(e3.value)}"`; - case 6: - return ","; - case 20: - return "url(" + CSS.escape(e3.value) + ")"; - case 22: - return "@" + CSS.escape(e3.value); - case 16: - return e3.value + "%"; - default: - throw new Error(`Unsupported token ${e3.type}`); + return accumulator; } - } - function _(e3, t3) { - return e3.value.map((t4) => { - let n3 = W(t4); - return 29 === t4.type && 0 !== e3.type && (n3 += ";"), n3; - }).join(""); - } - function B(e3) { - return W(e3); - } - function G(e3) { - const t3 = e3.at(1); - return 13 === t3.type && "=" === t3.value && (e3.consume(1), true); - } - function Y(e3, t3) { - const n3 = []; - for (; ; ) { - const r3 = e3.at(1); - if (0 === r3.type || t3 && 7 === r3.type || 13 === r3.type && (">" === r3.value || "<" === r3.value || "=" === r3.value)) - break; - n3.push(e3.consume(1)); + function asciiWords(string) { + return string.match(reAsciiWord) || []; } - return n3; - } - function J(e3) { - F(e3); - const t3 = e3.consume(1); - return 13 !== t3.type ? x : ">" === t3.value ? G(e3) ? 3 : 2 : "<" === t3.value ? G(e3) ? 5 : 4 : "=" === t3.value ? 1 : x; - } - function K(e3) { - return 4 === e3 || 5 === e3; - } - function X(e3) { - return 2 === e3 || 3 === e3; - } - function Z(e3, t3, n3) { - const r3 = function(e4) { - F(e4); - const t4 = e4.consume(1); - return F(e4), 24 !== t4.type || 0 !== e4.at(1).type ? x : t4.value; - }(C(e3)); - if (r3 === x) - return x; - let u3 = r3.toLowerCase(); - return u3 = n3 ? n3(u3) : u3, t3.has(u3) ? u3 : x; - } - function ee(e3) { - return { type: 13, value: e3 }; - } - function te(e3, t3) { - return { type: 29, name: e3, value: t3, important: false }; - } - function ne(e3) { - return { type: 24, value: e3 }; - } - function re(e3, t3) { - return { type: 27, name: e3, value: t3 }; - } - function ue(e3) { - return re("var", [ne(e3)]); - } - function oe(e3, t3) { - F(e3); - let n3 = false, r3 = e3.at(1); - if (24 === r3.type) { - if ("not" !== r3.value.toLowerCase()) - return x; - e3.consume(1), F(e3), n3 = true; + function basePropertyOf(object) { + return function(key) { + return object == null ? void 0 : object[key]; + }; } - let u3 = function(e4) { - const t4 = e4.consume(1); - switch (t4.type) { - case 28: { - if (4 !== t4.source.type) - return x; - const e5 = oe(C(t4.value.value), null); - return e5 !== x ? e5 : { type: 4, value: t4 }; - } - case 27: - return { type: 4, value: t4 }; - default: - return x; - } - }(e3); - if (u3 === x) - return x; - u3 = n3 ? { type: 1, value: u3 } : u3, F(e3), r3 = e3.at(1); - const o3 = 24 === r3.type ? r3.value.toLowerCase() : null; - if (null !== o3) { - if (e3.consume(1), F(e3), "and" !== o3 && "or" !== o3 || null !== t3 && o3 !== t3) - return x; - const n4 = oe(e3, o3); - return n4 === x ? x : { type: "and" === o3 ? 2 : 3, left: u3, right: n4 }; + var deburrLetter = basePropertyOf(deburredLetters); + function hasUnicodeWord(string) { + return reHasUnicodeWord.test(string); } - return V(e3) ? u3 : x; - } - function se(e3) { - return oe(e3, null); - } - function le(e3) { - switch (e3.type) { - case 1: - return [ne("not"), { type: 1 }, ...le(e3.value)]; - case 2: - case 3: - return [...le(e3.left), { type: 1 }, ne(2 === e3.type ? "and" : "or"), { type: 1 }, ...le(e3.right)]; - case 4: - return [e3.value]; + function unicodeWords(string) { + return string.match(reUnicodeWord) || []; } - } - var ce = { width: 1, height: 2, "inline-size": 3, "block-size": 4, "aspect-ratio": 5, orientation: 6 }; - var ie = new Set(Object.keys(ce)); - var ae = /* @__PURE__ */ new Set(["none", "and", "not", "or", "normal", "auto"]); - var fe = /* @__PURE__ */ new Set(["initial", "inherit", "revert", "revert-layer", "unset"]); - var pe = /* @__PURE__ */ new Set(["size", "inline-size"]); - function ye(e3, t3, n3, r3) { - const u3 = n3(); - if (u3 === x) - return x; - let o3 = [u3, null]; - F(e3); - const s3 = e3.at(1); - if (13 === s3.type) { - if (s3.value !== t3) - return x; - e3.consume(1), F(e3); - const n4 = r3(); - F(e3), n4 !== x && (o3 = [u3, n4]); - } - return V(e3) ? o3 : x; - } - function he(e3) { - const t3 = e3.consume(1); - return 17 === t3.type ? parseInt(t3.value) : x; - } - function ve(e3) { - const t3 = C(e3); - F(t3); - const n3 = t3.consume(1); - let r3 = x; - switch (n3.type) { - case 17: - t3.reconsume(), r3 = function(e4) { - const t4 = ye(e4, "/", () => he(e4), () => he(e4)); - return t4 === x ? x : { type: 2, value: t4[0] / (null !== t4[1] ? t4[1] : 1) }; - }(t3); - break; - case 15: - r3 = { type: 3, value: parseInt(n3.value), unit: n3.unit.toLowerCase() }; - break; - case 24: { - const e4 = n3.value.toLowerCase(); - switch (e4) { - case "landscape": - case "portrait": - r3 = { type: 4, value: e4 }; - } + var objectProto = Object.prototype; + var objectToString = objectProto.toString; + var Symbol2 = root.Symbol; + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function baseToString(value) { + if (typeof value == "string") { + return value; } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; } - return r3 === x ? x : V(t3) ? { type: 6, value: r3 } : x; - } - function de(e3) { - return !ge(e3 = e3.toLowerCase()) && !ae.has(e3); - } - function me(e3, t3) { - const n3 = []; - for (; ; ) { - F(e3); - const r3 = e3.at(1); - if (24 !== r3.type || !t3(r3.value)) - return n3; - e3.consume(1), n3.push(r3.value); + function createCompounder(callback) { + return function(string) { + return arrayReduce(words(deburr(string).replace(reApos, "")), callback, ""); + }; } - } - function we(e3) { - const t3 = []; - for (; ; ) { - F(e3); - const n3 = e3.at(1); - if (24 !== n3.type) - break; - const r3 = n3.value; - if (!de(r3)) - break; - e3.consume(1), t3.push(r3); + function isObjectLike(value) { + return !!value && typeof value == "object"; } - return t3; - } - function ge(e3) { - return fe.has(e3); - } - function be(e3) { - return e3.map((e4) => "cq-" + e4); - } - function Se(e3) { - const t3 = me(e3, (e4) => ge(e4)); - return 1 === t3.length ? be(t3) : x; - } - function xe(e3, t3) { - const n3 = me(e3, (e4) => "none" === e4); - if (1 === n3.length) - return be(n3); - if (0 !== n3.length) - return x; - if (t3) { - const t4 = Se(e3); - if (t4 !== x) - return t4; + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; } - const r3 = we(e3); - return r3.length > 0 && (!t3 || V(e3)) ? r3 : x; - } - function qe(e3, t3) { - if (t3) { - const t4 = Se(e3); - if (t4 !== x) - return t4; + function toString(value) { + return value == null ? "" : baseToString(value); } - return function(e4) { - const t4 = me(e4, (e5) => "normal" === e5); - if (1 === t4.length) - return be(t4); - if (0 !== t4.length) - return x; - const n3 = me(e4, (e5) => pe.has(e5)); - return n3.length > 0 && V(e4) ? n3 : x; - }(e3); - } - function Ce(e3) { - const t3 = C(e3), n3 = Se(t3); - if (n3 !== x) - return [n3, n3]; - const r3 = ye(t3, "/", () => xe(t3, false), () => qe(t3, false)); - return r3 !== x && V(t3) ? [r3[0], r3[1] || []] : x; - } - function $e(e3) { - const t3 = C(e3), n3 = we(t3); - if (!n3 || n3.length > 1) - return x; - const r3 = se(t3); - if (r3 === x) - return x; - const u3 = { features: /* @__PURE__ */ new Set() }, o3 = ke(r3, u3); - return V(t3) ? { name: n3.length > 0 ? n3[0] : null, condition: o3, features: u3.features } : x; - } - function ke(e3, t3) { - switch (e3.type) { - case 1: - return { type: 1, value: ke(e3.value, t3) }; - case 2: - case 3: - return { type: 2 === e3.type ? 2 : 3, left: ke(e3.left, t3), right: ke(e3.right, t3) }; - case 4: - if (28 === e3.value.type) { - const n3 = function(e4, t4) { - const n4 = function(e5, t5) { - const n5 = Y(e5, true), r4 = e5.at(1); - if (0 === r4.type) { - const e6 = Z(n5, t5); - return e6 !== x && t5.has(e6) ? { type: 1, feature: e6 } : x; - } - if (7 === r4.type) { - e5.consume(1); - const r5 = Y(e5, false); - let u4 = 1; - const o4 = Z(n5, t5, (e6) => e6.startsWith("min-") ? (u4 = 3, e6.substring(4)) : e6.startsWith("max-") ? (u4 = 5, e6.substring(4)) : e6); - return o4 !== x ? { type: 2, feature: o4, bounds: [null, [u4, r5]] } : x; - } - const u3 = J(e5); - if (u3 === x) - return x; - const o3 = Y(e5, false); - if (0 === e5.at(1).type) { - const e6 = Z(n5, t5); - if (e6 !== x) - return { type: 2, feature: e6, bounds: [null, [u3, o3]] }; - const r5 = Z(o3, t5); - return r5 !== x ? { type: 2, feature: r5, bounds: [[u3, n5], null] } : x; - } - const s3 = J(e5); - if (s3 === x || !(X(u3) && X(s3) || K(u3) && K(s3))) - return x; - const l2 = Y(e5, false), c3 = Z(o3, t5); - return c3 !== x ? { type: 2, feature: c3, bounds: [[u3, n5], [s3, l2]] } : x; - }(e4, ie); - if (n4 === x) - return x; - const r3 = ce[n4.feature]; - if (null == r3) - return x; - if (t4.features.add(r3), 1 === n4.type) - return { type: 5, feature: r3 }; - { - const e5 = { type: 5, feature: r3 }; - let t5 = x; - if (null !== n4.bounds[0]) { - const r4 = ve(n4.bounds[0][1]); - if (r4 === x) - return x; - t5 = { type: 4, operator: n4.bounds[0][0], left: r4, right: e5 }; - } - if (null !== n4.bounds[1]) { - const r4 = ve(n4.bounds[1][1]); - if (r4 === x) - return x; - const u3 = { type: 4, operator: n4.bounds[1][0], left: e5, right: r4 }; - t5 = t5 !== x ? { type: 2, left: t5, right: u3 } : u3; - } - return t5; - } - }(C(e3.value.value.value), t3); - if (n3 !== x) - return n3; - } - return { type: 6, value: { type: 1 } }; + function deburr(string) { + string = toString(string); + return string && string.replace(reLatin, deburrLetter).replace(reComboMark, ""); } - } - var Ae = 0; - var Ee = { cqw: m, cqh: w, cqi: g, cqb: b }; - var ze = CSS.supports("selector(:where(div))"); - var Le = ":not(.container-query-polyfill)"; - N(Array.from($(Le))); - var je = document.createElement("div"); - var Me = /* @__PURE__ */ new Set(["before", "after", "first-line", "first-letter"]); - function Te(e3, t3) { - return re("calc", [{ type: 17, flag: e3.flag, value: e3.value }, ee("*"), t3]); - } - function Pe(t3) { - return t3.map((t4) => { - switch (t4.type) { - case 15: - return function(e3) { - const t5 = e3.unit, n3 = Ee[t5]; - return null != n3 ? Te(e3, ue(n3)) : "cqmin" === t5 || "cqmax" === t5 ? Te(e3, re(e3.unit.slice(2), [ue(g), { type: 6 }, ue(b)])) : e3; - }(t4); - case 27: - return e({}, t4, { value: Pe(t4.value) }); - } - return t4; + var kebabCase2 = createCompounder(function(result, word, index) { + return result + (index ? "-" : "") + word.toLowerCase(); }); - } - function Ne(t3) { - switch (t3.name) { - case "container": - return Ce(t3.value) ? e({}, t3, { name: p }) : t3; - case "container-name": - return xe(C(t3.value), true) ? e({}, t3, { name: h }) : t3; - case "container-type": - return null != qe(C(t3.value), true) ? e({}, t3, { name: y }) : t3; - } - return e({}, t3, { value: Pe(t3.value) }); - } - function Oe(t3, n3) { - return e({}, t3, { value: t3.value.map((t4) => { - switch (t4.type) { - case 25: - return He(t4, n3); - case 26: - return function(t5, n4) { - return n4.transformStyleRule(e({}, t5, { value: Re(t5.value, n4) })); - }(t4, n3); - default: - return t4; + function words(string, pattern, guard) { + string = toString(string); + pattern = guard ? void 0 : pattern; + if (pattern === void 0) { + return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string); } - }) }); - } - function Fe(e3) { - return 0 === e3.type || 6 === e3.type; - } - function Ue(e3) { - for (let t3 = e3.length - 1; t3 >= 0; t3--) - if (1 !== e3[t3].type) - return e3.slice(0, t3 + 1); - return e3; - } - function Re(t3, n3) { - return function(t4, n4) { - const r3 = []; - let u3 = null, o3 = null; - for (const e3 of t4.value.value) - switch (e3.type) { - case 25: - { - const t5 = n4 ? n4(e3) : e3; - t5 && r3.push(t5); - } - break; - case 29: { - const t5 = Ne(e3); - switch (t5.name) { - case p: { - const t6 = Ce(e3.value); - t6 !== x && (u3 = t6[0], o3 = t6[1]); - break; - } - case h: { - const t6 = xe(C(e3.value), true); - t6 !== x && (u3 = t6); - break; - } - case y: { - const t6 = qe(C(e3.value), true); - t6 !== x && (o3 = t6); - break; - } - default: - r3.push(t5); - } - } - } - return u3 && u3.length > 0 && r3.push(te(h, [ne(u3.join(" "))])), o3 && o3.length > 0 && r3.push(te(y, [ne(o3.join(" "))])), e({}, t4, { value: { type: 2, value: r3 } }); - }(t3, (e3) => He(e3, n3)); - } - function Ie(t3) { - if (1 === t3.type) - return e({}, t3, { value: Ie(t3.value) }); - if (2 === t3.type || 3 === t3.type) - return e({}, t3, { left: Ie(t3.left), right: Ie(t3.right) }); - if (4 === t3.type && 28 === t3.value.type) { - const n3 = function(e3) { - const t4 = C(e3); - return F(t4), 24 !== t4.at(1).type ? x : I(t4) || x; - }(t3.value.value.value); - if (n3 !== x) - return e({}, t3, { value: e({}, t3.value, { value: { type: 0, value: [Ne(n3)] } }) }); + return string.match(pattern) || []; } - return t3; + module.exports = kebabCase2; } - function Qe(t3, n3) { - let r3 = se(C(t3.prelude)); - return r3 = r3 !== x ? Ie(r3) : x, e({}, t3, { prelude: r3 !== x ? le(r3) : t3.prelude, value: t3.value ? e({}, t3.value, { value: Oe(P(t3.value.value.value), n3) }) : null }); - } - function He(t3, n3) { - switch (t3.name.toLocaleLowerCase()) { - case "media": - case "layer": - return function(t4, n4) { - return e({}, t4, { value: t4.value ? e({}, t4.value, { value: Oe(P(t4.value.value.value), n4) }) : null }); - }(t3, n3); - case "keyframes": - return function(t4, n4) { - let r3 = null; - return t4.value && (r3 = e({}, t4.value, { value: { type: 3, value: P(t4.value.value.value).value.map((t5) => { - switch (t5.type) { - case 26: - return function(t6, n5) { - return e({}, t6, { value: Re(t6.value, n5) }); - }(t5, n4); - case 25: - return He(t5, n4); - } - }) } })), e({}, t4, { value: r3 }); - }(t3, n3); - case "supports": - return Qe(t3, n3); - case "container": - return function(t4, n4) { - if (t4.value) { - const r3 = $e(t4.prelude); - if (r3 !== x) { - const u3 = { rule: r3, selector: null, parent: n4.parent, uid: "c" + Ae++ }, o3 = /* @__PURE__ */ new Set(), s3 = [], l2 = Oe(P(t4.value.value.value), { descriptors: n4.descriptors, parent: u3, transformStyleRule: (t5) => { - const [n5, r4] = function(e3, t6, n6) { - const r5 = C(e3), u4 = [], o4 = []; - for (; ; ) { - if (0 === r5.at(1).type) - return [u4, o4]; - const n7 = Math.max(0, r5.index); - for (; l4 = r5.at(1), c3 = r5.at(2), !(Fe(l4) || 7 === l4.type && (7 === c3.type || 24 === c3.type && Me.has(c3.value.toLowerCase()))); ) - r5.consume(1); - const i3 = r5.index + 1, a3 = e3.slice(n7, i3), f3 = a3.length > 0 ? Ue(a3) : [ee("*")]; - for (; !Fe(r5.at(1)); ) - r5.consume(1); - const p2 = e3.slice(i3, Math.max(0, r5.index + 1)); - let y3 = f3, h3 = [{ type: 28, source: { type: 9 }, value: { type: 0, value: [ne(p2.length > 0 ? v : d), ee("~"), ee("="), { type: 2, value: t6 }] } }]; - if (ze) - h3 = [ee(":"), re("where", h3)]; - else { - const e4 = f3.map(B).join(""); - e4.endsWith(Le) ? y3 = N(Array.from($(e4.substring(0, e4.length - Le.length)))) : s3.push({ actual: e4, expected: e4 + Le }); - } - u4.push(...f3), o4.push(...y3), o4.push(...h3), o4.push(...p2), r5.consume(1); - } - var l4, c3; - }(t5.prelude, u3.uid); - if (s3.length > 0) - return t5; - const l3 = n5.map(B).join(""); - try { - je.matches(l3), o3.add(l3); - } catch (e3) { - } - return e({}, t5, { prelude: r4 }); - } }).value; - if (s3.length > 0) { - const e3 = /* @__PURE__ */ new Set(), t5 = []; - let n5 = 0; - for (const { actual: e4 } of s3) - n5 = Math.max(n5, e4.length); - const r4 = Array.from({ length: n5 }, () => " ").join(""); - for (const { actual: u4, expected: o4 } of s3) - e3.has(u4) || (t5.push(`${u4}${r4.substring(0, n5 - u4.length)} => ${o4}`), e3.add(u4)); - console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules: +}); -${t5.join("\n")}`); - } - return o3.size > 0 && (u3.selector = Array.from(o3).join(", ")), n4.descriptors.push(u3), { type: 25, name: "media", prelude: [ne("all")], value: e({}, t4.value, { value: { type: 3, value: l2 } }) }; - } - } - return t4; - }(t3, n3); - } - return t3; - } - var Ve = class { - constructor(e3) { - this.value = void 0, this.value = e3; - } - }; - function De(e3, t3) { - if (e3 === t3) - return true; - if (typeof e3 == typeof t3 && null !== e3 && null !== t3 && "object" == typeof e3) { - if (Array.isArray(e3)) { - if (!Array.isArray(t3) || t3.length !== e3.length) - return false; - for (let n3 = 0, r3 = e3.length; n3 < r3; n3++) - if (!De(e3[n3], t3[n3])) - return false; - return true; +// ../../../node_modules/lodash.mapvalues/index.js +var require_lodash3 = __commonJS({ + "../../../node_modules/lodash.mapvalues/index.js"(exports, module) { + var LARGE_ARRAY_SIZE = 200; + var FUNC_ERROR_TEXT = "Expected a function"; + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var UNORDERED_COMPARE_FLAG = 1; + var PARTIAL_COMPARE_FLAG = 2; + var INFINITY = 1 / 0; + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = "[object Arguments]"; + var arrayTag = "[object Array]"; + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var errorTag = "[object Error]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var objectTag = "[object Object]"; + var promiseTag = "[object Promise]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var weakMapTag = "[object WeakMap]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var reIsPlainProp = /^\w*$/; + var reLeadingDot = /^\./; + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reEscapeChar = /\\(\\)?/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + return freeProcess && freeProcess.binding("util"); + } catch (e2) { } - if (e3 instanceof Ve) - return t3 instanceof Ve && e3.value === t3.value; - { - const n3 = Object.keys(e3); - if (n3.length !== Object.keys(t3).length) - return false; - for (let r3 = 0, u3 = n3.length; r3 < u3; r3++) { - const u4 = n3[r3]; - if (!De(e3[u4], t3[u4])) - return false; + }(); + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function arraySome(array, predicate) { + var index = -1, length = array ? array.length : 0; + while (++index < length) { + if (predicate(array[index], index, array)) { + return true; } - return true; } + return false; } - return false; - } - var We = Symbol("CQ_INSTANCE"); - var _e = Symbol("CQ_STYLESHEET"); - var Be = CSS.supports("width: 1svh"); - var Ge = /* @__PURE__ */ new Set(["vertical-lr", "vertical-rl", "sideways-rl", "sideways-lr", "tb", "tb-lr", "tb-rl"]); - var Ye = ["padding-left", "padding-right", "border-left-width", "border-right-width"]; - var Je = ["padding-top", "padding-bottom", "border-top-width", "border-bottom-width"]; - var Ke = /(\w*(\s|-))?(table|ruby)(-\w*)?/; - var Xe = class { - constructor(e3) { - this.node = void 0, this.node = e3; + function baseProperty(key) { + return function(object) { + return object == null ? void 0 : object[key]; + }; } - connected() { + function baseTimes(n2, iteratee) { + var index = -1, result = Array(n2); + while (++index < n2) { + result[index] = iteratee(index); + } + return result; } - disconnected() { + function baseUnary(func) { + return function(value) { + return func(value); + }; } - updated() { + function getValue(object, key) { + return object == null ? void 0 : object[key]; } - }; - var Ze = class extends Xe { - constructor(e3, t3) { - super(e3), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t3; - } - connected() { - var e3 = this; - const t3 = this.node; - if ("stylesheet" === t3.rel) { - const n3 = new URL(t3.href, document.baseURI); - n3.origin === location.origin && (this.controller = rt(async function(r3) { - const u3 = await fetch(n3.toString(), { signal: r3 }), o3 = await u3.text(), s3 = e3.styleSheet = await e3.context.registerStyleSheet({ source: o3, url: n3, signal: r3 }), l2 = new Blob([s3.source], { type: "text/css" }), c3 = new Image(); - c3.onload = c3.onerror = s3.refresh, c3.src = t3.href = URL.createObjectURL(l2); - })); + function isHostObject(value) { + var result = false; + if (value != null && typeof value.toString != "function") { + try { + result = !!(value + ""); + } catch (e2) { + } } + return result; } - disconnected() { - var e3, t3; - null == (e3 = this.controller) || e3.abort(), this.controller = null, null == (t3 = this.styleSheet) || t3.dispose(), this.styleSheet = null; + function mapToArray(map) { + var index = -1, result = Array(map.size); + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; } - }; - var et = class extends Xe { - constructor(e3, t3) { - super(e3), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t3; + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } - connected() { - var e3 = this; - this.controller = rt(async function(t3) { - const n3 = e3.node, r3 = e3.styleSheet = await e3.context.registerStyleSheet({ source: n3.innerHTML, signal: t3 }); - n3.innerHTML = r3.source, r3.refresh(); + function setToArray(set) { + var index = -1, result = Array(set.size); + set.forEach(function(value) { + result[++index] = value; }); + return result; } - disconnected() { - var e3, t3; - null == (e3 = this.controller) || e3.abort(), this.controller = null, null == (t3 = this.styleSheet) || t3.dispose(), this.styleSheet = null; + var arrayProto = Array.prototype; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var coreJsData = root["__core-js_shared__"]; + var maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + var Symbol2 = root.Symbol; + var Uint8Array2 = root.Uint8Array; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var splice = arrayProto.splice; + var nativeKeys = overArg(Object.keys, Object); + var DataView = getNative(root, "DataView"); + var Map2 = getNative(root, "Map"); + var Promise2 = getNative(root, "Promise"); + var Set2 = getNative(root, "Set"); + var WeakMap2 = getNative(root, "WeakMap"); + var nativeCreate = getNative(Object, "create"); + var dataViewCtorString = toSource(DataView); + var mapCtorString = toSource(Map2); + var promiseCtorString = toSource(Promise2); + var setCtorString = toSource(Set2); + var weakMapCtorString = toSource(WeakMap2); + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function Hash(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - }; - var tt = class extends Xe { - connected() { - const e3 = `* { ${y}: cq-normal; ${h}: cq-none; }`; - this.node.innerHTML = void 0 === window.CSSLayerBlockRule ? e3 : `@layer cq-polyfill-${f} { ${e3} }`; + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; } - }; - var nt = class extends Xe { - constructor(e3, t3) { - super(e3), this.context = void 0, this.styles = void 0, this.context = t3, this.styles = window.getComputedStyle(e3); + function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; } - connected() { - this.node.style.cssText = "position: fixed; top: 0; left: 0; visibility: hidden; " + (Be ? "width: 1svw; height: 1svh;" : "width: 1%; height: 1%;"); - } - updated() { - const e3 = ct((e4) => this.styles.getPropertyValue(e4)); - this.context.viewportChanged({ width: e3.width, height: e3.height }); - } - }; - function rt(e3) { - const t3 = new AbortController(); - return e3(t3.signal).catch((e4) => { - if (!(e4 instanceof DOMException && "AbortError" === e4.message)) - throw e4; - }), t3; - } - function ut(e3) { - let t3 = 0; - if (0 === e3.length) - return t3; - if (e3.startsWith("cq-") && ("normal" === (e3 = e3.substring("cq-".length)) || ge(e3))) - return t3; - const n3 = e3.split(" "); - for (const e4 of n3) - switch (e4) { - case "size": - t3 |= 3; - break; - case "inline-size": - t3 |= 1; - break; - default: - return 0; + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; } - return t3; - } - function ot(e3) { - let t3 = 0; - return "none" !== e3 && (t3 |= 1, "contents" === e3 || "inline" === e3 || Ke.test(e3) || (t3 |= 2)), t3; - } - function st(e3, t3) { - return parseFloat(e3(t3)); - } - function lt(e3, t3) { - return t3.reduce((t4, n3) => t4 + st(e3, n3), 0); - } - function ct(e3) { - let t3 = 0, n3 = 0; - return "border-box" === e3("box-sizing") && (t3 = lt(e3, Ye), n3 = lt(e3, Je)), { fontSize: st(e3, "font-size"), width: st(e3, "width") - t3, height: st(e3, "height") - n3 }; - } - function it(e3) { - return { containerType: ut(e3(y).trim()), containerNames: (n3 = e3(h).trim(), n3.startsWith("cq-") && ("none" === (n3 = n3.substring("cq-".length)) || ge(n3)) ? /* @__PURE__ */ new Set([]) : new Set(0 === n3.length ? [] : n3.split(" "))), writingAxis: (t3 = e3("writing-mode").trim(), Ge.has(t3) ? 1 : 0), displayFlags: ot(e3("display").trim()) }; - var t3, n3; - } - function at(e3, t3, n3) { - null != n3 ? n3 != e3.getPropertyValue(t3) && e3.setProperty(t3, n3) : e3.removeProperty(t3); - } - function ft(e3) { - const t3 = e3[_e]; - return null != t3 ? t3 : []; - } - function pt(e3, t3) { - e3[_e] = t3; - } - new Promise((e3) => { - }), window.CQPolyfill = { version: "1.0.2" }, "container" in document.documentElement.style || function(n3) { - function r3(e3) { - return e3[We] || null; + return hasOwnProperty.call(data, key) ? data[key] : void 0; } - const u3 = document.documentElement; - if (r3(u3)) - return; - const o3 = document.createElement(`cq-polyfill-${f}`), s3 = document.createElement("style"); - new MutationObserver((e3) => { - for (const t3 of e3) { - for (const e4 of t3.removedNodes) { - const t4 = r3(e4); - null == t4 || t4.disconnect(); - } - t3.target.nodeType !== Node.DOCUMENT_NODE && t3.target.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && null === t3.target.parentNode || "attributes" === t3.type && t3.attributeName && (t3.attributeName === v || t3.attributeName === d || t3.target instanceof Element && t3.target.getAttribute(t3.attributeName) === t3.oldValue) || (A3(t3.target).mutate(), S2()); - } - }).observe(u3, { childList: true, subtree: true, attributes: true, attributeOldValue: true }); - const l2 = new ResizeObserver((e3) => { - for (const t3 of e3) - A3(t3.target).resize(); - A3(u3).update(C3()); - }), c3 = new Xe(u3); - async function a3(e3, { source: t3, url: n4, signal: r4 }) { - const o4 = function(e4, t4) { - try { - const n5 = Array.from($(e4)); - if (t4) - for (let e5 = 0; e5 < n5.length; e5++) { - const r6 = n5[e5]; - if (20 === r6.type) - r6.value = new URL(r6.value, t4).toString(); - else if (23 === r6.type && "url" === r6.value.toLowerCase()) { - const r7 = e5 + 1 < n5.length ? n5[e5 + 1] : null; - r7 && 2 === r7.type && (r7.value = new URL(r7.value, t4).toString()); - } - } - const r5 = { descriptors: [], parent: null, transformStyleRule: (e5) => e5 }; - return { source: _(Oe(P(n5, true), r5)), descriptors: r5.descriptors }; - } catch (t5) { - return console.warn("An error occurred while transpiling stylesheet: " + t5), { source: e4, descriptors: [] }; - } - }(t3, n4 ? n4.toString() : void 0); - let s4 = () => { - }, l3 = () => { - }; - const c4 = A3(u3); - let i3 = false; - return null != r4 && r4.aborted || (l3 = () => { - if (!i3) { - const { sheet: t4 } = e3; - null != t4 && (pt(t4, o4.descriptors), i3 = true, s4 = () => { - pt(t4), c4.mutate(), S2(); - }, c4.mutate(), S2()); - } - }), { source: o4.source, dispose: s4, refresh: l3 }; + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); } - const p2 = { cqw: null, cqh: null }; - function y3({ width: e3, height: t3 }) { - p2.cqw = e3, p2.cqh = t3; + function hashSet(key, value) { + var data = this.__data__; + data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; + return this; } - function h3(e3, t3, n4) { - if (e3 instanceof Element && t3) { - let r4 = ""; - for (const [n5, u4] of t3.conditions) { - const t4 = n5.value; - null != t4.selector && null != u4 && 2 == (2 & u4) && e3.matches(t4.selector) && (r4.length > 0 && (r4 += " "), r4 += t4.uid); - } - r4.length > 0 ? e3.setAttribute(n4, r4) : e3.removeAttribute(n4); + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + function ListCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } } - function S2() { - l2.unobserve(u3), l2.observe(u3); + function listCacheClear() { + this.__data__ = []; } - const x3 = () => { - const e3 = []; - for (const t3 of document.styleSheets) - for (const n4 of ft(t3)) - e3.push([new Ve(n4), 0]); - return e3; - }, q2 = window.getComputedStyle(u3), C3 = () => { - const t3 = (e3) => q2.getPropertyValue(e3), n4 = it(t3), r4 = ct(t3); - return { parentState: null, conditions: x3(), context: e({}, p2, { fontSize: r4.fontSize, rootFontSize: r4.fontSize, writingAxis: n4.writingAxis }), displayFlags: n4.displayFlags, isQueryContainer: false }; - }, k3 = (e3) => e3; - function A3(n4) { - let f3 = r3(n4); - if (!f3) { - let p3, S3 = null, x4 = false; - n4 === u3 ? (p3 = c3, S3 = k3) : n4 === o3 ? (x4 = true, p3 = new nt(o3, { viewportChanged: y3 })) : p3 = n4 === s3 ? new tt(s3) : n4 instanceof HTMLLinkElement ? new Ze(n4, { registerStyleSheet: (t3) => a3(n4, e({}, t3)) }) : n4 instanceof HTMLStyleElement ? new et(n4, { registerStyleSheet: (t3) => a3(n4, e({}, t3)) }) : new Xe(n4); - let q3 = Symbol(); - if (null == S3 && n4 instanceof Element) { - const r4 = function(n5) { - const r5 = window.getComputedStyle(n5); - return /* @__PURE__ */ function(n6) { - let u4 = null; - return (...n7) => { - if (null == u4 || !De(u4[0], n7)) { - const o4 = ((n8, u5) => { - const { context: o5, conditions: s4 } = n8, l3 = (e3) => r5.getPropertyValue(e3), c4 = it(l3), a4 = e({}, o5, { writingAxis: c4.writingAxis }); - let f4 = s4, p4 = false, y4 = c4.displayFlags; - 0 == (1 & n8.displayFlags) && (y4 = 0); - const { containerType: h4, containerNames: v3 } = c4; - if (h4 > 0) { - const e3 = h4 > 0 && 2 == (2 & y4), n9 = new Map(s4.map((e4) => [e4[0].value, e4[1]])); - if (f4 = [], p4 = true, e3) { - const e4 = ct(l3); - a4.fontSize = e4.fontSize; - const r6 = function(e5, t3) { - const n10 = { value: t3.width }, r7 = { value: t3.height }; - let u7 = n10, o6 = r7; - if (1 === e5.writingAxis) { - const e6 = u7; - u7 = o6, o6 = e6; - } - return 2 != (2 & e5.containerType) && (o6.value = void 0), { width: n10.value, height: r7.value, inlineSize: u7.value, blockSize: o6.value }; - }(c4, e4), u6 = { sizeFeatures: r6, treeContext: a4 }, p5 = (e5) => { - const { rule: r7 } = e5, o6 = r7.name, s5 = null == o6 || v3.has(o6) ? function(e6, n10) { - const r8 = /* @__PURE__ */ new Map(), u7 = n10.sizeFeatures; - for (const n11 of e6.features) { - const e7 = t(n11, u7); - if (1 === e7.type) - return null; - r8.set(n11, e7); - } - const o7 = i(e6.condition, { sizeFeatures: r8, treeContext: n10.treeContext }); - return 5 === o7.type ? o7.value : null; - }(r7, u6) : null; - var l4; - return null == s5 ? 1 === ((null != (l4 = n9.get(e5)) ? l4 : 0) && 1) : true === s5; - }, y5 = (e5, t3) => { - let n10 = e5.get(t3); - if (null == n10) { - const r7 = p5(t3); - n10 = (r7 ? 1 : 0) | (true !== r7 || null != t3.parent && 1 != (1 & y5(e5, t3.parent)) ? 0 : 2), e5.set(t3, n10); - } - return n10; - }, h5 = /* @__PURE__ */ new Map(); - for (const e5 of s4) - f4.push([e5[0], y5(h5, e5[0].value)]); - a4.cqw = null != r6.width ? r6.width / 100 : o5.cqw, a4.cqh = null != r6.height ? r6.height / 100 : o5.cqh; - } - } - return { parentState: new Ve(n8), conditions: f4, context: a4, displayFlags: y4, isQueryContainer: p4 }; - })(...n7); - null != u4 && De(u4[1], o4) || (u4 = [n7, o4]); - } - return u4[1]; - }; - }(); - }(n4); - S3 = (e3) => r4(e3, q3); - } - const C4 = S3 || k3; - let $3 = null; - const E2 = (e3) => { - const t3 = $3, n5 = C4(e3); - return $3 = n5, [$3, $3 !== t3]; - }, z3 = n4 instanceof HTMLElement || n4 instanceof SVGElement ? n4.style : null; - let L2 = false; - f3 = { connect() { - for (let e3 = n4.firstChild; null != e3; e3 = e3.nextSibling) - A3(e3); - p3.connected(); - }, disconnect() { - n4 instanceof Element && (l2.unobserve(n4), n4.removeAttribute(v), n4.removeAttribute(d)), z3 && (z3.removeProperty(g), z3.removeProperty(b), z3.removeProperty(m), z3.removeProperty(w)); - for (let e3 = n4.firstChild; null != e3; e3 = e3.nextSibling) { - const t3 = r3(e3); - null == t3 || t3.disconnect(); - } - p3.disconnected(), delete n4[We]; - }, update(e3) { - const [t3, r4] = E2(e3); - if (r4) { - if (h3(n4, e3, d), h3(n4, t3, v), n4 instanceof Element) { - const e4 = x4 || t3.isQueryContainer; - e4 && !L2 ? (l2.observe(n4), L2 = true) : !e4 && L2 && (l2.unobserve(n4), L2 = false); - } - if (z3) { - const n5 = t3.context, r5 = n5.writingAxis; - let u4 = null, o4 = null, s4 = null, l3 = null; - (r5 !== e3.context.writingAxis || t3.isQueryContainer) && (u4 = `var(${0 === r5 ? m : w})`, o4 = `var(${1 === r5 ? m : w})`), e3 && !t3.isQueryContainer || (n5.cqw && (s4 = n5.cqw + "px"), n5.cqh && (l3 = n5.cqh + "px")), at(z3, g, u4), at(z3, b, o4), at(z3, m, s4), at(z3, w, l3); - } - p3.updated(); - } - for (let e4 = n4.firstChild; null != e4; e4 = e4.nextSibling) - A3(e4).update(t3); - }, resize() { - q3 = Symbol(); - }, mutate() { - q3 = Symbol(); - for (let e3 = n4.firstChild; null != e3; e3 = e3.nextSibling) - A3(e3).mutate(); - } }, n4[We] = f3, f3.connect(); + function listCacheDelete(key) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + return false; } - return f3; + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; } - u3.prepend(s3, o3), A3(u3), S2(); - }(); - - // ../../../node_modules/alpinejs/dist/module.esm.js - var flushPending = false; - var flushing = false; - var queue = []; - var lastFlushedIndex = -1; - function scheduler(callback) { - queueJob(callback); - } - function queueJob(job) { - if (!queue.includes(job)) - queue.push(job); - queueFlush(); - } - function dequeueJob(job) { - let index = queue.indexOf(job); - if (index !== -1 && index > lastFlushedIndex) - queue.splice(index, 1); - } - function queueFlush() { - if (!flushing && !flushPending) { - flushPending = true; - queueMicrotask(flushJobs); + function listCacheGet(key) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? void 0 : data[index][1]; } - } - function flushJobs() { - flushPending = false; - flushing = true; - for (let i3 = 0; i3 < queue.length; i3++) { - queue[i3](); - lastFlushedIndex = i3; + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; } - queue.length = 0; - lastFlushedIndex = -1; - flushing = false; - } - var reactive; - var effect; - var release; - var raw; - var shouldSchedule = true; - function disableEffectScheduling(callback) { - shouldSchedule = false; - callback(); - shouldSchedule = true; - } - function setReactivityEngine(engine) { - reactive = engine.reactive; - release = engine.release; - effect = (callback) => engine.effect(callback, { scheduler: (task) => { - if (shouldSchedule) { - scheduler(task); + function listCacheSet(key, value) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + data.push([key, value]); } else { - task(); + data[index][1] = value; } - } }); - raw = engine.raw; - } - function overrideEffect(override) { - effect = override; - } - function elementBoundEffect(el) { - let cleanup2 = () => { - }; - let wrappedEffect = (callback) => { - let effectReference = effect(callback); - if (!el._x_effects) { - el._x_effects = /* @__PURE__ */ new Set(); - el._x_runEffects = () => { - el._x_effects.forEach((i3) => i3()); - }; + return this; + } + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + function MapCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - el._x_effects.add(effectReference); - cleanup2 = () => { - if (effectReference === void 0) - return; - el._x_effects.delete(effectReference); - release(effectReference); + } + function mapCacheClear() { + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() }; - return effectReference; - }; - return [wrappedEffect, () => { - cleanup2(); - }]; - } - function dispatch(el, name, detail = {}) { - el.dispatchEvent( - new CustomEvent(name, { - detail, - bubbles: true, - // Allows events to pass the shadow DOM barrier. - composed: true, - cancelable: true - }) - ); - } - function walk(el, callback) { - if (typeof ShadowRoot === "function" && el instanceof ShadowRoot) { - Array.from(el.children).forEach((el2) => walk(el2, callback)); - return; } - let skip = false; - callback(el, () => skip = true); - if (skip) - return; - let node = el.firstElementChild; - while (node) { - walk(node, callback, false); - node = node.nextElementSibling; + function mapCacheDelete(key) { + return getMapData(this, key)["delete"](key); } - } - function warn(message, ...args) { - console.warn(`Alpine Warning: ${message}`, ...args); - } - var started = false; - function start() { - if (started) - warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."); - started = true; - if (!document.body) - warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"); - dispatch(document, "alpine:init"); - dispatch(document, "alpine:initializing"); - startObservingMutations(); - onElAdded((el) => initTree(el, walk)); - onElRemoved((el) => destroyTree(el)); - onAttributesAdded((el, attrs) => { - directives(el, attrs).forEach((handle) => handle()); - }); - let outNestedComponents = (el) => !closestRoot(el.parentElement, true); - Array.from(document.querySelectorAll(allSelectors())).filter(outNestedComponents).forEach((el) => { - initTree(el); - }); - dispatch(document, "alpine:initialized"); - } - var rootSelectorCallbacks = []; - var initSelectorCallbacks = []; - function rootSelectors() { - return rootSelectorCallbacks.map((fn3) => fn3()); - } - function allSelectors() { - return rootSelectorCallbacks.concat(initSelectorCallbacks).map((fn3) => fn3()); - } - function addRootSelector(selectorCallback) { - rootSelectorCallbacks.push(selectorCallback); - } - function addInitSelector(selectorCallback) { - initSelectorCallbacks.push(selectorCallback); - } - function closestRoot(el, includeInitSelectors = false) { - return findClosest(el, (element) => { - const selectors = includeInitSelectors ? allSelectors() : rootSelectors(); - if (selectors.some((selector) => element.matches(selector))) - return true; - }); - } - function findClosest(el, callback) { - if (!el) - return; - if (callback(el)) - return el; - if (el._x_teleportBack) - el = el._x_teleportBack; - if (!el.parentElement) - return; - return findClosest(el.parentElement, callback); - } - function isRoot(el) { - return rootSelectors().some((selector) => el.matches(selector)); - } - var initInterceptors = []; - function interceptInit(callback) { - initInterceptors.push(callback); - } - function initTree(el, walker = walk, intercept = () => { - }) { - deferHandlingDirectives(() => { - walker(el, (el2, skip) => { - intercept(el2, skip); - initInterceptors.forEach((i3) => i3(el2, skip)); - directives(el2, el2.attributes).forEach((handle) => handle()); - el2._x_ignore && skip(); - }); - }); - } - function destroyTree(root) { - walk(root, (el) => { - cleanupAttributes(el); - cleanupElement(el); - }); - } - var onAttributeAddeds = []; - var onElRemoveds = []; - var onElAddeds = []; - function onElAdded(callback) { - onElAddeds.push(callback); - } - function onElRemoved(el, callback) { - if (typeof callback === "function") { - if (!el._x_cleanups) - el._x_cleanups = []; - el._x_cleanups.push(callback); - } else { - callback = el; - onElRemoveds.push(callback); + function mapCacheGet(key) { + return getMapData(this, key).get(key); } - } - function onAttributesAdded(callback) { - onAttributeAddeds.push(callback); - } - function onAttributeRemoved(el, name, callback) { - if (!el._x_attributeCleanups) - el._x_attributeCleanups = {}; - if (!el._x_attributeCleanups[name]) - el._x_attributeCleanups[name] = []; - el._x_attributeCleanups[name].push(callback); - } - function cleanupAttributes(el, names) { - if (!el._x_attributeCleanups) - return; - Object.entries(el._x_attributeCleanups).forEach(([name, value]) => { - if (names === void 0 || names.includes(name)) { - value.forEach((i3) => i3()); - delete el._x_attributeCleanups[name]; + function mapCacheHas(key) { + return getMapData(this, key).has(key); + } + function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + function SetCache(values) { + var index = -1, length = values ? values.length : 0; + this.__data__ = new MapCache(); + while (++index < length) { + this.add(values[index]); } - }); - } - function cleanupElement(el) { - if (el._x_cleanups) { - while (el._x_cleanups.length) - el._x_cleanups.pop()(); } - } - var observer = new MutationObserver(onMutate); - var currentlyObserving = false; - function startObservingMutations() { - observer.observe(document, { subtree: true, childList: true, attributes: true, attributeOldValue: true }); - currentlyObserving = true; - } - function stopObservingMutations() { - flushObserver(); - observer.disconnect(); - currentlyObserving = false; - } - var recordQueue = []; - var willProcessRecordQueue = false; - function flushObserver() { - recordQueue = recordQueue.concat(observer.takeRecords()); - if (recordQueue.length && !willProcessRecordQueue) { - willProcessRecordQueue = true; - queueMicrotask(() => { - processRecordQueue(); - willProcessRecordQueue = false; - }); + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } - } - function processRecordQueue() { - onMutate(recordQueue); - recordQueue.length = 0; - } - function mutateDom(callback) { - if (!currentlyObserving) - return callback(); - stopObservingMutations(); - let result = callback(); - startObservingMutations(); - return result; - } - var isCollecting = false; - var deferredMutations = []; - function deferMutations() { - isCollecting = true; - } - function flushAndStopDeferringMutations() { - isCollecting = false; - onMutate(deferredMutations); - deferredMutations = []; - } - function onMutate(mutations) { - if (isCollecting) { - deferredMutations = deferredMutations.concat(mutations); - return; + function setCacheHas(value) { + return this.__data__.has(value); } - let addedNodes = []; - let removedNodes = []; - let addedAttributes = /* @__PURE__ */ new Map(); - let removedAttributes = /* @__PURE__ */ new Map(); - for (let i3 = 0; i3 < mutations.length; i3++) { - if (mutations[i3].target._x_ignoreMutationObserver) - continue; - if (mutations[i3].type === "childList") { - mutations[i3].addedNodes.forEach((node) => node.nodeType === 1 && addedNodes.push(node)); - mutations[i3].removedNodes.forEach((node) => node.nodeType === 1 && removedNodes.push(node)); - } - if (mutations[i3].type === "attributes") { - let el = mutations[i3].target; - let name = mutations[i3].attributeName; - let oldValue = mutations[i3].oldValue; - let add2 = () => { - if (!addedAttributes.has(el)) - addedAttributes.set(el, []); - addedAttributes.get(el).push({ name, value: el.getAttribute(name) }); - }; - let remove = () => { - if (!removedAttributes.has(el)) - removedAttributes.set(el, []); - removedAttributes.get(el).push(name); - }; - if (el.hasAttribute(name) && oldValue === null) { - add2(); - } else if (el.hasAttribute(name)) { - remove(); - add2(); - } else { - remove(); - } - } + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + function Stack(entries) { + this.__data__ = new ListCache(entries); } - removedAttributes.forEach((attrs, el) => { - cleanupAttributes(el, attrs); - }); - addedAttributes.forEach((attrs, el) => { - onAttributeAddeds.forEach((i3) => i3(el, attrs)); - }); - for (let node of removedNodes) { - if (addedNodes.includes(node)) - continue; - onElRemoveds.forEach((i3) => i3(node)); - destroyTree(node); + function stackClear() { + this.__data__ = new ListCache(); } - addedNodes.forEach((node) => { - node._x_ignoreSelf = true; - node._x_ignore = true; - }); - for (let node of addedNodes) { - if (removedNodes.includes(node)) - continue; - if (!node.isConnected) - continue; - delete node._x_ignoreSelf; - delete node._x_ignore; - onElAddeds.forEach((i3) => i3(node)); - node._x_ignore = true; - node._x_ignoreSelf = true; + function stackDelete(key) { + return this.__data__["delete"](key); } - addedNodes.forEach((node) => { - delete node._x_ignoreSelf; - delete node._x_ignore; - }); - addedNodes = null; - removedNodes = null; - addedAttributes = null; - removedAttributes = null; - } - function scope(node) { - return mergeProxies(closestDataStack(node)); - } - function addScopeToNode(node, data2, referenceNode) { - node._x_dataStack = [data2, ...closestDataStack(referenceNode || node)]; - return () => { - node._x_dataStack = node._x_dataStack.filter((i3) => i3 !== data2); - }; - } - function closestDataStack(node) { - if (node._x_dataStack) - return node._x_dataStack; - if (typeof ShadowRoot === "function" && node instanceof ShadowRoot) { - return closestDataStack(node.host); + function stackGet(key) { + return this.__data__.get(key); } - if (!node.parentNode) { - return []; + function stackHas(key) { + return this.__data__.has(key); } - return closestDataStack(node.parentNode); - } - function mergeProxies(objects) { - return new Proxy({ objects }, mergeProxyTrap); - } - var mergeProxyTrap = { - ownKeys({ objects }) { - return Array.from( - new Set(objects.flatMap((i3) => Object.keys(i3))) - ); - }, - has({ objects }, name) { - if (name == Symbol.unscopables) - return false; - return objects.some( - (obj) => Object.prototype.hasOwnProperty.call(obj, name) - ); - }, - get({ objects }, name, thisProxy) { - if (name == "toJSON") - return collapseProxies; - return Reflect.get( - objects.find( - (obj) => Object.prototype.hasOwnProperty.call(obj, name) - ) || {}, - name, - thisProxy - ); - }, - set({ objects }, name, value, thisProxy) { - const target = objects.find( - (obj) => Object.prototype.hasOwnProperty.call(obj, name) - ) || objects[objects.length - 1]; - const descriptor = Object.getOwnPropertyDescriptor(target, name); - if ((descriptor == null ? void 0 : descriptor.set) && (descriptor == null ? void 0 : descriptor.get)) - return Reflect.set(target, name, value, thisProxy); - return Reflect.set(target, name, value); + function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; } - }; - function collapseProxies() { - let keys = Reflect.ownKeys(this); - return keys.reduce((acc, key) => { - acc[key] = Reflect.get(this, key); - return acc; - }, {}); - } - function initInterceptors2(data2) { - let isObject22 = (val) => typeof val === "object" && !Array.isArray(val) && val !== null; - let recurse = (obj, basePath = "") => { - Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key, { value, enumerable }]) => { - if (enumerable === false || value === void 0) - return; - let path = basePath === "" ? key : `${basePath}.${key}`; - if (typeof value === "object" && value !== null && value._x_interceptor) { - obj[key] = value.initialize(data2, path, key); - } else { - if (isObject22(value) && value !== obj && !(value instanceof Element)) { - recurse(value, path); - } + Stack.prototype.clear = stackClear; + Stack.prototype["delete"] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); } - }); - }; - return recurse(data2); - } - function interceptor(callback, mutateObj = () => { - }) { - let obj = { - initialValue: void 0, - _x_interceptor: true, - initialize(data2, path, key) { - return callback(this.initialValue, () => get(data2, path), (value) => set(data2, path, value), path, key); } - }; - mutateObj(obj); - return (initialValue) => { - if (typeof initialValue === "object" && initialValue !== null && initialValue._x_interceptor) { - let initialize = obj.initialize.bind(obj); - obj.initialize = (data2, path, key) => { - let innerValue = initialValue.initialize(data2, path, key); - obj.initialValue = innerValue; - return initialize(data2, path, key); - }; - } else { - obj.initialValue = initialValue; - } - return obj; - }; - } - function get(obj, path) { - return path.split(".").reduce((carry, segment) => carry[segment], obj); - } - function set(obj, path, value) { - if (typeof path === "string") - path = path.split("."); - if (path.length === 1) - obj[path[0]] = value; - else if (path.length === 0) - throw error; - else { - if (obj[path[0]]) - return set(obj[path[0]], path.slice(1), value); - else { - obj[path[0]] = {}; - return set(obj[path[0]], path.slice(1), value); - } + return result; } - } - var magics = {}; - function magic(name, callback) { - magics[name] = callback; - } - function injectMagics(obj, el) { - Object.entries(magics).forEach(([name, callback]) => { - let memoizedUtilities = null; - function getUtilities() { - if (memoizedUtilities) { - return memoizedUtilities; - } else { - let [utilities, cleanup2] = getElementBoundUtilities(el); - memoizedUtilities = __spreadValues({ interceptor }, utilities); - onElRemoved(el, cleanup2); - return memoizedUtilities; + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; } } - Object.defineProperty(obj, `$${name}`, { - get() { - return callback(el, getUtilities()); - }, - enumerable: false - }); - }); - return obj; - } - function tryCatch(el, expression, callback, ...args) { - try { - return callback(...args); - } catch (e3) { - handleError(e3, el, expression); + return -1; } - } - function handleError(error2, el, expression = void 0) { - Object.assign(error2, { el, expression }); - console.warn(`Alpine Expression Error: ${error2.message} - -${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el); - setTimeout(() => { - throw error2; - }, 0); - } - var shouldAutoEvaluateFunctions = true; - function dontAutoEvaluateFunctions(callback) { - let cache = shouldAutoEvaluateFunctions; - shouldAutoEvaluateFunctions = false; - let result = callback(); - shouldAutoEvaluateFunctions = cache; - return result; - } - function evaluate(el, expression, extras = {}) { - let result; - evaluateLater(el, expression)((value) => result = value, extras); - return result; - } - function evaluateLater(...args) { - return theEvaluatorFunction(...args); - } - var theEvaluatorFunction = normalEvaluator; - function setEvaluator(newEvaluator) { - theEvaluatorFunction = newEvaluator; - } - function normalEvaluator(el, expression) { - let overriddenMagics = {}; - injectMagics(overriddenMagics, el); - let dataStack = [overriddenMagics, ...closestDataStack(el)]; - let evaluator = typeof expression === "function" ? generateEvaluatorFromFunction(dataStack, expression) : generateEvaluatorFromString(dataStack, expression, el); - return tryCatch.bind(null, el, expression, evaluator); - } - function generateEvaluatorFromFunction(dataStack, func) { - return (receiver = () => { - }, { scope: scope2 = {}, params = [] } = {}) => { - let result = func.apply(mergeProxies([scope2, ...dataStack]), params); - runIfTypeOfFunction(receiver, result); - }; - } - var evaluatorMemo = {}; - function generateFunctionFromString(expression, el) { - if (evaluatorMemo[expression]) { - return evaluatorMemo[expression]; + var baseFor = createBaseFor(); + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); } - let AsyncFunction = Object.getPrototypeOf(async function() { - }).constructor; - let rightSideSafeExpression = /^[\n\s]*if.*\(.*\)/.test(expression.trim()) || /^(let|const)\s/.test(expression.trim()) ? `(async()=>{ ${expression} })()` : expression; - const safeAsyncFunction = () => { - try { - let func2 = new AsyncFunction( - ["__self", "scope"], - `with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;` - ); - Object.defineProperty(func2, "name", { - value: `[Alpine] ${expression}` - }); - return func2; - } catch (error2) { - handleError(error2, el, expression); - return Promise.resolve(); + function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + var index = 0, length = path.length; + while (object != null && index < length) { + object = object[toKey(path[index++])]; } - }; - let func = safeAsyncFunction(); - evaluatorMemo[expression] = func; - return func; - } - function generateEvaluatorFromString(dataStack, expression, el) { - let func = generateFunctionFromString(expression, el); - return (receiver = () => { - }, { scope: scope2 = {}, params = [] } = {}) => { - func.result = void 0; - func.finished = false; - let completeScope = mergeProxies([scope2, ...dataStack]); - if (typeof func === "function") { - let promise = func(func, completeScope).catch((error2) => handleError(error2, el, expression)); - if (func.finished) { - runIfTypeOfFunction(receiver, func.result, completeScope, params, el); - func.result = void 0; - } else { - promise.then((result) => { - runIfTypeOfFunction(receiver, result, completeScope, params, el); - }).catch((error2) => handleError(error2, el, expression)).finally(() => func.result = void 0); + return index && index == length ? object : void 0; + } + function baseGetTag(value) { + return objectToString.call(value); + } + function baseHasIn(object, key) { + return object != null && key in Object(object); + } + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; + } + if (value == null || other == null || !isObject2(value) && !isObjectLike(other)) { + return value !== value && other !== other; + } + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; + } + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); } } - }; - } - function runIfTypeOfFunction(receiver, value, scope2, params, el) { - if (shouldAutoEvaluateFunctions && typeof value === "function") { - let result = value.apply(scope2, params); - if (result instanceof Promise) { - result.then((i3) => runIfTypeOfFunction(receiver, i3, scope2, params)).catch((error2) => handleError(error2, el, value)); - } else { - receiver(result); + if (!isSameTag) { + return false; } - } else if (typeof value === "object" && value instanceof Promise) { - value.then((i3) => receiver(i3)); - } else { - receiver(value); + stack || (stack = new Stack()); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); } - } - var prefixAsString = "x-"; - function prefix(subject = "") { - return prefixAsString + subject; - } - function setPrefix(newPrefix) { - prefixAsString = newPrefix; - } - var directiveHandlers = {}; - function directive(name, callback) { - directiveHandlers[name] = callback; - return { - before(directive2) { - if (!directiveHandlers[directive2]) { - console.warn( - "Cannot find directive `${directive}`. `${name}` will use the default order of execution" - ); - return; + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, length = index, noCustomizer = !customizer; + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; } - const pos = directiveOrder.indexOf(directive2); - directiveOrder.splice(pos >= 0 ? pos : directiveOrder.indexOf("DEFAULT"), 0, name); } - }; - } - function directives(el, attributes, originalAttributeOverride) { - attributes = Array.from(attributes); - if (el._x_virtualDirectives) { - let vAttributes = Object.entries(el._x_virtualDirectives).map(([name, value]) => ({ name, value })); - let staticAttributes = attributesOnly(vAttributes); - vAttributes = vAttributes.map((attribute) => { - if (staticAttributes.find((attr) => attr.name === attribute.name)) { - return { - name: `x-bind:${attribute.name}`, - value: `"${attribute.value}"` - }; + while (++index < length) { + data = matchData[index]; + var key = data[0], objValue = object[key], srcValue = data[1]; + if (noCustomizer && data[2]) { + if (objValue === void 0 && !(key in object)) { + return false; + } + } else { + var stack = new Stack(); + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { + return false; + } } - return attribute; - }); - attributes = attributes.concat(vAttributes); + } + return true; } - let transformedAttributeMap = {}; - let directives2 = attributes.map(toTransformedAttributes((newName, oldName) => transformedAttributeMap[newName] = oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap, originalAttributeOverride)).sort(byPriority); - return directives2.map((directive2) => { - return getDirectiveHandler(el, directive2); - }); - } - function attributesOnly(attributes) { - return Array.from(attributes).map(toTransformedAttributes()).filter((attr) => !outNonAlpineAttributes(attr)); - } - var isDeferringHandlers = false; - var directiveHandlerStacks = /* @__PURE__ */ new Map(); - var currentHandlerStackKey = Symbol(); - function deferHandlingDirectives(callback) { - isDeferringHandlers = true; - let key = Symbol(); - currentHandlerStackKey = key; - directiveHandlerStacks.set(key, []); - let flushHandlers = () => { - while (directiveHandlerStacks.get(key).length) - directiveHandlerStacks.get(key).shift()(); - directiveHandlerStacks.delete(key); - }; - let stopDeferring = () => { - isDeferringHandlers = false; - flushHandlers(); - }; - callback(flushHandlers); - stopDeferring(); - } - function getElementBoundUtilities(el) { - let cleanups = []; - let cleanup2 = (callback) => cleanups.push(callback); - let [effect32, cleanupEffect] = elementBoundEffect(el); - cleanups.push(cleanupEffect); - let utilities = { - Alpine: alpine_default, - effect: effect32, - cleanup: cleanup2, - evaluateLater: evaluateLater.bind(evaluateLater, el), - evaluate: evaluate.bind(evaluate, el) - }; - let doCleanup = () => cleanups.forEach((i3) => i3()); - return [utilities, doCleanup]; - } - function getDirectiveHandler(el, directive2) { - let noop = () => { - }; - let handler4 = directiveHandlers[directive2.type] || noop; - let [utilities, cleanup2] = getElementBoundUtilities(el); - onAttributeRemoved(el, directive2.original, cleanup2); - let fullHandler = () => { - if (el._x_ignore || el._x_ignoreSelf) - return; - handler4.inline && handler4.inline(el, directive2, utilities); - handler4 = handler4.bind(handler4, el, directive2, utilities); - isDeferringHandlers ? directiveHandlerStacks.get(currentHandlerStackKey).push(handler4) : handler4(); - }; - fullHandler.runCleanups = cleanup2; - return fullHandler; - } - var startingWith = (subject, replacement) => ({ name, value }) => { - if (name.startsWith(subject)) - name = name.replace(subject, replacement); - return { name, value }; - }; - var into = (i3) => i3; - function toTransformedAttributes(callback = () => { - }) { - return ({ name, value }) => { - let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => { - return transform(carry); - }, { name, value }); - if (newName !== name) - callback(newName, name); - return { name: newName, value: newValue }; - }; - } - var attributeTransformers = []; - function mapAttributes(callback) { - attributeTransformers.push(callback); - } - function outNonAlpineAttributes({ name }) { - return alpineAttributeRegex().test(name); - } - var alpineAttributeRegex = () => new RegExp(`^${prefixAsString}([^:^.]+)\\b`); - function toParsedDirectives(transformedAttributeMap, originalAttributeOverride) { - return ({ name, value }) => { - let typeMatch = name.match(alpineAttributeRegex()); - let valueMatch = name.match(/:([a-zA-Z0-9\-_:]+)/); - let modifiers = name.match(/\.[^.\]]+(?=[^\]]*$)/g) || []; - let original = originalAttributeOverride || transformedAttributeMap[name] || name; - return { - type: typeMatch ? typeMatch[1] : null, - value: valueMatch ? valueMatch[1] : null, - modifiers: modifiers.map((i3) => i3.replace(".", "")), - expression: value, - original - }; - }; - } - var DEFAULT = "DEFAULT"; - var directiveOrder = [ - "ignore", - "ref", - "data", - "id", - "bind", - "init", - "for", - "model", - "modelable", - "transition", - "show", - "if", - DEFAULT, - "teleport" - ]; - function byPriority(a3, b3) { - let typeA = directiveOrder.indexOf(a3.type) === -1 ? DEFAULT : a3.type; - let typeB = directiveOrder.indexOf(b3.type) === -1 ? DEFAULT : b3.type; - return directiveOrder.indexOf(typeA) - directiveOrder.indexOf(typeB); - } - var tickStack = []; - var isHolding = false; - function nextTick(callback = () => { - }) { - queueMicrotask(() => { - isHolding || setTimeout(() => { - releaseNextTicks(); - }); - }); - return new Promise((res) => { - tickStack.push(() => { - callback(); - res(); - }); - }); - } - function releaseNextTicks() { - isHolding = false; - while (tickStack.length) - tickStack.shift()(); - } - function holdNextTicks() { - isHolding = true; - } - function setClasses(el, value) { - if (Array.isArray(value)) { - return setClassesFromString(el, value.join(" ")); - } else if (typeof value === "object" && value !== null) { - return setClassesFromObject(el, value); - } else if (typeof value === "function") { - return setClasses(el, value()); + function baseIsNative(value) { + if (!isObject2(value) || isMasked(value)) { + return false; + } + var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); } - return setClassesFromString(el, value); - } - function setClassesFromString(el, classString) { - let split = (classString2) => classString2.split(" ").filter(Boolean); - let missingClasses = (classString2) => classString2.split(" ").filter((i3) => !el.classList.contains(i3)).filter(Boolean); - let addClassesAndReturnUndo = (classes) => { - el.classList.add(...classes); - return () => { - el.classList.remove(...classes); - }; - }; - classString = classString === true ? classString = "" : classString || ""; - return addClassesAndReturnUndo(missingClasses(classString)); - } - function setClassesFromObject(el, classObject) { - let split = (classString) => classString.split(" ").filter(Boolean); - let forAdd = Object.entries(classObject).flatMap(([classString, bool]) => bool ? split(classString) : false).filter(Boolean); - let forRemove = Object.entries(classObject).flatMap(([classString, bool]) => !bool ? split(classString) : false).filter(Boolean); - let added = []; - let removed = []; - forRemove.forEach((i3) => { - if (el.classList.contains(i3)) { - el.classList.remove(i3); - removed.push(i3); + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + function baseIteratee(value) { + if (typeof value == "function") { + return value; } - }); - forAdd.forEach((i3) => { - if (!el.classList.contains(i3)) { - el.classList.add(i3); - added.push(i3); + if (value == null) { + return identity; } - }); - return () => { - removed.forEach((i3) => el.classList.add(i3)); - added.forEach((i3) => el.classList.remove(i3)); - }; - } - function setStyles(el, value) { - if (typeof value === "object" && value !== null) { - return setStylesFromObject(el, value); + if (typeof value == "object") { + return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); + } + return property(value); } - return setStylesFromString(el, value); - } - function setStylesFromObject(el, value) { - let previousStyles = {}; - Object.entries(value).forEach(([key, value2]) => { - previousStyles[key] = el.style[key]; - if (!key.startsWith("--")) { - key = kebabCase(key); + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); } - el.style.setProperty(key, value2); - }); - setTimeout(() => { - if (el.style.length === 0) { - el.removeAttribute("style"); + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } } - }); - return () => { - setStyles(el, previousStyles); - }; - } - function setStylesFromString(el, value) { - let cache = el.getAttribute("style", value); - el.setAttribute("style", value); - return () => { - el.setAttribute("style", cache || ""); - }; - } - function kebabCase(subject) { - return subject.replace(/([a-z])([A-Z])/g, "$1-$2").toLowerCase(); - } - function once(callback, fallback = () => { - }) { - let called = false; - return function() { - if (!called) { - called = true; - callback.apply(this, arguments); - } else { - fallback.apply(this, arguments); - } - }; - } - directive("transition", (el, { value, modifiers, expression }, { evaluate: evaluate2 }) => { - if (typeof expression === "function") - expression = evaluate2(expression); - if (expression === false) - return; - if (!expression || typeof expression === "boolean") { - registerTransitionsFromHelper(el, modifiers, value); - } else { - registerTransitionsFromClassString(el, expression, value); + return result; } - }); - function registerTransitionsFromClassString(el, classString, stage) { - registerTransitionObject(el, setClasses, ""); - let directiveStorageMap = { - "enter": (classes) => { - el._x_transition.enter.during = classes; - }, - "enter-start": (classes) => { - el._x_transition.enter.start = classes; - }, - "enter-end": (classes) => { - el._x_transition.enter.end = classes; - }, - "leave": (classes) => { - el._x_transition.leave.during = classes; - }, - "leave-start": (classes) => { - el._x_transition.leave.start = classes; - }, - "leave-end": (classes) => { - el._x_transition.leave.end = classes; + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); } - }; - directiveStorageMap[stage](classString); - } - function registerTransitionsFromHelper(el, modifiers, stage) { - registerTransitionObject(el, setStyles); - let doesntSpecify = !modifiers.includes("in") && !modifiers.includes("out") && !stage; - let transitioningIn = doesntSpecify || modifiers.includes("in") || ["enter"].includes(stage); - let transitioningOut = doesntSpecify || modifiers.includes("out") || ["leave"].includes(stage); - if (modifiers.includes("in") && !doesntSpecify) { - modifiers = modifiers.filter((i3, index) => index < modifiers.indexOf("out")); + return function(object) { + return object === source || baseIsMatch(object, source, matchData); + }; } - if (modifiers.includes("out") && !doesntSpecify) { - modifiers = modifiers.filter((i3, index) => index > modifiers.indexOf("out")); - } - let wantsAll = !modifiers.includes("opacity") && !modifiers.includes("scale"); - let wantsOpacity = wantsAll || modifiers.includes("opacity"); - let wantsScale = wantsAll || modifiers.includes("scale"); - let opacityValue = wantsOpacity ? 0 : 1; - let scaleValue = wantsScale ? modifierValue(modifiers, "scale", 95) / 100 : 1; - let delay3 = modifierValue(modifiers, "delay", 0) / 1e3; - let origin = modifierValue(modifiers, "origin", "center"); - let property = "opacity, transform"; - let durationIn = modifierValue(modifiers, "duration", 150) / 1e3; - let durationOut = modifierValue(modifiers, "duration", 75) / 1e3; - let easing = `cubic-bezier(0.4, 0.0, 0.2, 1)`; - if (transitioningIn) { - el._x_transition.enter.during = { - transformOrigin: origin, - transitionDelay: `${delay3}s`, - transitionProperty: property, - transitionDuration: `${durationIn}s`, - transitionTimingFunction: easing + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); }; - el._x_transition.enter.start = { - opacity: opacityValue, - transform: `scale(${scaleValue})` - }; - el._x_transition.enter.end = { - opacity: 1, - transform: `scale(1)` - }; } - if (transitioningOut) { - el._x_transition.leave.during = { - transformOrigin: origin, - transitionDelay: `${delay3}s`, - transitionProperty: property, - transitionDuration: `${durationOut}s`, - transitionTimingFunction: easing + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); }; - el._x_transition.leave.start = { - opacity: 1, - transform: `scale(1)` - }; - el._x_transition.leave.end = { - opacity: opacityValue, - transform: `scale(${scaleValue})` - }; } - } - function registerTransitionObject(el, setFunction, defaultValue = {}) { - if (!el._x_transition) - el._x_transition = { - enter: { during: defaultValue, start: defaultValue, end: defaultValue }, - leave: { during: defaultValue, start: defaultValue, end: defaultValue }, - in(before = () => { - }, after = () => { - }) { - transition(el, setFunction, { - during: this.enter.during, - start: this.enter.start, - end: this.enter.end - }, before, after); - }, - out(before = () => { - }, after = () => { - }) { - transition(el, setFunction, { - during: this.leave.during, - start: this.leave.start, - end: this.leave.end - }, before, after); + function baseToString(value) { + if (typeof value == "string") { + return value; + } + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; + } + function castPath(value) { + return isArray(value) ? value : stringToPath(value); + } + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } } + return object; }; - } - window.Element.prototype._x_toggleAndCascadeWithTransitions = function(el, value, show, hide2) { - const nextTick2 = document.visibilityState === "visible" ? requestAnimationFrame : setTimeout; - let clickAwayCompatibleShow = () => nextTick2(show); - if (value) { - if (el._x_transition && (el._x_transition.enter || el._x_transition.leave)) { - el._x_transition.enter && (Object.entries(el._x_transition.enter.during).length || Object.entries(el._x_transition.enter.start).length || Object.entries(el._x_transition.enter.end).length) ? el._x_transition.in(show) : clickAwayCompatibleShow(); - } else { - el._x_transition ? el._x_transition.in(show) : clickAwayCompatibleShow(); - } - return; } - el._x_hidePromise = el._x_transition ? new Promise((resolve, reject) => { - el._x_transition.out(() => { - }, () => resolve(hide2)); - el._x_transitioning.beforeCancel(() => reject({ isFromCancelledTransition: true })); - }) : Promise.resolve(hide2); - queueMicrotask(() => { - let closest = closestHide(el); - if (closest) { - if (!closest._x_hideChildren) - closest._x_hideChildren = []; - closest._x_hideChildren.push(el); - } else { - nextTick2(() => { - let hideAfterChildren = (el2) => { - let carry = Promise.all([ - el2._x_hidePromise, - ...(el2._x_hideChildren || []).map(hideAfterChildren) - ]).then(([i3]) => i3()); - delete el2._x_hidePromise; - delete el2._x_hideChildren; - return carry; - }; - hideAfterChildren(el).catch((e3) => { - if (!e3.isFromCancelledTransition) - throw e3; - }); - }); + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; } - }); - }; - function closestHide(el) { - let parent = el.parentNode; - if (!parent) - return; - return parent._x_hidePromise ? parent : closestHide(parent); - } - function transition(el, setFunction, { during, start: start22, end: end2 } = {}, before = () => { - }, after = () => { - }) { - if (el._x_transitioning) - el._x_transitioning.cancel(); - if (Object.keys(during).length === 0 && Object.keys(start22).length === 0 && Object.keys(end2).length === 0) { - before(); - after(); - return; - } - let undoStart, undoDuring, undoEnd; - performTransition(el, { - start() { - undoStart = setFunction(el, start22); - }, - during() { - undoDuring = setFunction(el, during); - }, - before, - end() { - undoStart(); - undoEnd = setFunction(el, end2); - }, - after, - cleanup() { - undoDuring(); - undoEnd(); + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; } - }); - } - function performTransition(el, stages) { - let interrupted, reachedBefore, reachedEnd; - let finish = once(() => { - mutateDom(() => { - interrupted = true; - if (!reachedBefore) - stages.before(); - if (!reachedEnd) { - stages.end(); - releaseNextTicks(); + var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : void 0; + stack.set(array, other); + stack.set(other, array); + while (++index < arrLength) { + var arrValue = array[index], othValue = other[index]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); } - stages.after(); - if (el.isConnected) - stages.cleanup(); - delete el._x_transitioning; - }); - }); - el._x_transitioning = { - beforeCancels: [], - beforeCancel(callback) { - this.beforeCancels.push(callback); - }, - cancel: once(function() { - while (this.beforeCancels.length) { - this.beforeCancels.shift()(); + if (compared !== void 0) { + if (compared) { + continue; + } + result = false; + break; } - ; - finish(); - }), - finish - }; - mutateDom(() => { - stages.start(); - stages.during(); - }); - holdNextTicks(); - requestAnimationFrame(() => { - if (interrupted) - return; - let duration = Number(getComputedStyle(el).transitionDuration.replace(/,.*/, "").replace("s", "")) * 1e3; - let delay3 = Number(getComputedStyle(el).transitionDelay.replace(/,.*/, "").replace("s", "")) * 1e3; - if (duration === 0) - duration = Number(getComputedStyle(el).animationDuration.replace("s", "")) * 1e3; - mutateDom(() => { - stages.before(); - }); - reachedBefore = true; - requestAnimationFrame(() => { - if (interrupted) - return; - mutateDom(() => { - stages.end(); - }); - releaseNextTicks(); - setTimeout(el._x_transitioning.finish, duration + delay3); - reachedEnd = true; - }); - }); - } - function modifierValue(modifiers, key, fallback) { - if (modifiers.indexOf(key) === -1) - return fallback; - const rawValue = modifiers[modifiers.indexOf(key) + 1]; - if (!rawValue) - return fallback; - if (key === "scale") { - if (isNaN(rawValue)) - return fallback; - } - if (key === "duration" || key === "delay") { - let match = rawValue.match(/([0-9]+)ms/); - if (match) - return match[1]; - } - if (key === "origin") { - if (["top", "right", "left", "center", "bottom"].includes(modifiers[modifiers.indexOf(key) + 2])) { - return [rawValue, modifiers[modifiers.indexOf(key) + 2]].join(" "); + if (seen) { + if (!arraySome(other, function(othValue2, othIndex) { + if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) { + return seen.add(othIndex); + } + })) { + result = false; + break; + } + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + result = false; + break; + } } + stack["delete"](array); + stack["delete"](other); + return result; } - return rawValue; - } - var isCloning = false; - function skipDuringClone(callback, fallback = () => { - }) { - return (...args) => isCloning ? fallback(...args) : callback(...args); - } - function onlyDuringClone(callback) { - return (...args) => isCloning && callback(...args); - } - function cloneNode(from, to) { - if (from._x_dataStack) { - to._x_dataStack = from._x_dataStack; - to.setAttribute("data-has-alpine-state", true); - } - isCloning = true; - dontRegisterReactiveSideEffects(() => { - initTree(to, (el, callback) => { - callback(el, () => { - }); - }); - }); - isCloning = false; - } - var isCloningLegacy = false; - function clone(oldEl, newEl) { - if (!newEl._x_dataStack) - newEl._x_dataStack = oldEl._x_dataStack; - isCloning = true; - isCloningLegacy = true; - dontRegisterReactiveSideEffects(() => { - cloneTree(newEl); - }); - isCloning = false; - isCloningLegacy = false; - } - function cloneTree(el) { - let hasRunThroughFirstEl = false; - let shallowWalker = (el2, callback) => { - walk(el2, (el3, skip) => { - if (hasRunThroughFirstEl && isRoot(el3)) - return skip(); - hasRunThroughFirstEl = true; - callback(el3, skip); - }); - }; - initTree(el, shallowWalker); - } - function dontRegisterReactiveSideEffects(callback) { - let cache = effect; - overrideEffect((callback2, el) => { - let storedEffect = cache(callback2); - release(storedEffect); - return () => { - }; - }); - callback(); - overrideEffect(cache); - } - function shouldSkipRegisteringDataDuringClone(el) { - if (!isCloning) + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; + } + object = object.buffer; + other = other.buffer; + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { + return false; + } + return true; + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; + case regexpTag: + case stringTag: + return object == other + ""; + case mapTag: + var convert = mapToArray; + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; + } + var stacked = stack.get(object); + if (stacked) { + return stacked == other; + } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack["delete"](object); + return result; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } return false; - if (isCloningLegacy) - return true; - return el.hasAttribute("data-has-alpine-state"); - } - function bind(el, name, value, modifiers = []) { - if (!el._x_bindings) - el._x_bindings = reactive({}); - el._x_bindings[name] = value; - name = modifiers.includes("camel") ? camelCase(name) : name; - switch (name) { - case "value": - bindInputValue(el, value); - break; - case "style": - bindStyles(el, value); - break; - case "class": - bindClasses(el, value); - break; - case "selected": - case "checked": - bindAttributeAndProperty(el, name, value); - break; - default: - bindAttribute(el, name, value); - break; } - } - function bindInputValue(el, value) { - if (el.type === "radio") { - if (el.attributes.value === void 0) { - el.value = value; + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; } - if (window.fromModel) { - el.checked = checkedAttrLooseCompare(el.value, value); + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; + } } - } else if (el.type === "checkbox") { - if (Number.isInteger(value)) { - el.value = value; - } else if (!Array.isArray(value) && typeof value !== "boolean" && ![null, void 0].includes(value)) { - el.value = String(value); - } else { - if (Array.isArray(value)) { - el.checked = value.some((val) => checkedAttrLooseCompare(val, el.value)); - } else { - el.checked = !!value; + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; + } + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); } + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) { + result = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); } - } else if (el.tagName === "SELECT") { - updateSelect(el, value); - } else { - if (el.value === value) - return; - el.value = value === void 0 ? "" : value; + if (result && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result = false; + } + } + stack["delete"](object); + stack["delete"](other); + return result; } - } - function bindClasses(el, value) { - if (el._x_undoAddedClasses) - el._x_undoAddedClasses(); - el._x_undoAddedClasses = setClasses(el, value); - } - function bindStyles(el, value) { - if (el._x_undoAddedStyles) - el._x_undoAddedStyles(); - el._x_undoAddedStyles = setStyles(el, value); - } - function bindAttributeAndProperty(el, name, value) { - bindAttribute(el, name, value); - setPropertyIfChanged(el, name, value); - } - function bindAttribute(el, name, value) { - if ([null, void 0, false].includes(value) && attributeShouldntBePreservedIfFalsy(name)) { - el.removeAttribute(name); - } else { - if (isBooleanAttr(name)) - value = name; - setIfChanged(el, name, value); + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; } - } - function setIfChanged(el, attrName, value) { - if (el.getAttribute(attrName) != value) { - el.setAttribute(attrName, value); + function getMatchData(object) { + var result = keys(object), length = result.length; + while (length--) { + var key = result[length], value = object[key]; + result[length] = [key, value, isStrictComparable(value)]; + } + return result; } - } - function setPropertyIfChanged(el, propName, value) { - if (el[propName] !== value) { - el[propName] = value; + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; } - } - function updateSelect(el, value) { - const arrayWrappedValue = [].concat(value).map((value2) => { - return value2 + ""; - }); - Array.from(el.options).forEach((option) => { - option.selected = arrayWrappedValue.includes(option.value); - }); - } - function camelCase(subject) { - return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase()); - } - function checkedAttrLooseCompare(valueA, valueB) { - return valueA == valueB; - } - function isBooleanAttr(attrName) { - const booleanAttributes = [ - "disabled", - "checked", - "required", - "readonly", - "hidden", - "open", - "selected", - "autofocus", - "itemscope", - "multiple", - "novalidate", - "allowfullscreen", - "allowpaymentrequest", - "formnovalidate", - "autoplay", - "controls", - "loop", - "muted", - "playsinline", - "default", - "ismap", - "reversed", - "async", - "defer", - "nomodule" - ]; - return booleanAttributes.includes(attrName); - } - function attributeShouldntBePreservedIfFalsy(name) { - return !["aria-pressed", "aria-checked", "aria-expanded", "aria-selected"].includes(name); - } - function getBinding(el, name, fallback) { - if (el._x_bindings && el._x_bindings[name] !== void 0) - return el._x_bindings[name]; - return getAttributeBinding(el, name, fallback); - } - function extractProp(el, name, fallback, extract = true) { - if (el._x_bindings && el._x_bindings[name] !== void 0) - return el._x_bindings[name]; - if (el._x_inlineBindings && el._x_inlineBindings[name] !== void 0) { - let binding = el._x_inlineBindings[name]; - binding.extract = extract; - return dontAutoEvaluateFunctions(() => { - return evaluate(el, binding.expression); - }); + var getTag = baseGetTag; + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { + getTag = function(value) { + var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; } - return getAttributeBinding(el, name, fallback); - } - function getAttributeBinding(el, name, fallback) { - let attr = el.getAttribute(name); - if (attr === null) - return typeof fallback === "function" ? fallback() : fallback; - if (attr === "") - return true; - if (isBooleanAttr(name)) { - return !![name, "true"].includes(attr); + function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + var result, index = -1, length = path.length; + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; + } + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } - return attr; - } - function debounce(func, wait) { - var timeout; - return function() { - var context = this, args = arguments; - var later = function() { - timeout = null; - func.apply(context, args); - }; - clearTimeout(timeout); - timeout = setTimeout(later, wait); - }; - } - function throttle(func, limit) { - let inThrottle; - return function() { - let context = this, args = arguments; - if (!inThrottle) { - func.apply(context, args); - inThrottle = true; - setTimeout(() => inThrottle = false, limit); + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); + } + function isKey(value, object) { + if (isArray(value)) { + return false; } - }; - } - function entangle({ get: outerGet, set: outerSet }, { get: innerGet, set: innerSet }) { - let firstRun = true; - let outerHash; - let reference2 = effect(() => { - const outer = outerGet(); - const inner = innerGet(); - if (firstRun) { - innerSet(cloneIfObject(outer)); - firstRun = false; - outerHash = JSON.stringify(outer); - } else { - const outerHashLatest = JSON.stringify(outer); - if (outerHashLatest !== outerHash) { - innerSet(cloneIfObject(outer)); - outerHash = outerHashLatest; - } else { - outerSet(cloneIfObject(inner)); - outerHash = JSON.stringify(inner); - } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; } - JSON.stringify(innerGet()); - JSON.stringify(outerGet()); - }); - return () => { - release(reference2); - }; - } - function cloneIfObject(value) { - return typeof value === "object" ? JSON.parse(JSON.stringify(value)) : value; - } - function plugin(callback) { - let callbacks = Array.isArray(callback) ? callback : [callback]; - callbacks.forEach((i3) => i3(alpine_default)); - } - var stores = {}; - var isReactive = false; - function store(name, value) { - if (!isReactive) { - stores = reactive(stores); - isReactive = true; + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); } - if (value === void 0) { - return stores[name]; + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } - stores[name] = value; - if (typeof value === "object" && value !== null && value.hasOwnProperty("init") && typeof value.init === "function") { - stores[name].init(); + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; } - initInterceptors2(stores[name]); - } - function getStores() { - return stores; - } - var binds = {}; - function bind2(name, bindings) { - let getBindings = typeof bindings !== "function" ? () => bindings : bindings; - if (name instanceof Element) { - return applyBindingsObject(name, getBindings()); - } else { - binds[name] = getBindings; + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; } - return () => { - }; - } - function injectBindingProviders(obj) { - Object.entries(binds).forEach(([name, callback]) => { - Object.defineProperty(obj, name, { - get() { - return (...args) => { - return callback(...args); - }; + function isStrictComparable(value) { + return value === value && !isObject2(value); + } + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; } - }); - }); - return obj; - } - function applyBindingsObject(el, obj, original) { - let cleanupRunners = []; - while (cleanupRunners.length) - cleanupRunners.pop()(); - let attributes = Object.entries(obj).map(([name, value]) => ({ name, value })); - let staticAttributes = attributesOnly(attributes); - attributes = attributes.map((attribute) => { - if (staticAttributes.find((attr) => attr.name === attribute.name)) { - return { - name: `x-bind:${attribute.name}`, - value: `"${attribute.value}"` - }; + return object[key] === srcValue && (srcValue !== void 0 || key in Object(object)); + }; + } + var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; + if (reLeadingDot.test(string)) { + result.push(""); } - return attribute; - }); - directives(el, attributes, original).map((handle) => { - cleanupRunners.push(handle.runCleanups); - handle(); - }); - return () => { - while (cleanupRunners.length) - cleanupRunners.pop()(); - }; - } - var datas = {}; - function data(name, callback) { - datas[name] = callback; - } - function injectDataProviders(obj, context) { - Object.entries(datas).forEach(([name, callback]) => { - Object.defineProperty(obj, name, { - get() { - return (...args) => { - return callback.bind(context)(...args); - }; - }, - enumerable: false + string.replace(rePropName, function(match, number, quote, string2) { + result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match); }); + return result; }); - return obj; - } - var Alpine2 = { - get reactive() { - return reactive; - }, - get release() { - return release; - }, - get effect() { - return effect; - }, - get raw() { - return raw; - }, - version: "3.13.2", - flushAndStopDeferringMutations, - dontAutoEvaluateFunctions, - disableEffectScheduling, - startObservingMutations, - stopObservingMutations, - setReactivityEngine, - onAttributeRemoved, - onAttributesAdded, - closestDataStack, - skipDuringClone, - onlyDuringClone, - addRootSelector, - addInitSelector, - addScopeToNode, - deferMutations, - mapAttributes, - evaluateLater, - interceptInit, - setEvaluator, - mergeProxies, - extractProp, - findClosest, - onElRemoved, - closestRoot, - destroyTree, - interceptor, - // INTERNAL: not public API and is subject to change without major release. - transition, - // INTERNAL - setStyles, - // INTERNAL - mutateDom, - directive, - entangle, - throttle, - debounce, - evaluate, - initTree, - nextTick, - prefixed: prefix, - prefix: setPrefix, - plugin, - magic, - store, - start, - clone, - // INTERNAL - cloneNode, - // INTERNAL - bound: getBinding, - $data: scope, - walk, - data, - bind: bind2 - }; - var alpine_default = Alpine2; - function makeMap(str, expectsLowerCase) { - const map = /* @__PURE__ */ Object.create(null); - const list = str.split(","); - for (let i3 = 0; i3 < list.length; i3++) { - map[list[i3]] = true; - } - return expectsLowerCase ? (val) => !!map[val.toLowerCase()] : (val) => !!map[val]; - } - var specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; - var isBooleanAttr2 = /* @__PURE__ */ makeMap(specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); - var EMPTY_OBJ = true ? Object.freeze({}) : {}; - var EMPTY_ARR = true ? Object.freeze([]) : []; - var hasOwnProperty = Object.prototype.hasOwnProperty; - var hasOwn = (val, key) => hasOwnProperty.call(val, key); - var isArray = Array.isArray; - var isMap = (val) => toTypeString(val) === "[object Map]"; - var isString = (val) => typeof val === "string"; - var isSymbol = (val) => typeof val === "symbol"; - var isObject = (val) => val !== null && typeof val === "object"; - var objectToString = Object.prototype.toString; - var toTypeString = (value) => objectToString.call(value); - var toRawType = (value) => { - return toTypeString(value).slice(8, -1); - }; - var isIntegerKey = (key) => isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; - var cacheStringFunction = (fn3) => { - const cache = /* @__PURE__ */ Object.create(null); - return (str) => { - const hit = cache[str]; - return hit || (cache[str] = fn3(str)); - }; - }; - var camelizeRE = /-(\w)/g; - var camelize = cacheStringFunction((str) => { - return str.replace(camelizeRE, (_3, c3) => c3 ? c3.toUpperCase() : ""); - }); - var hyphenateRE = /\B([A-Z])/g; - var hyphenate = cacheStringFunction((str) => str.replace(hyphenateRE, "-$1").toLowerCase()); - var capitalize = cacheStringFunction((str) => str.charAt(0).toUpperCase() + str.slice(1)); - var toHandlerKey = cacheStringFunction((str) => str ? `on${capitalize(str)}` : ``); - var hasChanged = (value, oldValue) => value !== oldValue && (value === value || oldValue === oldValue); - var targetMap = /* @__PURE__ */ new WeakMap(); - var effectStack = []; - var activeEffect; - var ITERATE_KEY = Symbol(true ? "iterate" : ""); - var MAP_KEY_ITERATE_KEY = Symbol(true ? "Map key iterate" : ""); - function isEffect(fn3) { - return fn3 && fn3._isEffect === true; - } - function effect2(fn3, options = EMPTY_OBJ) { - if (isEffect(fn3)) { - fn3 = fn3.raw; - } - const effect32 = createReactiveEffect(fn3, options); - if (!options.lazy) { - effect32(); - } - return effect32; - } - function stop(effect32) { - if (effect32.active) { - cleanup(effect32); - if (effect32.options.onStop) { - effect32.options.onStop(); + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; } - effect32.active = false; + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; } - } - var uid = 0; - function createReactiveEffect(fn3, options) { - const effect32 = function reactiveEffect() { - if (!effect32.active) { - return fn3(); - } - if (!effectStack.includes(effect32)) { - cleanup(effect32); + function toSource(func) { + if (func != null) { try { - enableTracking(); - effectStack.push(effect32); - activeEffect = effect32; - return fn3(); - } finally { - effectStack.pop(); - resetTracking(); - activeEffect = effectStack[effectStack.length - 1]; + return funcToString.call(func); + } catch (e2) { } + try { + return func + ""; + } catch (e2) { + } } - }; - effect32.id = uid++; - effect32.allowRecurse = !!options.allowRecurse; - effect32._isEffect = true; - effect32.active = true; - effect32.raw = fn3; - effect32.deps = []; - effect32.options = options; - return effect32; - } - function cleanup(effect32) { - const { deps } = effect32; - if (deps.length) { - for (let i3 = 0; i3 < deps.length; i3++) { - deps[i3].delete(effect32); + return ""; + } + function memoize(func, resolver) { + if (typeof func != "function" || resolver && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT); } - deps.length = 0; + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); + } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; } - } - var shouldTrack = true; - var trackStack = []; - function pauseTracking() { - trackStack.push(shouldTrack); - shouldTrack = false; - } - function enableTracking() { - trackStack.push(shouldTrack); - shouldTrack = true; - } - function resetTracking() { - const last = trackStack.pop(); - shouldTrack = last === void 0 ? true : last; - } - function track(target, type, key) { - if (!shouldTrack || activeEffect === void 0) { - return; + memoize.Cache = MapCache; + function eq(value, other) { + return value === other || value !== value && other !== other; } - let depsMap = targetMap.get(target); - if (!depsMap) { - targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); } - let dep = depsMap.get(key); - if (!dep) { - depsMap.set(key, dep = /* @__PURE__ */ new Set()); + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); } - if (!dep.has(activeEffect)) { - dep.add(activeEffect); - activeEffect.deps.push(dep); - if (activeEffect.options.onTrack) { - activeEffect.options.onTrack({ - effect: activeEffect, - target, - type, - key - }); - } + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); } - } - function trigger(target, type, key, newValue, oldValue, oldTarget) { - const depsMap = targetMap.get(target); - if (!depsMap) { - return; + function isFunction(value) { + var tag = isObject2(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; } - const effects = /* @__PURE__ */ new Set(); - const add2 = (effectsToAdd) => { - if (effectsToAdd) { - effectsToAdd.forEach((effect32) => { - if (effect32 !== activeEffect || effect32.allowRecurse) { - effects.add(effect32); - } - }); - } - }; - if (type === "clear") { - depsMap.forEach(add2); - } else if (key === "length" && isArray(target)) { - depsMap.forEach((dep, key2) => { - if (key2 === "length" || key2 >= newValue) { - add2(dep); - } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject2(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + function toString(value) { + return value == null ? "" : baseToString(value); + } + function get(object, path, defaultValue) { + var result = object == null ? void 0 : baseGet(object, path); + return result === void 0 ? defaultValue : result; + } + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function mapValues2(object, iteratee) { + var result = {}; + iteratee = baseIteratee(iteratee, 3); + baseForOwn(object, function(value, key, object2) { + result[key] = iteratee(value, key, object2); }); - } else { - if (key !== void 0) { - add2(depsMap.get(key)); - } - switch (type) { - case "add": - if (!isArray(target)) { - add2(depsMap.get(ITERATE_KEY)); - if (isMap(target)) { - add2(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } else if (isIntegerKey(key)) { - add2(depsMap.get("length")); - } - break; - case "delete": - if (!isArray(target)) { - add2(depsMap.get(ITERATE_KEY)); - if (isMap(target)) { - add2(depsMap.get(MAP_KEY_ITERATE_KEY)); - } - } - break; - case "set": - if (isMap(target)) { - add2(depsMap.get(ITERATE_KEY)); - } - break; - } + return result; } - const run = (effect32) => { - if (effect32.options.onTrigger) { - effect32.options.onTrigger({ - effect: effect32, - target, - key, - type, - newValue, - oldValue, - oldTarget - }); - } - if (effect32.options.scheduler) { - effect32.options.scheduler(effect32); - } else { - effect32(); - } - }; - effects.forEach(run); + function identity(value) { + return value; + } + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + module.exports = mapValues2; } - var isNonTrackableKeys = /* @__PURE__ */ makeMap(`__proto__,__v_isRef,__isVue`); - var builtInSymbols = new Set(Object.getOwnPropertyNames(Symbol).map((key) => Symbol[key]).filter(isSymbol)); - var get2 = /* @__PURE__ */ createGetter(); - var readonlyGet = /* @__PURE__ */ createGetter(true); - var arrayInstrumentations = /* @__PURE__ */ createArrayInstrumentations(); - function createArrayInstrumentations() { - const instrumentations = {}; - ["includes", "indexOf", "lastIndexOf"].forEach((key) => { - instrumentations[key] = function(...args) { - const arr = toRaw(this); - for (let i3 = 0, l2 = this.length; i3 < l2; i3++) { - track(arr, "get", i3 + ""); - } - const res = arr[key](...args); - if (res === -1 || res === false) { - return arr[key](...args.map(toRaw)); - } else { - return res; - } - }; - }); - ["push", "pop", "shift", "unshift", "splice"].forEach((key) => { - instrumentations[key] = function(...args) { - pauseTracking(); - const res = toRaw(this)[key].apply(this, args); - resetTracking(); - return res; - }; - }); - return instrumentations; - } - function createGetter(isReadonly = false, shallow = false) { - return function get3(target, key, receiver) { - if (key === "__v_isReactive") { - return !isReadonly; - } else if (key === "__v_isReadonly") { - return isReadonly; - } else if (key === "__v_raw" && receiver === (isReadonly ? shallow ? shallowReadonlyMap : readonlyMap : shallow ? shallowReactiveMap : reactiveMap).get(target)) { - return target; +}); + +// ../../../node_modules/lodash.keyby/index.js +var require_lodash4 = __commonJS({ + "../../../node_modules/lodash.keyby/index.js"(exports, module) { + var LARGE_ARRAY_SIZE = 200; + var FUNC_ERROR_TEXT = "Expected a function"; + var HASH_UNDEFINED = "__lodash_hash_undefined__"; + var UNORDERED_COMPARE_FLAG = 1; + var PARTIAL_COMPARE_FLAG = 2; + var INFINITY = 1 / 0; + var MAX_SAFE_INTEGER = 9007199254740991; + var argsTag = "[object Arguments]"; + var arrayTag = "[object Array]"; + var boolTag = "[object Boolean]"; + var dateTag = "[object Date]"; + var errorTag = "[object Error]"; + var funcTag = "[object Function]"; + var genTag = "[object GeneratorFunction]"; + var mapTag = "[object Map]"; + var numberTag = "[object Number]"; + var objectTag = "[object Object]"; + var promiseTag = "[object Promise]"; + var regexpTag = "[object RegExp]"; + var setTag = "[object Set]"; + var stringTag = "[object String]"; + var symbolTag = "[object Symbol]"; + var weakMapTag = "[object WeakMap]"; + var arrayBufferTag = "[object ArrayBuffer]"; + var dataViewTag = "[object DataView]"; + var float32Tag = "[object Float32Array]"; + var float64Tag = "[object Float64Array]"; + var int8Tag = "[object Int8Array]"; + var int16Tag = "[object Int16Array]"; + var int32Tag = "[object Int32Array]"; + var uint8Tag = "[object Uint8Array]"; + var uint8ClampedTag = "[object Uint8ClampedArray]"; + var uint16Tag = "[object Uint16Array]"; + var uint32Tag = "[object Uint32Array]"; + var reIsDeepProp = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/; + var reIsPlainProp = /^\w*$/; + var reLeadingDot = /^\./; + var rePropName = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g; + var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + var reEscapeChar = /\\(\\)?/g; + var reIsHostCtor = /^\[object .+?Constructor\]$/; + var reIsUint = /^(?:0|[1-9]\d*)$/; + var typedArrayTags = {}; + typedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true; + typedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false; + var freeGlobal = typeof global == "object" && global && global.Object === Object && global; + var freeSelf = typeof self == "object" && self && self.Object === Object && self; + var root = freeGlobal || freeSelf || Function("return this")(); + var freeExports = typeof exports == "object" && exports && !exports.nodeType && exports; + var freeModule = freeExports && typeof module == "object" && module && !module.nodeType && module; + var moduleExports = freeModule && freeModule.exports === freeExports; + var freeProcess = moduleExports && freeGlobal.process; + var nodeUtil = function() { + try { + return freeProcess && freeProcess.binding("util"); + } catch (e2) { } - const targetIsArray = isArray(target); - if (!isReadonly && targetIsArray && hasOwn(arrayInstrumentations, key)) { - return Reflect.get(arrayInstrumentations, key, receiver); + }(); + var nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray; + function arrayAggregator(array, setter, iteratee, accumulator) { + var index = -1, length = array ? array.length : 0; + while (++index < length) { + var value = array[index]; + setter(accumulator, value, iteratee(value), array); } - const res = Reflect.get(target, key, receiver); - if (isSymbol(key) ? builtInSymbols.has(key) : isNonTrackableKeys(key)) { - return res; - } - if (!isReadonly) { - track(target, "get", key); - } - if (shallow) { - return res; - } - if (isRef(res)) { - const shouldUnwrap = !targetIsArray || !isIntegerKey(key); - return shouldUnwrap ? res.value : res; - } - if (isObject(res)) { - return isReadonly ? readonly(res) : reactive2(res); - } - return res; - }; - } - var set2 = /* @__PURE__ */ createSetter(); - function createSetter(shallow = false) { - return function set3(target, key, value, receiver) { - let oldValue = target[key]; - if (!shallow) { - value = toRaw(value); - oldValue = toRaw(oldValue); - if (!isArray(target) && isRef(oldValue) && !isRef(value)) { - oldValue.value = value; + return accumulator; + } + function arraySome(array, predicate) { + var index = -1, length = array ? array.length : 0; + while (++index < length) { + if (predicate(array[index], index, array)) { return true; } } - const hadKey = isArray(target) && isIntegerKey(key) ? Number(key) < target.length : hasOwn(target, key); - const result = Reflect.set(target, key, value, receiver); - if (target === toRaw(receiver)) { - if (!hadKey) { - trigger(target, "add", key, value); - } else if (hasChanged(value, oldValue)) { - trigger(target, "set", key, value, oldValue); - } + return false; + } + function baseProperty(key) { + return function(object) { + return object == null ? void 0 : object[key]; + }; + } + function baseTimes(n2, iteratee) { + var index = -1, result = Array(n2); + while (++index < n2) { + result[index] = iteratee(index); } return result; - }; - } - function deleteProperty(target, key) { - const hadKey = hasOwn(target, key); - const oldValue = target[key]; - const result = Reflect.deleteProperty(target, key); - if (result && hadKey) { - trigger(target, "delete", key, void 0, oldValue); } - return result; - } - function has(target, key) { - const result = Reflect.has(target, key); - if (!isSymbol(key) || !builtInSymbols.has(key)) { - track(target, "has", key); + function baseUnary(func) { + return function(value) { + return func(value); + }; } - return result; - } - function ownKeys(target) { - track(target, "iterate", isArray(target) ? "length" : ITERATE_KEY); - return Reflect.ownKeys(target); - } - var mutableHandlers = { - get: get2, - set: set2, - deleteProperty, - has, - ownKeys - }; - var readonlyHandlers = { - get: readonlyGet, - set(target, key) { - if (true) { - console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`, target); + function getValue(object, key) { + return object == null ? void 0 : object[key]; + } + function isHostObject(value) { + var result = false; + if (value != null && typeof value.toString != "function") { + try { + result = !!(value + ""); + } catch (e2) { + } } - return true; - }, - deleteProperty(target, key) { - if (true) { - console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`, target); - } - return true; + return result; } - }; - var toReactive = (value) => isObject(value) ? reactive2(value) : value; - var toReadonly = (value) => isObject(value) ? readonly(value) : value; - var toShallow = (value) => value; - var getProto = (v3) => Reflect.getPrototypeOf(v3); - function get$1(target, key, isReadonly = false, isShallow = false) { - target = target[ - "__v_raw" - /* RAW */ - ]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (key !== rawKey) { - !isReadonly && track(rawTarget, "get", key); + function mapToArray(map) { + var index = -1, result = Array(map.size); + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; } - !isReadonly && track(rawTarget, "get", rawKey); - const { has: has2 } = getProto(rawTarget); - const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - if (has2.call(rawTarget, key)) { - return wrap(target.get(key)); - } else if (has2.call(rawTarget, rawKey)) { - return wrap(target.get(rawKey)); - } else if (target !== rawTarget) { - target.get(key); + function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; } - } - function has$1(key, isReadonly = false) { - const target = this[ - "__v_raw" - /* RAW */ - ]; - const rawTarget = toRaw(target); - const rawKey = toRaw(key); - if (key !== rawKey) { - !isReadonly && track(rawTarget, "has", key); + function setToArray(set) { + var index = -1, result = Array(set.size); + set.forEach(function(value) { + result[++index] = value; + }); + return result; } - !isReadonly && track(rawTarget, "has", rawKey); - return key === rawKey ? target.has(key) : target.has(key) || target.has(rawKey); - } - function size(target, isReadonly = false) { - target = target[ - "__v_raw" - /* RAW */ - ]; - !isReadonly && track(toRaw(target), "iterate", ITERATE_KEY); - return Reflect.get(target, "size", target); - } - function add(value) { - value = toRaw(value); - const target = toRaw(this); - const proto = getProto(target); - const hadKey = proto.has.call(target, value); - if (!hadKey) { - target.add(value); - trigger(target, "add", value, value); + var arrayProto = Array.prototype; + var funcProto = Function.prototype; + var objectProto = Object.prototype; + var coreJsData = root["__core-js_shared__"]; + var maskSrcKey = function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ""); + return uid ? "Symbol(src)_1." + uid : ""; + }(); + var funcToString = funcProto.toString; + var hasOwnProperty = objectProto.hasOwnProperty; + var objectToString = objectProto.toString; + var reIsNative = RegExp( + "^" + funcToString.call(hasOwnProperty).replace(reRegExpChar, "\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, "$1.*?") + "$" + ); + var Symbol2 = root.Symbol; + var Uint8Array2 = root.Uint8Array; + var propertyIsEnumerable = objectProto.propertyIsEnumerable; + var splice = arrayProto.splice; + var nativeKeys = overArg(Object.keys, Object); + var DataView = getNative(root, "DataView"); + var Map2 = getNative(root, "Map"); + var Promise2 = getNative(root, "Promise"); + var Set2 = getNative(root, "Set"); + var WeakMap2 = getNative(root, "WeakMap"); + var nativeCreate = getNative(Object, "create"); + var dataViewCtorString = toSource(DataView); + var mapCtorString = toSource(Map2); + var promiseCtorString = toSource(Promise2); + var setCtorString = toSource(Set2); + var weakMapCtorString = toSource(WeakMap2); + var symbolProto = Symbol2 ? Symbol2.prototype : void 0; + var symbolValueOf = symbolProto ? symbolProto.valueOf : void 0; + var symbolToString = symbolProto ? symbolProto.toString : void 0; + function Hash(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - return this; - } - function set$1(key, value) { - value = toRaw(value); - const target = toRaw(this); - const { has: has2, get: get3 } = getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target, key); - } else if (true) { - checkIdentityKeys(target, has2, key); + function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; } - const oldValue = get3.call(target, key); - target.set(key, value); - if (!hadKey) { - trigger(target, "add", key, value); - } else if (hasChanged(value, oldValue)) { - trigger(target, "set", key, value, oldValue); + function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; } - return this; - } - function deleteEntry(key) { - const target = toRaw(this); - const { has: has2, get: get3 } = getProto(target); - let hadKey = has2.call(target, key); - if (!hadKey) { - key = toRaw(key); - hadKey = has2.call(target, key); - } else if (true) { - checkIdentityKeys(target, has2, key); + function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? void 0 : result; + } + return hasOwnProperty.call(data, key) ? data[key] : void 0; } - const oldValue = get3 ? get3.call(target, key) : void 0; - const result = target.delete(key); - if (hadKey) { - trigger(target, "delete", key, void 0, oldValue); + function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== void 0 : hasOwnProperty.call(data, key); } - return result; - } - function clear() { - const target = toRaw(this); - const hadItems = target.size !== 0; - const oldTarget = true ? isMap(target) ? new Map(target) : new Set(target) : void 0; - const result = target.clear(); - if (hadItems) { - trigger(target, "clear", void 0, void 0, oldTarget); + function hashSet(key, value) { + var data = this.__data__; + data[key] = nativeCreate && value === void 0 ? HASH_UNDEFINED : value; + return this; } - return result; - } - function createForEach(isReadonly, isShallow) { - return function forEach(callback, thisArg) { - const observed = this; - const target = observed[ - "__v_raw" - /* RAW */ - ]; - const rawTarget = toRaw(target); - const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - !isReadonly && track(rawTarget, "iterate", ITERATE_KEY); - return target.forEach((value, key) => { - return callback.call(thisArg, wrap(value), wrap(key), observed); - }); - }; - } - function createIterableMethod(method, isReadonly, isShallow) { - return function(...args) { - const target = this[ - "__v_raw" - /* RAW */ - ]; - const rawTarget = toRaw(target); - const targetIsMap = isMap(rawTarget); - const isPair = method === "entries" || method === Symbol.iterator && targetIsMap; - const isKeyOnly = method === "keys" && targetIsMap; - const innerIterator = target[method](...args); - const wrap = isShallow ? toShallow : isReadonly ? toReadonly : toReactive; - !isReadonly && track(rawTarget, "iterate", isKeyOnly ? MAP_KEY_ITERATE_KEY : ITERATE_KEY); - return { - // iterator protocol - next() { - const { value, done } = innerIterator.next(); - return done ? { value, done } : { - value: isPair ? [wrap(value[0]), wrap(value[1])] : wrap(value), - done - }; - }, - // iterable protocol - [Symbol.iterator]() { - return this; - } - }; - }; - } - function createReadonlyMethod(type) { - return function(...args) { - if (true) { - const key = args[0] ? `on key "${args[0]}" ` : ``; - console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`, toRaw(this)); + Hash.prototype.clear = hashClear; + Hash.prototype["delete"] = hashDelete; + Hash.prototype.get = hashGet; + Hash.prototype.has = hashHas; + Hash.prototype.set = hashSet; + function ListCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); } - return type === "delete" ? false : this; - }; - } - function createInstrumentations() { - const mutableInstrumentations2 = { - get(key) { - return get$1(this, key); - }, - get size() { - return size(this); - }, - has: has$1, - add, - set: set$1, - delete: deleteEntry, - clear, - forEach: createForEach(false, false) - }; - const shallowInstrumentations2 = { - get(key) { - return get$1(this, key, false, true); - }, - get size() { - return size(this); - }, - has: has$1, - add, - set: set$1, - delete: deleteEntry, - clear, - forEach: createForEach(false, true) - }; - const readonlyInstrumentations2 = { - get(key) { - return get$1(this, key, true); - }, - get size() { - return size(this, true); - }, - has(key) { - return has$1.call(this, key, true); - }, - add: createReadonlyMethod( - "add" - /* ADD */ - ), - set: createReadonlyMethod( - "set" - /* SET */ - ), - delete: createReadonlyMethod( - "delete" - /* DELETE */ - ), - clear: createReadonlyMethod( - "clear" - /* CLEAR */ - ), - forEach: createForEach(true, false) - }; - const shallowReadonlyInstrumentations2 = { - get(key) { - return get$1(this, key, true, true); - }, - get size() { - return size(this, true); - }, - has(key) { - return has$1.call(this, key, true); - }, - add: createReadonlyMethod( - "add" - /* ADD */ - ), - set: createReadonlyMethod( - "set" - /* SET */ - ), - delete: createReadonlyMethod( - "delete" - /* DELETE */ - ), - clear: createReadonlyMethod( - "clear" - /* CLEAR */ - ), - forEach: createForEach(true, true) - }; - const iteratorMethods = ["keys", "values", "entries", Symbol.iterator]; - iteratorMethods.forEach((method) => { - mutableInstrumentations2[method] = createIterableMethod(method, false, false); - readonlyInstrumentations2[method] = createIterableMethod(method, true, false); - shallowInstrumentations2[method] = createIterableMethod(method, false, true); - shallowReadonlyInstrumentations2[method] = createIterableMethod(method, true, true); - }); - return [ - mutableInstrumentations2, - readonlyInstrumentations2, - shallowInstrumentations2, - shallowReadonlyInstrumentations2 - ]; - } - var [mutableInstrumentations, readonlyInstrumentations, shallowInstrumentations, shallowReadonlyInstrumentations] = /* @__PURE__ */ createInstrumentations(); - function createInstrumentationGetter(isReadonly, shallow) { - const instrumentations = shallow ? isReadonly ? shallowReadonlyInstrumentations : shallowInstrumentations : isReadonly ? readonlyInstrumentations : mutableInstrumentations; - return (target, key, receiver) => { - if (key === "__v_isReactive") { - return !isReadonly; - } else if (key === "__v_isReadonly") { - return isReadonly; - } else if (key === "__v_raw") { - return target; + } + function listCacheClear() { + this.__data__ = []; + } + function listCacheDelete(key) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + return false; } - return Reflect.get(hasOwn(instrumentations, key) && key in target ? instrumentations : target, key, receiver); - }; - } - var mutableCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(false, false) - }; - var readonlyCollectionHandlers = { - get: /* @__PURE__ */ createInstrumentationGetter(true, false) - }; - function checkIdentityKeys(target, has2, key) { - const rawKey = toRaw(key); - if (rawKey !== key && has2.call(target, rawKey)) { - const type = toRawType(target); - console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; } - } - var reactiveMap = /* @__PURE__ */ new WeakMap(); - var shallowReactiveMap = /* @__PURE__ */ new WeakMap(); - var readonlyMap = /* @__PURE__ */ new WeakMap(); - var shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); - function targetTypeMap(rawType) { - switch (rawType) { - case "Object": - case "Array": - return 1; - case "Map": - case "Set": - case "WeakMap": - case "WeakSet": - return 2; - default: - return 0; + function listCacheGet(key) { + var data = this.__data__, index = assocIndexOf(data, key); + return index < 0 ? void 0 : data[index][1]; } - } - function getTargetType(value) { - return value[ - "__v_skip" - /* SKIP */ - ] || !Object.isExtensible(value) ? 0 : targetTypeMap(toRawType(value)); - } - function reactive2(target) { - if (target && target[ - "__v_isReadonly" - /* IS_READONLY */ - ]) { - return target; + function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; } - return createReactiveObject(target, false, mutableHandlers, mutableCollectionHandlers, reactiveMap); - } - function readonly(target) { - return createReactiveObject(target, true, readonlyHandlers, readonlyCollectionHandlers, readonlyMap); - } - function createReactiveObject(target, isReadonly, baseHandlers, collectionHandlers, proxyMap) { - if (!isObject(target)) { - if (true) { - console.warn(`value cannot be made reactive: ${String(target)}`); + function listCacheSet(key, value) { + var data = this.__data__, index = assocIndexOf(data, key); + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; } - return target; + return this; } - if (target[ - "__v_raw" - /* RAW */ - ] && !(isReadonly && target[ - "__v_isReactive" - /* IS_REACTIVE */ - ])) { - return target; + ListCache.prototype.clear = listCacheClear; + ListCache.prototype["delete"] = listCacheDelete; + ListCache.prototype.get = listCacheGet; + ListCache.prototype.has = listCacheHas; + ListCache.prototype.set = listCacheSet; + function MapCache(entries) { + var index = -1, length = entries ? entries.length : 0; + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } } - const existingProxy = proxyMap.get(target); - if (existingProxy) { - return existingProxy; + function mapCacheClear() { + this.__data__ = { + "hash": new Hash(), + "map": new (Map2 || ListCache)(), + "string": new Hash() + }; } - const targetType = getTargetType(target); - if (targetType === 0) { - return target; + function mapCacheDelete(key) { + return getMapData(this, key)["delete"](key); } - const proxy = new Proxy(target, targetType === 2 ? collectionHandlers : baseHandlers); - proxyMap.set(target, proxy); - return proxy; - } - function toRaw(observed) { - return observed && toRaw(observed[ - "__v_raw" - /* RAW */ - ]) || observed; - } - function isRef(r3) { - return Boolean(r3 && r3.__v_isRef === true); - } - magic("nextTick", () => nextTick); - magic("dispatch", (el) => dispatch.bind(dispatch, el)); - magic("watch", (el, { evaluateLater: evaluateLater2, effect: effect32 }) => (key, callback) => { - let evaluate2 = evaluateLater2(key); - let firstTime = true; - let oldValue; - let effectReference = effect32(() => evaluate2((value) => { - JSON.stringify(value); - if (!firstTime) { - queueMicrotask(() => { - callback(value, oldValue); - oldValue = value; - }); - } else { - oldValue = value; - } - firstTime = false; - })); - el._x_effects.delete(effectReference); - }); - magic("store", getStores); - magic("data", (el) => scope(el)); - magic("root", (el) => closestRoot(el)); - magic("refs", (el) => { - if (el._x_refs_proxy) - return el._x_refs_proxy; - el._x_refs_proxy = mergeProxies(getArrayOfRefObject(el)); - return el._x_refs_proxy; - }); - function getArrayOfRefObject(el) { - let refObjects = []; - let currentEl = el; - while (currentEl) { - if (currentEl._x_refs) - refObjects.push(currentEl._x_refs); - currentEl = currentEl.parentNode; + function mapCacheGet(key) { + return getMapData(this, key).get(key); } - return refObjects; - } - var globalIdMemo = {}; - function findAndIncrementId(name) { - if (!globalIdMemo[name]) - globalIdMemo[name] = 0; - return ++globalIdMemo[name]; - } - function closestIdRoot(el, name) { - return findClosest(el, (element) => { - if (element._x_ids && element._x_ids[name]) - return true; - }); - } - function setIdRoot(el, name) { - if (!el._x_ids) - el._x_ids = {}; - if (!el._x_ids[name]) - el._x_ids[name] = findAndIncrementId(name); - } - magic("id", (el) => (name, key = null) => { - let root = closestIdRoot(el, name); - let id = root ? root._x_ids[name] : findAndIncrementId(name); - return key ? `${name}-${id}-${key}` : `${name}-${id}`; - }); - magic("el", (el) => el); - warnMissingPluginMagic("Focus", "focus", "focus"); - warnMissingPluginMagic("Persist", "persist", "persist"); - function warnMissingPluginMagic(name, magicName, slug) { - magic(magicName, (el) => warn(`You can't use [$${magicName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); - } - directive("modelable", (el, { expression }, { effect: effect32, evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { - let func = evaluateLater2(expression); - let innerGet = () => { - let result; - func((i3) => result = i3); - return result; - }; - let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`); - let innerSet = (val) => evaluateInnerSet(() => { - }, { scope: { "__placeholder": val } }); - let initialValue = innerGet(); - innerSet(initialValue); - queueMicrotask(() => { - if (!el._x_model) - return; - el._x_removeModelListeners["default"](); - let outerGet = el._x_model.get; - let outerSet = el._x_model.set; - let releaseEntanglement = entangle( - { - get() { - return outerGet(); - }, - set(value) { - outerSet(value); - } - }, - { - get() { - return innerGet(); - }, - set(value) { - innerSet(value); - } - } - ); - cleanup2(releaseEntanglement); - }); - }); - directive("teleport", (el, { modifiers, expression }, { cleanup: cleanup2 }) => { - if (el.tagName.toLowerCase() !== "template") - warn("x-teleport can only be used on a <template> tag", el); - let target = getTarget(expression); - let clone2 = el.content.cloneNode(true).firstElementChild; - el._x_teleport = clone2; - clone2._x_teleportBack = el; - el.setAttribute("data-teleport-template", true); - clone2.setAttribute("data-teleport-target", true); - if (el._x_forwardEvents) { - el._x_forwardEvents.forEach((eventName) => { - clone2.addEventListener(eventName, (e3) => { - e3.stopPropagation(); - el.dispatchEvent(new e3.constructor(e3.type, e3)); - }); - }); + function mapCacheHas(key) { + return getMapData(this, key).has(key); } - addScopeToNode(clone2, {}, el); - let placeInDom = (clone3, target2, modifiers2) => { - if (modifiers2.includes("prepend")) { - target2.parentNode.insertBefore(clone3, target2); - } else if (modifiers2.includes("append")) { - target2.parentNode.insertBefore(clone3, target2.nextSibling); - } else { - target2.appendChild(clone3); + function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; + } + MapCache.prototype.clear = mapCacheClear; + MapCache.prototype["delete"] = mapCacheDelete; + MapCache.prototype.get = mapCacheGet; + MapCache.prototype.has = mapCacheHas; + MapCache.prototype.set = mapCacheSet; + function SetCache(values) { + var index = -1, length = values ? values.length : 0; + this.__data__ = new MapCache(); + while (++index < length) { + this.add(values[index]); } - }; - mutateDom(() => { - placeInDom(clone2, target, modifiers); - initTree(clone2); - clone2._x_ignore = true; - }); - el._x_teleportPutBack = () => { - let target2 = getTarget(expression); - mutateDom(() => { - placeInDom(el._x_teleport, target2, modifiers); - }); - }; - cleanup2(() => clone2.remove()); - }); - var teleportContainerDuringClone = document.createElement("div"); - function getTarget(expression) { - let target = skipDuringClone(() => { - return document.querySelector(expression); - }, () => { - return teleportContainerDuringClone; - })(); - if (!target) - warn(`Cannot find x-teleport element for selector: "${expression}"`); - return target; - } - var handler = () => { - }; - handler.inline = (el, { modifiers }, { cleanup: cleanup2 }) => { - modifiers.includes("self") ? el._x_ignoreSelf = true : el._x_ignore = true; - cleanup2(() => { - modifiers.includes("self") ? delete el._x_ignoreSelf : delete el._x_ignore; - }); - }; - directive("ignore", handler); - directive("effect", (el, { expression }, { effect: effect32 }) => effect32(evaluateLater(el, expression))); - function on(el, event, modifiers, callback) { - let listenerTarget = el; - let handler4 = (e3) => callback(e3); - let options = {}; - let wrapHandler = (callback2, wrapper) => (e3) => wrapper(callback2, e3); - if (modifiers.includes("dot")) - event = dotSyntax(event); - if (modifiers.includes("camel")) - event = camelCase2(event); - if (modifiers.includes("passive")) - options.passive = true; - if (modifiers.includes("capture")) - options.capture = true; - if (modifiers.includes("window")) - listenerTarget = window; - if (modifiers.includes("document")) - listenerTarget = document; - if (modifiers.includes("debounce")) { - let nextModifier = modifiers[modifiers.indexOf("debounce") + 1] || "invalid-wait"; - let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; - handler4 = debounce(handler4, wait); } - if (modifiers.includes("throttle")) { - let nextModifier = modifiers[modifiers.indexOf("throttle") + 1] || "invalid-wait"; - let wait = isNumeric(nextModifier.split("ms")[0]) ? Number(nextModifier.split("ms")[0]) : 250; - handler4 = throttle(handler4, wait); + function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; } - if (modifiers.includes("prevent")) - handler4 = wrapHandler(handler4, (next, e3) => { - e3.preventDefault(); - next(e3); - }); - if (modifiers.includes("stop")) - handler4 = wrapHandler(handler4, (next, e3) => { - e3.stopPropagation(); - next(e3); - }); - if (modifiers.includes("self")) - handler4 = wrapHandler(handler4, (next, e3) => { - e3.target === el && next(e3); - }); - if (modifiers.includes("away") || modifiers.includes("outside")) { - listenerTarget = document; - handler4 = wrapHandler(handler4, (next, e3) => { - if (el.contains(e3.target)) - return; - if (e3.target.isConnected === false) - return; - if (el.offsetWidth < 1 && el.offsetHeight < 1) - return; - if (el._x_isShown === false) - return; - next(e3); - }); + function setCacheHas(value) { + return this.__data__.has(value); } - if (modifiers.includes("once")) { - handler4 = wrapHandler(handler4, (next, e3) => { - next(e3); - listenerTarget.removeEventListener(event, handler4, options); - }); + SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; + SetCache.prototype.has = setCacheHas; + function Stack(entries) { + this.__data__ = new ListCache(entries); } - handler4 = wrapHandler(handler4, (next, e3) => { - if (isKeyEvent(event)) { - if (isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers)) { - return; - } - } - next(e3); - }); - listenerTarget.addEventListener(event, handler4, options); - return () => { - listenerTarget.removeEventListener(event, handler4, options); - }; - } - function dotSyntax(subject) { - return subject.replace(/-/g, "."); - } - function camelCase2(subject) { - return subject.toLowerCase().replace(/-(\w)/g, (match, char) => char.toUpperCase()); - } - function isNumeric(subject) { - return !Array.isArray(subject) && !isNaN(subject); - } - function kebabCase2(subject) { - if ([" ", "_"].includes( - subject - )) - return subject; - return subject.replace(/([a-z])([A-Z])/g, "$1-$2").replace(/[_\s]/, "-").toLowerCase(); - } - function isKeyEvent(event) { - return ["keydown", "keyup"].includes(event); - } - function isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers) { - let keyModifiers = modifiers.filter((i3) => { - return !["window", "document", "prevent", "stop", "once", "capture"].includes(i3); - }); - if (keyModifiers.includes("debounce")) { - let debounceIndex = keyModifiers.indexOf("debounce"); - keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); + function stackClear() { + this.__data__ = new ListCache(); } - if (keyModifiers.includes("throttle")) { - let debounceIndex = keyModifiers.indexOf("throttle"); - keyModifiers.splice(debounceIndex, isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); + function stackDelete(key) { + return this.__data__["delete"](key); } - if (keyModifiers.length === 0) - return false; - if (keyModifiers.length === 1 && keyToModifiers(e3.key).includes(keyModifiers[0])) - return false; - const systemKeyModifiers = ["ctrl", "shift", "alt", "meta", "cmd", "super"]; - const selectedSystemKeyModifiers = systemKeyModifiers.filter((modifier) => keyModifiers.includes(modifier)); - keyModifiers = keyModifiers.filter((i3) => !selectedSystemKeyModifiers.includes(i3)); - if (selectedSystemKeyModifiers.length > 0) { - const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => { - if (modifier === "cmd" || modifier === "super") - modifier = "meta"; - return e3[`${modifier}Key`]; - }); - if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) { - if (keyToModifiers(e3.key).includes(keyModifiers[0])) - return false; - } + function stackGet(key) { + return this.__data__.get(key); } - return true; - } - function keyToModifiers(key) { - if (!key) - return []; - key = kebabCase2(key); - let modifierToKeyMap = { - "ctrl": "control", - "slash": "/", - "space": " ", - "spacebar": " ", - "cmd": "meta", - "esc": "escape", - "up": "arrow-up", - "down": "arrow-down", - "left": "arrow-left", - "right": "arrow-right", - "period": ".", - "equal": "=", - "minus": "-", - "underscore": "_" - }; - modifierToKeyMap[key] = key; - return Object.keys(modifierToKeyMap).map((modifier) => { - if (modifierToKeyMap[modifier] === key) - return modifier; - }).filter((modifier) => modifier); - } - directive("model", (el, { modifiers, expression }, { effect: effect32, cleanup: cleanup2 }) => { - let scopeTarget = el; - if (modifiers.includes("parent")) { - scopeTarget = el.parentNode; + function stackHas(key) { + return this.__data__.has(key); } - let evaluateGet = evaluateLater(scopeTarget, expression); - let evaluateSet; - if (typeof expression === "string") { - evaluateSet = evaluateLater(scopeTarget, `${expression} = __placeholder`); - } else if (typeof expression === "function" && typeof expression() === "string") { - evaluateSet = evaluateLater(scopeTarget, `${expression()} = __placeholder`); - } else { - evaluateSet = () => { - }; + function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map2 || pairs.length < LARGE_ARRAY_SIZE - 1) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; } - let getValue = () => { - let result; - evaluateGet((value) => result = value); - return isGetterSetter(result) ? result.get() : result; - }; - let setValue = (value) => { - let result; - evaluateGet((value2) => result = value2); - if (isGetterSetter(result)) { - result.set(value); - } else { - evaluateSet(() => { - }, { - scope: { "__placeholder": value } - }); + Stack.prototype.clear = stackClear; + Stack.prototype["delete"] = stackDelete; + Stack.prototype.get = stackGet; + Stack.prototype.has = stackHas; + Stack.prototype.set = stackSet; + function arrayLikeKeys(value, inherited) { + var result = isArray(value) || isArguments(value) ? baseTimes(value.length, String) : []; + var length = result.length, skipIndexes = !!length; + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && !(skipIndexes && (key == "length" || isIndex(key, length)))) { + result.push(key); + } } - }; - if (typeof expression === "string" && el.type === "radio") { - mutateDom(() => { - if (!el.hasAttribute("name")) - el.setAttribute("name", expression); - }); + return result; } - var event = el.tagName.toLowerCase() === "select" || ["checkbox", "radio"].includes(el.type) || modifiers.includes("lazy") ? "change" : "input"; - let removeListener = isCloning ? () => { - } : on(el, event, modifiers, (e3) => { - setValue(getInputValue(el, modifiers, e3, getValue())); - }); - if (modifiers.includes("fill")) { - if ([null, ""].includes(getValue()) || el.type === "checkbox" && Array.isArray(getValue())) { - el.dispatchEvent(new Event(event, {})); + function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } } + return -1; } - if (!el._x_removeModelListeners) - el._x_removeModelListeners = {}; - el._x_removeModelListeners["default"] = removeListener; - cleanup2(() => el._x_removeModelListeners["default"]()); - if (el.form) { - let removeResetListener = on(el.form, "reset", [], (e3) => { - nextTick(() => el._x_model && el._x_model.set(el.value)); + function baseAggregator(collection, setter, iteratee, accumulator) { + baseEach(collection, function(value, key, collection2) { + setter(accumulator, value, iteratee(value), collection2); }); - cleanup2(() => removeResetListener()); + return accumulator; } - el._x_model = { - get() { - return getValue(); - }, - set(value) { - setValue(value); + var baseEach = createBaseEach(baseForOwn); + var baseFor = createBaseFor(); + function baseForOwn(object, iteratee) { + return object && baseFor(object, iteratee, keys); + } + function baseGet(object, path) { + path = isKey(path, object) ? [path] : castPath(path); + var index = 0, length = path.length; + while (object != null && index < length) { + object = object[toKey(path[index++])]; } - }; - el._x_forceModelUpdate = (value) => { - if (value === void 0 && typeof expression === "string" && expression.match(/\./)) - value = ""; - window.fromModel = true; - mutateDom(() => bind(el, "value", value)); - delete window.fromModel; - }; - effect32(() => { - let value = getValue(); - if (modifiers.includes("unintrusive") && document.activeElement.isSameNode(el)) - return; - el._x_forceModelUpdate(value); - }); - }); - function getInputValue(el, modifiers, event, currentValue) { - return mutateDom(() => { - if (event instanceof CustomEvent && event.detail !== void 0) - return event.detail !== null && event.detail !== void 0 ? event.detail : event.target.value; - else if (el.type === "checkbox") { - if (Array.isArray(currentValue)) { - let newValue = modifiers.includes("number") ? safeParseNumber(event.target.value) : event.target.value; - return event.target.checked ? currentValue.concat([newValue]) : currentValue.filter((el2) => !checkedAttrLooseCompare2(el2, newValue)); - } else { - return event.target.checked; - } - } else if (el.tagName.toLowerCase() === "select" && el.multiple) { - return modifiers.includes("number") ? Array.from(event.target.selectedOptions).map((option) => { - let rawValue = option.value || option.text; - return safeParseNumber(rawValue); - }) : Array.from(event.target.selectedOptions).map((option) => { - return option.value || option.text; - }); - } else { - let rawValue = event.target.value; - return modifiers.includes("number") ? safeParseNumber(rawValue) : modifiers.includes("trim") ? rawValue.trim() : rawValue; - } - }); - } - function safeParseNumber(rawValue) { - let number = rawValue ? parseFloat(rawValue) : null; - return isNumeric2(number) ? number : rawValue; - } - function checkedAttrLooseCompare2(valueA, valueB) { - return valueA == valueB; - } - function isNumeric2(subject) { - return !Array.isArray(subject) && !isNaN(subject); - } - function isGetterSetter(value) { - return value !== null && typeof value === "object" && typeof value.get === "function" && typeof value.set === "function"; - } - directive("cloak", (el) => queueMicrotask(() => mutateDom(() => el.removeAttribute(prefix("cloak"))))); - addInitSelector(() => `[${prefix("init")}]`); - directive("init", skipDuringClone((el, { expression }, { evaluate: evaluate2 }) => { - if (typeof expression === "string") { - return !!expression.trim() && evaluate2(expression, {}, false); + return index && index == length ? object : void 0; } - return evaluate2(expression, {}, false); - })); - directive("text", (el, { expression }, { effect: effect32, evaluateLater: evaluateLater2 }) => { - let evaluate2 = evaluateLater2(expression); - effect32(() => { - evaluate2((value) => { - mutateDom(() => { - el.textContent = value; - }); - }); - }); - }); - directive("html", (el, { expression }, { effect: effect32, evaluateLater: evaluateLater2 }) => { - let evaluate2 = evaluateLater2(expression); - effect32(() => { - evaluate2((value) => { - mutateDom(() => { - el.innerHTML = value; - el._x_ignoreSelf = true; - initTree(el); - delete el._x_ignoreSelf; - }); - }); - }); - }); - mapAttributes(startingWith(":", into(prefix("bind:")))); - var handler2 = (el, { value, modifiers, expression, original }, { effect: effect32 }) => { - if (!value) { - let bindingProviders = {}; - injectBindingProviders(bindingProviders); - let getBindings = evaluateLater(el, expression); - getBindings((bindings) => { - applyBindingsObject(el, bindings, original); - }, { scope: bindingProviders }); - return; + function baseGetTag(value) { + return objectToString.call(value); } - if (value === "key") - return storeKeyForXFor(el, expression); - if (el._x_inlineBindings && el._x_inlineBindings[value] && el._x_inlineBindings[value].extract) { - return; + function baseHasIn(object, key) { + return object != null && key in Object(object); } - let evaluate2 = evaluateLater(el, expression); - effect32(() => evaluate2((result) => { - if (result === void 0 && typeof expression === "string" && expression.match(/\./)) { - result = ""; + function baseIsEqual(value, other, customizer, bitmask, stack) { + if (value === other) { + return true; } - mutateDom(() => bind(el, value, result, modifiers)); - })); - }; - handler2.inline = (el, { value, modifiers, expression }) => { - if (!value) - return; - if (!el._x_inlineBindings) - el._x_inlineBindings = {}; - el._x_inlineBindings[value] = { expression, extract: false }; - }; - directive("bind", handler2); - function storeKeyForXFor(el, expression) { - el._x_keyExpression = expression; - } - addRootSelector(() => `[${prefix("data")}]`); - directive("data", (el, { expression }, { cleanup: cleanup2 }) => { - if (shouldSkipRegisteringDataDuringClone(el)) - return; - expression = expression === "" ? "{}" : expression; - let magicContext = {}; - injectMagics(magicContext, el); - let dataProviderContext = {}; - injectDataProviders(dataProviderContext, magicContext); - let data2 = evaluate(el, expression, { scope: dataProviderContext }); - if (data2 === void 0 || data2 === true) - data2 = {}; - injectMagics(data2, el); - let reactiveData = reactive(data2); - initInterceptors2(reactiveData); - let undo = addScopeToNode(el, reactiveData); - reactiveData["init"] && evaluate(el, reactiveData["init"]); - cleanup2(() => { - reactiveData["destroy"] && evaluate(el, reactiveData["destroy"]); - undo(); - }); - }); - directive("show", (el, { modifiers, expression }, { effect: effect32 }) => { - let evaluate2 = evaluateLater(el, expression); - if (!el._x_doHide) - el._x_doHide = () => { - mutateDom(() => { - el.style.setProperty("display", "none", modifiers.includes("important") ? "important" : void 0); - }); - }; - if (!el._x_doShow) - el._x_doShow = () => { - mutateDom(() => { - if (el.style.length === 1 && el.style.display === "none") { - el.removeAttribute("style"); - } else { - el.style.removeProperty("display"); - } - }); - }; - let hide2 = () => { - el._x_doHide(); - el._x_isShown = false; - }; - let show = () => { - el._x_doShow(); - el._x_isShown = true; - }; - let clickAwayCompatibleShow = () => setTimeout(show); - let toggle = once( - (value) => value ? show() : hide2(), - (value) => { - if (typeof el._x_toggleAndCascadeWithTransitions === "function") { - el._x_toggleAndCascadeWithTransitions(el, value, show, hide2); - } else { - value ? clickAwayCompatibleShow() : hide2(); - } + if (value == null || other == null || !isObject2(value) && !isObjectLike(other)) { + return value !== value && other !== other; } - ); - let oldValue; - let firstTime = true; - effect32(() => evaluate2((value) => { - if (!firstTime && value === oldValue) - return; - if (modifiers.includes("immediate")) - value ? clickAwayCompatibleShow() : hide2(); - toggle(value); - oldValue = value; - firstTime = false; - })); - }); - directive("for", (el, { expression }, { effect: effect32, cleanup: cleanup2 }) => { - let iteratorNames = parseForExpression(expression); - let evaluateItems = evaluateLater(el, iteratorNames.items); - let evaluateKey = evaluateLater( - el, - // the x-bind:key expression is stored for our use instead of evaluated. - el._x_keyExpression || "index" - ); - el._x_prevKeys = []; - el._x_lookup = {}; - effect32(() => loop(el, iteratorNames, evaluateItems, evaluateKey)); - cleanup2(() => { - Object.values(el._x_lookup).forEach((el2) => el2.remove()); - delete el._x_prevKeys; - delete el._x_lookup; - }); - }); - function loop(el, iteratorNames, evaluateItems, evaluateKey) { - let isObject22 = (i3) => typeof i3 === "object" && !Array.isArray(i3); - let templateEl = el; - evaluateItems((items) => { - if (isNumeric3(items) && items >= 0) { - items = Array.from(Array(items).keys(), (i3) => i3 + 1); + return baseIsEqualDeep(value, other, baseIsEqual, customizer, bitmask, stack); + } + function baseIsEqualDeep(object, other, equalFunc, customizer, bitmask, stack) { + var objIsArr = isArray(object), othIsArr = isArray(other), objTag = arrayTag, othTag = arrayTag; + if (!objIsArr) { + objTag = getTag(object); + objTag = objTag == argsTag ? objectTag : objTag; } - if (items === void 0) - items = []; - let lookup = el._x_lookup; - let prevKeys = el._x_prevKeys; - let scopes = []; - let keys = []; - if (isObject22(items)) { - items = Object.entries(items).map(([key, value]) => { - let scope2 = getIterationScopeVariables(iteratorNames, value, key, items); - evaluateKey((value2) => keys.push(value2), { scope: __spreadValues({ index: key }, scope2) }); - scopes.push(scope2); - }); - } else { - for (let i3 = 0; i3 < items.length; i3++) { - let scope2 = getIterationScopeVariables(iteratorNames, items[i3], i3, items); - evaluateKey((value) => keys.push(value), { scope: __spreadValues({ index: i3 }, scope2) }); - scopes.push(scope2); + if (!othIsArr) { + othTag = getTag(other); + othTag = othTag == argsTag ? objectTag : othTag; + } + var objIsObj = objTag == objectTag && !isHostObject(object), othIsObj = othTag == objectTag && !isHostObject(other), isSameTag = objTag == othTag; + if (isSameTag && !objIsObj) { + stack || (stack = new Stack()); + return objIsArr || isTypedArray(object) ? equalArrays(object, other, equalFunc, customizer, bitmask, stack) : equalByTag(object, other, objTag, equalFunc, customizer, bitmask, stack); + } + if (!(bitmask & PARTIAL_COMPARE_FLAG)) { + var objIsWrapped = objIsObj && hasOwnProperty.call(object, "__wrapped__"), othIsWrapped = othIsObj && hasOwnProperty.call(other, "__wrapped__"); + if (objIsWrapped || othIsWrapped) { + var objUnwrapped = objIsWrapped ? object.value() : object, othUnwrapped = othIsWrapped ? other.value() : other; + stack || (stack = new Stack()); + return equalFunc(objUnwrapped, othUnwrapped, customizer, bitmask, stack); } } - let adds = []; - let moves = []; - let removes = []; - let sames = []; - for (let i3 = 0; i3 < prevKeys.length; i3++) { - let key = prevKeys[i3]; - if (keys.indexOf(key) === -1) - removes.push(key); + if (!isSameTag) { + return false; } - prevKeys = prevKeys.filter((key) => !removes.includes(key)); - let lastKey = "template"; - for (let i3 = 0; i3 < keys.length; i3++) { - let key = keys[i3]; - let prevIndex = prevKeys.indexOf(key); - if (prevIndex === -1) { - prevKeys.splice(i3, 0, key); - adds.push([lastKey, i3]); - } else if (prevIndex !== i3) { - let keyInSpot = prevKeys.splice(i3, 1)[0]; - let keyForSpot = prevKeys.splice(prevIndex - 1, 1)[0]; - prevKeys.splice(i3, 0, keyForSpot); - prevKeys.splice(prevIndex, 0, keyInSpot); - moves.push([keyInSpot, keyForSpot]); - } else { - sames.push(key); + stack || (stack = new Stack()); + return equalObjects(object, other, equalFunc, customizer, bitmask, stack); + } + function baseIsMatch(object, source, matchData, customizer) { + var index = matchData.length, length = index, noCustomizer = !customizer; + if (object == null) { + return !length; + } + object = Object(object); + while (index--) { + var data = matchData[index]; + if (noCustomizer && data[2] ? data[1] !== object[data[0]] : !(data[0] in object)) { + return false; } - lastKey = key; } - for (let i3 = 0; i3 < removes.length; i3++) { - let key = removes[i3]; - if (!!lookup[key]._x_effects) { - lookup[key]._x_effects.forEach(dequeueJob); + while (++index < length) { + data = matchData[index]; + var key = data[0], objValue = object[key], srcValue = data[1]; + if (noCustomizer && data[2]) { + if (objValue === void 0 && !(key in object)) { + return false; + } + } else { + var stack = new Stack(); + if (customizer) { + var result = customizer(objValue, srcValue, key, object, source, stack); + } + if (!(result === void 0 ? baseIsEqual(srcValue, objValue, customizer, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG, stack) : result)) { + return false; + } } - lookup[key].remove(); - lookup[key] = null; - delete lookup[key]; } - for (let i3 = 0; i3 < moves.length; i3++) { - let [keyInSpot, keyForSpot] = moves[i3]; - let elInSpot = lookup[keyInSpot]; - let elForSpot = lookup[keyForSpot]; - let marker = document.createElement("div"); - mutateDom(() => { - if (!elForSpot) - warn(`x-for ":key" is undefined or invalid`, templateEl); - elForSpot.after(marker); - elInSpot.after(elForSpot); - elForSpot._x_currentIfEl && elForSpot.after(elForSpot._x_currentIfEl); - marker.before(elInSpot); - elInSpot._x_currentIfEl && elInSpot.after(elInSpot._x_currentIfEl); - marker.remove(); - }); - elForSpot._x_refreshXForScope(scopes[keys.indexOf(keyForSpot)]); + return true; + } + function baseIsNative(value) { + if (!isObject2(value) || isMasked(value)) { + return false; } - for (let i3 = 0; i3 < adds.length; i3++) { - let [lastKey2, index] = adds[i3]; - let lastEl = lastKey2 === "template" ? templateEl : lookup[lastKey2]; - if (lastEl._x_currentIfEl) - lastEl = lastEl._x_currentIfEl; - let scope2 = scopes[index]; - let key = keys[index]; - let clone2 = document.importNode(templateEl.content, true).firstElementChild; - let reactiveScope = reactive(scope2); - addScopeToNode(clone2, reactiveScope, templateEl); - clone2._x_refreshXForScope = (newScope) => { - Object.entries(newScope).forEach(([key2, value]) => { - reactiveScope[key2] = value; - }); - }; - mutateDom(() => { - lastEl.after(clone2); - initTree(clone2); - }); - if (typeof key === "object") { - warn("x-for key cannot be an object, it must be a string or an integer", templateEl); - } - lookup[key] = clone2; + var pattern = isFunction(value) || isHostObject(value) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); + } + function baseIsTypedArray(value) { + return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)]; + } + function baseIteratee(value) { + if (typeof value == "function") { + return value; } - for (let i3 = 0; i3 < sames.length; i3++) { - lookup[sames[i3]]._x_refreshXForScope(scopes[keys.indexOf(sames[i3])]); + if (value == null) { + return identity; } - templateEl._x_prevKeys = keys; - }); - } - function parseForExpression(expression) { - let forIteratorRE = /,([^,\}\]]*)(?:,([^,\}\]]*))?$/; - let stripParensRE = /^\s*\(|\)\s*$/g; - let forAliasRE = /([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/; - let inMatch = expression.match(forAliasRE); - if (!inMatch) - return; - let res = {}; - res.items = inMatch[2].trim(); - let item = inMatch[1].replace(stripParensRE, "").trim(); - let iteratorMatch = item.match(forIteratorRE); - if (iteratorMatch) { - res.item = item.replace(forIteratorRE, "").trim(); - res.index = iteratorMatch[1].trim(); - if (iteratorMatch[2]) { - res.collection = iteratorMatch[2].trim(); + if (typeof value == "object") { + return isArray(value) ? baseMatchesProperty(value[0], value[1]) : baseMatches(value); } - } else { - res.item = item; + return property(value); } - return res; - } - function getIterationScopeVariables(iteratorNames, item, index, items) { - let scopeVariables = {}; - if (/^\[.*\]$/.test(iteratorNames.item) && Array.isArray(item)) { - let names = iteratorNames.item.replace("[", "").replace("]", "").split(",").map((i3) => i3.trim()); - names.forEach((name, i3) => { - scopeVariables[name] = item[i3]; - }); - } else if (/^\{.*\}$/.test(iteratorNames.item) && !Array.isArray(item) && typeof item === "object") { - let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i3) => i3.trim()); - names.forEach((name) => { - scopeVariables[name] = item[name]; - }); - } else { - scopeVariables[iteratorNames.item] = item; + function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != "constructor") { + result.push(key); + } + } + return result; } - if (iteratorNames.index) - scopeVariables[iteratorNames.index] = index; - if (iteratorNames.collection) - scopeVariables[iteratorNames.collection] = items; - return scopeVariables; - } - function isNumeric3(subject) { - return !Array.isArray(subject) && !isNaN(subject); - } - function handler3() { - } - handler3.inline = (el, { expression }, { cleanup: cleanup2 }) => { - let root = closestRoot(el); - if (!root._x_refs) - root._x_refs = {}; - root._x_refs[expression] = el; - cleanup2(() => delete root._x_refs[expression]); - }; - directive("ref", handler3); - directive("if", (el, { expression }, { effect: effect32, cleanup: cleanup2 }) => { - if (el.tagName.toLowerCase() !== "template") - warn("x-if can only be used on a <template> tag", el); - let evaluate2 = evaluateLater(el, expression); - let show = () => { - if (el._x_currentIfEl) - return el._x_currentIfEl; - let clone2 = el.content.cloneNode(true).firstElementChild; - addScopeToNode(clone2, {}, el); - mutateDom(() => { - el.after(clone2); - initTree(clone2); - }); - el._x_currentIfEl = clone2; - el._x_undoIf = () => { - walk(clone2, (node) => { - if (!!node._x_effects) { - node._x_effects.forEach(dequeueJob); - } - }); - clone2.remove(); - delete el._x_currentIfEl; + function baseMatches(source) { + var matchData = getMatchData(source); + if (matchData.length == 1 && matchData[0][2]) { + return matchesStrictComparable(matchData[0][0], matchData[0][1]); + } + return function(object) { + return object === source || baseIsMatch(object, source, matchData); }; - return clone2; - }; - let hide2 = () => { - if (!el._x_undoIf) - return; - el._x_undoIf(); - delete el._x_undoIf; - }; - effect32(() => evaluate2((value) => { - value ? show() : hide2(); - })); - cleanup2(() => el._x_undoIf && el._x_undoIf()); - }); - directive("id", (el, { expression }, { evaluate: evaluate2 }) => { - let names = evaluate2(expression); - names.forEach((name) => setIdRoot(el, name)); - }); - mapAttributes(startingWith("@", into(prefix("on:")))); - directive("on", skipDuringClone((el, { value, modifiers, expression }, { cleanup: cleanup2 }) => { - let evaluate2 = expression ? evaluateLater(el, expression) : () => { - }; - if (el.tagName.toLowerCase() === "template") { - if (!el._x_forwardEvents) - el._x_forwardEvents = []; - if (!el._x_forwardEvents.includes(value)) - el._x_forwardEvents.push(value); } - let removeListener = on(el, value, modifiers, (e3) => { - evaluate2(() => { - }, { scope: { "$event": e3 }, params: [e3] }); - }); - cleanup2(() => removeListener()); - })); - warnMissingPluginDirective("Collapse", "collapse", "collapse"); - warnMissingPluginDirective("Intersect", "intersect", "intersect"); - warnMissingPluginDirective("Focus", "trap", "focus"); - warnMissingPluginDirective("Mask", "mask", "mask"); - function warnMissingPluginDirective(name, directiveName, slug) { - directive(directiveName, (el) => warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`, el)); - } - alpine_default.setEvaluator(normalEvaluator); - alpine_default.setReactivityEngine({ reactive: reactive2, effect: effect2, release: stop, raw: toRaw }); - var src_default = alpine_default; - var module_default = src_default; - - // ../../../node_modules/@alpinejs/morph/dist/module.esm.js - function morph(from, toHtml, options) { - monkeyPatchDomSetAttributeToAllowAtSymbols(); - let fromEl; - let toEl; - let key, lookahead, updating, updated, removing, removed, adding, added; - function assignOptions(options2 = {}) { - let defaultGetKey = (el) => el.getAttribute("key"); - let noop = () => { + function baseMatchesProperty(path, srcValue) { + if (isKey(path) && isStrictComparable(srcValue)) { + return matchesStrictComparable(toKey(path), srcValue); + } + return function(object) { + var objValue = get(object, path); + return objValue === void 0 && objValue === srcValue ? hasIn(object, path) : baseIsEqual(srcValue, objValue, void 0, UNORDERED_COMPARE_FLAG | PARTIAL_COMPARE_FLAG); }; - updating = options2.updating || noop; - updated = options2.updated || noop; - removing = options2.removing || noop; - removed = options2.removed || noop; - adding = options2.adding || noop; - added = options2.added || noop; - key = options2.key || defaultGetKey; - lookahead = options2.lookahead || false; } - function patch(from2, to) { - if (differentElementNamesTypesOrKeys(from2, to)) { - return swapElements(from2, to); + function basePropertyDeep(path) { + return function(object) { + return baseGet(object, path); + }; + } + function baseToString(value) { + if (typeof value == "string") { + return value; } - let updateChildrenOnly = false; - if (shouldSkip(updating, from2, to, () => updateChildrenOnly = true)) - return; - if (from2.nodeType === 1 && window.Alpine) { - window.Alpine.cloneNode(from2, to); + if (isSymbol(value)) { + return symbolToString ? symbolToString.call(value) : ""; } - if (textOrComment(to)) { - patchNodeValue(from2, to); - updated(from2, to); - return; - } - if (!updateChildrenOnly) { - patchAttributes(from2, to); - } - updated(from2, to); - patchChildren(from2, to); + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; } - function differentElementNamesTypesOrKeys(from2, to) { - return from2.nodeType != to.nodeType || from2.nodeName != to.nodeName || getKey(from2) != getKey(to); + function castPath(value) { + return isArray(value) ? value : stringToPath(value); } - function swapElements(from2, to) { - if (shouldSkip(removing, from2)) - return; - let toCloned = to.cloneNode(true); - if (shouldSkip(adding, toCloned)) - return; - from2.replaceWith(toCloned); - removed(from2); - added(toCloned); + function createAggregator(setter, initializer) { + return function(collection, iteratee) { + var func = isArray(collection) ? arrayAggregator : baseAggregator, accumulator = initializer ? initializer() : {}; + return func(collection, setter, baseIteratee(iteratee, 2), accumulator); + }; } - function patchNodeValue(from2, to) { - let value = to.nodeValue; - if (from2.nodeValue !== value) { - from2.nodeValue = value; - } + function createBaseEach(eachFunc, fromRight) { + return function(collection, iteratee) { + if (collection == null) { + return collection; + } + if (!isArrayLike(collection)) { + return eachFunc(collection, iteratee); + } + var length = collection.length, index = fromRight ? length : -1, iterable = Object(collection); + while (fromRight ? index-- : ++index < length) { + if (iteratee(iterable[index], index, iterable) === false) { + break; + } + } + return collection; + }; } - function patchAttributes(from2, to) { - if (from2._x_transitioning) - return; - if (from2._x_isShown && !to._x_isShown) { - return; - } - if (!from2._x_isShown && to._x_isShown) { - return; - } - let domAttributes = Array.from(from2.attributes); - let toAttributes = Array.from(to.attributes); - for (let i3 = domAttributes.length - 1; i3 >= 0; i3--) { - let name = domAttributes[i3].name; - if (!to.hasAttribute(name)) { - from2.removeAttribute(name); + function createBaseFor(fromRight) { + return function(object, iteratee, keysFunc) { + var index = -1, iterable = Object(object), props = keysFunc(object), length = props.length; + while (length--) { + var key = props[fromRight ? length : ++index]; + if (iteratee(iterable[key], key, iterable) === false) { + break; + } } + return object; + }; + } + function equalArrays(array, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, arrLength = array.length, othLength = other.length; + if (arrLength != othLength && !(isPartial && othLength > arrLength)) { + return false; } - for (let i3 = toAttributes.length - 1; i3 >= 0; i3--) { - let name = toAttributes[i3].name; - let value = toAttributes[i3].value; - if (from2.getAttribute(name) !== value) { - from2.setAttribute(name, value); - } + var stacked = stack.get(array); + if (stacked && stack.get(other)) { + return stacked == other; } - } - function patchChildren(from2, to) { - let fromKeys = keyToMap(from2.children); - let fromKeyHoldovers = {}; - let currentTo = getFirstNode(to); - let currentFrom = getFirstNode(from2); - while (currentTo) { - let toKey = getKey(currentTo); - let fromKey = getKey(currentFrom); - if (!currentFrom) { - if (toKey && fromKeyHoldovers[toKey]) { - let holdover = fromKeyHoldovers[toKey]; - from2.appendChild(holdover); - currentFrom = holdover; - } else { - if (!shouldSkip(adding, currentTo)) { - let clone2 = currentTo.cloneNode(true); - from2.appendChild(clone2); - added(clone2); - } - currentTo = getNextSibling(to, currentTo); + var index = -1, result = true, seen = bitmask & UNORDERED_COMPARE_FLAG ? new SetCache() : void 0; + stack.set(array, other); + stack.set(other, array); + while (++index < arrLength) { + var arrValue = array[index], othValue = other[index]; + if (customizer) { + var compared = isPartial ? customizer(othValue, arrValue, index, other, array, stack) : customizer(arrValue, othValue, index, array, other, stack); + } + if (compared !== void 0) { + if (compared) { continue; } + result = false; + break; } - let isIf = (node) => node && node.nodeType === 8 && node.textContent === "[if BLOCK]><![endif]"; - let isEnd = (node) => node && node.nodeType === 8 && node.textContent === "[if ENDBLOCK]><![endif]"; - if (isIf(currentTo) && isIf(currentFrom)) { - let nestedIfCount = 0; - let fromBlockStart = currentFrom; - while (currentFrom) { - let next = getNextSibling(from2, currentFrom); - if (isIf(next)) { - nestedIfCount++; - } else if (isEnd(next) && nestedIfCount > 0) { - nestedIfCount--; - } else if (isEnd(next) && nestedIfCount === 0) { - currentFrom = next; - break; + if (seen) { + if (!arraySome(other, function(othValue2, othIndex) { + if (!seen.has(othIndex) && (arrValue === othValue2 || equalFunc(arrValue, othValue2, customizer, bitmask, stack))) { + return seen.add(othIndex); } - currentFrom = next; + })) { + result = false; + break; } - let fromBlockEnd = currentFrom; - nestedIfCount = 0; - let toBlockStart = currentTo; - while (currentTo) { - let next = getNextSibling(to, currentTo); - if (isIf(next)) { - nestedIfCount++; - } else if (isEnd(next) && nestedIfCount > 0) { - nestedIfCount--; - } else if (isEnd(next) && nestedIfCount === 0) { - currentTo = next; - break; - } - currentTo = next; - } - let toBlockEnd = currentTo; - let fromBlock = new Block(fromBlockStart, fromBlockEnd); - let toBlock = new Block(toBlockStart, toBlockEnd); - patchChildren(fromBlock, toBlock); - continue; + } else if (!(arrValue === othValue || equalFunc(arrValue, othValue, customizer, bitmask, stack))) { + result = false; + break; } - if (currentFrom.nodeType === 1 && lookahead && !currentFrom.isEqualNode(currentTo)) { - let nextToElementSibling = getNextSibling(to, currentTo); - let found = false; - while (!found && nextToElementSibling) { - if (nextToElementSibling.nodeType === 1 && currentFrom.isEqualNode(nextToElementSibling)) { - found = true; - currentFrom = addNodeBefore(from2, currentTo, currentFrom); - fromKey = getKey(currentFrom); - } - nextToElementSibling = getNextSibling(to, nextToElementSibling); + } + stack["delete"](array); + stack["delete"](other); + return result; + } + function equalByTag(object, other, tag, equalFunc, customizer, bitmask, stack) { + switch (tag) { + case dataViewTag: + if (object.byteLength != other.byteLength || object.byteOffset != other.byteOffset) { + return false; } - } - if (toKey !== fromKey) { - if (!toKey && fromKey) { - fromKeyHoldovers[fromKey] = currentFrom; - currentFrom = addNodeBefore(from2, currentTo, currentFrom); - fromKeyHoldovers[fromKey].remove(); - currentFrom = getNextSibling(from2, currentFrom); - currentTo = getNextSibling(to, currentTo); - continue; + object = object.buffer; + other = other.buffer; + case arrayBufferTag: + if (object.byteLength != other.byteLength || !equalFunc(new Uint8Array2(object), new Uint8Array2(other))) { + return false; } - if (toKey && !fromKey) { - if (fromKeys[toKey]) { - currentFrom.replaceWith(fromKeys[toKey]); - currentFrom = fromKeys[toKey]; - } + return true; + case boolTag: + case dateTag: + case numberTag: + return eq(+object, +other); + case errorTag: + return object.name == other.name && object.message == other.message; + case regexpTag: + case stringTag: + return object == other + ""; + case mapTag: + var convert = mapToArray; + case setTag: + var isPartial = bitmask & PARTIAL_COMPARE_FLAG; + convert || (convert = setToArray); + if (object.size != other.size && !isPartial) { + return false; } - if (toKey && fromKey) { - let fromKeyNode = fromKeys[toKey]; - if (fromKeyNode) { - fromKeyHoldovers[fromKey] = currentFrom; - currentFrom.replaceWith(fromKeyNode); - currentFrom = fromKeyNode; - } else { - fromKeyHoldovers[fromKey] = currentFrom; - currentFrom = addNodeBefore(from2, currentTo, currentFrom); - fromKeyHoldovers[fromKey].remove(); - currentFrom = getNextSibling(from2, currentFrom); - currentTo = getNextSibling(to, currentTo); - continue; - } + var stacked = stack.get(object); + if (stacked) { + return stacked == other; } + bitmask |= UNORDERED_COMPARE_FLAG; + stack.set(object, other); + var result = equalArrays(convert(object), convert(other), equalFunc, customizer, bitmask, stack); + stack["delete"](object); + return result; + case symbolTag: + if (symbolValueOf) { + return symbolValueOf.call(object) == symbolValueOf.call(other); + } + } + return false; + } + function equalObjects(object, other, equalFunc, customizer, bitmask, stack) { + var isPartial = bitmask & PARTIAL_COMPARE_FLAG, objProps = keys(object), objLength = objProps.length, othProps = keys(other), othLength = othProps.length; + if (objLength != othLength && !isPartial) { + return false; + } + var index = objLength; + while (index--) { + var key = objProps[index]; + if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) { + return false; } - let currentFromNext = currentFrom && getNextSibling(from2, currentFrom); - patch(currentFrom, currentTo); - currentTo = currentTo && getNextSibling(to, currentTo); - currentFrom = currentFromNext; } - let removals = []; - while (currentFrom) { - if (!shouldSkip(removing, currentFrom)) - removals.push(currentFrom); - currentFrom = getNextSibling(from2, currentFrom); + var stacked = stack.get(object); + if (stacked && stack.get(other)) { + return stacked == other; } - while (removals.length) { - let domForRemoval = removals.shift(); - domForRemoval.remove(); - removed(domForRemoval); + var result = true; + stack.set(object, other); + stack.set(other, object); + var skipCtor = isPartial; + while (++index < objLength) { + key = objProps[index]; + var objValue = object[key], othValue = other[key]; + if (customizer) { + var compared = isPartial ? customizer(othValue, objValue, key, other, object, stack) : customizer(objValue, othValue, key, object, other, stack); + } + if (!(compared === void 0 ? objValue === othValue || equalFunc(objValue, othValue, customizer, bitmask, stack) : compared)) { + result = false; + break; + } + skipCtor || (skipCtor = key == "constructor"); } - } - function getKey(el) { - return el && el.nodeType === 1 && key(el); - } - function keyToMap(els) { - let map = {}; - for (let el of els) { - let theKey = getKey(el); - if (theKey) { - map[theKey] = el; + if (result && !skipCtor) { + var objCtor = object.constructor, othCtor = other.constructor; + if (objCtor != othCtor && ("constructor" in object && "constructor" in other) && !(typeof objCtor == "function" && objCtor instanceof objCtor && typeof othCtor == "function" && othCtor instanceof othCtor)) { + result = false; } } - return map; + stack["delete"](object); + stack["delete"](other); + return result; } - function addNodeBefore(parent, node, beforeMe) { - if (!shouldSkip(adding, node)) { - let clone2 = node.cloneNode(true); - parent.insertBefore(clone2, beforeMe); - added(clone2); - return clone2; + function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) ? data[typeof key == "string" ? "string" : "hash"] : data.map; + } + function getMatchData(object) { + var result = keys(object), length = result.length; + while (length--) { + var key = result[length], value = object[key]; + result[length] = [key, value, isStrictComparable(value)]; } - return node; + return result; } - assignOptions(options); - fromEl = from; - toEl = typeof toHtml === "string" ? createElement(toHtml) : toHtml; - if (window.Alpine && window.Alpine.closestDataStack && !from._x_dataStack) { - toEl._x_dataStack = window.Alpine.closestDataStack(from); - toEl._x_dataStack && window.Alpine.cloneNode(from, toEl); + function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : void 0; } - patch(from, toEl); - fromEl = void 0; - toEl = void 0; - return from; - } - morph.step = () => { - }; - morph.log = () => { - }; - function shouldSkip(hook, ...args) { - let skip = false; - hook(...args, () => skip = true); - return skip; - } - var patched = false; - function createElement(html) { - const template = document.createElement("template"); - template.innerHTML = html; - return template.content.firstElementChild; - } - function textOrComment(el) { - return el.nodeType === 3 || el.nodeType === 8; - } - var Block = class { - constructor(start3, end2) { - this.startComment = start3; - this.endComment = end2; + var getTag = baseGetTag; + if (DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag || Map2 && getTag(new Map2()) != mapTag || Promise2 && getTag(Promise2.resolve()) != promiseTag || Set2 && getTag(new Set2()) != setTag || WeakMap2 && getTag(new WeakMap2()) != weakMapTag) { + getTag = function(value) { + var result = objectToString.call(value), Ctor = result == objectTag ? value.constructor : void 0, ctorString = Ctor ? toSource(Ctor) : void 0; + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: + return dataViewTag; + case mapCtorString: + return mapTag; + case promiseCtorString: + return promiseTag; + case setCtorString: + return setTag; + case weakMapCtorString: + return weakMapTag; + } + } + return result; + }; } - get children() { - let children = []; - let currentNode = this.startComment.nextSibling; - while (currentNode && currentNode !== this.endComment) { - children.push(currentNode); - currentNode = currentNode.nextSibling; + function hasPath(object, path, hasFunc) { + path = isKey(path, object) ? [path] : castPath(path); + var result, index = -1, length = path.length; + while (++index < length) { + var key = toKey(path[index]); + if (!(result = object != null && hasFunc(object, key))) { + break; + } + object = object[key]; } - return children; + if (result) { + return result; + } + var length = object ? object.length : 0; + return !!length && isLength(length) && isIndex(key, length) && (isArray(object) || isArguments(object)); } - appendChild(child) { - this.endComment.before(child); + function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && (typeof value == "number" || reIsUint.test(value)) && (value > -1 && value % 1 == 0 && value < length); } - get firstChild() { - let first = this.startComment.nextSibling; - if (first === this.endComment) - return; - return first; + function isKey(value, object) { + if (isArray(value)) { + return false; + } + var type = typeof value; + if (type == "number" || type == "symbol" || type == "boolean" || value == null || isSymbol(value)) { + return true; + } + return reIsPlainProp.test(value) || !reIsDeepProp.test(value) || object != null && value in Object(object); } - nextNode(reference2) { - let next = reference2.nextSibling; - if (next === this.endComment) - return; - return next; + function isKeyable(value) { + var type = typeof value; + return type == "string" || type == "number" || type == "symbol" || type == "boolean" ? value !== "__proto__" : value === null; } - insertBefore(newNode, reference2) { - reference2.before(newNode); - return newNode; + function isMasked(func) { + return !!maskSrcKey && maskSrcKey in func; } - }; - function getFirstNode(parent) { - return parent.firstChild; - } - function getNextSibling(parent, reference2) { - if (reference2._x_teleport) { - return reference2._x_teleport; + function isPrototype(value) { + var Ctor = value && value.constructor, proto = typeof Ctor == "function" && Ctor.prototype || objectProto; + return value === proto; } - let next; - if (parent instanceof Block) { - next = parent.nextNode(reference2); - } else { - next = reference2.nextSibling; + function isStrictComparable(value) { + return value === value && !isObject2(value); } - return next; - } - function monkeyPatchDomSetAttributeToAllowAtSymbols() { - if (patched) - return; - patched = true; - let original = Element.prototype.setAttribute; - let hostDiv = document.createElement("div"); - Element.prototype.setAttribute = function newSetAttribute(name, value) { - if (!name.includes("@")) { - return original.call(this, name, value); - } - hostDiv.innerHTML = `<span ${name}="${value}"></span>`; - let attr = hostDiv.firstElementChild.getAttributeNode(name); - hostDiv.firstElementChild.removeAttributeNode(attr); - this.setAttributeNode(attr); - }; - } - function src_default2(Alpine3) { - Alpine3.morph = morph; - } - var module_default2 = src_default2; - - // ../../../node_modules/@alpinejs/collapse/dist/module.esm.js - function src_default3(Alpine3) { - Alpine3.directive("collapse", collapse); - collapse.inline = (el, { modifiers }) => { - if (!modifiers.includes("min")) - return; - el._x_doShow = () => { - }; - el._x_doHide = () => { - }; - }; - function collapse(el, { modifiers }) { - let duration = modifierValue2(modifiers, "duration", 250) / 1e3; - let floor2 = modifierValue2(modifiers, "min", 0); - let fullyHide = !modifiers.includes("min"); - if (!el._x_isShown) - el.style.height = `${floor2}px`; - if (!el._x_isShown && fullyHide) - el.hidden = true; - if (!el._x_isShown) - el.style.overflow = "hidden"; - let setFunction = (el2, styles) => { - let revertFunction = Alpine3.setStyles(el2, styles); - return styles.height ? () => { - } : revertFunction; - }; - let transitionStyles = { - transitionProperty: "height", - transitionDuration: `${duration}s`, - transitionTimingFunction: "cubic-bezier(0.4, 0.0, 0.2, 1)" - }; - el._x_transition = { - in(before = () => { - }, after = () => { - }) { - if (fullyHide) - el.hidden = false; - if (fullyHide) - el.style.display = null; - let current = el.getBoundingClientRect().height; - el.style.height = "auto"; - let full = el.getBoundingClientRect().height; - if (current === full) { - current = floor2; - } - Alpine3.transition(el, Alpine3.setStyles, { - during: transitionStyles, - start: { height: current + "px" }, - end: { height: full + "px" } - }, () => el._x_isShown = true, () => { - if (el.getBoundingClientRect().height == full) { - el.style.overflow = null; - } - }); - }, - out(before = () => { - }, after = () => { - }) { - let full = el.getBoundingClientRect().height; - Alpine3.transition(el, setFunction, { - during: transitionStyles, - start: { height: full + "px" }, - end: { height: floor2 + "px" } - }, () => el.style.overflow = "hidden", () => { - el._x_isShown = false; - if (el.style.height == `${floor2}px` && fullyHide) { - el.style.display = "none"; - el.hidden = true; - } - }); + function matchesStrictComparable(key, srcValue) { + return function(object) { + if (object == null) { + return false; } + return object[key] === srcValue && (srcValue !== void 0 || key in Object(object)); }; } - } - function modifierValue2(modifiers, key, fallback) { - if (modifiers.indexOf(key) === -1) - return fallback; - const rawValue = modifiers[modifiers.indexOf(key) + 1]; - if (!rawValue) - return fallback; - if (key === "duration") { - let match = rawValue.match(/([0-9]+)ms/); - if (match) - return match[1]; - } - if (key === "min") { - let match = rawValue.match(/([0-9]+)px/); - if (match) - return match[1]; - } - return rawValue; - } - var module_default3 = src_default3; - - // ../../../node_modules/@alpinejs/intersect/dist/module.esm.js - function src_default4(Alpine3) { - Alpine3.directive("intersect", (el, { value, expression, modifiers }, { evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { - let evaluate2 = evaluateLater2(expression); - let options = { - rootMargin: getRootMargin(modifiers), - threshold: getThreshold(modifiers) - }; - let observer2 = new IntersectionObserver((entries) => { - entries.forEach((entry) => { - if (entry.isIntersecting === (value === "leave")) - return; - evaluate2(); - modifiers.includes("once") && observer2.disconnect(); - }); - }, options); - observer2.observe(el); - cleanup2(() => { - observer2.disconnect(); + var stringToPath = memoize(function(string) { + string = toString(string); + var result = []; + if (reLeadingDot.test(string)) { + result.push(""); + } + string.replace(rePropName, function(match, number, quote, string2) { + result.push(quote ? string2.replace(reEscapeChar, "$1") : number || match); }); + return result; }); - } - function getThreshold(modifiers) { - if (modifiers.includes("full")) - return 0.99; - if (modifiers.includes("half")) - return 0.5; - if (!modifiers.includes("threshold")) - return 0; - let threshold = modifiers[modifiers.indexOf("threshold") + 1]; - if (threshold === "100") - return 1; - if (threshold === "0") - return 0; - return Number(`.${threshold}`); - } - function getLengthValue(rawValue) { - let match = rawValue.match(/^(-?[0-9]+)(px|%)?$/); - return match ? match[1] + (match[2] || "px") : void 0; - } - function getRootMargin(modifiers) { - const key = "margin"; - const fallback = "0px 0px 0px 0px"; - const index = modifiers.indexOf(key); - if (index === -1) - return fallback; - let values = []; - for (let i3 = 1; i3 < 5; i3++) { - values.push(getLengthValue(modifiers[index + i3] || "")); + function toKey(value) { + if (typeof value == "string" || isSymbol(value)) { + return value; + } + var result = value + ""; + return result == "0" && 1 / value == -INFINITY ? "-0" : result; } - values = values.filter((v3) => v3 !== void 0); - return values.length ? values.join(" ").trim() : fallback; - } - var module_default4 = src_default4; - - // ../../../node_modules/@alpinejs/mask/dist/module.esm.js - function src_default5(Alpine3) { - Alpine3.directive("mask", (el, { value, expression }, { effect: effect7, evaluateLater: evaluateLater2 }) => { - let templateFn = () => expression; - let lastInputValue = ""; - queueMicrotask(() => { - if (["function", "dynamic"].includes(value)) { - let evaluator = evaluateLater2(expression); - effect7(() => { - templateFn = (input) => { - let result; - Alpine3.dontAutoEvaluateFunctions(() => { - evaluator((value2) => { - result = typeof value2 === "function" ? value2(input) : value2; - }, { scope: { - // These are "magics" we'll make available to the x-mask:function: - "$input": input, - "$money": formatMoney.bind({ el }) - } }); - }); - return result; - }; - processInputValue(el, false); - }); - } else { - processInputValue(el, false); + function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e2) { } - if (el._x_model) - el._x_model.set(el.value); - }); - el.addEventListener("input", () => processInputValue(el)); - el.addEventListener("blur", () => processInputValue(el, false)); - function processInputValue(el2, shouldRestoreCursor = true) { - let input = el2.value; - let template = templateFn(input); - if (!template || template === "false") - return false; - if (lastInputValue.length - el2.value.length === 1) { - return lastInputValue = el2.value; + try { + return func + ""; + } catch (e2) { } - let setInput = () => { - lastInputValue = el2.value = formatInput(input, template); - }; - if (shouldRestoreCursor) { - restoreCursorPosition(el2, template, () => { - setInput(); - }); - } else { - setInput(); - } } - function formatInput(input, template) { - if (input === "") - return ""; - let strippedDownInput = stripDown(template, input); - let rebuiltInput = buildUp(template, strippedDownInput); - return rebuiltInput; + return ""; + } + var keyBy2 = createAggregator(function(result, value, key) { + result[key] = value; + }); + function memoize(func, resolver) { + if (typeof func != "function" || resolver && typeof resolver != "function") { + throw new TypeError(FUNC_ERROR_TEXT); } - }).before("model"); - } - function restoreCursorPosition(el, template, callback) { - let cursorPosition = el.selectionStart; - let unformattedValue = el.value; - callback(); - let beforeLeftOfCursorBeforeFormatting = unformattedValue.slice(0, cursorPosition); - let newPosition = buildUp( - template, - stripDown( - template, - beforeLeftOfCursorBeforeFormatting - ) - ).length; - el.setSelectionRange(newPosition, newPosition); - } - function stripDown(template, input) { - let inputToBeStripped = input; - let output = ""; - let regexes = { - "9": /[0-9]/, - "a": /[a-zA-Z]/, - "*": /[a-zA-Z0-9]/ - }; - let wildcardTemplate = ""; - for (let i3 = 0; i3 < template.length; i3++) { - if (["9", "a", "*"].includes(template[i3])) { - wildcardTemplate += template[i3]; - continue; - } - for (let j3 = 0; j3 < inputToBeStripped.length; j3++) { - if (inputToBeStripped[j3] === template[i3]) { - inputToBeStripped = inputToBeStripped.slice(0, j3) + inputToBeStripped.slice(j3 + 1); - break; + var memoized = function() { + var args = arguments, key = resolver ? resolver.apply(this, args) : args[0], cache = memoized.cache; + if (cache.has(key)) { + return cache.get(key); } - } + var result = func.apply(this, args); + memoized.cache = cache.set(key, result); + return result; + }; + memoized.cache = new (memoize.Cache || MapCache)(); + return memoized; } - for (let i3 = 0; i3 < wildcardTemplate.length; i3++) { - let found = false; - for (let j3 = 0; j3 < inputToBeStripped.length; j3++) { - if (regexes[wildcardTemplate[i3]].test(inputToBeStripped[j3])) { - output += inputToBeStripped[j3]; - inputToBeStripped = inputToBeStripped.slice(0, j3) + inputToBeStripped.slice(j3 + 1); - found = true; - break; - } - } - if (!found) - break; + memoize.Cache = MapCache; + function eq(value, other) { + return value === other || value !== value && other !== other; } - return output; - } - function buildUp(template, input) { - let clean2 = Array.from(input); - let output = ""; - for (let i3 = 0; i3 < template.length; i3++) { - if (!["9", "a", "*"].includes(template[i3])) { - output += template[i3]; - continue; - } - if (clean2.length === 0) - break; - output += clean2.shift(); + function isArguments(value) { + return isArrayLikeObject(value) && hasOwnProperty.call(value, "callee") && (!propertyIsEnumerable.call(value, "callee") || objectToString.call(value) == argsTag); } - return output; - } - function formatMoney(input, delimiter = ".", thousands, precision = 2) { - if (input === "-") - return "-"; - if (/^\D+$/.test(input)) - return "9"; - if (thousands === null || thousands === void 0) { - thousands = delimiter === "," ? "." : ","; + var isArray = Array.isArray; + function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); } - let addThousands = (input2, thousands2) => { - let output = ""; - let counter = 0; - for (let i3 = input2.length - 1; i3 >= 0; i3--) { - if (input2[i3] === thousands2) - continue; - if (counter === 3) { - output = input2[i3] + thousands2 + output; - counter = 0; - } else { - output = input2[i3] + output; - } - counter++; - } - return output; - }; - let minus = input.startsWith("-") ? "-" : ""; - let strippedInput = input.replaceAll(new RegExp(`[^0-9\\${delimiter}]`, "g"), ""); - let template = Array.from({ length: strippedInput.split(delimiter)[0].length }).fill("9").join(""); - template = `${minus}${addThousands(template, thousands)}`; - if (precision > 0 && input.includes(delimiter)) - template += `${delimiter}` + "9".repeat(precision); - queueMicrotask(() => { - if (this.el.value.endsWith(delimiter)) - return; - if (this.el.value[this.el.selectionStart - 1] === delimiter) { - this.el.setSelectionRange(this.el.selectionStart - 1, this.el.selectionStart - 1); - } - }); - return template; + function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); + } + function isFunction(value) { + var tag = isObject2(value) ? objectToString.call(value) : ""; + return tag == funcTag || tag == genTag; + } + function isLength(value) { + return typeof value == "number" && value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; + } + function isObject2(value) { + var type = typeof value; + return !!value && (type == "object" || type == "function"); + } + function isObjectLike(value) { + return !!value && typeof value == "object"; + } + function isSymbol(value) { + return typeof value == "symbol" || isObjectLike(value) && objectToString.call(value) == symbolTag; + } + var isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray; + function toString(value) { + return value == null ? "" : baseToString(value); + } + function get(object, path, defaultValue) { + var result = object == null ? void 0 : baseGet(object, path); + return result === void 0 ? defaultValue : result; + } + function hasIn(object, path) { + return object != null && hasPath(object, path, baseHasIn); + } + function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); + } + function identity(value) { + return value; + } + function property(path) { + return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path); + } + module.exports = keyBy2; } - var module_default5 = src_default5; +}); - // ../../../node_modules/@alpinejs/focus/dist/module.esm.js - var candidateSelectors = ["input", "select", "textarea", "a[href]", "button", "[tabindex]:not(slot)", "audio[controls]", "video[controls]", '[contenteditable]:not([contenteditable="false"])', "details>summary:first-of-type", "details"]; - var candidateSelector = /* @__PURE__ */ candidateSelectors.join(","); - var NoElement = typeof Element === "undefined"; - var matches = NoElement ? function() { - } : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector; - var getRootNode = !NoElement && Element.prototype.getRootNode ? function(element) { - return element.getRootNode(); - } : function(element) { - return element.ownerDocument; - }; - var getCandidates = function getCandidates2(el, includeContainer, filter) { - var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector)); - if (includeContainer && matches.call(el, candidateSelector)) { - candidates.unshift(el); - } - candidates = candidates.filter(filter); - return candidates; - }; - var getCandidatesIteratively = function getCandidatesIteratively2(elements, includeContainer, options) { - var candidates = []; - var elementsToCheck = Array.from(elements); - while (elementsToCheck.length) { - var element = elementsToCheck.shift(); - if (element.tagName === "SLOT") { - var assigned = element.assignedElements(); - var content2 = assigned.length ? assigned : element.children; - var nestedCandidates = getCandidatesIteratively2(content2, true, options); - if (options.flatten) { - candidates.push.apply(candidates, nestedCandidates); - } else { - candidates.push({ - scope: element, - candidates: nestedCandidates - }); - } - } else { - var validCandidate = matches.call(element, candidateSelector); - if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) { - candidates.push(element); - } - var shadowRoot = element.shadowRoot || // check for an undisclosed shadow - typeof options.getShadowRoot === "function" && options.getShadowRoot(element); - var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element); - if (shadowRoot && validShadowRoot) { - var _nestedCandidates = getCandidatesIteratively2(shadowRoot === true ? element.children : shadowRoot.children, true, options); - if (options.flatten) { - candidates.push.apply(candidates, _nestedCandidates); - } else { - candidates.push({ - scope: element, - candidates: _nestedCandidates - }); - } - } else { - elementsToCheck.unshift.apply(elementsToCheck, element.children); - } +// ../../../node_modules/@popperjs/core/dist/cjs/popper.js +var require_popper = __commonJS({ + "../../../node_modules/@popperjs/core/dist/cjs/popper.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + function getWindow(node) { + if (node == null) { + return window; } - } - return candidates; - }; - var getTabindex = function getTabindex2(node, isScope) { - if (node.tabIndex < 0) { - if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute("tabindex"), 10))) { - return 0; + if (node.toString() !== "[object Window]") { + var ownerDocument = node.ownerDocument; + return ownerDocument ? ownerDocument.defaultView || window : window; } + return node; } - return node.tabIndex; - }; - var sortOrderedTabbables = function sortOrderedTabbables2(a3, b3) { - return a3.tabIndex === b3.tabIndex ? a3.documentOrder - b3.documentOrder : a3.tabIndex - b3.tabIndex; - }; - var isInput = function isInput2(node) { - return node.tagName === "INPUT"; - }; - var isHiddenInput = function isHiddenInput2(node) { - return isInput(node) && node.type === "hidden"; - }; - var isDetailsWithSummary = function isDetailsWithSummary2(node) { - var r3 = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { - return child.tagName === "SUMMARY"; - }); - return r3; - }; - var getCheckedRadio = function getCheckedRadio2(nodes, form) { - for (var i3 = 0; i3 < nodes.length; i3++) { - if (nodes[i3].checked && nodes[i3].form === form) { - return nodes[i3]; - } + function isElement(node) { + var OwnElement = getWindow(node).Element; + return node instanceof OwnElement || node instanceof Element; } - }; - var isTabbableRadio = function isTabbableRadio2(node) { - if (!node.name) { - return true; + function isHTMLElement(node) { + var OwnElement = getWindow(node).HTMLElement; + return node instanceof OwnElement || node instanceof HTMLElement; } - var radioScope = node.form || getRootNode(node); - var queryRadios = function queryRadios2(name) { - return radioScope.querySelectorAll('input[type="radio"][name="' + name + '"]'); - }; - var radioSet; - if (typeof window !== "undefined" && typeof window.CSS !== "undefined" && typeof window.CSS.escape === "function") { - radioSet = queryRadios(window.CSS.escape(node.name)); - } else { - try { - radioSet = queryRadios(node.name); - } catch (err) { - console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s", err.message); + function isShadowRoot(node) { + if (typeof ShadowRoot === "undefined") { return false; } + var OwnElement = getWindow(node).ShadowRoot; + return node instanceof OwnElement || node instanceof ShadowRoot; } - var checked = getCheckedRadio(radioSet, node.form); - return !checked || checked === node; - }; - var isRadio = function isRadio2(node) { - return isInput(node) && node.type === "radio"; - }; - var isNonTabbableRadio = function isNonTabbableRadio2(node) { - return isRadio(node) && !isTabbableRadio(node); - }; - var isZeroArea = function isZeroArea2(node) { - var _node$getBoundingClie = node.getBoundingClientRect(), width = _node$getBoundingClie.width, height = _node$getBoundingClie.height; - return width === 0 && height === 0; - }; - var isHidden = function isHidden2(node, _ref) { - var displayCheck = _ref.displayCheck, getShadowRoot = _ref.getShadowRoot; - if (getComputedStyle(node).visibility === "hidden") { - return true; + var max = Math.max; + var min = Math.min; + var round = Math.round; + function getUAString() { + var uaData = navigator.userAgentData; + if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { + return uaData.brands.map(function(item) { + return item.brand + "/" + item.version; + }).join(" "); + } + return navigator.userAgent; } - var isDirectSummary = matches.call(node, "details>summary:first-of-type"); - var nodeUnderDetails = isDirectSummary ? node.parentElement : node; - if (matches.call(nodeUnderDetails, "details:not([open]) *")) { - return true; + function isLayoutViewport() { + return !/^((?!chrome|android).)*safari/i.test(getUAString()); } - var nodeRootHost = getRootNode(node).host; - var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node); - if (!displayCheck || displayCheck === "full") { - if (typeof getShadowRoot === "function") { - var originalNode = node; - while (node) { - var parentElement = node.parentElement; - var rootNode = getRootNode(node); - if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true) { - return isZeroArea(node); - } else if (node.assignedSlot) { - node = node.assignedSlot; - } else if (!parentElement && rootNode !== node.ownerDocument) { - node = rootNode.host; - } else { - node = parentElement; - } - } - node = originalNode; + function getBoundingClientRect(element, includeScale, isFixedStrategy) { + if (includeScale === void 0) { + includeScale = false; } - if (nodeIsAttached) { - return !node.getClientRects().length; + if (isFixedStrategy === void 0) { + isFixedStrategy = false; } - } else if (displayCheck === "non-zero-area") { - return isZeroArea(node); - } - return false; - }; - var isDisabledFromFieldset = function isDisabledFromFieldset2(node) { - if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) { - var parentNode = node.parentElement; - while (parentNode) { - if (parentNode.tagName === "FIELDSET" && parentNode.disabled) { - for (var i3 = 0; i3 < parentNode.children.length; i3++) { - var child = parentNode.children.item(i3); - if (child.tagName === "LEGEND") { - return matches.call(parentNode, "fieldset[disabled] *") ? true : !child.contains(node); - } - } - return true; - } - parentNode = parentNode.parentElement; + var clientRect = element.getBoundingClientRect(); + var scaleX = 1; + var scaleY = 1; + if (includeScale && isHTMLElement(element)) { + scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; + scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; } + var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport; + var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; + var x2 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; + var y2 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; + var width = clientRect.width / scaleX; + var height = clientRect.height / scaleY; + return { + width, + height, + top: y2, + right: x2 + width, + bottom: y2 + height, + left: x2, + x: x2, + y: y2 + }; } - return false; - }; - var isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable2(options, node) { - if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus - isDetailsWithSummary(node) || isDisabledFromFieldset(node)) { - return false; + function getWindowScroll(node) { + var win = getWindow(node); + var scrollLeft = win.pageXOffset; + var scrollTop = win.pageYOffset; + return { + scrollLeft, + scrollTop + }; } - return true; - }; - var isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable2(options, node) { - if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) { - return false; + function getHTMLElementScroll(element) { + return { + scrollLeft: element.scrollLeft, + scrollTop: element.scrollTop + }; } - return true; - }; - var isValidShadowRootTabbable = function isValidShadowRootTabbable2(shadowHostNode) { - var tabIndex = parseInt(shadowHostNode.getAttribute("tabindex"), 10); - if (isNaN(tabIndex) || tabIndex >= 0) { - return true; - } - return false; - }; - var sortByOrder = function sortByOrder2(candidates) { - var regularTabbables = []; - var orderedTabbables = []; - candidates.forEach(function(item, i3) { - var isScope = !!item.scope; - var element = isScope ? item.scope : item; - var candidateTabindex = getTabindex(element, isScope); - var elements = isScope ? sortByOrder2(item.candidates) : element; - if (candidateTabindex === 0) { - isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element); + function getNodeScroll(node) { + if (node === getWindow(node) || !isHTMLElement(node)) { + return getWindowScroll(node); } else { - orderedTabbables.push({ - documentOrder: i3, - tabIndex: candidateTabindex, - item, - isScope, - content: elements - }); + return getHTMLElementScroll(node); } - }); - return orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc, sortable) { - sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content); - return acc; - }, []).concat(regularTabbables); - }; - var tabbable = function tabbable2(el, options) { - options = options || {}; - var candidates; - if (options.getShadowRoot) { - candidates = getCandidatesIteratively([el], options.includeContainer, { - filter: isNodeMatchingSelectorTabbable.bind(null, options), - flatten: false, - getShadowRoot: options.getShadowRoot, - shadowRootFilter: isValidShadowRootTabbable - }); - } else { - candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options)); } - return sortByOrder(candidates); - }; - var focusable = function focusable2(el, options) { - options = options || {}; - var candidates; - if (options.getShadowRoot) { - candidates = getCandidatesIteratively([el], options.includeContainer, { - filter: isNodeMatchingSelectorFocusable.bind(null, options), - flatten: true, - getShadowRoot: options.getShadowRoot - }); - } else { - candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options)); + function getNodeName(element) { + return element ? (element.nodeName || "").toLowerCase() : null; } - return candidates; - }; - var isTabbable = function isTabbable2(node, options) { - options = options || {}; - if (!node) { - throw new Error("No node provided"); + function getDocumentElement(element) { + return ((isElement(element) ? element.ownerDocument : ( + // $FlowFixMe[prop-missing] + element.document + )) || window.document).documentElement; } - if (matches.call(node, candidateSelector) === false) { - return false; + function getWindowScrollBarX(element) { + return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; } - return isNodeMatchingSelectorTabbable(options, node); - }; - var focusableCandidateSelector = /* @__PURE__ */ candidateSelectors.concat("iframe").join(","); - var isFocusable = function isFocusable2(node, options) { - options = options || {}; - if (!node) { - throw new Error("No node provided"); + function getComputedStyle2(element) { + return getWindow(element).getComputedStyle(element); } - if (matches.call(node, focusableCandidateSelector) === false) { - return false; + function isScrollParent(element) { + var _getComputedStyle = getComputedStyle2(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; + return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); } - return isNodeMatchingSelectorFocusable(options, node); - }; - function ownKeys2(object, enumerableOnly) { - var keys = Object.keys(object); - if (Object.getOwnPropertySymbols) { - var symbols = Object.getOwnPropertySymbols(object); - enumerableOnly && (symbols = symbols.filter(function(sym) { - return Object.getOwnPropertyDescriptor(object, sym).enumerable; - })), keys.push.apply(keys, symbols); + function isElementScaled(element) { + var rect = element.getBoundingClientRect(); + var scaleX = round(rect.width) / element.offsetWidth || 1; + var scaleY = round(rect.height) / element.offsetHeight || 1; + return scaleX !== 1 || scaleY !== 1; } - return keys; - } - function _objectSpread2(target) { - for (var i3 = 1; i3 < arguments.length; i3++) { - var source = null != arguments[i3] ? arguments[i3] : {}; - i3 % 2 ? ownKeys2(Object(source), true).forEach(function(key) { - _defineProperty(target, key, source[key]); - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys2(Object(source)).forEach(function(key) { - Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); - }); - } - return target; - } - function _defineProperty(obj, key, value) { - if (key in obj) { - Object.defineProperty(obj, key, { - value, - enumerable: true, - configurable: true, - writable: true - }); - } else { - obj[key] = value; - } - return obj; - } - var activeFocusTraps = /* @__PURE__ */ function() { - var trapQueue = []; - return { - activateTrap: function activateTrap(trap) { - if (trapQueue.length > 0) { - var activeTrap = trapQueue[trapQueue.length - 1]; - if (activeTrap !== trap) { - activeTrap.pause(); - } + function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { + if (isFixed === void 0) { + isFixed = false; + } + var isOffsetParentAnElement = isHTMLElement(offsetParent); + var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); + var documentElement = getDocumentElement(offsetParent); + var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); + var scroll = { + scrollLeft: 0, + scrollTop: 0 + }; + var offsets = { + x: 0, + y: 0 + }; + if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { + if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078 + isScrollParent(documentElement)) { + scroll = getNodeScroll(offsetParent); } - var trapIndex = trapQueue.indexOf(trap); - if (trapIndex === -1) { - trapQueue.push(trap); - } else { - trapQueue.splice(trapIndex, 1); - trapQueue.push(trap); + if (isHTMLElement(offsetParent)) { + offsets = getBoundingClientRect(offsetParent, true); + offsets.x += offsetParent.clientLeft; + offsets.y += offsetParent.clientTop; + } else if (documentElement) { + offsets.x = getWindowScrollBarX(documentElement); } - }, - deactivateTrap: function deactivateTrap(trap) { - var trapIndex = trapQueue.indexOf(trap); - if (trapIndex !== -1) { - trapQueue.splice(trapIndex, 1); - } - if (trapQueue.length > 0) { - trapQueue[trapQueue.length - 1].unpause(); - } } - }; - }(); - var isSelectableInput = function isSelectableInput2(node) { - return node.tagName && node.tagName.toLowerCase() === "input" && typeof node.select === "function"; - }; - var isEscapeEvent = function isEscapeEvent2(e3) { - return e3.key === "Escape" || e3.key === "Esc" || e3.keyCode === 27; - }; - var isTabEvent = function isTabEvent2(e3) { - return e3.key === "Tab" || e3.keyCode === 9; - }; - var delay = function delay2(fn3) { - return setTimeout(fn3, 0); - }; - var findIndex = function findIndex2(arr, fn3) { - var idx = -1; - arr.every(function(value, i3) { - if (fn3(value)) { - idx = i3; - return false; + return { + x: rect.left + scroll.scrollLeft - offsets.x, + y: rect.top + scroll.scrollTop - offsets.y, + width: rect.width, + height: rect.height + }; + } + function getLayoutRect(element) { + var clientRect = getBoundingClientRect(element); + var width = element.offsetWidth; + var height = element.offsetHeight; + if (Math.abs(clientRect.width - width) <= 1) { + width = clientRect.width; } - return true; - }); - return idx; - }; - var valueOrHandler = function valueOrHandler2(value) { - for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { - params[_key - 1] = arguments[_key]; + if (Math.abs(clientRect.height - height) <= 1) { + height = clientRect.height; + } + return { + x: element.offsetLeft, + y: element.offsetTop, + width, + height + }; } - return typeof value === "function" ? value.apply(void 0, params) : value; - }; - var getActualTarget = function getActualTarget2(event) { - return event.target.shadowRoot && typeof event.composedPath === "function" ? event.composedPath()[0] : event.target; - }; - var createFocusTrap = function createFocusTrap2(elements, userOptions) { - var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document; - var config = _objectSpread2({ - returnFocusOnDeactivate: true, - escapeDeactivates: true, - delayInitialFocus: true - }, userOptions); - var state = { - // containers given to createFocusTrap() - // @type {Array<HTMLElement>} - containers: [], - // list of objects identifying tabbable nodes in `containers` in the trap - // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap - // is active, but the trap should never get to a state where there isn't at least one group - // with at least one tabbable node in it (that would lead to an error condition that would - // result in an error being thrown) - // @type {Array<{ - // container: HTMLElement, - // tabbableNodes: Array<HTMLElement>, // empty if none - // focusableNodes: Array<HTMLElement>, // empty if none - // firstTabbableNode: HTMLElement|null, - // lastTabbableNode: HTMLElement|null, - // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined - // }>} - containerGroups: [], - // same order/length as `containers` list - // references to objects in `containerGroups`, but only those that actually have - // tabbable nodes in them - // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__ - // the same length - tabbableGroups: [], - nodeFocusedBeforeActivation: null, - mostRecentlyFocusedNode: null, - active: false, - paused: false, - // timer ID for when delayInitialFocus is true and initial focus in this trap - // has been delayed during activation - delayInitialFocusTimer: void 0 - }; - var trap; - var getOption = function getOption2(configOverrideOptions, optionName, configOptionName) { - return configOverrideOptions && configOverrideOptions[optionName] !== void 0 ? configOverrideOptions[optionName] : config[configOptionName || optionName]; - }; - var findContainerIndex = function findContainerIndex2(element) { - return state.containerGroups.findIndex(function(_ref) { - var container = _ref.container, tabbableNodes = _ref.tabbableNodes; - return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any - // web components if the `tabbableOptions.getShadowRoot` option was used for - // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't - // look inside web components even if open) - tabbableNodes.find(function(node) { - return node === element; - }); - }); - }; - var getNodeForOption = function getNodeForOption2(optionName) { - var optionValue = config[optionName]; - if (typeof optionValue === "function") { - for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) { - params[_key2 - 1] = arguments[_key2]; - } - optionValue = optionValue.apply(void 0, params); + function getParentNode(element) { + if (getNodeName(element) === "html") { + return element; } - if (optionValue === true) { - optionValue = void 0; + return ( + // this is a quicker (but less type safe) way to save quite some bytes from the bundle + // $FlowFixMe[incompatible-return] + // $FlowFixMe[prop-missing] + element.assignedSlot || // step into the shadow DOM of the parent of a slotted node + element.parentNode || // DOM Element detected + (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected + // $FlowFixMe[incompatible-call]: HTMLElement is a Node + getDocumentElement(element) + ); + } + function getScrollParent(node) { + if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { + return node.ownerDocument.body; } - if (!optionValue) { - if (optionValue === void 0 || optionValue === false) { - return optionValue; - } - throw new Error("`".concat(optionName, "` was specified but was not a node, or did not return a node")); + if (isHTMLElement(node) && isScrollParent(node)) { + return node; } - var node = optionValue; - if (typeof optionValue === "string") { - node = doc.querySelector(optionValue); - if (!node) { - throw new Error("`".concat(optionName, "` as selector refers to no known node")); + return getScrollParent(getParentNode(node)); + } + function listScrollParents(element, list) { + var _element$ownerDocumen; + if (list === void 0) { + list = []; + } + var scrollParent = getScrollParent(element); + var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); + var win = getWindow(scrollParent); + var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; + var updatedList = list.concat(target); + return isBody ? updatedList : ( + // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here + updatedList.concat(listScrollParents(getParentNode(target))) + ); + } + function isTableElement(element) { + return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; + } + function getTrueOffsetParent(element) { + if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 + getComputedStyle2(element).position === "fixed") { + return null; + } + return element.offsetParent; + } + function getContainingBlock(element) { + var isFirefox = /firefox/i.test(getUAString()); + var isIE = /Trident/i.test(getUAString()); + if (isIE && isHTMLElement(element)) { + var elementCss = getComputedStyle2(element); + if (elementCss.position === "fixed") { + return null; } } - return node; - }; - var getInitialFocusNode = function getInitialFocusNode2() { - var node = getNodeForOption("initialFocus"); - if (node === false) { - return false; + var currentNode = getParentNode(element); + if (isShadowRoot(currentNode)) { + currentNode = currentNode.host; } - if (node === void 0) { - if (findContainerIndex(doc.activeElement) >= 0) { - node = doc.activeElement; + while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { + var css = getComputedStyle2(currentNode); + if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { + return currentNode; } else { - var firstTabbableGroup = state.tabbableGroups[0]; - var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; - node = firstTabbableNode || getNodeForOption("fallbackFocus"); + currentNode = currentNode.parentNode; } } - if (!node) { - throw new Error("Your focus-trap needs to have at least one focusable element"); + return null; + } + function getOffsetParent(element) { + var window2 = getWindow(element); + var offsetParent = getTrueOffsetParent(element); + while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") { + offsetParent = getTrueOffsetParent(offsetParent); } - return node; - }; - var updateTabbableNodes = function updateTabbableNodes2() { - state.containerGroups = state.containers.map(function(container) { - var tabbableNodes = tabbable(container, config.tabbableOptions); - var focusableNodes = focusable(container, config.tabbableOptions); - return { - container, - tabbableNodes, - focusableNodes, - firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null, - lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null, - /** - * Finds the __tabbable__ node that follows the given node in the specified direction, - * in this container, if any. - * @param {HTMLElement} node - * @param {boolean} [forward] True if going in forward tab order; false if going - * in reverse. - * @returns {HTMLElement|undefined} The next tabbable node, if any. - */ - nextTabbableNode: function nextTabbableNode(node) { - var forward = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : true; - var nodeIdx = focusableNodes.findIndex(function(n3) { - return n3 === node; - }); - if (nodeIdx < 0) { - return void 0; + if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static")) { + return window2; + } + return offsetParent || getContainingBlock(element) || window2; + } + var top = "top"; + var bottom = "bottom"; + var right = "right"; + var left = "left"; + var auto = "auto"; + var basePlacements = [top, bottom, right, left]; + var start = "start"; + var end = "end"; + var clippingParents = "clippingParents"; + var viewport = "viewport"; + var popper = "popper"; + var reference = "reference"; + var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { + return acc.concat([placement + "-" + start, placement + "-" + end]); + }, []); + var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { + return acc.concat([placement, placement + "-" + start, placement + "-" + end]); + }, []); + var beforeRead = "beforeRead"; + var read = "read"; + var afterRead = "afterRead"; + var beforeMain = "beforeMain"; + var main = "main"; + var afterMain = "afterMain"; + var beforeWrite = "beforeWrite"; + var write = "write"; + var afterWrite = "afterWrite"; + var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; + function order(modifiers) { + var map = /* @__PURE__ */ new Map(); + var visited = /* @__PURE__ */ new Set(); + var result = []; + modifiers.forEach(function(modifier) { + map.set(modifier.name, modifier); + }); + function sort(modifier) { + visited.add(modifier.name); + var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); + requires.forEach(function(dep) { + if (!visited.has(dep)) { + var depModifier = map.get(dep); + if (depModifier) { + sort(depModifier); } - if (forward) { - return focusableNodes.slice(nodeIdx + 1).find(function(n3) { - return isTabbable(n3, config.tabbableOptions); - }); - } - return focusableNodes.slice(0, nodeIdx).reverse().find(function(n3) { - return isTabbable(n3, config.tabbableOptions); - }); } - }; + }); + result.push(modifier); + } + modifiers.forEach(function(modifier) { + if (!visited.has(modifier.name)) { + sort(modifier); + } }); - state.tabbableGroups = state.containerGroups.filter(function(group) { - return group.tabbableNodes.length > 0; + return result; + } + function orderModifiers(modifiers) { + var orderedModifiers = order(modifiers); + return modifierPhases.reduce(function(acc, phase) { + return acc.concat(orderedModifiers.filter(function(modifier) { + return modifier.phase === phase; + })); + }, []); + } + function debounce(fn) { + var pending; + return function() { + if (!pending) { + pending = new Promise(function(resolve) { + Promise.resolve().then(function() { + pending = void 0; + resolve(fn()); + }); + }); + } + return pending; + }; + } + function mergeByName(modifiers) { + var merged = modifiers.reduce(function(merged2, current) { + var existing = merged2[current.name]; + merged2[current.name] = existing ? Object.assign({}, existing, current, { + options: Object.assign({}, existing.options, current.options), + data: Object.assign({}, existing.data, current.data) + }) : current; + return merged2; + }, {}); + return Object.keys(merged).map(function(key) { + return merged[key]; }); - if (state.tabbableGroups.length <= 0 && !getNodeForOption("fallbackFocus")) { - throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times"); + } + function getViewportRect(element, strategy) { + var win = getWindow(element); + var html = getDocumentElement(element); + var visualViewport = win.visualViewport; + var width = html.clientWidth; + var height = html.clientHeight; + var x2 = 0; + var y2 = 0; + if (visualViewport) { + width = visualViewport.width; + height = visualViewport.height; + var layoutViewport = isLayoutViewport(); + if (layoutViewport || !layoutViewport && strategy === "fixed") { + x2 = visualViewport.offsetLeft; + y2 = visualViewport.offsetTop; + } } - }; - var tryFocus = function tryFocus2(node) { - if (node === false) { - return; + return { + width, + height, + x: x2 + getWindowScrollBarX(element), + y: y2 + }; + } + function getDocumentRect(element) { + var _element$ownerDocumen; + var html = getDocumentElement(element); + var winScroll = getWindowScroll(element); + var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; + var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); + var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); + var x2 = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y2 = -winScroll.scrollTop; + if (getComputedStyle2(body || html).direction === "rtl") { + x2 += max(html.clientWidth, body ? body.clientWidth : 0) - width; } - if (node === doc.activeElement) { - return; + return { + width, + height, + x: x2, + y: y2 + }; + } + function contains(parent, child) { + var rootNode = child.getRootNode && child.getRootNode(); + if (parent.contains(child)) { + return true; + } else if (rootNode && isShadowRoot(rootNode)) { + var next = child; + do { + if (next && parent.isSameNode(next)) { + return true; + } + next = next.parentNode || next.host; + } while (next); } - if (!node || !node.focus) { - tryFocus2(getInitialFocusNode()); - return; + return false; + } + function rectToClientRect(rect) { + return Object.assign({}, rect, { + left: rect.x, + top: rect.y, + right: rect.x + rect.width, + bottom: rect.y + rect.height + }); + } + function getInnerBoundingClientRect(element, strategy) { + var rect = getBoundingClientRect(element, false, strategy === "fixed"); + rect.top = rect.top + element.clientTop; + rect.left = rect.left + element.clientLeft; + rect.bottom = rect.top + element.clientHeight; + rect.right = rect.left + element.clientWidth; + rect.width = element.clientWidth; + rect.height = element.clientHeight; + rect.x = rect.left; + rect.y = rect.top; + return rect; + } + function getClientRectFromMixedType(element, clippingParent, strategy) { + return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); + } + function getClippingParents(element) { + var clippingParents2 = listScrollParents(getParentNode(element)); + var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element).position) >= 0; + var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; + if (!isElement(clipperElement)) { + return []; } - node.focus({ - preventScroll: !!config.preventScroll + return clippingParents2.filter(function(clippingParent) { + return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; }); - state.mostRecentlyFocusedNode = node; - if (isSelectableInput(node)) { - node.select(); + } + function getClippingRect(element, boundary, rootBoundary, strategy) { + var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary); + var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); + var firstClippingParent = clippingParents2[0]; + var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { + var rect = getClientRectFromMixedType(element, clippingParent, strategy); + accRect.top = max(rect.top, accRect.top); + accRect.right = min(rect.right, accRect.right); + accRect.bottom = min(rect.bottom, accRect.bottom); + accRect.left = max(rect.left, accRect.left); + return accRect; + }, getClientRectFromMixedType(element, firstClippingParent, strategy)); + clippingRect.width = clippingRect.right - clippingRect.left; + clippingRect.height = clippingRect.bottom - clippingRect.top; + clippingRect.x = clippingRect.left; + clippingRect.y = clippingRect.top; + return clippingRect; + } + function getBasePlacement(placement) { + return placement.split("-")[0]; + } + function getVariation(placement) { + return placement.split("-")[1]; + } + function getMainAxisFromPlacement(placement) { + return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; + } + function computeOffsets(_ref) { + var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement; + var basePlacement = placement ? getBasePlacement(placement) : null; + var variation = placement ? getVariation(placement) : null; + var commonX = reference2.x + reference2.width / 2 - element.width / 2; + var commonY = reference2.y + reference2.height / 2 - element.height / 2; + var offsets; + switch (basePlacement) { + case top: + offsets = { + x: commonX, + y: reference2.y - element.height + }; + break; + case bottom: + offsets = { + x: commonX, + y: reference2.y + reference2.height + }; + break; + case right: + offsets = { + x: reference2.x + reference2.width, + y: commonY + }; + break; + case left: + offsets = { + x: reference2.x - element.width, + y: commonY + }; + break; + default: + offsets = { + x: reference2.x, + y: reference2.y + }; } - }; - var getReturnFocusNode = function getReturnFocusNode2(previousActiveElement) { - var node = getNodeForOption("setReturnFocus", previousActiveElement); - return node ? node : node === false ? false : previousActiveElement; - }; - var checkPointerDown = function checkPointerDown2(e3) { - var target = getActualTarget(e3); - if (findContainerIndex(target) >= 0) { - return; - } - if (valueOrHandler(config.clickOutsideDeactivates, e3)) { - trap.deactivate({ - // if, on deactivation, we should return focus to the node originally-focused - // when the trap was activated (or the configured `setReturnFocus` node), - // then assume it's also OK to return focus to the outside node that was - // just clicked, causing deactivation, as long as that node is focusable; - // if it isn't focusable, then return focus to the original node focused - // on activation (or the configured `setReturnFocus` node) - // NOTE: by setting `returnFocus: false`, deactivate() will do nothing, - // which will result in the outside click setting focus to the node - // that was clicked, whether it's focusable or not; by setting - // `returnFocus: true`, we'll attempt to re-focus the node originally-focused - // on activation (or the configured `setReturnFocus` node) - returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions) - }); - return; - } - if (valueOrHandler(config.allowOutsideClick, e3)) { - return; - } - e3.preventDefault(); - }; - var checkFocusIn = function checkFocusIn2(e3) { - var target = getActualTarget(e3); - var targetContained = findContainerIndex(target) >= 0; - if (targetContained || target instanceof Document) { - if (targetContained) { - state.mostRecentlyFocusedNode = target; + var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; + if (mainAxis != null) { + var len = mainAxis === "y" ? "height" : "width"; + switch (variation) { + case start: + offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2); + break; + case end: + offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2); + break; } - } else { - e3.stopImmediatePropagation(); - tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); } - }; - var checkTab = function checkTab2(e3) { - var target = getActualTarget(e3); - updateTabbableNodes(); - var destinationNode = null; - if (state.tabbableGroups.length > 0) { - var containerIndex = findContainerIndex(target); - var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : void 0; - if (containerIndex < 0) { - if (e3.shiftKey) { - destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode; - } else { - destinationNode = state.tabbableGroups[0].firstTabbableNode; - } - } else if (e3.shiftKey) { - var startOfGroupIndex = findIndex(state.tabbableGroups, function(_ref2) { - var firstTabbableNode = _ref2.firstTabbableNode; - return target === firstTabbableNode; - }); - if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) { - startOfGroupIndex = containerIndex; - } - if (startOfGroupIndex >= 0) { - var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1; - var destinationGroup = state.tabbableGroups[destinationGroupIndex]; - destinationNode = destinationGroup.lastTabbableNode; - } - } else { - var lastOfGroupIndex = findIndex(state.tabbableGroups, function(_ref3) { - var lastTabbableNode = _ref3.lastTabbableNode; - return target === lastTabbableNode; - }); - if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) { - lastOfGroupIndex = containerIndex; - } - if (lastOfGroupIndex >= 0) { - var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1; - var _destinationGroup = state.tabbableGroups[_destinationGroupIndex]; - destinationNode = _destinationGroup.firstTabbableNode; - } - } - } else { - destinationNode = getNodeForOption("fallbackFocus"); + return offsets; + } + function getFreshSideObject() { + return { + top: 0, + right: 0, + bottom: 0, + left: 0 + }; + } + function mergePaddingObject(paddingObject) { + return Object.assign({}, getFreshSideObject(), paddingObject); + } + function expandToHashMap(value, keys) { + return keys.reduce(function(hashMap, key) { + hashMap[key] = value; + return hashMap; + }, {}); + } + function detectOverflow(state, options) { + if (options === void 0) { + options = {}; } - if (destinationNode) { - e3.preventDefault(); - tryFocus(destinationNode); + var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; + var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + var altContext = elementContext === popper ? reference : popper; + var popperRect = state.rects.popper; + var element = state.elements[altBoundary ? altContext : elementContext]; + var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); + var referenceClientRect = getBoundingClientRect(state.elements.reference); + var popperOffsets2 = computeOffsets({ + reference: referenceClientRect, + element: popperRect, + strategy: "absolute", + placement + }); + var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); + var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; + var overflowOffsets = { + top: clippingClientRect.top - elementClientRect.top + paddingObject.top, + bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, + left: clippingClientRect.left - elementClientRect.left + paddingObject.left, + right: elementClientRect.right - clippingClientRect.right + paddingObject.right + }; + var offsetData = state.modifiersData.offset; + if (elementContext === popper && offsetData) { + var offset2 = offsetData[placement]; + Object.keys(overflowOffsets).forEach(function(key) { + var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; + var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; + overflowOffsets[key] += offset2[axis] * multiply; + }); } + return overflowOffsets; + } + var DEFAULT_OPTIONS = { + placement: "bottom", + modifiers: [], + strategy: "absolute" }; - var checkKey = function checkKey2(e3) { - if (isEscapeEvent(e3) && valueOrHandler(config.escapeDeactivates, e3) !== false) { - e3.preventDefault(); - trap.deactivate(); - return; + function areValidElements() { + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; } - if (isTabEvent(e3)) { - checkTab(e3); - return; - } - }; - var checkClick = function checkClick2(e3) { - var target = getActualTarget(e3); - if (findContainerIndex(target) >= 0) { - return; - } - if (valueOrHandler(config.clickOutsideDeactivates, e3)) { - return; - } - if (valueOrHandler(config.allowOutsideClick, e3)) { - return; - } - e3.preventDefault(); - e3.stopImmediatePropagation(); - }; - var addListeners = function addListeners2() { - if (!state.active) { - return; - } - activeFocusTraps.activateTrap(trap); - state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function() { - tryFocus(getInitialFocusNode()); - }) : tryFocus(getInitialFocusNode()); - doc.addEventListener("focusin", checkFocusIn, true); - doc.addEventListener("mousedown", checkPointerDown, { - capture: true, - passive: false + return !args.some(function(element) { + return !(element && typeof element.getBoundingClientRect === "function"); }); - doc.addEventListener("touchstart", checkPointerDown, { - capture: true, - passive: false - }); - doc.addEventListener("click", checkClick, { - capture: true, - passive: false - }); - doc.addEventListener("keydown", checkKey, { - capture: true, - passive: false - }); - return trap; - }; - var removeListeners = function removeListeners2() { - if (!state.active) { - return; + } + function popperGenerator(generatorOptions) { + if (generatorOptions === void 0) { + generatorOptions = {}; } - doc.removeEventListener("focusin", checkFocusIn, true); - doc.removeEventListener("mousedown", checkPointerDown, true); - doc.removeEventListener("touchstart", checkPointerDown, true); - doc.removeEventListener("click", checkClick, true); - doc.removeEventListener("keydown", checkKey, true); - return trap; - }; - trap = { - get active() { - return state.active; - }, - get paused() { - return state.paused; - }, - activate: function activate(activateOptions) { - if (state.active) { - return this; + var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; + return function createPopper2(reference2, popper2, options) { + if (options === void 0) { + options = defaultOptions; } - var onActivate = getOption(activateOptions, "onActivate"); - var onPostActivate = getOption(activateOptions, "onPostActivate"); - var checkCanFocusTrap = getOption(activateOptions, "checkCanFocusTrap"); - if (!checkCanFocusTrap) { - updateTabbableNodes(); - } - state.active = true; - state.paused = false; - state.nodeFocusedBeforeActivation = doc.activeElement; - if (onActivate) { - onActivate(); - } - var finishActivation = function finishActivation2() { - if (checkCanFocusTrap) { - updateTabbableNodes(); - } - addListeners(); - if (onPostActivate) { - onPostActivate(); - } + var state = { + placement: "bottom", + orderedModifiers: [], + options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), + modifiersData: {}, + elements: { + reference: reference2, + popper: popper2 + }, + attributes: {}, + styles: {} }; - if (checkCanFocusTrap) { - checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation); - return this; - } - finishActivation(); - return this; - }, - deactivate: function deactivate(deactivateOptions) { - if (!state.active) { - return this; - } - var options = _objectSpread2({ - onDeactivate: config.onDeactivate, - onPostDeactivate: config.onPostDeactivate, - checkCanReturnFocus: config.checkCanReturnFocus - }, deactivateOptions); - clearTimeout(state.delayInitialFocusTimer); - state.delayInitialFocusTimer = void 0; - removeListeners(); - state.active = false; - state.paused = false; - activeFocusTraps.deactivateTrap(trap); - var onDeactivate = getOption(options, "onDeactivate"); - var onPostDeactivate = getOption(options, "onPostDeactivate"); - var checkCanReturnFocus = getOption(options, "checkCanReturnFocus"); - var returnFocus = getOption(options, "returnFocus", "returnFocusOnDeactivate"); - if (onDeactivate) { - onDeactivate(); - } - var finishDeactivation = function finishDeactivation2() { - delay(function() { - if (returnFocus) { - tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)); + var effectCleanupFns = []; + var isDestroyed = false; + var instance = { + state, + setOptions: function setOptions(setOptionsAction) { + var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; + cleanupModifierEffects(); + state.options = Object.assign({}, defaultOptions, state.options, options2); + state.scrollParents = { + reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], + popper: listScrollParents(popper2) + }; + var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); + state.orderedModifiers = orderedModifiers.filter(function(m2) { + return m2.enabled; + }); + runModifierEffects(); + return instance.update(); + }, + // Sync update – it will always be executed, even if not necessary. This + // is useful for low frequency updates where sync behavior simplifies the + // logic. + // For high frequency updates (e.g. `resize` and `scroll` events), always + // prefer the async Popper#update method + forceUpdate: function forceUpdate() { + if (isDestroyed) { + return; } - if (onPostDeactivate) { - onPostDeactivate(); + var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; + if (!areValidElements(reference3, popper3)) { + return; } - }); + state.rects = { + reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), + popper: getLayoutRect(popper3) + }; + state.reset = false; + state.placement = state.options.placement; + state.orderedModifiers.forEach(function(modifier) { + return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); + }); + for (var index = 0; index < state.orderedModifiers.length; index++) { + if (state.reset === true) { + state.reset = false; + index = -1; + continue; + } + var _state$orderedModifie = state.orderedModifiers[index], fn = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; + if (typeof fn === "function") { + state = fn({ + state, + options: _options, + name, + instance + }) || state; + } + } + }, + // Async and optimistically optimized update – it will not be executed if + // not necessary (debounced to run at most once-per-tick) + update: debounce(function() { + return new Promise(function(resolve) { + instance.forceUpdate(); + resolve(state); + }); + }), + destroy: function destroy() { + cleanupModifierEffects(); + isDestroyed = true; + } }; - if (returnFocus && checkCanReturnFocus) { - checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation); - return this; + if (!areValidElements(reference2, popper2)) { + return instance; } - finishDeactivation(); - return this; - }, - pause: function pause() { - if (state.paused || !state.active) { - return this; - } - state.paused = true; - removeListeners(); - return this; - }, - unpause: function unpause() { - if (!state.paused || !state.active) { - return this; - } - state.paused = false; - updateTabbableNodes(); - addListeners(); - return this; - }, - updateContainerElements: function updateContainerElements(containerElements) { - var elementsAsArray = [].concat(containerElements).filter(Boolean); - state.containers = elementsAsArray.map(function(element) { - return typeof element === "string" ? doc.querySelector(element) : element; + instance.setOptions(options).then(function(state2) { + if (!isDestroyed && options.onFirstUpdate) { + options.onFirstUpdate(state2); + } }); - if (state.active) { - updateTabbableNodes(); + function runModifierEffects() { + state.orderedModifiers.forEach(function(_ref) { + var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect2 = _ref.effect; + if (typeof effect2 === "function") { + var cleanupFn = effect2({ + state, + name, + instance, + options: options2 + }); + var noopFn = function noopFn2() { + }; + effectCleanupFns.push(cleanupFn || noopFn); + } + }); } - return this; - } - }; - trap.updateContainerElements(elements); - return trap; - }; - function src_default6(Alpine3) { - let lastFocused; - let currentFocused; - window.addEventListener("focusin", () => { - lastFocused = currentFocused; - currentFocused = document.activeElement; - }); - Alpine3.magic("focus", (el) => { - let within2 = el; - return { - __noscroll: false, - __wrapAround: false, - within(el2) { - within2 = el2; - return this; - }, - withoutScrolling() { - this.__noscroll = true; - return this; - }, - noscroll() { - this.__noscroll = true; - return this; - }, - withWrapAround() { - this.__wrapAround = true; - return this; - }, - wrap() { - return this.withWrapAround(); - }, - focusable(el2) { - return isFocusable(el2); - }, - previouslyFocused() { - return lastFocused; - }, - lastFocused() { - return lastFocused; - }, - focused() { - return currentFocused; - }, - focusables() { - if (Array.isArray(within2)) - return within2; - return focusable(within2, { displayCheck: "none" }); - }, - all() { - return this.focusables(); - }, - isFirst(el2) { - let els = this.all(); - return els[0] && els[0].isSameNode(el2); - }, - isLast(el2) { - let els = this.all(); - return els.length && els.slice(-1)[0].isSameNode(el2); - }, - getFirst() { - return this.all()[0]; - }, - getLast() { - return this.all().slice(-1)[0]; - }, - getNext() { - let list = this.all(); - let current = document.activeElement; - if (list.indexOf(current) === -1) - return; - if (this.__wrapAround && list.indexOf(current) === list.length - 1) { - return list[0]; - } - return list[list.indexOf(current) + 1]; - }, - getPrevious() { - let list = this.all(); - let current = document.activeElement; - if (list.indexOf(current) === -1) - return; - if (this.__wrapAround && list.indexOf(current) === 0) { - return list.slice(-1)[0]; - } - return list[list.indexOf(current) - 1]; - }, - first() { - this.focus(this.getFirst()); - }, - last() { - this.focus(this.getLast()); - }, - next() { - this.focus(this.getNext()); - }, - previous() { - this.focus(this.getPrevious()); - }, - prev() { - return this.previous(); - }, - focus(el2) { - if (!el2) - return; - setTimeout(() => { - if (!el2.hasAttribute("tabindex")) - el2.setAttribute("tabindex", "0"); - el2.focus({ preventScroll: this._noscroll }); + function cleanupModifierEffects() { + effectCleanupFns.forEach(function(fn) { + return fn(); }); + effectCleanupFns = []; } + return instance; }; - }); - Alpine3.directive("trap", Alpine3.skipDuringClone( - (el, { expression, modifiers }, { effect: effect7, evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { - let evaluator = evaluateLater2(expression); - let oldValue = false; - let options = { - escapeDeactivates: false, - allowOutsideClick: true, - fallbackFocus: () => el - }; - let autofocusEl = el.querySelector("[autofocus]"); - if (autofocusEl) - options.initialFocus = autofocusEl; - let trap = createFocusTrap(el, options); - let undoInert = () => { - }; - let undoDisableScrolling = () => { - }; - const releaseFocus = () => { - undoInert(); - undoInert = () => { - }; - undoDisableScrolling(); - undoDisableScrolling = () => { - }; - trap.deactivate({ - returnFocus: !modifiers.includes("noreturn") - }); - }; - effect7(() => evaluator((value) => { - if (oldValue === value) - return; - if (value && !oldValue) { - setTimeout(() => { - if (modifiers.includes("inert")) - undoInert = setInert(el); - if (modifiers.includes("noscroll")) - undoDisableScrolling = disableScrolling(); - trap.activate(); - }); - } - if (!value && oldValue) { - releaseFocus(); - } - oldValue = !!value; - })); - cleanup2(releaseFocus); - }, - // When cloning, we only want to add aria-hidden attributes to the - // DOM and not try to actually trap, as trapping can mess with the - // live DOM and isn't just isolated to the cloned DOM. - (el, { expression, modifiers }, { evaluate: evaluate2 }) => { - if (modifiers.includes("inert") && evaluate2(expression)) - setInert(el); - } - )); - } - function setInert(el) { - let undos = []; - crawlSiblingsUp(el, (sibling) => { - let cache = sibling.hasAttribute("aria-hidden"); - sibling.setAttribute("aria-hidden", "true"); - undos.push(() => cache || sibling.removeAttribute("aria-hidden")); - }); - return () => { - while (undos.length) - undos.pop()(); + } + var passive = { + passive: true }; - } - function crawlSiblingsUp(el, callback) { - if (el.isSameNode(document.body) || !el.parentNode) - return; - Array.from(el.parentNode.children).forEach((sibling) => { - if (sibling.isSameNode(el)) { - crawlSiblingsUp(el.parentNode, callback); - } else { - callback(sibling); + function effect$2(_ref) { + var state = _ref.state, instance = _ref.instance, options = _ref.options; + var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; + var window2 = getWindow(state.elements.popper); + var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.addEventListener("scroll", instance.update, passive); + }); } - }); - } - function disableScrolling() { - let overflow = document.documentElement.style.overflow; - let paddingRight = document.documentElement.style.paddingRight; - let scrollbarWidth = window.innerWidth - document.documentElement.clientWidth; - document.documentElement.style.overflow = "hidden"; - document.documentElement.style.paddingRight = `${scrollbarWidth}px`; - return () => { - document.documentElement.style.overflow = overflow; - document.documentElement.style.paddingRight = paddingRight; - }; - } - var module_default6 = src_default6; - - // helpers/lang.js - function nameFunction(name, body) { - return { - [name](...args) { - return body.apply(this, args); + if (resize) { + window2.addEventListener("resize", instance.update, passive); } - }[name]; - } - function isObject2(thing) { - return typeof thing === "object" && thing !== null; - } - function isNumeric4(str) { - if (typeof str != "string") - return false; - return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)... - !isNaN(parseFloat(str)); - } - function roughSizeOfObject(object) { - const objectList = []; - const stack = [object]; - let bytes = 0; - while (stack.length) { - const value = stack.pop(); - if (typeof value === "boolean") { - bytes += 4; - } else if (typeof value === "string") { - bytes += value.length * 2; - } else if (typeof value === "number") { - bytes += 8; - } else if (typeof value === "object" && objectList.indexOf(value) === -1) { - objectList.push(value); - for (var i3 in value) { - stack.push(value[i3]); + return function() { + if (scroll) { + scrollParents.forEach(function(scrollParent) { + scrollParent.removeEventListener("scroll", instance.update, passive); + }); } - } - } - return bytes; - } - - // base/alpine/directives/undo.js - function undo_default(Alpine3) { - const maxHistorySize = 100; - Alpine3.directive("undo", (el, { expression }, { evaluate: evaluate2 }) => { - const data2 = getData(el); - const history = Alpine3.reactive({ - stack: [], - stackPos: -1, - adding: false, - clear() { - history.stack.length = 0; - history.stackPos = -1; - }, - add(name, newValue, oldValue) { - if (!history.adding && newValue !== oldValue) { - if (history.stackPos < history.stackSize - 1) { - const stack = Alpine3.raw(history.stack); - history.stack = stack.slice(0, history.stackPos + 1); - } - history.stack.push({ name, newValue, oldValue }); - if (history.stackSize > maxHistorySize) { - history.stack.pop(); - } else { - history.stackPos++; - } - } - }, - undo() { - if (!data2.undo) { - console.error("Missing `undo` method"); - return; - } - if (history.undoable) { - history.adding = true; - const entry = history.stack[history.stackPos]; - data2.undo(entry.name, entry.oldValue); - history.stackPos--; - this.$nextTick(() => history.adding = false); - } - }, - redo() { - if (!data2.redo) { - console.error("Missing `redo` method"); - return; - } - if (history.redoable) { - history.adding = true; - history.stackPos++; - const entry = history.stack[history.stackPos]; - data2.redo(entry.name, entry.newValue); - this.$nextTick(() => history.adding = false); - } - }, - get undoable() { - return history.stackPos >= 0; - }, - get redoable() { - return history.stackPos < history.stackSize - 1; - }, - get stackSize() { - return history.stack.length; - }, - get stackMemoryUsage() { - return roughSizeOfObject(history.stack); + if (resize) { + window2.removeEventListener("resize", instance.update, passive); } + }; + } + var eventListeners = { + name: "eventListeners", + enabled: true, + phase: "write", + fn: function fn() { + }, + effect: effect$2, + data: {} + }; + function popperOffsets(_ref) { + var state = _ref.state, name = _ref.name; + state.modifiersData[name] = computeOffsets({ + reference: state.rects.reference, + element: state.rects.popper, + strategy: "absolute", + placement: state.placement }); - setData(el, { history }); - }); - } - - // base/alpine/directives/options.js - var import_lodash = __toESM(require_lodash(), 1); - - // helpers/dom.js - function castAttributeValue(value) { - if (value === "false") { - return false; } - if (value === "true") { - return true; + var popperOffsets$1 = { + name: "popperOffsets", + enabled: true, + phase: "read", + fn: popperOffsets, + data: {} + }; + var unsetSides = { + top: "auto", + right: "auto", + bottom: "auto", + left: "auto" + }; + function roundOffsetsByDPR(_ref, win) { + var x2 = _ref.x, y2 = _ref.y; + var dpr = win.devicePixelRatio || 1; + return { + x: round(x2 * dpr) / dpr || 0, + y: round(y2 * dpr) / dpr || 0 + }; } - if (isNumeric4(value)) { - return parseInt(value, 10); - } - return value; - } - function isNode(o3) { - return typeof Node === "object" ? o3 instanceof Node : o3 && typeof o3 === "object" && typeof o3.nodeType === "number" && typeof o3.nodeName === "string"; - } - - // base/alpine/directives/options.js - function options_default(Alpine3) { - Alpine3.directive( - "options", - (el, { expression }, { evaluate: evaluate2, effect: effect7, cleanup: cleanup2 }) => { - const optionNames = evaluate2(expression); - const optionsData = buildOptionsData(el, optionNames); - const optionAttrs = optionsData.map((option) => option.attr); - const data2 = setData( - el, - Alpine3.reactive({ - $options: toPairs(optionsData) - }) - ); - effect7(() => { - Object.entries(data2.$options).forEach(([key, value]) => { - Alpine3.mutateDom(() => { - const attrName = `data-${(0, import_lodash.kebabCase)(key)}`; - if (value === null) { - el.removeAttribute(attrName); - } else { - el.setAttribute(attrName, value); - } - }); - }); - }); - const attrObserver = new MutationObserver((mutationsList) => { - for (const mutation of mutationsList) { - const attrName = mutation.attributeName; - if (mutation.type !== "attributes" || !optionAttrs.includes(attrName)) { - return; - } - const value = mutation.target.getAttribute(attrName); - const option = (0, import_lodash.camelCase)(attrName.replace("data-", "")); - data2.$options[option] = castAttributeValue(value); + function mapToStyles(_ref2) { + var _Object$assign2; + var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; + var _offsets$x = offsets.x, x2 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y2 = _offsets$y === void 0 ? 0 : _offsets$y; + var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ + x: x2, + y: y2 + }) : { + x: x2, + y: y2 + }; + x2 = _ref3.x; + y2 = _ref3.y; + var hasX = offsets.hasOwnProperty("x"); + var hasY = offsets.hasOwnProperty("y"); + var sideX = left; + var sideY = top; + var win = window; + if (adaptive) { + var offsetParent = getOffsetParent(popper2); + var heightProp = "clientHeight"; + var widthProp = "clientWidth"; + if (offsetParent === getWindow(popper2)) { + offsetParent = getDocumentElement(popper2); + if (getComputedStyle2(offsetParent).position !== "static" && position === "absolute") { + heightProp = "scrollHeight"; + widthProp = "scrollWidth"; } - }).observe(el, { attributes: true }); - cleanup2(() => { - attrObserver && attrObserver.disconnect(); - }); + } + offsetParent = offsetParent; + if (placement === top || (placement === left || placement === right) && variation === end) { + sideY = bottom; + var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : ( + // $FlowFixMe[prop-missing] + offsetParent[heightProp] + ); + y2 -= offsetY - popperRect.height; + y2 *= gpuAcceleration ? 1 : -1; + } + if (placement === left || (placement === top || placement === bottom) && variation === end) { + sideX = right; + var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : ( + // $FlowFixMe[prop-missing] + offsetParent[widthProp] + ); + x2 -= offsetX - popperRect.width; + x2 *= gpuAcceleration ? 1 : -1; + } } - ).before("bind"); - } - function buildOptionsData(el, optionNames) { - return optionNames.map((name) => { - const key = (0, import_lodash.camelCase)(name); - const attr = `data-${(0, import_lodash.kebabCase)(name)}`; - let value = null; - if (el.hasAttribute(attr)) { - const strValue = el.getAttribute(attr); - value = castAttributeValue(strValue); + var commonStyles = Object.assign({ + position + }, adaptive && unsetSides); + var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ + x: x2, + y: y2 + }, getWindow(popper2)) : { + x: x2, + y: y2 + }; + x2 = _ref4.x; + y2 = _ref4.y; + if (gpuAcceleration) { + var _Object$assign; + return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _Object$assign)); } - return { name, key, attr, value }; - }); - } - function toPairs(optionsData) { - return (0, import_lodash.mapValues)((0, import_lodash.keyBy)(optionsData, "key"), "value"); - } - - // ../../../node_modules/@popperjs/core/lib/enums.js - var top = "top"; - var bottom = "bottom"; - var right = "right"; - var left = "left"; - var auto = "auto"; - var basePlacements = [top, bottom, right, left]; - var start2 = "start"; - var end = "end"; - var clippingParents = "clippingParents"; - var viewport = "viewport"; - var popper = "popper"; - var reference = "reference"; - var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) { - return acc.concat([placement + "-" + start2, placement + "-" + end]); - }, []); - var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) { - return acc.concat([placement, placement + "-" + start2, placement + "-" + end]); - }, []); - var beforeRead = "beforeRead"; - var read = "read"; - var afterRead = "afterRead"; - var beforeMain = "beforeMain"; - var main = "main"; - var afterMain = "afterMain"; - var beforeWrite = "beforeWrite"; - var write = "write"; - var afterWrite = "afterWrite"; - var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite]; - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js - function getNodeName(element) { - return element ? (element.nodeName || "").toLowerCase() : null; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js - function getWindow(node) { - if (node == null) { - return window; + return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2)); } - if (node.toString() !== "[object Window]") { - var ownerDocument = node.ownerDocument; - return ownerDocument ? ownerDocument.defaultView || window : window; - } - return node; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js - function isElement(node) { - var OwnElement = getWindow(node).Element; - return node instanceof OwnElement || node instanceof Element; - } - function isHTMLElement(node) { - var OwnElement = getWindow(node).HTMLElement; - return node instanceof OwnElement || node instanceof HTMLElement; - } - function isShadowRoot(node) { - if (typeof ShadowRoot === "undefined") { - return false; - } - var OwnElement = getWindow(node).ShadowRoot; - return node instanceof OwnElement || node instanceof ShadowRoot; - } - - // ../../../node_modules/@popperjs/core/lib/modifiers/applyStyles.js - function applyStyles(_ref) { - var state = _ref.state; - Object.keys(state.elements).forEach(function(name) { - var style = state.styles[name] || {}; - var attributes = state.attributes[name] || {}; - var element = state.elements[name]; - if (!isHTMLElement(element) || !getNodeName(element)) { - return; + function computeStyles(_ref5) { + var state = _ref5.state, options = _ref5.options; + var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; + var commonStyles = { + placement: getBasePlacement(state.placement), + variation: getVariation(state.placement), + popper: state.elements.popper, + popperRect: state.rects.popper, + gpuAcceleration, + isFixed: state.options.strategy === "fixed" + }; + if (state.modifiersData.popperOffsets != null) { + state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.popperOffsets, + position: state.options.strategy, + adaptive, + roundOffsets + }))); } - Object.assign(element.style, style); - Object.keys(attributes).forEach(function(name2) { - var value = attributes[name2]; - if (value === false) { - element.removeAttribute(name2); - } else { - element.setAttribute(name2, value === true ? "" : value); - } + if (state.modifiersData.arrow != null) { + state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { + offsets: state.modifiersData.arrow, + position: "absolute", + adaptive: false, + roundOffsets + }))); + } + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-placement": state.placement }); - }); - } - function effect3(_ref2) { - var state = _ref2.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: "0", - top: "0", - margin: "0" - }, - arrow: { - position: "absolute" - }, - reference: {} - }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); } - return function() { + var computeStyles$1 = { + name: "computeStyles", + enabled: true, + phase: "beforeWrite", + fn: computeStyles, + data: {} + }; + function applyStyles(_ref) { + var state = _ref.state; Object.keys(state.elements).forEach(function(name) { - var element = state.elements[name]; + var style = state.styles[name] || {}; var attributes = state.attributes[name] || {}; - var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); - var style = styleProperties.reduce(function(style2, property) { - style2[property] = ""; - return style2; - }, {}); + var element = state.elements[name]; if (!isHTMLElement(element) || !getNodeName(element)) { return; } Object.assign(element.style, style); - Object.keys(attributes).forEach(function(attribute) { - element.removeAttribute(attribute); + Object.keys(attributes).forEach(function(name2) { + var value = attributes[name2]; + if (value === false) { + element.removeAttribute(name2); + } else { + element.setAttribute(name2, value === true ? "" : value); + } }); }); - }; - } - var applyStyles_default = { - name: "applyStyles", - enabled: true, - phase: "write", - fn: applyStyles, - effect: effect3, - requires: ["computeStyles"] - }; - - // ../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js - function getBasePlacement(placement) { - return placement.split("-")[0]; - } - - // ../../../node_modules/@popperjs/core/lib/utils/math.js - var max = Math.max; - var min = Math.min; - var round = Math.round; - - // ../../../node_modules/@popperjs/core/lib/utils/userAgent.js - function getUAString() { - var uaData = navigator.userAgentData; - if (uaData != null && uaData.brands && Array.isArray(uaData.brands)) { - return uaData.brands.map(function(item) { - return item.brand + "/" + item.version; - }).join(" "); } - return navigator.userAgent; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js - function isLayoutViewport() { - return !/^((?!chrome|android).)*safari/i.test(getUAString()); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js - function getBoundingClientRect(element, includeScale, isFixedStrategy) { - if (includeScale === void 0) { - includeScale = false; - } - if (isFixedStrategy === void 0) { - isFixedStrategy = false; - } - var clientRect = element.getBoundingClientRect(); - var scaleX = 1; - var scaleY = 1; - if (includeScale && isHTMLElement(element)) { - scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1; - scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1; - } - var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport; - var addVisualOffsets = !isLayoutViewport() && isFixedStrategy; - var x3 = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX; - var y3 = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY; - var width = clientRect.width / scaleX; - var height = clientRect.height / scaleY; - return { - width, - height, - top: y3, - right: x3 + width, - bottom: y3 + height, - left: x3, - x: x3, - y: y3 - }; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js - function getLayoutRect(element) { - var clientRect = getBoundingClientRect(element); - var width = element.offsetWidth; - var height = element.offsetHeight; - if (Math.abs(clientRect.width - width) <= 1) { - width = clientRect.width; - } - if (Math.abs(clientRect.height - height) <= 1) { - height = clientRect.height; - } - return { - x: element.offsetLeft, - y: element.offsetTop, - width, - height - }; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/contains.js - function contains(parent, child) { - var rootNode = child.getRootNode && child.getRootNode(); - if (parent.contains(child)) { - return true; - } else if (rootNode && isShadowRoot(rootNode)) { - var next = child; - do { - if (next && parent.isSameNode(next)) { - return true; - } - next = next.parentNode || next.host; - } while (next); - } - return false; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js - function getComputedStyle2(element) { - return getWindow(element).getComputedStyle(element); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js - function isTableElement(element) { - return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js - function getDocumentElement(element) { - return ((isElement(element) ? element.ownerDocument : ( - // $FlowFixMe[prop-missing] - element.document - )) || window.document).documentElement; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js - function getParentNode(element) { - if (getNodeName(element) === "html") { - return element; - } - return ( - // this is a quicker (but less type safe) way to save quite some bytes from the bundle - // $FlowFixMe[incompatible-return] - // $FlowFixMe[prop-missing] - element.assignedSlot || // step into the shadow DOM of the parent of a slotted node - element.parentNode || // DOM Element detected - (isShadowRoot(element) ? element.host : null) || // ShadowRoot detected - // $FlowFixMe[incompatible-call]: HTMLElement is a Node - getDocumentElement(element) - ); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js - function getTrueOffsetParent(element) { - if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 - getComputedStyle2(element).position === "fixed") { - return null; - } - return element.offsetParent; - } - function getContainingBlock(element) { - var isFirefox = /firefox/i.test(getUAString()); - var isIE = /Trident/i.test(getUAString()); - if (isIE && isHTMLElement(element)) { - var elementCss = getComputedStyle2(element); - if (elementCss.position === "fixed") { - return null; + function effect$1(_ref2) { + var state = _ref2.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); } + return function() { + Object.keys(state.elements).forEach(function(name) { + var element = state.elements[name]; + var attributes = state.attributes[name] || {}; + var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]); + var style = styleProperties.reduce(function(style2, property) { + style2[property] = ""; + return style2; + }, {}); + if (!isHTMLElement(element) || !getNodeName(element)) { + return; + } + Object.assign(element.style, style); + Object.keys(attributes).forEach(function(attribute) { + element.removeAttribute(attribute); + }); + }); + }; } - var currentNode = getParentNode(element); - if (isShadowRoot(currentNode)) { - currentNode = currentNode.host; - } - while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) { - var css = getComputedStyle2(currentNode); - if (css.transform !== "none" || css.perspective !== "none" || css.contain === "paint" || ["transform", "perspective"].indexOf(css.willChange) !== -1 || isFirefox && css.willChange === "filter" || isFirefox && css.filter && css.filter !== "none") { - return currentNode; - } else { - currentNode = currentNode.parentNode; - } - } - return null; - } - function getOffsetParent(element) { - var window2 = getWindow(element); - var offsetParent = getTrueOffsetParent(element); - while (offsetParent && isTableElement(offsetParent) && getComputedStyle2(offsetParent).position === "static") { - offsetParent = getTrueOffsetParent(offsetParent); - } - if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle2(offsetParent).position === "static")) { - return window2; - } - return offsetParent || getContainingBlock(element) || window2; - } - - // ../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js - function getMainAxisFromPlacement(placement) { - return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y"; - } - - // ../../../node_modules/@popperjs/core/lib/utils/within.js - function within(min2, value, max2) { - return max(min2, min(value, max2)); - } - function withinMaxClamp(min2, value, max2) { - var v3 = within(min2, value, max2); - return v3 > max2 ? max2 : v3; - } - - // ../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js - function getFreshSideObject() { - return { - top: 0, - right: 0, - bottom: 0, - left: 0 + var applyStyles$1 = { + name: "applyStyles", + enabled: true, + phase: "write", + fn: applyStyles, + effect: effect$1, + requires: ["computeStyles"] }; - } - - // ../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js - function mergePaddingObject(paddingObject) { - return Object.assign({}, getFreshSideObject(), paddingObject); - } - - // ../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js - function expandToHashMap(value, keys) { - return keys.reduce(function(hashMap, key) { - hashMap[key] = value; - return hashMap; - }, {}); - } - - // ../../../node_modules/@popperjs/core/lib/modifiers/arrow.js - var toPaddingObject = function toPaddingObject2(padding, state) { - padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { - placement: state.placement - })) : padding; - return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); - }; - function arrow(_ref) { - var _state$modifiersData$; - var state = _ref.state, name = _ref.name, options = _ref.options; - var arrowElement = state.elements.arrow; - var popperOffsets2 = state.modifiersData.popperOffsets; - var basePlacement = getBasePlacement(state.placement); - var axis = getMainAxisFromPlacement(basePlacement); - var isVertical = [left, right].indexOf(basePlacement) >= 0; - var len = isVertical ? "height" : "width"; - if (!arrowElement || !popperOffsets2) { - return; + function distanceAndSkiddingToXY(placement, rects, offset2) { + var basePlacement = getBasePlacement(placement); + var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; + var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { + placement + })) : offset2, skidding = _ref[0], distance = _ref[1]; + skidding = skidding || 0; + distance = (distance || 0) * invertDistance; + return [left, right].indexOf(basePlacement) >= 0 ? { + x: distance, + y: skidding + } : { + x: skidding, + y: distance + }; } - var paddingObject = toPaddingObject(options.padding, state); - var arrowRect = getLayoutRect(arrowElement); - var minProp = axis === "y" ? top : left; - var maxProp = axis === "y" ? bottom : right; - var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; - var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; - var arrowOffsetParent = getOffsetParent(arrowElement); - var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; - var centerToReference = endDiff / 2 - startDiff / 2; - var min2 = paddingObject[minProp]; - var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; - var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; - var offset2 = within(min2, center, max2); - var axisProp = axis; - state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); - } - function effect4(_ref2) { - var state = _ref2.state, options = _ref2.options; - var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; - if (arrowElement == null) { - return; - } - if (typeof arrowElement === "string") { - arrowElement = state.elements.popper.querySelector(arrowElement); - if (!arrowElement) { - return; + function offset(_ref2) { + var state = _ref2.state, options = _ref2.options, name = _ref2.name; + var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; + var data = placements.reduce(function(acc, placement) { + acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); + return acc; + }, {}); + var _data$state$placement = data[state.placement], x2 = _data$state$placement.x, y2 = _data$state$placement.y; + if (state.modifiersData.popperOffsets != null) { + state.modifiersData.popperOffsets.x += x2; + state.modifiersData.popperOffsets.y += y2; } + state.modifiersData[name] = data; } - if (!contains(state.elements.popper, arrowElement)) { - return; - } - state.elements.arrow = arrowElement; - } - var arrow_default = { - name: "arrow", - enabled: true, - phase: "main", - fn: arrow, - effect: effect4, - requires: ["popperOffsets"], - requiresIfExists: ["preventOverflow"] - }; - - // ../../../node_modules/@popperjs/core/lib/utils/getVariation.js - function getVariation(placement) { - return placement.split("-")[1]; - } - - // ../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js - var unsetSides = { - top: "auto", - right: "auto", - bottom: "auto", - left: "auto" - }; - function roundOffsetsByDPR(_ref, win) { - var x3 = _ref.x, y3 = _ref.y; - var dpr = win.devicePixelRatio || 1; - return { - x: round(x3 * dpr) / dpr || 0, - y: round(y3 * dpr) / dpr || 0 + var offset$1 = { + name: "offset", + enabled: true, + phase: "main", + requires: ["popperOffsets"], + fn: offset }; - } - function mapToStyles(_ref2) { - var _Object$assign2; - var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed; - var _offsets$x = offsets.x, x3 = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y3 = _offsets$y === void 0 ? 0 : _offsets$y; - var _ref3 = typeof roundOffsets === "function" ? roundOffsets({ - x: x3, - y: y3 - }) : { - x: x3, - y: y3 + var hash$1 = { + left: "right", + right: "left", + bottom: "top", + top: "bottom" }; - x3 = _ref3.x; - y3 = _ref3.y; - var hasX = offsets.hasOwnProperty("x"); - var hasY = offsets.hasOwnProperty("y"); - var sideX = left; - var sideY = top; - var win = window; - if (adaptive) { - var offsetParent = getOffsetParent(popper2); - var heightProp = "clientHeight"; - var widthProp = "clientWidth"; - if (offsetParent === getWindow(popper2)) { - offsetParent = getDocumentElement(popper2); - if (getComputedStyle2(offsetParent).position !== "static" && position === "absolute") { - heightProp = "scrollHeight"; - widthProp = "scrollWidth"; - } - } - offsetParent = offsetParent; - if (placement === top || (placement === left || placement === right) && variation === end) { - sideY = bottom; - var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : ( - // $FlowFixMe[prop-missing] - offsetParent[heightProp] - ); - y3 -= offsetY - popperRect.height; - y3 *= gpuAcceleration ? 1 : -1; - } - if (placement === left || (placement === top || placement === bottom) && variation === end) { - sideX = right; - var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : ( - // $FlowFixMe[prop-missing] - offsetParent[widthProp] - ); - x3 -= offsetX - popperRect.width; - x3 *= gpuAcceleration ? 1 : -1; - } + function getOppositePlacement(placement) { + return placement.replace(/left|right|bottom|top/g, function(matched) { + return hash$1[matched]; + }); } - var commonStyles = Object.assign({ - position - }, adaptive && unsetSides); - var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ - x: x3, - y: y3 - }, getWindow(popper2)) : { - x: x3, - y: y3 + var hash = { + start: "end", + end: "start" }; - x3 = _ref4.x; - y3 = _ref4.y; - if (gpuAcceleration) { - var _Object$assign; - return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x3 + "px, " + y3 + "px)" : "translate3d(" + x3 + "px, " + y3 + "px, 0)", _Object$assign)); + function getOppositeVariationPlacement(placement) { + return placement.replace(/start|end/g, function(matched) { + return hash[matched]; + }); } - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y3 + "px" : "", _Object$assign2[sideX] = hasX ? x3 + "px" : "", _Object$assign2.transform = "", _Object$assign2)); - } - function computeStyles(_ref5) { - var state = _ref5.state, options = _ref5.options; - var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets; - var commonStyles = { - placement: getBasePlacement(state.placement), - variation: getVariation(state.placement), - popper: state.elements.popper, - popperRect: state.rects.popper, - gpuAcceleration, - isFixed: state.options.strategy === "fixed" - }; - if (state.modifiersData.popperOffsets != null) { - state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.popperOffsets, - position: state.options.strategy, - adaptive, - roundOffsets - }))); - } - if (state.modifiersData.arrow != null) { - state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, { - offsets: state.modifiersData.arrow, - position: "absolute", - adaptive: false, - roundOffsets - }))); - } - state.attributes.popper = Object.assign({}, state.attributes.popper, { - "data-popper-placement": state.placement - }); - } - var computeStyles_default = { - name: "computeStyles", - enabled: true, - phase: "beforeWrite", - fn: computeStyles, - data: {} - }; - - // ../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js - var passive = { - passive: true - }; - function effect5(_ref) { - var state = _ref.state, instance = _ref.instance, options = _ref.options; - var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize; - var window2 = getWindow(state.elements.popper); - var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper); - if (scroll) { - scrollParents.forEach(function(scrollParent) { - scrollParent.addEventListener("scroll", instance.update, passive); + function computeAutoPlacement(state, options) { + if (options === void 0) { + options = {}; + } + var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; + var variation = getVariation(placement); + var placements$1 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { + return getVariation(placement2) === variation; + }) : basePlacements; + var allowedPlacements = placements$1.filter(function(placement2) { + return allowedAutoPlacements.indexOf(placement2) >= 0; }); + if (allowedPlacements.length === 0) { + allowedPlacements = placements$1; + } + var overflows = allowedPlacements.reduce(function(acc, placement2) { + acc[placement2] = detectOverflow(state, { + placement: placement2, + boundary, + rootBoundary, + padding + })[getBasePlacement(placement2)]; + return acc; + }, {}); + return Object.keys(overflows).sort(function(a2, b2) { + return overflows[a2] - overflows[b2]; + }); } - if (resize) { - window2.addEventListener("resize", instance.update, passive); + function getExpandedFallbackPlacements(placement) { + if (getBasePlacement(placement) === auto) { + return []; + } + var oppositePlacement = getOppositePlacement(placement); + return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; } - return function() { - if (scroll) { - scrollParents.forEach(function(scrollParent) { - scrollParent.removeEventListener("scroll", instance.update, passive); + function flip(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + if (state.modifiersData[name]._skip) { + return; + } + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; + var preferredPlacement = state.options.placement; + var basePlacement = getBasePlacement(preferredPlacement); + var isBasePlacement = basePlacement === preferredPlacement; + var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); + var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { + return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { + placement: placement2, + boundary, + rootBoundary, + padding, + flipVariations, + allowedAutoPlacements + }) : placement2); + }, []); + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var checksMap = /* @__PURE__ */ new Map(); + var makeFallbackChecks = true; + var firstFittingPlacement = placements2[0]; + for (var i2 = 0; i2 < placements2.length; i2++) { + var placement = placements2[i2]; + var _basePlacement = getBasePlacement(placement); + var isStartVariation = getVariation(placement) === start; + var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; + var len = isVertical ? "width" : "height"; + var overflow = detectOverflow(state, { + placement, + boundary, + rootBoundary, + altBoundary, + padding }); + var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; + if (referenceRect[len] > popperRect[len]) { + mainVariationSide = getOppositePlacement(mainVariationSide); + } + var altVariationSide = getOppositePlacement(mainVariationSide); + var checks = []; + if (checkMainAxis) { + checks.push(overflow[_basePlacement] <= 0); + } + if (checkAltAxis) { + checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + } + if (checks.every(function(check) { + return check; + })) { + firstFittingPlacement = placement; + makeFallbackChecks = false; + break; + } + checksMap.set(placement, checks); } - if (resize) { - window2.removeEventListener("resize", instance.update, passive); + if (makeFallbackChecks) { + var numberOfChecks = flipVariations ? 3 : 1; + var _loop = function _loop2(_i2) { + var fittingPlacement = placements2.find(function(placement2) { + var checks2 = checksMap.get(placement2); + if (checks2) { + return checks2.slice(0, _i2).every(function(check) { + return check; + }); + } + }); + if (fittingPlacement) { + firstFittingPlacement = fittingPlacement; + return "break"; + } + }; + for (var _i = numberOfChecks; _i > 0; _i--) { + var _ret = _loop(_i); + if (_ret === "break") + break; + } } - }; - } - var eventListeners_default = { - name: "eventListeners", - enabled: true, - phase: "write", - fn: function fn() { - }, - effect: effect5, - data: {} - }; - - // ../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js - var hash = { - left: "right", - right: "left", - bottom: "top", - top: "bottom" - }; - function getOppositePlacement(placement) { - return placement.replace(/left|right|bottom|top/g, function(matched) { - return hash[matched]; - }); - } - - // ../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js - var hash2 = { - start: "end", - end: "start" - }; - function getOppositeVariationPlacement(placement) { - return placement.replace(/start|end/g, function(matched) { - return hash2[matched]; - }); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js - function getWindowScroll(node) { - var win = getWindow(node); - var scrollLeft = win.pageXOffset; - var scrollTop = win.pageYOffset; - return { - scrollLeft, - scrollTop - }; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js - function getWindowScrollBarX(element) { - return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js - function getViewportRect(element, strategy) { - var win = getWindow(element); - var html = getDocumentElement(element); - var visualViewport = win.visualViewport; - var width = html.clientWidth; - var height = html.clientHeight; - var x3 = 0; - var y3 = 0; - if (visualViewport) { - width = visualViewport.width; - height = visualViewport.height; - var layoutViewport = isLayoutViewport(); - if (layoutViewport || !layoutViewport && strategy === "fixed") { - x3 = visualViewport.offsetLeft; - y3 = visualViewport.offsetTop; + if (state.placement !== firstFittingPlacement) { + state.modifiersData[name]._skip = true; + state.placement = firstFittingPlacement; + state.reset = true; } } - return { - width, - height, - x: x3 + getWindowScrollBarX(element), - y: y3 - }; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js - function getDocumentRect(element) { - var _element$ownerDocumen; - var html = getDocumentElement(element); - var winScroll = getWindowScroll(element); - var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body; - var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0); - var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0); - var x3 = -winScroll.scrollLeft + getWindowScrollBarX(element); - var y3 = -winScroll.scrollTop; - if (getComputedStyle2(body || html).direction === "rtl") { - x3 += max(html.clientWidth, body ? body.clientWidth : 0) - width; - } - return { - width, - height, - x: x3, - y: y3 - }; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js - function isScrollParent(element) { - var _getComputedStyle = getComputedStyle2(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY; - return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js - function getScrollParent(node) { - if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) { - return node.ownerDocument.body; - } - if (isHTMLElement(node) && isScrollParent(node)) { - return node; - } - return getScrollParent(getParentNode(node)); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js - function listScrollParents(element, list) { - var _element$ownerDocumen; - if (list === void 0) { - list = []; - } - var scrollParent = getScrollParent(element); - var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body); - var win = getWindow(scrollParent); - var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent; - var updatedList = list.concat(target); - return isBody ? updatedList : ( - // $FlowFixMe[incompatible-call]: isBody tells us target will be an HTMLElement here - updatedList.concat(listScrollParents(getParentNode(target))) - ); - } - - // ../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js - function rectToClientRect(rect) { - return Object.assign({}, rect, { - left: rect.x, - top: rect.y, - right: rect.x + rect.width, - bottom: rect.y + rect.height - }); - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js - function getInnerBoundingClientRect(element, strategy) { - var rect = getBoundingClientRect(element, false, strategy === "fixed"); - rect.top = rect.top + element.clientTop; - rect.left = rect.left + element.clientLeft; - rect.bottom = rect.top + element.clientHeight; - rect.right = rect.left + element.clientWidth; - rect.width = element.clientWidth; - rect.height = element.clientHeight; - rect.x = rect.left; - rect.y = rect.top; - return rect; - } - function getClientRectFromMixedType(element, clippingParent, strategy) { - return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element))); - } - function getClippingParents(element) { - var clippingParents2 = listScrollParents(getParentNode(element)); - var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle2(element).position) >= 0; - var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element; - if (!isElement(clipperElement)) { - return []; - } - return clippingParents2.filter(function(clippingParent) { - return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body"; - }); - } - function getClippingRect(element, boundary, rootBoundary, strategy) { - var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary); - var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]); - var firstClippingParent = clippingParents2[0]; - var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) { - var rect = getClientRectFromMixedType(element, clippingParent, strategy); - accRect.top = max(rect.top, accRect.top); - accRect.right = min(rect.right, accRect.right); - accRect.bottom = min(rect.bottom, accRect.bottom); - accRect.left = max(rect.left, accRect.left); - return accRect; - }, getClientRectFromMixedType(element, firstClippingParent, strategy)); - clippingRect.width = clippingRect.right - clippingRect.left; - clippingRect.height = clippingRect.bottom - clippingRect.top; - clippingRect.x = clippingRect.left; - clippingRect.y = clippingRect.top; - return clippingRect; - } - - // ../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js - function computeOffsets(_ref) { - var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement; - var basePlacement = placement ? getBasePlacement(placement) : null; - var variation = placement ? getVariation(placement) : null; - var commonX = reference2.x + reference2.width / 2 - element.width / 2; - var commonY = reference2.y + reference2.height / 2 - element.height / 2; - var offsets; - switch (basePlacement) { - case top: - offsets = { - x: commonX, - y: reference2.y - element.height - }; - break; - case bottom: - offsets = { - x: commonX, - y: reference2.y + reference2.height - }; - break; - case right: - offsets = { - x: reference2.x + reference2.width, - y: commonY - }; - break; - case left: - offsets = { - x: reference2.x - element.width, - y: commonY - }; - break; - default: - offsets = { - x: reference2.x, - y: reference2.y - }; - } - var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null; - if (mainAxis != null) { - var len = mainAxis === "y" ? "height" : "width"; - switch (variation) { - case start2: - offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2); - break; - case end: - offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2); - break; - default: + var flip$1 = { + name: "flip", + enabled: true, + phase: "main", + fn: flip, + requiresIfExists: ["offset"], + data: { + _skip: false } - } - return offsets; - } - - // ../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js - function detectOverflow(state, options) { - if (options === void 0) { - options = {}; - } - var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding; - var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); - var altContext = elementContext === popper ? reference : popper; - var popperRect = state.rects.popper; - var element = state.elements[altBoundary ? altContext : elementContext]; - var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy); - var referenceClientRect = getBoundingClientRect(state.elements.reference); - var popperOffsets2 = computeOffsets({ - reference: referenceClientRect, - element: popperRect, - strategy: "absolute", - placement - }); - var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2)); - var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect; - var overflowOffsets = { - top: clippingClientRect.top - elementClientRect.top + paddingObject.top, - bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom, - left: clippingClientRect.left - elementClientRect.left + paddingObject.left, - right: elementClientRect.right - clippingClientRect.right + paddingObject.right }; - var offsetData = state.modifiersData.offset; - if (elementContext === popper && offsetData) { - var offset2 = offsetData[placement]; - Object.keys(overflowOffsets).forEach(function(key) { - var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1; - var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x"; - overflowOffsets[key] += offset2[axis] * multiply; - }); + function getAltAxis(axis) { + return axis === "x" ? "y" : "x"; } - return overflowOffsets; - } - - // ../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js - function computeAutoPlacement(state, options) { - if (options === void 0) { - options = {}; + function within(min$1, value, max$1) { + return max(min$1, min(value, max$1)); } - var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP; - var variation = getVariation(placement); - var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) { - return getVariation(placement2) === variation; - }) : basePlacements; - var allowedPlacements = placements2.filter(function(placement2) { - return allowedAutoPlacements.indexOf(placement2) >= 0; - }); - if (allowedPlacements.length === 0) { - allowedPlacements = placements2; + function withinMaxClamp(min2, value, max2) { + var v2 = within(min2, value, max2); + return v2 > max2 ? max2 : v2; } - var overflows = allowedPlacements.reduce(function(acc, placement2) { - acc[placement2] = detectOverflow(state, { - placement: placement2, - boundary, - rootBoundary, - padding - })[getBasePlacement(placement2)]; - return acc; - }, {}); - return Object.keys(overflows).sort(function(a3, b3) { - return overflows[a3] - overflows[b3]; - }); - } - - // ../../../node_modules/@popperjs/core/lib/modifiers/flip.js - function getExpandedFallbackPlacements(placement) { - if (getBasePlacement(placement) === auto) { - return []; - } - var oppositePlacement = getOppositePlacement(placement); - return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)]; - } - function flip(_ref) { - var state = _ref.state, options = _ref.options, name = _ref.name; - if (state.modifiersData[name]._skip) { - return; - } - var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements; - var preferredPlacement = state.options.placement; - var basePlacement = getBasePlacement(preferredPlacement); - var isBasePlacement = basePlacement === preferredPlacement; - var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement)); - var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) { - return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, { - placement: placement2, - boundary, - rootBoundary, - padding, - flipVariations, - allowedAutoPlacements - }) : placement2); - }, []); - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var checksMap = /* @__PURE__ */ new Map(); - var makeFallbackChecks = true; - var firstFittingPlacement = placements2[0]; - for (var i3 = 0; i3 < placements2.length; i3++) { - var placement = placements2[i3]; - var _basePlacement = getBasePlacement(placement); - var isStartVariation = getVariation(placement) === start2; - var isVertical = [top, bottom].indexOf(_basePlacement) >= 0; - var len = isVertical ? "width" : "height"; + function preventOverflow(_ref) { + var state = _ref.state, options = _ref.options, name = _ref.name; + var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; var overflow = detectOverflow(state, { - placement, boundary, rootBoundary, - altBoundary, - padding + padding, + altBoundary }); - var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top; - if (referenceRect[len] > popperRect[len]) { - mainVariationSide = getOppositePlacement(mainVariationSide); + var basePlacement = getBasePlacement(state.placement); + var variation = getVariation(state.placement); + var isBasePlacement = !variation; + var mainAxis = getMainAxisFromPlacement(basePlacement); + var altAxis = getAltAxis(mainAxis); + var popperOffsets2 = state.modifiersData.popperOffsets; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { + placement: state.placement + })) : tetherOffset; + var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { + mainAxis: tetherOffsetValue, + altAxis: tetherOffsetValue + } : Object.assign({ + mainAxis: 0, + altAxis: 0 + }, tetherOffsetValue); + var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; + var data = { + x: 0, + y: 0 + }; + if (!popperOffsets2) { + return; } - var altVariationSide = getOppositePlacement(mainVariationSide); - var checks = []; if (checkMainAxis) { - checks.push(overflow[_basePlacement] <= 0); + var _offsetModifierState$; + var mainSide = mainAxis === "y" ? top : left; + var altSide = mainAxis === "y" ? bottom : right; + var len = mainAxis === "y" ? "height" : "width"; + var offset2 = popperOffsets2[mainAxis]; + var min$1 = offset2 + overflow[mainSide]; + var max$1 = offset2 - overflow[altSide]; + var additive = tether ? -popperRect[len] / 2 : 0; + var minLen = variation === start ? referenceRect[len] : popperRect[len]; + var maxLen = variation === start ? -popperRect[len] : -referenceRect[len]; + var arrowElement = state.elements.arrow; + var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { + width: 0, + height: 0 + }; + var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); + var arrowPaddingMin = arrowPaddingObject[mainSide]; + var arrowPaddingMax = arrowPaddingObject[altSide]; + var arrowLen = within(0, referenceRect[len], arrowRect[len]); + var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; + var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; + var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); + var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; + var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; + var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; + var tetherMax = offset2 + maxOffset - offsetModifierValue; + var preventedOffset = within(tether ? min(min$1, tetherMin) : min$1, offset2, tether ? max(max$1, tetherMax) : max$1); + popperOffsets2[mainAxis] = preventedOffset; + data[mainAxis] = preventedOffset - offset2; } if (checkAltAxis) { - checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0); + var _offsetModifierState$2; + var _mainSide = mainAxis === "x" ? top : left; + var _altSide = mainAxis === "x" ? bottom : right; + var _offset = popperOffsets2[altAxis]; + var _len = altAxis === "y" ? "height" : "width"; + var _min = _offset + overflow[_mainSide]; + var _max = _offset - overflow[_altSide]; + var isOriginSide = [top, left].indexOf(basePlacement) !== -1; + var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; + var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; + var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; + var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); + popperOffsets2[altAxis] = _preventedOffset; + data[altAxis] = _preventedOffset - _offset; } - if (checks.every(function(check) { - return check; - })) { - firstFittingPlacement = placement; - makeFallbackChecks = false; - break; + state.modifiersData[name] = data; + } + var preventOverflow$1 = { + name: "preventOverflow", + enabled: true, + phase: "main", + fn: preventOverflow, + requiresIfExists: ["offset"] + }; + var toPaddingObject = function toPaddingObject2(padding, state) { + padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, { + placement: state.placement + })) : padding; + return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements)); + }; + function arrow(_ref) { + var _state$modifiersData$; + var state = _ref.state, name = _ref.name, options = _ref.options; + var arrowElement = state.elements.arrow; + var popperOffsets2 = state.modifiersData.popperOffsets; + var basePlacement = getBasePlacement(state.placement); + var axis = getMainAxisFromPlacement(basePlacement); + var isVertical = [left, right].indexOf(basePlacement) >= 0; + var len = isVertical ? "height" : "width"; + if (!arrowElement || !popperOffsets2) { + return; } - checksMap.set(placement, checks); + var paddingObject = toPaddingObject(options.padding, state); + var arrowRect = getLayoutRect(arrowElement); + var minProp = axis === "y" ? top : left; + var maxProp = axis === "y" ? bottom : right; + var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len]; + var startDiff = popperOffsets2[axis] - state.rects.reference[axis]; + var arrowOffsetParent = getOffsetParent(arrowElement); + var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0; + var centerToReference = endDiff / 2 - startDiff / 2; + var min2 = paddingObject[minProp]; + var max2 = clientSize - arrowRect[len] - paddingObject[maxProp]; + var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference; + var offset2 = within(min2, center, max2); + var axisProp = axis; + state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$); } - if (makeFallbackChecks) { - var numberOfChecks = flipVariations ? 3 : 1; - var _loop = function _loop2(_i2) { - var fittingPlacement = placements2.find(function(placement2) { - var checks2 = checksMap.get(placement2); - if (checks2) { - return checks2.slice(0, _i2).every(function(check) { - return check; - }); - } - }); - if (fittingPlacement) { - firstFittingPlacement = fittingPlacement; - return "break"; + function effect(_ref2) { + var state = _ref2.state, options = _ref2.options; + var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element; + if (arrowElement == null) { + return; + } + if (typeof arrowElement === "string") { + arrowElement = state.elements.popper.querySelector(arrowElement); + if (!arrowElement) { + return; } - }; - for (var _i = numberOfChecks; _i > 0; _i--) { - var _ret = _loop(_i); - if (_ret === "break") - break; } + if (!contains(state.elements.popper, arrowElement)) { + return; + } + state.elements.arrow = arrowElement; } - if (state.placement !== firstFittingPlacement) { - state.modifiersData[name]._skip = true; - state.placement = firstFittingPlacement; - state.reset = true; + var arrow$1 = { + name: "arrow", + enabled: true, + phase: "main", + fn: arrow, + effect, + requires: ["popperOffsets"], + requiresIfExists: ["preventOverflow"] + }; + function getSideOffsets(overflow, rect, preventedOffsets) { + if (preventedOffsets === void 0) { + preventedOffsets = { + x: 0, + y: 0 + }; + } + return { + top: overflow.top - rect.height - preventedOffsets.y, + right: overflow.right - rect.width + preventedOffsets.x, + bottom: overflow.bottom - rect.height + preventedOffsets.y, + left: overflow.left - rect.width - preventedOffsets.x + }; } - } - var flip_default = { - name: "flip", - enabled: true, - phase: "main", - fn: flip, - requiresIfExists: ["offset"], - data: { - _skip: false + function isAnySideFullyClipped(overflow) { + return [top, right, bottom, left].some(function(side) { + return overflow[side] >= 0; + }); } - }; - - // ../../../node_modules/@popperjs/core/lib/modifiers/hide.js - function getSideOffsets(overflow, rect, preventedOffsets) { - if (preventedOffsets === void 0) { - preventedOffsets = { - x: 0, - y: 0 + function hide(_ref) { + var state = _ref.state, name = _ref.name; + var referenceRect = state.rects.reference; + var popperRect = state.rects.popper; + var preventedOffsets = state.modifiersData.preventOverflow; + var referenceOverflow = detectOverflow(state, { + elementContext: "reference" + }); + var popperAltOverflow = detectOverflow(state, { + altBoundary: true + }); + var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); + var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); + var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); + var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); + state.modifiersData[name] = { + referenceClippingOffsets, + popperEscapeOffsets, + isReferenceHidden, + hasPopperEscaped }; + state.attributes.popper = Object.assign({}, state.attributes.popper, { + "data-popper-reference-hidden": isReferenceHidden, + "data-popper-escaped": hasPopperEscaped + }); } - return { - top: overflow.top - rect.height - preventedOffsets.y, - right: overflow.right - rect.width + preventedOffsets.x, - bottom: overflow.bottom - rect.height + preventedOffsets.y, - left: overflow.left - rect.width - preventedOffsets.x + var hide$1 = { + name: "hide", + enabled: true, + phase: "main", + requiresIfExists: ["preventOverflow"], + fn: hide }; - } - function isAnySideFullyClipped(overflow) { - return [top, right, bottom, left].some(function(side) { - return overflow[side] >= 0; + var defaultModifiers$1 = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1]; + var createPopper$1 = /* @__PURE__ */ popperGenerator({ + defaultModifiers: defaultModifiers$1 }); - } - function hide(_ref) { - var state = _ref.state, name = _ref.name; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var preventedOffsets = state.modifiersData.preventOverflow; - var referenceOverflow = detectOverflow(state, { - elementContext: "reference" + var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$1, flip$1, preventOverflow$1, arrow$1, hide$1]; + var createPopper = /* @__PURE__ */ popperGenerator({ + defaultModifiers }); - var popperAltOverflow = detectOverflow(state, { - altBoundary: true - }); - var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect); - var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets); - var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets); - var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets); - state.modifiersData[name] = { - referenceClippingOffsets, - popperEscapeOffsets, - isReferenceHidden, - hasPopperEscaped - }; - state.attributes.popper = Object.assign({}, state.attributes.popper, { - "data-popper-reference-hidden": isReferenceHidden, - "data-popper-escaped": hasPopperEscaped - }); + exports.applyStyles = applyStyles$1; + exports.arrow = arrow$1; + exports.computeStyles = computeStyles$1; + exports.createPopper = createPopper; + exports.createPopperLite = createPopper$1; + exports.defaultModifiers = defaultModifiers; + exports.detectOverflow = detectOverflow; + exports.eventListeners = eventListeners; + exports.flip = flip$1; + exports.hide = hide$1; + exports.offset = offset$1; + exports.popperGenerator = popperGenerator; + exports.popperOffsets = popperOffsets$1; + exports.preventOverflow = preventOverflow$1; } - var hide_default = { - name: "hide", - enabled: true, - phase: "main", - requiresIfExists: ["preventOverflow"], - fn: hide - }; +}); - // ../../../node_modules/@popperjs/core/lib/modifiers/offset.js - function distanceAndSkiddingToXY(placement, rects, offset2) { - var basePlacement = getBasePlacement(placement); - var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1; - var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, { - placement - })) : offset2, skidding = _ref[0], distance = _ref[1]; - skidding = skidding || 0; - distance = (distance || 0) * invertDistance; - return [left, right].indexOf(basePlacement) >= 0 ? { - x: distance, - y: skidding - } : { - x: skidding, - y: distance +// ../../../node_modules/tippy.js/dist/tippy.cjs.js +var require_tippy_cjs = __commonJS({ + "../../../node_modules/tippy.js/dist/tippy.cjs.js"(exports) { + "use strict"; + Object.defineProperty(exports, "__esModule", { value: true }); + var core = require_popper(); + var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>'; + var BOX_CLASS = "tippy-box"; + var CONTENT_CLASS = "tippy-content"; + var BACKDROP_CLASS = "tippy-backdrop"; + var ARROW_CLASS = "tippy-arrow"; + var SVG_ARROW_CLASS = "tippy-svg-arrow"; + var TOUCH_OPTIONS = { + passive: true, + capture: true }; - } - function offset(_ref2) { - var state = _ref2.state, options = _ref2.options, name = _ref2.name; - var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset; - var data2 = placements.reduce(function(acc, placement) { - acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2); - return acc; - }, {}); - var _data$state$placement = data2[state.placement], x3 = _data$state$placement.x, y3 = _data$state$placement.y; - if (state.modifiersData.popperOffsets != null) { - state.modifiersData.popperOffsets.x += x3; - state.modifiersData.popperOffsets.y += y3; - } - state.modifiersData[name] = data2; - } - var offset_default = { - name: "offset", - enabled: true, - phase: "main", - requires: ["popperOffsets"], - fn: offset - }; - - // ../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js - function popperOffsets(_ref) { - var state = _ref.state, name = _ref.name; - state.modifiersData[name] = computeOffsets({ - reference: state.rects.reference, - element: state.rects.popper, - strategy: "absolute", - placement: state.placement - }); - } - var popperOffsets_default = { - name: "popperOffsets", - enabled: true, - phase: "read", - fn: popperOffsets, - data: {} - }; - - // ../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js - function getAltAxis(axis) { - return axis === "x" ? "y" : "x"; - } - - // ../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js - function preventOverflow(_ref) { - var state = _ref.state, options = _ref.options, name = _ref.name; - var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset; - var overflow = detectOverflow(state, { - boundary, - rootBoundary, - padding, - altBoundary - }); - var basePlacement = getBasePlacement(state.placement); - var variation = getVariation(state.placement); - var isBasePlacement = !variation; - var mainAxis = getMainAxisFromPlacement(basePlacement); - var altAxis = getAltAxis(mainAxis); - var popperOffsets2 = state.modifiersData.popperOffsets; - var referenceRect = state.rects.reference; - var popperRect = state.rects.popper; - var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, { - placement: state.placement - })) : tetherOffset; - var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? { - mainAxis: tetherOffsetValue, - altAxis: tetherOffsetValue - } : Object.assign({ - mainAxis: 0, - altAxis: 0 - }, tetherOffsetValue); - var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null; - var data2 = { - x: 0, - y: 0 + var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() { + return document.body; }; - if (!popperOffsets2) { - return; + function hasOwnProperty(obj, key) { + return {}.hasOwnProperty.call(obj, key); } - if (checkMainAxis) { - var _offsetModifierState$; - var mainSide = mainAxis === "y" ? top : left; - var altSide = mainAxis === "y" ? bottom : right; - var len = mainAxis === "y" ? "height" : "width"; - var offset2 = popperOffsets2[mainAxis]; - var min2 = offset2 + overflow[mainSide]; - var max2 = offset2 - overflow[altSide]; - var additive = tether ? -popperRect[len] / 2 : 0; - var minLen = variation === start2 ? referenceRect[len] : popperRect[len]; - var maxLen = variation === start2 ? -popperRect[len] : -referenceRect[len]; - var arrowElement = state.elements.arrow; - var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : { - width: 0, - height: 0 + function getValueAtIndexOrReturn(value, index, defaultValue) { + if (Array.isArray(value)) { + var v2 = value[index]; + return v2 == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v2; + } + return value; + } + function isType(value, type) { + var str = {}.toString.call(value); + return str.indexOf("[object") === 0 && str.indexOf(type + "]") > -1; + } + function invokeWithArgsOrReturn(value, args) { + return typeof value === "function" ? value.apply(void 0, args) : value; + } + function debounce(fn, ms) { + if (ms === 0) { + return fn; + } + var timeout; + return function(arg) { + clearTimeout(timeout); + timeout = setTimeout(function() { + fn(arg); + }, ms); }; - var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject(); - var arrowPaddingMin = arrowPaddingObject[mainSide]; - var arrowPaddingMax = arrowPaddingObject[altSide]; - var arrowLen = within(0, referenceRect[len], arrowRect[len]); - var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis; - var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis; - var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow); - var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0; - var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0; - var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset; - var tetherMax = offset2 + maxOffset - offsetModifierValue; - var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2); - popperOffsets2[mainAxis] = preventedOffset; - data2[mainAxis] = preventedOffset - offset2; } - if (checkAltAxis) { - var _offsetModifierState$2; - var _mainSide = mainAxis === "x" ? top : left; - var _altSide = mainAxis === "x" ? bottom : right; - var _offset = popperOffsets2[altAxis]; - var _len = altAxis === "y" ? "height" : "width"; - var _min = _offset + overflow[_mainSide]; - var _max = _offset - overflow[_altSide]; - var isOriginSide = [top, left].indexOf(basePlacement) !== -1; - var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0; - var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis; - var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max; - var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max); - popperOffsets2[altAxis] = _preventedOffset; - data2[altAxis] = _preventedOffset - _offset; + function removeProperties(obj, keys) { + var clone = Object.assign({}, obj); + keys.forEach(function(key) { + delete clone[key]; + }); + return clone; } - state.modifiersData[name] = data2; - } - var preventOverflow_default = { - name: "preventOverflow", - enabled: true, - phase: "main", - fn: preventOverflow, - requiresIfExists: ["offset"] - }; - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js - function getHTMLElementScroll(element) { - return { - scrollLeft: element.scrollLeft, - scrollTop: element.scrollTop - }; - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js - function getNodeScroll(node) { - if (node === getWindow(node) || !isHTMLElement(node)) { - return getWindowScroll(node); - } else { - return getHTMLElementScroll(node); + function splitBySpaces(value) { + return value.split(/\s+/).filter(Boolean); } - } - - // ../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js - function isElementScaled(element) { - var rect = element.getBoundingClientRect(); - var scaleX = round(rect.width) / element.offsetWidth || 1; - var scaleY = round(rect.height) / element.offsetHeight || 1; - return scaleX !== 1 || scaleY !== 1; - } - function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) { - if (isFixed === void 0) { - isFixed = false; + function normalizeToArray(value) { + return [].concat(value); } - var isOffsetParentAnElement = isHTMLElement(offsetParent); - var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent); - var documentElement = getDocumentElement(offsetParent); - var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed); - var scroll = { - scrollLeft: 0, - scrollTop: 0 - }; - var offsets = { - x: 0, - y: 0 - }; - if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { - if (getNodeName(offsetParent) !== "body" || // https://github.com/popperjs/popper-core/issues/1078 - isScrollParent(documentElement)) { - scroll = getNodeScroll(offsetParent); + function pushIfUnique(arr, value) { + if (arr.indexOf(value) === -1) { + arr.push(value); } - if (isHTMLElement(offsetParent)) { - offsets = getBoundingClientRect(offsetParent, true); - offsets.x += offsetParent.clientLeft; - offsets.y += offsetParent.clientTop; - } else if (documentElement) { - offsets.x = getWindowScrollBarX(documentElement); - } } - return { - x: rect.left + scroll.scrollLeft - offsets.x, - y: rect.top + scroll.scrollTop - offsets.y, - width: rect.width, - height: rect.height - }; - } - - // ../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js - function order(modifiers) { - var map = /* @__PURE__ */ new Map(); - var visited = /* @__PURE__ */ new Set(); - var result = []; - modifiers.forEach(function(modifier) { - map.set(modifier.name, modifier); - }); - function sort(modifier) { - visited.add(modifier.name); - var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []); - requires.forEach(function(dep) { - if (!visited.has(dep)) { - var depModifier = map.get(dep); - if (depModifier) { - sort(depModifier); - } - } + function unique(arr) { + return arr.filter(function(item, index) { + return arr.indexOf(item) === index; }); - result.push(modifier); } - modifiers.forEach(function(modifier) { - if (!visited.has(modifier.name)) { - sort(modifier); - } - }); - return result; - } - function orderModifiers(modifiers) { - var orderedModifiers = order(modifiers); - return modifierPhases.reduce(function(acc, phase) { - return acc.concat(orderedModifiers.filter(function(modifier) { - return modifier.phase === phase; - })); - }, []); - } - - // ../../../node_modules/@popperjs/core/lib/utils/debounce.js - function debounce2(fn3) { - var pending; - return function() { - if (!pending) { - pending = new Promise(function(resolve) { - Promise.resolve().then(function() { - pending = void 0; - resolve(fn3()); - }); - }); - } - return pending; - }; - } - - // ../../../node_modules/@popperjs/core/lib/utils/mergeByName.js - function mergeByName(modifiers) { - var merged = modifiers.reduce(function(merged2, current) { - var existing = merged2[current.name]; - merged2[current.name] = existing ? Object.assign({}, existing, current, { - options: Object.assign({}, existing.options, current.options), - data: Object.assign({}, existing.data, current.data) - }) : current; - return merged2; - }, {}); - return Object.keys(merged).map(function(key) { - return merged[key]; - }); - } - - // ../../../node_modules/@popperjs/core/lib/createPopper.js - var DEFAULT_OPTIONS = { - placement: "bottom", - modifiers: [], - strategy: "absolute" - }; - function areValidElements() { - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { - args[_key] = arguments[_key]; + function getBasePlacement(placement) { + return placement.split("-")[0]; } - return !args.some(function(element) { - return !(element && typeof element.getBoundingClientRect === "function"); - }); - } - function popperGenerator(generatorOptions) { - if (generatorOptions === void 0) { - generatorOptions = {}; + function arrayFrom(value) { + return [].slice.call(value); } - var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2; - return function createPopper2(reference2, popper2, options) { - if (options === void 0) { - options = defaultOptions; - } - var state = { - placement: "bottom", - orderedModifiers: [], - options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions), - modifiersData: {}, - elements: { - reference: reference2, - popper: popper2 - }, - attributes: {}, - styles: {} - }; - var effectCleanupFns = []; - var isDestroyed = false; - var instance = { - state, - setOptions: function setOptions(setOptionsAction) { - var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction; - cleanupModifierEffects(); - state.options = Object.assign({}, defaultOptions, state.options, options2); - state.scrollParents = { - reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [], - popper: listScrollParents(popper2) - }; - var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers))); - state.orderedModifiers = orderedModifiers.filter(function(m3) { - return m3.enabled; - }); - runModifierEffects(); - return instance.update(); - }, - // Sync update – it will always be executed, even if not necessary. This - // is useful for low frequency updates where sync behavior simplifies the - // logic. - // For high frequency updates (e.g. `resize` and `scroll` events), always - // prefer the async Popper#update method - forceUpdate: function forceUpdate() { - if (isDestroyed) { - return; - } - var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper; - if (!areValidElements(reference3, popper3)) { - return; - } - state.rects = { - reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"), - popper: getLayoutRect(popper3) - }; - state.reset = false; - state.placement = state.options.placement; - state.orderedModifiers.forEach(function(modifier) { - return state.modifiersData[modifier.name] = Object.assign({}, modifier.data); - }); - for (var index = 0; index < state.orderedModifiers.length; index++) { - if (state.reset === true) { - state.reset = false; - index = -1; - continue; - } - var _state$orderedModifie = state.orderedModifiers[index], fn3 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name; - if (typeof fn3 === "function") { - state = fn3({ - state, - options: _options, - name, - instance - }) || state; - } - } - }, - // Async and optimistically optimized update – it will not be executed if - // not necessary (debounced to run at most once-per-tick) - update: debounce2(function() { - return new Promise(function(resolve) { - instance.forceUpdate(); - resolve(state); - }); - }), - destroy: function destroy() { - cleanupModifierEffects(); - isDestroyed = true; + function removeUndefinedProps(obj) { + return Object.keys(obj).reduce(function(acc, key) { + if (obj[key] !== void 0) { + acc[key] = obj[key]; } - }; - if (!areValidElements(reference2, popper2)) { - return instance; - } - instance.setOptions(options).then(function(state2) { - if (!isDestroyed && options.onFirstUpdate) { - options.onFirstUpdate(state2); - } - }); - function runModifierEffects() { - state.orderedModifiers.forEach(function(_ref) { - var name = _ref.name, _ref$options = _ref.options, options2 = _ref$options === void 0 ? {} : _ref$options, effect7 = _ref.effect; - if (typeof effect7 === "function") { - var cleanupFn = effect7({ - state, - name, - instance, - options: options2 - }); - var noopFn = function noopFn2() { - }; - effectCleanupFns.push(cleanupFn || noopFn); - } - }); - } - function cleanupModifierEffects() { - effectCleanupFns.forEach(function(fn3) { - return fn3(); - }); - effectCleanupFns = []; - } - return instance; - }; - } - - // ../../../node_modules/@popperjs/core/lib/popper.js - var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default]; - var createPopper = /* @__PURE__ */ popperGenerator({ - defaultModifiers - }); - - // ../../../node_modules/tippy.js/dist/tippy.esm.js - var ROUND_ARROW = '<svg width="16" height="6" xmlns="http://www.w3.org/2000/svg"><path d="M0 6s1.796-.013 4.67-3.615C5.851.9 6.93.006 8 0c1.07-.006 2.148.887 3.343 2.385C14.233 6.005 16 6 16 6H0z"></svg>'; - var BOX_CLASS = "tippy-box"; - var CONTENT_CLASS = "tippy-content"; - var BACKDROP_CLASS = "tippy-backdrop"; - var ARROW_CLASS = "tippy-arrow"; - var SVG_ARROW_CLASS = "tippy-svg-arrow"; - var TOUCH_OPTIONS = { - passive: true, - capture: true - }; - var TIPPY_DEFAULT_APPEND_TO = function TIPPY_DEFAULT_APPEND_TO2() { - return document.body; - }; - function hasOwnProperty2(obj, key) { - return {}.hasOwnProperty.call(obj, key); - } - function getValueAtIndexOrReturn(value, index, defaultValue) { - if (Array.isArray(value)) { - var v3 = value[index]; - return v3 == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v3; + return acc; + }, {}); } - return value; - } - function isType(value, type) { - var str = {}.toString.call(value); - return str.indexOf("[object") === 0 && str.indexOf(type + "]") > -1; - } - function invokeWithArgsOrReturn(value, args) { - return typeof value === "function" ? value.apply(void 0, args) : value; - } - function debounce3(fn3, ms) { - if (ms === 0) { - return fn3; + function div() { + return document.createElement("div"); } - var timeout; - return function(arg) { - clearTimeout(timeout); - timeout = setTimeout(function() { - fn3(arg); - }, ms); - }; - } - function removeProperties(obj, keys) { - var clone2 = Object.assign({}, obj); - keys.forEach(function(key) { - delete clone2[key]; - }); - return clone2; - } - function splitBySpaces(value) { - return value.split(/\s+/).filter(Boolean); - } - function normalizeToArray(value) { - return [].concat(value); - } - function pushIfUnique(arr, value) { - if (arr.indexOf(value) === -1) { - arr.push(value); + function isElement(value) { + return ["Element", "Fragment"].some(function(type) { + return isType(value, type); + }); } - } - function unique(arr) { - return arr.filter(function(item, index) { - return arr.indexOf(item) === index; - }); - } - function getBasePlacement2(placement) { - return placement.split("-")[0]; - } - function arrayFrom(value) { - return [].slice.call(value); - } - function removeUndefinedProps(obj) { - return Object.keys(obj).reduce(function(acc, key) { - if (obj[key] !== void 0) { - acc[key] = obj[key]; - } - return acc; - }, {}); - } - function div() { - return document.createElement("div"); - } - function isElement2(value) { - return ["Element", "Fragment"].some(function(type) { - return isType(value, type); - }); - } - function isNodeList(value) { - return isType(value, "NodeList"); - } - function isMouseEvent(value) { - return isType(value, "MouseEvent"); - } - function isReferenceElement(value) { - return !!(value && value._tippy && value._tippy.reference === value); - } - function getArrayOfElements(value) { - if (isElement2(value)) { - return [value]; + function isNodeList(value) { + return isType(value, "NodeList"); } - if (isNodeList(value)) { - return arrayFrom(value); + function isMouseEvent(value) { + return isType(value, "MouseEvent"); } - if (Array.isArray(value)) { - return value; + function isReferenceElement(value) { + return !!(value && value._tippy && value._tippy.reference === value); } - return arrayFrom(document.querySelectorAll(value)); - } - function setTransitionDuration(els, value) { - els.forEach(function(el) { - if (el) { - el.style.transitionDuration = value + "ms"; + function getArrayOfElements(value) { + if (isElement(value)) { + return [value]; } - }); - } - function setVisibilityState(els, state) { - els.forEach(function(el) { - if (el) { - el.setAttribute("data-state", state); + if (isNodeList(value)) { + return arrayFrom(value); } - }); - } - function getOwnerDocument(elementOrElements) { - var _element$ownerDocumen; - var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0]; - return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document; - } - function isCursorOutsideInteractiveBorder(popperTreeData, event) { - var clientX = event.clientX, clientY = event.clientY; - return popperTreeData.every(function(_ref) { - var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props; - var interactiveBorder = props.interactiveBorder; - var basePlacement = getBasePlacement2(popperState.placement); - var offsetData = popperState.modifiersData.offset; - if (!offsetData) { - return true; + if (Array.isArray(value)) { + return value; } - var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0; - var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0; - var leftDistance = basePlacement === "right" ? offsetData.left.x : 0; - var rightDistance = basePlacement === "left" ? offsetData.right.x : 0; - var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder; - var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder; - var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder; - var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder; - return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight; - }); - } - function updateTransitionEndListener(box, action, listener) { - var method = action + "EventListener"; - ["transitionend", "webkitTransitionEnd"].forEach(function(event) { - box[method](event, listener); - }); - } - function actualContains(parent, child) { - var target = child; - while (target) { - var _target$getRootNode; - if (parent.contains(target)) { - return true; - } - target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host; + return arrayFrom(document.querySelectorAll(value)); } - return false; - } - var currentInput = { - isTouch: false - }; - var lastMouseMoveTime = 0; - function onDocumentTouchStart() { - if (currentInput.isTouch) { - return; + function setTransitionDuration(els, value) { + els.forEach(function(el) { + if (el) { + el.style.transitionDuration = value + "ms"; + } + }); } - currentInput.isTouch = true; - if (window.performance) { - document.addEventListener("mousemove", onDocumentMouseMove); + function setVisibilityState(els, state) { + els.forEach(function(el) { + if (el) { + el.setAttribute("data-state", state); + } + }); } - } - function onDocumentMouseMove() { - var now = performance.now(); - if (now - lastMouseMoveTime < 20) { - currentInput.isTouch = false; - document.removeEventListener("mousemove", onDocumentMouseMove); + function getOwnerDocument(elementOrElements) { + var _element$ownerDocumen; + var _normalizeToArray = normalizeToArray(elementOrElements), element = _normalizeToArray[0]; + return element != null && (_element$ownerDocumen = element.ownerDocument) != null && _element$ownerDocumen.body ? element.ownerDocument : document; } - lastMouseMoveTime = now; - } - function onWindowBlur() { - var activeElement = document.activeElement; - if (isReferenceElement(activeElement)) { - var instance = activeElement._tippy; - if (activeElement.blur && !instance.state.isVisible) { - activeElement.blur(); - } + function isCursorOutsideInteractiveBorder(popperTreeData, event) { + var clientX = event.clientX, clientY = event.clientY; + return popperTreeData.every(function(_ref) { + var popperRect = _ref.popperRect, popperState = _ref.popperState, props = _ref.props; + var interactiveBorder = props.interactiveBorder; + var basePlacement = getBasePlacement(popperState.placement); + var offsetData = popperState.modifiersData.offset; + if (!offsetData) { + return true; + } + var topDistance = basePlacement === "bottom" ? offsetData.top.y : 0; + var bottomDistance = basePlacement === "top" ? offsetData.bottom.y : 0; + var leftDistance = basePlacement === "right" ? offsetData.left.x : 0; + var rightDistance = basePlacement === "left" ? offsetData.right.x : 0; + var exceedsTop = popperRect.top - clientY + topDistance > interactiveBorder; + var exceedsBottom = clientY - popperRect.bottom - bottomDistance > interactiveBorder; + var exceedsLeft = popperRect.left - clientX + leftDistance > interactiveBorder; + var exceedsRight = clientX - popperRect.right - rightDistance > interactiveBorder; + return exceedsTop || exceedsBottom || exceedsLeft || exceedsRight; + }); } - } - function bindGlobalEventListeners() { - document.addEventListener("touchstart", onDocumentTouchStart, TOUCH_OPTIONS); - window.addEventListener("blur", onWindowBlur); - } - var isBrowser = typeof window !== "undefined" && typeof document !== "undefined"; - var isIE11 = isBrowser ? ( - // @ts-ignore - !!window.msCrypto - ) : false; - function createMemoryLeakWarning(method) { - var txt = method === "destroy" ? "n already-" : " "; - return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" "); - } - function clean(value) { - var spacesAndTabs = /[ \t]{2,}/g; - var lineStartWithSpaces = /^[ \t]*/gm; - return value.replace(spacesAndTabs, " ").replace(lineStartWithSpaces, "").trim(); - } - function getDevMessage(message) { - return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\u{1F477}\u200D This is a development-only message. It will be removed in production.\n "); - } - function getFormattedMessage(message) { - return [ - getDevMessage(message), - // title - "color: #00C584; font-size: 1.3em; font-weight: bold;", - // message - "line-height: 1.5", - // footer - "color: #a6a095;" - ]; - } - var visitedMessages; - if (true) { - resetVisitedMessages(); - } - function resetVisitedMessages() { - visitedMessages = /* @__PURE__ */ new Set(); - } - function warnWhen(condition, message) { - if (condition && !visitedMessages.has(message)) { - var _console; - visitedMessages.add(message); - (_console = console).warn.apply(_console, getFormattedMessage(message)); + function updateTransitionEndListener(box, action, listener) { + var method = action + "EventListener"; + ["transitionend", "webkitTransitionEnd"].forEach(function(event) { + box[method](event, listener); + }); } - } - function errorWhen(condition, message) { - if (condition && !visitedMessages.has(message)) { - var _console2; - visitedMessages.add(message); - (_console2 = console).error.apply(_console2, getFormattedMessage(message)); - } - } - function validateTargets(targets) { - var didPassFalsyValue = !targets; - var didPassPlainObject = Object.prototype.toString.call(targets) === "[object Object]" && !targets.addEventListener; - errorWhen(didPassFalsyValue, ["tippy() was passed", "`" + String(targets) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")); - errorWhen(didPassPlainObject, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" ")); - } - var pluginProps = { - animateFill: false, - followCursor: false, - inlinePositioning: false, - sticky: false - }; - var renderProps = { - allowHTML: false, - animation: "fade", - arrow: true, - content: "", - inertia: false, - maxWidth: 350, - role: "tooltip", - theme: "", - zIndex: 9999 - }; - var defaultProps = Object.assign({ - appendTo: TIPPY_DEFAULT_APPEND_TO, - aria: { - content: "auto", - expanded: "auto" - }, - delay: 0, - duration: [300, 250], - getReferenceClientRect: null, - hideOnClick: true, - ignoreAttributes: false, - interactive: false, - interactiveBorder: 2, - interactiveDebounce: 0, - moveTransition: "", - offset: [0, 10], - onAfterUpdate: function onAfterUpdate() { - }, - onBeforeUpdate: function onBeforeUpdate() { - }, - onCreate: function onCreate() { - }, - onDestroy: function onDestroy() { - }, - onHidden: function onHidden() { - }, - onHide: function onHide() { - }, - onMount: function onMount() { - }, - onShow: function onShow() { - }, - onShown: function onShown() { - }, - onTrigger: function onTrigger() { - }, - onUntrigger: function onUntrigger() { - }, - onClickOutside: function onClickOutside() { - }, - placement: "top", - plugins: [], - popperOptions: {}, - render: null, - showOnCreate: false, - touch: true, - trigger: "mouseenter focus", - triggerTarget: null - }, pluginProps, renderProps); - var defaultKeys = Object.keys(defaultProps); - var setDefaultProps = function setDefaultProps2(partialProps) { - if (true) { - validateProps(partialProps, []); - } - var keys = Object.keys(partialProps); - keys.forEach(function(key) { - defaultProps[key] = partialProps[key]; - }); - }; - function getExtendedPassedProps(passedProps) { - var plugins = passedProps.plugins || []; - var pluginProps2 = plugins.reduce(function(acc, plugin2) { - var name = plugin2.name, defaultValue = plugin2.defaultValue; - if (name) { - var _name; - acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue; - } - return acc; - }, {}); - return Object.assign({}, passedProps, pluginProps2); - } - function getDataAttributeProps(reference2, plugins) { - var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, { - plugins - }))) : defaultKeys; - var props = propKeys.reduce(function(acc, key) { - var valueAsString = (reference2.getAttribute("data-tippy-" + key) || "").trim(); - if (!valueAsString) { - return acc; - } - if (key === "content") { - acc[key] = valueAsString; - } else { - try { - acc[key] = JSON.parse(valueAsString); - } catch (e3) { - acc[key] = valueAsString; + function actualContains(parent, child) { + var target = child; + while (target) { + var _target$getRootNode; + if (parent.contains(target)) { + return true; } + target = target.getRootNode == null ? void 0 : (_target$getRootNode = target.getRootNode()) == null ? void 0 : _target$getRootNode.host; } - return acc; - }, {}); - return props; - } - function evaluateProps(reference2, props) { - var out = Object.assign({}, props, { - content: invokeWithArgsOrReturn(props.content, [reference2]) - }, props.ignoreAttributes ? {} : getDataAttributeProps(reference2, props.plugins)); - out.aria = Object.assign({}, defaultProps.aria, out.aria); - out.aria = { - expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded, - content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content - }; - return out; - } - function validateProps(partialProps, plugins) { - if (partialProps === void 0) { - partialProps = {}; + return false; } - if (plugins === void 0) { - plugins = []; - } - var keys = Object.keys(partialProps); - keys.forEach(function(prop) { - var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps)); - var didPassUnknownProp = !hasOwnProperty2(nonPluginProps, prop); - if (didPassUnknownProp) { - didPassUnknownProp = plugins.filter(function(plugin2) { - return plugin2.name === prop; - }).length === 0; + var currentInput = { + isTouch: false + }; + var lastMouseMoveTime = 0; + function onDocumentTouchStart() { + if (currentInput.isTouch) { + return; } - warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", "\n\n", "All props: https://atomiks.github.io/tippyjs/v6/all-props/\n", "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" ")); - }); - } - var innerHTML = function innerHTML2() { - return "innerHTML"; - }; - function dangerouslySetInnerHTML(element, html) { - element[innerHTML()] = html; - } - function createArrowElement(value) { - var arrow2 = div(); - if (value === true) { - arrow2.className = ARROW_CLASS; - } else { - arrow2.className = SVG_ARROW_CLASS; - if (isElement2(value)) { - arrow2.appendChild(value); - } else { - dangerouslySetInnerHTML(arrow2, value); + currentInput.isTouch = true; + if (window.performance) { + document.addEventListener("mousemove", onDocumentMouseMove); } } - return arrow2; - } - function setContent(content2, props) { - if (isElement2(props.content)) { - dangerouslySetInnerHTML(content2, ""); - content2.appendChild(props.content); - } else if (typeof props.content !== "function") { - if (props.allowHTML) { - dangerouslySetInnerHTML(content2, props.content); - } else { - content2.textContent = props.content; + function onDocumentMouseMove() { + var now = performance.now(); + if (now - lastMouseMoveTime < 20) { + currentInput.isTouch = false; + document.removeEventListener("mousemove", onDocumentMouseMove); } + lastMouseMoveTime = now; } - } - function getChildren(popper2) { - var box = popper2.firstElementChild; - var boxChildren = arrayFrom(box.children); - return { - box, - content: boxChildren.find(function(node) { - return node.classList.contains(CONTENT_CLASS); - }), - arrow: boxChildren.find(function(node) { - return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS); - }), - backdrop: boxChildren.find(function(node) { - return node.classList.contains(BACKDROP_CLASS); - }) - }; - } - function render(instance) { - var popper2 = div(); - var box = div(); - box.className = BOX_CLASS; - box.setAttribute("data-state", "hidden"); - box.setAttribute("tabindex", "-1"); - var content2 = div(); - content2.className = CONTENT_CLASS; - content2.setAttribute("data-state", "hidden"); - setContent(content2, instance.props); - popper2.appendChild(box); - box.appendChild(content2); - onUpdate(instance.props, instance.props); - function onUpdate(prevProps, nextProps) { - var _getChildren = getChildren(popper2), box2 = _getChildren.box, content3 = _getChildren.content, arrow2 = _getChildren.arrow; - if (nextProps.theme) { - box2.setAttribute("data-theme", nextProps.theme); - } else { - box2.removeAttribute("data-theme"); - } - if (typeof nextProps.animation === "string") { - box2.setAttribute("data-animation", nextProps.animation); - } else { - box2.removeAttribute("data-animation"); - } - if (nextProps.inertia) { - box2.setAttribute("data-inertia", ""); - } else { - box2.removeAttribute("data-inertia"); - } - box2.style.maxWidth = typeof nextProps.maxWidth === "number" ? nextProps.maxWidth + "px" : nextProps.maxWidth; - if (nextProps.role) { - box2.setAttribute("role", nextProps.role); - } else { - box2.removeAttribute("role"); - } - if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) { - setContent(content3, instance.props); - } - if (nextProps.arrow) { - if (!arrow2) { - box2.appendChild(createArrowElement(nextProps.arrow)); - } else if (prevProps.arrow !== nextProps.arrow) { - box2.removeChild(arrow2); - box2.appendChild(createArrowElement(nextProps.arrow)); + function onWindowBlur() { + var activeElement = document.activeElement; + if (isReferenceElement(activeElement)) { + var instance = activeElement._tippy; + if (activeElement.blur && !instance.state.isVisible) { + activeElement.blur(); } - } else if (arrow2) { - box2.removeChild(arrow2); } } - return { - popper: popper2, - onUpdate - }; - } - render.$$tippy = true; - var idCounter = 1; - var mouseMoveListeners = []; - var mountedInstances = []; - function createTippy(reference2, passedProps) { - var props = evaluateProps(reference2, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); - var showTimeout; - var hideTimeout; - var scheduleHideAnimationFrame; - var isVisibleFromClick = false; - var didHideDueToDocumentMouseDown = false; - var didTouchMove = false; - var ignoreOnFirstUpdate = false; - var lastTriggerEvent; - var currentTransitionEndListener; - var onFirstUpdate; - var listeners = []; - var debouncedOnMouseMove = debounce3(onMouseMove, props.interactiveDebounce); - var currentTarget; - var id = idCounter++; - var popperInstance = null; - var plugins = unique(props.plugins); - var state = { - // Is the instance currently enabled? - isEnabled: true, - // Is the tippy currently showing and not transitioning out? - isVisible: false, - // Has the instance been destroyed? - isDestroyed: false, - // Is the tippy currently mounted to the DOM? - isMounted: false, - // Has the tippy finished transitioning in? - isShown: false - }; - var instance = { - // properties - id, - reference: reference2, - popper: div(), - popperInstance, - props, - state, - plugins, - // methods - clearDelayTimeouts, - setProps, - setContent: setContent2, - show, - hide: hide2, - hideWithInteractivity, - enable, - disable, - unmount, - destroy - }; - if (!props.render) { - if (true) { - errorWhen(true, "render() function has not been supplied."); - } - return instance; + function bindGlobalEventListeners() { + document.addEventListener("touchstart", onDocumentTouchStart, TOUCH_OPTIONS); + window.addEventListener("blur", onWindowBlur); } - var _props$render = props.render(instance), popper2 = _props$render.popper, onUpdate = _props$render.onUpdate; - popper2.setAttribute("data-tippy-root", ""); - popper2.id = "tippy-" + instance.id; - instance.popper = popper2; - reference2._tippy = instance; - popper2._tippy = instance; - var pluginsHooks = plugins.map(function(plugin2) { - return plugin2.fn(instance); - }); - var hasAriaExpanded = reference2.hasAttribute("aria-expanded"); - addListeners(); - handleAriaExpandedAttribute(); - handleStyles(); - invokeHook("onCreate", [instance]); - if (props.showOnCreate) { - scheduleShow(); + var isBrowser = typeof window !== "undefined" && typeof document !== "undefined"; + var isIE11 = isBrowser ? ( + // @ts-ignore + !!window.msCrypto + ) : false; + function createMemoryLeakWarning(method) { + var txt = method === "destroy" ? "n already-" : " "; + return [method + "() was called on a" + txt + "destroyed instance. This is a no-op but", "indicates a potential memory leak."].join(" "); } - popper2.addEventListener("mouseenter", function() { - if (instance.props.interactive && instance.state.isVisible) { - instance.clearDelayTimeouts(); - } - }); - popper2.addEventListener("mouseleave", function() { - if (instance.props.interactive && instance.props.trigger.indexOf("mouseenter") >= 0) { - getDocument().addEventListener("mousemove", debouncedOnMouseMove); - } - }); - return instance; - function getNormalizedTouchSettings() { - var touch = instance.props.touch; - return Array.isArray(touch) ? touch : [touch, 0]; + function clean(value) { + var spacesAndTabs = /[ \t]{2,}/g; + var lineStartWithSpaces = /^[ \t]*/gm; + return value.replace(spacesAndTabs, " ").replace(lineStartWithSpaces, "").trim(); } - function getIsCustomTouchBehavior() { - return getNormalizedTouchSettings()[0] === "hold"; + function getDevMessage(message) { + return clean("\n %ctippy.js\n\n %c" + clean(message) + "\n\n %c\u{1F477}\u200D This is a development-only message. It will be removed in production.\n "); } - function getIsDefaultRenderFn() { - var _instance$props$rende; - return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy); + function getFormattedMessage(message) { + return [ + getDevMessage(message), + // title + "color: #00C584; font-size: 1.3em; font-weight: bold;", + // message + "line-height: 1.5", + // footer + "color: #a6a095;" + ]; } - function getCurrentTarget() { - return currentTarget || reference2; + var visitedMessages; + if (process.env.NODE_ENV !== "production") { + resetVisitedMessages(); } - function getDocument() { - var parent = getCurrentTarget().parentNode; - return parent ? getOwnerDocument(parent) : document; + function resetVisitedMessages() { + visitedMessages = /* @__PURE__ */ new Set(); } - function getDefaultTemplateChildren() { - return getChildren(popper2); - } - function getDelay(isShow) { - if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") { - return 0; + function warnWhen(condition, message) { + if (condition && !visitedMessages.has(message)) { + var _console; + visitedMessages.add(message); + (_console = console).warn.apply(_console, getFormattedMessage(message)); } - return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay); } - function handleStyles(fromHide) { - if (fromHide === void 0) { - fromHide = false; + function errorWhen(condition, message) { + if (condition && !visitedMessages.has(message)) { + var _console2; + visitedMessages.add(message); + (_console2 = console).error.apply(_console2, getFormattedMessage(message)); } - popper2.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none"; - popper2.style.zIndex = "" + instance.props.zIndex; } - function invokeHook(hook, args, shouldInvokePropsHook) { - if (shouldInvokePropsHook === void 0) { - shouldInvokePropsHook = true; + function validateTargets(targets) { + var didPassFalsyValue = !targets; + var didPassPlainObject = Object.prototype.toString.call(targets) === "[object Object]" && !targets.addEventListener; + errorWhen(didPassFalsyValue, ["tippy() was passed", "`" + String(targets) + "`", "as its targets (first) argument. Valid types are: String, Element,", "Element[], or NodeList."].join(" ")); + errorWhen(didPassPlainObject, ["tippy() was passed a plain object which is not supported as an argument", "for virtual positioning. Use props.getReferenceClientRect instead."].join(" ")); + } + var pluginProps = { + animateFill: false, + followCursor: false, + inlinePositioning: false, + sticky: false + }; + var renderProps = { + allowHTML: false, + animation: "fade", + arrow: true, + content: "", + inertia: false, + maxWidth: 350, + role: "tooltip", + theme: "", + zIndex: 9999 + }; + var defaultProps = Object.assign({ + appendTo: TIPPY_DEFAULT_APPEND_TO, + aria: { + content: "auto", + expanded: "auto" + }, + delay: 0, + duration: [300, 250], + getReferenceClientRect: null, + hideOnClick: true, + ignoreAttributes: false, + interactive: false, + interactiveBorder: 2, + interactiveDebounce: 0, + moveTransition: "", + offset: [0, 10], + onAfterUpdate: function onAfterUpdate() { + }, + onBeforeUpdate: function onBeforeUpdate() { + }, + onCreate: function onCreate() { + }, + onDestroy: function onDestroy() { + }, + onHidden: function onHidden() { + }, + onHide: function onHide() { + }, + onMount: function onMount() { + }, + onShow: function onShow() { + }, + onShown: function onShown() { + }, + onTrigger: function onTrigger() { + }, + onUntrigger: function onUntrigger() { + }, + onClickOutside: function onClickOutside() { + }, + placement: "top", + plugins: [], + popperOptions: {}, + render: null, + showOnCreate: false, + touch: true, + trigger: "mouseenter focus", + triggerTarget: null + }, pluginProps, renderProps); + var defaultKeys = Object.keys(defaultProps); + var setDefaultProps = function setDefaultProps2(partialProps) { + if (process.env.NODE_ENV !== "production") { + validateProps(partialProps, []); } - pluginsHooks.forEach(function(pluginHooks) { - if (pluginHooks[hook]) { - pluginHooks[hook].apply(pluginHooks, args); - } + var keys = Object.keys(partialProps); + keys.forEach(function(key) { + defaultProps[key] = partialProps[key]; }); - if (shouldInvokePropsHook) { - var _instance$props; - (_instance$props = instance.props)[hook].apply(_instance$props, args); - } + }; + function getExtendedPassedProps(passedProps) { + var plugins = passedProps.plugins || []; + var pluginProps2 = plugins.reduce(function(acc, plugin) { + var name = plugin.name, defaultValue = plugin.defaultValue; + if (name) { + var _name; + acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue; + } + return acc; + }, {}); + return Object.assign({}, passedProps, pluginProps2); } - function handleAriaContentAttribute() { - var aria = instance.props.aria; - if (!aria.content) { - return; - } - var attr = "aria-" + aria.content; - var id2 = popper2.id; - var nodes = normalizeToArray(instance.props.triggerTarget || reference2); - nodes.forEach(function(node) { - var currentValue = node.getAttribute(attr); - if (instance.state.isVisible) { - node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2); + function getDataAttributeProps(reference, plugins) { + var propKeys = plugins ? Object.keys(getExtendedPassedProps(Object.assign({}, defaultProps, { + plugins + }))) : defaultKeys; + var props = propKeys.reduce(function(acc, key) { + var valueAsString = (reference.getAttribute("data-tippy-" + key) || "").trim(); + if (!valueAsString) { + return acc; + } + if (key === "content") { + acc[key] = valueAsString; } else { - var nextValue = currentValue && currentValue.replace(id2, "").trim(); - if (nextValue) { - node.setAttribute(attr, nextValue); - } else { - node.removeAttribute(attr); + try { + acc[key] = JSON.parse(valueAsString); + } catch (e2) { + acc[key] = valueAsString; } } - }); + return acc; + }, {}); + return props; } - function handleAriaExpandedAttribute() { - if (hasAriaExpanded || !instance.props.aria.expanded) { - return; + function evaluateProps(reference, props) { + var out = Object.assign({}, props, { + content: invokeWithArgsOrReturn(props.content, [reference]) + }, props.ignoreAttributes ? {} : getDataAttributeProps(reference, props.plugins)); + out.aria = Object.assign({}, defaultProps.aria, out.aria); + out.aria = { + expanded: out.aria.expanded === "auto" ? props.interactive : out.aria.expanded, + content: out.aria.content === "auto" ? props.interactive ? null : "describedby" : out.aria.content + }; + return out; + } + function validateProps(partialProps, plugins) { + if (partialProps === void 0) { + partialProps = {}; } - var nodes = normalizeToArray(instance.props.triggerTarget || reference2); - nodes.forEach(function(node) { - if (instance.props.interactive) { - node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false"); - } else { - node.removeAttribute("aria-expanded"); + if (plugins === void 0) { + plugins = []; + } + var keys = Object.keys(partialProps); + keys.forEach(function(prop) { + var nonPluginProps = removeProperties(defaultProps, Object.keys(pluginProps)); + var didPassUnknownProp = !hasOwnProperty(nonPluginProps, prop); + if (didPassUnknownProp) { + didPassUnknownProp = plugins.filter(function(plugin) { + return plugin.name === prop; + }).length === 0; } + warnWhen(didPassUnknownProp, ["`" + prop + "`", "is not a valid prop. You may have spelled it incorrectly, or if it's", "a plugin, forgot to pass it in an array as props.plugins.", "\n\n", "All props: https://atomiks.github.io/tippyjs/v6/all-props/\n", "Plugins: https://atomiks.github.io/tippyjs/v6/plugins/"].join(" ")); }); } - function cleanupInteractiveMouseListeners() { - getDocument().removeEventListener("mousemove", debouncedOnMouseMove); - mouseMoveListeners = mouseMoveListeners.filter(function(listener) { - return listener !== debouncedOnMouseMove; - }); + var innerHTML = function innerHTML2() { + return "innerHTML"; + }; + function dangerouslySetInnerHTML(element, html) { + element[innerHTML()] = html; } - function onDocumentPress(event) { - if (currentInput.isTouch) { - if (didTouchMove || event.type === "mousedown") { - return; - } - } - var actualTarget = event.composedPath && event.composedPath()[0] || event.target; - if (instance.props.interactive && actualContains(popper2, actualTarget)) { - return; - } - if (normalizeToArray(instance.props.triggerTarget || reference2).some(function(el) { - return actualContains(el, actualTarget); - })) { - if (currentInput.isTouch) { - return; - } - if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) { - return; - } + function createArrowElement(value) { + var arrow = div(); + if (value === true) { + arrow.className = ARROW_CLASS; } else { - invokeHook("onClickOutside", [instance, event]); - } - if (instance.props.hideOnClick === true) { - instance.clearDelayTimeouts(); - instance.hide(); - didHideDueToDocumentMouseDown = true; - setTimeout(function() { - didHideDueToDocumentMouseDown = false; - }); - if (!instance.state.isMounted) { - removeDocumentPress(); + arrow.className = SVG_ARROW_CLASS; + if (isElement(value)) { + arrow.appendChild(value); + } else { + dangerouslySetInnerHTML(arrow, value); } } + return arrow; } - function onTouchMove() { - didTouchMove = true; - } - function onTouchStart() { - didTouchMove = false; - } - function addDocumentPress() { - var doc = getDocument(); - doc.addEventListener("mousedown", onDocumentPress, true); - doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); - doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); - doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); - } - function removeDocumentPress() { - var doc = getDocument(); - doc.removeEventListener("mousedown", onDocumentPress, true); - doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); - doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); - doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); - } - function onTransitionedOut(duration, callback) { - onTransitionEnd(duration, function() { - if (!instance.state.isVisible && popper2.parentNode && popper2.parentNode.contains(popper2)) { - callback(); + function setContent(content2, props) { + if (isElement(props.content)) { + dangerouslySetInnerHTML(content2, ""); + content2.appendChild(props.content); + } else if (typeof props.content !== "function") { + if (props.allowHTML) { + dangerouslySetInnerHTML(content2, props.content); + } else { + content2.textContent = props.content; } - }); + } } - function onTransitionedIn(duration, callback) { - onTransitionEnd(duration, callback); + function getChildren(popper) { + var box = popper.firstElementChild; + var boxChildren = arrayFrom(box.children); + return { + box, + content: boxChildren.find(function(node) { + return node.classList.contains(CONTENT_CLASS); + }), + arrow: boxChildren.find(function(node) { + return node.classList.contains(ARROW_CLASS) || node.classList.contains(SVG_ARROW_CLASS); + }), + backdrop: boxChildren.find(function(node) { + return node.classList.contains(BACKDROP_CLASS); + }) + }; } - function onTransitionEnd(duration, callback) { - var box = getDefaultTemplateChildren().box; - function listener(event) { - if (event.target === box) { - updateTransitionEndListener(box, "remove", listener); - callback(); + function render(instance) { + var popper = div(); + var box = div(); + box.className = BOX_CLASS; + box.setAttribute("data-state", "hidden"); + box.setAttribute("tabindex", "-1"); + var content2 = div(); + content2.className = CONTENT_CLASS; + content2.setAttribute("data-state", "hidden"); + setContent(content2, instance.props); + popper.appendChild(box); + box.appendChild(content2); + onUpdate(instance.props, instance.props); + function onUpdate(prevProps, nextProps) { + var _getChildren = getChildren(popper), box2 = _getChildren.box, content3 = _getChildren.content, arrow = _getChildren.arrow; + if (nextProps.theme) { + box2.setAttribute("data-theme", nextProps.theme); + } else { + box2.removeAttribute("data-theme"); } + if (typeof nextProps.animation === "string") { + box2.setAttribute("data-animation", nextProps.animation); + } else { + box2.removeAttribute("data-animation"); + } + if (nextProps.inertia) { + box2.setAttribute("data-inertia", ""); + } else { + box2.removeAttribute("data-inertia"); + } + box2.style.maxWidth = typeof nextProps.maxWidth === "number" ? nextProps.maxWidth + "px" : nextProps.maxWidth; + if (nextProps.role) { + box2.setAttribute("role", nextProps.role); + } else { + box2.removeAttribute("role"); + } + if (prevProps.content !== nextProps.content || prevProps.allowHTML !== nextProps.allowHTML) { + setContent(content3, instance.props); + } + if (nextProps.arrow) { + if (!arrow) { + box2.appendChild(createArrowElement(nextProps.arrow)); + } else if (prevProps.arrow !== nextProps.arrow) { + box2.removeChild(arrow); + box2.appendChild(createArrowElement(nextProps.arrow)); + } + } else if (arrow) { + box2.removeChild(arrow); + } } - if (duration === 0) { - return callback(); - } - updateTransitionEndListener(box, "remove", currentTransitionEndListener); - updateTransitionEndListener(box, "add", listener); - currentTransitionEndListener = listener; + return { + popper, + onUpdate + }; } - function on2(eventType, handler4, options) { - if (options === void 0) { - options = false; + render.$$tippy = true; + var idCounter = 1; + var mouseMoveListeners = []; + var mountedInstances = []; + function createTippy(reference, passedProps) { + var props = evaluateProps(reference, Object.assign({}, defaultProps, getExtendedPassedProps(removeUndefinedProps(passedProps)))); + var showTimeout; + var hideTimeout; + var scheduleHideAnimationFrame; + var isVisibleFromClick = false; + var didHideDueToDocumentMouseDown = false; + var didTouchMove = false; + var ignoreOnFirstUpdate = false; + var lastTriggerEvent; + var currentTransitionEndListener; + var onFirstUpdate; + var listeners = []; + var debouncedOnMouseMove = debounce(onMouseMove, props.interactiveDebounce); + var currentTarget; + var id = idCounter++; + var popperInstance = null; + var plugins = unique(props.plugins); + var state = { + // Is the instance currently enabled? + isEnabled: true, + // Is the tippy currently showing and not transitioning out? + isVisible: false, + // Has the instance been destroyed? + isDestroyed: false, + // Is the tippy currently mounted to the DOM? + isMounted: false, + // Has the tippy finished transitioning in? + isShown: false + }; + var instance = { + // properties + id, + reference, + popper: div(), + popperInstance, + props, + state, + plugins, + // methods + clearDelayTimeouts, + setProps, + setContent: setContent2, + show, + hide, + hideWithInteractivity, + enable, + disable, + unmount, + destroy + }; + if (!props.render) { + if (process.env.NODE_ENV !== "production") { + errorWhen(true, "render() function has not been supplied."); + } + return instance; } - var nodes = normalizeToArray(instance.props.triggerTarget || reference2); - nodes.forEach(function(node) { - node.addEventListener(eventType, handler4, options); - listeners.push({ - node, - eventType, - handler: handler4, - options - }); + var _props$render = props.render(instance), popper = _props$render.popper, onUpdate = _props$render.onUpdate; + popper.setAttribute("data-tippy-root", ""); + popper.id = "tippy-" + instance.id; + instance.popper = popper; + reference._tippy = instance; + popper._tippy = instance; + var pluginsHooks = plugins.map(function(plugin) { + return plugin.fn(instance); }); - } - function addListeners() { - if (getIsCustomTouchBehavior()) { - on2("touchstart", onTrigger2, { - passive: true - }); - on2("touchend", onMouseLeave, { - passive: true - }); + var hasAriaExpanded = reference.hasAttribute("aria-expanded"); + addListeners(); + handleAriaExpandedAttribute(); + handleStyles(); + invokeHook("onCreate", [instance]); + if (props.showOnCreate) { + scheduleShow(); } - splitBySpaces(instance.props.trigger).forEach(function(eventType) { - if (eventType === "manual") { - return; + popper.addEventListener("mouseenter", function() { + if (instance.props.interactive && instance.state.isVisible) { + instance.clearDelayTimeouts(); } - on2(eventType, onTrigger2); - switch (eventType) { - case "mouseenter": - on2("mouseleave", onMouseLeave); - break; - case "focus": - on2(isIE11 ? "focusout" : "blur", onBlurOrFocusOut); - break; - case "focusin": - on2("focusout", onBlurOrFocusOut); - break; + }); + popper.addEventListener("mouseleave", function() { + if (instance.props.interactive && instance.props.trigger.indexOf("mouseenter") >= 0) { + getDocument().addEventListener("mousemove", debouncedOnMouseMove); } }); - } - function removeListeners() { - listeners.forEach(function(_ref) { - var node = _ref.node, eventType = _ref.eventType, handler4 = _ref.handler, options = _ref.options; - node.removeEventListener(eventType, handler4, options); - }); - listeners = []; - } - function onTrigger2(event) { - var _lastTriggerEvent; - var shouldScheduleClickHide = false; - if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) { - return; + return instance; + function getNormalizedTouchSettings() { + var touch = instance.props.touch; + return Array.isArray(touch) ? touch : [touch, 0]; } - var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus"; - lastTriggerEvent = event; - currentTarget = event.currentTarget; - handleAriaExpandedAttribute(); - if (!instance.state.isVisible && isMouseEvent(event)) { - mouseMoveListeners.forEach(function(listener) { - return listener(event); - }); + function getIsCustomTouchBehavior() { + return getNormalizedTouchSettings()[0] === "hold"; } - if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) { - shouldScheduleClickHide = true; - } else { - scheduleShow(event); + function getIsDefaultRenderFn() { + var _instance$props$rende; + return !!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy); } - if (event.type === "click") { - isVisibleFromClick = !shouldScheduleClickHide; + function getCurrentTarget() { + return currentTarget || reference; } - if (shouldScheduleClickHide && !wasFocused) { - scheduleHide(event); + function getDocument() { + var parent = getCurrentTarget().parentNode; + return parent ? getOwnerDocument(parent) : document; } - } - function onMouseMove(event) { - var target = event.target; - var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper2.contains(target); - if (event.type === "mousemove" && isCursorOverReferenceOrPopper) { - return; + function getDefaultTemplateChildren() { + return getChildren(popper); } - var popperTreeData = getNestedPopperTree().concat(popper2).map(function(popper3) { - var _instance$popperInsta; - var instance2 = popper3._tippy; - var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state; - if (state2) { - return { - popperRect: popper3.getBoundingClientRect(), - popperState: state2, - props - }; + function getDelay(isShow) { + if (instance.state.isMounted && !instance.state.isVisible || currentInput.isTouch || lastTriggerEvent && lastTriggerEvent.type === "focus") { + return 0; } - return null; - }).filter(Boolean); - if (isCursorOutsideInteractiveBorder(popperTreeData, event)) { - cleanupInteractiveMouseListeners(); - scheduleHide(event); + return getValueAtIndexOrReturn(instance.props.delay, isShow ? 0 : 1, defaultProps.delay); } - } - function onMouseLeave(event) { - var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick; - if (shouldBail) { - return; + function handleStyles(fromHide) { + if (fromHide === void 0) { + fromHide = false; + } + popper.style.pointerEvents = instance.props.interactive && !fromHide ? "" : "none"; + popper.style.zIndex = "" + instance.props.zIndex; } - if (instance.props.interactive) { - instance.hideWithInteractivity(event); - return; + function invokeHook(hook, args, shouldInvokePropsHook) { + if (shouldInvokePropsHook === void 0) { + shouldInvokePropsHook = true; + } + pluginsHooks.forEach(function(pluginHooks) { + if (pluginHooks[hook]) { + pluginHooks[hook].apply(pluginHooks, args); + } + }); + if (shouldInvokePropsHook) { + var _instance$props; + (_instance$props = instance.props)[hook].apply(_instance$props, args); + } } - scheduleHide(event); - } - function onBlurOrFocusOut(event) { - if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) { - return; + function handleAriaContentAttribute() { + var aria = instance.props.aria; + if (!aria.content) { + return; + } + var attr = "aria-" + aria.content; + var id2 = popper.id; + var nodes = normalizeToArray(instance.props.triggerTarget || reference); + nodes.forEach(function(node) { + var currentValue = node.getAttribute(attr); + if (instance.state.isVisible) { + node.setAttribute(attr, currentValue ? currentValue + " " + id2 : id2); + } else { + var nextValue = currentValue && currentValue.replace(id2, "").trim(); + if (nextValue) { + node.setAttribute(attr, nextValue); + } else { + node.removeAttribute(attr); + } + } + }); } - if (instance.props.interactive && event.relatedTarget && popper2.contains(event.relatedTarget)) { - return; + function handleAriaExpandedAttribute() { + if (hasAriaExpanded || !instance.props.aria.expanded) { + return; + } + var nodes = normalizeToArray(instance.props.triggerTarget || reference); + nodes.forEach(function(node) { + if (instance.props.interactive) { + node.setAttribute("aria-expanded", instance.state.isVisible && node === getCurrentTarget() ? "true" : "false"); + } else { + node.removeAttribute("aria-expanded"); + } + }); } - scheduleHide(event); - } - function isEventListenerStopped(event) { - return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false; - } - function createPopperInstance() { - destroyPopperInstance(); - var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset2 = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition; - var arrow2 = getIsDefaultRenderFn() ? getChildren(popper2).arrow : null; - var computedReference = getReferenceClientRect ? { - getBoundingClientRect: getReferenceClientRect, - contextElement: getReferenceClientRect.contextElement || getCurrentTarget() - } : reference2; - var tippyModifier = { - name: "$$tippy", - enabled: true, - phase: "beforeWrite", - requires: ["computeStyles"], - fn: function fn3(_ref2) { - var state2 = _ref2.state; - if (getIsDefaultRenderFn()) { - var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box; - ["placement", "reference-hidden", "escaped"].forEach(function(attr) { - if (attr === "placement") { - box.setAttribute("data-placement", state2.placement); - } else { - if (state2.attributes.popper["data-popper-" + attr]) { - box.setAttribute("data-" + attr, ""); - } else { - box.removeAttribute("data-" + attr); - } - } - }); - state2.attributes.popper = {}; + function cleanupInteractiveMouseListeners() { + getDocument().removeEventListener("mousemove", debouncedOnMouseMove); + mouseMoveListeners = mouseMoveListeners.filter(function(listener) { + return listener !== debouncedOnMouseMove; + }); + } + function onDocumentPress(event) { + if (currentInput.isTouch) { + if (didTouchMove || event.type === "mousedown") { + return; } } - }; - var modifiers = [{ - name: "offset", - options: { - offset: offset2 + var actualTarget = event.composedPath && event.composedPath()[0] || event.target; + if (instance.props.interactive && actualContains(popper, actualTarget)) { + return; } - }, { - name: "preventOverflow", - options: { - padding: { - top: 2, - bottom: 2, - left: 5, - right: 5 + if (normalizeToArray(instance.props.triggerTarget || reference).some(function(el) { + return actualContains(el, actualTarget); + })) { + if (currentInput.isTouch) { + return; } + if (instance.state.isVisible && instance.props.trigger.indexOf("click") >= 0) { + return; + } + } else { + invokeHook("onClickOutside", [instance, event]); } - }, { - name: "flip", - options: { - padding: 5 - } - }, { - name: "computeStyles", - options: { - adaptive: !moveTransition - } - }, tippyModifier]; - if (getIsDefaultRenderFn() && arrow2) { - modifiers.push({ - name: "arrow", - options: { - element: arrow2, - padding: 3 + if (instance.props.hideOnClick === true) { + instance.clearDelayTimeouts(); + instance.hide(); + didHideDueToDocumentMouseDown = true; + setTimeout(function() { + didHideDueToDocumentMouseDown = false; + }); + if (!instance.state.isMounted) { + removeDocumentPress(); } - }); + } } - modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []); - instance.popperInstance = createPopper(computedReference, popper2, Object.assign({}, popperOptions, { - placement, - onFirstUpdate, - modifiers - })); - } - function destroyPopperInstance() { - if (instance.popperInstance) { - instance.popperInstance.destroy(); - instance.popperInstance = null; + function onTouchMove() { + didTouchMove = true; } - } - function mount() { - var appendTo = instance.props.appendTo; - var parentNode; - var node = getCurrentTarget(); - if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") { - parentNode = node.parentNode; - } else { - parentNode = invokeWithArgsOrReturn(appendTo, [node]); + function onTouchStart() { + didTouchMove = false; } - if (!parentNode.contains(popper2)) { - parentNode.appendChild(popper2); + function addDocumentPress() { + var doc = getDocument(); + doc.addEventListener("mousedown", onDocumentPress, true); + doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); + doc.addEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); + doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); } - instance.state.isMounted = true; - createPopperInstance(); - if (true) { - warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper2, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", "\n\n", "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", "\n\n", "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", "\n\n", "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" ")); + function removeDocumentPress() { + var doc = getDocument(); + doc.removeEventListener("mousedown", onDocumentPress, true); + doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS); + doc.removeEventListener("touchstart", onTouchStart, TOUCH_OPTIONS); + doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS); } - } - function getNestedPopperTree() { - return arrayFrom(popper2.querySelectorAll("[data-tippy-root]")); - } - function scheduleShow(event) { - instance.clearDelayTimeouts(); - if (event) { - invokeHook("onTrigger", [instance, event]); + function onTransitionedOut(duration, callback) { + onTransitionEnd(duration, function() { + if (!instance.state.isVisible && popper.parentNode && popper.parentNode.contains(popper)) { + callback(); + } + }); } - addDocumentPress(); - var delay3 = getDelay(true); - var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1]; - if (currentInput.isTouch && touchValue === "hold" && touchDelay) { - delay3 = touchDelay; + function onTransitionedIn(duration, callback) { + onTransitionEnd(duration, callback); } - if (delay3) { - showTimeout = setTimeout(function() { - instance.show(); - }, delay3); - } else { - instance.show(); + function onTransitionEnd(duration, callback) { + var box = getDefaultTemplateChildren().box; + function listener(event) { + if (event.target === box) { + updateTransitionEndListener(box, "remove", listener); + callback(); + } + } + if (duration === 0) { + return callback(); + } + updateTransitionEndListener(box, "remove", currentTransitionEndListener); + updateTransitionEndListener(box, "add", listener); + currentTransitionEndListener = listener; } - } - function scheduleHide(event) { - instance.clearDelayTimeouts(); - invokeHook("onUntrigger", [instance, event]); - if (!instance.state.isVisible) { - removeDocumentPress(); - return; + function on(eventType, handler, options) { + if (options === void 0) { + options = false; + } + var nodes = normalizeToArray(instance.props.triggerTarget || reference); + nodes.forEach(function(node) { + node.addEventListener(eventType, handler, options); + listeners.push({ + node, + eventType, + handler, + options + }); + }); } - if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) { - return; - } - var delay3 = getDelay(false); - if (delay3) { - hideTimeout = setTimeout(function() { - if (instance.state.isVisible) { - instance.hide(); + function addListeners() { + if (getIsCustomTouchBehavior()) { + on("touchstart", onTrigger, { + passive: true + }); + on("touchend", onMouseLeave, { + passive: true + }); + } + splitBySpaces(instance.props.trigger).forEach(function(eventType) { + if (eventType === "manual") { + return; } - }, delay3); - } else { - scheduleHideAnimationFrame = requestAnimationFrame(function() { - instance.hide(); + on(eventType, onTrigger); + switch (eventType) { + case "mouseenter": + on("mouseleave", onMouseLeave); + break; + case "focus": + on(isIE11 ? "focusout" : "blur", onBlurOrFocusOut); + break; + case "focusin": + on("focusout", onBlurOrFocusOut); + break; + } }); } - } - function enable() { - instance.state.isEnabled = true; - } - function disable() { - instance.hide(); - instance.state.isEnabled = false; - } - function clearDelayTimeouts() { - clearTimeout(showTimeout); - clearTimeout(hideTimeout); - cancelAnimationFrame(scheduleHideAnimationFrame); - } - function setProps(partialProps) { - if (true) { - warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("setProps")); + function removeListeners() { + listeners.forEach(function(_ref) { + var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options; + node.removeEventListener(eventType, handler, options); + }); + listeners = []; } - if (instance.state.isDestroyed) { - return; + function onTrigger(event) { + var _lastTriggerEvent; + var shouldScheduleClickHide = false; + if (!instance.state.isEnabled || isEventListenerStopped(event) || didHideDueToDocumentMouseDown) { + return; + } + var wasFocused = ((_lastTriggerEvent = lastTriggerEvent) == null ? void 0 : _lastTriggerEvent.type) === "focus"; + lastTriggerEvent = event; + currentTarget = event.currentTarget; + handleAriaExpandedAttribute(); + if (!instance.state.isVisible && isMouseEvent(event)) { + mouseMoveListeners.forEach(function(listener) { + return listener(event); + }); + } + if (event.type === "click" && (instance.props.trigger.indexOf("mouseenter") < 0 || isVisibleFromClick) && instance.props.hideOnClick !== false && instance.state.isVisible) { + shouldScheduleClickHide = true; + } else { + scheduleShow(event); + } + if (event.type === "click") { + isVisibleFromClick = !shouldScheduleClickHide; + } + if (shouldScheduleClickHide && !wasFocused) { + scheduleHide(event); + } } - invokeHook("onBeforeUpdate", [instance, partialProps]); - removeListeners(); - var prevProps = instance.props; - var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), { - ignoreAttributes: true - })); - instance.props = nextProps; - addListeners(); - if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) { - cleanupInteractiveMouseListeners(); - debouncedOnMouseMove = debounce3(onMouseMove, nextProps.interactiveDebounce); + function onMouseMove(event) { + var target = event.target; + var isCursorOverReferenceOrPopper = getCurrentTarget().contains(target) || popper.contains(target); + if (event.type === "mousemove" && isCursorOverReferenceOrPopper) { + return; + } + var popperTreeData = getNestedPopperTree().concat(popper).map(function(popper2) { + var _instance$popperInsta; + var instance2 = popper2._tippy; + var state2 = (_instance$popperInsta = instance2.popperInstance) == null ? void 0 : _instance$popperInsta.state; + if (state2) { + return { + popperRect: popper2.getBoundingClientRect(), + popperState: state2, + props + }; + } + return null; + }).filter(Boolean); + if (isCursorOutsideInteractiveBorder(popperTreeData, event)) { + cleanupInteractiveMouseListeners(); + scheduleHide(event); + } } - if (prevProps.triggerTarget && !nextProps.triggerTarget) { - normalizeToArray(prevProps.triggerTarget).forEach(function(node) { - node.removeAttribute("aria-expanded"); - }); - } else if (nextProps.triggerTarget) { - reference2.removeAttribute("aria-expanded"); + function onMouseLeave(event) { + var shouldBail = isEventListenerStopped(event) || instance.props.trigger.indexOf("click") >= 0 && isVisibleFromClick; + if (shouldBail) { + return; + } + if (instance.props.interactive) { + instance.hideWithInteractivity(event); + return; + } + scheduleHide(event); } - handleAriaExpandedAttribute(); - handleStyles(); - if (onUpdate) { - onUpdate(prevProps, nextProps); + function onBlurOrFocusOut(event) { + if (instance.props.trigger.indexOf("focusin") < 0 && event.target !== getCurrentTarget()) { + return; + } + if (instance.props.interactive && event.relatedTarget && popper.contains(event.relatedTarget)) { + return; + } + scheduleHide(event); } - if (instance.popperInstance) { - createPopperInstance(); - getNestedPopperTree().forEach(function(nestedPopper) { - requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate); - }); + function isEventListenerStopped(event) { + return currentInput.isTouch ? getIsCustomTouchBehavior() !== event.type.indexOf("touch") >= 0 : false; } - invokeHook("onAfterUpdate", [instance, partialProps]); - } - function setContent2(content2) { - instance.setProps({ - content: content2 - }); - } - function show() { - if (true) { - warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("show")); + function createPopperInstance() { + destroyPopperInstance(); + var _instance$props2 = instance.props, popperOptions = _instance$props2.popperOptions, placement = _instance$props2.placement, offset = _instance$props2.offset, getReferenceClientRect = _instance$props2.getReferenceClientRect, moveTransition = _instance$props2.moveTransition; + var arrow = getIsDefaultRenderFn() ? getChildren(popper).arrow : null; + var computedReference = getReferenceClientRect ? { + getBoundingClientRect: getReferenceClientRect, + contextElement: getReferenceClientRect.contextElement || getCurrentTarget() + } : reference; + var tippyModifier = { + name: "$$tippy", + enabled: true, + phase: "beforeWrite", + requires: ["computeStyles"], + fn: function fn(_ref2) { + var state2 = _ref2.state; + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh = getDefaultTemplateChildren(), box = _getDefaultTemplateCh.box; + ["placement", "reference-hidden", "escaped"].forEach(function(attr) { + if (attr === "placement") { + box.setAttribute("data-placement", state2.placement); + } else { + if (state2.attributes.popper["data-popper-" + attr]) { + box.setAttribute("data-" + attr, ""); + } else { + box.removeAttribute("data-" + attr); + } + } + }); + state2.attributes.popper = {}; + } + } + }; + var modifiers = [{ + name: "offset", + options: { + offset + } + }, { + name: "preventOverflow", + options: { + padding: { + top: 2, + bottom: 2, + left: 5, + right: 5 + } + } + }, { + name: "flip", + options: { + padding: 5 + } + }, { + name: "computeStyles", + options: { + adaptive: !moveTransition + } + }, tippyModifier]; + if (getIsDefaultRenderFn() && arrow) { + modifiers.push({ + name: "arrow", + options: { + element: arrow, + padding: 3 + } + }); + } + modifiers.push.apply(modifiers, (popperOptions == null ? void 0 : popperOptions.modifiers) || []); + instance.popperInstance = core.createPopper(computedReference, popper, Object.assign({}, popperOptions, { + placement, + onFirstUpdate, + modifiers + })); } - var isAlreadyVisible = instance.state.isVisible; - var isDestroyed = instance.state.isDestroyed; - var isDisabled = !instance.state.isEnabled; - var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch; - var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration); - if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) { - return; + function destroyPopperInstance() { + if (instance.popperInstance) { + instance.popperInstance.destroy(); + instance.popperInstance = null; + } } - if (getCurrentTarget().hasAttribute("disabled")) { - return; + function mount() { + var appendTo = instance.props.appendTo; + var parentNode; + var node = getCurrentTarget(); + if (instance.props.interactive && appendTo === TIPPY_DEFAULT_APPEND_TO || appendTo === "parent") { + parentNode = node.parentNode; + } else { + parentNode = invokeWithArgsOrReturn(appendTo, [node]); + } + if (!parentNode.contains(popper)) { + parentNode.appendChild(popper); + } + instance.state.isMounted = true; + createPopperInstance(); + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.props.interactive && appendTo === defaultProps.appendTo && node.nextElementSibling !== popper, ["Interactive tippy element may not be accessible via keyboard", "navigation because it is not directly after the reference element", "in the DOM source order.", "\n\n", "Using a wrapper <div> or <span> tag around the reference element", "solves this by creating a new parentNode context.", "\n\n", "Specifying `appendTo: document.body` silences this warning, but it", "assumes you are using a focus management solution to handle", "keyboard navigation.", "\n\n", "See: https://atomiks.github.io/tippyjs/v6/accessibility/#interactivity"].join(" ")); + } } - invokeHook("onShow", [instance], false); - if (instance.props.onShow(instance) === false) { - return; + function getNestedPopperTree() { + return arrayFrom(popper.querySelectorAll("[data-tippy-root]")); } - instance.state.isVisible = true; - if (getIsDefaultRenderFn()) { - popper2.style.visibility = "visible"; + function scheduleShow(event) { + instance.clearDelayTimeouts(); + if (event) { + invokeHook("onTrigger", [instance, event]); + } + addDocumentPress(); + var delay = getDelay(true); + var _getNormalizedTouchSe = getNormalizedTouchSettings(), touchValue = _getNormalizedTouchSe[0], touchDelay = _getNormalizedTouchSe[1]; + if (currentInput.isTouch && touchValue === "hold" && touchDelay) { + delay = touchDelay; + } + if (delay) { + showTimeout = setTimeout(function() { + instance.show(); + }, delay); + } else { + instance.show(); + } } - handleStyles(); - addDocumentPress(); - if (!instance.state.isMounted) { - popper2.style.transition = "none"; + function scheduleHide(event) { + instance.clearDelayTimeouts(); + invokeHook("onUntrigger", [instance, event]); + if (!instance.state.isVisible) { + removeDocumentPress(); + return; + } + if (instance.props.trigger.indexOf("mouseenter") >= 0 && instance.props.trigger.indexOf("click") >= 0 && ["mouseleave", "mousemove"].indexOf(event.type) >= 0 && isVisibleFromClick) { + return; + } + var delay = getDelay(false); + if (delay) { + hideTimeout = setTimeout(function() { + if (instance.state.isVisible) { + instance.hide(); + } + }, delay); + } else { + scheduleHideAnimationFrame = requestAnimationFrame(function() { + instance.hide(); + }); + } } - if (getIsDefaultRenderFn()) { - var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content2 = _getDefaultTemplateCh2.content; - setTransitionDuration([box, content2], 0); + function enable() { + instance.state.isEnabled = true; } - onFirstUpdate = function onFirstUpdate2() { - var _instance$popperInsta2; - if (!instance.state.isVisible || ignoreOnFirstUpdate) { + function disable() { + instance.hide(); + instance.state.isEnabled = false; + } + function clearDelayTimeouts() { + clearTimeout(showTimeout); + clearTimeout(hideTimeout); + cancelAnimationFrame(scheduleHideAnimationFrame); + } + function setProps(partialProps) { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("setProps")); + } + if (instance.state.isDestroyed) { return; } - ignoreOnFirstUpdate = true; - void popper2.offsetHeight; - popper2.style.transition = instance.props.moveTransition; - if (getIsDefaultRenderFn() && instance.props.animation) { - var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content; - setTransitionDuration([_box, _content], duration); - setVisibilityState([_box, _content], "visible"); + invokeHook("onBeforeUpdate", [instance, partialProps]); + removeListeners(); + var prevProps = instance.props; + var nextProps = evaluateProps(reference, Object.assign({}, prevProps, removeUndefinedProps(partialProps), { + ignoreAttributes: true + })); + instance.props = nextProps; + addListeners(); + if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) { + cleanupInteractiveMouseListeners(); + debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce); } - handleAriaContentAttribute(); + if (prevProps.triggerTarget && !nextProps.triggerTarget) { + normalizeToArray(prevProps.triggerTarget).forEach(function(node) { + node.removeAttribute("aria-expanded"); + }); + } else if (nextProps.triggerTarget) { + reference.removeAttribute("aria-expanded"); + } handleAriaExpandedAttribute(); - pushIfUnique(mountedInstances, instance); - (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate(); - invokeHook("onMount", [instance]); - if (instance.props.animation && getIsDefaultRenderFn()) { - onTransitionedIn(duration, function() { - instance.state.isShown = true; - invokeHook("onShown", [instance]); + handleStyles(); + if (onUpdate) { + onUpdate(prevProps, nextProps); + } + if (instance.popperInstance) { + createPopperInstance(); + getNestedPopperTree().forEach(function(nestedPopper) { + requestAnimationFrame(nestedPopper._tippy.popperInstance.forceUpdate); }); } - }; - mount(); - } - function hide2() { - if (true) { - warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hide")); + invokeHook("onAfterUpdate", [instance, partialProps]); } - var isAlreadyHidden = !instance.state.isVisible; - var isDestroyed = instance.state.isDestroyed; - var isDisabled = !instance.state.isEnabled; - var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration); - if (isAlreadyHidden || isDestroyed || isDisabled) { - return; + function setContent2(content2) { + instance.setProps({ + content: content2 + }); } - invokeHook("onHide", [instance], false); - if (instance.props.onHide(instance) === false) { - return; + function show() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("show")); + } + var isAlreadyVisible = instance.state.isVisible; + var isDestroyed = instance.state.isDestroyed; + var isDisabled = !instance.state.isEnabled; + var isTouchAndTouchDisabled = currentInput.isTouch && !instance.props.touch; + var duration = getValueAtIndexOrReturn(instance.props.duration, 0, defaultProps.duration); + if (isAlreadyVisible || isDestroyed || isDisabled || isTouchAndTouchDisabled) { + return; + } + if (getCurrentTarget().hasAttribute("disabled")) { + return; + } + invokeHook("onShow", [instance], false); + if (instance.props.onShow(instance) === false) { + return; + } + instance.state.isVisible = true; + if (getIsDefaultRenderFn()) { + popper.style.visibility = "visible"; + } + handleStyles(); + addDocumentPress(); + if (!instance.state.isMounted) { + popper.style.transition = "none"; + } + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh2 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh2.box, content2 = _getDefaultTemplateCh2.content; + setTransitionDuration([box, content2], 0); + } + onFirstUpdate = function onFirstUpdate2() { + var _instance$popperInsta2; + if (!instance.state.isVisible || ignoreOnFirstUpdate) { + return; + } + ignoreOnFirstUpdate = true; + void popper.offsetHeight; + popper.style.transition = instance.props.moveTransition; + if (getIsDefaultRenderFn() && instance.props.animation) { + var _getDefaultTemplateCh3 = getDefaultTemplateChildren(), _box = _getDefaultTemplateCh3.box, _content = _getDefaultTemplateCh3.content; + setTransitionDuration([_box, _content], duration); + setVisibilityState([_box, _content], "visible"); + } + handleAriaContentAttribute(); + handleAriaExpandedAttribute(); + pushIfUnique(mountedInstances, instance); + (_instance$popperInsta2 = instance.popperInstance) == null ? void 0 : _instance$popperInsta2.forceUpdate(); + invokeHook("onMount", [instance]); + if (instance.props.animation && getIsDefaultRenderFn()) { + onTransitionedIn(duration, function() { + instance.state.isShown = true; + invokeHook("onShown", [instance]); + }); + } + }; + mount(); } - instance.state.isVisible = false; - instance.state.isShown = false; - ignoreOnFirstUpdate = false; - isVisibleFromClick = false; - if (getIsDefaultRenderFn()) { - popper2.style.visibility = "hidden"; - } - cleanupInteractiveMouseListeners(); - removeDocumentPress(); - handleStyles(true); - if (getIsDefaultRenderFn()) { - var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content2 = _getDefaultTemplateCh4.content; + function hide() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hide")); + } + var isAlreadyHidden = !instance.state.isVisible; + var isDestroyed = instance.state.isDestroyed; + var isDisabled = !instance.state.isEnabled; + var duration = getValueAtIndexOrReturn(instance.props.duration, 1, defaultProps.duration); + if (isAlreadyHidden || isDestroyed || isDisabled) { + return; + } + invokeHook("onHide", [instance], false); + if (instance.props.onHide(instance) === false) { + return; + } + instance.state.isVisible = false; + instance.state.isShown = false; + ignoreOnFirstUpdate = false; + isVisibleFromClick = false; + if (getIsDefaultRenderFn()) { + popper.style.visibility = "hidden"; + } + cleanupInteractiveMouseListeners(); + removeDocumentPress(); + handleStyles(true); + if (getIsDefaultRenderFn()) { + var _getDefaultTemplateCh4 = getDefaultTemplateChildren(), box = _getDefaultTemplateCh4.box, content2 = _getDefaultTemplateCh4.content; + if (instance.props.animation) { + setTransitionDuration([box, content2], duration); + setVisibilityState([box, content2], "hidden"); + } + } + handleAriaContentAttribute(); + handleAriaExpandedAttribute(); if (instance.props.animation) { - setTransitionDuration([box, content2], duration); - setVisibilityState([box, content2], "hidden"); + if (getIsDefaultRenderFn()) { + onTransitionedOut(duration, instance.unmount); + } + } else { + instance.unmount(); } } - handleAriaContentAttribute(); - handleAriaExpandedAttribute(); - if (instance.props.animation) { - if (getIsDefaultRenderFn()) { - onTransitionedOut(duration, instance.unmount); + function hideWithInteractivity(event) { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity")); } - } else { + getDocument().addEventListener("mousemove", debouncedOnMouseMove); + pushIfUnique(mouseMoveListeners, debouncedOnMouseMove); + debouncedOnMouseMove(event); + } + function unmount() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("unmount")); + } + if (instance.state.isVisible) { + instance.hide(); + } + if (!instance.state.isMounted) { + return; + } + destroyPopperInstance(); + getNestedPopperTree().forEach(function(nestedPopper) { + nestedPopper._tippy.unmount(); + }); + if (popper.parentNode) { + popper.parentNode.removeChild(popper); + } + mountedInstances = mountedInstances.filter(function(i2) { + return i2 !== instance; + }); + instance.state.isMounted = false; + invokeHook("onHidden", [instance]); + } + function destroy() { + if (process.env.NODE_ENV !== "production") { + warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("destroy")); + } + if (instance.state.isDestroyed) { + return; + } + instance.clearDelayTimeouts(); instance.unmount(); + removeListeners(); + delete reference._tippy; + instance.state.isDestroyed = true; + invokeHook("onDestroy", [instance]); } } - function hideWithInteractivity(event) { - if (true) { - warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("hideWithInteractivity")); + function tippy2(targets, optionalProps) { + if (optionalProps === void 0) { + optionalProps = {}; } - getDocument().addEventListener("mousemove", debouncedOnMouseMove); - pushIfUnique(mouseMoveListeners, debouncedOnMouseMove); - debouncedOnMouseMove(event); - } - function unmount() { - if (true) { - warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("unmount")); + var plugins = defaultProps.plugins.concat(optionalProps.plugins || []); + if (process.env.NODE_ENV !== "production") { + validateTargets(targets); + validateProps(optionalProps, plugins); } - if (instance.state.isVisible) { - instance.hide(); - } - if (!instance.state.isMounted) { - return; - } - destroyPopperInstance(); - getNestedPopperTree().forEach(function(nestedPopper) { - nestedPopper._tippy.unmount(); + bindGlobalEventListeners(); + var passedProps = Object.assign({}, optionalProps, { + plugins }); - if (popper2.parentNode) { - popper2.parentNode.removeChild(popper2); + var elements = getArrayOfElements(targets); + if (process.env.NODE_ENV !== "production") { + var isSingleContentElement = isElement(passedProps.content); + var isMoreThanOneReferenceElement = elements.length > 1; + warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", "\n\n", "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", "\n\n", "1) content: element.innerHTML\n", "2) content: () => element.cloneNode(true)"].join(" ")); } - mountedInstances = mountedInstances.filter(function(i3) { - return i3 !== instance; - }); - instance.state.isMounted = false; - invokeHook("onHidden", [instance]); + var instances = elements.reduce(function(acc, reference) { + var instance = reference && createTippy(reference, passedProps); + if (instance) { + acc.push(instance); + } + return acc; + }, []); + return isElement(targets) ? instances[0] : instances; } - function destroy() { - if (true) { - warnWhen(instance.state.isDestroyed, createMemoryLeakWarning("destroy")); + tippy2.defaultProps = defaultProps; + tippy2.setDefaultProps = setDefaultProps; + tippy2.currentInput = currentInput; + var hideAll2 = function hideAll3(_temp) { + var _ref = _temp === void 0 ? {} : _temp, excludedReferenceOrInstance = _ref.exclude, duration = _ref.duration; + mountedInstances.forEach(function(instance) { + var isExcluded = false; + if (excludedReferenceOrInstance) { + isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper; + } + if (!isExcluded) { + var originalDuration = instance.props.duration; + instance.setProps({ + duration + }); + instance.hide(); + if (!instance.state.isDestroyed) { + instance.setProps({ + duration: originalDuration + }); + } + } + }); + }; + var applyStylesModifier = Object.assign({}, core.applyStyles, { + effect: function effect(_ref) { + var state = _ref.state; + var initialStyles = { + popper: { + position: state.options.strategy, + left: "0", + top: "0", + margin: "0" + }, + arrow: { + position: "absolute" + }, + reference: {} + }; + Object.assign(state.elements.popper.style, initialStyles.popper); + state.styles = initialStyles; + if (state.elements.arrow) { + Object.assign(state.elements.arrow.style, initialStyles.arrow); + } } - if (instance.state.isDestroyed) { - return; - } - instance.clearDelayTimeouts(); - instance.unmount(); - removeListeners(); - delete reference2._tippy; - instance.state.isDestroyed = true; - invokeHook("onDestroy", [instance]); - } - } - function tippy(targets, optionalProps) { - if (optionalProps === void 0) { - optionalProps = {}; - } - var plugins = defaultProps.plugins.concat(optionalProps.plugins || []); - if (true) { - validateTargets(targets); - validateProps(optionalProps, plugins); - } - bindGlobalEventListeners(); - var passedProps = Object.assign({}, optionalProps, { - plugins }); - var elements = getArrayOfElements(targets); - if (true) { - var isSingleContentElement = isElement2(passedProps.content); - var isMoreThanOneReferenceElement = elements.length > 1; - warnWhen(isSingleContentElement && isMoreThanOneReferenceElement, ["tippy() was passed an Element as the `content` prop, but more than", "one tippy instance was created by this invocation. This means the", "content element will only be appended to the last tippy instance.", "\n\n", "Instead, pass the .innerHTML of the element, or use a function that", "returns a cloned version of the element instead.", "\n\n", "1) content: element.innerHTML\n", "2) content: () => element.cloneNode(true)"].join(" ")); - } - var instances = elements.reduce(function(acc, reference2) { - var instance = reference2 && createTippy(reference2, passedProps); - if (instance) { - acc.push(instance); + var createSingleton2 = function createSingleton3(tippyInstances, optionalProps) { + var _optionalProps$popper; + if (optionalProps === void 0) { + optionalProps = {}; } - return acc; - }, []); - return isElement2(targets) ? instances[0] : instances; - } - tippy.defaultProps = defaultProps; - tippy.setDefaultProps = setDefaultProps; - tippy.currentInput = currentInput; - var hideAll = function hideAll2(_temp) { - var _ref = _temp === void 0 ? {} : _temp, excludedReferenceOrInstance = _ref.exclude, duration = _ref.duration; - mountedInstances.forEach(function(instance) { - var isExcluded = false; - if (excludedReferenceOrInstance) { - isExcluded = isReferenceElement(excludedReferenceOrInstance) ? instance.reference === excludedReferenceOrInstance : instance.popper === excludedReferenceOrInstance.popper; + if (process.env.NODE_ENV !== "production") { + errorWhen(!Array.isArray(tippyInstances), ["The first argument passed to createSingleton() must be an array of", "tippy instances. The passed value was", String(tippyInstances)].join(" ")); } - if (!isExcluded) { - var originalDuration = instance.props.duration; - instance.setProps({ - duration + var individualInstances = tippyInstances; + var references = []; + var triggerTargets = []; + var currentTarget; + var overrides = optionalProps.overrides; + var interceptSetPropsCleanups = []; + var shownOnCreate = false; + function setTriggerTargets() { + triggerTargets = individualInstances.map(function(instance) { + return normalizeToArray(instance.props.triggerTarget || instance.reference); + }).reduce(function(acc, item) { + return acc.concat(item); + }, []); + } + function setReferences() { + references = individualInstances.map(function(instance) { + return instance.reference; }); - instance.hide(); - if (!instance.state.isDestroyed) { - instance.setProps({ - duration: originalDuration - }); + } + function enableInstances(isEnabled) { + individualInstances.forEach(function(instance) { + if (isEnabled) { + instance.enable(); + } else { + instance.disable(); + } + }); + } + function interceptSetProps(singleton2) { + return individualInstances.map(function(instance) { + var originalSetProps2 = instance.setProps; + instance.setProps = function(props) { + originalSetProps2(props); + if (instance.reference === currentTarget) { + singleton2.setProps(props); + } + }; + return function() { + instance.setProps = originalSetProps2; + }; + }); + } + function prepareInstance(singleton2, target) { + var index = triggerTargets.indexOf(target); + if (target === currentTarget) { + return; } + currentTarget = target; + var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) { + acc[prop] = individualInstances[index].props[prop]; + return acc; + }, {}); + singleton2.setProps(Object.assign({}, overrideProps, { + getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() { + var _references$index; + return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect(); + } + })); } - }); - }; - var applyStylesModifier = Object.assign({}, applyStyles_default, { - effect: function effect6(_ref) { - var state = _ref.state; - var initialStyles = { - popper: { - position: state.options.strategy, - left: "0", - top: "0", - margin: "0" - }, - arrow: { - position: "absolute" - }, - reference: {} + enableInstances(false); + setReferences(); + setTriggerTargets(); + var plugin = { + fn: function fn() { + return { + onDestroy: function onDestroy() { + enableInstances(true); + }, + onHidden: function onHidden() { + currentTarget = null; + }, + onClickOutside: function onClickOutside(instance) { + if (instance.props.showOnCreate && !shownOnCreate) { + shownOnCreate = true; + currentTarget = null; + } + }, + onShow: function onShow(instance) { + if (instance.props.showOnCreate && !shownOnCreate) { + shownOnCreate = true; + prepareInstance(instance, references[0]); + } + }, + onTrigger: function onTrigger(instance, event) { + prepareInstance(instance, event.currentTarget); + } + }; + } }; - Object.assign(state.elements.popper.style, initialStyles.popper); - state.styles = initialStyles; - if (state.elements.arrow) { - Object.assign(state.elements.arrow.style, initialStyles.arrow); + var singleton = tippy2(div(), Object.assign({}, removeProperties(optionalProps, ["overrides"]), { + plugins: [plugin].concat(optionalProps.plugins || []), + triggerTarget: triggerTargets, + popperOptions: Object.assign({}, optionalProps.popperOptions, { + modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier]) + }) + })); + var originalShow = singleton.show; + singleton.show = function(target) { + originalShow(); + if (!currentTarget && target == null) { + return prepareInstance(singleton, references[0]); + } + if (currentTarget && target == null) { + return; + } + if (typeof target === "number") { + return references[target] && prepareInstance(singleton, references[target]); + } + if (individualInstances.indexOf(target) >= 0) { + var ref = target.reference; + return prepareInstance(singleton, ref); + } + if (references.indexOf(target) >= 0) { + return prepareInstance(singleton, target); + } + }; + singleton.showNext = function() { + var first = references[0]; + if (!currentTarget) { + return singleton.show(0); + } + var index = references.indexOf(currentTarget); + singleton.show(references[index + 1] || first); + }; + singleton.showPrevious = function() { + var last = references[references.length - 1]; + if (!currentTarget) { + return singleton.show(last); + } + var index = references.indexOf(currentTarget); + var target = references[index - 1] || last; + singleton.show(target); + }; + var originalSetProps = singleton.setProps; + singleton.setProps = function(props) { + overrides = props.overrides || overrides; + originalSetProps(props); + }; + singleton.setInstances = function(nextInstances) { + enableInstances(true); + interceptSetPropsCleanups.forEach(function(fn) { + return fn(); + }); + individualInstances = nextInstances; + enableInstances(false); + setReferences(); + setTriggerTargets(); + interceptSetPropsCleanups = interceptSetProps(singleton); + singleton.setProps({ + triggerTarget: triggerTargets + }); + }; + interceptSetPropsCleanups = interceptSetProps(singleton); + return singleton; + }; + var BUBBLING_EVENTS_MAP = { + mouseover: "mouseenter", + focusin: "focus", + click: "click" + }; + function delegate(targets, props) { + if (process.env.NODE_ENV !== "production") { + errorWhen(!(props && props.target), ["You must specity a `target` prop indicating a CSS selector string matching", "the target elements that should receive a tippy."].join(" ")); } - } - }); - var createSingleton = function createSingleton2(tippyInstances, optionalProps) { - var _optionalProps$popper; - if (optionalProps === void 0) { - optionalProps = {}; - } - if (true) { - errorWhen(!Array.isArray(tippyInstances), ["The first argument passed to createSingleton() must be an array of", "tippy instances. The passed value was", String(tippyInstances)].join(" ")); - } - var individualInstances = tippyInstances; - var references = []; - var triggerTargets = []; - var currentTarget; - var overrides = optionalProps.overrides; - var interceptSetPropsCleanups = []; - var shownOnCreate = false; - function setTriggerTargets() { - triggerTargets = individualInstances.map(function(instance) { - return normalizeToArray(instance.props.triggerTarget || instance.reference); - }).reduce(function(acc, item) { - return acc.concat(item); - }, []); - } - function setReferences() { - references = individualInstances.map(function(instance) { - return instance.reference; + var listeners = []; + var childTippyInstances = []; + var disabled = false; + var target = props.target; + var nativeProps = removeProperties(props, ["target"]); + var parentProps = Object.assign({}, nativeProps, { + trigger: "manual", + touch: false }); - } - function enableInstances(isEnabled) { - individualInstances.forEach(function(instance) { - if (isEnabled) { - instance.enable(); - } else { - instance.disable(); - } + var childProps = Object.assign({ + touch: defaultProps.touch + }, nativeProps, { + showOnCreate: true }); - } - function interceptSetProps(singleton2) { - return individualInstances.map(function(instance) { - var originalSetProps2 = instance.setProps; - instance.setProps = function(props) { - originalSetProps2(props); - if (instance.reference === currentTarget) { - singleton2.setProps(props); + var returnValue = tippy2(targets, parentProps); + var normalizedReturnValue = normalizeToArray(returnValue); + function onTrigger(event) { + if (!event.target || disabled) { + return; + } + var targetNode = event.target.closest(target); + if (!targetNode) { + return; + } + var trigger = targetNode.getAttribute("data-tippy-trigger") || props.trigger || defaultProps.trigger; + if (targetNode._tippy) { + return; + } + if (event.type === "touchstart" && typeof childProps.touch === "boolean") { + return; + } + if (event.type !== "touchstart" && trigger.indexOf(BUBBLING_EVENTS_MAP[event.type]) < 0) { + return; + } + var instance = tippy2(targetNode, childProps); + if (instance) { + childTippyInstances = childTippyInstances.concat(instance); + } + } + function on(node, eventType, handler, options) { + if (options === void 0) { + options = false; + } + node.addEventListener(eventType, handler, options); + listeners.push({ + node, + eventType, + handler, + options + }); + } + function addEventListeners(instance) { + var reference = instance.reference; + on(reference, "touchstart", onTrigger, TOUCH_OPTIONS); + on(reference, "mouseover", onTrigger); + on(reference, "focusin", onTrigger); + on(reference, "click", onTrigger); + } + function removeEventListeners() { + listeners.forEach(function(_ref) { + var node = _ref.node, eventType = _ref.eventType, handler = _ref.handler, options = _ref.options; + node.removeEventListener(eventType, handler, options); + }); + listeners = []; + } + function applyMutations(instance) { + var originalDestroy = instance.destroy; + var originalEnable = instance.enable; + var originalDisable = instance.disable; + instance.destroy = function(shouldDestroyChildInstances) { + if (shouldDestroyChildInstances === void 0) { + shouldDestroyChildInstances = true; } + if (shouldDestroyChildInstances) { + childTippyInstances.forEach(function(instance2) { + instance2.destroy(); + }); + } + childTippyInstances = []; + removeEventListeners(); + originalDestroy(); }; - return function() { - instance.setProps = originalSetProps2; + instance.enable = function() { + originalEnable(); + childTippyInstances.forEach(function(instance2) { + return instance2.enable(); + }); + disabled = false; }; - }); - } - function prepareInstance(singleton2, target) { - var index = triggerTargets.indexOf(target); - if (target === currentTarget) { - return; + instance.disable = function() { + originalDisable(); + childTippyInstances.forEach(function(instance2) { + return instance2.disable(); + }); + disabled = true; + }; + addEventListeners(instance); } - currentTarget = target; - var overrideProps = (overrides || []).concat("content").reduce(function(acc, prop) { - acc[prop] = individualInstances[index].props[prop]; - return acc; - }, {}); - singleton2.setProps(Object.assign({}, overrideProps, { - getReferenceClientRect: typeof overrideProps.getReferenceClientRect === "function" ? overrideProps.getReferenceClientRect : function() { - var _references$index; - return (_references$index = references[index]) == null ? void 0 : _references$index.getBoundingClientRect(); + normalizedReturnValue.forEach(applyMutations); + return returnValue; + } + var animateFill = { + name: "animateFill", + defaultValue: false, + fn: function fn(instance) { + var _instance$props$rende; + if (!((_instance$props$rende = instance.props.render) != null && _instance$props$rende.$$tippy)) { + if (process.env.NODE_ENV !== "production") { + errorWhen(instance.props.animateFill, "The `animateFill` plugin requires the default render function."); + } + return {}; } - })); + var _getChildren = getChildren(instance.popper), box = _getChildren.box, content2 = _getChildren.content; + var backdrop = instance.props.animateFill ? createBackdropElement() : null; + return { + onCreate: function onCreate() { + if (backdrop) { + box.insertBefore(backdrop, box.firstElementChild); + box.setAttribute("data-animatefill", ""); + box.style.overflow = "hidden"; + instance.setProps({ + arrow: false, + animation: "shift-away" + }); + } + }, + onMount: function onMount() { + if (backdrop) { + var transitionDuration = box.style.transitionDuration; + var duration = Number(transitionDuration.replace("ms", "")); + content2.style.transitionDelay = Math.round(duration / 10) + "ms"; + backdrop.style.transitionDuration = transitionDuration; + setVisibilityState([backdrop], "visible"); + } + }, + onShow: function onShow() { + if (backdrop) { + backdrop.style.transitionDuration = "0ms"; + } + }, + onHide: function onHide() { + if (backdrop) { + setVisibilityState([backdrop], "hidden"); + } + } + }; + } + }; + function createBackdropElement() { + var backdrop = div(); + backdrop.className = BACKDROP_CLASS; + setVisibilityState([backdrop], "hidden"); + return backdrop; } - enableInstances(false); - setReferences(); - setTriggerTargets(); - var plugin2 = { - fn: function fn3() { + var mouseCoords = { + clientX: 0, + clientY: 0 + }; + var activeInstances = []; + function storeMouseCoords(_ref) { + var clientX = _ref.clientX, clientY = _ref.clientY; + mouseCoords = { + clientX, + clientY + }; + } + function addMouseCoordsListener(doc) { + doc.addEventListener("mousemove", storeMouseCoords); + } + function removeMouseCoordsListener(doc) { + doc.removeEventListener("mousemove", storeMouseCoords); + } + var followCursor2 = { + name: "followCursor", + defaultValue: false, + fn: function fn(instance) { + var reference = instance.reference; + var doc = getOwnerDocument(instance.props.triggerTarget || reference); + var isInternalUpdate = false; + var wasFocusEvent = false; + var isUnmounted = true; + var prevProps = instance.props; + function getIsInitialBehavior() { + return instance.props.followCursor === "initial" && instance.state.isVisible; + } + function addListener() { + doc.addEventListener("mousemove", onMouseMove); + } + function removeListener() { + doc.removeEventListener("mousemove", onMouseMove); + } + function unsetGetReferenceClientRect() { + isInternalUpdate = true; + instance.setProps({ + getReferenceClientRect: null + }); + isInternalUpdate = false; + } + function onMouseMove(event) { + var isCursorOverReference = event.target ? reference.contains(event.target) : true; + var followCursor3 = instance.props.followCursor; + var clientX = event.clientX, clientY = event.clientY; + var rect = reference.getBoundingClientRect(); + var relativeX = clientX - rect.left; + var relativeY = clientY - rect.top; + if (isCursorOverReference || !instance.props.interactive) { + instance.setProps({ + // @ts-ignore - unneeded DOMRect properties + getReferenceClientRect: function getReferenceClientRect() { + var rect2 = reference.getBoundingClientRect(); + var x2 = clientX; + var y2 = clientY; + if (followCursor3 === "initial") { + x2 = rect2.left + relativeX; + y2 = rect2.top + relativeY; + } + var top = followCursor3 === "horizontal" ? rect2.top : y2; + var right = followCursor3 === "vertical" ? rect2.right : x2; + var bottom = followCursor3 === "horizontal" ? rect2.bottom : y2; + var left = followCursor3 === "vertical" ? rect2.left : x2; + return { + width: right - left, + height: bottom - top, + top, + right, + bottom, + left + }; + } + }); + } + } + function create() { + if (instance.props.followCursor) { + activeInstances.push({ + instance, + doc + }); + addMouseCoordsListener(doc); + } + } + function destroy() { + activeInstances = activeInstances.filter(function(data) { + return data.instance !== instance; + }); + if (activeInstances.filter(function(data) { + return data.doc === doc; + }).length === 0) { + removeMouseCoordsListener(doc); + } + } return { - onDestroy: function onDestroy2() { - enableInstances(true); + onCreate: create, + onDestroy: destroy, + onBeforeUpdate: function onBeforeUpdate() { + prevProps = instance.props; }, - onHidden: function onHidden2() { - currentTarget = null; + onAfterUpdate: function onAfterUpdate(_2, _ref2) { + var followCursor3 = _ref2.followCursor; + if (isInternalUpdate) { + return; + } + if (followCursor3 !== void 0 && prevProps.followCursor !== followCursor3) { + destroy(); + if (followCursor3) { + create(); + if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) { + addListener(); + } + } else { + removeListener(); + unsetGetReferenceClientRect(); + } + } }, - onClickOutside: function onClickOutside2(instance) { - if (instance.props.showOnCreate && !shownOnCreate) { - shownOnCreate = true; - currentTarget = null; + onMount: function onMount() { + if (instance.props.followCursor && !wasFocusEvent) { + if (isUnmounted) { + onMouseMove(mouseCoords); + isUnmounted = false; + } + if (!getIsInitialBehavior()) { + addListener(); + } } }, - onShow: function onShow2(instance) { - if (instance.props.showOnCreate && !shownOnCreate) { - shownOnCreate = true; - prepareInstance(instance, references[0]); + onTrigger: function onTrigger(_2, event) { + if (isMouseEvent(event)) { + mouseCoords = { + clientX: event.clientX, + clientY: event.clientY + }; } + wasFocusEvent = event.type === "focus"; }, - onTrigger: function onTrigger2(instance, event) { - prepareInstance(instance, event.currentTarget); + onHidden: function onHidden() { + if (instance.props.followCursor) { + unsetGetReferenceClientRect(); + removeListener(); + isUnmounted = true; + } } }; } }; - var singleton = tippy(div(), Object.assign({}, removeProperties(optionalProps, ["overrides"]), { - plugins: [plugin2].concat(optionalProps.plugins || []), - triggerTarget: triggerTargets, - popperOptions: Object.assign({}, optionalProps.popperOptions, { - modifiers: [].concat(((_optionalProps$popper = optionalProps.popperOptions) == null ? void 0 : _optionalProps$popper.modifiers) || [], [applyStylesModifier]) - }) - })); - var originalShow = singleton.show; - singleton.show = function(target) { - originalShow(); - if (!currentTarget && target == null) { - return prepareInstance(singleton, references[0]); + function getProps(props, modifier) { + var _props$popperOptions; + return { + popperOptions: Object.assign({}, props.popperOptions, { + modifiers: [].concat((((_props$popperOptions = props.popperOptions) == null ? void 0 : _props$popperOptions.modifiers) || []).filter(function(_ref) { + var name = _ref.name; + return name !== modifier.name; + }), [modifier]) + }) + }; + } + var inlinePositioning = { + name: "inlinePositioning", + defaultValue: false, + fn: function fn(instance) { + var reference = instance.reference; + function isEnabled() { + return !!instance.props.inlinePositioning; + } + var placement; + var cursorRectIndex = -1; + var isInternalUpdate = false; + var triedPlacements = []; + var modifier = { + name: "tippyInlinePositioning", + enabled: true, + phase: "afterWrite", + fn: function fn2(_ref2) { + var state = _ref2.state; + if (isEnabled()) { + if (triedPlacements.indexOf(state.placement) !== -1) { + triedPlacements = []; + } + if (placement !== state.placement && triedPlacements.indexOf(state.placement) === -1) { + triedPlacements.push(state.placement); + instance.setProps({ + // @ts-ignore - unneeded DOMRect properties + getReferenceClientRect: function getReferenceClientRect() { + return _getReferenceClientRect(state.placement); + } + }); + } + placement = state.placement; + } + } + }; + function _getReferenceClientRect(placement2) { + return getInlineBoundingClientRect(getBasePlacement(placement2), reference.getBoundingClientRect(), arrayFrom(reference.getClientRects()), cursorRectIndex); + } + function setInternalProps(partialProps) { + isInternalUpdate = true; + instance.setProps(partialProps); + isInternalUpdate = false; + } + function addModifier() { + if (!isInternalUpdate) { + setInternalProps(getProps(instance.props, modifier)); + } + } + return { + onCreate: addModifier, + onAfterUpdate: addModifier, + onTrigger: function onTrigger(_2, event) { + if (isMouseEvent(event)) { + var rects = arrayFrom(instance.reference.getClientRects()); + var cursorRect = rects.find(function(rect) { + return rect.left - 2 <= event.clientX && rect.right + 2 >= event.clientX && rect.top - 2 <= event.clientY && rect.bottom + 2 >= event.clientY; + }); + var index = rects.indexOf(cursorRect); + cursorRectIndex = index > -1 ? index : cursorRectIndex; + } + }, + onHidden: function onHidden() { + cursorRectIndex = -1; + } + }; } - if (currentTarget && target == null) { - return; + }; + function getInlineBoundingClientRect(currentBasePlacement, boundingRect, clientRects, cursorRectIndex) { + if (clientRects.length < 2 || currentBasePlacement === null) { + return boundingRect; } - if (typeof target === "number") { - return references[target] && prepareInstance(singleton, references[target]); + if (clientRects.length === 2 && cursorRectIndex >= 0 && clientRects[0].left > clientRects[1].right) { + return clientRects[cursorRectIndex] || boundingRect; } - if (individualInstances.indexOf(target) >= 0) { - var ref = target.reference; - return prepareInstance(singleton, ref); + switch (currentBasePlacement) { + case "top": + case "bottom": { + var firstRect = clientRects[0]; + var lastRect = clientRects[clientRects.length - 1]; + var isTop = currentBasePlacement === "top"; + var top = firstRect.top; + var bottom = lastRect.bottom; + var left = isTop ? firstRect.left : lastRect.left; + var right = isTop ? firstRect.right : lastRect.right; + var width = right - left; + var height = bottom - top; + return { + top, + bottom, + left, + right, + width, + height + }; + } + case "left": + case "right": { + var minLeft = Math.min.apply(Math, clientRects.map(function(rects) { + return rects.left; + })); + var maxRight = Math.max.apply(Math, clientRects.map(function(rects) { + return rects.right; + })); + var measureRects = clientRects.filter(function(rect) { + return currentBasePlacement === "left" ? rect.left === minLeft : rect.right === maxRight; + }); + var _top = measureRects[0].top; + var _bottom = measureRects[measureRects.length - 1].bottom; + var _left = minLeft; + var _right = maxRight; + var _width = _right - _left; + var _height = _bottom - _top; + return { + top: _top, + bottom: _bottom, + left: _left, + right: _right, + width: _width, + height: _height + }; + } + default: { + return boundingRect; + } } - if (references.indexOf(target) >= 0) { - return prepareInstance(singleton, target); + } + var sticky = { + name: "sticky", + defaultValue: false, + fn: function fn(instance) { + var reference = instance.reference, popper = instance.popper; + function getReference() { + return instance.popperInstance ? instance.popperInstance.state.elements.reference : reference; + } + function shouldCheck(value) { + return instance.props.sticky === true || instance.props.sticky === value; + } + var prevRefRect = null; + var prevPopRect = null; + function updatePosition() { + var currentRefRect = shouldCheck("reference") ? getReference().getBoundingClientRect() : null; + var currentPopRect = shouldCheck("popper") ? popper.getBoundingClientRect() : null; + if (currentRefRect && areRectsDifferent(prevRefRect, currentRefRect) || currentPopRect && areRectsDifferent(prevPopRect, currentPopRect)) { + if (instance.popperInstance) { + instance.popperInstance.update(); + } + } + prevRefRect = currentRefRect; + prevPopRect = currentPopRect; + if (instance.state.isMounted) { + requestAnimationFrame(updatePosition); + } + } + return { + onMount: function onMount() { + if (instance.props.sticky) { + updatePosition(); + } + } + }; } }; - singleton.showNext = function() { - var first = references[0]; - if (!currentTarget) { - return singleton.show(0); + function areRectsDifferent(rectA, rectB) { + if (rectA && rectB) { + return rectA.top !== rectB.top || rectA.right !== rectB.right || rectA.bottom !== rectB.bottom || rectA.left !== rectB.left; } - var index = references.indexOf(currentTarget); - singleton.show(references[index + 1] || first); - }; - singleton.showPrevious = function() { - var last = references[references.length - 1]; - if (!currentTarget) { - return singleton.show(last); - } - var index = references.indexOf(currentTarget); - var target = references[index - 1] || last; - singleton.show(target); - }; - var originalSetProps = singleton.setProps; - singleton.setProps = function(props) { - overrides = props.overrides || overrides; - originalSetProps(props); - }; - singleton.setInstances = function(nextInstances) { - enableInstances(true); - interceptSetPropsCleanups.forEach(function(fn3) { - return fn3(); - }); - individualInstances = nextInstances; - enableInstances(false); - setReferences(); - setTriggerTargets(); - interceptSetPropsCleanups = interceptSetProps(singleton); - singleton.setProps({ - triggerTarget: triggerTargets - }); - }; - interceptSetPropsCleanups = interceptSetProps(singleton); - return singleton; - }; - var mouseCoords = { - clientX: 0, - clientY: 0 - }; - var activeInstances = []; - function storeMouseCoords(_ref) { - var clientX = _ref.clientX, clientY = _ref.clientY; - mouseCoords = { - clientX, - clientY - }; + return true; + } + tippy2.setDefaultProps({ + render + }); + exports.animateFill = animateFill; + exports.createSingleton = createSingleton2; + exports.default = tippy2; + exports.delegate = delegate; + exports.followCursor = followCursor2; + exports.hideAll = hideAll2; + exports.inlinePositioning = inlinePositioning; + exports.roundArrow = ROUND_ARROW; + exports.sticky = sticky; } - function addMouseCoordsListener(doc) { - doc.addEventListener("mousemove", storeMouseCoords); - } - function removeMouseCoordsListener(doc) { - doc.removeEventListener("mousemove", storeMouseCoords); - } - var followCursor = { - name: "followCursor", - defaultValue: false, - fn: function fn2(instance) { - var reference2 = instance.reference; - var doc = getOwnerDocument(instance.props.triggerTarget || reference2); - var isInternalUpdate = false; - var wasFocusEvent = false; - var isUnmounted = true; - var prevProps = instance.props; - function getIsInitialBehavior() { - return instance.props.followCursor === "initial" && instance.state.isVisible; +}); + +// ../../../node_modules/@jaames/iro/dist/iro.js +var require_iro = __commonJS({ + "../../../node_modules/@jaames/iro/dist/iro.js"(exports, module) { + (function(global2, factory) { + typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global2 = global2 || self, global2.iro = factory()); + })(exports, function() { + "use strict"; + var n2, u2, t2, i2, r2, o2, f2 = {}, e2 = [], c2 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i; + function s2(n3, l2) { + for (var u3 in l2) { + n3[u3] = l2[u3]; + } + return n3; } - function addListener() { - doc.addEventListener("mousemove", onMouseMove); + function a2(n3) { + var l2 = n3.parentNode; + l2 && l2.removeChild(n3); } - function removeListener() { - doc.removeEventListener("mousemove", onMouseMove); + function h2(n3, l2, u3) { + var t3, i3, r3, o3, f3 = arguments; + if (l2 = s2({}, l2), arguments.length > 3) { + for (u3 = [u3], t3 = 3; t3 < arguments.length; t3++) { + u3.push(f3[t3]); + } + } + if (null != u3 && (l2.children = u3), null != n3 && null != n3.defaultProps) { + for (i3 in n3.defaultProps) { + void 0 === l2[i3] && (l2[i3] = n3.defaultProps[i3]); + } + } + return o3 = l2.key, null != (r3 = l2.ref) && delete l2.ref, null != o3 && delete l2.key, v2(n3, l2, o3, r3); } - function unsetGetReferenceClientRect() { - isInternalUpdate = true; - instance.setProps({ - getReferenceClientRect: null - }); - isInternalUpdate = false; + function v2(l2, u3, t3, i3) { + var r3 = { type: l2, props: u3, key: t3, ref: i3, __k: null, __p: null, __b: 0, __e: null, l: null, __c: null, constructor: void 0 }; + return n2.vnode && n2.vnode(r3), r3; } - function onMouseMove(event) { - var isCursorOverReference = event.target ? reference2.contains(event.target) : true; - var followCursor2 = instance.props.followCursor; - var clientX = event.clientX, clientY = event.clientY; - var rect = reference2.getBoundingClientRect(); - var relativeX = clientX - rect.left; - var relativeY = clientY - rect.top; - if (isCursorOverReference || !instance.props.interactive) { - instance.setProps({ - // @ts-ignore - unneeded DOMRect properties - getReferenceClientRect: function getReferenceClientRect() { - var rect2 = reference2.getBoundingClientRect(); - var x3 = clientX; - var y3 = clientY; - if (followCursor2 === "initial") { - x3 = rect2.left + relativeX; - y3 = rect2.top + relativeY; - } - var top2 = followCursor2 === "horizontal" ? rect2.top : y3; - var right2 = followCursor2 === "vertical" ? rect2.right : x3; - var bottom2 = followCursor2 === "horizontal" ? rect2.bottom : y3; - var left2 = followCursor2 === "vertical" ? rect2.left : x3; - return { - width: right2 - left2, - height: bottom2 - top2, - top: top2, - right: right2, - bottom: bottom2, - left: left2 - }; - } - }); - } + function d2(n3) { + return n3.children; } - function create() { - if (instance.props.followCursor) { - activeInstances.push({ - instance, - doc - }); - addMouseCoordsListener(doc); + function y2(n3) { + if (null == n3 || "boolean" == typeof n3) { + return null; } + if ("string" == typeof n3 || "number" == typeof n3) { + return v2(null, n3, null, null); + } + if (null != n3.__e || null != n3.__c) { + var l2 = v2(n3.type, n3.props, n3.key, null); + return l2.__e = n3.__e, l2; + } + return n3; } - function destroy() { - activeInstances = activeInstances.filter(function(data2) { - return data2.instance !== instance; - }); - if (activeInstances.filter(function(data2) { - return data2.doc === doc; - }).length === 0) { - removeMouseCoordsListener(doc); + function m2(n3, l2) { + this.props = n3, this.context = l2; + } + function w2(n3, l2) { + if (null == l2) { + return n3.__p ? w2(n3.__p, n3.__p.__k.indexOf(n3) + 1) : null; } + for (var u3; l2 < n3.__k.length; l2++) { + if (null != (u3 = n3.__k[l2]) && null != u3.__e) { + return u3.__e; + } + } + return "function" == typeof n3.type ? w2(n3) : null; } - return { - onCreate: create, - onDestroy: destroy, - onBeforeUpdate: function onBeforeUpdate2() { - prevProps = instance.props; - }, - onAfterUpdate: function onAfterUpdate2(_3, _ref2) { - var followCursor2 = _ref2.followCursor; - if (isInternalUpdate) { - return; + function g2(n3) { + var l2, u3; + if (null != (n3 = n3.__p) && null != n3.__c) { + for (n3.__e = n3.__c.base = null, l2 = 0; l2 < n3.__k.length; l2++) { + if (null != (u3 = n3.__k[l2]) && null != u3.__e) { + n3.__e = n3.__c.base = u3.__e; + break; + } } - if (followCursor2 !== void 0 && prevProps.followCursor !== followCursor2) { - destroy(); - if (followCursor2) { - create(); - if (instance.state.isMounted && !wasFocusEvent && !getIsInitialBehavior()) { - addListener(); - } + return g2(n3); + } + } + function k2(l2) { + (!l2.__d && (l2.__d = true) && 1 === u2.push(l2) || i2 !== n2.debounceRendering) && (i2 = n2.debounceRendering, (n2.debounceRendering || t2)(_2)); + } + function _2() { + var n3, l2, t3, i3, r3, o3, f3, e3; + for (u2.sort(function(n4, l3) { + return l3.__v.__b - n4.__v.__b; + }); n3 = u2.pop(); ) { + n3.__d && (t3 = void 0, i3 = void 0, o3 = (r3 = (l2 = n3).__v).__e, f3 = l2.__P, e3 = l2.u, l2.u = false, f3 && (t3 = [], i3 = $2(f3, r3, s2({}, r3), l2.__n, void 0 !== f3.ownerSVGElement, null, t3, e3, null == o3 ? w2(r3) : o3), j2(t3, r3), i3 != o3 && g2(r3))); + } + } + function b2(n3, l2, u3, t3, i3, r3, o3, c3, s3) { + var h3, v3, p2, d3, y3, m3, g3, k3 = u3 && u3.__k || e2, _3 = k3.length; + if (c3 == f2 && (c3 = null != r3 ? r3[0] : _3 ? w2(u3, 0) : null), h3 = 0, l2.__k = x2(l2.__k, function(u4) { + if (null != u4) { + if (u4.__p = l2, u4.__b = l2.__b + 1, null === (p2 = k3[h3]) || p2 && u4.key == p2.key && u4.type === p2.type) { + k3[h3] = void 0; } else { - removeListener(); - unsetGetReferenceClientRect(); + for (v3 = 0; v3 < _3; v3++) { + if ((p2 = k3[v3]) && u4.key == p2.key && u4.type === p2.type) { + k3[v3] = void 0; + break; + } + p2 = null; + } } - } - }, - onMount: function onMount2() { - if (instance.props.followCursor && !wasFocusEvent) { - if (isUnmounted) { - onMouseMove(mouseCoords); - isUnmounted = false; + if (d3 = $2(n3, u4, p2 = p2 || f2, t3, i3, r3, o3, null, c3, s3), (v3 = u4.ref) && p2.ref != v3 && (g3 || (g3 = [])).push(v3, u4.__c || d3, u4), null != d3) { + if (null == m3 && (m3 = d3), null != u4.l) { + d3 = u4.l, u4.l = null; + } else if (r3 == p2 || d3 != c3 || null == d3.parentNode) { + n: + if (null == c3 || c3.parentNode !== n3) { + n3.appendChild(d3); + } else { + for (y3 = c3, v3 = 0; (y3 = y3.nextSibling) && v3 < _3; v3 += 2) { + if (y3 == d3) { + break n; + } + } + n3.insertBefore(d3, c3); + } + "option" == l2.type && (n3.value = ""); + } + c3 = d3.nextSibling, "function" == typeof l2.type && (l2.l = d3); } - if (!getIsInitialBehavior()) { - addListener(); - } } - }, - onTrigger: function onTrigger2(_3, event) { - if (isMouseEvent(event)) { - mouseCoords = { - clientX: event.clientX, - clientY: event.clientY - }; + return h3++, u4; + }), l2.__e = m3, null != r3 && "function" != typeof l2.type) { + for (h3 = r3.length; h3--; ) { + null != r3[h3] && a2(r3[h3]); } - wasFocusEvent = event.type === "focus"; - }, - onHidden: function onHidden2() { - if (instance.props.followCursor) { - unsetGetReferenceClientRect(); - removeListener(); - isUnmounted = true; + } + for (h3 = _3; h3--; ) { + null != k3[h3] && D2(k3[h3], k3[h3]); + } + if (g3) { + for (h3 = 0; h3 < g3.length; h3++) { + A2(g3[h3], g3[++h3], g3[++h3]); } } - }; - } - }; - tippy.setDefaultProps({ - render - }); - var tippy_esm_default = tippy; - - // base/tippy/plugins/hide_on_esc.js - var hide_on_esc_default = hideOnEsc = { - name: "hideOnEsc", - defaultValue: true, - fn({ hide: hide2 }) { - function onKeyDown(event) { - if (event.keyCode === 27) { - hide2(); + } + function x2(n3, l2, u3) { + if (null == u3 && (u3 = []), null == n3 || "boolean" == typeof n3) { + l2 && u3.push(l2(null)); + } else if (Array.isArray(n3)) { + for (var t3 = 0; t3 < n3.length; t3++) { + x2(n3[t3], l2, u3); + } + } else { + u3.push(l2 ? l2(y2(n3)) : n3); } + return u3; } - return { - onShow() { - document.addEventListener("keydown", onKeyDown); - }, - onHide() { - document.removeEventListener("keydown", onKeyDown); + function C2(n3, l2, u3, t3, i3) { + var r3; + for (r3 in u3) { + r3 in l2 || N2(n3, r3, null, u3[r3], t3); } - }; - } - }; - - // base/tippy/index.js - tippy_esm_default.setDefaultProps({ - theme: null, - allowHTML: true, - arrow: ROUND_ARROW + ROUND_ARROW, - plugins: [hide_on_esc_default, followCursor] - }); - var tippy_default = tippy_esm_default; - - // base/alpine/utils/tippy_modifiers.js - function tippyModifiers(modifiers) { - if (modifiers.length === 0) - return {}; - const config = { - plugins: [] - }; - const getModifierArgument = (modifier) => { - return modifiers[modifiers.indexOf(modifier) + 1]; - }; - if (modifiers.includes("duration")) { - config.duration = parseInt(getModifierArgument("duration")); - } - if (modifiers.includes("delay")) { - const delay3 = getModifierArgument("delay"); - config.delay = delay3.includes("-") ? delay3.split("-").map((n3) => parseInt(n3)) : parseInt(delay3); - } - if (modifiers.includes("debounce") && config.interactive) { - config.interactiveDebounce = parseInt(getModifierArgument("debounce")); - } - if (modifiers.includes("theme")) { - config.theme = getModifierArgument("theme"); - } - if (modifiers.includes("placement")) { - config.placement = getModifierArgument("placement"); - } - return config; - } - - // base/alpine/directives/tooltip.js - function tooltip_default(Alpine3) { - Alpine3.directive( - "tooltip", - (el, { modifiers, expression }, { evaluate: evaluate2, evaluateLater: evaluateLater2, effect: effect7 }) => { - const config = tippyModifiers(modifiers); - if (!el.__x_tippy) { - el.__x_tippy = tippy_default(el, __spreadValues({ - theme: "coco-tooltip" - }, config)); + for (r3 in l2) { + i3 && "function" != typeof l2[r3] || "value" === r3 || "checked" === r3 || u3[r3] === l2[r3] || N2(n3, r3, l2[r3], u3[r3], t3); } - let initialContent = null; - const enableTooltip = () => el.__x_tippy.enable(); - const disableTooltip = () => el.__x_tippy.disable(); - const setupTooltip = (content2) => { - if (!content2) { - disableTooltip(); + } + function P2(n3, l2, u3) { + "-" === l2[0] ? n3.setProperty(l2, u3) : n3[l2] = "number" == typeof u3 && false === c2.test(l2) ? u3 + "px" : null == u3 ? "" : u3; + } + function N2(n3, l2, u3, t3, i3) { + var r3, o3, f3, e3, c3; + if ("key" === (l2 = i3 ? "className" === l2 ? "class" : l2 : "class" === l2 ? "className" : l2) || "children" === l2) + ; + else if ("style" === l2) { + if (r3 = n3.style, "string" == typeof u3) { + r3.cssText = u3; } else { - enableTooltip(); - el.__x_tippy.setContent(content2); - initialContent = initialContent || content2; + if ("string" == typeof t3 && (r3.cssText = "", t3 = null), t3) { + for (o3 in t3) { + u3 && o3 in u3 || P2(r3, o3, ""); + } + } + if (u3) { + for (f3 in u3) { + t3 && u3[f3] === t3[f3] || P2(r3, f3, u3[f3]); + } + } } - }; - if (modifiers.includes("raw")) { - setupTooltip(expression); } else { - const getContent = evaluateLater2(expression); - effect7(() => { - getContent((content2) => { - if (typeof content2 === "object" && content2 !== null) { - el.__x_tippy.setProps(content2); - initialContent = initialContent || content2.content; - enableTooltip(); + "o" === l2[0] && "n" === l2[1] ? (e3 = l2 !== (l2 = l2.replace(/Capture$/, "")), c3 = l2.toLowerCase(), l2 = (c3 in n3 ? c3 : l2).slice(2), u3 ? (t3 || n3.addEventListener(l2, T2, e3), (n3.t || (n3.t = {}))[l2] = u3) : n3.removeEventListener(l2, T2, e3)) : "list" !== l2 && "tagName" !== l2 && "form" !== l2 && !i3 && l2 in n3 ? n3[l2] = null == u3 ? "" : u3 : "function" != typeof u3 && "dangerouslySetInnerHTML" !== l2 && (l2 !== (l2 = l2.replace(/^xlink:?/, "")) ? null == u3 || false === u3 ? n3.removeAttributeNS("http://www.w3.org/1999/xlink", l2.toLowerCase()) : n3.setAttributeNS("http://www.w3.org/1999/xlink", l2.toLowerCase(), u3) : null == u3 || false === u3 ? n3.removeAttribute(l2) : n3.setAttribute(l2, u3)); + } + } + function T2(l2) { + return this.t[l2.type](n2.event ? n2.event(l2) : l2); + } + function $2(l2, u3, t3, i3, r3, o3, f3, e3, c3, a3) { + var h3, v3, p2, y3, w3, g3, k3, _3, C3, P3, N3 = u3.type; + if (void 0 !== u3.constructor) { + return null; + } + (h3 = n2.__b) && h3(u3); + try { + n: + if ("function" == typeof N3) { + if (_3 = u3.props, C3 = (h3 = N3.contextType) && i3[h3.__c], P3 = h3 ? C3 ? C3.props.value : h3.__p : i3, t3.__c ? k3 = (v3 = u3.__c = t3.__c).__p = v3.__E : ("prototype" in N3 && N3.prototype.render ? u3.__c = v3 = new N3(_3, P3) : (u3.__c = v3 = new m2(_3, P3), v3.constructor = N3, v3.render = H2), C3 && C3.sub(v3), v3.props = _3, v3.state || (v3.state = {}), v3.context = P3, v3.__n = i3, p2 = v3.__d = true, v3.__h = []), null == v3.__s && (v3.__s = v3.state), null != N3.getDerivedStateFromProps && s2(v3.__s == v3.state ? v3.__s = s2({}, v3.__s) : v3.__s, N3.getDerivedStateFromProps(_3, v3.__s)), p2) { + null == N3.getDerivedStateFromProps && null != v3.componentWillMount && v3.componentWillMount(), null != v3.componentDidMount && f3.push(v3); } else { - setupTooltip(content2); + if (null == N3.getDerivedStateFromProps && null == e3 && null != v3.componentWillReceiveProps && v3.componentWillReceiveProps(_3, P3), !e3 && null != v3.shouldComponentUpdate && false === v3.shouldComponentUpdate(_3, v3.__s, P3)) { + for (v3.props = _3, v3.state = v3.__s, v3.__d = false, v3.__v = u3, u3.__e = null != c3 ? c3 !== t3.__e ? c3 : t3.__e : null, u3.__k = t3.__k, h3 = 0; h3 < u3.__k.length; h3++) { + u3.__k[h3] && (u3.__k[h3].__p = u3); + } + break n; + } + null != v3.componentWillUpdate && v3.componentWillUpdate(_3, v3.__s, P3); } - }); - }); + for (y3 = v3.props, w3 = v3.state, v3.context = P3, v3.props = _3, v3.state = v3.__s, (h3 = n2.__r) && h3(u3), v3.__d = false, v3.__v = u3, v3.__P = l2, h3 = v3.render(v3.props, v3.state, v3.context), u3.__k = x2(null != h3 && h3.type == d2 && null == h3.key ? h3.props.children : h3), null != v3.getChildContext && (i3 = s2(s2({}, i3), v3.getChildContext())), p2 || null == v3.getSnapshotBeforeUpdate || (g3 = v3.getSnapshotBeforeUpdate(y3, w3)), b2(l2, u3, t3, i3, r3, o3, f3, c3, a3), v3.base = u3.__e; h3 = v3.__h.pop(); ) { + v3.__s && (v3.state = v3.__s), h3.call(v3); + } + p2 || null == y3 || null == v3.componentDidUpdate || v3.componentDidUpdate(y3, w3, g3), k3 && (v3.__E = v3.__p = null); + } else { + u3.__e = z2(t3.__e, u3, t3, i3, r3, o3, f3, a3); + } + (h3 = n2.diffed) && h3(u3); + } catch (l3) { + n2.__e(l3, u3, t3); } - setData(el, { - tooltip: { - setContent(content2) { - setupTooltip(content2); - }, - disable: () => disableTooltip(), - enable: () => enableTooltip(), - reset() { - if (initialContent) - setupTooltip(initialContent); + return u3.__e; + } + function j2(l2, u3) { + for (var t3; t3 = l2.pop(); ) { + try { + t3.componentDidMount(); + } catch (l3) { + n2.__e(l3, t3.__v); + } + } + n2.__c && n2.__c(u3); + } + function z2(n3, l2, u3, t3, i3, r3, o3, c3) { + var s3, a3, h3, v3, p2 = u3.props, d3 = l2.props; + if (i3 = "svg" === l2.type || i3, null == n3 && null != r3) { + for (s3 = 0; s3 < r3.length; s3++) { + if (null != (a3 = r3[s3]) && (null === l2.type ? 3 === a3.nodeType : a3.localName === l2.type)) { + n3 = a3, r3[s3] = null; + break; } } - }); + } + if (null == n3) { + if (null === l2.type) { + return document.createTextNode(d3); + } + n3 = i3 ? document.createElementNS("http://www.w3.org/2000/svg", l2.type) : document.createElement(l2.type), r3 = null; + } + return null === l2.type ? p2 !== d3 && (null != r3 && (r3[r3.indexOf(n3)] = null), n3.data = d3) : l2 !== u3 && (null != r3 && (r3 = e2.slice.call(n3.childNodes)), h3 = (p2 = u3.props || f2).dangerouslySetInnerHTML, v3 = d3.dangerouslySetInnerHTML, c3 || (v3 || h3) && (v3 && h3 && v3.__html == h3.__html || (n3.innerHTML = v3 && v3.__html || "")), C2(n3, d3, p2, i3, c3), l2.__k = l2.props.children, v3 || b2(n3, l2, u3, t3, "foreignObject" !== l2.type && i3, r3, o3, f2, c3), c3 || ("value" in d3 && void 0 !== d3.value && d3.value !== n3.value && (n3.value = null == d3.value ? "" : d3.value), "checked" in d3 && void 0 !== d3.checked && d3.checked !== n3.checked && (n3.checked = d3.checked))), n3; } - ).before("bind"); - } - - // base/alpine/directives/destroy.js - function destroy_default(Alpine3) { - Alpine3.directive( - "destroy", - (el, { expression }, { evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { - const clean2 = evaluateLater2(expression); - cleanup2(() => clean2()); + function A2(l2, u3, t3) { + try { + "function" == typeof l2 ? l2(u3) : l2.current = u3; + } catch (l3) { + n2.__e(l3, t3); + } } - ); - } - - // base/alpine/directives/dropdown.js - function dropdown_default(Alpine3) { - Alpine3.directive( - "dropdown", - (el, { value, modifiers, expression }, { evaluate: evaluate2, effect: effect7 }) => { - if (value) - return; - const data2 = getData(el); - const settings = tippyModifiers(modifiers); - const result = expression ? evaluate2(expression) : {}; - const directiveConfig = isObject2(result) ? result : {}; - let _a = directiveConfig, { triggerTarget, contentTarget, anchorTarget } = _a, config = __objRest(_a, ["triggerTarget", "contentTarget", "anchorTarget"]); - contentTarget = contentTarget || el.querySelector("[x-dropdown\\:content]"); - content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget; - triggerTarget = triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el; - anchorTarget = anchorTarget || el.querySelector("[x-dropdown\\:anchor]") || el; - if (!el.__x_dropdown) { - const mixin = Alpine3.reactive({ - dropdown: { - open: false, - trigger: triggerTarget, - content: contentTarget, - hide() { - el.__x_dropdown.hide(); - }, - show() { - el.__x_dropdown.show(); + function D2(l2, u3, t3) { + var i3, r3, o3; + if (n2.unmount && n2.unmount(l2), (i3 = l2.ref) && A2(i3, null, u3), t3 || "function" == typeof l2.type || (t3 = null != (r3 = l2.__e)), l2.__e = l2.l = null, null != (i3 = l2.__c)) { + if (i3.componentWillUnmount) { + try { + i3.componentWillUnmount(); + } catch (l3) { + n2.__e(l3, u3); + } + } + i3.base = i3.__P = null; + } + if (i3 = l2.__k) { + for (o3 = 0; o3 < i3.length; o3++) { + i3[o3] && D2(i3[o3], u3, t3); + } + } + null != r3 && a2(r3); + } + function H2(n3, l2, u3) { + return this.constructor(n3, u3); + } + function I2(l2, u3, t3) { + var i3, o3, c3; + n2.__p && n2.__p(l2, u3), o3 = (i3 = t3 === r2) ? null : t3 && t3.__k || u3.__k, l2 = h2(d2, null, [l2]), c3 = [], $2(u3, i3 ? u3.__k = l2 : (t3 || u3).__k = l2, o3 || f2, f2, void 0 !== u3.ownerSVGElement, t3 && !i3 ? [t3] : o3 ? null : e2.slice.call(u3.childNodes), c3, false, t3 || f2, i3), j2(c3, l2); + } + n2 = {}, m2.prototype.setState = function(n3, l2) { + var u3 = this.__s !== this.state && this.__s || (this.__s = s2({}, this.state)); + ("function" != typeof n3 || (n3 = n3(u3, this.props))) && s2(u3, n3), null != n3 && this.__v && (this.u = false, l2 && this.__h.push(l2), k2(this)); + }, m2.prototype.forceUpdate = function(n3) { + this.__v && (n3 && this.__h.push(n3), this.u = true, k2(this)); + }, m2.prototype.render = d2, u2 = [], t2 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, i2 = n2.debounceRendering, n2.__e = function(n3, l2, u3) { + for (var t3; l2 = l2.__p; ) { + if ((t3 = l2.__c) && !t3.__p) { + try { + if (t3.constructor && null != t3.constructor.getDerivedStateFromError) { + t3.setState(t3.constructor.getDerivedStateFromError(n3)); + } else { + if (null == t3.componentDidCatch) { + continue; + } + t3.componentDidCatch(n3); } + return k2(t3.__E = t3); + } catch (l3) { + n3 = l3; } - }); - setData(el, mixin); - const dropdown = el.__x_dropdown = tippy_default(anchorTarget, __spreadValues(__spreadValues({ - theme: "coco-app-dropdown", - placement: "bottom-start", - offset: [0, 0], - trigger: "click", - interactive: true, - animation: false, - maxWidth: 380, - triggerTarget, - content, - onShow: (...args) => { - mixin.dropdown.open = true; - data2.$dispatch("dropdown:show", { dropdown: el.__x_dropdown }); - }, - onHide: (...args) => { - mixin.dropdown.open = false; - data2.$dispatch("dropdown:hide", { dropdown: el.__x_dropdown }); - }, - onMount() { - data2.$dispatch("dropdown:mount", { dropdown: el.__x_dropdown }); - }, - onCreate() { - data2.$dispatch("dropdown:create", { dropdown: el.__x_dropdown }); - } - }, settings), config)); + } } + throw n3; + }, r2 = f2, o2 = 0; + function _defineProperties(target, props) { + for (var i3 = 0; i3 < props.length; i3++) { + var descriptor = props[i3]; + descriptor.enumerable = descriptor.enumerable || false; + descriptor.configurable = true; + if ("value" in descriptor) { + descriptor.writable = true; + } + Object.defineProperty(target, descriptor.key, descriptor); + } } - ).before("bind"); - } - - // base/alpine/directives/dimensions.js - function dimensions_default(Alpine3) { - Alpine3.directive( - "dimensions", - (el, { value, modifiers, expression }, { evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { - if (value) - return; - const data2 = getData(el); - let target; - if (modifiers.includes("parent")) { - target = el.parentNode; - } else { - target = el.querySelector("[x-dimensions\\:target]") || el; + function _createClass(Constructor, protoProps, staticProps) { + if (protoProps) { + _defineProperties(Constructor.prototype, protoProps); } - const evaluate2 = evaluateLater2(expression); - const sizeObserver = new ResizeObserver((entries) => { - const dimensions = entries[0].contentRect; - evaluate2(() => { - }, { - scope: { - dimensions: { - width: dimensions.width, - height: dimensions.height, - x: dimensions.x, - y: dimensions.y + if (staticProps) { + _defineProperties(Constructor, staticProps); + } + return Constructor; + } + function _extends() { + _extends = Object.assign || function(target) { + var arguments$1 = arguments; + for (var i3 = 1; i3 < arguments.length; i3++) { + var source = arguments$1[i3]; + for (var key in source) { + if (Object.prototype.hasOwnProperty.call(source, key)) { + target[key] = source[key]; } } - }); - }); - sizeObserver.observe(target); - cleanup2(() => { - sizeObserver && sizeObserver.disconnect(); - }); + } + return target; + }; + return _extends.apply(this, arguments); } - ); - } - - // base/alpine/directives/notification.js - function notification_default(Alpine3) { - let notificationId = 0; - let queuePosition = 0; - Alpine3.directive("notification", (el, { expression }, { evaluate: evaluate2 }) => { - notificationId++; - const data2 = getData(el); - const type = evaluate2(expression); - const options = evaluate2("$options"); - const notification = Alpine3.reactive({ - id: notificationId, - type, - autoShow: options.show, - showDelay: options.showDelay, - shown: false, - autoDismiss: options.dismiss, - dismissDelay: options.dismissDelay, - dismissed: false, - dismissTimer: null, - position: options.position, - queuePosition: 0, - init() { - data2.$dispatch(`${type}:init`, { - id: notification.id, - type: notification.type, - [type]: notification - }); - if (notification.autoShow) { - setTimeout(() => notification.show(), notification.showDelay); + var CSS_INTEGER = "[-\\+]?\\d+%?"; + var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; + var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; + var PERMISSIVE_MATCH_3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var PERMISSIVE_MATCH_4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; + var REGEX_FUNCTIONAL_RGB = new RegExp("rgb" + PERMISSIVE_MATCH_3); + var REGEX_FUNCTIONAL_RGBA = new RegExp("rgba" + PERMISSIVE_MATCH_4); + var REGEX_FUNCTIONAL_HSL = new RegExp("hsl" + PERMISSIVE_MATCH_3); + var REGEX_FUNCTIONAL_HSLA = new RegExp("hsla" + PERMISSIVE_MATCH_4); + var HEX_START = "^(?:#?|0x?)"; + var HEX_INT_SINGLE = "([0-9a-fA-F]{1})"; + var HEX_INT_DOUBLE = "([0-9a-fA-F]{2})"; + var REGEX_HEX_3 = new RegExp(HEX_START + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + "$"); + var REGEX_HEX_4 = new RegExp(HEX_START + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + "$"); + var REGEX_HEX_6 = new RegExp(HEX_START + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + "$"); + var REGEX_HEX_8 = new RegExp(HEX_START + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + "$"); + var KELVIN_MIN = 2e3; + var KELVIN_MAX = 4e4; + var log = Math.log, round = Math.round, floor = Math.floor; + function clamp(num, min, max) { + return Math.min(Math.max(num, min), max); + } + function parseUnit(str, max) { + var isPercentage = str.indexOf("%") > -1; + var num = parseFloat(str); + return isPercentage ? max / 100 * num : num; + } + function parseHexInt(str) { + return parseInt(str, 16); + } + function intToHex(_int) { + return _int.toString(16).padStart(2, "0"); + } + var IroColor = /* @__PURE__ */ function() { + function IroColor2(value, onChange) { + this.$ = { + h: 0, + s: 0, + v: 0, + a: 1 + }; + if (value) { + this.set(value); } - }, - show() { - if (!notification.shown) { - notification.queuePosition = queuePosition++; - notification.startAutoDismiss(); - notification.shown = true; - data2.$dispatch(`${type}:show`, { - id: notification.id, - queuePosition: notification.queuePosition, - type: notification.type, - [type]: notification + this.onChange = onChange; + this.initialValue = _extends({}, this.$); + } + var _proto = IroColor2.prototype; + _proto.set = function set(value) { + if (typeof value === "string") { + if (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value)) { + this.hexString = value; + } else if (/^rgba?/.test(value)) { + this.rgbString = value; + } else if (/^hsla?/.test(value)) { + this.hslString = value; + } + } else if (typeof value === "object") { + if (value instanceof IroColor2) { + this.hsva = value.hsva; + } else if ("r" in value && "g" in value && "b" in value) { + this.rgb = value; + } else if ("h" in value && "s" in value && "v" in value) { + this.hsv = value; + } else if ("h" in value && "s" in value && "l" in value) { + this.hsl = value; + } else if ("kelvin" in value) { + this.kelvin = value.kelvin; + } + } else { + throw new Error("Invalid color value"); + } + }; + _proto.setChannel = function setChannel(format, channel, value) { + var _extends2; + this[format] = _extends({}, this[format], (_extends2 = {}, _extends2[channel] = value, _extends2)); + }; + _proto.reset = function reset() { + this.hsva = this.initialValue; + }; + _proto.clone = function clone() { + return new IroColor2(this); + }; + _proto.unbind = function unbind() { + this.onChange = void 0; + }; + IroColor2.hsvToRgb = function hsvToRgb(hsv) { + var h3 = hsv.h / 60; + var s3 = hsv.s / 100; + var v3 = hsv.v / 100; + var i3 = floor(h3); + var f3 = h3 - i3; + var p2 = v3 * (1 - s3); + var q2 = v3 * (1 - f3 * s3); + var t3 = v3 * (1 - (1 - f3) * s3); + var mod2 = i3 % 6; + var r3 = [v3, q2, p2, p2, t3, v3][mod2]; + var g3 = [t3, v3, v3, q2, p2, p2][mod2]; + var b3 = [p2, p2, t3, v3, v3, q2][mod2]; + return { + r: clamp(r3 * 255, 0, 255), + g: clamp(g3 * 255, 0, 255), + b: clamp(b3 * 255, 0, 255) + }; + }; + IroColor2.rgbToHsv = function rgbToHsv(rgb) { + var r3 = rgb.r / 255; + var g3 = rgb.g / 255; + var b3 = rgb.b / 255; + var max = Math.max(r3, g3, b3); + var min = Math.min(r3, g3, b3); + var delta = max - min; + var hue = 0; + var value = max; + var saturation = max === 0 ? 0 : delta / max; + switch (max) { + case min: + hue = 0; + break; + case r3: + hue = (g3 - b3) / delta + (g3 < b3 ? 6 : 0); + break; + case g3: + hue = (b3 - r3) / delta + 2; + break; + case b3: + hue = (r3 - g3) / delta + 4; + break; + } + return { + h: hue * 60 % 360, + s: clamp(saturation * 100, 0, 100), + v: clamp(value * 100, 0, 100) + }; + }; + IroColor2.hsvToHsl = function hsvToHsl(hsv) { + var s3 = hsv.s / 100; + var v3 = hsv.v / 100; + var l2 = (2 - s3) * v3; + var divisor = l2 <= 1 ? l2 : 2 - l2; + var saturation = divisor < 1e-9 ? 0 : s3 * v3 / divisor; + return { + h: hsv.h, + s: clamp(saturation * 100, 0, 100), + l: clamp(l2 * 50, 0, 100) + }; + }; + IroColor2.hslToHsv = function hslToHsv(hsl) { + var l2 = hsl.l * 2; + var s3 = hsl.s * (l2 <= 100 ? l2 : 200 - l2) / 100; + var saturation = l2 + s3 < 1e-9 ? 0 : 2 * s3 / (l2 + s3); + return { + h: hsl.h, + s: clamp(saturation * 100, 0, 100), + v: clamp((l2 + s3) / 2, 0, 100) + }; + }; + IroColor2.kelvinToRgb = function kelvinToRgb(kelvin) { + var temp = kelvin / 100; + var r3, g3, b3; + if (temp < 66) { + r3 = 255; + g3 = -155.25485562709179 - 0.44596950469579133 * (g3 = temp - 2) + 104.49216199393888 * log(g3); + b3 = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b3 = temp - 10) + 115.67994401066147 * log(b3); + } else { + r3 = 351.97690566805693 + 0.114206453784165 * (r3 = temp - 55) - 40.25366309332127 * log(r3); + g3 = 325.4494125711974 + 0.07943456536662342 * (g3 = temp - 50) - 28.0852963507957 * log(g3); + b3 = 255; + } + return { + r: clamp(floor(r3), 0, 255), + g: clamp(floor(g3), 0, 255), + b: clamp(floor(b3), 0, 255) + }; + }; + IroColor2.rgbToKelvin = function rgbToKelvin(rgb) { + var r3 = rgb.r, b3 = rgb.b; + var eps = 0.4; + var minTemp = KELVIN_MIN; + var maxTemp = KELVIN_MAX; + var temp; + while (maxTemp - minTemp > eps) { + temp = (maxTemp + minTemp) * 0.5; + var _rgb = IroColor2.kelvinToRgb(temp); + if (_rgb.b / _rgb.r >= b3 / r3) { + maxTemp = temp; + } else { + minTemp = temp; + } + } + return temp; + }; + _createClass(IroColor2, [{ + key: "hsv", + get: function get() { + var value = this.$; + return { + h: value.h, + s: value.s, + v: value.v + }; + }, + set: function set(newValue) { + var oldValue = this.$; + newValue = _extends({}, oldValue, newValue); + if (this.onChange) { + var changes = { + h: false, + v: false, + s: false, + a: false + }; + for (var key in oldValue) { + changes[key] = newValue[key] != oldValue[key]; + } + this.$ = newValue; + if (changes.h || changes.s || changes.v || changes.a) { + this.onChange(this, changes); + } + } else { + this.$ = newValue; + } + } + }, { + key: "hsva", + get: function get() { + return _extends({}, this.$); + }, + set: function set(value) { + this.hsv = value; + } + }, { + key: "hue", + get: function get() { + return this.$.h; + }, + set: function set(value) { + this.hsv = { + h: value + }; + } + }, { + key: "saturation", + get: function get() { + return this.$.s; + }, + set: function set(value) { + this.hsv = { + s: value + }; + } + }, { + key: "value", + get: function get() { + return this.$.v; + }, + set: function set(value) { + this.hsv = { + v: value + }; + } + }, { + key: "alpha", + get: function get() { + return this.$.a; + }, + set: function set(value) { + this.hsv = _extends({}, this.hsv, { + a: value }); } - }, - dismiss() { - notification.dismissed = true; - notification.clearAutoDismiss(); - data2.$dispatch(`${type}:dismiss`, { - id: notification.id, - [type]: notification - }); - setTimeout(() => el.remove(), 500); - }, - startAutoDismiss() { - if (notification.autoDismiss === true) { - notification.dismissTimer = setTimeout( - () => notification.dismiss(), - notification.dismissDelay - ); + }, { + key: "kelvin", + get: function get() { + return IroColor2.rgbToKelvin(this.rgb); + }, + set: function set(value) { + this.rgb = IroColor2.kelvinToRgb(value); } - }, - clearAutoDismiss() { - clearTimeout(notification.dismissTimer); - }, - clearFromQueue(event) { - if (notification.type === event.detail.type && notification.position === "fixed" && notification.id !== event.detail.id && notification.queuePosition < event.detail.queuePosition) { - notification.dismiss(); + }, { + key: "red", + get: function get() { + var rgb = this.rgb; + return rgb.r; + }, + set: function set(value) { + this.rgb = _extends({}, this.rgb, { + r: value + }); } - } - }); - setData(el, { notification }); - evaluate2("notification.init"); - }).before("init"); - } - - // base/alpine/index.js - window.Alpine = module_default; - module_default.plugin(module_default5); - module_default.plugin(module_default6); - module_default.plugin(module_default2); - module_default.plugin(module_default3); - module_default.plugin(module_default4); - module_default.plugin(undo_default); - module_default.plugin(options_default); - module_default.plugin(tooltip_default); - module_default.plugin(destroy_default); - module_default.plugin(dropdown_default); - module_default.plugin(dimensions_default); - module_default.plugin(notification_default); - var alpine_default2 = module_default; - - // base/setup.js - console.info("Initializing Coco JS", package_default.version); - - // ../../components/coco/buttons/button/button.js - var button_exports = {}; - __export(button_exports, { - default: () => button_default - }); - - // base/coco.js - function CocoComponent(name, fn3) { - const func = nameFunction(name, (...args) => { - const data2 = fn3(...args); - Object.defineProperties(data2, { - $parent: { - get() { - return getData(this.$root.parentElement); + }, { + key: "green", + get: function get() { + var rgb = this.rgb; + return rgb.g; + }, + set: function set(value) { + this.rgb = _extends({}, this.rgb, { + g: value + }); } - } - }); - data2.$options = {}; - return data2; - }); - func.component = true; - return func; - } - - // ../../components/coco/buttons/button/button.js - var import_lodash2 = __toESM(require_lodash(), 1); - var button_default = CocoComponent("button", (data2 = {}) => { - return __spreadProps(__spreadValues({ - options: ["state", "confirm", "size", "disabled", "collapsible"], - isCollapsed: false, - approving: false, - confirmed: true, - lastState: null, - stateTooltips: data2.tooltips || {}, - tooltipText: null - }, data2.props || {}), { - init() { - this.lastState = this.state; - this.checkConfirmation = this.checkConfirmation.bind(this); - this.approveAndRun = this.approveAndRun.bind(this); - this.shouldShowTooltip = this.shouldShowTooltip.bind(this); - this.$nextTick(() => { - if (this.$options.confirm) { - this.confirmed = false; + }, { + key: "blue", + get: function get() { + var rgb = this.rgb; + return rgb.b; + }, + set: function set(value) { + this.rgb = _extends({}, this.rgb, { + b: value + }); } - }); - this.$watch("collapsed", (collapsed) => { - if (collapsed && !this.collapsible) { - this.collapsed = false; - return; + }, { + key: "rgb", + get: function get() { + var _IroColor$hsvToRgb = IroColor2.hsvToRgb(this.$), r3 = _IroColor$hsvToRgb.r, g3 = _IroColor$hsvToRgb.g, b3 = _IroColor$hsvToRgb.b; + return { + r: round(r3), + g: round(g3), + b: round(b3) + }; + }, + set: function set(value) { + this.hsv = _extends({}, IroColor2.rgbToHsv(value), { + a: value.a === void 0 ? 1 : value.a + }); } - this.$root.setAttribute("data-collapsed", collapsed ? "true" : "false"); - }); - }, - setTooltipText() { - if (this.disabled) { - this.tooltipText = null; - return; - } - const defaultContent = this.$el.getAttribute("data-tippy-content"); - const tooltipForState = this.stateTooltips[this.state]; - if (this.collapsed) { - const labelText = this.getContentForState(this.state); - this.tooltipText = tooltipForState || labelText || defaultContent; + }, { + key: "rgba", + get: function get() { + return _extends({}, this.rgb, { + a: this.alpha + }); + }, + set: function set(value) { + this.rgb = value; + } + }, { + key: "hsl", + get: function get() { + var _IroColor$hsvToHsl = IroColor2.hsvToHsl(this.$), h3 = _IroColor$hsvToHsl.h, s3 = _IroColor$hsvToHsl.s, l2 = _IroColor$hsvToHsl.l; + return { + h: round(h3), + s: round(s3), + l: round(l2) + }; + }, + set: function set(value) { + this.hsv = _extends({}, IroColor2.hslToHsv(value), { + a: value.a === void 0 ? 1 : value.a + }); + } + }, { + key: "hsla", + get: function get() { + return _extends({}, this.hsl, { + a: this.alpha + }); + }, + set: function set(value) { + this.hsl = value; + } + }, { + key: "rgbString", + get: function get() { + var rgb = this.rgb; + return "rgb(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ")"; + }, + set: function set(value) { + var match; + var r3, g3, b3, a3 = 1; + if (match = REGEX_FUNCTIONAL_RGB.exec(value)) { + r3 = parseUnit(match[1], 255); + g3 = parseUnit(match[2], 255); + b3 = parseUnit(match[3], 255); + } else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) { + r3 = parseUnit(match[1], 255); + g3 = parseUnit(match[2], 255); + b3 = parseUnit(match[3], 255); + a3 = parseUnit(match[4], 1); + } + if (match) { + this.rgb = { + r: r3, + g: g3, + b: b3, + a: a3 + }; + } else { + throw new Error("Invalid rgb string"); + } + } + }, { + key: "rgbaString", + get: function get() { + var rgba = this.rgba; + return "rgba(" + rgba.r + ", " + rgba.g + ", " + rgba.b + ", " + rgba.a + ")"; + }, + set: function set(value) { + this.rgbString = value; + } + }, { + key: "hexString", + get: function get() { + var rgb = this.rgb; + return "#" + intToHex(rgb.r) + intToHex(rgb.g) + intToHex(rgb.b); + }, + set: function set(value) { + var match; + var r3, g3, b3, a3 = 255; + if (match = REGEX_HEX_3.exec(value)) { + r3 = parseHexInt(match[1]) * 17; + g3 = parseHexInt(match[2]) * 17; + b3 = parseHexInt(match[3]) * 17; + } else if (match = REGEX_HEX_4.exec(value)) { + r3 = parseHexInt(match[1]) * 17; + g3 = parseHexInt(match[2]) * 17; + b3 = parseHexInt(match[3]) * 17; + a3 = parseHexInt(match[4]) * 17; + } else if (match = REGEX_HEX_6.exec(value)) { + r3 = parseHexInt(match[1]); + g3 = parseHexInt(match[2]); + b3 = parseHexInt(match[3]); + } else if (match = REGEX_HEX_8.exec(value)) { + r3 = parseHexInt(match[1]); + g3 = parseHexInt(match[2]); + b3 = parseHexInt(match[3]); + a3 = parseHexInt(match[4]); + } + if (match) { + this.rgb = { + r: r3, + g: g3, + b: b3, + a: a3 / 255 + }; + } else { + throw new Error("Invalid hex string"); + } + } + }, { + key: "hex8String", + get: function get() { + var rgba = this.rgba; + return "#" + intToHex(rgba.r) + intToHex(rgba.g) + intToHex(rgba.b) + intToHex(floor(rgba.a * 255)); + }, + set: function set(value) { + this.hexString = value; + } + }, { + key: "hslString", + get: function get() { + var hsl = this.hsl; + return "hsl(" + hsl.h + ", " + hsl.s + "%, " + hsl.l + "%)"; + }, + set: function set(value) { + var match; + var h3, s3, l2, a3 = 1; + if (match = REGEX_FUNCTIONAL_HSL.exec(value)) { + h3 = parseUnit(match[1], 360); + s3 = parseUnit(match[2], 100); + l2 = parseUnit(match[3], 100); + } else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) { + h3 = parseUnit(match[1], 360); + s3 = parseUnit(match[2], 100); + l2 = parseUnit(match[3], 100); + a3 = parseUnit(match[4], 1); + } + if (match) { + this.hsl = { + h: h3, + s: s3, + l: l2, + a: a3 + }; + } else { + throw new Error("Invalid hsl string"); + } + } + }, { + key: "hslaString", + get: function get() { + var hsla = this.hsla; + return "hsla(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")"; + }, + set: function set(value) { + this.hslString = value; + } + }]); + return IroColor2; + }(); + var sliderDefaultOptions = { + sliderShape: "bar", + sliderType: "value", + minTemperature: 2200, + maxTemperature: 11e3 + }; + function getSliderDimensions(props) { + var _sliderSize; + var width = props.width, sliderSize = props.sliderSize, borderWidth = props.borderWidth, handleRadius = props.handleRadius, padding = props.padding, sliderShape = props.sliderShape; + var ishorizontal = props.layoutDirection === "horizontal"; + sliderSize = (_sliderSize = sliderSize) != null ? _sliderSize : padding * 2 + handleRadius * 2; + if (sliderShape === "circle") { + return { + handleStart: props.padding + props.handleRadius, + handleRange: width - padding * 2 - handleRadius * 2, + width, + height: width, + cx: width / 2, + cy: width / 2, + radius: width / 2 - borderWidth / 2 + }; } else { - this.tooltipText = tooltipForState || defaultContent; + return { + handleStart: sliderSize / 2, + handleRange: width - sliderSize, + radius: sliderSize / 2, + x: 0, + y: 0, + width: ishorizontal ? sliderSize : width, + height: ishorizontal ? width : sliderSize + }; } - }, - shouldShowTooltip() { - return !!this.tooltipText; - }, - get disabled() { - return this.$options.disabled === true; - }, - set disabled(value) { - this.$options.disabled = value; - }, - get tippyInstance() { - return this.$root.__x_tippy; - }, - /* confirmation */ - checkConfirmation(event) { - if (!this.confirmed) { - this.approving = true; - event.preventDefault(); + } + function getCurrentSliderValue(props, color) { + var hsva = color.hsva; + var rgb = color.rgb; + switch (props.sliderType) { + case "red": + return rgb.r / 2.55; + case "green": + return rgb.g / 2.55; + case "blue": + return rgb.b / 2.55; + case "alpha": + return hsva.a * 100; + case "kelvin": + var minTemperature = props.minTemperature, maxTemperature = props.maxTemperature; + var temperatureRange = maxTemperature - minTemperature; + var percent = (color.kelvin - minTemperature) / temperatureRange * 100; + return Math.max(0, Math.min(percent, 100)); + case "hue": + return hsva.h /= 3.6; + case "saturation": + return hsva.s; + case "value": + default: + return hsva.v; } - }, - approveAndRun(event) { - if (this.approving) { - event.stopPropagation(); - this.confirmed = true; - this.dropdown.trigger.click(); - this.dropdown.hide(); - this.confirmed = false; - this.approving = false; + } + function getSliderValueFromInput(props, x3, y3) { + var _getSliderDimensions = getSliderDimensions(props), handleRange = _getSliderDimensions.handleRange, handleStart = _getSliderDimensions.handleStart; + var handlePos; + if (props.layoutDirection === "horizontal") { + handlePos = -1 * y3 + handleRange + handleStart; + } else { + handlePos = x3 - handleStart; } - }, - cancelConfirmation(event) { - if (this.approving) { - event.stopPropagation(); - this.approving = false; - this.dropdown.hide(); + handlePos = Math.max(Math.min(handlePos, handleRange), 0); + var percent = Math.round(100 / handleRange * handlePos); + switch (props.sliderType) { + case "kelvin": + var minTemperature = props.minTemperature, maxTemperature = props.maxTemperature; + var temperatureRange = maxTemperature - minTemperature; + return minTemperature + temperatureRange * (percent / 100); + case "alpha": + return percent / 100; + case "hue": + return percent * 3.6; + case "red": + case "blue": + case "green": + return percent * 2.55; + default: + return percent; } - }, - /* state */ - get state() { - return this.$options.state || "default"; - }, - set state(name) { - this.setState(name); - }, - get loading() { - return this.state === "loading"; - }, - set loading(value) { - this.$options.state = value === true ? "loading" : "default"; - }, - setState(name) { - this.lastState = this.state; - this.$options.state = (0, import_lodash2.camelCase)(name); - }, - resetState() { - this.$options.state = this.lastState || "default"; - this.lastState = this.$options.state; - }, - toggleState(state1, state2 = this.laststate) { - this.state = this.state === state1 ? state2 : state1; - }, - getContentForState(state) { - const content2 = this.$refs[`${state}Content`]; - return content2 ? content2.innerText : null; - }, - hasIconForState(state) { - return !!this.$refs[`${state}Icon`]; - }, - hasContentForState(state) { - return !!this.getContentForState(state); - }, - showIcon(state) { - return state === this.state || !this.hasIconForState(this.state) && state === "default"; - }, - showContent(state) { - return state === this.state || !this.hasContentForState(this.state) && state === "default"; - }, - /* collapsing */ - get collapsed() { - return this.isCollapsed; - }, - set collapsed(value) { - this.isCollapsed = this.collapsible ? value : false; - }, - get collapsible() { - return this.$options.collapsible !== false && this.hasIconForState(this.$options.state || "default"); - }, - /* bindings */ - root: { - "x-options": "options", - "x-tooltip": "tooltipText", - "x-effect": "setTooltipText", - ":disabled": "disabled" } - }); - }); - - // ../../components/coco/buttons/button/button_dropdown.js - var button_dropdown_exports = {}; - __export(button_dropdown_exports, { - default: () => button_dropdown_default - }); - var button_dropdown_default = CocoComponent("buttonDropdown", () => { - return { - dropdown: null, - button: null, - init() { - this.$nextTick(() => { - this.button = getComponent(this.$el.querySelector(".coco-button")); - }); - }, - hideDropdown() { - if (this.dropdown) { - this.dropdown.hide(); + function getSliderHandlePosition(props, color) { + var _getSliderDimensions2 = getSliderDimensions(props), width = _getSliderDimensions2.width, height = _getSliderDimensions2.height, handleRange = _getSliderDimensions2.handleRange, handleStart = _getSliderDimensions2.handleStart; + var ishorizontal = props.layoutDirection === "horizontal"; + var sliderValue = getCurrentSliderValue(props, color); + var midPoint = ishorizontal ? width / 2 : height / 2; + var handlePos = handleStart + sliderValue / 100 * handleRange; + if (ishorizontal) { + handlePos = -1 * handlePos + handleRange + handleStart * 2; } - }, - showDropdown() { - if (this.dropdown) { - this.dropdown.show(); + return { + x: ishorizontal ? midPoint : handlePos, + y: ishorizontal ? handlePos : midPoint + }; + } + function getSliderGradient(props, color) { + var hsv = color.hsv; + var rgb = color.rgb; + switch (props.sliderType) { + case "red": + return [[0, "rgb(0," + rgb.g + "," + rgb.b + ")"], [100, "rgb(255," + rgb.g + "," + rgb.b + ")"]]; + case "green": + return [[0, "rgb(" + rgb.r + ",0," + rgb.b + ")"], [100, "rgb(" + rgb.r + ",255," + rgb.b + ")"]]; + case "blue": + return [[0, "rgb(" + rgb.r + "," + rgb.g + ",0)"], [100, "rgb(" + rgb.r + "," + rgb.g + ",255)"]]; + case "alpha": + return [[0, "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0)"], [100, "rgb(" + rgb.r + "," + rgb.g + "," + rgb.b + ")"]]; + case "kelvin": + var stops = []; + var min = props.minTemperature; + var max = props.maxTemperature; + var numStops = 8; + var range = max - min; + for (var kelvin = min, stop = 0; kelvin < max; kelvin += range / numStops, stop += 1) { + var _IroColor$kelvinToRgb = IroColor.kelvinToRgb(kelvin), r3 = _IroColor$kelvinToRgb.r, g3 = _IroColor$kelvinToRgb.g, b3 = _IroColor$kelvinToRgb.b; + stops.push([100 / numStops * stop, "rgb(" + r3 + "," + g3 + "," + b3 + ")"]); + } + return stops; + case "hue": + return [[0, "#f00"], [16.666, "#ff0"], [33.333, "#0f0"], [50, "#0ff"], [66.666, "#00f"], [83.333, "#f0f"], [100, "#f00"]]; + case "saturation": + var noSat = IroColor.hsvToHsl({ + h: hsv.h, + s: 0, + v: hsv.v + }); + var fullSat = IroColor.hsvToHsl({ + h: hsv.h, + s: 100, + v: hsv.v + }); + return [[0, "hsl(" + noSat.h + "," + noSat.s + "%," + noSat.l + "%)"], [100, "hsl(" + fullSat.h + "," + fullSat.s + "%," + fullSat.l + "%)"]]; + case "value": + default: + var hsl = IroColor.hsvToHsl({ + h: hsv.h, + s: hsv.s, + v: 100 + }); + return [[0, "#000"], [100, "hsl(" + hsl.h + "," + hsl.s + "%," + hsl.l + "%)"]]; } - }, - /* bindings */ - root: { - "@dropdown:show": "button.setState('active')", - "@dropdown:hide": "button.resetState()", - "@confirmation:confirm": "button.approveAndRun($event)", - "@confirmation:cancel": "button.cancelConfirmation($event)" } - }; - }); - - // ../../components/coco/buttons/button_group/button_group.js - var button_group_exports = {}; - __export(button_group_exports, { - default: () => button_group_default - }); - var button_group_default = CocoComponent("appButtonGroup", () => { - return { - options: ["collapsible"], - ready: false, - containerWidth: 0, - contentWidth: 0, - collapsed: false, - singletonTooltip: null, - tooltipInstances: [], - get collapsible() { - return this.$options.collapsible !== false; - }, - get buttons() { - const buttonElements = this.$el.querySelectorAll( - "[data-component='button']" - ); - return Array.from(buttonElements).map((el) => getComponent(el)); - }, - get parent() { - return this.$root.parentElement; - }, - init() { - if (this.collapsible) { - this.$nextTick(() => { - this.onResize(); - this.createSingletonTooltip(); - this.ready = true; - }); - } else { - this.ready = true; + var TAU = Math.PI * 2; + var mod = function mod2(a3, n3) { + return (a3 % n3 + n3) % n3; + }; + var dist = function dist2(x3, y3) { + return Math.sqrt(x3 * x3 + y3 * y3); + }; + function getHandleRange(props) { + return props.width / 2 - props.padding - props.handleRadius - props.borderWidth; + } + function isInputInsideWheel(props, x3, y3) { + var _getWheelDimensions = getWheelDimensions(props), cx = _getWheelDimensions.cx, cy = _getWheelDimensions.cy; + var r3 = props.width / 2; + return dist(cx - x3, cy - y3) < r3; + } + function getWheelDimensions(props) { + var r3 = props.width / 2; + return { + width: props.width, + radius: r3 - props.borderWidth, + cx: r3, + cy: r3 + }; + } + function translateWheelAngle(props, angle, invert) { + var wheelAngle = props.wheelAngle; + var wheelDirection = props.wheelDirection; + if (invert && wheelDirection === "clockwise") { + angle = wheelAngle + angle; + } else if (wheelDirection === "clockwise") { + angle = 360 - wheelAngle + angle; + } else if (invert && wheelDirection === "anticlockwise") { + angle = wheelAngle + 180 - angle; + } else if (wheelDirection === "anticlockwise") { + angle = wheelAngle - angle; } - this.$watch("collapsed", (value) => { - this.buttons.forEach((button) => { - button.isCollapsed = value; - }); - this.$nextTick(() => this.createSingletonTooltip()); - }); - }, - createSingletonTooltip() { - this.destroySingletonTooltip(); - this.tooltipInstances = this.buttons.map((button) => { - if (button.tippyInstance && button.shouldShowTooltip && button.shouldShowTooltip()) { - return button.tippyInstance; - } - }).filter((t3) => t3); - this.singletonTooltip = createSingleton(this.tooltipInstances, { - theme: "coco-tooltip", - delay: 100, - moveTransition: "transform 0.1s ease-out" - }); - }, - destroySingletonTooltip() { - if (this.singletonTooltip && this.singletonTooltip.destroy) { - this.singletonTooltip.destroy(); - this.singletonTooltip = null; - this.tooltipInstances.forEach((tooltip) => tooltip.destroy()); - this.tooltipInstances = []; + return mod(angle, 360); + } + function getWheelHandlePosition(props, color) { + var hsv = color.hsv; + var _getWheelDimensions2 = getWheelDimensions(props), cx = _getWheelDimensions2.cx, cy = _getWheelDimensions2.cy; + var handleRange = getHandleRange(props); + var handleAngle = (180 + translateWheelAngle(props, hsv.h, true)) * (TAU / 360); + var handleDist = hsv.s / 100 * handleRange; + var direction = props.wheelDirection === "clockwise" ? -1 : 1; + return { + x: cx + handleDist * Math.cos(handleAngle) * direction, + y: cy + handleDist * Math.sin(handleAngle) * direction + }; + } + function getWheelValueFromInput(props, x3, y3) { + var _getWheelDimensions3 = getWheelDimensions(props), cx = _getWheelDimensions3.cx, cy = _getWheelDimensions3.cy; + var handleRange = getHandleRange(props); + x3 = cx - x3; + y3 = cy - y3; + var hue = translateWheelAngle(props, Math.atan2(-y3, -x3) * (360 / TAU)); + var handleDist = Math.min(dist(x3, y3), handleRange); + return { + h: Math.round(hue), + s: Math.round(100 / handleRange * handleDist) + }; + } + function getBoxDimensions(props) { + var width = props.width, boxHeight = props.boxHeight, padding = props.padding, handleRadius = props.handleRadius; + return { + width, + height: boxHeight != null ? boxHeight : width, + radius: padding + handleRadius + }; + } + function getBoxValueFromInput(props, x3, y3) { + var _getBoxDimensions = getBoxDimensions(props), width = _getBoxDimensions.width, height = _getBoxDimensions.height, radius = _getBoxDimensions.radius; + var handleStart = radius; + var handleRangeX = width - radius * 2; + var handleRangeY = height - radius * 2; + var percentX = (x3 - handleStart) / handleRangeX * 100; + var percentY = (y3 - handleStart) / handleRangeY * 100; + return { + s: Math.max(0, Math.min(percentX, 100)), + v: Math.max(0, Math.min(100 - percentY, 100)) + }; + } + function getBoxHandlePosition(props, color) { + var _getBoxDimensions2 = getBoxDimensions(props), width = _getBoxDimensions2.width, height = _getBoxDimensions2.height, radius = _getBoxDimensions2.radius; + var hsv = color.hsv; + var handleStart = radius; + var handleRangeX = width - radius * 2; + var handleRangeY = height - radius * 2; + return { + x: handleStart + hsv.s / 100 * handleRangeX, + y: handleStart + (handleRangeY - hsv.v / 100 * handleRangeY) + }; + } + function getBoxGradients(props, color) { + var hue = color.hue; + return [ + // saturation gradient + [[0, "#fff"], [100, "hsl(" + hue + ",100%,50%)"]], + // lightness gradient + [[0, "rgba(0,0,0,0)"], [100, "#000"]] + ]; + } + var BASE_ELEMENTS; + function resolveSvgUrl(url) { + if (!BASE_ELEMENTS) { + BASE_ELEMENTS = document.getElementsByTagName("base"); } - }, - onResize() { - if (!this.collapsible) - return; - this.containerWidth = Math.ceil(this.parent.offsetWidth); - if (this.collapsed) { - if (this.containerWidth > this.contentWidth) { - this.collapsed = false; + var ua = window.navigator.userAgent; + var isSafari = /^((?!chrome|android).)*safari/i.test(ua); + var isIos = /iPhone|iPod|iPad/i.test(ua); + var location2 = window.location; + return (isSafari || isIos) && BASE_ELEMENTS.length > 0 ? location2.protocol + "//" + location2.host + location2.pathname + location2.search + url : url; + } + function getHandleAtPoint(props, x3, y3, handlePositions) { + for (var i3 = 0; i3 < handlePositions.length; i3++) { + var dX = handlePositions[i3].x - x3; + var dY = handlePositions[i3].y - y3; + var dist2 = Math.sqrt(dX * dX + dY * dY); + if (dist2 < props.handleRadius) { + return i3; } - } else { - if (this.containerWidth < this.contentWidth) { - this.collapsed = true; - } else { - const contentWidth = Math.ceil(this.$refs.buttons.scrollWidth); - this.contentWidth = contentWidth; - } } - }, - destroy() { - if (this.singletonTooltip) { - this.singletonTooltip.destroy(); - this.singletonTooltip = null; - } + return null; } - }; - }); - - // ../../components/coco/buttons/color_picker_button/color_picker_button.js - var color_picker_button_exports = {}; - __export(color_picker_button_exports, { - default: () => color_picker_button_default - }); - var color_picker_button_default = CocoComponent("colorPickerButton", ({ selected }) => { - selected = selected ? "#" + selected.replace("#", "") : "#FFFFFF"; - return { - selectedColor: selected, - getPicker() { - return getData( - this.$root.querySelector("[data-role='color-picker']").firstElementChild - ); - }, - onDropdownMount() { - this.getPicker().setSelectedColor(this.selectedColor); + function cssBorderStyles(props) { + return { + boxSizing: "border-box", + border: props.borderWidth + "px solid " + props.borderColor + }; } - }; - }); - - // ../../components/coco/buttons/confirm_panel/confirm_panel.js - var confirm_panel_exports = {}; - __export(confirm_panel_exports, { - default: () => confirm_panel_default - }); - var confirm_panel_default = CocoComponent("confirmPanel", () => { - return { - confirm() { - this.$dispatch("confirmation:confirm"); - }, - cancel() { - this.$dispatch("confirmation:cancel"); + function cssGradient(type, direction, stops) { + return type + "-gradient(" + direction + ", " + stops.map(function(_ref) { + var o3 = _ref[0], col = _ref[1]; + return col + " " + o3 + "%"; + }).join(",") + ")"; } - }; - }); - - // ../../components/coco/buttons/image_picker_button/image_picker_button.js - var image_picker_button_exports = {}; - __export(image_picker_button_exports, { - default: () => image_picker_button_default - }); - - // helpers/path.js - function basename(path) { - return path ? path.replace(/.*\//, "") : path; - } - - // ../../components/coco/buttons/image_picker_button/image_picker_button.js - var image_picker_button_default = CocoComponent("imagePickerButton", ({ src }) => { - return { - selectedImage: { - name: basename(src), - file: null, - data: src - }, - getPicker() { - return getData( - this.$root.querySelector("[data-role='image-picker'").firstElementChild - ); - }, - handleExternalDrop(event) { - this.readFile(event.dataTransfer.files[0]); - }, - readFile(file) { - const reader = new FileReader(); - reader.addEventListener("load", () => { - const selectedImage = { - name: file.name, - file, - data: reader.result + function cssValue(value) { + if (typeof value === "string") { + return value; + } + return value + "px"; + } + var iroColorPickerOptionDefaults = { + width: 300, + height: 300, + color: "#fff", + colors: [], + padding: 6, + layoutDirection: "vertical", + borderColor: "#fff", + borderWidth: 0, + handleRadius: 8, + activeHandleRadius: null, + handleSvg: null, + handleProps: { + x: 0, + y: 0 + }, + wheelLightness: true, + wheelAngle: 0, + wheelDirection: "anticlockwise", + sliderSize: null, + sliderMargin: 12, + boxHeight: null + }; + var SECONDARY_EVENTS = [ + "mousemove", + "touchmove", + "mouseup", + "touchend" + /* TouchEnd */ + ]; + var IroComponentWrapper = /* @__PURE__ */ function(Component) { + function IroComponentWrapper2(props) { + Component.call(this, props); + this.uid = (Math.random() + 1).toString(36).substring(5); + } + if (Component) + IroComponentWrapper2.__proto__ = Component; + IroComponentWrapper2.prototype = Object.create(Component && Component.prototype); + IroComponentWrapper2.prototype.constructor = IroComponentWrapper2; + IroComponentWrapper2.prototype.render = function render(props) { + var eventHandler = this.handleEvent.bind(this); + var rootProps = { + onMouseDown: eventHandler, + // https://github.com/jaames/iro.js/issues/126 + // https://github.com/preactjs/preact/issues/2113#issuecomment-553408767 + ontouchstart: eventHandler }; - this.$dispatch("image-picker:change", { image: selectedImage }); - this.selectedImage = selectedImage; - if (this.dropdown) { - this.dropdown.hide(); + var isHorizontal = props.layoutDirection === "horizontal"; + var margin = props.margin === null ? props.sliderMargin : props.margin; + var rootStyles = { + overflow: "visible", + display: isHorizontal ? "inline-block" : "block" + }; + if (props.index > 0) { + rootStyles[isHorizontal ? "marginLeft" : "marginTop"] = margin; } - }); - reader.readAsDataURL(file); - }, - clearSelectedImage() { - this.dropdown.hide(); - this.selectedImage = { name: null, data: null, file: null }; - }, - setSelectedImage(image) { - this.dropdown.hide(); - this.selectedImage = image; - }, - onDropdownMount({ detail }) { - this.dropdown = detail.dropdown; - this.getPicker().setImage(this.selectedImage, true); - } - }; - }); - - // ../../components/coco/buttons/layout_picker_button/layout_picker_button.js - var layout_picker_button_exports = {}; - __export(layout_picker_button_exports, { - default: () => layout_picker_button_default - }); - var layout_picker_button_default = CocoComponent("layoutPickerButton", ({ selected }) => { - return { - selectedLayout: selected, - getPicker() { - return getData( - this.$root.querySelector("[data-role='layout-picker']").firstElementChild + return h2(d2, null, props.children(this.uid, rootProps, rootStyles)); + }; + IroComponentWrapper2.prototype.handleEvent = function handleEvent(e3) { + var this$1 = this; + var inputHandler = this.props.onInput; + var bounds = this.base.getBoundingClientRect(); + e3.preventDefault(); + var point = e3.touches ? e3.changedTouches[0] : e3; + var x3 = point.clientX - bounds.left; + var y3 = point.clientY - bounds.top; + switch (e3.type) { + case "mousedown": + case "touchstart": + var result = inputHandler( + x3, + y3, + 0 + /* Start */ + ); + if (result !== false) { + SECONDARY_EVENTS.forEach(function(event) { + document.addEventListener(event, this$1, { passive: false }); + }); + } + break; + case "mousemove": + case "touchmove": + inputHandler( + x3, + y3, + 1 + /* Move */ + ); + break; + case "mouseup": + case "touchend": + inputHandler( + x3, + y3, + 2 + /* End */ + ); + SECONDARY_EVENTS.forEach(function(event) { + document.removeEventListener(event, this$1, { passive: false }); + }); + break; + } + }; + return IroComponentWrapper2; + }(m2); + function IroHandle(props) { + var radius = props.r; + var url = props.url; + var cx = radius; + var cy = radius; + return h2( + "svg", + { className: "IroHandle IroHandle--" + props.index + " " + (props.isActive ? "IroHandle--isActive" : ""), style: { + "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0);", + transform: "translate(" + cssValue(props.x) + ", " + cssValue(props.y) + ")", + willChange: "transform", + top: cssValue(-radius), + left: cssValue(-radius), + width: cssValue(radius * 2), + height: cssValue(radius * 2), + position: "absolute", + overflow: "visible" + } }, + url && h2("use", Object.assign({ xlinkHref: resolveSvgUrl(url) }, props.props)), + !url && h2("circle", { cx, cy, r: radius, fill: "none", "stroke-width": 2, stroke: "#000" }), + !url && h2("circle", { cx, cy, r: radius - 2, fill: props.fill, "stroke-width": 2, stroke: "#fff" }) ); - }, - getButton() { - return getData(this.$root.querySelector(".layout-picker-trigger")); - }, - init() { - this.$watch("selectedLayout", () => this.getButton().hideDropdown()); } - }; - }); - - // ../../components/coco/buttons/menu_button/menu_button.js - var menu_button_exports = {}; - __export(menu_button_exports, { - default: () => menu_button_default - }); - var menu_button_default = CocoComponent("menuButton", () => { - return {}; - }); - - // ../../components/coco/buttons/toolbar/toolbar.js - var toolbar_exports = {}; - __export(toolbar_exports, { - default: () => toolbar_default - }); - var toolbar_default = CocoComponent("appToolbar", () => { - return { - ready: false, - startSectionWidth: null, - endSectionWidth: null, - get startGroupEl() { - return this.$refs.startSection.firstElementChild; - }, - get endGroupEl() { - return this.$refs.endSection.firstElementChild; - }, - get groups() { - return [this.startGroupEl, this.endGroupEl].filter((g3) => g3).map((el) => getComponent(el, false)); - }, - init() { - const toolbarWidth = this.$el.offsetWidth; - let startSectionWidth = 0; - let endSectionWidth = 0; - if (this.startGroupEl) { - startSectionWidth = Math.ceil( - this.startGroupEl.offsetWidth / toolbarWidth * 100 - ); + IroHandle.defaultProps = { + fill: "none", + x: 0, + y: 0, + r: 8, + url: null, + props: { x: 0, y: 0 } + }; + function IroSlider(props) { + var activeIndex = props.activeIndex; + var activeColor = activeIndex !== void 0 && activeIndex < props.colors.length ? props.colors[activeIndex] : props.color; + var ref = getSliderDimensions(props); + var width = ref.width; + var height = ref.height; + var radius = ref.radius; + var handlePos = getSliderHandlePosition(props, activeColor); + var gradient = getSliderGradient(props, activeColor); + function handleInput(x3, y3, type) { + var value = getSliderValueFromInput(props, x3, y3); + props.parent.inputActive = true; + activeColor[props.sliderType] = value; + props.onInput(type, props.id); } - if (this.endGroupEl) { - endSectionWidth = Math.ceil( - this.endGroupEl.offsetWidth / toolbarWidth * 100 + return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid, rootProps, rootStyles) { + return h2( + "div", + Object.assign({}, rootProps, { className: "IroSlider", style: Object.assign( + {}, + { + position: "relative", + width: cssValue(width), + height: cssValue(height), + borderRadius: cssValue(radius), + // checkered bg to represent alpha + background: "conic-gradient(#ccc 25%, #fff 0 50%, #ccc 0 75%, #fff 0)", + backgroundSize: "8px 8px" + }, + rootStyles + ) }), + h2("div", { className: "IroSliderGradient", style: Object.assign( + {}, + { + position: "absolute", + top: 0, + left: 0, + width: "100%", + height: "100%", + borderRadius: cssValue(radius), + background: cssGradient("linear", props.layoutDirection === "horizontal" ? "to top" : "to right", gradient) + }, + cssBorderStyles(props) + ) }), + h2(IroHandle, { isActive: true, index: activeColor.index, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePos.x, y: handlePos.y }) ); - } - this.$nextTick(() => { - this.startSectionWidth = `${startSectionWidth}%`; - this.endSectionWidth = `${endSectionWidth}%`; - this.groups.forEach((group) => group.onResize()); - this.ready = true; }); } - }; - }); - - // ../../components/coco/images/icon/icon.js - var icon_exports = {}; - __export(icon_exports, { - default: () => icon_default - }); - var icon_default = CocoComponent("icon", () => { - return { - options: ["style", "spin"], - get spin() { - return this.$options.spin; - }, - set spin(val) { - this.$options.spin = val; - }, - get fill() { - return this.$options.style === "fill"; - }, - set fill(val) { - this.$options.style = val === true ? "fill" : "line"; - }, - root: { - "x-options": "options" - } - }; - }); - - // ../../components/coco/images/image_uploader/image_uploader.js - var image_uploader_exports = {}; - __export(image_uploader_exports, { - default: () => image_uploader_default - }); - var image_uploader_default = CocoComponent("imageUploader", ({ click, drop }) => { - return { - file: null, - errors: [], - active: false, - clickable: click, - droppable: drop, - input: null, - get fileName() { - return this.file && this.file.name; - }, - get fileType() { - return this.file && this.file.type; - }, - get fileSize() { - return this.file && this.file.size; - }, - get fileData() { - return this.file && this.file.data; - }, - init() { - this.input = this.$refs.input; - this.$watch("file", (file) => { - const dataTransfer = new DataTransfer(); - if (file && file.file instanceof File) { - dataTransfer.items.add(file.file); + IroSlider.defaultProps = Object.assign({}, sliderDefaultOptions); + function IroBox(props) { + var ref = getBoxDimensions(props); + var width = ref.width; + var height = ref.height; + var radius = ref.radius; + var colors = props.colors; + var colorPicker = props.parent; + var activeIndex = props.activeIndex; + var activeColor = activeIndex !== void 0 && activeIndex < props.colors.length ? props.colors[activeIndex] : props.color; + var gradients = getBoxGradients(props, activeColor); + var handlePositions = colors.map(function(color) { + return getBoxHandlePosition(props, color); + }); + function handleInput(x3, y3, inputType) { + if (inputType === 0) { + var activeHandle = getHandleAtPoint(props, x3, y3, handlePositions); + if (activeHandle !== null) { + colorPicker.setActiveColor(activeHandle); + } else { + colorPicker.inputActive = true; + activeColor.hsv = getBoxValueFromInput(props, x3, y3); + props.onInput(inputType, props.id); + } + } else if (inputType === 1) { + colorPicker.inputActive = true; + activeColor.hsv = getBoxValueFromInput(props, x3, y3); } - this.input.files = dataTransfer.files; + props.onInput(inputType, props.id); + } + return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid, rootProps, rootStyles) { + return h2( + "div", + Object.assign({}, rootProps, { className: "IroBox", style: Object.assign( + {}, + { + width: cssValue(width), + height: cssValue(height), + position: "relative" + }, + rootStyles + ) }), + h2("div", { className: "IroBox", style: Object.assign( + {}, + { + width: "100%", + height: "100%", + borderRadius: cssValue(radius) + }, + cssBorderStyles(props), + { background: cssGradient("linear", "to bottom", gradients[1]) + "," + cssGradient("linear", "to right", gradients[0]) } + ) }), + colors.filter(function(color) { + return color !== activeColor; + }).map(function(color) { + return h2(IroHandle, { isActive: false, index: color.index, fill: color.hslString, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[color.index].x, y: handlePositions[color.index].y }); + }), + h2(IroHandle, { isActive: true, index: activeColor.index, fill: activeColor.hslString, r: props.activeHandleRadius || props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[activeColor.index].x, y: handlePositions[activeColor.index].y }) + ); }); - }, - setFile(file) { - this.file = file; - }, - openPicker() { - this.input.click(); - }, - clear() { - this.file = null; - this.input.value = null; - this.$dispatch("image-uploader:clear"); - }, - handleDrop(event) { - const files = event.detail.files || event.dataTransfer.files; - this.handleFiles(files); - }, - handleFiles(files) { - Array.from(files).forEach((file) => this.readFile(file)); - }, - readFile(file) { - const reader = new FileReader(); - reader.addEventListener("load", () => { - this.file = { - name: file.name, - size: file.size, - type: file.type, - file, - data: reader.result - }; - this.$dispatch("image-uploader:load", { file: this.file }); + } + var HUE_GRADIENT_CLOCKWISE = "conic-gradient(red, yellow, lime, aqua, blue, magenta, red)"; + var HUE_GRADIENT_ANTICLOCKWISE = "conic-gradient(red, magenta, blue, aqua, lime, yellow, red)"; + function IroWheel(props) { + var ref = getWheelDimensions(props); + var width = ref.width; + var colors = props.colors; + var borderWidth = props.borderWidth; + var colorPicker = props.parent; + var activeColor = props.color; + var hsv = activeColor.hsv; + var handlePositions = colors.map(function(color) { + return getWheelHandlePosition(props, color); }); - reader.addEventListener("error", () => { - this.errors.push(`Error reading file: ${file.name}`); + var circleStyles = { + position: "absolute", + top: 0, + left: 0, + width: "100%", + height: "100%", + borderRadius: "50%", + boxSizing: "border-box" + }; + function handleInput(x3, y3, inputType) { + if (inputType === 0) { + if (!isInputInsideWheel(props, x3, y3)) { + return false; + } + var activeHandle = getHandleAtPoint(props, x3, y3, handlePositions); + if (activeHandle !== null) { + colorPicker.setActiveColor(activeHandle); + } else { + colorPicker.inputActive = true; + activeColor.hsv = getWheelValueFromInput(props, x3, y3); + props.onInput(inputType, props.id); + } + } else if (inputType === 1) { + colorPicker.inputActive = true; + activeColor.hsv = getWheelValueFromInput(props, x3, y3); + } + props.onInput(inputType, props.id); + } + return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid, rootProps, rootStyles) { + return h2( + "div", + Object.assign({}, rootProps, { className: "IroWheel", style: Object.assign( + {}, + { + width: cssValue(width), + height: cssValue(width), + position: "relative" + }, + rootStyles + ) }), + h2("div", { className: "IroWheelHue", style: Object.assign( + {}, + circleStyles, + { + transform: "rotateZ(" + (props.wheelAngle + 90) + "deg)", + background: props.wheelDirection === "clockwise" ? HUE_GRADIENT_CLOCKWISE : HUE_GRADIENT_ANTICLOCKWISE + } + ) }), + h2("div", { className: "IroWheelSaturation", style: Object.assign( + {}, + circleStyles, + { background: "radial-gradient(circle closest-side, #fff, transparent)" } + ) }), + props.wheelLightness && h2("div", { className: "IroWheelLightness", style: Object.assign( + {}, + circleStyles, + { + background: "#000", + opacity: 1 - hsv.v / 100 + } + ) }), + h2("div", { className: "IroWheelBorder", style: Object.assign( + {}, + circleStyles, + cssBorderStyles(props) + ) }), + colors.filter(function(color) { + return color !== activeColor; + }).map(function(color) { + return h2(IroHandle, { isActive: false, index: color.index, fill: color.hslString, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[color.index].x, y: handlePositions[color.index].y }); + }), + h2(IroHandle, { isActive: true, index: activeColor.index, fill: activeColor.hslString, r: props.activeHandleRadius || props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[activeColor.index].x, y: handlePositions[activeColor.index].y }) + ); }); - reader.readAsDataURL(file); } - }; - }); - - // ../../components/coco/layout/page/page.js - var page_exports = {}; - __export(page_exports, { - default: () => page_default - }); - var page_default = CocoComponent("pageLayout", () => { - return {}; - }); - - // ../../components/coco/messaging/alert/alert.js - var alert_exports = {}; - __export(alert_exports, { - default: () => alert_default - }); - var alert_default = CocoComponent("alertMessage", () => { - return { - alert: null, - dismissed: false, - forceMultiLine: false, - dismissDuration: 300, - init() { - this.checkSingleLineWrap = Alpine.throttle( - this.checkSingleLineWrap.bind(this), - 200 - ); - }, - dismiss() { - if (this.$options.dismissable) { - this.$dispatch("alert:dismiss", { - alert: this, - duration: this.dismissDuration + function createWidget(WidgetComponent) { + var widgetFactory = function(parent, props) { + var widget; + var widgetRoot = document.createElement("div"); + I2(h2(WidgetComponent, Object.assign( + {}, + { ref: function(ref) { + return widget = ref; + } }, + props + )), widgetRoot); + function mountWidget() { + var container = parent instanceof Element ? parent : document.querySelector(parent); + container.appendChild(widget.base); + widget.onMount(container); + } + if (document.readyState !== "loading") { + mountWidget(); + } else { + document.addEventListener("DOMContentLoaded", mountWidget); + } + return widget; + }; + widgetFactory.prototype = WidgetComponent.prototype; + Object.assign(widgetFactory, WidgetComponent); + widgetFactory.__component = WidgetComponent; + return widgetFactory; + } + var IroColorPicker = /* @__PURE__ */ function(Component) { + function IroColorPicker2(props) { + var this$1 = this; + Component.call(this, props); + this.colors = []; + this.inputActive = false; + this.events = {}; + this.activeEvents = {}; + this.deferredEvents = {}; + this.id = props.id; + var colors = props.colors.length > 0 ? props.colors : [props.color]; + colors.forEach(function(colorValue) { + return this$1.addColor(colorValue); }); - this.dismissed = true; - setTimeout(() => this.remove(), this.dismissDuration); + this.setActiveColor(0); + this.state = Object.assign( + {}, + props, + { + color: this.color, + colors: this.colors, + layout: props.layout + } + ); } - }, - remove() { - this.$nextTick(() => this.$dispatch("alert:removed", { alert: this })); - this.$root.remove(); - }, - checkSingleLineWrap({ height }) { - this.forceMultiLine = false; - if (height > 24 && this.$options.singleLine) { - this.$nextTick(() => { - this.forceMultiLine = true; + if (Component) + IroColorPicker2.__proto__ = Component; + IroColorPicker2.prototype = Object.create(Component && Component.prototype); + IroColorPicker2.prototype.constructor = IroColorPicker2; + IroColorPicker2.prototype.addColor = function addColor(color, index) { + if (index === void 0) + index = this.colors.length; + var newColor = new IroColor(color, this.onColorChange.bind(this)); + this.colors.splice(index, 0, newColor); + this.colors.forEach(function(color2, index2) { + return color2.index = index2; }); + if (this.state) { + this.setState({ colors: this.colors }); + } + this.deferredEmit("color:init", newColor); + }; + IroColorPicker2.prototype.removeColor = function removeColor(index) { + var color = this.colors.splice(index, 1)[0]; + color.unbind(); + this.colors.forEach(function(color2, index2) { + return color2.index = index2; + }); + if (this.state) { + this.setState({ colors: this.colors }); + } + if (color.index === this.color.index) { + this.setActiveColor(0); + } + this.emit("color:remove", color); + }; + IroColorPicker2.prototype.setActiveColor = function setActiveColor(index) { + this.color = this.colors[index]; + if (this.state) { + this.setState({ color: this.color }); + } + this.emit("color:setActive", this.color); + }; + IroColorPicker2.prototype.setColors = function setColors(newColorValues, activeColorIndex) { + var this$1 = this; + if (activeColorIndex === void 0) + activeColorIndex = 0; + this.colors.forEach(function(color) { + return color.unbind(); + }); + this.colors = []; + newColorValues.forEach(function(colorValue) { + return this$1.addColor(colorValue); + }); + this.setActiveColor(activeColorIndex); + this.emit("color:setAll", this.colors); + }; + IroColorPicker2.prototype.on = function on(eventList, callback) { + var this$1 = this; + var events = this.events; + (!Array.isArray(eventList) ? [eventList] : eventList).forEach(function(eventType) { + (events[eventType] || (events[eventType] = [])).push(callback); + if (this$1.deferredEvents[eventType]) { + this$1.deferredEvents[eventType].forEach(function(args) { + callback.apply(null, args); + }); + this$1.deferredEvents[eventType] = []; + } + }); + }; + IroColorPicker2.prototype.off = function off(eventList, callback) { + var this$1 = this; + (!Array.isArray(eventList) ? [eventList] : eventList).forEach(function(eventType) { + var callbackList = this$1.events[eventType]; + if (callbackList) { + callbackList.splice(callbackList.indexOf(callback), 1); + } + }); + }; + IroColorPicker2.prototype.emit = function emit(eventType) { + var this$1 = this; + var args = [], len = arguments.length - 1; + while (len-- > 0) + args[len] = arguments[len + 1]; + var activeEvents = this.activeEvents; + var isEventActive = activeEvents.hasOwnProperty(eventType) ? activeEvents[eventType] : false; + if (!isEventActive) { + activeEvents[eventType] = true; + var callbackList = this.events[eventType] || []; + callbackList.forEach(function(fn) { + return fn.apply(this$1, args); + }); + activeEvents[eventType] = false; + } + }; + IroColorPicker2.prototype.deferredEmit = function deferredEmit(eventType) { + var ref; + var args = [], len = arguments.length - 1; + while (len-- > 0) + args[len] = arguments[len + 1]; + var deferredEvents = this.deferredEvents; + (ref = this).emit.apply(ref, [eventType].concat(args)); + (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args); + }; + IroColorPicker2.prototype.setOptions = function setOptions(newOptions) { + this.setState(newOptions); + }; + IroColorPicker2.prototype.resize = function resize(width) { + this.setOptions({ width }); + }; + IroColorPicker2.prototype.reset = function reset() { + this.colors.forEach(function(color) { + return color.reset(); + }); + this.setState({ colors: this.colors }); + }; + IroColorPicker2.prototype.onMount = function onMount(container) { + this.el = container; + this.deferredEmit("mount", this); + }; + IroColorPicker2.prototype.onColorChange = function onColorChange(color, changes) { + this.setState({ color: this.color }); + if (this.inputActive) { + this.inputActive = false; + this.emit("input:change", color, changes); + } + this.emit("color:change", color, changes); + }; + IroColorPicker2.prototype.emitInputEvent = function emitInputEvent(type, originId) { + if (type === 0) { + this.emit("input:start", this.color, originId); + } else if (type === 1) { + this.emit("input:move", this.color, originId); + } else if (type === 2) { + this.emit("input:end", this.color, originId); + } + }; + IroColorPicker2.prototype.render = function render(props, state) { + var this$1 = this; + var layout = state.layout; + if (!Array.isArray(layout)) { + switch (layout) { + default: + layout = [ + { component: IroWheel }, + { component: IroSlider } + ]; + } + if (state.transparency) { + layout.push({ + component: IroSlider, + options: { + sliderType: "alpha" + } + }); + } + } + return h2("div", { class: "IroColorPicker", id: state.id, style: { + display: state.display + } }, layout.map(function(ref, componentIndex) { + var UiComponent = ref.component; + var options = ref.options; + return h2(UiComponent, Object.assign({}, state, options, { ref: void 0, onInput: this$1.emitInputEvent.bind(this$1), parent: this$1, index: componentIndex })); + })); + }; + return IroColorPicker2; + }(m2); + IroColorPicker.defaultProps = Object.assign( + {}, + iroColorPickerOptionDefaults, + { + colors: [], + display: "block", + id: null, + layout: "default", + margin: null } - }, - root: { - "x-options": '["dismissable", "singleLine", "dismissAfterAction"]', - ":class": "{'force-multi-line': forceMultiLine}" - } - }; - }); + ); + var IroColorPickerWidget = createWidget(IroColorPicker); + var iro2; + (function(iro3) { + iro3.version = "5.5.2"; + iro3.Color = IroColor; + iro3.ColorPicker = IroColorPickerWidget; + var ui; + (function(ui2) { + ui2.h = h2; + ui2.ComponentBase = IroComponentWrapper; + ui2.Handle = IroHandle; + ui2.Slider = IroSlider; + ui2.Wheel = IroWheel; + ui2.Box = IroBox; + })(ui = iro3.ui || (iro3.ui = {})); + })(iro2 || (iro2 = {})); + var iro$1 = iro2; + return iro$1; + }); + } +}); - // ../../components/coco/messaging/notice/notice.js - var notice_exports = {}; - __export(notice_exports, { - default: () => notice_default - }); - var notice_default = CocoComponent("notice", () => { - return {}; - }); - - // ../../components/coco/messaging/snackbar/snackbar.js - var snackbar_exports = {}; - __export(snackbar_exports, { - default: () => snackbar_default - }); - var snackbar_default = CocoComponent("snackbar", () => { - return { - notificationType: "snackbar", - options: ["show", "dismiss", "showDelay", "dismissDelay", "position"], - root: { - "x-options": "options", - "x-notification": "notificationType", - "x-show": "notification.shown && !notification.dismissed", - "@mouseover": "notification.clearAutoDismiss", - "@mouseout": "notification.startAutoDismiss", - "@snackbar:show.document": "notification.clearFromQueue", - "x-transition:enter": "snackbar-enter", - "x-transition:enter-start": "snackbar-enter-start", - "x-transition:enter-end": "snackbar-enter-end", - "x-transition:leave": "snackbar-leave", - "x-transition:leave-start": "snackbar-leave-start", - "x-transition:leave-end": "snackbar-leave-end" - } - }; - }); - - // ../../components/coco/messaging/system_banner/system_banner.js - var system_banner_exports = {}; - __export(system_banner_exports, { - default: () => system_banner_default - }); - - // ../../../node_modules/js-cookie/dist/js.cookie.mjs - function assign(target) { - for (var i3 = 1; i3 < arguments.length; i3++) { - var source = arguments[i3]; - for (var key in source) { - target[key] = source[key]; - } +// ../../../node_modules/container-query-polyfill/dist/container-query-polyfill.modern.js +function e() { + return e = Object.assign ? Object.assign.bind() : function(e2) { + for (var t2 = 1; t2 < arguments.length; t2++) { + var n2 = arguments[t2]; + for (var r2 in n2) + Object.prototype.hasOwnProperty.call(n2, r2) && (e2[r2] = n2[r2]); } - return target; + return e2; + }, e.apply(this, arguments); +} +function t(e2, t2) { + const n2 = t2.width, r2 = t2.height, u2 = t2.inlineSize, o2 = t2.blockSize; + switch (e2) { + case 1: + return null != n2 ? { type: 3, value: n2, unit: "px" } : { type: 1 }; + case 3: + return null != u2 ? { type: 3, value: u2, unit: "px" } : { type: 1 }; + case 2: + return null != r2 ? { type: 3, value: r2, unit: "px" } : { type: 1 }; + case 4: + return null != o2 ? { type: 3, value: o2, unit: "px" } : { type: 1 }; + case 5: + return null != n2 && null != r2 && r2 > 0 ? { type: 2, value: n2 / r2 } : { type: 1 }; + case 6: + return null != n2 && null != r2 ? { type: 4, value: r2 >= n2 ? "portrait" : "landscape" } : { type: 1 }; } - var defaultConverter = { - read: function(value) { - if (value[0] === '"') { - value = value.slice(1, -1); - } - return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); - }, - write: function(value) { - return encodeURIComponent(value).replace( - /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, - decodeURIComponent - ); +} +function n(e2, t2) { + switch (e2.type) { + case 1: + case 2: + case 3: + case 4: + return i(e2, t2); + case 5: { + const n2 = t2.sizeFeatures.get(e2.feature); + return null == n2 ? { type: 1 } : n2; } - }; - function init(converter, defaultAttributes) { - function set3(name, value, attributes) { - if (typeof document === "undefined") { - return; - } - attributes = assign({}, defaultAttributes, attributes); - if (typeof attributes.expires === "number") { - attributes.expires = new Date(Date.now() + attributes.expires * 864e5); - } - if (attributes.expires) { - attributes.expires = attributes.expires.toUTCString(); - } - name = encodeURIComponent(name).replace(/%(2[346B]|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 = name + "=" + converter.write(value, name) + stringifiedAttributes; + case 6: + return e2.value; + } +} +function r(e2) { + return { type: 5, value: e2 }; +} +function u(e2, t2, n2) { + return r(function(e3, t3, n3) { + switch (n3) { + case 1: + return e3 === t3; + case 2: + return e3 > t3; + case 3: + return e3 >= t3; + case 4: + return e3 < t3; + case 5: + return e3 <= t3; } - function get3(name) { - if (typeof document === "undefined" || arguments.length && !name) { - return; + }(e2, t2, n2)); +} +function o(e2, t2, n2) { + return null == e2 ? t2 : null == t2 ? e2 : n2(e2, t2); +} +function s(e2, t2) { + switch (e2) { + case "cqw": + return t2.cqw; + case "cqh": + return t2.cqh; + case "cqi": + return 0 === t2.writingAxis ? t2.cqw : t2.cqh; + case "cqb": + return 1 === t2.writingAxis ? t2.cqw : t2.cqh; + case "cqmin": + return o(s("cqi", t2), s("cqb", t2), Math.min); + case "cqmax": + return o(s("cqi", t2), s("cqb", t2), Math.max); + } +} +function l(e2, { treeContext: t2 }) { + switch (e2.unit) { + case "px": + return e2.value; + case "rem": + return e2.value * t2.rootFontSize; + case "em": + return e2.value * t2.fontSize; + case "cqw": + case "cqh": + case "cqi": + case "cqb": + case "cqmin": + case "cqmax": + return o(e2.value, s(e2.unit, t2), (e3, t3) => e3 * t3); + } + return null; +} +function c(e2, t2) { + switch (e2.type) { + case 2: + return 0 === e2.value ? 0 : null; + case 3: + return l(e2, t2); + } + return null; +} +function i(e2, t2) { + switch (e2.type) { + case 4: + return function(e3, t3) { + const o2 = n(e3.left, t3), s2 = n(e3.right, t3), l2 = e3.operator; + if (4 === o2.type && 4 === s2.type || 5 === o2.type && 5 === s2.type) + return function(e4, t4, n2) { + return 1 === n2 ? r(e4.value === t4.value) : { type: 1 }; + }(o2, s2, l2); + if (3 === o2.type || 3 === s2.type) { + const e4 = c(o2, t3), n2 = c(s2, t3); + if (null != e4 && null != n2) + return u(e4, n2, l2); + } else if (2 === o2.type && 2 === s2.type) + return u(o2.value, s2.value, l2); + return { type: 1 }; + }(e2, t2); + case 2: + return function(e3, t3) { + const n2 = i(e3.left, t3); + return 5 !== n2.type || true !== n2.value ? n2 : i(e3.right, t3); + }(e2, t2); + case 3: + return function(e3, t3) { + const n2 = i(e3.left, t3); + return 5 === n2.type && true === n2.value ? n2 : i(e3.right, t3); + }(e2, t2); + case 1: { + const n2 = i(e2.value, t2); + return 5 === n2.type ? { type: 5, value: !n2.value } : { type: 1 }; + } + case 5: + return a(n(e2, t2)); + case 6: + return a(e2.value); + } +} +function a(e2) { + switch (e2.type) { + case 5: + return e2; + case 2: + case 3: + return { type: 5, value: e2.value > 0 }; + } + return { type: 1 }; +} +var f = Array.from({ length: 4 }, () => Math.floor(256 * Math.random()).toString(16)).join(""); +var p = S("container"); +var y = S("container-type"); +var h = S("container-name"); +var v = `data-cqs-${f}`; +var d = `data-cqc-${f}`; +var m = S("cqw"); +var w = S("cqh"); +var g = S("cqi"); +var b = S("cqb"); +function S(e2) { + return `--cq-${e2}-${f}`; +} +var x = Symbol(); +function q(e2, t2) { + const n2 = { value: t2, errorIndices: [], index: -1, at(r2) { + const u2 = n2.index + r2; + return u2 >= e2.length ? t2 : e2[u2]; + }, consume: (e3) => (n2.index += e3, n2.value = n2.at(0), n2.value), reconsume() { + n2.index -= 1; + }, error() { + n2.errorIndices.push(n2.index); + } }; + return n2; +} +function C(e2) { + return q(e2, { type: 0 }); +} +function* $(e2) { + const t2 = []; + let n2 = false; + for (const r3 of e2) { + const e3 = r3.codePointAt(0); + n2 && 10 !== e3 && (n2 = false, t2.push(10)), 0 === e3 || e3 >= 55296 && e3 <= 57343 ? t2.push(65533) : 13 === e3 ? n2 = true : t2.push(e3); + } + const r2 = q(t2, -1), { at: u2, consume: o2, error: s2, reconsume: l2 } = r2; + function c2() { + return String.fromCodePoint(r2.value); + } + function i2() { + return { type: 13, value: c2() }; + } + function a2() { + for (; z(u2(1)); ) + o2(1); + } + function f2() { + for (; -1 !== r2.value; ) + if (o2(1), 42 === u2(0) && 47 === u2(1)) + return void o2(1); + s2(); + } + function p2() { + const [e3, t3] = function() { + let e4 = 0, t4 = "", n4 = u2(1); + for (43 !== n4 && 45 !== n4 || (o2(1), t4 += c2()); k(u2(1)); ) + o2(1), t4 += c2(); + if (46 === u2(1) && k(u2(2))) + for (e4 = 1, o2(1), t4 += c2(); k(u2(1)); ) + o2(1), t4 += c2(); + if (n4 = u2(1), 69 === n4 || 101 === n4) { + const n5 = u2(2); + if (k(n5)) + for (e4 = 1, o2(1), t4 += c2(); k(u2(1)); ) + o2(1), t4 += c2(); + else if ((45 === n5 || 43 === n5) && k(u2(3))) + for (e4 = 1, o2(1), t4 += c2(), o2(1), t4 += c2(); k(u2(1)); ) + o2(1), t4 += c2(); } - var cookies = document.cookie ? document.cookie.split("; ") : []; - var jar = {}; - for (var i3 = 0; i3 < cookies.length; i3++) { - var parts = cookies[i3].split("="); - var value = parts.slice(1).join("="); - try { - var found = decodeURIComponent(parts[0]); - jar[found] = converter.read(value, found); - if (name === found) { - break; + return [t4, e4]; + }(), n3 = u2(1); + return d2(n3, u2(1), u2(2)) ? { type: 15, value: e3, flag: t3, unit: w2() } : 37 === n3 ? (o2(1), { type: 16, value: e3 }) : { type: 17, value: e3, flag: t3 }; + } + function y2() { + const e3 = w2(); + let t3 = u2(1); + if ("url" === e3.toLowerCase() && 40 === t3) { + for (o2(1); z(u2(1)) && z(u2(2)); ) + o2(1); + t3 = u2(1); + const n3 = u2(2); + return 34 === t3 || 39 === t3 ? { type: 23, value: e3 } : !z(t3) || 34 !== n3 && 39 !== n3 ? function() { + let e4 = ""; + for (a2(); ; ) { + const n4 = o2(1); + if (41 === n4) + return { type: 20, value: e4 }; + if (-1 === n4) + return s2(), { type: 20, value: e4 }; + if (z(n4)) { + a2(); + const t5 = u2(1); + return 41 === t5 || -1 === t5 ? (o2(1), -1 === n4 && s2(), { type: 20, value: e4 }) : (g2(), { type: 21 }); } - } catch (e3) { + if (34 === n4 || 39 === n4 || 40 === n4 || (t4 = n4) >= 0 && t4 <= 8 || 11 === t4 || t4 >= 14 && t4 <= 31 || 127 === t4) + return s2(), g2(), { type: 21 }; + if (92 === n4) { + if (!j(n4, u2(1))) + return s2(), { type: 21 }; + e4 += v2(); + } else + e4 += c2(); } - } - return name ? jar[name] : jar; + var t4; + }() : { type: 23, value: e3 }; } - return Object.create( - { - set: set3, - get: get3, - remove: function(name, attributes) { - set3( - name, - "", - assign({}, attributes, { - expires: -1 - }) - ); - }, - withAttributes: function(attributes) { - return init(this.converter, assign({}, this.attributes, attributes)); - }, - withConverter: function(converter2) { - return init(assign({}, this.converter, converter2), this.attributes); - } - }, - { - attributes: { value: Object.freeze(defaultAttributes) }, - converter: { value: Object.freeze(converter) } + return 40 === t3 ? (o2(1), { type: 23, value: e3 }) : { type: 24, value: e3 }; + } + function h2(e3) { + let t3 = ""; + for (; ; ) { + const n3 = o2(1); + if (-1 === n3 || n3 === e3) + return -1 === n3 && s2(), { type: 2, value: t3 }; + if (E(n3)) + return s2(), l2(), { type: 3 }; + if (92 === n3) { + const e4 = u2(1); + if (-1 === e4) + continue; + E(e4) ? o2(1) : t3 += v2(); + } else + t3 += c2(); + } + } + function v2() { + const e3 = o2(1); + if (A(e3)) { + const t3 = [e3]; + for (let e4 = 0; e4 < 5; e4++) { + const e5 = u2(1); + if (!A(e5)) + break; + t3.push(e5), o2(1); } - ); + z(u2(1)) && o2(1); + let n3 = parseInt(String.fromCodePoint(...t3), 16); + return (0 === n3 || n3 >= 55296 && n3 <= 57343 || n3 > 1114111) && (n3 = 65533), String.fromCodePoint(n3); + } + return -1 === e3 ? (s2(), String.fromCodePoint(65533)) : c2(); } - var api = init(defaultConverter, { path: "/" }); - - // ../../components/coco/messaging/system_banner/system_banner.js - var system_banner_default = CocoComponent("systemBanner", (opts = {}) => { - return { - cookieName: null, - cookieValue: null, - cookieExpiry: null, - init() { - this.cookieName = opts.cookieName; - this.cookieValue = opts.cookieValue; - this.cookieExpiry = opts.cookieExpiry; - }, - onDismiss() { - this.$dispatch("banner:dismiss", { banner: this }); - if (this.shouldSetCookie) { - api.set(this.cookieName, this.cookieValue, { - expires: this.cookieExpiry - }); - } - }, - remove() { - this.$root.remove(); - }, - get shouldSetCookie() { - return Number.isInteger(this.cookieExpiry); - }, - root: { - "@alert:dismiss": "onDismiss", - "@alert:removed": "remove" + function d2(e3, t3, n3) { + return 45 === e3 ? L(t3) || 45 === t3 || j(t3, n3) : !!L(e3); + } + function m2(e3, t3, n3) { + return 43 === e3 || 45 === e3 ? k(t3) || 46 === t3 && k(n3) : !(46 !== e3 || !k(t3)) || !!k(e3); + } + function w2() { + let e3 = ""; + for (; ; ) { + const t3 = o2(1); + if (M(t3)) + e3 += c2(); + else { + if (!j(t3, u2(1))) + return l2(), e3; + e3 += v2(); } - }; - }); - - // ../../components/coco/messaging/toast/toast.js - var toast_exports = {}; - __export(toast_exports, { - default: () => toast_default - }); - var toast_default = CocoComponent("toast", () => { - return { - notificationType: "toast", - options: ["show", "dismiss", "showDelay", "dismissDelay", "position"], - root: { - "x-options": "options", - "x-notification": "notificationType", - "x-show": "notification.shown && !notification.dismissed", - "x-transition:enter": "toast-enter", - "x-transition:enter-start": "toast-enter-start", - "x-transition:enter-end": "toast-enter-end", - "x-transition:leave": "toast-leave", - "x-transition:leave-start": "toast-leave-start", - "x-transition:leave-end": "toast-leave-end", - "@mouseover": "notification.clearAutoDismiss", - "@mouseout": "notification.startAutoDismiss", - "@alert:dismiss": "notification.dismiss", - "@toast:show.document": "notification.clearFromQueue" - } - }; - }); - - // ../../components/coco/modals/modal/modal.js - var modal_exports = {}; - __export(modal_exports, { - default: () => modal_default - }); - - // helpers/location.js - function navigateTo(url, options = {}) { - if (window.Turbo && options.turbo === true) { - delete options.turbo; - turboOptions = Object.assign({ action: "advance" }, options); - window.Turbo.visit(url, turboOptions); - } else { - location.assign(url); } } - - // ../../components/coco/modals/modal/modal.js - var modal_default = CocoComponent("modal", () => { - return { - open: false, - frame: null, - modal: null, - options: ["dismissable", "closeOnSubmit"], - init() { - this.modal = this; - this.onFrameSubmitEnd = this.onFrameSubmitEnd.bind(this); - this.frame = this.$el.closest("turbo-frame"); - this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd); - this.$nextTick(() => this.show()); - }, - show() { - this.open = true; - hideAll(); - setTimeout(() => { - this.$dispatch("modal:shown"); - }, 400); - }, - hide() { - this.open = false; - setTimeout(() => { - this.clearFrame(); - this.$dispatch("modal:hidden"); - }, 200); - }, - dismiss(event) { - if (this.$options.dismissable) - this.hide(); - }, - visit(url) { - navigateTo(url, { frame: this.frame.id, turbo: true }); - }, - scrollTo(pos) { - setTimeout(() => { - this.$root.scrollTop = pos + this.contentOffsetTop; - }, 10); - }, - clearFrame() { - this.frame.removeAttribute("src"); - this.frame.removeAttribute("complete"); - this.frame.innerHTML = ""; - }, - onFrameSubmitEnd(event) { - if (this.$options.closeOnSubmit && event.detail.success) { - this.hide(); + function g2() { + for (; ; ) { + const e3 = o2(1); + if (-1 === e3) + return; + j(e3, u2(1)) && v2(); + } + } + for (; ; ) { + const e3 = o2(1); + if (47 === e3 && 42 === u2(1)) + o2(2), f2(); + else if (z(e3)) + a2(), yield { type: 1 }; + else if (34 === e3) + yield h2(e3); + else if (35 === e3) { + const e4 = u2(1); + M(e4) || j(e4, u2(2)) ? yield { type: 14, flag: d2(u2(1), u2(2), u2(3)) ? 1 : 0, value: w2() } : yield i2(); + } else if (39 === e3) + yield h2(e3); + else if (40 === e3) + yield { type: 4 }; + else if (41 === e3) + yield { type: 5 }; + else if (43 === e3) + m2(e3, u2(1), u2(2)) ? (l2(), yield p2()) : yield i2(); + else if (44 === e3) + yield { type: 6 }; + else if (45 === e3) { + const t3 = u2(1), n3 = u2(2); + m2(e3, t3, n3) ? (l2(), yield p2()) : 45 === t3 && 62 === n3 ? (o2(2), yield { type: 19 }) : d2(e3, t3, n3) ? (l2(), yield y2()) : yield i2(); + } else if (46 === e3) + m2(e3, u2(1), u2(2)) ? (l2(), yield p2()) : yield i2(); + else if (58 === e3) + yield { type: 7 }; + else if (59 === e3) + yield { type: 8 }; + else if (60 === e3) + 33 === u2(1) && 45 === u2(2) && 45 === u2(3) ? yield { type: 18 } : yield i2(); + else if (64 === e3) + if (d2(u2(1), u2(2), u2(3))) { + const e4 = w2(); + yield { type: 22, value: e4 }; + } else + yield i2(); + else if (91 === e3) + yield { type: 9 }; + else if (92 === e3) + j(e3, u2(1)) ? (l2(), yield y2()) : (s2(), yield i2()); + else if (93 === e3) + yield { type: 10 }; + else if (123 === e3) + yield { type: 11 }; + else if (125 === e3) + yield { type: 12 }; + else if (k(e3)) + l2(), yield p2(); + else if (L(e3)) + l2(), yield y2(); + else { + if (-1 === e3) + return yield { type: 0 }, r2.errorIndices; + yield { type: 13, value: c2() }; + } + } +} +function k(e2) { + return e2 >= 48 && e2 <= 57; +} +function A(e2) { + return k(e2) || e2 >= 65 && e2 <= 70 || e2 >= 97 && e2 <= 102; +} +function E(e2) { + return 10 === e2 || 13 === e2 || 12 === e2; +} +function z(e2) { + return E(e2) || 9 === e2 || 32 === e2; +} +function L(e2) { + return e2 >= 65 && e2 <= 90 || e2 >= 97 && e2 <= 122 || e2 >= 128 || 95 === e2; +} +function j(e2, t2) { + return 92 === e2 && !E(t2); +} +function M(e2) { + return L(e2) || k(e2) || 45 === e2; +} +var T = { 11: 12, 9: 10, 4: 5 }; +function P(t2, n2) { + const r2 = function(e2, t3) { + const n3 = []; + for (; ; ) + switch (e2.consume(1).type) { + case 1: + break; + case 0: + return { type: 3, value: n3 }; + case 18: + case 19: + if (false !== t3) { + e2.reconsume(); + const t4 = R(e2); + t4 !== x && n3.push(t4); + } + break; + case 22: + e2.reconsume(), n3.push(U(e2)); + break; + default: { + e2.reconsume(); + const t4 = R(e2); + t4 !== x && n3.push(t4); + break; } - }, - destroy() { - this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd); - }, - get contentOffsetTop() { - return parseInt( - window.getComputedStyle(this.$refs.container).paddingTop, - 10 - ); - }, - root: { - "x-options": "options", - "x-show": "open", - "@keydown.escape.document": "dismiss", - "@modal:hide.document": "hide" - }, - overlay: { - "x-show": "open", - "x-transition:enter": "overlay-enter", - "x-transition:enter-start": "overlay-enter-start", - "x-transition:enter-end": "overlay-enter-end", - "x-transition:leave": "overlay-leave", - "x-transition:leave-start": "overlay-leave-start", - "x-transition:leave-end": "overlay-leave-end" - }, - container: { - "x-show": "open", - "x-transition:enter": "container-enter", - "x-transition:enter-start": "container-enter-start", - "x-transition:enter-end": "container-enter-end", - "x-transition:leave": "container-leave", - "x-transition:leave-start": "container-leave-start", - "x-transition:leave-end": "container-leave-end" } - }; - }); - - // ../../components/coco/modals/modal_dialog/modal_dialog.js - var modal_dialog_exports = {}; - __export(modal_dialog_exports, { - default: () => modal_dialog_default - }); - var modal_dialog_default = CocoComponent("modalDialog", () => { - return { - frame: null, - init() { - this.onFrameLoad = this.onFrameLoad.bind(this); - this.frame = this.$el.closest("turbo-frame"); - if (this.frame) { - this.frame.addEventListener("turbo:frame-load", this.onFrameLoad); + }(C(t2), true === n2); + return e({}, r2, { value: r2.value.map((t3) => 26 === t3.type ? function(t4, n3) { + return 0 === t4.value.value.type ? e({}, t4, { value: e({}, t4.value, { value: O(t4.value.value.value) }) }) : t4; + }(t3) : t3) }); +} +function N(e2) { + const t2 = C(e2), n2 = []; + for (; ; ) { + if (0 === t2.consume(1).type) + return n2; + t2.reconsume(), n2.push(Q(t2)); + } +} +function O(e2) { + return function(e3) { + const t2 = [], n2 = []; + for (; ; ) { + const r2 = e3.consume(1); + switch (r2.type) { + case 1: + case 8: + break; + case 0: + return { type: 1, value: [...n2, ...t2] }; + case 22: + e3.reconsume(), t2.push(U(e3)); + break; + case 24: { + const t3 = [r2]; + let u2 = e3.at(1); + for (; 8 !== u2.type && 0 !== u2.type; ) + t3.push(Q(e3)), u2 = e3.at(1); + const o2 = I(C(t3)); + o2 !== x && n2.push(o2); + break; } - }, - close() { - this.modal.hide(); - }, - onFrameLoad() { - this.$focus.focus(this.firstInput); - }, - destroy() { - if (this.frame) { - this.frame.removeEventListener("turbo:frame-load", this.onFrameLoad); + case 13: + if ("&" === r2.value) { + e3.reconsume(); + const n3 = R(e3); + n3 !== x && t2.push(n3); + break; + } + default: { + e3.error(), e3.reconsume(); + let t3 = e3.at(1); + for (; 8 !== t3.type && 0 !== t3.type; ) + Q(e3), t3 = e3.at(1); + break; } - }, - get firstInput() { - return this.$root.querySelector( - "input:not([type=hidden]), textarea, select" - ); } - }; - }); - - // ../../components/coco/modals/modal_lightbox/modal_lightbox.js - var modal_lightbox_exports = {}; - __export(modal_lightbox_exports, { - default: () => modal_lightbox_default - }); - var modal_lightbox_default = CocoComponent("modalLightbox", () => { - return { - loaded: false, - init() { - if (this.img.complete && this.img.naturalHeight !== 0) { - this.imageLoaded(); - } - }, - close() { - this.modal.hide(); - }, - imageLoaded() { - this.loaded = true; - setTimeout(() => { - const scrollTop = parseInt(this.img.dataset.scrollTop, 10); - if (!isNaN(scrollTop) && scrollTop !== 0) { - this.modal.scrollTo(scrollTop); + } + }(C(e2)); +} +function F(e2) { + for (; 1 === e2.at(1).type; ) + e2.consume(1); +} +function U(e2) { + let t2 = e2.consume(1); + if (22 !== t2.type) + throw new Error(`Unexpected type ${t2.type}`); + const n2 = t2.value, r2 = []; + for (; ; ) + switch (t2 = e2.consume(1), t2.type) { + case 8: + return { type: 25, name: n2, prelude: r2, value: null }; + case 0: + return e2.error(), { type: 25, name: n2, prelude: r2, value: null }; + case 11: + return { type: 25, name: n2, prelude: r2, value: H(e2) }; + case 28: + if (11 === t2.source.type) + return { type: 25, name: n2, prelude: r2, value: t2 }; + default: + e2.reconsume(), r2.push(Q(e2)); + } +} +function R(e2) { + let t2 = e2.value; + const n2 = []; + for (; ; ) + switch (t2 = e2.consume(1), t2.type) { + case 0: + return e2.error(), x; + case 11: + return { type: 26, prelude: n2, value: H(e2) }; + case 28: + if (11 === t2.source.type) + return { type: 26, prelude: n2, value: t2 }; + default: + e2.reconsume(), n2.push(Q(e2)); + } +} +function I(e2) { + const t2 = e2.consume(1); + if (24 !== t2.type) + throw new Error(`Unexpected type ${t2.type}`); + const n2 = t2.value, r2 = []; + let u2 = false; + if (F(e2), 7 !== e2.at(1).type) + return e2.error(), x; + for (e2.consume(1), F(e2); 0 !== e2.at(1).type; ) + r2.push(Q(e2)); + const o2 = r2[r2.length - 2], s2 = r2[r2.length - 1]; + return o2 && 13 === o2.type && "!" === o2.value && 24 === s2.type && "important" === s2.value.toLowerCase() && (u2 = true, r2.splice(r2.length - 2)), { type: 29, name: n2, value: r2, important: u2 }; +} +function Q(e2) { + const t2 = e2.consume(1); + switch (t2.type) { + case 11: + case 9: + case 4: + return H(e2); + case 23: + return function(e3) { + let t3 = e3.value; + if (23 !== t3.type) + throw new Error(`Unexpected type ${t3.type}`); + const n2 = t3.value, r2 = []; + for (; ; ) + switch (t3 = e3.consume(1), t3.type) { + case 5: + return { type: 27, name: n2, value: r2 }; + case 0: + return e3.error(), { type: 27, name: n2, value: r2 }; + default: + e3.reconsume(), r2.push(Q(e3)); } - }, 200); - }, - get img() { - return this.$refs.media.querySelector("img"); - }, - root: { - ":class": "{loaded}" - } - }; - }); - - // ../../components/coco/pickers/color_picker/color_picker.js - var color_picker_exports = {}; - __export(color_picker_exports, { - default: () => color_picker_default - }); - - // ../../../node_modules/@jaames/iro/dist/iro.es.js - var n2; - var u2; - var t2; - var i2; - var r2; - var o2; - var f2 = {}; - var e2 = []; - var c2 = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i; - function s2(n3, l2) { - for (var u3 in l2) { - n3[u3] = l2[u3]; + }(e2); + default: + return t2; + } +} +function H(e2) { + let t2 = e2.value; + const n2 = t2, r2 = T[n2.type]; + if (!r2) + throw new Error(`Unexpected type ${t2.type}`); + const u2 = []; + for (; ; ) + switch (t2 = e2.consume(1), t2.type) { + case r2: + return { type: 28, source: n2, value: { type: 0, value: u2 } }; + case 0: + return e2.error(), { type: 28, source: n2, value: { type: 0, value: u2 } }; + default: + e2.reconsume(), u2.push(Q(e2)); } - return n3; +} +function V(e2) { + return F(e2), 0 === e2.at(1).type; +} +var D = { 11: ["{", "}"], 9: ["[", "]"], 4: ["(", ")"] }; +function W(e2, t2) { + switch (e2.type) { + case 25: + return `@${CSS.escape(e2.name)} ${e2.prelude.map((e3) => W(e3)).join("")}${e2.value ? W(e2.value) : ";"}`; + case 26: + return `${e2.prelude.map((e3) => W(e3)).join("")}${W(e2.value)}`; + case 28: { + const [t3, n2] = D[e2.source.type]; + return `${t3}${_(e2.value)}${n2}`; + } + case 27: + return `${CSS.escape(e2.name)}(${e2.value.map((e3) => W(e3)).join("")})`; + case 29: + return `${CSS.escape(e2.name)}:${e2.value.map((e3) => W(e3)).join("")}${e2.important ? " !important" : ""}`; + case 1: + return " "; + case 8: + return ";"; + case 7: + return ":"; + case 14: + return "#" + CSS.escape(e2.value); + case 24: + return CSS.escape(e2.value); + case 15: + return e2.value + CSS.escape(e2.unit); + case 13: + case 17: + return e2.value; + case 2: + return `"${CSS.escape(e2.value)}"`; + case 6: + return ","; + case 20: + return "url(" + CSS.escape(e2.value) + ")"; + case 22: + return "@" + CSS.escape(e2.value); + case 16: + return e2.value + "%"; + default: + throw new Error(`Unsupported token ${e2.type}`); } - function a2(n3) { - var l2 = n3.parentNode; - l2 && l2.removeChild(n3); +} +function _(e2, t2) { + return e2.value.map((t3) => { + let n2 = W(t3); + return 29 === t3.type && 0 !== e2.type && (n2 += ";"), n2; + }).join(""); +} +function B(e2) { + return W(e2); +} +function G(e2) { + const t2 = e2.at(1); + return 13 === t2.type && "=" === t2.value && (e2.consume(1), true); +} +function Y(e2, t2) { + const n2 = []; + for (; ; ) { + const r2 = e2.at(1); + if (0 === r2.type || t2 && 7 === r2.type || 13 === r2.type && (">" === r2.value || "<" === r2.value || "=" === r2.value)) + break; + n2.push(e2.consume(1)); } - function h2(n3, l2, u3) { - var t3, i3, r3, o3, f3 = arguments; - if (l2 = s2({}, l2), arguments.length > 3) { - for (u3 = [u3], t3 = 3; t3 < arguments.length; t3++) { - u3.push(f3[t3]); + return n2; +} +function J(e2) { + F(e2); + const t2 = e2.consume(1); + return 13 !== t2.type ? x : ">" === t2.value ? G(e2) ? 3 : 2 : "<" === t2.value ? G(e2) ? 5 : 4 : "=" === t2.value ? 1 : x; +} +function K(e2) { + return 4 === e2 || 5 === e2; +} +function X(e2) { + return 2 === e2 || 3 === e2; +} +function Z(e2, t2, n2) { + const r2 = function(e3) { + F(e3); + const t3 = e3.consume(1); + return F(e3), 24 !== t3.type || 0 !== e3.at(1).type ? x : t3.value; + }(C(e2)); + if (r2 === x) + return x; + let u2 = r2.toLowerCase(); + return u2 = n2 ? n2(u2) : u2, t2.has(u2) ? u2 : x; +} +function ee(e2) { + return { type: 13, value: e2 }; +} +function te(e2, t2) { + return { type: 29, name: e2, value: t2, important: false }; +} +function ne(e2) { + return { type: 24, value: e2 }; +} +function re(e2, t2) { + return { type: 27, name: e2, value: t2 }; +} +function ue(e2) { + return re("var", [ne(e2)]); +} +function oe(e2, t2) { + F(e2); + let n2 = false, r2 = e2.at(1); + if (24 === r2.type) { + if ("not" !== r2.value.toLowerCase()) + return x; + e2.consume(1), F(e2), n2 = true; + } + let u2 = function(e3) { + const t3 = e3.consume(1); + switch (t3.type) { + case 28: { + if (4 !== t3.source.type) + return x; + const e4 = oe(C(t3.value.value), null); + return e4 !== x ? e4 : { type: 4, value: t3 }; } + case 27: + return { type: 4, value: t3 }; + default: + return x; } - if (null != u3 && (l2.children = u3), null != n3 && null != n3.defaultProps) { - for (i3 in n3.defaultProps) { - void 0 === l2[i3] && (l2[i3] = n3.defaultProps[i3]); + }(e2); + if (u2 === x) + return x; + u2 = n2 ? { type: 1, value: u2 } : u2, F(e2), r2 = e2.at(1); + const o2 = 24 === r2.type ? r2.value.toLowerCase() : null; + if (null !== o2) { + if (e2.consume(1), F(e2), "and" !== o2 && "or" !== o2 || null !== t2 && o2 !== t2) + return x; + const n3 = oe(e2, o2); + return n3 === x ? x : { type: "and" === o2 ? 2 : 3, left: u2, right: n3 }; + } + return V(e2) ? u2 : x; +} +function se(e2) { + return oe(e2, null); +} +function le(e2) { + switch (e2.type) { + case 1: + return [ne("not"), { type: 1 }, ...le(e2.value)]; + case 2: + case 3: + return [...le(e2.left), { type: 1 }, ne(2 === e2.type ? "and" : "or"), { type: 1 }, ...le(e2.right)]; + case 4: + return [e2.value]; + } +} +var ce = { width: 1, height: 2, "inline-size": 3, "block-size": 4, "aspect-ratio": 5, orientation: 6 }; +var ie = new Set(Object.keys(ce)); +var ae = /* @__PURE__ */ new Set(["none", "and", "not", "or", "normal", "auto"]); +var fe = /* @__PURE__ */ new Set(["initial", "inherit", "revert", "revert-layer", "unset"]); +var pe = /* @__PURE__ */ new Set(["size", "inline-size"]); +function ye(e2, t2, n2, r2) { + const u2 = n2(); + if (u2 === x) + return x; + let o2 = [u2, null]; + F(e2); + const s2 = e2.at(1); + if (13 === s2.type) { + if (s2.value !== t2) + return x; + e2.consume(1), F(e2); + const n3 = r2(); + F(e2), n3 !== x && (o2 = [u2, n3]); + } + return V(e2) ? o2 : x; +} +function he(e2) { + const t2 = e2.consume(1); + return 17 === t2.type ? parseInt(t2.value) : x; +} +function ve(e2) { + const t2 = C(e2); + F(t2); + const n2 = t2.consume(1); + let r2 = x; + switch (n2.type) { + case 17: + t2.reconsume(), r2 = function(e3) { + const t3 = ye(e3, "/", () => he(e3), () => he(e3)); + return t3 === x ? x : { type: 2, value: t3[0] / (null !== t3[1] ? t3[1] : 1) }; + }(t2); + break; + case 15: + r2 = { type: 3, value: parseInt(n2.value), unit: n2.unit.toLowerCase() }; + break; + case 24: { + const e3 = n2.value.toLowerCase(); + switch (e3) { + case "landscape": + case "portrait": + r2 = { type: 4, value: e3 }; } } - return o3 = l2.key, null != (r3 = l2.ref) && delete l2.ref, null != o3 && delete l2.key, v2(n3, l2, o3, r3); } - function v2(l2, u3, t3, i3) { - var r3 = { type: l2, props: u3, key: t3, ref: i3, __k: null, __p: null, __b: 0, __e: null, l: null, __c: null, constructor: void 0 }; - return n2.vnode && n2.vnode(r3), r3; + return r2 === x ? x : V(t2) ? { type: 6, value: r2 } : x; +} +function de(e2) { + return !ge(e2 = e2.toLowerCase()) && !ae.has(e2); +} +function me(e2, t2) { + const n2 = []; + for (; ; ) { + F(e2); + const r2 = e2.at(1); + if (24 !== r2.type || !t2(r2.value)) + return n2; + e2.consume(1), n2.push(r2.value); } - function d2(n3) { - return n3.children; +} +function we(e2) { + const t2 = []; + for (; ; ) { + F(e2); + const n2 = e2.at(1); + if (24 !== n2.type) + break; + const r2 = n2.value; + if (!de(r2)) + break; + e2.consume(1), t2.push(r2); } - function y2(n3) { - if (null == n3 || "boolean" == typeof n3) { - return null; - } - if ("string" == typeof n3 || "number" == typeof n3) { - return v2(null, n3, null, null); - } - if (null != n3.__e || null != n3.__c) { - var l2 = v2(n3.type, n3.props, n3.key, null); - return l2.__e = n3.__e, l2; - } - return n3; + return t2; +} +function ge(e2) { + return fe.has(e2); +} +function be(e2) { + return e2.map((e3) => "cq-" + e3); +} +function Se(e2) { + const t2 = me(e2, (e3) => ge(e3)); + return 1 === t2.length ? be(t2) : x; +} +function xe(e2, t2) { + const n2 = me(e2, (e3) => "none" === e3); + if (1 === n2.length) + return be(n2); + if (0 !== n2.length) + return x; + if (t2) { + const t3 = Se(e2); + if (t3 !== x) + return t3; } - function m2(n3, l2) { - this.props = n3, this.context = l2; + const r2 = we(e2); + return r2.length > 0 && (!t2 || V(e2)) ? r2 : x; +} +function qe(e2, t2) { + if (t2) { + const t3 = Se(e2); + if (t3 !== x) + return t3; } - function w2(n3, l2) { - if (null == l2) { - return n3.__p ? w2(n3.__p, n3.__p.__k.indexOf(n3) + 1) : null; - } - for (var u3; l2 < n3.__k.length; l2++) { - if (null != (u3 = n3.__k[l2]) && null != u3.__e) { - return u3.__e; + return function(e3) { + const t3 = me(e3, (e4) => "normal" === e4); + if (1 === t3.length) + return be(t3); + if (0 !== t3.length) + return x; + const n2 = me(e3, (e4) => pe.has(e4)); + return n2.length > 0 && V(e3) ? n2 : x; + }(e2); +} +function Ce(e2) { + const t2 = C(e2), n2 = Se(t2); + if (n2 !== x) + return [n2, n2]; + const r2 = ye(t2, "/", () => xe(t2, false), () => qe(t2, false)); + return r2 !== x && V(t2) ? [r2[0], r2[1] || []] : x; +} +function $e(e2) { + const t2 = C(e2), n2 = we(t2); + if (!n2 || n2.length > 1) + return x; + const r2 = se(t2); + if (r2 === x) + return x; + const u2 = { features: /* @__PURE__ */ new Set() }, o2 = ke(r2, u2); + return V(t2) ? { name: n2.length > 0 ? n2[0] : null, condition: o2, features: u2.features } : x; +} +function ke(e2, t2) { + switch (e2.type) { + case 1: + return { type: 1, value: ke(e2.value, t2) }; + case 2: + case 3: + return { type: 2 === e2.type ? 2 : 3, left: ke(e2.left, t2), right: ke(e2.right, t2) }; + case 4: + if (28 === e2.value.type) { + const n2 = function(e3, t3) { + const n3 = function(e4, t4) { + const n4 = Y(e4, true), r3 = e4.at(1); + if (0 === r3.type) { + const e5 = Z(n4, t4); + return e5 !== x && t4.has(e5) ? { type: 1, feature: e5 } : x; + } + if (7 === r3.type) { + e4.consume(1); + const r4 = Y(e4, false); + let u3 = 1; + const o3 = Z(n4, t4, (e5) => e5.startsWith("min-") ? (u3 = 3, e5.substring(4)) : e5.startsWith("max-") ? (u3 = 5, e5.substring(4)) : e5); + return o3 !== x ? { type: 2, feature: o3, bounds: [null, [u3, r4]] } : x; + } + const u2 = J(e4); + if (u2 === x) + return x; + const o2 = Y(e4, false); + if (0 === e4.at(1).type) { + const e5 = Z(n4, t4); + if (e5 !== x) + return { type: 2, feature: e5, bounds: [null, [u2, o2]] }; + const r4 = Z(o2, t4); + return r4 !== x ? { type: 2, feature: r4, bounds: [[u2, n4], null] } : x; + } + const s2 = J(e4); + if (s2 === x || !(X(u2) && X(s2) || K(u2) && K(s2))) + return x; + const l2 = Y(e4, false), c2 = Z(o2, t4); + return c2 !== x ? { type: 2, feature: c2, bounds: [[u2, n4], [s2, l2]] } : x; + }(e3, ie); + if (n3 === x) + return x; + const r2 = ce[n3.feature]; + if (null == r2) + return x; + if (t3.features.add(r2), 1 === n3.type) + return { type: 5, feature: r2 }; + { + const e4 = { type: 5, feature: r2 }; + let t4 = x; + if (null !== n3.bounds[0]) { + const r3 = ve(n3.bounds[0][1]); + if (r3 === x) + return x; + t4 = { type: 4, operator: n3.bounds[0][0], left: r3, right: e4 }; + } + if (null !== n3.bounds[1]) { + const r3 = ve(n3.bounds[1][1]); + if (r3 === x) + return x; + const u2 = { type: 4, operator: n3.bounds[1][0], left: e4, right: r3 }; + t4 = t4 !== x ? { type: 2, left: t4, right: u2 } : u2; + } + return t4; + } + }(C(e2.value.value.value), t2); + if (n2 !== x) + return n2; } - } - return "function" == typeof n3.type ? w2(n3) : null; + return { type: 6, value: { type: 1 } }; } - function g2(n3) { - var l2, u3; - if (null != (n3 = n3.__p) && null != n3.__c) { - for (n3.__e = n3.__c.base = null, l2 = 0; l2 < n3.__k.length; l2++) { - if (null != (u3 = n3.__k[l2]) && null != u3.__e) { - n3.__e = n3.__c.base = u3.__e; - break; - } - } - return g2(n3); +} +var Ae = 0; +var Ee = { cqw: m, cqh: w, cqi: g, cqb: b }; +var ze = CSS.supports("selector(:where(div))"); +var Le = ":not(.container-query-polyfill)"; +N(Array.from($(Le))); +var je = document.createElement("div"); +var Me = /* @__PURE__ */ new Set(["before", "after", "first-line", "first-letter"]); +function Te(e2, t2) { + return re("calc", [{ type: 17, flag: e2.flag, value: e2.value }, ee("*"), t2]); +} +function Pe(t2) { + return t2.map((t3) => { + switch (t3.type) { + case 15: + return function(e2) { + const t4 = e2.unit, n2 = Ee[t4]; + return null != n2 ? Te(e2, ue(n2)) : "cqmin" === t4 || "cqmax" === t4 ? Te(e2, re(e2.unit.slice(2), [ue(g), { type: 6 }, ue(b)])) : e2; + }(t3); + case 27: + return e({}, t3, { value: Pe(t3.value) }); } + return t3; + }); +} +function Ne(t2) { + switch (t2.name) { + case "container": + return Ce(t2.value) ? e({}, t2, { name: p }) : t2; + case "container-name": + return xe(C(t2.value), true) ? e({}, t2, { name: h }) : t2; + case "container-type": + return null != qe(C(t2.value), true) ? e({}, t2, { name: y }) : t2; } - function k2(l2) { - (!l2.__d && (l2.__d = true) && 1 === u2.push(l2) || i2 !== n2.debounceRendering) && (i2 = n2.debounceRendering, (n2.debounceRendering || t2)(_2)); - } - function _2() { - var n3, l2, t3, i3, r3, o3, f3, e3; - for (u2.sort(function(n4, l3) { - return l3.__v.__b - n4.__v.__b; - }); n3 = u2.pop(); ) { - n3.__d && (t3 = void 0, i3 = void 0, o3 = (r3 = (l2 = n3).__v).__e, f3 = l2.__P, e3 = l2.u, l2.u = false, f3 && (t3 = [], i3 = $2(f3, r3, s2({}, r3), l2.__n, void 0 !== f3.ownerSVGElement, null, t3, e3, null == o3 ? w2(r3) : o3), j2(t3, r3), i3 != o3 && g2(r3))); + return e({}, t2, { value: Pe(t2.value) }); +} +function Oe(t2, n2) { + return e({}, t2, { value: t2.value.map((t3) => { + switch (t3.type) { + case 25: + return He(t3, n2); + case 26: + return function(t4, n3) { + return n3.transformStyleRule(e({}, t4, { value: Re(t4.value, n3) })); + }(t3, n2); + default: + return t3; } - } - function b2(n3, l2, u3, t3, i3, r3, o3, c3, s3) { - var h3, v3, p2, d3, y3, m3, g3, k3 = u3 && u3.__k || e2, _3 = k3.length; - if (c3 == f2 && (c3 = null != r3 ? r3[0] : _3 ? w2(u3, 0) : null), h3 = 0, l2.__k = x2(l2.__k, function(u4) { - if (null != u4) { - if (u4.__p = l2, u4.__b = l2.__b + 1, null === (p2 = k3[h3]) || p2 && u4.key == p2.key && u4.type === p2.type) { - k3[h3] = void 0; - } else { - for (v3 = 0; v3 < _3; v3++) { - if ((p2 = k3[v3]) && u4.key == p2.key && u4.type === p2.type) { - k3[v3] = void 0; + }) }); +} +function Fe(e2) { + return 0 === e2.type || 6 === e2.type; +} +function Ue(e2) { + for (let t2 = e2.length - 1; t2 >= 0; t2--) + if (1 !== e2[t2].type) + return e2.slice(0, t2 + 1); + return e2; +} +function Re(t2, n2) { + return function(t3, n3) { + const r2 = []; + let u2 = null, o2 = null; + for (const e2 of t3.value.value) + switch (e2.type) { + case 25: + { + const t4 = n3 ? n3(e2) : e2; + t4 && r2.push(t4); + } + break; + case 29: { + const t4 = Ne(e2); + switch (t4.name) { + case p: { + const t5 = Ce(e2.value); + t5 !== x && (u2 = t5[0], o2 = t5[1]); break; } - p2 = null; + case h: { + const t5 = xe(C(e2.value), true); + t5 !== x && (u2 = t5); + break; + } + case y: { + const t5 = qe(C(e2.value), true); + t5 !== x && (o2 = t5); + break; + } + default: + r2.push(t4); } } - if (d3 = $2(n3, u4, p2 = p2 || f2, t3, i3, r3, o3, null, c3, s3), (v3 = u4.ref) && p2.ref != v3 && (g3 || (g3 = [])).push(v3, u4.__c || d3, u4), null != d3) { - if (null == m3 && (m3 = d3), null != u4.l) { - d3 = u4.l, u4.l = null; - } else if (r3 == p2 || d3 != c3 || null == d3.parentNode) { - n: - if (null == c3 || c3.parentNode !== n3) { - n3.appendChild(d3); - } else { - for (y3 = c3, v3 = 0; (y3 = y3.nextSibling) && v3 < _3; v3 += 2) { - if (y3 == d3) { - break n; + } + return u2 && u2.length > 0 && r2.push(te(h, [ne(u2.join(" "))])), o2 && o2.length > 0 && r2.push(te(y, [ne(o2.join(" "))])), e({}, t3, { value: { type: 2, value: r2 } }); + }(t2, (e2) => He(e2, n2)); +} +function Ie(t2) { + if (1 === t2.type) + return e({}, t2, { value: Ie(t2.value) }); + if (2 === t2.type || 3 === t2.type) + return e({}, t2, { left: Ie(t2.left), right: Ie(t2.right) }); + if (4 === t2.type && 28 === t2.value.type) { + const n2 = function(e2) { + const t3 = C(e2); + return F(t3), 24 !== t3.at(1).type ? x : I(t3) || x; + }(t2.value.value.value); + if (n2 !== x) + return e({}, t2, { value: e({}, t2.value, { value: { type: 0, value: [Ne(n2)] } }) }); + } + return t2; +} +function Qe(t2, n2) { + let r2 = se(C(t2.prelude)); + return r2 = r2 !== x ? Ie(r2) : x, e({}, t2, { prelude: r2 !== x ? le(r2) : t2.prelude, value: t2.value ? e({}, t2.value, { value: Oe(P(t2.value.value.value), n2) }) : null }); +} +function He(t2, n2) { + switch (t2.name.toLocaleLowerCase()) { + case "media": + case "layer": + return function(t3, n3) { + return e({}, t3, { value: t3.value ? e({}, t3.value, { value: Oe(P(t3.value.value.value), n3) }) : null }); + }(t2, n2); + case "keyframes": + return function(t3, n3) { + let r2 = null; + return t3.value && (r2 = e({}, t3.value, { value: { type: 3, value: P(t3.value.value.value).value.map((t4) => { + switch (t4.type) { + case 26: + return function(t5, n4) { + return e({}, t5, { value: Re(t5.value, n4) }); + }(t4, n3); + case 25: + return He(t4, n3); + } + }) } })), e({}, t3, { value: r2 }); + }(t2, n2); + case "supports": + return Qe(t2, n2); + case "container": + return function(t3, n3) { + if (t3.value) { + const r2 = $e(t3.prelude); + if (r2 !== x) { + const u2 = { rule: r2, selector: null, parent: n3.parent, uid: "c" + Ae++ }, o2 = /* @__PURE__ */ new Set(), s2 = [], l2 = Oe(P(t3.value.value.value), { descriptors: n3.descriptors, parent: u2, transformStyleRule: (t4) => { + const [n4, r3] = function(e2, t5, n5) { + const r4 = C(e2), u3 = [], o3 = []; + for (; ; ) { + if (0 === r4.at(1).type) + return [u3, o3]; + const n6 = Math.max(0, r4.index); + for (; l4 = r4.at(1), c2 = r4.at(2), !(Fe(l4) || 7 === l4.type && (7 === c2.type || 24 === c2.type && Me.has(c2.value.toLowerCase()))); ) + r4.consume(1); + const i2 = r4.index + 1, a2 = e2.slice(n6, i2), f2 = a2.length > 0 ? Ue(a2) : [ee("*")]; + for (; !Fe(r4.at(1)); ) + r4.consume(1); + const p2 = e2.slice(i2, Math.max(0, r4.index + 1)); + let y2 = f2, h2 = [{ type: 28, source: { type: 9 }, value: { type: 0, value: [ne(p2.length > 0 ? v : d), ee("~"), ee("="), { type: 2, value: t5 }] } }]; + if (ze) + h2 = [ee(":"), re("where", h2)]; + else { + const e3 = f2.map(B).join(""); + e3.endsWith(Le) ? y2 = N(Array.from($(e3.substring(0, e3.length - Le.length)))) : s2.push({ actual: e3, expected: e3 + Le }); } + u3.push(...f2), o3.push(...y2), o3.push(...h2), o3.push(...p2), r4.consume(1); } - n3.insertBefore(d3, c3); + var l4, c2; + }(t4.prelude, u2.uid); + if (s2.length > 0) + return t4; + const l3 = n4.map(B).join(""); + try { + je.matches(l3), o2.add(l3); + } catch (e2) { } - "option" == l2.type && (n3.value = ""); + return e({}, t4, { prelude: r3 }); + } }).value; + if (s2.length > 0) { + const e2 = /* @__PURE__ */ new Set(), t4 = []; + let n4 = 0; + for (const { actual: e3 } of s2) + n4 = Math.max(n4, e3.length); + const r3 = Array.from({ length: n4 }, () => " ").join(""); + for (const { actual: u3, expected: o3 } of s2) + e2.has(u3) || (t4.push(`${u3}${r3.substring(0, n4 - u3.length)} => ${o3}`), e2.add(u3)); + console.warn(`The :where() pseudo-class is not supported by this browser. To use the Container Query Polyfill, you must modify the selectors under your @container rules: + +${t4.join("\n")}`); + } + return o2.size > 0 && (u2.selector = Array.from(o2).join(", ")), n3.descriptors.push(u2), { type: 25, name: "media", prelude: [ne("all")], value: e({}, t3.value, { value: { type: 3, value: l2 } }) }; } - c3 = d3.nextSibling, "function" == typeof l2.type && (l2.l = d3); } - } - return h3++, u4; - }), l2.__e = m3, null != r3 && "function" != typeof l2.type) { - for (h3 = r3.length; h3--; ) { - null != r3[h3] && a2(r3[h3]); - } + return t3; + }(t2, n2); + } + return t2; +} +var Ve = class { + constructor(e2) { + this.value = void 0, this.value = e2; + } +}; +function De(e2, t2) { + if (e2 === t2) + return true; + if (typeof e2 == typeof t2 && null !== e2 && null !== t2 && "object" == typeof e2) { + if (Array.isArray(e2)) { + if (!Array.isArray(t2) || t2.length !== e2.length) + return false; + for (let n2 = 0, r2 = e2.length; n2 < r2; n2++) + if (!De(e2[n2], t2[n2])) + return false; + return true; } - for (h3 = _3; h3--; ) { - null != k3[h3] && D2(k3[h3], k3[h3]); - } - if (g3) { - for (h3 = 0; h3 < g3.length; h3++) { - A2(g3[h3], g3[++h3], g3[++h3]); + if (e2 instanceof Ve) + return t2 instanceof Ve && e2.value === t2.value; + { + const n2 = Object.keys(e2); + if (n2.length !== Object.keys(t2).length) + return false; + for (let r2 = 0, u2 = n2.length; r2 < u2; r2++) { + const u3 = n2[r2]; + if (!De(e2[u3], t2[u3])) + return false; } + return true; } } - function x2(n3, l2, u3) { - if (null == u3 && (u3 = []), null == n3 || "boolean" == typeof n3) { - l2 && u3.push(l2(null)); - } else if (Array.isArray(n3)) { - for (var t3 = 0; t3 < n3.length; t3++) { - x2(n3[t3], l2, u3); - } - } else { - u3.push(l2 ? l2(y2(n3)) : n3); + return false; +} +var We = Symbol("CQ_INSTANCE"); +var _e = Symbol("CQ_STYLESHEET"); +var Be = CSS.supports("width: 1svh"); +var Ge = /* @__PURE__ */ new Set(["vertical-lr", "vertical-rl", "sideways-rl", "sideways-lr", "tb", "tb-lr", "tb-rl"]); +var Ye = ["padding-left", "padding-right", "border-left-width", "border-right-width"]; +var Je = ["padding-top", "padding-bottom", "border-top-width", "border-bottom-width"]; +var Ke = /(\w*(\s|-))?(table|ruby)(-\w*)?/; +var Xe = class { + constructor(e2) { + this.node = void 0, this.node = e2; + } + connected() { + } + disconnected() { + } + updated() { + } +}; +var Ze = class extends Xe { + constructor(e2, t2) { + super(e2), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t2; + } + connected() { + var e2 = this; + const t2 = this.node; + if ("stylesheet" === t2.rel) { + const n2 = new URL(t2.href, document.baseURI); + n2.origin === location.origin && (this.controller = rt(async function(r2) { + const u2 = await fetch(n2.toString(), { signal: r2 }), o2 = await u2.text(), s2 = e2.styleSheet = await e2.context.registerStyleSheet({ source: o2, url: n2, signal: r2 }), l2 = new Blob([s2.source], { type: "text/css" }), c2 = new Image(); + c2.onload = c2.onerror = s2.refresh, c2.src = t2.href = URL.createObjectURL(l2); + })); } - return u3; } - function C2(n3, l2, u3, t3, i3) { - var r3; - for (r3 in u3) { - r3 in l2 || N2(n3, r3, null, u3[r3], t3); + disconnected() { + var e2, t2; + null == (e2 = this.controller) || e2.abort(), this.controller = null, null == (t2 = this.styleSheet) || t2.dispose(), this.styleSheet = null; + } +}; +var et = class extends Xe { + constructor(e2, t2) { + super(e2), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t2; + } + connected() { + var e2 = this; + this.controller = rt(async function(t2) { + const n2 = e2.node, r2 = e2.styleSheet = await e2.context.registerStyleSheet({ source: n2.innerHTML, signal: t2 }); + n2.innerHTML = r2.source, r2.refresh(); + }); + } + disconnected() { + var e2, t2; + null == (e2 = this.controller) || e2.abort(), this.controller = null, null == (t2 = this.styleSheet) || t2.dispose(), this.styleSheet = null; + } +}; +var tt = class extends Xe { + connected() { + const e2 = `* { ${y}: cq-normal; ${h}: cq-none; }`; + this.node.innerHTML = void 0 === window.CSSLayerBlockRule ? e2 : `@layer cq-polyfill-${f} { ${e2} }`; + } +}; +var nt = class extends Xe { + constructor(e2, t2) { + super(e2), this.context = void 0, this.styles = void 0, this.context = t2, this.styles = window.getComputedStyle(e2); + } + connected() { + this.node.style.cssText = "position: fixed; top: 0; left: 0; visibility: hidden; " + (Be ? "width: 1svw; height: 1svh;" : "width: 1%; height: 1%;"); + } + updated() { + const e2 = ct((e3) => this.styles.getPropertyValue(e3)); + this.context.viewportChanged({ width: e2.width, height: e2.height }); + } +}; +function rt(e2) { + const t2 = new AbortController(); + return e2(t2.signal).catch((e3) => { + if (!(e3 instanceof DOMException && "AbortError" === e3.message)) + throw e3; + }), t2; +} +function ut(e2) { + let t2 = 0; + if (0 === e2.length) + return t2; + if (e2.startsWith("cq-") && ("normal" === (e2 = e2.substring("cq-".length)) || ge(e2))) + return t2; + const n2 = e2.split(" "); + for (const e3 of n2) + switch (e3) { + case "size": + t2 |= 3; + break; + case "inline-size": + t2 |= 1; + break; + default: + return 0; } - for (r3 in l2) { - i3 && "function" != typeof l2[r3] || "value" === r3 || "checked" === r3 || u3[r3] === l2[r3] || N2(n3, r3, l2[r3], u3[r3], t3); + return t2; +} +function ot(e2) { + let t2 = 0; + return "none" !== e2 && (t2 |= 1, "contents" === e2 || "inline" === e2 || Ke.test(e2) || (t2 |= 2)), t2; +} +function st(e2, t2) { + return parseFloat(e2(t2)); +} +function lt(e2, t2) { + return t2.reduce((t3, n2) => t3 + st(e2, n2), 0); +} +function ct(e2) { + let t2 = 0, n2 = 0; + return "border-box" === e2("box-sizing") && (t2 = lt(e2, Ye), n2 = lt(e2, Je)), { fontSize: st(e2, "font-size"), width: st(e2, "width") - t2, height: st(e2, "height") - n2 }; +} +function it(e2) { + return { containerType: ut(e2(y).trim()), containerNames: (n2 = e2(h).trim(), n2.startsWith("cq-") && ("none" === (n2 = n2.substring("cq-".length)) || ge(n2)) ? /* @__PURE__ */ new Set([]) : new Set(0 === n2.length ? [] : n2.split(" "))), writingAxis: (t2 = e2("writing-mode").trim(), Ge.has(t2) ? 1 : 0), displayFlags: ot(e2("display").trim()) }; + var t2, n2; +} +function at(e2, t2, n2) { + null != n2 ? n2 != e2.getPropertyValue(t2) && e2.setProperty(t2, n2) : e2.removeProperty(t2); +} +function ft(e2) { + const t2 = e2[_e]; + return null != t2 ? t2 : []; +} +function pt(e2, t2) { + e2[_e] = t2; +} +new Promise((e2) => { +}), window.CQPolyfill = { version: "1.0.2" }, "container" in document.documentElement.style || function(n2) { + function r2(e2) { + return e2[We] || null; + } + const u2 = document.documentElement; + if (r2(u2)) + return; + const o2 = document.createElement(`cq-polyfill-${f}`), s2 = document.createElement("style"); + new MutationObserver((e2) => { + for (const t2 of e2) { + for (const e3 of t2.removedNodes) { + const t3 = r2(e3); + null == t3 || t3.disconnect(); + } + t2.target.nodeType !== Node.DOCUMENT_NODE && t2.target.nodeType !== Node.DOCUMENT_FRAGMENT_NODE && null === t2.target.parentNode || "attributes" === t2.type && t2.attributeName && (t2.attributeName === v || t2.attributeName === d || t2.target instanceof Element && t2.target.getAttribute(t2.attributeName) === t2.oldValue) || (A2(t2.target).mutate(), S2()); } + }).observe(u2, { childList: true, subtree: true, attributes: true, attributeOldValue: true }); + const l2 = new ResizeObserver((e2) => { + for (const t2 of e2) + A2(t2.target).resize(); + A2(u2).update(C2()); + }), c2 = new Xe(u2); + async function a2(e2, { source: t2, url: n3, signal: r3 }) { + const o3 = function(e3, t3) { + try { + const n4 = Array.from($(e3)); + if (t3) + for (let e4 = 0; e4 < n4.length; e4++) { + const r5 = n4[e4]; + if (20 === r5.type) + r5.value = new URL(r5.value, t3).toString(); + else if (23 === r5.type && "url" === r5.value.toLowerCase()) { + const r6 = e4 + 1 < n4.length ? n4[e4 + 1] : null; + r6 && 2 === r6.type && (r6.value = new URL(r6.value, t3).toString()); + } + } + const r4 = { descriptors: [], parent: null, transformStyleRule: (e4) => e4 }; + return { source: _(Oe(P(n4, true), r4)), descriptors: r4.descriptors }; + } catch (t4) { + return console.warn("An error occurred while transpiling stylesheet: " + t4), { source: e3, descriptors: [] }; + } + }(t2, n3 ? n3.toString() : void 0); + let s3 = () => { + }, l3 = () => { + }; + const c3 = A2(u2); + let i2 = false; + return null != r3 && r3.aborted || (l3 = () => { + if (!i2) { + const { sheet: t3 } = e2; + null != t3 && (pt(t3, o3.descriptors), i2 = true, s3 = () => { + pt(t3), c3.mutate(), S2(); + }, c3.mutate(), S2()); + } + }), { source: o3.source, dispose: s3, refresh: l3 }; } - function P2(n3, l2, u3) { - "-" === l2[0] ? n3.setProperty(l2, u3) : n3[l2] = "number" == typeof u3 && false === c2.test(l2) ? u3 + "px" : null == u3 ? "" : u3; + const p2 = { cqw: null, cqh: null }; + function y2({ width: e2, height: t2 }) { + p2.cqw = e2, p2.cqh = t2; } - function N2(n3, l2, u3, t3, i3) { - var r3, o3, f3, e3, c3; - if ("key" === (l2 = i3 ? "className" === l2 ? "class" : l2 : "class" === l2 ? "className" : l2) || "children" === l2) - ; - else if ("style" === l2) { - if (r3 = n3.style, "string" == typeof u3) { - r3.cssText = u3; - } else { - if ("string" == typeof t3 && (r3.cssText = "", t3 = null), t3) { - for (o3 in t3) { - u3 && o3 in u3 || P2(r3, o3, ""); - } - } - if (u3) { - for (f3 in u3) { - t3 && u3[f3] === t3[f3] || P2(r3, f3, u3[f3]); - } - } + function h2(e2, t2, n3) { + if (e2 instanceof Element && t2) { + let r3 = ""; + for (const [n4, u3] of t2.conditions) { + const t3 = n4.value; + null != t3.selector && null != u3 && 2 == (2 & u3) && e2.matches(t3.selector) && (r3.length > 0 && (r3 += " "), r3 += t3.uid); } - } else { - "o" === l2[0] && "n" === l2[1] ? (e3 = l2 !== (l2 = l2.replace(/Capture$/, "")), c3 = l2.toLowerCase(), l2 = (c3 in n3 ? c3 : l2).slice(2), u3 ? (t3 || n3.addEventListener(l2, T2, e3), (n3.t || (n3.t = {}))[l2] = u3) : n3.removeEventListener(l2, T2, e3)) : "list" !== l2 && "tagName" !== l2 && "form" !== l2 && !i3 && l2 in n3 ? n3[l2] = null == u3 ? "" : u3 : "function" != typeof u3 && "dangerouslySetInnerHTML" !== l2 && (l2 !== (l2 = l2.replace(/^xlink:?/, "")) ? null == u3 || false === u3 ? n3.removeAttributeNS("http://www.w3.org/1999/xlink", l2.toLowerCase()) : n3.setAttributeNS("http://www.w3.org/1999/xlink", l2.toLowerCase(), u3) : null == u3 || false === u3 ? n3.removeAttribute(l2) : n3.setAttribute(l2, u3)); + r3.length > 0 ? e2.setAttribute(n3, r3) : e2.removeAttribute(n3); } } - function T2(l2) { - return this.t[l2.type](n2.event ? n2.event(l2) : l2); + function S2() { + l2.unobserve(u2), l2.observe(u2); } - function $2(l2, u3, t3, i3, r3, o3, f3, e3, c3, a3) { - var h3, v3, p2, y3, w3, g3, k3, _3, C3, P3, N3 = u3.type; - if (void 0 !== u3.constructor) { - return null; - } - (h3 = n2.__b) && h3(u3); - try { - n: - if ("function" == typeof N3) { - if (_3 = u3.props, C3 = (h3 = N3.contextType) && i3[h3.__c], P3 = h3 ? C3 ? C3.props.value : h3.__p : i3, t3.__c ? k3 = (v3 = u3.__c = t3.__c).__p = v3.__E : ("prototype" in N3 && N3.prototype.render ? u3.__c = v3 = new N3(_3, P3) : (u3.__c = v3 = new m2(_3, P3), v3.constructor = N3, v3.render = H2), C3 && C3.sub(v3), v3.props = _3, v3.state || (v3.state = {}), v3.context = P3, v3.__n = i3, p2 = v3.__d = true, v3.__h = []), null == v3.__s && (v3.__s = v3.state), null != N3.getDerivedStateFromProps && s2(v3.__s == v3.state ? v3.__s = s2({}, v3.__s) : v3.__s, N3.getDerivedStateFromProps(_3, v3.__s)), p2) { - null == N3.getDerivedStateFromProps && null != v3.componentWillMount && v3.componentWillMount(), null != v3.componentDidMount && f3.push(v3); - } else { - if (null == N3.getDerivedStateFromProps && null == e3 && null != v3.componentWillReceiveProps && v3.componentWillReceiveProps(_3, P3), !e3 && null != v3.shouldComponentUpdate && false === v3.shouldComponentUpdate(_3, v3.__s, P3)) { - for (v3.props = _3, v3.state = v3.__s, v3.__d = false, v3.__v = u3, u3.__e = null != c3 ? c3 !== t3.__e ? c3 : t3.__e : null, u3.__k = t3.__k, h3 = 0; h3 < u3.__k.length; h3++) { - u3.__k[h3] && (u3.__k[h3].__p = u3); + const x2 = () => { + const e2 = []; + for (const t2 of document.styleSheets) + for (const n3 of ft(t2)) + e2.push([new Ve(n3), 0]); + return e2; + }, q2 = window.getComputedStyle(u2), C2 = () => { + const t2 = (e2) => q2.getPropertyValue(e2), n3 = it(t2), r3 = ct(t2); + return { parentState: null, conditions: x2(), context: e({}, p2, { fontSize: r3.fontSize, rootFontSize: r3.fontSize, writingAxis: n3.writingAxis }), displayFlags: n3.displayFlags, isQueryContainer: false }; + }, k2 = (e2) => e2; + function A2(n3) { + let f2 = r2(n3); + if (!f2) { + let p3, S3 = null, x3 = false; + n3 === u2 ? (p3 = c2, S3 = k2) : n3 === o2 ? (x3 = true, p3 = new nt(o2, { viewportChanged: y2 })) : p3 = n3 === s2 ? new tt(s2) : n3 instanceof HTMLLinkElement ? new Ze(n3, { registerStyleSheet: (t2) => a2(n3, e({}, t2)) }) : n3 instanceof HTMLStyleElement ? new et(n3, { registerStyleSheet: (t2) => a2(n3, e({}, t2)) }) : new Xe(n3); + let q3 = Symbol(); + if (null == S3 && n3 instanceof Element) { + const r3 = function(n4) { + const r4 = window.getComputedStyle(n4); + return /* @__PURE__ */ function(n5) { + let u3 = null; + return (...n6) => { + if (null == u3 || !De(u3[0], n6)) { + const o3 = ((n7, u4) => { + const { context: o4, conditions: s3 } = n7, l3 = (e2) => r4.getPropertyValue(e2), c3 = it(l3), a3 = e({}, o4, { writingAxis: c3.writingAxis }); + let f3 = s3, p4 = false, y3 = c3.displayFlags; + 0 == (1 & n7.displayFlags) && (y3 = 0); + const { containerType: h3, containerNames: v2 } = c3; + if (h3 > 0) { + const e2 = h3 > 0 && 2 == (2 & y3), n8 = new Map(s3.map((e3) => [e3[0].value, e3[1]])); + if (f3 = [], p4 = true, e2) { + const e3 = ct(l3); + a3.fontSize = e3.fontSize; + const r5 = function(e4, t2) { + const n9 = { value: t2.width }, r6 = { value: t2.height }; + let u6 = n9, o5 = r6; + if (1 === e4.writingAxis) { + const e5 = u6; + u6 = o5, o5 = e5; + } + return 2 != (2 & e4.containerType) && (o5.value = void 0), { width: n9.value, height: r6.value, inlineSize: u6.value, blockSize: o5.value }; + }(c3, e3), u5 = { sizeFeatures: r5, treeContext: a3 }, p5 = (e4) => { + const { rule: r6 } = e4, o5 = r6.name, s4 = null == o5 || v2.has(o5) ? function(e5, n9) { + const r7 = /* @__PURE__ */ new Map(), u6 = n9.sizeFeatures; + for (const n10 of e5.features) { + const e6 = t(n10, u6); + if (1 === e6.type) + return null; + r7.set(n10, e6); + } + const o6 = i(e5.condition, { sizeFeatures: r7, treeContext: n9.treeContext }); + return 5 === o6.type ? o6.value : null; + }(r6, u5) : null; + var l4; + return null == s4 ? 1 === ((null != (l4 = n8.get(e4)) ? l4 : 0) && 1) : true === s4; + }, y4 = (e4, t2) => { + let n9 = e4.get(t2); + if (null == n9) { + const r6 = p5(t2); + n9 = (r6 ? 1 : 0) | (true !== r6 || null != t2.parent && 1 != (1 & y4(e4, t2.parent)) ? 0 : 2), e4.set(t2, n9); + } + return n9; + }, h4 = /* @__PURE__ */ new Map(); + for (const e4 of s3) + f3.push([e4[0], y4(h4, e4[0].value)]); + a3.cqw = null != r5.width ? r5.width / 100 : o4.cqw, a3.cqh = null != r5.height ? r5.height / 100 : o4.cqh; + } + } + return { parentState: new Ve(n7), conditions: f3, context: a3, displayFlags: y3, isQueryContainer: p4 }; + })(...n6); + null != u3 && De(u3[1], o3) || (u3 = [n6, o3]); } - break n; - } - null != v3.componentWillUpdate && v3.componentWillUpdate(_3, v3.__s, P3); + return u3[1]; + }; + }(); + }(n3); + S3 = (e2) => r3(e2, q3); + } + const C3 = S3 || k2; + let $2 = null; + const E2 = (e2) => { + const t2 = $2, n4 = C3(e2); + return $2 = n4, [$2, $2 !== t2]; + }, z2 = n3 instanceof HTMLElement || n3 instanceof SVGElement ? n3.style : null; + let L2 = false; + f2 = { connect() { + for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) + A2(e2); + p3.connected(); + }, disconnect() { + n3 instanceof Element && (l2.unobserve(n3), n3.removeAttribute(v), n3.removeAttribute(d)), z2 && (z2.removeProperty(g), z2.removeProperty(b), z2.removeProperty(m), z2.removeProperty(w)); + for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) { + const t2 = r2(e2); + null == t2 || t2.disconnect(); + } + p3.disconnected(), delete n3[We]; + }, update(e2) { + const [t2, r3] = E2(e2); + if (r3) { + if (h2(n3, e2, d), h2(n3, t2, v), n3 instanceof Element) { + const e3 = x3 || t2.isQueryContainer; + e3 && !L2 ? (l2.observe(n3), L2 = true) : !e3 && L2 && (l2.unobserve(n3), L2 = false); } - for (y3 = v3.props, w3 = v3.state, v3.context = P3, v3.props = _3, v3.state = v3.__s, (h3 = n2.__r) && h3(u3), v3.__d = false, v3.__v = u3, v3.__P = l2, h3 = v3.render(v3.props, v3.state, v3.context), u3.__k = x2(null != h3 && h3.type == d2 && null == h3.key ? h3.props.children : h3), null != v3.getChildContext && (i3 = s2(s2({}, i3), v3.getChildContext())), p2 || null == v3.getSnapshotBeforeUpdate || (g3 = v3.getSnapshotBeforeUpdate(y3, w3)), b2(l2, u3, t3, i3, r3, o3, f3, c3, a3), v3.base = u3.__e; h3 = v3.__h.pop(); ) { - v3.__s && (v3.state = v3.__s), h3.call(v3); + if (z2) { + const n4 = t2.context, r4 = n4.writingAxis; + let u3 = null, o3 = null, s3 = null, l3 = null; + (r4 !== e2.context.writingAxis || t2.isQueryContainer) && (u3 = `var(${0 === r4 ? m : w})`, o3 = `var(${1 === r4 ? m : w})`), e2 && !t2.isQueryContainer || (n4.cqw && (s3 = n4.cqw + "px"), n4.cqh && (l3 = n4.cqh + "px")), at(z2, g, u3), at(z2, b, o3), at(z2, m, s3), at(z2, w, l3); } - p2 || null == y3 || null == v3.componentDidUpdate || v3.componentDidUpdate(y3, w3, g3), k3 && (v3.__E = v3.__p = null); - } else { - u3.__e = z2(t3.__e, u3, t3, i3, r3, o3, f3, a3); + p3.updated(); } - (h3 = n2.diffed) && h3(u3); - } catch (l3) { - n2.__e(l3, u3, t3); + for (let e3 = n3.firstChild; null != e3; e3 = e3.nextSibling) + A2(e3).update(t2); + }, resize() { + q3 = Symbol(); + }, mutate() { + q3 = Symbol(); + for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) + A2(e2).mutate(); + } }, n3[We] = f2, f2.connect(); } - return u3.__e; + return f2; } - function j2(l2, u3) { - for (var t3; t3 = l2.pop(); ) { - try { - t3.componentDidMount(); - } catch (l3) { - n2.__e(l3, t3.__v); + u2.prepend(s2, o2), A2(u2), S2(); +}(); + +// base/alpine/index.js +var import_alpinejs = __toESM(require_module_cjs()); +var import_morph = __toESM(require_module_cjs2()); +var import_mask = __toESM(require_module_cjs3()); +var import_focus = __toESM(require_module_cjs4()); + +// helpers/alpine.js +function registerComponents(components) { + document.addEventListener("alpine:init", () => { + components.forEach((module) => { + if (module.default && module.default.component === true) { + Alpine.data(module.default.name, module.default); } + }); + }); + return components; +} +function getComponent(el, throwOnError = false) { + try { + return Alpine.$data(el); + } catch (error2) { + if (throwOnError) { + throw error2; + } else { + return null; } - n2.__c && n2.__c(u3); } - function z2(n3, l2, u3, t3, i3, r3, o3, c3) { - var s3, a3, h3, v3, p2 = u3.props, d3 = l2.props; - if (i3 = "svg" === l2.type || i3, null == n3 && null != r3) { - for (s3 = 0; s3 < r3.length; s3++) { - if (null != (a3 = r3[s3]) && (null === l2.type ? 3 === a3.nodeType : a3.localName === l2.type)) { - n3 = a3, r3[s3] = null; - break; - } - } +} +function getData(el) { + const root = Alpine.closestRoot(el); + return root ? Alpine.$data(root) : null; +} +function setData(el, newData) { + const data = getData(el); + return data ? Object.assign(data, newData) : null; +} + +// helpers/lang.js +var lang_exports = {}; +__export(lang_exports, { + camelCase: () => import_lodash.default, + isNumeric: () => isNumeric, + isObject: () => isObject, + kebabCase: () => import_lodash2.default, + keyBy: () => import_lodash4.default, + mapValues: () => import_lodash3.default, + nameFunction: () => nameFunction, + roughSizeOfObject: () => roughSizeOfObject +}); +var import_lodash = __toESM(require_lodash()); +var import_lodash2 = __toESM(require_lodash2()); +var import_lodash3 = __toESM(require_lodash3()); +var import_lodash4 = __toESM(require_lodash4()); +function nameFunction(name, body) { + return { + [name](...args) { + return body.apply(this, args); } - if (null == n3) { - if (null === l2.type) { - return document.createTextNode(d3); + }[name]; +} +function isObject(thing) { + return typeof thing === "object" && thing !== null; +} +function isNumeric(str) { + if (typeof str != "string") + return false; + return !isNaN(str) && // use type coercion to parse the _entirety_ of the string (`parseFloat` alone does not do this)... + !isNaN(parseFloat(str)); +} +function roughSizeOfObject(object) { + const objectList = []; + const stack = [object]; + let bytes = 0; + while (stack.length) { + const value = stack.pop(); + if (typeof value === "boolean") { + bytes += 4; + } else if (typeof value === "string") { + bytes += value.length * 2; + } else if (typeof value === "number") { + bytes += 8; + } else if (typeof value === "object" && objectList.indexOf(value) === -1) { + objectList.push(value); + for (var i2 in value) { + stack.push(value[i2]); } - n3 = i3 ? document.createElementNS("http://www.w3.org/2000/svg", l2.type) : document.createElement(l2.type), r3 = null; } - return null === l2.type ? p2 !== d3 && (null != r3 && (r3[r3.indexOf(n3)] = null), n3.data = d3) : l2 !== u3 && (null != r3 && (r3 = e2.slice.call(n3.childNodes)), h3 = (p2 = u3.props || f2).dangerouslySetInnerHTML, v3 = d3.dangerouslySetInnerHTML, c3 || (v3 || h3) && (v3 && h3 && v3.__html == h3.__html || (n3.innerHTML = v3 && v3.__html || "")), C2(n3, d3, p2, i3, c3), l2.__k = l2.props.children, v3 || b2(n3, l2, u3, t3, "foreignObject" !== l2.type && i3, r3, o3, f2, c3), c3 || ("value" in d3 && void 0 !== d3.value && d3.value !== n3.value && (n3.value = null == d3.value ? "" : d3.value), "checked" in d3 && void 0 !== d3.checked && d3.checked !== n3.checked && (n3.checked = d3.checked))), n3; } - function A2(l2, u3, t3) { - try { - "function" == typeof l2 ? l2(u3) : l2.current = u3; - } catch (l3) { - n2.__e(l3, t3); - } - } - function D2(l2, u3, t3) { - var i3, r3, o3; - if (n2.unmount && n2.unmount(l2), (i3 = l2.ref) && A2(i3, null, u3), t3 || "function" == typeof l2.type || (t3 = null != (r3 = l2.__e)), l2.__e = l2.l = null, null != (i3 = l2.__c)) { - if (i3.componentWillUnmount) { - try { - i3.componentWillUnmount(); - } catch (l3) { - n2.__e(l3, u3); + return bytes; +} + +// base/alpine/directives/undo.js +function undo_default(Alpine3) { + const maxHistorySize = 100; + Alpine3.directive("undo", (el, { expression }, { evaluate }) => { + const data = getData(el); + const history = Alpine3.reactive({ + stack: [], + stackPos: -1, + adding: false, + clear() { + history.stack.length = 0; + history.stackPos = -1; + }, + add(name, newValue, oldValue) { + if (!history.adding && newValue !== oldValue) { + if (history.stackPos < history.stackSize - 1) { + const stack = Alpine3.raw(history.stack); + history.stack = stack.slice(0, history.stackPos + 1); + } + history.stack.push({ name, newValue, oldValue }); + if (history.stackSize > maxHistorySize) { + history.stack.pop(); + } else { + history.stackPos++; + } } + }, + undo() { + if (!data.undo) { + console.error("Missing `undo` method"); + return; + } + if (history.undoable) { + history.adding = true; + const entry = history.stack[history.stackPos]; + data.undo(entry.name, entry.oldValue); + history.stackPos--; + this.$nextTick(() => history.adding = false); + } + }, + redo() { + if (!data.redo) { + console.error("Missing `redo` method"); + return; + } + if (history.redoable) { + history.adding = true; + history.stackPos++; + const entry = history.stack[history.stackPos]; + data.redo(entry.name, entry.newValue); + this.$nextTick(() => history.adding = false); + } + }, + get undoable() { + return history.stackPos >= 0; + }, + get redoable() { + return history.stackPos < history.stackSize - 1; + }, + get stackSize() { + return history.stack.length; + }, + get stackMemoryUsage() { + return roughSizeOfObject(history.stack); } - i3.base = i3.__P = null; - } - if (i3 = l2.__k) { - for (o3 = 0; o3 < i3.length; o3++) { - i3[o3] && D2(i3[o3], u3, t3); - } - } - null != r3 && a2(r3); + }); + setData(el, { history }); + }); +} + +// helpers/dom.js +var dom_exports = {}; +__export(dom_exports, { + castAttributeValue: () => castAttributeValue, + isNode: () => isNode +}); +function castAttributeValue(value) { + if (value === "false") { + return false; } - function H2(n3, l2, u3) { - return this.constructor(n3, u3); + if (value === "true") { + return true; } - function I2(l2, u3, t3) { - var i3, o3, c3; - n2.__p && n2.__p(l2, u3), o3 = (i3 = t3 === r2) ? null : t3 && t3.__k || u3.__k, l2 = h2(d2, null, [l2]), c3 = [], $2(u3, i3 ? u3.__k = l2 : (t3 || u3).__k = l2, o3 || f2, f2, void 0 !== u3.ownerSVGElement, t3 && !i3 ? [t3] : o3 ? null : e2.slice.call(u3.childNodes), c3, false, t3 || f2, i3), j2(c3, l2); + if (isNumeric(value)) { + return parseInt(value, 10); } - n2 = {}, m2.prototype.setState = function(n3, l2) { - var u3 = this.__s !== this.state && this.__s || (this.__s = s2({}, this.state)); - ("function" != typeof n3 || (n3 = n3(u3, this.props))) && s2(u3, n3), null != n3 && this.__v && (this.u = false, l2 && this.__h.push(l2), k2(this)); - }, m2.prototype.forceUpdate = function(n3) { - this.__v && (n3 && this.__h.push(n3), this.u = true, k2(this)); - }, m2.prototype.render = d2, u2 = [], t2 = "function" == typeof Promise ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, i2 = n2.debounceRendering, n2.__e = function(n3, l2, u3) { - for (var t3; l2 = l2.__p; ) { - if ((t3 = l2.__c) && !t3.__p) { - try { - if (t3.constructor && null != t3.constructor.getDerivedStateFromError) { - t3.setState(t3.constructor.getDerivedStateFromError(n3)); - } else { - if (null == t3.componentDidCatch) { - continue; + return value; +} +function isNode(o2) { + return typeof Node === "object" ? o2 instanceof Node : o2 && typeof o2 === "object" && typeof o2.nodeType === "number" && typeof o2.nodeName === "string"; +} + +// base/alpine/directives/options.js +function options_default(Alpine3) { + Alpine3.directive( + "options", + (el, { expression }, { evaluate, effect, cleanup }) => { + const optionNames = evaluate(expression); + const optionsData = buildOptionsData(el, optionNames); + const optionAttrs = optionsData.map((option) => option.attr); + const data = setData( + el, + Alpine3.reactive({ + $options: toPairs(optionsData) + }) + ); + effect(() => { + Object.entries(data.$options).forEach(([key, value]) => { + Alpine3.mutateDom(() => { + const attrName = `data-${(0, import_lodash2.default)(key)}`; + if (value === null) { + el.removeAttribute(attrName); + } else { + el.setAttribute(attrName, value); } - t3.componentDidCatch(n3); + }); + }); + }); + const attrObserver = new MutationObserver((mutationsList) => { + for (const mutation of mutationsList) { + const attrName = mutation.attributeName; + if (mutation.type !== "attributes" || !optionAttrs.includes(attrName)) { + return; } - return k2(t3.__E = t3); - } catch (l3) { - n3 = l3; + const value = mutation.target.getAttribute(attrName); + const option = (0, import_lodash.default)(attrName.replace("data-", "")); + data.$options[option] = castAttributeValue(value); } - } + }).observe(el, { attributes: true }); + cleanup(() => { + attrObserver && attrObserver.disconnect(); + }); } - throw n3; - }, r2 = f2, o2 = 0; - function _defineProperties(target, props) { - for (var i3 = 0; i3 < props.length; i3++) { - var descriptor = props[i3]; - descriptor.enumerable = descriptor.enumerable || false; - descriptor.configurable = true; - if ("value" in descriptor) { - descriptor.writable = true; + ).before("bind"); +} +function buildOptionsData(el, optionNames) { + return optionNames.map((name) => { + const key = (0, import_lodash.default)(name); + const attr = `data-${(0, import_lodash2.default)(name)}`; + let value = null; + if (el.hasAttribute(attr)) { + const strValue = el.getAttribute(attr); + value = castAttributeValue(strValue); + } + return { name, key, attr, value }; + }); +} +function toPairs(optionsData) { + return (0, import_lodash3.default)((0, import_lodash4.default)(optionsData, "key"), "value"); +} + +// base/tippy/index.js +var import_tippy = __toESM(require_tippy_cjs()); + +// base/tippy/plugins/hide_on_esc.js +var hide_on_esc_default = hideOnEsc = { + name: "hideOnEsc", + defaultValue: true, + fn({ hide }) { + function onKeyDown(event) { + if (event.keyCode === 27) { + hide(); } - Object.defineProperty(target, descriptor.key, descriptor); } - } - function _createClass(Constructor, protoProps, staticProps) { - if (protoProps) { - _defineProperties(Constructor.prototype, protoProps); - } - if (staticProps) { - _defineProperties(Constructor, staticProps); - } - return Constructor; - } - function _extends() { - _extends = Object.assign || function(target) { - var arguments$1 = arguments; - for (var i3 = 1; i3 < arguments.length; i3++) { - var source = arguments$1[i3]; - for (var key in source) { - if (Object.prototype.hasOwnProperty.call(source, key)) { - target[key] = source[key]; - } - } + return { + onShow() { + document.addEventListener("keydown", onKeyDown); + }, + onHide() { + document.removeEventListener("keydown", onKeyDown); } - return target; }; - return _extends.apply(this, arguments); } - var CSS_INTEGER = "[-\\+]?\\d+%?"; - var CSS_NUMBER = "[-\\+]?\\d*\\.\\d+%?"; - var CSS_UNIT = "(?:" + CSS_NUMBER + ")|(?:" + CSS_INTEGER + ")"; - var PERMISSIVE_MATCH_3 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; - var PERMISSIVE_MATCH_4 = "[\\s|\\(]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")[,|\\s]+(" + CSS_UNIT + ")\\s*\\)?"; - var REGEX_FUNCTIONAL_RGB = new RegExp("rgb" + PERMISSIVE_MATCH_3); - var REGEX_FUNCTIONAL_RGBA = new RegExp("rgba" + PERMISSIVE_MATCH_4); - var REGEX_FUNCTIONAL_HSL = new RegExp("hsl" + PERMISSIVE_MATCH_3); - var REGEX_FUNCTIONAL_HSLA = new RegExp("hsla" + PERMISSIVE_MATCH_4); - var HEX_START = "^(?:#?|0x?)"; - var HEX_INT_SINGLE = "([0-9a-fA-F]{1})"; - var HEX_INT_DOUBLE = "([0-9a-fA-F]{2})"; - var REGEX_HEX_3 = new RegExp(HEX_START + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + "$"); - var REGEX_HEX_4 = new RegExp(HEX_START + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + HEX_INT_SINGLE + "$"); - var REGEX_HEX_6 = new RegExp(HEX_START + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + "$"); - var REGEX_HEX_8 = new RegExp(HEX_START + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + HEX_INT_DOUBLE + "$"); - var KELVIN_MIN = 2e3; - var KELVIN_MAX = 4e4; - var log = Math.log; - var round2 = Math.round; - var floor = Math.floor; - function clamp(num, min2, max2) { - return Math.min(Math.max(num, min2), max2); +}; + +// base/tippy/index.js +import_tippy.default.setDefaultProps({ + theme: null, + allowHTML: true, + arrow: import_tippy.roundArrow + import_tippy.roundArrow, + plugins: [hide_on_esc_default, import_tippy.followCursor] +}); +var tippy_default = import_tippy.default; + +// base/alpine/utils/tippy_modifiers.js +function tippyModifiers(modifiers) { + if (modifiers.length === 0) + return {}; + const config = { + plugins: [] + }; + const getModifierArgument = (modifier) => { + return modifiers[modifiers.indexOf(modifier) + 1]; + }; + if (modifiers.includes("duration")) { + config.duration = parseInt(getModifierArgument("duration")); } - function parseUnit(str, max2) { - var isPercentage = str.indexOf("%") > -1; - var num = parseFloat(str); - return isPercentage ? max2 / 100 * num : num; + if (modifiers.includes("delay")) { + const delay = getModifierArgument("delay"); + config.delay = delay.includes("-") ? delay.split("-").map((n2) => parseInt(n2)) : parseInt(delay); } - function parseHexInt(str) { - return parseInt(str, 16); + if (modifiers.includes("debounce") && config.interactive) { + config.interactiveDebounce = parseInt(getModifierArgument("debounce")); } - function intToHex(_int) { - return _int.toString(16).padStart(2, "0"); + if (modifiers.includes("theme")) { + config.theme = getModifierArgument("theme"); } - var IroColor = /* @__PURE__ */ function() { - function IroColor2(value, onChange) { - this.$ = { - h: 0, - s: 0, - v: 0, - a: 1 - }; - if (value) { - this.set(value); + if (modifiers.includes("placement")) { + config.placement = getModifierArgument("placement"); + } + return config; +} + +// base/alpine/directives/tooltip.js +function tooltip_default(Alpine3) { + Alpine3.directive( + "tooltip", + (el, { modifiers, expression }, { evaluate, evaluateLater, effect }) => { + const config = tippyModifiers(modifiers); + if (!el.__x_tippy) { + el.__x_tippy = tippy_default(el, { + theme: "coco-tooltip", + ...config + }); } - this.onChange = onChange; - this.initialValue = _extends({}, this.$); - } - var _proto = IroColor2.prototype; - _proto.set = function set3(value) { - if (typeof value === "string") { - if (/^(?:#?|0x?)[0-9a-fA-F]{3,8}$/.test(value)) { - this.hexString = value; - } else if (/^rgba?/.test(value)) { - this.rgbString = value; - } else if (/^hsla?/.test(value)) { - this.hslString = value; + let initialContent = null; + const enableTooltip = () => el.__x_tippy.enable(); + const disableTooltip = () => el.__x_tippy.disable(); + const setupTooltip = (content2) => { + if (!content2) { + disableTooltip(); + } else { + enableTooltip(); + el.__x_tippy.setContent(content2); + initialContent = initialContent || content2; } - } else if (typeof value === "object") { - if (value instanceof IroColor2) { - this.hsva = value.hsva; - } else if ("r" in value && "g" in value && "b" in value) { - this.rgb = value; - } else if ("h" in value && "s" in value && "v" in value) { - this.hsv = value; - } else if ("h" in value && "s" in value && "l" in value) { - this.hsl = value; - } else if ("kelvin" in value) { - this.kelvin = value.kelvin; - } + }; + if (modifiers.includes("raw")) { + setupTooltip(expression); } else { - throw new Error("Invalid color value"); + const getContent = evaluateLater(expression); + effect(() => { + getContent((content2) => { + if (typeof content2 === "object" && content2 !== null) { + el.__x_tippy.setProps(content2); + initialContent = initialContent || content2.content; + enableTooltip(); + } else { + setupTooltip(content2); + } + }); + }); } - }; - _proto.setChannel = function setChannel(format, channel, value) { - var _extends2; - this[format] = _extends({}, this[format], (_extends2 = {}, _extends2[channel] = value, _extends2)); - }; - _proto.reset = function reset() { - this.hsva = this.initialValue; - }; - _proto.clone = function clone2() { - return new IroColor2(this); - }; - _proto.unbind = function unbind() { - this.onChange = void 0; - }; - IroColor2.hsvToRgb = function hsvToRgb(hsv) { - var h3 = hsv.h / 60; - var s3 = hsv.s / 100; - var v3 = hsv.v / 100; - var i3 = floor(h3); - var f3 = h3 - i3; - var p2 = v3 * (1 - s3); - var q2 = v3 * (1 - f3 * s3); - var t3 = v3 * (1 - (1 - f3) * s3); - var mod3 = i3 % 6; - var r3 = [v3, q2, p2, p2, t3, v3][mod3]; - var g3 = [t3, v3, v3, q2, p2, p2][mod3]; - var b3 = [p2, p2, t3, v3, v3, q2][mod3]; - return { - r: clamp(r3 * 255, 0, 255), - g: clamp(g3 * 255, 0, 255), - b: clamp(b3 * 255, 0, 255) - }; - }; - IroColor2.rgbToHsv = function rgbToHsv(rgb) { - var r3 = rgb.r / 255; - var g3 = rgb.g / 255; - var b3 = rgb.b / 255; - var max2 = Math.max(r3, g3, b3); - var min2 = Math.min(r3, g3, b3); - var delta = max2 - min2; - var hue = 0; - var value = max2; - var saturation = max2 === 0 ? 0 : delta / max2; - switch (max2) { - case min2: - hue = 0; - break; - case r3: - hue = (g3 - b3) / delta + (g3 < b3 ? 6 : 0); - break; - case g3: - hue = (b3 - r3) / delta + 2; - break; - case b3: - hue = (r3 - g3) / delta + 4; - break; + setData(el, { + tooltip: { + setContent(content2) { + setupTooltip(content2); + }, + disable: () => disableTooltip(), + enable: () => enableTooltip(), + reset() { + if (initialContent) + setupTooltip(initialContent); + } + } + }); + } + ).before("bind"); +} + +// base/alpine/directives/destroy.js +function destroy_default(Alpine3) { + Alpine3.directive( + "destroy", + (el, { expression }, { evaluateLater, cleanup }) => { + const clean = evaluateLater(expression); + cleanup(() => clean()); + } + ); +} + +// base/alpine/directives/dropdown.js +function dropdown_default(Alpine3) { + Alpine3.directive( + "dropdown", + (el, { value, modifiers, expression }, { evaluate, effect }) => { + if (value) + return; + const data = getData(el); + const settings = tippyModifiers(modifiers); + const result = expression ? evaluate(expression) : {}; + const directiveConfig = isObject(result) ? result : {}; + let { triggerTarget, contentTarget, anchorTarget, ...config } = directiveConfig; + contentTarget = contentTarget || el.querySelector("[x-dropdown\\:content]"); + content = isNode(contentTarget) ? contentTarget.firstElementChild : contentTarget; + triggerTarget = triggerTarget || el.querySelector("[x-dropdown\\:trigger]") || el; + anchorTarget = anchorTarget || el.querySelector("[x-dropdown\\:anchor]") || el; + if (!el.__x_dropdown) { + const mixin = Alpine3.reactive({ + dropdown: { + open: false, + trigger: triggerTarget, + content: contentTarget, + hide() { + el.__x_dropdown.hide(); + }, + show() { + el.__x_dropdown.show(); + } + } + }); + setData(el, mixin); + const dropdown = el.__x_dropdown = tippy_default(anchorTarget, { + theme: "coco-app-dropdown", + placement: "bottom-start", + offset: [0, 0], + trigger: "click", + interactive: true, + animation: false, + maxWidth: 380, + triggerTarget, + content, + onShow: (...args) => { + mixin.dropdown.open = true; + data.$dispatch("dropdown:show", { dropdown: el.__x_dropdown }); + }, + onHide: (...args) => { + mixin.dropdown.open = false; + data.$dispatch("dropdown:hide", { dropdown: el.__x_dropdown }); + }, + onMount() { + data.$dispatch("dropdown:mount", { dropdown: el.__x_dropdown }); + }, + onCreate() { + data.$dispatch("dropdown:create", { dropdown: el.__x_dropdown }); + }, + ...settings, + ...config + }); } - return { - h: hue * 60 % 360, - s: clamp(saturation * 100, 0, 100), - v: clamp(value * 100, 0, 100) - }; - }; - IroColor2.hsvToHsl = function hsvToHsl(hsv) { - var s3 = hsv.s / 100; - var v3 = hsv.v / 100; - var l2 = (2 - s3) * v3; - var divisor = l2 <= 1 ? l2 : 2 - l2; - var saturation = divisor < 1e-9 ? 0 : s3 * v3 / divisor; - return { - h: hsv.h, - s: clamp(saturation * 100, 0, 100), - l: clamp(l2 * 50, 0, 100) - }; - }; - IroColor2.hslToHsv = function hslToHsv(hsl) { - var l2 = hsl.l * 2; - var s3 = hsl.s * (l2 <= 100 ? l2 : 200 - l2) / 100; - var saturation = l2 + s3 < 1e-9 ? 0 : 2 * s3 / (l2 + s3); - return { - h: hsl.h, - s: clamp(saturation * 100, 0, 100), - v: clamp((l2 + s3) / 2, 0, 100) - }; - }; - IroColor2.kelvinToRgb = function kelvinToRgb(kelvin) { - var temp = kelvin / 100; - var r3, g3, b3; - if (temp < 66) { - r3 = 255; - g3 = -155.25485562709179 - 0.44596950469579133 * (g3 = temp - 2) + 104.49216199393888 * log(g3); - b3 = temp < 20 ? 0 : -254.76935184120902 + 0.8274096064007395 * (b3 = temp - 10) + 115.67994401066147 * log(b3); + } + ).before("bind"); +} + +// base/alpine/directives/dimensions.js +function dimensions_default(Alpine3) { + Alpine3.directive( + "dimensions", + (el, { value, modifiers, expression }, { evaluateLater, cleanup }) => { + if (value) + return; + const data = getData(el); + let target; + if (modifiers.includes("parent")) { + target = el.parentNode; } else { - r3 = 351.97690566805693 + 0.114206453784165 * (r3 = temp - 55) - 40.25366309332127 * log(r3); - g3 = 325.4494125711974 + 0.07943456536662342 * (g3 = temp - 50) - 28.0852963507957 * log(g3); - b3 = 255; + target = el.querySelector("[x-dimensions\\:target]") || el; } - return { - r: clamp(floor(r3), 0, 255), - g: clamp(floor(g3), 0, 255), - b: clamp(floor(b3), 0, 255) - }; - }; - IroColor2.rgbToKelvin = function rgbToKelvin(rgb) { - var r3 = rgb.r, b3 = rgb.b; - var eps = 0.4; - var minTemp = KELVIN_MIN; - var maxTemp = KELVIN_MAX; - var temp; - while (maxTemp - minTemp > eps) { - temp = (maxTemp + minTemp) * 0.5; - var _rgb = IroColor2.kelvinToRgb(temp); - if (_rgb.b / _rgb.r >= b3 / r3) { - maxTemp = temp; - } else { - minTemp = temp; + const evaluate = evaluateLater(expression); + const sizeObserver = new ResizeObserver((entries) => { + const dimensions = entries[0].contentRect; + evaluate(() => { + }, { + scope: { + dimensions: { + width: dimensions.width, + height: dimensions.height, + x: dimensions.x, + y: dimensions.y + } + } + }); + }); + sizeObserver.observe(target); + cleanup(() => { + sizeObserver && sizeObserver.disconnect(); + }); + } + ); +} + +// base/alpine/directives/notification.js +function notification_default(Alpine3) { + let notificationId = 0; + let queuePosition = 0; + Alpine3.directive("notification", (el, { expression }, { evaluate }) => { + notificationId++; + const data = getData(el); + const type = evaluate(expression); + const options = evaluate("$options"); + const notification = Alpine3.reactive({ + id: notificationId, + type, + autoShow: options.show, + showDelay: options.showDelay, + shown: false, + autoDismiss: options.dismiss, + dismissDelay: options.dismissDelay, + dismissed: false, + dismissTimer: null, + position: options.position, + queuePosition: 0, + init() { + data.$dispatch(`${type}:init`, { + id: notification.id, + type: notification.type, + [type]: notification + }); + if (notification.autoShow) { + setTimeout(() => notification.show(), notification.showDelay); } - } - return temp; - }; - _createClass(IroColor2, [{ - key: "hsv", - get: function get3() { - var value = this.$; - return { - h: value.h, - s: value.s, - v: value.v - }; }, - set: function set3(newValue) { - var oldValue = this.$; - newValue = _extends({}, oldValue, newValue); - if (this.onChange) { - var changes = { - h: false, - v: false, - s: false, - a: false - }; - for (var key in oldValue) { - changes[key] = newValue[key] != oldValue[key]; - } - this.$ = newValue; - if (changes.h || changes.s || changes.v || changes.a) { - this.onChange(this, changes); - } - } else { - this.$ = newValue; + show() { + if (!notification.shown) { + notification.queuePosition = queuePosition++; + notification.startAutoDismiss(); + notification.shown = true; + data.$dispatch(`${type}:show`, { + id: notification.id, + queuePosition: notification.queuePosition, + type: notification.type, + [type]: notification + }); } - } - }, { - key: "hsva", - get: function get3() { - return _extends({}, this.$); }, - set: function set3(value) { - this.hsv = value; - } - }, { - key: "hue", - get: function get3() { - return this.$.h; + dismiss() { + notification.dismissed = true; + notification.clearAutoDismiss(); + data.$dispatch(`${type}:dismiss`, { + id: notification.id, + [type]: notification + }); + setTimeout(() => el.remove(), 500); }, - set: function set3(value) { - this.hsv = { - h: value - }; - } - }, { - key: "saturation", - get: function get3() { - return this.$.s; + startAutoDismiss() { + if (notification.autoDismiss === true) { + notification.dismissTimer = setTimeout( + () => notification.dismiss(), + notification.dismissDelay + ); + } }, - set: function set3(value) { - this.hsv = { - s: value - }; - } - }, { - key: "value", - get: function get3() { - return this.$.v; + clearAutoDismiss() { + clearTimeout(notification.dismissTimer); }, - set: function set3(value) { - this.hsv = { - v: value - }; + clearFromQueue(event) { + if (notification.type === event.detail.type && notification.position === "fixed" && notification.id !== event.detail.id && notification.queuePosition < event.detail.queuePosition) { + notification.dismiss(); + } } - }, { - key: "alpha", - get: function get3() { - return this.$.a; - }, - set: function set3(value) { - this.hsv = _extends({}, this.hsv, { - a: value - }); + }); + setData(el, { notification }); + evaluate("notification.init"); + }).before("init"); +} + +// base/alpine/index.js +window.Alpine = import_alpinejs.default; +import_alpinejs.default.plugin(import_mask.default); +import_alpinejs.default.plugin(import_focus.default); +import_alpinejs.default.plugin(import_morph.default); +import_alpinejs.default.plugin(undo_default); +import_alpinejs.default.plugin(options_default); +import_alpinejs.default.plugin(tooltip_default); +import_alpinejs.default.plugin(destroy_default); +import_alpinejs.default.plugin(dropdown_default); +import_alpinejs.default.plugin(dimensions_default); +import_alpinejs.default.plugin(notification_default); +var alpine_default = import_alpinejs.default; + +// ../../../package.json +var package_default = { + name: "coveragebook-components", + version: "0.15.0", + repository: "git@github.com:coveragebook/coco.git", + license: "NO LICENSE", + author: "Mark Perkins <mark@coveragebook.com>", + main: "app/assets/build/coco/core.js", + scripts: { + build: "npm run js:build && npm run css:build && npm run lookbook:build", + "build:dev": "npm run js:dev && npm run css:dev", + "css:build": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco", + "css:dev": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco/dev", + "css:watch": "postcss ./app/assets/css/{app,book}.css -d ./app/assets/build/coco/dev --watch", + "js:build": "node esbuild.config.mjs", + "js:dev": "node esbuild.config.mjs --dev", + "js:watch": "node esbuild.config.mjs --watch", + "lint:fix": "bundle exec standardrb --fix && prettier --write .", + "lookbook:build": "cd lookbook && npm run build", + prepare: "husky install", + release: "release-it" + }, + "lint-staged": { + "**/*": [ + "prettier --write --ignore-unknown" + ], + "(**/*.(rb|rake))|Gemfile|Rakefile": [ + "standardrb --fix" + ] + }, + browserslist: [ + "defaults" + ], + prettier: { + semi: true, + singleQuote: false, + tabWidth: 2, + trailingComma: "es5" + }, + dependencies: { + "@alpinejs/focus": "^3.13.2", + "@alpinejs/mask": "^3.13.3", + "@alpinejs/morph": "^3.13.2", + "@jaames/iro": "^5.5.2", + "@percy/cli": "^1.27.3", + "@tailwindcss/container-queries": "^0.1.0", + "@tailwindcss/forms": "^0.5.6", + "alias-hq": "^6.2.2", + alpinejs: "^3.13.2", + autoprefixer: "^10.4.16", + "container-query-polyfill": "^1.0.2", + del: "^7.1.0", + esbuild: "^0.19.11", + "esbuild-plugin-copy": "^2.0.2", + "fast-glob": "^3.3.1", + "fast-sort": "^3.2.1", + html2canvas: "^1.4.1", + husky: "^8.0.3", + "js-cookie": "^3.0.5", + "lint-staged": "^15.2.0", + "lodash.camelcase": "^4.3.0", + "lodash.kebabcase": "^4.1.1", + "lodash.keyby": "^4.6.0", + "lodash.mapvalues": "^4.6.0", + "lucide-static": "^0.303.0", + postcss: "^8.4.31", + "postcss-cli": "^10.1.0", + "postcss-value-parser": "^4.2.0", + prettier: "^3.1.1", + "release-it": "^17.0.1", + svgo: "^3.0.2", + tailwindcss: "^3.4.0", + "tippy.js": "^6.3.7" + }, + "release-it": { + github: { + release: true + }, + npm: { + publish: false + }, + hooks: { + "before:init": [ + "npm install", + "bundle install", + "bundle exec rake coco:test" + ], + "after:bump": [ + "npm run lint:fix", + "npm run build" + ], + "after:version:bump": "bundle exec rake coco:gem:bump_version[${version}] && bundle && cd lookbook && bundle", + "after:release": "rake coco:gem:release[${version}]" + } + } +}; + +// coco/component.js +function CocoComponent(name, fn) { + const func = nameFunction(name, (...args) => { + const data = fn(...args); + Object.defineProperties(data, { + $parent: { + get() { + return getData(this.$root.parentElement); + } } - }, { - key: "kelvin", - get: function get3() { - return IroColor2.rgbToKelvin(this.rgb); - }, - set: function set3(value) { - this.rgb = IroColor2.kelvinToRgb(value); + }); + data.$options = {}; + return data; + }); + func.component = true; + return func; +} +var component_default = CocoComponent; + +// helpers/index.js +var helpers_exports = {}; +__export(helpers_exports, { + color: () => color_exports, + dom: () => dom_exports, + lang: () => lang_exports, + location: () => location_exports, + turboEvents: () => turbo_events_exports +}); + +// helpers/color.js +var color_exports = {}; +__export(color_exports, { + formatHex: () => formatHex, + isDark: () => isDark, + isLight: () => isLight, + isValidHex: () => isValidHex +}); +function isDark(color) { + let r2; + let g2; + let b2; + let hsp; + color = +`0x${color.slice(1).replace(color.length < 5 && /./g, "$&$&")}`; + r2 = color >> 16; + g2 = color >> 8 & 255; + b2 = color & 255; + hsp = Math.sqrt(0.299 * (r2 * r2) + 0.587 * (g2 * g2) + 0.114 * (b2 * b2)); + if (hsp > 127.5) { + return false; + } + return true; +} +function isLight(color) { + return !isDark(color); +} +function isValidHex(color) { + if (!color || typeof color !== "string") + return false; + if (color.substring(0, 1) === "#") + color = color.substring(1); + switch (color.length) { + case 3: + return /^[0-9A-F]{3}$/i.test(color); + case 6: + return /^[0-9A-F]{6}$/i.test(color); + case 8: + return /^[0-9A-F]{8}$/i.test(color); + default: + return false; + } +} +function formatHex(str) { + return `#${str.toUpperCase().replace("#", "")}`; +} + +// helpers/location.js +var location_exports = {}; +__export(location_exports, { + navigateTo: () => navigateTo +}); +function navigateTo(url, options = {}) { + if (window.Turbo && options.turbo === true) { + delete options.turbo; + turboOptions = Object.assign({ action: "advance" }, options); + window.Turbo.visit(url, turboOptions); + } else { + location.assign(url); + } +} + +// helpers/turbo_events.js +var turbo_events_exports = {}; +__export(turbo_events_exports, { + hasFailed: () => hasFailed, + wasSuccessful: () => wasSuccessful +}); +function wasSuccessful(event) { + return getEventDetail(event).success; +} +function hasFailed(event) { + return !getEventDetail(event).success; +} +function getEventDetail(obj) { + return obj instanceof CustomEvent ? obj.detail : obj; +} + +// coco/coco.js +var Coco = { + version: package_default.version, + start() { + if (this._started) { + throw new Error("Coco has already been started!"); + } + console.info("Initializing Coco JS", package_default.version); + registerComponents(this._components); + window.Alpine = alpine_default; + alpine_default.start(); + }, + registerComponents(components) { + this._components.push(...components); + }, + component(...args) { + return component_default(...args); + }, + _components: [], + _started: false +}; +Coco.Component = component_default; +Coco.helpers = helpers_exports; +var coco_default = Coco; + +// ../../components/coco/buttons/button/button.js +var button_exports = {}; +__export(button_exports, { + default: () => button_default +}); +var button_default = CocoComponent("button", (data = {}) => { + return { + options: ["state", "confirm", "size", "disabled", "collapsible"], + isCollapsed: false, + approving: false, + confirmed: true, + lastState: null, + stateTooltips: data.tooltips || {}, + tooltipText: null, + ...data.props || {}, + init() { + this.lastState = this.state; + this.checkConfirmation = this.checkConfirmation.bind(this); + this.approveAndRun = this.approveAndRun.bind(this); + this.shouldShowTooltip = this.shouldShowTooltip.bind(this); + this.$nextTick(() => { + if (this.$options.confirm) { + this.confirmed = false; + } + }); + this.$watch("collapsed", (collapsed) => { + if (collapsed && !this.collapsible) { + this.collapsed = false; + return; + } + this.$root.setAttribute("data-collapsed", collapsed ? "true" : "false"); + }); + }, + setTooltipText() { + if (this.disabled) { + this.tooltipText = null; + return; } - }, { - key: "red", - get: function get3() { - var rgb = this.rgb; - return rgb.r; - }, - set: function set3(value) { - this.rgb = _extends({}, this.rgb, { - r: value - }); + const defaultContent = this.$el.getAttribute("data-tippy-content"); + const tooltipForState = this.stateTooltips[this.state]; + if (this.collapsed) { + const labelText = this.getContentForState(this.state); + this.tooltipText = tooltipForState || labelText || defaultContent; + } else { + this.tooltipText = tooltipForState || defaultContent; } - }, { - key: "green", - get: function get3() { - var rgb = this.rgb; - return rgb.g; - }, - set: function set3(value) { - this.rgb = _extends({}, this.rgb, { - g: value - }); + }, + shouldShowTooltip() { + return !!this.tooltipText; + }, + get disabled() { + return this.$options.disabled === true; + }, + set disabled(value) { + this.$options.disabled = value; + }, + get tippyInstance() { + return this.$root.__x_tippy; + }, + /* confirmation */ + checkConfirmation(event) { + if (!this.confirmed) { + this.approving = true; + event.preventDefault(); } - }, { - key: "blue", - get: function get3() { - var rgb = this.rgb; - return rgb.b; - }, - set: function set3(value) { - this.rgb = _extends({}, this.rgb, { - b: value - }); + }, + approveAndRun(event) { + if (this.approving) { + event.stopPropagation(); + this.confirmed = true; + this.dropdown.trigger.click(); + this.dropdown.hide(); + this.confirmed = false; + this.approving = false; } - }, { - key: "rgb", - get: function get3() { - var _IroColor$hsvToRgb = IroColor2.hsvToRgb(this.$), r3 = _IroColor$hsvToRgb.r, g3 = _IroColor$hsvToRgb.g, b3 = _IroColor$hsvToRgb.b; - return { - r: round2(r3), - g: round2(g3), - b: round2(b3) - }; - }, - set: function set3(value) { - this.hsv = _extends({}, IroColor2.rgbToHsv(value), { - a: value.a === void 0 ? 1 : value.a - }); + }, + cancelConfirmation(event) { + if (this.approving) { + event.stopPropagation(); + this.approving = false; + this.dropdown.hide(); } - }, { - key: "rgba", - get: function get3() { - return _extends({}, this.rgb, { - a: this.alpha - }); - }, - set: function set3(value) { - this.rgb = value; + }, + /* state */ + get state() { + return this.$options.state || "default"; + }, + set state(name) { + this.setState(name); + }, + get loading() { + return this.state === "loading"; + }, + set loading(value) { + this.$options.state = value === true ? "loading" : "default"; + }, + setState(name) { + this.lastState = this.state; + this.$options.state = (0, import_lodash.default)(name); + }, + resetState() { + this.$options.state = this.lastState || "default"; + this.lastState = this.$options.state; + }, + toggleState(state1, state2 = this.laststate) { + this.state = this.state === state1 ? state2 : state1; + }, + getContentForState(state) { + const content2 = this.$refs[`${state}Content`]; + return content2 ? content2.innerText : null; + }, + hasIconForState(state) { + return !!this.$refs[`${state}Icon`]; + }, + hasContentForState(state) { + return !!this.getContentForState(state); + }, + showIcon(state) { + return state === this.state || !this.hasIconForState(this.state) && state === "default"; + }, + showContent(state) { + return state === this.state || !this.hasContentForState(this.state) && state === "default"; + }, + /* collapsing */ + get collapsed() { + return this.isCollapsed; + }, + set collapsed(value) { + this.isCollapsed = this.collapsible ? value : false; + }, + get collapsible() { + return this.$options.collapsible !== false && this.hasIconForState(this.$options.state || "default"); + }, + /* bindings */ + root: { + "x-options": "options", + "x-tooltip": "tooltipText", + "x-effect": "setTooltipText", + ":disabled": "disabled" + } + }; +}); + +// ../../components/coco/buttons/button/button_dropdown.js +var button_dropdown_exports = {}; +__export(button_dropdown_exports, { + default: () => button_dropdown_default +}); +var button_dropdown_default = CocoComponent("buttonDropdown", () => { + return { + dropdown: null, + button: null, + init() { + this.$nextTick(() => { + this.button = getComponent(this.$el.querySelector(".coco-button")); + }); + }, + hideDropdown() { + if (this.dropdown) { + this.dropdown.hide(); } - }, { - key: "hsl", - get: function get3() { - var _IroColor$hsvToHsl = IroColor2.hsvToHsl(this.$), h3 = _IroColor$hsvToHsl.h, s3 = _IroColor$hsvToHsl.s, l2 = _IroColor$hsvToHsl.l; - return { - h: round2(h3), - s: round2(s3), - l: round2(l2) - }; - }, - set: function set3(value) { - this.hsv = _extends({}, IroColor2.hslToHsv(value), { - a: value.a === void 0 ? 1 : value.a - }); + }, + showDropdown() { + if (this.dropdown) { + this.dropdown.show(); } - }, { - key: "hsla", - get: function get3() { - return _extends({}, this.hsl, { - a: this.alpha + }, + /* bindings */ + root: { + "@dropdown:show": "button.setState('active')", + "@dropdown:hide": "button.resetState()", + "@confirmation:confirm": "button.approveAndRun($event)", + "@confirmation:cancel": "button.cancelConfirmation($event)" + } + }; +}); + +// ../../components/coco/buttons/button_group/button_group.js +var button_group_exports = {}; +__export(button_group_exports, { + default: () => button_group_default +}); +var button_group_default = CocoComponent("appButtonGroup", () => { + return { + options: ["collapsible"], + ready: false, + containerWidth: 0, + contentWidth: 0, + collapsed: false, + singletonTooltip: null, + tooltipInstances: [], + get collapsible() { + return this.$options.collapsible !== false; + }, + get buttons() { + const buttonElements = this.$el.querySelectorAll( + "[data-component='button']" + ); + return Array.from(buttonElements).map((el) => getComponent(el)); + }, + get parent() { + return this.$root.parentElement; + }, + init() { + if (this.collapsible) { + this.$nextTick(() => { + this.onResize(); + this.createSingletonTooltip(); + this.ready = true; }); - }, - set: function set3(value) { - this.hsl = value; + } else { + this.ready = true; } - }, { - key: "rgbString", - get: function get3() { - var rgb = this.rgb; - return "rgb(" + rgb.r + ", " + rgb.g + ", " + rgb.b + ")"; - }, - set: function set3(value) { - var match; - var r3, g3, b3, a3 = 1; - if (match = REGEX_FUNCTIONAL_RGB.exec(value)) { - r3 = parseUnit(match[1], 255); - g3 = parseUnit(match[2], 255); - b3 = parseUnit(match[3], 255); - } else if (match = REGEX_FUNCTIONAL_RGBA.exec(value)) { - r3 = parseUnit(match[1], 255); - g3 = parseUnit(match[2], 255); - b3 = parseUnit(match[3], 255); - a3 = parseUnit(match[4], 1); + this.$watch("collapsed", (value) => { + this.buttons.forEach((button) => { + button.isCollapsed = value; + }); + this.$nextTick(() => this.createSingletonTooltip()); + }); + }, + createSingletonTooltip() { + this.destroySingletonTooltip(); + this.tooltipInstances = this.buttons.map((button) => { + if (button.tippyInstance && button.shouldShowTooltip && button.shouldShowTooltip()) { + return button.tippyInstance; } - if (match) { - this.rgb = { - r: r3, - g: g3, - b: b3, - a: a3 - }; - } else { - throw new Error("Invalid rgb string"); - } + }).filter((t2) => t2); + this.singletonTooltip = (0, import_tippy.createSingleton)(this.tooltipInstances, { + theme: "coco-tooltip", + delay: 100, + moveTransition: "transform 0.1s ease-out" + }); + }, + destroySingletonTooltip() { + if (this.singletonTooltip && this.singletonTooltip.destroy) { + this.singletonTooltip.destroy(); + this.singletonTooltip = null; + this.tooltipInstances.forEach((tooltip) => tooltip.destroy()); + this.tooltipInstances = []; } - }, { - key: "rgbaString", - get: function get3() { - var rgba = this.rgba; - return "rgba(" + rgba.r + ", " + rgba.g + ", " + rgba.b + ", " + rgba.a + ")"; - }, - set: function set3(value) { - this.rgbString = value; - } - }, { - key: "hexString", - get: function get3() { - var rgb = this.rgb; - return "#" + intToHex(rgb.r) + intToHex(rgb.g) + intToHex(rgb.b); - }, - set: function set3(value) { - var match; - var r3, g3, b3, a3 = 255; - if (match = REGEX_HEX_3.exec(value)) { - r3 = parseHexInt(match[1]) * 17; - g3 = parseHexInt(match[2]) * 17; - b3 = parseHexInt(match[3]) * 17; - } else if (match = REGEX_HEX_4.exec(value)) { - r3 = parseHexInt(match[1]) * 17; - g3 = parseHexInt(match[2]) * 17; - b3 = parseHexInt(match[3]) * 17; - a3 = parseHexInt(match[4]) * 17; - } else if (match = REGEX_HEX_6.exec(value)) { - r3 = parseHexInt(match[1]); - g3 = parseHexInt(match[2]); - b3 = parseHexInt(match[3]); - } else if (match = REGEX_HEX_8.exec(value)) { - r3 = parseHexInt(match[1]); - g3 = parseHexInt(match[2]); - b3 = parseHexInt(match[3]); - a3 = parseHexInt(match[4]); + }, + onResize() { + if (!this.collapsible) + return; + this.containerWidth = Math.ceil(this.parent.offsetWidth); + if (this.collapsed) { + if (this.containerWidth > this.contentWidth) { + this.collapsed = false; } - if (match) { - this.rgb = { - r: r3, - g: g3, - b: b3, - a: a3 / 255 - }; + } else { + if (this.containerWidth < this.contentWidth) { + this.collapsed = true; } else { - throw new Error("Invalid hex string"); + const contentWidth = Math.ceil(this.$refs.buttons.scrollWidth); + this.contentWidth = contentWidth; } } - }, { - key: "hex8String", - get: function get3() { - var rgba = this.rgba; - return "#" + intToHex(rgba.r) + intToHex(rgba.g) + intToHex(rgba.b) + intToHex(floor(rgba.a * 255)); - }, - set: function set3(value) { - this.hexString = value; + }, + destroy() { + if (this.singletonTooltip) { + this.singletonTooltip.destroy(); + this.singletonTooltip = null; } - }, { - key: "hslString", - get: function get3() { - var hsl = this.hsl; - return "hsl(" + hsl.h + ", " + hsl.s + "%, " + hsl.l + "%)"; - }, - set: function set3(value) { - var match; - var h3, s3, l2, a3 = 1; - if (match = REGEX_FUNCTIONAL_HSL.exec(value)) { - h3 = parseUnit(match[1], 360); - s3 = parseUnit(match[2], 100); - l2 = parseUnit(match[3], 100); - } else if (match = REGEX_FUNCTIONAL_HSLA.exec(value)) { - h3 = parseUnit(match[1], 360); - s3 = parseUnit(match[2], 100); - l2 = parseUnit(match[3], 100); - a3 = parseUnit(match[4], 1); - } - if (match) { - this.hsl = { - h: h3, - s: s3, - l: l2, - a: a3 - }; - } else { - throw new Error("Invalid hsl string"); - } - } - }, { - key: "hslaString", - get: function get3() { - var hsla = this.hsla; - return "hsla(" + hsla.h + ", " + hsla.s + "%, " + hsla.l + "%, " + hsla.a + ")"; - }, - set: function set3(value) { - this.hslString = value; - } - }]); - return IroColor2; - }(); - var sliderDefaultOptions = { - sliderShape: "bar", - sliderType: "value", - minTemperature: 2200, - maxTemperature: 11e3 + } }; - function getSliderDimensions(props) { - var _sliderSize; - var width = props.width, sliderSize = props.sliderSize, borderWidth = props.borderWidth, handleRadius = props.handleRadius, padding = props.padding, sliderShape = props.sliderShape; - var ishorizontal = props.layoutDirection === "horizontal"; - sliderSize = (_sliderSize = sliderSize) != null ? _sliderSize : padding * 2 + handleRadius * 2; - if (sliderShape === "circle") { - return { - handleStart: props.padding + props.handleRadius, - handleRange: width - padding * 2 - handleRadius * 2, - width, - height: width, - cx: width / 2, - cy: width / 2, - radius: width / 2 - borderWidth / 2 - }; - } else { - return { - handleStart: sliderSize / 2, - handleRange: width - sliderSize, - radius: sliderSize / 2, - x: 0, - y: 0, - width: ishorizontal ? sliderSize : width, - height: ishorizontal ? width : sliderSize - }; +}); + +// ../../components/coco/buttons/color_picker_button/color_picker_button.js +var color_picker_button_exports = {}; +__export(color_picker_button_exports, { + default: () => color_picker_button_default +}); +var color_picker_button_default = CocoComponent("colorPickerButton", ({ selected }) => { + selected = selected ? "#" + selected.replace("#", "") : "#FFFFFF"; + return { + selectedColor: selected, + getPicker() { + return getData( + this.$root.querySelector("[data-role='color-picker']").firstElementChild + ); + }, + onDropdownMount() { + this.getPicker().setSelectedColor(this.selectedColor); } - } - function getCurrentSliderValue(props, color) { - var hsva = color.hsva; - var rgb = color.rgb; - switch (props.sliderType) { - case "red": - return rgb.r / 2.55; - case "green": - return rgb.g / 2.55; - case "blue": - return rgb.b / 2.55; - case "alpha": - return hsva.a * 100; - case "kelvin": - var minTemperature = props.minTemperature, maxTemperature = props.maxTemperature; - var temperatureRange = maxTemperature - minTemperature; - var percent = (color.kelvin - minTemperature) / temperatureRange * 100; - return Math.max(0, Math.min(percent, 100)); - case "hue": - return hsva.h /= 3.6; - case "saturation": - return hsva.s; - case "value": - default: - return hsva.v; + }; +}); + +// ../../components/coco/buttons/confirm_panel/confirm_panel.js +var confirm_panel_exports = {}; +__export(confirm_panel_exports, { + default: () => confirm_panel_default +}); +var confirm_panel_default = CocoComponent("confirmPanel", () => { + return { + confirm() { + this.$dispatch("confirmation:confirm"); + }, + cancel() { + this.$dispatch("confirmation:cancel"); } - } - function getSliderValueFromInput(props, x3, y3) { - var _getSliderDimensions = getSliderDimensions(props), handleRange = _getSliderDimensions.handleRange, handleStart = _getSliderDimensions.handleStart; - var handlePos; - if (props.layoutDirection === "horizontal") { - handlePos = -1 * y3 + handleRange + handleStart; - } else { - handlePos = x3 - handleStart; + }; +}); + +// ../../components/coco/buttons/image_picker_button/image_picker_button.js +var image_picker_button_exports = {}; +__export(image_picker_button_exports, { + default: () => image_picker_button_default +}); + +// helpers/path.js +function basename(path) { + return path ? path.replace(/.*\//, "") : path; +} + +// ../../components/coco/buttons/image_picker_button/image_picker_button.js +var image_picker_button_default = CocoComponent("imagePickerButton", ({ src }) => { + return { + selectedImage: { + name: basename(src), + file: null, + data: src + }, + getPicker() { + return getData( + this.$root.querySelector("[data-role='image-picker'").firstElementChild + ); + }, + handleExternalDrop(event) { + this.readFile(event.dataTransfer.files[0]); + }, + readFile(file) { + const reader = new FileReader(); + reader.addEventListener("load", () => { + const selectedImage = { + name: file.name, + file, + data: reader.result + }; + this.$dispatch("image-picker:change", { image: selectedImage }); + this.selectedImage = selectedImage; + if (this.dropdown) { + this.dropdown.hide(); + } + }); + reader.readAsDataURL(file); + }, + clearSelectedImage() { + this.dropdown.hide(); + this.selectedImage = { name: null, data: null, file: null }; + }, + setSelectedImage(image) { + this.dropdown.hide(); + this.selectedImage = image; + }, + onDropdownMount({ detail }) { + this.dropdown = detail.dropdown; + this.getPicker().setImage(this.selectedImage, true); } - handlePos = Math.max(Math.min(handlePos, handleRange), 0); - var percent = Math.round(100 / handleRange * handlePos); - switch (props.sliderType) { - case "kelvin": - var minTemperature = props.minTemperature, maxTemperature = props.maxTemperature; - var temperatureRange = maxTemperature - minTemperature; - return minTemperature + temperatureRange * (percent / 100); - case "alpha": - return percent / 100; - case "hue": - return percent * 3.6; - case "red": - case "blue": - case "green": - return percent * 2.55; - default: - return percent; + }; +}); + +// ../../components/coco/buttons/layout_picker_button/layout_picker_button.js +var layout_picker_button_exports = {}; +__export(layout_picker_button_exports, { + default: () => layout_picker_button_default +}); +var layout_picker_button_default = CocoComponent("layoutPickerButton", ({ selected }) => { + return { + selectedLayout: selected, + getPicker() { + return getData( + this.$root.querySelector("[data-role='layout-picker']").firstElementChild + ); + }, + getButton() { + return getData(this.$root.querySelector(".layout-picker-trigger")); + }, + init() { + this.$watch("selectedLayout", () => this.getButton().hideDropdown()); } - } - function getSliderHandlePosition(props, color) { - var _getSliderDimensions2 = getSliderDimensions(props), width = _getSliderDimensions2.width, height = _getSliderDimensions2.height, handleRange = _getSliderDimensions2.handleRange, handleStart = _getSliderDimensions2.handleStart; - var ishorizontal = props.layoutDirection === "horizontal"; - var sliderValue = getCurrentSliderValue(props, color); - var midPoint = ishorizontal ? width / 2 : height / 2; - var handlePos = handleStart + sliderValue / 100 * handleRange; - if (ishorizontal) { - handlePos = -1 * handlePos + handleRange + handleStart * 2; + }; +}); + +// ../../components/coco/buttons/menu_button/menu_button.js +var menu_button_exports = {}; +__export(menu_button_exports, { + default: () => menu_button_default +}); +var menu_button_default = CocoComponent("menuButton", () => { + return {}; +}); + +// ../../components/coco/buttons/toolbar/toolbar.js +var toolbar_exports = {}; +__export(toolbar_exports, { + default: () => toolbar_default +}); +var toolbar_default = CocoComponent("appToolbar", () => { + return { + ready: false, + startSectionWidth: null, + endSectionWidth: null, + get startGroupEl() { + return this.$refs.startSection.firstElementChild; + }, + get endGroupEl() { + return this.$refs.endSection.firstElementChild; + }, + get groups() { + return [this.startGroupEl, this.endGroupEl].filter((g2) => g2).map((el) => getComponent(el, false)); + }, + init() { + const toolbarWidth = this.$el.offsetWidth; + let startSectionWidth = 0; + let endSectionWidth = 0; + if (this.startGroupEl) { + startSectionWidth = Math.ceil( + this.startGroupEl.offsetWidth / toolbarWidth * 100 + ); + } + if (this.endGroupEl) { + endSectionWidth = Math.ceil( + this.endGroupEl.offsetWidth / toolbarWidth * 100 + ); + } + this.$nextTick(() => { + this.startSectionWidth = `${startSectionWidth}%`; + this.endSectionWidth = `${endSectionWidth}%`; + this.groups.forEach((group) => group.onResize()); + this.ready = true; + }); } - return { - x: ishorizontal ? midPoint : handlePos, - y: ishorizontal ? handlePos : midPoint - }; - } - function getSliderGradient(props, color) { - var hsv = color.hsv; - var rgb = color.rgb; - switch (props.sliderType) { - case "red": - return [[0, "rgb(0," + rgb.g + "," + rgb.b + ")"], [100, "rgb(255," + rgb.g + "," + rgb.b + ")"]]; - case "green": - return [[0, "rgb(" + rgb.r + ",0," + rgb.b + ")"], [100, "rgb(" + rgb.r + ",255," + rgb.b + ")"]]; - case "blue": - return [[0, "rgb(" + rgb.r + "," + rgb.g + ",0)"], [100, "rgb(" + rgb.r + "," + rgb.g + ",255)"]]; - case "alpha": - return [[0, "rgba(" + rgb.r + "," + rgb.g + "," + rgb.b + ",0)"], [100, "rgb(" + rgb.r + "," + rgb.g + "," + rgb.b + ")"]]; - case "kelvin": - var stops = []; - var min2 = props.minTemperature; - var max2 = props.maxTemperature; - var numStops = 8; - var range = max2 - min2; - for (var kelvin = min2, stop2 = 0; kelvin < max2; kelvin += range / numStops, stop2 += 1) { - var _IroColor$kelvinToRgb = IroColor.kelvinToRgb(kelvin), r3 = _IroColor$kelvinToRgb.r, g3 = _IroColor$kelvinToRgb.g, b3 = _IroColor$kelvinToRgb.b; - stops.push([100 / numStops * stop2, "rgb(" + r3 + "," + g3 + "," + b3 + ")"]); + }; +}); + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/buttons/**/*.js +var modules = [button_exports, button_dropdown_exports, button_group_exports, color_picker_button_exports, confirm_panel_exports, image_picker_button_exports, layout_picker_button_exports, menu_button_exports, toolbar_exports]; +var __default = modules; + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/embeds/**/*.js +var modules2 = []; +var __default2 = modules2; + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/fields/**/*.js +var modules3 = []; +var __default3 = modules3; + +// ../../components/coco/images/icon/icon.js +var icon_exports = {}; +__export(icon_exports, { + default: () => icon_default +}); +var icon_default = CocoComponent("icon", () => { + return { + options: ["style", "spin"], + get spin() { + return this.$options.spin; + }, + set spin(val) { + this.$options.spin = val; + }, + get fill() { + return this.$options.style === "fill"; + }, + set fill(val) { + this.$options.style = val === true ? "fill" : "line"; + }, + root: { + "x-options": "options" + } + }; +}); + +// ../../components/coco/images/image_uploader/image_uploader.js +var image_uploader_exports = {}; +__export(image_uploader_exports, { + default: () => image_uploader_default +}); +var image_uploader_default = CocoComponent("imageUploader", ({ click, drop }) => { + return { + file: null, + errors: [], + active: false, + clickable: click, + droppable: drop, + input: null, + get fileName() { + return this.file && this.file.name; + }, + get fileType() { + return this.file && this.file.type; + }, + get fileSize() { + return this.file && this.file.size; + }, + get fileData() { + return this.file && this.file.data; + }, + init() { + this.input = this.$refs.input; + this.$watch("file", (file) => { + const dataTransfer = new DataTransfer(); + if (file && file.file instanceof File) { + dataTransfer.items.add(file.file); } - return stops; - case "hue": - return [[0, "#f00"], [16.666, "#ff0"], [33.333, "#0f0"], [50, "#0ff"], [66.666, "#00f"], [83.333, "#f0f"], [100, "#f00"]]; - case "saturation": - var noSat = IroColor.hsvToHsl({ - h: hsv.h, - s: 0, - v: hsv.v + this.input.files = dataTransfer.files; + }); + }, + setFile(file) { + this.file = file; + }, + openPicker() { + this.input.click(); + }, + clear() { + this.file = null; + this.input.value = null; + this.$dispatch("image-uploader:clear"); + }, + handleDrop(event) { + const files = event.detail.files || event.dataTransfer.files; + this.handleFiles(files); + }, + handleFiles(files) { + Array.from(files).forEach((file) => this.readFile(file)); + }, + readFile(file) { + const reader = new FileReader(); + reader.addEventListener("load", () => { + this.file = { + name: file.name, + size: file.size, + type: file.type, + file, + data: reader.result + }; + this.$dispatch("image-uploader:load", { file: this.file }); + }); + reader.addEventListener("error", () => { + this.errors.push(`Error reading file: ${file.name}`); + }); + reader.readAsDataURL(file); + } + }; +}); + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/images/**/*.js +var modules4 = [icon_exports, image_uploader_exports]; +var __default4 = modules4; + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/indicators/**/*.js +var modules5 = []; +var __default5 = modules5; + +// ../../components/coco/layout/page/page.js +var page_exports = {}; +__export(page_exports, { + default: () => page_default +}); +var page_default = CocoComponent("pageLayout", () => { + return {}; +}); + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/layout/**/*.js +var modules6 = [page_exports]; +var __default6 = modules6; + +// ../../components/coco/messaging/alert/alert.js +var alert_exports = {}; +__export(alert_exports, { + default: () => alert_default +}); +var alert_default = CocoComponent("alertMessage", () => { + return { + alert: null, + dismissed: false, + forceMultiLine: false, + dismissDuration: 300, + init() { + this.checkSingleLineWrap = Alpine.throttle( + this.checkSingleLineWrap.bind(this), + 200 + ); + }, + dismiss() { + if (this.$options.dismissable) { + this.$dispatch("alert:dismiss", { + alert: this, + duration: this.dismissDuration }); - var fullSat = IroColor.hsvToHsl({ - h: hsv.h, - s: 100, - v: hsv.v + this.dismissed = true; + setTimeout(() => this.remove(), this.dismissDuration); + } + }, + remove() { + this.$nextTick(() => this.$dispatch("alert:removed", { alert: this })); + this.$root.remove(); + }, + checkSingleLineWrap({ height }) { + this.forceMultiLine = false; + if (height > 24 && this.$options.singleLine) { + this.$nextTick(() => { + this.forceMultiLine = true; }); - return [[0, "hsl(" + noSat.h + "," + noSat.s + "%," + noSat.l + "%)"], [100, "hsl(" + fullSat.h + "," + fullSat.s + "%," + fullSat.l + "%)"]]; - case "value": - default: - var hsl = IroColor.hsvToHsl({ - h: hsv.h, - s: hsv.s, - v: 100 - }); - return [[0, "#000"], [100, "hsl(" + hsl.h + "," + hsl.s + "%," + hsl.l + "%)"]]; + } + }, + root: { + "x-options": '["dismissable", "singleLine", "dismissAfterAction"]', + ":class": "{'force-multi-line': forceMultiLine}" } - } - var TAU = Math.PI * 2; - var mod = function mod2(a3, n3) { - return (a3 % n3 + n3) % n3; }; - var dist = function dist2(x3, y3) { - return Math.sqrt(x3 * x3 + y3 * y3); +}); + +// ../../components/coco/messaging/notice/notice.js +var notice_exports = {}; +__export(notice_exports, { + default: () => notice_default +}); +var notice_default = CocoComponent("notice", () => { + return {}; +}); + +// ../../components/coco/messaging/snackbar/snackbar.js +var snackbar_exports = {}; +__export(snackbar_exports, { + default: () => snackbar_default +}); +var snackbar_default = CocoComponent("snackbar", () => { + return { + notificationType: "snackbar", + options: ["show", "dismiss", "showDelay", "dismissDelay", "position"], + root: { + "x-options": "options", + "x-notification": "notificationType", + "x-show": "notification.shown && !notification.dismissed", + "@mouseover": "notification.clearAutoDismiss", + "@mouseout": "notification.startAutoDismiss", + "@snackbar:show.document": "notification.clearFromQueue", + "x-transition:enter": "snackbar-enter", + "x-transition:enter-start": "snackbar-enter-start", + "x-transition:enter-end": "snackbar-enter-end", + "x-transition:leave": "snackbar-leave", + "x-transition:leave-start": "snackbar-leave-start", + "x-transition:leave-end": "snackbar-leave-end" + } }; - function getHandleRange(props) { - return props.width / 2 - props.padding - props.handleRadius - props.borderWidth; - } - function isInputInsideWheel(props, x3, y3) { - var _getWheelDimensions = getWheelDimensions(props), cx = _getWheelDimensions.cx, cy = _getWheelDimensions.cy; - var r3 = props.width / 2; - return dist(cx - x3, cy - y3) < r3; - } - function getWheelDimensions(props) { - var r3 = props.width / 2; - return { - width: props.width, - radius: r3 - props.borderWidth, - cx: r3, - cy: r3 - }; - } - function translateWheelAngle(props, angle, invert) { - var wheelAngle = props.wheelAngle; - var wheelDirection = props.wheelDirection; - if (invert && wheelDirection === "clockwise") { - angle = wheelAngle + angle; - } else if (wheelDirection === "clockwise") { - angle = 360 - wheelAngle + angle; - } else if (invert && wheelDirection === "anticlockwise") { - angle = wheelAngle + 180 - angle; - } else if (wheelDirection === "anticlockwise") { - angle = wheelAngle - angle; +}); + +// ../../components/coco/messaging/system_banner/system_banner.js +var system_banner_exports = {}; +__export(system_banner_exports, { + default: () => system_banner_default +}); + +// ../../../node_modules/js-cookie/dist/js.cookie.mjs +function assign(target) { + for (var i2 = 1; i2 < arguments.length; i2++) { + var source = arguments[i2]; + for (var key in source) { + target[key] = source[key]; } - return mod(angle, 360); } - function getWheelHandlePosition(props, color) { - var hsv = color.hsv; - var _getWheelDimensions2 = getWheelDimensions(props), cx = _getWheelDimensions2.cx, cy = _getWheelDimensions2.cy; - var handleRange = getHandleRange(props); - var handleAngle = (180 + translateWheelAngle(props, hsv.h, true)) * (TAU / 360); - var handleDist = hsv.s / 100 * handleRange; - var direction = props.wheelDirection === "clockwise" ? -1 : 1; - return { - x: cx + handleDist * Math.cos(handleAngle) * direction, - y: cy + handleDist * Math.sin(handleAngle) * direction - }; - } - function getWheelValueFromInput(props, x3, y3) { - var _getWheelDimensions3 = getWheelDimensions(props), cx = _getWheelDimensions3.cx, cy = _getWheelDimensions3.cy; - var handleRange = getHandleRange(props); - x3 = cx - x3; - y3 = cy - y3; - var hue = translateWheelAngle(props, Math.atan2(-y3, -x3) * (360 / TAU)); - var handleDist = Math.min(dist(x3, y3), handleRange); - return { - h: Math.round(hue), - s: Math.round(100 / handleRange * handleDist) - }; - } - function getBoxDimensions(props) { - var width = props.width, boxHeight = props.boxHeight, padding = props.padding, handleRadius = props.handleRadius; - return { - width, - height: boxHeight != null ? boxHeight : width, - radius: padding + handleRadius - }; - } - function getBoxValueFromInput(props, x3, y3) { - var _getBoxDimensions = getBoxDimensions(props), width = _getBoxDimensions.width, height = _getBoxDimensions.height, radius = _getBoxDimensions.radius; - var handleStart = radius; - var handleRangeX = width - radius * 2; - var handleRangeY = height - radius * 2; - var percentX = (x3 - handleStart) / handleRangeX * 100; - var percentY = (y3 - handleStart) / handleRangeY * 100; - return { - s: Math.max(0, Math.min(percentX, 100)), - v: Math.max(0, Math.min(100 - percentY, 100)) - }; - } - function getBoxHandlePosition(props, color) { - var _getBoxDimensions2 = getBoxDimensions(props), width = _getBoxDimensions2.width, height = _getBoxDimensions2.height, radius = _getBoxDimensions2.radius; - var hsv = color.hsv; - var handleStart = radius; - var handleRangeX = width - radius * 2; - var handleRangeY = height - radius * 2; - return { - x: handleStart + hsv.s / 100 * handleRangeX, - y: handleStart + (handleRangeY - hsv.v / 100 * handleRangeY) - }; - } - function getBoxGradients(props, color) { - var hue = color.hue; - return [ - // saturation gradient - [[0, "#fff"], [100, "hsl(" + hue + ",100%,50%)"]], - // lightness gradient - [[0, "rgba(0,0,0,0)"], [100, "#000"]] - ]; - } - var BASE_ELEMENTS; - function resolveSvgUrl(url) { - if (!BASE_ELEMENTS) { - BASE_ELEMENTS = document.getElementsByTagName("base"); + return target; +} +var defaultConverter = { + read: function(value) { + if (value[0] === '"') { + value = value.slice(1, -1); } - var ua = window.navigator.userAgent; - var isSafari = /^((?!chrome|android).)*safari/i.test(ua); - var isIos = /iPhone|iPod|iPad/i.test(ua); - var location2 = window.location; - return (isSafari || isIos) && BASE_ELEMENTS.length > 0 ? location2.protocol + "//" + location2.host + location2.pathname + location2.search + url : url; + return value.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent); + }, + write: function(value) { + return encodeURIComponent(value).replace( + /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g, + decodeURIComponent + ); } - function getHandleAtPoint(props, x3, y3, handlePositions) { - for (var i3 = 0; i3 < handlePositions.length; i3++) { - var dX = handlePositions[i3].x - x3; - var dY = handlePositions[i3].y - y3; - var dist3 = Math.sqrt(dX * dX + dY * dY); - if (dist3 < props.handleRadius) { - return i3; - } +}; +function init(converter, defaultAttributes) { + function set(name, value, attributes) { + if (typeof document === "undefined") { + return; } - return null; - } - function cssBorderStyles(props) { - return { - boxSizing: "border-box", - border: props.borderWidth + "px solid " + props.borderColor - }; - } - function cssGradient(type, direction, stops) { - return type + "-gradient(" + direction + ", " + stops.map(function(_ref) { - var o3 = _ref[0], col = _ref[1]; - return col + " " + o3 + "%"; - }).join(",") + ")"; - } - function cssValue(value) { - if (typeof value === "string") { - return value; + attributes = assign({}, defaultAttributes, attributes); + if (typeof attributes.expires === "number") { + attributes.expires = new Date(Date.now() + attributes.expires * 864e5); } - return value + "px"; - } - var iroColorPickerOptionDefaults = { - width: 300, - height: 300, - color: "#fff", - colors: [], - padding: 6, - layoutDirection: "vertical", - borderColor: "#fff", - borderWidth: 0, - handleRadius: 8, - activeHandleRadius: null, - handleSvg: null, - handleProps: { - x: 0, - y: 0 - }, - wheelLightness: true, - wheelAngle: 0, - wheelDirection: "anticlockwise", - sliderSize: null, - sliderMargin: 12, - boxHeight: null - }; - var SECONDARY_EVENTS = [ - "mousemove", - "touchmove", - "mouseup", - "touchend" - /* TouchEnd */ - ]; - var IroComponentWrapper = /* @__PURE__ */ function(Component) { - function IroComponentWrapper2(props) { - Component.call(this, props); - this.uid = (Math.random() + 1).toString(36).substring(5); + if (attributes.expires) { + attributes.expires = attributes.expires.toUTCString(); } - if (Component) - IroComponentWrapper2.__proto__ = Component; - IroComponentWrapper2.prototype = Object.create(Component && Component.prototype); - IroComponentWrapper2.prototype.constructor = IroComponentWrapper2; - IroComponentWrapper2.prototype.render = function render2(props) { - var eventHandler = this.handleEvent.bind(this); - var rootProps = { - onMouseDown: eventHandler, - // https://github.com/jaames/iro.js/issues/126 - // https://github.com/preactjs/preact/issues/2113#issuecomment-553408767 - ontouchstart: eventHandler - }; - var isHorizontal = props.layoutDirection === "horizontal"; - var margin = props.margin === null ? props.sliderMargin : props.margin; - var rootStyles = { - overflow: "visible", - display: isHorizontal ? "inline-block" : "block" - }; - if (props.index > 0) { - rootStyles[isHorizontal ? "marginLeft" : "marginTop"] = margin; + name = encodeURIComponent(name).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape); + var stringifiedAttributes = ""; + for (var attributeName in attributes) { + if (!attributes[attributeName]) { + continue; } - return h2(d2, null, props.children(this.uid, rootProps, rootStyles)); - }; - IroComponentWrapper2.prototype.handleEvent = function handleEvent(e3) { - var this$1 = this; - var inputHandler = this.props.onInput; - var bounds = this.base.getBoundingClientRect(); - e3.preventDefault(); - var point = e3.touches ? e3.changedTouches[0] : e3; - var x3 = point.clientX - bounds.left; - var y3 = point.clientY - bounds.top; - switch (e3.type) { - case "mousedown": - case "touchstart": - var result = inputHandler( - x3, - y3, - 0 - /* Start */ - ); - if (result !== false) { - SECONDARY_EVENTS.forEach(function(event) { - document.addEventListener(event, this$1, { passive: false }); - }); - } - break; - case "mousemove": - case "touchmove": - inputHandler( - x3, - y3, - 1 - /* Move */ - ); - break; - case "mouseup": - case "touchend": - inputHandler( - x3, - y3, - 2 - /* End */ - ); - SECONDARY_EVENTS.forEach(function(event) { - document.removeEventListener(event, this$1, { passive: false }); - }); - break; + stringifiedAttributes += "; " + attributeName; + if (attributes[attributeName] === true) { + continue; } - }; - return IroComponentWrapper2; - }(m2); - function IroHandle(props) { - var radius = props.r; - var url = props.url; - var cx = radius; - var cy = radius; - return h2( - "svg", - { className: "IroHandle IroHandle--" + props.index + " " + (props.isActive ? "IroHandle--isActive" : ""), style: { - "-webkit-tap-highlight-color": "rgba(0, 0, 0, 0);", - transform: "translate(" + cssValue(props.x) + ", " + cssValue(props.y) + ")", - willChange: "transform", - top: cssValue(-radius), - left: cssValue(-radius), - width: cssValue(radius * 2), - height: cssValue(radius * 2), - position: "absolute", - overflow: "visible" - } }, - url && h2("use", Object.assign({ xlinkHref: resolveSvgUrl(url) }, props.props)), - !url && h2("circle", { cx, cy, r: radius, fill: "none", "stroke-width": 2, stroke: "#000" }), - !url && h2("circle", { cx, cy, r: radius - 2, fill: props.fill, "stroke-width": 2, stroke: "#fff" }) - ); - } - IroHandle.defaultProps = { - fill: "none", - x: 0, - y: 0, - r: 8, - url: null, - props: { x: 0, y: 0 } - }; - function IroSlider(props) { - var activeIndex = props.activeIndex; - var activeColor = activeIndex !== void 0 && activeIndex < props.colors.length ? props.colors[activeIndex] : props.color; - var ref = getSliderDimensions(props); - var width = ref.width; - var height = ref.height; - var radius = ref.radius; - var handlePos = getSliderHandlePosition(props, activeColor); - var gradient = getSliderGradient(props, activeColor); - function handleInput(x3, y3, type) { - var value = getSliderValueFromInput(props, x3, y3); - props.parent.inputActive = true; - activeColor[props.sliderType] = value; - props.onInput(type, props.id); + stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; } - return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid2, rootProps, rootStyles) { - return h2( - "div", - Object.assign({}, rootProps, { className: "IroSlider", style: Object.assign( - {}, - { - position: "relative", - width: cssValue(width), - height: cssValue(height), - borderRadius: cssValue(radius), - // checkered bg to represent alpha - background: "conic-gradient(#ccc 25%, #fff 0 50%, #ccc 0 75%, #fff 0)", - backgroundSize: "8px 8px" - }, - rootStyles - ) }), - h2("div", { className: "IroSliderGradient", style: Object.assign( - {}, - { - position: "absolute", - top: 0, - left: 0, - width: "100%", - height: "100%", - borderRadius: cssValue(radius), - background: cssGradient("linear", props.layoutDirection === "horizontal" ? "to top" : "to right", gradient) - }, - cssBorderStyles(props) - ) }), - h2(IroHandle, { isActive: true, index: activeColor.index, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePos.x, y: handlePos.y }) - ); - }); + return document.cookie = name + "=" + converter.write(value, name) + stringifiedAttributes; } - IroSlider.defaultProps = Object.assign({}, sliderDefaultOptions); - function IroBox(props) { - var ref = getBoxDimensions(props); - var width = ref.width; - var height = ref.height; - var radius = ref.radius; - var colors = props.colors; - var colorPicker = props.parent; - var activeIndex = props.activeIndex; - var activeColor = activeIndex !== void 0 && activeIndex < props.colors.length ? props.colors[activeIndex] : props.color; - var gradients = getBoxGradients(props, activeColor); - var handlePositions = colors.map(function(color) { - return getBoxHandlePosition(props, color); - }); - function handleInput(x3, y3, inputType) { - if (inputType === 0) { - var activeHandle = getHandleAtPoint(props, x3, y3, handlePositions); - if (activeHandle !== null) { - colorPicker.setActiveColor(activeHandle); - } else { - colorPicker.inputActive = true; - activeColor.hsv = getBoxValueFromInput(props, x3, y3); - props.onInput(inputType, props.id); + function get(name) { + if (typeof document === "undefined" || arguments.length && !name) { + return; + } + var cookies = document.cookie ? document.cookie.split("; ") : []; + var jar = {}; + for (var i2 = 0; i2 < cookies.length; i2++) { + var parts = cookies[i2].split("="); + var value = parts.slice(1).join("="); + try { + var found = decodeURIComponent(parts[0]); + jar[found] = converter.read(value, found); + if (name === found) { + break; } - } else if (inputType === 1) { - colorPicker.inputActive = true; - activeColor.hsv = getBoxValueFromInput(props, x3, y3); + } catch (e2) { } - props.onInput(inputType, props.id); } - return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid2, rootProps, rootStyles) { - return h2( - "div", - Object.assign({}, rootProps, { className: "IroBox", style: Object.assign( - {}, - { - width: cssValue(width), - height: cssValue(height), - position: "relative" - }, - rootStyles - ) }), - h2("div", { className: "IroBox", style: Object.assign( - {}, - { - width: "100%", - height: "100%", - borderRadius: cssValue(radius) - }, - cssBorderStyles(props), - { background: cssGradient("linear", "to bottom", gradients[1]) + "," + cssGradient("linear", "to right", gradients[0]) } - ) }), - colors.filter(function(color) { - return color !== activeColor; - }).map(function(color) { - return h2(IroHandle, { isActive: false, index: color.index, fill: color.hslString, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[color.index].x, y: handlePositions[color.index].y }); - }), - h2(IroHandle, { isActive: true, index: activeColor.index, fill: activeColor.hslString, r: props.activeHandleRadius || props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[activeColor.index].x, y: handlePositions[activeColor.index].y }) - ); - }); + return name ? jar[name] : jar; } - var HUE_GRADIENT_CLOCKWISE = "conic-gradient(red, yellow, lime, aqua, blue, magenta, red)"; - var HUE_GRADIENT_ANTICLOCKWISE = "conic-gradient(red, magenta, blue, aqua, lime, yellow, red)"; - function IroWheel(props) { - var ref = getWheelDimensions(props); - var width = ref.width; - var colors = props.colors; - var borderWidth = props.borderWidth; - var colorPicker = props.parent; - var activeColor = props.color; - var hsv = activeColor.hsv; - var handlePositions = colors.map(function(color) { - return getWheelHandlePosition(props, color); - }); - var circleStyles = { - position: "absolute", - top: 0, - left: 0, - width: "100%", - height: "100%", - borderRadius: "50%", - boxSizing: "border-box" - }; - function handleInput(x3, y3, inputType) { - if (inputType === 0) { - if (!isInputInsideWheel(props, x3, y3)) { - return false; - } - var activeHandle = getHandleAtPoint(props, x3, y3, handlePositions); - if (activeHandle !== null) { - colorPicker.setActiveColor(activeHandle); - } else { - colorPicker.inputActive = true; - activeColor.hsv = getWheelValueFromInput(props, x3, y3); - props.onInput(inputType, props.id); - } - } else if (inputType === 1) { - colorPicker.inputActive = true; - activeColor.hsv = getWheelValueFromInput(props, x3, y3); + return Object.create( + { + set, + get, + remove: function(name, attributes) { + set( + name, + "", + assign({}, attributes, { + expires: -1 + }) + ); + }, + withAttributes: function(attributes) { + return init(this.converter, assign({}, this.attributes, attributes)); + }, + withConverter: function(converter2) { + return init(assign({}, this.converter, converter2), this.attributes); } - props.onInput(inputType, props.id); + }, + { + attributes: { value: Object.freeze(defaultAttributes) }, + converter: { value: Object.freeze(converter) } } - return h2(IroComponentWrapper, Object.assign({}, props, { onInput: handleInput }), function(uid2, rootProps, rootStyles) { - return h2( - "div", - Object.assign({}, rootProps, { className: "IroWheel", style: Object.assign( - {}, - { - width: cssValue(width), - height: cssValue(width), - position: "relative" - }, - rootStyles - ) }), - h2("div", { className: "IroWheelHue", style: Object.assign( - {}, - circleStyles, - { - transform: "rotateZ(" + (props.wheelAngle + 90) + "deg)", - background: props.wheelDirection === "clockwise" ? HUE_GRADIENT_CLOCKWISE : HUE_GRADIENT_ANTICLOCKWISE - } - ) }), - h2("div", { className: "IroWheelSaturation", style: Object.assign( - {}, - circleStyles, - { background: "radial-gradient(circle closest-side, #fff, transparent)" } - ) }), - props.wheelLightness && h2("div", { className: "IroWheelLightness", style: Object.assign( - {}, - circleStyles, - { - background: "#000", - opacity: 1 - hsv.v / 100 - } - ) }), - h2("div", { className: "IroWheelBorder", style: Object.assign( - {}, - circleStyles, - cssBorderStyles(props) - ) }), - colors.filter(function(color) { - return color !== activeColor; - }).map(function(color) { - return h2(IroHandle, { isActive: false, index: color.index, fill: color.hslString, r: props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[color.index].x, y: handlePositions[color.index].y }); - }), - h2(IroHandle, { isActive: true, index: activeColor.index, fill: activeColor.hslString, r: props.activeHandleRadius || props.handleRadius, url: props.handleSvg, props: props.handleProps, x: handlePositions[activeColor.index].x, y: handlePositions[activeColor.index].y }) - ); - }); - } - function createWidget(WidgetComponent) { - var widgetFactory = function(parent, props) { - var widget; - var widgetRoot = document.createElement("div"); - I2(h2(WidgetComponent, Object.assign( - {}, - { ref: function(ref) { - return widget = ref; - } }, - props - )), widgetRoot); - function mountWidget() { - var container = parent instanceof Element ? parent : document.querySelector(parent); - container.appendChild(widget.base); - widget.onMount(container); + ); +} +var api = init(defaultConverter, { path: "/" }); + +// ../../components/coco/messaging/system_banner/system_banner.js +var system_banner_default = CocoComponent("systemBanner", (opts = {}) => { + return { + cookieName: null, + cookieValue: null, + cookieExpiry: null, + init() { + this.cookieName = opts.cookieName; + this.cookieValue = opts.cookieValue; + this.cookieExpiry = opts.cookieExpiry; + }, + onDismiss() { + this.$dispatch("banner:dismiss", { banner: this }); + if (this.shouldSetCookie) { + api.set(this.cookieName, this.cookieValue, { + expires: this.cookieExpiry + }); } - if (document.readyState !== "loading") { - mountWidget(); - } else { - document.addEventListener("DOMContentLoaded", mountWidget); + }, + remove() { + this.$root.remove(); + }, + get shouldSetCookie() { + return Number.isInteger(this.cookieExpiry); + }, + root: { + "@alert:dismiss": "onDismiss", + "@alert:removed": "remove" + } + }; +}); + +// ../../components/coco/messaging/toast/toast.js +var toast_exports = {}; +__export(toast_exports, { + default: () => toast_default +}); +var toast_default = CocoComponent("toast", () => { + return { + notificationType: "toast", + options: ["show", "dismiss", "showDelay", "dismissDelay", "position"], + root: { + "x-options": "options", + "x-notification": "notificationType", + "x-show": "notification.shown && !notification.dismissed", + "x-transition:enter": "toast-enter", + "x-transition:enter-start": "toast-enter-start", + "x-transition:enter-end": "toast-enter-end", + "x-transition:leave": "toast-leave", + "x-transition:leave-start": "toast-leave-start", + "x-transition:leave-end": "toast-leave-end", + "@mouseover": "notification.clearAutoDismiss", + "@mouseout": "notification.startAutoDismiss", + "@alert:dismiss": "notification.dismiss", + "@toast:show.document": "notification.clearFromQueue" + } + }; +}); + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/messaging/**/*.js +var modules7 = [alert_exports, notice_exports, snackbar_exports, system_banner_exports, toast_exports]; +var __default7 = modules7; + +// ../../components/coco/modals/modal/modal.js +var modal_exports = {}; +__export(modal_exports, { + default: () => modal_default +}); +var modal_default = CocoComponent("modal", () => { + return { + open: false, + frame: null, + modal: null, + options: ["dismissable", "closeOnSubmit"], + init() { + this.modal = this; + this.onFrameSubmitEnd = this.onFrameSubmitEnd.bind(this); + this.frame = this.$el.closest("turbo-frame"); + this.frame.addEventListener("turbo:submit-end", this.onFrameSubmitEnd); + this.$nextTick(() => this.show()); + }, + show() { + this.open = true; + (0, import_tippy.hideAll)(); + setTimeout(() => { + this.$dispatch("modal:shown"); + }, 400); + }, + hide() { + this.open = false; + setTimeout(() => { + this.clearFrame(); + this.$dispatch("modal:hidden"); + }, 200); + }, + dismiss(event) { + if (this.$options.dismissable) + this.hide(); + }, + visit(url) { + navigateTo(url, { frame: this.frame.id, turbo: true }); + }, + scrollTo(pos) { + setTimeout(() => { + this.$root.scrollTop = pos + this.contentOffsetTop; + }, 10); + }, + clearFrame() { + this.frame.removeAttribute("src"); + this.frame.removeAttribute("complete"); + this.frame.innerHTML = ""; + }, + onFrameSubmitEnd(event) { + if (this.$options.closeOnSubmit && event.detail.success) { + this.hide(); } - return widget; - }; - widgetFactory.prototype = WidgetComponent.prototype; - Object.assign(widgetFactory, WidgetComponent); - widgetFactory.__component = WidgetComponent; - return widgetFactory; - } - var IroColorPicker = /* @__PURE__ */ function(Component) { - function IroColorPicker2(props) { - var this$1 = this; - Component.call(this, props); - this.colors = []; - this.inputActive = false; - this.events = {}; - this.activeEvents = {}; - this.deferredEvents = {}; - this.id = props.id; - var colors = props.colors.length > 0 ? props.colors : [props.color]; - colors.forEach(function(colorValue) { - return this$1.addColor(colorValue); - }); - this.setActiveColor(0); - this.state = Object.assign( - {}, - props, - { - color: this.color, - colors: this.colors, - layout: props.layout - } + }, + destroy() { + this.frame.removeEventListener("turbo:submit-end", this.onFrameSubmitEnd); + }, + get contentOffsetTop() { + return parseInt( + window.getComputedStyle(this.$refs.container).paddingTop, + 10 ); + }, + root: { + "x-options": "options", + "x-show": "open", + "@keydown.escape.document": "dismiss", + "@modal:hide.document": "hide" + }, + overlay: { + "x-show": "open", + "x-transition:enter": "overlay-enter", + "x-transition:enter-start": "overlay-enter-start", + "x-transition:enter-end": "overlay-enter-end", + "x-transition:leave": "overlay-leave", + "x-transition:leave-start": "overlay-leave-start", + "x-transition:leave-end": "overlay-leave-end" + }, + container: { + "x-show": "open", + "x-transition:enter": "container-enter", + "x-transition:enter-start": "container-enter-start", + "x-transition:enter-end": "container-enter-end", + "x-transition:leave": "container-leave", + "x-transition:leave-start": "container-leave-start", + "x-transition:leave-end": "container-leave-end" } - if (Component) - IroColorPicker2.__proto__ = Component; - IroColorPicker2.prototype = Object.create(Component && Component.prototype); - IroColorPicker2.prototype.constructor = IroColorPicker2; - IroColorPicker2.prototype.addColor = function addColor(color, index) { - if (index === void 0) - index = this.colors.length; - var newColor = new IroColor(color, this.onColorChange.bind(this)); - this.colors.splice(index, 0, newColor); - this.colors.forEach(function(color2, index2) { - return color2.index = index2; - }); - if (this.state) { - this.setState({ colors: this.colors }); + }; +}); + +// ../../components/coco/modals/modal_dialog/modal_dialog.js +var modal_dialog_exports = {}; +__export(modal_dialog_exports, { + default: () => modal_dialog_default +}); +var modal_dialog_default = CocoComponent("modalDialog", () => { + return { + frame: null, + init() { + this.onFrameLoad = this.onFrameLoad.bind(this); + this.frame = this.$el.closest("turbo-frame"); + if (this.frame) { + this.frame.addEventListener("turbo:frame-load", this.onFrameLoad); } - this.deferredEmit("color:init", newColor); - }; - IroColorPicker2.prototype.removeColor = function removeColor(index) { - var color = this.colors.splice(index, 1)[0]; - color.unbind(); - this.colors.forEach(function(color2, index2) { - return color2.index = index2; - }); - if (this.state) { - this.setState({ colors: this.colors }); + }, + close() { + this.modal.hide(); + }, + onFrameLoad() { + this.$focus.focus(this.firstInput); + }, + destroy() { + if (this.frame) { + this.frame.removeEventListener("turbo:frame-load", this.onFrameLoad); } - if (color.index === this.color.index) { - this.setActiveColor(0); + }, + get firstInput() { + return this.$root.querySelector( + "input:not([type=hidden]), textarea, select" + ); + } + }; +}); + +// ../../components/coco/modals/modal_lightbox/modal_lightbox.js +var modal_lightbox_exports = {}; +__export(modal_lightbox_exports, { + default: () => modal_lightbox_default +}); +var modal_lightbox_default = CocoComponent("modalLightbox", () => { + return { + loaded: false, + init() { + if (this.img.complete && this.img.naturalHeight !== 0) { + this.imageLoaded(); } - this.emit("color:remove", color); - }; - IroColorPicker2.prototype.setActiveColor = function setActiveColor(index) { - this.color = this.colors[index]; - if (this.state) { - this.setState({ color: this.color }); - } - this.emit("color:setActive", this.color); - }; - IroColorPicker2.prototype.setColors = function setColors(newColorValues, activeColorIndex) { - var this$1 = this; - if (activeColorIndex === void 0) - activeColorIndex = 0; - this.colors.forEach(function(color) { - return color.unbind(); - }); - this.colors = []; - newColorValues.forEach(function(colorValue) { - return this$1.addColor(colorValue); - }); - this.setActiveColor(activeColorIndex); - this.emit("color:setAll", this.colors); - }; - IroColorPicker2.prototype.on = function on2(eventList, callback) { - var this$1 = this; - var events = this.events; - (!Array.isArray(eventList) ? [eventList] : eventList).forEach(function(eventType) { - (events[eventType] || (events[eventType] = [])).push(callback); - if (this$1.deferredEvents[eventType]) { - this$1.deferredEvents[eventType].forEach(function(args) { - callback.apply(null, args); - }); - this$1.deferredEvents[eventType] = []; + }, + close() { + this.modal.hide(); + }, + imageLoaded() { + this.loaded = true; + setTimeout(() => { + const scrollTop = parseInt(this.img.dataset.scrollTop, 10); + if (!isNaN(scrollTop) && scrollTop !== 0) { + this.modal.scrollTo(scrollTop); } - }); - }; - IroColorPicker2.prototype.off = function off(eventList, callback) { - var this$1 = this; - (!Array.isArray(eventList) ? [eventList] : eventList).forEach(function(eventType) { - var callbackList = this$1.events[eventType]; - if (callbackList) { - callbackList.splice(callbackList.indexOf(callback), 1); + }, 200); + }, + get img() { + return this.$refs.media.querySelector("img"); + }, + root: { + ":class": "{loaded}" + } + }; +}); + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/modals/**/*.js +var modules8 = [modal_exports, modal_dialog_exports, modal_lightbox_exports]; +var __default8 = modules8; + +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/navigation/**/*.js +var modules9 = []; +var __default9 = modules9; + +// ../../components/coco/pickers/color_picker/color_picker.js +var color_picker_exports = {}; +__export(color_picker_exports, { + default: () => color_picker_default +}); +var import_iro = __toESM(require_iro()); +var color_picker_default = CocoComponent("colorPicker", ({ selected }) => { + return { + selectedColor: selected, + display: selected, + updating: false, + invalid: false, + colorWheel: { + show: false, + instance: null, + interacting: false + }, + getColorWheelToggle() { + return getComponent(this.$refs.display.querySelector(".coco-button")); + }, + init() { + this.initColorWheel(); + this.$watch("display", (value) => { + if (!this.updating) { + if (isValidHex(value)) { + this.invalid = false; + this.selectedColor = formatHex(value); + } else { + this.invalid = true; + } } }); - }; - IroColorPicker2.prototype.emit = function emit(eventType) { - var this$1 = this; - var args = [], len = arguments.length - 1; - while (len-- > 0) - args[len] = arguments[len + 1]; - var activeEvents = this.activeEvents; - var isEventActive = activeEvents.hasOwnProperty(eventType) ? activeEvents[eventType] : false; - if (!isEventActive) { - activeEvents[eventType] = true; - var callbackList = this.events[eventType] || []; - callbackList.forEach(function(fn3) { - return fn3.apply(this$1, args); + this.$watch("selectedColor", (value) => { + const hex = formatHex(value); + this.updating = true; + this.display = hex; + if (this.colorWheel.instance) { + this.colorWheel.instance.color.hexString = hex; + } + this.$dispatch("color-picker:select", { + selectedColor: this.selectedColor }); - activeEvents[eventType] = false; - } - }; - IroColorPicker2.prototype.deferredEmit = function deferredEmit(eventType) { - var ref; - var args = [], len = arguments.length - 1; - while (len-- > 0) - args[len] = arguments[len + 1]; - var deferredEvents = this.deferredEvents; - (ref = this).emit.apply(ref, [eventType].concat(args)); - (deferredEvents[eventType] || (deferredEvents[eventType] = [])).push(args); - }; - IroColorPicker2.prototype.setOptions = function setOptions(newOptions) { - this.setState(newOptions); - }; - IroColorPicker2.prototype.resize = function resize(width) { - this.setOptions({ width }); - }; - IroColorPicker2.prototype.reset = function reset() { - this.colors.forEach(function(color) { - return color.reset(); + this.$nextTick(() => this.updating = false); }); - this.setState({ colors: this.colors }); - }; - IroColorPicker2.prototype.onMount = function onMount2(container) { - this.el = container; - this.deferredEmit("mount", this); - }; - IroColorPicker2.prototype.onColorChange = function onColorChange(color, changes) { - this.setState({ color: this.color }); - if (this.inputActive) { - this.inputActive = false; - this.emit("input:change", color, changes); - } - this.emit("color:change", color, changes); - }; - IroColorPicker2.prototype.emitInputEvent = function emitInputEvent(type, originId) { - if (type === 0) { - this.emit("input:start", this.color, originId); - } else if (type === 1) { - this.emit("input:move", this.color, originId); - } else if (type === 2) { - this.emit("input:end", this.color, originId); - } - }; - IroColorPicker2.prototype.render = function render2(props, state) { - var this$1 = this; - var layout = state.layout; - if (!Array.isArray(layout)) { - switch (layout) { - default: - layout = [ - { component: IroWheel }, - { component: IroSlider } - ]; + }, + setSelectedColor(color) { + this.selectedColor = color; + this.invalid = false; + }, + toggleAdvancedView() { + this.colorWheel.show = !this.colorWheel.show; + }, + initColorWheel() { + this.cleanupColorWheel(); + const colorWheel = new import_iro.default.ColorPicker(this.$refs.colorWheel, { + width: this.$refs.swatches.clientWidth, + color: this.selectedColor + }); + colorWheel.on("input:end", (color) => { + if (!this.updating) { + this.selectedColor = color.hexString; + this.invalid = false; } - if (state.transparency) { - layout.push({ - component: IroSlider, - options: { - sliderType: "alpha" - } - }); - } + }); + this.colorWheel.instance = colorWheel; + }, + onResize() { + if (this.colorWheel.instance) { + this.colorWheel.instance.resize(this.$refs.swatches.clientWidth); } - return h2("div", { class: "IroColorPicker", id: state.id, style: { - display: state.display - } }, layout.map(function(ref, componentIndex) { - var UiComponent = ref.component; - var options = ref.options; - return h2(UiComponent, Object.assign({}, state, options, { ref: void 0, onInput: this$1.emitInputEvent.bind(this$1), parent: this$1, index: componentIndex })); - })); - }; - return IroColorPicker2; - }(m2); - IroColorPicker.defaultProps = Object.assign( - {}, - iroColorPickerOptionDefaults, - { - colors: [], - display: "block", - id: null, - layout: "default", - margin: null + }, + toggleColorWheel() { + this.colorWheel.show = !this.colorWheel.show; + }, + cleanupColorWheel() { + this.colorWheel.instance = null; + this.$refs.colorWheel.innerHTML = ""; + }, + destroy() { + this.getColorWheelToggle().resetState(); + this.cleanupColorWheel(); } - ); - var IroColorPickerWidget = createWidget(IroColorPicker); - var iro; - (function(iro2) { - iro2.version = "5.5.2"; - iro2.Color = IroColor; - iro2.ColorPicker = IroColorPickerWidget; - var ui; - (function(ui2) { - ui2.h = h2; - ui2.ComponentBase = IroComponentWrapper; - ui2.Handle = IroHandle; - ui2.Slider = IroSlider; - ui2.Wheel = IroWheel; - ui2.Box = IroBox; - })(ui = iro2.ui || (iro2.ui = {})); - })(iro || (iro = {})); - var iro$1 = iro; - var iro_es_default = iro$1; + }; +}); - // helpers/color.js - function isValidHex(color) { - if (!color || typeof color !== "string") - return false; - if (color.substring(0, 1) === "#") - color = color.substring(1); - switch (color.length) { - case 3: - return /^[0-9A-F]{3}$/i.test(color); - case 6: - return /^[0-9A-F]{6}$/i.test(color); - case 8: - return /^[0-9A-F]{8}$/i.test(color); - default: - return false; +// ../../components/coco/pickers/image_picker/image_picker.js +var image_picker_exports = {}; +__export(image_picker_exports, { + default: () => image_picker_default +}); +var image_picker_default = CocoComponent("imagePicker", ({ src }) => { + return { + image: { + name: basename(src), + file: null, + data: src + }, + get name() { + return this.image.name; + }, + get src() { + return this.image.data; + }, + get hasImage() { + return !!this.src; + }, + get uploader() { + return getComponent(this.$refs.uploader.firstElementChild); + }, + setImage(file, silent = false) { + this.image = { + file: file.file, + name: file.name, + data: file.data + }; + this.uploader.setFile(file); + if (silent === false) { + this.$dispatch("image-picker:select", { image: this.image }); + } + }, + clearImage(silent = false) { + this.uploader.clear(); + this.image = { name: null, data: null, file: null }; + if (silent === false) { + this.$dispatch("image-picker:clear"); + } + }, + browseFiles() { + this.uploader.openPicker(); + }, + replaceImage() { + this.uploader.openPicker(); } - } - function formatHex(str) { - return `#${str.toUpperCase().replace("#", "")}`; - } + }; +}); - // ../../components/coco/pickers/color_picker/color_picker.js - var color_picker_default = CocoComponent("colorPicker", ({ selected }) => { - return { - selectedColor: selected, - display: selected, - updating: false, - invalid: false, - colorWheel: { - show: false, - instance: null, - interacting: false - }, - getColorWheelToggle() { - return getComponent(this.$refs.display.querySelector(".coco-button")); - }, - init() { - this.initColorWheel(); - this.$watch("display", (value) => { - if (!this.updating) { - if (isValidHex(value)) { - this.invalid = false; - this.selectedColor = formatHex(value); - } else { - this.invalid = true; - } - } - }); - this.$watch("selectedColor", (value) => { - const hex = formatHex(value); - this.updating = true; - this.display = hex; - if (this.colorWheel.instance) { - this.colorWheel.instance.color.hexString = hex; - } - this.$dispatch("color-picker:select", { - selectedColor: this.selectedColor - }); - this.$nextTick(() => this.updating = false); - }); - }, - setSelectedColor(color) { - this.selectedColor = color; - this.invalid = false; - }, - toggleAdvancedView() { - this.colorWheel.show = !this.colorWheel.show; - }, - initColorWheel() { - this.cleanupColorWheel(); - const colorWheel = new iro_es_default.ColorPicker(this.$refs.colorWheel, { - width: this.$refs.swatches.clientWidth, - color: this.selectedColor - }); - colorWheel.on("input:end", (color) => { - if (!this.updating) { - this.selectedColor = color.hexString; - this.invalid = false; - } - }); - this.colorWheel.instance = colorWheel; - }, - onResize() { - if (this.colorWheel.instance) { - this.colorWheel.instance.resize(this.$refs.swatches.clientWidth); - } - }, - toggleColorWheel() { - this.colorWheel.show = !this.colorWheel.show; - }, - cleanupColorWheel() { - this.colorWheel.instance = null; - this.$refs.colorWheel.innerHTML = ""; - }, - destroy() { - this.getColorWheelToggle().resetState(); - this.cleanupColorWheel(); - } - }; - }); +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/pickers/**/*.js +var modules10 = [color_picker_exports, image_picker_exports]; +var __default10 = modules10; - // ../../components/coco/pickers/image_picker/image_picker.js - var image_picker_exports = {}; - __export(image_picker_exports, { - default: () => image_picker_default - }); - var image_picker_default = CocoComponent("imagePicker", ({ src }) => { - return { - image: { - name: basename(src), - file: null, - data: src - }, - get name() { - return this.image.name; - }, - get src() { - return this.image.data; - }, - get hasImage() { - return !!this.src; - }, - get uploader() { - return getComponent(this.$refs.uploader.firstElementChild); - }, - setImage(file, silent = false) { - this.image = { - file: file.file, - name: file.name, - data: file.data - }; - this.uploader.setFile(file); - if (silent === false) { - this.$dispatch("image-picker:select", { image: this.image }); - } - }, - clearImage(silent = false) { - this.uploader.clear(); - this.image = { name: null, data: null, file: null }; - if (silent === false) { - this.$dispatch("image-picker:clear"); - } - }, - browseFiles() { - this.uploader.openPicker(); - }, - replaceImage() { - this.uploader.openPicker(); - } - }; - }); +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/typography/**/*.js +var modules11 = []; +var __default11 = modules11; - // ../../components/coco/utilities/dropdown/dropdown.js - var dropdown_exports = {}; - __export(dropdown_exports, { - default: () => dropdown_default2 - }); - var dropdown_default2 = CocoComponent("dropdown", () => { - return {}; - }); +// ../../components/coco/utilities/dropdown/dropdown.js +var dropdown_exports = {}; +__export(dropdown_exports, { + default: () => dropdown_default2 +}); +var dropdown_default2 = CocoComponent("dropdown", () => { + return {}; +}); - // ../../components/coco/utilities/poll_controller/poll_controller.js - var poll_controller_exports = {}; - __export(poll_controller_exports, { - default: () => poll_controller_default - }); - var poll_controller_default = CocoComponent("pollController", () => { - return { - polling: false, - frame: null, - pollTimer: null, - get interval() { - return parseInt(this.$root.dataset.interval || 0, 10); - }, - init() { - this.frame = document.getElementById("polling-controller-frame"); - this.observer = new MutationObserver(() => this.onUpdate()); - this.observer.observe(this.$el, { attributes: true }); - }, - startPolling() { - if (this.interval > 0 && !this.polling) { - this.polling = true; - this.queuePollRequest(500); - } - }, - onUpdate() { - this.$nextTick(() => { - this.$dispatch("dom-updates:complete", { html: document }); - }); - this.queuePollRequest(); - }, - queuePollRequest(wait) { - if (this.pollTimer) - clearTimeout(this.pollTimer); - if (this.interval > 0 && this.polling) { - this.pollTimer = setTimeout( - () => this.reloadFrame(), - wait || this.interval - ); - } - }, - reloadFrame() { - this.frame.addEventListener( - "turbo:before-fetch-request", - addStreamHeaders, - { once: true } +// ../../components/coco/utilities/poll_controller/poll_controller.js +var poll_controller_exports = {}; +__export(poll_controller_exports, { + default: () => poll_controller_default +}); +var poll_controller_default = CocoComponent("pollController", () => { + return { + polling: false, + frame: null, + pollTimer: null, + get interval() { + return parseInt(this.$root.dataset.interval || 0, 10); + }, + init() { + this.frame = document.getElementById("polling-controller-frame"); + this.observer = new MutationObserver(() => this.onUpdate()); + this.observer.observe(this.$el, { attributes: true }); + }, + startPolling() { + if (this.interval > 0 && !this.polling) { + this.polling = true; + this.queuePollRequest(500); + } + }, + onUpdate() { + this.$nextTick(() => { + this.$dispatch("dom-updates:complete", { html: document }); + }); + this.queuePollRequest(); + }, + queuePollRequest(wait) { + if (this.pollTimer) + clearTimeout(this.pollTimer); + if (this.interval > 0 && this.polling) { + this.pollTimer = setTimeout( + () => this.reloadFrame(), + wait || this.interval ); - window.Turbo.visit(location.href, { - frame: this.frame.id, - action: "replace" - }); - }, - destroy() { - this.observer.disconnect(); - this.polling = false; } - }; - }); - function addStreamHeaders(event) { - const { headers } = event.detail.fetchOptions || {}; - if (headers) { - headers.Accept = ["text/vnd.turbo-stream.html", headers.Accept].join(", "); + }, + reloadFrame() { + this.frame.addEventListener( + "turbo:before-fetch-request", + addStreamHeaders, + { once: true } + ); + window.Turbo.visit(location.href, { + frame: this.frame.id, + action: "replace" + }); + }, + destroy() { + this.observer.disconnect(); + this.polling = false; } + }; +}); +function addStreamHeaders(event) { + const { headers } = event.detail.fetchOptions || {}; + if (headers) { + headers.Accept = ["text/vnd.turbo-stream.html", headers.Accept].join(", "); } +} - // ../../components/coco/utilities/seamless_textarea/seamless_textarea.js - var seamless_textarea_exports = {}; - __export(seamless_textarea_exports, { - default: () => seamless_textarea_default - }); - var seamless_textarea_default = CocoComponent("seamlessTextarea", () => { - return { - height: null, - observer: null, - value: null, - options: ["multiline", "focus"], - init() { - this.value = this.$refs.textarea.value; - this.$nextTick(() => { - this.onResize(); - if (this.$options.focus) { - this.$refs.textarea.focus(); - this.$refs.textarea.selectionStart = this.$refs.textarea.value.length; - } - }); - }, - onResize() { - const textarea = this.$refs.textarea; - if (textarea) { - textarea.style.height = "4px"; - const newHeight = textarea.scrollHeight; - textarea.style.height = `${newHeight}px`; - if (this.height !== newHeight) { - this.height = newHeight; - } +// ../../components/coco/utilities/seamless_textarea/seamless_textarea.js +var seamless_textarea_exports = {}; +__export(seamless_textarea_exports, { + default: () => seamless_textarea_default +}); +var seamless_textarea_default = CocoComponent("seamlessTextarea", () => { + return { + height: null, + observer: null, + value: null, + options: ["multiline", "focus"], + init() { + this.value = this.$refs.textarea.value; + this.$nextTick(() => { + this.onResize(); + if (this.$options.focus) { + this.$refs.textarea.focus(); + this.$refs.textarea.selectionStart = this.$refs.textarea.value.length; } + }); + }, + onResize() { + const textarea = this.$refs.textarea; + if (textarea) { + textarea.style.height = "4px"; + const newHeight = textarea.scrollHeight; + textarea.style.height = `${newHeight}px`; + if (this.height !== newHeight) { + this.height = newHeight; + } } - }; - }); + } + }; +}); - // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js|@components/!(app)/**/*.js - var modules = [button_exports, button_dropdown_exports, button_group_exports, color_picker_button_exports, confirm_panel_exports, image_picker_button_exports, layout_picker_button_exports, menu_button_exports, toolbar_exports, icon_exports, image_uploader_exports, page_exports, alert_exports, notice_exports, snackbar_exports, system_banner_exports, toast_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, color_picker_exports, image_picker_exports, dropdown_exports, poll_controller_exports, seamless_textarea_exports]; - var __default = modules; +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@components/utilities/**/*.js +var modules12 = [dropdown_exports, poll_controller_exports, seamless_textarea_exports]; +var __default12 = modules12; - // book.js - registerComponents(__default); - alpine_default2.start(); -})(); -/*! Bundled license information: +// base/components.js +var components_default = [ + ...__default, + ...__default2, + ...__default3, + ...__default4, + ...__default5, + ...__default6, + ...__default7, + ...__default8, + ...__default9, + ...__default10, + ...__default11, + ...__default12 +]; -lodash/lodash.js: - (** - * @license - * Lodash <https://lodash.com/> - * Copyright OpenJS Foundation and other contributors <https://openjsf.org/> - * Released under MIT license <https://lodash.com/license> - * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - *) +// import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js|@bookComponents/**/*.js +var modules13 = []; +var __default13 = modules13; -@alpinejs/focus/dist/module.esm.js: +// book.js +coco_default.registerComponents(components_default); +coco_default.registerComponents(__default13); +var book_default = coco_default; +export { + book_default as default +}; +/*! Bundled license information: + +@alpinejs/focus/dist/module.cjs.js: (*! Bundled license information: - tabbable/dist/index.esm.js: + tabbable/dist/index.js: (*! * tabbable 5.3.3 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE *) - focus-trap/dist/focus-trap.esm.js: + focus-trap/dist/focus-trap.js: (*! * focus-trap 6.9.4 * @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE *) *) -js-cookie/dist/js.cookie.mjs: - (*! js-cookie v3.0.5 | MIT *) - -@jaames/iro/dist/iro.es.js: +@jaames/iro/dist/iro.js: (*! * iro.js v5.5.2 * 2016-2021 James Daniel * Licensed under MPL 2.0 * github.com/jaames/iro.js *) + +js-cookie/dist/js.cookie.mjs: + (*! js-cookie v3.0.5 | MIT *) */