veritheme 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ /*!
2
+ * veritheme.js v1.1.0
3
+ * https://veritheme.com
4
+ * MIT License
5
+ */
6
+
7
+ var UCAccordion={init:function(){var t=0;document.querySelectorAll("[data-accordion-item]").forEach(function(a){t++;var r=a.querySelector("[data-accordion-trigger]"),n=a.querySelector("[data-accordion-content]");if(r&&n){var i="acc-trigger-"+t,s="acc-content-"+t;r.id=i,n.id=s,r.setAttribute("aria-controls",s),!r.hasAttribute("role")&&r.tagName!=="BUTTON"&&(r.setAttribute("role","button"),r.setAttribute("tabindex","0")),n.setAttribute("aria-labelledby",i),n.setAttribute("role","region");var d=!n.classList.contains("vt-hidden")&&!n.classList.contains("hidden");r.setAttribute("aria-expanded",d?"true":"false")}});function e(a){a.classList.remove("vt-hidden"),a.classList.add("open");var r=a.style.transition,n=a.style.maxHeight;a.style.transition="none",a.style.maxHeight="none";var i=a.scrollHeight;a.style.maxHeight=n||"0px",a.offsetHeight,a.style.transition=r,a.style.maxHeight=i+"px"}function o(a){a.style.maxHeight="0px",a.classList.remove("open"),a.addEventListener("transitionend",function r(){a.style.maxHeight==="0px"&&a.classList.add("vt-hidden"),a.removeEventListener("transitionend",r)})}document.querySelectorAll("[data-accordion-content]").forEach(function(a){!a.classList.contains("vt-hidden")&&!a.classList.contains("hidden")&&e(a)}),document.querySelectorAll("[data-accordion-trigger]").forEach(function(a){a.hasAttribute("data-accordion-init")||(a.setAttribute("data-accordion-init","true"),a.addEventListener("keydown",function(r){(r.key==="Enter"||r.key===" ")&&(r.preventDefault(),a.click())}),a.addEventListener("click",function(){var r=a.closest("[data-accordion-item]"),n=a.closest("[data-accordion]"),i=n.getAttribute("data-accordion"),s=r.querySelector("[data-accordion-content]"),d=a.querySelector("[data-accordion-icon]"),c=!s.classList.contains("vt-hidden")&&!s.classList.contains("hidden")&&s.classList.contains("open");i==="single"&&n.querySelectorAll("[data-accordion-item]").forEach(function(l){var u=l.querySelector("[data-accordion-content]"),v=l.querySelector("[data-accordion-trigger]"),f=l.querySelector("[data-accordion-trigger] [data-accordion-icon]");l!==r&&!u.classList.contains("vt-hidden")&&!u.classList.contains("hidden")&&(o(u),f&&f.classList.remove("vt-rotate-180"),v&&v.setAttribute("aria-expanded","false"))}),c?(o(s),d&&d.classList.remove("vt-rotate-180"),a.setAttribute("aria-expanded","false")):(s.classList.remove("vt-hidden"),s.offsetHeight,e(s),d&&d.classList.add("vt-rotate-180"),a.setAttribute("aria-expanded","true"))}))})}},UCCalendar={init:function(){document.querySelectorAll("[data-calendar]").forEach(function(t){if(!t.hasAttribute("data-calendar-bound")){t.setAttribute("data-calendar-bound","true");var e=t.getAttribute("data-calendar")||"single";t.addEventListener("click",function(o){var a=o.target.closest(".vt-calendar-day");if(!(!a||a.classList.contains("vt-outside")||a.classList.contains("vt-muted"))){var r=Array.prototype.slice.call(t.querySelectorAll(".vt-calendar-day")).filter(function(l){return!l.classList.contains("vt-outside")&&!l.classList.contains("vt-muted")});if(e==="range"){var n=r.indexOf(a);if(t._rangeStart==null||t._rangeDone)r.forEach(function(l){l.classList.remove("vt-range-start","vt-range-middle","vt-range-end","vt-active")}),a.classList.add("vt-range-start"),t._rangeStart=n,t._rangeDone=!1;else{var i=t._rangeStart,s=n;if(i===s)return;if(s<i){r[i].classList.remove("vt-range-start");var d=i;i=s,s=d,r[i].classList.add("vt-range-start")}for(var c=i+1;c<s;c++)r[c].classList.add("vt-range-middle");r[s].classList.add("vt-range-end"),t._rangeDone=!0}}else r.forEach(function(l){l.classList.remove("vt-active")}),a.classList.add("vt-active")}})}})}},UCChip={init:function(){document.querySelectorAll("[data-chip-group]").forEach(function(t){t.hasAttribute("data-chip-bound")||(t.setAttribute("data-chip-bound","true"),t.querySelectorAll(".vt-chip-btn").forEach(function(e){var o=e.getAttribute("data-selected")==="true"||e.classList.contains("vt-chip-active");e.setAttribute("aria-pressed",o?"true":"false"),e.addEventListener("click",function(){var a=e.getAttribute("data-selected")==="true";e.setAttribute("data-selected",a?"false":"true"),e.setAttribute("aria-pressed",a?"false":"true"),e.classList.toggle("vt-chip-active",!a)})}))})}},UCRadioGroup={init:function(){document.querySelectorAll("[data-group] .vt-radio").forEach(function(t){var e=t.closest("label");!e||e.hasAttribute("data-radio-bound")||(e.setAttribute("data-radio-bound","true"),e.addEventListener("click",function(){if(!t.classList.contains("disabled")){var o=t.closest("[data-group]");o.querySelectorAll(".vt-radio").forEach(function(a){a.classList.remove("selected")}),t.classList.add("selected")}}))})}};function selectRadio(t,e){document.querySelectorAll('[data-group="'+t+'"] .vt-radio').forEach(function(a){a.classList.remove("selected")});var o=e.querySelector(".vt-radio");o&&!o.classList.contains("disabled")&&o.classList.add("selected")}var UCTabs={activate:function(t,e){t.querySelectorAll('[role="tab"]').forEach(function(o){var a=o.getAttribute("data-tab")===e;o.setAttribute("aria-selected",a?"true":"false"),o.setAttribute("tabindex",a?"0":"-1"),o.classList.toggle("vt-active",a)}),t.querySelectorAll('[role="tabpanel"]').forEach(function(o){o.classList.toggle("vt-hidden",o.getAttribute("data-panel")!==e)})},init:function(){document.querySelectorAll("[data-tab-group]").forEach(function(t){t.hasAttribute("data-tabs-bound")||(t.setAttribute("data-tabs-bound","true"),t.querySelectorAll('[role="tab"]').forEach(function(e){e.addEventListener("click",function(){UCTabs.activate(t,e.getAttribute("data-tab"))})}))}),document.body.hasAttribute("data-tabs-keyboard-init")||(document.body.setAttribute("data-tabs-keyboard-init","true"),document.addEventListener("keydown",function(t){var e=t.target;if(!(!e||e.getAttribute("role")!=="tab")){var o=e.closest('[role="tablist"]');if(o){var a=Array.prototype.slice.call(o.querySelectorAll('[role="tab"]')),r=a.indexOf(e),n=-1;t.key==="ArrowRight"||t.key==="ArrowDown"?n=(r+1)%a.length:t.key==="ArrowLeft"||t.key==="ArrowUp"?n=(r-1+a.length)%a.length:t.key==="Home"?n=0:t.key==="End"&&(n=a.length-1),n>=0&&(t.preventDefault(),a[n].focus(),a[n].click())}}}))}},UCCollapsible={init:function(){document.querySelectorAll("[data-collapsible][data-collapsible-open]").forEach(function(t){var e=t.querySelector("[data-collapsible-content]"),o=t.querySelector("[data-collapsible-icon]");e&&(e.classList.remove("vt-hidden"),t.hasAttribute("data-collapsible-animated")&&(e.style.maxHeight=e.scrollHeight+"px")),o&&o.classList.add("vt-rotate-180")}),document.querySelectorAll("[data-collapsible-trigger]").forEach(function(t){t.hasAttribute("data-collapsible-bound")||(t.setAttribute("data-collapsible-bound","true"),t.addEventListener("click",function(){var e=t.closest("[data-collapsible]"),o=e.querySelector(":scope > [data-collapsible-content]");o||(o=e.querySelector("[data-collapsible-content]"));var a=e.querySelector(":scope > * [data-collapsible-icon]")||e.querySelector("[data-collapsible-icon]"),r=e.hasAttribute("data-collapsible-animated"),n=t.querySelector("[data-collapsible-label-collapse]"),i=t.querySelector("[data-collapsible-label-expand]"),s;r?s=parseInt(o.style.maxHeight)>0:s=!o.classList.contains("vt-hidden"),s?(r?o.style.maxHeight="0":o.classList.add("vt-hidden"),a&&a.classList.remove("vt-rotate-180"),n&&n.classList.add("vt-hidden"),i&&i.classList.remove("vt-hidden"),e.removeAttribute("data-collapsible-open")):(r?o.style.maxHeight=o.scrollHeight+"px":o.classList.remove("vt-hidden"),a&&a.classList.add("vt-rotate-180"),n&&n.classList.remove("vt-hidden"),i&&i.classList.add("vt-hidden"),e.setAttribute("data-collapsible-open",""))}))})}},UCCombobox={init:function(){var t='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="vt-w-4 vt-h-4 vt-shrink-0 vt-text-accents-brand vt-combobox-icon"><path d="M20 6 9 17l-5-5"/></svg>',e='<span class="vt-w-4 vt-h-4 vt-shrink-0 vt-combobox-icon"></span>',o='<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="vt-w-3 vt-h-3"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg>';document.body.hasAttribute("data-combobox-outside-init")||(document.body.setAttribute("data-combobox-outside-init","true"),document.addEventListener("click",function(r){r.target.closest(".vt-combobox-wrapper")||document.querySelectorAll("[data-combobox-content]").forEach(function(n){n.classList.remove("vt-open")})})),window.openCombobox=function(r){var n=document.getElementById(r);n&&n.classList.add("vt-open")},window.toggleCombobox=function(r){var n=document.getElementById(r);n&&n.classList.toggle("vt-open")},window.filterCombobox=function(r,n){var i=document.getElementById(n),s=r.value.toLowerCase(),d=i.querySelectorAll(".vt-combobox-item"),c=i.querySelectorAll("[data-combobox-group]"),l=i.querySelector(".vt-combobox-empty"),u=0;c.length>0?c.forEach(function(v){var f=v.querySelectorAll(".vt-combobox-item"),b=0;f.forEach(function(m){m.textContent.toLowerCase().includes(s)?(m.classList.remove("vt-hidden"),b++,u++):m.classList.add("vt-hidden")}),v.style.display=b>0?"":"none"}):d.forEach(function(v){v.textContent.toLowerCase().includes(s)?(v.classList.remove("vt-hidden"),u++):v.classList.add("vt-hidden")}),l&&l.classList.toggle("vt-hidden",u>0||!s)};function a(r,n){var i=r.querySelector(".vt-combobox-icon");i&&(i.outerHTML=n?t:e)}window.selectComboboxItem=function(r){var n=r.textContent.trim(),i=r.closest(".vt-combobox-wrapper"),s=i.hasAttribute("data-keep-icons"),d=i.querySelector("input"),c=r.closest("[data-combobox-content]");d.value=n,c.querySelectorAll(".vt-combobox-item").forEach(function(l){l.classList.remove("vt-selected"),s||a(l,!1)}),r.classList.add("vt-selected"),s||a(r,!0),c.classList.remove("vt-open")},window.selectComboboxButton=function(r,n){var i=r.textContent.trim(),s=r.closest(".vt-combobox-wrapper"),d=s.querySelector(".vt-combobox-button-label"),c=document.getElementById(n);d.textContent=i,d.classList.remove("vt-text-mains-quaternary"),c.querySelectorAll(".vt-combobox-item").forEach(function(l){l.classList.remove("vt-selected"),a(l,!1)}),r.classList.add("vt-selected"),a(r,!0),c.classList.remove("vt-open")},window.toggleMultiComboboxItem=function(r){var n=r.classList.toggle("vt-selected");a(r,n);var i=r.closest(".vt-combobox-wrapper"),s=i.querySelector(".vt-combobox-tags"),d=r.textContent.trim();if(n){var c=document.createElement("span");c.className="vt-combobox-tag vt-inline-flex vt-items-center vt-gap-1 vt-rounded vt-bg-surfaces-subtle vt-px-2 vt-py-0.5 vt-text-xs vt-font-medium",c.setAttribute("data-tag-value",d),c.appendChild(document.createTextNode(d));var l=document.createElement("button");l.type="button",l.className="vt-ml-0.5 vt-rounded-sm vt-hover:bg-surfaces-moderate vt-transition-colors",l.innerHTML=o,l.addEventListener("click",function(v){v.stopPropagation(),window.removeComboboxTag(l)}),c.appendChild(l),s.insertBefore(c,s.querySelector("input"))}else{var u=s.querySelector('[data-tag-value="'+d+'"]');u&&u.remove()}UCCombobox._updateMultiPlaceholder(i)},window.removeComboboxTag=function(r){var n=r.closest(".vt-combobox-tag");if(n){var i=n.getAttribute("data-tag-value"),s=n.closest(".vt-combobox-wrapper");n.remove();var d=s.querySelector("[data-combobox-content]");d&&d.querySelectorAll(".vt-combobox-item").forEach(function(c){c.textContent.trim()===i&&(c.classList.remove("vt-selected"),a(c,!1))}),UCCombobox._updateMultiPlaceholder(s)}}},_updateMultiPlaceholder:function(t){var e=t.querySelector("input"),o=t.querySelectorAll(".vt-combobox-tag");e&&(e.placeholder=o.length>0?"":"Add framework...")}},UCResizable={init:function(){document.querySelectorAll("[data-resizable]").forEach(function(t){if(!t.hasAttribute("data-resizable-init")){t.setAttribute("data-resizable-init","true");var e=t.dataset.resizable,o=e==="horizontal",a=parseFloat(t.dataset.min||"10"),r=parseFloat(t.dataset.max||"90"),n=t.querySelectorAll(":scope > .vt-resize-handle");n.forEach(function(i){var s=!1,d=0,c=null,l=null,u=0,v=0,f=0;i.addEventListener("mousedown",function(b){b.preventDefault(),s=!0,c=i.previousElementSibling,l=i.nextElementSibling,!(!c||!l)&&(u=o?t.offsetWidth:t.offsetHeight,v=o?c.offsetWidth:c.offsetHeight,f=o?l.offsetWidth:l.offsetHeight,d=o?b.clientX:b.clientY,document.body.style.cursor=o?"col-resize":"row-resize",document.body.style.userSelect="none",i.style.background="hsl(var(--accents-brand) / 0.5)")}),document.addEventListener("mousemove",function(b){if(!(!s||!c||!l)){var m=(o?b.clientX:b.clientY)-d,p=v+m,h=f-m,y=u*(a/100),g=u*(r/100);p<y&&(p=y,h=v+f-y),h<y&&(h=y,p=v+f-y),p>g&&(p=g,h=v+f-g),h>g&&(h=g,p=v+f-g);var x=(p/u*100).toFixed(1),A=(h/u*100).toFixed(1);o?(c.style.width=x+"%",l.style.width=A+"%"):(c.style.height=x+"%",l.style.height=A+"%"),c.style.flex="none",l.style.flex="none";var L=c.querySelector(".vt-size-label"),w=l.querySelector(".vt-size-label");L&&(L.textContent=Math.round(parseFloat(x))+"%"),w&&(w.textContent=Math.round(parseFloat(A))+"%")}}),document.addEventListener("mouseup",function(){s&&(s=!1,document.body.style.cursor="",document.body.style.userSelect="",i.style.background="")})})}})}},UCCarousel={init:function(){document.querySelectorAll("[data-carousel]").forEach(function(t){if(t.hasAttribute("data-carousel-init"))return;t.setAttribute("data-carousel-init","true");var e=t,o=e.querySelector("[data-carousel-track]"),a=e.querySelector("[data-carousel-prev]"),r=e.querySelector("[data-carousel-next]"),n=e.querySelector("[data-carousel-dots]"),i=parseInt(e.dataset.total||"0"),s=parseInt(e.dataset.visible||"1"),d=i-s,c=0;function l(){if(s===1)o.style.transform="translateX(-"+c*100+"%)";else{var u=o.children[0],v=parseFloat(getComputedStyle(o).gap)||0,f=c*(u.offsetWidth+v);o.style.transform="translateX(-"+f+"px)"}n&&n.querySelectorAll("[data-dot]").forEach(function(b){var m=parseInt(b.dataset.dot||"0");b.className="vt-w-2 vt-h-2 vt-rounded-full vt-transition-colors "+(m===c?"vt-bg-accents-brand":"vt-bg-surfaces-moderate")}),a&&(a.style.opacity=c===0?"0.4":"1"),r&&(r.style.opacity=c>=d?"0.4":"1")}a&&a.addEventListener("click",function(){c>0&&(c--,l())}),r&&r.addEventListener("click",function(){c<d&&(c++,l())}),n&&n.querySelectorAll("[data-dot]").forEach(function(u){u.addEventListener("click",function(){c=Math.min(parseInt(u.dataset.dot||"0"),d),l()})}),l()})}},UCDropdown={init:function(){document.body.hasAttribute("data-dropdowns-init")||(document.body.setAttribute("data-dropdowns-init","true"),document.addEventListener("click",function(t){!t.target.closest("[data-dropdown-trigger]")&&!t.target.closest(".vt-dropdown-menu")&&document.querySelectorAll(".vt-dropdown-menu").forEach(function(e){e.closest(".vt-combobox-wrapper")||e.classList.remove("vt-open")})}),document.addEventListener("keydown",function(t){t.key==="Escape"&&(document.querySelectorAll(".vt-dropdown-menu.vt-open").forEach(function(e){e.classList.remove("vt-open")}),document.querySelectorAll("[data-dropdown-trigger]").forEach(function(e){e.setAttribute("aria-expanded","false")}))})),document.querySelectorAll("[data-dropdown-trigger]").forEach(function(t){if(!t.hasAttribute("data-dropdown-bound")){t.setAttribute("data-dropdown-bound","true");var e=t.getAttribute("data-dropdown-trigger");t.setAttribute("aria-haspopup","menu"),t.setAttribute("aria-expanded","false"),e&&t.setAttribute("aria-controls",e),t.addEventListener("click",function(o){o.stopPropagation();var a=document.getElementById(e);if(a){document.querySelectorAll(".vt-dropdown-menu").forEach(function(n){n!==a&&n.classList.remove("vt-open")});var r=!a.classList.contains("vt-open");a.classList.toggle("vt-open"),t.setAttribute("aria-expanded",r?"true":"false")}})}})}};function toggleCheckbox(t){var e=t.querySelector(".checkbox-indicator"),o=e.classList.contains("vt-bg-accents-brand");o?(e.classList.remove("vt-bg-accents-brand","vt-text-generic-white","vt-border-transparent"),e.innerHTML="",t.setAttribute("aria-checked","false")):(e.classList.add("vt-bg-accents-brand","vt-text-generic-white","vt-border-transparent"),e.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="vt-w-3 vt-h-3"><path d="M20 6 9 17l-5-5"/></svg>',t.setAttribute("aria-checked","true"))}function selectMenuRadio(t){var e=t.closest(".vt-dropdown-menu");e.querySelectorAll(".radio-indicator").forEach(function(a){a.classList.remove("vt-border-accents-brand"),a.classList.add("vt-border-input"),a.innerHTML=""});var o=t.querySelector(".radio-indicator");o.classList.remove("vt-border-input"),o.classList.add("vt-border-accents-brand"),o.innerHTML='<div class="vt-w-2 vt-h-2 vt-rounded-full vt-bg-accents-brand"></div>'}var UCScrollView={init:function(){document.querySelectorAll(".vt-drag-scroll").forEach(function(t){if(!t.hasAttribute("data-drag-init")){t.setAttribute("data-drag-init","true");var e=!1,o=0,a=0;t.addEventListener("mousedown",function(r){e=!0,t.style.cursor="grabbing",t.style.userSelect="none",o=r.pageX-t.offsetLeft,a=t.scrollLeft}),t.addEventListener("mouseleave",function(){e=!1,t.style.cursor="grab",t.style.userSelect=""}),t.addEventListener("mouseup",function(){e=!1,t.style.cursor="grab",t.style.userSelect=""}),t.addEventListener("mousemove",function(r){if(e){r.preventDefault();var n=r.pageX-t.offsetLeft,i=(n-o)*1.5;t.scrollLeft=a-i}})}}),document.querySelectorAll(".vt-scroll-indicator").forEach(function(t){if(!t.hasAttribute("data-indicator-init")){t.setAttribute("data-indicator-init","true");var e=t.querySelector(".vt-scroll, .vt-scroll-hidden, .vt-scroll-autohide");e&&e.addEventListener("scroll",function(){var o=e.scrollTop,a=e.scrollHeight,r=e.clientHeight;t.classList.toggle("vt-show-top",o>8),t.classList.toggle("vt-show-bottom",o<a-r-8)})}}),document.querySelectorAll(".vt-scroll-indicator-h").forEach(function(t){if(!t.hasAttribute("data-indicator-h-init")){t.setAttribute("data-indicator-h-init","true");var e=t.querySelector('.vt-scroll, .vt-scroll-hidden, .vt-scroll-autohide, [class*="vt-overflow-x"]');e&&e.addEventListener("scroll",function(){var o=e.scrollLeft,a=e.scrollWidth,r=e.clientWidth;t.classList.toggle("vt-show-left",o>8),t.classList.toggle("vt-show-right",o<a-r-8)})}})}},UCNumberInput={init:function(){document.querySelectorAll("[data-number-input]").forEach(function(t){if(t.hasAttribute("data-ni-bound"))return;t.setAttribute("data-ni-bound","true");var e=t.querySelector("[data-number-value]"),o=t.querySelector('[data-action="decrement"]'),a=t.querySelector('[data-action="increment"]');if(!e)return;function r(){var i=parseInt(e.value)||0,s=e.hasAttribute("min")?parseInt(e.min):-1/0,d=e.hasAttribute("max")?parseInt(e.max):1/0;o&&(o.disabled=i<=s),a&&(a.disabled=i>=d)}function n(i){var s=parseInt(e.value)||0,d=e.hasAttribute("min")?parseInt(e.min):-1/0,c=e.hasAttribute("max")?parseInt(e.max):1/0,l=Math.min(Math.max(s+i,d),c);e.value=l,r()}o&&o.addEventListener("click",function(){n(-1)}),a&&a.addEventListener("click",function(){n(1)}),e.addEventListener("change",function(){var i=e.hasAttribute("min")?parseInt(e.min):-1/0,s=e.hasAttribute("max")?parseInt(e.max):1/0,d=parseInt(e.value)||i;e.value=Math.min(Math.max(d,i),s),r()}),r()})}},UCPopover={init:function(){document.querySelectorAll("[data-popover-trigger]").forEach(function(t){var e=t.getAttribute("data-popover-trigger");t.setAttribute("aria-haspopup","dialog"),t.setAttribute("aria-expanded","false"),e&&t.setAttribute("aria-controls",e),t.onclick=function(o){o.stopPropagation();var a=e?document.getElementById(e):null;if(a){var r=a.classList.contains("vt-open");document.querySelectorAll(".vt-popover-content").forEach(function(n){n.classList.remove("vt-open")}),document.querySelectorAll("[data-popover-trigger]").forEach(function(n){n.setAttribute("aria-expanded","false")}),r||(a.classList.add("vt-open"),t.setAttribute("aria-expanded","true"))}}}),document.body.hasAttribute("data-popover-outside-init")||(document.body.setAttribute("data-popover-outside-init","true"),document.addEventListener("click",function(t){var e=t.target;!e.closest(".vt-popover-content")&&!e.closest("[data-popover-trigger]")&&(document.querySelectorAll(".vt-popover-content").forEach(function(o){o.classList.remove("vt-open")}),document.querySelectorAll("[data-popover-trigger]").forEach(function(o){o.setAttribute("aria-expanded","false")}))}),document.addEventListener("keydown",function(t){t.key==="Escape"&&(document.querySelectorAll(".vt-popover-content").forEach(function(e){e.classList.remove("vt-open")}),document.querySelectorAll("[data-popover-trigger]").forEach(function(e){e.setAttribute("aria-expanded","false")}))}))}},UCSelect={init:function(){document.body.hasAttribute("data-select-init")||(document.body.setAttribute("data-select-init","true"),document.addEventListener("click",function(t){t.target.closest(".vt-select-wrapper")||document.querySelectorAll(".vt-select-dropdown").forEach(function(e){e.classList.remove("open")})}))}};function toggleSelect(t){var e=document.getElementById(t);document.querySelectorAll(".vt-select-dropdown").forEach(function(o){o.id!==t&&o.classList.remove("open")}),e.classList.toggle("open")}function selectItem(t,e,o){document.getElementById(e).querySelector("span").textContent=o,document.getElementById(e).querySelector("span").classList.remove("placeholder");var a=document.getElementById(t);a.querySelectorAll(".vt-select-item").forEach(function(r){r.classList.remove("selected")}),a.querySelectorAll(".vt-select-item").forEach(function(r){r.textContent.trim()===o&&r.classList.add("selected")}),a.classList.remove("open")}var UCSlider={init:function(){document.querySelectorAll('input[type="range"]').forEach(function(t){if(t.hasAttribute("data-slider-init"))return;t.setAttribute("data-slider-init","true");function e(){var o=parseFloat(t.min||"0"),a=parseFloat(t.max||"100"),r=parseFloat(t.value||"0"),n=a>o?(r-o)/(a-o)*100:0;t.style.setProperty("--slider-progress",n+"%")}e(),t.addEventListener("input",e)})}},UCToast={_count:0,show:function(t){var e=document.getElementById("toast-container");e||(e=document.createElement("div"),e.id="toast-container",e.className="vt-fixed vt-bottom-4 vt-right-4 vt-z-50 vt-flex vt-flex-col vt-items-end",document.body.appendChild(e));var o="toast-"+ ++UCToast._count,a={default:{title:"Scheduled: Catch up",desc:"Friday, February 14, 2026 at 5:57 PM",icon:"",btn:"Undo"},success:{title:"Success",desc:"Your changes have been saved.",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="vt-w-5 vt-h-5 vt-text-accents-brand"><path d="M22 11.08V12a10 10 0 1 1-5.93-9.14"/><path d="M22 4 12 14.01l-3-3"/></svg>',btn:""},error:{title:"Error",desc:"Something went wrong. Please try again.",icon:'<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="vt-w-5 vt-h-5 vt-text-error-primary"><circle cx="12" cy="12" r="10"/><line x1="12" x2="12" y1="8" y2="12"/><line x1="12" x2="12.01" y1="16" y2="16"/></svg>',btn:"Retry"},action:{title:"Event created",desc:"Sunday, December 03, 2023",icon:"",btn:"Undo"}},r=a[t]||a.default,n=document.createElement("div");n.id=o,n.className="vt-flex vt-items-start vt-gap-3 vt-w-80 vt-p-4 vt-rounded-lg vt-border vt-border-border-default vt-bg-surfaces-surface vt-shadow-lg vt-mb-2",n.setAttribute("role",t==="error"?"alert":"status"),n.setAttribute("aria-live",t==="error"?"assertive":"polite"),n.setAttribute("aria-atomic","true"),n.innerHTML=(r.icon?'<div class="vt-flex-shrink-0 vt-mt-0.5">'+r.icon+"</div>":"")+'<div class="vt-flex-1 vt-min-w-0"><p class="vt-text-sm vt-font-semibold">'+r.title+'</p><p class="vt-text-xs vt-text-mains-quaternary vt-mt-0.5">'+r.desc+"</p></div>"+(r.btn?'<button onclick="this.parentElement.remove()" class="vt-flex-shrink-0 vt-inline-flex vt-items-center vt-justify-center vt-rounded-lg vt-text-xs vt-font-medium vt-h-7 vt-px-2 vt-border vt-border-border-strong vt-bg-surfaces-surface vt-hover:bg-surfaces-subtle vt-transition-colors">'+r.btn+"</button>":"")+'<button onclick="this.parentElement.remove()" aria-label="Close" class="vt-flex-shrink-0 vt-p-0.5 vt-text-mains-quaternary vt-hover:text-mains-primary vt-transition-colors"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="vt-w-3.5 vt-h-3.5"><path d="M18 6 6 18"/><path d="m6 6 12 12"/></svg></button>',e.appendChild(n),setTimeout(function(){var i=document.getElementById(o);i&&i.remove()},4e3)},init:function(){window.showToast=function(t){UCToast.show(t)}}},UCDialog={init:function(){window.openDialog=function(t){var e=document.getElementById(t);if(e){e._keyHandler&&document.removeEventListener("keydown",e._keyHandler),e._previousFocus=document.activeElement,e.classList.add("vt-open"),e.removeAttribute("aria-hidden"),e.setAttribute("role","dialog"),e.setAttribute("aria-modal","true");var o=e.querySelector('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');o&&o.focus(),e._keyHandler=function(a){if(a.key==="Escape"){window.closeDialog(t);return}if(a.key==="Tab"){var r=e.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'),n=r[0],i=r[r.length-1];a.shiftKey&&document.activeElement===n?(a.preventDefault(),i.focus()):!a.shiftKey&&document.activeElement===i&&(a.preventDefault(),n.focus())}},document.addEventListener("keydown",e._keyHandler)}},window.closeDialog=function(t){var e=document.getElementById(t);e&&(e.classList.remove("vt-open"),e.setAttribute("aria-hidden","true"),e._keyHandler&&document.removeEventListener("keydown",e._keyHandler),e._previousFocus&&typeof e._previousFocus.focus=="function"&&e._previousFocus.focus(),e._keyHandler=null,e._previousFocus=null)}}},UCTreeView={init:function(){document.querySelectorAll("[data-tree]").forEach(function(t){t.hasAttribute("data-tree-bound")||(t.setAttribute("data-tree-bound","true"),t.querySelectorAll("[data-tree-branch]").forEach(function(e){var o=e.querySelector(":scope > .vt-tree-toggle");o&&o.addEventListener("click",function(){e.classList.toggle("open")})}))})}};(function(){function t(){UCAccordion.init(),UCCalendar.init(),UCChip.init(),UCRadioGroup.init(),UCTabs.init(),UCCollapsible.init(),UCCombobox.init(),UCResizable.init(),UCCarousel.init(),UCDropdown.init(),UCScrollView.init(),UCNumberInput.init(),UCPopover.init(),UCSelect.init(),UCSlider.init(),UCToast.init(),UCDialog.init(),UCTreeView.init()}document.readyState==="loading"?document.addEventListener("DOMContentLoaded",t):t(),document.addEventListener("astro:after-swap",function(){t()})})();