app/assets/build/coco/book.js in coveragebook_components-0.12.2 vs app/assets/build/coco/book.js in coveragebook_components-0.13.0

- old
+ new

@@ -8,22 +8,22 @@ 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 = (a2, b2) => { - for (var prop in b2 || (b2 = {})) - if (__hasOwnProp.call(b2, prop)) - __defNormalProp(a2, prop, b2[prop]); + 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(b2)) { - if (__propIsEnum.call(b2, prop)) - __defNormalProp(a2, prop, b2[prop]); + for (var prop of __getOwnPropSymbols(b3)) { + if (__propIsEnum.call(b3, prop)) + __defNormalProp(a3, prop, b3[prop]); } - return a2; + return a3; }; - var __spreadProps = (a2, b2) => __defProps(a2, __getOwnPropDescs(b2)); + 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]; @@ -32,12 +32,12 @@ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) target[prop] = source[prop]; } return target; }; - var __commonJS = (cb, mod) => function __require() { - return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; + 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 }); }; @@ -47,17 +47,17 @@ 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( + 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 || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, - mod + isNodeMode || !mod3 || !mod3.__esModule ? __defProp(target, "default", { value: mod3, enumerable: true }) : target, + mod3 )); // ../../../node_modules/lodash/lodash.js var require_lodash = __commonJS({ "../../../node_modules/lodash/lodash.js"(exports, module) { @@ -397,11 +397,11 @@ var types = freeModule && freeModule.require && freeModule.require("util").types; if (types) { return types; } return freeProcess && freeProcess.binding && freeProcess.binding("util"); - } catch (e2) { + } 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) { @@ -594,13 +594,13 @@ result = result === undefined2 ? current : result + current; } } return result; } - function baseTimes(n2, iteratee) { - var index = -1, result = Array(n2); - while (++index < n2) { + function baseTimes(n3, iteratee) { + var index = -1, result = Array(n3); + while (++index < n3) { result[index] = iteratee(index); } return result; } function baseToPairs(object, props) { @@ -746,12 +746,12 @@ } function unicodeWords(string) { return string.match(reUnicodeWord) || []; } var runInContext = function runInContext2(context) { - context = context == null ? root : _2.defaults(root.Object(), context, _2.pick(root, contextProps)); - var Array2 = context.Array, Date = context.Date, Error2 = context.Error, Function2 = context.Function, Math2 = context.Math, Object2 = context.Object, RegExp2 = context.RegExp, String2 = context.String, TypeError2 = context.TypeError; + 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; @@ -769,15 +769,15 @@ var defineProperty = function() { try { var func = getNative(Object2, "defineProperty"); func({}, "", {}); return func; - } catch (e2) { + } catch (e3) { } }(); - var ctxClearTimeout = context.clearTimeout !== root.clearTimeout && context.clearTimeout, ctxNow = Date && Date.now !== root.Date.now && Date.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 = Date.now, nativeParseInt = context.parseInt, nativeRandom = Math2.random, nativeReverse = arrayProto.reverse; + 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; @@ -1120,12 +1120,12 @@ } function arraySample(array) { var length = array.length; return length ? array[baseRandom(0, length - 1)] : undefined2; } - function arraySampleSize(array, n2) { - return shuffleSelf(copyArray(array), baseClamp(n2, 0, array.length)); + 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) { @@ -1682,17 +1682,17 @@ mergeFunc(newValue, srcValue, srcIndex, customizer, stack); stack["delete"](srcValue); } assignMergeValue(object, key, newValue); } - function baseNth(array, n2) { + function baseNth(array, n3) { var length = array.length; if (!length) { return; } - n2 += n2 < 0 ? length : 0; - return isIndex(n2, length) ? array[n2] : undefined2; + n3 += n3 < 0 ? length : 0; + return isIndex(n3, length) ? array[n3] : undefined2; } function baseOrderBy(collection, iteratees, orders) { if (iteratees.length) { iteratees = arrayMap(iteratees, function(iteratee2) { if (isArray2(iteratee2)) { @@ -1780,35 +1780,35 @@ result2[fromRight ? length : ++index] = start3; start3 += step; } return result2; } - function baseRepeat(string, n2) { + function baseRepeat(string, n3) { var result2 = ""; - if (!string || n2 < 1 || n2 > MAX_SAFE_INTEGER) { + if (!string || n3 < 1 || n3 > MAX_SAFE_INTEGER) { return result2; } do { - if (n2 % 2) { + if (n3 % 2) { result2 += string; } - n2 = nativeFloor(n2 / 2); - if (n2) { + n3 = nativeFloor(n3 / 2); + if (n3) { string += string; } - } while (n2); + } 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, n2) { + function baseSampleSize(collection, n3) { var array = values(collection); - return shuffleSelf(array, baseClamp(n2, 0, array.length)); + return shuffleSelf(array, baseClamp(n3, 0, array.length)); } function baseSet(object, path, value, customizer) { if (!isObject3(object)) { return object; } @@ -2801,11 +2801,11 @@ function getRawTag(value) { var isOwn = hasOwnProperty3.call(value, symToStringTag), tag = value[symToStringTag]; try { value[symToStringTag] = undefined2; var unmasked = true; - } catch (e2) { + } catch (e3) { } var result2 = nativeObjectToString.call(value); if (unmasked) { if (isOwn) { value[symToStringTag] = tag; @@ -3158,15 +3158,15 @@ } function toSource(func) { if (func != null) { try { return funcToString.call(func); - } catch (e2) { + } catch (e3) { } try { return func + ""; - } catch (e2) { + } catch (e3) { } } return ""; } function updateWrapDetails(details, bitmask) { @@ -3240,26 +3240,26 @@ if (isArrayLikeObject(comparator)) { comparator = undefined2; } return isArrayLikeObject(array) ? baseDifference(array, baseFlatten(values2, 1, isArrayLikeObject, true), undefined2, comparator) : []; }); - function drop(array, n2, guard) { + function drop(array, n3, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } - n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); - return baseSlice(array, n2 < 0 ? 0 : n2, length); + n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); + return baseSlice(array, n3 < 0 ? 0 : n3, length); } - function dropRight(array, n2, guard) { + function dropRight(array, n3, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } - n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); - n2 = length - n2; - return baseSlice(array, 0, n2 < 0 ? 0 : n2); + n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); + n3 = length - n3; + return baseSlice(array, 0, n3 < 0 ? 0 : n3); } function dropRightWhile(array, predicate) { return array && array.length ? baseWhile(array, getIteratee(predicate, 3), true, true) : []; } function dropWhile(array, predicate) { @@ -3379,12 +3379,12 @@ 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, n2) { - return array && array.length ? baseNth(array, toInteger(n2)) : undefined2; + 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; } @@ -3475,25 +3475,25 @@ } function tail(array) { var length = array == null ? 0 : array.length; return length ? baseSlice(array, 1, length) : []; } - function take(array, n2, guard) { + function take(array, n3, guard) { if (!(array && array.length)) { return []; } - n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); - return baseSlice(array, 0, n2 < 0 ? 0 : n2); + n3 = guard || n3 === undefined2 ? 1 : toInteger(n3); + return baseSlice(array, 0, n3 < 0 ? 0 : n3); } - function takeRight(array, n2, guard) { + function takeRight(array, n3, guard) { var length = array == null ? 0 : array.length; if (!length) { return []; } - n2 = guard || n2 === undefined2 ? 1 : toInteger(n2); - n2 = length - n2; - return baseSlice(array, n2 < 0 ? 0 : n2, length); + 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) { @@ -3766,18 +3766,18 @@ } function sample(collection) { var func = isArray2(collection) ? arraySample : baseSample; return func(collection); } - function sampleSize(collection, n2, guard) { - if (guard ? isIterateeCall(collection, n2, guard) : n2 === undefined2) { - n2 = 1; + function sampleSize(collection, n3, guard) { + if (guard ? isIterateeCall(collection, n3, guard) : n3 === undefined2) { + n3 = 1; } else { - n2 = toInteger(n2); + n3 = toInteger(n3); } var func = isArray2(collection) ? arraySampleSize : baseSampleSize; - return func(collection, n2); + return func(collection, n3); } function shuffle(collection) { var func = isArray2(collection) ? arrayShuffle : baseShuffle; return func(collection); } @@ -3814,37 +3814,37 @@ return baseOrderBy(collection, baseFlatten(iteratees, 1), []); }); var now = ctxNow || function() { return root.Date.now(); }; - function after(n2, func) { + function after(n3, func) { if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } - n2 = toInteger(n2); + n3 = toInteger(n3); return function() { - if (--n2 < 1) { + if (--n3 < 1) { return func.apply(this, arguments); } }; } - function ary(func, n2, guard) { - n2 = guard ? undefined2 : n2; - n2 = func && n2 == null ? func.length : n2; - return createWrap(func, WRAP_ARY_FLAG, undefined2, undefined2, undefined2, undefined2, n2); + 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(n2, func) { + function before(n3, func) { var result2; if (typeof func != "function") { throw new TypeError2(FUNC_ERROR_TEXT); } - n2 = toInteger(n2); + n3 = toInteger(n3); return function() { - if (--n2 > 0) { + if (--n3 > 0) { result2 = func.apply(this, arguments); } - if (n2 <= 1) { + if (n3 <= 1) { func = undefined2; } return result2; }; } @@ -4297,11 +4297,11 @@ return value ? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER) : value === 0 ? value : 0; } function toString(value) { return value == null ? "" : baseToString(value); } - var assign = createAssigner(function(object, source) { + var assign2 = createAssigner(function(object, source) { if (isPrototype(source) || isArrayLike(source)) { copyObject(source, keys(source), object); return; } for (var key in source) { @@ -4527,11 +4527,11 @@ return object == null ? [] : baseValues(object, keys(object)); } function valuesIn(object) { return object == null ? [] : baseValues(object, keysIn(object)); } - function clamp(number, lower, upper) { + function clamp2(number, lower, upper) { if (upper === undefined2) { upper = lower; lower = undefined2; } if (upper !== undefined2) { @@ -4609,11 +4609,11 @@ position = position === undefined2 ? length : baseClamp(toInteger(position), 0, length); var end2 = position; position -= target.length; return position >= 0 && string.slice(position, end2) == target; } - function escape(string) { + function escape2(string) { string = toString(string); return string && reHasUnescapedHtml.test(string) ? string.replace(reUnescapedHtml, escapeHtmlChar) : string; } function escapeRegExp(string) { string = toString(string); @@ -4654,17 +4654,17 @@ } else if (radix) { radix = +radix; } return nativeParseInt(toString(string).replace(reTrimStart, ""), radix || 0); } - function repeat(string, n2, guard) { - if (guard ? isIterateeCall(string, n2, guard) : n2 === undefined2) { - n2 = 1; + function repeat(string, n3, guard) { + if (guard ? isIterateeCall(string, n3, guard) : n3 === undefined2) { + n3 = 1; } else { - n2 = toInteger(n2); + n3 = toInteger(n3); } - return baseRepeat(toString(string), n2); + 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]); } @@ -4849,12 +4849,12 @@ return string.match(pattern) || []; } var attempt = baseRest(function(func, args) { try { return apply(func, undefined2, args); - } catch (e2) { - return isError(e2) ? e2 : new Error2(e2); + } catch (e3) { + return isError(e3) ? e3 : new Error2(e3); } }); var bindAll = flatRest(function(object, methodNames) { arrayEach(methodNames, function(key) { key = toKey(key); @@ -4948,14 +4948,14 @@ } return this; } function noop() { } - function nthArg(n2) { - n2 = toInteger(n2); + function nthArg(n3) { + n3 = toInteger(n3); return baseRest(function(args) { - return baseNth(args, n2); + return baseNth(args, n3); }); } var over = createOver(arrayMap); var overEvery = createOver(arrayEvery); var overSome = createOver(arraySome); @@ -4982,20 +4982,20 @@ return ""; } function stubTrue() { return true; } - function times(n2, iteratee2) { - n2 = toInteger(n2); - if (n2 < 1 || n2 > MAX_SAFE_INTEGER) { + function times(n3, iteratee2) { + n3 = toInteger(n3); + if (n3 < 1 || n3 > MAX_SAFE_INTEGER) { return []; } - var index = MAX_ARRAY_LENGTH, length = nativeMin(n2, MAX_ARRAY_LENGTH); + var index = MAX_ARRAY_LENGTH, length = nativeMin(n3, MAX_ARRAY_LENGTH); iteratee2 = getIteratee(iteratee2); - n2 -= MAX_ARRAY_LENGTH; + n3 -= MAX_ARRAY_LENGTH; var result2 = baseTimes(length, iteratee2); - while (++index < n2) { + while (++index < n3) { iteratee2(index); } return result2; } function toPath(value) { @@ -5013,11 +5013,11 @@ }, 0); var ceil = createRound("ceil"); var divide = createMathOperation(function(dividend, divisor) { return dividend / divisor; }, 1); - var floor = createRound("floor"); + 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; @@ -5035,11 +5035,11 @@ return array && array.length ? baseExtremum(array, getIteratee(iteratee2, 2), baseLt) : undefined2; } var multiply = createMathOperation(function(multiplier, multiplicand) { return multiplier * multiplicand; }, 1); - var round2 = createRound("round"); + 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; @@ -5047,11 +5047,11 @@ function sumBy(array, iteratee2) { return array && array.length ? baseSum(array, getIteratee(iteratee2, 2)) : 0; } lodash.after = after; lodash.ary = ary; - lodash.assign = assign; + lodash.assign = assign2; lodash.assignIn = assignIn; lodash.assignInWith = assignInWith; lodash.assignWith = assignWith; lodash.at = at2; lodash.before = before; @@ -5204,31 +5204,31 @@ lodash.add = add2; lodash.attempt = attempt; lodash.camelCase = camelCase5; lodash.capitalize = capitalize2; lodash.ceil = ceil; - lodash.clamp = clamp; + 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 = escape; + 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 = floor; + lodash.floor = floor2; lodash.forEach = forEach; lodash.forEachRight = forEachRight; lodash.forIn = forIn; lodash.forInRight = forInRight; lodash.forOwn = forOwn; @@ -5313,11 +5313,11 @@ lodash.reduce = reduce; lodash.reduceRight = reduceRight; lodash.repeat = repeat; lodash.replace = replace; lodash.result = result; - lodash.round = round2; + lodash.round = round3; lodash.runInContext = runInContext2; lodash.sample = sample; lodash.size = size2; lodash.snakeCase = snakeCase; lodash.some = some; @@ -5365,25 +5365,25 @@ 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(n2) { - n2 = n2 === undefined2 ? 1 : nativeMax(toInteger(n2), 0); + 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(n2, result2.__takeCount__); + result2.__takeCount__ = nativeMin(n3, result2.__takeCount__); } else { result2.__views__.push({ - "size": nativeMin(n2, MAX_ARRAY_LENGTH), + "size": nativeMin(n3, MAX_ARRAY_LENGTH), "type": methodName + (result2.__dir__ < 0 ? "Right" : "") }); } return result2; }; - LazyWrapper.prototype[methodName + "Right"] = function(n2) { - return this.reverse()[methodName](n2).reverse(); + 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) { @@ -5520,178 +5520,305 @@ if (symIterator) { lodash.prototype[symIterator] = wrapperToIterator; } return lodash; }; - var _2 = runInContext(); + var _3 = runInContext(); if (typeof define == "function" && typeof define.amd == "object" && define.amd) { - root._ = _2; + root._ = _3; define(function() { - return _2; + return _3; }); } else if (freeModule) { - (freeModule.exports = _2)._ = _2; - freeExports._ = _2; + (freeModule.exports = _3)._ = _3; + freeExports._ = _3; } else { - root._ = _2; + root._ = _3; } }).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); + } + }); + }); + return components; + } + function getComponent(el, throwOnError = false) { + try { + return Alpine.$data(el); + } catch (error2) { + if (throwOnError) { + throw error2; + } else { + return null; + } + } + } + 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.13.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.294.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/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 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]); } - return e2; + return e3; }, e.apply(this, arguments); } - function t(e2, t2) { - const n2 = t2.width, r2 = t2.height, u2 = t2.inlineSize, o2 = t2.blockSize; - switch (e2) { + function t(e3, t3) { + const n3 = t3.width, r3 = t3.height, u3 = t3.inlineSize, o3 = t3.blockSize; + switch (e3) { case 1: - return null != n2 ? { type: 3, value: n2, unit: "px" } : { type: 1 }; + return null != n3 ? { type: 3, value: n3, unit: "px" } : { type: 1 }; case 3: - return null != u2 ? { type: 3, value: u2, unit: "px" } : { type: 1 }; + return null != u3 ? { type: 3, value: u3, unit: "px" } : { type: 1 }; case 2: - return null != r2 ? { type: 3, value: r2, unit: "px" } : { type: 1 }; + return null != r3 ? { type: 3, value: r3, unit: "px" } : { type: 1 }; case 4: - return null != o2 ? { type: 3, value: o2, unit: "px" } : { type: 1 }; + return null != o3 ? { type: 3, value: o3, unit: "px" } : { type: 1 }; case 5: - return null != n2 && null != r2 && r2 > 0 ? { type: 2, value: n2 / r2 } : { type: 1 }; + return null != n3 && null != r3 && r3 > 0 ? { type: 2, value: n3 / r3 } : { type: 1 }; case 6: - return null != n2 && null != r2 ? { type: 4, value: r2 >= n2 ? "portrait" : "landscape" } : { type: 1 }; + return null != n3 && null != r3 ? { type: 4, value: r3 >= n3 ? "portrait" : "landscape" } : { type: 1 }; } } - function n(e2, t2) { - switch (e2.type) { + function n(e3, t3) { + switch (e3.type) { case 1: case 2: case 3: case 4: - return i(e2, t2); + return i(e3, t3); case 5: { - const n2 = t2.sizeFeatures.get(e2.feature); - return null == n2 ? { type: 1 } : n2; + const n3 = t3.sizeFeatures.get(e3.feature); + return null == n3 ? { type: 1 } : n3; } case 6: - return e2.value; + return e3.value; } } - function r(e2) { - return { type: 5, value: e2 }; + function r(e3) { + return { type: 5, value: e3 }; } - function u(e2, t2, n2) { - return r(function(e3, t3, n3) { - switch (n3) { + function u(e3, t3, n3) { + return r(function(e4, t4, n4) { + switch (n4) { case 1: - return e3 === t3; + return e4 === t4; case 2: - return e3 > t3; + return e4 > t4; case 3: - return e3 >= t3; + return e4 >= t4; case 4: - return e3 < t3; + return e4 < t4; case 5: - return e3 <= t3; + return e4 <= t4; } - }(e2, t2, n2)); + }(e3, t3, n3)); } - function o(e2, t2, n2) { - return null == e2 ? t2 : null == t2 ? e2 : n2(e2, t2); + function o(e3, t3, n3) { + return null == e3 ? t3 : null == t3 ? e3 : n3(e3, t3); } - function s(e2, t2) { - switch (e2) { + function s(e3, t3) { + switch (e3) { case "cqw": - return t2.cqw; + return t3.cqw; case "cqh": - return t2.cqh; + return t3.cqh; case "cqi": - return 0 === t2.writingAxis ? t2.cqw : t2.cqh; + return 0 === t3.writingAxis ? t3.cqw : t3.cqh; case "cqb": - return 1 === t2.writingAxis ? t2.cqw : t2.cqh; + return 1 === t3.writingAxis ? t3.cqw : t3.cqh; case "cqmin": - return o(s("cqi", t2), s("cqb", t2), Math.min); + return o(s("cqi", t3), s("cqb", t3), Math.min); case "cqmax": - return o(s("cqi", t2), s("cqb", t2), Math.max); + return o(s("cqi", t3), s("cqb", t3), Math.max); } } - function l(e2, { treeContext: t2 }) { - switch (e2.unit) { + function l(e3, { treeContext: t3 }) { + switch (e3.unit) { case "px": - return e2.value; + return e3.value; case "rem": - return e2.value * t2.rootFontSize; + return e3.value * t3.rootFontSize; case "em": - return e2.value * t2.fontSize; + return e3.value * t3.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 o(e3.value, s(e3.unit, t3), (e4, t4) => e4 * t4); } return null; } - function c(e2, t2) { - switch (e2.type) { + function c(e3, t3) { + switch (e3.type) { case 2: - return 0 === e2.value ? 0 : null; + return 0 === e3.value ? 0 : null; case 3: - return l(e2, t2); + return l(e3, t3); } return null; } - function i(e2, t2) { - switch (e2.type) { + function i(e3, t3) { + switch (e3.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 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 }; - }(e2, t2); + }(e3, t3); 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); + 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(e3, t3) { - const n2 = i(e3.left, t3); - return 5 === n2.type && true === n2.value ? n2 : i(e3.right, t3); - }(e2, t2); + 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 n2 = i(e2.value, t2); - return 5 === n2.type ? { type: 5, value: !n2.value } : { type: 1 }; + const n3 = i(e3.value, t3); + return 5 === n3.type ? { type: 5, value: !n3.value } : { type: 1 }; } case 5: - return a(n(e2, t2)); + return a(n(e3, t3)); case 6: - return a(e2.value); + return a(e3.value); } } - function a(e2) { - switch (e2.type) { + function a(e3) { + switch (e3.type) { case 5: - return e2; + return e3; case 2: case 3: - return { type: 5, value: e2.value > 0 }; + return { type: 5, value: e3.value > 0 }; } return { type: 1 }; } var f = Array.from({ length: 4 }, () => Math.floor(256 * Math.random()).toString(16)).join(""); var p = S("container"); @@ -5701,785 +5828,785 @@ 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}`; + function S(e3) { + return `--cq-${e3}-${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; + 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() { - n2.errorIndices.push(n2.index); + n3.errorIndices.push(n3.index); } }; - return n2; + return n3; } - function C(e2) { - return q(e2, { type: 0 }); + function C(e3) { + return q(e3, { 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); + 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); } - const r2 = q(t2, -1), { at: u2, consume: o2, error: s2, reconsume: l2 } = r2; - function c2() { - return String.fromCodePoint(r2.value); + const r3 = q(t3, -1), { at: u3, consume: o3, error: s3, reconsume: l2 } = r3; + function c3() { + return String.fromCodePoint(r3.value); } - function i2() { - return { type: 13, value: c2() }; + function i3() { + return { type: 13, value: c3() }; } - function a2() { - for (; z(u2(1)); ) - o2(1); + function a3() { + for (; z(u3(1)); ) + o3(1); } - function f2() { - for (; -1 !== r2.value; ) - if (o2(1), 42 === u2(0) && 47 === u2(1)) - return void o2(1); - s2(); + function f3() { + for (; -1 !== r3.value; ) + if (o3(1), 42 === u3(0) && 47 === u3(1)) + return void o3(1); + s3(); } 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(); + 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 [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 }; + 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 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 }); + 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 === 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(); + 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 - e4 += c2(); + e5 += c3(); } - var t4; - }() : { type: 23, value: e3 }; + var t5; + }() : { type: 23, value: e4 }; } - return 40 === t3 ? (o2(1), { type: 23, value: e3 }) : { type: 24, value: e3 }; + return 40 === t4 ? (o3(1), { type: 23, value: e4 }) : { type: 24, value: e4 }; } - function h2(e3) { - let t3 = ""; + function h3(e4) { + let t4 = ""; 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) + 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(e4) ? o2(1) : t3 += v2(); + E(e5) ? o3(1) : t4 += v3(); } else - t3 += c2(); + t4 += c3(); } } - 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)) + 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; - t3.push(e5), o2(1); + t4.push(e6), o3(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); + 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); } - return -1 === e3 ? (s2(), String.fromCodePoint(65533)) : c2(); + return -1 === e4 ? (s3(), String.fromCodePoint(65533)) : c3(); } - function d2(e3, t3, n3) { - return 45 === e3 ? L(t3) || 45 === t3 || j(t3, n3) : !!L(e3); + function d3(e4, t4, n4) { + return 45 === e4 ? L(t4) || 45 === t4 || j(t4, n4) : !!L(e4); } - function m2(e3, t3, n3) { - return 43 === e3 || 45 === e3 ? k(t3) || 46 === t3 && k(n3) : !(46 !== e3 || !k(t3)) || !!k(e3); + function m3(e4, t4, n4) { + return 43 === e4 || 45 === e4 ? k(t4) || 46 === t4 && k(n4) : !(46 !== e4 || !k(t4)) || !!k(e4); } - function w2() { - let e3 = ""; + function w3() { + let e4 = ""; for (; ; ) { - const t3 = o2(1); - if (M(t3)) - e3 += c2(); + const t4 = o3(1); + if (M(t4)) + e4 += c3(); else { - if (!j(t3, u2(1))) - return l2(), e3; - e3 += v2(); + if (!j(t4, u3(1))) + return l2(), e4; + e4 += v3(); } } } - function g2() { + function g3() { for (; ; ) { - const e3 = o2(1); - if (-1 === e3) + const e4 = o3(1); + if (-1 === e4) return; - j(e3, u2(1)) && v2(); + j(e4, u3(1)) && v3(); } } 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) + 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 === e3) + else if (41 === e4) yield { type: 5 }; - else if (43 === e3) - m2(e3, u2(1), u2(2)) ? (l2(), yield p2()) : yield i2(); - else if (44 === e3) + 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 === 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) + 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 === e3) + else if (59 === e4) 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 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 i2(); - else if (91 === e3) + yield i3(); + else if (91 === e4) yield { type: 9 }; - else if (92 === e3) - j(e3, u2(1)) ? (l2(), yield y2()) : (s2(), yield i2()); - else if (93 === e3) + else if (92 === e4) + j(e4, u3(1)) ? (l2(), yield y3()) : (s3(), yield i3()); + else if (93 === e4) yield { type: 10 }; - else if (123 === e3) + else if (123 === e4) yield { type: 11 }; - else if (125 === e3) + else if (125 === e4) yield { type: 12 }; - else if (k(e3)) + else if (k(e4)) l2(), yield p2(); - else if (L(e3)) - l2(), yield y2(); + else if (L(e4)) + l2(), yield y3(); else { - if (-1 === e3) - return yield { type: 0 }, r2.errorIndices; - yield { type: 13, value: c2() }; + if (-1 === e4) + return yield { type: 0 }, r3.errorIndices; + yield { type: 13, value: c3() }; } } } - function k(e2) { - return e2 >= 48 && e2 <= 57; + function k(e3) { + return e3 >= 48 && e3 <= 57; } - function A(e2) { - return k(e2) || e2 >= 65 && e2 <= 70 || e2 >= 97 && e2 <= 102; + function A(e3) { + return k(e3) || e3 >= 65 && e3 <= 70 || e3 >= 97 && e3 <= 102; } - function E(e2) { - return 10 === e2 || 13 === e2 || 12 === e2; + function E(e3) { + return 10 === e3 || 13 === e3 || 12 === e3; } - function z(e2) { - return E(e2) || 9 === e2 || 32 === e2; + function z(e3) { + return E(e3) || 9 === e3 || 32 === e3; } - function L(e2) { - return e2 >= 65 && e2 <= 90 || e2 >= 97 && e2 <= 122 || e2 >= 128 || 95 === e2; + function L(e3) { + return e3 >= 65 && e3 <= 90 || e3 >= 97 && e3 <= 122 || e3 >= 128 || 95 === e3; } - function j(e2, t2) { - return 92 === e2 && !E(t2); + function j(e3, t3) { + return 92 === e3 && !E(t3); } - function M(e2) { - return L(e2) || k(e2) || 45 === e2; + function M(e3) { + return L(e3) || k(e3) || 45 === e3; } var T = { 11: 12, 9: 10, 4: 5 }; - function P(t2, n2) { - const r2 = function(e2, t3) { - const n3 = []; + function P(t3, n3) { + const r3 = function(e3, t4) { + const n4 = []; for (; ; ) - switch (e2.consume(1).type) { + switch (e3.consume(1).type) { case 1: break; case 0: - return { type: 3, value: n3 }; + return { type: 3, value: n4 }; case 18: case 19: - if (false !== t3) { - e2.reconsume(); - const t4 = R(e2); - t4 !== x && n3.push(t4); + if (false !== t4) { + e3.reconsume(); + const t5 = R(e3); + t5 !== x && n4.push(t5); } break; case 22: - e2.reconsume(), n3.push(U(e2)); + e3.reconsume(), n4.push(U(e3)); break; default: { - e2.reconsume(); - const t4 = R(e2); - t4 !== x && n3.push(t4); + e3.reconsume(); + const t5 = R(e3); + t5 !== x && n4.push(t5); break; } } - }(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) }); + }(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(e2) { - const t2 = C(e2), n2 = []; + function N(e3) { + const t3 = C(e3), n3 = []; for (; ; ) { - if (0 === t2.consume(1).type) - return n2; - t2.reconsume(), n2.push(Q(t2)); + if (0 === t3.consume(1).type) + return n3; + t3.reconsume(), n3.push(Q(t3)); } } - function O(e2) { - return function(e3) { - const t2 = [], n2 = []; + function O(e3) { + return function(e4) { + const t3 = [], n3 = []; for (; ; ) { - const r2 = e3.consume(1); - switch (r2.type) { + const r3 = e4.consume(1); + switch (r3.type) { case 1: case 8: break; case 0: - return { type: 1, value: [...n2, ...t2] }; + return { type: 1, value: [...n3, ...t3] }; case 22: - e3.reconsume(), t2.push(U(e3)); + e4.reconsume(), t3.push(U(e4)); 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); + 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 ("&" === r2.value) { - e3.reconsume(); - const n3 = R(e3); - n3 !== x && t2.push(n3); + if ("&" === r3.value) { + e4.reconsume(); + const n4 = R(e4); + n4 !== x && t3.push(n4); break; } default: { - e3.error(), e3.reconsume(); - let t3 = e3.at(1); - for (; 8 !== t3.type && 0 !== t3.type; ) - Q(e3), t3 = e3.at(1); + e4.error(), e4.reconsume(); + let t4 = e4.at(1); + for (; 8 !== t4.type && 0 !== t4.type; ) + Q(e4), t4 = e4.at(1); break; } } } - }(C(e2)); + }(C(e3)); } - function F(e2) { - for (; 1 === e2.at(1).type; ) - e2.consume(1); + function F(e3) { + for (; 1 === e3.at(1).type; ) + e3.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 = []; + 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 (t2 = e2.consume(1), t2.type) { + switch (t3 = e3.consume(1), t3.type) { case 8: - return { type: 25, name: n2, prelude: r2, value: null }; + return { type: 25, name: n3, prelude: r3, value: null }; case 0: - return e2.error(), { type: 25, name: n2, prelude: r2, value: null }; + return e3.error(), { type: 25, name: n3, prelude: r3, value: null }; case 11: - return { type: 25, name: n2, prelude: r2, value: H(e2) }; + return { type: 25, name: n3, prelude: r3, value: H(e3) }; case 28: - if (11 === t2.source.type) - return { type: 25, name: n2, prelude: r2, value: t2 }; + if (11 === t3.source.type) + return { type: 25, name: n3, prelude: r3, value: t3 }; default: - e2.reconsume(), r2.push(Q(e2)); + e3.reconsume(), r3.push(Q(e3)); } } - function R(e2) { - let t2 = e2.value; - const n2 = []; + function R(e3) { + let t3 = e3.value; + const n3 = []; for (; ; ) - switch (t2 = e2.consume(1), t2.type) { + switch (t3 = e3.consume(1), t3.type) { case 0: - return e2.error(), x; + return e3.error(), x; case 11: - return { type: 26, prelude: n2, value: H(e2) }; + return { type: 26, prelude: n3, value: H(e3) }; case 28: - if (11 === t2.source.type) - return { type: 26, prelude: n2, value: t2 }; + if (11 === t3.source.type) + return { type: 26, prelude: n3, value: t3 }; default: - e2.reconsume(), n2.push(Q(e2)); + e3.reconsume(), n3.push(Q(e3)); } } - 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 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(e2) { - const t2 = e2.consume(1); - switch (t2.type) { + function Q(e3) { + const t3 = e3.consume(1); + switch (t3.type) { case 11: case 9: case 4: - return H(e2); + return H(e3); 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 = []; + 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 (t3 = e3.consume(1), t3.type) { + switch (t4 = e4.consume(1), t4.type) { case 5: - return { type: 27, name: n2, value: r2 }; + return { type: 27, name: n3, value: r3 }; case 0: - return e3.error(), { type: 27, name: n2, value: r2 }; + return e4.error(), { type: 27, name: n3, value: r3 }; default: - e3.reconsume(), r2.push(Q(e3)); + e4.reconsume(), r3.push(Q(e4)); } - }(e2); + }(e3); default: - return t2; + return t3; } } - 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 = []; + 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 (t2 = e2.consume(1), t2.type) { - case r2: - return { type: 28, source: n2, value: { type: 0, value: u2 } }; + switch (t3 = e3.consume(1), t3.type) { + case r3: + return { type: 28, source: n3, value: { type: 0, value: u3 } }; case 0: - return e2.error(), { type: 28, source: n2, value: { type: 0, value: u2 } }; + return e3.error(), { type: 28, source: n3, value: { type: 0, value: u3 } }; default: - e2.reconsume(), u2.push(Q(e2)); + e3.reconsume(), u3.push(Q(e3)); } } - function V(e2) { - return F(e2), 0 === e2.at(1).type; + function V(e3) { + return F(e3), 0 === e3.at(1).type; } var D = { 11: ["{", "}"], 9: ["[", "]"], 4: ["(", ")"] }; - function W(e2, t2) { - switch (e2.type) { + function W(e3, t3) { + switch (e3.type) { case 25: - return `@${CSS.escape(e2.name)} ${e2.prelude.map((e3) => W(e3)).join("")}${e2.value ? W(e2.value) : ";"}`; + return `@${CSS.escape(e3.name)} ${e3.prelude.map((e4) => W(e4)).join("")}${e3.value ? W(e3.value) : ";"}`; case 26: - return `${e2.prelude.map((e3) => W(e3)).join("")}${W(e2.value)}`; + return `${e3.prelude.map((e4) => W(e4)).join("")}${W(e3.value)}`; case 28: { - const [t3, n2] = D[e2.source.type]; - return `${t3}${_(e2.value)}${n2}`; + const [t4, n3] = D[e3.source.type]; + return `${t4}${_(e3.value)}${n3}`; } case 27: - return `${CSS.escape(e2.name)}(${e2.value.map((e3) => W(e3)).join("")})`; + return `${CSS.escape(e3.name)}(${e3.value.map((e4) => W(e4)).join("")})`; case 29: - return `${CSS.escape(e2.name)}:${e2.value.map((e3) => W(e3)).join("")}${e2.important ? " !important" : ""}`; + 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(e2.value); + return "#" + CSS.escape(e3.value); case 24: - return CSS.escape(e2.value); + return CSS.escape(e3.value); case 15: - return e2.value + CSS.escape(e2.unit); + return e3.value + CSS.escape(e3.unit); case 13: case 17: - return e2.value; + return e3.value; case 2: - return `"${CSS.escape(e2.value)}"`; + return `"${CSS.escape(e3.value)}"`; case 6: return ","; case 20: - return "url(" + CSS.escape(e2.value) + ")"; + return "url(" + CSS.escape(e3.value) + ")"; case 22: - return "@" + CSS.escape(e2.value); + return "@" + CSS.escape(e3.value); case 16: - return e2.value + "%"; + return e3.value + "%"; default: - throw new Error(`Unsupported token ${e2.type}`); + throw new Error(`Unsupported token ${e3.type}`); } } - function _(e2, t2) { - return e2.value.map((t3) => { - let n2 = W(t3); - return 29 === t3.type && 0 !== e2.type && (n2 += ";"), n2; + function _(e3, t3) { + return e3.value.map((t4) => { + let n3 = W(t4); + return 29 === t4.type && 0 !== e3.type && (n3 += ";"), n3; }).join(""); } - function B(e2) { - return W(e2); + function B(e3) { + return W(e3); } - function G(e2) { - const t2 = e2.at(1); - return 13 === t2.type && "=" === t2.value && (e2.consume(1), true); + function G(e3) { + const t3 = e3.at(1); + return 13 === t3.type && "=" === t3.value && (e3.consume(1), true); } - function Y(e2, t2) { - const n2 = []; + function Y(e3, t3) { + const n3 = []; for (; ; ) { - const r2 = e2.at(1); - if (0 === r2.type || t2 && 7 === r2.type || 13 === r2.type && (">" === r2.value || "<" === r2.value || "=" === r2.value)) + const r3 = e3.at(1); + if (0 === r3.type || t3 && 7 === r3.type || 13 === r3.type && (">" === r3.value || "<" === r3.value || "=" === r3.value)) break; - n2.push(e2.consume(1)); + n3.push(e3.consume(1)); } - return n2; + return n3; } - 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 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(e2) { - return 4 === e2 || 5 === e2; + function K(e3) { + return 4 === e3 || 5 === e3; } - function X(e2) { - return 2 === e2 || 3 === e2; + function X(e3) { + return 2 === e3 || 3 === e3; } - 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) + 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 u2 = r2.toLowerCase(); - return u2 = n2 ? n2(u2) : u2, t2.has(u2) ? u2 : x; + let u3 = r3.toLowerCase(); + return u3 = n3 ? n3(u3) : u3, t3.has(u3) ? u3 : x; } - function ee(e2) { - return { type: 13, value: e2 }; + function ee(e3) { + return { type: 13, value: e3 }; } - function te(e2, t2) { - return { type: 29, name: e2, value: t2, important: false }; + function te(e3, t3) { + return { type: 29, name: e3, value: t3, important: false }; } - function ne(e2) { - return { type: 24, value: e2 }; + function ne(e3) { + return { type: 24, value: e3 }; } - function re(e2, t2) { - return { type: 27, name: e2, value: t2 }; + function re(e3, t3) { + return { type: 27, name: e3, value: t3 }; } - function ue(e2) { - return re("var", [ne(e2)]); + function ue(e3) { + return re("var", [ne(e3)]); } - function oe(e2, t2) { - F(e2); - let n2 = false, r2 = e2.at(1); - if (24 === r2.type) { - if ("not" !== r2.value.toLowerCase()) + function oe(e3, t3) { + F(e3); + let n3 = false, r3 = e3.at(1); + if (24 === r3.type) { + if ("not" !== r3.value.toLowerCase()) return x; - e2.consume(1), F(e2), n2 = true; + e3.consume(1), F(e3), n3 = true; } - let u2 = function(e3) { - const t3 = e3.consume(1); - switch (t3.type) { + let u3 = function(e4) { + const t4 = e4.consume(1); + switch (t4.type) { case 28: { - if (4 !== t3.source.type) + if (4 !== t4.source.type) return x; - const e4 = oe(C(t3.value.value), null); - return e4 !== x ? e4 : { type: 4, value: t3 }; + const e5 = oe(C(t4.value.value), null); + return e5 !== x ? e5 : { type: 4, value: t4 }; } case 27: - return { type: 4, value: t3 }; + return { type: 4, value: t4 }; default: return x; } - }(e2); - if (u2 === x) + }(e3); + if (u3 === 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) + 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 n3 = oe(e2, o2); - return n3 === x ? x : { type: "and" === o2 ? 2 : 3, left: u2, right: n3 }; + const n4 = oe(e3, o3); + return n4 === x ? x : { type: "and" === o3 ? 2 : 3, left: u3, right: n4 }; } - return V(e2) ? u2 : x; + return V(e3) ? u3 : x; } - function se(e2) { - return oe(e2, null); + function se(e3) { + return oe(e3, null); } - function le(e2) { - switch (e2.type) { + function le(e3) { + switch (e3.type) { case 1: - return [ne("not"), { type: 1 }, ...le(e2.value)]; + return [ne("not"), { type: 1 }, ...le(e3.value)]; case 2: case 3: - return [...le(e2.left), { type: 1 }, ne(2 === e2.type ? "and" : "or"), { type: 1 }, ...le(e2.right)]; + return [...le(e3.left), { type: 1 }, ne(2 === e3.type ? "and" : "or"), { type: 1 }, ...le(e3.right)]; case 4: - return [e2.value]; + return [e3.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) + function ye(e3, t3, n3, r3) { + const u3 = n3(); + if (u3 === x) return x; - let o2 = [u2, null]; - F(e2); - const s2 = e2.at(1); - if (13 === s2.type) { - if (s2.value !== t2) + let o3 = [u3, null]; + F(e3); + const s3 = e3.at(1); + if (13 === s3.type) { + if (s3.value !== t3) return x; - e2.consume(1), F(e2); - const n3 = r2(); - F(e2), n3 !== x && (o2 = [u2, n3]); + e3.consume(1), F(e3); + const n4 = r3(); + F(e3), n4 !== x && (o3 = [u3, n4]); } - return V(e2) ? o2 : x; + return V(e3) ? o3 : x; } - function he(e2) { - const t2 = e2.consume(1); - return 17 === t2.type ? parseInt(t2.value) : x; + function he(e3) { + const t3 = e3.consume(1); + return 17 === t3.type ? parseInt(t3.value) : x; } - function ve(e2) { - const t2 = C(e2); - F(t2); - const n2 = t2.consume(1); - let r2 = x; - switch (n2.type) { + function ve(e3) { + const t3 = C(e3); + F(t3); + const n3 = t3.consume(1); + let r3 = x; + switch (n3.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); + 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: - r2 = { type: 3, value: parseInt(n2.value), unit: n2.unit.toLowerCase() }; + r3 = { type: 3, value: parseInt(n3.value), unit: n3.unit.toLowerCase() }; break; case 24: { - const e3 = n2.value.toLowerCase(); - switch (e3) { + const e4 = n3.value.toLowerCase(); + switch (e4) { case "landscape": case "portrait": - r2 = { type: 4, value: e3 }; + r3 = { type: 4, value: e4 }; } } } - return r2 === x ? x : V(t2) ? { type: 6, value: r2 } : x; + return r3 === x ? x : V(t3) ? { type: 6, value: r3 } : x; } - function de(e2) { - return !ge(e2 = e2.toLowerCase()) && !ae.has(e2); + function de(e3) { + return !ge(e3 = e3.toLowerCase()) && !ae.has(e3); } - function me(e2, t2) { - const n2 = []; + function me(e3, t3) { + const n3 = []; for (; ; ) { - F(e2); - const r2 = e2.at(1); - if (24 !== r2.type || !t2(r2.value)) - return n2; - e2.consume(1), n2.push(r2.value); + F(e3); + const r3 = e3.at(1); + if (24 !== r3.type || !t3(r3.value)) + return n3; + e3.consume(1), n3.push(r3.value); } } - function we(e2) { - const t2 = []; + function we(e3) { + const t3 = []; for (; ; ) { - F(e2); - const n2 = e2.at(1); - if (24 !== n2.type) + F(e3); + const n3 = e3.at(1); + if (24 !== n3.type) break; - const r2 = n2.value; - if (!de(r2)) + const r3 = n3.value; + if (!de(r3)) break; - e2.consume(1), t2.push(r2); + e3.consume(1), t3.push(r3); } - return t2; + return t3; } - function ge(e2) { - return fe.has(e2); + function ge(e3) { + return fe.has(e3); } - function be(e2) { - return e2.map((e3) => "cq-" + e3); + function be(e3) { + return e3.map((e4) => "cq-" + e4); } - function Se(e2) { - const t2 = me(e2, (e3) => ge(e3)); - return 1 === t2.length ? be(t2) : x; + function Se(e3) { + const t3 = me(e3, (e4) => ge(e4)); + return 1 === t3.length ? be(t3) : x; } - function xe(e2, t2) { - const n2 = me(e2, (e3) => "none" === e3); - if (1 === n2.length) - return be(n2); - if (0 !== n2.length) + 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 (t2) { - const t3 = Se(e2); - if (t3 !== x) - return t3; + if (t3) { + const t4 = Se(e3); + if (t4 !== x) + return t4; } - const r2 = we(e2); - return r2.length > 0 && (!t2 || V(e2)) ? r2 : x; + const r3 = we(e3); + return r3.length > 0 && (!t3 || V(e3)) ? r3 : x; } - function qe(e2, t2) { - if (t2) { - const t3 = Se(e2); - if (t3 !== x) - return t3; + function qe(e3, t3) { + if (t3) { + const t4 = Se(e3); + if (t4 !== x) + return t4; } - return function(e3) { - const t3 = me(e3, (e4) => "normal" === e4); - if (1 === t3.length) - return be(t3); - if (0 !== t3.length) + return function(e4) { + const t4 = me(e4, (e5) => "normal" === e5); + if (1 === t4.length) + return be(t4); + if (0 !== t4.length) return x; - const n2 = me(e3, (e4) => pe.has(e4)); - return n2.length > 0 && V(e3) ? n2 : x; - }(e2); + const n3 = me(e4, (e5) => pe.has(e5)); + return n3.length > 0 && V(e4) ? n3 : x; + }(e3); } - 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 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(e2) { - const t2 = C(e2), n2 = we(t2); - if (!n2 || n2.length > 1) + function $e(e3) { + const t3 = C(e3), n3 = we(t3); + if (!n3 || n3.length > 1) return x; - const r2 = se(t2); - if (r2 === x) + const r3 = se(t3); + if (r3 === 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; + 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(e2, t2) { - switch (e2.type) { + function ke(e3, t3) { + switch (e3.type) { case 1: - return { type: 1, value: ke(e2.value, t2) }; + return { type: 1, value: ke(e3.value, t3) }; case 2: case 3: - return { type: 2 === e2.type ? 2 : 3, left: ke(e2.left, t2), right: ke(e2.right, t2) }; + return { type: 2 === e3.type ? 2 : 3, left: ke(e3.left, t3), right: ke(e3.right, t3) }; 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 (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 === 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; + 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 u2 = J(e4); - if (u2 === x) + const u3 = J(e5); + if (u3 === 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 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 s2 = J(e4); - if (s2 === x || !(X(u2) && X(s2) || K(u2) && K(s2))) + const s3 = J(e5); + if (s3 === x || !(X(u3) && X(s3) || K(u3) && K(s3))) 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) + 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 r2 = ce[n3.feature]; - if (null == r2) + const r3 = ce[n4.feature]; + if (null == r3) return x; - if (t3.features.add(r2), 1 === n3.type) - return { type: 5, feature: r2 }; + if (t4.features.add(r3), 1 === n4.type) + return { type: 5, feature: r3 }; { - const e4 = { type: 5, feature: r2 }; - let t4 = x; - if (null !== n3.bounds[0]) { - const r3 = ve(n3.bounds[0][1]); - if (r3 === x) + 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; - t4 = { type: 4, operator: n3.bounds[0][0], left: r3, right: e4 }; + t5 = { type: 4, operator: n4.bounds[0][0], left: r4, right: e5 }; } - if (null !== n3.bounds[1]) { - const r3 = ve(n3.bounds[1][1]); - if (r3 === x) + if (null !== n4.bounds[1]) { + const r4 = ve(n4.bounds[1][1]); + if (r4 === 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; + const u3 = { type: 4, operator: n4.bounds[1][0], left: e5, right: r4 }; + t5 = t5 !== x ? { type: 2, left: t5, right: u3 } : u3; } - return t4; + return t5; } - }(C(e2.value.value.value), t2); - if (n2 !== x) - return n2; + }(C(e3.value.value.value), t3); + if (n3 !== x) + return n3; } return { type: 6, value: { type: 1 } }; } } var Ae = 0; @@ -6487,225 +6614,225 @@ 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 Te(e3, t3) { + return re("calc", [{ type: 17, flag: e3.flag, value: e3.value }, ee("*"), t3]); } - function Pe(t2) { - return t2.map((t3) => { - switch (t3.type) { + function Pe(t3) { + return t3.map((t4) => { + switch (t4.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); + 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({}, t3, { value: Pe(t3.value) }); + return e({}, t4, { value: Pe(t4.value) }); } - return t3; + return t4; }); } - function Ne(t2) { - switch (t2.name) { + function Ne(t3) { + switch (t3.name) { case "container": - return Ce(t2.value) ? e({}, t2, { name: p }) : t2; + return Ce(t3.value) ? e({}, t3, { name: p }) : t3; case "container-name": - return xe(C(t2.value), true) ? e({}, t2, { name: h }) : t2; + return xe(C(t3.value), true) ? e({}, t3, { name: h }) : t3; case "container-type": - return null != qe(C(t2.value), true) ? e({}, t2, { name: y }) : t2; + return null != qe(C(t3.value), true) ? e({}, t3, { name: y }) : t3; } - return e({}, t2, { value: Pe(t2.value) }); + return e({}, t3, { value: Pe(t3.value) }); } - function Oe(t2, n2) { - return e({}, t2, { value: t2.value.map((t3) => { - switch (t3.type) { + function Oe(t3, n3) { + return e({}, t3, { value: t3.value.map((t4) => { + switch (t4.type) { case 25: - return He(t3, n2); + return He(t4, n3); case 26: - return function(t4, n3) { - return n3.transformStyleRule(e({}, t4, { value: Re(t4.value, n3) })); - }(t3, n2); + return function(t5, n4) { + return n4.transformStyleRule(e({}, t5, { value: Re(t5.value, n4) })); + }(t4, n3); default: - return t3; + return t4; } }) }); } - function Fe(e2) { - return 0 === e2.type || 6 === e2.type; + function Fe(e3) { + return 0 === e3.type || 6 === e3.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 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(t2, n2) { - return function(t3, n3) { - const r2 = []; - let u2 = null, o2 = null; - for (const e2 of t3.value.value) - switch (e2.type) { + 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 t4 = n3 ? n3(e2) : e2; - t4 && r2.push(t4); + const t5 = n4 ? n4(e3) : e3; + t5 && r3.push(t5); } break; case 29: { - const t4 = Ne(e2); - switch (t4.name) { + const t5 = Ne(e3); + switch (t5.name) { case p: { - const t5 = Ce(e2.value); - t5 !== x && (u2 = t5[0], o2 = t5[1]); + const t6 = Ce(e3.value); + t6 !== x && (u3 = t6[0], o3 = t6[1]); break; } case h: { - const t5 = xe(C(e2.value), true); - t5 !== x && (u2 = t5); + const t6 = xe(C(e3.value), true); + t6 !== x && (u3 = t6); break; } case y: { - const t5 = qe(C(e2.value), true); - t5 !== x && (o2 = t5); + const t6 = qe(C(e3.value), true); + t6 !== x && (o3 = t6); break; } default: - r2.push(t4); + r3.push(t5); } } } - 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)); + 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(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)] } }) }); + 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 t2; + return t3; } - 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 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(t2, n2) { - switch (t2.name.toLocaleLowerCase()) { + function He(t3, n3) { + switch (t3.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); + 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(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) { + 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(t5, n4) { - return e({}, t5, { value: Re(t5.value, n4) }); - }(t4, n3); + return function(t6, n5) { + return e({}, t6, { value: Re(t6.value, n5) }); + }(t5, n4); case 25: - return He(t4, n3); + return He(t5, n4); } - }) } })), e({}, t3, { value: r2 }); - }(t2, n2); + }) } })), e({}, t4, { value: r3 }); + }(t3, n3); case "supports": - return Qe(t2, n2); + return Qe(t3, n3); 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 = []; + 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 === 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 (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) - h2 = [ee(":"), re("where", h2)]; + h3 = [ee(":"), re("where", h3)]; 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 }); + 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 }); } - u3.push(...f2), o3.push(...y2), o3.push(...h2), o3.push(...p2), r4.consume(1); + u4.push(...f3), o4.push(...y3), o4.push(...h3), o4.push(...p2), r5.consume(1); } - var l4, c2; - }(t4.prelude, u2.uid); - if (s2.length > 0) - return t4; - const l3 = n4.map(B).join(""); + var l4, c3; + }(t5.prelude, u3.uid); + if (s3.length > 0) + return t5; + const l3 = n5.map(B).join(""); try { - je.matches(l3), o2.add(l3); - } catch (e2) { + je.matches(l3), o3.add(l3); + } catch (e3) { } - return e({}, t4, { prelude: r3 }); + return e({}, t5, { prelude: r4 }); } }).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)); + 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: -${t4.join("\n")}`); +${t5.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 } }) }; + 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 t3; - }(t2, n2); + return t4; + }(t3, n3); } - return t2; + return t3; } var Ve = class { - constructor(e2) { - this.value = void 0, this.value = e2; + constructor(e3) { + this.value = void 0, this.value = e3; } }; - function De(e2, t2) { - if (e2 === t2) + function De(e3, t3) { + if (e3 === t3) 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) + 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 n2 = 0, r2 = e2.length; n2 < r2; n2++) - if (!De(e2[n2], t2[n2])) + for (let n3 = 0, r3 = e3.length; n3 < r3; n3++) + if (!De(e3[n3], t3[n3])) return false; return true; } - if (e2 instanceof Ve) - return t2 instanceof Ve && e2.value === t2.value; + if (e3 instanceof Ve) + return t3 instanceof Ve && e3.value === t3.value; { - const n2 = Object.keys(e2); - if (n2.length !== Object.keys(t2).length) + const n3 = Object.keys(e3); + if (n3.length !== Object.keys(t3).length) return false; - for (let r2 = 0, u2 = n2.length; r2 < u2; r2++) { - const u3 = n2[r2]; - if (!De(e2[u3], t2[u3])) + for (let r3 = 0, u3 = n3.length; r3 < u3; r3++) { + const u4 = n3[r3]; + if (!De(e3[u4], t3[u4])) return false; } return true; } } @@ -6717,326 +6844,326 @@ 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; + constructor(e3) { + this.node = void 0, this.node = e3; } 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; + constructor(e3, t3) { + super(e3), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t3; } 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); + 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); })); } } disconnected() { - var e2, t2; - null == (e2 = this.controller) || e2.abort(), this.controller = null, null == (t2 = this.styleSheet) || t2.dispose(), this.styleSheet = null; + var e3, t3; + null == (e3 = this.controller) || e3.abort(), this.controller = null, null == (t3 = this.styleSheet) || t3.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; + constructor(e3, t3) { + super(e3), this.context = void 0, this.controller = null, this.styleSheet = null, this.context = t3; } 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(); + 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(); }); } disconnected() { - var e2, t2; - null == (e2 = this.controller) || e2.abort(), this.controller = null, null == (t2 = this.styleSheet) || t2.dispose(), this.styleSheet = null; + var e3, t3; + null == (e3 = this.controller) || e3.abort(), this.controller = null, null == (t3 = this.styleSheet) || t3.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} }`; + const e3 = `* { ${y}: cq-normal; ${h}: cq-none; }`; + this.node.innerHTML = void 0 === window.CSSLayerBlockRule ? e3 : `@layer cq-polyfill-${f} { ${e3} }`; } }; 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); + constructor(e3, t3) { + super(e3), this.context = void 0, this.styles = void 0, this.context = t3, this.styles = window.getComputedStyle(e3); } 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 }); + const e3 = ct((e4) => this.styles.getPropertyValue(e4)); + this.context.viewportChanged({ width: e3.width, height: e3.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 rt(e3) { + const t3 = new AbortController(); + return e3(t3.signal).catch((e4) => { + if (!(e4 instanceof DOMException && "AbortError" === e4.message)) + throw e4; + }), t3; } - 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) { + 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": - t2 |= 3; + t3 |= 3; break; case "inline-size": - t2 |= 1; + t3 |= 1; break; default: return 0; } - return t2; + return t3; } - function ot(e2) { - let t2 = 0; - return "none" !== e2 && (t2 |= 1, "contents" === e2 || "inline" === e2 || Ke.test(e2) || (t2 |= 2)), t2; + function ot(e3) { + let t3 = 0; + return "none" !== e3 && (t3 |= 1, "contents" === e3 || "inline" === e3 || Ke.test(e3) || (t3 |= 2)), t3; } - function st(e2, t2) { - return parseFloat(e2(t2)); + function st(e3, t3) { + return parseFloat(e3(t3)); } - function lt(e2, t2) { - return t2.reduce((t3, n2) => t3 + st(e2, n2), 0); + function lt(e3, t3) { + return t3.reduce((t4, n3) => t4 + st(e3, n3), 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 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(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 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(e2, t2, n2) { - null != n2 ? n2 != e2.getPropertyValue(t2) && e2.setProperty(t2, n2) : e2.removeProperty(t2); + function at(e3, t3, n3) { + null != n3 ? n3 != e3.getPropertyValue(t3) && e3.setProperty(t3, n3) : e3.removeProperty(t3); } - function ft(e2) { - const t2 = e2[_e]; - return null != t2 ? t2 : []; + function ft(e3) { + const t3 = e3[_e]; + return null != t3 ? t3 : []; } - function pt(e2, t2) { - e2[_e] = t2; + function pt(e3, t3) { + e3[_e] = t3; } - new Promise((e2) => { - }), window.CQPolyfill = { version: "1.0.2" }, "container" in document.documentElement.style || function(n2) { - function r2(e2) { - return e2[We] || null; + new Promise((e3) => { + }), window.CQPolyfill = { version: "1.0.2" }, "container" in document.documentElement.style || function(n3) { + function r3(e3) { + return e3[We] || null; } - const u2 = document.documentElement; - if (r2(u2)) + const u3 = document.documentElement; + if (r3(u3)) 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(); + 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(); } - 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()); + 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(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) { + }).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 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 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 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: [] }; + 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: [] }; } - }(t2, n3 ? n3.toString() : void 0); - let s3 = () => { + }(t3, n4 ? n4.toString() : void 0); + let s4 = () => { }, 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()); + 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: o3.source, dispose: s3, refresh: l3 }; + }), { source: o4.source, dispose: s4, refresh: l3 }; } const p2 = { cqw: null, cqh: null }; - function y2({ width: e2, height: t2 }) { - p2.cqw = e2, p2.cqh = t2; + function y3({ width: e3, height: t3 }) { + p2.cqw = e3, p2.cqh = t3; } - 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); + 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); } - r3.length > 0 ? e2.setAttribute(n3, r3) : e2.removeAttribute(n3); + r4.length > 0 ? e3.setAttribute(n4, r4) : e3.removeAttribute(n4); } } function S2() { - l2.unobserve(u2), l2.observe(u2); + l2.unobserve(u3), l2.observe(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); + 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 && 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; + 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 & 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 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; - r7.set(n10, e6); + r8.set(n11, e7); } - const o6 = i(e5.condition, { sizeFeatures: r7, treeContext: n9.treeContext }); - return 5 === o6.type ? o6.value : null; - }(r6, u5) : null; + const o7 = i(e6.condition, { sizeFeatures: r8, treeContext: n10.treeContext }); + return 5 === o7.type ? o7.value : null; + }(r7, u6) : 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 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 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 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(n7), conditions: f3, context: a3, displayFlags: y3, isQueryContainer: p4 }; - })(...n6); - null != u3 && De(u3[1], o3) || (u3 = [n6, o3]); + return { parentState: new Ve(n8), conditions: f4, context: a4, displayFlags: y4, isQueryContainer: p4 }; + })(...n7); + null != u4 && De(u4[1], o4) || (u4 = [n7, o4]); } - return u3[1]; + return u4[1]; }; }(); - }(n3); - S3 = (e2) => r3(e2, q3); + }(n4); + S3 = (e3) => r4(e3, 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; + 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; - f2 = { connect() { - for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) - A2(e2); + f3 = { connect() { + for (let e3 = n4.firstChild; null != e3; e3 = e3.nextSibling) + A3(e3); 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(); + 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 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); + 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 (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); + 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 e3 = n3.firstChild; null != e3; e3 = e3.nextSibling) - A2(e3).update(t2); + for (let e4 = n4.firstChild; null != e4; e4 = e4.nextSibling) + A3(e4).update(t3); }, resize() { q3 = Symbol(); }, mutate() { q3 = Symbol(); - for (let e2 = n3.firstChild; null != e2; e2 = e2.nextSibling) - A2(e2).mutate(); - } }, n3[We] = f2, f2.connect(); + for (let e3 = n4.firstChild; null != e3; e3 = e3.nextSibling) + A3(e3).mutate(); + } }, n4[We] = f3, f3.connect(); } - return f2; + return f3; } - u2.prepend(s2, o2), A2(u2), S2(); + u3.prepend(s3, o3), A3(u3), S2(); }(); // ../../../node_modules/alpinejs/dist/module.esm.js var flushPending = false; var flushing = false; @@ -7062,13 +7189,13 @@ } } function flushJobs() { flushPending = false; flushing = true; - for (let i2 = 0; i2 < queue.length; i2++) { - queue[i2](); - lastFlushedIndex = i2; + for (let i3 = 0; i3 < queue.length; i3++) { + queue[i3](); + lastFlushedIndex = i3; } queue.length = 0; lastFlushedIndex = -1; flushing = false; } @@ -7103,11 +7230,11 @@ 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.forEach((i3) => i3()); }; } el._x_effects.add(effectReference); cleanup2 = () => { if (effectReference === void 0) @@ -7213,11 +7340,11 @@ function initTree(el, walker = walk, intercept = () => { }) { deferHandlingDirectives(() => { walker(el, (el2, skip) => { intercept(el2, skip); - initInterceptors.forEach((i2) => i2(el2, skip)); + initInterceptors.forEach((i3) => i3(el2, skip)); directives(el2, el2.attributes).forEach((handle) => handle()); el2._x_ignore && skip(); }); }); } @@ -7256,11 +7383,11 @@ 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()); + value.forEach((i3) => i3()); delete el._x_attributeCleanups[name]; } }); } function cleanupElement(el) { @@ -7321,21 +7448,21 @@ } 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) + for (let i3 = 0; i3 < mutations.length; i3++) { + if (mutations[i3].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[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[i2].type === "attributes") { - let el = mutations[i2].target; - let name = mutations[i2].attributeName; - let oldValue = mutations[i2].oldValue; + 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) }); }; @@ -7356,16 +7483,16 @@ } removedAttributes.forEach((attrs, el) => { cleanupAttributes(el, attrs); }); addedAttributes.forEach((attrs, el) => { - onAttributeAddeds.forEach((i2) => i2(el, attrs)); + onAttributeAddeds.forEach((i3) => i3(el, attrs)); }); for (let node of removedNodes) { if (addedNodes.includes(node)) continue; - onElRemoveds.forEach((i2) => i2(node)); + onElRemoveds.forEach((i3) => i3(node)); destroyTree(node); } addedNodes.forEach((node) => { node._x_ignoreSelf = true; node._x_ignore = true; @@ -7375,11 +7502,11 @@ continue; if (!node.isConnected) continue; delete node._x_ignoreSelf; delete node._x_ignore; - onElAddeds.forEach((i2) => i2(node)); + onElAddeds.forEach((i3) => i3(node)); node._x_ignore = true; node._x_ignoreSelf = true; } addedNodes.forEach((node) => { delete node._x_ignoreSelf; @@ -7394,11 +7521,11 @@ 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); + node._x_dataStack = node._x_dataStack.filter((i3) => i3 !== data2); }; } function closestDataStack(node) { if (node._x_dataStack) return node._x_dataStack; @@ -7414,11 +7541,11 @@ return new Proxy({ objects }, mergeProxyTrap); } var mergeProxyTrap = { ownKeys({ objects }) { return Array.from( - new Set(objects.flatMap((i2) => Object.keys(i2))) + new Set(objects.flatMap((i3) => Object.keys(i3))) ); }, has({ objects }, name) { if (name == Symbol.unscopables) return false; @@ -7542,12 +7669,12 @@ return obj; } function tryCatch(el, expression, callback, ...args) { try { return callback(...args); - } catch (e2) { - handleError(e2, el, expression); + } catch (e3) { + handleError(e3, el, expression); } } function handleError(error2, el, expression = void 0) { Object.assign(error2, { el, expression }); console.warn(`Alpine Expression Error: ${error2.message} @@ -7640,16 +7767,16 @@ } 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)); + result.then((i3) => runIfTypeOfFunction(receiver, i3, scope2, params)).catch((error2) => handleError(error2, el, value)); } else { receiver(result); } } else if (typeof value === "object" && value instanceof Promise) { - value.then((i2) => receiver(i2)); + value.then((i3) => receiver(i3)); } else { receiver(value); } } var prefixAsString = "x-"; @@ -7730,11 +7857,11 @@ effect: effect32, cleanup: cleanup2, evaluateLater: evaluateLater.bind(evaluateLater, el), evaluate: evaluate.bind(evaluate, el) }; - let doCleanup = () => cleanups.forEach((i2) => i2()); + let doCleanup = () => cleanups.forEach((i3) => i3()); return [utilities, doCleanup]; } function getDirectiveHandler(el, directive2) { let noop = () => { }; @@ -7754,11 +7881,11 @@ var startingWith = (subject, replacement) => ({ name, value }) => { if (name.startsWith(subject)) name = name.replace(subject, replacement); return { name, value }; }; - var into = (i2) => i2; + var into = (i3) => i3; function toTransformedAttributes(callback = () => { }) { return ({ name, value }) => { let { name: newName, value: newValue } = attributeTransformers.reduce((carry, transform) => { return transform(carry); @@ -7783,11 +7910,11 @@ 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(".", "")), + modifiers: modifiers.map((i3) => i3.replace(".", "")), expression: value, original }; }; } @@ -7806,13 +7933,13 @@ "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; + 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 = () => { @@ -7847,11 +7974,11 @@ } 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 missingClasses = (classString2) => classString2.split(" ").filter((i3) => !el.classList.contains(i3)).filter(Boolean); let addClassesAndReturnUndo = (classes) => { el.classList.add(...classes); return () => { el.classList.remove(...classes); }; @@ -7863,25 +7990,25 @@ 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); + forRemove.forEach((i3) => { + if (el.classList.contains(i3)) { + el.classList.remove(i3); + removed.push(i3); } }); - forAdd.forEach((i2) => { - if (!el.classList.contains(i2)) { - el.classList.add(i2); - added.push(i2); + forAdd.forEach((i3) => { + if (!el.classList.contains(i3)) { + el.classList.add(i3); + added.push(i3); } }); return () => { - removed.forEach((i2) => el.classList.add(i2)); - added.forEach((i2) => el.classList.remove(i2)); + 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); @@ -7967,14 +8094,14 @@ 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")); + modifiers = modifiers.filter((i3, index) => index < modifiers.indexOf("out")); } if (modifiers.includes("out") && !doesntSpecify) { - modifiers = modifiers.filter((i2, index) => index > modifiers.indexOf("out")); + 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; @@ -8071,18 +8198,18 @@ nextTick2(() => { let hideAfterChildren = (el2) => { let carry = Promise.all([ el2._x_hidePromise, ...(el2._x_hideChildren || []).map(hideAfterChildren) - ]).then(([i2]) => i2()); + ]).then(([i3]) => i3()); delete el2._x_hidePromise; delete el2._x_hideChildren; return carry; }; - hideAfterChildren(el).catch((e2) => { - if (!e2.isFromCancelledTransition) - throw e2; + hideAfterChildren(el).catch((e3) => { + if (!e3.isFromCancelledTransition) + throw e3; }); }); } }); }; @@ -8480,11 +8607,11 @@ 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_default)); + callbacks.forEach((i3) => i3(alpine_default)); } var stores = {}; var isReactive = false; function store(name, value) { if (!isReactive) { @@ -8638,12 +8765,12 @@ }; var alpine_default = Alpine2; 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; + 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`); @@ -8669,11 +8796,11 @@ return hit || (cache[str] = fn3(str)); }; }; var camelizeRE = /-(\w)/g; var camelize = cacheStringFunction((str) => { - return str.replace(camelizeRE, (_2, c2) => c2 ? c2.toUpperCase() : ""); + 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)}` : ``); @@ -8735,12 +8862,12 @@ return effect32; } function cleanup(effect32) { const { deps } = effect32; if (deps.length) { - for (let i2 = 0; i2 < deps.length; i2++) { - deps[i2].delete(effect32); + for (let i3 = 0; i3 < deps.length; i3++) { + deps[i3].delete(effect32); } deps.length = 0; } } var shouldTrack = true; @@ -8863,12 +8990,12 @@ function createArrayInstrumentations() { const instrumentations = {}; ["includes", "indexOf", "lastIndexOf"].forEach((key) => { instrumentations[key] = function(...args) { const arr = toRaw(this); - for (let i2 = 0, l2 = this.length; i2 < l2; i2++) { - track(arr, "get", i2 + ""); + 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 { @@ -8986,11 +9113,11 @@ } }; var toReactive = (value) => isObject(value) ? reactive2(value) : value; var toReadonly = (value) => isObject(value) ? readonly(value) : value; var toShallow = (value) => value; - var getProto = (v2) => Reflect.getPrototypeOf(v2); + var getProto = (v3) => Reflect.getPrototypeOf(v3); function get$1(target, key, isReadonly = false, isShallow = false) { target = target[ "__v_raw" /* RAW */ ]; @@ -9336,12 +9463,12 @@ return observed && toRaw(observed[ "__v_raw" /* RAW */ ]) || observed; } - function isRef(r2) { - return Boolean(r2 && r2.__v_isRef === true); + 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); @@ -9411,11 +9538,11 @@ } directive("modelable", (el, { expression }, { effect: effect32, evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { let func = evaluateLater2(expression); let innerGet = () => { let result; - func((i2) => result = i2); + func((i3) => result = i3); return result; }; let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`); let innerSet = (val) => evaluateInnerSet(() => { }, { scope: { "__placeholder": val } }); @@ -9457,13 +9584,13 @@ 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)); + clone2.addEventListener(eventName, (e3) => { + e3.stopPropagation(); + el.dispatchEvent(new e3.constructor(e3.type, e3)); }); }); } addScopeToNode(clone2, {}, el); let placeInDom = (clone3, target2, modifiers2) => { @@ -9509,13 +9636,13 @@ }; directive("ignore", handler); directive("effect", (el, { expression }, { effect: effect32 }) => effect32(evaluateLater(el, expression))); function on(el, event, modifiers, callback) { let listenerTarget = el; - let handler4 = (e2) => callback(e2); + let handler4 = (e3) => callback(e3); let options = {}; - let wrapHandler = (callback2, wrapper) => (e2) => wrapper(callback2, e2); + 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")) @@ -9535,50 +9662,50 @@ 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); } if (modifiers.includes("prevent")) - handler4 = wrapHandler(handler4, (next, e2) => { - e2.preventDefault(); - next(e2); + handler4 = wrapHandler(handler4, (next, e3) => { + e3.preventDefault(); + next(e3); }); if (modifiers.includes("stop")) - handler4 = wrapHandler(handler4, (next, e2) => { - e2.stopPropagation(); - next(e2); + handler4 = wrapHandler(handler4, (next, e3) => { + e3.stopPropagation(); + next(e3); }); if (modifiers.includes("self")) - handler4 = wrapHandler(handler4, (next, e2) => { - e2.target === el && next(e2); + handler4 = wrapHandler(handler4, (next, e3) => { + e3.target === el && next(e3); }); if (modifiers.includes("away") || modifiers.includes("outside")) { listenerTarget = document; - handler4 = wrapHandler(handler4, (next, e2) => { - if (el.contains(e2.target)) + handler4 = wrapHandler(handler4, (next, e3) => { + if (el.contains(e3.target)) return; - if (e2.target.isConnected === false) + if (e3.target.isConnected === false) return; if (el.offsetWidth < 1 && el.offsetHeight < 1) return; if (el._x_isShown === false) return; - next(e2); + next(e3); }); } if (modifiers.includes("once")) { - handler4 = wrapHandler(handler4, (next, e2) => { - next(e2); + handler4 = wrapHandler(handler4, (next, e3) => { + next(e3); listenerTarget.removeEventListener(event, handler4, options); }); } - handler4 = wrapHandler(handler4, (next, e2) => { + handler4 = wrapHandler(handler4, (next, e3) => { if (isKeyEvent(event)) { - if (isListeningForASpecificKeyThatHasntBeenPressed(e2, modifiers)) { + if (isListeningForASpecificKeyThatHasntBeenPressed(e3, modifiers)) { return; } } - next(e2); + next(e3); }); listenerTarget.addEventListener(event, handler4, options); return () => { listenerTarget.removeEventListener(event, handler4, options); }; @@ -9600,13 +9727,13 @@ 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); + 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); } @@ -9614,23 +9741,23 @@ let debounceIndex = keyModifiers.indexOf("throttle"); keyModifiers.splice(debounceIndex, isNumeric((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])) + 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((i2) => !selectedSystemKeyModifiers.includes(i2)); + keyModifiers = keyModifiers.filter((i3) => !selectedSystemKeyModifiers.includes(i3)); if (selectedSystemKeyModifiers.length > 0) { const activelyPressedKeyModifiers = selectedSystemKeyModifiers.filter((modifier) => { if (modifier === "cmd" || modifier === "super") modifier = "meta"; - return e2[`${modifier}Key`]; + return e3[`${modifier}Key`]; }); if (activelyPressedKeyModifiers.length === selectedSystemKeyModifiers.length) { - if (keyToModifiers(e2.key).includes(keyModifiers[0])) + if (keyToModifiers(e3.key).includes(keyModifiers[0])) return false; } } return true; } @@ -9698,12 +9825,12 @@ 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())); + } : 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, {})); } @@ -9711,11 +9838,11 @@ 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", [], (e2) => { + let removeResetListener = on(el.form, "reset", [], (e3) => { nextTick(() => el._x_model && el._x_model.set(el.value)); }); cleanup2(() => removeResetListener()); } el._x_model = { @@ -9930,15 +10057,15 @@ delete el._x_prevKeys; delete el._x_lookup; }); }); function loop(el, iteratorNames, evaluateItems, evaluateKey) { - let isObject22 = (i2) => typeof i2 === "object" && !Array.isArray(i2); + 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(), (i2) => i2 + 1); + items = Array.from(Array(items).keys(), (i3) => i3 + 1); } if (items === void 0) items = []; let lookup = el._x_lookup; let prevKeys = el._x_prevKeys; @@ -9949,55 +10076,55 @@ let scope2 = getIterationScopeVariables(iteratorNames, value, key, items); evaluateKey((value2) => keys.push(value2), { scope: __spreadValues({ 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: __spreadValues({ index: i2 }, scope2) }); + 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); } } let adds = []; let moves = []; let removes = []; let sames = []; - for (let i2 = 0; i2 < prevKeys.length; i2++) { - let key = prevKeys[i2]; + for (let i3 = 0; i3 < prevKeys.length; i3++) { + let key = prevKeys[i3]; 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]; + for (let i3 = 0; i3 < keys.length; i3++) { + let key = keys[i3]; 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]; + 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(i2, 0, keyForSpot); + prevKeys.splice(i3, 0, keyForSpot); prevKeys.splice(prevIndex, 0, keyInSpot); moves.push([keyInSpot, keyForSpot]); } else { sames.push(key); } lastKey = key; } - for (let i2 = 0; i2 < removes.length; i2++) { - let key = removes[i2]; + for (let i3 = 0; i3 < removes.length; i3++) { + let key = removes[i3]; if (!!lookup[key]._x_effects) { lookup[key]._x_effects.forEach(dequeueJob); } lookup[key].remove(); lookup[key] = null; delete lookup[key]; } - for (let i2 = 0; i2 < moves.length; i2++) { - let [keyInSpot, keyForSpot] = moves[i2]; + 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) @@ -10009,12 +10136,12 @@ 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]; + 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]; @@ -10033,12 +10160,12 @@ if (typeof key === "object") { warn("x-for key cannot be an object, it must be a string or an integer", templateEl); } lookup[key] = clone2; } - for (let i2 = 0; i2 < sames.length; i2++) { - lookup[sames[i2]]._x_refreshXForScope(scopes[keys.indexOf(sames[i2])]); + for (let i3 = 0; i3 < sames.length; i3++) { + lookup[sames[i3]]._x_refreshXForScope(scopes[keys.indexOf(sames[i3])]); } templateEl._x_prevKeys = keys; }); } function parseForExpression(expression) { @@ -10064,16 +10191,16 @@ 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]; + 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((i2) => i2.trim()); + let names = iteratorNames.item.replace("{", "").replace("}", "").split(",").map((i3) => i3.trim()); names.forEach((name) => { scopeVariables[name] = item[name]; }); } else { scopeVariables[iteratorNames.item] = item; @@ -10145,13 +10272,13 @@ 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) => { + let removeListener = on(el, value, modifiers, (e3) => { evaluate2(() => { - }, { scope: { "$event": e2 }, params: [e2] }); + }, { scope: { "$event": e3 }, params: [e3] }); }); cleanup2(() => removeListener()); })); warnMissingPluginDirective("Collapse", "collapse", "collapse"); warnMissingPluginDirective("Intersect", "intersect", "intersect"); @@ -10233,19 +10360,19 @@ 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; + for (let i3 = domAttributes.length - 1; i3 >= 0; i3--) { + let name = domAttributes[i3].name; if (!to.hasAttribute(name)) { from2.removeAttribute(name); } } - for (let i2 = toAttributes.length - 1; i2 >= 0; i2--) { - let name = toAttributes[i2].name; - let value = toAttributes[i2].value; + 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); } } } @@ -10503,14 +10630,14 @@ el._x_doHide = () => { }; }; function collapse(el, { modifiers }) { let duration = modifierValue2(modifiers, "duration", 250) / 1e3; - let floor = modifierValue2(modifiers, "min", 0); + let floor2 = modifierValue2(modifiers, "min", 0); let fullyHide = !modifiers.includes("min"); if (!el._x_isShown) - el.style.height = `${floor}px`; + 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) => { @@ -10533,11 +10660,11 @@ el.style.display = null; let current = el.getBoundingClientRect().height; el.style.height = "auto"; let full = el.getBoundingClientRect().height; if (current === full) { - current = floor; + current = floor2; } Alpine3.transition(el, Alpine3.setStyles, { during: transitionStyles, start: { height: current + "px" }, end: { height: full + "px" } @@ -10552,14 +10679,14 @@ }) { let full = el.getBoundingClientRect().height; Alpine3.transition(el, setFunction, { during: transitionStyles, start: { height: full + "px" }, - end: { height: floor + "px" } + end: { height: floor2 + "px" } }, () => el.style.overflow = "hidden", () => { el._x_isShown = false; - if (el.style.height == `${floor}px` && fullyHide) { + if (el.style.height == `${floor2}px` && fullyHide) { el.style.display = "none"; el.hidden = true; } }); } @@ -10631,14 +10758,14 @@ const fallback = "0px 0px 0px 0px"; const index = modifiers.indexOf(key); if (index === -1) return fallback; let values = []; - for (let i2 = 1; i2 < 5; i2++) { - values.push(getLengthValue(modifiers[index + i2] || "")); + for (let i3 = 1; i3 < 5; i3++) { + values.push(getLengthValue(modifiers[index + i3] || "")); } - values = values.filter((v2) => v2 !== void 0); + 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 @@ -10722,28 +10849,28 @@ "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]; + for (let i3 = 0; i3 < template.length; i3++) { + if (["9", "a", "*"].includes(template[i3])) { + wildcardTemplate += template[i3]; continue; } - for (let j2 = 0; j2 < inputToBeStripped.length; j2++) { - if (inputToBeStripped[j2] === template[i2]) { - inputToBeStripped = inputToBeStripped.slice(0, j2) + inputToBeStripped.slice(j2 + 1); + for (let j3 = 0; j3 < inputToBeStripped.length; j3++) { + if (inputToBeStripped[j3] === template[i3]) { + inputToBeStripped = inputToBeStripped.slice(0, j3) + inputToBeStripped.slice(j3 + 1); break; } } } - for (let i2 = 0; i2 < wildcardTemplate.length; i2++) { + for (let i3 = 0; i3 < wildcardTemplate.length; i3++) { 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); + 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) @@ -10752,13 +10879,13 @@ return output; } function buildUp(template, input) { let clean2 = Array.from(input); let output = ""; - for (let i2 = 0; i2 < template.length; i2++) { - if (!["9", "a", "*"].includes(template[i2])) { - output += template[i2]; + 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(); @@ -10774,18 +10901,18 @@ thousands = delimiter === "," ? "." : ","; } let addThousands = (input2, thousands2) => { let output = ""; let counter = 0; - for (let i2 = input2.length - 1; i2 >= 0; i2--) { - if (input2[i2] === thousands2) + for (let i3 = input2.length - 1; i3 >= 0; i3--) { + if (input2[i3] === thousands2) continue; if (counter === 3) { - output = input2[i2] + thousands2 + output; + output = input2[i3] + thousands2 + output; counter = 0; } else { - output = input2[i2] + output; + output = input2[i3] + output; } counter++; } return output; }; @@ -10873,29 +11000,29 @@ return 0; } } return node.tabIndex; }; - var sortOrderedTabbables = function sortOrderedTabbables2(a2, b2) { - return a2.tabIndex === b2.tabIndex ? a2.documentOrder - b2.documentOrder : a2.tabIndex - b2.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 r2 = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { + var r3 = node.tagName === "DETAILS" && Array.prototype.slice.apply(node.children).some(function(child) { return child.tagName === "SUMMARY"; }); - return r2; + return r3; }; 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]; + for (var i3 = 0; i3 < nodes.length; i3++) { + if (nodes[i3].checked && nodes[i3].form === form) { + return nodes[i3]; } } }; var isTabbableRadio = function isTabbableRadio2(node) { if (!node.name) { @@ -10970,12 +11097,12 @@ 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); + 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; @@ -11006,20 +11133,20 @@ return false; }; var sortByOrder = function sortByOrder2(candidates) { var regularTabbables = []; var orderedTabbables = []; - candidates.forEach(function(item, i2) { + 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); } else { orderedTabbables.push({ - documentOrder: i2, + documentOrder: i3, tabIndex: candidateTabindex, item, isScope, content: elements }); @@ -11089,13 +11216,13 @@ })), keys.push.apply(keys, symbols); } return keys; } function _objectSpread2(target) { - for (var i2 = 1; i2 < arguments.length; i2++) { - var source = null != arguments[i2] ? arguments[i2] : {}; - i2 % 2 ? ownKeys2(Object(source), true).forEach(function(key) { + 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)); }); } @@ -11144,24 +11271,24 @@ }; }(); 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 isEscapeEvent = function isEscapeEvent2(e3) { + return e3.key === "Escape" || e3.key === "Esc" || e3.keyCode === 27; }; - var isTabEvent = function isTabEvent2(e2) { - return e2.key === "Tab" || e2.keyCode === 9; + 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, i2) { + arr.every(function(value, i3) { if (fn3(value)) { - idx = i2; + idx = i3; return false; } return true; }); return idx; @@ -11293,23 +11420,23 @@ * 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; + var nodeIdx = focusableNodes.findIndex(function(n3) { + return n3 === node; }); if (nodeIdx < 0) { return void 0; } if (forward) { - return focusableNodes.slice(nodeIdx + 1).find(function(n2) { - return isTabbable(n2, config.tabbableOptions); + return focusableNodes.slice(nodeIdx + 1).find(function(n3) { + return isTabbable(n3, config.tabbableOptions); }); } - return focusableNodes.slice(0, nodeIdx).reverse().find(function(n2) { - return isTabbable(n2, config.tabbableOptions); + return focusableNodes.slice(0, nodeIdx).reverse().find(function(n3) { + return isTabbable(n3, config.tabbableOptions); }); } }; }); state.tabbableGroups = state.containerGroups.filter(function(group) { @@ -11340,16 +11467,16 @@ }; 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); + var checkPointerDown = function checkPointerDown2(e3) { + var target = getActualTarget(e3); if (findContainerIndex(target) >= 0) { return; } - if (valueOrHandler(config.clickOutsideDeactivates, e2)) { + 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; @@ -11362,41 +11489,41 @@ // on activation (or the configured `setReturnFocus` node) returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions) }); return; } - if (valueOrHandler(config.allowOutsideClick, e2)) { + if (valueOrHandler(config.allowOutsideClick, e3)) { return; } - e2.preventDefault(); + e3.preventDefault(); }; - var checkFocusIn = function checkFocusIn2(e2) { - var target = getActualTarget(e2); + var checkFocusIn = function checkFocusIn2(e3) { + var target = getActualTarget(e3); var targetContained = findContainerIndex(target) >= 0; if (targetContained || target instanceof Document) { if (targetContained) { state.mostRecentlyFocusedNode = target; } } else { - e2.stopImmediatePropagation(); + e3.stopImmediatePropagation(); tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode()); } }; - var checkTab = function checkTab2(e2) { - var target = getActualTarget(e2); + 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 (e2.shiftKey) { + if (e3.shiftKey) { destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode; } else { destinationNode = state.tabbableGroups[0].firstTabbableNode; } - } else if (e2.shiftKey) { + } 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))) { @@ -11423,38 +11550,38 @@ } } else { destinationNode = getNodeForOption("fallbackFocus"); } if (destinationNode) { - e2.preventDefault(); + e3.preventDefault(); tryFocus(destinationNode); } }; - var checkKey = function checkKey2(e2) { - if (isEscapeEvent(e2) && valueOrHandler(config.escapeDeactivates, e2) !== false) { - e2.preventDefault(); + var checkKey = function checkKey2(e3) { + if (isEscapeEvent(e3) && valueOrHandler(config.escapeDeactivates, e3) !== false) { + e3.preventDefault(); trap.deactivate(); return; } - if (isTabEvent(e2)) { - checkTab(e2); + if (isTabEvent(e3)) { + checkTab(e3); return; } }; - var checkClick = function checkClick2(e2) { - var target = getActualTarget(e2); + var checkClick = function checkClick2(e3) { + var target = getActualTarget(e3); if (findContainerIndex(target) >= 0) { return; } - if (valueOrHandler(config.clickOutsideDeactivates, e2)) { + if (valueOrHandler(config.clickOutsideDeactivates, e3)) { return; } - if (valueOrHandler(config.allowOutsideClick, e2)) { + if (valueOrHandler(config.allowOutsideClick, e3)) { return; } - e2.preventDefault(); - e2.stopImmediatePropagation(); + e3.preventDefault(); + e3.stopImmediatePropagation(); }; var addListeners = function addListeners2() { if (!state.active) { return; } @@ -11802,41 +11929,10 @@ document.documentElement.style.paddingRight = paddingRight; }; } var module_default6 = src_default6; - // 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; - } - } - } - 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; - } - // helpers/lang.js function nameFunction(name, body) { return { [name](...args) { return body.apply(this, args); @@ -11864,19 +11960,19 @@ 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]); + for (var i3 in value) { + stack.push(value[i3]); } } } return bytes; } - // libs/alpine/directives/undo.js + // 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({ @@ -11942,11 +12038,11 @@ }); setData(el, { history }); }); } - // libs/alpine/directives/options.js + // base/alpine/directives/options.js var import_lodash = __toESM(require_lodash(), 1); // helpers/dom.js function castAttributeValue(value) { if (value === "false") { @@ -11958,15 +12054,15 @@ if (isNumeric4(value)) { return parseInt(value, 10); } return value; } - function isNode(o2) { - return typeof Node === "object" ? o2 instanceof Node : o2 && typeof o2 === "object" && typeof o2.nodeType === "number" && typeof o2.nodeName === "string"; + function isNode(o3) { + return typeof Node === "object" ? o3 instanceof Node : o3 && typeof o3 === "object" && typeof o3.nodeType === "number" && typeof o3.nodeName === "string"; } - // libs/alpine/directives/options.js + // base/alpine/directives/options.js function options_default(Alpine3) { Alpine3.directive( "options", (el, { expression }, { evaluate: evaluate2, effect: effect7, cleanup: cleanup2 }) => { const optionNames = evaluate2(expression); @@ -12196,23 +12292,23 @@ 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 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: y2, - right: x2 + width, - bottom: y2 + height, - left: x2, - x: x2, - y: y2 + 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) { @@ -12336,12 +12432,12 @@ // ../../../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 v2 = within(min2, value, max2); - return v2 > max2 ? max2 : v2; + var v3 = within(min2, value, max2); + return v3 > max2 ? max2 : v3; } // ../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js function getFreshSideObject() { return { @@ -12438,30 +12534,30 @@ right: "auto", bottom: "auto", left: "auto" }; function roundOffsetsByDPR(_ref, win) { - var x2 = _ref.x, y2 = _ref.y; + var x3 = _ref.x, y3 = _ref.y; var dpr = win.devicePixelRatio || 1; return { - x: round(x2 * dpr) / dpr || 0, - y: round(y2 * dpr) / dpr || 0 + x: round(x3 * dpr) / dpr || 0, + y: round(y3 * dpr) / dpr || 0 }; } 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 _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: x2, - y: y2 + x: x3, + y: y3 }) : { - x: x2, - y: y2 + x: x3, + y: y3 }; - x2 = _ref3.x; - y2 = _ref3.y; + 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; @@ -12481,40 +12577,40 @@ 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; + 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] ); - x2 -= offsetX - popperRect.width; - x2 *= gpuAcceleration ? 1 : -1; + x3 -= offsetX - popperRect.width; + x3 *= gpuAcceleration ? 1 : -1; } } var commonStyles = Object.assign({ position }, adaptive && unsetSides); var _ref4 = roundOffsets === true ? roundOffsetsByDPR({ - x: x2, - y: y2 + x: x3, + y: y3 }, getWindow(popper2)) : { - x: x2, - y: y2 + x: x3, + y: y3 }; - x2 = _ref4.x; - y2 = _ref4.y; + 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(" + x2 + "px, " + y2 + "px)" : "translate3d(" + x2 + "px, " + y2 + "px, 0)", _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)); } - return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y2 + "px" : "", _Object$assign2[sideX] = hasX ? x2 + "px" : "", _Object$assign2.transform = "", _Object$assign2)); + 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 = { @@ -12636,26 +12732,26 @@ 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; + var x3 = 0; + var y3 = 0; if (visualViewport) { width = visualViewport.width; height = visualViewport.height; var layoutViewport = isLayoutViewport(); if (layoutViewport || !layoutViewport && strategy === "fixed") { - x2 = visualViewport.offsetLeft; - y2 = visualViewport.offsetTop; + x3 = visualViewport.offsetLeft; + y3 = visualViewport.offsetTop; } } return { width, height, - x: x2 + getWindowScrollBarX(element), - y: y2 + x: x3 + getWindowScrollBarX(element), + y: y3 }; } // ../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js function getDocumentRect(element) { @@ -12663,20 +12759,20 @@ 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; + var x3 = -winScroll.scrollLeft + getWindowScrollBarX(element); + var y3 = -winScroll.scrollTop; if (getComputedStyle2(body || html).direction === "rtl") { - x2 += max(html.clientWidth, body ? body.clientWidth : 0) - width; + x3 += max(html.clientWidth, body ? body.clientWidth : 0) - width; } return { width, height, - x: x2, - y: y2 + x: x3, + y: y3 }; } // ../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js function isScrollParent(element) { @@ -12884,12 +12980,12 @@ rootBoundary, padding })[getBasePlacement(placement2)]; return acc; }, {}); - return Object.keys(overflows).sort(function(a2, b2) { - return overflows[a2] - overflows[b2]; + return Object.keys(overflows).sort(function(a3, b3) { + return overflows[a3] - overflows[b3]; }); } // ../../../node_modules/@popperjs/core/lib/modifiers/flip.js function getExpandedFallbackPlacements(placement) { @@ -12922,12 +13018,12 @@ 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]; + 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"; var overflow = detectOverflow(state, { @@ -13073,14 +13169,14 @@ 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], x2 = _data$state$placement.x, y2 = _data$state$placement.y; + 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 += x2; - state.modifiersData.popperOffsets.y += y2; + state.modifiersData.popperOffsets.x += x3; + state.modifiersData.popperOffsets.y += y3; } state.modifiersData[name] = data2; } var offset_default = { name: "offset", @@ -13381,12 +13477,12 @@ 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; + 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 @@ -13498,12 +13594,12 @@ function hasOwnProperty2(obj, key) { return {}.hasOwnProperty.call(obj, key); } function getValueAtIndexOrReturn(value, index, defaultValue) { if (Array.isArray(value)) { - var v2 = value[index]; - return v2 == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v2; + var v3 = value[index]; + return v3 == null ? Array.isArray(defaultValue) ? defaultValue[index] : defaultValue : v3; } return value; } function isType(value, type) { var str = {}.toString.call(value); @@ -13836,11 +13932,11 @@ if (key === "content") { acc[key] = valueAsString; } else { try { acc[key] = JSON.parse(valueAsString); - } catch (e2) { + } catch (e3) { acc[key] = valueAsString; } } return acc; }, {}); @@ -14682,12 +14778,12 @@ nestedPopper._tippy.unmount(); }); if (popper2.parentNode) { popper2.parentNode.removeChild(popper2); } - mountedInstances = mountedInstances.filter(function(i2) { - return i2 !== instance; + mountedInstances = mountedInstances.filter(function(i3) { + return i3 !== instance; }); instance.state.isMounted = false; invokeHook("onHidden", [instance]); } function destroy() { @@ -14996,20 +15092,20 @@ if (isCursorOverReference || !instance.props.interactive) { instance.setProps({ // @ts-ignore - unneeded DOMRect properties getReferenceClientRect: function getReferenceClientRect() { var rect2 = reference2.getBoundingClientRect(); - var x2 = clientX; - var y2 = clientY; + var x3 = clientX; + var y3 = clientY; if (followCursor2 === "initial") { - x2 = rect2.left + relativeX; - y2 = rect2.top + relativeY; + x3 = rect2.left + relativeX; + y3 = rect2.top + relativeY; } - var top2 = followCursor2 === "horizontal" ? rect2.top : y2; - var right2 = followCursor2 === "vertical" ? rect2.right : x2; - var bottom2 = followCursor2 === "horizontal" ? rect2.bottom : y2; - var left2 = followCursor2 === "vertical" ? rect2.left : x2; + 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, @@ -15043,11 +15139,11 @@ onCreate: create, onDestroy: destroy, onBeforeUpdate: function onBeforeUpdate2() { prevProps = instance.props; }, - onAfterUpdate: function onAfterUpdate2(_2, _ref2) { + onAfterUpdate: function onAfterUpdate2(_3, _ref2) { var followCursor2 = _ref2.followCursor; if (isInternalUpdate) { return; } if (followCursor2 !== void 0 && prevProps.followCursor !== followCursor2) { @@ -15072,11 +15168,11 @@ if (!getIsInitialBehavior()) { addListener(); } } }, - onTrigger: function onTrigger2(_2, event) { + onTrigger: function onTrigger2(_3, event) { if (isMouseEvent(event)) { mouseCoords = { clientX: event.clientX, clientY: event.clientY }; @@ -15096,11 +15192,11 @@ tippy.setDefaultProps({ render }); var tippy_esm_default = tippy; - // libs/tippy/plugins/hide_on_esc.js + // base/tippy/plugins/hide_on_esc.js var hide_on_esc_default = hideOnEsc = { name: "hideOnEsc", defaultValue: true, fn({ hide: hide2 }) { function onKeyDown(event) { @@ -15117,20 +15213,20 @@ } }; } }; - // libs/tippy/index.js + // 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; - // libs/alpine/utils/tippy_modifiers.js + // base/alpine/utils/tippy_modifiers.js function tippyModifiers(modifiers) { if (modifiers.length === 0) return {}; const config = { plugins: [] @@ -15141,11 +15237,11 @@ if (modifiers.includes("duration")) { config.duration = parseInt(getModifierArgument("duration")); } if (modifiers.includes("delay")) { const delay3 = getModifierArgument("delay"); - config.delay = delay3.includes("-") ? delay3.split("-").map((n2) => parseInt(n2)) : parseInt(delay3); + 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")) { @@ -15155,11 +15251,11 @@ config.placement = getModifierArgument("placement"); } return config; } - // libs/alpine/directives/tooltip.js + // 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); @@ -15211,22 +15307,22 @@ }); } ).before("bind"); } - // libs/alpine/directives/destroy.js + // base/alpine/directives/destroy.js function destroy_default(Alpine3) { Alpine3.directive( "destroy", (el, { expression }, { evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { const clean2 = evaluateLater2(expression); cleanup2(() => clean2()); } ); } - // libs/alpine/directives/dropdown.js + // base/alpine/directives/dropdown.js function dropdown_default(Alpine3) { Alpine3.directive( "dropdown", (el, { value, modifiers, expression }, { evaluate: evaluate2, effect: effect7 }) => { if (value) @@ -15283,11 +15379,11 @@ } } ).before("bind"); } - // libs/alpine/directives/dimensions.js + // base/alpine/directives/dimensions.js function dimensions_default(Alpine3) { Alpine3.directive( "dimensions", (el, { value, modifiers, expression }, { evaluateLater: evaluateLater2, cleanup: cleanup2 }) => { if (value) @@ -15320,11 +15416,11 @@ }); } ); } - // libs/alpine/directives/notification.js + // base/alpine/directives/notification.js function notification_default(Alpine3) { let notificationId = 0; let queuePosition = 0; Alpine3.directive("notification", (el, { expression }, { evaluate: evaluate2 }) => { notificationId++; @@ -15395,11 +15491,11 @@ setData(el, { notification }); evaluate2("notification.init"); }).before("init"); } - // libs/alpine/index.js + // 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); @@ -15411,17 +15507,20 @@ module_default.plugin(dropdown_default); module_default.plugin(dimensions_default); module_default.plugin(notification_default); var alpine_default2 = module_default; - // ../../components/coco/shared/button/button.js + // 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 }); - // shared/coco.js + // base/coco.js function CocoComponent(name, fn3) { const func = nameFunction(name, (...args) => { const data2 = fn3(...args); Object.defineProperties(data2, { $parent: { @@ -15435,11 +15534,11 @@ }); func.component = true; return func; } - // ../../components/coco/shared/button/button.js + // ../../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, @@ -15575,11 +15674,11 @@ ":disabled": "disabled" } }); }); - // ../../components/coco/shared/button/button_dropdown.js + // ../../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", () => { @@ -15609,11 +15708,11 @@ "@confirmation:cancel": "button.cancelConfirmation($event)" } }; }); - // ../../components/coco/shared/button_group/button_group.js + // ../../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", () => { @@ -15658,11 +15757,11 @@ this.destroySingletonTooltip(); this.tooltipInstances = this.buttons.map((button) => { if (button.tippyInstance && button.shouldShowTooltip && button.shouldShowTooltip()) { return button.tippyInstance; } - }).filter((t2) => t2); + }).filter((t3) => t3); this.singletonTooltip = createSingleton(this.tooltipInstances, { theme: "coco-tooltip", delay: 100, moveTransition: "transform 0.1s ease-out" }); @@ -15699,20 +15798,179 @@ } } }; }); - // ../../components/coco/shared/dropdown/dropdown.js - var dropdown_exports = {}; - __export(dropdown_exports, { - default: () => dropdown_default2 + // ../../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 dropdown_default2 = CocoComponent("dropdown", () => { + 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); + } + }; + }); + + // ../../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"); + } + }; + }); + + // ../../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); + } + }; + }); + + // ../../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()); + } + }; + }); + + // ../../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/shared/icon/icon.js + // ../../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 + ); + } + 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; + }); + } + }; + }); + + // ../../components/coco/images/icon/icon.js var icon_exports = {}; __export(icon_exports, { default: () => icon_default }); var icon_default = CocoComponent("icon", () => { @@ -15734,11 +15992,11 @@ "x-options": "options" } }; }); - // ../../components/coco/shared/image_uploader/image_uploader.js + // ../../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 }) => { @@ -15807,11 +16065,264 @@ reader.readAsDataURL(file); } }; }); - // ../../components/coco/shared/modal/modal.js + // ../../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 + }); + 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; + }); + } + }, + root: { + "x-options": '["dismissable", "singleLine", "dismissAfterAction"]', + ":class": "{'force-multi-line': forceMultiLine}" + } + }; + }); + + // ../../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]; + } + } + return target; + } + 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 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; + } + function get3(name) { + if (typeof document === "undefined" || arguments.length && !name) { + return; + } + 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; + } + } catch (e3) { + } + } + return name ? jar[name] : jar; + } + 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) } + } + ); + } + 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" + } + }; + }); + + // ../../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 }); @@ -15824,11 +16335,11 @@ } else { location.assign(url); } } - // ../../components/coco/shared/modal/modal.js + // ../../components/coco/modals/modal/modal.js var modal_default = CocoComponent("modal", () => { return { open: false, frame: null, modal: null, @@ -15910,11 +16421,11 @@ "x-transition:leave-end": "container-leave-end" } }; }); - // ../../components/coco/shared/modal_dialog/modal_dialog.js + // ../../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", () => { @@ -15944,11 +16455,11 @@ ); } }; }); - // ../../components/coco/shared/modal_lightbox/modal_lightbox.js + // ../../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", () => { @@ -15978,11 +16489,1884 @@ ":class": "{loaded}" } }; }); - // ../../components/coco/shared/poll_controller/poll_controller.js + // ../../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]; + } + return n3; + } + function a2(n3) { + var l2 = n3.parentNode; + l2 && l2.removeChild(n3); + } + 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 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 d2(n3) { + return n3.children; + } + 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 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; + } + 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); + } + } + 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 { + 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; + } + } + 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); + } + } + return h3++, u4; + }), l2.__e = m3, null != r3 && "function" != typeof l2.type) { + for (h3 = r3.length; h3--; ) { + null != r3[h3] && a2(r3[h3]); + } + } + 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]); + } + } + } + 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; + } + function C2(n3, l2, u3, t3, i3) { + var r3; + for (r3 in u3) { + r3 in l2 || N2(n3, r3, null, u3[r3], t3); + } + 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); + } + } + 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 { + 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]); + } + } + } + } 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)); + } + } + 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 { + 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); + } + 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; + } + 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); + } + } + 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; + } + } + } + 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); + } + } + 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 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); + } + function parseUnit(str, max2) { + var isPercentage = str.indexOf("%") > -1; + var num = parseFloat(str); + return isPercentage ? max2 / 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); + } + 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; + } + } 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 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; + } + 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 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; + } + } + }, { + key: "hsva", + get: function get3() { + return _extends({}, this.$); + }, + set: function set3(value) { + this.hsv = value; + } + }, { + key: "hue", + get: function get3() { + return this.$.h; + }, + set: function set3(value) { + this.hsv = { + h: value + }; + } + }, { + key: "saturation", + get: function get3() { + return this.$.s; + }, + set: function set3(value) { + this.hsv = { + s: value + }; + } + }, { + key: "value", + get: function get3() { + return this.$.v; + }, + set: function set3(value) { + this.hsv = { + v: value + }; + } + }, { + key: "alpha", + get: function get3() { + return this.$.a; + }, + set: function set3(value) { + this.hsv = _extends({}, this.hsv, { + a: value + }); + } + }, { + key: "kelvin", + get: function get3() { + return IroColor2.rgbToKelvin(this.rgb); + }, + set: function set3(value) { + this.rgb = IroColor2.kelvinToRgb(value); + } + }, { + key: "red", + get: function get3() { + var rgb = this.rgb; + return rgb.r; + }, + set: function set3(value) { + this.rgb = _extends({}, this.rgb, { + r: value + }); + } + }, { + key: "green", + get: function get3() { + var rgb = this.rgb; + return rgb.g; + }, + set: function set3(value) { + this.rgb = _extends({}, this.rgb, { + g: value + }); + } + }, { + key: "blue", + get: function get3() { + var rgb = this.rgb; + return rgb.b; + }, + set: function set3(value) { + this.rgb = _extends({}, this.rgb, { + b: value + }); + } + }, { + 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 + }); + } + }, { + key: "rgba", + get: function get3() { + return _extends({}, this.rgb, { + a: this.alpha + }); + }, + set: function set3(value) { + this.rgb = value; + } + }, { + 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 + }); + } + }, { + key: "hsla", + get: function get3() { + return _extends({}, this.hsl, { + a: this.alpha + }); + }, + set: function set3(value) { + this.hsl = value; + } + }, { + 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); + } + if (match) { + this.rgb = { + r: r3, + g: g3, + b: b3, + a: a3 + }; + } else { + throw new Error("Invalid rgb string"); + } + } + }, { + 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]); + } + if (match) { + this.rgb = { + r: r3, + g: g3, + b: b3, + a: a3 / 255 + }; + } else { + throw new Error("Invalid hex string"); + } + } + }, { + 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; + } + }, { + 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 + }; + } + } + 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; + } + } + 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; + } + 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; + } + } + 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; + } + 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 + ")"]); + } + 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 + "%)"]]; + } + } + 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; + } + 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"); + } + 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 dist3 = Math.sqrt(dX * dX + dY * dY); + if (dist3 < props.handleRadius) { + return i3; + } + } + 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; + } + 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 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; + } + 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" }) + ); + } + 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); + } + 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 }) + ); + }); + } + 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); + } + 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 }) + ); + }); + } + 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); + } + props.onInput(inputType, props.id); + } + 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); + } + 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.setActiveColor(0); + this.state = Object.assign( + {}, + props, + { + color: this.color, + colors: this.colors, + layout: props.layout + } + ); + } + 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 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] = []; + } + }); + }; + 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(fn3) { + return fn3.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 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 } + ]; + } + 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 + } + ); + 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; + } + } + 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(); + } + }; + }); + + // ../../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(); + } + }; + }); + + // ../../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", () => { @@ -16042,25 +18426,51 @@ if (headers) { headers.Accept = ["text/vnd.turbo-stream.html", headers.Accept].join(", "); } } - // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/shared|@sharedComponents/**/*.js - var modules = [button_exports, button_dropdown_exports, button_group_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports]; + // ../../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; - // shared/components.js - var components_default = registerComponents(__default); - - // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/book|@bookComponents/**/*.js - var modules2 = []; - var __default2 = modules2; - - // book/components.js - var components_default2 = registerComponents(__default2); - // book.js + registerComponents(__default); alpine_default2.start(); })(); /*! Bundled license information: lodash/lodash.js: @@ -16086,6 +18496,17 @@ (*! * 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: + (*! + * iro.js v5.5.2 + * 2016-2021 James Daniel + * Licensed under MPL 2.0 + * github.com/jaames/iro.js + *) */