");
css(wrapper, {
boxSizing: "border-box",
height: dim.height,
width: dim.width,
...css(el, [
"overflow",
"padding",
"borderTop",
"borderRight",
"borderBottom",
"borderLeft",
"borderImage",
marginStartProp
])
});
css(el, {
padding: 0,
border: 0,
minWidth: 0,
minHeight: 0,
[marginStartProp]: 0,
width: dim.width,
height: dim.height,
overflow: "hidden",
[dimProp]: currentDim
});
const percent = currentDim / endDim;
duration = (velocity * endDim + duration) * (show ? 1 - percent : percent);
const endProps = { [dimProp]: show ? endDim : 0 };
if (end) {
css(el, marginProp, endDim - currentDim + currentMargin);
endProps[marginProp] = show ? currentMargin : endDim + currentMargin;
}
if (!end ^ mode === "reveal") {
css(wrapper, marginProp, -endDim + currentDim);
Transition.start(wrapper, { [marginProp]: show ? 0 : -endDim }, duration, transition);
}
try {
await Transition.start(el, endProps, duration, transition);
} finally {
css(el, prevProps);
unwrap(wrapper.firstChild);
if (!show) {
_toggle(el, false);
}
}
}
function toggleAnimation(el, show, cmp) {
const { animation, duration, _toggle } = cmp;
if (show) {
_toggle(el, true);
return Animation.in(el, animation[0], duration, cmp.origin);
}
return Animation.out(el, animation[1] || animation[0], duration, cmp.origin).then(
() => _toggle(el, false)
);
}
const active$1 = [];
var Modal = {
mixins: [Class, Container, Togglable],
props: {
selPanel: String,
selClose: String,
escClose: Boolean,
bgClose: Boolean,
stack: Boolean,
role: String
},
data: {
cls: "uk-open",
escClose: true,
bgClose: true,
overlay: true,
stack: false,
role: "dialog"
},
computed: {
panel: ({ selPanel }, $el) => $(selPanel, $el),
transitionElement() {
return this.panel;
}
},
connected() {
const el = this.panel || this.$el;
el.role = this.role;
if (this.overlay) {
el.ariaModal = true;
}
},
beforeDisconnect() {
if (includes(active$1, this)) {
this.toggleElement(this.$el, false, false);
}
},
events: [
{
name: "click",
delegate: ({ selClose }) => `${selClose},a[href*="#"]`,
handler(e) {
const { current, defaultPrevented } = e;
const { hash } = current;
if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {
this.hide();
} else if (matches(current, this.selClose)) {
maybeDefaultPreventClick(e);
this.hide();
}
}
},
{
name: "toggle",
self: true,
handler(e, toggle) {
if (e.defaultPrevented) {
return;
}
e.preventDefault();
this.target = toggle == null ? void 0 : toggle.$el;
if (this.isToggled() === includes(active$1, this)) {
this.toggle();
}
}
},
{
name: "beforeshow",
self: true,
handler(e) {
if (includes(active$1, this)) {
return false;
}
if (!this.stack && active$1.length) {
Promise.all(active$1.map((modal) => modal.hide())).then(this.show);
e.preventDefault();
} else {
active$1.push(this);
}
}
},
{
name: "show",
self: true,
handler() {
if (this.stack) {
css(this.$el, "zIndex", toFloat(css(this.$el, "zIndex")) + active$1.length);
}
const handlers = [
this.overlay && preventBackgroundFocus(this),
this.overlay && preventBackgroundScroll(this.$el),
this.bgClose && listenForBackgroundClose$1(this),
this.escClose && listenForEscClose$1(this)
];
once(
this.$el,
"hidden",
() => handlers.forEach((handler) => handler && handler()),
{ self: true }
);
addClass(document.documentElement, this.clsPage);
setAriaExpanded(this.target, true);
}
},
{
name: "shown",
self: true,
handler() {
if (!isFocusable(this.$el)) {
this.$el.tabIndex = -1;
}
if (!matches(this.$el, ":focus-within")) {
this.$el.focus();
}
}
},
{
name: "hidden",
self: true,
handler() {
if (includes(active$1, this)) {
active$1.splice(active$1.indexOf(this), 1);
}
css(this.$el, "zIndex", "");
const { target } = this;
if (!active$1.some((modal) => modal.clsPage === this.clsPage)) {
removeClass(document.documentElement, this.clsPage);
queueMicrotask(() => {
if (isFocusable(target)) {
const restoreScrollPosition = storeScrollPosition(target);
target.focus();
restoreScrollPosition();
}
});
}
setAriaExpanded(target, false);
this.target = null;
}
}
],
methods: {
toggle() {
return this.isToggled() ? this.hide() : this.show();
},
async show() {
if (this.container && parent(this.$el) !== this.container) {
append(this.container, this.$el);
await awaitFrame();
}
return this.toggleElement(this.$el, true, animate$1);
},
hide() {
return this.toggleElement(this.$el, false, animate$1);
}
}
};
function animate$1(el, show, { transitionElement, _toggle }) {
return new Promise(
(resolve, reject) => once(el, "show hide", () => {
var _a;
(_a = el._reject) == null ? void 0 : _a.call(el);
el._reject = reject;
_toggle(el, show);
const off = once(
transitionElement,
"transitionstart",
() => {
once(transitionElement, "transitionend transitioncancel", resolve, {
self: true
});
clearTimeout(timer);
},
{ self: true }
);
const timer = setTimeout(
() => {
off();
resolve();
},
toMs(css(transitionElement, "transitionDuration"))
);
})
).then(() => delete el._reject);
}
function toMs(time) {
return time ? endsWith(time, "ms") ? toFloat(time) : toFloat(time) * 1e3 : 0;
}
function preventBackgroundFocus(modal) {
return on(document, "focusin", (e) => {
if (last(active$1) === modal && !modal.$el.contains(e.target)) {
modal.$el.focus();
}
});
}
function listenForBackgroundClose$1(modal) {
return on(document, pointerDown$1, ({ target }) => {
if (last(active$1) !== modal || modal.overlay && !modal.$el.contains(target) || !modal.panel || modal.panel.contains(target)) {
return;
}
once(
document,
`${pointerUp$1} ${pointerCancel} scroll`,
({ defaultPrevented, type, target: newTarget }) => {
if (!defaultPrevented && type === pointerUp$1 && target === newTarget) {
modal.hide();
}
},
true
);
});
}
function listenForEscClose$1(modal) {
return on(document, "keydown", (e) => {
if (e.keyCode === 27 && last(active$1) === modal) {
modal.hide();
}
});
}
function setAriaExpanded(el, toggled) {
if (el == null ? void 0 : el.ariaExpanded) {
el.ariaExpanded = toggled;
}
}
var Animations$2 = {
slide: {
show(dir) {
return [{ transform: translate(dir * -100) }, { transform: translate() }];
},
percent(current) {
return translated(current);
},
translate(percent, dir) {
return [
{ transform: translate(dir * -100 * percent) },
{ transform: translate(dir * 100 * (1 - percent)) }
];
}
}
};
function translated(el) {
return Math.abs(new DOMMatrix(css(el, "transform")).m41 / el.offsetWidth);
}
function translate(value = 0, unit = "%") {
return value ? `translate3d(${value + unit}, 0, 0)` : "";
}
function Transitioner$1(prev, next, dir, { animation, easing }) {
const { percent, translate, show = noop } = animation;
const props = show(dir);
const { promise, resolve } = withResolvers();
return {
dir,
show(duration, percent2 = 0, linear) {
const timing = linear ? "linear" : easing;
duration -= Math.round(duration * clamp(percent2, -1, 1));
this.translate(percent2);
triggerUpdate(next, "itemin", { percent: percent2, duration, timing, dir });
triggerUpdate(prev, "itemout", { percent: 1 - percent2, duration, timing, dir });
Promise.all([
Transition.start(next, props[1], duration, timing),
Transition.start(prev, props[0], duration, timing)
]).then(() => {
this.reset();
resolve();
}, noop);
return promise;
},
cancel() {
return Transition.cancel([next, prev]);
},
reset() {
resetProps([next, prev], props[0]);
},
async forward(duration, percent2 = this.percent()) {
await this.cancel();
return this.show(duration, percent2, true);
},
translate(percent2) {
this.reset();
const props2 = translate(percent2, dir);
css(next, props2[1]);
css(prev, props2[0]);
triggerUpdate(next, "itemtranslatein", { percent: percent2, dir });
triggerUpdate(prev, "itemtranslateout", { percent: 1 - percent2, dir });
},
percent() {
return percent(prev || next, next, dir);
},
getDistance() {
return prev == null ? void 0 : prev.offsetWidth;
}
};
}
function triggerUpdate(el, type, data) {
trigger(el, createEvent(type, false, false, data));
}
function withResolvers() {
let resolve;
return { promise: new Promise((res) => resolve = res), resolve };
}
var I18n = {
props: {
i18n: Object
},
data: {
i18n: null
},
methods: {
t(key, ...params) {
var _a, _b, _c;
let i = 0;
return ((_c = ((_a = this.i18n) == null ? void 0 : _a[key]) || ((_b = this.$options.i18n) == null ? void 0 : _b[key])) == null ? void 0 : _c.replace(
/%s/g,
() => params[i++] || ""
)) || "";
}
}
};
var SliderAutoplay = {
props: {
autoplay: Boolean,
autoplayInterval: Number,
pauseOnHover: Boolean
},
data: {
autoplay: false,
autoplayInterval: 7e3,
pauseOnHover: true
},
connected() {
attr(this.list, "aria-live", this.autoplay ? "off" : "polite");
this.autoplay && this.startAutoplay();
},
disconnected() {
this.stopAutoplay();
},
update() {
attr(this.slides, "tabindex", "-1");
},
events: [
{
name: "visibilitychange",
el: () => document,
filter: ({ autoplay }) => autoplay,
handler() {
if (document.hidden) {
this.stopAutoplay();
} else {
this.startAutoplay();
}
}
}
],
methods: {
startAutoplay() {
this.stopAutoplay();
this.interval = setInterval(() => {
if (!(this.stack.length || !isVisible(this.$el) || this.draggable && matches(this.$el, ":focus-within") && !matches(this.$el, ":focus") || this.pauseOnHover && matches(this.$el, ":hover"))) {
this.show("next");
}
}, this.autoplayInterval);
},
stopAutoplay() {
clearInterval(this.interval);
}
}
};
const pointerOptions = { passive: false, capture: true };
const pointerUpOptions = { passive: true, capture: true };
const pointerDown = "touchstart mousedown";
const pointerMove = "touchmove mousemove";
const pointerUp = "touchend touchcancel mouseup click input scroll";
var SliderDrag = {
props: {
draggable: Boolean
},
data: {
draggable: true,
threshold: 10
},
created() {
for (const key of ["start", "move", "end"]) {
const fn = this[key];
this[key] = (e) => {
const pos = getEventPos(e).x * (isRtl ? -1 : 1);
this.prevPos = pos === this.pos ? this.prevPos : this.pos;
this.pos = pos;
fn(e);
};
}
},
events: [
{
name: pointerDown,
passive: true,
delegate: ({ selList }) => `${selList} > *`,
handler(e) {
if (!this.draggable || this.parallax || !isTouch(e) && hasSelectableText(e.target) || e.target.closest(selInput) || e.button > 0 || this.length < 2) {
return;
}
this.start(e);
}
},
{
name: "dragstart",
handler(e) {
e.preventDefault();
}
},
{
// iOS workaround for slider stopping if swiping fast
name: pointerMove,
el: ({ list }) => list,
handler: noop,
...pointerOptions
}
],
methods: {
start() {
this.drag = this.pos;
if (this._transitioner) {
this.percent = this._transitioner.percent();
this.drag += this._transitioner.getDistance() * this.percent * this.dir;
this._transitioner.cancel();
this._transitioner.translate(this.percent);
this.dragging = true;
this.stack = [];
} else {
this.prevIndex = this.index;
}
on(document, pointerMove, this.move, pointerOptions);
on(document, pointerUp, this.end, pointerUpOptions);
css(this.list, "userSelect", "none");
},
move(e) {
const distance = this.pos - this.drag;
if (distance === 0 || this.prevPos === this.pos || !this.dragging && Math.abs(distance) < this.threshold) {
return;
}
e.cancelable && e.preventDefault();
this.dragging = true;
this.dir = distance < 0 ? 1 : -1;
let { slides, prevIndex } = this;
let dis = Math.abs(distance);
let nextIndex = this.getIndex(prevIndex + this.dir);
let width = getDistance.call(this, prevIndex, nextIndex);
while (nextIndex !== prevIndex && dis > width) {
this.drag -= width * this.dir;
prevIndex = nextIndex;
dis -= width;
nextIndex = this.getIndex(prevIndex + this.dir);
width = getDistance.call(this, prevIndex, nextIndex);
}
this.percent = dis / width;
const prev = slides[prevIndex];
const next = slides[nextIndex];
const changed = this.index !== nextIndex;
const edge = prevIndex === nextIndex;
let itemShown;
for (const i of [this.index, this.prevIndex]) {
if (!includes([nextIndex, prevIndex], i)) {
trigger(slides[i], "itemhidden", [this]);
if (edge) {
itemShown = true;
this.prevIndex = prevIndex;
}
}
}
if (this.index === prevIndex && this.prevIndex !== prevIndex || itemShown) {
trigger(slides[this.index], "itemshown", [this]);
}
if (changed) {
this.prevIndex = prevIndex;
this.index = nextIndex;
if (!edge) {
trigger(prev, "beforeitemhide", [this]);
trigger(prev, "itemhide", [this]);
}
trigger(next, "beforeitemshow", [this]);
trigger(next, "itemshow", [this]);
}
this._transitioner = this._translate(Math.abs(this.percent), prev, !edge && next);
},
end() {
off(document, pointerMove, this.move, pointerOptions);
off(document, pointerUp, this.end, pointerUpOptions);
if (this.dragging) {
setTimeout(on(this.list, "click", (e) => e.preventDefault(), pointerOptions));
this.dragging = null;
if (this.index === this.prevIndex) {
this.percent = 1 - this.percent;
this.dir *= -1;
this._show(false, this.index, true);
this._transitioner = null;
} else {
const dirChange = (isRtl ? this.dir * (isRtl ? 1 : -1) : this.dir) < 0 === this.prevPos > this.pos;
this.index = dirChange ? this.index : this.prevIndex;
if (dirChange) {
trigger(this.slides[this.prevIndex], "itemhidden", [this]);
trigger(this.slides[this.index], "itemshown", [this]);
this.percent = 1 - this.percent;
}
this.show(
this.dir > 0 && !dirChange || this.dir < 0 && dirChange ? "next" : "previous",
true
);
}
}
css(this.list, { userSelect: "" });
this.drag = this.percent = null;
}
}
};
function getDistance(prev, next) {
return this._getTransitioner(prev, prev !== next && next).getDistance() || this.slides[prev].offsetWidth;
}
function hasSelectableText(el) {
return css(el, "userSelect") !== "none" && toArray(el.childNodes).some((el2) => el2.nodeType === 3 && el2.textContent.trim());
}
function initWatches(instance) {
instance._watches = [];
for (const watches of instance.$options.watch || []) {
for (const [name, watch] of Object.entries(watches)) {
registerWatch(instance, watch, name);
}
}
instance._initial = true;
}
function registerWatch(instance, watch, name) {
instance._watches.push({
name,
...isPlainObject(watch) ? watch : { handler: watch }
});
}
function runWatches(instance, values) {
for (const { name, handler, immediate = true } of instance._watches) {
if (instance._initial && immediate || hasOwn(values, name) && !isEqual(values[name], instance[name])) {
handler.call(instance, instance[name], values[name]);
}
}
instance._initial = false;
}
function initComputed(instance) {
const { computed } = instance.$options;
instance._computed = {};
if (computed) {
for (const key in computed) {
registerComputed(instance, key, computed[key]);
}
}
}
const mutationOptions = { subtree: true, childList: true };
function registerComputed(instance, key, cb) {
instance._hasComputed = true;
Object.defineProperty(instance, key, {
enumerable: true,
get() {
const { _computed, $props, $el } = instance;
if (!hasOwn(_computed, key)) {
_computed[key] = (cb.get || cb).call(instance, $props, $el);
if (cb.observe && instance._computedObserver) {
const selector = cb.observe.call(instance, $props);
instance._computedObserver.observe(
["~", "+", "-"].includes(selector[0]) ? $el.parentElement : $el.getRootNode(),
mutationOptions
);
}
}
return _computed[key];
},
set(value) {
const { _computed } = instance;
_computed[key] = cb.set ? cb.set.call(instance, value) : value;
if (isUndefined(_computed[key])) {
delete _computed[key];
}
}
});
}
function initComputedUpdates(instance) {
if (!instance._hasComputed) {
return;
}
prependUpdate(instance, {
read: () => runWatches(instance, resetComputed(instance)),
events: ["resize", "computed"]
});
instance._computedObserver = observeMutation(
instance.$el,
() => callUpdate(instance, "computed"),
mutationOptions
);
instance._disconnect.push(() => {
instance._computedObserver.disconnect();
instance._computedObserver = null;
resetComputed(instance);
});
}
function resetComputed(instance) {
const values = { ...instance._computed };
instance._computed = {};
return values;
}
function initEvents(instance) {
for (const event of instance.$options.events || []) {
if (hasOwn(event, "handler")) {
registerEvent(instance, event);
} else {
for (const key in event) {
registerEvent(instance, { name: key, handler: event[key] });
}
}
}
}
function registerEvent(instance, { name, el, handler, capture, passive, delegate, filter, self }) {
if (filter && !filter.call(instance, instance)) {
return;
}
instance._disconnect.push(
on(
el ? el.call(instance, instance) : instance.$el,
name,
delegate == null ? void 0 : delegate.call(instance, instance),
handler.bind(instance),
{
passive,
capture,
self
}
)
);
}
function initObservers(instance) {
for (const observer of instance.$options.observe || []) {
registerObservable(instance, observer);
}
}
function registerObservable(instance, observable) {
let { observe, target = instance.$el, handler, options, filter, args } = observable;
if (filter && !filter.call(instance, instance)) {
return;
}
const key = `_observe${instance._disconnect.length}`;
if (isFunction(target) && !hasOwn(instance, key)) {
registerComputed(instance, key, () => {
const targets2 = target.call(instance, instance);
return isArray(targets2) ? toNodes(targets2) : targets2;
});
}
handler = isString(handler) ? instance[handler] : handler.bind(instance);
if (isFunction(options)) {
options = options.call(instance, instance);
}
const targets = hasOwn(instance, key) ? instance[key] : target;
const observer = observe(targets, handler, options, args);
if (isFunction(target) && isArray(instance[key])) {
registerWatch(
instance,
{ handler: updateTargets(observer, options), immediate: false },
key
);
}
instance._disconnect.push(() => observer.disconnect());
}
function updateTargets(observer, options) {
return (targets, prev) => {
for (const target of prev) {
if (!includes(targets, target)) {
if (observer.unobserve) {
observer.unobserve(target);
} else if (observer.observe) {
observer.disconnect();
}
}
}
for (const target of targets) {
if (!includes(prev, target) || !observer.unobserve) {
observer.observe(target, options);
}
}
};
}
function initProps(instance) {
const { $options, $props } = instance;
const props = getProps($options);
assign($props, props);
const { computed, methods } = $options;
for (let key in $props) {
if (key in props && (!computed || !hasOwn(computed, key)) && (!methods || !hasOwn(methods, key))) {
instance[key] = $props[key];
}
}
}
function getProps(opts) {
const data$1 = {};
const { args = [], props = {}, el, id } = opts;
if (!props) {
return data$1;
}
for (const key in props) {
const prop = hyphenate(key);
let value = data(el, prop);
if (isUndefined(value)) {
continue;
}
value = props[key] === Boolean && value === "" ? true : coerce$1(props[key], value);
if (prop === "target" && startsWith(value, "_")) {
continue;
}
data$1[key] = value;
}
const options = parseOptions(data(el, id), args);
for (const key in options) {
const prop = camelize(key);
if (!isUndefined(props[prop])) {
data$1[prop] = coerce$1(props[prop], options[key]);
}
}
return data$1;
}
const getAttributes = memoize((id, props) => {
const attributes = Object.keys(props);
const filter = attributes.concat(id).map((key) => [hyphenate(key), `data-${hyphenate(key)}`]).flat();
return { attributes, filter };
});
function initPropsObserver(instance) {
const { $options, $props } = instance;
const { id, props, el } = $options;
if (!props) {
return;
}
const { attributes, filter } = getAttributes(id, props);
const observer = new MutationObserver((records) => {
const data = getProps($options);
if (records.some(({ attributeName }) => {
const prop = attributeName.replace("data-", "");
return (prop === id ? attributes : [camelize(prop), camelize(attributeName)]).some(
(prop2) => !isUndefined(data[prop2]) && data[prop2] !== $props[prop2]
);
})) {
instance.$reset();
}
});
observer.observe(el, {
attributes: true,
attributeFilter: filter
});
instance._disconnect.push(() => observer.disconnect());
}
function callHook(instance, hook) {
var _a;
(_a = instance.$options[hook]) == null ? void 0 : _a.forEach((handler) => handler.call(instance));
}
function callConnected(instance) {
if (instance._connected) {
return;
}
initProps(instance);
callHook(instance, "beforeConnect");
instance._connected = true;
instance._disconnect = [];
initEvents(instance);
initUpdates(instance);
initWatches(instance);
initObservers(instance);
initPropsObserver(instance);
initComputedUpdates(instance);
callHook(instance, "connected");
callUpdate(instance);
}
function callDisconnected(instance) {
if (!instance._connected) {
return;
}
callHook(instance, "beforeDisconnect");
instance._disconnect.forEach((off) => off());
instance._disconnect = null;
callHook(instance, "disconnected");
instance._connected = false;
}
let uid = 0;
function init$1(instance, options = {}) {
options.data = normalizeData(options, instance.constructor.options);
instance.$options = mergeOptions(instance.constructor.options, options, instance);
instance.$props = {};
instance._uid = uid++;
initData(instance);
initMethods(instance);
initComputed(instance);
callHook(instance, "created");
if (options.el) {
instance.$mount(options.el);
}
}
function initData(instance) {
const { data = {} } = instance.$options;
for (const key in data) {
instance.$props[key] = instance[key] = data[key];
}
}
function initMethods(instance) {
const { methods } = instance.$options;
if (methods) {
for (const key in methods) {
instance[key] = methods[key].bind(instance);
}
}
}
function normalizeData({ data = {} }, { args = [], props = {} }) {
if (isArray(data)) {
data = data.slice(0, args.length).reduce((data2, value, index) => {
if (isPlainObject(value)) {
assign(data2, value);
} else {
data2[args[index]] = value;
}
return data2;
}, {});
}
for (const key in data) {
if (isUndefined(data[key])) {
delete data[key];
} else if (props[key]) {
data[key] = coerce$1(props[key], data[key]);
}
}
return data;
}
const App = function(options) {
init$1(this, options);
};
App.util = util;
App.options = {};
App.version = "3.24.2";
const PREFIX = "uk-";
const DATA = "__uikit__";
const components$2 = {};
function component(name, options) {
var _a, _b;
const id = PREFIX + hyphenate(name);
if (!options) {
if (!components$2[id].options) {
components$2[id] = App.extend(components$2[id]);
}
return components$2[id];
}
name = camelize(name);
App[name] = (element, data) => createComponent(name, element, data);
const opt = (_a = options.options) != null ? _a : { ...options };
opt.id = id;
opt.name = name;
(_b = opt.install) == null ? void 0 : _b.call(opt, App, opt, name);
if (App._initialized && !opt.functional) {
requestAnimationFrame(() => createComponent(name, `[${id}],[data-${id}]`));
}
return components$2[id] = opt;
}
function createComponent(name, element, data, ...args) {
const Component = component(name);
return Component.options.functional ? new Component({ data: isPlainObject(element) ? element : [element, data, ...args] }) : element ? $$(element).map(init)[0] : init();
function init(element2) {
const instance = getComponent(element2, name);
if (instance) {
if (data) {
instance.$destroy();
} else {
return instance;
}
}
return new Component({ el: element2, data });
}
}
function getComponents(element) {
return (element == null ? void 0 : element[DATA]) || {};
}
function getComponent(element, name) {
return getComponents(element)[name];
}
function attachToElement(element, instance) {
if (!element[DATA]) {
element[DATA] = {};
}
element[DATA][instance.$options.name] = instance;
}
function detachFromElement(element, instance) {
var _a;
(_a = element[DATA]) == null ? true : delete _a[instance.$options.name];
if (isEmpty(element[DATA])) {
delete element[DATA];
}
}
function globalApi(App) {
App.component = component;
App.getComponents = getComponents;
App.getComponent = getComponent;
App.update = update;
App.use = function(plugin) {
if (plugin.installed) {
return;
}
plugin.call(null, this);
plugin.installed = true;
return this;
};
App.mixin = function(mixin, component2) {
component2 = (isString(component2) ? this.component(component2) : component2) || this;
component2.options = mergeOptions(component2.options, mixin);
};
App.extend = function(options) {
options || (options = {});
const Super = this;
const Sub = function UIkitComponent(options2) {
init$1(this, options2);
};
Sub.prototype = Object.create(Super.prototype);
Sub.prototype.constructor = Sub;
Sub.options = mergeOptions(Super.options, options);
Sub.super = Super;
Sub.extend = Super.extend;
return Sub;
};
let container;
Object.defineProperty(App, "container", {
get() {
return container || document.body;
},
set(element) {
container = $(element);
}
});
}
function update(element, e) {
element = element ? toNode(element) : document.body;
for (const parentEl of parents(element).reverse()) {
updateElement(parentEl, e);
}
apply(element, (element2) => updateElement(element2, e));
}
function updateElement(element, e) {
const components = getComponents(element);
for (const name in components) {
callUpdate(components[name], e);
}
}
function instanceApi(App) {
App.prototype.$mount = function(el) {
const instance = this;
attachToElement(el, instance);
instance.$options.el = el;
if (el.isConnected) {
callConnected(instance);
}
};
App.prototype.$destroy = function(removeEl = false) {
const instance = this;
const { el } = instance.$options;
if (el) {
callDisconnected(instance);
}
callHook(instance, "destroy");
detachFromElement(el, instance);
if (removeEl) {
remove$1(instance.$el);
}
};
App.prototype.$create = createComponent;
App.prototype.$emit = function(e) {
callUpdate(this, e);
};
App.prototype.$update = function(element = this.$el, e) {
update(element, e);
};
App.prototype.$reset = function() {
callDisconnected(this);
callConnected(this);
};
App.prototype.$getComponent = getComponent;
Object.defineProperties(App.prototype, {
$el: {
get() {
return this.$options.el;
}
},
$container: Object.getOwnPropertyDescriptor(App, "container")
});
}
let id = 1;
function generateId(instance, el = null) {
return (el == null ? void 0 : el.id) || `${instance.$options.id}-${id++}`;
}
var SliderNav = {
i18n: {
next: "Next slide",
previous: "Previous slide",
slideX: "Slide %s",
slideLabel: "%s of %s",
role: "String"
},
data: {
selNav: false,
role: "region"
},
computed: {
nav: ({ selNav }, $el) => $(selNav, $el),
navChildren() {
return children(this.nav);
},
selNavItem: ({ attrItem }) => `[${attrItem}],[data-${attrItem}]`,
navItems(_, $el) {
return $$(this.selNavItem, $el);
}
},
watch: {
nav(nav, prev) {
attr(nav, "role", "tablist");
this.padNavitems();
if (prev) {
this.$emit();
}
},
list(list) {
if (isTag(list, "ul")) {
attr(list, "role", "presentation");
}
},
navChildren(children2) {
attr(children2, "role", "presentation");
this.padNavitems();
this.updateNav();
},
navItems(items) {
for (const el of items) {
const cmd = data(el, this.attrItem);
const button = $("a,button", el) || el;
let ariaLabel;
let ariaControls = null;
if (isNumeric(cmd)) {
const item = toNumber(cmd);
const slide = this.slides[item];
if (slide) {
if (!slide.id) {
slide.id = generateId(this, slide);
}
ariaControls = slide.id;
}
ariaLabel = this.t("slideX", toFloat(cmd) + 1);
button.role = "tab";
} else {
if (this.list) {
if (!this.list.id) {
this.list.id = generateId(this, this.list);
}
ariaControls = this.list.id;
}
ariaLabel = this.t(cmd);
}
button.ariaControls = ariaControls;
button.ariaLabel = button.ariaLabel || ariaLabel;
}
},
slides(slides) {
slides.forEach(
(slide, i) => attr(slide, {
role: this.nav ? "tabpanel" : "group",
"aria-label": this.t("slideLabel", i + 1, this.length),
"aria-roledescription": this.nav ? null : "slide"
})
);
this.padNavitems();
}
},
connected() {
this.$el.role = this.role;
this.$el.ariaRoleDescription = "carousel";
},
update: [
{
write() {
this.navItems.concat(this.nav).forEach((el) => el && (el.hidden = !this.maxIndex));
this.updateNav();
},
events: ["resize"]
}
],
events: [
{
name: "click keydown",
delegate: ({ selNavItem }) => selNavItem,
filter: ({ parallax }) => !parallax,
handler(e) {
if (e.target.closest("a,button") && (e.type === "click" || e.keyCode === keyMap.SPACE)) {
maybeDefaultPreventClick(e);
this.show(data(e.current, this.attrItem));
}
}
},
{
name: "itemshow",
handler() {
this.updateNav();
}
},
{
name: "keydown",
delegate: ({ selNavItem }) => selNavItem,
filter: ({ parallax }) => !parallax,
handler(e) {
const { current, keyCode } = e;
const cmd = data(current, this.attrItem);
if (!isNumeric(cmd)) {
return;
}
let i = keyCode === keyMap.HOME ? 0 : keyCode === keyMap.END ? "last" : keyCode === keyMap.LEFT ? "previous" : keyCode === keyMap.RIGHT ? "next" : -1;
if (~i) {
e.preventDefault();
this.show(i);
}
}
}
],
methods: {
updateNav() {
const index = this.getValidIndex();
for (const el of this.navItems) {
const cmd = data(el, this.attrItem);
const button = $("a,button", el) || el;
if (isNumeric(cmd)) {
const item = toNumber(cmd);
const active = item === index;
toggleClass(el, this.clsActive, active);
toggleClass(button, "uk-disabled", !!this.parallax);
button.ariaSelected = active;
button.tabIndex = active && !this.parallax ? null : -1;
if (active && button && matches(parent(el), ":focus-within")) {
button.focus();
}
} else {
toggleClass(
el,
"uk-invisible",
this.finite && (cmd === "previous" && index === 0 || cmd === "next" && index >= this.maxIndex)
);
}
}
},
padNavitems() {
if (!this.nav) {
return;
}
const children2 = [];
for (let i = 0; i < this.length; i++) {
const attr2 = `${this.attrItem}="${i}"`;
children2[i] = this.navChildren.findLast((el) => el.matches(`[${attr2}]`)) || $(`
`);
}
if (!isEqual(children2, this.navChildren)) {
html(this.nav, children2);
}
}
}
};
const easeOutQuad = "cubic-bezier(0.25, 0.46, 0.45, 0.94)";
const easeOutQuart = "cubic-bezier(0.165, 0.84, 0.44, 1)";
var Slider = {
mixins: [SliderAutoplay, SliderDrag, SliderNav, I18n],
props: {
clsActivated: String,
easing: String,
index: Number,
finite: Boolean,
velocity: Number
},
data: () => ({
easing: "ease",
finite: false,
velocity: 1,
index: 0,
prevIndex: -1,
stack: [],
percent: 0,
clsActive: "uk-active",
clsActivated: "",
clsEnter: "uk-slide-enter",
clsLeave: "uk-slide-leave",
clsSlideActive: "uk-slide-active",
Transitioner: false,
transitionOptions: {}
}),
connected() {
this.prevIndex = -1;
this.index = this.getValidIndex(this.$props.index);
this.stack = [];
},
disconnected() {
removeClass(this.slides, this.clsActive);
},
computed: {
duration: ({ velocity }, $el) => speedUp($el.offsetWidth / velocity),
list: ({ selList }, $el) => $(selList, $el),
maxIndex() {
return this.length - 1;
},
slides() {
return children(this.list);
},
length() {
return this.slides.length;
}
},
watch: {
slides(slides, prev) {
if (prev) {
this.$emit();
}
}
},
events: {
itemshow({ target }) {
addClass(target, this.clsEnter, this.clsSlideActive);
},
itemshown({ target }) {
removeClass(target, this.clsEnter);
},
itemhide({ target }) {
addClass(target, this.clsLeave);
},
itemhidden({ target }) {
removeClass(target, this.clsLeave, this.clsSlideActive);
}
},
methods: {
async show(index, force = false) {
var _a;
if (this.dragging || !this.length || this.parallax) {
return;
}
const { stack } = this;
const queueIndex = force ? 0 : stack.length;
const reset = () => {
stack.splice(queueIndex, 1);
if (stack.length) {
this.show(stack.shift(), true);
}
};
stack[force ? "unshift" : "push"](index);
if (!force && stack.length > 1) {
if (stack.length === 2) {
(_a = this._transitioner) == null ? void 0 : _a.forward(Math.min(this.duration, 200));
}
return;
}
const prevIndex = this.getIndex(this.index);
const prev = hasClass(this.slides, this.clsActive) && this.slides[prevIndex];
const nextIndex = this.getIndex(index, this.index);
const next = this.slides[nextIndex];
if (prev === next) {
reset();
return;
}
this.dir = getDirection(index, prevIndex);
this.prevIndex = prevIndex;
this.index = nextIndex;
if (prev && !trigger(prev, "beforeitemhide", [this]) || !trigger(next, "beforeitemshow", [this, prev])) {
this.index = this.prevIndex;
reset();
return;
}
prev && trigger(prev, "itemhide", [this]);
trigger(next, "itemshow", [this]);
await this._show(prev, next, force);
prev && trigger(prev, "itemhidden", [this]);
trigger(next, "itemshown", [this]);
stack.shift();
this._transitioner = null;
await awaitFrame();
if (stack.length) {
this.show(stack.shift(), true);
}
},
getIndex(index = this.index, prev = this.index) {
return clamp(
getIndex(index, this.slides, prev, this.finite),
0,
Math.max(0, this.maxIndex)
);
},
getValidIndex(index = this.index, prevIndex = this.prevIndex) {
return this.getIndex(index, prevIndex);
},
async _show(prev, next, force) {
this._transitioner = this._getTransitioner(prev, next, this.dir, {
easing: force ? next.offsetWidth < 600 ? easeOutQuad : easeOutQuart : this.easing,
...this.transitionOptions
});
if (!force && !prev) {
this._translate(1);
return;
}
const { length } = this.stack;
return this._transitioner[length > 1 ? "forward" : "show"](
length > 1 ? Math.min(this.duration, 75 + 75 / (length - 1)) : this.duration,
this.percent
);
},
_translate(percent, prev = this.prevIndex, next = this.index) {
const transitioner = this._getTransitioner(prev === next ? false : prev, next);
transitioner.translate(percent);
return transitioner;
},
_getTransitioner(prev = this.prevIndex, next = this.index, dir = this.dir || 1, options = this.transitionOptions) {
return new this.Transitioner(
isNumber(prev) ? this.slides[prev] : prev,
isNumber(next) ? this.slides[next] : next,
dir * (isRtl ? -1 : 1),
options
);
}
}
};
function getDirection(index, prevIndex) {
return index === "next" ? 1 : index === "previous" ? -1 : index < prevIndex ? -1 : 1;
}
function speedUp(x) {
return 0.5 * x + 300;
}
var Slideshow = {
mixins: [Slider],
props: {
animation: String
},
data: {
animation: "slide",
clsActivated: "uk-transition-active",
Animations: Animations$2,
Transitioner: Transitioner$1
},
computed: {
animation({ animation, Animations: Animations2 }) {
return { ...Animations2[animation] || Animations2.slide, name: animation };
},
transitionOptions() {
return { animation: this.animation };
}
},
observe: resize(),
events: {
itemshow({ target }) {
addClass(target, this.clsActive);
},
itemshown({ target }) {
addClass(target, this.clsActivated);
},
itemhidden({ target }) {
removeClass(target, this.clsActive, this.clsActivated);
}
}
};
var Animations$1 = {
...Animations$2,
fade: {
show() {
return [{ opacity: 0, zIndex: 0 }, { zIndex: -1 }];
},
percent(current) {
return 1 - css(current, "opacity");
},
translate(percent) {
return [{ opacity: 1 - percent, zIndex: 0 }, { zIndex: -1 }];
}
},
scale: {
show() {
return [{ opacity: 0, transform: scale3d(1 + 0.5), zIndex: 0 }, { zIndex: -1 }];
},
percent(current) {
return 1 - css(current, "opacity");
},
translate(percent) {
return [
{ opacity: 1 - percent, transform: scale3d(1 + 0.5 * percent), zIndex: 0 },
{ zIndex: -1 }
];
}
},
pull: {
show(dir) {
return dir < 0 ? [
{ transform: translate(30), zIndex: -1 },
{ transform: translate(), zIndex: 0 }
] : [
{ transform: translate(-100), zIndex: 0 },
{ transform: translate(), zIndex: -1 }
];
},
percent(current, next, dir) {
return dir < 0 ? 1 - translated(next) : translated(current);
},
translate(percent, dir) {
return dir < 0 ? [
{ transform: translate(30 * percent), zIndex: -1 },
{ transform: translate(-100 * (1 - percent)), zIndex: 0 }
] : [
{ transform: translate(-percent * 100), zIndex: 0 },
{ transform: translate(30 * (1 - percent)), zIndex: -1 }
];
}
},
push: {
show(dir) {
return dir < 0 ? [
{ transform: translate(100), zIndex: 0 },
{ transform: translate(), zIndex: -1 }
] : [
{ transform: translate(-30), zIndex: -1 },
{ transform: translate(), zIndex: 0 }
];
},
percent(current, next, dir) {
return dir > 0 ? 1 - translated(next) : translated(current);
},
translate(percent, dir) {
return dir < 0 ? [
{ transform: translate(percent * 100), zIndex: 0 },
{ transform: translate(-30 * (1 - percent)), zIndex: -1 }
] : [
{ transform: translate(-30 * percent), zIndex: -1 },
{ transform: translate(100 * (1 - percent)), zIndex: 0 }
];
}
}
};
function scale3d(value) {
return `scale3d(${value}, ${value}, 1)`;
}
var Animations = {
...Animations$2,
fade: {
show() {
return [{ opacity: 0 }, { opacity: 1 }];
},
percent(current) {
return 1 - css(current, "opacity");
},
translate(percent) {
return [{ opacity: 1 - percent }, { opacity: percent }];
}
},
scale: {
show() {
return [
{ opacity: 0, transform: scale3d(1 - 0.2) },
{ opacity: 1, transform: scale3d(1) }
];
},
percent(current) {
return 1 - css(current, "opacity");
},
translate(percent) {
return [
{ opacity: 1 - percent, transform: scale3d(1 - 0.2 * percent) },
{ opacity: percent, transform: scale3d(1 - 0.2 + 0.2 * percent) }
];
}
}
};
var LightboxPanel = {
i18n: {
counter: "%s / %s"
},
mixins: [Modal, Slideshow],
functional: true,
props: {
counter: Boolean,
preload: Number,
nav: Boolean,
slidenav: Boolean,
delayControls: Number,
videoAutoplay: Boolean,
template: String
},
data: () => ({
counter: false,
preload: 1,
nav: false,
slidenav: true,
delayControls: 3e3,
videoAutoplay: false,
items: [],
cls: "uk-open",
clsPage: "uk-lightbox-page",
clsFit: "uk-lightbox-items-fit",
clsZoom: "uk-lightbox-zoom",
attrItem: "uk-lightbox-item",
selList: ".uk-lightbox-items",
selClose: ".uk-close-large",
selNav: ".uk-lightbox-thumbnav, .uk-lightbox-dotnav",
selCaption: ".uk-lightbox-caption",
selCounter: ".uk-lightbox-counter",
pauseOnHover: false,
velocity: 2,
Animations,
template: `
`
}),
created() {
let $el = $(this.template);
if (isTag($el, "template")) {
$el = fragment(html($el));
}
const list = $(this.selList, $el);
const navType = this.$props.nav;
remove$1($$(this.selNav, $el).filter((el) => !matches(el, `.uk-${navType}`)));
for (const [i, item] of this.items.entries()) {
append(list, "
");
if (navType === "thumbnav") {
wrapAll(
toThumbnavItem(item, this.videoAutoplay),
append($(this.selNav, $el), `
`)
);
}
}
if (!this.slidenav) {
remove$1($$(".uk-lightbox-slidenav", $el));
}
if (!this.counter) {
remove$1($(this.selCounter, $el));
}
addClass(list, this.clsFit);
const close = $("[uk-close]", $el);
const closeLabel = this.t("close");
if (close && closeLabel) {
close.dataset.i18n = JSON.stringify({ label: closeLabel });
}
this.$mount(append(this.container, $el));
},
events: [
{
name: "click",
self: true,
filter: ({ bgClose }) => bgClose,
delegate: ({ selList }) => `${selList} > *`,
handler(e) {
if (!e.defaultPrevented) {
this.hide();
}
}
},
{
name: "click",
self: true,
delegate: ({ clsZoom }) => `.${clsZoom}`,
handler(e) {
if (!e.defaultPrevented) {
toggleClass(this.list, this.clsFit);
}
}
},
{
name: `${pointerMove$1} ${pointerDown$1} keydown`,
filter: ({ delayControls }) => delayControls,
handler() {
this.showControls();
}
},
{
name: "shown",
self: true,
handler() {
this.showControls();
}
},
{
name: "hide",
self: true,
handler() {
this.hideControls();
removeClass(this.slides, this.clsActive);
Transition.stop(this.slides);
}
},
{
name: "hidden",
self: true,
handler() {
this.$destroy(true);
}
},
{
name: "keyup",
el: () => document,
handler({ keyCode }) {
if (!this.isToggled() || !this.draggable) {
return;
}
let i = -1;
if (keyCode === keyMap.LEFT) {
i = "previous";
} else if (keyCode === keyMap.RIGHT) {
i = "next";
} else if (keyCode === keyMap.HOME) {
i = 0;
} else if (keyCode === keyMap.END) {
i = "last";
}
if (~i) {
this.show(i);
}
}
},
{
name: "beforeitemshow",
handler(e) {
html($(this.selCaption, this.$el), this.getItem().caption || "");
html(
$(this.selCounter, this.$el),
this.t("counter", this.index + 1, this.slides.length)
);
for (let j = -this.preload; j <= this.preload; j++) {
this.loadItem(this.index + j);
}
if (this.isToggled()) {
return;
}
this.draggable = false;
e.preventDefault();
this.toggleElement(this.$el, true, false);
this.animation = Animations.scale;
removeClass(e.target, this.clsActive);
this.stack.splice(1, 0, this.index);
}
},
{
name: "itemshown",
handler() {
this.draggable = this.$props.draggable;
}
},
{
name: "itemload",
async handler(_, item) {
const { source: src, type, attrs = {} } = item;
this.setItem(item, "
");
if (!src) {
return;
}
let matches2;
const iframeAttrs = {
allowfullscreen: "",
style: "max-width: 100%; box-sizing: border-box;",
"uk-responsive": "",
"uk-video": Boolean(this.videoAutoplay)
};
if (type === "image" || isImage(src)) {
const img = createEl("img");
wrapInPicture(img, item.sources);
attr(img, {
src,
...pick(item, ["alt", "srcset", "sizes"]),
...attrs
});
on(img, "load", () => this.setItem(item, parent(img) || img));
on(img, "error", () => this.setError(item));
} else if (type === "video" || isVideo(src)) {
const inline = this.videoAutoplay === "inline";
const video = createEl("video", {
src,
playsinline: "",
controls: inline ? null : "",
loop: inline ? "" : null,
muted: inline ? "" : null,
poster: this.videoAutoplay ? null : item.poster,
"uk-video": Boolean(this.videoAutoplay),
...attrs
});
on(video, "loadedmetadata", () => this.setItem(item, video));
on(video, "error", () => this.setError(item));
} else if (type === "iframe" || src.match(/\.(html|php)($|\?)/i)) {
this.setItem(
item,
createEl("iframe", {
src,
allowfullscreen: "",
class: "uk-lightbox-iframe",
...attrs
})
);
} else if (matches2 = src.match(
/\/\/(?:.*?youtube(-nocookie)?\..*?(?:[?&]v=|\/shorts\/)|youtu\.be\/)([\w-]{11})[&?]?(.*)?/
)) {
this.setItem(
item,
createEl("iframe", {
src: `https://www.youtube${matches2[1] || ""}.com/embed/${matches2[2]}${matches2[3] ? `?${matches2[3]}` : ""}`,
width: 1920,
height: 1080,
...iframeAttrs,
...attrs
})
);
} else if (matches2 = src.match(/\/\/.*?vimeo\.[a-z]+\/(\d+)[&?]?(.*)?/)) {
try {
const { height, width } = await (await fetch(
`https://vimeo.com/api/oembed.json?maxwidth=1920&url=${encodeURI(
src
)}`,
{ credentials: "omit" }
)).json();
this.setItem(
item,
createEl("iframe", {
src: `https://player.vimeo.com/video/${matches2[1]}${matches2[2] ? `?${matches2[2]}` : ""}`,
width,
height,
...iframeAttrs,
...attrs
})
);
} catch {
this.setError(item);
}
}
}
},
{
name: "itemloaded",
handler() {
this.$emit("resize");
}
}
],
update: {
read() {
for (const media of $$(`${this.selList} :not([controls]):is(img,video)`, this.$el)) {
toggleClass(
media,
this.clsZoom,
(media.naturalHeight || media.videoHeight) - this.$el.offsetHeight > Math.max(
0,
(media.naturalWidth || media.videoWidth) - this.$el.offsetWidth
)
);
}
},
events: ["resize"]
},
methods: {
loadItem(index = this.index) {
const item = this.getItem(index);
if (!this.getSlide(item).childElementCount) {
trigger(this.$el, "itemload", [item]);
}
},
getItem(index = this.index) {
return this.items[getIndex(index, this.slides)];
},
setItem(item, content) {
trigger(this.$el, "itemloaded", [this, html(this.getSlide(item), content)]);
},
getSlide(item) {
return this.slides[this.items.indexOf(item)];
},
setError(item) {
this.setItem(item, '
');
},
showControls() {
clearTimeout(this.controlsTimer);
this.controlsTimer = this.delayControls && setTimeout(this.hideControls, this.delayControls);
addClass(this.$el, "uk-active", "uk-transition-active");
},
hideControls() {
removeClass(this.$el, "uk-active", "uk-transition-active");
}
}
};
function createEl(tag, attrs) {
const el = fragment(`<${tag}>`);
attr(el, attrs);
return el;
}
function toThumbnavItem(item, videoAutoplay) {
const el = item.poster || item.thumb && (item.type === "image" || isImage(item.thumb)) ? createEl("img", { src: item.poster || item.thumb, alt: "" }) : item.thumb && (item.type === "video" || isVideo(item.thumb)) ? createEl("video", {
src: item.thumb,
loop: "",
playsinline: "",
muted: "",
"uk-video": videoAutoplay === "inline"
}) : createEl("canvas");
if (item.thumbRatio) {
el.style.aspectRatio = item.thumbRatio;
}
return el;
}
function isImage(src) {
return src == null ? void 0 : src.match(/\.(avif|jpe?g|jfif|a?png|gif|svg|webp)($|\?)/i);
}
function isVideo(src) {
return src == null ? void 0 : src.match(/\.(mp4|webm|ogv)($|\?)/i);
}
const selDisabled$1 = ".uk-disabled *, .uk-disabled, [disabled]";
var lightbox = {
install: install$3,
props: { toggle: String },
data: { toggle: "a" },
computed: {
toggles: ({ toggle }, $el) => $$(toggle, $el)
},
watch: {
toggles(toggles) {
this.hide();
for (const toggle of toggles) {
if (isTag(toggle, "a")) {
toggle.role = "button";
}
}
}
},
disconnected() {
this.hide();
},
events: {
name: "click",
delegate: ({ toggle }) => toggle,
handler(e) {
if (!e.defaultPrevented) {
e.preventDefault();
if (!matches(e.current, selDisabled$1)) {
this.show(e.current);
}
}
}
},
methods: {
show(index) {
let items = this.toggles.map(toItem);
if (this.nav === "thumbnav") {
ensureThumb.call(this, this.toggles, items);
}
items = uniqueBy(items, "source");
if (isElement(index)) {
const { source } = toItem(index);
index = findIndex(items, ({ source: src }) => source === src);
}
this.panel = this.panel || this.$create("lightboxPanel", { ...this.$props, items });
on(this.panel.$el, "hidden", () => this.panel = null);
return this.panel.show(index);
},
hide() {
var _a;
return (_a = this.panel) == null ? void 0 : _a.hide();
}
}
};
function install$3(UIkit, Lightbox) {
if (!UIkit.lightboxPanel) {
UIkit.component("lightboxPanel", LightboxPanel);
}
assign(Lightbox.props, UIkit.component("lightboxPanel").options.props);
}
function ensureThumb(toggles, items) {
for (const [i, toggle] of Object.entries(toggles)) {
if (items[i].thumb) {
continue;
}
const parent = parents(toggle).reverse().concat(toggle).find(
(parent2) => this.$el.contains(parent2) && (parent2 === toggle || $$(this.toggle, parent2).length === 1)
);
if (!parent) {
continue;
}
const media = $("img,video", parent);
if (media) {
items[i].thumb = media.currentSrc || media.poster || media.src;
items[i].thumbRatio = (media.naturalWidth || media.videoWidth) / (media.naturalHeight || media.videoHeight);
}
}
}
function toItem(el) {
const item = {};
for (const attribute of el.getAttributeNames()) {
const key = attribute.replace(/^data-/, "");
item[key === "href" ? "source" : key] = el.getAttribute(attribute);
}
item.attrs = parseOptions(item.attrs);
return item;
}
var notification = {
mixins: [Container],
functional: true,
args: ["message", "status"],
data: {
message: "",
status: "",
timeout: 5e3,
group: "",
pos: "top-center",
clsContainer: "uk-notification",
clsClose: "uk-notification-close",
clsMsg: "uk-notification-message"
},
install: install$2,
computed: {
marginProp: ({ pos }) => `margin-${pos.match(/[a-z]+(?=-)/)[0]}`,
startProps() {
return { opacity: 0, [this.marginProp]: -this.$el.offsetHeight };
}
},
created() {
const posClass = `${this.clsContainer}-${this.pos}`;
const containerAttr = `data-${this.clsContainer}-container`;
const container = $(`.${posClass}[${containerAttr}]`, this.container) || append(
this.container,
`
`
);
this.$mount(
append(
container,
`
`
)
);
},
async connected() {
const margin = toFloat(css(this.$el, this.marginProp));
await Transition.start(css(this.$el, this.startProps), {
opacity: 1,
[this.marginProp]: margin
});
if (this.timeout) {
this.timer = setTimeout(this.close, this.timeout);
}
},
events: {
click(e) {
maybeDefaultPreventClick(e);
this.close();
},
[pointerEnter]() {
if (this.timer) {
clearTimeout(this.timer);
}
},
[pointerLeave]() {
if (this.timeout) {
this.timer = setTimeout(this.close, this.timeout);
}
}
},
methods: {
async close(immediate) {
const removeFn = (el) => {
const container = parent(el);
trigger(el, "close", [this]);
remove$1(el);
if (!(container == null ? void 0 : container.hasChildNodes())) {
remove$1(container);
}
};
if (this.timer) {
clearTimeout(this.timer);
}
if (!immediate) {
await Transition.start(this.$el, this.startProps);
}
removeFn(this.$el);
}
}
};
function install$2(UIkit) {
UIkit.notification.closeAll = function(group, immediate) {
apply(document.body, (el) => {
const notification = UIkit.getComponent(el, "notification");
if (notification && (!group || group === notification.group)) {
notification.close(immediate);
}
});
};
}
var Media = {
props: {
media: Boolean
},
data: {
media: false
},
connected() {
const media = toMedia(this.media, this.$el);
this.matchMedia = true;
if (media) {
this.mediaObj = window.matchMedia(media);
const handler = () => {
this.matchMedia = this.mediaObj.matches;
trigger(this.$el, createEvent("mediachange", false, true, [this.mediaObj]));
};
this.offMediaObj = on(this.mediaObj, "change", () => {
handler();
this.$emit("resize");
});
handler();
}
},
disconnected() {
var _a;
(_a = this.offMediaObj) == null ? void 0 : _a.call(this);
}
};
function toMedia(value, element) {
if (isString(value)) {
if (startsWith(value, "@")) {
value = toFloat(css(element, `--uk-breakpoint-${value.slice(1)}`));
} else if (isNaN(value)) {
return value;
}
}
return value && isNumeric(value) ? `(min-width: ${value}px)` : "";
}
function getMaxPathLength(el) {
return isVisible(el) ? Math.ceil(
Math.max(0, ...$$("[stroke]", el).map((stroke) => {
var _a;
return ((_a = stroke.getTotalLength) == null ? void 0 : _a.call(stroke)) || 0;
}))
) : 0;
}
const props = {
x: transformFn,
y: transformFn,
rotate: transformFn,
scale: transformFn,
color: colorFn,
backgroundColor: colorFn,
borderColor: colorFn,
blur: filterFn,
hue: filterFn,
fopacity: filterFn,
grayscale: filterFn,
invert: filterFn,
saturate: filterFn,
sepia: filterFn,
opacity: cssPropFn,
stroke: strokeFn,
bgx: backgroundFn,
bgy: backgroundFn
};
const { keys } = Object;
var Parallax = {
mixins: [Media],
props: fillObject(keys(props), "list"),
data: fillObject(keys(props), void 0),
computed: {
props(properties, $el) {
const stops = {};
for (const prop in properties) {
if (prop in props && !isUndefined(properties[prop])) {
stops[prop] = properties[prop].slice();
}
}
const result = {};
for (const prop in stops) {
result[prop] = props[prop](prop, $el, stops[prop], stops);
}
return result;
}
},
events: {
load() {
this.$emit();
}
},
methods: {
reset() {
resetProps(this.$el, this.getCss(0));
},
getCss(percent) {
const css2 = {};
for (const prop in this.props) {
this.props[prop](css2, clamp(percent));
}
css2.willChange = Object.keys(css2).map(propName).join(",");
return css2;
}
}
};
function transformFn(prop, el, stops) {
let unit = getUnit(stops) || { x: "px", y: "px", rotate: "deg" }[prop] || "";
let transformFn2;
if (prop === "x" || prop === "y") {
prop = `translate${ucfirst(prop)}`;
transformFn2 = (stop) => toFloat(toFloat(stop).toFixed(unit === "px" ? 0 : 6));
} else if (prop === "scale") {
unit = "";
transformFn2 = (stop) => {
var _a;
return getUnit([stop]) ? toPx(stop, "width", el, true) / el[`offset${((_a = stop.endsWith) == null ? void 0 : _a.call(stop, "vh")) ? "Height" : "Width"}`] : toFloat(stop);
};
}
if (stops.length === 1) {
stops.unshift(prop === "scale" ? 1 : 0);
}
stops = parseStops(stops, transformFn2);
return (css2, percent) => {
css2.transform = `${css2.transform || ""} ${prop}(${getValue(stops, percent)}${unit})`;
};
}
function colorFn(prop, el, stops) {
if (stops.length === 1) {
stops.unshift(getCssValue(el, prop, ""));
}
stops = parseStops(stops, (stop) => parseColor(el, stop));
return (css2, percent) => {
const [start, end, p] = getStop(stops, percent);
const value = start.map((value2, i) => {
value2 += p * (end[i] - value2);
return i === 3 ? toFloat(value2) : parseInt(value2, 10);
}).join(",");
css2[prop] = `rgba(${value})`;
};
}
function parseColor(el, color) {
return getCssValue(el, "color", color).split(/[(),]/g).slice(1, -1).concat(1).slice(0, 4).map(toFloat);
}
function filterFn(prop, el, stops) {
if (stops.length === 1) {
stops.unshift(0);
}
const unit = getUnit(stops) || { blur: "px", hue: "deg" }[prop] || "%";
prop = { fopacity: "opacity", hue: "hue-rotate" }[prop] || prop;
stops = parseStops(stops);
return (css2, percent) => {
const value = getValue(stops, percent);
css2.filter = `${css2.filter || ""} ${prop}(${value + unit})`;
};
}
function cssPropFn(prop, el, stops) {
if (stops.length === 1) {
stops.unshift(getCssValue(el, prop, ""));
}
stops = parseStops(stops);
return (css2, percent) => {
css2[prop] = getValue(stops, percent);
};
}
function strokeFn(prop, el, stops) {
if (stops.length === 1) {
stops.unshift(0);
}
const unit = getUnit(stops);
const length = getMaxPathLength(el);
stops = parseStops(stops.reverse(), (stop) => {
stop = toFloat(stop);
return unit === "%" ? stop * length / 100 : stop;
});
if (!stops.some(([value]) => value)) {
return noop;
}
css(el, "strokeDasharray", length);
return (css2, percent) => {
css2.strokeDashoffset = getValue(stops, percent);
};
}
function backgroundFn(prop, el, stops, props2) {
if (stops.length === 1) {
stops.unshift(0);
}
const attr = prop === "bgy" ? "height" : "width";
props2[prop] = parseStops(stops, (stop) => toPx(stop, attr, el));
const bgProps = ["bgx", "bgy"].filter((prop2) => prop2 in props2);
if (bgProps.length === 2 && prop === "bgx") {
return noop;
}
if (getCssValue(el, "backgroundSize", "") === "cover") {
return backgroundCoverFn(prop, el, stops, props2);
}
const positions = {};
for (const prop2 of bgProps) {
positions[prop2] = getBackgroundPos(el, prop2);
}
return setBackgroundPosFn(bgProps, positions, props2);
}
function backgroundCoverFn(prop, el, stops, props2) {
const dimImage = getBackgroundImageDimensions(el);
if (!dimImage.width) {
return noop;
}
const dimEl = {
width: el.offsetWidth,
height: el.offsetHeight
};
const bgProps = ["bgx", "bgy"].filter((prop2) => prop2 in props2);
const positions = {};
for (const prop2 of bgProps) {
const values = props2[prop2].map(([value]) => value);
const min = Math.min(...values);
const max = Math.max(...values);
const down = values.indexOf(min) < values.indexOf(max);
const diff = max - min;
positions[prop2] = `${(down ? -diff : 0) - (down ? min : max)}px`;
dimEl[prop2 === "bgy" ? "height" : "width"] += diff;
}
const dim = Dimensions.cover(dimImage, dimEl);
for (const prop2 of bgProps) {
const attr = prop2 === "bgy" ? "height" : "width";
const overflow = dim[attr] - dimEl[attr];
positions[prop2] = `max(${getBackgroundPos(el, prop2)},-${overflow}px) + ${positions[prop2]}`;
}
const fn = setBackgroundPosFn(bgProps, positions, props2);
return (css2, percent) => {
fn(css2, percent);
css2.backgroundSize = `${dim.width}px ${dim.height}px`;
css2.backgroundRepeat = "no-repeat";
};
}
function getBackgroundPos(el, prop) {
return getCssValue(el, `background-position-${prop.slice(-1)}`, "");
}
function setBackgroundPosFn(bgProps, positions, props2) {
return function(css2, percent) {
for (const prop of bgProps) {
const value = getValue(props2[prop], percent);
css2[`background-position-${prop.slice(-1)}`] = `calc(${positions[prop]} + ${value}px)`;
}
};
}
const loading = {};
const dimensions = {};
function getBackgroundImageDimensions(el) {
const src = css(el, "backgroundImage").replace(/^none|url\(["']?(.+?)["']?\)$/, "$1");
if (dimensions[src]) {
return dimensions[src];
}
const image = new Image();
if (src) {
image.src = src;
if (!image.naturalWidth && !loading[src]) {
once(image, "error load", () => {
dimensions[src] = toDimensions(image);
trigger(el, createEvent("load", false));
});
loading[src] = true;
return toDimensions(image);
}
}
return dimensions[src] = toDimensions(image);
}
function toDimensions(image) {
return {
width: image.naturalWidth,
height: image.naturalHeight
};
}
function parseStops(stops, fn = toFloat) {
const result = [];
const { length } = stops;
let nullIndex = 0;
for (let i = 0; i < length; i++) {
let [value, percent] = isString(stops[i]) ? stops[i].trim().split(/ (?![^(]*\))/) : [stops[i]];
value = fn(value);
percent = percent ? toFloat(percent) / 100 : null;
if (i === 0) {
if (percent === null) {
percent = 0;
} else if (percent) {
result.push([value, 0]);
}
} else if (i === length - 1) {
if (percent === null) {
percent = 1;
} else if (percent !== 1) {
result.push([value, percent]);
percent = 1;
}
}
result.push([value, percent]);
if (percent === null) {
nullIndex++;
} else if (nullIndex) {
const leftPercent = result[i - nullIndex - 1][1];
const p = (percent - leftPercent) / (nullIndex + 1);
for (let j = nullIndex; j > 0; j--) {
result[i - j][1] = leftPercent + p * (nullIndex - j + 1);
}
nullIndex = 0;
}
}
return result;
}
function getStop(stops, percent) {
const index = findIndex(stops.slice(1), ([, targetPercent]) => percent <= targetPercent) + 1;
return [
stops[index - 1][0],
stops[index][0],
(percent - stops[index - 1][1]) / (stops[index][1] - stops[index - 1][1])
];
}
function getValue(stops, percent) {
const [start, end, p] = getStop(stops, percent);
return start + Math.abs(start - end) * p * (start < end ? 1 : -1);
}
const unitRe = /^-?\d+(?:\.\d+)?(\S+)?/;
function getUnit(stops, defaultUnit) {
var _a;
for (const stop of stops) {
const match = (_a = stop.match) == null ? void 0 : _a.call(stop, unitRe);
if (match) {
return match[1];
}
}
return defaultUnit;
}
function getCssValue(el, prop, value) {
const prev = el.style[prop];
const val = css(css(el, prop, value), prop);
el.style[prop] = prev;
return val;
}
function fillObject(keys2, value) {
return keys2.reduce((data, prop) => {
data[prop] = value;
return data;
}, {});
}
function ease(percent, easing) {
return easing >= 0 ? Math.pow(percent, easing + 1) : 1 - Math.pow(1 - percent, 1 - easing);
}
var parallax = {
mixins: [Parallax],
props: {
target: String,
viewport: Number,
// Deprecated
easing: Number,
start: String,
end: String
},
data: {
target: false,
viewport: 1,
easing: 1,
start: 0,
end: 0
},
computed: {
target: ({ target }, $el) => getOffsetElement(target && query(target, $el) || $el),
start({ start }) {
return toPx(start, "height", this.target, true);
},
end({ end, viewport: viewport2 }) {
return toPx(
end || (viewport2 = (1 - viewport2) * 100) && `${viewport2}vh+${viewport2}%`,
"height",
this.target,
true
);
}
},
observe: [
viewport(),
scroll$1({ target: ({ target }) => target }),
resize({ target: ({ $el, target }) => [$el, target, scrollParent(target, true)] })
],
update: {
read({ percent }, types) {
if (!types.has("scroll")) {
percent = false;
}
if (!isVisible(this.$el)) {
return false;
}
if (!this.matchMedia) {
return;
}
const prev = percent;
percent = ease(scrolledOver(this.target, this.start, this.end), this.easing);
return {
percent,
style: prev === percent ? false : this.getCss(percent)
};
},
write({ style }) {
if (!this.matchMedia) {
this.reset();
return;
}
style && css(this.$el, style);
},
events: ["scroll", "resize"]
}
};
function getOffsetElement(el) {
return el ? "offsetTop" in el ? el : getOffsetElement(parent(el)) : document.documentElement;
}
var SliderParallax = {
props: {
parallax: Boolean,
parallaxTarget: Boolean,
parallaxStart: String,
parallaxEnd: String,
parallaxEasing: Number
},
data: {
parallax: false,
parallaxTarget: false,
parallaxStart: 0,
parallaxEnd: 0,
parallaxEasing: 0
},
observe: [
resize({
target: ({ $el, parallaxTarget }) => [$el, parallaxTarget],
filter: ({ parallax }) => parallax
}),
scroll$1({ filter: ({ parallax }) => parallax })
],
computed: {
parallaxTarget({ parallaxTarget }, $el) {
return parallaxTarget && query(parallaxTarget, $el) || this.list;
}
},
update: {
read() {
if (!this.parallax) {
return false;
}
const target = this.parallaxTarget;
if (!target) {
return false;
}
const start = toPx(this.parallaxStart, "height", target, true);
const end = toPx(this.parallaxEnd, "height", target, true);
const percent = ease(scrolledOver(target, start, end), this.parallaxEasing);
return { parallax: this.getIndexAt(percent) };
},
write({ parallax }) {
const [prevIndex, slidePercent] = parallax;
const nextIndex = this.getValidIndex(prevIndex + Math.ceil(slidePercent));
const prev = this.slides[prevIndex];
const next = this.slides[nextIndex];
const { triggerShow, triggerShown, triggerHide, triggerHidden } = useTriggers(this);
if (~this.prevIndex) {
for (const i of /* @__PURE__ */ new Set([this.index, this.prevIndex])) {
if (!includes([nextIndex, prevIndex], i)) {
triggerHide(this.slides[i]);
triggerHidden(this.slides[i]);
}
}
}
const changed = this.prevIndex !== prevIndex || this.index !== nextIndex;
this.dir = 1;
this.prevIndex = prevIndex;
this.index = nextIndex;
if (prev !== next) {
triggerHide(prev);
}
triggerShow(next);
if (changed) {
triggerShown(prev);
}
this._translate(prev === next ? 1 : slidePercent, prev, next);
},
events: ["scroll", "resize"]
},
methods: {
getIndexAt(percent) {
const index = percent * (this.length - 1);
return [Math.floor(index), index % 1];
}
}
};
function useTriggers(cmp) {
const { clsSlideActive, clsEnter, clsLeave } = cmp;
return { triggerShow, triggerShown, triggerHide, triggerHidden };
function triggerShow(el) {
if (hasClass(el, clsLeave)) {
triggerHide(el);
triggerHidden(el);
}
if (!hasClass(el, clsSlideActive)) {
trigger(el, "beforeitemshow", [cmp]);
trigger(el, "itemshow", [cmp]);
}
}
function triggerShown(el) {
if (hasClass(el, clsEnter)) {
trigger(el, "itemshown", [cmp]);
}
}
function triggerHide(el) {
if (!hasClass(el, clsSlideActive)) {
triggerShow(el);
}
if (hasClass(el, clsEnter)) {
triggerShown(el);
}
if (!hasClass(el, clsLeave)) {
trigger(el, "beforeitemhide", [cmp]);
trigger(el, "itemhide", [cmp]);
}
}
function triggerHidden(el) {
if (hasClass(el, clsLeave)) {
trigger(el, "itemhidden", [cmp]);
}
}
}
var SliderReactive = {
update: {
write() {
if (this.stack.length || this.dragging || this.parallax) {
return;
}
const index = this.getValidIndex();
if (!~this.prevIndex || this.index !== index) {
this.show(index);
} else {
this._translate(1);
}
},
events: ["resize"]
}
};
var SliderPreload = {
observe: lazyload({
target: ({ slides }) => slides,
targets: (instance) => instance.getAdjacentSlides()
}),
methods: {
getAdjacentSlides() {
return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
}
}
};
function Transitioner(prev, next, dir, { center, easing, list }) {
const from = prev ? getLeft(prev, list, center) : getLeft(next, list, center) + dimensions$1(next).width * dir;
const to = next ? getLeft(next, list, center) : from + dimensions$1(prev).width * dir * (isRtl ? -1 : 1);
const { promise, resolve } = withResolvers();
return {
dir,
show(duration, percent = 0, linear) {
const timing = linear ? "linear" : easing;
duration -= Math.round(duration * clamp(percent, -1, 1));
css(list, "transitionProperty", "none");
this.translate(percent);
css(list, "transitionProperty", "");
percent = prev ? percent : clamp(percent, 0, 1);
triggerUpdate(this.getItemIn(), "itemin", { percent, duration, timing, dir });
prev && triggerUpdate(this.getItemIn(true), "itemout", {
percent: 1 - percent,
duration,
timing,
dir
});
Transition.start(
list,
{ transform: translate(-to * (isRtl ? -1 : 1), "px") },
duration,
timing
).then(resolve, noop);
return promise;
},
cancel() {
return Transition.cancel(list);
},
reset() {
css(list, "transform", "");
},
async forward(duration, percent = this.percent()) {
await this.cancel();
return this.show(duration, percent, true);
},
translate(percent) {
if (percent === this.percent()) {
return;
}
const distance = this.getDistance() * dir * (isRtl ? -1 : 1);
css(
list,
"transform",
translate(
clamp(
-to + (distance - distance * percent),
-getWidth(list),
dimensions$1(list).width
) * (isRtl ? -1 : 1),
"px"
)
);
const actives = this.getActives();
const itemIn = this.getItemIn();
const itemOut = this.getItemIn(true);
percent = prev ? clamp(percent, -1, 1) : 0;
for (const slide of children(list)) {
const isActive = includes(actives, slide);
const isIn = slide === itemIn;
const isOut = slide === itemOut;
const translateIn = isIn || !isOut && (isActive || dir * (isRtl ? -1 : 1) === -1 ^ getElLeft(slide, list) > getElLeft(prev || next));
triggerUpdate(slide, `itemtranslate${translateIn ? "in" : "out"}`, {
dir,
percent: isOut ? 1 - percent : isIn ? percent : isActive ? 1 : 0
});
}
},
percent() {
return Math.abs(
(new DOMMatrix(css(list, "transform")).m41 * (isRtl ? -1 : 1) + from) / (to - from)
);
},
getDistance() {
return Math.abs(to - from);
},
getItemIn(out = false) {
let actives = this.getActives();
let nextActives = inView(list, getLeft(next || prev, list, center));
if (out) {
const temp = actives;
actives = nextActives;
nextActives = temp;
}
return nextActives[findIndex(nextActives, (el) => !includes(actives, el))];
},
getActives() {
return inView(list, getLeft(prev || next, list, center));
}
};
}
function getLeft(el, list, center) {
const left = getElLeft(el, list);
return center ? left - centerEl(el, list) : Math.min(left, getMax(list));
}
function getMax(list) {
return Math.max(0, getWidth(list) - dimensions$1(list).width);
}
function getWidth(list, index) {
return sumBy(children(list).slice(0, index), (el) => dimensions$1(el).width);
}
function centerEl(el, list) {
return dimensions$1(list).width / 2 - dimensions$1(el).width / 2;
}
function getElLeft(el, list) {
return el && (position(el).left + (isRtl ? dimensions$1(el).width - dimensions$1(list).width : 0)) * (isRtl ? -1 : 1) || 0;
}
function inView(list, listLeft) {
listLeft -= 1;
const listWidth = dimensions$1(list).width;
const listRight = listLeft + listWidth + 2;
return children(list).filter((slide) => {
const slideLeft = getElLeft(slide, list);
const slideRight = slideLeft + Math.min(dimensions$1(slide).width, listWidth);
return slideLeft >= listLeft && slideRight <= listRight;
});
}
var slider = {
mixins: [Class, Slider, SliderReactive, SliderParallax, SliderPreload],
props: {
center: Boolean,
sets: Boolean,
active: String
},
data: {
center: false,
sets: false,
attrItem: "uk-slider-item",
selList: ".uk-slider-items",
selNav: ".uk-slider-nav",
clsContainer: "uk-slider-container",
active: "all",
Transitioner
},
computed: {
finite({ finite }) {
return finite || isFinite(this.list, this.center);
},
maxIndex() {
if (!this.finite || this.center && !this.sets) {
return this.length - 1;
}
if (this.center) {
return last(this.sets);
}
let lft = 0;
const max = getMax(this.list);
const index = findIndex(this.slides, (el) => {
if (lft >= max - 5e-3) {
return true;
}
lft += dimensions$1(el).width;
});
return ~index ? index : this.length - 1;
},
sets({ sets: enabled }) {
if (!enabled || this.parallax) {
return;
}
let left = 0;
const sets = [];
const width = dimensions$1(this.list).width;
for (let i = 0; i < this.length; i++) {
const slideWidth = dimensions$1(this.slides[i]).width;
if (left + slideWidth > width) {
left = 0;
}
if (this.center) {
if (left < width / 2 && left + slideWidth + dimensions$1(this.slides[getIndex(i + 1, this.slides)]).width / 2 > width / 2) {
sets.push(i);
left = width / 2 - slideWidth / 2;
}
} else if (left === 0) {
sets.push(Math.min(i, this.maxIndex));
}
left += slideWidth;
}
if (sets.length) {
return sets;
}
},
transitionOptions() {
return {
center: this.center,
list: this.list
};
},
slides() {
return children(this.list).filter(isVisible);
}
},
connected() {
toggleClass(this.$el, this.clsContainer, !$(`.${this.clsContainer}`, this.$el));
},
observe: resize({
target: ({ slides, $el }) => [$el, ...slides]
}),
update: {
write() {
for (const el of this.navItems) {
const index = toNumber(data(el, this.attrItem));
if (index !== false) {
el.hidden = !this.maxIndex || index > this.maxIndex || this.sets && !includes(this.sets, index);
}
}
this.reorder();
if (!this.parallax) {
this._translate(1);
}
this.updateActiveClasses();
},
events: ["resize"]
},
events: {
beforeitemshow(e) {
if (!this.dragging && this.sets && this.stack.length < 2 && !includes(this.sets, this.index)) {
this.index = this.getValidIndex();
}
const diff = Math.abs(
this.index - this.prevIndex + (this.dir > 0 && this.index < this.prevIndex || this.dir < 0 && this.index > this.prevIndex ? (this.maxIndex + 1) * this.dir : 0)
);
if (!this.dragging && diff > 1) {
for (let i = 0; i < diff; i++) {
this.stack.splice(1, 0, this.dir > 0 ? "next" : "previous");
}
e.preventDefault();
return;
}
const index = this.dir < 0 || !this.slides[this.prevIndex] ? this.index : this.prevIndex;
const avgWidth = getWidth(this.list) / this.length;
this.duration = speedUp(avgWidth / this.velocity) * (dimensions$1(this.slides[index]).width / avgWidth);
this.reorder();
},
itemshow() {
if (~this.prevIndex) {
addClass(this._getTransitioner().getItemIn(), this.clsActive);
}
this.updateActiveClasses(this.prevIndex);
},
itemshown() {
this.updateActiveClasses();
}
},
methods: {
reorder() {
if (this.finite) {
css(this.slides, "order", "");
return;
}
const index = this.dir > 0 && this.slides[this.prevIndex] ? this.prevIndex : this.index;
this.slides.forEach(
(slide, i) => css(
slide,
"order",
this.dir > 0 && i < index ? 1 : this.dir < 0 && i >= this.index ? -1 : ""
)
);
if (!this.center || !this.length) {
return;
}
const next = this.slides[index];
let width = dimensions$1(this.list).width / 2 - dimensions$1(next).width / 2;
let j = 0;
while (width > 0) {
const slideIndex = this.getIndex(--j + index, index);
const slide = this.slides[slideIndex];
css(slide, "order", slideIndex > index ? -2 : -1);
width -= dimensions$1(slide).width;
}
},
updateActiveClasses(currentIndex = this.index) {
let actives = this._getTransitioner(currentIndex).getActives();
if (this.active !== "all") {
actives = [this.slides[this.getValidIndex(currentIndex)]];
}
const activeClasses = [
this.clsActive,
!this.sets || includes(this.sets, toFloat(this.index)) ? this.clsActivated : ""
];
for (const slide of this.slides) {
const active = includes(actives, slide);
toggleClass(slide, activeClasses, active);
slide.ariaHidden = !active;
for (const focusable of $$(selFocusable, slide)) {
if (!hasOwn(focusable, "_tabindex")) {
focusable._tabindex = focusable.tabIndex;
}
focusable.tabIndex = active ? focusable._tabindex : -1;
}
}
},
getValidIndex(index = this.index, prevIndex = this.prevIndex) {
index = this.getIndex(index, prevIndex);
if (!this.sets) {
return index;
}
let prev;
do {
if (includes(this.sets, index)) {
return index;
}
prev = index;
index = this.getIndex(index + this.dir, prevIndex);
} while (index !== prev);
return index;
},
getAdjacentSlides() {
const { width } = dimensions$1(this.list);
const left = -width;
const right = width * 2;
const slideWidth = dimensions$1(this.slides[this.index]).width;
const slideLeft = this.center ? width / 2 - slideWidth / 2 : 0;
const slides = /* @__PURE__ */ new Set();
for (const i of [-1, 1]) {
let currentLeft = slideLeft + (i > 0 ? slideWidth : 0);
let j = 0;
do {
const slide = this.slides[this.getIndex(this.index + i + j++ * i)];
currentLeft += dimensions$1(slide).width * i;
slides.add(slide);
} while (this.length > j && currentLeft > left && currentLeft < right);
}
return Array.from(slides);
},
getIndexAt(percent) {
let index = -1;
const scrollDist = this.center ? getWidth(this.list) - (dimensions$1(this.slides[0]).width / 2 + dimensions$1(last(this.slides)).width / 2) : getWidth(this.list, this.maxIndex);
let dist = percent * scrollDist;
let slidePercent = 0;
do {
const slideWidth = dimensions$1(this.slides[++index]).width;
const slideDist = this.center ? slideWidth / 2 + dimensions$1(this.slides[index + 1]).width / 2 : slideWidth;
slidePercent = dist / slideDist % 1;
dist -= slideDist;
} while (dist >= 0 && index < this.maxIndex);
return [index, slidePercent];
}
}
};
function isFinite(list, center) {
if (!list || list.length < 2) {
return true;
}
const { width: listWidth } = dimensions$1(list);
if (!center) {
return Math.ceil(getWidth(list)) < Math.trunc(listWidth + getMaxElWidth(list));
}
const slides = children(list);
const listHalf = Math.trunc(listWidth / 2);
for (const index in slides) {
const slide = slides[index];
const slideWidth = dimensions$1(slide).width;
const slidesInView = /* @__PURE__ */ new Set([slide]);
let diff = 0;
for (const i of [-1, 1]) {
let left = slideWidth / 2;
let j = 0;
while (left < listHalf) {
const nextSlide = slides[getIndex(+index + i + j++ * i, slides)];
if (slidesInView.has(nextSlide)) {
return true;
}
left += dimensions$1(nextSlide).width;
slidesInView.add(nextSlide);
}
diff = Math.max(
diff,
slideWidth / 2 + dimensions$1(slides[getIndex(+index + i, slides)]).width / 2 - (left - listHalf)
);
}
if (Math.trunc(diff) > sumBy(
slides.filter((slide2) => !slidesInView.has(slide2)),
(slide2) => dimensions$1(slide2).width
)) {
return true;
}
}
return false;
}
function getMaxElWidth(list) {
return Math.max(0, ...children(list).map((el) => dimensions$1(el).width));
}
var sliderParallax = {
mixins: [Parallax],
beforeConnect() {
this.item = this.$el.closest(`.${this.$options.id.replace("parallax", "items")} > *`);
},
disconnected() {
this.item = null;
},
events: [
{
name: "itemin itemout",
self: true,
el: ({ item }) => item,
handler({ type, detail: { percent, duration, timing, dir } }) {
fastdom.read(() => {
if (!this.matchMedia) {
return;
}
const propsFrom = this.getCss(getCurrentPercent(type, dir, percent));
const propsTo = this.getCss(isIn(type) ? 0.5 : dir > 0 ? 1 : 0);
fastdom.write(() => {
css(this.$el, propsFrom);
Transition.start(this.$el, propsTo, duration, timing).catch(noop);
});
});
}
},
{
name: "transitioncanceled transitionend",
self: true,
el: ({ item }) => item,
handler() {
Transition.cancel(this.$el);
}
},
{
name: "itemtranslatein itemtranslateout",
self: true,
el: ({ item }) => item,
handler({ type, detail: { percent, dir } }) {
fastdom.read(() => {
if (!this.matchMedia) {
this.reset();
return;
}
const props = this.getCss(getCurrentPercent(type, dir, percent));
fastdom.write(() => css(this.$el, props));
});
}
}
]
};
function isIn(type) {
return endsWith(type, "in");
}
function getCurrentPercent(type, dir, percent) {
percent /= 2;
return isIn(type) ^ dir < 0 ? percent : 1 - percent;
}
var slideshow = {
mixins: [Class, Slideshow, SliderReactive, SliderParallax, SliderPreload],
props: {
ratio: String,
minHeight: String,
maxHeight: String
},
data: {
ratio: "16:9",
minHeight: void 0,
maxHeight: void 0,
selList: ".uk-slideshow-items",
attrItem: "uk-slideshow-item",
selNav: ".uk-slideshow-nav",
Animations: Animations$1
},
watch: {
list(list) {
css(list, {
aspectRatio: this.ratio ? this.ratio.replace(":", "/") : void 0,
minHeight: this.minHeight,
maxHeight: this.maxHeight,
width: "100%"
});
}
},
methods: {
getAdjacentSlides() {
return [1, -1].map((i) => this.slides[this.getIndex(this.index + i)]);
}
}
};
var sortable = {
mixins: [Class, Animate],
props: {
group: String,
threshold: Number,
clsItem: String,
clsPlaceholder: String,
clsDrag: String,
clsDragState: String,
clsBase: String,
clsNoDrag: String,
clsEmpty: String,
clsCustom: String,
handle: String
},
data: {
group: false,
threshold: 5,
clsItem: "uk-sortable-item",
clsPlaceholder: "uk-sortable-placeholder",
clsDrag: "uk-sortable-drag",
clsDragState: "uk-drag",
clsBase: "uk-sortable",
clsNoDrag: "uk-sortable-nodrag",
clsEmpty: "uk-sortable-empty",
clsCustom: "",
handle: false,
pos: {}
},
events: {
name: pointerDown$1,
passive: false,
handler(e) {
this.init(e);
}
},
computed: {
target: (_, $el) => ($el.tBodies || [$el])[0],
items() {
return children(this.target);
},
isEmpty() {
return !this.items.length;
},
handles({ handle }, $el) {
return handle ? $$(handle, $el) : this.items;
}
},
watch: {
isEmpty(empty) {
toggleClass(this.target, this.clsEmpty, empty);
},
handles(handles, prev) {
const props = { touchAction: "none", userSelect: "none" };
resetProps(prev, props);
css(handles, props);
}
},
update: {
write(data) {
if (!this.drag || !parent(this.placeholder)) {
return;
}
const {
pos: { x, y },
origin: { offsetTop, offsetLeft },
placeholder
} = this;
css(this.drag, {
top: y - offsetTop,
left: x - offsetLeft
});
const sortable = this.getSortable(document.elementFromPoint(x, y));
if (!sortable) {
return;
}
const { items } = sortable;
if (items.some(Transition.inProgress)) {
return;
}
const target = findTarget(items, { x, y });
if (items.length && (!target || target === placeholder)) {
return;
}
const previous = this.getSortable(placeholder);
const insertTarget = findInsertTarget(
sortable.target,
target,
placeholder,
x,
y,
sortable === previous && data.moved !== target
);
if (insertTarget === false) {
return;
}
if (insertTarget && placeholder === insertTarget) {
return;
}
if (sortable !== previous) {
previous.remove(placeholder);
data.moved = target;
} else {
delete data.moved;
}
sortable.insert(placeholder, insertTarget);
this.touched.add(sortable);
},
events: ["move"]
},
methods: {
init(e) {
const { target, button, defaultPrevented } = e;
const [placeholder] = this.items.filter((el) => el.contains(target));
if (!placeholder || defaultPrevented || button > 0 || isInput(target) || target.closest(`.${this.clsNoDrag}`) || this.handle && !target.closest(this.handle)) {
return;
}
e.preventDefault();
this.pos = getEventPos(e);
this.touched = /* @__PURE__ */ new Set([this]);
this.placeholder = placeholder;
this.origin = { target, index: index(placeholder), ...this.pos };
on(document, pointerMove$1, this.move);
on(document, pointerUp$1, this.end);
if (!this.threshold) {
this.start(e);
}
},
start(e) {
this.drag = appendDrag(this.$container, this.placeholder);
const { left, top } = dimensions$1(this.placeholder);
assign(this.origin, { offsetLeft: this.pos.x - left, offsetTop: this.pos.y - top });
addClass(this.drag, this.clsDrag, this.clsCustom);
addClass(this.placeholder, this.clsPlaceholder);
addClass(this.items, this.clsItem);
addClass(document.documentElement, this.clsDragState);
trigger(this.$el, "start", [this, this.placeholder]);
trackScroll(this.pos);
this.move(e);
},
move: throttle(function(e) {
assign(this.pos, getEventPos(e));
if (!this.drag && (Math.abs(this.pos.x - this.origin.x) > this.threshold || Math.abs(this.pos.y - this.origin.y) > this.threshold)) {
this.start(e);
}
this.$emit("move");
}),
end() {
off(document, pointerMove$1, this.move);
off(document, pointerUp$1, this.end);
if (!this.drag) {
return;
}
untrackScroll();
const sortable = this.getSortable(this.placeholder);
if (this === sortable) {
if (this.origin.index !== index(this.placeholder)) {
trigger(this.$el, "moved", [this, this.placeholder]);
}
} else {
trigger(sortable.$el, "added", [sortable, this.placeholder]);
trigger(this.$el, "removed", [this, this.placeholder]);
}
trigger(this.$el, "stop", [this, this.placeholder]);
remove$1(this.drag);
this.drag = null;
for (const { clsPlaceholder, clsItem } of this.touched) {
for (const sortable2 of this.touched) {
removeClass(sortable2.items, clsPlaceholder, clsItem);
}
}
this.touched = null;
removeClass(document.documentElement, this.clsDragState);
},
insert(element, target) {
addClass(this.items, this.clsItem);
if (target && target.previousElementSibling !== element) {
this.animate(() => before(target, element));
} else if (!target && this.target.lastElementChild !== element) {
this.animate(() => append(this.target, element));
}
},
remove(element) {
if (this.target.contains(element)) {
this.animate(() => remove$1(element));
}
},
getSortable(element) {
do {
const sortable = this.$getComponent(element, "sortable");
if (sortable && (sortable === this || this.group !== false && sortable.group === this.group)) {
return sortable;
}
} while (element = parent(element));
}
}
};
let trackTimer;
function trackScroll(pos) {
let last = Date.now();
trackTimer = setInterval(() => {
let { x, y } = pos;
y += document.scrollingElement.scrollTop;
const dist = (Date.now() - last) * 0.3;
last = Date.now();
scrollParents(document.elementFromPoint(x, pos.y)).reverse().some((scrollEl) => {
let { scrollTop: scroll, scrollHeight } = scrollEl;
const { top, bottom, height: height2 } = offsetViewport(scrollEl);
if (top < y && top + 35 > y) {
scroll -= dist;
} else if (bottom > y && bottom - 35 < y) {
scroll += dist;
} else {
return;
}
if (scroll > 0 && scroll < scrollHeight - height2) {
scrollEl.scrollTop = scroll;
return true;
}
});
}, 15);
}
function untrackScroll() {
clearInterval(trackTimer);
}
function appendDrag(container, element) {
let clone;
if (isTag(element, "li", "tr")) {
clone = $("
");
append(clone, element.cloneNode(true).children);
for (const attribute of element.getAttributeNames()) {
attr(clone, attribute, element.getAttribute(attribute));
}
} else {
clone = element.cloneNode(true);
}
append(container, clone);
css(clone, "margin", "0", "important");
css(clone, {
boxSizing: "border-box",
width: element.offsetWidth,
height: element.offsetHeight,
padding: css(element, "padding")
});
height(clone.firstElementChild, height(element.firstElementChild));
return clone;
}
function findTarget(items, point) {
return items[findIndex(items, (item) => pointInRect(point, dimensions$1(item)))];
}
function findInsertTarget(list, target, placeholder, x, y, sameList) {
if (!children(list).length) {
return;
}
const rect = dimensions$1(target);
if (!sameList) {
if (!isHorizontal(list, placeholder)) {
return y < rect.top + rect.height / 2 ? target : target.nextElementSibling;
}
return target;
}
const placeholderRect = dimensions$1(placeholder);
const sameRow = linesIntersect(
[rect.top, rect.bottom],
[placeholderRect.top, placeholderRect.bottom]
);
const [pointerPos, lengthProp, startProp, endProp] = sameRow ? [x, "width", "left", "right"] : [y, "height", "top", "bottom"];
const diff = placeholderRect[lengthProp] < rect[lengthProp] ? rect[lengthProp] - placeholderRect[lengthProp] : 0;
if (placeholderRect[startProp] < rect[startProp]) {
if (diff && pointerPos < rect[startProp] + diff) {
return false;
}
return target.nextElementSibling;
}
if (diff && pointerPos > rect[endProp] - diff) {
return false;
}
return target;
}
function isHorizontal(list, placeholder) {
const single = children(list).length === 1;
if (single) {
append(list, placeholder);
}
const items = children(list);
const isHorizontal2 = items.some((el, i) => {
const rectA = dimensions$1(el);
return items.slice(i + 1).some((el2) => {
const rectB = dimensions$1(el2);
return !linesIntersect([rectA.left, rectA.right], [rectB.left, rectB.right]);
});
});
if (single) {
remove$1(placeholder);
}
return isHorizontal2;
}
function linesIntersect(lineA, lineB) {
return lineA[1] > lineB[0] && lineB[1] > lineA[0];
}
function throttle(fn) {
let throttled;
return function(...args) {
if (!throttled) {
throttled = true;
fn.call(this, ...args);
requestAnimationFrame(() => throttled = false);
}
};
}
var tooltip = {
mixins: [Container, Togglable, Position],
data: {
pos: "top",
animation: ["uk-animation-scale-up"],
duration: 100,
cls: "uk-active"
},
connected() {
makeFocusable(this.$el);
},
disconnected() {
this.hide();
},
methods: {
show() {
if (this.isToggled(this.tooltip || null)) {
return;
}
const { delay = 0, title } = parseProps(this.$options);
if (!title) {
return;
}
const titleAttr = attr(this.$el, "title");
const off = on(this.$el, ["blur", pointerLeave], (e) => !isTouch(e) && this.hide());
this.reset = () => {
attr(this.$el, { title: titleAttr, "aria-describedby": null });
off();
};
const id = generateId(this);
attr(this.$el, { title: null, "aria-describedby": id });
clearTimeout(this.showTimer);
this.showTimer = setTimeout(() => this._show(title, id), delay);
},
async hide() {
var _a;
if (matches(this.$el, "input:focus")) {
return;
}
clearTimeout(this.showTimer);
if (this.isToggled(this.tooltip || null)) {
await this.toggleElement(this.tooltip, false, false);
}
(_a = this.reset) == null ? void 0 : _a.call(this);
remove$1(this.tooltip);
this.tooltip = null;
},
async _show(title, id) {
this.tooltip = append(
this.container,
`
`
);
on(this.tooltip, "toggled", (e, toggled) => {
if (!toggled) {
return;
}
const update = () => this.positionAt(this.tooltip, this.$el);
update();
const [dir, align] = getAlignment(this.tooltip, this.$el, this.pos);
this.origin = this.axis === "y" ? `${flipPosition(dir)}-${align}` : `${align}-${flipPosition(dir)}`;
const handlers = [
once(
document,
`keydown ${pointerDown$1}`,
this.hide,
false,
(e2) => e2.type === pointerDown$1 && !this.$el.contains(e2.target) || e2.type === "keydown" && e2.keyCode === keyMap.ESC
),
on([document, ...overflowParents(this.$el)], "scroll", update, {
passive: true
})
];
once(this.tooltip, "hide", () => handlers.forEach((handler) => handler()), {
self: true
});
});
if (!await this.toggleElement(this.tooltip, true)) {
this.hide();
}
}
},
events: {
// Clicking a button does not give it focus on all browsers and platforms
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#clicking_and_focus
[`focus ${pointerEnter} ${pointerDown$1}`](e) {
if ((!isTouch(e) || e.type === pointerDown$1) && document.readyState !== "loading") {
this.show();
}
}
}
};
function makeFocusable(el) {
if (!isFocusable(el)) {
el.tabIndex = 0;
}
}
function getAlignment(el, target, [dir, align]) {
const elOffset = offset(el);
const targetOffset = offset(target);
const properties = [
["left", "right"],
["top", "bottom"]
];
for (const props2 of properties) {
if (elOffset[props2[0]] >= targetOffset[props2[1]]) {
dir = props2[1];
break;
}
if (elOffset[props2[1]] <= targetOffset[props2[0]]) {
dir = props2[0];
break;
}
}
const props = includes(properties[0], dir) ? properties[1] : properties[0];
align = props.find((prop) => elOffset[prop] === targetOffset[prop]) || "center";
return [dir, align];
}
function parseProps(options) {
const { el, id, data: data$1 } = options;
return ["delay", "title"].reduce((obj, key) => ({ [key]: data(el, key), ...obj }), {
...parseOptions(data(el, id), ["title"]),
...data$1
});
}
var upload = {
mixins: [I18n],
i18n: {
invalidMime: "Invalid File Type: %s",
invalidName: "Invalid File Name: %s",
invalidSize: "Invalid File Size: %s Kilobytes Max"
},
props: {
allow: String,
clsDragover: String,
concurrent: Number,
maxSize: Number,
method: String,
mime: String,
multiple: Boolean,
name: String,
params: Object,
type: String,
url: String
},
data: {
allow: false,
clsDragover: "uk-dragover",
concurrent: 1,
maxSize: 0,
method: "POST",
mime: false,
multiple: false,
name: "files[]",
params: {},
type: "",
url: "",
abort: noop,
beforeAll: noop,
beforeSend: noop,
complete: noop,
completeAll: noop,
error: noop,
fail: noop,
load: noop,
loadEnd: noop,
loadStart: noop,
progress: noop
},
events: {
change(e) {
if (!matches(e.target, 'input[type="file"]')) {
return;
}
e.preventDefault();
if (e.target.files) {
this.upload(e.target.files);
}
e.target.value = "";
},
drop(e) {
stop(e);
const transfer = e.dataTransfer;
if (!(transfer == null ? void 0 : transfer.files)) {
return;
}
removeClass(this.$el, this.clsDragover);
this.upload(transfer.files);
},
dragenter(e) {
stop(e);
},
dragover(e) {
stop(e);
addClass(this.$el, this.clsDragover);
},
dragleave(e) {
stop(e);
removeClass(this.$el, this.clsDragover);
}
},
methods: {
async upload(files) {
files = toArray(files);
if (!files.length) {
return;
}
trigger(this.$el, "upload", [files]);
for (const file of files) {
if (this.maxSize && this.maxSize * 1e3 < file.size) {
this.fail(this.t("invalidSize", this.maxSize));
return;
}
if (this.allow && !match$1(this.allow, file.name)) {
this.fail(this.t("invalidName", this.allow));
return;
}
if (this.mime && !match$1(this.mime, file.type)) {
this.fail(this.t("invalidMime", this.mime));
return;
}
}
if (!this.multiple) {
files = files.slice(0, 1);
}
this.beforeAll(this, files);
const chunks = chunk(files, this.concurrent);
const upload = async (files2) => {
const data = new FormData();
files2.forEach((file) => data.append(this.name, file));
for (const key in this.params) {
data.append(key, this.params[key]);
}
try {
const xhr = await ajax(this.url, {
data,
method: this.method,
responseType: this.type,
beforeSend: (env) => {
const { xhr: xhr2 } = env;
on(xhr2.upload, "progress", this.progress);
for (const type of ["loadStart", "load", "loadEnd", "abort"]) {
on(xhr2, type.toLowerCase(), this[type]);
}
return this.beforeSend(env);
}
});
this.complete(xhr);
if (chunks.length) {
await upload(chunks.shift());
} else {
this.completeAll(xhr);
}
} catch (e) {
this.error(e);
}
};
await upload(chunks.shift());
}
}
};
function match$1(pattern, path) {
return path.match(
new RegExp(
`^${pattern.replace(/\//g, "\\/").replace(/\*\*/g, "(\\/[^\\/]+)*").replace(/\*/g, "[^\\/]+").replace(/((?!\\))\?/g, "$1.")}$`,
"i"
)
);
}
function chunk(files, size) {
const chunks = [];
for (let i = 0; i < files.length; i += size) {
chunks.push(files.slice(i, i + size));
}
return chunks;
}
function stop(e) {
e.preventDefault();
e.stopPropagation();
}
async function ajax(url, options) {
const env = {
data: null,
method: "GET",
headers: {},
xhr: new XMLHttpRequest(),
beforeSend: noop,
responseType: "",
...options
};
await env.beforeSend(env);
return send(url, env);
}
function send(url, env) {
return new Promise((resolve, reject) => {
const { xhr } = env;
for (const prop in env) {
if (prop in xhr) {
try {
xhr[prop] = env[prop];
} catch {
}
}
}
xhr.open(env.method.toUpperCase(), url);
for (const header in env.headers) {
xhr.setRequestHeader(header, env.headers[header]);
}
on(xhr, "load", () => {
if (xhr.status === 0 || xhr.status >= 200 && xhr.status < 300 || xhr.status === 304) {
resolve(xhr);
} else {
reject(
assign(Error(xhr.statusText), {
xhr,
status: xhr.status
})
);
}
});
on(xhr, "error", () => reject(assign(Error("Network Error"), { xhr })));
on(xhr, "timeout", () => reject(assign(Error("Network Timeout"), { xhr })));
xhr.send(env.data);
});
}
var components$1 = /*#__PURE__*/Object.freeze({
__proto__: null,
Countdown: countdown,
Filter: filter,
Lightbox: lightbox,
LightboxPanel: LightboxPanel,
Notification: notification,
Parallax: parallax,
Slider: slider,
SliderParallax: sliderParallax,
Slideshow: slideshow,
SlideshowParallax: sliderParallax,
Sortable: sortable,
Tooltip: tooltip,
Upload: upload
});
function boot(App) {
if (inBrowser && window.MutationObserver) {
if (document.body) {
requestAnimationFrame(() => init(App));
} else {
new MutationObserver((records, observer) => {
if (document.body) {
init(App);
observer.disconnect();
}
}).observe(document.documentElement, { childList: true });
}
}
}
function init(App) {
trigger(document, "uikit:init", App);
if (document.body) {
apply(document.body, connect);
}
new MutationObserver(handleMutation).observe(document, {
subtree: true,
childList: true,
attributes: true
});
App._initialized = true;
}
function handleMutation(records) {
var _a;
for (const { addedNodes, removedNodes, target, attributeName } of records) {
for (const node of addedNodes) {
apply(node, connect);
}
for (const node of removedNodes) {
apply(node, disconnect);
}
const name = attributeName && getComponentName(attributeName);
if (name) {
if (hasAttr(target, attributeName)) {
createComponent(name, target);
} else {
(_a = getComponent(target, name)) == null ? void 0 : _a.$destroy();
}
}
}
}
function connect(node) {
const components2 = getComponents(node);
for (const name in components2) {
callConnected(components2[name]);
}
for (const attributeName of node.getAttributeNames()) {
const name = getComponentName(attributeName);
name && createComponent(name, node);
}
}
function disconnect(node) {
const components2 = getComponents(node);
for (const name in components2) {
callDisconnected(components2[name]);
}
}
function getComponentName(attribute) {
if (startsWith(attribute, "data-")) {
attribute = attribute.slice(5);
}
const cmp = components$2[attribute];
return cmp && (cmp.options || cmp).name;
}
globalApi(App);
instanceApi(App);
var Accordion = {
mixins: [Class, Togglable],
props: {
animation: Boolean,
targets: String,
active: null,
collapsible: Boolean,
multiple: Boolean,
toggle: String,
content: String,
offset: Number
},
data: {
targets: "> *",
active: false,
animation: true,
collapsible: true,
multiple: false,
clsOpen: "uk-open",
toggle: "> .uk-accordion-title",
content: "> .uk-accordion-content",
offset: 0
},
computed: {
items: ({ targets }, $el) => $$(targets, $el),
toggles({ toggle }) {
return this.items.map((item) => $(toggle, item));
},
contents({ content }) {
return this.items.map((item) => {
var _a;
return ((_a = item._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, item);
});
}
},
watch: {
items(items, prev) {
if (prev || hasClass(items, this.clsOpen)) {
return;
}
const active = this.active !== false && items[Number(this.active)] || !this.collapsible && items[0];
if (active) {
this.toggle(active, false);
}
},
toggles() {
this.$emit();
},
contents(items) {
for (const el of items) {
const isOpen = hasClass(
this.items.find((item) => item.contains(el)),
this.clsOpen
);
hide(el, !isOpen);
}
this.$emit();
}
},
observe: lazyload(),
events: [
{
name: "click keydown",
delegate: ({ targets, $props }) => `${targets} ${$props.toggle}`,
async handler(e) {
var _a;
if (e.type === "keydown" && e.keyCode !== keyMap.SPACE) {
return;
}
maybeDefaultPreventClick(e);
(_a = this._off) == null ? void 0 : _a.call(this);
this._off = keepScrollPosition(e.target);
await this.toggle(index(this.toggles, e.current));
this._off();
}
},
{
name: "shown hidden",
self: true,
delegate: ({ targets }) => targets,
handler() {
this.$emit();
}
}
],
update() {
const activeItems = filter$1(this.items, `.${this.clsOpen}`);
for (const index2 in this.items) {
const toggle = this.toggles[index2];
const content = this.contents[index2];
if (!toggle || !content) {
continue;
}
toggle.id = generateId(this, toggle);
content.id = generateId(this, content);
const active = includes(activeItems, this.items[index2]);
attr(toggle, {
role: isTag(toggle, "a") ? "button" : null,
"aria-controls": content.id,
"aria-expanded": active,
"aria-disabled": !this.collapsible && activeItems.length < 2 && active
});
attr(content, { role: "region", "aria-labelledby": toggle.id });
if (isTag(content, "ul")) {
attr(children(content), "role", "presentation");
}
}
},
methods: {
toggle(item, animate) {
item = this.items[getIndex(item, this.items)];
let items = [item];
const activeItems = filter$1(this.items, `.${this.clsOpen}`);
if (!this.multiple && !includes(activeItems, items[0])) {
items = items.concat(activeItems);
}
if (!this.collapsible && activeItems.length < 2 && includes(activeItems, item)) {
return;
}
return Promise.all(
items.map(
(el) => this.toggleElement(el, !includes(activeItems, el), (el2, show) => {
toggleClass(el2, this.clsOpen, show);
if (animate === false || !this.animation) {
hide($(this.content, el2), !show);
return;
}
return transition(el2, show, this);
})
)
);
}
}
};
function hide(el, hide2) {
el && (el.hidden = hide2);
}
async function transition(el, show, { content, duration, velocity, transition: transition2 }) {
var _a;
content = ((_a = el._wrapper) == null ? void 0 : _a.firstElementChild) || $(content, el);
if (!el._wrapper) {
el._wrapper = wrapAll(content, "
");
}
const wrapper = el._wrapper;
css(wrapper, "overflow", "hidden");
const currentHeight = toFloat(css(wrapper, "height"));
await Transition.cancel(wrapper);
hide(content, false);
const endHeight = sumBy(["marginTop", "marginBottom"], (prop) => css(content, prop)) + dimensions$1(content).height;
const percent = currentHeight / endHeight;
duration = (velocity * endHeight + duration) * (show ? 1 - percent : percent);
css(wrapper, "height", currentHeight);
await Transition.start(wrapper, { height: show ? endHeight : 0 }, duration, transition2);
unwrap(content);
delete el._wrapper;
if (!show) {
hide(content, true);
}
}
function keepScrollPosition(el) {
const scrollElement = scrollParent(el, true);
let frame;
(function scroll() {
frame = requestAnimationFrame(() => {
const { top } = dimensions$1(el);
if (top < 0) {
scrollElement.scrollTop += top;
}
scroll();
});
})();
return () => requestAnimationFrame(() => cancelAnimationFrame(frame));
}
var alert = {
mixins: [Class, Togglable],
args: "animation",
props: {
animation: Boolean,
close: String
},
data: {
animation: true,
selClose: ".uk-alert-close",
duration: 150
},
events: {
name: "click",
delegate: ({ selClose }) => selClose,
handler(e) {
maybeDefaultPreventClick(e);
this.close();
}
},
methods: {
async close() {
await this.toggleElement(this.$el, false, animate);
this.$destroy(true);
}
}
};
function animate(el, show, { duration, transition, velocity }) {
const height = toFloat(css(el, "height"));
css(el, "height", height);
return Transition.start(
el,
{
height: 0,
marginTop: 0,
marginBottom: 0,
paddingTop: 0,
paddingBottom: 0,
borderTop: 0,
borderBottom: 0,
opacity: 0
},
velocity * height + duration,
transition
);
}
var Video = {
args: "autoplay",
props: {
automute: Boolean,
autoplay: Boolean,
restart: Boolean,
hoverTarget: Boolean
},
data: {
automute: false,
autoplay: true,
restart: false,
hoverTarget: false
},
beforeConnect() {
const isVideo = isTag(this.$el, "video");
if (this.autoplay === "inview" && isVideo && !hasAttr(this.$el, "preload")) {
this.$el.preload = "none";
}
if (!isVideo && !hasAttr(this.$el, "allow")) {
this.$el.allow = "autoplay";
}
if (this.autoplay === "hover") {
if (isVideo) {
this.$el.tabIndex = 0;
} else {
this.autoplay = true;
}
}
if (this.automute || hasAttr(this.$el, "muted")) {
mute(this.$el);
}
},
events: [
{
name: `${pointerEnter} focusin`,
el: ({ hoverTarget, $el }) => query(hoverTarget, $el) || $el,
filter: ({ autoplay }) => includes(autoplay, "hover"),
handler(e) {
if (!isTouch(e) || !isPlaying(this.$el)) {
play(this.$el);
} else {
pauseHover(this.$el, this.restart);
}
}
},
{
name: `${pointerLeave} focusout`,
el: ({ hoverTarget, $el }) => query(hoverTarget, $el) || $el,
filter: ({ autoplay }) => includes(autoplay, "hover"),
handler(e) {
if (!isTouch(e)) {
pauseHover(this.$el, this.restart);
}
}
}
],
observe: [
intersection({
filter: ({ $el }) => $el.preload === "none",
handler([{ target }]) {
target.preload = "";
this.$reset();
}
}),
intersection({
filter: ({ $el, autoplay }) => autoplay !== "hover" && $el.preload !== "none",
handler([{ isIntersecting, target }]) {
if (!document.fullscreenElement) {
if (isIntersecting) {
if (this.autoplay) {
play(target);
}
} else {
pauseHover(target, this.restart);
}
}
},
args: { intersecting: false },
options: ({ $el, autoplay }) => ({
root: autoplay === "inview" ? null : parent($el).closest(":not(a)")
})
})
]
};
function isPlaying(videoEl) {
return !videoEl.paused && !videoEl.ended;
}
function pauseHover(el, restart) {
pause(el);
if (restart && isTag(el, "video")) {
el.currentTime = 0;
}
}
var cover = {
mixins: [Video],
props: {
width: Number,
height: Number
},
data: {
automute: true
},
created() {
this.useObjectFit = isTag(this.$el, "img", "video");
},
observe: resize({
target: ({ $el }) => getPositionedParent($el) || parent($el),
filter: ({ useObjectFit }) => !useObjectFit
}),
update: {
read() {
if (this.useObjectFit) {
return false;
}
const { $el, width = $el.clientWidth, height = $el.clientHeight } = this;
const el = getPositionedParent($el) || parent($el);
const dim = Dimensions.cover(
{ width, height },
{ width: el.offsetWidth, height: el.offsetHeight }
);
return dim.width && dim.height ? dim : false;
},
write({ height, width }) {
css(this.$el, { height, width });
},
events: ["resize"]
}
};
function getPositionedParent(el) {
while (el = parent(el)) {
if (css(el, "position") !== "static") {
return el;
}
}
}
let active;
var drop = {
mixins: [Class, Container, Position, Togglable],
args: "pos",
props: {
mode: "list",
toggle: Boolean,
boundary: Boolean,
boundaryX: Boolean,
boundaryY: Boolean,
target: Boolean,
targetX: Boolean,
targetY: Boolean,
stretch: Boolean,
delayShow: Number,
delayHide: Number,
autoUpdate: Boolean,
animateOut: Boolean,
bgScroll: Boolean,
closeOnScroll: Boolean
},
data: {
mode: ["click", "hover"],
toggle: "- *",
boundary: false,
boundaryX: false,
boundaryY: false,
target: false,
targetX: false,
targetY: false,
stretch: false,
delayShow: 0,
delayHide: 800,
autoUpdate: true,
animateOut: false,
bgScroll: true,
animation: ["uk-animation-fade"],
cls: "uk-open",
container: false,
closeOnScroll: false,
selClose: ".uk-drop-close"
},
computed: {
boundary({ boundary, boundaryX, boundaryY }, $el) {
return [
query(boundaryX || boundary, $el) || window,
query(boundaryY || boundary, $el) || window
];
},
target({ target, targetX, targetY }, $el) {
targetX || (targetX = target || this.targetEl);
targetY || (targetY = target || this.targetEl);
return [
targetX === true ? window : query(targetX, $el),
targetY === true ? window : query(targetY, $el)
];
}
},
created() {
this.tracker = new MouseTracker();
},
connected() {
addClass(this.$el, "uk-drop");
if (this.toggle && !this.targetEl) {
this.targetEl = createToggleComponent(this);
}
attr(this.targetEl, "aria-expanded", false);
this._style = pick(this.$el.style, ["width", "height"]);
},
disconnected() {
if (this.isActive()) {
this.hide(false);
active = null;
}
css(this.$el, this._style);
},
events: [
{
name: "click",
delegate: ({ selClose }) => selClose,
handler(e) {
maybeDefaultPreventClick(e);
this.hide(false);
}
},
{
name: "click",
delegate: () => 'a[href*="#"]',
handler({ defaultPrevented, current }) {
const { hash } = current;
if (!defaultPrevented && hash && isSameSiteAnchor(current) && !this.$el.contains($(hash))) {
this.hide(false);
}
}
},
{
name: "beforescroll",
handler() {
this.hide(false);
}
},
{
name: "toggle",
self: true,
handler(e, toggle) {
e.preventDefault();
if (this.isToggled()) {
this.hide(false);
} else {
this.show(toggle == null ? void 0 : toggle.$el, false);
}
}
},
{
name: "toggleshow",
self: true,
handler(e, toggle) {
e.preventDefault();
this.show(toggle == null ? void 0 : toggle.$el);
}
},
{
name: "togglehide",
self: true,
handler(e) {
e.preventDefault();
if (!matches(this.$el, ":focus,:hover")) {
this.hide();
}
}
},
{
name: `${pointerEnter} focusin`,
filter: ({ mode }) => includes(mode, "hover"),
handler(e) {
if (!isTouch(e)) {
this.clearTimers();
}
}
},
{
name: `${pointerLeave} focusout`,
filter: ({ mode }) => includes(mode, "hover"),
handler(e) {
if (!isTouch(e) && e.relatedTarget) {
this.hide();
}
}
},
{
name: "toggled",
self: true,
handler(e, toggled) {
if (toggled) {
this.clearTimers();
this.position();
}
}
},
{
name: "show",
self: true,
handler() {
active = this;
this.tracker.init();
attr(this.targetEl, "aria-expanded", true);
const handlers = [
listenForResize(this),
listenForEscClose(this),
listenForBackgroundClose(this),
this.autoUpdate && listenForScroll(this),
this.closeOnScroll && listenForScrollClose(this)
];
once(this.$el, "hide", () => handlers.forEach((handler) => handler && handler()), {
self: true
});
if (!this.bgScroll) {
once(this.$el, "hidden", preventBackgroundScroll(this.$el), { self: true });
}
}
},
{
name: "beforehide",
self: true,
handler() {
this.clearTimers();
}
},
{
name: "hide",
handler({ target }) {
if (this.$el !== target) {
active = active === null && this.$el.contains(target) && this.isToggled() ? this : active;
return;
}
active = this.isActive() ? null : active;
this.tracker.cancel();
attr(this.targetEl, "aria-expanded", false);
}
}
],
update: {
write() {
if (this.isToggled() && !hasClass(this.$el, this.clsEnter)) {
this.position();
}
}
},
methods: {
show(target = this.targetEl, delay = true) {
if (this.isToggled() && target && this.targetEl && target !== this.targetEl) {
this.hide(false, false);
}
this.targetEl = target;
this.clearTimers();
if (this.isActive()) {
return;
}
if (active) {
if (delay && active.isDelaying()) {
this.showTimer = setTimeout(() => matches(target, ":hover") && this.show(), 10);
return;
}
let prev;
while (active && prev !== active && !active.$el.contains(this.$el)) {
prev = active;
active.hide(false, false);
}
delay = false;
}
if (this.container && parent(this.$el) !== this.container) {
append(this.container, this.$el);
}
this.showTimer = setTimeout(
() => this.toggleElement(this.$el, true),
delay && this.delayShow || 0
);
},
hide(delay = true, animate = true) {
const hide = () => this.toggleElement(this.$el, false, this.animateOut && animate);
this.clearTimers();
this.isDelayedHide = delay;
if (delay && this.isDelaying()) {
this.hideTimer = setTimeout(this.hide, 50);
} else if (delay && this.delayHide) {
this.hideTimer = setTimeout(hide, this.delayHide);
} else {
hide();
}
},
clearTimers() {
clearTimeout(this.showTimer);
clearTimeout(this.hideTimer);
this.showTimer = null;
this.hideTimer = null;
},
isActive() {
return active === this;
},
isDelaying() {
return [this.$el, ...$$(".uk-drop", this.$el)].some((el) => this.tracker.movesTo(el));
},
position() {
const restoreScrollPosition = storeScrollPosition(this.$el);
removeClass(this.$el, "uk-drop-stack");
css(this.$el, this._style);
this.$el.hidden = true;
const viewports = this.target.map((target) => getViewport$1(this.$el, target));
const viewportOffset = this.getViewportOffset(this.$el);
const dirs = [
[0, ["x", "width", "left", "right"]],
[1, ["y", "height", "top", "bottom"]]
];
for (const [i, [axis, prop]] of dirs) {
if (this.axis !== axis && includes([axis, true], this.stretch)) {
css(this.$el, {
[prop]: Math.min(
offset(this.boundary[i])[prop],
viewports[i][prop] - 2 * viewportOffset
),
[`overflow-${axis}`]: "auto"
});
}
}
const maxWidth = viewports[0].width - 2 * viewportOffset;
this.$el.hidden = false;
css(this.$el, "maxWidth", "");
if (this.$el.offsetWidth > maxWidth) {
addClass(this.$el, "uk-drop-stack");
}
css(this.$el, "maxWidth", maxWidth);
this.positionAt(this.$el, this.target, this.boundary);
for (const [i, [axis, prop, start, end]] of dirs) {
if (this.axis === axis && includes([axis, true], this.stretch)) {
const positionOffset = Math.abs(this.getPositionOffset());
const targetOffset = offset(this.target[i]);
const elOffset = offset(this.$el);
css(this.$el, {
[prop]: (targetOffset[start] > elOffset[start] ? targetOffset[this.inset ? end : start] - Math.max(
offset(this.boundary[i])[start],
viewports[i][start] + viewportOffset
) : Math.min(
offset(this.boundary[i])[end],
viewports[i][end] - viewportOffset
) - targetOffset[this.inset ? start : end]) - positionOffset,
[`overflow-${axis}`]: "auto"
});
this.positionAt(this.$el, this.target, this.boundary);
}
}
restoreScrollPosition();
}
}
};
function getViewport$1(el, target) {
return offsetViewport(overflowParents(target).find((parent2) => parent2.contains(el)));
}
function createToggleComponent(drop) {
const { $el } = drop.$create("toggle", query(drop.toggle, drop.$el), {
target: drop.$el,
mode: drop.mode
});
$el.ariaHasPopup = true;
return $el;
}
function listenForResize(drop) {
const update = () => drop.$emit();
const off = [
observeViewportResize(update),
observeResize(overflowParents(drop.$el).concat(drop.target), update)
];
return () => off.map((observer) => observer.disconnect());
}
function listenForScroll(drop, fn = () => drop.$emit()) {
return on([document, ...overflowParents(drop.$el)], "scroll", fn, {
passive: true
});
}
function listenForEscClose(drop) {
return on(document, "keydown", (e) => {
if (e.keyCode === keyMap.ESC) {
drop.hide(false);
}
});
}
function listenForScrollClose(drop) {
return listenForScroll(drop, () => drop.hide(false));
}
function listenForBackgroundClose(drop) {
return on(document, pointerDown$1, ({ target }) => {
if (drop.$el.contains(target)) {
return;
}
once(
document,
`${pointerUp$1} ${pointerCancel} scroll`,
({ defaultPrevented, type, target: newTarget }) => {
var _a;
if (!defaultPrevented && type === pointerUp$1 && target === newTarget && !((_a = drop.targetEl) == null ? void 0 : _a.contains(target))) {
drop.hide(false);
}
},
true
);
});
}
var Dropnav = {
mixins: [Class, Container],
props: {
align: String,
boundary: Boolean,
dropbar: Boolean,
dropbarAnchor: Boolean,
duration: Number,
mode: Boolean,
offset: Boolean,
stretch: Boolean,
delayShow: Boolean,
delayHide: Boolean,
target: Boolean,
targetX: Boolean,
targetY: Boolean,
animation: Boolean,
animateOut: Boolean,
closeOnScroll: Boolean
},
data: {
align: isRtl ? "right" : "left",
clsDrop: "uk-dropdown",
clsDropbar: "uk-dropnav-dropbar",
boundary: true,
dropbar: false,
dropbarAnchor: false,
flip: true,
delayShow: 160,
duration: 200,
container: false,
selNavItem: "> li > a, > ul > li > a"
},
computed: {
dropbarAnchor: ({ dropbarAnchor }, $el) => query(dropbarAnchor, $el) || $el,
dropbar({ dropbar }) {
if (!dropbar) {
return null;
}
dropbar = this._dropbar || query(dropbar, this.$el) || $(`+ .${this.clsDropbar}`, this.$el);
return dropbar ? dropbar : this._dropbar = $("
");
},
dropContainer(_, $el) {
return this.container || $el;
},
dropdowns({ clsDrop }, $el) {
var _a;
const dropdowns = $$(`.${clsDrop}`, $el);
if (this.dropContainer !== $el) {
for (const el of $$(`.${clsDrop}`, this.dropContainer)) {
const target = (_a = this.getDropdown(el)) == null ? void 0 : _a.targetEl;
if (!includes(dropdowns, el) && target && this.$el.contains(target)) {
dropdowns.push(el);
}
}
}
return dropdowns;
},
items({ selNavItem }, $el) {
return $$(selNavItem, $el);
}
},
watch: {
dropbar(dropbar) {
addClass(
dropbar,
"uk-dropbar",
"uk-dropbar-top",
this.clsDropbar,
`uk-${this.$options.name}-dropbar`
);
},
dropdowns() {
this.initializeDropdowns();
}
},
connected() {
this.initializeDropdowns();
preventInitialPointerEnter(this.$el);
},
disconnected() {
remove$1(this._dropbar);
delete this._dropbar;
},
events: [
{
name: "mouseover focusin",
delegate: ({ selNavItem }) => selNavItem,
handler({ current }) {
const active2 = this.getActive();
if (active2 && includes(active2.mode, "hover") && active2.targetEl && !current.contains(active2.targetEl) && !active2.isDelaying()) {
active2.hide(false);
}
}
},
{
name: "keydown",
self: true,
delegate: ({ selNavItem }) => selNavItem,
handler(e) {
var _a;
const { current, keyCode } = e;
const active2 = this.getActive();
if (keyCode === keyMap.DOWN) {
if ((active2 == null ? void 0 : active2.targetEl) === current) {
e.preventDefault();
(_a = $(selFocusable, active2.$el)) == null ? void 0 : _a.focus();
} else {
const dropdown = this.dropdowns.find(
(el) => {
var _a2;
return ((_a2 = this.getDropdown(el)) == null ? void 0 : _a2.targetEl) === current;
}
);
if (dropdown) {
e.preventDefault();
current.click();
once(dropdown, "show", (e2) => {
var _a2;
return (_a2 = $(selFocusable, e2.target)) == null ? void 0 : _a2.focus();
});
}
}
}
handleNavItemNavigation(e, this.items, active2);
}
},
{
name: "keydown",
el: ({ dropContainer }) => dropContainer,
delegate: ({ clsDrop }) => `.${clsDrop}`,
handler(e) {
var _a;
const { current, keyCode, target } = e;
if (isInput(target) || !includes(this.dropdowns, current)) {
return;
}
const active2 = this.getActive();
let next = -1;
if (keyCode === keyMap.HOME) {
next = 0;
} else if (keyCode === keyMap.END) {
next = "last";
} else if (keyCode === keyMap.UP) {
next = "previous";
} else if (keyCode === keyMap.DOWN) {
next = "next";
} else if (keyCode === keyMap.ESC) {
(_a = active2.targetEl) == null ? void 0 : _a.focus();
}
if (~next) {
e.preventDefault();
const elements = $$(selFocusable, current);
elements[getIndex(
next,
elements,
findIndex(elements, (el) => matches(el, ":focus"))
)].focus();
return;
}
handleNavItemNavigation(e, this.items, active2);
}
},
{
name: "mouseleave",
el: ({ dropbar }) => dropbar,
filter: ({ dropbar }) => dropbar,
handler() {
const active2 = this.getActive();
if (active2 && includes(active2.mode, "hover") && !this.dropdowns.some((el) => matches(el, ":hover"))) {
active2.hide();
}
}
},
{
name: "beforeshow",
el: ({ dropContainer }) => dropContainer,
filter: ({ dropbar }) => dropbar,
handler({ target }) {
if (!this.isDropbarDrop(target)) {
return;
}
if (this.dropbar.previousElementSibling !== this.dropbarAnchor) {
after(this.dropbarAnchor, this.dropbar);
}
addClass(target, `${this.clsDrop}-dropbar`);
}
},
{
name: "show",
el: ({ dropContainer }) => dropContainer,
filter: ({ dropbar }) => dropbar,
handler({ target }) {
if (!this.isDropbarDrop(target)) {
return;
}
const drop = this.getDropdown(target);
const adjustHeight = () => {
const maxBottom = Math.max(
...parents(target, `.${this.clsDrop}`).concat(target).map((el) => offset(el).bottom)
);
offset(this.dropbar, {
left: offset(this.dropbar).left,
top: this.getDropbarOffset(drop.getPositionOffset())
});
this.transitionTo(
maxBottom - offset(this.dropbar).top + toFloat(css(target, "marginBottom")),
target
);
};
this._observer = observeResize([drop.$el, ...drop.target], adjustHeight);
adjustHeight();
}
},
{
name: "beforehide",
el: ({ dropContainer }) => dropContainer,
filter: ({ dropbar }) => dropbar,
handler(e) {
const active2 = this.getActive();
if (matches(this.dropbar, ":hover") && active2.$el === e.target && this.isDropbarDrop(active2.$el) && includes(active2.mode, "hover") && active2.isDelayedHide && !this.items.some((el) => active2.targetEl !== el && matches(el, ":focus"))) {
e.preventDefault();
}
}
},
{
name: "hide",
el: ({ dropContainer }) => dropContainer,
filter: ({ dropbar }) => dropbar,
handler({ target }) {
var _a;
if (!this.isDropbarDrop(target)) {
return;
}
(_a = this._observer) == null ? void 0 : _a.disconnect();
const active2 = this.getActive();
if (!active2 || active2.$el === target) {
this.transitionTo(0);
}
}
}
],
methods: {
getActive() {
var _a;
return includes(this.dropdowns, (_a = active) == null ? void 0 : _a.$el) && active;
},
async transitionTo(newHeight, el) {
const { dropbar } = this;
const oldHeight = height(dropbar);
el = oldHeight < newHeight && el;
await Transition.cancel([el, dropbar]);
if (el) {
const diff = offset(el).top - offset(dropbar).top - oldHeight;
if (diff > 0) {
css(el, "transitionDelay", `${diff / newHeight * this.duration}ms`);
}
}
css(el, "clipPath", `polygon(0 0,100% 0,100% ${oldHeight}px,0 ${oldHeight}px)`);
height(dropbar, oldHeight);
await Promise.all([
Transition.start(dropbar, { height: newHeight }, this.duration),
Transition.start(
el,
{ clipPath: `polygon(0 0,100% 0,100% ${newHeight}px,0 ${newHeight}px)` },
this.duration
).finally(() => css(el, { clipPath: "", transitionDelay: "" }))
]).catch(noop);
},
getDropdown(el) {
return this.$getComponent(el, "drop") || this.$getComponent(el, "dropdown");
},
isDropbarDrop(el) {
return includes(this.dropdowns, el) && hasClass(el, this.clsDrop);
},
getDropbarOffset(offsetTop) {
const { $el, target, targetY } = this;
const { top, height: height2 } = offset(query(targetY || target || $el, $el));
return top + height2 + offsetTop;
},
initializeDropdowns() {
this.$create(
"drop",
this.dropdowns.filter((el) => !this.getDropdown(el)),
{
...this.$props,
flip: this.flip && !this.$props.dropbar,
shift: true,
pos: `bottom-${this.align}`,
boundaryX: this.boundary === true ? this.$el : this.boundary
}
);
}
}
};
function handleNavItemNavigation(e, toggles, active2) {
var _a, _b, _c;
const { current, keyCode } = e;
let next = -1;
if (keyCode === keyMap.HOME) {
next = 0;
} else if (keyCode === keyMap.END) {
next = "last";
} else if (keyCode === keyMap.LEFT) {
next = "previous";
} else if (keyCode === keyMap.RIGHT) {
next = "next";
} else if (keyCode === keyMap.TAB) {
(_a = active2.targetEl) == null ? void 0 : _a.focus();
(_b = active2.hide) == null ? void 0 : _b.call(active2, false);
}
if (~next) {
e.preventDefault();
(_c = active2.hide) == null ? void 0 : _c.call(active2, false);
toggles[getIndex(next, toggles, toggles.indexOf(active2.targetEl || current))].focus();
}
}
function preventInitialPointerEnter(el) {
const off = () => handlers.forEach((handler) => handler());
const handlers = [
once(el.ownerDocument, pointerMove$1, (e) => el.contains(e.target) || off()),
on(el, `mouseenter ${pointerEnter}`, (e) => e.stopPropagation(), { capture: true }),
on(el, `mouseleave ${pointerLeave}`, off, { capture: true })
];
}
var formCustom = {
mixins: [Class],
args: "target",
props: {
target: Boolean
},
data: {
target: false
},
computed: {
input: (_, $el) => $(selInput, $el),
state() {
return this.input.nextElementSibling;
},
target({ target }, $el) {
return target && (target === true && parent(this.input) === $el && this.input.nextElementSibling || $(target, $el));
}
},
update() {
var _a;
const { target, input } = this;
if (!target) {
return;
}
let option;
const prop = isInput(target) ? "value" : "textContent";
const prev = target[prop];
const value = ((_a = input.files) == null ? void 0 : _a[0]) ? input.files[0].name : matches(input, "select") && (option = $$("option", input).filter((el) => el.selected)[0]) ? option.textContent : input.value;
if (prev !== value) {
target[prop] = value;
}
},
events: [
{
name: "change",
handler() {
this.$emit();
}
},
{
name: "reset",
el: ({ $el }) => $el.closest("form"),
handler() {
this.$emit();
}
}
]
};
var grid = {
extends: Margin,
mixins: [Class],
name: "grid",
props: {
masonry: Boolean,
parallax: String,
parallaxStart: String,
parallaxEnd: String,
parallaxJustify: Boolean
},
data: {
margin: "uk-grid-margin",
clsStack: "uk-grid-stack",
masonry: false,
parallax: 0,
parallaxStart: 0,
parallaxEnd: 0,
parallaxJustify: false
},
connected() {
this.masonry && addClass(this.$el, "uk-flex-top", "uk-flex-wrap-top");
},
observe: scroll$1({ filter: ({ parallax, parallaxJustify }) => parallax || parallaxJustify }),
update: [
{
write({ rows }) {
toggleClass(this.$el, this.clsStack, !rows.some((row) => row.length > 1));
},
events: ["resize"]
},
{
read(data) {
const { rows } = data;
let { masonry, parallax, parallaxJustify, margin } = this;
parallax = Math.max(0, toPx(parallax));
if (!(masonry || parallax || parallaxJustify) || positionedAbsolute(rows) || rows[0].some(
(el, i) => rows.some((row) => row[i] && row[i].offsetWidth !== el.offsetWidth)
)) {
return data.translates = data.scrollColumns = false;
}
let gutter = getGutter(rows, margin);
let columns;
let translates;
if (masonry) {
[columns, translates] = applyMasonry(rows, gutter, masonry === "next");
} else {
columns = transpose(rows);
}
const columnHeights = columns.map(
(column) => sumBy(column, "offsetHeight") + gutter * (column.length - 1)
);
const height = Math.max(0, ...columnHeights);
let scrollColumns;
let parallaxStart;
let parallaxEnd;
if (parallax || parallaxJustify) {
scrollColumns = columnHeights.map(
(hgt, i) => parallaxJustify ? height - hgt + parallax : parallax / (i % 2 || 8)
);
if (!parallaxJustify) {
parallax = Math.max(
...columnHeights.map((hgt, i) => hgt + scrollColumns[i] - height)
);
}
parallaxStart = toPx(this.parallaxStart, "height", this.$el, true);
parallaxEnd = toPx(this.parallaxEnd, "height", this.$el, true);
}
return {
columns,
translates,
scrollColumns,
parallaxStart,
parallaxEnd,
padding: parallax,
height: translates ? height : ""
};
},
write({ height, padding }) {
css(this.$el, "paddingBottom", padding || "");
height !== false && css(this.$el, "height", height);
},
events: ["resize"]
},
{
read({ rows, scrollColumns, parallaxStart, parallaxEnd }) {
return {
scrolled: scrollColumns && !positionedAbsolute(rows) ? scrolledOver(this.$el, parallaxStart, parallaxEnd) : false
};
},
write({ columns, scrolled, scrollColumns, translates }) {
if (!scrolled && !translates) {
return;
}
columns.forEach(
(column, i) => column.forEach((el, j) => {
let [x, y] = translates && translates[i][j] || [0, 0];
if (scrolled) {
y += scrolled * scrollColumns[i];
}
css(el, "transform", `translate(${x}px, ${y}px)`);
})
);
},
events: ["scroll", "resize"]
}
]
};
function positionedAbsolute(rows) {
return rows.flat().some((el) => css(el, "position") === "absolute");
}
function applyMasonry(rows, gutter, next) {
const columns = [];
const translates = [];
const columnHeights = Array(rows[0].length).fill(0);
let rowHeights = 0;
for (let row of rows) {
if (isRtl) {
row.reverse();
}
let height = 0;
for (const j in row) {
const { offsetWidth, offsetHeight } = row[j];
const index = next ? j : columnHeights.indexOf(Math.min(...columnHeights));
push(columns, index, row[j]);
push(translates, index, [
(index - j) * offsetWidth * (isRtl ? -1 : 1),
columnHeights[index] - rowHeights
]);
columnHeights[index] += offsetHeight + gutter;
height = Math.max(height, offsetHeight);
}
rowHeights += height + gutter;
}
return [columns, translates];
}
function getGutter(rows, cls) {
const node = rows.flat().find((el) => hasClass(el, cls));
return toFloat(node ? css(node, "marginTop") : css(rows[0][0], "paddingLeft"));
}
function transpose(rows) {
const columns = [];
for (const row of rows) {
for (const i in row) {
push(columns, i, row[i]);
}
}
return columns;
}
function push(array, index, value) {
if (!array[index]) {
array[index] = [];
}
array[index].push(value);
}
var heightMatch = {
args: "target",
props: {
target: String,
row: Boolean
},
data: {
target: "> *",
row: true
},
computed: {
elements: ({ target }, $el) => $$(target, $el)
},
observe: resize({
target: ({ $el, elements }) => elements.reduce((elements2, el) => elements2.concat(el, ...el.children), [$el])
}),
events: {
// Hidden elements may change height when fonts load
name: "loadingdone",
el: () => document.fonts,
handler() {
this.$emit("resize");
}
},
update: {
read() {
return {
rows: (this.row ? getRows(this.elements) : [this.elements]).map(match)
};
},
write({ rows }) {
for (const { heights, elements } of rows) {
elements.forEach((el, i) => css(el, "minHeight", heights[i]));
}
},
events: ["resize"]
}
};
function match(elements) {
if (elements.length < 2) {
return { heights: [""], elements };
}
let heights = elements.map(getHeight);
const max = Math.max(...heights);
return {
heights: elements.map((el, i) => heights[i].toFixed(2) === max.toFixed(2) ? "" : max),
elements
};
}
function getHeight(element) {
const style = pick(element.style, ["display", "minHeight"]);
if (!isVisible(element)) {
css(element, "display", "block", "important");
}
css(element, "minHeight", "");
const height = dimensions$1(element).height - boxModelAdjust(element, "height", "content-box");
css(element, style);
return height;
}
var heightPlaceholder = {
args: "target",
props: {
target: String
},
data: {
target: ""
},
computed: {
target: {
get: ({ target }, $el) => query(target, $el),
observe: ({ target }) => target
}
},
observe: resize({ target: ({ target }) => target }),
update: {
read() {
return this.target ? { height: this.target.offsetHeight } : false;
},
write({ height }) {
css(this.$el, "minHeight", height);
},
events: ["resize"]
}
};
var heightViewport = {
props: {
expand: Boolean,
offsetTop: Boolean,
offsetBottom: Boolean,
min: Number,
property: String
},
data: {
expand: false,
offsetTop: false,
offsetBottom: false,
min: 0,
property: "min-height"
},
// check for offsetTop change
observe: [
viewport({ filter: ({ expand }) => expand }),
resize({ target: ({ $el }) => scrollParents($el) })
],
update: {
read() {
if (!isVisible(this.$el)) {
return false;
}
let minHeight = "";
const box = boxModelAdjust(this.$el, "height", "content-box");
const { body, scrollingElement } = document;
const scrollElement = scrollParent(this.$el);
const { height: viewportHeight } = offsetViewport(
scrollElement === body ? scrollingElement : scrollElement
);
const isScrollingElement = scrollingElement === scrollElement || body === scrollElement;
minHeight = `calc(${isScrollingElement ? "100vh" : `${viewportHeight}px`}`;
if (this.expand) {
const diff = dimensions$1(scrollElement).height - dimensions$1(this.$el).height;
minHeight += ` - ${diff}px`;
} else {
if (this.offsetTop) {
if (isScrollingElement) {
const offsetTopEl = this.offsetTop === true ? this.$el : query(this.offsetTop, this.$el);
const { top } = offset(offsetTopEl);
minHeight += top > 0 && top < viewportHeight / 2 ? ` - ${top}px` : "";
} else {
minHeight += ` - ${boxModelAdjust(scrollElement, "height", css(scrollElement, "boxSizing"))}px`;
}
}
if (this.offsetBottom === true) {
minHeight += ` - ${dimensions$1(this.$el.nextElementSibling).height}px`;
} else if (isNumeric(this.offsetBottom)) {
minHeight += ` - ${this.offsetBottom}vh`;
} else if (this.offsetBottom && endsWith(this.offsetBottom, "px")) {
minHeight += ` - ${toFloat(this.offsetBottom)}px`;
} else if (isString(this.offsetBottom)) {
minHeight += ` - ${dimensions$1(query(this.offsetBottom, this.$el)).height}px`;
}
}
minHeight += `${box ? ` - ${box}px` : ""})`;
return { minHeight };
},
write({ minHeight }) {
css(this.$el, this.property, `max(${this.min || 0}px, ${minHeight})`);
},
events: ["resize"]
}
};
var closeIcon = "
";
var closeLarge = "
";
var dropParentIcon = "
";
var marker = "
";
var navParentIconLarge = "
";
var navParentIcon = "
";
var navbarParentIcon = "
";
var navbarToggleIcon = "
";
var overlayIcon = "
";
var paginationNext = "
";
var paginationPrevious = "
";
var searchIcon = "
";
var searchLarge = "
";
var searchMedium = "
";
var slidenavNextLarge = "
";
var slidenavNext = "
";
var slidenavPreviousLarge = "
";
var slidenavPrevious = "
";
var spinner = "
";
var totop = "
";
var Svg = {
args: "src",
props: {
width: Number,
height: Number,
ratio: Number
},
data: {
ratio: 1
},
connected() {
this.svg = this.getSvg().then((el) => {
if (!this._connected) {
return;
}
const svg = insertSVG(el, this.$el);
if (this.svgEl && svg !== this.svgEl) {
remove$1(this.svgEl);
}
applyWidthAndHeight.call(this, svg, el);
return this.svgEl = svg;
}, noop);
},
disconnected() {
this.svg.then((svg) => {
if (this._connected) {
return;
}
if (isVoidElement(this.$el)) {
this.$el.hidden = false;
}
remove$1(svg);
this.svgEl = null;
});
this.svg = null;
},
methods: {
async getSvg() {
}
}
};
function insertSVG(el, root) {
if (isVoidElement(root) || isTag(root, "canvas")) {
root.hidden = true;
const next = root.nextElementSibling;
return equals(el, next) ? next : after(root, el);
}
const last = root.lastElementChild;
return equals(el, last) ? last : append(root, el);
}
function equals(el, other) {
return isTag(el, "svg") && isTag(other, "svg") && el.innerHTML === other.innerHTML;
}
function applyWidthAndHeight(el, ref) {
const props = ["width", "height"];
let dimensions = props.map((prop) => this[prop]);
if (!dimensions.some((val) => val)) {
dimensions = props.map((prop) => attr(ref, prop));
}
const viewBox = attr(ref, "viewBox");
if (viewBox && !dimensions.some((val) => val)) {
dimensions = viewBox.split(" ").slice(2);
}
dimensions.forEach((val, i) => attr(el, props[i], toFloat(val) * this.ratio || null));
}
function parseSVG(svg, icon) {
if (icon && includes(svg, "
/g;
const parseSymbols = memoize(function(svg) {
const symbols = {};
let match;
while (match = symbolRe.exec(svg)) {
symbols[match[3]] = `