@themarioga/grid-editor 8.8.0 → 8.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/js/register.js", "../../src/js/dom.js", "../../src/js/plugins/grideditor.carousel.js"],
4
- "sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are jQuery's: 400 ms unless the caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Carousels for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a carousel, a bootstrap carousel whose slides are editable regions. What it\n * can ask the editor for is the handle its factory is called with, described\n * in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.carousel.min.js\"></script>\n *\n * Only one slide shows on the canvas, as on the page. The container's drawer\n * says which, and moves to the next and the previous; Bootstrap's own arrows\n * and indicators are drawn but do not answer, and neither does its javascript:\n * the attributes it acts on are put aside while editing. A carousel's options\n * - arrows, indicators, fade, dark theme, autoplay and its interval, pause,\n * wrap, keyboard and touch - are Bootstrap's classes and attributes and\n * nothing else: they are read from the markup, chosen in the container's\n * settings panel, or given to createContainer and the carousel setting for\n * the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_carousel': 'Carousel',\n 'container.add_carousel_item': 'Add slide',\n 'confirm.delete_carousel_item': 'Delete this slide and everything in it?',\n 'panel.kind_carousel_item': 'Slide',\n 'container.carousel_previous': 'Previous',\n 'container.carousel_next': 'Next',\n 'container.carousel_slide_label': 'Slide {number}',\n 'container.carousel_counter': '{current} / {total}',\n 'tool.carousel_show_previous': 'Previous slide',\n 'tool.carousel_show_next': 'Next slide',\n 'tool.carousel_move_back': 'Move back',\n 'tool.carousel_move_forward': 'Move forward',\n 'container.carousel_section': 'Carousel',\n 'container.carousel_controls': 'Arrows',\n 'container.carousel_indicators': 'Indicators',\n 'container.carousel_fade': 'Fade',\n 'container.carousel_dark': 'Dark theme',\n 'container.carousel_ride': 'Autoplay',\n 'container.carousel_ride_no': 'No',\n 'container.carousel_ride_load': 'On load',\n 'container.carousel_ride_interaction': 'After first interaction',\n 'container.carousel_interval': 'Interval (s)',\n 'container.carousel_pause': 'Pause on hover',\n 'container.carousel_wrap': 'Wrap around',\n 'container.carousel_keyboard': 'Keyboard',\n 'container.carousel_touch': 'Touch swipe',\n 'container.carousel_item_section': 'Slide',\n});\n\n/** What a carousel made new has when neither the call nor the setting says. */\nvar DEFAULTS = {\n controls: true,\n indicators: true,\n fade: false,\n dark: false,\n ride: false,\n interval: null,\n pause: true,\n wrap: true,\n keyboard: true,\n touch: true,\n slides: 2,\n};\n\nvar CHECKBOXES = ['controls', 'indicators', 'fade', 'dark'];\nvar BEHAVIOURS = ['pause', 'wrap', 'keyboard', 'touch'];\n\n/** Each option's checkbox in the panel, and its label. */\nvar LABELS = {\n controls: { labelKey: 'container.carousel_controls' },\n indicators: { labelKey: 'container.carousel_indicators' },\n fade: { labelKey: 'container.carousel_fade' },\n dark: { labelKey: 'container.carousel_dark' },\n pause: { labelKey: 'container.carousel_pause' },\n wrap: { labelKey: 'container.carousel_wrap' },\n keyboard: { labelKey: 'container.carousel_keyboard' },\n touch: { labelKey: 'container.carousel_touch' },\n};\nvar RIDE_LABEL = { labelKey: 'container.carousel_ride' };\nvar INTERVAL_LABEL = { labelKey: 'container.carousel_interval' };\nvar RIDES = [false, 'carousel', 'true'];\nvar MIN_INTERVAL = 1000; // ms\n\n/** What Bootstrap puts on a slide while it moves one in: never part of the page. */\nvar TRANSITION = 'carousel-item-next carousel-item-prev carousel-item-start carousel-item-end';\n\nfunction validInterval(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value && value >= MIN_INTERVAL;\n}\n\nvar CHECKS = {\n ride: function(value) { return RIDES.indexOf(value) !== -1; },\n interval: function(value) { return value === null || validInterval(value); },\n slides: function(value) { return typeof value === 'number' && Math.floor(value) === value && value >= 1; },\n};\n\n/** The values an option takes, as the warning lists them. */\nfunction takes(key) {\n if (key === 'ride') { return JSON.stringify(RIDES); }\n if (key === 'interval') { return 'null or an integer of ' + MIN_INTERVAL + ' or more'; }\n if (key === 'slides') { return 'an integer of 1 or more'; }\n\n return '[true,false]';\n}\n\nfunction isValid(key, value) {\n return CHECKS[key] ? CHECKS[key](value) : typeof value === 'boolean';\n}\n\nvar fieldCounter = 0;\n\nGridEditor.containers.carousel = function(ge) {\n\n var shown = new WeakMap(); // The slide each carousel shows, whatever its markup says\n var sections = []; // { node, element, render } for every panel section built\n\n function carouselOf(container) {\n return dom.child(container, '.carousel');\n }\n\n function innerOf(container) {\n return dom.child(carouselOf(container), '.carousel-inner');\n }\n\n /** A container with no carousel or no slides' holder is left as it is. */\n function usable(container) {\n return !!innerOf(container);\n }\n\n function itemsOf(container) {\n return dom.children(innerOf(container), '.carousel-item');\n }\n\n /** The carousel's id, which its arrows and indicators point at. */\n function idOf(carousel) {\n if (!carousel.getAttribute('id')) { carousel.setAttribute('id', ge.containerId('carousel')); }\n\n return carousel.getAttribute('id');\n }\n\n /** A Bootstrap attribute, whether it is where Bootstrap reads it or put aside for editing. */\n function bsAttribute(node, name) {\n var value = node.getAttribute('data-bs-' + name);\n\n return value === null ? node.getAttribute('data-ge-bs-' + name) : value;\n }\n\n function intervalOf(node) {\n var value = parseInt(node.getAttribute('data-bs-interval'), 10);\n\n return isFinite(value) && value > 0 ? value : null;\n }\n\n function writeInterval(node, value) {\n if (value === null) {\n node.removeAttribute('data-bs-interval');\n } else {\n node.setAttribute('data-bs-interval', String(value));\n }\n }\n\n /** What a carousel's classes and attributes say it is. */\n function read(container) {\n var carousel = carouselOf(container);\n var ride = bsAttribute(carousel, 'ride');\n var off = function(name) { return carousel.getAttribute('data-bs-' + name) !== 'false'; };\n\n return {\n controls: !!dom.child(carousel, '.carousel-control-prev, .carousel-control-next'),\n indicators: !!dom.child(carousel, '.carousel-indicators'),\n fade: dom.hasClass(carousel, 'carousel-fade'),\n dark: carousel.getAttribute('data-bs-theme') === 'dark',\n ride: ride === 'carousel' || ride === 'true' ? ride : false,\n interval: intervalOf(carousel),\n pause: off('pause'),\n wrap: off('wrap'),\n keyboard: off('keyboard'),\n touch: off('touch'),\n };\n }\n\n function controlButton(carousel, direction) {\n var button = dom.element('button', {\n 'class': 'carousel-control-' + direction,\n type: 'button',\n 'data-bs-target': '#' + idOf(carousel),\n 'data-bs-slide': direction,\n });\n\n button.appendChild(dom.element('span', { 'class': 'carousel-control-' + direction + '-icon', 'aria-hidden': 'true' }));\n button.appendChild(dom.element('span', { 'class': 'visually-hidden' },\n direction === 'prev' ? ge.t('container.carousel_previous') : ge.t('container.carousel_next')));\n\n return button;\n }\n\n function setControls(container, on) {\n var carousel = carouselOf(container);\n\n dom.children(carousel, '.carousel-control-prev, .carousel-control-next').forEach(function(button) { button.remove(); });\n\n if (on) {\n carousel.appendChild(controlButton(carousel, 'prev'));\n carousel.appendChild(controlButton(carousel, 'next'));\n }\n }\n\n function setIndicators(container, on) {\n var carousel = carouselOf(container);\n var bar = dom.child(carousel, '.carousel-indicators');\n\n if (!on) {\n if (bar) { bar.remove(); }\n return;\n }\n\n if (!bar) {\n bar = carousel.insertBefore(dom.element('div', { 'class': 'carousel-indicators' }), carousel.firstChild);\n }\n\n rebuildIndicators(container);\n }\n\n /** One indicator a slide, in the slides' order, the shown one marked. */\n function rebuildIndicators(container, list) {\n var carousel = carouselOf(container);\n var bar = dom.child(carousel, '.carousel-indicators');\n if (!bar) { return; }\n\n list = list || itemsOf(container);\n var id = idOf(carousel);\n var active = 0;\n\n list.forEach(function(item, index) {\n if (dom.hasClass(item, 'active')) { active = index; }\n });\n\n bar.textContent = '';\n list.forEach(function(item, index) {\n bar.appendChild(dom.element('button', {\n type: 'button',\n 'data-bs-target': '#' + id,\n 'data-bs-slide-to': String(index),\n 'aria-label': ge.t('container.carousel_slide_label', { number: index + 1 }),\n }));\n });\n\n syncIndicators(container, list.length ? active : -1);\n }\n\n function syncIndicators(container, index) {\n var bar = dom.child(carouselOf(container), '.carousel-indicators');\n\n dom.children(bar).forEach(function(indicator, position) {\n dom.toggleClass(indicator, 'active', position === index);\n\n if (position === index) {\n indicator.setAttribute('aria-current', 'true');\n } else {\n indicator.removeAttribute('aria-current');\n }\n });\n }\n\n function write(container, key, value) {\n var carousel = carouselOf(container);\n\n if (key === 'controls') { setControls(container, value); }\n if (key === 'indicators') { setIndicators(container, value); }\n if (key === 'fade') { dom.toggleClass(carousel, 'carousel-fade', value); }\n\n if (key === 'dark') {\n if (value) {\n carousel.setAttribute('data-bs-theme', 'dark');\n } else if (carousel.getAttribute('data-bs-theme') === 'dark') {\n carousel.removeAttribute('data-bs-theme');\n }\n }\n\n if (key === 'ride') {\n carousel.removeAttribute('data-bs-ride');\n carousel.removeAttribute('data-ge-bs-ride');\n if (value) { carousel.setAttribute('data-bs-ride', value); }\n }\n\n if (key === 'interval') { writeInterval(carousel, value); }\n\n if (BEHAVIOURS.indexOf(key) !== -1) {\n if (value) {\n carousel.removeAttribute('data-bs-' + key);\n } else {\n carousel.setAttribute('data-bs-' + key, 'false');\n }\n }\n\n dom.dropEmptyClass(carousel);\n }\n\n /**\n * A value for a new carousel: the option, or the carousel setting, or the\n * default. One the option does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.carousel || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (isValid(key, value)) { return value; }\n\n ge.warn('carousel: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n takes(key) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /** What stops Bootstrap's javascript acting on the carousel while it is edited. */\n function suspend(container) {\n var carousel = carouselOf(container);\n\n dom.children(carousel, '.carousel-control-prev, .carousel-control-next').forEach(ge.suspendToggles);\n dom.children(dom.child(carousel, '.carousel-indicators')).forEach(ge.suspendToggles);\n\n // By hand: suspendToggles(carousel) would take a tabs or an accordion\n // inside a slide off its toggles as well\n var ride = carousel.getAttribute('data-bs-ride');\n if (ride !== null) {\n carousel.setAttribute('data-ge-bs-ride', ride);\n carousel.removeAttribute('data-bs-ride');\n }\n }\n\n /** A carousel Bootstrap started before the editor did stops, and is forgotten. */\n function stopBootstrap(carousel) {\n var library = GridEditor.bootstrap || window.bootstrap;\n var instance = library && library.Carousel ? library.Carousel.getInstance(carousel) : null;\n\n if (instance) {\n instance.pause();\n instance.dispose();\n }\n }\n\n function buildItem(container, active, interval) {\n var item = innerOf(container).appendChild(dom.element('div', { 'class': active ? 'carousel-item active' : 'carousel-item' }));\n\n item.appendChild(ge.defaultRegion());\n if (interval !== null && interval !== undefined) { writeInterval(item, interval); }\n\n return item;\n }\n\n /** The slide the carousel shows: the one it was left on, or the markup's, or the first. */\n function currentOf(container) {\n var list = itemsOf(container);\n var kept = shown.get(container);\n\n if (kept && list.indexOf(kept) !== -1) { return kept; }\n\n return list.filter(function(item) { return dom.hasClass(item, 'active'); })[0] || list[0] || null;\n }\n\n /** Show one slide and only that one. */\n function show(container, item, list) {\n list = list || itemsOf(container);\n\n list.forEach(function(each) { dom.toggleClass(each, 'active', each === item); });\n\n if (item) {\n shown.set(container, item);\n } else {\n shown.delete(container);\n }\n\n syncIndicators(container, list.indexOf(item));\n refreshNavigation(container);\n }\n\n function step(container, offset) {\n var list = itemsOf(container);\n if (list.length < 2) { return; }\n\n var index = list.indexOf(currentOf(container));\n show(container, list[(index + offset + list.length) % list.length]);\n }\n\n function disable(tool, state) {\n if (!tool) { return; }\n\n dom.toggleClass(tool, 'disabled', state);\n\n if (state) {\n tool.setAttribute('aria-disabled', 'true');\n } else {\n tool.removeAttribute('aria-disabled');\n }\n }\n\n function disabled(tool) {\n return tool.getAttribute('aria-disabled') === 'true';\n }\n\n /** The container's counter and arrows, and every slide's move tools, as the slides stand. */\n function refreshNavigation(container) {\n var list = itemsOf(container);\n var drawer = dom.child(container, '.ge-container-drawer');\n var index = list.indexOf(currentOf(container));\n\n if (drawer) {\n var counter = dom.child(drawer, '.ge-carousel-counter');\n\n if (counter) {\n counter.textContent = ge.t('container.carousel_counter', {\n current: list.length ? index + 1 : 0,\n total: list.length,\n });\n }\n\n disable(dom.child(drawer, '.ge-carousel-previous'), list.length < 2);\n disable(dom.child(drawer, '.ge-carousel-next'), list.length < 2);\n }\n\n list.forEach(function(item, position) {\n var tools = dom.child(item, '.ge-pane-drawer');\n\n disable(dom.child(tools, '.ge-carousel-move-back'), position === 0);\n disable(dom.child(tools, '.ge-carousel-move-forward'), position === list.length - 1);\n });\n }\n\n function moveItem(container, item, offset) {\n var inner = innerOf(container);\n var list = itemsOf(container);\n var index = list.indexOf(item);\n var target = index + offset;\n\n if (target < 0 || target >= list.length) { return; }\n\n var from = { parent: inner, index: index };\n\n ge.operate(function() {\n if (!ge.emit('before-move', ge.payloadFor('carousel-item', item, {\n parent: inner,\n source: 'tool',\n from: from,\n }))) { return; }\n\n inner.insertBefore(item, offset < 0 ? list[target] : list[target].nextSibling);\n show(container, currentOf(container));\n rebuildIndicators(container);\n suspend(container);\n\n ge.emit('after-move', ge.payloadFor('carousel-item', item, {\n parent: inner,\n source: 'tool',\n from: from,\n to: { parent: inner, index: target },\n container: container,\n }));\n });\n }\n\n /** What the slide to show is once `item` goes: the next one, or the previous if it was the last. */\n function afterRemoving(container, item, removed) {\n dom.fadeOut(item, 200, function() {\n var list = itemsOf(container);\n var rest = list.filter(function(each) { return each !== item; });\n\n if (currentOf(container) === item) {\n show(container, rest[Math.min(list.indexOf(item), rest.length - 1)] || null, rest);\n }\n\n rebuildIndicators(container, rest);\n removed();\n });\n }\n\n function createItemControls(container, item) {\n var drawer = ge.createPaneControls(item, 'carousel-item', ge.settings.carousel_tools,\n ge.t('confirm.delete_carousel_item'), function(removed) {\n afterRemoving(container, item, removed);\n });\n\n // A slide moves a place at a time, not by dragging\n var handle = dom.child(drawer, '.ge-move');\n if (handle) { handle.remove(); }\n\n var back = ge.createTool(drawer, ge.t('tool.carousel_move_back'), 'ge-carousel-move-back', 'bi bi-arrow-left', function() {\n if (!disabled(this)) { moveItem(container, item, -1); }\n });\n var forward = ge.createTool(drawer, ge.t('tool.carousel_move_forward'), 'ge-carousel-move-forward', 'bi bi-arrow-right', function() {\n if (!disabled(this)) { moveItem(container, item, 1); }\n });\n\n drawer.insertBefore(forward, drawer.firstChild);\n drawer.insertBefore(back, forward);\n }\n\n function addSlideTo(container, options) {\n options = options || {};\n\n if (!usable(container)) {\n ge.warn('carousel: there is no .carousel-inner to add a slide to');\n return null;\n }\n\n var interval = null;\n\n if (options.interval !== undefined && options.interval !== null) {\n if (validInterval(options.interval)) {\n interval = options.interval;\n } else {\n ge.warn('carousel: ' + JSON.stringify(options.interval) + ' is not a interval, which takes ' +\n takes('interval') + ': null is used');\n }\n }\n\n var item = buildItem(container, false, interval);\n\n show(container, item);\n rebuildIndicators(container);\n\n return item;\n }\n\n function field(labelKey, control, id) {\n var box = dom.element('div', { 'class': 'ge-carousel-option mb-2' });\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n box.appendChild(control);\n\n return box;\n }\n\n function nextId() {\n return 'ge-carousel-option-' + (++fieldCounter);\n }\n\n /**\n * The interval in seconds, for a node: empty takes it off, under a\n * second is refused and the field says so, and anything else is written\n * in milliseconds.\n */\n function intervalField(node, onWrite) {\n var id = nextId();\n var input = dom.element('input', {\n 'class': 'form-control form-control-sm',\n id: id,\n type: 'number',\n step: '0.1',\n min: String(MIN_INTERVAL / 1000),\n });\n\n input.addEventListener('change', function() {\n var text = input.value.trim();\n var seconds = parseFloat(text);\n\n if (text === '') {\n dom.removeClass(input, 'is-invalid');\n writeInterval(node, null);\n } else if (!isFinite(seconds) || Math.round(seconds * 1000) < MIN_INTERVAL) {\n dom.addClass(input, 'is-invalid');\n return;\n } else {\n dom.removeClass(input, 'is-invalid');\n writeInterval(node, Math.round(seconds * 1000));\n }\n\n if (onWrite) { onWrite(); }\n });\n\n return {\n id: id,\n input: input,\n render: function() {\n var interval = intervalOf(node);\n\n dom.removeClass(input, 'is-invalid');\n input.value = interval === null ? '' : String(interval / 1000);\n },\n };\n }\n\n function checkbox(labelKey, onChange) {\n var id = nextId();\n var box = dom.element('div', { 'class': 'form-check' });\n var input = box.appendChild(dom.element('input', { 'class': 'form-check-input', type: 'checkbox', id: id }));\n\n box.appendChild(dom.element('label', { 'class': 'form-check-label', 'for': id }, ge.t(labelKey)));\n input.addEventListener('change', function() { onChange(input.checked); });\n\n return { box: box, input: input };\n }\n\n /** The Carousel section of a carousel's settings panel. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-carousel-options' });\n var inputs = {};\n\n function change(key, value) {\n write(container, key, value);\n suspend(container);\n render();\n }\n\n var rideId = nextId();\n var ride = dom.element('select', { 'class': 'form-select form-select-sm', id: rideId });\n\n [\n { value: 'false', labelKey: 'container.carousel_ride_no' },\n { value: 'carousel', labelKey: 'container.carousel_ride_load' },\n { value: 'true', labelKey: 'container.carousel_ride_interaction' },\n ].forEach(function(choice) {\n ride.appendChild(dom.element('option', { value: choice.value }, ge.t(choice.labelKey)));\n });\n ride.addEventListener('change', function() { change('ride', ride.value === 'false' ? false : ride.value); });\n body.appendChild(field(RIDE_LABEL.labelKey, ride, rideId));\n\n var interval = intervalField(carouselOf(container), function() { render(); });\n body.appendChild(field(INTERVAL_LABEL.labelKey, interval.input, interval.id));\n\n CHECKBOXES.concat(BEHAVIOURS).forEach(function(key) {\n var each = checkbox(LABELS[key].labelKey, function(on) { change(key, on); });\n\n inputs[key] = each.input;\n each.box.setAttribute('data-ge-carousel-option', key);\n body.appendChild(each.box);\n });\n\n /** Fill the fields from the markup, and turn off what autoplay being off leaves without use. */\n function render() {\n var values = read(container);\n\n ride.value = String(values.ride);\n interval.render();\n Object.keys(inputs).forEach(function(key) { inputs[key].checked = values[key]; });\n\n interval.input.disabled = values.ride === false;\n inputs.pause.disabled = values.ride === false;\n }\n\n render();\n sections.push({ node: container, element: body, render: render });\n\n return body;\n }\n\n /** The Slide section of a slide's settings panel. */\n function createItemSection(item) {\n var body = dom.element('div', { 'class': 'ge-carousel-options' });\n var interval = intervalField(item);\n\n body.appendChild(field(INTERVAL_LABEL.labelKey, interval.input, interval.id));\n interval.render();\n sections.push({ node: item, element: body, render: interval.render });\n\n return body;\n }\n\n return {\n labelKey: 'container.add_carousel',\n addPaneKey: 'container.add_carousel_item',\n paneKind: 'carousel-item',\n paneClass: 'ge-carousel-item',\n paneLabelKey: 'panel.kind_carousel_item',\n\n /**\n * `slides` slides, each a region, and the options of DEFAULTS as the\n * call, the carousel setting or the defaults give them.\n */\n create: function(options) {\n options = options || {};\n\n var container = dom.element('div', { 'data-ge-container': 'carousel' });\n var carousel = container.appendChild(dom.element('div', { 'class': 'carousel slide', id: ge.containerId('carousel') }));\n var slides = chosen(options, 'slides');\n\n carousel.appendChild(dom.element('div', { 'class': 'carousel-inner' }));\n\n for (var i = 0; i < slides; i++) {\n buildItem(container, i === 0);\n }\n\n Object.keys(DEFAULTS).filter(function(key) { return key !== 'slides'; }).forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n return container;\n },\n\n addPane: addSlideTo,\n\n mark: function(container) {\n var carousel = carouselOf(container);\n if (!carousel || !usable(container)) { return; }\n\n stopBootstrap(carousel);\n suspend(container);\n\n var current = currentOf(container);\n\n itemsOf(container).forEach(function(item) {\n dom.addClass(item, 'ge-carousel-item');\n dom.removeClass(item, TRANSITION);\n\n if (!dom.child(item, '.ge-tools-drawer')) { createItemControls(container, item); }\n });\n\n show(container, current);\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n if (!usable(container)) { return; }\n\n // What the page ships starts at the first slide, whichever one\n // the canvas was showing\n itemsOf(container).forEach(function(item, index) {\n dom.removeClass(item, 'ge-carousel-item ' + TRANSITION);\n dom.toggleClass(item, 'active', index === 0);\n dom.dropEmptyClass(item);\n });\n\n syncIndicators(container, itemsOf(container).length ? 0 : -1);\n },\n\n // The same, on a copy of the canvas: unmark only touches markup\n cleanMarkup: function(root) {\n var definition = this;\n dom.all(root, '[data-ge-container=\"carousel\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n // The arrows, the counter and the arrow's other side: what moves the\n // carousel from slide to slide while it is edited\n tools: function(drawer, container) {\n if (!usable(container)) { return; }\n\n ge.createTool(drawer, ge.t('tool.carousel_show_previous'), 'ge-carousel-previous', 'bi bi-chevron-left', function() {\n if (!disabled(this)) { step(container, -1); }\n });\n\n var counter = ge.createTool(drawer, '', 'ge-carousel-counter', '', null);\n counter.textContent = '';\n counter.removeAttribute('title');\n\n ge.createTool(drawer, ge.t('tool.carousel_show_next'), 'ge-carousel-next', 'bi bi-chevron-right', function() {\n if (!disabled(this)) { step(container, 1); }\n });\n\n refreshNavigation(container);\n },\n\n panelSection: function(node, kind) {\n if (kind === 'carousel' && usable(node)) {\n return { labelKey: 'container.carousel_section', body: createSection(node) };\n }\n\n if (kind === 'carousel-item') {\n return { labelKey: 'container.carousel_item_section', body: createItemSection(node) };\n }\n\n return null;\n },\n\n // After a view change or a change of classes: the sections follow\n onRefresh: function(scope) {\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.node === scope || scope.contains(entry.node)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\n },\n };\n};\n"],
5
- "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAO,MAAM,UAAU,MAAM,KAAKA,EAAK,iBAAiBC,CAAQ,CAAC,EAAI,CAAC,CACjF,CAiBO,SAASC,EAASC,EAAMC,EAAU,CACrC,OA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AAKG,EAAOH,CAAS,EAErB,CAAAJ,EAAG,WAAW6D,EAAQ7D,EAAG,EAAE,6BAA6B,EAAG,uBAAwB,qBAAsB,UAAW,CAC3G4D,EAAS,IAAI,GAAKL,EAAKnD,EAAW,EAAE,CAC7C,CAAC,EAED,IAAI0D,EAAU9D,EAAG,WAAW6D,EAAQ,GAAI,sBAAuB,GAAI,IAAI,EACvEC,EAAQ,YAAc,GACtBA,EAAQ,gBAAgB,OAAO,EAE/B9D,EAAG,WAAW6D,EAAQ7D,EAAG,EAAE,yBAAyB,EAAG,mBAAoB,sBAAuB,UAAW,CACpG4D,EAAS,IAAI,GAAKL,EAAKnD,EAAW,CAAC,CAC5C,CAAC,EAEDkD,EAAkBlD,CAAS,EAC/B,EAEA,aAAc,SAASS,EAAM6F,EAAM,CAC/B,OAAIA,IAAS,YAAcnG,EAAOM,CAAI,EAC3B,CAAE,SAAU,6BAA8B,KAAM8E,GAAc9E,CAAI,CAAE,EAG3E6F,IAAS,gBACF,CAAE,SAAU,kCAAmC,KAAMP,GAAkBtF,CAAI,CAAE,EAGjF,IACX,EAGA,UAAW,SAAS8F,EAAO,CACvBzG,EAAWA,EAAS,OAAO,SAAS0G,EAAO,CAAE,OAAOA,EAAM,QAAQ,WAAa,CAAC,EAChF1G,EAAS,QAAQ,SAAS0G,EAAO,EACzBA,EAAM,OAASD,GAASA,EAAM,SAASC,EAAM,IAAI,IAAKA,EAAM,OAAO,CAC3E,CAAC,CACL,EAEA,SAAU,UAAW,CACjB1G,EAAW,CAAC,CAChB,CACJ,CACJ",
4
+ "sourcesContent": ["/**\n * What a plugin's or a locale's classic script imports in place of the\n * editor: the GridEditor the page already loaded.\n *\n * The build points `import { GridEditor } from '../grideditor.js'` here for\n * the classic scripts, so each registers on the editor the page has rather\n * than bringing its own. Loaded before the editor there is nothing to\n * register on, and saying so is better than a TypeError three calls later.\n */\nvar GridEditor = window.GridEditor;\n\nif (!GridEditor || typeof GridEditor.get !== 'function') {\n throw new Error('grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, ' +\n 'its locales and grideditor.jquery.js');\n}\n\nexport { GridEditor };\nexport default GridEditor;\n", "/**\n * The DOM, the way grid-editor uses it.\n *\n * Small helpers over the browser's own API, for the core and the shipped\n * plugins. Not a public API: a plugin of a host's own is free to write its\n * DOM code however it likes, and this file makes no promise to it.\n *\n * Stateless on purpose. The build puts a copy of this file in each plugin's\n * classic script, so anything kept here would be kept once per copy; a\n * module that needs to remember something about a node keeps its own\n * WeakMap.\n */\n\n/** Every element under `root` matching `selector`, as an array. */\nexport function all(root, selector) {\n return root ? Array.prototype.slice.call(root.querySelectorAll(selector)) : [];\n}\n\n/** The first element under `root` matching `selector`, or null. */\nexport function one(root, selector) {\n return root ? root.querySelector(selector) : null;\n}\n\n/** `root` itself when it matches, then every element under it that does. */\nexport function selfAndAll(root, selector) {\n if (!root) { return []; }\n\n var found = all(root, selector);\n if (root.nodeType === 1 && root.matches(selector)) { found.unshift(root); }\n return found;\n}\n\n/** The element children of `node`, those matching `selector` if one is given. */\nexport function children(node, selector) {\n if (!node) { return []; }\n\n return Array.prototype.filter.call(node.children, function(each) {\n return !selector || each.matches(selector);\n });\n}\n\n/** The first element child matching `selector`, or null. */\nexport function child(node, selector) {\n return children(node, selector)[0] || null;\n}\n\n/** The nearest ancestor-or-self matching `selector` below `stopAt`, or null. */\nexport function closest(node, selector, stopAt) {\n var found = node && node.nodeType === 1 ? node.closest(selector) : null;\n\n if (found && stopAt && found !== stopAt && !stopAt.contains(found)) { return null; }\n return found;\n}\n\n/** Whether `node` is an element matching `selector`. */\nexport function is(node, selector) {\n return !!node && node.nodeType === 1 && node.matches(selector);\n}\n\n/** Whether `node` is in the document. */\nexport function attached(node) {\n return !!node && document.documentElement.contains(node);\n}\n\n/** The element siblings after `node` that match `selector`. */\nexport function nextAll(node, selector) {\n var found = [];\n\n for (var next = node.nextElementSibling; next; next = next.nextElementSibling) {\n if (!selector || next.matches(selector)) { found.push(next); }\n }\n return found;\n}\n\n/** The ancestors of `node` up to, and not including, `stop`, nearest first. */\nexport function parentsUntil(node, stop) {\n var found = [];\n\n for (var parent = node.parentElement; parent && parent !== stop; parent = parent.parentElement) {\n found.push(parent);\n }\n return found;\n}\n\n/**\n * The nodes the html parses into, detached. Parsed the way innerHTML parses,\n * so a <script> in it never runs, here or once it is in the page.\n */\nexport function parse(html) {\n var template = document.createElement('template');\n template.innerHTML = html;\n return Array.prototype.slice.call(template.content.childNodes);\n}\n\n/** The one element the html is, detached. */\nexport function create(html) {\n var nodes = parse(html.trim());\n\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].nodeType === 1) { return nodes[i]; }\n }\n return null;\n}\n\n/** An element of `tag`, with `attributes` and `text`. */\nexport function element(tag, attributes, text) {\n var node = document.createElement(tag);\n\n Object.keys(attributes || {}).forEach(function(name) {\n var value = attributes[name];\n if (value !== null && value !== undefined && value !== false) { node.setAttribute(name, value); }\n });\n if (text !== undefined && text !== null) { node.textContent = text; }\n\n return node;\n}\n\n/** Replace what `node` holds with `html`. A <script> in it does not run. */\nexport function setHtml(node, html) {\n node.innerHTML = html === undefined || html === null ? '' : String(html);\n return node;\n}\n\n/** Add one or several space separated classes. */\nexport function addClass(node, names) {\n split(names).forEach(function(name) { node.classList.add(name); });\n return node;\n}\n\nexport function removeClass(node, names) {\n split(names).forEach(function(name) { node.classList.remove(name); });\n return node;\n}\n\n/** Each class on, or off, or flipped when `on` is not given. */\nexport function toggleClass(node, names, state) {\n split(names).forEach(function(name) {\n if (state === undefined) {\n node.classList.toggle(name);\n } else {\n node.classList.toggle(name, !!state);\n }\n });\n return node;\n}\n\nexport function hasClass(node, name) {\n return !!node && node.nodeType === 1 && node.classList.contains(name);\n}\n\nfunction split(names) {\n return String(names || '').split(/\\s+/).filter(Boolean);\n}\n\n/** Take the class attribute off when there is nothing left in it. */\nexport function dropEmptyClass(node) {\n if (!node.getAttribute('class')) { node.removeAttribute('class'); }\n return node;\n}\n\n/** Take the style attribute off when there is nothing left in it. */\nexport function dropEmptyStyle(node) {\n if (!node.getAttribute('style')) { node.removeAttribute('style'); }\n return node;\n}\n\n/** Set attributes; a null or undefined value takes the attribute off. */\nexport function attr(node, attributes) {\n Object.keys(attributes).forEach(function(name) {\n var value = attributes[name];\n\n if (value === null || value === undefined) {\n node.removeAttribute(name);\n } else {\n node.setAttribute(name, value);\n }\n });\n return node;\n}\n\n/**\n * Inline styles, by css property name. A number is pixels for the properties\n * that take a length, as jQuery had it; an empty string takes one off.\n */\nexport function css(node, styles) {\n Object.keys(styles).forEach(function(property) {\n var value = styles[property];\n\n if (typeof value === 'number' && !UNITLESS[property]) { value = value + 'px'; }\n node.style.setProperty(property, value === null || value === undefined ? '' : String(value));\n });\n return node;\n}\n\nvar UNITLESS = { opacity: true, 'z-index': true, 'flex-grow': true, 'flex-shrink': true, order: true };\n\n/** What an element of this tag shows as when nothing hides it. */\nvar defaultDisplays = {};\n\nfunction defaultDisplay(node) {\n var tag = node.nodeName;\n\n if (!defaultDisplays[tag]) {\n var probe = document.body.appendChild(document.createElement(tag));\n defaultDisplays[tag] = getComputedStyle(probe).display;\n probe.remove();\n if (defaultDisplays[tag] === 'none') { defaultDisplays[tag] = 'block'; }\n }\n return defaultDisplays[tag];\n}\n\n/** Show a node: its inline display:none off, and a display of its own if a stylesheet hides it. */\nexport function show(node) {\n node.style.removeProperty('display');\n if (getComputedStyle(node).display === 'none') { node.style.display = defaultDisplay(node); }\n return node;\n}\n\nexport function hide(node) {\n node.style.display = 'none';\n return node;\n}\n\n/** Show or hide; flip when `on` is not given. */\nexport function toggle(node, state) {\n if (state === undefined) { state = !visible(node); }\n return state ? show(node) : hide(node);\n}\n\n/** Whether a node takes up room: what jQuery's :visible meant. */\nexport function visible(node) {\n return !!(node.offsetWidth || node.offsetHeight || node.getClientRects().length);\n}\n\n/** The border box's width, fractions included. */\nexport function outerWidth(node) {\n return node.getBoundingClientRect().width;\n}\n\nexport function outerHeight(node) {\n return node.getBoundingClientRect().height;\n}\n\n/** The content box's height, which is what jQuery's height() gave. */\nexport function contentHeight(node) {\n var style = getComputedStyle(node);\n return node.clientHeight - parseFloat(style.paddingTop) - parseFloat(style.paddingBottom);\n}\n\n/** Where a node is on the page, not in the window. */\nexport function offset(node) {\n var box = node.getBoundingClientRect();\n return { top: box.top + window.pageYOffset, left: box.left + window.pageXOffset };\n}\n\n/** Its index among its parent's element children, those matching `selector` if given. */\nexport function indexIn(node, selector) {\n return children(node.parentElement, selector).indexOf(node);\n}\n\n/** Put `node` right after `reference`. */\nexport function insertAfter(node, reference) {\n reference.parentNode.insertBefore(node, reference.nextSibling);\n return node;\n}\n\n/** Replace `node` with what it holds. */\nexport function unwrap(node) {\n var parent = node.parentNode;\n\n while (node.firstChild) { parent.insertBefore(node.firstChild, node); }\n node.remove();\n}\n\n/** Put `node` inside `wrapper`, where `node` was. */\nexport function wrap(node, wrapper) {\n node.parentNode.insertBefore(wrapper, node);\n wrapper.appendChild(node);\n return wrapper;\n}\n\n/**\n * Listen on `root` for `types` (space separated) on descendants that match\n * `selector`, with `this` the matched element, as jQuery's delegated\n * handlers had it. Hands back the listener, for removeEventListener; a\n * signal in `options` removes it too.\n */\nexport function delegate(root, types, selector, handler, options) {\n var listener = function(event) {\n var match = closest(event.target, selector, root);\n if (match && root.contains(match)) { return handler.call(match, event); }\n return undefined;\n };\n\n split(types).forEach(function(type) { root.addEventListener(type, listener, options); });\n return listener;\n}\n\n/** Listen for several space separated event types with one handler. */\nexport function on(target, types, handler, options) {\n split(types).forEach(function(type) { target.addEventListener(type, handler, options); });\n return handler;\n}\n\nexport function off(target, types, handler, options) {\n split(types).forEach(function(type) { target.removeEventListener(type, handler, options); });\n}\n\n/** A mouse event of `type` sent to `node`, the way a pointer would. */\nexport function fire(node, type) {\n node.dispatchEvent(new MouseEvent(type, { bubbles: type !== 'mouseenter' && type !== 'mouseleave' }));\n}\n\n/* ------------------------------------------------------------------\n * Taking a node away, visibly.\n *\n * The durations are jQuery's: 400 ms unless the caller says otherwise. `done` runs once the node is out of sight, which is\n * when the caller removes it; a node that is already out of sight is done at\n * once, on the next task, as jQuery had it.\n * ------------------------------------------------------------------ */\n\nvar DEFAULT_DURATION = 400;\n\nfunction animateAway(node, frames, duration, done) {\n duration = duration === undefined ? DEFAULT_DURATION : duration;\n\n var finish = function() {\n hide(node);\n if (done) { done(); }\n };\n\n if (!visible(node) || !node.animate || duration <= 0) {\n window.setTimeout(finish, 0);\n return;\n }\n\n var animation = node.animate(frames(getComputedStyle(node)), {\n duration: duration,\n easing: 'ease-in-out',\n });\n var called = false;\n var once = function() {\n if (called) { return; }\n called = true;\n finish();\n };\n\n animation.onfinish = once;\n animation.oncancel = once;\n}\n\n/** Fold a node up to nothing, then hide it. */\nexport function slideUp(node, duration, done) {\n if (typeof duration === 'function') {\n done = duration;\n duration = undefined;\n }\n\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n return [\n {\n height: style.height,\n paddingTop: style.paddingTop,\n paddingBottom: style.paddingBottom,\n marginTop: style.marginTop,\n marginBottom: style.marginBottom,\n },\n { height: '0px', paddingTop: '0px', paddingBottom: '0px', marginTop: '0px', marginBottom: '0px' },\n ];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n\n/** Fade a node out, then hide it. */\nexport function fadeOut(node, duration, done) {\n animateAway(node, function(style) {\n return [{ opacity: style.opacity }, { opacity: 0 }];\n }, duration, done);\n}\n\n/** Fade and fold a node, in height and, with `width`, sideways too, then hide it. */\nexport function shrinkAway(node, duration, done, width) {\n node.style.overflow = 'hidden';\n animateAway(node, function(style) {\n var from = { opacity: style.opacity, height: style.height };\n var to = { opacity: 0, height: '0px' };\n\n if (width) {\n from.width = style.width;\n to.width = '0px';\n }\n return [from, to];\n }, duration, function() {\n node.style.removeProperty('overflow');\n if (done) { done(); }\n });\n}\n", "/**\n * Carousels for grid-editor.\n *\n * A container plugin: load this file after the editor and the toolbar offers\n * a carousel, a bootstrap carousel whose slides are editable regions. What it\n * can ask the editor for is the handle its factory is called with, described\n * in docs/plugins.md.\n *\n * <script src=\"dist/grideditor.min.js\"></script>\n * <script src=\"dist/plugins/grideditor.carousel.min.js\"></script>\n *\n * Only one slide shows on the canvas, as on the page. The container's drawer\n * says which, and moves to the next and the previous; Bootstrap's own arrows\n * are kept in the markup but not drawn, its indicators are drawn but do not\n * answer, and neither does its javascript:\n * the attributes it acts on are put aside while editing. A carousel's options\n * - arrows, indicators, fade, dark theme, autoplay and its interval, pause,\n * wrap, keyboard and touch - are Bootstrap's classes and attributes and\n * nothing else: they are read from the markup, chosen in the container's\n * settings panel, or given to createContainer and the carousel setting for\n * the ones made new.\n */\nimport { GridEditor } from '../grideditor.js';\nimport * as dom from '../dom.js';\n\nObject.assign(GridEditor.locales.en, {\n 'container.add_carousel': 'Carousel',\n 'container.add_carousel_item': 'Add slide',\n 'confirm.delete_carousel_item': 'Delete this slide and everything in it?',\n 'panel.kind_carousel_item': 'Slide',\n 'container.carousel_previous': 'Previous',\n 'container.carousel_next': 'Next',\n 'container.carousel_slide_label': 'Slide {number}',\n 'container.carousel_counter': '{current} / {total}',\n 'tool.carousel_show_previous': 'Previous slide',\n 'tool.carousel_show_next': 'Next slide',\n 'tool.carousel_move_back': 'Move back',\n 'tool.carousel_move_forward': 'Move forward',\n 'container.carousel_section': 'Carousel',\n 'container.carousel_controls': 'Arrows',\n 'container.carousel_indicators': 'Indicators',\n 'container.carousel_fade': 'Fade',\n 'container.carousel_dark': 'Dark theme',\n 'container.carousel_ride': 'Autoplay',\n 'container.carousel_ride_no': 'No',\n 'container.carousel_ride_load': 'On load',\n 'container.carousel_ride_interaction': 'After first interaction',\n 'container.carousel_interval': 'Interval (s)',\n 'container.carousel_pause': 'Pause on hover',\n 'container.carousel_wrap': 'Wrap around',\n 'container.carousel_keyboard': 'Keyboard',\n 'container.carousel_touch': 'Touch swipe',\n 'container.carousel_item_section': 'Slide',\n});\n\n/** What a carousel made new has when neither the call nor the setting says. */\nvar DEFAULTS = {\n controls: true,\n indicators: true,\n fade: false,\n dark: false,\n ride: false,\n interval: null,\n pause: true,\n wrap: true,\n keyboard: true,\n touch: true,\n slides: 2,\n};\n\nvar CHECKBOXES = ['controls', 'indicators', 'fade', 'dark'];\nvar BEHAVIOURS = ['pause', 'wrap', 'keyboard', 'touch'];\n\n/** Each option's checkbox in the panel, and its label. */\nvar LABELS = {\n controls: { labelKey: 'container.carousel_controls' },\n indicators: { labelKey: 'container.carousel_indicators' },\n fade: { labelKey: 'container.carousel_fade' },\n dark: { labelKey: 'container.carousel_dark' },\n pause: { labelKey: 'container.carousel_pause' },\n wrap: { labelKey: 'container.carousel_wrap' },\n keyboard: { labelKey: 'container.carousel_keyboard' },\n touch: { labelKey: 'container.carousel_touch' },\n};\nvar RIDE_LABEL = { labelKey: 'container.carousel_ride' };\nvar INTERVAL_LABEL = { labelKey: 'container.carousel_interval' };\nvar RIDES = [false, 'carousel', 'true'];\nvar MIN_INTERVAL = 1000; // ms\n\n/** What Bootstrap puts on a slide while it moves one in: never part of the page. */\nvar TRANSITION = 'carousel-item-next carousel-item-prev carousel-item-start carousel-item-end';\n\nfunction validInterval(value) {\n return typeof value === 'number' && isFinite(value) && Math.floor(value) === value && value >= MIN_INTERVAL;\n}\n\nvar CHECKS = {\n ride: function(value) { return RIDES.indexOf(value) !== -1; },\n interval: function(value) { return value === null || validInterval(value); },\n slides: function(value) { return typeof value === 'number' && Math.floor(value) === value && value >= 1; },\n};\n\n/** The values an option takes, as the warning lists them. */\nfunction takes(key) {\n if (key === 'ride') { return JSON.stringify(RIDES); }\n if (key === 'interval') { return 'null or an integer of ' + MIN_INTERVAL + ' or more'; }\n if (key === 'slides') { return 'an integer of 1 or more'; }\n\n return '[true,false]';\n}\n\nfunction isValid(key, value) {\n return CHECKS[key] ? CHECKS[key](value) : typeof value === 'boolean';\n}\n\nvar fieldCounter = 0;\n\nGridEditor.containers.carousel = function(ge) {\n\n var shown = new WeakMap(); // The slide each carousel shows, whatever its markup says\n var sections = []; // { node, element, render } for every panel section built\n\n function carouselOf(container) {\n return dom.child(container, '.carousel');\n }\n\n function innerOf(container) {\n return dom.child(carouselOf(container), '.carousel-inner');\n }\n\n /** A container with no carousel or no slides' holder is left as it is. */\n function usable(container) {\n return !!innerOf(container);\n }\n\n function itemsOf(container) {\n return dom.children(innerOf(container), '.carousel-item');\n }\n\n /** The carousel's id, which its arrows and indicators point at. */\n function idOf(carousel) {\n if (!carousel.getAttribute('id')) { carousel.setAttribute('id', ge.containerId('carousel')); }\n\n return carousel.getAttribute('id');\n }\n\n /** A Bootstrap attribute, whether it is where Bootstrap reads it or put aside for editing. */\n function bsAttribute(node, name) {\n var value = node.getAttribute('data-bs-' + name);\n\n return value === null ? node.getAttribute('data-ge-bs-' + name) : value;\n }\n\n function intervalOf(node) {\n var value = parseInt(node.getAttribute('data-bs-interval'), 10);\n\n return isFinite(value) && value > 0 ? value : null;\n }\n\n function writeInterval(node, value) {\n if (value === null) {\n node.removeAttribute('data-bs-interval');\n } else {\n node.setAttribute('data-bs-interval', String(value));\n }\n }\n\n /** What a carousel's classes and attributes say it is. */\n function read(container) {\n var carousel = carouselOf(container);\n var ride = bsAttribute(carousel, 'ride');\n var off = function(name) { return carousel.getAttribute('data-bs-' + name) !== 'false'; };\n\n return {\n controls: !!dom.child(carousel, '.carousel-control-prev, .carousel-control-next'),\n indicators: !!dom.child(carousel, '.carousel-indicators'),\n fade: dom.hasClass(carousel, 'carousel-fade'),\n dark: carousel.getAttribute('data-bs-theme') === 'dark',\n ride: ride === 'carousel' || ride === 'true' ? ride : false,\n interval: intervalOf(carousel),\n pause: off('pause'),\n wrap: off('wrap'),\n keyboard: off('keyboard'),\n touch: off('touch'),\n };\n }\n\n function controlButton(carousel, direction) {\n var button = dom.element('button', {\n 'class': 'carousel-control-' + direction,\n type: 'button',\n 'data-bs-target': '#' + idOf(carousel),\n 'data-bs-slide': direction,\n });\n\n button.appendChild(dom.element('span', { 'class': 'carousel-control-' + direction + '-icon', 'aria-hidden': 'true' }));\n button.appendChild(dom.element('span', { 'class': 'visually-hidden' },\n direction === 'prev' ? ge.t('container.carousel_previous') : ge.t('container.carousel_next')));\n\n return button;\n }\n\n function setControls(container, on) {\n var carousel = carouselOf(container);\n\n dom.children(carousel, '.carousel-control-prev, .carousel-control-next').forEach(function(button) { button.remove(); });\n\n if (on) {\n carousel.appendChild(controlButton(carousel, 'prev'));\n carousel.appendChild(controlButton(carousel, 'next'));\n }\n }\n\n function setIndicators(container, on) {\n var carousel = carouselOf(container);\n var bar = dom.child(carousel, '.carousel-indicators');\n\n if (!on) {\n if (bar) { bar.remove(); }\n return;\n }\n\n if (!bar) {\n bar = carousel.insertBefore(dom.element('div', { 'class': 'carousel-indicators' }), carousel.firstChild);\n }\n\n rebuildIndicators(container);\n }\n\n /** One indicator a slide, in the slides' order, the shown one marked. */\n function rebuildIndicators(container, list) {\n var carousel = carouselOf(container);\n var bar = dom.child(carousel, '.carousel-indicators');\n if (!bar) { return; }\n\n list = list || itemsOf(container);\n var id = idOf(carousel);\n var active = 0;\n\n list.forEach(function(item, index) {\n if (dom.hasClass(item, 'active')) { active = index; }\n });\n\n bar.textContent = '';\n list.forEach(function(item, index) {\n bar.appendChild(dom.element('button', {\n type: 'button',\n 'data-bs-target': '#' + id,\n 'data-bs-slide-to': String(index),\n 'aria-label': ge.t('container.carousel_slide_label', { number: index + 1 }),\n }));\n });\n\n syncIndicators(container, list.length ? active : -1);\n }\n\n function syncIndicators(container, index) {\n var bar = dom.child(carouselOf(container), '.carousel-indicators');\n\n dom.children(bar).forEach(function(indicator, position) {\n dom.toggleClass(indicator, 'active', position === index);\n\n if (position === index) {\n indicator.setAttribute('aria-current', 'true');\n } else {\n indicator.removeAttribute('aria-current');\n }\n });\n }\n\n function write(container, key, value) {\n var carousel = carouselOf(container);\n\n if (key === 'controls') { setControls(container, value); }\n if (key === 'indicators') { setIndicators(container, value); }\n if (key === 'fade') { dom.toggleClass(carousel, 'carousel-fade', value); }\n\n if (key === 'dark') {\n if (value) {\n carousel.setAttribute('data-bs-theme', 'dark');\n } else if (carousel.getAttribute('data-bs-theme') === 'dark') {\n carousel.removeAttribute('data-bs-theme');\n }\n }\n\n if (key === 'ride') {\n carousel.removeAttribute('data-bs-ride');\n carousel.removeAttribute('data-ge-bs-ride');\n if (value) { carousel.setAttribute('data-bs-ride', value); }\n }\n\n if (key === 'interval') { writeInterval(carousel, value); }\n\n if (BEHAVIOURS.indexOf(key) !== -1) {\n if (value) {\n carousel.removeAttribute('data-bs-' + key);\n } else {\n carousel.setAttribute('data-bs-' + key, 'false');\n }\n }\n\n dom.dropEmptyClass(carousel);\n }\n\n /**\n * A value for a new carousel: the option, or the carousel setting, or the\n * default. One the option does not take is warned about and the default used.\n */\n function chosen(options, key) {\n var setting = ge.settings.carousel || {};\n var value = options[key] !== undefined ? options[key] : setting[key];\n\n if (value === undefined) { return DEFAULTS[key]; }\n if (isValid(key, value)) { return value; }\n\n ge.warn('carousel: ' + JSON.stringify(value) + ' is not a ' + key + ', which takes ' +\n takes(key) + ': ' + JSON.stringify(DEFAULTS[key]) + ' is used');\n return DEFAULTS[key];\n }\n\n /** What stops Bootstrap's javascript acting on the carousel while it is edited. */\n function suspend(container) {\n var carousel = carouselOf(container);\n\n dom.children(carousel, '.carousel-control-prev, .carousel-control-next').forEach(ge.suspendToggles);\n dom.children(dom.child(carousel, '.carousel-indicators')).forEach(ge.suspendToggles);\n\n // By hand: suspendToggles(carousel) would take a tabs or an accordion\n // inside a slide off its toggles as well\n var ride = carousel.getAttribute('data-bs-ride');\n if (ride !== null) {\n carousel.setAttribute('data-ge-bs-ride', ride);\n carousel.removeAttribute('data-bs-ride');\n }\n }\n\n /** A carousel Bootstrap started before the editor did stops, and is forgotten. */\n function stopBootstrap(carousel) {\n var library = GridEditor.bootstrap || window.bootstrap;\n var instance = library && library.Carousel ? library.Carousel.getInstance(carousel) : null;\n\n if (instance) {\n instance.pause();\n instance.dispose();\n }\n }\n\n function buildItem(container, active, interval) {\n var item = innerOf(container).appendChild(dom.element('div', { 'class': active ? 'carousel-item active' : 'carousel-item' }));\n\n item.appendChild(ge.defaultRegion());\n if (interval !== null && interval !== undefined) { writeInterval(item, interval); }\n\n return item;\n }\n\n /** The slide the carousel shows: the one it was left on, or the markup's, or the first. */\n function currentOf(container) {\n var list = itemsOf(container);\n var kept = shown.get(container);\n\n if (kept && list.indexOf(kept) !== -1) { return kept; }\n\n return list.filter(function(item) { return dom.hasClass(item, 'active'); })[0] || list[0] || null;\n }\n\n /** Show one slide and only that one. */\n function show(container, item, list) {\n list = list || itemsOf(container);\n\n list.forEach(function(each) { dom.toggleClass(each, 'active', each === item); });\n\n if (item) {\n shown.set(container, item);\n } else {\n shown.delete(container);\n }\n\n syncIndicators(container, list.indexOf(item));\n refreshNavigation(container);\n }\n\n function step(container, offset) {\n var list = itemsOf(container);\n if (list.length < 2) { return; }\n\n var index = list.indexOf(currentOf(container));\n show(container, list[(index + offset + list.length) % list.length]);\n }\n\n function disable(tool, state) {\n if (!tool) { return; }\n\n dom.toggleClass(tool, 'disabled', state);\n\n if (state) {\n tool.setAttribute('aria-disabled', 'true');\n } else {\n tool.removeAttribute('aria-disabled');\n }\n }\n\n function disabled(tool) {\n return tool.getAttribute('aria-disabled') === 'true';\n }\n\n /** The container's counter and arrows, and every slide's move tools, as the slides stand. */\n function refreshNavigation(container) {\n var list = itemsOf(container);\n var drawer = dom.child(container, '.ge-container-drawer');\n var index = list.indexOf(currentOf(container));\n\n if (drawer) {\n var counter = dom.child(drawer, '.ge-carousel-counter');\n\n if (counter) {\n counter.textContent = ge.t('container.carousel_counter', {\n current: list.length ? index + 1 : 0,\n total: list.length,\n });\n }\n\n disable(dom.child(drawer, '.ge-carousel-previous'), list.length < 2);\n disable(dom.child(drawer, '.ge-carousel-next'), list.length < 2);\n }\n\n list.forEach(function(item, position) {\n var tools = dom.child(item, '.ge-pane-drawer');\n\n disable(dom.child(tools, '.ge-carousel-move-back'), position === 0);\n disable(dom.child(tools, '.ge-carousel-move-forward'), position === list.length - 1);\n });\n }\n\n function moveItem(container, item, offset) {\n var inner = innerOf(container);\n var list = itemsOf(container);\n var index = list.indexOf(item);\n var target = index + offset;\n\n if (target < 0 || target >= list.length) { return; }\n\n var from = { parent: inner, index: index };\n\n ge.operate(function() {\n if (!ge.emit('before-move', ge.payloadFor('carousel-item', item, {\n parent: inner,\n source: 'tool',\n from: from,\n }))) { return; }\n\n inner.insertBefore(item, offset < 0 ? list[target] : list[target].nextSibling);\n show(container, currentOf(container));\n rebuildIndicators(container);\n suspend(container);\n\n ge.emit('after-move', ge.payloadFor('carousel-item', item, {\n parent: inner,\n source: 'tool',\n from: from,\n to: { parent: inner, index: target },\n container: container,\n }));\n });\n }\n\n /** What the slide to show is once `item` goes: the next one, or the previous if it was the last. */\n function afterRemoving(container, item, removed) {\n dom.fadeOut(item, 200, function() {\n var list = itemsOf(container);\n var rest = list.filter(function(each) { return each !== item; });\n\n if (currentOf(container) === item) {\n show(container, rest[Math.min(list.indexOf(item), rest.length - 1)] || null, rest);\n }\n\n rebuildIndicators(container, rest);\n removed();\n });\n }\n\n function createItemControls(container, item) {\n var drawer = ge.createPaneControls(item, 'carousel-item', ge.settings.carousel_tools,\n ge.t('confirm.delete_carousel_item'), function(removed) {\n afterRemoving(container, item, removed);\n });\n\n // A slide moves a place at a time, not by dragging\n var handle = dom.child(drawer, '.ge-move');\n if (handle) { handle.remove(); }\n\n var back = ge.createTool(drawer, ge.t('tool.carousel_move_back'), 'ge-carousel-move-back', 'bi bi-arrow-left', function() {\n if (!disabled(this)) { moveItem(container, item, -1); }\n });\n var forward = ge.createTool(drawer, ge.t('tool.carousel_move_forward'), 'ge-carousel-move-forward', 'bi bi-arrow-right', function() {\n if (!disabled(this)) { moveItem(container, item, 1); }\n });\n\n drawer.insertBefore(forward, drawer.firstChild);\n drawer.insertBefore(back, forward);\n }\n\n function addSlideTo(container, options) {\n options = options || {};\n\n if (!usable(container)) {\n ge.warn('carousel: there is no .carousel-inner to add a slide to');\n return null;\n }\n\n var interval = null;\n\n if (options.interval !== undefined && options.interval !== null) {\n if (validInterval(options.interval)) {\n interval = options.interval;\n } else {\n ge.warn('carousel: ' + JSON.stringify(options.interval) + ' is not a interval, which takes ' +\n takes('interval') + ': null is used');\n }\n }\n\n var item = buildItem(container, false, interval);\n\n show(container, item);\n rebuildIndicators(container);\n\n return item;\n }\n\n function field(labelKey, control, id) {\n var box = dom.element('div', { 'class': 'ge-carousel-option mb-2' });\n\n box.appendChild(dom.element('label', { 'class': 'form-label', 'for': id }, ge.t(labelKey)));\n box.appendChild(control);\n\n return box;\n }\n\n function nextId() {\n return 'ge-carousel-option-' + (++fieldCounter);\n }\n\n /**\n * The interval in seconds, for a node: empty takes it off, under a\n * second is refused and the field says so, and anything else is written\n * in milliseconds.\n */\n function intervalField(node, onWrite) {\n var id = nextId();\n var input = dom.element('input', {\n 'class': 'form-control form-control-sm',\n id: id,\n type: 'number',\n step: '0.1',\n min: String(MIN_INTERVAL / 1000),\n });\n\n input.addEventListener('change', function() {\n var text = input.value.trim();\n var seconds = parseFloat(text);\n\n if (text === '') {\n dom.removeClass(input, 'is-invalid');\n writeInterval(node, null);\n } else if (!isFinite(seconds) || Math.round(seconds * 1000) < MIN_INTERVAL) {\n dom.addClass(input, 'is-invalid');\n return;\n } else {\n dom.removeClass(input, 'is-invalid');\n writeInterval(node, Math.round(seconds * 1000));\n }\n\n if (onWrite) { onWrite(); }\n });\n\n return {\n id: id,\n input: input,\n render: function() {\n var interval = intervalOf(node);\n\n dom.removeClass(input, 'is-invalid');\n input.value = interval === null ? '' : String(interval / 1000);\n },\n };\n }\n\n function checkbox(labelKey, onChange) {\n var id = nextId();\n var box = dom.element('div', { 'class': 'form-check' });\n var input = box.appendChild(dom.element('input', { 'class': 'form-check-input', type: 'checkbox', id: id }));\n\n box.appendChild(dom.element('label', { 'class': 'form-check-label', 'for': id }, ge.t(labelKey)));\n input.addEventListener('change', function() { onChange(input.checked); });\n\n return { box: box, input: input };\n }\n\n /** The Carousel section of a carousel's settings panel. */\n function createSection(container) {\n var body = dom.element('div', { 'class': 'ge-carousel-options' });\n var inputs = {};\n\n function change(key, value) {\n write(container, key, value);\n suspend(container);\n render();\n }\n\n var rideId = nextId();\n var ride = dom.element('select', { 'class': 'form-select form-select-sm', id: rideId });\n\n [\n { value: 'false', labelKey: 'container.carousel_ride_no' },\n { value: 'carousel', labelKey: 'container.carousel_ride_load' },\n { value: 'true', labelKey: 'container.carousel_ride_interaction' },\n ].forEach(function(choice) {\n ride.appendChild(dom.element('option', { value: choice.value }, ge.t(choice.labelKey)));\n });\n ride.addEventListener('change', function() { change('ride', ride.value === 'false' ? false : ride.value); });\n body.appendChild(field(RIDE_LABEL.labelKey, ride, rideId));\n\n var interval = intervalField(carouselOf(container), function() { render(); });\n body.appendChild(field(INTERVAL_LABEL.labelKey, interval.input, interval.id));\n\n CHECKBOXES.concat(BEHAVIOURS).forEach(function(key) {\n var each = checkbox(LABELS[key].labelKey, function(on) { change(key, on); });\n\n inputs[key] = each.input;\n each.box.setAttribute('data-ge-carousel-option', key);\n body.appendChild(each.box);\n });\n\n /** Fill the fields from the markup, and turn off what autoplay being off leaves without use. */\n function render() {\n var values = read(container);\n\n ride.value = String(values.ride);\n interval.render();\n Object.keys(inputs).forEach(function(key) { inputs[key].checked = values[key]; });\n\n interval.input.disabled = values.ride === false;\n inputs.pause.disabled = values.ride === false;\n }\n\n render();\n sections.push({ node: container, element: body, render: render });\n\n return body;\n }\n\n /** The Slide section of a slide's settings panel. */\n function createItemSection(item) {\n var body = dom.element('div', { 'class': 'ge-carousel-options' });\n var interval = intervalField(item);\n\n body.appendChild(field(INTERVAL_LABEL.labelKey, interval.input, interval.id));\n interval.render();\n sections.push({ node: item, element: body, render: interval.render });\n\n return body;\n }\n\n return {\n labelKey: 'container.add_carousel',\n addPaneKey: 'container.add_carousel_item',\n paneKind: 'carousel-item',\n paneClass: 'ge-carousel-item',\n paneLabelKey: 'panel.kind_carousel_item',\n\n /**\n * `slides` slides, each a region, and the options of DEFAULTS as the\n * call, the carousel setting or the defaults give them.\n */\n create: function(options) {\n options = options || {};\n\n var container = dom.element('div', { 'data-ge-container': 'carousel' });\n var carousel = container.appendChild(dom.element('div', { 'class': 'carousel slide', id: ge.containerId('carousel') }));\n var slides = chosen(options, 'slides');\n\n carousel.appendChild(dom.element('div', { 'class': 'carousel-inner' }));\n\n for (var i = 0; i < slides; i++) {\n buildItem(container, i === 0);\n }\n\n Object.keys(DEFAULTS).filter(function(key) { return key !== 'slides'; }).forEach(function(key) {\n write(container, key, chosen(options, key));\n });\n\n return container;\n },\n\n addPane: addSlideTo,\n\n mark: function(container) {\n var carousel = carouselOf(container);\n if (!carousel || !usable(container)) { return; }\n\n stopBootstrap(carousel);\n suspend(container);\n\n var current = currentOf(container);\n\n itemsOf(container).forEach(function(item) {\n dom.addClass(item, 'ge-carousel-item');\n dom.removeClass(item, TRANSITION);\n\n if (!dom.child(item, '.ge-tools-drawer')) { createItemControls(container, item); }\n });\n\n show(container, current);\n },\n\n unmark: function(container) {\n ge.resumeToggles(container);\n if (!usable(container)) { return; }\n\n // What the page ships starts at the first slide, whichever one\n // the canvas was showing\n itemsOf(container).forEach(function(item, index) {\n dom.removeClass(item, 'ge-carousel-item ' + TRANSITION);\n dom.toggleClass(item, 'active', index === 0);\n dom.dropEmptyClass(item);\n });\n\n syncIndicators(container, itemsOf(container).length ? 0 : -1);\n },\n\n // The same, on a copy of the canvas: unmark only touches markup\n cleanMarkup: function(root) {\n var definition = this;\n dom.all(root, '[data-ge-container=\"carousel\"]').forEach(function(container) { definition.unmark(container); });\n },\n\n // The arrows, the counter and the arrow's other side: what moves the\n // carousel from slide to slide while it is edited\n tools: function(drawer, container) {\n if (!usable(container)) { return; }\n\n ge.createTool(drawer, ge.t('tool.carousel_show_previous'), 'ge-carousel-previous', 'bi bi-chevron-left', function() {\n if (!disabled(this)) { step(container, -1); }\n });\n\n var counter = ge.createTool(drawer, '', 'ge-carousel-counter', '', null);\n counter.textContent = '';\n counter.removeAttribute('title');\n\n ge.createTool(drawer, ge.t('tool.carousel_show_next'), 'ge-carousel-next', 'bi bi-chevron-right', function() {\n if (!disabled(this)) { step(container, 1); }\n });\n\n refreshNavigation(container);\n },\n\n panelSection: function(node, kind) {\n if (kind === 'carousel' && usable(node)) {\n return { labelKey: 'container.carousel_section', body: createSection(node) };\n }\n\n if (kind === 'carousel-item') {\n return { labelKey: 'container.carousel_item_section', body: createItemSection(node) };\n }\n\n return null;\n },\n\n // After a view change or a change of classes: the sections follow\n onRefresh: function(scope) {\n sections = sections.filter(function(entry) { return entry.element.isConnected; });\n sections.forEach(function(entry) {\n if (entry.node === scope || scope.contains(entry.node)) { entry.render(); }\n });\n },\n\n onDeinit: function() {\n sections = [];\n },\n };\n};\n"],
5
+ "mappings": "MASA,IAAIA,EAAa,OAAO,WAExB,GAAI,CAACA,GAAc,OAAOA,EAAW,KAAQ,WACzC,MAAM,IAAI,MAAM,wHAC0B,ECCvC,SAASC,EAAIC,EAAMC,EAAU,CAChC,OAAOD,EAAO,MAAM,UAAU,MAAM,KAAKA,EAAK,iBAAiBC,CAAQ,CAAC,EAAI,CAAC,CACjF,CAiBO,SAASC,EAASC,EAAMC,EAAU,CACrC,OAAKD,EAEE,MAAM,UAAU,OAAO,KAAKA,EAAK,SAAU,SAASE,EAAM,CAC7D,MAAO,CAACD,GAAYC,EAAK,QAAQD,CAAQ,CAC7C,CAAC,EAJmB,CAAC,CAKzB,CAGO,SAASE,EAAMH,EAAMC,EAAU,CAClC,OAAOF,EAASC,EAAMC,CAAQ,EAAE,CAAC,GAAK,IAC1C,CA6DO,SAASG,EAAQC,EAAKC,EAAYC,EAAM,CAC3C,IAAIC,EAAO,SAAS,cAAcH,CAAG,EAErC,cAAO,KAAKC,GAAc,CAAC,CAAC,EAAE,QAAQ,SAASG,EAAM,CACjD,IAAIC,EAAQJ,EAAWG,CAAI,EACvBC,GAAU,MAA+BA,IAAU,IAASF,EAAK,aAAaC,EAAMC,CAAK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,aAAc,SAASS,EAAM6F,EAAM,CAC/B,OAAIA,IAAS,YAAcnG,EAAOM,CAAI,EAC3B,CAAE,SAAU,6BAA8B,KAAM8E,GAAc9E,CAAI,CAAE,EAG3E6F,IAAS,gBACF,CAAE,SAAU,kCAAmC,KAAMP,GAAkBtF,CAAI,CAAE,EAGjF,IACX,EAGA,UAAW,SAAS8F,EAAO,CACvBzG,EAAWA,EAAS,OAAO,SAAS0G,EAAO,CAAE,OAAOA,EAAM,QAAQ,WAAa,CAAC,EAChF1G,EAAS,QAAQ,SAAS0G,EAAO,EACzBA,EAAM,OAASD,GAASA,EAAM,SAASC,EAAM,IAAI,IAAKA,EAAM,OAAO,CAC3E,CAAC,CACL,EAEA,SAAU,UAAW,CACjB1G,EAAW,CAAC,CAChB,CACJ,CACJ",
6
6
  "names": ["GridEditor", "all", "root", "selector", "children", "node", "selector", "each", "child", "element", "tag", "attributes", "text", "node", "name", "value", "addClass", "node", "names", "split", "name", "removeClass", "toggleClass", "state", "hasClass", "dropEmptyClass", "hide", "node", "visible", "node", "DEFAULT_DURATION", "animateAway", "node", "frames", "duration", "done", "finish", "hide", "visible", "animation", "called", "once", "fadeOut", "node", "duration", "done", "animateAway", "style", "GridEditor", "DEFAULTS", "CHECKBOXES", "BEHAVIOURS", "LABELS", "RIDE_LABEL", "INTERVAL_LABEL", "RIDES", "MIN_INTERVAL", "TRANSITION", "validInterval", "value", "CHECKS", "takes", "key", "isValid", "fieldCounter", "ge", "shown", "sections", "carouselOf", "container", "child", "innerOf", "usable", "itemsOf", "children", "idOf", "carousel", "bsAttribute", "node", "name", "intervalOf", "writeInterval", "read", "ride", "off", "hasClass", "controlButton", "direction", "button", "element", "setControls", "on", "setIndicators", "bar", "rebuildIndicators", "list", "id", "active", "item", "index", "syncIndicators", "indicator", "position", "toggleClass", "write", "dropEmptyClass", "chosen", "options", "setting", "suspend", "stopBootstrap", "library", "instance", "buildItem", "interval", "currentOf", "kept", "show", "each", "refreshNavigation", "step", "offset", "disable", "tool", "state", "disabled", "drawer", "counter", "tools", "moveItem", "inner", "target", "from", "afterRemoving", "removed", "fadeOut", "rest", "createItemControls", "handle", "back", "forward", "addSlideTo", "field", "labelKey", "control", "box", "nextId", "intervalField", "onWrite", "input", "text", "seconds", "removeClass", "addClass", "checkbox", "onChange", "createSection", "body", "inputs", "change", "render", "rideId", "choice", "values", "createItemSection", "slides", "i", "current", "root", "definition", "all", "kind", "scope", "entry"]
