var N=Object.defineProperty,A=Object.defineProperties;var I=Object.getOwnPropertyDescriptors;var D=Object.getOwnPropertySymbols;var M=Object.prototype.hasOwnProperty,y=Object.prototype.propertyIsEnumerable;var C=(e,n,a)=>n in e?N(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a,F=(e,n)=>{for(var a in n||(n={}))M.call(n,a)&&C(e,a,n[a]);if(D)for(var a of D(n))y.call(n,a)&&C(e,a,n[a]);return e},$=(e,n)=>A(e,I(n));import{P}from"./index.566277e5.js";import{a as b,aK as u,r as R,c as S,eI as Y,a1 as j,eJ as k,eq as H,dz as g,aP as O,cw as U,cv as W,bh as q,o as E,h as V,t as z,cx as J,cB as K,m as Q,a$ as G,aQ as w,aR as L,p,j as i,i as _}from"./index.0d073eaa.js";import"./index.e9a84cba.js";import"./index.0972fd96.js";import"./useSize.bb4e5ce5.js";import"./eagerComputed.156e81ff.js";import"./useWindowSizeFn.ef20ece8.js";import"./useContentViewHeight.01b9d1c6.js";import"./ArrowLeftOutlined.90d2e05e.js";import"./index.8680e4c4.js";import"./transButton.8c1b1a4f.js";const f=1e3,d=f*60,v=d*60,B=v*24,X=b({name:"Time",props:{value:u.oneOfType([u.number,u.instanceOf(Date),u.string]).isRequired,step:u.number.def(60),mode:u.oneOf(["date","datetime","relative"]).def("relative")},setup(e){const n=R(""),{t:a}=S();Y(m,e.step*f),j(()=>e.value,()=>{m()},{immediate:!0});function T(){const{value:t}=e;let s=0;if(U(t)){const l=t.toString().length>10?t:t*1e3;s=new Date(l).getTime()}else W(t)?s=new Date(t).getTime():q(t)&&(s=t.getTime());return s}function m(){const{mode:t,value:s}=e,l=T();t==="relative"?n.value=h(l):t==="datetime"?n.value=k(s):t==="date"&&(n.value=H(s))}function h(t){const s=new Date().getTime(),l=g(t).isBefore(s);let o=s-t;l||(o=-o);let r="",c=a(l?"component.time.before":"component.time.after");return o<f?r=a("component.time.just"):o<d?r=parseInt(o/f)+a("component.time.seconds")+c:o>=d&&o<v?r=Math.floor(o/d)+a("component.time.minutes")+c:o>=v&&o<B?r=Math.floor(o/v)+a("component.time.hours")+c:o>=B&&o<262386e4?r=Math.floor(o/B)+a("component.time.days")+c:o>=262386e4&&o<=3156786e4&&l?r=g(t).format("MM-DD-HH-mm"):r=g(t).format("YYYY"),r}return{date:n}}});function Z(e,n,a,T,m,h){return E(),V("span",null,z(e.date),1)}var x=O(X,[["render",Z]]);const ee=J(x),te=b({components:{PageWrapper:P,Time:ee,CollapseContainer:K},setup(){const e=new Date().getTime(),n=Q({time1:e-60*3*1e3,time2:e-86400*3*1e3});return $(F({},G(n)),{now:e})}}),ne=_("br",null,null,-1),ae=_("br",null,null,-1),oe=_("br",null,null,-1),se=_("br",null,null,-1);function ie(e,n,a,T,m,h){const t=w("Time"),s=w("CollapseContainer"),l=w("PageWrapper");return E(),L(l,{title:"\u65F6\u95F4\u7EC4\u4EF6\u793A\u4F8B"},{default:p(()=>[i(s,{title:"\u57FA\u7840\u793A\u4F8B"},{default:p(()=>[i(t,{value:e.time1},null,8,["value"]),ne,i(t,{value:e.time2},null,8,["value"])]),_:1}),i(s,{title:"\u5B9A\u65F6\u66F4\u65B0",class:"my-4"},{default:p(()=>[i(t,{value:e.now,step:1},null,8,["value"]),ae,i(t,{value:e.now,step:5},null,8,["value"])]),_:1}),i(s,{title:"\u5B9A\u65F6\u66F4\u65B0"},{default:p(()=>[i(t,{value:e.now,mode:"date"},null,8,["value"]),oe,i(t,{value:e.now,mode:"datetime"},null,8,["value"]),se,i(t,{value:e.now},null,8,["value"])]),_:1})]),_:1})}var ge=O(te,[["render",ie]]);export{ge as default};
