aptechka 0.64.8 → 0.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- "use strict";var te=c=>{throw TypeError(c)};var Q=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(Q(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(Q(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),b=(c,o,t)=>(Q(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),m=require("../css-property/index.cjs"),_=require("../index-DekP7OZe.cjs"),Y=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),F=require("../Viewport-DB0qAZPJ.cjs");var u,y,J,K;class le{constructor(){r(this,u,new Map);r(this,y,[]);r(this,J,o=>{var s;const t=[...e(this,y)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,K,o=>{if(o.code==="Escape"){const t=[...e(this,y)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,J)),addEventListener("keydown",e(this,K))}get groups(){return e(this,u)}get stack(){return e(this,y)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,y).push(t),s.push(t)}remove(o,t){if(n(this,y,e(this,y).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,y=new WeakMap,J=new WeakMap,K=new WeakMap;var f,$,M,C,B,v,w,x,A,g,R,q,L,T,O,a,P,oe,I,V,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,$);r(this,M);r(this,C);r(this,B);r(this,v);r(this,w);r(this,x);r(this,A);r(this,g);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,V);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new m.CSSProperty(this,"--history",!1)),n(this,w,new m.CSSProperty(this,"--restore",!1)),n(this,x,new m.CSSProperty(this,"--close-rest",!1)),n(this,A,new m.CSSProperty(this,"--close-rest-in-group",!1)),n(this,g,new m.CSSProperty(this,"--group","")),n(this,R,new m.CSSProperty(this,"--click-outside",!1)),n(this,q,new m.CSSProperty(this,"--escape",!1)),n(this,L,new m.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,V,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>F.viewport.width?s=F.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>F.viewport.height?i=F.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),e(this,g).subscribe(t=>{t.previous&&(E.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=E.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,x)}get closeRestInGroup(){return e(this,A)}get group(){return e(this,g)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,$)),clearTimeout(e(this,M)),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),Y.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,g).current,this),e(this,S).call(this),e(this,a).set("opened",!0),Y.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,C,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,C,setTimeout(s,10))}close(){e(this,f)&&(clearTimeout(e(this,C)),clearTimeout(e(this,B)),E.stack.remove(e(this,g).current,this),n(this,f,!1),b(this,P,I).call(this),e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),Y.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),Y.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,x).observe(),e(this,A).observe(),e(this,g).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(b(this,P,I).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,g).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,x).close(),e(this,A).close(),e(this,g).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,C)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),b(this,P,I).call(this)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,C=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,x=new WeakMap,A=new WeakMap,g=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},I=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;_.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Z,D,U,j,X,N;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new m.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,X,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});_.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(b(this,k,Z).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,X))):console.warn(this,`target ${t} not found`)}b(this,k,N).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{b(this,k,N).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0);const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),b(this,k,Z).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Z=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,X)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,X=new WeakMap,N=function(t){e(this,h)instanceof z&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};_.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
1
+ "use strict";var te=c=>{throw TypeError(c)};var K=(c,o,t)=>o.has(c)||te("Cannot "+t);var e=(c,o,t)=>(K(c,o,"read from private field"),t?t.call(c):o.get(c)),r=(c,o,t)=>o.has(c)?te("Cannot add the same private member more than once"):o instanceof WeakSet?o.add(c):o.set(c,t),n=(c,o,t,s)=>(K(c,o,"write to private field"),s?s.call(c,t):o.set(c,t),t),y=(c,o,t)=>(K(c,o,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const he=require("../element-linked-store/index.cjs"),g=require("../css-property/index.cjs"),_=require("../index-DekP7OZe.cjs"),X=require("../events-KVanG9sR.cjs"),ce=require("../function-MthRj-GJ.cjs"),se=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ie=require("../url-lnBE_6yf.cjs"),re=require("../window-resizer/index.cjs"),Y=require("../Viewport-DB0qAZPJ.cjs");var u,b,I,J;class le{constructor(){r(this,u,new Map);r(this,b,[]);r(this,I,o=>{var s;const t=[...e(this,b)].reverse().find(i=>i.clickOutside.current);if(t){const i=o.composedPath();if(i.find(ee=>ee instanceof HTMLElement&&ee.hasAttribute("data-popover-content")))return;const l=i[0],p=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),H=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!p||H)&&t.close()}});r(this,J,o=>{if(o.code==="Escape"){const t=[...e(this,b)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,I)),addEventListener("keydown",e(this,J))}get groups(){return e(this,u)}get stack(){return e(this,b)}add(o,t){if(t.closeRest.current)e(this,u).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,u).get(o);i==null||i.forEach(l=>{l.close()})}let s=e(this,u).get(o);s!=null&&s.length||(s=[],e(this,u).set(o,s)),e(this,b).push(t),s.push(t)}remove(o,t){if(n(this,b,e(this,b).filter(s=>s!==t)),t.closeRest.current){let s=[];e(this,u).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,u).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,u).get(o);e(this,u).delete(o),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,u).get(o);s&&(s=s.filter(i=>i!==t),e(this,u).set(o,s))}}}u=new WeakMap,b=new WeakMap,I=new WeakMap,J=new WeakMap;var f,$,M,A,B,v,w,C,x,m,R,q,L,T,O,a,P,oe,F,V,S,W,G;const E=class E extends HTMLElement{constructor(){super();r(this,P);r(this,f);r(this,$);r(this,M);r(this,A);r(this,B);r(this,v);r(this,w);r(this,C);r(this,x);r(this,m);r(this,R);r(this,q);r(this,L);r(this,T);r(this,O);r(this,a);r(this,V);r(this,S);r(this,W);r(this,G);this.urlValue="",n(this,f,!1),n(this,v,new g.CSSProperty(this,"--history",!1)),n(this,w,new g.CSSProperty(this,"--restore",!1)),n(this,C,new g.CSSProperty(this,"--close-rest",!1)),n(this,x,new g.CSSProperty(this,"--close-rest-in-group",!1)),n(this,m,new g.CSSProperty(this,"--group","")),n(this,R,new g.CSSProperty(this,"--click-outside",!1)),n(this,q,new g.CSSProperty(this,"--escape",!1)),n(this,L,new g.CSSProperty(this,"--check-viewport-bounds",!1)),n(this,T,!1),n(this,a,new he.ElementLinkedStore(this,{opened:!1,closing:!1,triggered:!1,transitionend:!1})),n(this,V,()=>{n(this,T,!1),e(this,f)&&e(this,v).current&&!location.search.includes(this.id)?this.close():!e(this,f)&&e(this,v).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),n(this,T,!0)}),n(this,S,()=>{this.style.setProperty("--content-width","initial"),this.style.setProperty("--content-height","initial"),this.style.setProperty("--viewport-offset-x","0px"),this.style.setProperty("--viewport-offset-y","0px"),e(this,W).call(this)}),n(this,W,ce.debounce(()=>{e(this,G).call(this)},10)),n(this,G,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,L).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Y.viewport.width?s=Y.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Y.viewport.height?i=Y.viewport.height-t.bottom:t.top<0&&(i=t.top*-1),this.style.setProperty("--viewport-offset-x",s+"px"),this.style.setProperty("--viewport-offset-y",i+"px")}}),e(this,m).subscribe(t=>{t.previous&&(E.stack.remove(t.previous,this),t.current||(document.documentElement.classList.remove(`${this.group.previous}-closing`),document.documentElement.classList.remove(`${this.group.previous}-opened`)))}),e(this,a).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=E.stack.groups.get(this.group.current),i=s==null?void 0:s.find(l=>l.opened);document.documentElement.classList.toggle(`${this.group.current}-opened`,!!i)}})}get history(){return e(this,v)}get restore(){return e(this,w)}get closeRest(){return e(this,C)}get closeRestInGroup(){return e(this,x)}get group(){return e(this,m)}get clickOutside(){return e(this,R)}get escape(){return e(this,q)}get opened(){return e(this,f)}get lastTrigger(){return e(this,O)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,f)&&ie.updateSearchParameter(this.id,t)}open(t){if(e(this,f))return;if(n(this,O,t==null?void 0:t.trigger),clearTimeout(e(this,$)),clearTimeout(e(this,M)),this.hasAttribute("data-document-class")){const i=this.getAttribute("data-document-class");document.documentElement.classList.add(i)}e(this,a).set("closing",!1),e(this,a).set("triggered",!0),X.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,O)}}),e(this,v).current&&e(this,T)&&history.pushState(history.state,"",e(this,P,oe)),n(this,f,!0);const s=()=>{E.stack.add(e(this,m).current,this),e(this,S).call(this),e(this,a).set("opened",!0),X.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,O)}}),n(this,A,void 0),n(this,B,setTimeout(()=>{e(this,a).set("transitionend",!0)},se.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():n(this,A,setTimeout(s,10))}close(){if(e(this,f)){if(clearTimeout(e(this,A)),clearTimeout(e(this,B)),E.stack.remove(e(this,m).current,this),n(this,f,!1),y(this,P,F).call(this),this.hasAttribute("data-document-class")){const t=this.getAttribute("data-document-class");document.documentElement.classList.remove(t)}e(this,a).set("transitionend",!1),n(this,$,setTimeout(()=>{e(this,a).set("opened",!1),e(this,a).set("closing",!0),X.dispatchEvent(this,"popoverClosing",{custom:!0}),n(this,M,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("closing",!1),X.dispatchEvent(this,"popoverClosed",{custom:!0})},se.getElementTransitionDurationMS(this)+10))},10))}}connectedCallback(){e(this,v).observe(),e(this,w).observe(),e(this,C).observe(),e(this,x).observe(),e(this,m).observe(),e(this,R).observe(),e(this,q).observe(),e(this,L).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,V)),setTimeout(()=>{e(this,w).current?(this.urlValue=ie.parseSearchParameters(location.search)[this.id],e(this,V).call(this)):(y(this,P,F).call(this),n(this,T,!0))},0),e(this,L).subscribe(()=>{e(this,S).call(this)}),re.windowResizer.subscribe(e(this,S))}disconnectedCallback(){E.stack.remove(e(this,m).current,this),re.windowResizer.unsubscribe(e(this,S)),e(this,a).close(),e(this,v).close(),e(this,w).close(),e(this,C).close(),e(this,x).close(),e(this,m).close(),e(this,R).close(),e(this,q).close(),e(this,L).close(),this.removeAttribute("role"),clearTimeout(e(this,$)),clearTimeout(e(this,M)),clearTimeout(e(this,A)),clearTimeout(e(this,B)),removeEventListener("popstate",e(this,V)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),y(this,P,F).call(this)}};f=new WeakMap,$=new WeakMap,M=new WeakMap,A=new WeakMap,B=new WeakMap,v=new WeakMap,w=new WeakMap,C=new WeakMap,x=new WeakMap,m=new WeakMap,R=new WeakMap,q=new WeakMap,L=new WeakMap,T=new WeakMap,O=new WeakMap,a=new WeakMap,P=new WeakSet,oe=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},F=function(){if(e(this,v).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},V=new WeakMap,S=new WeakMap,W=new WeakMap,G=new WeakMap,E.stack=new le;let z=E;_.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",z);var h,d,k,Q,D,U,j,N,Z;class ne extends HTMLElement{constructor(){super();r(this,k);r(this,h);r(this,d,new g.CSSProperty(this,"--type","open"));r(this,D,()=>{e(this,d).current!=="close"&&this.classList.add("triggered")});r(this,U,()=>{e(this,d).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,j,()=>{e(this,d).current!=="close"&&this.classList.remove("opened")});r(this,N,()=>{e(this,d).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});_.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,d).current;t==="open"||t==="toggle"&&!e(this,h).opened?e(this,h).open({trigger:this}):(t==="close"||t==="toggle"&&e(this,h).opened)&&e(this,h).close()}}),this.addEventListener("keydown",t=>{t.code==="Space"&&!this.hasAttribute("keydown-disabled")&&(t.preventDefault(),this.click())}))}get type(){return e(this,d)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(y(this,k,Q).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const p=this.getRootNode();p instanceof ShadowRoot?i=p.host.closest("[data-popover]"):p instanceof HTMLElement&&(i=p.closest("[data-popover]"))}}else if(t==="sibling")i=(s=this.parentElement)==null?void 0:s.querySelector("[data-popover]");else if(t==="ancestor-child"){const l=p=>{if(!p)return null;let H=p.querySelector("[data-popover]");return!H&&(p!=null&&p.parentElement)&&(H=l(p.parentElement)),H};i=l(this.parentElement)||null}else!t.startsWith(".")&&!t.startsWith("[")&&(t=`#${t}`),i=document.querySelector(t)||this.getRootNode().querySelector(t);i instanceof HTMLElement?(n(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,D)),e(this,h).addEventListener("popoverOpened",e(this,U)),e(this,h).addEventListener("popoverClosing",e(this,j)),e(this,h).addEventListener("popoverClosed",e(this,N))):console.warn(this,`target ${t} not found`)}y(this,k,Z).call(this,e(this,d).current)}connectedCallback(){e(this,d).subscribe(s=>{y(this,k,Z).call(this,s.current)}),this.hasAttribute("tabindex")||(this.tabIndex=0),this.hasAttribute("role")||this.setAttribute("role","button");const t=this.getAttribute("target");t&&this.changePopover(t),this.isConnected&&e(this,d).observe()}disconnectedCallback(){e(this,d).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),y(this,k,Q).call(this)}}h=new WeakMap,d=new WeakMap,k=new WeakSet,Q=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,D)),e(this,h).removeEventListener("popoverOpened",e(this,U)),e(this,h).removeEventListener("popoverClosing",e(this,j)),e(this,h).removeEventListener("popoverClosed",e(this,N)))},D=new WeakMap,U=new WeakMap,j=new WeakMap,N=new WeakMap,Z=function(t){e(this,h)instanceof z&&(t!=="close"?(this.setAttribute("aria-haspopup","true"),this.setAttribute("aria-expanded",e(this,h).opened?"true":"false"),this.setAttribute("aria-controls",e(this,h).id||"")):(this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls")))};_.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ne);exports.PopoverButtonElement=ne;exports.PopoverElement=z;
@@ -1,24 +1,24 @@
1
1
  var et = (c) => {
2
2
  throw TypeError(c);
3
3
  };