7
7
  }
@@ -467,6 +467,10 @@ GridEditor.containers.tabs = function(ge) {
467
467
  all(container, ".ge-tab-pane").forEach(function(pane) {
468
468
  removeClass(pane, "ge-tab-pane");
469
469
  });
470
+ all(container, ".ge-tab").forEach(function(tab) {
471
+ removeClass(tab, "ge-tab");
472
+ dropEmptyClass(tab);
473
+ });
470
474
  ge.unwrapLabels(container);
471
475
  },
472
476
  // The same, on a copy of the canvas: unmark only touches markup
@@ -471,6 +471,10 @@
471
471
  all(container, ".ge-tab-pane").forEach(function(pane) {
472
472
  removeClass(pane, "ge-tab-pane");
473
473
  });
474
+ all(container, ".ge-tab").forEach(function(tab) {
475
+ removeClass(tab, "ge-tab");
476
+ dropEmptyClass(tab);
477
+ });
474
478
  ge.unwrapLabels(container);
475
479
  },
476
480
  // The same, on a copy of the canvas: unmark only touches markup
@@ -1 +1 @@
1
- (()=>{var x=window.GridEditor;if(!x||typeof x.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function p(t,l){return t?Array.prototype.slice.call(t.querySelectorAll(l)):[]}function g(t,l){return t?t.querySelector(l):null}function F(t,l){if(!t)return[];var o=p(t,l);return t.nodeType===1&&t.matches(l)&&o.unshift(t),o}function w(t,l){return t?Array.prototype.filter.call(t.children,function(o){return!l||o.matches(l)}):[]}function j(t,l){return w(t,l)[0]||null}function f(t,l,o){var c=document.createElement(t);return Object.keys(l||{}).forEach(function(h){var d=l[h];d!=null&&d!==!1&&c.setAttribute(h,d)}),o!=null&&(c.textContent=o),c}function b(t,l){return L(l).forEach(function(o){t.classList.add(o)}),t}function m(t,l){return L(l).forEach(function(o){t.classList.remove(o)}),t}function M(t,l,o){return L(l).forEach(function(c){o===void 0?t.classList.toggle(c):t.classList.toggle(c,!!o)}),t}function O(t,l){return!!t&&t.nodeType===1&&t.classList.contains(l)}function L(t){return String(t||"").split(/\s+/).filter(Boolean)}function k(t){return t.getAttribute("class")||t.removeAttribute("class"),t}function V(t){return t.style.display="none",t}function Y(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}var X=400;function $(t,l,o,c){o=o===void 0?X:o;var h=function(){V(t),c&&c()};if(!Y(t)||!t.animate||o<=0){window.setTimeout(h,0);return}var d=t.animate(l(getComputedStyle(t)),{duration:o,easing:"ease-in-out"}),y=!1,_=function(){y||(y=!0,h())};d.onfinish=_,d.oncancel=_}function G(t,l,o){$(t,function(c){return[{opacity:c.opacity},{opacity:0}]},l,o)}Object.assign(x.locales.en,{"container.add_tabs":"Tabs","container.add_tab":"Add tab","container.tab_label":"Tab {number}","confirm.delete_tab":"Delete this tab and everything in it?","container.tabs_section":"Tabs","container.tabs_style":"Style","container.tabs_style_tabs":"Tabs","container.tabs_style_pills":"Pills","container.tabs_style_underline":"Underline","container.tabs_width":"Width","container.tabs_width_natural":"Natural","container.tabs_width_fill":"Fill","container.tabs_width_justified":"Justified","container.tabs_align":"Alignment","container.tabs_align_start":"Start","container.tabs_align_center":"Center","container.tabs_align_end":"End","container.tabs_layout":"Layout","container.tabs_layout_horizontal":"Horizontal","container.tabs_layout_vertical":"Vertical","container.tabs_layout_vertical_from":"Vertical from {breakpoint}"});var A={tabs:"nav-tabs",pills:"nav-pills",underline:"nav-underline"},C={natural:null,fill:"nav-fill",justified:"nav-justified"},E={start:null,center:"justify-content-center",end:"justify-content-end"},K={variant:"tabs",width:"natural",align:"start",vertical:!1},B={variant:{labelKey:"container.tabs_style",choices:[{value:"tabs",labelKey:"container.tabs_style_tabs"},{value:"pills",labelKey:"container.tabs_style_pills"},{value:"underline",labelKey:"container.tabs_style_underline"}]},width:{labelKey:"container.tabs_width",choices:[{value:"natural",labelKey:"container.tabs_width_natural"},{value:"fill",labelKey:"container.tabs_width_fill"},{value:"justified",labelKey:"container.tabs_width_justified"}]},align:{labelKey:"container.tabs_align",choices:[{value:"start",labelKey:"container.tabs_align_start"},{value:"center",labelKey:"container.tabs_align_center"},{value:"end",labelKey:"container.tabs_align_end"}]},vertical:{labelKey:"container.tabs_layout"}},Z=0,S="data-ge-tabs-layout";function N(t){return Object.keys(t).map(function(l){return t[l]}).filter(Boolean)}x.containers.tabs=function(t){var l=[];function o(n){return j(n,".nav")}function c(){return t.breakpoints.slice(1)}function h(n){return n===!0?"":"-"+n}function d(n){var e=h(n);return{container:["d"+e+"-flex","align-items"+e+"-start"],strip:["flex"+e+"-column","me"+e+"-3"]}}function y(){return[!0].concat(c())}function _(n){var e=o(n),a=function(s,i){return!!s&&O(s,i)},r=function(s,i){return Object.keys(s).filter(function(v){return s[v]&&a(e,s[v])})[0]||i},u=y().filter(function(s){var i=d(s);return a(n,i.container[0])&&a(e,i.strip[0])})[0];return{variant:r(A,"tabs"),width:r(C,"natural"),align:r(E,"start"),vertical:u===void 0?!1:u}}function H(n,e,a){var r=o(n);if(r){if(e==="variant"&&(m(r,N(A).join(" ")),b(r,A[a])),(e==="width"||e==="vertical")&&(m(r,N(C).join(" ")),e==="width"&&C[a]&&b(r,C[a])),(e==="align"||e==="vertical"||e==="width"&&a!=="natural")&&(m(r,N(E).join(" ")),e==="align"&&E[a]&&b(r,E[a])),e==="vertical"&&(y().forEach(function(s){var i=d(s);m(n,i.container.join(" ")),m(r,i.strip.join(" "))}),r.removeAttribute("aria-orientation"),a!==!1)){var u=d(a);b(n,u.container.join(" ")),b(r,u.strip.join(" ")),r.setAttribute("aria-orientation","vertical")}k(n)}}function P(n){return n==="variant"?Object.keys(A):n==="width"?Object.keys(C):n==="align"?Object.keys(E):[!1].concat(y())}function J(n,e){var a=t.settings.tabs||{},r=n[e]!==void 0?n[e]:a[e];return r===void 0?K[e]:P(e).indexOf(r)!==-1?r:(t.warn("tabs: "+JSON.stringify(r)+" is not a "+e+", which takes "+JSON.stringify(P(e))+": "+JSON.stringify(K[e])+" is used"),K[e])}function W(n){var e=_(n).vertical;return e===!1?null:t.view()==="all"?(n.removeAttribute(S),/flex$/.test(getComputedStyle(n).display)?"vertical":"horizontal"):e===!0||t.breakpoints.indexOf(t.view())>=t.breakpoints.indexOf(e)?"vertical":"horizontal"}function D(n){var e=W(n);e?n.setAttribute(S,e):n.removeAttribute(S)}function I(n,e,a){var r=f("div",{class:"ge-tabs-variant"}),u="ge-tabs-variant-"+ ++Z;r.appendChild(f("label",{class:"form-label",for:u},t.t(n)));var s=r.appendChild(f("select",{class:"form-select form-select-sm",id:u}));return e.forEach(function(i){s.appendChild(f("option",{value:i.value},i.label))}),s.addEventListener("change",function(){a(s.value)}),{box:r,field:s}}function q(n){var e=f("div",{class:"ge-tabs-variants"}),a={};function r(i,v){H(n,i,v),D(n),s()}function u(i){return B[i].choices.map(function(v){return{value:v.value,label:t.t(v.labelKey)}})}["variant","width","align"].forEach(function(i){a[i]=I(B[i].labelKey,u(i),function(v){r(i,v)})}),a.vertical=I(B.vertical.labelKey,[{value:"false",label:t.t("container.tabs_layout_horizontal")},{value:"true",label:t.t("container.tabs_layout_vertical")}].concat(c().map(function(i){return{value:i,label:t.t("container.tabs_layout_vertical_from",{breakpoint:i})}})),function(i){r("vertical",i==="true"?!0:i==="false"?!1:i)}),["variant","width","align","vertical"].forEach(function(i){a[i].box.setAttribute("data-ge-tabs-variant",i),e.appendChild(a[i].box)});function s(){var i=_(n);a.variant.field.value=i.variant,a.width.field.value=i.width,a.align.field.value=i.align,a.vertical.field.value=String(i.vertical),a.width.field.disabled=i.vertical!==!1,a.align.field.disabled=i.vertical!==!1||i.width!=="natural"}return s(),l.push({container:n,element:e,render:s}),e}function R(n,e){e=e||{};var a=o(n),r=g(n,":scope > .tab-content"),u=t.containerId("tab"),s=w(a,".nav-item").length+1,i=a.appendChild(f("li",{class:"nav-item ge-tab",role:"presentation"})),v=i.appendChild(f("button",{class:"nav-link",type:"button",role:"tab","data-bs-toggle":"tab","data-bs-target":"#"+u,"aria-controls":u}));v.appendChild(f("span",{class:"ge-pane-label"},e.label||t.t("container.tab_label",{number:s})));var T=r.appendChild(f("div",{class:"tab-pane fade",role:"tabpanel",tabindex:"0",id:u}));return T.appendChild(t.defaultRegion()),(e.activate||s===1)&&U(n,T),T}function U(n,e){var a=e.getAttribute("id");p(n,":scope > .tab-content > .tab-pane").forEach(function(r){m(r,"show active")}),b(e,"show active"),p(o(n)||n,".nav-link").forEach(function(r){var u=r.getAttribute("data-bs-target")==="#"+a;M(r,"active",u),r.setAttribute("aria-selected",u?"true":"false")})}function z(n,e){var a=g(e,".nav-link"),r=a?a.getAttribute("data-bs-target"):null;return r?g(n,r):null}return{labelKey:"container.add_tabs",onSortable:function(n){n(p(t.canvas,".ge-container-tabs").map(o).filter(Boolean),{draggable:".ge-tab"})},addPaneKey:"container.add_tab",paneKind:"tab",create:function(n){var e=f("div",{"data-ge-container":"tabs"}),a=n.labels||[],r=n.tabs||a.length||2;e.appendChild(f("ul",{class:"nav nav-tabs",role:"tablist"})),e.appendChild(f("div",{class:"tab-content"})),["variant","width","align","vertical"].forEach(function(s){H(e,s,J(n,s))});for(var u=0;u<r;u++)R(e,{label:a[u]});return e},addPane:R,mark:function(n){p(n,":scope > .tab-content > .tab-pane").forEach(function(e){b(e,"ge-tab-pane")}),w(o(n)||n,".nav-item").forEach(function(e){b(e,"ge-tab");var a=g(e,".nav-link");a&&t.makeLabelEditable(t.labelIn(a)),!j(e,".ge-tools-drawer")&&t.createPaneControls(e,"tab",t.settings.tab_tools,t.t("confirm.delete_tab"),function(r){var u=z(n,e),s=O(u,"active");G(e,200,function(){u&&u.remove(),r();var i=g(n,":scope > .tab-content > .tab-pane");s&&i&&U(n,i)})})})},unmark:function(n){t.resumeToggles(n),n.removeAttribute(S),p(n,".ge-tab-pane").forEach(function(e){m(e,"ge-tab-pane")}),t.unwrapLabels(n)},cleanMarkup:function(n){var e=this;p(n,'[data-ge-container="tabs"]').forEach(function(a){e.unmark(a)})},panelSection:function(n,e){return e!=="tabs"||!o(n)?null:{labelKey:"container.tabs_section",body:q(n)}},onRefresh:function(n){F(n,'[data-ge-container="tabs"]').forEach(D),l=l.filter(function(e){return e.element.isConnected}),l.forEach(function(e){(e.container===n||n.contains(e.container))&&e.render()})},onDeinit:function(){l=[]},afterPaneMove:function(n){var e=g(n,":scope > .tab-content");w(o(n)||n,".nav-item").forEach(function(a){var r=z(n,a);r&&e.appendChild(r)})}}};})();
1
+ (()=>{var x=window.GridEditor;if(!x||typeof x.get!="function")throw new Error("grid-editor: load grideditor.js (or grideditor.bundle.min.js) before its plugins, its locales and grideditor.jquery.js");function b(e,l){return e?Array.prototype.slice.call(e.querySelectorAll(l)):[]}function g(e,l){return e?e.querySelector(l):null}function M(e,l){if(!e)return[];var o=b(e,l);return e.nodeType===1&&e.matches(l)&&o.unshift(e),o}function C(e,l){return e?Array.prototype.filter.call(e.children,function(o){return!l||o.matches(l)}):[]}function j(e,l){return C(e,l)[0]||null}function f(e,l,o){var c=document.createElement(e);return Object.keys(l||{}).forEach(function(h){var d=l[h];d!=null&&d!==!1&&c.setAttribute(h,d)}),o!=null&&(c.textContent=o),c}function p(e,l){return L(l).forEach(function(o){e.classList.add(o)}),e}function m(e,l){return L(l).forEach(function(o){e.classList.remove(o)}),e}function k(e,l,o){return L(l).forEach(function(c){o===void 0?e.classList.toggle(c):e.classList.toggle(c,!!o)}),e}function O(e,l){return!!e&&e.nodeType===1&&e.classList.contains(l)}function L(e){return String(e||"").split(/\s+/).filter(Boolean)}function K(e){return e.getAttribute("class")||e.removeAttribute("class"),e}function V(e){return e.style.display="none",e}function Y(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)}var X=400;function $(e,l,o,c){o=o===void 0?X:o;var h=function(){V(e),c&&c()};if(!Y(e)||!e.animate||o<=0){window.setTimeout(h,0);return}var d=e.animate(l(getComputedStyle(e)),{duration:o,easing:"ease-in-out"}),y=!1,_=function(){y||(y=!0,h())};d.onfinish=_,d.oncancel=_}function G(e,l,o){$(e,function(c){return[{opacity:c.opacity},{opacity:0}]},l,o)}Object.assign(x.locales.en,{"container.add_tabs":"Tabs","container.add_tab":"Add tab","container.tab_label":"Tab {number}","confirm.delete_tab":"Delete this tab and everything in it?","container.tabs_section":"Tabs","container.tabs_style":"Style","container.tabs_style_tabs":"Tabs","container.tabs_style_pills":"Pills","container.tabs_style_underline":"Underline","container.tabs_width":"Width","container.tabs_width_natural":"Natural","container.tabs_width_fill":"Fill","container.tabs_width_justified":"Justified","container.tabs_align":"Alignment","container.tabs_align_start":"Start","container.tabs_align_center":"Center","container.tabs_align_end":"End","container.tabs_layout":"Layout","container.tabs_layout_horizontal":"Horizontal","container.tabs_layout_vertical":"Vertical","container.tabs_layout_vertical_from":"Vertical from {breakpoint}"});var A={tabs:"nav-tabs",pills:"nav-pills",underline:"nav-underline"},w={natural:null,fill:"nav-fill",justified:"nav-justified"},E={start:null,center:"justify-content-center",end:"justify-content-end"},B={variant:"tabs",width:"natural",align:"start",vertical:!1},N={variant:{labelKey:"container.tabs_style",choices:[{value:"tabs",labelKey:"container.tabs_style_tabs"},{value:"pills",labelKey:"container.tabs_style_pills"},{value:"underline",labelKey:"container.tabs_style_underline"}]},width:{labelKey:"container.tabs_width",choices:[{value:"natural",labelKey:"container.tabs_width_natural"},{value:"fill",labelKey:"container.tabs_width_fill"},{value:"justified",labelKey:"container.tabs_width_justified"}]},align:{labelKey:"container.tabs_align",choices:[{value:"start",labelKey:"container.tabs_align_start"},{value:"center",labelKey:"container.tabs_align_center"},{value:"end",labelKey:"container.tabs_align_end"}]},vertical:{labelKey:"container.tabs_layout"}},Z=0,S="data-ge-tabs-layout";function H(e){return Object.keys(e).map(function(l){return e[l]}).filter(Boolean)}x.containers.tabs=function(e){var l=[];function o(n){return j(n,".nav")}function c(){return e.breakpoints.slice(1)}function h(n){return n===!0?"":"-"+n}function d(n){var t=h(n);return{container:["d"+t+"-flex","align-items"+t+"-start"],strip:["flex"+t+"-column","me"+t+"-3"]}}function y(){return[!0].concat(c())}function _(n){var t=o(n),a=function(s,i){return!!s&&O(s,i)},r=function(s,i){return Object.keys(s).filter(function(v){return s[v]&&a(t,s[v])})[0]||i},u=y().filter(function(s){var i=d(s);return a(n,i.container[0])&&a(t,i.strip[0])})[0];return{variant:r(A,"tabs"),width:r(w,"natural"),align:r(E,"start"),vertical:u===void 0?!1:u}}function P(n,t,a){var r=o(n);if(r){if(t==="variant"&&(m(r,H(A).join(" ")),p(r,A[a])),(t==="width"||t==="vertical")&&(m(r,H(w).join(" ")),t==="width"&&w[a]&&p(r,w[a])),(t==="align"||t==="vertical"||t==="width"&&a!=="natural")&&(m(r,H(E).join(" ")),t==="align"&&E[a]&&p(r,E[a])),t==="vertical"&&(y().forEach(function(s){var i=d(s);m(n,i.container.join(" ")),m(r,i.strip.join(" "))}),r.removeAttribute("aria-orientation"),a!==!1)){var u=d(a);p(n,u.container.join(" ")),p(r,u.strip.join(" ")),r.setAttribute("aria-orientation","vertical")}K(n)}}function D(n){return n==="variant"?Object.keys(A):n==="width"?Object.keys(w):n==="align"?Object.keys(E):[!1].concat(y())}function J(n,t){var a=e.settings.tabs||{},r=n[t]!==void 0?n[t]:a[t];return r===void 0?B[t]:D(t).indexOf(r)!==-1?r:(e.warn("tabs: "+JSON.stringify(r)+" is not a "+t+", which takes "+JSON.stringify(D(t))+": "+JSON.stringify(B[t])+" is used"),B[t])}function W(n){var t=_(n).vertical;return t===!1?null:e.view()==="all"?(n.removeAttribute(S),/flex$/.test(getComputedStyle(n).display)?"vertical":"horizontal"):t===!0||e.breakpoints.indexOf(e.view())>=e.breakpoints.indexOf(t)?"vertical":"horizontal"}function I(n){var t=W(n);t?n.setAttribute(S,t):n.removeAttribute(S)}function R(n,t,a){var r=f("div",{class:"ge-tabs-variant"}),u="ge-tabs-variant-"+ ++Z;r.appendChild(f("label",{class:"form-label",for:u},e.t(n)));var s=r.appendChild(f("select",{class:"form-select form-select-sm",id:u}));return t.forEach(function(i){s.appendChild(f("option",{value:i.value},i.label))}),s.addEventListener("change",function(){a(s.value)}),{box:r,field:s}}function q(n){var t=f("div",{class:"ge-tabs-variants"}),a={};function r(i,v){P(n,i,v),I(n),s()}function u(i){return N[i].choices.map(function(v){return{value:v.value,label:e.t(v.labelKey)}})}["variant","width","align"].forEach(function(i){a[i]=R(N[i].labelKey,u(i),function(v){r(i,v)})}),a.vertical=R(N.vertical.labelKey,[{value:"false",label:e.t("container.tabs_layout_horizontal")},{value:"true",label:e.t("container.tabs_layout_vertical")}].concat(c().map(function(i){return{value:i,label:e.t("container.tabs_layout_vertical_from",{breakpoint:i})}})),function(i){r("vertical",i==="true"?!0:i==="false"?!1:i)}),["variant","width","align","vertical"].forEach(function(i){a[i].box.setAttribute("data-ge-tabs-variant",i),t.appendChild(a[i].box)});function s(){var i=_(n);a.variant.field.value=i.variant,a.width.field.value=i.width,a.align.field.value=i.align,a.vertical.field.value=String(i.vertical),a.width.field.disabled=i.vertical!==!1,a.align.field.disabled=i.vertical!==!1||i.width!=="natural"}return s(),l.push({container:n,element:t,render:s}),t}function U(n,t){t=t||{};var a=o(n),r=g(n,":scope > .tab-content"),u=e.containerId("tab"),s=C(a,".nav-item").length+1,i=a.appendChild(f("li",{class:"nav-item ge-tab",role:"presentation"})),v=i.appendChild(f("button",{class:"nav-link",type:"button",role:"tab","data-bs-toggle":"tab","data-bs-target":"#"+u,"aria-controls":u}));v.appendChild(f("span",{class:"ge-pane-label"},t.label||e.t("container.tab_label",{number:s})));var T=r.appendChild(f("div",{class:"tab-pane fade",role:"tabpanel",tabindex:"0",id:u}));return T.appendChild(e.defaultRegion()),(t.activate||s===1)&&z(n,T),T}function z(n,t){var a=t.getAttribute("id");b(n,":scope > .tab-content > .tab-pane").forEach(function(r){m(r,"show active")}),p(t,"show active"),b(o(n)||n,".nav-link").forEach(function(r){var u=r.getAttribute("data-bs-target")==="#"+a;k(r,"active",u),r.setAttribute("aria-selected",u?"true":"false")})}function F(n,t){var a=g(t,".nav-link"),r=a?a.getAttribute("data-bs-target"):null;return r?g(n,r):null}return{labelKey:"container.add_tabs",onSortable:function(n){n(b(e.canvas,".ge-container-tabs").map(o).filter(Boolean),{draggable:".ge-tab"})},addPaneKey:"container.add_tab",paneKind:"tab",create:function(n){var t=f("div",{"data-ge-container":"tabs"}),a=n.labels||[],r=n.tabs||a.length||2;t.appendChild(f("ul",{class:"nav nav-tabs",role:"tablist"})),t.appendChild(f("div",{class:"tab-content"})),["variant","width","align","vertical"].forEach(function(s){P(t,s,J(n,s))});for(var u=0;u<r;u++)U(t,{label:a[u]});return t},addPane:U,mark:function(n){b(n,":scope > .tab-content > .tab-pane").forEach(function(t){p(t,"ge-tab-pane")}),C(o(n)||n,".nav-item").forEach(function(t){p(t,"ge-tab");var a=g(t,".nav-link");a&&e.makeLabelEditable(e.labelIn(a)),!j(t,".ge-tools-drawer")&&e.createPaneControls(t,"tab",e.settings.tab_tools,e.t("confirm.delete_tab"),function(r){var u=F(n,t),s=O(u,"active");G(t,200,function(){u&&u.remove(),r();var i=g(n,":scope > .tab-content > .tab-pane");s&&i&&z(n,i)})})})},unmark:function(n){e.resumeToggles(n),n.removeAttribute(S),b(n,".ge-tab-pane").forEach(function(t){m(t,"ge-tab-pane")}),b(n,".ge-tab").forEach(function(t){m(t,"ge-tab"),K(t)}),e.unwrapLabels(n)},cleanMarkup:function(n){var t=this;b(n,'[data-ge-container="tabs"]').forEach(function(a){t.unmark(a)})},panelSection:function(n,t){return t!=="tabs"||!o(n)?null:{labelKey:"container.tabs_section",body:q(n)}},onRefresh:function(n){M(n,'[data-ge-container="tabs"]').forEach(I),l=l.filter(function(t){return t.element.isConnected}),l.forEach(function(t){(t.container===n||n.contains(t.container))&&t.render()})},onDeinit:function(){l=[]},afterPaneMove:function(n){var t=g(n,":scope > .tab-content");C(o(n)||n,".nav-item").forEach(function(a){var r=F(n,a);r&&t.appendChild(r)})}}};})();