aptechka 0.76.6 → 0.76.8

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 ne=c=>{throw TypeError(c)};var se=(c,n,t)=>n.has(c)||ne("Cannot "+t);var e=(c,n,t)=>(se(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?ne("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(se(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),d=(c,n,t)=>(se(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const de=require("../element-linked-store/index.cjs"),y=require("../css-property/index.cjs"),oe=require("../index-DekP7OZe.cjs"),W=require("../events-KVanG9sR.cjs"),fe=require("../function-MthRj-GJ.cjs"),he=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const le=require("../url-Dns-01WU.cjs"),ce=require("../window-resizer/index.cjs"),_=require("../Viewport-DB0qAZPJ.cjs");var f,w,ee,te;class ge{constructor(){r(this,f,new Map);r(this,w,[]);r(this,ee,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(j=>j instanceof HTMLElement&&j.hasAttribute("data-popover-content")))return;const l=i[0],a=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),x=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!a||x)&&t.close()}});r(this,te,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,ee)),addEventListener("keydown",e(this,te))}get groups(){return e(this,f)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,f).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,f).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,f).get(n);s!=null&&s.length||(s=[],e(this,f).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(setTimeout(()=>{o(this,w,e(this,w).filter(s=>s!==t))}),t.closeRest.current){let s=[];e(this,f).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,f).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,f).get(n);e(this,f).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,f).get(n);s&&(s=s.filter(i=>i!==t),e(this,f).set(n,s))}}}f=new WeakMap,w=new WeakMap,ee=new WeakMap,te=new WeakMap;var v,B,H,R,G,m,C,T,q,$,b,V,O,P,E,z,u,M,D,p,ae,L,N,F,k,Y,I,U;const S=class S extends HTMLElement{constructor(){super();r(this,p);r(this,v);r(this,B);r(this,H);r(this,R);r(this,G);r(this,m);r(this,C);r(this,T);r(this,q);r(this,$);r(this,b);r(this,V);r(this,O);r(this,P);r(this,E);r(this,z);r(this,u);r(this,M);r(this,D);r(this,F);r(this,k);r(this,Y);r(this,I);r(this,U);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,C,new y.CSSProperty(this,"--restore",!1)),o(this,T,new y.CSSProperty(this,"--dispatch-resize",!1)),o(this,q,new y.CSSProperty(this,"--close-rest",!1)),o(this,$,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,V,new y.CSSProperty(this,"--click-outside",!1)),o(this,O,new y.CSSProperty(this,"--escape",!1)),o(this,P,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,E,!0),o(this,u,new de.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,M,[]),o(this,D,[]),o(this,F,()=>{o(this,E,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)}),o(this,k,()=>{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,Y).call(this)}),o(this,Y,fe.debounce(()=>{e(this,I).call(this)},10)),o(this,I,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,P).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>_.viewport.width?s=_.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>_.viewport.height?i=_.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")}}),o(this,U,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(S.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,u).subscribe(t=>{if(this.group.current){document.documentElement.classList.toggle(`${this.group.current}-closing`,t.current.closing);const s=S.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 openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,C)}get dispatchResize(){return e(this,T)}get closeRest(){return e(this,q)}get closeRestInGroup(){return e(this,$)}get group(){return e(this,b)}get clickOutside(){return e(this,V)}get escape(){return e(this,O)}get opened(){return e(this,v)}get lastTrigger(){return e(this,z)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&le.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,z,t==null?void 0:t.trigger),clearTimeout(e(this,B)),clearTimeout(e(this,H)),d(this,p,L).call(this,!1,this.closingClass),e(this,u).set("closing",!1),e(this,u).set("triggered",!0),W.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,z)}}),e(this,m).current&&e(this,E)&&history.pushState(history.state,"",e(this,p,ae)),e(this,u).set("beforeopen",!0),o(this,v,!0);const s=()=>{S.stack.add(e(this,b).current,this),e(this,D).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),d(this,p,L).call(this,!0,this.openClass),e(this,u).set("opened",!0),e(this,T).current?W.dispatchEvent(window,"resize",{custom:!0}):e(this,k).call(this),W.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,z)},bubbles:!0}),o(this,R,void 0),o(this,G,setTimeout(()=>{e(this,u).set("transitionend",!0),W.dispatchEvent(this,"popoverTransitionend")},he.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,R,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,R)),clearTimeout(e(this,G)),S.stack.remove(e(this,b).current,this),d(this,p,N).call(this),o(this,B,setTimeout(()=>{e(this,u).set("transitionend",!1),e(this,u).set("opened",!1),e(this,u).set("closing",!0),d(this,p,L).call(this,!1,this.openClass),d(this,p,L).call(this,!0,this.closingClass),W.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,H,setTimeout(()=>{e(this,u).set("triggered",!1),e(this,u).set("beforeopen",!1),e(this,u).set("closing",!1),d(this,p,L).call(this,!1,this.closingClass),W.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},he.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,M,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,M).forEach(t=>{t.addEventListener("click",e(this,U))}),o(this,D,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,C).observe(),e(this,T).observe(),e(this,q).observe(),e(this,$).observe(),e(this,b).observe(),e(this,V).observe(),e(this,O).observe(),e(this,P).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,F)),setTimeout(()=>{e(this,C).current?(o(this,E,!1),this.urlValue=le.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)):(d(this,p,N).call(this),o(this,E,!0))},0),e(this,P).subscribe(()=>{e(this,k).call(this)}),ce.windowResizer.subscribe(e(this,k))}disconnectedCallback(){e(this,M).forEach(t=>{t.removeEventListener("click",e(this,U))}),S.stack.remove(e(this,b).current,this),ce.windowResizer.unsubscribe(e(this,k)),e(this,m).close(),e(this,C).close(),e(this,T).close(),e(this,q).close(),e(this,$).close(),e(this,b).close(),e(this,V).close(),e(this,O).close(),e(this,P).close(),this.removeAttribute("role"),d(this,p,L).call(this,!1,this.openClass),d(this,p,L).call(this,!1,this.closingClass),clearTimeout(e(this,B)),clearTimeout(e(this,H)),clearTimeout(e(this,R)),clearTimeout(e(this,G)),removeEventListener("popstate",e(this,F)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),d(this,p,N).call(this)}};v=new WeakMap,B=new WeakMap,H=new WeakMap,R=new WeakMap,G=new WeakMap,m=new WeakMap,C=new WeakMap,T=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakMap,V=new WeakMap,O=new WeakMap,P=new WeakMap,E=new WeakMap,z=new WeakMap,u=new WeakMap,M=new WeakMap,D=new WeakMap,p=new WeakSet,ae=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},L=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},N=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},F=new WeakMap,k=new WeakMap,Y=new WeakMap,I=new WeakMap,U=new WeakMap,S.stack=new ge;let X=S;oe.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",X);var h,g,A,ie,J,K,Q,Z,re;class ue extends HTMLElement{constructor(){super();r(this,A);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,J,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,K,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,Q,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,Z,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});oe.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).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,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(d(this,A,ie).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const a=this.getRootNode();a instanceof ShadowRoot?i=a.host.closest("[data-popover]"):a instanceof HTMLElement&&(i=a.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=a=>{if(!a)return null;let x=a.querySelector("[data-popover]");return!x&&(a!=null&&a.parentElement)&&(x=l(a.parentElement)),x};i=l(this.parentElement)||null}else if(!t.startsWith(".")&&!t.startsWith("[")&&t.startsWith("#"),i=document.querySelector(t)||this.getRootNode().querySelector(t),!i){const a=[...document.querySelectorAll("[data-popover-ids]")].find(x=>{var j;return(j=x.getAttribute("data-popover-ids"))==null?void 0:j.split(",").find(pe=>pe.trim()===t)});a&&(i=a)}i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,J)),e(this,h).addEventListener("popoverOpened",e(this,K)),e(this,h).addEventListener("popoverClosing",e(this,Q)),e(this,h).addEventListener("popoverClosed",e(this,Z))):console.warn(this,`target ${t} not found`)}d(this,A,re).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{d(this,A,re).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,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),d(this,A,ie).call(this)}}h=new WeakMap,g=new WeakMap,A=new WeakSet,ie=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,J)),e(this,h).removeEventListener("popoverOpened",e(this,K)),e(this,h).removeEventListener("popoverClosing",e(this,Q)),e(this,h).removeEventListener("popoverClosed",e(this,Z)))},J=new WeakMap,K=new WeakMap,Q=new WeakMap,Z=new WeakMap,re=function(t){e(this,h)instanceof X&&(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")))};oe.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",ue);exports.PopoverButtonElement=ue;exports.PopoverElement=X;
1
+ "use strict";var he=c=>{throw TypeError(c)};var se=(c,n,t)=>n.has(c)||he("Cannot "+t);var e=(c,n,t)=>(se(c,n,"read from private field"),t?t.call(c):n.get(c)),r=(c,n,t)=>n.has(c)?he("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(c):n.set(c,t),o=(c,n,t,s)=>(se(c,n,"write to private field"),s?s.call(c,t):n.set(c,t),t),p=(c,n,t)=>(se(c,n,"access private method"),t);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const fe=require("../element-linked-store/index.cjs"),y=require("../css-property/index.cjs"),oe=require("../index-DekP7OZe.cjs"),W=require("../events-KVanG9sR.cjs"),ge=require("../function-MthRj-GJ.cjs"),le=require("../style-At6aDoqG.cjs");require("construct-style-sheets-polyfill");const ce=require("../url-Dns-01WU.cjs"),ae=require("../window-resizer/index.cjs"),Z=require("../Viewport-DB0qAZPJ.cjs");var f,w,ee,te;class ve{constructor(){r(this,f,new Map);r(this,w,[]);r(this,ee,n=>{var s;const t=[...e(this,w)].reverse().find(i=>i.clickOutside.current);if(t){const i=n.composedPath();if(i.find(Q=>Q instanceof HTMLElement&&Q.hasAttribute("data-popover-content")))return;const l=i[0],d=l instanceof Node&&(t.contains(l)||((s=t.shadowRoot)==null?void 0:s.contains(l))),L=l instanceof HTMLElement&&l.hasAttribute("data-outside");(!d||L)&&t.close()}});r(this,te,n=>{if(n.code==="Escape"){const t=[...e(this,w)].reverse().find(s=>s.escape.current);t&&t.close()}});document.documentElement.addEventListener("click",e(this,ee)),addEventListener("keydown",e(this,te))}get groups(){return e(this,f)}get stack(){return e(this,w)}add(n,t){if(t.closeRest.current)e(this,f).forEach(i=>{i.forEach(l=>{l.close()})});else if(t.closeRestInGroup.current){let i=e(this,f).get(n);i==null||i.forEach(l=>{l.close()})}let s=e(this,f).get(n);s!=null&&s.length||(s=[],e(this,f).set(n,s)),e(this,w).push(t),s.push(t)}remove(n,t){if(setTimeout(()=>{o(this,w,e(this,w).filter(s=>s!==t))}),t.closeRest.current){let s=[];e(this,f).forEach(i=>{i.forEach(l=>s.push(l))}),e(this,f).clear(),s.forEach(i=>i.close())}else if(t.closeRestInGroup.current){const s=e(this,f).get(n);e(this,f).delete(n),s==null||s.forEach(i=>{i.close()})}else{let s=e(this,f).get(n);s&&(s=s.filter(i=>i!==t),e(this,f).set(n,s))}}}f=new WeakMap,w=new WeakMap,ee=new WeakMap,te=new WeakMap;var v,B,H,R,G,m,T,P,q,$,b,V,O,k,E,z,a,M,D,u,ue,S,_,F,A,I,X,U;const C=class C extends HTMLElement{constructor(){super();r(this,u);r(this,v);r(this,B);r(this,H);r(this,R);r(this,G);r(this,m);r(this,T);r(this,P);r(this,q);r(this,$);r(this,b);r(this,V);r(this,O);r(this,k);r(this,E);r(this,z);r(this,a);r(this,M);r(this,D);r(this,F);r(this,A);r(this,I);r(this,X);r(this,U);this.urlValue="",o(this,v,!1),o(this,m,new y.CSSProperty(this,"--history",!1)),o(this,T,new y.CSSProperty(this,"--restore",!1)),o(this,P,new y.CSSProperty(this,"--dispatch-resize",!1)),o(this,q,new y.CSSProperty(this,"--close-rest",!1)),o(this,$,new y.CSSProperty(this,"--close-rest-in-group",!1)),o(this,b,new y.CSSProperty(this,"--group","")),o(this,V,new y.CSSProperty(this,"--click-outside",!1)),o(this,O,new y.CSSProperty(this,"--escape",!1)),o(this,k,new y.CSSProperty(this,"--check-viewport-bounds",!1)),o(this,E,!0),o(this,a,new fe.ElementLinkedStore(this,{triggered:!1,beforeopen:!1,opened:!1,closing:!1,transitionend:!1})),o(this,M,[]),o(this,D,[]),o(this,F,()=>{o(this,E,!1),e(this,v)&&e(this,m).current&&!location.search.includes(this.id)?this.close():!e(this,v)&&e(this,m).current&&location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)}),o(this,A,()=>{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,I).call(this)}),o(this,I,ge.debounce(()=>{e(this,X).call(this)},10)),o(this,X,()=>{if(this.style.setProperty("--content-width",this.scrollWidth+"px"),this.style.setProperty("--content-height",this.scrollHeight+"px"),e(this,k).current){const t=this.getBoundingClientRect();let s=0,i=0;t.right>Z.viewport.width?s=Z.viewport.width-t.right:t.left<0&&(s=t.left*-1),t.bottom>Z.viewport.height?i=Z.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")}}),o(this,U,()=>{this.close()}),e(this,b).subscribe(t=>{t.previous&&(C.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=C.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 openClass(){return this.getAttribute("data-open-global-class")}get closingClass(){return this.getAttribute("data-closing-global-class")}get history(){return e(this,m)}get restore(){return e(this,T)}get dispatchResize(){return e(this,P)}get closeRest(){return e(this,q)}get closeRestInGroup(){return e(this,$)}get group(){return e(this,b)}get clickOutside(){return e(this,V)}get escape(){return e(this,O)}get opened(){return e(this,v)}get lastTrigger(){return e(this,z)}get idWithValue(){return`${this.id}${this.urlValue?"="+this.urlValue:""}`}updateUrlValue(t){this.urlValue=(t==null?void 0:t.toString())||"",e(this,v)&&ce.updateSearchParameter(this.id,t)}open(t){if(e(this,v))return;o(this,z,t==null?void 0:t.trigger),clearTimeout(e(this,B)),clearTimeout(e(this,H)),p(this,u,S).call(this,!1,this.closingClass),e(this,a).set("closing",!1),e(this,a).set("triggered",!0),W.dispatchEvent(this,"popoverTriggered",{custom:!0,detail:{trigger:e(this,z)}}),e(this,m).current&&e(this,E)&&history.pushState(history.state,"",e(this,u,ue)),e(this,a).set("beforeopen",!0),o(this,v,!0);const s=()=>{C.stack.add(e(this,b).current,this),e(this,D).forEach(i=>{i.scroll({top:0,left:0,behavior:"instant"})}),p(this,u,S).call(this,!0,this.openClass),e(this,a).set("opened",!0),e(this,P).current?W.dispatchEvent(window,"resize",{custom:!0}):e(this,A).call(this),W.dispatchEvent(this,"popoverOpened",{custom:!0,detail:{trigger:e(this,z)},bubbles:!0}),o(this,R,void 0),o(this,G,setTimeout(()=>{e(this,a).set("transitionend",!0),W.dispatchEvent(this,"popoverTransitionend")},le.getElementTransitionDurationMS(this)+10))};t!=null&&t.skipTransition?s():o(this,R,requestAnimationFrame(s))}close(){e(this,v)&&(o(this,v,!1),cancelAnimationFrame(e(this,R)),clearTimeout(e(this,G)),C.stack.remove(e(this,b).current,this),p(this,u,_).call(this),o(this,B,setTimeout(()=>{e(this,a).set("transitionend",!1),e(this,a).set("opened",!1),e(this,a).set("closing",!0),p(this,u,S).call(this,!1,this.openClass),p(this,u,S).call(this,!0,this.closingClass),W.dispatchEvent(this,"popoverClosing",{custom:!0,bubbles:!0}),o(this,H,setTimeout(()=>{e(this,a).set("triggered",!1),e(this,a).set("beforeopen",!1),e(this,a).set("closing",!1),p(this,u,S).call(this,!1,this.closingClass),W.dispatchEvent(this,"popoverClosed",{custom:!0,bubbles:!0})},le.getElementTransitionDurationMS(this)+10))},10)))}connectedCallback(){o(this,M,[...this.querySelectorAll(`[data-popover-close${this.id?`="${this.id}"`:""}]`)]),e(this,M).forEach(t=>{t.addEventListener("click",e(this,U))}),o(this,D,[...this.querySelectorAll(`[data-popover-reset-scroll${this.id?`="${this.id}"`:""}]`)]),e(this,m).observe(),e(this,T).observe(),e(this,P).observe(),e(this,q).observe(),e(this,$).observe(),e(this,b).observe(),e(this,V).observe(),e(this,O).observe(),e(this,k).observe(),this.setAttribute("role","dialog"),addEventListener("popstate",e(this,F)),setTimeout(()=>{e(this,T).current?(o(this,E,!1),this.urlValue=ce.parseSearchParameters(location.search)[this.id],location.search.includes(this.id)&&this.open({trigger:this.idWithValue}),o(this,E,!0)):(p(this,u,_).call(this),o(this,E,!0))},0),e(this,k).subscribe(()=>{e(this,A).call(this)}),ae.windowResizer.subscribe(e(this,A))}disconnectedCallback(){e(this,M).forEach(t=>{t.removeEventListener("click",e(this,U))}),C.stack.remove(e(this,b).current,this),ae.windowResizer.unsubscribe(e(this,A)),e(this,m).close(),e(this,T).close(),e(this,P).close(),e(this,q).close(),e(this,$).close(),e(this,b).close(),e(this,V).close(),e(this,O).close(),e(this,k).close(),this.removeAttribute("role"),p(this,u,S).call(this,!1,this.openClass),p(this,u,S).call(this,!1,this.closingClass),clearTimeout(e(this,B)),clearTimeout(e(this,H)),clearTimeout(e(this,R)),clearTimeout(e(this,G)),removeEventListener("popstate",e(this,F)),this.style.removeProperty("--content-width"),this.style.removeProperty("--content-height"),this.style.removeProperty("--viewport-offset-x"),this.style.removeProperty("--viewport-offset-y"),p(this,u,_).call(this)}};v=new WeakMap,B=new WeakMap,H=new WeakMap,R=new WeakMap,G=new WeakMap,m=new WeakMap,T=new WeakMap,P=new WeakMap,q=new WeakMap,$=new WeakMap,b=new WeakMap,V=new WeakMap,O=new WeakMap,k=new WeakMap,E=new WeakMap,z=new WeakMap,a=new WeakMap,M=new WeakMap,D=new WeakMap,u=new WeakSet,ue=function(){return`${location.pathname}${location.search?location.search+"&":"?"}${this.idWithValue}`},S=function(t,s){s&&s.split(" ").map(i=>{document.documentElement.classList.toggle(i.trim(),t)})},_=function(){if(e(this,m).current){const t=new URL(location.href);t.searchParams.delete(this.id),history.replaceState(history.state,"",t.href)}},F=new WeakMap,A=new WeakMap,I=new WeakMap,X=new WeakMap,U=new WeakMap,C.stack=new ve;let j=C;oe.isBrowser&&!customElements.get("e-popover")&&customElements.define("e-popover",j);var h,g,x,ie,Y,J,K,N,re;class pe extends HTMLElement{constructor(){super();r(this,x);r(this,h);r(this,g,new y.CSSProperty(this,"--type","open"));r(this,Y,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.add("triggered")});r(this,J,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.add("opened"),this.setAttribute("aria-expanded","true"))});r(this,K,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&this.classList.remove("opened")});r(this,N,t=>{t.target===e(this,h)&&e(this,g).current!=="close"&&(this.classList.remove("triggered"),this.setAttribute("aria-expanded","false"))});oe.isBrowser&&(this.addEventListener("click",()=>{if(e(this,h)){const t=e(this,g).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,g)}get popoverElement(){return e(this,h)}changePopover(t){var s;if(p(this,x,ie).call(this),t){let i=null;if(t==="parent"){const l=this.closest("[data-popover]");if(l)i=l;else{const d=this.getRootNode();d instanceof ShadowRoot?i=d.host.closest("[data-popover]"):d instanceof HTMLElement&&(i=d.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=d=>{if(!d)return null;let L=d.querySelector("[data-popover]");return!L&&(d!=null&&d.parentElement)&&(L=l(d.parentElement)),L};i=l(this.parentElement)||null}else{let l=t;if(isNaN(parseInt(l))&&(!t.startsWith(".")&&!t.startsWith("[")&&!t.startsWith("#")&&(l=`#${t}`),i=document.querySelector(l)||this.getRootNode().querySelector(l)),!i){const L=[...document.querySelectorAll("[data-popover-ids]")].find(Q=>{var ne;return(ne=Q.getAttribute("data-popover-ids"))==null?void 0:ne.split(",").find(de=>de.trim()===t)});L&&(i=L)}}i instanceof HTMLElement?(o(this,h,i),e(this,h).addEventListener("popoverTriggered",e(this,Y)),e(this,h).addEventListener("popoverOpened",e(this,J)),e(this,h).addEventListener("popoverClosing",e(this,K)),e(this,h).addEventListener("popoverClosed",e(this,N))):console.warn(this,`target ${t} not found`)}p(this,x,re).call(this,e(this,g).current)}connectedCallback(){e(this,g).subscribe(s=>{p(this,x,re).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,g).observe()}disconnectedCallback(){e(this,g).unobserve(),this.removeAttribute("aria-haspopup"),this.removeAttribute("aria-expanded"),this.removeAttribute("aria-controls"),this.removeAttribute("role"),this.removeAttribute("tabindex"),p(this,x,ie).call(this)}}h=new WeakMap,g=new WeakMap,x=new WeakSet,ie=function(){e(this,h)&&(e(this,h).removeEventListener("popoverTriggered",e(this,Y)),e(this,h).removeEventListener("popoverOpened",e(this,J)),e(this,h).removeEventListener("popoverClosing",e(this,K)),e(this,h).removeEventListener("popoverClosed",e(this,N)))},Y=new WeakMap,J=new WeakMap,K=new WeakMap,N=new WeakMap,re=function(t){e(this,h)instanceof j&&(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")))};oe.isBrowser&&!customElements.get("e-popover-button")&&customElements.define("e-popover-button",pe);exports.PopoverButtonElement=pe;exports.PopoverElement=j;
@@ -1,20 +1,20 @@
1
- var ht = (c) => {
1
+ var nt = (c) => {
2
2
  throw TypeError(c);
3
3
  };
4
- var st = (c, h, e) => h.has(c) || ht("Cannot " + e);
5
- var t = (c, h, e) => (st(c, h, "read from private field"), e ? e.call(c) : h.get(c)), r = (c, h, e) => h.has(c) ? ht("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(c) : h.set(c, e), o = (c, h, e, s) => (st(c, h, "write to private field"), s ? s.call(c, e) : h.set(c, e), e), d = (c, h, e) => (st(c, h, "access private method"), e);
6
- import { ElementLinkedStore as ut } from "../element-linked-store/index.js";
4
+ var st = (c, h, e) => h.has(c) || nt("Cannot " + e);
5
+ var t = (c, h, e) => (st(c, h, "read from private field"), e ? e.call(c) : h.get(c)), r = (c, h, e) => h.has(c) ? nt("Cannot add the same private member more than once") : h instanceof WeakSet ? h.add(c) : h.set(c, e), o = (c, h, e, s) => (st(c, h, "write to private field"), s ? s.call(c, e) : h.set(c, e), e), p = (c, h, e) => (st(c, h, "access private method"), e);
6
+ import { ElementLinkedStore as pt } from "../element-linked-store/index.js";
7
7
  import { CSSProperty as E } from "../css-property/index.js";
8
8
  import { i as ot } from "../index-Bv9zgfdb.js";
9
9
  import { d as W } from "../events-CsVF98U6.js";
10
- import { d as pt } from "../function-C10DGppn.js";
11
- import { g as nt } from "../style-j2TwriJ_.js";
10
+ import { d as dt } from "../function-C10DGppn.js";
11
+ import { g as lt } from "../style-j2TwriJ_.js";
12
12
  import "construct-style-sheets-polyfill";
13
- import { u as dt, p as ft } from "../url-CBKXmNOi.js";
14
- import { windowResizer as lt } from "../window-resizer/index.js";
15
- import { v as Z } from "../Viewport-DA10iWAO.js";
13
+ import { u as ft, p as gt } from "../url-CBKXmNOi.js";
14
+ import { windowResizer as ct } from "../window-resizer/index.js";
15
+ import { v as Q } from "../Viewport-DA10iWAO.js";
16
16
  var f, w, tt, et;
17
- class gt {
17
+ class mt {
18
18
  constructor() {
19
19
  r(this, f, /* @__PURE__ */ new Map());
20
20
  r(this, w, []);
@@ -24,11 +24,11 @@ class gt {
24
24
  if (e) {
25
25
  const i = h.composedPath();
26
26
  if (i.find(
27
- (X) => X instanceof HTMLElement && X.hasAttribute("data-popover-content")
27
+ (N) => N instanceof HTMLElement && N.hasAttribute("data-popover-content")
28
28
  ))
29
29
  return;
30
- const l = i[0], a = l instanceof Node && (e.contains(l) || ((s = e.shadowRoot) == null ? void 0 : s.contains(l))), x = l instanceof HTMLElement && l.hasAttribute("data-outside");
31
- (!a || x) && e.close();
30
+ const l = i[0], d = l instanceof Node && (e.contains(l) || ((s = e.shadowRoot) == null ? void 0 : s.contains(l))), L = l instanceof HTMLElement && l.hasAttribute("data-outside");
31
+ (!d || L) && e.close();
32
32
  }
33
33
  });
34
34
  r(this, et, (h) => {
@@ -84,40 +84,40 @@ class gt {
84
84
  }
85
85
  }
86
86
  f = new WeakMap(), w = new WeakMap(), tt = new WeakMap(), et = new WeakMap();
87
- var m, H, G, R, B, v, k, A, $, V, b, O, q, C, y, z, u, M, F, p, ct, L, N, D, P, Y, j, U;
88
- const T = class T extends HTMLElement {
87
+ var m, H, G, R, B, v, A, C, $, V, b, O, q, P, y, z, a, M, F, u, at, T, Z, D, S, I, X, U;
88
+ const k = class k extends HTMLElement {
89
89
  constructor() {
90
90
  super();
91
- r(this, p);
91
+ r(this, u);
92
92
  r(this, m);
93
93
  r(this, H);
94
94
  r(this, G);
95
95
  r(this, R);
96
96
  r(this, B);
97
97
  r(this, v);
98
- r(this, k);
99
98
  r(this, A);
99
+ r(this, C);
100
100
  r(this, $);
101
101
  r(this, V);
102
102
  r(this, b);
103
103
  r(this, O);
104
104
  r(this, q);
105
- r(this, C);
105
+ r(this, P);
106
106
  r(this, y);
107
107
  r(this, z);
108
- r(this, u);
108
+ r(this, a);
109
109
  r(this, M);
110
110
  r(this, F);
111
111
  r(this, D);
112
- r(this, P);
113
- r(this, Y);
114
- r(this, j);
112
+ r(this, S);
113
+ r(this, I);
114
+ r(this, X);
115
115
  r(this, U);
116
- this.urlValue = "", o(this, m, !1), o(this, v, new E(this, "--history", !1)), o(this, k, new E(this, "--restore", !1)), o(this, A, new E(this, "--dispatch-resize", !1)), o(this, $, new E(this, "--close-rest", !1)), o(this, V, new E(
116
+ this.urlValue = "", o(this, m, !1), o(this, v, new E(this, "--history", !1)), o(this, A, new E(this, "--restore", !1)), o(this, C, new E(this, "--dispatch-resize", !1)), o(this, $, new E(this, "--close-rest", !1)), o(this, V, new E(
117
117
  this,
118
118
  "--close-rest-in-group",
119
119
  !1
120
- )), o(this, b, new E(this, "--group", "")), o(this, O, new E(this, "--click-outside", !1)), o(this, q, new E(this, "--escape", !1)), o(this, C, new E(this, "--check-viewport-bounds", !1)), o(this, y, !0), o(this, u, new ut(this, {
120
+ )), o(this, b, new E(this, "--group", "")), o(this, O, new E(this, "--click-outside", !1)), o(this, q, new E(this, "--escape", !1)), o(this, P, new E(this, "--check-viewport-bounds", !1)), o(this, y, !0), o(this, a, new pt(this, {
121
121
  triggered: !1,
122
122
  beforeopen: !1,
123
123
  opened: !1,
@@ -125,31 +125,31 @@ const T = class T extends HTMLElement {
125
125
  transitionend: !1
126
126
  })), o(this, M, []), o(this, F, []), o(this, D, () => {
127
127
  o(this, y, !1), t(this, m) && t(this, v).current && !location.search.includes(this.id) ? this.close() : !t(this, m) && t(this, v).current && location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, y, !0);
128
- }), o(this, P, () => {
129
- 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"), t(this, Y).call(this);
130
- }), o(this, Y, pt(() => {
131
- t(this, j).call(this);
132
- }, 10)), o(this, j, () => {
133
- if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, C).current) {
128
+ }), o(this, S, () => {
129
+ 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"), t(this, I).call(this);
130
+ }), o(this, I, dt(() => {
131
+ t(this, X).call(this);
132
+ }, 10)), o(this, X, () => {
133
+ if (this.style.setProperty("--content-width", this.scrollWidth + "px"), this.style.setProperty("--content-height", this.scrollHeight + "px"), t(this, P).current) {
134
134
  const e = this.getBoundingClientRect();
135
135
  let s = 0, i = 0;
136
- e.right > Z.width ? s = Z.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > Z.height ? i = Z.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");
136
+ e.right > Q.width ? s = Q.width - e.right : e.left < 0 && (s = e.left * -1), e.bottom > Q.height ? i = Q.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");
137
137
  }
138
138
  }), o(this, U, () => {
139
139
  this.close();
140
140
  }), t(this, b).subscribe((e) => {
141
- e.previous && (T.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
141
+ e.previous && (k.stack.remove(e.previous, this), e.current || (document.documentElement.classList.remove(
142
142
  `${this.group.previous}-closing`
143
143
  ), document.documentElement.classList.remove(
144
144
  `${this.group.previous}-opened`
145
145
  )));
146
- }), t(this, u).subscribe((e) => {
146
+ }), t(this, a).subscribe((e) => {
147
147
  if (this.group.current) {
148
148
  document.documentElement.classList.toggle(
149
149
  `${this.group.current}-closing`,
150
150
  e.current.closing
151
151
  );
152
- const s = T.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((l) => l.opened);
152
+ const s = k.stack.groups.get(this.group.current), i = s == null ? void 0 : s.find((l) => l.opened);
153
153
  document.documentElement.classList.toggle(
154
154
  `${this.group.current}-opened`,
155
155
  !!i
@@ -167,10 +167,10 @@ const T = class T extends HTMLElement {
167
167
  return t(this, v);
168
168
  }
169
169
  get restore() {
170
- return t(this, k);
170
+ return t(this, A);
171
171
  }
172
172
  get dispatchResize() {
173
- return t(this, A);
173
+ return t(this, C);
174
174
  }
175
175
  get closeRest() {
176
176
  return t(this, $);
@@ -197,47 +197,47 @@ const T = class T extends HTMLElement {
197
197
  return `${this.id}${this.urlValue ? "=" + this.urlValue : ""}`;
198
198
  }
199
199
  updateUrlValue(e) {
200
- this.urlValue = (e == null ? void 0 : e.toString()) || "", t(this, m) && dt(this.id, e);
200
+ this.urlValue = (e == null ? void 0 : e.toString()) || "", t(this, m) && ft(this.id, e);
201
201
  }
202
202
  open(e) {
203
203
  if (t(this, m))
204
204
  return;
205
- o(this, z, e == null ? void 0 : e.trigger), clearTimeout(t(this, H)), clearTimeout(t(this, G)), d(this, p, L).call(this, !1, this.closingClass), t(this, u).set("closing", !1), t(this, u).set("triggered", !0), W(this, "popoverTriggered", {
205
+ o(this, z, e == null ? void 0 : e.trigger), clearTimeout(t(this, H)), clearTimeout(t(this, G)), p(this, u, T).call(this, !1, this.closingClass), t(this, a).set("closing", !1), t(this, a).set("triggered", !0), W(this, "popoverTriggered", {
206
206
  custom: !0,
207
207
  detail: {
208
208
  trigger: t(this, z)
209
209
  }
210
- }), t(this, v).current && t(this, y) && history.pushState(history.state, "", t(this, p, ct)), t(this, u).set("beforeopen", !0), o(this, m, !0);
210
+ }), t(this, v).current && t(this, y) && history.pushState(history.state, "", t(this, u, at)), t(this, a).set("beforeopen", !0), o(this, m, !0);
211
211
  const s = () => {
212
- T.stack.add(t(this, b).current, this), t(this, F).forEach((i) => {
212
+ k.stack.add(t(this, b).current, this), t(this, F).forEach((i) => {
213
213
  i.scroll({
214
214
  top: 0,
215
215
  left: 0,
216
216
  behavior: "instant"
217
217
  });
218
- }), d(this, p, L).call(this, !0, this.openClass), t(this, u).set("opened", !0), t(this, A).current ? W(window, "resize", { custom: !0 }) : t(this, P).call(this), W(this, "popoverOpened", {
218
+ }), p(this, u, T).call(this, !0, this.openClass), t(this, a).set("opened", !0), t(this, C).current ? W(window, "resize", { custom: !0 }) : t(this, S).call(this), W(this, "popoverOpened", {
219
219
  custom: !0,
220
220
  detail: {
221
221
  trigger: t(this, z)
222
222
  },
223
223
  bubbles: !0
224
224
  }), o(this, R, void 0), o(this, B, setTimeout(() => {
225
- t(this, u).set("transitionend", !0), W(this, "popoverTransitionend");
226
- }, nt(this) + 10));
225
+ t(this, a).set("transitionend", !0), W(this, "popoverTransitionend");
226
+ }, lt(this) + 10));
227
227
  };
228
228
  e != null && e.skipTransition ? s() : o(this, R, requestAnimationFrame(s));
229
229
  }
230
230
  close() {
231
- t(this, m) && (o(this, m, !1), cancelAnimationFrame(t(this, R)), clearTimeout(t(this, B)), T.stack.remove(t(this, b).current, this), d(this, p, N).call(this), o(this, H, setTimeout(() => {
232
- t(this, u).set("transitionend", !1), t(this, u).set("opened", !1), t(this, u).set("closing", !0), d(this, p, L).call(this, !1, this.openClass), d(this, p, L).call(this, !0, this.closingClass), W(this, "popoverClosing", {
231
+ t(this, m) && (o(this, m, !1), cancelAnimationFrame(t(this, R)), clearTimeout(t(this, B)), k.stack.remove(t(this, b).current, this), p(this, u, Z).call(this), o(this, H, setTimeout(() => {
232
+ t(this, a).set("transitionend", !1), t(this, a).set("opened", !1), t(this, a).set("closing", !0), p(this, u, T).call(this, !1, this.openClass), p(this, u, T).call(this, !0, this.closingClass), W(this, "popoverClosing", {
233
233
  custom: !0,
234
234
  bubbles: !0
235
235
  }), o(this, G, setTimeout(() => {
236
- t(this, u).set("triggered", !1), t(this, u).set("beforeopen", !1), t(this, u).set("closing", !1), d(this, p, L).call(this, !1, this.closingClass), W(this, "popoverClosed", {
236
+ t(this, a).set("triggered", !1), t(this, a).set("beforeopen", !1), t(this, a).set("closing", !1), p(this, u, T).call(this, !1, this.closingClass), W(this, "popoverClosed", {
237
237
  custom: !0,
238
238
  bubbles: !0
239
239
  });
240
- }, nt(this) + 10));
240
+ }, lt(this) + 10));
241
241
  }, 10)));
242
242
  }
243
243
  connectedCallback() {
@@ -251,49 +251,49 @@ const T = class T extends HTMLElement {
251
251
  ...this.querySelectorAll(
252
252
  `[data-popover-reset-scroll${this.id ? `="${this.id}"` : ""}]`
253
253
  )
254
- ]), t(this, v).observe(), t(this, k).observe(), t(this, A).observe(), t(this, $).observe(), t(this, V).observe(), t(this, b).observe(), t(this, O).observe(), t(this, q).observe(), t(this, C).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, D)), setTimeout(() => {
255
- t(this, k).current ? (o(this, y, !1), this.urlValue = ft(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, y, !0)) : (d(this, p, N).call(this), o(this, y, !0));
256
- }, 0), t(this, C).subscribe(() => {
257
- t(this, P).call(this);
258
- }), lt.subscribe(t(this, P));
254
+ ]), t(this, v).observe(), t(this, A).observe(), t(this, C).observe(), t(this, $).observe(), t(this, V).observe(), t(this, b).observe(), t(this, O).observe(), t(this, q).observe(), t(this, P).observe(), this.setAttribute("role", "dialog"), addEventListener("popstate", t(this, D)), setTimeout(() => {
255
+ t(this, A).current ? (o(this, y, !1), this.urlValue = gt(location.search)[this.id], location.search.includes(this.id) && this.open({ trigger: this.idWithValue }), o(this, y, !0)) : (p(this, u, Z).call(this), o(this, y, !0));
256
+ }, 0), t(this, P).subscribe(() => {
257
+ t(this, S).call(this);
258
+ }), ct.subscribe(t(this, S));
259
259
  }
260
260
  disconnectedCallback() {
261
261
  t(this, M).forEach((e) => {
262
262
  e.removeEventListener("click", t(this, U));
263
- }), T.stack.remove(t(this, b).current, this), lt.unsubscribe(t(this, P)), t(this, v).close(), t(this, k).close(), t(this, A).close(), t(this, $).close(), t(this, V).close(), t(this, b).close(), t(this, O).close(), t(this, q).close(), t(this, C).close(), this.removeAttribute("role"), d(this, p, L).call(this, !1, this.openClass), d(this, p, L).call(this, !1, this.closingClass), clearTimeout(t(this, H)), clearTimeout(t(this, G)), clearTimeout(t(this, R)), clearTimeout(t(this, B)), removeEventListener("popstate", t(this, D)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), d(this, p, N).call(this);
263
+ }), k.stack.remove(t(this, b).current, this), ct.unsubscribe(t(this, S)), t(this, v).close(), t(this, A).close(), t(this, C).close(), t(this, $).close(), t(this, V).close(), t(this, b).close(), t(this, O).close(), t(this, q).close(), t(this, P).close(), this.removeAttribute("role"), p(this, u, T).call(this, !1, this.openClass), p(this, u, T).call(this, !1, this.closingClass), clearTimeout(t(this, H)), clearTimeout(t(this, G)), clearTimeout(t(this, R)), clearTimeout(t(this, B)), removeEventListener("popstate", t(this, D)), this.style.removeProperty("--content-width"), this.style.removeProperty("--content-height"), this.style.removeProperty("--viewport-offset-x"), this.style.removeProperty("--viewport-offset-y"), p(this, u, Z).call(this);
264
264
  }
265
265
  };
266
- m = new WeakMap(), H = new WeakMap(), G = new WeakMap(), R = new WeakMap(), B = new WeakMap(), v = new WeakMap(), k = new WeakMap(), A = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), b = new WeakMap(), O = new WeakMap(), q = new WeakMap(), C = new WeakMap(), y = new WeakMap(), z = new WeakMap(), u = new WeakMap(), M = new WeakMap(), F = new WeakMap(), p = new WeakSet(), ct = function() {
266
+ m = new WeakMap(), H = new WeakMap(), G = new WeakMap(), R = new WeakMap(), B = new WeakMap(), v = new WeakMap(), A = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), b = new WeakMap(), O = new WeakMap(), q = new WeakMap(), P = new WeakMap(), y = new WeakMap(), z = new WeakMap(), a = new WeakMap(), M = new WeakMap(), F = new WeakMap(), u = new WeakSet(), at = function() {
267
267
  return `${location.pathname}${location.search ? location.search + "&" : "?"}${this.idWithValue}`;
268
- }, L = function(e, s) {
268
+ }, T = function(e, s) {
269
269
  s && s.split(" ").map((i) => {
270
270
  document.documentElement.classList.toggle(i.trim(), e);
271
271
  });
272
- }, N = function() {
272
+ }, Z = function() {
273
273
  if (t(this, v).current) {
274
274
  const e = new URL(location.href);
275
275
  e.searchParams.delete(this.id), history.replaceState(history.state, "", e.href);
276
276
  }
277
- }, D = new WeakMap(), P = new WeakMap(), Y = new WeakMap(), j = new WeakMap(), U = new WeakMap(), T.stack = new gt();
278
- let _ = T;
277
+ }, D = new WeakMap(), S = new WeakMap(), I = new WeakMap(), X = new WeakMap(), U = new WeakMap(), k.stack = new mt();
278
+ let _ = k;
279
279
  ot && !customElements.get("e-popover") && customElements.define("e-popover", _);
280
- var n, g, S, it, I, J, K, Q, rt;
281
- class mt extends HTMLElement {
280
+ var n, g, x, it, Y, j, J, K, rt;
281
+ class vt extends HTMLElement {
282
282
  constructor() {
283
283
  super();
284
- r(this, S);
284
+ r(this, x);
285
285
  r(this, n);
286
286
  r(this, g, new E(this, "--type", "open"));
287
- r(this, I, (e) => {
287
+ r(this, Y, (e) => {
288
288
  e.target === t(this, n) && t(this, g).current !== "close" && this.classList.add("triggered");
289
289
  });
290
- r(this, J, (e) => {
290
+ r(this, j, (e) => {
291
291
  e.target === t(this, n) && t(this, g).current !== "close" && (this.classList.add("opened"), this.setAttribute("aria-expanded", "true"));
292
292
  });
293
- r(this, K, (e) => {
293
+ r(this, J, (e) => {
294
294
  e.target === t(this, n) && t(this, g).current !== "close" && this.classList.remove("opened");
295
295
  });
296
- r(this, Q, (e) => {
296
+ r(this, K, (e) => {
297
297
  e.target === t(this, n) && t(this, g).current !== "close" && (this.classList.remove("triggered"), this.setAttribute("aria-expanded", "false"));
298
298
  });
299
299
  ot && (this.addEventListener("click", () => {
@@ -313,84 +313,87 @@ class mt extends HTMLElement {
313
313
  }
314
314
  changePopover(e) {
315
315
  var s;
316
- if (d(this, S, it).call(this), e) {
316
+ if (p(this, x, it).call(this), e) {
317
317
  let i = null;
318
318
  if (e === "parent") {
319
319
  const l = this.closest("[data-popover]");
320
320
  if (l)
321
321
  i = l;
322
322
  else {
323
- const a = this.getRootNode();
324
- a instanceof ShadowRoot ? i = a.host.closest("[data-popover]") : a instanceof HTMLElement && (i = a.closest("[data-popover]"));
323
+ const d = this.getRootNode();
324
+ d instanceof ShadowRoot ? i = d.host.closest("[data-popover]") : d instanceof HTMLElement && (i = d.closest("[data-popover]"));
325
325
  }
326
326
  } else if (e === "sibling")
327
327
  i = (s = this.parentElement) == null ? void 0 : s.querySelector("[data-popover]");
328
328
  else if (e === "ancestor-child") {
329
- const l = (a) => {
330
- if (!a)
329
+ const l = (d) => {
330
+ if (!d)
331
331
  return null;
332
- let x = a.querySelector("[data-popover]");
333
- return !x && (a != null && a.parentElement) && (x = l(a.parentElement)), x;
332
+ let L = d.querySelector("[data-popover]");
333
+ return !L && (d != null && d.parentElement) && (L = l(d.parentElement)), L;
334
334
  };
335
335
  i = l(this.parentElement) || null;
336
- } else if (!e.startsWith(".") && !e.startsWith("[") && e.startsWith("#"), i = document.querySelector(e) || this.getRootNode().querySelector(e), !i) {
337
- const a = [...document.querySelectorAll("[data-popover-ids]")].find(
338
- (x) => {
339
- var X;
340
- return (X = x.getAttribute("data-popover-ids")) == null ? void 0 : X.split(",").find((at) => at.trim() === e);
341
- }
342
- );
343
- a && (i = a);
336
+ } else {
337
+ let l = e;
338
+ if (isNaN(parseInt(l)) && (!e.startsWith(".") && !e.startsWith("[") && !e.startsWith("#") && (l = `#${e}`), i = document.querySelector(l) || this.getRootNode().querySelector(l)), !i) {
339
+ const L = [...document.querySelectorAll("[data-popover-ids]")].find(
340
+ (N) => {
341
+ var ht;
342
+ return (ht = N.getAttribute("data-popover-ids")) == null ? void 0 : ht.split(",").find((ut) => ut.trim() === e);
343
+ }
344
+ );
345
+ L && (i = L);
346
+ }
344
347
  }
345
348
  i instanceof HTMLElement ? (o(this, n, i), t(this, n).addEventListener(
346
349
  "popoverTriggered",
347
- t(this, I)
350
+ t(this, Y)
348
351
  ), t(this, n).addEventListener(
349
352
  "popoverOpened",
350
- t(this, J)
353
+ t(this, j)
351
354
  ), t(this, n).addEventListener(
352
355
  "popoverClosing",
353
- t(this, K)
356
+ t(this, J)
354
357
  ), t(this, n).addEventListener(
355
358
  "popoverClosed",
356
- t(this, Q)
359
+ t(this, K)
357
360
  )) : console.warn(this, `target ${e} not found`);
358
361
  }
359
- d(this, S, rt).call(this, t(this, g).current);
362
+ p(this, x, rt).call(this, t(this, g).current);
360
363
  }
361
364
  connectedCallback() {
362
365
  t(this, g).subscribe((s) => {
363
- d(this, S, rt).call(this, s.current);
366
+ p(this, x, rt).call(this, s.current);
364
367
  }), this.hasAttribute("tabindex") || (this.tabIndex = 0), this.hasAttribute("role") || this.setAttribute("role", "button");
365
368
  const e = this.getAttribute("target");
366
369
  e && this.changePopover(e), this.isConnected && t(this, g).observe();
367
370
  }
368
371
  disconnectedCallback() {
369
- t(this, g).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), d(this, S, it).call(this);
372
+ t(this, g).unobserve(), this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls"), this.removeAttribute("role"), this.removeAttribute("tabindex"), p(this, x, it).call(this);
370
373
  }
371
374
  }
372
- n = new WeakMap(), g = new WeakMap(), S = new WeakSet(), it = function() {
375
+ n = new WeakMap(), g = new WeakMap(), x = new WeakSet(), it = function() {
373
376
  t(this, n) && (t(this, n).removeEventListener(
374
377
  "popoverTriggered",
375
- t(this, I)
378
+ t(this, Y)
376
379
  ), t(this, n).removeEventListener(
377
380
  "popoverOpened",
378
- t(this, J)
381
+ t(this, j)
379
382
  ), t(this, n).removeEventListener(
380
383
  "popoverClosing",
381
- t(this, K)
384
+ t(this, J)
382
385
  ), t(this, n).removeEventListener(
383
386
  "popoverClosed",
384
- t(this, Q)
387
+ t(this, K)
385
388
  ));
386
- }, I = new WeakMap(), J = new WeakMap(), K = new WeakMap(), Q = new WeakMap(), rt = function(e) {
389
+ }, Y = new WeakMap(), j = new WeakMap(), J = new WeakMap(), K = new WeakMap(), rt = function(e) {
387
390
  t(this, n) instanceof _ && (e !== "close" ? (this.setAttribute("aria-haspopup", "true"), this.setAttribute(
388
391
  "aria-expanded",
389
392
  t(this, n).opened ? "true" : "false"
390
393
  ), this.setAttribute("aria-controls", t(this, n).id || "")) : (this.removeAttribute("aria-haspopup"), this.removeAttribute("aria-expanded"), this.removeAttribute("aria-controls")));
391
394
  };
392
- ot && !customElements.get("e-popover-button") && customElements.define("e-popover-button", mt);
395
+ ot && !customElements.get("e-popover-button") && customElements.define("e-popover-button", vt);
393
396
  export {
394
- mt as PopoverButtonElement,
397
+ vt as PopoverButtonElement,
395
398
  _ as PopoverElement
396
399
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aptechka",
3
- "version": "0.76.6",
3
+ "version": "0.76.8",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/denisavitski/aptechka.git"