@lumal/datav 0.0.1-beta → 0.0.2-beta

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 (58) hide show
  1. package/LICENSE +21 -21
  2. package/dist/LumalActiveRingChart-CFvdUp1Z.js +1 -0
  3. package/dist/LumalActiveRingChart-a8vgtb0R.cjs +1 -0
  4. package/dist/LumalCapsuleChart-BaP_ke20.js +1 -0
  5. package/dist/LumalCapsuleChart-rpE-RLtM.cjs +1 -0
  6. package/dist/LumalCharts-BJYGMqQz.cjs +1 -0
  7. package/dist/LumalCharts-C1xDf8pJ.js +1 -0
  8. package/dist/LumalConicalColumnChart-BeN-R1Ey.cjs +1 -0
  9. package/dist/LumalConicalColumnChart-D9I6pn6u.js +1 -0
  10. package/dist/{LumalDecoration-02s-uU9A.cjs → LumalDecoration-NO3p8-15.cjs} +1 -1
  11. package/dist/{LumalDecoration-CFP6mGDX.js → LumalDecoration-mPN6Fsoh.js} +1 -1
  12. package/dist/{LumalScrollBoard-CrS1y498.js → LumalScrollBoard-4iAIX0AJ.js} +1 -1
  13. package/dist/{LumalScrollBoard-HKF85wB3.cjs → LumalScrollBoard-BlJGzVWt.cjs} +1 -1
  14. package/dist/{LumalScrollRankingBoard-CwIxBYWh.cjs → LumalScrollRankingBoard-Cvxv-u9H.cjs} +1 -1
  15. package/dist/{LumalScrollRankingBoard-DMVRrsyi.js → LumalScrollRankingBoard-DHAXz2T4.js} +1 -1
  16. package/dist/active-ring-chart.cjs +1 -1
  17. package/dist/active-ring-chart.js +1 -1
  18. package/dist/border-box.cjs +1 -1
  19. package/dist/capsule-chart.cjs +1 -1
  20. package/dist/capsule-chart.js +1 -1
  21. package/dist/charts.cjs +1 -1
  22. package/dist/charts.js +1 -1
  23. package/dist/conical-column-chart.cjs +1 -1
  24. package/dist/conical-column-chart.js +1 -1
  25. package/dist/datav.css +1 -1
  26. package/dist/decoration.cjs +1 -1
  27. package/dist/decoration.js +1 -1
  28. package/dist/digital-flop.cjs +1 -1
  29. package/dist/flyline-chart-enhanced.cjs +1 -1
  30. package/dist/flyline-chart.cjs +1 -1
  31. package/dist/full-screen-container.cjs +1 -1
  32. package/dist/index.cjs +1 -1
  33. package/dist/index.js +1 -1
  34. package/dist/loading.cjs +1 -1
  35. package/dist/percent-pond.cjs +1 -1
  36. package/dist/scroll-board.cjs +1 -1
  37. package/dist/scroll-board.js +1 -1
  38. package/dist/scroll-ranking-board.cjs +1 -1
  39. package/dist/scroll-ranking-board.js +1 -1
  40. package/dist/src/components/LumalActiveRingChart.vue.d.ts.map +1 -1
  41. package/dist/src/components/LumalCapsuleChart.vue.d.ts.map +1 -1
  42. package/dist/src/components/LumalCharts.vue.d.ts.map +1 -1
  43. package/dist/src/components/LumalConicalColumnChart.vue.d.ts.map +1 -1
  44. package/dist/src/components/LumalDecoration.vue.d.ts.map +1 -1
  45. package/dist/src/components/LumalScrollBoard.vue.d.ts.map +1 -1
  46. package/dist/src/components/LumalScrollRankingBoard.vue.d.ts.map +1 -1
  47. package/dist/src/index.d.ts +1 -1
  48. package/dist/src/index.d.ts.map +1 -1
  49. package/dist/water-level-pond.cjs +1 -1
  50. package/package.json +5 -5
  51. package/dist/LumalActiveRingChart-BZAnPotP.js +0 -1
  52. package/dist/LumalActiveRingChart-DAgLadE-.cjs +0 -1
  53. package/dist/LumalCapsuleChart-BUfj4j3C.cjs +0 -1
  54. package/dist/LumalCapsuleChart-DxUDrb_Q.js +0 -1
  55. package/dist/LumalCharts-6FM9fUmp.cjs +0 -1
  56. package/dist/LumalCharts-Dzb92It8.js +0 -1
  57. package/dist/LumalConicalColumnChart-DN27lsqT.cjs +0 -1
  58. package/dist/LumalConicalColumnChart-DicGl-cp.js +0 -1
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2026 Lumal contributors
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lumal contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ import{t as e}from"./useElementSize-CKA7EtNB.js";import{t as a}from"./useReducedMotion-DrRe5YGn.js";import{t}from"./LumalCharts-C1xDf8pJ.js";import{t as i}from"./_plugin-vue_export-helper-DgLP3hnZ.js";import{t as l}from"./LumalDigitalFlop-BCwB_0xK.js";import{Fragment as n,computed as o,createElementBlock as u,createElementVNode as v,createVNode as r,defineComponent as c,mergeModels as s,normalizeStyle as m,onBeforeUnmount as f,onMounted as d,openBlock as p,renderList as g,shallowRef as b,toDisplayString as y,useModel as h,useTemplateRef as k,watch as x}from"vue";var F=["aria-label","data-active-index"],L={class:"active-ring-info"},S=["aria-label"],C=["aria-label","aria-selected","onClick"],_=/*#__PURE__*/i(/*@__PURE__*/c({__name:"LumalActiveRingChart",props:/*@__PURE__*/s({items:{default:void 0},config:{default:()=>({})},interval:{default:void 0},autoplay:{type:Boolean,default:!0},ariaLabel:{default:"活动环图"}},{activeKey:{},activeKeyModifiers:{}}),emits:/*@__PURE__*/s(["select"],["update:activeKey"]),setup(i,{emit:c}){const s=i,_=c,w=["#37a2da","#32c5e9","#67e0e3","#9fe6b8","#ffdb5c","#ff9f7f","#fb7293","#e062ae","#e690d1","#e7bcf3","#9d96f5","#8378ea","#96bfff"],$=h(i,"activeKey"),j=k("chartHostRef"),z=e(j),M=a(),R=b(0);let K;const T=o(()=>void 0!==s.items?s.items.map(e=>({data:{name:e.label,value:e.value},item:e})):(s.config.data??[{name:"",value:0}]).map((e,a)=>({data:{...e},item:{key:"string"==typeof e.key||"number"==typeof e.key?e.key:e.name||a,label:e.name,value:e.value}}))),I=o(()=>s.config.color??s.items?.map((e,a)=>e.color??w[a%w.length])??w),O=o(()=>s.config.lineWidth??20),H=o(()=>T.value[R.value]),U=o(()=>{const e=H.value?.data.value??0;if(s.config.showOriginValue)return e;const a=T.value.reduce((e,a)=>e+a.data.value,0);return a?e/a*100:0}),V=o(()=>({fill:"#fff",fontSize:25,...s.config.digitalFlopStyle})),A=o(()=>({animationCurve:s.config.animationCurve??"easeOutCubic",animationFrame:s.config.animationFrame??50,content:s.config.showOriginValue?`{nt}${s.config.digitalFlopUnit??""}`:`{nt}${s.config.digitalFlopUnit||"%"}`,number:[U.value],style:V.value,toFixed:s.config.digitalFlopToFixed??0})),B=o(()=>({fontSize:`${V.value.fontSize}px`})),D=o(()=>z.value.width>0&&z.value.height>0);function E(e,a){const t=e??a,i=Math.min(z.value.width,z.value.height)/2;return"number"==typeof t?t:Number.parseFloat(t)/100*i}const G=o(()=>{const e=E(s.config.radius,"50%"),a=E(s.config.activeRadius,"55%"),t=O.value/2,i=T.value.map((e,a)=>({name:e.data.name,value:e.data.value,itemStyle:{color:I.value[a%I.value.length],opacity:a===R.value?0:1}})),l=i.map((e,a)=>({...e,itemStyle:{...e.itemStyle,opacity:a===R.value?1:0}})),n={animation:!M.value,center:["50%","50%"],label:{show:!1},labelLine:{show:!1},silent:!0,type:"pie"};return{animation:!M.value,color:[...I.value],series:[{...n,data:i,radius:[Math.max(0,e-t),e+t]},{...n,data:l,radius:[Math.max(0,a-t),a+t],z:2}]}});function N(e,a=!1){const t=T.value[e];t&&(R.value=e,$.value=t.item.key,a&&_("select",t.item))}const W=o(()=>s.interval??s.config.activeTimeGap??3e3),q=o(()=>s.autoplay&&W.value>0&&T.value.length>1&&D.value&&!M.value);function J(){void 0!==K&&clearTimeout(K),K=void 0}function P(){J(),q.value&&(K=setTimeout(()=>{T.value.length>1&&N((R.value+1)%T.value.length),P()},W.value))}return x(()=>$.value,e=>{const a=T.value.findIndex(a=>a.item.key===e);a>=0&&(R.value=a)}),x([()=>s.config,()=>s.items],function(){const e=T.value.findIndex(e=>e.item.key===$.value);R.value=e>=0?e:0}),x([q,W],P),d(P),f(J),(e,a)=>(p(),u("div",{class:"dv-active-ring-chart",role:"group","aria-label":i.ariaLabel,"data-active-index":R.value},[v("div",{ref_key:"chartHostRef",ref:j,class:"active-ring-chart-container"},[r(t,{option:G.value,"aria-label":i.ariaLabel},null,8,["option","aria-label"])],512),v("div",L,[r(l,{class:"dv-digital-flop",config:A.value},null,8,["config"]),v("div",{class:"active-ring-name",style:m(B.value)},y(H.value?.item.label??""),5)]),v("div",{class:"lumal-active-ring-controls",role:"listbox","aria-label":`${i.ariaLabel}数据项`},[(p(!0),u(n,null,g(T.value,(e,a)=>(p(),u("button",{key:e.item.key,type:"button",role:"option","aria-label":`${e.item.label} ${e.item.value}`,"aria-selected":a===R.value,onClick:e=>N(a,!0)},y(e.item.label),9,C))),128))],8,S)],8,F))}}),[["__scopeId","data-v-5331199a"]]);export{_ as t};
@@ -0,0 +1 @@
1
+ const e=require("./LumalCharts-BJYGMqQz.cjs"),a=require("./useElementSize-CZjD5sCp.cjs"),t=require("./useReducedMotion-B0VTSXyW.cjs"),l=require("./_plugin-vue_export-helper-BXystuG9.cjs"),i=require("./LumalDigitalFlop-D_s0BSsf.cjs");let o=require("vue");var n=["aria-label","data-active-index"],u={class:"active-ring-info"},c=["aria-label"],r=["aria-label","aria-selected","onClick"],d=(0,o.defineComponent)({__name:"LumalActiveRingChart",props:(0,o.mergeModels)({items:{default:void 0},config:{default:()=>({})},interval:{default:void 0},autoplay:{type:Boolean,default:!0},ariaLabel:{default:"活动环图"}},{activeKey:{},activeKeyModifiers:{}}),emits:(0,o.mergeModels)(["select"],["update:activeKey"]),setup(l,{emit:d}){const v=l,m=d,s=["#37a2da","#32c5e9","#67e0e3","#9fe6b8","#ffdb5c","#ff9f7f","#fb7293","#e062ae","#e690d1","#e7bcf3","#9d96f5","#8378ea","#96bfff"],f=(0,o.useModel)(l,"activeKey"),p=(0,o.useTemplateRef)("chartHostRef"),g=a.useElementSize(p),b=t.useReducedMotion(),y=(0,o.shallowRef)(0);let h;const k=(0,o.computed)(()=>void 0!==v.items?v.items.map(e=>({data:{name:e.label,value:e.value},item:e})):(v.config.data??[{name:"",value:0}]).map((e,a)=>({data:{...e},item:{key:"string"==typeof e.key||"number"==typeof e.key?e.key:e.name||a,label:e.name,value:e.value}}))),_=(0,o.computed)(()=>v.config.color??v.items?.map((e,a)=>e.color??s[a%s.length])??s),x=(0,o.computed)(()=>v.config.lineWidth??20),F=(0,o.computed)(()=>k.value[y.value]),L=(0,o.computed)(()=>{const e=F.value?.data.value??0;if(v.config.showOriginValue)return e;const a=k.value.reduce((e,a)=>e+a.data.value,0);return a?e/a*100:0}),S=(0,o.computed)(()=>({fill:"#fff",fontSize:25,...v.config.digitalFlopStyle})),w=(0,o.computed)(()=>({animationCurve:v.config.animationCurve??"easeOutCubic",animationFrame:v.config.animationFrame??50,content:v.config.showOriginValue?`{nt}${v.config.digitalFlopUnit??""}`:`{nt}${v.config.digitalFlopUnit||"%"}`,number:[L.value],style:S.value,toFixed:v.config.digitalFlopToFixed??0})),C=(0,o.computed)(()=>({fontSize:`${S.value.fontSize}px`})),M=(0,o.computed)(()=>g.value.width>0&&g.value.height>0);function E(e,a){const t=e??a,l=Math.min(g.value.width,g.value.height)/2;return"number"==typeof t?t:Number.parseFloat(t)/100*l}const R=(0,o.computed)(()=>{const e=E(v.config.radius,"50%"),a=E(v.config.activeRadius,"55%"),t=x.value/2,l=k.value.map((e,a)=>({name:e.data.name,value:e.data.value,itemStyle:{color:_.value[a%_.value.length],opacity:a===y.value?0:1}})),i=l.map((e,a)=>({...e,itemStyle:{...e.itemStyle,opacity:a===y.value?1:0}})),o={animation:!b.value,center:["50%","50%"],label:{show:!1},labelLine:{show:!1},silent:!0,type:"pie"};return{animation:!b.value,color:[..._.value],series:[{...o,data:l,radius:[Math.max(0,e-t),e+t]},{...o,data:i,radius:[Math.max(0,a-t),a+t],z:2}]}});function B(e,a=!1){const t=k.value[e];t&&(y.value=e,f.value=t.item.key,a&&m("select",t.item))}const V=(0,o.computed)(()=>v.interval??v.config.activeTimeGap??3e3),z=(0,o.computed)(()=>v.autoplay&&V.value>0&&k.value.length>1&&M.value&&!b.value);function N(){void 0!==h&&clearTimeout(h),h=void 0}function j(){N(),z.value&&(h=setTimeout(()=>{k.value.length>1&&B((y.value+1)%k.value.length),j()},V.value))}return(0,o.watch)(()=>f.value,e=>{const a=k.value.findIndex(a=>a.item.key===e);a>=0&&(y.value=a)}),(0,o.watch)([()=>v.config,()=>v.items],function(){const e=k.value.findIndex(e=>e.item.key===f.value);y.value=e>=0?e:0}),(0,o.watch)([z,V],j),(0,o.onMounted)(j),(0,o.onBeforeUnmount)(N),(a,t)=>((0,o.openBlock)(),(0,o.createElementBlock)("div",{class:"dv-active-ring-chart",role:"group","aria-label":l.ariaLabel,"data-active-index":y.value},[(0,o.createElementVNode)("div",{ref_key:"chartHostRef",ref:p,class:"active-ring-chart-container"},[(0,o.createVNode)(e.LumalCharts_default,{option:R.value,"aria-label":l.ariaLabel},null,8,["option","aria-label"])],512),(0,o.createElementVNode)("div",u,[(0,o.createVNode)(i.LumalDigitalFlop_default,{class:"dv-digital-flop",config:w.value},null,8,["config"]),(0,o.createElementVNode)("div",{class:"active-ring-name",style:(0,o.normalizeStyle)(C.value)},(0,o.toDisplayString)(F.value?.item.label??""),5)]),(0,o.createElementVNode)("div",{class:"lumal-active-ring-controls",role:"listbox","aria-label":`${l.ariaLabel}数据项`},[((0,o.openBlock)(!0),(0,o.createElementBlock)(o.Fragment,null,(0,o.renderList)(k.value,(e,a)=>((0,o.openBlock)(),(0,o.createElementBlock)("button",{key:e.item.key,type:"button",role:"option","aria-label":`${e.item.label} ${e.item.value}`,"aria-selected":a===y.value,onClick:e=>B(a,!0)},(0,o.toDisplayString)(e.item.label),9,r))),128))],8,c)],8,n))}}),v=l._plugin_vue_export_helper_default(d,[["__scopeId","data-v-5331199a"]]);Object.defineProperty(exports,"LumalActiveRingChart_default",{enumerable:!0,get:function(){return v}});
@@ -0,0 +1 @@
1
+ import{t as e}from"./_plugin-vue_export-helper-DgLP3hnZ.js";import{Fragment as a,computed as l,createCommentVNode as u,createElementBlock as t,createElementVNode as o,defineComponent as v,normalizeStyle as i,openBlock as s,renderList as r,toDisplayString as n}from"vue";var c=["aria-label"],d={class:"label-column"},m={class:"capsule-container"},f={key:0,class:"capsule-item-value"},p={class:"unit-label"},b={key:0,class:"unit-text"},h=/*#__PURE__*/e(/*@__PURE__*/v({__name:"LumalCapsuleChart",props:{items:{default:void 0},config:{default:()=>({})},colors:{default:void 0},max:{default:void 0},unit:{default:void 0},sort:{type:[Boolean,String],default:!1},showValue:{type:Boolean,default:void 0},ariaLabel:{default:"胶囊图"}},setup(e){const v=e,h=["#37a2da","#32c5e9","#67e0e3","#9fe6b8","#ffdb5c","#ff9f7f","#fb7293"],y=l(()=>void 0!==v.items?v.items.map(e=>({...e})):(v.config.data??[]).map((e,a)=>({key:e.name||a,label:e.name,value:e.value}))),g=l(()=>v.sort?[...y.value].sort((e,a)=>"asc"===v.sort?e.value-a.value:a.value-e.value):y.value),k=l(()=>{const e=v.colors??v.config.colors??(v.items?.some(e=>e.color)?v.items.map(e=>e.color):void 0),a=[...h];return e?.forEach((e,l)=>{e&&(a[l]=e)}),a}),x=l(()=>v.showValue??v.config.showValue??!1),_=l(()=>v.unit??v.config.unit??""),w=l(()=>v.max??(g.value.length?Math.max(...g.value.map(e=>e.value)):0)),C=l(()=>g.value.map(e=>w.value?e.value/w.value:0)),L=l(()=>{const e=w.value/5;return Array.from(new Set(Array.from({length:6}).fill(0).map((a,l)=>Math.ceil(l*e))))});function V(e,a){return{backgroundColor:k.value[a%k.value.length]??h[0],width:100*e+"%"}}return(l,v)=>(s(),t("div",{class:"dv-capsule-chart",role:"img","aria-label":e.ariaLabel},[o("div",d,[(s(!0),t(a,null,r(g.value,e=>(s(),t("div",{key:e.key},n(e.label),1))),128)),v[0]||(v[0]=o("div",null," ",-1))]),o("div",m,[(s(!0),t(a,null,r(C.value,(e,a)=>(s(),t("div",{key:g.value[a]?.key??a,class:"capsule-item"},[o("div",{class:"capsule-item-column",style:i(V(e,a))},[x.value?(s(),t("div",f,n(g.value[a]?.value),1)):u("",!0)],4)]))),128)),o("div",p,[(s(!0),t(a,null,r(L.value,(e,a)=>(s(),t("div",{key:`${e}-${a}`},n(e),1))),128))])]),_.value?(s(),t("div",b,n(_.value),1)):u("",!0)],8,c))}}),[["__scopeId","data-v-b8ed1b43"]]);export{h as t};
@@ -0,0 +1 @@
1
+ const e=require("./_plugin-vue_export-helper-BXystuG9.cjs");let l=require("vue");var a=["aria-label"],t={class:"label-column"},o={class:"capsule-container"},u={key:0,class:"capsule-item-value"},n={class:"unit-label"},c={key:0,class:"unit-text"},r=(0,l.defineComponent)({__name:"LumalCapsuleChart",props:{items:{default:void 0},config:{default:()=>({})},colors:{default:void 0},max:{default:void 0},unit:{default:void 0},sort:{type:[Boolean,String],default:!1},showValue:{type:Boolean,default:void 0},ariaLabel:{default:"胶囊图"}},setup(e){const r=e,i=["#37a2da","#32c5e9","#67e0e3","#9fe6b8","#ffdb5c","#ff9f7f","#fb7293"],m=(0,l.computed)(()=>void 0!==r.items?r.items.map(e=>({...e})):(r.config.data??[]).map((e,l)=>({key:e.name||l,label:e.name,value:e.value}))),d=(0,l.computed)(()=>r.sort?[...m.value].sort((e,l)=>"asc"===r.sort?e.value-l.value:l.value-e.value):m.value),s=(0,l.computed)(()=>{const e=r.colors??r.config.colors??(r.items?.some(e=>e.color)?r.items.map(e=>e.color):void 0),l=[...i];return e?.forEach((e,a)=>{e&&(l[a]=e)}),l}),v=(0,l.computed)(()=>r.showValue??r.config.showValue??!1),p=(0,l.computed)(()=>r.unit??r.config.unit??""),f=(0,l.computed)(()=>r.max??(d.value.length?Math.max(...d.value.map(e=>e.value)):0)),k=(0,l.computed)(()=>d.value.map(e=>f.value?e.value/f.value:0)),g=(0,l.computed)(()=>{const e=f.value/5;return Array.from(new Set(Array.from({length:6}).fill(0).map((l,a)=>Math.ceil(a*e))))});function B(e,l){return{backgroundColor:s.value[l%s.value.length]??i[0],width:100*e+"%"}}return(r,i)=>((0,l.openBlock)(),(0,l.createElementBlock)("div",{class:"dv-capsule-chart",role:"img","aria-label":e.ariaLabel},[(0,l.createElementVNode)("div",t,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(d.value,e=>((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:e.key},(0,l.toDisplayString)(e.label),1))),128)),i[0]||(i[0]=(0,l.createElementVNode)("div",null," ",-1))]),(0,l.createElementVNode)("div",o,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(k.value,(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:d.value[a]?.key??a,class:"capsule-item"},[(0,l.createElementVNode)("div",{class:"capsule-item-column",style:(0,l.normalizeStyle)(B(e,a))},[v.value?((0,l.openBlock)(),(0,l.createElementBlock)("div",u,(0,l.toDisplayString)(d.value[a]?.value),1)):(0,l.createCommentVNode)("",!0)],4)]))),128)),(0,l.createElementVNode)("div",n,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(g.value,(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:`${e}-${a}`},(0,l.toDisplayString)(e),1))),128))])]),p.value?((0,l.openBlock)(),(0,l.createElementBlock)("div",c,(0,l.toDisplayString)(p.value),1)):(0,l.createCommentVNode)("",!0)],8,a))}}),i=e._plugin_vue_export_helper_default(r,[["__scopeId","data-v-b8ed1b43"]]);Object.defineProperty(exports,"LumalCapsuleChart_default",{enumerable:!0,get:function(){return i}});
@@ -0,0 +1 @@
1
+ var e=Object.create,t=Object.defineProperty,o=Object.getOwnPropertyDescriptor,n=Object.getOwnPropertyNames,a=Object.getPrototypeOf,i=Object.prototype.hasOwnProperty,l=(l,u,r)=>(r=null!=l?e(a(l)):{},((e,a,l,u)=>{if(a&&"object"==typeof a||"function"==typeof a)for(var r,c=n(a),s=0,d=c.length;s<d;s++)r=c[s],i.call(e,r)||void 0===r||t(e,r,{get:(e=>a[e]).bind(null,r),enumerable:!(u=o(a,r))||u.enumerable});return e})(!u&&l&&l.__esModule?r:t(r,"default",{value:l,enumerable:!0}),l));const u=require("./_plugin-vue_export-helper-BXystuG9.cjs");let r=require("vue"),c=require("@jiaminghi/charts");c=l(c,1);let s=require("echarts");s=l(s,1);var d=["aria-label","data-renderer"],v=(0,r.defineComponent)({__name:"LumalCharts",props:{config:{default:void 0},option:{default:()=>({})},theme:{default:void 0},initOptions:{default:void 0},setOptionOptions:{default:void 0},autoResize:{type:Boolean,default:!0},events:{default:()=>({})},group:{default:void 0},loading:{type:Boolean,default:!1},loadingType:{default:"default"},loadingOptions:{default:void 0},ariaLabel:{default:void 0}},setup(e,{expose:t}){const o=e,n=c.default.default??c.default,a=(0,r.useAttrs)(),i=(0,r.useTemplateRef)("rootRef"),l=(0,r.useTemplateRef)("chartHostRef"),u=(0,r.shallowRef)(),v=(0,r.shallowRef)(),f=new Map,p=(0,r.computed)(()=>void 0!==o.config),h=(0,r.computed)(()=>o.ariaLabel??(p.value?"DataV 图表":"ECharts 图表"));let g,w=0,O=!1,m=!1,b=!1,y=!1;function L(){const e=l.value;if(!e||!e.isConnected)return;const t=Math.floor(e.clientWidth),o=Math.floor(e.clientHeight);return t<=0||o<=0?void 0:{height:o,width:t}}function _(){w&&("function"==typeof cancelAnimationFrame?cancelAnimationFrame(w):clearTimeout(w),w=0)}function R(){const e=u.value;e&&(f.forEach((t,o)=>e.off(o,t)),f.clear(),function(){const e=new Map;return Object.entries(o.events).forEach(([t,o])=>e.set(t.toLowerCase(),o)),Object.entries(a).forEach(([t,o])=>{const n=function(e){if(e.startsWith("on")&&!(e.length<=2))return e.slice(2).toLowerCase()}(t);n&&"function"==typeof o&&e.set(n,o)}),e}().forEach((t,o)=>{e.on(o,t),f.set(o,t)}))}function j(){v.value?.render.graphs.forEach(e=>e.animationEnd()),v.value=void 0,f.clear(),u.value?.dispose(),u.value=void 0,l.value?.replaceChildren()}function x(e){const t=u.value;t&&L()?(o.setOptionOptions?t.setOption(e,o.setOptionOptions):t.setOption(e),O=!1):O=!0}function E(e,t=!0){v.value&&L()?(v.value.setOption(e,t),m=!1):m=!0}function P(){const e=l.value,t=L();if(!e||!t)return;if(j(),p.value){const t=new n(e);return v.value=t,t.setOption(o.config??{}),void(m=!1)}const a={...o.initOptions,height:o.initOptions?.height??t.height,width:o.initOptions?.width??t.width},i=s.init(e,o.theme,a);u.value=i,o.group&&(i.group=o.group),x(o.option),R(),o.loading&&i.showLoading(o.loadingType,o.loadingOptions)}function T(e){_();const t=()=>{w=0;const t=L();t&&(v.value||u.value?(v.value?v.value.resize():u.value?.resize({...e,height:e?.height??t.height,width:e?.width??t.width}),L()&&(v.value&&m&&void 0!==o.config&&E(o.config),u.value&&O&&x(o.option))):P())};w="function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t,16)}function C(){L()&&(v.value||u.value?T():P())}function z(){if(!o.autoResize)return;const e=i.value;if(e&&"undefined"!=typeof ResizeObserver)return g=new ResizeObserver(C),void g.observe(e);"undefined"==typeof window||y||(window.addEventListener("resize",C,{passive:!0}),y=!0)}function k(){g?.disconnect(),g=void 0,y&&"undefined"!=typeof window&&(window.removeEventListener("resize",C),y=!1)}return(0,r.watch)(()=>o.config,e=>{void 0!==e&&E(e)},{deep:!1}),(0,r.watch)(()=>o.option,e=>{p.value||x(e)},{deep:!1}),(0,r.watch)(p,()=>{(0,r.nextTick)(P)}),(0,r.watch)(()=>o.group,e=>{u.value&&(u.value.group=e??"")}),(0,r.watchEffect)(()=>{Object.keys(a),o.events,R()}),(0,r.watch)(()=>o.loading,e=>{const t=u.value;t&&L()&&(e?t.showLoading(o.loadingType,o.loadingOptions):t.hideLoading())}),(0,r.watch)(()=>[o.theme,o.initOptions],()=>{p.value||(0,r.nextTick)(P)},{deep:!1}),(0,r.watch)(()=>o.autoResize,()=>{b&&(k(),z(),C())}),(0,r.onMounted)(async()=>{b=!0,await(0,r.nextTick)(),z(),P()}),(0,r.onBeforeUnmount)(()=>{b=!1,_(),k(),j()}),t({appendData:(...e)=>u.value?.appendData(...e),clear:()=>v.value?v.value.setOption({},!0):u.value?.clear(),containPixel:(...e)=>u.value?.containPixel(...e),convertFromPixel:(...e)=>u.value?.convertFromPixel(...e),convertToPixel:(...e)=>u.value?.convertToPixel(...e),dispatchAction:(...e)=>u.value?.dispatchAction(...e),dispose:j,getConnectedDataURL:(...e)=>u.value?.getConnectedDataURL(...e),getDataURL:(...e)=>u.value?.getDataURL(...e),getHeight:()=>v.value?l.value?.clientHeight:u.value?.getHeight(),getInstance:()=>v.value??u.value,getNativeInstance:()=>v.value,getOption:()=>v.value?.option??u.value?.getOption(),getWidth:()=>v.value?l.value?.clientWidth:u.value?.getWidth(),hideLoading:()=>u.value?.hideLoading(),off:(...e)=>u.value?.off(...e),on:(...e)=>u.value?.on(...e),resize:e=>T(e),setConfig:(e,t=!0)=>E(e,t),setOption:(e,t)=>{if(v.value)E(e,"boolean"!=typeof t||t);else if("object"==typeof t){if(!L())return void(O=!0);u.value?.setOption(e,t)}else x(e)},showLoading:(...e)=>u.value?.showLoading(...e)}),(e,t)=>((0,r.openBlock)(),(0,r.createElementBlock)("div",{ref_key:"rootRef",ref:i,class:"lumal-charts",role:"img","aria-label":h.value,"data-renderer":p.value?"datav":"echarts"},[(0,r.createElementVNode)("div",{ref_key:"chartHostRef",ref:l,class:"lumal-charts__host"},null,512)],8,d))}}),f=u._plugin_vue_export_helper_default(v,[["__scopeId","data-v-380913b5"]]);Object.defineProperty(exports,"LumalCharts_default",{enumerable:!0,get:function(){return f}});
@@ -0,0 +1 @@
1
+ import{t as e}from"./_plugin-vue_export-helper-DgLP3hnZ.js";import{computed as t,createElementBlock as i,createElementVNode as o,defineComponent as a,nextTick as n,onBeforeUnmount as l,onMounted as u,openBlock as r,shallowRef as s,useAttrs as d,useTemplateRef as v,watch as c,watchEffect as f}from"vue";import p from"@jiaminghi/charts";import*as h from"echarts";var g=["aria-label","data-renderer"],m=/*#__PURE__*/e(/*@__PURE__*/a({__name:"LumalCharts",props:{config:{default:void 0},option:{default:()=>({})},theme:{default:void 0},initOptions:{default:void 0},setOptionOptions:{default:void 0},autoResize:{type:Boolean,default:!0},events:{default:()=>({})},group:{default:void 0},loading:{type:Boolean,default:!1},loadingType:{default:"default"},loadingOptions:{default:void 0},ariaLabel:{default:void 0}},setup(e,{expose:a}){const m=e,O=p.default??p,w=d(),L=v("rootRef"),y=v("chartHostRef"),b=s(),R=s(),z=/* @__PURE__ */new Map,_=t(()=>void 0!==m.config),x=t(()=>m.ariaLabel??(_.value?"DataV 图表":"ECharts 图表"));let C,E=0,D=!1,T=!1,j=!1,A=!1;function F(){const e=y.value;if(!e||!e.isConnected)return;const t=Math.floor(e.clientWidth),i=Math.floor(e.clientHeight);return t<=0||i<=0?void 0:{height:i,width:t}}function H(){E&&("function"==typeof cancelAnimationFrame?cancelAnimationFrame(E):clearTimeout(E),E=0)}function P(){const e=b.value;e&&(z.forEach((t,i)=>e.off(i,t)),z.clear(),function(){const e=/* @__PURE__ */new Map;return Object.entries(m.events).forEach(([t,i])=>e.set(t.toLowerCase(),i)),Object.entries(w).forEach(([t,i])=>{const o=function(e){if(e.startsWith("on")&&!(e.length<=2))return e.slice(2).toLowerCase()}(t);o&&"function"==typeof i&&e.set(o,i)}),e}().forEach((t,i)=>{e.on(i,t),z.set(i,t)}))}function W(){R.value?.render.graphs.forEach(e=>e.animationEnd()),R.value=void 0,z.clear(),b.value?.dispose(),b.value=void 0,y.value?.replaceChildren()}function M(e){const t=b.value;t&&F()?(m.setOptionOptions?t.setOption(e,m.setOptionOptions):t.setOption(e),D=!1):D=!0}function U(e,t=!0){R.value&&F()?(R.value.setOption(e,t),T=!1):T=!0}function k(){const e=y.value,t=F();if(!e||!t)return;if(W(),_.value){const t=new O(e);return R.value=t,t.setOption(m.config??{}),void(T=!1)}const i={...m.initOptions,height:m.initOptions?.height??t.height,width:m.initOptions?.width??t.width},o=h.init(e,m.theme,i);b.value=o,m.group&&(o.group=m.group),M(m.option),P(),m.loading&&o.showLoading(m.loadingType,m.loadingOptions)}function I(e){H();const t=()=>{E=0;const t=F();t&&(R.value||b.value?(R.value?R.value.resize():b.value?.resize({...e,height:e?.height??t.height,width:e?.width??t.width}),F()&&(R.value&&T&&void 0!==m.config&&U(m.config),b.value&&D&&M(m.option))):k())};E="function"==typeof requestAnimationFrame?requestAnimationFrame(t):setTimeout(t,16)}function q(){F()&&(R.value||b.value?I():k())}function B(){if(!m.autoResize)return;const e=L.value;if(e&&"undefined"!=typeof ResizeObserver)return C=new ResizeObserver(q),void C.observe(e);"undefined"==typeof window||A||(window.addEventListener("resize",q,{passive:!0}),A=!0)}function N(){C?.disconnect(),C=void 0,A&&"undefined"!=typeof window&&(window.removeEventListener("resize",q),A=!1)}return c(()=>m.config,e=>{void 0!==e&&U(e)},{deep:!1}),c(()=>m.option,e=>{_.value||M(e)},{deep:!1}),c(_,()=>{n(k)}),c(()=>m.group,e=>{b.value&&(b.value.group=e??"")}),f(()=>{Object.keys(w),m.events,P()}),c(()=>m.loading,e=>{const t=b.value;t&&F()&&(e?t.showLoading(m.loadingType,m.loadingOptions):t.hideLoading())}),c(()=>[m.theme,m.initOptions],()=>{_.value||n(k)},{deep:!1}),c(()=>m.autoResize,()=>{j&&(N(),B(),q())}),u(async()=>{j=!0,await n(),B(),k()}),l(()=>{j=!1,H(),N(),W()}),a({appendData:(...e)=>b.value?.appendData(...e),clear:()=>R.value?R.value.setOption({},!0):b.value?.clear(),containPixel:(...e)=>b.value?.containPixel(...e),convertFromPixel:(...e)=>b.value?.convertFromPixel(...e),convertToPixel:(...e)=>b.value?.convertToPixel(...e),dispatchAction:(...e)=>b.value?.dispatchAction(...e),dispose:W,getConnectedDataURL:(...e)=>b.value?.getConnectedDataURL(...e),getDataURL:(...e)=>b.value?.getDataURL(...e),getHeight:()=>R.value?y.value?.clientHeight:b.value?.getHeight(),getInstance:()=>R.value??b.value,getNativeInstance:()=>R.value,getOption:()=>R.value?.option??b.value?.getOption(),getWidth:()=>R.value?y.value?.clientWidth:b.value?.getWidth(),hideLoading:()=>b.value?.hideLoading(),off:(...e)=>b.value?.off(...e),on:(...e)=>b.value?.on(...e),resize:e=>I(e),setConfig:(e,t=!0)=>U(e,t),setOption:(e,t)=>{if(R.value)U(e,"boolean"!=typeof t||t);else if("object"==typeof t){if(!F())return void(D=!0);b.value?.setOption(e,t)}else M(e)},showLoading:(...e)=>b.value?.showLoading(...e)}),(e,t)=>(r(),i("div",{ref_key:"rootRef",ref:L,class:"lumal-charts",role:"img","aria-label":x.value,"data-renderer":_.value?"datav":"echarts"},[o("div",{ref_key:"chartHostRef",ref:y,class:"lumal-charts__host"},null,512)],8,g))}}),[["__scopeId","data-v-380913b5"]]);export{m as t};
@@ -0,0 +1 @@
1
+ const e=require("./useElementSize-CZjD5sCp.cjs"),l=require("./_plugin-vue_export-helper-BXystuG9.cjs");let t=require("vue");var a=["aria-label"],o=["width","height"],i=["d","fill"],u=["fill","x","y"],n=["xlink:href","width","height","x","y"],r=["fill","x","y"],c=(0,t.defineComponent)({__name:"LumalConicalColumnChart",props:{items:{default:void 0},config:{default:()=>({})},max:{default:void 0},unit:{default:""},sort:{type:[Boolean,String],default:"desc"},showValue:{type:Boolean,default:void 0},images:{default:void 0},imageSideLength:{default:void 0},fontSize:{default:void 0},columnColor:{default:void 0},textColor:{default:void 0},ariaLabel:{default:"锥形柱图"}},setup(l){const c=l,m=(0,t.useTemplateRef)("rootRef"),d=e.useElementSize(m);function f(e,l=0){return Number.isFinite(e)?Math.max(0,e):l}const v=(0,t.computed)(()=>void 0!==c.items?c.items.map(e=>({...e,value:f(e.value)})):(c.config.data??[]).map((e,l)=>({key:e.name?`${e.name}-${l}`:l,label:e.name,value:f(e.value)}))),h=(0,t.computed)(()=>c.sort?[...v.value].sort((e,l)=>"asc"===c.sort?e.value-l.value:l.value-e.value):v.value),p=(0,t.computed)(()=>c.images??c.config.img??[]),g=(0,t.computed)(()=>f(c.imageSideLength??c.config.imgSideLength??30,30)),s=(0,t.computed)(()=>f(c.fontSize??c.config.fontSize??12,12)),x=(0,t.computed)(()=>c.columnColor??c.config.columnColor??"rgba(0, 194, 255, 0.4)"),y=(0,t.computed)(()=>c.textColor??c.config.textColor??"#fff"),k=(0,t.computed)(()=>c.showValue??c.config.showValue??!1),$=(0,t.computed)(()=>{const e=h.value,l=e.length?Math.max(...e.map(e=>e.value)):0,t=f(c.max??0),a=Math.max(l,t,1),o=d.value.width/(e.length+1),i=Math.max(0,d.value.height-s.value-5),u=Math.max(0,i-g.value);return e.map((e,l)=>{const t=e.value/a,n=o*(l+1),r=o*l,m=i-u*t,d=u*t*.6+m,f=[`M${r}, ${i}`,`Q${n}, ${d} ${n},${m}`,`M${n},${m}`,`Q${n}, ${d} ${o*(l+2)},${i}`,`L${r}, ${i}`,"Z"].join(" ");return{...e,d:f,fill:void 0!==c.items?e.color??x.value:x.value,percent:t,textY:(i+m)/2+s.value/2,x:n,y:m}})});return(e,c)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{ref_key:"rootRef",ref:m,class:"dv-conical-column-chart",role:"img","aria-label":l.ariaLabel},[((0,t.openBlock)(),(0,t.createElementBlock)("svg",{width:(0,t.unref)(d).width,height:(0,t.unref)(d).height,"aria-hidden":"true"},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)($.value,(e,a)=>((0,t.openBlock)(),(0,t.createElementBlock)("g",{key:e.key},[(0,t.createElementVNode)("path",{d:e.d,fill:e.fill},null,8,i),(0,t.createElementVNode)("text",{style:(0,t.normalizeStyle)({fontSize:`${s.value}px`}),fill:y.value,x:e.x,y:(0,t.unref)(d).height-4},(0,t.toDisplayString)(e.label),13,u),p.value.length?((0,t.openBlock)(),(0,t.createElementBlock)("image",{key:0,"xlink:href":p.value[a%p.value.length],width:g.value,height:g.value,x:e.x-g.value/2,y:e.y-g.value},null,8,n)):(0,t.createCommentVNode)("",!0),k.value?((0,t.openBlock)(),(0,t.createElementBlock)("text",{key:1,style:(0,t.normalizeStyle)({fontSize:`${s.value}px`}),fill:y.value,x:e.x,y:e.textY},(0,t.toDisplayString)(e.value)+(0,t.toDisplayString)(l.unit),13,r)):(0,t.createCommentVNode)("",!0)]))),128))],8,o))],8,a))}}),m=l._plugin_vue_export_helper_default(c,[["__scopeId","data-v-c78a8338"]]);Object.defineProperty(exports,"LumalConicalColumnChart_default",{enumerable:!0,get:function(){return m}});
@@ -0,0 +1 @@
1
+ import{t as e}from"./useElementSize-CKA7EtNB.js";import{t as l}from"./_plugin-vue_export-helper-DgLP3hnZ.js";import{Fragment as a,computed as t,createCommentVNode as i,createElementBlock as o,createElementVNode as u,defineComponent as n,normalizeStyle as v,openBlock as r,renderList as f,toDisplayString as d,unref as h,useTemplateRef as m}from"vue";var g=["aria-label"],s=["width","height"],x=["d","fill"],c=["fill","x","y"],p=["xlink:href","width","height","x","y"],y=["fill","x","y"],$=/*#__PURE__*/l(/*@__PURE__*/n({__name:"LumalConicalColumnChart",props:{items:{default:void 0},config:{default:()=>({})},max:{default:void 0},unit:{default:""},sort:{type:[Boolean,String],default:"desc"},showValue:{type:Boolean,default:void 0},images:{default:void 0},imageSideLength:{default:void 0},fontSize:{default:void 0},columnColor:{default:void 0},textColor:{default:void 0},ariaLabel:{default:"锥形柱图"}},setup(l){const n=l,$=m("rootRef"),S=e($);function w(e,l=0){return Number.isFinite(e)?Math.max(0,e):l}const C=t(()=>void 0!==n.items?n.items.map(e=>({...e,value:w(e.value)})):(n.config.data??[]).map((e,l)=>({key:e.name?`${e.name}-${l}`:l,label:e.name,value:w(e.value)}))),b=t(()=>n.sort?[...C.value].sort((e,l)=>"asc"===n.sort?e.value-l.value:l.value-e.value):C.value),k=t(()=>n.images??n.config.img??[]),L=t(()=>w(n.imageSideLength??n.config.imgSideLength??30,30)),M=t(()=>w(n.fontSize??n.config.fontSize??12,12)),_=t(()=>n.columnColor??n.config.columnColor??"rgba(0, 194, 255, 0.4)"),z=t(()=>n.textColor??n.config.textColor??"#fff"),j=t(()=>n.showValue??n.config.showValue??!1),V=t(()=>{const e=b.value,l=e.length?Math.max(...e.map(e=>e.value)):0,a=w(n.max??0),t=Math.max(l,a,1),i=S.value.width/(e.length+1),o=Math.max(0,S.value.height-M.value-5),u=Math.max(0,o-L.value);return e.map((e,l)=>{const a=e.value/t,v=i*(l+1),r=i*l,f=o-u*a,d=u*a*.6+f,h=[`M${r}, ${o}`,`Q${v}, ${d} ${v},${f}`,`M${v},${f}`,`Q${v}, ${d} ${i*(l+2)},${o}`,`L${r}, ${o}`,"Z"].join(" ");return{...e,d:h,fill:void 0!==n.items?e.color??_.value:_.value,percent:a,textY:(o+f)/2+M.value/2,x:v,y:f}})});return(e,t)=>(r(),o("div",{ref_key:"rootRef",ref:$,class:"dv-conical-column-chart",role:"img","aria-label":l.ariaLabel},[(r(),o("svg",{width:h(S).width,height:h(S).height,"aria-hidden":"true"},[(r(!0),o(a,null,f(V.value,(e,a)=>(r(),o("g",{key:e.key},[u("path",{d:e.d,fill:e.fill},null,8,x),u("text",{style:v({fontSize:`${M.value}px`}),fill:z.value,x:e.x,y:h(S).height-4},d(e.label),13,c),k.value.length?(r(),o("image",{key:0,"xlink:href":k.value[a%k.value.length],width:L.value,height:L.value,x:e.x-L.value/2,y:e.y-L.value},null,8,p)):i("",!0),j.value?(r(),o("text",{key:1,style:v({fontSize:`${M.value}px`}),fill:z.value,x:e.x,y:e.textY},d(e.value)+d(l.unit),13,y)):i("",!0)]))),128))],8,s))],8,g))}}),[["__scopeId","data-v-c78a8338"]]);export{$ as t};
@@ -1 +1 @@
1
- const e=require("./useElementSize-CZjD5sCp.cjs"),a=require("./useAnimationPause-DP4oaEoq.cjs"),t=require("./utils-W5S-hj72.cjs");let l=require("vue");var n={1:["#fff","#0de7c2"],2:["#3faacb","#fff"],3:["#7acaec","transparent"],4:["rgba(255, 255, 255, 0.3)","rgba(255, 255, 255, 0.3)"],5:["#3f96a5","#3f96a5"],6:["#7acaec","#7acaec"],7:["#1dc1f5","#1dc1f5"],8:["#3f96a5","#3f96a5"],9:["rgba(3, 166, 224, 0.8)","rgba(3, 166, 224, 0.5)"],10:["#00c2ff","rgba(0, 194, 255, 0.3)"],11:["#1a98fc","#2cf7fe"],12:["#2783ce","#2cf7fe"]},r={1:2e3,2:6e3,3:1500,4:3e3,5:1200,6:2e3,7:2800,8:2800,9:3e3,10:3e3,11:2800,12:3e3},o=0;function u(e,a,t,l){const n=e/(l+1),r=a/(t+1);return Array.from({length:t*l},(e,a)=>{const t=Math.floor(a/l);return[n*(a%l+1),r*(t+1)]})}var i=u(200,50,4,20),c=[i[39]??[0,0],i[37]??[0,0]];function s(e,a){const t=Math.min(100,Math.max(0,a))/100,l=e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(l){const e=3===l.length?l.split("").map(e=>`${e}${e}`).join(""):l;return`rgba(${Number.parseInt(e.slice(0,2),16)}, ${Number.parseInt(e.slice(2,4),16)}, ${Number.parseInt(e.slice(4,6),16)}, ${t})`}const n=e.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return n?`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})`:"transparent"===e.trim().toLowerCase()?"transparent":`color-mix(in srgb, ${e} ${a}%, transparent)`}function d(e){return e.slice(1).reduce((a,t,l)=>{const n=e[l];return n?a+Math.hypot(t[0]-n[0],t[1]-n[1]):a},0)}function v(e,a,t,l){return[e+Math.cos(l)*t,a+Math.sin(l)*t]}var m=["data-variant"],k={key:0,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 200 50"},p=["fill","x","y"],f=["begin","dur","values"],h=["fill","x","y"],y=["dur","values"],$=["dur","values"],g=["dur","values"],B=["dur","values"],N=["fill","x","y"],E=["dur","values"],b=["dur","values"],V=["height","width"],w=["fill","height","width","x","y"],x=["attributeName","dur","to"],C=["fill","x","y"],_=["attributeName","dur","to"],M={key:2,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},S=["fill","x","y"],z=["begin","dur","values"],A=["height","width"],j=["points","stroke"],T=["points","stroke"],L=["height","width"],F=["points","stroke"],q=["dur","from","to"],P=["points","stroke"],R=["dur","from","to"],I={key:5,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},D=["fill","height","x","y"],H=["dur","values"],G=["dur","values"],O={key:6,class:"lumal-decoration__chevrons"},U={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},J=["stroke"],K=["stroke"],Q={class:"lumal-decoration__content lumal-decoration__content--inline"},W={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},X=["stroke"],Y=["stroke"],Z=["height","width"],ee=["points","stroke"],ae=["points","stroke"],te=["points","stroke"],le={key:8,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 100 100"},ne=["stroke"],re=["dur","values"],oe=["stroke"],ue=["dur","values"],ie=["stroke"],ce=["fill","href","stroke"],se=["begin","dur","values"],de=["stroke"],ve=["height","width"],me=["points","stroke"],ke=["points","stroke","stroke-dasharray"],pe=["id","begin","dur","values"],fe=["begin","values"],he=["points","stroke","stroke-dasharray"],ye=["id","begin","dur","values"],$e=["begin","values"],ge=["points","stroke","stroke-dasharray"],Be=["id","begin","dur","values"],Ne=["begin","values"],Ee=["cx","cy","fill"],be=["id","begin","dur","values"],Ve=["cx","cy","fill"],we=["id","begin","dur","values"],xe=["begin","values"],Ce=["cx","cy","fill"],_e=["id","begin","dur","values"],Me=["begin","values"],Se=["cx","cy","fill"],ze=["id","begin","dur","values"],Ae=["begin","values"],je=["height","width"],Te=["fill","stroke"],Le=["fill","points","stroke"],Fe=["fill","points","stroke"],qe=["fill","points","stroke"],Pe=["fill","points","stroke"],Re=["points","stroke"],Ie=["points","stroke"],De=["height","width"],He=["d","stroke","stroke-width"],Ge=["stop-color"],Oe=["cx","cy","r","stroke"],Ue=["cx","cy","fill"],Je=["dur","values"],Ke=["dur"],Qe=["cx","cy","fill"],We=["points","stroke"],Xe=["d","stroke"],Ye=["href"],Ze=["dur","values"],ea=(0,l.defineComponent)({__name:"LumalDecoration",props:{variant:{default:1},color:{default:void 0},colors:{default:void 0},background:{default:void 0},dur:{default:void 0},duration:{default:void 0},haloDur:{default:void 0},reverse:{type:Boolean,default:!1},scanDur:{default:void 0}},setup(ea){const aa=i.filter(()=>Math.random()>.6).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:1,point:e})),ta=u(300,35,2,25).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:Math.random()+1,point:e})),la=u(300,35,1,40).map(e=>{const a=Math.random()>.8,t=a?24.5:7,l=Math.trunc(Math.random()*((a?35:17.5)-t+1)+t);return{colorIndex:Math.random()>.5?0:1,durationSeconds:Math.random()+1.5,height:l,minHeight:l*Math.random(),point:e}}),na=Array.from({length:20},()=>Math.random()<=.4),ra=ea,oa=(0,l.useTemplateRef)("animationRef"),ua=e.useElementSize(oa),ia=a.useAnimationPause(oa),ca=(0,l.shallowRef)(!1),sa=(0,l.shallowRef)(!1),da=(0,l.shallowRef)(!1);let va;const ma=(0,l.computed)(()=>ua.value.width),ka=(0,l.computed)(()=>ua.value.height),pa=(0,l.computed)(()=>{const e=n[ra.variant],a=ra.color??ra.colors;return[a?.[0]??e[0],a?.[1]??e[1]]}),fa=(0,l.computed)(()=>12===ra.variant?ra.scanDur:ra.dur),ha=(0,l.computed)(()=>{const e=void 0===fa.value?ra.duration:1e3*fa.value;return Math.max(0,e??r[ra.variant])}),ya=(0,l.computed)(()=>ha.value/r[ra.variant]),$a=(0,l.computed)(()=>ha.value>0),ga=(0,l.computed)(()=>{const e=ra.haloDur??2*ya.value;return`${Number(Math.max(.001,e).toFixed(6))}s`}),Ba=(0,l.computed)(()=>ia.value||ca.value||sa.value||da.value||!$a.value),Na=(0,l.computed)(()=>t.colorStyle(pa.value,ra.background,ha.value)),Ea=(ba=(0,l.useId)(),o+=1,`lumal-decoration-${ba.replace(/[^\w-]/g,"")}-${o}`);var ba;const Va=`${Ea}-polygon`,wa=`${Ea}-radar-group`,xa=`${Ea}-radar-gradient`,Ca=[`${Ea}-sequence-1`,`${Ea}-sequence-2`,`${Ea}-sequence-3`,`${Ea}-sequence-4`,`${Ea}-sequence-5`,`${Ea}-sequence-6`,`${Ea}-sequence-7`],_a=(0,l.computed)(()=>[[0,.2*ka.value],[.18*ma.value,.2*ka.value],[.2*ma.value,.4*ka.value],[.25*ma.value,.4*ka.value],[.27*ma.value,.6*ka.value],[.72*ma.value,.6*ka.value],[.75*ma.value,.4*ka.value],[.8*ma.value,.4*ka.value],[.82*ma.value,.2*ka.value],[ma.value,.2*ka.value]]),Ma=(0,l.computed)(()=>[[.3*ma.value,.8*ka.value],[.7*ma.value,.8*ka.value]]),Sa=(0,l.computed)(()=>_a.value.map(e=>e.join(",")).join(" ")),za=(0,l.computed)(()=>Ma.value.map(e=>e.join(",")).join(" ")),Aa=(0,l.computed)(()=>d(_a.value)),ja=(0,l.computed)(()=>d(Ma.value)),Ta=(0,l.computed)(()=>function(e,a){const t=e/2,l=a/2,n=Math.PI/3,r=e/4,o=-Math.PI/2,u=n/30;let i=v(t,l,r,o);const c=Array.from({length:30},(e,a)=>{const n=v(t,l,r,o-(a+1)*u).map(e=>e.toFixed(5)),c=`M${i.join(",")} A${r}, ${r} 0 0 0 ${n.join(",")}`;return i=[Number(n[0]),Number(n[1])],c}),s=Math.max(0,e/2-.5)/3,d=Array.from({length:3},(e,a)=>s*(a+1)),m=Math.PI/6,k=e/2,p=Array.from({length:6},(e,a)=>{const n=m*(a+1),r=v(t,l,k,n),o=v(t,l,k,n+Math.PI);return`${r.join(",")} ${o.join(",")}`}),f=Math.max(0,e/2-1);return{arcPaths:Array.from({length:4},(e,a)=>{const n=m*(3*a+1),r=v(t,l,f,n),o=v(t,l,f,n+m);return`M${r.join(",")} A${t}, ${l} 0 0 1 ${o.join(",")}`}),circleRadii:d,scanPaths:c,splitLines:p}}(ma.value,ka.value)),La=(0,l.computed)(()=>Ta.value.scanPaths.map((e,a,t)=>s(pa.value[0],100-100*a/(t.length-1))));function Fa(e){const a=Math.max(.001,e*ya.value);return`${Number(a.toFixed(6))}s`}function qa(e,a=!0){const t=e.map(String);return(ra.reverse&&a?t.reverse():t).join(";")}function Pa(e){return ra.reverse?ma.value-e:e}function Ra(e){da.value=e.matches}function Ia(){return Array.from(oa.value?.querySelectorAll("svg")??[])}function Da(){for(const e of Ia())Ba.value?e.pauseAnimations?.():e.unpauseAnimations?.()}function Ha(){for(const e of Ia())e.setCurrentTime?.(0);Da()}function Ga(e){const a=e.relatedTarget;sa.value=Boolean(a&&oa.value?.contains(a))}return(0,l.watch)(Ba,()=>{(0,l.nextTick)(Da)},{immediate:!0}),(0,l.watch)(()=>[ra.variant,ra.reverse,ra.color,ra.colors,ra.dur,ra.duration,ra.haloDur,ra.scanDur],()=>{(0,l.nextTick)(Ha)},{flush:"post"}),(0,l.onMounted)(()=>{"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(va=window.matchMedia("(prefers-reduced-motion: reduce)"),Ra(va),va.addEventListener?.("change",Ra)),(0,l.nextTick)(Da)}),(0,l.onBeforeUnmount)(()=>{va?.removeEventListener?.("change",Ra)}),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("div",{ref_key:"animationRef",ref:oa,class:(0,l.normalizeClass)(["lumal-decoration",{"is-animation-paused":Ba.value,"is-reverse":ea.reverse}]),"data-variant":ea.variant,style:(0,l.normalizeStyle)(Na.value),onMouseenter:a[0]||(a[0]=e=>ca.value=!0),onMouseleave:a[1]||(a[1]=e=>ca.value=!1),onFocusin:a[2]||(a[2]=e=>sa.value=!0),onFocusout:Ga},[1===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",k,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(aa),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("rect",{key:a,class:"lumal-decoration__mark",fill:pa.value[0],height:2.5,width:2.5,x:e.point[0]-1.25,y:e.point[1]-1.25},[e.animated&&$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:Fa(e.durationSeconds),repeatCount:"indefinite",values:qa([pa.value[0],"transparent"])},null,8,f)):(0,l.createCommentVNode)("",!0)],8,p))),128)),(0,l.createElementVNode)("rect",{fill:pa.value[1],height:5,width:5,x:(0,l.unref)(c)[0][0]-2.5,y:(0,l.unref)(c)[0][1]-2.5},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"width",dur:Fa(2),repeatCount:"indefinite",values:qa([0,5])},null,8,y)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"height",dur:Fa(2),repeatCount:"indefinite",values:qa([0,5])},null,8,$)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:2,attributeName:"x",dur:Fa(2),repeatCount:"indefinite",values:qa([(0,l.unref)(c)[0][0],(0,l.unref)(c)[0][0]-2.5])},null,8,g)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:3,attributeName:"y",dur:Fa(2),repeatCount:"indefinite",values:qa([(0,l.unref)(c)[0][1],(0,l.unref)(c)[0][1]-2.5])},null,8,B)):(0,l.createCommentVNode)("",!0)],8,h),(0,l.createElementVNode)("rect",{fill:pa.value[1],height:5,width:40,x:(0,l.unref)(c)[1][0]-40,y:(0,l.unref)(c)[1][1]-2.5},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"width",dur:Fa(2),repeatCount:"indefinite",values:qa([0,40,0])},null,8,E)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"x",dur:Fa(2),repeatCount:"indefinite",values:qa([(0,l.unref)(c)[1][0],(0,l.unref)(c)[1][0]-40,(0,l.unref)(c)[1][0]])},null,8,b)):(0,l.createCommentVNode)("",!0)],8,N)])):2===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:1,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("rect",{fill:pa.value[0],height:ea.reverse?ka.value:1,width:ea.reverse?1:ma.value,x:ea.reverse?ma.value/2:0,y:ea.reverse?0:ka.value/2},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:ea.reverse?"height":"width",calcMode:"spline",dur:Fa(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:ea.reverse?ka.value:ma.value},null,8,x)):(0,l.createCommentVNode)("",!0)],8,w),(0,l.createElementVNode)("rect",{fill:pa.value[1],height:"1",width:"1",x:ea.reverse?ma.value/2:0,y:ea.reverse?0:ka.value/2},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:ea.reverse?"y":"x",calcMode:"spline",dur:Fa(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:ea.reverse?ka.value:ma.value},null,8,_)):(0,l.createCommentVNode)("",!0)],8,C)],8,V)):3===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",M,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(ta),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("rect",{key:a,class:"lumal-decoration__mark",fill:pa.value[0],height:"7",width:"7",x:e.point[0]-3.5,y:e.point[1]-3.5},[e.animated&&$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:Fa(e.durationSeconds),repeatCount:"indefinite",values:qa(pa.value)},null,8,z)):(0,l.createCommentVNode)("",!0)],8,S))),128))])):4===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:3,class:(0,l.normalizeClass)(["lumal-decoration__line-reveal",[ea.reverse?"lumal-decoration__line-reveal--horizontal":"lumal-decoration__line-reveal--vertical",{"is-static":!$a.value}]]),style:(0,l.normalizeStyle)({animationDuration:ha.value/1e3+"s",height:ea.reverse?"5px":`${ka.value}px`,width:ea.reverse?`${ma.value}px`:"5px"})},[((0,l.openBlock)(),(0,l.createElementBlock)("svg",{"aria-hidden":"true",focusable:"false",height:ea.reverse?5:ka.value,width:ea.reverse?ma.value:5},[(0,l.createElementVNode)("polyline",{points:ea.reverse?`0,2.5 ${ma.value},2.5`:`2.5,0 2.5,${ka.value}`,stroke:pa.value[0]},null,8,j),(0,l.createElementVNode)("polyline",{points:ea.reverse?`0,2.5 ${ma.value},2.5`:`2.5,0 2.5,${ka.value}`,stroke:pa.value[1],"stroke-dasharray":"20,80","stroke-dashoffset":"-30","stroke-width":"3"},null,8,T)],8,A))],6)):5===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:4,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polyline",{fill:"transparent",points:Sa.value,stroke:pa.value[0],"stroke-width":"3"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:Fa(1.2),from:`0, ${Aa.value/2}, 0, ${Aa.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${Aa.value}, 0`},null,8,q)):(0,l.createCommentVNode)("",!0)],8,F),(0,l.createElementVNode)("polyline",{fill:"transparent",points:za.value,stroke:pa.value[1],"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:Fa(1.2),from:`0, ${ja.value/2}, 0, ${ja.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${ja.value}, 0`},null,8,R)):(0,l.createCommentVNode)("",!0)],8,P)],8,L)):6===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",I,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(la),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("rect",{key:a,class:"lumal-decoration__bar",fill:pa.value[e.colorIndex],height:e.height,width:"7",x:e.point[0]-3.5,y:e.point[1]-e.height/2},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"y",begin:"0s",calcMode:"spline",dur:Fa(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:qa([e.point[1]-e.minHeight/2,e.point[1]-e.height/2,e.point[1]-e.minHeight/2])},null,8,H)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"height",begin:"0s",calcMode:"spline",dur:Fa(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:qa([e.minHeight,e.height,e.minHeight])},null,8,G)):(0,l.createCommentVNode)("",!0)],8,D))),128))])):7===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("div",O,[((0,l.openBlock)(),(0,l.createElementBlock)("svg",U,[(0,l.createElementVNode)("polyline",{fill:"transparent",points:"10,0 19,10 10,20",stroke:pa.value[0],"stroke-width":"4"},null,8,J),(0,l.createElementVNode)("polyline",{fill:"transparent",points:"2,0 11,10 2,20",stroke:pa.value[1],"stroke-width":"2"},null,8,K)])),(0,l.createElementVNode)("div",Q,[(0,l.renderSlot)(e.$slots,"default")]),((0,l.openBlock)(),(0,l.createElementBlock)("svg",W,[(0,l.createElementVNode)("polyline",{fill:"transparent",points:"11,0 2,10 11,20",stroke:pa.value[0],"stroke-width":"4"},null,8,X),(0,l.createElementVNode)("polyline",{fill:"transparent",points:"19,0 10,10 19,20",stroke:pa.value[1],"stroke-width":"2"},null,8,Y)]))])):8===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:7,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(0)},0 ${Pa(30)},${ka.value/2}`,stroke:pa.value[0],"stroke-width":"2"},null,8,ee),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(20)},0 ${Pa(50)},${ka.value/2} ${Pa(ma.value)},${ka.value/2}`,stroke:pa.value[0],"stroke-width":"2"},null,8,ae),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(0)},${ka.value-3} ${Pa(200)},${ka.value-3}`,stroke:pa.value[1],"stroke-width":"3"},null,8,te)],8,Z)):9===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",le,[(0,l.createElementVNode)("defs",null,[(0,l.createElementVNode)("polygon",{id:Va,points:"15,46.5 21,47.5 21,52.5 15,53.5"})]),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"80,100,30,100",stroke:pa.value[1],"stroke-width":"10"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,re)):(0,l.createCommentVNode)("",!0)],8,ne),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"50,66,100,66",stroke:pa.value[0],"stroke-width":"6"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?"0 50 50;360 50 50":"0 50 50;-360 50 50"},null,8,ue)):(0,l.createCommentVNode)("",!0)],8,oe),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"38","stroke-dasharray":"5,1",stroke:(0,l.unref)(s)(pa.value[1],30),"stroke-width":"1"},null,8,ie),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(na),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("use",{key:a,fill:e?pa.value[0]:"transparent",href:`#${Va}`,stroke:pa.value[1]},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",begin:a*ha.value/20/1e3+"s",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,se)):(0,l.createCommentVNode)("",!0)],8,ce))),128)),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"26","stroke-dasharray":"5,1",stroke:(0,l.unref)(s)(pa.value[1],30),"stroke-width":"1"},null,8,de)])):10===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:9,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(0)},${ka.value/2} ${Pa(ma.value)},${ka.value/2}`,stroke:pa.value[1],"stroke-width":"2"},null,8,me),(0,l.createElementVNode)("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${Pa(5)},${ka.value/2} ${Pa(.2*ma.value-3)},${ka.value/2}`,stroke:pa.value[0],"stroke-dasharray":"0,"+.2*ma.value,"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[1],attributeName:"stroke-dasharray",begin:`${Ca[0]}.end`,dur:Fa(3),fill:"freeze",values:`0,${.2*ma.value};${.2*ma.value},0`},null,8,pe)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ma.value},0;0,${.2*ma.value}`},null,8,fe)):(0,l.createCommentVNode)("",!0)],8,ke),(0,l.createElementVNode)("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${Pa(.2*ma.value+3)},${ka.value/2} ${Pa(.8*ma.value-3)},${ka.value/2}`,stroke:pa.value[0],"stroke-dasharray":"0,"+.6*ma.value,"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[3],attributeName:"stroke-dasharray",begin:`${Ca[2]}.end + ${Fa(1)}`,dur:Fa(3),fill:"freeze",values:`0,${.6*ma.value};${.6*ma.value},0`},null,8,ye)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.6*ma.value},0;0,${.6*ma.value}`},null,8,$e)):(0,l.createCommentVNode)("",!0)],8,he),(0,l.createElementVNode)("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${Pa(.8*ma.value+3)},${ka.value/2} ${Pa(ma.value-5)},${ka.value/2}`,stroke:pa.value[0],"stroke-dasharray":"0,"+.2*ma.value,"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[5],attributeName:"stroke-dasharray",begin:`${Ca[4]}.end + ${Fa(1)}`,dur:Fa(3),fill:"freeze",values:`0,${.2*ma.value};${.2*ma.value},0`},null,8,Be)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ma.value},0;0,${.3*ma.value}`},null,8,Ne)):(0,l.createCommentVNode)("",!0)],8,ge),(0,l.createElementVNode)("circle",{cx:Pa(2),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[0],attributeName:"fill",begin:`0s;${Ca[6]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,be)):(0,l.createCommentVNode)("",!0)],8,Ee),(0,l.createElementVNode)("circle",{cx:Pa(.2*ma.value),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[2],attributeName:"fill",begin:`${Ca[1]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,we)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"fill",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${pa.value[1]};${pa.value[1]}`},null,8,xe)):(0,l.createCommentVNode)("",!0)],8,Ve),(0,l.createElementVNode)("circle",{cx:Pa(.8*ma.value),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[4],attributeName:"fill",begin:`${Ca[3]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,_e)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"fill",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${pa.value[1]};${pa.value[1]}`},null,8,Me)):(0,l.createCommentVNode)("",!0)],8,Ce),(0,l.createElementVNode)("circle",{cx:Pa(ma.value-2),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[6],attributeName:"fill",begin:`${Ca[5]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,ze)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"fill",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${pa.value[1]};${pa.value[1]}`},null,8,Ae)):(0,l.createCommentVNode)("",!0)],8,Se)],8,ve)):11===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:10,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:"20 10,25 4,55 4,60 10",stroke:pa.value[1]},null,8,Te),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:`20 ${ka.value-10},25 ${ka.value-4},55 ${ka.value-4},60 ${ka.value-10}`,stroke:pa.value[1]},null,8,Le),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:`${ma.value-20} 10,${ma.value-25} 4,${ma.value-55} 4,${ma.value-60} 10`,stroke:pa.value[1]},null,8,Fe),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:`${ma.value-20} ${ka.value-10},${ma.value-25} ${ka.value-4},${ma.value-55} ${ka.value-4},${ma.value-60} ${ka.value-10}`,stroke:pa.value[1]},null,8,qe),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[0],20),points:`20 10,5 ${ka.value/2},20 ${ka.value-10},${ma.value-20} ${ka.value-10},${ma.value-5} ${ka.value/2},${ma.value-20} 10`,stroke:pa.value[0]},null,8,Pe),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`25 18,15 ${ka.value/2},25 ${ka.value-18}`,stroke:(0,l.unref)(s)(pa.value[0],70)},null,8,Re),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${ma.value-25} 18,${ma.value-15} ${ka.value/2},${ma.value-25} ${ka.value-18}`,stroke:(0,l.unref)(s)(pa.value[0],70)},null,8,Ie)],8,je)):((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:11,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("defs",null,[(0,l.createElementVNode)("g",{id:wa},[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.scanPaths,(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("path",{key:e,fill:"transparent",d:e,stroke:La.value[a],"stroke-width":ma.value/2},null,8,He))),128))]),(0,l.createElementVNode)("radialGradient",{id:xa,cx:"50%",cy:"50%",r:"50%"},[a[3]||(a[3]=(0,l.createElementVNode)("stop",{offset:"0%","stop-color":"transparent","stop-opacity":"1"},null,-1)),(0,l.createElementVNode)("stop",{offset:"100%","stop-color":(0,l.unref)(s)(pa.value[1],30),"stop-opacity":"1"},null,8,Ge)])]),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.circleRadii,e=>((0,l.openBlock)(),(0,l.createElementBlock)("circle",{key:e,cx:ma.value/2,cy:ka.value/2,fill:"transparent",r:e,stroke:pa.value[1],"stroke-width":"0.5"},null,8,Oe))),128)),(0,l.createElementVNode)("circle",{cx:ma.value/2,cy:ka.value/2,fill:`url(#${xa})`,r:"1",stroke:"transparent"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"r",dur:ga.value,repeatCount:"indefinite",values:"1;"+ma.value/2},null,8,Je)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"opacity",dur:ga.value,repeatCount:"indefinite",values:"1;0"},null,8,Ke)):(0,l.createCommentVNode)("",!0)],8,Ue),(0,l.createElementVNode)("circle",{cx:ma.value/2,cy:ka.value/2,fill:pa.value[1],r:"2"},null,8,Qe),(0,l.createElementVNode)("g",null,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.splitLines,e=>((0,l.openBlock)(),(0,l.createElementBlock)("polyline",{key:e,opacity:"0.5",points:e,stroke:pa.value[1],"stroke-width":"0.5"},null,8,We))),128))]),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.arcPaths,e=>((0,l.openBlock)(),(0,l.createElementBlock)("path",{key:e,fill:"transparent",d:e,stroke:pa.value[1],"stroke-width":"2"},null,8,Xe))),128)),(0,l.createElementVNode)("use",{href:`#${wa}`},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?`0,${ma.value/2} ${ka.value/2};-360,${ma.value/2} ${ka.value/2}`:`0,${ma.value/2} ${ka.value/2};360,${ma.value/2} ${ka.value/2}`},null,8,Ze)):(0,l.createCommentVNode)("",!0)],8,Ye)],8,De)),7!==ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:12,class:(0,l.normalizeClass)(["lumal-decoration__content",{"lumal-decoration__content--centered":9===ea.variant||11===ea.variant||12===ea.variant}])},[(0,l.renderSlot)(e.$slots,"default")],2)):(0,l.createCommentVNode)("",!0)],46,m))}});Object.defineProperty(exports,"LumalDecoration_default",{enumerable:!0,get:function(){return ea}});
1
+ const e=require("./useElementSize-CZjD5sCp.cjs"),a=require("./useAnimationPause-DP4oaEoq.cjs"),t=require("./utils-W5S-hj72.cjs");let l=require("vue");var n={1:["#fff","#0de7c2"],2:["#3faacb","#fff"],3:["#7acaec","transparent"],4:["rgba(255, 255, 255, 0.3)","rgba(255, 255, 255, 0.3)"],5:["#3f96a5","#3f96a5"],6:["#7acaec","#7acaec"],7:["#1dc1f5","#1dc1f5"],8:["#3f96a5","#3f96a5"],9:["rgba(3, 166, 224, 0.8)","rgba(3, 166, 224, 0.5)"],10:["#00c2ff","rgba(0, 194, 255, 0.3)"],11:["#1a98fc","#2cf7fe"],12:["#2783ce","#2cf7fe"]},r={1:2e3,2:6e3,3:1500,4:3e3,5:1200,6:2e3,7:2800,8:2800,9:3e3,10:3e3,11:2800,12:3e3},o=0;function u(e,a,t,l){const n=e/(l+1),r=a/(t+1);return Array.from({length:t*l},(e,a)=>{const t=Math.floor(a/l);return[n*(a%l+1),r*(t+1)]})}var i=u(200,50,4,20),c=[i[39]??[0,0],i[37]??[0,0]];function s(e,a){const t=Math.min(100,Math.max(0,a))/100,l=e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(l){const e=3===l.length?l.split("").map(e=>`${e}${e}`).join(""):l;return`rgba(${Number.parseInt(e.slice(0,2),16)}, ${Number.parseInt(e.slice(2,4),16)}, ${Number.parseInt(e.slice(4,6),16)}, ${t})`}const n=e.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return n?`rgba(${n[1]}, ${n[2]}, ${n[3]}, ${t})`:"transparent"===e.trim().toLowerCase()?"transparent":`color-mix(in srgb, ${e} ${a}%, transparent)`}function d(e){return e.slice(1).reduce((a,t,l)=>{const n=e[l];return n?a+Math.hypot(t[0]-n[0],t[1]-n[1]):a},0)}function v(e,a,t,l){return[e+Math.cos(l)*t,a+Math.sin(l)*t]}var m=["data-variant"],k={key:0,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 200 50"},p=["fill","x","y"],f=["begin","dur","values"],h=["fill","x","y"],y=["dur","values"],$=["dur","values"],g=["dur","values"],B=["dur","values"],N=["fill","x","y"],E=["dur","values"],b=["dur","values"],V=["height","width"],w=["fill","height","width","x","y"],x=["attributeName","dur","to"],C=["fill","x","y"],_=["attributeName","dur","to"],M={key:2,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},S=["fill","x","y"],z=["begin","dur","values"],A=["height","width"],j=["points","stroke"],T=["points","stroke"],L=["height","width"],F=["points","stroke"],q=["dur","from","to"],P=["points","stroke"],R=["dur","from","to"],I={key:5,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},D=["fill","height","x","y"],H=["dur","values"],G=["dur","values"],O={key:6,class:"lumal-decoration__chevrons"},U={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},J=["stroke"],K=["stroke"],Q={class:"lumal-decoration__content lumal-decoration__content--inline"},W={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},X=["stroke"],Y=["stroke"],Z=["height","width"],ee=["points","stroke"],ae=["points","stroke"],te=["points","stroke"],le={key:8,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 100 100"},ne=["stroke"],re=["dur","values"],oe=["stroke"],ue=["dur","values"],ie=["stroke"],ce=["fill","href","stroke"],se=["begin","dur","values"],de=["stroke"],ve=["height","width"],me=["points","stroke"],ke=["points","stroke","stroke-dasharray"],pe=["id","begin","dur","values"],fe=["begin","values"],he=["points","stroke","stroke-dasharray"],ye=["id","begin","dur","values"],$e=["begin","values"],ge=["points","stroke","stroke-dasharray"],Be=["id","begin","dur","values"],Ne=["begin","values"],Ee=["cx","cy","fill"],be=["id","begin","dur","values"],Ve=["cx","cy","fill"],we=["id","begin","dur","values"],xe=["begin","values"],Ce=["cx","cy","fill"],_e=["id","begin","dur","values"],Me=["begin","values"],Se=["cx","cy","fill"],ze=["id","begin","dur","values"],Ae=["begin","values"],je=["height","width"],Te=["fill","stroke"],Le=["fill","points","stroke"],Fe=["fill","points","stroke"],qe=["fill","points","stroke"],Pe=["fill","points","stroke"],Re=["points","stroke"],Ie=["points","stroke"],De=["height","width"],He=["d","stroke","stroke-width"],Ge=["stop-color"],Oe=["cx","cy","r","stroke"],Ue=["cx","cy","fill"],Je=["dur","values"],Ke=["dur"],Qe=["cx","cy","fill"],We=["points","stroke"],Xe=["d","stroke"],Ye=["href"],Ze=["dur","values"],ea=(0,l.defineComponent)({__name:"LumalDecoration",props:{variant:{default:1},color:{default:void 0},colors:{default:void 0},background:{default:void 0},dur:{default:void 0},duration:{default:void 0},haloDur:{default:void 0},reverse:{type:Boolean,default:!1},scanDur:{default:void 0}},setup(ea){const aa=ea,ta=i.filter(()=>Math.random()>.6).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:1,point:e})),la=u(300,35,2,25).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:Math.random()+1,point:e})),na=u(300,35,1,40).map(e=>{const a=Math.random()>.8,t=a?24.5:7,l=Math.trunc(Math.random()*((a?35:17.5)-t+1)+t);return{colorIndex:Math.random()>.5?0:1,durationSeconds:Math.random()+1.5,height:l,minHeight:l*Math.random(),point:e}}),ra=Array.from({length:20},()=>Math.random()<=.4),oa=(0,l.useTemplateRef)("animationRef"),ua=e.useElementSize(oa),ia=a.useAnimationPause(oa),ca=(0,l.shallowRef)(!1),sa=(0,l.shallowRef)(!1),da=(0,l.shallowRef)(!1);let va;const ma=(0,l.computed)(()=>ua.value.width),ka=(0,l.computed)(()=>ua.value.height),pa=(0,l.computed)(()=>{const e=n[aa.variant],a=aa.color??aa.colors;return[a?.[0]??e[0],a?.[1]??e[1]]}),fa=(0,l.computed)(()=>12===aa.variant?aa.scanDur:aa.dur),ha=(0,l.computed)(()=>{const e=void 0===fa.value?aa.duration:1e3*fa.value;return Math.max(0,e??r[aa.variant])}),ya=(0,l.computed)(()=>ha.value/r[aa.variant]),$a=(0,l.computed)(()=>ha.value>0),ga=(0,l.computed)(()=>{const e=aa.haloDur??2*ya.value;return`${Number(Math.max(.001,e).toFixed(6))}s`}),Ba=(0,l.computed)(()=>ia.value||ca.value||sa.value||da.value||!$a.value),Na=(0,l.computed)(()=>t.colorStyle(pa.value,aa.background,ha.value)),Ea=(ba=(0,l.useId)(),o+=1,`lumal-decoration-${ba.replace(/[^\w-]/g,"")}-${o}`);var ba;const Va=`${Ea}-polygon`,wa=`${Ea}-radar-group`,xa=`${Ea}-radar-gradient`,Ca=[`${Ea}-sequence-1`,`${Ea}-sequence-2`,`${Ea}-sequence-3`,`${Ea}-sequence-4`,`${Ea}-sequence-5`,`${Ea}-sequence-6`,`${Ea}-sequence-7`],_a=(0,l.computed)(()=>[[0,.2*ka.value],[.18*ma.value,.2*ka.value],[.2*ma.value,.4*ka.value],[.25*ma.value,.4*ka.value],[.27*ma.value,.6*ka.value],[.72*ma.value,.6*ka.value],[.75*ma.value,.4*ka.value],[.8*ma.value,.4*ka.value],[.82*ma.value,.2*ka.value],[ma.value,.2*ka.value]]),Ma=(0,l.computed)(()=>[[.3*ma.value,.8*ka.value],[.7*ma.value,.8*ka.value]]),Sa=(0,l.computed)(()=>_a.value.map(e=>e.join(",")).join(" ")),za=(0,l.computed)(()=>Ma.value.map(e=>e.join(",")).join(" ")),Aa=(0,l.computed)(()=>d(_a.value)),ja=(0,l.computed)(()=>d(Ma.value)),Ta=(0,l.computed)(()=>function(e,a){const t=e/2,l=a/2,n=Math.PI/3,r=e/4,o=-Math.PI/2,u=n/30;let i=v(t,l,r,o);const c=Array.from({length:30},(e,a)=>{const n=v(t,l,r,o-(a+1)*u).map(e=>e.toFixed(5)),c=`M${i.join(",")} A${r}, ${r} 0 0 0 ${n.join(",")}`;return i=[Number(n[0]),Number(n[1])],c}),s=Math.max(0,e/2-.5)/3,d=Array.from({length:3},(e,a)=>s*(a+1)),m=Math.PI/6,k=e/2,p=Array.from({length:6},(e,a)=>{const n=m*(a+1),r=v(t,l,k,n),o=v(t,l,k,n+Math.PI);return`${r.join(",")} ${o.join(",")}`}),f=Math.max(0,e/2-1);return{arcPaths:Array.from({length:4},(e,a)=>{const n=m*(3*a+1),r=v(t,l,f,n),o=v(t,l,f,n+m);return`M${r.join(",")} A${t}, ${l} 0 0 1 ${o.join(",")}`}),circleRadii:d,scanPaths:c,splitLines:p}}(ma.value,ka.value)),La=(0,l.computed)(()=>Ta.value.scanPaths.map((e,a,t)=>s(pa.value[0],100-100*a/(t.length-1))));function Fa(e){const a=Math.max(.001,e*ya.value);return`${Number(a.toFixed(6))}s`}function qa(e,a=!0){const t=e.map(String);return(aa.reverse&&a?t.reverse():t).join(";")}function Pa(e){return aa.reverse?ma.value-e:e}function Ra(e){da.value=e.matches}function Ia(){return Array.from(oa.value?.querySelectorAll("svg")??[])}function Da(){for(const e of Ia())Ba.value?e.pauseAnimations?.():e.unpauseAnimations?.()}function Ha(){for(const e of Ia())e.setCurrentTime?.(0);Da()}function Ga(e){const a=e.relatedTarget;sa.value=Boolean(a&&oa.value?.contains(a))}return(0,l.watch)(Ba,()=>{(0,l.nextTick)(Da)},{immediate:!0}),(0,l.watch)(()=>[aa.variant,aa.reverse,aa.color,aa.colors,aa.dur,aa.duration,aa.haloDur,aa.scanDur],()=>{(0,l.nextTick)(Ha)},{flush:"post"}),(0,l.onMounted)(()=>{"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(va=window.matchMedia("(prefers-reduced-motion: reduce)"),Ra(va),va.addEventListener?.("change",Ra)),(0,l.nextTick)(Da)}),(0,l.onBeforeUnmount)(()=>{va?.removeEventListener?.("change",Ra)}),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("div",{ref_key:"animationRef",ref:oa,class:(0,l.normalizeClass)(["lumal-decoration",{"is-animation-paused":Ba.value,"is-reverse":ea.reverse}]),"data-variant":ea.variant,style:(0,l.normalizeStyle)(Na.value),onMouseenter:a[0]||(a[0]=e=>ca.value=!0),onMouseleave:a[1]||(a[1]=e=>ca.value=!1),onFocusin:a[2]||(a[2]=e=>sa.value=!0),onFocusout:Ga},[1===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",k,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(ta),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("rect",{key:a,class:"lumal-decoration__mark",fill:pa.value[0],height:2.5,width:2.5,x:e.point[0]-1.25,y:e.point[1]-1.25},[e.animated&&$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:Fa(e.durationSeconds),repeatCount:"indefinite",values:qa([pa.value[0],"transparent"])},null,8,f)):(0,l.createCommentVNode)("",!0)],8,p))),128)),(0,l.createElementVNode)("rect",{fill:pa.value[1],height:5,width:5,x:(0,l.unref)(c)[0][0]-2.5,y:(0,l.unref)(c)[0][1]-2.5},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"width",dur:Fa(2),repeatCount:"indefinite",values:qa([0,5])},null,8,y)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"height",dur:Fa(2),repeatCount:"indefinite",values:qa([0,5])},null,8,$)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:2,attributeName:"x",dur:Fa(2),repeatCount:"indefinite",values:qa([(0,l.unref)(c)[0][0],(0,l.unref)(c)[0][0]-2.5])},null,8,g)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:3,attributeName:"y",dur:Fa(2),repeatCount:"indefinite",values:qa([(0,l.unref)(c)[0][1],(0,l.unref)(c)[0][1]-2.5])},null,8,B)):(0,l.createCommentVNode)("",!0)],8,h),(0,l.createElementVNode)("rect",{fill:pa.value[1],height:5,width:40,x:(0,l.unref)(c)[1][0]-40,y:(0,l.unref)(c)[1][1]-2.5},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"width",dur:Fa(2),repeatCount:"indefinite",values:qa([0,40,0])},null,8,E)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"x",dur:Fa(2),repeatCount:"indefinite",values:qa([(0,l.unref)(c)[1][0],(0,l.unref)(c)[1][0]-40,(0,l.unref)(c)[1][0]])},null,8,b)):(0,l.createCommentVNode)("",!0)],8,N)])):2===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:1,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("rect",{fill:pa.value[0],height:ea.reverse?ka.value:1,width:ea.reverse?1:ma.value,x:ea.reverse?ma.value/2:0,y:ea.reverse?0:ka.value/2},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:ea.reverse?"height":"width",calcMode:"spline",dur:Fa(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:ea.reverse?ka.value:ma.value},null,8,x)):(0,l.createCommentVNode)("",!0)],8,w),(0,l.createElementVNode)("rect",{fill:pa.value[1],height:"1",width:"1",x:ea.reverse?ma.value/2:0,y:ea.reverse?0:ka.value/2},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:ea.reverse?"y":"x",calcMode:"spline",dur:Fa(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:ea.reverse?ka.value:ma.value},null,8,_)):(0,l.createCommentVNode)("",!0)],8,C)],8,V)):3===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",M,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(la),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("rect",{key:a,class:"lumal-decoration__mark",fill:pa.value[0],height:"7",width:"7",x:e.point[0]-3.5,y:e.point[1]-3.5},[e.animated&&$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:Fa(e.durationSeconds),repeatCount:"indefinite",values:qa(pa.value)},null,8,z)):(0,l.createCommentVNode)("",!0)],8,S))),128))])):4===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:3,class:(0,l.normalizeClass)(["lumal-decoration__line-reveal",[ea.reverse?"lumal-decoration__line-reveal--horizontal":"lumal-decoration__line-reveal--vertical",{"is-static":!$a.value}]]),style:(0,l.normalizeStyle)({animationDuration:ha.value/1e3+"s",height:ea.reverse?"5px":`${ka.value}px`,width:ea.reverse?`${ma.value}px`:"5px"})},[((0,l.openBlock)(),(0,l.createElementBlock)("svg",{"aria-hidden":"true",focusable:"false",height:ea.reverse?5:ka.value,width:ea.reverse?ma.value:5},[(0,l.createElementVNode)("polyline",{points:ea.reverse?`0,2.5 ${ma.value},2.5`:`2.5,0 2.5,${ka.value}`,stroke:pa.value[0]},null,8,j),(0,l.createElementVNode)("polyline",{points:ea.reverse?`0,2.5 ${ma.value},2.5`:`2.5,0 2.5,${ka.value}`,stroke:pa.value[1],"stroke-dasharray":"20,80","stroke-dashoffset":"-30","stroke-width":"3"},null,8,T)],8,A))],6)):5===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:4,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polyline",{fill:"transparent",points:Sa.value,stroke:pa.value[0],"stroke-width":"3"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:Fa(1.2),from:`0, ${Aa.value/2}, 0, ${Aa.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${Aa.value}, 0`},null,8,q)):(0,l.createCommentVNode)("",!0)],8,F),(0,l.createElementVNode)("polyline",{fill:"transparent",points:za.value,stroke:pa.value[1],"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:Fa(1.2),from:`0, ${ja.value/2}, 0, ${ja.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${ja.value}, 0`},null,8,R)):(0,l.createCommentVNode)("",!0)],8,P)],8,L)):6===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",I,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(na),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("rect",{key:a,class:"lumal-decoration__bar",fill:pa.value[e.colorIndex],height:e.height,width:"7",x:e.point[0]-3.5,y:e.point[1]-e.height/2},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"y",begin:"0s",calcMode:"spline",dur:Fa(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:qa([e.point[1]-e.minHeight/2,e.point[1]-e.height/2,e.point[1]-e.minHeight/2])},null,8,H)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"height",begin:"0s",calcMode:"spline",dur:Fa(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:qa([e.minHeight,e.height,e.minHeight])},null,8,G)):(0,l.createCommentVNode)("",!0)],8,D))),128))])):7===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("div",O,[((0,l.openBlock)(),(0,l.createElementBlock)("svg",U,[(0,l.createElementVNode)("polyline",{fill:"transparent",points:"10,0 19,10 10,20",stroke:pa.value[0],"stroke-width":"4"},null,8,J),(0,l.createElementVNode)("polyline",{fill:"transparent",points:"2,0 11,10 2,20",stroke:pa.value[1],"stroke-width":"2"},null,8,K)])),(0,l.createElementVNode)("div",Q,[(0,l.renderSlot)(e.$slots,"default")]),((0,l.openBlock)(),(0,l.createElementBlock)("svg",W,[(0,l.createElementVNode)("polyline",{fill:"transparent",points:"11,0 2,10 11,20",stroke:pa.value[0],"stroke-width":"4"},null,8,X),(0,l.createElementVNode)("polyline",{fill:"transparent",points:"19,0 10,10 19,20",stroke:pa.value[1],"stroke-width":"2"},null,8,Y)]))])):8===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:7,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(0)},0 ${Pa(30)},${ka.value/2}`,stroke:pa.value[0],"stroke-width":"2"},null,8,ee),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(20)},0 ${Pa(50)},${ka.value/2} ${Pa(ma.value)},${ka.value/2}`,stroke:pa.value[0],"stroke-width":"2"},null,8,ae),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(0)},${ka.value-3} ${Pa(200)},${ka.value-3}`,stroke:pa.value[1],"stroke-width":"3"},null,8,te)],8,Z)):9===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",le,[(0,l.createElementVNode)("defs",null,[(0,l.createElementVNode)("polygon",{id:Va,points:"15,46.5 21,47.5 21,52.5 15,53.5"})]),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"80,100,30,100",stroke:pa.value[1],"stroke-width":"10"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,re)):(0,l.createCommentVNode)("",!0)],8,ne),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"50,66,100,66",stroke:pa.value[0],"stroke-width":"6"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?"0 50 50;360 50 50":"0 50 50;-360 50 50"},null,8,ue)):(0,l.createCommentVNode)("",!0)],8,oe),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"38","stroke-dasharray":"5,1",stroke:(0,l.unref)(s)(pa.value[1],30),"stroke-width":"1"},null,8,ie),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)((0,l.unref)(ra),(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("use",{key:a,fill:e?pa.value[0]:"transparent",href:`#${Va}`,stroke:pa.value[1]},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",begin:a*ha.value/20/1e3+"s",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,se)):(0,l.createCommentVNode)("",!0)],8,ce))),128)),(0,l.createElementVNode)("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"26","stroke-dasharray":"5,1",stroke:(0,l.unref)(s)(pa.value[1],30),"stroke-width":"1"},null,8,de)])):10===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:9,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${Pa(0)},${ka.value/2} ${Pa(ma.value)},${ka.value/2}`,stroke:pa.value[1],"stroke-width":"2"},null,8,me),(0,l.createElementVNode)("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${Pa(5)},${ka.value/2} ${Pa(.2*ma.value-3)},${ka.value/2}`,stroke:pa.value[0],"stroke-dasharray":"0,"+.2*ma.value,"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[1],attributeName:"stroke-dasharray",begin:`${Ca[0]}.end`,dur:Fa(3),fill:"freeze",values:`0,${.2*ma.value};${.2*ma.value},0`},null,8,pe)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ma.value},0;0,${.2*ma.value}`},null,8,fe)):(0,l.createCommentVNode)("",!0)],8,ke),(0,l.createElementVNode)("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${Pa(.2*ma.value+3)},${ka.value/2} ${Pa(.8*ma.value-3)},${ka.value/2}`,stroke:pa.value[0],"stroke-dasharray":"0,"+.6*ma.value,"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[3],attributeName:"stroke-dasharray",begin:`${Ca[2]}.end + ${Fa(1)}`,dur:Fa(3),fill:"freeze",values:`0,${.6*ma.value};${.6*ma.value},0`},null,8,ye)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.6*ma.value},0;0,${.6*ma.value}`},null,8,$e)):(0,l.createCommentVNode)("",!0)],8,he),(0,l.createElementVNode)("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${Pa(.8*ma.value+3)},${ka.value/2} ${Pa(ma.value-5)},${ka.value/2}`,stroke:pa.value[0],"stroke-dasharray":"0,"+.2*ma.value,"stroke-width":"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[5],attributeName:"stroke-dasharray",begin:`${Ca[4]}.end + ${Fa(1)}`,dur:Fa(3),fill:"freeze",values:`0,${.2*ma.value};${.2*ma.value},0`},null,8,Be)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ma.value},0;0,${.3*ma.value}`},null,8,Ne)):(0,l.createCommentVNode)("",!0)],8,ge),(0,l.createElementVNode)("circle",{cx:Pa(2),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[0],attributeName:"fill",begin:`0s;${Ca[6]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,be)):(0,l.createCommentVNode)("",!0)],8,Ee),(0,l.createElementVNode)("circle",{cx:Pa(.2*ma.value),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[2],attributeName:"fill",begin:`${Ca[1]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,we)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"fill",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${pa.value[1]};${pa.value[1]}`},null,8,xe)):(0,l.createCommentVNode)("",!0)],8,Ve),(0,l.createElementVNode)("circle",{cx:Pa(.8*ma.value),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[4],attributeName:"fill",begin:`${Ca[3]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,_e)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"fill",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${pa.value[1]};${pa.value[1]}`},null,8,Me)):(0,l.createCommentVNode)("",!0)],8,Ce),(0,l.createElementVNode)("circle",{cx:Pa(ma.value-2),cy:ka.value/2,fill:pa.value[1],r:"2"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,id:Ca[6],attributeName:"fill",begin:`${Ca[5]}.end`,dur:Fa(.3),fill:"freeze",values:`${pa.value[1]};${pa.value[0]}`},null,8,ze)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"fill",begin:`${Ca[6]}.end`,dur:"0.01s",fill:"freeze",values:`${pa.value[1]};${pa.value[1]}`},null,8,Ae)):(0,l.createCommentVNode)("",!0)],8,Se)],8,ve)):11===ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:10,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:"20 10,25 4,55 4,60 10",stroke:pa.value[1]},null,8,Te),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:`20 ${ka.value-10},25 ${ka.value-4},55 ${ka.value-4},60 ${ka.value-10}`,stroke:pa.value[1]},null,8,Le),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:`${ma.value-20} 10,${ma.value-25} 4,${ma.value-55} 4,${ma.value-60} 10`,stroke:pa.value[1]},null,8,Fe),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[1],10),points:`${ma.value-20} ${ka.value-10},${ma.value-25} ${ka.value-4},${ma.value-55} ${ka.value-4},${ma.value-60} ${ka.value-10}`,stroke:pa.value[1]},null,8,qe),(0,l.createElementVNode)("polygon",{fill:(0,l.unref)(s)(pa.value[0],20),points:`20 10,5 ${ka.value/2},20 ${ka.value-10},${ma.value-20} ${ka.value-10},${ma.value-5} ${ka.value/2},${ma.value-20} 10`,stroke:pa.value[0]},null,8,Pe),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`25 18,15 ${ka.value/2},25 ${ka.value-18}`,stroke:(0,l.unref)(s)(pa.value[0],70)},null,8,Re),(0,l.createElementVNode)("polyline",{fill:"transparent",points:`${ma.value-25} 18,${ma.value-15} ${ka.value/2},${ma.value-25} ${ka.value-18}`,stroke:(0,l.unref)(s)(pa.value[0],70)},null,8,Ie)],8,je)):((0,l.openBlock)(),(0,l.createElementBlock)("svg",{key:11,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:ka.value,width:ma.value},[(0,l.createElementVNode)("defs",null,[(0,l.createElementVNode)("g",{id:wa},[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.scanPaths,(e,a)=>((0,l.openBlock)(),(0,l.createElementBlock)("path",{key:e,fill:"transparent",d:e,stroke:La.value[a],"stroke-width":ma.value/2},null,8,He))),128))]),(0,l.createElementVNode)("radialGradient",{id:xa,cx:"50%",cy:"50%",r:"50%"},[a[3]||(a[3]=(0,l.createElementVNode)("stop",{offset:"0%","stop-color":"transparent","stop-opacity":"1"},null,-1)),(0,l.createElementVNode)("stop",{offset:"100%","stop-color":(0,l.unref)(s)(pa.value[1],30),"stop-opacity":"1"},null,8,Ge)])]),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.circleRadii,e=>((0,l.openBlock)(),(0,l.createElementBlock)("circle",{key:e,cx:ma.value/2,cy:ka.value/2,fill:"transparent",r:e,stroke:pa.value[1],"stroke-width":"0.5"},null,8,Oe))),128)),(0,l.createElementVNode)("circle",{cx:ma.value/2,cy:ka.value/2,fill:`url(#${xa})`,r:"1",stroke:"transparent"},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:0,attributeName:"r",dur:ga.value,repeatCount:"indefinite",values:"1;"+ma.value/2},null,8,Je)):(0,l.createCommentVNode)("",!0),$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animate",{key:1,attributeName:"opacity",dur:ga.value,repeatCount:"indefinite",values:"1;0"},null,8,Ke)):(0,l.createCommentVNode)("",!0)],8,Ue),(0,l.createElementVNode)("circle",{cx:ma.value/2,cy:ka.value/2,fill:pa.value[1],r:"2"},null,8,Qe),(0,l.createElementVNode)("g",null,[((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.splitLines,e=>((0,l.openBlock)(),(0,l.createElementBlock)("polyline",{key:e,opacity:"0.5",points:e,stroke:pa.value[1],"stroke-width":"0.5"},null,8,We))),128))]),((0,l.openBlock)(!0),(0,l.createElementBlock)(l.Fragment,null,(0,l.renderList)(Ta.value.arcPaths,e=>((0,l.openBlock)(),(0,l.createElementBlock)("path",{key:e,fill:"transparent",d:e,stroke:pa.value[1],"stroke-width":"2"},null,8,Xe))),128)),(0,l.createElementVNode)("use",{href:`#${wa}`},[$a.value?((0,l.openBlock)(),(0,l.createElementBlock)("animateTransform",{key:0,attributeName:"transform",dur:Fa(3),repeatCount:"indefinite",type:"rotate",values:ea.reverse?`0,${ma.value/2} ${ka.value/2};-360,${ma.value/2} ${ka.value/2}`:`0,${ma.value/2} ${ka.value/2};360,${ma.value/2} ${ka.value/2}`},null,8,Ze)):(0,l.createCommentVNode)("",!0)],8,Ye)],8,De)),7!==ea.variant?((0,l.openBlock)(),(0,l.createElementBlock)("div",{key:12,class:(0,l.normalizeClass)(["lumal-decoration__content",{"lumal-decoration__content--centered":9===ea.variant||11===ea.variant||12===ea.variant}])},[(0,l.renderSlot)(e.$slots,"default")],2)):(0,l.createCommentVNode)("",!0)],46,m))}});Object.defineProperty(exports,"LumalDecoration_default",{enumerable:!0,get:function(){return ea}});
@@ -1 +1 @@
1
- import{t as e}from"./useElementSize-CKA7EtNB.js";import{t as a}from"./useAnimationPause-DSOHlI2X.js";import{n as l}from"./utils-BmGYN0WH.js";import{Fragment as t,computed as r,createCommentVNode as u,createElementBlock as i,createElementVNode as n,defineComponent as s,nextTick as o,normalizeClass as v,normalizeStyle as d,onBeforeUnmount as c,onMounted as f,openBlock as h,renderList as m,renderSlot as p,shallowRef as k,unref as y,useId as $,useTemplateRef as g,watch as b}from"vue";var w={1:["#fff","#0de7c2"],2:["#3faacb","#fff"],3:["#7acaec","transparent"],4:["rgba(255, 255, 255, 0.3)","rgba(255, 255, 255, 0.3)"],5:["#3f96a5","#3f96a5"],6:["#7acaec","#7acaec"],7:["#1dc1f5","#1dc1f5"],8:["#3f96a5","#3f96a5"],9:["rgba(3, 166, 224, 0.8)","rgba(3, 166, 224, 0.5)"],10:["#00c2ff","rgba(0, 194, 255, 0.3)"],11:["#1a98fc","#2cf7fe"],12:["#2783ce","#2cf7fe"]},x={1:2e3,2:6e3,3:1500,4:3e3,5:1200,6:2e3,7:2800,8:2800,9:3e3,10:3e3,11:2800,12:3e3},_=0;function N(e,a,l,t){const r=e/(t+1),u=a/(l+1);return Array.from({length:l*t},(e,a)=>{const l=Math.floor(a/t);return[r*(a%t+1),u*(l+1)]})}var M=N(200,50,4,20),C=[M[39]??[0,0],M[37]??[0,0]];function S(e,a){const l=Math.min(100,Math.max(0,a))/100,t=e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(t){const e=3===t.length?t.split("").map(e=>`${e}${e}`).join(""):t;return`rgba(${Number.parseInt(e.slice(0,2),16)}, ${Number.parseInt(e.slice(2,4),16)}, ${Number.parseInt(e.slice(4,6),16)}, ${l})`}const r=e.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return r?`rgba(${r[1]}, ${r[2]}, ${r[3]}, ${l})`:"transparent"===e.trim().toLowerCase()?"transparent":`color-mix(in srgb, ${e} ${a}%, transparent)`}function A(e){return e.slice(1).reduce((a,l,t)=>{const r=e[t];return r?a+Math.hypot(l[0]-r[0],l[1]-r[1]):a},0)}function j(e,a,l,t){return[e+Math.cos(t)*l,a+Math.sin(t)*l]}var z=["data-variant"],T={key:0,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 200 50"},P=["fill","x","y"],I=["begin","dur","values"],q=["fill","x","y"],B=["dur","values"],D=["dur","values"],R=["dur","values"],L=["dur","values"],F=["fill","x","y"],H=["dur","values"],E=["dur","values"],G=["height","width"],J=["fill","height","width","x","y"],K=["attributeName","dur","to"],O=["fill","x","y"],Q=["attributeName","dur","to"],U={key:2,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},V=["fill","x","y"],W=["begin","dur","values"],X=["height","width"],Y=["points","stroke"],Z=["points","stroke"],ee=["height","width"],ae=["points","stroke"],le=["dur","from","to"],te=["points","stroke"],re=["dur","from","to"],ue={key:5,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},ie=["fill","height","x","y"],ne=["dur","values"],se=["dur","values"],oe={key:6,class:"lumal-decoration__chevrons"},ve={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},de=["stroke"],ce=["stroke"],fe={class:"lumal-decoration__content lumal-decoration__content--inline"},he={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},me=["stroke"],pe=["stroke"],ke=["height","width"],ye=["points","stroke"],$e=["points","stroke"],ge=["points","stroke"],be={key:8,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 100 100"},we=["stroke"],xe=["dur","values"],_e=["stroke"],Ne=["dur","values"],Me=["stroke"],Ce=["fill","href","stroke"],Se=["begin","dur","values"],Ae=["stroke"],je=["height","width"],ze=["points","stroke"],Te=["points","stroke","stroke-dasharray"],Pe=["id","begin","dur","values"],Ie=["begin","values"],qe=["points","stroke","stroke-dasharray"],Be=["id","begin","dur","values"],De=["begin","values"],Re=["points","stroke","stroke-dasharray"],Le=["id","begin","dur","values"],Fe=["begin","values"],He=["cx","cy","fill"],Ee=["id","begin","dur","values"],Ge=["cx","cy","fill"],Je=["id","begin","dur","values"],Ke=["begin","values"],Oe=["cx","cy","fill"],Qe=["id","begin","dur","values"],Ue=["begin","values"],Ve=["cx","cy","fill"],We=["id","begin","dur","values"],Xe=["begin","values"],Ye=["height","width"],Ze=["fill","stroke"],ea=["fill","points","stroke"],aa=["fill","points","stroke"],la=["fill","points","stroke"],ta=["fill","points","stroke"],ra=["points","stroke"],ua=["points","stroke"],ia=["height","width"],na=["d","stroke","stroke-width"],sa=["stop-color"],oa=["cx","cy","r","stroke"],va=["cx","cy","fill"],da=["dur","values"],ca=["dur"],fa=["cx","cy","fill"],ha=["points","stroke"],ma=["d","stroke"],pa=["href"],ka=["dur","values"],ya=/*@__PURE__*/s({__name:"LumalDecoration",props:{variant:{default:1},color:{default:void 0},colors:{default:void 0},background:{default:void 0},dur:{default:void 0},duration:{default:void 0},haloDur:{default:void 0},reverse:{type:Boolean,default:!1},scanDur:{default:void 0}},setup(s){const ya=M.filter(()=>Math.random()>.6).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:1,point:e})),$a=N(300,35,2,25).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:Math.random()+1,point:e})),ga=N(300,35,1,40).map(e=>{const a=Math.random()>.8,l=a?24.5:7,t=Math.trunc(Math.random()*((a?35:17.5)-l+1)+l);return{colorIndex:Math.random()>.5?0:1,durationSeconds:Math.random()+1.5,height:t,minHeight:t*Math.random(),point:e}}),ba=Array.from({length:20},()=>Math.random()<=.4),wa=s,xa=g("animationRef"),_a=e(xa),Na=a(xa),Ma=k(!1),Ca=k(!1),Sa=k(!1);let Aa;const ja=r(()=>_a.value.width),za=r(()=>_a.value.height),Ta=r(()=>{const e=w[wa.variant],a=wa.color??wa.colors;return[a?.[0]??e[0],a?.[1]??e[1]]}),Pa=r(()=>12===wa.variant?wa.scanDur:wa.dur),Ia=r(()=>{const e=void 0===Pa.value?wa.duration:1e3*Pa.value;return Math.max(0,e??x[wa.variant])}),qa=r(()=>Ia.value/x[wa.variant]),Ba=r(()=>Ia.value>0),Da=r(()=>{const e=wa.haloDur??2*qa.value;return`${Number(Math.max(.001,e).toFixed(6))}s`}),Ra=r(()=>Na.value||Ma.value||Ca.value||Sa.value||!Ba.value),La=r(()=>l(Ta.value,wa.background,Ia.value)),Fa=(Ha=$(),_+=1,`lumal-decoration-${Ha.replace(/[^\w-]/g,"")}-${_}`);var Ha;const Ea=`${Fa}-polygon`,Ga=`${Fa}-radar-group`,Ja=`${Fa}-radar-gradient`,Ka=[`${Fa}-sequence-1`,`${Fa}-sequence-2`,`${Fa}-sequence-3`,`${Fa}-sequence-4`,`${Fa}-sequence-5`,`${Fa}-sequence-6`,`${Fa}-sequence-7`],Oa=r(()=>[[0,.2*za.value],[.18*ja.value,.2*za.value],[.2*ja.value,.4*za.value],[.25*ja.value,.4*za.value],[.27*ja.value,.6*za.value],[.72*ja.value,.6*za.value],[.75*ja.value,.4*za.value],[.8*ja.value,.4*za.value],[.82*ja.value,.2*za.value],[ja.value,.2*za.value]]),Qa=r(()=>[[.3*ja.value,.8*za.value],[.7*ja.value,.8*za.value]]),Ua=r(()=>Oa.value.map(e=>e.join(",")).join(" ")),Va=r(()=>Qa.value.map(e=>e.join(",")).join(" ")),Wa=r(()=>A(Oa.value)),Xa=r(()=>A(Qa.value)),Ya=r(()=>function(e,a){const l=e/2,t=a/2,r=Math.PI/3,u=e/4,i=-Math.PI/2,n=r/30;let s=j(l,t,u,i);const o=Array.from({length:30},(e,a)=>{const r=j(l,t,u,i-(a+1)*n).map(e=>e.toFixed(5)),o=`M${s.join(",")} A${u}, ${u} 0 0 0 ${r.join(",")}`;return s=[Number(r[0]),Number(r[1])],o}),v=Math.max(0,e/2-.5)/3,d=Array.from({length:3},(e,a)=>v*(a+1)),c=Math.PI/6,f=e/2,h=Array.from({length:6},(e,a)=>{const r=c*(a+1),u=j(l,t,f,r),i=j(l,t,f,r+Math.PI);return`${u.join(",")} ${i.join(",")}`}),m=Math.max(0,e/2-1);return{arcPaths:Array.from({length:4},(e,a)=>{const r=c*(3*a+1),u=j(l,t,m,r),i=j(l,t,m,r+c);return`M${u.join(",")} A${l}, ${t} 0 0 1 ${i.join(",")}`}),circleRadii:d,scanPaths:o,splitLines:h}}(ja.value,za.value)),Za=r(()=>Ya.value.scanPaths.map((e,a,l)=>S(Ta.value[0],100-100*a/(l.length-1))));function el(e){const a=Math.max(.001,e*qa.value);return`${Number(a.toFixed(6))}s`}function al(e,a=!0){const l=e.map(String);return(wa.reverse&&a?l.reverse():l).join(";")}function ll(e){return wa.reverse?ja.value-e:e}function tl(e){Sa.value=e.matches}function rl(){return Array.from(xa.value?.querySelectorAll("svg")??[])}function ul(){for(const e of rl())Ra.value?e.pauseAnimations?.():e.unpauseAnimations?.()}function il(){for(const e of rl())e.setCurrentTime?.(0);ul()}function nl(e){const a=e.relatedTarget;Ca.value=Boolean(a&&xa.value?.contains(a))}return b(Ra,()=>{o(ul)},{immediate:!0}),b(()=>[wa.variant,wa.reverse,wa.color,wa.colors,wa.dur,wa.duration,wa.haloDur,wa.scanDur],()=>{o(il)},{flush:"post"}),f(()=>{"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(Aa=window.matchMedia("(prefers-reduced-motion: reduce)"),tl(Aa),Aa.addEventListener?.("change",tl)),o(ul)}),c(()=>{Aa?.removeEventListener?.("change",tl)}),(e,a)=>(h(),i("div",{ref_key:"animationRef",ref:xa,class:v(["lumal-decoration",{"is-animation-paused":Ra.value,"is-reverse":s.reverse}]),"data-variant":s.variant,style:d(La.value),onMouseenter:a[0]||(a[0]=e=>Ma.value=!0),onMouseleave:a[1]||(a[1]=e=>Ma.value=!1),onFocusin:a[2]||(a[2]=e=>Ca.value=!0),onFocusout:nl},[1===s.variant?(h(),i("svg",T,[(h(!0),i(t,null,m(y(ya),(e,a)=>(h(),i("rect",{key:a,class:"lumal-decoration__mark",fill:Ta.value[0],height:2.5,width:2.5,x:e.point[0]-1.25,y:e.point[1]-1.25},[e.animated&&Ba.value?(h(),i("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:el(e.durationSeconds),repeatCount:"indefinite",values:al([Ta.value[0],"transparent"])},null,8,I)):u("",!0)],8,P))),128)),n("rect",{fill:Ta.value[1],height:5,width:5,x:y(C)[0][0]-2.5,y:y(C)[0][1]-2.5},[Ba.value?(h(),i("animate",{key:0,attributeName:"width",dur:el(2),repeatCount:"indefinite",values:al([0,5])},null,8,B)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"height",dur:el(2),repeatCount:"indefinite",values:al([0,5])},null,8,D)):u("",!0),Ba.value?(h(),i("animate",{key:2,attributeName:"x",dur:el(2),repeatCount:"indefinite",values:al([y(C)[0][0],y(C)[0][0]-2.5])},null,8,R)):u("",!0),Ba.value?(h(),i("animate",{key:3,attributeName:"y",dur:el(2),repeatCount:"indefinite",values:al([y(C)[0][1],y(C)[0][1]-2.5])},null,8,L)):u("",!0)],8,q),n("rect",{fill:Ta.value[1],height:5,width:40,x:y(C)[1][0]-40,y:y(C)[1][1]-2.5},[Ba.value?(h(),i("animate",{key:0,attributeName:"width",dur:el(2),repeatCount:"indefinite",values:al([0,40,0])},null,8,H)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"x",dur:el(2),repeatCount:"indefinite",values:al([y(C)[1][0],y(C)[1][0]-40,y(C)[1][0]])},null,8,E)):u("",!0)],8,F)])):2===s.variant?(h(),i("svg",{key:1,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("rect",{fill:Ta.value[0],height:s.reverse?za.value:1,width:s.reverse?1:ja.value,x:s.reverse?ja.value/2:0,y:s.reverse?0:za.value/2},[Ba.value?(h(),i("animate",{key:0,attributeName:s.reverse?"height":"width",calcMode:"spline",dur:el(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:s.reverse?za.value:ja.value},null,8,K)):u("",!0)],8,J),n("rect",{fill:Ta.value[1],height:"1",width:"1",x:s.reverse?ja.value/2:0,y:s.reverse?0:za.value/2},[Ba.value?(h(),i("animate",{key:0,attributeName:s.reverse?"y":"x",calcMode:"spline",dur:el(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:s.reverse?za.value:ja.value},null,8,Q)):u("",!0)],8,O)],8,G)):3===s.variant?(h(),i("svg",U,[(h(!0),i(t,null,m(y($a),(e,a)=>(h(),i("rect",{key:a,class:"lumal-decoration__mark",fill:Ta.value[0],height:"7",width:"7",x:e.point[0]-3.5,y:e.point[1]-3.5},[e.animated&&Ba.value?(h(),i("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:el(e.durationSeconds),repeatCount:"indefinite",values:al(Ta.value)},null,8,W)):u("",!0)],8,V))),128))])):4===s.variant?(h(),i("div",{key:3,class:v(["lumal-decoration__line-reveal",[s.reverse?"lumal-decoration__line-reveal--horizontal":"lumal-decoration__line-reveal--vertical",{"is-static":!Ba.value}]]),style:d({animationDuration:Ia.value/1e3+"s",height:s.reverse?"5px":`${za.value}px`,width:s.reverse?`${ja.value}px`:"5px"})},[(h(),i("svg",{"aria-hidden":"true",focusable:"false",height:s.reverse?5:za.value,width:s.reverse?ja.value:5},[n("polyline",{points:s.reverse?`0,2.5 ${ja.value},2.5`:`2.5,0 2.5,${za.value}`,stroke:Ta.value[0]},null,8,Y),n("polyline",{points:s.reverse?`0,2.5 ${ja.value},2.5`:`2.5,0 2.5,${za.value}`,stroke:Ta.value[1],"stroke-dasharray":"20,80","stroke-dashoffset":"-30","stroke-width":"3"},null,8,Z)],8,X))],6)):5===s.variant?(h(),i("svg",{key:4,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polyline",{fill:"transparent",points:Ua.value,stroke:Ta.value[0],"stroke-width":"3"},[Ba.value?(h(),i("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:el(1.2),from:`0, ${Wa.value/2}, 0, ${Wa.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${Wa.value}, 0`},null,8,le)):u("",!0)],8,ae),n("polyline",{fill:"transparent",points:Va.value,stroke:Ta.value[1],"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:el(1.2),from:`0, ${Xa.value/2}, 0, ${Xa.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${Xa.value}, 0`},null,8,re)):u("",!0)],8,te)],8,ee)):6===s.variant?(h(),i("svg",ue,[(h(!0),i(t,null,m(y(ga),(e,a)=>(h(),i("rect",{key:a,class:"lumal-decoration__bar",fill:Ta.value[e.colorIndex],height:e.height,width:"7",x:e.point[0]-3.5,y:e.point[1]-e.height/2},[Ba.value?(h(),i("animate",{key:0,attributeName:"y",begin:"0s",calcMode:"spline",dur:el(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:al([e.point[1]-e.minHeight/2,e.point[1]-e.height/2,e.point[1]-e.minHeight/2])},null,8,ne)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"height",begin:"0s",calcMode:"spline",dur:el(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:al([e.minHeight,e.height,e.minHeight])},null,8,se)):u("",!0)],8,ie))),128))])):7===s.variant?(h(),i("div",oe,[(h(),i("svg",ve,[n("polyline",{fill:"transparent",points:"10,0 19,10 10,20",stroke:Ta.value[0],"stroke-width":"4"},null,8,de),n("polyline",{fill:"transparent",points:"2,0 11,10 2,20",stroke:Ta.value[1],"stroke-width":"2"},null,8,ce)])),n("div",fe,[p(e.$slots,"default")]),(h(),i("svg",he,[n("polyline",{fill:"transparent",points:"11,0 2,10 11,20",stroke:Ta.value[0],"stroke-width":"4"},null,8,me),n("polyline",{fill:"transparent",points:"19,0 10,10 19,20",stroke:Ta.value[1],"stroke-width":"2"},null,8,pe)]))])):8===s.variant?(h(),i("svg",{key:7,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polyline",{fill:"transparent",points:`${ll(0)},0 ${ll(30)},${za.value/2}`,stroke:Ta.value[0],"stroke-width":"2"},null,8,ye),n("polyline",{fill:"transparent",points:`${ll(20)},0 ${ll(50)},${za.value/2} ${ll(ja.value)},${za.value/2}`,stroke:Ta.value[0],"stroke-width":"2"},null,8,$e),n("polyline",{fill:"transparent",points:`${ll(0)},${za.value-3} ${ll(200)},${za.value-3}`,stroke:Ta.value[1],"stroke-width":"3"},null,8,ge)],8,ke)):9===s.variant?(h(),i("svg",be,[n("defs",null,[n("polygon",{id:Ea,points:"15,46.5 21,47.5 21,52.5 15,53.5"})]),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"80,100,30,100",stroke:Ta.value[1],"stroke-width":"10"},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,xe)):u("",!0)],8,we),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"50,66,100,66",stroke:Ta.value[0],"stroke-width":"6"},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?"0 50 50;360 50 50":"0 50 50;-360 50 50"},null,8,Ne)):u("",!0)],8,_e),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"38","stroke-dasharray":"5,1",stroke:y(S)(Ta.value[1],30),"stroke-width":"1"},null,8,Me),(h(!0),i(t,null,m(y(ba),(e,a)=>(h(),i("use",{key:a,fill:e?Ta.value[0]:"transparent",href:`#${Ea}`,stroke:Ta.value[1]},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",begin:a*Ia.value/20/1e3+"s",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,Se)):u("",!0)],8,Ce))),128)),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"26","stroke-dasharray":"5,1",stroke:y(S)(Ta.value[1],30),"stroke-width":"1"},null,8,Ae)])):10===s.variant?(h(),i("svg",{key:9,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polyline",{fill:"transparent",points:`${ll(0)},${za.value/2} ${ll(ja.value)},${za.value/2}`,stroke:Ta.value[1],"stroke-width":"2"},null,8,ze),n("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${ll(5)},${za.value/2} ${ll(.2*ja.value-3)},${za.value/2}`,stroke:Ta.value[0],"stroke-dasharray":"0,"+.2*ja.value,"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[1],attributeName:"stroke-dasharray",begin:`${Ka[0]}.end`,dur:el(3),fill:"freeze",values:`0,${.2*ja.value};${.2*ja.value},0`},null,8,Pe)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ja.value},0;0,${.2*ja.value}`},null,8,Ie)):u("",!0)],8,Te),n("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${ll(.2*ja.value+3)},${za.value/2} ${ll(.8*ja.value-3)},${za.value/2}`,stroke:Ta.value[0],"stroke-dasharray":"0,"+.6*ja.value,"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[3],attributeName:"stroke-dasharray",begin:`${Ka[2]}.end + ${el(1)}`,dur:el(3),fill:"freeze",values:`0,${.6*ja.value};${.6*ja.value},0`},null,8,Be)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.6*ja.value},0;0,${.6*ja.value}`},null,8,De)):u("",!0)],8,qe),n("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${ll(.8*ja.value+3)},${za.value/2} ${ll(ja.value-5)},${za.value/2}`,stroke:Ta.value[0],"stroke-dasharray":"0,"+.2*ja.value,"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[5],attributeName:"stroke-dasharray",begin:`${Ka[4]}.end + ${el(1)}`,dur:el(3),fill:"freeze",values:`0,${.2*ja.value};${.2*ja.value},0`},null,8,Le)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ja.value},0;0,${.3*ja.value}`},null,8,Fe)):u("",!0)],8,Re),n("circle",{cx:ll(2),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[0],attributeName:"fill",begin:`0s;${Ka[6]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,Ee)):u("",!0)],8,He),n("circle",{cx:ll(.2*ja.value),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[2],attributeName:"fill",begin:`${Ka[1]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,Je)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"fill",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${Ta.value[1]};${Ta.value[1]}`},null,8,Ke)):u("",!0)],8,Ge),n("circle",{cx:ll(.8*ja.value),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[4],attributeName:"fill",begin:`${Ka[3]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,Qe)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"fill",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${Ta.value[1]};${Ta.value[1]}`},null,8,Ue)):u("",!0)],8,Oe),n("circle",{cx:ll(ja.value-2),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[6],attributeName:"fill",begin:`${Ka[5]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,We)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"fill",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${Ta.value[1]};${Ta.value[1]}`},null,8,Xe)):u("",!0)],8,Ve)],8,je)):11===s.variant?(h(),i("svg",{key:10,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polygon",{fill:y(S)(Ta.value[1],10),points:"20 10,25 4,55 4,60 10",stroke:Ta.value[1]},null,8,Ze),n("polygon",{fill:y(S)(Ta.value[1],10),points:`20 ${za.value-10},25 ${za.value-4},55 ${za.value-4},60 ${za.value-10}`,stroke:Ta.value[1]},null,8,ea),n("polygon",{fill:y(S)(Ta.value[1],10),points:`${ja.value-20} 10,${ja.value-25} 4,${ja.value-55} 4,${ja.value-60} 10`,stroke:Ta.value[1]},null,8,aa),n("polygon",{fill:y(S)(Ta.value[1],10),points:`${ja.value-20} ${za.value-10},${ja.value-25} ${za.value-4},${ja.value-55} ${za.value-4},${ja.value-60} ${za.value-10}`,stroke:Ta.value[1]},null,8,la),n("polygon",{fill:y(S)(Ta.value[0],20),points:`20 10,5 ${za.value/2},20 ${za.value-10},${ja.value-20} ${za.value-10},${ja.value-5} ${za.value/2},${ja.value-20} 10`,stroke:Ta.value[0]},null,8,ta),n("polyline",{fill:"transparent",points:`25 18,15 ${za.value/2},25 ${za.value-18}`,stroke:y(S)(Ta.value[0],70)},null,8,ra),n("polyline",{fill:"transparent",points:`${ja.value-25} 18,${ja.value-15} ${za.value/2},${ja.value-25} ${za.value-18}`,stroke:y(S)(Ta.value[0],70)},null,8,ua)],8,Ye)):(h(),i("svg",{key:11,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("defs",null,[n("g",{id:Ga},[(h(!0),i(t,null,m(Ya.value.scanPaths,(e,a)=>(h(),i("path",{key:e,fill:"transparent",d:e,stroke:Za.value[a],"stroke-width":ja.value/2},null,8,na))),128))]),n("radialGradient",{id:Ja,cx:"50%",cy:"50%",r:"50%"},[a[3]||(a[3]=n("stop",{offset:"0%","stop-color":"transparent","stop-opacity":"1"},null,-1)),n("stop",{offset:"100%","stop-color":y(S)(Ta.value[1],30),"stop-opacity":"1"},null,8,sa)])]),(h(!0),i(t,null,m(Ya.value.circleRadii,e=>(h(),i("circle",{key:e,cx:ja.value/2,cy:za.value/2,fill:"transparent",r:e,stroke:Ta.value[1],"stroke-width":"0.5"},null,8,oa))),128)),n("circle",{cx:ja.value/2,cy:za.value/2,fill:`url(#${Ja})`,r:"1",stroke:"transparent"},[Ba.value?(h(),i("animate",{key:0,attributeName:"r",dur:Da.value,repeatCount:"indefinite",values:"1;"+ja.value/2},null,8,da)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"opacity",dur:Da.value,repeatCount:"indefinite",values:"1;0"},null,8,ca)):u("",!0)],8,va),n("circle",{cx:ja.value/2,cy:za.value/2,fill:Ta.value[1],r:"2"},null,8,fa),n("g",null,[(h(!0),i(t,null,m(Ya.value.splitLines,e=>(h(),i("polyline",{key:e,opacity:"0.5",points:e,stroke:Ta.value[1],"stroke-width":"0.5"},null,8,ha))),128))]),(h(!0),i(t,null,m(Ya.value.arcPaths,e=>(h(),i("path",{key:e,fill:"transparent",d:e,stroke:Ta.value[1],"stroke-width":"2"},null,8,ma))),128)),n("use",{href:`#${Ga}`},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?`0,${ja.value/2} ${za.value/2};-360,${ja.value/2} ${za.value/2}`:`0,${ja.value/2} ${za.value/2};360,${ja.value/2} ${za.value/2}`},null,8,ka)):u("",!0)],8,pa)],8,ia)),7!==s.variant?(h(),i("div",{key:12,class:v(["lumal-decoration__content",{"lumal-decoration__content--centered":9===s.variant||11===s.variant||12===s.variant}])},[p(e.$slots,"default")],2)):u("",!0)],46,z))}});export{ya as t};
1
+ import{t as e}from"./useElementSize-CKA7EtNB.js";import{t as a}from"./useAnimationPause-DSOHlI2X.js";import{n as l}from"./utils-BmGYN0WH.js";import{Fragment as t,computed as r,createCommentVNode as u,createElementBlock as i,createElementVNode as n,defineComponent as s,nextTick as o,normalizeClass as v,normalizeStyle as d,onBeforeUnmount as c,onMounted as f,openBlock as h,renderList as m,renderSlot as p,shallowRef as k,unref as y,useId as $,useTemplateRef as g,watch as b}from"vue";var w={1:["#fff","#0de7c2"],2:["#3faacb","#fff"],3:["#7acaec","transparent"],4:["rgba(255, 255, 255, 0.3)","rgba(255, 255, 255, 0.3)"],5:["#3f96a5","#3f96a5"],6:["#7acaec","#7acaec"],7:["#1dc1f5","#1dc1f5"],8:["#3f96a5","#3f96a5"],9:["rgba(3, 166, 224, 0.8)","rgba(3, 166, 224, 0.5)"],10:["#00c2ff","rgba(0, 194, 255, 0.3)"],11:["#1a98fc","#2cf7fe"],12:["#2783ce","#2cf7fe"]},x={1:2e3,2:6e3,3:1500,4:3e3,5:1200,6:2e3,7:2800,8:2800,9:3e3,10:3e3,11:2800,12:3e3},_=0;function N(e,a,l,t){const r=e/(t+1),u=a/(l+1);return Array.from({length:l*t},(e,a)=>{const l=Math.floor(a/t);return[r*(a%t+1),u*(l+1)]})}var M=N(200,50,4,20),C=[M[39]??[0,0],M[37]??[0,0]];function S(e,a){const l=Math.min(100,Math.max(0,a))/100,t=e.trim().match(/^#([\da-f]{3}|[\da-f]{6})$/i)?.[1];if(t){const e=3===t.length?t.split("").map(e=>`${e}${e}`).join(""):t;return`rgba(${Number.parseInt(e.slice(0,2),16)}, ${Number.parseInt(e.slice(2,4),16)}, ${Number.parseInt(e.slice(4,6),16)}, ${l})`}const r=e.match(/^rgba?\(\s*([\d.]+)\s*,\s*([\d.]+)\s*,\s*([\d.]+)/i);return r?`rgba(${r[1]}, ${r[2]}, ${r[3]}, ${l})`:"transparent"===e.trim().toLowerCase()?"transparent":`color-mix(in srgb, ${e} ${a}%, transparent)`}function A(e){return e.slice(1).reduce((a,l,t)=>{const r=e[t];return r?a+Math.hypot(l[0]-r[0],l[1]-r[1]):a},0)}function j(e,a,l,t){return[e+Math.cos(t)*l,a+Math.sin(t)*l]}var z=["data-variant"],T={key:0,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 200 50"},P=["fill","x","y"],I=["begin","dur","values"],q=["fill","x","y"],B=["dur","values"],D=["dur","values"],R=["dur","values"],L=["dur","values"],F=["fill","x","y"],H=["dur","values"],E=["dur","values"],G=["height","width"],J=["fill","height","width","x","y"],K=["attributeName","dur","to"],O=["fill","x","y"],Q=["attributeName","dur","to"],U={key:2,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},V=["fill","x","y"],W=["begin","dur","values"],X=["height","width"],Y=["points","stroke"],Z=["points","stroke"],ee=["height","width"],ae=["points","stroke"],le=["dur","from","to"],te=["points","stroke"],re=["dur","from","to"],ue={key:5,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 300 35"},ie=["fill","height","x","y"],ne=["dur","values"],se=["dur","values"],oe={key:6,class:"lumal-decoration__chevrons"},ve={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},de=["stroke"],ce=["stroke"],fe={class:"lumal-decoration__content lumal-decoration__content--inline"},he={"aria-hidden":"true",focusable:"false",height:"20",viewBox:"0 0 21 20",width:"21"},me=["stroke"],pe=["stroke"],ke=["height","width"],ye=["points","stroke"],$e=["points","stroke"],ge=["points","stroke"],be={key:8,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",preserveAspectRatio:"none",viewBox:"0 0 100 100"},we=["stroke"],xe=["dur","values"],_e=["stroke"],Ne=["dur","values"],Me=["stroke"],Ce=["fill","href","stroke"],Se=["begin","dur","values"],Ae=["stroke"],je=["height","width"],ze=["points","stroke"],Te=["points","stroke","stroke-dasharray"],Pe=["id","begin","dur","values"],Ie=["begin","values"],qe=["points","stroke","stroke-dasharray"],Be=["id","begin","dur","values"],De=["begin","values"],Re=["points","stroke","stroke-dasharray"],Le=["id","begin","dur","values"],Fe=["begin","values"],He=["cx","cy","fill"],Ee=["id","begin","dur","values"],Ge=["cx","cy","fill"],Je=["id","begin","dur","values"],Ke=["begin","values"],Oe=["cx","cy","fill"],Qe=["id","begin","dur","values"],Ue=["begin","values"],Ve=["cx","cy","fill"],We=["id","begin","dur","values"],Xe=["begin","values"],Ye=["height","width"],Ze=["fill","stroke"],ea=["fill","points","stroke"],aa=["fill","points","stroke"],la=["fill","points","stroke"],ta=["fill","points","stroke"],ra=["points","stroke"],ua=["points","stroke"],ia=["height","width"],na=["d","stroke","stroke-width"],sa=["stop-color"],oa=["cx","cy","r","stroke"],va=["cx","cy","fill"],da=["dur","values"],ca=["dur"],fa=["cx","cy","fill"],ha=["points","stroke"],ma=["d","stroke"],pa=["href"],ka=["dur","values"],ya=/*@__PURE__*/s({__name:"LumalDecoration",props:{variant:{default:1},color:{default:void 0},colors:{default:void 0},background:{default:void 0},dur:{default:void 0},duration:{default:void 0},haloDur:{default:void 0},reverse:{type:Boolean,default:!1},scanDur:{default:void 0}},setup(s){const ya=s,$a=M.filter(()=>Math.random()>.6).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:1,point:e})),ga=N(300,35,2,25).map(e=>({animated:Math.random()>.6,beginSeconds:2*Math.random(),durationSeconds:Math.random()+1,point:e})),ba=N(300,35,1,40).map(e=>{const a=Math.random()>.8,l=a?24.5:7,t=Math.trunc(Math.random()*((a?35:17.5)-l+1)+l);return{colorIndex:Math.random()>.5?0:1,durationSeconds:Math.random()+1.5,height:t,minHeight:t*Math.random(),point:e}}),wa=Array.from({length:20},()=>Math.random()<=.4),xa=g("animationRef"),_a=e(xa),Na=a(xa),Ma=k(!1),Ca=k(!1),Sa=k(!1);let Aa;const ja=r(()=>_a.value.width),za=r(()=>_a.value.height),Ta=r(()=>{const e=w[ya.variant],a=ya.color??ya.colors;return[a?.[0]??e[0],a?.[1]??e[1]]}),Pa=r(()=>12===ya.variant?ya.scanDur:ya.dur),Ia=r(()=>{const e=void 0===Pa.value?ya.duration:1e3*Pa.value;return Math.max(0,e??x[ya.variant])}),qa=r(()=>Ia.value/x[ya.variant]),Ba=r(()=>Ia.value>0),Da=r(()=>{const e=ya.haloDur??2*qa.value;return`${Number(Math.max(.001,e).toFixed(6))}s`}),Ra=r(()=>Na.value||Ma.value||Ca.value||Sa.value||!Ba.value),La=r(()=>l(Ta.value,ya.background,Ia.value)),Fa=(Ha=$(),_+=1,`lumal-decoration-${Ha.replace(/[^\w-]/g,"")}-${_}`);var Ha;const Ea=`${Fa}-polygon`,Ga=`${Fa}-radar-group`,Ja=`${Fa}-radar-gradient`,Ka=[`${Fa}-sequence-1`,`${Fa}-sequence-2`,`${Fa}-sequence-3`,`${Fa}-sequence-4`,`${Fa}-sequence-5`,`${Fa}-sequence-6`,`${Fa}-sequence-7`],Oa=r(()=>[[0,.2*za.value],[.18*ja.value,.2*za.value],[.2*ja.value,.4*za.value],[.25*ja.value,.4*za.value],[.27*ja.value,.6*za.value],[.72*ja.value,.6*za.value],[.75*ja.value,.4*za.value],[.8*ja.value,.4*za.value],[.82*ja.value,.2*za.value],[ja.value,.2*za.value]]),Qa=r(()=>[[.3*ja.value,.8*za.value],[.7*ja.value,.8*za.value]]),Ua=r(()=>Oa.value.map(e=>e.join(",")).join(" ")),Va=r(()=>Qa.value.map(e=>e.join(",")).join(" ")),Wa=r(()=>A(Oa.value)),Xa=r(()=>A(Qa.value)),Ya=r(()=>function(e,a){const l=e/2,t=a/2,r=Math.PI/3,u=e/4,i=-Math.PI/2,n=r/30;let s=j(l,t,u,i);const o=Array.from({length:30},(e,a)=>{const r=j(l,t,u,i-(a+1)*n).map(e=>e.toFixed(5)),o=`M${s.join(",")} A${u}, ${u} 0 0 0 ${r.join(",")}`;return s=[Number(r[0]),Number(r[1])],o}),v=Math.max(0,e/2-.5)/3,d=Array.from({length:3},(e,a)=>v*(a+1)),c=Math.PI/6,f=e/2,h=Array.from({length:6},(e,a)=>{const r=c*(a+1),u=j(l,t,f,r),i=j(l,t,f,r+Math.PI);return`${u.join(",")} ${i.join(",")}`}),m=Math.max(0,e/2-1);return{arcPaths:Array.from({length:4},(e,a)=>{const r=c*(3*a+1),u=j(l,t,m,r),i=j(l,t,m,r+c);return`M${u.join(",")} A${l}, ${t} 0 0 1 ${i.join(",")}`}),circleRadii:d,scanPaths:o,splitLines:h}}(ja.value,za.value)),Za=r(()=>Ya.value.scanPaths.map((e,a,l)=>S(Ta.value[0],100-100*a/(l.length-1))));function el(e){const a=Math.max(.001,e*qa.value);return`${Number(a.toFixed(6))}s`}function al(e,a=!0){const l=e.map(String);return(ya.reverse&&a?l.reverse():l).join(";")}function ll(e){return ya.reverse?ja.value-e:e}function tl(e){Sa.value=e.matches}function rl(){return Array.from(xa.value?.querySelectorAll("svg")??[])}function ul(){for(const e of rl())Ra.value?e.pauseAnimations?.():e.unpauseAnimations?.()}function il(){for(const e of rl())e.setCurrentTime?.(0);ul()}function nl(e){const a=e.relatedTarget;Ca.value=Boolean(a&&xa.value?.contains(a))}return b(Ra,()=>{o(ul)},{immediate:!0}),b(()=>[ya.variant,ya.reverse,ya.color,ya.colors,ya.dur,ya.duration,ya.haloDur,ya.scanDur],()=>{o(il)},{flush:"post"}),f(()=>{"undefined"!=typeof window&&"function"==typeof window.matchMedia&&(Aa=window.matchMedia("(prefers-reduced-motion: reduce)"),tl(Aa),Aa.addEventListener?.("change",tl)),o(ul)}),c(()=>{Aa?.removeEventListener?.("change",tl)}),(e,a)=>(h(),i("div",{ref_key:"animationRef",ref:xa,class:v(["lumal-decoration",{"is-animation-paused":Ra.value,"is-reverse":s.reverse}]),"data-variant":s.variant,style:d(La.value),onMouseenter:a[0]||(a[0]=e=>Ma.value=!0),onMouseleave:a[1]||(a[1]=e=>Ma.value=!1),onFocusin:a[2]||(a[2]=e=>Ca.value=!0),onFocusout:nl},[1===s.variant?(h(),i("svg",T,[(h(!0),i(t,null,m(y($a),(e,a)=>(h(),i("rect",{key:a,class:"lumal-decoration__mark",fill:Ta.value[0],height:2.5,width:2.5,x:e.point[0]-1.25,y:e.point[1]-1.25},[e.animated&&Ba.value?(h(),i("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:el(e.durationSeconds),repeatCount:"indefinite",values:al([Ta.value[0],"transparent"])},null,8,I)):u("",!0)],8,P))),128)),n("rect",{fill:Ta.value[1],height:5,width:5,x:y(C)[0][0]-2.5,y:y(C)[0][1]-2.5},[Ba.value?(h(),i("animate",{key:0,attributeName:"width",dur:el(2),repeatCount:"indefinite",values:al([0,5])},null,8,B)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"height",dur:el(2),repeatCount:"indefinite",values:al([0,5])},null,8,D)):u("",!0),Ba.value?(h(),i("animate",{key:2,attributeName:"x",dur:el(2),repeatCount:"indefinite",values:al([y(C)[0][0],y(C)[0][0]-2.5])},null,8,R)):u("",!0),Ba.value?(h(),i("animate",{key:3,attributeName:"y",dur:el(2),repeatCount:"indefinite",values:al([y(C)[0][1],y(C)[0][1]-2.5])},null,8,L)):u("",!0)],8,q),n("rect",{fill:Ta.value[1],height:5,width:40,x:y(C)[1][0]-40,y:y(C)[1][1]-2.5},[Ba.value?(h(),i("animate",{key:0,attributeName:"width",dur:el(2),repeatCount:"indefinite",values:al([0,40,0])},null,8,H)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"x",dur:el(2),repeatCount:"indefinite",values:al([y(C)[1][0],y(C)[1][0]-40,y(C)[1][0]])},null,8,E)):u("",!0)],8,F)])):2===s.variant?(h(),i("svg",{key:1,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("rect",{fill:Ta.value[0],height:s.reverse?za.value:1,width:s.reverse?1:ja.value,x:s.reverse?ja.value/2:0,y:s.reverse?0:za.value/2},[Ba.value?(h(),i("animate",{key:0,attributeName:s.reverse?"height":"width",calcMode:"spline",dur:el(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:s.reverse?za.value:ja.value},null,8,K)):u("",!0)],8,J),n("rect",{fill:Ta.value[1],height:"1",width:"1",x:s.reverse?ja.value/2:0,y:s.reverse?0:za.value/2},[Ba.value?(h(),i("animate",{key:0,attributeName:s.reverse?"y":"x",calcMode:"spline",dur:el(6),from:"0",keySplines:".42,0,.58,1",keyTimes:"0;1",repeatCount:"indefinite",to:s.reverse?za.value:ja.value},null,8,Q)):u("",!0)],8,O)],8,G)):3===s.variant?(h(),i("svg",U,[(h(!0),i(t,null,m(y(ga),(e,a)=>(h(),i("rect",{key:a,class:"lumal-decoration__mark",fill:Ta.value[0],height:"7",width:"7",x:e.point[0]-3.5,y:e.point[1]-3.5},[e.animated&&Ba.value?(h(),i("animate",{key:0,attributeName:"fill",begin:`${e.beginSeconds}s`,dur:el(e.durationSeconds),repeatCount:"indefinite",values:al(Ta.value)},null,8,W)):u("",!0)],8,V))),128))])):4===s.variant?(h(),i("div",{key:3,class:v(["lumal-decoration__line-reveal",[s.reverse?"lumal-decoration__line-reveal--horizontal":"lumal-decoration__line-reveal--vertical",{"is-static":!Ba.value}]]),style:d({animationDuration:Ia.value/1e3+"s",height:s.reverse?"5px":`${za.value}px`,width:s.reverse?`${ja.value}px`:"5px"})},[(h(),i("svg",{"aria-hidden":"true",focusable:"false",height:s.reverse?5:za.value,width:s.reverse?ja.value:5},[n("polyline",{points:s.reverse?`0,2.5 ${ja.value},2.5`:`2.5,0 2.5,${za.value}`,stroke:Ta.value[0]},null,8,Y),n("polyline",{points:s.reverse?`0,2.5 ${ja.value},2.5`:`2.5,0 2.5,${za.value}`,stroke:Ta.value[1],"stroke-dasharray":"20,80","stroke-dashoffset":"-30","stroke-width":"3"},null,8,Z)],8,X))],6)):5===s.variant?(h(),i("svg",{key:4,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polyline",{fill:"transparent",points:Ua.value,stroke:Ta.value[0],"stroke-width":"3"},[Ba.value?(h(),i("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:el(1.2),from:`0, ${Wa.value/2}, 0, ${Wa.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${Wa.value}, 0`},null,8,le)):u("",!0)],8,ae),n("polyline",{fill:"transparent",points:Va.value,stroke:Ta.value[1],"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,attributeName:"stroke-dasharray",calcMode:"spline",dur:el(1.2),from:`0, ${Xa.value/2}, 0, ${Xa.value/2}`,keySplines:".4,1,.49,.98",keyTimes:"0;1",repeatCount:"indefinite",to:`0, 0, ${Xa.value}, 0`},null,8,re)):u("",!0)],8,te)],8,ee)):6===s.variant?(h(),i("svg",ue,[(h(!0),i(t,null,m(y(ba),(e,a)=>(h(),i("rect",{key:a,class:"lumal-decoration__bar",fill:Ta.value[e.colorIndex],height:e.height,width:"7",x:e.point[0]-3.5,y:e.point[1]-e.height/2},[Ba.value?(h(),i("animate",{key:0,attributeName:"y",begin:"0s",calcMode:"spline",dur:el(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:al([e.point[1]-e.minHeight/2,e.point[1]-e.height/2,e.point[1]-e.minHeight/2])},null,8,ne)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"height",begin:"0s",calcMode:"spline",dur:el(e.durationSeconds),keySplines:".42,0,.58,1;.42,0,.58,1",keyTimes:"0;.5;1",repeatCount:"indefinite",values:al([e.minHeight,e.height,e.minHeight])},null,8,se)):u("",!0)],8,ie))),128))])):7===s.variant?(h(),i("div",oe,[(h(),i("svg",ve,[n("polyline",{fill:"transparent",points:"10,0 19,10 10,20",stroke:Ta.value[0],"stroke-width":"4"},null,8,de),n("polyline",{fill:"transparent",points:"2,0 11,10 2,20",stroke:Ta.value[1],"stroke-width":"2"},null,8,ce)])),n("div",fe,[p(e.$slots,"default")]),(h(),i("svg",he,[n("polyline",{fill:"transparent",points:"11,0 2,10 11,20",stroke:Ta.value[0],"stroke-width":"4"},null,8,me),n("polyline",{fill:"transparent",points:"19,0 10,10 19,20",stroke:Ta.value[1],"stroke-width":"2"},null,8,pe)]))])):8===s.variant?(h(),i("svg",{key:7,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polyline",{fill:"transparent",points:`${ll(0)},0 ${ll(30)},${za.value/2}`,stroke:Ta.value[0],"stroke-width":"2"},null,8,ye),n("polyline",{fill:"transparent",points:`${ll(20)},0 ${ll(50)},${za.value/2} ${ll(ja.value)},${za.value/2}`,stroke:Ta.value[0],"stroke-width":"2"},null,8,$e),n("polyline",{fill:"transparent",points:`${ll(0)},${za.value-3} ${ll(200)},${za.value-3}`,stroke:Ta.value[1],"stroke-width":"3"},null,8,ge)],8,ke)):9===s.variant?(h(),i("svg",be,[n("defs",null,[n("polygon",{id:Ea,points:"15,46.5 21,47.5 21,52.5 15,53.5"})]),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"80,100,30,100",stroke:Ta.value[1],"stroke-width":"10"},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,xe)):u("",!0)],8,we),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"45","stroke-dasharray":"50,66,100,66",stroke:Ta.value[0],"stroke-width":"6"},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?"0 50 50;360 50 50":"0 50 50;-360 50 50"},null,8,Ne)):u("",!0)],8,_e),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"38","stroke-dasharray":"5,1",stroke:y(S)(Ta.value[1],30),"stroke-width":"1"},null,8,Me),(h(!0),i(t,null,m(y(wa),(e,a)=>(h(),i("use",{key:a,fill:e?Ta.value[0]:"transparent",href:`#${Ea}`,stroke:Ta.value[1]},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",begin:a*Ia.value/20/1e3+"s",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?"0 50 50;-360 50 50":"0 50 50;360 50 50"},null,8,Se)):u("",!0)],8,Ce))),128)),n("circle",{class:"lumal-decoration__ring",cx:"50",cy:"50",fill:"transparent",r:"26","stroke-dasharray":"5,1",stroke:y(S)(Ta.value[1],30),"stroke-width":"1"},null,8,Ae)])):10===s.variant?(h(),i("svg",{key:9,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polyline",{fill:"transparent",points:`${ll(0)},${za.value/2} ${ll(ja.value)},${za.value/2}`,stroke:Ta.value[1],"stroke-width":"2"},null,8,ze),n("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${ll(5)},${za.value/2} ${ll(.2*ja.value-3)},${za.value/2}`,stroke:Ta.value[0],"stroke-dasharray":"0,"+.2*ja.value,"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[1],attributeName:"stroke-dasharray",begin:`${Ka[0]}.end`,dur:el(3),fill:"freeze",values:`0,${.2*ja.value};${.2*ja.value},0`},null,8,Pe)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ja.value},0;0,${.2*ja.value}`},null,8,Ie)):u("",!0)],8,Te),n("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${ll(.2*ja.value+3)},${za.value/2} ${ll(.8*ja.value-3)},${za.value/2}`,stroke:Ta.value[0],"stroke-dasharray":"0,"+.6*ja.value,"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[3],attributeName:"stroke-dasharray",begin:`${Ka[2]}.end + ${el(1)}`,dur:el(3),fill:"freeze",values:`0,${.6*ja.value};${.6*ja.value},0`},null,8,Be)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.6*ja.value},0;0,${.6*ja.value}`},null,8,De)):u("",!0)],8,qe),n("polyline",{class:"lumal-decoration__segment",fill:"transparent",points:`${ll(.8*ja.value+3)},${za.value/2} ${ll(ja.value-5)},${za.value/2}`,stroke:Ta.value[0],"stroke-dasharray":"0,"+.2*ja.value,"stroke-width":"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[5],attributeName:"stroke-dasharray",begin:`${Ka[4]}.end + ${el(1)}`,dur:el(3),fill:"freeze",values:`0,${.2*ja.value};${.2*ja.value},0`},null,8,Le)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"stroke-dasharray",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${.2*ja.value},0;0,${.3*ja.value}`},null,8,Fe)):u("",!0)],8,Re),n("circle",{cx:ll(2),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[0],attributeName:"fill",begin:`0s;${Ka[6]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,Ee)):u("",!0)],8,He),n("circle",{cx:ll(.2*ja.value),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[2],attributeName:"fill",begin:`${Ka[1]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,Je)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"fill",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${Ta.value[1]};${Ta.value[1]}`},null,8,Ke)):u("",!0)],8,Ge),n("circle",{cx:ll(.8*ja.value),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[4],attributeName:"fill",begin:`${Ka[3]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,Qe)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"fill",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${Ta.value[1]};${Ta.value[1]}`},null,8,Ue)):u("",!0)],8,Oe),n("circle",{cx:ll(ja.value-2),cy:za.value/2,fill:Ta.value[1],r:"2"},[Ba.value?(h(),i("animate",{key:0,id:Ka[6],attributeName:"fill",begin:`${Ka[5]}.end`,dur:el(.3),fill:"freeze",values:`${Ta.value[1]};${Ta.value[0]}`},null,8,We)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"fill",begin:`${Ka[6]}.end`,dur:"0.01s",fill:"freeze",values:`${Ta.value[1]};${Ta.value[1]}`},null,8,Xe)):u("",!0)],8,Ve)],8,je)):11===s.variant?(h(),i("svg",{key:10,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("polygon",{fill:y(S)(Ta.value[1],10),points:"20 10,25 4,55 4,60 10",stroke:Ta.value[1]},null,8,Ze),n("polygon",{fill:y(S)(Ta.value[1],10),points:`20 ${za.value-10},25 ${za.value-4},55 ${za.value-4},60 ${za.value-10}`,stroke:Ta.value[1]},null,8,ea),n("polygon",{fill:y(S)(Ta.value[1],10),points:`${ja.value-20} 10,${ja.value-25} 4,${ja.value-55} 4,${ja.value-60} 10`,stroke:Ta.value[1]},null,8,aa),n("polygon",{fill:y(S)(Ta.value[1],10),points:`${ja.value-20} ${za.value-10},${ja.value-25} ${za.value-4},${ja.value-55} ${za.value-4},${ja.value-60} ${za.value-10}`,stroke:Ta.value[1]},null,8,la),n("polygon",{fill:y(S)(Ta.value[0],20),points:`20 10,5 ${za.value/2},20 ${za.value-10},${ja.value-20} ${za.value-10},${ja.value-5} ${za.value/2},${ja.value-20} 10`,stroke:Ta.value[0]},null,8,ta),n("polyline",{fill:"transparent",points:`25 18,15 ${za.value/2},25 ${za.value-18}`,stroke:y(S)(Ta.value[0],70)},null,8,ra),n("polyline",{fill:"transparent",points:`${ja.value-25} 18,${ja.value-15} ${za.value/2},${ja.value-25} ${za.value-18}`,stroke:y(S)(Ta.value[0],70)},null,8,ua)],8,Ye)):(h(),i("svg",{key:11,class:"lumal-decoration__svg","aria-hidden":"true",focusable:"false",height:za.value,width:ja.value},[n("defs",null,[n("g",{id:Ga},[(h(!0),i(t,null,m(Ya.value.scanPaths,(e,a)=>(h(),i("path",{key:e,fill:"transparent",d:e,stroke:Za.value[a],"stroke-width":ja.value/2},null,8,na))),128))]),n("radialGradient",{id:Ja,cx:"50%",cy:"50%",r:"50%"},[a[3]||(a[3]=n("stop",{offset:"0%","stop-color":"transparent","stop-opacity":"1"},null,-1)),n("stop",{offset:"100%","stop-color":y(S)(Ta.value[1],30),"stop-opacity":"1"},null,8,sa)])]),(h(!0),i(t,null,m(Ya.value.circleRadii,e=>(h(),i("circle",{key:e,cx:ja.value/2,cy:za.value/2,fill:"transparent",r:e,stroke:Ta.value[1],"stroke-width":"0.5"},null,8,oa))),128)),n("circle",{cx:ja.value/2,cy:za.value/2,fill:`url(#${Ja})`,r:"1",stroke:"transparent"},[Ba.value?(h(),i("animate",{key:0,attributeName:"r",dur:Da.value,repeatCount:"indefinite",values:"1;"+ja.value/2},null,8,da)):u("",!0),Ba.value?(h(),i("animate",{key:1,attributeName:"opacity",dur:Da.value,repeatCount:"indefinite",values:"1;0"},null,8,ca)):u("",!0)],8,va),n("circle",{cx:ja.value/2,cy:za.value/2,fill:Ta.value[1],r:"2"},null,8,fa),n("g",null,[(h(!0),i(t,null,m(Ya.value.splitLines,e=>(h(),i("polyline",{key:e,opacity:"0.5",points:e,stroke:Ta.value[1],"stroke-width":"0.5"},null,8,ha))),128))]),(h(!0),i(t,null,m(Ya.value.arcPaths,e=>(h(),i("path",{key:e,fill:"transparent",d:e,stroke:Ta.value[1],"stroke-width":"2"},null,8,ma))),128)),n("use",{href:`#${Ga}`},[Ba.value?(h(),i("animateTransform",{key:0,attributeName:"transform",dur:el(3),repeatCount:"indefinite",type:"rotate",values:s.reverse?`0,${ja.value/2} ${za.value/2};-360,${ja.value/2} ${za.value/2}`:`0,${ja.value/2} ${za.value/2};360,${ja.value/2} ${za.value/2}`},null,8,ka)):u("",!0)],8,pa)],8,ia)),7!==s.variant?(h(),i("div",{key:12,class:v(["lumal-decoration__content",{"lumal-decoration__content--centered":9===s.variant||11===s.variant||12===s.variant}])},[p(e.$slots,"default")],2)):u("",!0)],46,z))}});export{ya as t};
@@ -1 +1 @@
1
- import{t as e}from"./useElementSize-CKA7EtNB.js";import{t as l}from"./_plugin-vue_export-helper-DgLP3hnZ.js";import{a as o,o as a,r as n}from"./utils-BmGYN0WH.js";import{t as u}from"./useDataVScrollAnimation-BOXD7OZB.js";import{Fragment as r,computed as t,createCommentVNode as s,createElementBlock as i,createElementVNode as v,createTextVNode as d,defineComponent as c,normalizeClass as f,normalizeStyle as m,openBlock as g,renderList as p,renderSlot as w,shallowRef as h,toDisplayString as y,unref as x,useSlots as k,useTemplateRef as b,watch as I}from"vue";var M=["role","data-mode","aria-label"],_=["align"],R=["role","tabindex","onClick","onKeydown"],C={key:0,class:"ceil lumal-scroll-board__slot"},$=["align","onClick","onMouseenter"],B=/*#__PURE__*/l(/*@__PURE__*/c({__name:"LumalScrollBoard",props:{config:{default:()=>({})},rows:{default:void 0},rowKey:{type:[String,Function],default:void 0},columns:{default:()=>[]},visibleRows:{default:void 0},interval:{default:void 0},step:{default:void 0},autoplay:{type:Boolean,default:!0},ariaLabel:{default:"滚动数据表"}},emits:["click","mouseover","rowClick"],setup(l,{expose:c,emit:B}){const F=l,A=B,K=b("rootRef"),L=k(),S=e(K),j=h(F.config.data??[]),E=t(()=>void 0===F.rows),O=t(()=>!E.value&&Boolean(L.default)),G=t(()=>o(F.visibleRows??F.config.rowNum??5,5)),H=t(()=>Math.max(0,F.interval??F.config.waitTime??2e3)),T=t(()=>"page"===F.step?"page":F.config.carousel??"single"),D=t(()=>"page"===F.step||void 0===F.step&&"page"===T.value?G.value:o("number"==typeof F.step?F.step:1,1)),P=t(()=>!E.value||(F.config.hoverPause??!0)),z=t(()=>{if(!E.value)return F.columns.map(e=>e.label);const e=[...F.config.header??[]];return e.length&&F.config.index&&e.unshift(F.config.indexHeader??"#"),e}),N=t(()=>E.value?j.value.map((e,l)=>{const o=e.map(e=>({index:!1,value:e}));return F.config.index&&o.unshift({index:!0,value:l+1}),{cells:o,key:l,rowIndex:l}}):(F.rows??[]).map((e,l)=>({cells:F.columns.map(l=>({index:!1,value:Z(e,l)})),key:F.rowKey?a(e,l,F.rowKey):l,modernRow:e,rowIndex:l}))),V=t(()=>N.value[0]?.cells.length??z.value.length),W=t(()=>{if(!E.value)return F.columns.map(e=>e.width);const e=F.config.columnWidth??[],l=e.reduce((e,l)=>e+l,0),o=V.value-e.length,a=o>0?(S.value.width-l)/o:0;return Array.from({length:V.value},(l,o)=>e[o]??a)}),q=t(()=>Array.from({length:V.value},(e,l)=>E.value?F.config.align?.[l]??"left":F.columns[l]?.align??"left")),J=t(()=>z.value.length?Math.max(0,F.config.headerHeight??35):0),Q=t(()=>Math.max(0,S.value.height-J.value)),U=t(()=>Q.value/G.value),X=u({advanceBy:D,element:K,enabled:t(()=>F.autoplay&&H.value>0),hoverPause:P,rowCount:G,total:t(()=>N.value.length),waitTime:H}),Y=t(()=>{const e=N.value;if(!e.length)return[];if(e.length<=G.value)return e.map((e,l)=>({...e,renderKey:`${String(e.key)}-${l}`,slotIndex:l}));const l=E.value&&"page"===T.value?2*G.value:G.value+1;return Array.from({length:l},(l,o)=>{const a=(X.renderOffset.value+o)%e.length,n=e[a];return{...n,renderKey:`${String(n.key)}-${o}-${X.renderOffset.value}`,slotIndex:o}})});function Z(e,l){return e[l.key]}function ee(e,l){const o=e.cells[l];if(!o)return"";if(E.value)return"string"==typeof o.value||"number"==typeof o.value?o.value:String(o.value??"");const a=F.columns[l],n=e.modernRow;return a&&n?a.formatter?.(o.value,n,e.rowIndex)??("string"==typeof o.value||"number"==typeof o.value?o.value:""):""}function le(e){const l=W.value[e];return{flex:void 0===l?"1 1 0":"0 0 auto",textAlign:q.value[e],width:n(l)}}function oe(e){const l="page"===T.value?G.value:D.value,o=X.collapsing.value&&e.slotIndex<l?0:U.value;return{backgroundColor:e.rowIndex%2==0?F.config.evenRowBGC??"#0A2732":F.config.oddRowBGC??"#003B51",height:`${o}px`,lineHeight:`${o}px`}}function ae(e,l){const o=e.cells.map(e=>e.value);return{ceil:o[l],columnIndex:l,row:o,rowIndex:e.rowIndex}}function ne(e){!E.value&&e.modernRow&&A("rowClick",e.modernRow,e.rowIndex)}return I(()=>F.config.data,e=>{j.value=(e??[]).map(e=>[...e]),X.reset(0)}),I(()=>F.rows,()=>X.reset(0)),I(()=>F.config,()=>X.reset(0)),c({updateRows:function(e,l){j.value=e.map(e=>[...e]),X.reset("number"==typeof l?l:X.renderOffset.value)}}),(e,o)=>(g(),i("div",{ref_key:"rootRef",ref:K,class:f(["dv-scroll-board lumal-scroll-board",{"is-animation-paused":x(X).paused.value}]),role:O.value?"list":"table","data-mode":O.value?"list":"table","aria-label":l.ariaLabel,onMouseenter:o[3]||(o[3]=e=>!E.value&&x(X).onMouseEnter()),onMouseleave:o[4]||(o[4]=e=>!E.value&&x(X).onMouseLeave()),onFocusin:o[5]||(o[5]=(...e)=>x(X).onFocusIn&&x(X).onFocusIn(...e)),onFocusout:o[6]||(o[6]=(...e)=>x(X).onFocusOut&&x(X).onFocusOut(...e))},[z.value.length?(g(),i("div",{key:0,class:"header lumal-scroll-board__header",role:"row",style:m({backgroundColor:l.config.headerBGC??"#00BAFF"})},[(g(!0),i(r,null,p(z.value,(e,l)=>(g(),i("div",{key:`${e}-${l}`,class:"header-item",role:"columnheader",align:q.value[l],style:m({...le(l),height:`${J.value}px`,lineHeight:`${J.value}px`})},y(e),13,_))),128))],4)):s("",!0),v("div",{class:"rows lumal-scroll-board__viewport",style:m({height:`${Q.value}px`})},[(g(!0),i(r,null,p(Y.value,a=>(g(),i("div",{key:a.renderKey,class:"row-item lumal-scroll-board__row",role:O.value?"listitem":"row",style:m(oe(a)),tabindex:E.value||O.value?void 0:0,onClick:e=>ne(a),onKeydown:e=>function(e,l){E.value||O.value||e.target!==e.currentTarget||!["Enter"," "].includes(e.key)||(e.preventDefault(),ne(l))}(e,a),onMouseenter:o[1]||(o[1]=e=>!E.value&&x(X).onMouseEnter()),onMouseleave:o[2]||(o[2]=(...e)=>x(X).onMouseLeave&&x(X).onMouseLeave(...e))},[O.value&&a.modernRow?(g(),i("div",C,[w(e.$slots,"default",{row:a.modernRow,index:a.rowIndex},void 0,!0)])):(g(!0),i(r,{key:1},p(a.cells,(n,u)=>(g(),i("div",{key:u,class:"ceil lumal-scroll-board__cell",role:"cell",align:q.value[u],style:m(le(u)),onClick:e=>function(e,l){E.value&&A("click",ae(e,l))}(a,u),onMouseenter:e=>function(e,l){E.value&&A("mouseover",ae(e,l)),X.onMouseEnter()}(a,u),onMouseleave:o[0]||(o[0]=(...e)=>x(X).onMouseLeave&&x(X).onMouseLeave(...e))},[n.index?(g(),i("span",{key:0,class:"index",style:m({backgroundColor:l.config.headerBGC??"#00BAFF"})},y(n.value),5)):!E.value&&a.modernRow&&l.columns[u]?w(e.$slots,"cell",{key:1,row:a.modernRow,column:l.columns[u],value:n.value,rowIndex:a.rowIndex,columnIndex:u},()=>[d(y(ee(a,u)),1)],!0):(g(),i(r,{key:2},[d(y(ee(a,u)),1)],64))],44,$))),128))],44,R))),128))],4)],42,M))}}),[["__scopeId","data-v-99138671"]]);export{B as t};
1
+ import{t as e}from"./useElementSize-CKA7EtNB.js";import{t as l}from"./_plugin-vue_export-helper-DgLP3hnZ.js";import{a as o,o as a,r as n}from"./utils-BmGYN0WH.js";import{t as u}from"./useDataVScrollAnimation-BOXD7OZB.js";import{Fragment as r,computed as t,createCommentVNode as s,createElementBlock as i,createElementVNode as v,createTextVNode as d,defineComponent as c,normalizeClass as f,normalizeStyle as m,openBlock as g,renderList as p,renderSlot as w,shallowRef as h,toDisplayString as y,unref as x,useSlots as k,useTemplateRef as b,watch as I}from"vue";var M=["role","data-mode","aria-label"],_=["align"],R=["role","tabindex","onClick","onKeydown"],C={key:0,class:"ceil lumal-scroll-board__slot"},$=["align","onClick","onMouseenter"],B=/*#__PURE__*/l(/*@__PURE__*/c({__name:"LumalScrollBoard",props:{config:{default:()=>({})},rows:{default:void 0},rowKey:{type:[String,Function],default:void 0},columns:{default:()=>[]},visibleRows:{default:void 0},interval:{default:void 0},step:{default:void 0},autoplay:{type:Boolean,default:!0},ariaLabel:{default:"滚动数据表"}},emits:["click","mouseover","rowClick"],setup(l,{expose:c,emit:B}){const F=l,A=B,K=b("rootRef"),L=k(),S=e(K),j=h(F.config.data??[]),E=t(()=>void 0===F.rows),O=t(()=>!E.value&&Boolean(L.default)),G=t(()=>o(F.visibleRows??F.config.rowNum??5,5)),H=t(()=>Math.max(0,F.interval??F.config.waitTime??2e3)),T=t(()=>"page"===F.step?"page":F.config.carousel??"single"),D=t(()=>"page"===F.step||void 0===F.step&&"page"===T.value?G.value:o("number"==typeof F.step?F.step:1,1)),P=t(()=>!E.value||(F.config.hoverPause??!0)),z=t(()=>{if(!E.value)return F.columns.map(e=>e.label);const e=[...F.config.header??[]];return e.length&&F.config.index&&e.unshift(F.config.indexHeader??"#"),e}),N=t(()=>E.value?j.value.map((e,l)=>{const o=e.map(e=>({index:!1,value:e}));return F.config.index&&o.unshift({index:!0,value:l+1}),{cells:o,key:l,rowIndex:l}}):(F.rows??[]).map((e,l)=>({cells:F.columns.map(l=>({index:!1,value:Z(e,l)})),key:F.rowKey?a(e,l,F.rowKey):l,modernRow:e,rowIndex:l}))),V=t(()=>N.value[0]?.cells.length??z.value.length),W=t(()=>{if(!E.value)return F.columns.map(e=>e.width);const e=F.config.columnWidth??[],l=e.reduce((e,l)=>e+l,0),o=V.value-e.length,a=o>0?(S.value.width-l)/o:0;return Array.from({length:V.value},(l,o)=>e[o]??a)}),q=t(()=>Array.from({length:V.value},(e,l)=>E.value?F.config.align?.[l]??"left":F.columns[l]?.align??"left")),J=t(()=>z.value.length?Math.max(0,F.config.headerHeight??35):0),Q=t(()=>Math.max(0,S.value.height-J.value)),U=t(()=>Q.value/G.value),X=u({advanceBy:D,element:K,enabled:t(()=>F.autoplay&&H.value>0),hoverPause:P,rowCount:G,total:t(()=>N.value.length),waitTime:H}),Y=t(()=>{const e=N.value;if(!e.length)return[];if(e.length<=G.value)return e.map((e,l)=>({...e,renderKey:`${String(e.key)}-${l}`,slotIndex:l}));const l=E.value&&"page"===T.value?2*G.value:G.value+1;return Array.from({length:l},(l,o)=>{const a=(X.renderOffset.value+o)%e.length,n=e[a];return{...n,renderKey:`${String(n.key)}-${o}-${X.renderOffset.value}`,slotIndex:o}})});function Z(e,l){return e[l.key]}function ee(e,l){const o=e.cells[l];if(!o)return"";if(E.value)return"string"==typeof o.value||"number"==typeof o.value?o.value:String(o.value??"");const a=F.columns[l],n=e.modernRow;return a&&n?a.formatter?.(o.value,n,e.rowIndex)??("string"==typeof o.value||"number"==typeof o.value?o.value:""):""}function le(e){const l=W.value[e];return{flex:void 0===l?"1 1 0":"0 0 auto",textAlign:q.value[e],width:n(l)}}function oe(e){const l="page"===T.value?G.value:D.value,o=X.collapsing.value&&e.slotIndex<l?0:U.value;return{backgroundColor:e.rowIndex%2==0?F.config.evenRowBGC??"#0A2732":F.config.oddRowBGC??"#003B51",height:`${o}px`,lineHeight:`${o}px`}}function ae(e,l){const o=e.cells.map(e=>e.value);return{ceil:o[l],columnIndex:l,row:o,rowIndex:e.rowIndex}}function ne(e){!E.value&&e.modernRow&&A("rowClick",e.modernRow,e.rowIndex)}return I(()=>F.config.data,e=>{j.value=(e??[]).map(e=>[...e]),X.reset(0)}),I(()=>F.rows,()=>X.reset(0)),I(()=>F.config,()=>X.reset(0)),c({updateRows:function(e,l){j.value=e.map(e=>[...e]),X.reset("number"==typeof l?l:X.renderOffset.value)}}),(e,o)=>(g(),i("div",{ref_key:"rootRef",ref:K,class:f(["dv-scroll-board lumal-scroll-board",{"is-animation-paused":x(X).paused.value}]),role:O.value?"list":"table","data-mode":O.value?"list":"table","aria-label":l.ariaLabel,onMouseenter:o[3]||(o[3]=e=>!E.value&&x(X).onMouseEnter()),onMouseleave:o[4]||(o[4]=e=>!E.value&&x(X).onMouseLeave()),onFocusin:o[5]||(o[5]=(...e)=>x(X).onFocusIn&&x(X).onFocusIn(...e)),onFocusout:o[6]||(o[6]=(...e)=>x(X).onFocusOut&&x(X).onFocusOut(...e))},[z.value.length?(g(),i("div",{key:0,class:"header lumal-scroll-board__header",role:"row",style:m({backgroundColor:l.config.headerBGC??"#00BAFF"})},[(g(!0),i(r,null,p(z.value,(e,l)=>(g(),i("div",{key:`${e}-${l}`,class:"header-item",role:"columnheader",align:q.value[l],style:m({...le(l),height:`${J.value}px`,lineHeight:`${J.value}px`})},y(e),13,_))),128))],4)):s("",!0),v("div",{class:"rows lumal-scroll-board__viewport",style:m({height:`${Q.value}px`})},[(g(!0),i(r,null,p(Y.value,a=>(g(),i("div",{key:a.renderKey,class:"row-item lumal-scroll-board__row",role:O.value?"listitem":"row",style:m(oe(a)),tabindex:E.value||O.value?void 0:0,onClick:e=>ne(a),onKeydown:e=>function(e,l){E.value||O.value||e.target!==e.currentTarget||!["Enter"," "].includes(e.key)||(e.preventDefault(),ne(l))}(e,a),onMouseenter:o[1]||(o[1]=e=>!E.value&&x(X).onMouseEnter()),onMouseleave:o[2]||(o[2]=(...e)=>x(X).onMouseLeave&&x(X).onMouseLeave(...e))},[O.value&&a.modernRow?(g(),i("div",C,[w(e.$slots,"default",{row:a.modernRow,index:a.rowIndex},void 0,!0)])):(g(!0),i(r,{key:1},p(a.cells,(n,u)=>(g(),i("div",{key:u,class:"ceil lumal-scroll-board__cell",role:"cell",align:q.value[u],style:m(le(u)),onClick:e=>function(e,l){E.value&&A("click",ae(e,l))}(a,u),onMouseenter:e=>function(e,l){E.value&&A("mouseover",ae(e,l)),X.onMouseEnter()}(a,u),onMouseleave:o[0]||(o[0]=(...e)=>x(X).onMouseLeave&&x(X).onMouseLeave(...e))},[n.index?(g(),i("span",{key:0,class:"index",style:m({backgroundColor:l.config.headerBGC??"#00BAFF"})},y(n.value),5)):!E.value&&a.modernRow&&l.columns[u]?w(e.$slots,"cell",{key:1,row:a.modernRow,column:l.columns[u],value:n.value,rowIndex:a.rowIndex,columnIndex:u},()=>[d(y(ee(a,u)),1)],!0):(g(),i(r,{key:2},[d(y(ee(a,u)),1)],64))],44,$))),128))],44,R))),128))],4)],42,M))}}),[["__scopeId","data-v-101f9a6f"]]);export{B as t};
@@ -1 +1 @@
1
- const e=require("./useElementSize-CZjD5sCp.cjs"),o=require("./_plugin-vue_export-helper-BXystuG9.cjs"),l=require("./utils-W5S-hj72.cjs"),n=require("./useDataVScrollAnimation-C9_e6lZo.cjs");let t=require("vue");var a=["role","data-mode","aria-label"],r=["align"],u=["role","tabindex","onClick","onKeydown"],c={key:0,class:"ceil lumal-scroll-board__slot"},i=["align","onClick","onMouseenter"],s=(0,t.defineComponent)({__name:"LumalScrollBoard",props:{config:{default:()=>({})},rows:{default:void 0},rowKey:{type:[String,Function],default:void 0},columns:{default:()=>[]},visibleRows:{default:void 0},interval:{default:void 0},step:{default:void 0},autoplay:{type:Boolean,default:!0},ariaLabel:{default:"滚动数据表"}},emits:["click","mouseover","rowClick"],setup(o,{expose:s,emit:d}){const v=o,m=d,p=(0,t.useTemplateRef)("rootRef"),f=(0,t.useSlots)(),g=e.useElementSize(p),y=(0,t.shallowRef)(v.config.data??[]),w=(0,t.computed)(()=>void 0===v.rows),h=(0,t.computed)(()=>!w.value&&Boolean(f.default)),k=(0,t.computed)(()=>l.positiveInteger(v.visibleRows??v.config.rowNum??5,5)),x=(0,t.computed)(()=>Math.max(0,v.interval??v.config.waitTime??2e3)),B=(0,t.computed)(()=>"page"===v.step?"page":v.config.carousel??"single"),b=(0,t.computed)(()=>"page"===v.step||void 0===v.step&&"page"===B.value?k.value:l.positiveInteger("number"==typeof v.step?v.step:1,1)),S=(0,t.computed)(()=>!w.value||(v.config.hoverPause??!0)),_=(0,t.computed)(()=>{if(!w.value)return v.columns.map(e=>e.label);const e=[...v.config.header??[]];return e.length&&v.config.index&&e.unshift(v.config.indexHeader??"#"),e}),I=(0,t.computed)(()=>w.value?y.value.map((e,o)=>{const l=e.map(e=>({index:!1,value:e}));return v.config.index&&l.unshift({index:!0,value:o+1}),{cells:l,key:o,rowIndex:o}}):(v.rows??[]).map((e,o)=>({cells:v.columns.map(o=>({index:!1,value:A(e,o)})),key:v.rowKey?l.resolveRowKey(e,o,v.rowKey):o,modernRow:e,rowIndex:o}))),E=(0,t.computed)(()=>I.value[0]?.cells.length??_.value.length),M=(0,t.computed)(()=>{if(!w.value)return v.columns.map(e=>e.width);const e=v.config.columnWidth??[],o=e.reduce((e,o)=>e+o,0),l=E.value-e.length,n=l>0?(g.value.width-o)/l:0;return Array.from({length:E.value},(o,l)=>e[l]??n)}),R=(0,t.computed)(()=>Array.from({length:E.value},(e,o)=>w.value?v.config.align?.[o]??"left":v.columns[o]?.align??"left")),C=(0,t.computed)(()=>_.value.length?Math.max(0,v.config.headerHeight??35):0),F=(0,t.computed)(()=>Math.max(0,g.value.height-C.value)),$=(0,t.computed)(()=>F.value/k.value),L=n.useDataVScrollAnimation({advanceBy:b,element:p,enabled:(0,t.computed)(()=>v.autoplay&&x.value>0),hoverPause:S,rowCount:k,total:(0,t.computed)(()=>I.value.length),waitTime:x}),z=(0,t.computed)(()=>{const e=I.value;if(!e.length)return[];if(e.length<=k.value)return e.map((e,o)=>({...e,renderKey:`${String(e.key)}-${o}`,slotIndex:o}));const o=w.value&&"page"===B.value?2*k.value:k.value+1;return Array.from({length:o},(o,l)=>{const n=(L.renderOffset.value+l)%e.length,t=e[n];return{...t,renderKey:`${String(t.key)}-${l}-${L.renderOffset.value}`,slotIndex:l}})});function A(e,o){return e[o.key]}function K(e,o){const l=e.cells[o];if(!l)return"";if(w.value)return"string"==typeof l.value||"number"==typeof l.value?l.value:String(l.value??"");const n=v.columns[o],t=e.modernRow;return n&&t?n.formatter?.(l.value,t,e.rowIndex)??("string"==typeof l.value||"number"==typeof l.value?l.value:""):""}function D(e){const o=M.value[e];return{flex:void 0===o?"1 1 0":"0 0 auto",textAlign:R.value[e],width:l.cssSize(o)}}function j(e){const o="page"===B.value?k.value:b.value,l=L.collapsing.value&&e.slotIndex<o?0:$.value;return{backgroundColor:e.rowIndex%2==0?v.config.evenRowBGC??"#0A2732":v.config.oddRowBGC??"#003B51",height:`${l}px`,lineHeight:`${l}px`}}function O(e,o){const l=e.cells.map(e=>e.value);return{ceil:l[o],columnIndex:o,row:l,rowIndex:e.rowIndex}}function T(e){!w.value&&e.modernRow&&m("rowClick",e.modernRow,e.rowIndex)}return(0,t.watch)(()=>v.config.data,e=>{y.value=(e??[]).map(e=>[...e]),L.reset(0)}),(0,t.watch)(()=>v.rows,()=>L.reset(0)),(0,t.watch)(()=>v.config,()=>L.reset(0)),s({updateRows:function(e,o){y.value=e.map(e=>[...e]),L.reset("number"==typeof o?o:L.renderOffset.value)}}),(e,l)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{ref_key:"rootRef",ref:p,class:(0,t.normalizeClass)(["dv-scroll-board lumal-scroll-board",{"is-animation-paused":(0,t.unref)(L).paused.value}]),role:h.value?"list":"table","data-mode":h.value?"list":"table","aria-label":o.ariaLabel,onMouseenter:l[3]||(l[3]=e=>!w.value&&(0,t.unref)(L).onMouseEnter()),onMouseleave:l[4]||(l[4]=e=>!w.value&&(0,t.unref)(L).onMouseLeave()),onFocusin:l[5]||(l[5]=(...e)=>(0,t.unref)(L).onFocusIn&&(0,t.unref)(L).onFocusIn(...e)),onFocusout:l[6]||(l[6]=(...e)=>(0,t.unref)(L).onFocusOut&&(0,t.unref)(L).onFocusOut(...e))},[_.value.length?((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:0,class:"header lumal-scroll-board__header",role:"row",style:(0,t.normalizeStyle)({backgroundColor:o.config.headerBGC??"#00BAFF"})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_.value,(e,o)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:`${e}-${o}`,class:"header-item",role:"columnheader",align:R.value[o],style:(0,t.normalizeStyle)({...D(o),height:`${C.value}px`,lineHeight:`${C.value}px`})},(0,t.toDisplayString)(e),13,r))),128))],4)):(0,t.createCommentVNode)("",!0),(0,t.createElementVNode)("div",{class:"rows lumal-scroll-board__viewport",style:(0,t.normalizeStyle)({height:`${F.value}px`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(z.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:n.renderKey,class:"row-item lumal-scroll-board__row",role:h.value?"listitem":"row",style:(0,t.normalizeStyle)(j(n)),tabindex:w.value||h.value?void 0:0,onClick:e=>T(n),onKeydown:e=>function(e,o){w.value||h.value||e.target!==e.currentTarget||!["Enter"," "].includes(e.key)||(e.preventDefault(),T(o))}(e,n),onMouseenter:l[1]||(l[1]=e=>!w.value&&(0,t.unref)(L).onMouseEnter()),onMouseleave:l[2]||(l[2]=(...e)=>(0,t.unref)(L).onMouseLeave&&(0,t.unref)(L).onMouseLeave(...e))},[h.value&&n.modernRow?((0,t.openBlock)(),(0,t.createElementBlock)("div",c,[(0,t.renderSlot)(e.$slots,"default",{row:n.modernRow,index:n.rowIndex},void 0,!0)])):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(n.cells,(a,r)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:r,class:"ceil lumal-scroll-board__cell",role:"cell",align:R.value[r],style:(0,t.normalizeStyle)(D(r)),onClick:e=>function(e,o){w.value&&m("click",O(e,o))}(n,r),onMouseenter:e=>function(e,o){w.value&&m("mouseover",O(e,o)),L.onMouseEnter()}(n,r),onMouseleave:l[0]||(l[0]=(...e)=>(0,t.unref)(L).onMouseLeave&&(0,t.unref)(L).onMouseLeave(...e))},[a.index?((0,t.openBlock)(),(0,t.createElementBlock)("span",{key:0,class:"index",style:(0,t.normalizeStyle)({backgroundColor:o.config.headerBGC??"#00BAFF"})},(0,t.toDisplayString)(a.value),5)):!w.value&&n.modernRow&&o.columns[r]?(0,t.renderSlot)(e.$slots,"cell",{key:1,row:n.modernRow,column:o.columns[r],value:a.value,rowIndex:n.rowIndex,columnIndex:r},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(K(n,r)),1)],!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.createTextVNode)((0,t.toDisplayString)(K(n,r)),1)],64))],44,i))),128))],44,u))),128))],4)],42,a))}}),d=o._plugin_vue_export_helper_default(s,[["__scopeId","data-v-99138671"]]);Object.defineProperty(exports,"LumalScrollBoard_default",{enumerable:!0,get:function(){return d}});
1
+ const e=require("./useElementSize-CZjD5sCp.cjs"),o=require("./_plugin-vue_export-helper-BXystuG9.cjs"),l=require("./utils-W5S-hj72.cjs"),n=require("./useDataVScrollAnimation-C9_e6lZo.cjs");let t=require("vue");var a=["role","data-mode","aria-label"],r=["align"],u=["role","tabindex","onClick","onKeydown"],c={key:0,class:"ceil lumal-scroll-board__slot"},i=["align","onClick","onMouseenter"],s=(0,t.defineComponent)({__name:"LumalScrollBoard",props:{config:{default:()=>({})},rows:{default:void 0},rowKey:{type:[String,Function],default:void 0},columns:{default:()=>[]},visibleRows:{default:void 0},interval:{default:void 0},step:{default:void 0},autoplay:{type:Boolean,default:!0},ariaLabel:{default:"滚动数据表"}},emits:["click","mouseover","rowClick"],setup(o,{expose:s,emit:d}){const v=o,m=d,p=(0,t.useTemplateRef)("rootRef"),f=(0,t.useSlots)(),g=e.useElementSize(p),y=(0,t.shallowRef)(v.config.data??[]),w=(0,t.computed)(()=>void 0===v.rows),h=(0,t.computed)(()=>!w.value&&Boolean(f.default)),k=(0,t.computed)(()=>l.positiveInteger(v.visibleRows??v.config.rowNum??5,5)),x=(0,t.computed)(()=>Math.max(0,v.interval??v.config.waitTime??2e3)),B=(0,t.computed)(()=>"page"===v.step?"page":v.config.carousel??"single"),b=(0,t.computed)(()=>"page"===v.step||void 0===v.step&&"page"===B.value?k.value:l.positiveInteger("number"==typeof v.step?v.step:1,1)),S=(0,t.computed)(()=>!w.value||(v.config.hoverPause??!0)),_=(0,t.computed)(()=>{if(!w.value)return v.columns.map(e=>e.label);const e=[...v.config.header??[]];return e.length&&v.config.index&&e.unshift(v.config.indexHeader??"#"),e}),I=(0,t.computed)(()=>w.value?y.value.map((e,o)=>{const l=e.map(e=>({index:!1,value:e}));return v.config.index&&l.unshift({index:!0,value:o+1}),{cells:l,key:o,rowIndex:o}}):(v.rows??[]).map((e,o)=>({cells:v.columns.map(o=>({index:!1,value:A(e,o)})),key:v.rowKey?l.resolveRowKey(e,o,v.rowKey):o,modernRow:e,rowIndex:o}))),E=(0,t.computed)(()=>I.value[0]?.cells.length??_.value.length),M=(0,t.computed)(()=>{if(!w.value)return v.columns.map(e=>e.width);const e=v.config.columnWidth??[],o=e.reduce((e,o)=>e+o,0),l=E.value-e.length,n=l>0?(g.value.width-o)/l:0;return Array.from({length:E.value},(o,l)=>e[l]??n)}),R=(0,t.computed)(()=>Array.from({length:E.value},(e,o)=>w.value?v.config.align?.[o]??"left":v.columns[o]?.align??"left")),C=(0,t.computed)(()=>_.value.length?Math.max(0,v.config.headerHeight??35):0),F=(0,t.computed)(()=>Math.max(0,g.value.height-C.value)),$=(0,t.computed)(()=>F.value/k.value),L=n.useDataVScrollAnimation({advanceBy:b,element:p,enabled:(0,t.computed)(()=>v.autoplay&&x.value>0),hoverPause:S,rowCount:k,total:(0,t.computed)(()=>I.value.length),waitTime:x}),z=(0,t.computed)(()=>{const e=I.value;if(!e.length)return[];if(e.length<=k.value)return e.map((e,o)=>({...e,renderKey:`${String(e.key)}-${o}`,slotIndex:o}));const o=w.value&&"page"===B.value?2*k.value:k.value+1;return Array.from({length:o},(o,l)=>{const n=(L.renderOffset.value+l)%e.length,t=e[n];return{...t,renderKey:`${String(t.key)}-${l}-${L.renderOffset.value}`,slotIndex:l}})});function A(e,o){return e[o.key]}function K(e,o){const l=e.cells[o];if(!l)return"";if(w.value)return"string"==typeof l.value||"number"==typeof l.value?l.value:String(l.value??"");const n=v.columns[o],t=e.modernRow;return n&&t?n.formatter?.(l.value,t,e.rowIndex)??("string"==typeof l.value||"number"==typeof l.value?l.value:""):""}function D(e){const o=M.value[e];return{flex:void 0===o?"1 1 0":"0 0 auto",textAlign:R.value[e],width:l.cssSize(o)}}function j(e){const o="page"===B.value?k.value:b.value,l=L.collapsing.value&&e.slotIndex<o?0:$.value;return{backgroundColor:e.rowIndex%2==0?v.config.evenRowBGC??"#0A2732":v.config.oddRowBGC??"#003B51",height:`${l}px`,lineHeight:`${l}px`}}function O(e,o){const l=e.cells.map(e=>e.value);return{ceil:l[o],columnIndex:o,row:l,rowIndex:e.rowIndex}}function T(e){!w.value&&e.modernRow&&m("rowClick",e.modernRow,e.rowIndex)}return(0,t.watch)(()=>v.config.data,e=>{y.value=(e??[]).map(e=>[...e]),L.reset(0)}),(0,t.watch)(()=>v.rows,()=>L.reset(0)),(0,t.watch)(()=>v.config,()=>L.reset(0)),s({updateRows:function(e,o){y.value=e.map(e=>[...e]),L.reset("number"==typeof o?o:L.renderOffset.value)}}),(e,l)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{ref_key:"rootRef",ref:p,class:(0,t.normalizeClass)(["dv-scroll-board lumal-scroll-board",{"is-animation-paused":(0,t.unref)(L).paused.value}]),role:h.value?"list":"table","data-mode":h.value?"list":"table","aria-label":o.ariaLabel,onMouseenter:l[3]||(l[3]=e=>!w.value&&(0,t.unref)(L).onMouseEnter()),onMouseleave:l[4]||(l[4]=e=>!w.value&&(0,t.unref)(L).onMouseLeave()),onFocusin:l[5]||(l[5]=(...e)=>(0,t.unref)(L).onFocusIn&&(0,t.unref)(L).onFocusIn(...e)),onFocusout:l[6]||(l[6]=(...e)=>(0,t.unref)(L).onFocusOut&&(0,t.unref)(L).onFocusOut(...e))},[_.value.length?((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:0,class:"header lumal-scroll-board__header",role:"row",style:(0,t.normalizeStyle)({backgroundColor:o.config.headerBGC??"#00BAFF"})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_.value,(e,o)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:`${e}-${o}`,class:"header-item",role:"columnheader",align:R.value[o],style:(0,t.normalizeStyle)({...D(o),height:`${C.value}px`,lineHeight:`${C.value}px`})},(0,t.toDisplayString)(e),13,r))),128))],4)):(0,t.createCommentVNode)("",!0),(0,t.createElementVNode)("div",{class:"rows lumal-scroll-board__viewport",style:(0,t.normalizeStyle)({height:`${F.value}px`})},[((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(z.value,n=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:n.renderKey,class:"row-item lumal-scroll-board__row",role:h.value?"listitem":"row",style:(0,t.normalizeStyle)(j(n)),tabindex:w.value||h.value?void 0:0,onClick:e=>T(n),onKeydown:e=>function(e,o){w.value||h.value||e.target!==e.currentTarget||!["Enter"," "].includes(e.key)||(e.preventDefault(),T(o))}(e,n),onMouseenter:l[1]||(l[1]=e=>!w.value&&(0,t.unref)(L).onMouseEnter()),onMouseleave:l[2]||(l[2]=(...e)=>(0,t.unref)(L).onMouseLeave&&(0,t.unref)(L).onMouseLeave(...e))},[h.value&&n.modernRow?((0,t.openBlock)(),(0,t.createElementBlock)("div",c,[(0,t.renderSlot)(e.$slots,"default",{row:n.modernRow,index:n.rowIndex},void 0,!0)])):((0,t.openBlock)(!0),(0,t.createElementBlock)(t.Fragment,{key:1},(0,t.renderList)(n.cells,(a,r)=>((0,t.openBlock)(),(0,t.createElementBlock)("div",{key:r,class:"ceil lumal-scroll-board__cell",role:"cell",align:R.value[r],style:(0,t.normalizeStyle)(D(r)),onClick:e=>function(e,o){w.value&&m("click",O(e,o))}(n,r),onMouseenter:e=>function(e,o){w.value&&m("mouseover",O(e,o)),L.onMouseEnter()}(n,r),onMouseleave:l[0]||(l[0]=(...e)=>(0,t.unref)(L).onMouseLeave&&(0,t.unref)(L).onMouseLeave(...e))},[a.index?((0,t.openBlock)(),(0,t.createElementBlock)("span",{key:0,class:"index",style:(0,t.normalizeStyle)({backgroundColor:o.config.headerBGC??"#00BAFF"})},(0,t.toDisplayString)(a.value),5)):!w.value&&n.modernRow&&o.columns[r]?(0,t.renderSlot)(e.$slots,"cell",{key:1,row:n.modernRow,column:o.columns[r],value:a.value,rowIndex:n.rowIndex,columnIndex:r},()=>[(0,t.createTextVNode)((0,t.toDisplayString)(K(n,r)),1)],!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:2},[(0,t.createTextVNode)((0,t.toDisplayString)(K(n,r)),1)],64))],44,i))),128))],44,u))),128))],4)],42,a))}}),d=o._plugin_vue_export_helper_default(s,[["__scopeId","data-v-101f9a6f"]]);Object.defineProperty(exports,"LumalScrollBoard_default",{enumerable:!0,get:function(){return d}});
@@ -1 +1 @@
1
- const e=require("./_plugin-vue_export-helper-BXystuG9.cjs"),a=require("./utils-W5S-hj72.cjs"),t=require("./useDataVScrollAnimation-C9_e6lZo.cjs");let n=require("vue");var l=["aria-label"],o={class:"lumal-scroll-ranking-board__viewport"},r={class:"lumal-scroll-ranking-board__slot"},u={class:"ranking-info lumal-scroll-ranking-board__summary"},i={class:"rank lumal-scroll-ranking-board__rank"},s={class:"info-name lumal-scroll-ranking-board__label"},c={class:"ranking-value"},m={class:"ranking-column lumal-scroll-ranking-board__track","aria-hidden":"true"},d=(0,n.defineComponent)({__name:"LumalScrollRankingBoard",props:{config:{default:()=>({})},items:{default:void 0},visibleRows:{default:void 0},interval:{default:void 0},autoplay:{type:Boolean,default:!0},sort:{type:[Boolean,String],default:void 0},unit:{default:void 0},formatter:{type:Function,default:void 0},ariaLabel:{default:"滚动排名"}},setup(e){const d=e,v=(0,n.useTemplateRef)("rootRef"),p=(0,n.shallowRef)(d.config.data??[]),f=(0,n.computed)(()=>void 0===d.items),g=(0,n.computed)(()=>a.positiveInteger(d.visibleRows??d.config.rowNum??5,5)),k=(0,n.computed)(()=>Math.max(0,d.interval??d.config.waitTime??2e3)),y=(0,n.computed)(()=>d.config.carousel??"single"),h=(0,n.computed)(()=>"page"===y.value?g.value:1),_=(0,n.computed)(()=>d.unit??d.config.unit??""),b=(0,n.computed)(()=>{if(!f.value){const e=[...d.items??[]],a=d.sort??"desc";a&&e.sort((e,t)=>"asc"===a?e.value-t.value:t.value-e.value);const t=Math.max(1,...e.map(e=>Math.max(0,e.value)));return e.map((e,a)=>({item:e,key:e.key,percent:Math.min(100,Math.max(0,e.value/t*100)),ranking:a+1,sourceIndex:a,value:e.value}))}const e=p.value.map(e=>({...e}));(d.config.sort??1)&&e.sort((e,a)=>a.value-e.value);const a=e.map(e=>e.value),t=a.length?Math.min(...a):0,n=a.length?Math.max(...a):0,l=Math.abs(t),o=n+l;return e.map((e,a)=>{const t=o?(e.value+l)/o*100:0;return{computedItem:{...e,percent:t,ranking:a+1,scroll:a},item:{data:e.data,key:"string"==typeof e.key||"number"==typeof e.key?e.key:`${e.name}-${a}`,label:e.name,value:e.value},key:`${e.name}-${a}`,percent:t,ranking:a+1,sourceIndex:a,value:e.value}})}),x=t.useDataVScrollAnimation({advanceBy:h,element:v,enabled:(0,n.computed)(()=>d.autoplay&&k.value>0),hoverPause:(0,n.computed)(()=>!0),rowCount:g,total:(0,n.computed)(()=>b.value.length),waitTime:k}),M=(0,n.computed)(()=>{const e=b.value;return e.length?e.length<=g.value?e.map((e,a)=>({...e,renderKey:`${String(e.key)}-${a}`,slotIndex:a})):Array.from({length:g.value+1},(a,t)=>{const n=(x.renderOffset.value+t)%e.length,l=e[n];return{...l,renderKey:`${String(l.key)}-${t}-${x.renderOffset.value}`,slotIndex:t}}):[]}),E=(0,n.computed)(()=>100/g.value);function I(e){return Math.min(1,Math.max(0,e.percent/100))}function w(e){const t="page"===y.value?g.value:1,n=x.collapsing.value&&e.slotIndex<t?0:E.value;return{"--lumal-ranking-color":f.value?"#1370fb":a.itemColor(e.item,e.sourceIndex),"--lumal-ranking-ratio":I(e),height:`${n}%`}}function $(e){return f.value&&d.config.valueFormatter&&e.computedItem?d.config.valueFormatter(e.computedItem):d.formatter?.(e.value,e.item,e.sourceIndex)??`${e.value}${_.value}`}return(0,n.watch)(()=>d.config.data,e=>{p.value=(e??[]).map(e=>({...e})),x.reset(0)}),(0,n.watch)(()=>d.items,()=>x.reset(0)),(0,n.watch)(()=>d.config,()=>x.reset(0)),(a,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"rootRef",ref:v,class:(0,n.normalizeClass)(["dv-scroll-ranking-board lumal-scroll-ranking-board",{"is-animation-paused":(0,n.unref)(x).paused.value}]),role:"list","aria-label":e.ariaLabel,onMouseenter:t[0]||(t[0]=(...e)=>(0,n.unref)(x).onMouseEnter&&(0,n.unref)(x).onMouseEnter(...e)),onMouseleave:t[1]||(t[1]=(...e)=>(0,n.unref)(x).onMouseLeave&&(0,n.unref)(x).onMouseLeave(...e)),onFocusin:t[2]||(t[2]=(...e)=>(0,n.unref)(x).onFocusIn&&(0,n.unref)(x).onFocusIn(...e)),onFocusout:t[3]||(t[3]=(...e)=>(0,n.unref)(x).onFocusOut&&(0,n.unref)(x).onFocusOut(...e))},[(0,n.createElementVNode)("div",o,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(M.value,e=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.renderKey,class:"row-item lumal-scroll-ranking-board__row",role:"listitem",style:(0,n.normalizeStyle)(w(e))},[(0,n.createElementVNode)("div",r,[(0,n.renderSlot)(a.$slots,"default",{item:e.item,index:e.sourceIndex,ratio:I(e)},()=>[(0,n.createElementVNode)("div",u,[(0,n.createElementVNode)("div",i,"No."+(0,n.toDisplayString)(e.ranking),1),(0,n.createElementVNode)("div",s,(0,n.toDisplayString)(e.item.label),1),(0,n.createElementVNode)("div",c,[(0,n.createElementVNode)("strong",null,(0,n.toDisplayString)($(e)),1)])]),(0,n.createElementVNode)("div",m,[(0,n.createElementVNode)("div",{class:"inside-column",style:(0,n.normalizeStyle)({width:`${e.percent}%`})},[...t[4]||(t[4]=[(0,n.createElementVNode)("div",{class:"shine"},null,-1)])],4)])],!0)])],4))),128))])],42,l))}}),v=e._plugin_vue_export_helper_default(d,[["__scopeId","data-v-546d1e97"]]);Object.defineProperty(exports,"LumalScrollRankingBoard_default",{enumerable:!0,get:function(){return v}});
1
+ const e=require("./_plugin-vue_export-helper-BXystuG9.cjs"),a=require("./utils-W5S-hj72.cjs"),t=require("./useDataVScrollAnimation-C9_e6lZo.cjs");let n=require("vue");var l=["aria-label"],o={class:"lumal-scroll-ranking-board__viewport"},r={class:"lumal-scroll-ranking-board__slot"},u={class:"ranking-info lumal-scroll-ranking-board__summary"},i={class:"rank lumal-scroll-ranking-board__rank"},s={class:"info-name lumal-scroll-ranking-board__label"},c={class:"ranking-value"},m={class:"ranking-column lumal-scroll-ranking-board__track","aria-hidden":"true"},d=(0,n.defineComponent)({__name:"LumalScrollRankingBoard",props:{config:{default:()=>({})},items:{default:void 0},visibleRows:{default:void 0},interval:{default:void 0},autoplay:{type:Boolean,default:!0},sort:{type:[Boolean,String],default:void 0},unit:{default:void 0},formatter:{type:Function,default:void 0},ariaLabel:{default:"滚动排名"}},setup(e){const d=e,v=(0,n.useTemplateRef)("rootRef"),p=(0,n.shallowRef)(d.config.data??[]),f=(0,n.computed)(()=>void 0===d.items),g=(0,n.computed)(()=>a.positiveInteger(d.visibleRows??d.config.rowNum??5,5)),k=(0,n.computed)(()=>Math.max(0,d.interval??d.config.waitTime??2e3)),y=(0,n.computed)(()=>d.config.carousel??"single"),h=(0,n.computed)(()=>"page"===y.value?g.value:1),_=(0,n.computed)(()=>d.unit??d.config.unit??""),b=(0,n.computed)(()=>{if(!f.value){const e=[...d.items??[]],a=d.sort??"desc";a&&e.sort((e,t)=>"asc"===a?e.value-t.value:t.value-e.value);const t=Math.max(1,...e.map(e=>Math.max(0,e.value)));return e.map((e,a)=>({item:e,key:e.key,percent:Math.min(100,Math.max(0,e.value/t*100)),ranking:a+1,sourceIndex:a,value:e.value}))}const e=p.value.map(e=>({...e}));(d.config.sort??1)&&e.sort((e,a)=>a.value-e.value);const a=e.map(e=>e.value),t=a.length?Math.min(...a):0,n=a.length?Math.max(...a):0,l=Math.abs(t),o=n+l;return e.map((e,a)=>{const t=o?(e.value+l)/o*100:0;return{computedItem:{...e,percent:t,ranking:a+1,scroll:a},item:{data:e.data,key:"string"==typeof e.key||"number"==typeof e.key?e.key:`${e.name}-${a}`,label:e.name,value:e.value},key:`${e.name}-${a}`,percent:t,ranking:a+1,sourceIndex:a,value:e.value}})}),x=t.useDataVScrollAnimation({advanceBy:h,element:v,enabled:(0,n.computed)(()=>d.autoplay&&k.value>0),hoverPause:(0,n.computed)(()=>!0),rowCount:g,total:(0,n.computed)(()=>b.value.length),waitTime:k}),M=(0,n.computed)(()=>{const e=b.value;return e.length?e.length<=g.value?e.map((e,a)=>({...e,renderKey:`${String(e.key)}-${a}`,slotIndex:a})):Array.from({length:g.value+1},(a,t)=>{const n=(x.renderOffset.value+t)%e.length,l=e[n];return{...l,renderKey:`${String(l.key)}-${t}-${x.renderOffset.value}`,slotIndex:t}}):[]}),E=(0,n.computed)(()=>100/g.value);function I(e){return Math.min(1,Math.max(0,e.percent/100))}function w(e){const t="page"===y.value?g.value:1,n=x.collapsing.value&&e.slotIndex<t?0:E.value;return{"--lumal-ranking-color":f.value?"#1370fb":a.itemColor(e.item,e.sourceIndex),"--lumal-ranking-ratio":I(e),height:`${n}%`}}function $(e){return f.value&&d.config.valueFormatter&&e.computedItem?d.config.valueFormatter(e.computedItem):d.formatter?.(e.value,e.item,e.sourceIndex)??`${e.value}${_.value}`}return(0,n.watch)(()=>d.config.data,e=>{p.value=(e??[]).map(e=>({...e})),x.reset(0)}),(0,n.watch)(()=>d.items,()=>x.reset(0)),(0,n.watch)(()=>d.config,()=>x.reset(0)),(a,t)=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{ref_key:"rootRef",ref:v,class:(0,n.normalizeClass)(["dv-scroll-ranking-board lumal-scroll-ranking-board",{"is-animation-paused":(0,n.unref)(x).paused.value}]),role:"list","aria-label":e.ariaLabel,onMouseenter:t[0]||(t[0]=(...e)=>(0,n.unref)(x).onMouseEnter&&(0,n.unref)(x).onMouseEnter(...e)),onMouseleave:t[1]||(t[1]=(...e)=>(0,n.unref)(x).onMouseLeave&&(0,n.unref)(x).onMouseLeave(...e)),onFocusin:t[2]||(t[2]=(...e)=>(0,n.unref)(x).onFocusIn&&(0,n.unref)(x).onFocusIn(...e)),onFocusout:t[3]||(t[3]=(...e)=>(0,n.unref)(x).onFocusOut&&(0,n.unref)(x).onFocusOut(...e))},[(0,n.createElementVNode)("div",o,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(M.value,e=>((0,n.openBlock)(),(0,n.createElementBlock)("div",{key:e.renderKey,class:"row-item lumal-scroll-ranking-board__row",role:"listitem",style:(0,n.normalizeStyle)(w(e))},[(0,n.createElementVNode)("div",r,[(0,n.renderSlot)(a.$slots,"default",{item:e.item,index:e.sourceIndex,ratio:I(e)},()=>[(0,n.createElementVNode)("div",u,[(0,n.createElementVNode)("div",i," No."+(0,n.toDisplayString)(e.ranking),1),(0,n.createElementVNode)("div",s,(0,n.toDisplayString)(e.item.label),1),(0,n.createElementVNode)("div",c,[(0,n.createElementVNode)("strong",null,(0,n.toDisplayString)($(e)),1)])]),(0,n.createElementVNode)("div",m,[(0,n.createElementVNode)("div",{class:"inside-column",style:(0,n.normalizeStyle)({width:`${e.percent}%`})},[...t[4]||(t[4]=[(0,n.createElementVNode)("div",{class:"shine"},null,-1)])],4)])],!0)])],4))),128))])],42,l))}}),v=e._plugin_vue_export_helper_default(d,[["__scopeId","data-v-1792f489"]]);Object.defineProperty(exports,"LumalScrollRankingBoard_default",{enumerable:!0,get:function(){return v}});