"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./main-BB7fFseo.cjs"),_={class:"carousel"},f={class:"main"},y={class:"name"},B={class:"phone"},w={class:"time"},i=40,R=e.defineComponent({__name:"Carousel",setup(S){const c=e.inject("editable"),s=e.inject("widgetStore"),d=e.computed({get:()=>s.attrs.title,set:n=>{s.updateAttr("title",n)}}),m=e.computed(()=>s.attrs.rows),l=[{name:"张一一",phone:e.getRandomPhone()},{name:"李一一",phone:e.getRandomPhone()},{name:"王一一",phone:e.getRandomPhone()},{name:"赵一一",phone:e.getRandomPhone()},{name:"孙一一",phone:e.getRandomPhone()},{name:"周一一",phone:e.getRandomPhone()},{name:"吴一一",phone:e.getRandomPhone()},{name:"郑一一",phone:e.getRandomPhone()}].map((n,o)=>({...n,id:o,name:n.name.replace(/./g,(t,v)=>v===0?t:"*"),phone:n.phone.replace(/(\d{3})\d{4}(\d{4})/,"$1****$2"),createdMins:o+1+Math.round(Math.random()*1)})),h=e.computed(()=>[...l,...l.slice(0,m.value).map(n=>({...n,id:n.id+l.length}))]),u=e.ref(0),r=e.ref(0),p=n=>{u.value=Math.round(n/1e3/60);const o=-(l.length*i);r.value<=o?r.value=0:r.value-=1,a=window.requestAnimationFrame(p)};let a=null;e.onMounted(()=>{a&&console.warn("requestAnimationFrame is already called."),a=window.requestAnimationFrame(p)}),e.onBeforeUnmount(()=>{a&&(window.cancelAnimationFrame(a),a=null)});const g=n=>{n.target.select()};return(n,o)=>(e.openBlock(),e.createElementBlock("div",_,[e.createBaseVNode("div",f,[e.createBaseVNode("div",{class:e.normalizeClass(["title",{readonly:!e.unref(c)||!e.unref(s).isActive}])},[e.createVNode(e.unref(e.ElInput),{modelValue:d.value,"onUpdate:modelValue":o[0]||(o[0]=t=>d.value=t),readonly:!e.unref(c),maxlength:12,"input-style":{fontSize:"16px",color:"#1a1a1a",textAlign:"center",fontWeight:"bold"},onFocus:g},null,8,["modelValue","readonly"])],2),e.createBaseVNode("div",{class:"list",style:e.normalizeStyle({height:`${i*m.value}px`})},[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(h.value,t=>(e.openBlock(),e.createElementBlock("div",{key:t.id,class:"carousel-item",style:e.normalizeStyle({height:`${i}px`,transform:`translateY(${r.value}px)`})},[e.createBaseVNode("div",y,e.toDisplayString(t.name),1),e.createBaseVNode("div",B,e.toDisplayString(t.phone),1),e.createBaseVNode("div",w,e.toDisplayString(t.createdMins+u.value)+"分钟前",1)],4))),128))],4)]),e.createVNode(e._sfc_main$2)]))}}),V=e._export_sfc(R,[["__scopeId","data-v-f5343c4a"]]);exports.default=V;
