/*!
Copyright (c) 2026 Lenovo SSG BASD. All rights reserved.
@license Proprietary

This software is the confidential and proprietary property of Lenovo SSG BASD.
You shall not disclose such Confidential Information and shall use it only in
accordance with the terms of the license agreement.

--- Build Info ---
Version: 1.1.1
Build Time: 2026/2/26 17:21:00
Build Commit: 81e556ed827e2f043668506dae6fae8dbb9ef395
*/
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});require('./index2.css');require('./index.css');const e=require("vue"),a=require("../../hooks/useNamespace.js");/* empty css             */;/* empty css            */const l=require("../../_virtual/_plugin-vue_export-helper.js"),t=require("../../node_modules/lodash-es/isFinite.js"),n={key:1,"aria-hidden":!0,class:"marquee"},r=Object.assign({name:"GscMarquee"},{__name:"index",props:{vertical:{type:Boolean,default:!1},direction:{type:String,default:"normal"},duration:{type:Number,default:28},delay:{type:Number,default:1},loop:{type:Number,default:0},clone:{type:Boolean,default:!1},gradient:{type:Boolean,default:!1},gradientColor:{type:Array,default:()=>[255,255,255]},gradientLength:{type:String},pauseOnHover:{type:Boolean,default:!0},pauseOnClick:{type:Boolean,default:!1},pause:{type:Boolean,default:!1},animateOnOverflowOnly:{type:Boolean,default:!1}},emits:["complete","loop-complete","pause","resume","overflow-detected","overflow-cleared"],setup(l,{emit:r}){const o=l,u=r,{prefixCls:i}=a.useNamespace("marquee"),v=e.ref(0),s=e.ref("100%"),d=e.ref("100%"),c=e.ref(0),p=e.ref(!1),f=e.ref(!0),m=e.ref(0),y=e.ref(0),O=e.ref(0),g=e.ref(0),h=e.ref(!1),k=e.ref(!1),w=e.ref(0),C=e.ref(null),$=e.ref("200px"),B=e.ref(!1),q=e.ref(null),_=e.ref(null),H=async()=>{await(async()=>{o.vertical&&(p.value=!0),setInterval(()=>{if(s.value="0%",d.value="0%",null!==q.value&&null!==_.value&&q.value&&_.value){if(o.vertical&&"clientHeight"in q.value&&"clientHeight"in _.value){g.value=q.value.clientHeight,O.value=_.value.clientHeight;const e=Math.ceil(O.value/g.value);return v.value=t.default(e)?e:0,p.value=!1,v.value}if(!o.vertical&&"clientWidth"in q.value&&"clientWidth"in _.value){if(y.value=q.value.clientWidth,m.value=_.value.clientWidth,o.animateOnOverflowOnly)return y.value<m.value?(f.value=!0,u("overflow-detected")):(f.value=!1,u("overflow-cleared")),0;const e=Math.ceil(m.value/y.value);return v.value=t.default(e)?e:0,v.value}return s.value="100%",d.value="100%",0}return s.value="100%",d.value="100%",0},100)})(),c.value++};e.watch(y,async()=>{o.clone&&H()}),e.watch(m,async()=>{(o.clone||o.animateOnOverflowOnly)&&H()}),e.watch(()=>o.pause,(e,a)=>{e!==a&&u(e?"resume":"pause")});const M=()=>{o.pauseOnHover&&(u("pause"),h.value=!0)},N=()=>{o.pauseOnHover&&(u("resume"),h.value=!1)},b=()=>{o.pauseOnClick&&(u("pause"),k.value=!0)},x=()=>{o.pauseOnClick&&(u("resume"),k.value=!1)},S=e.computed(()=>o.pause||o.vertical&&p.value||o.animateOnOverflowOnly&&f.value?"paused":"running"),j=e.computed(()=>o.pauseOnHover&&(h.value||k.value)||!o.pauseOnHover&&"paused"===S.value?"paused":"running"),E=e.computed(()=>o.pauseOnHover&&h.value||o.pauseOnClick&&k.value||!o.pauseOnHover&&"paused"===S.value?"paused":"running"),z=e.computed(()=>{const e={"--duration":`${o.duration}s`,"--delay":`${o.delay}s`,"--direction":`${o.direction}`,"--pause-on-hover":`${j.value}`,"--pause-on-click":`${E.value}`,"--pause-animation":`${S.value}`,"--loops":`${0===o.loop?"infinite":o.loop}`,"--gradient-color":`rgba(${o.gradientColor[0]}, ${o.gradientColor[1]}, ${o.gradientColor[2]}, 1), rgba(${o.gradientColor[0]}, ${o.gradientColor[1]}, ${o.gradientColor[2]}, 0)`,"--gradient-length":`${$.value}`,"--min-width":`${s.value}`,"--min-height":`${d.value}`},a={"--orientation":"scrollX",orientation:"horizontal"};o.vertical&&(a["--orientation"]="scrollY");return{...e,...a}}),I=e.computed(()=>!!o.gradient);return e.onMounted(async()=>{o.gradient&&o.gradientLength&&($.value=o.gradientLength),o.vertical&&o.animateOnOverflowOnly&&console.warn("The `animateOnOverflowOnly` prop is not supported for vertical marquees."),B.value=!0,C.value=setInterval(()=>{w.value++,0!==o.loop&&w.value===o.loop&&(u("complete"),clearInterval(C.value)),u("loop-complete")},1e3*o.duration)}),e.onBeforeUnmount(()=>{clearInterval(C.value)}),(a,t)=>B.value?(e.openBlock(),e.createElementBlock("div",{key:c.value,class:e.normalizeClass([e.unref(i),{vertical:l.vertical,horizontal:!l.vertical}]),style:e.normalizeStyle(z.value),onMouseenter:M,onMouseleave:N,onMousedown:b,onMouseup:x},[e.createElementVNode("div",{ref_key:"marqueeOverlayContainer",ref:_,class:"transparent-overlay","aria-hidden":!0},null,512),I.value?(e.openBlock(),e.createElementBlock("div",{key:0,"aria-hidden":!0,class:e.normalizeClass(["overlay",{vertical:l.vertical,horizontal:!l.vertical}])},null,2)):e.createCommentVNode("",!0),e.createElementVNode("div",{ref_key:"marqueeContent",ref:q,class:"marquee"},[e.renderSlot(a.$slots,"default",{},void 0,!0)],512),!l.animateOnOverflowOnly||l.animateOnOverflowOnly&&!f.value?(e.openBlock(),e.createElementBlock("div",n,[e.renderSlot(a.$slots,"default",{},void 0,!0)])):e.createCommentVNode("",!0),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(v.value,l=>(e.openBlock(),e.createElementBlock("div",{key:l,"aria-hidden":!0,class:"marquee cloned"},[e.renderSlot(a.$slots,"default",{},void 0,!0)]))),128))],38)):e.createCommentVNode("",!0)}}),o=l.default(r,[["__scopeId","data-v-f1f0ed6e"]]);exports.default=o;