iron-cms 0.3.0 → 0.4.1

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.
Files changed (53) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/builds/iron.css +1468 -1447
  3. data/app/assets/tailwind/iron/application.css +12 -1
  4. data/app/assets/tailwind/iron/components/button.css +110 -60
  5. data/app/assets/tailwind/iron/components/input.css +11 -9
  6. data/app/assets/tailwind/iron/components/sidebar.css +13 -17
  7. data/app/helpers/iron/application_helper.rb +1 -1
  8. data/app/helpers/iron/form_builder.rb +46 -0
  9. data/app/javascript/iron/application.js +2 -0
  10. data/app/models/iron/entry/web_publishable.rb +12 -12
  11. data/app/views/iron/block_definitions/_form.html.erb +1 -1
  12. data/app/views/iron/block_definitions/index.html.erb +1 -1
  13. data/app/views/iron/block_definitions/show.html.erb +3 -3
  14. data/app/views/iron/content_types/_form.html.erb +1 -1
  15. data/app/views/iron/content_types/index.html.erb +4 -7
  16. data/app/views/iron/content_types/show.html.erb +3 -9
  17. data/app/views/iron/contents/new.html.erb +2 -2
  18. data/app/views/iron/entries/_form.html.erb +45 -37
  19. data/app/views/iron/entries/edit.html.erb +2 -12
  20. data/app/views/iron/entries/fields/_block.html.erb +3 -4
  21. data/app/views/iron/entries/fields/_block_list.html.erb +26 -17
  22. data/app/views/iron/entries/fields/_reference_item.html.erb +2 -3
  23. data/app/views/iron/entries/fields/_text_field.html.erb +1 -1
  24. data/app/views/iron/entries/index.html.erb +1 -1
  25. data/app/views/iron/field_definitions/_field_definition.html.erb +1 -2
  26. data/app/views/iron/field_definitions/edit.html.erb +1 -7
  27. data/app/views/iron/field_definitions/layouts/_form.html.erb +1 -1
  28. data/app/views/iron/first_runs/show.html.erb +1 -1
  29. data/app/views/iron/locales/_form.html.erb +1 -1
  30. data/app/views/iron/locales/_locale.html.erb +1 -1
  31. data/app/views/iron/locales/index.html.erb +1 -1
  32. data/app/views/iron/passwords/edit.html.erb +31 -6
  33. data/app/views/iron/passwords/new.html.erb +19 -18
  34. data/app/views/iron/schemas/new.html.erb +2 -2
  35. data/app/views/iron/sessions/new.html.erb +27 -26
  36. data/app/views/iron/settings/show.html.erb +3 -4
  37. data/app/views/iron/shared/_collection_select.html.erb +31 -0
  38. data/app/views/iron/users/_form.html.erb +1 -1
  39. data/app/views/iron/users/new.html.erb +1 -1
  40. data/app/views/iron/users/show.html.erb +1 -4
  41. data/app/views/layouts/iron/_mobile_header.html.erb +10 -0
  42. data/app/views/layouts/iron/_sidebar.html.erb +26 -81
  43. data/app/views/layouts/iron/_sidebar_content.html.erb +36 -0
  44. data/app/views/layouts/iron/_sidebar_item.html.erb +1 -5
  45. data/app/views/layouts/iron/_user_menu.html.erb +26 -0
  46. data/app/views/layouts/iron/application.html.erb +11 -27
  47. data/app/views/layouts/iron/authentication.html.erb +4 -21
  48. data/config/importmap.rb +1 -0
  49. data/lib/iron/version.rb +1 -1
  50. data/vendor/javascript/@tailwindplus--elements.js +4 -0
  51. data/vendor/javascript/trix.js +5 -0
  52. metadata +8 -3
  53. data/app/helpers/iron/components/dropdown_helper.rb +0 -161
@@ -0,0 +1,26 @@
1
+ <%# locals: (class: nil, anchor: "bottom end", show_name: true) -%>
2
+
3
+ <el-dropdown class="block">
4
+ <button class="<%= local_assigns[:class] %>">
5
+ <%= avatar Iron::Current.user, class: "size-8 bg-stone-50 outline -outline-offset-1 outline-black/5 dark:bg-stone-800 dark:outline-white/10" %>
6
+ <span class="sr-only">Your profile</span>
7
+ <% if show_name %>
8
+ <span aria-hidden="true"><%= Iron::Current.user.name %></span>
9
+ <% end %>
10
+ </button>
11
+
12
+ <el-menu anchor="<%= anchor %>" popover class="<%= anchor.include?('top') ? 'mx-2' : '' %> w-56 origin-bottom-right divide-y divide-stone-100 rounded-md bg-white shadow-lg outline-1 outline-black/5 transition transition-discrete [--anchor-gap:--spacing(2)] data-closed:scale-95 data-closed:transform data-closed:opacity-0 data-enter:duration-100 data-enter:ease-out data-leave:duration-75 data-leave:ease-in dark:divide-white/10 dark:bg-stone-800 dark:shadow-none dark:-outline-offset-1 dark:outline-white/10">
13
+ <div class="py-1">
14
+ <a href="#" class="group/item flex items-center px-4 py-2 text-sm text-stone-700 focus:bg-stone-100 focus:text-stone-900 focus:outline-hidden dark:text-stone-300 dark:focus:bg-white/5 dark:focus:text-white">
15
+ <%= icon "circle-user", class: "mr-3 size-5 text-stone-400 group-focus/item:text-stone-500 dark:text-stone-500 dark:group-focus/item:text-white" %>
16
+ My account
17
+ </a>
18
+ </div>
19
+ <div class="py-1">
20
+ <%= link_to session_path, method: :delete, class: "group/item flex items-center px-4 py-2 text-sm text-stone-700 focus:bg-stone-100 focus:text-stone-900 focus:outline-hidden dark:text-stone-300 dark:focus:bg-white/5 dark:focus:text-white" do %>
21
+ <%= icon "log-out", class: "mr-3 size-5 text-stone-400 group-focus/item:text-stone-500 dark:text-stone-500 dark:group-focus/item:text-white" %>
22
+ Sign out
23
+ <% end %>
24
+ </div>
25
+ </el-menu>
26
+ </el-dropdown>
@@ -1,10 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html
3
- class="
4
- text-stone-950 antialiased lg:bg-stone-100 dark:bg-stone-900 dark:text-white
5
- dark:lg:bg-stone-950
6
- "
7
- >
2
+ <html class="h-full bg-stone-50 text-stone-950 antialiased dark:bg-stone-900 dark:text-white">
8
3
  <head>
9
4
  <title><%= content_for(:title).present? ? "#{content_for(:title)} | Iron CMS" : "Iron CMS" %></title>
10
5
  <%= csrf_meta_tags %>
@@ -19,27 +14,16 @@
19
14
 
20
15
  <%= yield :head %>
21
16
  </head>
22
- <body>
23
- <div
24
- class="
25
- relative isolate flex min-h-svh w-full bg-white max-lg:flex-col lg:bg-stone-100
26
- dark:bg-stone-900 dark:lg:bg-stone-950
27
- "
28
- >
29
- <%= render "layouts/iron/sidebar" %>
30
- <main class="flex flex-1 flex-col pb-2 lg:min-w-0 lg:pl-64 lg:pr-2 lg:pt-2">
31
- <div
32
- class="
33
- grow p-6 lg:rounded-lg lg:bg-white lg:p-10 lg:shadow-xs lg:ring-1
34
- lg:ring-stone-950/5 dark:lg:bg-stone-900 dark:lg:ring-white/10
35
- "
36
- >
37
- <div class="mx-auto max-w-6xl">
38
- <%= yield %>
39
- </div>
40
- </div>
41
- </main>
42
- </div>
17
+ <body class="h-full">
18
+ <%= render "layouts/iron/sidebar" %>
19
+
20
+ <%= render "layouts/iron/mobile_header" %>
21
+
22
+ <main class="py-10 lg:pl-72">
23
+ <div class="px-4 sm:px-6 lg:px-8">
24
+ <%= yield %>
25
+ </div>
26
+ </main>
43
27
 
44
28
  <%= render "layouts/iron/toast" %>
45
29
  </body>
@@ -1,9 +1,5 @@
1
1
  <!DOCTYPE html>
2
- <html
3
- class="
4
- text-stone-950 antialiased bg-stone-100 dark:bg-stone-950 dark:text-white
5
- "
6
- >
2
+ <html class="h-full bg-white dark:bg-stone-900">
7
3
  <head>
8
4
  <title><%= content_for(:title).present? ? "#{content_for(:title)} | Iron CMS" : "Iron CMS" %></title>
9
5
  <%= csrf_meta_tags %>
@@ -18,22 +14,9 @@
18
14
 
19
15
  <%= yield :head %>
20
16
  </head>
21
- <body>
22
- <div
23
- class="
24
- flex min-h-svh items-center justify-center bg-stone-100 p-6 dark:bg-stone-950
25
- "
26
- >
27
- <div class="w-full max-w-md">
28
- <div
29
- class="
30
- rounded-lg bg-white p-8 shadow-xs ring-1 ring-stone-950/5 dark:bg-stone-900
31
- dark:ring-white/10
32
- "
33
- >
34
- <%= yield %>
35
- </div>
36
- </div>
17
+ <body class="h-full">
18
+ <div class="flex min-h-full flex-col justify-center px-6 py-12 lg:px-8">
19
+ <%= yield %>
37
20
  </div>
38
21
 
39
22
  <%= render "layouts/iron/toast" %>
data/config/importmap.rb CHANGED
@@ -7,3 +7,4 @@ pin "@rails/actiontext", to: "actiontext.esm.js"
7
7
 
8
8
  pin_all_from Iron::Engine.root.join("app/javascript/iron/lib"), under: "lib", to: "iron/lib"
9
9
  pin_all_from Iron::Engine.root.join("app/javascript/iron/controllers"), under: "controllers", to: "iron/controllers"
