From c456544d21a74b53008afb13dd3995adecfc4dc9 Mon Sep 17 00:00:00 2001 From: Zane Meyers Date: Tue, 17 Feb 2026 17:04:56 -0500 Subject: [PATCH] vault backup: 2026-02-17 17:04:56 --- .obsidian/community-plugins.json | 1 - .obsidian/plugins/obsidian-linter/data.json | 2 +- .obsidian/plugins/obsidian-pandoc-plus | 1 + .obsidian/plugins/obsidian-tracker/main.js | 4 - .../plugins/obsidian-tracker/manifest.json | 10 - .obsidian/plugins/obsidian-tracker/styles.css | 182 ------------------ .obsidian/types.json | 3 +- 2025-11-05.md | 2 + 2025-11-10.md | 4 +- 2025-11-13.md | 4 +- 2025-11-18.md | 4 +- 2025-11-21.md | 28 +-- 2025-11-21_10-11-00.md | 36 ++++ 2026-01-22.md | 12 +- 2026-01-25.md | 2 + 2026-01-27.md | 2 + 2026-01-28.md | 14 +- 2026-01-29.md | 2 +- 2026-01-30.md | 4 +- 2026-01-31.md | 39 ---- 2026-01-31_12-48-00.md | 35 ++++ 2026-01-31_17-49-00.md | 27 +++ 2026-02-02_06-50-00.md | 1 + 2026-02-02_12-18-00.md | 1 + 2026-02-03_08-34-00.md | 1 + 2026-02-03_15-04-00.md | 1 + 2026-02-03_16-17-00.md | 1 + 2026-02-04_08-07-00.md | 1 + 2026-02-04_09-00-00.md | 15 +- 2026-02-04_13-42-00.md | 1 + 2026-02-04_17-02-00.md | 5 +- 2026-02-04_18-05-00.md | 1 + 2026-02-05_10-14-01.md | 3 +- 2026-02-05_12-14-47.md | 3 +- 2026-02-07_09-16-31.md | 3 +- 2026-02-08_08-00-49.md | 3 +- 2026-02-10_07-46-30.md | 23 --- 2026-02-11_12-12-16.md | 2 +- 2026-02-12_09-49-56.md | 7 +- 2026-02-17_13-13-06.md | 24 +++ 2026-02-17_16-47-46.md | 44 +++++ README.md | 3 +- distributed-antenna-systems-takeoff.md | 3 + earned-value-management.md | 24 +++ favorite-quotes.md | 14 +- templates/timestamped.md | 6 +- units-takeoff.md | 69 ++++--- 47 files changed, 320 insertions(+), 357 deletions(-) create mode 160000 .obsidian/plugins/obsidian-pandoc-plus delete mode 100644 .obsidian/plugins/obsidian-tracker/main.js delete mode 100644 .obsidian/plugins/obsidian-tracker/manifest.json delete mode 100644 .obsidian/plugins/obsidian-tracker/styles.css create mode 100644 2025-11-21_10-11-00.md create mode 100644 2026-01-31_12-48-00.md create mode 100644 2026-01-31_17-49-00.md delete mode 100644 2026-02-10_07-46-30.md create mode 100644 2026-02-17_13-13-06.md create mode 100644 2026-02-17_16-47-46.md create mode 100644 earned-value-management.md diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index adce6f0..71ed2b0 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -24,6 +24,5 @@ "obsidian-tasks-plugin", "digitalgarden", "pdf-plus", - "obsidian-tracker", "copy-document-as-html" ] \ No newline at end of file diff --git a/.obsidian/plugins/obsidian-linter/data.json b/.obsidian/plugins/obsidian-linter/data.json index 9e31ecd..8b40b52 100644 --- a/.obsidian/plugins/obsidian-linter/data.json +++ b/.obsidian/plugins/obsidian-linter/data.json @@ -53,7 +53,7 @@ }, "yaml-key-sort": { "enabled": true, - "yaml-key-priority-sort-order": "id\naliases\ntitle\ntags", + "yaml-key-priority-sort-order": "id\naliases\ntitle\ntags\ndg-publish\ndaily\nweekly\nmonthly\nquarterly\nyearly", "priority-keys-at-start-of-yaml": true, "yaml-sort-order-for-other-keys": "Ascending Alphabetical" }, diff --git a/.obsidian/plugins/obsidian-pandoc-plus b/.obsidian/plugins/obsidian-pandoc-plus new file mode 160000 index 0000000..89d0fdb --- /dev/null +++ b/.obsidian/plugins/obsidian-pandoc-plus @@ -0,0 +1 @@ +Subproject commit 89d0fdbcf0e99f31e741b9556e758360304bf74a diff --git a/.obsidian/plugins/obsidian-tracker/main.js b/.obsidian/plugins/obsidian-tracker/main.js deleted file mode 100644 index 8134297..0000000 --- a/.obsidian/plugins/obsidian-tracker/main.js +++ /dev/null @@ -1,4 +0,0 @@ -"use strict";var t=require("obsidian");function e(t,e){return null==t||null==e?NaN:te?1:t>=e?0:NaN}function n(t,e){return null==t||null==e?NaN:et?1:e>=t?0:NaN}function r(t){let r,a,l;function o(t,e,n=0,i=t.length){if(n>>1;a(t[r],e)<0?n=r+1:i=r}while(ne(t(n),r),l=(e,n)=>t(e)-n):(r=t===e||t===n?t:i,a=t,l=t),{left:o,center:function(t,e,n=0,r=t.length){const i=o(t,e,n,r-1);return i>n&&l(t[i-1],e)>-l(t[i],e)?i-1:i},right:function(t,e,n=0,i=t.length){if(n>>1;a(t[r],e)<=0?n=r+1:i=r}while(n=t))-(null==e||!(e>=e))||(te?1:0)}const c=Math.sqrt(50),h=Math.sqrt(10),f=Math.sqrt(2);function d(t,e,n){const r=(e-t)/Math.max(0,n),i=Math.floor(Math.log10(r)),a=r/Math.pow(10,i),l=a>=c?10:a>=h?5:a>=f?2:1;let o,s,u;return i<0?(u=Math.pow(10,-i)/l,o=Math.round(t*u),s=Math.round(e*u),o/ue&&--s,u=-u):(u=Math.pow(10,i)*l,o=Math.round(t/u),s=Math.round(e/u),o*ue&&--s),s=e)&&(n=e);return n}function m(t,e){let n;for(const e of t)null!=e&&(n>e||void 0===n&&e>=e)&&(n=e);return n}function v(t,n,r=0,i=1/0,a){if(n=Math.floor(n),r=Math.floor(Math.max(0,r)),i=Math.floor(Math.min(t.length-1,i)),!(r<=n&&n<=i))return t;for(a=void 0===a?u:function(t=e){if(t===e)return u;if("function"!=typeof t)throw new TypeError("compare is not a function");return(e,n)=>{const r=t(e,n);return r||0===r?r:(0===t(n,n))-(0===t(e,e))}}(a);i>r;){if(i-r>600){const e=i-r+1,l=n-r+1,o=Math.log(e),s=.5*Math.exp(2*o/3),u=.5*Math.sqrt(o*s*(e-s)/e)*(l-e/2<0?-1:1);v(t,n,Math.max(r,Math.floor(n-l*s/e+u)),Math.min(i,Math.floor(n+(e-l)*s/e+u)),a)}const e=t[n];let l=r,o=i;for(x(t,r,n),a(t[i],e)>0&&x(t,r,i);l0;)--o}0===a(t[r],e)?x(t,r,o):(++o,x(t,o,i)),o<=n&&(r=o+1),n<=o&&(i=o-1)}return t}function x(t,e,n){const r=t[e];t[e]=t[n],t[n]=r}function A(t,e){return function(t,e){if((n=(t=Float64Array.from(function*(t){for(let e of t)null!=e&&(e=+e)>=e&&(yield e)}(t))).length)&&!isNaN(e=+e)){if(e<=0||n<2)return m(t);if(e>=1)return y(t);var n,r=(n-1)*e,i=Math.floor(r),a=y(v(t,i).subarray(0,i+1));return a+(m(t.subarray(i+1))-a)*(r-i)}}(t,.5)}function w(t,e,n){t=+t,e=+e,n=(i=arguments.length)<2?(e=t,t=0,1):i<3?1:+n;for(var r=-1,i=0|Math.max(0,Math.ceil((e-t)/n)),a=new Array(i);++r+t(e)}function _(t,e){return e=Math.max(0,t.bandwidth()-2*e)/2,t.round()&&(e=Math.round(e)),n=>+t(n)+e}function E(){return!this.__axis}function F(t,e){var n=[],r=null,i=null,a=6,l=6,o=3,s="undefined"!=typeof window&&window.devicePixelRatio>1?0:.5,u=1===t||4===t?-1:1,c=4===t||2===t?"x":"y",h=1===t||3===t?C:T;function f(f){var d=null==r?e.ticks?e.ticks.apply(e,n):e.domain():r,g=null==i?e.tickFormat?e.tickFormat.apply(e,n):D:i,p=Math.max(a,0)+o,y=e.range(),m=+y[0]+s,v=+y[y.length-1]+s,x=(e.bandwidth?_:M)(e.copy(),s),A=f.selection?f.selection():f,w=A.selectAll(".domain").data([null]),b=A.selectAll(".tick").data(d,e).order(),C=b.exit(),T=b.enter().append("g").attr("class","tick"),F=b.select("line"),S=b.select("text");w=w.merge(w.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),b=b.merge(T),F=F.merge(T.append("line").attr("stroke","currentColor").attr(c+"2",u*a)),S=S.merge(T.append("text").attr("fill","currentColor").attr(c,u*p).attr("dy",1===t?"0em":3===t?"0.71em":"0.32em")),f!==A&&(w=w.transition(f),b=b.transition(f),F=F.transition(f),S=S.transition(f),C=C.transition(f).attr("opacity",k).attr("transform",(function(t){return isFinite(t=x(t))?h(t+s):this.getAttribute("transform")})),T.attr("opacity",k).attr("transform",(function(t){var e=this.parentNode.__axis;return h((e&&isFinite(e=e(t))?e:x(t))+s)}))),C.remove(),w.attr("d",4===t||2===t?l?"M"+u*l+","+m+"H"+s+"V"+v+"H"+u*l:"M"+s+","+m+"V"+v:l?"M"+m+","+u*l+"V"+s+"H"+v+"V"+u*l:"M"+m+","+s+"H"+v),b.attr("opacity",1).attr("transform",(function(t){return h(x(t)+s)})),F.attr(c+"2",u*a),S.attr(c,u*p).text(g),A.filter(E).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",2===t?"start":4===t?"end":"middle"),A.each((function(){this.__axis=x}))}return f.scale=function(t){return arguments.length?(e=t,f):e},f.ticks=function(){return n=Array.from(arguments),f},f.tickArguments=function(t){return arguments.length?(n=null==t?[]:Array.from(t),f):n.slice()},f.tickValues=function(t){return arguments.length?(r=null==t?null:Array.from(t),f):r&&r.slice()},f.tickFormat=function(t){return arguments.length?(i=t,f):i},f.tickSize=function(t){return arguments.length?(a=l=+t,f):a},f.tickSizeInner=function(t){return arguments.length?(a=+t,f):a},f.tickSizeOuter=function(t){return arguments.length?(l=+t,f):l},f.tickPadding=function(t){return arguments.length?(o=+t,f):o},f.offset=function(t){return arguments.length?(s=+t,f):s},f}function S(t){return F(3,t)}function B(t){return F(4,t)}var N={value:()=>{}};function L(){for(var t,e=0,n=arguments.length,r={};e=0&&(e=t.slice(n+1),t=t.slice(0,n)),t&&!r.hasOwnProperty(t))throw new Error("unknown type: "+t);return{type:t,name:e}}))),l=-1,o=a.length;if(!(arguments.length<2)){if(null!=e&&"function"!=typeof e)throw new Error("invalid callback: "+e);for(;++l0)for(var n,r,i=new Array(n),a=0;a=0&&"xmlns"!==(e=t.slice(0,n))&&(t=t.slice(n+1)),$.hasOwnProperty(e)?{space:$[e],local:t}:t}function R(t){return function(){var e=this.ownerDocument,n=this.namespaceURI;return n===P&&e.documentElement.namespaceURI===P?e.createElement(t):e.createElementNS(n,t)}}function z(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function U(t){var e=Y(t);return(e.local?z:R)(e)}function H(){}function X(t){return null==t?H:function(){return this.querySelector(t)}}function W(){return[]}function j(t){return null==t?W:function(){return this.querySelectorAll(t)}}function q(t){return function(){return function(t){return null==t?[]:Array.isArray(t)?t:Array.from(t)}(t.apply(this,arguments))}}function G(t){return function(){return this.matches(t)}}function Q(t){return function(e){return e.matches(t)}}var Z=Array.prototype.find;function K(){return this.firstElementChild}var J=Array.prototype.filter;function tt(){return Array.from(this.children)}function et(t){return new Array(t.length)}function nt(t,e){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=e}function rt(t,e,n,r,i,a){for(var l,o=0,s=e.length,u=a.length;oe?1:t>=e?0:NaN}function st(t){return function(){this.removeAttribute(t)}}function ut(t){return function(){this.removeAttributeNS(t.space,t.local)}}function ct(t,e){return function(){this.setAttribute(t,e)}}function ht(t,e){return function(){this.setAttributeNS(t.space,t.local,e)}}function ft(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttribute(t):this.setAttribute(t,n)}}function dt(t,e){return function(){var n=e.apply(this,arguments);null==n?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,n)}}function gt(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function pt(t){return function(){this.style.removeProperty(t)}}function yt(t,e,n){return function(){this.style.setProperty(t,e,n)}}function mt(t,e,n){return function(){var r=e.apply(this,arguments);null==r?this.style.removeProperty(t):this.style.setProperty(t,r,n)}}function vt(t,e){return t.style.getPropertyValue(e)||gt(t).getComputedStyle(t,null).getPropertyValue(e)}function xt(t){return function(){delete this[t]}}function At(t,e){return function(){this[t]=e}}function wt(t,e){return function(){var n=e.apply(this,arguments);null==n?delete this[t]:this[t]=n}}function bt(t){return t.trim().split(/^|\s+/)}function Dt(t){return t.classList||new kt(t)}function kt(t){this._node=t,this._names=bt(t.getAttribute("class")||"")}function Ct(t,e){for(var n=Dt(t),r=-1,i=e.length;++r=0&&(this._names.splice(e,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};var jt=[null];function qt(t,e){this._groups=t,this._parents=e}function Gt(){return new qt([[document.documentElement]],jt)}function Qt(t){return"string"==typeof t?new qt([[document.querySelector(t)]],[document.documentElement]):new qt([[t]],jt)}function Zt(t,e,n){t.prototype=e.prototype=n,n.constructor=t}function Kt(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function Jt(){}qt.prototype=Gt.prototype={constructor:qt,select:function(t){"function"!=typeof t&&(t=X(t));for(var e=this._groups,n=e.length,r=new Array(n),i=0;i=A&&(A=x+1);!(v=y[A])&&++A=0;)(r=i[a])&&(l&&4^r.compareDocumentPosition(l)&&l.parentNode.insertBefore(r,l),l=r);return this},sort:function(t){function e(e,n){return e&&n?t(e.__data__,n.__data__):!e-!n}t||(t=ot);for(var n=this._groups,r=n.length,i=new Array(r),a=0;a1?this.each((null==e?pt:"function"==typeof e?mt:yt)(t,e,null==n?"":n)):vt(this.node(),t)},property:function(t,e){return arguments.length>1?this.each((null==e?xt:"function"==typeof e?wt:At)(t,e)):this.node()[t]},classed:function(t,e){var n=bt(t+"");if(arguments.length<2){for(var r=Dt(this.node()),i=-1,a=n.length;++i=0&&(e=t.slice(n+1),t=t.slice(0,n)),{type:t,name:e}}))}(t+""),l=a.length;if(!(arguments.length<2)){for(o=e?Ut:zt,r=0;r>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?me(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?me(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=le.exec(t))?new Ae(e[1],e[2],e[3],1):(e=oe.exec(t))?new Ae(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=se.exec(t))?me(e[1],e[2],e[3],e[4]):(e=ue.exec(t))?me(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=ce.exec(t))?Te(e[1],e[2]/100,e[3]/100,1):(e=he.exec(t))?Te(e[1],e[2]/100,e[3]/100,e[4]):fe.hasOwnProperty(t)?ye(fe[t]):"transparent"===t?new Ae(NaN,NaN,NaN,0):null}function ye(t){return new Ae(t>>16&255,t>>8&255,255&t,1)}function me(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ae(t,e,n,r)}function ve(t){return t instanceof Jt||(t=pe(t)),t?new Ae((t=t.rgb()).r,t.g,t.b,t.opacity):new Ae}function xe(t,e,n,r){return 1===arguments.length?ve(t):new Ae(t,e,n,null==r?1:r)}function Ae(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function we(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}`}function be(){const t=De(this.opacity);return`${1===t?"rgb(":"rgba("}${ke(this.r)}, ${ke(this.g)}, ${ke(this.b)}${1===t?")":`, ${t})`}`}function De(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ke(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function Ce(t){return((t=ke(t))<16?"0":"")+t.toString(16)}function Te(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new _e(t,e,n,r)}function Me(t){if(t instanceof _e)return new _e(t.h,t.s,t.l,t.opacity);if(t instanceof Jt||(t=pe(t)),!t)return new _e;if(t instanceof _e)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),a=Math.max(e,n,r),l=NaN,o=a-i,s=(a+i)/2;return o?(l=e===a?(n-r)/o+6*(n0&&s<1?0:l,new _e(l,o,s,t.opacity)}function _e(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Ee(t){return(t=(t||0)%360)<0?t+360:t}function Fe(t){return Math.max(0,Math.min(1,t||0))}function Se(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}Zt(Jt,pe,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:de,formatHex:de,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Me(this).formatHsl()},formatRgb:ge,toString:ge}),Zt(Ae,xe,Kt(Jt,{brighter(t){return t=null==t?ee:Math.pow(ee,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=null==t?te:Math.pow(te,t),new Ae(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new Ae(ke(this.r),ke(this.g),ke(this.b),De(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:we,formatHex:we,formatHex8:function(){return`#${Ce(this.r)}${Ce(this.g)}${Ce(this.b)}${Ce(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:be,toString:be})),Zt(_e,(function(t,e,n,r){return 1===arguments.length?Me(t):new _e(t,e,n,null==r?1:r)}),Kt(Jt,{brighter(t){return t=null==t?ee:Math.pow(ee,t),new _e(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=null==t?te:Math.pow(te,t),new _e(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ae(Se(t>=240?t-240:t+120,i,r),Se(t,i,r),Se(t<120?t+240:t-120,i,r),this.opacity)},clamp(){return new _e(Ee(this.h),Fe(this.s),Fe(this.l),De(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=De(this.opacity);return`${1===t?"hsl(":"hsla("}${Ee(this.h)}, ${100*Fe(this.s)}%, ${100*Fe(this.l)}%${1===t?")":`, ${t})`}`}}));const Be=Math.PI/180,Ne=180/Math.PI,Le=.96422,Ie=.82521,Ve=4/29,Oe=6/29,Pe=3*Oe*Oe,$e=Oe*Oe*Oe;function Ye(t){if(t instanceof ze)return new ze(t.l,t.a,t.b,t.opacity);if(t instanceof je)return qe(t);t instanceof Ae||(t=ve(t));var e,n,r=We(t.r),i=We(t.g),a=We(t.b),l=Ue((.2225045*r+.7168786*i+.0606169*a)/1);return r===i&&i===a?e=n=l:(e=Ue((.4360747*r+.3850649*i+.1430804*a)/Le),n=Ue((.0139322*r+.0971045*i+.7141733*a)/Ie)),new ze(116*l-16,500*(e-l),200*(l-n),t.opacity)}function Re(t,e,n,r){return 1===arguments.length?Ye(t):new ze(t,e,n,null==r?1:r)}function ze(t,e,n,r){this.l=+t,this.a=+e,this.b=+n,this.opacity=+r}function Ue(t){return t>$e?Math.pow(t,1/3):t/Pe+Ve}function He(t){return t>Oe?t*t*t:Pe*(t-Ve)}function Xe(t){return 255*(t<=.0031308?12.92*t:1.055*Math.pow(t,1/2.4)-.055)}function We(t){return(t/=255)<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function je(t,e,n,r){this.h=+t,this.c=+e,this.l=+n,this.opacity=+r}function qe(t){if(isNaN(t.h))return new ze(t.l,0,0,t.opacity);var e=t.h*Be;return new ze(t.l,Math.cos(e)*t.c,Math.sin(e)*t.c,t.opacity)}Zt(ze,Re,Kt(Jt,{brighter(t){return new ze(this.l+18*(null==t?1:t),this.a,this.b,this.opacity)},darker(t){return new ze(this.l-18*(null==t?1:t),this.a,this.b,this.opacity)},rgb(){var t=(this.l+16)/116,e=isNaN(this.a)?t:t+this.a/500,n=isNaN(this.b)?t:t-this.b/200;return new Ae(Xe(3.1338561*(e=Le*He(e))-1.6168667*(t=1*He(t))-.4906146*(n=Ie*He(n))),Xe(-.9787684*e+1.9161415*t+.033454*n),Xe(.0719453*e-.2289914*t+1.4052427*n),this.opacity)}})),Zt(je,(function(t,e,n,r){return 1===arguments.length?function(t){if(t instanceof je)return new je(t.h,t.c,t.l,t.opacity);if(t instanceof ze||(t=Ye(t)),0===t.a&&0===t.b)return new je(NaN,0()=>t;function Qe(t){return 1==(t=+t)?Ze:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Ge(isNaN(e)?n:e)}}function Ze(t,e){var n=e-t;return n?function(t,e){return function(n){return t+n*e}}(t,n):Ge(isNaN(t)?e:t)}var Ke=function t(e){var n=Qe(e);function r(t,e){var r=n((t=xe(t)).r,(e=xe(e)).r),i=n(t.g,e.g),a=n(t.b,e.b),l=Ze(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=a(e),t.opacity=l(e),t+""}}return r.gamma=t,r}(1);var Je,tn=(Je=function(t){var e=t.length-1;return function(n){var r=n<=0?n=0:n>=1?(n=1,e-1):Math.floor(n*e),i=t[r],a=t[r+1],l=r>0?t[r-1]:2*i-a,o=ra&&(i=e.slice(a,i),o[l]?o[l]+=i:o[++l]=i),(n=n[0])===(r=r[0])?o[l]?o[l]+=r:o[++l]=r:(o[++l]=null,s.push({i:l,x:an(n,r)})),a=sn.lastIndex;return a180?e+=360:e-t>180&&(t+=360),a.push({i:n.push(i(n)+"rotate(",null,r)-2,x:an(t,e)})):e&&n.push(i(n)+"rotate("+e+r)}(a.rotate,l.rotate,o,s),function(t,e,n,a){t!==e?a.push({i:n.push(i(n)+"skewX(",null,r)-2,x:an(t,e)}):e&&n.push(i(n)+"skewX("+e+r)}(a.skewX,l.skewX,o,s),function(t,e,n,r,a,l){if(t!==n||e!==r){var o=a.push(i(a)+"scale(",null,",",null,")");l.push({i:o-4,x:an(t,n)},{i:o-2,x:an(e,r)})}else 1===n&&1===r||a.push(i(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,l.scaleX,l.scaleY,o,s),a=l=null,function(t){for(var e,n=-1,r=s.length;++n=0&&e._call.call(void 0,t),e=e._next;--bn}()}finally{bn=0,function(){var t,e,n=An,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:An=e);wn=t,Vn(r)}(),Tn=0}}function In(){var t=_n.now(),e=t-Cn;e>1e3&&(Mn-=e,Cn=t)}function Vn(t){bn||(Dn&&(Dn=clearTimeout(Dn)),t-Tn>24?(t<1/0&&(Dn=setTimeout(Ln,t-_n.now()-Mn)),kn&&(kn=clearInterval(kn))):(kn||(Cn=_n.now(),kn=setInterval(In,1e3)),bn=1,En(Ln)))}function On(t,e,n){var r=new Bn;return e=null==e?0:+e,r.restart((n=>{r.stop(),t(n+e)}),e,n),r}Bn.prototype=Nn.prototype={constructor:Bn,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?Fn():+n)+(null==e?0:+e),this._next||wn===this||(wn?wn._next=this:An=this,wn=this),this._call=t,this._time=n,Vn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Vn())}};var Pn=L("start","end","cancel","interrupt"),$n=[];function Yn(t,e,n,r,i,a){var l=t.__transition;if(l){if(n in l)return}else t.__transition={};!function(t,e,n){var r,i=t.__transition;function a(t){n.state=1,n.timer.restart(l,n.delay,n.time),n.delay<=t&&l(t-n.delay)}function l(a){var u,c,h,f;if(1!==n.state)return s();for(u in i)if((f=i[u]).name===n.name){if(3===f.state)return On(l);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",t,t.__data__,f.index,f.group),delete i[u]):+u0)throw new Error("too late; already scheduled");return n}function zn(t,e){var n=Un(t,e);if(n.state>3)throw new Error("too late; already running");return n}function Un(t,e){var n=t.__transition;if(!n||!(n=n[e]))throw new Error("transition not found");return n}function Hn(t,e){var n,r;return function(){var i=zn(this,t),a=i.tween;if(a!==n)for(var l=0,o=(r=n=a).length;l=0&&(t=t.slice(0,e)),!t||"start"===t}))}(e)?Rn:zn;return function(){var l=a(this,t),o=l.on;o!==r&&(i=(r=o).copy()).on(e,n),l.on=i}}(n,t,e))},attr:function(t,e){var n=Y(t),r="transform"===n?vn:jn;return this.attrTween(t,"function"==typeof e?(n.local?Jn:Kn)(n,r,Wn(this,"attr."+t,e)):null==e?(n.local?Gn:qn)(n):(n.local?Zn:Qn)(n,r,e))},attrTween:function(t,e){var n="attr."+t;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==e)return this.tween(n,null);if("function"!=typeof e)throw new Error;var r=Y(t);return this.tween(n,(r.local?tr:er)(r,e))},style:function(t,e,n){var r="transform"==(t+="")?mn:jn;return null==e?this.styleTween(t,function(t,e){var n,r,i;return function(){var a=vt(this,t),l=(this.style.removeProperty(t),vt(this,t));return a===l?null:a===n&&l===r?i:i=e(n=a,r=l)}}(t,r)).on("end.style."+t,or(t)):"function"==typeof e?this.styleTween(t,function(t,e,n){var r,i,a;return function(){var l=vt(this,t),o=n(this),s=o+"";return null==o&&(this.style.removeProperty(t),s=o=vt(this,t)),l===s?null:l===r&&s===i?a:(i=s,a=e(r=l,o))}}(t,r,Wn(this,"style."+t,e))).each(function(t,e){var n,r,i,a,l="style."+e,o="end."+l;return function(){var s=zn(this,t),u=s.on,c=null==s.value[l]?a||(a=or(e)):void 0;u===n&&i===c||(r=(n=u).copy()).on(o,i=c),s.on=r}}(this._id,t)):this.styleTween(t,function(t,e,n){var r,i,a=n+"";return function(){var l=vt(this,t);return l===a?null:l===r?i:i=e(r=l,n)}}(t,r,e),n).on("end.style."+t,null)},styleTween:function(t,e,n){var r="style."+(t+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==e)return this.tween(r,null);if("function"!=typeof e)throw new Error;return this.tween(r,function(t,e,n){var r,i;function a(){var a=e.apply(this,arguments);return a!==i&&(r=(i=a)&&function(t,e,n){return function(r){this.style.setProperty(t,e.call(this,r),n)}}(t,a,n)),r}return a._value=e,a}(t,e,null==n?"":n))},text:function(t){return this.tween("text","function"==typeof t?function(t){return function(){var e=t(this);this.textContent=null==e?"":e}}(Wn(this,"text",t)):function(t){return function(){this.textContent=t}}(null==t?"":t+""))},textTween:function(t){var e="text";if(arguments.length<1)return(e=this.tween(e))&&e._value;if(null==t)return this.tween(e,null);if("function"!=typeof t)throw new Error;return this.tween(e,function(t){var e,n;function r(){var r=t.apply(this,arguments);return r!==n&&(e=(n=r)&&function(t){return function(e){this.textContent=t.call(this,e)}}(r)),e}return r._value=t,r}(t))},remove:function(){return this.on("end.remove",function(t){return function(){var e=this.parentNode;for(var n in this.__transition)if(+n!==t)return;e&&e.removeChild(this)}}(this._id))},tween:function(t,e){var n=this._id;if(t+="",arguments.length<2){for(var r,i=Un(this.node(),n).tween,a=0,l=i.length;a2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",t,t.__data__,n.index,n.group),delete a[i]):l=!1;l&&delete t.__transition}}(this,t)}))},Gt.prototype.transition=function(t){var e,n;t instanceof ur?(e=t._id,t=t._name):(e=cr(),(n=fr).time=Fn(),t=null==t?null:t+"");for(var r=this._groups,i=r.length,a=0;a=0))throw new Error(`invalid digits: ${t}`);if(e>15)return vr;const n=10**e;return function(t){this._+=t[0];for(let e=1,r=t.length;eyr)if(Math.abs(c*o-s*u)>yr&&i){let f=n-a,d=r-l,g=o*o+s*s,p=f*f+d*d,y=Math.sqrt(g),m=Math.sqrt(h),v=i*Math.tan((gr-Math.acos((g+h-p)/(2*y*m)))/2),x=v/m,A=v/y;Math.abs(x-1)>yr&&this._append`L${t+x*u},${e+x*c}`,this._append`A${i},${i},0,0,${+(c*f>u*d)},${this._x1=t+A*o},${this._y1=e+A*s}`}else this._append`L${this._x1=t},${this._y1=e}`;else;}arc(t,e,n,r,i,a){if(t=+t,e=+e,a=!!a,(n=+n)<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(r),o=n*Math.sin(r),s=t+l,u=e+o,c=1^a,h=a?r-i:i-r;null===this._x1?this._append`M${s},${u}`:(Math.abs(this._x1-s)>yr||Math.abs(this._y1-u)>yr)&&this._append`L${s},${u}`,n&&(h<0&&(h=h%pr+pr),h>mr?this._append`A${n},${n},0,1,${c},${t-l},${e-o}A${n},${n},0,1,${c},${this._x1=s},${this._y1=u}`:h>yr&&this._append`A${n},${n},0,${+(h>=gr)},${c},${this._x1=t+n*Math.cos(i)},${this._y1=e+n*Math.sin(i)}`)}rect(t,e,n,r){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+e}h${n=+n}v${+r}h${-n}Z`}toString(){return this._}}function Ar(t,e){if((n=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var n,r=t.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+t.slice(n+1)]}function wr(t){return(t=Ar(Math.abs(t)))?t[1]:NaN}var br,Dr=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function kr(t){if(!(e=Dr.exec(t)))throw new Error("invalid format: "+t);var e;return new Cr({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function Cr(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function Tr(t,e){var n=Ar(t,e);if(!n)return t+"";var r=n[0],i=n[1];return i<0?"0."+new Array(-i).join("0")+r:r.length>i+1?r.slice(0,i+1)+"."+r.slice(i+1):r+new Array(i-r.length+2).join("0")}kr.prototype=Cr.prototype,Cr.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};var Mr={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>Tr(100*t,e),r:Tr,s:function(t,e){var n=Ar(t,e);if(!n)return t+"";var r=n[0],i=n[1],a=i-(br=3*Math.max(-8,Math.min(8,Math.floor(i/3))))+1,l=r.length;return a===l?r:a>l?r+new Array(a-l+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+Ar(t,Math.max(0,e+a-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function _r(t){return t}var Er,Fr,Sr,Br=Array.prototype.map,Nr=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lr(t){var e,n,r=void 0===t.grouping||void 0===t.thousands?_r:(e=Br.call(t.grouping,Number),n=t.thousands+"",function(t,r){for(var i=t.length,a=[],l=0,o=e[0],s=0;i>0&&o>0&&(s+o+1>r&&(o=Math.max(1,r-s)),a.push(t.substring(i-=o,i+o)),!((s+=o+1)>r));)o=e[l=(l+1)%e.length];return a.reverse().join(n)}),i=void 0===t.currency?"":t.currency[0]+"",a=void 0===t.currency?"":t.currency[1]+"",l=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?_r:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(Br.call(t.numerals,String)),s=void 0===t.percent?"%":t.percent+"",u=void 0===t.minus?"−":t.minus+"",c=void 0===t.nan?"NaN":t.nan+"";function h(t){var e=(t=kr(t)).fill,n=t.align,h=t.sign,f=t.symbol,d=t.zero,g=t.width,p=t.comma,y=t.precision,m=t.trim,v=t.type;"n"===v?(p=!0,v="g"):Mr[v]||(void 0===y&&(y=12),m=!0,v="g"),(d||"0"===e&&"="===n)&&(d=!0,e="0",n="=");var x="$"===f?i:"#"===f&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",A="$"===f?a:/[%p]/.test(v)?s:"",w=Mr[v],b=/[defgprs%]/.test(v);function D(t){var i,a,s,f=x,D=A;if("c"===v)D=w(t)+D,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?c:w(Math.abs(t),y),m&&(t=function(t){t:for(var e,n=t.length,r=1,i=-1;r0&&(i=0)}return i>0?t.slice(0,i)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==h&&(k=!1),f=(k?"("===h?h:u:"-"===h||"("===h?"":h)+f,D=("s"===v?Nr[8+br/3]:"")+D+(k&&"("===h?")":""),b)for(i=-1,a=t.length;++i(s=t.charCodeAt(i))||s>57){D=(46===s?l+t.slice(i+1):t.slice(i))+D,t=t.slice(0,i);break}}p&&!d&&(t=r(t,1/0));var C=f.length+t.length+D.length,T=C>1)+f+t+D+T.slice(C);break;default:t=T+f+t+D}return o(t)}return y=void 0===y?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y)),D.toString=function(){return t+""},D}return{format:h,formatPrefix:function(t,e){var n=h(((t=kr(t)).type="f",t)),r=3*Math.max(-8,Math.min(8,Math.floor(wr(e)/3))),i=Math.pow(10,-r),a=Nr[8+r/3];return function(t){return n(i*t)+a}}}}function Ir(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t)}return this}Er=Lr({thousands:",",grouping:[3],currency:["$",""]}),Fr=Er.format,Sr=Er.formatPrefix;const Vr=Symbol("implicit");function Or(){var t=new l,e=[],n=[],r=Vr;function i(i){let a=t.get(i);if(void 0===a){if(r!==Vr)return r;t.set(i,a=e.push(i)-1)}return n[a%n.length]}return i.domain=function(n){if(!arguments.length)return e.slice();e=[],t=new l;for(const r of n)t.has(r)||t.set(r,e.push(r)-1);return i},i.range=function(t){return arguments.length?(n=Array.from(t),i):n.slice()},i.unknown=function(t){return arguments.length?(r=t,i):r},i.copy=function(){return Or(e,n).unknown(r)},Ir.apply(i,arguments),i}function Pr(t){return+t}var $r=[0,1];function Yr(t){return t}function Rr(t,e){return(e-=t=+t)?function(n){return(n-t)/e}:function(t){return function(){return t}}(isNaN(e)?NaN:.5)}function zr(t,e,n){var r=t[0],i=t[1],a=e[0],l=e[1];return ie&&(n=t,t=e,e=n),u=function(n){return Math.max(t,Math.min(e,n))}),r=s>2?Ur:zr,i=a=null,h}function h(e){return null==e||isNaN(e=+e)?n:(i||(i=r(l.map(t),o,s)))(t(u(e)))}return h.invert=function(n){return u(e((a||(a=r(o,l.map(t),an)))(n)))},h.domain=function(t){return arguments.length?(l=Array.from(t,Pr),c()):l.slice()},h.range=function(t){return arguments.length?(o=Array.from(t),c()):o.slice()},h.rangeRound=function(t){return o=Array.from(t),s=hn,c()},h.clamp=function(t){return arguments.length?(u=!!t||Yr,c()):u!==Yr},h.interpolate=function(t){return arguments.length?(s=t,c()):s},h.unknown=function(t){return arguments.length?(n=t,h):n},function(n,r){return t=n,e=r,c()}}function Wr(){return Xr()(Yr,Yr)}function jr(t,e,n,r){var i,a=p(t,e,n);switch((r=kr(null==r?",f":r)).type){case"s":var l=Math.max(Math.abs(t),Math.abs(e));return null!=r.precision||isNaN(i=function(t,e){return Math.max(0,3*Math.max(-8,Math.min(8,Math.floor(wr(e)/3)))-wr(Math.abs(t)))}(a,l))||(r.precision=i),Sr(r,l);case"":case"e":case"g":case"p":case"r":null!=r.precision||isNaN(i=function(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,wr(e)-wr(t))+1}(a,Math.max(Math.abs(t),Math.abs(e))))||(r.precision=i-("e"===r.type));break;case"f":case"%":null!=r.precision||isNaN(i=function(t){return Math.max(0,-wr(Math.abs(t)))}(a))||(r.precision=i-2*("%"===r.type))}return Fr(r)}function qr(t){var e=t.domain;return t.ticks=function(t){var n=e();return function(t,e,n){if(!((n=+n)>0))return[];if((t=+t)==(e=+e))return[t];const r=e=i))return[];const o=a-i+1,s=new Array(o);if(r)if(l<0)for(let t=0;t0;){if((i=g(s,u,n))===r)return a[l]=s,a[o]=u,e(a);if(i>0)s=Math.floor(s/i)*i,u=Math.ceil(u/i)*i;else{if(!(i<0))break;s=Math.ceil(s*i)/i,u=Math.floor(u*i)/i}r=i}return t},t}function Gr(){var t=Wr();return t.copy=function(){return Hr(t,Gr())},Ir.apply(t,arguments),qr(t)}const Qr=new Date,Zr=new Date;function Kr(t,e,n,r){function i(e){return t(e=0===arguments.length?new Date:new Date(+e)),e}return i.floor=e=>(t(e=new Date(+e)),e),i.ceil=n=>(t(n=new Date(n-1)),e(n,1),t(n),n),i.round=t=>{const e=i(t),n=i.ceil(t);return t-e(e(t=new Date(+t),null==n?1:Math.floor(n)),t),i.range=(n,r,a)=>{const l=[];if(n=i.ceil(n),a=null==a?1:Math.floor(a),!(n0))return l;let o;do{l.push(o=new Date(+n)),e(n,a),t(n)}while(oKr((e=>{if(e>=e)for(;t(e),!n(e);)e.setTime(e-1)}),((t,r)=>{if(t>=t)if(r<0)for(;++r<=0;)for(;e(t,-1),!n(t););else for(;--r>=0;)for(;e(t,1),!n(t););})),n&&(i.count=(e,r)=>(Qr.setTime(+e),Zr.setTime(+r),t(Qr),t(Zr),Math.floor(n(Qr,Zr))),i.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?i.filter(r?e=>r(e)%t==0:e=>i.count(0,e)%t==0):i:null)),i}const Jr=Kr((()=>{}),((t,e)=>{t.setTime(+t+e)}),((t,e)=>e-t));Jr.every=t=>(t=Math.floor(t),isFinite(t)&&t>0?t>1?Kr((e=>{e.setTime(Math.floor(e/t)*t)}),((e,n)=>{e.setTime(+e+n*t)}),((e,n)=>(n-e)/t)):Jr:null),Jr.range;const ti=1e3,ei=6e4,ni=36e5,ri=864e5,ii=6048e5,ai=2592e6,li=31536e6,oi=Kr((t=>{t.setTime(t-t.getMilliseconds())}),((t,e)=>{t.setTime(+t+e*ti)}),((t,e)=>(e-t)/ti),(t=>t.getUTCSeconds()));oi.range;const si=Kr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ti)}),((t,e)=>{t.setTime(+t+e*ei)}),((t,e)=>(e-t)/ei),(t=>t.getMinutes()));si.range;const ui=Kr((t=>{t.setUTCSeconds(0,0)}),((t,e)=>{t.setTime(+t+e*ei)}),((t,e)=>(e-t)/ei),(t=>t.getUTCMinutes()));ui.range;const ci=Kr((t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*ti-t.getMinutes()*ei)}),((t,e)=>{t.setTime(+t+e*ni)}),((t,e)=>(e-t)/ni),(t=>t.getHours()));ci.range;const hi=Kr((t=>{t.setUTCMinutes(0,0,0)}),((t,e)=>{t.setTime(+t+e*ni)}),((t,e)=>(e-t)/ni),(t=>t.getUTCHours()));hi.range;const fi=Kr((t=>t.setHours(0,0,0,0)),((t,e)=>t.setDate(t.getDate()+e)),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ei)/ri),(t=>t.getDate()-1));fi.range;const di=Kr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/ri),(t=>t.getUTCDate()-1));di.range;const gi=Kr((t=>{t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+e)}),((t,e)=>(e-t)/ri),(t=>Math.floor(t/ri)));function pi(t){return Kr((e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)}),((t,e)=>{t.setDate(t.getDate()+7*e)}),((t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*ei)/ii))}gi.range;const yi=pi(0),mi=pi(1),vi=pi(2),xi=pi(3),Ai=pi(4),wi=pi(5),bi=pi(6);function Di(t){return Kr((e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCDate(t.getUTCDate()+7*e)}),((t,e)=>(e-t)/ii))}yi.range,mi.range,vi.range,xi.range,Ai.range,wi.range,bi.range;const ki=Di(0),Ci=Di(1),Ti=Di(2),Mi=Di(3),_i=Di(4),Ei=Di(5),Fi=Di(6);ki.range,Ci.range,Ti.range,Mi.range,_i.range,Ei.range,Fi.range;const Si=Kr((t=>{t.setDate(1),t.setHours(0,0,0,0)}),((t,e)=>{t.setMonth(t.getMonth()+e)}),((t,e)=>e.getMonth()-t.getMonth()+12*(e.getFullYear()-t.getFullYear())),(t=>t.getMonth()));Si.range;const Bi=Kr((t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)}),((t,e)=>e.getUTCMonth()-t.getUTCMonth()+12*(e.getUTCFullYear()-t.getUTCFullYear())),(t=>t.getUTCMonth()));Bi.range;const Ni=Kr((t=>{t.setMonth(0,1),t.setHours(0,0,0,0)}),((t,e)=>{t.setFullYear(t.getFullYear()+e)}),((t,e)=>e.getFullYear()-t.getFullYear()),(t=>t.getFullYear()));Ni.every=t=>isFinite(t=Math.floor(t))&&t>0?Kr((e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)}),((e,n)=>{e.setFullYear(e.getFullYear()+n*t)})):null,Ni.range;const Li=Kr((t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)}),((t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)}),((t,e)=>e.getUTCFullYear()-t.getUTCFullYear()),(t=>t.getUTCFullYear()));Li.every=t=>isFinite(t=Math.floor(t))&&t>0?Kr((e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)}),((e,n)=>{e.setUTCFullYear(e.getUTCFullYear()+n*t)})):null,Li.range;const[Ii,Vi]=function(t,e,n,i,a,l){const o=[[oi,1,ti],[oi,5,5e3],[oi,15,15e3],[oi,30,3e4],[l,1,ei],[l,5,3e5],[l,15,9e5],[l,30,18e5],[a,1,ni],[a,3,108e5],[a,6,216e5],[a,12,432e5],[i,1,ri],[i,2,1728e5],[n,1,ii],[e,1,ai],[e,3,7776e6],[t,1,li]];function s(e,n,i){const a=Math.abs(n-e)/i,l=r((([,,t])=>t)).right(o,a);if(l===o.length)return t.every(p(e/li,n/li,i));if(0===l)return Jr.every(Math.max(p(e,n,i),1));const[s,u]=o[a/o[l-1][2][t.toLowerCase(),e])))}function Qi(t,e,n){var r=Ui.exec(e.slice(n,n+1));return r?(t.w=+r[0],n+r[0].length):-1}function Zi(t,e,n){var r=Ui.exec(e.slice(n,n+1));return r?(t.u=+r[0],n+r[0].length):-1}function Ki(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.U=+r[0],n+r[0].length):-1}function Ji(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.V=+r[0],n+r[0].length):-1}function ta(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.W=+r[0],n+r[0].length):-1}function ea(t,e,n){var r=Ui.exec(e.slice(n,n+4));return r?(t.y=+r[0],n+r[0].length):-1}function na(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function ra(t,e,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(n,n+6));return r?(t.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function ia(t,e,n){var r=Ui.exec(e.slice(n,n+1));return r?(t.q=3*r[0]-3,n+r[0].length):-1}function aa(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.m=r[0]-1,n+r[0].length):-1}function la(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.d=+r[0],n+r[0].length):-1}function oa(t,e,n){var r=Ui.exec(e.slice(n,n+3));return r?(t.m=0,t.d=+r[0],n+r[0].length):-1}function sa(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.H=+r[0],n+r[0].length):-1}function ua(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.M=+r[0],n+r[0].length):-1}function ca(t,e,n){var r=Ui.exec(e.slice(n,n+2));return r?(t.S=+r[0],n+r[0].length):-1}function ha(t,e,n){var r=Ui.exec(e.slice(n,n+3));return r?(t.L=+r[0],n+r[0].length):-1}function fa(t,e,n){var r=Ui.exec(e.slice(n,n+6));return r?(t.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function da(t,e,n){var r=Hi.exec(e.slice(n,n+1));return r?n+r[0].length:-1}function ga(t,e,n){var r=Ui.exec(e.slice(n));return r?(t.Q=+r[0],n+r[0].length):-1}function pa(t,e,n){var r=Ui.exec(e.slice(n));return r?(t.s=+r[0],n+r[0].length):-1}function ya(t,e){return Wi(t.getDate(),e,2)}function ma(t,e){return Wi(t.getHours(),e,2)}function va(t,e){return Wi(t.getHours()%12||12,e,2)}function xa(t,e){return Wi(1+fi.count(Ni(t),t),e,3)}function Aa(t,e){return Wi(t.getMilliseconds(),e,3)}function wa(t,e){return Aa(t,e)+"000"}function ba(t,e){return Wi(t.getMonth()+1,e,2)}function Da(t,e){return Wi(t.getMinutes(),e,2)}function ka(t,e){return Wi(t.getSeconds(),e,2)}function Ca(t){var e=t.getDay();return 0===e?7:e}function Ta(t,e){return Wi(yi.count(Ni(t)-1,t),e,2)}function Ma(t){var e=t.getDay();return e>=4||0===e?Ai(t):Ai.ceil(t)}function _a(t,e){return t=Ma(t),Wi(Ai.count(Ni(t),t)+(4===Ni(t).getDay()),e,2)}function Ea(t){return t.getDay()}function Fa(t,e){return Wi(mi.count(Ni(t)-1,t),e,2)}function Sa(t,e){return Wi(t.getFullYear()%100,e,2)}function Ba(t,e){return Wi((t=Ma(t)).getFullYear()%100,e,2)}function Na(t,e){return Wi(t.getFullYear()%1e4,e,4)}function La(t,e){var n=t.getDay();return Wi((t=n>=4||0===n?Ai(t):Ai.ceil(t)).getFullYear()%1e4,e,4)}function Ia(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+Wi(e/60|0,"0",2)+Wi(e%60,"0",2)}function Va(t,e){return Wi(t.getUTCDate(),e,2)}function Oa(t,e){return Wi(t.getUTCHours(),e,2)}function Pa(t,e){return Wi(t.getUTCHours()%12||12,e,2)}function $a(t,e){return Wi(1+di.count(Li(t),t),e,3)}function Ya(t,e){return Wi(t.getUTCMilliseconds(),e,3)}function Ra(t,e){return Ya(t,e)+"000"}function za(t,e){return Wi(t.getUTCMonth()+1,e,2)}function Ua(t,e){return Wi(t.getUTCMinutes(),e,2)}function Ha(t,e){return Wi(t.getUTCSeconds(),e,2)}function Xa(t){var e=t.getUTCDay();return 0===e?7:e}function Wa(t,e){return Wi(ki.count(Li(t)-1,t),e,2)}function ja(t){var e=t.getUTCDay();return e>=4||0===e?_i(t):_i.ceil(t)}function qa(t,e){return t=ja(t),Wi(_i.count(Li(t),t)+(4===Li(t).getUTCDay()),e,2)}function Ga(t){return t.getUTCDay()}function Qa(t,e){return Wi(Ci.count(Li(t)-1,t),e,2)}function Za(t,e){return Wi(t.getUTCFullYear()%100,e,2)}function Ka(t,e){return Wi((t=ja(t)).getUTCFullYear()%100,e,2)}function Ja(t,e){return Wi(t.getUTCFullYear()%1e4,e,4)}function tl(t,e){var n=t.getUTCDay();return Wi((t=n>=4||0===n?_i(t):_i.ceil(t)).getUTCFullYear()%1e4,e,4)}function el(){return"+0000"}function nl(){return"%"}function rl(t){return+t}function il(t){return Math.floor(+t/1e3)}function al(t){return new Date(t)}function ll(t){return t instanceof Date?+t:+new Date(+t)}function ol(t,e,n,r,i,a,l,o,s,u){var c=Wr(),h=c.invert,f=c.domain,d=u(".%L"),g=u(":%S"),p=u("%I:%M"),y=u("%I %p"),m=u("%a %d"),v=u("%b %d"),x=u("%B"),A=u("%Y");function w(t){return(s(t)=12)]},q:function(t){return 1+~~(t.getMonth()/3)},Q:rl,s:il,S:ka,u:Ca,U:Ta,V:_a,w:Ea,W:Fa,x:null,X:null,y:Sa,Y:Na,Z:Ia,"%":nl},A={a:function(t){return l[t.getUTCDay()]},A:function(t){return a[t.getUTCDay()]},b:function(t){return s[t.getUTCMonth()]},B:function(t){return o[t.getUTCMonth()]},c:null,d:Va,e:Va,f:Ra,g:Ka,G:tl,H:Oa,I:Pa,j:$a,L:Ya,m:za,M:Ua,p:function(t){return i[+(t.getUTCHours()>=12)]},q:function(t){return 1+~~(t.getUTCMonth()/3)},Q:rl,s:il,S:Ha,u:Xa,U:Wa,V:qa,w:Ga,W:Qa,x:null,X:null,y:Za,Y:Ja,Z:el,"%":nl},w={a:function(t,e,n){var r=d.exec(e.slice(n));return r?(t.w=g.get(r[0].toLowerCase()),n+r[0].length):-1},A:function(t,e,n){var r=h.exec(e.slice(n));return r?(t.w=f.get(r[0].toLowerCase()),n+r[0].length):-1},b:function(t,e,n){var r=m.exec(e.slice(n));return r?(t.m=v.get(r[0].toLowerCase()),n+r[0].length):-1},B:function(t,e,n){var r=p.exec(e.slice(n));return r?(t.m=y.get(r[0].toLowerCase()),n+r[0].length):-1},c:function(t,n,r){return k(t,e,n,r)},d:la,e:la,f:fa,g:na,G:ea,H:sa,I:sa,j:oa,L:ha,m:aa,M:ua,p:function(t,e,n){var r=u.exec(e.slice(n));return r?(t.p=c.get(r[0].toLowerCase()),n+r[0].length):-1},q:ia,Q:ga,s:pa,S:ca,u:Zi,U:Ki,V:Ji,w:Qi,W:ta,x:function(t,e,r){return k(t,n,e,r)},X:function(t,e,n){return k(t,r,e,n)},y:na,Y:ea,Z:ra,"%":da};function b(t,e){return function(n){var r,i,a,l=[],o=-1,s=0,u=t.length;for(n instanceof Date||(n=new Date(+n));++o53)return null;"w"in a||(a.w=1),"Z"in a?(i=(r=Pi($i(a.y,0,1))).getUTCDay(),r=i>4||0===i?Ci.ceil(r):Ci(r),r=di.offset(r,7*(a.V-1)),a.y=r.getUTCFullYear(),a.m=r.getUTCMonth(),a.d=r.getUTCDate()+(a.w+6)%7):(i=(r=Oi($i(a.y,0,1))).getDay(),r=i>4||0===i?mi.ceil(r):mi(r),r=fi.offset(r,7*(a.V-1)),a.y=r.getFullYear(),a.m=r.getMonth(),a.d=r.getDate()+(a.w+6)%7)}else("W"in a||"U"in a)&&("w"in a||(a.w="u"in a?a.u%7:"W"in a?1:0),i="Z"in a?Pi($i(a.y,0,1)).getUTCDay():Oi($i(a.y,0,1)).getDay(),a.m=0,a.d="W"in a?(a.w+6)%7+7*a.W-(i+5)%7:a.w+7*a.U-(i+6)%7);return"Z"in a?(a.H+=a.Z/100|0,a.M+=a.Z%100,Pi(a)):Oi(a)}}function k(t,e,n,r){for(var i,a,l=0,o=e.length,s=n.length;l=s)return-1;if(37===(i=e.charCodeAt(l++))){if(i=e.charAt(l++),!(a=w[i in zi?e.charAt(l++):i])||(r=a(t,n,r))<0)return-1}else if(i!=n.charCodeAt(r++))return-1}return r}return x.x=b(n,x),x.X=b(r,x),x.c=b(e,x),A.x=b(n,A),A.X=b(r,A),A.c=b(e,A),{format:function(t){var e=b(t+="",x);return e.toString=function(){return t},e},parse:function(t){var e=D(t+="",!1);return e.toString=function(){return t},e},utcFormat:function(t){var e=b(t+="",A);return e.toString=function(){return t},e},utcParse:function(t){var e=D(t+="",!0);return e.toString=function(){return t},e}}}(t),Ri=Yi.format,Yi.parse,Yi.utcFormat,Yi.utcParse}({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});var ul=new Array(3).concat("fc8d59ffffbf99d594","d7191cfdae61abdda42b83ba","d7191cfdae61ffffbfabdda42b83ba","d53e4ffc8d59fee08be6f59899d5943288bd","d53e4ffc8d59fee08bffffbfe6f59899d5943288bd","d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd","d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd","9e0142d53e4ff46d43fdae61fee08be6f598abdda466c2a53288bd5e4fa2","9e0142d53e4ff46d43fdae61fee08bffffbfe6f598abdda466c2a53288bd5e4fa2").map((function(t){for(var e=t.length/6|0,n=new Array(e),r=0;r{tn(t[t.length-1])})(ul);const hl=Math.abs,fl=Math.atan2,dl=Math.cos,gl=Math.max,pl=Math.min,yl=Math.sin,ml=Math.sqrt,vl=1e-12,xl=Math.PI,Al=xl/2,wl=2*xl;function bl(t){return t>=1?Al:t<=-1?-Al:Math.asin(t)}function Dl(t){let e=3;return t.digits=function(n){if(!arguments.length)return e;if(null==n)e=null;else{const t=Math.floor(n);if(!(t>=0))throw new RangeError(`invalid digits: ${n}`);e=t}return t},()=>new xr(e)}function kl(t){return t.innerRadius}function Cl(t){return t.outerRadius}function Tl(t){return t.startAngle}function Ml(t){return t.endAngle}function _l(t){return t&&t.padAngle}function El(t,e,n,r,i,a,l){var o=t-n,s=e-r,u=(l?a:-a)/ml(o*o+s*s),c=u*s,h=-u*o,f=t+c,d=e+h,g=n+c,p=r+h,y=(f+g)/2,m=(d+p)/2,v=g-f,x=p-d,A=v*v+x*x,w=i-a,b=f*p-g*d,D=(x<0?-1:1)*ml(gl(0,w*w*A-b*b)),k=(b*x-v*D)/A,C=(-b*v-x*D)/A,T=(b*x+v*D)/A,M=(-b*v+x*D)/A,_=k-y,E=C-m,F=T-y,S=M-m;return _*_+E*E>F*F+S*S&&(k=T,C=M),{cx:k,cy:C,x01:-c,y01:-h,x11:k*(i/w-1),y11:C*(i/w-1)}}function Fl(){var t=kl,e=Cl,n=cl(0),r=null,i=Tl,a=Ml,l=_l,o=null,s=Dl(u);function u(){var u,c,h=+t.apply(this,arguments),f=+e.apply(this,arguments),d=i.apply(this,arguments)-Al,g=a.apply(this,arguments)-Al,p=hl(g-d),y=g>d;if(o||(o=u=s()),fvl)if(p>wl-vl)o.moveTo(f*dl(d),f*yl(d)),o.arc(0,0,f,d,g,!y),h>vl&&(o.moveTo(h*dl(g),h*yl(g)),o.arc(0,0,h,g,d,y));else{var m,v,x=d,A=g,w=d,b=g,D=p,k=p,C=l.apply(this,arguments)/2,T=C>vl&&(r?+r.apply(this,arguments):ml(h*h+f*f)),M=pl(hl(f-h)/2,+n.apply(this,arguments)),_=M,E=M;if(T>vl){var F=bl(T/h*yl(C)),S=bl(T/f*yl(C));(D-=2*F)>vl?(w+=F*=y?1:-1,b-=F):(D=0,w=b=(d+g)/2),(k-=2*S)>vl?(x+=S*=y?1:-1,A-=S):(k=0,x=A=(d+g)/2)}var B=f*dl(x),N=f*yl(x),L=h*dl(b),I=h*yl(b);if(M>vl){var V,O=f*dl(A),P=f*yl(A),$=h*dl(w),Y=h*yl(w);if(p1?0:t<-1?xl:Math.acos(t)}((R*U+z*H)/(ml(R*R+z*z)*ml(U*U+H*H)))/2),W=ml(V[0]*V[0]+V[1]*V[1]);_=pl(M,(h-W)/(X-1)),E=pl(M,(f-W)/(X+1))}else _=E=0}k>vl?E>vl?(m=El($,Y,B,N,f,E,y),v=El(O,P,L,I,f,E,y),o.moveTo(m.cx+m.x01,m.cy+m.y01),Evl&&D>vl?_>vl?(m=El(L,I,O,P,h,-_,y),v=El(B,N,$,Y,h,-_,y),o.lineTo(m.cx+m.x01,m.cy+m.y01),_t?1:e>=t?0:NaN}function Ol(t){return t}function Pl(t,e,n){this.k=t,this.x=e,this.y=n}var $l,Yl,Rl,zl;Bl.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||0!==this._line&&1===this._point)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e)}}},Pl.prototype={constructor:Pl,scale:function(t){return 1===t?this:new Pl(this.k*t,this.x,this.y)},translate:function(t,e){return 0===t&0===e?this:new Pl(this.k,this.x+this.k*t,this.y+this.k*e)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}},Pl.prototype,function(t){t[t.Tag=0]="Tag",t[t.Frontmatter=1]="Frontmatter",t[t.Wiki=2]="Wiki",t[t.WikiLink=3]="WikiLink",t[t.WikiDisplay=4]="WikiDisplay",t[t.Text=5]="Text",t[t.dvField=6]="dvField",t[t.Table=7]="Table",t[t.FileMeta=8]="FileMeta",t[t.Task=9]="Task",t[t.TaskDone=10]="TaskDone",t[t.TaskNotDone=11]="TaskNotDone"}($l||($l={})),function(t){t[t.Line=0]="Line",t[t.Bar=1]="Bar",t[t.Pie=2]="Pie",t[t.Radar=3]="Radar",t[t.Summary=4]="Summary",t[t.Table=5]="Table",t[t.Month=6]="Month",t[t.Heatmap=7]="Heatmap",t[t.Bullet=8]="Bullet",t[t.Unknown=9]="Unknown"}(Yl||(Yl={})),function(t){t[t.Number=0]="Number",t[t.Int=1]="Int",t[t.Date=2]="Date",t[t.Time=3]="Time",t[t.DateTime=4]="DateTime",t[t.String=5]="String"}(Rl||(Rl={})),function(t){t.GreaterThan="greaterthan",t.LessThan="lessthan"}(zl||(zl={}));class Ul{constructor(t,e){this.date=t,this.value=e}}class Hl{constructor(t,e,n){if(this.type=e,this.target=n,this.separator="",this.id=t,this.accessor=-1,this.accessor1=-1,this.accessor2=-1,this.valueType=Rl.Number,this.usedAsXDataset=!1,this.numTargets=0,e===$l.Table){let t,e=new RegExp("\\[(?[0-9]+)\\]\\[(?[0-9]+)\\](\\[(?[0-9]+)\\])?","gm");for(;t=e.exec(n);)if(void 0!==t.groups.accessor){let r=parseFloat(t.groups.accessor);if(Number.isNumber(r)&&void 0!==t.groups.accessor1){let i=parseFloat(t.groups.accessor1);if(Number.isNumber(i)){let a;void 0!==t.groups.accessor2&&(a=parseFloat(t.groups.accessor2)),this.accessor=r,this.accessor1=i,Number.isNumber(a)&&(this.accessor2=a),this.parentTarget=n.replace(e,"")}break}}}else{let t,e=new RegExp("\\[(?[0-9]+)\\]","gm");for(;t=e.exec(n);)if(void 0!==t.groups.accessor){let r=parseFloat(t.groups.accessor);Number.isNumber(r)&&(this.accessor=r,this.parentTarget=n.replace(e,""));break}}}equalTo(t){return this.type===t.type&&this.target===t.target}getType(){return this.type}getTarget(){return this.target}getParentTarget(){return this.parentTarget}getId(){return this.id}getAccessor(t=0){switch(t){case 0:return this.accessor;case 1:return this.accessor1;case 2:return this.accessor2}return null}setSeparator(t){this.separator=t}getSeparator(t=!1){return""===this.separator?t?",":"/":this.separator}addNumTargets(t=1){this.numTargets=this.numTargets+t}getNumTargets(){return this.numTargets}}class Xl{constructor(t,e){this.currentIndex=0,this.name="untitled",this.query=e,this.values=[],this.parent=t,this.id=-1,this.yMin=null,this.yMax=null,this.startDate=null,this.endDate=null,this.numTargets=0,this.lineInfo=null,this.barInfo=null,this.isTmpDataset=!1,this.valueType=null==e?void 0:e.valueType;for(let e=0;e=0&&n=0&&nthis.yMax)&&(this.yMax=e),(null===this.startDate||tthis.endDate)&&(this.endDate=t.clone()))}recalculateMinMax(){this.yMin=Math.min(...this.values),this.yMax=Math.max(...this.values)}getYMin(){return this.yMin}getYMax(){return this.yMax}getStartDate(){return this.startDate}getEndDate(){return this.endDate}shift(t,e){let n=!1;for(let r=0;r=e)&&(this.values[r]=this.values[r]+t,n=!0);n&&(this.yMin=this.yMin+t,this.yMax=this.yMax+t)}setPenalty(t){for(let e=0;ethis.yMax&&(this.yMax=t))}getQuery(){return this.query}accumulateValues(){let t=0;for(let e=0;ethis.yMax&&(this.yMax=t)}shiftByDataset(t){for(let e=0;ethis.yMax&&(this.yMax=n)}}getValues(){return this.values}getLength(){return this.values.length}getLengthNotNull(){let t=0;for(let e=0;e[\d\.\/-]+)\s*,\s*(?[\d\.\/-]+)\s*\)/).groups;e&&(this.translateX=parseFloat(e.x),this.translateY=parseFloat(e.y))}}}class oo{constructor(t,e){this.filePath=t,this.tableIndex=e,this.xDataset=null,this.yDatasets=[]}}class so{constructor(){this.fileTotal=0,this.fileAvailable=0,this.fileOutOfDateRange=0,this.fileNotInFormat=0,this.errorMessage="",this.minDate=window.moment(""),this.maxDate=window.moment(""),this.gotAnyValidXValue=!1,this.gotAnyValidYValue=!1}}const uo=function(){const t=["HH","H","hh","h"],e=["mm","m"],n=["ss","s",""];let r=[];for(let i of t)for(let t of e)for(let e of n){let n=`${i}:${t}`;""!==e&&(n+=`:${e}`),i.contains("h")&&(n+=" a"),r.push(n)}return r}();function co(t,e,n){if(!e&&!n)return t;let r=t;if(r.startsWith("^")&&(r=r.slice(1)),e){let t=new RegExp("^("+e+")","gm");t.test(r)&&(r=r.replace(t,""))}if(n){let t=new RegExp("("+n+")$","gm");t.test(r)&&(r=r.replace(t,""))}return r}function ho(t,e){let n=e;t.length>4&&t.startsWith("[[")&&t.endsWith("]]")&&(t=t.substring(2,t.length-2)),"iso-8601"===e.toLowerCase()&&(n=window.moment.ISO_8601);let r=window.moment(t,n,!0);return r=r.startOf("day"),r}function fo(t,e,n=!0){if(!t||!e||0===e.length)return[null,t];let r=null;const i="^(?[0-9]+)("+e.join("|")+")$",a=new RegExp(i,"gm");let l=a.exec(t);return l&&void 0!==l.groups&&void 0!==l.groups.value&&(r=parseFloat(l.groups.value),Number.isNumber(r)&&!Number.isNaN(r))?(n&&(t=t.replace(a,"")),[r,t]):[null,t]}function go(t){if(!t)return null;let e=window.moment.duration(0),n=!1,r=!1;t.startsWith("+")&&(r=!1,t=t.substring(1)),t.startsWith("-")&&(r=!0,t=t.substring(1));let i=null;[i,t]=fo(t,["year","years","Y","y"]),null!==i&&(r&&(i*=-1),e.add(i,"years"),n=!0);let a=null;[a,t]=fo(t,["month","months","M"]),null!==a&&(r&&(a*=-1),e.add(a,"months"),n=!0);let l=null;[l,t]=fo(t,["week","weeks","W","w"]),null!==l&&(r&&(l*=-1),e.add(l,"weeks"),n=!0);let o=null;[o,t]=fo(t,["day","days","D","d"]),null!==o&&(r&&(o*=-1),e.add(o,"days"),n=!0);let s=null;[s,t]=fo(t,["hour","hours","H","h"]),null!==s&&(r&&(s*=-1),e.add(s,"hours"),n=!0);let u=null;[u,t]=fo(t,["minute","minutes","m"]),null!==u&&(r&&(u*=-1),e.add(u,"minutes"),n=!0);let c=null;return[c,t]=fo(t,["second","seconds","S","s"]),null!==c&&(r&&(c*=-1),e.add(c,"seconds"),n=!0),n?e:null}function po(t,e){let n=null,r=go(t);return r&&window.moment.isDuration(r)&&(n=vo(e),n=n.add(r),n&&n.isValid()),n}function yo(t,e){return null==t?null:"iso-8601"===e.toLowerCase()?t.format():t.format(e)}function mo(t,e){return ho(yo(window.moment(t),e),e)}function vo(t){return ho(yo(window.moment(),t),t)}function xo(t,e){for(var n=(e=e.replace(/^\./,"")).split("."),r=0,i=n.length;rt!==e)),i=n.reverse().findIndex((t=>t!==e));return-1===r&&-1===i?t:t.substring(r,t.length-i)}function wo(t){if(null===t)return null;let e=new RegExp(']*?alt\\s*=\\s*[""\']?(?[^\'"" >]+?)[ \'""][^>]*?>',"g");return t.replace(e,((...t)=>{let e=t[t.length-1];return e&&e.emoji?e.emoji.trim():""}))}function bo(t,e=null){let n=null,r=Rl.Number;if("string"==typeof t)if(t.includes(":")){let e=!1;t.startsWith("-")&&(e=!0,t=t.substring(1));let i=window.moment(t,uo,!0);i.isValid()&&(n=i.diff(window.moment("00:00","HH:mm",!0),"seconds"),e&&(n*=-1),r=Rl.Time)}else if(e){const r=Object.keys(e);for(let n of r)if("string"==typeof n){let r=new RegExp(n,"gm");if(r.test(t)&&Number.isNumber(e[n])){let i=e[n].toString();t=t.replace(r,i);break}}n=parseFloat(t),Number.isNaN(n)&&(n=null)}else n=parseFloat(t),Number.isNaN(n)&&(n=null);else"number"==typeof t&&(n=t);return{type:r,value:n}}function Do(t,e="",n=""){var r=Qt("body").append("svg");let i=r.append("text").text(t).attr("x",-99999).attr("y",-99999);e&&i.attr("class",e),n&&i.attr("transform","rotate("+n+")");var a=r.node().getBBox();return r.remove(),{width:a.width,height:a.height}}function ko(t,e,n){let r=(0|parseFloat(t.attr("width")))+e,i=(0|parseFloat(t.attr("height")))+n;t.attr("width",r),t.attr("height",i)}function Co(t,e,n){let r=new lo(t.attr("transform"));t.attr("transform","translate("+(r.translateX+e)+","+(r.translateY+n)+")")}function To(t){return t=(t=(t=t.replace(/(^\\s\*)|(\\s\*$)/gi,"")).replace(/\[ \]{2,}/gi," ")).replace(/\\n /,"\\n")}class Mo{static get version(){return"1.4.0"}static toString(){return"JavaScript Expression Parser (JSEP) v"+Mo.version}static addUnaryOp(t){return Mo.max_unop_len=Math.max(t.length,Mo.max_unop_len),Mo.unary_ops[t]=1,Mo}static addBinaryOp(t,e,n){return Mo.max_binop_len=Math.max(t.length,Mo.max_binop_len),Mo.binary_ops[t]=e,n?Mo.right_associative.add(t):Mo.right_associative.delete(t),Mo}static addIdentifierChar(t){return Mo.additional_identifier_chars.add(t),Mo}static addLiteral(t,e){return Mo.literals[t]=e,Mo}static removeUnaryOp(t){return delete Mo.unary_ops[t],t.length===Mo.max_unop_len&&(Mo.max_unop_len=Mo.getMaxKeyLen(Mo.unary_ops)),Mo}static removeAllUnaryOps(){return Mo.unary_ops={},Mo.max_unop_len=0,Mo}static removeIdentifierChar(t){return Mo.additional_identifier_chars.delete(t),Mo}static removeBinaryOp(t){return delete Mo.binary_ops[t],t.length===Mo.max_binop_len&&(Mo.max_binop_len=Mo.getMaxKeyLen(Mo.binary_ops)),Mo.right_associative.delete(t),Mo}static removeAllBinaryOps(){return Mo.binary_ops={},Mo.max_binop_len=0,Mo}static removeLiteral(t){return delete Mo.literals[t],Mo}static removeAllLiterals(){return Mo.literals={},Mo}get char(){return this.expr.charAt(this.index)}get code(){return this.expr.charCodeAt(this.index)}constructor(t){this.expr=t,this.index=0}static parse(t){return new Mo(t).parse()}static getMaxKeyLen(t){return Math.max(0,...Object.keys(t).map((t=>t.length)))}static isDecimalDigit(t){return t>=48&&t<=57}static binaryPrecedence(t){return Mo.binary_ops[t]||0}static isIdentifierStart(t){return t>=65&&t<=90||t>=97&&t<=122||t>=128&&!Mo.binary_ops[String.fromCharCode(t)]||Mo.additional_identifier_chars.has(String.fromCharCode(t))}static isIdentifierPart(t){return Mo.isIdentifierStart(t)||Mo.isDecimalDigit(t)}throwError(t){const e=new Error(t+" at character "+this.index);throw e.index=this.index,e.description=t,e}runHook(t,e){if(Mo.hooks[t]){const n={context:this,node:e};return Mo.hooks.run(t,n),n.node}return e}searchHook(t){if(Mo.hooks[t]){const e={context:this};return Mo.hooks[t].find((function(t){return t.call(e.context,e),e.node})),e.node}}gobbleSpaces(){let t=this.code;for(;t===Mo.SPACE_CODE||t===Mo.TAB_CODE||t===Mo.LF_CODE||t===Mo.CR_CODE;)t=this.expr.charCodeAt(++this.index);this.runHook("gobble-spaces")}parse(){this.runHook("before-all");const t=this.gobbleExpressions(),e=1===t.length?t[0]:{type:Mo.COMPOUND,body:t};return this.runHook("after-all",e)}gobbleExpressions(t){let e,n,r=[];for(;this.index0;){if(Mo.binary_ops.hasOwnProperty(t)&&(!Mo.isIdentifierStart(this.code)||this.index+t.lengthi.right_a&&t.right_a?n>t.prec:n<=t.prec;for(;r.length>2&&o(r[r.length-2]);)l=r.pop(),e=r.pop().value,a=r.pop(),t={type:Mo.BINARY_EXP,operator:e,left:a,right:l},r.push(t);t=this.gobbleToken(),t||this.throwError("Expected expression after "+s),r.push(i,t)}for(o=r.length-1,t=r[o];o>1;)t={type:Mo.BINARY_EXP,operator:r[o-1].value,left:r[o-2],right:t},o-=2;return t}gobbleToken(){let t,e,n,r;if(this.gobbleSpaces(),r=this.searchHook("gobble-token"),r)return this.runHook("after-token",r);if(t=this.code,Mo.isDecimalDigit(t)||t===Mo.PERIOD_CODE)return this.gobbleNumericLiteral();if(t===Mo.SQUOTE_CODE||t===Mo.DQUOTE_CODE)r=this.gobbleStringLiteral();else if(t===Mo.OBRACK_CODE)r=this.gobbleArray();else{for(e=this.expr.substr(this.index,Mo.max_unop_len),n=e.length;n>0;){if(Mo.unary_ops.hasOwnProperty(e)&&(!Mo.isIdentifierStart(this.code)||this.index+e.length=e.length&&this.throwError("Unexpected token "+String.fromCharCode(t));break}if(i===Mo.COMMA_CODE){if(this.index++,r++,r!==e.length)if(t===Mo.CPAREN_CODE)this.throwError("Unexpected token ,");else if(t===Mo.CBRACK_CODE)for(let t=e.length;t{if("object"!=typeof t||!t.name||!t.init)throw new Error("Invalid JSEP plugin format");this.registered[t.name]||(t.init(this.jsep),this.registered[t.name]=t)}))}}(Mo),COMPOUND:"Compound",SEQUENCE_EXP:"SequenceExpression",IDENTIFIER:"Identifier",MEMBER_EXP:"MemberExpression",LITERAL:"Literal",THIS_EXP:"ThisExpression",CALL_EXP:"CallExpression",UNARY_EXP:"UnaryExpression",BINARY_EXP:"BinaryExpression",ARRAY_EXP:"ArrayExpression",TAB_CODE:9,LF_CODE:10,CR_CODE:13,SPACE_CODE:32,PERIOD_CODE:46,COMMA_CODE:44,SQUOTE_CODE:39,DQUOTE_CODE:34,OPAREN_CODE:40,CPAREN_CODE:41,OBRACK_CODE:91,CBRACK_CODE:93,QUMARK_CODE:63,SEMCOL_CODE:59,COLON_CODE:58,unary_ops:{"-":1,"!":1,"~":1,"+":1},binary_ops:{"||":1,"??":1,"&&":2,"|":3,"^":4,"&":5,"==":6,"!=":6,"===":6,"!==":6,"<":7,">":7,"<=":7,">=":7,"<<":8,">>":8,">>>":8,"+":9,"-":9,"*":10,"/":10,"%":10,"**":11},right_associative:new Set(["**"]),additional_identifier_chars:new Set(["$","_"]),literals:{true:!0,false:!1,null:null},this_str:"this"}),Mo.max_unop_len=Mo.getMaxKeyLen(Mo.unary_ops),Mo.max_binop_len=Mo.getMaxKeyLen(Mo.binary_ops);const Eo=t=>new Mo(t).parse(),Fo=Object.getOwnPropertyNames(class{});Object.getOwnPropertyNames(Mo).filter((t=>!Fo.includes(t)&&void 0===Eo[t])).forEach((t=>{Eo[t]=Mo[t]})),Eo.Jsep=Mo;var So={name:"ternary",init(t){t.hooks.add("after-expression",(function(e){if(e.node&&this.code===t.QUMARK_CODE){this.index++;const n=e.node,r=this.gobbleExpression();if(r||this.throwError("Expected expression"),this.gobbleSpaces(),this.code===t.COLON_CODE){this.index++;const i=this.gobbleExpression();if(i||this.throwError("Expected expression"),e.node={type:"ConditionalExpression",test:n,consequent:r,alternate:i},n.operator&&t.binary_ops[n.operator]<=.9){let r=n;for(;r.right.operator&&t.binary_ops[r.right.operator]<=.9;)r=r.right;e.node.test=r.right,r.right=e.node,e.node=n}}else this.throwError("Expected :")}}))}};Eo.plugins.register(So);var Bo,No={};var Lo,Io=(Bo||(Bo=1,Lo=No,function(){var t={not_type:/[^T]/,not_primitive:/[^v]/,number:/[diefg]/,numeric_arg:/[bcdiefguxX]/,json:/[j]/,text:/^[^\x25]+/,modulo:/^\x25{2}/,placeholder:/^\x25(?:([1-9]\d*)\$|\(([^)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-gijostTuvxX])/,key:/^([a-z_][a-z_\d]*)/i,key_access:/^\.([a-z_][a-z_\d]*)/i,index_access:/^\[(\d+)\]/,sign:/^[+-]/};function e(n){return function(n,r){var i,a,l,o,s,u,c,h,f,d=1,g=n.length,p="";for(a=0;a=0),o.type){case"b":i=parseInt(i,10).toString(2);break;case"c":i=String.fromCharCode(parseInt(i,10));break;case"d":case"i":i=parseInt(i,10);break;case"j":i=JSON.stringify(i,null,o.width?parseInt(o.width):0);break;case"e":i=o.precision?parseFloat(i).toExponential(o.precision):parseFloat(i).toExponential();break;case"f":i=o.precision?parseFloat(i).toFixed(o.precision):parseFloat(i);break;case"g":i=o.precision?String(Number(i.toPrecision(o.precision))):parseFloat(i);break;case"o":i=(parseInt(i,10)>>>0).toString(8);break;case"s":i=String(i),i=o.precision?i.substring(0,o.precision):i;break;case"t":i=String(!!i),i=o.precision?i.substring(0,o.precision):i;break;case"T":i=Object.prototype.toString.call(i).slice(8,-1).toLowerCase(),i=o.precision?i.substring(0,o.precision):i;break;case"u":i=parseInt(i,10)>>>0;break;case"v":i=i.valueOf(),i=o.precision?i.substring(0,o.precision):i;break;case"x":i=(parseInt(i,10)>>>0).toString(16);break;case"X":i=(parseInt(i,10)>>>0).toString(16).toUpperCase()}t.json.test(o.type)?p+=i:(!t.number.test(o.type)||h&&!o.sign?f="":(f=h?"+":"-",i=i.toString().replace(t.sign,"")),u=o.pad_char?"0"===o.pad_char?"0":o.pad_char.charAt(1):" ",c=o.width-(f+i).length,s=o.width&&c>0?u.repeat(c):"",p+=o.align?f+i+s:"0"===u?f+s+i:s+f+i)}return p}(function(e){if(r[e])return r[e];for(var n,i=e,a=[],l=0;i;){if(null!==(n=t.text.exec(i)))a.push(n[0]);else if(null!==(n=t.modulo.exec(i)))a.push("%");else{if(null===(n=t.placeholder.exec(i)))throw new SyntaxError("[sprintf] unexpected placeholder");if(n[2]){l|=1;var o=[],s=n[2],u=[];if(null===(u=t.key.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");for(o.push(u[1]);""!==(s=s.substring(u[0].length));)if(null!==(u=t.key_access.exec(s)))o.push(u[1]);else{if(null===(u=t.index_access.exec(s)))throw new SyntaxError("[sprintf] failed to parse named argument key");o.push(u[1])}n[2]=o}else l|=2;if(3===l)throw new Error("[sprintf] mixing positional and named placeholders is not (yet) supported");a.push({placeholder:n[0],param_no:n[1],keys:n[2],sign:n[3],pad_char:n[4],align:n[5],width:n[6],precision:n[7],type:n[8]})}i=i.substring(n[0].length)}return r[e]=a}(n),arguments)}function n(t,n){return e.apply(null,[t].concat(n||[]))}var r=Object.create(null);Lo.sprintf=e,Lo.vsprintf=n,"undefined"!=typeof window&&(window.sprintf=e,window.vsprintf=n)}()),No);function Vo(t){if("number"==typeof t){if(0===t)return!1}else if(t instanceof Xl&&t.getValues().some((function(t){return 0===t})))return!1;return!0}const Oo={first:function(t,e){return t.getValue(this.startDate(...arguments))},last:function(t,e){return t.getValue(this.endDate(...arguments))},min:function(t,e){return m(t.getValues())},minDate:function(t,e){let n=m(t.getValues());if(Number.isNumber(n)){let e=Array.from(t);for(let t of e.reverse())if(null!==t.value&&t.value===n)return t.date}return"Error: min not found"},max:function(t,e){return y(t.getValues())},maxDate:function(t,e){let n=y(t.getValues());if(Number.isNumber(n)){let e=Array.from(t);for(let t of e.reverse())if(null!==t.value&&t.value===n)return t.date}return"Error: max not found"},startDate:function(t,e){if(t){let e=t.getStartDate();if(e&&e.isValid())return e}return e.startDate},endDate:function(t,e){if(t){let e=t.getEndDate();if(e&&e.isValid())return e}return e.endDate},sum:function(t,e){return b(t.getValues())},count:function(t,e){return"Error: deprecated function 'count'"},numTargets:function(t,e){return t.getNumTargets()},days:function(t,e){return"Error: deprecated function 'days'"},numDays:function(t,e){return t.getLength()},numDaysHavingData:function(t,e){return t.getLengthNotNull()},maxStreak:function(t,e){let n=0,r=0;for(let e of t)e.value?n++:n=0,n>=r&&(r=n);return r},maxStreakStart:function(t,e){let n=0,r=0,i=null,a=null;if(t)for(let e of t)e.value?(0===n&&(i=e.date),n++):n=0,n>=r&&(r=n,a=i);return a},maxStreakEnd:function(t,e){let n=0,r=0,i=null,a=null;if(t){let e=Array.from(t);for(let t=0;t=r&&(r=n,a=i)}}return a},maxBreaks:function(t,e){let n=0,r=0;for(let e of t)e.value?n=0:n++,n>r&&(r=n);return r},maxBreaksStart:function(t,e){let n=0,r=0,i=null,a=null;if(t)for(let e of t)e.value?n=0:(0===n&&(i=e.date),n++),n>=r&&(r=n,a=i);return a},maxBreaksEnd:function(t,e){let n=0,r=0,i=null,a=null;if(t){let e=Array.from(t);for(let t=0;t=r&&(r=n,a=i)}}return a},lastStreak:function(t,e){return"Error: deprecated function 'lastStreak'"},currentStreak:function(t,e){let n=0;if(t){let e=Array.from(t);for(let t=e.length-1;t>=0;t--){if(!e[t].value)break;n++}}return n},currentStreakStart:function(t,e){let n=null;if(t){let e=Array.from(t);for(let t=e.length-1;t>=0;t--){let r=e[t];if(t=0;t--){let i=e[t];if(!i.value)break;0===n&&(r=i.date),n++}}return null===r?"Error: absense":r},currentBreaks:function(t,e){let n=0;if(t){let e=Array.from(t);for(let t=e.length-1;t>=0;t--){if(e[t].value)break;n++}}return n},currentBreaksStart:function(t,e){let n=null;if(t){let e=Array.from(t);for(let t=e.length-1;t>=0;t--){let r=e[t];if(t=0;t--){let i=e[t];if(i.value)break;0===n&&(r=i.date),n++}}return null===r?"Error: absense":r},average:function(t,e){let n=t.getLengthNotNull();return Vo(n)?b(t.getValues())/n:"Error: divide by zero in expression"},median:function(t,e){return A(t.getValues())},variance:function(t,e){return function(t){let e,n=0,r=0,i=0;for(let a of t)null!=a&&(a=+a)>=a&&(e=a-r,r+=e/++n,i+=e*(a-r));if(n>1)return i/(n-1)}(t.getValues())}},Po={"-":function(t){if("number"==typeof t)return-1*t;if(t instanceof Xl){let e=t.cloneToTmpDataset();return e.getValues().forEach((function(t,e,n){null!==n[e]&&(n[e]=-1*t)})),e.recalculateMinMax(),e}return"Error: unknown operation for '-'"},"+":function(t){if("number"==typeof t)return t;if(t instanceof Xl){return t.cloneToTmpDataset()}return"Error: unknown operation for '+'"}},$o={"+":function(t,e){if("number"==typeof t&&"number"==typeof e)return t+e;if("number"==typeof t&&e instanceof Xl){let n=e.cloneToTmpDataset();return n.getValues().forEach((function(e,n,r){null!==r[n]?r[n]=t+e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&"number"==typeof e){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t+e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&e instanceof Xl){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t+e.getValues()[n]:r[n]=null})),n.recalculateMinMax(),n}return"Error: unknown operation for '+'"},"-":function(t,e){if("number"==typeof t&&"number"==typeof e)return t-e;if("number"==typeof t&&e instanceof Xl){let n=e.cloneToTmpDataset();return n.getValues().forEach((function(e,n,r){null!==r[n]?r[n]=t-e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&"number"==typeof e){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t-e:r[n]=null})),n}if(t instanceof Xl&&e instanceof Xl){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t-e.getValues()[n]:r[n]=null})),n.recalculateMinMax(),n}return"Error: unknown operation for '-'"},"*":function(t,e){if("number"==typeof t&&"number"==typeof e)return t*e;if("number"==typeof t&&e instanceof Xl){let n=e.cloneToTmpDataset();return n.getValues().forEach((function(e,n,r){null!==r[n]?r[n]=t*e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&"number"==typeof e){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t*e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&e instanceof Xl){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t*e.getValues()[n]:r[n]=null})),n.recalculateMinMax(),n}return"Error: unknown operation for '*'"},"/":function(t,e){if(!Vo(e))return"Error: divide by zero in expression";if("number"==typeof t&&"number"==typeof e)return t/e;if("number"==typeof t&&e instanceof Xl){let n=e.cloneToTmpDataset();return n.getValues().forEach((function(e,n,r){null!==r[n]?r[n]=t/e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&"number"==typeof e){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t/e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&e instanceof Xl){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t/e.getValues()[n]:r[n]=null})),n.recalculateMinMax(),n}return"Error: unknown operation for '/'"},"%":function(t,e){if(!Vo(e))return"Error: divide by zero in expression";if("number"==typeof t&&"number"==typeof e)return t%e;if("number"==typeof t&&e instanceof Xl){let n=e.cloneToTmpDataset();return n.getValues().forEach((function(e,n,r){null!==r[n]?r[n]=t%e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&"number"==typeof e){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t%e:r[n]=null})),n.recalculateMinMax(),n}if(t instanceof Xl&&e instanceof Xl){let n=t.cloneToTmpDataset();return n.getValues().forEach((function(t,n,r){null!==r[n]?r[n]=t%e.getValues()[n]:r[n]=null})),n.recalculateMinMax(),n}return"Error: unknown operation for '%'"}},Yo={normalize:function(t,e,n){let r=t.getYMin(),i=t.getYMax();if(null!==r&&null!==i&&i>r){let e=t.cloneToTmpDataset();return e.getValues().forEach((function(t,e,n){n[e]=(t-r)/(i-r)})),e.recalculateMinMax(),e}return"Error: invalid data range for function 'normalize'"},setMissingValues:function(t,e,n){if(e&&e.length>0){let n=e[0],r=t.cloneToTmpDataset();return Number.isNumber(n)&&!Number.isNaN(n)?(r.getValues().forEach((function(t,e,r){null===t&&(r[e]=n)})),r.recalculateMinMax(),r):"Error: invalid arguments for function 'setMissingValues'"}return"Error: invalid arguments for function 'setMissingValues"}};function Ro(t,e){switch(t.type){case"Literal":return t.value;case"Identifier":let n=t.name;return n in Oo||n in Yo?`Error: deprecated template variable '${n}', use '${n}()' instead`:`Error: unknown function name '${n}'`;case"UnaryExpression":let r=t,i=Ro(r.argument,e);return"string"==typeof i?i:Po[r.operator](i);case"BinaryExpression":let a=t,l=Ro(a.left,e),o=Ro(a.right,e),s=function(t,e){return"string"==typeof t?t:"string"==typeof e?e:"number"==typeof t||window.moment.isMoment(t)||t instanceof Xl?"number"==typeof e||window.moment.isMoment(e)||e instanceof Xl?"":"Error: invalide operant type":"Error: invalid operant type"}(l,o);return"string"==typeof s&&s.startsWith("Error:")?s:$o[a.operator](l,o);case"CallExpression":let u=t,c=u.callee.name,h=function(t,e){return t.map((function(t){return Ro(t,e)}))}(u.arguments,e);if("string"==typeof h)return h;if("dataset"===c){if(1===h.length){let t=h[0];if("string"==typeof t)return t;if("number"!=typeof t)return"Error: function 'dataset' only accepts id in number";let n=function(t,e){return e.datasets.getDatasetById(t)}(t,e);return n||`Error: no dataset found for id '${t}'`}}else{if(c in Oo){if(0===h.length){let t=null;for(let n of e.datasets)t||n.getQuery().usedAsXDataset||(t=n);return t?Oo[c](t,e):`No available dataset found for function ${c}`}if(1===h.length){let t=h[0];return"string"==typeof t?t:t instanceof Xl?Oo[c](t,e):`Error: function '${c}' only accepts Dataset`}return`Error: Too many arguments for function ${c}`}if(c in Yo){if(1===h.length){if("string"==typeof h[0])return h[0];if(h[0]instanceof Xl){let t=h[0];return Yo[c](t,null,e)}return`Error: function ${c} only accept Dataset`}if(h.length>1){if("string"==typeof h[0])return h[0];if(h[0]instanceof Xl){let t=h[0];return Yo[c](t,h.filter((function(t,e,n){return e>0})),e)}return`Error: function ${c} only accept Dataset`}return`Error: Too many arguments for function ${c}`}}return`Error: unknown function name '${c}'`}return"Error: unknown expression"}function zo(t,e){let n,r=[],i=new RegExp("{{(?[\\w+\\-*\\/0-9\\s()\\[\\]%.,]+)(::(?[\\w+\\-*\\/0-9\\s()\\[\\]%.:]+))?}}","gm");for(;n=i.exec(t);){let t=n[0];if(!r.some((e=>e.source===t))&&(void 0!==n.groups&&void 0!==n.groups.expr)){let i=n.groups.expr,a=null;try{a=Eo(i)}catch(t){return"Error:"+t.message}if(!a)return"Error: failed to parse expression";const l=Ro(a,e);if("string"==typeof l)return l;if("number"==typeof l||window.moment.isMoment(l)){let e=null;void 0!==n.groups.format&&(e=n.groups.format),r.push({source:t,value:l,format:e})}}}return r}function Uo(t,e){let n=zo(t,e);if("string"==typeof n)return n;let r=n;for(let n of r){let r=n.source,i=n.value,a=n.format,l="";"number"==typeof i?l=a?Io.sprintf("%"+a,i):i.toFixed(1):window.moment.isMoment(i)&&(l=yo(i,a||e.dateFormat)),l&&(t=t.split(r).join(l))}return t}function Ho(t,e){if(t=t.trim(),/^([\-]?[0-9]+[\.][0-9]+|[\-]?[0-9]+)$/.test(t))return parseFloat(t);let n=zo(t,e);if("string"==typeof n)return n;let r=n;return r.length>0?r[0].value:"Error: failed to resolve values"}function Xo(t,e,n,r){let i="",a=.5*n.dataAreaSize.width,l=.7*a,o=l*r.ratioInnerRadius,s=[];for(let t of r.data){let e=Ho(t,n);if("string"==typeof e){i=e;break}"number"==typeof e&&s.push(e)}if(""!==i)return i;let u=[];for(let t of r.label){let e=Uo(t,n);if(e.startsWith("Error")){i=e;break}u.push(e)}if(""!==i)return i;let c=r.hideLabelLessThan,h=u.map((function(t){return Do(t,"tracker-tick-label")})),f=[];for(let t of r.extLabel){let e=Uo(t,n);if(e.startsWith("Error")){i=e;break}f.push(e)}if(""!==i)return i;let d=f.map((function(t){return Do(t,"tracker-pie-label")})),g=r.showExtLabelOnlyIfNoLabel,p=Or().range(r.dataColor),y=e.dataArea.append("g");y.attr("transform",(function(){return"translate("+.5*n.dataAreaSize.width+","+.5*n.dataAreaSize.height+")"}));let m=function(){var t=Ol,e=Vl,n=null,r=cl(0),i=cl(wl),a=cl(0);function l(l){var o,s,u,c,h,f=(l=Sl(l)).length,d=0,g=new Array(f),p=new Array(f),y=+r.apply(this,arguments),m=Math.min(wl,Math.max(-wl,i.apply(this,arguments)-y)),v=Math.min(Math.abs(m)/f,a.apply(this,arguments)),x=v*(m<0?-1:1);for(o=0;o0&&(d+=h);for(null!=e?g.sort((function(t,n){return e(p[t],p[n])})):null!=n&&g.sort((function(t,e){return n(l[t],l[e])})),o=0,u=d?(m-f*x)/d:0;o0?h*u:0)+x,p[s]={data:l[s],index:o,value:h,startAngle:y,endAngle:c,padAngle:v};return p}return l.value=function(e){return arguments.length?(t="function"==typeof e?e:cl(+e),l):t},l.sortValues=function(t){return arguments.length?(e=t,n=null,l):e},l.sort=function(t){return arguments.length?(n=t,e=null,l):n},l.startAngle=function(t){return arguments.length?(r="function"==typeof t?t:cl(+t),l):r},l.endAngle=function(t){return arguments.length?(i="function"==typeof t?t:cl(+t),l):i},l.padAngle=function(t){return arguments.length?(a="function"==typeof t?t:cl(+t),l):a},l}(),v=m(s);v.forEach((function(t,e){t.input_index=e}));let x=y.selectAll("sector").data(v).enter().append("g").attr("class","sector"),A=Fl().innerRadius(o).outerRadius(l);var w=Fl().innerRadius(.9*a).outerRadius(.9*a);function b(t){return(t.endAngle-t.startAngle)/(2*Math.PI)Math.sqrt((o[0]-a[0])**2+(o[1]-a[1])**2)?[a,o]:[a,l,o]}y.selectAll("extLabel").data(v).enter().append("text").sort((function(t,e){return Math.cos(D(e))-Math.cos(D(t))})).text((function(t,e){return k(t,t.input_index)})).attr("transform",(function(t,e){if(0==k(t,e=t.input_index).length)return;let n=w.centroid(t),r=D(t);n[0]=(.99*a-d[e].width)*(rh&&(h=u[t].width,c=t);let f=h/s[c].length,d=u[c].height,g=s.length,p=2*f,y=d,m=2*f,v=0,x=0;"vertical"===r.legendOrientation?(v=3*p+m+h,x=(g+1)*y):"horizontal"===r.legendOrientation&&(v=(2*p+m)*g+p+b(u,(function(t,e){return t.width})),x=y+d);let A=0,w=0;if("top"===r.legendPosition)A=n.dataAreaSize.width/2-v/2,w=o,ko(i,0,x+y),Co(a,0,x+y);else if("bottom"===r.legendPosition)A=n.dataAreaSize.width/2-v/2,w=o+n.dataAreaSize.height+y,ko(i,0,x+y);else if("left"===r.legendPosition)A=0,w=o+n.dataAreaSize.height/2-x/2,ko(i,v+p,0),Co(a,v+p,0);else{if("right"!==r.legendPosition)return;A=n.dataAreaSize.width+p,w=o+n.dataAreaSize.height/2-x/2,ko(i,v+p,0)}let D=e.graphArea.append("g").attr("id","legend").attr("transform","translate("+A+","+w+")"),k=D.append("rect").attr("class","tracker-legend").attr("width",v).attr("height",x);r.legendBgColor&&k.style("fill",r.legendBgColor),r.legendBorderColor&&k.style("stroke",r.legendBorderColor);let C=p,T=d,M=C+p+m,_=T;if("vertical"===r.legendOrientation)D.selectAll("markers").data(s).enter().append("circle").attr("cx",C+m/2).attr("cy",(function(t,e){return T+e*y})).attr("r",(function(t,e){return 5})).style("fill",(function(t,e){return r.dataColor[e]})),D.selectAll("labels").data(s).enter().append("text").attr("x",M).attr("y",(function(t,e){return _+e*y})).text((function(t,e){return t})).style("alignment-baseline","middle").attr("class","tracker-legend-label").style("fill",(function(t,e){return r.dataColor[e]}));else if("horizontal"===r.legendOrientation){let t=0;t=0,D.selectAll("markers").data(s).enter().append("circle").attr("cx",(function(e,n){return 0===n?t=C+m/2:t+=u[n].width+p+m+p,t})).attr("cy",T).attr("r",(function(t,e){return 5})).style("fill",(function(t,e){return r.dataColor[e]})),t=0,D.selectAll("labels").data(s).enter().append("text").attr("x",(function(e,n){return 0===n?t=M:t+=u[n].width+p+m+p,t})).attr("y",_).text((function(t,e){return t})).style("alignment-baseline","middle").attr("class","tracker-legend-label").style("fill",(function(t,e){return r.dataColor[e]}))}}(0,r,e,n),function(t,e,n){let r=Qt(t),i=e.svg,a=parseFloat(i.attr("width")),l=parseFloat(i.attr("height"));i.attr("width",null).attr("height",null).attr("viewBox",`0 0 ${a} ${l}`).attr("preserveAspectRatio","xMidYMid meet"),n.fitPanelWidth?r.style("width","100%"):(r.style("width",(a*n.fixedScale).toString()+"px"),r.style("height",(l*n.fixedScale).toString()+"px"))}(t,r,e)}function jo(t,e,n){if(!e||!n)return;let r="";n.template,r=n.template;let i=Uo(r,e);if(i.startsWith("Error:"))return i;if(r=i,""!==r){let e=Qt(t).append("div");if(r.includes("\n")||r.includes("\\n")){let t=r.split(/(\n|\\n)/);for(let n of t)"\n"!==n&&"\\n"!==n&&e.append("div").text(n)}else e.text(r);""!==n.style&&e.attr("style",n.style)}}let qo=!1;function Go(t,e,n){let r=Qt(t),i=e.svg,a=parseFloat(i.attr("width")),l=parseFloat(i.attr("height"));i.attr("width",null).attr("height",null).attr("viewBox",`0 0 ${a} ${l}`).attr("preserveAspectRatio","xMidYMid meet"),n.fitPanelWidth?r.style("width","100%"):(r.style("width",(a*n.fixedScale).toString()+"px"),r.style("height",(l*n.fixedScale).toString()+"px"))}function Qo(t,e){let n=e.dataset;if(0===n.length)return!1;let r=null;if(null===e.selectedDataset){for(let e of n)if(r=t.datasets.getDatasetById(e),r&&!r.getQuery().usedAsXDataset)break;if(r)return e.selectedDataset=r.getId(),!0}else{let i=e.selectedDataset,a=n.findIndex((t=>t===i));if(a>=0){if(a===e.dataset.length-1){for(let e of n)if(r=t.datasets.getDatasetById(e),r&&!r.getQuery().usedAsXDataset)break;return!!r&&(e.selectedDataset=r.getId(),!0)}{a++;let i=n[a];if(r=t.datasets.getDatasetById(i),e.selectedDataset=i,r&&!r.getQuery().usedAsXDataset)return!0;Qo(t,e)}}}return!1}function Zo(t,e,n,r){Qt(e).select("#svg").remove();for(var i=Object.getOwnPropertyNames(t),a=0;a1&&(o="All Targets");let A=Do(o,"tracker-month-title-rotator"),w=p.append("text").text(o).attr("transform","translate("+3.5*u+","+A.height+")").attr("class","tracker-month-title-rotator").style("cursor","pointer");r.showAnnotationOfAllTargets&&"annotation"===r.mode||w.on("click",(function(a){Qo(n,r)&&(Ko(e,r),es(t,e,n,r,i))})),e.rotator=w;let b=Do("0.0000","tracker-month-title-monitor"),D=p.append("text").text("").attr("id","monitor").attr("class","tracker-month-title-monitor").attr("transform","translate("+3.5*u+","+(A.height+b.height)+")").style("cursor","pointer").style("fill",r.selectedRingColor);e.monitor=D;let k=Do("<","tracker-month-title-arrow");p.append("text").text("<").attr("id","arrowLeft").attr("transform","translate("+5.5*u+","+(g/2+k.height/2)+")").attr("class","tracker-month-title-arrow").on("click",(function(a){Ko(e,r),r.selectedDate="";let l=i.clone().add(-1,"month");es(t,e,n,r,l)})).style("cursor","pointer"),p.append("text").text(">").attr("id","arrowRight").attr("transform","translate("+6.5*u+","+(g/2+k.height/2)+")").attr("class","tracker-month-title-arrow").on("click",(function(a){Ko(e,r);let l=i.clone().add(1,"month");es(t,e,n,r,l)})).style("cursor","pointer"),p.append("text").text("◦").attr("id","arrowToday").attr("transform","translate("+6*u+","+(g/2+k.height/2)+")").attr("class","tracker-month-title-arrow").on("click",(function(i){Ko(e,r);let a=vo(n.dateFormat);es(t,e,n,r,a)})).style("cursor","pointer"),g+=8;let C=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];"mon"===r.startWeekOn.toLowerCase()&&C.push(C.shift());let T=Do(C[0],"tracker-month-weekday");e.graphArea.selectAll("weekDays").data(C).enter().append("text").text((function(t){return t})).attr("transform",(function(t,e){return"translate("+(e+.5)*u+","+(g+T.height)+")"})).attr("class","tracker-month-weekday").attr("text-anchor","middle").style("cursor","default").on("click",(function(t){Ko(e,r)})),g+=T.height+8;let M=null;r.dividingLineColor?M=r.dividingLineColor:r.color&&(M=r.color);let _=e.graphArea.append("rect").attr("x",0).attr("y",g).attr("width",6.5*u+T.width).attr("height",1).attr("class","tracker-month-dividing-line");M&&_.style("fill",M),g+=1,p.attr("height",g),e.header=p,Co(e.dataArea,0,g)}function ts(t,e,n,r,i){if(!n||!r)return;let a=r.mode;if("circle"!==a&&"annotation"!==a)return"Unknown month view mode";let l=r.selectedDataset;if(null===l)return;let o=n.datasets.getDatasetById(l);if(!o)return;let s=r.dataset.findIndex((t=>t===l));l<0&&(s=0);let u=r.threshold[s],c=r.thresholdType[s];qo&&console.log(`threshold: ${u}, thresholdType: ${c}`),i.month(),i.daysInMonth();let h=Do("30","tracker-month-label"),f=2.8*Math.max(h.width,h.height),d=f/2.8*1.8/2,g=(f-2*d)/2,p=m(o.getValues());null!==r.yMin[s]&&(p=r.yMin[s]);let v=y(o.getValues());null!==r.yMax[s]&&(v=r.yMax[s]);let x=!0;(null===v||null===p||v<=p)&&(x=!1);const A=i.clone().startOf("month");let w=A.clone().subtract(A.day(),"days");"mon"===r.startWeekOn.toLowerCase()&&(w=w.add(1,"days"));const b=i.clone().endOf("month");let D=b.clone().add(7-b.day()-1,"days");"mon"===r.startWeekOn.toLowerCase()&&(D=D.add(1,"days"));const k=o.getStartDate(),C=o.getEndDate();let T=r.showAnnotation,M=r.annotation,_=M[s],E=r.showAnnotationOfAllTargets,F=[],S=0,B=0,N=0,L=0,I=w.clone().subtract(1,"days");for(;L<28;){let t=o.getValue(I);if(null==t||!(c===zl.LessThan&&tu))break;L++,I=I.subtract(1,"days")}for(let t=w.clone();t<=D;t.add(1,"days")){t=ho(yo(t,n.dateFormat),n.dateFormat),"2021-09-13"===t.format("YYYY-MM-DD")&&(qo=!1),"mon"===r.startWeekOn.toLowerCase()?(S=t.day()-1,S<0&&(S=6),B=Math.floor(N/7)):(S=t.day(),B=Math.floor(N/7));let e=!0;(t.diff(A)<0||t.diff(b)>0)&&(e=!1);let i=!0;k&&C&&t.diff(k)>=0&&t.diff(C)<=0&&(i=!1);const a=o.getValue(t);qo&&(console.log(o),console.log(yo(t,n.dateFormat)),console.log(a));let l=null!=a;l=c===zl.LessThan?l&&au;let s=null;r.circleColorByValue&&x&&null!==a&&(s=(a-p)/(v-p)),qo&&(console.log(p),console.log(v),console.log(s));let h=o.getValue(t,1),f=o.getValue(t,-1),d=!1;l&&null!==f&&(c===zl.LessThan&&fu)&&(d=!0),l?28!=L&&L++:L=0;let g=!1;l&&null!==h&&(c===zl.LessThan&&hu)&&(g=!0),qo&&(console.log(`preValue: ${f}, curValue: ${a}, nextValue: ${h}`),console.log(r.threshold),console.log(`streakIn: ${d}, streakOut: ${g}`));let y="";if(T)if(E)for(let e of r.dataset){let i=r.dataset.findIndex((t=>t===e));if(i>=0){let a=n.datasets.getDatasetById(e).getValue(t),l=r.thresholdType[i],o=r.threshold[i];null!==a&&(l===zl.LessThan&&ao)&&(y+=M[i])}}else l&&(y=_);F.push({date:yo(t,n.dateFormat),value:a,scaledValue:s,dayInMonth:t.date(),isInThisMonth:e,isOutOfDataRange:i,row:B,col:S,showCircle:l,streakIn:d,streakOut:g,curStreakCount:L,annotation:y}),N++,qo&&(qo=!1)}let V=(S+1)*f,O=Gr().domain([-.5,6.5]).range([0,V]);if("circle"===a&&r.showCircle&&r.showStreak){let t="#69b3a2";r.circleColor?t=r.circleColor:r.color&&(t=r.color),e.dataArea.selectAll("streakIn").data(F.filter((function(t){return t.streakIn}))).enter().append("rect").attr("x",(function(t){return O(t.col)-d-g})).attr("y",(function(t){return O(t.row)-1.5})).attr("width",g).attr("height",3).style("fill",(function(e){return e.showCircle?r.circleColorByValue||r.circleColorByStreak?r.circleColorByValue&&null!==e.scaledValue?xn("white",t)(.8*e.scaledValue+.2):r.circleColorByStreak&&e.curStreakCount>0?xn("white",t)(Math.log10(e.curStreakCount)/Math.log10(28)*.6+.4):"none":t:"none"})).style("opacity",(function(t){return t.isOutOfDataRange||r.dimNotInMonth&&!t.isInThisMonth?.2:1})),e.dataArea.selectAll("streakOut").data(F.filter((function(t){return t.streakOut}))).enter().append("rect").attr("x",(function(t){return O(t.col)+d})).attr("y",(function(t){return O(t.row)-1.5})).attr("width",g).attr("height",3).style("fill",(function(e){return e.showCircle?r.circleColorByValue||r.circleColorByStreak?r.circleColorByValue&&null!==e.scaledValue?xn("white",t)(.8*e.scaledValue+.2):r.circleColorByStreak&&e.curStreakCount>0?xn("white",t)(Math.log10(e.curStreakCount)/Math.log10(28)*.6+.4):"none":t:"none"})).style("opacity",(function(t){return t.isOutOfDataRange||r.dimNotInMonth&&!t.isInThisMonth?.2:1}))}let P="#69b3a2";r.circleColor?P=r.circleColor:r.color&&(P=r.color),"circle"===a&&r.showCircle&&e.dataArea.selectAll("dot").data(F).enter().append("circle").attr("r",d).attr("cx",(function(t){return O(t.col)})).attr("cy",(function(t){return O(t.row)})).style("fill",(function(t){return t.showCircle?r.circleColorByValue||r.circleColorByStreak?r.circleColorByValue&&null!==t.scaledValue?xn("white",P)(.8*t.scaledValue+.2):r.circleColorByStreak&&t.curStreakCount>0?xn("white",P)(Math.log10(t.curStreakCount)/Math.log10(28)*.6+.4):"none":P:"none"})).style("opacity",(function(t){return t.isOutOfDataRange||r.dimNotInMonth&&!t.isInThisMonth?.2:1})).style("cursor","default");let $=yo(window.moment(),n.dateFormat);if("circle"===a&&r.showTodayRing){let t=e.dataArea.selectAll("todayRing").data(F.filter((function(t){return t.date===$}))).enter().append("circle").attr("r",.9*d).attr("cx",(function(t){return O(t.col)})).attr("cy",(function(t){return O(t.row)})).attr("class","tracker-month-today-circle").style("cursor","default");""!==r.todayRingColor?t.style("stroke",r.todayRingColor):t.style("stroke","white")}"circle"===a&&r.showSelectedRing&&e.dataArea.selectAll("selectedRing").data(F).enter().append("circle").attr("r",d).attr("cx",(function(t){return O(t.col)})).attr("cy",(function(t){return O(t.row)})).attr("id",(function(t){return"tracker-selected-circle-"+t.date})).attr("class","tracker-month-selected-circle").style("cursor","default").style("stroke","none"),e.dataArea.selectAll("dayLabel").data(F).enter().append("text").text((function(t){return t.dayInMonth.toString()})).attr("transform",(function(t){return"translate("+O(t.col)+","+(O(t.row)+h.height/4)+")"})).style("fill-opacity",(function(t){return t.isOutOfDataRange||r.dimNotInMonth&&!t.isInThisMonth?.2:1})).attr("date",(function(t){return t.date})).attr("value",(function(t){return t.value})).attr("valueType",(function(t){return Rl[o.valueType]})).attr("class","tracker-month-label").on("click",(function(t){Ko(e,r);let n=Qt(this).attr("date");if(r.selectedDate=n,r.showSelectedRing&&e.dataArea.select("#tracker-selected-circle-"+n).style("stroke",r.selectedRingColor),r.showSelectedValue){let t=Qt(this).attr("value"),n="";if("Time"===Qt(this).attr("valueType")){n=window.moment("00:00","HH:mm",!0).add(parseFloat(t),"seconds").format("HH:mm")}else n=t;e.monitor.text(n)}})).style("cursor","pointer"),"annotation"===a&&T&&e.dataArea.selectAll("dayAnnotation").data(F).enter().append("text").text((function(t){return t.annotation})).attr("transform",(function(t){let e=O(t.col),n=O(t.row)+h.height/4;return t.annotation&&(n+=d),"translate("+e+","+n+")"})).attr("class","tracker-month-annotation");let Y=parseFloat(e.svg.attr("width")),R=parseFloat(e.svg.attr("height")),z=parseFloat(e.graphArea.attr("width")),U=parseFloat(e.graphArea.attr("height")),H=7*f+parseFloat(e.header.attr("height")),X=7*f;H>R&&ko(e.svg,0,H-R),X>Y&&ko(e.svg,X-Y,0),H>U&&ko(e.graphArea,0,H-U),X>z&&ko(e.svg,X-z,0)}function es(t,e,n,r,i){n&&ns&&(Jo(t,e=Zo(e,t,n),n,r,i),ts(0,e,n,r,i),Go(t,e,n))}function ns(t,e,n){if(!e||!ns)return;n.dataset;let r=0;for(let t of e.datasets)t.getQuery().usedAsXDataset||r++;if(0===r)return"No available dataset found";if(Qo(e,n),null===n.selectedDataset)return"No available dataset found";let i={};i=Zo(i,t,e);let a=null;if(n.initMonth){if(a=po(n.initMonth,e.dateFormat),!a){let t=window.moment(n.initMonth,"YYYY-MM",!0);if(!t.isValid())return"Invalid initMonth";a=t}}else a=e.datasets.getDates().last();a&&(Jo(t,i,e,n,a),ts(0,i,e,n,a),Go(t,i,e))}function rs(t,e,n){if(e&&rs)return"Under construction"}function is(t,e,n){if(!e||!n)return;let r=parseFloat(n.dataset);e.datasets.getDatasetById(r),"horizontal"===n.orientation?e.dataAreaSize={width:250,height:24}:"vertical"===n.orientation&&(e.dataAreaSize={width:24,height:250});let i=function(t,e,n){let r={};if(!e||!n)return;let i=Qt(t).append("svg").attr("id","svg").attr("width",e.dataAreaSize.width+e.margin.left+e.margin.right).attr("height",e.dataAreaSize.height+e.margin.top+e.margin.bottom);r.svg=i;let a=i.append("g").attr("id","graphArea").attr("transform","translate("+e.margin.left+","+e.margin.top+")").attr("width",e.dataAreaSize.width+e.margin.right).attr("height",e.dataAreaSize.height+e.margin.bottom);r.graphArea=a;let l=a.append("g").attr("id","dataArea").attr("width",e.dataAreaSize.width).attr("height",e.dataAreaSize.height);return r.dataArea=l,r}(t,e,n),a=function(t,e,n){if(!e||!n)return;let r=n.range,i=r[r.length-1],a=[0,i],l=n.valueUnit,o=function(t){return l&&l.endsWith("%")?jr(0,i,7)(t)+" %":jr(0,i,7)(t)},s=Do(o(i),"tracker-tick-label");if("horizontal"===n.orientation){let n=Gr();n.domain(a).range([0,e.dataAreaSize.width]),t.scale=n;let r=S(n);r.tickFormat(o);let i=t.dataArea.append("g").attr("id","axis").attr("transform","translate(0,"+e.dataAreaSize.height+")").call(r).attr("class","tracker-axis");t.axis=i,i.selectAll("path").style("stroke","none"),i.selectAll("line"),i.selectAll("text").attr("class","tracker-tick-label"),i.attr("width",e.dataAreaSize.width+s.width),i.attr("height",6+s.height),ko(t.svg,+s.width,6+s.height),ko(t.graphArea,+s.width,6+s.height)}else if("vertical"===n.orientation){let n=Gr();n.domain(a).range([e.dataAreaSize.height,0]),t.scale=n;let r=B(n);r.tickFormat(o);let i=t.dataArea.append("g").attr("id","axis").attr("x",0).attr("y",0).call(r).attr("class","tracker-axis");t.axis=i,i.selectAll("path").style("stroke","none"),i.selectAll("line"),i.selectAll("text").attr("class","tracker-tick-label"),i.attr("width",6+s.width),i.attr("height",e.dataAreaSize.width),ko(t.svg,6+s.width,0),ko(t.graphArea,6+s.width,0),Co(t.dataArea,6+s.width,0)}}(i,e,n);if("string"==typeof a)return a;!function(t,e,n){if(!e||!n)return;if(n.title){let r=Do(n.title,"tracker-title-small");if("horizontal"===n.orientation){let i=t.graphArea.append("text").text(n.title).attr("id","title").attr("x",r.width/2).attr("y",e.dataAreaSize.height/2).attr("height",r.height).attr("class","tracker-title-small");t.title=i,ko(t.svg,r.width+6,0),ko(t.graphArea,r.width+6,0),Co(t.dataArea,r.width+6,0)}else if("vertical"===n.orientation){let i=e.dataAreaSize.width/2;r.width>e.dataAreaSize.width&&(ko(t.svg,r.width-e.dataAreaSize.width,0),ko(t.graphArea,r.width-e.dataAreaSize.width,0),Co(t.dataArea,r.width/2-e.dataAreaSize.width/2,0),i=r.width/2);let a=parseFloat(t.axis.attr("width")),l=t.graphArea.append("text").text(n.title).attr("id","title").attr("x",i+a).attr("y",r.height/2).attr("height",r.height).attr("class","tracker-title-small");t.title=l,ko(t.svg,0,r.height+6),ko(t.graphArea,0,r.height+6),Co(t.dataArea,0,r.height+6)}}if(n.valueUnit){let r=Do(n.valueUnit,"tracker-tick-label");if("horizontal"===n.orientation){let i=t.dataArea.append("text").text(n.valueUnit).attr("id","unit").attr("x",-1*(r.width+6)).attr("y",e.dataAreaSize.height+6).attr("height",r.height).attr("class","tracker-tick-label");t.unit=i}else if("vertical"===n.orientation){let i=t.dataArea.append("text").text(n.valueUnit).attr("id","unit").attr("x",e.dataAreaSize.width/2-r.width/2).attr("y",-(r.height/2+6)).attr("height",r.height).attr("class","tracker-tick-label");t.unit=i,ko(t.svg,0,r.height+6),ko(t.graphArea,0,r.height+6),Co(t.dataArea,0,r.height+6)}}}(i,e,n),function(t,e,n){if(!e||!n)return;let r=t.scale,i=n.range,a=n.rangeColor,l=[],o=0;for(let t=0;t=r&&(e=n=r):(e>r&&(e=r),no)&&(o=e.getYMax()),u=e.valueType===Rl.Time,null===s)s=u;else if(u!==s)return"Not all values in time format"}let c=null;"left"===r?c=n.yMin[0]:"right"===r&&(c=n.yMin[1]);let h=!1;"number"!=typeof c?c=l:h=!0;let f=null;"left"===r?f=n.yMax[0]:"right"===r&&(f=n.yMax[1]);let d=!1;if("number"!=typeof f?f=o:d=!0,f0&&(g=0));let v=[g,p];("left"===r&&n.reverseYAxis[0]||"right"===r&&n.reverseYAxis[1])&&(v=[p,g]),m.domain(v).range([e.dataAreaSize.height,0]),"left"===r?t.leftYScale=m:"right"===r&&(t.rightYScale=m);let x="";"left"===r?x=n.yAxisColor[0]:"right"===r&&(x=n.yAxisColor[1]);let A="";"left"===r?A=n.yAxisLabelColor[0]:"right"===r&&(A=n.yAxisLabelColor[1]);let b="";"left"===r?b=n.yAxisLabel[0]:"right"===r&&(b=n.yAxisLabel[1]);let D="",k=null,C=null;"left"===r?(D=n.yAxisUnit[0],k=n.yAxisTickInterval[0],C=n.yAxisTickLabelFormat[0]):"right"===r&&(D=n.yAxisUnit[1],k=n.yAxisTickInterval[1],C=n.yAxisTickLabelFormat[1]);let T,M=null;if(u?M=go(k):(M=parseFloat(k),Number.isNumber(M)&&!Number.isNaN(M)||(M=null)),"left"===r?T=B(m):"right"===r&&(T=F(2,m)),T){let t=function(t,e,n,r=!1){if(r){if(n){function i(t){return window.moment("00:00","HH:mm",!0).add(t,"seconds").format(n)}return i}{function a(n){const r=Math.abs(e-t);let i=window.moment("00:00","HH:mm",!0).add(n,"seconds").format("HH:mm");return r>43200&&(ne||(n-t)/3600%2<1)&&(i=""),i}return a}}if(n){function l(t){return Io.sprintf("%"+n,t)}return l}return jr(t,e,10)}(g,p,C,u);t&&T.tickFormat(t);let e=function(t,e,n,r=!1){const i=Math.abs(e-t);let a=[];r?a=n&&window.moment.isDuration(n)?w(t,e,Math.abs(n.asSeconds())):i>18e3?w(t=3600*Math.floor(t/3600),e=3600*Math.ceil(e/3600),3600):w(t=1800*Math.floor(t/1800),e=1800*Math.ceil(e/1800),1800):n&&"number"==typeof n&&(a=w(t,e,n));return 0===a.length?null:a}(g,p,M,u);e&&T.tickValues(e)}let _=t.dataArea.append("g").attr("id","yAxis").call(T).attr("class","tracker-axis");"right"==r&&_.attr("transform","translate("+e.dataAreaSize.width+" ,0)"),"left"===r?t.leftYAxis=_:"right"===r&&(t.rightYAxis=_);let E=_.selectAll("path");x&&E.style("stroke",x);let S=_.selectAll("line");x&&S.style("stroke",x);let N=_.selectAll("text").attr("class","tracker-tick-label");x&&N.style("fill",x);let L=0;for(let t of N)if(t.textContent){let e=Do(t.textContent,"tracker-axis-label");e.width>L&&(L=e.width)}""!==D&&(b+=" ("+D+")");let I=Do(b),V=_.append("text").text(b).attr("transform","rotate(-90)").attr("x",-1*e.dataAreaSize.height/2).attr("class","tracker-axis-label");"left"===r?V.attr("y",-6-L-I.height/2):V.attr("y",6+L+I.height),A&&V.style("fill",A);let O=I.height+L+6;_.attr("width",O),ko(t.svg,O,0),ko(t.graphArea,O,0),"left"===r&&(Co(t.dataArea,O,0),t.title&&Co(t.title,O,0))}function os(t,e,n,r,i){if(!e||!n)return;let a=null;if("left"===i?a=t.leftYScale:"right"===i&&(a=t.rightYScale),n.showLine[r.getId()]){let e=function(t,e){var n=cl(!0),r=null,i=Nl,a=null,l=Dl(o);function o(o){var s,u,c,h=(o=Sl(o)).length,f=!1;for(null==r&&(a=i(c=l())),s=0;s<=h;++s)!(s0&&(i.style("stroke",n.pointBorderColor[r.getId()]),i.style("stroke-width",n.pointBorderWidth[r.getId()]))),n.allowInspectData&&function(t,e,n){let r=e.dataArea.append("svg").style("opacity",0),i=r.append("rect").attr("x",0).attr("y",0),a=r.append("text"),l=a.append("tspan").attr("class","tracker-tooltip-label"),o=a.append("tspan").attr("class","tracker-tooltip-label"),s=3,u=3;t.on("mouseenter",(function(t){const[e,c]=function(t,e){if(t=function(t){let e;for(;e=t.sourceEvent;)t=e;return t}(t),void 0===e&&(e=t.currentTarget),e){var n=e.ownerSVGElement||e;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=t.clientX,r.y=t.clientY,[(r=r.matrixTransform(e.getScreenCTM().inverse())).x,r.y]}if(e.getBoundingClientRect){var i=e.getBoundingClientRect();return[t.clientX-i.left-e.clientLeft,t.clientY-i.top-e.clientTop]}}return[t.pageX,t.pageY]}(t);let h=0,f=0,d="date: "+Qt(this).attr("date"),g=Do(d,"tracker-tooltip-label");l.text(d),g.width>h&&(h=g.width),f+=g.height,l.attr("x",s).attr("y",f);let p="value: ",y=Qt(this).attr("valueType"),m=Qt(this).attr("value");if("Time"===y){p+=window.moment("00:00","HH:mm",!0).add(parseFloat(m),"seconds").format("HH:mm"),o.text(p)}else p+=m,o.text(p);let v=Do(p,"tracker-tooltip-label");v.width>h&&(h=v.width),f+=u+v.height,o.attr("x",s).attr("y",f),h+=2*s,f+=2*u,a.attr("width",h).attr("height",f),i.attr("width",h).attr("height",f).attr("class","tracker-tooltip");let x=e,A=c,w=12,b=12;x=e+w+h>n.dataAreaSize.width?e-h-w:e+w,A=c-b-f<0?c+b:c-b-f,r.attr("x",x).attr("y",A),r.transition().duration(200).style("opacity",1)})).on("mouseleave",(function(){r.transition().duration(500).style("opacity",0)}))}(i,t,e)}}function us(t,e,n,r,i,a,l){if(!e||!n)return;let o=e.dataAreaSize.width/r.getLength(),s=o,u=a,c=l;o-1>0&&(s=o-1),e.stack?(u=0,c=1):s/=l;let h=null;"left"===i?h=t.leftYScale:"right"===i&&(h=t.rightYScale);let f=t.dataArea.selectAll("bar").data(Array.from(r).filter((function(t){return null!==t.value}))).enter().append("rect").attr("x",(function(e,r){if(0===r&&null===n.xAxisPadding){let n=u+1-c/2;if(n<1)return t.xScale(e.date)-o/2+u*s+n*s}return t.xScale(e.date)-o/2+u*s})).attr("y",(function(t){return h(Math.max(t.value,0))})).attr("width",(function(t,e){if(0===e&&null===n.xAxisPadding){let t=u+1-c/2;return t<0?0:t<1?s*t:s}if(e===r.getLength()-1&&null===n.xAxisPadding){let t=1-(u+1-c/2);return t<0?0:t<1?s*t:s}return s})).attr("height",(function(t){if(null!==t.value)return Math.abs(h(t.value)-h(0))})).attr("class","tracker-bar");n.barColor[r.getId()]&&f.style("fill",n.barColor[r.getId()])}function cs(t,e,n){let r=t.svg;t.graphArea;let i=t.dataArea,a=t.title,l=t.xAxis,o=t.leftYAxis,s=t.rightYAxis,u=0;a&&(u=parseFloat(a.attr("height")));let c=parseFloat(l.attr("height")),h=0;o&&(h=parseFloat(o.attr("width")));let f=0;s&&(f=parseFloat(s.attr("width")));let d=e.datasets,g=d.getXDatasetIds(),p=d.getNames(),y=p.map((function(t){return Do(t,"tracker-legend-label")})),m=0,v=0;for(let t=0;tv&&(v=y[t].width,m=t);let x=v/p[m].length,A=y[m].height,w=p.length-g.length,D=2*x,k=A,C=2*x,T=0,M=0;"vertical"===n.legendOrientation?(T=3*D+C+v,M=(w+1)*k):"horizontal"===n.legendOrientation&&(T=(2*D+C)*w+D+b(y,(function(t,e){return g.includes(e)?0:t.width})),M=k+A);let _=0,E=0;if("top"===n.legendPosition)_=h+e.dataAreaSize.width/2-T/2,E=u,ko(r,0,M+k),Co(i,0,M+k);else if("bottom"===n.legendPosition)_=h+e.dataAreaSize.width/2-T/2,E=u+e.dataAreaSize.height+c+k,ko(r,0,M+k);else if("left"===n.legendPosition)_=0,E=u+e.dataAreaSize.height/2-M/2,ko(r,T+D,0),Co(i,T+D,0);else{if("right"!==n.legendPosition)return;_=e.dataAreaSize.width+h+f+D,E=u+e.dataAreaSize.height/2-M/2,ko(r,T+D,0)}let F=t.graphArea.append("g").attr("id","legend").attr("transform","translate("+_+","+E+")"),S=F.append("rect").attr("class","tracker-legend").attr("width",T).attr("height",M);n.legendBgColor&&S.style("fill",n.legendBgColor),n.legendBorderColor&&S.style("stroke",n.legendBorderColor);let B=D,N=A,L=B+D+C,I=N;if("vertical"===n.legendOrientation){n.GetGraphType()===Yl.Line?(F.selectAll("markers").data(p).enter().append("line").attr("x1",B).attr("x2",B+C).attr("y1",(function(t,e){let n=g.filter((t=>ttttt!g.includes(e)))).enter().append("rect").attr("x",(function(t,e){let n=D;for(let[t,r]of y.entries())if(!g.includes(t)){if(!(t=0;t--){if(l.includes(t))continue;let e=n.yAxisLocation[t];"left"===e.toLowerCase()?i.push(t):"right"===e.toLocaleLowerCase()&&a.push(t)}else for(let t=0;ta.length;)a.push(r);if(null==e);else if("object"==typeof e&&null!==e){if(Array.isArray(e)){if(e.length>n)return l="Too many inputs for parameter '"+t+"'",l;if(0===e.length)return l="Empty array not allowd for "+t,l;for(let n=0;n0&&(s=e[n-1].trim()),"string"==typeof i){if(i=i.trim(),""!==i){l="Invalid inputs for "+t;break}a[n]=null!==s?s:r}else{if("boolean"!=typeof i){l="Invalid inputs for "+t;break}a[n]=i,o++}}else{let t=e[e.length-1];a[n]=o>0?t:r}}}else if("string"==typeof e){let i=As(e);if(i.length>1){if(i.length>n)return l="Too many inputs for parameter '"+t+"'",l;for(let e=0;e0&&(s=ys(i[e-1].trim())),""===n)a[e]=null!==s?s:r;else{let r=ys(n);if(null===r){l="Invalid inputs for "+t;break}a[e]=r,o++}}else{let t=ys(i[i.length-1].trim());a[e]=o>0&&null!==t?t:r}}else if(""===e);else{let n=ys(e);if(null!==n){a[0]=n,o++;for(let t=1;ta.length;)a.push(r);if(null==e);else if("object"==typeof e&&null!==e){if(Array.isArray(e)){if(e.length>n)return l="Too many inputs for parameter '"+t+"'",l;if(0===e.length)return l="Empty array not allowd for "+t,l;for(let n=0;n0&&(s=e[n-1].trim()),"string"==typeof i){if(i=i.trim(),""!==i){l="Invalid inputs for "+t;break}a[n]=null!==s?s:r}else{if("number"!=typeof i){l="Invalid inputs for "+t;break}a[n]=i,o++}}else{let t=e[e.length-1];a[n]=o>0?t:r}}}else if("string"==typeof e){let i=As(e);if(i.length>1){if(i.length>n)return l="Too many inputs for parameter '"+t+"'",l;for(let n=0;n0&&(s=bo(i[n-1].trim()).value),""===e)null!==s&&Number.isNumber(s)?a[n]=s:a[n]=r;else{let r=bo(e).value;if(null===r){l="Invalid inputs for "+t;break}a[n]=r,o++}}else{let t=bo(i[e.length-1].trim()).value;a[n]=o>0&&null!==t?t:r}}else if(""===e);else{let n=bo(e).value;if(null!==n){a[0]=n,o++;for(let t=1;tl.length;)l.push(r);if(null==e);else if("object"==typeof e&&null!==e){if(Array.isArray(e)){if(e.length>n)return o="Too many inputs for parameter '"+t+"'",o;if(0===e.length)return o="Empty array not allowd for "+t,o;for(let n=0;n0&&(u=e[n-1].trim()),"string"!=typeof a){o="Invalid inputs for "+t;break}if(a=a.trim(),""===a)l[n]=null!==u?u:r;else if(i){if(!i(a)){o="Invalid inputs for "+t;break}l[n]=a,s++}else l[n]=a,s++}else{let t=e[e.length-1].trim();l[n]=s>0?t:r}}}else if("string"==typeof e){let a=As(e);if(a.length>1){if(a.length>n)return o="Too many inputs for parameter '"+t+"'",o;for(let e=0;e0&&(u=a[e-1].trim()),""===n)l[e]=null!==u?u:r;else if(i){if(!i(n)){o="Invalid inputs for "+t;break}l[e]=n,s++}else l[e]=n,s++}else{let t=a[a.length-1].trim();l[e]=s>0?t:r}}else if(""===e);else if(i)if(i(e)){l[0]=e,s++;for(let t=1;t1)for(let e of r){let r=parseFloat(e.trim());if(Number.isNaN(r)){return`Parameter '${t}' accepts only numbers`}n.push(r)}else{if(""===e){return`Empty ${t} is not allowed.`}{let r=parseFloat(e);if(!Number.isNumber(r)){return`Parameter '${t}' accepts only numbers`}n.push(r)}}}else{if("number"!=typeof e){return`Invalid ${t}`}n.push(e)}return n}function Ts(t,e){let n=[];if(null==e)return n;if("object"==typeof e){if(Array.isArray(e))for(let t of e)"string"==typeof t&&n.push(t.trim())}else{if("string"!=typeof e){return`Invalid ${t}`}{let r=As(e);if(r.length>1)for(let t of r)n.push(t.trim());else{if(""===e){return`Empty ${t} is not allowed.`}n.push(e)}}}for(let t=0;t2)return"yAxisLabel accepts not more than two values for left and right y-axes";e.yAxisLabel=n;let r=ks("yAxisColor",null==t?void 0:t.yAxisColor,2,"",xs,!0);if("string"==typeof r)return r;if(r.length>2)return"yAxisColor accepts not more than two values for left and right y-axes";e.yAxisColor=r;let i=ks("yAxisLabelColor",null==t?void 0:t.yAxisLabelColor,2,"",xs,!0);if("string"==typeof i)return i;if(i.length>2)return"yAxisLabelColor accepts not more than two values for left and right y-axes";e.yAxisLabelColor=i;let a=ks("yAxisUnit",null==t?void 0:t.yAxisUnit,2,"",null,!0);if("string"==typeof a)return a;if(a.length>2)return"yAxisUnit accepts not more than two values for left and right y-axes";e.yAxisUnit=a,e.xAxisTickInterval=Ds(null==t?void 0:t.xAxisTickInterval,e.xAxisTickInterval);let l=ks("yAxisTickInterval",null==t?void 0:t.yAxisTickInterval,2,null,null,!0);if("string"==typeof l)return l;if(l.length>2)return"yAxisTickInterval accepts not more than two values for left and right y-axes";e.yAxisTickInterval=l,e.xAxisTickLabelFormat=Ds(null==t?void 0:t.xAxisTickLabelFormat,e.xAxisTickLabelFormat);let o=ks("yAxisTickLabelFormat",null==t?void 0:t.yAxisTickLabelFormat,2,null,null,!0);if("string"==typeof o)return o;if(o.length>2)return"yAxisTickLabelFormat accepts not more than two values for left and right y-axes";e.yAxisTickLabelFormat=o;let s=bs("yMin",null==t?void 0:t.yMin,2,null);if("string"==typeof s)return s;if(s.length>2)return"yMin accepts not more than two values for left and right y-axes";e.yMin=s;let u=bs("yMax",null==t?void 0:t.yMax,2,null);if("string"==typeof u)return u;if(u.length>2)return"yMax accepts not more than two values for left and right y-axes";e.yMax=u;let c=ws("reverseYAxis",null==t?void 0:t.reverseYAxis,2,!1);return"string"==typeof c?c:c.length>2?"reverseYAxis accepts not more than two values for left and right y-axes":void(e.reverseYAxis=c)}function _s(t){let e=[];if(null!==t){const n=Object.keys(t);for(let t of n)e.push(t.toString())}return e}function Es(t,e){return ho(co(t.basename,e.dateFormatPrefix,e.dateFormatSuffix),e.dateFormat)}function Fs(t,e,n){let r=window.moment(""),i=t.frontmatter;if(i&&xo(i,e.getTarget())){let t=xo(i,e.getTarget());"string"==typeof t&&(t=co(t,n.dateFormatPrefix,n.dateFormatSuffix),r=ho(t,n.dateFormat))}return r}function Ss(t,e,n){let r,i=window.moment(""),a=new RegExp(e,"gm");for(;r=a.exec(t);)if(void 0!==r.groups&&void 0!==r.groups.value){let t=r.groups.value.trim();if(t=co(t,n.dateFormatPrefix,n.dateFormatSuffix),i=ho(t,n.dateFormat),i.isValid())return i}return i}function Bs(t,e,n){window.moment("");let r=e.getTarget();return e.getParentTarget()&&(r=e.getParentTarget()),Ss(t,"(^|\\s)#"+r+"(\\/[\\w-]+)*(:(?[\\d\\.\\/-]*)[a-zA-Z]*)?([\\.!,\\?;~-]*)?(\\s|$)",n)}function Ns(t,e,n){return window.moment(""),Ss(t,e.getTarget(),n)}function Ls(t,e,n){window.moment("");let r=e.getTarget();return e.getParentTarget()&&(r=e.getParentTarget()),r=r.replace("-","[\\s\\-]"),Ss(t,"(^| |\\t)\\*{0,2}"+r+"\\*{0,2}(::[ |\\t]*(?[\\d\\.\\/\\-\\w,@; \\t:]*))(\\r\\?\\n|\\r|$)",n)}function Is(e,n,r){let i=window.moment("");if(e&&e instanceof t.TFile){let t=n.getTarget();if("cDate"===t){i=mo(e.stat.ctime,r.dateFormat)}else if("mDate"===t){i=mo(e.stat.mtime,r.dateFormat)}else"name"===t&&(i=Es(e,r))}return i}function Vs(t,e,n){window.moment("");let r=e.getType(),i=e.getTarget();return i=r===$l.Task?"\\[[\\sx]\\]\\s"+i:r===$l.TaskDone?"\\[x\\]\\s"+i:r===$l.TaskNotDone?"\\[\\s\\]\\s"+i:"\\[[\\sx]\\]\\s"+i,Ss(t,i,n)}function Os(t,e,n,r){if(t.has(e)){t.get(e).push({query:n,value:r})}else{let i=new Array;i.push({query:n,value:r}),t.set(e,i)}}function Ps(t,e,n,r,i,a){let l,o=new RegExp(e,"gmu"),s=0,u=!1;for(;l=o.exec(t);)if(a.ignoreAttachedValue[n.getId()])s+=a.constValue[n.getId()],u=!0,n.addNumTargets();else if(void 0!==l.groups&&void 0!==l.groups.value){let t=l.groups.value.trim().split(n.getSeparator());if(!t)continue;if(1===t.length){let e=bo(t[0].trim(),a.textValueMap);null!==e.value&&(e.type===Rl.Time?(s=e.value,u=!0,n.valueType=Rl.Time,n.addNumTargets()):a.ignoreZeroValue[n.getId()]&&0===e.value||(s+=e.value,u=!0,n.addNumTargets()))}else if(t.length>n.getAccessor()&&n.getAccessor()>=0){let e=bo(t[n.getAccessor()].trim(),a.textValueMap);null!==e.value&&(e.type===Rl.Time?(s=e.value,u=!0,n.valueType=Rl.Time,n.addNumTargets()):(s+=e.value,u=!0,n.addNumTargets()))}}else s+=a.constValue[n.getId()],u=!0,n.addNumTargets();if(u){return Os(r,i.get(a.xDataset[n.getId()]),n,s),!0}return!1}function $s(e,n,r,i,a,l){if(e&&e instanceof t.TFile){let t=r.getTarget(),o=l.get(i.xDataset[r.getId()]);if("cDate"===t){let t=e.stat.ctime;return r.valueType=Rl.Date,r.addNumTargets(),Os(a,o,r,t),!0}if("mDate"===t){let t=e.stat.mtime;return r.valueType=Rl.Date,r.addNumTargets(),Os(a,o,r,t),!0}if("size"===t){let t=e.stat.size;return r.addNumTargets(),Os(a,o,r,t),!0}if("numWords"===t){return Os(a,o,r,function(t){t=To(t);var e=new RegExp(["(?:[0-9]+(?:(?:,|\\.)[0-9]+)*|[\\-"+/A-Za-z\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B4\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AD\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC/.source+"])+",/[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u4E00-\u9FD5]{1}/.source].join("|"),"g");return(t.match(e)||[]).length}(n)),!0}if("numChars"===t){let t=n.length;return r.addNumTargets(),Os(a,o,r,t),!0}if("numSentences"===t){let t=function(t){return(((t=To(t))||"").match(/[^.。!!??\s][^.。!!??]*(?:[.!?](?!['‘’"“”「」『』]?\s|$)[^.。!!??]*)*[.。!!??]?['’"”」』]?(?=\s||$)/gm)||[]).length}(n);return r.addNumTargets(),Os(a,o,r,t),!0}if("name"===t){let t=0,n=!1,l=bo(e.basename,i.textValueMap);null!==l.value&&(l.type===Rl.Time?(t=l.value,n=!0,r.valueType=Rl.Time,r.addNumTargets()):i.ignoreZeroValue[r.getId()]&&0===l.value||(t+=l.value,n=!0,r.addNumTargets()));let s=null;if(n&&(s=t),null!==s)return Os(a,o,r,s),!0}}return!1}const Ys={folder:"/",dateFormat:"YYYY-MM-DD"};class Rs extends t.PluginSettingTab{constructor(t,e){super(t,e),this.plugin=e}display(){let{containerEl:e}=this;e.empty(),new t.Setting(e).setName("Default folder location").setDesc("Files in this folder will be parsed and used as input data of the tracker plugin.\nYou can also override it using 'folder' argument in the tracker codeblock.").addText((t=>t.setPlaceholder("Folder Path").setValue(this.plugin.settings.folder).onChange((async t=>{this.plugin.settings.folder=t,await this.plugin.saveSettings()})))),new t.Setting(e).setName("Default date format").setDesc("This format is used to parse the date in your diary title.\nYou can also override it using 'dateFormat' argument in the tracker codeblock.").addText((t=>t.setPlaceholder("YYYY-MM-DD").setValue(this.plugin.settings.dateFormat).onChange((async t=>{this.plugin.settings.dateFormat=t,await this.plugin.saveSettings()}))))}}class zs extends t.Plugin{async onload(){console.log("loading obsidian-tracker plugin"),await this.loadSettings(),this.addSettingTab(new Rs(this.app,this)),this.registerMarkdownCodeBlockProcessor("tracker",this.postprocessor.bind(this)),this.addCommand({id:"add-line-chart-tracker",name:"Add Line Chart Tracker",callback:()=>this.addCodeBlock(Yl.Line)}),this.addCommand({id:"add-bar-chart-tracker",name:"Add Bar Chart Tracker",callback:()=>this.addCodeBlock(Yl.Bar)}),this.addCommand({id:"add-summary-tracker",name:"Add Summary Tracker",callback:()=>this.addCodeBlock(Yl.Summary)})}async loadSettings(){this.settings=Object.assign({},Ys,await this.loadData())}async saveSettings(){await this.saveData(this.settings)}renderErrorMessage(t,e,n){!function(t,e){Qt(t).select("#svg").remove(),Qt(t).append("div").text(e).style("background-color","white").style("margin-bottom","20px").style("padding","10px").style("color","red")}(e,t),n.appendChild(e)}onunload(){console.log("unloading obsidian-tracker plugin")}getFilesInFolder(e,n=!0){let r=[];for(let i of e.children)i instanceof t.TFile?"md"===i.extension&&r.push(i):i instanceof t.TFolder&&n&&(r=r.concat(this.getFilesInFolder(i)));return r}async getFiles(e,n,r=!0){if(!e)return;let i=n.folder,a=n.specifiedFilesOnly,l=n.file,o=n.fileContainsLinkedFiles,s=n.fileMultiplierAfterLink;if(!a){let n=this.app.vault.getAbstractFileByPath(t.normalizePath(i));if(n&&n instanceof t.TFolder){let t=this.getFilesInFolder(n);for(let n of t)e.push(n)}}for(let n of l){let r=n;r.endsWith(".md")||(r+=".md"),r=t.normalizePath(r);let i=this.app.vault.getAbstractFileByPath(r);i&&i instanceof t.TFile&&e.push(i)}let u=1,c=!0;""===s?c=!1:/^[0-9]+$/.test(s)?(u=parseFloat(s),c=!1):/\?/.test(s)||(c=!1);for(let r of o){r.endsWith(".md")||(r+=".md");let i=this.app.vault.getAbstractFileByPath(t.normalizePath(r));if(i&&i instanceof t.TFile){let a=this.app.metadataCache.getFileCache(i),l=(await this.app.vault.adapter.read(i.path)).split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/);if(!(null==a?void 0:a.links))continue;for(let i of a.links){if(!i)continue;let a=this.app.metadataCache.getFirstLinkpathDest(i.link,r);if(a&&a instanceof t.TFile){if(c){let t=i.position.end.line;if(t>=0&&t1)for(let e of t){if(e=e.trim(),""===e){a="Empty search target is not allowed.";break}l.push(e)}else""===r.searchTarget?a="Empty search target is not allowed.":l.push(r.searchTarget)}else a="Invalid search target (searchTarget)";for(let t=0;tt!==$l.Table)).length>0)return"searchType 'table' doesn't work with other types for now";let c=[],h=ks("separator",r.separator,o,"",null,!0);if("string"==typeof h)return h;c=h.map((t=>"comma"===t||"\\,"===t?",":t));let f=bs("xDataset",r.xDataset,o,-1);if("string"==typeof f)return f;let d=f.map((t=>t<0||t>=o?-1:t)),g=[];for(let t=0;tt.getId()===e)))return a="Duplicated dataset id for key '"+t+"'",a;C.push(t),m.push(t)}for(let t of i)if(!y.includes(t)&&!m.includes(t))return a="'"+t+"' is not an available key",a;if(0===v.length+x.length+A.length+w.length+k.length+b.length+D.length)return"No output parameter provided, please place line, bar, pie, month, bullet, or summary.";p.folder=Ds(null==r?void 0:r.folder,n.settings.folder),""===p.folder.trim()&&(p.folder=n.settings.folder);let T=n.app.vault.getAbstractFileByPath(t.normalizePath(p.folder));if(!(T&&T instanceof t.TFolder))return"Folder '"+p.folder+"' doesn't exist";if("string"==typeof r.file){let t=Ts("file",r.file);if("string"==typeof t)return t;p.file=t}if("boolean"==typeof r.specifiedFilesOnly&&(p.specifiedFilesOnly=r.specifiedFilesOnly),"string"==typeof r.fileContainsLinkedFiles){let t=Ts("fileContainsLinkedFiles",r.fileContainsLinkedFiles);if("string"==typeof t)return t;p.fileContainsLinkedFiles=t}p.fileMultiplierAfterLink=Ds(null==r?void 0:r.fileMultiplierAfterLink,p.fileMultiplierAfterLink);const M=r.dateFormat;if("string"==typeof r.dateFormat?""===r.dateFormat?p.dateFormat=n.settings.dateFormat:p.dateFormat=M:p.dateFormat=n.settings.dateFormat,p.dateFormatPrefix=Ds(null==r?void 0:r.dateFormatPrefix,p.dateFormatPrefix),p.dateFormatSuffix=Ds(null==r?void 0:r.dateFormatSuffix,p.dateFormatSuffix),"string"==typeof r.startDate){if(/^([\-]?[0-9]+[\.][0-9]+|[\-]?[0-9]+)m$/.test(r.startDate))return"'m' for 'minute' is too small for parameter startDate, please use 'd' for 'day' or 'M' for month";let t=co(r.startDate,p.dateFormatPrefix,p.dateFormatSuffix),e=null,n=!1;if(e=po(t,p.dateFormat),e?n=!0:(e=ho(t,p.dateFormat),e.isValid()&&(n=!0)),!n||null===e)return"Invalid startDate, the format of startDate may not match your dateFormat "+p.dateFormat;p.startDate=e}if("string"==typeof r.endDate){if(/^([\-]?[0-9]+[\.][0-9]+|[\-]?[0-9]+)m$/.test(r.endDate))return"'m' for 'minute' is too small for parameter endDate, please use 'd' for 'day' or 'M' for month";let t=co(r.endDate,p.dateFormatPrefix,p.dateFormatSuffix),e=null,n=!1;if(e=po(t,p.dateFormat),e?n=!0:(e=ho(t,p.dateFormat),e.isValid()&&(n=!0)),!n||null===e)return"Invalid endDate, the format of endDate may not match your dateFormat "+p.dateFormat;p.endDate=e}if(null!==p.startDate&&p.startDate.isValid()&&null!==p.endDate&&p.endDate.isValid()&&p.endDateparseInt(t,10))),2==e.length&&(p.aspectRatio=new io(e[0],e[1]),p.dataAreaSize=p.aspectRatio.recalculateSize(p.dataAreaSize))}let O=bs("margin",r.margin,4,10);if("string"==typeof O)return O;if(O.length>4)return"margin accepts not more than four values for top, right, bottom, and left margins.";p.margin=new ao(O[0],O[1],O[2],O[3]);for(let t of C){let e=new ql,n=r[t],i=_s(e),l=_s(n);for(let t of l)if(!i.includes(t))return a="'"+t+"' is not an available key",a;let o=-1,s=t.replace("dataset","");o=""===s?0:parseFloat(s),e.id=o,e.name=Ds(null==n?void 0:n.name,e.name);let u=Ts("xData",null==n?void 0:n.xData);if("string"==typeof u)return u;e.xData=u;let c=e.xData.length,h=Ts("yData",null==n?void 0:n.yData);if("string"==typeof h)return h;if(e.yData=h,e.yData.length!==c)return"Number of elements in xData and yData not matched";p.customDataset.push(e)}for(let t of v){let e=new Ql,n=r[t],i=_s(e),l=_s(n);for(let t of l)if(!i.includes(t))return a="'"+t+"' is not an available key",a;let s=Ms(n,e);if("string"==typeof s)return s;let u=ks("lineColor",null==n?void 0:n.lineColor,o,"",xs,!0);if("string"==typeof u)return u;e.lineColor=u;let c=bs("lineWidth",null==n?void 0:n.lineWidth,o,1.5);if("string"==typeof c)return c;e.lineWidth=c;let h=ws("showLine",null==n?void 0:n.showLine,o,!0);if("string"==typeof h)return h;e.showLine=h;let f=ws("showPoint",null==n?void 0:n.showPoint,o,!0);if("string"==typeof f)return f;e.showPoint=f;let d=ks("pointColor",null==n?void 0:n.pointColor,o,"#69b3a2",xs,!0);if("string"==typeof d)return d;e.pointColor=d;let g=ks("pointBorderColor",null==n?void 0:n.pointBorderColor,o,"#69b3a2",xs,!0);if("string"==typeof g)return g;e.pointBorderColor=g;let y=bs("pointBorderWidth",null==n?void 0:n.pointBorderWidth,o,0);if("string"==typeof y)return y;e.pointBorderWidth=y;let m=bs("pointSize",null==n?void 0:n.pointSize,o,3);if("string"==typeof m)return m;e.pointSize=m;let v=ws("fillGap",null==n?void 0:n.fillGap,o,!1);if("string"==typeof v)return v;e.fillGap=v;let x=ks("yAxisLocation",null==n?void 0:n.yAxisLocation,o,"left",vs,!0);if("string"==typeof x)return x;e.yAxisLocation=x,p.line.push(e)}for(let t of x){let e=new Zl,n=r[t],i=_s(e),l=_s(n);for(let t of l)if(!i.includes(t))return a="'"+t+"' is not an available key",a;let s=Ms(n,e);if("string"==typeof s)return s;let u=ks("barColor",null==n?void 0:n.barColor,o,"",xs,!0);if("string"==typeof u)return u;e.barColor=u;let c=ks("yAxisLocation",null==n?void 0:n.yAxisLocation,o,"left",vs,!0);if("string"==typeof c)return c;e.yAxisLocation=c;let h=Ds(null==n?void 0:n.xAxisPadding,null);e.xAxisPadding=h,p.bar.push(e)}for(let t of A){let e=new Kl,n=r[t],i=_s(e),l=_s(n);for(let t of l)if(!i.includes(t))return a="'"+t+"' is not an available key",a;e.title=Ds(null==n?void 0:n.title,e.title);let o=Ts("data",null==n?void 0:n.data);if("string"==typeof o)return o;e.data=o;let s=e.data.length,u=ks("dataColor",null==n?void 0:n.dataColor,s,null,xs,!0);if("string"==typeof u)return u;e.dataColor=u;let c=ks("dataName",null==n?void 0:n.dataName,s,"",null,!0);if("string"==typeof c)return c;e.dataName=c;let h=ks("label",null==n?void 0:n.label,s,"",null,!0);if("string"==typeof h)return h;e.label=h,"number"==typeof(null==n?void 0:n.hideLabelLessThan)&&(e.hideLabelLessThan=n.hideLabelLessThan);let f=ks("extLabel",null==n?void 0:n.extLabel,s,"",null,!0);if("string"==typeof f)return f;e.extLabel=f,"boolean"==typeof(null==n?void 0:n.showExtLabelOnlyIfNoLabel)&&(e.showExtLabelOnlyIfNoLabel=n.showExtLabelOnlyIfNoLabel),"number"==typeof(null==n?void 0:n.ratioInnerRadius)&&(e.ratioInnerRadius=n.ratioInnerRadius),"boolean"==typeof(null==n?void 0:n.showLegend)&&(e.showLegend=n.showLegend),e.legendPosition=Ds(null==n?void 0:n.legendPosition,"right");let d="horizontal";d="top"===e.legendPosition||"bottom"===e.legendPosition?"horizontal":"left"===e.legendPosition||"right"===e.legendPosition?"vertical":"horizontal",e.legendOrientation=Ds(null==n?void 0:n.legendOrientation,d),e.legendBgColor=Ds(null==n?void 0:n.legendBgColor,e.legendBgColor),e.legendBorderColor=Ds(null==n?void 0:n.legendBorderColor,e.legendBorderColor),p.pie.push(e)}for(let t of w){let e=new Jl,n=r[t],i=_s(e),l=_s(n);for(let t of l)if(!i.includes(t))return a="'"+t+"' is not an available key",a;e.template=Ds(null==n?void 0:n.template,e.template),e.style=Ds(null==n?void 0:n.style,e.style),p.summary.push(e)}for(let t of b){let e=new to,n=r[t],i=_s(e),l=_s(n);for(let t of l)if(!i.includes(t))return a="'"+t+"' is not an available key",a;e.mode=Ds(null==n?void 0:n.mode,e.mode);let o=Cs("dataset",null==n?void 0:n.dataset);if("string"==typeof o)return o;if(0===o.length)for(let t of g)o.push(t.getId());e.dataset=o;let s=e.dataset.length;e.startWeekOn=Ds(null==n?void 0:n.startWeekOn,e.startWeekOn),"boolean"==typeof(null==n?void 0:n.showCircle)&&(e.showCircle=n.showCircle);let u=Cs("threshold",null==n?void 0:n.threshold);if("string"==typeof u)return u;if(e.threshold=u,0===e.threshold.length)for(let t=0;t1))return a="Empty range is not allowed",a;{let t=s[0];if(t<0)return a="Negative range value is not allowed",a;for(let e=1;e{let e=null;u.queries.some((t=>{let e=t.getType();return t.getTarget(),e===$l.Frontmatter||e===$l.Tag||e===$l.Wiki||e===$l.WikiLink||e===$l.WikiDisplay}))&&(e=this.app.metadataCache.getFileCache(t));let n=null;u.queries.some((t=>{let e=t.getType(),n=t.getTarget();return e===$l.Tag||e===$l.Text||e===$l.dvField||e===$l.Task||e===$l.TaskDone||e===$l.TaskNotDone||e===$l.FileMeta&&("numWords"===n||"numChars"===n||"numSentences"===n)}))&&(n=await this.app.vault.adapter.read(t.path));let r=new Map,i=!1;for(let a of u.xDataset)if(!r.has(a)){let l=window.moment("");if(-1===a)l=Es(t,u);else{let r=u.queries[a];switch(r.getType()){case $l.Frontmatter:l=Fs(e,r,u);break;case $l.Tag:l=Bs(n,r,u);break;case $l.Text:l=Ns(n,r,u);break;case $l.dvField:l=Ls(n,r,u);break;case $l.FileMeta:l=Is(t,r,u);break;case $l.Task:case $l.TaskDone:case $l.TaskNotDone:l=Vs(n,r,u)}}l.isValid()?(null!==u.startDate&&lu.endDate&&(i=!0,f.fileOutOfDateRange++)):(i=!0,f.fileNotInFormat++),i||(f.gotAnyValidXValue||(f.gotAnyValidXValue=!0),r.set(a,yo(l,u.dateFormat)),f.fileAvailable++,1==f.fileAvailable?(f.minDate=l.clone(),f.maxDate=l.clone()):(lf.maxDate&&(f.maxDate=l.clone())))}if(i)return;const a=u.queries.filter((t=>t.getType()!==$l.Table&&!t.usedAsXDataset)).map((async i=>{if(e&&i.getType()===$l.Tag){let t=function(t,e,n,r,i){let a=t.frontmatter,l=[];if(a&&a.tags){let t=0,o=!1;if(Array.isArray(a.tags))l=l.concat(a.tags);else if("string"==typeof a.tags){let t=a.tags.split(e.getSeparator(!0));for(let e of t){let t=e.trim();""!==t&&l.push(t)}}for(let a of l){if(a===e.getTarget())t+=n.constValue[e.getId()],o=!0,e.addNumTargets();else{if(!a.startsWith(e.getTarget()+"/"))continue;t+=n.constValue[e.getId()],o=!0,e.addNumTargets()}let l=null;return o&&(l=t),Os(r,i.get(n.xDataset[e.getId()]),e,l),!0}}return!1}(e,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}if(e&&i.getType()===$l.Frontmatter&&"tags"!==i.getTarget()){let t=function(t,e,n,r,i){let a=t.frontmatter;if(a){let t=xo(a,e.getTarget());if(t){let a=bo(t,n.textValueMap);if(null===a.value&&("true"!==t&&"false"!==t||(a.type=Rl.Number,a.value="true"===t?1:0)),null!==a.value)return a.type===Rl.Time&&(e.valueType=Rl.Time),e.addNumTargets(),Os(r,i.get(n.xDataset[e.getId()]),e,a.value),!0}else if(e.getParentTarget()&&xo(a,e.getParentTarget())){let t=xo(a,e.getParentTarget()),l=null;if(Array.isArray(t)?l=t.map((t=>t.toString())):"string"==typeof t&&(l=t.split(e.getSeparator())),l&&l.length>e.getAccessor()&&e.getAccessor()>=0){let t=bo(l[e.getAccessor()].trim(),n.textValueMap);if(null!==t.value)return t.type===Rl.Time&&(e.valueType=Rl.Time),e.addNumTargets(),Os(r,i.get(n.xDataset[e.getId()]),e,t.value),!0}}}return!1}(e,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}if(e&&(i.getType()===$l.Wiki||i.getType()===$l.WikiLink||i.getType()===$l.WikiDisplay)){let t=function(t,e,n,r,i){let a=t.links;if(!a)return!1;let l=e.getTarget(),o=e.getType(),s="",u=l;for(let t of a){if(!t)continue;let e="";o===$l.Wiki?e=t.displayText?t.displayText:t.link:o===$l.WikiLink?e=t.link:o===$l.WikiDisplay?t.displayText&&(e=t.displayText):e=t.displayText?t.displayText:t.link,e=e.trim(),s+=e+"\n"}return Ps(s,u,e,r,i,n)}(e,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}if(n&&i.getType()===$l.Tag){let t=function(t,e,n,r,i){let a=e.getTarget();return e.getParentTarget()&&(a=e.getParentTarget()),a.length>1&&a.startsWith("#")&&(a=a.substring(1)),Ps(t,"(^|\\s)#"+a+"(\\/[\\w-]+)*(:(?[\\d\\.\\/-]*)[a-zA-Z]*)?([\\.!,\\?;~-]*)?(\\s|$)",e,r,i,n)}(n,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}if(n&&i.getType()===$l.Text){let t=function(t,e,n,r,i){return Ps(t,e.getTarget(),e,r,i,n)}(n,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}if(i.getType()===$l.FileMeta){let e=$s(t,n,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=e)}if(n&&i.getType()===$l.dvField){let t=function(t,e,n,r,i){let a=e.getTarget();return e.getParentTarget()&&(a=e.getParentTarget()),a=a.replace("-","[\\s\\-]"),Ps(t,String.raw`(^| |\t|\|)(\[|\()?\*{0,2}`+a+String.raw`\*{0,2}(::[ |\t]*(?[\p{ExtPict}\d\.\/\-\w,@; \t:`+"\\w$€£¥¢₹₨₱₩฿₫₪α-ωΑ-Ω©®℗™℠一-鿿㐀-䶿 、-〿"+String.raw`]*)(\]|\))?)`,e,r,i,n)}(n,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}if(n&&(i.getType()===$l.Task||i.getType()===$l.TaskDone||i.getType()===$l.TaskNotDone)){let t=function(t,e,n,r,i){let a=e.getType(),l=e.getTarget();return l=a===$l.Task?"\\[[\\sx]\\]\\s"+l:a===$l.TaskDone?"\\[x\\]\\s"+l:a===$l.TaskNotDone?"\\[\\s\\]\\s"+l:"\\[[\\sx]\\]\\s"+l,Ps(t,l,e,r,i,n)}(n,i,u,h,r);f.gotAnyValidYValue||(f.gotAnyValidYValue=t)}}));await Promise.all(a)}));if(await Promise.all(d),await this.collectDataFromTable(h,u,f),f.errorMessage)return this.renderErrorMessage(f.errorMessage,i,n);let g="";if(f.minDate.isValid()&&f.maxDate.isValid()&&0!==f.fileAvailable&&f.gotAnyValidXValue||(g="No valid date as X value found in notes",f.fileOutOfDateRange>0&&(g+=`\n${f.fileOutOfDateRange} files are out of the date range.`),f.fileNotInFormat&&(g+=`\n${f.fileNotInFormat} files are not in the right format.`)),null===u.startDate&&null===u.endDate?(u.startDate=f.minDate.clone(),u.endDate=f.maxDate.clone()):null!==u.startDate&&null===u.endDate?u.startDatef.minDate?u.startDate=f.minDate.clone():g="Invalid date range":(u.startDatef.maxDate&&u.endDate>f.maxDate)&&(g="Invalid date range"),g)return this.renderErrorMessage(g,i,n);if(!f.gotAnyValidYValue)return this.renderErrorMessage("No valid Y value found in notes",i,n);let p=new Wl(u.startDate,u.endDate);for(let t of u.queries){let e=p.createDataset(t,u);e.addNumTargets(t.getNumTargets());for(let n=u.startDate.clone();n<=u.endDate;n.add(1,"days"))if(h.has(yo(n,u.dateFormat))){let r=h.get(yo(n,u.dateFormat)).filter((function(e){return e.query.equalTo(t)}));if(r.length>0){let t=null;for(let e=0;et.getType()===$l.Table)),a=[],l=!1;for(let e of i){let n=e.getParentTarget(),r=this.app.vault.getAbstractFileByPath(t.normalizePath(n+".md"));if(!(r&&r instanceof t.TFile)){l=!0;break}let i=e.getAccessor(),o=e.usedAsXDataset,s=a.find((t=>t.filePath===n&&t.tableIndex===i));if(s)o?s.xDataset=e:s.yDatasets.push(e);else{let t=new oo(n,i);o?t.xDataset=e:t.yDatasets.push(e),a.push(t)}}if(l)r.errorMessage="File containing tables not found";else for(let i of a){let a=i.xDataset;if(!a)continue;let l=i.yDatasets,o=a.getParentTarget(),s=a.getAccessor(),u="";o+=".md";let c=this.app.vault.getAbstractFileByPath(t.normalizePath(o));if(!(c&&c instanceof t.TFile))continue;{r.fileAvailable++;let t,e=await this.app.vault.adapter.read(c.path),n=new RegExp("((\\r?\\n){2}|^)([^\\r\\n]*\\|[^\\r\\n]*(\\r?\\n)?)+(?=(\\r?\\n){2}|$)","gm"),i=0;for(;t=n.exec(e);){if(i===s){u=t[0];break}i++}}let h=u.split(/\r?\n/);h=h.filter((t=>""!==t));let f=0,d=0;if(h.length>=2){let t=h.shift().trim();t=Ao(t,"|"),f=t.split("|").length;let e=h.shift().trim();e=Ao(e,"|");let n=e.split("|");for(let t of n)if(!t.includes("-"))break;d=h.length}if(0==d)continue;let g=a.getAccessor(1);if(g>=f)continue;let p=[];for(let t of h){let e=Ao(t.trim(),"|").split("|");if(gr.maxDate&&(r.maxDate=t.clone())):(r.minDate=t.clone(),r.maxDate=t.clone())):p.push(null)}else p.push(null)}if(p.every((t=>null===t)))return void(r.errorMessage="No valid date as X value found in table");r.gotAnyValidXValue||(r.gotAnyValidXValue=!0);for(let t of l){let i=t.getAccessor(1);if(i>=f)continue;let a=0;for(let l of h){let o=Ao(l.trim(),"|").split("|");if(it.getAccessor(2)&&t.getAccessor(2)>=0){let i=null,o=bo(l[t.getAccessor(2)].trim(),n.textValueMap);null!==o.value&&(o.type===Rl.Time&&(t.valueType=Rl.Time),i=o.value,a [!quote] [ELECTRI's Industry Benchmarking Tool - ELECTRI International](https://www.electri.org/research-overview/electris-industry-benchmarking-tool/) -> ### Hours Burned vs. Hours Earned -> -> Definition: -> Comparison between portion of project estimated hours complete -> compared with the actual hours spent on the task. -> This is the labor performance factor -> (needs to reference the labor factor used at bid time for a full comparison). - -This is a terribly problematic metric. - -If a project went over its material budget -despite standard rigorous oversight -where would you first look, -construction or estimating? -In almost all cases the safer bet is estimating. -Why should labor be different? - -Wherever there is budget variance -there is a persistent tendency to blame construction -before estimating. - -[[purpose-of-construction-estimating#The Myth of Estimate Accuracy]] +[[2025-11-21_10-11-00]] \ No newline at end of file diff --git a/2025-11-21_10-11-00.md b/2025-11-21_10-11-00.md new file mode 100644 index 0000000..436566f --- /dev/null +++ b/2025-11-21_10-11-00.md @@ -0,0 +1,36 @@ +--- +id: 2025-11-21T10:11:00-05:00 +aliases: [] +title: 2025-11-21 10:11:?? +tags: + - authorship/original + - destiny/permanent + - status/complete + - topic/estimating + - type/periodic/timestamped +--- +# 2025-11-21 10:11:?? + +> [!quote] [ELECTRI's Industry Benchmarking Tool - ELECTRI International](https://www.electri.org/research-overview/electris-industry-benchmarking-tool/) +> ### Hours Burned vs. Hours Earned +> +> Definition: +> Comparison between portion of project estimated hours complete +> compared with the actual hours spent on the task. +> This is the labor performance factor +> (needs to reference the labor factor used at bid time for a full comparison). + +This is a terribly problematic metric. + +If a project went over its material budget +despite standard rigorous oversight +where would you first look, +construction or estimating? +In almost all cases the safer bet is estimating. +Why should labor be different? + +Wherever there is budget variance +there is a persistent tendency to blame construction +before estimating. + +[[purpose-of-construction-estimating#The Myth of Estimate Accuracy]] diff --git a/2026-01-22.md b/2026-01-22.md index bf8c182..ff10e7a 100644 --- a/2026-01-22.md +++ b/2026-01-22.md @@ -32,9 +32,9 @@ is the relevant section. Effective date: [[2026-01-21]] * [x] Escrow deposit due by [[2026-01-26]] -* [ ] Loan application submitted by [[2026-01-26]] -* [ ] Inspection period ends [[2026-01-28]] -* [ ] Loan approval due by [[2026-02-11]] +* [x] Loan application submitted by [[2026-01-26]] +* [x] Inspection period ends [[2026-01-28]] +* [x] Loan approval due by [[2026-02-11]] * [ ] Title commitment due by [[2026-02-27]] Closing: [[2026-03-04]] @@ -54,13 +54,15 @@ Closing: [[2026-03-04]] It may be counterintuitive to BOM-oriented estimators (typical of those with an electrical background), -but deviating from ~~common practice~~ +but deviating from organization standard practice to make an assembly "more accurate" (read: to make the estimate BOM more closely resemble the construction BOM), may make the budget _less_ accurate. -The review and adjustment process is based on ~~common practice~~, +The review and adjustment process +is based on standard practice, +so deviations may have unpredictable effects. Our assemblies do not include screws It would be more accurate to the BOM to add them, diff --git a/2026-01-25.md b/2026-01-25.md index 3f7bb9c..b2ee1cf 100644 --- a/2026-01-25.md +++ b/2026-01-25.md @@ -13,6 +13,8 @@ dg-publish: true ## 2026-01-25 18:46 +#topic/finance + ### Calculating Monthly Principal & Interest Payment For a **fixed-rate, fully-amortizing mortgage**, diff --git a/2026-01-27.md b/2026-01-27.md index 1549aca..81635f7 100644 --- a/2026-01-27.md +++ b/2026-01-27.md @@ -13,6 +13,8 @@ dg-publish: true ## 2026-01-27 17:31 +#topic/hobbies/reading + ### BLAME! Coelacanth Follow-up to [[2026-01-26#BLAME! Coelacanth]] diff --git a/2026-01-28.md b/2026-01-28.md index b9ff1dc..b37048d 100644 --- a/2026-01-28.md +++ b/2026-01-28.md @@ -11,7 +11,9 @@ dg-publish: true --- # 2026-01-28 -## 2026-01-28 09:51 +## 2026-01-28 09:51:?? + +#occupational ### ConEst OneNote Template @@ -25,8 +27,10 @@ some I would not have thought could work so well. At Ace my takeoff notes were entirely freeform, and I would have balked at the idea of using a standard checklist. Our projects were so varied -no list could be generic enough to approach universal applicability -without being so shallow as to be useless to an experienced estimator. +that no list could be generic enough +to approach universal applicability +without being so shallow +as to be useless to an experienced estimator. #### Estimator Initials @@ -34,7 +38,9 @@ Voluntary commitment to responsibility. An estimator adding their initials knows they are expected to be familiar with the scope. -## 2026-01-28 10:02 +## 2026-01-28 10:02:?? + +#topic/meta I'm tempted to replace [[daily-notes]] with timestamped notes from core plugins Unique Note Creator, diff --git a/2026-01-29.md b/2026-01-29.md index 9082750..3ccde63 100644 --- a/2026-01-29.md +++ b/2026-01-29.md @@ -82,7 +82,7 @@ even when slightly lower. Short-term investments may be favored when liquidity is needed during the term, -Tax deferred investments (IRA) +and tax deferred investments (IRA) are strongly favored over elective payment since interest is deductible (effective interest < nominal). diff --git a/2026-01-30.md b/2026-01-30.md index 3e97ed6..1ed45ff 100644 --- a/2026-01-30.md +++ b/2026-01-30.md @@ -45,7 +45,9 @@ and touch a virtual light switch because the routines they programmed were too conservative. Human or software, -an assistant without agency and the will to contradict you is worthless. +an assistant without agency +and the will to contradict you +is worthless. If the effort to _communicate_ your instructions exceeds the effort to perform them, you will always do the task yourself. diff --git a/2026-01-31.md b/2026-01-31.md index 7a48ae8..6d5fcdf 100644 --- a/2026-01-31.md +++ b/2026-01-31.md @@ -10,42 +10,3 @@ tags: dg-publish: true --- # 2026-01-31 - -## 2026-01-31 12:48:00 - -Follow-up to [[2026-01-19#2026-01-19 11:57]] - -a **natural-language parser** -could easily determine where hyphens should be replaced with em dashes. - -"deep-set" `{ADJECTIVE}-{VERB_PAST_TENSE}` -> `{COMPOUND_ADJECTIVE}` -"leather-covered" `{NOUN}-{VERB_PAST_TENSE}` -> `{COMPOUND_ADJECTIVE}` -"magic-worker" `{NOUN}-{AGENT_NOUN}` -> `{COMPOUND_NOUN}` -"eon-old" `{NOUN}-{ADJECTIVE}` -> `{COMPOUND_ADJECTIVE}` -"one-armed" `{NUMBER_ADJECTIVE}-{ADJECTIVE}` -> `{COMPOUND_ADJECTIVE}` -"twenty-two" `{NUMBER_ADJECTIVE}-{NUMBER_ADJECTIVE}` -> `{NUMBER_ADJECTIVE}` - -[Agent noun](https://en.wikipedia.org/wiki/Agent_noun) - -- **-er / -or**: _worker, runner, actor_ -- **-ist**: _pianist, socialist_ -- **-ant / -ent**: _assistant, respondent_ - -[Theta role](https://en.wikipedia.org/wiki/Theta_role) - -- **-ee** (often recipient rather than doer, but related): _employee, trainee_ - -## 2026-01-31 17:49:00 - -> [!quote] [Linux Bash Shell Script Error: cannot execute: required file not found - Unix Stack Exchange](https://unix.stackexchange.com/questions/721844/linux-bash-shell-script-error-cannot-execute-required-file-not-found) -> > [!quote] [ctrl-alt-delor](https://unix.stackexchange.com/users/4778/) 2022-10-21 08:16 -> > Note: use of back ticks e.g. `... ``command`` ...` is deprecated. Use the newer easier to use `"$(command)"` (but yes this simple use with echo is hoop jumping). Use of `.sh` at the end of file names is not Unix. And it violates the principle of abstraction, as it leaks implementation detail. Just name them by what they do, not how they do it. -> -> > [!quote] [Kusalananda](https://unix.stackexchange.com/users/116858/) 2022-10-21 08:22 -> > @ctrl-alt-delor They are most definitely not deprecated, only awkward to use and should be avoided. In this particular case, any type of command substitution would be inappropriate. As for naming files, that's really up to the user. If you are concerned with abstraction, you could suggest the user uses the `hostname` command directly rather than via a nonsensical script with a function. -> -> > [!quote] ctrl-alt-delor 2022-10-21 08:29 -> > `deprecate` : express disapproval of. I disapprove. You say should be avoided. Thus deprecated. As for up to the user. I agree, it is the same for drug use. And the best abstraction is no abstraction (it depends). However I assume the examples were minimum non-working examples. -> -> > [!quote] [Ed Swangren](https://unix.stackexchange.com/users/597584/) 2024-09-28 07:46 -> > @ctrl-alt-delor `deprecate(3):` to withdraw official support for or discourage the use of (something, such as a software product) in favor of a newer or better alternative" you're right, but only accidentally, so no credit given and mockery warranted. Citing a dictionary definition in a technical context is always wrong, citing the wrong one is lazy and stupid, and citing your opinion as evidence is in line with what I'd expect after #1 and #2. No one cares. diff --git a/2026-01-31_12-48-00.md b/2026-01-31_12-48-00.md new file mode 100644 index 0000000..c26f21c --- /dev/null +++ b/2026-01-31_12-48-00.md @@ -0,0 +1,35 @@ +--- +id: +aliases: [] +title: 2026-01-31 12:48:00 +tags: + - authorship/original + - destiny/permanent + - status/draft + - type/timestamped +daily: "[[2026-01-31]]" +dg-publish: true +--- +# 2026-01-31 12:48:00 + +Follow-up to [[2026-01-19#2026-01-19 11:57]] + +a **natural-language parser** +could easily determine where hyphens should be replaced with em dashes. + +"deep-set" `{ADJECTIVE}-{VERB_PAST_TENSE}` -> `{COMPOUND_ADJECTIVE}` +"leather-covered" `{NOUN}-{VERB_PAST_TENSE}` -> `{COMPOUND_ADJECTIVE}` +"magic-worker" `{NOUN}-{AGENT_NOUN}` -> `{COMPOUND_NOUN}` +"eon-old" `{NOUN}-{ADJECTIVE}` -> `{COMPOUND_ADJECTIVE}` +"one-armed" `{NUMBER_ADJECTIVE}-{ADJECTIVE}` -> `{COMPOUND_ADJECTIVE}` +"twenty-two" `{NUMBER_ADJECTIVE}-{NUMBER_ADJECTIVE}` -> `{NUMBER_ADJECTIVE}` + +[Agent noun](https://en.wikipedia.org/wiki/Agent_noun) + +* **-er / -or**: _worker, runner, actor_ +* **-ist**: _pianist, socialist_ +* **-ant / -ent**: _assistant, respondent_ + +[Theta role](https://en.wikipedia.org/wiki/Theta_role) + +* **-ee** (often recipient rather than doer, but related): _employee, trainee_ diff --git a/2026-01-31_17-49-00.md b/2026-01-31_17-49-00.md new file mode 100644 index 0000000..f7f2ef8 --- /dev/null +++ b/2026-01-31_17-49-00.md @@ -0,0 +1,27 @@ +--- +id: 2026-01-31T17:49:00-05:00 +aliases: [] +title: 2026-01-31 17:49:00 +tags: + - authorship/other + - destiny/permanent + - status/draft + - type/timestamped +daily: "[[2026-01-31]]" +dg-publish: true +--- +# 2026-01-31 17:49:00 + +> [!quote] [Linux Bash Shell Script Error: cannot execute: required file not found - Unix Stack Exchange](https://unix.stackexchange.com/questions/721844/linux-bash-shell-script-error-cannot-execute-required-file-not-found) +> +> > [!quote] [ctrl-alt-delor](https://unix.stackexchange.com/users/4778/) 2022-10-21 08:16 +> > Note: use of back ticks e.g. `... ``command`` ...` is deprecated. Use the newer easier to use `"$(command)"` (but yes this simple use with echo is hoop jumping). Use of `.sh` at the end of file names is not Unix. And it violates the principle of abstraction, as it leaks implementation detail. Just name them by what they do, not how they do it. +> +> > [!quote] [Kusalananda](https://unix.stackexchange.com/users/116858/) 2022-10-21 08:22 +> > @ctrl-alt-delor They are most definitely not deprecated, only awkward to use and should be avoided. In this particular case, any type of command substitution would be inappropriate. As for naming files, that's really up to the user. If you are concerned with abstraction, you could suggest the user uses the `hostname` command directly rather than via a nonsensical script with a function. +> +> > [!quote] ctrl-alt-delor 2022-10-21 08:29 +> > `deprecate` : express disapproval of. I disapprove. You say should be avoided. Thus deprecated. As for up to the user. I agree, it is the same for drug use. And the best abstraction is no abstraction (it depends). However I assume the examples were minimum non-working examples. +> +> > [!quote] [Ed Swangren](https://unix.stackexchange.com/users/597584/) 2024-09-28 07:46 +> > @ctrl-alt-delor `deprecate(3):` to withdraw official support for or discourage the use of (something, such as a software product) in favor of a newer or better alternative" you're right, but only accidentally, so no credit given and mockery warranted. Citing a dictionary definition in a technical context is always wrong, citing the wrong one is lazy and stupid, and citing your opinion as evidence is in line with what I'd expect after #1 and #2. No one cares. diff --git a/2026-02-02_06-50-00.md b/2026-02-02_06-50-00.md index 1dfacec..4d60a76 100644 --- a/2026-02-02_06-50-00.md +++ b/2026-02-02_06-50-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - topic/meta dg-publish: true daily: "[[2026-02-02]]" --- diff --git a/2026-02-02_12-18-00.md b/2026-02-02_12-18-00.md index 9688bd4..630651e 100644 --- a/2026-02-02_12-18-00.md +++ b/2026-02-02_12-18-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - occupational/takeoff dg-publish: true daily: "[[2026-02-02]]" --- diff --git a/2026-02-03_08-34-00.md b/2026-02-03_08-34-00.md index ff5c629..421ce48 100644 --- a/2026-02-03_08-34-00.md +++ b/2026-02-03_08-34-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - occupational dg-publish: true daily: "[[2026-02-03]]" --- diff --git a/2026-02-03_15-04-00.md b/2026-02-03_15-04-00.md index 4669721..eff0242 100644 --- a/2026-02-03_15-04-00.md +++ b/2026-02-03_15-04-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - topic/estimating dg-publish: true daily: "[[2026-02-03]]" --- diff --git a/2026-02-03_16-17-00.md b/2026-02-03_16-17-00.md index ef1ce5c..cc76afa 100644 --- a/2026-02-03_16-17-00.md +++ b/2026-02-03_16-17-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - occupational dg-publish: true daily: "[[2026-02-03]]" --- diff --git a/2026-02-04_08-07-00.md b/2026-02-04_08-07-00.md index 2660524..22e86ca 100644 --- a/2026-02-04_08-07-00.md +++ b/2026-02-04_08-07-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - occupational dg-publish: true daily: "[[2026-02-04]]" --- diff --git a/2026-02-04_09-00-00.md b/2026-02-04_09-00-00.md index 1e29fb8..07f41b3 100644 --- a/2026-02-04_09-00-00.md +++ b/2026-02-04_09-00-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - topic/organization dg-publish: true daily: "[[2026-02-04]]" --- @@ -24,28 +25,26 @@ is a method of project estimation characterized by the use of T-shirt sizes representing project scale buckets. -> [!example] +> [!example] [T-Shirt Sizing in Agile --- Project Management Pathways](https://www.projectmanagementpathways.com/project-management-articles/tshirt-sizing-in-agile-projects) > * **XS (1-2 days):** Simple UI changes or minor bug fixes > -> Example: "Update button color on checkout page" +> Example: "Update button color on checkout page" > > * **S (2-3 days):** Feature enhancements with minimal complexity > -> Example: "Add product sorting by price" +> Example: "Add product sorting by price" > > * **M (5-7 days):** Features requiring moderate integration > -> Example: "Implement basic search filters" +> Example: "Implement basic search filters" > > * **L (8-10 days):** Complex features affecting multiple components > -> Example: "Create shopping cart functionality" +> Example: "Create shopping cart functionality" > > * **XL (2+ weeks):** Major features requiring breaking down > -> Example: "Implement payment gateway integration" -> -> --- [T-Shirt Sizing in Agile --- Project Management Pathways](https://www.projectmanagementpathways.com/project-management-articles/tshirt-sizing-in-agile-projects) +> Example: "Implement payment gateway integration" The buckets chosen should be wide enough that scale can be confidently estimated diff --git a/2026-02-04_13-42-00.md b/2026-02-04_13-42-00.md index 659cb65..9a10a1d 100644 --- a/2026-02-04_13-42-00.md +++ b/2026-02-04_13-42-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - occupational/takeoff dg-publish: true daily: "[[2026-02-04]]" --- diff --git a/2026-02-04_17-02-00.md b/2026-02-04_17-02-00.md index 4c3fc21..dcd586f 100644 --- a/2026-02-04_17-02-00.md +++ b/2026-02-04_17-02-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - occupational/takeoff dg-publish: true daily: "[[2026-02-04]]" --- @@ -23,9 +24,9 @@ so that we would not risk having too little overall. Their expectation surprised me, since it is intuitive to me -that there must be some limit to the logic of "covering it" +that there must be some limit to the logic of "covering it", since it is always within our power to add contingency, -and especially because, if anything, +and especially because---if anything--- I feel that our procedures tend towards the upper end of reasonable ECI. (see [[value-of-information.jpg]]) diff --git a/2026-02-04_18-05-00.md b/2026-02-04_18-05-00.md index b18d9a2..fc84c0d 100644 --- a/2026-02-04_18-05-00.md +++ b/2026-02-04_18-05-00.md @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/timestamped + - topic/estimating dg-publish: true daily: "[[2026-02-04]]" --- diff --git a/2026-02-05_10-14-01.md b/2026-02-05_10-14-01.md index ac52ca5..2cebb66 100644 --- a/2026-02-05_10-14-01.md +++ b/2026-02-05_10-14-01.md @@ -1,12 +1,13 @@ --- id: aliases: [] -title: "2026-02-05 10:14:01" +title: 2026-02-05 10:14:01 tags: - authorship/original - destiny/permanent - status/draft - type/periodic/timestamped + - occupational/takeoff dg-publish: true daily: "[[2026-02-05]]" weekly: "[[2026-W06]]" diff --git a/2026-02-05_12-14-47.md b/2026-02-05_12-14-47.md index f55f373..d426f16 100644 --- a/2026-02-05_12-14-47.md +++ b/2026-02-05_12-14-47.md @@ -1,12 +1,13 @@ --- id: aliases: [] -title: "2026-02-05 12:14:47" +title: 2026-02-05 12:14:47 tags: - authorship/original - destiny/permanent - status/draft - type/periodic/timestamped + - topic/construction/electrical dg-publish: true daily: "[[2026-02-05]]" weekly: "[[2026-W06]]" diff --git a/2026-02-07_09-16-31.md b/2026-02-07_09-16-31.md index b41300b..81ccb05 100644 --- a/2026-02-07_09-16-31.md +++ b/2026-02-07_09-16-31.md @@ -1,12 +1,13 @@ --- id: aliases: [] -title: "2026-02-07 09:16:31" +title: 2026-02-07 09:16:31 tags: - authorship/original - destiny/permanent - status/draft - type/periodic/timestamped + - topic/hobbies/reading dg-publish: true daily: "[[2026-02-07]]" weekly: "[[2026-W06]]" diff --git a/2026-02-08_08-00-49.md b/2026-02-08_08-00-49.md index 17c89bf..43dff63 100644 --- a/2026-02-08_08-00-49.md +++ b/2026-02-08_08-00-49.md @@ -1,12 +1,13 @@ --- id: aliases: [] -title: "2026-02-08 08:00:49" +title: 2026-02-08 08:00:49 tags: - authorship/original - destiny/permanent - status/draft - type/periodic/timestamped + - topic/hobbies/reading dg-publish: true daily: "[[2026-02-08]]" weekly: "[[2026-W06]]" diff --git a/2026-02-10_07-46-30.md b/2026-02-10_07-46-30.md deleted file mode 100644 index c20b42e..0000000 --- a/2026-02-10_07-46-30.md +++ /dev/null @@ -1,23 +0,0 @@ ---- -id: -aliases: [] -title: "2026-02-10 07:46:30" -tags: - - authorship/original - - destiny/permanent - - status/draft - - type/periodic/timestamped -dg-publish: true -daily: "[[2026-02-10]]" -weekly: "[[2026-W07]]" -monthly: "[[2026-02]]" -quarterly: "[[2026-Q1]]" -yearly: "[[2026]]" ---- -# 2026-02-10 07:46:30 - -## Foobar2000 Autofill Metadata Values - -```foobar -%tracknumber%. %artist% - %title% -``` diff --git a/2026-02-11_12-12-16.md b/2026-02-11_12-12-16.md index 851155a..851c607 100644 --- a/2026-02-11_12-12-16.md +++ b/2026-02-11_12-12-16.md @@ -1,5 +1,5 @@ --- -id: +id: 2026-02-11T12:12:16-05:00 aliases: [] title: 2026-02-11 12:12:16 tags: diff --git a/2026-02-12_09-49-56.md b/2026-02-12_09-49-56.md index c0f0ecb..6655ecd 100644 --- a/2026-02-12_09-49-56.md +++ b/2026-02-12_09-49-56.md @@ -1,5 +1,5 @@ --- -id: +id: 2026-02-12T09:49:56-05:00 aliases: [] title: 2026-02-12 09:49:56 tags: @@ -7,6 +7,7 @@ tags: - destiny/permanent - status/draft - type/periodic/timestamped + - topic/construction/electrical daily: "[[2026-02-12]]" dg-publish: true monthly: "[[2026-02]]" @@ -22,7 +23,7 @@ yearly: "[[2026]]" Applies to "Equipment intended to interrupt current". -[[nfpa-70_110_requirements#110.9 Interrupting Rating.|110.9 Interrupting Rating.]] +[[nfpa-70_110_requirements#110.9 Interrupting Rating.|NEC 110.9 Interrupting Rating.]] Maximum current that the equipment can interrupt without damage. Measured in amperes, usually shown as kAIC. @@ -31,7 +32,7 @@ Measured in amperes, usually shown as kAIC. * "withstand rating" -[[nfpa-70_110_requirements#110.10 Circuit Impedance, Short-Circuit Current Ratings, and Other Characteristics.]] +[[nfpa-70_110_requirements#110.10 Circuit Impedance, Short-Circuit Current Ratings, and Other Characteristics.|NEC 110.10 Circuit Impedance, Short-Circuit Current Ratings, and Other Characteristics.]] Applies to **assemblies**: distribution equipment like switchboards, panelboards, switches, etc. diff --git a/2026-02-17_13-13-06.md b/2026-02-17_13-13-06.md new file mode 100644 index 0000000..4aa276d --- /dev/null +++ b/2026-02-17_13-13-06.md @@ -0,0 +1,24 @@ +--- +id: 2026-02-17T13-13-06-05:00 +aliases: [] +title: "2026-02-17 13:13:06" +tags: + - authorship/original + - destiny/permanent + - status/draft + - type/periodic/timestamped +dg-publish: true +daily: "[[2026-02-17]]" +weekly: "[[2026-W08]]" +monthly: "[[2026-02]]" +quarterly: "[[2026-Q1]]" +yearly: "[[2026]]" +--- +# 2026-02-17 13:13:06 + +Relevant to [[2025-11-21_10-11-00#2025-11-21 10:11:??|2025-11-21 10:11:??]] + +Today I spoke to a peer about +[[earned-value-management#Earned Value Management|earned value management]]: +how it relates to our [[pdi-estimating#ConEst Processes|WBS]] +and my negative opinion of it. diff --git a/2026-02-17_16-47-46.md b/2026-02-17_16-47-46.md new file mode 100644 index 0000000..8b89bdb --- /dev/null +++ b/2026-02-17_16-47-46.md @@ -0,0 +1,44 @@ +--- +id: 2026-02-17T16-47-46-05:00 +aliases: [] +title: "2026-02-17 16:47:46" +tags: + - authorship/original + - destiny/permanent + - status/draft + - type/periodic/timestamped +dg-publish: true +daily: "[[2026-02-17]]" +weekly: "[[2026-W08]]" +monthly: "[[2026-02]]" +quarterly: "[[2026-Q1]]" +yearly: "[[2026]]" +--- +# 2026-02-17 16:47:46 + +## The Lindy Effect + +> [!quote] [Lindy effect - Wikipedia](https://en.wikipedia.org/wiki/Lindy_effect) +> The Lindy effect (also known as Lindy's law) +> is a theorized phenomenon by which the future life expectancy +> of some non-perishable thing, +> like a technology or an idea, +> is proportional to its current age. +> Thus, the Lindy effect proposes +> the longer a period something has survived +> to exist or be used in the present, +> the longer its remaining life expectancy. +> Longevity implies a resistance to change, +> obsolescence, or competition, +> and greater odds of continued existence into the future. +> Where the Lindy effect applies, +> mortality rate decreases with time. +> +> ... +> +> The concept is named after Lindy's delicatessen in New York City, +> where the concept was informally theorized by comedians: +> a show running only 2 weeks +> would be expected to last another 2 weeks, +> while a show that has lasted 2 years +> could expect a further 2-year run. \ No newline at end of file diff --git a/README.md b/README.md index 5ace190..0c365bc 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,8 @@ For contents, prose conventions, etc. see [[this-notebook]]. I primarily use [[obsidian|Obsidian]] for both reading and writing, so notes are written in [Obsidian-flavored markdown](https://help.obsidian.md/), -which is partially reimplemented by [Foam](https://foamnotes.com/) for Visual Studio Code +which is partially reimplemented by +[Foam](https://foamnotes.com/) for Visual Studio Code and [Markdown Oxide](https://oxide.md/) for vim, neovim, and others. For compatibility, diff --git a/distributed-antenna-systems-takeoff.md b/distributed-antenna-systems-takeoff.md index 8b5f461..0a96f97 100644 --- a/distributed-antenna-systems-takeoff.md +++ b/distributed-antenna-systems-takeoff.md @@ -58,7 +58,10 @@ dg-publish: true ### Top 2H Rated Room To Roof +Weatherhead for antenna. One per building. + 1. .../`TOP 2HR RATED RM TO ROOF = ...` + * **Count** = 1 * **Length** = Top level ceiling height to structure (minimum 15ft) ## Horizontal diff --git a/earned-value-management.md b/earned-value-management.md new file mode 100644 index 0000000..7993f18 --- /dev/null +++ b/earned-value-management.md @@ -0,0 +1,24 @@ +--- +id: +aliases: [] +title: Earned Value Management +tags: + - authorship/original + - destiny/permanent + - status/incomplete + - topic/organization + - type/encyclopedia-entry +--- +# Earned Value Management + +Earned value management (EVM) +is a [[project-management]] technique +... + +EVM is frequently stated to be capable of +"measuring project performance and progress +in an _objective_ manner",[^1] +an analysis that is either optimistic +or totally misleading, depending on the context. + +[^1]: [Wikipedia](https://en.wikipedia.org/wiki/Earned_value_management) (emphasis added) diff --git a/favorite-quotes.md b/favorite-quotes.md index 43c6be9..17ec4a6 100644 --- a/favorite-quotes.md +++ b/favorite-quotes.md @@ -101,4 +101,16 @@ and easily interpreted as an [optimization problem](https://en.wikipedia.org/wik > Brother, let me pull out the mote that is in thine eye, > when thou thyself beholdest not the beam that is in thine own eye? > Thou hypocrite, cast out first the beam out of thine own eye, -> and then shalt thou see clearly to pull out the mote that is in thy brother's eye. \ No newline at end of file +> and then shalt thou see clearly to pull out the mote that is in thy brother's eye. + +## About Estimating + +> [!quote] Tom Cargill, Bell Labs +> The first 90 percent of the code +> accounts for the first 90 percent of the development time. +> The remaining 10 percent of the code +> accounts for the other 90 percent of the development time. + +> [!quote] Hofstadter's law +> It always takes longer than you expect, +> even when you take into account Hofstadter's law. \ No newline at end of file diff --git a/templates/timestamped.md b/templates/timestamped.md index a19166f..6ad3f95 100644 --- a/templates/timestamped.md +++ b/templates/timestamped.md @@ -1,7 +1,7 @@ --- -id: {{date:YYYY-MM-DD-HH-mm-ss}} +id: {{date:YYYY-MM-DDTHH-mm-ssZ}} aliases: [] -title: "{{date:YYYY-MM-DD}} {{time:HH:mm:ss}}" +title: "{{date:YYYY-MM-DD HH:mm:ss}}" tags: - authorship/original - destiny/permanent @@ -14,4 +14,4 @@ monthly: "[[{{date:YYYY-MM}}]]" quarterly: "[[{{date:YYYY-[Q]Q}}]]" yearly: "[[{{date:YYYY}}]]" --- -# {{date:YYYY-MM-DD}} {{time:HH:mm:ss}} +# {{date:YYYY-MM-DD HH:mm:ss}} diff --git a/units-takeoff.md b/units-takeoff.md index 60449e3..28859b3 100644 --- a/units-takeoff.md +++ b/units-takeoff.md @@ -12,29 +12,33 @@ dg-publish: true --- # Unit Takeoff -[[pdi-conest-project-setup#Create Unit Matrix|Create Unit Matrix]] -[[accubid-setup#Create Unit Typicals|Create Unit Typicals]] +> [!info] +> See [[multi-family-dwellings]]. + +[[pdi-building-types]] + +## Prerequisites > [!important] > Complete [[pre-takeoff-research]], > including [[wiring-method-selection]] and [[wiring-device-research]], > before beginning takeoff. -> [!info] -> See [[multi-family-dwellings]]. +1. [[pdi-conest-project-setup#Create Unit Matrix|Create Unit Matrix]] +2. [[accubid-setup#Create Unit Typicals|Create Unit Typicals]] -[[pdi-building-types]] +## Takeoff > [!tip] Preparing for Unit Takeoff > Units generally have very little variation. > It is usually best to copy-paste takeoffs > rather than re-build them for each unit. -1. Kitchen and Bath -2. General assemblies -3. Low Voltage -4. Lighting Fixtures -5. Lighting Control +3. Kitchen and Bath +4. General assemblies +5. Low Voltage +6. Lighting Fixtures +7. Lighting Control > [!tip] > It may be more efficient and neat to not copy switches, @@ -42,7 +46,9 @@ dg-publish: true > and creating them new for each unit, > since the types required can vary greatly between units. -## Load Centers +### Load Centers + +* `System` = "EL - Electrical" | Rating | Assembly | | ------- | ---------------------------------------------------------------------------------- | @@ -51,17 +57,17 @@ dg-publish: true Include terminations per [[switchgear]]. -## Fixtures +### Fixtures [[fixtures-takeoff]] -## Shade Control +### Shade Control -## VTAC Units +### VTAC Units Used in lieu of individual split systems. -## Dedicated Circuit Receptacles +### Dedicated Circuit Receptacles > [!quote] Joel Jansen 2025-11-11, pp. > @@ -76,7 +82,7 @@ Used in lieu of individual split systems. > match the receptacle configuration shown on the plans > (i.e. simplex to simplex, duplex to duplex). -## Air Sealing +### Air Sealing * LEED Silver * Mid-Atlantic jobs @@ -86,28 +92,28 @@ Used in lieu of individual split systems. `COMMON ASSEMBLIES`/`UNITS - MC CABLE ASSEMBLIES`/`GENERAL ASSEMBLIES - METAL STUD`/`UNIT MISC ITEMS - MC - ADJUST ACCORDINGLY` -## Dishwasher/Disposal Receptacles +### Dishwasher/Disposal Receptacles > [!quote] Joel Jansen 2026-01-12 in Reference to Woodbrook (pp.)[^1] > Even when drawings show 2 separate duplex receptacles, > use `DW & DISPOSAL DUAL CIR - ...`, > which includes only one receptacle. -[^1]: [[2026-01-12#Unit Diskwasher/Disposal]] +[^1]: [[2026-01-12#Unit Dishwasher/Disposal]] -## Islands +### Islands -Use 1 `SLAB / DECK` receptacle for every 2 circuits in the island. +Use (1) `SLAB / DECK` receptacle for every 2 circuits in the island. `COMMON ASSEMBLIES`/`UNITS - MC CABLE ASSEMBLIES`/`... RECEPTACLE TAMPER RESISTANT ...`/`... (METAL STUD) - 20' 3/4" PVC, ENT, 3#12 THHN` Use standard MC assemblies for remaining devices. -## Bidet Toilets, Whirlpool Baths, etc. +### Bidet Toilets, Whirlpool Baths, etc. `COMMON ASSEMBLIES`/`MECHANICAL CONNECTIONS (UP TO 100A)`/`PVC - LT NM FLEX (CARFLEX)`/`20A 1PH MECH CONN (100') 3/4" PVC 3#12 - CARFLEX` -## "High-Lows" +### "High-Lows" Empty in-wall pass through from credenza location to behind television location. @@ -115,27 +121,28 @@ from credenza location to behind television location. `COMMON ASSEMBLIES`/`TELECOM SYSTEMS`/`UNIT DATA - TELECOM`/`HIGH-LOW - TV SCOOP 1 1/2" ENT - NO CABLE` > ![Eaton 35M2W|250x250](https://www.eaton.com/mdmfiles/PDM19433863/35M2W_C/500x500_72dpi) -> Eaton 35M2W +> +> _Eaton 35M2W_ -## Telecom Homeruns +### Telecom Homeruns -### Residential +#### Residential Included in MSDE. -### Key +#### Key `COMMON ASSEMBLIES`/`TELECOM SYSTEMS`/`BOH AMENITY ASSEMBLIES`/... Adjust cable length as needed. -## Fire Alarm Devices +### Fire Alarm Devices -### Residential +#### Residential * `System` = "EL - Electrical" -#### Smoke Detectors & CO Detectors +##### Smoke Detectors & CO Detectors For smoke detectors and CO detectors where 120V (most common): @@ -145,11 +152,11 @@ For ADA units: `COMMON ASSEMBLIES`/`UNITS - MC CABLE ASSEMBLIES`/`GENERAL ASSEMBLIES - METAL STUD`/`UNIT SMOKE DETECTOR / VISUAL SIGNAL ...` -#### Additional Signaling Devices +##### Additional Signaling Devices `COMMON ASSEMBLIES`/`FIRE ALARM & DAS SYSTEMS`/`INDICATING DEVICES WITH WIRE - ...`/`UNIT HORN/STROBE - ...` -### Key +#### Key * `System` = "FA - Fire Alarm"