"use strict";(self["webpackChunkaw_webui"]=self["webpackChunkaw_webui"]||[]).push([[3275],{23275:(t,e,n)=>{n.r(e),n.d(e,{default:()=>_});var r=function(){var t=this,e=t._self._c;return e("svg")},a=[],i=(n(65069),n(43290),n(38862),n(3181)),o=require("d3"),s=require("color"),l=require("lodash"),u=require("moment"),c=require("../util/time");function f(t){t.innerHTML="",o.select(t).attr("viewBox","0 0 100 4").attr("width","100%")}function p(t,e){var n=o.select(t);n.selectAll("*").remove(),n.append("text").attr("x","0").attr("y","3").text(e).attr("font-family","sans-serif").attr("font-size","2").attr("fill","black")}function d(t,e,n){var r=o.select(t);if(r.selectAll("*").remove(),!(e.length<=0)){e=l.clone(e),l.reverse(e);var a=l.first(e),f=l.last(e),d=u(a.timestamp),m=u(f.timestamp),v=(m-d)/1e3+f.duration;return console.log("First: "+d.format()),console.log("Last: "+m.format()),console.log("Duration: "+v),l.each(e,(function(t,e){var a="timeline_event_"+e,o=u(t.timestamp),l=(0,i.T_)((0,i.NF)({type:n},t)),f=s(l).darken(.4).hex(),p=(o-d)/1e3/v,m=100*t.duration/v,h=r.append("g").attr("id",a).attr("transform","translate("+100*p+",0)"),y=h.append("rect").attr("width",m).attr("height",4).style("fill",l).on("mouseover",(function(t,e,n){var r=n[e];r.style.fill=f})).on("mouseout",(function(t,e,n){var r=n[e];r.style.fill=l}));y.append("title").text(o.format()+"\nDuration: "+c.seconds_to_duration(t.duration)+"\n"+JSON.stringify(t.data)),t.duration>.05*v&&h.append("text").attr("font-size",2).attr("x",1).attr("y",2.5).attr("pointer-events","none").text((0,i.NF)({type:n},t))})),t}p(t,"No data")}const m={create:f,update:d},v={name:"aw-timeline",props:{type:String,event_type:String,events:Array},watch:{events:function(){m.update(this.$el,this.events,this.event_type)}},mounted:function(){m.create(this.$el)}},h=v;var y=n(1001),w=(0,y.Z)(h,r,a,!1,null,"ad967da4",null);const _=w.exports}}]);
//# sourceMappingURL=3275.3be6ac4e.js.map