From ec404a971bca523dde755687bad7999f55af1c65 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 31 Jan 2019 18:06:05 -0500 Subject: ... --- build/asset-manifest.json | 6 +- build/index.html | 2 +- ...he-manifest.4b3348396592c5f2793c6b9bef079d99.js | 118 +++++++++++++++++++++ ...he-manifest.6f3255a92338a4917c393f15fc8d5469.js | 118 --------------------- build/service-worker.js | 2 +- build/static/js/main.0c8ec738.chunk.js | 2 + build/static/js/main.0c8ec738.chunk.js.map | 1 + build/static/js/main.36efdf67.chunk.js | 2 - build/static/js/main.36efdf67.chunk.js.map | 1 - src/App.js | 4 +- 10 files changed, 128 insertions(+), 128 deletions(-) create mode 100644 build/precache-manifest.4b3348396592c5f2793c6b9bef079d99.js delete mode 100644 build/precache-manifest.6f3255a92338a4917c393f15fc8d5469.js create mode 100644 build/static/js/main.0c8ec738.chunk.js create mode 100644 build/static/js/main.0c8ec738.chunk.js.map delete mode 100644 build/static/js/main.36efdf67.chunk.js delete mode 100644 build/static/js/main.36efdf67.chunk.js.map diff --git a/build/asset-manifest.json b/build/asset-manifest.json index d3228d7..4761af6 100644 --- a/build/asset-manifest.json +++ b/build/asset-manifest.json @@ -1,6 +1,6 @@ { - "main.js": "/static/js/main.36efdf67.chunk.js", - "main.js.map": "/static/js/main.36efdf67.chunk.js.map", + "main.js": "/static/js/main.0c8ec738.chunk.js", + "main.js.map": "/static/js/main.0c8ec738.chunk.js.map", "static/css/1.297ee474.chunk.css": "/static/css/1.297ee474.chunk.css", "static/js/1.b5cbbf9b.chunk.js": "/static/js/1.b5cbbf9b.chunk.js", "static/js/1.b5cbbf9b.chunk.js.map": "/static/js/1.b5cbbf9b.chunk.js.map", @@ -9,6 +9,6 @@ "static/media/index.css": "/static/media/roboto-latin-900italic.bc833e72.woff", "static/css/1.297ee474.chunk.css.map": "/static/css/1.297ee474.chunk.css.map", "index.html": "/index.html", - "precache-manifest.6f3255a92338a4917c393f15fc8d5469.js": "/precache-manifest.6f3255a92338a4917c393f15fc8d5469.js", + "precache-manifest.4b3348396592c5f2793c6b9bef079d99.js": "/precache-manifest.4b3348396592c5f2793c6b9bef079d99.js", "service-worker.js": "/service-worker.js" } \ No newline at end of file diff --git a/build/index.html b/build/index.html index 6b1aa38..1880729 100644 --- a/build/index.html +++ b/build/index.html @@ -1 +1 @@ -Chromicle
\ No newline at end of file +Chromicle
\ No newline at end of file diff --git a/build/precache-manifest.4b3348396592c5f2793c6b9bef079d99.js b/build/precache-manifest.4b3348396592c5f2793c6b9bef079d99.js new file mode 100644 index 0000000..0c285f0 --- /dev/null +++ b/build/precache-manifest.4b3348396592c5f2793c6b9bef079d99.js @@ -0,0 +1,118 @@ +self.__precacheManifest = [ + { + "revision": "d8bcbe724fd6f4ba44d0ee6a2675890f", + "url": "/static/media/roboto-latin-400italic.d8bcbe72.woff2" + }, + { + "revision": "0c8ec738cbc4afdfc52a", + "url": "/static/js/main.0c8ec738.chunk.js" + }, + { + "revision": "bc833e725c137257c2c42a789845d82f", + "url": "/static/media/roboto-latin-900italic.bc833e72.woff" + }, + { + "revision": "229c360febb4351a89df", + "url": "/static/js/runtime~main.229c360f.js" + }, + { + "revision": "987b84570ea69ee660455b8d5e91f5f1", + "url": "/static/media/roboto-latin-100.987b8457.woff2" + }, + { + "revision": "e9dbbe8a693dd275c16d32feb101f1c1", + "url": "/static/media/roboto-latin-100.e9dbbe8a.woff" + }, + { + "revision": "d704bb3d579b7d5e40880c75705c8a71", + "url": "/static/media/roboto-latin-100italic.d704bb3d.woff" + }, + { + "revision": "55536c8e9e9a532651e3cf374f290ea3", + "url": "/static/media/roboto-latin-300.55536c8e.woff2" + }, + { + "revision": "a1471d1d6431c893582a5f6a250db3f9", + "url": "/static/media/roboto-latin-300.a1471d1d.woff" + }, + { + "revision": "6232f43d15b0e7a0bf0fe82e295bdd06", + "url": "/static/media/roboto-latin-100italic.6232f43d.woff2" + }, + { + "revision": "d69924b98acd849cdeba9fbff3f88ea6", + "url": "/static/media/roboto-latin-300italic.d69924b9.woff2" + }, + { + "revision": "210a7c781f5a354a0e4985656ab456d9", + "url": "/static/media/roboto-latin-300italic.210a7c78.woff" + }, + { + "revision": "bafb105baeb22d965c70fe52ba6b49d9", + "url": "/static/media/roboto-latin-400.bafb105b.woff" + }, + { + "revision": "9680d5a0c32d2fd084e07bbc4c8b2923", + "url": "/static/media/roboto-latin-400italic.9680d5a0.woff" + }, + { + "revision": "8c2ade503b34e31430d6c98aa29a52a3", + "url": "/static/media/roboto-latin-900.8c2ade50.woff" + }, + { + "revision": "285467176f7fe6bb6a9c6873b3dad2cc", + "url": "/static/media/roboto-latin-500.28546717.woff2" + }, + { + "revision": "de8b7431b74642e830af4d4f4b513ec9", + "url": "/static/media/roboto-latin-500.de8b7431.woff" + }, + { + "revision": "510dec37fa69fba39593e01a469ee018", + "url": "/static/media/roboto-latin-500italic.510dec37.woff2" + }, + { + "revision": "ffcc050b2d92d4b14a4fcb527ee0bcc8", + "url": "/static/media/roboto-latin-500italic.ffcc050b.woff" + }, + { + "revision": "037d830416495def72b7881024c14b7b", + "url": "/static/media/roboto-latin-700.037d8304.woff2" + }, + { + "revision": "5d4aeb4e5f5ef754e307d7ffaef688bd", + "url": "/static/media/roboto-latin-400.5d4aeb4e.woff2" + }, + { + "revision": "010c1aeee3c6d1cbb1d5761d80353823", + "url": "/static/media/roboto-latin-700italic.010c1aee.woff2" + }, + { + "revision": "cf6613d1adf490972c557a8e318e0868", + "url": "/static/media/roboto-latin-700.cf6613d1.woff" + }, + { + "revision": "846d1890aee87fde5d8ced8eba360c3a", + "url": "/static/media/roboto-latin-700italic.846d1890.woff" + }, + { + "revision": "19b7a0adfdd4f808b53af7e2ce2ad4e5", + "url": "/static/media/roboto-latin-900.19b7a0ad.woff2" + }, + { + "revision": "7b770d6c53423deb1a8e49d3c9175184", + "url": "/static/media/roboto-latin-900italic.7b770d6c.woff2" + }, + { + "revision": "b5cbbf9bff7bad31bf86", + "url": "/static/js/1.b5cbbf9b.chunk.js" + }, + { + "revision": "b5cbbf9bff7bad31bf86", + "url": "/static/css/1.297ee474.chunk.css" + }, + { + "revision": "ae169eb6e1e22ab620835a8b332f1b63", + "url": "/index.html" + } +]; \ No newline at end of file diff --git a/build/precache-manifest.6f3255a92338a4917c393f15fc8d5469.js b/build/precache-manifest.6f3255a92338a4917c393f15fc8d5469.js deleted file mode 100644 index 282089e..0000000 --- a/build/precache-manifest.6f3255a92338a4917c393f15fc8d5469.js +++ /dev/null @@ -1,118 +0,0 @@ -self.__precacheManifest = [ - { - "revision": "d8bcbe724fd6f4ba44d0ee6a2675890f", - "url": "/static/media/roboto-latin-400italic.d8bcbe72.woff2" - }, - { - "revision": "36efdf6701903316bed6", - "url": "/static/js/main.36efdf67.chunk.js" - }, - { - "revision": "bc833e725c137257c2c42a789845d82f", - "url": "/static/media/roboto-latin-900italic.bc833e72.woff" - }, - { - "revision": "229c360febb4351a89df", - "url": "/static/js/runtime~main.229c360f.js" - }, - { - "revision": "987b84570ea69ee660455b8d5e91f5f1", - "url": "/static/media/roboto-latin-100.987b8457.woff2" - }, - { - "revision": "6232f43d15b0e7a0bf0fe82e295bdd06", - "url": "/static/media/roboto-latin-100italic.6232f43d.woff2" - }, - { - "revision": "e9dbbe8a693dd275c16d32feb101f1c1", - "url": "/static/media/roboto-latin-100.e9dbbe8a.woff" - }, - { - "revision": "55536c8e9e9a532651e3cf374f290ea3", - "url": "/static/media/roboto-latin-300.55536c8e.woff2" - }, - { - "revision": "a1471d1d6431c893582a5f6a250db3f9", - "url": "/static/media/roboto-latin-300.a1471d1d.woff" - }, - { - "revision": "d704bb3d579b7d5e40880c75705c8a71", - "url": "/static/media/roboto-latin-100italic.d704bb3d.woff" - }, - { - "revision": "210a7c781f5a354a0e4985656ab456d9", - "url": "/static/media/roboto-latin-300italic.210a7c78.woff" - }, - { - "revision": "d69924b98acd849cdeba9fbff3f88ea6", - "url": "/static/media/roboto-latin-300italic.d69924b9.woff2" - }, - { - "revision": "5d4aeb4e5f5ef754e307d7ffaef688bd", - "url": "/static/media/roboto-latin-400.5d4aeb4e.woff2" - }, - { - "revision": "bafb105baeb22d965c70fe52ba6b49d9", - "url": "/static/media/roboto-latin-400.bafb105b.woff" - }, - { - "revision": "7b770d6c53423deb1a8e49d3c9175184", - "url": "/static/media/roboto-latin-900italic.7b770d6c.woff2" - }, - { - "revision": "9680d5a0c32d2fd084e07bbc4c8b2923", - "url": "/static/media/roboto-latin-400italic.9680d5a0.woff" - }, - { - "revision": "285467176f7fe6bb6a9c6873b3dad2cc", - "url": "/static/media/roboto-latin-500.28546717.woff2" - }, - { - "revision": "de8b7431b74642e830af4d4f4b513ec9", - "url": "/static/media/roboto-latin-500.de8b7431.woff" - }, - { - "revision": "510dec37fa69fba39593e01a469ee018", - "url": "/static/media/roboto-latin-500italic.510dec37.woff2" - }, - { - "revision": "ffcc050b2d92d4b14a4fcb527ee0bcc8", - "url": "/static/media/roboto-latin-500italic.ffcc050b.woff" - }, - { - "revision": "037d830416495def72b7881024c14b7b", - "url": "/static/media/roboto-latin-700.037d8304.woff2" - }, - { - "revision": "cf6613d1adf490972c557a8e318e0868", - "url": "/static/media/roboto-latin-700.cf6613d1.woff" - }, - { - "revision": "010c1aeee3c6d1cbb1d5761d80353823", - "url": "/static/media/roboto-latin-700italic.010c1aee.woff2" - }, - { - "revision": "846d1890aee87fde5d8ced8eba360c3a", - "url": "/static/media/roboto-latin-700italic.846d1890.woff" - }, - { - "revision": "19b7a0adfdd4f808b53af7e2ce2ad4e5", - "url": "/static/media/roboto-latin-900.19b7a0ad.woff2" - }, - { - "revision": "8c2ade503b34e31430d6c98aa29a52a3", - "url": "/static/media/roboto-latin-900.8c2ade50.woff" - }, - { - "revision": "b5cbbf9bff7bad31bf86", - "url": "/static/js/1.b5cbbf9b.chunk.js" - }, - { - "revision": "b5cbbf9bff7bad31bf86", - "url": "/static/css/1.297ee474.chunk.css" - }, - { - "revision": "41d3415b63e510212e25ae08824f3386", - "url": "/index.html" - } -]; \ No newline at end of file diff --git a/build/service-worker.js b/build/service-worker.js index 274873b..eee1ebb 100644 --- a/build/service-worker.js +++ b/build/service-worker.js @@ -14,7 +14,7 @@ importScripts("https://storage.googleapis.com/workbox-cdn/releases/3.6.3/workbox-sw.js"); importScripts( - "/precache-manifest.6f3255a92338a4917c393f15fc8d5469.js" + "/precache-manifest.4b3348396592c5f2793c6b9bef079d99.js" ); workbox.clientsClaim(); diff --git a/build/static/js/main.0c8ec738.chunk.js b/build/static/js/main.0c8ec738.chunk.js new file mode 100644 index 0000000..f55a1f0 --- /dev/null +++ b/build/static/js/main.0c8ec738.chunk.js @@ -0,0 +1,2 @@ +(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{308:function(e,t,a){e.exports=a(655)},655:function(e,t,a){"use strict";a.r(t);var n=a(1),r=a.n(n),c=a(28),o=a.n(c),i=a(137),l=a(101),s=a(39),u=a(45),h=a(78),d=a(74),m=a(79),p=(a(313),a(315),a(341),a(286)),f=a(31),v=a(99),g=a.n(v),y=a(306),E=a.n(y),w=a(305),b=a.n(w),P=a(173),x=a.n(P),k=a(81),S=a.n(k),T=a(177),C=a.n(T),D=a(93),O=a.n(D),j=a(103),R=a.n(j),N=a(40),B=a.n(N),G=a(307),I=a.n(G),W=a(174),K=a.n(W),A=function(e){return r.a.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 98.905998 93.557997",version:"1.1",style:e.style},r.a.createElement("g",{id:"g13",transform:"translate(-153.533,-203.047)"},r.a.createElement("g",{id:"g29"},r.a.createElement("g",{id:"g27"},r.a.createElement("polygon",{id:"polygon7",points:"252.439,241.924 234.556,288.703 185.103,296.605 153.533,257.728 171.416,210.949 220.869,203.047 ",style:{fill:"#ff8000"}}),r.a.createElement("g",{id:"g11",transform:"translate(167.24355,224.20734)"},r.a.createElement("text",{id:"text9",style:{fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",fontStretch:"normal",fontSize:75,fontFamily:"TypoPRO Fantasque Sans Mono",fill:"#ffeade"},transform:"translate(0.586,49.072)"},"Cr"))))))},_="https://www.googleapis.com/calendar/v3",M={invalidSyncToken:1,otherError:2};function z(e){return Object.entries(e).map(function(e){var t=Object(i.a)(e,2),a=t[0],n=t[1];return"".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(n))}).join("&")}function F(){return new Promise(function(e){return chrome.identity.getAuthToken({interactive:!0},function(t){return e(t)})})}function U(e){return fetch("".concat(_,"/users/me/calendarList?").concat(z({access_token:e})),{method:"GET",async:!0}).then(function(e){return e.json()}).then(function(e){return e.items})}function L(e){return fetch("".concat(_,"/colors?").concat(z({access_token:e})),{method:"GET",async:!0}).then(function(e){return e.json()})}var $=function(){function e(t,a){Object(s.a)(this,e),this.calId=t,this.name=a,this.token=F(),this.syncToken="",this.cache={}}return Object(u.a)(e,[{key:"getSlot",value:function(e){return this.cache[e]||(this.cache[e]={}),this.cache[e]}},{key:"addEvent",value:function(t){var a=e.dateToCacheKey(t.start),n=e.dateToCacheKey(new Date(t.end.getTime()-1));if(a===n)this.getSlot(a)[t.id]={start:t.start,end:t.end,id:t.id};else{this.getSlot(a)[t.id]={start:t.start,end:e.slotEndDate(a),id:t.id},this.getSlot(n)[t.id]={start:e.slotStartDate(n),end:t.end,id:t.id};for(var r=a+1;r=a||n[c].end<=t))(n[c].start(n[c].end>a?a:n[c].end)&&console.log(n[c],t,a),r.push({id:c,start:n[c].starta?a:n[c].end})}return r}},{key:"getCachedEvents",value:function(t,a){for(var n=e.dateToCacheKey(t),r=e.dateToCacheKey(new Date(a.getTime()-1)),c=this.getSlotEvents(n,t,a),o=n+1;on&&c.push.apply(c,Object(l.a)(this.getSlotEvents(r,t,a))),c}},{key:"sync",value:function(){var e=this;return this.token.then(function(t){return function(e,t,a){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:100,r=[];return function a(c,o){return fetch("".concat(_,"/calendars/").concat(e,"/events?").concat(z({access_token:t,pageToken:c,syncToken:o,maxResults:n})),{method:"GET",async:!0}).then(function(e){if(200===e.status)return e.json();throw 410==e.status?M.invalidSyncToken:M.otherErrors}).then(function(e){return r.push.apply(r,Object(l.a)(e.items)),e.nextPageToken?a(e.nextPageToken,""):{nextSyncToken:e.nextSyncToken,results:r}})}("",a)}(e.calId,t,e.syncToken).then(function(a){e.syncToken=a.nextSyncToken;var n=a.results.map(function(a){return a.start?Promise.resolve(a):function(e,t,a){return fetch("".concat(_,"/calendars/").concat(e,"/events/").concat(t,"?").concat(z({access_token:a})),{method:"GET",async:!0}).then(function(e){return e.json()})}(e.calId,a.id,t)});return Promise.all(n).then(function(t){return t.forEach(function(t){t.start=new Date(t.start.dateTime),t.end=new Date(t.end.dateTime),"confirmed"===t.status?e.addEvent(t):"cancelled"===t.status&&e.removeEvent(t)})})})}).catch(function(t){if(t!=M.invalidSyncToken)throw t;e.syncToken="",e.sync()})}},{key:"getEvents",value:function(e,t){var a=this;return this.sync().then(function(){return a.getCachedEvents(e,t)})}}],[{key:"dateToCacheKey",value:function(e){return Math.floor(e/864e5)}},{key:"slotStartDate",value:function(e){return new Date(864e5*e)}},{key:"slotEndDate",value:function(e){return new Date(864e5*(e+1))}}]),e}(),H=function(){function e(t,a,n,r){Object(s.a)(this,e),this.id=t,this.isRegex=a,this.value=n,this.label=r}return Object(u.a)(e,[{key:"regex",get:function(){return new RegExp(this.isRegex?this.value:"^".concat(this.value,"$"))}},{key:"isEmpty",get:function(){return null===this.label}}]),e}();H.emptyPattern=function(){return new H(0,!0,"",null)},H.anyPattern=function(){return new H("any",!0,".*","Any")};var J=function e(t,a,n,r){Object(s.a)(this,e),this.name=t,this.idx=a,this.cal=n,this.event=r};J.defaultPatternEntry=function(e){return new J("",e,H.emptyPattern(),H.anyPattern())};var V=a(299),q=a.n(V),X=a(659),Y=a(657),Q=a(656),Z=a(554);function ee(e){var t=e.cx,a=e.cy,n=e.x,c=e.y,o=e.fill,i=e.name,l="middle",s=0,u=0;return nt+2&&(s=5,l="start"),ca+2&&(u=10),r.a.createElement("text",{x:n,y:c,dx:s,dy:u,fill:o,textAnchor:l},"".concat(i))}var te=Object(f.withStyles)(function(e){return{pieChart:{margin:"0 auto"}}})(function(e){return r.a.createElement(B.a,{container:!0,spacing:0},r.a.createElement(B.a,{item:!0,xs:12,lg:6},r.a.createElement("div",{className:e.classes.patternTableWrapper},r.a.createElement(X.a,{width:400,height:250,className:e.classes.pieChart},r.a.createElement(Y.a,{data:e.patternGraphData,dataKey:"value",cx:200,cy:125,outerRadius:60,fill:q.a[300],label:ee}),r.a.createElement(Q.a,{formatter:function(e){return"".concat(e.toFixed(2)," hr")}})))),r.a.createElement(B.a,{item:!0,xs:12,lg:6},r.a.createElement("div",{className:e.classes.patternTableWrapper},r.a.createElement(X.a,{width:400,height:250,className:e.classes.pieChart},r.a.createElement(Y.a,{data:e.calendarGraphData,dataKey:"value",cx:200,cy:125,innerRadius:40,outerRadius:70,fill:g.a[300],label:ee},e.calendarGraphData.map(function(e,t){return r.a.createElement(Z.a,{key:t,fill:e.color})})),r.a.createElement(Q.a,{formatter:function(e){return"".concat(e.toFixed(2)," hr")}})))))}),ae=a(136),ne=a.n(ae),re=a(301),ce=a.n(re),oe=a(303),ie=a.n(oe),le=a(140),se=a.n(le),ue=a(100),he=a.n(ue),de=a(302),me=a.n(de),pe=a(304),fe=a.n(pe),ve=a(300),ge=a.n(ve),ye=a(131),Ee=a.n(ye),we=a(172),be=a.n(we),Pe=function(e){function t(){return Object(s.a)(this,t),Object(h.a)(this,Object(d.a)(t).apply(this,arguments))}return Object(m.a)(t,e),Object(u.a)(t,[{key:"render",value:function(){var e=this,t=this.props.classes,a=[],n=this.props.options,c=new H.emptyPattern;for(var o in n[c.id]=c,n){var i=n[o].isEmpty?r.a.createElement("span",{style:{color:this.props.theme.palette.primary.dark}},"Custom"):n[o].label;a.push(r.a.createElement(be.a,{key:o,value:o},i))}var l=this.props.value.isRegex?t.fieldRegex:t.fieldNoRegex;return r.a.createElement(O.a,null,r.a.createElement("span",null,r.a.createElement(Ee.a,{value:this.props.value.id,onChange:function(t){var a;a=null==n[t.target.value].label?new H(0,!0,e.props.value.isRegex?e.props.value.value:"^".concat(e.props.value.value,"$"),null):n[t.target.value],e.props.onChange({target:{value:a}})},className:l},a),null==this.props.value.label&&r.a.createElement(ne.a,{value:this.props.value.value,onChange:function(t){return e.props.onChange({target:{value:new H(0,!0,t.target.value,null)}})}})))}}]),t}(r.a.Component),xe=Object(f.withStyles)(function(e){return{fieldNoRegex:{width:200},fieldRegex:{marginRight:"0.5em"}}})(Pe);var ke=a(139),Se=a.n(ke),Te=Object(f.createMuiTheme)({palette:{primary:{light:Se.a[300],main:Se.a[500],dark:Se.a[700],contrastText:"#fff"}},typography:{useNextVariants:!0}}),Ce=[{label:"Name",field:"name",elem:ne.a},{label:"Calendar",field:"cal",elem:Object(f.withTheme)(Te)(function(e){var t={};for(var a in e.cached.calendars)t[a]=new H(a,!1,e.cached.calendars[a].name,e.cached.calendars[a].name);return r.a.createElement(xe,{value:e.value,options:t,onChange:e.onChange,theme:e.theme})})},{label:"Event",field:"event",elem:Object(f.withTheme)(Te)(function(e){var t=H.anyPattern(),a={};return a[t.id]=t,r.a.createElement(xe,{value:e.value,options:a,onChange:e.onChange,theme:e.theme})})}],De=function(e){function t(){var e,a;Object(s.a)(this,t);for(var n=arguments.length,r=new Array(n),c=0;c0&&r.a.createElement(se.a,{style:{height:48*s}},r.a.createElement(he.a,{colSpan:Ce.length}))))),r.a.createElement(fe.a,{rowsPerPageOptions:[5,10,25],component:"div",count:c.length,rowsPerPage:i,page:l,backIconButtonProps:{"aria-label":"Previous Page"},nextIconButtonProps:{"aria-label":"Next Page"},onChangePage:this.handleChangePage,onChangeRowsPerPage:this.handleChangeRowsPerPage}))}}]),t}(r.a.Component),Oe=Object(f.withStyles)(function(e){return{deleteButtonShow:{position:"absolute",right:0,height:48},deleteButtonHide:{display:"none"},deleteIcon:{height:"100%",cursor:"pointer"},patternTableWrapper:{overflowX:"auto",overflowY:"hidden"},patternTable:{minWidth:600}}})(De),je=[{name:"Work",value:10,color:g.a[300]},{name:"Wasted",value:10,color:g.a[300]}];var Re=function(e){function t(){var e,a;Object(s.a)(this,t);for(var n=arguments.length,r=new Array(n),c=0;c\n \n \n \n \n \n \n Cr\n \n \n \n \n \n","/* global chrome */\nconst gapi_base = 'https://www.googleapis.com/calendar/v3';\n\nconst GApiError = {\n invalidSyncToken: 1,\n otherError: 2,\n};\n\nfunction to_params(dict) {\n return Object.entries(dict).map(([k, v]) => `${encodeURIComponent(k)}=${encodeURIComponent(v)}`).join('&');\n}\n\nexport function getAuthToken() {\n return new Promise(resolver =>\n chrome.identity.getAuthToken(\n {interactive: true}, token => resolver(token)));\n}\n\nexport function getCalendars(token) {\n return fetch(`${gapi_base}/users/me/calendarList?${to_params({access_token: token})}`,\n { method: 'GET', async: true })\n .then(response => response.json())\n .then(data => data.items);\n}\n\nexport function getColors(token) {\n return fetch(`${gapi_base}/colors?${to_params({access_token: token})}`,\n { method: 'GET', async: true })\n .then(response => response.json());\n}\n\nfunction getEvent(calId, eventId, token) {\n return fetch(`${gapi_base}/calendars/${calId}/events/${eventId}?${to_params({access_token: token})}`,\n { method: 'GET', async: true })\n .then(response => response.json());\n}\n\nfunction getEvents(calId, token, syncToken, resultsPerRequest=100) {\n let results = [];\n const singleFetch = (pageToken, syncToken) => fetch(`${gapi_base}/calendars/${calId}/events?${to_params({\n access_token: token,\n pageToken,\n syncToken,\n maxResults: resultsPerRequest\n })}`, { method: 'GET', async: true })\n .then(response => {\n if (response.status === 200)\n return response.json();\n else if (response.status == 410)\n throw GApiError.invalidSyncToken;\n else throw GApiError.otherErrors;\n })\n .then(data => {\n results.push(...data.items);\n if (data.nextPageToken) {\n return singleFetch(data.nextPageToken, '');\n } else {\n return ({\n nextSyncToken: data.nextSyncToken,\n results\n });\n }\n })\n\n return singleFetch('', syncToken);\n}\n\nexport class GCalendar {\n constructor(calId, name) {\n this.calId = calId;\n this.name = name;\n this.token = getAuthToken();\n this.syncToken = '';\n this.cache = {};\n }\n\n static dateToCacheKey(date) {\n return Math.floor(date / 8.64e7);\n }\n\n getSlot(k) {\n if (!this.cache[k])\n this.cache[k] = {};\n return this.cache[k];\n }\n\n static slotStartDate(k) { return new Date(k * 8.64e7); }\n static slotEndDate(k) { return new Date((k + 1) * 8.64e7); }\n\n addEvent(e) {\n let ks = GCalendar.dateToCacheKey(e.start);\n let ke = GCalendar.dateToCacheKey(new Date(e.end.getTime() - 1));\n if (ks === ke)\n this.getSlot(ks)[e.id] = {\n start: e.start,\n end: e.end,\n id: e.id };\n else\n {\n this.getSlot(ks)[e.id] = {\n start: e.start,\n end: GCalendar.slotEndDate(ks),\n id: e.id };\n this.getSlot(ke)[e.id] = {\n start: GCalendar.slotStartDate(ke),\n end: e.end,\n id: e.id };\n for (let k = ks + 1; k < ke; k++)\n this.getSlot(k)[e.id] = {\n start: GCalendar.slotStartDate(k),\n end: GCalendar.slotEndDate(k),\n id: e.id };\n }\n }\n\n removeEvent(e) {\n let ks = GCalendar.dateToCacheKey(e.start);\n let ke = GCalendar.dateToCacheKey(new Date(e.end.getTime() - 1));\n for (let k = ks; k <= ke; k++)\n delete this.getSlot(k)[e.id];\n }\n\n getSlotEvents(k, start, end) {\n let s = this.getSlot(k);\n let results = [];\n for (let id in s) {\n if (!(s[id].start >= end || s[id].end <= start))\n {\n let nstart = s[id].start < start ? start: s[id].start;\n let nend = s[id].end > end ? end: s[id].end;\n if (nstart > nend) console.log(s[id], start, end);\n results.push({\n id,\n start: s[id].start < start ? start: s[id].start,\n end: s[id].end > end ? end: s[id].end\n });\n }\n }\n return results;\n }\n\n getCachedEvents(start, end) {\n let ks = GCalendar.dateToCacheKey(start);\n let ke = GCalendar.dateToCacheKey(new Date(end.getTime() - 1));\n let results = this.getSlotEvents(ks, start, end);\n for (let k = ks + 1; k < ke; k++)\n {\n let s = this.getSlot(k);\n for (let id in s)\n results.push(s[id]);\n }\n if (ke > ks)\n results.push(...this.getSlotEvents(ke, start, end));\n return results;\n }\n\n sync() {\n return this.token.then(token => getEvents(this.calId, token, this.syncToken).then(r => {\n this.syncToken = r.nextSyncToken;\n let pm_results = r.results.map(e => e.start ? Promise.resolve(e) : getEvent(this.calId, e.id, token));\n return Promise.all(pm_results).then(results => results.forEach(e => {\n e.start = new Date(e.start.dateTime);\n e.end = new Date(e.end.dateTime);\n if (e.status === 'confirmed')\n this.addEvent(e);\n else if (e.status === 'cancelled')\n this.removeEvent(e);\n }));\n })).catch(e => {\n if (e == GApiError.invalidSyncToken) {\n this.syncToken = '';\n this.sync();\n } else throw e;\n });\n }\n\n getEvents(start, end) {\n return this.sync().then(() => this.getCachedEvents(start, end));\n }\n}\n","export class Pattern {\n constructor(id, isRegex, value, label) {\n this.id = id;\n this.isRegex = isRegex;\n this.value = value;\n this.label = label;\n }\n\n get regex() { return new RegExp(this.isRegex ? this.value : `^${this.value}$`); }\n get isEmpty() { return this.label === null; }\n static emptyPattern = () => new Pattern(0, true, '', null);\n static anyPattern = () => new Pattern('any', true, '.*', 'Any');\n}\n\nexport class PatternEntry {\n constructor(name, idx, calPattern, eventPattern) {\n this.name = name;\n this.idx = idx;\n this.cal = calPattern;\n this.event = eventPattern;\n }\n\n static defaultPatternEntry = (idx) => new PatternEntry('', idx, Pattern.emptyPattern(), Pattern.anyPattern());\n}\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Grid from '@material-ui/core/Grid';\nimport deepOrange from '@material-ui/core/colors/deepOrange';\nimport cyan from '@material-ui/core/colors/cyan';\nimport { PieChart, Pie, Cell, Tooltip } from 'recharts';\n\nconst styles = theme => ({\n pieChart: {\n margin: '0 auto',\n }\n});\n\nfunction customizedLabel(props) {\n const {cx, cy, x, y, fill, name} = props;\n let anchor = \"middle\";\n const EPS = 2;\n let dx = 0;\n let dy = 0;\n if (x < cx - EPS) {\n dx = -5;\n anchor = \"end\"\n } else if (x > cx + EPS) {\n dx = 5;\n anchor = \"start\";\n }\n\n if (y < cy - EPS) {\n dy = -5;\n } else if (y > cy + EPS) {\n dy = 10;\n }\n\n return ({`${name}`});\n}\n\nfunction ChromiclePieChart(props) {\n return (\n \n \n
\n \n \n `${value.toFixed(2)} hr`}/>\n \n
\n
\n \n
\n \n \n {props.calendarGraphData.map((d, i) => )}\n \n `${value.toFixed(2)} hr`}/>\n \n
\n
\n
);\n}\n\nChromiclePieChart.propTypes = {\n patternGraphData: PropTypes.array.isRequired,\n calendarGraphData: PropTypes.array.isRequired,\n};\n\nexport default withStyles(styles)(ChromiclePieChart);\n","import React from 'react';\nimport PropTypes from 'prop-types';\nimport { withStyles } from '@material-ui/core/styles';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TextField from '@material-ui/core/TextField';\nimport FormControl from '@material-ui/core/FormControl';\nimport { Pattern } from './pattern';\n\nconst styles = theme => ({\n fieldNoRegex: {\n width: 200\n },\n fieldRegex: {\n marginRight: '0.5em'\n }\n});\n\nclass RegexField extends React.Component {\n render() {\n const { classes } = this.props;\n let items = [];\n var pitems = this.props.options;\n const p0 = new Pattern.emptyPattern();\n pitems[p0.id] = p0;\n for (let id in pitems)\n {\n const label = !pitems[id].isEmp