@m3e/web 2.1.3 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/README.md +5 -2
  2. package/dist/all.js +2916 -391
  3. package/dist/all.js.map +1 -1
  4. package/dist/all.min.js +77 -41
  5. package/dist/all.min.js.map +1 -1
  6. package/dist/app-bar.js +14 -7
  7. package/dist/app-bar.js.map +1 -1
  8. package/dist/app-bar.min.js +1 -1
  9. package/dist/app-bar.min.js.map +1 -1
  10. package/dist/autocomplete.js +59 -23
  11. package/dist/autocomplete.js.map +1 -1
  12. package/dist/autocomplete.min.js +1 -1
  13. package/dist/autocomplete.min.js.map +1 -1
  14. package/dist/bottom-sheet.js +8 -27
  15. package/dist/bottom-sheet.js.map +1 -1
  16. package/dist/bottom-sheet.min.js +1 -1
  17. package/dist/bottom-sheet.min.js.map +1 -1
  18. package/dist/calendar.js +1082 -0
  19. package/dist/calendar.js.map +1 -0
  20. package/dist/calendar.min.js +43 -0
  21. package/dist/calendar.min.js.map +1 -0
  22. package/dist/chips.js +2 -6
  23. package/dist/chips.js.map +1 -1
  24. package/dist/chips.min.js +1 -1
  25. package/dist/chips.min.js.map +1 -1
  26. package/dist/core-a11y.js +23 -9
  27. package/dist/core-a11y.js.map +1 -1
  28. package/dist/core-a11y.min.js +4 -4
  29. package/dist/core-a11y.min.js.map +1 -1
  30. package/dist/core-anchoring.js +135 -15
  31. package/dist/core-anchoring.js.map +1 -1
  32. package/dist/core-anchoring.min.js +1 -1
  33. package/dist/core-anchoring.min.js.map +1 -1
  34. package/dist/core.js +101 -1
  35. package/dist/core.js.map +1 -1
  36. package/dist/core.min.js +1 -1
  37. package/dist/core.min.js.map +1 -1
  38. package/dist/css-custom-data.json +1146 -646
  39. package/dist/custom-elements.json +31433 -26898
  40. package/dist/datepicker.js +573 -0
  41. package/dist/datepicker.js.map +1 -0
  42. package/dist/datepicker.min.js +7 -0
  43. package/dist/datepicker.min.js.map +1 -0
  44. package/dist/drawer-container.js +10 -4
  45. package/dist/drawer-container.js.map +1 -1
  46. package/dist/drawer-container.min.js +1 -1
  47. package/dist/drawer-container.min.js.map +1 -1
  48. package/dist/fab-menu.js +1 -1
  49. package/dist/fab-menu.js.map +1 -1
  50. package/dist/fab-menu.min.js +1 -1
  51. package/dist/fab-menu.min.js.map +1 -1
  52. package/dist/form-field.js +2 -6
  53. package/dist/form-field.js.map +1 -1
  54. package/dist/form-field.min.js +3 -3
  55. package/dist/form-field.min.js.map +1 -1
  56. package/dist/html-custom-data.json +553 -187
  57. package/dist/menu.js +3 -7
  58. package/dist/menu.js.map +1 -1
  59. package/dist/menu.min.js +1 -1
  60. package/dist/menu.min.js.map +1 -1
  61. package/dist/nav-bar.js +17 -7
  62. package/dist/nav-bar.js.map +1 -1
  63. package/dist/nav-bar.min.js +1 -1
  64. package/dist/nav-bar.min.js.map +1 -1
  65. package/dist/nav-menu.js +3 -11
  66. package/dist/nav-menu.js.map +1 -1
  67. package/dist/nav-menu.min.js +1 -1
  68. package/dist/nav-menu.min.js.map +1 -1
  69. package/dist/nav-rail.js +2 -6
  70. package/dist/nav-rail.js.map +1 -1
  71. package/dist/nav-rail.min.js +1 -1
  72. package/dist/nav-rail.min.js.map +1 -1
  73. package/dist/option.js +4 -8
  74. package/dist/option.js.map +1 -1
  75. package/dist/option.min.js +1 -1
  76. package/dist/option.min.js.map +1 -1
  77. package/dist/paginator.js.map +1 -1
  78. package/dist/paginator.min.js.map +1 -1
  79. package/dist/search.js +821 -0
  80. package/dist/search.js.map +1 -0
  81. package/dist/search.min.js +7 -0
  82. package/dist/search.min.js.map +1 -0
  83. package/dist/segmented-button.js +2 -2
  84. package/dist/segmented-button.js.map +1 -1
  85. package/dist/segmented-button.min.js.map +1 -1
  86. package/dist/select.js +4 -15
  87. package/dist/select.js.map +1 -1
  88. package/dist/select.min.js +1 -1
  89. package/dist/select.min.js.map +1 -1
  90. package/dist/snackbar.js +2 -6
  91. package/dist/snackbar.js.map +1 -1
  92. package/dist/snackbar.min.js +1 -1
  93. package/dist/snackbar.min.js.map +1 -1
  94. package/dist/split-button.js +1 -1
  95. package/dist/split-button.js.map +1 -1
  96. package/dist/split-button.min.js.map +1 -1
  97. package/dist/src/all.d.ts +3 -0
  98. package/dist/src/all.d.ts.map +1 -1
  99. package/dist/src/app-bar/AppBarElement.d.ts +6 -4
  100. package/dist/src/app-bar/AppBarElement.d.ts.map +1 -1
  101. package/dist/src/autocomplete/AutocompleteElement.d.ts +7 -2
  102. package/dist/src/autocomplete/AutocompleteElement.d.ts.map +1 -1
  103. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts +12 -0
  104. package/dist/src/autocomplete/AutocompleteQueryEventDetail.d.ts.map +1 -0
  105. package/dist/src/autocomplete/QueryEventDetail.d.ts +3 -8
  106. package/dist/src/autocomplete/QueryEventDetail.d.ts.map +1 -1
  107. package/dist/src/autocomplete/index.d.ts +1 -0
  108. package/dist/src/autocomplete/index.d.ts.map +1 -1
  109. package/dist/src/bottom-sheet/BottomSheetElement.d.ts.map +1 -1
  110. package/dist/src/calendar/CalendarElement.d.ts +213 -0
  111. package/dist/src/calendar/CalendarElement.d.ts.map +1 -0
  112. package/dist/src/calendar/CalendarView.d.ts +3 -0
  113. package/dist/src/calendar/CalendarView.d.ts.map +1 -0
  114. package/dist/src/calendar/CalendarViewElementBase.d.ts +28 -0
  115. package/dist/src/calendar/CalendarViewElementBase.d.ts.map +1 -0
  116. package/dist/src/calendar/MonthViewElement.d.ts +36 -0
  117. package/dist/src/calendar/MonthViewElement.d.ts.map +1 -0
  118. package/dist/src/calendar/MultiYearViewElement.d.ts +27 -0
  119. package/dist/src/calendar/MultiYearViewElement.d.ts.map +1 -0
  120. package/dist/src/calendar/YearViewElement.d.ts +27 -0
  121. package/dist/src/calendar/YearViewElement.d.ts.map +1 -0
  122. package/dist/src/calendar/index.d.ts +7 -0
  123. package/dist/src/calendar/index.d.ts.map +1 -0
  124. package/dist/src/calendar/utils.d.ts +24 -0
  125. package/dist/src/calendar/utils.d.ts.map +1 -0
  126. package/dist/src/chips/InputChipSetElement.d.ts.map +1 -1
  127. package/dist/src/core/a11y/FocusTrapElement.d.ts.map +1 -1
  128. package/dist/src/core/a11y/InteractivityChecker.d.ts.map +1 -1
  129. package/dist/src/core/anchoring/AnchorOptions.d.ts +1 -1
  130. package/dist/src/core/anchoring/AnchorOptions.d.ts.map +1 -1
  131. package/dist/src/core/anchoring/FloatingPanelElement.d.ts +18 -3
  132. package/dist/src/core/anchoring/FloatingPanelElement.d.ts.map +1 -1
  133. package/dist/src/core/anchoring/positionAnchor.d.ts.map +1 -1
  134. package/dist/src/core/shared/controllers/InertController.d.ts +19 -0
  135. package/dist/src/core/shared/controllers/InertController.d.ts.map +1 -0
  136. package/dist/src/core/shared/controllers/index.d.ts +1 -0
  137. package/dist/src/core/shared/controllers/index.d.ts.map +1 -1
  138. package/dist/src/core/shared/converters/dateConverter.d.ts +4 -0
  139. package/dist/src/core/shared/converters/dateConverter.d.ts.map +1 -0
  140. package/dist/src/core/shared/converters/index.d.ts +1 -0
  141. package/dist/src/core/shared/converters/index.d.ts.map +1 -1
  142. package/dist/src/core/shared/utils/index.d.ts +1 -0
  143. package/dist/src/core/shared/utils/index.d.ts.map +1 -1
  144. package/dist/src/core/shared/utils/registerStyleSheet.d.ts +7 -0
  145. package/dist/src/core/shared/utils/registerStyleSheet.d.ts.map +1 -0
  146. package/dist/src/datepicker/DatepickerElement.d.ts +239 -0
  147. package/dist/src/datepicker/DatepickerElement.d.ts.map +1 -0
  148. package/dist/src/datepicker/DatepickerToggleElement.d.ts +21 -0
  149. package/dist/src/datepicker/DatepickerToggleElement.d.ts.map +1 -0
  150. package/dist/src/datepicker/DatepickerVariant.d.ts +3 -0
  151. package/dist/src/datepicker/DatepickerVariant.d.ts.map +1 -0
  152. package/dist/src/datepicker/index.d.ts +4 -0
  153. package/dist/src/datepicker/index.d.ts.map +1 -0
  154. package/dist/src/drawer-container/DrawerContainerElement.d.ts +2 -2
  155. package/dist/src/drawer-container/DrawerContainerElement.d.ts.map +1 -1
  156. package/dist/src/form-field/FormFieldElement.d.ts.map +1 -1
  157. package/dist/src/menu/MenuElement.d.ts.map +1 -1
  158. package/dist/src/nav-bar/NavBarElement.d.ts +3 -1
  159. package/dist/src/nav-bar/NavBarElement.d.ts.map +1 -1
  160. package/dist/src/nav-menu/NavMenuElement.d.ts.map +1 -1
  161. package/dist/src/nav-menu/NavMenuItemElement.d.ts.map +1 -1
  162. package/dist/src/nav-rail/NavRailElement.d.ts.map +1 -1
  163. package/dist/src/option/OptionPanelElement.d.ts.map +1 -1
  164. package/dist/src/paginator/PageEventDetail.d.ts +6 -11
  165. package/dist/src/paginator/PageEventDetail.d.ts.map +1 -1
  166. package/dist/src/paginator/PaginatorElement.d.ts +2 -2
  167. package/dist/src/paginator/PaginatorElement.d.ts.map +1 -1
  168. package/dist/src/paginator/PaginatorPageEventDetail.d.ts +12 -0
  169. package/dist/src/paginator/PaginatorPageEventDetail.d.ts.map +1 -0
  170. package/dist/src/paginator/index.d.ts +1 -0
  171. package/dist/src/paginator/index.d.ts.map +1 -1
  172. package/dist/src/search/SearchBarElement.d.ts +92 -0
  173. package/dist/src/search/SearchBarElement.d.ts.map +1 -0
  174. package/dist/src/search/SearchViewElement.d.ts +150 -0
  175. package/dist/src/search/SearchViewElement.d.ts.map +1 -0
  176. package/dist/src/search/SearchViewMode.d.ts +3 -0
  177. package/dist/src/search/SearchViewMode.d.ts.map +1 -0
  178. package/dist/src/search/SearchViewQueryEventDetail.d.ts +12 -0
  179. package/dist/src/search/SearchViewQueryEventDetail.d.ts.map +1 -0
  180. package/dist/src/search/index.d.ts +5 -0
  181. package/dist/src/search/index.d.ts.map +1 -0
  182. package/dist/src/search/styles/SearchBarStyle.d.ts +12 -0
  183. package/dist/src/search/styles/SearchBarStyle.d.ts.map +1 -0
  184. package/dist/src/search/styles/SearchBarToken.d.ts +27 -0
  185. package/dist/src/search/styles/SearchBarToken.d.ts.map +1 -0
  186. package/dist/src/search/styles/SearchViewStyle.d.ts +12 -0
  187. package/dist/src/search/styles/SearchViewStyle.d.ts.map +1 -0
  188. package/dist/src/search/styles/SearchViewToken.d.ts +26 -0
  189. package/dist/src/search/styles/SearchViewToken.d.ts.map +1 -0
  190. package/dist/src/search/styles/index.d.ts +3 -0
  191. package/dist/src/search/styles/index.d.ts.map +1 -0
  192. package/dist/src/segmented-button/ButtonSegmentElement.d.ts +2 -2
  193. package/dist/src/select/SelectElement.d.ts.map +1 -1
  194. package/dist/src/snackbar/SnackbarElement.d.ts.map +1 -1
  195. package/dist/src/split-button/SplitButtonElement.d.ts +1 -1
  196. package/dist/src/stepper/StepperElement.d.ts +3 -1
  197. package/dist/src/stepper/StepperElement.d.ts.map +1 -1
  198. package/dist/src/switch/SwitchElement.d.ts +2 -2
  199. package/dist/stepper.js +18 -12
  200. package/dist/stepper.js.map +1 -1
  201. package/dist/stepper.min.js +1 -1
  202. package/dist/stepper.min.js.map +1 -1
  203. package/dist/switch.js +2 -2
  204. package/dist/switch.js.map +1 -1
  205. package/dist/switch.min.js.map +1 -1
  206. package/dist/tooltip.js +1 -1
  207. package/dist/tooltip.js.map +1 -1
  208. package/dist/tooltip.min.js +1 -1
  209. package/dist/tooltip.min.js.map +1 -1
  210. package/package.json +16 -1