10
+ pin "@tailwindplus/elements", to: "@tailwindplus--elements.js" # @1.0.18
data/lib/iron/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Iron
2
- VERSION = "0.3.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -0,0 +1,4 @@
1
+ // @tailwindplus/elements@1.0.18 downloaded from https://ga.jspm.io/npm:@tailwindplus/elements@1.0.18/dist/index.js
2
+
3
+ var e=Object.defineProperty;var t=e=>{throw TypeError(e)};var n=(t,n,o)=>n in t?e(t,n,{enumerable:!0,configurable:!0,writable:!0,value:o}):t[n]=o;var o=(e,t,o)=>n(e,typeof t!="symbol"?t+"":t,o),a=(e,n,o)=>n.has(e)||t("Cannot "+o);var l=(e,t,n)=>(a(e,t,"read from private field"),n?n.call(e):t.get(e)),s=(e,n,o)=>n.has(e)?t("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(e):n.set(e,o),u=(e,t,n,o)=>(a(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),c=(e,t,n)=>(a(e,t,"access private method"),n);if(typeof globalThis.window<"u"){let e=!1;document.addEventListener("submit",(t=>{if(e){e=!1;return}let n=t.target;if(n&&n.method==="dialog"){let o=n.closest("el-dialog");if(!o||!("beforeClose"in o))return;let a=o.beforeClose();if(a===!0||(t.preventDefault(),t.stopImmediatePropagation(),a===!1))return;a.then((o=>{o&&(e=!0,n.dispatchEvent(t))})).catch(console.error)}}),!0)}var d=class extends Event{constructor(e,{oldState:t="",newState:n="",...a}={}){super(e,a);o(this,"oldState");o(this,"newState");this.oldState=String(t||""),this.newState=String(n||"")}},h=new WeakMap;function p(e,t,n){h.set(e,setTimeout((()=>{h.has(e)&&e.dispatchEvent(new d("toggle",{cancelable:!1,oldState:t,newState:n}))}),0))}var f=globalThis.ShadowRoot||function(){},m=globalThis.HTMLDialogElement||function(){},g=new WeakMap,b=new WeakMap,v=new WeakMap,w=new WeakMap;function y(e){return w.get(e)||"hidden"}var A=new WeakMap;function E(e){return[...e].pop()}function x(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=y(t);e.popoverTargetAction==="show"&&n==="showing"||e.popoverTargetAction==="hide"&&n==="hidden"||(n==="showing"?F(t,!0,!0):S(t,!1)&&(A.set(t,e),W(t)))}function S(e,t){return!(e.popover!=="auto"&&e.popover!=="manual"&&e.popover!=="hint"||!e.isConnected||t&&y(e)!=="showing"||!t&&y(e)!=="hidden"||e instanceof m&&e.hasAttribute("open")||document.fullscreenElement===e)}function T(e){if(!e)return 0;let t=b.get(document)||new Set,n=v.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function k(e){let t=P(e),n=C(e);return T(t)>T(n)?t:n}function L(e){let t,n=v.get(e)||new Set,o=b.get(e)||new Set,a=n.size>0?n:o.size>0?o:null;return a?(t=E(a),t.isConnected?t:(a.delete(t),L(e))):null}function I(e){for(let t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function D(e){return typeof e.getRootNode=="function"?e.getRootNode():e.parentNode?D(e.parentNode):e}function P(e){for(;e;){if(e instanceof HTMLElement&&e.popover==="auto"&&w.get(e)==="showing")return e;if(e=e instanceof Element&&e.assignedSlot||e.parentElement||D(e),e instanceof f&&(e=e.host),e instanceof Document)return}}function C(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if(e=e.parentElement||D(e),e instanceof f&&(e=e.host),e instanceof Document)return}}function M(e,t){let n=new Map,o=0;for(let e of t||[])n.set(e,o),o+=1;n.set(e,o),o+=1;let a=null;function l(t){if(!t)return;let o=!1,l=null,s=null;for(;!o;){if(l=P(t)||null,l===null||!n.has(l))return;(e.popover==="hint"||l.popover==="auto")&&(o=!0),o||(t=l.parentElement)}s=n.get(l),(a===null||n.get(a)<s)&&(a=l)}return l(e.parentElement||D(e)),a}function O(e){return!(e.hidden||e instanceof f||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&e.type==="hidden"||e instanceof HTMLAnchorElement&&e.href==="")&&(typeof e.tabIndex=="number"&&e.tabIndex!==-1)}function B(e){if(e.shadowRoot&&e.shadowRoot.delegatesFocus!==!0)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector("[autofocus]");if(n)return n;{let e=t.querySelectorAll("slot");for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e){if(t.hasAttribute("autofocus"))return t;if(n=t.querySelector("[autofocus]"),n)return n}}}let o=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),a=o.currentNode;for(;a;){if(O(a))return a;a=o.nextNode()}}function R(e){var t;(t=B(e))==null||t.focus()}var q=new WeakMap;function W(e){if(!S(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new d("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!S(e,!1))return;let n=!1,o=e.popover,a=null,l=M(e,b.get(t)||new Set),s=M(e,v.get(t)||new Set);if(o==="auto"&&(N(v.get(t)||new Set,n,!0),K(l||t,n,!0),a="auto"),o==="hint"&&(s?(K(s,n,!0),a="hint"):(N(v.get(t)||new Set,n,!0),l?(K(l,n,!0),a="auto"):a="hint")),o==="auto"||o==="hint"){if(o!==e.popover||!S(e,!1))return;L(t)||(n=!0),a==="auto"?(b.has(t)||b.set(t,new Set),b.get(t).add(e)):a==="hint"&&(v.has(t)||v.set(t,new Set),v.get(t).add(e))}q.delete(e);let u=t.activeElement;e.classList.add(":popover-open"),w.set(e,"showing"),g.has(t)||g.set(t,new Set),g.get(t).add(e),U(A.get(e),!0),R(e),n&&u&&e.popover==="auto"&&q.set(e,u),p(e,"closed","open")}function F(e,t=!1,n=!1){var o,a;if(!S(e,!0))return;let l=e.ownerDocument;if(["auto","hint"].includes(e.popover)&&(K(e,t,n),!S(e,!0)))return;let s=b.get(l)||new Set,u=s.has(e)&&E(s)===e;if(U(A.get(e),!1),A.delete(e),n&&(e.dispatchEvent(new d("beforetoggle",{oldState:"open",newState:"closed"})),u&&E(s)!==e&&K(e,t,n),!S(e,!0)))return;(o=g.get(l))==null||o.delete(e),s.delete(e),(a=v.get(l))==null||a.delete(e),e.classList.remove(":popover-open"),w.set(e,"hidden"),n&&p(e,"open","closed");let c=q.get(e);c&&(q.delete(e),t&&c.focus())}function H(e,t=!1,n=!1){let o=L(e);for(;o;)F(o,t,n),o=L(e)}function N(e,t=!1,n=!1){let o=I(e);for(;o;)F(o,t,n),o=I(e)}function $(e,t,n,o){let a=!1,l=!1;for(;a||!l;){l=!0;let s=null,u=!1;for(let n of t)if(n===e)u=!0;else if(u){s=n;break}if(!s)return;for(;y(s)==="showing"&&t.size;)F(E(t),n,o);t.has(e)&&E(t)!==e&&(a=!0),a&&(o=!1)}}function K(e,t,n){var o,a;let l=e.ownerDocument||e;if(e instanceof Document)return H(l,t,n);(o=v.get(l))!=null&&o.has(e)?$(e,v.get(l),t,n):(N(v.get(l)||new Set,t,n),(a=b.get(l))!=null&&a.has(e)&&$(e,b.get(l),t,n))}var j=new WeakMap;function V(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!L(n))return;let o=k(t);if(o&&e.type==="pointerdown")j.set(n,o);else if(e.type==="pointerup"){let e=j.get(n)===o;j.delete(n),e&&K(o||n,!1,!0)}}var z=new WeakMap;function U(e,t=!1){if(!e)return;z.has(e)||z.set(e,e.getAttribute("aria-expanded"));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&n.popover==="auto")e.setAttribute("aria-expanded",String(t));else{let t=z.get(e);t?e.setAttribute("aria-expanded",t):e.removeAttribute("aria-expanded")}}var G=globalThis.ShadowRoot||function(){};function Y(){return typeof HTMLElement<"u"&&typeof HTMLElement.prototype=="object"&&"popover"in HTMLElement.prototype}function Q(e,t,n){let o=e[t];Object.defineProperty(e,t,{value(e){return o.call(this,n(e))}})}var X=/(^|[^\\]):popover-open\b/g;function _(){return typeof globalThis.CSSLayerBlockRule=="function"}function J(){let e=_();return`\n${e?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${e?"}":""}\n`}var Z=null;function ee(e){let t=J();if(Z===null)try{Z=new CSSStyleSheet,Z.replaceSync(t)}catch{Z=!1}if(Z===!1){let n=document.createElement("style");n.textContent=t,e instanceof Document?e.head.prepend(n):e.prepend(n)}else e.adoptedStyleSheets=[Z,...e.adoptedStyleSheets]}function te(){if(typeof window>"u")return;window.ToggleEvent=window.ToggleEvent||d;function e(e){return e?.includes(":popover-open")&&(e=e.replace(X,"$1.\\:popover-open")),e}Q(Document.prototype,"querySelector",e),Q(Document.prototype,"querySelectorAll",e),Q(Element.prototype,"querySelector",e),Q(Element.prototype,"querySelectorAll",e),Q(Element.prototype,"matches",e),Q(Element.prototype,"closest",e),Q(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let e=(this.getAttribute("popover")||"").toLowerCase();return e===""||e=="auto"?"auto":e=="hint"?"hint":"manual"},set(e){e===null?this.removeAttribute("popover"):this.setAttribute("popover",e)}},showPopover:{enumerable:!0,configurable:!0,value(e={}){W(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){F(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e={}){return typeof e=="boolean"&&(e={force:e}),w.get(this)==="showing"&&e.force===void 0||e.force===!1?F(this,!0,!0):(e.force===void 0||e.force===!0)&&W(this),w.get(this)==="showing"}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=t.call(this,e);return ee(n),n}}});let n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=n.call(this);return e.shadowRoot&&ee(e.shadowRoot),e}}});let o=new WeakMap;function a(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(e===null)this.removeAttribute("popovertarget"),o.delete(this);else{if(!(e instanceof Element))throw new TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),o.set(this,e)}},get(){if(this.localName!=="button"&&this.localName!=="input"||this.localName==="input"&&this.type!=="reset"&&this.type!=="image"&&this.type!=="button"||this.disabled||this.form&&this.type==="submit")return null;let e=o.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return o.delete(this),null;let t=D(this),n=this.getAttribute("popovertarget");return(t instanceof Document||t instanceof G)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute("popovertargetaction")||"").toLowerCase();return e==="show"||e==="hide"?e:"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}})}a(HTMLButtonElement),a(HTMLInputElement);let l=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let o=D(n);if(!(o instanceof G||o instanceof Document))return;let a=t.find((e=>{var t;return(t=e.matches)==null?void 0:t.call(e,"[popovertargetaction],[popovertarget]")}));a&&(x(a),e.preventDefault())},s=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&(t==="Escape"||t==="Esc")&&K(n.ownerDocument,!0,!0)};(e=>{e.addEventListener("click",l),e.addEventListener("keydown",s),e.addEventListener("pointerdown",V),e.addEventListener("pointerup",V)})(document),ee(document)}function ne(){return typeof HTMLButtonElement<"u"&&"command"in HTMLButtonElement.prototype&&"source"in((globalThis.CommandEvent||{}).prototype||{})}function oe(){document.addEventListener("invoke",(e=>{e.type=="invoke"&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())}),!0),document.addEventListener("command",(e=>{e.type=="command"&&e.isTrusted&&(e.stopImmediatePropagation(),e.preventDefault())}),!0);function e(e,t,n=!0){Object.defineProperty(e,t,{...Object.getOwnPropertyDescriptor(e,t),enumerable:n})}function t(e){return e&&typeof e.getRootNode=="function"?e.getRootNode():e&&e.parentNode?t(e.parentNode):e}let n=new WeakMap,o=new WeakMap;class r extends Event{constructor(e,t={}){super(e,t);let{source:a,command:l}=t;if(a!=null&&!(a instanceof Element))throw new TypeError("source must be an element");n.set(this,a||null),o.set(this,l!==void 0?String(l):"")}get[Symbol.toStringTag](){return"CommandEvent"}get source(){if(!n.has(this))throw new TypeError("illegal invocation");let e=n.get(this);if(!(e instanceof Element))return null;let o=t(e);return o!==t(this.target||document)?o.host:e}get command(){if(!o.has(this))throw new TypeError("illegal invocation");return o.get(this)}get action(){throw new Error("CommandEvent#action was renamed to CommandEvent#command")}get invoker(){throw new Error("CommandEvent#invoker was renamed to CommandEvent#source")}}e(r.prototype,"source"),e(r.prototype,"command");class i extends Event{constructor(e,t={}){throw super(e,t),new Error("InvokeEvent has been deprecated, it has been renamed to `CommandEvent`")}}let a=new WeakMap;function l(e){Object.defineProperties(e.prototype,{commandForElement:{enumerable:!0,configurable:!0,set(e){if(this.hasAttribute("invokeaction"))throw new TypeError("Element has deprecated `invokeaction` attribute, replace with `command`");if(this.hasAttribute("invoketarget"))throw new TypeError("Element has deprecated `invoketarget` attribute, replace with `commandfor`");if(e===null)this.removeAttribute("commandfor"),a.delete(this);else{if(!(e instanceof Element))throw new TypeError("commandForElement must be an element or null");{this.setAttribute("commandfor","");let n=t(e);t(this)===n||n===this.ownerDocument?a.set(this,e):a.delete(this)}}},get(){if(this.localName!=="button")return null;if(this.hasAttribute("invokeaction")||this.hasAttribute("invoketarget"))return console.warn("Element has deprecated `invoketarget` or `invokeaction` attribute, use `commandfor` and `command` instead"),null;if(this.disabled)return null;if(this.form&&this.getAttribute("type")!=="button")return console.warn("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work"),null;let e=a.get(this);if(e)return e.isConnected?e:(a.delete(this),null);let n=t(this),o=this.getAttribute("commandfor");return(n instanceof Document||n instanceof ShadowRoot)&&o&&n.getElementById(o)||null}},command:{enumerable:!0,configurable:!0,get(){let e=this.getAttribute("command")||"";if(e.startsWith("--"))return e;let t=e.toLowerCase();switch(t){case"show-modal":case"close":case"toggle-popover":case"hide-popover":case"show-popover":return t}return""},set(e){this.setAttribute("command",e)}},invokeAction:{enumerable:!1,configurable:!0,get(){throw new Error("invokeAction is deprecated. It has been renamed to command")},set(e){throw new Error("invokeAction is deprecated. It has been renamed to command")}},invokeTargetElement:{enumerable:!1,configurable:!0,get(){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")},set(e){throw new Error("invokeTargetElement is deprecated. It has been renamed to command")}}})}let s=new WeakMap;Object.defineProperties(HTMLElement.prototype,{oncommand:{enumerable:!0,configurable:!0,get(){return c.takeRecords(),s.get(this)||null},set(e){let t=s.get(this)||null;t&&this.removeEventListener("command",t),s.set(this,typeof e=="object"||typeof e=="function"?e:null),typeof e=="function"&&this.addEventListener("command",e)}}});function u(e){for(let t of e)t.oncommand=new Function("event",t.getAttribute("oncommand"))}let c=new MutationObserver((e=>{for(let t of e){let{target:e}=t;t.type==="childList"?u(e.querySelectorAll("[oncommand]")):u([e])}}));c.observe(document,{subtree:!0,childList:!0,attributeFilter:["oncommand"]}),u(document.querySelectorAll("[oncommand]"));function d(e){if(e.defaultPrevented||e.type!=="click")return;let t=e.target.closest("button[invoketarget], button[invokeaction], input[invoketarget], input[invokeaction]");if(t&&(console.warn("Elements with `invoketarget` or `invokeaction` are deprecated and should be renamed to use `commandfor` and `command` respectively"),t.matches("input")))throw new Error("Input elements no longer support `commandfor`");let n=e.target.closest("button[commandfor], button[command]");if(!n)return;if(n.form&&n.getAttribute("type")!=="button")throw e.preventDefault(),new Error("Element with `commandFor` is a form participant. It should explicitly set `type=button` in order for `commandFor` to work. In order for it to act as a Submit button, it must not have command or commandfor attributes");if(n.hasAttribute("command")!==n.hasAttribute("commandfor")){let e=n.hasAttribute("command")?"command":"commandfor",t=n.hasAttribute("command")?"commandfor":"command";throw new Error(`Element with ${e} attribute must also have a ${t} attribute to function.`)}if(n.command!=="show-popover"&&n.command!=="hide-popover"&&n.command!=="toggle-popover"&&n.command!=="show-modal"&&n.command!=="close"&&!n.command.startsWith("--")){console.warn(`"${n.command}" is not a valid command value. Custom commands must begin with --`);return}let o=n.commandForElement;if(!o)return;let a=new r("command",{command:n.command,source:n,cancelable:!0});if(o.dispatchEvent(a),a.defaultPrevented)return;let l=a.command.toLowerCase();if(o.popover){let e=!o.matches(":popover-open");!e||l!=="toggle-popover"&&l!=="show-popover"?!e&&l==="hide-popover"&&o.hidePopover():o.showPopover({source:n})}else if(o.localName==="dialog"){let e=!o.hasAttribute("open");e&&l==="show-modal"?o.showModal():!e&&l==="close"&&o.close()}}function h(e){e.addEventListener("click",d,!0)}function p(e,t){let n=e.prototype.attachShadow;e.prototype.attachShadow=function(e){let o=n.call(this,e);return t(o),o};let o=e.prototype.attachInternals;e.prototype.attachInternals=function(){let e=o.call(this);return e.shadowRoot&&t(e.shadowRoot),e}}l(HTMLButtonElement),p(HTMLElement,(e=>{h(e),c.observe(e,{attributeFilter:["oncommand"]}),u(e.querySelectorAll("[oncommand]"))})),h(document),Object.assign(globalThis,{CommandEvent:r,InvokeEvent:i})}function re(){if(typeof HTMLDialogElement!="function")return!1;let e=!1,t=document.createElement("dialog");return t.addEventListener("beforetoggle",(t=>{e=!0,t.preventDefault()})),t.show(),e}function ie(){let e=new WeakMap;function t(t){let n=t.open?"closed":"open",o=t.open?"open":"closed";if(e.has(t)){let n=e.get(t);o=n.oldState,clearTimeout(n.id)}e.set(t,{oldState:o,id:setTimeout((()=>{t.dispatchEvent(new ToggleEvent("toggle",{newState:n,oldState:o}))}))})}let n=HTMLDialogElement.prototype.show,o=HTMLDialogElement.prototype.showModal,a=HTMLDialogElement.prototype.close;function l(e){let n=new ToggleEvent("beforetoggle",{newState:"closed",oldState:"open",cancelable:!1});e.dispatchEvent(n),e.open&&t(e)}document.addEventListener("submit",(e=>{let t=e.target;if(t.method==="dialog"){let e=t.closest("dialog");e instanceof HTMLDialogElement&&l(e)}}),!0),Object.defineProperties(HTMLDialogElement.prototype,{show:{value(){if(this.open||this.matches(":popover-open, :modal")||!this.ownerDocument)return n.apply(this,arguments);let e=new ToggleEvent("beforetoggle",{newState:"open",oldState:"closed",cancelable:!0});this.dispatchEvent(e)&&(t(this),n.apply(this,arguments))}},showModal:{value(){if(this.open||this.matches(":popover-open, :modal")||!this.isConnected||!this.ownerDocument)return o.apply(this,arguments);let e=new ToggleEvent("beforetoggle",{newState:"open",oldState:"closed",cancelable:!0});return this.dispatchEvent(e)?(t(this),o.apply(this,arguments)):void 0}},close:{value(){return this.open||this.matches(":popover-open, :modal")?(l(this),a.apply(this,arguments)):a.apply(this,arguments)}}})}function ae(e){function t(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",t))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",t),t())}typeof globalThis.window<"u"&&(Y()||(te(),ae((async()=>{if(await le("popover-polyfill"))return;let e=document.createElement("style");e.textContent="@layer popover-polyfill;",e.setAttribute("suppressHydrationWarning",""),e.addEventListener("securitypolicyviolation",(()=>{console.log("CSP rules on this website prevented @tailwindplus/elements from defining `popover-polyfill` as the first CSS layer. This is necessary to ensure the popover polyfill behaves correctly with CSS layers. To fix this, please manually add the following CSS to the top of your first stylesheet:\n\n```\n@layer popover-polyfill;\n```")})),document.documentElement.prepend(e)}))),ne()||oe(),re()||ie());async function le(e){await se();for(let t of document.styleSheets)try{for(let n of t.rules)if(n.constructor.name==="CSSLayerStatementRule"&&"nameList"in n&&n.nameList.includes(e))return!0}catch{}return!1}async function se(){await Promise.all(Array.from(document.querySelectorAll('link[rel="stylesheet"]')).map((e=>e.sheet?Promise.resolve():new Promise((t=>{e.addEventListener("load",(()=>t()),{once:!0}),e.addEventListener("error",(()=>t()),{once:!0})})))))}function ue(e){"focus"in e&&e.focus({focusVisible:ce})}var ce=!1;if(typeof globalThis.window<"u"){let e;(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse"))(e||(e={})),document.addEventListener("keydown",(e=>{e.metaKey||e.altKey||e.ctrlKey||(ce=!0,document.documentElement.dataset.focusVisible="")}),!0),document.addEventListener("click",(e=>{e.detail===1?(ce=!1,delete document.documentElement.dataset.focusVisible):e.detail===0&&(ce=!0,document.documentElement.dataset.focusVisible="")}),!0)}typeof globalThis.HTMLElement>"u"&&(globalThis.HTMLElement=class{});var de,he,pe,fe=class extends HTMLElement{constructor(){super(...arguments);s(this,de,new AbortController);s(this,he,!1);s(this,pe,!1)}connectedCallback(){if("observedAttributes"in this.constructor&&typeof this.constructor.observedAttributes=="object"&&Array.isArray(this.constructor.observedAttributes))for(let e of this.constructor.observedAttributes)typeof e=="string"&&(e in this||Object.defineProperty(this,e,{get(){return this.getAttribute(e)},set(t){t!=null&&t!==!1?this.setAttribute(e,t.toString()):this.removeAttribute(e)}}));u(this,he,!0);let e=l(this,de).signal;queueMicrotask((()=>{if(!e.aborted)try{this.mount?.(e)}catch(e){console.error(e)}}))}disconnectedCallback(){l(this,de).abort(),u(this,de,new AbortController)}setAttributeNoCallbacks(e,t){try{u(this,pe,!0),this.setAttribute(e,t)}finally{u(this,pe,!1)}}removeAttributeNoCallbacks(e){try{u(this,pe,!0),this.removeAttribute(e)}finally{u(this,pe,!1)}}attributeChangedCallback(e,t,n){l(this,he)&&(l(this,pe)||t!==n&&this.onAttributeChange?.(e,t,n))}};de=new WeakMap,he=new WeakMap,pe=new WeakMap;function me(e,t){typeof globalThis.customElements>"u"||customElements.get(e)===t||customElements.define(e,t)}function ge(){let e=[],t={addEventListener(e,n,o,a){return e.addEventListener(n,o,a),t.add((()=>e.removeEventListener(n,o,a)))},requestAnimationFrame(...e){let n=requestAnimationFrame(...e);return t.add((()=>cancelAnimationFrame(n)))},nextFrame(...e){return t.requestAnimationFrame((()=>t.requestAnimationFrame(...e)))},setTimeout(...e){let n=setTimeout(...e);return t.add((()=>clearTimeout(n)))},microTask(...e){let n={current:!0};return queueMicrotask((()=>{n.current&&e[0]()})),t.add((()=>{n.current=!1}))},style(e,t,n){let o=e.style.getPropertyValue(t);return t.startsWith("--")?e.style.setProperty(t,n):Object.assign(e.style,{[t]:n}),this.add((()=>{t.startsWith("--")?e.style.setProperty(t,o):Object.assign(e.style,{[t]:o})}))},add(t){return e.includes(t)||e.push(t),()=>{let n=e.indexOf(t);if(n>=0)for(let t of e.splice(n,1))t()}},dispose(){for(let t of e.splice(0))t()}};return t}function be(e,t=()=>[]){let n=!1,o=null,a=ge();return{start(l,s){let u=[e,...t()];n=!n&&(o!==null&&o!==l),o=l;for(let e of u)ve(e,(()=>{n||(l==="in"?(e.dataset.transition="",e.dataset.enter="",e.dataset.closed="",delete e.dataset.leave):l==="out"&&(e.dataset.transition="",e.dataset.leave="",delete e.dataset.enter))}),o!==null);a.nextFrame((()=>{for(let e of u)n?l==="in"?(delete e.dataset.enter,delete e.dataset.closed,e.dataset.leave=""):l==="out"&&(delete e.dataset.leave,e.dataset.enter="",e.dataset.closed=""):l==="in"?delete e.dataset.closed:l==="out"&&(e.dataset.closed="");a.requestAnimationFrame((()=>{a.add(we(e,(()=>{if(!(n&&u.some((e=>ye(e))))){for(let e of u)delete e.dataset.transition,delete e.dataset.enter,delete e.dataset.closed,delete e.dataset.leave;o=null,s?.()}})))}))}))},abort(){a.dispose(),n=!1,o=null}}}function ve(e,t,n=!1){if(n){t();return}let o=e.style.transition;e.style.transition="none",t(),e.offsetHeight,e.style.transition=o}function we(e,t){let n=ge();if(!e)return n.dispose;let o=!1;n.add((()=>{o=!0}));let a=e.getAnimations?.({subtree:!0}).filter((e=>e instanceof CSSTransition))??[];return a.length===0?(t(),n.dispose):(Promise.allSettled(a.map((e=>e.finished))).then((()=>{o||t()})),n.dispose)}function ye(e){return(e.getAnimations?.()??[]).some((e=>e instanceof CSSTransition&&e.playState!=="finished"))}var Ae=Math.min,Ee=Math.max,xe=Math.round,Se=Math.floor,Te=e=>({x:e,y:e}),ke={left:"right",right:"left",bottom:"top",top:"bottom"},Le={start:"end",end:"start"};function Ie(e,t,n){return Ee(e,Ae(t,n))}function De(e,t){return typeof e=="function"?e(t):e}function Pe(e){return e.split("-")[0]}function Ce(e){return e.split("-")[1]}function Me(e){return e==="x"?"y":"x"}function Oe(e){return e==="y"?"height":"width"}var Be=new Set(["top","bottom"]);function Re(e){return Be.has(Pe(e))?"y":"x"}function qe(e){return Me(Re(e))}function We(e,t,n){n===void 0&&(n=!1);let o=Ce(e),a=qe(e),l=Oe(a),s=a==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[l]>t.floating[l]&&(s=Ue(s)),[s,Ue(s)]}function Fe(e){let t=Ue(e);return[He(e),t,He(t)]}function He(e){return e.replace(/start|end/g,(e=>Le[e]))}var Ne=["left","right"],$e=["right","left"],Ke=["top","bottom"],je=["bottom","top"];function Ve(e,t,n){switch(e){case"top":case"bottom":return n?t?$e:Ne:t?Ne:$e;case"left":case"right":return t?Ke:je;default:return[]}}function ze(e,t,n,o){let a=Ce(e),l=Ve(Pe(e),n==="start",o);return a&&(l=l.map((e=>e+"-"+a)),t&&(l=l.concat(l.map(He)))),l}function Ue(e){return e.replace(/left|right|bottom|top/g,(e=>ke[e]))}function Ge(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ye(e){return typeof e!="number"?Ge(e):{top:e,right:e,bottom:e,left:e}}function Qe(e){let{x:t,y:n,width:o,height:a}=e;return{width:o,height:a,top:n,left:t,right:t+o,bottom:n+a,x:t,y:n}}function Xe(e,t,n){let o,{reference:a,floating:l}=e,s=Re(t),u=qe(t),c=Oe(u),d=Pe(t),h=s==="y",p=a.x+a.width/2-l.width/2,f=a.y+a.height/2-l.height/2,m=a[c]/2-l[c]/2;switch(d){case"top":o={x:p,y:a.y-l.height};break;case"bottom":o={x:p,y:a.y+a.height};break;case"right":o={x:a.x+a.width,y:f};break;case"left":o={x:a.x-l.width,y:f};break;default:o={x:a.x,y:a.y}}switch(Ce(t)){case"start":o[u]-=m*(n&&h?-1:1);break;case"end":o[u]+=m*(n&&h?-1:1);break}return o}var _e=async(e,t,n)=>{let{placement:o="bottom",strategy:a="absolute",middleware:l=[],platform:s}=n,u=l.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t)),d=await s.getElementRects({reference:e,floating:t,strategy:a}),{x:h,y:p}=Xe(d,o,c),f=o,m={},g=0;for(let n=0;n<u.length;n++){let{name:l,fn:b}=u[n],{x:v,y:w,data:y,reset:A}=await b({x:h,y:p,initialPlacement:o,placement:f,strategy:a,middlewareData:m,rects:d,platform:s,elements:{reference:e,floating:t}});h=v??h,p=w??p,m={...m,[l]:{...m[l],...y}},A&&g<=50&&(g++,typeof A=="object"&&(A.placement&&(f=A.placement),A.rects&&(d=A.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:a}):A.rects),({x:h,y:p}=Xe(d,f,c))),n=-1)}return{x:h,y:p,placement:f,strategy:a,middlewareData:m}};async function Je(e,t){var n;t===void 0&&(t={});let{x:o,y:a,platform:l,rects:s,elements:u,strategy:c}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:p="floating",altBoundary:f=!1,padding:m=0}=De(t,e),g=Ye(m),b=u[f?p==="floating"?"reference":"floating":p],v=Qe(await l.getClippingRect({element:(n=await(l.isElement==null?void 0:l.isElement(b)))==null||n?b:b.contextElement||await(l.getDocumentElement==null?void 0:l.getDocumentElement(u.floating)),boundary:d,rootBoundary:h,strategy:c})),w=p==="floating"?{x:o,y:a,width:s.floating.width,height:s.floating.height}:s.reference,y=await(l.getOffsetParent==null?void 0:l.getOffsetParent(u.floating)),A=await(l.isElement==null?void 0:l.isElement(y))&&await(l.getScale==null?void 0:l.getScale(y))||{x:1,y:1},E=Qe(l.convertOffsetParentRelativeRectToViewportRelativeRect?await l.convertOffsetParentRelativeRectToViewportRelativeRect({elements:u,rect:w,offsetParent:y,strategy:c}):w);return{top:(v.top-E.top+g.top)/A.y,bottom:(E.bottom-v.bottom+g.bottom)/A.y,left:(v.left-E.left+g.left)/A.x,right:(E.right-v.right+g.right)/A.x}}var Ze=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;let{placement:a,middlewareData:l,rects:s,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:h=!0,crossAxis:p=!0,fallbackPlacements:f,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:b=!0,...v}=De(e,t);if((n=l.arrow)!=null&&n.alignmentOffset)return{};let w=Pe(a),y=Re(u),A=Pe(u)===u,E=await(c.isRTL==null?void 0:c.isRTL(d.floating)),x=f||(A||!b?[Ue(u)]:Fe(u)),S=g!=="none";!f&&S&&x.push(...ze(u,b,g,E));let T=[u,...x],k=await Je(t,v),L=[],I=((o=l.flip)==null?void 0:o.overflows)||[];if(h&&L.push(k[w]),p){let e=We(a,s,E);L.push(k[e[0]],k[e[1]])}if(I=[...I,{placement:a,overflows:L}],!L.every((e=>e<=0))){var D,P;let e=(((D=l.flip)==null?void 0:D.index)||0)+1,t=T[e];if(t&&(!(p==="alignment"&&y!==Re(t))||I.every((e=>Re(e.placement)!==y||e.overflows[0]>0))))return{data:{index:e,overflows:I},reset:{placement:t}};let n=(P=I.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])==null?void 0:P.placement;if(!n)switch(m){case"bestFit":{var C;let e=(C=I.filter((e=>{if(S){let t=Re(e.placement);return t===y||t==="y"}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])==null?void 0:C[0];e&&(n=e);break}case"initialPlacement":n=u;break}if(a!==n)return{reset:{placement:n}}}return{}}}};var et=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:o,placement:a}=t,{mainAxis:l=!0,crossAxis:s=!1,limiter:u={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=De(e,t),d={x:n,y:o},h=await Je(t,c),p=Re(Pe(a)),f=Me(p),m=d[f],g=d[p];if(l){let e=f==="y"?"top":"left",t=f==="y"?"bottom":"right",n=m+h[e],o=m-h[t];m=Ie(n,m,o)}if(s){let e=p==="y"?"top":"left",t=p==="y"?"bottom":"right",n=g+h[e],o=g-h[t];g=Ie(n,g,o)}let b=u.fn({...t,[f]:m,[p]:g});return{...b,data:{x:b.x-n,y:b.y-o,enabled:{[f]:l,[p]:s}}}}}};function tt(){return typeof window<"u"}function nt(e){return it(e)?(e.nodeName||"").toLowerCase():"#document"}function ot(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function rt(e){var t;return(t=(it(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function it(e){return!!tt()&&(e instanceof Node||e instanceof ot(e).Node)}function at(e){return!!tt()&&(e instanceof Element||e instanceof ot(e).Element)}function lt(e){return!!tt()&&(e instanceof HTMLElement||e instanceof ot(e).HTMLElement)}function st(e){return!(!tt()||typeof ShadowRoot>"u")&&(e instanceof ShadowRoot||e instanceof ot(e).ShadowRoot)}var ut=new Set(["inline","contents"]);function ct(e){let{overflow:t,overflowX:n,overflowY:o,display:a}=xt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!ut.has(a)}var dt=new Set(["table","td","th"]);function ht(e){return dt.has(nt(e))}var pt=[":popover-open",":modal"];function ft(e){return pt.some((t=>{try{return e.matches(t)}catch{return!1}}))}var mt=["transform","translate","scale","rotate","perspective"],gt=["transform","translate","scale","rotate","perspective","filter"],bt=["paint","layout","strict","content"];function vt(e){let t=yt(),n=at(e)?xt(e):e;return mt.some((e=>!!n[e]&&n[e]!=="none"))||!!n.containerType&&n.containerType!=="normal"||!t&&!!n.backdropFilter&&n.backdropFilter!=="none"||!t&&!!n.filter&&n.filter!=="none"||gt.some((e=>(n.willChange||"").includes(e)))||bt.some((e=>(n.contain||"").includes(e)))}function wt(e){let t=Tt(e);for(;lt(t)&&!Et(t);){if(vt(t))return t;if(ft(t))return null;t=Tt(t)}return null}function yt(){return!(typeof CSS>"u"||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}var At=new Set(["html","body","#document"]);function Et(e){return At.has(nt(e))}function xt(e){return ot(e).getComputedStyle(e)}function St(e){return at(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Tt(e){if(nt(e)==="html")return e;let t=e.assignedSlot||e.parentNode||st(e)&&e.host||rt(e);return st(t)?t.host:t}function kt(e){let t=Tt(e);return Et(t)?e.ownerDocument?e.ownerDocument.body:e.body:lt(t)&&ct(t)?t:kt(t)}function Lt(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);let a=kt(e),l=a===((o=e.ownerDocument)==null?void 0:o.body),s=ot(a);if(l){let e=It(s);return t.concat(s,s.visualViewport||[],ct(a)?a:[],e&&n?Lt(e):[])}return t.concat(a,Lt(a,[],n))}function It(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Dt(e){let t=xt(e),n=parseFloat(t.width)||0,o=parseFloat(t.height)||0,a=lt(e),l=a?e.offsetWidth:n,s=a?e.offsetHeight:o,u=xe(n)!==l||xe(o)!==s;return u&&(n=l,o=s),{width:n,height:o,$:u}}function Pt(e){return at(e)?e:e.contextElement}function Ct(e){let t=Pt(e);if(!lt(t))return Te(1);let n=t.getBoundingClientRect(),{width:o,height:a,$:l}=Dt(t),s=(l?xe(n.width):n.width)/o,u=(l?xe(n.height):n.height)/a;return(!s||!Number.isFinite(s))&&(s=1),(!u||!Number.isFinite(u))&&(u=1),{x:s,y:u}}var Mt=Te(0);function Ot(e){let t=ot(e);return yt()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Mt}function Bt(e,t,n){return t===void 0&&(t=!1),!(!n||t&&n!==ot(e))&&t}function Rt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);let a=e.getBoundingClientRect(),l=Pt(e),s=Te(1);t&&(o?at(o)&&(s=Ct(o)):s=Ct(e));let u=Bt(l,n,o)?Ot(l):Te(0),c=(a.left+u.x)/s.x,d=(a.top+u.y)/s.y,h=a.width/s.x,p=a.height/s.y;if(l){let e=ot(l),t=o&&at(o)?ot(o):o,n=e,a=It(n);for(;a&&o&&t!==n;){let e=Ct(a),t=a.getBoundingClientRect(),o=xt(a),l=t.left+(a.clientLeft+parseFloat(o.paddingLeft))*e.x,s=t.top+(a.clientTop+parseFloat(o.paddingTop))*e.y;c*=e.x,d*=e.y,h*=e.x,p*=e.y,c+=l,d+=s,n=ot(a),a=It(n)}}return Qe({width:h,height:p,x:c,y:d})}function qt(e,t){let n=St(e).scrollLeft;return t?t.left+n:Rt(rt(e)).left+n}function Wt(e,t,n){n===void 0&&(n=!1);let o=e.getBoundingClientRect(),a=o.left+t.scrollLeft-(n?0:qt(e,o)),l=o.top+t.scrollTop;return{x:a,y:l}}function Ft(e){let{elements:t,rect:n,offsetParent:o,strategy:a}=e,l=a==="fixed",s=rt(o),u=!!t&&ft(t.floating);if(o===s||u&&l)return n;let c={scrollLeft:0,scrollTop:0},d=Te(1),h=Te(0),p=lt(o);if((p||!p&&!l)&&((nt(o)!=="body"||ct(s))&&(c=St(o)),lt(o))){let e=Rt(o);d=Ct(o),h.x=e.x+o.clientLeft,h.y=e.y+o.clientTop}let f=!s||p||l?Te(0):Wt(s,c,!0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-c.scrollLeft*d.x+h.x+f.x,y:n.y*d.y-c.scrollTop*d.y+h.y+f.y}}function Ht(e){return Array.from(e.getClientRects())}function Nt(e){let t=rt(e),n=St(e),o=e.ownerDocument.body,a=Ee(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),l=Ee(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight),s=-n.scrollLeft+qt(e),u=-n.scrollTop;return xt(o).direction==="rtl"&&(s+=Ee(t.clientWidth,o.clientWidth)-a),{width:a,height:l,x:s,y:u}}function $t(e,t){let n=ot(e),o=rt(e),a=n.visualViewport,l=o.clientWidth,s=o.clientHeight,u=0,c=0;if(a){l=a.width,s=a.height;let e=yt();(!e||e&&t==="fixed")&&(u=a.offsetLeft,c=a.offsetTop)}return{width:l,height:s,x:u,y:c}}var Kt=new Set(["absolute","fixed"]);function jt(e,t){let n=Rt(e,!0,t==="fixed"),o=n.top+e.clientTop,a=n.left+e.clientLeft,l=lt(e)?Ct(e):Te(1),s=e.clientWidth*l.x,u=e.clientHeight*l.y,c=a*l.x,d=o*l.y;return{width:s,height:u,x:c,y:d}}function Vt(e,t,n){let o;if(t==="viewport")o=$t(e,n);else if(t==="document")o=Nt(rt(e));else if(at(t))o=jt(t,n);else{let n=Ot(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Qe(o)}function zt(e,t){let n=Tt(e);return!(n===t||!at(n)||Et(n))&&(xt(n).position==="fixed"||zt(n,t))}function Ut(e,t){let n=t.get(e);if(n)return n;let o=Lt(e,[],!1).filter((e=>at(e)&&nt(e)!=="body")),a=null,l=xt(e).position==="fixed",s=l?Tt(e):e;for(;at(s)&&!Et(s);){let t=xt(s),n=vt(s);!n&&t.position==="fixed"&&(a=null),(l?!n&&!a:!n&&t.position==="static"&&!!a&&Kt.has(a.position)||ct(s)&&!n&&zt(e,s))?o=o.filter((e=>e!==s)):a=t,s=Tt(s)}return t.set(e,o),o}function Gt(e){let{element:t,boundary:n,rootBoundary:o,strategy:a}=e,l=[...n==="clippingAncestors"?ft(t)?[]:Ut(t,this._c):[].concat(n),o],s=l[0],u=l.reduce(((e,n)=>{let o=Vt(t,n,a);return e.top=Ee(o.top,e.top),e.right=Ae(o.right,e.right),e.bottom=Ae(o.bottom,e.bottom),e.left=Ee(o.left,e.left),e}),Vt(t,s,a));return{width:u.right-u.left,height:u.bottom-u.top,x:u.left,y:u.top}}function Yt(e){let{width:t,height:n}=Dt(e);return{width:t,height:n}}function Qt(e,t,n){let o=lt(t),a=rt(t),l=n==="fixed",s=Rt(e,!0,l,t),u={scrollLeft:0,scrollTop:0},c=Te(0);function d(){c.x=qt(a)}if(o||!o&&!l)if((nt(t)!=="body"||ct(a))&&(u=St(t)),o){let e=Rt(t,!0,l,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}else a&&d();l&&!o&&a&&d();let h=!a||o||l?Te(0):Wt(a,u),p=s.left+u.scrollLeft-c.x-h.x,f=s.top+u.scrollTop-c.y-h.y;return{x:p,y:f,width:s.width,height:s.height}}function Xt(e){return xt(e).position==="static"}function _t(e,t){if(!lt(e)||xt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return rt(e)===n&&(n=n.ownerDocument.body),n}function Jt(e,t){let n=ot(e);if(ft(e))return n;if(!lt(e)){let t=Tt(e);for(;t&&!Et(t);){if(at(t)&&!Xt(t))return t;t=Tt(t)}return n}let o=_t(e,t);for(;o&&ht(o)&&Xt(o);)o=_t(o,t);return o&&Et(o)&&Xt(o)&&!vt(o)?n:o||wt(e)||n}var Zt=async function(e){let t=this.getOffsetParent||Jt,n=this.getDimensions,o=await n(e.floating);return{reference:Qt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function en(e){return xt(e).direction==="rtl"}var tn={convertOffsetParentRelativeRectToViewportRelativeRect:Ft,getDocumentElement:rt,getClippingRect:Gt,getOffsetParent:Jt,getElementRects:Zt,getClientRects:Ht,getDimensions:Yt,getScale:Ct,isElement:at,isRTL:en};function nn(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function on(e,t){let n,o=null,a=rt(e);function l(){var e;clearTimeout(n),(e=o)==null||e.disconnect(),o=null}function s(u,c){u===void 0&&(u=!1),c===void 0&&(c=1),l();let d=e.getBoundingClientRect(),{left:h,top:p,width:f,height:m}=d;if(u||t(),!f||!m)return;let g=Se(p),b=Se(a.clientWidth-(h+f)),v=Se(a.clientHeight-(p+m)),w=Se(h),y={rootMargin:-g+"px "+-b+"px "+-v+"px "+-w+"px",threshold:Ee(0,Ae(1,c))||1},A=!0;function E(t){let o=t[0].intersectionRatio;if(o!==c){if(!A)return s();o?s(!1,o):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}o===1&&!nn(d,e.getBoundingClientRect())&&s(),A=!1}try{o=new IntersectionObserver(E,{...y,root:a.ownerDocument})}catch{o=new IntersectionObserver(E,y)}o.observe(e)}return s(!0),l}function rn(e,t,n,o){o===void 0&&(o={});let{ancestorScroll:a=!0,ancestorResize:l=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,d=Pt(e),h=a||l?[...d?Lt(d):[],...Lt(t)]:[];h.forEach((e=>{a&&e.addEventListener("scroll",n,{passive:!0}),l&&e.addEventListener("resize",n)}));let p=d&&u?on(d,n):null,f=-1,m=null;s&&(m=new ResizeObserver((e=>{let[o]=e;o&&o.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;(e=m)==null||e.observe(t)}))),n()})),d&&!c&&m.observe(d),m.observe(t));let g,b=c?Rt(e):null;c&&v();function v(){let t=Rt(e);b&&!nn(b,t)&&n(),b=t,g=requestAnimationFrame(v)}return n(),()=>{var e;h.forEach((e=>{a&&e.removeEventListener("scroll",n),l&&e.removeEventListener("resize",n)})),p?.(),(e=m)==null||e.disconnect(),m=null,c&&cancelAnimationFrame(g)}}var an=et,ln=Ze;var sn=(e,t,n)=>{let o=new Map,a={platform:tn,...n},l={...a.platform,_c:o};return _e(e,t,{...a,platform:l})};function un(e){let t=()=>{};return function(n,o){if(t(),!n){requestAnimationFrame((()=>{ye(e)?we(e,(()=>{e.style.removeProperty("position")})):e.style.removeProperty("position")}));return}if(!o||!e.hasAttribute("anchor"))return;let a=e.getAttribute("anchor"),l=e.getAttribute("anchor-strategy")||"absolute";l!=="absolute"&&l!=="fixed"&&(console.warn(`[createAnchorUpdater] Invalid anchor strategy "${l}" for element:`,e),l="absolute"),t=rn(o,e,(()=>{let t=dn(window.getComputedStyle(e).getPropertyValue("--anchor-gap"),e),n=dn(window.getComputedStyle(e).getPropertyValue("--anchor-offset"),e),s=a.split(" ")[0],u={};switch(s){case"top":case"bottom":u={top:t,left:-1*n,right:n,bottom:t};break;case"left":case"right":u={top:-1*n,bottom:n,left:t,right:t};break}sn(o,e,{strategy:l,placement:a.replace(" ","-"),middleware:[ln({padding:u}),an({padding:u})]}).then((async({x:t,y:n,placement:o})=>{if(!cn()&&l==="absolute"){let o=null;for(let t=e.parentElement;t;t=t.parentElement){let e=getComputedStyle(t).position;if(e==="relative"||e==="absolute"||e==="fixed"||e==="sticky"){o=t;break}}if(o){let e=o.getBoundingClientRect();t-=e.left+window.scrollX,n-=e.top+window.scrollY}}let a=`${t}px`,s=`${n}px`;switch(o.split("-")[0]){case"top":s=`calc(${n}px - var(--anchor-gap, 0px))`,a=`calc(${t}px + var(--anchor-offset, 0px))`;break;case"right":a=`calc(${t}px + var(--anchor-gap, 0px))`,s=`calc(${n}px + var(--anchor-offset, 0px))`;break;case"bottom":s=`calc(${n}px + var(--anchor-gap, 0px))`,a=`calc(${t}px + var(--anchor-offset, 0px))`;break;case"left":a=`calc(${t}px - var(--anchor-gap, 0px))`,s=`calc(${n}px + var(--anchor-offset, 0px))`;break}{let t=e.getBoundingClientRect();if(t.x===0&&t.y===0&&t.width===0&&t.height===0)return}Object.assign(e.style,{left:a,top:s,position:l}),await(tn.isRTL?.(e))&&Object.assign(e.style,{right:"unset",bottom:"unset"})}))}))}}function cn(){return"showPopover"in HTMLElement.prototype&&HTMLElement.prototype.showPopover.toString().includes("[native code]")}function dn(e,t){let n=document.createElement("div");t.appendChild(n),n.style.setProperty("margin-top","0px","important"),n.style.setProperty("margin-top",e,"important");let o=parseFloat(window.getComputedStyle(n).marginTop)||0;return t.removeChild(n),o}function hn(e){return pn(e)&&"tabIndex"in e}function pn(e){return mn(e)&&"tagName"in e}function fn(e){return pn(e)&&"accessKey"in e}function mn(e){return typeof e=="object"&&e!==null&&"nodeType"in e}function gn(e){return pn(e)&&"style"in e}function bn(e){return fn(e)&&e.nodeName==="INPUT"}function vn(e){let t=e.getBoundingClientRect();return!(!(t.x!==0||t.y!==0||t.width!==0||t.height!==0)||(e.ownerDocument.defaultView||window).getComputedStyle(e).visibility==="hidden")}var wn={get selectRequired(){let e=document.createElement("select");e.setAttribute("required","true");let t=e.validationMessage;return Object.defineProperty(this,"selectRequired",{value:t}),t}};function yn(e,t,n){function o(){if(!vn(e)){for(let t of e.children)if(vn(t))return;n()}}if(typeof ResizeObserver<"u"){let n=new ResizeObserver(o);n.observe(e),t.addEventListener("abort",(()=>n.disconnect()))}if(typeof IntersectionObserver<"u"){let n=new IntersectionObserver(o);n.observe(e),t.addEventListener("abort",(()=>n.disconnect()))}}var An=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map((e=>`${e}:not([tabindex='-1'])`)).join(",");function En(e,t,n){let o=t?e.indexOf(t):null;switch(o===-1&&(o=null),n){case 0:for(let t=0;t<e.length;t++)if(vn(e[t]))return e[t];return null;case 1:for(let t=e.length-1;t>=0;t--)if(vn(e[t]))return e[t];return null;case 2:if(o===null)return En(e,t,1);for(let t=o-1;t>=0;t--)if(vn(e[t]))return e[t];return null;case 3:if(o===null)return En(e,t,0);for(let t=o+1;t<e.length;t++)if(vn(e[t]))return e[t];return null;case 4:return null}}var xn=[];ae((()=>{function e(e){if(e.target===document.body||xn[0]===e.target)return;let t=e.target;t&&"closest"in t&&(t=t.closest(An),xn.unshift(t??e.target),xn=xn.filter((e=>e!=null&&e.isConnected)),xn.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("pointerdown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("pointerdown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})}));var Sn=!1,Tn=!1;typeof navigator<"u"&&(Sn=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),Tn=navigator.userAgent.toLowerCase().includes("firefox"));var kn=!1;function Ln(e,t,n,o,a,l){Pn(e.ownerDocument);let s=be(e),u=un(e),c=ge();e.hasAttribute("popover")||e.setAttribute("popover","");let d=n();for(let t of d)t.setAttribute("type","button"),t.setAttribute("aria-haspopup","true"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false");e.hasAttribute("open")&&queueMicrotask((()=>e.showPopover()));function h(){e.hasAttribute("open")&&e.hidePopover()}let p=new AbortController;t.addEventListener("abort",(()=>p.abort())),e.addEventListener("beforetoggle",(t=>{let n=In(t,d);u(t.newState==="open",o?.()??n),t.newState==="open"?n&&(yn(n,p.signal,h),yn(e,p.signal,h)):(p.abort(),p=new AbortController);let f=e.hasAttribute("open");t.newState!=="open"||f?t.newState==="closed"&&f&&e.removeAttributeNoCallbacks("open"):e.setAttributeNoCallbacks("open",""),t.newState==="open"?(n?.setAttribute("aria-expanded","true"),n?.id&&e.setAttribute("aria-labelledby",n.id),a?.(),kn=e.getAttribute("popover")===""):(n?.setAttribute("aria-expanded","false"),e.removeAttribute("aria-labelledby"),l?.(),kn=!1),t.oldState==="closed"&&t.newState==="open"?(Sn&&(c.dispose(),c=ge()),s.start("in")):t.oldState==="open"&&t.newState==="closed"&&(Sn&&c.style(e,"transition-property","none"),s.start("out"))}),{signal:t}),t.addEventListener("abort",(()=>s.abort()))}function In(e,t){return e.source??xn.find((e=>t.includes(e)))??t[0]??null}var Dn=new WeakSet;function Pn(e){if(Tn||Sn||Dn.has(e))return;Dn.add(e);let t=null;e.addEventListener("mousedown",(()=>{kn&&(e.body.setAttribute("tabindex","-1"),t&&clearTimeout(t),t=setTimeout((()=>e.body.removeAttribute("tabindex"))))}),{capture:!0})}function Cn(e,t,n,o){function a(){let n=e.getBoundingClientRect();o.style.setProperty(t,n.width+"px")}let l=e.ownerDocument,s=new ResizeObserver(a);s.observe(e),l.addEventListener("transitionend",a,{signal:n}),n.addEventListener("abort",(()=>s.disconnect()))}var Mn=0;function On(e){return`${e}-${Mn++}`}var Bn=200;function Rn(e,t,n,o){Fn(),e.addEventListener(t,(e=>{qn!==null&&Date.now()-qn<Bn||o(e)}),{passive:!0,signal:n})}var qn=null,Wn=!1;function Fn(){Wn||(Wn=!0,document.addEventListener("keydown",(()=>{qn=Date.now()}),{capture:!0}))}var Hn=class extends Map{constructor(e){super();this.factory=e}get(e){let t=super.get(e);return t===void 0&&(t=this.factory(e,this),this.set(e,t)),t}};var Nn=new Hn((()=>({referenceCounter:0,d:ge()})));function $n(e){let t=Nn.get(e);if(t.referenceCounter++,t.referenceCounter===1){let n=[zn(),jn(),Kn()];n.forEach((({before:n})=>n({doc:e,d:t.d}))),n.forEach((({after:n})=>n({doc:e,d:t.d})))}let n=!1;return()=>{n||(n=!0,t.referenceCounter--,!(t.referenceCounter>0)&&(t.d.dispose(),Nn.delete(e)))}}function Kn(){return{before({doc:e,d:t}){t.style(e.documentElement,"overflow","hidden")},after(){}}}function jn(){let e;return{before({doc:t}){let n=t.documentElement,o=t.defaultView??window;e=Math.max(0,o.innerWidth-n.clientWidth),n.style.setProperty("--el-top-layer-scrollbar-offset","0px")},after({doc:t,d:n}){let o=t.documentElement,a=Math.max(0,o.clientWidth-o.offsetWidth),l=Math.max(0,e-a);n.style(o,"paddingRight",`${l}px`),n.add((()=>{o.style.setProperty("--el-top-layer-scrollbar-offset",`-${l}px`)}))}}}function Vn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function zn(){return Vn()?{before({doc:e,d:t}){function n(e){return!!e.closest("[popover], dialog > *")}t.microTask((()=>{if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let n=ge();n.style(e.documentElement,"scrollBehavior","auto"),t.add((()=>t.microTask((()=>n.dispose()))))}let o=window.scrollY??window.pageYOffset,a=null;t.addEventListener(e,"click",(t=>{if(hn(t.target))try{let o=t.target.closest("a");if(!o)return;let{hash:l}=new URL(o.href),s=e.querySelector(l);hn(s)&&!n(s)&&(a=s)}catch{}}),!0),t.addEventListener(e,"touchstart",(e=>{if(hn(e.target)&&gn(e.target))if(n(e.target)){let o=e.target;for(;o.parentElement&&n(o.parentElement);)o=o.parentElement;t.style(o,"overscrollBehavior","contain")}else t.style(e.target,"touchAction","none")})),t.addEventListener(e,"touchmove",(e=>{if(hn(e.target)){if(bn(e.target))return;if(n(e.target)){let t=e.target;for(;t.parentElement&&t.dataset.tailwindplusPortal!==""&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;t.dataset.tailwindplusPortal===""&&e.preventDefault()}else e.preventDefault()}}),{passive:!1}),t.add((()=>{let e=window.scrollY??window.pageYOffset;o!==e&&window.scrollTo(0,o),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)}))}))},after(){}}:{before(){},after(){}}}function Un(e,t){let n=null;e.addEventListener("toggle",(t=>{t.newState==="open"?n||(n=$n(e.ownerDocument)):n&&(n(),n=null)}),{signal:t}),t.addEventListener("abort",(()=>{n&&(n(),n=null)}))}var Gn=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Yn(e){let t=e.innerText??"",n=e.cloneNode(!0);if(!fn(n))return t;let o=!1;for(let e of n.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))e.remove(),o=!0;let a=o?n.innerText??"":t;return Gn.test(a)&&(a=a.replace(Gn,"")),a}function Qn(e){let t=e.getAttribute("aria-label");if(typeof t=="string")return t.trim();let n=e.getAttribute("aria-labelledby");if(n){let e=n.split(" ").map((e=>{let t=document.getElementById(e);if(t){let e=t.getAttribute("aria-label");return typeof e=="string"?e.trim():Yn(t).trim()}return null})).filter(Boolean);if(e.length>0)return e.join(", ")}return Yn(e).trim()}var Xn,_n,Jn=class extends fe{constructor(){super(...arguments);s(this,Xn,[]);s(this,_n,null)}mount(e){let t=this.getInput(),n=this.getButton(),o=this.getOptions();t.id||(t.id=On("autocomplete-input")),n&&(n.id||(n.id=On("autocomplete-button"))),o.id||(o.id=On("autocomplete-listbox")),Ln(o,e,(()=>{let e=this.getButton();return e?[e]:[]}),(()=>this.getInput()),(()=>this.onBeforeOpen()),(()=>this.onBeforeClose())),Un(o,e),t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-controls",o.id),t.setAttribute("aria-activedescendant",""),t.setAttribute("autocomplete","off"),n&&(n.setAttribute("type","button"),n.setAttribute("tabindex","-1"),n.setAttribute("aria-expanded","false"),n.setAttribute("aria-haspopup","listbox"),n.setAttribute("popovertarget",o.id)),o.setAttribute("role","listbox"),o.setAttribute("popover","manual");let a=this,s=new WeakSet;function u(){for(let t of o.getItems())s.has(t)||(s.add(t),t.id||(t.id=On("option")),t.setAttribute("role","option"),t.setAttribute("aria-selected","false"),t.setAttribute("tabIndex","-1"),t.addEventListener("mousedown",(e=>{e.button===0&&(e.preventDefault(),a.selectOption(t))}),{signal:e}),Rn(t,"mouseover",e,(()=>a.setActiveItem(t,!1))),Rn(t,"mouseout",e,(()=>a.clearActiveItem())));a.filterOptions()}u();let c=new MutationObserver(u);c.observe(this,{attributes:!1,childList:!0,subtree:!0}),n&&Cn(n,"--button-width",e,this),Cn(t,"--input-width",e,this),t.addEventListener("input",(()=>{t.matches(":disabled")||(this.filterOptions(),l(this,Xn).length>0?o.hasAttribute("open")||o.showPopover():o.hidePopover())}),{signal:e});let d=()=>{t.matches(":disabled")||(t.focus(),o.hasAttribute("open")?o.hidePopover():(this.filterOptions(),l(this,Xn).length>0&&o.showPopover()))};t.addEventListener("pointerdown",d,{signal:e}),n&&(n.addEventListener("pointerdown",(e=>{e.preventDefault(),d()}),{signal:e}),n.addEventListener("click",(e=>{e.preventDefault(),e.stopImmediatePropagation()}),{signal:e})),t.addEventListener("blur",(({relatedTarget:e})=>{e&&this.contains(e)||o.hidePopover()}),{signal:e}),t.addEventListener("keydown",(e=>{if(!t.matches(":disabled"))switch(e.key){case"ArrowDown":e.preventDefault(),o.hasAttribute("open")||(l(this,Xn).length===0&&this.filterOptions(),l(this,Xn).length>0&&o.showPopover()),this.goToItem(3);break;case"ArrowUp":e.preventDefault(),o.hasAttribute("open")||(l(this,Xn).length===0&&this.filterOptions(),l(this,Xn).length>0&&o.showPopover()),this.goToItem(2);break;case"Home":case"PageUp":return o.hasAttribute("open")?(e.preventDefault(),e.stopPropagation(),this.goToItem(0)):void 0;case"End":case"PageDown":return o.hasAttribute("open")?(e.preventDefault(),e.stopPropagation(),this.goToItem(1)):void 0;case"Enter":{let t=this.getActiveItem();t&&(e.preventDefault(),this.selectOption(t)),o.hasAttribute("open")&&(e.preventDefault(),o.hidePopover());break}case"Escape":if(!o.hasAttribute("open"))return;e.preventDefault(),o.hidePopover();break;case"Tab":o.hidePopover();break}}),{signal:e});let h=Array.from(o.querySelectorAll("el-option[disabled]"));for(let e of h)e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false");e.addEventListener("abort",(()=>{c.disconnect()}))}getInput(){let e=this.querySelector("input");if(!e)throw new Error("`<el-autocomplete>` must contain an input element.");return e}getButton(){return this.querySelector("button")}getOptions(){let e=this.querySelector("el-options");if(!e)throw new Error("`<el-autocomplete>` must contain a `<el-options>` element.");return e}filterOptions(){let e=this.getInput().value.toLowerCase();l(this,_n)!==e&&(this.clearActiveItem(),u(this,_n,e)),u(this,Xn,[]);for(let t of this.getOptions().getItems()){let n=t.getAttribute("value")?.toLowerCase()||"",o=Yn(t)?.trim().toLowerCase()??"";e===""||n.includes(e)||o.includes(e)?(l(this,Xn).push(t),t.removeAttribute("hidden"),t.removeAttribute("aria-hidden")):(t.setAttribute("hidden",""),t.setAttribute("aria-hidden","true"))}}getActiveItem(){let e=this.getInput().getAttribute("aria-activedescendant");return e?document.getElementById(e):null}goToItem(e){if(l(this,Xn).length===0)return;let t=this.getActiveItem(),n=En(l(this,Xn),t,e);n&&this.setActiveItem(n)}setActiveItem(e,t=!0){let n=this.getInput(),o=this.getActiveItem();o!==null&&o.setAttribute("aria-selected","false"),e.setAttribute("aria-selected","true"),n.setAttribute("aria-activedescendant",e.id),t&&e.scrollIntoView({block:"nearest"})}clearActiveItem(){let e=this.getInput(),t=this.getActiveItem();t!==null&&t.setAttribute("aria-selected","false"),e.setAttribute("aria-activedescendant","")}selectOption(e){let t=this.getInput(),n=e.getAttribute("value");n&&(t.value=n,t.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),this.getOptions().hidePopover())}onBeforeOpen(){let e=this.getInput(),t=this.getButton();e.setAttribute("aria-expanded","true"),t?.setAttribute("aria-expanded","true")}onBeforeClose(){let e=this.getInput(),t=this.getButton();e.setAttribute("aria-expanded","false"),t?.setAttribute("aria-expanded","false"),this.clearActiveItem()}};Xn=new WeakMap,_n=new WeakMap;me("el-autocomplete",Jn);var Zn,eo,to,no,oo,ro,io=class extends fe{constructor(){super(...arguments);s(this,no);s(this,Zn,[]);s(this,eo,null);s(this,to,(({query:e,content:t})=>t.toLocaleLowerCase().includes(e.toLocaleLowerCase().trim())))}mount(e){let t=this.getInput(),n=this.getItems();t.id||(t.id=On("command-input")),n.id||(n.id=On("command-items")),t.setAttribute("role","combobox"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("autocomplete","off"),t.setAttribute("aria-controls",n.id),n.setAttribute("role","listbox");let o=this,a=new WeakSet;function l(t=!1){var l;for(let t of n.getItems())a.has(t)||(a.add(t),t.id||(t.id=On("item")),t.setAttribute("role","option"),t.setAttribute("tabIndex","-1"),t.setAttribute("aria-selected","false"),t.hasAttribute("disabled")&&t.setAttribute("aria-disabled","true"),Rn(t,"mouseover",e,(()=>{var e;return c(e=o,no,ro).call(e,t,!1)})));c(l=o,no,oo).call(l,t),t||o.goToItem(0)}l(!0);let s=new MutationObserver((()=>l(!1)));s.observe(this,{attributes:!1,childList:!0,subtree:!0}),Cn(t,"--input-width",e,this),t.addEventListener("input",(()=>c(this,no,oo).call(this)),{signal:e}),t.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":e.preventDefault(),this.goToItem(3);break;case"ArrowUp":e.preventDefault(),this.goToItem(2);break;case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),this.goToItem(1);case"Enter":{let t=this.getActiveItem();t&&(e.preventDefault(),t.click());break}case"Tab":break}}),{signal:e}),e.addEventListener("abort",(()=>{s.disconnect()}))}getInput(){let e=this.querySelector("input");if(!e)throw new Error("`<el-command-palette>` must contain an input element.");return e}getItems(){let e=this.querySelector("el-command-list");if(!e)throw new Error("`<el-command-palette>` must contain a `<el-command-list>` element.");return e}getGroups(){return this.getItems().querySelectorAll("el-command-group")}getSuggestions(){return this.querySelector("el-defaults")}getActiveItem(){let e=this.getInput().getAttribute("aria-activedescendant");return e?document.getElementById(e):null}goToItem(e){if(l(this,Zn).length===0)return;let t=this.getActiveItem(),n=En(l(this,Zn),t,e);n&&c(this,no,ro).call(this,n)}clearActiveItem(){let e=this.getInput(),t=this.getActiveItem();if(t!==null){t.setAttribute("aria-selected","false");let e=this.querySelector(`el-command-preview[for="${t.id}"]`);e&&e.setAttribute("hidden","")}e.removeAttribute("aria-activedescendant"),this.dispatchEvent(new CustomEvent("change",{detail:{relatedTarget:null},bubbles:!1,cancelable:!1}))}reset(){let e=this.getInput();e.value="",e.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),e.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),c(this,no,oo).call(this,!0),this.clearActiveItem()}setFilterCallback(e){u(this,to,e)}};Zn=new WeakMap,eo=new WeakMap,to=new WeakMap,no=new WeakSet,oo=function(e=!1){let t=this.getItems(),n=this.getInput().value??"";u(this,Zn,[]);for(let e of t.getItems()){if(e.closest("el-defaults"))continue;let t=Qn(e)??"";n!==""&&l(this,to).call(this,{query:n,node:e,content:t})?(l(this,Zn).push(e),e.removeAttribute("hidden"),e.removeAttribute("aria-hidden")):(e.setAttribute("hidden",""),e.setAttribute("aria-hidden","true"))}for(let e of this.getGroups())e.getItems().some((e=>!e.hasAttribute("hidden")))?e.removeAttribute("hidden"):e.setAttribute("hidden","");let o=this.getSuggestions();o&&(n===""?(o.removeAttribute("hidden"),u(this,Zn,o.getItems())):o.setAttribute("hidden",""));let a=this.querySelector("el-no-results");a&&(n===""||l(this,Zn).length>0?a.setAttribute("hidden",""):a.removeAttribute("hidden")),l(this,Zn).length===0?t.setAttribute("hidden",""):t.removeAttribute("hidden"),!(e&&n==="")&&(l(this,Zn).length===0?this.clearActiveItem():l(this,eo)!==n&&this.goToItem(0),u(this,eo,n))},ro=function(e,t=!0){let n=this.getInput(),o=this.getActiveItem();if(e===o)return;if(o!==null){o.setAttribute("aria-selected","false");let e=this.querySelector(`el-command-preview[for="${o.id}"]`);e&&e.setAttribute("hidden","")}e.setAttribute("aria-selected","true"),n.setAttribute("aria-activedescendant",e.id);let a=this.querySelector(`el-command-preview[for="${e.id}"]`);a&&a.removeAttribute("hidden"),t&&e.scrollIntoView({block:"nearest"}),this.dispatchEvent(new CustomEvent("change",{detail:{relatedTarget:e},bubbles:!1,cancelable:!1}))};var ao=class extends fe{getItems(){return Array.from(this.querySelectorAll(`${An},[role="option"]`))}},lo=class extends fe{getItems(){return Array.from(this.querySelectorAll(`${An},[role="option"]`))}},so=class extends fe{},uo=class extends fe{},co=class extends fe{getItems(){return Array.from(this.querySelectorAll(`${An},[role="option"]`))}};me("el-command-palette",io);me("el-command-list",ao);me("el-defaults",lo);me("el-no-results",so);me("el-command-group",co);me("el-command-preview",uo);var ho=null;typeof globalThis.window<"u"&&(ho=HTMLDialogElement.prototype.close,Object.defineProperties(HTMLDialogElement.prototype,{close:{value(){let e=this.closest("el-dialog");if(!(e instanceof wo))return ho?.apply(this,arguments);let t=e.beforeClose();if(t===!0)return ho?.apply(this,arguments);t!==!1&&t.then((e=>e?ho?.apply(this,arguments):null)).catch(console.error)}}}),document.addEventListener("command",(e=>{let t=e.target;if(!(t instanceof HTMLDialogElement)||!("command"in e)||e.command!=="close")return;let n=t.closest("el-dialog");if(!(n instanceof wo))return;let o=n.beforeClose();o!==!0&&(e.stopImmediatePropagation(),e.preventDefault(),o!==!1&&o.then((e=>e?ho?.apply(t):null)).catch(console.error))}),!0));var po,fo,mo,go,bo,vo,wo=class extends fe{constructor(){super(...arguments);s(this,bo);s(this,po,null);s(this,fo,null);s(this,mo,!0);s(this,go,be(this,(()=>Array.from(this.querySelectorAll("el-dialog-panel,el-dialog-backdrop")))))}mount(e){let t=this.getNativeDialog();t.removeAttribute("open"),t.style.setProperty("right","var(--el-top-layer-scrollbar-offset, 0px)");let n=this.hasAttribute("open");for(let e of c(this,bo,vo).call(this))e.setAttribute("aria-expanded",n.toString());xo(t,e,(e=>{e.preventDefault();let n=new Event("cancel",{bubbles:!1,cancelable:!0});!this.dispatchEvent(n)||t.close()}));let o=this.querySelector("el-dialog-panel");yn(o??t,e,(()=>{this.hasAttribute("open")&&t.close()}));let a=null;t.addEventListener("beforetoggle",(e=>{let t=e;t.newState==="open"&&t.oldState==="closed"&&this.beforeOpen();let n=this.hasAttribute("open");if(t.newState!=="open"||n?t.newState==="closed"&&n&&(this.dispatchEvent(new CustomEvent("close",{bubbles:!1,cancelable:!1})),this.removeAttribute("open")):(this.dispatchEvent(new CustomEvent("open",{bubbles:!1,cancelable:!1})),this.setAttribute("open","")),t.newState==="open"&&t.oldState==="closed")xn.length>0&&!a&&(a=xn[0]);else if(t.newState==="closed"&&t.oldState==="open"){let e=l(this,mo);setTimeout((()=>{e?(a&&a!==document.activeElement&&a.isConnected&&ue(a),a=null):a&&a===document.activeElement&&a.isConnected&&"blur"in a&&typeof a.blur=="function"&&a.blur()}))}}),{signal:e}),t.addEventListener("focusout",(e=>{e.relatedTarget===null&&t.focus()}),{signal:e}),e.addEventListener("abort",(()=>{var e;l(this,go).abort(),(e=l(this,fo))==null||e.call(this)})),this.hasAttribute("open")&&t.showModal()}onAttributeChange(e,t,n){switch(e){case"open":{let e=this.getNativeDialog();for(let e of c(this,bo,vo).call(this))e.setAttribute("aria-expanded",n!==null?"true":"false");n===null?e.close():e.showModal();break}}}getNativeDialog(){let e=this.querySelector("dialog");if(!e)throw new Error("[ElDialog] No `<dialog>` element found");return e}beforeOpen(){u(this,mo,!0),l(this,po)&&(l(this,po).abort(),u(this,po,null)),l(this,fo)||u(this,fo,$n(this.ownerDocument)),l(this,go)&&l(this,go).start("in")}beforeClose(){if(l(this,fo)&&(l(this,fo).call(this),u(this,fo,null)),l(this,po))return!1;u(this,po,new AbortController);let e=l(this,po).signal;return new Promise((t=>{l(this,go)?.start("out",(()=>{e.aborted||(u(this,po,null),requestAnimationFrame((()=>{let e=this.getNativeDialog(),t=e.style.cssText;e.style.cssText=t+"transition-duration: 0 !important;",ho?.apply(e),requestAnimationFrame((()=>{e.style.cssText=t}))})),t(!0))}))}))}show(){this.getNativeDialog().showModal()}hide({restoreFocus:e=!0}={}){u(this,mo,e),this.getNativeDialog().close()}};po=new WeakMap,fo=new WeakMap,mo=new WeakMap,go=new WeakMap,bo=new WeakSet,vo=function(){return document.querySelectorAll(`[commandfor="${this.getNativeDialog().id}"]`)},o(wo,"observedAttributes",["open"]);var yo=class extends fe{mount(e){Eo(this,e,(()=>{let e=this.getDialog(),t=e.getNativeDialog();if(!t.hasAttribute("open"))return;let n=new Event("cancel",{bubbles:!1,cancelable:!0});!e.dispatchEvent(n)||t.close()}))}getDialog(){let e=this.closest("el-dialog");if(!e)throw new Error("[ElDialogPanel] No `<el-dialog>` parent found");return e}},Ao=class extends fe{mount(){this.setAttribute("inert","")}};me("el-dialog",wo);me("el-dialog-panel",yo);me("el-dialog-backdrop",Ao);function Eo(e,t,n){let o=null;document.addEventListener("pointerdown",(e=>{o=e.composedPath()[0]||e.target}),!0),document.addEventListener("click",(t=>{if(o!==t.target)return;if(t.target===e){let{clientX:o,clientY:a}=t,l=e.getBoundingClientRect();if(o>=l.left&&o<=l.right&&a>=l.top&&a<=l.bottom)return;n(t);return}let a=e.closest("dialog");a&&a.contains(t.target)&&!e.contains(t.target)?n(t):t.target!==t.target.ownerDocument.documentElement||n(t)}),{signal:t,capture:!0})}function xo(e,t,n){e.addEventListener("keydown",(e=>{e.key==="Escape"&&(e.defaultPrevented||n(e))}),{signal:t})}var So,To,ko,Lo=class extends fe{constructor(){super(...arguments);s(this,To);s(this,So,be(this))}mount(e){this.id||(this.id=On("disclosure")),this.hasAttribute("hidden")?this.removeAttributeNoCallbacks("open"):this.setAttributeNoCallbacks("open","");let t=()=>{this.hasAttribute("open")&&this.hide()},n=!this.hasAttribute("hidden");for(let o of c(this,To,ko).call(this))yn(o,e,t),o.setAttribute("aria-expanded",n.toString()),o.setAttribute("aria-controls",this.id);this.addEventListener("command",(e=>{if(e.target instanceof HTMLElement&&"command"in e)switch(e.command){case"--show":this.show(),e.preventDefault();break;case"--hide":this.hide(),e.preventDefault();break;case"--toggle":this.toggle(),e.preventDefault();break}}),{signal:e}),yn(this,e,t),e.addEventListener("abort",(()=>l(this,So).abort()))}onAttributeChange(e,t,n){switch(e){case"hidden":n===null?this.setAttributeNoCallbacks("open",""):this.removeAttributeNoCallbacks("open");for(let e of c(this,To,ko).call(this))e.setAttribute("aria-expanded",n===null?"true":"false");n===null?l(this,So).start("in"):l(this,So).start("out");break;case"open":n===null?this.hide():this.show();break}}show(){this.removeAttribute("hidden")}hide(){this.setAttribute("hidden","")}toggle(){this.hasAttribute("hidden")?this.show():this.hide()}};So=new WeakMap,To=new WeakSet,ko=function(){return document.querySelectorAll(`[commandfor="${this.id}"]`)},o(Lo,"observedAttributes",["hidden","open"]);me("el-disclosure",Lo);function Io(e,t,n,o,a){let l=null;for(let n of t)n.addEventListener("pointerdown",(t=>{t.button===0&&e.classList.contains(":popover-open")&&(l=Date.now()+100)}),{signal:o,capture:!0});e.ownerDocument.addEventListener("focusin",(o=>{if(!n.hasAttribute("open"))return;let s=o.target,u=o.relatedTarget;s!==null&&(l&&Date.now()<l||e.contains(s)||t.some((e=>e.contains(s)))||a(u))}),{signal:o})}var Do=200;function Po(e,t,n){let o=null,a="",l=null,s=null;e.id||(e.id=On(t.role));let u=t.getButton();u.id||(u.id=On(`${t.role}-button`)),Ln(e,n,(()=>[t.getButton()]),(()=>t.getButton()),(()=>t.onBeforeOpen()),(()=>{t.onBeforeClose(),b(),a="",l&&(clearTimeout(l),l=null)})),Un(e,n),e.setAttribute("popover","manual"),e.setAttribute("role",t.role),u.setAttribute("popovertarget",e.id),u.setAttribute("aria-haspopup",t.role);let c=new WeakSet;function d(){let e=t.getItems(),o={passive:!0,signal:n},a=t.role==="menu"?"menuitem":"option";for(let l of e)c.has(l)||(c.add(l),l.id||(l.id=On("item")),l.setAttribute("role",a),l.setAttribute("tabIndex","-1"),l.addEventListener("click",(()=>t.onItemClick(l)),o),Rn(l,"mouseover",n,(()=>g(l,!1))),Rn(l,"mouseout",n,(()=>b())))}d();let h=new MutationObserver(d);h.observe(e,{attributes:!1,childList:!0,subtree:!0}),Io(e,[u],e,n,(t=>{t===null&&(s=Date.now()+100),e.hidePopover()}));let p=null,f=!1;u.addEventListener("pointerdown",(t=>{if(t.button===0&&!u.matches(":disabled")){if(t.pointerType==="touch"){f=!0;return}e.togglePopover(),p=Date.now()}}),{signal:n}),document.addEventListener("pointerup",(t=>{if(t.button===0&&!u.matches(":disabled")&&e.hasAttribute("open")){if(Date.now()-(p??0)>Do){let n=t.composedPath();if(n.includes(e)){if(p!==null){let e=v();e&&e.click()}return}for(let t of n)if(t instanceof Element&&(t.getAttribute("commandfor")||t.getAttribute("popovertarget"))===e.id)return;e.hidePopover()}p=null}}),{signal:n,capture:!0}),u.addEventListener("click",(e=>{f?f=!1:(e.preventDefault(),e.stopPropagation())}),{signal:n});let m=null;e.addEventListener("beforetoggle",(e=>{let t=e;t.newState==="open"&&t.oldState==="closed"&&xn.length>0&&!m&&(m=xn[0])}),{signal:n}),e.addEventListener("toggle",(t=>{let n=t;n.newState==="closed"&&n.oldState==="open"&&setTimeout((()=>{!e.contains(document.activeElement)&&document.activeElement!==document.body||s&&Date.now()<s||(m&&m!==document.activeElement&&m.isConnected&&ue(m),m=null)}))}),{signal:n}),n.addEventListener("abort",(()=>{l&&(clearTimeout(l),l=null),h.disconnect()}));function g(t,n=!0){let a=v();a!==null&&a.setAttribute("tabIndex","-1"),e.removeAttribute("tabIndex"),t.setAttribute("tabIndex","0"),t.focus({preventScroll:!0}),o=t,n&&t.scrollIntoView({block:"nearest"})}function b(){let t=v();t!==null&&t.setAttribute("tabIndex","-1"),o=null,e.hasAttribute("open")&&(e.setAttribute("tabIndex","0"),e.focus())}function v(){return o}function w(e,n=!1){if(e==="")return null;let o=t.getItems(),a=e.toLowerCase(),l=v(),s=l?o.indexOf(l):-1;if(!n&&l&&s!==-1&&vn(l)&&(l.textContent?.trim().toLowerCase()||"").startsWith(a))return l;for(let e=s+1;e<o.length;e++)if((o[e].textContent?.trim().toLowerCase()||"").startsWith(a)&&vn(o[e]))return o[e];for(let e=0;e<=s;e++)if((o[e].textContent?.trim().toLowerCase()||"").startsWith(a)&&vn(o[e]))return o[e];return null}function y(e){let t=a==="";l&&(clearTimeout(l),l=null),a+=e.toLowerCase();let n=w(a,t);n&&g(n,!0),l=setTimeout((()=>{a="",l=null}),350)}function A(){return a!==""}return{ignoreNextFocusRestoration:()=>s=Date.now()+100,setActiveItem:g,clearActiveItem:b,getActiveItem:v,findItemBySearchQuery:w,handleSearchKey:y,hasActiveSearchQuery:A}}var Co,Mo,Oo,Bo,Ro,qo=class extends fe{constructor(){super(...arguments);s(this,Bo);s(this,Co,this.attachInternals());s(this,Mo,"");s(this,Oo,null)}mount(e){let t=this.getOptions();this.value=this.getAttribute("value")??this.value??"";let n=this.getButton();n.id||(n.id=On("select-button")),Cn(n,"--button-width",e,this),n.addEventListener("keydown",(e=>{if(!n.matches(":disabled"))switch(e.key){case"ArrowUp":t.showPopover(),this.goToItem("selected"),e.preventDefault();break;case"ArrowDown":t.showPopover(),this.goToItem("selected"),e.preventDefault();break;case"Enter":e.preventDefault(),l(this,Co).form&&l(this,Co).form.requestSubmit();break;case" ":if(t.hasAttribute("open")&&l(this,Oo)&&l(this,Oo).hasActiveSearchQuery()){e.preventDefault(),e.stopPropagation(),l(this,Oo).handleSearchKey(e.key);break}e.preventDefault(),t.hasAttribute("open")?t.hidePopover():(t.showPopover(),this.goToItem("selected"));break;default:t.hasAttribute("open")&&e.key.length===1&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(e.preventDefault(),e.stopPropagation(),this.handleSearchKey(e.key));break}}),{signal:e});for(let e of l(this,Co).labels)e.setAttribute("for",n.id);u(this,Oo,Po(t,{role:"listbox",getItems:()=>this.getItems(),onItemClick:e=>this.setSelectedOption(e),getButton:()=>this.getButton(),onBeforeOpen:()=>this.onBeforeOpen(),onBeforeClose:()=>this.onBeforeClose()},e)),t.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":return e.preventDefault(),e.stopPropagation(),this.goToItem(3);case"ArrowUp":return e.preventDefault(),e.stopPropagation(),this.goToItem(2);case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),this.goToItem(1);case" ":if(l(this,Oo)&&l(this,Oo).hasActiveSearchQuery()){e.preventDefault(),e.stopPropagation(),l(this,Oo).handleSearchKey(e.key);return}case"Enter":{e.preventDefault(),e.stopPropagation();let n=this.getActiveItem();n?n.click():t.hidePopover();return}case"Tab":l(this,Oo)&&l(this,Oo).ignoreNextFocusRestoration();break;case"Escape":e.preventDefault(),e.stopPropagation(),t.hidePopover(),n.focus();break;default:e.key.length===1&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(e.preventDefault(),e.stopPropagation(),l(this,Oo)&&l(this,Oo).handleSearchKey(e.key));break}}),{signal:e}),t.addEventListener("toggle",(e=>{e.newState==="open"&&this.onOpen()}),{signal:e});let o=Array.from(t.querySelectorAll("el-option[disabled]"));for(let e of o)e.setAttribute("aria-disabled","true"),e.setAttribute("aria-selected","false")}onAttributeChange(e,t,n){switch(e){case"value":n!==null&&(this.value=n);break;case"required":c(this,Bo,Ro).call(this);break}}getButton(){let e=this.querySelector("button");if(!e)throw new Error("`<el-select>` must contain a button element.");return e}getOptions(){let e=this.querySelector("el-options");if(!e)throw new Error("`<el-select>` must contain a `<el-options>` element.");return e}setSelectedOption(e){this.value=e.getAttribute("value"),this.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),this.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0})),this.getOptions().hidePopover()}getOptionByName(e){return this.getOptions().getOptionByName(e)}getItems(){return this.getOptions().getItems()}getActiveItem(){return l(this,Oo)?.getActiveItem()}getSelectedOption(){return this.getOptionByName(l(this,Mo))}goToItem(e=4){let t=this.getItems();if(t.length===0)return;let n=this.getActiveItem();if(n===null&&(e===2||e===3)){this.goToItem("selected");return}if(e==="selected"){let e=this.getSelectedOption();e&&vn(e)?this.setActiveItem(e):this.goToItem(0);return}let o=En(t,n,e);o&&this.setActiveItem(o)}setActiveItem(e){l(this,Oo)&&l(this,Oo).setActiveItem(e)}clearActiveItem(){l(this,Oo)&&l(this,Oo).clearActiveItem()}onBeforeOpen(){let e=this.getButton(),t=e.dataset.originalTabIndex;t&&(e.dataset.originalTabIndex=t),e.setAttribute("tabIndex","-1")}onOpen(){this.getActiveItem()===null&&this.goToItem("selected")}onBeforeClose(){let e=this.getButton(),t=e.dataset.originalTabIndex;delete e.dataset.originalTabIndex,t!==void 0?e.setAttribute("tabIndex",t):e.removeAttribute("tabIndex");let n=this.getActiveItem();n!==null&&n.setAttribute("tabIndex","-1")}handleSearchKey(e){l(this,Oo)&&l(this,Oo).handleSearchKey(e)}set value(e){u(this,Mo,e),l(this,Co).setFormValue(e),c(this,Bo,Ro).call(this);let t=this.getSelectedOption();if(t){for(let e of this.getItems())e.setAttribute("aria-selected","false");t.setAttribute("aria-selected","true");try{this.querySelectorAll("el-selectedcontent").forEach((e=>e.update()))}catch{}}}get value(){return l(this,Mo)}};Co=new WeakMap,Mo=new WeakMap,Oo=new WeakMap,Bo=new WeakSet,Ro=function(){this.hasAttribute("required")&&!l(this,Mo)?l(this,Co).setValidity({valueMissing:!0},wn.selectRequired,this.getButton()):l(this,Co).setValidity({})},o(qo,"formAssociated",!0),o(qo,"observedAttributes",["required"]);var Wo=class extends fe{mount(){this.update()}update(){let e=this.getSelect().getSelectedOption();if(!e)return;let t=document.createDocumentFragment();for(let n of e.childNodes)t.append(n.cloneNode(!0));this.replaceChildren(t)}getSelect(){let e=this.closest("el-select");if(!e)throw new Error("`<el-selectedcontent>` must be inside of a `<el-select>` element.");return e}};me("el-select",qo);me("el-selectedcontent",Wo);var Fo,Ho=class extends fe{getButton(){let e=this.querySelector("button");if(!e)throw new Error("[ElDropdown] No `<button>` element found");return e}mount(e){let t=this.getButton();t.id||(t.id=On("dropdown-button")),Cn(t,"--button-width",e,this);let n=this.querySelectorAll("label");for(let e of n)e.setAttribute("for",t.id)}},No=class extends fe{constructor(){super(...arguments);s(this,Fo,null)}mount(e){u(this,Fo,Po(this,{role:"menu",getItems:()=>this.getItems(),onItemClick:()=>this.hidePopover(),getButton:()=>this.getDropdown().getButton(),onBeforeOpen:()=>this.onBeforeOpen(),onBeforeClose:()=>this.onBeforeClose()},e));let t=this.getDropdown().getButton();t.addEventListener("keydown",(e=>{if(!t.disabled)switch(e.key){case"ArrowDown":this.showPopover(),this.goToItem(0),e.preventDefault();break;case"ArrowUp":this.showPopover(),this.goToItem(1),e.preventDefault();break;case" ":if(this.hasAttribute("open")&&l(this,Fo)&&l(this,Fo).hasActiveSearchQuery()){e.preventDefault(),e.stopPropagation(),l(this,Fo).handleSearchKey(e.key);break}case"Enter":e.preventDefault(),this.hasAttribute("open")?this.hidePopover():(this.showPopover(),this.goToItem(0));break;default:this.hasAttribute("open")&&e.key.length===1&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(e.preventDefault(),e.stopPropagation(),l(this,Fo)&&l(this,Fo).handleSearchKey(e.key));break}}),{signal:e}),this.addEventListener("keydown",(e=>{switch(e.key){case"ArrowDown":return e.preventDefault(),e.stopPropagation(),this.goToItem(3);case"ArrowUp":return e.preventDefault(),e.stopPropagation(),this.goToItem(2);case"Home":case"PageUp":return e.preventDefault(),e.stopPropagation(),this.goToItem(0);case"End":case"PageDown":return e.preventDefault(),e.stopPropagation(),this.goToItem(1);case" ":if(l(this,Fo)&&l(this,Fo).hasActiveSearchQuery()){e.preventDefault(),e.stopPropagation(),l(this,Fo).handleSearchKey(e.key);return}case"Enter":{e.preventDefault(),e.stopPropagation();let t=this.getActiveItem();t?t.click():this.hidePopover();return}case"Tab":l(this,Fo)&&l(this,Fo).ignoreNextFocusRestoration();break;case"Escape":e.preventDefault(),e.stopPropagation(),this.hidePopover(),t.focus();break;default:e.key.length===1&&!e.ctrlKey&&!e.altKey&&!e.metaKey&&(e.preventDefault(),e.stopPropagation(),l(this,Fo)&&l(this,Fo).handleSearchKey(e.key));break}}),{signal:e})}onBeforeOpen(){let e=this.getDropdown().getButton(),t=e.dataset.originalTabIndex;t&&(e.dataset.originalTabIndex=t),e.setAttribute("tabIndex","-1"),this.getActiveItem()===null&&(this.setAttribute("tabIndex","0"),setTimeout((()=>this.focus({preventScroll:!0}))))}onBeforeClose(){let e=this.getDropdown().getButton(),t=e.dataset.originalTabIndex;delete e.dataset.originalTabIndex,t!==void 0?e.setAttribute("tabIndex",t):e.removeAttribute("tabIndex");let n=this.getActiveItem();n!==null&&n.setAttribute("tabIndex","-1")}goToItem(e=4){let t=this.getItems();if(t.length===0)return;let n=this.getActiveItem(),o=En(t,n,e);o&&this.setActiveItem(o)}setActiveItem(e){l(this,Fo)&&l(this,Fo).setActiveItem(e)}clearActiveItem(){l(this,Fo)&&l(this,Fo).clearActiveItem()}getDropdown(){let e=this.closest("el-dropdown");if(!e)throw new Error("[ElMenu] No `<el-dropdown>` element found");return e}getItems(){return Array.from(this.querySelectorAll(`${An},[role="menuitem"]`))}getActiveItem(){return l(this,Fo)?.getActiveItem()||null}onAttributeChange(e,t,n){switch(e){case"open":n===null?this.hidePopover():this.showPopover();break}}};Fo=new WeakMap,o(No,"observedAttributes",["anchor","open"]);me("el-menu",No);me("el-dropdown",Ho);var $o=class extends fe{onAttributeChange(e,t,n){switch(e){case"open":n===null?this.hidePopover():this.showPopover();break}}getOptionByName(e){let t=this.querySelector(`el-option[value="${e}"]`);return t||null}getItems(){return Array.from(this.querySelectorAll("el-option:not([disabled])"))}};o($o,"observedAttributes",["anchor","open"]);var Ko=class extends fe{};me("el-options",$o);me("el-option",Ko);var jo=class extends fe{getPopovers(){return Array.from(this.querySelectorAll("* > el-popover"))}},Vo=class extends fe{mount(e){if(!this.id)throw new Error("[ElPopover] No id found for popover (ensure `id` is set)");let t=this.getButtons();for(let n of t)n.id||(n.id=On("popover-button")),n.addEventListener("keydown",(e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.togglePopover())}),{signal:e});Ln(this,e,(()=>this.getButtons())),this.setAttribute("tabindex","-1");let n=this,o=this.closest("el-popover-group");o&&o.getPopovers().includes(this)&&(n=o),Io(n,t,this,e,(()=>this.hidePopover()));let a=new AbortController;e.addEventListener("abort",(()=>a.abort())),this.addEventListener("beforetoggle",(e=>{if(e.newState==="open"){let n=In(e,t);n&&Cn(n,"--button-width",a.signal,this)}else a.abort(),a=new AbortController})),this.addEventListener("toggle",(e=>{e.newState==="closed"&&e.oldState==="open"&&setTimeout((()=>{if(!this.contains(document.activeElement)&&document.activeElement!==document.body)return;let n=In(e,t);n&&n!==document.activeElement&&n.isConnected&&ue(n)}))}),{signal:e})}getButtons(){let e=this.id,t=Array.from(document.querySelectorAll(`[popovertarget="${e}"]`));if(!t)throw new Error('[ElPopover] No button found for popover (ensure you add a `<button popovertarget="${id}">` on the page)');return t}onAttributeChange(e,t,n){switch(e){case"open":n===null?this.hidePopover():this.showPopover();break}}};o(Vo,"observedAttributes",["anchor","open"]);me("el-popover",Vo);me("el-popover-group",jo);var zo=class extends fe{mount(e){let t=this.getList(),n=this.getPanels(),o=t.getTabButtons(),a=n.getPanels();if(o.length!==a.length){console.warn("[ElTabGroup] Mismatch between number of tabs and panels");return}for(let e=0;e<a.length;e++){let t=a[e],n=o[e];n.id||(n.id=On("tailwindplus-tab")),t.id||(t.id=On("tailwindplus-tab-panel")),t.setAttribute("aria-labelledby",n.id),n.setAttribute("aria-controls",t.id),n.setAttribute("role","tab")}let l=this.getActiveTab();l===-1&&(l=0),t.setActiveTab(l),n.setActivePanel(l),t.addEventListener("keydown",(e=>{switch(e.key){case"ArrowLeft":{e.preventDefault();let t=this.getActiveTab()-1;t<0&&(t=o.length-1),this.setActiveTab(t),o[t].focus();break}case"ArrowRight":{e.preventDefault();let t=this.getActiveTab()+1;t>=o.length&&(t=0),this.setActiveTab(t),o[t].focus();break}case"Home":case"PageUp":e.preventDefault(),this.setActiveTab(0),o[0].focus();break;case"End":case"PageDown":e.preventDefault(),this.setActiveTab(o.length-1),o[o.length-1].focus();break}}),{signal:e});for(let t=0;t<o.length;t++)o[t].addEventListener("click",(e=>{e.preventDefault(),this.setActiveTab(t)}),{signal:e})}getActiveTab(){let e=this.querySelector("el-tab-panels"),t=e.getPanels().find((e=>!e.hasAttribute("hidden")));return t?e.getPanels().indexOf(t):-1}getList(){let e=this.querySelector("el-tab-list");if(!e)throw new Error("[ElTabGroup] No `<el-tab-list>` element found");return e}getPanels(){let e=this.querySelector("el-tab-panels");if(!e)throw new Error("[ElTabGroup] No `<el-tab-panels>` element found");return e}setActiveTab(e){if(this.getActiveTab()===e)return;let t=this.getList(),n=this.getPanels(),o=t.getTabButtons();e<0||e>=o.length||(t.setActiveTab(e),n.setActivePanel(e))}},Uo=class extends fe{mount(){this.setAttribute("role","tablist"),this.setAttribute("aria-orientation","horizontal")}getTabButtons(){let e=this.querySelectorAll("button");return Array.from(e)}setActiveTab(e){this.getTabButtons().forEach(((t,n)=>{let o=n===e;t.setAttribute("tabindex",o?"0":"-1"),t.setAttribute("aria-selected",o?"true":"false")}))}},Go=class extends fe{mount(){let e=this.getTabGroup().getList(),t=this.getPanels(),n=new MutationObserver((n=>{for(let o of n){let n=o.target;switch(o.attributeName){case"hidden":if(!n.hasAttribute(o.attributeName)){let o=t.indexOf(n);e.setActiveTab(o),this.setActivePanel(o)}}}}));for(let e of t)e.setAttribute("role","tabpanel"),e.setAttribute("tabindex","0"),n.observe(e,{attributeFilter:["hidden"],attributes:!0})}getTabGroup(){let e=this.closest("el-tab-group");if(!e)throw new Error("`<el-tab-panels>` must be inside of a `<el-tab-group>` element.");return e}getPanels(){return Array.from(this.children)}setActivePanel(e){this.getPanels().forEach(((t,n)=>{t.toggleAttribute("hidden",n!==e)}))}};me("el-tab-list",Uo);me("el-tab-panels",Go);me("el-tab-group",zo);typeof globalThis.window<"u"&&setTimeout((()=>window.dispatchEvent(new Event("elements:ready"))));
4
+