public/lookbook-assets/js/index.js in lookbook-2.0.0.beta.4 vs public/lookbook-assets/js/index.js in lookbook-2.0.0.beta.5

- old
+ new

@@ -10,32 +10,37 @@ } // packages/alpinejs/src/scheduler.js var $caa9439642c6336c$var$flushPending = false; var $caa9439642c6336c$var$flushing = false; var $caa9439642c6336c$var$queue = []; +var $caa9439642c6336c$var$lastFlushedIndex = -1; function $caa9439642c6336c$var$scheduler(callback) { $caa9439642c6336c$var$queueJob(callback); } function $caa9439642c6336c$var$queueJob(job) { if (!$caa9439642c6336c$var$queue.includes(job)) $caa9439642c6336c$var$queue.push(job); $caa9439642c6336c$var$queueFlush(); } function $caa9439642c6336c$var$dequeueJob(job) { let index = $caa9439642c6336c$var$queue.indexOf(job); - if (index !== -1) $caa9439642c6336c$var$queue.splice(index, 1); + if (index !== -1 && index > $caa9439642c6336c$var$lastFlushedIndex) $caa9439642c6336c$var$queue.splice(index, 1); } function $caa9439642c6336c$var$queueFlush() { if (!$caa9439642c6336c$var$flushing && !$caa9439642c6336c$var$flushPending) { $caa9439642c6336c$var$flushPending = true; queueMicrotask($caa9439642c6336c$var$flushJobs); } } function $caa9439642c6336c$var$flushJobs() { $caa9439642c6336c$var$flushPending = false; $caa9439642c6336c$var$flushing = true; - for(let i = 0; i < $caa9439642c6336c$var$queue.length; i++)$caa9439642c6336c$var$queue[i](); + for(let i = 0; i < $caa9439642c6336c$var$queue.length; i++){ + $caa9439642c6336c$var$queue[i](); + $caa9439642c6336c$var$lastFlushedIndex = i; + } $caa9439642c6336c$var$queue.length = 0; + $caa9439642c6336c$var$lastFlushedIndex = -1; $caa9439642c6336c$var$flushing = false; } // packages/alpinejs/src/reactivity.js var $caa9439642c6336c$var$reactive; var $caa9439642c6336c$var$effect; @@ -64,11 +69,11 @@ function $caa9439642c6336c$var$elementBoundEffect(el) { let cleanup2 = ()=>{}; let wrappedEffect = (callback)=>{ let effectReference = $caa9439642c6336c$var$effect(callback); if (!el._x_effects) { - el._x_effects = new Set(); + el._x_effects = /* @__PURE__ */ new Set(); el._x_runEffects = ()=>{ el._x_effects.forEach((i)=>i()); }; } el._x_effects.add(effectReference); @@ -173,12 +178,12 @@ $caa9439642c6336c$var$deferredMutations = $caa9439642c6336c$var$deferredMutations.concat(mutations); return; } let addedNodes = []; let removedNodes = []; - let addedAttributes = new Map(); - let removedAttributes = new Map(); + let addedAttributes = /* @__PURE__ */ new Map(); + let removedAttributes = /* @__PURE__ */ new Map(); for(let i = 0; i < mutations.length; i++){ if (mutations[i].target._x_ignoreMutationObserver) continue; if (mutations[i].type === "childList") { mutations[i].addedNodes.forEach((node)=>node.nodeType === 1 && addedNodes.push(node)); mutations[i].removedNodes.forEach((node)=>node.nodeType === 1 && removedNodes.push(node)); @@ -420,12 +425,11 @@ $caa9439642c6336c$var$injectMagics(overriddenMagics, el); let dataStack = [ overriddenMagics, ...$caa9439642c6336c$var$closestDataStack(el) ]; - if (typeof expression === "function") return $caa9439642c6336c$var$generateEvaluatorFromFunction(dataStack, expression); - let evaluator = $caa9439642c6336c$var$generateEvaluatorFromString(dataStack, expression, el); + let evaluator = typeof expression === "function" ? $caa9439642c6336c$var$generateEvaluatorFromFunction(dataStack, expression) : $caa9439642c6336c$var$generateEvaluatorFromString(dataStack, expression, el); return $caa9439642c6336c$var$tryCatch.bind(null, el, expression, evaluator); } function $caa9439642c6336c$var$generateEvaluatorFromFunction(dataStack, func) { return (receiver = ()=>{}, { scope: scope2 = {} , params: params = [] } = {})=>{ let result = func.apply($caa9439642c6336c$var$mergeProxies([ @@ -498,12 +502,12 @@ before (directive2) { if (!$caa9439642c6336c$var$directiveHandlers[directive2]) { console.warn("Cannot find directive `${directive}`. `${name}` will use the default order of execution"); return; } - const pos = $caa9439642c6336c$var$directiveOrder.indexOf(directive2) ?? $caa9439642c6336c$var$directiveOrder.indexOf("DEFAULT"); - if (pos >= 0) $caa9439642c6336c$var$directiveOrder.splice(pos, 0, name); + const pos = $caa9439642c6336c$var$directiveOrder.indexOf(directive2); + $caa9439642c6336c$var$directiveOrder.splice(pos >= 0 ? pos : $caa9439642c6336c$var$directiveOrder.indexOf("DEFAULT"), 0, name); } }; } function $caa9439642c6336c$var$directives(el, attributes, originalAttributeOverride) { attributes = Array.from(attributes); @@ -530,11 +534,11 @@ } function $caa9439642c6336c$var$attributesOnly(attributes) { return Array.from(attributes).map($caa9439642c6336c$var$toTransformedAttributes()).filter((attr)=>!$caa9439642c6336c$var$outNonAlpineAttributes(attr)); } var $caa9439642c6336c$var$isDeferringHandlers = false; -var $caa9439642c6336c$var$directiveHandlerStacks = new Map(); +var $caa9439642c6336c$var$directiveHandlerStacks = /* @__PURE__ */ new Map(); var $caa9439642c6336c$var$currentHandlerStackKey = Symbol(); function $caa9439642c6336c$var$deferHandlingDirectives(callback) { $caa9439642c6336c$var$isDeferringHandlers = true; let key = Symbol(); $caa9439642c6336c$var$currentHandlerStackKey = key; @@ -632,21 +636,13 @@ var $caa9439642c6336c$var$directiveOrder = [ "ignore", "ref", "data", "id", - "radio", - "tabs", - "switch", - "disclosure", - "menu", - "listbox", - "combobox", "bind", "init", "for", - "mask", "model", "modelable", "transition", "show", "if", @@ -661,10 +657,11 @@ // packages/alpinejs/src/utils/dispatch.js function $caa9439642c6336c$var$dispatch(el, name, detail = {}) { el.dispatchEvent(new CustomEvent(name, { detail: detail, bubbles: true, + // Allows events to pass the shadow DOM barrier. composed: true, cancelable: true })); } // packages/alpinejs/src/utils/walk.js @@ -861,20 +858,20 @@ else $caa9439642c6336c$var$registerTransitionsFromClassString(el, expression, value); }); function $caa9439642c6336c$var$registerTransitionsFromClassString(el, classString, stage) { $caa9439642c6336c$var$registerTransitionObject(el, $caa9439642c6336c$var$setClasses, ""); let directiveStorageMap = { - enter: (classes)=>{ + "enter": (classes)=>{ el._x_transition.enter.during = classes; }, "enter-start": (classes)=>{ el._x_transition.enter.start = classes; }, "enter-end": (classes)=>{ el._x_transition.enter.end = classes; }, - leave: (classes)=>{ + "leave": (classes)=>{ el._x_transition.leave.during = classes; }, "leave-start": (classes)=>{ el._x_transition.leave.start = classes; }, @@ -1386,11 +1383,11 @@ return $caa9439642c6336c$var$effect; }, get raw () { return $caa9439642c6336c$var$raw; }, - version: "3.11.1", + version: "3.12.0", flushAndStopDeferringMutations: $caa9439642c6336c$var$flushAndStopDeferringMutations, dontAutoEvaluateFunctions: $caa9439642c6336c$var$dontAutoEvaluateFunctions, disableEffectScheduling: $caa9439642c6336c$var$disableEffectScheduling, startObservingMutations: $caa9439642c6336c$var$startObservingMutations, stopObservingMutations: $caa9439642c6336c$var$stopObservingMutations, @@ -1409,13 +1406,16 @@ mergeProxies: $caa9439642c6336c$var$mergeProxies, findClosest: $caa9439642c6336c$var$findClosest, closestRoot: $caa9439642c6336c$var$closestRoot, destroyTree: $caa9439642c6336c$var$destroyTree, interceptor: $caa9439642c6336c$var$interceptor, - transition: $caa9439642c6336c$var$transition, - setStyles: $caa9439642c6336c$var$setStyles, - mutateDom: $caa9439642c6336c$var$mutateDom, + transition: // INTERNAL: not public API and is subject to change without major release. + $caa9439642c6336c$var$transition, + setStyles: // INTERNAL + $caa9439642c6336c$var$setStyles, + mutateDom: // INTERNAL + $caa9439642c6336c$var$mutateDom, directive: $caa9439642c6336c$var$directive, throttle: $caa9439642c6336c$var$throttle, debounce: $caa9439642c6336c$var$debounce, evaluate: $caa9439642c6336c$var$evaluate, initTree: $caa9439642c6336c$var$initTree, @@ -1434,36 +1434,15 @@ bind: $caa9439642c6336c$var$bind2 }; var $caa9439642c6336c$var$alpine_default = $caa9439642c6336c$var$Alpine; // node_modules/@vue/shared/dist/shared.esm-bundler.js function $caa9439642c6336c$var$makeMap(str, expectsLowerCase) { - const map = Object.create(null); + const map = /* @__PURE__ */ Object.create(null); const list = str.split(","); for(let i = 0; i < list.length; i++)map[list[i]] = true; return expectsLowerCase ? (val)=>!!map[val.toLowerCase()] : (val)=>!!map[val]; } -var $caa9439642c6336c$var$PatchFlagNames = { - [1]: `TEXT`, - [2]: `CLASS`, - [4]: `STYLE`, - [8]: `PROPS`, - [16]: `FULL_PROPS`, - [32]: `HYDRATE_EVENTS`, - [64]: `STABLE_FRAGMENT`, - [128]: `KEYED_FRAGMENT`, - [256]: `UNKEYED_FRAGMENT`, - [512]: `NEED_PATCH`, - [1024]: `DYNAMIC_SLOTS`, - [2048]: `DEV_ROOT_FRAGMENT`, - [-1]: `HOISTED`, - [-2]: `BAIL` -}; -var $caa9439642c6336c$var$slotFlagsText = { - [1]: "STABLE", - [2]: "DYNAMIC", - [3]: "FORWARDED" -}; var $caa9439642c6336c$var$specialBooleanAttrs = `itemscope,allowfullscreen,formnovalidate,ismap,nomodule,novalidate,readonly`; var $caa9439642c6336c$var$isBooleanAttr2 = /* @__PURE__ */ $caa9439642c6336c$var$makeMap($caa9439642c6336c$var$specialBooleanAttrs + `,async,autofocus,autoplay,controls,default,defer,disabled,hidden,loop,open,required,reversed,scoped,seamless,checked,muted,multiple,selected`); var $caa9439642c6336c$var$EMPTY_OBJ = Object.freeze({}); var $caa9439642c6336c$var$EMPTY_ARR = Object.freeze([]); var $caa9439642c6336c$var$extend = Object.assign; @@ -1479,11 +1458,11 @@ var $caa9439642c6336c$var$toRawType = (value)=>{ return $caa9439642c6336c$var$toTypeString(value).slice(8, -1); }; var $caa9439642c6336c$var$isIntegerKey = (key)=>$caa9439642c6336c$var$isString(key) && key !== "NaN" && key[0] !== "-" && "" + parseInt(key, 10) === key; var $caa9439642c6336c$var$cacheStringFunction = (fn)=>{ - const cache = Object.create(null); + const cache = /* @__PURE__ */ Object.create(null); return (str)=>{ const hit = cache[str]; return hit || (cache[str] = fn(str)); }; }; @@ -1495,11 +1474,11 @@ var $caa9439642c6336c$var$hyphenate = $caa9439642c6336c$var$cacheStringFunction((str)=>str.replace($caa9439642c6336c$var$hyphenateRE, "-$1").toLowerCase()); var $caa9439642c6336c$var$capitalize = $caa9439642c6336c$var$cacheStringFunction((str)=>str.charAt(0).toUpperCase() + str.slice(1)); var $caa9439642c6336c$var$toHandlerKey = $caa9439642c6336c$var$cacheStringFunction((str)=>str ? `on${$caa9439642c6336c$var$capitalize(str)}` : ``); var $caa9439642c6336c$var$hasChanged = (value, oldValue)=>value !== oldValue && (value === value || oldValue === oldValue); // node_modules/@vue/reactivity/dist/reactivity.esm-bundler.js -var $caa9439642c6336c$var$targetMap = new WeakMap(); +var $caa9439642c6336c$var$targetMap = /* @__PURE__ */ new WeakMap(); var $caa9439642c6336c$var$effectStack = []; var $caa9439642c6336c$var$activeEffect; var $caa9439642c6336c$var$ITERATE_KEY = Symbol("iterate"); var $caa9439642c6336c$var$MAP_KEY_ITERATE_KEY = Symbol("Map key iterate"); function $caa9439642c6336c$var$isEffect(fn) { @@ -1567,13 +1546,13 @@ $caa9439642c6336c$var$shouldTrack = last === void 0 ? true : last; } function $caa9439642c6336c$var$track(target, type, key) { if (!$caa9439642c6336c$var$shouldTrack || $caa9439642c6336c$var$activeEffect === void 0) return; let depsMap = $caa9439642c6336c$var$targetMap.get(target); - if (!depsMap) $caa9439642c6336c$var$targetMap.set(target, depsMap = new Map()); + if (!depsMap) $caa9439642c6336c$var$targetMap.set(target, depsMap = /* @__PURE__ */ new Map()); let dep = depsMap.get(key); - if (!dep) depsMap.set(key, dep = new Set()); + if (!dep) depsMap.set(key, dep = /* @__PURE__ */ new Set()); if (!dep.has($caa9439642c6336c$var$activeEffect)) { dep.add($caa9439642c6336c$var$activeEffect); $caa9439642c6336c$var$activeEffect.deps.push(dep); if ($caa9439642c6336c$var$activeEffect.options.onTrack) $caa9439642c6336c$var$activeEffect.options.onTrack({ effect: $caa9439642c6336c$var$activeEffect, @@ -1584,11 +1563,11 @@ } } function $caa9439642c6336c$var$trigger(target, type, key, newValue, oldValue, oldTarget) { const depsMap = $caa9439642c6336c$var$targetMap.get(target); if (!depsMap) return; - const effects = new Set(); + const effects = /* @__PURE__ */ new Set(); const add2 = (effectsToAdd)=>{ if (effectsToAdd) effectsToAdd.forEach((effect3)=>{ if (effect3 !== $caa9439642c6336c$var$activeEffect || effect3.allowRecurse) effects.add(effect3); }); }; @@ -1846,10 +1825,11 @@ const isKeyOnly = method === "keys" && targetIsMap; const innerIterator = target[method](...args); const wrap = isShallow ? $caa9439642c6336c$var$toShallow : isReadonly ? $caa9439642c6336c$var$toReadonly : $caa9439642c6336c$var$toReactive; !isReadonly && $caa9439642c6336c$var$track(rawTarget, "iterate", isKeyOnly ? $caa9439642c6336c$var$MAP_KEY_ITERATE_KEY : $caa9439642c6336c$var$ITERATE_KEY); return { + // iterator protocol next () { const { value: value , done: done } = innerIterator.next(); return done ? { value: value, done: done @@ -1859,10 +1839,11 @@ wrap(value[1]) ] : wrap(value), done: done }; }, + // iterable protocol [Symbol.iterator] () { return this; } }; }; @@ -1974,14 +1955,14 @@ if (rawKey !== key && has2.call(target, rawKey)) { const type = $caa9439642c6336c$var$toRawType(target); console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type === `Map` ? ` as keys` : ``}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`); } } -var $caa9439642c6336c$var$reactiveMap = new WeakMap(); -var $caa9439642c6336c$var$shallowReactiveMap = new WeakMap(); -var $caa9439642c6336c$var$readonlyMap = new WeakMap(); -var $caa9439642c6336c$var$shallowReadonlyMap = new WeakMap(); +var $caa9439642c6336c$var$reactiveMap = /* @__PURE__ */ new WeakMap(); +var $caa9439642c6336c$var$shallowReactiveMap = /* @__PURE__ */ new WeakMap(); +var $caa9439642c6336c$var$readonlyMap = /* @__PURE__ */ new WeakMap(); +var $caa9439642c6336c$var$shallowReadonlyMap = /* @__PURE__ */ new WeakMap(); function $caa9439642c6336c$var$targetTypeMap(rawType) { switch(rawType){ case "Object": case "Array": return 1; @@ -2135,11 +2116,11 @@ return result; }; let evaluateInnerSet = evaluateLater2(`${expression} = __placeholder`); let innerSet = (val)=>evaluateInnerSet(()=>{}, { scope: { - __placeholder: val + "__placeholder": val } }); let initialValue = innerGet(); innerSet(initialValue); queueMicrotask(()=>{ @@ -2290,11 +2271,12 @@ return ![ "window", "document", "prevent", "stop", - "once" + "once", + "capture" ].includes(i); }); if (keyModifiers.includes("debounce")) { let debounceIndex = keyModifiers.indexOf("debounce"); keyModifiers.splice(debounceIndex, $caa9439642c6336c$var$isNumeric((keyModifiers[debounceIndex + 1] || "invalid-wait").split("ms")[0]) ? 2 : 1); @@ -2328,24 +2310,24 @@ } function $caa9439642c6336c$var$keyToModifiers(key) { if (!key) return []; key = $caa9439642c6336c$var$kebabCase2(key); let modifierToKeyMap = { - ctrl: "control", - slash: "/", - space: " ", - spacebar: " ", - cmd: "meta", - esc: "escape", - up: "arrow-up", - down: "arrow-down", - left: "arrow-left", - right: "arrow-right", - period: ".", - equal: "=", - minus: "-", - underscore: "_" + "ctrl": "control", + "slash": "/", + "space": " ", + "spacebar": " ", + "cmd": "meta", + "esc": "escape", + "up": "arrow-up", + "down": "arrow-down", + "left": "arrow-left", + "right": "arrow-right", + "period": ".", + "equal": "=", + "minus": "-", + "underscore": "_" }; modifierToKeyMap[key] = key; return Object.keys(modifierToKeyMap).map((modifier)=>{ if (modifierToKeyMap[modifier] === key) return modifier; }).filter((modifier)=>modifier); @@ -2368,22 +2350,23 @@ let result; evaluateGet((value2)=>result = value2); if ($caa9439642c6336c$var$isGetterSetter(result)) result.set(value); else evaluateSet(()=>{}, { scope: { - __placeholder: value + "__placeholder": value } }); }; + if (modifiers.includes("fill") && el.hasAttribute("value") && (getValue() === null || getValue() === "")) setValue(el.value); if (typeof expression === "string" && el.type === "radio") $caa9439642c6336c$var$mutateDom(()=>{ if (!el.hasAttribute("name")) el.setAttribute("name", expression); }); var event = el.tagName.toLowerCase() === "select" || [ "checkbox", "radio" ].includes(el.type) || modifiers.includes("lazy") ? "change" : "input"; - let removeListener = $caa9439642c6336c$var$on(el, event, modifiers, (e)=>{ + let removeListener = $caa9439642c6336c$var$isCloning ? ()=>{} : $caa9439642c6336c$var$on(el, event, modifiers, (e)=>{ setValue($caa9439642c6336c$var$getInputValue(el, modifiers, e, getValue())); }); if (!el._x_removeModelListeners) el._x_removeModelListeners = {}; el._x_removeModelListeners["default"] = removeListener; cleanup2(()=>el._x_removeModelListeners["default"]()); @@ -2515,11 +2498,11 @@ let dataProviderContext = {}; $caa9439642c6336c$var$injectDataProviders(dataProviderContext, magicContext); let data2 = $caa9439642c6336c$var$evaluate(el, expression, { scope: dataProviderContext }); - if (data2 === void 0) data2 = {}; + if (data2 === void 0 || data2 === true) data2 = {}; $caa9439642c6336c$var$injectMagics(data2, el); let reactiveData = $caa9439642c6336c$var$reactive(data2); $caa9439642c6336c$var$initInterceptors(reactiveData); let undo = $caa9439642c6336c$var$addScopeToNode(el, reactiveData); reactiveData["init"] && $caa9439642c6336c$var$evaluate(el, reactiveData["init"]); @@ -2567,11 +2550,12 @@ }); // packages/alpinejs/src/directives/x-for.js $caa9439642c6336c$var$directive("for", (el, { expression: expression }, { effect: effect3 , cleanup: cleanup2 })=>{ let iteratorNames = $caa9439642c6336c$var$parseForExpression(expression); let evaluateItems = $caa9439642c6336c$var$evaluateLater(el, iteratorNames.items); - let evaluateKey = $caa9439642c6336c$var$evaluateLater(el, el._x_keyExpression || "index"); + let evaluateKey = $caa9439642c6336c$var$evaluateLater(el, // the x-bind:key expression is stored for our use instead of evaluated. + el._x_keyExpression || "index"); el._x_prevKeys = []; el._x_lookup = {}; effect3(()=>$caa9439642c6336c$var$loop(el, iteratorNames, evaluateItems, evaluateKey)); cleanup2(()=>{ Object.values(el._x_lookup).forEach((el2)=>el2.remove()); @@ -2772,11 +2756,11 @@ if (!el._x_forwardEvents.includes(value)) el._x_forwardEvents.push(value); } let removeListener = $caa9439642c6336c$var$on(el, value, modifiers, (e)=>{ evaluate2(()=>{}, { scope: { - $event: e + "$event": e }, params: [ e ] }); @@ -7709,19 +7693,19 @@ } async function $e8e1f68a69f95ce8$export$51c59e2af49c1a92(url, selector) { const response = await fetch(url || window.document.location); - if (response.ok) { - const html = await response.text(); - const doc = new DOMParser().parseFromString(html, "text/html"); - return { - fragment: selector ? doc.querySelector(selector).outerHTML : null, - title: doc.title, - doc: doc - }; - } else throw new Error(`Error fetching HTML from ${url}`); + const html = await response.text(); + const doc = new DOMParser().parseFromString(html, "text/html"); + return { + ok: response.ok, + fragment: selector ? doc.querySelector(selector).outerHTML : null, + title: doc.title, + response: response, + doc: doc + }; } function $d709d0f4027033b2$export$2e2bcd8739ae039() { @@ -7829,11 +7813,11 @@ return $1.toUpperCase().replace("-", "").replace("_", ""); }); } -var $77553f14666631eb$exports = {}; +var $e4c11ef0d00e55a8$exports = {}; var $cbd28b10fa9798c7$exports = {}; $parcel$defineInteropFlag($cbd28b10fa9798c7$exports); $parcel$export($cbd28b10fa9798c7$exports, "default", () => $cbd28b10fa9798c7$export$2e2bcd8739ae039); @@ -11360,20 +11344,10 @@ _spinning: false }; } -var $99486586f6691564$exports = {}; - -$parcel$defineInteropFlag($99486586f6691564$exports); - -$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039); -function $99486586f6691564$export$2e2bcd8739ae039() { - return {}; -} - - var $47a1c62621be0c54$exports = {}; $parcel$defineInteropFlag($47a1c62621be0c54$exports); $parcel$export($47a1c62621be0c54$exports, "default", () => $47a1c62621be0c54$export$2e2bcd8739ae039); @@ -11484,10 +11458,20 @@ } }; } +var $99486586f6691564$exports = {}; + +$parcel$defineInteropFlag($99486586f6691564$exports); + +$parcel$export($99486586f6691564$exports, "default", () => $99486586f6691564$export$2e2bcd8739ae039); +function $99486586f6691564$export$2e2bcd8739ae039() { + return {}; +} + + var $e9904a14dabf652d$exports = {}; $parcel$defineInteropFlag($e9904a14dabf652d$exports); $parcel$export($e9904a14dabf652d$exports, "default", () => $e9904a14dabf652d$export$2e2bcd8739ae039); @@ -11509,22 +11493,10 @@ } }; } -var $36506012e0c6e9e3$exports = {}; - -$parcel$defineInteropFlag($36506012e0c6e9e3$exports); - -$parcel$export($36506012e0c6e9e3$exports, "default", () => $36506012e0c6e9e3$export$2e2bcd8739ae039); -function $36506012e0c6e9e3$export$2e2bcd8739ae039(iconName) { - return { - iconName: iconName - }; -} - - var $d92d9d5253f84566$exports = {}; $parcel$defineInteropFlag($d92d9d5253f84566$exports); $parcel$export($d92d9d5253f84566$exports, "default", () => $d92d9d5253f84566$export$2e2bcd8739ae039); @@ -12142,103 +12114,10 @@ } }; } -var $0db07828cadc68e0$exports = {}; - -$parcel$defineInteropFlag($0db07828cadc68e0$exports); - -$parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$export$2e2bcd8739ae039); - - - - -function $0db07828cadc68e0$export$2e2bcd8739ae039(store) { - const initial = store ? store.activeTab : null; - let dropdown = null; - return { - visibleTabsCount: 0, - triggerLeft: 0, - get store () { - return store || this; - }, - get tabs () { - return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : []; - }, - get dropdownTabs () { - return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []); - }, - get tabWidths () { - return this.tabs.map((tab)=>(0, $e263283f97229955$export$bdf7e699b242f476)(tab, { - includeMargins: true - }).width); - }, - init () { - this.$nextTick(()=>{ - if (this.$root.parentElement.offsetWidth === this.$root.offsetWidth) this.visibleTabsCount = this.tabs.length; - dropdown = (0, $d6f449055c23f07a$export$2e2bcd8739ae039)(this.$refs.dropdownTrigger, { - content: this.$refs.tabsDropdown, - theme: "menu", - interactive: true, - trigger: "click", - placement: "bottom", - appendTo: this.$root - }); - const initialTab = initial ? this.tabs.find((t)=>this._getRef(t) === initial) : this.tabs[0]; - this.selectTab(initialTab || this.tabs[0], true); - this.parentObserver = (0, $9930d46698775b42$export$a2214cc2adb2dc44)(this.$root.parentElement, (0, $c5d017602d25d050$export$61fc7d43ac8f84b0)(10, this.handleResize.bind(this))); - this.$watch("visibleTabsCount", (value)=>{ - this.debug(`'#${this.$root.id}' visible tabs count:`, value); - }); - }); - }, - handleResize ({ width: width }) { - if (width === this._lastMeasuredWidth) return; - if (width === this.$root.offsetWidth) { - this.visibleTabsCount = this.tabs.length; - return; - } - let sumTabWidths = 60; - let triggerLeft = 20; - let visibleTabsCount = 0; - this.tabWidths.forEach((tabWidth)=>{ - sumTabWidths += tabWidth; - if (sumTabWidths < width) { - triggerLeft += tabWidth; - visibleTabsCount++; - } - }); - this.visibleTabsCount = visibleTabsCount; - this.triggerLeft = triggerLeft; - this._lastMeasuredWidth = width; - }, - selectTab (el, initial = false) { - this.store.activeTab = this._getRef(el); - dropdown.hide(); - if (!initial) this.$dispatch("tabs:change", { - tabs: this - }); - }, - isSelected (el) { - return this.store.activeTab === this._getRef(el); - }, - isDisabled (el) { - return el.getAttribute("data-disabled") == "true"; - }, - hasHiddenTabs () { - return this.visibleTabsCount < this.tabs.length; - }, - // protected - _lastMeasuredWidth: 0, - _getRef (el) { - return el ? el.getAttribute("x-ref").replace("dropdown-", "") : null; - } - }; -} - - var $6d64716f0b34fdf4$exports = {}; $parcel$defineInteropFlag($6d64716f0b34fdf4$exports); $parcel$export($6d64716f0b34fdf4$exports, "default", () => $6d64716f0b34fdf4$export$2e2bcd8739ae039); @@ -12362,27 +12241,237 @@ } }; } -$77553f14666631eb$exports = { +var $0db07828cadc68e0$exports = {}; + +$parcel$defineInteropFlag($0db07828cadc68e0$exports); + +$parcel$export($0db07828cadc68e0$exports, "default", () => $0db07828cadc68e0$export$2e2bcd8739ae039); + + + + +function $0db07828cadc68e0$export$2e2bcd8739ae039(store) { + const initial = store ? store.activeTab : null; + let dropdown = null; + return { + visibleTabsCount: 0, + triggerLeft: 0, + get store () { + return store || this; + }, + get tabs () { + return this.$refs.tabs ? Array.from(this.$refs.tabs.children) : []; + }, + get dropdownTabs () { + return Array.from(this.$refs.tabsDropdown ? this.$refs.tabsDropdown.children : []); + }, + get tabWidths () { + return this.tabs.map((tab)=>(0, $e263283f97229955$export$bdf7e699b242f476)(tab, { + includeMargins: true + }).width); + }, + init () { + this.$nextTick(()=>{ + if (this.$root.parentElement.offsetWidth === this.$root.offsetWidth) this.visibleTabsCount = this.tabs.length; + dropdown = (0, $d6f449055c23f07a$export$2e2bcd8739ae039)(this.$refs.dropdownTrigger, { + content: this.$refs.tabsDropdown, + theme: "menu", + interactive: true, + trigger: "click", + placement: "bottom", + appendTo: this.$root + }); + const initialTab = initial ? this.tabs.find((t)=>this._getRef(t) === initial) : this.tabs[0]; + this.selectTab(initialTab || this.tabs[0], true); + this.parentObserver = (0, $9930d46698775b42$export$a2214cc2adb2dc44)(this.$root.parentElement, (0, $c5d017602d25d050$export$61fc7d43ac8f84b0)(10, this.handleResize.bind(this))); + this.$watch("visibleTabsCount", (value)=>{ + this.debug(`'#${this.$root.id}' visible tabs count:`, value); + }); + }); + }, + handleResize ({ width: width }) { + if (width === this._lastMeasuredWidth) return; + if (width === this.$root.offsetWidth) { + this.visibleTabsCount = this.tabs.length; + return; + } + let sumTabWidths = 60; + let triggerLeft = 20; + let visibleTabsCount = 0; + this.tabWidths.forEach((tabWidth)=>{ + sumTabWidths += tabWidth; + if (sumTabWidths < width) { + triggerLeft += tabWidth; + visibleTabsCount++; + } + }); + this.visibleTabsCount = visibleTabsCount; + this.triggerLeft = triggerLeft; + this._lastMeasuredWidth = width; + }, + selectTab (el, initial = false) { + this.store.activeTab = this._getRef(el); + dropdown.hide(); + if (!initial) this.$dispatch("tabs:change", { + tabs: this + }); + }, + isSelected (el) { + return this.store.activeTab === this._getRef(el); + }, + isDisabled (el) { + return el.getAttribute("data-disabled") == "true"; + }, + hasHiddenTabs () { + return this.visibleTabsCount < this.tabs.length; + }, + // protected + _lastMeasuredWidth: 0, + _getRef (el) { + return el ? el.getAttribute("x-ref").replace("dropdown-", "") : null; + } + }; +} + + +$e4c11ef0d00e55a8$exports = { "button": $cbd28b10fa9798c7$exports, - "code": $99486586f6691564$exports, "copy_button": $47a1c62621be0c54$exports, "dimensions_display": $e398acaded942bbe$exports, "embed_code_dropdown": $216ef7001f59f21d$exports, + "code": $99486586f6691564$exports, "filter": $e9904a14dabf652d$exports, - "icon": $36506012e0c6e9e3$exports, "nav": $d92d9d5253f84566$exports, "split_layout": $506dabb2bf255b38$exports, "tab_panels": $a87dacf5139b5e2f$exports, - "tabs": $0db07828cadc68e0$exports, - "viewport": $6d64716f0b34fdf4$exports + "viewport": $6d64716f0b34fdf4$exports, + "tabs": $0db07828cadc68e0$exports }; -var $2af7656449ff0341$exports = {}; +var $f3e1e32f4a1bd6da$exports = {}; +var $6a9b69d9cc7f810f$exports = {}; + +$parcel$defineInteropFlag($6a9b69d9cc7f810f$exports); + +$parcel$export($6a9b69d9cc7f810f$exports, "default", () => $6a9b69d9cc7f810f$export$2e2bcd8739ae039); +var $cdfeaa1e0e8d642c$exports = {}; +(function(global, factory) { + $cdfeaa1e0e8d642c$exports = factory(); +})($cdfeaa1e0e8d642c$exports, function() { + "use strict"; + /* eslint-disable no-var */ function assign(target) { + for(var i = 1; i < arguments.length; i++){ + var source = arguments[i]; + for(var key in source)target[key] = source[key]; + } + return target; + } + /* eslint-enable no-var */ /* eslint-disable no-var */ 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); + } + }; + /* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) { + function set(key, 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(); + key = encodeURIComponent(key).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; + // Considers RFC 6265 section 5.2: + // ... + // 3. If the remaining unparsed-attributes contains a %x3B (";") + // character: + // Consume the characters of the unparsed-attributes up to, + // not including, the first %x3B (";") character. + // ... + stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; + } + return document.cookie = key + "=" + converter.write(value, key) + stringifiedAttributes; + } + function get(key) { + if (typeof document === "undefined" || arguments.length && !key) return; + // To prevent the for loop in the first place assign an empty array + // in case there are no cookies at all. + var cookies = document.cookie ? document.cookie.split("; ") : []; + var jar = {}; + for(var i = 0; i < cookies.length; i++){ + var parts = cookies[i].split("="); + var value = parts.slice(1).join("="); + try { + var foundKey = decodeURIComponent(parts[0]); + jar[foundKey] = converter.read(value, foundKey); + if (key === foundKey) break; + } catch (e) {} + } + return key ? jar[key] : jar; + } + return Object.create({ + set: set, + get: get, + remove: function(key, attributes) { + set(key, "", assign({}, attributes, { + expires: -1 + })); + }, + withAttributes: function(attributes) { + return init(this.converter, assign({}, this.attributes, attributes)); + }, + withConverter: function(converter) { + return init(assign({}, this.converter, converter), this.attributes); + } + }, { + attributes: { + value: Object.freeze(defaultAttributes) + }, + converter: { + value: Object.freeze(converter) + } + }); + } + var api = init(defaultConverter, { + path: "/" + }); + /* eslint-enable no-var */ return api; +}); + + + +function $6a9b69d9cc7f810f$export$2e2bcd8739ae039({ name: name , value: value }) { + return { + name: name, + value: value, + init () { + this.$watch("value", ()=>this.update()); + }, + update () { + (0, (/*@__PURE__*/$parcel$interopDefault($cdfeaa1e0e8d642c$exports))).set(`lookbook-display-${name}`, this.value); + const searchParams = new URLSearchParams(window.location.search); + const display = searchParams.get("_display"); + const displayParams = display ? (0, $7ae6ae39c2ec9059$export$f720fd0ddbeb53d9)(display) : {}; + displayParams[this.name] = this.value; + searchParams.set("_display", (0, $7ae6ae39c2ec9059$export$c788aab010beeaec)(displayParams)); + const path = location.href.replace(location.search, ""); + this.navigateTo(`${path}?${searchParams.toString()}`); + } + }; +} + + var $c299e36fa9e271bc$exports = {}; $parcel$defineInteropFlag($c299e36fa9e271bc$exports); $parcel$export($c299e36fa9e271bc$exports, "default", () => $c299e36fa9e271bc$export$2e2bcd8739ae039); @@ -12396,16 +12485,16 @@ * Contributor: Jure Mav - jure.mav@gmail.com * Contributor: Reed Dadoune - reed@dadoune.com */ // eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names (function(undefined) { if (typeof window === "undefined") return; // don't run for server side render - var count = 0, logEnabled = false, hiddenCheckEnabled = false, msgHeader = "message", msgHeaderLen = msgHeader.length, msgId = "[iFrameSizer]", msgIdLen = msgId.length, pagePosition = null, requestAnimationFrame = window.requestAnimationFrame, resetRequiredMethods = { + var count = 0, logEnabled = false, hiddenCheckEnabled = false, msgHeader = "message", msgHeaderLen = msgHeader.length, msgId = "[iFrameSizer]", msgIdLen = msgId.length, pagePosition = null, requestAnimationFrame = window.requestAnimationFrame, resetRequiredMethods = Object.freeze({ max: 1, scroll: 1, bodyScroll: 1, documentElementScroll: 1 - }, settings = {}, timer = null, defaults = { + }), settings = {}, timer = null, defaults = Object.freeze({ autoResize: true, bodyBackground: null, bodyMargin: null, bodyMarginV1: 8, bodyPadding: null, @@ -12440,11 +12529,11 @@ onMouseLeave: function() {}, onResized: function() {}, onScroll: function() { return true; } - }; + }); function getMutationObserver() { return window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver; } function addEventListener(el, evt, func) { el.addEventListener(evt, func, false); @@ -12958,10 +13047,11 @@ var id = options && options.id || defaults.id + count++; if (null !== document.getElementById(id)) id += count++; return id; } function ensureHasId(iframeId) { + if (typeof iframeId !== "string") throw new TypeError("Invaild id for iFrame. Expected String"); if ("" === iframeId) { // eslint-disable-next-line no-multi-assign iframe.id = iframeId = newId(); logEnabled = (options || {}).log; log(iframeId, "Added missing iframe ID: " + iframeId + " (" + iframe.src + ")"); @@ -13066,15 +13156,15 @@ warn(iframeId, "Deprecated: '" + key + "' has been renamed '" + name + "'. The old method will be removed in the next major version."); } } function processOptions(options) { options = options || {}; - settings[iframeId] = { - firstRun: true, - iframe: iframe, - remoteHost: iframe.src && iframe.src.split("/").slice(0, 3).join("/") - }; + settings[iframeId] = Object.create(null) // Protect against prototype attacks + ; + settings[iframeId].iframe = iframe; + settings[iframeId].firstRun = true; + settings[iframeId].remoteHost = iframe.src && iframe.src.split("/").slice(0, 3).join("/"); checkOptions(options); Object.keys(options).forEach(depricate, options); copyOptions(options); if (settings[iframeId]) settings[iframeId].targetOrigin = true === settings[iframeId].checkOrigin ? getTargetOrigin(settings[iframeId].remoteHost) : "*"; } @@ -13260,128 +13350,10 @@ } }; } -var $6a9b69d9cc7f810f$exports = {}; - -$parcel$defineInteropFlag($6a9b69d9cc7f810f$exports); - -$parcel$export($6a9b69d9cc7f810f$exports, "default", () => $6a9b69d9cc7f810f$export$2e2bcd8739ae039); -var $cdfeaa1e0e8d642c$exports = {}; -(function(global, factory) { - $cdfeaa1e0e8d642c$exports = factory(); -})($cdfeaa1e0e8d642c$exports, function() { - "use strict"; - /* eslint-disable no-var */ function assign(target) { - for(var i = 1; i < arguments.length; i++){ - var source = arguments[i]; - for(var key in source)target[key] = source[key]; - } - return target; - } - /* eslint-enable no-var */ /* eslint-disable no-var */ 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); - } - }; - /* eslint-enable no-var */ /* eslint-disable no-var */ function init(converter, defaultAttributes) { - function set(key, 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(); - key = encodeURIComponent(key).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; - // Considers RFC 6265 section 5.2: - // ... - // 3. If the remaining unparsed-attributes contains a %x3B (";") - // character: - // Consume the characters of the unparsed-attributes up to, - // not including, the first %x3B (";") character. - // ... - stringifiedAttributes += "=" + attributes[attributeName].split(";")[0]; - } - return document.cookie = key + "=" + converter.write(value, key) + stringifiedAttributes; - } - function get(key) { - if (typeof document === "undefined" || arguments.length && !key) return; - // To prevent the for loop in the first place assign an empty array - // in case there are no cookies at all. - var cookies = document.cookie ? document.cookie.split("; ") : []; - var jar = {}; - for(var i = 0; i < cookies.length; i++){ - var parts = cookies[i].split("="); - var value = parts.slice(1).join("="); - try { - var foundKey = decodeURIComponent(parts[0]); - jar[foundKey] = converter.read(value, foundKey); - if (key === foundKey) break; - } catch (e) {} - } - return key ? jar[key] : jar; - } - return Object.create({ - set: set, - get: get, - remove: function(key, attributes) { - set(key, "", assign({}, attributes, { - expires: -1 - })); - }, - withAttributes: function(attributes) { - return init(this.converter, assign({}, this.attributes, attributes)); - }, - withConverter: function(converter) { - return init(assign({}, this.converter, converter), this.attributes); - } - }, { - attributes: { - value: Object.freeze(defaultAttributes) - }, - converter: { - value: Object.freeze(converter) - } - }); - } - var api = init(defaultConverter, { - path: "/" - }); - /* eslint-enable no-var */ return api; -}); - - - -function $6a9b69d9cc7f810f$export$2e2bcd8739ae039({ name: name , value: value }) { - return { - name: name, - value: value, - init () { - this.$watch("value", ()=>this.update()); - }, - update () { - (0, (/*@__PURE__*/$parcel$interopDefault($cdfeaa1e0e8d642c$exports))).set(`lookbook-display-${name}`, this.value); - const searchParams = new URLSearchParams(window.location.search); - const display = searchParams.get("_display"); - const displayParams = display ? (0, $7ae6ae39c2ec9059$export$f720fd0ddbeb53d9)(display) : {}; - displayParams[this.name] = this.value; - searchParams.set("_display", (0, $7ae6ae39c2ec9059$export$c788aab010beeaec)(displayParams)); - const path = location.href.replace(location.search, ""); - this.navigateTo(`${path}?${searchParams.toString()}`); - } - }; -} - - var $9b24cbeb3a465447$exports = {}; $parcel$defineInteropFlag($9b24cbeb3a465447$exports); $parcel$export($9b24cbeb3a465447$exports, "default", () => $9b24cbeb3a465447$export$2e2bcd8739ae039); @@ -13467,17 +13439,17 @@ } }; } -$2af7656449ff0341$exports = { - "embed": { - "inspector": $c299e36fa9e271bc$exports - }, +$f3e1e32f4a1bd6da$exports = { "display_options": { "field": $6a9b69d9cc7f810f$exports }, + "embed": { + "inspector": $c299e36fa9e271bc$exports + }, "nav": { "item": $9b24cbeb3a465447$exports }, "params": { "editor": $1a7a7298eec5b755$exports, @@ -13547,11 +13519,11 @@ prefix: $939f2ad3cd685486$var$prefix })); // Components (0, $caa9439642c6336c$export$2e2bcd8739ae039).data("app", (0, $d709d0f4027033b2$export$2e2bcd8739ae039)); [ - $77553f14666631eb$exports, - $2af7656449ff0341$exports, + $e4c11ef0d00e55a8$exports, + $f3e1e32f4a1bd6da$exports, $6c10158820e535ef$exports ].forEach((scripts)=>{ const components = (0, $5439cede634b2921$export$4e811121b221213b)(scripts); Object.keys(components).forEach((name)=>{ (0, $caa9439642c6336c$export$2e2bcd8739ae039).data(`${name}Component`, components[name]);