UNPKG

bootstrap-vue-next

Version:

BootstrapVueNext is an early and lovely component library for Vue 3 & Nuxt 3 based on Bootstrap 5 and Typescript.

3 lines (2 loc) 32.7 kB
"use strict";const e=require("vue"),t=require("./index-CSe17yC0.js"),n=require("./useDefaults-Bq2idhQU.js"),o=require("./index-BqHkgtNq.js"),l=require("./useId-BOa4n5pr.js"),i=require("./getElement-Ca6iEV7Z.js"),r=require("./ConditionalTeleport.vue_vue_type_script_lang-6a2bI705.js"),a=require("./useShowHide-DsVWrWmv.js"),u=require("./_plugin-vue_export-helper-CC_fc8JW.js"),s=["top","right","bottom","left"],c=["start","end"],f=s.reduce(((e,t)=>e.concat(t,t+"-"+c[0],t+"-"+c[1])),[]),d=Math.min,p=Math.max,m=Math.round,v=Math.floor,h=e=>({x:e,y:e}),g={left:"right",right:"left",bottom:"top",top:"bottom"},y={start:"end",end:"start"};function w(e,t,n){return p(e,d(t,n))}function x(e,t){return"function"==typeof e?e(t):e}function b(e){return e.split("-")[0]}function R(e){return e.split("-")[1]}function B(e){return"x"===e?"y":"x"}function E(e){return"y"===e?"height":"width"}function T(e){return["top","bottom"].includes(b(e))?"y":"x"}function L(e){return B(T(e))}function C(e,t,n){void 0===n&&(n=!1);const o=R(e),l=L(e),i=E(l);let r="x"===l?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(r=S(r)),[r,S(r)]}function A(e){return e.replace(/start|end/g,(e=>y[e]))}function S(e){return e.replace(/left|right|bottom|top/g,(e=>g[e]))}function k(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}}function D(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function P(e,t,n){let{reference:o,floating:l}=e;const i=T(t),r=L(t),a=E(r),u=b(t),s="y"===i,c=o.x+o.width/2-l.width/2,f=o.y+o.height/2-l.height/2,d=o[a]/2-l[a]/2;let p;switch(u){case"top":p={x:c,y:o.y-l.height};break;case"bottom":p={x:c,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-l.width,y:f};break;default:p={x:o.x,y:o.y}}switch(R(t)){case"start":p[r]-=d*(n&&s?-1:1);break;case"end":p[r]+=d*(n&&s?-1:1)}return p}async function _(e,t){var n;void 0===t&&(t={});const{x:o,y:l,platform:i,rects:r,elements:a,strategy:u}=e,{boundary:s="clippingAncestors",rootBoundary:c="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=x(t,e),m=k(p),v=a[d?"floating"===f?"reference":"floating":f],h=D(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(v)))||n?v:v.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:s,rootBoundary:c,strategy:u})),g="floating"===f?{x:o,y:l,width:r.floating.width,height:r.floating.height}:r.reference,y=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),w=await(null==i.isElement?void 0:i.isElement(y))&&await(null==i.getScale?void 0:i.getScale(y))||{x:1,y:1},b=D(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:g,offsetParent:y,strategy:u}):g);return{top:(h.top-b.top+m.top)/w.y,bottom:(b.bottom-h.bottom+m.bottom)/w.y,left:(h.left-b.left+m.left)/w.x,right:(b.right-h.right+m.right)/w.x}}function H(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function O(e){return s.some((t=>e[t]>=0))}function V(e){const t=d(...e.map((e=>e.left))),n=d(...e.map((e=>e.top)));return{x:t,y:n,width:p(...e.map((e=>e.right)))-t,height:p(...e.map((e=>e.bottom)))-n}}function M(){return"undefined"!=typeof window}function F(e){return z(e)?(e.nodeName||"").toLowerCase():"#document"}function N(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function $(e){var t;return null==(t=(z(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function z(e){return!!M()&&(e instanceof Node||e instanceof N(e).Node)}function W(e){return!!M()&&(e instanceof Element||e instanceof N(e).Element)}function j(e){return!!M()&&(e instanceof HTMLElement||e instanceof N(e).HTMLElement)}function q(e){return!(!M()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof N(e).ShadowRoot)}function I(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(l)}function X(e){return["table","td","th"].includes(F(e))}function Y(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(n){return!1}}))}function U(e){const t=Z(),n=W(e)?J(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function Z(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function G(e){return["html","body","#document"].includes(F(e))}function J(e){return N(e).getComputedStyle(e)}function K(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if("html"===F(e))return e;const t=e.assignedSlot||e.parentNode||q(e)&&e.host||$(e);return q(t)?t.host:t}function ee(e){const t=Q(e);return G(t)?e.ownerDocument?e.ownerDocument.body:e.body:j(t)&&I(t)?t:ee(t)}function te(e,t,n){var o;void 0===t&&(t=[]),void 0===n&&(n=!0);const l=ee(e),i=l===(null==(o=e.ownerDocument)?void 0:o.body),r=N(l);if(i){const e=ne(r);return t.concat(r,r.visualViewport||[],I(l)?l:[],e&&n?te(e):[])}return t.concat(l,te(l,[],n))}function ne(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function oe(e){const t=J(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=j(e),i=l?e.offsetWidth:n,r=l?e.offsetHeight:o,a=m(n)!==i||m(o)!==r;return a&&(n=i,o=r),{width:n,height:o,$:a}}function le(e){return W(e)?e:e.contextElement}function ie(e){const t=le(e);if(!j(t))return h(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:i}=oe(t);let r=(i?m(n.width):n.width)/o,a=(i?m(n.height):n.height)/l;return r&&Number.isFinite(r)||(r=1),a&&Number.isFinite(a)||(a=1),{x:r,y:a}}const re=h(0);function ae(e){const t=N(e);return Z()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:re}function ue(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const l=e.getBoundingClientRect(),i=le(e);let r=h(1);t&&(o?W(o)&&(r=ie(o)):r=ie(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==N(e))&&t}(i,n,o)?ae(i):h(0);let u=(l.left+a.x)/r.x,s=(l.top+a.y)/r.y,c=l.width/r.x,f=l.height/r.y;if(i){const e=N(i),t=o&&W(o)?N(o):o;let n=e,l=ne(n);for(;l&&o&&t!==n;){const e=ie(l),t=l.getBoundingClientRect(),o=J(l),i=t.left+(l.clientLeft+parseFloat(o.paddingLeft))*e.x,r=t.top+(l.clientTop+parseFloat(o.paddingTop))*e.y;u*=e.x,s*=e.y,c*=e.x,f*=e.y,u+=i,s+=r,n=N(l),l=ne(n)}}return D({width:c,height:f,x:u,y:s})}function se(e,t){const n=K(e).scrollLeft;return t?t.left+n:ue($(e)).left+n}function ce(e,t,n){void 0===n&&(n=!1);const o=e.getBoundingClientRect();return{x:o.left+t.scrollLeft-(n?0:se(e,o)),y:o.top+t.scrollTop}}function fe(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=N(e),o=$(e),l=n.visualViewport;let i=o.clientWidth,r=o.clientHeight,a=0,u=0;if(l){i=l.width,r=l.height;const e=Z();(!e||e&&"fixed"===t)&&(a=l.offsetLeft,u=l.offsetTop)}return{width:i,height:r,x:a,y:u}}(e,n);else if("document"===t)o=function(e){const t=$(e),n=K(e),o=e.ownerDocument.body,l=p(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=p(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let r=-n.scrollLeft+se(e);const a=-n.scrollTop;return"rtl"===J(o).direction&&(r+=p(t.clientWidth,o.clientWidth)-l),{width:l,height:i,x:r,y:a}}($(e));else if(W(t))o=function(e,t){const n=ue(e,!0,"fixed"===t),o=n.top+e.clientTop,l=n.left+e.clientLeft,i=j(e)?ie(e):h(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:l*i.x,y:o*i.y}}(t,n);else{const n=ae(e);o={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return D(o)}function de(e,t){const n=Q(e);return!(n===t||!W(n)||G(n))&&("fixed"===J(n).position||de(n,t))}function pe(e,t,n){const o=j(t),l=$(t),i="fixed"===n,r=ue(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const u=h(0);if(o||!o&&!i)if(("body"!==F(t)||I(l))&&(a=K(t)),o){const e=ue(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else l&&(u.x=se(l));const s=!l||o||i?h(0):ce(l,a);return{x:r.left+a.scrollLeft-u.x-s.x,y:r.top+a.scrollTop-u.y-s.y,width:r.width,height:r.height}}function me(e){return"static"===J(e).position}function ve(e,t){if(!j(e)||"fixed"===J(e).position)return null;if(t)return t(e);let n=e.offsetParent;return $(e)===n&&(n=n.ownerDocument.body),n}function he(e,t){const n=N(e);if(Y(e))return n;if(!j(e)){let t=Q(e);for(;t&&!G(t);){if(W(t)&&!me(t))return t;t=Q(t)}return n}let o=ve(e,t);for(;o&&X(o)&&me(o);)o=ve(o,t);return o&&G(o)&&me(o)&&!U(o)?n:o||function(e){let t=Q(e);for(;j(t)&&!G(t);){if(U(t))return t;if(Y(t))return null;t=Q(t)}return null}(e)||n}const ge={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const i="fixed"===l,r=$(o),a=!!t&&Y(t.floating);if(o===r||a&&i)return n;let u={scrollLeft:0,scrollTop:0},s=h(1);const c=h(0),f=j(o);if((f||!f&&!i)&&(("body"!==F(o)||I(r))&&(u=K(o)),j(o))){const e=ue(o);s=ie(o),c.x=e.x+o.clientLeft,c.y=e.y+o.clientTop}const d=!r||f||i?h(0):ce(r,u,!0);return{width:n.width*s.x,height:n.height*s.y,x:n.x*s.x-u.scrollLeft*s.x+c.x+d.x,y:n.y*s.y-u.scrollTop*s.y+c.y+d.y}},getDocumentElement:$,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const i=[..."clippingAncestors"===n?Y(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let o=te(e,[],!1).filter((e=>W(e)&&"body"!==F(e))),l=null;const i="fixed"===J(e).position;let r=i?Q(e):e;for(;W(r)&&!G(r);){const t=J(r),n=U(r);n||"fixed"!==t.position||(l=null),(i?!n&&!l:!n&&"static"===t.position&&l&&["absolute","fixed"].includes(l.position)||I(r)&&!n&&de(e,r))?o=o.filter((e=>e!==r)):l=t,r=Q(r)}return t.set(e,o),o}(t,this._c):[].concat(n),o],r=i[0],a=i.reduce(((e,n)=>{const o=fe(t,n,l);return e.top=p(o.top,e.top),e.right=d(o.right,e.right),e.bottom=d(o.bottom,e.bottom),e.left=p(o.left,e.left),e}),fe(t,r,l));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:he,getElementRects:async function(e){const t=this.getOffsetParent||he,n=this.getDimensions,o=await n(e.floating);return{reference:pe(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}=oe(e);return{width:t,height:n}},getScale:ie,isElement:W,isRTL:function(e){return"rtl"===J(e).direction}};function ye(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:l=!0,ancestorResize:i=!0,elementResize:r="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,s=le(e),c=l||i?[...s?te(s):[],...te(t)]:[];c.forEach((e=>{l&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=s&&a?function(e,t){let n,o=null;const l=$(e);function i(){var e;clearTimeout(n),null==(e=o)||e.disconnect(),o=null}return function r(a,u){void 0===a&&(a=!1),void 0===u&&(u=1),i();const{left:s,top:c,width:f,height:m}=e.getBoundingClientRect();if(a||t(),!f||!m)return;const h={rootMargin:-v(c)+"px "+-v(l.clientWidth-(s+f))+"px "+-v(l.clientHeight-(c+m))+"px "+-v(s)+"px",threshold:p(0,d(1,u))||1};let g=!0;function y(e){const t=e[0].intersectionRatio;if(t!==u){if(!g)return r();t?r(!1,t):n=setTimeout((()=>{r(!1,1e-7)}),1e3)}g=!1}try{o=new IntersectionObserver(y,{...h,root:l.ownerDocument})}catch(w){o=new IntersectionObserver(y,h)}o.observe(e)}(!0),i}(s,n):null;let m,h=-1,g=null;r&&(g=new ResizeObserver((e=>{let[o]=e;o&&o.target===s&&g&&(g.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame((()=>{var e;null==(e=g)||e.observe(t)}))),n()})),s&&!u&&g.observe(s),g.observe(t));let y=u?ue(e):null;return u&&function t(){const o=ue(e);!y||o.x===y.x&&o.y===y.y&&o.width===y.width&&o.height===y.height||n();y=o,m=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach((e=>{l&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==f||f(),null==(e=g)||e.disconnect(),g=null,u&&cancelAnimationFrame(m)}}const we=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:l,y:i,placement:r,middlewareData:a}=t,u=await async function(e,t){const{placement:n,platform:o,elements:l}=e,i=await(null==o.isRTL?void 0:o.isRTL(l.floating)),r=b(n),a=R(n),u="y"===T(n),s=["left","top"].includes(r)?-1:1,c=i&&u?-1:1,f=x(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:m}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:f.mainAxis||0,crossAxis:f.crossAxis||0,alignmentAxis:f.alignmentAxis};return a&&"number"==typeof m&&(p="end"===a?-1*m:m),u?{x:p*c,y:d*s}:{x:d*s,y:p*c}}(t,e);return r===(null==(n=a.offset)?void 0:n.placement)&&null!=(o=a.arrow)&&o.alignmentOffset?{}:{x:l+u.x,y:i+u.y,data:{...u,placement:r}}}}},xe=function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,l;const{rects:i,middlewareData:r,placement:a,platform:u,elements:s}=t,{crossAxis:c=!1,alignment:d,allowedPlacements:p=f,autoAlignment:m=!0,...v}=x(e,t),h=void 0!==d||p===f?function(e,t,n){return(e?[...n.filter((t=>R(t)===e)),...n.filter((t=>R(t)!==e))]:n.filter((e=>b(e)===e))).filter((n=>!e||R(n)===e||!!t&&A(n)!==n))}(d||null,m,p):p,g=await _(t,v),y=(null==(n=r.autoPlacement)?void 0:n.index)||0,w=h[y];if(null==w)return{};const B=C(w,i,await(null==u.isRTL?void 0:u.isRTL(s.floating)));if(a!==w)return{reset:{placement:h[0]}};const E=[g[b(w)],g[B[0]],g[B[1]]],T=[...(null==(o=r.autoPlacement)?void 0:o.overflows)||[],{placement:w,overflows:E}],L=h[y+1];if(L)return{data:{index:y+1,overflows:T},reset:{placement:L}};const S=T.map((e=>{const t=R(e.placement);return[e.placement,t&&c?e.overflows.slice(0,2).reduce(((e,t)=>e+t),0):e.overflows[0],e.overflows]})).sort(((e,t)=>e[1]-t[1])),k=(null==(l=S.filter((e=>e[2].slice(0,R(e[0])?2:3).every((e=>e<=0))))[0])?void 0:l[0])||S[0][0];return k!==a?{data:{index:y+1,overflows:T},reset:{placement:k}}:{}}}},be=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:i=!0,crossAxis:r=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=x(e,t),s={x:n,y:o},c=await _(t,u),f=T(b(l)),d=B(f);let p=s[d],m=s[f];if(i){const e="y"===d?"bottom":"right";p=w(p+c["y"===d?"top":"left"],p,p-c[e])}if(r){const e="y"===f?"bottom":"right";m=w(m+c["y"===f?"top":"left"],m,m-c[e])}const v=a.fn({...t,[d]:p,[f]:m});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[d]:i,[f]:r}}}}}},Re=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:l,middlewareData:i,rects:r,initialPlacement:a,platform:u,elements:s}=t,{mainAxis:c=!0,crossAxis:f=!0,fallbackPlacements:d,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:m="none",flipAlignment:v=!0,...h}=x(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const g=b(l),y=T(a),w=b(a)===a,B=await(null==u.isRTL?void 0:u.isRTL(s.floating)),E=d||(w||!v?[S(a)]:function(e){const t=S(e);return[A(e),t,A(t)]}(a)),L="none"!==m;!d&&L&&E.push(...function(e,t,n,o){const l=R(e);let i=function(e,t,n){const o=["left","right"],l=["right","left"],i=["top","bottom"],r=["bottom","top"];switch(e){case"top":case"bottom":return n?t?l:o:t?o:l;case"left":case"right":return t?i:r;default:return[]}}(b(e),"start"===n,o);return l&&(i=i.map((e=>e+"-"+l)),t&&(i=i.concat(i.map(A)))),i}(a,v,m,B));const k=[a,...E],D=await _(t,h),P=[];let H=(null==(o=i.flip)?void 0:o.overflows)||[];if(c&&P.push(D[g]),f){const e=C(l,r,B);P.push(D[e[0]],D[e[1]])}if(H=[...H,{placement:l,overflows:P}],!P.every((e=>e<=0))){var O,V;const e=((null==(O=i.flip)?void 0:O.index)||0)+1,t=k[e];if(t)return{data:{index:e,overflows:H},reset:{placement:t}};let n=null==(V=H.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:V.placement;if(!n)switch(p){case"bestFit":{var M;const e=null==(M=H.filter((e=>{if(L){const t=T(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:M[0];e&&(n=e);break}case"initialPlacement":n=a}if(l!==n)return{reset:{placement:n}}}return{}}}},Be=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:l,rects:i,platform:r,elements:a}=t,{apply:u=()=>{},...s}=x(e,t),c=await _(t,s),f=b(l),m=R(l),v="y"===T(l),{width:h,height:g}=i.floating;let y,w;"top"===f||"bottom"===f?(y=f,w=m===(await(null==r.isRTL?void 0:r.isRTL(a.floating))?"start":"end")?"left":"right"):(w=f,y="end"===m?"top":"bottom");const B=g-c.top-c.bottom,E=h-c.left-c.right,L=d(g-c[y],B),C=d(h-c[w],E),A=!t.middlewareData.shift;let S=L,k=C;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(k=E),null!=(o=t.middlewareData.shift)&&o.enabled.y&&(S=B),A&&!m){const e=p(c.left,0),t=p(c.right,0),n=p(c.top,0),o=p(c.bottom,0);v?k=h-2*(0!==e||0!==t?e+t:p(c.left,c.right)):S=g-2*(0!==n||0!==o?n+o:p(c.top,c.bottom))}await u({...t,availableWidth:k,availableHeight:S});const D=await r.getDimensions(a.floating);return h!==D.width||g!==D.height?{reset:{rects:!0}}:{}}}},Ee=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...l}=x(e,t);switch(o){case"referenceHidden":{const e=H(await _(t,{...l,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:O(e)}}}case"escaped":{const e=H(await _(t,{...l,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:O(e)}}}default:return{}}}}},Te=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:l,rects:i,platform:r,elements:a,middlewareData:u}=t,{element:s,padding:c=0}=x(e,t)||{};if(null==s)return{};const f=k(c),p={x:n,y:o},m=L(l),v=E(m),h=await r.getDimensions(s),g="y"===m,y=g?"top":"left",b=g?"bottom":"right",B=g?"clientHeight":"clientWidth",T=i.reference[v]+i.reference[m]-p[m]-i.floating[v],C=p[m]-i.reference[m],A=await(null==r.getOffsetParent?void 0:r.getOffsetParent(s));let S=A?A[B]:0;S&&await(null==r.isElement?void 0:r.isElement(A))||(S=a.floating[B]||i.floating[v]);const D=T/2-C/2,P=S/2-h[v]/2-1,_=d(f[y],P),H=d(f[b],P),O=_,V=S-h[v]-H,M=S/2-h[v]/2+D,F=w(O,M,V),N=!u.arrow&&null!=R(l)&&M!==F&&i.reference[v]/2-(M<O?_:H)-h[v]/2<0,$=N?M<O?M-O:M-V:0;return{[m]:p[m]+$,data:{[m]:F,centerOffset:M-F-$,...N&&{alignmentOffset:$}},reset:N}}}),Le=function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:l,platform:i,strategy:r}=t,{padding:a=2,x:u,y:s}=x(e,t),c=Array.from(await(null==i.getClientRects?void 0:i.getClientRects(o.reference))||[]),f=function(e){const t=e.slice().sort(((e,t)=>e.y-t.y)),n=[];let o=null;for(let l=0;l<t.length;l++){const e=t[l];!o||e.y-o.y>o.height/2?n.push([e]):n[n.length-1].push(e),o=e}return n.map((e=>D(V(e))))}(c),m=D(V(c)),v=k(a);const h=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&f[0].left>f[1].right&&null!=u&&null!=s)return f.find((e=>u>e.left-v.left&&u<e.right+v.right&&s>e.top-v.top&&s<e.bottom+v.bottom))||m;if(f.length>=2){if("y"===T(n)){const e=f[0],t=f[f.length-1],o="top"===b(n),l=e.top,i=t.bottom,r=o?e.left:t.left,a=o?e.right:t.right;return{top:l,bottom:i,left:r,right:a,width:a-r,height:i-l,x:r,y:l}}const e="left"===b(n),t=p(...f.map((e=>e.right))),o=d(...f.map((e=>e.left))),l=f.filter((n=>e?n.left===o:n.right===t)),i=l[0].top,r=l[l.length-1].bottom;return{top:i,bottom:r,left:o,right:t,width:t-o,height:r-i,x:o,y:i}}return m}},floating:o.floating,strategy:r});return l.reference.x!==h.reference.x||l.reference.y!==h.reference.y||l.reference.width!==h.reference.width||l.reference.height!==h.reference.height?{reset:{rects:h}}:{}}}},Ce=(e,t,n)=>{const o=new Map,l={platform:ge,...n},i={...l.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:l="absolute",middleware:i=[],platform:r}=n,a=i.filter(Boolean),u=await(null==r.isRTL?void 0:r.isRTL(t));let s=await r.getElementRects({reference:e,floating:t,strategy:l}),{x:c,y:f}=P(s,o,u),d=o,p={},m=0;for(let v=0;v<a.length;v++){const{name:n,fn:i}=a[v],{x:h,y:g,data:y,reset:w}=await i({x:c,y:f,initialPlacement:o,placement:d,strategy:l,middlewareData:p,rects:s,platform:r,elements:{reference:e,floating:t}});c=null!=h?h:c,f=null!=g?g:f,p={...p,[n]:{...p[n],...y}},w&&m<=50&&(m++,"object"==typeof w&&(w.placement&&(d=w.placement),w.rects&&(s=!0===w.rects?await r.getElementRects({reference:e,floating:t,strategy:l}):w.rects),({x:c,y:f}=P(s,d,u))),v=-1)}return{x:c,y:f,placement:d,strategy:l,middlewareData:p}})(e,t,{...l,platform:i})};function Ae(e){if(function(e){return null!=e&&"object"==typeof e&&"$el"in e}(e)){const t=e.$el;return z(t)&&"#comment"===F(t)?null:t}return e}function Se(t){return"function"==typeof t?t():e.unref(t)}function ke(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function De(e,t){const n=ke(e);return Math.round(t*n)/n}function Pe(t,n,o){void 0===o&&(o={});const l=o.whileElementsMounted,i=e.computed((()=>{var e;return null==(e=Se(o.open))||e})),r=e.computed((()=>Se(o.middleware))),a=e.computed((()=>{var e;return null!=(e=Se(o.placement))?e:"bottom"})),u=e.computed((()=>{var e;return null!=(e=Se(o.strategy))?e:"absolute"})),s=e.computed((()=>{var e;return null==(e=Se(o.transform))||e})),c=e.computed((()=>Ae(t.value))),f=e.computed((()=>Ae(n.value))),d=e.ref(0),p=e.ref(0),m=e.ref(u.value),v=e.ref(a.value),h=e.shallowRef({}),g=e.ref(!1),y=e.computed((()=>{const e={position:m.value,left:"0",top:"0"};if(!f.value)return e;const t=De(f.value,d.value),n=De(f.value,p.value);return s.value?{...e,transform:"translate("+t+"px, "+n+"px)",...ke(f.value)>=1.5&&{willChange:"transform"}}:{position:m.value,left:t+"px",top:n+"px"}}));let w;function x(){if(null==c.value||null==f.value)return;const e=i.value;Ce(c.value,f.value,{middleware:r.value,placement:a.value,strategy:u.value}).then((t=>{d.value=t.x,p.value=t.y,m.value=t.strategy,v.value=t.placement,h.value=t.middlewareData,g.value=!1!==e}))}function b(){"function"==typeof w&&(w(),w=void 0)}return e.watch([r,a,u,i],x,{flush:"sync"}),e.watch([c,f],(function(){b(),void 0!==l?null==c.value||null==f.value||(w=l(c.value,f.value,x)):x()}),{flush:"sync"}),e.watch(i,(function(){i.value||(g.value=!1)}),{flush:"sync"}),e.getCurrentScope()&&e.onScopeDispose(b),{x:e.shallowReadonly(d),y:e.shallowReadonly(p),strategy:e.shallowReadonly(m),placement:e.shallowReadonly(v),middlewareData:e.shallowReadonly(h),isPositioned:e.shallowReadonly(g),floatingStyles:y,update:x}}const _e=o.createSharedComposable(t.useMouse),He=["id"],Oe=["id"],Ve=e.defineComponent({inheritAttrs:!1,__name:"BPopover",props:e.mergeModels({boundary:{default:"clippingAncestors"},boundaryPadding:{default:void 0},click:{type:Boolean,default:!1},closeOnHide:{type:Boolean,default:!1},content:{default:void 0},customClass:{default:""},delay:{default:()=>({show:100,hide:300})},floatingMiddleware:{default:void 0},hideMargin:{default:2},id:{default:void 0},inline:{type:Boolean,default:!1},manual:{type:Boolean,default:!1},noAutoClose:{type:Boolean,default:!1},noFlip:{type:Boolean,default:!1},noHide:{type:Boolean,default:!1},noShift:{type:Boolean,default:!1},noSize:{type:Boolean,default:!1},noninteractive:{type:Boolean,default:!1},offset:{default:null},placement:{default:"top"},realtime:{type:Boolean,default:!1},reference:{default:null},strategy:{default:"absolute"},target:{default:null},title:{default:void 0},tooltip:{type:Boolean,default:!1},variant:{default:null},teleportDisabled:{type:Boolean,default:!1},teleportTo:{default:void 0},initialAnimation:{type:Boolean,default:!1},noAnimation:{type:Boolean},noFade:{type:Boolean,default:!1},lazy:{type:Boolean,default:!1},unmountLazy:{type:Boolean,default:!1},show:{type:Boolean,default:!1},transProps:{},visible:{type:Boolean,default:!1}},{modelValue:{type:Boolean,default:!1},modelModifiers:{}}),emits:e.mergeModels(["pointerleave","blur","click-outside","close-on-hide","hide","hide-prevented","hidden","show","show-prevented","shown","toggle","toggle-prevented"],["update:modelValue"]),setup(u,{expose:s,emit:c}){const f=u,d=n.useDefaults(f,"BPopover"),p=c,m=e.useSlots(),v=e.useModel(u,"modelValue"),h=l.useId((()=>d.id),"popover"),g=e.ref(!1),y=e.useTemplateRef("_element"),w=e.useTemplateRef("_content"),x=e.useTemplateRef("_arrow"),b=e.useTemplateRef("_placeholder"),R=e.ref(null),B=e.ref(null),E=e.computed((()=>d.placement.startsWith("auto"))),T=o.useToNumber((()=>d.offset??NaN)),L=e.computed((()=>$e(d.boundary)?d.boundary:void 0)),C=e.computed((()=>ze(d.boundary)?d.boundary:void 0)),A=e.ref({}),S=e.computed((()=>{if(void 0!==d.floatingMiddleware)return d.floatingMiddleware;const e=null!==d.offset?T.value:d.tooltip?6:8,t=[we(e)];var n;return!1!==d.noFlip||E.value||t.push(Re({boundary:L.value,rootBoundary:C.value,padding:d.boundaryPadding})),E.value&&t.push(xe({alignment:d.placement.split("-")[1]||void 0,boundary:L.value,rootBoundary:C.value,padding:d.boundaryPadding})),!1===d.noShift&&t.push(be({boundary:L.value,rootBoundary:C.value,padding:d.boundaryPadding})),!1===d.noHide&&t.push(Ee({boundary:L.value,rootBoundary:C.value,padding:d.boundaryPadding})),!0===d.inline&&t.push(Le()),t.push({name:"arrow",options:n={element:x,padding:10},fn(e){const t=Ae(Se(n.element));return null==t?{}:Te({element:t,padding:n.padding}).fn(e)}}),!1===d.noSize&&t.push(Be({boundary:L.value,rootBoundary:C.value,padding:d.boundaryPadding,apply({availableWidth:e,availableHeight:t}){var n,o;A.value={maxHeight:t>=((null==(n=w.value)?void 0:n.scrollHeight)??0)?void 0:t?`${Math.max(0,t)}px`:void 0,maxWidth:e>=((null==(o=w.value)?void 0:o.scrollWidth)??0)?void 0:e?`${Math.max(0,e)}px`:void 0}}})),t})),k=e.computed((()=>E.value?void 0:d.placement)),{floatingStyles:D,middlewareData:P,placement:_,update:H}=Pe(R,y,{placement:k,middleware:S,strategy:e.toRef((()=>d.strategy)),whileElementsMounted:(...e)=>ye(...e,{animationFrame:d.realtime})}),O=e.ref({position:"absolute"});e.watch(P,(e=>{var t,n;if(!1===d.noHide&&((null==(t=e.hide)?void 0:t.referenceHidden)&&!g.value&&V.value?!d.closeOnHide||d.noAutoClose||d.manual?(X.value=!0,g.value=!0):$("close-on-hide"):X.value&&!(null==(n=e.hide)?void 0:n.referenceHidden)&&(X.value=!1,g.value=!1)),e.arrow){const{x:t,y:n}=e.arrow;O.value={position:"absolute",top:n?`${n}px`:"",left:t?`${t}px`:""}}}));const{showRef:V,hide:M,show:F,toggle:N,throttleHide:$,computedNoAnimation:z,transitionProps:W,contentShowing:j,isVisible:q,renderRef:I,localTemporaryHide:X}=a.useShowHide(v,d,p,y,h,{showFn:()=>{g.value&&H()}}),Y=e.computed((()=>{const e=d.tooltip?"tooltip":"popover";return[e,`b-${e}`,{[`b-${e}-${d.variant}`]:null!==d.variant,show:q.value&&!g.value,fade:!z.value,[`${d.customClass}`]:void 0!==d.customClass,[`bs-${e}-${Fe(_.value)}`]:void 0!==_.value}]})),{x:U,y:Z}=_e();let G;const J=e=>{var t,n,o;const l="number"==typeof d.delay?d.delay:(null==(t=d.delay)?void 0:t.hide)||0,{triggerIsOutside:i,isOutside:r}=(()=>{var e,t;const n=null==(e=B.value)?void 0:e.getBoundingClientRect(),o=null==(t=y.value)?void 0:t.getBoundingClientRect(),l=parseInt(d.hideMargin,10)||0,i=(null==window?void 0:window.scrollX)||0,r=(null==window?void 0:window.scrollY)||0;return{triggerIsOutside:!n||U.value<n.left+i-l||U.value>n.right+i+l||Z.value<n.top+r-l||Z.value>n.bottom+r+l,isOutside:!o||U.value<o.left+i-l||U.value>o.right+i+l||Z.value<o.top+r-l||Z.value>o.bottom+r+l}})();!d.noninteractive&&r&&i&&!(null==(n=y.value)?void 0:n.contains(null==document?void 0:document.activeElement))&&!(null==(o=B.value)?void 0:o.contains(null==document?void 0:document.activeElement))||d.noninteractive&&i?M(null==e?void 0:e.type):(G&&clearTimeout(G),G=setTimeout((()=>{J(e)}),l<50?50:l))};e.watch(q,(()=>{H()})),s({hide:M,show:F,toggle:N});const K=e=>{V.value?M("click"===e.type?"click":"toggle"):F()},Q=()=>{var t;if(d.target){const t=i.getElement(e.toValue(d.target));t?B.value=t:console.warn("Target element not found",d.target)}else B.value=null==(t=b.value)?void 0:t.nextElementSibling;if(d.reference){const t=i.getElement(e.toValue(d.reference));t?R.value=t:console.warn("Reference element not found",d.reference)}else R.value=B.value;B.value&&!d.manual&&(d.click?B.value.addEventListener("click",K):(B.value.addEventListener("pointerenter",F),B.value.addEventListener("pointerleave",J),B.value.addEventListener("focus",F),B.value.addEventListener("blur",J)))},ee=()=>{B.value&&(B.value.removeEventListener("click",K),B.value.removeEventListener("pointerenter",F),B.value.removeEventListener("pointerleave",J),B.value.removeEventListener("focus",F),B.value.removeEventListener("blur",J))};return t.onClickOutside(y,(()=>{V.value&&d.click&&!d.noAutoClose&&!d.manual&&M("click-outside")}),{ignore:[B]}),e.watch([()=>d.click,()=>d.target,()=>d.reference],(()=>{ee(),Q()})),e.onMounted((()=>{Q(),e.nextTick((()=>{H()}))})),e.onBeforeUnmount(ee),(t,n)=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[e.createElementVNode("span",{id:e.unref(h)+"_placeholder",ref:"_placeholder"},null,8,He),e.renderSlot(t.$slots,"target",{show:e.unref(F),hide:e.unref(M),toggle:e.unref(N),visible:e.unref(V)},void 0,!0),e.createVNode(r._sfc_main,{to:e.unref(d).teleportTo,disabled:!e.unref(d).teleportTo||e.unref(d).teleportDisabled},{default:e.withCtx((()=>[e.unref(I)||e.unref(j)?(e.openBlock(),e.createBlock(e.Transition,e.mergeProps({key:0},e.unref(W),{appear:v.value||e.unref(d).visible}),{default:e.withCtx((()=>[e.withDirectives(e.createElementVNode("div",e.mergeProps({id:e.unref(h)},t.$attrs,{ref:"_element",class:Y.value,role:"tooltip",tabindex:"-1",style:e.unref(D)}),[e.createElementVNode("div",{ref:"_arrow",class:e.normalizeClass((e.unref(d).tooltip?"tooltip":"popover")+"-arrow"),style:e.normalizeStyle(O.value),"data-popper-arrow":""},null,6),e.createElementVNode("div",{ref:"_content",class:"overflow-auto",style:e.normalizeStyle(A.value)},[e.unref(d).title||m.title?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(["position-sticky top-0",e.unref(d).tooltip?"tooltip-inner":"popover-header"])},[e.renderSlot(t.$slots,"title",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(d).title),1)]),!0)],2)):e.createCommentVNode("",!0),e.unref(d).tooltip&&!m.title&&!e.unref(d).title||!e.unref(d).tooltip?(e.openBlock(),e.createElementBlock("div",{key:1,class:e.normalizeClass(e.unref(d).tooltip?"tooltip-inner":"popover-body")},[e.renderSlot(t.$slots,"default",{},(()=>[e.createTextVNode(e.toDisplayString(e.unref(d).content),1)]),!0)],2)):e.createCommentVNode("",!0)],4)],16,Oe),[[e.vShow,e.unref(V)&&!g.value]])])),_:3},16,["appear"])):e.createCommentVNode("",!0)])),_:3},8,["to","disabled"])],64))}}),Me=u._export_sfc(Ve,[["__scopeId","data-v-08119d6e"]]),Fe=e=>{const[t]=e.split("-");switch(t){case"left":return"start";case"right":return"end";default:return t}},Ne=e=>"object"!=typeof e||!1!==e.active,$e=e=>"clippingAncestors"===e||e instanceof Element||Array.isArray(e),ze=e=>!$e(e);exports.BPopover=Me,exports.autoUpdate=ye,exports.bind=(t,n,o)=>{var l;const i=document.createElement("span");n.modifiers.body?document.body.appendChild(i):n.modifiers.child?t.appendChild(i):null==(l=t.parentNode)||l.insertBefore(i,t.nextSibling),e.render(e.h(Me,o),i),t.$__element=i},exports.flip=Re,exports.isBoundary=$e,exports.isRootBoundary=ze,exports.offset=we,exports.resolveActiveStatus=Ne,exports.resolveContent=(e,t)=>{if(!Ne(e))return{};const n=void 0===e||"object"==typeof e&&!e.title&&!e.content,o=t.getAttribute("title")||t.getAttribute("data-original-title");return n?o?(t.removeAttribute("title"),t.setAttribute("data-original-title",o),{content:o}):{}:"string"==typeof e?{content:e}:{title:(null==e?void 0:e.title)?null==e?void 0:e.title:void 0,content:(null==e?void 0:e.content)?null==e?void 0:e.content:void 0}},exports.resolveDirectiveProps=(e,t)=>({target:t,modelValue:e.modifiers.show,inline:e.modifiers.inline,click:e.modifiers.click,realtime:e.modifiers.realtime,lazy:e.modifiers.lazy,placement:e.modifiers.left?"left":e.modifiers.right?"right":e.modifiers.bottom?"bottom":e.modifiers.top?"top":void 0,html:!0,..."object"==typeof e.value?e.value:void 0,...e.modifiers.interactive?{noninteractive:!1}:void 0,title:null,content:null}),exports.shift=be,exports.size=Be,exports.unbind=t=>{const n=t.$__element;n&&e.render(null,n),setTimeout((()=>{null==n||n.remove()}),0),delete t.$__element},exports.useFloating=Pe; //# sourceMappingURL=floatingUi-C5akC2Bv.js.map