@@ -3,5 +3,5 @@
3
3
  * Copyright (c) 2025 matraic
4
4
  * See LICENSE file in the project root for full license text.
5
5
  */
6
- import{__classPrivateFieldGet as t,__classPrivateFieldSet as e,__decorate as n}from"tslib";import{LitElement as o,html as i,unsafeCSS as r,css as l}from"lit";import{property as s}from"lit/decorators.js";import{SuppressInitialAnimation as a,AttachInternals as c,ScrollController as f,DesignToken as u,customElement as h,setCustomState as d}from"@m3e/web/core";import{M3eDirectionality as p}from"@m3e/web/core/bidi";const m=Math.min,g=Math.max,y=Math.round,w=Math.floor,x=t=>({x:t,y:t}),v={left:"right",right:"left",bottom:"top",top:"bottom"};function b(t,e,n){return g(t,m(e,n))}function R(t,e){return"function"==typeof t?t(e):t}function k(t){return t.split("-")[0]}function L(t){return t.split("-")[1]}function E(t){return"x"===t?"y":"x"}function S(t){return"y"===t?"height":"width"}function T(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function C(t){return E(T(t))}function A(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const O=["left","right"],W=["right","left"],P=["top","bottom"],D=["bottom","top"];function $(t,e,n,o){const i=L(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?W:O:e?O:W;case"left":case"right":return e?P:D;default:return[]}}(k(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(A)))),r}function M(t){const e=k(t);return v[e]+t.slice(e.length)}function F(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function B(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function N(t,e,n){let{reference:o,floating:i}=t;const r=T(e),l=C(e),s=S(l),a=k(e),c="y"===r,f=o.x+o.width/2-i.width/2,u=o.y+o.height/2-i.height/2,h=o[s]/2-i[s]/2;let d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:u};break;case"left":d={x:o.x-i.width,y:u};break;default:d={x:o.x,y:o.y}}switch(L(e)){case"start":d[l]-=h*(n&&c?-1:1);break;case"end":d[l]+=h*(n&&c?-1:1)}return d}async function H(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:l,elements:s,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:u="floating",altBoundary:h=!1,padding:d=0}=R(e,t),p=F(d),m=s[h?"floating"===u?"reference":"floating":u],g=B(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(s.floating)),boundary:c,rootBoundary:f,strategy:a})),y="floating"===u?{x:o,y:i,width:l.floating.width,height:l.floating.height}:l.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s.floating)),x=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=B(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-v.top+p.top)/x.y,bottom:(v.bottom-g.bottom+p.bottom)/x.y,left:(g.left-v.left+p.left)/x.x,right:(v.right-g.right+p.right)/x.x}}function V(t){const e=m(...t.map(t=>t.left)),n=m(...t.map(t=>t.top));return{x:e,y:n,width:g(...t.map(t=>t.right))-e,height:g(...t.map(t=>t.bottom))-n}}const z=new Set(["left","top"]);function Y(){return"undefined"!=typeof window}function j(t){return X(t)?(t.nodeName||"").toLowerCase():"#document"}function I(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function q(t){var e;return null==(e=(X(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function X(t){return!!Y()&&(t instanceof Node||t instanceof I(t).Node)}function _(t){return!!Y()&&(t instanceof Element||t instanceof I(t).Element)}function G(t){return!!Y()&&(t instanceof HTMLElement||t instanceof I(t).HTMLElement)}function J(t){return!(!Y()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof I(t).ShadowRoot)}function K(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=lt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function Q(t){return/^(table|td|th)$/.test(j(t))}function U(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const Z=/transform|translate|scale|rotate|perspective|filter/,tt=/paint|layout|strict|content/,et=t=>!!t&&"none"!==t;let nt;function ot(t){const e=_(t)?lt(t):t;return et(e.transform)||et(e.translate)||et(e.scale)||et(e.rotate)||et(e.perspective)||!it()&&(et(e.backdropFilter)||et(e.filter))||Z.test(e.willChange||"")||tt.test(e.contain||"")}function it(){return null==nt&&(nt="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),nt}function rt(t){return/^(html|body|#document)$/.test(j(t))}function lt(t){return I(t).getComputedStyle(t)}function st(t){return _(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function at(t){if("html"===j(t))return t;const e=t.assignedSlot||t.parentNode||J(t)&&t.host||q(t);return J(e)?e.host:e}function ct(t){const e=at(t);return rt(e)?t.ownerDocument?t.ownerDocument.body:t.body:G(e)&&K(e)?e:ct(e)}function ft(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=ct(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),l=I(i);if(r){const t=ut(l);return e.concat(l,l.visualViewport||[],K(i)?i:[],t&&n?ft(t):[])}return e.concat(i,ft(i,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function ht(t){const e=lt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=G(t),r=i?t.offsetWidth:n,l=i?t.offsetHeight:o,s=y(n)!==r||y(o)!==l;return s&&(n=r,o=l),{width:n,height:o,$:s}}function dt(t){return _(t)?t:t.contextElement}function pt(t){const e=dt(t);if(!G(e))return x(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=ht(e);let l=(r?y(n.width):n.width)/o,s=(r?y(n.height):n.height)/i;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const mt=x(0);function gt(t){const e=I(t);return it()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:mt}function yt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=dt(t);let l=x(1);e&&(o?_(o)&&(l=pt(o)):l=pt(t));const s=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==I(t))&&e}(r,n,o)?gt(r):x(0);let a=(i.left+s.x)/l.x,c=(i.top+s.y)/l.y,f=i.width/l.x,u=i.height/l.y;if(r){const t=I(r),e=o&&_(o)?I(o):o;let n=t,i=ut(n);for(;i&&o&&e!==n;){const t=pt(i),e=i.getBoundingClientRect(),o=lt(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,l=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,u*=t.y,a+=r,c+=l,n=I(i),i=ut(n)}}return B({width:f,height:u,x:a,y:c})}function wt(t,e){const n=st(t).scrollLeft;return e?e.left+n:yt(q(t)).left+n}function xt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-wt(t,n),y:n.top+e.scrollTop}}function vt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=I(t),o=q(t),i=n.visualViewport;let r=o.clientWidth,l=o.clientHeight,s=0,a=0;if(i){r=i.width,l=i.height;const t=it();(!t||t&&"fixed"===e)&&(s=i.offsetLeft,a=i.offsetTop)}const c=wt(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,l=Math.abs(o.clientWidth-e.clientWidth-i);l<=25&&(r-=l)}else c<=25&&(r+=c);return{width:r,height:l,x:s,y:a}}(t,n);else if("document"===e)o=function(t){const e=q(t),n=st(t),o=t.ownerDocument.body,i=g(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=g(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+wt(t);const s=-n.scrollTop;return"rtl"===lt(o).direction&&(l+=g(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:l,y:s}}(q(t));else if(_(e))o=function(t,e){const n=yt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=G(t)?pt(t):x(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=gt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return B(o)}function bt(t,e){const n=at(t);return!(n===e||!_(n)||rt(n))&&("fixed"===lt(n).position||bt(n,e))}function Rt(t,e,n){const o=G(e),i=q(e),r="fixed"===n,l=yt(t,!0,r,e);let s={scrollLeft:0,scrollTop:0};const a=x(0);function c(){a.x=wt(i)}if(o||!o&&!r)if(("body"!==j(e)||K(i))&&(s=st(e)),o){const t=yt(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const f=!i||o||r?x(0):xt(i,s);return{x:l.left+s.scrollLeft-a.x-f.x,y:l.top+s.scrollTop-a.y-f.y,width:l.width,height:l.height}}function kt(t){return"static"===lt(t).position}function Lt(t,e){if(!G(t)||"fixed"===lt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return q(t)===n&&(n=n.ownerDocument.body),n}function Et(t,e){const n=I(t);if(U(t))return n;if(!G(t)){let e=at(t);for(;e&&!rt(e);){if(_(e)&&!kt(e))return e;e=at(e)}return n}let o=Lt(t,e);for(;o&&Q(o)&&kt(o);)o=Lt(o,e);return o&&rt(o)&&kt(o)&&!ot(o)?n:o||function(t){let e=at(t);for(;G(e)&&!rt(e);){if(ot(e))return e;if(U(e))return null;e=at(e)}return null}(t)||n}const St={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,l=q(o),s=!!e&&U(e.floating);if(o===l||s&&r)return n;let a={scrollLeft:0,scrollTop:0},c=x(1);const f=x(0),u=G(o);if((u||!u&&!r)&&(("body"!==j(o)||K(l))&&(a=st(o)),u)){const t=yt(o);c=pt(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const h=!l||u||r?x(0):xt(l,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+h.x,y:n.y*c.y-a.scrollTop*c.y+f.y+h.y}},getDocumentElement:q,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?U(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=ft(t,[],!1).filter(t=>_(t)&&"body"!==j(t)),i=null;const r="fixed"===lt(t).position;let l=r?at(t):t;for(;_(l)&&!rt(l);){const e=lt(l),n=ot(l);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||K(l)&&!n&&bt(t,l))?o=o.filter(t=>t!==l):i=e,l=at(l)}return e.set(t,o),o}(e,this._c):[].concat(n),o],l=vt(e,r[0],i);let s=l.top,a=l.right,c=l.bottom,f=l.left;for(let t=1;t<r.length;t++){const n=vt(e,r[t],i);s=g(n.top,s),a=m(n.right,a),c=m(n.bottom,c),f=g(n.left,f)}return{width:a-f,height:c-s,x:f,y:s}},getOffsetParent:Et,getElementRects:async function(t){const e=this.getOffsetParent||Et,n=this.getDimensions,o=await n(t.floating);return{reference:Rt(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=ht(t);return{width:e,height:n}},getScale:pt,isElement:_,isRTL:function(t){return"rtl"===lt(t).direction}};function Tt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Ct(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,c=dt(t),f=i||r?[...c?ft(c):[],...e?ft(e):[]]:[];f.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const u=c&&s?function(t,e){let n,o=null;const i=q(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function l(s,a){void 0===s&&(s=!1),void 0===a&&(a=1),r();const c=t.getBoundingClientRect(),{left:f,top:u,width:h,height:d}=c;if(s||e(),!h||!d)return;const p={rootMargin:-w(u)+"px "+-w(i.clientWidth-(f+h))+"px "+-w(i.clientHeight-(u+d))+"px "+-w(f)+"px",threshold:g(0,m(1,a))||1};let y=!0;function x(e){const o=e[0].intersectionRatio;if(o!==a){if(!y)return l();o?l(!1,o):n=setTimeout(()=>{l(!1,1e-7)},1e3)}1!==o||Tt(c,t.getBoundingClientRect())||l(),y=!1}try{o=new IntersectionObserver(x,{...p,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(x,p)}o.observe(t)}(!0),r}(c,n):null;let h,d=-1,p=null;l&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&e&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),c&&!a&&p.observe(c),e&&p.observe(e));let y=a?yt(t):null;return a&&function e(){const o=yt(t);y&&!Tt(y,o)&&n();y=o,h=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==u||u(),null==(t=p)||t.disconnect(),p=null,a&&cancelAnimationFrame(h)}}const At=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:l,middlewareData:s}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),l=k(n),s=L(n),a="y"===T(n),c=z.has(l)?-1:1,f=r&&a?-1:1,u=R(e,t);let{mainAxis:h,crossAxis:d,alignmentAxis:p}="number"==typeof u?{mainAxis:u,crossAxis:0,alignmentAxis:null}:{mainAxis:u.mainAxis||0,crossAxis:u.crossAxis||0,alignmentAxis:u.alignmentAxis};return s&&"number"==typeof p&&(d="end"===s?-1*p:p),a?{x:d*f,y:h*c}:{x:h*c,y:d*f}}(e,t);return l===(null==(n=s.offset)?void 0:n.placement)&&null!=(o=s.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:l}}}}},Ot=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:l=!0,crossAxis:s=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=R(t,e),f={x:n,y:o},u=await r.detectOverflow(e,c),h=T(k(i)),d=E(h);let p=f[d],m=f[h];if(l){const t="y"===d?"bottom":"right";p=b(p+u["y"===d?"top":"left"],p,p-u[t])}if(s){const t="y"===h?"bottom":"right";m=b(m+u["y"===h?"top":"left"],m,m-u[t])}const g=a.fn({...e,[d]:p,[h]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:l,[h]:s}}}}}},Wt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:l,initialPlacement:s,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:u=!0,fallbackPlacements:h,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=R(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=k(i),w=T(s),x=k(s)===s,v=await(null==a.isRTL?void 0:a.isRTL(c.floating)),b=h||(x||!m?[M(s)]:function(t){const e=M(t);return[A(t),e,A(e)]}(s)),E="none"!==p;!h&&E&&b.push(...$(s,m,p,v));const O=[s,...b],W=await a.detectOverflow(e,g),P=[];let D=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&P.push(W[y]),u){const t=function(t,e,n){void 0===n&&(n=!1);const o=L(t),i=C(t),r=S(i);let l="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(l=M(l)),[l,M(l)]}(i,l,v);P.push(W[t[0]],W[t[1]])}if(D=[...D,{placement:i,overflows:P}],!P.every(t=>t<=0)){var F,B;const t=((null==(F=r.flip)?void 0:F.index)||0)+1,e=O[t];if(e){if(!("alignment"===u&&w!==T(e))||D.every(t=>T(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:D},reset:{placement:e}}}let n=null==(B=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:B.placement;if(!n)switch(d){case"bestFit":{var N;const t=null==(N=D.filter(t=>{if(E){const e=T(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:N[0];t&&(n=t);break}case"initialPlacement":n=s}if(i!==n)return{reset:{placement:n}}}return{}}}},Pt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:l}=e,{padding:s=2,x:a,y:c}=R(t,e),f=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),u=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>B(V(t)))}(f),h=B(V(f)),d=F(s);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===u.length&&u[0].left>u[1].right&&null!=a&&null!=c)return u.find(t=>a>t.left-d.left&&a<t.right+d.right&&c>t.top-d.top&&c<t.bottom+d.bottom)||h;if(u.length>=2){if("y"===T(n)){const t=u[0],e=u[u.length-1],o="top"===k(n),i=t.top,r=e.bottom,l=o?t.left:e.left,s=o?t.right:e.right;return{top:i,bottom:r,left:l,right:s,width:s-l,height:r-i,x:l,y:i}}const t="left"===k(n),e=g(...u.map(t=>t.right)),o=m(...u.map(t=>t.left)),i=u.filter(n=>t?n.left===o:n.right===e),r=i[0].top,l=i[i.length-1].bottom;return{top:r,bottom:l,left:o,right:e,width:e-o,height:l-r,x:o,y:r}}return h}},floating:o.floating,strategy:l});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},Dt=(t,e,n)=>{const o=new Map,i={platform:St,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:l}=n,s=l.detectOverflow?l:{...l,detectOverflow:H},a=await(null==l.isRTL?void 0:l.isRTL(e));let c=await l.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:u}=N(c,o,a),h=o,d=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:g,fn:y}=m,{x:w,y:x,data:v,reset:b}=await y({x:f,y:u,initialPlacement:o,placement:h,strategy:i,middlewareData:p,rects:c,platform:s,elements:{reference:t,floating:e}});f=null!=w?w:f,u=null!=x?x:u,p[g]={...p[g],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(h=b.placement),b.rects&&(c=!0===b.rects?await l.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:u}=N(c,h,a))),n=-1)}return{x:f,y:u,placement:h,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})};function $t(t){return function(t){for(let e=t;e;e=Mt(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Mt(t);e;e=Mt(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||ot(t))return e;if("BODY"===e.tagName)return e}}return null}(t)}function Mt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}async function Ft(t,e,n,o){async function i(){const i=new Array;n?.inline&&i.push(Pt()),n.flip&&i.push(!0===n.flip?Wt():Wt({fallbackPlacements:n.flip})),n.shift&&i.push(Ot()),n.offset&&!isNaN(n.offset)&&i.push(At(n.offset));const r=await Dt(e,t,{placement:n.position,middleware:i,platform:{...St,getOffsetParent:t=>St.getOffsetParent(t,$t)}});o(r.x,r.y,r.placement)}return await i(),Ct(e,t,async()=>await i())}var Bt,Nt,Ht,Vt,zt,Yt,jt,It;let qt=class extends(a(c(o))){constructor(){super(...arguments),Bt.add(this),Nt.set(this,void 0),Ht.set(this,void 0),Vt.set(this,void 0),zt.set(this,e=>t(this,Bt,"m",It).call(this,e)),Yt.set(this,n=>{"closed"===n.newState&&(t(this,Vt,"f")?.call(this),e(this,Vt,void 0,"f"))}),jt.set(this,new f(this,{target:null,callback:()=>this.hide(!1)})),this.scrollStrategy="hide"}get isOpen(){return void 0!==t(this,Nt,"f")}get trigger(){return t(this,Nt,"f")??null}connectedCallback(){super.connectedCallback(),this.setAttribute("popover","manual"),this.addEventListener("toggle",t(this,Yt,"f")),document.addEventListener("click",t(this,zt,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",t(this,Yt,"f")),document.removeEventListener("click",t(this,zt,"f"))}async show(n,o){t(this,Nt,"f")&&t(this,Nt,"f")!==n&&this.hide(),e(this,Vt,await Ft(this,o??n,{position:"bottom-start",inline:!0,flip:!0},(t,e,n)=>{d(this,"-top",n.includes("top")),d(this,"-bottom",n.includes("bottom")),"rtl"===p.current?(this.style.right=window.innerWidth-t-this.clientWidth+"px",this.style.left=""):(this.style.left=`${t}px`,this.style.right=""),this.style.top=`${e}px`}),"f"),this.showPopover(),e(this,Nt,n,"f"),t(this,Nt,"f").ariaExpanded="true",e(this,Ht,o,"f"),"hide"===this.scrollStrategy&&t(this,jt,"f").observe(t(this,Ht,"f")??t(this,Nt,"f"))}hide(n=!1){this.hidePopover(),t(this,Nt,"f")&&(t(this,Nt,"f").ariaExpanded="false",n&&t(this,Nt,"f").focus(),t(this,jt,"f").unobserve(t(this,Ht,"f")??t(this,Nt,"f")),e(this,Nt,void 0,"f"),e(this,Ht,void 0,"f"))}async toggle(e,n){t(this,Nt,"f")?this.hide():await this.show(e,n)}render(){return i`<div class="base"><slot></slot></div>`}};Nt=new WeakMap,Ht=new WeakMap,Vt=new WeakMap,zt=new WeakMap,Yt=new WeakMap,jt=new WeakMap,Bt=new WeakSet,It=function(e){this.isOpen&&!e.composedPath().some(e=>e===this||e===t(this,Nt,"f")||e===t(this,Ht,"f"))&&this.hide()},qt.styles=l`:host { position: absolute; flex-direction: column; padding: unset; margin: unset; border: unset; overflow-y: auto; scrollbar-width: ${u.scrollbar.thinWidth}; scrollbar-color: ${u.scrollbar.color}; scroll-padding-block: calc( var(--m3e-focus-ring-thickness, 3px) + var(--m3e-floating-panel-container-padding-block, 0.25rem) ); border-radius: var(--m3e-floating-panel-container-shape, ${u.shape.corner.large}); min-width: var(--m3e-floating-panel-container-min-width, 7rem); max-width: var(--m3e-floating-panel-container-max-width, 17.5rem); max-height: var(--m3e-floating-panel-container-max-height, 17.5rem); background-color: var(--m3e-floating-panel-container-color, ${u.color.surfaceContainer}); box-shadow: var(--m3e-floating-panel-container-elevation, ${u.elevation.level3}); opacity: 0; display: none; } .base { box-sizing: border-box; display: flex; flex-direction: column; padding-block: var(--m3e-floating-panel-container-padding-block, 0.25rem); padding-inline: var(--m3e-floating-panel-container-padding-inline, 0.25rem); } :host(:not(:state(-no-animate))) { transition: ${r(`opacity ${u.motion.duration.short2} ${u.motion.easing.standard}, \n transform ${u.motion.duration.short2} ${u.motion.easing.standard},\n overlay ${u.motion.duration.short2} ${u.motion.easing.standard} allow-discrete,\n display ${u.motion.duration.short2} ${u.motion.easing.standard} allow-discrete`)}; } :host { transform: scaleY(0.8); } :host(:popover-open) { transform: scaleY(1); display: block; opacity: 1; } :host::backdrop { background-color: transparent; } :host(:state(-bottom)) { transform-origin: top; } :host(:state(-top)) { transform-origin: bottom; } @starting-style { :host(:popover-open) { transform: scaleY(0.8); } } @media (prefers-reduced-motion) { :host(:not(:state(-no-animate))) { transition: none; } } @media (forced-colors: active) { :host { background-color: Menu; color: MenuText; outline: 1px solid MenuText; } }`,n([s({attribute:"scroll-strategy"})],qt.prototype,"scrollStrategy",void 0),qt=n([h("m3e-floating-panel")],qt);export{qt as M3eFloatingPanelElement,Ft as positionAnchor};
6
+ import{__classPrivateFieldGet as t,__classPrivateFieldSet as e,__decorate as n}from"tslib";import{LitElement as o,html as i,unsafeCSS as r,css as s}from"lit";import{property as l}from"lit/decorators.js";import{SuppressInitialAnimation as a,AttachInternals as c,ScrollController as f,ResizeController as h,DesignToken as u,customElement as d,setCustomState as p}from"@m3e/web/core";import{M3eDirectionality as m}from"@m3e/web/core/bidi";const g=Math.min,y=Math.max,w=Math.round,x=Math.floor,v=t=>({x:t,y:t}),b={left:"right",right:"left",bottom:"top",top:"bottom"};function R(t,e,n){return y(t,g(e,n))}function A(t,e){return"function"==typeof t?t(e):t}function k(t){return t.split("-")[0]}function L(t){return t.split("-")[1]}function E(t){return"x"===t?"y":"x"}function S(t){return"y"===t?"height":"width"}function T(t){const e=t[0];return"t"===e||"b"===e?"y":"x"}function W(t){return E(T(t))}function C(t){return t.includes("start")?t.replace("start","end"):t.replace("end","start")}const O=["left","right"],$=["right","left"],D=["top","bottom"],P=["bottom","top"];function M(t,e,n,o){const i=L(t);let r=function(t,e,n){switch(t){case"top":case"bottom":return n?e?$:O:e?O:$;case"left":case"right":return e?D:P;default:return[]}}(k(t),"start"===n,o);return i&&(r=r.map(t=>t+"-"+i),e&&(r=r.concat(r.map(C)))),r}function F(t){const e=k(t);return b[e]+t.slice(e.length)}function B(t){return"number"!=typeof t?function(t){return{top:0,right:0,bottom:0,left:0,...t}}(t):{top:t,right:t,bottom:t,left:t}}function N(t){const{x:e,y:n,width:o,height:i}=t;return{width:o,height:i,top:n,left:e,right:e+o,bottom:n+i,x:e,y:n}}function H(t,e,n){let{reference:o,floating:i}=t;const r=T(e),s=W(e),l=S(s),a=k(e),c="y"===r,f=o.x+o.width/2-i.width/2,h=o.y+o.height/2-i.height/2,u=o[l]/2-i[l]/2;let d;switch(a){case"top":d={x:f,y:o.y-i.height};break;case"bottom":d={x:f,y:o.y+o.height};break;case"right":d={x:o.x+o.width,y:h};break;case"left":d={x:o.x-i.width,y:h};break;default:d={x:o.x,y:o.y}}switch(L(e)){case"start":d[s]-=u*(n&&c?-1:1);break;case"end":d[s]+=u*(n&&c?-1:1)}return d}async function V(t,e){var n;void 0===e&&(e={});const{x:o,y:i,platform:r,rects:s,elements:l,strategy:a}=t,{boundary:c="clippingAncestors",rootBoundary:f="viewport",elementContext:h="floating",altBoundary:u=!1,padding:d=0}=A(e,t),p=B(d),m=l[u?"floating"===h?"reference":"floating":h],g=N(await r.getClippingRect({element:null==(n=await(null==r.isElement?void 0:r.isElement(m)))||n?m:m.contextElement||await(null==r.getDocumentElement?void 0:r.getDocumentElement(l.floating)),boundary:c,rootBoundary:f,strategy:a})),y="floating"===h?{x:o,y:i,width:s.floating.width,height:s.floating.height}:s.reference,w=await(null==r.getOffsetParent?void 0:r.getOffsetParent(l.floating)),x=await(null==r.isElement?void 0:r.isElement(w))&&await(null==r.getScale?void 0:r.getScale(w))||{x:1,y:1},v=N(r.convertOffsetParentRelativeRectToViewportRelativeRect?await r.convertOffsetParentRelativeRectToViewportRelativeRect({elements:l,rect:y,offsetParent:w,strategy:a}):y);return{top:(g.top-v.top+p.top)/x.y,bottom:(v.bottom-g.bottom+p.bottom)/x.y,left:(g.left-v.left+p.left)/x.x,right:(v.right-g.right+p.right)/x.x}}function z(t){const e=g(...t.map(t=>t.left)),n=g(...t.map(t=>t.top));return{x:e,y:n,width:y(...t.map(t=>t.right))-e,height:y(...t.map(t=>t.bottom))-n}}const Y=new Set(["left","top"]);function j(){return"undefined"!=typeof window}function I(t){return _(t)?(t.nodeName||"").toLowerCase():"#document"}function q(t){var e;return(null==t||null==(e=t.ownerDocument)?void 0:e.defaultView)||window}function X(t){var e;return null==(e=(_(t)?t.ownerDocument:t.document)||window.document)?void 0:e.documentElement}function _(t){return!!j()&&(t instanceof Node||t instanceof q(t).Node)}function G(t){return!!j()&&(t instanceof Element||t instanceof q(t).Element)}function J(t){return!!j()&&(t instanceof HTMLElement||t instanceof q(t).HTMLElement)}function K(t){return!(!j()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof q(t).ShadowRoot)}function Q(t){const{overflow:e,overflowX:n,overflowY:o,display:i}=lt(t);return/auto|scroll|overlay|hidden|clip/.test(e+o+n)&&"inline"!==i&&"contents"!==i}function U(t){return/^(table|td|th)$/.test(I(t))}function Z(t){try{if(t.matches(":popover-open"))return!0}catch(t){}try{return t.matches(":modal")}catch(t){return!1}}const tt=/transform|translate|scale|rotate|perspective|filter/,et=/paint|layout|strict|content/,nt=t=>!!t&&"none"!==t;let ot;function it(t){const e=G(t)?lt(t):t;return nt(e.transform)||nt(e.translate)||nt(e.scale)||nt(e.rotate)||nt(e.perspective)||!rt()&&(nt(e.backdropFilter)||nt(e.filter))||tt.test(e.willChange||"")||et.test(e.contain||"")}function rt(){return null==ot&&(ot="undefined"!=typeof CSS&&CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")),ot}function st(t){return/^(html|body|#document)$/.test(I(t))}function lt(t){return q(t).getComputedStyle(t)}function at(t){return G(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function ct(t){if("html"===I(t))return t;const e=t.assignedSlot||t.parentNode||K(t)&&t.host||X(t);return K(e)?e.host:e}function ft(t){const e=ct(t);return st(e)?t.ownerDocument?t.ownerDocument.body:t.body:J(e)&&Q(e)?e:ft(e)}function ht(t,e,n){var o;void 0===e&&(e=[]),void 0===n&&(n=!0);const i=ft(t),r=i===(null==(o=t.ownerDocument)?void 0:o.body),s=q(i);if(r){const t=ut(s);return e.concat(s,s.visualViewport||[],Q(i)?i:[],t&&n?ht(t):[])}return e.concat(i,ht(i,[],n))}function ut(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function dt(t){const e=lt(t);let n=parseFloat(e.width)||0,o=parseFloat(e.height)||0;const i=J(t),r=i?t.offsetWidth:n,s=i?t.offsetHeight:o,l=w(n)!==r||w(o)!==s;return l&&(n=r,o=s),{width:n,height:o,$:l}}function pt(t){return G(t)?t:t.contextElement}function mt(t){const e=pt(t);if(!J(e))return v(1);const n=e.getBoundingClientRect(),{width:o,height:i,$:r}=dt(e);let s=(r?w(n.width):n.width)/o,l=(r?w(n.height):n.height)/i;return s&&Number.isFinite(s)||(s=1),l&&Number.isFinite(l)||(l=1),{x:s,y:l}}const gt=v(0);function yt(t){const e=q(t);return rt()&&e.visualViewport?{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}:gt}function wt(t,e,n,o){void 0===e&&(e=!1),void 0===n&&(n=!1);const i=t.getBoundingClientRect(),r=pt(t);let s=v(1);e&&(o?G(o)&&(s=mt(o)):s=mt(t));const l=function(t,e,n){return void 0===e&&(e=!1),!(!n||e&&n!==q(t))&&e}(r,n,o)?yt(r):v(0);let a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,f=i.width/s.x,h=i.height/s.y;if(r){const t=q(r),e=o&&G(o)?q(o):o;let n=t,i=ut(n);for(;i&&o&&e!==n;){const t=mt(i),e=i.getBoundingClientRect(),o=lt(i),r=e.left+(i.clientLeft+parseFloat(o.paddingLeft))*t.x,s=e.top+(i.clientTop+parseFloat(o.paddingTop))*t.y;a*=t.x,c*=t.y,f*=t.x,h*=t.y,a+=r,c+=s,n=q(i),i=ut(n)}}return N({width:f,height:h,x:a,y:c})}function xt(t,e){const n=at(t).scrollLeft;return e?e.left+n:wt(X(t)).left+n}function vt(t,e){const n=t.getBoundingClientRect();return{x:n.left+e.scrollLeft-xt(t,n),y:n.top+e.scrollTop}}function bt(t,e,n){let o;if("viewport"===e)o=function(t,e){const n=q(t),o=X(t),i=n.visualViewport;let r=o.clientWidth,s=o.clientHeight,l=0,a=0;if(i){r=i.width,s=i.height;const t=rt();(!t||t&&"fixed"===e)&&(l=i.offsetLeft,a=i.offsetTop)}const c=xt(o);if(c<=0){const t=o.ownerDocument,e=t.body,n=getComputedStyle(e),i="CSS1Compat"===t.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,s=Math.abs(o.clientWidth-e.clientWidth-i);s<=25&&(r-=s)}else c<=25&&(r+=c);return{width:r,height:s,x:l,y:a}}(t,n);else if("document"===e)o=function(t){const e=X(t),n=at(t),o=t.ownerDocument.body,i=y(e.scrollWidth,e.clientWidth,o.scrollWidth,o.clientWidth),r=y(e.scrollHeight,e.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+xt(t);const l=-n.scrollTop;return"rtl"===lt(o).direction&&(s+=y(e.clientWidth,o.clientWidth)-i),{width:i,height:r,x:s,y:l}}(X(t));else if(G(e))o=function(t,e){const n=wt(t,!0,"fixed"===e),o=n.top+t.clientTop,i=n.left+t.clientLeft,r=J(t)?mt(t):v(1);return{width:t.clientWidth*r.x,height:t.clientHeight*r.y,x:i*r.x,y:o*r.y}}(e,n);else{const n=yt(t);o={x:e.x-n.x,y:e.y-n.y,width:e.width,height:e.height}}return N(o)}function Rt(t,e){const n=ct(t);return!(n===e||!G(n)||st(n))&&("fixed"===lt(n).position||Rt(n,e))}function At(t,e,n){const o=J(e),i=X(e),r="fixed"===n,s=wt(t,!0,r,e);let l={scrollLeft:0,scrollTop:0};const a=v(0);function c(){a.x=xt(i)}if(o||!o&&!r)if(("body"!==I(e)||Q(i))&&(l=at(e)),o){const t=wt(e,!0,r,e);a.x=t.x+e.clientLeft,a.y=t.y+e.clientTop}else i&&c();r&&!o&&i&&c();const f=!i||o||r?v(0):vt(i,l);return{x:s.left+l.scrollLeft-a.x-f.x,y:s.top+l.scrollTop-a.y-f.y,width:s.width,height:s.height}}function kt(t){return"static"===lt(t).position}function Lt(t,e){if(!J(t)||"fixed"===lt(t).position)return null;if(e)return e(t);let n=t.offsetParent;return X(t)===n&&(n=n.ownerDocument.body),n}function Et(t,e){const n=q(t);if(Z(t))return n;if(!J(t)){let e=ct(t);for(;e&&!st(e);){if(G(e)&&!kt(e))return e;e=ct(e)}return n}let o=Lt(t,e);for(;o&&U(o)&&kt(o);)o=Lt(o,e);return o&&st(o)&&kt(o)&&!it(o)?n:o||function(t){let e=ct(t);for(;J(e)&&!st(e);){if(it(e))return e;if(Z(e))return null;e=ct(e)}return null}(t)||n}const St={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:e,rect:n,offsetParent:o,strategy:i}=t;const r="fixed"===i,s=X(o),l=!!e&&Z(e.floating);if(o===s||l&&r)return n;let a={scrollLeft:0,scrollTop:0},c=v(1);const f=v(0),h=J(o);if((h||!h&&!r)&&(("body"!==I(o)||Q(s))&&(a=at(o)),h)){const t=wt(o);c=mt(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const u=!s||h||r?v(0):vt(s,a);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-a.scrollLeft*c.x+f.x+u.x,y:n.y*c.y-a.scrollTop*c.y+f.y+u.y}},getDocumentElement:X,getClippingRect:function(t){let{element:e,boundary:n,rootBoundary:o,strategy:i}=t;const r=[..."clippingAncestors"===n?Z(e)?[]:function(t,e){const n=e.get(t);if(n)return n;let o=ht(t,[],!1).filter(t=>G(t)&&"body"!==I(t)),i=null;const r="fixed"===lt(t).position;let s=r?ct(t):t;for(;G(s)&&!st(s);){const e=lt(s),n=it(s);n||"fixed"!==e.position||(i=null),(r?!n&&!i:!n&&"static"===e.position&&i&&("absolute"===i.position||"fixed"===i.position)||Q(s)&&!n&&Rt(t,s))?o=o.filter(t=>t!==s):i=e,s=ct(s)}return e.set(t,o),o}(e,this._c):[].concat(n),o],s=bt(e,r[0],i);let l=s.top,a=s.right,c=s.bottom,f=s.left;for(let t=1;t<r.length;t++){const n=bt(e,r[t],i);l=y(n.top,l),a=g(n.right,a),c=g(n.bottom,c),f=y(n.left,f)}return{width:a-f,height:c-l,x:f,y:l}},getOffsetParent:Et,getElementRects:async function(t){const e=this.getOffsetParent||Et,n=this.getDimensions,o=await n(t.floating);return{reference:At(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}},getClientRects:function(t){return Array.from(t.getClientRects())},getDimensions:function(t){const{width:e,height:n}=dt(t);return{width:e,height:n}},getScale:mt,isElement:G,isRTL:function(t){return"rtl"===lt(t).direction}};function Tt(t,e){return t.x===e.x&&t.y===e.y&&t.width===e.width&&t.height===e.height}function Wt(t,e,n,o){void 0===o&&(o={});const{ancestorScroll:i=!0,ancestorResize:r=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:l="function"==typeof IntersectionObserver,animationFrame:a=!1}=o,c=pt(t),f=i||r?[...c?ht(c):[],...e?ht(e):[]]:[];f.forEach(t=>{i&&t.addEventListener("scroll",n,{passive:!0}),r&&t.addEventListener("resize",n)});const h=c&&l?function(t,e){let n,o=null;const i=X(t);function r(){var t;clearTimeout(n),null==(t=o)||t.disconnect(),o=null}return function s(l,a){void 0===l&&(l=!1),void 0===a&&(a=1),r();const c=t.getBoundingClientRect(),{left:f,top:h,width:u,height:d}=c;if(l||e(),!u||!d)return;const p={rootMargin:-x(h)+"px "+-x(i.clientWidth-(f+u))+"px "+-x(i.clientHeight-(h+d))+"px "+-x(f)+"px",threshold:y(0,g(1,a))||1};let m=!0;function w(e){const o=e[0].intersectionRatio;if(o!==a){if(!m)return s();o?s(!1,o):n=setTimeout(()=>{s(!1,1e-7)},1e3)}1!==o||Tt(c,t.getBoundingClientRect())||s(),m=!1}try{o=new IntersectionObserver(w,{...p,root:i.ownerDocument})}catch(t){o=new IntersectionObserver(w,p)}o.observe(t)}(!0),r}(c,n):null;let u,d=-1,p=null;s&&(p=new ResizeObserver(t=>{let[o]=t;o&&o.target===c&&p&&e&&(p.unobserve(e),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var t;null==(t=p)||t.observe(e)})),n()}),c&&!a&&p.observe(c),e&&p.observe(e));let m=a?wt(t):null;return a&&function e(){const o=wt(t);m&&!Tt(m,o)&&n();m=o,u=requestAnimationFrame(e)}(),n(),()=>{var t;f.forEach(t=>{i&&t.removeEventListener("scroll",n),r&&t.removeEventListener("resize",n)}),null==h||h(),null==(t=p)||t.disconnect(),p=null,a&&cancelAnimationFrame(u)}}const Ct=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(e){var n,o;const{x:i,y:r,placement:s,middlewareData:l}=e,a=await async function(t,e){const{placement:n,platform:o,elements:i}=t,r=await(null==o.isRTL?void 0:o.isRTL(i.floating)),s=k(n),l=L(n),a="y"===T(n),c=Y.has(s)?-1:1,f=r&&a?-1:1,h=A(e,t);let{mainAxis:u,crossAxis:d,alignmentAxis:p}="number"==typeof h?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return l&&"number"==typeof p&&(d="end"===l?-1*p:p),a?{x:d*f,y:u*c}:{x:u*c,y:d*f}}(e,t);return s===(null==(n=l.offset)?void 0:n.placement)&&null!=(o=l.arrow)&&o.alignmentOffset?{}:{x:i+a.x,y:r+a.y,data:{...a,placement:s}}}}},Ot=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:o,placement:i,platform:r}=e,{mainAxis:s=!0,crossAxis:l=!1,limiter:a={fn:t=>{let{x:e,y:n}=t;return{x:e,y:n}}},...c}=A(t,e),f={x:n,y:o},h=await r.detectOverflow(e,c),u=T(k(i)),d=E(u);let p=f[d],m=f[u];if(s){const t="y"===d?"bottom":"right";p=R(p+h["y"===d?"top":"left"],p,p-h[t])}if(l){const t="y"===u?"bottom":"right";m=R(m+h["y"===u?"top":"left"],m,m-h[t])}const g=a.fn({...e,[d]:p,[u]:m});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:s,[u]:l}}}}}},$t=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(e){var n,o;const{placement:i,middlewareData:r,rects:s,initialPlacement:l,platform:a,elements:c}=e,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:u,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:m=!0,...g}=A(t,e);if(null!=(n=r.arrow)&&n.alignmentOffset)return{};const y=k(i),w=T(l),x=k(l)===l,v=await(null==a.isRTL?void 0:a.isRTL(c.floating)),b=u||(x||!m?[F(l)]:function(t){const e=F(t);return[C(t),e,C(e)]}(l)),R="none"!==p;!u&&R&&b.push(...M(l,m,p,v));const E=[l,...b],O=await a.detectOverflow(e,g),$=[];let D=(null==(o=r.flip)?void 0:o.overflows)||[];if(f&&$.push(O[y]),h){const t=function(t,e,n){void 0===n&&(n=!1);const o=L(t),i=W(t),r=S(i);let s="x"===i?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return e.reference[r]>e.floating[r]&&(s=F(s)),[s,F(s)]}(i,s,v);$.push(O[t[0]],O[t[1]])}if(D=[...D,{placement:i,overflows:$}],!$.every(t=>t<=0)){var P,B;const t=((null==(P=r.flip)?void 0:P.index)||0)+1,e=E[t];if(e){if(!("alignment"===h&&w!==T(e))||D.every(t=>T(t.placement)!==w||t.overflows[0]>0))return{data:{index:t,overflows:D},reset:{placement:e}}}let n=null==(B=D.filter(t=>t.overflows[0]<=0).sort((t,e)=>t.overflows[1]-e.overflows[1])[0])?void 0:B.placement;if(!n)switch(d){case"bestFit":{var N;const t=null==(N=D.filter(t=>{if(R){const e=T(t.placement);return e===w||"y"===e}return!0}).map(t=>[t.placement,t.overflows.filter(t=>t>0).reduce((t,e)=>t+e,0)]).sort((t,e)=>t[1]-e[1])[0])?void 0:N[0];t&&(n=t);break}case"initialPlacement":n=l}if(i!==n)return{reset:{placement:n}}}return{}}}},Dt=function(t){return void 0===t&&(t={}),{name:"inline",options:t,async fn(e){const{placement:n,elements:o,rects:i,platform:r,strategy:s}=e,{padding:l=2,x:a,y:c}=A(t,e),f=Array.from(await(null==r.getClientRects?void 0:r.getClientRects(o.reference))||[]),h=function(t){const e=t.slice().sort((t,e)=>t.y-e.y),n=[];let o=null;for(let t=0;t<e.length;t++){const i=e[t];!o||i.y-o.y>o.height/2?n.push([i]):n[n.length-1].push(i),o=i}return n.map(t=>N(z(t)))}(f),u=N(z(f)),d=B(l);const p=await r.getElementRects({reference:{getBoundingClientRect:function(){if(2===h.length&&h[0].left>h[1].right&&null!=a&&null!=c)return h.find(t=>a>t.left-d.left&&a<t.right+d.right&&c>t.top-d.top&&c<t.bottom+d.bottom)||u;if(h.length>=2){if("y"===T(n)){const t=h[0],e=h[h.length-1],o="top"===k(n),i=t.top,r=e.bottom,s=o?t.left:e.left,l=o?t.right:e.right;return{top:i,bottom:r,left:s,right:l,width:l-s,height:r-i,x:s,y:i}}const t="left"===k(n),e=y(...h.map(t=>t.right)),o=g(...h.map(t=>t.left)),i=h.filter(n=>t?n.left===o:n.right===e),r=i[0].top,s=i[i.length-1].bottom;return{top:r,bottom:s,left:o,right:e,width:e-o,height:s-r,x:o,y:r}}return u}},floating:o.floating,strategy:s});return i.reference.x!==p.reference.x||i.reference.y!==p.reference.y||i.reference.width!==p.reference.width||i.reference.height!==p.reference.height?{reset:{rects:p}}:{}}}},Pt=function(t){return void 0===t&&(t={}),{options:t,fn(e){const{x:n,y:o,placement:i,rects:r,middlewareData:s}=e,{offset:l=0,mainAxis:a=!0,crossAxis:c=!0}=A(t,e),f={x:n,y:o},h=T(i),u=E(h);let d=f[u],p=f[h];const m=A(l,e),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(a){const t="y"===u?"height":"width",e=r.reference[u]-r.floating[t]+g.mainAxis,n=r.reference[u]+r.reference[t]-g.mainAxis;d<e?d=e:d>n&&(d=n)}if(c){var y,w;const t="y"===u?"width":"height",e=Y.has(k(i)),n=r.reference[h]-r.floating[t]+(e&&(null==(y=s.offset)?void 0:y[h])||0)+(e?0:g.crossAxis),o=r.reference[h]+r.reference[t]+(e?0:(null==(w=s.offset)?void 0:w[h])||0)-(e?g.crossAxis:0);p<n?p=n:p>o&&(p=o)}return{[u]:d,[h]:p}}}},Mt=(t,e,n)=>{const o=new Map,i={platform:St,...n},r={...i.platform,_c:o};return(async(t,e,n)=>{const{placement:o="bottom",strategy:i="absolute",middleware:r=[],platform:s}=n,l=s.detectOverflow?s:{...s,detectOverflow:V},a=await(null==s.isRTL?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:i}),{x:f,y:h}=H(c,o,a),u=o,d=0;const p={};for(let n=0;n<r.length;n++){const m=r[n];if(!m)continue;const{name:g,fn:y}=m,{x:w,y:x,data:v,reset:b}=await y({x:f,y:h,initialPlacement:o,placement:u,strategy:i,middlewareData:p,rects:c,platform:l,elements:{reference:t,floating:e}});f=null!=w?w:f,h=null!=x?x:h,p[g]={...p[g],...v},b&&d<50&&(d++,"object"==typeof b&&(b.placement&&(u=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:t,floating:e,strategy:i}):b.rects),({x:f,y:h}=H(c,u,a))),n=-1)}return{x:f,y:h,placement:u,strategy:i,middlewareData:p}})(t,e,{...i,platform:r})};function Ft(t){return function(t){for(let e=t;e;e=Bt(e))if(e instanceof Element&&"none"===getComputedStyle(e).display)return null;for(let e=Bt(t);e;e=Bt(e)){if(!(e instanceof Element))continue;const t=getComputedStyle(e);if("contents"!==t.display){if("static"!==t.position||it(t))return e;if("BODY"===e.tagName)return e}}return null}(t)}function Bt(t){return t.assignedSlot?t.assignedSlot:t.parentNode instanceof ShadowRoot?t.parentNode.host:t.parentNode}async function Nt(t,e,n,o){async function i(){const i=new Array;n?.inline&&i.push(Dt()),n.flip&&i.push(!0===n.flip?$t():$t({fallbackPlacements:n.flip})),n.shift&&i.push(Ot({mainAxis:"main"===n.shift||"both"===n.shift,crossAxis:"cross"===n.shift||"both"===n.shift,limiter:Pt()})),n.offset&&!isNaN(n.offset)&&i.push(Ct(n.offset));const r=await Mt(e,t,{placement:n.position,middleware:i,platform:{...St,getOffsetParent:t=>St.getOffsetParent(t,Ft)}});o(r.x,r.y,r.placement)}return await i(),Wt(e,t,async()=>await i())}var Ht,Vt,zt,Yt,jt,It,qt,Xt,_t;let Gt=class extends(a(c(o))){constructor(){super(...arguments),Ht.add(this),Vt.set(this,void 0),zt.set(this,void 0),Yt.set(this,void 0),jt.set(this,e=>t(this,Ht,"m",_t).call(this,e)),It.set(this,n=>{"closed"===n.newState&&(t(this,Yt,"f")?.call(this),e(this,Yt,void 0,"f"))}),qt.set(this,new f(this,{target:null,callback:()=>this.hide(!1)})),Xt.set(this,new h(this,{target:null,callback:()=>{t(this,zt,"f")&&this.fitAnchorWidth&&(this.style.minWidth=`${t(this,zt,"f").clientWidth}px`)}})),this.scrollStrategy="hide",this.fitAnchorWidth=!1,this.anchorOffset=0}get isOpen(){return void 0!==t(this,Vt,"f")}get trigger(){return t(this,Vt,"f")??null}connectedCallback(){super.connectedCallback(),this.setAttribute("popover","manual"),this.addEventListener("toggle",t(this,It,"f")),document.addEventListener("click",t(this,jt,"f"))}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("toggle",t(this,It,"f")),document.removeEventListener("click",t(this,jt,"f"))}async show(n,o){t(this,Vt,"f")&&t(this,Vt,"f")!==n&&this.hide(),e(this,Vt,n,"f"),t(this,Vt,"f").ariaExpanded="true",e(this,zt,o??n,"f"),"hide"===this.scrollStrategy&&t(this,qt,"f").observe(t(this,zt,"f")),this.fitAnchorWidth&&(t(this,Xt,"f").observe(t(this,zt,"f")),this.style.minWidth=`${t(this,zt,"f").clientWidth}px`),e(this,Yt,await Nt(this,t(this,zt,"f"),{position:"bottom-start",inline:!0,flip:!0,offset:this.anchorOffset>0?this.anchorOffset:void 0},(t,e,n)=>{p(this,"-top",n.includes("top")),p(this,"-bottom",n.includes("bottom")),"rtl"===m.current?(this.style.right=window.innerWidth-t-this.clientWidth+"px",this.style.left=""):(this.style.left=`${t}px`,this.style.right=""),this.style.top=`${e}px`}),"f"),this.showPopover()}hide(n=!1){this.hidePopover(),t(this,Vt,"f")&&(t(this,Vt,"f").ariaExpanded="false",n&&t(this,Vt,"f").focus(),t(this,zt,"f")&&(t(this,qt,"f").unobserve(t(this,zt,"f")),this.fitAnchorWidth&&t(this,Xt,"f").unobserve(t(this,zt,"f"))),e(this,Vt,void 0,"f"),e(this,zt,void 0,"f"))}async toggle(e,n){t(this,Vt,"f")?this.hide():await this.show(e,n)}render(){return i`<div class="base"><slot></slot></div>`}};Vt=new WeakMap,zt=new WeakMap,Yt=new WeakMap,jt=new WeakMap,It=new WeakMap,qt=new WeakMap,Xt=new WeakMap,Ht=new WeakSet,_t=function(e){this.isOpen&&!e.composedPath().some(e=>e===this||e===t(this,zt,"f"))&&this.hide()},Gt.styles=s`:host { position: absolute; flex-direction: column; padding: unset; margin: unset; border: unset; overflow-y: auto; scrollbar-width: ${u.scrollbar.thinWidth}; scrollbar-color: ${u.scrollbar.color}; scroll-padding-block: calc( var(--m3e-focus-ring-thickness, 3px) + var(--m3e-floating-panel-container-padding-block, 0.25rem) ); border-radius: var(--m3e-floating-panel-container-shape, ${u.shape.corner.large}); min-width: var(--m3e-floating-panel-container-min-width, 7rem); max-width: var(--m3e-floating-panel-container-max-width, 17.5rem); max-height: var(--m3e-floating-panel-container-max-height, 17.5rem); background-color: var(--m3e-floating-panel-container-color, ${u.color.surfaceContainer}); box-shadow: var(--m3e-floating-panel-container-elevation, ${u.elevation.level3}); opacity: 0; display: none; } .base { box-sizing: border-box; display: flex; flex-direction: column; padding-block: var(--m3e-floating-panel-container-padding-block, 0.25rem); padding-inline: var(--m3e-floating-panel-container-padding-inline, 0.25rem); } :host(:not(:state(-no-animate))) { transition: ${r(`opacity ${u.motion.duration.short2} ${u.motion.easing.standard}, \n transform ${u.motion.duration.short2} ${u.motion.easing.standard},\n overlay ${u.motion.duration.short2} ${u.motion.easing.standard} allow-discrete,\n display ${u.motion.duration.short2} ${u.motion.easing.standard} allow-discrete`)}; } :host { transform: scaleY(0.8); } :host(:popover-open) { transform: scaleY(1); display: block; opacity: 1; } :host::backdrop { background-color: transparent; } :host(:state(-bottom)) { transform-origin: top; } :host(:state(-top)) { transform-origin: bottom; } @starting-style { :host(:popover-open) { transform: scaleY(0.8); } } @media (prefers-reduced-motion) { :host(:not(:state(-no-animate))) { transition: none; } } @media (forced-colors: active) { :host { background-color: Menu; color: MenuText; outline: 1px solid MenuText; } }`,n([l({attribute:"scroll-strategy"})],Gt.prototype,"scrollStrategy",void 0),n([l({attribute:"fit-anchor-width",type:Boolean})],Gt.prototype,"fitAnchorWidth",void 0),n([l({attribute:"anchor-offset",type:Number})],Gt.prototype,"anchorOffset",void 0),Gt=n([d("m3e-floating-panel")],Gt);export{Gt as M3eFloatingPanelElement,Nt as positionAnchor};
7
7
  //# sourceMappingURL=core-anchoring.min.js.map