4
- var Q = (c, o, e) => o.has(c) || et("Cannot " + e);
5
- var t = (c, o, e) => (Q(c, o, "read from private field"), e ? e.call(c) : o.get(c)), r = (c, o, e) => o.has(c) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(c) : o.set(c, e), h = (c, o, e, s) => (Q(c, o, "write to private field"), s ? s.call(c, e) : o.set(c, e), e), y = (c, o, e) => (Q(c, o, "access private method"), e);
4
+ var K = (c, o, e) => o.has(c) || et("Cannot " + e);
5
+ var t = (c, o, e) => (K(c, o, "read from private field"), e ? e.call(c) : o.get(c)), r = (c, o, e) => o.has(c) ? et("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(c) : o.set(c, e), h = (c, o, e, s) => (K(c, o, "write to private field"), s ? s.call(c, e) : o.set(c, e), e), y = (c, o, e) => (K(c, o, "access private method"), e);
6
6
  import { ElementLinkedStore as ot } from "../element-linked-store/index.js";
7
- import { CSSProperty as v } from "../css-property/index.js";
7
+ import { CSSProperty as g } from "../css-property/index.js";
8
8
  import { i as _ } from "../index-Bv9zgfdb.js";
9
- import { d as Y } from "../events-CsVF98U6.js";
9
+ import { d as X } from "../events-CsVF98U6.js";
10
10
  import { d as ht } from "../function-C10DGppn.js";
11
11
  import { g as st } from "../style-j2TwriJ_.js";
12
12
  import "construct-style-sheets-polyfill";
13
13
  import { u as nt, p as ct } from "../url-Cc-RVfii.js";
14
14
  import { windowResizer as it } from "../window-resizer/index.js";
15
- import { v as j } from "../Viewport-DA10iWAO.js";
16
- var u, b, J, K;
17
- class lt {
15
+ import { v as Y } from "../Viewport-DA10iWAO.js";
16
+ var u, b, I, J;
17
+ class at {
18
18
  constructor() {
19
19
  r(this, u, /* @__PURE__ */ new Map());
20
20
  r(this, b, []);
21
- r(this, J, (o) => {
21
+ r(this, I, (o) => {
22
22
  var s;
23
23
  const e = [...t(this, b)].reverse().find((i) => i.clickOutside.current);
24
24
  if (e) {
@@ -27,11 +27,11 @@ class lt {
27
27
  (tt) => tt instanceof HTMLElement && tt.hasAttribute("data-popover-content")
28
28
  ))
29
29
  return;
30
- const l = i[0], p = l instanceof Node && (e.contains(l) || ((s = e.shadowRoot) == null ? void 0 : s.contains(l))), G = l instanceof HTMLElement && l.hasAttribute("data-outside");
30
+ const a = i[0], p = a instanceof Node && (e.contains(a) || ((s = e.shadowRoot) == null ? void 0 : s.contains(a))), G = a instanceof HTMLElement && a.hasAttribute("data-outside");
31
31
  (!p || G) && e.close();
32
32
  }
33
33
  });
34
- r(this, K, (o) => {
34
+ r(this, J, (o) => {
35
35
  if (o.code === "Escape") {
36
36
  const e = [...t(this, b)].reverse().find((s) => s.escape.current);
37
37
  e && e.close();
@@ -39,8 +39,8 @@ class lt {
39
39
  });
40
40
  document.documentElement.addEventListener(
41
41
  "click",
42
- t(this, J)
43
- ), addEventListener("keydown", t(this, K));
42
+ t(this, I)
43
+ ), addEventListener("keydown", t(this, J));
44
44
  }
45
45
  get groups() {
46
46
  return t(this, u);
@@ -51,14 +51,14 @@ class lt {
51
51
  add(o, e) {
52
52
  if (e.closeRest.current)
53
53
  t(this, u).forEach((i) => {
54
- i.forEach((l) => {
55
- l.close();
54
+ i.forEach((a) => {
55
+ a.close();
56
56
  });
57
57
  });
58
58
  else if (e.closeRestInGroup.current) {
59
59
  let i = t(this, u).get(o);
60
- i == null || i.forEach((l) => {
61
- l.close();
60
+ i == null || i.forEach((a) => {
61
+ a.close();
62
62
  });
63
63
  }
64
64
  let s = t(this, u).get(o);
@@ -68,7 +68,7 @@ class lt {
68
68
  if (h(this, b, t(this, b).filter((s) => s !== e)), e.closeRest.current) {
69
69
  let s = [];
70
70
  t(this, u).forEach((i) => {
71
- i.forEach((l) => s.push(l));
71
+ i.forEach((a) => s.push(a));
72
72
  }), t(this, u).clear(), s.forEach((i) => i.close());
73
73
  } else if (e.closeRestInGroup.current) {
74
74
  const s = t(this, u).get(o);
@@ -81,37 +81,37 @@ class lt {
81
81
  }
82
82
  }
83
83
  }
84
- u = new WeakMap(), b = new WeakMap(), J = new WeakMap(), K = new WeakMap();
85
- var f, M, H, A, W, m, w, S, C, g, R, $, L, T, O, a, P, rt, F, V, k, q, z;
84
+ u = new WeakMap(), b = new WeakMap(), I = new WeakMap(), J = new WeakMap();
85
+ var f, M, H, x, W, m, w, S, C, v, R, $, L, T, O, l, A, rt, j, V, k, q, z;
86
86
  const E = class E extends HTMLElement {
87
87
  constructor() {
88
88
  super();
89
- r(this, P);
89
+ r(this, A);
90
90
  r(this, f);
91
91
  r(this, M);
92
92
  r(this, H);
93
- r(this, A);
93
+ r(this, x);
94
94
  r(this, W);
95
95
  r(this, m);
96
96
  r(this, w);
97
97
  r(this, S);
98
98
  r(this, C);
99
- r(this, g);
99
+ r(this, v);
100
100
  r(this, R);
101
101
  r(this, $);
102
102
  r(this, L);
103
103
  r(this, T);
104
104
  r(this, O);
105
- r(this, a);
105
+ r(this, l);
106
106
  r(this, V);
107
107
  r(this, k);
108
108
  r(this, q);
109
109
  r(this, z);
110
- this.urlValue = "", h(this, f, !1), h(this, m, new v(this, "--history", !1)), h(this, w, new v(this, "--restore", !1)), h(this, S, new v(this, "--close-rest", !1)), h(this, C, new v(
110
+ this.urlValue = "", h(this, f, !1), h(this, m, new g(this, "--history", !1)), h(this, w, new g(this, "--restore", !1)), h(this, S, new g(this, "--close-rest", !1)), h(this, C, new g(
111
111
  this,
112
112
  "--close-rest-in-group",
113
113
  !1
114
- )), h(this, g, new v(this, "--group", "")), h(this, R, new v(this, "--click-outside", !1)), h(this, $, new v(this, "--escape", !1)), h(this, L, new v(this, "--check-viewport-bounds", !1)), h(this, T, !1), h(this, a, new ot(this, {
114
+ )), h(this, v, new g(this, "--group", "")), h(this, R, new g(this, "--click-outside", !1)), h(this, $, new g(this, "--escape", !1)), h(this, L, new g(this, "--check-viewport-bounds", !1)), h(this, T, !1), h(this, l, new ot(this, {
115
115
  opened: !1,
116
116
  closing: !1,
117
117
  triggered: !1,
@@ -126,21 +126,21 @@ const E = class E extends HTMLElement {
126
126
  if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, L).current) {
127
127
  const e = this.getBoundingClientRect();
128
128
  let s = 0, i = 0;
129
- e.right > j.width ? s = j.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > j.height ? i = j.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
129
+ e.right > Y.width ? s = Y.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > Y.height ? i = Y.height - e.bottom : e.top < 0 && (i = e.top * -1), this.style.setProperty("--viewport-offset-x", s + "px"), this.style.setProperty("--viewport-offset-y", i + "px");
130
130
  }
131
- }), t(this, g).subscribe((e) => {
131
+ }), t(this, v).subscribe((e) => {
132
132
  e.previous && (E.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
133
133
  `${this.group.previous}-closing`
134
134
  ), document.documentElement.classList.remove(
135
135
  `${this.group.previous}-opened`
136
136
  )));
137
- }), t(this, a).subscribe((e) => {
137
+ }), t(this, l).subscribe((e) => {
138
138
  if (this.group.current) {
139
139
  document.documentElement.classList.toggle(
140
140
  `${this.group.current}-closing`,
141
141
  e.current.closing
142
142
  );
143
- const s = E.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((l) => l.opened);
143
+ const s = E.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((a) => a.opened);
144
144
  document.documentElement.classList.toggle(
145
145
  `${this.group.current}-opened`,
146
146
  !!i
@@ -161,7 +161,7 @@ const E = class E extends HTMLElement {
161
161
  return t(this, C);
162
162
  }
163
163
  get group() {
164
- return t(this, g);
164
+ return t(this, v);
165
165
  }
166
166
  get clickOutside() {
167
167
  return t(this, R);
@@ -184,63 +184,73 @@ const E = class E extends HTMLElement {
184
184
  open(e) {
185
185
  if (t(this, f))
186
186
  return;
187
- h(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, M)), clearTimeout(t(this, H)), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), Y(this, "popoverTriggered", {
187
+ if (h(this, O, e == null ? void 0 : e.trigger), clearTimeout(t(this, M)), clearTimeout(t(this, H)), this.hasAttribute("data-document-class")) {
188
+ const i = this.getAttribute("data-document-class");
189
+ document.documentElement.classList.add(i);
190
+ }
191
+ t(this, l).set("closing", !1), t(this, l).set("triggered", !0), X(this, "popoverTriggered", {
188
192
  custom: !0,
189
193
  detail: {
190
194
  trigger: t(this, O)
191
195
  }
192
- }), t(this, m).current && t(this, T) && history.pushState(history.state, "", t(this, P, rt)), h(this, f, !0);
196
+ }), t(this, m).current && t(this, T) && history.pushState(history.state, "", t(this, A, rt)), h(this, f, !0);
193
197
  const s = () => {
194
- E.stack.add(t(this, g).current, this), t(this, k).call(this), t(this, a).set("opened", !0), Y(this, "popoverOpened", {
198
+ E.stack.add(t(this, v).current, this), t(this, k).call(this), t(this, l).set("opened", !0), X(this, "popoverOpened", {
195
199
  custom: !0,
196
200
  detail: {
197
201
  trigger: t(this, O)
198
202
  }
199
- }), h(this, A, void 0), h(this, W, setTimeout(() => {
200
- t(this, a).set("transitionend", !0);
203
+ }), h(this, x, void 0), h(this, W, setTimeout(() => {
204
+ t(this, l).set("transitionend", !0);
201
205
  }, st(this) + 10));
202
206
  };
203
- e != null && e.skipTransition ? s() : h(this, A, setTimeout(s, 10));
207
+ e != null && e.skipTransition ? s() : h(this, x, setTimeout(s, 10));
204
208
  }
205
209
  close() {
206
- t(this, f) && (clearTimeout(t(this, A)), clearTimeout(t(this, W)), E.stack.remove(t(this, g).current, this), h(this, f, !1), y(this, P, F).call(this), t(this, a).set("transitionend", !1), h(this, M, setTimeout(() => {
207
- t(this, a).set("opened", !1), t(this, a).set("closing", !0), Y(this, "popoverClosing", {
208
- custom: !0
209
- }), h(this, H, setTimeout(() => {
210
- t(this, a).set("triggered", !1), t(this, a).set("closing", !1), Y(this, "popoverClosed", {
210
+ if (t(this, f)) {
211
+ if (clearTimeout(t(this, x)), clearTimeout(t(this, W)), E.stack.remove(t(this, v).current, this), h(this, f, !1), y(this, A, j).call(this), this.hasAttribute("data-document-class")) {
212
+ const e = this.getAttribute("data-document-class");
213
+ document.documentElement.classList.remove(e);
214
+ }
215
+ t(this, l).set("transitionend", !1), h(this, M, setTimeout(() => {
216
+ t(this, l).set("opened", !1), t(this, l).set("closing", !0), X(this, "popoverClosing", {
211
217
  custom: !0
212
- });
213
- }, st(this) + 10));
214
- }, 10)));
218
+ }), h(this, H, setTimeout(() => {
219
+ t(this, l).set("triggered", !1), t(this, l).set("closing", !1), X(this, "popoverClosed", {
220
+ custom: !0
221
+ });
222
+ }, st(this) + 10));
223
+ }, 10));
224
+ }
215
225
  }
216
226
  connectedCallback() {
217
- t(this, m).observe(), t(this, w).observe(), t(this, S).observe(), t(this, C).observe(), t(this, g).observe(), t(this, R).observe(), t(this, $).observe(), t(this, L).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, V)), setTimeout(() => {
218
- t(this, w).current ? (this.urlValue = ct(location.search)[this.id], t(this, V).call(this)) : (y(this, P, F).call(this), h(this, T, !0));
227
+ t(this, m).observe(), t(this, w).observe(), t(this, S).observe(), t(this, C).observe(), t(this, v).observe(), t(this, R).observe(), t(this, $).observe(), t(this, L).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, V)), setTimeout(() => {
228
+ t(this, w).current ? (this.urlValue = ct(location.search)[this.id], t(this, V).call(this)) : (y(this, A, j).call(this), h(this, T, !0));
219
229
  }, 0), t(this, L).subscribe(() => {
220
230
  t(this, k).call(this);
221
231
  }), it.subscribe(t(this, k));
222
232
  }
223
233
  disconnectedCallback() {
224
- E.stack.remove(t(this, g).current, this), it.unsubscribe(t(this, k)), t(this, a).close(), t(this, m).close(), t(this, w).close(), t(this, S).close(), t(this, C).close(), t(this, g).close(), t(this, R).close(), t(this, $).close(), t(this, L).close(), this.removeAttribute("role"), clearTimeout(t(this, M)), clearTimeout(t(this, H)), clearTimeout(t(this, A)), clearTimeout(t(this, W)), removeEventListener("popstate", t(this, V)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), y(this, P, F).call(this);
234
+ E.stack.remove(t(this, v).current, this), it.unsubscribe(t(this, k)), t(this, l).close(), t(this, m).close(), t(this, w).close(), t(this, S).close(), t(this, C).close(), t(this, v).close(), t(this, R).close(), t(this, $).close(), t(this, L).close(), this.removeAttribute("role"), clearTimeout(t(this, M)), clearTimeout(t(this, H)), clearTimeout(t(this, x)), clearTimeout(t(this, W)), removeEventListener("popstate", t(this, V)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), y(this, A, j).call(this);
225
235
  }
226
236
  };
227
- f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), A = new WeakMap(), W = new WeakMap(), m = new WeakMap(), w = new WeakMap(), S = new WeakMap(), C = new WeakMap(), g = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), L = new WeakMap(), T = new WeakMap(), O = new WeakMap(), a = new WeakMap(), P = new WeakSet(), rt = function() {
237
+ f = new WeakMap(), M = new WeakMap(), H = new WeakMap(), x = new WeakMap(), W = new WeakMap(), m = new WeakMap(), w = new WeakMap(), S = new WeakMap(), C = new WeakMap(), v = new WeakMap(), R = new WeakMap(), $ = new WeakMap(), L = new WeakMap(), T = new WeakMap(), O = new WeakMap(), l = new WeakMap(), A = new WeakSet(), rt = function() {
228
238
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
229
- }, F = function() {
239
+ }, j = function() {
230
240
  if (t(this, m).current) {
231
241
  const e = new URL(location.href);
232
242
  e.searchParams.delete(this.id), history.replaceState(history.state, "", e.href);
233
243
  }
234
- }, V = new WeakMap(), k = new WeakMap(), q = new WeakMap(), z = new WeakMap(), E.stack = new lt();
235
- let I = E;
236
- _ && !customElements.get("e-popover") && customElements.define("e-popover", I);
237
- var n, d, x, Z, B, D, U, X, N;
238
- class at extends HTMLElement {
244
+ }, V = new WeakMap(), k = new WeakMap(), q = new WeakMap(), z = new WeakMap(), E.stack = new at();
245
+ let F = E;
246
+ _ && !customElements.get("e-popover") && customElements.define("e-popover", F);
247
+ var n, d, P, Q, B, D, U, N, Z;
248
+ class lt extends HTMLElement {
239
249
  constructor() {
240
250
  super();
241
- r(this, x);
251
+ r(this, P);
242
252
  r(this, n);
243
- r(this, d, new v(this, "--type", "open"));
253
+ r(this, d, new g(this, "--type", "open"));
244
254
  r(this, B, () => {
245
255
  t(this, d).current !== "close" && this.classList.add("triggered");
246
256
  });
@@ -250,7 +260,7 @@ class at extends HTMLElement {
250
260
  r(this, U, () => {
251
261
  t(this, d).current !== "close" && this.classList.remove("opened");
252
262
  });
253
- r(this, X, () => {
263
+ r(this, N, () => {
254
264
  t(this, d).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
255
265
  });
256
266
  _ && (this.addEventListener("click", () => {
@@ -270,12 +280,12 @@ class at extends HTMLElement {
270
280
  }
271
281
  changePopover(e) {
272
282
  var s;
273
- if (y(this, x, Z).call(this), e) {
283
+ if (y(this, P, Q).call(this), e) {
274
284
  let i = null;
275
285
  if (e === "parent") {
276
- const l = this.closest("[data-popover]");
277
- if (l)
278
- i = l;
286
+ const a = this.closest("[data-popover]");
287
+ if (a)
288
+ i = a;
279
289
  else {
280
290
  const p = this.getRootNode();
281
291
  p instanceof ShadowRoot ? i = p.host.closest("[data-popover]") : p instanceof HTMLElement && (i = p.closest("[data-popover]"));
@@ -283,13 +293,13 @@ class at extends HTMLElement {
283
293
  } else if (e === "sibling")
284
294
  i = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
285
295
  else if (e === "ancestor-child") {
286
- const l = (p) => {
296
+ const a = (p) => {
287
297
  if (!p)
288
298
  return null;
289
299
  let G = p.querySelector("[data-popover]");
290
- return !G && (p != null && p.parentElement) && (G = l(p.parentElement)), G;
300
+ return !G && (p != null && p.parentElement) && (G = a(p.parentElement)), G;
291
301
  };
292
- i = l(this.parentElement) || null;
302
+ i = a(this.parentElement) || null;
293
303
  } else
294
304
  !e.startsWith(".") && !e.startsWith("[") && (e = `#${e}`), i = document.querySelector(e) || this.getRootNode().querySelector(e);
295
305
  i instanceof HTMLElement ? (h(this, n, i), t(this, n).addEventListener(
@@ -303,23 +313,23 @@ class at extends HTMLElement {
303
313
  t(this, U)
304
314
  ), t(this, n).addEventListener(
305
315
  "popoverClosed",
306
- t(this, X)
316
+ t(this, N)
307
317
  )) : console.warn(this, `target ${e} not found`);
308
318
  }
309
- y(this, x, N).call(this, t(this, d).current);
319
+ y(this, P, Z).call(this, t(this, d).current);
310
320
  }
311
321
  connectedCallback() {
312
322
  t(this, d).subscribe((s) => {
313
- y(this, x, N).call(this, s.current);
314
- }), this.hasAttribute("tabindex") || (this.tabIndex = 0);
323
+ y(this, P, Z).call(this, s.current);
324
+ }), this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("role") || this.setAttribute("role", "button");
315
325
  const e = this.getAttribute("target");
316
326
  e && this.changePopover(e), this.isConnected && t(this, d).observe();
317
327
  }
318
328
  disconnectedCallback() {
319
- t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), y(this, x, Z).call(this);
329
+ t(this, d).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), y(this, P, Q).call(this);
320
330
  }
321
331
  }
322
- n = new WeakMap(), d = new WeakMap(), x = new WeakSet(), Z = function() {
332
+ n = new WeakMap(), d = new WeakMap(), P = new WeakSet(), Q = function() {
323
333
  t(this, n) && (t(this, n).removeEventListener(
324
334
  "popoverTriggered",
325
335
  t(this, B)
@@ -331,16 +341,16 @@ n = new WeakMap(), d = new WeakMap(), x = new WeakSet(), Z = function() {
331
341
  t(this, U)
332
342
  ), t(this, n).removeEventListener(
333
343
  "popoverClosed",
334
- t(this, X)
344
+ t(this, N)
335
345
  ));
336
- }, B = new WeakMap(), D = new WeakMap(), U = new WeakMap(), X = new WeakMap(), N = function(e) {
337
- t(this, n) instanceof I && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
346
+ }, B = new WeakMap(), D = new WeakMap(), U = new WeakMap(), N = new WeakMap(), Z = function(e) {
347
+ t(this, n) instanceof F && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
338
348
  "aria-expanded",
339
349
  t(this, n).opened ? "true" : "false"
340
350
  ), this.setAttribute("aria-controls", t(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
341
351
  };
342
- _ && !customElements.get("e-popover-button") && customElements.define("e-popover-button", at);
352
+ _ && !customElements.get("e-popover-button") && customElements.define("e-popover-button", lt);
343
353
  export {
344
- at as PopoverButtonElement,
345
- I as PopoverElement
354
+ lt as PopoverButtonElement,
355
+ F as PopoverElement
346
356
  };
@@ -1 +1 @@
1
- "use strict";var hs=Object.defineProperty;var We=Object.getOwnPropertySymbols,os=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty,cs=Object.prototype.propertyIsEnumerable,us=Reflect.get;var Fe=a=>{throw TypeError(a)};var _e=(a,n,e)=>n in a?hs(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e,Ne=(a,n)=>{for(var e in n||(n={}))ls.call(n,e)&&_e(a,e,n[e]);if(We)for(var e of We(n))cs.call(n,e)&&_e(a,e,n[e]);return a};var Te=(a,n,e)=>n.has(a)||Fe("Cannot "+e);var t=(a,n,e)=>(Te(a,n,"read from private field"),e?e.call(a):n.get(a)),s=(a,n,e)=>n.has(a)?Fe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),h=(a,n,e,i)=>(Te(a,n,"write to private field"),i?i.call(a,e):n.set(a,e),e),c=(a,n,e)=>(Te(a,n,"access private method"),e);var Ue=(a,n,e)=>us(os(a),e,n);var Ge=(a,n,e)=>new Promise((i,r)=>{var l=g=>{try{m(e.next(g))}catch(yt){r(yt)}},f=g=>{try{m(e.throw(g))}catch(yt){r(yt)}},m=g=>g.done?i(g.value):Promise.resolve(g.value).then(l,f);m((e=e.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const as=require("../Store-Cd1GlEmZ.cjs"),T=require("../index-DekP7OZe.cjs"),ds=require("../easings-GegIwET5.cjs"),Ss=require("../element-yhcBhsho.cjs"),le=require("../events-KVanG9sR.cjs"),qe=require("../function-MthRj-GJ.cjs"),Wt=require("../layout-Ctc2p3uz.cjs"),Ke=require("../math-GDWEqu7y.cjs"),je=require("../number-DyefJ5a1.cjs"),Je=require("../stylesheet-HWF2a3nr.cjs");require("../ticker/index.cjs");const Ie=require("../order/index.cjs"),ps=require("../Damped-BD1OQ1fH.cjs"),bs=require("../Tweened-B-AHx93m.cjs"),Le=require("../DragControls-D8BXtKVu.cjs"),_t=require("../window-resizer/index.cjs"),vt=require("../scroll-entries/index.cjs"),Ze=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),fs=require("../Viewport-DB0qAZPJ.cjs");require("construct-style-sheets-polyfill");const de=require("../element-resizer/index.cjs"),ms=require("../gestures-C7gbKx11.cjs"),Qe=require("../dom-JBOkFLTh.cjs"),gs=require("../ScrollSegmentElement-DtMMAirz.cjs");var p,Ft,C,Se,pe,Pt,H,st,Et,wt,ce;class ys{constructor(n,e,i){s(this,wt);s(this,p);s(this,Ft);s(this,C);s(this,Se,0);s(this,pe,0);s(this,Pt,0);s(this,H,0);s(this,st,null);s(this,Et,0);h(this,p,n),h(this,Ft,e),h(this,C,i),vt.scrollEntries.register(t(this,p)),this.setIndex(t(this,Ft))}get element(){return t(this,p)}get index(){return t(this,Ft)}get size(){return t(this,Pt)}get width(){return t(this,Se)}get height(){return t(this,pe)}get position(){return t(this,H)}get transformPosition(){return t(this,Et)}destroy(){vt.scrollEntries.unregister(t(this,p)),this.unsetTransform()}unsetTransform(){t(this,p).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setMiddle(!1),this.setSize()}setSize(n){n?(t(this,p).style.setProperty("--size",n+"px"),t(this,C).axisCSSProperty.current==="x"?(t(this,p).style.width=n+"px",t(this,p).style.height=""):(t(this,p).style.height=n+"px",t(this,p).style.width="")):(t(this,p).style.width="",t(this,p).style.height="",t(this,p).style.removeProperty("--size"))}resize(){h(this,Se,t(this,p).offsetWidth),h(this,pe,t(this,p).offsetHeight),h(this,Pt,t(this,C).vertical?t(this,p).offsetHeight:t(this,p).offsetWidth),h(this,H,t(this,C).vertical?Wt.getCumulativeOffsetTop(t(this,p)):Wt.getCumulativeOffsetLeft(t(this,p))),h(this,H,t(this,H)-t(this,C).contentPosition)}transform(){const n=t(this,C).shiftSectionPositionCSSProperty.current;let e=n;const i=t(this,C).viewportSize*t(this,C).sectionDistanceScaleCSSProperty.current;t(this,C).loopCSSProperty.current&&t(this,H)+t(this,Pt)<=t(this,C).currentScrollValue-n/2&&(e=(t(this,C).distance-n)*-1-t(this,C).gap),vt.scrollEntries.update(t(this,p),t(this,C).axisCSSProperty.current,e);const r=t(this,C).currentScrollValue+e,l=t(this,H)-t(this,C).viewportSize-i,f=t(this,H)+t(this,Pt)+i,m=je.preciseNumber(Ke.clamp(r,l,f),3);h(this,Et,m*-1),t(this,C).vertical?t(this,p).style.transform=`translate3d(0px, ${t(this,Et)}px, 0px)`:t(this,p).style.transform=`translate3d(${t(this,Et)}px, 0px, 0px)`}setMark(n){t(this,st)!==n&&(t(this,st)&&t(this,p).classList.remove(t(this,st)),n&&t(this,p).classList.add(n),h(this,st,n),le.dispatchEvent(t(this,p),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,st)},custom:!0}))}setMiddle(n){t(this,p).classList.toggle("middle",n)}setIndex(n){c(this,wt,ce).call(this,"index",n)}setCurrentIndex(n){c(this,wt,ce).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,wt,ce).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,wt,ce).call(this,"current-index-arc-abs",n)}}p=new WeakMap,Ft=new WeakMap,C=new WeakMap,Se=new WeakMap,pe=new WeakMap,Pt=new WeakMap,H=new WeakMap,st=new WeakMap,Et=new WeakMap,wt=new WeakSet,ce=function(n,e){e!==null?(t(this,p).style.setProperty(`--${n}`,e.toString()),t(this,p).setAttribute(`data-${n}`,e.toString())):(t(this,p).style.removeProperty(`--${n}`),t(this,p).removeAttribute(`data-${n}`))};const Cs=Je.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var d,xt,x,it,W,_,F,q,rt,nt,N,ht,zt,D,P,Lt,It,kt,At,Nt,Rt,R,Mt,ot,M,lt,U,Tt,ct,qt,ut,at,dt,b,Ut,k,u,be,fe,v,y,A,B,St,V,w,z,Gt,G,Z,K,j,Zt,pt,J,Dt,O,E,Kt,Q,Bt,jt,o,De,ue,Ht,ke,Ae,Be,Ve,L,me,Xe,Jt,ge,Oe,$e,Ct,Ye,ye,ae,Ce;class Ot extends HTMLElement{constructor(){super();s(this,o);s(this,d,null);s(this,xt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,it,new S.CSSProperty(this,"--reverse",!1));s(this,W,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,F,new S.CSSProperty(this,"--split",!1));s(this,q,new S.CSSProperty(this,"--sectional",!1));s(this,rt,new S.CSSProperty(this,"--tween-easing",!1));s(this,nt,new S.CSSProperty(this,"--tween-duration",!1));s(this,N,new S.CSSProperty(this,"--auto-size",!1));s(this,ht,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,zt,new S.CSSProperty(this,"--drag-inertion",1));s(this,D,new S.CSSProperty(this,"--sections-in-view",1));s(this,P,new S.CSSProperty(this,"--loop",!1));s(this,Lt,new S.CSSProperty(this,"--damping",20));s(this,It,new S.CSSProperty(this,"--mass",0));s(this,kt,new S.CSSProperty(this,"--stiffness",0));s(this,At,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Nt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,Rt,new S.CSSProperty(this,"--start-section",0));s(this,R,new S.CSSProperty(this,"--autoplay",0));s(this,Mt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,ot,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,M,new S.CSSProperty(this,"--classes",!1));s(this,lt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,U,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,Tt,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ct,new S.CSSProperty(this,"--focus-delay",0));s(this,qt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ut,new S.CSSProperty(this,"--disabled",!1));s(this,at,new S.CSSProperty(this,"--hibernate",!1));s(this,dt,null);s(this,b,null);s(this,Ut,null);s(this,k,[]);s(this,u,[]);s(this,be,0);s(this,fe,0);s(this,v,0);s(this,y,0);s(this,A,0);s(this,B,null);s(this,St,null);s(this,V,null);s(this,w,null);s(this,z,new as.Store(0));s(this,Gt,0);s(this,G,0);s(this,Z,!1);s(this,K,!0);s(this,j,!0);s(this,Zt);s(this,pt);s(this,J,new bs.Tweened);s(this,Dt,!1);s(this,O,null);s(this,E,!1);s(this,Kt,null);s(this,Q,[]);s(this,Bt,!1);s(this,jt);s(this,L,e=>{if(e&&t(this,Bt)){h(this,Bt,!1);return}this.resize()});s(this,me,()=>{if(!t(this,Z)||t(this,j)||t(this,K))return;const e=this.currentScrollValue;if(h(this,Gt,Math.max(0,e-t(this,y))),t(this,u).length){for(let i=0;i<t(this,k).length;i++)t(this,k)[i].transform();t(this,z).current=c(this,o,ae).call(this)}else this.vertical?t(this,b).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,b).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;c(this,o,Ye).call(this),vt.scrollEntries.update(this,t(this,x).current,e)});s(this,Jt,(e,i)=>{t(this,xt).current&&(c(this,o,Oe).call(this,Math.sign(i)||1),t(this,ge).call(this,e,i))});s(this,ge,(e,i)=>{if(t(this,W).current){if(t(this,W).current<0&&i>0)return;if(t(this,W).current>0&&i<0)return}if(t(this,pt)||t(this,J).unlistenAnimationFrame(),!t(this,R).current&&t(this,ct).current&&(clearInterval(t(this,Zt)),h(this,Zt,setTimeout(()=>{const r=t(this,u)[c(this,o,ae).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,qt).current,easing:ds.easeInOutExpo}})},t(this,ct).current))),!(e.includes("drag")&&!fs.device.isTouch&&!t(this,At).current)){if(t(this,q).current&&e!=="drag"){const r=Math.sign(i);if(t(this,u).length){const l={tween:t(this,rt).current||t(this,nt).current?{easing:t(this,rt).current||"easeInOutCubic",duration:t(this,nt).current||500}:void 0};t(this,Dt)?this.scrollToSection(c(this,o,ae).call(this,!0),l):this.shiftSections(r,l)}else t(this,d).shift(r*t(this,v))}else t(this,d).shift(i);h(this,Dt,e==="drag")}});s(this,ye,qe.debounce(()=>{const e=t(this,Q).reduce((i,r)=>{const l=this.vertical?r.width:r.height;return l>i?l:i},0);clearTimeout(t(this,jt)),h(this,Bt,!0),this.style.setProperty("--max-section-size",""),h(this,jt,setTimeout(()=>{h(this,Bt,!0),this.style.setProperty("--max-section-size",e+"px")},10))},20));s(this,Ce,()=>{h(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,Ve).call(this)});if(T.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Cs];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,dt,document.createElement("div")),t(this,dt).className="content-wrapper",h(this,b,document.createElement("div")),t(this,b).className="content",h(this,Ut,document.createElement("slot")),t(this,b).appendChild(t(this,Ut)),t(this,dt).appendChild(t(this,b)),e.appendChild(t(this,dt)),h(this,Kt,new MutationObserver(qe.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,d)}get controlsCSSProperty(){return t(this,xt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,it)}get directionCSSProperty(){return t(this,W)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,F)}get sectionalCSSProperty(){return t(this,q)}get easingCSSProperty(){return t(this,rt)}get durationCSSProperty(){return t(this,nt)}get autoSizeCSSProperty(){return t(this,N)}get wheelMaxDeltaCSSProperty(){return t(this,ht)}get dragInertionCSSProperty(){return t(this,zt)}get sectionsInViewCSSProperty(){return t(this,D)}get loopCSSProperty(){return t(this,P)}get dampingCSSProperty(){return t(this,Lt)}get massCSSProperty(){return t(this,It)}get stiffnessCSSProperty(){return t(this,kt)}get mouseDragCSSProperty(){return t(this,At)}get sectionDistanceScaleCSSProperty(){return t(this,Nt)}get startSectionCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,R)}get autoplayPauseDurationCSSProperty(){return t(this,Mt)}get autoplayUserDirectionCSSProperty(){return t(this,ot)}get classesCSSProperty(){return t(this,M)}get currentIndexStartOffsetCSSProperty(){return t(this,lt)}get currentIndexEndOffsetCSSProperty(){return t(this,U)}get shiftSectionPositionCSSProperty(){return t(this,Tt)}get focusDelayCSSProperty(){return t(this,ct)}get focusDurationCSSProperty(){return t(this,qt)}get disabledCSSProperty(){return t(this,ut)}get hibernatedCSSProperty(){return t(this,at)}get currentScrollValue(){return c(this,o,$e).call(this,"current")}get targetScrollValue(){return c(this,o,$e).call(this,"target")}get contentWrapperElement(){return t(this,dt)}get contentElement(){return t(this,b)}get sections(){return t(this,k)}get visibleSections(){return t(this,u)}get position(){return t(this,be)}get contentPosition(){return t(this,fe)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,y)}get gap(){return t(this,A)}get counter(){return t(this,z)}get limit(){return Math.ceil(t(this,u).length-t(this,D).current)}get distance(){return t(this,G)}get loopDistance(){return t(this,P).current?t(this,G)+t(this,A):t(this,G)}get hasOverflow(){return t(this,Z)}get overscroll(){return t(this,Gt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,d).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,d).distance}tryResplit(){!t(this,j)&&(t(this,P).current||t(this,F).current||t(this,P).current||t(this,N).current||t(this,q).current)&&c(this,o,ue).call(this)}onScroll(...e){return t(this,d).subscribe(...e)}offScroll(...e){t(this,d).unsubscribe(...e)}range(e,i,r=0){const l=e-r,f=l+i+r*2;return this.currentProgress<l?0:this.currentProgress>f?1:(this.currentProgress-l)/(f-l)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const l=e-r,f=l+i+r*2;return this.currentProgress>=l&&this.currentProgress<=f}scrollToSection(e,i){if(!t(this,u).length)return;const r=t(this,z).current,l=c(this,o,Xe).call(this,e),f=t(this,u)[r],m=t(this,u)[l];if(f&&m){let g=0;const yt=c(this,o,ae).call(this),$t=t(this,u)[yt];let oe=$t?this.targetScrollValue-$t.position:0;t(this,P).current?l===0&&r===t(this,u).length-1?(g=t(this,y)+t(this,v)-f.position+t(this,A),t(this,Dt)||(oe=0)):l===t(this,u).length-1&&r===0?g=m.position-(t(this,y)+t(this,v)+t(this,A)):g=m.position-f.position:g=m.position-f.position,this.shiftPosition(g-oe,i)}}shiftSections(e,i){t(this,u).length&&this.scrollToSection(t(this,z).current+e,i)}setPosition(e,i){c(this,o,Oe).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,pt)||(t(this,J).set(t(this,d).current,{equalize:!0}),t(this,J).set(e,Ne({},i.tween)),h(this,pt,setTimeout(()=>{h(this,pt,void 0)},i.tween.duration||0))):t(this,d).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,d).target+e,i)}resize(){if(t(this,at).current)return;h(this,u,t(this,k).filter(r=>Ss.isElementVisible(r.element))),this.style.setProperty("--sections",t(this,u).length.toString()),t(this,d).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,y)||0,i=t(this,z).current;if(h(this,be,this.vertical?Wt.getCumulativeOffsetTop(this):Wt.getCumulativeOffsetLeft(this)),h(this,fe,this.vertical?Wt.getCumulativeOffsetTop(t(this,b)):Wt.getCumulativeOffsetLeft(t(this,b))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,A,Ze.cssUnitParser.parse(getComputedStyle(t(this,b)).rowGap)):h(this,A,Ze.cssUnitParser.parse(getComputedStyle(t(this,b)).columnGap)),t(this,N).current&&t(this,u).length){const r=t(this,D).current,l=(t(this,v)-t(this,A)*(r-1))/r;t(this,u).forEach(f=>{f.setSize(l)})}else t(this,u).forEach(r=>{r.setSize()});if(t(this,u).forEach(r=>{r.resize()}),t(this,_).current){h(this,y,t(this,v)*t(this,_).current);const r=t(this,y)+t(this,v);this.vertical?(t(this,b).style.width=r+"px",t(this,b).style.height="100%"):(t(this,b).style.height=r+"px",t(this,b).style.width="100%")}else this.vertical?(t(this,b).style.width="100%",t(this,b).style.height="max-content",h(this,y,t(this,b).offsetHeight-t(this,v))):(t(this,b).style.width="max-content",t(this,b).style.height="100%",h(this,y,t(this,b).offsetWidth-t(this,v)));if(!t(this,P).current){const r=getComputedStyle(this),l=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,y,t(this,y)+l),t(this,d).max=t(this,y)}if(t(this,P).current&&t(this,u).length){const r=t(this,u)[t(this,u).length-1],l=r.position+r.size-t(this,v),f=t(this,y)-l;h(this,G,r.position+r.size+f)}else h(this,G,t(this,y));if(t(this,q).current&&t(this,u).length){const r=t(this,u)[i];t(this,d).set(r.position,{equalize:!0})}else t(this,d).set(e*t(this,y),{equalize:!0});h(this,Z,(this.vertical?t(this,b).offsetHeight:t(this,b).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,Z)),t(this,Z)?t(this,ut).current||c(this,o,Ae).call(this):c(this,o,ke).call(this),t(this,ye).call(this),le.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,d).notify()}connectedCallback(){vt.scrollEntries.register(this),h(this,d,new ps.Damped(0,{damping:.01,min:0,order:Ie.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,B,new Le.WheelControls({element:t(this,b)})),t(this,B).changeEvent.subscribe(t(this,Jt)),h(this,St,new Le.KeyboardControls({element:this})),t(this,St).changeEvent.subscribe(t(this,Jt)),h(this,V,new Le.DragControls({element:t(this,b),rootElement:this})),t(this,V).changeEvent.subscribe(t(this,Jt)),h(this,w,new Le.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,ge)),t(this,x).subscribe(()=>{c(this,o,De).call(this)}),t(this,it).subscribe(()=>{c(this,o,De).call(this)}),t(this,ht).subscribe(e=>{t(this,B).axis=e.current?"max":t(this,x).current}),t(this,zt).subscribe(e=>{t(this,V).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,F).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,ue).call(this):c(this,o,Ht).call(this))}),t(this,q).subscribe(e=>{t(this,B).debounce=e.current,t(this,V).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,u).length?c(this,o,ue).call(this):!e.current&&e.previous&&t(this,u).length&&c(this,o,Ht).call(this))}),t(this,N).subscribe(e=>{t(this,E)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,u).length?c(this,o,ue).call(this):!e.current&&e.previous&&t(this,u).length&&c(this,o,Ht).call(this))}),t(this,D).subscribe(e=>{t(this,E)&&(t(this,L).call(this),c(this,o,Ct).call(this))}),t(this,P).subscribe(e=>{e.current?(t(this,E)&&(t(this,u).length||(t(this,F).current=!0)),t(this,d).max=1/0,t(this,d).min=-1/0):(h(this,Gt,0),t(this,d).max=t(this,y),t(this,d).min=0)}),t(this,Lt).subscribe(e=>{t(this,d).damping=e.current}),t(this,It).subscribe(e=>{t(this,d).mass=e.current}),t(this,kt).subscribe(e=>{t(this,d).stiffness=e.current}),t(this,R).subscribe(e=>{t(this,w).speed=e.current,!t(this,K)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,ot).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,M).subscribe(e=>{t(this,E)&&c(this,o,Ct).call(this)}),t(this,lt).subscribe(e=>{t(this,E)&&t(this,M).current&&c(this,o,Ct).call(this)}),t(this,U).subscribe(e=>{t(this,E)&&t(this,M).current&&c(this,o,Ct).call(this)}),t(this,Tt).subscribe(e=>{t(this,E)&&t(this,d).notify()}),t(this,d).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,z).subscribe(e=>{t(this,u).length&&c(this,o,Ct).call(this),this.style.setProperty("--counter",e.current+"")}),t(this,J).subscribe(e=>{t(this,J).isRunning.current&&t(this,d).set(e.current,{equalize:!0})}),t(this,ut).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ke).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Ae).call(this))}),t(this,at).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,Be).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,Ve).call(this))}),t(this,xt).observe(),t(this,x).observe(),t(this,it).observe(),t(this,W).observe(),t(this,_).observe(),t(this,F).observe(),t(this,q).observe(),t(this,rt).observe(),t(this,nt).observe(),t(this,N).observe(),t(this,ht).observe(),t(this,zt).observe(),t(this,D).observe(),t(this,P).observe(),t(this,Lt).observe(),t(this,It).observe(),t(this,kt).observe(),t(this,At).observe(),t(this,Nt).observe(),t(this,Rt).observe(),t(this,R).observe(),t(this,R).observe(),t(this,Mt).observe(),t(this,ot).observe(),t(this,M).observe(),t(this,lt).observe(),t(this,U).observe(),t(this,Tt).observe(),t(this,ct).observe(),t(this,qt).observe(),t(this,ut).observe(),t(this,at).observe(),_t.windowResizer.subscribe(t(this,Ce),Ie.RESIZE_ORDER.LAST),de.elementResizer.subscribe(this,t(this,L)),t(this,Kt).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,xt).unobserve(),t(this,x).unobserve(),t(this,it).unobserve(),t(this,W).unobserve(),t(this,_).unobserve(),t(this,F).unobserve(),t(this,q).unobserve(),t(this,rt).unobserve(),t(this,nt).unobserve(),t(this,N).unobserve(),t(this,ht).unobserve(),t(this,zt).unobserve(),t(this,D).unobserve(),t(this,P).unobserve(),t(this,Lt).unobserve(),t(this,It).unobserve(),t(this,kt).unobserve(),t(this,At).unobserve(),t(this,Nt).unobserve(),t(this,Rt).unobserve(),t(this,R).unobserve(),t(this,Mt).unobserve(),t(this,ot).unobserve(),t(this,M).unobserve(),t(this,lt).unobserve(),t(this,U).unobserve(),t(this,Tt).unobserve(),t(this,ct).unobserve(),t(this,qt).unobserve(),t(this,ut).unobserve(),t(this,at).unobserve(),_t.windowResizer.unsubscribe(t(this,Ce)),de.elementResizer.unsubscribe(t(this,L)),c(this,o,Be).call(this),t(this,Kt).disconnect()}}d=new WeakMap,xt=new WeakMap,x=new WeakMap,it=new WeakMap,W=new WeakMap,_=new WeakMap,F=new WeakMap,q=new WeakMap,rt=new WeakMap,nt=new WeakMap,N=new WeakMap,ht=new WeakMap,zt=new WeakMap,D=new WeakMap,P=new WeakMap,Lt=new WeakMap,It=new WeakMap,kt=new WeakMap,At=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,R=new WeakMap,Mt=new WeakMap,ot=new WeakMap,M=new WeakMap,lt=new WeakMap,U=new WeakMap,Tt=new WeakMap,ct=new WeakMap,qt=new WeakMap,ut=new WeakMap,at=new WeakMap,dt=new WeakMap,b=new WeakMap,Ut=new WeakMap,k=new WeakMap,u=new WeakMap,be=new WeakMap,fe=new WeakMap,v=new WeakMap,y=new WeakMap,A=new WeakMap,B=new WeakMap,St=new WeakMap,V=new WeakMap,w=new WeakMap,z=new WeakMap,Gt=new WeakMap,G=new WeakMap,Z=new WeakMap,K=new WeakMap,j=new WeakMap,Zt=new WeakMap,pt=new WeakMap,J=new WeakMap,Dt=new WeakMap,O=new WeakMap,E=new WeakMap,Kt=new WeakMap,Q=new WeakMap,Bt=new WeakMap,jt=new WeakMap,o=new WeakSet,De=function(){const e=t(this,x).current,i=t(this,it).current?"-reverse":"";t(this,b).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,B).axis=t(this,ht).current?"max":e,t(this,St).dimension=e==="x"?"width":"height",t(this,V).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,L).call(this)},ue=function(){c(this,o,Ht).call(this),t(this,Ut).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&e.tagName!=="SCRIPT"&&t(this,k).push(new ys(e,i,this))}),h(this,u,[...t(this,k)]),t(this,b).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,Ct).call(this)},Ht=function(){t(this,k).forEach(e=>{e.destroy()}),h(this,k,[]),h(this,u,[]),t(this,z).reset(),t(this,d).reset(),this.style.removeProperty("--max-section-size"),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ke=function(){t(this,K)||(h(this,K,!0),t(this,d).unsubscribe(t(this,me)),t(this,d).unlistenAnimationFrame(),clearInterval(t(this,Zt)),clearInterval(t(this,pt)),t(this,J).unlistenAnimationFrame(),t(this,B).disconnect(),t(this,St).disconnect(),t(this,V).disconnect(),t(this,w).disconnect(),t(this,Z)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Ae=function(){t(this,K)&&(h(this,K,!1),t(this,d).subscribe(t(this,me),-1e4),t(this,d).notify(),t(this,B).connect(),t(this,St).connect(),t(this,V).connect(),t(this,R).current&&t(this,w).connect())},Be=function(){t(this,j)||(h(this,j,!0),clearTimeout(t(this,jt)),_t.windowResizer.unsubscribe(t(this,L)),c(this,o,ke).call(this),t(this,b).style.transform="",t(this,b).style.height="",t(this,b).style.width="",this.classList.remove("has-overflow","start","end"),t(this,k).length?c(this,o,Ht).call(this):(t(this,z).reset(),t(this,d).reset()),vt.scrollEntries.unregister(this))},Ve=function(){t(this,j)&&(h(this,j,!1),vt.scrollEntries.register(this),this.tryResplit(),c(this,o,Ae).call(this),this.scrollToSection(t(this,Rt).current,{behaviour:"instant"}),_t.windowResizer.subscribe(t(this,L),Ie.RESIZE_ORDER.SCROLL))},L=new WeakMap,me=new WeakMap,Xe=function(e){let i=t(this,z).current;return t(this,P).current?i=je.loopNumber(e,t(this,u).length):i=Ke.clamp(e,0,this.limit),i},Jt=new WeakMap,ge=new WeakMap,Oe=function(e=1){t(this,ot).current&&(t(this,w).direction=e),t(this,R).current&&t(this,w).pauseAndContinue(t(this,Mt).current,this.sectionalCSSProperty.current)},$e=function(e="current"){if(t(this,P).current&&t(this,u).length){const i=t(this,d)[e]%Math.round(t(this,y)+t(this,v)+t(this,A));return i<0?t(this,y)+i+t(this,v)+t(this,A):i}else return t(this,d)[e]},Ct=function(){if(t(this,u).length){const e=t(this,z).current+t(this,lt).current;if(e===0?h(this,O,"start"):e===this.limit?h(this,O,"end"):h(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,M).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,D).current+t(this,U).current;h(this,Q,[]),t(this,u).forEach((r,l)=>{r.setCurrentIndex(null),r.setCurrentIndexArc(null),r.setCurrentIndexArcAbs(null),r.setMiddle(!1);const f=e-this.limit-1+t(this,U).current,m=e+i,g=this.sections.length-m;l>=e&&l<m||l<=f?(r.setMark("current"),t(this,Q).push(r)):l>=m&&l<m+g/2||l<=f+i?r.setMark("next"):r.setMark("previous")}),t(this,ye).call(this)}}},Ye=function(){if(t(this,M).current){const e=Math.floor(t(this,Q).length/2);t(this,Q).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,Q).forEach((i,r)=>{const l=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(l),i.setCurrentIndexArcAbs(Math.abs(l)),i.setMiddle(r===e)})}},ye=new WeakMap,ae=function(e=!1){let i=this.targetScrollValue,r=1/0,l=0;const f=t(this,d).direction;for(let m=0;m<t(this,u).length;m++){const g=t(this,u)[m];let yt=t(this,Dt)?g.size*f*-1*.4:0,$t=g.position;this.overscroll&&$t===0&&e&&($t=t(this,G));let oe=Math.abs($t+yt-i);oe<=r&&(r=oe,l=m)}return l},Ce=new WeakMap;T.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Ot);var ve;class Me extends HTMLElement{constructor(){super(...arguments);s(this,ve,null)}get scrollElement(){return t(this,ve)}connectedCallback(){const e=Qe.findParentElement(this,Ot);e instanceof Ot?h(this,ve,e):console.error(this,"e-scroll not found")}}ve=new WeakMap;var bt,I,X,Y,Qt,Xt,ft,Yt,Pe,Ee;class ts extends Me{constructor(){super();s(this,bt,null);s(this,I,null);s(this,X,!1);s(this,Y,0);s(this,Qt,0);s(this,Xt,0);s(this,ft,()=>{h(this,X,this.offsetWidth>this.offsetHeight);const e=t(this,X)?this.offsetWidth:this.offsetHeight;h(this,Y,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,Y,Math.max(t(this,Y),30)),t(this,X)?(t(this,I).style.width=t(this,Y)+"px",t(this,I).style.height="100%"):(t(this,I).style.width="100%",t(this,I).style.height=t(this,Y)+"px"),h(this,Qt,e-t(this,Y)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Yt).call(this)});s(this,Yt,()=>{h(this,Xt,this.scrollElement.currentProgress*t(this,Qt)),t(this,X)?t(this,I).style.transform=`translate3d(${t(this,Xt)}px, 0px, 0px)`:t(this,I).style.transform=`translate3d(0px, ${t(this,Xt)}px, 0px)`});s(this,Pe,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Ee,e=>{document.documentElement.classList.add("grabbing"),ms.setupDrag(l=>{const f=t(this,X)?l.x:l.y,m=this.scrollElement.distance/t(this,Qt),g=(f-r)*m;this.scrollElement.setPosition(i+g)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,X)?e.x:e.y});if(T.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Je.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],h(this,bt,document.createElement("slot")),t(this,bt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,bt))}}get thumbElement(){return t(this,I)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,bt).assignedElements()[0]||t(this,bt).firstElementChild;h(this,I,e),t(this,I).addEventListener("pointerdown",t(this,Ee)),_t.windowResizer.subscribe(t(this,ft),Ie.RESIZE_ORDER.SCROLL),de.elementResizer.subscribe(this,t(this,ft)),de.elementResizer.subscribe(this.scrollElement,t(this,ft)),this.scrollElement.onScroll(t(this,Yt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Pe))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,I).removeEventListener("pointerdown",t(this,Ee)),_t.windowResizer.unsubscribe(t(this,ft)),de.elementResizer.unsubscribe(t(this,ft)),this.scrollElement.offScroll(t(this,Yt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Pe))}}bt=new WeakMap,I=new WeakMap,X=new WeakMap,Y=new WeakMap,Qt=new WeakMap,Xt=new WeakMap,ft=new WeakMap,Yt=new WeakMap,Pe=new WeakMap,Ee=new WeakMap;T.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",ts);var te,ee,se;class es extends Me{constructor(){super();s(this,te,new S.CSSProperty(this,"--behaviour","smooth"));s(this,ee,new S.CSSProperty(this,"--tween-easing",!1));s(this,se,new S.CSSProperty(this,"--tween-duration",0));T.isBrowser&&this.addEventListener("click",()=>{const e=t(this,te).current,i=t(this,ee).current,r=t(this,se).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),t(this,te).observe(),t(this,ee).observe(),t(this,se).observe()}disconnectedCallback(){t(this,te).close(),t(this,ee).close(),t(this,se).close()}}te=new WeakMap,ee=new WeakMap,se=new WeakMap;var ie;class ss extends es{constructor(){super(...arguments);s(this,ie,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,ie).current,e)}connectedCallback(){super.connectedCallback(),t(this,ie).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,ie).close()}}ie=new WeakMap;T.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",ss);var tt,re;class is extends es{constructor(){super(...arguments);s(this,tt,new S.CSSProperty(this,"--step",1));s(this,re,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,tt).current>0&&this.scrollElement.scrollLine==="end"||t(this,tt).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,tt).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,tt).subscribe(()=>{t(this,re).call(this)}),t(this,tt).observe(),this.scrollElement.addEventListener("scrollLine",t(this,re)),t(this,re).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,tt).close(),this.removeAttribute("disabled")}}tt=new WeakMap,re=new WeakMap;T.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",is);var $,mt,ne,we,xe,he;class vs{constructor(n,e,i){s(this,$,null);s(this,mt,null);s(this,ne,null);s(this,we,null);s(this,xe,()=>{t(this,mt).scrollToSection(t(this,ne),{behaviour:t(this,we)})});s(this,he,()=>{t(this,$).classList.toggle("current",t(this,mt).counter.current===t(this,ne))});T.isBrowser&&(h(this,$,document.createElement("button")),t(this,$).setAttribute("aria-label",`Go to section ${e+1}`),h(this,mt,n),h(this,we,i),h(this,ne,e),t(this,$).addEventListener("click",t(this,xe)),t(this,mt).counter.subscribe(t(this,he)),t(this,he).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,xe)),t(this,mt).counter.unsubscribe(t(this,he)),t(this,$).remove()}}$=new WeakMap,mt=new WeakMap,ne=new WeakMap,we=new WeakMap,xe=new WeakMap,he=new WeakMap;var Vt,gt,et;class rs extends Me{constructor(){super(...arguments);s(this,Vt,null);s(this,gt,[]);s(this,et,qe.debounce(()=>{t(this,gt).forEach(i=>i.destroy()),h(this,gt,[]);let e=0;this.scrollElement.loopCSSProperty.current?e=this.scrollElement.visibleSections.length:e=this.scrollElement.visibleSections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new vs(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");t(this,Vt).appendChild(r.element),t(this,gt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",this.scrollElement.addEventListener("scrollSectionsChange",t(this,et)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,et)),this.scrollElement.loopCSSProperty.subscribe(t(this,et)),h(this,Vt,document.createElement("div")),this.appendChild(t(this,Vt))}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",t(this,et)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,et)),this.scrollElement.loopCSSProperty.unsubscribe(t(this,et)),t(this,gt).forEach(e=>e.destroy()),h(this,gt,[]),t(this,Vt).remove()}}Vt=new WeakMap,gt=new WeakMap,et=new WeakMap;T.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",rs);class ns extends gs.ScrollSegmentElement{connectedCallback(){const n=Qe.findParentElement(this,Ot);n instanceof Ot?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.addEventListener("scrollResize",this.resize),this.resize()):console.error(this,"e-scroll not found")}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer instanceof Ot&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}T.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",ns);var ze;const He=class He extends Me{constructor(){super(...arguments);s(this,ze,()=>{this.textContent=`${this.scrollElement.counter.current+1}`})}connectedCallback(){return Ge(this,null,function*(){Ue(He.prototype,this,"connectedCallback").call(this),this.scrollElement.counter.subscribe(t(this,ze))})}disconnectedCallback(){this.scrollElement.counter.unsubscribe(t(this,ze))}};ze=new WeakMap;let Re=He;T.isBrowser&&!customElements.get("e-scroll-counter")&&customElements.define("e-scroll-counter",Re);exports.ScrollBulletButtonsElement=rs;exports.ScrollCounterElement=Re;exports.ScrollElement=Ot;exports.ScrollSegmentElement=ns;exports.ScrollSetButtonElement=ss;exports.ScrollStepButtonElement=is;exports.ScrollbarElement=ts;
1
+ "use strict";var hs=Object.defineProperty;var We=Object.getOwnPropertySymbols,os=Object.getPrototypeOf,ls=Object.prototype.hasOwnProperty,cs=Object.prototype.propertyIsEnumerable,us=Reflect.get;var Fe=a=>{throw TypeError(a)};var _e=(a,n,e)=>n in a?hs(a,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):a[n]=e,Ne=(a,n)=>{for(var e in n||(n={}))ls.call(n,e)&&_e(a,e,n[e]);if(We)for(var e of We(n))cs.call(n,e)&&_e(a,e,n[e]);return a};var Te=(a,n,e)=>n.has(a)||Fe("Cannot "+e);var t=(a,n,e)=>(Te(a,n,"read from private field"),e?e.call(a):n.get(a)),s=(a,n,e)=>n.has(a)?Fe("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(a):n.set(a,e),h=(a,n,e,i)=>(Te(a,n,"write to private field"),i?i.call(a,e):n.set(a,e),e),c=(a,n,e)=>(Te(a,n,"access private method"),e);var Ue=(a,n,e)=>us(os(a),e,n);var Ge=(a,n,e)=>new Promise((i,r)=>{var l=g=>{try{m(e.next(g))}catch(yt){r(yt)}},f=g=>{try{m(e.throw(g))}catch(yt){r(yt)}},m=g=>g.done?i(g.value):Promise.resolve(g.value).then(l,f);m((e=e.apply(a,n)).next())});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const as=require("../Store-Cd1GlEmZ.cjs"),T=require("../index-DekP7OZe.cjs"),ds=require("../easings-GegIwET5.cjs"),Ss=require("../element-yhcBhsho.cjs"),le=require("../events-KVanG9sR.cjs"),qe=require("../function-MthRj-GJ.cjs"),Wt=require("../layout-Ctc2p3uz.cjs"),Ke=require("../math-GDWEqu7y.cjs"),je=require("../number-DyefJ5a1.cjs"),Je=require("../stylesheet-HWF2a3nr.cjs");require("../ticker/index.cjs");const Ie=require("../order/index.cjs"),ps=require("../Damped-BD1OQ1fH.cjs"),bs=require("../Tweened-B-AHx93m.cjs"),Le=require("../DragControls-D8BXtKVu.cjs"),_t=require("../window-resizer/index.cjs"),vt=require("../scroll-entries/index.cjs"),Ze=require("../css-unit-parser/index.cjs"),S=require("../css-property/index.cjs"),fs=require("../Viewport-DB0qAZPJ.cjs");require("construct-style-sheets-polyfill");const de=require("../element-resizer/index.cjs"),ms=require("../gestures-C7gbKx11.cjs"),Qe=require("../dom-JBOkFLTh.cjs"),gs=require("../ScrollSegmentElement-DtMMAirz.cjs");var p,Ft,C,Se,pe,Pt,H,st,Et,wt,ce;class ys{constructor(n,e,i){s(this,wt);s(this,p);s(this,Ft);s(this,C);s(this,Se,0);s(this,pe,0);s(this,Pt,0);s(this,H,0);s(this,st,null);s(this,Et,0);h(this,p,n),h(this,Ft,e),h(this,C,i),vt.scrollEntries.register(t(this,p)),this.setIndex(t(this,Ft))}get element(){return t(this,p)}get index(){return t(this,Ft)}get size(){return t(this,Pt)}get width(){return t(this,Se)}get height(){return t(this,pe)}get position(){return t(this,H)}get transformPosition(){return t(this,Et)}destroy(){vt.scrollEntries.unregister(t(this,p)),this.unsetTransform()}unsetTransform(){t(this,p).style.transform="",this.setMark(null),this.setIndex(null),this.setCurrentIndex(null),this.setCurrentIndexArc(null),this.setCurrentIndexArcAbs(null),this.setMiddle(!1),this.setSize()}setSize(n){n?(t(this,p).style.setProperty("--size",n+"px"),t(this,C).axisCSSProperty.current==="x"?(t(this,p).style.width=n+"px",t(this,p).style.height=""):(t(this,p).style.height=n+"px",t(this,p).style.width="")):(t(this,p).style.width="",t(this,p).style.height="",t(this,p).style.removeProperty("--size"))}resize(){h(this,Se,t(this,p).offsetWidth),h(this,pe,t(this,p).offsetHeight),h(this,Pt,t(this,C).vertical?t(this,p).offsetHeight:t(this,p).offsetWidth),h(this,H,t(this,C).vertical?Wt.getCumulativeOffsetTop(t(this,p)):Wt.getCumulativeOffsetLeft(t(this,p))),h(this,H,t(this,H)-t(this,C).contentPosition)}transform(){const n=t(this,C).shiftSectionPositionCSSProperty.current;let e=n;const i=t(this,C).viewportSize*t(this,C).sectionDistanceScaleCSSProperty.current;t(this,C).loopCSSProperty.current&&t(this,H)+t(this,Pt)<=t(this,C).currentScrollValue-n/2&&(e=(t(this,C).distance-n)*-1-t(this,C).gap),vt.scrollEntries.update(t(this,p),t(this,C).axisCSSProperty.current,e);const r=t(this,C).currentScrollValue+e,l=t(this,H)-t(this,C).viewportSize-i,f=t(this,H)+t(this,Pt)+i,m=je.preciseNumber(Ke.clamp(r,l,f),3);h(this,Et,m*-1),t(this,C).vertical?t(this,p).style.transform=`translate3d(0px, ${t(this,Et)}px, 0px)`:t(this,p).style.transform=`translate3d(${t(this,Et)}px, 0px, 0px)`}setMark(n){t(this,st)!==n&&(t(this,st)&&t(this,p).classList.remove(t(this,st)),n&&t(this,p).classList.add(n),h(this,st,n),le.dispatchEvent(t(this,p),"scrollSectionMarkChange",{composed:!0,detail:{mark:t(this,st)},custom:!0}))}setMiddle(n){t(this,p).classList.toggle("middle",n)}setIndex(n){c(this,wt,ce).call(this,"index",n)}setCurrentIndex(n){c(this,wt,ce).call(this,"current-index",n)}setCurrentIndexArc(n){c(this,wt,ce).call(this,"current-index-arc",n)}setCurrentIndexArcAbs(n){c(this,wt,ce).call(this,"current-index-arc-abs",n)}}p=new WeakMap,Ft=new WeakMap,C=new WeakMap,Se=new WeakMap,pe=new WeakMap,Pt=new WeakMap,H=new WeakMap,st=new WeakMap,Et=new WeakMap,wt=new WeakSet,ce=function(n,e){e!==null?(t(this,p).style.setProperty(`--${n}`,e.toString()),t(this,p).setAttribute(`data-${n}`,e.toString())):(t(this,p).style.removeProperty(`--${n}`),t(this,p).removeAttribute(`data-${n}`))};const Cs=Je.createStylesheet({":host":{position:"relative",width:"100%",height:"100%",display:"block",outline:"none"},".static":{position:"var(--static-position, absolute)",top:"var(--static-top, 0)",left:"var(--static-left, 0)",width:"var(--static-width, 100%)",height:"var(--static-height, 100%)"},".content-wrapper":{width:"var(--content-wrapper-width, 100%)",height:"var(--content-wrapper-height, 100%)",overflow:"var(--overflow, initial)",borderRadius:"var(--border-radius, unset)"},".content":{position:"relative",display:"flex",width:"100%",height:"100%",gap:"var(--gap, 0px)",willChange:"var(--will-change, transform)"},":host(.hibernated) .content-wrapper":{display:"contents"},":host(.hibernated) .content":{display:"contents"},"::slotted(*)":{flexShrink:"0"}});var d,xt,x,it,W,_,F,q,rt,nt,N,ht,zt,D,P,Lt,It,kt,At,Nt,Rt,R,Mt,ot,M,lt,U,Tt,ct,qt,ut,at,dt,b,Ut,k,u,be,fe,v,y,A,B,St,V,w,z,Gt,G,Z,K,j,Zt,pt,J,Dt,O,E,Kt,Q,Bt,jt,o,De,ue,Ht,ke,Ae,Be,Ve,L,me,Xe,Jt,ge,Oe,$e,Ct,Ye,ye,ae,Ce;class Ot extends HTMLElement{constructor(){super();s(this,o);s(this,d,null);s(this,xt,new S.CSSProperty(this,"--controls",!0));s(this,x,new S.CSSProperty(this,"--axis","y"));s(this,it,new S.CSSProperty(this,"--reverse",!1));s(this,W,new S.CSSProperty(this,"--direction",0));s(this,_,new S.CSSProperty(this,"--pages",0,{validate:e=>Math.max(0,e-1)}));s(this,F,new S.CSSProperty(this,"--split",!1));s(this,q,new S.CSSProperty(this,"--sectional",!1));s(this,rt,new S.CSSProperty(this,"--tween-easing",!1));s(this,nt,new S.CSSProperty(this,"--tween-duration",!1));s(this,N,new S.CSSProperty(this,"--auto-size",!1));s(this,ht,new S.CSSProperty(this,"--wheel-max-delta",!1));s(this,zt,new S.CSSProperty(this,"--drag-inertion",1));s(this,D,new S.CSSProperty(this,"--sections-in-view",1));s(this,P,new S.CSSProperty(this,"--loop",!1));s(this,Lt,new S.CSSProperty(this,"--damping",20));s(this,It,new S.CSSProperty(this,"--mass",0));s(this,kt,new S.CSSProperty(this,"--stiffness",0));s(this,At,new S.CSSProperty(this,"--mouse-drag",!1));s(this,Nt,new S.CSSProperty(this,"--section-distance-scale",.5));s(this,Rt,new S.CSSProperty(this,"--start-section",0));s(this,R,new S.CSSProperty(this,"--autoplay",0));s(this,Mt,new S.CSSProperty(this,"--autoplay-pause-duration",0));s(this,ot,new S.CSSProperty(this,"--autoplay-user-direction",!1));s(this,M,new S.CSSProperty(this,"--classes",!1));s(this,lt,new S.CSSProperty(this,"--current-index-start-offset",0));s(this,U,new S.CSSProperty(this,"--current-index-end-offset",0));s(this,Tt,new S.CSSProperty(this,"--shift-section-position",0,{rawValueCheck:!1}));s(this,ct,new S.CSSProperty(this,"--focus-delay",0));s(this,qt,new S.CSSProperty(this,"--focus-duration",3e3));s(this,ut,new S.CSSProperty(this,"--disabled",!1));s(this,at,new S.CSSProperty(this,"--hibernate",!1));s(this,dt,null);s(this,b,null);s(this,Ut,null);s(this,k,[]);s(this,u,[]);s(this,be,0);s(this,fe,0);s(this,v,0);s(this,y,0);s(this,A,0);s(this,B,null);s(this,St,null);s(this,V,null);s(this,w,null);s(this,z,new as.Store(0));s(this,Gt,0);s(this,G,0);s(this,Z,!1);s(this,K,!0);s(this,j,!0);s(this,Zt);s(this,pt);s(this,J,new bs.Tweened);s(this,Dt,!1);s(this,O,null);s(this,E,!1);s(this,Kt,null);s(this,Q,[]);s(this,Bt,!1);s(this,jt);s(this,L,e=>{if(e&&t(this,Bt)){h(this,Bt,!1);return}this.resize()});s(this,me,()=>{if(!t(this,Z)||t(this,j)||t(this,K))return;const e=this.currentScrollValue;if(h(this,Gt,Math.max(0,e-t(this,y))),t(this,u).length){for(let i=0;i<t(this,k).length;i++)t(this,k)[i].transform();t(this,z).current=c(this,o,ae).call(this)}else this.vertical?t(this,b).style.transform=`translate3d(0px, ${e*-1}px, 0px)`:t(this,b).style.transform=`translate3d(${e*-1}px, 0px, 0px)`;c(this,o,Ye).call(this),vt.scrollEntries.update(this,t(this,x).current,e)});s(this,Jt,(e,i)=>{t(this,xt).current&&(c(this,o,Oe).call(this,Math.sign(i)||1),t(this,ge).call(this,e,i))});s(this,ge,(e,i)=>{if(t(this,W).current){if(t(this,W).current<0&&i>0)return;if(t(this,W).current>0&&i<0)return}if(t(this,pt)||t(this,J).unlistenAnimationFrame(),!t(this,R).current&&t(this,ct).current&&(clearInterval(t(this,Zt)),h(this,Zt,setTimeout(()=>{const r=t(this,u)[c(this,o,ae).call(this)];r&&this.scrollToSection(r.index,{tween:{duration:t(this,qt).current,easing:ds.easeInOutExpo}})},t(this,ct).current))),!(e.includes("drag")&&!fs.device.isTouch&&!t(this,At).current)){if(t(this,q).current&&e!=="drag"){const r=Math.sign(i);if(t(this,u).length){const l={tween:t(this,rt).current||t(this,nt).current?{easing:t(this,rt).current||"easeInOutCubic",duration:t(this,nt).current||500}:void 0};t(this,Dt)?this.scrollToSection(c(this,o,ae).call(this,!0),l):this.shiftSections(r,l)}else t(this,d).shift(r*t(this,v))}else t(this,d).shift(i);h(this,Dt,e==="drag")}});s(this,ye,qe.debounce(()=>{const e=t(this,Q).reduce((i,r)=>{const l=this.vertical?r.width:r.height;return l>i?l:i},0);clearTimeout(t(this,jt)),h(this,Bt,!0),this.style.setProperty("--max-section-size",""),h(this,jt,setTimeout(()=>{h(this,Bt,!0),this.style.setProperty("--max-section-size",e+"px")},10))},20));s(this,Ce,()=>{h(this,E,!0),this.hibernatedCSSProperty.current||c(this,o,Ve).call(this)});if(T.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Cs];const i=document.createElement("div");i.className="static",i.innerHTML='<slot name="static"></slot>',e.appendChild(i),h(this,dt,document.createElement("div")),t(this,dt).className="content-wrapper",h(this,b,document.createElement("div")),t(this,b).className="content",h(this,Ut,document.createElement("slot")),t(this,b).appendChild(t(this,Ut)),t(this,dt).appendChild(t(this,b)),e.appendChild(t(this,dt)),h(this,Kt,new MutationObserver(qe.debounce(()=>{this.tryResplit()},10)))}}get damped(){return t(this,d)}get controlsCSSProperty(){return t(this,xt)}get axisCSSProperty(){return t(this,x)}get reverseCSSProperty(){return t(this,it)}get directionCSSProperty(){return t(this,W)}get pagesCSSProperty(){return t(this,_)}get splitCSSProperty(){return t(this,F)}get sectionalCSSProperty(){return t(this,q)}get easingCSSProperty(){return t(this,rt)}get durationCSSProperty(){return t(this,nt)}get autoSizeCSSProperty(){return t(this,N)}get wheelMaxDeltaCSSProperty(){return t(this,ht)}get dragInertionCSSProperty(){return t(this,zt)}get sectionsInViewCSSProperty(){return t(this,D)}get loopCSSProperty(){return t(this,P)}get dampingCSSProperty(){return t(this,Lt)}get massCSSProperty(){return t(this,It)}get stiffnessCSSProperty(){return t(this,kt)}get mouseDragCSSProperty(){return t(this,At)}get sectionDistanceScaleCSSProperty(){return t(this,Nt)}get startSectionCSSProperty(){return t(this,Rt)}get autoplayCSSProperty(){return t(this,R)}get autoplayPauseDurationCSSProperty(){return t(this,Mt)}get autoplayUserDirectionCSSProperty(){return t(this,ot)}get classesCSSProperty(){return t(this,M)}get currentIndexStartOffsetCSSProperty(){return t(this,lt)}get currentIndexEndOffsetCSSProperty(){return t(this,U)}get shiftSectionPositionCSSProperty(){return t(this,Tt)}get focusDelayCSSProperty(){return t(this,ct)}get focusDurationCSSProperty(){return t(this,qt)}get disabledCSSProperty(){return t(this,ut)}get hibernatedCSSProperty(){return t(this,at)}get currentScrollValue(){return c(this,o,$e).call(this,"current")}get targetScrollValue(){return c(this,o,$e).call(this,"target")}get contentWrapperElement(){return t(this,dt)}get contentElement(){return t(this,b)}get sections(){return t(this,k)}get visibleSections(){return t(this,u)}get position(){return t(this,be)}get contentPosition(){return t(this,fe)}get viewportSize(){return t(this,v)}get scrollSize(){return t(this,y)}get gap(){return t(this,A)}get counter(){return t(this,z)}get limit(){return Math.ceil(t(this,u).length-t(this,D).current)}get distance(){return t(this,G)}get loopDistance(){return t(this,P).current?t(this,G)+t(this,A):t(this,G)}get hasOverflow(){return t(this,Z)}get overscroll(){return t(this,Gt)}get scrollLine(){return t(this,O)}get vertical(){return t(this,x).current==="y"}get currentProgress(){return this.currentScrollValue/this.loopDistance||0}get targetProgress(){return this.targetScrollValue/this.loopDistance||0}get scrollWidth(){return t(this,x).current==="y"?0:t(this,d).distance}get scrollHeight(){return t(this,x).current==="x"?0:t(this,d).distance}tryResplit(){!t(this,j)&&(t(this,P).current||t(this,F).current||t(this,P).current||t(this,N).current||t(this,q).current)&&c(this,o,ue).call(this)}onScroll(...e){return t(this,d).subscribe(...e)}offScroll(...e){t(this,d).unsubscribe(...e)}range(e,i,r=0){const l=e-r,f=l+i+r*2;return this.currentProgress<l?0:this.currentProgress>f?1:(this.currentProgress-l)/(f-l)}curve(e,i,r=0){return Math.sin(this.range(e,i,r)*Math.PI)}visible(e,i,r=0){const l=e-r,f=l+i+r*2;return this.currentProgress>=l&&this.currentProgress<=f}scrollToSection(e,i){if(!t(this,u).length)return;const r=t(this,z).current,l=c(this,o,Xe).call(this,e),f=t(this,u)[r],m=t(this,u)[l];if(f&&m){let g=0;const yt=c(this,o,ae).call(this),$t=t(this,u)[yt];let oe=$t?this.targetScrollValue-$t.position:0;t(this,P).current?l===0&&r===t(this,u).length-1?(g=t(this,y)+t(this,v)-f.position+t(this,A),t(this,Dt)||(oe=0)):l===t(this,u).length-1&&r===0?g=m.position-(t(this,y)+t(this,v)+t(this,A)):g=m.position-f.position:g=m.position-f.position,this.shiftPosition(g-oe,i)}}shiftSections(e,i){t(this,u).length&&this.scrollToSection(t(this,z).current+e,i)}setPosition(e,i){c(this,o,Oe).call(this,Math.sign(e)||1),i!=null&&i.tween?t(this,pt)||(t(this,J).set(t(this,d).current,{equalize:!0}),t(this,J).set(e,Ne({},i.tween)),h(this,pt,setTimeout(()=>{h(this,pt,void 0)},i.tween.duration||0))):t(this,d).set(e,{equalize:(i==null?void 0:i.behaviour)==="instant"})}shiftPosition(e,i){this.setPosition(t(this,d).target+e,i)}resize(){if(t(this,at).current)return;h(this,u,t(this,k).filter(r=>Ss.isElementVisible(r.element))),this.style.setProperty("--sections",t(this,u).length.toString()),t(this,d).unlistenAnimationFrame();const e=this.currentScrollValue/t(this,y)||0,i=t(this,z).current;if(h(this,be,this.vertical?Wt.getCumulativeOffsetTop(this):Wt.getCumulativeOffsetLeft(this)),h(this,fe,this.vertical?Wt.getCumulativeOffsetTop(t(this,b)):Wt.getCumulativeOffsetLeft(t(this,b))),h(this,v,this.vertical?this.offsetHeight:this.offsetWidth),this.vertical?h(this,A,Ze.cssUnitParser.parse(getComputedStyle(t(this,b)).rowGap)):h(this,A,Ze.cssUnitParser.parse(getComputedStyle(t(this,b)).columnGap)),t(this,N).current&&t(this,u).length){const r=t(this,D).current,l=(t(this,v)-t(this,A)*(r-1))/r;t(this,u).forEach(f=>{f.setSize(l)})}else t(this,u).forEach(r=>{r.setSize()});if(t(this,u).forEach(r=>{r.resize()}),t(this,_).current){h(this,y,t(this,v)*t(this,_).current);const r=t(this,y)+t(this,v);this.vertical?(t(this,b).style.width=r+"px",t(this,b).style.height="100%"):(t(this,b).style.height=r+"px",t(this,b).style.width="100%")}else this.vertical?(t(this,b).style.width="100%",t(this,b).style.height="max-content",h(this,y,t(this,b).offsetHeight-t(this,v))):(t(this,b).style.width="max-content",t(this,b).style.height="100%",h(this,y,t(this,b).offsetWidth-t(this,v)));if(!t(this,P).current){const r=getComputedStyle(this),l=this.vertical?parseFloat(r.paddingBlockStart)+parseFloat(r.paddingBlockEnd):parseFloat(r.paddingInlineStart)+parseFloat(r.paddingInlineEnd);h(this,y,t(this,y)+l),t(this,d).max=t(this,y)}if(t(this,P).current&&t(this,u).length){const r=t(this,u)[t(this,u).length-1],l=r.position+r.size-t(this,v),f=t(this,y)-l;h(this,G,r.position+r.size+f)}else h(this,G,t(this,y));if(t(this,q).current&&t(this,u).length){const r=t(this,u)[i];t(this,d).set(r.position,{equalize:!0})}else t(this,d).set(e*t(this,y),{equalize:!0});h(this,Z,(this.vertical?t(this,b).offsetHeight:t(this,b).offsetWidth)>t(this,v)),this.classList.toggle("has-overflow",t(this,Z)),t(this,Z)?t(this,ut).current||c(this,o,Ae).call(this):c(this,o,ke).call(this),t(this,ye).call(this),le.dispatchEvent(this,"scrollResize",{custom:!0}),t(this,d).notify()}connectedCallback(){vt.scrollEntries.register(this),h(this,d,new ps.Damped(0,{damping:.01,min:0,order:Ie.TICK_ORDER.SCROLL})),this.setAttribute("tabindex","0"),h(this,B,new Le.WheelControls({element:t(this,b)})),t(this,B).changeEvent.subscribe(t(this,Jt)),h(this,St,new Le.KeyboardControls({element:this})),t(this,St).changeEvent.subscribe(t(this,Jt)),h(this,V,new Le.DragControls({element:t(this,b),rootElement:this})),t(this,V).changeEvent.subscribe(t(this,Jt)),h(this,w,new Le.AutoplayControls({culling:this})),t(this,w).changeEvent.subscribe(t(this,ge)),t(this,x).subscribe(()=>{c(this,o,De).call(this)}),t(this,it).subscribe(()=>{c(this,o,De).call(this)}),t(this,ht).subscribe(e=>{t(this,B).axis=e.current?"max":t(this,x).current}),t(this,zt).subscribe(e=>{t(this,V).inertion=typeof e.current=="number"?e.current:1}),t(this,_).subscribe(()=>{t(this,E)&&t(this,L).call(this)}),t(this,F).subscribe(({current:e})=>{t(this,E)&&(e?c(this,o,ue).call(this):c(this,o,Ht).call(this))}),t(this,q).subscribe(e=>{t(this,B).debounce=e.current,t(this,V).swipe=e.current,t(this,w).interval=e.current,t(this,E)&&(e.current&&!e.previous&&!t(this,u).length?c(this,o,ue).call(this):!e.current&&e.previous&&t(this,u).length&&c(this,o,Ht).call(this))}),t(this,N).subscribe(e=>{t(this,E)&&(t(this,L).call(this),e.current&&!e.previous&&!t(this,u).length?c(this,o,ue).call(this):!e.current&&e.previous&&t(this,u).length&&c(this,o,Ht).call(this))}),t(this,D).subscribe(e=>{t(this,E)&&(t(this,L).call(this),c(this,o,Ct).call(this))}),t(this,P).subscribe(e=>{e.current?(t(this,E)&&(t(this,u).length||(t(this,F).current=!0)),t(this,d).max=1/0,t(this,d).min=-1/0):(h(this,Gt,0),t(this,d).max=t(this,y),t(this,d).min=0)}),t(this,Lt).subscribe(e=>{t(this,d).damping=e.current}),t(this,It).subscribe(e=>{t(this,d).mass=e.current}),t(this,kt).subscribe(e=>{t(this,d).stiffness=e.current}),t(this,R).subscribe(e=>{t(this,w).speed=e.current,!t(this,K)&&e.current&&!e.previous?t(this,w).connect():!e.current&&e.previous&&t(this,w).disconnect()}),t(this,ot).subscribe(e=>{e.current||(t(this,w).direction=1)}),t(this,M).subscribe(e=>{t(this,E)&&c(this,o,Ct).call(this)}),t(this,lt).subscribe(e=>{t(this,E)&&t(this,M).current&&c(this,o,Ct).call(this)}),t(this,U).subscribe(e=>{t(this,E)&&t(this,M).current&&c(this,o,Ct).call(this)}),t(this,Tt).subscribe(e=>{t(this,E)&&t(this,d).notify()}),t(this,d).isRunning.subscribe(e=>{this.classList.toggle("active",e.current)}),t(this,z).subscribe(e=>{t(this,u).length&&c(this,o,Ct).call(this),this.style.setProperty("--counter",e.current+"")}),t(this,J).subscribe(e=>{t(this,J).isRunning.current&&t(this,d).set(e.current,{equalize:!0})}),t(this,ut).subscribe(e=>{e.current&&!e.previous?(this.classList.add("disabled"),c(this,o,ke).call(this)):!e.current&&e.previous&&(this.classList.remove("disabled"),c(this,o,Ae).call(this))}),t(this,at).subscribe(e=>{e.current&&!e.previous?(this.classList.add("hibernated"),c(this,o,Be).call(this)):!e.current&&e.previous&&(this.classList.remove("hibernated"),c(this,o,Ve).call(this))}),t(this,xt).observe(),t(this,x).observe(),t(this,it).observe(),t(this,W).observe(),t(this,_).observe(),t(this,F).observe(),t(this,q).observe(),t(this,rt).observe(),t(this,nt).observe(),t(this,N).observe(),t(this,ht).observe(),t(this,zt).observe(),t(this,D).observe(),t(this,P).observe(),t(this,Lt).observe(),t(this,It).observe(),t(this,kt).observe(),t(this,At).observe(),t(this,Nt).observe(),t(this,Rt).observe(),t(this,R).observe(),t(this,R).observe(),t(this,Mt).observe(),t(this,ot).observe(),t(this,M).observe(),t(this,lt).observe(),t(this,U).observe(),t(this,Tt).observe(),t(this,ct).observe(),t(this,qt).observe(),t(this,ut).observe(),t(this,at).observe(),_t.windowResizer.subscribe(t(this,Ce),Ie.RESIZE_ORDER.LAST),de.elementResizer.subscribe(this,t(this,L)),t(this,Kt).observe(this,{childList:!0})}disconnectedCallback(){this.removeAttribute("tabindex"),this.classList.remove("disabled"),this.classList.remove("hibernated"),t(this,xt).unobserve(),t(this,x).unobserve(),t(this,it).unobserve(),t(this,W).unobserve(),t(this,_).unobserve(),t(this,F).unobserve(),t(this,q).unobserve(),t(this,rt).unobserve(),t(this,nt).unobserve(),t(this,N).unobserve(),t(this,ht).unobserve(),t(this,zt).unobserve(),t(this,D).unobserve(),t(this,P).unobserve(),t(this,Lt).unobserve(),t(this,It).unobserve(),t(this,kt).unobserve(),t(this,At).unobserve(),t(this,Nt).unobserve(),t(this,Rt).unobserve(),t(this,R).unobserve(),t(this,Mt).unobserve(),t(this,ot).unobserve(),t(this,M).unobserve(),t(this,lt).unobserve(),t(this,U).unobserve(),t(this,Tt).unobserve(),t(this,ct).unobserve(),t(this,qt).unobserve(),t(this,ut).unobserve(),t(this,at).unobserve(),_t.windowResizer.unsubscribe(t(this,Ce)),de.elementResizer.unsubscribe(t(this,L)),c(this,o,Be).call(this),t(this,Kt).disconnect()}}d=new WeakMap,xt=new WeakMap,x=new WeakMap,it=new WeakMap,W=new WeakMap,_=new WeakMap,F=new WeakMap,q=new WeakMap,rt=new WeakMap,nt=new WeakMap,N=new WeakMap,ht=new WeakMap,zt=new WeakMap,D=new WeakMap,P=new WeakMap,Lt=new WeakMap,It=new WeakMap,kt=new WeakMap,At=new WeakMap,Nt=new WeakMap,Rt=new WeakMap,R=new WeakMap,Mt=new WeakMap,ot=new WeakMap,M=new WeakMap,lt=new WeakMap,U=new WeakMap,Tt=new WeakMap,ct=new WeakMap,qt=new WeakMap,ut=new WeakMap,at=new WeakMap,dt=new WeakMap,b=new WeakMap,Ut=new WeakMap,k=new WeakMap,u=new WeakMap,be=new WeakMap,fe=new WeakMap,v=new WeakMap,y=new WeakMap,A=new WeakMap,B=new WeakMap,St=new WeakMap,V=new WeakMap,w=new WeakMap,z=new WeakMap,Gt=new WeakMap,G=new WeakMap,Z=new WeakMap,K=new WeakMap,j=new WeakMap,Zt=new WeakMap,pt=new WeakMap,J=new WeakMap,Dt=new WeakMap,O=new WeakMap,E=new WeakMap,Kt=new WeakMap,Q=new WeakMap,Bt=new WeakMap,jt=new WeakMap,o=new WeakSet,De=function(){const e=t(this,x).current,i=t(this,it).current?"-reverse":"";t(this,b).style.flexDirection=e==="x"?`row${i}`:`column${i}`,t(this,B).axis=t(this,ht).current?"max":e,t(this,St).dimension=e==="x"?"width":"height",t(this,V).axis=e,e==="x"?this.style.touchAction="pan-y":e==="y"&&(this.style.touchAction="pan-x"),t(this,E)&&t(this,L).call(this)},ue=function(){c(this,o,Ht).call(this),t(this,Ut).assignedElements().forEach((e,i)=>{e instanceof HTMLElement&&e.tagName!=="SCRIPT"&&t(this,k).push(new ys(e,i,this))}),h(this,u,[...t(this,k)]),t(this,b).style.transform="",le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0}),t(this,L).call(this),c(this,o,Ct).call(this)},Ht=function(){t(this,k).forEach(e=>{e.destroy()}),h(this,k,[]),h(this,u,[]),t(this,z).reset(),t(this,d).reset(),this.style.removeProperty("--max-section-size"),le.dispatchEvent(this,"scrollSectionsChange",{custom:!0,composed:!0})},ke=function(){t(this,K)||(h(this,K,!0),t(this,d).unsubscribe(t(this,me)),t(this,d).unlistenAnimationFrame(),clearInterval(t(this,Zt)),clearInterval(t(this,pt)),t(this,J).unlistenAnimationFrame(),t(this,B).disconnect(),t(this,St).disconnect(),t(this,V).disconnect(),t(this,w).disconnect(),t(this,Z)||(this.sections.forEach(e=>{e.unsetTransform()}),t(this,L).call(this)))},Ae=function(){t(this,K)&&(h(this,K,!1),t(this,d).subscribe(t(this,me),-1e4),t(this,d).notify(),t(this,B).connect(),t(this,St).connect(),t(this,V).connect(),t(this,R).current&&t(this,w).connect())},Be=function(){t(this,j)||(h(this,j,!0),clearTimeout(t(this,jt)),_t.windowResizer.unsubscribe(t(this,L)),c(this,o,ke).call(this),t(this,b).style.transform="",t(this,b).style.height="",t(this,b).style.width="",this.classList.remove("has-overflow","start","end"),t(this,k).length?c(this,o,Ht).call(this):(t(this,z).reset(),t(this,d).reset()),vt.scrollEntries.unregister(this))},Ve=function(){t(this,j)&&(h(this,j,!1),vt.scrollEntries.register(this),this.tryResplit(),c(this,o,Ae).call(this),this.scrollToSection(t(this,Rt).current,{behaviour:"instant"}),_t.windowResizer.subscribe(t(this,L),Ie.RESIZE_ORDER.SCROLL))},L=new WeakMap,me=new WeakMap,Xe=function(e){let i=t(this,z).current;return t(this,P).current?i=je.loopNumber(e,t(this,u).length):i=Ke.clamp(e,0,this.limit),i},Jt=new WeakMap,ge=new WeakMap,Oe=function(e=1){t(this,ot).current&&(t(this,w).direction=e),t(this,R).current&&t(this,w).pauseAndContinue(t(this,Mt).current,this.sectionalCSSProperty.current)},$e=function(e="current"){if(t(this,P).current&&t(this,u).length){const i=t(this,d)[e]%Math.round(t(this,y)+t(this,v)+t(this,A));return i<0?t(this,y)+i+t(this,v)+t(this,A):i}else return t(this,d)[e]},Ct=function(){if(t(this,u).length){const e=t(this,z).current+t(this,lt).current;if(e===0?h(this,O,"start"):e===this.limit?h(this,O,"end"):h(this,O,null),le.dispatchEvent(this,"scrollLine",{detail:{line:t(this,O)}}),t(this,M).current){this.classList.remove("end","start"),t(this,O)&&this.classList.add(t(this,O));const i=t(this,D).current+t(this,U).current;h(this,Q,[]),t(this,u).forEach((r,l)=>{r.setCurrentIndex(null),r.setCurrentIndexArc(null),r.setCurrentIndexArcAbs(null),r.setMiddle(!1);const f=e-this.limit-1+t(this,U).current,m=e+i,g=this.sections.length-m;l>=e&&l<m||l<=f?(r.setMark("current"),t(this,Q).push(r)):l>=m&&l<m+g/2||l<=f+i?r.setMark("next"):r.setMark("previous")}),t(this,ye).call(this)}}},Ye=function(){if(t(this,M).current){const e=Math.floor(t(this,Q).length/2);t(this,Q).sort((i,r)=>i.element.getBoundingClientRect().left-r.element.getBoundingClientRect().left),t(this,Q).forEach((i,r)=>{const l=r-e;i.setCurrentIndex(r),i.setCurrentIndexArc(l),i.setCurrentIndexArcAbs(Math.abs(l)),i.setMiddle(r===e)})}},ye=new WeakMap,ae=function(e=!1){let i=this.targetScrollValue,r=1/0,l=0;const f=t(this,d).direction;for(let m=0;m<t(this,u).length;m++){const g=t(this,u)[m];let yt=t(this,Dt)?g.size*f*-1*.4:0,$t=g.position;this.overscroll&&$t===0&&e&&($t=t(this,G));let oe=Math.abs($t+yt-i);oe<=r&&(r=oe,l=m)}return l},Ce=new WeakMap;T.isBrowser&&!customElements.get("e-scroll")&&customElements.define("e-scroll",Ot);var ve;class Me extends HTMLElement{constructor(){super(...arguments);s(this,ve,null)}get scrollElement(){return t(this,ve)}connectedCallback(){const e=Qe.findParentElement(this,Ot);e instanceof Ot?h(this,ve,e):console.error(this,"e-scroll not found")}}ve=new WeakMap;var bt,I,X,Y,Qt,Xt,ft,Yt,Pe,Ee;class ts extends Me{constructor(){super();s(this,bt,null);s(this,I,null);s(this,X,!1);s(this,Y,0);s(this,Qt,0);s(this,Xt,0);s(this,ft,()=>{h(this,X,this.offsetWidth>this.offsetHeight);const e=t(this,X)?this.offsetWidth:this.offsetHeight;h(this,Y,e/((this.scrollElement.scrollSize+this.scrollElement.viewportSize)/e)),h(this,Y,Math.max(t(this,Y),30)),t(this,X)?(t(this,I).style.width=t(this,Y)+"px",t(this,I).style.height="100%"):(t(this,I).style.width="100%",t(this,I).style.height=t(this,Y)+"px"),h(this,Qt,e-t(this,Y)),this.scrollElement.scrollSize<=0?this.style.display="none":this.style.display="",t(this,Yt).call(this)});s(this,Yt,()=>{h(this,Xt,this.scrollElement.currentProgress*t(this,Qt)),t(this,X)?t(this,I).style.transform=`translate3d(${t(this,Xt)}px, 0px, 0px)`:t(this,I).style.transform=`translate3d(0px, ${t(this,Xt)}px, 0px)`});s(this,Pe,()=>{this.setAttribute("axis",this.scrollElement.axisCSSProperty.current)});s(this,Ee,e=>{document.documentElement.classList.add("grabbing"),ms.setupDrag(l=>{const f=t(this,X)?l.x:l.y,m=this.scrollElement.distance/t(this,Qt),g=(f-r)*m;this.scrollElement.setPosition(i+g)},()=>{document.documentElement.classList.remove("grabbing")});const i=this.scrollElement.damped.target,r=t(this,X)?e.x:e.y});if(T.isBrowser){const e=this.attachShadow({mode:"open"});e.adoptedStyleSheets=[Je.createStylesheet({":host":{display:"inline-block",zIndex:"1",backgroundColor:"#ebebeb"},':host([axis="y"])':{position:"absolute",right:"0",top:"0",width:"1vmin",height:"100%"},':host([axis="x"])':{position:"absolute",left:"0",bottom:"0",width:"100%",height:"1vmin"},".default-thumb":{backgroundColor:"var(--thumb-color, black)",borderRadius:"var(--thumb-radius, 0px)",touchAction:"none"},"::slotted(*)":{touchAction:"none"}})],h(this,bt,document.createElement("slot")),t(this,bt).innerHTML='<div class="default-thumb"></div>',e.appendChild(t(this,bt))}}get thumbElement(){return t(this,I)}connectedCallback(){super.connectedCallback(),this.setAttribute("drag-dead-zone","");const e=t(this,bt).assignedElements()[0]||t(this,bt).firstElementChild;h(this,I,e),t(this,I).addEventListener("pointerdown",t(this,Ee)),_t.windowResizer.subscribe(t(this,ft),Ie.RESIZE_ORDER.SCROLL),de.elementResizer.subscribe(this,t(this,ft)),de.elementResizer.subscribe(this.scrollElement,t(this,ft)),this.scrollElement.onScroll(t(this,Yt)),this.scrollElement.axisCSSProperty.subscribe(t(this,Pe))}disconnectedCallback(){this.removeAttribute("drag-dead-zone"),this.style.display="",t(this,I).removeEventListener("pointerdown",t(this,Ee)),_t.windowResizer.unsubscribe(t(this,ft)),de.elementResizer.unsubscribe(t(this,ft)),this.scrollElement.offScroll(t(this,Yt)),this.scrollElement.axisCSSProperty.unsubscribe(t(this,Pe))}}bt=new WeakMap,I=new WeakMap,X=new WeakMap,Y=new WeakMap,Qt=new WeakMap,Xt=new WeakMap,ft=new WeakMap,Yt=new WeakMap,Pe=new WeakMap,Ee=new WeakMap;T.isBrowser&&!customElements.get("e-scrollbar")&&customElements.define("e-scrollbar",ts);var te,ee,se;class es extends Me{constructor(){super();s(this,te,new S.CSSProperty(this,"--behaviour","smooth"));s(this,ee,new S.CSSProperty(this,"--tween-easing",!1));s(this,se,new S.CSSProperty(this,"--tween-duration",0));T.isBrowser&&this.addEventListener("click",()=>{const e=t(this,te).current,i=t(this,ee).current,r=t(this,se).current;this.handleClick({behaviour:e,tween:i||r?{easing:i,duration:r}:void 0})})}connectedCallback(){super.connectedCallback(),this.hasAttribute("tabindex")||this.setAttribute("tabindex","0"),this.hasAttribute("role")||this.setAttribute("role","button"),t(this,te).observe(),t(this,ee).observe(),t(this,se).observe()}disconnectedCallback(){this.removeAttribute("tabindex"),this.removeAttribute("role"),t(this,te).close(),t(this,ee).close(),t(this,se).close()}}te=new WeakMap,ee=new WeakMap,se=new WeakMap;var ie;class ss extends es{constructor(){super(...arguments);s(this,ie,new S.CSSProperty(this,"--set",1))}handleClick(e){this.scrollElement.scrollToSection(t(this,ie).current,e)}connectedCallback(){super.connectedCallback(),t(this,ie).observe()}disconnectedCallback(){super.disconnectedCallback(),t(this,ie).close()}}ie=new WeakMap;T.isBrowser&&!customElements.get("e-scroll-set-button")&&customElements.define("e-scroll-set-button",ss);var tt,re;class is extends es{constructor(){super(...arguments);s(this,tt,new S.CSSProperty(this,"--step",1));s(this,re,()=>{this.scrollElement.loopCSSProperty.current?this.removeAttribute("disabled"):t(this,tt).current>0&&this.scrollElement.scrollLine==="end"||t(this,tt).current<0&&this.scrollElement.scrollLine==="start"?this.setAttribute("disabled",""):this.removeAttribute("disabled")})}handleClick(e){this.scrollElement.shiftSections(t(this,tt).current,e)}connectedCallback(){super.connectedCallback(),this.scrollElement&&(t(this,tt).subscribe(()=>{t(this,re).call(this)}),t(this,tt).observe(),this.scrollElement.addEventListener("scrollLine",t(this,re)),t(this,re).call(this))}disconnectedCallback(){super.disconnectedCallback(),t(this,tt).close(),this.removeAttribute("disabled")}}tt=new WeakMap,re=new WeakMap;T.isBrowser&&!customElements.get("e-scroll-step-button")&&customElements.define("e-scroll-step-button",is);var $,mt,ne,we,xe,he;class vs{constructor(n,e,i){s(this,$,null);s(this,mt,null);s(this,ne,null);s(this,we,null);s(this,xe,()=>{t(this,mt).scrollToSection(t(this,ne),{behaviour:t(this,we)})});s(this,he,()=>{t(this,$).classList.toggle("current",t(this,mt).counter.current===t(this,ne))});T.isBrowser&&(h(this,$,document.createElement("button")),t(this,$).setAttribute("aria-label",`Go to section ${e+1}`),h(this,mt,n),h(this,we,i),h(this,ne,e),t(this,$).addEventListener("click",t(this,xe)),t(this,mt).counter.subscribe(t(this,he)),t(this,he).call(this))}get element(){return t(this,$)}destroy(){t(this,$).removeEventListener("click",t(this,xe)),t(this,mt).counter.unsubscribe(t(this,he)),t(this,$).remove()}}$=new WeakMap,mt=new WeakMap,ne=new WeakMap,we=new WeakMap,xe=new WeakMap,he=new WeakMap;var Vt,gt,et;class rs extends Me{constructor(){super(...arguments);s(this,Vt,null);s(this,gt,[]);s(this,et,qe.debounce(()=>{t(this,gt).forEach(i=>i.destroy()),h(this,gt,[]);let e=0;this.scrollElement.loopCSSProperty.current?e=this.scrollElement.visibleSections.length:e=this.scrollElement.visibleSections.length-Math.max(this.scrollElement.sectionsInViewCSSProperty.current-1,0);for(let i=0;i<e;i++){const r=new vs(this.scrollElement,i,this.getAttribute("behaviour")||"smooth");t(this,Vt).appendChild(r.element),t(this,gt).push(r)}},0))}connectedCallback(){super.connectedCallback(),this.innerHTML="",this.scrollElement.addEventListener("scrollSectionsChange",t(this,et)),this.scrollElement.sectionsInViewCSSProperty.subscribe(t(this,et)),this.scrollElement.loopCSSProperty.subscribe(t(this,et)),h(this,Vt,document.createElement("div")),this.appendChild(t(this,Vt))}disconnectedCallback(){this.scrollElement.removeEventListener("scrollSectionsChange",t(this,et)),this.scrollElement.sectionsInViewCSSProperty.unsubscribe(t(this,et)),this.scrollElement.loopCSSProperty.unsubscribe(t(this,et)),t(this,gt).forEach(e=>e.destroy()),h(this,gt,[]),t(this,Vt).remove()}}Vt=new WeakMap,gt=new WeakMap,et=new WeakMap;T.isBrowser&&!customElements.get("e-scroll-bullet-buttons")&&customElements.define("e-scroll-bullet-buttons",rs);class ns extends gs.ScrollSegmentElement{connectedCallback(){const n=Qe.findParentElement(this,Ot);n instanceof Ot?(this.scrollContainer=n,this.scrollContainer.addEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.addEventListener("scrollResize",this.resize),this.resize()):console.error(this,"e-scroll not found")}disconnectedCallback(){super.disconnectedCallback(),this.scrollContainer instanceof Ot&&(this.scrollContainer.removeEventListener("scrollSectionsChange",this.findAnotherScrollEntries),this.scrollContainer.removeEventListener("scrollResize",this.resize))}}T.isBrowser&&!customElements.get("e-scroll-segment")&&customElements.define("e-scroll-segment",ns);var ze;const He=class He extends Me{constructor(){super(...arguments);s(this,ze,()=>{this.textContent=`${this.scrollElement.counter.current+1}`})}connectedCallback(){return Ge(this,null,function*(){Ue(He.prototype,this,"connectedCallback").call(this),this.scrollElement.counter.subscribe(t(this,ze))})}disconnectedCallback(){this.scrollElement.counter.unsubscribe(t(this,ze))}};ze=new WeakMap;let Re=He;T.isBrowser&&!customElements.get("e-scroll-counter")&&customElements.define("e-scroll-counter",Re);exports.ScrollBulletButtonsElement=rs;exports.ScrollCounterElement=Re;exports.ScrollElement=Ot;exports.ScrollSegmentElement=ns;exports.ScrollSetButtonElement=ss;exports.ScrollStepButtonElement=is;exports.ScrollbarElement=ts;