@politiet/sheriff-web-components 2.12.0 → 2.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/custom-elements.json +224 -8
- package/dist/frameworks/vue.d.ts +79 -30
- package/dist/frameworks/vue.d.ts.map +1 -1
- package/dist/mixins/sds-dialog-target-mixin.d.ts.map +1 -1
- package/dist/mixins/sds-dialog-target-mixin.js +10 -0
- package/dist/mixins/sds-dialog-target-mixin.js.map +1 -1
- package/dist/sds-alert/sds-alert.component.js +3 -3
- package/dist/sds-alert/sds-alert.component.js.map +1 -1
- package/dist/sds-alert/sds-alert.styles.d.ts.map +1 -1
- package/dist/sds-alert/sds-alert.styles.js +0 -6
- package/dist/sds-alert/sds-alert.styles.js.map +1 -1
- package/dist/sds-button/sds-button.component.d.ts +1 -0
- package/dist/sds-button/sds-button.component.d.ts.map +1 -1
- package/dist/sds-button/sds-button.component.js.map +1 -1
- package/dist/sds-button/sds-button.styles.d.ts.map +1 -1
- package/dist/sds-button/sds-button.styles.js +7 -2
- package/dist/sds-button/sds-button.styles.js.map +1 -1
- package/dist/sds-details/sds-details.styles.d.ts.map +1 -1
- package/dist/sds-details/sds-details.styles.js +4 -2
- package/dist/sds-details/sds-details.styles.js.map +1 -1
- package/dist/sds-dialog/sds-dialog.styles.d.ts.map +1 -1
- package/dist/sds-dialog/sds-dialog.styles.js +2 -0
- package/dist/sds-dialog/sds-dialog.styles.js.map +1 -1
- package/dist/sds-icon/sds-icon-loader.d.ts +1 -0
- package/dist/sds-icon/sds-icon-loader.d.ts.map +1 -1
- package/dist/sds-icon/sds-icon-loader.js +21 -14
- package/dist/sds-icon/sds-icon-loader.js.map +1 -1
- package/dist/sds-radio/sds-radio.d.ts +53 -1
- package/dist/sds-radio/sds-radio.d.ts.map +1 -1
- package/dist/sds-radio/sds-radio.js +218 -41
- package/dist/sds-radio/sds-radio.js.map +1 -1
- package/dist/sds-radio/sds-radio.styles.js +36 -36
- package/dist/sds-radio/sds-radio.styles.js.map +1 -1
- package/dist/sds-radio-group/sds-radio-group.d.ts +4 -2
- package/dist/sds-radio-group/sds-radio-group.d.ts.map +1 -1
- package/dist/sds-radio-group/sds-radio-group.js +10 -3
- package/dist/sds-radio-group/sds-radio-group.js.map +1 -1
- package/dist/sds-text/sds-text.component.d.ts +2 -0
- package/dist/sds-text/sds-text.component.d.ts.map +1 -1
- package/dist/sds-text/sds-text.component.js +4 -0
- package/dist/sds-text/sds-text.component.js.map +1 -1
- package/dist/sds-text/sds-text.styles.d.ts.map +1 -1
- package/dist/sds-text/sds-text.styles.js +4 -0
- package/dist/sds-text/sds-text.styles.js.map +1 -1
- package/dist/sds-textarea/sds-textarea.styles.d.ts.map +1 -1
- package/dist/sds-textarea/sds-textarea.styles.js +2 -0
- package/dist/sds-textarea/sds-textarea.styles.js.map +1 -1
- package/dist/shared/assets/positioning.js +1 -1
- package/dist/sheriff-web-components.js +206 -194
- package/dist/skill/SKILL.md +127 -41
- package/dist/skill/references/components.md +247 -35
- package/dist/skill/references/react-wrappers.md +34 -9
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +78 -36
- package/web-types.json +163 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
const e={passive:!0,capture:!0},t=()=>typeof window<"u"&&typeof document<"u",n=(e,t,n)=>void 0===n?e.getAttribute(t)??null:(null===n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),o=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),r=(e,...t)=>{let[n,...o]=t;for(let t of n.split(" "))e.addEventListener(t,...o);return()=>i(e,...t)},i=(e,...t)=>{let[n,...o]=t;for(let t of n.split(" "))e.removeEventListener(t,...o)},l=(e,n)=>{t()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(e)?.map(e=>e()),window._dsHotReloadCleanup?.set(e,n()))};let a;const s=()=>{"complete"===document.readyState&&(a||(a=((e,t)=>{let o=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))n(o,e,r);return o})("div",{"aria-live":"assertive"}),a.style.overflow="hidden",a.style.position="fixed",a.style.whiteSpace="nowrap",a.style.width="1px"),a.isConnected||document.body.appendChild(a))};l("announce",()=>[r(document,"focus mouseover",s,e)]);var c=class extends Event{oldState;newState;constructor(e,{oldState:t="",newState:n="",...o}={}){super(e,o),this.oldState=String(t||""),this.newState=String(n||"")}},u=new WeakMap;function f(e,t,n){u.set(e,setTimeout(()=>{u.has(e)&&e.dispatchEvent(new c("toggle",{cancelable:!1,oldState:t,newState:n}))},0))}var p=globalThis.ShadowRoot||function(){},d=globalThis.HTMLDialogElement||function(){},h=new WeakMap,m=new WeakMap,g=new WeakMap,w=new WeakMap;function y(e){return w.get(e)||"hidden"}var v=new WeakMap;function b(e){return[...e].pop()}function x(e,t){return!("auto"!==e.popover&&"manual"!==e.popover&&"hint"!==e.popover||!e.isConnected||t&&"showing"!==y(e)||!t&&"hidden"!==y(e)||e instanceof d&&e.hasAttribute("open")||document.fullscreenElement===e)}function E(e){if(!e)return 0;let t=m.get(document)||new Set,n=g.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function S(e){let t=R(e),n=function(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if((e=e.parentElement||A(e))instanceof p&&(e=e.host),e instanceof Document)return}}(e);return E(t)>E(n)?t:n}function T(e){let t,n=g.get(e)||new Set,o=m.get(e)||new Set,r=n.size>0?n:o.size>0?o:null;return r?(t=b(r),t.isConnected?t:(r.delete(t),T(e))):null}function L(e){for(let t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function A(e){return"function"==typeof e.getRootNode?e.getRootNode():e.parentNode?A(e.parentNode):e}function R(e){for(;e;){if(e instanceof HTMLElement&&"auto"===e.popover&&"showing"===w.get(e))return e;if((e=e instanceof Element&&e.assignedSlot||e.parentElement||A(e))instanceof p&&(e=e.host),e instanceof Document)return}}function M(e,t){let n=new Map,o=0;for(let e of t||[])n.set(e,o),o+=1;n.set(e,o),o+=1;let r=null;return function(t){if(!t)return;let o=!1,i=null,l=null;for(;!o;){if(i=R(t)||null,null===i||!n.has(i))return;("hint"===e.popover||"auto"===i.popover)&&(o=!0),o||(t=i.parentElement)}l=n.get(i),(null===r||n.get(r)<l)&&(r=i)}(e.parentElement||A(e)),r}function H(e){return!(e.hidden||e instanceof p||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&"hidden"===e.type||e instanceof HTMLAnchorElement&&""===e.href)&&("number"==typeof e.tabIndex&&-1!==e.tabIndex)}function D(e){var t;null==(t=function(e){if(e.shadowRoot&&!0!==e.shadowRoot.delegatesFocus)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector("[autofocus]");if(n)return n;{let e=t.querySelectorAll("slot");for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e){if(t.hasAttribute("autofocus"))return t;if(n=t.querySelector("[autofocus]"),n)return n}}}let o=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),r=o.currentNode;for(;r;){if(H(r))return r;r=o.nextNode()}}(e))||t.focus()}var C=new WeakMap;function k(e){if(!x(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new c("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!x(e,!1))return;let n=!1,o=e.popover,r=null,i=M(e,m.get(t)||new Set),l=M(e,g.get(t)||new Set);if("auto"===o&&(P(g.get(t)||new Set,n,!0),F(i||t,n,!0),r="auto"),"hint"===o&&(l?(F(l,n,!0),r="hint"):(P(g.get(t)||new Set,n,!0),i?(F(i,n,!0),r="auto"):r="hint")),"auto"===o||"hint"===o){if(o!==e.popover||!x(e,!1))return;T(t)||(n=!0),"auto"===r?(m.has(t)||m.set(t,new Set),m.get(t).add(e)):"hint"===r&&(g.has(t)||g.set(t,new Set),g.get(t).add(e))}C.delete(e);let a=t.activeElement;e.classList.add(":popover-open"),w.set(e,"showing"),h.has(t)||h.set(t,new Set),h.get(t).add(e),B(v.get(e),!0),D(e),n&&a&&"auto"===e.popover&&C.set(e,a),f(e,"closed","open")}function O(e,t=!1,n=!1){var o,r;if(!x(e,!0))return;let i=e.ownerDocument;if(["auto","hint"].includes(e.popover)&&(F(e,t,n),!x(e,!0)))return;let l=m.get(i)||new Set,a=l.has(e)&&b(l)===e;if(B(v.get(e),!1),v.delete(e),n&&(e.dispatchEvent(new c("beforetoggle",{oldState:"open",newState:"closed"})),a&&b(l)!==e&&F(e,t,n),!x(e,!0)))return;null==(o=h.get(i))||o.delete(e),l.delete(e),null==(r=g.get(i))||r.delete(e),e.classList.remove(":popover-open"),w.set(e,"hidden"),n&&f(e,"open","closed");let s=C.get(e);s&&(C.delete(e),t&&s.focus())}function P(e,t=!1,n=!1){let o=L(e);for(;o;)O(o,t,n),o=L(e)}function W(e,t,n,o){let r=!1,i=!1;for(;r||!i;){i=!0;let l=null,a=!1;for(let n of t)if(n===e)a=!0;else if(a){l=n;break}if(!l)return;for(;"showing"===y(l)&&t.size;)O(b(t),n,o);t.has(e)&&b(t)!==e&&(r=!0),r&&(o=!1)}}function F(e,t,n){let o=e.ownerDocument||e;if(e instanceof Document)return function(e,t=!1,n=!1){let o=T(e);for(;o;)O(o,t,n),o=T(e)}(o,t,n);g.get(o)?.has(e)?W(e,g.get(o),t,n):(P(g.get(o)||new Set,t,n),m.get(o)?.has(e)&&W(e,m.get(o),t,n))}var N=new WeakMap;function z(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!T(n))return;let o=S(t);if(o&&"pointerdown"===e.type)N.set(n,o);else if("pointerup"===e.type){let e=N.get(n)===o;N.delete(n),e&&F(o||n,!1,!0)}}var $=new WeakMap;function B(e,t=!1){if(!e)return;$.has(e)||$.set(e,e.getAttribute("aria-expanded"));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)e.setAttribute("aria-expanded",String(t));else{let t=$.get(e);t?e.setAttribute("aria-expanded",t):e.removeAttribute("aria-expanded")}}var _=globalThis.ShadowRoot||function(){};function q(e,t,n){let o=e[t];Object.defineProperty(e,t,{value(e){return o.call(this,n(e))}})}var I=/(^|[^\\]):popover-open\b/g;function V(){let e="function"==typeof globalThis.CSSLayerBlockRule;return`\n${e?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${e?"}":""}\n`}var j=null;function X(e){let t=V();if(null===j)try{(j=new CSSStyleSheet).replaceSync(t)}catch{j=!1}if(!1===j){let n=document.createElement("style");n.textContent=t,e instanceof Document?e.head.prepend(n):e.prepend(n)}else e.adoptedStyleSheets=[j,...e.adoptedStyleSheets]}const Y=Math.min,G=Math.max,J=Math.round,K=Math.floor,Q=e=>({x:e,y:e}),U={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(e,t,n){return G(e,Y(t,n))}function ee(e,t){return"function"==typeof e?e(t):e}function te(e){return e.split("-")[0]}function ne(e){return e.split("-")[1]}function oe(e){return"x"===e?"y":"x"}function re(e){return"y"===e?"height":"width"}function ie(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function le(e){return oe(ie(e))}function ae(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const se=["left","right"],ce=["right","left"],ue=["top","bottom"],fe=["bottom","top"];function pe(e,t,n,o){const r=ne(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?ce:se:t?se:ce;case"left":case"right":return t?ue:fe;default:return[]}}(te(e),"start"===n,o);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(ae)))),i}function de(e){const t=te(e);return U[t]+e.slice(t.length)}function he(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function me(e,t,n){let{reference:o,floating:r}=e;const i=ie(t),l=le(t),a=re(l),s=te(t),c="y"===i,u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let d;switch(s){case"top":d={x:u,y:o.y-r.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-r.width,y:f};break;default:d={x:o.x,y:o.y}}switch(ne(t)){case"start":d[l]-=p*(n&&c?-1:1);break;case"end":d[l]+=p*(n&&c?-1:1)}return d}async function ge(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=ee(t,e),h=function(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}(d),m=a[p?"floating"===f?"reference":"floating":f],g=he(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),w="floating"===f?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=he(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:s}):w);return{top:(g.top-b.top+h.top)/v.y,bottom:(b.bottom-g.bottom+h.bottom)/v.y,left:(g.left-b.left+h.left)/v.x,right:(b.right-g.right+h.right)/v.x}}const we=new Set(["left","top"]);function ye(){return"undefined"!=typeof window}function ve(e){return Ee(e)?(e.nodeName||"").toLowerCase():"#document"}function be(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function xe(e){var t;return null==(t=(Ee(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Ee(e){return!!ye()&&(e instanceof Node||e instanceof be(e).Node)}function Se(e){return!!ye()&&(e instanceof Element||e instanceof be(e).Element)}function Te(e){return!!ye()&&(e instanceof HTMLElement||e instanceof be(e).HTMLElement)}function Le(e){return!(!ye()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof be(e).ShadowRoot)}function Ae(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Fe(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&"inline"!==r&&"contents"!==r}function Re(e){return/^(table|td|th)$/.test(ve(e))}function Me(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const He=/transform|translate|scale|rotate|perspective|filter/,De=/paint|layout|strict|content/,Ce=e=>!!e&&"none"!==e;let ke;function Oe(e){const t=Se(e)?Fe(e):e;return Ce(t.transform)||Ce(t.translate)||Ce(t.scale)||Ce(t.rotate)||Ce(t.perspective)||!Pe()&&(Ce(t.backdropFilter)||Ce(t.filter))||He.test(t.willChange||"")||De.test(t.contain||"")}function Pe(){return null==ke&&(ke="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ke}function We(e){return/^(html|body|#document)$/.test(ve(e))}function Fe(e){return be(e).getComputedStyle(e)}function Ne(e){return Se(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if("html"===ve(e))return e;const t=e.assignedSlot||e.parentNode||Le(e)&&e.host||xe(e);return Le(t)?t.host:t}function $e(e){const t=ze(e);return We(t)?e.ownerDocument?e.ownerDocument.body:e.body:Te(t)&&Ae(t)?t:$e(t)}function Be(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=$e(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),l=be(r);if(i){const e=_e(l);return t.concat(l,l.visualViewport||[],Ae(r)?r:[],e&&n?Be(e):[])}return t.concat(r,Be(r,[],n))}function _e(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function qe(e){const t=Fe(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Te(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,a=J(n)!==i||J(o)!==l;return a&&(n=i,o=l),{width:n,height:o,$:a}}function Ie(e){return Se(e)?e:e.contextElement}function Ve(e){const t=Ie(e);if(!Te(t))return Q(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=qe(t);let l=(i?J(n.width):n.width)/o,a=(i?J(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const je=Q(0);function Xe(e){const t=be(e);return Pe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:je}function Ye(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Ie(e);let l=Q(1);t&&(o?Se(o)&&(l=Ve(o)):l=Ve(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==be(e))&&t}(i,n,o)?Xe(i):Q(0);let s=(r.left+a.x)/l.x,c=(r.top+a.y)/l.y,u=r.width/l.x,f=r.height/l.y;if(i){const e=be(i),t=o&&Se(o)?be(o):o;let n=e,r=_e(n);for(;r&&o&&t!==n;){const e=Ve(r),t=r.getBoundingClientRect(),o=Fe(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,l=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,f*=e.y,s+=i,c+=l,n=be(r),r=_e(n)}}return he({width:u,height:f,x:s,y:c})}function Ge(e,t){const n=Ne(e).scrollLeft;return t?t.left+n:Ye(xe(e)).left+n}function Je(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Ge(e,n),y:n.top+t.scrollTop}}function Ke(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=be(e),o=xe(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,s=0;if(r){i=r.width,l=r.height;const e=Pe();(!e||e&&"fixed"===t)&&(a=r.offsetLeft,s=r.offsetTop)}const c=Ge(o);if(c<=0){const e=o.ownerDocument,t=e.body,n=getComputedStyle(t),r="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-t.clientWidth-r);l<=25&&(i-=l)}else c<=25&&(i+=c);return{width:i,height:l,x:a,y:s}}(e,n);else if("document"===t)o=function(e){const t=xe(e),n=Ne(e),o=e.ownerDocument.body,r=G(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=G(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Ge(e);const a=-n.scrollTop;return"rtl"===Fe(o).direction&&(l+=G(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}(xe(e));else if(Se(t))o=function(e,t){const n=Ye(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Te(e)?Ve(e):Q(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Xe(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return he(o)}function Qe(e,t){const n=ze(e);return!(n===t||!Se(n)||We(n))&&("fixed"===Fe(n).position||Qe(n,t))}function Ue(e,t,n){const o=Te(t),r=xe(t),i="fixed"===n,l=Ye(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=Q(0);function c(){s.x=Ge(r)}if(o||!o&&!i)if(("body"!==ve(t)||Ae(r))&&(a=Ne(t)),o){const e=Ye(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else r&&c();i&&!o&&r&&c();const u=!r||o||i?Q(0):Je(r,a);return{x:l.left+a.scrollLeft-s.x-u.x,y:l.top+a.scrollTop-s.y-u.y,width:l.width,height:l.height}}function Ze(e){return"static"===Fe(e).position}function et(e,t){if(!Te(e)||"fixed"===Fe(e).position)return null;if(t)return t(e);let n=e.offsetParent;return xe(e)===n&&(n=n.ownerDocument.body),n}function tt(e,t){const n=be(e);if(Me(e))return n;if(!Te(e)){let t=ze(e);for(;t&&!We(t);){if(Se(t)&&!Ze(t))return t;t=ze(t)}return n}let o=et(e,t);for(;o&&Re(o)&&Ze(o);)o=et(o,t);return o&&We(o)&&Ze(o)&&!Oe(o)?n:o||function(e){let t=ze(e);for(;Te(t)&&!We(t);){if(Oe(t))return t;if(Me(t))return null;t=ze(t)}return null}(e)||n}const nt={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,l=xe(o),a=!!t&&Me(t.floating);if(o===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=Q(1);const u=Q(0),f=Te(o);if((f||!f&&!i)&&(("body"!==ve(o)||Ae(l))&&(s=Ne(o)),f)){const e=Ye(o);c=Ve(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const p=!l||f||i?Q(0):Je(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-s.scrollTop*c.y+u.y+p.y}},getDocumentElement:xe,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?Me(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=Be(e,[],!1).filter(e=>Se(e)&&"body"!==ve(e)),r=null;const i="fixed"===Fe(e).position;let l=i?ze(e):e;for(;Se(l)&&!We(l);){const t=Fe(l),n=Oe(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&("absolute"===r.position||"fixed"===r.position)||Ae(l)&&!n&&Qe(e,l))?o=o.filter(e=>e!==l):r=t,l=ze(l)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=Ke(t,i[0],r);let a=l.top,s=l.right,c=l.bottom,u=l.left;for(let e=1;e<i.length;e++){const n=Ke(t,i[e],r);a=G(n.top,a),s=Y(n.right,s),c=Y(n.bottom,c),u=G(n.left,u)}return{width:s-u,height:c-a,x:u,y:a}},getOffsetParent:tt,getElementRects:async function(e){const t=this.getOffsetParent||tt,n=this.getDimensions,o=await n(e.floating);return{reference:Ue(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=qe(e);return{width:t,height:n}},getScale:Ve,isElement:Se,isRTL:function(e){return"rtl"===Fe(e).direction}};function ot(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rt(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=Ie(e),u=r||i?[...c?Be(c):[],...t?Be(t):[]]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const f=c&&a?function(e,t){let n,o=null;const r=xe(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function l(a,s){void 0===a&&(a=!1),void 0===s&&(s=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:d}=c;if(a||t(),!p||!d)return;const h={rootMargin:-K(f)+"px "+-K(r.clientWidth-(u+p))+"px "+-K(r.clientHeight-(f+d))+"px "+-K(u)+"px",threshold:G(0,Y(1,s))||1};let m=!0;function g(t){const o=t[0].intersectionRatio;if(o!==s){if(!m)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||ot(c,e.getBoundingClientRect())||l(),m=!1}try{o=new IntersectionObserver(g,{...h,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(g,h)}o.observe(e)}(!0),i}(c,n):null;let p,d=-1,h=null;l&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let m=s?Ye(e):null;return s&&function t(){const o=Ye(e);m&&!ot(m,o)&&n();m=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const it=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:a}=t,s=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=te(n),a=ne(n),s="y"===ie(n),c=we.has(l)?-1:1,u=i&&s?-1:1,f=ee(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof h&&(d="end"===a?-1*h:h),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:l}}}}},lt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=ee(e,t),u={x:n,y:o},f=await i.detectOverflow(t,c),p=ie(te(r)),d=oe(p);let h=u[d],m=u[p];if(l){const e="y"===d?"bottom":"right";h=Z(h+f["y"===d?"top":"left"],h,h-f[e])}if(a){const e="y"===p?"bottom":"right";m=Z(m+f["y"===p?"top":"left"],m,m-f[e])}const g=s.fn({...t,[d]:h,[p]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:l,[p]:a}}}}}},at=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=ee(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const w=te(r),y=ie(a),v=te(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=p||(v||!m?[de(a)]:function(e){const t=de(e);return[ae(e),t,ae(t)]}(a)),E="none"!==h;!p&&E&&x.push(...pe(a,m,h,b));const S=[a,...x],T=await s.detectOverflow(t,g),L=[];let A=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&L.push(T[w]),f){const e=function(e,t,n){void 0===n&&(n=!1);const o=ne(e),r=le(e),i=re(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=de(l)),[l,de(l)]}(r,l,b);L.push(T[e[0]],T[e[1]])}if(A=[...A,{placement:r,overflows:L}],!L.every(e=>e<=0)){var R,M;const e=((null==(R=i.flip)?void 0:R.index)||0)+1,t=S[e];if(t){if(!("alignment"===f&&y!==ie(t))||A.every(e=>ie(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:A},reset:{placement:t}}}let n=null==(M=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(d){case"bestFit":{var H;const e=null==(H=A.filter(e=>{if(E){const t=ie(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:H[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},st=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:r,rects:i,platform:l,elements:a}=t,{apply:s=()=>{},...c}=ee(e,t),u=await l.detectOverflow(t,c),f=te(r),p=ne(r),d="y"===ie(r),{width:h,height:m}=i.floating;let g,w;"top"===f||"bottom"===f?(g=f,w=p===(await(null==l.isRTL?void 0:l.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,g="end"===p?"top":"bottom");const y=m-u.top-u.bottom,v=h-u.left-u.right,b=Y(m-u[g],y),x=Y(h-u[w],v),E=!t.middlewareData.shift;let S=b,T=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(T=v),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(S=y),E&&!p){const e=G(u.left,0),t=G(u.right,0),n=G(u.top,0),o=G(u.bottom,0);d?T=h-2*(0!==e||0!==t?e+t:G(u.left,u.right)):S=m-2*(0!==n||0!==o?n+o:G(u.top,u.bottom))}await s({...t,availableWidth:T,availableHeight:S});const L=await l.getDimensions(a.floating);return h!==L.width||m!==L.height?{reset:{rects:!0}}:{}}}},ct=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:r,rects:i,middlewareData:l}=t,{offset:a=0,mainAxis:s=!0,crossAxis:c=!0}=ee(e,t),u={x:n,y:o},f=ie(r),p=oe(f);let d=u[p],h=u[f];const m=ee(a,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(s){const e="y"===p?"height":"width",t=i.reference[p]-i.floating[e]+g.mainAxis,n=i.reference[p]+i.reference[e]-g.mainAxis;d<t?d=t:d>n&&(d=n)}if(c){var w,y;const e="y"===p?"width":"height",t=we.has(te(r)),n=i.reference[f]-i.floating[e]+(t&&(null==(w=l.offset)?void 0:w[f])||0)+(t?0:g.crossAxis),o=i.reference[f]+i.reference[e]+(t?0:(null==(y=l.offset)?void 0:y[f])||0)-(t?g.crossAxis:0);h<n?h=n:h>o&&(h=o)}return{[p]:d,[f]:h}}}},ut=(e,t,n)=>{const o=new Map,r={platform:nt,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:ge},s=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=me(c,o,s),p=o,d=0;const h={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:g,fn:w}=m,{x:y,y:v,data:b,reset:x}=await w({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=y?y:u,f=null!=v?v:f,h[g]={...h[g],...b},x&&d<50&&(d++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):x.rects),({x:u,y:f}=me(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:h}})(e,t,{...r,platform:i})};t()&&!(typeof HTMLElement<"u"&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype)&&function(){if(typeof window>"u")return;function e(e){return e?.includes(":popover-open")&&(e=e.replace(I,"$1.\\:popover-open")),e}window.ToggleEvent=window.ToggleEvent||c,q(Document.prototype,"querySelector",e),q(Document.prototype,"querySelectorAll",e),q(Element.prototype,"querySelector",e),q(Element.prototype,"querySelectorAll",e),q(Element.prototype,"matches",e),q(Element.prototype,"closest",e),q(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let e=(this.getAttribute("popover")||"").toLowerCase();return""===e||"auto"==e?"auto":"hint"==e?"hint":"manual"},set(e){null===e?this.removeAttribute("popover"):this.setAttribute("popover",e)}},showPopover:{enumerable:!0,configurable:!0,value(e={}){k(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){O(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e={}){return"boolean"==typeof e&&(e={force:e}),"showing"===w.get(this)&&void 0===e.force||!1===e.force?O(this,!0,!0):(void 0===e.force||!0===e.force)&&k(this),"showing"===w.get(this)}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=t.call(this,e);return X(n),n}}});let n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=n.call(this);return e.shadowRoot&&X(e.shadowRoot),e}}});let o=new WeakMap;function r(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(null===e)this.removeAttribute("popovertarget"),o.delete(this);else{if(!(e instanceof Element))throw TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),o.set(this,e)}},get(){if("button"!==this.localName&&"input"!==this.localName||"input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type||this.disabled||this.form&&"submit"===this.type)return null;let e=o.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return o.delete(this),null;let t=A(this),n=this.getAttribute("popovertarget");return(t instanceof Document||t instanceof _)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===e||"hide"===e?e:"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}})}r(HTMLButtonElement),r(HTMLInputElement);let i=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let o=A(n);if(!(o instanceof _||o instanceof Document))return;let r=t.find(e=>e.matches?.call(e,"[popovertargetaction],[popovertarget]"));return r?(function(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=y(t);"show"===e.popoverTargetAction&&"showing"===n||"hide"===e.popoverTargetAction&&"hidden"===n||("showing"===n?O(t,!0,!0):x(t,!1)&&(v.set(t,e),k(t)))}(r),void e.preventDefault()):void 0},l=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&("Escape"===t||"Esc"===t)&&F(n.ownerDocument,!0,!0)};(e=>{e.addEventListener("click",i),e.addEventListener("keydown",l),e.addEventListener("pointerdown",z),e.addEventListener("pointerup",z)})(document),X(document)}();const ft="data-placement",pt="data-autoplacement",dt=new Map;function ht(e){let{newState:t,oldState:r,target:i,source:l=e.detail}=e,a=i instanceof HTMLElement&&null!==n(i,"popover")&&o(i,"--_ds-floating");if(!a)return;if("closed"===t)return dt.get(i)?.();if(!l){let e=i.getRootNode(),t=`[popovertarget="${i.id}"],[commandfor="${i.id}"]`;l=i.id&&e?.querySelector?.(t)||void 0}if(!l||l===i||r&&r===t)return;i.style.scrollMarginBottom="var(--_ds-floating-arrow-size)";let s=o(i,"--_ds-floating-overscroll"),c=n(i,ft)||n(l,ft)||a,u=n(i,pt)||n(l,pt),f=parseFloat(o(i,"scroll-margin-bottom"))||0,p=c.match(/left|right/gi)?"Height":"Width",d=l[`offset${p}`]/2+f;if("none"===c)return;let h={strategy:"absolute",placement:c,middleware:[it(f),lt({padding:10,limiter:ct({offset:{mainAxis:d}})}),wt(),..."false"===u?[]:[at({padding:10,crossAxis:!1})],...s?[st({apply({availableHeight:e}){"fit"===s&&(i.style.width=`${l.offsetWidth}px`),i.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},m=rt(l,i,async()=>{if(!l?.isConnected)return dt.get(i)?.();let{x:e,y:t}=await ut(l,i,h);i.style.translate=`${e}px ${t}px`});dt.set(i,()=>dt.delete(i)&&m())}let mt;const gt=({type:e})=>{if("mousedown"===e&&(mt=!1),"scroll"===e&&!1===mt&&(mt=!0),"mouseup"===e&&mt)for(let[e]of dt)e.showPopover()};l("popover",()=>[r(document,"mousedown scroll mouseup",gt,!0),r(document,"toggle ds-toggle-source",ht,e)]);const wt=()=>({name:"arrowPseudo",fn(e){let t=e.elements.floating,o=e.rects.reference,r=`${Math.round(o.width/2+o.x-e.x)}px`,i=`${Math.round(o.height/2+o.y-e.y)}px`;return t.style.setProperty("--_ds-floating-arrow-x",r),t.style.setProperty("--_ds-floating-arrow-y",i),n(t,"data-floating",e.placement),e}});
|
|
1
|
+
const e={passive:!0,capture:!0},t=()=>typeof window<"u"&&typeof document<"u",n=(e,t,n)=>void 0===n?e.getAttribute(t)??null:(null===n?e.removeAttribute(t):e.getAttribute(t)!==n&&e.setAttribute(t,n),null),o=(e,t)=>getComputedStyle(e).getPropertyValue(t).trim(),r=(e,...t)=>{let[n,...o]=t;for(let t of n.split(" "))e.addEventListener(t,...o);return()=>i(e,...t)},i=(e,...t)=>{let[n,...o]=t;for(let t of n.split(" "))e.removeEventListener(t,...o)},l=(e,n)=>{t()&&(window._dsHotReloadCleanup||(window._dsHotReloadCleanup=new Map),window._dsHotReloadCleanup?.get(e)?.map(e=>e()),window._dsHotReloadCleanup?.set(e,n()))};let a;const s=()=>{"complete"===document.readyState&&(a||(a=((e,t)=>{let o=document.createElement(e);if(t)for(let[e,r]of Object.entries(t))n(o,e,r);return o})("div",{"aria-live":"assertive"}),a.style.overflow="hidden",a.style.position="fixed",a.style.whiteSpace="nowrap",a.style.width="1px"),a.isConnected||document.body.appendChild(a))};l("announce",()=>[r(document,"focus mouseover",s,e)]);var c=class extends Event{oldState;newState;constructor(e,{oldState:t="",newState:n="",...o}={}){super(e,o),this.oldState=String(t||""),this.newState=String(n||"")}},u=new WeakMap;function f(e,t,n){u.set(e,setTimeout(()=>{u.has(e)&&e.dispatchEvent(new c("toggle",{cancelable:!1,oldState:t,newState:n}))},0))}var p=globalThis.ShadowRoot||function(){},d=globalThis.HTMLDialogElement||function(){},h=new WeakMap,m=new WeakMap,g=new WeakMap,w=new WeakMap;function y(e){return w.get(e)||"hidden"}var v=new WeakMap;function b(e){return[...e].pop()}function x(e,t){return!("auto"!==e.popover&&"manual"!==e.popover&&"hint"!==e.popover||!e.isConnected||t&&"showing"!==y(e)||!t&&"hidden"!==y(e)||e instanceof d&&e.hasAttribute("open")||document.fullscreenElement===e)}function E(e){if(!e)return 0;let t=m.get(document)||new Set,n=g.get(document)||new Set;return n.has(e)?[...n].indexOf(e)+t.size+1:t.has(e)?[...t].indexOf(e)+1:0}function S(e){let t=R(e),n=function(e){for(;e;){let t=e.popoverTargetElement;if(t instanceof HTMLElement)return t;if((e=e.parentElement||A(e))instanceof p&&(e=e.host),e instanceof Document)return}}(e);return E(t)>E(n)?t:n}function T(e){let t,n=g.get(e)||new Set,o=m.get(e)||new Set,r=n.size>0?n:o.size>0?o:null;return r?(t=b(r),t.isConnected?t:(r.delete(t),T(e))):null}function L(e){for(let t of e||[]){if(t.isConnected)return t;e.delete(t)}return null}function A(e){return"function"==typeof e.getRootNode?e.getRootNode():e.parentNode?A(e.parentNode):e}function R(e){for(;e;){if(e instanceof HTMLElement&&"auto"===e.popover&&"showing"===w.get(e))return e;if((e=e instanceof Element&&e.assignedSlot||e.parentElement||A(e))instanceof p&&(e=e.host),e instanceof Document)return}}function M(e,t){let n=new Map,o=0;for(let e of t||[])n.set(e,o),o+=1;n.set(e,o),o+=1;let r=null;return function(t){if(!t)return;let o=!1,i=null,l=null;for(;!o;){if(i=R(t)||null,null===i||!n.has(i))return;("hint"===e.popover||"auto"===i.popover)&&(o=!0),o||(t=i.parentElement)}l=n.get(i),(null===r||n.get(r)<l)&&(r=i)}(e.parentElement||A(e)),r}function H(e){return!(e.hidden||e instanceof p||(e instanceof HTMLButtonElement||e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLOptGroupElement||e instanceof HTMLOptionElement||e instanceof HTMLFieldSetElement)&&e.disabled||e instanceof HTMLInputElement&&"hidden"===e.type||e instanceof HTMLAnchorElement&&""===e.href)&&("number"==typeof e.tabIndex&&-1!==e.tabIndex)}function C(e){var t;null==(t=function(e){if(e.shadowRoot&&!0!==e.shadowRoot.delegatesFocus)return null;let t=e;t.shadowRoot&&(t=t.shadowRoot);let n=t.querySelector("[autofocus]");if(n)return n;{let e=t.querySelectorAll("slot");for(let t of e){let e=t.assignedElements({flatten:!0});for(let t of e){if(t.hasAttribute("autofocus"))return t;if(n=t.querySelector("[autofocus]"),n)return n}}}let o=e.ownerDocument.createTreeWalker(t,NodeFilter.SHOW_ELEMENT),r=o.currentNode;for(;r;){if(H(r))return r;r=o.nextNode()}}(e))||t.focus()}var D=new WeakMap;function k(e){if(!x(e,!1))return;let t=e.ownerDocument;if(!e.dispatchEvent(new c("beforetoggle",{cancelable:!0,oldState:"closed",newState:"open"}))||!x(e,!1))return;let n=!1,o=e.popover,r=null,i=M(e,m.get(t)||new Set),l=M(e,g.get(t)||new Set);if("auto"===o&&(P(g.get(t)||new Set,n,!0),F(i||t,n,!0),r="auto"),"hint"===o&&(l?(F(l,n,!0),r="hint"):(P(g.get(t)||new Set,n,!0),i?(F(i,n,!0),r="auto"):r="hint")),"auto"===o||"hint"===o){if(o!==e.popover||!x(e,!1))return;T(t)||(n=!0),"auto"===r?(m.has(t)||m.set(t,new Set),m.get(t).add(e)):"hint"===r&&(g.has(t)||g.set(t,new Set),g.get(t).add(e))}D.delete(e);let a=t.activeElement;e.classList.add(":popover-open"),w.set(e,"showing"),h.has(t)||h.set(t,new Set),h.get(t).add(e),B(v.get(e),!0),C(e),n&&a&&"auto"===e.popover&&D.set(e,a),f(e,"closed","open")}function O(e,t=!1,n=!1){var o,r;if(!x(e,!0))return;let i=e.ownerDocument;if(["auto","hint"].includes(e.popover)&&(F(e,t,n),!x(e,!0)))return;let l=m.get(i)||new Set,a=l.has(e)&&b(l)===e;if(B(v.get(e),!1),v.delete(e),n&&(e.dispatchEvent(new c("beforetoggle",{oldState:"open",newState:"closed"})),a&&b(l)!==e&&F(e,t,n),!x(e,!0)))return;null==(o=h.get(i))||o.delete(e),l.delete(e),null==(r=g.get(i))||r.delete(e),e.classList.remove(":popover-open"),w.set(e,"hidden"),n&&f(e,"open","closed");let s=D.get(e);s&&(D.delete(e),t&&s.focus())}function P(e,t=!1,n=!1){let o=L(e);for(;o;)O(o,t,n),o=L(e)}function W(e,t,n,o){let r=!1,i=!1;for(;r||!i;){i=!0;let l=null,a=!1;for(let n of t)if(n===e)a=!0;else if(a){l=n;break}if(!l)return;for(;"showing"===y(l)&&t.size;)O(b(t),n,o);t.has(e)&&b(t)!==e&&(r=!0),r&&(o=!1)}}function F(e,t,n){let o=e.ownerDocument||e;if(e instanceof Document)return function(e,t=!1,n=!1){let o=T(e);for(;o;)O(o,t,n),o=T(e)}(o,t,n);g.get(o)?.has(e)?W(e,g.get(o),t,n):(P(g.get(o)||new Set,t,n),m.get(o)?.has(e)&&W(e,m.get(o),t,n))}var z=new WeakMap;function N(e){if(!e.isTrusted)return;let t=e.composedPath()[0];if(!t)return;let n=t.ownerDocument;if(!T(n))return;let o=S(t);if(o&&"pointerdown"===e.type)z.set(n,o);else if("pointerup"===e.type){let e=z.get(n)===o;z.delete(n),e&&F(o||n,!1,!0)}}var $=new WeakMap;function B(e,t=!1){if(!e)return;$.has(e)||$.set(e,e.getAttribute("aria-expanded"));let n=e.popoverTargetElement;if(n instanceof HTMLElement&&"auto"===n.popover)e.setAttribute("aria-expanded",String(t));else{let t=$.get(e);t?e.setAttribute("aria-expanded",t):e.removeAttribute("aria-expanded")}}var V=globalThis.ShadowRoot||function(){};function _(e,t,n){let o=e[t];Object.defineProperty(e,t,{value(e){return o.call(this,n(e))}})}var q=/(^|[^\\]):popover-open\b/g;function I(){let e="function"==typeof globalThis.CSSLayerBlockRule;return`\n${e?"@layer popover-polyfill {":""}\n :where([popover]) {\n position: fixed;\n z-index: 2147483647;\n inset: 0;\n padding: 0.25em;\n width: fit-content;\n height: fit-content;\n border-width: initial;\n border-color: initial;\n border-image: initial;\n border-style: solid;\n background-color: canvas;\n color: canvastext;\n overflow: auto;\n margin: auto;\n }\n\n :where([popover]:not(.\\:popover-open)) {\n display: none;\n }\n\n :where(dialog[popover].\\:popover-open) {\n display: block;\n }\n\n :where(dialog[popover][open]) {\n display: revert;\n }\n\n :where([anchor].\\:popover-open) {\n inset: auto;\n }\n\n :where([anchor]:popover-open) {\n inset: auto;\n }\n\n @supports not (background-color: canvas) {\n :where([popover]) {\n background-color: white;\n color: black;\n }\n }\n\n @supports (width: -moz-fit-content) {\n :where([popover]) {\n width: -moz-fit-content;\n height: -moz-fit-content;\n }\n }\n\n @supports not (inset: 0) {\n :where([popover]) {\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n }\n }\n${e?"}":""}\n`}var j=null;function G(e){let t=I();if(null===j)try{(j=new CSSStyleSheet).replaceSync(t)}catch{j=!1}if(!1===j){let n=document.createElement("style");n.textContent=t,e instanceof Document?e.head.prepend(n):e.prepend(n)}else e.adoptedStyleSheets=[j,...e.adoptedStyleSheets]}const X=Math.min,Y=Math.max,J=Math.round,K=Math.floor,Q=e=>({x:e,y:e}),U={left:"right",right:"left",bottom:"top",top:"bottom"};function Z(e,t){return"function"==typeof e?e(t):e}function ee(e){return e.split("-")[0]}function te(e){return e.split("-")[1]}function ne(e){return"x"===e?"y":"x"}function oe(e){return"y"===e?"height":"width"}function re(e){const t=e[0];return"t"===t||"b"===t?"y":"x"}function ie(e){return ne(re(e))}function le(e){return e.includes("start")?e.replace("start","end"):e.replace("end","start")}const ae=["left","right"],se=["right","left"],ce=["top","bottom"],ue=["bottom","top"];function fe(e,t,n,o){const r=te(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?se:ae:t?ae:se;case"left":case"right":return t?ce:ue;default:return[]}}(ee(e),"start"===n,o);return r&&(i=i.map(e=>e+"-"+r),t&&(i=i.concat(i.map(le)))),i}function pe(e){const t=ee(e);return U[t]+e.slice(t.length)}function de(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function he(e,t,n){let{reference:o,floating:r}=e;const i=re(t),l=ie(t),a=oe(l),s=ee(t),c="y"===i,u=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,p=o[a]/2-r[a]/2;let d;switch(s){case"top":d={x:u,y:o.y-r.height};break;case"bottom":d={x:u,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:f};break;case"left":d={x:o.x-r.width,y:f};break;default:d={x:o.x,y:o.y}}const h=te(t);return h&&(d[l]+=p*("end"===h?1:-1)*(n&&c?-1:1)),d}async function me(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:a,strategy:s}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:f="floating",altBoundary:p=!1,padding:d=0}=Z(t,e),h=function(e){return"number"!=typeof e?function(e){var t,n,o,r;return{top:null!=(t=e.top)?t:0,right:null!=(n=e.right)?n:0,bottom:null!=(o=e.bottom)?o:0,left:null!=(r=e.left)?r:0}}(e):{top:e,right:e,bottom:e,left:e}}(d),m=a[p?"floating"===f?"reference":"floating":f],g=de(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:s})),w="floating"===f?{x:o,y:r,width:l.floating.width,height:l.floating.height}:l.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),v=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=de(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:w,offsetParent:y,strategy:s}):w);return{top:(g.top-b.top+h.top)/v.y,bottom:(b.bottom-g.bottom+h.bottom)/v.y,left:(g.left-b.left+h.left)/v.x,right:(b.right-g.right+h.right)/v.x}}const ge=new Set(["left","top"]);function we(){return"undefined"!=typeof window}function ye(e){return xe(e)?(e.nodeName||"").toLowerCase():"#document"}function ve(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function be(e){var t;return null==(t=(xe(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function xe(e){return!!we()&&(e instanceof Node||e instanceof ve(e).Node)}function Ee(e){return!!we()&&(e instanceof Element||e instanceof ve(e).Element)}function Se(e){return!!we()&&(e instanceof HTMLElement||e instanceof ve(e).HTMLElement)}function Te(e){return!(!we()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof ve(e).ShadowRoot)}function Le(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=We(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&"inline"!==r&&"contents"!==r}function Ae(e){return/^(table|td|th)$/.test(ye(e))}function Re(e){try{if(e.matches(":popover-open"))return!0}catch(e){}try{return e.matches(":modal")}catch(e){return!1}}const Me=/transform|translate|scale|rotate|perspective|filter/,He=/paint|layout|strict|content/,Ce=e=>!!e&&"none"!==e;let De;function ke(e){const t=Ee(e)?We(e):e;return Ce(t.transform)||Ce(t.translate)||Ce(t.scale)||Ce(t.rotate)||Ce(t.perspective)||!Oe()&&(Ce(t.backdropFilter)||Ce(t.filter))||Me.test(t.willChange||"")||He.test(t.contain||"")}function Oe(){return null==De&&(De="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),De}function Pe(e){return/^(html|body|#document)$/.test(ye(e))}function We(e){return ve(e).getComputedStyle(e)}function Fe(e){return Ee(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ze(e){if("html"===ye(e))return e;const t=e.assignedSlot||e.parentNode||Te(e)&&e.host||be(e);return Te(t)?t.host:t}function Ne(e){const t=ze(e);return Pe(t)?(e.ownerDocument||e).body:Se(t)&&Le(t)?t:Ne(t)}function $e(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const r=Ne(e),i=r===(null==(o=e.ownerDocument)?void 0:o.body),l=ve(r);if(i){const e=Be(l);return t.concat(l,l.visualViewport||[],Le(r)?r:[],e&&n?$e(e):[])}return t.concat(r,$e(r,[],n))}function Be(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Ve(e){const t=We(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Se(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,a=J(n)!==i||J(o)!==l;return a&&(n=i,o=l),{width:n,height:o,$:a}}function _e(e){return Ee(e)?e:e.contextElement}function qe(e){const t=_e(e);if(!Se(t))return Q(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=Ve(t);let l=(i?J(n.width):n.width)/o,a=(i?J(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const Ie=Q(0);function je(e){const t=ve(e);return Oe()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ie}function Ge(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=_e(e);let l=Q(1);t&&(o?Ee(o)&&(l=qe(o)):l=qe(e));const a=function(e,t,n){return void 0===t&&(t=!1),!!n&&t&&n===ve(e)}(i,n,o)?je(i):Q(0);let s=(r.left+a.x)/l.x,c=(r.top+a.y)/l.y,u=r.width/l.x,f=r.height/l.y;if(i&&o){const e=ve(i),t=Ee(o)?ve(o):o;let n=e,r=Be(n);for(;r&&t!==n;){const e=qe(r),t=r.getBoundingClientRect(),o=We(r),i=t.left+(r.clientLeft+parseFloat(o.paddingLeft))*e.x,l=t.top+(r.clientTop+parseFloat(o.paddingTop))*e.y;s*=e.x,c*=e.y,u*=e.x,f*=e.y,s+=i,c+=l,n=ve(r),r=Be(n)}}return de({width:u,height:f,x:s,y:c})}function Xe(e,t){const n=Fe(e).scrollLeft;return t?t.left+n:Ge(be(e)).left+n}function Ye(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Xe(e,n),y:n.top+t.scrollTop}}function Je(e,t,n){let o;if("viewport"===t||"layoutViewport"===t)o=function(e,t,n){void 0===n&&(n="viewport");const o="layoutViewport"===n,r=ve(e),i=be(e),l=r.visualViewport;let a=i.clientWidth,s=i.clientHeight,c=0,u=0;if(l){const e=!Oe()||"fixed"===t;o?e||(c=-l.offsetLeft,u=-l.offsetTop):(a=l.width,s=l.height,e&&(c=l.offsetLeft,u=l.offsetTop))}if(Xe(i)<=0){const e=i.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,r=Math.abs(i.clientWidth-t.clientWidth-o),l="stable both-edges"===getComputedStyle(i).scrollbarGutter?r/2:r;l<=25&&(a-=l)}return{width:a,height:s,x:c,y:u}}(e,n,t);else if("document"===t)o=function(e){const t=Fe(e),n=e.ownerDocument.body,o=Y(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),r=Y(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight);let i=-t.scrollLeft+Xe(e);const l=-t.scrollTop;return"rtl"===We(n).direction&&(i+=Y(e.clientWidth,n.clientWidth)-o),{width:o,height:r,x:i,y:l}}(be(e));else if(Ee(t))o=function(e,t){const n=Ge(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=qe(e);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=je(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return de(o)}function Ke(e,t,n){const o=Se(t),r=be(t),i="fixed"===n,l=Ge(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const s=Q(0);if((o||!i)&&(("body"!==ye(t)||Le(r))&&(a=Fe(t)),o)){const e=Ge(t,!0,i,t);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}!o&&r&&(s.x=Xe(r));const c=!r||o||i?Q(0):Ye(r,a);return{x:l.left+a.scrollLeft-s.x-c.x,y:l.top+a.scrollTop-s.y-c.y,width:l.width,height:l.height}}function Qe(e){return"static"===We(e).position}function Ue(e,t){if(!Se(e)||"fixed"===We(e).position)return null;if(t)return t(e);let n=e.offsetParent;return be(e)===n&&(n=n.ownerDocument.body),n}function Ze(e,t){const n=ve(e);if(Re(e))return n;if(!Se(e)){let t=ze(e);for(;t&&!Pe(t);){if(Ee(t)&&!Qe(t))return t;t=ze(t)}return n}let o=Ue(e,t);for(;o&&Ae(o)&&Qe(o);)o=Ue(o,t);return o&&Pe(o)&&Qe(o)&&!ke(o)?n:o||function(e){let t=ze(e);for(;Se(t)&&!Pe(t);){if(ke(t))return t;if(Re(t))return null;t=ze(t)}return null}(e)||n}const et={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i="fixed"===r,l=be(o),a=!!t&&Re(t.floating);if(o===l||a&&i)return n;let s={scrollLeft:0,scrollTop:0},c=Q(1);const u=Q(0),f=Se(o);if((f||!i)&&(("body"!==ye(o)||Le(l))&&(s=Fe(o)),f)){const e=Ge(o);c=qe(o),u.x=e.x+o.clientLeft,u.y=e.y+o.clientTop}const p=!l||f||i?Q(0):Ye(l,s);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-s.scrollLeft*c.x+u.x+p.x,y:n.y*c.y-s.scrollTop*c.y+u.y+p.y}},getDocumentElement:be,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?Re(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=$e(e,[],!1).filter(e=>Ee(e)&&"body"!==ye(e)),r=null;const i="fixed"===We(e).position;let l=i?ze(e):e;for(;Ee(l)&&!Pe(l);){const e=We(l),t=ke(l),n=r?r.position:i?"fixed":"";t||"fixed"!==n&&("absolute"!==n||"static"!==e.position)?r=e:o=o.filter(e=>e!==l),l=ze(l)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=Je(t,i[0],r);let a=l.top,s=l.right,c=l.bottom,u=l.left;for(let e=1;e<i.length;e++){const n=Je(t,i[e],r);a=Y(n.top,a),s=X(n.right,s),c=X(n.bottom,c),u=Y(n.left,u)}return{width:s-u,height:c-a,x:u,y:a}},getOffsetParent:Ze,getElementRects:async function(e){const t=this.getOffsetParent||Ze,n=this.getDimensions,o=await n(e.floating);return{reference:Ke(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(e){return e.getClientRects?Array.from(e.getClientRects()):[]},getDimensions:function(e){const{width:t,height:n}=Ve(e);return{width:t,height:n}},getScale:qe,isElement:Ee,isRTL:function(e){return"rtl"===We(e).direction}};function tt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function nt(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:s=!1}=o,c=_e(e),u=r||i?[...c?$e(c):[],...t?$e(t):[]]:[];u.forEach(e=>{r&&e.addEventListener("scroll",n),i&&e.addEventListener("resize",n)});const f=c&&a?function(e,t,n){let o,r=null;const i=be(e);function l(){var e;clearTimeout(o),null==(e=r)||e.disconnect(),r=null}function a(n,s){void 0===n&&(n=!1),void 0===s&&(s=1),l();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:d}=c;if(n||t(),!p||!d)return;const h={rootMargin:-K(f)+"px "+-K(i.clientWidth-(u+p))+"px "+-K(i.clientHeight-(f+d))+"px "+-K(u)+"px",threshold:Y(0,X(1,s))||1};let m=!0;function g(t){const n=t[0].intersectionRatio;if(!tt(c,e.getBoundingClientRect()))return a();if(n!==s){if(!m)return a();n?a(!1,n):o=setTimeout(()=>{a(!1,1e-7)},1e3)}m=!1}try{r=new IntersectionObserver(g,{...h,root:i.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}const s=ve(e),c=()=>a(n);return s.addEventListener("resize",c),a(!0),()=>{s.removeEventListener("resize",c),l()}}(c,n,i):null;let p,d=-1,h=null;l&&(h=new ResizeObserver(e=>{let[o]=e;o&&o.target===c&&h&&t&&(h.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!s&&h.observe(c),t&&h.observe(t));let m=s?Ge(e):null;return s&&function t(){const o=Ge(e);m&&!tt(m,o)&&n();m=o,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,s&&cancelAnimationFrame(p)}}const ot=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:l,middlewareData:a}=t,s=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=ee(n),a=te(n),s="y"===re(n),c=ge.has(l)?-1:1,u=i&&s?-1:1,f=Z(t,e);let{mainAxis:p,crossAxis:d,alignmentAxis:h}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof h&&(d="end"===a?-1*h:h),s?{x:d*u,y:p*c}:{x:p*c,y:d*u}}(t,e);return l===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:l}}}}},rt=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r,platform:i}=t,{mainAxis:l=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...c}=Z(e,t),u={x:n,y:o},f=await i.detectOverflow(t,c),p=re(r),d=ne(p);let h=u[d],m=u[p];const g=(e,t)=>{return n=t+f["y"===e?"top":"left"],o=t,r=t-f["y"===e?"bottom":"right"],Y(n,X(o,r));var n,o,r};l&&(h=g(d,h)),a&&(m=g(p,m));const w=s.fn({...t,[d]:h,[p]:m});return{...w,data:{x:w.x-n,y:w.y-o,enabled:{[d]:l,[p]:a}}}}}},it=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:l,initialPlacement:a,platform:s,elements:c}=t,{mainAxis:u=!0,crossAxis:f=!0,fallbackPlacements:p,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Z(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const w=ee(r),y=re(a),v=ee(a)===a,b=await(null==s.isRTL?void 0:s.isRTL(c.floating)),x=p||(v||!m?[pe(a)]:function(e){const t=pe(e);return[le(e),t,le(t)]}(a)),E="none"!==h;!p&&E&&x.push(...fe(a,m,h,b));const S=[a,...x],T=await s.detectOverflow(t,g),L=[];let A=(null==(o=i.flip)?void 0:o.overflows)||[];if(u&&L.push(T[w]),f){const e=function(e,t,n){void 0===n&&(n=!1);const o=te(e),r=ie(e),i=oe(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=pe(l)),[l,pe(l)]}(r,l,b);L.push(T[e[0]],T[e[1]])}if(A=[...A,{placement:r,overflows:L}],!L.every(e=>e<=0)){var R,M;const e=((null==(R=i.flip)?void 0:R.index)||0)+1,t=S[e];if(t){if(!("alignment"===f&&y!==re(t))||A.every(e=>re(e.placement)!==y||e.overflows[0]>0))return{data:{index:e,overflows:A},reset:{placement:t}}}let n=null==(M=A.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(d){case"bestFit":{var H;const e=null==(H=A.filter(e=>{if(E){const t=re(e.placement);return t===y||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:H[0];e&&(n=e);break}case"initialPlacement":n=a}if(r!==n)return{reset:{placement:n}}}return{}}}},lt=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:o,platform:r,elements:i}=t,{apply:l=()=>{},...a}=Z(e,t),s=await r.detectOverflow(t,a),c=ee(n),u=te(n),f="y"===re(n),{width:p,height:d}=o.floating;let h,m;"top"===c||"bottom"===c?(h=c,m=u===(await(null==r.isRTL?void 0:r.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,h="end"===u?"top":"bottom");const g=d-s.top-s.bottom,w=p-s.left-s.right,y=X(d-s[h],g),v=X(p-s[m],w),b=t.middlewareData.shift,x=!b;let E=y,S=v;null!=b&&b.enabled.x&&(S=w),null!=b&&b.enabled.y&&(E=g),x&&!u&&(f?S=p-2*Y(s.left,s.right):E=d-2*Y(s.top,s.bottom)),await l({...t,availableWidth:S,availableHeight:E});const T=await r.getDimensions(i.floating);return p!==T.width||d!==T.height?{reset:{rects:!0}}:{}}}},at=function(e){return void 0===e&&(e={}),{options:e,fn(t){var n,o;const{x:r,y:i,placement:l,rects:a,middlewareData:s}=t,{offset:c=0,mainAxis:u=!0,crossAxis:f=!0}=Z(e,t),p={x:r,y:i},d=re(l),h=ne(d);let m=p[h],g=p[d];const w=Z(c,t),y="number"==typeof w?{mainAxis:w,crossAxis:0}:{mainAxis:null!=(n=w.mainAxis)?n:0,crossAxis:null!=(o=w.crossAxis)?o:0};if(u){const e="y"===h?"height":"width",t=a.reference[h]-a.floating[e]+y.mainAxis,n=a.reference[h]+a.reference[e]-y.mainAxis;m<t?m=t:m>n&&(m=n)}if(f){var v,b;const e="y"===h?"width":"height",t=ge.has(ee(l)),n=a.reference[d]-a.floating[e]+(t&&(null==(v=s.offset)?void 0:v[d])||0)+(t?0:y.crossAxis),o=a.reference[d]+a.reference[e]+(t?0:(null==(b=s.offset)?void 0:b[d])||0)-(t?y.crossAxis:0);g<n?g=n:g>o&&(g=o)}return{[h]:m,[d]:g}}}},st=(e,t,n)=>{const o=new Map,r=null!=n?n:{},i={...et,...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,a=l.detectOverflow?l:{...l,detectOverflow:me},s=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:f}=he(c,o,s),p=o,d=0;const h={};for(let n=0;n<i.length;n++){const m=i[n];if(!m)continue;const{name:g,fn:w}=m,{x:y,y:v,data:b,reset:x}=await w({x:u,y:f,initialPlacement:o,placement:p,strategy:r,middlewareData:h,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=y?y:u,f=null!=v?v:f,h[g]={...h[g],...b},x&&d<50&&(d++,"object"==typeof x&&(x.placement&&(p=x.placement),x.rects&&(c=!0===x.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):x.rects),({x:u,y:f}=he(c,p,s))),n=-1)}return{x:u,y:f,placement:p,strategy:r,middlewareData:h}})(e,t,{...r,platform:i})};t()&&!(typeof HTMLElement<"u"&&"object"==typeof HTMLElement.prototype&&"popover"in HTMLElement.prototype)&&function(){if(typeof window>"u")return;function e(e){return e?.includes(":popover-open")&&(e=e.replace(q,"$1.\\:popover-open")),e}window.ToggleEvent=window.ToggleEvent||c,_(Document.prototype,"querySelector",e),_(Document.prototype,"querySelectorAll",e),_(Element.prototype,"querySelector",e),_(Element.prototype,"querySelectorAll",e),_(Element.prototype,"matches",e),_(Element.prototype,"closest",e),_(DocumentFragment.prototype,"querySelectorAll",e),Object.defineProperties(HTMLElement.prototype,{popover:{enumerable:!0,configurable:!0,get(){if(!this.hasAttribute("popover"))return null;let e=(this.getAttribute("popover")||"").toLowerCase();return""===e||"auto"==e?"auto":"hint"==e?"hint":"manual"},set(e){null===e?this.removeAttribute("popover"):this.setAttribute("popover",e)}},showPopover:{enumerable:!0,configurable:!0,value(e={}){k(this)}},hidePopover:{enumerable:!0,configurable:!0,value(){O(this,!0,!0)}},togglePopover:{enumerable:!0,configurable:!0,value(e={}){return"boolean"==typeof e&&(e={force:e}),"showing"===w.get(this)&&void 0===e.force||!1===e.force?O(this,!0,!0):(void 0===e.force||!0===e.force)&&k(this),"showing"===w.get(this)}}});let t=Element.prototype.attachShadow;t&&Object.defineProperties(Element.prototype,{attachShadow:{enumerable:!0,configurable:!0,writable:!0,value(e){let n=t.call(this,e);return G(n),n}}});let n=HTMLElement.prototype.attachInternals;n&&Object.defineProperties(HTMLElement.prototype,{attachInternals:{enumerable:!0,configurable:!0,writable:!0,value(){let e=n.call(this);return e.shadowRoot&&G(e.shadowRoot),e}}});let o=new WeakMap;function r(e){Object.defineProperties(e.prototype,{popoverTargetElement:{enumerable:!0,configurable:!0,set(e){if(null===e)this.removeAttribute("popovertarget"),o.delete(this);else{if(!(e instanceof Element))throw TypeError("popoverTargetElement must be an element or null");this.setAttribute("popovertarget",""),o.set(this,e)}},get(){if("button"!==this.localName&&"input"!==this.localName||"input"===this.localName&&"reset"!==this.type&&"image"!==this.type&&"button"!==this.type||this.disabled||this.form&&"submit"===this.type)return null;let e=o.get(this);if(e&&e.isConnected)return e;if(e&&!e.isConnected)return o.delete(this),null;let t=A(this),n=this.getAttribute("popovertarget");return(t instanceof Document||t instanceof V)&&n&&t.getElementById(n)||null}},popoverTargetAction:{enumerable:!0,configurable:!0,get(){let e=(this.getAttribute("popovertargetaction")||"").toLowerCase();return"show"===e||"hide"===e?e:"toggle"},set(e){this.setAttribute("popovertargetaction",e)}}})}r(HTMLButtonElement),r(HTMLInputElement);let i=e=>{if(e.defaultPrevented)return;let t=e.composedPath(),n=t[0];if(!(n instanceof Element)||n?.shadowRoot)return;let o=A(n);if(!(o instanceof V||o instanceof Document))return;let r=t.find(e=>e.matches?.call(e,"[popovertargetaction],[popovertarget]"));return r?(function(e){let t=e.popoverTargetElement;if(!(t instanceof HTMLElement))return;let n=y(t);"show"===e.popoverTargetAction&&"showing"===n||"hide"===e.popoverTargetAction&&"hidden"===n||("showing"===n?O(t,!0,!0):x(t,!1)&&(v.set(t,e),k(t)))}(r),void e.preventDefault()):void 0},l=e=>{let t=e.key,n=e.target;!e.defaultPrevented&&n&&("Escape"===t||"Esc"===t)&&F(n.ownerDocument,!0,!0)};(e=>{e.addEventListener("click",i),e.addEventListener("keydown",l),e.addEventListener("pointerdown",N),e.addEventListener("pointerup",N)})(document),G(document)}();const ct="data-placement",ut="data-autoplacement",ft=new Map;function pt(e){let{newState:t,oldState:r,target:i,source:l=e.detail}=e,a=i instanceof HTMLElement&&null!==n(i,"popover")&&o(i,"--_ds-floating");if(!a)return;if("closed"===t)return ft.get(i)?.();if(!l){let e=i.getRootNode(),t=`[popovertarget="${i.id}"],[commandfor="${i.id}"]`;l=i.id&&e?.querySelector?.(t)||void 0}if(!l||l===i||r&&r===t)return;i.style.scrollMarginBottom="var(--_ds-floating-arrow-size)";let s=o(i,"--_ds-floating-overscroll"),c=n(i,ct)||n(l,ct)||a,u=n(i,ut)||n(l,ut),f=parseFloat(o(i,"scroll-margin-bottom"))||0,p=c.match(/left|right/gi)?"Height":"Width",d=l[`offset${p}`]/2+f;if("none"===c)return;let h={strategy:"absolute",placement:c,middleware:[ot(f),rt({padding:10,limiter:at({offset:{mainAxis:d}})}),mt(),..."false"===u?[]:[it({padding:10,crossAxis:!1})],...s?[lt({apply({availableHeight:e}){"fit"===s&&(i.style.width=`${l.offsetWidth}px`),i.style.maxHeight=`${Math.max(50,e-20)}px`}})]:[]]},m=nt(l,i,async()=>{if(!l?.isConnected)return ft.get(i)?.();let{x:e,y:t}=await st(l,i,h);i.style.translate=`${e}px ${t}px`});ft.set(i,()=>ft.delete(i)&&m())}let dt;const ht=({type:e})=>{if("mousedown"===e&&(dt=!1),"scroll"===e&&!1===dt&&(dt=!0),"mouseup"===e&&dt)for(let[e]of ft)e.showPopover()};l("popover",()=>[r(document,"mousedown scroll mouseup",ht,!0),r(document,"toggle ds-toggle-source",pt,e)]);const mt=()=>({name:"arrowPseudo",fn(e){let t=e.elements.floating,o=e.rects.reference,r=`${Math.round(o.width/2+o.x-e.x)}px`,i=`${Math.round(o.height/2+o.y-e.y)}px`;return t.style.setProperty("--_ds-floating-arrow-x",r),t.style.setProperty("--_ds-floating-arrow-y",i),n(t,"data-floating",e.placement),e}});
|