@cloudflare/realtimekit-ui 1.0.2-staging.3 → 1.0.3-staging.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 (108) hide show
  1. package/dist/browser.js +1 -0
  2. package/dist/cjs/{floating-ui.dom.esm-c3c35b98.js → floating-ui.dom.esm-90c5a220.js} +54 -30
  3. package/dist/cjs/rtk-avatar_54.cjs.entry.js +1 -1
  4. package/dist/cjs/rtk-livestream-indicator_3.cjs.entry.js +30892 -23958
  5. package/dist/cjs/rtk-participant_2.cjs.entry.js +1 -1
  6. package/dist/cjs/rtk-setup-screen.cjs.entry.js +4 -4
  7. package/dist/collection/components/rtk-audio-tile/rtk-audio-tile.js +1 -1
  8. package/dist/collection/components/rtk-audio-visualizer/rtk-audio-visualizer.js +1 -1
  9. package/dist/collection/components/rtk-avatar/rtk-avatar.js +1 -1
  10. package/dist/collection/components/rtk-breakout-room-toggle/rtk-breakout-rooms-toggle.js +1 -1
  11. package/dist/collection/components/rtk-breakout-rooms-manager/rtk-breakout-rooms-manager.js +1 -1
  12. package/dist/collection/components/rtk-channel-selector-view/rtk-channel-selector-view.js +2 -2
  13. package/dist/collection/components/rtk-file-picker-button/rtk-file-picker-button.js +1 -1
  14. package/dist/collection/components/rtk-name-tag/rtk-name-tag.js +1 -1
  15. package/dist/collection/components/rtk-network-indicator/rtk-network-indicator.js +1 -1
  16. package/dist/collection/components/rtk-participant/rtk-participant.js +1 -1
  17. package/dist/collection/components/rtk-participant-setup/rtk-participant-setup.js +1 -1
  18. package/dist/collection/components/rtk-participant-tile/rtk-participant-tile.js +2 -2
  19. package/dist/collection/components/rtk-plugin-main/rtk-plugin-main.js +1 -1
  20. package/dist/collection/components/rtk-poll/rtk-poll.js +1 -1
  21. package/dist/collection/components/rtk-screenshare-view/rtk-screenshare-view.js +1 -1
  22. package/dist/collection/components/rtk-setup-screen/rtk-setup-screen.js +4 -4
  23. package/dist/components/{p-5e5c9b53.js → p-01b76741.js} +1 -1
  24. package/dist/components/{p-94e8d526.js → p-11048ea8.js} +1 -1
  25. package/dist/components/{p-778197ec.js → p-11b00854.js} +1 -1
  26. package/dist/components/{p-70053efe.js → p-1a6ad05c.js} +30892 -23958
  27. package/dist/components/{p-828a11f4.js → p-1c22a3a0.js} +3 -3
  28. package/dist/components/{p-519e8701.js → p-1f0c5462.js} +1 -1
  29. package/dist/components/{p-98d49c8e.js → p-22f2908e.js} +1 -1
  30. package/dist/components/{p-1174d3f4.js → p-2c41819d.js} +2 -2
  31. package/dist/components/{p-ff13d28d.js → p-2e9c3dd2.js} +1 -1
  32. package/dist/components/{p-abdd2a8a.js → p-4b89a5d6.js} +1 -1
  33. package/dist/components/{p-e2006e05.js → p-5d9eec22.js} +16 -16
  34. package/dist/components/{p-2cc196a8.js → p-6d3c8a73.js} +1 -1
  35. package/dist/components/{p-31964573.js → p-94cc1b33.js} +54 -30
  36. package/dist/components/{p-1633eae1.js → p-97ce630d.js} +2 -2
  37. package/dist/components/{p-1d7f3c99.js → p-98cc289f.js} +3 -3
  38. package/dist/components/{p-83a87193.js → p-9b675f4f.js} +1 -1
  39. package/dist/components/{p-8750e2de.js → p-a0000935.js} +2 -2
  40. package/dist/components/{p-9140d5c1.js → p-b29a58cd.js} +1 -1
  41. package/dist/components/{p-de2175ca.js → p-b2b2e917.js} +1 -1
  42. package/dist/components/{p-be584d57.js → p-be45dbd1.js} +2 -2
  43. package/dist/components/{p-af7aea98.js → p-c1f57f6b.js} +1 -1
  44. package/dist/components/{p-c173a513.js → p-cc6ff913.js} +1 -1
  45. package/dist/components/{p-c226934a.js → p-d8be719c.js} +4 -4
  46. package/dist/components/{p-25738f7b.js → p-db6f9f73.js} +1 -1
  47. package/dist/components/{p-fb31f34b.js → p-e83a6293.js} +1 -1
  48. package/dist/components/{p-a5d2ac22.js → p-eba76ab4.js} +4 -4
  49. package/dist/components/{p-1f6e5501.js → p-ed0df5b1.js} +1 -1
  50. package/dist/components/rtk-breakout-room-manager.js +1 -1
  51. package/dist/components/rtk-breakout-room-participants.js +1 -1
  52. package/dist/components/rtk-breakout-rooms-manager.js +1 -1
  53. package/dist/components/rtk-camera-toggle.js +1 -1
  54. package/dist/components/rtk-channel-header.js +1 -1
  55. package/dist/components/rtk-chat-composer-ui.js +1 -1
  56. package/dist/components/rtk-chat-composer-view.js +1 -1
  57. package/dist/components/rtk-chat-message.js +1 -1
  58. package/dist/components/rtk-chat-messages-ui-paginated.js +1 -1
  59. package/dist/components/rtk-chat-messages-ui.js +1 -1
  60. package/dist/components/rtk-chat-search-results.js +1 -1
  61. package/dist/components/rtk-chat.js +1 -1
  62. package/dist/components/rtk-dialog-manager.js +1 -1
  63. package/dist/components/rtk-draft-attachment-view.js +1 -1
  64. package/dist/components/rtk-emoji-picker-button.js +1 -1
  65. package/dist/components/rtk-file-picker-button.js +1 -1
  66. package/dist/components/rtk-grid-pagination.js +1 -1
  67. package/dist/components/rtk-grid.js +1 -1
  68. package/dist/components/rtk-livestream-player.js +1 -1
  69. package/dist/components/rtk-meeting-title.js +1 -1
  70. package/dist/components/rtk-meeting.js +17 -17
  71. package/dist/components/rtk-menu.js +1 -1
  72. package/dist/components/rtk-message-view.js +1 -1
  73. package/dist/components/rtk-mic-toggle.js +1 -1
  74. package/dist/components/rtk-mixed-grid.js +3 -3
  75. package/dist/components/rtk-mute-all-button.js +1 -1
  76. package/dist/components/rtk-participant.js +1 -1
  77. package/dist/components/rtk-participants-stage-queue.js +1 -1
  78. package/dist/components/rtk-participants-viewer-list.js +1 -1
  79. package/dist/components/rtk-participants-waiting-list.js +1 -1
  80. package/dist/components/rtk-participants.js +5 -5
  81. package/dist/components/rtk-poll.js +1 -1
  82. package/dist/components/rtk-polls.js +1 -1
  83. package/dist/components/rtk-screen-share-toggle.js +1 -1
  84. package/dist/components/rtk-screenshare-view.js +1 -1
  85. package/dist/components/rtk-setup-screen.js +4 -4
  86. package/dist/components/rtk-sidebar.js +3 -3
  87. package/dist/components/rtk-spotlight-indicator.js +1 -1
  88. package/dist/components/rtk-stage-toggle.js +1 -1
  89. package/dist/components/rtk-tab-bar.js +1 -1
  90. package/dist/components/rtk-tooltip.js +1 -1
  91. package/dist/docs/docs-components.json +118 -118
  92. package/dist/docs/docs-vscode.json +12 -12
  93. package/dist/esm/{floating-ui.dom.esm-cf1488a2.js → floating-ui.dom.esm-a2dc8eef.js} +54 -30
  94. package/dist/esm/loader.js +63224 -4
  95. package/dist/esm/rtk-avatar_54.entry.js +1 -1
  96. package/dist/esm/rtk-livestream-indicator_3.entry.js +30892 -23958
  97. package/dist/esm/rtk-participant_2.entry.js +1 -1
  98. package/dist/esm/rtk-setup-screen.entry.js +4 -4
  99. package/dist/realtimekit-ui/{p-c39a8005.entry.js → p-14350b0d.entry.js} +1 -1
  100. package/dist/realtimekit-ui/p-1abb4841.entry.js +1 -0
  101. package/dist/realtimekit-ui/{p-2db001cf.entry.js → p-48610132.entry.js} +1 -1
  102. package/dist/realtimekit-ui/p-94cc1b33.js +1 -0
  103. package/dist/realtimekit-ui/p-f4105345.entry.js +1 -0
  104. package/dist/realtimekit-ui/realtimekit-ui.esm.js +1 -1
  105. package/package.json +1 -1
  106. package/dist/realtimekit-ui/p-0b8b849b.entry.js +0 -1
  107. package/dist/realtimekit-ui/p-31964573.js +0 -1
  108. package/dist/realtimekit-ui/p-b60b229e.entry.js +0 -1
