dateFormat-legacy-7f1891b4-1726219372904.js 2.5 KB

1
  1. System.register(["./index-legacy-07b6971b-1726219372904.js"],(function(e,t){"use strict";var n,r,a,o,i,u,l,c,s,m;return{setters:[e=>{n=e.b1,r=e.b2,a=e.a3,o=e.d,i=e.b3,u=e.r,l=e.U,c=e.q,s=e.am,m=e.Q}],execute:function(){e({a:function(e){const t=e;let n=7-new Date(e).getDay();return 7==n&&(n=0),new Date(t+24*n*60*60*1e3).getTime()},c:function(e){return Math.floor(e/60)},d:function(e){return Math.floor(e%60)},g:function(e){let t=e;const n=new Date(e);0==n.getDay()&&(t-=6048e5);const r=t-24*(n.getDay()-1)*60*60*1e3;return new Date(r).getTime()}});var t=1/0,f=17976931348623157e292;function d(e){var r=function(e){return e?(e=n(e))===t||e===-t?(e<0?-1:1)*f:e==e?e:0:0===e?e:0}(e),a=r%1;return r==r?a?r-a:r:0}var p,v=r.isFinite,h=Math.min;const g=(p=Math.round,function(e,t){if(e=n(e),(t=null==t?0:h(d(t),292))&&v(e)){var r=(a(e)+"e").split("e"),o=p(r[0]+"e"+(+r[1]+t));return+((r=(a(o)+"e").split("e"))[0]+"e"+(+r[1]-t))}return p(e)});function b(e){const{from:t,to:n,duration:r,onUpdate:a,onFinish:o}=e,i=()=>{const e=performance.now(),l=Math.min(e-u,r),c=t+(n-t)*(s=l/r,1-Math.pow(1-s,5));var s;l!==r?(a(c),requestAnimationFrame(i)):o()},u=performance.now();i()}const y={to:{type:Number,default:0},precision:{type:Number,default:0},showSeparator:Boolean,locale:String,from:{type:Number,default:0},active:{type:Boolean,default:!0},duration:{type:Number,default:2e3},onFinish:Function};e("N",o({name:"NumberAnimation",props:y,setup(e){const{localeRef:t}=i("name"),{duration:n}=e,r=u(e.from),a=l((()=>{const{locale:n}=e;return void 0!==n?n:t.value}));let o=!1;const m=e=>{r.value=e},f=()=>{var t;r.value=e.to,o=!1,null===(t=e.onFinish)||void 0===t||t.call(e)},d=(t=e.from,a=e.to)=>{o=!0,r.value=e.from,t!==a&&b({from:t,to:a,duration:n,onUpdate:m,onFinish:f})},p=l((()=>{var t;const n=g(r.value,e.precision).toFixed(e.precision).split("."),o=new Intl.NumberFormat(a.value),i=null===(t=o.formatToParts(.5).find((e=>"decimal"===e.type)))||void 0===t?void 0:t.value;return{integer:e.showSeparator?o.format(Number(n[0])):n[0],decimal:n[1],decimalSeparator:i}}));c((()=>{s((()=>{e.active&&d()}))}));const v={play:function(){o||d()}};return Object.assign({formattedValue:p},v)},render(){const{formattedValue:{integer:e,decimal:t,decimalSeparator:n}}=this;return[e,t?n:null,t]}})),e("b",((e,t=[],n="YYYY-MM-DD")=>e&&e.length?"YYYY-MM-DD"==n?{[t[0]||"start"]:m(e[0]).isValid()?m(e[0]).format(n)+" 00:00:00":"",[t[1]||"end"]:m(e[1]).isValid()?m(e[1]).format(n)+" 23:59:59":""}:{[t[0]||"start"]:m(e[0]).isValid()?m(e[0]).format(n):"",[t[1]||"end"]:m(e[1]).isValid()?m(e[1]).format(n):""}:{}))}}}));