bkui-vue 0.0.2-beta.72 → 0.0.2-beta.73

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 (170) hide show
  1. package/lib/affix/index.js +319 -1
  2. package/lib/alert/index.js +215 -1
  3. package/lib/animate-number/index.js +155 -1
  4. package/lib/backtop/index.js +188 -1
  5. package/lib/badge/index.js +236 -1
  6. package/lib/breadcrumb/index.js +309 -1
  7. package/lib/button/index.js +321 -1
  8. package/lib/card/index.js +274 -1
  9. package/lib/cascader/index.js +2019 -2
  10. package/lib/checkbox/index.js +542 -1
  11. package/lib/code-diff/index.js +5501 -1
  12. package/lib/collapse/index.js +518 -1
  13. package/lib/collapse-transition/index.js +178 -1
  14. package/lib/color-picker/index.js +2662 -1
  15. package/lib/components.js +530 -1
  16. package/lib/config-provider/index.js +317 -1
  17. package/lib/container/index.js +343 -1
  18. package/lib/date-picker/index.js +5481 -1
  19. package/lib/dialog/index.js +1266 -2
  20. package/lib/directives/index.js +1335 -2
  21. package/lib/dist.index.js +87 -1
  22. package/lib/divider/index.js +169 -1
  23. package/lib/dropdown/index.js +369 -1
  24. package/lib/exception/index.js +385 -1
  25. package/lib/fixed-navbar/index.js +154 -1
  26. package/lib/form/index.js +918 -1
  27. package/lib/hooks.js +73 -1
  28. package/lib/icon/angle-double-down-line.js +481 -1
  29. package/lib/icon/angle-double-left-line.js +481 -1
  30. package/lib/icon/angle-double-left.js +481 -1
  31. package/lib/icon/angle-double-right-line.js +481 -1
  32. package/lib/icon/angle-double-right.js +481 -1
  33. package/lib/icon/angle-double-up-line.js +481 -1
  34. package/lib/icon/angle-down-fill.js +481 -1
  35. package/lib/icon/angle-down-line.js +481 -1
  36. package/lib/icon/angle-down.js +481 -1
  37. package/lib/icon/angle-left.js +481 -1
  38. package/lib/icon/angle-right.js +481 -1
  39. package/lib/icon/angle-up-fill.js +481 -1
  40. package/lib/icon/angle-up.js +481 -1
  41. package/lib/icon/archive-fill.js +481 -1
  42. package/lib/icon/arrows-left.js +481 -1
  43. package/lib/icon/arrows-right.js +481 -1
  44. package/lib/icon/assistant.js +481 -1
  45. package/lib/icon/audio-fill.js +481 -1
  46. package/lib/icon/bk.js +481 -1
  47. package/lib/icon/circle.js +481 -1
  48. package/lib/icon/close-line.js +481 -1
  49. package/lib/icon/close.js +481 -1
  50. package/lib/icon/code.js +481 -1
  51. package/lib/icon/cog-shape.js +481 -1
  52. package/lib/icon/collapse-left.js +481 -1
  53. package/lib/icon/copy-shape.js +481 -1
  54. package/lib/icon/copy.js +481 -1
  55. package/lib/icon/data-shape.js +481 -1
  56. package/lib/icon/del.js +481 -1
  57. package/lib/icon/doc-fill.js +481 -1
  58. package/lib/icon/done.js +481 -1
  59. package/lib/icon/down-shape.js +481 -1
  60. package/lib/icon/down-small.js +481 -1
  61. package/lib/icon/edit-line.js +481 -1
  62. package/lib/icon/ellipsis.js +481 -1
  63. package/lib/icon/enlarge-line.js +481 -1
  64. package/lib/icon/error.js +481 -1
  65. package/lib/icon/excel-fill.js +481 -1
  66. package/lib/icon/exclamation-circle-shape.js +481 -1
  67. package/lib/icon/eye.js +481 -1
  68. package/lib/icon/filliscreen-line.js +481 -1
  69. package/lib/icon/fix-line.js +481 -1
  70. package/lib/icon/fix-shape.js +481 -1
  71. package/lib/icon/folder-open.js +481 -1
  72. package/lib/icon/folder-shape-open.js +481 -1
  73. package/lib/icon/folder-shape.js +481 -1
  74. package/lib/icon/folder.js +481 -1
  75. package/lib/icon/funnel.js +481 -1
  76. package/lib/icon/help-document-fill.js +481 -1
  77. package/lib/icon/help-fill.js +481 -1
  78. package/lib/icon/help.js +481 -1
  79. package/lib/icon/image-fill.js +527 -1
  80. package/lib/icon/img-error.js +527 -1
  81. package/lib/icon/img-placehoulder.js +527 -1
  82. package/lib/icon/index.js +2367 -1
  83. package/lib/icon/info-line.js +527 -1
  84. package/lib/icon/info.js +527 -1
  85. package/lib/icon/left-shape.js +527 -1
  86. package/lib/icon/left-turn-line.js +527 -1
  87. package/lib/icon/narrow-line.js +527 -1
  88. package/lib/icon/original.js +527 -1
  89. package/lib/icon/pdf-fill.js +527 -1
  90. package/lib/icon/play-shape.js +527 -1
  91. package/lib/icon/plus.js +527 -1
  92. package/lib/icon/ppt-fill.js +527 -1
  93. package/lib/icon/qq.js +527 -1
  94. package/lib/icon/right-shape.js +527 -1
  95. package/lib/icon/right-turn-line.js +527 -1
  96. package/lib/icon/search.js +527 -1
  97. package/lib/icon/share.js +527 -1
  98. package/lib/icon/spinner.js +527 -1
  99. package/lib/icon/success.js +527 -1
  100. package/lib/icon/switcher-loading.js +527 -1
  101. package/lib/icon/text-file.js +527 -1
  102. package/lib/icon/text-fill.js +527 -1
  103. package/lib/icon/transfer.js +527 -1
  104. package/lib/icon/tree-application-shape.js +527 -1
  105. package/lib/icon/unfull-screen.js +527 -1
  106. package/lib/icon/unvisible.js +527 -1
  107. package/lib/icon/up-shape.js +527 -1
  108. package/lib/icon/upload.js +527 -1
  109. package/lib/icon/video-fill.js +527 -1
  110. package/lib/icon/warn.js +527 -1
  111. package/lib/icon/weixin-pro.js +527 -1
  112. package/lib/icon/weixin.js +527 -1
  113. package/lib/image/index.js +593 -1
  114. package/lib/index.js +97 -1
  115. package/lib/info-box/index.js +1456 -2
  116. package/lib/input/index.js +1528 -2
  117. package/lib/link/index.js +160 -1
  118. package/lib/loading/index.js +379 -1
  119. package/lib/locale/index.js +465 -1
  120. package/lib/menu/index.js +725 -1
  121. package/lib/message/index.js +1790 -2
  122. package/lib/modal/index.js +337 -1
  123. package/lib/navigation/index.js +367 -1
  124. package/lib/notify/index.js +394 -1
  125. package/lib/overflow-title/index.js +485 -1
  126. package/lib/pagination/index.js +880 -1
  127. package/lib/plugin-popover/index.js +4067 -1
  128. package/lib/plugins/index.js +63 -1
  129. package/lib/pop-confirm/index.js +273 -1
  130. package/lib/popover/index.js +4075 -1
  131. package/lib/popover2/index.js +107 -1
  132. package/lib/preset.js +93 -1
  133. package/lib/process/index.js +1099 -2
  134. package/lib/progress/index.js +428 -1
  135. package/lib/radio/index.js +627 -1
  136. package/lib/rate/index.js +338 -1
  137. package/lib/resize-layout/index.js +430 -1
  138. package/lib/search-select/index.js +3036 -2
  139. package/lib/select/index.js +2571 -2
  140. package/lib/shared/index.js +2865 -1
  141. package/lib/sideslider/index.js +1005 -2
  142. package/lib/slider/index.js +1629 -2
  143. package/lib/steps/index.js +1163 -2
  144. package/lib/swiper/index.js +336 -1
  145. package/lib/switcher/index.js +277 -1
  146. package/lib/tab/index.js +859 -1
  147. package/lib/table/index.js +6568 -1
  148. package/lib/table-column/index.js +730 -1
  149. package/lib/tag/index.js +233 -1
  150. package/lib/tag-input/index.js +1652 -1
  151. package/lib/time-picker/index.js +71 -1
  152. package/lib/timeline/index.js +242 -1
  153. package/lib/transfer/index.js +673 -1
  154. package/lib/tree/index.js +2625 -1
  155. package/lib/upload/index.js +3193 -2
  156. package/lib/virtual-render/index.js +748 -1
  157. package/package.json +2 -1
  158. package/lib/cascader/index.js.LICENSE.txt +0 -1
  159. package/lib/dialog/index.js.LICENSE.txt +0 -1
  160. package/lib/directives/index.js.LICENSE.txt +0 -14
  161. package/lib/info-box/index.js.LICENSE.txt +0 -1
  162. package/lib/input/index.js.LICENSE.txt +0 -1
  163. package/lib/message/index.js.LICENSE.txt +0 -6
  164. package/lib/process/index.js.LICENSE.txt +0 -1
  165. package/lib/search-select/index.js.LICENSE.txt +0 -1
  166. package/lib/select/index.js.LICENSE.txt +0 -1
  167. package/lib/sideslider/index.js.LICENSE.txt +0 -1
  168. package/lib/slider/index.js.LICENSE.txt +0 -1
  169. package/lib/steps/index.js.LICENSE.txt +0 -1
  170. package/lib/upload/index.js.LICENSE.txt +0 -1
