ariadne_view_components 0.0.96.13 → 0.0.97.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +14 -0
- data/app/assets/javascripts/ariadne_view_components.js +14 -14
- data/app/assets/javascripts/ariadne_view_components.js.br +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.gz +0 -0
- data/app/assets/javascripts/ariadne_view_components.js.map +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css +1 -1
- data/app/assets/stylesheets/ariadne_view_components.css.br +0 -0
- data/app/assets/stylesheets/ariadne_view_components.css.gz +0 -0
- data/app/components/ariadne/form/select/component.rb +3 -7
- data/app/components/ariadne/form/text_field/component.rb +3 -3
- data/app/components/ariadne/layout/content/README.md +63 -0
- data/app/components/ariadne/ui/button/component.rb +1 -1
- data/app/components/ariadne/ui/card/component.rb +1 -1
- data/app/components/ariadne/ui/dialog/component.html.erb +34 -13
- data/app/components/ariadne/ui/dialog/component.rb +27 -20
- data/app/components/ariadne/ui/dialog/component.ts +68 -8
- data/app/components/ariadne/ui/dialog_trigger/component.ts +47 -0
- data/app/frontend/stylesheets/theme.css +1 -1
- data/lib/ariadne/view_components/version.rb +1 -1
- metadata +4 -2
@@ -1,4 +1,4 @@
|
|
1
|
-
class mi{constructor(t,e,{tabInsertsSuggestions:s,defaultFirstOption:i,scrollIntoViewOptions:r}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=s??!0,this.defaultFirstOption=i??!1,this.scrollIntoViewOptions=r??{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=o=>pi(o,this),this.compositionEventHandler=o=>vi(o,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",fn),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",fn)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(ge)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(ge)[0],s=Array.from(this.list.querySelectorAll('[role="option"]')).filter(ge),i=s.indexOf(e);if(i===s.length-1&&t===1||i===0&&t===-1){this.clearSelection(),this.input.focus();return}let r=t===1?0:s.length-1;if(e&&i>=0){const a=i+t;a>=0&&a<s.length&&(r=a)}const o=s[r];if(o)for(const a of s)a.removeAttribute("data-combobox-option-default"),o===a?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),bi(o),o.scrollIntoView(this.scrollIntoViewOptions)):a.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function pi(n,t){if(!(n.shiftKey||n.metaKey||n.altKey)&&!(!t.ctrlBindings&&n.ctrlKey)&&!t.isComposing)switch(n.key){case"Enter":mn(t.input,t.list)&&n.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&mn(t.input,t.list)&&n.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),n.preventDefault();break;case"ArrowUp":t.navigate(-1),n.preventDefault();break;case"n":t.ctrlBindings&&n.ctrlKey&&(t.navigate(1),n.preventDefault());break;case"p":t.ctrlBindings&&n.ctrlKey&&(t.navigate(-1),n.preventDefault());break;default:if(n.ctrlKey)break;t.clearSelection()}}function fn(n){if(!(n.target instanceof Element))return;const t=n.target.closest('[role="option"]');t&&t.getAttribute("aria-disabled")!=="true"&&gi(t,{event:n})}function mn(n,t){const e=t.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return e?(e.getAttribute("aria-disabled")==="true"||e.click(),!0):!1}function gi(n,t){n.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:t}))}function bi(n){n.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function ge(n){return!n.hidden&&!(n instanceof HTMLInputElement&&n.type==="hidden")&&(n.offsetWidth>0||n.offsetHeight>0)}function vi(n,t){t.isComposing=n.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function yi(n,t=0){let e;return function(...s){clearTimeout(e),e=window.setTimeout(()=>{clearTimeout(e),n(...s)},t)}}const wi=window.testScreenReaderDelay||100;class Ei{constructor(t,e,s,i=!1){var r;if(this.container=t,this.input=e,this.results=s,this.combobox=new mi(e,s,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=s.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const o=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(o==null?void 0:o.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=yi(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),(r=this.clearButton)===null||r===void 0||r.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),this.input.getAttribute("aria-expanded")==="true"&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if(t.key==="Escape"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowUp"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowDown"&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement)||(this.close(),e instanceof HTMLAnchorElement))return;const s=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=s,s||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout(()=>{this.feedback&&(this.feedback.textContent=t)},wi)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty){this.close();return}const e=this.container.src;if(!e)return;const s=new URL(e,window.location.href),i=new URLSearchParams(s.search.slice(1));i.append("q",t),s.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(s).then(r=>{this.results.innerHTML=r,this.identifyOptions(),this.combobox.indicateDefaultOption();const o=this.results.querySelectorAll('[role="option"]'),a=!!o.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,l=o.length,[c]=o,u=c==null?void 0:c.textContent;this.autoselectEnabled&&u?this.updateFeedbackForScreenReaders(`${l} results. ${u} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${l||"No"} results.`),a?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var Y=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},be=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},Ti=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e},ft,kt,Lt,_t,Zt;const Ai=globalThis.HTMLElement||null;class xi extends Event{constructor(t,e){var{relatedTarget:s}=e,i=Ti(e,["relatedTarget"]);super(t,i),this.relatedTarget=s}}const J=new WeakMap;let ve=null;class Oi extends Ai{constructor(){super(...arguments),ft.add(this),kt.set(this,null),Lt.set(this,null),Zt.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){ve=t===null?t:Promise.resolve(t)}get forElement(){var t;if(!((t=Y(this,kt,"f"))===null||t===void 0)&&t.isConnected)return Y(this,kt,"f");const e=this.getAttribute("for"),s=this.getRootNode();return e&&(s instanceof Document||s instanceof ShadowRoot)?s.getElementById(e):null}set forElement(t){be(this,kt,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return!((t=Y(this,Lt,"f"))===null||t===void 0)&&t.isConnected?Y(this,Lt,"f"):this.querySelector("input")}set inputElement(t){be(this,Lt,t,"f"),Y(this,ft,"m",_t).call(this)}connectedCallback(){this.isConnected&&(Y(this,ft,"m",_t).call(this),new MutationObserver(()=>{J.get(this)||Y(this,ft,"m",_t).call(this)}).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=J.get(this);t&&(t.destroy(),J.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;(e=Y(this,Zt,"f"))===null||e===void 0||e.abort();const{signal:s}=be(this,Zt,new AbortController,"f"),i=await fetch(t.toString(),{signal:s,headers:{Accept:"text/fragment+html"}});if(!i.ok)throw new Error(await i.text());return ve?(await ve).createHTML(await i.text(),i):await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,s){var i,r;if(e===s)return;const o=J.get(this);if(o)switch((this.forElement!==((i=J.get(this))===null||i===void 0?void 0:i.results)||this.inputElement!==((r=J.get(this))===null||r===void 0?void 0:r.input))&&Y(this,ft,"m",_t).call(this),t){case"open":s===null?o.close():o.open();break;case"value":s!==null&&(o.input.value=s),this.dispatchEvent(new xi("auto-complete-change",{bubbles:!0,relatedTarget:o.input}));break}}}kt=new WeakMap,Lt=new WeakMap,Zt=new WeakMap,ft=new WeakSet,_t=function(){var t;(t=J.get(this))===null||t===void 0||t.destroy();const{forElement:e,inputElement:s}=this;if(!e||!s)return;const i=this.getAttribute("data-autoselect")==="true";J.set(this,new Ei(this,s,e,i)),e.setAttribute("role","listbox")};const ye=typeof globalThis<"u"?globalThis:window;try{ye.AutocompleteElement=ye.AutoCompleteElement=Oi.define()}catch(n){if(!(ye.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class ke extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const s=[V(t,"compositionstart",i=>yn(this,i)),V(t,"compositionend",i=>yn(this,i)),V(t,"click",i=>bn(t,i)),V(t,"change",i=>bn(t,i)),V(t,"keydown",i=>_i(t,this,i)),V(t,"toggle",()=>pn(t,this),{once:!0}),V(t,"toggle",()=>Ci(t)),this.preload?V(t,"mouseover",()=>pn(t,this),{once:!0}):Si,...Mi(t)];gt.set(this,{subscriptions:s,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=gt.get(this);if(t){gt.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const gt=new WeakMap,Si={unsubscribe(){}};function V(n,t,e,s=!1){return n.addEventListener(t,e,s),{unsubscribe:()=>{n.removeEventListener(t,e,s)}}}function pn(n,t){const e=t.getAttribute("src");if(!e)return;const s=gt.get(t);if(!s||s.loaded)return;s.loaded=!0;const i=t.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",()=>ms(n)),i.setAttribute("src",e))}function Mi(n){let t=!1;const e=()=>t=!0,s=()=>t=!1,i=()=>{n.hasAttribute("open")&&(ms(n)||t||ki(n))};return[V(n,"mousedown",e),V(n,"keydown",s),V(n,"toggle",i)]}function Ci(n){if(n.hasAttribute("open"))for(const t of document.querySelectorAll("details[open] > details-menu")){const e=t.closest("details");e&&e!==n&&!e.contains(n)&&e.removeAttribute("open")}}function ms(n){if(!n.hasAttribute("open"))return!1;const t=n.querySelector("details-menu [autofocus]");return t?(t.focus(),!0):!1}function ki(n){const t=document.activeElement;if(t&&ps(t)&&n.contains(t))return;const e=Dt(n,!0);e&&e.focus()}function Dt(n,t){const e=Array.from(n.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),s=document.activeElement,i=s instanceof HTMLElement?e.indexOf(s):-1,r=t?e[i+1]:e[i-1],o=t?e[0]:e[e.length-1];return r||o}const gn=navigator.userAgent.match(/Macintosh/);function bn(n,t){const e=t.target;if(e instanceof Element&&e.closest("details")===n){if(t.type==="click"){const s=e.closest('[role="menuitem"], [role="menuitemradio"]');if(!s)return;const i=s.querySelector("input");if(s.tagName==="LABEL"&&e===i)return;s.tagName==="LABEL"&&i&&!i.checked||vn(s,n)}else if(t.type==="change"){const s=e.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');s&&vn(s,n)}}}function Li(n,t){for(const e of t.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const s=e.querySelector('input[type="radio"], input[type="checkbox"]');let i=(e===n).toString();s instanceof HTMLInputElement&&(i=s.indeterminate?"mixed":s.checked.toString()),e.setAttribute("aria-checked",i)}}function vn(n,t){if(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")return;const e=n.closest("details-menu");!e||!e.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:n}}))||(Di(n,t),Li(n,t),n.getAttribute("role")!=="menuitemcheckbox"&&gs(t),e.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:n}})))}function _i(n,t,e){if(!(e instanceof KeyboardEvent)||n.querySelector("details[open]"))return;const s=gt.get(t);if(!s||s.isComposing)return;const i=e.target instanceof Element&&e.target.tagName==="SUMMARY";switch(e.key){case"Escape":n.hasAttribute("open")&&(gs(n),e.preventDefault(),e.stopPropagation());break;case"ArrowDown":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Dt(n,!0);r&&r.focus(),e.preventDefault()}break;case"ArrowUp":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Dt(n,!1);r&&r.focus(),e.preventDefault()}break;case"n":if(gn&&e.ctrlKey){const r=Dt(n,!0);r&&r.focus(),e.preventDefault()}break;case"p":if(gn&&e.ctrlKey){const r=Dt(n,!1);r&&r.focus(),e.preventDefault()}break;case" ":case"Enter":{const r=document.activeElement;r instanceof HTMLElement&&ps(r)&&r.closest("details")===n&&(e.preventDefault(),e.stopPropagation(),r.click())}break}}function ps(n){const t=n.getAttribute("role");return t==="menuitem"||t==="menuitemcheckbox"||t==="menuitemradio"}function gs(n){if(!n.hasAttribute("open"))return;n.removeAttribute("open");const e=n.querySelector("summary");e&&e.focus()}function Di(n,t){const e=t.querySelector("[data-menu-button]");if(!e)return;const s=Fi(n);if(s)e.textContent=s;else{const i=Bi(n);i&&(e.innerHTML=i)}}function Fi(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-text")?n:n.querySelector("[data-menu-button-text]");return t?t.getAttribute("data-menu-button-text")||t.textContent:null}function Bi(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-contents")?n:n.querySelector("[data-menu-button-contents]");return t?t.innerHTML:null}function yn(n,t){const e=gt.get(n);e&&(e.isComposing=t.type==="compositionstart")}window.customElements.get("details-menu")||(window.DetailsMenuElement=ke,window.customElements.define("details-menu",ke));const bt=new WeakMap,rt=new WeakMap,X=new WeakMap;function Vt(n){const t=n.currentTarget;if(!(t instanceof Et))return;const{box:e,image:s}=X.get(t)||{};if(!e||!s)return;let i=0,r=0;if(n instanceof KeyboardEvent)n.key==="ArrowUp"?r=-1:n.key==="ArrowDown"?r=1:n.key==="ArrowLeft"?i=-1:n.key==="ArrowRight"&&(i=1);else if(rt.has(t)&&n instanceof MouseEvent){const o=rt.get(t);i=n.pageX-o.dragStartX,r=n.pageY-o.dragStartY}else if(rt.has(t)&&n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0],{dragStartX:l,dragStartY:c}=rt.get(t);i=o-l,r=a-c}if(i!==0||r!==0){const o=Math.min(Math.max(0,e.offsetLeft+i),s.width-e.offsetWidth),a=Math.min(Math.max(0,e.offsetTop+r),s.height-e.offsetHeight);e.style.left=`${o}px`,e.style.top=`${a}px`,ws(t,{x:o,y:a,width:e.offsetWidth,height:e.offsetHeight})}if(n instanceof MouseEvent)rt.set(t,{dragStartX:n.pageX,dragStartY:n.pageY});else if(n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0];rt.set(t,{dragStartX:o,dragStartY:a})}}function vt(n){const t=n.target;if(!(t instanceof HTMLElement))return;const e=bs(t);if(!(e instanceof Et))return;const{box:s}=X.get(e)||{};if(!s)return;const i=e.getBoundingClientRect();let r,o,a;if(n instanceof KeyboardEvent){if(n.key==="Escape")return ys(e);if(n.key==="-"&&(a=-10),n.key==="="&&(a=10),!a)return;r=s.offsetWidth+a,o=s.offsetHeight+a,bt.set(e,{startX:s.offsetLeft,startY:s.offsetTop})}else if(n instanceof MouseEvent){const l=bt.get(e);if(!l)return;r=n.pageX-l.startX-i.left-window.pageXOffset,o=n.pageY-l.startY-i.top-window.pageYOffset}else if(n instanceof TouchEvent){const l=bt.get(e);if(!l)return;r=n.changedTouches[0].pageX-l.startX-i.left-window.pageXOffset,o=n.changedTouches[0].pageY-l.startY-i.top-window.pageYOffset}r&&o&&vs(e,r,o,!(n instanceof KeyboardEvent))}function bs(n){const t=n.getRootNode();return t instanceof ShadowRoot?t.host:n}function wn(n){const t=n.currentTarget;if(!(t instanceof HTMLElement))return;const e=bs(t);if(!(e instanceof Et))return;const{box:s}=X.get(e)||{};if(!s)return;const i=n.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const r=i.getAttribute("data-direction")||"";e.addEventListener("mousemove",vt),e.addEventListener("touchmove",vt,{passive:!0}),["nw","se"].indexOf(r)>=0&&e.classList.add("nwse"),["ne","sw"].indexOf(r)>=0&&e.classList.add("nesw"),bt.set(e,{startX:s.offsetLeft+(["se","ne"].indexOf(r)>=0?0:s.offsetWidth),startY:s.offsetTop+(["se","sw"].indexOf(r)>=0?0:s.offsetHeight)}),vt(n)}else e.addEventListener("mousemove",Vt),e.addEventListener("touchmove",Vt,{passive:!0})}function vs(n,t,e,s=!0){let i=Math.max(Math.abs(t),Math.abs(e),10);const r=bt.get(n);if(!r)return;const{box:o,image:a}=X.get(n)||{};if(!o||!a)return;i=Math.min(i,e>0?a.height-r.startY:r.startY,t>0?a.width-r.startX:r.startX);const l=s?Math.round(Math.max(0,t>0?r.startX:r.startX-i)):o.offsetLeft,c=s?Math.round(Math.max(0,e>0?r.startY:r.startY-i)):o.offsetTop;o.style.left=`${l}px`,o.style.top=`${c}px`,o.style.width=`${i}px`,o.style.height=`${i}px`,ws(n,{x:l,y:c,width:i,height:i})}function ys(n){const{image:t}=X.get(n)||{};if(!t)return;const e=Math.round(t.clientWidth>t.clientHeight?t.clientHeight:t.clientWidth);bt.set(n,{startX:(t.clientWidth-e)/2,startY:(t.clientHeight-e)/2}),vs(n,e,e)}function we(n){const t=n.currentTarget;t instanceof Et&&(rt.delete(t),t.classList.remove("nwse","nesw"),t.removeEventListener("mousemove",vt),t.removeEventListener("mousemove",Vt),t.removeEventListener("touchmove",vt),t.removeEventListener("touchmove",Vt))}function ws(n,t){const{image:e}=X.get(n)||{};if(!e)return;const s=e.naturalWidth/e.width;for(const i in t){const r=Math.round(t[i]*s);t[i]=r;const o=n.querySelector(`[data-image-crop-input='${i}']`);o instanceof HTMLInputElement&&(o.value=r.toString())}n.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:t}))}class Et extends HTMLElement{connectedCallback(){if(X.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
1
|
+
class Ho{constructor(t,e,{tabInsertsSuggestions:s,defaultFirstOption:i,scrollIntoViewOptions:r}={}){this.input=t,this.list=e,this.tabInsertsSuggestions=s??!0,this.defaultFirstOption=i??!1,this.scrollIntoViewOptions=r??{block:"nearest",inline:"nearest"},this.isComposing=!1,e.id||(e.id=`combobox-${Math.random().toString().slice(2,6)}`),this.ctrlBindings=!!navigator.userAgent.match(/Macintosh/),this.keyboardEventHandler=o=>Uo(o,this),this.compositionEventHandler=o=>qo(o,this),this.inputHandler=this.clearSelection.bind(this),t.setAttribute("role","combobox"),t.setAttribute("aria-controls",e.id),t.setAttribute("aria-expanded","false"),t.setAttribute("aria-autocomplete","list"),t.setAttribute("aria-haspopup","listbox")}destroy(){this.clearSelection(),this.stop(),this.input.removeAttribute("role"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-expanded"),this.input.removeAttribute("aria-autocomplete"),this.input.removeAttribute("aria-haspopup")}start(){this.input.setAttribute("aria-expanded","true"),this.input.addEventListener("compositionstart",this.compositionEventHandler),this.input.addEventListener("compositionend",this.compositionEventHandler),this.input.addEventListener("input",this.inputHandler),this.input.addEventListener("keydown",this.keyboardEventHandler),this.list.addEventListener("click",Cs),this.indicateDefaultOption()}stop(){this.clearSelection(),this.input.setAttribute("aria-expanded","false"),this.input.removeEventListener("compositionstart",this.compositionEventHandler),this.input.removeEventListener("compositionend",this.compositionEventHandler),this.input.removeEventListener("input",this.inputHandler),this.input.removeEventListener("keydown",this.keyboardEventHandler),this.list.removeEventListener("click",Cs)}indicateDefaultOption(){var t;this.defaultFirstOption&&((t=Array.from(this.list.querySelectorAll('[role="option"]:not([aria-disabled="true"])')).filter(Qe)[0])===null||t===void 0||t.setAttribute("data-combobox-option-default","true"))}navigate(t=1){const e=Array.from(this.list.querySelectorAll('[aria-selected="true"]')).filter(Qe)[0],s=Array.from(this.list.querySelectorAll('[role="option"]')).filter(Qe),i=s.indexOf(e);if(i===s.length-1&&t===1||i===0&&t===-1){this.clearSelection(),this.input.focus();return}let r=t===1?0:s.length-1;if(e&&i>=0){const a=i+t;a>=0&&a<s.length&&(r=a)}const o=s[r];if(o)for(const a of s)a.removeAttribute("data-combobox-option-default"),o===a?(this.input.setAttribute("aria-activedescendant",o.id),o.setAttribute("aria-selected","true"),zo(o),o.scrollIntoView(this.scrollIntoViewOptions)):a.removeAttribute("aria-selected")}clearSelection(){this.input.removeAttribute("aria-activedescendant");for(const t of this.list.querySelectorAll('[aria-selected="true"]'))t.removeAttribute("aria-selected");this.indicateDefaultOption()}}function Uo(n,t){if(!(n.shiftKey||n.metaKey||n.altKey)&&!(!t.ctrlBindings&&n.ctrlKey)&&!t.isComposing)switch(n.key){case"Enter":ks(t.input,t.list)&&n.preventDefault();break;case"Tab":t.tabInsertsSuggestions&&ks(t.input,t.list)&&n.preventDefault();break;case"Escape":t.clearSelection();break;case"ArrowDown":t.navigate(1),n.preventDefault();break;case"ArrowUp":t.navigate(-1),n.preventDefault();break;case"n":t.ctrlBindings&&n.ctrlKey&&(t.navigate(1),n.preventDefault());break;case"p":t.ctrlBindings&&n.ctrlKey&&(t.navigate(-1),n.preventDefault());break;default:if(n.ctrlKey)break;t.clearSelection()}}function Cs(n){if(!(n.target instanceof Element))return;const t=n.target.closest('[role="option"]');t&&t.getAttribute("aria-disabled")!=="true"&&Wo(t,{event:n})}function ks(n,t){const e=t.querySelector('[aria-selected="true"], [data-combobox-option-default="true"]');return e?(e.getAttribute("aria-disabled")==="true"||e.click(),!0):!1}function Wo(n,t){n.dispatchEvent(new CustomEvent("combobox-commit",{bubbles:!0,detail:t}))}function zo(n){n.dispatchEvent(new Event("combobox-select",{bubbles:!0}))}function Qe(n){return!n.hidden&&!(n instanceof HTMLInputElement&&n.type==="hidden")&&(n.offsetWidth>0||n.offsetHeight>0)}function qo(n,t){t.isComposing=n.type==="compositionstart",document.getElementById(t.input.getAttribute("aria-controls")||"")&&t.clearSelection()}function Yo(n,t=0){let e;return function(...s){clearTimeout(e),e=window.setTimeout(()=>{clearTimeout(e),n(...s)},t)}}const Xo=window.testScreenReaderDelay||100;class Go{constructor(t,e,s,i=!1){var r;if(this.container=t,this.input=e,this.results=s,this.combobox=new Ho(e,s,{defaultFirstOption:i}),this.feedback=t.getRootNode().getElementById(`${this.results.id}-feedback`),this.autoselectEnabled=i,this.clearButton=t.getRootNode().getElementById(`${this.input.id||this.input.name}-clear`),this.clientOptions=s.querySelectorAll("[role=option]"),this.feedback&&(this.feedback.setAttribute("aria-live","polite"),this.feedback.setAttribute("aria-atomic","true")),this.clearButton&&!this.clearButton.getAttribute("aria-label")){const o=document.querySelector(`label[for="${this.input.name}"]`);this.clearButton.setAttribute("aria-label","clear:"),this.clearButton.setAttribute("aria-labelledby",`${this.clearButton.id} ${(o==null?void 0:o.id)||""}`)}this.input.getAttribute("aria-expanded")||this.input.setAttribute("aria-expanded","false"),this.results.popover?this.results.matches(":popover-open")&&this.results.hidePopover():this.results.hidden=!0,this.results.getAttribute("aria-label")||this.results.setAttribute("aria-label","results"),this.input.setAttribute("autocomplete","off"),this.input.setAttribute("spellcheck","false"),this.interactingWithList=!1,this.onInputChange=Yo(this.onInputChange.bind(this),300),this.onResultsMouseDown=this.onResultsMouseDown.bind(this),this.onInputBlur=this.onInputBlur.bind(this),this.onInputFocus=this.onInputFocus.bind(this),this.onKeydown=this.onKeydown.bind(this),this.onCommit=this.onCommit.bind(this),this.handleClear=this.handleClear.bind(this),this.input.addEventListener("keydown",this.onKeydown),this.input.addEventListener("focus",this.onInputFocus),this.input.addEventListener("blur",this.onInputBlur),this.input.addEventListener("input",this.onInputChange),this.results.addEventListener("mousedown",this.onResultsMouseDown),this.results.addEventListener("combobox-commit",this.onCommit),(r=this.clearButton)===null||r===void 0||r.addEventListener("click",this.handleClear)}destroy(){this.input.removeEventListener("keydown",this.onKeydown),this.input.removeEventListener("focus",this.onInputFocus),this.input.removeEventListener("blur",this.onInputBlur),this.input.removeEventListener("input",this.onInputChange),this.results.removeEventListener("mousedown",this.onResultsMouseDown),this.results.removeEventListener("combobox-commit",this.onCommit)}handleClear(t){t.preventDefault(),this.input.getAttribute("aria-expanded")==="true"&&(this.input.setAttribute("aria-expanded","false"),this.updateFeedbackForScreenReaders("Results hidden.")),this.input.value="",this.container.value="",this.input.focus(),this.input.dispatchEvent(new Event("change")),this.close()}onKeydown(t){if(t.key==="Escape"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowUp"&&this.container.open)this.close(),t.stopPropagation(),t.preventDefault();else if(t.altKey&&t.key==="ArrowDown"&&!this.container.open){if(!this.input.value.trim())return;this.open(),t.stopPropagation(),t.preventDefault()}}onInputFocus(){this.interactingWithList||this.fetchResults()}onInputBlur(){this.interactingWithList||this.close()}onCommit({target:t}){const e=t;if(!(e instanceof HTMLElement)||(this.close(),e instanceof HTMLAnchorElement))return;const s=e.getAttribute("data-autocomplete-value")||e.textContent;this.updateFeedbackForScreenReaders(`${e.textContent||""} selected.`),this.container.value=s,s||this.updateFeedbackForScreenReaders("Results hidden.")}onResultsMouseDown(){this.interactingWithList=!0}onInputChange(){this.feedback&&this.feedback.textContent&&(this.feedback.textContent=""),this.container.removeAttribute("value"),this.fetchResults()}identifyOptions(){let t=0;for(const e of this.results.querySelectorAll('[role="option"]:not([id])'))e.id=`${this.results.id}-option-${t++}`}updateFeedbackForScreenReaders(t){setTimeout(()=>{this.feedback&&(this.feedback.textContent=t)},Xo)}fetchResults(){const t=this.input.value.trim();if(!t&&!this.container.fetchOnEmpty){this.close();return}const e=this.container.src;if(!e)return;const s=new URL(e,window.location.href),i=new URLSearchParams(s.search.slice(1));i.append("q",t),s.search=i.toString(),this.container.dispatchEvent(new CustomEvent("loadstart")),this.container.fetchResult(s).then(r=>{this.results.innerHTML=r,this.identifyOptions(),this.combobox.indicateDefaultOption();const o=this.results.querySelectorAll('[role="option"]'),a=!!o.length||!!this.results.querySelectorAll('[data-no-result-found="true"]').length,l=o.length,[c]=o,u=c==null?void 0:c.textContent;this.autoselectEnabled&&u?this.updateFeedbackForScreenReaders(`${l} results. ${u} is the top result: Press Enter to activate.`):this.updateFeedbackForScreenReaders(`${l||"No"} results.`),a?this.open():this.close(),this.container.dispatchEvent(new CustomEvent("load")),this.container.dispatchEvent(new CustomEvent("loadend"))}).catch(()=>{this.container.dispatchEvent(new CustomEvent("error")),this.container.dispatchEvent(new CustomEvent("loadend"))})}open(){(this.results.popover?!this.results.matches(":popover-open"):this.results.hidden)&&(this.combobox.start(),this.results.popover?this.results.showPopover():this.results.hidden=!1),this.container.open=!0,this.interactingWithList=!0}close(){(this.results.popover?this.results.matches(":popover-open"):!this.results.hidden)&&(this.combobox.stop(),this.results.popover?this.results.hidePopover():this.results.hidden=!0),this.container.open=!1,this.interactingWithList=!1}}var tt=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Je=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},Zo=function(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e},St,Yt,Xt,Gt,Me;const Qo=globalThis.HTMLElement||null;class Jo extends Event{constructor(t,e){var{relatedTarget:s}=e,i=Zo(e,["relatedTarget"]);super(t,i),this.relatedTarget=s}}const ot=new WeakMap;let tn=null;class ta extends Qo{constructor(){super(...arguments),St.add(this),Yt.set(this,null),Xt.set(this,null),Me.set(this,void 0)}static define(t="auto-complete",e=customElements){return e.define(t,this),this}static setCSPTrustedTypesPolicy(t){tn=t===null?t:Promise.resolve(t)}get forElement(){var t;if(!((t=tt(this,Yt,"f"))===null||t===void 0)&&t.isConnected)return tt(this,Yt,"f");const e=this.getAttribute("for"),s=this.getRootNode();return e&&(s instanceof Document||s instanceof ShadowRoot)?s.getElementById(e):null}set forElement(t){Je(this,Yt,t,"f"),this.setAttribute("for","")}get inputElement(){var t;return!((t=tt(this,Xt,"f"))===null||t===void 0)&&t.isConnected?tt(this,Xt,"f"):this.querySelector("input")}set inputElement(t){Je(this,Xt,t,"f"),tt(this,St,"m",Gt).call(this)}connectedCallback(){this.isConnected&&(tt(this,St,"m",Gt).call(this),new MutationObserver(()=>{ot.get(this)||tt(this,St,"m",Gt).call(this)}).observe(this,{subtree:!0,childList:!0}))}disconnectedCallback(){const t=ot.get(this);t&&(t.destroy(),ot.delete(this))}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}get open(){return this.hasAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get fetchOnEmpty(){return this.hasAttribute("fetch-on-empty")}set fetchOnEmpty(t){this.toggleAttribute("fetch-on-empty",t)}async fetchResult(t){var e;(e=tt(this,Me,"f"))===null||e===void 0||e.abort();const{signal:s}=Je(this,Me,new AbortController,"f"),i=await fetch(t.toString(),{signal:s,headers:{Accept:"text/fragment+html"}});if(!i.ok)throw new Error(await i.text());return tn?(await tn).createHTML(await i.text(),i):await i.text()}static get observedAttributes(){return["open","value","for"]}attributeChangedCallback(t,e,s){var i,r;if(e===s)return;const o=ot.get(this);if(o)switch((this.forElement!==((i=ot.get(this))===null||i===void 0?void 0:i.results)||this.inputElement!==((r=ot.get(this))===null||r===void 0?void 0:r.input))&&tt(this,St,"m",Gt).call(this),t){case"open":s===null?o.close():o.open();break;case"value":s!==null&&(o.input.value=s),this.dispatchEvent(new Jo("auto-complete-change",{bubbles:!0,relatedTarget:o.input}));break}}}Yt=new WeakMap,Xt=new WeakMap,Me=new WeakMap,St=new WeakSet,Gt=function(){var t;(t=ot.get(this))===null||t===void 0||t.destroy();const{forElement:e,inputElement:s}=this;if(!e||!s)return;const i=this.getAttribute("data-autoselect")==="true";ot.set(this,new Go(this,s,e,i)),e.setAttribute("role","listbox")};const en=typeof globalThis<"u"?globalThis:window;try{en.AutocompleteElement=en.AutoCompleteElement=ta.define()}catch(n){if(!(en.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class dn extends HTMLElement{get preload(){return this.hasAttribute("preload")}set preload(t){t?this.setAttribute("preload",""):this.removeAttribute("preload")}get src(){return this.getAttribute("src")||""}set src(t){this.setAttribute("src",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","menu");const t=this.parentElement;if(!t)return;const e=t.querySelector("summary");e&&(e.setAttribute("aria-haspopup","menu"),e.hasAttribute("role")||e.setAttribute("role","button"));const s=[q(t,"compositionstart",i=>_s(this,i)),q(t,"compositionend",i=>_s(this,i)),q(t,"click",i=>Fs(t,i)),q(t,"change",i=>Fs(t,i)),q(t,"keydown",i=>oa(t,this,i)),q(t,"toggle",()=>Ds(t,this),{once:!0}),q(t,"toggle",()=>sa(t)),this.preload?q(t,"mouseover",()=>Ds(t,this),{once:!0}):ea,...na(t)];Ct.set(this,{subscriptions:s,loaded:!1,isComposing:!1})}disconnectedCallback(){const t=Ct.get(this);if(t){Ct.delete(this);for(const e of t.subscriptions)e.unsubscribe()}}}const Ct=new WeakMap,ea={unsubscribe(){}};function q(n,t,e,s=!1){return n.addEventListener(t,e,s),{unsubscribe:()=>{n.removeEventListener(t,e,s)}}}function Ds(n,t){const e=t.getAttribute("src");if(!e)return;const s=Ct.get(t);if(!s||s.loaded)return;s.loaded=!0;const i=t.querySelector("include-fragment");i&&!i.hasAttribute("src")&&(i.addEventListener("loadend",()=>Zi(n)),i.setAttribute("src",e))}function na(n){let t=!1;const e=()=>t=!0,s=()=>t=!1,i=()=>{n.hasAttribute("open")&&(Zi(n)||t||ia(n))};return[q(n,"mousedown",e),q(n,"keydown",s),q(n,"toggle",i)]}function sa(n){if(n.hasAttribute("open"))for(const t of document.querySelectorAll("details[open] > details-menu")){const e=t.closest("details");e&&e!==n&&!e.contains(n)&&e.removeAttribute("open")}}function Zi(n){if(!n.hasAttribute("open"))return!1;const t=n.querySelector("details-menu [autofocus]");return t?(t.focus(),!0):!1}function ia(n){const t=document.activeElement;if(t&&Qi(t)&&n.contains(t))return;const e=Zt(n,!0);e&&e.focus()}function Zt(n,t){const e=Array.from(n.querySelectorAll('[role^="menuitem"]:not([hidden]):not([disabled])')),s=document.activeElement,i=s instanceof HTMLElement?e.indexOf(s):-1,r=t?e[i+1]:e[i-1],o=t?e[0]:e[e.length-1];return r||o}const Ls=navigator.userAgent.match(/Macintosh/);function Fs(n,t){const e=t.target;if(e instanceof Element&&e.closest("details")===n){if(t.type==="click"){const s=e.closest('[role="menuitem"], [role="menuitemradio"]');if(!s)return;const i=s.querySelector("input");if(s.tagName==="LABEL"&&e===i)return;s.tagName==="LABEL"&&i&&!i.checked||Vs(s,n)}else if(t.type==="change"){const s=e.closest('[role="menuitemradio"], [role="menuitemcheckbox"]');s&&Vs(s,n)}}}function ra(n,t){for(const e of t.querySelectorAll('[role="menuitemradio"], [role="menuitemcheckbox"]')){const s=e.querySelector('input[type="radio"], input[type="checkbox"]');let i=(e===n).toString();s instanceof HTMLInputElement&&(i=s.indeterminate?"mixed":s.checked.toString()),e.setAttribute("aria-checked",i)}}function Vs(n,t){if(n.hasAttribute("disabled")||n.getAttribute("aria-disabled")==="true")return;const e=n.closest("details-menu");!e||!e.dispatchEvent(new CustomEvent("details-menu-select",{cancelable:!0,detail:{relatedTarget:n}}))||(aa(n,t),ra(n,t),n.getAttribute("role")!=="menuitemcheckbox"&&Ji(t),e.dispatchEvent(new CustomEvent("details-menu-selected",{detail:{relatedTarget:n}})))}function oa(n,t,e){if(!(e instanceof KeyboardEvent)||n.querySelector("details[open]"))return;const s=Ct.get(t);if(!s||s.isComposing)return;const i=e.target instanceof Element&&e.target.tagName==="SUMMARY";switch(e.key){case"Escape":n.hasAttribute("open")&&(Ji(n),e.preventDefault(),e.stopPropagation());break;case"ArrowDown":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Zt(n,!0);r&&r.focus(),e.preventDefault()}break;case"ArrowUp":{i&&!n.hasAttribute("open")&&n.setAttribute("open","");const r=Zt(n,!1);r&&r.focus(),e.preventDefault()}break;case"n":if(Ls&&e.ctrlKey){const r=Zt(n,!0);r&&r.focus(),e.preventDefault()}break;case"p":if(Ls&&e.ctrlKey){const r=Zt(n,!1);r&&r.focus(),e.preventDefault()}break;case" ":case"Enter":{const r=document.activeElement;r instanceof HTMLElement&&Qi(r)&&r.closest("details")===n&&(e.preventDefault(),e.stopPropagation(),r.click())}break}}function Qi(n){const t=n.getAttribute("role");return t==="menuitem"||t==="menuitemcheckbox"||t==="menuitemradio"}function Ji(n){if(!n.hasAttribute("open"))return;n.removeAttribute("open");const e=n.querySelector("summary");e&&e.focus()}function aa(n,t){const e=t.querySelector("[data-menu-button]");if(!e)return;const s=la(n);if(s)e.textContent=s;else{const i=ca(n);i&&(e.innerHTML=i)}}function la(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-text")?n:n.querySelector("[data-menu-button-text]");return t?t.getAttribute("data-menu-button-text")||t.textContent:null}function ca(n){if(!n)return null;const t=n.hasAttribute("data-menu-button-contents")?n:n.querySelector("[data-menu-button-contents]");return t?t.innerHTML:null}function _s(n,t){const e=Ct.get(n);e&&(e.isComposing=t.type==="compositionstart")}window.customElements.get("details-menu")||(window.DetailsMenuElement=dn,window.customElements.define("details-menu",dn));const kt=new WeakMap,ft=new WeakMap,et=new WeakMap;function re(n){const t=n.currentTarget;if(!(t instanceof Vt))return;const{box:e,image:s}=et.get(t)||{};if(!e||!s)return;let i=0,r=0;if(n instanceof KeyboardEvent)n.key==="ArrowUp"?r=-1:n.key==="ArrowDown"?r=1:n.key==="ArrowLeft"?i=-1:n.key==="ArrowRight"&&(i=1);else if(ft.has(t)&&n instanceof MouseEvent){const o=ft.get(t);i=n.pageX-o.dragStartX,r=n.pageY-o.dragStartY}else if(ft.has(t)&&n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0],{dragStartX:l,dragStartY:c}=ft.get(t);i=o-l,r=a-c}if(i!==0||r!==0){const o=Math.min(Math.max(0,e.offsetLeft+i),s.width-e.offsetWidth),a=Math.min(Math.max(0,e.offsetTop+r),s.height-e.offsetHeight);e.style.left=`${o}px`,e.style.top=`${a}px`,sr(t,{x:o,y:a,width:e.offsetWidth,height:e.offsetHeight})}if(n instanceof MouseEvent)ft.set(t,{dragStartX:n.pageX,dragStartY:n.pageY});else if(n instanceof TouchEvent){const{pageX:o,pageY:a}=n.changedTouches[0];ft.set(t,{dragStartX:o,dragStartY:a})}}function Dt(n){const t=n.target;if(!(t instanceof HTMLElement))return;const e=tr(t);if(!(e instanceof Vt))return;const{box:s}=et.get(e)||{};if(!s)return;const i=e.getBoundingClientRect();let r,o,a;if(n instanceof KeyboardEvent){if(n.key==="Escape")return nr(e);if(n.key==="-"&&(a=-10),n.key==="="&&(a=10),!a)return;r=s.offsetWidth+a,o=s.offsetHeight+a,kt.set(e,{startX:s.offsetLeft,startY:s.offsetTop})}else if(n instanceof MouseEvent){const l=kt.get(e);if(!l)return;r=n.pageX-l.startX-i.left-window.pageXOffset,o=n.pageY-l.startY-i.top-window.pageYOffset}else if(n instanceof TouchEvent){const l=kt.get(e);if(!l)return;r=n.changedTouches[0].pageX-l.startX-i.left-window.pageXOffset,o=n.changedTouches[0].pageY-l.startY-i.top-window.pageYOffset}r&&o&&er(e,r,o,!(n instanceof KeyboardEvent))}function tr(n){const t=n.getRootNode();return t instanceof ShadowRoot?t.host:n}function Ps(n){const t=n.currentTarget;if(!(t instanceof HTMLElement))return;const e=tr(t);if(!(e instanceof Vt))return;const{box:s}=et.get(e)||{};if(!s)return;const i=n.target;if(i instanceof HTMLElement)if(i.hasAttribute("data-direction")){const r=i.getAttribute("data-direction")||"";e.addEventListener("mousemove",Dt),e.addEventListener("touchmove",Dt,{passive:!0}),["nw","se"].indexOf(r)>=0&&e.classList.add("nwse"),["ne","sw"].indexOf(r)>=0&&e.classList.add("nesw"),kt.set(e,{startX:s.offsetLeft+(["se","ne"].indexOf(r)>=0?0:s.offsetWidth),startY:s.offsetTop+(["se","sw"].indexOf(r)>=0?0:s.offsetHeight)}),Dt(n)}else e.addEventListener("mousemove",re),e.addEventListener("touchmove",re,{passive:!0})}function er(n,t,e,s=!0){let i=Math.max(Math.abs(t),Math.abs(e),10);const r=kt.get(n);if(!r)return;const{box:o,image:a}=et.get(n)||{};if(!o||!a)return;i=Math.min(i,e>0?a.height-r.startY:r.startY,t>0?a.width-r.startX:r.startX);const l=s?Math.round(Math.max(0,t>0?r.startX:r.startX-i)):o.offsetLeft,c=s?Math.round(Math.max(0,e>0?r.startY:r.startY-i)):o.offsetTop;o.style.left=`${l}px`,o.style.top=`${c}px`,o.style.width=`${i}px`,o.style.height=`${i}px`,sr(n,{x:l,y:c,width:i,height:i})}function nr(n){const{image:t}=et.get(n)||{};if(!t)return;const e=Math.round(t.clientWidth>t.clientHeight?t.clientHeight:t.clientWidth);kt.set(n,{startX:(t.clientWidth-e)/2,startY:(t.clientHeight-e)/2}),er(n,e,e)}function nn(n){const t=n.currentTarget;t instanceof Vt&&(ft.delete(t),t.classList.remove("nwse","nesw"),t.removeEventListener("mousemove",Dt),t.removeEventListener("mousemove",re),t.removeEventListener("touchmove",Dt),t.removeEventListener("touchmove",re))}function sr(n,t){const{image:e}=et.get(n)||{};if(!e)return;const s=e.naturalWidth/e.width;for(const i in t){const r=Math.round(t[i]*s);t[i]=r;const o=n.querySelector(`[data-image-crop-input='${i}']`);o instanceof HTMLInputElement&&(o.value=r.toString())}n.dispatchEvent(new CustomEvent("image-crop-change",{bubbles:!0,detail:t}))}class Vt extends HTMLElement{connectedCallback(){if(et.has(this))return;const t=this.attachShadow({mode:"open"});t.innerHTML=`
|
2
2
|
<style>
|
3
3
|
:host { touch-action: none; display: block; }
|
4
4
|
:host(.nesw) { cursor: nesw-resize; }
|
@@ -76,24 +76,24 @@ class mi{constructor(t,e,{tabInsertsSuggestions:s,defaultFirstOption:i,scrollInt
|
|
76
76
|
</div>
|
77
77
|
</div>
|
78
78
|
</div>
|
79
|
-
`;const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const s=t.querySelector("img");s instanceof HTMLImageElement&&(
|
80
|
-
`).length>1}function
|
81
|
-
`);let e=0;for(let s=0;s<t.length;s++){const i=t[s].length+1;n.selectionStart>=e&&n.selectionStart<e+i&&(n.selectionStart=e),n.selectionEnd>=e&&n.selectionEnd<e+i&&(n.selectionEnd=e+i-1),e+=i}}function
|
82
|
-
`,2-r)),e.match(/\S/)&&o<2&&(l=
|
83
|
-
`,2-o)),a==null&&(a=""),l==null&&(l=""),{newlinesToAppend:a,newlinesToPrepend:l}}function
|
84
|
-
`:i,b=
|
85
|
-
${a}`:r;if(c){const
|
79
|
+
`;const e=t.querySelector("[data-crop-box]");if(!(e instanceof HTMLElement))return;const s=t.querySelector("img");s instanceof HTMLImageElement&&(et.set(this,{box:e,image:s}),s.addEventListener("load",()=>{this.loaded=!0,nr(this)}),this.addEventListener("mouseleave",nn),this.addEventListener("touchend",nn),this.addEventListener("mouseup",nn),e.addEventListener("mousedown",Ps),e.addEventListener("touchstart",Ps,{passive:!0}),this.addEventListener("keydown",re),this.addEventListener("keydown",Dt),this.src&&(s.src=this.src))}static get observedAttributes(){return["src"]}get src(){return this.getAttribute("src")}set src(t){t?this.setAttribute("src",t):this.removeAttribute("src")}get loaded(){return this.hasAttribute("loaded")}set loaded(t){t?this.setAttribute("loaded",""):this.removeAttribute("loaded")}attributeChangedCallback(t,e,s){const{image:i}=et.get(this)||{};t==="src"&&(this.loaded=!1,i&&(i.src=s))}}window.customElements.get("image-crop")||(window.ImageCropElement=Vt,window.customElements.define("image-crop",Vt));var Rs=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Oe,fn;const ua=["[data-md-button]","md-header","md-bold","md-italic","md-quote","md-code","md-link","md-image","md-unordered-list","md-ordered-list","md-task-list","md-mention","md-ref","md-strikethrough"];function ir(n){const t=[];for(const e of n.querySelectorAll(ua.join(", ")))e.hidden||e.offsetWidth<=0&&e.offsetHeight<=0||e.closest("markdown-toolbar")===n&&t.push(e);return t}function rr(n){return function(t){(t.key===" "||t.key==="Enter")&&n(t)}}const R=new WeakMap,ha={"header-1":{prefix:"# "},"header-2":{prefix:"## "},"header-3":{prefix:"### "},"header-4":{prefix:"#### "},"header-5":{prefix:"##### "},"header-6":{prefix:"###### "},bold:{prefix:"**",suffix:"**",trimFirst:!0},italic:{prefix:"_",suffix:"_",trimFirst:!0},quote:{prefix:"> ",multiline:!0,surroundWithNewlines:!0},code:{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"},link:{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"},image:{prefix:"",replaceNext:"url",scanFor:"https?://"},"unordered-list":{prefix:"- ",multiline:!0,unorderedList:!0},"ordered-list":{prefix:"1. ",multiline:!0,orderedList:!0},"task-list":{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0},mention:{prefix:"@",prefixSpace:!0},ref:{prefix:"#",prefixSpace:!0},strikethrough:{prefix:"~~",suffix:"~~",trimFirst:!0}};class H extends HTMLElement{constructor(){super();const t=e=>{const s=R.get(this);s&&(e.preventDefault(),pn(this,s))};this.addEventListener("keydown",rr(t)),this.addEventListener("click",t)}connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","button")}click(){const t=R.get(this);t&&pn(this,t)}}class Bs extends H{constructor(){super(...arguments),Oe.add(this)}connectedCallback(){const t=parseInt(this.getAttribute("level")||"3",10);Rs(this,Oe,"m",fn).call(this,t)}static get observedAttributes(){return["level"]}attributeChangedCallback(t,e,s){if(t!=="level")return;const i=parseInt(s||"3",10);Rs(this,Oe,"m",fn).call(this,i)}}Oe=new WeakSet,fn=function(t){if(t<1||t>6)return;const e=`${"#".repeat(t)} `;R.set(this,{prefix:e})};window.customElements.get("md-header")||(window.MarkdownHeaderButtonElement=Bs,window.customElements.define("md-header",Bs));class Is extends H{connectedCallback(){R.set(this,{prefix:"**",suffix:"**",trimFirst:!0})}}window.customElements.get("md-bold")||(window.MarkdownBoldButtonElement=Is,window.customElements.define("md-bold",Is));class Ns extends H{connectedCallback(){R.set(this,{prefix:"_",suffix:"_",trimFirst:!0})}}window.customElements.get("md-italic")||(window.MarkdownItalicButtonElement=Ns,window.customElements.define("md-italic",Ns));class $s extends H{connectedCallback(){R.set(this,{prefix:"> ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-quote")||(window.MarkdownQuoteButtonElement=$s,window.customElements.define("md-quote",$s));class js extends H{connectedCallback(){R.set(this,{prefix:"`",suffix:"`",blockPrefix:"```",blockSuffix:"```"})}}window.customElements.get("md-code")||(window.MarkdownCodeButtonElement=js,window.customElements.define("md-code",js));class Ks extends H{connectedCallback(){R.set(this,{prefix:"[",suffix:"](url)",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-link")||(window.MarkdownLinkButtonElement=Ks,window.customElements.define("md-link",Ks));class Hs extends H{connectedCallback(){R.set(this,{prefix:"",replaceNext:"url",scanFor:"https?://"})}}window.customElements.get("md-image")||(window.MarkdownImageButtonElement=Hs,window.customElements.define("md-image",Hs));class Us extends H{connectedCallback(){R.set(this,{prefix:"- ",multiline:!0,unorderedList:!0})}}window.customElements.get("md-unordered-list")||(window.MarkdownUnorderedListButtonElement=Us,window.customElements.define("md-unordered-list",Us));class Ws extends H{connectedCallback(){R.set(this,{prefix:"1. ",multiline:!0,orderedList:!0})}}window.customElements.get("md-ordered-list")||(window.MarkdownOrderedListButtonElement=Ws,window.customElements.define("md-ordered-list",Ws));class zs extends H{connectedCallback(){R.set(this,{prefix:"- [ ] ",multiline:!0,surroundWithNewlines:!0})}}window.customElements.get("md-task-list")||(window.MarkdownTaskListButtonElement=zs,window.customElements.define("md-task-list",zs));class qs extends H{connectedCallback(){R.set(this,{prefix:"@",prefixSpace:!0})}}window.customElements.get("md-mention")||(window.MarkdownMentionButtonElement=qs,window.customElements.define("md-mention",qs));class Ys extends H{connectedCallback(){R.set(this,{prefix:"#",prefixSpace:!0})}}window.customElements.get("md-ref")||(window.MarkdownRefButtonElement=Ys,window.customElements.define("md-ref",Ys));class Xs extends H{connectedCallback(){R.set(this,{prefix:"~~",suffix:"~~",trimFirst:!0})}}window.customElements.get("md-strikethrough")||(window.MarkdownStrikethroughButtonElement=Xs,window.customElements.define("md-strikethrough",Xs));function Gs(n){const{target:t,currentTarget:e}=n;if(!(t instanceof Element))return;const s=t.closest("[data-md-button]");if(!s||s.closest("markdown-toolbar")!==e)return;const i=s.getAttribute("data-md-button"),r=ha[i];r&&(n.preventDefault(),pn(t,r))}function Zs(n){n.addEventListener("keydown",ar),n.setAttribute("tabindex","0"),n.addEventListener("focus",or,{once:!0})}function Qs(n){n.removeEventListener("keydown",ar),n.removeAttribute("tabindex"),n.removeEventListener("focus",or)}class ke extends HTMLElement{connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","toolbar"),this.hasAttribute("data-no-focus")||Zs(this),this.addEventListener("keydown",rr(Gs)),this.addEventListener("click",Gs)}attributeChangedCallback(t,e,s){t==="data-no-focus"&&(s===null?Zs(this):Qs(this))}disconnectedCallback(){Qs(this)}get field(){const t=this.getAttribute("for");if(!t)return null;const e="getRootNode"in this?this.getRootNode():document;let s;return(e instanceof Document||e instanceof ShadowRoot)&&(s=e.getElementById(t)),s instanceof HTMLTextAreaElement?s:null}}ke.observedAttributes=["data-no-focus"];function or({target:n}){if(!(n instanceof Element))return;n.removeAttribute("tabindex");let t="0";for(const e of ir(n))e.setAttribute("tabindex",t),t==="0"&&(e.focus(),t="-1")}function ar(n){const t=n.key;if(t!=="ArrowRight"&&t!=="ArrowLeft"&&t!=="Home"&&t!=="End")return;const e=n.currentTarget;if(!(e instanceof HTMLElement))return;const s=ir(e),i=s.indexOf(n.target),r=s.length;if(i===-1)return;let o=0;t==="ArrowLeft"&&(o=i-1),t==="ArrowRight"&&(o=i+1),t==="End"&&(o=r-1),o<0&&(o=r-1),o>r-1&&(o=0);for(let a=0;a<r;a+=1)s[a].setAttribute("tabindex",a===o?"0":"-1");n.preventDefault(),s[o].focus()}window.customElements.get("markdown-toolbar")||(window.MarkdownToolbarElement=ke,window.customElements.define("markdown-toolbar",ke));function mn(n){return n.trim().split(`
|
80
|
+
`).length>1}function Js(n,t){return Array(t+1).join(n)}function da(n,t){let e=t;for(;n[e]&&n[e-1]!=null&&!n[e-1].match(/\s/);)e--;return e}function fa(n,t,e){let s=t;const i=e?/\n/:/\s/;for(;n[s]&&!n[s].match(i);)s++;return s}let dt=null;function ma(n,{text:t,selectionStart:e,selectionEnd:s}){const i=n.selectionStart,r=n.value.slice(0,i),o=n.value.slice(n.selectionEnd);if(dt===null||dt===!0){n.contentEditable="true";try{dt=document.execCommand("insertText",!1,t)}catch{dt=!1}n.contentEditable="false"}if(dt&&!n.value.slice(0,n.selectionStart).endsWith(t)&&(dt=!1),!dt){try{document.execCommand("ms-beginUndoUnit")}catch{}n.value=r+t+o;try{document.execCommand("ms-endUndoUnit")}catch{}n.dispatchEvent(new CustomEvent("input",{bubbles:!0,cancelable:!0}))}e!=null&&s!=null?n.setSelectionRange(e,s):n.setSelectionRange(i,n.selectionEnd)}function pa(n,t){const e=n.value.slice(n.selectionStart,n.selectionEnd);let s;t.orderedList||t.unorderedList?s=Ea(n,t):t.multiline&&mn(e)?s=va(n,t):s=ya(n,t),ma(n,s)}function ga(n){const t=n.value.split(`
|
81
|
+
`);let e=0;for(let s=0;s<t.length;s++){const i=t[s].length+1;n.selectionStart>=e&&n.selectionStart<e+i&&(n.selectionStart=e),n.selectionEnd>=e&&n.selectionEnd<e+i&&(n.selectionEnd=e+i-1),e+=i}}function ba(n,t,e,s=!1){if(n.selectionStart===n.selectionEnd)n.selectionStart=da(n.value,n.selectionStart),n.selectionEnd=fa(n.value,n.selectionEnd,s);else{const i=n.selectionStart-t.length,r=n.selectionEnd+e.length,o=n.value.slice(i,n.selectionStart)===t,a=n.value.slice(n.selectionEnd,r)===e;o&&a&&(n.selectionStart=i,n.selectionEnd=r)}return n.value.slice(n.selectionStart,n.selectionEnd)}function Hn(n){const t=n.value.slice(0,n.selectionStart),e=n.value.slice(n.selectionEnd),s=t.match(/\n*$/),i=e.match(/^\n*/),r=s?s[0].length:0,o=i?i[0].length:0;let a,l;return t.match(/\S/)&&r<2&&(a=Js(`
|
82
|
+
`,2-r)),e.match(/\S/)&&o<2&&(l=Js(`
|
83
|
+
`,2-o)),a==null&&(a=""),l==null&&(l=""),{newlinesToAppend:a,newlinesToPrepend:l}}function ya(n,t){let e,s;const{prefix:i,suffix:r,blockPrefix:o,blockSuffix:a,replaceNext:l,prefixSpace:c,scanFor:u,surroundWithNewlines:h}=t,d=n.selectionStart,m=n.selectionEnd;let f=n.value.slice(n.selectionStart,n.selectionEnd),g=mn(f)&&o.length>0?`${o}
|
84
|
+
`:i,b=mn(f)&&a.length>0?`
|
85
|
+
${a}`:r;if(c){const w=n.value[n.selectionStart-1];n.selectionStart!==0&&w!=null&&!w.match(/\s/)&&(g=` ${g}`)}f=ba(n,g,b,t.multiline);let p=n.selectionStart,v=n.selectionEnd;const E=l.length>0&&b.indexOf(l)>-1&&f.length>0;if(h){const w=Hn(n);e=w.newlinesToAppend,s=w.newlinesToPrepend,g=e+i,b+=s}if(f.startsWith(g)&&f.endsWith(b)){const w=f.slice(g.length,f.length-b.length);if(d===m){let y=d-g.length;y=Math.max(y,p),y=Math.min(y,p+w.length),p=v=y}else v=p+w.length;return{text:w,selectionStart:p,selectionEnd:v}}else if(E)if(u.length>0&&f.match(u)){b=b.replace(l,f);const w=g+b;return p=v=p+g.length,{text:w,selectionStart:p,selectionEnd:v}}else{const w=g+f+b;return p=p+g.length+f.length+b.indexOf(l),v=p+l.length,{text:w,selectionStart:p,selectionEnd:v}}else{let w=g+f+b;p=d+g.length,v=m+g.length;const y=f.match(/^\s*|\s*$/g);if(t.trimFirst&&y){const T=y[0]||"",S=y[1]||"";w=T+g+f.trim()+b+S,p+=T.length,v-=S.length}return{text:w,selectionStart:p,selectionEnd:v}}}function va(n,t){const{prefix:e,suffix:s,surroundWithNewlines:i}=t;let r=n.value.slice(n.selectionStart,n.selectionEnd),o=n.selectionStart,a=n.selectionEnd;const l=r.split(`
|
86
86
|
`);if(l.every(u=>u.startsWith(e)&&u.endsWith(s)))r=l.map(u=>u.slice(e.length,u.length-s.length)).join(`
|
87
87
|
`),a=o+r.length;else if(r=l.map(u=>e+u+s).join(`
|
88
|
-
`),i){const{newlinesToAppend:u,newlinesToPrepend:
|
88
|
+
`),i){const{newlinesToAppend:u,newlinesToPrepend:h}=Hn(n);o+=u.length,a=o+r.length,r=u+r+h}return{text:r,selectionStart:o,selectionEnd:a}}function ti(n){const t=n.split(`
|
89
89
|
`),e=/^\d+\.\s+/,s=t.every(r=>e.test(r));let i=t;return s&&(i=t.map(r=>r.replace(e,""))),{text:i.join(`
|
90
|
-
`),processed:s}}function
|
90
|
+
`),processed:s}}function ei(n){const t=n.split(`
|
91
91
|
`),e="- ",s=t.every(r=>r.startsWith(e));let i=t;return s&&(i=t.map(r=>r.slice(e.length,r.length))),{text:i.join(`
|
92
|
-
`),processed:s}}function
|
93
|
-
`).map((
|
94
|
-
`)+m;return e?(s=Math.max(s+Mt(0,t.unorderedList).length+h.length,0),i=s):a.processed?(s=Math.max(n.selectionStart+h.length,0),i=n.selectionEnd+h.length+u-d):(s=Math.max(n.selectionStart+h.length,0),i=n.selectionEnd+h.length+u),{text:f,selectionStart:s,selectionEnd:i}}function De(n,t){const e=n.closest("markdown-toolbar");if(!(e instanceof Qt))return;const i=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,unorderedList:!1,trimFirst:!1}),t),r=e.field;r&&(r.focus(),Vi(r,i))}localStorage.getItem("theme");window.matchMedia("(prefers-color-scheme: dark)").matches;class qi{constructor(t,e,s){this.eventTarget=t,this.eventName=e,this.eventOptions=s,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(t){this.unorderedBindings.add(t)}bindingDisconnected(t){this.unorderedBindings.delete(t)}handleEvent(t){const e=Yi(t);for(const s of this.bindings){if(e.immediatePropagationStopped)break;s.handleEvent(e)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((t,e)=>{const s=t.index,i=e.index;return s<i?-1:s>i?1:0})}}function Yi(n){if("immediatePropagationStopped"in n)return n;{const{stopImmediatePropagation:t}=n;return Object.assign(n,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}class Xi{constructor(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(t=>t.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(t=>t.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((t,e)=>t.concat(Array.from(e.values())),[])}bindingConnected(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}bindingDisconnected(t,e=!1){this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}handleError(t,e,s={}){this.application.handleError(t,`Error ${e}`,s)}clearEventListenersForBinding(t){const e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}removeMappedEventListenerFor(t){const{eventTarget:e,eventName:s,eventOptions:i}=t,r=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(s,i);r.delete(o),r.size==0&&this.eventListenerMaps.delete(e)}fetchEventListenerForBinding(t){const{eventTarget:e,eventName:s,eventOptions:i}=t;return this.fetchEventListener(e,s,i)}fetchEventListener(t,e,s){const i=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(e,s);let o=i.get(r);return o||(o=this.createEventListener(t,e,s),i.set(r,o)),o}createEventListener(t,e,s){const i=new qi(t,e,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(t){let e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}cacheKey(t,e){const s=[t];return Object.keys(e).sort().forEach(i=>{s.push(`${e[i]?"":"!"}${i}`)}),s.join(":")}}const Gi={stop({event:n,value:t}){return t&&n.stopPropagation(),!0},prevent({event:n,value:t}){return t&&n.preventDefault(),!0},self({event:n,value:t,element:e}){return t?e===n.target:!0}},Zi=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Ji(n){const e=n.trim().match(Zi)||[];let s=e[2],i=e[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:Qi(e[4]),eventName:s,eventOptions:e[7]?tr(e[7]):{},identifier:e[5],methodName:e[6],keyFilter:e[1]||i}}function Qi(n){if(n=="window")return window;if(n=="document")return document}function tr(n){return n.split(":").reduce((t,e)=>Object.assign(t,{[e.replace(/^!/,"")]:!/^!/.test(e)}),{})}function er(n){if(n==window)return"window";if(n==document)return"document"}function Xe(n){return n.replace(/(?:[_-])([a-z0-9])/g,(t,e)=>e.toUpperCase())}function Fe(n){return Xe(n.replace(/--/g,"-").replace(/__/g,"_"))}function Wt(n){return n.charAt(0).toUpperCase()+n.slice(1)}function Os(n){return n.replace(/([A-Z])/g,(t,e)=>`-${e.toLowerCase()}`)}function nr(n){return n.match(/[^\s]+/g)||[]}function jn(n){return n!=null}function Be(n,t){return Object.prototype.hasOwnProperty.call(n,t)}const Hn=["meta","ctrl","alt","shift"];class sr{constructor(t,e,s,i){this.element=t,this.index=e,this.eventTarget=s.eventTarget||t,this.eventName=s.eventName||ir(t)||qt("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||qt("missing identifier"),this.methodName=s.methodName||qt("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(t,e){return new this(t.element,t.index,Ji(t.content),e)}toString(){const t=this.keyFilter?`.${this.keyFilter}`:"",e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${t}${e}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(t){if(!this.keyFilter)return!1;const e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;const s=e.filter(i=>!Hn.includes(i))[0];return s?(Be(this.keyMappings,s)||qt(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==t.key.toLowerCase()):!1}shouldIgnoreMouseEvent(t){if(!this.keyFilter)return!1;const e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}get params(){const t={},e=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:s,value:i}of Array.from(this.element.attributes)){const r=s.match(e),o=r&&r[1];o&&(t[Xe(o)]=rr(i))}return t}get eventTargetName(){return er(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(t,e){const[s,i,r,o]=Hn.map(a=>e.includes(a));return t.metaKey!==s||t.ctrlKey!==i||t.altKey!==r||t.shiftKey!==o}}const Un={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:n=>n.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function ir(n){const t=n.tagName.toLowerCase();if(t in Un)return Un[t](n)}function qt(n){throw new Error(n)}function rr(n){try{return JSON.parse(n)}catch{return n}}class or{constructor(t,e){this.context=t,this.action=e}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(t){const e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){const t=this.controller[this.methodName];if(typeof t=="function")return t;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(t){const{element:e}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context;let r=!0;for(const[o,a]of Object.entries(this.eventOptions))if(o in s){const l=s[o];r=r&&l({name:o,value:a,event:t,element:e,controller:i})}else continue;return r}prepareActionEvent(t){return Object.assign(t,{params:this.action.params})}invokeWithEvent(t){const{target:e,currentTarget:s}=t;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:s,action:this.methodName})}catch(i){const{identifier:r,controller:o,element:a,index:l}=this,c={identifier:r,controller:o,element:a,index:l,event:t};this.context.handleError(i,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(t){const e=t.target;return t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t)||t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t)?!1:this.element===e?!0:e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class Ss{constructor(t,e){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const t=new Set(this.matchElementsInTree());for(const e of Array.from(this.elements))t.has(e)||this.removeElement(e);for(const e of Array.from(t))this.addElement(e)}}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){t.type=="attributes"?this.processAttributeChange(t.target,t.attributeName):t.type=="childList"&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}processAttributeChange(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}processRemovedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.processTree(s,this.removeElement)}}processAddedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(t){return this.delegate.matchElement(t)}matchElementsInTree(t=this.element){return this.delegate.matchElementsInTree(t)}processTree(t,e){for(const s of this.matchElementsInTree(t))e.call(this,s)}elementFromNode(t){if(t.nodeType==Node.ELEMENT_NODE)return t}elementIsActive(t){return t.isConnected!=this.element.isConnected?!1:this.element.contains(t)}addElement(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}removeElement(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}}class Ms{constructor(t,e,s){this.attributeName=e,this.delegate=s,this.elementObserver=new Ss(t,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(t){return t.hasAttribute(this.attributeName)}matchElementsInTree(t){const e=this.matchElement(t)?[t]:[],s=Array.from(t.querySelectorAll(this.selector));return e.concat(s)}elementMatched(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}elementUnmatched(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}elementAttributeChanged(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}}function ar(n,t,e){Cs(n,t).add(e)}function lr(n,t,e){Cs(n,t).delete(e),cr(n,t)}function Cs(n,t){let e=n.get(t);return e||(e=new Set,n.set(t,e)),e}function cr(n,t){const e=n.get(t);e!=null&&e.size==0&&n.delete(t)}class lt{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e+s.size,0)}add(t,e){ar(this.valuesByKey,t,e)}delete(t,e){lr(this.valuesByKey,t,e)}has(t,e){const s=this.valuesByKey.get(t);return s!=null&&s.has(e)}hasKey(t){return this.valuesByKey.has(t)}hasValue(t){return Array.from(this.valuesByKey.values()).some(s=>s.has(t))}getValuesForKey(t){const e=this.valuesByKey.get(t);return e?Array.from(e):[]}getKeysForValue(t){return Array.from(this.valuesByKey).filter(([e,s])=>s.has(t)).map(([e,s])=>e)}}class ur{constructor(t,e,s,i){this._selector=e,this.details=i,this.elementObserver=new Ss(t,this),this.delegate=s,this.matchesByElement=new lt}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(t){this._selector=t,this.refresh()}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(t){const{selector:e}=this;if(e){const s=t.matches(e);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(t,this.details):s}else return!1}matchElementsInTree(t){const{selector:e}=this;if(e){const s=this.matchElement(t)?[t]:[],i=Array.from(t.querySelectorAll(e)).filter(r=>this.matchElement(r));return s.concat(i)}else return[]}elementMatched(t){const{selector:e}=this;e&&this.selectorMatched(t,e)}elementUnmatched(t){const e=this.matchesByElement.getKeysForValue(t);for(const s of e)this.selectorUnmatched(t,s)}elementAttributeChanged(t,e){const{selector:s}=this;if(s){const i=this.matchElement(t),r=this.matchesByElement.has(s,t);i&&!r?this.selectorMatched(t,s):!i&&r&&this.selectorUnmatched(t,s)}}selectorMatched(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}selectorUnmatched(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}}class hr{constructor(t,e){this.element=t,this.delegate=e,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const t of this.knownAttributeNames)this.refreshAttribute(t,null)}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){const e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}refreshAttribute(t,e){const s=this.delegate.getStringMapKeyForAttribute(t);if(s!=null){this.stringMap.has(t)||this.stringMapKeyAdded(s,t);const i=this.element.getAttribute(t);if(this.stringMap.get(t)!=i&&this.stringMapValueChanged(i,s,e),i==null){const r=this.stringMap.get(t);this.stringMap.delete(t),r&&this.stringMapKeyRemoved(s,t,r)}else this.stringMap.set(t,i)}}stringMapKeyAdded(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}stringMapValueChanged(t,e,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,s)}stringMapKeyRemoved(t,e,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(t=>t.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class ks{constructor(t,e,s){this.attributeObserver=new Ms(t,e,this),this.delegate=s,this.tokensByElement=new lt}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(t){this.attributeObserver.pause(t)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(t){this.tokensMatched(this.readTokensForElement(t))}elementAttributeValueChanged(t){const[e,s]=this.refreshTokensForElement(t);this.tokensUnmatched(e),this.tokensMatched(s)}elementUnmatchedAttribute(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}tokensMatched(t){t.forEach(e=>this.tokenMatched(e))}tokensUnmatched(t){t.forEach(e=>this.tokenUnmatched(e))}tokenMatched(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}tokenUnmatched(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}refreshTokensForElement(t){const e=this.tokensByElement.getValuesForKey(t),s=this.readTokensForElement(t),i=fr(e,s).findIndex(([r,o])=>!mr(r,o));return i==-1?[[],[]]:[e.slice(i),s.slice(i)]}readTokensForElement(t){const e=this.attributeName,s=t.getAttribute(e)||"";return dr(s,t,e)}}function dr(n,t,e){return n.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:t,attributeName:e,content:s,index:i}))}function fr(n,t){const e=Math.max(n.length,t.length);return Array.from({length:e},(s,i)=>[n[i],t[i]])}function mr(n,t){return n&&t&&n.index==t.index&&n.content==t.content}class Ls{constructor(t,e,s){this.tokenListObserver=new ks(t,e,this),this.delegate=s,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).set(t,s),this.delegate.elementMatchedValue(e,s))}tokenUnmatched(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,s))}fetchParseResultForToken(t){let e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}fetchValuesByTokenForElement(t){let e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}parseToken(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(e){return{error:e}}}}class pr{constructor(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new Ls(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(t){const e=new or(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}disconnectAction(t){const e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}disconnectAllActions(){this.bindings.forEach(t=>this.delegate.bindingDisconnected(t,!0)),this.bindingsByAction.clear()}parseValueForToken(t){const e=sr.forToken(t,this.schema);if(e.identifier==this.identifier)return e}elementMatchedValue(t,e){this.connectAction(e)}elementUnmatchedValue(t,e){this.disconnectAction(e)}}class gr{constructor(t,e){this.context=t,this.receiver=e,this.stringMapObserver=new hr(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}stringMapKeyAdded(t,e){const s=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,s.writer(this.receiver[t]),s.writer(s.defaultValue))}stringMapValueChanged(t,e,s){const i=this.valueDescriptorNameMap[e];t!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(e,t,s))}stringMapKeyRemoved(t,e,s){const i=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,i.writer(this.receiver[t]),s):this.invokeChangedCallback(t,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(const{key:t,name:e,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(t)&&this.invokeChangedCallback(e,i(s),void 0)}invokeChangedCallback(t,e,s){const i=`${t}Changed`,r=this.receiver[i];if(typeof r=="function"){const o=this.valueDescriptorNameMap[t];try{const a=o.reader(e);let l=s;s&&(l=o.reader(s)),r.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){const{valueDescriptorMap:t}=this;return Object.keys(t).map(e=>t[e])}get valueDescriptorNameMap(){const t={};return Object.keys(this.valueDescriptorMap).forEach(e=>{const s=this.valueDescriptorMap[e];t[s.name]=s}),t}hasValue(t){const e=this.valueDescriptorNameMap[t],s=`has${Wt(e.name)}`;return this.receiver[s]}}class br{constructor(t,e){this.context=t,this.delegate=e,this.targetsByName=new lt}start(){this.tokenListObserver||(this.tokenListObserver=new ks(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:t,content:e}){this.scope.containsElement(t)&&this.connectTarget(t,e)}tokenUnmatched({element:t,content:e}){this.disconnectTarget(t,e)}connectTarget(t,e){var s;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(t,e)))}disconnectTarget(t,e){var s;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(t,e)))}disconnectAllTargets(){for(const t of this.targetsByName.keys)for(const e of this.targetsByName.getValuesForKey(t))this.disconnectTarget(e,t)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function Kt(n,t){const e=_s(n);return Array.from(e.reduce((s,i)=>(yr(i,t).forEach(r=>s.add(r)),s),new Set))}function vr(n,t){return _s(n).reduce((s,i)=>(s.push(...wr(i,t)),s),[])}function _s(n){const t=[];for(;n;)t.push(n),n=Object.getPrototypeOf(n);return t.reverse()}function yr(n,t){const e=n[t];return Array.isArray(e)?e:[]}function wr(n,t){const e=n[t];return e?Object.keys(e).map(s=>[s,e[s]]):[]}class Er{constructor(t,e){this.started=!1,this.context=t,this.delegate=e,this.outletsByName=new lt,this.outletElementsByName=new lt,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(t=>{this.setupSelectorObserverForOutlet(t),this.setupAttributeObserverForOutlet(t)}),this.started=!0,this.dependentContexts.forEach(t=>t.refresh()))}refresh(){this.selectorObserverMap.forEach(t=>t.refresh()),this.attributeObserverMap.forEach(t=>t.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(t=>t.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(t=>t.stop()),this.attributeObserverMap.clear())}selectorMatched(t,e,{outletName:s}){const i=this.getOutlet(t,s);i&&this.connectOutlet(i,t,s)}selectorUnmatched(t,e,{outletName:s}){const i=this.getOutletFromMap(t,s);i&&this.disconnectOutlet(i,t,s)}selectorMatchElement(t,{outletName:e}){const s=this.selector(e),i=this.hasOutlet(t,e),r=t.matches(`[${this.schema.controllerAttribute}~=${e}]`);return s?i&&r&&t.matches(s):!1}elementMatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)||(this.outletsByName.add(s,t),this.outletElementsByName.add(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(t,e,s)))}disconnectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)&&(this.outletsByName.delete(s,t),this.outletElementsByName.delete(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(t,e,s)))}disconnectAllOutlets(){for(const t of this.outletElementsByName.keys)for(const e of this.outletElementsByName.getValuesForKey(t))for(const s of this.outletsByName.getValuesForKey(t))this.disconnectOutlet(s,e,t)}updateSelectorObserverForOutlet(t){const e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}setupSelectorObserverForOutlet(t){const e=this.selector(t),s=new ur(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,s),s.start()}setupAttributeObserverForOutlet(t){const e=this.attributeNameForOutletName(t),s=new Ms(this.scope.element,e,this);this.attributeObserverMap.set(t,s),s.start()}selector(t){return this.scope.outlets.getSelectorForOutletName(t)}attributeNameForOutletName(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}getOutletNameFromOutletAttributeName(t){return this.outletDefinitions.find(e=>this.attributeNameForOutletName(e)===t)}get outletDependencies(){const t=new lt;return this.router.modules.forEach(e=>{const s=e.definition.controllerConstructor;Kt(s,"outlets").forEach(r=>t.add(r,e.identifier))}),t}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const t=this.dependentControllerIdentifiers;return this.router.contexts.filter(e=>t.includes(e.identifier))}hasOutlet(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}getOutlet(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}getOutletFromMap(t,e){return this.outletsByName.getValuesForKey(e).find(s=>s.element===t)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class Tr{constructor(t,e){this.logDebugActivity=(s,i={})=>{const{identifier:r,controller:o,element:a}=this;i=Object.assign({identifier:r,controller:o,element:a},i),this.application.logDebugActivity(this.identifier,s,i)},this.module=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new pr(this,this.dispatcher),this.valueObserver=new gr(this,this.controller),this.targetObserver=new br(this,this),this.outletObserver=new Er(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(s){this.handleError(s,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(t){this.handleError(t,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(t,e,s={}){const{identifier:i,controller:r,element:o}=this;s=Object.assign({identifier:i,controller:r,element:o},s),this.application.handleError(t,`Error ${e}`,s)}targetConnected(t,e){this.invokeControllerMethod(`${e}TargetConnected`,t)}targetDisconnected(t,e){this.invokeControllerMethod(`${e}TargetDisconnected`,t)}outletConnected(t,e,s){this.invokeControllerMethod(`${Fe(s)}OutletConnected`,t,e)}outletDisconnected(t,e,s){this.invokeControllerMethod(`${Fe(s)}OutletDisconnected`,t,e)}invokeControllerMethod(t,...e){const s=this.controller;typeof s[t]=="function"&&s[t](...e)}}function Ar(n){return xr(n,Or(n))}function xr(n,t){const e=kr(n),s=Sr(n.prototype,t);return Object.defineProperties(e.prototype,s),e}function Or(n){return Kt(n,"blessings").reduce((e,s)=>{const i=s(n);for(const r in i){const o=e[r]||{};e[r]=Object.assign(o,i[r])}return e},{})}function Sr(n,t){return Cr(t).reduce((e,s)=>{const i=Mr(n,t,s);return i&&Object.assign(e,{[s]:i}),e},{})}function Mr(n,t,e){const s=Object.getOwnPropertyDescriptor(n,e);if(!(s&&"value"in s)){const r=Object.getOwnPropertyDescriptor(t,e).value;return s&&(r.get=s.get||r.get,r.set=s.set||r.set),r}}const Cr=typeof Object.getOwnPropertySymbols=="function"?n=>[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)]:Object.getOwnPropertyNames,kr=(()=>{function n(e){function s(){return Reflect.construct(e,arguments,new.target)}return s.prototype=Object.create(e.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,e),s}function t(){const s=n(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return t(),n}catch{return s=>class extends s{}}})();function Lr(n){return{identifier:n.identifier,controllerConstructor:Ar(n.controllerConstructor)}}class _r{constructor(t,e){this.application=t,this.definition=Lr(e),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(t){const e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()}disconnectContextForScope(t){const e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())}fetchContextForScope(t){let e=this.contextsByScope.get(t);return e||(e=new Tr(this,t),this.contextsByScope.set(t,e)),e}}class Dr{constructor(t){this.scope=t}has(t){return this.data.has(this.getDataKey(t))}get(t){return this.getAll(t)[0]}getAll(t){const e=this.data.get(this.getDataKey(t))||"";return nr(e)}getAttributeName(t){return this.data.getAttributeNameForKey(this.getDataKey(t))}getDataKey(t){return`${t}-class`}get data(){return this.scope.data}}class Fr{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(t){const e=this.getAttributeNameForKey(t);return this.element.getAttribute(e)}set(t,e){const s=this.getAttributeNameForKey(t);return this.element.setAttribute(s,e),this.get(t)}has(t){const e=this.getAttributeNameForKey(t);return this.element.hasAttribute(e)}delete(t){if(this.has(t)){const e=this.getAttributeNameForKey(t);return this.element.removeAttribute(e),!0}else return!1}getAttributeNameForKey(t){return`data-${this.identifier}-${Os(t)}`}}class Br{constructor(t){this.warnedKeysByObject=new WeakMap,this.logger=t}warn(t,e,s){let i=this.warnedKeysByObject.get(t);i||(i=new Set,this.warnedKeysByObject.set(t,i)),i.has(e)||(i.add(e),this.logger.warn(s,t))}}function Pe(n,t){return`[${n}~="${t}"]`}class Pr{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(t){const e=this.getSelectorForTargetName(t);return this.scope.findElement(e)}findAllTargets(t){const e=this.getSelectorForTargetName(t);return this.scope.findAllElements(e)}getSelectorForTargetName(t){const e=this.schema.targetAttributeForScope(this.identifier);return Pe(e,t)}findLegacyTarget(t){const e=this.getLegacySelectorForTargetName(t);return this.deprecate(this.scope.findElement(e),t)}findAllLegacyTargets(t){const e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(s=>this.deprecate(s,t))}getLegacySelectorForTargetName(t){const e=`${this.identifier}.${t}`;return Pe(this.schema.targetAttribute,e)}deprecate(t,e){if(t){const{identifier:s}=this,i=this.schema.targetAttribute,r=this.schema.targetAttributeForScope(s);this.guide.warn(t,`target:${e}`,`Please replace ${i}="${s}.${e}" with ${r}="${e}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return t}get guide(){return this.scope.guide}}class Rr{constructor(t,e){this.scope=t,this.controllerElement=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findOutlet(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllOutlets(s)],[])}getSelectorForOutletName(t){const e=this.schema.outletAttributeForScope(this.identifier,t);return this.controllerElement.getAttribute(e)}findOutlet(t){const e=this.getSelectorForOutletName(t);if(e)return this.findElement(e,t)}findAllOutlets(t){const e=this.getSelectorForOutletName(t);return e?this.findAllElements(e,t):[]}findElement(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))[0]}findAllElements(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))}matchesElement(t,e,s){const i=t.getAttribute(this.scope.schema.controllerAttribute)||"";return t.matches(e)&&i.split(" ").includes(s)}}class Ge{constructor(t,e,s,i){this.targets=new Pr(this),this.classes=new Dr(this),this.data=new Fr(this),this.containsElement=r=>r.closest(this.controllerSelector)===this.element,this.schema=t,this.element=e,this.identifier=s,this.guide=new Br(i),this.outlets=new Rr(this.documentScope,e)}findElement(t){return this.element.matches(t)?this.element:this.queryElements(t).find(this.containsElement)}findAllElements(t){return[...this.element.matches(t)?[this.element]:[],...this.queryElements(t).filter(this.containsElement)]}queryElements(t){return Array.from(this.element.querySelectorAll(t))}get controllerSelector(){return Pe(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Ge(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class $r{constructor(t,e,s){this.element=t,this.schema=e,this.delegate=s,this.valueListObserver=new Ls(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(t){const{element:e,content:s}=t;return this.parseValueForElementAndIdentifier(e,s)}parseValueForElementAndIdentifier(t,e){const s=this.fetchScopesByIdentifierForElement(t);let i=s.get(e);return i||(i=this.delegate.createScopeForElementAndIdentifier(t,e),s.set(e,i)),i}elementMatchedValue(t,e){const s=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,s),s==1&&this.delegate.scopeConnected(e)}elementUnmatchedValue(t,e){const s=this.scopeReferenceCounts.get(e);s&&(this.scopeReferenceCounts.set(e,s-1),s==1&&this.delegate.scopeDisconnected(e))}fetchScopesByIdentifierForElement(t){let e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e}}class Nr{constructor(t){this.application=t,this.scopeObserver=new $r(this.element,this.schema,this),this.scopesByIdentifier=new lt,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((t,e)=>t.concat(e.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(t){this.unloadIdentifier(t.identifier);const e=new _r(this.application,t);this.connectModule(e);const s=t.controllerConstructor.afterLoad;s&&s.call(t.controllerConstructor,t.identifier,this.application)}unloadIdentifier(t){const e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)}getContextForElementAndIdentifier(t,e){const s=this.modulesByIdentifier.get(e);if(s)return s.contexts.find(i=>i.element==t)}proposeToConnectScopeForElementAndIdentifier(t,e){const s=this.scopeObserver.parseValueForElementAndIdentifier(t,e);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${e}" and element:`,t)}handleError(t,e,s){this.application.handleError(t,e,s)}createScopeForElementAndIdentifier(t,e){return new Ge(this.schema,t,e,this.logger)}scopeConnected(t){this.scopesByIdentifier.add(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)}scopeDisconnected(t){this.scopesByIdentifier.delete(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)}connectModule(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.connectContextForScope(s))}disconnectModule(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.disconnectContextForScope(s))}}const Ir={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:n=>`data-${n}-target`,outletAttributeForScope:(n,t)=>`data-${n}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},Wn("abcdefghijklmnopqrstuvwxyz".split("").map(n=>[n,n]))),Wn("0123456789".split("").map(n=>[n,n])))};function Wn(n){return n.reduce((t,[e,s])=>Object.assign(Object.assign({},t),{[e]:s}),{})}class Vr{constructor(t=document.documentElement,e=Ir){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,r={})=>{this.debug&&this.logFormattedMessage(s,i,r)},this.element=t,this.schema=e,this.dispatcher=new Xi(this),this.router=new Nr(this),this.actionDescriptorFilters=Object.assign({},Gi)}static start(t,e){const s=new this(t,e);return s.start(),s}async start(){await jr(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(t,e){this.load({identifier:t,controllerConstructor:e})}registerActionOption(t,e){this.actionDescriptorFilters[t]=e}load(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(t=>t.controller)}getControllerForElementAndIdentifier(t,e){const s=this.router.getContextForElementAndIdentifier(t,e);return s?s.controller:null}handleError(t,e,s){var i;this.logger.error(`%s
|
92
|
+
`),processed:s}}function zt(n,t){return t?"- ":`${n+1}. `}function wa(n,t){let e,s,i;return n.orderedList?(s=ti(t),e=ei(s.text),i=e.text):(s=ei(t),e=ti(s.text),i=e.text),[s,e,i]}function Ea(n,t){const e=n.selectionStart===n.selectionEnd;let s=n.selectionStart,i=n.selectionEnd;ga(n);const r=n.value.slice(n.selectionStart,n.selectionEnd),[o,a,l]=wa(t,r),c=l.split(`
|
93
|
+
`).map((g,b)=>`${zt(b,t.unorderedList)}${g}`),u=c.reduce((g,b,p)=>g+zt(p,t.unorderedList).length,0),h=c.reduce((g,b,p)=>g+zt(p,!t.unorderedList).length,0);if(o.processed)return e?(s=Math.max(s-zt(0,t.unorderedList).length,0),i=s):(s=n.selectionStart,i=n.selectionEnd-u),{text:l,selectionStart:s,selectionEnd:i};const{newlinesToAppend:d,newlinesToPrepend:m}=Hn(n),f=d+c.join(`
|
94
|
+
`)+m;return e?(s=Math.max(s+zt(0,t.unorderedList).length+d.length,0),i=s):a.processed?(s=Math.max(n.selectionStart+d.length,0),i=n.selectionEnd+d.length+u-h):(s=Math.max(n.selectionStart+d.length,0),i=n.selectionEnd+d.length+u),{text:f,selectionStart:s,selectionEnd:i}}function pn(n,t){const e=n.closest("markdown-toolbar");if(!(e instanceof ke))return;const i=Object.assign(Object.assign({},{prefix:"",suffix:"",blockPrefix:"",blockSuffix:"",multiline:!1,replaceNext:"",prefixSpace:!1,scanFor:"",surroundWithNewlines:!1,orderedList:!1,unorderedList:!1,trimFirst:!1}),t),r=e.field;r&&(r.focus(),pa(r,i))}localStorage.getItem("theme");window.matchMedia("(prefers-color-scheme: dark)").matches;class Ta{constructor(t,e,s){this.eventTarget=t,this.eventName=e,this.eventOptions=s,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(t){this.unorderedBindings.add(t)}bindingDisconnected(t){this.unorderedBindings.delete(t)}handleEvent(t){const e=Aa(t);for(const s of this.bindings){if(e.immediatePropagationStopped)break;s.handleEvent(e)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((t,e)=>{const s=t.index,i=e.index;return s<i?-1:s>i?1:0})}}function Aa(n){if("immediatePropagationStopped"in n)return n;{const{stopImmediatePropagation:t}=n;return Object.assign(n,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}class xa{constructor(t){this.application=t,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(t=>t.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(t=>t.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((t,e)=>t.concat(Array.from(e.values())),[])}bindingConnected(t){this.fetchEventListenerForBinding(t).bindingConnected(t)}bindingDisconnected(t,e=!1){this.fetchEventListenerForBinding(t).bindingDisconnected(t),e&&this.clearEventListenersForBinding(t)}handleError(t,e,s={}){this.application.handleError(t,`Error ${e}`,s)}clearEventListenersForBinding(t){const e=this.fetchEventListenerForBinding(t);e.hasBindings()||(e.disconnect(),this.removeMappedEventListenerFor(t))}removeMappedEventListenerFor(t){const{eventTarget:e,eventName:s,eventOptions:i}=t,r=this.fetchEventListenerMapForEventTarget(e),o=this.cacheKey(s,i);r.delete(o),r.size==0&&this.eventListenerMaps.delete(e)}fetchEventListenerForBinding(t){const{eventTarget:e,eventName:s,eventOptions:i}=t;return this.fetchEventListener(e,s,i)}fetchEventListener(t,e,s){const i=this.fetchEventListenerMapForEventTarget(t),r=this.cacheKey(e,s);let o=i.get(r);return o||(o=this.createEventListener(t,e,s),i.set(r,o)),o}createEventListener(t,e,s){const i=new Ta(t,e,s);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(t){let e=this.eventListenerMaps.get(t);return e||(e=new Map,this.eventListenerMaps.set(t,e)),e}cacheKey(t,e){const s=[t];return Object.keys(e).sort().forEach(i=>{s.push(`${e[i]?"":"!"}${i}`)}),s.join(":")}}const Sa={stop({event:n,value:t}){return t&&n.stopPropagation(),!0},prevent({event:n,value:t}){return t&&n.preventDefault(),!0},self({event:n,value:t,element:e}){return t?e===n.target:!0}},Ma=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function Oa(n){const e=n.trim().match(Ma)||[];let s=e[2],i=e[3];return i&&!["keydown","keyup","keypress"].includes(s)&&(s+=`.${i}`,i=""),{eventTarget:Ca(e[4]),eventName:s,eventOptions:e[7]?ka(e[7]):{},identifier:e[5],methodName:e[6],keyFilter:e[1]||i}}function Ca(n){if(n=="window")return window;if(n=="document")return document}function ka(n){return n.split(":").reduce((t,e)=>Object.assign(t,{[e.replace(/^!/,"")]:!/^!/.test(e)}),{})}function Da(n){if(n==window)return"window";if(n==document)return"document"}function Un(n){return n.replace(/(?:[_-])([a-z0-9])/g,(t,e)=>e.toUpperCase())}function gn(n){return Un(n.replace(/--/g,"-").replace(/__/g,"_"))}function de(n){return n.charAt(0).toUpperCase()+n.slice(1)}function lr(n){return n.replace(/([A-Z])/g,(t,e)=>`-${e.toLowerCase()}`)}function La(n){return n.match(/[^\s]+/g)||[]}function ni(n){return n!=null}function bn(n,t){return Object.prototype.hasOwnProperty.call(n,t)}const si=["meta","ctrl","alt","shift"];class Fa{constructor(t,e,s,i){this.element=t,this.index=e,this.eventTarget=s.eventTarget||t,this.eventName=s.eventName||Va(t)||Ee("missing event name"),this.eventOptions=s.eventOptions||{},this.identifier=s.identifier||Ee("missing identifier"),this.methodName=s.methodName||Ee("missing method name"),this.keyFilter=s.keyFilter||"",this.schema=i}static forToken(t,e){return new this(t.element,t.index,Oa(t.content),e)}toString(){const t=this.keyFilter?`.${this.keyFilter}`:"",e=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${t}${e}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(t){if(!this.keyFilter)return!1;const e=this.keyFilter.split("+");if(this.keyFilterDissatisfied(t,e))return!0;const s=e.filter(i=>!si.includes(i))[0];return s?(bn(this.keyMappings,s)||Ee(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[s].toLowerCase()!==t.key.toLowerCase()):!1}shouldIgnoreMouseEvent(t){if(!this.keyFilter)return!1;const e=[this.keyFilter];return!!this.keyFilterDissatisfied(t,e)}get params(){const t={},e=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:s,value:i}of Array.from(this.element.attributes)){const r=s.match(e),o=r&&r[1];o&&(t[Un(o)]=_a(i))}return t}get eventTargetName(){return Da(this.eventTarget)}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(t,e){const[s,i,r,o]=si.map(a=>e.includes(a));return t.metaKey!==s||t.ctrlKey!==i||t.altKey!==r||t.shiftKey!==o}}const ii={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:n=>n.getAttribute("type")=="submit"?"click":"input",select:()=>"change",textarea:()=>"input"};function Va(n){const t=n.tagName.toLowerCase();if(t in ii)return ii[t](n)}function Ee(n){throw new Error(n)}function _a(n){try{return JSON.parse(n)}catch{return n}}class Pa{constructor(t,e){this.context=t,this.action=e}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(t){const e=this.prepareActionEvent(t);this.willBeInvokedByEvent(t)&&this.applyEventModifiers(e)&&this.invokeWithEvent(e)}get eventName(){return this.action.eventName}get method(){const t=this.controller[this.methodName];if(typeof t=="function")return t;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(t){const{element:e}=this.action,{actionDescriptorFilters:s}=this.context.application,{controller:i}=this.context;let r=!0;for(const[o,a]of Object.entries(this.eventOptions))if(o in s){const l=s[o];r=r&&l({name:o,value:a,event:t,element:e,controller:i})}else continue;return r}prepareActionEvent(t){return Object.assign(t,{params:this.action.params})}invokeWithEvent(t){const{target:e,currentTarget:s}=t;try{this.method.call(this.controller,t),this.context.logDebugActivity(this.methodName,{event:t,target:e,currentTarget:s,action:this.methodName})}catch(i){const{identifier:r,controller:o,element:a,index:l}=this,c={identifier:r,controller:o,element:a,index:l,event:t};this.context.handleError(i,`invoking action "${this.action}"`,c)}}willBeInvokedByEvent(t){const e=t.target;return t instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(t)||t instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(t)?!1:this.element===e?!0:e instanceof Element&&this.element.contains(e)?this.scope.containsElement(e):this.scope.containsElement(this.action.element)}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class cr{constructor(t,e){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=t,this.started=!1,this.delegate=e,this.elements=new Set,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(t){this.started&&(this.mutationObserver.disconnect(),this.started=!1),t(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const t=new Set(this.matchElementsInTree());for(const e of Array.from(this.elements))t.has(e)||this.removeElement(e);for(const e of Array.from(t))this.addElement(e)}}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){t.type=="attributes"?this.processAttributeChange(t.target,t.attributeName):t.type=="childList"&&(this.processRemovedNodes(t.removedNodes),this.processAddedNodes(t.addedNodes))}processAttributeChange(t,e){this.elements.has(t)?this.delegate.elementAttributeChanged&&this.matchElement(t)?this.delegate.elementAttributeChanged(t,e):this.removeElement(t):this.matchElement(t)&&this.addElement(t)}processRemovedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.processTree(s,this.removeElement)}}processAddedNodes(t){for(const e of Array.from(t)){const s=this.elementFromNode(e);s&&this.elementIsActive(s)&&this.processTree(s,this.addElement)}}matchElement(t){return this.delegate.matchElement(t)}matchElementsInTree(t=this.element){return this.delegate.matchElementsInTree(t)}processTree(t,e){for(const s of this.matchElementsInTree(t))e.call(this,s)}elementFromNode(t){if(t.nodeType==Node.ELEMENT_NODE)return t}elementIsActive(t){return t.isConnected!=this.element.isConnected?!1:this.element.contains(t)}addElement(t){this.elements.has(t)||this.elementIsActive(t)&&(this.elements.add(t),this.delegate.elementMatched&&this.delegate.elementMatched(t))}removeElement(t){this.elements.has(t)&&(this.elements.delete(t),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(t))}}class ur{constructor(t,e,s){this.attributeName=e,this.delegate=s,this.elementObserver=new cr(t,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(t){return t.hasAttribute(this.attributeName)}matchElementsInTree(t){const e=this.matchElement(t)?[t]:[],s=Array.from(t.querySelectorAll(this.selector));return e.concat(s)}elementMatched(t){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(t,this.attributeName)}elementUnmatched(t){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(t,this.attributeName)}elementAttributeChanged(t,e){this.delegate.elementAttributeValueChanged&&this.attributeName==e&&this.delegate.elementAttributeValueChanged(t,e)}}function Ra(n,t,e){hr(n,t).add(e)}function Ba(n,t,e){hr(n,t).delete(e),Ia(n,t)}function hr(n,t){let e=n.get(t);return e||(e=new Set,n.set(t,e)),e}function Ia(n,t){const e=n.get(t);e!=null&&e.size==0&&n.delete(t)}class yt{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e.concat(Array.from(s)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,s)=>e+s.size,0)}add(t,e){Ra(this.valuesByKey,t,e)}delete(t,e){Ba(this.valuesByKey,t,e)}has(t,e){const s=this.valuesByKey.get(t);return s!=null&&s.has(e)}hasKey(t){return this.valuesByKey.has(t)}hasValue(t){return Array.from(this.valuesByKey.values()).some(s=>s.has(t))}getValuesForKey(t){const e=this.valuesByKey.get(t);return e?Array.from(e):[]}getKeysForValue(t){return Array.from(this.valuesByKey).filter(([e,s])=>s.has(t)).map(([e,s])=>e)}}class Na{constructor(t,e,s,i){this._selector=e,this.details=i,this.elementObserver=new cr(t,this),this.delegate=s,this.matchesByElement=new yt}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(t){this._selector=t,this.refresh()}start(){this.elementObserver.start()}pause(t){this.elementObserver.pause(t)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(t){const{selector:e}=this;if(e){const s=t.matches(e);return this.delegate.selectorMatchElement?s&&this.delegate.selectorMatchElement(t,this.details):s}else return!1}matchElementsInTree(t){const{selector:e}=this;if(e){const s=this.matchElement(t)?[t]:[],i=Array.from(t.querySelectorAll(e)).filter(r=>this.matchElement(r));return s.concat(i)}else return[]}elementMatched(t){const{selector:e}=this;e&&this.selectorMatched(t,e)}elementUnmatched(t){const e=this.matchesByElement.getKeysForValue(t);for(const s of e)this.selectorUnmatched(t,s)}elementAttributeChanged(t,e){const{selector:s}=this;if(s){const i=this.matchElement(t),r=this.matchesByElement.has(s,t);i&&!r?this.selectorMatched(t,s):!i&&r&&this.selectorUnmatched(t,s)}}selectorMatched(t,e){this.delegate.selectorMatched(t,e,this.details),this.matchesByElement.add(e,t)}selectorUnmatched(t,e){this.delegate.selectorUnmatched(t,e,this.details),this.matchesByElement.delete(e,t)}}class $a{constructor(t,e){this.element=t,this.delegate=e,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(s=>this.processMutations(s))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const t of this.knownAttributeNames)this.refreshAttribute(t,null)}processMutations(t){if(this.started)for(const e of t)this.processMutation(e)}processMutation(t){const e=t.attributeName;e&&this.refreshAttribute(e,t.oldValue)}refreshAttribute(t,e){const s=this.delegate.getStringMapKeyForAttribute(t);if(s!=null){this.stringMap.has(t)||this.stringMapKeyAdded(s,t);const i=this.element.getAttribute(t);if(this.stringMap.get(t)!=i&&this.stringMapValueChanged(i,s,e),i==null){const r=this.stringMap.get(t);this.stringMap.delete(t),r&&this.stringMapKeyRemoved(s,t,r)}else this.stringMap.set(t,i)}}stringMapKeyAdded(t,e){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(t,e)}stringMapValueChanged(t,e,s){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(t,e,s)}stringMapKeyRemoved(t,e,s){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(t,e,s)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(t=>t.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class dr{constructor(t,e,s){this.attributeObserver=new ur(t,e,this),this.delegate=s,this.tokensByElement=new yt}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(t){this.attributeObserver.pause(t)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(t){this.tokensMatched(this.readTokensForElement(t))}elementAttributeValueChanged(t){const[e,s]=this.refreshTokensForElement(t);this.tokensUnmatched(e),this.tokensMatched(s)}elementUnmatchedAttribute(t){this.tokensUnmatched(this.tokensByElement.getValuesForKey(t))}tokensMatched(t){t.forEach(e=>this.tokenMatched(e))}tokensUnmatched(t){t.forEach(e=>this.tokenUnmatched(e))}tokenMatched(t){this.delegate.tokenMatched(t),this.tokensByElement.add(t.element,t)}tokenUnmatched(t){this.delegate.tokenUnmatched(t),this.tokensByElement.delete(t.element,t)}refreshTokensForElement(t){const e=this.tokensByElement.getValuesForKey(t),s=this.readTokensForElement(t),i=Ka(e,s).findIndex(([r,o])=>!Ha(r,o));return i==-1?[[],[]]:[e.slice(i),s.slice(i)]}readTokensForElement(t){const e=this.attributeName,s=t.getAttribute(e)||"";return ja(s,t,e)}}function ja(n,t,e){return n.trim().split(/\s+/).filter(s=>s.length).map((s,i)=>({element:t,attributeName:e,content:s,index:i}))}function Ka(n,t){const e=Math.max(n.length,t.length);return Array.from({length:e},(s,i)=>[n[i],t[i]])}function Ha(n,t){return n&&t&&n.index==t.index&&n.content==t.content}class fr{constructor(t,e,s){this.tokenListObserver=new dr(t,e,this),this.delegate=s,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).set(t,s),this.delegate.elementMatchedValue(e,s))}tokenUnmatched(t){const{element:e}=t,{value:s}=this.fetchParseResultForToken(t);s&&(this.fetchValuesByTokenForElement(e).delete(t),this.delegate.elementUnmatchedValue(e,s))}fetchParseResultForToken(t){let e=this.parseResultsByToken.get(t);return e||(e=this.parseToken(t),this.parseResultsByToken.set(t,e)),e}fetchValuesByTokenForElement(t){let e=this.valuesByTokenByElement.get(t);return e||(e=new Map,this.valuesByTokenByElement.set(t,e)),e}parseToken(t){try{return{value:this.delegate.parseValueForToken(t)}}catch(e){return{error:e}}}}class Ua{constructor(t,e){this.context=t,this.delegate=e,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new fr(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(t){const e=new Pa(this.context,t);this.bindingsByAction.set(t,e),this.delegate.bindingConnected(e)}disconnectAction(t){const e=this.bindingsByAction.get(t);e&&(this.bindingsByAction.delete(t),this.delegate.bindingDisconnected(e))}disconnectAllActions(){this.bindings.forEach(t=>this.delegate.bindingDisconnected(t,!0)),this.bindingsByAction.clear()}parseValueForToken(t){const e=Fa.forToken(t,this.schema);if(e.identifier==this.identifier)return e}elementMatchedValue(t,e){this.connectAction(e)}elementUnmatchedValue(t,e){this.disconnectAction(e)}}class Wa{constructor(t,e){this.context=t,this.receiver=e,this.stringMapObserver=new $a(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(t){if(t in this.valueDescriptorMap)return this.valueDescriptorMap[t].name}stringMapKeyAdded(t,e){const s=this.valueDescriptorMap[e];this.hasValue(t)||this.invokeChangedCallback(t,s.writer(this.receiver[t]),s.writer(s.defaultValue))}stringMapValueChanged(t,e,s){const i=this.valueDescriptorNameMap[e];t!==null&&(s===null&&(s=i.writer(i.defaultValue)),this.invokeChangedCallback(e,t,s))}stringMapKeyRemoved(t,e,s){const i=this.valueDescriptorNameMap[t];this.hasValue(t)?this.invokeChangedCallback(t,i.writer(this.receiver[t]),s):this.invokeChangedCallback(t,i.writer(i.defaultValue),s)}invokeChangedCallbacksForDefaultValues(){for(const{key:t,name:e,defaultValue:s,writer:i}of this.valueDescriptors)s!=null&&!this.controller.data.has(t)&&this.invokeChangedCallback(e,i(s),void 0)}invokeChangedCallback(t,e,s){const i=`${t}Changed`,r=this.receiver[i];if(typeof r=="function"){const o=this.valueDescriptorNameMap[t];try{const a=o.reader(e);let l=s;s&&(l=o.reader(s)),r.call(this.receiver,a,l)}catch(a){throw a instanceof TypeError&&(a.message=`Stimulus Value "${this.context.identifier}.${o.name}" - ${a.message}`),a}}}get valueDescriptors(){const{valueDescriptorMap:t}=this;return Object.keys(t).map(e=>t[e])}get valueDescriptorNameMap(){const t={};return Object.keys(this.valueDescriptorMap).forEach(e=>{const s=this.valueDescriptorMap[e];t[s.name]=s}),t}hasValue(t){const e=this.valueDescriptorNameMap[t],s=`has${de(e.name)}`;return this.receiver[s]}}class za{constructor(t,e){this.context=t,this.delegate=e,this.targetsByName=new yt}start(){this.tokenListObserver||(this.tokenListObserver=new dr(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:t,content:e}){this.scope.containsElement(t)&&this.connectTarget(t,e)}tokenUnmatched({element:t,content:e}){this.disconnectTarget(t,e)}connectTarget(t,e){var s;this.targetsByName.has(e,t)||(this.targetsByName.add(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetConnected(t,e)))}disconnectTarget(t,e){var s;this.targetsByName.has(e,t)&&(this.targetsByName.delete(e,t),(s=this.tokenListObserver)===null||s===void 0||s.pause(()=>this.delegate.targetDisconnected(t,e)))}disconnectAllTargets(){for(const t of this.targetsByName.keys)for(const e of this.targetsByName.getValuesForKey(t))this.disconnectTarget(e,t)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function fe(n,t){const e=mr(n);return Array.from(e.reduce((s,i)=>(Ya(i,t).forEach(r=>s.add(r)),s),new Set))}function qa(n,t){return mr(n).reduce((s,i)=>(s.push(...Xa(i,t)),s),[])}function mr(n){const t=[];for(;n;)t.push(n),n=Object.getPrototypeOf(n);return t.reverse()}function Ya(n,t){const e=n[t];return Array.isArray(e)?e:[]}function Xa(n,t){const e=n[t];return e?Object.keys(e).map(s=>[s,e[s]]):[]}class Ga{constructor(t,e){this.started=!1,this.context=t,this.delegate=e,this.outletsByName=new yt,this.outletElementsByName=new yt,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(t=>{this.setupSelectorObserverForOutlet(t),this.setupAttributeObserverForOutlet(t)}),this.started=!0,this.dependentContexts.forEach(t=>t.refresh()))}refresh(){this.selectorObserverMap.forEach(t=>t.refresh()),this.attributeObserverMap.forEach(t=>t.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(t=>t.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(t=>t.stop()),this.attributeObserverMap.clear())}selectorMatched(t,e,{outletName:s}){const i=this.getOutlet(t,s);i&&this.connectOutlet(i,t,s)}selectorUnmatched(t,e,{outletName:s}){const i=this.getOutletFromMap(t,s);i&&this.disconnectOutlet(i,t,s)}selectorMatchElement(t,{outletName:e}){const s=this.selector(e),i=this.hasOutlet(t,e),r=t.matches(`[${this.schema.controllerAttribute}~=${e}]`);return s?i&&r&&t.matches(s):!1}elementMatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementAttributeValueChanged(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}elementUnmatchedAttribute(t,e){const s=this.getOutletNameFromOutletAttributeName(e);s&&this.updateSelectorObserverForOutlet(s)}connectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)||(this.outletsByName.add(s,t),this.outletElementsByName.add(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletConnected(t,e,s)))}disconnectOutlet(t,e,s){var i;this.outletElementsByName.has(s,e)&&(this.outletsByName.delete(s,t),this.outletElementsByName.delete(s,e),(i=this.selectorObserverMap.get(s))===null||i===void 0||i.pause(()=>this.delegate.outletDisconnected(t,e,s)))}disconnectAllOutlets(){for(const t of this.outletElementsByName.keys)for(const e of this.outletElementsByName.getValuesForKey(t))for(const s of this.outletsByName.getValuesForKey(t))this.disconnectOutlet(s,e,t)}updateSelectorObserverForOutlet(t){const e=this.selectorObserverMap.get(t);e&&(e.selector=this.selector(t))}setupSelectorObserverForOutlet(t){const e=this.selector(t),s=new Na(document.body,e,this,{outletName:t});this.selectorObserverMap.set(t,s),s.start()}setupAttributeObserverForOutlet(t){const e=this.attributeNameForOutletName(t),s=new ur(this.scope.element,e,this);this.attributeObserverMap.set(t,s),s.start()}selector(t){return this.scope.outlets.getSelectorForOutletName(t)}attributeNameForOutletName(t){return this.scope.schema.outletAttributeForScope(this.identifier,t)}getOutletNameFromOutletAttributeName(t){return this.outletDefinitions.find(e=>this.attributeNameForOutletName(e)===t)}get outletDependencies(){const t=new yt;return this.router.modules.forEach(e=>{const s=e.definition.controllerConstructor;fe(s,"outlets").forEach(r=>t.add(r,e.identifier))}),t}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const t=this.dependentControllerIdentifiers;return this.router.contexts.filter(e=>t.includes(e.identifier))}hasOutlet(t,e){return!!this.getOutlet(t,e)||!!this.getOutletFromMap(t,e)}getOutlet(t,e){return this.application.getControllerForElementAndIdentifier(t,e)}getOutletFromMap(t,e){return this.outletsByName.getValuesForKey(e).find(s=>s.element===t)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class Za{constructor(t,e){this.logDebugActivity=(s,i={})=>{const{identifier:r,controller:o,element:a}=this;i=Object.assign({identifier:r,controller:o,element:a},i),this.application.logDebugActivity(this.identifier,s,i)},this.module=t,this.scope=e,this.controller=new t.controllerConstructor(this),this.bindingObserver=new Ua(this,this.dispatcher),this.valueObserver=new Wa(this,this.controller),this.targetObserver=new za(this,this),this.outletObserver=new Ga(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(s){this.handleError(s,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(t){this.handleError(t,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(t){this.handleError(t,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(t,e,s={}){const{identifier:i,controller:r,element:o}=this;s=Object.assign({identifier:i,controller:r,element:o},s),this.application.handleError(t,`Error ${e}`,s)}targetConnected(t,e){this.invokeControllerMethod(`${e}TargetConnected`,t)}targetDisconnected(t,e){this.invokeControllerMethod(`${e}TargetDisconnected`,t)}outletConnected(t,e,s){this.invokeControllerMethod(`${gn(s)}OutletConnected`,t,e)}outletDisconnected(t,e,s){this.invokeControllerMethod(`${gn(s)}OutletDisconnected`,t,e)}invokeControllerMethod(t,...e){const s=this.controller;typeof s[t]=="function"&&s[t](...e)}}function Qa(n){return Ja(n,tl(n))}function Ja(n,t){const e=il(n),s=el(n.prototype,t);return Object.defineProperties(e.prototype,s),e}function tl(n){return fe(n,"blessings").reduce((e,s)=>{const i=s(n);for(const r in i){const o=e[r]||{};e[r]=Object.assign(o,i[r])}return e},{})}function el(n,t){return sl(t).reduce((e,s)=>{const i=nl(n,t,s);return i&&Object.assign(e,{[s]:i}),e},{})}function nl(n,t,e){const s=Object.getOwnPropertyDescriptor(n,e);if(!(s&&"value"in s)){const r=Object.getOwnPropertyDescriptor(t,e).value;return s&&(r.get=s.get||r.get,r.set=s.set||r.set),r}}const sl=typeof Object.getOwnPropertySymbols=="function"?n=>[...Object.getOwnPropertyNames(n),...Object.getOwnPropertySymbols(n)]:Object.getOwnPropertyNames,il=(()=>{function n(e){function s(){return Reflect.construct(e,arguments,new.target)}return s.prototype=Object.create(e.prototype,{constructor:{value:s}}),Reflect.setPrototypeOf(s,e),s}function t(){const s=n(function(){this.a.call(this)});return s.prototype.a=function(){},new s}try{return t(),n}catch{return s=>class extends s{}}})();function rl(n){return{identifier:n.identifier,controllerConstructor:Qa(n.controllerConstructor)}}class ol{constructor(t,e){this.application=t,this.definition=rl(e),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(t){const e=this.fetchContextForScope(t);this.connectedContexts.add(e),e.connect()}disconnectContextForScope(t){const e=this.contextsByScope.get(t);e&&(this.connectedContexts.delete(e),e.disconnect())}fetchContextForScope(t){let e=this.contextsByScope.get(t);return e||(e=new Za(this,t),this.contextsByScope.set(t,e)),e}}class al{constructor(t){this.scope=t}has(t){return this.data.has(this.getDataKey(t))}get(t){return this.getAll(t)[0]}getAll(t){const e=this.data.get(this.getDataKey(t))||"";return La(e)}getAttributeName(t){return this.data.getAttributeNameForKey(this.getDataKey(t))}getDataKey(t){return`${t}-class`}get data(){return this.scope.data}}class ll{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(t){const e=this.getAttributeNameForKey(t);return this.element.getAttribute(e)}set(t,e){const s=this.getAttributeNameForKey(t);return this.element.setAttribute(s,e),this.get(t)}has(t){const e=this.getAttributeNameForKey(t);return this.element.hasAttribute(e)}delete(t){if(this.has(t)){const e=this.getAttributeNameForKey(t);return this.element.removeAttribute(e),!0}else return!1}getAttributeNameForKey(t){return`data-${this.identifier}-${lr(t)}`}}class cl{constructor(t){this.warnedKeysByObject=new WeakMap,this.logger=t}warn(t,e,s){let i=this.warnedKeysByObject.get(t);i||(i=new Set,this.warnedKeysByObject.set(t,i)),i.has(e)||(i.add(e),this.logger.warn(s,t))}}function yn(n,t){return`[${n}~="${t}"]`}class ul{constructor(t){this.scope=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findTarget(s)||this.findLegacyTarget(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllTargets(s),...this.findAllLegacyTargets(s)],[])}findTarget(t){const e=this.getSelectorForTargetName(t);return this.scope.findElement(e)}findAllTargets(t){const e=this.getSelectorForTargetName(t);return this.scope.findAllElements(e)}getSelectorForTargetName(t){const e=this.schema.targetAttributeForScope(this.identifier);return yn(e,t)}findLegacyTarget(t){const e=this.getLegacySelectorForTargetName(t);return this.deprecate(this.scope.findElement(e),t)}findAllLegacyTargets(t){const e=this.getLegacySelectorForTargetName(t);return this.scope.findAllElements(e).map(s=>this.deprecate(s,t))}getLegacySelectorForTargetName(t){const e=`${this.identifier}.${t}`;return yn(this.schema.targetAttribute,e)}deprecate(t,e){if(t){const{identifier:s}=this,i=this.schema.targetAttribute,r=this.schema.targetAttributeForScope(s);this.guide.warn(t,`target:${e}`,`Please replace ${i}="${s}.${e}" with ${r}="${e}". The ${i} attribute is deprecated and will be removed in a future version of Stimulus.`)}return t}get guide(){return this.scope.guide}}class hl{constructor(t,e){this.scope=t,this.controllerElement=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(t){return this.find(t)!=null}find(...t){return t.reduce((e,s)=>e||this.findOutlet(s),void 0)}findAll(...t){return t.reduce((e,s)=>[...e,...this.findAllOutlets(s)],[])}getSelectorForOutletName(t){const e=this.schema.outletAttributeForScope(this.identifier,t);return this.controllerElement.getAttribute(e)}findOutlet(t){const e=this.getSelectorForOutletName(t);if(e)return this.findElement(e,t)}findAllOutlets(t){const e=this.getSelectorForOutletName(t);return e?this.findAllElements(e,t):[]}findElement(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))[0]}findAllElements(t,e){return this.scope.queryElements(t).filter(i=>this.matchesElement(i,t,e))}matchesElement(t,e,s){const i=t.getAttribute(this.scope.schema.controllerAttribute)||"";return t.matches(e)&&i.split(" ").includes(s)}}class Wn{constructor(t,e,s,i){this.targets=new ul(this),this.classes=new al(this),this.data=new ll(this),this.containsElement=r=>r.closest(this.controllerSelector)===this.element,this.schema=t,this.element=e,this.identifier=s,this.guide=new cl(i),this.outlets=new hl(this.documentScope,e)}findElement(t){return this.element.matches(t)?this.element:this.queryElements(t).find(this.containsElement)}findAllElements(t){return[...this.element.matches(t)?[this.element]:[],...this.queryElements(t).filter(this.containsElement)]}queryElements(t){return Array.from(this.element.querySelectorAll(t))}get controllerSelector(){return yn(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Wn(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class dl{constructor(t,e,s){this.element=t,this.schema=e,this.delegate=s,this.valueListObserver=new fr(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(t){const{element:e,content:s}=t;return this.parseValueForElementAndIdentifier(e,s)}parseValueForElementAndIdentifier(t,e){const s=this.fetchScopesByIdentifierForElement(t);let i=s.get(e);return i||(i=this.delegate.createScopeForElementAndIdentifier(t,e),s.set(e,i)),i}elementMatchedValue(t,e){const s=(this.scopeReferenceCounts.get(e)||0)+1;this.scopeReferenceCounts.set(e,s),s==1&&this.delegate.scopeConnected(e)}elementUnmatchedValue(t,e){const s=this.scopeReferenceCounts.get(e);s&&(this.scopeReferenceCounts.set(e,s-1),s==1&&this.delegate.scopeDisconnected(e))}fetchScopesByIdentifierForElement(t){let e=this.scopesByIdentifierByElement.get(t);return e||(e=new Map,this.scopesByIdentifierByElement.set(t,e)),e}}class fl{constructor(t){this.application=t,this.scopeObserver=new dl(this.element,this.schema,this),this.scopesByIdentifier=new yt,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((t,e)=>t.concat(e.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(t){this.unloadIdentifier(t.identifier);const e=new ol(this.application,t);this.connectModule(e);const s=t.controllerConstructor.afterLoad;s&&s.call(t.controllerConstructor,t.identifier,this.application)}unloadIdentifier(t){const e=this.modulesByIdentifier.get(t);e&&this.disconnectModule(e)}getContextForElementAndIdentifier(t,e){const s=this.modulesByIdentifier.get(e);if(s)return s.contexts.find(i=>i.element==t)}proposeToConnectScopeForElementAndIdentifier(t,e){const s=this.scopeObserver.parseValueForElementAndIdentifier(t,e);s?this.scopeObserver.elementMatchedValue(s.element,s):console.error(`Couldn't find or create scope for identifier: "${e}" and element:`,t)}handleError(t,e,s){this.application.handleError(t,e,s)}createScopeForElementAndIdentifier(t,e){return new Wn(this.schema,t,e,this.logger)}scopeConnected(t){this.scopesByIdentifier.add(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.connectContextForScope(t)}scopeDisconnected(t){this.scopesByIdentifier.delete(t.identifier,t);const e=this.modulesByIdentifier.get(t.identifier);e&&e.disconnectContextForScope(t)}connectModule(t){this.modulesByIdentifier.set(t.identifier,t),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.connectContextForScope(s))}disconnectModule(t){this.modulesByIdentifier.delete(t.identifier),this.scopesByIdentifier.getValuesForKey(t.identifier).forEach(s=>t.disconnectContextForScope(s))}}const ml={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:n=>`data-${n}-target`,outletAttributeForScope:(n,t)=>`data-${n}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},ri("abcdefghijklmnopqrstuvwxyz".split("").map(n=>[n,n]))),ri("0123456789".split("").map(n=>[n,n])))};function ri(n){return n.reduce((t,[e,s])=>Object.assign(Object.assign({},t),{[e]:s}),{})}class pl{constructor(t=document.documentElement,e=ml){this.logger=console,this.debug=!1,this.logDebugActivity=(s,i,r={})=>{this.debug&&this.logFormattedMessage(s,i,r)},this.element=t,this.schema=e,this.dispatcher=new xa(this),this.router=new fl(this),this.actionDescriptorFilters=Object.assign({},Sa)}static start(t,e){const s=new this(t,e);return s.start(),s}async start(){await gl(),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(t,e){this.load({identifier:t,controllerConstructor:e})}registerActionOption(t,e){this.actionDescriptorFilters[t]=e}load(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>{i.controllerConstructor.shouldLoad&&this.router.loadDefinition(i)})}unload(t,...e){(Array.isArray(t)?t:[t,...e]).forEach(i=>this.router.unloadIdentifier(i))}get controllers(){return this.router.contexts.map(t=>t.controller)}getControllerForElementAndIdentifier(t,e){const s=this.router.getContextForElementAndIdentifier(t,e);return s?s.controller:null}handleError(t,e,s){var i;this.logger.error(`%s
|
95
95
|
|
96
96
|
%o
|
97
97
|
|
98
|
-
%o`,e,t,s),(i=window.onerror)===null||i===void 0||i.call(window,e,"",0,0,t)}logFormattedMessage(t,e,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${t} #${e}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}}function jr(){return new Promise(n=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>n()):n()})}function Hr(n){return Kt(n,"classes").reduce((e,s)=>Object.assign(e,Ur(s)),{})}function Ur(n){return{[`${n}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${Wt(n)}Class`]:{get(){return this.classes.has(n)}}}}function Wr(n){return Kt(n,"outlets").reduce((e,s)=>Object.assign(e,Kr(s)),{})}function Kn(n,t,e){return n.application.getControllerForElementAndIdentifier(t,e)}function zn(n,t,e){let s=Kn(n,t,e);if(s||(n.application.router.proposeToConnectScopeForElementAndIdentifier(t,e),s=Kn(n,t,e),s))return s}function Kr(n){const t=Fe(n);return{[`${t}Outlet`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e){const i=zn(this,e,n);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}Outlets`]:{get(){const e=this.outlets.findAll(n);return e.length>0?e.map(s=>{const i=zn(this,s,n);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${t}OutletElement`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e)return e;throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(n)}},[`has${Wt(t)}Outlet`]:{get(){return this.outlets.has(n)}}}}function zr(n){return Kt(n,"targets").reduce((e,s)=>Object.assign(e,qr(s)),{})}function qr(n){return{[`${n}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${Wt(n)}Target`]:{get(){return this.targets.has(n)}}}}function Yr(n){const t=vr(n,"values"),e={valueDescriptorMap:{get(){return t.reduce((s,i)=>{const r=Ds(i,this.identifier),o=this.data.getAttributeNameForKey(r.key);return Object.assign(s,{[o]:r})},{})}}};return t.reduce((s,i)=>Object.assign(s,Xr(i)),e)}function Xr(n,t){const e=Ds(n,t),{key:s,name:i,reader:r,writer:o}=e;return{[i]:{get(){const a=this.data.get(s);return a!==null?r(a):e.defaultValue},set(a){a===void 0?this.data.delete(s):this.data.set(s,o(a))}},[`has${Wt(i)}`]:{get(){return this.data.has(s)||e.hasCustomDefaultValue}}}}function Ds([n,t],e){return Qr({controller:e,token:n,typeDefinition:t})}function te(n){switch(n){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function jt(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(n))return"array";if(Object.prototype.toString.call(n)==="[object Object]")return"object"}function Gr(n){const{controller:t,token:e,typeObject:s}=n,i=jn(s.type),r=jn(s.default),o=i&&r,a=i&&!r,l=!i&&r,c=te(s.type),u=jt(n.typeObject.default);if(a)return c;if(l)return u;if(c!==u){const d=t?`${t}.${e}`:e;throw new Error(`The specified default value for the Stimulus Value "${d}" must match the defined type "${c}". The provided default value of "${s.default}" is of type "${u}".`)}if(o)return c}function Zr(n){const{controller:t,token:e,typeDefinition:s}=n,r=Gr({controller:t,token:e,typeObject:s}),o=jt(s),a=te(s),l=r||o||a;if(l)return l;const c=t?`${t}.${s}`:e;throw new Error(`Unknown value type "${c}" for "${e}" value`)}function Jr(n){const t=te(n);if(t)return qn[t];const e=Be(n,"default"),s=Be(n,"type"),i=n;if(e)return i.default;if(s){const{type:r}=i,o=te(r);if(o)return qn[o]}return n}function Qr(n){const{token:t,typeDefinition:e}=n,s=`${Os(t)}-value`,i=Zr(n);return{type:i,key:s,name:Xe(s),get defaultValue(){return Jr(e)},get hasCustomDefaultValue(){return jt(e)!==void 0},reader:to[i],writer:Yn[i]||Yn.default}}const qn={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},to={array(n){const t=JSON.parse(n);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${n}" of type "${jt(t)}"`);return t},boolean(n){return!(n=="0"||String(n).toLowerCase()=="false")},number(n){return Number(n.replace(/_/g,""))},object(n){const t=JSON.parse(n);if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${n}" of type "${jt(t)}"`);return t},string(n){return n}},Yn={default:eo,array:Xn,object:Xn};function Xn(n){return JSON.stringify(n)}function eo(n){return`${n}`}let st=class{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(t,{target:e=this.element,detail:s={},prefix:i=this.identifier,bubbles:r=!0,cancelable:o=!0}={}){const a=i?`${i}:${t}`:t,l=new CustomEvent(a,{detail:s,bubbles:r,cancelable:o});return e.dispatchEvent(l),l}};st.blessings=[Hr,zr,Yr,Wr];st.targets=[];st.outlets=[];st.values={};function F(){return function({targets:t,values:e}={}){const i=class i extends st{dispatchEvent(o,a,l={}){const c=new Event(a,{bubbles:l.bubbles||!1,cancelable:l.cancelable||!1});o.dispatchEvent(c)}};i.targets=Object.keys(t??{}),i.values=e??{};let s=i;return s}}class no extends F()({targets:{toggle:HTMLInputElement},values:{formMethod:String,formUrl:String,csrfToken:String,turbo:Boolean}}){connect(){this.toggling=!1}requiresFormSubmit(){return this.formUrlValue!=null}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.requiresFormSubmit()){this.performToggle(),this.toggling=!1;return}this.performToggle();try{await this.submitForm()}catch(t){t instanceof Error&&this.performToggle();return}finally{this.toggling=!1}}}performToggle(){this.isOn()?this.turnOff():this.turnOn()}turnOn(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","true")}turnOff(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","false")}isOn(){return this.toggleTarget.getAttribute("aria-pressed")==="true"}isOff(){return!this.isOn()}isDisabled(){return this.toggleTarget.getAttribute("disabled")!=null}async submitForm(){const t=new FormData,e=this.documentCsrfToken()||this.csrfTokenValue;if(e&&t.append(this.csrfField(),e),t.append(this.toggleTarget.name,this.isOn()?"true":"false"),!this.formUrlValue)throw new Error("invalid src");let s;const i={"Requested-With":"XMLHttpRequest"};this.turboValue&&(i.Accept="text/vnd.turbo-stream.html");try{s=await fetch(this.formUrlValue,{credentials:"same-origin",method:this.formMethodValue,headers:i,body:t})}catch(o){throw new Error(`A network error occurred, please try again: ${o.message}`)}if(!s.ok)throw new Error(await s.text());const r=s.headers.get("Content-Type");window.Turbo&&this.turbo&&(r!=null&&r.startsWith("text/vnd.turbo-stream.html"))&&window.Turbo.renderStreamMessage(await s.text())}csrfField(){return this.toggleTarget.getAttribute("csrf-field")||"authenticity_token"}documentCsrfToken(){const t=document.querySelector("meta[name=csrf-token]");return t&&t.getAttribute("content")}}const so=Object.freeze(Object.defineProperty({__proto__:null,default:no},Symbol.toStringTag,{value:"Module"})),dn=class dn extends F()({targets:{content:HTMLElement,chevron:HTMLElement},values:{open:{type:Boolean,default:!1}}}){connect(){this.applyState(this.openValue)}toggle(t){t&&t.stopPropagation(),this.openValue=!this.openValue}openValueChanged(t){this.applyState(t)}applyState(t){const e=this.contentTarget,s=this.hasChevronTarget?this.chevronTarget:null,i=e.scrollHeight;t?(e.classList.add("ariadne:animate-accordion-down"),e.classList.remove("ariadne:animate-accordion-up"),e.style.height=`${i}px`,this.element.classList.add("ariadne-sidebar-group-open"),this.element.classList.remove("ariadne-sidebar-group-closed"),s&&s.classList.add("ariadne:rotate-90"),setTimeout(()=>{this.openValue&&(e.style.height="auto")},200)):(e.classList.add("ariadne:animate-accordion-up"),e.classList.remove("ariadne:animate-accordion-down"),e.style.height=`${i}px`,e.offsetHeight,e.style.height="0px",this.element.classList.add("ariadne-sidebar-group-closed"),this.element.classList.remove("ariadne-sidebar-group-open"),s&&s.classList.remove("ariadne:rotate-90"))}};dn.classes=["open","closed"];let Re=dn;const io=Object.freeze(Object.defineProperty({__proto__:null,default:Re},Symbol.toStringTag,{value:"Module"}));function ro(n,t){n.indexOf(t)===-1&&n.push(t)}const Fs=(n,t,e)=>Math.min(Math.max(e,n),t),I={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},ee=n=>typeof n=="number",yt=n=>Array.isArray(n)&&!ee(n[0]),oo=(n,t,e)=>{const s=t-n;return((e-n)%s+s)%s+n};function ao(n,t){return yt(n)?n[oo(0,n.length,t)]:n}const Bs=(n,t,e)=>-e*n+e*t+n,Ps=()=>{},Q=n=>n,Ze=(n,t,e)=>t-n===0?1:(e-n)/(t-n);function Rs(n,t){const e=n[n.length-1];for(let s=1;s<=t;s++){const i=Ze(0,t,s);n.push(Bs(e,1,i))}}function lo(n){const t=[0];return Rs(t,n-1),t}function co(n,t=lo(n.length),e=Q){const s=n.length,i=s-t.length;return i>0&&Rs(t,i),r=>{let o=0;for(;o<s-2&&!(r<t[o+1]);o++);let a=Fs(0,1,Ze(t[o],t[o+1],r));return a=ao(e,o)(a),Bs(n[o],n[o+1],a)}}const $s=n=>Array.isArray(n)&&ee(n[0]),$e=n=>typeof n=="object"&&!!n.createAnimation,Tt=n=>typeof n=="function",uo=n=>typeof n=="string",$t={ms:n=>n*1e3,s:n=>n/1e3},Ns=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n,ho=1e-7,fo=12;function mo(n,t,e,s,i){let r,o,a=0;do o=t+(e-t)/2,r=Ns(o,s,i)-n,r>0?e=o:t=o;while(Math.abs(r)>ho&&++a<fo);return o}function Ft(n,t,e,s){if(n===t&&e===s)return Q;const i=r=>mo(r,0,1,n,e);return r=>r===0||r===1?r:Ns(i(r),t,s)}const po=(n,t="end")=>e=>{e=t==="end"?Math.min(e,.999):Math.max(e,.001);const s=e*n,i=t==="end"?Math.floor(s):Math.ceil(s);return Fs(0,1,i/n)},go={ease:Ft(.25,.1,.25,1),"ease-in":Ft(.42,0,1,1),"ease-in-out":Ft(.42,0,.58,1),"ease-out":Ft(0,0,.58,1)},bo=/\((.*?)\)/;function Gn(n){if(Tt(n))return n;if($s(n))return Ft(...n);const t=go[n];if(t)return t;if(n.startsWith("steps")){const e=bo.exec(n);if(e){const s=e[1].split(",");return po(parseFloat(s[0]),s[1].trim())}}return Q}class Is{constructor(t,e=[0,1],{easing:s,duration:i=I.duration,delay:r=I.delay,endDelay:o=I.endDelay,repeat:a=I.repeat,offset:l,direction:c="normal",autoplay:u=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=Q,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((h,m)=>{this.resolve=h,this.reject=m}),s=s||I.easing,$e(s)){const h=s.createAnimation(e);s=h.easing,e=h.keyframes||e,i=h.duration||i}this.repeat=a,this.easing=yt(s)?Q:Gn(s),this.updateDuration(i);const d=co(e,l,yt(s)?s.map(Gn):Q);this.tick=h=>{var m;r=r;let f=0;this.pauseTime!==void 0?f=this.pauseTime:f=(h-this.startTime)*this.rate,this.t=f,f/=1e3,f=Math.max(f-r,0),this.playState==="finished"&&this.pauseTime===void 0&&(f=this.totalDuration);const p=f/this.duration;let b=Math.floor(p),g=p%1;!g&&p>=1&&(g=1),g===1&&b--;const w=b%2;(c==="reverse"||c==="alternate"&&w||c==="alternate-reverse"&&!w)&&(g=1-g);const E=f>=this.totalDuration?1:Math.min(g,1),v=d(this.easing(E));t(v),this.pauseTime===void 0&&(this.playState==="finished"||f>=this.totalDuration+o)?(this.playState="finished",(m=this.resolve)===null||m===void 0||m.call(this,v)):this.playState!=="idle"&&(this.frameRequestId=requestAnimationFrame(this.tick))},u&&this.play()}play(){const t=performance.now();this.playState="running",this.pauseTime!==void 0?this.startTime=t-this.pauseTime:this.startTime||(this.startTime=t),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var t;this.playState="idle",this.frameRequestId!==void 0&&cancelAnimationFrame(this.frameRequestId),(t=this.reject)===null||t===void 0||t.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(t){this.duration=t,this.totalDuration=t*(this.repeat+1)}get currentTime(){return this.t}set currentTime(t){this.pauseTime!==void 0||this.rate===0?this.pauseTime=t:this.startTime=performance.now()-t/this.rate}get playbackRate(){return this.rate}set playbackRate(t){this.rate=t}}class vo{setAnimation(t){this.animation=t,t==null||t.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}const Ee=new WeakMap;function Vs(n){return Ee.has(n)||Ee.set(n,{transforms:[],values:new Map}),Ee.get(n)}function yo(n,t){return n.has(t)||n.set(t,new vo),n.get(t)}const wo=["","X","Y","Z"],Eo=["translate","scale","rotate","skew"],ne={x:"translateX",y:"translateY",z:"translateZ"},Zn={syntax:"<angle>",initialValue:"0deg",toDefaultUnit:n=>n+"deg"},To={translate:{syntax:"<length-percentage>",initialValue:"0px",toDefaultUnit:n=>n+"px"},rotate:Zn,scale:{syntax:"<number>",initialValue:1,toDefaultUnit:Q},skew:Zn},Ht=new Map,Je=n=>`--motion-${n}`,se=["x","y","z"];Eo.forEach(n=>{wo.forEach(t=>{se.push(n+t),Ht.set(Je(n+t),To[n])})});const Ao=(n,t)=>se.indexOf(n)-se.indexOf(t),xo=new Set(se),js=n=>xo.has(n),Oo=(n,t)=>{ne[t]&&(t=ne[t]);const{transforms:e}=Vs(n);ro(e,t),n.style.transform=So(e)},So=n=>n.sort(Ao).reduce(Mo,"").trim(),Mo=(n,t)=>`${n} ${t}(var(${Je(t)}))`,Ne=n=>n.startsWith("--"),Jn=new Set;function Co(n){if(!Jn.has(n)){Jn.add(n);try{const{syntax:t,initialValue:e}=Ht.has(n)?Ht.get(n):{};CSS.registerProperty({name:n,inherits:!1,syntax:t,initialValue:e})}catch{}}}const Te=(n,t)=>document.createElement("div").animate(n,t),Qn={cssRegisterProperty:()=>typeof CSS<"u"&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{Te({opacity:[1]})}catch{return!1}return!0},finished:()=>!!Te({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{Te({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0}},Ae={},pt={};for(const n in Qn)pt[n]=()=>(Ae[n]===void 0&&(Ae[n]=Qn[n]()),Ae[n]);const ko=.015,Lo=(n,t)=>{let e="";const s=Math.round(t/ko);for(let i=0;i<s;i++)e+=n(Ze(0,s-1,i))+", ";return e.substring(0,e.length-2)},ts=(n,t)=>Tt(n)?pt.linearEasing()?`linear(${Lo(n,t)})`:I.easing:$s(n)?_o(n):n,_o=([n,t,e,s])=>`cubic-bezier(${n}, ${t}, ${e}, ${s})`;function Do(n,t){for(let e=0;e<n.length;e++)n[e]===null&&(n[e]=e?n[e-1]:t());return n}const Fo=n=>Array.isArray(n)?n:[n];function Ie(n){return ne[n]&&(n=ne[n]),js(n)?Je(n):n}const Yt={get:(n,t)=>{t=Ie(t);let e=Ne(t)?n.style.getPropertyValue(t):getComputedStyle(n)[t];if(!e&&e!==0){const s=Ht.get(t);s&&(e=s.initialValue)}return e},set:(n,t,e)=>{t=Ie(t),Ne(t)?n.style.setProperty(t,e):n.style[t]=e}};function Hs(n,t=!0){if(!(!n||n.playState==="finished"))try{n.stop?n.stop():(t&&n.commitStyles(),n.cancel())}catch{}}function Bo(n,t){var e;let s=(t==null?void 0:t.toDefaultUnit)||Q;const i=n[n.length-1];if(uo(i)){const r=((e=i.match(/(-?[\d.]+)([a-z%]*)/))===null||e===void 0?void 0:e[2])||"";r&&(s=o=>o+r)}return s}function Po(){return window.__MOTION_DEV_TOOLS_RECORD}function Ro(n,t,e,s={},i){const r=Po(),o=s.record!==!1&&r;let a,{duration:l=I.duration,delay:c=I.delay,endDelay:u=I.endDelay,repeat:d=I.repeat,easing:h=I.easing,persist:m=!1,direction:f,offset:p,allowWebkitAcceleration:b=!1,autoplay:g=!0}=s;const w=Vs(n),E=js(t);let v=pt.waapi();E&&Oo(n,t);const y=Ie(t),O=yo(w.values,y),x=Ht.get(y);return Hs(O.animation,!($e(h)&&O.generator)&&s.record!==!1),()=>{const _=()=>{var A,C;return(C=(A=Yt.get(n,y))!==null&&A!==void 0?A:x==null?void 0:x.initialValue)!==null&&C!==void 0?C:0};let T=Do(Fo(e),_);const D=Bo(T,x);if($e(h)){const A=h.createAnimation(T,t!=="opacity",_,y,O);h=A.easing,T=A.keyframes||T,l=A.duration||l}if(Ne(y)&&(pt.cssRegisterProperty()?Co(y):v=!1),E&&!pt.linearEasing()&&(Tt(h)||yt(h)&&h.some(Tt))&&(v=!1),v){x&&(T=T.map(k=>ee(k)?x.toDefaultUnit(k):k)),T.length===1&&(!pt.partialKeyframes()||o)&&T.unshift(_());const A={delay:$t.ms(c),duration:$t.ms(l),endDelay:$t.ms(u),easing:yt(h)?void 0:ts(h,l),direction:f,iterations:d+1,fill:"both"};a=n.animate({[y]:T,offset:p,easing:yt(h)?h.map(k=>ts(k,l)):void 0},A),a.finished||(a.finished=new Promise((k,M)=>{a.onfinish=k,a.oncancel=M}));const C=T[T.length-1];a.finished.then(()=>{m||(Yt.set(n,y,C),a.cancel())}).catch(Ps),b||(a.playbackRate=1.000001)}else if(i&&E)T=T.map(A=>typeof A=="string"?parseFloat(A):A),T.length===1&&T.unshift(parseFloat(_())),a=new i(A=>{Yt.set(n,y,D?D(A):A)},T,Object.assign(Object.assign({},s),{duration:l,easing:h}));else{const A=T[T.length-1];Yt.set(n,y,x&&ee(A)?x.toDefaultUnit(A):A)}return o&&r(n,t,T,{duration:l,delay:c,easing:h,repeat:d,offset:p},"motion-one"),O.setAnimation(a),a&&!g&&a.pause(),a}}const $o=(n,t)=>n[t]?Object.assign(Object.assign({},n),n[t]):Object.assign({},n);function No(n,t){return typeof n=="string"?n=document.querySelectorAll(n):n instanceof Element&&(n=[n]),Array.from(n||[])}const Io=n=>n(),Us=(n,t,e=I.duration)=>new Proxy({animations:n.map(Io).filter(Boolean),duration:e,options:t},jo),Vo=n=>n.animations[0],jo={get:(n,t)=>{const e=Vo(n);switch(t){case"duration":return n.duration;case"currentTime":return $t.s((e==null?void 0:e[t])||0);case"playbackRate":case"playState":return e==null?void 0:e[t];case"finished":return n.finished||(n.finished=Promise.all(n.animations.map(Ho)).catch(Ps)),n.finished;case"stop":return()=>{n.animations.forEach(s=>Hs(s))};case"forEachNative":return s=>{n.animations.forEach(i=>s(i,n))};default:return typeof(e==null?void 0:e[t])>"u"?void 0:()=>n.animations.forEach(s=>s[t]())}},set:(n,t,e)=>{switch(t){case"currentTime":e=$t.ms(e);case"playbackRate":for(let s=0;s<n.animations.length;s++)n.animations[s][t]=e;return!0}return!1}},Ho=n=>n.finished;function Uo(n,t,e){return Tt(n)?n(t,e):n}function Wo(n){return function(e,s,i={}){e=No(e);const r=e.length,o=[];for(let a=0;a<r;a++){const l=e[a];for(const c in s){const u=$o(i,c);u.delay=Uo(u.delay,a,r);const d=Ro(l,c,s[c],u,n);o.push(d)}}return Us(o,i,i.duration)}}const Ko=Wo(Is);function zo(n,t={}){return Us([()=>{const e=new Is(n,[0,1],t);return e.finished.catch(()=>{}),e}],t,t.duration)}function xe(n,t,e){return(Tt(n)?zo:Ko)(n,t,e)}let qo=class extends F()({targets:{icon:HTMLElement,content:HTMLElement},values:{open:Boolean}}){connect(){this.animationDurationValue=.15,this.openValue?this.open():this.close()}toggle(){this.openValue=!this.openValue}openValueChanged(t){t?this.open():this.close()}open(){this.hasContentTarget&&(this.revealContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!0)}close(){this.hasContentTarget&&(this.hideContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!1)}revealContent(){const t=this.contentTarget.scrollHeight;xe(this.contentTarget,{height:`${t}px`},{duration:this.animationDurationValue,easing:"ease-in-out"})}hideContent(){xe(this.contentTarget,{height:0},{duration:this.animationDurationValue,easing:"ease-in-out"})}rotateIcon(){xe(this.iconTarget,{rotate:`${this.openValue?180:0}deg`})}};const Yo=Object.freeze(Object.defineProperty({__proto__:null,default:qo},Symbol.toStringTag,{value:"Module"}));class Xo extends F()({targets:{banner:HTMLDivElement},values:{open:Boolean,autohide:{default:4e3,type:Number}}}){connect(){if(this.autohideValue!=0){const t=()=>{};setTimeout(()=>{this.hide().then(t).catch(t)},this.autohideValue)}}dismiss(){this.remove(),this.dispatchEvent(this.bannerTarget,"ariadne-banner:dismiss")}show(){this.bannerTarget.style.setProperty("display","initial")}remove(){const t=this.bannerTarget.parentElement;t&&t.removeChild(this.bannerTarget)}hide(){this.bannerTarget.style.setProperty("display","none")}}const Go=Object.freeze(Object.defineProperty({__proto__:null,default:Xo},Symbol.toStringTag,{value:"Module"}));function Zo(n){const t=document.createElement("pre");return t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=n,t}function Ws(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n.textContent||"");const t=getSelection();if(t==null)return Promise.reject(new Error);t.removeAllRanges();const e=document.createRange();return e.selectNodeContents(n),t.addRange(e),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}function Ve(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n);const t=document.body;if(!t)return Promise.reject(new Error);const e=Zo(n);return t.appendChild(e),Ws(e),t.removeChild(e),Promise.resolve()}async function Ks(n){const t=n.getAttribute("for"),e=n.getAttribute("value");function s(){n.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n.getAttribute("aria-disabled")!=="true"){if(e)await Ve(e),s();else if(t){const i="getRootNode"in Element.prototype?n.getRootNode():n.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const r=i.getElementById(t);r&&(await Jo(r),s())}}}function Jo(n){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Ve(n.value):n instanceof HTMLAnchorElement&&n.hasAttribute("href")?Ve(n.href):Ws(n)}function Qo(n){const t=n.currentTarget;t instanceof HTMLElement&&Ks(t)}function zs(n){if(n.key===" "||n.key==="Enter"){const t=n.currentTarget;t instanceof HTMLElement&&(n.preventDefault(),Ks(t))}}function ta(n){n.currentTarget.addEventListener("keydown",zs)}function ea(n){n.currentTarget.removeEventListener("keydown",zs)}class na extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",Qo),this.addEventListener("focus",ta),this.addEventListener("blur",ea)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const es=typeof globalThis<"u"?globalThis:window;try{es.ClipboardCopyElement=na.define()}catch(n){if(!(es.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}const sa=2e3;class ia extends F()({targets:{initial:HTMLElement,confirmed:null},values:{hiddenClass:String,showClass:String}}){connect(){this.clipboardCopyElementTimers=new WeakMap}copy(t){var o;const e=t.target,s=this.clipboardCopyElementTimers.get(e),i=(o=e.parentNode)==null?void 0:o.querySelector("[data-clipboard-copy-feedback]"),r="Copied!";s?(clearTimeout(s),this.clipboardCopyElementTimers.delete(e)):(this.showConfirm(),i&&(i.textContent===r?i.textContent=`${r} `:i.textContent=r)),this.clipboardCopyElementTimers.set(e,window.setTimeout(()=>{this.showInitial(),this.hideConfirm(),this.clipboardCopyElementTimers.delete(e)},sa))}showConfirm(){this.hasConfirmedTarget&&(this.confirmedTarget.classList.remove(this.hiddenClassValue),this.confirmedTarget.classList.add(this.showClassValue),this.initialTarget.classList.add(this.hiddenClassValue))}showInitial(){this.initialTarget.classList.remove(this.hiddenClassValue),this.initialTarget.classList.add(this.showClassValue),this.hasConfirmedTarget&&this.confirmedTarget.classList.add(this.hiddenClassValue)}hideConfirm(){this.hasConfirmedTarget&&this.confirmedTarget.classList.remove(this.showClassValue)}}const ra=Object.freeze(Object.defineProperty({__proto__:null,default:ia},Symbol.toStringTag,{value:"Module"})),tt=Math.min,B=Math.max,ie=Math.round,Xt=Math.floor,W=n=>({x:n,y:n}),oa={left:"right",right:"left",bottom:"top",top:"bottom"},aa={start:"end",end:"start"};function je(n,t,e){return B(n,tt(t,e))}function xt(n,t){return typeof n=="function"?n(t):n}function et(n){return n.split("-")[0]}function Ot(n){return n.split("-")[1]}function qs(n){return n==="x"?"y":"x"}function Qe(n){return n==="y"?"height":"width"}function ut(n){return["top","bottom"].includes(et(n))?"y":"x"}function tn(n){return qs(ut(n))}function la(n,t,e){e===void 0&&(e=!1);const s=Ot(n),i=tn(n),r=Qe(i);let o=i==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=re(o)),[o,re(o)]}function ca(n){const t=re(n);return[He(n),t,He(t)]}function He(n){return n.replace(/start|end/g,t=>aa[t])}function ua(n,t,e){const s=["left","right"],i=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return e?t?i:s:t?s:i;case"left":case"right":return t?r:o;default:return[]}}function ha(n,t,e,s){const i=Ot(n);let r=ua(et(n),e==="start",s);return i&&(r=r.map(o=>o+"-"+i),t&&(r=r.concat(r.map(He)))),r}function re(n){return n.replace(/left|right|bottom|top/g,t=>oa[t])}function da(n){return{top:0,right:0,bottom:0,left:0,...n}}function Ys(n){return typeof n!="number"?da(n):{top:n,right:n,bottom:n,left:n}}function oe(n){const{x:t,y:e,width:s,height:i}=n;return{width:s,height:i,top:e,left:t,right:t+s,bottom:e+i,x:t,y:e}}function ns(n,t,e){let{reference:s,floating:i}=n;const r=ut(t),o=tn(t),a=Qe(o),l=et(t),c=r==="y",u=s.x+s.width/2-i.width/2,d=s.y+s.height/2-i.height/2,h=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:s.y-i.height};break;case"bottom":m={x:u,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:d};break;case"left":m={x:s.x-i.width,y:d};break;default:m={x:s.x,y:s.y}}switch(Ot(t)){case"start":m[o]-=h*(e&&c?-1:1);break;case"end":m[o]+=h*(e&&c?-1:1);break}return m}const fa=async(n,t,e)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:n,floating:t,strategy:i}),{x:u,y:d}=ns(c,s,l),h=s,m={},f=0;for(let p=0;p<a.length;p++){const{name:b,fn:g}=a[p],{x:w,y:E,data:v,reset:y}=await g({x:u,y:d,initialPlacement:s,placement:h,strategy:i,middlewareData:m,rects:c,platform:o,elements:{reference:n,floating:t}});u=w??u,d=E??d,m={...m,[b]:{...m[b],...v}},y&&f<=50&&(f++,typeof y=="object"&&(y.placement&&(h=y.placement),y.rects&&(c=y.rects===!0?await o.getElementRects({reference:n,floating:t,strategy:i}):y.rects),{x:u,y:d}=ns(c,h,l)),p=-1)}return{x:u,y:d,placement:h,strategy:i,middlewareData:m}};async function en(n,t){var e;t===void 0&&(t={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:h=!1,padding:m=0}=xt(t,n),f=Ys(m),b=a[h?d==="floating"?"reference":"floating":d],g=oe(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(b)))==null||e?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),w=d==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),v=await(r.isElement==null?void 0:r.isElement(E))?await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1}:{x:1,y:1},y=oe(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:E,strategy:l}):w);return{top:(g.top-y.top+f.top)/v.y,bottom:(y.bottom-g.bottom+f.bottom)/v.y,left:(g.left-y.left+f.left)/v.x,right:(y.right-g.right+f.right)/v.x}}const ma=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:i,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=xt(n,t)||{};if(c==null)return{};const d=Ys(u),h={x:e,y:s},m=tn(i),f=Qe(m),p=await o.getDimensions(c),b=m==="y",g=b?"top":"left",w=b?"bottom":"right",E=b?"clientHeight":"clientWidth",v=r.reference[f]+r.reference[m]-h[m]-r.floating[f],y=h[m]-r.reference[m],O=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let x=O?O[E]:0;(!x||!await(o.isElement==null?void 0:o.isElement(O)))&&(x=a.floating[E]||r.floating[f]);const _=v/2-y/2,T=x/2-p[f]/2-1,D=tt(d[g],T),A=tt(d[w],T),C=D,k=x-p[f]-A,M=x/2-p[f]/2+_,dt=je(C,M,k),q=!l.arrow&&Ot(i)!=null&&M!==dt&&r.reference[f]/2-(M<C?D:A)-p[f]/2<0,U=q?M<C?M-C:M-k:0;return{[m]:h[m]+U,data:{[m]:dt,centerOffset:M-dt-U,...q&&{alignmentOffset:U}},reset:q}}}),pa=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:h,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:p=!0,...b}=xt(n,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const g=et(i),w=ut(a),E=et(a)===a,v=await(l.isRTL==null?void 0:l.isRTL(c.floating)),y=h||(E||!p?[re(a)]:ca(a)),O=f!=="none";!h&&O&&y.push(...ha(a,p,f,v));const x=[a,...y],_=await en(t,b),T=[];let D=((s=r.flip)==null?void 0:s.overflows)||[];if(u&&T.push(_[g]),d){const M=la(i,o,v);T.push(_[M[0]],_[M[1]])}if(D=[...D,{placement:i,overflows:T}],!T.every(M=>M<=0)){var A,C;const M=(((A=r.flip)==null?void 0:A.index)||0)+1,dt=x[M];if(dt)return{data:{index:M,overflows:D},reset:{placement:dt}};let q=(C=D.filter(U=>U.overflows[0]<=0).sort((U,G)=>U.overflows[1]-G.overflows[1])[0])==null?void 0:C.placement;if(!q)switch(m){case"bestFit":{var k;const U=(k=D.filter(G=>{if(O){const Z=ut(G.placement);return Z===w||Z==="y"}return!0}).map(G=>[G.placement,G.overflows.filter(Z=>Z>0).reduce((Z,fi)=>Z+fi,0)]).sort((G,Z)=>G[1]-Z[1])[0])==null?void 0:k[0];U&&(q=U);break}case"initialPlacement":q=a;break}if(i!==q)return{reset:{placement:q}}}return{}}}};async function ga(n,t){const{placement:e,platform:s,elements:i}=n,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=et(e),a=Ot(e),l=ut(e)==="y",c=["left","top"].includes(o)?-1:1,u=r&&l?-1:1,d=xt(t,n);let{mainAxis:h,crossAxis:m,alignmentAxis:f}=typeof d=="number"?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:h*c}:{x:h*c,y:m*u}}const ba=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,s;const{x:i,y:r,placement:o,middlewareData:a}=t,l=await ga(t,n);return o===((e=a.offset)==null?void 0:e.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},va=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:i}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:g,y:w}=b;return{x:g,y:w}}},...l}=xt(n,t),c={x:e,y:s},u=await en(t,l),d=ut(et(i)),h=qs(d);let m=c[h],f=c[d];if(r){const b=h==="y"?"top":"left",g=h==="y"?"bottom":"right",w=m+u[b],E=m-u[g];m=je(w,m,E)}if(o){const b=d==="y"?"top":"left",g=d==="y"?"bottom":"right",w=f+u[b],E=f-u[g];f=je(w,f,E)}const p=a.fn({...t,[h]:m,[d]:f});return{...p,data:{x:p.x-e,y:p.y-s,enabled:{[h]:r,[d]:o}}}}}},ya=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,s;const{placement:i,rects:r,platform:o,elements:a}=t,{apply:l=()=>{},...c}=xt(n,t),u=await en(t,c),d=et(i),h=Ot(i),m=ut(i)==="y",{width:f,height:p}=r.floating;let b,g;d==="top"||d==="bottom"?(b=d,g=h===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(g=d,b=h==="end"?"top":"bottom");const w=p-u.top-u.bottom,E=f-u.left-u.right,v=tt(p-u[b],w),y=tt(f-u[g],E),O=!t.middlewareData.shift;let x=v,_=y;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(_=E),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(x=w),O&&!h){const D=B(u.left,0),A=B(u.right,0),C=B(u.top,0),k=B(u.bottom,0);m?_=f-2*(D!==0||A!==0?D+A:B(u.left,u.right)):x=p-2*(C!==0||k!==0?C+k:B(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:x});const T=await o.getDimensions(a.floating);return f!==T.width||p!==T.height?{reset:{rects:!0}}:{}}}};function de(){return typeof window<"u"}function St(n){return Xs(n)?(n.nodeName||"").toLowerCase():"#document"}function R(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function z(n){var t;return(t=(Xs(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function Xs(n){return de()?n instanceof Node||n instanceof R(n).Node:!1}function j(n){return de()?n instanceof Element||n instanceof R(n).Element:!1}function K(n){return de()?n instanceof HTMLElement||n instanceof R(n).HTMLElement:!1}function ss(n){return!de()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof R(n).ShadowRoot}function zt(n){const{overflow:t,overflowX:e,overflowY:s,display:i}=H(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(i)}function wa(n){return["table","td","th"].includes(St(n))}function fe(n){return[":popover-open",":modal"].some(t=>{try{return n.matches(t)}catch{return!1}})}function nn(n){const t=sn(),e=j(n)?H(n):n;return["transform","translate","scale","rotate","perspective"].some(s=>e[s]?e[s]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function Ea(n){let t=nt(n);for(;K(t)&&!At(t);){if(nn(t))return t;if(fe(t))return null;t=nt(t)}return null}function sn(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function At(n){return["html","body","#document"].includes(St(n))}function H(n){return R(n).getComputedStyle(n)}function me(n){return j(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function nt(n){if(St(n)==="html")return n;const t=n.assignedSlot||n.parentNode||ss(n)&&n.host||z(n);return ss(t)?t.host:t}function Gs(n){const t=nt(n);return At(t)?n.ownerDocument?n.ownerDocument.body:n.body:K(t)&&zt(t)?t:Gs(t)}function Ut(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=Gs(n),r=i===((s=n.ownerDocument)==null?void 0:s.body),o=R(i);if(r){const a=Ue(o);return t.concat(o,o.visualViewport||[],zt(i)?i:[],a&&e?Ut(a):[])}return t.concat(i,Ut(i,[],e))}function Ue(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Zs(n){const t=H(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=K(n),r=i?n.offsetWidth:e,o=i?n.offsetHeight:s,a=ie(e)!==r||ie(s)!==o;return a&&(e=r,s=o),{width:e,height:s,$:a}}function rn(n){return j(n)?n:n.contextElement}function wt(n){const t=rn(n);if(!K(t))return W(1);const e=t.getBoundingClientRect(),{width:s,height:i,$:r}=Zs(t);let o=(r?ie(e.width):e.width)/s,a=(r?ie(e.height):e.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const Ta=W(0);function Js(n){const t=R(n);return!sn()||!t.visualViewport?Ta:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Aa(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==R(n)?!1:t}function ht(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=n.getBoundingClientRect(),r=rn(n);let o=W(1);t&&(s?j(s)&&(o=wt(s)):o=wt(n));const a=Aa(r,e,s)?Js(r):W(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(r){const h=R(r),m=s&&j(s)?R(s):s;let f=h,p=Ue(f);for(;p&&s&&m!==f;){const b=wt(p),g=p.getBoundingClientRect(),w=H(p),E=g.left+(p.clientLeft+parseFloat(w.paddingLeft))*b.x,v=g.top+(p.clientTop+parseFloat(w.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,d*=b.y,l+=E,c+=v,f=R(p),p=Ue(f)}}return oe({width:u,height:d,x:l,y:c})}function on(n,t){const e=me(n).scrollLeft;return t?t.left+e:ht(z(n)).left+e}function Qs(n,t,e){e===void 0&&(e=!1);const s=n.getBoundingClientRect(),i=s.left+t.scrollLeft-(e?0:on(n,s)),r=s.top+t.scrollTop;return{x:i,y:r}}function xa(n){let{elements:t,rect:e,offsetParent:s,strategy:i}=n;const r=i==="fixed",o=z(s),a=t?fe(t.floating):!1;if(s===o||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=W(1);const u=W(0),d=K(s);if((d||!d&&!r)&&((St(s)!=="body"||zt(o))&&(l=me(s)),K(s))){const m=ht(s);c=wt(s),u.x=m.x+s.clientLeft,u.y=m.y+s.clientTop}const h=o&&!d&&!r?Qs(o,l,!0):W(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+u.x+h.x,y:e.y*c.y-l.scrollTop*c.y+u.y+h.y}}function Oa(n){return Array.from(n.getClientRects())}function Sa(n){const t=z(n),e=me(n),s=n.ownerDocument.body,i=B(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=B(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-e.scrollLeft+on(n);const a=-e.scrollTop;return H(s).direction==="rtl"&&(o+=B(t.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:a}}function Ma(n,t){const e=R(n),s=z(n),i=e.visualViewport;let r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;const c=sn();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a,y:l}}function Ca(n,t){const e=ht(n,!0,t==="fixed"),s=e.top+n.clientTop,i=e.left+n.clientLeft,r=K(n)?wt(n):W(1),o=n.clientWidth*r.x,a=n.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function is(n,t,e){let s;if(t==="viewport")s=Ma(n,e);else if(t==="document")s=Sa(z(n));else if(j(t))s=Ca(t,e);else{const i=Js(n);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return oe(s)}function ti(n,t){const e=nt(n);return e===t||!j(e)||At(e)?!1:H(e).position==="fixed"||ti(e,t)}function ka(n,t){const e=t.get(n);if(e)return e;let s=Ut(n,[],!1).filter(a=>j(a)&&St(a)!=="body"),i=null;const r=H(n).position==="fixed";let o=r?nt(n):n;for(;j(o)&&!At(o);){const a=H(o),l=nn(o);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||zt(o)&&!l&&ti(n,o))?s=s.filter(u=>u!==o):i=a,o=nt(o)}return t.set(n,s),s}function La(n){let{element:t,boundary:e,rootBoundary:s,strategy:i}=n;const o=[...e==="clippingAncestors"?fe(t)?[]:ka(t,this._c):[].concat(e),s],a=o[0],l=o.reduce((c,u)=>{const d=is(t,u,i);return c.top=B(d.top,c.top),c.right=tt(d.right,c.right),c.bottom=tt(d.bottom,c.bottom),c.left=B(d.left,c.left),c},is(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function _a(n){const{width:t,height:e}=Zs(n);return{width:t,height:e}}function Da(n,t,e){const s=K(t),i=z(t),r=e==="fixed",o=ht(n,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=W(0);if(s||!s&&!r)if((St(t)!=="body"||zt(i))&&(a=me(t)),s){const h=ht(t,!0,r,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else i&&(l.x=on(i));const c=i&&!s&&!r?Qs(i,a):W(0),u=o.left+a.scrollLeft-l.x-c.x,d=o.top+a.scrollTop-l.y-c.y;return{x:u,y:d,width:o.width,height:o.height}}function Oe(n){return H(n).position==="static"}function rs(n,t){if(!K(n)||H(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return z(n)===e&&(e=e.ownerDocument.body),e}function ei(n,t){const e=R(n);if(fe(n))return e;if(!K(n)){let i=nt(n);for(;i&&!At(i);){if(j(i)&&!Oe(i))return i;i=nt(i)}return e}let s=rs(n,t);for(;s&&wa(s)&&Oe(s);)s=rs(s,t);return s&&At(s)&&Oe(s)&&!nn(s)?e:s||Ea(n)||e}const Fa=async function(n){const t=this.getOffsetParent||ei,e=this.getDimensions,s=await e(n.floating);return{reference:Da(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function Ba(n){return H(n).direction==="rtl"}const Pa={convertOffsetParentRelativeRectToViewportRelativeRect:xa,getDocumentElement:z,getClippingRect:La,getOffsetParent:ei,getElementRects:Fa,getClientRects:Oa,getDimensions:_a,getScale:wt,isElement:j,isRTL:Ba};function ni(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Ra(n,t){let e=null,s;const i=z(n);function r(){var a;clearTimeout(s),(a=e)==null||a.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=n.getBoundingClientRect(),{left:u,top:d,width:h,height:m}=c;if(a||t(),!h||!m)return;const f=Xt(d),p=Xt(i.clientWidth-(u+h)),b=Xt(i.clientHeight-(d+m)),g=Xt(u),E={rootMargin:-f+"px "+-p+"px "+-b+"px "+-g+"px",threshold:B(0,tt(1,l))||1};let v=!0;function y(O){const x=O[0].intersectionRatio;if(x!==l){if(!v)return o();x?o(!1,x):s=setTimeout(()=>{o(!1,1e-7)},1e3)}x===1&&!ni(c,n.getBoundingClientRect())&&o(),v=!1}try{e=new IntersectionObserver(y,{...E,root:i.ownerDocument})}catch{e=new IntersectionObserver(y,E)}e.observe(n)}return o(!0),r}function si(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=rn(n),u=i||r?[...c?Ut(c):[],...Ut(t)]:[];u.forEach(g=>{i&&g.addEventListener("scroll",e,{passive:!0}),r&&g.addEventListener("resize",e)});const d=c&&a?Ra(c,e):null;let h=-1,m=null;o&&(m=new ResizeObserver(g=>{let[w]=g;w&&w.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),e()}),c&&!l&&m.observe(c),m.observe(t));let f,p=l?ht(n):null;l&&b();function b(){const g=ht(n);p&&!ni(p,g)&&e(),p=g,f=requestAnimationFrame(b)}return e(),()=>{var g;u.forEach(w=>{i&&w.removeEventListener("scroll",e),r&&w.removeEventListener("resize",e)}),d==null||d(),(g=m)==null||g.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const an=ba,ln=va,cn=pa,$a=ya,Na=ma,un=(n,t,e)=>{const s=new Map,i={platform:Pa,...e},r={...i.platform,_c:s};return fa(n,t,{...i,platform:r})},os=(n,t)=>{const e=n[t];return typeof e=="function"?e:(...s)=>{}},We=(n,t,e)=>{let s=n;return e===!0?s=`${t.identifier}:${n}`:typeof e=="string"&&(s=`${e}:${n}`),s},Ke=(n,t,e)=>{const{bubbles:s,cancelable:i,composed:r}=t||{bubbles:!0,cancelable:!0,composed:!0};return t&&Object.assign(e,{originalEvent:t}),new CustomEvent(n,{bubbles:s,cancelable:i,composed:r,detail:e})};function Ia(n){const t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth,i=t.top<=e&&t.top+t.height>0,r=t.left<=s&&t.left+t.width>0;return i&&r}function Va(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e}const Se={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};class ja{constructor(t,e={}){var s,i,r;this.log=(l,c)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${l}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},c)),this.logger.groupEnd())},this.warn=l=>{this.logger.warn(`%c${this.controller.identifier} %c${l}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(l,c={})=>{if(this.dispatchEvent){const{event:u}=c,d=Va(c,["event"]),h=this.extendedEvent(l,u||null,d);this.targetElement.dispatchEvent(h),this.log("dispatchEvent",Object.assign({eventName:h.type},d))}},this.call=(l,c={})=>{const u=this.controller[l];if(typeof u=="function")return u.call(this.controller,c)},this.extendedEvent=(l,c,u)=>{const{bubbles:d,cancelable:h,composed:m}=c||{bubbles:!0,cancelable:!0,composed:!0};return c&&Object.assign(u,{originalEvent:c}),new CustomEvent(this.composeEventName(l),{bubbles:d,cancelable:h,composed:m,detail:u})},this.composeEventName=l=>{let c=l;return this.eventPrefix===!0?c=`${this.controller.identifier}:${l}`:typeof this.eventPrefix=="string"&&(c=`${this.eventPrefix}:${l}`),c},this.debug=(i=(s=e==null?void 0:e.debug)!==null&&s!==void 0?s:t.application.stimulusUseDebug)!==null&&i!==void 0?i:Se.debug,this.logger=(r=e==null?void 0:e.logger)!==null&&r!==void 0?r:Se.logger,this.controller=t,this.controllerId=t.element.id||t.element.dataset.id,this.targetElement=(e==null?void 0:e.element)||t.element;const{dispatchEvent:o,eventPrefix:a}=Object.assign({},Se,e);Object.assign(this,{dispatchEvent:o,eventPrefix:a}),this.controllerInitialize=t.initialize.bind(t),this.controllerConnect=t.connect.bind(t),this.controllerDisconnect=t.disconnect.bind(t)}}const Ha={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Ua=(n,t={})=>{const e=n,{onlyVisible:s,dispatchEvent:i,events:r,eventPrefix:o}=Object.assign({},Ha,t),a=d=>{const h=(t==null?void 0:t.element)||e.element;if(!(h.contains(d.target)||!Ia(h)&&s)&&(e.clickOutside&&e.clickOutside(d),i)){const m=We("click:outside",e,o),f=Ke(m,d,{controller:e});h.dispatchEvent(f)}},l=()=>{r==null||r.forEach(d=>{window.addEventListener(d,a,!0)})},c=()=>{r==null||r.forEach(d=>{window.removeEventListener(d,a,!0)})},u=e.disconnect.bind(e);return Object.assign(e,{disconnect(){c(),u()}}),l(),[l,c]};class Wa extends st{}Wa.debounces=[];const Ka=200,as=(n,t=Ka)=>{let e=null;return function(){const s=Array.from(arguments),i=this,r=s.map(a=>a.params),o=()=>(s.forEach((a,l)=>a.params=r[l]),n.apply(i,s));e&&clearTimeout(e),e=setTimeout(o,t)}},za=(n,t)=>{const e=n;e.constructor.debounces.forEach(i=>{if(typeof i=="string"&&(e[i]=as(e[i],void 0)),typeof i=="object"){const{name:r,wait:o}=i;if(!r)return;e[r]=as(e[r],o||void 0)}})},qa={dispatchEvent:!0,eventPrefix:!0,visibleAttribute:"isVisible"},Ya=(n,t={})=>{const e=n,{dispatchEvent:s,eventPrefix:i,visibleAttribute:r}=Object.assign({},qa,t),o=(t==null?void 0:t.element)||e.element;e.intersectionElements||(e.intersectionElements=[]),e.intersectionElements.push(o);const a=v=>{const[y]=v;y.isIntersecting?c(y):o.hasAttribute(r)&&u(y)},l=new IntersectionObserver(a,t),c=v=>{if(o.setAttribute(r,"true"),os(e,"appear").call(e,v,l),s){const y=We("appear",e,i),O=Ke(y,null,{controller:e,entry:v,observer:l});o.dispatchEvent(O)}},u=v=>{if(o.removeAttribute(r),os(e,"disappear").call(e,v,l),s){const y=We("disappear",e,i),O=Ke(y,null,{controller:e,entry:v,observer:l});o.dispatchEvent(O)}},d=e.disconnect.bind(e),h=()=>{f(),d()},m=()=>{l.observe(o)},f=()=>{l.unobserve(o)},p=()=>e.intersectionElements.filter(v=>v.hasAttribute(r)).length===0,b=()=>e.intersectionElements.filter(v=>v.hasAttribute(r)).length===1,g=()=>e.intersectionElements.some(v=>v.hasAttribute(r)),w=()=>e.intersectionElements.every(v=>v.hasAttribute(r));return Object.assign(e,{isVisible:w,noneVisible:p,oneVisible:b,atLeastOneVisible:g,allVisible:w,disconnect:h}),m(),[m,f]};class Xa extends ja{constructor(t,e={}){super(t,e),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(s){this.controller.application.handleError(s,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=s=>{this.call("mutate",s),this.log("mutate",{entries:s}),this.dispatch("mutate",{entries:s})},this.targetElement=(e==null?void 0:e.element)||t.element,this.controller=t,this.options=e,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const t=this.controller.disconnect.bind(this.controller),e=()=>{this.unobserve(),t()};Object.assign(this.controller,{disconnect:e})}}const ii=(n,t={})=>{const e=new Xa(n,t);return[e.observe,e.unobserve]};class Ga extends st{}Ga.throttles=[];class Za extends F()({targets:{wrapper:HTMLDetailsElement,button:HTMLElement,popover:ke,options:HTMLDivElement},values:{clamped:Boolean,placement:String,dynamicLabelPrefix:String}}){constructor(){super(...arguments),this.changedIds=new Set}clickOutside(){this.element.open=!1,this.setupAutoUpdate(),this.close()}close(){this.changedIds.size>0&&(this.dispatch("changed"),this.changedIds.clear(),this.buttonTarget.setAttribute("aria-expanded","false"))}connect(){Ua(this),ii(this,{childList:!0,subtree:!0}),this.setupAutoUpdate(),this.setupForm()}disconnect(){var t;(t=this.unsubAutoUpdate)==null||t.call(this)}setupForm(){for(const t of["checkbox","radio"])for(const e of this.popoverTarget.querySelectorAll(`input[type="${t}"]`))e.addEventListener("change",s=>{const i=s.target;this.changedIds.has(i)?this.changedIds.delete(i):this.changedIds.add(i),this.dispatch("clicked",{detail:i})})}setupAutoUpdate(){var e;if(!this.element.open){(e=this.unsubAutoUpdate)==null||e.call(this);return}const t=()=>{const s=this.optionsTarget,i=this.clampedValue;un(this.buttonTarget,this.popoverTarget,{middleware:[an(6),cn(),ln({padding:6}),$a({apply({availableHeight:r}){let o=r-6;i&&o>400&&(o=400),Object.assign(s.style,{maxHeight:`${o}px`})}})],placement:this.placementValue,strategy:"fixed"}).then(({x:r,y:o})=>{Object.assign(this.popoverTarget.style,{left:`${r}px`,top:`${o}px`})})};t(),this.unsubAutoUpdate=si(this.buttonTarget,this.popoverTarget,t)}updateButtonLabel(t){var r;const s=t.target.querySelector("input[type=radio]:checked");if(!s)return;const i=((r=s.labels)==null?void 0:r.item(0)).textContent;this.buttonTarget.querySelector('[data-ariadne-ui-button-target="content"]').textContent=`${this.dynamicLabelPrefixValue}${i}`}toggle(){this.element.open=!this.element.open,this.setupAutoUpdate(),this.buttonTarget.setAttribute("aria-expanded","true")}}const Ja=Object.freeze(Object.defineProperty({__proto__:null,default:Za},Symbol.toStringTag,{value:"Module"}));function Qa(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}else return Array.from(n)}var hn=!1;if(typeof window<"u"){var ls={get passive(){hn=!0}};window.addEventListener("testPassive",null,ls),window.removeEventListener("testPassive",null,ls)}var ae=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),ct=[],le=!1,ri=-1,Nt=void 0,at=void 0,It=void 0,oi=function(t){return ct.some(function(e){return!!(e.options.allowTouchMove&&e.options.allowTouchMove(t))})},ce=function(t){var e=t||window.event;return oi(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},tl=function(t){if(It===void 0){var e=!!t&&t.reserveScrollBarGap===!0,s=window.innerWidth-document.documentElement.clientWidth;if(e&&s>0){var i=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);It=document.body.style.paddingRight,document.body.style.paddingRight=i+s+"px"}}Nt===void 0&&(Nt=document.body.style.overflow,document.body.style.overflow="hidden")},el=function(){It!==void 0&&(document.body.style.paddingRight=It,It=void 0),Nt!==void 0&&(document.body.style.overflow=Nt,Nt=void 0)},nl=function(){return window.requestAnimationFrame(function(){if(at===void 0){at={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var t=window,e=t.scrollY,s=t.scrollX,i=t.innerHeight;document.body.style.position="fixed",document.body.style.top=-e,document.body.style.left=-s,setTimeout(function(){return window.requestAnimationFrame(function(){var r=i-window.innerHeight;r&&e>=i&&(document.body.style.top=-(e+r))})},300)}})},sl=function(){if(at!==void 0){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=at.position,document.body.style.top=at.top,document.body.style.left=at.left,window.scrollTo(e,t),at=void 0}},il=function(t){return t?t.scrollHeight-t.scrollTop<=t.clientHeight:!1},rl=function(t,e){var s=t.targetTouches[0].clientY-ri;return oi(t.target)?!1:e&&e.scrollTop===0&&s>0||il(e)&&s<0?ce(t):(t.stopPropagation(),!0)},ol=function(t,e){if(!t){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!ct.some(function(i){return i.targetElement===t})){var s={targetElement:t,options:e||{}};ct=[].concat(Qa(ct),[s]),ae?nl():tl(e),ae&&(t.ontouchstart=function(i){i.targetTouches.length===1&&(ri=i.targetTouches[0].clientY)},t.ontouchmove=function(i){i.targetTouches.length===1&&rl(i,t)},le||(document.addEventListener("touchmove",ce,hn?{passive:!1}:void 0),le=!0))}},al=function(t){if(!t){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}ct=ct.filter(function(e){return e.targetElement!==t}),ae&&(t.ontouchstart=null,t.ontouchmove=null,le&&ct.length===0&&(document.removeEventListener("touchmove",ce,hn?{passive:!1}:void 0),le=!1)),ae?sl():el()};class ll extends F()({targets:{dialog:HTMLDialogElement}}){close(t){this.dialogTarget.open&&(this.dialogTarget.close(),al(this.dialogTarget))}disconnect(){this.close()}open(t){t.preventDefault(),this.dialogTarget.showModal(),ol(this.dialogTarget,{reserveScrollBarGap:!0})}windowClick(t){t.target===this.dialogTarget&&this.close()}}const cl=Object.freeze(Object.defineProperty({__proto__:null,default:ll},Symbol.toStringTag,{value:"Module"}));class ul extends F()({targets:{emptyRoot:null,input:HTMLInputElement,searchString:null}}){handleNewQuery(t){let e=!1;for(const{el:s,searchString:i}of this.items){const r=i.includes(t.trim().toLowerCase());!e&&r&&(e=!0),r?s.classList.remove("ariadne:hidden"):s.classList.add("ariadne:hidden")}this.hasEmptyRootTarget&&(e?this.emptyRootTarget.classList.add("ariadne:hidden"):this.emptyRootTarget.classList.remove("ariadne:hidden"))}connect(){this.items=this.searchStringTargets.map(t=>({el:t,searchString:(t.textContent??"").trim().toLowerCase()})),Ya(this)}appear(){this.reset()}handleInput(){this.hasSearchStringTarget&&this.handleNewQuery(this.inputTarget.value)}reset(){this.handleNewQuery(""),this.hasInputTarget&&(this.inputTarget.value="")}}const hl=Object.freeze(Object.defineProperty({__proto__:null,default:ul},Symbol.toStringTag,{value:"Module"}));class dl extends F()({targets:{button:HTMLButtonElement,popover:HTMLElement},values:{placement:String}}){connect(){this.popoverTarget.addEventListener("toggle",t=>{t.newState==="open"&&this.updatePosition()})}toggle(){dispatchEvent(new CustomEvent("toggle",{detail:{newState:this.popoverTarget.open?"closed":"open"}}))}updatePosition(){si(this.buttonTarget,this.popoverTarget,()=>{un(this.buttonTarget,this.popoverTarget,{placement:this.placementValue,middleware:[an(5),cn(),ln({padding:5})]}).then(({x:t,y:e})=>{Object.assign(this.popoverTarget.style,{left:`${t}px`,top:`${e}px`})})})}}const fl=Object.freeze(Object.defineProperty({__proto__:null,default:dl},Symbol.toStringTag,{value:"Module"}));var ml=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},cs=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Bt;class pl{formatToParts(t){const e=[];for(const s of t)e.push({type:"element",value:s}),e.push({type:"literal",value:", "});return e.slice(0,-1)}}const gl=typeof Intl<"u"&&Intl.ListFormat||pl,bl=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],vl={minimumIntegerDigits:2};class yl{constructor(t,e={}){Bt.set(this,void 0);let s=String(e.style||"short");s!=="long"&&s!=="short"&&s!=="narrow"&&s!=="digital"&&(s="short");let i=s==="digital"?"numeric":s;const r=e.hours||i;i=r==="2-digit"?"numeric":r;const o=e.minutes||i;i=o==="2-digit"?"numeric":o;const a=e.seconds||i;i=a==="2-digit"?"numeric":a;const l=e.milliseconds||i;ml(this,Bt,{locale:t,style:s,years:e.years||s==="digital"?"short":s,yearsDisplay:e.yearsDisplay==="always"?"always":"auto",months:e.months||s==="digital"?"short":s,monthsDisplay:e.monthsDisplay==="always"?"always":"auto",weeks:e.weeks||s==="digital"?"short":s,weeksDisplay:e.weeksDisplay==="always"?"always":"auto",days:e.days||s==="digital"?"short":s,daysDisplay:e.daysDisplay==="always"?"always":"auto",hours:r,hoursDisplay:e.hoursDisplay==="always"||s==="digital"?"always":"auto",minutes:o,minutesDisplay:e.minutesDisplay==="always"||s==="digital"?"always":"auto",seconds:a,secondsDisplay:e.secondsDisplay==="always"||s==="digital"?"always":"auto",milliseconds:l,millisecondsDisplay:e.millisecondsDisplay==="always"?"always":"auto"},"f")}resolvedOptions(){return cs(this,Bt,"f")}formatToParts(t){const e=[],s=cs(this,Bt,"f"),i=s.style,r=s.locale;for(const[o,a]of bl){const l=t[o];if(s[`${o}Display`]==="auto"&&!l)continue;const c=s[o],u=c==="2-digit"?vl:c==="numeric"?{}:{style:"unit",unit:a,unitDisplay:c};e.push(new Intl.NumberFormat(r,u).format(l))}return new gl(r,{type:"unit",style:i==="digital"?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map(e=>e.value).join("")}}Bt=new WeakMap;const ai=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,ue=["year","month","week","day","hour","minute","second","millisecond"],wl=n=>ai.test(n);class P{constructor(t=0,e=0,s=0,i=0,r=0,o=0,a=0,l=0){this.years=t,this.months=e,this.weeks=s,this.days=i,this.hours=r,this.minutes=o,this.seconds=a,this.milliseconds=l,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=this.sign===0}abs(){return new P(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}static from(t){var e;if(typeof t=="string"){const s=String(t).trim(),i=s.startsWith("-")?-1:1,r=(e=s.match(ai))===null||e===void 0?void 0:e.slice(1).map(o=>(Number(o)||0)*i);return r?new P(...r):new P}else if(typeof t=="object"){const{years:s,months:i,weeks:r,days:o,hours:a,minutes:l,seconds:c,milliseconds:u}=t;return new P(s,i,r,o,a,l,c,u)}throw new RangeError("invalid duration")}static compare(t,e){const s=Date.now(),i=Math.abs(us(s,P.from(t)).getTime()-s),r=Math.abs(us(s,P.from(e)).getTime()-s);return i>r?-1:i<r?1:0}toLocaleString(t,e){return new yl(t,e).format(this)}}function us(n,t){const e=new Date(n);return t.sign<0?(e.setUTCSeconds(e.getUTCSeconds()+t.seconds),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCFullYear(e.getUTCFullYear()+t.years)):(e.setUTCFullYear(e.getUTCFullYear()+t.years),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCSeconds(e.getUTCSeconds()+t.seconds)),e}function El(n,t="second",e=Date.now()){const s=n.getTime()-e;if(s===0)return new P;const i=Math.sign(s),r=Math.abs(s),o=Math.floor(r/1e3),a=Math.floor(o/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),d=Math.floor(u/12),h=ue.indexOf(t)||ue.length;return new P(h>=0?d*i:0,h>=1?(u-d*12)*i:0,0,h>=3?(c-u*30)*i:0,h>=4?(l-c*24)*i:0,h>=5?(a-l*60)*i:0,h>=6?(o-a*60)*i:0,h>=7?(r-o*1e3)*i:0)}function li(n,{relativeTo:t=Date.now()}={}){if(t=new Date(t),n.blank)return n;const e=n.sign;let s=Math.abs(n.years),i=Math.abs(n.months),r=Math.abs(n.weeks),o=Math.abs(n.days),a=Math.abs(n.hours),l=Math.abs(n.minutes),c=Math.abs(n.seconds),u=Math.abs(n.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||o||r||i||s)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||o||r||i||s)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||o||r||i||s)&&(l=0),o&&a>=12&&(o+=Math.round(a/24)),!o&&a>=21&&(o+=Math.round(a/24)),(o||r||i||s)&&(a=0);const d=t.getFullYear(),h=t.getMonth(),m=t.getDate();if(o>=27||s+i+o){const f=new Date(t);f.setDate(1),f.setMonth(h+i*e+1),f.setDate(0);const p=Math.max(0,m-f.getDate()),b=new Date(t);b.setFullYear(d+s*e),b.setDate(m-p),b.setMonth(h+i*e),b.setDate(m-p+o*e);const g=b.getFullYear()-t.getFullYear(),w=b.getMonth()-t.getMonth(),E=Math.abs(Math.round((Number(b)-Number(t))/864e5))+p,v=Math.abs(g*12+w);E<27?(o>=6?(r+=Math.round(o/7),o=0):o=E,i=s=0):v<=11?(i=v,s=0):(i=0,s=g*e),(i||s)&&(o=0)}return s&&(i=0),r>=4&&(i+=Math.round(r/4)),(i||s)&&(r=0),o&&r&&!i&&!s&&(r+=Math.round(o/7),o=0),new P(s*e,i*e,r*e,o*e,a*e,l*e,c*e,u*e)}function Tl(n,t){const e=li(n,t);if(e.blank)return[0,"second"];for(const s of ue){if(s==="millisecond")continue;const i=e[`${s}s`];if(i)return[i,s]}return[0,"second"]}var S=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Gt=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},N,Pt,Rt,Ct,ot,ze,ci,ui,hi,di,mt;const Al=globalThis.HTMLElement||null,Me=new P,hs=new P(0,0,0,0,0,1);class xl extends Event{constructor(t,e,s,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=s,this.newTitle=i}}function ds(n){if(!n.date)return 1/0;if(n.format==="duration"||n.format==="elapsed"){const e=n.precision;if(e==="second")return 1e3;if(e==="minute")return 60*1e3}const t=Math.abs(Date.now()-n.date.getTime());return t<60*1e3?1e3:t<60*60*1e3?60*1e3:60*60*1e3}const Ce=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(n){if(this.elements.has(n))return;this.elements.add(n);const t=n.date;if(t&&t.getTime()){const e=ds(n),s=Date.now()+e;s<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=s)}}unobserve(n){this.elements.has(n)&&this.elements.delete(n)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let n=1/0;for(const t of this.elements)n=Math.min(n,ds(t)),t.update();this.time=Math.min(60*60*1e3,n),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class Ol extends Al{constructor(){super(...arguments),N.add(this),Pt.set(this,!1),Rt.set(this,!1),ot.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),mt.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title"]}get onRelativeTimeUpdated(){return S(this,mt,"f")}set onRelativeTimeUpdated(t){S(this,mt,"f")&&this.removeEventListener("relative-time-updated",S(this,mt,"f")),Gt(this,mt,typeof t=="object"||typeof t=="function"?t:null,"f"),typeof t=="function"&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if(t==="numeric"||t==="2-digit")return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if(t==="numeric"||t==="2-digit")return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if(t==="numeric"||t==="2-digit")return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if(t==="long"||t==="short"||t==="narrow")return t;if(this.format==="datetime"&&t!=="")return this.formatStyle}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=(t=this.getAttribute("day"))!==null&&t!==void 0?t:"numeric";if(e==="numeric"||e==="2-digit")return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(e!==""&&(e??(e=t==="datetime"?this.formatStyle:"short"),e==="numeric"||e==="2-digit"||e==="short"||e==="long"||e==="narrow"))return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");if(e==="numeric"||e==="2-digit")return e;if(!this.hasAttribute("year")&&new Date().getUTCFullYear()!==((t=this.date)===null||t===void 0?void 0:t.getUTCFullYear()))return"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if(t==="long"||t==="short"||t==="shortOffset"||t==="longOffset"||t==="shortGeneric"||t==="longGeneric")return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return(t=this.getAttribute("prefix"))!==null&&t!==void 0?t:this.format==="datetime"?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&wl(t)?t:"P30D"}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return t==="past"?"past":t==="future"?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return ue.includes(t)?t:this.format==="micro"?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return t==="datetime"?"datetime":t==="relative"?"relative":t==="duration"?"duration":t==="micro"?"micro":t==="elapsed"?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if(t==="long")return"long";if(t==="short")return"short";if(t==="narrow")return"narrow";const e=this.format;return e==="elapsed"||e==="micro"?"narrow":e==="datetime"?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(t==null?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){Ce.unobserve(this)}attributeChangedCallback(t,e,s){e!==s&&(t==="title"&&Gt(this,Pt,s!==null&&(this.date&&S(this,N,"m",ze).call(this,this.date))!==s,"f"),!S(this,Rt,"f")&&!(t==="title"&&S(this,Pt,"f"))&&Gt(this,Rt,(async()=>{await Promise.resolve(),this.update(),Gt(this,Rt,!1,"f")})(),"f"))}update(){const t=S(this,ot,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let s=e;const i=this.date;if(typeof Intl>"u"||!Intl.DateTimeFormat||!i){S(this,ot,"f").textContent=t;return}const r=Date.now();S(this,Pt,"f")||(s=S(this,N,"m",ze).call(this,i)||"",s&&!this.noTitle&&this.setAttribute("title",s));const o=El(i,this.precision,r),a=S(this,N,"m",ci).call(this,o);let l=t;a==="duration"?l=S(this,N,"m",ui).call(this,o):a==="relative"?l=S(this,N,"m",hi).call(this,o):l=S(this,N,"m",di).call(this,i),l?S(this,ot,"f").textContent=l:this.shadowRoot===S(this,ot,"f")&&this.textContent&&(S(this,ot,"f").textContent=this.textContent),(l!==t||s!==e)&&this.dispatchEvent(new xl(t,l,e,s)),a==="relative"||a==="duration"?Ce.observe(this):Ce.unobserve(this)}}Pt=new WeakMap,Rt=new WeakMap,ot=new WeakMap,mt=new WeakMap,N=new WeakSet,Ct=function(){var t;const e=((t=this.closest("[lang]"))===null||t===void 0?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(e??"").toString()}catch{return"default"}},ze=function(t){return new Intl.DateTimeFormat(S(this,N,"a",Ct),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},ci=function(t){const e=this.format;if(e==="datetime")return"datetime";if(e==="duration"||e==="elapsed"||e==="micro")return"duration";if((e==="auto"||e==="relative")&&typeof Intl<"u"&&Intl.RelativeTimeFormat){const s=this.tense;if(s==="past"||s==="future"||P.compare(t,this.threshold)===1)return"relative"}return"datetime"},ui=function(t){const e=S(this,N,"a",Ct),s=this.format,i=this.formatStyle,r=this.tense;let o=Me;s==="micro"?(t=li(t),o=hs,(this.tense==="past"&&t.sign!==-1||this.tense==="future"&&t.sign!==1)&&(t=hs)):(r==="past"&&t.sign!==-1||r==="future"&&t.sign!==1)&&(t=o);const a=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:i,[a]:"always"}):t.abs().toLocaleString(e,{style:i})},hi=function(t){const e=new Intl.RelativeTimeFormat(S(this,N,"a",Ct),{numeric:"auto",style:this.formatStyle}),s=this.tense;s==="future"&&t.sign!==1&&(t=Me),s==="past"&&t.sign!==-1&&(t=Me);const[i,r]=Tl(t);return r==="second"&&i<10?e.format(0,this.precision==="millisecond"?"second":this.precision):e.format(i,r)},di=function(t){const e=new Intl.DateTimeFormat(S(this,N,"a",Ct),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()};const fs=typeof globalThis<"u"?globalThis:window;try{fs.RelativeTimeElement=Ol.define()}catch(n){if(!(fs.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class Sl extends F()({targets:{}}){}const Ml=Object.freeze(Object.defineProperty({__proto__:null,default:Sl},Symbol.toStringTag,{value:"Module"}));function Cl(){return/Mac|iMac|Macintosh|MacIntel/.test(navigator.userAgent)}class kl extends F()({targets:{alt:HTMLSpanElement,ctrl:HTMLSpanElement,shift:HTMLSpanElement}}){replaceSymbol(t,e){for(const s of t)s.innerText=e,s.classList.add("!font-fallback")}connect(){this.replaceSymbol(this.shiftTargets,"⇧"),Cl()&&(this.replaceSymbol(this.ctrlTargets,"⌘"),this.replaceSymbol(this.altTargets,"⌥"))}}const Ll=Object.freeze(Object.defineProperty({__proto__:null,default:kl},Symbol.toStringTag,{value:"Module"})),he=class he extends st{connect(){za(this)}save(){this.hasFormTarget?this.formTarget.requestSubmit():this.element.requestSubmit()}};he.debounces=["save"],he.targets=["form"];let qe=he;const _l=Object.freeze(Object.defineProperty({__proto__:null,default:qe},Symbol.toStringTag,{value:"Module"}));class Dl extends F()({targets:{button:HTMLButtonElement,form:HTMLFormElement}}){get form(){return this.hasFormTarget?this.formTarget:this.element}runCheck(){this.buttonTarget.disabled=!this.form.checkValidity()}connect(){this.form.addEventListener("input",()=>this.runCheck()),this.runCheck(),ii(this,{childList:!0,subtree:!0})}mutate(){this.runCheck()}}const Fl=Object.freeze(Object.defineProperty({__proto__:null,default:Dl},Symbol.toStringTag,{value:"Module"}));class Bl extends F()({targets:{perPage:HTMLSelectElement}}){connect(){}perPageChange(t){t.preventDefault();const s=t.target.value,i=new URL(window.location.href);new URLSearchParams(s.split("?")[1]).forEach((o,a)=>{i.searchParams.set(a,o)}),window.location.href=i.toString()}navigate(t){const e=t.target.closest("a");e&&(t.preventDefault(),window.location.href=e.href)}}const Pl=Object.freeze(Object.defineProperty({__proto__:null,default:Bl},Symbol.toStringTag,{value:"Module"})),Rl=8,$l=8;class Nl extends F()({targets:{activator:HTMLElement,wrapper:HTMLDivElement,tooltip:HTMLDivElement,arrow:HTMLDivElement,text:HTMLSpanElement}}){async update(){const t=this.element.getAttribute("data-placement")||"top";un(this.activatorTarget,this.tooltipTarget,{placement:t,middleware:[an(Rl+$l),cn({padding:8}),ln({padding:8}),Na({element:this.arrowTarget})]}).then(({x:e,y:s,placement:i,middlewareData:r})=>{Object.assign(this.tooltipTarget.style,{left:`${e}px`,top:`${s}px`});const o=i.split("-")[0];this.tooltipTarget.setAttribute("data-side",o),this.arrowTarget.setAttribute("data-side",o);const{x:a,y:l}=r.arrow||{},c={top:"bottom",right:"left",bottom:"top",left:"right"}[o],u={left:a!=null?`${a}px`:"",top:l!=null?`${l}px`:"",right:"",bottom:""};c==="top"?u.bottom="-8px":c==="bottom"?u.top="-8px":c==="left"?u.right="-8px":c==="right"&&(u.left="-8px"),Object.assign(this.arrowTarget.style,u)})}showTooltip(t){this.wrapperTarget.classList.add("ariadne:block"),this.wrapperTarget.classList.remove("ariadne:hidden"),this.update()}hideTooltip(t){this.wrapperTarget.classList.add("ariadne:hidden"),this.wrapperTarget.classList.remove("ariadne:block")}}const Il=Object.freeze(Object.defineProperty({__proto__:null,default:Nl},Symbol.toStringTag,{value:"Module"})),pe=Vr.start();pe.debug=!1;window.Stimulus=pe;const Vl=Object.assign({"../../components/ariadne/form/toggle/component.ts":so,"../../components/ariadne/layout/sidebar/group/component.ts":io,"../../components/ariadne/ui/accordion/component.ts":Yo,"../../components/ariadne/ui/banner/component.ts":Go,"../../components/ariadne/ui/clipboard_copy/component.ts":ra,"../../components/ariadne/ui/combobox/component.ts":Ja,"../../components/ariadne/ui/dialog/component.ts":cl,"../../components/ariadne/ui/list/component.ts":hl,"../../components/ariadne/ui/popover/component.ts":fl,"../../components/ariadne/ui/relative_time/component.ts":Ml,"../../components/ariadne/ui/shortcut/component.ts":Ll});for(const[n,t]of Object.entries(Vl)){const e=n.split("/"),s=e.slice(3,e.length-1).join("-").replaceAll("_","-").toLocaleLowerCase();pe.register(s,t.default)}const jl=Object.assign({"/controllers/form_autosubmit_controller.ts":_l,"/controllers/form_validity_controller.ts":Fl,"/controllers/pagination_controller.ts":Pl,"/controllers/tooltip_controller.ts":Il});for(const[n,t]of Object.entries(jl)){const e=n.split("/"),s=e[e.length-1].replace("_controller.ts","").replaceAll("_","-").toLocaleLowerCase();pe.register(`ariadne-${s}`,t.default)}
|
98
|
+
%o`,e,t,s),(i=window.onerror)===null||i===void 0||i.call(window,e,"",0,0,t)}logFormattedMessage(t,e,s={}){s=Object.assign({application:this},s),this.logger.groupCollapsed(`${t} #${e}`),this.logger.log("details:",Object.assign({},s)),this.logger.groupEnd()}}function gl(){return new Promise(n=>{document.readyState=="loading"?document.addEventListener("DOMContentLoaded",()=>n()):n()})}function bl(n){return fe(n,"classes").reduce((e,s)=>Object.assign(e,yl(s)),{})}function yl(n){return{[`${n}Class`]:{get(){const{classes:t}=this;if(t.has(n))return t.get(n);{const e=t.getAttributeName(n);throw new Error(`Missing attribute "${e}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${de(n)}Class`]:{get(){return this.classes.has(n)}}}}function vl(n){return fe(n,"outlets").reduce((e,s)=>Object.assign(e,wl(s)),{})}function oi(n,t,e){return n.application.getControllerForElementAndIdentifier(t,e)}function ai(n,t,e){let s=oi(n,t,e);if(s||(n.application.router.proposeToConnectScopeForElementAndIdentifier(t,e),s=oi(n,t,e),s))return s}function wl(n){const t=gn(n);return{[`${t}Outlet`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e){const i=ai(this,e,n);if(i)return i;throw new Error(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}Outlets`]:{get(){const e=this.outlets.findAll(n);return e.length>0?e.map(s=>{const i=ai(this,s,n);if(i)return i;console.warn(`The provided outlet element is missing an outlet controller "${n}" instance for host controller "${this.identifier}"`,s)}).filter(s=>s):[]}},[`${t}OutletElement`]:{get(){const e=this.outlets.find(n),s=this.outlets.getSelectorForOutletName(n);if(e)return e;throw new Error(`Missing outlet element "${n}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${s}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(n)}},[`has${de(t)}Outlet`]:{get(){return this.outlets.has(n)}}}}function El(n){return fe(n,"targets").reduce((e,s)=>Object.assign(e,Tl(s)),{})}function Tl(n){return{[`${n}Target`]:{get(){const t=this.targets.find(n);if(t)return t;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${de(n)}Target`]:{get(){return this.targets.has(n)}}}}function Al(n){const t=qa(n,"values"),e={valueDescriptorMap:{get(){return t.reduce((s,i)=>{const r=pr(i,this.identifier),o=this.data.getAttributeNameForKey(r.key);return Object.assign(s,{[o]:r})},{})}}};return t.reduce((s,i)=>Object.assign(s,xl(i)),e)}function xl(n,t){const e=pr(n,t),{key:s,name:i,reader:r,writer:o}=e;return{[i]:{get(){const a=this.data.get(s);return a!==null?r(a):e.defaultValue},set(a){a===void 0?this.data.delete(s):this.data.set(s,o(a))}},[`has${de(i)}`]:{get(){return this.data.has(s)||e.hasCustomDefaultValue}}}}function pr([n,t],e){return Cl({controller:e,token:n,typeDefinition:t})}function De(n){switch(n){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function oe(n){switch(typeof n){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}if(Array.isArray(n))return"array";if(Object.prototype.toString.call(n)==="[object Object]")return"object"}function Sl(n){const{controller:t,token:e,typeObject:s}=n,i=ni(s.type),r=ni(s.default),o=i&&r,a=i&&!r,l=!i&&r,c=De(s.type),u=oe(n.typeObject.default);if(a)return c;if(l)return u;if(c!==u){const h=t?`${t}.${e}`:e;throw new Error(`The specified default value for the Stimulus Value "${h}" must match the defined type "${c}". The provided default value of "${s.default}" is of type "${u}".`)}if(o)return c}function Ml(n){const{controller:t,token:e,typeDefinition:s}=n,r=Sl({controller:t,token:e,typeObject:s}),o=oe(s),a=De(s),l=r||o||a;if(l)return l;const c=t?`${t}.${s}`:e;throw new Error(`Unknown value type "${c}" for "${e}" value`)}function Ol(n){const t=De(n);if(t)return li[t];const e=bn(n,"default"),s=bn(n,"type"),i=n;if(e)return i.default;if(s){const{type:r}=i,o=De(r);if(o)return li[o]}return n}function Cl(n){const{token:t,typeDefinition:e}=n,s=`${lr(t)}-value`,i=Ml(n);return{type:i,key:s,name:Un(s),get defaultValue(){return Ol(e)},get hasCustomDefaultValue(){return oe(e)!==void 0},reader:kl[i],writer:ci[i]||ci.default}}const li={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},kl={array(n){const t=JSON.parse(n);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${n}" of type "${oe(t)}"`);return t},boolean(n){return!(n=="0"||String(n).toLowerCase()=="false")},number(n){return Number(n.replace(/_/g,""))},object(n){const t=JSON.parse(n);if(t===null||typeof t!="object"||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${n}" of type "${oe(t)}"`);return t},string(n){return n}},ci={default:Dl,array:ui,object:ui};function ui(n){return JSON.stringify(n)}function Dl(n){return`${n}`}let it=class{constructor(t){this.context=t}static get shouldLoad(){return!0}static afterLoad(t,e){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(t,{target:e=this.element,detail:s={},prefix:i=this.identifier,bubbles:r=!0,cancelable:o=!0}={}){const a=i?`${i}:${t}`:t,l=new CustomEvent(a,{detail:s,bubbles:r,cancelable:o});return e.dispatchEvent(l),l}};it.blessings=[bl,El,Al,vl];it.targets=[];it.outlets=[];it.values={};function I(){return function({targets:t,values:e}={}){const i=class i extends it{dispatchEvent(o,a,l={}){const c=new Event(a,{bubbles:l.bubbles||!1,cancelable:l.cancelable||!1});o.dispatchEvent(c)}};i.targets=Object.keys(t??{}),i.values=e??{};let s=i;return s}}class Ll extends I()({targets:{toggle:HTMLInputElement},values:{formMethod:String,formUrl:String,csrfToken:String,turbo:Boolean}}){connect(){this.toggling=!1}requiresFormSubmit(){return this.formUrlValue!=null}async toggle(){if(!this.toggling&&(this.toggling=!0,!this.isDisabled())){if(!this.requiresFormSubmit()){this.performToggle(),this.toggling=!1;return}this.performToggle();try{await this.submitForm()}catch(t){t instanceof Error&&this.performToggle();return}finally{this.toggling=!1}}}performToggle(){this.isOn()?this.turnOff():this.turnOn()}turnOn(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","true")}turnOff(){this.isDisabled()||this.toggleTarget.setAttribute("aria-pressed","false")}isOn(){return this.toggleTarget.getAttribute("aria-pressed")==="true"}isOff(){return!this.isOn()}isDisabled(){return this.toggleTarget.getAttribute("disabled")!=null}async submitForm(){const t=new FormData,e=this.documentCsrfToken()||this.csrfTokenValue;if(e&&t.append(this.csrfField(),e),t.append(this.toggleTarget.name,this.isOn()?"true":"false"),!this.formUrlValue)throw new Error("invalid src");let s;const i={"Requested-With":"XMLHttpRequest"};this.turboValue&&(i.Accept="text/vnd.turbo-stream.html");try{s=await fetch(this.formUrlValue,{credentials:"same-origin",method:this.formMethodValue,headers:i,body:t})}catch(o){throw new Error(`A network error occurred, please try again: ${o.message}`)}if(!s.ok)throw new Error(await s.text());const r=s.headers.get("Content-Type");window.Turbo&&this.turbo&&(r!=null&&r.startsWith("text/vnd.turbo-stream.html"))&&window.Turbo.renderStreamMessage(await s.text())}csrfField(){return this.toggleTarget.getAttribute("csrf-field")||"authenticity_token"}documentCsrfToken(){const t=document.querySelector("meta[name=csrf-token]");return t&&t.getAttribute("content")}}const Fl=Object.freeze(Object.defineProperty({__proto__:null,default:Ll},Symbol.toStringTag,{value:"Module"})),Es=class Es extends I()({targets:{content:HTMLElement,chevron:HTMLElement},values:{open:{type:Boolean,default:!1}}}){connect(){this.applyState(this.openValue)}toggle(t){t&&t.stopPropagation(),this.openValue=!this.openValue}openValueChanged(t){this.applyState(t)}applyState(t){const e=this.contentTarget,s=this.hasChevronTarget?this.chevronTarget:null,i=e.scrollHeight;t?(e.classList.add("ariadne:animate-accordion-down"),e.classList.remove("ariadne:animate-accordion-up"),e.style.height=`${i}px`,this.element.classList.add("ariadne-sidebar-group-open"),this.element.classList.remove("ariadne-sidebar-group-closed"),s&&s.classList.add("ariadne:rotate-90"),setTimeout(()=>{this.openValue&&(e.style.height="auto")},200)):(e.classList.add("ariadne:animate-accordion-up"),e.classList.remove("ariadne:animate-accordion-down"),e.style.height=`${i}px`,e.offsetHeight,e.style.height="0px",this.element.classList.add("ariadne-sidebar-group-closed"),this.element.classList.remove("ariadne-sidebar-group-open"),s&&s.classList.remove("ariadne:rotate-90"))}};Es.classes=["open","closed"];let vn=Es;const Vl=Object.freeze(Object.defineProperty({__proto__:null,default:vn},Symbol.toStringTag,{value:"Module"})),Et=n=>n;let gr=Et;function _l(n,t){n.indexOf(t)===-1&&n.push(t)}function br(n,t){const e=n.indexOf(t);e>-1&&n.splice(e,1)}class yr{constructor(){this.subscriptions=[]}add(t){return _l(this.subscriptions,t),()=>br(this.subscriptions,t)}notify(t,e,s){const i=this.subscriptions.length;if(i)if(i===1)this.subscriptions[0](t,e,s);else for(let r=0;r<i;r++){const o=this.subscriptions[r];o&&o(t,e,s)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function vr(n,t){return t?n*(1e3/t):0}const Pl={useManualTiming:!1},Te=["read","resolveKeyframes","update","preRender","render","postRender"];function Rl(n,t){let e=new Set,s=new Set,i=!1,r=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(u){o.has(u)&&(c.schedule(u),n()),u(a)}const c={schedule:(u,h=!1,d=!1)=>{const f=d&&i?e:s;return h&&o.add(u),f.has(u)||f.add(u),u},cancel:u=>{s.delete(u),o.delete(u)},process:u=>{if(a=u,i){r=!0;return}i=!0,[e,s]=[s,e],e.forEach(l),e.clear(),i=!1,r&&(r=!1,c.process(u))}};return c}const Bl=40;function Il(n,t){let e=!1,s=!0;const i={delta:0,timestamp:0,isProcessing:!1},r=()=>e=!0,o=Te.reduce((p,v)=>(p[v]=Rl(r),p),{}),{read:a,resolveKeyframes:l,update:c,preRender:u,render:h,postRender:d}=o,m=()=>{const p=performance.now();e=!1,i.delta=s?1e3/60:Math.max(Math.min(p-i.timestamp,Bl),1),i.timestamp=p,i.isProcessing=!0,a.process(i),l.process(i),c.process(i),u.process(i),h.process(i),d.process(i),i.isProcessing=!1,e&&t&&(s=!1,n(m))},f=()=>{e=!0,s=!0,i.isProcessing||n(m)};return{schedule:Te.reduce((p,v)=>{const E=o[v];return p[v]=(w,y=!1,T=!1)=>(e||f(),E.schedule(w,y,T)),p},{}),cancel:p=>{for(let v=0;v<Te.length;v++)o[Te[v]].cancel(p)},state:i,steps:o}}const{schedule:Z,cancel:wn,state:Le}=Il(typeof requestAnimationFrame<"u"?requestAnimationFrame:Et,!0);let Ce;function Nl(){Ce=void 0}const at={now:()=>(Ce===void 0&&at.set(Le.isProcessing||Pl.useManualTiming?Le.timestamp:performance.now()),Ce),set:n=>{Ce=n,queueMicrotask(Nl)}},hi=30,$l=n=>!isNaN(parseFloat(n));class jl{constructor(t,e={}){this.version="12.6.1",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(s,i=!0)=>{const r=at.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(s),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),i&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=e.owner}setCurrent(t){this.current=t,this.updatedAt=at.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=$l(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,e){this.events[t]||(this.events[t]=new yr);const s=this.events[t].add(e);return t==="change"?()=>{s(),Z.read(()=>{this.events.change.getSize()||this.stop()})}:s}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,e){this.passiveEffect=t,this.stopPassiveEffect=e}set(t,e=!0){!e||!this.passiveEffect?this.updateAndNotify(t,e):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,e,s){this.set(e),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-s}jump(t,e=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,e&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=at.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>hi)return 0;const e=Math.min(this.updatedAt-this.prevUpdatedAt,hi);return vr(parseFloat(this.current)-parseFloat(this.prevFrameValue),e)}start(t){return this.stop(),new Promise(e=>{this.hasAnimated=!0,this.animation=t(e),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ae(n,t){return new jl(n,t)}function Kl(n,t,e){var s;if(n instanceof EventTarget)return[n];if(typeof n=="string"){let i=document;const r=(s=e==null?void 0:e[n])!==null&&s!==void 0?s:i.querySelectorAll(n);return r?Array.from(r):[]}return Array.from(n)}const We=(n,t,e)=>{const s=t-n;return s===0?1:(e-n)/s};function zn(n){let t;return()=>(t===void 0&&(t=n()),t)}const Hl=zn(()=>window.ScrollTimeline!==void 0);class Ul{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,e){for(let s=0;s<this.animations.length;s++)this.animations[s][t]=e}attachTimeline(t,e){const s=this.animations.map(i=>{if(Hl()&&i.attachTimeline)return i.attachTimeline(t);if(typeof e=="function")return e(i)});return()=>{s.forEach((i,r)=>{i&&i(),this.animations[r].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let e=0;e<this.animations.length;e++)t=Math.max(t,this.animations[e].duration);return t}runAll(t){this.animations.forEach(e=>e[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class wr extends Ul{then(t,e){return Promise.all(this.animations).then(t).catch(e)}}const nt=n=>n*1e3,st=n=>n/1e3,Fe=2e4;function qn(n){let t=0;const e=50;let s=n.next(t);for(;!s.done&&t<Fe;)t+=e,s=n.next(t);return t>=Fe?1/0:t}const Er=(n,t,e=10)=>{let s="";const i=Math.max(Math.round(t/e),2);for(let r=0;r<i;r++)s+=n(We(0,i-1,r))+", ";return`linear(${s.substring(0,s.length-2)})`},Tt=(n,t,e)=>e>t?t:e<n?n:e,Wl=5;function Tr(n,t,e){const s=Math.max(t-Wl,0);return vr(e-n(s),t-s)}const C={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},di=.001;function zl({duration:n=C.duration,bounce:t=C.bounce,velocity:e=C.velocity,mass:s=C.mass}){let i,r,o=1-t;o=Tt(C.minDamping,C.maxDamping,o),n=Tt(C.minDuration,C.maxDuration,st(n)),o<1?(i=c=>{const u=c*o,h=u*n,d=u-e,m=En(c,o),f=Math.exp(-h);return di-d/m*f},r=c=>{const h=c*o*n,d=h*e+e,m=Math.pow(o,2)*Math.pow(c,2)*n,f=Math.exp(-h),g=En(Math.pow(c,2),o);return(-i(c)+di>0?-1:1)*((d-m)*f)/g}):(i=c=>{const u=Math.exp(-c*n),h=(c-e)*n+1;return-.001+u*h},r=c=>{const u=Math.exp(-c*n),h=(e-c)*(n*n);return u*h});const a=5/n,l=Yl(i,r,a);if(n=nt(n),isNaN(l))return{stiffness:C.stiffness,damping:C.damping,duration:n};{const c=Math.pow(l,2)*s;return{stiffness:c,damping:o*2*Math.sqrt(s*c),duration:n}}}const ql=12;function Yl(n,t,e){let s=e;for(let i=1;i<ql;i++)s=s-n(s)/t(s);return s}function En(n,t){return n*Math.sqrt(1-t*t)}const Xl=["duration","bounce"],Gl=["stiffness","damping","mass"];function fi(n,t){return t.some(e=>n[e]!==void 0)}function Zl(n){let t={velocity:C.velocity,stiffness:C.stiffness,damping:C.damping,mass:C.mass,isResolvedFromDuration:!1,...n};if(!fi(n,Gl)&&fi(n,Xl))if(n.visualDuration){const e=n.visualDuration,s=2*Math.PI/(e*1.2),i=s*s,r=2*Tt(.05,1,1-(n.bounce||0))*Math.sqrt(i);t={...t,mass:C.mass,stiffness:i,damping:r}}else{const e=zl(n);t={...t,...e,mass:C.mass},t.isResolvedFromDuration=!0}return t}function Yn(n=C.visualDuration,t=C.bounce){const e=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:t}:n;let{restSpeed:s,restDelta:i}=e;const r=e.keyframes[0],o=e.keyframes[e.keyframes.length-1],a={done:!1,value:r},{stiffness:l,damping:c,mass:u,duration:h,velocity:d,isResolvedFromDuration:m}=Zl({...e,velocity:-st(e.velocity||0)}),f=d||0,g=c/(2*Math.sqrt(l*u)),b=o-r,p=st(Math.sqrt(l/u)),v=Math.abs(b)<5;s||(s=v?C.restSpeed.granular:C.restSpeed.default),i||(i=v?C.restDelta.granular:C.restDelta.default);let E;if(g<1){const y=En(p,g);E=T=>{const S=Math.exp(-g*p*T);return o-S*((f+g*p*b)/y*Math.sin(y*T)+b*Math.cos(y*T))}}else if(g===1)E=y=>o-Math.exp(-p*y)*(b+(f+p*b)*y);else{const y=p*Math.sqrt(g*g-1);E=T=>{const S=Math.exp(-g*p*T),A=Math.min(y*T,300);return o-S*((f+g*p*b)*Math.sinh(A)+y*b*Math.cosh(A))/y}}const w={calculatedDuration:m&&h||null,next:y=>{const T=E(y);if(m)a.done=y>=h;else{let S=0;g<1&&(S=y===0?nt(f):Tr(E,y,T));const A=Math.abs(S)<=s,M=Math.abs(o-T)<=i;a.done=A&&M}return a.value=a.done?o:T,a},toString:()=>{const y=Math.min(qn(w),Fe),T=Er(S=>w.next(y*S).value,y,30);return y+"ms "+T}};return w}function Ql(n,t=100,e){const s=e({...n,keyframes:[0,t]}),i=Math.min(qn(s),Fe);return{type:"keyframes",ease:r=>s.next(i*r).value/t,duration:st(i)}}function ze(n){return typeof n=="function"}const Jl=(n,t,e)=>{const s=t-n;return((e-n)%s+s)%s+n},Ar=n=>Array.isArray(n)&&typeof n[0]!="number";function xr(n,t){return Ar(n)?n[Jl(0,n.length,t)]:n}const me=(n,t,e)=>n+(t-n)*e;function Sr(n,t){const e=n[n.length-1];for(let s=1;s<=t;s++){const i=We(0,t,s);n.push(me(e,1,i))}}function Mr(n){const t=[0];return Sr(t,n.length-1),t}const P=n=>!!(n&&n.getVelocity);function Xn(n){return typeof n=="object"&&!Array.isArray(n)}function Or(n,t,e,s){return typeof n=="string"&&Xn(t)?Kl(n,e,s):n instanceof NodeList?Array.from(n):Array.isArray(n)?n:[n]}function tc(n,t,e){return n*(t+1)}function mi(n,t,e,s){var i;return typeof t=="number"?t:t.startsWith("-")||t.startsWith("+")?Math.max(0,n+parseFloat(t)):t==="<"?e:(i=s.get(t))!==null&&i!==void 0?i:n}function ec(n,t,e){for(let s=0;s<n.length;s++){const i=n[s];i.at>t&&i.at<e&&(br(n,i),s--)}}function nc(n,t,e,s,i,r){ec(n,i,r);for(let o=0;o<t.length;o++)n.push({value:t[o],at:me(i,r,s[o]),easing:xr(e,o)})}function sc(n,t){for(let e=0;e<n.length;e++)n[e]=n[e]/(t+1)}function ic(n,t){return n.at===t.at?n.value===null?1:t.value===null?-1:0:n.at-t.at}const rc="easeInOut";function oc(n,{defaultTransition:t={},...e}={},s,i){const r=t.duration||.3,o=new Map,a=new Map,l={},c=new Map;let u=0,h=0,d=0;for(let m=0;m<n.length;m++){const f=n[m];if(typeof f=="string"){c.set(f,h);continue}else if(!Array.isArray(f)){c.set(f.name,mi(h,f.at,u,c));continue}let[g,b,p={}]=f;p.at!==void 0&&(h=mi(h,p.at,u,c));let v=0;const E=(w,y,T,S=0,A=0)=>{const M=ac(w),{delay:O=0,times:L=Mr(M),type:B="keyframes",repeat:N,repeatType:V,repeatDelay:ht=0,...W}=y;let{ease:F=t.ease||"easeOut",duration:D}=y;const z=typeof O=="function"?O(S,A):O,ye=M.length,xs=ze(B)?B:i==null?void 0:i[B];if(ye<=2&&xs){let Ht=100;if(ye===2&&uc(M)){const Ut=M[1]-M[0];Ht=Math.abs(Ut)}const ve={...W};D!==void 0&&(ve.duration=nt(D));const we=Ql(ve,Ht,xs);F=we.ease,D=we.duration}D??(D=r);const Ss=h+z;L.length===1&&L[0]===0&&(L[1]=1);const Ms=L.length-M.length;if(Ms>0&&Sr(L,Ms),M.length===1&&M.unshift(null),N){D=tc(D,N);const Ht=[...M],ve=[...L];F=Array.isArray(F)?[...F]:[F];const we=[...F];for(let Ut=0;Ut<N;Ut++){M.push(...Ht);for(let Wt=0;Wt<Ht.length;Wt++)L.push(ve[Wt]+(Ut+1)),F.push(Wt===0?"linear":xr(we,Wt-1))}sc(L,N)}const Os=Ss+D;nc(T,M,F,L,Ss,Os),v=Math.max(z+D,v),d=Math.max(Os,d)};if(P(g)){const w=pi(g,a);E(b,p,gi("default",w))}else{const w=Or(g,b,s,l),y=w.length;for(let T=0;T<y;T++){b=b,p=p;const S=w[T],A=pi(S,a);for(const M in b)E(b[M],lc(p,M),gi(M,A),T,y)}}u=h,h+=v}return a.forEach((m,f)=>{for(const g in m){const b=m[g];b.sort(ic);const p=[],v=[],E=[];for(let y=0;y<b.length;y++){const{at:T,value:S,easing:A}=b[y];p.push(S),v.push(We(0,d,T)),E.push(A||"easeOut")}v[0]!==0&&(v.unshift(0),p.unshift(p[0]),E.unshift(rc)),v[v.length-1]!==1&&(v.push(1),p.push(null)),o.has(f)||o.set(f,{keyframes:{},transition:{}});const w=o.get(f);w.keyframes[g]=p,w.transition[g]={...t,duration:d,ease:E,times:v,...e}}}),o}function pi(n,t){return!t.has(n)&&t.set(n,{}),t.get(n)}function gi(n,t){return t[n]||(t[n]=[]),t[n]}function ac(n){return Array.isArray(n)?n:[n]}function lc(n,t){return n&&n[t]?{...n,...n[t]}:{...n}}const cc=n=>typeof n=="number",uc=n=>n.every(cc),le=new WeakMap;function Cr(n,t){return n?n[t]||n.default||n:void 0}const Rt=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Bt=new Set(Rt),kr=new Set(["width","height","top","left","right","bottom",...Rt]),hc=n=>Array.isArray(n),dc=n=>hc(n)?n[n.length-1]||0:n;function bi(n){const t=[{},{}];return n==null||n.values.forEach((e,s)=>{t[0][s]=e.get(),t[1][s]=e.getVelocity()}),t}function Dr(n,t,e,s){if(typeof t=="function"){const[i,r]=bi(s);t=t(e!==void 0?e:n.custom,i,r)}if(typeof t=="string"&&(t=n.variants&&n.variants[t]),typeof t=="function"){const[i,r]=bi(s);t=t(e!==void 0?e:n.custom,i,r)}return t}function fc(n,t,e){const s=n.getProps();return Dr(s,t,s.custom,n)}function mc(n,t,e){n.hasValue(t)?n.getValue(t).set(e):n.addValue(t,ae(e))}function pc(n,t){const e=fc(n,t);let{transitionEnd:s={},transition:i={},...r}=e||{};r={...r,...s};for(const o in r){const a=dc(r[o]);mc(n,o,a)}}function gc(n){return!!(P(n)&&n.add)}function bc(n,t){const e=n.getValue("willChange");if(gc(e))return e.add(t)}const Gn=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),yc="framerAppearId",vc="data-"+Gn(yc);function wc(n){return n.props[vc]}function yi(n,t){n.timeline=t,n.onfinish=null}const Zn=n=>Array.isArray(n)&&typeof n[0]=="number",Ec={linearEasing:void 0};function Tc(n,t){const e=zn(n);return()=>{var s;return(s=Ec[t])!==null&&s!==void 0?s:e()}}const Ve=Tc(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing");function Lr(n){return!!(typeof n=="function"&&Ve()||!n||typeof n=="string"&&(n in Tn||Ve())||Zn(n)||Array.isArray(n)&&n.every(Lr))}const Qt=([n,t,e,s])=>`cubic-bezier(${n}, ${t}, ${e}, ${s})`,Tn={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Qt([0,.65,.55,1]),circOut:Qt([.55,0,1,.45]),backIn:Qt([.31,.01,.66,-.59]),backOut:Qt([.33,1.53,.69,.99])};function Fr(n,t){if(n)return typeof n=="function"&&Ve()?Er(n,t):Zn(n)?Qt(n):Array.isArray(n)?n.map(e=>Fr(e,t)||Tn.easeOut):Tn[n]}const Vr=(n,t,e)=>(((1-3*e+3*t)*n+(3*e-6*t))*n+3*t)*n,Ac=1e-7,xc=12;function Sc(n,t,e,s,i){let r,o,a=0;do o=t+(e-t)/2,r=Vr(o,s,i)-n,r>0?e=o:t=o;while(Math.abs(r)>Ac&&++a<xc);return o}function pe(n,t,e,s){if(n===t&&e===s)return Et;const i=r=>Sc(r,0,1,n,e);return r=>r===0||r===1?r:Vr(i(r),t,s)}const _r=n=>t=>t<=.5?n(2*t)/2:(2-n(2*(1-t)))/2,Pr=n=>t=>1-n(1-t),Rr=pe(.33,1.53,.69,.99),Qn=Pr(Rr),Br=_r(Qn),Ir=n=>(n*=2)<1?.5*Qn(n):.5*(2-Math.pow(2,-10*(n-1))),Jn=n=>1-Math.sin(Math.acos(n)),Mc=Pr(Jn),Nr=_r(Jn),$r=n=>/^0[^.\s]+$/u.test(n);function Oc(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||$r(n):!0}const It={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},ce={...It,transform:n=>Tt(0,1,n)},Ae={...It,default:1},ne=n=>Math.round(n*1e5)/1e5,ts=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function Cc(n){return n==null}const kc=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,es=(n,t)=>e=>!!(typeof e=="string"&&kc.test(e)&&e.startsWith(n)||t&&!Cc(e)&&Object.prototype.hasOwnProperty.call(e,t)),jr=(n,t,e)=>s=>{if(typeof s!="string")return s;const[i,r,o,a]=s.match(ts);return{[n]:parseFloat(i),[t]:parseFloat(r),[e]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},Dc=n=>Tt(0,255,n),sn={...It,transform:n=>Math.round(Dc(n))},gt={test:es("rgb","red"),parse:jr("red","green","blue"),transform:({red:n,green:t,blue:e,alpha:s=1})=>"rgba("+sn.transform(n)+", "+sn.transform(t)+", "+sn.transform(e)+", "+ne(ce.transform(s))+")"};function Lc(n){let t="",e="",s="",i="";return n.length>5?(t=n.substring(1,3),e=n.substring(3,5),s=n.substring(5,7),i=n.substring(7,9)):(t=n.substring(1,2),e=n.substring(2,3),s=n.substring(3,4),i=n.substring(4,5),t+=t,e+=e,s+=s,i+=i),{red:parseInt(t,16),green:parseInt(e,16),blue:parseInt(s,16),alpha:i?parseInt(i,16)/255:1}}const An={test:es("#"),parse:Lc,transform:gt.transform},ge=n=>({test:t=>typeof t=="string"&&t.endsWith(n)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${n}`}),rt=ge("deg"),Lt=ge("%"),x=ge("px"),Fc=ge("vh"),Vc=ge("vw"),vi={...Lt,parse:n=>Lt.parse(n)/100,transform:n=>Lt.transform(n*100)},Ot={test:es("hsl","hue"),parse:jr("hue","saturation","lightness"),transform:({hue:n,saturation:t,lightness:e,alpha:s=1})=>"hsla("+Math.round(n)+", "+Lt.transform(ne(t))+", "+Lt.transform(ne(e))+", "+ne(ce.transform(s))+")"},_={test:n=>gt.test(n)||An.test(n)||Ot.test(n),parse:n=>gt.test(n)?gt.parse(n):Ot.test(n)?Ot.parse(n):An.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?gt.transform(n):Ot.transform(n)},_c=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function Pc(n){var t,e;return isNaN(n)&&typeof n=="string"&&(((t=n.match(ts))===null||t===void 0?void 0:t.length)||0)+(((e=n.match(_c))===null||e===void 0?void 0:e.length)||0)>0}const Kr="number",Hr="color",Rc="var",Bc="var(",wi="${}",Ic=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ue(n){const t=n.toString(),e=[],s={color:[],number:[],var:[]},i=[];let r=0;const a=t.replace(Ic,l=>(_.test(l)?(s.color.push(r),i.push(Hr),e.push(_.parse(l))):l.startsWith(Bc)?(s.var.push(r),i.push(Rc),e.push(l)):(s.number.push(r),i.push(Kr),e.push(parseFloat(l))),++r,wi)).split(wi);return{values:e,split:a,indexes:s,types:i}}function Ur(n){return ue(n).values}function Wr(n){const{split:t,types:e}=ue(n),s=t.length;return i=>{let r="";for(let o=0;o<s;o++)if(r+=t[o],i[o]!==void 0){const a=e[o];a===Kr?r+=ne(i[o]):a===Hr?r+=_.transform(i[o]):r+=i[o]}return r}}const Nc=n=>typeof n=="number"?0:n;function $c(n){const t=Ur(n);return Wr(n)(t.map(Nc))}const Nt={test:Pc,parse:Ur,createTransformer:Wr,getAnimatableNone:$c},jc=new Set(["brightness","contrast","saturate","opacity"]);function Kc(n){const[t,e]=n.slice(0,-1).split("(");if(t==="drop-shadow")return n;const[s]=e.match(ts)||[];if(!s)return n;const i=e.replace(s,"");let r=jc.has(t)?1:0;return s!==e&&(r*=100),t+"("+r+i+")"}const Hc=/\b([a-z-]*)\(.*?\)/gu,xn={...Nt,getAnimatableNone:n=>{const t=n.match(Hc);return t?t.map(Kc).join(" "):n}},Uc={borderWidth:x,borderTopWidth:x,borderRightWidth:x,borderBottomWidth:x,borderLeftWidth:x,borderRadius:x,radius:x,borderTopLeftRadius:x,borderTopRightRadius:x,borderBottomRightRadius:x,borderBottomLeftRadius:x,width:x,maxWidth:x,height:x,maxHeight:x,top:x,right:x,bottom:x,left:x,padding:x,paddingTop:x,paddingRight:x,paddingBottom:x,paddingLeft:x,margin:x,marginTop:x,marginRight:x,marginBottom:x,marginLeft:x,backgroundPositionX:x,backgroundPositionY:x},Wc={rotate:rt,rotateX:rt,rotateY:rt,rotateZ:rt,scale:Ae,scaleX:Ae,scaleY:Ae,scaleZ:Ae,skew:rt,skewX:rt,skewY:rt,distance:x,translateX:x,translateY:x,translateZ:x,x,y:x,z:x,perspective:x,transformPerspective:x,opacity:ce,originX:vi,originY:vi,originZ:x},Ei={...It,transform:Math.round},ns={...Uc,...Wc,zIndex:Ei,size:x,fillOpacity:ce,strokeOpacity:ce,numOctaves:Ei},zc={...ns,color:_,backgroundColor:_,outlineColor:_,fill:_,stroke:_,borderColor:_,borderTopColor:_,borderRightColor:_,borderBottomColor:_,borderLeftColor:_,filter:xn,WebkitFilter:xn},zr=n=>zc[n];function qr(n,t){let e=zr(n);return e!==xn&&(e=Nt),e.getAnimatableNone?e.getAnimatableNone(t):void 0}const qc=new Set(["auto","none","0"]);function Yc(n,t,e){let s=0,i;for(;s<n.length&&!i;){const r=n[s];typeof r=="string"&&!qc.has(r)&&ue(r).values.length&&(i=n[s]),s++}if(i&&e)for(const r of t)n[r]=qr(e,i)}const bt=n=>n*180/Math.PI,Sn=n=>{const t=bt(Math.atan2(n[1],n[0]));return Mn(t)},Xc={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Sn,rotateZ:Sn,skewX:n=>bt(Math.atan(n[1])),skewY:n=>bt(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},Mn=n=>(n=n%360,n<0&&(n+=360),n),Ti=Sn,Ai=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),xi=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),Gc={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:Ai,scaleY:xi,scale:n=>(Ai(n)+xi(n))/2,rotateX:n=>Mn(bt(Math.atan2(n[6],n[5]))),rotateY:n=>Mn(bt(Math.atan2(-n[2],n[0]))),rotateZ:Ti,rotate:Ti,skewX:n=>bt(Math.atan(n[4])),skewY:n=>bt(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function Si(n){return n.includes("scale")?1:0}function On(n,t){if(!n||n==="none")return Si(t);const e=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let s,i;if(e)s=Gc,i=e;else{const a=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);s=Xc,i=a}if(!i)return Si(t);const r=s[t],o=i[1].split(",").map(Qc);return typeof r=="function"?r(o):o[r]}const Zc=(n,t)=>{const{transform:e="none"}=getComputedStyle(n);return On(e,t)};function Qc(n){return parseFloat(n.trim())}const Mi=n=>n===It||n===x,Jc=new Set(["x","y","z"]),tu=Rt.filter(n=>!Jc.has(n));function eu(n){const t=[];return tu.forEach(e=>{const s=n.getValue(e);s!==void 0&&(t.push([e,s.get()]),s.set(e.startsWith("scale")?1:0))}),t}const _t={width:({x:n},{paddingLeft:t="0",paddingRight:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),height:({y:n},{paddingTop:t="0",paddingBottom:e="0"})=>n.max-n.min-parseFloat(t)-parseFloat(e),top:(n,{top:t})=>parseFloat(t),left:(n,{left:t})=>parseFloat(t),bottom:({y:n},{top:t})=>parseFloat(t)+(n.max-n.min),right:({x:n},{left:t})=>parseFloat(t)+(n.max-n.min),x:(n,{transform:t})=>On(t,"x"),y:(n,{transform:t})=>On(t,"y")};_t.translateX=_t.x;_t.translateY=_t.y;const vt=new Set;let Cn=!1,kn=!1;function Yr(){if(kn){const n=Array.from(vt).filter(s=>s.needsMeasurement),t=new Set(n.map(s=>s.element)),e=new Map;t.forEach(s=>{const i=eu(s);i.length&&(e.set(s,i),s.render())}),n.forEach(s=>s.measureInitialState()),t.forEach(s=>{s.render();const i=e.get(s);i&&i.forEach(([r,o])=>{var a;(a=s.getValue(r))===null||a===void 0||a.set(o)})}),n.forEach(s=>s.measureEndState()),n.forEach(s=>{s.suspendedScrollY!==void 0&&window.scrollTo(0,s.suspendedScrollY)})}kn=!1,Cn=!1,vt.forEach(n=>n.complete()),vt.clear()}function Xr(){vt.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(kn=!0)})}function nu(){Xr(),Yr()}class ss{constructor(t,e,s,i,r,o=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=e,this.name=s,this.motionValue=i,this.element=r,this.isAsync=o}scheduleResolve(){this.isScheduled=!0,this.isAsync?(vt.add(this),Cn||(Cn=!0,Z.read(Xr),Z.resolveKeyframes(Yr))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:e,element:s,motionValue:i}=this;for(let r=0;r<t.length;r++)if(t[r]===null)if(r===0){const o=i==null?void 0:i.get(),a=t[t.length-1];if(o!==void 0)t[0]=o;else if(s&&e){const l=s.readValue(e,a);l!=null&&(t[0]=l)}t[0]===void 0&&(t[0]=a),i&&o===void 0&&i.set(t[0])}else t[r]=t[r-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),vt.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,vt.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const Gr=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),Zr=n=>t=>typeof t=="string"&&t.startsWith(n),Qr=Zr("--"),su=Zr("var(--"),is=n=>su(n)?iu.test(n.split("/*")[0].trim()):!1,iu=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ru=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function ou(n){const t=ru.exec(n);if(!t)return[,];const[,e,s,i]=t;return[`--${e??s}`,i]}function Jr(n,t,e=1){const[s,i]=ou(n);if(!s)return;const r=window.getComputedStyle(t).getPropertyValue(s);if(r){const o=r.trim();return Gr(o)?parseFloat(o):o}return is(i)?Jr(i,t,e+1):i}const to=n=>t=>t.test(n),au={test:n=>n==="auto",parse:n=>n},eo=[It,x,Lt,rt,Vc,Fc,au],Oi=n=>eo.find(to(n));class no extends ss{constructor(t,e,s,i,r){super(t,e,s,i,r,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:e,name:s}=this;if(!e||!e.current)return;super.readKeyframes();for(let l=0;l<t.length;l++){let c=t[l];if(typeof c=="string"&&(c=c.trim(),is(c))){const u=Jr(c,e.current);u!==void 0&&(t[l]=u),l===t.length-1&&(this.finalKeyframe=c)}}if(this.resolveNoneKeyframes(),!kr.has(s)||t.length!==2)return;const[i,r]=t,o=Oi(i),a=Oi(r);if(o!==a)if(Mi(o)&&Mi(a))for(let l=0;l<t.length;l++){const c=t[l];typeof c=="string"&&(t[l]=parseFloat(c))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:e}=this,s=[];for(let i=0;i<t.length;i++)Oc(t[i])&&s.push(i);s.length&&Yc(t,s,e)}measureInitialState(){const{element:t,unresolvedKeyframes:e,name:s}=this;if(!t||!t.current)return;s==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=_t[s](t.measureViewportBox(),window.getComputedStyle(t.current)),e[0]=this.measuredOrigin;const i=e[e.length-1];i!==void 0&&t.getValue(s,i).jump(i,!1)}measureEndState(){var t;const{element:e,name:s,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const r=e.getValue(s);r&&r.jump(this.measuredOrigin,!1);const o=i.length-1,a=i[o];i[o]=_t[s](e.measureViewportBox(),window.getComputedStyle(e.current)),a!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=a),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([l,c])=>{e.getValue(l).set(c)}),this.resolveNoneKeyframes()}}const Ci=(n,t)=>t==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Nt.test(n)||n==="0")&&!n.startsWith("url("));function lu(n){const t=n[0];if(n.length===1)return!0;for(let e=0;e<n.length;e++)if(n[e]!==t)return!0}function cu(n,t,e,s){const i=n[0];if(i===null)return!1;if(t==="display"||t==="visibility")return!0;const r=n[n.length-1],o=Ci(i,t),a=Ci(r,t);return!o||!a?!1:lu(n)||(e==="spring"||ze(e))&&s}const uu=n=>n!==null;function qe(n,{repeat:t,repeatType:e="loop"},s){const i=n.filter(uu),r=t&&e!=="loop"&&t%2===1?0:i.length-1;return!r||s===void 0?i[r]:s}const hu=40;class so{constructor({autoplay:t=!0,delay:e=0,type:s="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=at.now(),this.options={autoplay:t,delay:e,type:s,repeat:i,repeatDelay:r,repeatType:o,...a},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>hu?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&nu(),this._resolved}onKeyframesResolved(t,e){this.resolvedAt=at.now(),this.hasAttemptedResolve=!0;const{name:s,type:i,velocity:r,delay:o,onComplete:a,onUpdate:l,isGenerator:c}=this.options;if(!c&&!cu(t,s,i,r))if(o)this.options.duration=0;else{l&&l(qe(t,this.options,e)),a&&a(),this.resolveFinishedPromise();return}const u=this.initPlayback(t,e);u!==!1&&(this._resolved={keyframes:t,finalKeyframe:e,...u},this.onPostResolved())}onPostResolved(){}then(t,e){return this.currentFinishedPromise.then(t,e)}flatten(){this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear")}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}function rn(n,t,e){return e<0&&(e+=1),e>1&&(e-=1),e<1/6?n+(t-n)*6*e:e<1/2?t:e<2/3?n+(t-n)*(2/3-e)*6:n}function du({hue:n,saturation:t,lightness:e,alpha:s}){n/=360,t/=100,e/=100;let i=0,r=0,o=0;if(!t)i=r=o=e;else{const a=e<.5?e*(1+t):e+t-e*t,l=2*e-a;i=rn(l,a,n+1/3),r=rn(l,a,n),o=rn(l,a,n-1/3)}return{red:Math.round(i*255),green:Math.round(r*255),blue:Math.round(o*255),alpha:s}}function _e(n,t){return e=>e>0?t:n}const on=(n,t,e)=>{const s=n*n,i=e*(t*t-s)+s;return i<0?0:Math.sqrt(i)},fu=[An,gt,Ot],mu=n=>fu.find(t=>t.test(n));function ki(n){const t=mu(n);if(!t)return!1;let e=t.parse(n);return t===Ot&&(e=du(e)),e}const Di=(n,t)=>{const e=ki(n),s=ki(t);if(!e||!s)return _e(n,t);const i={...e};return r=>(i.red=on(e.red,s.red,r),i.green=on(e.green,s.green,r),i.blue=on(e.blue,s.blue,r),i.alpha=me(e.alpha,s.alpha,r),gt.transform(i))},pu=(n,t)=>e=>t(n(e)),rs=(...n)=>n.reduce(pu),Dn=new Set(["none","hidden"]);function gu(n,t){return Dn.has(n)?e=>e<=0?n:t:e=>e>=1?t:n}function bu(n,t){return e=>me(n,t,e)}function os(n){return typeof n=="number"?bu:typeof n=="string"?is(n)?_e:_.test(n)?Di:wu:Array.isArray(n)?io:typeof n=="object"?_.test(n)?Di:yu:_e}function io(n,t){const e=[...n],s=e.length,i=n.map((r,o)=>os(r)(r,t[o]));return r=>{for(let o=0;o<s;o++)e[o]=i[o](r);return e}}function yu(n,t){const e={...n,...t},s={};for(const i in e)n[i]!==void 0&&t[i]!==void 0&&(s[i]=os(n[i])(n[i],t[i]));return i=>{for(const r in s)e[r]=s[r](i);return e}}function vu(n,t){var e;const s=[],i={color:0,var:0,number:0};for(let r=0;r<t.values.length;r++){const o=t.types[r],a=n.indexes[o][i[o]],l=(e=n.values[a])!==null&&e!==void 0?e:0;s[r]=l,i[o]++}return s}const wu=(n,t)=>{const e=Nt.createTransformer(t),s=ue(n),i=ue(t);return s.indexes.var.length===i.indexes.var.length&&s.indexes.color.length===i.indexes.color.length&&s.indexes.number.length>=i.indexes.number.length?Dn.has(n)&&!i.values.length||Dn.has(t)&&!s.values.length?gu(n,t):rs(io(vu(s,i),i.values),e):_e(n,t)};function ro(n,t,e){return typeof n=="number"&&typeof t=="number"&&typeof e=="number"?me(n,t,e):os(n)(n,t)}function Li({keyframes:n,velocity:t=0,power:e=.8,timeConstant:s=325,bounceDamping:i=10,bounceStiffness:r=500,modifyTarget:o,min:a,max:l,restDelta:c=.5,restSpeed:u}){const h=n[0],d={done:!1,value:h},m=A=>a!==void 0&&A<a||l!==void 0&&A>l,f=A=>a===void 0?l:l===void 0||Math.abs(a-A)<Math.abs(l-A)?a:l;let g=e*t;const b=h+g,p=o===void 0?b:o(b);p!==b&&(g=p-h);const v=A=>-g*Math.exp(-A/s),E=A=>p+v(A),w=A=>{const M=v(A),O=E(A);d.done=Math.abs(M)<=c,d.value=d.done?p:O};let y,T;const S=A=>{m(d.value)&&(y=A,T=Yn({keyframes:[d.value,f(d.value)],velocity:Tr(E,A,d.value),damping:i,stiffness:r,restDelta:c,restSpeed:u}))};return S(0),{calculatedDuration:null,next:A=>{let M=!1;return!T&&y===void 0&&(M=!0,w(A),S(A)),y!==void 0&&A>=y?T.next(A-y):(!M&&w(A),d)}}}const Eu=pe(.42,0,1,1),Tu=pe(0,0,.58,1),oo=pe(.42,0,.58,1),Au={linear:Et,easeIn:Eu,easeInOut:oo,easeOut:Tu,circIn:Jn,circInOut:Nr,circOut:Mc,backIn:Qn,backInOut:Br,backOut:Rr,anticipate:Ir},Fi=n=>{if(Zn(n)){gr(n.length===4);const[t,e,s,i]=n;return pe(t,e,s,i)}else if(typeof n=="string")return Au[n];return n};function xu(n,t,e){const s=[],i=e||ro,r=n.length-1;for(let o=0;o<r;o++){let a=i(n[o],n[o+1]);if(t){const l=Array.isArray(t)?t[o]||Et:t;a=rs(l,a)}s.push(a)}return s}function Su(n,t,{clamp:e=!0,ease:s,mixer:i}={}){const r=n.length;if(gr(r===t.length),r===1)return()=>t[0];if(r===2&&t[0]===t[1])return()=>t[1];const o=n[0]===n[1];n[0]>n[r-1]&&(n=[...n].reverse(),t=[...t].reverse());const a=xu(t,s,i),l=a.length,c=u=>{if(o&&u<n[0])return t[0];let h=0;if(l>1)for(;h<n.length-2&&!(u<n[h+1]);h++);const d=We(n[h],n[h+1],u);return a[h](d)};return e?u=>c(Tt(n[0],n[r-1],u)):c}function Mu(n,t){return n.map(e=>e*t)}function Ou(n,t){return n.map(()=>t||oo).splice(0,n.length-1)}function Pe({duration:n=300,keyframes:t,times:e,ease:s="easeInOut"}){const i=Ar(s)?s.map(Fi):Fi(s),r={done:!1,value:t[0]},o=Mu(e&&e.length===t.length?e:Mr(t),n),a=Su(o,t,{ease:Array.isArray(i)?i:Ou(t,i)});return{calculatedDuration:n,next:l=>(r.value=a(l),r.done=l>=n,r)}}const Cu=n=>{const t=({timestamp:e})=>n(e);return{start:()=>Z.update(t,!0),stop:()=>wn(t),now:()=>Le.isProcessing?Le.timestamp:at.now()}},ku={decay:Li,inertia:Li,tween:Pe,keyframes:Pe,spring:Yn},Du=n=>n/100;class as extends so{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:l}=this.options;l&&l()};const{name:e,motionValue:s,element:i,keyframes:r}=this.options,o=(i==null?void 0:i.KeyframeResolver)||ss,a=(l,c)=>this.onKeyframesResolved(l,c);this.resolver=new o(r,a,e,s,i),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:e="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:r,velocity:o=0}=this.options,a=ze(e)?e:ku[e]||Pe;let l,c;a!==Pe&&typeof t[0]!="number"&&(l=rs(Du,ro(t[0],t[1])),t=[0,100]);const u=a({...this.options,keyframes:t});r==="mirror"&&(c=a({...this.options,keyframes:[...t].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=qn(u));const{calculatedDuration:h}=u,d=h+i,m=d*(s+1)-i;return{generator:u,mirroredGenerator:c,mapPercentToKeyframes:l,calculatedDuration:h,resolvedDuration:d,totalDuration:m}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,e=!1){const{resolved:s}=this;if(!s){const{keyframes:A}=this.options;return{done:!0,value:A[A.length-1]}}const{finalKeyframe:i,generator:r,mirroredGenerator:o,mapPercentToKeyframes:a,keyframes:l,calculatedDuration:c,totalDuration:u,resolvedDuration:h}=s;if(this.startTime===null)return r.next(0);const{delay:d,repeat:m,repeatType:f,repeatDelay:g,onUpdate:b}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-u/this.speed,this.startTime)),e?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const p=this.currentTime-d*(this.speed>=0?1:-1),v=this.speed>=0?p<0:p>u;this.currentTime=Math.max(p,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=u);let E=this.currentTime,w=r;if(m){const A=Math.min(this.currentTime,u)/h;let M=Math.floor(A),O=A%1;!O&&A>=1&&(O=1),O===1&&M--,M=Math.min(M,m+1),!!(M%2)&&(f==="reverse"?(O=1-O,g&&(O-=g/h)):f==="mirror"&&(w=o)),E=Tt(0,1,O)*h}const y=v?{done:!1,value:l[0]}:w.next(E);a&&(y.value=a(y.value));let{done:T}=y;!v&&c!==null&&(T=this.speed>=0?this.currentTime>=u:this.currentTime<=0);const S=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return S&&i!==void 0&&(y.value=qe(l,this.options,i)),b&&b(y.value),S&&this.finish(),y}get duration(){const{resolved:t}=this;return t?st(t.calculatedDuration):0}get time(){return st(this.currentTime)}set time(t){t=nt(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const e=this.playbackSpeed!==t;this.playbackSpeed=t,e&&(this.time=st(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=Cu,onPlay:e,startTime:s}=this.options;this.driver||(this.driver=t(r=>this.tick(r))),e&&e();const i=this.driver.now();this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=i):this.startTime=s??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const Lu=new Set(["opacity","clipPath","filter","transform"]);function Fu(n,t,e,{delay:s=0,duration:i=300,repeat:r=0,repeatType:o="loop",ease:a="easeInOut",times:l}={}){const c={[t]:e};l&&(c.offset=l);const u=Fr(a,i);return Array.isArray(u)&&(c.easing=u),n.animate(c,{delay:s,duration:i,easing:Array.isArray(u)?"linear":u,fill:"both",iterations:r+1,direction:o==="reverse"?"alternate":"normal"})}const Vu=zn(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),Re=10,_u=2e4;function Pu(n){return ze(n.type)||n.type==="spring"||!Lr(n.ease)}function Ru(n,t){const e=new as({...t,keyframes:n,repeat:0,delay:0,isGenerator:!0});let s={done:!1,value:n[0]};const i=[];let r=0;for(;!s.done&&r<_u;)s=e.sample(r),i.push(s.value),r+=Re;return{times:void 0,keyframes:i,duration:r-Re,ease:"linear"}}const ao={anticipate:Ir,backInOut:Br,circInOut:Nr};function Bu(n){return n in ao}class Vi extends so{constructor(t){super(t);const{name:e,motionValue:s,element:i,keyframes:r}=this.options;this.resolver=new no(r,(o,a)=>this.onKeyframesResolved(o,a),e,s,i),this.resolver.scheduleResolve()}initPlayback(t,e){let{duration:s=300,times:i,ease:r,type:o,motionValue:a,name:l,startTime:c}=this.options;if(!a.owner||!a.owner.current)return!1;if(typeof r=="string"&&Ve()&&Bu(r)&&(r=ao[r]),Pu(this.options)){const{onComplete:h,onUpdate:d,motionValue:m,element:f,...g}=this.options,b=Ru(t,g);t=b.keyframes,t.length===1&&(t[1]=t[0]),s=b.duration,i=b.times,r=b.ease,o="keyframes"}const u=Fu(a.owner.current,l,t,{...this.options,duration:s,times:i,ease:r});return u.startTime=c??this.calcStartTime(),this.pendingTimeline?(yi(u,this.pendingTimeline),this.pendingTimeline=void 0):u.onfinish=()=>{const{onComplete:h}=this.options;a.set(qe(t,this.options,e)),h&&h(),this.cancel(),this.resolveFinishedPromise()},{animation:u,duration:s,times:i,type:o,ease:r,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:e}=t;return st(e)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:e}=t;return st(e.currentTime||0)}set time(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.currentTime=nt(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:e}=t;return e.playbackRate}set speed(t){const{resolved:e}=this;if(!e)return;const{animation:s}=e;s.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:e}=t;return e.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:e}=t;return e.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:e}=this;if(!e)return Et;const{animation:s}=e;yi(s,t)}return Et}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.playState==="finished"&&this.updateFinishedPromise(),e.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:e}=t;e.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:e,keyframes:s,duration:i,type:r,ease:o,times:a}=t;if(e.playState==="idle"||e.playState==="finished")return;if(this.time){const{motionValue:c,onUpdate:u,onComplete:h,element:d,...m}=this.options,f=new as({...m,keyframes:s,duration:i,type:r,ease:o,times:a,isGenerator:!0}),g=nt(this.time);c.setWithVelocity(f.sample(g-Re).value,f.sample(g).value,Re)}const{onStop:l}=this.options;l&&l(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:e,name:s,repeatDelay:i,repeatType:r,damping:o,type:a}=t;if(!e||!e.owner||!(e.owner.current instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:c}=e.owner.getProps();return Vu()&&s&&Lu.has(s)&&(s!=="transform"||!c)&&!l&&!i&&r!=="mirror"&&o!==0&&a!=="inertia"}}const Iu={type:"spring",stiffness:500,damping:25,restSpeed:10},Nu=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),$u={type:"keyframes",duration:.8},ju={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},Ku=(n,{keyframes:t})=>t.length>2?$u:Bt.has(n)?n.startsWith("scale")?Nu(t[1]):Iu:ju;function Hu({when:n,delay:t,delayChildren:e,staggerChildren:s,staggerDirection:i,repeat:r,repeatType:o,repeatDelay:a,from:l,elapsed:c,...u}){return!!Object.keys(u).length}const lo=(n,t,e,s={},i,r)=>o=>{const a=Cr(s,n)||{},l=a.delay||s.delay||0;let{elapsed:c=0}=s;c=c-nt(l);let u={keyframes:Array.isArray(e)?e:[null,e],ease:"easeOut",velocity:t.getVelocity(),...a,delay:-c,onUpdate:d=>{t.set(d),a.onUpdate&&a.onUpdate(d)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:n,motionValue:t,element:r?void 0:i};Hu(a)||(u={...u,...Ku(n,u)}),u.duration&&(u.duration=nt(u.duration)),u.repeatDelay&&(u.repeatDelay=nt(u.repeatDelay)),u.from!==void 0&&(u.keyframes[0]=u.from);let h=!1;if((u.type===!1||u.duration===0&&!u.repeatDelay)&&(u.duration=0,u.delay===0&&(h=!0)),u.allowFlatten=!a.type&&!a.ease,h&&!r&&t.get()!==void 0){const d=qe(u.keyframes,a);if(d!==void 0)return Z.update(()=>{u.onUpdate(d),u.onComplete()}),new wr([])}return!r&&Vi.supports(u)?new Vi(u):new as(u)};function Uu({protectedKeys:n,needsAnimating:t},e){const s=n.hasOwnProperty(e)&&t[e]!==!0;return t[e]=!1,s}function Wu(n,t,{delay:e=0,transitionOverride:s,type:i}={}){var r;let{transition:o=n.getDefaultTransition(),transitionEnd:a,...l}=t;s&&(o=s);const c=[],u=i&&n.animationState&&n.animationState.getState()[i];for(const h in l){const d=n.getValue(h,(r=n.latestValues[h])!==null&&r!==void 0?r:null),m=l[h];if(m===void 0||u&&Uu(u,h))continue;const f={delay:e,...Cr(o||{},h)};let g=!1;if(window.MotionHandoffAnimation){const p=wc(n);if(p){const v=window.MotionHandoffAnimation(p,h,Z);v!==null&&(f.startTime=v,g=!0)}}bc(n,h),d.start(lo(h,d,m,n.shouldReduceMotion&&kr.has(h)?{type:!1}:f,n,g));const b=d.animation;b&&c.push(b)}return a&&Promise.all(c).then(()=>{Z.update(()=>{a&&pc(n,a)})}),c}function zu(n){return n instanceof SVGElement&&n.tagName!=="svg"}const _i=()=>({min:0,max:0}),ls=()=>({x:_i(),y:_i()}),Pi={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Ln={};for(const n in Pi)Ln[n]={isEnabled:t=>Pi[n].some(e=>!!t[e])};const qu=typeof window<"u",Fn={current:null},co={current:!1};function Yu(){if(co.current=!0,!!qu)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),t=()=>Fn.current=n.matches;n.addListener(t),t()}else Fn.current=!1}const Xu=[...eo,_,Nt],Gu=n=>Xu.find(to(n));function Zu(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function Qu(n){return typeof n=="string"||Array.isArray(n)}const Ju=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],th=["initial",...Ju];function uo(n){return Zu(n.animate)||th.some(t=>Qu(n[t]))}function eh(n){return!!(uo(n)||n.variants)}function nh(n,t,e){for(const s in t){const i=t[s],r=e[s];if(P(i))n.addValue(s,i);else if(P(r))n.addValue(s,ae(i,{owner:n}));else if(r!==i)if(n.hasValue(s)){const o=n.getValue(s);o.liveStyle===!0?o.jump(i):o.hasAnimated||o.set(i)}else{const o=n.getStaticValue(s);n.addValue(s,ae(o!==void 0?o:i,{owner:n}))}}for(const s in e)t[s]===void 0&&n.removeValue(s);return t}const Ri=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class ho{scrapeMotionValuesFromProps(t,e,s){return{}}constructor({parent:t,props:e,presenceContext:s,reducedMotionConfig:i,blockInitialAnimation:r,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=ss,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const m=at.now();this.renderScheduledAt<m&&(this.renderScheduledAt=m,Z.render(this.render,!1,!0))};const{latestValues:l,renderState:c,onUpdate:u}=o;this.onUpdate=u,this.latestValues=l,this.baseTarget={...l},this.initialValues=e.initial?{...l}:{},this.renderState=c,this.parent=t,this.props=e,this.presenceContext=s,this.depth=t?t.depth+1:0,this.reducedMotionConfig=i,this.options=a,this.blockInitialAnimation=!!r,this.isControllingVariants=uo(e),this.isVariantNode=eh(e),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(e,{},this);for(const m in d){const f=d[m];l[m]!==void 0&&P(f)&&f.set(l[m],!1)}}mount(t){this.current=t,le.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,s)=>this.bindToMotionValue(s,e)),co.current||Yu(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Fn.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),wn(this.notifyUpdate),wn(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const e=this.features[t];e&&(e.unmount(),e.isMounted=!1)}this.current=null}bindToMotionValue(t,e){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const s=Bt.has(t);s&&this.onBindTransform&&this.onBindTransform();const i=e.on("change",a=>{this.latestValues[t]=a,this.props.onUpdate&&Z.preRender(this.notifyUpdate),s&&this.projection&&(this.projection.isTransformDirty=!0)}),r=e.on("renderRequest",this.scheduleRender);let o;window.MotionCheckAppearSync&&(o=window.MotionCheckAppearSync(this,t,e)),this.valueSubscriptions.set(t,()=>{i(),r(),o&&o(),e.owner&&e.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in Ln){const e=Ln[t];if(!e)continue;const{isEnabled:s,Feature:i}=e;if(!this.features[t]&&i&&s(this.props)&&(this.features[t]=new i(this)),this.features[t]){const r=this.features[t];r.isMounted?r.update():(r.mount(),r.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ls()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,e){this.latestValues[t]=e}update(t,e){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=e;for(let s=0;s<Ri.length;s++){const i=Ri[s];this.propEventSubscriptions[i]&&(this.propEventSubscriptions[i](),delete this.propEventSubscriptions[i]);const r="on"+i,o=t[r];o&&(this.propEventSubscriptions[i]=this.on(i,o))}this.prevMotionValues=nh(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const e=this.getClosestVariantNode();if(e)return e.variantChildren&&e.variantChildren.add(t),()=>e.variantChildren.delete(t)}addValue(t,e){const s=this.values.get(t);e!==s&&(s&&this.removeValue(t),this.bindToMotionValue(t,e),this.values.set(t,e),this.latestValues[t]=e.get())}removeValue(t){this.values.delete(t);const e=this.valueSubscriptions.get(t);e&&(e(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,e){if(this.props.values&&this.props.values[t])return this.props.values[t];let s=this.values.get(t);return s===void 0&&e!==void 0&&(s=ae(e===null?void 0:e,{owner:this}),this.addValue(t,s)),s}readValue(t,e){var s;let i=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(s=this.getBaseTargetFromProps(this.props,t))!==null&&s!==void 0?s:this.readValueFromInstance(this.current,t,this.options);return i!=null&&(typeof i=="string"&&(Gr(i)||$r(i))?i=parseFloat(i):!Gu(i)&&Nt.test(e)&&(i=qr(t,e)),this.setBaseTarget(t,P(i)?i.get():i)),P(i)?i.get():i}setBaseTarget(t,e){this.baseTarget[t]=e}getBaseTarget(t){var e;const{initial:s}=this.props;let i;if(typeof s=="string"||typeof s=="object"){const o=Dr(this.props,s,(e=this.presenceContext)===null||e===void 0?void 0:e.custom);o&&(i=o[t])}if(s&&i!==void 0)return i;const r=this.getBaseTargetFromProps(this.props,t);return r!==void 0&&!P(r)?r:this.initialValues[t]!==void 0&&i===void 0?void 0:this.baseTarget[t]}on(t,e){return this.events[t]||(this.events[t]=new yr),this.events[t].add(e)}notify(t,...e){this.events[t]&&this.events[t].notify(...e)}}class fo extends ho{constructor(){super(...arguments),this.KeyframeResolver=no}sortInstanceNodePosition(t,e){return t.compareDocumentPosition(e)&2?1:-1}getBaseTargetFromProps(t,e){return t.style?t.style[e]:void 0}removeValueFromRenderState(t,{vars:e,style:s}){delete e[t],delete s[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;P(t)&&(this.childSubscription=t.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}const mo=(n,t)=>t&&typeof n=="number"?t.transform(n):n,sh={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},ih=Rt.length;function rh(n,t,e){let s="",i=!0;for(let r=0;r<ih;r++){const o=Rt[r],a=n[o];if(a===void 0)continue;let l=!0;if(typeof a=="number"?l=a===(o.startsWith("scale")?1:0):l=parseFloat(a)===0,!l||e){const c=mo(a,ns[o]);if(!l){i=!1;const u=sh[o]||o;s+=`${u}(${c}) `}e&&(t[o]=c)}}return s=s.trim(),e?s=e(t,i?"":s):i&&(s="none"),s}function po(n,t,e){const{style:s,vars:i,transformOrigin:r}=n;let o=!1,a=!1;for(const l in t){const c=t[l];if(Bt.has(l)){o=!0;continue}else if(Qr(l)){i[l]=c;continue}else{const u=mo(c,ns[l]);l.startsWith("origin")?(a=!0,r[l]=u):s[l]=u}}if(t.transform||(o||e?s.transform=rh(t,n.transform,e):s.transform&&(s.transform="none")),a){const{originX:l="50%",originY:c="50%",originZ:u=0}=r;s.transformOrigin=`${l} ${c} ${u}`}}const oh={offset:"stroke-dashoffset",array:"stroke-dasharray"},ah={offset:"strokeDashoffset",array:"strokeDasharray"};function lh(n,t,e=1,s=0,i=!0){n.pathLength=1;const r=i?oh:ah;n[r.offset]=x.transform(-s);const o=x.transform(t),a=x.transform(e);n[r.array]=`${o} ${a}`}function Bi(n,t,e){return typeof n=="string"?n:x.transform(t+e*n)}function ch(n,t,e){const s=Bi(t,n.x,n.width),i=Bi(e,n.y,n.height);return`${s} ${i}`}function uh(n,{attrX:t,attrY:e,attrScale:s,originX:i,originY:r,pathLength:o,pathSpacing:a=1,pathOffset:l=0,...c},u,h){if(po(n,c,h),u){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:d,style:m,dimensions:f}=n;d.transform&&(f&&(m.transform=d.transform),delete d.transform),f&&(i!==void 0||r!==void 0||m.transform)&&(m.transformOrigin=ch(f,i!==void 0?i:.5,r!==void 0?r:.5)),t!==void 0&&(d.x=t),e!==void 0&&(d.y=e),s!==void 0&&(d.scale=s),o!==void 0&&lh(d,o,a,l,!1)}const go=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),hh=n=>typeof n=="string"&&n.toLowerCase()==="svg";function dh(n,t){try{t.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}function bo(n,{style:t,vars:e},s,i){Object.assign(n.style,t,i&&i.getProjectionStyles(s));for(const r in e)n.style.setProperty(r,e[r])}function fh(n,t,e,s){bo(n,t,void 0,s);for(const i in t.attrs)n.setAttribute(go.has(i)?i:Gn(i),t.attrs[i])}const mh={};function ph(n,{layout:t,layoutId:e}){return Bt.has(n)||n.startsWith("origin")||(t||e!==void 0)&&(!!mh[n]||n==="opacity")}function yo(n,t,e){var s;const{style:i}=n,r={};for(const o in i)(P(i[o])||t.style&&P(t.style[o])||ph(o,n)||((s=e==null?void 0:e.getValue(o))===null||s===void 0?void 0:s.liveStyle)!==void 0)&&(r[o]=i[o]);return r}function gh(n,t,e){const s=yo(n,t,e);for(const i in n)if(P(n[i])||P(t[i])){const r=Rt.indexOf(i)!==-1?"attr"+i.charAt(0).toUpperCase()+i.substring(1):i;s[r]=n[i]}return s}class bh extends fo{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ls,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&dh(this.current,this.renderState)}}getBaseTargetFromProps(t,e){return t[e]}readValueFromInstance(t,e){if(Bt.has(e)){const s=zr(e);return s&&s.default||0}return e=go.has(e)?e:Gn(e),t.getAttribute(e)}scrapeMotionValuesFromProps(t,e,s){return gh(t,e,s)}onBindTransform(){this.current&&!this.renderState.dimensions&&Z.postRender(this.updateDimensions)}build(t,e,s){uh(t,e,this.isSVGTag,s.transformTemplate)}renderInstance(t,e,s,i){fh(t,e,s,i)}mount(t){this.isSVGTag=hh(t.tagName),super.mount(t)}}function yh({top:n,left:t,right:e,bottom:s}){return{x:{min:t,max:e},y:{min:n,max:s}}}function vh(n,t){if(!t)return n;const e=t({x:n.left,y:n.top}),s=t({x:n.right,y:n.bottom});return{top:e.y,left:e.x,bottom:s.y,right:s.x}}function wh(n,t){return yh(vh(n.getBoundingClientRect(),t))}function Eh(n){return window.getComputedStyle(n)}class Th extends fo{constructor(){super(...arguments),this.type="html",this.renderInstance=bo}readValueFromInstance(t,e){if(Bt.has(e))return Zc(t,e);{const s=Eh(t),i=(Qr(e)?s.getPropertyValue(e):s[e])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(t,{transformPagePoint:e}){return wh(t,e)}build(t,e,s){po(t,e,s.transformTemplate)}scrapeMotionValuesFromProps(t,e,s){return yo(t,e,s)}}function Ah(n,t){return n in t}class xh extends ho{constructor(){super(...arguments),this.type="object"}readValueFromInstance(t,e){if(Ah(e,t)){const s=t[e];if(typeof s=="string"||typeof s=="number")return s}}getBaseTargetFromProps(){}removeValueFromRenderState(t,e){delete e.output[t]}measureInstanceViewportBox(){return ls()}build(t,e){Object.assign(t.output,e)}renderInstance(t,{output:e}){Object.assign(t,e)}sortInstanceNodePosition(){return 0}}function Sh(n){const t={presenceContext:null,props:{},visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},e=zu(n)?new bh(t):new Th(t);e.mount(n),le.set(n,e)}function Mh(n){const t={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},e=new xh(t);e.mount(n),le.set(n,e)}function Oh(n,t,e){const s=P(n)?n:ae(n);return s.start(lo("",s,t,e)),s.animation}function Ch(n,t){return P(n)||typeof n=="number"||typeof n=="string"&&!Xn(t)}function vo(n,t,e,s){const i=[];if(Ch(n,t))i.push(Oh(n,Xn(t)&&t.default||t,e&&(e.default||e)));else{const r=Or(n,t,s),o=r.length;for(let a=0;a<o;a++){const l=r[a],c=l instanceof Element?Sh:Mh;le.has(l)||c(l);const u=le.get(l),h={...e};"delay"in h&&typeof h.delay=="function"&&(h.delay=h.delay(a,o)),i.push(...Wu(u,{...t,transition:h},{}))}}return i}function kh(n,t,e){const s=[];return oc(n,t,e,{spring:Yn}).forEach(({keyframes:r,transition:o},a)=>{s.push(...vo(a,r,o))}),s}function Dh(n){return Array.isArray(n)&&n.some(Array.isArray)}function Lh(n){function t(e,s,i){let r=[];return Dh(e)?r=kh(e,s,n):r=vo(e,s,i,n),new wr(r)}return t}const an=Lh();let Fh=class extends I()({targets:{icon:HTMLElement,content:HTMLElement},values:{open:Boolean}}){connect(){this.animationDurationValue=.15,this.openValue?this.open():this.close()}toggle(){this.openValue=!this.openValue}openValueChanged(t){t?this.open():this.close()}open(){this.hasContentTarget&&(this.revealContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!0)}close(){this.hasContentTarget&&(this.hideContent(),this.hasIconTarget&&this.rotateIcon(),this.openValue=!1)}revealContent(){const t=this.contentTarget.scrollHeight;an(this.contentTarget,{height:`${t}px`},{duration:this.animationDurationValue,easing:"ease-in-out"})}hideContent(){an(this.contentTarget,{height:0},{duration:this.animationDurationValue,easing:"ease-in-out"})}rotateIcon(){an(this.iconTarget,{rotate:`${this.openValue?180:0}deg`})}};const Vh=Object.freeze(Object.defineProperty({__proto__:null,default:Fh},Symbol.toStringTag,{value:"Module"}));class _h extends I()({targets:{banner:HTMLDivElement},values:{open:Boolean,autohide:{default:4e3,type:Number}}}){connect(){if(this.autohideValue!=0){const t=()=>{};setTimeout(()=>{this.hide().then(t).catch(t)},this.autohideValue)}}dismiss(){this.remove(),this.dispatchEvent(this.bannerTarget,"ariadne-banner:dismiss")}show(){this.bannerTarget.style.setProperty("display","initial")}remove(){const t=this.bannerTarget.parentElement;t&&t.removeChild(this.bannerTarget)}hide(){this.bannerTarget.style.setProperty("display","none")}}const Ph=Object.freeze(Object.defineProperty({__proto__:null,default:_h},Symbol.toStringTag,{value:"Module"}));function Rh(n){const t=document.createElement("pre");return t.style.width="1px",t.style.height="1px",t.style.position="fixed",t.style.top="5px",t.textContent=n,t}function wo(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n.textContent||"");const t=getSelection();if(t==null)return Promise.reject(new Error);t.removeAllRanges();const e=document.createRange();return e.selectNodeContents(n),t.addRange(e),document.execCommand("copy"),t.removeAllRanges(),Promise.resolve()}function Vn(n){if("clipboard"in navigator)return navigator.clipboard.writeText(n);const t=document.body;if(!t)return Promise.reject(new Error);const e=Rh(n);return t.appendChild(e),wo(e),t.removeChild(e),Promise.resolve()}async function Eo(n){const t=n.getAttribute("for"),e=n.getAttribute("value");function s(){n.dispatchEvent(new CustomEvent("clipboard-copy",{bubbles:!0}))}if(n.getAttribute("aria-disabled")!=="true"){if(e)await Vn(e),s();else if(t){const i="getRootNode"in Element.prototype?n.getRootNode():n.ownerDocument;if(!(i instanceof Document||"ShadowRoot"in window&&i instanceof ShadowRoot))return;const r=i.getElementById(t);r&&(await Bh(r),s())}}}function Bh(n){return n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement?Vn(n.value):n instanceof HTMLAnchorElement&&n.hasAttribute("href")?Vn(n.href):wo(n)}function Ih(n){const t=n.currentTarget;t instanceof HTMLElement&&Eo(t)}function To(n){if(n.key===" "||n.key==="Enter"){const t=n.currentTarget;t instanceof HTMLElement&&(n.preventDefault(),Eo(t))}}function Nh(n){n.currentTarget.addEventListener("keydown",To)}function $h(n){n.currentTarget.removeEventListener("keydown",To)}class jh extends HTMLElement{static define(t="clipboard-copy",e=customElements){return e.define(t,this),this}constructor(){super(),this.addEventListener("click",Ih),this.addEventListener("focus",Nh),this.addEventListener("blur",$h)}connectedCallback(){this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button")}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}}const Ii=typeof globalThis<"u"?globalThis:window;try{Ii.ClipboardCopyElement=jh.define()}catch(n){if(!(Ii.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}const Kh=2e3;class Hh extends I()({targets:{initial:HTMLElement,confirmed:null},values:{hiddenClass:String,showClass:String}}){connect(){this.clipboardCopyElementTimers=new WeakMap}copy(t){var o;const e=t.target,s=this.clipboardCopyElementTimers.get(e),i=(o=e.parentNode)==null?void 0:o.querySelector("[data-clipboard-copy-feedback]"),r="Copied!";s?(clearTimeout(s),this.clipboardCopyElementTimers.delete(e)):(this.showConfirm(),i&&(i.textContent===r?i.textContent=`${r} `:i.textContent=r)),this.clipboardCopyElementTimers.set(e,window.setTimeout(()=>{this.showInitial(),this.hideConfirm(),this.clipboardCopyElementTimers.delete(e)},Kh))}showConfirm(){this.hasConfirmedTarget&&(this.confirmedTarget.classList.remove(this.hiddenClassValue),this.confirmedTarget.classList.add(this.showClassValue),this.initialTarget.classList.add(this.hiddenClassValue))}showInitial(){this.initialTarget.classList.remove(this.hiddenClassValue),this.initialTarget.classList.add(this.showClassValue),this.hasConfirmedTarget&&this.confirmedTarget.classList.add(this.hiddenClassValue)}hideConfirm(){this.hasConfirmedTarget&&this.confirmedTarget.classList.remove(this.showClassValue)}}const Uh=Object.freeze(Object.defineProperty({__proto__:null,default:Hh},Symbol.toStringTag,{value:"Module"})),lt=Math.min,$=Math.max,Be=Math.round,xe=Math.floor,G=n=>({x:n,y:n}),Wh={left:"right",right:"left",bottom:"top",top:"bottom"},zh={start:"end",end:"start"};function _n(n,t,e){return $(n,lt(t,e))}function $t(n,t){return typeof n=="function"?n(t):n}function ct(n){return n.split("-")[0]}function jt(n){return n.split("-")[1]}function Ao(n){return n==="x"?"y":"x"}function cs(n){return n==="y"?"height":"width"}function At(n){return["top","bottom"].includes(ct(n))?"y":"x"}function us(n){return Ao(At(n))}function qh(n,t,e){e===void 0&&(e=!1);const s=jt(n),i=us(n),r=cs(i);let o=i==="x"?s===(e?"end":"start")?"right":"left":s==="start"?"bottom":"top";return t.reference[r]>t.floating[r]&&(o=Ie(o)),[o,Ie(o)]}function Yh(n){const t=Ie(n);return[Pn(n),t,Pn(t)]}function Pn(n){return n.replace(/start|end/g,t=>zh[t])}function Xh(n,t,e){const s=["left","right"],i=["right","left"],r=["top","bottom"],o=["bottom","top"];switch(n){case"top":case"bottom":return e?t?i:s:t?s:i;case"left":case"right":return t?r:o;default:return[]}}function Gh(n,t,e,s){const i=jt(n);let r=Xh(ct(n),e==="start",s);return i&&(r=r.map(o=>o+"-"+i),t&&(r=r.concat(r.map(Pn)))),r}function Ie(n){return n.replace(/left|right|bottom|top/g,t=>Wh[t])}function Zh(n){return{top:0,right:0,bottom:0,left:0,...n}}function xo(n){return typeof n!="number"?Zh(n):{top:n,right:n,bottom:n,left:n}}function Ne(n){const{x:t,y:e,width:s,height:i}=n;return{width:s,height:i,top:e,left:t,right:t+s,bottom:e+i,x:t,y:e}}function Ni(n,t,e){let{reference:s,floating:i}=n;const r=At(t),o=us(t),a=cs(o),l=ct(t),c=r==="y",u=s.x+s.width/2-i.width/2,h=s.y+s.height/2-i.height/2,d=s[a]/2-i[a]/2;let m;switch(l){case"top":m={x:u,y:s.y-i.height};break;case"bottom":m={x:u,y:s.y+s.height};break;case"right":m={x:s.x+s.width,y:h};break;case"left":m={x:s.x-i.width,y:h};break;default:m={x:s.x,y:s.y}}switch(jt(t)){case"start":m[o]-=d*(e&&c?-1:1);break;case"end":m[o]+=d*(e&&c?-1:1);break}return m}const Qh=async(n,t,e)=>{const{placement:s="bottom",strategy:i="absolute",middleware:r=[],platform:o}=e,a=r.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:n,floating:t,strategy:i}),{x:u,y:h}=Ni(c,s,l),d=s,m={},f=0;for(let g=0;g<a.length;g++){const{name:b,fn:p}=a[g],{x:v,y:E,data:w,reset:y}=await p({x:u,y:h,initialPlacement:s,placement:d,strategy:i,middlewareData:m,rects:c,platform:o,elements:{reference:n,floating:t}});u=v??u,h=E??h,m={...m,[b]:{...m[b],...w}},y&&f<=50&&(f++,typeof y=="object"&&(y.placement&&(d=y.placement),y.rects&&(c=y.rects===!0?await o.getElementRects({reference:n,floating:t,strategy:i}):y.rects),{x:u,y:h}=Ni(c,d,l)),g=-1)}return{x:u,y:h,placement:d,strategy:i,middlewareData:m}};async function hs(n,t){var e;t===void 0&&(t={});const{x:s,y:i,platform:r,rects:o,elements:a,strategy:l}=n,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:m=0}=$t(t,n),f=xo(m),b=a[d?h==="floating"?"reference":"floating":h],p=Ne(await r.getClippingRect({element:(e=await(r.isElement==null?void 0:r.isElement(b)))==null||e?b:b.contextElement||await(r.getDocumentElement==null?void 0:r.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),v=h==="floating"?{x:s,y:i,width:o.floating.width,height:o.floating.height}:o.reference,E=await(r.getOffsetParent==null?void 0:r.getOffsetParent(a.floating)),w=await(r.isElement==null?void 0:r.isElement(E))?await(r.getScale==null?void 0:r.getScale(E))||{x:1,y:1}:{x:1,y:1},y=Ne(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:E,strategy:l}):v);return{top:(p.top-y.top+f.top)/w.y,bottom:(y.bottom-p.bottom+f.bottom)/w.y,left:(p.left-y.left+f.left)/w.x,right:(y.right-p.right+f.right)/w.x}}const Jh=n=>({name:"arrow",options:n,async fn(t){const{x:e,y:s,placement:i,rects:r,platform:o,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=$t(n,t)||{};if(c==null)return{};const h=xo(u),d={x:e,y:s},m=us(i),f=cs(m),g=await o.getDimensions(c),b=m==="y",p=b?"top":"left",v=b?"bottom":"right",E=b?"clientHeight":"clientWidth",w=r.reference[f]+r.reference[m]-d[m]-r.floating[f],y=d[m]-r.reference[m],T=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let S=T?T[E]:0;(!S||!await(o.isElement==null?void 0:o.isElement(T)))&&(S=a.floating[E]||r.floating[f]);const A=w/2-y/2,M=S/2-g[f]/2-1,O=lt(h[p],M),L=lt(h[v],M),B=O,N=S-g[f]-L,V=S/2-g[f]/2+A,ht=_n(B,V,N),W=!l.arrow&&jt(i)!=null&&V!==ht&&r.reference[f]/2-(V<B?O:L)-g[f]/2<0,F=W?V<B?V-B:V-N:0;return{[m]:d[m]+F,data:{[m]:ht,centerOffset:V-ht-F,...W&&{alignmentOffset:F}},reset:W}}}),td=function(n){return n===void 0&&(n={}),{name:"flip",options:n,async fn(t){var e,s;const{placement:i,middlewareData:r,rects:o,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:f="none",flipAlignment:g=!0,...b}=$t(n,t);if((e=r.arrow)!=null&&e.alignmentOffset)return{};const p=ct(i),v=At(a),E=ct(a)===a,w=await(l.isRTL==null?void 0:l.isRTL(c.floating)),y=d||(E||!g?[Ie(a)]:Yh(a)),T=f!=="none";!d&&T&&y.push(...Gh(a,g,f,w));const S=[a,...y],A=await hs(t,b),M=[];let O=((s=r.flip)==null?void 0:s.overflows)||[];if(u&&M.push(A[p]),h){const V=qh(i,o,w);M.push(A[V[0]],A[V[1]])}if(O=[...O,{placement:i,overflows:M}],!M.every(V=>V<=0)){var L,B;const V=(((L=r.flip)==null?void 0:L.index)||0)+1,ht=S[V];if(ht)return{data:{index:V,overflows:O},reset:{placement:ht}};let W=(B=O.filter(F=>F.overflows[0]<=0).sort((F,D)=>F.overflows[1]-D.overflows[1])[0])==null?void 0:B.placement;if(!W)switch(m){case"bestFit":{var N;const F=(N=O.filter(D=>{if(T){const z=At(D.placement);return z===v||z==="y"}return!0}).map(D=>[D.placement,D.overflows.filter(z=>z>0).reduce((z,ye)=>z+ye,0)]).sort((D,z)=>D[1]-z[1])[0])==null?void 0:N[0];F&&(W=F);break}case"initialPlacement":W=a;break}if(i!==W)return{reset:{placement:W}}}return{}}}};async function ed(n,t){const{placement:e,platform:s,elements:i}=n,r=await(s.isRTL==null?void 0:s.isRTL(i.floating)),o=ct(e),a=jt(e),l=At(e)==="y",c=["left","top"].includes(o)?-1:1,u=r&&l?-1:1,h=$t(t,n);let{mainAxis:d,crossAxis:m,alignmentAxis:f}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof f=="number"&&(m=a==="end"?f*-1:f),l?{x:m*u,y:d*c}:{x:d*c,y:m*u}}const nd=function(n){return n===void 0&&(n=0),{name:"offset",options:n,async fn(t){var e,s;const{x:i,y:r,placement:o,middlewareData:a}=t,l=await ed(t,n);return o===((e=a.offset)==null?void 0:e.placement)&&(s=a.arrow)!=null&&s.alignmentOffset?{}:{x:i+l.x,y:r+l.y,data:{...l,placement:o}}}}},sd=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(t){const{x:e,y:s,placement:i}=t,{mainAxis:r=!0,crossAxis:o=!1,limiter:a={fn:b=>{let{x:p,y:v}=b;return{x:p,y:v}}},...l}=$t(n,t),c={x:e,y:s},u=await hs(t,l),h=At(ct(i)),d=Ao(h);let m=c[d],f=c[h];if(r){const b=d==="y"?"top":"left",p=d==="y"?"bottom":"right",v=m+u[b],E=m-u[p];m=_n(v,m,E)}if(o){const b=h==="y"?"top":"left",p=h==="y"?"bottom":"right",v=f+u[b],E=f-u[p];f=_n(v,f,E)}const g=a.fn({...t,[d]:m,[h]:f});return{...g,data:{x:g.x-e,y:g.y-s,enabled:{[d]:r,[h]:o}}}}}},id=function(n){return n===void 0&&(n={}),{name:"size",options:n,async fn(t){var e,s;const{placement:i,rects:r,platform:o,elements:a}=t,{apply:l=()=>{},...c}=$t(n,t),u=await hs(t,c),h=ct(i),d=jt(i),m=At(i)==="y",{width:f,height:g}=r.floating;let b,p;h==="top"||h==="bottom"?(b=h,p=d===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(p=h,b=d==="end"?"top":"bottom");const v=g-u.top-u.bottom,E=f-u.left-u.right,w=lt(g-u[b],v),y=lt(f-u[p],E),T=!t.middlewareData.shift;let S=w,A=y;if((e=t.middlewareData.shift)!=null&&e.enabled.x&&(A=E),(s=t.middlewareData.shift)!=null&&s.enabled.y&&(S=v),T&&!d){const O=$(u.left,0),L=$(u.right,0),B=$(u.top,0),N=$(u.bottom,0);m?A=f-2*(O!==0||L!==0?O+L:$(u.left,u.right)):S=g-2*(B!==0||N!==0?B+N:$(u.top,u.bottom))}await l({...t,availableWidth:A,availableHeight:S});const M=await o.getDimensions(a.floating);return f!==M.width||g!==M.height?{reset:{rects:!0}}:{}}}};function Ye(){return typeof window<"u"}function Kt(n){return So(n)?(n.nodeName||"").toLowerCase():"#document"}function K(n){var t;return(n==null||(t=n.ownerDocument)==null?void 0:t.defaultView)||window}function J(n){var t;return(t=(So(n)?n.ownerDocument:n.document)||window.document)==null?void 0:t.documentElement}function So(n){return Ye()?n instanceof Node||n instanceof K(n).Node:!1}function Y(n){return Ye()?n instanceof Element||n instanceof K(n).Element:!1}function Q(n){return Ye()?n instanceof HTMLElement||n instanceof K(n).HTMLElement:!1}function $i(n){return!Ye()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof K(n).ShadowRoot}function be(n){const{overflow:t,overflowX:e,overflowY:s,display:i}=X(n);return/auto|scroll|overlay|hidden|clip/.test(t+s+e)&&!["inline","contents"].includes(i)}function rd(n){return["table","td","th"].includes(Kt(n))}function Xe(n){return[":popover-open",":modal"].some(t=>{try{return n.matches(t)}catch{return!1}})}function ds(n){const t=fs(),e=Y(n)?X(n):n;return["transform","translate","scale","rotate","perspective"].some(s=>e[s]?e[s]!=="none":!1)||(e.containerType?e.containerType!=="normal":!1)||!t&&(e.backdropFilter?e.backdropFilter!=="none":!1)||!t&&(e.filter?e.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(s=>(e.willChange||"").includes(s))||["paint","layout","strict","content"].some(s=>(e.contain||"").includes(s))}function od(n){let t=ut(n);for(;Q(t)&&!Pt(t);){if(ds(t))return t;if(Xe(t))return null;t=ut(t)}return null}function fs(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Pt(n){return["html","body","#document"].includes(Kt(n))}function X(n){return K(n).getComputedStyle(n)}function Ge(n){return Y(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ut(n){if(Kt(n)==="html")return n;const t=n.assignedSlot||n.parentNode||$i(n)&&n.host||J(n);return $i(t)?t.host:t}function Mo(n){const t=ut(n);return Pt(t)?n.ownerDocument?n.ownerDocument.body:n.body:Q(t)&&be(t)?t:Mo(t)}function he(n,t,e){var s;t===void 0&&(t=[]),e===void 0&&(e=!0);const i=Mo(n),r=i===((s=n.ownerDocument)==null?void 0:s.body),o=K(i);if(r){const a=Rn(o);return t.concat(o,o.visualViewport||[],be(i)?i:[],a&&e?he(a):[])}return t.concat(i,he(i,[],e))}function Rn(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Oo(n){const t=X(n);let e=parseFloat(t.width)||0,s=parseFloat(t.height)||0;const i=Q(n),r=i?n.offsetWidth:e,o=i?n.offsetHeight:s,a=Be(e)!==r||Be(s)!==o;return a&&(e=r,s=o),{width:e,height:s,$:a}}function ms(n){return Y(n)?n:n.contextElement}function Ft(n){const t=ms(n);if(!Q(t))return G(1);const e=t.getBoundingClientRect(),{width:s,height:i,$:r}=Oo(t);let o=(r?Be(e.width):e.width)/s,a=(r?Be(e.height):e.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const ad=G(0);function Co(n){const t=K(n);return!fs()||!t.visualViewport?ad:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ld(n,t,e){return t===void 0&&(t=!1),!e||t&&e!==K(n)?!1:t}function xt(n,t,e,s){t===void 0&&(t=!1),e===void 0&&(e=!1);const i=n.getBoundingClientRect(),r=ms(n);let o=G(1);t&&(s?Y(s)&&(o=Ft(s)):o=Ft(n));const a=ld(r,e,s)?Co(r):G(0);let l=(i.left+a.x)/o.x,c=(i.top+a.y)/o.y,u=i.width/o.x,h=i.height/o.y;if(r){const d=K(r),m=s&&Y(s)?K(s):s;let f=d,g=Rn(f);for(;g&&s&&m!==f;){const b=Ft(g),p=g.getBoundingClientRect(),v=X(g),E=p.left+(g.clientLeft+parseFloat(v.paddingLeft))*b.x,w=p.top+(g.clientTop+parseFloat(v.paddingTop))*b.y;l*=b.x,c*=b.y,u*=b.x,h*=b.y,l+=E,c+=w,f=K(g),g=Rn(f)}}return Ne({width:u,height:h,x:l,y:c})}function ps(n,t){const e=Ge(n).scrollLeft;return t?t.left+e:xt(J(n)).left+e}function ko(n,t,e){e===void 0&&(e=!1);const s=n.getBoundingClientRect(),i=s.left+t.scrollLeft-(e?0:ps(n,s)),r=s.top+t.scrollTop;return{x:i,y:r}}function cd(n){let{elements:t,rect:e,offsetParent:s,strategy:i}=n;const r=i==="fixed",o=J(s),a=t?Xe(t.floating):!1;if(s===o||a&&r)return e;let l={scrollLeft:0,scrollTop:0},c=G(1);const u=G(0),h=Q(s);if((h||!h&&!r)&&((Kt(s)!=="body"||be(o))&&(l=Ge(s)),Q(s))){const m=xt(s);c=Ft(s),u.x=m.x+s.clientLeft,u.y=m.y+s.clientTop}const d=o&&!h&&!r?ko(o,l,!0):G(0);return{width:e.width*c.x,height:e.height*c.y,x:e.x*c.x-l.scrollLeft*c.x+u.x+d.x,y:e.y*c.y-l.scrollTop*c.y+u.y+d.y}}function ud(n){return Array.from(n.getClientRects())}function hd(n){const t=J(n),e=Ge(n),s=n.ownerDocument.body,i=$(t.scrollWidth,t.clientWidth,s.scrollWidth,s.clientWidth),r=$(t.scrollHeight,t.clientHeight,s.scrollHeight,s.clientHeight);let o=-e.scrollLeft+ps(n);const a=-e.scrollTop;return X(s).direction==="rtl"&&(o+=$(t.clientWidth,s.clientWidth)-i),{width:i,height:r,x:o,y:a}}function dd(n,t){const e=K(n),s=J(n),i=e.visualViewport;let r=s.clientWidth,o=s.clientHeight,a=0,l=0;if(i){r=i.width,o=i.height;const c=fs();(!c||c&&t==="fixed")&&(a=i.offsetLeft,l=i.offsetTop)}return{width:r,height:o,x:a,y:l}}function fd(n,t){const e=xt(n,!0,t==="fixed"),s=e.top+n.clientTop,i=e.left+n.clientLeft,r=Q(n)?Ft(n):G(1),o=n.clientWidth*r.x,a=n.clientHeight*r.y,l=i*r.x,c=s*r.y;return{width:o,height:a,x:l,y:c}}function ji(n,t,e){let s;if(t==="viewport")s=dd(n,e);else if(t==="document")s=hd(J(n));else if(Y(t))s=fd(t,e);else{const i=Co(n);s={x:t.x-i.x,y:t.y-i.y,width:t.width,height:t.height}}return Ne(s)}function Do(n,t){const e=ut(n);return e===t||!Y(e)||Pt(e)?!1:X(e).position==="fixed"||Do(e,t)}function md(n,t){const e=t.get(n);if(e)return e;let s=he(n,[],!1).filter(a=>Y(a)&&Kt(a)!=="body"),i=null;const r=X(n).position==="fixed";let o=r?ut(n):n;for(;Y(o)&&!Pt(o);){const a=X(o),l=ds(o);!l&&a.position==="fixed"&&(i=null),(r?!l&&!i:!l&&a.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||be(o)&&!l&&Do(n,o))?s=s.filter(u=>u!==o):i=a,o=ut(o)}return t.set(n,s),s}function pd(n){let{element:t,boundary:e,rootBoundary:s,strategy:i}=n;const o=[...e==="clippingAncestors"?Xe(t)?[]:md(t,this._c):[].concat(e),s],a=o[0],l=o.reduce((c,u)=>{const h=ji(t,u,i);return c.top=$(h.top,c.top),c.right=lt(h.right,c.right),c.bottom=lt(h.bottom,c.bottom),c.left=$(h.left,c.left),c},ji(t,a,i));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function gd(n){const{width:t,height:e}=Oo(n);return{width:t,height:e}}function bd(n,t,e){const s=Q(t),i=J(t),r=e==="fixed",o=xt(n,!0,r,t);let a={scrollLeft:0,scrollTop:0};const l=G(0);if(s||!s&&!r)if((Kt(t)!=="body"||be(i))&&(a=Ge(t)),s){const d=xt(t,!0,r,t);l.x=d.x+t.clientLeft,l.y=d.y+t.clientTop}else i&&(l.x=ps(i));const c=i&&!s&&!r?ko(i,a):G(0),u=o.left+a.scrollLeft-l.x-c.x,h=o.top+a.scrollTop-l.y-c.y;return{x:u,y:h,width:o.width,height:o.height}}function ln(n){return X(n).position==="static"}function Ki(n,t){if(!Q(n)||X(n).position==="fixed")return null;if(t)return t(n);let e=n.offsetParent;return J(n)===e&&(e=e.ownerDocument.body),e}function Lo(n,t){const e=K(n);if(Xe(n))return e;if(!Q(n)){let i=ut(n);for(;i&&!Pt(i);){if(Y(i)&&!ln(i))return i;i=ut(i)}return e}let s=Ki(n,t);for(;s&&rd(s)&&ln(s);)s=Ki(s,t);return s&&Pt(s)&&ln(s)&&!ds(s)?e:s||od(n)||e}const yd=async function(n){const t=this.getOffsetParent||Lo,e=this.getDimensions,s=await e(n.floating);return{reference:bd(n.reference,await t(n.floating),n.strategy),floating:{x:0,y:0,width:s.width,height:s.height}}};function vd(n){return X(n).direction==="rtl"}const wd={convertOffsetParentRelativeRectToViewportRelativeRect:cd,getDocumentElement:J,getClippingRect:pd,getOffsetParent:Lo,getElementRects:yd,getClientRects:ud,getDimensions:gd,getScale:Ft,isElement:Y,isRTL:vd};function Fo(n,t){return n.x===t.x&&n.y===t.y&&n.width===t.width&&n.height===t.height}function Ed(n,t){let e=null,s;const i=J(n);function r(){var a;clearTimeout(s),(a=e)==null||a.disconnect(),e=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),r();const c=n.getBoundingClientRect(),{left:u,top:h,width:d,height:m}=c;if(a||t(),!d||!m)return;const f=xe(h),g=xe(i.clientWidth-(u+d)),b=xe(i.clientHeight-(h+m)),p=xe(u),E={rootMargin:-f+"px "+-g+"px "+-b+"px "+-p+"px",threshold:$(0,lt(1,l))||1};let w=!0;function y(T){const S=T[0].intersectionRatio;if(S!==l){if(!w)return o();S?o(!1,S):s=setTimeout(()=>{o(!1,1e-7)},1e3)}S===1&&!Fo(c,n.getBoundingClientRect())&&o(),w=!1}try{e=new IntersectionObserver(y,{...E,root:i.ownerDocument})}catch{e=new IntersectionObserver(y,E)}e.observe(n)}return o(!0),r}function Vo(n,t,e,s){s===void 0&&(s={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=s,c=ms(n),u=i||r?[...c?he(c):[],...he(t)]:[];u.forEach(p=>{i&&p.addEventListener("scroll",e,{passive:!0}),r&&p.addEventListener("resize",e)});const h=c&&a?Ed(c,e):null;let d=-1,m=null;o&&(m=new ResizeObserver(p=>{let[v]=p;v&&v.target===c&&m&&(m.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var E;(E=m)==null||E.observe(t)})),e()}),c&&!l&&m.observe(c),m.observe(t));let f,g=l?xt(n):null;l&&b();function b(){const p=xt(n);g&&!Fo(g,p)&&e(),g=p,f=requestAnimationFrame(b)}return e(),()=>{var p;u.forEach(v=>{i&&v.removeEventListener("scroll",e),r&&v.removeEventListener("resize",e)}),h==null||h(),(p=m)==null||p.disconnect(),m=null,l&&cancelAnimationFrame(f)}}const gs=nd,bs=sd,ys=td,Td=id,Ad=Jh,vs=(n,t,e)=>{const s=new Map,i={platform:wd,...e},r={...i.platform,_c:s};return Qh(n,t,{...i,platform:r})},Hi=(n,t)=>{const e=n[t];return typeof e=="function"?e:(...s)=>{}},Bn=(n,t,e)=>{let s=n;return e===!0?s=`${t.identifier}:${n}`:typeof e=="string"&&(s=`${e}:${n}`),s},In=(n,t,e)=>{const{bubbles:s,cancelable:i,composed:r}=t||{bubbles:!0,cancelable:!0,composed:!0};return t&&Object.assign(e,{originalEvent:t}),new CustomEvent(n,{bubbles:s,cancelable:i,composed:r,detail:e})};function xd(n){const t=n.getBoundingClientRect(),e=window.innerHeight||document.documentElement.clientHeight,s=window.innerWidth||document.documentElement.clientWidth,i=t.top<=e&&t.top+t.height>0,r=t.left<=s&&t.left+t.width>0;return i&&r}function Sd(n,t){var e={};for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&t.indexOf(s)<0&&(e[s]=n[s]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,s=Object.getOwnPropertySymbols(n);i<s.length;i++)t.indexOf(s[i])<0&&Object.prototype.propertyIsEnumerable.call(n,s[i])&&(e[s[i]]=n[s[i]]);return e}const cn={debug:!1,logger:console,dispatchEvent:!0,eventPrefix:!0};class Md{constructor(t,e={}){var s,i,r;this.log=(l,c)=>{this.debug&&(this.logger.groupCollapsed(`%c${this.controller.identifier} %c#${l}`,"color: #3B82F6","color: unset"),this.logger.log(Object.assign({controllerId:this.controllerId},c)),this.logger.groupEnd())},this.warn=l=>{this.logger.warn(`%c${this.controller.identifier} %c${l}`,"color: #3B82F6; font-weight: bold","color: unset")},this.dispatch=(l,c={})=>{if(this.dispatchEvent){const{event:u}=c,h=Sd(c,["event"]),d=this.extendedEvent(l,u||null,h);this.targetElement.dispatchEvent(d),this.log("dispatchEvent",Object.assign({eventName:d.type},h))}},this.call=(l,c={})=>{const u=this.controller[l];if(typeof u=="function")return u.call(this.controller,c)},this.extendedEvent=(l,c,u)=>{const{bubbles:h,cancelable:d,composed:m}=c||{bubbles:!0,cancelable:!0,composed:!0};return c&&Object.assign(u,{originalEvent:c}),new CustomEvent(this.composeEventName(l),{bubbles:h,cancelable:d,composed:m,detail:u})},this.composeEventName=l=>{let c=l;return this.eventPrefix===!0?c=`${this.controller.identifier}:${l}`:typeof this.eventPrefix=="string"&&(c=`${this.eventPrefix}:${l}`),c},this.debug=(i=(s=e==null?void 0:e.debug)!==null&&s!==void 0?s:t.application.stimulusUseDebug)!==null&&i!==void 0?i:cn.debug,this.logger=(r=e==null?void 0:e.logger)!==null&&r!==void 0?r:cn.logger,this.controller=t,this.controllerId=t.element.id||t.element.dataset.id,this.targetElement=(e==null?void 0:e.element)||t.element;const{dispatchEvent:o,eventPrefix:a}=Object.assign({},cn,e);Object.assign(this,{dispatchEvent:o,eventPrefix:a}),this.controllerInitialize=t.initialize.bind(t),this.controllerConnect=t.connect.bind(t),this.controllerDisconnect=t.disconnect.bind(t)}}const Od={events:["click","touchend"],onlyVisible:!0,dispatchEvent:!0,eventPrefix:!0},Cd=(n,t={})=>{const e=n,{onlyVisible:s,dispatchEvent:i,events:r,eventPrefix:o}=Object.assign({},Od,t),a=h=>{const d=(t==null?void 0:t.element)||e.element;if(!(d.contains(h.target)||!xd(d)&&s)&&(e.clickOutside&&e.clickOutside(h),i)){const m=Bn("click:outside",e,o),f=In(m,h,{controller:e});d.dispatchEvent(f)}},l=()=>{r==null||r.forEach(h=>{window.addEventListener(h,a,!0)})},c=()=>{r==null||r.forEach(h=>{window.removeEventListener(h,a,!0)})},u=e.disconnect.bind(e);return Object.assign(e,{disconnect(){c(),u()}}),l(),[l,c]};class kd extends it{}kd.debounces=[];const Dd=200,Ui=(n,t=Dd)=>{let e=null;return function(){const s=Array.from(arguments),i=this,r=s.map(a=>a.params),o=()=>(s.forEach((a,l)=>a.params=r[l]),n.apply(i,s));e&&clearTimeout(e),e=setTimeout(o,t)}},Ld=(n,t)=>{const e=n;e.constructor.debounces.forEach(i=>{if(typeof i=="string"&&(e[i]=Ui(e[i],void 0)),typeof i=="object"){const{name:r,wait:o}=i;if(!r)return;e[r]=Ui(e[r],o||void 0)}})},Fd={dispatchEvent:!0,eventPrefix:!0,visibleAttribute:"isVisible"},Vd=(n,t={})=>{const e=n,{dispatchEvent:s,eventPrefix:i,visibleAttribute:r}=Object.assign({},Fd,t),o=(t==null?void 0:t.element)||e.element;e.intersectionElements||(e.intersectionElements=[]),e.intersectionElements.push(o);const a=w=>{const[y]=w;y.isIntersecting?c(y):o.hasAttribute(r)&&u(y)},l=new IntersectionObserver(a,t),c=w=>{if(o.setAttribute(r,"true"),Hi(e,"appear").call(e,w,l),s){const y=Bn("appear",e,i),T=In(y,null,{controller:e,entry:w,observer:l});o.dispatchEvent(T)}},u=w=>{if(o.removeAttribute(r),Hi(e,"disappear").call(e,w,l),s){const y=Bn("disappear",e,i),T=In(y,null,{controller:e,entry:w,observer:l});o.dispatchEvent(T)}},h=e.disconnect.bind(e),d=()=>{f(),h()},m=()=>{l.observe(o)},f=()=>{l.unobserve(o)},g=()=>e.intersectionElements.filter(w=>w.hasAttribute(r)).length===0,b=()=>e.intersectionElements.filter(w=>w.hasAttribute(r)).length===1,p=()=>e.intersectionElements.some(w=>w.hasAttribute(r)),v=()=>e.intersectionElements.every(w=>w.hasAttribute(r));return Object.assign(e,{isVisible:v,noneVisible:g,oneVisible:b,atLeastOneVisible:p,allVisible:v,disconnect:d}),m(),[m,f]};class _d extends Md{constructor(t,e={}){super(t,e),this.observe=()=>{try{this.observer.observe(this.targetElement,this.options)}catch(s){this.controller.application.handleError(s,"At a minimum, one of childList, attributes, and/or characterData must be true",{})}},this.unobserve=()=>{this.observer.disconnect()},this.mutation=s=>{this.call("mutate",s),this.log("mutate",{entries:s}),this.dispatch("mutate",{entries:s})},this.targetElement=(e==null?void 0:e.element)||t.element,this.controller=t,this.options=e,this.observer=new MutationObserver(this.mutation),this.enhanceController(),this.observe()}enhanceController(){const t=this.controller.disconnect.bind(this.controller),e=()=>{this.unobserve(),t()};Object.assign(this.controller,{disconnect:e})}}const _o=(n,t={})=>{const e=new _d(n,t);return[e.observe,e.unobserve]};class Pd extends it{}Pd.throttles=[];class Rd extends I()({targets:{wrapper:HTMLDetailsElement,button:HTMLElement,popover:dn,options:HTMLDivElement},values:{clamped:Boolean,placement:String,dynamicLabelPrefix:String}}){constructor(){super(...arguments),this.changedIds=new Set}clickOutside(){this.element.open=!1,this.setupAutoUpdate(),this.close()}close(){this.changedIds.size>0&&(this.dispatch("changed"),this.changedIds.clear(),this.buttonTarget.setAttribute("aria-expanded","false"))}connect(){Cd(this),_o(this,{childList:!0,subtree:!0}),this.setupAutoUpdate(),this.setupForm()}disconnect(){var t;(t=this.unsubAutoUpdate)==null||t.call(this)}setupForm(){for(const t of["checkbox","radio"])for(const e of this.popoverTarget.querySelectorAll(`input[type="${t}"]`))e.addEventListener("change",s=>{const i=s.target;this.changedIds.has(i)?this.changedIds.delete(i):this.changedIds.add(i),this.dispatch("clicked",{detail:i})})}setupAutoUpdate(){var e;if(!this.element.open){(e=this.unsubAutoUpdate)==null||e.call(this);return}const t=()=>{const s=this.optionsTarget,i=this.clampedValue;vs(this.buttonTarget,this.popoverTarget,{middleware:[gs(6),ys(),bs({padding:6}),Td({apply({availableHeight:r}){let o=r-6;i&&o>400&&(o=400),Object.assign(s.style,{maxHeight:`${o}px`})}})],placement:this.placementValue,strategy:"fixed"}).then(({x:r,y:o})=>{Object.assign(this.popoverTarget.style,{left:`${r}px`,top:`${o}px`})})};t(),this.unsubAutoUpdate=Vo(this.buttonTarget,this.popoverTarget,t)}updateButtonLabel(t){var r;const s=t.target.querySelector("input[type=radio]:checked");if(!s)return;const i=((r=s.labels)==null?void 0:r.item(0)).textContent;this.buttonTarget.querySelector('[data-ariadne-ui-button-target="content"]').textContent=`${this.dynamicLabelPrefixValue}${i}`}toggle(){this.element.open=!this.element.open,this.setupAutoUpdate(),this.buttonTarget.setAttribute("aria-expanded","true")}}const Bd=Object.freeze(Object.defineProperty({__proto__:null,default:Rd},Symbol.toStringTag,{value:"Module"}));function Id(n){if(Array.isArray(n)){for(var t=0,e=Array(n.length);t<n.length;t++)e[t]=n[t];return e}else return Array.from(n)}var ws=!1;if(typeof window<"u"){var Wi={get passive(){ws=!0}};window.addEventListener("testPassive",null,Wi),window.removeEventListener("testPassive",null,Wi)}var $e=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),wt=[],je=!1,Po=-1,se=void 0,pt=void 0,ie=void 0,Ro=function(t){return wt.some(function(e){return!!(e.options.allowTouchMove&&e.options.allowTouchMove(t))})},Ke=function(t){var e=t||window.event;return Ro(e.target)||e.touches.length>1?!0:(e.preventDefault&&e.preventDefault(),!1)},Nd=function(t){if(ie===void 0){var e=!!t&&t.reserveScrollBarGap===!0,s=window.innerWidth-document.documentElement.clientWidth;if(e&&s>0){var i=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);ie=document.body.style.paddingRight,document.body.style.paddingRight=i+s+"px"}}se===void 0&&(se=document.body.style.overflow,document.body.style.overflow="hidden")},$d=function(){ie!==void 0&&(document.body.style.paddingRight=ie,ie=void 0),se!==void 0&&(document.body.style.overflow=se,se=void 0)},jd=function(){return window.requestAnimationFrame(function(){if(pt===void 0){pt={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var t=window,e=t.scrollY,s=t.scrollX,i=t.innerHeight;document.body.style.position="fixed",document.body.style.top=-e,document.body.style.left=-s,setTimeout(function(){return window.requestAnimationFrame(function(){var r=i-window.innerHeight;r&&e>=i&&(document.body.style.top=-(e+r))})},300)}})},Kd=function(){if(pt!==void 0){var t=-parseInt(document.body.style.top,10),e=-parseInt(document.body.style.left,10);document.body.style.position=pt.position,document.body.style.top=pt.top,document.body.style.left=pt.left,window.scrollTo(e,t),pt=void 0}},Hd=function(t){return t?t.scrollHeight-t.scrollTop<=t.clientHeight:!1},Ud=function(t,e){var s=t.targetTouches[0].clientY-Po;return Ro(t.target)?!1:e&&e.scrollTop===0&&s>0||Hd(e)&&s<0?Ke(t):(t.stopPropagation(),!0)},Wd=function(t,e){if(!t){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!wt.some(function(i){return i.targetElement===t})){var s={targetElement:t,options:e||{}};wt=[].concat(Id(wt),[s]),$e?jd():Nd(e),$e&&(t.ontouchstart=function(i){i.targetTouches.length===1&&(Po=i.targetTouches[0].clientY)},t.ontouchmove=function(i){i.targetTouches.length===1&&Ud(i,t)},je||(document.addEventListener("touchmove",Ke,ws?{passive:!1}:void 0),je=!0))}},zd=function(t){if(!t){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}wt=wt.filter(function(e){return e.targetElement!==t}),$e&&(t.ontouchstart=null,t.ontouchmove=null,je&&wt.length===0&&(document.removeEventListener("touchmove",Ke,ws?{passive:!1}:void 0),je=!1)),$e?Kd():$d()};const Ts=class Ts extends I()({targets:{dialog:HTMLDialogElement}}){connect(){this.element.tagName==="DIALOG"&&(window.AriadneDialogRegistry=window.AriadneDialogRegistry||{},window.AriadneDialogRegistry[this.element.id]=this)}disconnect(){this.element.tagName==="DIALOG"&&window.AriadneDialogRegistry&&window.AriadneDialogRegistry[this.element.id]&&delete window.AriadneDialogRegistry[this.element.id],this.close()}close(t){const e=this.hasDialogTarget?this.dialogTarget:this.element;e.open&&(t&&t.preventDefault(),e.close(),zd(e))}open(t){const e=this.hasDialogTarget?this.dialogTarget:this.element;e.open||(t&&t.preventDefault(),e.showModal(),Wd(e,{reserveScrollBarGap:!0}))}openDialogExternally(t){var i;t.preventDefault();const e=this.dialogIdValue;if(!e){console.error("Dialog trigger clicked without a data-ariadne-ui-dialog-dialog-id-value attribute.");return}const s=(i=window.AriadneDialogRegistry)==null?void 0:i[e];s?s.open():console.error(`Dialog with ID "${e}" not found in registry.`)}windowClick(t){const e=this.hasDialogTarget?this.dialogTarget:this.element;t.target===e&&this.close()}};Ts.values={dialogId:String};let Nn=Ts;const qd=Object.freeze(Object.defineProperty({__proto__:null,default:Nn},Symbol.toStringTag,{value:"Module"})),As=class As extends it{openDialog(t){t.preventDefault();const s=(window.AriadneDialogRegistry||{})[this.dialogIdValue];if(s)s.open();else{const i=document.getElementById(this.dialogIdValue);i&&i.tagName==="DIALOG"?i.showModal():console.warn(`Dialog with ID ${this.dialogIdValue} not found`)}}};As.values={dialogId:String};let $n=As;const Yd=Object.freeze(Object.defineProperty({__proto__:null,default:$n},Symbol.toStringTag,{value:"Module"}));class Xd extends I()({targets:{emptyRoot:null,input:HTMLInputElement,searchString:null}}){handleNewQuery(t){let e=!1;for(const{el:s,searchString:i}of this.items){const r=i.includes(t.trim().toLowerCase());!e&&r&&(e=!0),r?s.classList.remove("ariadne:hidden"):s.classList.add("ariadne:hidden")}this.hasEmptyRootTarget&&(e?this.emptyRootTarget.classList.add("ariadne:hidden"):this.emptyRootTarget.classList.remove("ariadne:hidden"))}connect(){this.items=this.searchStringTargets.map(t=>({el:t,searchString:(t.textContent??"").trim().toLowerCase()})),Vd(this)}appear(){this.reset()}handleInput(){this.hasSearchStringTarget&&this.handleNewQuery(this.inputTarget.value)}reset(){this.handleNewQuery(""),this.hasInputTarget&&(this.inputTarget.value="")}}const Gd=Object.freeze(Object.defineProperty({__proto__:null,default:Xd},Symbol.toStringTag,{value:"Module"}));class Zd extends I()({targets:{button:HTMLButtonElement,popover:HTMLElement},values:{placement:String}}){connect(){this.popoverTarget.addEventListener("toggle",t=>{t.newState==="open"&&this.updatePosition()})}toggle(){dispatchEvent(new CustomEvent("toggle",{detail:{newState:this.popoverTarget.open?"closed":"open"}}))}updatePosition(){Vo(this.buttonTarget,this.popoverTarget,()=>{vs(this.buttonTarget,this.popoverTarget,{placement:this.placementValue,middleware:[gs(5),ys(),bs({padding:5})]}).then(({x:t,y:e})=>{Object.assign(this.popoverTarget.style,{left:`${t}px`,top:`${e}px`})})})}}const Qd=Object.freeze(Object.defineProperty({__proto__:null,default:Zd},Symbol.toStringTag,{value:"Module"}));var Jd=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},zi=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Jt;class tf{formatToParts(t){const e=[];for(const s of t)e.push({type:"element",value:s}),e.push({type:"literal",value:", "});return e.slice(0,-1)}}const ef=typeof Intl<"u"&&Intl.ListFormat||tf,nf=[["years","year"],["months","month"],["weeks","week"],["days","day"],["hours","hour"],["minutes","minute"],["seconds","second"],["milliseconds","millisecond"]],sf={minimumIntegerDigits:2};class rf{constructor(t,e={}){Jt.set(this,void 0);let s=String(e.style||"short");s!=="long"&&s!=="short"&&s!=="narrow"&&s!=="digital"&&(s="short");let i=s==="digital"?"numeric":s;const r=e.hours||i;i=r==="2-digit"?"numeric":r;const o=e.minutes||i;i=o==="2-digit"?"numeric":o;const a=e.seconds||i;i=a==="2-digit"?"numeric":a;const l=e.milliseconds||i;Jd(this,Jt,{locale:t,style:s,years:e.years||s==="digital"?"short":s,yearsDisplay:e.yearsDisplay==="always"?"always":"auto",months:e.months||s==="digital"?"short":s,monthsDisplay:e.monthsDisplay==="always"?"always":"auto",weeks:e.weeks||s==="digital"?"short":s,weeksDisplay:e.weeksDisplay==="always"?"always":"auto",days:e.days||s==="digital"?"short":s,daysDisplay:e.daysDisplay==="always"?"always":"auto",hours:r,hoursDisplay:e.hoursDisplay==="always"||s==="digital"?"always":"auto",minutes:o,minutesDisplay:e.minutesDisplay==="always"||s==="digital"?"always":"auto",seconds:a,secondsDisplay:e.secondsDisplay==="always"||s==="digital"?"always":"auto",milliseconds:l,millisecondsDisplay:e.millisecondsDisplay==="always"?"always":"auto"},"f")}resolvedOptions(){return zi(this,Jt,"f")}formatToParts(t){const e=[],s=zi(this,Jt,"f"),i=s.style,r=s.locale;for(const[o,a]of nf){const l=t[o];if(s[`${o}Display`]==="auto"&&!l)continue;const c=s[o],u=c==="2-digit"?sf:c==="numeric"?{}:{style:"unit",unit:a,unitDisplay:c};e.push(new Intl.NumberFormat(r,u).format(l))}return new ef(r,{type:"unit",style:i==="digital"?"short":i}).formatToParts(e)}format(t){return this.formatToParts(t).map(e=>e.value).join("")}}Jt=new WeakMap;const Bo=/^[-+]?P(?:(\d+)Y)?(?:(\d+)M)?(?:(\d+)W)?(?:(\d+)D)?(?:T(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?)?$/,He=["year","month","week","day","hour","minute","second","millisecond"],of=n=>Bo.test(n);class j{constructor(t=0,e=0,s=0,i=0,r=0,o=0,a=0,l=0){this.years=t,this.months=e,this.weeks=s,this.days=i,this.hours=r,this.minutes=o,this.seconds=a,this.milliseconds=l,this.years||(this.years=0),this.sign||(this.sign=Math.sign(this.years)),this.months||(this.months=0),this.sign||(this.sign=Math.sign(this.months)),this.weeks||(this.weeks=0),this.sign||(this.sign=Math.sign(this.weeks)),this.days||(this.days=0),this.sign||(this.sign=Math.sign(this.days)),this.hours||(this.hours=0),this.sign||(this.sign=Math.sign(this.hours)),this.minutes||(this.minutes=0),this.sign||(this.sign=Math.sign(this.minutes)),this.seconds||(this.seconds=0),this.sign||(this.sign=Math.sign(this.seconds)),this.milliseconds||(this.milliseconds=0),this.sign||(this.sign=Math.sign(this.milliseconds)),this.blank=this.sign===0}abs(){return new j(Math.abs(this.years),Math.abs(this.months),Math.abs(this.weeks),Math.abs(this.days),Math.abs(this.hours),Math.abs(this.minutes),Math.abs(this.seconds),Math.abs(this.milliseconds))}static from(t){var e;if(typeof t=="string"){const s=String(t).trim(),i=s.startsWith("-")?-1:1,r=(e=s.match(Bo))===null||e===void 0?void 0:e.slice(1).map(o=>(Number(o)||0)*i);return r?new j(...r):new j}else if(typeof t=="object"){const{years:s,months:i,weeks:r,days:o,hours:a,minutes:l,seconds:c,milliseconds:u}=t;return new j(s,i,r,o,a,l,c,u)}throw new RangeError("invalid duration")}static compare(t,e){const s=Date.now(),i=Math.abs(qi(s,j.from(t)).getTime()-s),r=Math.abs(qi(s,j.from(e)).getTime()-s);return i>r?-1:i<r?1:0}toLocaleString(t,e){return new rf(t,e).format(this)}}function qi(n,t){const e=new Date(n);return t.sign<0?(e.setUTCSeconds(e.getUTCSeconds()+t.seconds),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCFullYear(e.getUTCFullYear()+t.years)):(e.setUTCFullYear(e.getUTCFullYear()+t.years),e.setUTCMonth(e.getUTCMonth()+t.months),e.setUTCDate(e.getUTCDate()+t.weeks*7+t.days),e.setUTCHours(e.getUTCHours()+t.hours),e.setUTCMinutes(e.getUTCMinutes()+t.minutes),e.setUTCSeconds(e.getUTCSeconds()+t.seconds)),e}function af(n,t="second",e=Date.now()){const s=n.getTime()-e;if(s===0)return new j;const i=Math.sign(s),r=Math.abs(s),o=Math.floor(r/1e3),a=Math.floor(o/60),l=Math.floor(a/60),c=Math.floor(l/24),u=Math.floor(c/30),h=Math.floor(u/12),d=He.indexOf(t)||He.length;return new j(d>=0?h*i:0,d>=1?(u-h*12)*i:0,0,d>=3?(c-u*30)*i:0,d>=4?(l-c*24)*i:0,d>=5?(a-l*60)*i:0,d>=6?(o-a*60)*i:0,d>=7?(r-o*1e3)*i:0)}function Io(n,{relativeTo:t=Date.now()}={}){if(t=new Date(t),n.blank)return n;const e=n.sign;let s=Math.abs(n.years),i=Math.abs(n.months),r=Math.abs(n.weeks),o=Math.abs(n.days),a=Math.abs(n.hours),l=Math.abs(n.minutes),c=Math.abs(n.seconds),u=Math.abs(n.milliseconds);u>=900&&(c+=Math.round(u/1e3)),(c||l||a||o||r||i||s)&&(u=0),c>=55&&(l+=Math.round(c/60)),(l||a||o||r||i||s)&&(c=0),l>=55&&(a+=Math.round(l/60)),(a||o||r||i||s)&&(l=0),o&&a>=12&&(o+=Math.round(a/24)),!o&&a>=21&&(o+=Math.round(a/24)),(o||r||i||s)&&(a=0);const h=t.getFullYear(),d=t.getMonth(),m=t.getDate();if(o>=27||s+i+o){const f=new Date(t);f.setDate(1),f.setMonth(d+i*e+1),f.setDate(0);const g=Math.max(0,m-f.getDate()),b=new Date(t);b.setFullYear(h+s*e),b.setDate(m-g),b.setMonth(d+i*e),b.setDate(m-g+o*e);const p=b.getFullYear()-t.getFullYear(),v=b.getMonth()-t.getMonth(),E=Math.abs(Math.round((Number(b)-Number(t))/864e5))+g,w=Math.abs(p*12+v);E<27?(o>=6?(r+=Math.round(o/7),o=0):o=E,i=s=0):w<=11?(i=w,s=0):(i=0,s=p*e),(i||s)&&(o=0)}return s&&(i=0),r>=4&&(i+=Math.round(r/4)),(i||s)&&(r=0),o&&r&&!i&&!s&&(r+=Math.round(o/7),o=0),new j(s*e,i*e,r*e,o*e,a*e,l*e,c*e,u*e)}function lf(n,t){const e=Io(n,t);if(e.blank)return[0,"second"];for(const s of He){if(s==="millisecond")continue;const i=e[`${s}s`];if(i)return[i,s]}return[0,"second"]}var k=function(n,t,e,s){if(e==="a"&&!s)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?n!==t||!s:!t.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?s:e==="a"?s.call(n):s?s.value:t.get(n)},Se=function(n,t,e,s,i){if(s==="m")throw new TypeError("Private method is not writable");if(s==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?n!==t||!i:!t.has(n))throw new TypeError("Cannot write private member to an object whose class did not declare it");return s==="a"?i.call(n,e):i?i.value=e:t.set(n,e),e},U,te,ee,qt,mt,jn,No,$o,jo,Ko,Mt;const cf=globalThis.HTMLElement||null,un=new j,Yi=new j(0,0,0,0,0,1);class uf extends Event{constructor(t,e,s,i){super("relative-time-updated",{bubbles:!0,composed:!0}),this.oldText=t,this.newText=e,this.oldTitle=s,this.newTitle=i}}function Xi(n){if(!n.date)return 1/0;if(n.format==="duration"||n.format==="elapsed"){const e=n.precision;if(e==="second")return 1e3;if(e==="minute")return 60*1e3}const t=Math.abs(Date.now()-n.date.getTime());return t<60*1e3?1e3:t<60*60*1e3?60*1e3:60*60*1e3}const hn=new class{constructor(){this.elements=new Set,this.time=1/0,this.timer=-1}observe(n){if(this.elements.has(n))return;this.elements.add(n);const t=n.date;if(t&&t.getTime()){const e=Xi(n),s=Date.now()+e;s<this.time&&(clearTimeout(this.timer),this.timer=setTimeout(()=>this.update(),e),this.time=s)}}unobserve(n){this.elements.has(n)&&this.elements.delete(n)}update(){if(clearTimeout(this.timer),!this.elements.size)return;let n=1/0;for(const t of this.elements)n=Math.min(n,Xi(t)),t.update();this.time=Math.min(60*60*1e3,n),this.timer=setTimeout(()=>this.update(),this.time),this.time+=Date.now()}};class hf extends cf{constructor(){super(...arguments),U.add(this),te.set(this,!1),ee.set(this,!1),mt.set(this,this.shadowRoot?this.shadowRoot:this.attachShadow?this.attachShadow({mode:"open"}):this),Mt.set(this,null)}static define(t="relative-time",e=customElements){return e.define(t,this),this}static get observedAttributes(){return["second","minute","hour","weekday","day","month","year","time-zone-name","prefix","threshold","tense","precision","format","format-style","no-title","datetime","lang","title"]}get onRelativeTimeUpdated(){return k(this,Mt,"f")}set onRelativeTimeUpdated(t){k(this,Mt,"f")&&this.removeEventListener("relative-time-updated",k(this,Mt,"f")),Se(this,Mt,typeof t=="object"||typeof t=="function"?t:null,"f"),typeof t=="function"&&this.addEventListener("relative-time-updated",t)}get second(){const t=this.getAttribute("second");if(t==="numeric"||t==="2-digit")return t}set second(t){this.setAttribute("second",t||"")}get minute(){const t=this.getAttribute("minute");if(t==="numeric"||t==="2-digit")return t}set minute(t){this.setAttribute("minute",t||"")}get hour(){const t=this.getAttribute("hour");if(t==="numeric"||t==="2-digit")return t}set hour(t){this.setAttribute("hour",t||"")}get weekday(){const t=this.getAttribute("weekday");if(t==="long"||t==="short"||t==="narrow")return t;if(this.format==="datetime"&&t!=="")return this.formatStyle}set weekday(t){this.setAttribute("weekday",t||"")}get day(){var t;const e=(t=this.getAttribute("day"))!==null&&t!==void 0?t:"numeric";if(e==="numeric"||e==="2-digit")return e}set day(t){this.setAttribute("day",t||"")}get month(){const t=this.format;let e=this.getAttribute("month");if(e!==""&&(e??(e=t==="datetime"?this.formatStyle:"short"),e==="numeric"||e==="2-digit"||e==="short"||e==="long"||e==="narrow"))return e}set month(t){this.setAttribute("month",t||"")}get year(){var t;const e=this.getAttribute("year");if(e==="numeric"||e==="2-digit")return e;if(!this.hasAttribute("year")&&new Date().getUTCFullYear()!==((t=this.date)===null||t===void 0?void 0:t.getUTCFullYear()))return"numeric"}set year(t){this.setAttribute("year",t||"")}get timeZoneName(){const t=this.getAttribute("time-zone-name");if(t==="long"||t==="short"||t==="shortOffset"||t==="longOffset"||t==="shortGeneric"||t==="longGeneric")return t}set timeZoneName(t){this.setAttribute("time-zone-name",t||"")}get prefix(){var t;return(t=this.getAttribute("prefix"))!==null&&t!==void 0?t:this.format==="datetime"?"":"on"}set prefix(t){this.setAttribute("prefix",t)}get threshold(){const t=this.getAttribute("threshold");return t&&of(t)?t:"P30D"}set threshold(t){this.setAttribute("threshold",t)}get tense(){const t=this.getAttribute("tense");return t==="past"?"past":t==="future"?"future":"auto"}set tense(t){this.setAttribute("tense",t)}get precision(){const t=this.getAttribute("precision");return He.includes(t)?t:this.format==="micro"?"minute":"second"}set precision(t){this.setAttribute("precision",t)}get format(){const t=this.getAttribute("format");return t==="datetime"?"datetime":t==="relative"?"relative":t==="duration"?"duration":t==="micro"?"micro":t==="elapsed"?"elapsed":"auto"}set format(t){this.setAttribute("format",t)}get formatStyle(){const t=this.getAttribute("format-style");if(t==="long")return"long";if(t==="short")return"short";if(t==="narrow")return"narrow";const e=this.format;return e==="elapsed"||e==="micro"?"narrow":e==="datetime"?"short":"long"}set formatStyle(t){this.setAttribute("format-style",t)}get noTitle(){return this.hasAttribute("no-title")}set noTitle(t){this.toggleAttribute("no-title",t)}get datetime(){return this.getAttribute("datetime")||""}set datetime(t){this.setAttribute("datetime",t)}get date(){const t=Date.parse(this.datetime);return Number.isNaN(t)?null:new Date(t)}set date(t){this.datetime=(t==null?void 0:t.toISOString())||""}connectedCallback(){this.update()}disconnectedCallback(){hn.unobserve(this)}attributeChangedCallback(t,e,s){e!==s&&(t==="title"&&Se(this,te,s!==null&&(this.date&&k(this,U,"m",jn).call(this,this.date))!==s,"f"),!k(this,ee,"f")&&!(t==="title"&&k(this,te,"f"))&&Se(this,ee,(async()=>{await Promise.resolve(),this.update(),Se(this,ee,!1,"f")})(),"f"))}update(){const t=k(this,mt,"f").textContent||this.textContent||"",e=this.getAttribute("title")||"";let s=e;const i=this.date;if(typeof Intl>"u"||!Intl.DateTimeFormat||!i){k(this,mt,"f").textContent=t;return}const r=Date.now();k(this,te,"f")||(s=k(this,U,"m",jn).call(this,i)||"",s&&!this.noTitle&&this.setAttribute("title",s));const o=af(i,this.precision,r),a=k(this,U,"m",No).call(this,o);let l=t;a==="duration"?l=k(this,U,"m",$o).call(this,o):a==="relative"?l=k(this,U,"m",jo).call(this,o):l=k(this,U,"m",Ko).call(this,i),l?k(this,mt,"f").textContent=l:this.shadowRoot===k(this,mt,"f")&&this.textContent&&(k(this,mt,"f").textContent=this.textContent),(l!==t||s!==e)&&this.dispatchEvent(new uf(t,l,e,s)),a==="relative"||a==="duration"?hn.observe(this):hn.unobserve(this)}}te=new WeakMap,ee=new WeakMap,mt=new WeakMap,Mt=new WeakMap,U=new WeakSet,qt=function(){var t;const e=((t=this.closest("[lang]"))===null||t===void 0?void 0:t.getAttribute("lang"))||this.ownerDocument.documentElement.getAttribute("lang");try{return new Intl.Locale(e??"").toString()}catch{return"default"}},jn=function(t){return new Intl.DateTimeFormat(k(this,U,"a",qt),{day:"numeric",month:"short",year:"numeric",hour:"numeric",minute:"2-digit",timeZoneName:"short"}).format(t)},No=function(t){const e=this.format;if(e==="datetime")return"datetime";if(e==="duration"||e==="elapsed"||e==="micro")return"duration";if((e==="auto"||e==="relative")&&typeof Intl<"u"&&Intl.RelativeTimeFormat){const s=this.tense;if(s==="past"||s==="future"||j.compare(t,this.threshold)===1)return"relative"}return"datetime"},$o=function(t){const e=k(this,U,"a",qt),s=this.format,i=this.formatStyle,r=this.tense;let o=un;s==="micro"?(t=Io(t),o=Yi,(this.tense==="past"&&t.sign!==-1||this.tense==="future"&&t.sign!==1)&&(t=Yi)):(r==="past"&&t.sign!==-1||r==="future"&&t.sign!==1)&&(t=o);const a=`${this.precision}sDisplay`;return t.blank?o.toLocaleString(e,{style:i,[a]:"always"}):t.abs().toLocaleString(e,{style:i})},jo=function(t){const e=new Intl.RelativeTimeFormat(k(this,U,"a",qt),{numeric:"auto",style:this.formatStyle}),s=this.tense;s==="future"&&t.sign!==1&&(t=un),s==="past"&&t.sign!==-1&&(t=un);const[i,r]=lf(t);return r==="second"&&i<10?e.format(0,this.precision==="millisecond"?"second":this.precision):e.format(i,r)},Ko=function(t){const e=new Intl.DateTimeFormat(k(this,U,"a",qt),{second:this.second,minute:this.minute,hour:this.hour,weekday:this.weekday,day:this.day,month:this.month,year:this.year,timeZoneName:this.timeZoneName});return`${this.prefix} ${e.format(t)}`.trim()};const Gi=typeof globalThis<"u"?globalThis:window;try{Gi.RelativeTimeElement=hf.define()}catch(n){if(!(Gi.DOMException&&n instanceof DOMException&&n.name==="NotSupportedError")&&!(n instanceof ReferenceError))throw n}class df extends I()({targets:{}}){}const ff=Object.freeze(Object.defineProperty({__proto__:null,default:df},Symbol.toStringTag,{value:"Module"}));function mf(){return/Mac|iMac|Macintosh|MacIntel/.test(navigator.userAgent)}class pf extends I()({targets:{alt:HTMLSpanElement,ctrl:HTMLSpanElement,shift:HTMLSpanElement}}){replaceSymbol(t,e){for(const s of t)s.innerText=e,s.classList.add("!font-fallback")}connect(){this.replaceSymbol(this.shiftTargets,"⇧"),mf()&&(this.replaceSymbol(this.ctrlTargets,"⌘"),this.replaceSymbol(this.altTargets,"⌥"))}}const gf=Object.freeze(Object.defineProperty({__proto__:null,default:pf},Symbol.toStringTag,{value:"Module"})),Ue=class Ue extends it{connect(){Ld(this)}save(){this.hasFormTarget?this.formTarget.requestSubmit():this.element.requestSubmit()}};Ue.debounces=["save"],Ue.targets=["form"];let Kn=Ue;const bf=Object.freeze(Object.defineProperty({__proto__:null,default:Kn},Symbol.toStringTag,{value:"Module"}));class yf extends I()({targets:{button:HTMLButtonElement,form:HTMLFormElement}}){get form(){return this.hasFormTarget?this.formTarget:this.element}runCheck(){this.buttonTarget.disabled=!this.form.checkValidity()}connect(){this.form.addEventListener("input",()=>this.runCheck()),this.runCheck(),_o(this,{childList:!0,subtree:!0})}mutate(){this.runCheck()}}const vf=Object.freeze(Object.defineProperty({__proto__:null,default:yf},Symbol.toStringTag,{value:"Module"}));class wf extends I()({targets:{perPage:HTMLSelectElement}}){connect(){}perPageChange(t){t.preventDefault();const s=t.target.value,i=new URL(window.location.href);new URLSearchParams(s.split("?")[1]).forEach((o,a)=>{i.searchParams.set(a,o)}),window.location.href=i.toString()}navigate(t){const e=t.target.closest("a");e&&(t.preventDefault(),window.location.href=e.href)}}const Ef=Object.freeze(Object.defineProperty({__proto__:null,default:wf},Symbol.toStringTag,{value:"Module"})),Tf=8,Af=8;class xf extends I()({targets:{activator:HTMLElement,wrapper:HTMLDivElement,tooltip:HTMLDivElement,arrow:HTMLDivElement,text:HTMLSpanElement}}){async update(){const t=this.element.getAttribute("data-placement")||"top";vs(this.activatorTarget,this.tooltipTarget,{placement:t,middleware:[gs(Tf+Af),ys({padding:8}),bs({padding:8}),Ad({element:this.arrowTarget})]}).then(({x:e,y:s,placement:i,middlewareData:r})=>{Object.assign(this.tooltipTarget.style,{left:`${e}px`,top:`${s}px`});const o=i.split("-")[0];this.tooltipTarget.setAttribute("data-side",o),this.arrowTarget.setAttribute("data-side",o);const{x:a,y:l}=r.arrow||{},c={top:"bottom",right:"left",bottom:"top",left:"right"}[o],u={left:a!=null?`${a}px`:"",top:l!=null?`${l}px`:"",right:"",bottom:""};c==="top"?u.bottom="-8px":c==="bottom"?u.top="-8px":c==="left"?u.right="-8px":c==="right"&&(u.left="-8px"),Object.assign(this.arrowTarget.style,u)})}showTooltip(t){this.wrapperTarget.classList.add("ariadne:block"),this.wrapperTarget.classList.remove("ariadne:hidden"),this.update()}hideTooltip(t){this.wrapperTarget.classList.add("ariadne:hidden"),this.wrapperTarget.classList.remove("ariadne:block")}}const Sf=Object.freeze(Object.defineProperty({__proto__:null,default:xf},Symbol.toStringTag,{value:"Module"})),Ze=pl.start();Ze.debug=!1;window.Stimulus=Ze;const Mf=Object.assign({"../../components/ariadne/form/toggle/component.ts":Fl,"../../components/ariadne/layout/sidebar/group/component.ts":Vl,"../../components/ariadne/ui/accordion/component.ts":Vh,"../../components/ariadne/ui/banner/component.ts":Ph,"../../components/ariadne/ui/clipboard_copy/component.ts":Uh,"../../components/ariadne/ui/combobox/component.ts":Bd,"../../components/ariadne/ui/dialog/component.ts":qd,"../../components/ariadne/ui/dialog_trigger/component.ts":Yd,"../../components/ariadne/ui/list/component.ts":Gd,"../../components/ariadne/ui/popover/component.ts":Qd,"../../components/ariadne/ui/relative_time/component.ts":ff,"../../components/ariadne/ui/shortcut/component.ts":gf});for(const[n,t]of Object.entries(Mf)){const e=n.split("/"),s=e.slice(3,e.length-1).join("-").replaceAll("_","-").toLocaleLowerCase();Ze.register(s,t.default)}const Of=Object.assign({"/controllers/form_autosubmit_controller.ts":bf,"/controllers/form_validity_controller.ts":vf,"/controllers/pagination_controller.ts":Ef,"/controllers/tooltip_controller.ts":Sf});for(const[n,t]of Object.entries(Of)){const e=n.split("/"),s=e[e.length-1].replace("_controller.ts","").replaceAll("_","-").toLocaleLowerCase();Ze.register(`ariadne-${s}`,t.default)}
|
99
99
|
//# sourceMappingURL=ariadne_view_components.js.map
|