diff --git a/app-frontend/src/api/accounts.js b/app-frontend/src/api/accounts.js new file mode 100644 index 0000000..74c413e --- /dev/null +++ b/app-frontend/src/api/accounts.js @@ -0,0 +1,57 @@ +import { publicApi } from './http' + +export async function fetchAccounts(params = {}) { + const { data } = await publicApi.get('/accounts', { params }) + return data +} + +export async function addAccount(payload) { + const { data } = await publicApi.post('/accounts', payload) + return data +} + +export async function updateAccount(accountId, payload) { + const { data } = await publicApi.put(`/accounts/${accountId}`, payload) + return data +} + +export async function deleteAccount(accountId) { + const { data } = await publicApi.delete(`/accounts/${accountId}`) + return data +} + +export async function updateAccountRemark(accountId, payload) { + const { data } = await publicApi.put(`/accounts/${accountId}/remark`, payload) + return data +} + +export async function startAccount(accountId, payload) { + const { data } = await publicApi.post(`/accounts/${accountId}/start`, payload) + return data +} + +export async function stopAccount(accountId) { + const { data } = await publicApi.post(`/accounts/${accountId}/stop`, {}) + return data +} + +export async function batchStartAccounts(payload) { + const { data } = await publicApi.post('/accounts/batch/start', payload) + return data +} + +export async function batchStopAccounts(payload) { + const { data } = await publicApi.post('/accounts/batch/stop', payload) + return data +} + +export async function clearAccounts() { + const { data } = await publicApi.post('/accounts/clear', {}) + return data +} + +export async function takeScreenshot(accountId, payload = {}) { + const { data } = await publicApi.post(`/accounts/${accountId}/screenshot`, payload) + return data +} + diff --git a/app-frontend/src/api/stats.js b/app-frontend/src/api/stats.js new file mode 100644 index 0000000..b5420d8 --- /dev/null +++ b/app-frontend/src/api/stats.js @@ -0,0 +1,7 @@ +import { publicApi } from './http' + +export async function fetchRunStats() { + const { data } = await publicApi.get('/run_stats') + return data +} + diff --git a/app-frontend/src/api/user.js b/app-frontend/src/api/user.js new file mode 100644 index 0000000..ccf30b3 --- /dev/null +++ b/app-frontend/src/api/user.js @@ -0,0 +1,12 @@ +import { publicApi } from './http' + +export async function fetchVipInfo() { + const { data } = await publicApi.get('/user/vip') + return data +} + +export async function logout() { + const { data } = await publicApi.post('/logout', {}) + return data +} + diff --git a/app-frontend/src/composables/useSocket.js b/app-frontend/src/composables/useSocket.js new file mode 100644 index 0000000..50a692c --- /dev/null +++ b/app-frontend/src/composables/useSocket.js @@ -0,0 +1,15 @@ +import { io } from 'socket.io-client' + +let socketInstance = null + +export function useSocket() { + if (socketInstance) return socketInstance + + socketInstance = io({ + transports: ['websocket', 'polling'], + withCredentials: true, + }) + + return socketInstance +} + diff --git a/app-frontend/src/layouts/AppLayout.vue b/app-frontend/src/layouts/AppLayout.vue index b5c66a4..262a6a9 100644 --- a/app-frontend/src/layouts/AppLayout.vue +++ b/app-frontend/src/layouts/AppLayout.vue @@ -4,8 +4,11 @@ import { useRoute, useRouter } from 'vue-router' import { ElMessageBox } from 'element-plus' import { Calendar, Camera, User } from '@element-plus/icons-vue' +import { useUserStore } from '../stores/user' + const route = useRoute() const router = useRouter() +const userStore = useUserStore() const isMobile = ref(false) const drawerOpen = ref(false) @@ -20,6 +23,10 @@ onMounted(() => { mediaQuery = window.matchMedia('(max-width: 768px)') mediaQuery.addEventListener?.('change', syncIsMobile) syncIsMobile() + + userStore.refreshVipInfo().catch(() => { + window.location.href = '/login' + }) }) onBeforeUnmount(() => { @@ -50,6 +57,7 @@ async function logout() { return } + await userStore.logout() window.location.href = '/login' } @@ -80,6 +88,14 @@ async function logout() {
(O(),F(ze,null,[G(Ey,{move:l.value,ratio:c.value,size:r.value,always:v.always},null,8,["move","ratio","size","always"]),G(Ey,{move:a.value,ratio:u.value,size:i.value,vertical:"",always:v.always},null,8,["move","ratio","size","always"])],64))}});var k3=Oe(S3,[["__file","bar.vue"]]);const E3=Ee({distance:{type:Number,default:0},height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:Boolean,wrapStyle:{type:J([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...Gn(["ariaLabel","ariaOrientation"])}),GS={"end-reached":e=>["left","right","top","bottom"].includes(e),scroll:({scrollTop:e,scrollLeft:t})=>[e,t].every(Ye)},_3="ElScrollbar",T3=q({name:_3}),O3=q({...T3,props:E3,emits:GS,setup(e,{expose:t,emit:n}){const o=e,l=ge("scrollbar");let a,r,i,u=0,c=0,d="";const f={bottom:!1,top:!1,right:!1,left:!1},v=A(),p=A(),m=A(),h=A(),g=S(()=>{const T={},N=Zt(o.height),z=Zt(o.maxHeight);return N&&(T.height=N),z&&(T.maxHeight=z),[o.wrapStyle,T]}),b=S(()=>[o.wrapClass,l.e("wrap"),{[l.em("wrap","hidden-default")]:!o.native}]),C=S(()=>[l.e("view"),o.viewClass]),w=T=>{var N;return(N=f[T])!=null?N:!1},y={top:"bottom",bottom:"top",left:"right",right:"left"},k=T=>{const N=y[d];if(!N)return;const z=T[d],U=T[N];z&&!f[d]&&(f[d]=!0),!U&&f[N]&&(f[N]=!1)},E=()=>{var T;if(p.value){(T=h.value)==null||T.handleScroll(p.value);const N=u,z=c;u=p.value.scrollTop,c=p.value.scrollLeft;const U={bottom:u+p.value.clientHeight>=p.value.scrollHeight-o.distance,top:u<=o.distance&&N!==0,right:c+p.value.clientWidth>=p.value.scrollWidth-o.distance&&z!==c,left:c<=o.distance&&z!==0};if(n("scroll",{scrollTop:u,scrollLeft:c}),N!==u&&(d=u>N?"bottom":"top"),z!==c&&(d=c>z?"right":"left"),o.distance>0){if(w(d))return;k(U)}U[d]&&n("end-reached",d)}};function _(T,N){rt(T)?p.value.scrollTo(T):Ye(T)&&Ye(N)&&p.value.scrollTo(T,N)}const I=T=>{Ye(T)&&(p.value.scrollTop=T)},$=T=>{Ye(T)&&(p.value.scrollLeft=T)},M=()=>{var T;(T=h.value)==null||T.update(),f[d]=!1};return fe(()=>o.noresize,T=>{T?(a?.(),r?.(),i?.()):({stop:a}=Yt(m,M),{stop:r}=Yt(p,M),i=xt("resize",M))},{immediate:!0}),fe(()=>[o.maxHeight,o.height],()=>{o.native||Me(()=>{var T;M(),p.value&&((T=h.value)==null||T.handleScroll(p.value))})}),bt(tm,It({scrollbarElement:v,wrapElement:p})),Dd(()=>{p.value&&(p.value.scrollTop=u,p.value.scrollLeft=c)}),pt(()=>{o.native||Me(()=>{M()})}),Qo(()=>M()),t({wrapRef:p,update:M,scrollTo:_,setScrollTop:I,setScrollLeft:$,handleScroll:E}),(T,N)=>(O(),F("div",{ref_key:"scrollbarRef",ref:v,class:x(s(l).b())},[W("div",{ref_key:"wrapRef",ref:p,class:x(s(b)),style:je(s(g)),tabindex:T.tabindex,onScroll:E},[(O(),ie(ut(T.tag),{id:T.id,ref_key:"resizeRef",ref:m,class:x(s(C)),style:je(T.viewStyle),role:T.role,"aria-label":T.ariaLabel,"aria-orientation":T.ariaOrientation},{default:te(()=>[ae(T.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),T.native?re("v-if",!0):(O(),ie(k3,{key:0,ref_key:"barRef",ref:h,always:T.always,"min-size":T.minSize},null,8,["always","min-size"]))],2))}});var $3=Oe(O3,[["__file","scrollbar.vue"]]);const Yo=lt($3),nm=Symbol("popper"),XS=Symbol("popperContent"),JS=["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],ZS=Ee({role:{type:String,values:JS,default:"tooltip"}}),R3=q({name:"ElPopper",inheritAttrs:!1}),N3=q({...R3,props:ZS,setup(e,{expose:t}){const n=e,o=A(),l=A(),a=A(),r=A(),i=S(()=>n.role),u={triggerRef:o,popperInstanceRef:l,contentRef:a,referenceRef:r,role:i};return t(u),bt(nm,u),(c,d)=>ae(c.$slots,"default")}});var I3=Oe(N3,[["__file","popper.vue"]]);const x3=q({name:"ElPopperArrow",inheritAttrs:!1}),P3=q({...x3,setup(e,{expose:t}){const n=ge("popper"),{arrowRef:o,arrowStyle:l}=Pe(XS,void 0);return Pt(()=>{o.value=void 0}),t({arrowRef:o}),(a,r)=>(O(),F("span",{ref_key:"arrowRef",ref:o,class:x(s(n).e("arrow")),style:je(s(l)),"data-popper-arrow":""},null,6))}});var M3=Oe(P3,[["__file","arrow.vue"]]);const QS=Ee({virtualRef:{type:J(Object)},virtualTriggering:Boolean,onMouseenter:{type:J(Function)},onMouseleave:{type:J(Function)},onClick:{type:J(Function)},onKeydown:{type:J(Function)},onFocus:{type:J(Function)},onBlur:{type:J(Function)},onContextmenu:{type:J(Function)},id:String,open:Boolean}),ek=Symbol("elForwardRef"),A3=e=>{bt(ek,{setForwardRef:n=>{e.value=n}})},L3=e=>({mounted(t){e(t)},updated(t){e(t)},unmounted(){e(null)}}),D3="ElOnlyChild",tk=q({name:D3,setup(e,{slots:t,attrs:n}){var o;const l=Pe(ek),a=L3((o=l?.setForwardRef)!=null?o:Mt);return()=>{var r;const i=(r=t.default)==null?void 0:r.call(t,n);if(!i)return null;const[u,c]=nk(i);return u?it(Yl(u,n),[[a]]):null}}});function nk(e){if(!e)return[null,0];const t=e,n=t.filter(o=>o.type!==un).length;for(const o of t){if(rt(o))switch(o.type){case un:continue;case _s:case"svg":return[_y(o),n];case ze:return nk(o.children);default:return[o,n]}return[_y(o),n]}return[null,0]}function _y(e){const t=ge("only-child");return G("span",{class:t.e("content")},[e])}const B3=q({name:"ElPopperTrigger",inheritAttrs:!1}),F3=q({...B3,props:QS,setup(e,{expose:t}){const n=e,{role:o,triggerRef:l}=Pe(nm,void 0);A3(l);const a=S(()=>i.value?n.id:void 0),r=S(()=>{if(o&&o.value==="tooltip")return n.open&&n.id?n.id:void 0}),i=S(()=>{if(o&&o.value!=="tooltip")return o.value}),u=S(()=>i.value?`${n.open}`:void 0);let c;const d=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return pt(()=>{fe(()=>n.virtualRef,f=>{f&&(l.value=En(f))},{immediate:!0}),fe(l,(f,v)=>{c?.(),c=void 0,io(v)&&d.forEach(p=>{const m=n[p];m&&v.removeEventListener(p.slice(2).toLowerCase(),m,["onFocus","onBlur"].includes(p))}),io(f)&&(d.forEach(p=>{const m=n[p];m&&f.addEventListener(p.slice(2).toLowerCase(),m,["onFocus","onBlur"].includes(p))}),Li(f)&&(c=fe([a,r,i,u],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((m,h)=>{cn(p[h])?f.removeAttribute(m):f.setAttribute(m,p[h])})},{immediate:!0}))),io(v)&&Li(v)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>v.removeAttribute(p))},{immediate:!0})}),Pt(()=>{if(c?.(),c=void 0,l.value&&io(l.value)){const f=l.value;d.forEach(v=>{const p=n[v];p&&f.removeEventListener(v.slice(2).toLowerCase(),p,["onFocus","onBlur"].includes(v))}),l.value=void 0}}),t({triggerRef:l}),(f,v)=>f.virtualTriggering?re("v-if",!0):(O(),ie(s(tk),ft({key:0},f.$attrs,{"aria-controls":s(a),"aria-describedby":s(r),"aria-expanded":s(u),"aria-haspopup":s(i)}),{default:te(()=>[ae(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var V3=Oe(F3,[["__file","trigger.vue"]]);const ep="focus-trap.focus-after-trapped",tp="focus-trap.focus-after-released",z3="focus-trap.focusout-prevented",Ty={cancelable:!0,bubbles:!1},H3={cancelable:!0,bubbles:!1},Oy="focusAfterTrapped",$y="focusAfterReleased",ok=Symbol("elFocusTrap"),om=A(),af=A(0),lm=A(0);let ju=0;const lk=e=>{const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const l=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||l?NodeFilter.FILTER_SKIP:o.tabIndex>=0||o===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t},Ry=(e,t)=>{for(const n of e)if(!K3(n,t))return n},K3=(e,t)=>{if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},W3=e=>{const t=lk(e),n=Ry(t,e),o=Ry(t.reverse(),e);return[n,o]},j3=e=>e instanceof HTMLInputElement&&"select"in e,va=(e,t)=>{if(e){const n=document.activeElement;hu(e,{preventScroll:!0}),lm.value=window.performance.now(),e!==n&&j3(e)&&t&&e.select()}};function Ny(e,t){const n=[...e],o=e.indexOf(t);return o!==-1&&n.splice(o,1),n}const U3=()=>{let e=[];return{push:o=>{const l=e[0];l&&o!==l&&l.pause(),e=Ny(e,o),e.unshift(o)},remove:o=>{var l,a;e=Ny(e,o),(a=(l=e[0])==null?void 0:l.resume)==null||a.call(l)}}},q3=(e,t=!1)=>{const n=document.activeElement;for(const o of e)if(va(o,t),document.activeElement!==n)return},Iy=U3(),Y3=()=>af.value>lm.value,Uu=()=>{om.value="pointer",af.value=window.performance.now()},xy=()=>{om.value="keyboard",af.value=window.performance.now()},G3=()=>(pt(()=>{ju===0&&(document.addEventListener("mousedown",Uu),document.addEventListener("touchstart",Uu),document.addEventListener("keydown",xy)),ju++}),Pt(()=>{ju--,ju<=0&&(document.removeEventListener("mousedown",Uu),document.removeEventListener("touchstart",Uu),document.removeEventListener("keydown",xy))}),{focusReason:om,lastUserFocusTimestamp:af,lastAutomatedFocusTimestamp:lm}),qu=e=>new CustomEvent(z3,{...H3,detail:e}),Se={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",backspace:"Backspace",numpadEnter:"NumpadEnter",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},wn=(e,t,{checkForDefaultPrevented:n=!0}={})=>l=>{const a=e?.(l);if(n===!1||!a)return t?.(l)},Py=e=>t=>t.pointerType==="mouse"?e(t):void 0,Vt=e=>{if(e.code&&e.code!=="Unidentified")return e.code;const t=ak(e);if(t){if(Object.values(Se).includes(t))return t;switch(t){case" ":return Se.space;default:return""}}return""},ak=e=>{let t=e.key&&e.key!=="Unidentified"?e.key:"";if(!t&&e.type==="keyup"&&WS()){const n=e.target;t=n.value.charAt(n.selectionStart-1)}return t};let Fr=[];const My=e=>{Vt(e)===Se.esc&&Fr.forEach(n=>n(e))},X3=e=>{pt(()=>{Fr.length===0&&document.addEventListener("keydown",My),Nt&&Fr.push(e)}),Pt(()=>{Fr=Fr.filter(t=>t!==e),Fr.length===0&&Nt&&document.removeEventListener("keydown",My)})},J3=q({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Oy,$y,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:t}){const n=A();let o,l;const{focusReason:a}=G3();X3(m=>{e.trapped&&!r.paused&&t("release-requested",m)});const r={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},i=m=>{if(!e.loop&&!e.trapped||r.paused)return;const{altKey:h,ctrlKey:g,metaKey:b,currentTarget:C,shiftKey:w}=m,{loop:y}=e,E=Vt(m)===Se.tab&&!h&&!g&&!b,_=document.activeElement;if(E&&_){const I=C,[$,M]=W3(I);if($&&M){if(!w&&_===M){const N=qu({focusReason:a.value});t("focusout-prevented",N),N.defaultPrevented||(m.preventDefault(),y&&va($,!0))}else if(w&&[$,I].includes(_)){const N=qu({focusReason:a.value});t("focusout-prevented",N),N.defaultPrevented||(m.preventDefault(),y&&va(M,!0))}}else if(_===I){const N=qu({focusReason:a.value});t("focusout-prevented",N),N.defaultPrevented||m.preventDefault()}}};bt(ok,{focusTrapRef:n,onKeydown:i}),fe(()=>e.focusTrapEl,m=>{m&&(n.value=m)},{immediate:!0}),fe([n],([m],[h])=>{m&&(m.addEventListener("keydown",i),m.addEventListener("focusin",d),m.addEventListener("focusout",f)),h&&(h.removeEventListener("keydown",i),h.removeEventListener("focusin",d),h.removeEventListener("focusout",f))});const u=m=>{t(Oy,m)},c=m=>t($y,m),d=m=>{const h=s(n);if(!h)return;const g=m.target,b=m.relatedTarget,C=g&&h.contains(g);e.trapped||b&&h.contains(b)||(o=b),C&&t("focusin",m),!r.paused&&e.trapped&&(C?l=g:va(l,!0))},f=m=>{const h=s(n);if(!(r.paused||!h))if(e.trapped){const g=m.relatedTarget;!cn(g)&&!h.contains(g)&&setTimeout(()=>{if(!r.paused&&e.trapped){const b=qu({focusReason:a.value});t("focusout-prevented",b),b.defaultPrevented||va(l,!0)}},0)}else{const g=m.target;g&&h.contains(g)||t("focusout",m)}};async function v(){await Me();const m=s(n);if(m){Iy.push(r);const h=m.contains(document.activeElement)?o:document.activeElement;if(o=h,!m.contains(h)){const b=new Event(ep,Ty);m.addEventListener(ep,u),m.dispatchEvent(b),b.defaultPrevented||Me(()=>{let C=e.focusStartEl;Ve(C)||(va(C),document.activeElement!==C&&(C="first")),C==="first"&&q3(lk(m),!0),(document.activeElement===h||C==="container")&&va(m)})}}}function p(){const m=s(n);if(m){m.removeEventListener(ep,u);const h=new CustomEvent(tp,{...Ty,detail:{focusReason:a.value}});m.addEventListener(tp,c),m.dispatchEvent(h),!h.defaultPrevented&&(a.value=="keyboard"||!Y3()||m.contains(document.activeElement))&&va(o??document.body),m.removeEventListener(tp,c),Iy.remove(r),o=null,l=null}}return pt(()=>{e.trapped&&v(),fe(()=>e.trapped,m=>{m?v():p()})}),Pt(()=>{e.trapped&&p(),n.value&&(n.value.removeEventListener("keydown",i),n.value.removeEventListener("focusin",d),n.value.removeEventListener("focusout",f),n.value=void 0),o=null,l=null}),{onKeydown:i}}});function Z3(e,t,n,o,l,a){return ae(e.$slots,"default",{handleKeydown:e.onKeydown})}var xs=Oe(J3,[["render",Z3],["__file","focus-trap.vue"]]),co="top",Mo="bottom",Ao="right",fo="left",am="auto",gu=[co,Mo,Ao,fo],cs="start",Di="end",Q3="clippingParents",rk="viewport",js="popper",eD="reference",Ay=gu.reduce(function(e,t){return e.concat([t+"-"+cs,t+"-"+Di])},[]),ia=[].concat(gu,[am]).reduce(function(e,t){return e.concat([t,t+"-"+cs,t+"-"+Di])},[]),tD="beforeRead",nD="read",oD="afterRead",lD="beforeMain",aD="main",rD="afterMain",sD="beforeWrite",iD="write",uD="afterWrite",cD=[tD,nD,oD,lD,aD,rD,sD,iD,uD];function Sl(e){return e?(e.nodeName||"").toLowerCase():null}function nl(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function ds(e){var t=nl(e).Element;return e instanceof t||e instanceof Element}function Io(e){var t=nl(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function rm(e){if(typeof ShadowRoot>"u")return!1;var t=nl(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function dD(e){var t=e.state;Object.keys(t.elements).forEach(function(n){var o=t.styles[n]||{},l=t.attributes[n]||{},a=t.elements[n];!Io(a)||!Sl(a)||(Object.assign(a.style,o),Object.keys(l).forEach(function(r){var i=l[r];i===!1?a.removeAttribute(r):a.setAttribute(r,i===!0?"":i)}))})}function fD(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach(function(o){var l=t.elements[o],a=t.attributes[o]||{},r=Object.keys(t.styles.hasOwnProperty(o)?t.styles[o]:n[o]),i=r.reduce(function(u,c){return u[c]="",u},{});!Io(l)||!Sl(l)||(Object.assign(l.style,i),Object.keys(a).forEach(function(u){l.removeAttribute(u)}))})}}var sk={name:"applyStyles",enabled:!0,phase:"write",fn:dD,effect:fD,requires:["computeStyles"]};function vl(e){return e.split("-")[0]}var sr=Math.max,nd=Math.min,fs=Math.round;function ps(e,t){t===void 0&&(t=!1);var n=e.getBoundingClientRect(),o=1,l=1;if(Io(e)&&t){var a=e.offsetHeight,r=e.offsetWidth;r>0&&(o=fs(n.width)/r||1),a>0&&(l=fs(n.height)/a||1)}return{width:n.width/o,height:n.height/l,top:n.top/l,right:n.right/o,bottom:n.bottom/l,left:n.left/o,x:n.left/o,y:n.top/l}}function sm(e){var t=ps(e),n=e.offsetWidth,o=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-o)<=1&&(o=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:o}}function ik(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&rm(n)){var o=t;do{if(o&&e.isSameNode(o))return!0;o=o.parentNode||o.host}while(o)}return!1}function Ql(e){return nl(e).getComputedStyle(e)}function pD(e){return["table","td","th"].indexOf(Sl(e))>=0}function Fa(e){return((ds(e)?e.ownerDocument:e.document)||window.document).documentElement}function rf(e){return Sl(e)==="html"?e:e.assignedSlot||e.parentNode||(rm(e)?e.host:null)||Fa(e)}function Ly(e){return!Io(e)||Ql(e).position==="fixed"?null:e.offsetParent}function vD(e){var t=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&Io(e)){var o=Ql(e);if(o.position==="fixed")return null}var l=rf(e);for(rm(l)&&(l=l.host);Io(l)&&["html","body"].indexOf(Sl(l))<0;){var a=Ql(l);if(a.transform!=="none"||a.perspective!=="none"||a.contain==="paint"||["transform","perspective"].indexOf(a.willChange)!==-1||t&&a.willChange==="filter"||t&&a.filter&&a.filter!=="none")return l;l=l.parentNode}return null}function bu(e){for(var t=nl(e),n=Ly(e);n&&pD(n)&&Ql(n).position==="static";)n=Ly(n);return n&&(Sl(n)==="html"||Sl(n)==="body"&&Ql(n).position==="static")?t:n||vD(e)||t}function im(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function hi(e,t,n){return sr(e,nd(t,n))}function hD(e,t,n){var o=hi(e,t,n);return o>n?n:o}function uk(){return{top:0,right:0,bottom:0,left:0}}function ck(e){return Object.assign({},uk(),e)}function dk(e,t){return t.reduce(function(n,o){return n[o]=e,n},{})}var mD=function(e,t){return e=typeof e=="function"?e(Object.assign({},t.rects,{placement:t.placement})):e,ck(typeof e!="number"?e:dk(e,gu))};function gD(e){var t,n=e.state,o=e.name,l=e.options,a=n.elements.arrow,r=n.modifiersData.popperOffsets,i=vl(n.placement),u=im(i),c=[fo,Ao].indexOf(i)>=0,d=c?"height":"width";if(!(!a||!r)){var f=mD(l.padding,n),v=sm(a),p=u==="y"?co:fo,m=u==="y"?Mo:Ao,h=n.rects.reference[d]+n.rects.reference[u]-r[u]-n.rects.popper[d],g=r[u]-n.rects.reference[u],b=bu(a),C=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,w=h/2-g/2,y=f[p],k=C-v[d]-f[m],E=C/2-v[d]/2+w,_=hi(y,E,k),I=u;n.modifiersData[o]=(t={},t[I]=_,t.centerOffset=_-E,t)}}function bD(e){var t=e.state,n=e.options,o=n.element,l=o===void 0?"[data-popper-arrow]":o;l!=null&&(typeof l=="string"&&(l=t.elements.popper.querySelector(l),!l)||!ik(t.elements.popper,l)||(t.elements.arrow=l))}var yD={name:"arrow",enabled:!0,phase:"main",fn:gD,effect:bD,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function vs(e){return e.split("-")[1]}var wD={top:"auto",right:"auto",bottom:"auto",left:"auto"};function CD(e){var t=e.x,n=e.y,o=window,l=o.devicePixelRatio||1;return{x:fs(t*l)/l||0,y:fs(n*l)/l||0}}function Dy(e){var t,n=e.popper,o=e.popperRect,l=e.placement,a=e.variation,r=e.offsets,i=e.position,u=e.gpuAcceleration,c=e.adaptive,d=e.roundOffsets,f=e.isFixed,v=r.x,p=v===void 0?0:v,m=r.y,h=m===void 0?0:m,g=typeof d=="function"?d({x:p,y:h}):{x:p,y:h};p=g.x,h=g.y;var b=r.hasOwnProperty("x"),C=r.hasOwnProperty("y"),w=fo,y=co,k=window;if(c){var E=bu(n),_="clientHeight",I="clientWidth";if(E===nl(n)&&(E=Fa(n),Ql(E).position!=="static"&&i==="absolute"&&(_="scrollHeight",I="scrollWidth")),E=E,l===co||(l===fo||l===Ao)&&a===Di){y=Mo;var $=f&&E===k&&k.visualViewport?k.visualViewport.height:E[_];h-=$-o.height,h*=u?1:-1}if(l===fo||(l===co||l===Mo)&&a===Di){w=Ao;var M=f&&E===k&&k.visualViewport?k.visualViewport.width:E[I];p-=M-o.width,p*=u?1:-1}}var T=Object.assign({position:i},c&&wD),N=d===!0?CD({x:p,y:h}):{x:p,y:h};if(p=N.x,h=N.y,u){var z;return Object.assign({},T,(z={},z[y]=C?"0":"",z[w]=b?"0":"",z.transform=(k.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",z))}return Object.assign({},T,(t={},t[y]=C?h+"px":"",t[w]=b?p+"px":"",t.transform="",t))}function SD(e){var t=e.state,n=e.options,o=n.gpuAcceleration,l=o===void 0?!0:o,a=n.adaptive,r=a===void 0?!0:a,i=n.roundOffsets,u=i===void 0?!0:i,c={placement:vl(t.placement),variation:vs(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:l,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,Dy(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:r,roundOffsets:u})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,Dy(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}var fk={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:SD,data:{}},Yu={passive:!0};function kD(e){var t=e.state,n=e.instance,o=e.options,l=o.scroll,a=l===void 0?!0:l,r=o.resize,i=r===void 0?!0:r,u=nl(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return a&&c.forEach(function(d){d.addEventListener("scroll",n.update,Yu)}),i&&u.addEventListener("resize",n.update,Yu),function(){a&&c.forEach(function(d){d.removeEventListener("scroll",n.update,Yu)}),i&&u.removeEventListener("resize",n.update,Yu)}}var pk={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:kD,data:{}},ED={left:"right",right:"left",bottom:"top",top:"bottom"};function vc(e){return e.replace(/left|right|bottom|top/g,function(t){return ED[t]})}var _D={start:"end",end:"start"};function By(e){return e.replace(/start|end/g,function(t){return _D[t]})}function um(e){var t=nl(e),n=t.pageXOffset,o=t.pageYOffset;return{scrollLeft:n,scrollTop:o}}function cm(e){return ps(Fa(e)).left+um(e).scrollLeft}function TD(e){var t=nl(e),n=Fa(e),o=t.visualViewport,l=n.clientWidth,a=n.clientHeight,r=0,i=0;return o&&(l=o.width,a=o.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(r=o.offsetLeft,i=o.offsetTop)),{width:l,height:a,x:r+cm(e),y:i}}function OD(e){var t,n=Fa(e),o=um(e),l=(t=e.ownerDocument)==null?void 0:t.body,a=sr(n.scrollWidth,n.clientWidth,l?l.scrollWidth:0,l?l.clientWidth:0),r=sr(n.scrollHeight,n.clientHeight,l?l.scrollHeight:0,l?l.clientHeight:0),i=-o.scrollLeft+cm(e),u=-o.scrollTop;return Ql(l||n).direction==="rtl"&&(i+=sr(n.clientWidth,l?l.clientWidth:0)-a),{width:a,height:r,x:i,y:u}}function dm(e){var t=Ql(e),n=t.overflow,o=t.overflowX,l=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+l+o)}function vk(e){return["html","body","#document"].indexOf(Sl(e))>=0?e.ownerDocument.body:Io(e)&&dm(e)?e:vk(rf(e))}function mi(e,t){var n;t===void 0&&(t=[]);var o=vk(e),l=o===((n=e.ownerDocument)==null?void 0:n.body),a=nl(o),r=l?[a].concat(a.visualViewport||[],dm(o)?o:[]):o,i=t.concat(r);return l?i:i.concat(mi(rf(r)))}function Jp(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function $D(e){var t=ps(e);return t.top=t.top+e.clientTop,t.left=t.left+e.clientLeft,t.bottom=t.top+e.clientHeight,t.right=t.left+e.clientWidth,t.width=e.clientWidth,t.height=e.clientHeight,t.x=t.left,t.y=t.top,t}function Fy(e,t){return t===rk?Jp(TD(e)):ds(t)?$D(t):Jp(OD(Fa(e)))}function RD(e){var t=mi(rf(e)),n=["absolute","fixed"].indexOf(Ql(e).position)>=0,o=n&&Io(e)?bu(e):e;return ds(o)?t.filter(function(l){return ds(l)&&ik(l,o)&&Sl(l)!=="body"}):[]}function ND(e,t,n){var o=t==="clippingParents"?RD(e):[].concat(t),l=[].concat(o,[n]),a=l[0],r=l.reduce(function(i,u){var c=Fy(e,u);return i.top=sr(c.top,i.top),i.right=nd(c.right,i.right),i.bottom=nd(c.bottom,i.bottom),i.left=sr(c.left,i.left),i},Fy(e,a));return r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}function hk(e){var t=e.reference,n=e.element,o=e.placement,l=o?vl(o):null,a=o?vs(o):null,r=t.x+t.width/2-n.width/2,i=t.y+t.height/2-n.height/2,u;switch(l){case co:u={x:r,y:t.y-n.height};break;case Mo:u={x:r,y:t.y+t.height};break;case Ao:u={x:t.x+t.width,y:i};break;case fo:u={x:t.x-n.width,y:i};break;default:u={x:t.x,y:t.y}}var c=l?im(l):null;if(c!=null){var d=c==="y"?"height":"width";switch(a){case cs:u[c]=u[c]-(t[d]/2-n[d]/2);break;case Di:u[c]=u[c]+(t[d]/2-n[d]/2);break}}return u}function Bi(e,t){t===void 0&&(t={});var n=t,o=n.placement,l=o===void 0?e.placement:o,a=n.boundary,r=a===void 0?Q3:a,i=n.rootBoundary,u=i===void 0?rk:i,c=n.elementContext,d=c===void 0?js:c,f=n.altBoundary,v=f===void 0?!1:f,p=n.padding,m=p===void 0?0:p,h=ck(typeof m!="number"?m:dk(m,gu)),g=d===js?eD:js,b=e.rects.popper,C=e.elements[v?g:d],w=ND(ds(C)?C:C.contextElement||Fa(e.elements.popper),r,u),y=ps(e.elements.reference),k=hk({reference:y,element:b,placement:l}),E=Jp(Object.assign({},b,k)),_=d===js?E:y,I={top:w.top-_.top+h.top,bottom:_.bottom-w.bottom+h.bottom,left:w.left-_.left+h.left,right:_.right-w.right+h.right},$=e.modifiersData.offset;if(d===js&&$){var M=$[l];Object.keys(I).forEach(function(T){var N=[Ao,Mo].indexOf(T)>=0?1:-1,z=[co,Mo].indexOf(T)>=0?"y":"x";I[T]+=M[z]*N})}return I}function ID(e,t){t===void 0&&(t={});var n=t,o=n.placement,l=n.boundary,a=n.rootBoundary,r=n.padding,i=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?ia:u,d=vs(o),f=d?i?Ay:Ay.filter(function(m){return vs(m)===d}):gu,v=f.filter(function(m){return c.indexOf(m)>=0});v.length===0&&(v=f);var p=v.reduce(function(m,h){return m[h]=Bi(e,{placement:h,boundary:l,rootBoundary:a,padding:r})[vl(h)],m},{});return Object.keys(p).sort(function(m,h){return p[m]-p[h]})}function xD(e){if(vl(e)===am)return[];var t=vc(e);return[By(e),t,By(t)]}function PD(e){var t=e.state,n=e.options,o=e.name;if(!t.modifiersData[o]._skip){for(var l=n.mainAxis,a=l===void 0?!0:l,r=n.altAxis,i=r===void 0?!0:r,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,v=n.altBoundary,p=n.flipVariations,m=p===void 0?!0:p,h=n.allowedAutoPlacements,g=t.options.placement,b=vl(g),C=b===g,w=u||(C||!m?[vc(g)]:xD(g)),y=[g].concat(w).reduce(function(ne,oe){return ne.concat(vl(oe)===am?ID(t,{placement:oe,boundary:d,rootBoundary:f,padding:c,flipVariations:m,allowedAutoPlacements:h}):oe)},[]),k=t.rects.reference,E=t.rects.popper,_=new Map,I=!0,$=y[0],M=0;M[R.indicatorPosition!=="none"?(O(),F("ul",{key:0,class:x(s(U))},[(O(!0),F(ze,null,gt(s(f),(V,D)=>it((O(),F("li",{key:D,class:x([s(T).e("indicator"),s(T).em("indicator",R.direction),s(T).is("active",D===s(a))]),onMouseenter:K=>s(M)(D),onClick:Ze(K=>s(g)(D),["stop"])},[W("button",{class:x(s(T).e("button")),"aria-label":s(N)("el.carousel.indicator",{index:D+1})},[s(u)?(O(),F("span",{key:0},ke(V.props.label),1)):re("v-if",!0)],10,["aria-label"])],42,["onMouseenter","onClick"])),[[$t,s(_)(D)]])),128))],2)):re("v-if",!0)]),_:1}),R.motionBlur?(O(),F("svg",{key:2,xmlns:"http://www.w3.org/2000/svg",version:"1.1",style:{display:"none"}},[W("defs",null,[W("filter",{id:"elCarouselHorizontal"},[W("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"12,0"})]),W("filter",{id:"elCarouselVertical"},[W("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"0,10"})])])])):re("v-if",!0)],42,["onMouseenter","onMouseleave"]))}});var OB=Oe(TB,[["__file","carousel.vue"]]);const $B=Ee({name:{type:String,default:""},label:{type:[String,Number],default:""}}),RB=e=>{const t=Pe(Mk),n=dt(),o=A(),l=A(!1),a=A(0),r=A(1),i=A(!1),u=A(!1),c=A(!1),d=A(!1),{isCardType:f,isVertical:v,cardScale:p}=t;function m(y,k,E){const _=E-1,I=k-1,$=k+1,M=E/2;return k===0&&y===_?-1:k===_&&y===0?E:y=M?E+1:y>$&&y-k>=M?-2:y}function h(y,k){var E,_;const I=s(v)?((E=t.root.value)==null?void 0:E.offsetHeight)||0:((_=t.root.value)==null?void 0:_.offsetWidth)||0;return c.value?I*((2-p)*(y-k)+1)/4:yi&&(e.scrollTop=a-e.clientHeight)}function FP(e,t,n,o,l){const a=Date.now();let s;const i=()=>{const c=Date.now()-a,d=BP(c>o?o:c,t,n,o);ji(e)?e.scrollTo(window.pageXOffset,d):e.scrollTop=d,c