From e4651c8d1bc1c416de553428bcfba137ca35ef91 Mon Sep 17 00:00:00 2001 From: Determinant Date: Thu, 7 Feb 2019 00:37:13 -0500 Subject: use a minimal webpack-based build env --- build/static/js/main.e5c342f4.chunk.js | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 build/static/js/main.e5c342f4.chunk.js (limited to 'build/static/js/main.e5c342f4.chunk.js') diff --git a/build/static/js/main.e5c342f4.chunk.js b/build/static/js/main.e5c342f4.chunk.js deleted file mode 100644 index 0c0a334..0000000 --- a/build/static/js/main.e5c342f4.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(window.webpackJsonp=window.webpackJsonp||[]).push([[0],{341:function(e,t,a){e.exports=a(713)},713:function(e,t,a){"use strict";a.r(t);var n=a(1),r=a.n(n),s=a(29),l=a.n(s),o=a(30),i=a(33),c=a(47),u=a(46),d=a(48),m=(a(346),a(27)),h=a(146),p=a.n(h),g=a(336),f=a.n(g),v=a(194),y=a.n(v),b=a(41),E=a.n(b),C=a(337),O=a.n(C),P=a(199),w=a.n(P),k=a(719),S=a(720),x=a(723),j=a(724),D=a(722),R=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"))))))},B=a(157),M=a.n(B),N=Object(m.createMuiTheme)({palette:{primary:{light:M.a[300],main:M.a[500],dark:M.a[700],contrastText:"#fff"}},typography:{useNextVariants:!0}}),L=a(76),I=(a(407),a(433),a(307)),T=a(119),z=a.n(T),A=a(49),G=a.n(A),W=a(74),F=a.n(W),H=a(77),V=a.n(H),_=a(38),U=a.n(_),q=a(154),Y=a.n(q),$=a(56),J=a.n($),K=a(97),X=(a(308),"https://www.googleapis.com/calendar/v3"),Q=Object.freeze({invalidSyncToken:Symbol("invalidSyncToken"),notLoggedIn:Symbol("notLoggedIn"),notLoggedOut:Symbol("notLoggedOut"),otherError:Symbol("otherError")});function Z(e){return Object.entries(e).filter(function(e){var t=Object(K.a)(e,2);t[0];return t[1]}).map(function(e){var t=Object(K.a)(e,2),a=t[0],n=t[1];return"".concat(encodeURIComponent(a),"=").concat(encodeURIComponent(n))}).join("&")}var ee=null;function te(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return new Promise(function(t){return chrome.identity.getAuthToken({interactive:e},function(e){return t([e,!chrome.runtime.lastError])})}).then(function(e){var t=Object(K.a)(e,2),a=t[0];if(t[1])return a;throw Q.notLoggedIn})}function ae(){return null===ee?te(!1).then(function(){return ee=!0}).catch(function(){return ee=!1}).then(function(){return ee}):Promise.resolve(ee)}function ne(){return ae().then(function(e){if(e)return te(!1);throw Q.notLoggedIn})}function re(){return ne().then(function(e){return fetch("https://accounts.google.com/o/oauth2/revoke?".concat(Z({token:e})),{method:"GET",async:!0}).then(function(t){if(200===t.status)return function(e){return new Promise(function(t){return chrome.identity.removeCachedAuthToken({token:e},function(){return t()})})}(e);throw Q.otherError})}).then(function(){return ee=!1})}function se(e){return fetch("".concat(X,"/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 le(e){return fetch("".concat(X,"/colors?").concat(Z({access_token:e})),{method:"GET",async:!0}).then(function(e){return e.json()})}var oe="updatePatterns",ie="getPatterns",ce="updateCalendars",ue="getCalendars",de="getCalEvents",me=Object.freeze({updatePatterns:Symbol(oe),getPatterns:Symbol(ie),updateCalendars:Symbol(ce),getCalendars:Symbol(ue),getCalEvents:Symbol(de)});function he(e){switch(e){case me.updatePatterns:return oe;case me.getPatterns:return ie;case me.updateCalendars:return ce;case me.getCalendars:return ue;case me.getCalEvents:return de;default:console.error("unreachable")}}var pe=function(){function e(t,a,n){Object(o.a)(this,e),this.id=t,this.type=a,this.data=n}return Object(i.a)(e,[{key:"genResp",value:function(t){return new e(this.id,this.type,t)}},{key:"deflate",value:function(){return{id:this.id,type:he(this.type),data:this.data}}}]),e}();pe.inflate=function(e){return new pe(e.id,function(e){switch(e){case oe:return me.updatePatterns;case ie:return me.getPatterns;case ce:return me.updateCalendars;case ue:return me.getCalendars;case de:return me.getCalEvents;default:console.error("unreachable")}}(e.type),e.data)};var ge=function e(t){var a=this;Object(o.a)(this,e),this.sendMsg=function(e){var t,n,r=e.type,s=e.data,l=a.requestCallback,o=new Promise(function(e){t=e});return n=l.ids.length>0?l.ids.pop():l.maxId++,l.inFlight[n]=t,a.port.postMessage(new pe(n,r,s).deflate()),o};var n=chrome.runtime.connect({name:t});n.onMessage.addListener(function(e){console.log(e);var t=(e.type,a.requestCallback),n=t.inFlight[e.id];console.assert(void 0!==n),t.ids.push(e.id),n(e)}),this.port=n,this.requestCallback={inFlight:{},ids:[],maxId:0}},fe=function(){function e(t,a,n,r){Object(o.a)(this,e),this.id=t,this.isRegex=a,this.value=n,this.label=r}return Object(i.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}();fe.emptyPattern=function(){return new fe(0,!0,"",null)},fe.anyPattern=function(){return new fe("any",!0,".*","Any")},fe.revive=function(e){return new fe(e.id,e.isRegex,e.value,e.label)};var ve=function e(t,a,n,r){Object(o.a)(this,e),this.name=t,this.idx=a,this.cal=n,this.event=r};ve.defaultPatternEntry=function(e){return new ve("",e,fe.emptyPattern(),fe.anyPattern())},ve.revive=function(e){return new ve(e.name,e.idx,fe.revive(e.cal),fe.revive(e.event))};var ye=a(320),be=a.n(ye),Ee=a(721),Ce=a(715),Oe=a(714),Pe=a(598);function we(e){var t=e.cx,a=e.cy,n=e.x,s=e.y,l=e.fill,o=e.name,i="middle",c=0,u=0;return nt+2&&(c=5,i="start"),sa+2&&(u=10),r.a.createElement("text",{x:n,y:s,dx:c,dy:u,fill:l,textAnchor:i},"".concat(o))}var ke=Object(m.withStyles)(function(e){return{pieChart:{margin:"0 auto"}}})(function(e){return r.a.createElement(U.a,{container:!0,spacing:0},r.a.createElement(U.a,{item:!0,xs:12,lg:6},r.a.createElement("div",{className:e.classes.patternTableWrapper},r.a.createElement(Ee.a,{width:400,height:250,className:e.classes.pieChart},r.a.createElement(Ce.a,{data:e.patternGraphData,dataKey:"value",cx:200,cy:125,outerRadius:60,fill:be.a[300],label:we}),r.a.createElement(Oe.a,{formatter:function(e){return"".concat(e.toFixed(2)," hr")}})))),r.a.createElement(U.a,{item:!0,xs:12,lg:6},r.a.createElement("div",{className:e.classes.patternTableWrapper},r.a.createElement(Ee.a,{width:400,height:250,className:e.classes.pieChart},r.a.createElement(Ce.a,{data:e.calendarGraphData,dataKey:"value",cx:200,cy:125,innerRadius:40,outerRadius:70,fill:z.a[300],label:we},e.calendarGraphData.map(function(e,t){return r.a.createElement(Pe.a,{key:t,fill:e.color})})),r.a.createElement(Oe.a,{formatter:function(e){return"".concat(e.toFixed(2)," hr")}})))))}),Se=a(151),xe=a.n(Se),je=a(152),De=a.n(je),Re=a(153),Be=a.n(Re),Me=a(65),Ne=a.n(Me),Le=a(75),Ie=a.n(Le),Te=a(193),ze=a.n(Te),Ae=a(322),Ge=a.n(Ae),We=a(321),Fe=a.n(We),He=a(145),Ve=a.n(He),_e=a(190),Ue=a.n(_e),qe=function(e){function t(){return Object(o.a)(this,t),Object(c.a)(this,Object(u.a)(t).apply(this,arguments))}return Object(d.a)(t,e),Object(i.a)(t,[{key:"render",value:function(){var e=this,t=this.props.classes,a=[],n=this.props.options,s=new fe.emptyPattern;for(var l in n[s.id]=s,n){var o=n[l].isEmpty?r.a.createElement("span",{style:{color:this.props.theme.palette.primary.dark}},"Custom"):n[l].label;a.push(r.a.createElement(Ue.a,{key:l,value:l},o))}var i=this.props.value.isRegex?t.fieldRegex:t.fieldNoRegex;return r.a.createElement(F.a,null,r.a.createElement("span",null,r.a.createElement(Ve.a,{value:this.props.value.id,onChange:function(t){var a;a=null==n[t.target.value].label?new fe(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:i},a),null==this.props.value.label&&r.a.createElement(xe.a,{value:this.props.value.value,onChange:function(t){return e.props.onChange({target:{value:new fe(0,!0,t.target.value,null)}})}})))}}]),t}(r.a.Component),Ye=Object(m.withStyles)(function(e){return{fieldNoRegex:{width:200},fieldRegex:{marginRight:"0.5em"}}})(qe);var $e=[{label:"Name",field:"name",elem:xe.a},{label:"Calendar",field:"cal",elem:Object(m.withTheme)(N)(function(e){var t={};for(var a in e.calendars)t[a]=new fe(a,!1,e.calendars[a].name,e.calendars[a].name);return r.a.createElement(Ye,{value:e.value,options:t,onChange:e.onChange,theme:e.theme})})},{label:"Event",field:"event",elem:Object(m.withTheme)(N)(function(e){var t=fe.anyPattern(),a={};return a[t.id]=t,r.a.createElement(Ye,{value:e.value,options:a,onChange:e.onChange,theme:e.theme})})}],Je=function(e){function t(){var e,a;Object(o.a)(this,t);for(var n=arguments.length,r=new Array(n),s=0;s0&&r.a.createElement(Ne.a,{style:{height:48*c}},r.a.createElement(Ie.a,{colSpan:$e.length}))))),r.a.createElement(Ge.a,{rowsPerPageOptions:[5,10,25],component:"div",count:s.length,rowsPerPage:o,page:i,backIconButtonProps:{"aria-label":"Previous Page"},nextIconButtonProps:{"aria-label":"Next Page"},onChangePage:this.handleChangePage,onChangeRowsPerPage:this.handleChangeRowsPerPage}))}}]),t}(r.a.Component),Ke=Object(m.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}}})(Je),Xe=a(339),Qe=a(5),Ze=a.n(Qe),et=a(325),tt=a.n(et),at=a(326),nt=a.n(at),rt=a(196),st=a.n(rt),lt=a(323),ot=a.n(lt),it=a(324),ct=a.n(it),ut=a(327),dt=a.n(ut),mt={error:ot.a,warning:ct.a};var ht=Object(m.withStyles)(function(e){return{error:{backgroundColor:e.palette.error.dark},warning:{backgroundColor:tt.a[700]},icon:{fontSize:20},iconVariant:{opacity:.9,marginRight:e.spacing.unit},message:{display:"flex",alignItems:"center"}}})(function(e){var t=e.classes,a=e.className,n=e.message,s=e.variant,l=e.open,o=e.onClose,i=Object(Xe.a)(e,["classes","className","message","variant","open","onClose"]),c=mt[s];return r.a.createElement(nt.a,{anchorOrigin:{vertical:"top",horizontal:"center"},open:l,autoHideDuration:1e4,onClose:o},r.a.createElement(st.a,Object.assign({className:Ze()(t[s],a),"aria-describedby":"snackbar-content",message:r.a.createElement("span",{id:"snackbar-content",className:t.message},r.a.createElement(c,{className:Ze()(t.icon,t.iconVariant)}),n),action:[r.a.createElement(J.a,{key:"close","aria-label":"Close",color:"inherit",className:t.close,onClick:o},r.a.createElement(dt.a,{className:t.icon}))]},i)))}),pt=a(328),gt=a.n(pt),ft=a(332),vt=a.n(ft),yt=a(330),bt=a.n(yt),Et=a(331),Ct=a.n(Et),Ot=a(329),Pt=a.n(Ot),wt=a(195),kt=a.n(wt);function St(e){return r.a.createElement(kt.a,Object.assign({direction:"up"},e))}var xt=function(e){return r.a.createElement(gt.a,{open:e.open,TransitionComponent:St,keepMounted:!0,onClose:function(){return e.handleClose(!1)},"aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description"},r.a.createElement(Pt.a,{id:"alert-dialog-slide-title"},e.title),r.a.createElement(bt.a,null,r.a.createElement(Ct.a,{id:"alert-dialog-slide-description"},e.message)),r.a.createElement(vt.a,null,r.a.createElement(G.a,{onClick:function(){return e.handleClose(!1)},color:"primary"},"No"),r.a.createElement(G.a,{onClick:function(){return e.handleClose(!0)},color:"primary"},"Yes")))},jt=[{name:"Work",value:10,color:z.a[300]},{name:"Wasted",value:10,color:z.a[300]}];var Dt=function(e){function t(e){var a;return Object(o.a)(this,t),(a=Object(c.a)(this,Object(u.a)(t).call(this,e))).state={patterns:[],calendars:{},startDate:null,endDate:null,patternGraphData:jt,calendarGraphData:jt,snackBarOpen:!1,snackBarMsg:"unknown",snackBarVariant:"error",dialogOpen:!1,dialogMsg:{title:"",message:""}},a.updatePattern=function(e,t,n){var r=a.state.patterns;r[t][e]=n,a.msgClient.sendMsg({type:me.updatePatterns,data:{id:"analyze",patterns:r}}).then(function(){return a.setState({patterns:r})})},a.removePattern=function(e){var t=a.state.patterns;t.splice(e,1);for(var n=0;n0&&n.push(a.getCalEvents(s,e,t).then(function(e){return{id:s,events:e,patterns:l}}))};for(var l in r)s(l);Promise.all(n).then(function(e){console.log(e);var t={},n={},s={},l={};e.forEach(function(e){t[e.id]=e.events,n[e.id]=e.patterns});for(var o=0;o