that contains calendar
+ calendarLinkName: 'calendarlink', // name of the link that is used to toggle
+ clockDivName: 'clockbox', // name of clock
that gets toggled
+ clockLinkName: 'clocklink', // name of the link that is used to toggle
+ shortCutsClass: 'datetimeshortcuts', // class of the clock and cal shortcuts
+ timezoneWarningClass: 'timezonewarning', // class of the warning for timezone mismatch
+ timezoneOffset: 0,
+ init: function() {
+ const serverOffset = document.body.dataset.adminUtcOffset;
+ if (serverOffset) {
+ const localOffset = new Date().getTimezoneOffset() * -60;
+ DateTimeShortcuts.timezoneOffset = localOffset - serverOffset;
+ }
+
+ for (const inp of document.getElementsByTagName('input')) {
+ if (inp.type === 'text' && inp.classList.contains('vCustomTimeField')) {
+ DateTimeShortcuts.addClock(inp);
+ DateTimeShortcuts.addTimezoneWarning(inp);
+ }
+ else if (inp.type === 'text' && inp.classList.contains('vCustomDateField')) {
+ DateTimeShortcuts.addCalendar(inp);
+ DateTimeShortcuts.addTimezoneWarning(inp);
+ }
+ }
+ },
+ // Return the current time while accounting for the server timezone.
+ now: function() {
+ const serverOffset = document.body.dataset.adminUtcOffset;
+ if (serverOffset) {
+ const localNow = new Date();
+ const localOffset = localNow.getTimezoneOffset() * -60;
+ localNow.setTime(localNow.getTime() + 1000 * (serverOffset - localOffset));
+ return localNow;
+ } else {
+ return new Date();
+ }
+ },
+ // Add a warning when the time zone in the browser and backend do not match.
+ addTimezoneWarning: function(inp) {
+ const warningClass = DateTimeShortcuts.timezoneWarningClass;
+ let timezoneOffset = DateTimeShortcuts.timezoneOffset / 3600;
+
+ // Only warn if there is a time zone mismatch.
+ if (!timezoneOffset) {
+ return;
+ }
+
+ // Check if warning is already there.
+ if (inp.parentNode.querySelectorAll('.' + warningClass).length) {
+ return;
+ }
+
+ let message;
+ if (timezoneOffset > 0) {
+ message = ngettext(
+ 'Note: You are %s hour ahead of server time.',
+ 'Note: You are %s hours ahead of server time.',
+ timezoneOffset
+ );
+ }
+ else {
+ timezoneOffset *= -1;
+ message = ngettext(
+ 'Note: You are %s hour behind server time.',
+ 'Note: You are %s hours behind server time.',
+ timezoneOffset
+ );
+ }
+ message = interpolate(message, [timezoneOffset]);
+
+ const warning = document.createElement('div');
+ warning.classList.add('help', warningClass);
+ warning.textContent = message;
+ inp.parentNode.appendChild(warning);
+ },
+ // Add clock widget to a given field
+ addClock: function(inp) {
+ const num = DateTimeShortcuts.clockInputs.length;
+ DateTimeShortcuts.clockInputs[num] = inp;
+ DateTimeShortcuts.dismissClockFunc[num] = function() { DateTimeShortcuts.dismissClock(num); return true; };
+
+ // Shortcut links (clock icon and "Now" link)
+ const shortcuts_span = document.createElement('span');
+ shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
+ inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
+ const now_link = document.createElement('a');
+ now_link.href = "#";
+ now_link.textContent = gettext('Now');
+ now_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.handleClockQuicklink(num, -1);
+ });
+ const clock_link = document.createElement('a');
+ clock_link.href = '#';
+ clock_link.id = DateTimeShortcuts.clockLinkName + num;
+ clock_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ // avoid triggering the document click handler to dismiss the clock
+ e.stopPropagation();
+ DateTimeShortcuts.openClock(num);
+ });
+
+ quickElement(
+ 'span', clock_link, '',
+ 'class', 'clock-icon',
+ 'title', gettext('Choose a Time')
+ );
+ shortcuts_span.appendChild(document.createTextNode('\u00A0'));
+ shortcuts_span.appendChild(now_link);
+ shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0'));
+ shortcuts_span.appendChild(clock_link);
+
+ // Create clock link div
+ //
+ // Markup looks like:
+ //
+ //
Choose a time
+ //
+ //
Cancel
+ //
+
+ const clock_box = document.createElement('div');
+ clock_box.style.display = 'none';
+ clock_box.style.position = 'absolute';
+ clock_box.className = 'clockbox module';
+ clock_box.id = DateTimeShortcuts.clockDivName + num;
+ document.body.appendChild(clock_box);
+ clock_box.addEventListener('click', function(e) { e.stopPropagation(); });
+
+ quickElement('h2', clock_box, gettext('Choose a time'));
+ const time_list = quickElement('ul', clock_box);
+ time_list.className = 'timelist';
+ // The list of choices can be overridden in JavaScript like this:
+ // DateTimeShortcuts.clockHours.name = [['3 a.m.', 3]];
+ // where name is the name attribute of the
.
+ const name = typeof DateTimeShortcuts.clockHours[inp.name] === 'undefined' ? 'default_' : inp.name;
+ DateTimeShortcuts.clockHours[name].forEach(function(element) {
+ const time_link = quickElement('a', quickElement('li', time_list), gettext(element[0]), 'href', '#');
+ time_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.handleClockQuicklink(num, element[1]);
+ });
+ });
+
+ const cancel_p = quickElement('p', clock_box);
+ cancel_p.className = 'calendar-cancel';
+ const cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#');
+ cancel_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.dismissClock(num);
+ });
+
+ document.addEventListener('keyup', function(event) {
+ if (event.which === 27) {
+ // ESC key closes popup
+ DateTimeShortcuts.dismissClock(num);
+ event.preventDefault();
+ }
+ });
+ },
+ openClock: function(num) {
+ const clock_box = document.getElementById(DateTimeShortcuts.clockDivName + num);
+ const clock_link = document.getElementById(DateTimeShortcuts.clockLinkName + num);
+
+ // Recalculate the clockbox position
+ // is it left-to-right or right-to-left layout ?
+ if (window.getComputedStyle(document.body).direction !== 'rtl') {
+ clock_box.style.left = findPosX(clock_link) + 17 + 'px';
+ }
+ else {
+ // since style's width is in em, it'd be tough to calculate
+ // px value of it. let's use an estimated px for now
+ clock_box.style.left = findPosX(clock_link) - 110 + 'px';
+ }
+ clock_box.style.top = Math.max(0, findPosY(clock_link) - 30) + 'px';
+
+ // Show the clock box
+ clock_box.style.display = 'block';
+ document.addEventListener('click', DateTimeShortcuts.dismissClockFunc[num]);
+ },
+ dismissClock: function(num) {
+ document.getElementById(DateTimeShortcuts.clockDivName + num).style.display = 'none';
+ document.removeEventListener('click', DateTimeShortcuts.dismissClockFunc[num]);
+ },
+ handleClockQuicklink: function(num, val) {
+ let d;
+ if (val === -1) {
+ d = DateTimeShortcuts.now();
+ }
+ else {
+ d = new Date(1970, 1, 1, val, 0, 0, 0);
+ }
+ DateTimeShortcuts.clockInputs[num].value = d.strftime(get_format('TIME_INPUT_FORMATS')[0]);
+ DateTimeShortcuts.clockInputs[num].focus();
+ DateTimeShortcuts.dismissClock(num);
+ },
+ // Add calendar widget to a given field.
+ addCalendar: function(inp) {
+ const num = DateTimeShortcuts.calendars.length;
+
+ DateTimeShortcuts.calendarInputs[num] = inp;
+ DateTimeShortcuts.dismissCalendarFunc[num] = function() { DateTimeShortcuts.dismissCalendar(num); return true; };
+
+ // Shortcut links (calendar icon and "Today" link)
+ const shortcuts_span = document.createElement('span');
+ shortcuts_span.className = DateTimeShortcuts.shortCutsClass;
+ inp.parentNode.insertBefore(shortcuts_span, inp.nextSibling);
+ const today_link = document.createElement('a');
+ today_link.href = '#';
+ today_link.appendChild(document.createTextNode(gettext('Today')));
+ today_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.handleCalendarQuickLink(num, 0);
+ });
+ const cal_link = document.createElement('a');
+ cal_link.href = '#';
+ cal_link.id = DateTimeShortcuts.calendarLinkName + num;
+ cal_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ // avoid triggering the document click handler to dismiss the calendar
+ e.stopPropagation();
+ DateTimeShortcuts.openCalendar(num);
+ });
+ quickElement(
+ 'span', cal_link, '',
+ 'class', 'date-icon',
+ 'title', gettext('Choose a Date')
+ );
+ shortcuts_span.appendChild(document.createTextNode('\u00A0'));
+ shortcuts_span.appendChild(today_link);
+ shortcuts_span.appendChild(document.createTextNode('\u00A0|\u00A0'));
+ shortcuts_span.appendChild(cal_link);
+
+ // Create calendarbox div.
+ //
+ // Markup looks like:
+ //
+ //
+ //
+ // ‹
+ // › February 2003
+ //
+ //
+ //
+ //
+ //
+ //
Cancel
+ //
+ const cal_box = document.createElement('div');
+ cal_box.style.display = 'none';
+ cal_box.style.position = 'absolute';
+ cal_box.className = 'calendarbox module';
+ cal_box.id = DateTimeShortcuts.calendarDivName1 + num;
+ document.body.appendChild(cal_box);
+ cal_box.addEventListener('click', function(e) { e.stopPropagation(); });
+
+ // next-prev links
+ const cal_nav = quickElement('div', cal_box);
+ const cal_nav_prev = quickElement('a', cal_nav, '<', 'href', '#');
+ cal_nav_prev.className = 'calendarnav-previous';
+ cal_nav_prev.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.drawPrev(num);
+ });
+
+ const cal_nav_next = quickElement('a', cal_nav, '>', 'href', '#');
+ cal_nav_next.className = 'calendarnav-next';
+ cal_nav_next.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.drawNext(num);
+ });
+
+ // main box
+ const cal_main = quickElement('div', cal_box, '', 'id', DateTimeShortcuts.calendarDivName2 + num);
+ cal_main.className = 'calendar';
+ DateTimeShortcuts.calendars[num] = new Calendar(DateTimeShortcuts.calendarDivName2 + num, DateTimeShortcuts.handleCalendarCallback(num));
+ DateTimeShortcuts.calendars[num].drawCurrent();
+
+ // calendar shortcuts
+ const shortcuts = quickElement('div', cal_box);
+ shortcuts.className = 'calendar-shortcuts';
+ let day_link = quickElement('a', shortcuts, gettext('Yesterday'), 'href', '#');
+ day_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.handleCalendarQuickLink(num, -1);
+ });
+ shortcuts.appendChild(document.createTextNode('\u00A0|\u00A0'));
+ day_link = quickElement('a', shortcuts, gettext('Today'), 'href', '#');
+ day_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.handleCalendarQuickLink(num, 0);
+ });
+ shortcuts.appendChild(document.createTextNode('\u00A0|\u00A0'));
+ day_link = quickElement('a', shortcuts, gettext('Tomorrow'), 'href', '#');
+ day_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.handleCalendarQuickLink(num, +1);
+ });
+
+ // cancel bar
+ const cancel_p = quickElement('p', cal_box);
+ cancel_p.className = 'calendar-cancel';
+ const cancel_link = quickElement('a', cancel_p, gettext('Cancel'), 'href', '#');
+ cancel_link.addEventListener('click', function(e) {
+ e.preventDefault();
+ DateTimeShortcuts.dismissCalendar(num);
+ });
+ document.addEventListener('keyup', function(event) {
+ if (event.which === 27) {
+ // ESC key closes popup
+ DateTimeShortcuts.dismissCalendar(num);
+ event.preventDefault();
+ }
+ });
+ },
+ openCalendar: function(num) {
+ const cal_box = document.getElementById(DateTimeShortcuts.calendarDivName1 + num);
+ const cal_link = document.getElementById(DateTimeShortcuts.calendarLinkName + num);
+ const inp = DateTimeShortcuts.calendarInputs[num];
+
+ // Determine if the current value in the input has a valid date.
+ // If so, draw the calendar with that date's year and month.
+ if (inp.value) {
+ const format = get_format('DATE_INPUT_FORMATS')[0];
+ const selected = inp.value.strptime(format);
+ const year = selected.getUTCFullYear();
+ const month = selected.getUTCMonth() + 1;
+ const re = /\d{4}/;
+ if (re.test(year.toString()) && month >= 1 && month <= 12) {
+ DateTimeShortcuts.calendars[num].drawDate(month, year, selected);
+ }
+ }
+
+ // Recalculate the clockbox position
+ // is it left-to-right or right-to-left layout ?
+ if (window.getComputedStyle(document.body).direction !== 'rtl') {
+ cal_box.style.left = findPosX(cal_link) - 228 + 'px';
+ }
+ else {
+ // since style's width is in em, it'd be tough to calculate
+ // px value of it. let's use an estimated px for now
+ cal_box.style.left = findPosX(cal_link) - 180 + 'px';
+ }
+ cal_box.style.top = Math.max(0, findPosY(cal_link) + 44) + 'px';
+
+ cal_box.style.display = 'block';
+ document.addEventListener('click', DateTimeShortcuts.dismissCalendarFunc[num]);
+ },
+ dismissCalendar: function(num) {
+ document.getElementById(DateTimeShortcuts.calendarDivName1 + num).style.display = 'none';
+ document.removeEventListener('click', DateTimeShortcuts.dismissCalendarFunc[num]);
+ },
+ drawPrev: function(num) {
+ DateTimeShortcuts.calendars[num].drawPreviousMonth();
+ },
+ drawNext: function(num) {
+ DateTimeShortcuts.calendars[num].drawNextMonth();
+ },
+ handleCalendarCallback: function(num) {
+ const format = get_format('DATE_INPUT_FORMATS')[0];
+ return function(y, m, d) {
+ DateTimeShortcuts.calendarInputs[num].value = new Date(y, m - 1, d).strftime(format);
+ DateTimeShortcuts.calendarInputs[num].focus();
+ document.getElementById(DateTimeShortcuts.calendarDivName1 + num).style.display = 'none';
+ };
+ },
+ handleCalendarQuickLink: function(num, offset) {
+ const d = DateTimeShortcuts.now();
+ d.setDate(d.getDate() + offset);
+ DateTimeShortcuts.calendarInputs[num].value = d.strftime(get_format('DATE_INPUT_FORMATS')[0]);
+ DateTimeShortcuts.calendarInputs[num].focus();
+ DateTimeShortcuts.dismissCalendar(num);
+ }
+ };
+
+ window.addEventListener('load', DateTimeShortcuts.init);
+ window.DateTimeShortcuts = DateTimeShortcuts;
+}
diff --git a/backend/staticfiles/unfold/filters/js/admin-numeric-filter.js b/backend/staticfiles/unfold/filters/js/admin-numeric-filter.js
new file mode 100644
index 00000000..46d108ca
--- /dev/null
+++ b/backend/staticfiles/unfold/filters/js/admin-numeric-filter.js
@@ -0,0 +1,69 @@
+document.addEventListener("DOMContentLoaded", function () {
+ Array.from(
+ document.getElementsByClassName("admin-numeric-filter-slider")
+ ).forEach(function (slider) {
+ if (Array.from(slider.classList).includes("noUi-target")) {
+ return;
+ }
+
+ const fromInput = slider
+ .closest(".admin-numeric-filter-wrapper")
+ .querySelectorAll(".admin-numeric-filter-wrapper-group input")[0];
+
+ const toInput = slider
+ .closest(".admin-numeric-filter-wrapper")
+ .querySelectorAll(".admin-numeric-filter-wrapper-group input")[1];
+
+ noUiSlider.create(slider, {
+ start: [parseFloat(fromInput.value), parseFloat(toInput.value)],
+ step: parseFloat(slider.getAttribute("data-step")),
+ connect: true,
+ format: wNumb({
+ decimals: parseFloat(slider.getAttribute("data-decimals")),
+ }),
+ range: {
+ min: parseFloat(slider.getAttribute("data-min")),
+ max: parseFloat(slider.getAttribute("data-max")),
+ },
+ });
+
+ /*************************************************************
+ * Update slider when input values change
+ *************************************************************/
+ fromInput.addEventListener("keyup", function () {
+ clearTimeout(this._sliderUpdateTimeout);
+ this._sliderUpdateTimeout = setTimeout(() => {
+ slider.noUiSlider.set([
+ parseFloat(this.value),
+ parseFloat(toInput.value),
+ ]);
+ }, 500);
+ });
+
+ toInput.addEventListener("keyup", function () {
+ clearTimeout(this._sliderUpdateTimeout);
+ this._sliderUpdateTimeout = setTimeout(() => {
+ slider.noUiSlider.set([
+ parseFloat(fromInput.value),
+ parseFloat(this.value),
+ ]);
+ }, 500);
+ });
+
+ /*************************************************************
+ * Updated inputs when slider is moved
+ *************************************************************/
+ slider.noUiSlider.on("update", function (values, handle) {
+ const parent = this.target.closest(".admin-numeric-filter-wrapper");
+ const from = parent.querySelectorAll(
+ ".admin-numeric-filter-wrapper-group input"
+ )[0];
+ const to = parent.querySelectorAll(
+ ".admin-numeric-filter-wrapper-group input"
+ )[1];
+
+ from.value = values[0];
+ to.value = values[1];
+ });
+ });
+});
diff --git a/backend/staticfiles/unfold/filters/js/nouislider/LICENSE b/backend/staticfiles/unfold/filters/js/nouislider/LICENSE
new file mode 100644
index 00000000..98f4ca25
--- /dev/null
+++ b/backend/staticfiles/unfold/filters/js/nouislider/LICENSE
@@ -0,0 +1,21 @@
+MIT License
+
+Copyright (c) 2019 LΓ©on Gersen
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/backend/staticfiles/unfold/filters/js/nouislider/nouislider.min.js b/backend/staticfiles/unfold/filters/js/nouislider/nouislider.min.js
new file mode 100644
index 00000000..a365d9d9
--- /dev/null
+++ b/backend/staticfiles/unfold/filters/js/nouislider/nouislider.min.js
@@ -0,0 +1 @@
+!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).noUiSlider={})}(this,function(ot){"use strict";function n(t){return"object"==typeof t&&"function"==typeof t.to}function st(t){t.parentElement.removeChild(t)}function at(t){return null!=t}function lt(t){t.preventDefault()}function i(t){return"number"==typeof t&&!isNaN(t)&&isFinite(t)}function ut(t,e,r){0
=e[r];)r+=1;return r}function r(t,e,r){if(r>=t.slice(-1)[0])return 100;var n=l(r,t),i=t[n-1],o=t[n],t=e[n-1],n=e[n];return t+(r=r,a(o=[i,o],o[0]<0?r+Math.abs(o[0]):r-o[0],0)/s(t,n))}function o(t,e,r,n){if(100===n)return n;var i=l(n,t),o=t[i-1],s=t[i];return r?(s-o)/2this.xPct[n+1];)n++;else t===this.xPct[this.xPct.length-1]&&(n=this.xPct.length-2);r||t!==this.xPct[n+1]||n++;for(var i,o=1,s=(e=null===e?[]:e)[n],a=0,l=0,u=0,c=r?(t-this.xPct[n])/(this.xPct[n+1]-this.xPct[n]):(this.xPct[n+1]-t)/(this.xPct[n+1]-this.xPct[n]);0= 2) required for mode 'count'.");for(var e=t.values-1,r=100/e,n=[];e--;)n[e]=e*r;return n.push(100),U(n,t.stepped)}(d),m={},t=S.xVal[0],e=S.xVal[S.xVal.length-1],g=!1,v=!1,b=0;return(h=h.slice().sort(function(t,e){return t-e}).filter(function(t){return!this[t]&&(this[t]=!0)},{}))[0]!==t&&(h.unshift(t),g=!0),h[h.length-1]!==e&&(h.push(e),v=!0),h.forEach(function(t,e){var r,n,i,o,s,a,l,u,t=t,c=h[e+1],p=d.mode===ot.PipsMode.Steps,f=(f=p?S.xNumSteps[e]:f)||c-t;for(void 0===c&&(c=t),f=Math.max(f,1e-7),r=t;r<=c;r=Number((r+f).toFixed(7))){for(a=(o=(i=S.toStepping(r))-b)/(d.density||1),u=o/(l=Math.round(a)),n=1;n<=l;n+=1)m[(s=b+n*u).toFixed(5)]=[S.fromStepping(s),0];a=-1ot.PipsType.NoValue&&((t=P(a,!1)).className=p(n,f.cssClasses.value),t.setAttribute("data-value",String(r)),t.style[f.style]=e+"%",t.innerHTML=String(s.to(r))))}),a}function L(){n&&(st(n),n=null)}function T(t){L();var e=D(t),r=t.filter,t=t.format||{to:function(t){return String(Math.round(t))}};return n=d.appendChild(O(e,r,t))}function j(){var t=i.getBoundingClientRect(),e="offset"+["Width","Height"][f.ort];return 0===f.ort?t.width||i[e]:t.height||i[e]}function z(n,i,o,s){function e(t){var e,r=function(e,t,r){var n=0===e.type.indexOf("touch"),i=0===e.type.indexOf("mouse"),o=0===e.type.indexOf("pointer"),s=0,a=0;0===e.type.indexOf("MSPointer")&&(o=!0);if("mousedown"===e.type&&!e.buttons&&!e.touches)return!1;if(n){var l=function(t){t=t.target;return t===r||r.contains(t)||e.composed&&e.composedPath().shift()===r};if("touchstart"===e.type){n=Array.prototype.filter.call(e.touches,l);if(1r.stepAfter.startValue&&(i=r.stepAfter.startValue-n),t=n>r.thisStep.startValue?r.thisStep.step:!1!==r.stepBefore.step&&n-r.stepBefore.highestStep,100===e?i=null:0===e&&(t=null);e=S.countStepDecimals();return null!==i&&!1!==i&&(i=Number(i.toFixed(e))),[t=null!==t&&!1!==t?Number(t.toFixed(e)):t,i]}ft(t=d,f.cssClasses.target),0===f.dir?ft(t,f.cssClasses.ltr):ft(t,f.cssClasses.rtl),0===f.ort?ft(t,f.cssClasses.horizontal):ft(t,f.cssClasses.vertical),ft(t,"rtl"===getComputedStyle(t).direction?f.cssClasses.textDirectionRtl:f.cssClasses.textDirectionLtr),i=P(t,f.cssClasses.base),function(t,e){var r=P(e,f.cssClasses.connects);l=[],(a=[]).push(N(r,t[0]));for(var n=0;n{var V=Math.min,S=Math.max,X=Math.round,U=Math.floor,T=t=>({x:t,y:t}),Ht={left:"right",right:"left",bottom:"top",top:"bottom"},zt={start:"end",end:"start"};function ot(t,e,n){return S(t,V(e,n))}function q(t,e){return typeof t=="function"?t(e):t}function L(t){return t.split("-")[0]}function J(t){return t.split("-")[1]}function it(t){return t==="x"?"y":"x"}function st(t){return t==="y"?"height":"width"}function K(t){return["top","bottom"].includes(L(t))?"y":"x"}function rt(t){return it(K(t))}function pt(t,e,n){n===void 0&&(n=!1);let o=J(t),i=rt(t),s=st(i),r=i==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return e.reference[s]>e.floating[s]&&(r=$(r)),[r,$(r)]}function xt(t){let e=$(t);return[tt(t),e,tt(e)]}function tt(t){return t.replace(/start|end/g,e=>zt[e])}function It(t,e,n){let o=["left","right"],i=["right","left"],s=["top","bottom"],r=["bottom","top"];switch(t){case"top":case"bottom":return n?e?i:o:e?o:i;case"left":case"right":return e?s:r;default:return[]}}function wt(t,e,n,o){let i=J(t),s=It(L(t),n==="start",o);return i&&(s=s.map(r=>r+"-"+i),e&&(s=s.concat(s.map(tt)))),s}function $(t){return t.replace(/left|right|bottom|top/g,e=>Ht[e])}function jt(t){return{top:0,right:0,bottom:0,left:0,...t}}function yt(t){return typeof t!="number"?jt(t):{top:t,right:t,bottom:t,left:t}}function _(t){return{...t,top:t.y,left:t.x,right:t.x+t.width,bottom:t.y+t.height}}function vt(t,e,n){let{reference:o,floating:i}=t,s=K(e),r=rt(e),c=st(r),l=L(e),f=s==="y",m=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,p=o[c]/2-i[c]/2,a;switch(l){case"top":a={x:m,y:o.y-i.height};break;case"bottom":a={x:m,y:o.y+o.height};break;case"right":a={x:o.x+o.width,y:u};break;case"left":a={x:o.x-i.width,y:u};break;default:a={x:o.x,y:o.y}}switch(J(e)){case"start":a[r]-=p*(n&&f?-1:1);break;case"end":a[r]+=p*(n&&f?-1:1);break}return a}var bt=async(t,e,n)=>{let{placement:o="bottom",strategy:i="absolute",middleware:s=[],platform:r}=n,c=s.filter(Boolean),l=await(r.isRTL==null?void 0:r.isRTL(e)),f=await r.getElementRects({reference:t,floating:e,strategy:i}),{x:m,y:u}=vt(f,o,l),p=o,a={},d=0;for(let g=0;gk<=0)){var dt,mt;let k=(((dt=s.flip)==null?void 0:dt.index)||0)+1,ht=v[k];if(ht)return{data:{index:k,overflows:I},reset:{placement:ht}};let j=(mt=I.filter(B=>B.overflows[0]<=0).sort((B,F)=>B.overflows[1]-F.overflows[1])[0])==null?void 0:mt.placement;if(!j)switch(a){case"bestFit":{var gt;let B=(gt=I.map(F=>[F.placement,F.overflows.filter(Y=>Y>0).reduce((Y,Wt)=>Y+Wt,0)]).sort((F,Y)=>F[1]-Y[1])[0])==null?void 0:gt[0];B&&(j=B);break}case"initialPlacement":j=c;break}if(i!==j)return{reset:{placement:j}}}return{}}}};async function Yt(t,e){let{placement:n,platform:o,elements:i}=t,s=await(o.isRTL==null?void 0:o.isRTL(i.floating)),r=L(n),c=J(n),l=K(n)==="y",f=["left","top"].includes(r)?-1:1,m=s&&l?-1:1,u=q(e,t),{mainAxis:p,crossAxis:a,alignmentAxis:d}=typeof u=="number"?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...u};return c&&typeof d=="number"&&(a=c==="end"?d*-1:d),l?{x:a*m,y:p*f}:{x:p*f,y:a*m}}var ft=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){let{x:n,y:o}=e,i=await Yt(e,t);return{x:n+i.x,y:o+i.y,data:i}}}},at=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){let{x:n,y:o,placement:i}=e,{mainAxis:s=!0,crossAxis:r=!1,limiter:c={fn:x=>{let{x:h,y:w}=x;return{x:h,y:w}}},...l}=q(t,e),f={x:n,y:o},m=await ct(e,l),u=K(L(i)),p=it(u),a=f[p],d=f[u];if(s){let x=p==="y"?"top":"left",h=p==="y"?"bottom":"right",w=a+m[x],y=a-m[h];a=ot(w,a,y)}if(r){let x=u==="y"?"top":"left",h=u==="y"?"bottom":"right",w=d+m[x],y=d-m[h];d=ot(w,d,y)}let g=c.fn({...e,[p]:a,[u]:d});return{...g,data:{x:g.x-n,y:g.y-o}}}}};function P(t){return Ot(t)?(t.nodeName||"").toLowerCase():"#document"}function b(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function C(t){var e;return(e=(Ot(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function Ot(t){return t instanceof Node||t instanceof b(t).Node}function E(t){return t instanceof Element||t instanceof b(t).Element}function R(t){return t instanceof HTMLElement||t instanceof b(t).HTMLElement}function At(t){return typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof b(t).ShadowRoot}function H(t){let{overflow:e,overflowX:n,overflowY:o,display:i}=A(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&!["inline","contents"].includes(i)}function Rt(t){return["table","td","th"].includes(P(t))}function et(t){let e=nt(),n=A(t);return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(o=>(n.willChange||"").includes(o))||["paint","layout","strict","content"].some(o=>(n.contain||"").includes(o))}function Ct(t){let e=M(t);for(;R(e)&&!G(e);){if(et(e))return e;e=M(e)}return null}function nt(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function G(t){return["html","body","#document"].includes(P(t))}function A(t){return b(t).getComputedStyle(t)}function Q(t){return E(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function M(t){if(P(t)==="html")return t;let e=t.assignedSlot||t.parentNode||At(t)&&t.host||C(t);return At(e)?e.host:e}function Et(t){let e=M(t);return G(e)?t.ownerDocument?t.ownerDocument.body:t.body:R(e)&&H(e)?e:Et(e)}function W(t,e,n){var o;e===void 0&&(e=[]),n===void 0&&(n=!0);let i=Et(t),s=i===((o=t.ownerDocument)==null?void 0:o.body),r=b(i);return s?e.concat(r,r.visualViewport||[],H(i)?i:[],r.frameElement&&n?W(r.frameElement):[]):e.concat(i,W(i,[],n))}function Pt(t){let e=A(t),n=parseFloat(e.width)||0,o=parseFloat(e.height)||0,i=R(t),s=i?t.offsetWidth:n,r=i?t.offsetHeight:o,c=X(n)!==s||X(o)!==r;return c&&(n=s,o=r),{width:n,height:o,$:c}}function ut(t){return E(t)?t:t.contextElement}function z(t){let e=ut(t);if(!R(e))return T(1);let n=e.getBoundingClientRect(),{width:o,height:i,$:s}=Pt(e),r=(s?X(n.width):n.width)/o,c=(s?X(n.height):n.height)/i;return(!r||!Number.isFinite(r))&&(r=1),(!c||!Number.isFinite(c))&&(c=1),{x:r,y:c}}var $t=T(0);function Lt(t){let e=b(t);return!nt()||!e.visualViewport?$t:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Xt(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==b(t)?!1:e}function N(t,e,n,o){e===void 0&&(e=!1),n===void 0&&(n=!1);let i=t.getBoundingClientRect(),s=ut(t),r=T(1);e&&(o?E(o)&&(r=z(o)):r=z(t));let c=Xt(s,n,o)?Lt(s):T(0),l=(i.left+c.x)/r.x,f=(i.top+c.y)/r.y,m=i.width/r.x,u=i.height/r.y;if(s){let p=b(s),a=o&&E(o)?b(o):o,d=p.frameElement;for(;d&&o&&a!==p;){let g=z(d),x=d.getBoundingClientRect(),h=A(d),w=x.left+(d.clientLeft+parseFloat(h.paddingLeft))*g.x,y=x.top+(d.clientTop+parseFloat(h.paddingTop))*g.y;l*=g.x,f*=g.y,m*=g.x,u*=g.y,l+=w,f+=y,d=b(d).frameElement}}return _({width:m,height:u,x:l,y:f})}function Ut(t){let{rect:e,offsetParent:n,strategy:o}=t,i=R(n),s=C(n);if(n===s)return e;let r={scrollLeft:0,scrollTop:0},c=T(1),l=T(0);if((i||!i&&o!=="fixed")&&((P(n)!=="body"||H(s))&&(r=Q(n)),R(n))){let f=N(n);c=z(n),l.x=f.x+n.clientLeft,l.y=f.y+n.clientTop}return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-r.scrollLeft*c.x+l.x,y:e.y*c.y-r.scrollTop*c.y+l.y}}function qt(t){return Array.from(t.getClientRects())}function Dt(t){return N(C(t)).left+Q(t).scrollLeft}function Jt(t){let e=C(t),n=Q(t),o=t.ownerDocument.body,i=S(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),s=S(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight),r=-n.scrollLeft+Dt(t),c=-n.scrollTop;return A(o).direction==="rtl"&&(r+=S(e.clientWidth,o.clientWidth)-i),{width:i,height:s,x:r,y:c}}function Kt(t,e){let n=b(t),o=C(t),i=n.visualViewport,s=o.clientWidth,r=o.clientHeight,c=0,l=0;if(i){s=i.width,r=i.height;let f=nt();(!f||f&&e==="fixed")&&(c=i.offsetLeft,l=i.offsetTop)}return{width:s,height:r,x:c,y:l}}function Gt(t,e){let n=N(t,!0,e==="fixed"),o=n.top+t.clientTop,i=n.left+t.clientLeft,s=R(t)?z(t):T(1),r=t.clientWidth*s.x,c=t.clientHeight*s.y,l=i*s.x,f=o*s.y;return{width:r,height:c,x:l,y:f}}function St(t,e,n){let o;if(e==="viewport")o=Kt(t,n);else if(e==="document")o=Jt(C(t));else if(E(e))o=Gt(e,n);else{let i=Lt(t);o={...e,x:e.x-i.x,y:e.y-i.y}}return _(o)}function kt(t,e){let n=M(t);return n===e||!E(n)||G(n)?!1:A(n).position==="fixed"||kt(n,e)}function Qt(t,e){let n=e.get(t);if(n)return n;let o=W(t,[],!1).filter(c=>E(c)&&P(c)!=="body"),i=null,s=A(t).position==="fixed",r=s?M(t):t;for(;E(r)&&!G(r);){let c=A(r),l=et(r);!l&&c.position==="fixed"&&(i=null),(s?!l&&!i:!l&&c.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||H(r)&&!l&&kt(t,r))?o=o.filter(m=>m!==r):i=c,r=M(r)}return e.set(t,o),o}function Zt(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t,r=[...n==="clippingAncestors"?Qt(e,this._c):[].concat(n),o],c=r[0],l=r.reduce((f,m)=>{let u=St(e,m,i);return f.top=S(u.top,f.top),f.right=V(u.right,f.right),f.bottom=V(u.bottom,f.bottom),f.left=S(u.left,f.left),f},St(e,c,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function te(t){return Pt(t)}function ee(t,e,n){let o=R(e),i=C(e),s=n==="fixed",r=N(t,!0,s,e),c={scrollLeft:0,scrollTop:0},l=T(0);if(o||!o&&!s)if((P(e)!=="body"||H(i))&&(c=Q(e)),o){let f=N(e,!0,s,e);l.x=f.x+e.clientLeft,l.y=f.y+e.clientTop}else i&&(l.x=Dt(i));return{x:r.left+c.scrollLeft-l.x,y:r.top+c.scrollTop-l.y,width:r.width,height:r.height}}function Tt(t,e){return!R(t)||A(t).position==="fixed"?null:e?e(t):t.offsetParent}function _t(t,e){let n=b(t);if(!R(t))return n;let o=Tt(t,e);for(;o&&Rt(o)&&A(o).position==="static";)o=Tt(o,e);return o&&(P(o)==="html"||P(o)==="body"&&A(o).position==="static"&&!et(o))?n:o||Ct(t)||n}var ne=async function(t){let{reference:e,floating:n,strategy:o}=t,i=this.getOffsetParent||_t,s=this.getDimensions;return{reference:ee(e,await i(n),o),floating:{x:0,y:0,...await s(n)}}};function oe(t){return A(t).direction==="rtl"}var ie={convertOffsetParentRelativeRectToViewportRelativeRect:Ut,getDocumentElement:C,getClippingRect:Zt,getOffsetParent:_t,getElementRects:ne,getClientRects:qt,getDimensions:te,getScale:z,isElement:E,isRTL:oe};function se(t,e){let n=null,o,i=C(t);function s(){clearTimeout(o),n&&n.disconnect(),n=null}function r(c,l){c===void 0&&(c=!1),l===void 0&&(l=1),s();let{left:f,top:m,width:u,height:p}=t.getBoundingClientRect();if(c||e(),!u||!p)return;let a=U(m),d=U(i.clientWidth-(f+u)),g=U(i.clientHeight-(m+p)),x=U(f),w={rootMargin:-a+"px "+-d+"px "+-g+"px "+-x+"px",threshold:S(0,V(1,l))||1},y=!0;function O(v){let D=v[0].intersectionRatio;if(D!==l){if(!y)return r();D?r(!1,D):o=setTimeout(()=>{r(!1,1e-7)},100)}y=!1}try{n=new IntersectionObserver(O,{...w,root:i.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(t)}return r(!0),s}function Mt(t,e,n,o){o===void 0&&(o={});let{ancestorScroll:i=!0,ancestorResize:s=!0,elementResize:r=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:l=!1}=o,f=ut(t),m=i||s?[...f?W(f):[],...W(e)]:[];m.forEach(h=>{i&&h.addEventListener("scroll",n,{passive:!0}),s&&h.addEventListener("resize",n)});let u=f&&c?se(f,n):null,p=-1,a=null;r&&(a=new ResizeObserver(h=>{let[w]=h;w&&w.target===f&&a&&(a.unobserve(e),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{a&&a.observe(e)})),n()}),f&&!l&&a.observe(f),a.observe(e));let d,g=l?N(t):null;l&&x();function x(){let h=N(t);g&&(h.x!==g.x||h.y!==g.y||h.width!==g.width||h.height!==g.height)&&n(),g=h,d=requestAnimationFrame(x)}return n(),()=>{m.forEach(h=>{i&&h.removeEventListener("scroll",n),s&&h.removeEventListener("resize",n)}),u&&u(),a&&a.disconnect(),a=null,l&&cancelAnimationFrame(d)}}var Nt=(t,e,n)=>{let o=new Map,i={platform:ie,...n},s={...i.platform,_c:o};return bt(t,e,{...i,platform:s})};function Vt(t){t.magic("anchor",e=>{if(!e._x_anchor)throw"Alpine: No x-anchor directive found on element using $anchor...";return e._x_anchor}),t.interceptClone((e,n)=>{e&&e._x_anchor&&!n._x_anchor&&(n._x_anchor=e._x_anchor)}),t.directive("anchor",t.skipDuringClone((e,{expression:n,modifiers:o,value:i},{cleanup:s,evaluate:r})=>{let{placement:c,offsetValue:l,unstyled:f}=Ft(o);e._x_anchor=t.reactive({x:0,y:0});let m=r(n);if(!m)throw"Alpine: no element provided to x-anchor...";let u=()=>{let a;Nt(m,e,{placement:c,middleware:[lt(),at({padding:5}),ft(l)]}).then(({x:d,y:g})=>{f||Bt(e,d,g),JSON.stringify({x:d,y:g})!==a&&(e._x_anchor.x=d,e._x_anchor.y=g),a=JSON.stringify({x:d,y:g})})},p=Mt(m,e,()=>u());s(()=>p())},(e,{expression:n,modifiers:o,value:i},{cleanup:s,evaluate:r})=>{let{placement:c,offsetValue:l,unstyled:f}=Ft(o);e._x_anchor&&(f||Bt(e,e._x_anchor.x,e._x_anchor.y))}))}function Bt(t,e,n){Object.assign(t.style,{left:e+"px",top:n+"px",position:"absolute"})}function Ft(t){let n=["top","top-start","top-end","right","right-start","right-end","bottom","bottom-start","bottom-end","left","left-start","left-end"].find(s=>t.includes(s)),o=0;if(t.includes("offset")){let s=t.findIndex(r=>r==="offset");o=t[s+1]!==void 0?Number(t[s+1]):o}let i=t.includes("no-style");return{placement:n,offsetValue:o,unstyled:i}}document.addEventListener("alpine:init",()=>{window.Alpine.plugin(Vt)});})();
diff --git a/backend/staticfiles/unfold/js/alpine/alpine.js b/backend/staticfiles/unfold/js/alpine/alpine.js
new file mode 100644
index 00000000..2fdd6ecf
--- /dev/null
+++ b/backend/staticfiles/unfold/js/alpine/alpine.js
@@ -0,0 +1,5 @@
+(()=>{var nt=!1,it=!1,W=[],ot=-1;function Ut(e){Rn(e)}function Rn(e){W.includes(e)||W.push(e),Mn()}function Wt(e){let t=W.indexOf(e);t!==-1&&t>ot&&W.splice(t,1)}function Mn(){!it&&!nt&&(nt=!0,queueMicrotask(Nn))}function Nn(){nt=!1,it=!0;for(let e=0;ee.effect(t,{scheduler:r=>{st?Ut(r):r()}}),at=e.raw}function ct(e){N=e}function Yt(e){let t=()=>{};return[n=>{let i=N(n);return e._x_effects||(e._x_effects=new Set,e._x_runEffects=()=>{e._x_effects.forEach(o=>o())}),e._x_effects.add(i),t=()=>{i!==void 0&&(e._x_effects.delete(i),$(i))},i},()=>{t()}]}function ve(e,t){let r=!0,n,i=N(()=>{let o=e();JSON.stringify(o),r?n=o:queueMicrotask(()=>{t(o,n),n=o}),r=!1});return()=>$(i)}var Xt=[],Zt=[],Qt=[];function er(e){Qt.push(e)}function te(e,t){typeof t=="function"?(e._x_cleanups||(e._x_cleanups=[]),e._x_cleanups.push(t)):(t=e,Zt.push(t))}function Ae(e){Xt.push(e)}function Oe(e,t,r){e._x_attributeCleanups||(e._x_attributeCleanups={}),e._x_attributeCleanups[t]||(e._x_attributeCleanups[t]=[]),e._x_attributeCleanups[t].push(r)}function lt(e,t){e._x_attributeCleanups&&Object.entries(e._x_attributeCleanups).forEach(([r,n])=>{(t===void 0||t.includes(r))&&(n.forEach(i=>i()),delete e._x_attributeCleanups[r])})}function tr(e){for(e._x_effects?.forEach(Wt);e._x_cleanups?.length;)e._x_cleanups.pop()()}var ut=new MutationObserver(mt),ft=!1;function ue(){ut.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),ft=!0}function dt(){kn(),ut.disconnect(),ft=!1}var le=[];function kn(){let e=ut.takeRecords();le.push(()=>e.length>0&&mt(e));let t=le.length;queueMicrotask(()=>{if(le.length===t)for(;le.length>0;)le.shift()()})}function m(e){if(!ft)return e();dt();let t=e();return ue(),t}var pt=!1,Se=[];function rr(){pt=!0}function nr(){pt=!1,mt(Se),Se=[]}function mt(e){if(pt){Se=Se.concat(e);return}let t=[],r=new Set,n=new Map,i=new Map;for(let o=0;o{s.nodeType===1&&s._x_marker&&r.add(s)}),e[o].addedNodes.forEach(s=>{if(s.nodeType===1){if(r.has(s)){r.delete(s);return}s._x_marker||t.push(s)}})),e[o].type==="attributes")){let s=e[o].target,a=e[o].attributeName,c=e[o].oldValue,l=()=>{n.has(s)||n.set(s,[]),n.get(s).push({name:a,value:s.getAttribute(a)})},u=()=>{i.has(s)||i.set(s,[]),i.get(s).push(a)};s.hasAttribute(a)&&c===null?l():s.hasAttribute(a)?(u(),l()):u()}i.forEach((o,s)=>{lt(s,o)}),n.forEach((o,s)=>{Xt.forEach(a=>a(s,o))});for(let o of r)t.some(s=>s.contains(o))||Zt.forEach(s=>s(o));for(let o of t)o.isConnected&&Qt.forEach(s=>s(o));t=null,r=null,n=null,i=null}function Ce(e){return z(B(e))}function k(e,t,r){return e._x_dataStack=[t,...B(r||e)],()=>{e._x_dataStack=e._x_dataStack.filter(n=>n!==t)}}function B(e){return e._x_dataStack?e._x_dataStack:typeof ShadowRoot=="function"&&e instanceof ShadowRoot?B(e.host):e.parentNode?B(e.parentNode):[]}function z(e){return new Proxy({objects:e},Dn)}var Dn={ownKeys({objects:e}){return Array.from(new Set(e.flatMap(t=>Object.keys(t))))},has({objects:e},t){return t==Symbol.unscopables?!1:e.some(r=>Object.prototype.hasOwnProperty.call(r,t)||Reflect.has(r,t))},get({objects:e},t,r){return t=="toJSON"?Pn:Reflect.get(e.find(n=>Reflect.has(n,t))||{},t,r)},set({objects:e},t,r,n){let i=e.find(s=>Object.prototype.hasOwnProperty.call(s,t))||e[e.length-1],o=Object.getOwnPropertyDescriptor(i,t);return o?.set&&o?.get?o.set.call(n,r)||!0:Reflect.set(i,t,r)}};function Pn(){return Reflect.ownKeys(this).reduce((t,r)=>(t[r]=Reflect.get(this,r),t),{})}function Te(e){let t=n=>typeof n=="object"&&!Array.isArray(n)&&n!==null,r=(n,i="")=>{Object.entries(Object.getOwnPropertyDescriptors(n)).forEach(([o,{value:s,enumerable:a}])=>{if(a===!1||s===void 0||typeof s=="object"&&s!==null&&s.__v_skip)return;let c=i===""?o:`${i}.${o}`;typeof s=="object"&&s!==null&&s._x_interceptor?n[o]=s.initialize(e,c,o):t(s)&&s!==n&&!(s instanceof Element)&&r(s,c)})};return r(e)}function Re(e,t=()=>{}){let r={initialValue:void 0,_x_interceptor:!0,initialize(n,i,o){return e(this.initialValue,()=>In(n,i),s=>ht(n,i,s),i,o)}};return t(r),n=>{if(typeof n=="object"&&n!==null&&n._x_interceptor){let i=r.initialize.bind(r);r.initialize=(o,s,a)=>{let c=n.initialize(o,s,a);return r.initialValue=c,i(o,s,a)}}else r.initialValue=n;return r}}function In(e,t){return t.split(".").reduce((r,n)=>r[n],e)}function ht(e,t,r){if(typeof t=="string"&&(t=t.split(".")),t.length===1)e[t[0]]=r;else{if(t.length===0)throw error;return e[t[0]]||(e[t[0]]={}),ht(e[t[0]],t.slice(1),r)}}var ir={};function y(e,t){ir[e]=t}function fe(e,t){let r=Ln(t);return Object.entries(ir).forEach(([n,i])=>{Object.defineProperty(e,`$${n}`,{get(){return i(t,r)},enumerable:!1})}),e}function Ln(e){let[t,r]=_t(e),n={interceptor:Re,...t};return te(e,r),n}function or(e,t,r,...n){try{return r(...n)}catch(i){re(i,e,t)}}function re(e,t,r=void 0){e=Object.assign(e??{message:"No error message given."},{el:t,expression:r}),console.warn(`Alpine Expression Error: ${e.message}
+
+${r?'Expression: "'+r+`"
+
+`:""}`,t),setTimeout(()=>{throw e},0)}var Me=!0;function ke(e){let t=Me;Me=!1;let r=e();return Me=t,r}function R(e,t,r={}){let n;return x(e,t)(i=>n=i,r),n}function x(...e){return sr(...e)}var sr=xt;function ar(e){sr=e}function xt(e,t){let r={};fe(r,e);let n=[r,...B(e)],i=typeof t=="function"?$n(n,t):Fn(n,t,e);return or.bind(null,e,t,i)}function $n(e,t){return(r=()=>{},{scope:n={},params:i=[]}={})=>{let o=t.apply(z([n,...e]),i);Ne(r,o)}}var gt={};function jn(e,t){if(gt[e])return gt[e];let r=Object.getPrototypeOf(async function(){}).constructor,n=/^[\n\s]*if.*\(.*\)/.test(e.trim())||/^(let|const)\s/.test(e.trim())?`(async()=>{ ${e} })()`:e,o=(()=>{try{let s=new r(["__self","scope"],`with (scope) { __self.result = ${n} }; __self.finished = true; return __self.result;`);return Object.defineProperty(s,"name",{value:`[Alpine] ${e}`}),s}catch(s){return re(s,t,e),Promise.resolve()}})();return gt[e]=o,o}function Fn(e,t,r){let n=jn(t,r);return(i=()=>{},{scope:o={},params:s=[]}={})=>{n.result=void 0,n.finished=!1;let a=z([o,...e]);if(typeof n=="function"){let c=n(n,a).catch(l=>re(l,r,t));n.finished?(Ne(i,n.result,a,s,r),n.result=void 0):c.then(l=>{Ne(i,l,a,s,r)}).catch(l=>re(l,r,t)).finally(()=>n.result=void 0)}}}function Ne(e,t,r,n,i){if(Me&&typeof t=="function"){let o=t.apply(r,n);o instanceof Promise?o.then(s=>Ne(e,s,r,n)).catch(s=>re(s,i,t)):e(o)}else typeof t=="object"&&t instanceof Promise?t.then(o=>e(o)):e(t)}var wt="x-";function C(e=""){return wt+e}function cr(e){wt=e}var De={};function d(e,t){return De[e]=t,{before(r){if(!De[r]){console.warn(String.raw`Cannot find directive \`${r}\`. \`${e}\` will use the default order of execution`);return}let n=G.indexOf(r);G.splice(n>=0?n:G.indexOf("DEFAULT"),0,e)}}}function lr(e){return Object.keys(De).includes(e)}function pe(e,t,r){if(t=Array.from(t),e._x_virtualDirectives){let o=Object.entries(e._x_virtualDirectives).map(([a,c])=>({name:a,value:c})),s=Et(o);o=o.map(a=>s.find(c=>c.name===a.name)?{name:`x-bind:${a.name}`,value:`"${a.value}"`}:a),t=t.concat(o)}let n={};return t.map(dr((o,s)=>n[o]=s)).filter(mr).map(zn(n,r)).sort(Kn).map(o=>Bn(e,o))}function Et(e){return Array.from(e).map(dr()).filter(t=>!mr(t))}var yt=!1,de=new Map,ur=Symbol();function fr(e){yt=!0;let t=Symbol();ur=t,de.set(t,[]);let r=()=>{for(;de.get(t).length;)de.get(t).shift()();de.delete(t)},n=()=>{yt=!1,r()};e(r),n()}function _t(e){let t=[],r=a=>t.push(a),[n,i]=Yt(e);return t.push(i),[{Alpine:K,effect:n,cleanup:r,evaluateLater:x.bind(x,e),evaluate:R.bind(R,e)},()=>t.forEach(a=>a())]}function Bn(e,t){let r=()=>{},n=De[t.type]||r,[i,o]=_t(e);Oe(e,t.original,o);let s=()=>{e._x_ignore||e._x_ignoreSelf||(n.inline&&n.inline(e,t,i),n=n.bind(n,e,t,i),yt?de.get(ur).push(n):n())};return s.runCleanups=o,s}var Pe=(e,t)=>({name:r,value:n})=>(r.startsWith(e)&&(r=r.replace(e,t)),{name:r,value:n}),Ie=e=>e;function dr(e=()=>{}){return({name:t,value:r})=>{let{name:n,value:i}=pr.reduce((o,s)=>s(o),{name:t,value:r});return n!==t&&e(n,t),{name:n,value:i}}}var pr=[];function ne(e){pr.push(e)}function mr({name:e}){return hr().test(e)}var hr=()=>new RegExp(`^${wt}([^:^.]+)\\b`);function zn(e,t){return({name:r,value:n})=>{let i=r.match(hr()),o=r.match(/:([a-zA-Z0-9\-_:]+)/),s=r.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],a=t||e[r]||r;return{type:i?i[1]:null,value:o?o[1]:null,modifiers:s.map(c=>c.replace(".","")),expression:n,original:a}}}var bt="DEFAULT",G=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",bt,"teleport"];function Kn(e,t){let r=G.indexOf(e.type)===-1?bt:e.type,n=G.indexOf(t.type)===-1?bt:t.type;return G.indexOf(r)-G.indexOf(n)}function J(e,t,r={}){e.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!0,composed:!0,cancelable:!0}))}function D(e,t){if(typeof ShadowRoot=="function"&&e instanceof ShadowRoot){Array.from(e.children).forEach(i=>D(i,t));return}let r=!1;if(t(e,()=>r=!0),r)return;let n=e.firstElementChild;for(;n;)D(n,t,!1),n=n.nextElementSibling}function E(e,...t){console.warn(`Alpine Warning: ${e}`,...t)}var _r=!1;function gr(){_r&&E("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),_r=!0,document.body||E("Unable to initialize. Trying to load Alpine before `` is available. Did you forget to add `defer` in Alpine's `