@@ -1 +1,4075 @@
1
- !function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("../shared"),require("vue"),require("../config-provider"),require("vue-types"),require("lodash"));else if("function"==typeof define&&define.amd)define(["../shared","vue","../config-provider","vue-types","lodash"],t);else{var n="object"==typeof exports?t(require("../shared"),require("vue"),require("../config-provider"),require("vue-types"),require("lodash")):t(e["../shared"],e.vue,e["../config-provider"],e["vue-types"],e.lodash);for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}(self,((e,t,n,o,r)=>(()=>{var i={8022:(e,t,n)=>{var o=n(4481),r=n(6426),i=r;i.v1=o,i.v4=r,e.exports=i},8725:e=>{for(var t=[],n=0;n<256;++n)t[n]=(n+256).toString(16).substr(1);e.exports=function(e,n){var o=n||0,r=t;return[r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],"-",r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]],r[e[o++]]].join("")}},9157:e=>{var t="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(t){var n=new Uint8Array(16);e.exports=function(){return t(n),n}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},4481:(e,t,n)=>{var o,r,i=n(9157),l=n(8725),a=0,u=0;e.exports=function(e,t,n){var c=t&&n||0,s=t||[],f=(e=e||{}).node||o,d=void 0!==e.clockseq?e.clockseq:r;if(null==f||null==d){var p=i();null==f&&(f=o=[1|p[0],p[1],p[2],p[3],p[4],p[5]]),null==d&&(d=r=16383&(p[6]<<8|p[7]))}var v=void 0!==e.msecs?e.msecs:(new Date).getTime(),m=void 0!==e.nsecs?e.nsecs:u+1,y=v-a+(m-u)/1e4;if(y<0&&void 0===e.clockseq&&(d=d+1&16383),(y<0||v>a)&&void 0===e.nsecs&&(m=0),m>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");a=v,u=m,r=d;var h=(1e4*(268435455&(v+=122192928e5))+m)%4294967296;s[c++]=h>>>24&255,s[c++]=h>>>16&255,s[c++]=h>>>8&255,s[c++]=255&h;var g=v/4294967296*1e4&268435455;s[c++]=g>>>8&255,s[c++]=255&g,s[c++]=g>>>24&15|16,s[c++]=g>>>16&255,s[c++]=d>>>8|128,s[c++]=255&d;for(var b=0;b<6;++b)s[c+b]=f[b];return t||l(s)}},6426:(e,t,n)=>{var o=n(9157),r=n(8725);e.exports=function(e,t,n){var i=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var l=(e=e||{}).random||(e.rng||o)();if(l[6]=15&l[6]|64,l[8]=63&l[8]|128,t)for(var a=0;a<16;++a)t[i+a]=l[a];return t||r(l)}},2717:e=>{"use strict";e.exports=n},4212:t=>{"use strict";t.exports=e},467:e=>{"use strict";e.exports=r},748:e=>{"use strict";e.exports=t},210:e=>{"use strict";e.exports=o}},l={};function a(e){var t=l[e];if(void 0!==t)return t.exports;var n=l[e]={exports:{}};return i[e](n,n.exports,a),n.exports}a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),a.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var u={};return(()=>{"use strict";a.r(u),a.d(u,{$bkPopover:()=>Be,PopoverProps:()=>T,default:()=>Ue});var e=a(4212),t=a(748);function n(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var l,a=!0,u=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){u=!0,l=e},f:function(){try{a||null==n.return||n.return()}finally{if(u)throw l}}}}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}var r,i=new Map;function l(e,t){var n,o=[];return Array.isArray(t.arg)?o=t.arg:(n=t.arg,"undefined"!=typeof Element&&n instanceof Element&&o.push(t.arg)),function(n,r){var i=t.instance.popperRef,l=n.target,a=null==r?void 0:r.target,u=!t||!t.instance,c=!l||!a,s=e.contains(l)||e.contains(a),f=e===l,d=o.length&&o.some((function(e){return null==e?void 0:e.contains(l)}))||o.length&&o.includes(a),p=i&&(i.contains(l)||i.contains(a));u||c||s||f||d||p||t.value(n,r)}}document.addEventListener("mousedown",(function(e){return r=e})),document.addEventListener("mouseup",(function(e){var t,o=n(i.values());try{for(o.s();!(t=o.n()).done;){var l,a=n(t.value);try{for(a.s();!(l=a.n()).done;)(0,l.value.documentHandler)(e,r)}catch(e){a.e(e)}finally{a.f()}}}catch(e){o.e(e)}finally{o.f()}}));var c={beforeMount:function(e,t){i.has(e)||i.set(e,[]),i.get(e).push({documentHandler:l(e,t),bindingFn:t.value})},updated:function(e,t){i.has(e)||i.set(e,[]);var n=i.get(e),o=n.findIndex((function(e){return e.bindingFn===t.oldValue})),r={documentHandler:l(e,t),bindingFn:t.value};o>=0?n.splice(o,1,r):n.push(r)},unmounted:function(e){i.delete(e)},install:function(e){e.directive("bkTooltips",c)}};const s=c;var f=a(2717);const d=(0,t.defineComponent)({name:"PopArrow",render:function(){var e=(0,(0,f.usePrefix)().resolveClassName)("pop2-arrow");return(0,t.createVNode)("div",{class:e},null)}});function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function v(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==p(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,"string");if("object"!==p(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===p(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var m,y;!function(e){e.CLICK_OUTSIDE="clickoutside",e.CONTENT_MOUSEENTER="contentMouseenter",e.CONTENT_MOUSELEAVE="contentMouseleave",e.CONTENT_AfterHidden="afterHidden",e.CONTENT_AfterShow="afterShow"}(y||(y={}));var h=function(e){return!0},g=function(e){return e},b=(v(m={},y.CLICK_OUTSIDE,(function(e){return!0})),v(m,y.CONTENT_MOUSEENTER,g),v(m,y.CONTENT_MOUSELEAVE,g),v(m,y.CONTENT_AfterHidden,h),v(m,y.CONTENT_AfterShow,h),m);const w=(0,t.defineComponent)({name:"PopContent",props:{width:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),height:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),maxHeight:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),maxWidth:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),extCls:e.PropTypes.string.def(""),visible:e.PropTypes.bool.def(!1),eventDelay:e.PropTypes.number.def(0)},setup:function(e){var n=function(e){return/^\d+\.?\d*$/.test("".concat(e))?"".concat(e,"px"):e},o=(0,t.computed)((function(){return{width:n(e.width),height:n(e.height),maxHeight:n(e.maxHeight),maxWidth:n(e.maxWidth)}})),r=(0,t.ref)(null),i=(0,t.ref)(null),l=function(t){var n;0!==e.eventDelay&&(null===(n=r.value)||void 0===n||n.style.setProperty("pointer-events",t))},a=(0,f.usePrefix)().resolveClassName;return{style:o,refContent:r,resolveClassName:a,resetPointerEvent:function(){var t;0!==e.eventDelay&&(i.value&&clearTimeout(i.value),i.value=setTimeout((function(){l("unset")}),null!==(t=e.eventDelay)&&void 0!==t?t:300))},setContentPointerEvent:l}},render:function(){var e,n,o,r,i,l,a,u,c=this,s=[this.resolveClassName("popover"),this.resolveClassName("pop2-content"),this.extCls],f=function(e){var n;return t.Fragment===(null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.type)&&(0,t.nextTick)((function(){c.setContentPointerEvent("none"),c.resetPointerEvent()})),c.style}(null===(n=(e=this.$slots).default)||void 0===n?void 0:n.call(e));return(0,t.createVNode)("div",{class:s,style:f,ref:"refContent"},[null!==(i=null===(r=(o=this.$slots).arrow)||void 0===r?void 0:r.call(o))&&void 0!==i?i:"",null!==(u=null===(a=(l=this.$slots).default)||void 0===a?void 0:a.call(l))&&void 0!==u?u:""])}});var x=a(210),T={isShow:e.PropTypes.bool.def(!1),always:e.PropTypes.bool.def(!1),disabled:e.PropTypes.bool.def(!1),width:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),height:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),maxWidth:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),maxHeight:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.number]).def("auto"),content:(0,x.toType)("IContent",{}).def(""),target:e.PropTypes.oneOfType([e.PropTypes.string,e.PropTypes.instanceOf(HTMLElement),e.PropTypes.instanceOf(PointerEvent)]),allowHtml:e.PropTypes.bool.def(!1),placement:(0,e.placementType)().def(e.PlacementEnum.TOP_START),theme:e.PropTypes.string.def("dark"),trigger:(0,e.triggerType)(),renderType:(0,e.renderType)(),arrow:e.PropTypes.bool.def(!0),padding:e.PropTypes.number.def(5),offset:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.shape({mainAxis:e.PropTypes.number,crossAxis:e.PropTypes.number,alignmentAxis:e.PropTypes.number})]).def(6),boundary:e.PropTypes.oneOfType([e.PropTypes.string.def("parent"),e.PropTypes.instanceOf(HTMLElement)]),zIndex:e.PropTypes.number.def(void 0),disableTeleport:e.PropTypes.bool.def(!1),autoPlacement:e.PropTypes.bool.def(!1),autoVisibility:e.PropTypes.bool.def(!0),disableOutsideClick:e.PropTypes.bool.def(!1),disableTransform:e.PropTypes.bool.def(!1),reference:e.PropTypes.any,modifiers:e.PropTypes.array.def([]),popoverDelay:e.PropTypes.oneOfType([e.PropTypes.number,e.PropTypes.arrayOf(e.PropTypes.number)]).def(100),extCls:e.PropTypes.string.def(""),componentEventDelay:e.PropTypes.number.def(0),forceClickoutside:e.PropTypes.bool.def(!1)};const P=(0,t.defineComponent)({name:"PopReference",render:function(){var e,t,n;return null!==(n=null===(t=(e=this.$slots).default)||void 0===t?void 0:t.call(e))&&void 0!==n?n:""}}),E=(0,t.defineComponent)({props:{class:e.PropTypes.string.def(""),mode:e.PropTypes.string.def("")},render:function(){var e,n;return(0,t.createVNode)(t.Fragment,null,[null===(n=(e=this.$slots).default)||void 0===n?void 0:n.call(e)])}});function C(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function O(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,l,a=[],u=!0,c=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;u=!1}else for(;!(u=(o=i.call(n)).done)&&(a.push(o.value),a.length!==t);u=!0);}catch(e){c=!0,r=e}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(c)throw r}}return a}}(e,t)||function(e,t){if(e){if("string"==typeof e)return C(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var R=a(467);const A=["top","right","bottom","left"],S=["start","end"],N=A.reduce(((e,t)=>e.concat(t,t+"-"+S[0],t+"-"+S[1])),[]),L=Math.min,D=Math.max,H=Math.round,I=Math.floor,j=e=>({x:e,y:e}),k={left:"right",right:"left",bottom:"top",top:"bottom"},M={start:"end",end:"start"};function F(e,t,n){return D(e,L(t,n))}function V(e,t){return"function"==typeof e?e(t):e}function $(e){return e.split("-")[0]}function _(e){return e.split("-")[1]}function q(e){return"x"===e?"y":"x"}function B(e){return"y"===e?"height":"width"}function U(e){return["top","bottom"].includes($(e))?"y":"x"}function W(e){return q(U(e))}function z(e,t,n){void 0===n&&(n=!1);const o=_(e),r=W(e),i=B(r);let l="x"===r?o===(n?"end":"start")?"right":"left":"start"===o?"bottom":"top";return t.reference[i]>t.floating[i]&&(l=X(l)),[l,X(l)]}function K(e){return e.replace(/start|end/g,(e=>M[e]))}function X(e){return e.replace(/left|right|bottom|top/g,(e=>k[e]))}function Y(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 Z(e){return{...e,top:e.y,left:e.x,right:e.x+e.width,bottom:e.y+e.height}}function G(e,t,n){let{reference:o,floating:r}=e;const i=U(t),l=W(t),a=B(l),u=$(t),c="y"===i,s=o.x+o.width/2-r.width/2,f=o.y+o.height/2-r.height/2,d=o[a]/2-r[a]/2;let p;switch(u){case"top":p={x:s,y:o.y-r.height};break;case"bottom":p={x:s,y:o.y+o.height};break;case"right":p={x:o.x+o.width,y:f};break;case"left":p={x:o.x-r.width,y:f};break;default:p={x:o.x,y:o.y}}switch(_(t)){case"start":p[l]-=d*(n&&c?-1:1);break;case"end":p[l]+=d*(n&&c?-1:1)}return p}async function J(e,t){var n;void 0===t&&(t={});const{x:o,y:r,platform:i,rects:l,elements:a,strategy:u}=e,{boundary:c="clippingAncestors",rootBoundary:s="viewport",elementContext:f="floating",altBoundary:d=!1,padding:p=0}=V(t,e),v=Y(p),m=a[d?"floating"===f?"reference":"floating":f],y=Z(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:s,strategy:u})),h="floating"===f?{...l.floating,x:o,y:r}:l.reference,g=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(g))&&await(null==i.getScale?void 0:i.getScale(g))||{x:1,y:1},w=Z(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({rect:h,offsetParent:g,strategy:u}):h);return{top:(y.top-w.top+v.top)/b.y,bottom:(w.bottom-y.bottom+v.bottom)/b.y,left:(y.left-w.left+v.left)/b.x,right:(w.right-y.right+v.right)/b.x}}function Q(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function ee(e){return A.some((t=>e[t]>=0))}function te(e){const t=L(...e.map((e=>e.left))),n=L(...e.map((e=>e.top)));return{x:t,y:n,width:D(...e.map((e=>e.right)))-t,height:D(...e.map((e=>e.bottom)))-n}}const ne=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){const{x:n,y:o}=t,r=await async function(e,t){const{placement:n,platform:o,elements:r}=e,i=await(null==o.isRTL?void 0:o.isRTL(r.floating)),l=$(n),a=_(n),u="y"===U(n),c=["left","top"].includes(l)?-1:1,s=i&&u?-1:1,f=V(t,e);let{mainAxis:d,crossAxis:p,alignmentAxis:v}="number"==typeof f?{mainAxis:f,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...f};return a&&"number"==typeof v&&(p="end"===a?-1*v:v),u?{x:p*s,y:d*c}:{x:d*c,y:p*s}}(t,e);return{x:n+r.x,y:o+r.y,data:r}}}},oe=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:l=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...u}=V(e,t),c={x:n,y:o},s=await J(t,u),f=U($(r)),d=q(f);let p=c[d],v=c[f];if(i){const e="y"===d?"bottom":"right";p=F(p+s["y"===d?"top":"left"],p,p-s[e])}if(l){const e="y"===f?"bottom":"right";v=F(v+s["y"===f?"top":"left"],v,v-s[e])}const m=a.fn({...t,[d]:p,[f]:v});return{...m,data:{x:m.x-n,y:m.y-o}}}}};function re(e){return ae(e)?(e.nodeName||"").toLowerCase():"#document"}function ie(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function le(e){var t;return null==(t=(ae(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ae(e){return e instanceof Node||e instanceof ie(e).Node}function ue(e){return e instanceof Element||e instanceof ie(e).Element}function ce(e){return e instanceof HTMLElement||e instanceof ie(e).HTMLElement}function se(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof ie(e).ShadowRoot)}function fe(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=ye(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!["inline","contents"].includes(r)}function de(e){return["table","td","th"].includes(re(e))}function pe(e){const t=ve(),n=ye(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 ve(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function me(e){return["html","body","#document"].includes(re(e))}function ye(e){return ie(e).getComputedStyle(e)}function he(e){return ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ge(e){if("html"===re(e))return e;const t=e.assignedSlot||e.parentNode||se(e)&&e.host||le(e);return se(t)?t.host:t}function be(e){const t=ge(e);return me(t)?e.ownerDocument?e.ownerDocument.body:e.body:ce(t)&&fe(t)?t:be(t)}function we(e,t){var n;void 0===t&&(t=[]);const o=be(e),r=o===(null==(n=e.ownerDocument)?void 0:n.body),i=ie(o);return r?t.concat(i,i.visualViewport||[],fe(o)?o:[]):t.concat(o,we(o))}function xe(e){const t=ye(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=ce(e),i=r?e.offsetWidth:n,l=r?e.offsetHeight:o,a=H(n)!==i||H(o)!==l;return a&&(n=i,o=l),{width:n,height:o,$:a}}function Te(e){return ue(e)?e:e.contextElement}function Pe(e){const t=Te(e);if(!ce(t))return j(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=xe(t);let l=(i?H(n.width):n.width)/o,a=(i?H(n.height):n.height)/r;return l&&Number.isFinite(l)||(l=1),a&&Number.isFinite(a)||(a=1),{x:l,y:a}}const Ee=j(0);function Ce(e){const t=ie(e);return ve()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ee}function Oe(e,t,n,o){void 0===t&&(t=!1),void 0===n&&(n=!1);const r=e.getBoundingClientRect(),i=Te(e);let l=j(1);t&&(o?ue(o)&&(l=Pe(o)):l=Pe(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==ie(e))&&t}(i,n,o)?Ce(i):j(0);let u=(r.left+a.x)/l.x,c=(r.top+a.y)/l.y,s=r.width/l.x,f=r.height/l.y;if(i){const e=ie(i),t=o&&ue(o)?ie(o):o;let n=e.frameElement;for(;n&&o&&t!==e;){const e=Pe(n),t=n.getBoundingClientRect(),o=ye(n),r=t.left+(n.clientLeft+parseFloat(o.paddingLeft))*e.x,i=t.top+(n.clientTop+parseFloat(o.paddingTop))*e.y;u*=e.x,c*=e.y,s*=e.x,f*=e.y,u+=r,c+=i,n=ie(n).frameElement}}return Z({width:s,height:f,x:u,y:c})}function Re(e){return Oe(le(e)).left+he(e).scrollLeft}function Ae(e,t,n){let o;if("viewport"===t)o=function(e,t){const n=ie(e),o=le(e),r=n.visualViewport;let i=o.clientWidth,l=o.clientHeight,a=0,u=0;if(r){i=r.width,l=r.height;const e=ve();(!e||e&&"fixed"===t)&&(a=r.offsetLeft,u=r.offsetTop)}return{width:i,height:l,x:a,y:u}}(e,n);else if("document"===t)o=function(e){const t=le(e),n=he(e),o=e.ownerDocument.body,r=D(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=D(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+Re(e);const a=-n.scrollTop;return"rtl"===ye(o).direction&&(l+=D(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:l,y:a}}(le(e));else if(ue(t))o=function(e,t){const n=Oe(e,!0,"fixed"===t),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=ce(e)?Pe(e):j(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:r*i.x,y:o*i.y}}(t,n);else{const n=Ce(e);o={...t,x:t.x-n.x,y:t.y-n.y}}return Z(o)}function Se(e,t){const n=ge(e);return!(n===t||!ue(n)||me(n))&&("fixed"===ye(n).position||Se(n,t))}function Ne(e,t,n){const o=ce(t),r=le(t),i="fixed"===n,l=Oe(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const u=j(0);if(o||!o&&!i)if(("body"!==re(t)||fe(r))&&(a=he(t)),o){const e=Oe(t,!0,i,t);u.x=e.x+t.clientLeft,u.y=e.y+t.clientTop}else r&&(u.x=Re(r));return{x:l.left+a.scrollLeft-u.x,y:l.top+a.scrollTop-u.y,width:l.width,height:l.height}}function Le(e,t){return ce(e)&&"fixed"!==ye(e).position?t?t(e):e.offsetParent:null}function De(e,t){const n=ie(e);if(!ce(e))return n;let o=Le(e,t);for(;o&&de(o)&&"static"===ye(o).position;)o=Le(o,t);return o&&("html"===re(o)||"body"===re(o)&&"static"===ye(o).position&&!pe(o))?n:o||function(e){let t=ge(e);for(;ce(t)&&!me(t);){if(pe(t))return t;t=ge(t)}return null}(e)||n}const He={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:o}=e;const r=ce(n),i=le(n);if(n===i)return t;let l={scrollLeft:0,scrollTop:0},a=j(1);const u=j(0);if((r||!r&&"fixed"!==o)&&(("body"!==re(n)||fe(i))&&(l=he(n)),ce(n))){const e=Oe(n);a=Pe(n),u.x=e.x+n.clientLeft,u.y=e.y+n.clientTop}return{width:t.width*a.x,height:t.height*a.y,x:t.x*a.x-l.scrollLeft*a.x+u.x,y:t.y*a.y-l.scrollTop*a.y+u.y}},getDocumentElement:le,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const i=[..."clippingAncestors"===n?function(e,t){const n=t.get(e);if(n)return n;let o=we(e).filter((e=>ue(e)&&"body"!==re(e))),r=null;const i="fixed"===ye(e).position;let l=i?ge(e):e;for(;ue(l)&&!me(l);){const t=ye(l),n=pe(l);n||"fixed"!==t.position||(r=null),(i?!n&&!r:!n&&"static"===t.position&&r&&["absolute","fixed"].includes(r.position)||fe(l)&&!n&&Se(e,l))?o=o.filter((e=>e!==l)):r=t,l=ge(l)}return t.set(e,o),o}(t,this._c):[].concat(n),o],l=i[0],a=i.reduce(((e,n)=>{const o=Ae(t,n,r);return e.top=D(o.top,e.top),e.right=L(o.right,e.right),e.bottom=L(o.bottom,e.bottom),e.left=D(o.left,e.left),e}),Ae(t,l,r));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}},getOffsetParent:De,getElementRects:async function(e){let{reference:t,floating:n,strategy:o}=e;const r=this.getOffsetParent||De,i=this.getDimensions;return{reference:Ne(t,await r(n),o),floating:{x:0,y:0,...await i(n)}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){return xe(e)},getScale:Pe,isElement:ue,isRTL:function(e){return"rtl"===ye(e).direction}};var Ie=a(8022),je={},ke=function(e){return document.querySelector(e)instanceof HTMLElement},Me=function(e){return e instanceof Element||e instanceof HTMLDocument},Fe=function(e){if(Me(e))return{isElement:!0,content:e,vNode:void 0};if(/^(#|\.)/.test(e)){var t=document.querySelector(e),n=Me(t);return{isElement:n,content:n?t:e,vNode:n?void 0:e}}return{isElement:!1,content:e,vNode:e}};const Ve=function(n,o,r){var i=r.refReference,l=r.refContent,a=r.refArrow,u=r.refRoot,c=(0,t.ref)(!1),s=(0,t.ref)(),f=function(){var e,t,n=b();return(null===(e=document.fullscreenElement)||void 0===e?void 0:e.shadowRoot)?document.fullscreenElement.shadowRoot.contains(n):null===(t=document.fullscreenElement)||void 0===t?void 0:t.contains(n)},d=["dark","light"],p=(0,t.computed)((function(){var e,t,o=null!==(t=null===(e=n.theme)||void 0===e?void 0:e.split(/\s+/))&&void 0!==t?t:[];return o.sort((function(e,t){return Number(d.includes(t))-Number(d.includes(e))})),{systemThemes:o,customThemes:o.filter((function(e){return!d.includes(e)}))}})),m=function(){return n.autoVisibility},h=function(){return n.autoPlacement},g=function(){var e,t,o,r=b(),i=T(null===(e=l.value)||void 0===e?void 0:e.$el),c=n.arrow?T(null===(t=a.value)||void 0===t?void 0:t.$el):null,s=T(null===(o=u.value)||void 0===o?void 0:o.$el),f=Fe(n.content),d=f.isElement,p=f.content;return i&&d&&!(null==i?void 0:i.contains(p))&&i.append(p),{elReference:r,elContent:i,elArrow:c,root:s}},b=function(){var e;return T(n.target)||T(null===(e=i.value)||void 0===e?void 0:e.$el)},w=function(){var e={};return Array.isArray(n.modifiers)&&n.modifiers.forEach((function(t){var n,o,r,i,l;if("offset"===t.name){if("number"==typeof(null===(n=t.options)||void 0===n?void 0:n.offset)&&(l=null===(o=t.options)||void 0===o?void 0:o.offset),Array.isArray(null===(r=t.options)||void 0===r?void 0:r.offset)){var a=O(null===(i=t.options)||void 0===i?void 0:i.offset,2);l={mainAxis:a[0],crossAxis:a[1]}}Object.assign(e,{offset:l})}})),e},x=function(e,t){var n,o,r=w(),i=[ne(r.offset||t.offset),oe({padding:t.padding})],l={placement:t.placement,middleware:i};if(t.arrow&&i.push((e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:r,rects:i,platform:l,elements:a}=t,{element:u,padding:c=0}=V(e,t)||{};if(null==u)return{};const s=Y(c),f={x:n,y:o},d=W(r),p=B(d),v=await l.getDimensions(u),m="y"===d,y=m?"top":"left",h=m?"bottom":"right",g=m?"clientHeight":"clientWidth",b=i.reference[p]+i.reference[d]-f[d]-i.floating[p],w=f[d]-i.reference[d],x=await(null==l.getOffsetParent?void 0:l.getOffsetParent(u));let T=x?x[g]:0;T&&await(null==l.isElement?void 0:l.isElement(x))||(T=a.floating[g]||i.floating[p]);const P=b/2-w/2,E=T/2-v[p]/2-1,C=L(s[y],E),O=L(s[h],E),R=C,A=T-v[p]-O,S=T/2-v[p]/2+P,N=F(R,S,A),D=null!=_(r)&&S!=N&&i.reference[p]/2-(S<R?C:O)-v[p]/2<0?S<R?R-S:A-S:0;return{[d]:f[d]-D,data:{[d]:N,centerOffset:S-N+D}}}}))({element:e})),h()?i.push(function(e){return void 0===e&&(e={}),{name:"autoPlacement",options:e,async fn(t){var n,o,r;const{rects:i,middlewareData:l,placement:a,platform:u,elements:c}=t,{crossAxis:s=!1,alignment:f,allowedPlacements:d=N,autoAlignment:p=!0,...v}=V(e,t),m=void 0!==f||d===N?function(e,t,n){return(e?[...n.filter((t=>_(t)===e)),...n.filter((t=>_(t)!==e))]:n.filter((e=>$(e)===e))).filter((n=>!e||_(n)===e||!!t&&K(n)!==n))}(f||null,p,d):d,y=await J(t,v),h=(null==(n=l.autoPlacement)?void 0:n.index)||0,g=m[h];if(null==g)return{};const b=z(g,i,await(null==u.isRTL?void 0:u.isRTL(c.floating)));if(a!==g)return{reset:{placement:m[0]}};const w=[y[$(g)],y[b[0]],y[b[1]]],x=[...(null==(o=l.autoPlacement)?void 0:o.overflows)||[],{placement:g,overflows:w}],T=m[h+1];if(T)return{data:{index:h+1,overflows:x},reset:{placement:T}};const P=x.map((e=>{const t=_(e.placement);return[e.placement,t&&s?e.overflows.slice(0,2).reduce(((e,t)=>e+t),0):e.overflows[0],e.overflows]})).sort(((e,t)=>e[1]-t[1])),E=(null==(r=P.filter((e=>e[2].slice(0,_(e[0])?2:3).every((e=>e<=0))))[0])?void 0:r[0])||P[0][0];return E!==a?{data:{index:h+1,overflows:x},reset:{placement:E}}:{}}}}()):(i.unshift(function(e){return void 0===e&&(e={}),{name:"inline",options:e,async fn(t){const{placement:n,elements:o,rects:r,platform:i,strategy:l}=t,{padding:a=2,x:u,y:c}=V(e,t),s=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 e=0;e<t.length;e++){const r=t[e];!o||r.y-o.y>o.height/2?n.push([r]):n[n.length-1].push(r),o=r}return n.map((e=>Z(te(e))))}(s),d=Z(te(s)),p=Y(a),v=await i.getElementRects({reference:{getBoundingClientRect:function(){if(2===f.length&&f[0].left>f[1].right&&null!=u&&null!=c)return f.find((e=>u>e.left-p.left&&u<e.right+p.right&&c>e.top-p.top&&c<e.bottom+p.bottom))||d;if(f.length>=2){if("y"===U(n)){const e=f[0],t=f[f.length-1],o="top"===$(n),r=e.top,i=t.bottom,l=o?e.left:t.left,a=o?e.right:t.right;return{top:r,bottom:i,left:l,right:a,width:a-l,height:i-r,x:l,y:r}}const e="left"===$(n),t=D(...f.map((e=>e.right))),o=L(...f.map((e=>e.left))),r=f.filter((n=>e?n.left===o:n.right===t)),i=r[0].top,l=r[r.length-1].bottom;return{top:i,bottom:l,left:o,right:t,width:t-o,height:l-i,x:o,y:i}}return d}},floating:o.floating,strategy:l});return r.reference.x!==v.reference.x||r.reference.y!==v.reference.y||r.reference.width!==v.reference.width||r.reference.height!==v.reference.height?{reset:{rects:v}}:{}}}}()),i.push(function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n;const{placement:o,middlewareData:r,rects:i,initialPlacement:l,platform:a,elements:u}=t,{mainAxis:c=!0,crossAxis:s=!0,fallbackPlacements:f,fallbackStrategy:d="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:v=!0,...m}=V(e,t),y=$(o),h=$(l)===l,g=await(null==a.isRTL?void 0:a.isRTL(u.floating)),b=f||(h||!v?[X(l)]:function(e){const t=X(e);return[K(e),t,K(t)]}(l));f||"none"===p||b.push(...function(e,t,n,o){const r=_(e);let i=function(e,t,n){const o=["left","right"],r=["right","left"],i=["top","bottom"],l=["bottom","top"];switch(e){case"top":case"bottom":return n?t?r:o:t?o:r;case"left":case"right":return t?i:l;default:return[]}}($(e),"start"===n,o);return r&&(i=i.map((e=>e+"-"+r)),t&&(i=i.concat(i.map(K)))),i}(l,v,p,g));const w=[l,...b],x=await J(t,m),T=[];let P=(null==(n=r.flip)?void 0:n.overflows)||[];if(c&&T.push(x[y]),s){const e=z(o,i,g);T.push(x[e[0]],x[e[1]])}if(P=[...P,{placement:o,overflows:T}],!T.every((e=>e<=0))){var E,C;const e=((null==(E=r.flip)?void 0:E.index)||0)+1,t=w[e];if(t)return{data:{index:e,overflows:P},reset:{placement:t}};let n=null==(C=P.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:C.placement;if(!n)switch(d){case"bestFit":{var O;const e=null==(O=P.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:O[0];e&&(n=e);break}case"initialPlacement":n=l}if(o!==n)return{reset:{placement:n}}}return{}}}}())),m()&&l.middleware.push(function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...r}=V(e,t);switch(o){case"referenceHidden":{const e=Q(await J(t,{...r,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:ee(e)}}}case"escaped":{const e=Q(await J(t,{...r,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:ee(e)}}}default:return{}}}}}()),f()||t.isVirtualEl){var a=(o=s.value,{getElementRects:function(e){var t=e.reference,n=e.floating,o=t.getBoundingClientRect(),r=n.getBoundingClientRect();return{reference:{width:o.width,height:o.height,x:o.x,y:o.y},floating:{width:r.width,height:r.height,x:r.x,y:r.y}}},getDimensions:function(e){var t=e.getBoundingClientRect();return{width:t.width,height:t.height}},getClippingRect:function(e){var t;!function(e){if(null==e)throw new TypeError("Cannot destructure "+e)}(e);var n=null!==(t=null==o?void 0:o.getBoundingClientRect())&&void 0!==t?t:{},r=n.width,i=void 0===r?0:r,l=n.height;return{width:i,height:void 0===l?0:l,x:0,y:0}}}),u=a.getElementRects,c=a.getDimensions,d=a.getClippingRect;Object.assign(l,{platform:Object.assign(Object.assign({},null!==(n=null==t?void 0:t.platform)&&void 0!==n?n:{}),{getElementRects:u,getDimensions:c,getClippingRect:d})})}return l},T=function e(t){if(t instanceof HTMLElement)return t;if(t instanceof Text)return e(t.nextElementSibling);if("function"==typeof(null==t?void 0:t.getBoundingClientRect))return t;if("string"==typeof t){var n=document.querySelector(t);return(0,R.isElement)(n)?n:null}return t instanceof PointerEvent?e(t.target):null},P=p.value.customThemes.join(" "),E=p.value.customThemes.reduce((function(e,t){return Object.assign(v({},"data-".concat(t,"-theme"),!0),e)}),{}),C="".concat(P),A=null,S=function(e){var t=window.devicePixelRatio||1;return Math.round(e*t)/t||0},H=function(e,t,o,r){var i;n.disableTransform?Object.assign(e.style,{left:"".concat(S(t),"px"),top:"".concat(S(o),"px")}):Object.assign(e.style,{left:"0",top:"0",transform:"translate3d(".concat(S(t),"px,").concat(S(o),"px,0)")});var l=!!m()&&(null===(i=r.hide)||void 0===i?void 0:i.referenceHidden);Object.assign(e.style,{visibility:l?"hidden":"visible"})},j=function(e,t,o){var r;if(n.arrow){var i=null!==(r=o.arrow)&&void 0!==r?r:{},l=i.x,a=i.y;e.setAttribute("data-arrow",t),Object.assign(e.style,{left:"",top:"",bottom:"",right:""});var u={top:"bottom",right:"left",bottom:"top",left:"right"}[t];Object.assign(e.style,v({left:null!==l?"".concat(l,"px"):"",top:null!==a?"".concat(a,"px"):""},u,"-4px"))}},k=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,o=g(),r=o.elReference,i=o.elContent,l=o.elArrow,a=e||r;if(a&&i){var u=x(l,t);((e,t,n)=>{const o=new Map,r={platform:He,...n},i={...r.platform,_c:o};return(async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:l}=n,a=i.filter(Boolean),u=await(null==l.isRTL?void 0:l.isRTL(t));let c=await l.getElementRects({reference:e,floating:t,strategy:r}),{x:s,y:f}=G(c,o,u),d=o,p={},v=0;for(let n=0;n<a.length;n++){const{name:i,fn:m}=a[n],{x:y,y:h,data:g,reset:b}=await m({x:s,y:f,initialPlacement:o,placement:d,strategy:r,middlewareData:p,rects:c,platform:l,elements:{reference:e,floating:t}});s=null!=y?y:s,f=null!=h?h:f,p={...p,[i]:{...p[i],...g}},b&&v<=50&&(v++,"object"==typeof b&&(b.placement&&(d=b.placement),b.rects&&(c=!0===b.rects?await l.getElementRects({reference:e,floating:t,strategy:r}):b.rects),({x:s,y:f}=G(c,d,u))),n=-1)}return{x:s,y:f,placement:d,strategy:r,middlewareData:p}})(e,t,{...r,platform:i})})(a,i,u).then((function(e){var t=e.x,o=e.y,r=e.placement,a=e.middlewareData,u=i.className;i.className="".concat(u.replace(C,"")," ").concat(C).replace(/\s+/gm," ").replace(/^\s+|\s+$/g,""),Object.keys(E).forEach((function(e){i.setAttribute(e,E[e])}));var c=r.split("-")[0],s=c;["left","right","top","bottom"].includes(c)||(s="top"),H(i,t,o,a),j(l,s,a),"function"==typeof n&&n()}))}},M=void 0,q=void 0,re=!1,ie=function(){return Array.isArray(n.popoverDelay)?[n.popoverDelay[0],n.popoverDelay.slice(-1)[0]]:[n.popoverDelay,n.popoverDelay]},ae=function(){var e=ie()[0];q=setTimeout((function(){M&&clearTimeout(M),n.disabled||(c.value=!0)}),e)},ue=function(){var e=ie()[1];M=setTimeout((function(){q&&clearTimeout(q),c.value=!1}),e)},ce=function(){c.value?ue():ae()},se=function(){ce()},fe=function(e){"hover"===n.trigger&&(M&&(re=!0,clearTimeout(M),M=void 0),pe(e))},de=function(e){re&&(ue(),re=!1,ve(e))},pe=function(e){o.emit(y.CONTENT_MOUSEENTER,e)},ve=function(e){o.emit(y.CONTENT_MOUSELEAVE,e)};return(0,t.watch)((function(){return n.isShow}),(function(e){c.value=e})),(0,t.watch)(c,(function(t){var r,i;t?((i=T(null===(r=l.value)||void 0===r?void 0:r.$el)).style.setProperty("display","block"),i.style.setProperty("z-index","".concat(n.zIndex?n.zIndex:e.bkZIndexManager.getPopperIndex())),k(),o.emit(y.CONTENT_AfterShow,{isShow:!0})):function(){var e;T(null===(e=l.value)||void 0===e?void 0:e.$el).style.setProperty("display","none"),o.emit(y.CONTENT_AfterHidden,{isShow:!1})}()})),{showPopover:ae,hidePopover:ue,resolveTriggerEvents:function(){var e;return null!==(e={hover:{content:[["mouseenter",fe],["mouseleave",de]],reference:[["mouseenter",ae],["mouseleave",ue],["focus",ae],["blur",ue]]},click:[["click",se]],manual:{content:[["mouseenter",pe],["mouseleave",ve]],reference:[[]]}}[n.trigger])&&void 0!==e?e:[]},updatePopover:k,triggerPopover:ce,resolvePopElements:g,isElementFullScreen:f,resolveTargetElement:T,createPopInstance:function(){var e=g(),t=e.elReference,o=e.elContent;A=function(e,t,n,o){void 0===o&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:l="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:u=!1}=o,c=Te(e),s=r||i?[...c?we(c):[],...we(t)]:[];s.forEach((e=>{r&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const f=c&&a?function(e,t){let n,o=null;const r=le(e);function i(){clearTimeout(n),o&&o.disconnect(),o=null}return function l(a,u){void 0===a&&(a=!1),void 0===u&&(u=1),i();const{left:c,top:s,width:f,height:d}=e.getBoundingClientRect();if(a||t(),!f||!d)return;const p={rootMargin:-I(s)+"px "+-I(r.clientWidth-(c+f))+"px "+-I(r.clientHeight-(s+d))+"px "+-I(c)+"px",threshold:D(0,L(1,u))||1};let v=!0;function m(e){const t=e[0].intersectionRatio;if(t!==u){if(!v)return l();t?l(!1,t):n=setTimeout((()=>{l(!1,1e-7)}),100)}v=!1}try{o=new IntersectionObserver(m,{...p,root:r.ownerDocument})}catch(e){o=new IntersectionObserver(m,p)}o.observe(e)}(!0),i}(c,n):null;let d,p=-1,v=null;l&&(v=new ResizeObserver((e=>{let[o]=e;o&&o.target===c&&v&&(v.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame((()=>{v&&v.observe(t)}))),n()})),c&&!u&&v.observe(c),v.observe(t));let m=u?Oe(e):null;return u&&function t(){const o=Oe(e);!m||o.x===m.x&&o.y===m.y&&o.width===m.width&&o.height===m.height||n(),m=o,d=requestAnimationFrame(t)}(),n(),()=>{s.forEach((e=>{r&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),f&&f(),v&&v.disconnect(),v=null,u&&cancelAnimationFrame(d)}}(t,o,(function(){c.value&&k(null,n)}))},updateFullscreenTarget:function(e){s.value=e},getFullscreenRoot:function(e){return f()?document.fullscreenElement.shadowRoot?document.fullscreenElement.shadowRoot.querySelector(e):document.fullscreenElement.querySelector(e):document.body},stopHide:function(){M&&(re=!0,clearTimeout(M),M=void 0)},localIsShow:c,cleanup:A}};var $e=null,_e=null;const qe=(0,t.defineComponent)({name:"Popover",components:{Content:w,Arrow:d,Root:E},directives:{clickoutside:s},props:T,emits:b,setup:function(n,o){var r=(0,t.toRefs)(n).reference,i=(0,t.ref)(),l=(0,t.ref)(),a=(0,t.ref)(),u=(0,t.ref)(),c=(0,t.computed)((function(){return r.value||i.value})),s=function(e,n,o){var r=o.refReference,i=o.refContent,l=o.refArrow,a=o.refRoot,u=null,c=(0,t.ref)(!1),s=(je.fullscreenReferId||(je.fullscreenReferId="id_".concat((0,Ie.v4)())),je.fullscreenReferId),f=(0,t.ref)(),d=Ve(e,n,{refReference:r,refContent:i,refArrow:l,refRoot:a}),p=d.localIsShow,v=d.showPopover,m=d.hidePopover,h=d.updatePopover,g=d.cleanup,b=d.resolveTriggerEvents,w=d.resolvePopElements,x=d.isElementFullScreen,T=d.updateFullscreenTarget,P=d.createPopInstance,E=d.getFullscreenRoot,C=d.stopHide,R=function(){m()},A=function(){P(),e.always?v():S()},S=function(){var e=w(),t=e.elReference,n=e.elContent;if(u=b(),Array.isArray(u))N(t,u);else{var o=u,r=o.content,i=o.reference;N(t,i),N(n,r)}},N=function(e,t){t.forEach((function(t){var n=O(t,2),o=n[0],r=n[1];o&&"function"==typeof r&&e.addEventListener(o,r)}))},L=function(){var e=w(),t=e.elReference,n=e.root;c.value?I.value=null==f?void 0:f.value:I.value=H(n||t)},D=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"#",n=function(n){var o=null,r=function(e){null===o&&e()};return r((function(){if(/^parent$/i.test(e.boundary)){o="".concat(t).concat($e);var r=(n||{}).parentNode;(null==r?void 0:r.parentNode)&&(r.parentNode.setAttribute("data-pnode-id",_e),o="[data-pnode-id=".concat(_e,"]"))}})),r((function(){if(!/^body$/i.test(e.boundary)){if("string"==typeof e.boundary)return ke(e.boundary)?void(o=e.boundary):void(o="body");if(Me(e.boundary))return void(o=e.boundary)}})),r((function(){o="string"==typeof e.boundary?e.boundary:"".concat(t).concat($e)})),o};if(null===$e||!ke("#".concat($e))){$e="id_".concat((0,Ie.v4)());var o=document.createElement("div");o.setAttribute("id",$e),o.setAttribute("data-popper-id",$e),document.body.append(o)}return null===_e&&(_e="id_".concat((0,Ie.v4)())),{popContainerId:$e,prefixId:n(),getPrefixId:n}}(e,"#"),H=D.getPrefixId,I=(0,t.ref)(),j=function(){!function(){if(null==u?void 0:u.length){var e=w().elReference;e&&u.forEach((function(t){var n=O(t,2),o=n[0],r=n[1];o&&"function"==typeof r&&e.removeEventListener(o,r)})),u=null}}()},k=function(e){var t;f.value=e,T(e),c.value=x(),null===(t=null==f?void 0:f.value)||void 0===t||t.setAttribute("data-fllsrn-id",s)},M=function(t){var n,o,r;document.fullscreenElement||(r="[data-fllsrn-id=".concat(s,"]"),(null!==(o=null===(n=null==f?void 0:f.value)||void 0===n?void 0:n.querySelectorAll(r))&&void 0!==o?o:[]).forEach((function(e){null==e||e.removeAttribute("data-fllsrn-id")}))),k(t.target),L(),h(null,e)};return{onMountedFn:function(){if(!e.disabled){if(A(),x()){var t="[data-fllsrn-id=".concat(s,"]"),n=E(t);k(n)}L(),document.body.addEventListener("fullscreenchange",M)}},onUnmountedFn:function(){j(),document.body.removeEventListener("fullscreenchange",M)},handleClickOutside:function(t){n.emit(y.CLICK_OUTSIDE,{isShow:p.value,event:t});var o=e.disableOutsideClick||e.always||e.disabled||"manual"===e.trigger;!e.forceClickoutside&&o||p.value&&R()},beforeInstanceUnmount:j,updateBoundary:L,initPopInstance:A,updatePopover:h,resetPopover:function(){null==g||g(),P()},showPopover:v,hidePopover:m,showFn:function(){v()},hideFn:R,stopHide:C,isFullscreen:c,boundary:I,localIsShow:p}}(n,o,{refReference:c,refContent:l,refArrow:a,refRoot:u}),f=s.onMountedFn,d=s.onUnmountedFn,p=s.handleClickOutside,v=s.beforeInstanceUnmount,m=s.updateBoundary,h=s.initPopInstance,g=s.showFn,b=s.hideFn,w=s.showPopover,x=s.hidePopover,T=s.updatePopover,P=s.resetPopover,E=s.stopHide,C=s.localIsShow,R=s.boundary;n.always||n.disabled||(0,t.watch)((function(){return n.isShow}),(function(){n.isShow?w():x()}),{immediate:!0}),(0,t.watch)((function(){return[n.disabled]}),(function(e){e[0]?v():h()})),m(),(0,t.onMounted)(f),(0,t.onBeforeUnmount)(d);var A=(0,t.computed)((function(){return!n.disableTeleport})),S=(0,t.computed)((function(){return n.renderType===e.RenderType.AUTO||C.value}));return{boundary:R,arrow:n.arrow,refDefaultReference:i,refContent:l,refArrow:a,content:n.content,theme:n.theme,transBoundary:A,handleClickOutside:p,updatePopover:T,resetPopover:P,hide:function(){b()},show:function(){g()},stopHide:E,contentIsShow:S,renderContent:function(){return n.allowHtml?Fe(n.content).vNode:n.content},localIsShow:C}},render:function(){var e,n,o,r,i,l,a,u=this,c=function(e){var n;return t.Text===(null===(n=null==e?void 0:e[0])||void 0===n?void 0:n.type)?(0,t.createVNode)("span",null,[e]):e};return(0,t.createVNode)(E,{ref:"refRoot"},{default:function(){return[(0,t.createVNode)(P,{ref:"refDefaultReference"},(s=e=c(null!==(r=null===(o=(n=u.$slots).default)||void 0===o?void 0:o.call(n))&&void 0!==r?r:(0,t.createVNode)("span",null,null)),"function"==typeof s||"[object Object]"===Object.prototype.toString.call(s)&&!(0,t.isVNode)(s)?e:{default:function(){return[e]}})),(0,t.createVNode)(t.Teleport,{to:u.boundary,disabled:!u.transBoundary},{default:function(){return[(0,t.withDirectives)((0,t.createVNode)(w,{ref:"refContent",visible:u.localIsShow,"data-theme":u.theme,extCls:u.extCls,width:u.width,height:u.height,maxWidth:u.maxWidth,maxHeight:u.maxHeight,eventDelay:u.componentEventDelay},{default:function(){return[u.contentIsShow?null!==(a=null===(l=(i=u.$slots).content)||void 0===l?void 0:l.call(i))&&void 0!==a?a:u.renderContent():""]},arrow:function(){var e,n;return u.arrow?(0,t.createVNode)(d,{ref:"refArrow"},{default:function(){return[null===(n=(e=u.$slots).arrow)||void 0===n?void 0:n.call(e)]}}):""}}),[[(0,t.resolveDirective)("clickoutside"),u.handleClickOutside]])]}})];var s}})}});function Be(e){var n,o=null,r=null,i=null,l=Object.assign(Object.assign({boundary:"body",placement:"top",autoVisibility:!0,isShow:!1,trigger:"manual"},e),{allowHtml:!0}),a={name:"$popover",setup:function(e,n){var o=n.expose,r=(0,t.reactive)(Object.keys(T).reduce((function(e,t){return Object.prototype.hasOwnProperty.call(l,t)&&Object.assign(e,v({},t,l[t])),e}),{target:l.target})),i=(0,t.ref)(),a=function(){var e;null===(e=l.onContentMouseenter)||void 0===e||e.call(l)},u=function(){var e;null===(e=l.onContentMouseleave)||void 0===e||e.call(l)};return o({show:function(){var e,t;null===(t=null===(e=i.value)||void 0===e?void 0:e.show)||void 0===t||t.call(e)},hide:function(){var e,t;null===(t=null===(e=i.value)||void 0===e?void 0:e.hide)||void 0===t||t.call(e)},updateTarget:function(e){var t,n;r.target=e,null===(n=null===(t=i.value)||void 0===t?void 0:t.resetPopover)||void 0===n||n.call(t)},stopHide:function(){var e,t;null===(t=null===(e=i.value)||void 0===e?void 0:e.stopHide)||void 0===t||t.call(e)}}),function(){return(0,t.createVNode)(qe,(0,t.mergeProps)(r,{ref:i,onContentMouseenter:a,onContentMouseleave:u}),null)}}};return null===o&&(i=document.createElement("div"),(n=l.boundary,/^body$/i.test(n)?document.body:/^parent$/i.test(n)?Me(l.target)?l.target.parentNode:l.target.target.parentNode:"string"==typeof n&&ke(n)?document.querySelector(n):document.body).append(i),o=(0,t.createApp)(a),r=o.mount(i)),{close:function(){o&&(o.unmount(),r=null,o=null,i.remove())},show:function(){null==r||r.show()},hide:function(){null==r||r.hide()},update:function(e){null==r||r.updateTarget(e)},get vm(){return r},get $el(){return r.$el}}}const Ue=(0,e.withInstall)(qe)})(),u})()));
1
+ import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
2
+ import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
3
+ import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
4
+ import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
5
+ import * as __WEBPACK_EXTERNAL_MODULE_lodash__ from "lodash";
6
+ /******/ var __webpack_modules__ = ({
7
+
8
+ /***/ 8022:
9
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10
+
11
+ var v1 = __webpack_require__(4481);
12
+ var v4 = __webpack_require__(6426);
13
+
14
+ var uuid = v4;
15
+ uuid.v1 = v1;
16
+ uuid.v4 = v4;
17
+
18
+ module.exports = uuid;
19
+
20
+
21
+ /***/ }),
22
+
23
+ /***/ 8725:
24
+ /***/ ((module) => {
25
+
26
+ /**
27
+ * Convert array of 16 byte values to UUID string format of the form:
28
+ * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
29
+ */
30
+ var byteToHex = [];
31
+ for (var i = 0; i < 256; ++i) {
32
+ byteToHex[i] = (i + 0x100).toString(16).substr(1);
33
+ }
34
+
35
+ function bytesToUuid(buf, offset) {
36
+ var i = offset || 0;
37
+ var bth = byteToHex;
38
+ // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4
39
+ return ([
40
+ bth[buf[i++]], bth[buf[i++]],
41
+ bth[buf[i++]], bth[buf[i++]], '-',
42
+ bth[buf[i++]], bth[buf[i++]], '-',
43
+ bth[buf[i++]], bth[buf[i++]], '-',
44
+ bth[buf[i++]], bth[buf[i++]], '-',
45
+ bth[buf[i++]], bth[buf[i++]],
46
+ bth[buf[i++]], bth[buf[i++]],
47
+ bth[buf[i++]], bth[buf[i++]]
48
+ ]).join('');
49
+ }
50
+
51
+ module.exports = bytesToUuid;
52
+
53
+
54
+ /***/ }),
55
+
56
+ /***/ 9157:
57
+ /***/ ((module) => {
58
+
59
+ // Unique ID creation requires a high quality random # generator. In the
60
+ // browser this is a little complicated due to unknown quality of Math.random()
61
+ // and inconsistent support for the `crypto` API. We do the best we can via
62
+ // feature-detection
63
+
64
+ // getRandomValues needs to be invoked in a context where "this" is a Crypto
65
+ // implementation. Also, find the complete implementation of crypto on IE11.
66
+ var getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||
67
+ (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));
68
+
69
+ if (getRandomValues) {
70
+ // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto
71
+ var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef
72
+
73
+ module.exports = function whatwgRNG() {
74
+ getRandomValues(rnds8);
75
+ return rnds8;
76
+ };
77
+ } else {
78
+ // Math.random()-based (RNG)
79
+ //
80
+ // If all else fails, use Math.random(). It's fast, but is of unspecified
81
+ // quality.
82
+ var rnds = new Array(16);
83
+
84
+ module.exports = function mathRNG() {
85
+ for (var i = 0, r; i < 16; i++) {
86
+ if ((i & 0x03) === 0) r = Math.random() * 0x100000000;
87
+ rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;
88
+ }
89
+
90
+ return rnds;
91
+ };
92
+ }
93
+
94
+
95
+ /***/ }),
96
+
97
+ /***/ 4481:
98
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
99
+
100
+ var rng = __webpack_require__(9157);
101
+ var bytesToUuid = __webpack_require__(8725);
102
+
103
+ // **`v1()` - Generate time-based UUID**
104
+ //
105
+ // Inspired by https://github.com/LiosK/UUID.js
106
+ // and http://docs.python.org/library/uuid.html
107
+
108
+ var _nodeId;
109
+ var _clockseq;
110
+
111
+ // Previous uuid creation time
112
+ var _lastMSecs = 0;
113
+ var _lastNSecs = 0;
114
+
115
+ // See https://github.com/uuidjs/uuid for API details
116
+ function v1(options, buf, offset) {
117
+ var i = buf && offset || 0;
118
+ var b = buf || [];
119
+
120
+ options = options || {};
121
+ var node = options.node || _nodeId;
122
+ var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;
123
+
124
+ // node and clockseq need to be initialized to random values if they're not
125
+ // specified. We do this lazily to minimize issues related to insufficient
126
+ // system entropy. See #189
127
+ if (node == null || clockseq == null) {
128
+ var seedBytes = rng();
129
+ if (node == null) {
130
+ // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)
131
+ node = _nodeId = [
132
+ seedBytes[0] | 0x01,
133
+ seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]
134
+ ];
135
+ }
136
+ if (clockseq == null) {
137
+ // Per 4.2.2, randomize (14 bit) clockseq
138
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
139
+ }
140
+ }
141
+
142
+ // UUID timestamps are 100 nano-second units since the Gregorian epoch,
143
+ // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so
144
+ // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'
145
+ // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
146
+ var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();
147
+
148
+ // Per 4.2.1.2, use count of uuid's generated during the current clock
149
+ // cycle to simulate higher resolution clock
150
+ var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
151
+
152
+ // Time since last uuid creation (in msecs)
153
+ var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
154
+
155
+ // Per 4.2.1.2, Bump clockseq on clock regression
156
+ if (dt < 0 && options.clockseq === undefined) {
157
+ clockseq = clockseq + 1 & 0x3fff;
158
+ }
159
+
160
+ // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
161
+ // time interval
162
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
163
+ nsecs = 0;
164
+ }
165
+
166
+ // Per 4.2.1.2 Throw error if too many uuids are requested
167
+ if (nsecs >= 10000) {
168
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
169
+ }
170
+
171
+ _lastMSecs = msecs;
172
+ _lastNSecs = nsecs;
173
+ _clockseq = clockseq;
174
+
175
+ // Per 4.1.4 - Convert from unix epoch to Gregorian epoch
176
+ msecs += 12219292800000;
177
+
178
+ // `time_low`
179
+ var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
180
+ b[i++] = tl >>> 24 & 0xff;
181
+ b[i++] = tl >>> 16 & 0xff;
182
+ b[i++] = tl >>> 8 & 0xff;
183
+ b[i++] = tl & 0xff;
184
+
185
+ // `time_mid`
186
+ var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;
187
+ b[i++] = tmh >>> 8 & 0xff;
188
+ b[i++] = tmh & 0xff;
189
+
190
+ // `time_high_and_version`
191
+ b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
192
+ b[i++] = tmh >>> 16 & 0xff;
193
+
194
+ // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
195
+ b[i++] = clockseq >>> 8 | 0x80;
196
+
197
+ // `clock_seq_low`
198
+ b[i++] = clockseq & 0xff;
199
+
200
+ // `node`
201
+ for (var n = 0; n < 6; ++n) {
202
+ b[i + n] = node[n];
203
+ }
204
+
205
+ return buf ? buf : bytesToUuid(b);
206
+ }
207
+
208
+ module.exports = v1;
209
+
210
+
211
+ /***/ }),
212
+
213
+ /***/ 6426:
214
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
215
+
216
+ var rng = __webpack_require__(9157);
217
+ var bytesToUuid = __webpack_require__(8725);
218
+
219
+ function v4(options, buf, offset) {
220
+ var i = buf && offset || 0;
221
+
222
+ if (typeof(options) == 'string') {
223
+ buf = options === 'binary' ? new Array(16) : null;
224
+ options = null;
225
+ }
226
+ options = options || {};
227
+
228
+ var rnds = options.random || (options.rng || rng)();
229
+
230
+ // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`
231
+ rnds[6] = (rnds[6] & 0x0f) | 0x40;
232
+ rnds[8] = (rnds[8] & 0x3f) | 0x80;
233
+
234
+ // Copy bytes to buffer, if provided
235
+ if (buf) {
236
+ for (var ii = 0; ii < 16; ++ii) {
237
+ buf[i + ii] = rnds[ii];
238
+ }
239
+ }
240
+
241
+ return buf || bytesToUuid(rnds);
242
+ }
243
+
244
+ module.exports = v4;
245
+
246
+
247
+ /***/ })
248
+
249
+ /******/ });
250
+ /************************************************************************/
251
+ /******/ // The module cache
252
+ /******/ var __webpack_module_cache__ = {};
253
+ /******/
254
+ /******/ // The require function
255
+ /******/ function __webpack_require__(moduleId) {
256
+ /******/ // Check if module is in cache
257
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
258
+ /******/ if (cachedModule !== undefined) {
259
+ /******/ return cachedModule.exports;
260
+ /******/ }
261
+ /******/ // Create a new module (and put it into the cache)
262
+ /******/ var module = __webpack_module_cache__[moduleId] = {
263
+ /******/ // no module.id needed
264
+ /******/ // no module.loaded needed
265
+ /******/ exports: {}
266
+ /******/ };
267
+ /******/
268
+ /******/ // Execute the module function
269
+ /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
270
+ /******/
271
+ /******/ // Return the exports of the module
272
+ /******/ return module.exports;
273
+ /******/ }
274
+ /******/
275
+ /************************************************************************/
276
+ /******/ /* webpack/runtime/define property getters */
277
+ /******/ (() => {
278
+ /******/ // define getter functions for harmony exports
279
+ /******/ __webpack_require__.d = (exports, definition) => {
280
+ /******/ for(var key in definition) {
281
+ /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
282
+ /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
283
+ /******/ }
284
+ /******/ }
285
+ /******/ };
286
+ /******/ })();
287
+ /******/
288
+ /******/ /* webpack/runtime/hasOwnProperty shorthand */
289
+ /******/ (() => {
290
+ /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
291
+ /******/ })();
292
+ /******/
293
+ /************************************************************************/
294
+ var __webpack_exports__ = {};
295
+ // This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
296
+ (() => {
297
+
298
+ // EXPORTS
299
+ __webpack_require__.d(__webpack_exports__, {
300
+ kB: () => (/* reexport */ createPopoverComponent),
301
+ uE: () => (/* reexport */ PopoverProps),
302
+ ZP: () => (/* binding */ src)
303
+ });
304
+
305
+ ;// CONCATENATED MODULE: external "../shared"
306
+ var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
307
+ var y = x => () => x
308
+ const external_shared_namespaceObject = x({ ["PlacementEnum"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PlacementEnum, ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["RenderType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.RenderType, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.bkZIndexManager, ["placementType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.placementType, ["renderType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.renderType, ["triggerType"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.triggerType, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
309
+ ;// CONCATENATED MODULE: external "vue"
310
+ var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
311
+ var external_vue_y = x => () => x
312
+ const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Teleport"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Teleport, ["Text"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Text, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createApp"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createApp, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
313
+ ;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
314
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
315
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
316
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
317
+ /*
318
+ * Tencent is pleased to support the open source community by making
319
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
320
+ *
321
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
322
+ *
323
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
324
+ *
325
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
326
+ *
327
+ * ---------------------------------------------------
328
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
329
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
330
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
331
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
332
+ *
333
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
334
+ * the Software.
335
+ *
336
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
337
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
338
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
339
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
340
+ * IN THE SOFTWARE.
341
+ */
342
+ var isElement = function isElement(e) {
343
+ if (typeof Element === 'undefined') return false;
344
+ return e instanceof Element;
345
+ };
346
+ var nodeList = new Map();
347
+ var startClick;
348
+ document.addEventListener('mousedown', function (e) {
349
+ return startClick = e;
350
+ });
351
+ document.addEventListener('mouseup', function (e) {
352
+ var _iterator = _createForOfIteratorHelper(nodeList.values()),
353
+ _step;
354
+ try {
355
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
356
+ var handlers = _step.value;
357
+ var _iterator2 = _createForOfIteratorHelper(handlers),
358
+ _step2;
359
+ try {
360
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
361
+ var documentHandler = _step2.value.documentHandler;
362
+ documentHandler(e, startClick);
363
+ }
364
+ } catch (err) {
365
+ _iterator2.e(err);
366
+ } finally {
367
+ _iterator2.f();
368
+ }
369
+ }
370
+ } catch (err) {
371
+ _iterator.e(err);
372
+ } finally {
373
+ _iterator.f();
374
+ }
375
+ });
376
+ function createDocumentHandler(el, binding) {
377
+ var excludes = [];
378
+ if (Array.isArray(binding.arg)) {
379
+ excludes = binding.arg;
380
+ } else if (isElement(binding.arg)) {
381
+ excludes.push(binding.arg);
382
+ }
383
+ return function (mouseup, mousedown) {
384
+ var popperRef = binding.instance.popperRef;
385
+ var mouseUpTarget = mouseup.target;
386
+ var mouseDownTarget = mousedown === null || mousedown === void 0 ? void 0 : mousedown.target;
387
+ var isBound = !binding || !binding.instance;
388
+ var isTargetExists = !mouseUpTarget || !mouseDownTarget;
389
+ var isContainedByEl = el.contains(mouseUpTarget) || el.contains(mouseDownTarget);
390
+ var isSelf = el === mouseUpTarget;
391
+ var isTargetExcluded = excludes.length && excludes.some(function (item) {
392
+ return item === null || item === void 0 ? void 0 : item.contains(mouseUpTarget);
393
+ }) || excludes.length && excludes.includes(mouseDownTarget);
394
+ var isContainedByPopper = popperRef && (popperRef.contains(mouseUpTarget) || popperRef.contains(mouseDownTarget));
395
+ if (isBound || isTargetExists || isContainedByEl || isSelf || isTargetExcluded || isContainedByPopper) {
396
+ return;
397
+ }
398
+ binding.value(mouseup, mousedown);
399
+ };
400
+ }
401
+ var ClickOutside = {
402
+ beforeMount: function beforeMount(el, binding) {
403
+ if (!nodeList.has(el)) {
404
+ nodeList.set(el, []);
405
+ }
406
+ nodeList.get(el).push({
407
+ documentHandler: createDocumentHandler(el, binding),
408
+ bindingFn: binding.value
409
+ });
410
+ },
411
+ updated: function updated(el, binding) {
412
+ if (!nodeList.has(el)) {
413
+ nodeList.set(el, []);
414
+ }
415
+ var handlers = nodeList.get(el);
416
+ var oldHandlerIndex = handlers.findIndex(function (item) {
417
+ return item.bindingFn === binding.oldValue;
418
+ });
419
+ var newHandler = {
420
+ documentHandler: createDocumentHandler(el, binding),
421
+ bindingFn: binding.value
422
+ };
423
+ if (oldHandlerIndex >= 0) {
424
+ // replace the old handler to the new handler
425
+ handlers.splice(oldHandlerIndex, 1, newHandler);
426
+ } else {
427
+ handlers.push(newHandler);
428
+ }
429
+ },
430
+ unmounted: function unmounted(el) {
431
+ // remove all listeners when a component unmounted
432
+ nodeList["delete"](el);
433
+ }
434
+ };
435
+ ClickOutside.install = function (app) {
436
+ app.directive('bkTooltips', ClickOutside);
437
+ };
438
+ /* harmony default export */ const clickoutside = (ClickOutside);
439
+ ;// CONCATENATED MODULE: external "../config-provider"
440
+ var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
441
+ var external_config_provider_y = x => () => x
442
+ const external_config_provider_namespaceObject = external_config_provider_x({ ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
443
+ ;// CONCATENATED MODULE: ../../packages/popover/src/arrow.tsx
444
+
445
+ /*
446
+ * Tencent is pleased to support the open source community by making
447
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
448
+ *
449
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
450
+ *
451
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
452
+ *
453
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
454
+ *
455
+ * ---------------------------------------------------
456
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
457
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
458
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
459
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
460
+ *
461
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
462
+ * the Software.
463
+ *
464
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
465
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
466
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
467
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
468
+ * IN THE SOFTWARE.
469
+ */
470
+
471
+
472
+ /* harmony default export */ const src_arrow = ((0,external_vue_namespaceObject.defineComponent)({
473
+ name: 'PopArrow',
474
+ render: function render() {
475
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
476
+ resolveClassName = _usePrefix.resolveClassName;
477
+ var arrowClassName = resolveClassName('pop2-arrow');
478
+ return (0,external_vue_namespaceObject.createVNode)("div", {
479
+ "class": arrowClassName
480
+ }, null);
481
+ }
482
+ }));
483
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
484
+ function _typeof(obj) {
485
+ "@babel/helpers - typeof";
486
+
487
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
488
+ return typeof obj;
489
+ } : function (obj) {
490
+ return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
491
+ }, _typeof(obj);
492
+ }
493
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
494
+
495
+ function _toPrimitive(input, hint) {
496
+ if (_typeof(input) !== "object" || input === null) return input;
497
+ var prim = input[Symbol.toPrimitive];
498
+ if (prim !== undefined) {
499
+ var res = prim.call(input, hint || "default");
500
+ if (_typeof(res) !== "object") return res;
501
+ throw new TypeError("@@toPrimitive must return a primitive value.");
502
+ }
503
+ return (hint === "string" ? String : Number)(input);
504
+ }
505
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
506
+
507
+
508
+ function _toPropertyKey(arg) {
509
+ var key = _toPrimitive(arg, "string");
510
+ return _typeof(key) === "symbol" ? key : String(key);
511
+ }
512
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
513
+
514
+ function _defineProperty(obj, key, value) {
515
+ key = _toPropertyKey(key);
516
+ if (key in obj) {
517
+ Object.defineProperty(obj, key, {
518
+ value: value,
519
+ enumerable: true,
520
+ configurable: true,
521
+ writable: true
522
+ });
523
+ } else {
524
+ obj[key] = value;
525
+ }
526
+ return obj;
527
+ }
528
+ ;// CONCATENATED MODULE: ../../packages/popover/src/const.tsx
529
+
530
+ var _EMIT_EVENT_TYPES;
531
+ /* eslint-disable @typescript-eslint/naming-convention */
532
+ /*
533
+ * Tencent is pleased to support the open source community by making
534
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
535
+ *
536
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
537
+ *
538
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
539
+ *
540
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
541
+ *
542
+ * ---------------------------------------------------
543
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
544
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
545
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
546
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
547
+ *
548
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
549
+ * the Software.
550
+ *
551
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
552
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
553
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
554
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
555
+ * IN THE SOFTWARE.
556
+ */
557
+ // eslint-disable-next-line @typescript-eslint/naming-convention
558
+ var EMIT_EVENTS;
559
+ (function (EMIT_EVENTS) {
560
+ EMIT_EVENTS["CLICK_OUTSIDE"] = "clickoutside";
561
+ EMIT_EVENTS["CONTENT_MOUSEENTER"] = "contentMouseenter";
562
+ EMIT_EVENTS["CONTENT_MOUSELEAVE"] = "contentMouseleave";
563
+ EMIT_EVENTS["CONTENT_AfterHidden"] = "afterHidden";
564
+ EMIT_EVENTS["CONTENT_AfterShow"] = "afterShow";
565
+ })(EMIT_EVENTS || (EMIT_EVENTS = {}));
566
+ var EVENT_SHOW_HIDE_FN = function EVENT_SHOW_HIDE_FN(_args) {
567
+ return true;
568
+ };
569
+ var EVENT_COMMON_FN = function EVENT_COMMON_FN(e) {
570
+ return e;
571
+ };
572
+ var EVENT_CLICK_OUTSIDE_FN = function EVENT_CLICK_OUTSIDE_FN(_args) {
573
+ return true;
574
+ };
575
+ var EMIT_EVENT_TYPES = (_EMIT_EVENT_TYPES = {}, _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CLICK_OUTSIDE, EVENT_CLICK_OUTSIDE_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_MOUSEENTER, EVENT_COMMON_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_MOUSELEAVE, EVENT_COMMON_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_AfterHidden, EVENT_SHOW_HIDE_FN), _defineProperty(_EMIT_EVENT_TYPES, EMIT_EVENTS.CONTENT_AfterShow, EVENT_SHOW_HIDE_FN), _EMIT_EVENT_TYPES);
576
+ ;// CONCATENATED MODULE: ../../packages/popover/src/content.tsx
577
+
578
+ /*
579
+ * Tencent is pleased to support the open source community by making
580
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
581
+ *
582
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
583
+ *
584
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
585
+ *
586
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
587
+ *
588
+ * ---------------------------------------------------
589
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
590
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
591
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
592
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
593
+ *
594
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
595
+ * the Software.
596
+ *
597
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
598
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
599
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
600
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
601
+ * IN THE SOFTWARE.
602
+ */
603
+
604
+
605
+
606
+ /* harmony default export */ const content = ((0,external_vue_namespaceObject.defineComponent)({
607
+ name: 'PopContent',
608
+ props: {
609
+ width: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
610
+ height: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
611
+ maxHeight: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
612
+ maxWidth: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
613
+ extCls: external_shared_namespaceObject.PropTypes.string.def(''),
614
+ visible: external_shared_namespaceObject.PropTypes.bool.def(false),
615
+ eventDelay: external_shared_namespaceObject.PropTypes.number.def(0)
616
+ },
617
+ setup: function setup(props) {
618
+ var resolveValToPix = function resolveValToPix(val) {
619
+ if (/^\d+\.?\d*$/.test("".concat(val))) {
620
+ return "".concat(val, "px");
621
+ }
622
+ return val;
623
+ };
624
+ var style = (0,external_vue_namespaceObject.computed)(function () {
625
+ return {
626
+ width: resolveValToPix(props.width),
627
+ height: resolveValToPix(props.height),
628
+ maxHeight: resolveValToPix(props.maxHeight),
629
+ maxWidth: resolveValToPix(props.maxWidth)
630
+ };
631
+ });
632
+ var refContent = (0,external_vue_namespaceObject.ref)(null);
633
+ var refTimer = (0,external_vue_namespaceObject.ref)(null);
634
+ var resetPointerEvent = function resetPointerEvent() {
635
+ var _a;
636
+ if (props.eventDelay === 0) {
637
+ return;
638
+ }
639
+ refTimer.value && clearTimeout(refTimer.value);
640
+ refTimer.value = setTimeout(function () {
641
+ setContentPointerEvent('unset');
642
+ }, (_a = props.eventDelay) !== null && _a !== void 0 ? _a : 300);
643
+ };
644
+ var setContentPointerEvent = function setContentPointerEvent(val) {
645
+ var _a;
646
+ if (props.eventDelay === 0) {
647
+ return;
648
+ }
649
+ (_a = refContent.value) === null || _a === void 0 ? void 0 : _a.style.setProperty('pointer-events', val);
650
+ };
651
+ var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
652
+ resolveClassName = _usePrefix.resolveClassName;
653
+ return {
654
+ style: style,
655
+ refContent: refContent,
656
+ resolveClassName: resolveClassName,
657
+ resetPointerEvent: resetPointerEvent,
658
+ setContentPointerEvent: setContentPointerEvent
659
+ };
660
+ },
661
+ render: function render() {
662
+ var _this = this;
663
+ var _a, _b, _c, _d, _e, _f, _g, _h;
664
+ var className = [this.resolveClassName('popover'), this.resolveClassName('pop2-content'), this.extCls];
665
+ var resolveContentStyle = function resolveContentStyle(slot) {
666
+ var _a;
667
+ if (external_vue_namespaceObject.Fragment === ((_a = slot === null || slot === void 0 ? void 0 : slot[0]) === null || _a === void 0 ? void 0 : _a.type)) {
668
+ (0,external_vue_namespaceObject.nextTick)(function () {
669
+ _this.setContentPointerEvent('none');
670
+ _this.resetPointerEvent();
671
+ });
672
+ }
673
+ return _this.style;
674
+ };
675
+ var style = resolveContentStyle((_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a));
676
+ return (0,external_vue_namespaceObject.createVNode)("div", {
677
+ "class": className,
678
+ "style": style,
679
+ "ref": "refContent"
680
+ }, [(_e = (_d = (_c = this.$slots).arrow) === null || _d === void 0 ? void 0 : _d.call(_c)) !== null && _e !== void 0 ? _e : '', (_h = (_g = (_f = this.$slots)["default"]) === null || _g === void 0 ? void 0 : _g.call(_f)) !== null && _h !== void 0 ? _h : '']);
681
+ }
682
+ }));
683
+ ;// CONCATENATED MODULE: external "vue-types"
684
+ var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
685
+ var external_vue_types_y = x => () => x
686
+ const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
687
+ ;// CONCATENATED MODULE: ../../packages/popover/src/props.ts
688
+
689
+
690
+ var EventProps = {
691
+ onAfterHidden: function onAfterHidden() {},
692
+ onAfterShow: function onAfterShow() {}
693
+ };
694
+ var PopoverProps = {
695
+ isShow: external_shared_namespaceObject.PropTypes.bool.def(false),
696
+ always: external_shared_namespaceObject.PropTypes.bool.def(false),
697
+ disabled: external_shared_namespaceObject.PropTypes.bool.def(false),
698
+ width: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
699
+ height: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
700
+ maxWidth: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
701
+ maxHeight: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.number]).def('auto'),
702
+ content: (0,external_vue_types_namespaceObject.toType)('IContent', {}).def(''),
703
+ target: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string, external_shared_namespaceObject.PropTypes.instanceOf(HTMLElement), external_shared_namespaceObject.PropTypes.instanceOf(PointerEvent)]),
704
+ allowHtml: external_shared_namespaceObject.PropTypes.bool.def(false),
705
+ /**
706
+ * 组件显示位置
707
+ */
708
+ // placement: placementType().def(PlacementEnum.TOP),
709
+ placement: (0,external_shared_namespaceObject.placementType)().def(external_shared_namespaceObject.PlacementEnum.TOP_START),
710
+ // 'dark', 'light'
711
+ theme: external_shared_namespaceObject.PropTypes.string.def('dark'),
712
+ /**
713
+ * 触发方式
714
+ * 支持 click hover manual
715
+ * manual: 通过isShow控制显示、隐藏
716
+ */
717
+ // trigger: triggerType(),
718
+ trigger: (0,external_shared_namespaceObject.triggerType)(),
719
+ /**
720
+ * content 渲染方式
721
+ */
722
+ renderType: (0,external_shared_namespaceObject.renderType)(),
723
+ // 是否显示箭头
724
+ arrow: external_shared_namespaceObject.PropTypes.bool.def(true),
725
+ padding: external_shared_namespaceObject.PropTypes.number.def(5),
726
+ offset: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.shape({
727
+ mainAxis: external_shared_namespaceObject.PropTypes.number,
728
+ crossAxis: external_shared_namespaceObject.PropTypes.number,
729
+ alignmentAxis: external_shared_namespaceObject.PropTypes.number
730
+ })]).def(6),
731
+ /**
732
+ * 弹出内容绑定元素
733
+ */
734
+ boundary: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.string.def('parent'), external_shared_namespaceObject.PropTypes.instanceOf(HTMLElement)]),
735
+ zIndex: external_shared_namespaceObject.PropTypes.number.def(undefined),
736
+ disableTeleport: external_shared_namespaceObject.PropTypes.bool.def(false),
737
+ /**
738
+ * chooses the placement that has the most space available automatically
739
+ */
740
+ autoPlacement: external_shared_namespaceObject.PropTypes.bool.def(false),
741
+ /**
742
+ * 当有滚动条,滚动出可是范围时自动隐藏pop
743
+ */
744
+ autoVisibility: external_shared_namespaceObject.PropTypes.bool.def(true),
745
+ /**
746
+ * 是否禁用clickoutside
747
+ */
748
+ disableOutsideClick: external_shared_namespaceObject.PropTypes.bool.def(false),
749
+ /**
750
+ * 是否禁用样式的transform更新位移
751
+ */
752
+ disableTransform: external_shared_namespaceObject.PropTypes.bool.def(false),
753
+ /**
754
+ * 自定义 reference
755
+ */
756
+ reference: external_shared_namespaceObject.PropTypes.any,
757
+ /**
758
+ * 兼容v1版本遗留配置
759
+ * 不建议使用
760
+ */
761
+ modifiers: external_shared_namespaceObject.PropTypes.array.def([]),
762
+ /**
763
+ * popover显示和隐藏的延时时间
764
+ */
765
+ popoverDelay: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.arrayOf(external_shared_namespaceObject.PropTypes.number)]).def(100),
766
+ /**
767
+ * 配置自定义样式类名,传入的类会被加在组件最外层的 DOM
768
+ */
769
+ extCls: external_shared_namespaceObject.PropTypes.string.def(''),
770
+ /**
771
+ * 自定义Content组件渲染,point-event延迟渲染时间
772
+ * 避免子组件point-event渲染时触发popover鼠标事件
773
+ * 如果设置为0,则不启用此设置
774
+ */
775
+ componentEventDelay: external_shared_namespaceObject.PropTypes.number.def(0),
776
+ /**
777
+ * 或略其他判定条件,强制监听clickoutside & 执行hide
778
+ */
779
+ forceClickoutside: external_shared_namespaceObject.PropTypes.bool.def(false)
780
+ };
781
+ ;// CONCATENATED MODULE: ../../packages/popover/src/reference.tsx
782
+ /*
783
+ * Tencent is pleased to support the open source community by making
784
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
785
+ *
786
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
787
+ *
788
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
789
+ *
790
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
791
+ *
792
+ * ---------------------------------------------------
793
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
794
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
795
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
796
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
797
+ *
798
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
799
+ * the Software.
800
+ *
801
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
802
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
803
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
804
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
805
+ * IN THE SOFTWARE.
806
+ */
807
+
808
+ /* harmony default export */ const reference = ((0,external_vue_namespaceObject.defineComponent)({
809
+ name: 'PopReference',
810
+ render: function render() {
811
+ var _a, _b, _c;
812
+ return (_c = (_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : '';
813
+ }
814
+ }));
815
+ ;// CONCATENATED MODULE: ../../packages/popover/src/root.tsx
816
+
817
+ /*
818
+ * Tencent is pleased to support the open source community by making
819
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
820
+ *
821
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
822
+ *
823
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
824
+ *
825
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
826
+ *
827
+ * ---------------------------------------------------
828
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
829
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
830
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
831
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
832
+ *
833
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
834
+ * the Software.
835
+ *
836
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
837
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
838
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
839
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
840
+ * IN THE SOFTWARE.
841
+ */
842
+
843
+
844
+ /* harmony default export */ const root = ((0,external_vue_namespaceObject.defineComponent)({
845
+ props: {
846
+ "class": external_shared_namespaceObject.PropTypes.string.def(''),
847
+ mode: external_shared_namespaceObject.PropTypes.string.def('')
848
+ },
849
+ render: function render() {
850
+ var _a, _b;
851
+ return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(_b = (_a = this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)]);
852
+ }
853
+ }));
854
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
855
+ function _arrayWithHoles(arr) {
856
+ if (Array.isArray(arr)) return arr;
857
+ }
858
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
859
+ function _iterableToArrayLimit(arr, i) {
860
+ var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
861
+ if (null != _i) {
862
+ var _s,
863
+ _e,
864
+ _x,
865
+ _r,
866
+ _arr = [],
867
+ _n = !0,
868
+ _d = !1;
869
+ try {
870
+ if (_x = (_i = _i.call(arr)).next, 0 === i) {
871
+ if (Object(_i) !== _i) return;
872
+ _n = !1;
873
+ } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
874
+ } catch (err) {
875
+ _d = !0, _e = err;
876
+ } finally {
877
+ try {
878
+ if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
879
+ } finally {
880
+ if (_d) throw _e;
881
+ }
882
+ }
883
+ return _arr;
884
+ }
885
+ }
886
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
887
+ function arrayLikeToArray_arrayLikeToArray(arr, len) {
888
+ if (len == null || len > arr.length) len = arr.length;
889
+ for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
890
+ return arr2;
891
+ }
892
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
893
+
894
+ function unsupportedIterableToArray_unsupportedIterableToArray(o, minLen) {
895
+ if (!o) return;
896
+ if (typeof o === "string") return arrayLikeToArray_arrayLikeToArray(o, minLen);
897
+ var n = Object.prototype.toString.call(o).slice(8, -1);
898
+ if (n === "Object" && o.constructor) n = o.constructor.name;
899
+ if (n === "Map" || n === "Set") return Array.from(o);
900
+ if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray_arrayLikeToArray(o, minLen);
901
+ }
902
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
903
+ function _nonIterableRest() {
904
+ throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
905
+ }
906
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
907
+
908
+
909
+
910
+
911
+ function _slicedToArray(arr, i) {
912
+ return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || unsupportedIterableToArray_unsupportedIterableToArray(arr, i) || _nonIterableRest();
913
+ }
914
+ ;// CONCATENATED MODULE: external "lodash"
915
+ var external_lodash_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
916
+ var external_lodash_y = x => () => x
917
+ const external_lodash_namespaceObject = external_lodash_x({ ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE_lodash__.isElement });
918
+ ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
919
+ const sides = ['top', 'right', 'bottom', 'left'];
920
+ const alignments = ['start', 'end'];
921
+ const placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + "-" + alignments[0], side + "-" + alignments[1]), []);
922
+ const floating_ui_utils_min = Math.min;
923
+ const floating_ui_utils_max = Math.max;
924
+ const round = Math.round;
925
+ const floor = Math.floor;
926
+ const createCoords = v => ({
927
+ x: v,
928
+ y: v
929
+ });
930
+ const oppositeSideMap = {
931
+ left: 'right',
932
+ right: 'left',
933
+ bottom: 'top',
934
+ top: 'bottom'
935
+ };
936
+ const oppositeAlignmentMap = {
937
+ start: 'end',
938
+ end: 'start'
939
+ };
940
+ function clamp(start, value, end) {
941
+ return floating_ui_utils_max(start, floating_ui_utils_min(value, end));
942
+ }
943
+ function floating_ui_utils_evaluate(value, param) {
944
+ return typeof value === 'function' ? value(param) : value;
945
+ }
946
+ function floating_ui_utils_getSide(placement) {
947
+ return placement.split('-')[0];
948
+ }
949
+ function floating_ui_utils_getAlignment(placement) {
950
+ return placement.split('-')[1];
951
+ }
952
+ function floating_ui_utils_getOppositeAxis(axis) {
953
+ return axis === 'x' ? 'y' : 'x';
954
+ }
955
+ function getAxisLength(axis) {
956
+ return axis === 'y' ? 'height' : 'width';
957
+ }
958
+ function floating_ui_utils_getSideAxis(placement) {
959
+ return ['top', 'bottom'].includes(floating_ui_utils_getSide(placement)) ? 'y' : 'x';
960
+ }
961
+ function getAlignmentAxis(placement) {
962
+ return floating_ui_utils_getOppositeAxis(floating_ui_utils_getSideAxis(placement));
963
+ }
964
+ function getAlignmentSides(placement, rects, rtl) {
965
+ if (rtl === void 0) {
966
+ rtl = false;
967
+ }
968
+ const alignment = floating_ui_utils_getAlignment(placement);
969
+ const alignmentAxis = getAlignmentAxis(placement);
970
+ const length = getAxisLength(alignmentAxis);
971
+ let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';
972
+ if (rects.reference[length] > rects.floating[length]) {
973
+ mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
974
+ }
975
+ return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
976
+ }
977
+ function getExpandedPlacements(placement) {
978
+ const oppositePlacement = getOppositePlacement(placement);
979
+ return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
980
+ }
981
+ function getOppositeAlignmentPlacement(placement) {
982
+ return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);
983
+ }
984
+ function getSideList(side, isStart, rtl) {
985
+ const lr = ['left', 'right'];
986
+ const rl = ['right', 'left'];
987
+ const tb = ['top', 'bottom'];
988
+ const bt = ['bottom', 'top'];
989
+ switch (side) {
990
+ case 'top':
991
+ case 'bottom':
992
+ if (rtl) return isStart ? rl : lr;
993
+ return isStart ? lr : rl;
994
+ case 'left':
995
+ case 'right':
996
+ return isStart ? tb : bt;
997
+ default:
998
+ return [];
999
+ }
1000
+ }
1001
+ function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
1002
+ const alignment = floating_ui_utils_getAlignment(placement);
1003
+ let list = getSideList(floating_ui_utils_getSide(placement), direction === 'start', rtl);
1004
+ if (alignment) {
1005
+ list = list.map(side => side + "-" + alignment);
1006
+ if (flipAlignment) {
1007
+ list = list.concat(list.map(getOppositeAlignmentPlacement));
1008
+ }
1009
+ }
1010
+ return list;
1011
+ }
1012
+ function getOppositePlacement(placement) {
1013
+ return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);
1014
+ }
1015
+ function expandPaddingObject(padding) {
1016
+ return {
1017
+ top: 0,
1018
+ right: 0,
1019
+ bottom: 0,
1020
+ left: 0,
1021
+ ...padding
1022
+ };
1023
+ }
1024
+ function getPaddingObject(padding) {
1025
+ return typeof padding !== 'number' ? expandPaddingObject(padding) : {
1026
+ top: padding,
1027
+ right: padding,
1028
+ bottom: padding,
1029
+ left: padding
1030
+ };
1031
+ }
1032
+ function rectToClientRect(rect) {
1033
+ return {
1034
+ ...rect,
1035
+ top: rect.y,
1036
+ left: rect.x,
1037
+ right: rect.x + rect.width,
1038
+ bottom: rect.y + rect.height
1039
+ };
1040
+ }
1041
+
1042
+
1043
+
1044
+ ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs
1045
+
1046
+
1047
+
1048
+ function computeCoordsFromPlacement(_ref, placement, rtl) {
1049
+ let {
1050
+ reference,
1051
+ floating
1052
+ } = _ref;
1053
+ const sideAxis = floating_ui_utils_getSideAxis(placement);
1054
+ const alignmentAxis = getAlignmentAxis(placement);
1055
+ const alignLength = getAxisLength(alignmentAxis);
1056
+ const side = floating_ui_utils_getSide(placement);
1057
+ const isVertical = sideAxis === 'y';
1058
+ const commonX = reference.x + reference.width / 2 - floating.width / 2;
1059
+ const commonY = reference.y + reference.height / 2 - floating.height / 2;
1060
+ const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;
1061
+ let coords;
1062
+ switch (side) {
1063
+ case 'top':
1064
+ coords = {
1065
+ x: commonX,
1066
+ y: reference.y - floating.height
1067
+ };
1068
+ break;
1069
+ case 'bottom':
1070
+ coords = {
1071
+ x: commonX,
1072
+ y: reference.y + reference.height
1073
+ };
1074
+ break;
1075
+ case 'right':
1076
+ coords = {
1077
+ x: reference.x + reference.width,
1078
+ y: commonY
1079
+ };
1080
+ break;
1081
+ case 'left':
1082
+ coords = {
1083
+ x: reference.x - floating.width,
1084
+ y: commonY
1085
+ };
1086
+ break;
1087
+ default:
1088
+ coords = {
1089
+ x: reference.x,
1090
+ y: reference.y
1091
+ };
1092
+ }
1093
+ switch (floating_ui_utils_getAlignment(placement)) {
1094
+ case 'start':
1095
+ coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);
1096
+ break;
1097
+ case 'end':
1098
+ coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);
1099
+ break;
1100
+ }
1101
+ return coords;
1102
+ }
1103
+
1104
+ /**
1105
+ * Computes the `x` and `y` coordinates that will place the floating element
1106
+ * next to a reference element when it is given a certain positioning strategy.
1107
+ *
1108
+ * This export does not have any `platform` interface logic. You will need to
1109
+ * write one for the platform you are using Floating UI with.
1110
+ */
1111
+ const computePosition = async (reference, floating, config) => {
1112
+ const {
1113
+ placement = 'bottom',
1114
+ strategy = 'absolute',
1115
+ middleware = [],
1116
+ platform
1117
+ } = config;
1118
+ const validMiddleware = middleware.filter(Boolean);
1119
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));
1120
+ let rects = await platform.getElementRects({
1121
+ reference,
1122
+ floating,
1123
+ strategy
1124
+ });
1125
+ let {
1126
+ x,
1127
+ y
1128
+ } = computeCoordsFromPlacement(rects, placement, rtl);
1129
+ let statefulPlacement = placement;
1130
+ let middlewareData = {};
1131
+ let resetCount = 0;
1132
+ for (let i = 0; i < validMiddleware.length; i++) {
1133
+ const {
1134
+ name,
1135
+ fn
1136
+ } = validMiddleware[i];
1137
+ const {
1138
+ x: nextX,
1139
+ y: nextY,
1140
+ data,
1141
+ reset
1142
+ } = await fn({
1143
+ x,
1144
+ y,
1145
+ initialPlacement: placement,
1146
+ placement: statefulPlacement,
1147
+ strategy,
1148
+ middlewareData,
1149
+ rects,
1150
+ platform,
1151
+ elements: {
1152
+ reference,
1153
+ floating
1154
+ }
1155
+ });
1156
+ x = nextX != null ? nextX : x;
1157
+ y = nextY != null ? nextY : y;
1158
+ middlewareData = {
1159
+ ...middlewareData,
1160
+ [name]: {
1161
+ ...middlewareData[name],
1162
+ ...data
1163
+ }
1164
+ };
1165
+ if (reset && resetCount <= 50) {
1166
+ resetCount++;
1167
+ if (typeof reset === 'object') {
1168
+ if (reset.placement) {
1169
+ statefulPlacement = reset.placement;
1170
+ }
1171
+ if (reset.rects) {
1172
+ rects = reset.rects === true ? await platform.getElementRects({
1173
+ reference,
1174
+ floating,
1175
+ strategy
1176
+ }) : reset.rects;
1177
+ }
1178
+ ({
1179
+ x,
1180
+ y
1181
+ } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));
1182
+ }
1183
+ i = -1;
1184
+ continue;
1185
+ }
1186
+ }
1187
+ return {
1188
+ x,
1189
+ y,
1190
+ placement: statefulPlacement,
1191
+ strategy,
1192
+ middlewareData
1193
+ };
1194
+ };
1195
+
1196
+ /**
1197
+ * Resolves with an object of overflow side offsets that determine how much the
1198
+ * element is overflowing a given clipping boundary on each side.
1199
+ * - positive = overflowing the boundary by that number of pixels
1200
+ * - negative = how many pixels left before it will overflow
1201
+ * - 0 = lies flush with the boundary
1202
+ * @see https://floating-ui.com/docs/detectOverflow
1203
+ */
1204
+ async function detectOverflow(state, options) {
1205
+ var _await$platform$isEle;
1206
+ if (options === void 0) {
1207
+ options = {};
1208
+ }
1209
+ const {
1210
+ x,
1211
+ y,
1212
+ platform,
1213
+ rects,
1214
+ elements,
1215
+ strategy
1216
+ } = state;
1217
+ const {
1218
+ boundary = 'clippingAncestors',
1219
+ rootBoundary = 'viewport',
1220
+ elementContext = 'floating',
1221
+ altBoundary = false,
1222
+ padding = 0
1223
+ } = floating_ui_utils_evaluate(options, state);
1224
+ const paddingObject = getPaddingObject(padding);
1225
+ const altContext = elementContext === 'floating' ? 'reference' : 'floating';
1226
+ const element = elements[altBoundary ? altContext : elementContext];
1227
+ const clippingClientRect = rectToClientRect(await platform.getClippingRect({
1228
+ element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),
1229
+ boundary,
1230
+ rootBoundary,
1231
+ strategy
1232
+ }));
1233
+ const rect = elementContext === 'floating' ? {
1234
+ ...rects.floating,
1235
+ x,
1236
+ y
1237
+ } : rects.reference;
1238
+ const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));
1239
+ const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {
1240
+ x: 1,
1241
+ y: 1
1242
+ } : {
1243
+ x: 1,
1244
+ y: 1
1245
+ };
1246
+ const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({
1247
+ rect,
1248
+ offsetParent,
1249
+ strategy
1250
+ }) : rect);
1251
+ return {
1252
+ top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
1253
+ bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
1254
+ left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
1255
+ right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
1256
+ };
1257
+ }
1258
+
1259
+ /**
1260
+ * Provides data to position an inner element of the floating element so that it
1261
+ * appears centered to the reference element.
1262
+ * @see https://floating-ui.com/docs/arrow
1263
+ */
1264
+ const arrow = options => ({
1265
+ name: 'arrow',
1266
+ options,
1267
+ async fn(state) {
1268
+ const {
1269
+ x,
1270
+ y,
1271
+ placement,
1272
+ rects,
1273
+ platform,
1274
+ elements
1275
+ } = state;
1276
+ // Since `element` is required, we don't Partial<> the type.
1277
+ const {
1278
+ element,
1279
+ padding = 0
1280
+ } = floating_ui_utils_evaluate(options, state) || {};
1281
+ if (element == null) {
1282
+ return {};
1283
+ }
1284
+ const paddingObject = getPaddingObject(padding);
1285
+ const coords = {
1286
+ x,
1287
+ y
1288
+ };
1289
+ const axis = getAlignmentAxis(placement);
1290
+ const length = getAxisLength(axis);
1291
+ const arrowDimensions = await platform.getDimensions(element);
1292
+ const isYAxis = axis === 'y';
1293
+ const minProp = isYAxis ? 'top' : 'left';
1294
+ const maxProp = isYAxis ? 'bottom' : 'right';
1295
+ const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';
1296
+ const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
1297
+ const startDiff = coords[axis] - rects.reference[axis];
1298
+ const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));
1299
+ let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
1300
+
1301
+ // DOM platform can return `window` as the `offsetParent`.
1302
+ if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {
1303
+ clientSize = elements.floating[clientProp] || rects.floating[length];
1304
+ }
1305
+ const centerToReference = endDiff / 2 - startDiff / 2;
1306
+
1307
+ // If the padding is large enough that it causes the arrow to no longer be
1308
+ // centered, modify the padding so that it is centered.
1309
+ const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
1310
+ const minPadding = floating_ui_utils_min(paddingObject[minProp], largestPossiblePadding);
1311
+ const maxPadding = floating_ui_utils_min(paddingObject[maxProp], largestPossiblePadding);
1312
+
1313
+ // Make sure the arrow doesn't overflow the floating element if the center
1314
+ // point is outside the floating element's bounds.
1315
+ const min$1 = minPadding;
1316
+ const max = clientSize - arrowDimensions[length] - maxPadding;
1317
+ const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
1318
+ const offset = clamp(min$1, center, max);
1319
+
1320
+ // If the reference is small enough that the arrow's padding causes it to
1321
+ // to point to nothing for an aligned placement, adjust the offset of the
1322
+ // floating element itself. This stops `shift()` from taking action, but can
1323
+ // be worked around by calling it again after the `arrow()` if desired.
1324
+ const shouldAddOffset = floating_ui_utils_getAlignment(placement) != null && center != offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
1325
+ const alignmentOffset = shouldAddOffset ? center < min$1 ? min$1 - center : max - center : 0;
1326
+ return {
1327
+ [axis]: coords[axis] - alignmentOffset,
1328
+ data: {
1329
+ [axis]: offset,
1330
+ centerOffset: center - offset + alignmentOffset
1331
+ }
1332
+ };
1333
+ }
1334
+ });
1335
+
1336
+ function getPlacementList(alignment, autoAlignment, allowedPlacements) {
1337
+ const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => floating_ui_utils_getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => floating_ui_utils_getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => floating_ui_utils_getSide(placement) === placement);
1338
+ return allowedPlacementsSortedByAlignment.filter(placement => {
1339
+ if (alignment) {
1340
+ return floating_ui_utils_getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
1341
+ }
1342
+ return true;
1343
+ });
1344
+ }
1345
+ /**
1346
+ * Optimizes the visibility of the floating element by choosing the placement
1347
+ * that has the most space available automatically, without needing to specify a
1348
+ * preferred placement. Alternative to `flip`.
1349
+ * @see https://floating-ui.com/docs/autoPlacement
1350
+ */
1351
+ const autoPlacement = function (options) {
1352
+ if (options === void 0) {
1353
+ options = {};
1354
+ }
1355
+ return {
1356
+ name: 'autoPlacement',
1357
+ options,
1358
+ async fn(state) {
1359
+ var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;
1360
+ const {
1361
+ rects,
1362
+ middlewareData,
1363
+ placement,
1364
+ platform,
1365
+ elements
1366
+ } = state;
1367
+ const {
1368
+ crossAxis = false,
1369
+ alignment,
1370
+ allowedPlacements = placements,
1371
+ autoAlignment = true,
1372
+ ...detectOverflowOptions
1373
+ } = floating_ui_utils_evaluate(options, state);
1374
+ const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;
1375
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1376
+ const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;
1377
+ const currentPlacement = placements$1[currentIndex];
1378
+ if (currentPlacement == null) {
1379
+ return {};
1380
+ }
1381
+ const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));
1382
+
1383
+ // Make `computeCoords` start from the right place.
1384
+ if (placement !== currentPlacement) {
1385
+ return {
1386
+ reset: {
1387
+ placement: placements$1[0]
1388
+ }
1389
+ };
1390
+ }
1391
+ const currentOverflows = [overflow[floating_ui_utils_getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];
1392
+ const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {
1393
+ placement: currentPlacement,
1394
+ overflows: currentOverflows
1395
+ }];
1396
+ const nextPlacement = placements$1[currentIndex + 1];
1397
+
1398
+ // There are more placements to check.
1399
+ if (nextPlacement) {
1400
+ return {
1401
+ data: {
1402
+ index: currentIndex + 1,
1403
+ overflows: allOverflows
1404
+ },
1405
+ reset: {
1406
+ placement: nextPlacement
1407
+ }
1408
+ };
1409
+ }
1410
+ const placementsSortedByMostSpace = allOverflows.map(d => {
1411
+ const alignment = floating_ui_utils_getAlignment(d.placement);
1412
+ return [d.placement, alignment && crossAxis ?
1413
+ // Check along the mainAxis and main crossAxis side.
1414
+ d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :
1415
+ // Check only the mainAxis.
1416
+ d.overflows[0], d.overflows];
1417
+ }).sort((a, b) => a[1] - b[1]);
1418
+ const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,
1419
+ // Aligned placements should not check their opposite crossAxis
1420
+ // side.
1421
+ floating_ui_utils_getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));
1422
+ const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];
1423
+ if (resetPlacement !== placement) {
1424
+ return {
1425
+ data: {
1426
+ index: currentIndex + 1,
1427
+ overflows: allOverflows
1428
+ },
1429
+ reset: {
1430
+ placement: resetPlacement
1431
+ }
1432
+ };
1433
+ }
1434
+ return {};
1435
+ }
1436
+ };
1437
+ };
1438
+
1439
+ /**
1440
+ * Optimizes the visibility of the floating element by flipping the `placement`
1441
+ * in order to keep it in view when the preferred placement(s) will overflow the
1442
+ * clipping boundary. Alternative to `autoPlacement`.
1443
+ * @see https://floating-ui.com/docs/flip
1444
+ */
1445
+ const flip = function (options) {
1446
+ if (options === void 0) {
1447
+ options = {};
1448
+ }
1449
+ return {
1450
+ name: 'flip',
1451
+ options,
1452
+ async fn(state) {
1453
+ var _middlewareData$flip;
1454
+ const {
1455
+ placement,
1456
+ middlewareData,
1457
+ rects,
1458
+ initialPlacement,
1459
+ platform,
1460
+ elements
1461
+ } = state;
1462
+ const {
1463
+ mainAxis: checkMainAxis = true,
1464
+ crossAxis: checkCrossAxis = true,
1465
+ fallbackPlacements: specifiedFallbackPlacements,
1466
+ fallbackStrategy = 'bestFit',
1467
+ fallbackAxisSideDirection = 'none',
1468
+ flipAlignment = true,
1469
+ ...detectOverflowOptions
1470
+ } = floating_ui_utils_evaluate(options, state);
1471
+ const side = floating_ui_utils_getSide(placement);
1472
+ const isBasePlacement = floating_ui_utils_getSide(initialPlacement) === initialPlacement;
1473
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1474
+ const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
1475
+ if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== 'none') {
1476
+ fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
1477
+ }
1478
+ const placements = [initialPlacement, ...fallbackPlacements];
1479
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1480
+ const overflows = [];
1481
+ let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
1482
+ if (checkMainAxis) {
1483
+ overflows.push(overflow[side]);
1484
+ }
1485
+ if (checkCrossAxis) {
1486
+ const sides = getAlignmentSides(placement, rects, rtl);
1487
+ overflows.push(overflow[sides[0]], overflow[sides[1]]);
1488
+ }
1489
+ overflowsData = [...overflowsData, {
1490
+ placement,
1491
+ overflows
1492
+ }];
1493
+
1494
+ // One or more sides is overflowing.
1495
+ if (!overflows.every(side => side <= 0)) {
1496
+ var _middlewareData$flip2, _overflowsData$filter;
1497
+ const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
1498
+ const nextPlacement = placements[nextIndex];
1499
+ if (nextPlacement) {
1500
+ // Try next placement and re-run the lifecycle.
1501
+ return {
1502
+ data: {
1503
+ index: nextIndex,
1504
+ overflows: overflowsData
1505
+ },
1506
+ reset: {
1507
+ placement: nextPlacement
1508
+ }
1509
+ };
1510
+ }
1511
+
1512
+ // First, find the candidates that fit on the mainAxis side of overflow,
1513
+ // then find the placement that fits the best on the main crossAxis side.
1514
+ let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
1515
+
1516
+ // Otherwise fallback.
1517
+ if (!resetPlacement) {
1518
+ switch (fallbackStrategy) {
1519
+ case 'bestFit':
1520
+ {
1521
+ var _overflowsData$map$so;
1522
+ const placement = (_overflowsData$map$so = overflowsData.map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
1523
+ if (placement) {
1524
+ resetPlacement = placement;
1525
+ }
1526
+ break;
1527
+ }
1528
+ case 'initialPlacement':
1529
+ resetPlacement = initialPlacement;
1530
+ break;
1531
+ }
1532
+ }
1533
+ if (placement !== resetPlacement) {
1534
+ return {
1535
+ reset: {
1536
+ placement: resetPlacement
1537
+ }
1538
+ };
1539
+ }
1540
+ }
1541
+ return {};
1542
+ }
1543
+ };
1544
+ };
1545
+
1546
+ function getSideOffsets(overflow, rect) {
1547
+ return {
1548
+ top: overflow.top - rect.height,
1549
+ right: overflow.right - rect.width,
1550
+ bottom: overflow.bottom - rect.height,
1551
+ left: overflow.left - rect.width
1552
+ };
1553
+ }
1554
+ function isAnySideFullyClipped(overflow) {
1555
+ return sides.some(side => overflow[side] >= 0);
1556
+ }
1557
+ /**
1558
+ * Provides data to hide the floating element in applicable situations, such as
1559
+ * when it is not in the same clipping context as the reference element.
1560
+ * @see https://floating-ui.com/docs/hide
1561
+ */
1562
+ const hide = function (options) {
1563
+ if (options === void 0) {
1564
+ options = {};
1565
+ }
1566
+ return {
1567
+ name: 'hide',
1568
+ options,
1569
+ async fn(state) {
1570
+ const {
1571
+ rects
1572
+ } = state;
1573
+ const {
1574
+ strategy = 'referenceHidden',
1575
+ ...detectOverflowOptions
1576
+ } = floating_ui_utils_evaluate(options, state);
1577
+ switch (strategy) {
1578
+ case 'referenceHidden':
1579
+ {
1580
+ const overflow = await detectOverflow(state, {
1581
+ ...detectOverflowOptions,
1582
+ elementContext: 'reference'
1583
+ });
1584
+ const offsets = getSideOffsets(overflow, rects.reference);
1585
+ return {
1586
+ data: {
1587
+ referenceHiddenOffsets: offsets,
1588
+ referenceHidden: isAnySideFullyClipped(offsets)
1589
+ }
1590
+ };
1591
+ }
1592
+ case 'escaped':
1593
+ {
1594
+ const overflow = await detectOverflow(state, {
1595
+ ...detectOverflowOptions,
1596
+ altBoundary: true
1597
+ });
1598
+ const offsets = getSideOffsets(overflow, rects.floating);
1599
+ return {
1600
+ data: {
1601
+ escapedOffsets: offsets,
1602
+ escaped: isAnySideFullyClipped(offsets)
1603
+ }
1604
+ };
1605
+ }
1606
+ default:
1607
+ {
1608
+ return {};
1609
+ }
1610
+ }
1611
+ }
1612
+ };
1613
+ };
1614
+
1615
+ function getBoundingRect(rects) {
1616
+ const minX = floating_ui_utils_min(...rects.map(rect => rect.left));
1617
+ const minY = floating_ui_utils_min(...rects.map(rect => rect.top));
1618
+ const maxX = floating_ui_utils_max(...rects.map(rect => rect.right));
1619
+ const maxY = floating_ui_utils_max(...rects.map(rect => rect.bottom));
1620
+ return {
1621
+ x: minX,
1622
+ y: minY,
1623
+ width: maxX - minX,
1624
+ height: maxY - minY
1625
+ };
1626
+ }
1627
+ function getRectsByLine(rects) {
1628
+ const sortedRects = rects.slice().sort((a, b) => a.y - b.y);
1629
+ const groups = [];
1630
+ let prevRect = null;
1631
+ for (let i = 0; i < sortedRects.length; i++) {
1632
+ const rect = sortedRects[i];
1633
+ if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {
1634
+ groups.push([rect]);
1635
+ } else {
1636
+ groups[groups.length - 1].push(rect);
1637
+ }
1638
+ prevRect = rect;
1639
+ }
1640
+ return groups.map(rect => rectToClientRect(getBoundingRect(rect)));
1641
+ }
1642
+ /**
1643
+ * Provides improved positioning for inline reference elements that can span
1644
+ * over multiple lines, such as hyperlinks or range selections.
1645
+ * @see https://floating-ui.com/docs/inline
1646
+ */
1647
+ const inline = function (options) {
1648
+ if (options === void 0) {
1649
+ options = {};
1650
+ }
1651
+ return {
1652
+ name: 'inline',
1653
+ options,
1654
+ async fn(state) {
1655
+ const {
1656
+ placement,
1657
+ elements,
1658
+ rects,
1659
+ platform,
1660
+ strategy
1661
+ } = state;
1662
+ // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a
1663
+ // ClientRect's bounds, despite the event listener being triggered. A
1664
+ // padding of 2 seems to handle this issue.
1665
+ const {
1666
+ padding = 2,
1667
+ x,
1668
+ y
1669
+ } = floating_ui_utils_evaluate(options, state);
1670
+ const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);
1671
+ const clientRects = getRectsByLine(nativeClientRects);
1672
+ const fallback = rectToClientRect(getBoundingRect(nativeClientRects));
1673
+ const paddingObject = getPaddingObject(padding);
1674
+ function getBoundingClientRect() {
1675
+ // There are two rects and they are disjoined.
1676
+ if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {
1677
+ // Find the first rect in which the point is fully inside.
1678
+ return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;
1679
+ }
1680
+
1681
+ // There are 2 or more connected rects.
1682
+ if (clientRects.length >= 2) {
1683
+ if (floating_ui_utils_getSideAxis(placement) === 'y') {
1684
+ const firstRect = clientRects[0];
1685
+ const lastRect = clientRects[clientRects.length - 1];
1686
+ const isTop = floating_ui_utils_getSide(placement) === 'top';
1687
+ const top = firstRect.top;
1688
+ const bottom = lastRect.bottom;
1689
+ const left = isTop ? firstRect.left : lastRect.left;
1690
+ const right = isTop ? firstRect.right : lastRect.right;
1691
+ const width = right - left;
1692
+ const height = bottom - top;
1693
+ return {
1694
+ top,
1695
+ bottom,
1696
+ left,
1697
+ right,
1698
+ width,
1699
+ height,
1700
+ x: left,
1701
+ y: top
1702
+ };
1703
+ }
1704
+ const isLeftSide = floating_ui_utils_getSide(placement) === 'left';
1705
+ const maxRight = floating_ui_utils_max(...clientRects.map(rect => rect.right));
1706
+ const minLeft = floating_ui_utils_min(...clientRects.map(rect => rect.left));
1707
+ const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);
1708
+ const top = measureRects[0].top;
1709
+ const bottom = measureRects[measureRects.length - 1].bottom;
1710
+ const left = minLeft;
1711
+ const right = maxRight;
1712
+ const width = right - left;
1713
+ const height = bottom - top;
1714
+ return {
1715
+ top,
1716
+ bottom,
1717
+ left,
1718
+ right,
1719
+ width,
1720
+ height,
1721
+ x: left,
1722
+ y: top
1723
+ };
1724
+ }
1725
+ return fallback;
1726
+ }
1727
+ const resetRects = await platform.getElementRects({
1728
+ reference: {
1729
+ getBoundingClientRect
1730
+ },
1731
+ floating: elements.floating,
1732
+ strategy
1733
+ });
1734
+ if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {
1735
+ return {
1736
+ reset: {
1737
+ rects: resetRects
1738
+ }
1739
+ };
1740
+ }
1741
+ return {};
1742
+ }
1743
+ };
1744
+ };
1745
+
1746
+ // For type backwards-compatibility, the `OffsetOptions` type was also
1747
+ // Derivable.
1748
+ async function convertValueToCoords(state, options) {
1749
+ const {
1750
+ placement,
1751
+ platform,
1752
+ elements
1753
+ } = state;
1754
+ const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));
1755
+ const side = floating_ui_utils_getSide(placement);
1756
+ const alignment = floating_ui_utils_getAlignment(placement);
1757
+ const isVertical = floating_ui_utils_getSideAxis(placement) === 'y';
1758
+ const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;
1759
+ const crossAxisMulti = rtl && isVertical ? -1 : 1;
1760
+ const rawValue = floating_ui_utils_evaluate(options, state);
1761
+
1762
+ // eslint-disable-next-line prefer-const
1763
+ let {
1764
+ mainAxis,
1765
+ crossAxis,
1766
+ alignmentAxis
1767
+ } = typeof rawValue === 'number' ? {
1768
+ mainAxis: rawValue,
1769
+ crossAxis: 0,
1770
+ alignmentAxis: null
1771
+ } : {
1772
+ mainAxis: 0,
1773
+ crossAxis: 0,
1774
+ alignmentAxis: null,
1775
+ ...rawValue
1776
+ };
1777
+ if (alignment && typeof alignmentAxis === 'number') {
1778
+ crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;
1779
+ }
1780
+ return isVertical ? {
1781
+ x: crossAxis * crossAxisMulti,
1782
+ y: mainAxis * mainAxisMulti
1783
+ } : {
1784
+ x: mainAxis * mainAxisMulti,
1785
+ y: crossAxis * crossAxisMulti
1786
+ };
1787
+ }
1788
+
1789
+ /**
1790
+ * Modifies the placement by translating the floating element along the
1791
+ * specified axes.
1792
+ * A number (shorthand for `mainAxis` or distance), or an axes configuration
1793
+ * object may be passed.
1794
+ * @see https://floating-ui.com/docs/offset
1795
+ */
1796
+ const offset = function (options) {
1797
+ if (options === void 0) {
1798
+ options = 0;
1799
+ }
1800
+ return {
1801
+ name: 'offset',
1802
+ options,
1803
+ async fn(state) {
1804
+ const {
1805
+ x,
1806
+ y
1807
+ } = state;
1808
+ const diffCoords = await convertValueToCoords(state, options);
1809
+ return {
1810
+ x: x + diffCoords.x,
1811
+ y: y + diffCoords.y,
1812
+ data: diffCoords
1813
+ };
1814
+ }
1815
+ };
1816
+ };
1817
+
1818
+ /**
1819
+ * Optimizes the visibility of the floating element by shifting it in order to
1820
+ * keep it in view when it will overflow the clipping boundary.
1821
+ * @see https://floating-ui.com/docs/shift
1822
+ */
1823
+ const shift = function (options) {
1824
+ if (options === void 0) {
1825
+ options = {};
1826
+ }
1827
+ return {
1828
+ name: 'shift',
1829
+ options,
1830
+ async fn(state) {
1831
+ const {
1832
+ x,
1833
+ y,
1834
+ placement
1835
+ } = state;
1836
+ const {
1837
+ mainAxis: checkMainAxis = true,
1838
+ crossAxis: checkCrossAxis = false,
1839
+ limiter = {
1840
+ fn: _ref => {
1841
+ let {
1842
+ x,
1843
+ y
1844
+ } = _ref;
1845
+ return {
1846
+ x,
1847
+ y
1848
+ };
1849
+ }
1850
+ },
1851
+ ...detectOverflowOptions
1852
+ } = floating_ui_utils_evaluate(options, state);
1853
+ const coords = {
1854
+ x,
1855
+ y
1856
+ };
1857
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1858
+ const crossAxis = floating_ui_utils_getSideAxis(floating_ui_utils_getSide(placement));
1859
+ const mainAxis = floating_ui_utils_getOppositeAxis(crossAxis);
1860
+ let mainAxisCoord = coords[mainAxis];
1861
+ let crossAxisCoord = coords[crossAxis];
1862
+ if (checkMainAxis) {
1863
+ const minSide = mainAxis === 'y' ? 'top' : 'left';
1864
+ const maxSide = mainAxis === 'y' ? 'bottom' : 'right';
1865
+ const min = mainAxisCoord + overflow[minSide];
1866
+ const max = mainAxisCoord - overflow[maxSide];
1867
+ mainAxisCoord = clamp(min, mainAxisCoord, max);
1868
+ }
1869
+ if (checkCrossAxis) {
1870
+ const minSide = crossAxis === 'y' ? 'top' : 'left';
1871
+ const maxSide = crossAxis === 'y' ? 'bottom' : 'right';
1872
+ const min = crossAxisCoord + overflow[minSide];
1873
+ const max = crossAxisCoord - overflow[maxSide];
1874
+ crossAxisCoord = clamp(min, crossAxisCoord, max);
1875
+ }
1876
+ const limitedCoords = limiter.fn({
1877
+ ...state,
1878
+ [mainAxis]: mainAxisCoord,
1879
+ [crossAxis]: crossAxisCoord
1880
+ });
1881
+ return {
1882
+ ...limitedCoords,
1883
+ data: {
1884
+ x: limitedCoords.x - x,
1885
+ y: limitedCoords.y - y
1886
+ }
1887
+ };
1888
+ }
1889
+ };
1890
+ };
1891
+ /**
1892
+ * Built-in `limiter` that will stop `shift()` at a certain point.
1893
+ */
1894
+ const limitShift = function (options) {
1895
+ if (options === void 0) {
1896
+ options = {};
1897
+ }
1898
+ return {
1899
+ options,
1900
+ fn(state) {
1901
+ const {
1902
+ x,
1903
+ y,
1904
+ placement,
1905
+ rects,
1906
+ middlewareData
1907
+ } = state;
1908
+ const {
1909
+ offset = 0,
1910
+ mainAxis: checkMainAxis = true,
1911
+ crossAxis: checkCrossAxis = true
1912
+ } = evaluate(options, state);
1913
+ const coords = {
1914
+ x,
1915
+ y
1916
+ };
1917
+ const crossAxis = getSideAxis(placement);
1918
+ const mainAxis = getOppositeAxis(crossAxis);
1919
+ let mainAxisCoord = coords[mainAxis];
1920
+ let crossAxisCoord = coords[crossAxis];
1921
+ const rawOffset = evaluate(offset, state);
1922
+ const computedOffset = typeof rawOffset === 'number' ? {
1923
+ mainAxis: rawOffset,
1924
+ crossAxis: 0
1925
+ } : {
1926
+ mainAxis: 0,
1927
+ crossAxis: 0,
1928
+ ...rawOffset
1929
+ };
1930
+ if (checkMainAxis) {
1931
+ const len = mainAxis === 'y' ? 'height' : 'width';
1932
+ const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;
1933
+ const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;
1934
+ if (mainAxisCoord < limitMin) {
1935
+ mainAxisCoord = limitMin;
1936
+ } else if (mainAxisCoord > limitMax) {
1937
+ mainAxisCoord = limitMax;
1938
+ }
1939
+ }
1940
+ if (checkCrossAxis) {
1941
+ var _middlewareData$offse, _middlewareData$offse2;
1942
+ const len = mainAxis === 'y' ? 'width' : 'height';
1943
+ const isOriginSide = ['top', 'left'].includes(getSide(placement));
1944
+ const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);
1945
+ const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);
1946
+ if (crossAxisCoord < limitMin) {
1947
+ crossAxisCoord = limitMin;
1948
+ } else if (crossAxisCoord > limitMax) {
1949
+ crossAxisCoord = limitMax;
1950
+ }
1951
+ }
1952
+ return {
1953
+ [mainAxis]: mainAxisCoord,
1954
+ [crossAxis]: crossAxisCoord
1955
+ };
1956
+ }
1957
+ };
1958
+ };
1959
+
1960
+ /**
1961
+ * Provides data that allows you to change the size of the floating element —
1962
+ * for instance, prevent it from overflowing the clipping boundary or match the
1963
+ * width of the reference element.
1964
+ * @see https://floating-ui.com/docs/size
1965
+ */
1966
+ const size = function (options) {
1967
+ if (options === void 0) {
1968
+ options = {};
1969
+ }
1970
+ return {
1971
+ name: 'size',
1972
+ options,
1973
+ async fn(state) {
1974
+ const {
1975
+ placement,
1976
+ rects,
1977
+ platform,
1978
+ elements
1979
+ } = state;
1980
+ const {
1981
+ apply = () => {},
1982
+ ...detectOverflowOptions
1983
+ } = evaluate(options, state);
1984
+ const overflow = await detectOverflow(state, detectOverflowOptions);
1985
+ const side = getSide(placement);
1986
+ const alignment = getAlignment(placement);
1987
+ const isYAxis = getSideAxis(placement) === 'y';
1988
+ const {
1989
+ width,
1990
+ height
1991
+ } = rects.floating;
1992
+ let heightSide;
1993
+ let widthSide;
1994
+ if (side === 'top' || side === 'bottom') {
1995
+ heightSide = side;
1996
+ widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';
1997
+ } else {
1998
+ widthSide = side;
1999
+ heightSide = alignment === 'end' ? 'top' : 'bottom';
2000
+ }
2001
+ const overflowAvailableHeight = height - overflow[heightSide];
2002
+ const overflowAvailableWidth = width - overflow[widthSide];
2003
+ const noShift = !state.middlewareData.shift;
2004
+ let availableHeight = overflowAvailableHeight;
2005
+ let availableWidth = overflowAvailableWidth;
2006
+ if (isYAxis) {
2007
+ const maximumClippingWidth = width - overflow.left - overflow.right;
2008
+ availableWidth = alignment || noShift ? min(overflowAvailableWidth, maximumClippingWidth) : maximumClippingWidth;
2009
+ } else {
2010
+ const maximumClippingHeight = height - overflow.top - overflow.bottom;
2011
+ availableHeight = alignment || noShift ? min(overflowAvailableHeight, maximumClippingHeight) : maximumClippingHeight;
2012
+ }
2013
+ if (noShift && !alignment) {
2014
+ const xMin = max(overflow.left, 0);
2015
+ const xMax = max(overflow.right, 0);
2016
+ const yMin = max(overflow.top, 0);
2017
+ const yMax = max(overflow.bottom, 0);
2018
+ if (isYAxis) {
2019
+ availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));
2020
+ } else {
2021
+ availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));
2022
+ }
2023
+ }
2024
+ await apply({
2025
+ ...state,
2026
+ availableWidth,
2027
+ availableHeight
2028
+ });
2029
+ const nextDimensions = await platform.getDimensions(elements.floating);
2030
+ if (width !== nextDimensions.width || height !== nextDimensions.height) {
2031
+ return {
2032
+ reset: {
2033
+ rects: true
2034
+ }
2035
+ };
2036
+ }
2037
+ return {};
2038
+ }
2039
+ };
2040
+ };
2041
+
2042
+
2043
+
2044
+ ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/utils/dom/dist/floating-ui.utils.dom.mjs
2045
+ function getNodeName(node) {
2046
+ if (isNode(node)) {
2047
+ return (node.nodeName || '').toLowerCase();
2048
+ }
2049
+ // Mocked nodes in testing environments may not be instances of Node. By
2050
+ // returning `#document` an infinite loop won't occur.
2051
+ // https://github.com/floating-ui/floating-ui/issues/2317
2052
+ return '#document';
2053
+ }
2054
+ function getWindow(node) {
2055
+ var _node$ownerDocument;
2056
+ return (node == null ? void 0 : (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
2057
+ }
2058
+ function getDocumentElement(node) {
2059
+ var _ref;
2060
+ return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
2061
+ }
2062
+ function isNode(value) {
2063
+ return value instanceof Node || value instanceof getWindow(value).Node;
2064
+ }
2065
+ function floating_ui_utils_dom_isElement(value) {
2066
+ return value instanceof Element || value instanceof getWindow(value).Element;
2067
+ }
2068
+ function isHTMLElement(value) {
2069
+ return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;
2070
+ }
2071
+ function isShadowRoot(value) {
2072
+ // Browsers without `ShadowRoot` support.
2073
+ if (typeof ShadowRoot === 'undefined') {
2074
+ return false;
2075
+ }
2076
+ return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
2077
+ }
2078
+ function isOverflowElement(element) {
2079
+ const {
2080
+ overflow,
2081
+ overflowX,
2082
+ overflowY,
2083
+ display
2084
+ } = getComputedStyle(element);
2085
+ return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);
2086
+ }
2087
+ function isTableElement(element) {
2088
+ return ['table', 'td', 'th'].includes(getNodeName(element));
2089
+ }
2090
+ function isContainingBlock(element) {
2091
+ const webkit = isWebKit();
2092
+ const css = getComputedStyle(element);
2093
+
2094
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
2095
+ return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));
2096
+ }
2097
+ function isWebKit() {
2098
+ if (typeof CSS === 'undefined' || !CSS.supports) return false;
2099
+ return CSS.supports('-webkit-backdrop-filter', 'none');
2100
+ }
2101
+ function isLastTraversableNode(node) {
2102
+ return ['html', 'body', '#document'].includes(getNodeName(node));
2103
+ }
2104
+ function getComputedStyle(element) {
2105
+ return getWindow(element).getComputedStyle(element);
2106
+ }
2107
+ function getNodeScroll(element) {
2108
+ if (floating_ui_utils_dom_isElement(element)) {
2109
+ return {
2110
+ scrollLeft: element.scrollLeft,
2111
+ scrollTop: element.scrollTop
2112
+ };
2113
+ }
2114
+ return {
2115
+ scrollLeft: element.pageXOffset,
2116
+ scrollTop: element.pageYOffset
2117
+ };
2118
+ }
2119
+ function getParentNode(node) {
2120
+ if (getNodeName(node) === 'html') {
2121
+ return node;
2122
+ }
2123
+ const result =
2124
+ // Step into the shadow DOM of the parent of a slotted node.
2125
+ node.assignedSlot ||
2126
+ // DOM Element detected.
2127
+ node.parentNode ||
2128
+ // ShadowRoot detected.
2129
+ isShadowRoot(node) && node.host ||
2130
+ // Fallback.
2131
+ getDocumentElement(node);
2132
+ return isShadowRoot(result) ? result.host : result;
2133
+ }
2134
+ function getNearestOverflowAncestor(node) {
2135
+ const parentNode = getParentNode(node);
2136
+ if (isLastTraversableNode(parentNode)) {
2137
+ return node.ownerDocument ? node.ownerDocument.body : node.body;
2138
+ }
2139
+ if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {
2140
+ return parentNode;
2141
+ }
2142
+ return getNearestOverflowAncestor(parentNode);
2143
+ }
2144
+ function getOverflowAncestors(node, list) {
2145
+ var _node$ownerDocument2;
2146
+ if (list === void 0) {
2147
+ list = [];
2148
+ }
2149
+ const scrollableAncestor = getNearestOverflowAncestor(node);
2150
+ const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);
2151
+ const win = getWindow(scrollableAncestor);
2152
+ if (isBody) {
2153
+ return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : []);
2154
+ }
2155
+ return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor));
2156
+ }
2157
+
2158
+
2159
+
2160
+ ;// CONCATENATED MODULE: ../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs
2161
+
2162
+
2163
+
2164
+
2165
+
2166
+
2167
+ function getCssDimensions(element) {
2168
+ const css = getComputedStyle(element);
2169
+ // In testing environments, the `width` and `height` properties are empty
2170
+ // strings for SVG elements, returning NaN. Fallback to `0` in this case.
2171
+ let width = parseFloat(css.width) || 0;
2172
+ let height = parseFloat(css.height) || 0;
2173
+ const hasOffset = isHTMLElement(element);
2174
+ const offsetWidth = hasOffset ? element.offsetWidth : width;
2175
+ const offsetHeight = hasOffset ? element.offsetHeight : height;
2176
+ const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;
2177
+ if (shouldFallback) {
2178
+ width = offsetWidth;
2179
+ height = offsetHeight;
2180
+ }
2181
+ return {
2182
+ width,
2183
+ height,
2184
+ $: shouldFallback
2185
+ };
2186
+ }
2187
+
2188
+ function unwrapElement(element) {
2189
+ return !floating_ui_utils_dom_isElement(element) ? element.contextElement : element;
2190
+ }
2191
+
2192
+ function getScale(element) {
2193
+ const domElement = unwrapElement(element);
2194
+ if (!isHTMLElement(domElement)) {
2195
+ return createCoords(1);
2196
+ }
2197
+ const rect = domElement.getBoundingClientRect();
2198
+ const {
2199
+ width,
2200
+ height,
2201
+ $
2202
+ } = getCssDimensions(domElement);
2203
+ let x = ($ ? round(rect.width) : rect.width) / width;
2204
+ let y = ($ ? round(rect.height) : rect.height) / height;
2205
+
2206
+ // 0, NaN, or Infinity should always fallback to 1.
2207
+
2208
+ if (!x || !Number.isFinite(x)) {
2209
+ x = 1;
2210
+ }
2211
+ if (!y || !Number.isFinite(y)) {
2212
+ y = 1;
2213
+ }
2214
+ return {
2215
+ x,
2216
+ y
2217
+ };
2218
+ }
2219
+
2220
+ const noOffsets = /*#__PURE__*/createCoords(0);
2221
+ function getVisualOffsets(element) {
2222
+ const win = getWindow(element);
2223
+ if (!isWebKit() || !win.visualViewport) {
2224
+ return noOffsets;
2225
+ }
2226
+ return {
2227
+ x: win.visualViewport.offsetLeft,
2228
+ y: win.visualViewport.offsetTop
2229
+ };
2230
+ }
2231
+ function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {
2232
+ if (isFixed === void 0) {
2233
+ isFixed = false;
2234
+ }
2235
+ if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {
2236
+ return false;
2237
+ }
2238
+ return isFixed;
2239
+ }
2240
+
2241
+ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {
2242
+ if (includeScale === void 0) {
2243
+ includeScale = false;
2244
+ }
2245
+ if (isFixedStrategy === void 0) {
2246
+ isFixedStrategy = false;
2247
+ }
2248
+ const clientRect = element.getBoundingClientRect();
2249
+ const domElement = unwrapElement(element);
2250
+ let scale = createCoords(1);
2251
+ if (includeScale) {
2252
+ if (offsetParent) {
2253
+ if (floating_ui_utils_dom_isElement(offsetParent)) {
2254
+ scale = getScale(offsetParent);
2255
+ }
2256
+ } else {
2257
+ scale = getScale(element);
2258
+ }
2259
+ }
2260
+ const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);
2261
+ let x = (clientRect.left + visualOffsets.x) / scale.x;
2262
+ let y = (clientRect.top + visualOffsets.y) / scale.y;
2263
+ let width = clientRect.width / scale.x;
2264
+ let height = clientRect.height / scale.y;
2265
+ if (domElement) {
2266
+ const win = getWindow(domElement);
2267
+ const offsetWin = offsetParent && floating_ui_utils_dom_isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;
2268
+ let currentIFrame = win.frameElement;
2269
+ while (currentIFrame && offsetParent && offsetWin !== win) {
2270
+ const iframeScale = getScale(currentIFrame);
2271
+ const iframeRect = currentIFrame.getBoundingClientRect();
2272
+ const css = getComputedStyle(currentIFrame);
2273
+ const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;
2274
+ const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;
2275
+ x *= iframeScale.x;
2276
+ y *= iframeScale.y;
2277
+ width *= iframeScale.x;
2278
+ height *= iframeScale.y;
2279
+ x += left;
2280
+ y += top;
2281
+ currentIFrame = getWindow(currentIFrame).frameElement;
2282
+ }
2283
+ }
2284
+ return rectToClientRect({
2285
+ width,
2286
+ height,
2287
+ x,
2288
+ y
2289
+ });
2290
+ }
2291
+
2292
+ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
2293
+ let {
2294
+ rect,
2295
+ offsetParent,
2296
+ strategy
2297
+ } = _ref;
2298
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
2299
+ const documentElement = getDocumentElement(offsetParent);
2300
+ if (offsetParent === documentElement) {
2301
+ return rect;
2302
+ }
2303
+ let scroll = {
2304
+ scrollLeft: 0,
2305
+ scrollTop: 0
2306
+ };
2307
+ let scale = createCoords(1);
2308
+ const offsets = createCoords(0);
2309
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== 'fixed') {
2310
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
2311
+ scroll = getNodeScroll(offsetParent);
2312
+ }
2313
+ if (isHTMLElement(offsetParent)) {
2314
+ const offsetRect = getBoundingClientRect(offsetParent);
2315
+ scale = getScale(offsetParent);
2316
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
2317
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2318
+ }
2319
+ }
2320
+ return {
2321
+ width: rect.width * scale.x,
2322
+ height: rect.height * scale.y,
2323
+ x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
2324
+ y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
2325
+ };
2326
+ }
2327
+
2328
+ function getClientRects(element) {
2329
+ return Array.from(element.getClientRects());
2330
+ }
2331
+
2332
+ function getWindowScrollBarX(element) {
2333
+ // If <html> has a CSS width greater than the viewport, then this will be
2334
+ // incorrect for RTL.
2335
+ return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
2336
+ }
2337
+
2338
+ // Gets the entire size of the scrollable document area, even extending outside
2339
+ // of the `<html>` and `<body>` rect bounds if horizontally scrollable.
2340
+ function getDocumentRect(element) {
2341
+ const html = getDocumentElement(element);
2342
+ const scroll = getNodeScroll(element);
2343
+ const body = element.ownerDocument.body;
2344
+ const width = floating_ui_utils_max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);
2345
+ const height = floating_ui_utils_max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);
2346
+ let x = -scroll.scrollLeft + getWindowScrollBarX(element);
2347
+ const y = -scroll.scrollTop;
2348
+ if (getComputedStyle(body).direction === 'rtl') {
2349
+ x += floating_ui_utils_max(html.clientWidth, body.clientWidth) - width;
2350
+ }
2351
+ return {
2352
+ width,
2353
+ height,
2354
+ x,
2355
+ y
2356
+ };
2357
+ }
2358
+
2359
+ function getViewportRect(element, strategy) {
2360
+ const win = getWindow(element);
2361
+ const html = getDocumentElement(element);
2362
+ const visualViewport = win.visualViewport;
2363
+ let width = html.clientWidth;
2364
+ let height = html.clientHeight;
2365
+ let x = 0;
2366
+ let y = 0;
2367
+ if (visualViewport) {
2368
+ width = visualViewport.width;
2369
+ height = visualViewport.height;
2370
+ const visualViewportBased = isWebKit();
2371
+ if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {
2372
+ x = visualViewport.offsetLeft;
2373
+ y = visualViewport.offsetTop;
2374
+ }
2375
+ }
2376
+ return {
2377
+ width,
2378
+ height,
2379
+ x,
2380
+ y
2381
+ };
2382
+ }
2383
+
2384
+ // Returns the inner client rect, subtracting scrollbars if present.
2385
+ function getInnerBoundingClientRect(element, strategy) {
2386
+ const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');
2387
+ const top = clientRect.top + element.clientTop;
2388
+ const left = clientRect.left + element.clientLeft;
2389
+ const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);
2390
+ const width = element.clientWidth * scale.x;
2391
+ const height = element.clientHeight * scale.y;
2392
+ const x = left * scale.x;
2393
+ const y = top * scale.y;
2394
+ return {
2395
+ width,
2396
+ height,
2397
+ x,
2398
+ y
2399
+ };
2400
+ }
2401
+ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {
2402
+ let rect;
2403
+ if (clippingAncestor === 'viewport') {
2404
+ rect = getViewportRect(element, strategy);
2405
+ } else if (clippingAncestor === 'document') {
2406
+ rect = getDocumentRect(getDocumentElement(element));
2407
+ } else if (floating_ui_utils_dom_isElement(clippingAncestor)) {
2408
+ rect = getInnerBoundingClientRect(clippingAncestor, strategy);
2409
+ } else {
2410
+ const visualOffsets = getVisualOffsets(element);
2411
+ rect = {
2412
+ ...clippingAncestor,
2413
+ x: clippingAncestor.x - visualOffsets.x,
2414
+ y: clippingAncestor.y - visualOffsets.y
2415
+ };
2416
+ }
2417
+ return rectToClientRect(rect);
2418
+ }
2419
+ function hasFixedPositionAncestor(element, stopNode) {
2420
+ const parentNode = getParentNode(element);
2421
+ if (parentNode === stopNode || !floating_ui_utils_dom_isElement(parentNode) || isLastTraversableNode(parentNode)) {
2422
+ return false;
2423
+ }
2424
+ return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);
2425
+ }
2426
+
2427
+ // A "clipping ancestor" is an `overflow` element with the characteristic of
2428
+ // clipping (or hiding) child elements. This returns all clipping ancestors
2429
+ // of the given element up the tree.
2430
+ function getClippingElementAncestors(element, cache) {
2431
+ const cachedResult = cache.get(element);
2432
+ if (cachedResult) {
2433
+ return cachedResult;
2434
+ }
2435
+ let result = getOverflowAncestors(element).filter(el => floating_ui_utils_dom_isElement(el) && getNodeName(el) !== 'body');
2436
+ let currentContainingBlockComputedStyle = null;
2437
+ const elementIsFixed = getComputedStyle(element).position === 'fixed';
2438
+ let currentNode = elementIsFixed ? getParentNode(element) : element;
2439
+
2440
+ // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block
2441
+ while (floating_ui_utils_dom_isElement(currentNode) && !isLastTraversableNode(currentNode)) {
2442
+ const computedStyle = getComputedStyle(currentNode);
2443
+ const currentNodeIsContaining = isContainingBlock(currentNode);
2444
+ if (!currentNodeIsContaining && computedStyle.position === 'fixed') {
2445
+ currentContainingBlockComputedStyle = null;
2446
+ }
2447
+ const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);
2448
+ if (shouldDropCurrentNode) {
2449
+ // Drop non-containing blocks.
2450
+ result = result.filter(ancestor => ancestor !== currentNode);
2451
+ } else {
2452
+ // Record last containing block for next iteration.
2453
+ currentContainingBlockComputedStyle = computedStyle;
2454
+ }
2455
+ currentNode = getParentNode(currentNode);
2456
+ }
2457
+ cache.set(element, result);
2458
+ return result;
2459
+ }
2460
+
2461
+ // Gets the maximum area that the element is visible in due to any number of
2462
+ // clipping ancestors.
2463
+ function getClippingRect(_ref) {
2464
+ let {
2465
+ element,
2466
+ boundary,
2467
+ rootBoundary,
2468
+ strategy
2469
+ } = _ref;
2470
+ const elementClippingAncestors = boundary === 'clippingAncestors' ? getClippingElementAncestors(element, this._c) : [].concat(boundary);
2471
+ const clippingAncestors = [...elementClippingAncestors, rootBoundary];
2472
+ const firstClippingAncestor = clippingAncestors[0];
2473
+ const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {
2474
+ const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);
2475
+ accRect.top = floating_ui_utils_max(rect.top, accRect.top);
2476
+ accRect.right = floating_ui_utils_min(rect.right, accRect.right);
2477
+ accRect.bottom = floating_ui_utils_min(rect.bottom, accRect.bottom);
2478
+ accRect.left = floating_ui_utils_max(rect.left, accRect.left);
2479
+ return accRect;
2480
+ }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));
2481
+ return {
2482
+ width: clippingRect.right - clippingRect.left,
2483
+ height: clippingRect.bottom - clippingRect.top,
2484
+ x: clippingRect.left,
2485
+ y: clippingRect.top
2486
+ };
2487
+ }
2488
+
2489
+ function getDimensions(element) {
2490
+ return getCssDimensions(element);
2491
+ }
2492
+
2493
+ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
2494
+ const isOffsetParentAnElement = isHTMLElement(offsetParent);
2495
+ const documentElement = getDocumentElement(offsetParent);
2496
+ const isFixed = strategy === 'fixed';
2497
+ const rect = getBoundingClientRect(element, true, isFixed, offsetParent);
2498
+ let scroll = {
2499
+ scrollLeft: 0,
2500
+ scrollTop: 0
2501
+ };
2502
+ const offsets = createCoords(0);
2503
+ if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
2504
+ if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {
2505
+ scroll = getNodeScroll(offsetParent);
2506
+ }
2507
+ if (isOffsetParentAnElement) {
2508
+ const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);
2509
+ offsets.x = offsetRect.x + offsetParent.clientLeft;
2510
+ offsets.y = offsetRect.y + offsetParent.clientTop;
2511
+ } else if (documentElement) {
2512
+ offsets.x = getWindowScrollBarX(documentElement);
2513
+ }
2514
+ }
2515
+ return {
2516
+ x: rect.left + scroll.scrollLeft - offsets.x,
2517
+ y: rect.top + scroll.scrollTop - offsets.y,
2518
+ width: rect.width,
2519
+ height: rect.height
2520
+ };
2521
+ }
2522
+
2523
+ function getTrueOffsetParent(element, polyfill) {
2524
+ if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {
2525
+ return null;
2526
+ }
2527
+ if (polyfill) {
2528
+ return polyfill(element);
2529
+ }
2530
+ return element.offsetParent;
2531
+ }
2532
+ function getContainingBlock(element) {
2533
+ let currentNode = getParentNode(element);
2534
+ while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {
2535
+ if (isContainingBlock(currentNode)) {
2536
+ return currentNode;
2537
+ } else {
2538
+ currentNode = getParentNode(currentNode);
2539
+ }
2540
+ }
2541
+ return null;
2542
+ }
2543
+
2544
+ // Gets the closest ancestor positioned element. Handles some edge cases,
2545
+ // such as table ancestors and cross browser bugs.
2546
+ function getOffsetParent(element, polyfill) {
2547
+ const window = getWindow(element);
2548
+ if (!isHTMLElement(element)) {
2549
+ return window;
2550
+ }
2551
+ let offsetParent = getTrueOffsetParent(element, polyfill);
2552
+ while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === 'static') {
2553
+ offsetParent = getTrueOffsetParent(offsetParent, polyfill);
2554
+ }
2555
+ if (offsetParent && (getNodeName(offsetParent) === 'html' || getNodeName(offsetParent) === 'body' && getComputedStyle(offsetParent).position === 'static' && !isContainingBlock(offsetParent))) {
2556
+ return window;
2557
+ }
2558
+ return offsetParent || getContainingBlock(element) || window;
2559
+ }
2560
+
2561
+ const getElementRects = async function (_ref) {
2562
+ let {
2563
+ reference,
2564
+ floating,
2565
+ strategy
2566
+ } = _ref;
2567
+ const getOffsetParentFn = this.getOffsetParent || getOffsetParent;
2568
+ const getDimensionsFn = this.getDimensions;
2569
+ return {
2570
+ reference: getRectRelativeToOffsetParent(reference, await getOffsetParentFn(floating), strategy),
2571
+ floating: {
2572
+ x: 0,
2573
+ y: 0,
2574
+ ...(await getDimensionsFn(floating))
2575
+ }
2576
+ };
2577
+ };
2578
+
2579
+ function isRTL(element) {
2580
+ return getComputedStyle(element).direction === 'rtl';
2581
+ }
2582
+
2583
+ const platform = {
2584
+ convertOffsetParentRelativeRectToViewportRelativeRect,
2585
+ getDocumentElement: getDocumentElement,
2586
+ getClippingRect,
2587
+ getOffsetParent,
2588
+ getElementRects,
2589
+ getClientRects,
2590
+ getDimensions,
2591
+ getScale,
2592
+ isElement: floating_ui_utils_dom_isElement,
2593
+ isRTL
2594
+ };
2595
+
2596
+ // https://samthor.au/2021/observing-dom/
2597
+ function observeMove(element, onMove) {
2598
+ let io = null;
2599
+ let timeoutId;
2600
+ const root = getDocumentElement(element);
2601
+ function cleanup() {
2602
+ clearTimeout(timeoutId);
2603
+ io && io.disconnect();
2604
+ io = null;
2605
+ }
2606
+ function refresh(skip, threshold) {
2607
+ if (skip === void 0) {
2608
+ skip = false;
2609
+ }
2610
+ if (threshold === void 0) {
2611
+ threshold = 1;
2612
+ }
2613
+ cleanup();
2614
+ const {
2615
+ left,
2616
+ top,
2617
+ width,
2618
+ height
2619
+ } = element.getBoundingClientRect();
2620
+ if (!skip) {
2621
+ onMove();
2622
+ }
2623
+ if (!width || !height) {
2624
+ return;
2625
+ }
2626
+ const insetTop = floor(top);
2627
+ const insetRight = floor(root.clientWidth - (left + width));
2628
+ const insetBottom = floor(root.clientHeight - (top + height));
2629
+ const insetLeft = floor(left);
2630
+ const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
2631
+ const options = {
2632
+ rootMargin,
2633
+ threshold: floating_ui_utils_max(0, floating_ui_utils_min(1, threshold)) || 1
2634
+ };
2635
+ let isFirstUpdate = true;
2636
+ function handleObserve(entries) {
2637
+ const ratio = entries[0].intersectionRatio;
2638
+ if (ratio !== threshold) {
2639
+ if (!isFirstUpdate) {
2640
+ return refresh();
2641
+ }
2642
+ if (!ratio) {
2643
+ timeoutId = setTimeout(() => {
2644
+ refresh(false, 1e-7);
2645
+ }, 100);
2646
+ } else {
2647
+ refresh(false, ratio);
2648
+ }
2649
+ }
2650
+ isFirstUpdate = false;
2651
+ }
2652
+
2653
+ // Older browsers don't support a `document` as the root and will throw an
2654
+ // error.
2655
+ try {
2656
+ io = new IntersectionObserver(handleObserve, {
2657
+ ...options,
2658
+ // Handle <iframe>s
2659
+ root: root.ownerDocument
2660
+ });
2661
+ } catch (e) {
2662
+ io = new IntersectionObserver(handleObserve, options);
2663
+ }
2664
+ io.observe(element);
2665
+ }
2666
+ refresh(true);
2667
+ return cleanup;
2668
+ }
2669
+
2670
+ /**
2671
+ * Automatically updates the position of the floating element when necessary.
2672
+ * Should only be called when the floating element is mounted on the DOM or
2673
+ * visible on the screen.
2674
+ * @returns cleanup function that should be invoked when the floating element is
2675
+ * removed from the DOM or hidden from the screen.
2676
+ * @see https://floating-ui.com/docs/autoUpdate
2677
+ */
2678
+ function autoUpdate(reference, floating, update, options) {
2679
+ if (options === void 0) {
2680
+ options = {};
2681
+ }
2682
+ const {
2683
+ ancestorScroll = true,
2684
+ ancestorResize = true,
2685
+ elementResize = typeof ResizeObserver === 'function',
2686
+ layoutShift = typeof IntersectionObserver === 'function',
2687
+ animationFrame = false
2688
+ } = options;
2689
+ const referenceEl = unwrapElement(reference);
2690
+ const ancestors = ancestorScroll || ancestorResize ? [...(referenceEl ? getOverflowAncestors(referenceEl) : []), ...getOverflowAncestors(floating)] : [];
2691
+ ancestors.forEach(ancestor => {
2692
+ ancestorScroll && ancestor.addEventListener('scroll', update, {
2693
+ passive: true
2694
+ });
2695
+ ancestorResize && ancestor.addEventListener('resize', update);
2696
+ });
2697
+ const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
2698
+ let reobserveFrame = -1;
2699
+ let resizeObserver = null;
2700
+ if (elementResize) {
2701
+ resizeObserver = new ResizeObserver(_ref => {
2702
+ let [firstEntry] = _ref;
2703
+ if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
2704
+ // Prevent update loops when using the `size` middleware.
2705
+ // https://github.com/floating-ui/floating-ui/issues/1740
2706
+ resizeObserver.unobserve(floating);
2707
+ cancelAnimationFrame(reobserveFrame);
2708
+ reobserveFrame = requestAnimationFrame(() => {
2709
+ resizeObserver && resizeObserver.observe(floating);
2710
+ });
2711
+ }
2712
+ update();
2713
+ });
2714
+ if (referenceEl && !animationFrame) {
2715
+ resizeObserver.observe(referenceEl);
2716
+ }
2717
+ resizeObserver.observe(floating);
2718
+ }
2719
+ let frameId;
2720
+ let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null;
2721
+ if (animationFrame) {
2722
+ frameLoop();
2723
+ }
2724
+ function frameLoop() {
2725
+ const nextRefRect = getBoundingClientRect(reference);
2726
+ if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
2727
+ update();
2728
+ }
2729
+ prevRefRect = nextRefRect;
2730
+ frameId = requestAnimationFrame(frameLoop);
2731
+ }
2732
+ update();
2733
+ return () => {
2734
+ ancestors.forEach(ancestor => {
2735
+ ancestorScroll && ancestor.removeEventListener('scroll', update);
2736
+ ancestorResize && ancestor.removeEventListener('resize', update);
2737
+ });
2738
+ cleanupIo && cleanupIo();
2739
+ resizeObserver && resizeObserver.disconnect();
2740
+ resizeObserver = null;
2741
+ if (animationFrame) {
2742
+ cancelAnimationFrame(frameId);
2743
+ }
2744
+ };
2745
+ }
2746
+
2747
+ /**
2748
+ * Computes the `x` and `y` coordinates that will place the floating element
2749
+ * next to a reference element when it is given a certain CSS positioning
2750
+ * strategy.
2751
+ */
2752
+ const floating_ui_dom_computePosition = (reference, floating, options) => {
2753
+ // This caches the expensive `getClippingElementAncestors` function so that
2754
+ // multiple lifecycle resets re-use the same result. It only lives for a
2755
+ // single call. If other functions become expensive, we can add them as well.
2756
+ const cache = new Map();
2757
+ const mergedOptions = {
2758
+ platform,
2759
+ ...options
2760
+ };
2761
+ const platformWithCache = {
2762
+ ...mergedOptions.platform,
2763
+ _c: cache
2764
+ };
2765
+ return computePosition(reference, floating, {
2766
+ ...mergedOptions,
2767
+ platform: platformWithCache
2768
+ });
2769
+ };
2770
+
2771
+
2772
+
2773
+ ;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/objectDestructuringEmpty.js
2774
+ function _objectDestructuringEmpty(obj) {
2775
+ if (obj == null) throw new TypeError("Cannot destructure " + obj);
2776
+ }
2777
+ ;// CONCATENATED MODULE: ../../packages/popover/src/use-platform.tsx
2778
+
2779
+ /*
2780
+ * Tencent is pleased to support the open source community by making
2781
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2782
+ *
2783
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2784
+ *
2785
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2786
+ *
2787
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2788
+ *
2789
+ * ---------------------------------------------------
2790
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2791
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2792
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2793
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2794
+ *
2795
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2796
+ * the Software.
2797
+ *
2798
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2799
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2800
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2801
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2802
+ * IN THE SOFTWARE.
2803
+ */
2804
+ /* harmony default export */ const use_platform = (function (fullscreenTarget) {
2805
+ var getElementRects = function getElementRects(_ref) {
2806
+ var reference = _ref.reference,
2807
+ floating = _ref.floating;
2808
+ var refRect = reference.getBoundingClientRect();
2809
+ var floatRect = floating.getBoundingClientRect();
2810
+ return {
2811
+ reference: {
2812
+ width: refRect.width,
2813
+ height: refRect.height,
2814
+ x: refRect.x,
2815
+ y: refRect.y
2816
+ },
2817
+ floating: {
2818
+ width: floatRect.width,
2819
+ height: floatRect.height,
2820
+ x: floatRect.x,
2821
+ y: floatRect.y
2822
+ }
2823
+ };
2824
+ };
2825
+ var getDimensions = function getDimensions(element) {
2826
+ var _element$getBoundingC = element.getBoundingClientRect(),
2827
+ width = _element$getBoundingC.width,
2828
+ height = _element$getBoundingC.height;
2829
+ return {
2830
+ width: width,
2831
+ height: height
2832
+ };
2833
+ };
2834
+ var getClippingRect = function getClippingRect(_ref2) {
2835
+ _objectDestructuringEmpty(_ref2);
2836
+ var _a;
2837
+ var _ref3 = (_a = fullscreenTarget === null || fullscreenTarget === void 0 ? void 0 : fullscreenTarget.getBoundingClientRect()) !== null && _a !== void 0 ? _a : {},
2838
+ _ref3$width = _ref3.width,
2839
+ width = _ref3$width === void 0 ? 0 : _ref3$width,
2840
+ _ref3$height = _ref3.height,
2841
+ height = _ref3$height === void 0 ? 0 : _ref3$height;
2842
+ return {
2843
+ width: width,
2844
+ height: height,
2845
+ x: 0,
2846
+ y: 0
2847
+ };
2848
+ };
2849
+ return {
2850
+ getElementRects: getElementRects,
2851
+ getDimensions: getDimensions,
2852
+ getClippingRect: getClippingRect
2853
+ };
2854
+ });
2855
+ // EXTERNAL MODULE: ../../node_modules/uuid/index.js
2856
+ var uuid = __webpack_require__(8022);
2857
+ ;// CONCATENATED MODULE: ../../packages/popover/src/utils.ts
2858
+ /*
2859
+ * Tencent is pleased to support the open source community by making
2860
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2861
+ *
2862
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2863
+ *
2864
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2865
+ *
2866
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2867
+ *
2868
+ * ---------------------------------------------------
2869
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2870
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2871
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2872
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2873
+ *
2874
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2875
+ * the Software.
2876
+ *
2877
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2878
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2879
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2880
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2881
+ * IN THE SOFTWARE.
2882
+ */
2883
+
2884
+ var CachedConst = {};
2885
+ var isAvailableId = function isAvailableId(query) {
2886
+ var container = document.querySelector(query);
2887
+ return container instanceof HTMLElement;
2888
+ };
2889
+ var getFullscreenUid = function getFullscreenUid() {
2890
+ if (!CachedConst.fullscreenReferId) {
2891
+ CachedConst.fullscreenReferId = "id_".concat((0,uuid.v4)());
2892
+ }
2893
+ return CachedConst.fullscreenReferId;
2894
+ };
2895
+ var utils_isElement = function isElement(element) {
2896
+ return element instanceof Element || element instanceof HTMLDocument;
2897
+ };
2898
+ var contentAsHTMLElement = function contentAsHTMLElement(content) {
2899
+ if (utils_isElement(content)) {
2900
+ return {
2901
+ isElement: true,
2902
+ content: content,
2903
+ vNode: undefined
2904
+ };
2905
+ }
2906
+ if (/^(#|\.)/.test(content)) {
2907
+ var target = document.querySelector(content);
2908
+ var isEle = utils_isElement(target);
2909
+ return {
2910
+ isElement: isEle,
2911
+ content: isEle ? target : content,
2912
+ vNode: isEle ? undefined : content
2913
+ };
2914
+ }
2915
+ return {
2916
+ isElement: false,
2917
+ content: content,
2918
+ vNode: content
2919
+ };
2920
+ };
2921
+ ;// CONCATENATED MODULE: ../../packages/popover/src/use-floating.tsx
2922
+
2923
+
2924
+ /*
2925
+ * Tencent is pleased to support the open source community by making
2926
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
2927
+ *
2928
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
2929
+ *
2930
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
2931
+ *
2932
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
2933
+ *
2934
+ * ---------------------------------------------------
2935
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
2936
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
2937
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
2938
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
2939
+ *
2940
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
2941
+ * the Software.
2942
+ *
2943
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
2944
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
2945
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
2946
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
2947
+ * IN THE SOFTWARE.
2948
+ */
2949
+
2950
+
2951
+
2952
+
2953
+
2954
+
2955
+
2956
+ /**
2957
+ * 解析popover相关配置
2958
+ */
2959
+ /* harmony default export */ const use_floating = (function (props, ctx, _ref) {
2960
+ var refReference = _ref.refReference,
2961
+ refContent = _ref.refContent,
2962
+ refArrow = _ref.refArrow,
2963
+ refRoot = _ref.refRoot;
2964
+ var localIsShow = (0,external_vue_namespaceObject.ref)(false);
2965
+ var fullScreenTarget = (0,external_vue_namespaceObject.ref)();
2966
+ var isElementFullScreen = function isElementFullScreen() {
2967
+ var _a, _b;
2968
+ var elReference = resolveReferElement();
2969
+ if ((_a = document.fullscreenElement) === null || _a === void 0 ? void 0 : _a.shadowRoot) {
2970
+ return document.fullscreenElement.shadowRoot.contains(elReference);
2971
+ }
2972
+ return (_b = document.fullscreenElement) === null || _b === void 0 ? void 0 : _b.contains(elReference);
2973
+ };
2974
+ /**
2975
+ * 当全屏模式开启,获取指定选择器下面的全屏元素
2976
+ * 如果是启用了webcomponent组件,则返回shadowRoot内指定的目标元素
2977
+ * @param selector
2978
+ * @returns
2979
+ */
2980
+ var getFullscreenRoot = function getFullscreenRoot(selector) {
2981
+ if (isElementFullScreen()) {
2982
+ if (document.fullscreenElement.shadowRoot) {
2983
+ return document.fullscreenElement.shadowRoot.querySelector(selector);
2984
+ }
2985
+ return document.fullscreenElement.querySelector(selector);
2986
+ }
2987
+ return document.body;
2988
+ };
2989
+ var themeList = ['dark', 'light'];
2990
+ /**
2991
+ * 根据props.theme计算theme
2992
+ * 返回systemTheme & customTheme
2993
+ * systemTheme是指包含在 ['dark', 'light'] 内置主题
2994
+ * customTheme是指自定义的theme,string类型
2995
+ */
2996
+ var compTheme = (0,external_vue_namespaceObject.computed)(function () {
2997
+ var _a, _b;
2998
+ var themes = (_b = (_a = props.theme) === null || _a === void 0 ? void 0 : _a.split(/\s+/)) !== null && _b !== void 0 ? _b : [];
2999
+ themes.sort(function (a, b) {
3000
+ return Number(themeList.includes(b)) - Number(themeList.includes(a));
3001
+ });
3002
+ var systemThemes = themes;
3003
+ var customThemes = themes.filter(function (item) {
3004
+ return !themeList.includes(item);
3005
+ });
3006
+ return {
3007
+ systemThemes: systemThemes,
3008
+ customThemes: customThemes
3009
+ };
3010
+ });
3011
+ var isHideMiddlewareAvailable = function isHideMiddlewareAvailable() {
3012
+ return props.autoVisibility;
3013
+ };
3014
+ var isAutoPlacementAvailable = function isAutoPlacementAvailable() {
3015
+ return props.autoPlacement;
3016
+ };
3017
+ /**
3018
+ * 解析弹出reference元素,content元素, arrow元素
3019
+ * @returns
3020
+ */
3021
+ var resolvePopElements = function resolvePopElements() {
3022
+ var _a, _b, _c;
3023
+ var elReference = resolveReferElement();
3024
+ var elContent = resolveTargetElement((_a = refContent.value) === null || _a === void 0 ? void 0 : _a.$el);
3025
+ var elArrow = props.arrow ? resolveTargetElement((_b = refArrow.value) === null || _b === void 0 ? void 0 : _b.$el) : null;
3026
+ var root = resolveTargetElement((_c = refRoot.value) === null || _c === void 0 ? void 0 : _c.$el);
3027
+ var _contentAsHTMLElement = contentAsHTMLElement(props.content),
3028
+ isElement = _contentAsHTMLElement.isElement,
3029
+ content = _contentAsHTMLElement.content;
3030
+ if (elContent && isElement && !(elContent === null || elContent === void 0 ? void 0 : elContent.contains(content))) {
3031
+ elContent.append(content);
3032
+ }
3033
+ return {
3034
+ elReference: elReference,
3035
+ elContent: elContent,
3036
+ elArrow: elArrow,
3037
+ root: root
3038
+ };
3039
+ };
3040
+ var resolveReferElement = function resolveReferElement() {
3041
+ var _a;
3042
+ return resolveTargetElement(props.target) || resolveTargetElement((_a = refReference.value) === null || _a === void 0 ? void 0 : _a.$el);
3043
+ };
3044
+ var resolveModifiers = function resolveModifiers() {
3045
+ var resolveResult = {};
3046
+ if (Array.isArray(props.modifiers)) {
3047
+ props.modifiers.forEach(function (m) {
3048
+ var _a, _b, _c, _d;
3049
+ var result;
3050
+ if (m.name === 'offset') {
3051
+ if (typeof ((_a = m.options) === null || _a === void 0 ? void 0 : _a.offset) === 'number') {
3052
+ result = (_b = m.options) === null || _b === void 0 ? void 0 : _b.offset;
3053
+ }
3054
+ if (Array.isArray((_c = m.options) === null || _c === void 0 ? void 0 : _c.offset)) {
3055
+ var _ref2 = (_d = m.options) === null || _d === void 0 ? void 0 : _d.offset,
3056
+ _ref3 = _slicedToArray(_ref2, 2),
3057
+ mainAxis = _ref3[0],
3058
+ crossAxis = _ref3[1];
3059
+ result = {
3060
+ mainAxis: mainAxis,
3061
+ crossAxis: crossAxis
3062
+ };
3063
+ }
3064
+ Object.assign(resolveResult, {
3065
+ offset: result
3066
+ });
3067
+ }
3068
+ });
3069
+ }
3070
+ return resolveResult;
3071
+ };
3072
+ var resolvePopOptions = function resolvePopOptions(elArrow, props) {
3073
+ var _a;
3074
+ var modifiers = resolveModifiers();
3075
+ var middleware = [offset(modifiers.offset || props.offset), shift({
3076
+ padding: props.padding
3077
+ })];
3078
+ var options = {
3079
+ placement: props.placement,
3080
+ middleware: middleware
3081
+ };
3082
+ if (props.arrow) {
3083
+ middleware.push(arrow({
3084
+ element: elArrow
3085
+ }));
3086
+ }
3087
+ if (isAutoPlacementAvailable()) {
3088
+ middleware.push(autoPlacement());
3089
+ } else {
3090
+ middleware.unshift(inline());
3091
+ middleware.push(flip());
3092
+ }
3093
+ if (isHideMiddlewareAvailable()) {
3094
+ options.middleware.push(hide());
3095
+ }
3096
+ /**
3097
+ * 如果是全屏元素或者指定的虚拟元素
3098
+ * 则启用自定义的platform
3099
+ * 在弹出的全屏元素中,元素相对位置有别于document下面元素
3100
+ * 全屏模式下面,需要自定义当前元素的一个platform
3101
+ */
3102
+ if (isElementFullScreen() || props.isVirtualEl) {
3103
+ var _usePlatform = use_platform(fullScreenTarget.value),
3104
+ getElementRects = _usePlatform.getElementRects,
3105
+ getDimensions = _usePlatform.getDimensions,
3106
+ getClippingRect = _usePlatform.getClippingRect;
3107
+ Object.assign(options, {
3108
+ platform: Object.assign(Object.assign({}, (_a = props === null || props === void 0 ? void 0 : props.platform) !== null && _a !== void 0 ? _a : {}), {
3109
+ getElementRects: getElementRects,
3110
+ getDimensions: getDimensions,
3111
+ getClippingRect: getClippingRect
3112
+ })
3113
+ });
3114
+ }
3115
+ return options;
3116
+ };
3117
+ var resolveTargetElement = function resolveTargetElement(target) {
3118
+ if (target instanceof HTMLElement) {
3119
+ return target;
3120
+ }
3121
+ if (target instanceof Text) {
3122
+ return resolveTargetElement(target.nextElementSibling);
3123
+ }
3124
+ if (typeof (target === null || target === void 0 ? void 0 : target.getBoundingClientRect) === 'function') {
3125
+ return target;
3126
+ }
3127
+ if (typeof target === 'string') {
3128
+ var targetEl = document.querySelector(target);
3129
+ if ((0,external_lodash_namespaceObject.isElement)(targetEl)) {
3130
+ return targetEl;
3131
+ }
3132
+ return null;
3133
+ }
3134
+ if (target instanceof PointerEvent) {
3135
+ return resolveTargetElement(target.target);
3136
+ }
3137
+ return null;
3138
+ };
3139
+ // 兼容多种样式处理规则
3140
+ // class custom-theme
3141
+ var customThemeCls = compTheme.value.customThemes.join(' ');
3142
+ var customTheme = compTheme.value.customThemes.reduce(function (out, cur) {
3143
+ return Object.assign(_defineProperty({}, "data-".concat(cur, "-theme"), true), out);
3144
+ }, {});
3145
+ var contentClass = "".concat(customThemeCls);
3146
+ var cleanup = null;
3147
+ var getRoundPixelVal = function getRoundPixelVal(val) {
3148
+ var dpr = window.devicePixelRatio || 1;
3149
+ return Math.round(val * dpr) / dpr || 0;
3150
+ };
3151
+ var updatePopContentStyle = function updatePopContentStyle(elContent, x, y, middlewareData) {
3152
+ var _a;
3153
+ if (props.disableTransform) {
3154
+ Object.assign(elContent.style, {
3155
+ left: "".concat(getRoundPixelVal(x), "px"),
3156
+ top: "".concat(getRoundPixelVal(y), "px")
3157
+ });
3158
+ } else {
3159
+ Object.assign(elContent.style, {
3160
+ left: '0',
3161
+ top: '0',
3162
+ transform: "translate3d(".concat(getRoundPixelVal(x), "px,").concat(getRoundPixelVal(y), "px,0)")
3163
+ });
3164
+ }
3165
+ var referenceHidden = isHideMiddlewareAvailable() ? (_a = middlewareData.hide) === null || _a === void 0 ? void 0 : _a.referenceHidden : false;
3166
+ Object.assign(elContent.style, {
3167
+ visibility: referenceHidden ? 'hidden' : 'visible'
3168
+ });
3169
+ };
3170
+ var updateArrowStyle = function updateArrowStyle(elArrow, resolvedPlacement, middlewareData) {
3171
+ var _a;
3172
+ if (props.arrow) {
3173
+ var _ref4 = (_a = middlewareData.arrow) !== null && _a !== void 0 ? _a : {},
3174
+ arrowX = _ref4.x,
3175
+ arrowY = _ref4.y;
3176
+ elArrow.setAttribute('data-arrow', resolvedPlacement);
3177
+ var arrowConfig = {
3178
+ left: '',
3179
+ top: '',
3180
+ bottom: '',
3181
+ right: ''
3182
+ };
3183
+ Object.assign(elArrow.style, arrowConfig);
3184
+ var arrowSide = {
3185
+ top: 'bottom',
3186
+ right: 'left',
3187
+ bottom: 'top',
3188
+ left: 'right'
3189
+ }[resolvedPlacement];
3190
+ Object.assign(elArrow.style, _defineProperty({
3191
+ left: arrowX !== null ? "".concat(arrowX, "px") : '',
3192
+ top: arrowY !== null ? "".concat(arrowY, "px") : ''
3193
+ }, arrowSide, '-4px'));
3194
+ }
3195
+ };
3196
+ var createPopInstance = function createPopInstance() {
3197
+ var _resolvePopElements = resolvePopElements(),
3198
+ elReference = _resolvePopElements.elReference,
3199
+ elContent = _resolvePopElements.elContent;
3200
+ cleanup = autoUpdate(elReference, elContent, function () {
3201
+ if (localIsShow.value) {
3202
+ updatePopover(null, props);
3203
+ }
3204
+ });
3205
+ };
3206
+ var updatePopover = function updatePopover() {
3207
+ var virtualEl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
3208
+ var props = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3209
+ var callFn = arguments.length > 2 ? arguments[2] : undefined;
3210
+ var _resolvePopElements2 = resolvePopElements(),
3211
+ elReference = _resolvePopElements2.elReference,
3212
+ elContent = _resolvePopElements2.elContent,
3213
+ elArrow = _resolvePopElements2.elArrow;
3214
+ var targetEl = virtualEl || elReference;
3215
+ if (!targetEl || !elContent) return;
3216
+ var options = resolvePopOptions(elArrow, props);
3217
+ floating_ui_dom_computePosition(targetEl, elContent, options).then(function (_ref5) {
3218
+ var x = _ref5.x,
3219
+ y = _ref5.y,
3220
+ placement = _ref5.placement,
3221
+ middlewareData = _ref5.middlewareData;
3222
+ var oldClass = elContent.className;
3223
+ elContent.className = "".concat(oldClass.replace(contentClass, ''), " ").concat(contentClass).replace(/\s+/gm, ' ').replace(/^\s+|\s+$/g, '');
3224
+ Object.keys(customTheme).forEach(function (key) {
3225
+ elContent.setAttribute(key, customTheme[key]);
3226
+ });
3227
+ var placementStr = placement.split('-')[0];
3228
+ var resolvedPlacement = placementStr;
3229
+ if (!['left', 'right', 'top', 'bottom'].includes(placementStr)) {
3230
+ resolvedPlacement = 'top';
3231
+ }
3232
+ updatePopContentStyle(elContent, x, y, middlewareData);
3233
+ updateArrowStyle(elArrow, resolvedPlacement, middlewareData);
3234
+ if (typeof callFn === 'function') {
3235
+ callFn();
3236
+ }
3237
+ });
3238
+ };
3239
+ var popHideTimerId = undefined;
3240
+ var popShowTimerId = undefined;
3241
+ var isMouseenter = false;
3242
+ var resolvePopoverDelay = function resolvePopoverDelay() {
3243
+ if (Array.isArray(props.popoverDelay)) {
3244
+ return [props.popoverDelay[0], props.popoverDelay.slice(-1)[0]];
3245
+ }
3246
+ return [props.popoverDelay, props.popoverDelay];
3247
+ };
3248
+ var showPopover = function showPopover() {
3249
+ var delay = resolvePopoverDelay()[0];
3250
+ // 设置settimeout避免hidePopover导致显示问题
3251
+ popShowTimerId = setTimeout(function () {
3252
+ if (popHideTimerId) {
3253
+ clearTimeout(popHideTimerId);
3254
+ }
3255
+ if (!props.disabled) {
3256
+ localIsShow.value = true;
3257
+ }
3258
+ }, delay);
3259
+ };
3260
+ var hidePopover = function hidePopover() {
3261
+ var delay = resolvePopoverDelay()[1];
3262
+ popHideTimerId = setTimeout(function () {
3263
+ popShowTimerId && clearTimeout(popShowTimerId);
3264
+ localIsShow.value = false;
3265
+ }, delay);
3266
+ };
3267
+ var handlePopoverShow = function handlePopoverShow() {
3268
+ var _a;
3269
+ var elContent = resolveTargetElement((_a = refContent.value) === null || _a === void 0 ? void 0 : _a.$el);
3270
+ elContent.style.setProperty('display', 'block');
3271
+ elContent.style.setProperty('z-index', "".concat(props.zIndex ? props.zIndex : external_shared_namespaceObject.bkZIndexManager.getPopperIndex()));
3272
+ updatePopover();
3273
+ ctx.emit(EMIT_EVENTS.CONTENT_AfterShow, {
3274
+ isShow: true
3275
+ });
3276
+ };
3277
+ var handlePopoverHide = function handlePopoverHide() {
3278
+ var _a;
3279
+ var elContent = resolveTargetElement((_a = refContent.value) === null || _a === void 0 ? void 0 : _a.$el);
3280
+ elContent.style.setProperty('display', 'none');
3281
+ ctx.emit(EMIT_EVENTS.CONTENT_AfterHidden, {
3282
+ isShow: false
3283
+ });
3284
+ };
3285
+ var triggerPopover = function triggerPopover() {
3286
+ if (!localIsShow.value) {
3287
+ showPopover();
3288
+ } else {
3289
+ hidePopover();
3290
+ }
3291
+ };
3292
+ var handleClickRef = function handleClickRef() {
3293
+ triggerPopover();
3294
+ };
3295
+ var handlePopContentMouseEnter = function handlePopContentMouseEnter(e) {
3296
+ if (props.trigger !== 'hover') {
3297
+ return;
3298
+ }
3299
+ if (popHideTimerId) {
3300
+ isMouseenter = true;
3301
+ clearTimeout(popHideTimerId);
3302
+ popHideTimerId = undefined;
3303
+ }
3304
+ emitPopContentMouseEnter(e);
3305
+ };
3306
+ var handlePopContentMouseLeave = function handlePopContentMouseLeave(e) {
3307
+ if (isMouseenter) {
3308
+ hidePopover();
3309
+ isMouseenter = false;
3310
+ emitPopContentMouseLeave(e);
3311
+ }
3312
+ };
3313
+ /**
3314
+ * 弹出内容鼠标移入事件
3315
+ * 抛出相关事件,方便后续操作
3316
+ * 例如:鼠标移入内容区域,则取消弹出内容隐藏操作
3317
+ */
3318
+ var emitPopContentMouseEnter = function emitPopContentMouseEnter(e) {
3319
+ ctx.emit(EMIT_EVENTS.CONTENT_MOUSEENTER, e);
3320
+ };
3321
+ /**
3322
+ * 弹出内容鼠标移出事件
3323
+ */
3324
+ var emitPopContentMouseLeave = function emitPopContentMouseLeave(e) {
3325
+ ctx.emit(EMIT_EVENTS.CONTENT_MOUSELEAVE, e);
3326
+ };
3327
+ var resolveTriggerEvents = function resolveTriggerEvents() {
3328
+ var _a;
3329
+ var triggerEvents = {
3330
+ hover: {
3331
+ content: [['mouseenter', handlePopContentMouseEnter], ['mouseleave', handlePopContentMouseLeave]],
3332
+ reference: [['mouseenter', showPopover], ['mouseleave', hidePopover], ['focus', showPopover], ['blur', hidePopover]]
3333
+ },
3334
+ click: [['click', handleClickRef]],
3335
+ manual: {
3336
+ content: [['mouseenter', emitPopContentMouseEnter], ['mouseleave', emitPopContentMouseLeave]],
3337
+ reference: [[]]
3338
+ }
3339
+ };
3340
+ return (_a = triggerEvents[props.trigger]) !== null && _a !== void 0 ? _a : [];
3341
+ };
3342
+ var updateFullscreenTarget = function updateFullscreenTarget(val) {
3343
+ fullScreenTarget.value = val;
3344
+ };
3345
+ (0,external_vue_namespaceObject.watch)(function () {
3346
+ return props.isShow;
3347
+ }, function (val) {
3348
+ localIsShow.value = val;
3349
+ });
3350
+ (0,external_vue_namespaceObject.watch)(localIsShow, function (val) {
3351
+ if (val) {
3352
+ handlePopoverShow();
3353
+ } else {
3354
+ handlePopoverHide();
3355
+ }
3356
+ });
3357
+ var stopHide = function stopHide() {
3358
+ if (popHideTimerId) {
3359
+ isMouseenter = true;
3360
+ clearTimeout(popHideTimerId);
3361
+ popHideTimerId = undefined;
3362
+ }
3363
+ };
3364
+ return {
3365
+ showPopover: showPopover,
3366
+ hidePopover: hidePopover,
3367
+ resolveTriggerEvents: resolveTriggerEvents,
3368
+ updatePopover: updatePopover,
3369
+ triggerPopover: triggerPopover,
3370
+ resolvePopElements: resolvePopElements,
3371
+ isElementFullScreen: isElementFullScreen,
3372
+ resolveTargetElement: resolveTargetElement,
3373
+ createPopInstance: createPopInstance,
3374
+ updateFullscreenTarget: updateFullscreenTarget,
3375
+ getFullscreenRoot: getFullscreenRoot,
3376
+ stopHide: stopHide,
3377
+ localIsShow: localIsShow,
3378
+ cleanup: cleanup
3379
+ };
3380
+ });
3381
+ ;// CONCATENATED MODULE: ../../packages/popover/src/use-popper-id.ts
3382
+ /*
3383
+ * Tencent is pleased to support the open source community by making
3384
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3385
+ *
3386
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3387
+ *
3388
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3389
+ *
3390
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3391
+ *
3392
+ * ---------------------------------------------------
3393
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3394
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3395
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3396
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3397
+ *
3398
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3399
+ * the Software.
3400
+ *
3401
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3402
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3403
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3404
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3405
+ * IN THE SOFTWARE.
3406
+ */
3407
+
3408
+
3409
+ var popContainerId = null;
3410
+ var parentNodeReferId = null;
3411
+ /* harmony default export */ const use_popper_id = (function (props) {
3412
+ var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '#';
3413
+ var getPrefixId = function getPrefixId(root) {
3414
+ var resolvedBoundary = null;
3415
+ var resolveBoundary = function resolveBoundary(fn) {
3416
+ if (resolvedBoundary === null) {
3417
+ fn();
3418
+ }
3419
+ };
3420
+ var resolveParentBoundary = function resolveParentBoundary() {
3421
+ if (/^parent$/i.test(props.boundary)) {
3422
+ resolvedBoundary = "".concat(prefix).concat(popContainerId);
3423
+ var _ref = root || {},
3424
+ parentNode = _ref.parentNode;
3425
+ if (parentNode === null || parentNode === void 0 ? void 0 : parentNode.parentNode) {
3426
+ parentNode.parentNode.setAttribute('data-pnode-id', parentNodeReferId);
3427
+ resolvedBoundary = "[data-pnode-id=".concat(parentNodeReferId, "]");
3428
+ }
3429
+ }
3430
+ };
3431
+ var resolveCommonBoundary = function resolveCommonBoundary() {
3432
+ if (!/^body$/i.test(props.boundary)) {
3433
+ if (typeof props.boundary === 'string') {
3434
+ if (!isAvailableId(props.boundary)) {
3435
+ // console.error('props.boundary is not available selector');
3436
+ resolvedBoundary = 'body';
3437
+ return;
3438
+ }
3439
+ resolvedBoundary = props.boundary;
3440
+ return;
3441
+ }
3442
+ if (utils_isElement(props.boundary)) {
3443
+ resolvedBoundary = props.boundary;
3444
+ return;
3445
+ }
3446
+ }
3447
+ };
3448
+ resolveBoundary(resolveParentBoundary);
3449
+ resolveBoundary(resolveCommonBoundary);
3450
+ resolveBoundary(function () {
3451
+ resolvedBoundary = typeof props.boundary === 'string' ? props.boundary : "".concat(prefix).concat(popContainerId);
3452
+ });
3453
+ return resolvedBoundary;
3454
+ };
3455
+ if (popContainerId === null || !isAvailableId("#".concat(popContainerId))) {
3456
+ popContainerId = "id_".concat((0,uuid.v4)());
3457
+ var popContainer = document.createElement('div');
3458
+ popContainer.setAttribute('id', popContainerId);
3459
+ popContainer.setAttribute('data-popper-id', popContainerId);
3460
+ document.body.append(popContainer);
3461
+ }
3462
+ if (parentNodeReferId === null) {
3463
+ parentNodeReferId = "id_".concat((0,uuid.v4)());
3464
+ }
3465
+ return {
3466
+ popContainerId: popContainerId,
3467
+ prefixId: getPrefixId(),
3468
+ getPrefixId: getPrefixId
3469
+ };
3470
+ });
3471
+ ;// CONCATENATED MODULE: ../../packages/popover/src/use-popover-init.ts
3472
+
3473
+ /*
3474
+ * Tencent is pleased to support the open source community by making
3475
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3476
+ *
3477
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3478
+ *
3479
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3480
+ *
3481
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3482
+ *
3483
+ * ---------------------------------------------------
3484
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3485
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3486
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3487
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3488
+ *
3489
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3490
+ * the Software.
3491
+ *
3492
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3493
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3494
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3495
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3496
+ * IN THE SOFTWARE.
3497
+ */
3498
+
3499
+
3500
+
3501
+
3502
+
3503
+ /* harmony default export */ const use_popover_init = (function (props, ctx, _ref) {
3504
+ var refReference = _ref.refReference,
3505
+ refContent = _ref.refContent,
3506
+ refArrow = _ref.refArrow,
3507
+ refRoot = _ref.refRoot;
3508
+ var storeEvents = null;
3509
+ var isFullscreen = (0,external_vue_namespaceObject.ref)(false);
3510
+ var fullscreenReferId = getFullscreenUid();
3511
+ var fullScreenTarget = (0,external_vue_namespaceObject.ref)();
3512
+ var _useFloating = use_floating(props, ctx, {
3513
+ refReference: refReference,
3514
+ refContent: refContent,
3515
+ refArrow: refArrow,
3516
+ refRoot: refRoot
3517
+ }),
3518
+ localIsShow = _useFloating.localIsShow,
3519
+ showPopover = _useFloating.showPopover,
3520
+ hidePopover = _useFloating.hidePopover,
3521
+ updatePopover = _useFloating.updatePopover,
3522
+ cleanup = _useFloating.cleanup,
3523
+ resolveTriggerEvents = _useFloating.resolveTriggerEvents,
3524
+ resolvePopElements = _useFloating.resolvePopElements,
3525
+ isElementFullScreen = _useFloating.isElementFullScreen,
3526
+ updateFullscreenTarget = _useFloating.updateFullscreenTarget,
3527
+ createPopInstance = _useFloating.createPopInstance,
3528
+ getFullscreenRoot = _useFloating.getFullscreenRoot,
3529
+ stopHide = _useFloating.stopHide;
3530
+ var resetPopover = function resetPopover() {
3531
+ cleanup === null || cleanup === void 0 ? void 0 : cleanup();
3532
+ createPopInstance();
3533
+ };
3534
+ var showFn = function showFn() {
3535
+ showPopover();
3536
+ };
3537
+ var hideFn = function hideFn() {
3538
+ hidePopover();
3539
+ };
3540
+ var initPopInstance = function initPopInstance() {
3541
+ createPopInstance();
3542
+ if (props.always) {
3543
+ showPopover();
3544
+ } else {
3545
+ addEventToPopTargetEl();
3546
+ }
3547
+ };
3548
+ var addEventToPopTargetEl = function addEventToPopTargetEl() {
3549
+ var _resolvePopElements = resolvePopElements(),
3550
+ elReference = _resolvePopElements.elReference,
3551
+ elContent = _resolvePopElements.elContent;
3552
+ storeEvents = resolveTriggerEvents();
3553
+ if (Array.isArray(storeEvents)) {
3554
+ addEventToTargetEl(elReference, storeEvents);
3555
+ } else {
3556
+ var _storeEvents = storeEvents,
3557
+ content = _storeEvents.content,
3558
+ reference = _storeEvents.reference;
3559
+ addEventToTargetEl(elReference, reference);
3560
+ addEventToTargetEl(elContent, content);
3561
+ }
3562
+ };
3563
+ var addEventToTargetEl = function addEventToTargetEl(target, evets) {
3564
+ evets.forEach(function (_ref2) {
3565
+ var _ref3 = _slicedToArray(_ref2, 2),
3566
+ event = _ref3[0],
3567
+ listener = _ref3[1];
3568
+ if (event && typeof listener === 'function') {
3569
+ target.addEventListener(event, listener);
3570
+ }
3571
+ });
3572
+ };
3573
+ var removeEventListener = function removeEventListener() {
3574
+ if (storeEvents === null || storeEvents === void 0 ? void 0 : storeEvents.length) {
3575
+ var _resolvePopElements2 = resolvePopElements(),
3576
+ elReference = _resolvePopElements2.elReference;
3577
+ if (elReference) {
3578
+ storeEvents.forEach(function (_ref4) {
3579
+ var _ref5 = _slicedToArray(_ref4, 2),
3580
+ event = _ref5[0],
3581
+ listener = _ref5[1];
3582
+ if (event && typeof listener === 'function') {
3583
+ elReference.removeEventListener(event, listener);
3584
+ }
3585
+ });
3586
+ }
3587
+ storeEvents = null;
3588
+ }
3589
+ };
3590
+ var updateBoundary = function updateBoundary() {
3591
+ var _resolvePopElements3 = resolvePopElements(),
3592
+ elReference = _resolvePopElements3.elReference,
3593
+ root = _resolvePopElements3.root;
3594
+ if (isFullscreen.value) {
3595
+ boundary.value = fullScreenTarget === null || fullScreenTarget === void 0 ? void 0 : fullScreenTarget.value;
3596
+ return;
3597
+ }
3598
+ boundary.value = getPrefixId(root || elReference);
3599
+ };
3600
+ var _usePopperId = use_popper_id(props, '#'),
3601
+ getPrefixId = _usePopperId.getPrefixId;
3602
+ var setFullscreenTag = function setFullscreenTag() {
3603
+ var _a;
3604
+ (_a = fullScreenTarget === null || fullScreenTarget === void 0 ? void 0 : fullScreenTarget.value) === null || _a === void 0 ? void 0 : _a.setAttribute('data-fllsrn-id', fullscreenReferId);
3605
+ };
3606
+ var clearFullscreenTag = function clearFullscreenTag() {
3607
+ var _a, _b;
3608
+ var query = "[data-fllsrn-id=".concat(fullscreenReferId, "]");
3609
+ ((_b = (_a = fullScreenTarget === null || fullScreenTarget === void 0 ? void 0 : fullScreenTarget.value) === null || _a === void 0 ? void 0 : _a.querySelectorAll(query)) !== null && _b !== void 0 ? _b : []).forEach(function (element) {
3610
+ element === null || element === void 0 ? void 0 : element.removeAttribute('data-fllsrn-id');
3611
+ });
3612
+ };
3613
+ var boundary = (0,external_vue_namespaceObject.ref)();
3614
+ var beforeInstanceUnmount = function beforeInstanceUnmount() {
3615
+ removeEventListener();
3616
+ };
3617
+ var updateFullscreen = function updateFullscreen(target) {
3618
+ fullScreenTarget.value = target;
3619
+ updateFullscreenTarget(target);
3620
+ isFullscreen.value = isElementFullScreen();
3621
+ setFullscreenTag();
3622
+ };
3623
+ var handleFullscreenChange = function handleFullscreenChange(e) {
3624
+ if (!document.fullscreenElement) {
3625
+ clearFullscreenTag();
3626
+ }
3627
+ updateFullscreen(e.target);
3628
+ updateBoundary();
3629
+ updatePopover(null, props);
3630
+ };
3631
+ var onMountedFn = function onMountedFn() {
3632
+ if (props.disabled) {
3633
+ return;
3634
+ }
3635
+ initPopInstance();
3636
+ if (isElementFullScreen()) {
3637
+ var query = "[data-fllsrn-id=".concat(fullscreenReferId, "]");
3638
+ var target = getFullscreenRoot(query);
3639
+ updateFullscreen(target);
3640
+ }
3641
+ updateBoundary();
3642
+ document.body.addEventListener('fullscreenchange', handleFullscreenChange);
3643
+ };
3644
+ var onUnmountedFn = function onUnmountedFn() {
3645
+ beforeInstanceUnmount();
3646
+ document.body.removeEventListener('fullscreenchange', handleFullscreenChange);
3647
+ };
3648
+ var handleClickOutside = function handleClickOutside(_e) {
3649
+ ctx.emit(EMIT_EVENTS.CLICK_OUTSIDE, {
3650
+ isShow: localIsShow.value,
3651
+ event: _e
3652
+ });
3653
+ var needExec = props.disableOutsideClick || props.always || props.disabled || props.trigger === 'manual';
3654
+ if (!props.forceClickoutside && needExec) {
3655
+ return;
3656
+ }
3657
+ if (localIsShow.value) {
3658
+ hideFn();
3659
+ }
3660
+ };
3661
+ return {
3662
+ onMountedFn: onMountedFn,
3663
+ onUnmountedFn: onUnmountedFn,
3664
+ handleClickOutside: handleClickOutside,
3665
+ beforeInstanceUnmount: beforeInstanceUnmount,
3666
+ updateBoundary: updateBoundary,
3667
+ initPopInstance: initPopInstance,
3668
+ updatePopover: updatePopover,
3669
+ resetPopover: resetPopover,
3670
+ showPopover: showPopover,
3671
+ hidePopover: hidePopover,
3672
+ showFn: showFn,
3673
+ hideFn: hideFn,
3674
+ stopHide: stopHide,
3675
+ isFullscreen: isFullscreen,
3676
+ boundary: boundary,
3677
+ localIsShow: localIsShow
3678
+ };
3679
+ });
3680
+ ;// CONCATENATED MODULE: ../../packages/popover/src/popover.tsx
3681
+
3682
+ /*
3683
+ * Tencent is pleased to support the open source community by making
3684
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3685
+ *
3686
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3687
+ *
3688
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3689
+ *
3690
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3691
+ *
3692
+ * ---------------------------------------------------
3693
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3694
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3695
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3696
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3697
+ *
3698
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3699
+ * the Software.
3700
+ *
3701
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3702
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3703
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3704
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3705
+ * IN THE SOFTWARE.
3706
+ */
3707
+
3708
+
3709
+
3710
+
3711
+
3712
+
3713
+
3714
+
3715
+
3716
+
3717
+
3718
+ function _isSlot(s) {
3719
+ return typeof s === 'function' || Object.prototype.toString.call(s) === '[object Object]' && !(0,external_vue_namespaceObject.isVNode)(s);
3720
+ }
3721
+ /* harmony default export */ const popover = ((0,external_vue_namespaceObject.defineComponent)({
3722
+ name: 'Popover',
3723
+ components: {
3724
+ // eslint-disable-next-line vue/no-reserved-component-names
3725
+ Content: content,
3726
+ Arrow: src_arrow,
3727
+ Root: root
3728
+ },
3729
+ directives: {
3730
+ clickoutside: clickoutside
3731
+ },
3732
+ props: PopoverProps,
3733
+ emits: EMIT_EVENT_TYPES,
3734
+ setup: function setup(props, ctx) {
3735
+ var _toRefs = (0,external_vue_namespaceObject.toRefs)(props),
3736
+ reference = _toRefs.reference;
3737
+ var refDefaultReference = (0,external_vue_namespaceObject.ref)();
3738
+ var refContent = (0,external_vue_namespaceObject.ref)();
3739
+ var refArrow = (0,external_vue_namespaceObject.ref)();
3740
+ var refRoot = (0,external_vue_namespaceObject.ref)();
3741
+ var refReference = (0,external_vue_namespaceObject.computed)(function () {
3742
+ return reference.value || refDefaultReference.value;
3743
+ });
3744
+ var _usePopoverInit = use_popover_init(props, ctx, {
3745
+ refReference: refReference,
3746
+ refContent: refContent,
3747
+ refArrow: refArrow,
3748
+ refRoot: refRoot
3749
+ }),
3750
+ onMountedFn = _usePopoverInit.onMountedFn,
3751
+ onUnmountedFn = _usePopoverInit.onUnmountedFn,
3752
+ handleClickOutside = _usePopoverInit.handleClickOutside,
3753
+ beforeInstanceUnmount = _usePopoverInit.beforeInstanceUnmount,
3754
+ updateBoundary = _usePopoverInit.updateBoundary,
3755
+ initPopInstance = _usePopoverInit.initPopInstance,
3756
+ showFn = _usePopoverInit.showFn,
3757
+ hideFn = _usePopoverInit.hideFn,
3758
+ showPopover = _usePopoverInit.showPopover,
3759
+ hidePopover = _usePopoverInit.hidePopover,
3760
+ updatePopover = _usePopoverInit.updatePopover,
3761
+ resetPopover = _usePopoverInit.resetPopover,
3762
+ stopHide = _usePopoverInit.stopHide,
3763
+ localIsShow = _usePopoverInit.localIsShow,
3764
+ boundary = _usePopoverInit.boundary;
3765
+ if (!props.always && !props.disabled) {
3766
+ (0,external_vue_namespaceObject.watch)(function () {
3767
+ return props.isShow;
3768
+ }, function () {
3769
+ props.isShow ? showPopover() : hidePopover();
3770
+ }, {
3771
+ immediate: true
3772
+ });
3773
+ }
3774
+ (0,external_vue_namespaceObject.watch)(function () {
3775
+ return [props.disabled];
3776
+ }, function (val) {
3777
+ if (val[0]) {
3778
+ beforeInstanceUnmount();
3779
+ } else {
3780
+ initPopInstance();
3781
+ }
3782
+ });
3783
+ updateBoundary();
3784
+ (0,external_vue_namespaceObject.onMounted)(onMountedFn);
3785
+ (0,external_vue_namespaceObject.onBeforeUnmount)(onUnmountedFn);
3786
+ var transBoundary = (0,external_vue_namespaceObject.computed)(function () {
3787
+ return !props.disableTeleport;
3788
+ });
3789
+ var show = function show() {
3790
+ showFn();
3791
+ };
3792
+ var hide = function hide() {
3793
+ hideFn();
3794
+ };
3795
+ var contentIsShow = (0,external_vue_namespaceObject.computed)(function () {
3796
+ if (props.renderType === external_shared_namespaceObject.RenderType.AUTO) {
3797
+ return true;
3798
+ }
3799
+ return localIsShow.value;
3800
+ });
3801
+ var renderContent = function renderContent() {
3802
+ if (props.allowHtml) {
3803
+ var _contentAsHTMLElement = contentAsHTMLElement(props.content),
3804
+ vNode = _contentAsHTMLElement.vNode;
3805
+ return vNode;
3806
+ }
3807
+ return props.content;
3808
+ };
3809
+ return {
3810
+ boundary: boundary,
3811
+ arrow: props.arrow,
3812
+ refDefaultReference: refDefaultReference,
3813
+ refContent: refContent,
3814
+ refArrow: refArrow,
3815
+ content: props.content,
3816
+ theme: props.theme,
3817
+ transBoundary: transBoundary,
3818
+ handleClickOutside: handleClickOutside,
3819
+ updatePopover: updatePopover,
3820
+ resetPopover: resetPopover,
3821
+ hide: hide,
3822
+ show: show,
3823
+ stopHide: stopHide,
3824
+ contentIsShow: contentIsShow,
3825
+ renderContent: renderContent,
3826
+ localIsShow: localIsShow
3827
+ };
3828
+ },
3829
+ render: function render() {
3830
+ var _this = this;
3831
+ var _slot;
3832
+ var _a, _b, _c, _d, _e, _f;
3833
+ var renderReferSlot = function renderReferSlot(slot) {
3834
+ var _a;
3835
+ if (external_vue_namespaceObject.Text === ((_a = slot === null || slot === void 0 ? void 0 : slot[0]) === null || _a === void 0 ? void 0 : _a.type)) {
3836
+ return (0,external_vue_namespaceObject.createVNode)("span", null, [slot]);
3837
+ }
3838
+ return slot;
3839
+ };
3840
+ return (0,external_vue_namespaceObject.createVNode)(root, {
3841
+ "ref": "refRoot"
3842
+ }, {
3843
+ "default": function _default() {
3844
+ return [(0,external_vue_namespaceObject.createVNode)(reference, {
3845
+ "ref": "refDefaultReference"
3846
+ }, _isSlot(_slot = renderReferSlot((_c = (_b = (_a = _this.$slots)["default"]) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (0,external_vue_namespaceObject.createVNode)("span", null, null))) ? _slot : {
3847
+ "default": function _default() {
3848
+ return [_slot];
3849
+ }
3850
+ }), (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Teleport, {
3851
+ "to": _this.boundary,
3852
+ "disabled": !_this.transBoundary
3853
+ }, {
3854
+ "default": function _default() {
3855
+ return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)(content, {
3856
+ "ref": "refContent",
3857
+ "visible": _this.localIsShow,
3858
+ "data-theme": _this.theme,
3859
+ "extCls": _this.extCls,
3860
+ "width": _this.width,
3861
+ "height": _this.height,
3862
+ "maxWidth": _this.maxWidth,
3863
+ "maxHeight": _this.maxHeight,
3864
+ "eventDelay": _this.componentEventDelay
3865
+ }, {
3866
+ "default": function _default() {
3867
+ return [_this.contentIsShow ? (_f = (_e = (_d = _this.$slots).content) === null || _e === void 0 ? void 0 : _e.call(_d)) !== null && _f !== void 0 ? _f : _this.renderContent() : ''];
3868
+ },
3869
+ arrow: function arrow() {
3870
+ var _a, _b;
3871
+ return _this.arrow ? (0,external_vue_namespaceObject.createVNode)(src_arrow, {
3872
+ "ref": "refArrow"
3873
+ }, {
3874
+ "default": function _default() {
3875
+ return [(_b = (_a = _this.$slots).arrow) === null || _b === void 0 ? void 0 : _b.call(_a)];
3876
+ }
3877
+ }) : '';
3878
+ }
3879
+ }), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]])];
3880
+ }
3881
+ })];
3882
+ }
3883
+ });
3884
+ }
3885
+ }));
3886
+ ;// CONCATENATED MODULE: ../../packages/popover/src/plugin-popover.tsx
3887
+
3888
+
3889
+ /*
3890
+ * Tencent is pleased to support the open source community by making
3891
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
3892
+ *
3893
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
3894
+ *
3895
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
3896
+ *
3897
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
3898
+ *
3899
+ * ---------------------------------------------------
3900
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
3901
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
3902
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
3903
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
3904
+ *
3905
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
3906
+ * the Software.
3907
+ *
3908
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
3909
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
3910
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
3911
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
3912
+ * IN THE SOFTWARE.
3913
+ */
3914
+
3915
+
3916
+
3917
+
3918
+ function createPopoverComponent(options) {
3919
+ var $PopoverInstance = null;
3920
+ var $PopoverInstanceVm = null;
3921
+ var $PopoverInstanceEl = null;
3922
+ var resolvedOptions = Object.assign(Object.assign({
3923
+ boundary: 'body',
3924
+ placement: 'top',
3925
+ autoVisibility: true,
3926
+ isShow: false,
3927
+ trigger: 'manual'
3928
+ }, options), {
3929
+ allowHtml: true
3930
+ });
3931
+ var popoverComponent = {
3932
+ name: '$popover',
3933
+ setup: function setup(_, _ref) {
3934
+ var expose = _ref.expose;
3935
+ var formatOptions = function formatOptions() {
3936
+ return Object.keys(PopoverProps).reduce(function (result, key) {
3937
+ if (Object.prototype.hasOwnProperty.call(resolvedOptions, key)) {
3938
+ Object.assign(result, _defineProperty({}, key, resolvedOptions[key]));
3939
+ }
3940
+ return result;
3941
+ }, {
3942
+ target: resolvedOptions.target
3943
+ });
3944
+ };
3945
+ var refProps = (0,external_vue_namespaceObject.reactive)(formatOptions());
3946
+ var refReference = (0,external_vue_namespaceObject.ref)();
3947
+ var show = function show() {
3948
+ var _a, _b;
3949
+ (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.show) === null || _b === void 0 ? void 0 : _b.call(_a);
3950
+ };
3951
+ var hide = function hide() {
3952
+ var _a, _b;
3953
+ (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.hide) === null || _b === void 0 ? void 0 : _b.call(_a);
3954
+ };
3955
+ var stopHide = function stopHide() {
3956
+ var _a, _b;
3957
+ (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.stopHide) === null || _b === void 0 ? void 0 : _b.call(_a);
3958
+ };
3959
+ var updateTarget = function updateTarget(target) {
3960
+ var _a, _b;
3961
+ refProps.target = target;
3962
+ (_b = (_a = refReference.value) === null || _a === void 0 ? void 0 : _a.resetPopover) === null || _b === void 0 ? void 0 : _b.call(_a);
3963
+ };
3964
+ var handleContentMouseenter = function handleContentMouseenter() {
3965
+ var _a;
3966
+ (_a = resolvedOptions.onContentMouseenter) === null || _a === void 0 ? void 0 : _a.call(resolvedOptions);
3967
+ };
3968
+ var handleContentMouseleave = function handleContentMouseleave() {
3969
+ var _a;
3970
+ (_a = resolvedOptions.onContentMouseleave) === null || _a === void 0 ? void 0 : _a.call(resolvedOptions);
3971
+ };
3972
+ expose({
3973
+ show: show,
3974
+ hide: hide,
3975
+ updateTarget: updateTarget,
3976
+ stopHide: stopHide
3977
+ });
3978
+ return function () {
3979
+ return (0,external_vue_namespaceObject.createVNode)(popover, (0,external_vue_namespaceObject.mergeProps)(refProps, {
3980
+ "ref": refReference,
3981
+ "onContentMouseenter": handleContentMouseenter,
3982
+ "onContentMouseleave": handleContentMouseleave
3983
+ }), null);
3984
+ };
3985
+ }
3986
+ };
3987
+ function getBoundaryDom(boundary) {
3988
+ if (/^body$/i.test(boundary)) {
3989
+ return document.body;
3990
+ }
3991
+ if (/^parent$/i.test(boundary)) {
3992
+ if (utils_isElement(resolvedOptions.target)) {
3993
+ return resolvedOptions.target.parentNode;
3994
+ }
3995
+ return resolvedOptions.target.target.parentNode;
3996
+ }
3997
+ if (typeof boundary === 'string' && isAvailableId(boundary)) {
3998
+ return document.querySelector(boundary);
3999
+ }
4000
+ return document.body;
4001
+ }
4002
+ if ($PopoverInstance === null) {
4003
+ $PopoverInstanceEl = document.createElement('div');
4004
+ getBoundaryDom(resolvedOptions.boundary).append($PopoverInstanceEl);
4005
+ $PopoverInstance = (0,external_vue_namespaceObject.createApp)(popoverComponent);
4006
+ $PopoverInstanceVm = $PopoverInstance.mount($PopoverInstanceEl);
4007
+ }
4008
+ function close() {
4009
+ if ($PopoverInstance) {
4010
+ $PopoverInstance.unmount();
4011
+ $PopoverInstanceVm = null;
4012
+ $PopoverInstance = null;
4013
+ $PopoverInstanceEl.remove();
4014
+ }
4015
+ }
4016
+ function show() {
4017
+ $PopoverInstanceVm === null || $PopoverInstanceVm === void 0 ? void 0 : $PopoverInstanceVm.show();
4018
+ }
4019
+ function update(e) {
4020
+ $PopoverInstanceVm === null || $PopoverInstanceVm === void 0 ? void 0 : $PopoverInstanceVm.updateTarget(e);
4021
+ }
4022
+ function hide() {
4023
+ $PopoverInstanceVm === null || $PopoverInstanceVm === void 0 ? void 0 : $PopoverInstanceVm.hide();
4024
+ }
4025
+ return {
4026
+ close: close,
4027
+ show: show,
4028
+ hide: hide,
4029
+ update: update,
4030
+ get vm() {
4031
+ return $PopoverInstanceVm;
4032
+ },
4033
+ get $el() {
4034
+ return $PopoverInstanceVm.$el;
4035
+ }
4036
+ };
4037
+ }
4038
+ ;// CONCATENATED MODULE: ../../packages/popover/src/index.ts
4039
+ /**
4040
+ * Tencent is pleased to support the open source community by making
4041
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
4042
+ *
4043
+ * Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
4044
+ *
4045
+ * 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
4046
+ *
4047
+ * License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
4048
+ *
4049
+ * ---------------------------------------------------
4050
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
4051
+ * documentation files (the "Software"), to deal in the Software without restriction, including without limitation
4052
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
4053
+ * to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4054
+ *
4055
+ * The above copyright notice and this permission notice shall be included in all copies or substantial portions of
4056
+ * the Software.
4057
+ *
4058
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
4059
+ * THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
4060
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
4061
+ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
4062
+ * IN THE SOFTWARE.
4063
+ */
4064
+
4065
+
4066
+ var BkPopover = (0,external_shared_namespaceObject.withInstall)(popover);
4067
+ /* harmony default export */ const src = (BkPopover);
4068
+
4069
+
4070
+ })();
4071
+
4072
+ var __webpack_exports__$bkPopover = __webpack_exports__.kB;
4073
+ var __webpack_exports__PopoverProps = __webpack_exports__.uE;
4074
+ var __webpack_exports__default = __webpack_exports__.ZP;
4075
+ export { __webpack_exports__$bkPopover as $bkPopover, __webpack_exports__PopoverProps as PopoverProps, __webpack_exports__default as default };