vue-data-ui 2.4.21 → 2.4.22

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 (147) hide show
  1. package/dist/{Arrow-BuVX2WoN.js → Arrow-BW_I0Vmx.js} +1 -1
  2. package/dist/{Arrow-DDe-g8rw.cjs → Arrow-D2zjDsxe.cjs} +1 -1
  3. package/dist/{BaseIcon-BdKOa64A.cjs → BaseIcon-BCC16NCl.cjs} +1 -1
  4. package/dist/{BaseIcon-BRSPQaGQ.js → BaseIcon-BbbAnrZI.js} +1 -1
  5. package/dist/{DataTable-BpVz3DBX.js → DataTable-Ce4R8v-3.js} +2 -2
  6. package/dist/{DataTable-H-KTkjfv.cjs → DataTable-DeevzR8O.cjs} +1 -1
  7. package/dist/{Legend-G5Zc4QaZ.cjs → Legend-BksImVUi.cjs} +1 -1
  8. package/dist/{Legend-hnLfwhmm.js → Legend-C6q2bLVV.js} +1 -1
  9. package/dist/{PackageVersion-BbQFSVXm.cjs → PackageVersion-AftniVVo.cjs} +1 -1
  10. package/dist/{PackageVersion-wqab02xF.js → PackageVersion-g2UOsY7H.js} +1 -1
  11. package/dist/{PenAndPaper-C_laA5mt.js → PenAndPaper-DRFeGfqV.js} +3 -3
  12. package/dist/{PenAndPaper-BX8pR5oV.cjs → PenAndPaper-j5noaKJZ.cjs} +1 -1
  13. package/dist/{Shape-QdnXSUyn.js → Shape-CBu7ails.js} +1 -1
  14. package/dist/{Shape-CJbFv4bs.cjs → Shape-Cf2Cj3g6.cjs} +1 -1
  15. package/dist/{Slicer-DV1kBscZ.js → Slicer-C0bRksfh.js} +2 -2
  16. package/dist/{Slicer-C1blYfez.cjs → Slicer-IneBjcpY.cjs} +1 -1
  17. package/dist/{Title-DBozX6nP.js → Title-B2orjUIW.js} +1 -1
  18. package/dist/{Title-BRqTk-nT.cjs → Title-BxrsVY3-.cjs} +1 -1
  19. package/dist/{Tooltip-DvGSIp31.cjs → Tooltip-BXc56Oxr.cjs} +1 -1
  20. package/dist/{Tooltip-Com_T8vc.js → Tooltip-CXjc5vb3.js} +1 -1
  21. package/dist/{index-CsQwCVqU.cjs → index-3oZdQf6G.cjs} +1 -1
  22. package/dist/{index-hV0hU1iE.js → index-D020Kb3z.js} +1 -1
  23. package/dist/style.css +1 -1
  24. package/dist/{useNestedProp-CRAUOmT5.js → useNestedProp-CZkNAGQh.js} +1 -1
  25. package/dist/{useNestedProp-DSYpaLxP.cjs → useNestedProp-vPTP0Wem.cjs} +1 -1
  26. package/dist/{usePrinter-O2fMMTMe.cjs → usePrinter-BKzxQK4e.cjs} +1 -1
  27. package/dist/{usePrinter-y3d31M4g.js → usePrinter-CN0J0NFL.js} +1 -1
  28. package/dist/{vue-data-ui-qBad3a6z.cjs → vue-data-ui-CWDZLUkp.cjs} +1 -1
  29. package/dist/{vue-data-ui-bEKZH8jG.js → vue-data-ui-e2cclW_4.js} +58 -58
  30. package/dist/vue-data-ui.cjs +1 -1
  31. package/dist/vue-data-ui.js +1 -1
  32. package/dist/{vue-ui-3d-bar-CkqKnqQt.cjs → vue-ui-3d-bar-DCeFCwb0.cjs} +1 -1
  33. package/dist/{vue-ui-3d-bar-f7YaBbrh.js → vue-ui-3d-bar-DggyGAlC.js} +9 -9
  34. package/dist/{vue-ui-accordion-m-s-7akB.js → vue-ui-accordion-B0fEWLwn.js} +3 -3
  35. package/dist/{vue-ui-accordion-CaktYQoo.cjs → vue-ui-accordion-QoJofzqF.cjs} +1 -1
  36. package/dist/{vue-ui-age-pyramid-EKKYQu3N.cjs → vue-ui-age-pyramid-CXtRGpVa.cjs} +1 -1
  37. package/dist/{vue-ui-age-pyramid-DkfNZR86.js → vue-ui-age-pyramid-DGDvfcvP.js} +10 -10
  38. package/dist/{vue-ui-annotator-DrVu5Pu0.js → vue-ui-annotator-BETCQ-pV.js} +1 -1
  39. package/dist/{vue-ui-annotator-v07J6oQG.cjs → vue-ui-annotator-BEZ0D_12.cjs} +1 -1
  40. package/dist/{vue-ui-bullet-CYDMehDZ.js → vue-ui-bullet-BK3d_nhc.js} +8 -8
  41. package/dist/{vue-ui-bullet-CdG92x7A.cjs → vue-ui-bullet-qAGQkwN4.cjs} +1 -1
  42. package/dist/{vue-ui-candlestick-Bw1O3QmK.js → vue-ui-candlestick-DQR8cYLr.js} +11 -11
  43. package/dist/{vue-ui-candlestick-D9yN-yRo.cjs → vue-ui-candlestick-DwfFHSRG.cjs} +1 -1
  44. package/dist/{vue-ui-carousel-table-kcQa0FHw.js → vue-ui-carousel-table-B6TSxUwp.js} +4 -4
  45. package/dist/{vue-ui-carousel-table-Cg6hAEVv.cjs → vue-ui-carousel-table-BrIXFgJp.cjs} +1 -1
  46. package/dist/{vue-ui-chestnut-Qu8c3_vB.cjs → vue-ui-chestnut-CWtw_edx.cjs} +1 -1
  47. package/dist/{vue-ui-chestnut-DE1AMXeX.js → vue-ui-chestnut-CpINqXRz.js} +8 -8
  48. package/dist/{vue-ui-cursor-DG8oufeh.cjs → vue-ui-cursor-DvX6FbhZ.cjs} +1 -1
  49. package/dist/{vue-ui-cursor-DbfjKtpf.js → vue-ui-cursor-yI58QC1O.js} +2 -2
  50. package/dist/{vue-ui-dashboard-BbwgfxLx.cjs → vue-ui-dashboard-BCic2CfN.cjs} +1 -1
  51. package/dist/{vue-ui-dashboard-CAkCNUBh.js → vue-ui-dashboard-Bb7vJ0Nx.js} +2 -2
  52. package/dist/{vue-ui-digits-DgQkxULm.cjs → vue-ui-digits-C4dI1v6b.cjs} +1 -1
  53. package/dist/{vue-ui-digits-BaXAiH4u.js → vue-ui-digits-D4uy7_hL.js} +2 -2
  54. package/dist/{vue-ui-donut-7GM_Wd1Y.js → vue-ui-donut-CRiEc5mP.js} +11 -11
  55. package/dist/{vue-ui-donut-BHzCOBu6.cjs → vue-ui-donut-ClvjMOxC.cjs} +1 -1
  56. package/dist/{vue-ui-donut-evolution-C-TkUOr6.cjs → vue-ui-donut-evolution-DFkGtmhv.cjs} +1 -1
  57. package/dist/{vue-ui-donut-evolution-DbU4RlP6.js → vue-ui-donut-evolution-DgrQVEh2.js} +11 -11
  58. package/dist/{vue-ui-dumbbell-DacMeiTU.cjs → vue-ui-dumbbell-BdkARfxX.cjs} +1 -1
  59. package/dist/{vue-ui-dumbbell-BacTx3zB.js → vue-ui-dumbbell-QCB4jZm4.js} +10 -10
  60. package/dist/{vue-ui-flow-D2G0YWL9.js → vue-ui-flow-CRnCk5Is.js} +9 -9
  61. package/dist/{vue-ui-flow-BUAvjG7i.cjs → vue-ui-flow-CYfdTIad.cjs} +1 -1
  62. package/dist/{vue-ui-galaxy-CxfV3BIw.cjs → vue-ui-galaxy-Cn9t3BG5.cjs} +1 -1
  63. package/dist/{vue-ui-galaxy-D6RFyIbQ.js → vue-ui-galaxy-WhRsA1Is.js} +11 -11
  64. package/dist/{vue-ui-gauge-DNJXnyLw.js → vue-ui-gauge-DwmCZiTj.js} +7 -7
  65. package/dist/{vue-ui-gauge-CJ5TKJpb.cjs → vue-ui-gauge-jYskVFUy.cjs} +1 -1
  66. package/dist/{vue-ui-gizmo-BBA51j_0.cjs → vue-ui-gizmo-C2P2qQYU.cjs} +1 -1
  67. package/dist/{vue-ui-gizmo-Db7-gRmB.js → vue-ui-gizmo-DpEZm4Uk.js} +3 -3
  68. package/dist/{vue-ui-heatmap-KQj8Jbpt.cjs → vue-ui-heatmap-D7TGNxC-.cjs} +1 -1
  69. package/dist/{vue-ui-heatmap-Ba6RMSTk.js → vue-ui-heatmap-u3SOjwts.js} +10 -10
  70. package/dist/{vue-ui-kpi-1srKxA1L.cjs → vue-ui-kpi-CCr0pHjp.cjs} +1 -1
  71. package/dist/{vue-ui-kpi-C8wyHy1H.js → vue-ui-kpi-Cdz5RM6j.js} +3 -3
  72. package/dist/{vue-ui-mini-loader-DutVmCuC.js → vue-ui-mini-loader-B2Xh0j5H.js} +2 -2
  73. package/dist/{vue-ui-mini-loader-BgKTecng.cjs → vue-ui-mini-loader-BuCeYPNP.cjs} +1 -1
  74. package/dist/{vue-ui-molecule-BOkIojio.js → vue-ui-molecule-GPDqR2rp.js} +11 -11
  75. package/dist/{vue-ui-molecule-CSezTn3m.cjs → vue-ui-molecule-z1A47zG1.cjs} +1 -1
  76. package/dist/{vue-ui-mood-radar-C8U8PHaq.js → vue-ui-mood-radar-DdQC5bH5.js} +11 -11
  77. package/dist/{vue-ui-mood-radar-CNTDrRs6.cjs → vue-ui-mood-radar-YZfCADah.cjs} +1 -1
  78. package/dist/{vue-ui-nested-donuts-DRWWnsdR.cjs → vue-ui-nested-donuts-CDSRcEX0.cjs} +1 -1
  79. package/dist/{vue-ui-nested-donuts-Bv2D1uFd.js → vue-ui-nested-donuts-Cf_KfoeP.js} +11 -11
  80. package/dist/{vue-ui-onion-CsnwbXED.cjs → vue-ui-onion-CmGZo3Sf.cjs} +1 -1
  81. package/dist/{vue-ui-onion-CT9YjU8v.js → vue-ui-onion-Lw3ohFAX.js} +11 -11
  82. package/dist/{vue-ui-parallel-coordinate-plot-C8KCRAX1.cjs → vue-ui-parallel-coordinate-plot-AHpf7ejC.cjs} +1 -1
  83. package/dist/{vue-ui-parallel-coordinate-plot-in5qpfXf.js → vue-ui-parallel-coordinate-plot-BsT0r0hr.js} +12 -12
  84. package/dist/{vue-ui-quadrant-Bw-0aW4F.cjs → vue-ui-quadrant-BPUIyB4-.cjs} +1 -1
  85. package/dist/{vue-ui-quadrant-C_9VNAXg.js → vue-ui-quadrant-BTmoe6UT.js} +12 -12
  86. package/dist/{vue-ui-quick-chart-C0YqMjyE.cjs → vue-ui-quick-chart-BYyXa06h.cjs} +1 -1
  87. package/dist/{vue-ui-quick-chart-BDBlm9uu.js → vue-ui-quick-chart-CRtE0pcc.js} +9 -9
  88. package/dist/{vue-ui-radar-C2QM_ee9.js → vue-ui-radar-BpkjOSOI.js} +12 -12
  89. package/dist/{vue-ui-radar-DXKMbeyW.cjs → vue-ui-radar-krdMX_hl.cjs} +1 -1
  90. package/dist/{vue-ui-rating-CsOknvaV.cjs → vue-ui-rating-9kj9GE7P.cjs} +1 -1
  91. package/dist/{vue-ui-rating-DVpgv2AY.js → vue-ui-rating-D1RlkwK9.js} +2 -2
  92. package/dist/{vue-ui-relation-circle-OXfdAyky.js → vue-ui-relation-circle-B7WGb08k.js} +7 -7
  93. package/dist/{vue-ui-relation-circle-ZA-M7aSc.cjs → vue-ui-relation-circle-Kv3G0P5k.cjs} +1 -1
  94. package/dist/{vue-ui-rings-qLQ-gl21.js → vue-ui-rings-DjXcLsY1.js} +11 -11
  95. package/dist/{vue-ui-rings-rftqDu-q.cjs → vue-ui-rings-DsZPnoqm.cjs} +1 -1
  96. package/dist/{vue-ui-scatter-Cv2IcrVH.cjs → vue-ui-scatter-D3ntjnfT.cjs} +1 -1
  97. package/dist/{vue-ui-scatter-4LbMvEAD.js → vue-ui-scatter-DEkTyyG8.js} +12 -12
  98. package/dist/{vue-ui-screenshot-BgjnQNxG.cjs → vue-ui-screenshot-BEbUxjNl.cjs} +1 -1
  99. package/dist/{vue-ui-screenshot-BV6ZYQRk.js → vue-ui-screenshot-kiJVXAGt.js} +1 -1
  100. package/dist/{vue-ui-skeleton-DsRTbz6d.cjs → vue-ui-skeleton-CI8sxaqr.cjs} +1 -1
  101. package/dist/{vue-ui-skeleton-BY8Jg9a_.js → vue-ui-skeleton-E1-7diF5.js} +3 -3
  102. package/dist/{vue-ui-smiley-BQ_3uicm.js → vue-ui-smiley-Cjbqlfre.js} +2 -2
  103. package/dist/{vue-ui-smiley-DB3y8CIb.cjs → vue-ui-smiley-CmkUQtfb.cjs} +1 -1
  104. package/dist/{vue-ui-spark-trend-Cgn7ONtS.cjs → vue-ui-spark-trend-C60Ypeev.cjs} +1 -1
  105. package/dist/{vue-ui-spark-trend-BhCJfY_p.js → vue-ui-spark-trend-DfpFe1UQ.js} +5 -5
  106. package/dist/{vue-ui-sparkbar-DxXt-GHr.js → vue-ui-sparkbar-B5oV2RUs.js} +4 -4
  107. package/dist/{vue-ui-sparkbar-D4GIhUXT.cjs → vue-ui-sparkbar-BAa71eZp.cjs} +1 -1
  108. package/dist/{vue-ui-sparkgauge-BbltbIrq.cjs → vue-ui-sparkgauge-UejPQm4b.cjs} +1 -1
  109. package/dist/{vue-ui-sparkgauge-BCPkJveV.js → vue-ui-sparkgauge-xlERw-g0.js} +4 -4
  110. package/dist/{vue-ui-sparkhistogram-DzX6lkk8.cjs → vue-ui-sparkhistogram-DC4jzkI0.cjs} +1 -1
  111. package/dist/{vue-ui-sparkhistogram-BKcr2mFc.js → vue-ui-sparkhistogram-nzFRlmgx.js} +5 -5
  112. package/dist/{vue-ui-sparkline-C-svTmFU.cjs → vue-ui-sparkline-BT4hxfBE.cjs} +1 -1
  113. package/dist/{vue-ui-sparkline-DYHUFUOp.js → vue-ui-sparkline-Duu0VrnG.js} +4 -4
  114. package/dist/{vue-ui-sparkstackbar-CL0uL_Te.cjs → vue-ui-sparkstackbar-K_vPau1u.cjs} +1 -1
  115. package/dist/{vue-ui-sparkstackbar-Btag2osm.js → vue-ui-sparkstackbar-tyoFIhva.js} +5 -5
  116. package/dist/{vue-ui-stackbar-CML7v_yU.cjs → vue-ui-stackbar-DRlvF164.cjs} +1 -1
  117. package/dist/{vue-ui-stackbar-C2mRU7ya.js → vue-ui-stackbar-e8BUjttp.js} +12 -12
  118. package/dist/{vue-ui-strip-plot-Vn5sEcME.cjs → vue-ui-strip-plot-8MOhIicL.cjs} +1 -1
  119. package/dist/{vue-ui-strip-plot-BIXF3VxN.js → vue-ui-strip-plot-Ef8oKjNV.js} +11 -11
  120. package/dist/{vue-ui-table-CyuRalnp.js → vue-ui-table-BOV6jtcL.js} +1 -1
  121. package/dist/{vue-ui-table-BbVpmm0B.cjs → vue-ui-table-DfevkNnK.cjs} +1 -1
  122. package/dist/{vue-ui-table-heatmap-DrQXQd41.cjs → vue-ui-table-heatmap-BMyRP1ol.cjs} +1 -1
  123. package/dist/{vue-ui-table-heatmap-DlGeS3l9.js → vue-ui-table-heatmap-CL-MybKI.js} +4 -4
  124. package/dist/{vue-ui-table-sparkline-DauDTktD.cjs → vue-ui-table-sparkline-CsqcT3ff.cjs} +1 -1
  125. package/dist/{vue-ui-table-sparkline-Yg2I33yZ.js → vue-ui-table-sparkline-DXvxiDJJ.js} +5 -5
  126. package/dist/{vue-ui-thermometer-Bglz0dOQ.cjs → vue-ui-thermometer-DyYqfAOW.cjs} +1 -1
  127. package/dist/{vue-ui-thermometer-DXwbqNrn.js → vue-ui-thermometer-WKzTNOOX.js} +7 -7
  128. package/dist/{vue-ui-timer-Brr7buaM.js → vue-ui-timer-CFDkyaxV.js} +5 -5
  129. package/dist/{vue-ui-timer-CpSEl8UD.cjs → vue-ui-timer-DQQGe1jt.cjs} +1 -1
  130. package/dist/{vue-ui-tiremarks-zdGmZNjo.cjs → vue-ui-tiremarks-C8iAWe-u.cjs} +1 -1
  131. package/dist/{vue-ui-tiremarks-DJowPFwY.js → vue-ui-tiremarks-aiUC8-YL.js} +7 -7
  132. package/dist/{vue-ui-treemap-a7NSP656.cjs → vue-ui-treemap-BORZ3g1I.cjs} +1 -1
  133. package/dist/{vue-ui-treemap-Bn5JU5BI.js → vue-ui-treemap-Bw-bWkza.js} +11 -11
  134. package/dist/{vue-ui-vertical-bar-CZxN7L9z.js → vue-ui-vertical-bar--mYbTcpi.js} +11 -11
  135. package/dist/{vue-ui-vertical-bar-BYG1vGlT.cjs → vue-ui-vertical-bar-B3ypOHUB.cjs} +1 -1
  136. package/dist/{vue-ui-waffle-CzUpKfkZ.js → vue-ui-waffle-Bj-tJs4n.js} +11 -11
  137. package/dist/{vue-ui-waffle-BbDBOivH.cjs → vue-ui-waffle-_84Hvek7.cjs} +1 -1
  138. package/dist/{vue-ui-wheel-CCje_ZSc.js → vue-ui-wheel-BywwqvY2.js} +7 -7
  139. package/dist/{vue-ui-wheel-lN3uYCr4.cjs → vue-ui-wheel-C-v9TgG1.cjs} +1 -1
  140. package/dist/{vue-ui-word-cloud-BjvG3n7x.cjs → vue-ui-word-cloud-CaQ4jLed.cjs} +1 -1
  141. package/dist/{vue-ui-word-cloud-D_5y92zN.js → vue-ui-word-cloud-CwExwCYc.js} +10 -10
  142. package/dist/{vue-ui-xy-Drm1aAb-.js → vue-ui-xy-CAYxRDzC.js} +14 -14
  143. package/dist/{vue-ui-xy-B-WlwJXZ.cjs → vue-ui-xy-CT3-xPpa.cjs} +1 -1
  144. package/dist/{vue-ui-xy-canvas-jieVsnBN.js → vue-ui-xy-canvas-BOElCo0f.js} +133 -131
  145. package/dist/vue-ui-xy-canvas-CdrfnVuI.cjs +9 -0
  146. package/package.json +1 -1
  147. package/dist/vue-ui-xy-canvas-BHrq_CYD.cjs +0 -9
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-CsQwCVqU.cjs"),L=require("./useNestedProp-DSYpaLxP.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,A)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,I)],8,R)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,H)],8,Y)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),a=require("./index-3oZdQf6G.cjs"),L=require("./useNestedProp-vPTP0Wem.cjs"),D=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),M={key:0,class:"vue-ui-rating-title",style:{width:"100%"}},A=["src","height","width"],R=["xmlns","height","width"],X=["id"],j=["stop-color"],F=["stop-color"],I=["points","fill","stroke","stroke-width"],O=["src","alt","height","width","id"],Y=["xmlns","viewBox","height","id"],G=["id"],q=["stop-color"],U=["stop-color"],H=["points","fill","stroke"],K=["xmlns","height"],P=["onClick","onMouseenter","onKeyup"],T=["onMouseenter"],W={__name:"vue-ui-rating",props:{config:{type:Object,default(){return{}}},dataset:{type:Object,default(){return{}}}},emits:["rate"],setup(k,{expose:_,emit:S}){const i=k,{vue_ui_rating:z}=a.useConfig(),d=e.ref(a.createUid()),f=e.ref(!1),s=e.ref(void 0),y=e.ref([]),t=e.computed({get:()=>g(),set:o=>o});function g(){return L.useNestedProp({userConfig:i.config,defaultConfig:z})}e.watch(()=>i.config,o=>{t.value=g(),h()},{deep:!0});const w=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)?N(i.dataset.rating):i.dataset.rating),B=e.computed(()=>typeof i.dataset.rating=="object"&&!Array.isArray(i.dataset.rating)),r=e.ref(w.value),m=e.computed(()=>t.value.type==="image"),c=e.computed(()=>t.value.readonly);function N(o){let n=0,l=0;for(const u in o){const V=parseInt(u),b=o[u];n+=V*b,l+=b}if(l===0)return 0;const v=n/l;return Math.min(t.value.to,Math.max(t.value.from,v))}e.onMounted(()=>{h()});function h(){a.objectIsEmpty(i.dataset)&&a.error({componentName:"VueUiRating",type:"dataset"}),y.value=[];for(let o=t.value.from;o<=t.value.to;o+=1)y.value.push(o)}function p(o,n=!1){return o>s.value||c.value?n?t.value.style.image.inactiveOpacity:t.value.style.star.inactiveColor:n?1:t.value.style.star.useGradient?`url(#star_gradient_under_${d.value})`:t.value.style.star.activeColor}function x(o,n=!1){const l=r.value-o,v=n?1:100;switch(!0){case l<=0:return .001;case l>1:return 1*v;default:return l*v}}function $(o){c.value||(r.value=o,S("rate",o))}function C(){return r.value}function E(o=!0){c.value=o}return _({getData:C,toggleReadonly:E}),(o,n)=>(e.openBlock(),e.createElementBlock("div",{style:e.normalizeStyle(`background:${t.value.style.backgroundColor};font-family:${t.value.style.fontFamily};width:100%`),class:"vue-ui-rating",onMouseover:n[2]||(n[2]=l=>f.value=!0),onMouseleave:n[3]||(n[3]=l=>{f.value=!1,s.value=void 0})},[t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",M,[e.createElementVNode("div",{style:e.normalizeStyle(`color:${t.value.style.title.color};font-weight:${t.value.style.title.bold?"bold":"normal"};text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.offsetY}px;font-size:${t.value.style.title.fontSize}px`)},e.toDisplayString(t.value.style.title.text),5),t.value.style.title.subtitle.text?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`color:${t.value.style.title.subtitle.color};font-size:${t.value.style.title.subtitle.fontSize}px;text-align:${t.value.style.title.textAlign};margin-bottom:${t.value.style.title.subtitle.offsetY}px;font-weight:${t.value.style.title.subtitle.bold?"bold":"normal"}`)},e.toDisplayString(t.value.style.title.subtitle.text),5)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.rating.show&&t.value.style.rating.position==="top"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:100%;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:"vue-ui-rating-wrapper",style:e.normalizeStyle(`height:${t.value.style.itemSize}px;width:100%;display:flex;align-items:center;justify-content:center`)},[t.value.style.rating.show&&t.value.style.rating.position==="left"?(e.openBlock(),e.createElementBlock("div",{key:0,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-right:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(y.value,(l,v)=>(e.openBlock(),e.createElementBlock("div",{class:"vue-ui-rating-unit-container",style:e.normalizeStyle(`position:relative;height:${t.value.style.itemSize}px;width:${t.value.style.itemSize}px`)},[m.value?(e.openBlock(),e.createElementBlock("img",{key:0,src:t.value.style.image.src,height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;opacity:${isNaN(s.value)?t.value.style.image.inactiveOpacity:p(l,!0)}`)},null,12,A)):(e.openBlock(),e.createElementBlock("svg",{key:1,xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,width:t.value.style.itemSize,class:"vue-ui-rating-unit"},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_under_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,j),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,F)],8,X)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:isNaN(s.value)?t.value.style.star.inactiveColor:p(l),stroke:t.value.style.star.borderColor?t.value.style.star.borderColor:s.value?p(l):t.value.style.star.inactiveColor,"stroke-width":t.value.style.star.borderWidth,"stroke-linecap":"round","stroke-linejoin":"round"},null,8,I)],8,R)),m.value?(e.openBlock(),e.createElementBlock("img",{key:2,src:t.value.style.image.src,alt:`${t.value.style.image.alt} ${l}`,height:t.value.style.itemSize,width:t.value.style.itemSize,id:`active_${d.value}_${l}`,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;clip:rect(0px,${x(v,!0)*t.value.style.itemSize}px,${t.value.style.itemSize}px,0px`)},null,12,O)):(e.openBlock(),e.createElementBlock("svg",{key:3,xmlns:e.unref(a.XMLNS),viewBox:`0 0 ${x(v)} 100`,height:t.value.style.itemSize,class:"vue-ui-rating-unit",id:`active_${d.value}_${l}`,style:{position:"absolute",top:"0",left:"0"}},[e.createElementVNode("defs",null,[e.createElementVNode("radialGradient",{cx:"50%",cy:"50%",r:"50%",fx:"50%",fy:"50%",id:`star_gradient_over_${d.value}`},[e.createElementVNode("stop",{offset:"0%","stop-color":`${e.unref(a.shiftHue)(t.value.style.star.activeColor,.05)}`},null,8,q),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.star.activeColor},null,8,U)],8,G)]),e.createElementVNode("polygon",{points:e.unref(a.createStar)({plot:{x:50,y:50},radius:30,apexes:t.value.style.star.apexes}),fill:t.value.style.star.useGradient?`url(#star_gradient_over_${d.value})`:t.value.style.star.activeColor,stroke:t.value.style.star.activeColor},null,8,H)],8,Y)),(e.openBlock(),e.createElementBlock("svg",{xmlns:e.unref(a.XMLNS),viewBox:"0 0 100 100",height:t.value.style.itemSize,class:"vue-ui-rating-unit",style:e.normalizeStyle(`position:absolute;top:0;left:0;${c.value?"":"cursor:pointer"}`)},[c.value?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("rect",{key:0,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onClick:u=>$(l),onMouseenter:u=>s.value=l,onMouseleave:n[0]||(n[0]=u=>s.value=void 0),tabindex:"0",onKeyup:e.withKeys(u=>$(l),["enter"])},null,40,P)),c.value?(e.openBlock(),e.createElementBlock("rect",{key:1,class:"vue-ui-rating-mouse-trap",x:0,y:0,width:100,height:100,fill:"transparent",onMouseenter:u=>s.value=l,onMouseleave:n[1]||(n[1]=u=>s.value=void 0)},null,40,T)):e.createCommentVNode("",!0)],12,K)),t.value.style.tooltip.show&&B.value&&c.value?(e.openBlock(),e.createElementBlock("div",{key:4,class:"vue-ui-rating-tooltip",style:e.normalizeStyle(`border:1px solid ${t.value.style.tooltip.borderColor};position:absolute;top:${-48+t.value.style.tooltip.offsetY}px;left:50%;transform:translateX(-50%);width:fit-content;text-align:center;background:${t.value.style.tooltip.backgroundColor};display:${s.value===l?"block":"none"};padding:2px 12px;border-radius:${t.value.style.tooltip.borderRadius}px;box-shadow:${t.value.style.tooltip.boxShadow}`)},[e.createElementVNode("div",{style:e.normalizeStyle(`width:100%;display:flex;flex-direction:row;gap:6px;position:relative;text-align:center;color:${t.value.style.tooltip.color}`)},[e.createElementVNode("span",{style:e.normalizeStyle(`font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(l)+":",5),e.createElementVNode("span",{style:e.normalizeStyle(`font-weight:${t.value.style.tooltip.bold?"bold":"normal"};font-size:${t.value.style.tooltip.fontSize}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.tooltip.formatter,i.dataset.rating[l],e.unref(a.dataLabel)({v:i.dataset.rating[l],r:t.value.style.tooltip.roundingValue}),t.value)),5),e.createElementVNode("div",{style:e.normalizeStyle(`font-family:Arial !important;position:absolute;top:calc(100% - 4px);left:50%;transform:translateX(-50%);color:${t.value.style.tooltip.borderColor}`)}," ▼ ",4)],4)],4)):e.createCommentVNode("",!0)],4))),256)),t.value.style.rating.show&&t.value.style.rating.position==="right"?(e.openBlock(),e.createElementBlock("div",{key:1,style:e.normalizeStyle(`width:fit-content;text-align:center;margin-bottom:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};padding-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],4),t.value.style.rating.show&&t.value.style.rating.position==="bottom"?(e.openBlock(),e.createElementBlock("div",{key:2,style:e.normalizeStyle(`width:100%;text-align:center;margin-top:${t.value.style.rating.offsetY}px;font-size:${t.value.style.rating.fontSize}px;font-weight:${t.value.style.rating.bold?"bold":"normal"};margin-left:${t.value.style.rating.offsetX}px`)},e.toDisplayString(e.unref(a.applyDataLabel)(t.value.style.rating.formatter,r.value,e.unref(a.dataLabel)({v:r.value,r:t.value.style.rating.roundingValue}),t.value)),5)):e.createCommentVNode("",!0)],36))}},J=D._export_sfc(W,[["__scopeId","data-v-d90e158f"]]);exports.default=J;
@@ -1,6 +1,6 @@
1
1
  import { ref as h, computed as x, watch as U, onMounted as K, openBlock as a, createElementBlock as i, normalizeStyle as o, createElementVNode as r, toDisplayString as g, createCommentVNode as d, unref as s, Fragment as T, renderList as H, withKeys as P } from "vue";
2
- import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, V as F } from "./index-hV0hU1iE.js";
3
- import { u as Z } from "./useNestedProp-CRAUOmT5.js";
2
+ import { u as W, c as q, o as J, e as Q, i as $, f as _, X as k, w as R, V as F } from "./index-D020Kb3z.js";
3
+ import { u as Z } from "./useNestedProp-CZkNAGQh.js";
4
4
  import { _ as tt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
5
5
  const et = {
6
6
  key: 0,
@@ -1,12 +1,12 @@
1
1
  import { useCssVars as xe, computed as c, ref as a, watch as be, onMounted as Ae, onBeforeUnmount as Oe, openBlock as n, createElementBlock as i, normalizeStyle as C, createBlock as A, createCommentVNode as f, unref as y, createSlots as Pe, withCtx as O, renderSlot as m, normalizeProps as N, guardReactiveProps as S, normalizeClass as R, createVNode as Ie, createElementVNode as Fe, Fragment as P, renderList as I, toDisplayString as Te } from "vue";
2
- import { u as Ee, c as ze, t as Le, a as Ne, p as ne, b as Se, o as Re, e as re, g as Me, X as je } from "./index-hV0hU1iE.js";
2
+ import { u as Ee, c as ze, t as Le, a as Ne, p as ne, b as Se, o as Re, e as re, g as Me, X as je } from "./index-D020Kb3z.js";
3
3
  import { t as Be, u as Ge } from "./useResponsive-CoxXLe23.js";
4
- import { _ as Ue } from "./Title-DBozX6nP.js";
5
- import { u as De, U as Ve } from "./usePrinter-y3d31M4g.js";
6
- import We from "./vue-ui-skeleton-BY8Jg9a_.js";
7
- import { u as se } from "./useNestedProp-CRAUOmT5.js";
8
- import { _ as Xe } from "./PackageVersion-wqab02xF.js";
9
- import { P as Ye } from "./PenAndPaper-C_laA5mt.js";
4
+ import { _ as Ue } from "./Title-B2orjUIW.js";
5
+ import { u as De, U as Ve } from "./usePrinter-CN0J0NFL.js";
6
+ import We from "./vue-ui-skeleton-E1-7diF5.js";
7
+ import { u as se } from "./useNestedProp-CZkNAGQh.js";
8
+ import { _ as Xe } from "./PackageVersion-g2UOsY7H.js";
9
+ import { P as Ye } from "./PenAndPaper-DRFeGfqV.js";
10
10
  import { _ as qe } from "./_plugin-vue_export-helper-CHgC5LLL.js";
11
11
  const He = ["id"], Je = ["xmlns", "viewBox"], Ke = ["cx", "cy", "r", "stroke", "stroke-width"], Qe = { key: 0 }, Ze = ["stroke", "d", "stroke-width"], et = { key: 1 }, tt = ["stroke", "x1", "x2", "y1", "y2"], lt = ["text-anchor", "transform", "x", "y", "onClick", "font-weight", "font-size", "fill"], nt = ["cx", "cy", "fill", "onClick", "r"], rt = {
12
12
  key: 5,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-CsQwCVqU.cjs"),U=require("./useResponsive-BJ7DTGpm.cjs"),de=require("./Title-BRqTk-nT.cjs"),D=require("./usePrinter-O2fMMTMe.cjs"),ve=require("./vue-ui-skeleton-DsRTbz6d.cjs"),W=require("./useNestedProp-DSYpaLxP.cjs"),fe=require("./PackageVersion-BbQFSVXm.cjs"),ge=require("./PenAndPaper-BX8pR5oV.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],he=["xmlns","viewBox"],ke=["cx","cy","r","stroke","stroke-width"],pe={key:0},Ce=["stroke","d","stroke-width"],_e={key:1},$e=["stroke","x1","x2","y1","y2"],xe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],we=["cx","cy","fill","onClick","r"],Be={key:5,class:"vue-data-ui-watermark"},be={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(X,{expose:Y}){const u=X;e.useCssVars(t=>({"47419f48":ee.value,"77774d27":Z.value,df46026e:te.value}));const{vue_ui_relation_circle:H}=i.useConfig(),C=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(i.createUid()),B=e.ref(0),m=e.ref(null),b=e.ref(null),P=e.ref(null),A=e.ref(null),O=e.ref(0),n=e.computed({get:()=>E(),set:t=>t});function E(){const t=W.useNestedProp({userConfig:u.config,defaultConfig:H});return t.theme?{...W.useNestedProp({userConfig:i.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:i.themePalettes[t.theme]||i.palette}:t}e.watch(()=>u.config,t=>{n.value=E(),T(),O.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:N,generateImage:z}=D.usePrinter({elementId:`relation_circle_${g.value}`,fileName:n.value.style.title.text||"vue-ui-relation-circle"}),J=e.computed(()=>n.value.userOptions.show&&!n.value.style.title.text),F=e.computed(()=>i.convertCustomPalette(n.value.customPalette)),d=e.ref([]),f=e.ref([]),a=e.ref({}),c=e.ref([]),K=e.ref(0),_=e.computed(()=>u.dataset.slice(0,n.value.style.limit)),$=e.ref(n.value.style.size),s=e.ref({height:n.value.style.size,width:n.value.style.size}),v=e.computed({get(){return $.value*n.value.style.circle.radiusProportion},set(t){return t}}),Q=e.computed(()=>n.value.style.links.curved),Z=e.computed(()=>`${n.value.style.animation.speedMs}ms`),ee=e.computed(()=>v.value*2),te=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{T(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",L)});function T(){if(i.objectIsEmpty(u.dataset)?i.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.dataset.forEach((t,r)=>{i.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{i.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:r})})}),n.value.responsive){const t=U.throttle(()=>{const{width:r,height:l}=U.useResponsive({chart:m.value,title:n.value.style.title.text?b.value:null,source:P.value,noTitle:A.value});$.value=Math.min(r,l),s.value.width=r,s.value.height=l,v.value=$.value*n.value.style.circle.radiusProportion,d.value=[],f.value=[],V(),R()});h.value=new ResizeObserver(t),h.value.observe(m.value.parentNode)}else d.value=[],f.value=[],V(),R()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",L),h.value&&h.value.disconnect()});function L(t){const r=t.target;r&&Array.from(r.classList).includes("vue-ui-user-options")||r&&Array.from(r.classList).includes("vue-ui-user-options-summary")||r&&Array.from(r.classList).includes("vue-data-ui-button")||r&&Array.from(r.classList).includes("vue-ui-relation-circle-legend")||(a.value={},c.value=[])}function V(){const t=6.28319/_.value.length,r=360/_.value.length;let l=0,o=0;_.value.forEach((y,w)=>{const ue=v.value*Math.cos(l)+s.value.width/2,ce=v.value*Math.sin(l)+s.value.height/2+n.value.style.circle.offsetY;d.value.push({x:ue,y:ce,...y,color:y.color?y.color:F.value[w]?F.value[w]:i.palette[w],regAngle:o}),l+=t,o+=r})}function R(){d.value.forEach(t=>{d.value.filter(l=>l.relations.includes(t.id)).forEach((l,o)=>{f.value.push({weight:t.weights&&t.weights[o]?t.weights[o]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const le=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function ne(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function q(t){return Object.hasOwn(a.value,"x")?t.colorTarget:t.colorSource}function M(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${a.value.id}`||t.relationId===`${a.value.id}_${t.id}`?`opacity:1;stroke-width:${G(t)}`:"opacity: 0":"opacity: 1"}function re(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function oe(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ae(t){return Object.hasOwn(a.value,"x")?a.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function se(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function j(t){K.value=360-t.regAngle,a.value.id&&t.id===a.value.id?(a.value={},c.value=[]):(a.value=t,c.value=[...t.relations])}function G(t){return t.weight/le.value*n.value.style.links.maxWidth}const k=e.ref(!1);function ie(t){k.value=t,B.value+=1}const p=e.ref(!1);function x(){p.value=!p.value}return Y({generatePdf:N,generateImage:z,toggleAnnotator:x}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${n.value.style.backgroundColor};text-align:center;${n.value.responsive?"height: 100%":""}`),id:`relation_circle_${g.value}`},[n.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ge.PenAndPaper,{key:0,parent:m.value,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,active:p.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:A,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),n.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:b,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(de._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"relation-div-title",...n.value.style.title},subtitle:{cy:"relation-div-subtitle",...n.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),n.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_options_${B.value}`,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,isPrinting:e.unref(S),isImaging:e.unref(I),uid:g.value,hasPdf:n.value.userOptions.buttons.pdf,hasImg:n.value.userOptions.buttons.img,hasFullscreen:n.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...n.value.userOptions.buttonTitles},chartElement:m.value,position:n.value.userOptions.position,hasAnnotator:n.value.userOptions.buttons.annotator,isAnnotation:p.value,onToggleFullscreen:ie,onGeneratePdf:e.unref(N),onGenerateImage:e.unref(z),onToggleAnnotator:x},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(i.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(fe._sfc_main),e.createElementVNode("circle",{cx:(s.value.width<=0?1e-4:s.value.width)/2,cy:(s.value.height<=0?1e-4:s.value.height)/2+n.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:n.value.style.circle.stroke,"stroke-width":n.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ke),Q.value?(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(M(l)),stroke:q(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${s.value.width/2},${s.value.height/2+n.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":G(l),"stroke-linecap":"round"},null,14,Ce))),128))])):(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:q(l),style:e.normalizeStyle(M(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}),"stroke-linecap":"round"},null,14,$e))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":re(l),transform:se(l),x:oe(l),y:l.y+5,onClick:y=>j(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":a.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${n.value.style.fontFamily};${ae(l)}`),"font-size":n.value.style.labels.fontSize,fill:n.value.style.labels.color},e.toDisplayString(l.label),13,xe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${o}`,style:e.normalizeStyle(ne(l)),class:"vue-ui-relation-circle-plot",fill:n.value.style.plot.color,onClick:y=>j(l),r:n.value.style.plot.radius},null,12,we))),128)),e.renderSlot(t.$slots,"svg",{svg:s.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:n.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ye))}},Pe=me._export_sfc(be,[["__scopeId","data-v-a4837ff7"]]);exports.default=Pe;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),i=require("./index-3oZdQf6G.cjs"),U=require("./useResponsive-BJ7DTGpm.cjs"),de=require("./Title-BxrsVY3-.cjs"),D=require("./usePrinter-BKzxQK4e.cjs"),ve=require("./vue-ui-skeleton-CI8sxaqr.cjs"),W=require("./useNestedProp-vPTP0Wem.cjs"),fe=require("./PackageVersion-AftniVVo.cjs"),ge=require("./PenAndPaper-j5noaKJZ.cjs"),me=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),ye=["id"],he=["xmlns","viewBox"],ke=["cx","cy","r","stroke","stroke-width"],pe={key:0},Ce=["stroke","d","stroke-width"],_e={key:1},$e=["stroke","x1","x2","y1","y2"],xe=["text-anchor","transform","x","y","onClick","font-weight","font-size","fill"],we=["cx","cy","fill","onClick","r"],Be={key:5,class:"vue-data-ui-watermark"},be={__name:"vue-ui-relation-circle",props:{dataset:{type:Array,default(){return[]}},config:{type:Object,default(){return{}}}},setup(X,{expose:Y}){const u=X;e.useCssVars(t=>({"47419f48":ee.value,"77774d27":Z.value,df46026e:te.value}));const{vue_ui_relation_circle:H}=i.useConfig(),C=e.computed(()=>!!u.dataset&&Object.keys(u.dataset).length),g=e.ref(i.createUid()),B=e.ref(0),m=e.ref(null),b=e.ref(null),P=e.ref(null),A=e.ref(null),O=e.ref(0),n=e.computed({get:()=>E(),set:t=>t});function E(){const t=W.useNestedProp({userConfig:u.config,defaultConfig:H});return t.theme?{...W.useNestedProp({userConfig:i.themes.vue_ui_relation_circle[t.theme]||u.config,defaultConfig:t}),customPalette:i.themePalettes[t.theme]||i.palette}:t}e.watch(()=>u.config,t=>{n.value=E(),T(),O.value+=1},{deep:!0});const{isPrinting:S,isImaging:I,generatePdf:N,generateImage:z}=D.usePrinter({elementId:`relation_circle_${g.value}`,fileName:n.value.style.title.text||"vue-ui-relation-circle"}),J=e.computed(()=>n.value.userOptions.show&&!n.value.style.title.text),F=e.computed(()=>i.convertCustomPalette(n.value.customPalette)),d=e.ref([]),f=e.ref([]),a=e.ref({}),c=e.ref([]),K=e.ref(0),_=e.computed(()=>u.dataset.slice(0,n.value.style.limit)),$=e.ref(n.value.style.size),s=e.ref({height:n.value.style.size,width:n.value.style.size}),v=e.computed({get(){return $.value*n.value.style.circle.radiusProportion},set(t){return t}}),Q=e.computed(()=>n.value.style.links.curved),Z=e.computed(()=>`${n.value.style.animation.speedMs}ms`),ee=e.computed(()=>v.value*2),te=e.computed(()=>v.value*4),h=e.ref(null);e.onMounted(()=>{T(),document.getElementById(`relation_circle_${g.value}`).addEventListener("click",L)});function T(){if(i.objectIsEmpty(u.dataset)?i.error({componentName:"VueUiRelationCircle",type:"dataset"}):u.dataset.forEach((t,r)=>{i.getMissingDatasetAttributes({datasetObject:t,requiredAttributes:["id","label","relations","weights"]}).forEach(l=>{i.error({componentName:"VueUiRelationCircle",type:"datasetSerieAttribute",property:l,index:r})})}),n.value.responsive){const t=U.throttle(()=>{const{width:r,height:l}=U.useResponsive({chart:m.value,title:n.value.style.title.text?b.value:null,source:P.value,noTitle:A.value});$.value=Math.min(r,l),s.value.width=r,s.value.height=l,v.value=$.value*n.value.style.circle.radiusProportion,d.value=[],f.value=[],V(),R()});h.value=new ResizeObserver(t),h.value.observe(m.value.parentNode)}else d.value=[],f.value=[],V(),R()}e.onBeforeUnmount(()=>{document.getElementById(`relation_circle_${g.value}`).removeEventListener("click",L),h.value&&h.value.disconnect()});function L(t){const r=t.target;r&&Array.from(r.classList).includes("vue-ui-user-options")||r&&Array.from(r.classList).includes("vue-ui-user-options-summary")||r&&Array.from(r.classList).includes("vue-data-ui-button")||r&&Array.from(r.classList).includes("vue-ui-relation-circle-legend")||(a.value={},c.value=[])}function V(){const t=6.28319/_.value.length,r=360/_.value.length;let l=0,o=0;_.value.forEach((y,w)=>{const ue=v.value*Math.cos(l)+s.value.width/2,ce=v.value*Math.sin(l)+s.value.height/2+n.value.style.circle.offsetY;d.value.push({x:ue,y:ce,...y,color:y.color?y.color:F.value[w]?F.value[w]:i.palette[w],regAngle:o}),l+=t,o+=r})}function R(){d.value.forEach(t=>{d.value.filter(l=>l.relations.includes(t.id)).forEach((l,o)=>{f.value.push({weight:t.weights&&t.weights[o]?t.weights[o]:1,relationId:`${t.id}_${l.id}`,x1:t.x,y1:t.y,x2:l.x,y2:l.y,colorSource:t.color,colorTarget:l.color,...t})})})}const le=e.computed(()=>Math.max(...f.value.map(t=>t.weight)));function ne(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)?"opacity:1":"opacity:0.1":"opacity:1"}function q(t){return Object.hasOwn(a.value,"x")?t.colorTarget:t.colorSource}function M(t){return Object.hasOwn(a.value,"x")?c.value.includes(t.id)&&t.relationId===`${t.id}_${a.value.id}`||t.relationId===`${a.value.id}_${t.id}`?`opacity:1;stroke-width:${G(t)}`:"opacity: 0":"opacity: 1"}function re(t){return t.regAngle>90&&t.regAngle<270?"end":"start"}function oe(t){return t.regAngle>90&&t.regAngle<270?t.x-5:t.x+5}function ae(t){return Object.hasOwn(a.value,"x")?a.value.id===t.id||c.value.includes(t.id)?"opacity:1":"opacity:0.2":"opacity:1"}function se(t){return t.regAngle>90&&t.regAngle<270?`rotate(${t.regAngle+180},${t.x},${t.y})`:`rotate(${t.regAngle},${t.x},${t.y})`}function j(t){K.value=360-t.regAngle,a.value.id&&t.id===a.value.id?(a.value={},c.value=[]):(a.value=t,c.value=[...t.relations])}function G(t){return t.weight/le.value*n.value.style.links.maxWidth}const k=e.ref(!1);function ie(t){k.value=t,B.value+=1}const p=e.ref(!1);function x(){p.value=!p.value}return Y({generatePdf:N,generateImage:z,toggleAnnotator:x}),(t,r)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"relationCircleChart",ref:m,class:"vue-ui-relation-circle",style:e.normalizeStyle(`width:100%;background:${n.value.style.backgroundColor};text-align:center;${n.value.responsive?"height: 100%":""}`),id:`relation_circle_${g.value}`},[n.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(ge.PenAndPaper,{key:0,parent:m.value,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,active:p.value,onClose:x},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),J.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:A,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),n.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:b,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(de._sfc_main,{key:`title_${O.value}`,config:{title:{cy:"relation-div-title",...n.value.style.title},subtitle:{cy:"relation-div-subtitle",...n.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),n.value.userOptions.show&&C.value?(e.openBlock(),e.createBlock(D.UserOptions,{ref:"details",key:`user_options_${B.value}`,backgroundColor:n.value.style.backgroundColor,color:n.value.style.color,isPrinting:e.unref(S),isImaging:e.unref(I),uid:g.value,hasPdf:n.value.userOptions.buttons.pdf,hasImg:n.value.userOptions.buttons.img,hasFullscreen:n.value.userOptions.buttons.img,hasXls:!1,isFullscreen:k.value,titles:{...n.value.userOptions.buttonTitles},chartElement:m.value,position:n.value.userOptions.position,hasAnnotator:n.value.userOptions.buttons.annotator,isAnnotation:p.value,onToggleFullscreen:ie,onGeneratePdf:e.unref(N),onGenerateImage:e.unref(z),onToggleAnnotator:x},e.createSlots({_:2},[t.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionPdf",{},void 0,!0)]),key:"0"}:void 0,t.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(t.$slots,"optionImg",{},void 0,!0)]),key:"1"}:void 0,t.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:o})=>[e.renderSlot(t.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:o})),void 0,!0)]),key:"2"}:void 0,t.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:o})=>[e.renderSlot(t.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:o})),void 0,!0)]),key:"3"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasPdf","hasImg","hasFullscreen","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),C.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(i.XMLNS),class:e.normalizeClass([{"vue-data-ui-fullscreen--on":k.value,"vue-data-ui-fulscreen--off":!k.value},"relation-circle"]),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,width:"100%",style:"user-select:none; background:transparent"},[e.createVNode(fe._sfc_main),e.createElementVNode("circle",{cx:(s.value.width<=0?1e-4:s.value.width)/2,cy:(s.value.height<=0?1e-4:s.value.height)/2+n.value.style.circle.offsetY,r:v.value<=0?1e-4:v.value,stroke:n.value.style.circle.stroke,"stroke-width":n.value.style.circle.strokeWidth,fill:"transparent",class:"main-circle"},null,8,ke),Q.value?(e.openBlock(),e.createElementBlock("g",pe,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("path",{key:`relation_${o}`,style:e.normalizeStyle(M(l)),stroke:q(l),class:e.normalizeClass(["relation",{"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}]),d:`M${l.x1},${l.y1} C${l.x1},${l.y1} ${s.value.width/2},${s.value.height/2+n.value.style.circle.offsetY} ${l.x2},${l.y2}`,fill:"none","stroke-width":G(l),"stroke-linecap":"round"},null,14,Ce))),128))])):(e.openBlock(),e.createElementBlock("g",_e,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(f.value,(l,o)=>(e.openBlock(),e.createElementBlock("line",{key:`relation_${o}`,stroke:q(l),style:e.normalizeStyle(M(l)),x1:l.x1,x2:l.x2,y1:l.y1,y2:l.y2,class:e.normalizeClass({"vue-ui-relation-circle-selected":a.value.hasOwnProperty("id")&&c.value.includes(l.id)}),"stroke-linecap":"round"},null,14,$e))),128))])),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("text",{key:`plot_text_${o}`,"text-anchor":re(l),transform:se(l),x:oe(l),y:l.y+5,onClick:y=>j(l),class:"vue-ui-relation-circle-legend","transform-origin":"start","font-weight":a.value.id===l.id?"900":"400",style:e.normalizeStyle(`font-family:${n.value.style.fontFamily};${ae(l)}`),"font-size":n.value.style.labels.fontSize,fill:n.value.style.labels.color},e.toDisplayString(l.label),13,xe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(d.value,(l,o)=>(e.openBlock(),e.createElementBlock("circle",{cx:l.x,cy:l.y,key:`plot_${o}`,style:e.normalizeStyle(ne(l)),class:"vue-ui-relation-circle-plot",fill:n.value.style.plot.color,onClick:y=>j(l),r:n.value.style.plot.radius},null,12,we))),128)),e.renderSlot(t.$slots,"svg",{svg:s.value},void 0,!0)],10,he)):e.createCommentVNode("",!0),t.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Be,[e.renderSlot(t.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(S)||e.unref(I)})),void 0,!0)])):e.createCommentVNode("",!0),t.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:6,ref_key:"source",ref:P,dir:"auto"},[e.renderSlot(t.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),C.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(ve.default,{key:7,config:{type:"relationCircle",style:{backgroundColor:n.value.style.backgroundColor,relationCircle:{color:"#CCCCCC"}}}},null,8,["config"]))],12,ye))}},Pe=me._export_sfc(be,[["__scopeId","data-v-a4837ff7"]]);exports.default=Pe;
@@ -1,16 +1,16 @@
1
1
  import { ref as n, computed as v, watch as Re, onMounted as Ve, onBeforeUnmount as Be, openBlock as r, createElementBlock as f, normalizeClass as W, normalizeStyle as I, createBlock as _, createCommentVNode as k, unref as i, createSlots as De, withCtx as p, renderSlot as h, normalizeProps as F, guardReactiveProps as M, createVNode as fe, createElementVNode as C, Fragment as ye, renderList as me, createTextVNode as be, toDisplayString as E, nextTick as Ue } from "vue";
2
- import { u as We, c as ke, t as Ee, a as Ge, p as x, o as He, e as Y, g as Xe, b as je, I as Ye, d as Ce, f as N, X as qe, s as Je, w as Ke, v as q, i as we, x as Qe, y as Ze, q as et, r as tt } from "./index-hV0hU1iE.js";
2
+ import { u as We, c as ke, t as Ee, a as Ge, p as x, o as He, e as Y, g as Xe, b as je, I as Ye, d as Ce, f as N, X as qe, s as Je, w as Ke, v as q, i as we, x as Qe, y as Ze, q as et, r as tt } from "./index-D020Kb3z.js";
3
3
  import { t as lt, u as ot } from "./useResponsive-CoxXLe23.js";
4
- import { _ as at } from "./Title-DBozX6nP.js";
5
- import { u as st, U as nt } from "./usePrinter-y3d31M4g.js";
6
- import { _ as rt } from "./Tooltip-Com_T8vc.js";
7
- import { D as ut } from "./DataTable-BpVz3DBX.js";
8
- import { L as it } from "./Legend-hnLfwhmm.js";
9
- import vt from "./vue-ui-skeleton-BY8Jg9a_.js";
10
- import ct from "./vue-ui-accordion-m-s-7akB.js";
11
- import { u as $e } from "./useNestedProp-CRAUOmT5.js";
12
- import { _ as dt } from "./PackageVersion-wqab02xF.js";
13
- import { P as pt } from "./PenAndPaper-C_laA5mt.js";
4
+ import { _ as at } from "./Title-B2orjUIW.js";
5
+ import { u as st, U as nt } from "./usePrinter-CN0J0NFL.js";
6
+ import { _ as rt } from "./Tooltip-CXjc5vb3.js";
7
+ import { D as ut } from "./DataTable-Ce4R8v-3.js";
8
+ import { L as it } from "./Legend-C6q2bLVV.js";
9
+ import vt from "./vue-ui-skeleton-E1-7diF5.js";
10
+ import ct from "./vue-ui-accordion-B0fEWLwn.js";
11
+ import { u as $e } from "./useNestedProp-CZkNAGQh.js";
12
+ import { _ as dt } from "./PackageVersion-g2UOsY7H.js";
13
+ import { P as pt } from "./PenAndPaper-DRFeGfqV.js";
14
14
  import { _ as ht } from "./_plugin-vue_export-helper-CHgC5LLL.js";
15
15
  const gt = ["id"], ft = ["xmlns", "viewBox"], yt = ["id"], mt = ["stop-color"], bt = ["stop-color"], kt = ["stroke", "cx", "cy", "r", "fill"], Ct = ["stroke", "stroke-width", "cx", "cy", "r", "fill"], wt = ["cx", "cy", "r", "onMouseenter"], $t = {
16
16
  key: 5,
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-CsQwCVqU.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./Title-BRqTk-nT.cjs"),ee=require("./usePrinter-O2fMMTMe.cjs"),fe=require("./Tooltip-DvGSIp31.cjs"),me=require("./DataTable-H-KTkjfv.cjs"),ye=require("./Legend-G5Zc4QaZ.cjs"),be=require("./vue-ui-skeleton-DsRTbz6d.cjs"),ke=require("./vue-ui-accordion-CaktYQoo.cjs"),te=require("./useNestedProp-DSYpaLxP.cjs"),Ce=require("./PackageVersion-BbQFSVXm.cjs"),we=require("./PenAndPaper-BX8pR5oV.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],Ne=["xmlns","viewBox"],$e=["id"],Se=["stop-color"],Be=["stop-color"],Pe=["stroke","cx","cy","r","fill"],_e=["stroke","stroke-width","cx","cy","r","fill"],Le=["cx","cy","r","onMouseenter"],Ve={key:5,class:"vue-data-ui-watermark"},Ee=["onClick"],Ae={key:0},Oe={key:1},ze=["innerHTML"],Fe={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:le,emit:ae}){const v=oe,{vue_ui_rings:re}=r.useConfig(),b=e.ref(!1),T=e.computed(()=>!!v.dataset&&v.dataset.length),k=e.ref(r.createUid()),ne=e.ref(null),x=e.ref(!1),P=e.ref(""),m=e.ref(null),E=e.ref(0),y=e.ref(null),A=e.ref(null),O=e.ref(null),z=e.ref(null),F=e.ref(null),I=e.ref(0),R=e.ref(0),M=e.ref(0),t=e.computed({get:()=>q(),set:o=>o});function q(){const o=te.useNestedProp({userConfig:v.config,defaultConfig:re});return o.theme?{...te.useNestedProp({userConfig:r.themes.vue_ui_rings[o.theme]||v.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>v.config,o=>{t.value=q(),D(),I.value+=1,R.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((o,a)=>{o.values.length||r.error({componentName:"VueUiRings",type:"dataset"}),r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=Z.throttle(()=>{const{width:a,height:l}=Z.useResponsive({chart:y.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:z.value,noTitle:F.value});s.value.width=a,s.value.height=l});N.value=new ResizeObserver(o),N.value.observe(y.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ee.usePrinter({elementId:`rings_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),se=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function _(o){i.value.includes(o)?i.value=i.value.filter(a=>a!==o):i.value.push(o),ae("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ie=e.computed(()=>Math.max(...$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o)));function X(o){return o/ie.value}const $=e.computed(()=>v.dataset.map(({values:o,name:a,color:l=null},n)=>{const u=r.sanitizeArray(o).reduce((h,w)=>h+w,0);return{name:a,color:l||r.convertColorToHex(l)||j.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,he)=>w+he,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),Y=e.computed(()=>$.value.map(o=>({...o,shape:"circle",opacity:i.value.includes(o.uid)?.5:1,segregate:()=>_(o.uid),isSegregated:i.value.includes(o.uid)})).toSorted((o,a)=>a.value-o.value)),ce=e.computed(()=>({cy:"rings-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o).reduce((o,a)=>o+a,0)),c=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({name:o,value:a,color:l=null,uid:n},u)=>({uid:n,name:o,color:l||r.convertColorToHex(l)||j.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:X(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*X(a)})).toSorted((o,a)=>a.value-o.value));function de(){return c.value.map(({name:o,color:a,value:l,absoluteValues:n,percentage:u})=>({name:o,color:a,value:l,absoluteValues:n,percentage:u}))}const d=e.computed(()=>se.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ve(o,a){if(i.value.length===v.dataset.length)return;L.value={datapoint:a,seriesIndex:o,series:c.value,config:t.value},m.value=o;const l=c.value[o],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:o,datapoint:a,series:c.value,config:t.value})))P.value=n({seriesIndex:o,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),r=require("./index-3oZdQf6G.cjs"),Z=require("./useResponsive-BJ7DTGpm.cjs"),ge=require("./Title-BxrsVY3-.cjs"),ee=require("./usePrinter-BKzxQK4e.cjs"),fe=require("./Tooltip-BXc56Oxr.cjs"),me=require("./DataTable-DeevzR8O.cjs"),ye=require("./Legend-BksImVUi.cjs"),be=require("./vue-ui-skeleton-CI8sxaqr.cjs"),ke=require("./vue-ui-accordion-QoJofzqF.cjs"),te=require("./useNestedProp-vPTP0Wem.cjs"),Ce=require("./PackageVersion-AftniVVo.cjs"),we=require("./PenAndPaper-j5noaKJZ.cjs"),Te=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),xe=["id"],Ne=["xmlns","viewBox"],$e=["id"],Se=["stop-color"],Be=["stop-color"],Pe=["stroke","cx","cy","r","fill"],_e=["stroke","stroke-width","cx","cy","r","fill"],Le=["cx","cy","r","onMouseenter"],Ve={key:5,class:"vue-data-ui-watermark"},Ee=["onClick"],Ae={key:0},Oe={key:1},ze=["innerHTML"],Fe={__name:"vue-ui-rings",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},emits:["selectLegend"],setup(oe,{expose:le,emit:ae}){const v=oe,{vue_ui_rings:re}=r.useConfig(),b=e.ref(!1),T=e.computed(()=>!!v.dataset&&v.dataset.length),k=e.ref(r.createUid()),ne=e.ref(null),x=e.ref(!1),P=e.ref(""),m=e.ref(null),E=e.ref(0),y=e.ref(null),A=e.ref(null),O=e.ref(null),z=e.ref(null),F=e.ref(null),I=e.ref(0),R=e.ref(0),M=e.ref(0),t=e.computed({get:()=>q(),set:o=>o});function q(){const o=te.useNestedProp({userConfig:v.config,defaultConfig:re});return o.theme?{...te.useNestedProp({userConfig:r.themes.vue_ui_rings[o.theme]||v.config,defaultConfig:o}),customPalette:r.themePalettes[o.theme]||r.palette}:o}e.watch(()=>v.config,o=>{t.value=q(),D(),I.value+=1,R.value+=1,M.value+=1},{deep:!0});const N=e.ref(null);e.onMounted(()=>{D()});function D(){if(r.objectIsEmpty(v.dataset)?r.error({componentName:"VueUiRings",type:"dataset"}):v.dataset.forEach((o,a)=>{o.values.length||r.error({componentName:"VueUiRings",type:"dataset"}),r.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["name","values"]}).forEach(l=>{r.error({componentName:"VueUiRings",type:"datasetSerieAttribute",property:l,index:a})})}),t.value.responsive){const o=Z.throttle(()=>{const{width:a,height:l}=Z.useResponsive({chart:y.value,title:t.value.style.chart.title.text?A.value:null,legend:t.value.style.chart.legend.show?O.value:null,source:z.value,noTitle:F.value});s.value.width=a,s.value.height=l});N.value=new ResizeObserver(o),N.value.observe(y.value.parentNode)}setTimeout(()=>{b.value=!0},600)}e.onBeforeUnmount(()=>{N.value&&N.value.disconnect()});const{isPrinting:U,isImaging:H,generatePdf:W,generateImage:G}=ee.usePrinter({elementId:`rings_${k.value}`,fileName:t.value.style.chart.title.text||"vue-ui-rings"}),ue=e.computed(()=>t.value.userOptions.show&&!t.value.style.chart.title.text),j=e.computed(()=>r.convertCustomPalette(t.value.customPalette)),g=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.chart.tooltip.show}),s=e.ref({height:360,width:360}),se=e.computed(()=>Math.min(s.value.height,s.value.width)),i=e.ref([]);function _(o){i.value.includes(o)?i.value=i.value.filter(a=>a!==o):i.value.push(o),ae("selectLegend",c.value.map(a=>({name:a.name,color:a.color,value:a.value})))}const ie=e.computed(()=>Math.max(...$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o)));function X(o){return o/ie.value}const $=e.computed(()=>v.dataset.map(({values:o,name:a,color:l=null},n)=>{const u=r.sanitizeArray(o).reduce((h,w)=>h+w,0);return{name:a,color:l||r.convertColorToHex(l)||j.value[n]||r.palette[n]||r.palette[n%r.palette.length],value:u,proportion:u/v.dataset.map(h=>(h.values||[]).reduce((w,he)=>w+he,0)).reduce((h,w)=>h+w,0),uid:r.createUid()}})),Y=e.computed(()=>$.value.map(o=>({...o,shape:"circle",opacity:i.value.includes(o.uid)?.5:1,segregate:()=>_(o.uid),isSegregated:i.value.includes(o.uid)})).toSorted((o,a)=>a.value-o.value)),ce=e.computed(()=>({cy:"rings-div-legend",backgroundColor:t.value.style.chart.legend.backgroundColor,color:t.value.style.chart.legend.color,fontSize:t.value.style.chart.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.chart.legend.bold?"bold":""})),p=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({value:o})=>o).reduce((o,a)=>o+a,0)),c=e.computed(()=>$.value.filter(o=>!i.value.includes(o.uid)).map(({name:o,value:a,color:l=null,uid:n},u)=>({uid:n,name:o,color:l||r.convertColorToHex(l)||j.value[u]||r.palette[u]||r.palette[u%r.palette.length],value:a,proportion:X(a),percentage:a/p.value*100,strokeWidth:t.value.style.chart.layout.rings.strokeWidth*X(a)})).toSorted((o,a)=>a.value-o.value));function de(){return c.value.map(({name:o,color:a,value:l,absoluteValues:n,percentage:u})=>({name:o,color:a,value:l,absoluteValues:n,percentage:u}))}const d=e.computed(()=>se.value-t.value.style.chart.layout.rings.strokeWidth*2),L=e.ref(null);function ve(o,a){if(i.value.length===v.dataset.length)return;L.value={datapoint:a,seriesIndex:o,series:c.value,config:t.value},m.value=o;const l=c.value[o],n=t.value.style.chart.tooltip.customFormat;if(r.isFunction(n)&&r.functionReturnsString(()=>n({seriesIndex:o,datapoint:a,series:c.value,config:t.value})))P.value=n({seriesIndex:o,datapoint:a,series:c.value,config:t.value});else{let u="";u+=`<div style="width:100%;text-align:center;border-bottom:1px solid ${t.value.style.chart.tooltip.borderColor};padding-bottom:6px;margin-bottom:3px;">${l.name}</div>`,u+=`<div style="display:flex;flex-direction:row;gap:6px;align-items:center;"><svg viewBox="0 0 12 12" height="14" width="14"><circle cx="6" cy="6" r="6" stroke="none" fill="${l.color}" /></svg>`,t.value.style.chart.tooltip.showValue&&(u+=`<b>${r.applyDataLabel(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.tooltip.roundingValue}),{datapoint:a,seriesIndex:o})}
2
2
  </b>`),t.value.style.chart.tooltip.showPercentage&&(t.value.style.chart.tooltip.showValue?u+=`<span>(${r.dataLabel({v:l.value/p.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})})</span></div>`:u+=`<b>${r.dataLabel({v:l.value/p.value*100,s:"%",r:t.value.style.chart.tooltip.roundingPercentage})}</b></div>`),P.value=u}x.value=!0}const f=e.computed(()=>{const o=c.value.map(l=>({name:l.name,color:l.color})),a=c.value.map(l=>l.value);return{head:o,body:a}}),S=e.computed(()=>{const o=[' <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 16v2a1 1 0 0 1 -1 1h-11l6 -7l-6 -7h11a1 1 0 0 1 1 1v2" /></svg>',r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:p.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),"100%"],a=f.value.head.map((u,h)=>[{color:u.color,name:u.name},r.dataLabel({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:f.value.body[h],s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.table.td.roundingValue}),isNaN(f.value.body[h]/p.value)?"-":(f.value.body[h]/p.value*100).toFixed(t.value.table.td.roundingPercentage)+"%"]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint},n=[t.value.table.columnNames.series,t.value.table.columnNames.value,t.value.table.columnNames.percentage];return{head:o,body:a,config:l,colNames:n}});function J(){e.nextTick(()=>{const o=f.value.head.map((n,u)=>[[n.name],[f.value.body[u]],[isNaN(f.value.body[u]/p.value)?"-":f.value.body[u]/p.value*100]]),a=[[t.value.style.chart.title.text],[t.value.style.chart.title.subtitle.text],[[""],["val"],["%"]]].concat(o),l=r.createCsvContent(a);r.downloadCsv({csvContent:l,title:t.value.style.chart.title.text||"vue-ui-rings"})})}const C=e.ref(!1);function pe(o){C.value=o,E.value+=1}function K(){g.value.showTable=!g.value.showTable}function Q(){g.value.showTooltip=!g.value.showTooltip}const B=e.ref(!1);function V(){B.value=!B.value}return le({getData:de,generatePdf:W,generateCsv:J,generateImage:G,toggleTable:K,toggleTooltip:Q,toggleAnnotator:V}),(o,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"ringsChart",ref:y,class:e.normalizeClass(`vue-ui-rings ${C.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};text-align:center;width:100%;background:${t.value.style.chart.backgroundColor};${t.value.responsive?"height: 100%":""}`),id:`rings_${k.value}`,onMouseleave:a[3]||(a[3]=l=>{m.value=null,x.value=!1})},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(we.PenAndPaper,{key:0,parent:y.value,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,active:B.value,onClose:V},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),ue.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:F,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.chart.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:A,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ge._sfc_main,{key:`title_${I.value}`,config:{title:{cy:"rings-div-title",...t.value.style.chart.title},subtitle:{cy:"rings-div-subtitle",...t.value.style.chart.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&T.value?(e.openBlock(),e.createBlock(ee.UserOptions,{ref_key:"details",ref:ne,key:`user_options_${E.value}`,backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color,isPrinting:e.unref(U),isImaging:e.unref(H),uid:k.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.chart.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasXls:t.value.userOptions.buttons.csv,hasImg:t.value.userOptions.buttons.img,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:g.value.showTooltip,isFullscreen:C.value,titles:{...t.value.userOptions.buttonTitles},chartElement:y.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:B.value,onToggleFullscreen:pe,onGeneratePdf:e.unref(W),onGenerateCsv:J,onGenerateImage:e.unref(G),onToggleTable:K,onToggleTooltip:Q,onToggleAnnotator:V},e.createSlots({_:2},[o.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,o.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,o.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,o.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,o.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(o.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,o.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:n})=>[e.renderSlot(o.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:n})),void 0,!0)]),key:"5"}:void 0,o.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:n})=>[e.renderSlot(o.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:n})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isPrinting","isImaging","uid","hasTooltip","hasPdf","hasXls","hasImg","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),T.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(r.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":C.value,"vue-data-ui-fulscreen--off":!C.value}),viewBox:`0 0 ${s.value.width<=0?10:s.value.width} ${s.value.height<=0?10:s.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.chart.color}`)},[e.createVNode(Ce._sfc_main),e.createElementVNode("defs",null,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,n)=>(e.openBlock(),e.createElementBlock("radialGradient",{cx:"50%",cy:"30%",r:"50%",fx:"50%",fy:"50%",id:`gradient_${k.value}_${n}`},[e.createElementVNode("stop",{offset:"0%","stop-color":e.unref(r.setOpacity)(e.unref(r.shiftHue)(l.color,.05),100-t.value.style.chart.layout.rings.gradient.intensity)},null,8,Se),e.createElementVNode("stop",{offset:"100%","stop-color":l.color},null,8,Be)],8,$e))),256))]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(c.value,(l,n)=>(e.openBlock(),e.createElementBlock("g",null,[e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-opacity":m.value!==null&&m.value!==n}),style:e.normalizeStyle(`animation-delay:${n*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*l.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*l.proportion/2*.9<=0?1e-4:d.value*l.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.underlayerColor},null,14,Pe),e.createElementVNode("circle",{class:e.normalizeClass({"vue-ui-rings-item":b.value&&t.value.useCssAnimation,"vue-rings-item-onload":!b.value&&t.value.useCssAnimation,"vue-ui-rings-shadow":t.value.style.chart.layout.rings.useShadow,"vue-ui-rings-blur":m.value!==null&&m.value!==n}),style:e.normalizeStyle(`animation-delay:${n*100}ms`),stroke:t.value.style.chart.layout.rings.stroke,"stroke-width":l.strokeWidth<.5?.5:l.strokeWidth,cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*l.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*l.proportion/2*.9<=0?1e-4:d.value*l.proportion/2*.9),fill:t.value.style.chart.layout.rings.gradient.show?`url(#gradient_${k.value}_${n})`:l.color},null,14,_e),e.createElementVNode("circle",{"data-cy-trap":"",stroke:"none",cx:s.value.width/2,cy:n===0?s.value.height/2:s.value.height/2+d.value*c.value[0].proportion/2-d.value*l.proportion/2-2*(n+1),r:e.unref(r.checkNaN)(d.value*l.proportion/2*.9<=0?1e-4:d.value*l.proportion/2*.9),fill:"transparent",onMouseenter:u=>ve(n,l),onMouseleave:a[0]||(a[0]=u=>{m.value=null,x.value=!1})},null,40,Le)]))),256)),e.renderSlot(o.$slots,"svg",{svg:s.value},void 0,!0)],14,Ne)):e.createCommentVNode("",!0),o.$slots.watermark?(e.openBlock(),e.createElementBlock("div",Ve,[e.renderSlot(o.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(U)||e.unref(H)})),void 0,!0)])):e.createCommentVNode("",!0),T.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(be.default,{key:6,config:{type:"rings",style:{backgroundColor:t.value.style.chart.backgroundColor,rings:{color:"#CCCCCC"}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:O},[t.value.style.chart.legend.show?(e.openBlock(),e.createBlock(ye.Legend,{key:`legend_${M.value}`,legendSet:Y.value,config:ce.value,onClickMarker:a[1]||(a[1]=({legend:l})=>_(l.uid))},{item:e.withCtx(({legend:l,index:n})=>[e.createElementVNode("div",{"data-cy-legend-item":"",onClick:u=>_(l.uid),style:e.normalizeStyle(`opacity:${i.value.includes(l.uid)?.5:1}`)},[e.createTextVNode(e.toDisplayString(l.name)+": "+e.toDisplayString(e.unref(r.applyDataLabel)(t.value.style.chart.layout.labels.dataLabels.formatter,l.value,e.unref(r.dataLabel)({p:t.value.style.chart.layout.labels.dataLabels.prefix,v:l.value,s:t.value.style.chart.layout.labels.dataLabels.suffix,r:t.value.style.chart.legend.roundingValue}),{datapoint:l,seriesIndex:n}))+" ",1),i.value.includes(l.uid)?(e.openBlock(),e.createElementBlock("span",Oe," ( - % ) ")):(e.openBlock(),e.createElementBlock("span",Ae," ("+e.toDisplayString(isNaN(l.value/p.value)?"-":e.unref(r.dataLabel)({v:l.value/p.value*100,s:"%",r:t.value.style.chart.legend.roundingPercentage}))+") ",1))],12,Ee)]),_:1},8,["legendSet","config"])):e.renderSlot(o.$slots,"legend",{key:1,legend:Y.value},void 0,!0)],512),o.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:z,dir:"auto"},[e.renderSlot(o.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(fe._sfc_main,{show:g.value.showTooltip&&x.value&&i.value.length<v.dataset.length,backgroundColor:t.value.style.chart.tooltip.backgroundColor,color:t.value.style.chart.tooltip.color,borderRadius:t.value.style.chart.tooltip.borderRadius,borderColor:t.value.style.chart.tooltip.borderColor,borderWidth:t.value.style.chart.tooltip.borderWidth,fontSize:t.value.style.chart.tooltip.fontSize,backgroundOpacity:t.value.style.chart.tooltip.backgroundOpacity,position:t.value.style.chart.tooltip.position,offsetY:t.value.style.chart.tooltip.offsetY,parent:y.value,content:P.value,isCustom:t.value.style.chart.tooltip.customFormat&&typeof t.value.style.chart.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(o.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...L.value})),void 0,!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),T.value?(e.openBlock(),e.createBlock(ke.default,{key:8,hideDetails:"",config:{open:g.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color},head:{backgroundColor:t.value.style.chart.backgroundColor,color:t.value.style.chart.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(me.DataTable,{key:`table_${R.value}`,colNames:S.value.colNames,head:S.value.head,body:S.value.body,config:S.value.config,title:`${t.value.style.chart.title.text}${t.value.style.chart.title.subtitle.text?` : ${t.value.style.chart.title.subtitle.text}`:""}`,onClose:a[2]||(a[2]=l=>g.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createElementVNode("div",{innerHTML:l,style:{display:"flex","align-items":"center"}},null,8,ze)]),td:e.withCtx(({td:l})=>[e.createTextVNode(e.toDisplayString(l.name||l),1)]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],46,xe))}},Ie=Te._export_sfc(Fe,[["__scopeId","data-v-2a4f4cb4"]]);exports.default=Ie;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-CsQwCVqU.cjs"),ke=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./Title-BRqTk-nT.cjs"),xe=require("./usePrinter-O2fMMTMe.cjs"),Ve=require("./Tooltip-DvGSIp31.cjs"),Ae=require("./Legend-G5Zc4QaZ.cjs"),be=require("./Shape-CJbFv4bs.cjs"),Te=require("./DataTable-H-KTkjfv.cjs"),Pe=require("./vue-ui-skeleton-DsRTbz6d.cjs"),De=require("./vue-ui-accordion-CaktYQoo.cjs"),Be=require("./useNestedProp-DSYpaLxP.cjs"),Fe=require("./PackageVersion-BbQFSVXm.cjs"),Oe=require("./PenAndPaper-BX8pR5oV.cjs"),We=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["id"],Ie=["xmlns","viewBox"],Xe={key:0},Ye=["x1","x2","y1","y2","stroke","stroke-width"],je=["x1","x2","y1","y2","stroke","stroke-width"],Re={key:1},Ge=["points","fill","stroke-width","stroke-dasharray","stroke"],Ue={key:0},He=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Je={key:1},Ke={key:2},Qe=["id"],Ze=["stop-color"],et=["stop-color"],tt=["id"],lt=["stop-color"],at=["stop-color"],ot=["x","y","width","height","fill","stroke","stroke-width","rx"],st=["x","y","height","width","fill","stroke","stroke-width","rx"],rt={key:0},nt=["d","stroke","stroke-width"],ut=["d","stroke","stroke-width"],it=["d","stroke","stroke-width"],ct=["d","stroke","stroke-width"],yt={key:3,style:{"pointer-events":"none !important"}},vt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],dt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],pt=["x","y","font-size","fill","font-weight","text-anchor"],ht=["x","y","font-size","fill","font-weight"],ft=["cx","cy","r","fill","stroke","stroke-width"],mt=["cx","cy","r","fill","stroke","stroke-width"],gt=["x","y","font-size","fill","font-weight","text-anchor"],kt={key:4},xt=["x","y","font-size","fill"],bt=["x","y","font-size","fill"],Bt=["id","transform","font-size","font-weight","fill"],wt={key:5},_t=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],Nt=["font-size","font-weight","fill","x","y"],St=["id"],Mt=["x","y","width","height"],$t={key:6},Et=["x1","x2","y1","y2","stroke-dasharray","stroke","stroke-width","clip-path"],Lt=["x","y","fill","font-size","font-weight"],zt={key:5,class:"vue-data-ui-watermark"},Vt=["onClick"],At={key:0,style:{width:"100%",display:"flex","align-items":"center","justify-content":"center"}},Tt={viewBox:"0 0 20 20",height:"20",width:"20",style:{overflow:"hidden",background:"transparent"}},Pt={key:0},Dt=["innerHTML"],Ft={__name:"vue-ui-scatter",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(we,{expose:_e}){const C=we,{vue_ui_scatter:Ce}=s.useConfig(),P=e.computed(()=>!!C.dataset&&C.dataset.length),g=e.ref(s.createUid()),Ne=e.ref(null),I=e.ref(!1),X=e.ref(""),J=e.ref(0),V=e.ref(null),K=e.ref(null),Q=e.ref(null),Z=e.ref(null),ee=e.ref(null),te=e.ref(0),le=e.ref(0),ae=e.ref(0),t=e.computed({get:()=>oe(),set:a=>a});function oe(){const a=Be.useNestedProp({userConfig:C.config,defaultConfig:Ce});return a.theme?{...Be.useNestedProp({userConfig:s.themes.vue_ui_scatter[a.theme]||C.config,defaultConfig:a}),customPalette:s.themePalettes[a.theme]||s.palette}:a}e.watch(()=>C.config,a=>{t.value=oe(),se(),te.value+=1,le.value+=1,ae.value+=1},{deep:!0});const D=e.ref(null);e.onMounted(()=>{se()});function se(){if(s.objectIsEmpty(C.dataset)&&s.error({componentName:"VueUiScatter",type:"dataset"}),t.value.responsive){const a=ke.throttle(()=>{const{width:u,height:l}=ke.useResponsive({chart:V.value,title:t.value.style.title.text?K.value:null,legend:t.value.style.legend.show?Q.value:null,source:Z.value,noTitle:ee.value});k.value.width=u,k.value.height=l});D.value=new ResizeObserver(a),D.value.observe(V.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const{isPrinting:re,isImaging:ne,generatePdf:ue,generateImage:ie}=xe.usePrinter({elementId:`vue-ui-scatter_${g.value}`,fileName:t.value.style.title.text||"vue-ui-scatter"}),Se=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),ce=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),S=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),k=e.ref({height:t.value.style.layout.height,width:t.value.style.layout.width}),F=e.computed(()=>t.value.style.layout.marginalBars.show?t.value.style.layout.marginalBars.size+t.value.style.layout.marginalBars.offset:0),n=e.computed(()=>({top:t.value.style.layout.padding.top+F.value,right:k.value.width-t.value.style.layout.padding.right-F.value,bottom:k.value.height-t.value.style.layout.padding.bottom,left:t.value.style.layout.padding.left,height:k.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom-F.value,width:k.value.width-t.value.style.layout.padding.left-t.value.style.layout.padding.right-F.value})),y=e.computed(()=>{C.dataset.forEach((o,i)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["values"]}).forEach(h=>{s.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:h,index:i})}),o.values&&o.values.forEach((h,E)=>{s.getMissingDatasetAttributes({datasetObject:h,requiredAttributes:["x","y"]}).forEach(A=>{s.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:`values.${A}`,index:`${i} - ${E}`})})})});const a=Math.min(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.x))),u=Math.max(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.x))),l=Math.min(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.y))),r=Math.max(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.y)));return{xMin:a>=0?0:a,xMax:u,yMin:l>=0?0:l,yMax:r}}),v=e.computed(()=>({x:n.value.left+Math.abs(y.value.xMin)/(y.value.xMax+Math.abs(y.value.xMin))*n.value.width,y:n.value.bottom-Math.abs(y.value.yMin)/(y.value.yMax+Math.abs(y.value.yMin))*n.value.height})),$=e.computed(()=>C.dataset.map((a,u)=>{const l=`cluster_${g.value}_${u}`;return{...a,values:s.largestTriangleThreeBuckets({data:a.values,threshold:t.value.downsample.threshold}),id:l,color:a.color?a.color:ce.value[u]||s.palette[u]||s.palette[u%s.palette.length],opacity:p.value.includes(l)?.5:1,shape:a.shape??"circle",segregate:()=>he(l),isSegregated:p.value.includes(l)}})),Me=e.computed(()=>({cy:"scatter-div-legend",backgroundColor:t.value.style.legend.backgroundColor,color:t.value.style.legend.color,fontSize:t.value.style.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.legend.bold?"bold":""})),Y=e.computed(()=>$.value.map((a,u)=>({...a,plots:a.values.map(l=>({x:n.value.left+(l.x+Math.abs(y.value.xMin))/(y.value.xMax+Math.abs(y.value.xMin))*n.value.width,y:n.value.bottom-(l.y+Math.abs(y.value.yMin))/(y.value.yMax+Math.abs(y.value.yMin))*n.value.height,v:{...l,name:l.name||""},clusterName:a.name,color:a.color?a.color:ce.value[u]||s.palette[u]||s.palette[u%s.palette.length],id:`plot_${g.value}_${Math.random()}`,weight:l.weight??t.value.style.layout.plots.radius}))})).filter(a=>!p.value.includes(a.id))),x=e.computed(()=>Y.value.map(a=>{const u=a.plots.reduce((d,L)=>d+L.x,0)/a.plots.length,l=a.plots.reduce((d,L)=>d+L.y,0)/a.plots.length;let r=0,o=0,i=0;for(const d of a.plots)r+=(d.x-u)*(d.y-l),o+=(d.x-u)**2,i+=(d.y-l)**2;const h=r/Math.sqrt(o*i),E=h*(Math.sqrt(i)/Math.sqrt(o)),A=l-E*u,_={x1:n.value.left,x2:n.value.right,y1:E*n.value.left+A,y2:E*n.value.right+A,coefficient:h},m=(_.y2-_.y1)/(_.x2-_.x1),B=_.y1-m*_.x1,N=Math.min(k.value.width-t.value.style.layout.padding.right,Math.max(t.value.style.layout.padding.left,(n.value.top-B)/m)),q={x:N,y:m*N+B<=t.value.style.layout.padding.top?n.value.top:m*N+B};return{...a,correlation:_,label:q,plots:a.plots.map(d=>{const L=(d.x+m*d.y-m*B)/(1+Math.pow(m,2)),G=(m*d.x+Math.pow(m,2)*d.y+B)/(1+Math.pow(m,2)),f=Math.sqrt(Math.pow(d.x-L,2)+Math.pow(d.y-G,2));return{...d,deviation:f,shape:a.shape,color:a.color}})}})),ye=e.computed(()=>Math.max(...x.value.flatMap(a=>a.plots.map(u=>Math.abs(u.deviation)))));function $e(){return x.value}function ve(a,u){const l=Array.isArray(a)?a.flatMap(f=>f.plots.map(z=>({x:z.x,y:z.y}))):a.plots.map(f=>({x:f.x,y:f.y}));let r=1/0,o=-1/0,i=1/0,h=-1/0;l.forEach(({x:f,y:z})=>{r=Math.min(r,f),o=Math.max(o,f),i=Math.min(i,z),h=Math.max(h,z)});const E=o-r,A=h-i,_=E/u,m=A/u,B=Array(u).fill(0),N=Array(u).fill(0);l.forEach(({x:f,y:z})=>{const U=Math.floor((f-r)/_),H=Math.floor((z-i)/m);B[U]||(B[U]=0),N[H]||(N[H]=0),B[U]+=1,N[H]+=1});const q=[],d=[];for(let f=0;f<u;f+=1)q.push(r+(f+.5)*_),d.push(i+(f+.5)*m);const L=Math.max(...B),G=Math.max(...N);return{x:B,y:N,avgX:q,avgY:d,maxX:L,maxY:G}}const M=e.computed(()=>t.value.style.layout.marginalBars.tranches),b=e.computed(()=>ve(Y.value,M.value)),Ee=e.computed(()=>{const a=n.value.top-t.value.style.layout.marginalBars.offset,u=n.value.right+t.value.style.layout.marginalBars.offset;return Y.value.map(l=>{const r=ve(l,M.value);return{coords:r,dX:s.createSmoothPath(r.avgX.map((o,i)=>({x:o,y:a-r.x[i]/r.maxX*t.value.style.layout.marginalBars.size}))),dY:s.createSmoothPathVertical(r.avgY.map((o,i)=>({y:o,x:u+t.value.style.layout.marginalBars.size*r.y[i]/r.maxY}))),color:l.color,id:l.id}})}),w=e.ref(void 0),c=e.ref(null),j=e.ref(null);function de(a,u){w.value=a.id,c.value=a;let l="";j.value={datapoint:a,seriesIndex:u,series:x.value,config:t.value};const r=t.value.style.tooltip.customFormat;s.isFunction(r)&&s.functionReturnsString(()=>r({datapoint:a,seriesIndex:u,series:x.value,config:t.value}))?X.value=r({datapoint:a,seriesIndex:u,series:x.value,config:t.value}):(a.clusterName&&(l+=`<div style="display:flex;gap:3px;align-items:center">${a.clusterName}</div>`),a.v.name&&(l+=`<div>${a.v.name}</div>`),l+=`<div style="text-align:left;margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,l+=`<div>${t.value.style.layout.dataLabels.xAxis.name}: <b>${isNaN(a.v.x)?"-":s.applyDataLabel(t.value.style.layout.plots.selectors.labels.x.formatter,a.v.x,s.dataLabel({p:t.value.style.tooltip.prefix,v:a.v.x,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:a,seriesIndex:u})}</b></div>`,l+=`<div>${t.value.style.layout.dataLabels.yAxis.name}: <b>${isNaN(a.v.y)?"-":s.applyDataLabel(t.value.style.layout.plots.selectors.labels.y.formatter,a.v.y,s.dataLabel({p:t.value.style.tooltip.prefix,v:a.v.y,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:a,seriesIndex:u})}</b></div>`,l+=`${t.value.style.layout.plots.deviation.translation}: <b>${s.dataLabel({v:a.deviation,r:t.value.style.layout.plots.deviation.roundingValue})}</b>`,l+="</div>",X.value=`<div>${l}</div>`),I.value=!0}function pe(){I.value=!1,w.value=void 0,c.value=null}const p=e.ref([]);function he(a){p.value.includes(a)?p.value=p.value.filter(u=>u!==a):p.value.length<C.dataset.length-1&&p.value.push(a)}function fe(){e.nextTick(()=>{const a=["",t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],u=x.value.map(o=>[o.name,o.correlation.coefficient,o.plots.length,o.plots.map(i=>i.v.x).reduce((i,h)=>i+h,0)/o.plots.length,o.plots.map(i=>i.v.y).reduce((i,h)=>i+h,0)/o.plots.length]),l=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([a]).concat(u),r=s.createCsvContent(l);s.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const O=e.computed(()=>{const a=[t.value.table.translations.series,t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],u=x.value.map(r=>[{shape:r.shape,content:r.name,color:r.color},Number((r.correlation.coefficient??0).toFixed(t.value.table.td.roundingValue)).toLocaleString(),r.plots.length.toLocaleString(),Number((r.plots.map(o=>o.v.x??0).reduce((o,i)=>o+i,0)/r.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString(),Number((r.plots.map(o=>o.v.y??0).reduce((o,i)=>o+i,0)/r.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString()]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:a,body:u,config:l,colNames:a}}),T=e.ref(!1);function Le(a){T.value=a,J.value+=1}function me(){S.value.showTable=!S.value.showTable}function ge(){S.value.showTooltip=!S.value.showTooltip}const W=e.ref(!1);function R(){W.value=!W.value}return _e({getData:$e,generatePdf:ue,generateCsv:fe,generateImage:ie,toggleTable:me,toggleTooltip:ge,toggleAnnotator:R}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-scatter ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"scatterChart",ref:V,id:`vue-ui-scatter_${g.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Oe.PenAndPaper,{key:0,parent:V.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:W.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:ee,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:K,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ze._sfc_main,{key:`title_${te.value}`,config:{title:{cy:"scatter-div-title",...t.value.style.title},subtitle:{cy:"scatter-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(xe.UserOptions,{ref_key:"details",ref:Ne,key:`user_options_${J.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(ne),isPrinting:e.unref(re),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:S.value.showTooltip,isFullscreen:T.value,titles:{...t.value.userOptions.buttonTitles},chartElement:V.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:W.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(ue),onGenerateCsv:fe,onGenerateImage:e.unref(ie),onToggleTable:me,onToggleTooltip:ge,onToggleAnnotator:R},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(Fe._sfc_main),t.value.style.layout.axis.show?(e.openBlock(),e.createElementBlock("g",Xe,[e.createElementVNode("line",{x1:v.value.x,x2:v.value.x,y1:n.value.top,y2:n.value.bottom,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Ye),e.createElementVNode("line",{x1:n.value.left,x2:n.value.right,y1:v.value.y,y2:v.value.y,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,je)])):e.createCommentVNode("",!0),t.value.style.layout.plots.giftWrap.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l.plots.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:e.unref(s.giftWrap)({series:l.plots}),fill:e.unref(s.setOpacity)(l.color,t.value.style.layout.plots.giftWrap.fillOpacity*100),"stroke-width":t.value.style.layout.plots.giftWrap.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.giftWrap.strokeDasharray,stroke:l.color,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Ge)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[!l.shape||l.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(o,i)=>(e.openBlock(),e.createElementBlock("circle",{cx:o.x,cy:o.y,r:w.value&&w.value===o.id?o.weight*2:o.weight,fill:e.unref(s.setOpacity)(l.color,t.value.style.layout.plots.opacity*100),stroke:t.value.style.layout.plots.stroke,"stroke-width":t.value.style.layout.plots.strokeWidth,onMouseover:h=>de(o,r),onMouseleave:pe,style:e.normalizeStyle(`opacity:${w.value&&w.value===o.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(o.deviation)/ye.value:t.value.style.layout.plots.significance.show&&Math.abs(o.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,44,He))),256))])):(e.openBlock(),e.createElementBlock("g",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(o,i)=>(e.openBlock(),e.createBlock(be._sfc_main,{plot:{x:o.x,y:o.y},radius:w.value&&w.value===o.id?o.weight*2:o.weight,shape:l.shape,color:e.unref(s.setOpacity)(l.color,t.value.style.layout.plots.opacity*100),stroke:t.value.style.layout.plots.stroke,strokeWidth:t.value.style.layout.plots.strokeWidth,onMouseover:h=>de(o,r),onMouseleave:pe,style:e.normalizeStyle(`opacity:${w.value&&w.value===o.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(o.deviation)/ye.value:t.value.style.layout.plots.significance.show&&Math.abs(o.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,8,["plot","radius","shape","color","stroke","strokeWidth","onMouseover","style"]))),256))]))]))),256)),t.value.style.layout.marginalBars.show?(e.openBlock(),e.createElementBlock("g",Ke,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`marginal_x_${g.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.marginalBars.fill},null,8,Ze),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,et)],8,Qe),e.createElementVNode("linearGradient",{id:`marginal_y_${g.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.backgroundColor},null,8,lt),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.marginalBars.fill},null,8,at)],8,tt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.x,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgX[r]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:b.value.avgX[r]-n.value.width/M.value/2,y:n.value.top-t.value.style.layout.marginalBars.offset-l/b.value.maxX*t.value.style.layout.marginalBars.size,width:n.value.width/M.value<=0?1e-4:n.value.width/M.value,height:l/b.value.maxX*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxX*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_x_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,ot)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.y,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgY[r]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:n.value.right+t.value.style.layout.marginalBars.offset,y:b.value.avgY[r]-n.value.height/M.value/2,height:n.value.height/M.value<=0?1e-4:n.value.height/M.value,width:l/b.value.maxY*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxY*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_y_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,st)):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.marginalBars.showLines?(e.openBlock(),e.createElementBlock("g",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${l.dX}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,nt)),p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${l.dX}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ut)),p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${l.dY}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,it)),p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${l.dY}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ct))],64))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),c.value&&t.value.style.layout.plots.selectors.show?(e.openBlock(),e.createElementBlock("g",yt,[e.createElementVNode("line",{x1:v.value.x,x2:c.value.x,y1:c.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,vt),e.createElementVNode("line",{x1:c.value.x,x2:c.value.x,y1:v.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,dt),e.createElementVNode("text",{x:v.value.x+(c.value.x>v.value.x?-6:6),y:c.value.y+t.value.style.layout.plots.selectors.labels.fontSize/3,"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x>v.value.x?"end":"start"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(c.value.v.y),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(c.value.v.y),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding}),{datapoint:c.value})),9,pt),e.createElementVNode("text",{x:c.value.x,y:v.value.y+(c.value.y>v.value.y?-6:t.value.style.layout.plots.selectors.labels.fontSize+6),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(c.value.v.x),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(c.value.v.x),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding}),{datapoint:c.value})),9,ht),e.createElementVNode("circle",{cx:v.value.x,cy:c.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,ft),e.createElementVNode("circle",{cx:c.value.x,cy:v.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,mt),t.value.style.layout.plots.selectors.labels.showName?(e.openBlock(),e.createElementBlock("text",{key:0,x:c.value.x,y:c.value.y+(c.value.y<v.value.y?-t.value.style.layout.plots.selectors.labels.fontSize/2:t.value.style.layout.plots.selectors.labels.fontSize),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x<n.value.left+100?"start":c.value.x>n.value.right-100?"end":c.value.x>v.value.x?"start":"end"},e.toDisplayString(c.value.v.name),9,gt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",kt,[e.createElementVNode("text",{x:n.value.left-5,y:v.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.x.formatter,e.unref(s.checkNaN)(y.value.xMin),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.xMin),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.xAxis.rounding}))),9,xt),e.createElementVNode("text",{x:n.value.right+3,y:v.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"start","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.x.formatter,e.unref(s.checkNaN)(y.value.xMax),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.xMax),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.xAxis.rounding}))),9,bt),e.createElementVNode("text",{id:`vue-ui-scatter-xAxis-label-${g.value}`,transform:`translate(${t.value.style.layout.dataLabels.xAxis.fontSize*2}, ${n.value.top+n.value.height/2}), rotate(-90)`,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.name),9,Bt)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",wt,[e.createElementVNode("text",{x:v.value.x,y:n.value.bottom+t.value.style.layout.dataLabels.yAxis.fontSize+3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(y.value.yMin),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.yMin),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.yAxis.rounding}))),9,_t),e.createElementVNode("text",{x:v.value.x,y:n.value.top-t.value.style.layout.dataLabels.yAxis.fontSize/2,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(y.value.yMax),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.yMax),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.yAxis.rounding}))),9,Ct),e.createElementVNode("text",{"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.yAxis.color,x:n.value.left+n.value.width/2,y:n.value.bottom+8+t.value.style.layout.dataLabels.yAxis.fontSize*2},e.toDisplayString(t.value.style.layout.dataLabels.yAxis.name),9,Nt)])):e.createCommentVNode("",!0),e.createElementVNode("clipPath",{id:`clip_path_${g.value}`},[e.createElementVNode("rect",{x:n.value.left,y:n.value.top,width:n.value.width<=0?1e-4:n.value.width,height:n.value.height<=0?1e-4:n.value.height},null,8,Mt)],8,St),t.value.style.layout.correlation.show?(e.openBlock(),e.createElementBlock("g",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.correlation.x1,x2:l.correlation.x2,y1:l.correlation.y1,y2:l.correlation.y2,"stroke-dasharray":t.value.style.layout.correlation.strokeDasharray,stroke:l.color,"stroke-width":t.value.style.layout.correlation.strokeWidth,"clip-path":`url(#clip_path_${g.value})`},null,8,Et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.correlation.label.show?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.label.x,y:l.label.y,fill:t.value.style.layout.correlation.label.useSerieColor?l.color:t.value.style.layout.correlation.label.color,"font-size":t.value.style.layout.correlation.label.fontSize,"font-weight":t.value.style.layout.correlation.label.bold?"bold":"normal"},e.toDisplayString(e.unref(s.dataLabel)({v:e.unref(s.checkNaN)(l.correlation.coefficient),r:t.value.style.layout.correlation.label.roundingValue})),9,Lt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:k.value},void 0,!0)],14,Ie)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",zt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(re)||e.unref(ne)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pe.default,{key:6,config:{type:"quadrant",style:{backgroundColor:t.value.style.backgroundColor,quadrant:{grid:{color:t.value.style.layout.axis.stroke},plots:{color:t.value.style.layout.axis.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:Q},[t.value.style.legend.show?(e.openBlock(),e.createBlock(Ae.Legend,{key:`legend_${ae.value}`,legendSet:$.value,config:Me.value,onClickMarker:u[0]||(u[0]=({legend:l})=>he(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{onClick:r=>l.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name),13,Vt)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:$.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:Z,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ve._sfc_main,{show:S.value.showTooltip&&I.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:V.value,content:X.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),default:e.withCtx(()=>[t.value.style.tooltip.showShape?(e.openBlock(),e.createElementBlock("div",At,[(e.openBlock(),e.createElementBlock("svg",Tt,[e.createVNode(be._sfc_main,{shape:c.value.shape,color:c.value.color,plot:{x:10,y:10},radius:7},null,8,["shape","color"])]))])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),P.value?(e.openBlock(),e.createBlock(De.default,{key:8,hideDetails:"",config:{open:S.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Te.DataTable,{key:`table_${le.value}`,colNames:O.value.colNames,head:O.value.head,body:O.value.body,config:O.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:u[1]||(u[1]=l=>S.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[l.shape?(e.openBlock(),e.createElementBlock("div",Pt,[e.createElementVNode("span",null,e.toDisplayString(l.content),1)])):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:l},null,8,Dt))]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,qe))}},Ot=We._export_sfc(Ft,[["__scopeId","data-v-0648a715"]]);exports.default=Ot;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),s=require("./index-3oZdQf6G.cjs"),ke=require("./useResponsive-BJ7DTGpm.cjs"),ze=require("./Title-BxrsVY3-.cjs"),xe=require("./usePrinter-BKzxQK4e.cjs"),Ve=require("./Tooltip-BXc56Oxr.cjs"),Ae=require("./Legend-BksImVUi.cjs"),be=require("./Shape-Cf2Cj3g6.cjs"),Te=require("./DataTable-DeevzR8O.cjs"),Pe=require("./vue-ui-skeleton-CI8sxaqr.cjs"),De=require("./vue-ui-accordion-QoJofzqF.cjs"),Be=require("./useNestedProp-vPTP0Wem.cjs"),Fe=require("./PackageVersion-AftniVVo.cjs"),Oe=require("./PenAndPaper-j5noaKJZ.cjs"),We=require("./_plugin-vue_export-helper-BHFhmbuH.cjs"),qe=["id"],Ie=["xmlns","viewBox"],Xe={key:0},Ye=["x1","x2","y1","y2","stroke","stroke-width"],je=["x1","x2","y1","y2","stroke","stroke-width"],Re={key:1},Ge=["points","fill","stroke-width","stroke-dasharray","stroke"],Ue={key:0},He=["cx","cy","r","fill","stroke","stroke-width","onMouseover"],Je={key:1},Ke={key:2},Qe=["id"],Ze=["stop-color"],et=["stop-color"],tt=["id"],lt=["stop-color"],at=["stop-color"],ot=["x","y","width","height","fill","stroke","stroke-width","rx"],st=["x","y","height","width","fill","stroke","stroke-width","rx"],rt={key:0},nt=["d","stroke","stroke-width"],ut=["d","stroke","stroke-width"],it=["d","stroke","stroke-width"],ct=["d","stroke","stroke-width"],yt={key:3,style:{"pointer-events":"none !important"}},vt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],dt=["x1","x2","y1","y2","stroke","stroke-width","stroke-dasharray"],pt=["x","y","font-size","fill","font-weight","text-anchor"],ht=["x","y","font-size","fill","font-weight"],ft=["cx","cy","r","fill","stroke","stroke-width"],mt=["cx","cy","r","fill","stroke","stroke-width"],gt=["x","y","font-size","fill","font-weight","text-anchor"],kt={key:4},xt=["x","y","font-size","fill"],bt=["x","y","font-size","fill"],Bt=["id","transform","font-size","font-weight","fill"],wt={key:5},_t=["x","y","font-size","fill"],Ct=["x","y","font-size","fill"],Nt=["font-size","font-weight","fill","x","y"],St=["id"],Mt=["x","y","width","height"],$t={key:6},Et=["x1","x2","y1","y2","stroke-dasharray","stroke","stroke-width","clip-path"],Lt=["x","y","fill","font-size","font-weight"],zt={key:5,class:"vue-data-ui-watermark"},Vt=["onClick"],At={key:0,style:{width:"100%",display:"flex","align-items":"center","justify-content":"center"}},Tt={viewBox:"0 0 20 20",height:"20",width:"20",style:{overflow:"hidden",background:"transparent"}},Pt={key:0},Dt=["innerHTML"],Ft={__name:"vue-ui-scatter",props:{config:{type:Object,default(){return{}}},dataset:{type:Array,default(){return[]}}},setup(we,{expose:_e}){const C=we,{vue_ui_scatter:Ce}=s.useConfig(),P=e.computed(()=>!!C.dataset&&C.dataset.length),g=e.ref(s.createUid()),Ne=e.ref(null),I=e.ref(!1),X=e.ref(""),J=e.ref(0),V=e.ref(null),K=e.ref(null),Q=e.ref(null),Z=e.ref(null),ee=e.ref(null),te=e.ref(0),le=e.ref(0),ae=e.ref(0),t=e.computed({get:()=>oe(),set:a=>a});function oe(){const a=Be.useNestedProp({userConfig:C.config,defaultConfig:Ce});return a.theme?{...Be.useNestedProp({userConfig:s.themes.vue_ui_scatter[a.theme]||C.config,defaultConfig:a}),customPalette:s.themePalettes[a.theme]||s.palette}:a}e.watch(()=>C.config,a=>{t.value=oe(),se(),te.value+=1,le.value+=1,ae.value+=1},{deep:!0});const D=e.ref(null);e.onMounted(()=>{se()});function se(){if(s.objectIsEmpty(C.dataset)&&s.error({componentName:"VueUiScatter",type:"dataset"}),t.value.responsive){const a=ke.throttle(()=>{const{width:u,height:l}=ke.useResponsive({chart:V.value,title:t.value.style.title.text?K.value:null,legend:t.value.style.legend.show?Q.value:null,source:Z.value,noTitle:ee.value});k.value.width=u,k.value.height=l});D.value=new ResizeObserver(a),D.value.observe(V.value.parentNode)}}e.onBeforeUnmount(()=>{D.value&&D.value.disconnect()});const{isPrinting:re,isImaging:ne,generatePdf:ue,generateImage:ie}=xe.usePrinter({elementId:`vue-ui-scatter_${g.value}`,fileName:t.value.style.title.text||"vue-ui-scatter"}),Se=e.computed(()=>t.value.userOptions.show&&!t.value.style.title.text),ce=e.computed(()=>s.convertCustomPalette(t.value.customPalette)),S=e.ref({showTable:t.value.table.show,showTooltip:t.value.style.tooltip.show}),k=e.ref({height:t.value.style.layout.height,width:t.value.style.layout.width}),F=e.computed(()=>t.value.style.layout.marginalBars.show?t.value.style.layout.marginalBars.size+t.value.style.layout.marginalBars.offset:0),n=e.computed(()=>({top:t.value.style.layout.padding.top+F.value,right:k.value.width-t.value.style.layout.padding.right-F.value,bottom:k.value.height-t.value.style.layout.padding.bottom,left:t.value.style.layout.padding.left,height:k.value.height-t.value.style.layout.padding.top-t.value.style.layout.padding.bottom-F.value,width:k.value.width-t.value.style.layout.padding.left-t.value.style.layout.padding.right-F.value})),y=e.computed(()=>{C.dataset.forEach((o,i)=>{s.getMissingDatasetAttributes({datasetObject:o,requiredAttributes:["values"]}).forEach(h=>{s.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:h,index:i})}),o.values&&o.values.forEach((h,E)=>{s.getMissingDatasetAttributes({datasetObject:h,requiredAttributes:["x","y"]}).forEach(A=>{s.error({componentName:"VueUiScatter",type:"datasetSerieAttribute",property:`values.${A}`,index:`${i} - ${E}`})})})});const a=Math.min(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.x))),u=Math.max(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.x))),l=Math.min(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.y))),r=Math.max(...$.value.filter(o=>!p.value.includes(o.id)).flatMap(o=>o.values.map(i=>i.y)));return{xMin:a>=0?0:a,xMax:u,yMin:l>=0?0:l,yMax:r}}),v=e.computed(()=>({x:n.value.left+Math.abs(y.value.xMin)/(y.value.xMax+Math.abs(y.value.xMin))*n.value.width,y:n.value.bottom-Math.abs(y.value.yMin)/(y.value.yMax+Math.abs(y.value.yMin))*n.value.height})),$=e.computed(()=>C.dataset.map((a,u)=>{const l=`cluster_${g.value}_${u}`;return{...a,values:s.largestTriangleThreeBuckets({data:a.values,threshold:t.value.downsample.threshold}),id:l,color:a.color?a.color:ce.value[u]||s.palette[u]||s.palette[u%s.palette.length],opacity:p.value.includes(l)?.5:1,shape:a.shape??"circle",segregate:()=>he(l),isSegregated:p.value.includes(l)}})),Me=e.computed(()=>({cy:"scatter-div-legend",backgroundColor:t.value.style.legend.backgroundColor,color:t.value.style.legend.color,fontSize:t.value.style.legend.fontSize,paddingBottom:12,fontWeight:t.value.style.legend.bold?"bold":""})),Y=e.computed(()=>$.value.map((a,u)=>({...a,plots:a.values.map(l=>({x:n.value.left+(l.x+Math.abs(y.value.xMin))/(y.value.xMax+Math.abs(y.value.xMin))*n.value.width,y:n.value.bottom-(l.y+Math.abs(y.value.yMin))/(y.value.yMax+Math.abs(y.value.yMin))*n.value.height,v:{...l,name:l.name||""},clusterName:a.name,color:a.color?a.color:ce.value[u]||s.palette[u]||s.palette[u%s.palette.length],id:`plot_${g.value}_${Math.random()}`,weight:l.weight??t.value.style.layout.plots.radius}))})).filter(a=>!p.value.includes(a.id))),x=e.computed(()=>Y.value.map(a=>{const u=a.plots.reduce((d,L)=>d+L.x,0)/a.plots.length,l=a.plots.reduce((d,L)=>d+L.y,0)/a.plots.length;let r=0,o=0,i=0;for(const d of a.plots)r+=(d.x-u)*(d.y-l),o+=(d.x-u)**2,i+=(d.y-l)**2;const h=r/Math.sqrt(o*i),E=h*(Math.sqrt(i)/Math.sqrt(o)),A=l-E*u,_={x1:n.value.left,x2:n.value.right,y1:E*n.value.left+A,y2:E*n.value.right+A,coefficient:h},m=(_.y2-_.y1)/(_.x2-_.x1),B=_.y1-m*_.x1,N=Math.min(k.value.width-t.value.style.layout.padding.right,Math.max(t.value.style.layout.padding.left,(n.value.top-B)/m)),q={x:N,y:m*N+B<=t.value.style.layout.padding.top?n.value.top:m*N+B};return{...a,correlation:_,label:q,plots:a.plots.map(d=>{const L=(d.x+m*d.y-m*B)/(1+Math.pow(m,2)),G=(m*d.x+Math.pow(m,2)*d.y+B)/(1+Math.pow(m,2)),f=Math.sqrt(Math.pow(d.x-L,2)+Math.pow(d.y-G,2));return{...d,deviation:f,shape:a.shape,color:a.color}})}})),ye=e.computed(()=>Math.max(...x.value.flatMap(a=>a.plots.map(u=>Math.abs(u.deviation)))));function $e(){return x.value}function ve(a,u){const l=Array.isArray(a)?a.flatMap(f=>f.plots.map(z=>({x:z.x,y:z.y}))):a.plots.map(f=>({x:f.x,y:f.y}));let r=1/0,o=-1/0,i=1/0,h=-1/0;l.forEach(({x:f,y:z})=>{r=Math.min(r,f),o=Math.max(o,f),i=Math.min(i,z),h=Math.max(h,z)});const E=o-r,A=h-i,_=E/u,m=A/u,B=Array(u).fill(0),N=Array(u).fill(0);l.forEach(({x:f,y:z})=>{const U=Math.floor((f-r)/_),H=Math.floor((z-i)/m);B[U]||(B[U]=0),N[H]||(N[H]=0),B[U]+=1,N[H]+=1});const q=[],d=[];for(let f=0;f<u;f+=1)q.push(r+(f+.5)*_),d.push(i+(f+.5)*m);const L=Math.max(...B),G=Math.max(...N);return{x:B,y:N,avgX:q,avgY:d,maxX:L,maxY:G}}const M=e.computed(()=>t.value.style.layout.marginalBars.tranches),b=e.computed(()=>ve(Y.value,M.value)),Ee=e.computed(()=>{const a=n.value.top-t.value.style.layout.marginalBars.offset,u=n.value.right+t.value.style.layout.marginalBars.offset;return Y.value.map(l=>{const r=ve(l,M.value);return{coords:r,dX:s.createSmoothPath(r.avgX.map((o,i)=>({x:o,y:a-r.x[i]/r.maxX*t.value.style.layout.marginalBars.size}))),dY:s.createSmoothPathVertical(r.avgY.map((o,i)=>({y:o,x:u+t.value.style.layout.marginalBars.size*r.y[i]/r.maxY}))),color:l.color,id:l.id}})}),w=e.ref(void 0),c=e.ref(null),j=e.ref(null);function de(a,u){w.value=a.id,c.value=a;let l="";j.value={datapoint:a,seriesIndex:u,series:x.value,config:t.value};const r=t.value.style.tooltip.customFormat;s.isFunction(r)&&s.functionReturnsString(()=>r({datapoint:a,seriesIndex:u,series:x.value,config:t.value}))?X.value=r({datapoint:a,seriesIndex:u,series:x.value,config:t.value}):(a.clusterName&&(l+=`<div style="display:flex;gap:3px;align-items:center">${a.clusterName}</div>`),a.v.name&&(l+=`<div>${a.v.name}</div>`),l+=`<div style="text-align:left;margin-top:6px;padding-top:6px;border-top:1px solid ${t.value.style.tooltip.borderColor}">`,l+=`<div>${t.value.style.layout.dataLabels.xAxis.name}: <b>${isNaN(a.v.x)?"-":s.applyDataLabel(t.value.style.layout.plots.selectors.labels.x.formatter,a.v.x,s.dataLabel({p:t.value.style.tooltip.prefix,v:a.v.x,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:a,seriesIndex:u})}</b></div>`,l+=`<div>${t.value.style.layout.dataLabels.yAxis.name}: <b>${isNaN(a.v.y)?"-":s.applyDataLabel(t.value.style.layout.plots.selectors.labels.y.formatter,a.v.y,s.dataLabel({p:t.value.style.tooltip.prefix,v:a.v.y,s:t.value.style.tooltip.suffix,r:t.value.style.tooltip.roundingValue}),{datapoint:a,seriesIndex:u})}</b></div>`,l+=`${t.value.style.layout.plots.deviation.translation}: <b>${s.dataLabel({v:a.deviation,r:t.value.style.layout.plots.deviation.roundingValue})}</b>`,l+="</div>",X.value=`<div>${l}</div>`),I.value=!0}function pe(){I.value=!1,w.value=void 0,c.value=null}const p=e.ref([]);function he(a){p.value.includes(a)?p.value=p.value.filter(u=>u!==a):p.value.length<C.dataset.length-1&&p.value.push(a)}function fe(){e.nextTick(()=>{const a=["",t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],u=x.value.map(o=>[o.name,o.correlation.coefficient,o.plots.length,o.plots.map(i=>i.v.x).reduce((i,h)=>i+h,0)/o.plots.length,o.plots.map(i=>i.v.y).reduce((i,h)=>i+h,0)/o.plots.length]),l=[[t.value.style.title.text],[t.value.style.title.subtitle.text],[[""],[""],[""]]].concat([a]).concat(u),r=s.createCsvContent(l);s.downloadCsv({csvContent:r,title:t.value.style.title.text||"vue-ui-heatmap"})})}const O=e.computed(()=>{const a=[t.value.table.translations.series,t.value.table.translations.correlationCoefficient,t.value.table.translations.nbrPlots,`${t.value.style.layout.dataLabels.xAxis.name} ${t.value.table.translations.average}`,`${t.value.style.layout.dataLabels.yAxis.name} ${t.value.table.translations.average}`],u=x.value.map(r=>[{shape:r.shape,content:r.name,color:r.color},Number((r.correlation.coefficient??0).toFixed(t.value.table.td.roundingValue)).toLocaleString(),r.plots.length.toLocaleString(),Number((r.plots.map(o=>o.v.x??0).reduce((o,i)=>o+i,0)/r.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString(),Number((r.plots.map(o=>o.v.y??0).reduce((o,i)=>o+i,0)/r.plots.length).toFixed(t.value.table.td.roundingAverage)).toLocaleString()]),l={th:{backgroundColor:t.value.table.th.backgroundColor,color:t.value.table.th.color,outline:t.value.table.th.outline},td:{backgroundColor:t.value.table.td.backgroundColor,color:t.value.table.td.color,outline:t.value.table.td.outline},breakpoint:t.value.table.responsiveBreakpoint};return{head:a,body:u,config:l,colNames:a}}),T=e.ref(!1);function Le(a){T.value=a,J.value+=1}function me(){S.value.showTable=!S.value.showTable}function ge(){S.value.showTooltip=!S.value.showTooltip}const W=e.ref(!1);function R(){W.value=!W.value}return _e({getData:$e,generatePdf:ue,generateCsv:fe,generateImage:ie,toggleTable:me,toggleTooltip:ge,toggleAnnotator:R}),(a,u)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(`vue-ui-scatter ${T.value?"vue-data-ui-wrapper-fullscreen":""} ${t.value.useCssAnimation?"":"vue-ui-dna"}`),ref_key:"scatterChart",ref:V,id:`vue-ui-scatter_${g.value}`,style:e.normalizeStyle(`font-family:${t.value.style.fontFamily};width:100%; text-align:center;background:${t.value.style.backgroundColor};${t.value.responsive?"height: 100%":""}`)},[t.value.userOptions.buttons.annotator?(e.openBlock(),e.createBlock(Oe.PenAndPaper,{key:0,parent:V.value,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,active:W.value,onClose:R},null,8,["parent","backgroundColor","color","active"])):e.createCommentVNode("",!0),Se.value?(e.openBlock(),e.createElementBlock("div",{key:1,ref_key:"noTitle",ref:ee,class:"vue-data-ui-no-title-space",style:"height:36px; width: 100%;background:transparent"},null,512)):e.createCommentVNode("",!0),t.value.style.title.text?(e.openBlock(),e.createElementBlock("div",{key:2,ref_key:"chartTitle",ref:K,style:"width:100%;background:transparent"},[(e.openBlock(),e.createBlock(ze._sfc_main,{key:`title_${te.value}`,config:{title:{cy:"scatter-div-title",...t.value.style.title},subtitle:{cy:"scatter-div-subtitle",...t.value.style.title.subtitle}}},null,8,["config"]))],512)):e.createCommentVNode("",!0),t.value.userOptions.show&&P.value?(e.openBlock(),e.createBlock(xe.UserOptions,{ref_key:"details",ref:Ne,key:`user_options_${J.value}`,backgroundColor:t.value.style.backgroundColor,color:t.value.style.color,isImaging:e.unref(ne),isPrinting:e.unref(re),uid:g.value,hasTooltip:t.value.userOptions.buttons.tooltip&&t.value.style.tooltip.show,hasPdf:t.value.userOptions.buttons.pdf,hasImg:t.value.userOptions.buttons.img,hasXls:t.value.userOptions.buttons.csv,hasTable:t.value.userOptions.buttons.table,hasFullscreen:t.value.userOptions.buttons.fullscreen,isTooltip:S.value.showTooltip,isFullscreen:T.value,titles:{...t.value.userOptions.buttonTitles},chartElement:V.value,position:t.value.userOptions.position,hasAnnotator:t.value.userOptions.buttons.annotator,isAnnotation:W.value,onToggleFullscreen:Le,onGeneratePdf:e.unref(ue),onGenerateCsv:fe,onGenerateImage:e.unref(ie),onToggleTable:me,onToggleTooltip:ge,onToggleAnnotator:R},e.createSlots({_:2},[a.$slots.optionTooltip?{name:"optionTooltip",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTooltip",{},void 0,!0)]),key:"0"}:void 0,a.$slots.optionPdf?{name:"optionPdf",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionPdf",{},void 0,!0)]),key:"1"}:void 0,a.$slots.optionCsv?{name:"optionCsv",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionCsv",{},void 0,!0)]),key:"2"}:void 0,a.$slots.optionImg?{name:"optionImg",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionImg",{},void 0,!0)]),key:"3"}:void 0,a.$slots.optionTable?{name:"optionTable",fn:e.withCtx(()=>[e.renderSlot(a.$slots,"optionTable",{},void 0,!0)]),key:"4"}:void 0,a.$slots.optionFullscreen?{name:"optionFullscreen",fn:e.withCtx(({toggleFullscreen:l,isFullscreen:r})=>[e.renderSlot(a.$slots,"optionFullscreen",e.normalizeProps(e.guardReactiveProps({toggleFullscreen:l,isFullscreen:r})),void 0,!0)]),key:"5"}:void 0,a.$slots.optionAnnotator?{name:"optionAnnotator",fn:e.withCtx(({toggleAnnotator:l,isAnnotator:r})=>[e.renderSlot(a.$slots,"optionAnnotator",e.normalizeProps(e.guardReactiveProps({toggleAnnotator:l,isAnnotator:r})),void 0,!0)]),key:"6"}:void 0]),1032,["backgroundColor","color","isImaging","isPrinting","uid","hasTooltip","hasPdf","hasImg","hasXls","hasTable","hasFullscreen","isTooltip","isFullscreen","titles","chartElement","position","hasAnnotator","isAnnotation","onGeneratePdf","onGenerateImage"])):e.createCommentVNode("",!0),P.value?(e.openBlock(),e.createElementBlock("svg",{key:4,xmlns:e.unref(s.XMLNS),class:e.normalizeClass({"vue-data-ui-fullscreen--on":T.value,"vue-data-ui-fulscreen--off":!T.value}),viewBox:`0 0 ${k.value.width<=0?10:k.value.width} ${k.value.height<=0?10:k.value.height}`,style:e.normalizeStyle(`max-width:100%;overflow:visible;background:transparent;color:${t.value.style.color}`)},[e.createVNode(Fe._sfc_main),t.value.style.layout.axis.show?(e.openBlock(),e.createElementBlock("g",Xe,[e.createElementVNode("line",{x1:v.value.x,x2:v.value.x,y1:n.value.top,y2:n.value.bottom,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,Ye),e.createElementVNode("line",{x1:n.value.left,x2:n.value.right,y1:v.value.y,y2:v.value.y,stroke:t.value.style.layout.axis.stroke,"stroke-width":t.value.style.layout.axis.strokeWidth,"stroke-linecap":"round"},null,8,je)])):e.createCommentVNode("",!0),t.value.style.layout.plots.giftWrap.show?(e.openBlock(),e.createElementBlock("g",Re,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l.plots.length>2?(e.openBlock(),e.createElementBlock("polygon",{key:0,points:e.unref(s.giftWrap)({series:l.plots}),fill:e.unref(s.setOpacity)(l.color,t.value.style.layout.plots.giftWrap.fillOpacity*100),"stroke-width":t.value.style.layout.plots.giftWrap.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.giftWrap.strokeDasharray,stroke:l.color,"stroke-linejoin":"round","stroke-linecap":"round"},null,8,Ge)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[!l.shape||l.shape==="circle"?(e.openBlock(),e.createElementBlock("g",Ue,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(o,i)=>(e.openBlock(),e.createElementBlock("circle",{cx:o.x,cy:o.y,r:w.value&&w.value===o.id?o.weight*2:o.weight,fill:e.unref(s.setOpacity)(l.color,t.value.style.layout.plots.opacity*100),stroke:t.value.style.layout.plots.stroke,"stroke-width":t.value.style.layout.plots.strokeWidth,onMouseover:h=>de(o,r),onMouseleave:pe,style:e.normalizeStyle(`opacity:${w.value&&w.value===o.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(o.deviation)/ye.value:t.value.style.layout.plots.significance.show&&Math.abs(o.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,44,He))),256))])):(e.openBlock(),e.createElementBlock("g",Je,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(l.plots,(o,i)=>(e.openBlock(),e.createBlock(be._sfc_main,{plot:{x:o.x,y:o.y},radius:w.value&&w.value===o.id?o.weight*2:o.weight,shape:l.shape,color:e.unref(s.setOpacity)(l.color,t.value.style.layout.plots.opacity*100),stroke:t.value.style.layout.plots.stroke,strokeWidth:t.value.style.layout.plots.strokeWidth,onMouseover:h=>de(o,r),onMouseleave:pe,style:e.normalizeStyle(`opacity:${w.value&&w.value===o.id?1:t.value.style.layout.plots.significance.useDistanceOpacity?1-Math.abs(o.deviation)/ye.value:t.value.style.layout.plots.significance.show&&Math.abs(o.deviation)>t.value.style.layout.plots.significance.deviationThreshold?t.value.style.layout.plots.significance.opacity:1}`)},null,8,["plot","radius","shape","color","stroke","strokeWidth","onMouseover","style"]))),256))]))]))),256)),t.value.style.layout.marginalBars.show?(e.openBlock(),e.createElementBlock("g",Ke,[e.createElementVNode("defs",null,[e.createElementVNode("linearGradient",{id:`marginal_x_${g.value}`,x1:"0%",y1:"0%",x2:"0%",y2:"100%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.layout.marginalBars.fill},null,8,Ze),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.backgroundColor},null,8,et)],8,Qe),e.createElementVNode("linearGradient",{id:`marginal_y_${g.value}`,x1:"0%",x2:"100%",y1:"0%",y2:"0%"},[e.createElementVNode("stop",{offset:"0%","stop-color":t.value.style.backgroundColor},null,8,lt),e.createElementVNode("stop",{offset:"100%","stop-color":t.value.style.layout.marginalBars.fill},null,8,at)],8,tt)]),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.x,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgX[r]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:b.value.avgX[r]-n.value.width/M.value/2,y:n.value.top-t.value.style.layout.marginalBars.offset-l/b.value.maxX*t.value.style.layout.marginalBars.size,width:n.value.width/M.value<=0?1e-4:n.value.width/M.value,height:l/b.value.maxX*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxX*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_x_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,ot)):e.createCommentVNode("",!0)]))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(b.value.y,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[l&&b.value.avgY[r]?(e.openBlock(),e.createElementBlock("rect",{key:0,x:n.value.right+t.value.style.layout.marginalBars.offset,y:b.value.avgY[r]-n.value.height/M.value/2,height:n.value.height/M.value<=0?1e-4:n.value.height/M.value,width:l/b.value.maxY*t.value.style.layout.marginalBars.size<=0?1e-4:l/b.value.maxY*t.value.style.layout.marginalBars.size,fill:t.value.style.layout.marginalBars.useGradient?`url(#marginal_y_${g.value})`:t.value.style.layout.marginalBars.fill,style:e.normalizeStyle(`opacity:${t.value.style.layout.marginalBars.opacity}`),stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.strokeWidth,rx:t.value.style.layout.marginalBars.borderRadius},null,12,st)):e.createCommentVNode("",!0)]))),256)),t.value.style.layout.marginalBars.showLines?(e.openBlock(),e.createElementBlock("g",rt,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(Ee.value,l=>(e.openBlock(),e.createElementBlock(e.Fragment,null,[p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:0,d:`M ${l.dX}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,nt)),p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:1,d:`M ${l.dX}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ut)),p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:2,d:`M ${l.dY}`,stroke:t.value.style.backgroundColor,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth+1,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,it)),p.value.includes(l.id)?e.createCommentVNode("",!0):(e.openBlock(),e.createElementBlock("path",{key:3,d:`M ${l.dY}`,stroke:l.color,"stroke-width":t.value.style.layout.marginalBars.linesStrokeWidth,"stroke-linecap":"round","stroke-linejoin":"round",fill:"none"},null,8,ct))],64))),256))])):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),c.value&&t.value.style.layout.plots.selectors.show?(e.openBlock(),e.createElementBlock("g",yt,[e.createElementVNode("line",{x1:v.value.x,x2:c.value.x,y1:c.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,vt),e.createElementVNode("line",{x1:c.value.x,x2:c.value.x,y1:v.value.y,y2:c.value.y,stroke:t.value.style.layout.plots.selectors.stroke,"stroke-width":t.value.style.layout.plots.selectors.strokeWidth,"stroke-dasharray":t.value.style.layout.plots.selectors.strokeDasharray,"stroke-linecap":"round",class:"line-pointer"},null,8,dt),e.createElementVNode("text",{x:v.value.x+(c.value.x>v.value.x?-6:6),y:c.value.y+t.value.style.layout.plots.selectors.labels.fontSize/3,"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x>v.value.x?"end":"start"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(c.value.v.y),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(c.value.v.y),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding}),{datapoint:c.value})),9,pt),e.createElementVNode("text",{x:c.value.x,y:v.value.y+(c.value.y>v.value.y?-6:t.value.style.layout.plots.selectors.labels.fontSize+6),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":"middle"},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(c.value.v.x),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(c.value.v.x),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.plots.selectors.labels.rounding}),{datapoint:c.value})),9,ht),e.createElementVNode("circle",{cx:v.value.x,cy:c.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,ft),e.createElementVNode("circle",{cx:c.value.x,cy:v.value.y,r:t.value.style.layout.plots.selectors.markers.radius,fill:t.value.style.layout.plots.selectors.markers.fill,stroke:t.value.style.layout.plots.selectors.markers.stroke,"stroke-width":t.value.style.layout.plots.selectors.markers.strokeWidth,class:"line-pointer"},null,8,mt),t.value.style.layout.plots.selectors.labels.showName?(e.openBlock(),e.createElementBlock("text",{key:0,x:c.value.x,y:c.value.y+(c.value.y<v.value.y?-t.value.style.layout.plots.selectors.labels.fontSize/2:t.value.style.layout.plots.selectors.labels.fontSize),"font-size":t.value.style.layout.plots.selectors.labels.fontSize,fill:t.value.style.layout.plots.selectors.labels.color,"font-weight":t.value.style.layout.plots.selectors.labels.bold?"bold":"normal","text-anchor":c.value.x<n.value.left+100?"start":c.value.x>n.value.right-100?"end":c.value.x>v.value.x?"start":"end"},e.toDisplayString(c.value.v.name),9,gt)):e.createCommentVNode("",!0)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.xAxis.show?(e.openBlock(),e.createElementBlock("g",kt,[e.createElementVNode("text",{x:n.value.left-5,y:v.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"end","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.x.formatter,e.unref(s.checkNaN)(y.value.xMin),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.xMin),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.xAxis.rounding}))),9,xt),e.createElementVNode("text",{x:n.value.right+3,y:v.value.y+t.value.style.layout.dataLabels.xAxis.fontSize/3,"text-anchor":"start","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.x.formatter,e.unref(s.checkNaN)(y.value.xMax),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.xMax),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.xAxis.rounding}))),9,bt),e.createElementVNode("text",{id:`vue-ui-scatter-xAxis-label-${g.value}`,transform:`translate(${t.value.style.layout.dataLabels.xAxis.fontSize*2}, ${n.value.top+n.value.height/2}), rotate(-90)`,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.xAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.xAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.xAxis.color},e.toDisplayString(t.value.style.layout.dataLabels.xAxis.name),9,Bt)])):e.createCommentVNode("",!0),t.value.style.layout.dataLabels.yAxis.show?(e.openBlock(),e.createElementBlock("g",wt,[e.createElementVNode("text",{x:v.value.x,y:n.value.bottom+t.value.style.layout.dataLabels.yAxis.fontSize+3,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(y.value.yMin),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.yMin),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.yAxis.rounding}))),9,_t),e.createElementVNode("text",{x:v.value.x,y:n.value.top-t.value.style.layout.dataLabels.yAxis.fontSize/2,"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,fill:t.value.style.layout.dataLabels.yAxis.color},e.toDisplayString(e.unref(s.applyDataLabel)(t.value.style.layout.plots.selectors.labels.y.formatter,e.unref(s.checkNaN)(y.value.yMax),e.unref(s.dataLabel)({p:t.value.style.layout.plots.selectors.labels.prefix,v:e.unref(s.checkNaN)(y.value.yMax),s:t.value.style.layout.plots.selectors.labels.suffix,r:t.value.style.layout.dataLabels.yAxis.rounding}))),9,Ct),e.createElementVNode("text",{"text-anchor":"middle","font-size":t.value.style.layout.dataLabels.yAxis.fontSize,"font-weight":t.value.style.layout.dataLabels.yAxis.bold?"bold":"normal",fill:t.value.style.layout.dataLabels.yAxis.color,x:n.value.left+n.value.width/2,y:n.value.bottom+8+t.value.style.layout.dataLabels.yAxis.fontSize*2},e.toDisplayString(t.value.style.layout.dataLabels.yAxis.name),9,Nt)])):e.createCommentVNode("",!0),e.createElementVNode("clipPath",{id:`clip_path_${g.value}`},[e.createElementVNode("rect",{x:n.value.left,y:n.value.top,width:n.value.width<=0?1e-4:n.value.width,height:n.value.height<=0?1e-4:n.value.height},null,8,Mt)],8,St),t.value.style.layout.correlation.show?(e.openBlock(),e.createElementBlock("g",$t,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("line",{x1:l.correlation.x1,x2:l.correlation.x2,y1:l.correlation.y1,y2:l.correlation.y2,"stroke-dasharray":t.value.style.layout.correlation.strokeDasharray,stroke:l.color,"stroke-width":t.value.style.layout.correlation.strokeWidth,"clip-path":`url(#clip_path_${g.value})`},null,8,Et))),256)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(x.value,(l,r)=>(e.openBlock(),e.createElementBlock("g",null,[t.value.style.layout.correlation.label.show?(e.openBlock(),e.createElementBlock("text",{key:0,x:l.label.x,y:l.label.y,fill:t.value.style.layout.correlation.label.useSerieColor?l.color:t.value.style.layout.correlation.label.color,"font-size":t.value.style.layout.correlation.label.fontSize,"font-weight":t.value.style.layout.correlation.label.bold?"bold":"normal"},e.toDisplayString(e.unref(s.dataLabel)({v:e.unref(s.checkNaN)(l.correlation.coefficient),r:t.value.style.layout.correlation.label.roundingValue})),9,Lt)):e.createCommentVNode("",!0)]))),256))])):e.createCommentVNode("",!0),e.renderSlot(a.$slots,"svg",{svg:k.value},void 0,!0)],14,Ie)):e.createCommentVNode("",!0),a.$slots.watermark?(e.openBlock(),e.createElementBlock("div",zt,[e.renderSlot(a.$slots,"watermark",e.normalizeProps(e.guardReactiveProps({isPrinting:e.unref(re)||e.unref(ne)})),void 0,!0)])):e.createCommentVNode("",!0),P.value?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(Pe.default,{key:6,config:{type:"quadrant",style:{backgroundColor:t.value.style.backgroundColor,quadrant:{grid:{color:t.value.style.layout.axis.stroke},plots:{color:t.value.style.layout.axis.stroke,radius:1}}}}},null,8,["config"])),e.createElementVNode("div",{ref_key:"chartLegend",ref:Q},[t.value.style.legend.show?(e.openBlock(),e.createBlock(Ae.Legend,{key:`legend_${ae.value}`,legendSet:$.value,config:Me.value,onClickMarker:u[0]||(u[0]=({legend:l})=>he(l.id))},{item:e.withCtx(({legend:l})=>[e.createElementVNode("div",{onClick:r=>l.segregate(),style:e.normalizeStyle(`opacity:${p.value.includes(l.id)?.5:1}`)},e.toDisplayString(l.name),13,Vt)]),_:1},8,["legendSet","config"])):e.renderSlot(a.$slots,"legend",{key:1,legend:$.value},void 0,!0)],512),a.$slots.source?(e.openBlock(),e.createElementBlock("div",{key:7,ref_key:"source",ref:Z,dir:"auto"},[e.renderSlot(a.$slots,"source",{},void 0,!0)],512)):e.createCommentVNode("",!0),e.createVNode(Ve._sfc_main,{show:S.value.showTooltip&&I.value,backgroundColor:t.value.style.tooltip.backgroundColor,color:t.value.style.tooltip.color,borderRadius:t.value.style.tooltip.borderRadius,borderColor:t.value.style.tooltip.borderColor,borderWidth:t.value.style.tooltip.borderWidth,fontSize:t.value.style.tooltip.fontSize,backgroundOpacity:t.value.style.tooltip.backgroundOpacity,position:t.value.style.tooltip.position,offsetY:t.value.style.tooltip.offsetY,parent:V.value,content:X.value,isCustom:t.value.style.tooltip.customFormat&&typeof t.value.style.tooltip.customFormat=="function"},{"tooltip-before":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-before",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),"tooltip-after":e.withCtx(()=>[e.renderSlot(a.$slots,"tooltip-after",e.normalizeProps(e.guardReactiveProps({...j.value})),void 0,!0)]),default:e.withCtx(()=>[t.value.style.tooltip.showShape?(e.openBlock(),e.createElementBlock("div",At,[(e.openBlock(),e.createElementBlock("svg",Tt,[e.createVNode(be._sfc_main,{shape:c.value.shape,color:c.value.color,plot:{x:10,y:10},radius:7},null,8,["shape","color"])]))])):e.createCommentVNode("",!0)]),_:3},8,["show","backgroundColor","color","borderRadius","borderColor","borderWidth","fontSize","backgroundOpacity","position","offsetY","parent","content","isCustom"]),P.value?(e.openBlock(),e.createBlock(De.default,{key:8,hideDetails:"",config:{open:S.value.showTable,maxHeight:1e4,body:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color},head:{backgroundColor:t.value.style.backgroundColor,color:t.value.style.color}}},{content:e.withCtx(()=>[(e.openBlock(),e.createBlock(Te.DataTable,{key:`table_${le.value}`,colNames:O.value.colNames,head:O.value.head,body:O.value.body,config:O.value.config,title:`${t.value.style.title.text}${t.value.style.title.subtitle.text?` : ${t.value.style.title.subtitle.text}`:""}`,onClose:u[1]||(u[1]=l=>S.value.showTable=!1)},{th:e.withCtx(({th:l})=>[e.createTextVNode(e.toDisplayString(l),1)]),td:e.withCtx(({td:l})=>[l.shape?(e.openBlock(),e.createElementBlock("div",Pt,[e.createElementVNode("span",null,e.toDisplayString(l.content),1)])):(e.openBlock(),e.createElementBlock("div",{key:1,innerHTML:l},null,8,Dt))]),_:1},8,["colNames","head","body","config","title"]))]),_:1},8,["config"])):e.createCommentVNode("",!0)],14,qe))}},Ot=We._export_sfc(Ft,[["__scopeId","data-v-0648a715"]]);exports.default=Ot;
@@ -1,17 +1,17 @@
1
1
  import { computed as m, ref as h, watch as Ze, onMounted as et, onBeforeUnmount as tt, openBlock as o, createElementBlock as u, normalizeClass as De, normalizeStyle as U, createBlock as Y, createCommentVNode as c, unref as v, createSlots as lt, withCtx as _, renderSlot as M, normalizeProps as Q, guardReactiveProps as Z, createVNode as he, createElementVNode as d, Fragment as P, renderList as X, toDisplayString as $, createTextVNode as at, nextTick as ot } from "vue";
2
- import { u as st, c as ut, t as rt, a as it, p as q, o as nt, e as pe, b as vt, g as Ye, T as yt, R as ct, W as dt, X as ht, U as pt, s as fe, i as j, v as C, f as W, x as ft, y as gt, q as xt, r as mt } from "./index-hV0hU1iE.js";
2
+ import { u as st, c as ut, t as rt, a as it, p as q, o as nt, e as pe, b as vt, g as Ye, T as yt, R as ct, W as dt, X as ht, U as pt, s as fe, i as j, v as C, f as W, x as ft, y as gt, q as xt, r as mt } from "./index-D020Kb3z.js";
3
3
  import { t as bt, u as kt } from "./useResponsive-CoxXLe23.js";
4
- import { _ as _t } from "./Title-DBozX6nP.js";
5
- import { u as wt, U as Mt } from "./usePrinter-y3d31M4g.js";
6
- import { _ as $t } from "./Tooltip-Com_T8vc.js";
7
- import { L as Ct } from "./Legend-hnLfwhmm.js";
8
- import { _ as je } from "./Shape-QdnXSUyn.js";
9
- import { D as zt } from "./DataTable-BpVz3DBX.js";
10
- import At from "./vue-ui-skeleton-BY8Jg9a_.js";
11
- import St from "./vue-ui-accordion-m-s-7akB.js";
12
- import { u as Ve } from "./useNestedProp-CRAUOmT5.js";
13
- import { _ as Lt } from "./PackageVersion-wqab02xF.js";
14
- import { P as Tt } from "./PenAndPaper-C_laA5mt.js";
4
+ import { _ as _t } from "./Title-B2orjUIW.js";
5
+ import { u as wt, U as Mt } from "./usePrinter-CN0J0NFL.js";
6
+ import { _ as $t } from "./Tooltip-CXjc5vb3.js";
7
+ import { L as Ct } from "./Legend-C6q2bLVV.js";
8
+ import { _ as je } from "./Shape-CBu7ails.js";
9
+ import { D as zt } from "./DataTable-Ce4R8v-3.js";
10
+ import At from "./vue-ui-skeleton-E1-7diF5.js";
11
+ import St from "./vue-ui-accordion-B0fEWLwn.js";
12
+ import { u as Ve } from "./useNestedProp-CZkNAGQh.js";
13
+ import { _ as Lt } from "./PackageVersion-g2UOsY7H.js";
14
+ import { P as Tt } from "./PenAndPaper-DRFeGfqV.js";
15
15
  import { _ as Bt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
16
16
  const Nt = ["id"], Pt = ["xmlns", "viewBox"], Wt = { key: 0 }, Ot = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Ft = ["x1", "x2", "y1", "y2", "stroke", "stroke-width"], Xt = { key: 1 }, It = ["points", "fill", "stroke-width", "stroke-dasharray", "stroke"], Dt = { key: 0 }, Yt = ["cx", "cy", "r", "fill", "stroke", "stroke-width", "onMouseover"], jt = { key: 1 }, Vt = { key: 2 }, Et = ["id"], Gt = ["stop-color"], Rt = ["stop-color"], Ut = ["id"], qt = ["stop-color"], Ht = ["stop-color"], Jt = ["x", "y", "width", "height", "fill", "stroke", "stroke-width", "rx"], Kt = ["x", "y", "height", "width", "fill", "stroke", "stroke-width", "rx"], Qt = { key: 0 }, Zt = ["d", "stroke", "stroke-width"], el = ["d", "stroke", "stroke-width"], tl = ["d", "stroke", "stroke-width"], ll = ["d", "stroke", "stroke-width"], al = {
17
17
  key: 3,
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),k=require("./index-CsQwCVqU.cjs"),V=require("./html2canvas.esm-BA_v9SIU.cjs"),U={__name:"vue-ui-screenshot",props:{config:{type:Object,default(){return{}}}},emits:["postImage"],setup(z,{expose:T,emit:H}){const C=z,{vue_ui_screenshot:B}=k.useConfig(),$=i.ref(`vue-ui-screenshot-${Math.random()}`),n=i.computed(()=>{if(!Object.keys(C.config||{}).length)return B;const e=k.treeShake({defaultConfig:B,userConfig:C.config});return k.convertConfigColors(e)}),a=i.ref(null),d=i.ref(null),v=i.ref(null),M=i.ref(null),S=i.ref(null),y=i.ref(null),h=i.ref(null),p=i.ref(null),f=i.ref(null),b=i.ref(null),x=i.ref(null),w=i.ref(!1),I=i.ref(null);function R(){const e=document.createElement("DIV"),{innerWidth:t,innerHeight:l}=window;return e.style.position="fixed",e.style.top=`${l?l/2-n.value.style.captureArea.initialHeight/2:200}px`,e.style.left=`${t?t/2-n.value.style.captureArea.initialWidth/2:100}px`,e.style.width=`${n.value.style.captureArea.initialWidth}px`,e.style.height=`${n.value.style.captureArea.initialHeight}px`,e.style.background=n.value.style.captureArea.background,e.style.cursor="move",e.style.boxSizing="border-box",e.style.border=n.value.style.captureArea.border,e.style.resize="both",e.style.padding="none !important",e.style.margin="none !important",e.dataset.cy="screenshot-overlay",e}function E(){a.value&&(clearTimeout(I.value),a.value.remove(),a.value=null)}function W(e){const t=document.createElement("DIV");t.classList.add("vue-ui-screenshot-info-text"),t.innerHTML=n.value.translations.info,t.dataset.html2canvasIgnore="true",t.dataset.cy="screenshot-info-text",t.style.background=n.value.style.info.background,t.style.color=n.value.style.info.color,t.style.fontWeight=n.value.style.info.bold?"bold":"normal",t.style.minWidth=`${n.value.style.info.minWidth}px`,t.style.left="50%",t.style.padding=`${n.value.style.info.padding}px`,t.style.position="absolute",t.style.textAlign="center",t.style.top=`${n.value.style.info.top}px`,t.style.transform="translateX(-50%)",t.style.borderRadius=`${n.value.style.info.borderRadius}px`,t.style.boxShadow=n.value.style.info.boxShadow,t.style.fontFamily=n.value.style.info.fontFamily,t.style.fontSize=`${n.value.style.info.fontSize}px`,t.style.border=n.value.style.info.border,t.style.userSelect="none";const l=document.createElement("BUTTON");l.classList.add("vue-ui-screenshot-close-button"),l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>',l.style.outline="none",l.dataset.cy="screenshot-close-button",l.style.display="flex",l.style.cursor="pointer",l.style.borderRadius="50%",l.style.alignItems="center",l.style.position="absolute",l.style.justifyContent="center",l.style.transformOrigin="center",l.style.top=`${n.value.style.cancelButton.top}px`,l.style.right=`${n.value.style.cancelButton.right}px`,l.style.background=n.value.style.cancelButton.background,l.style.color=n.value.style.cancelButton.color,l.style.border=n.value.style.cancelButton.border,l.style.borderRadius=`${n.value.style.cancelButton.borderRadius}px`,l.style.height=`${n.value.style.cancelButton.size}px`,l.style.width=`${n.value.style.cancelButton.size}px`,l.addEventListener("click",E),t.appendChild(l),e.appendChild(t)}function X(e){a.value&&(w.value=!0,e.touches?(y.value=e.touches[0].clientX,h.value=e.touches[0].clientY):(y.value=e.clientX,h.value=e.clientY),b.value=a.value.getBoundingClientRect().width,x.value=a.value.getBoundingClientRect().height,e.target.addEventListener("mousemove",L),e.target.addEventListener("touchmove",L))}function L(e){if(!a.value)return;let t,l;e.touches?(p.value=e.touches[0].clientX,t=e.touches[0].clientX,f.value=e.touches[0].clientY,l=e.touches[0].clientY):(p.value=e.clientX,t=e.clientX,f.value=e.clientY,l=e.clientY);const u=e.target.classList[0],o=a.value.style;switch(!0){case u==="vue-ui-screenshot-handle-nw":o.top=`${l}px`,o.left=`${t}px`,o.width=`${b.value+(y.value-p.value)}px`,o.height=`${x.value+(h.value-f.value)}px`;break;case u==="vue-ui-screenshot-handle-ne":o.top=`${l}px`,o.width=`${b.value+(p.value-y.value)}px`,o.height=`${x.value+(h.value-f.value)}px`;break;case u==="vue-ui-screenshot-handle-sw":o.left=`${t}px`,o.width=`${b.value+(y.value-p.value)}px`,o.height=`${x.value+(f.value-h.value)}px`;break;case u==="vue-ui-screenshot-handle-se":o.width=`${b.value+(p.value-y.value)}px`,o.height=`${x.value+(f.value-h.value)}px`;break}}function A(e){if(!a.value)return;e.stopPropagation();const t=Array.from(e.target.classList);t.includes("vue-ui-screenshot-handle-se")||t.includes("vue-ui-screenshot-handle-sw")||t.includes("vue-ui-screenshot-handle-nw")||t.includes("vue-ui-screenshot-handle-ne")||(w.value=!0,a.value.style.pointerEvents="auto",e.touches?(d.value=e.touches[0].clientX,v.value=e.touches[0].clientY):(d.value=e.clientX,v.value=e.clientY),M.value=d.value,S.value=v.value,document.addEventListener("mousemove",g),document.addEventListener("touchmove",g),document.addEventListener("mouseup",m),document.addEventListener("touchend",m))}function m(){d.value=null,v.value=null,M.value=null,S.value=null,w.value=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",m)}function g(e){if(!a.value)return;const t=a.value.getBoundingClientRect();let l,u;e.touches?(l=e.touches[0].clientX-d.value,u=e.touches[0].clientY-v.value,d.value=e.touches[0].clientX,v.value=e.touches[0].clientY):(l=e.clientX-d.value,u=e.clientY-v.value,d.value=e.clientX,v.value=e.clientY),a.value.style.top=`${t.top+u}px`,a.value.style.left=`${t.left+l}px`}function Y(e){e.target.removeEventListener("mousemove",L),e.target.removeEventListener("touchmove",L),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",m),document.removeEventListener("touchend",m),w.value=!1}function D(){const e=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":"desktop"}function O(){const e=document.getElementById(`vue-ui-screenshot-button-${$.value}`);e.innerHTML=`<svg id="saveButtonSvg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 20 20" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("vue"),k=require("./index-3oZdQf6G.cjs"),V=require("./html2canvas.esm-BA_v9SIU.cjs"),U={__name:"vue-ui-screenshot",props:{config:{type:Object,default(){return{}}}},emits:["postImage"],setup(z,{expose:T,emit:H}){const C=z,{vue_ui_screenshot:B}=k.useConfig(),$=i.ref(`vue-ui-screenshot-${Math.random()}`),n=i.computed(()=>{if(!Object.keys(C.config||{}).length)return B;const e=k.treeShake({defaultConfig:B,userConfig:C.config});return k.convertConfigColors(e)}),a=i.ref(null),d=i.ref(null),v=i.ref(null),M=i.ref(null),S=i.ref(null),y=i.ref(null),h=i.ref(null),p=i.ref(null),f=i.ref(null),b=i.ref(null),x=i.ref(null),w=i.ref(!1),I=i.ref(null);function R(){const e=document.createElement("DIV"),{innerWidth:t,innerHeight:l}=window;return e.style.position="fixed",e.style.top=`${l?l/2-n.value.style.captureArea.initialHeight/2:200}px`,e.style.left=`${t?t/2-n.value.style.captureArea.initialWidth/2:100}px`,e.style.width=`${n.value.style.captureArea.initialWidth}px`,e.style.height=`${n.value.style.captureArea.initialHeight}px`,e.style.background=n.value.style.captureArea.background,e.style.cursor="move",e.style.boxSizing="border-box",e.style.border=n.value.style.captureArea.border,e.style.resize="both",e.style.padding="none !important",e.style.margin="none !important",e.dataset.cy="screenshot-overlay",e}function E(){a.value&&(clearTimeout(I.value),a.value.remove(),a.value=null)}function W(e){const t=document.createElement("DIV");t.classList.add("vue-ui-screenshot-info-text"),t.innerHTML=n.value.translations.info,t.dataset.html2canvasIgnore="true",t.dataset.cy="screenshot-info-text",t.style.background=n.value.style.info.background,t.style.color=n.value.style.info.color,t.style.fontWeight=n.value.style.info.bold?"bold":"normal",t.style.minWidth=`${n.value.style.info.minWidth}px`,t.style.left="50%",t.style.padding=`${n.value.style.info.padding}px`,t.style.position="absolute",t.style.textAlign="center",t.style.top=`${n.value.style.info.top}px`,t.style.transform="translateX(-50%)",t.style.borderRadius=`${n.value.style.info.borderRadius}px`,t.style.boxShadow=n.value.style.info.boxShadow,t.style.fontFamily=n.value.style.info.fontFamily,t.style.fontSize=`${n.value.style.info.fontSize}px`,t.style.border=n.value.style.info.border,t.style.userSelect="none";const l=document.createElement("BUTTON");l.classList.add("vue-ui-screenshot-close-button"),l.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" stroke-width="2.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M18 6l-12 12" /><path d="M6 6l12 12" /></svg>',l.style.outline="none",l.dataset.cy="screenshot-close-button",l.style.display="flex",l.style.cursor="pointer",l.style.borderRadius="50%",l.style.alignItems="center",l.style.position="absolute",l.style.justifyContent="center",l.style.transformOrigin="center",l.style.top=`${n.value.style.cancelButton.top}px`,l.style.right=`${n.value.style.cancelButton.right}px`,l.style.background=n.value.style.cancelButton.background,l.style.color=n.value.style.cancelButton.color,l.style.border=n.value.style.cancelButton.border,l.style.borderRadius=`${n.value.style.cancelButton.borderRadius}px`,l.style.height=`${n.value.style.cancelButton.size}px`,l.style.width=`${n.value.style.cancelButton.size}px`,l.addEventListener("click",E),t.appendChild(l),e.appendChild(t)}function X(e){a.value&&(w.value=!0,e.touches?(y.value=e.touches[0].clientX,h.value=e.touches[0].clientY):(y.value=e.clientX,h.value=e.clientY),b.value=a.value.getBoundingClientRect().width,x.value=a.value.getBoundingClientRect().height,e.target.addEventListener("mousemove",L),e.target.addEventListener("touchmove",L))}function L(e){if(!a.value)return;let t,l;e.touches?(p.value=e.touches[0].clientX,t=e.touches[0].clientX,f.value=e.touches[0].clientY,l=e.touches[0].clientY):(p.value=e.clientX,t=e.clientX,f.value=e.clientY,l=e.clientY);const u=e.target.classList[0],o=a.value.style;switch(!0){case u==="vue-ui-screenshot-handle-nw":o.top=`${l}px`,o.left=`${t}px`,o.width=`${b.value+(y.value-p.value)}px`,o.height=`${x.value+(h.value-f.value)}px`;break;case u==="vue-ui-screenshot-handle-ne":o.top=`${l}px`,o.width=`${b.value+(p.value-y.value)}px`,o.height=`${x.value+(h.value-f.value)}px`;break;case u==="vue-ui-screenshot-handle-sw":o.left=`${t}px`,o.width=`${b.value+(y.value-p.value)}px`,o.height=`${x.value+(f.value-h.value)}px`;break;case u==="vue-ui-screenshot-handle-se":o.width=`${b.value+(p.value-y.value)}px`,o.height=`${x.value+(f.value-h.value)}px`;break}}function A(e){if(!a.value)return;e.stopPropagation();const t=Array.from(e.target.classList);t.includes("vue-ui-screenshot-handle-se")||t.includes("vue-ui-screenshot-handle-sw")||t.includes("vue-ui-screenshot-handle-nw")||t.includes("vue-ui-screenshot-handle-ne")||(w.value=!0,a.value.style.pointerEvents="auto",e.touches?(d.value=e.touches[0].clientX,v.value=e.touches[0].clientY):(d.value=e.clientX,v.value=e.clientY),M.value=d.value,S.value=v.value,document.addEventListener("mousemove",g),document.addEventListener("touchmove",g),document.addEventListener("mouseup",m),document.addEventListener("touchend",m))}function m(){d.value=null,v.value=null,M.value=null,S.value=null,w.value=!1,document.removeEventListener("mousemove",g),document.removeEventListener("mouseup",m),document.removeEventListener("touchmove",g),document.removeEventListener("touchend",m)}function g(e){if(!a.value)return;const t=a.value.getBoundingClientRect();let l,u;e.touches?(l=e.touches[0].clientX-d.value,u=e.touches[0].clientY-v.value,d.value=e.touches[0].clientX,v.value=e.touches[0].clientY):(l=e.clientX-d.value,u=e.clientY-v.value,d.value=e.clientX,v.value=e.clientY),a.value.style.top=`${t.top+u}px`,a.value.style.left=`${t.left+l}px`}function Y(e){e.target.removeEventListener("mousemove",L),e.target.removeEventListener("touchmove",L),document.removeEventListener("mousemove",g),document.removeEventListener("touchmove",g),document.removeEventListener("mouseup",m),document.removeEventListener("touchend",m),w.value=!1}function D(){const e=navigator.userAgent;return/(tablet|ipad|playbook|silk)|(android(?!.*mobi))/i.test(e)?"tablet":/Mobile|iP(hone|od)|Android|BlackBerry|IEMobile|Kindle|Silk-Accelerated|(hpw|web)OS|Opera M(obi|ini)/.test(e)?"mobile":"desktop"}function O(){const e=document.getElementById(`vue-ui-screenshot-button-${$.value}`);e.innerHTML=`<svg id="saveButtonSvg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 20 20" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
2
2
  <path fill="none" stroke="currentColor" d="M1 4 1 3C1 2 2 1 3 1L4 1M16 1 17 1C18 1 19 2 19 3L19 4M1 16 1 17C1 18 2 19 3 19L4 19M16 19 17 19C18 19 19 18 19 17L19 16M8 10A1 1 0 0012 10 1 1 0 008 10M5 13 5 8C5 7 5 7 6 7L14 7C15 7 15 7 15 8L15 13C15 14 15 14 14 14L6 14C5 14 5 14 5 13M7 6 13 6" />
3
3
  </svg>`,document.getElementById(`vue-ui-screenshot-button-${$.value}`).animate([{opacity:"0.3"},{opacity:"1"},{opacity:"0.3"}],{duration:1e3,iterations:1/0}),e.classList.add("loading"),e.setAttribute("disabled","true")}function _(){if(!a.value)return;O();const e=a.value.getBoundingClientRect();I.value=setTimeout(()=>{V.default(document.body,{allowTaint:!0,width:e.width,height:e.height,x:e.left+window.scrollX,y:e.top+window.scrollY,useCORS:!0,scale:n.value.quality}).then(t=>{const l=t.toDataURL("image/png",1),u=l.split(",")[1],c=atob(u).length/1024;if(n.value.mode==="download"){const s=document.createElement("a");s.download="screenshot.png",s.href=l,s.click()}n.value.mode==="post"&&H("postImage",{createdAt:Date.now(),fileSize:`${c.toFixed(2)} KB`,image:l,x:e.left+window.scrollX,y:e.top+window.scrollY,screenWidth:window.innerWidth>0?window.innerWidth:screen.width,deviceType:D()})}).finally(E)},10)}function F(e){const t=n.value.style.handles.size/2+4,l=document.createElement("DIV");l.style.top=`${-t}px`,l.style.left=`${-t}px`,l.style.cursor="nw-resize",l.classList.add("vue-ui-screenshot-handle-nw"),l.dataset.cy="screenshot-handle-nw";const u=document.createElement("DIV");u.style.top=`${-t}px`,u.style.left="auto",u.style.right=`${-t}px`,u.style.cursor="ne-resize",u.classList.add("vue-ui-screenshot-handle-ne"),u.dataset.cy="screenshot-handle-ne";const o=document.createElement("DIV");o.style.top="auto",o.style.bottom=`${-t}px`,o.style.left=`${-t}px`,o.style.cursor="sw-resize",o.classList.add("vue-ui-screenshot-handle-sw"),o.dataset.cy="screenshot-handle-sw";const c=document.createElement("DIV");c.style.top="auto",c.style.left="auto",c.style.right=`${-t}px`,c.style.bottom=`${-t}px`,c.style.cursor="se-resize",c.classList.add("vue-ui-screenshot-handle-se"),c.dataset.cy="screenshot-handle-se";const s=document.createElement("BUTTON");s.innerHTML=`<svg id="saveButtonSvg" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 20 20" stroke-width="1.5" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path fill="none" stroke="currentColor" d="M1 4 1 3C1 2 2 1 3 1L4 1M16 1 17 1C18 1 19 2 19 3L19 4M1 16 1 17C1 18 2 19 3 19L4 19M16 19 17 19C18 19 19 18 19 17L19 16M8 10A1 1 0 0012 10 1 1 0 008 10M5 13 5 8C5 7 5 7 6 7L14 7C15 7 15 7 15 8L15 13C15 14 15 14 14 14L6 14C5 14 5 14 5 13M7 6 13 6" /></svg><span>${n.value.translations.captureButton}</span>`,s.classList.add("vue-ui-screenshot-capture-button"),s.id=`vue-ui-screenshot-button-${$.value}`,s.style.position="absolute",s.style.top="50%",s.style.left="50%",s.style.transform="translate(-50%,-50%)",s.style.background=n.value.style.captureButton.background,s.style.color=n.value.style.captureButton.color,s.style.border=n.value.style.captureButton.border,s.style.outline="none",s.style.cursor="pointer",s.style.padding=n.value.style.captureButton.padding,s.style.fontFamily=n.value.style.captureButton.fontFamily,s.style.fontSize=`${n.value.style.captureButton.fontSize}px`,s.style.minHeight=`${n.value.style.captureButton.minHeight}px`,s.style.width="fit-content",s.style.display="flex",s.style.alignItems="center",s.style.justifyContent="center",s.style.gap="3px",s.style.borderRadius=`${n.value.style.captureButton.borderRadius}px`,s.style.boxShadow=n.value.style.captureButton.boxShadow,s.style.userSelect="none",s.style.opacity="0.95",s.style.textAlign="left",s.style.fontWeight=n.value.style.captureButton.bold?"bold":"normal",s.dataset.cy="screenshot-save-button",s.addEventListener("mouseenter",()=>{s.style.opacity="1"}),s.addEventListener("mouseleave",()=>{s.style.opacity="0.95"}),s.addEventListener("click",_),e.appendChild(s),[l,u,o,c].forEach((r,N)=>{r.classList.add(`handle-${N}`),r.dataset.html2canvasIgnore="true",r.style.position="absolute",r.style.height=`${n.value.style.handles.size}px`,r.style.width=`${n.value.style.handles.size}px`,r.style.background=n.value.style.handles.background,r.style.border=n.value.style.handles.border,r.style.borderRadius=`${n.value.style.handles.borderRadius}px`,r.style.pointerEvents="auto !important",r.addEventListener("mousedown",X),r.addEventListener("touchstart",X),e.appendChild(r)})}function j(){a.value||i.nextTick(()=>{const e=R();e.dataset.html2canvasIgnore=!0,W(e),F(e),a.value=e,e.addEventListener("touchmove",function(t){t.preventDefault()},{passive:!1}),document.body.appendChild(e),document.addEventListener("mousedown",A),document.addEventListener("touchstart",A),document.addEventListener("mouseup",Y),document.addEventListener("touchend",Y)})}return T({shoot:j,close:E}),(e,t)=>(i.openBlock(),i.createElementBlock("div"))}};exports.default=U;
@@ -1,5 +1,5 @@
1
1
  import { ref as i, computed as N, openBlock as V, createElementBlock as U, nextTick as G } from "vue";
2
- import { u as K, A as P, B as q } from "./index-hV0hU1iE.js";
2
+ import { u as K, A as P, B as q } from "./index-D020Kb3z.js";
3
3
  import J from "./html2canvas.esm-d2sM-0Wm.js";
4
4
  const te = {
5
5
  __name: "vue-ui-screenshot",