@@ -0,0 +1 @@
1
+ const t=["top","right","bottom","left"],n=["start","end"],e=t.reduce(((t,e)=>t.concat(e,e+"-"+n[0],e+"-"+n[1])),[]),o=Math.min,r=Math.max,i=Math.round,a=t=>({x:t,y:t}),c={left:"right",right:"left",bottom:"top",top:"bottom"},l={start:"end",end:"start"};function s(t,n,e){return r(t,o(n,e))}function u(t,n){return"function"==typeof t?t(n):t}function f(t){return t.split("-")[0]}function d(t){return t.split("-")[1]}function m(t){return"x"===t?"y":"x"}function y(t){return"y"===t?"height":"width"}const p=new Set(["top","bottom"]);function h(t){return p.has(f(t))?"y":"x"}function w(t){return m(h(t))}function g(t,n,e){void 0===e&&(e=!1);const o=d(t),r=w(t),i=y(r);let a="x"===r?o===(e?"end":"start")?"right":"left":"start"===o?"bottom":"top";return n.reference[i]>n.floating[i]&&(a=k(a)),[a,k(a)]}function x(t){return t.replace(/start|end/g,(t=>l[t]))}const v=["left","right"],b=["right","left"],A=["top","bottom"],S=["bottom","top"];function k(t){return t.replace(/left|right|bottom|top/g,(t=>c[t]))}function P(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 R(t){const{x:n,y:e,width:o,height:r}=t;return{width:o,height:r,top:e,left:n,right:n+o,bottom:e+r,x:n,y:e}}function D(t,n,e){let{reference:o,floating:r}=t;const i=h(n),a=w(n),c=y(a),l=f(n),s="y"===i,u=o.x+o.width/2-r.width/2,m=o.y+o.height/2-r.height/2,p=o[c]/2-r[c]/2;let g;switch(l){case"top":g={x:u,y:o.y-r.height};break;case"bottom":g={x:u,y:o.y+o.height};break;case"right":g={x:o.x+o.width,y:m};break;case"left":g={x:o.x-r.width,y:m};break;default:g={x:o.x,y:o.y}}switch(d(n)){case"start":g[a]-=p*(e&&s?-1:1);break;case"end":g[a]+=p*(e&&s?-1:1)}return g}async function C(t,n){var e;void 0===n&&(n={});const{x:o,y:r,platform:i,rects:a,elements:c,strategy:l}=t,{boundary:s="clippingAncestors",rootBoundary:f="viewport",elementContext:d="floating",altBoundary:m=!1,padding:y=0}=u(n,t),p=P(y),h=c[m?"floating"===d?"reference":"floating":d],w=R(await i.getClippingRect({element:null==(e=await(null==i.isElement?void 0:i.isElement(h)))||e?h:h.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(c.floating)),boundary:s,rootBoundary:f,strategy:l})),g="floating"===d?{x:o,y:r,width:a.floating.width,height:a.floating.height}:a.reference,x=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c.floating)),v=await(null==i.isElement?void 0:i.isElement(x))&&await(null==i.getScale?void 0:i.getScale(x))||{x:1,y:1},b=R(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:g,offsetParent:x,strategy:l}):g);return{top:(w.top-b.top+p.top)/v.y,bottom:(b.bottom-w.bottom+p.bottom)/v.y,left:(w.left-b.left+p.left)/v.x,right:(b.right-w.right+p.right)/v.x}}function O(t,n){return{top:t.top-n.height,right:t.right-n.width,bottom:t.bottom-n.height,left:t.left-n.width}}function T(n){return t.some((t=>n[t]>=0))}const B=new Set(["left","top"]);function F(){return"undefined"!=typeof window}function H(t){return M(t)?(t.nodeName||"").toLowerCase():"#document"}function L(t){var n;return(null==t||null==(n=t.ownerDocument)?void 0:n.defaultView)||window}function E(t){var n;return null==(n=(M(t)?t.ownerDocument:t.document)||window.document)?void 0:n.documentElement}function M(t){return!!F()&&(t instanceof Node||t instanceof L(t).Node)}function N(t){return!!F()&&(t instanceof Element||t instanceof L(t).Element)}function j(t){return!!F()&&(t instanceof HTMLElement||t instanceof L(t).HTMLElement)}function $(t){return!(!F()||"undefined"==typeof ShadowRoot)&&(t instanceof ShadowRoot||t instanceof L(t).ShadowRoot)}const V=new Set(["inline","contents"]);function W(t){const{overflow:n,overflowX:e,overflowY:o,display:r}=Z(t);return/auto|scroll|overlay|hidden|clip/.test(n+o+e)&&!V.has(r)}const X=new Set(["table","td","th"]);function Y(t){return X.has(H(t))}const _=[":popover-open",":modal"];function q(t){return _.some((n=>{try{return t.matches(n)}catch(t){return!1}}))}const z=["transform","translate","scale","rotate","perspective"],G=["transform","translate","scale","rotate","perspective","filter"],I=["paint","layout","strict","content"];function J(t){const n=K(),e=N(t)?Z(t):t;return z.some((t=>!!e[t]&&"none"!==e[t]))||!!e.containerType&&"normal"!==e.containerType||!n&&!!e.backdropFilter&&"none"!==e.backdropFilter||!n&&!!e.filter&&"none"!==e.filter||G.some((t=>(e.willChange||"").includes(t)))||I.some((t=>(e.contain||"").includes(t)))}function K(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const Q=new Set(["html","body","#document"]);function U(t){return Q.has(H(t))}function Z(t){return L(t).getComputedStyle(t)}function tt(t){return N(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function nt(t){if("html"===H(t))return t;const n=t.assignedSlot||t.parentNode||$(t)&&t.host||E(t);return $(n)?n.host:n}function et(t){const n=nt(t);return U(n)?t.ownerDocument?t.ownerDocument.body:t.body:j(n)&&W(n)?n:et(n)}function ot(t,n,e){var o;void 0===n&&(n=[]),void 0===e&&(e=!0);const r=et(t),i=r===(null==(o=t.ownerDocument)?void 0:o.body),a=L(r);if(i){const t=rt(a);return n.concat(a,a.visualViewport||[],W(r)?r:[],t&&e?ot(t):[])}return n.concat(r,ot(r,[],e))}function rt(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function it(t){const n=Z(t);let e=parseFloat(n.width)||0,o=parseFloat(n.height)||0;const r=j(t),a=r?t.offsetWidth:e,c=r?t.offsetHeight:o,l=i(e)!==a||i(o)!==c;return l&&(e=a,o=c),{width:e,height:o,$:l}}function at(t){return N(t)?t:t.contextElement}function ct(t){const n=at(t);if(!j(n))return a(1);const e=n.getBoundingClientRect(),{width:o,height:r,$:c}=it(n);let l=(c?i(e.width):e.width)/o,s=(c?i(e.height):e.height)/r;return l&&Number.isFinite(l)||(l=1),s&&Number.isFinite(s)||(s=1),{x:l,y:s}}const lt=a(0);function st(t){const n=L(t);return K()&&n.visualViewport?{x:n.visualViewport.offsetLeft,y:n.visualViewport.offsetTop}:lt}function ut(t,n,e,o){void 0===n&&(n=!1),void 0===e&&(e=!1);const r=t.getBoundingClientRect(),i=at(t);let c=a(1);n&&(o?N(o)&&(c=ct(o)):c=ct(t));const l=function(t,n,e){return void 0===n&&(n=!1),!(!e||n&&e!==L(t))&&n}(i,e,o)?st(i):a(0);let s=(r.left+l.x)/c.x,u=(r.top+l.y)/c.y,f=r.width/c.x,d=r.height/c.y;if(i){const t=L(i),n=o&&N(o)?L(o):o;let e=t,r=rt(e);for(;r&&o&&n!==e;){const t=ct(r),n=r.getBoundingClientRect(),o=Z(r),i=n.left+(r.clientLeft+parseFloat(o.paddingLeft))*t.x,a=n.top+(r.clientTop+parseFloat(o.paddingTop))*t.y;s*=t.x,u*=t.y,f*=t.x,d*=t.y,s+=i,u+=a,e=L(r),r=rt(e)}}return R({width:f,height:d,x:s,y:u})}function ft(t,n){const e=tt(t).scrollLeft;return n?n.left+e:ut(E(t)).left+e}function dt(t,n,e){void 0===e&&(e=!1);const o=t.getBoundingClientRect();return{x:o.left+n.scrollLeft-(e?0:ft(t,o)),y:o.top+n.scrollTop}}const mt=new Set(["absolute","fixed"]);function yt(t,n,e){let o;if("viewport"===n)o=function(t,n){const e=L(t),o=E(t),r=e.visualViewport;let i=o.clientWidth,a=o.clientHeight,c=0,l=0;if(r){i=r.width,a=r.height;const t=K();(!t||t&&"fixed"===n)&&(c=r.offsetLeft,l=r.offsetTop)}return{width:i,height:a,x:c,y:l}}(t,e);else if("document"===n)o=function(t){const n=E(t),e=tt(t),o=t.ownerDocument.body,i=r(n.scrollWidth,n.clientWidth,o.scrollWidth,o.clientWidth),a=r(n.scrollHeight,n.clientHeight,o.scrollHeight,o.clientHeight);let c=-e.scrollLeft+ft(t);const l=-e.scrollTop;return"rtl"===Z(o).direction&&(c+=r(n.clientWidth,o.clientWidth)-i),{width:i,height:a,x:c,y:l}}(E(t));else if(N(n))o=function(t,n){const e=ut(t,!0,"fixed"===n),o=e.top+t.clientTop,r=e.left+t.clientLeft,i=j(t)?ct(t):a(1);return{width:t.clientWidth*i.x,height:t.clientHeight*i.y,x:r*i.x,y:o*i.y}}(n,e);else{const e=st(t);o={x:n.x-e.x,y:n.y-e.y,width:n.width,height:n.height}}return R(o)}function pt(t,n){const e=nt(t);return!(e===n||!N(e)||U(e))&&("fixed"===Z(e).position||pt(e,n))}function ht(t,n,e){const o=j(n),r=E(n),i="fixed"===e,c=ut(t,!0,i,n);let l={scrollLeft:0,scrollTop:0};const s=a(0);function u(){s.x=ft(r)}if(o||!o&&!i)if(("body"!==H(n)||W(r))&&(l=tt(n)),o){const t=ut(n,!0,i,n);s.x=t.x+n.clientLeft,s.y=t.y+n.clientTop}else r&&u();i&&!o&&r&&u();const f=!r||o||i?a(0):dt(r,l);return{x:c.left+l.scrollLeft-s.x-f.x,y:c.top+l.scrollTop-s.y-f.y,width:c.width,height:c.height}}function wt(t){return"static"===Z(t).position}function gt(t,n){if(!j(t)||"fixed"===Z(t).position)return null;if(n)return n(t);let e=t.offsetParent;return E(t)===e&&(e=e.ownerDocument.body),e}function xt(t,n){const e=L(t);if(q(t))return e;if(!j(t)){let n=nt(t);for(;n&&!U(n);){if(N(n)&&!wt(n))return n;n=nt(n)}return e}let o=gt(t,n);for(;o&&Y(o)&&wt(o);)o=gt(o,n);return o&&U(o)&&wt(o)&&!J(o)?e:o||function(t){let n=nt(t);for(;j(n)&&!U(n);){if(J(n))return n;if(q(n))return null;n=nt(n)}return null}(t)||e}const vt={convertOffsetParentRelativeRectToViewportRelativeRect:function(t){let{elements:n,rect:e,offsetParent:o,strategy:r}=t;const i="fixed"===r,c=E(o),l=!!n&&q(n.floating);if(o===c||l&&i)return e;let s={scrollLeft:0,scrollTop:0},u=a(1);const f=a(0),d=j(o);if((d||!d&&!i)&&(("body"!==H(o)||W(c))&&(s=tt(o)),j(o))){const t=ut(o);u=ct(o),f.x=t.x+o.clientLeft,f.y=t.y+o.clientTop}const m=!c||d||i?a(0):dt(c,s,!0);return{width:e.width*u.x,height:e.height*u.y,x:e.x*u.x-s.scrollLeft*u.x+f.x+m.x,y:e.y*u.y-s.scrollTop*u.y+f.y+m.y}},getDocumentElement:E,getClippingRect:function(t){let{element:n,boundary:e,rootBoundary:i,strategy:a}=t;const c=[..."clippingAncestors"===e?q(n)?[]:function(t,n){const e=n.get(t);if(e)return e;let o=ot(t,[],!1).filter((t=>N(t)&&"body"!==H(t))),r=null;const i="fixed"===Z(t).position;let a=i?nt(t):t;for(;N(a)&&!U(a);){const n=Z(a),e=J(a);e||"fixed"!==n.position||(r=null),(i?!e&&!r:!e&&"static"===n.position&&r&&mt.has(r.position)||W(a)&&!e&&pt(t,a))?o=o.filter((t=>t!==a)):r=n,a=nt(a)}return n.set(t,o),o}(n,this._c):[].concat(e),i],l=c.reduce(((t,e)=>{const i=yt(n,e,a);return t.top=r(i.top,t.top),t.right=o(i.right,t.right),t.bottom=o(i.bottom,t.bottom),t.left=r(i.left,t.left),t}),yt(n,c[0],a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:xt,getElementRects:async function(t){const n=this.getOffsetParent||xt,e=this.getDimensions,o=await e(t.floating);return{reference:ht(t.reference,await n(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:n,height:e}=it(t);return{width:n,height:e}},getScale:ct,isElement:N,isRTL:function(t){return"rtl"===Z(t).direction}},bt=function(t){return void 0===t&&(t=0),{name:"offset",options:t,async fn(n){var e,o;const{x:r,y:i,placement:a,middlewareData:c}=n,l=await async function(t,n){const{placement:e,platform:o,elements:r}=t,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),a=f(e),c=d(e),l="y"===h(e),s=B.has(a)?-1:1,m=i&&l?-1:1,y=u(n,t);let{mainAxis:p,crossAxis:w,alignmentAxis:g}="number"==typeof y?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return c&&"number"==typeof g&&(w="end"===c?-1*g:g),l?{x:w*m,y:p*s}:{x:p*s,y:w*m}}(n,t);return a===(null==(e=c.offset)?void 0:e.placement)&&null!=(o=c.arrow)&&o.alignmentOffset?{}:{x:r+l.x,y:i+l.y,data:{...l,placement:a}}}}},At=function(t){return void 0===t&&(t={}),{name:"autoPlacement",options:t,async fn(n){var o,r,i;const{rects:a,middlewareData:c,placement:l,platform:s,elements:m}=n,{crossAxis:y=!1,alignment:p,allowedPlacements:h=e,autoAlignment:w=!0,...v}=u(t,n),b=void 0!==p||h===e?function(t,n,e){return(t?[...e.filter((n=>d(n)===t)),...e.filter((n=>d(n)!==t))]:e.filter((t=>f(t)===t))).filter((e=>!t||d(e)===t||!!n&&x(e)!==e))}(p||null,w,h):h,A=await C(n,v),S=(null==(o=c.autoPlacement)?void 0:o.index)||0,k=b[S];if(null==k)return{};const P=g(k,a,await(null==s.isRTL?void 0:s.isRTL(m.floating)));if(l!==k)return{reset:{placement:b[0]}};const R=[A[f(k)],A[P[0]],A[P[1]]],D=[...(null==(r=c.autoPlacement)?void 0:r.overflows)||[],{placement:k,overflows:R}],O=b[S+1];if(O)return{data:{index:S+1,overflows:D},reset:{placement:O}};const T=D.map((t=>{const n=d(t.placement);return[t.placement,n&&y?t.overflows.slice(0,2).reduce(((t,n)=>t+n),0):t.overflows[0],t.overflows]})).sort(((t,n)=>t[1]-n[1])),B=(null==(i=T.filter((t=>t[2].slice(0,d(t[0])?2:3).every((t=>t<=0))))[0])?void 0:i[0])||T[0][0];return B!==l?{data:{index:S+1,overflows:D},reset:{placement:B}}:{}}}},St=function(t){return void 0===t&&(t={}),{name:"shift",options:t,async fn(n){const{x:e,y:o,placement:r}=n,{mainAxis:i=!0,crossAxis:a=!1,limiter:c={fn:t=>{let{x:n,y:e}=t;return{x:n,y:e}}},...l}=u(t,n),d={x:e,y:o},y=await C(n,l),p=h(f(r)),w=m(p);let g=d[w],x=d[p];i&&(g=s(g+y["y"===w?"top":"left"],g,g-y["y"===w?"bottom":"right"])),a&&(x=s(x+y["y"===p?"top":"left"],x,x-y["y"===p?"bottom":"right"]));const v=c.fn({...n,[w]:g,[p]:x});return{...v,data:{x:v.x-e,y:v.y-o,enabled:{[w]:i,[p]:a}}}}}},kt=function(t){return void 0===t&&(t={}),{name:"flip",options:t,async fn(n){var e,o;const{placement:r,middlewareData:i,rects:a,initialPlacement:c,platform:l,elements:s}=n,{mainAxis:m=!0,crossAxis:y=!0,fallbackPlacements:p,fallbackStrategy:w="bestFit",fallbackAxisSideDirection:P="none",flipAlignment:R=!0,...D}=u(t,n);if(null!=(e=i.arrow)&&e.alignmentOffset)return{};const O=f(r),T=h(c),B=f(c)===c,F=await(null==l.isRTL?void 0:l.isRTL(s.floating)),H=p||(B||!R?[k(c)]:function(t){const n=k(t);return[x(t),n,x(n)]}(c)),L="none"!==P;!p&&L&&H.push(...function(t,n,e,o){const r=d(t);let i=function(t,n,e){switch(t){case"top":case"bottom":return e?n?b:v:n?v:b;case"left":case"right":return n?A:S;default:return[]}}(f(t),"start"===e,o);return r&&(i=i.map((t=>t+"-"+r)),n&&(i=i.concat(i.map(x)))),i}(c,R,P,F));const E=[c,...H],M=await C(n,D),N=[];let j=(null==(o=i.flip)?void 0:o.overflows)||[];if(m&&N.push(M[O]),y){const t=g(r,a,F);N.push(M[t[0]],M[t[1]])}if(j=[...j,{placement:r,overflows:N}],!N.every((t=>t<=0))){var $,V;const t=((null==($=i.flip)?void 0:$.index)||0)+1,n=E[t];if(n&&("alignment"!==y||T===h(n)||j.every((t=>t.overflows[0]>0&&h(t.placement)===T))))return{data:{index:t,overflows:j},reset:{placement:n}};let e=null==(V=j.filter((t=>t.overflows[0]<=0)).sort(((t,n)=>t.overflows[1]-n.overflows[1]))[0])?void 0:V.placement;if(!e)switch(w){case"bestFit":{var W;const t=null==(W=j.filter((t=>{if(L){const n=h(t.placement);return n===T||"y"===n}return!0})).map((t=>[t.placement,t.overflows.filter((t=>t>0)).reduce(((t,n)=>t+n),0)])).sort(((t,n)=>t[1]-n[1]))[0])?void 0:W[0];t&&(e=t);break}case"initialPlacement":e=c}if(r!==e)return{reset:{placement:e}}}return{}}}},Pt=function(t){return void 0===t&&(t={}),{name:"hide",options:t,async fn(n){const{rects:e}=n,{strategy:o="referenceHidden",...r}=u(t,n);switch(o){case"referenceHidden":{const t=O(await C(n,{...r,elementContext:"reference"}),e.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:T(t)}}}case"escaped":{const t=O(await C(n,{...r,altBoundary:!0}),e.floating);return{data:{escapedOffsets:t,escaped:T(t)}}}default:return{}}}}},Rt=t=>({name:"arrow",options:t,async fn(n){const{x:e,y:r,placement:i,rects:a,platform:c,elements:l,middlewareData:f}=n,{element:m,padding:p=0}=u(t,n)||{};if(null==m)return{};const h=P(p),g={x:e,y:r},x=w(i),v=y(x),b=await c.getDimensions(m),A="y"===x,S=A?"top":"left",k=A?"bottom":"right",R=A?"clientHeight":"clientWidth",D=a.reference[v]+a.reference[x]-g[x]-a.floating[v],C=g[x]-a.reference[x],O=await(null==c.getOffsetParent?void 0:c.getOffsetParent(m));let T=O?O[R]:0;T&&await(null==c.isElement?void 0:c.isElement(O))||(T=l.floating[R]||a.floating[v]);const B=D/2-C/2,F=T/2-b[v]/2-1,H=o(h[S],F),L=o(h[k],F),E=H,M=T-b[v]-L,N=T/2-b[v]/2+B,j=s(E,N,M),$=!f.arrow&&null!=d(i)&&N!==j&&a.reference[v]/2-(N<E?H:L)-b[v]/2<0,V=$?N<E?N-E:N-M:0;return{[x]:g[x]+V,data:{[x]:j,centerOffset:N-j-V,...$&&{alignmentOffset:V}},reset:$}}}),Dt=(t,n,e)=>{const o=new Map,r={platform:vt,...e},i={...r.platform,_c:o};return(async(t,n,e)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:a}=e,c=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(n));let s=await a.getElementRects({reference:t,floating:n,strategy:r}),{x:u,y:f}=D(s,o,l),d=o,m={},y=0;for(let e=0;e<c.length;e++){const{name:i,fn:p}=c[e],{x:h,y:w,data:g,reset:x}=await p({x:u,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:m,rects:s,platform:a,elements:{reference:t,floating:n}});u=null!=h?h:u,f=null!=w?w:f,m={...m,[i]:{...m[i],...g}},x&&y<=50&&(y++,"object"==typeof x&&(x.placement&&(d=x.placement),x.rects&&(s=!0===x.rects?await a.getElementRects({reference:t,floating:n,strategy:r}):x.rects),({x:u,y:f}=D(s,d,l))),e=-1)}return{x:u,y:f,placement:d,strategy:r,middlewareData:m}})(t,n,{...r,platform:i})};export{Rt as a,At as b,Dt as c,kt as f,Pt as h,bt as o,St as s}