@vizabi/bubblechart 0.0.4 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/cursors/zoom-in.cur +0 -0
- package/build/assets/cursors/zoom-out.cur +0 -0
- package/build/bubblechart.css +3 -0
- package/build/bubblechart.js +138 -118
- package/build/bubblechart.js.map +1 -1
- package/build/stats.html +2513 -370
- package/package.json +3 -3
package/build/stats.html
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
<meta charset="UTF-8" />
|
|
6
6
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
7
7
|
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
|
|
8
|
-
<title>
|
|
8
|
+
<title>Rollup Visualizer</title>
|
|
9
9
|
<style>
|
|
10
10
|
:root {
|
|
11
11
|
--font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif,
|
|
@@ -116,6 +116,7 @@ main {
|
|
|
116
116
|
|
|
117
117
|
.module-filters {
|
|
118
118
|
display: flex;
|
|
119
|
+
flex-grow: 1;
|
|
119
120
|
}
|
|
120
121
|
|
|
121
122
|
.module-filter {
|
|
@@ -144,9 +145,9 @@ main {
|
|
|
144
145
|
var drawChart = (function (exports) {
|
|
145
146
|
'use strict';
|
|
146
147
|
|
|
147
|
-
var n,l$1,u$1,t$1,o$2,r$1,f$1={},e$
|
|
148
|
+
var n,l$1,u$1,t$1,o$2,r$1,f$1={},e$1=[],c$1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function s$1(n,l){for(var u in l)n[u]=l[u];return n}function a$1(n){var l=n.parentNode;l&&l.removeChild(n);}function h$1(l,u,i){var t,o,r,f={};for(r in u)"key"==r?t=u[r]:"ref"==r?o=u[r]:f[r]=u[r];if(arguments.length>2&&(f.children=arguments.length>3?n.call(arguments,2):i),"function"==typeof l&&null!=l.defaultProps)for(r in l.defaultProps)void 0===f[r]&&(f[r]=l.defaultProps[r]);return v$1(l,f,t,o,null)}function v$1(n,i,t,o,r){var f={type:n,props:i,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==r?++u$1:r};return null==r&&null!=l$1.vnode&&l$1.vnode(f),f}function p$1(n){return n.children}function d$1(n,l){this.props=n,this.context=l;}function _$2(n,l){if(null==l)return n.__?_$2(n.__,n.__.__k.indexOf(n)+1):null;for(var u;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e)return u.__e;return "function"==typeof n.type?_$2(n):null}function k$1(n){var l,u;if(null!=(n=n.__)&&null!=n.__c){for(n.__e=n.__c.base=null,l=0;l<n.__k.length;l++)if(null!=(u=n.__k[l])&&null!=u.__e){n.__e=n.__c.base=u.__e;break}return k$1(n)}}function b$1(n){(!n.__d&&(n.__d=!0)&&t$1.push(n)&&!g$1.__r++||o$2!==l$1.debounceRendering)&&((o$2=l$1.debounceRendering)||setTimeout)(g$1);}function g$1(){for(var n;g$1.__r=t$1.length;)n=t$1.sort(function(n,l){return n.__v.__b-l.__v.__b}),t$1=[],n.some(function(n){var l,u,i,t,o,r;n.__d&&(o=(t=(l=n).__v).__e,(r=l.__P)&&(u=[],(i=s$1({},t)).__v=t.__v+1,j$1(r,t,i,l.__n,void 0!==r.ownerSVGElement,null!=t.__h?[o]:null,u,null==o?_$2(t):o,t.__h),z$1(u,t),t.__e!=o&&k$1(t)));});}function w$1(n,l,u,i,t,o,r,c,s,a){var h,y,d,k,b,g,w,x=i&&i.__k||e$1,C=x.length;for(u.__k=[],h=0;h<l.length;h++)if(null!=(k=u.__k[h]=null==(k=l[h])||"boolean"==typeof k?null:"string"==typeof k||"number"==typeof k||"bigint"==typeof k?v$1(null,k,null,null,k):Array.isArray(k)?v$1(p$1,{children:k},null,null,null):k.__b>0?v$1(k.type,k.props,k.key,k.ref?k.ref:null,k.__v):k)){if(k.__=u,k.__b=u.__b+1,null===(d=x[h])||d&&k.key==d.key&&k.type===d.type)x[h]=void 0;else for(y=0;y<C;y++){if((d=x[y])&&k.key==d.key&&k.type===d.type){x[y]=void 0;break}d=null;}j$1(n,k,d=d||f$1,t,o,r,c,s,a),b=k.__e,(y=k.ref)&&d.ref!=y&&(w||(w=[]),d.ref&&w.push(d.ref,null,k),w.push(y,k.__c||b,k)),null!=b?(null==g&&(g=b),"function"==typeof k.type&&k.__k===d.__k?k.__d=s=m$1(k,s,n):s=A$1(n,k,d,x,b,s),"function"==typeof u.type&&(u.__d=s)):s&&d.__e==s&&s.parentNode!=n&&(s=_$2(d));}for(u.__e=g,h=C;h--;)null!=x[h]&&N(x[h],x[h]);if(w)for(h=0;h<w.length;h++)M(w[h],w[++h],w[++h]);}function m$1(n,l,u){for(var i,t=n.__k,o=0;t&&o<t.length;o++)(i=t[o])&&(i.__=n,l="function"==typeof i.type?m$1(i,l,u):A$1(u,i,i,t,i.__e,l));return l}function A$1(n,l,u,i,t,o){var r,f,e;if(void 0!==l.__d)r=l.__d,l.__d=void 0;else if(null==u||t!=o||null==t.parentNode)n:if(null==o||o.parentNode!==n)n.appendChild(t),r=null;else {for(f=o,e=0;(f=f.nextSibling)&&e<i.length;e+=1)if(f==t)break n;n.insertBefore(t,o),r=o;}return void 0!==r?r:t.nextSibling}function C$1(n,l,u,i,t){var o;for(o in u)"children"===o||"key"===o||o in l||H(n,o,null,u[o],i);for(o in l)t&&"function"!=typeof l[o]||"children"===o||"key"===o||"value"===o||"checked"===o||u[o]===l[o]||H(n,o,l[o],u[o],i);}function $(n,l,u){"-"===l[0]?n.setProperty(l,u):n[l]=null==u?"":"number"!=typeof u||c$1.test(l)?u:u+"px";}function H(n,l,u,i,t){var o;n:if("style"===l)if("string"==typeof u)n.style.cssText=u;else {if("string"==typeof i&&(n.style.cssText=i=""),i)for(l in i)u&&l in u||$(n.style,l,"");if(u)for(l in u)i&&u[l]===i[l]||$(n.style,l,u[l]);}else if("o"===l[0]&&"n"===l[1])o=l!==(l=l.replace(/Capture$/,"")),l=l.toLowerCase()in n?l.toLowerCase().slice(2):l.slice(2),n.l||(n.l={}),n.l[l+o]=u,u?i||n.addEventListener(l,o?T$1:I,o):n.removeEventListener(l,o?T$1:I,o);else if("dangerouslySetInnerHTML"!==l){if(t)l=l.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("href"!==l&&"list"!==l&&"form"!==l&&"tabIndex"!==l&&"download"!==l&&l in n)try{n[l]=null==u?"":u;break n}catch(n){}"function"==typeof u||(null==u||!1===u&&-1==l.indexOf("-")?n.removeAttribute(l):n.setAttribute(l,u));}}function I(n){this.l[n.type+!1](l$1.event?l$1.event(n):n);}function T$1(n){this.l[n.type+!0](l$1.event?l$1.event(n):n);}function j$1(n,u,i,t,o,r,f,e,c){var a,h,v,y,_,k,b,g,m,x,A,C,$,H,I,T=u.type;if(void 0!==u.constructor)return null;null!=i.__h&&(c=i.__h,e=u.__e=i.__e,u.__h=null,r=[e]),(a=l$1.__b)&&a(u);try{n:if("function"==typeof T){if(g=u.props,m=(a=T.contextType)&&t[a.__c],x=a?m?m.props.value:a.__:t,i.__c?b=(h=u.__c=i.__c).__=h.__E:("prototype"in T&&T.prototype.render?u.__c=h=new T(g,x):(u.__c=h=new d$1(g,x),h.constructor=T,h.render=O),m&&m.sub(h),h.props=g,h.state||(h.state={}),h.context=x,h.__n=t,v=h.__d=!0,h.__h=[],h._sb=[]),null==h.__s&&(h.__s=h.state),null!=T.getDerivedStateFromProps&&(h.__s==h.state&&(h.__s=s$1({},h.__s)),s$1(h.__s,T.getDerivedStateFromProps(g,h.__s))),y=h.props,_=h.state,v)null==T.getDerivedStateFromProps&&null!=h.componentWillMount&&h.componentWillMount(),null!=h.componentDidMount&&h.__h.push(h.componentDidMount);else {if(null==T.getDerivedStateFromProps&&g!==y&&null!=h.componentWillReceiveProps&&h.componentWillReceiveProps(g,x),!h.__e&&null!=h.shouldComponentUpdate&&!1===h.shouldComponentUpdate(g,h.__s,x)||u.__v===i.__v){for(h.props=g,h.state=h.__s,u.__v!==i.__v&&(h.__d=!1),h.__v=u,u.__e=i.__e,u.__k=i.__k,u.__k.forEach(function(n){n&&(n.__=u);}),A=0;A<h._sb.length;A++)h.__h.push(h._sb[A]);h._sb=[],h.__h.length&&f.push(h);break n}null!=h.componentWillUpdate&&h.componentWillUpdate(g,h.__s,x),null!=h.componentDidUpdate&&h.__h.push(function(){h.componentDidUpdate(y,_,k);});}if(h.context=x,h.props=g,h.__v=u,h.__P=n,C=l$1.__r,$=0,"prototype"in T&&T.prototype.render){for(h.state=h.__s,h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),H=0;H<h._sb.length;H++)h.__h.push(h._sb[H]);h._sb=[];}else do{h.__d=!1,C&&C(u),a=h.render(h.props,h.state,h.context),h.state=h.__s;}while(h.__d&&++$<25);h.state=h.__s,null!=h.getChildContext&&(t=s$1(s$1({},t),h.getChildContext())),v||null==h.getSnapshotBeforeUpdate||(k=h.getSnapshotBeforeUpdate(y,_)),I=null!=a&&a.type===p$1&&null==a.key?a.props.children:a,w$1(n,Array.isArray(I)?I:[I],u,i,t,o,r,f,e,c),h.base=u.__e,u.__h=null,h.__h.length&&f.push(h),b&&(h.__E=h.__=null),h.__e=!1;}else null==r&&u.__v===i.__v?(u.__k=i.__k,u.__e=i.__e):u.__e=L(i.__e,u,i,t,o,r,f,c);(a=l$1.diffed)&&a(u);}catch(n){u.__v=null,(c||null!=r)&&(u.__e=e,u.__h=!!c,r[r.indexOf(e)]=null),l$1.__e(n,u,i);}}function z$1(n,u){l$1.__c&&l$1.__c(u,n),n.some(function(u){try{n=u.__h,u.__h=[],n.some(function(n){n.call(u);});}catch(n){l$1.__e(n,u.__v);}});}function L(l,u,i,t,o,r,e,c){var s,h,v,y=i.props,p=u.props,d=u.type,k=0;if("svg"===d&&(o=!0),null!=r)for(;k<r.length;k++)if((s=r[k])&&"setAttribute"in s==!!d&&(d?s.localName===d:3===s.nodeType)){l=s,r[k]=null;break}if(null==l){if(null===d)return document.createTextNode(p);l=o?document.createElementNS("http://www.w3.org/2000/svg",d):document.createElement(d,p.is&&p),r=null,c=!1;}if(null===d)y===p||c&&l.data===p||(l.data=p);else {if(r=r&&n.call(l.childNodes),h=(y=i.props||f$1).dangerouslySetInnerHTML,v=p.dangerouslySetInnerHTML,!c){if(null!=r)for(y={},k=0;k<l.attributes.length;k++)y[l.attributes[k].name]=l.attributes[k].value;(v||h)&&(v&&(h&&v.__html==h.__html||v.__html===l.innerHTML)||(l.innerHTML=v&&v.__html||""));}if(C$1(l,p,y,o,c),v)u.__k=[];else if(k=u.props.children,w$1(l,Array.isArray(k)?k:[k],u,i,t,o&&"foreignObject"!==d,r,e,r?r[0]:i.__k&&_$2(i,0),c),null!=r)for(k=r.length;k--;)null!=r[k]&&a$1(r[k]);c||("value"in p&&void 0!==(k=p.value)&&(k!==l.value||"progress"===d&&!k||"option"===d&&k!==y.value)&&H(l,"value",k,y.value,!1),"checked"in p&&void 0!==(k=p.checked)&&k!==l.checked&&H(l,"checked",k,y.checked,!1));}return l}function M(n,u,i){try{"function"==typeof n?n(u):n.current=u;}catch(n){l$1.__e(n,i);}}function N(n,u,i){var t,o;if(l$1.unmount&&l$1.unmount(n),(t=n.ref)&&(t.current&&t.current!==n.__e||M(t,null,u)),null!=(t=n.__c)){if(t.componentWillUnmount)try{t.componentWillUnmount();}catch(n){l$1.__e(n,u);}t.base=t.__P=null,n.__c=void 0;}if(t=n.__k)for(o=0;o<t.length;o++)t[o]&&N(t[o],u,i||"function"!=typeof n.type);i||null==n.__e||a$1(n.__e),n.__=n.__e=n.__d=void 0;}function O(n,l,u){return this.constructor(n,u)}function P(u,i,t){var o,r,e;l$1.__&&l$1.__(u,i),r=(o="function"==typeof t)?null:t&&t.__k||i.__k,e=[],j$1(i,u=(!o&&t||i).__k=h$1(p$1,null,[u]),r||f$1,f$1,void 0!==i.ownerSVGElement,!o&&t?[t]:r?null:i.firstChild?n.call(i.childNodes):null,e,!o&&t?t:r?r.__e:i.firstChild,o),z$1(e,u);}function B$2(n,l){var u={__c:l="__cC"+r$1++,__:n,Consumer:function(n,l){return n.children(l)},Provider:function(n){var u,i;return this.getChildContext||(u=[],(i={})[l]=this,this.getChildContext=function(){return i},this.shouldComponentUpdate=function(n){this.props.value!==n.value&&u.some(b$1);},this.sub=function(n){u.push(n);var l=n.componentWillUnmount;n.componentWillUnmount=function(){u.splice(u.indexOf(n),1),l&&l.call(n);};}),n.children}};return u.Provider.__=u.Consumer.contextType=u}n=e$1.slice,l$1={__e:function(n,l,u,i){for(var t,o,r;l=l.__;)if((t=l.__c)&&!t.__)try{if((o=t.constructor)&&null!=o.getDerivedStateFromError&&(t.setState(o.getDerivedStateFromError(n)),r=t.__d),null!=t.componentDidCatch&&(t.componentDidCatch(n,i||{}),r=t.__d),r)return t.__E=t}catch(l){n=l;}throw n}},u$1=0,d$1.prototype.setState=function(n,l){var u;u=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=s$1({},this.state),"function"==typeof n&&(n=n(s$1({},u),this.props)),n&&s$1(u,n),null!=n&&this.__v&&(l&&this._sb.push(l),b$1(this));},d$1.prototype.forceUpdate=function(n){this.__v&&(this.__e=!0,n&&this.__h.push(n),b$1(this));},d$1.prototype.render=p$1,t$1=[],g$1.__r=0,r$1=0;
|
|
148
149
|
|
|
149
|
-
var
|
|
150
|
+
var _$1=0;function o$1(o,e,n,t,f){var l,s,u={};for(s in e)"ref"==s?l=e[s]:u[s]=e[s];var a={type:o,props:u,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--_$1,__source:f,__self:t};if("function"==typeof o&&(l=o.defaultProps))for(s in l)void 0===u[s]&&(u[s]=l[s]);return l$1.vnode&&l$1.vnode(a),a}
|
|
150
151
|
|
|
151
152
|
function count$1(node) {
|
|
152
153
|
var sum = 0,
|
|
@@ -542,149 +543,2252 @@ var drawChart = (function (exports) {
|
|
|
542
543
|
}
|
|
543
544
|
}
|
|
544
545
|
|
|
545
|
-
treemap.round = function(x) {
|
|
546
|
-
return arguments.length ? (round = !!x, treemap) : round;
|
|
547
|
-
};
|
|
546
|
+
treemap.round = function(x) {
|
|
547
|
+
return arguments.length ? (round = !!x, treemap) : round;
|
|
548
|
+
};
|
|
549
|
+
|
|
550
|
+
treemap.size = function(x) {
|
|
551
|
+
return arguments.length ? (dx = +x[0], dy = +x[1], treemap) : [dx, dy];
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
treemap.tile = function(x) {
|
|
555
|
+
return arguments.length ? (tile = required(x), treemap) : tile;
|
|
556
|
+
};
|
|
557
|
+
|
|
558
|
+
treemap.padding = function(x) {
|
|
559
|
+
return arguments.length ? treemap.paddingInner(x).paddingOuter(x) : treemap.paddingInner();
|
|
560
|
+
};
|
|
561
|
+
|
|
562
|
+
treemap.paddingInner = function(x) {
|
|
563
|
+
return arguments.length ? (paddingInner = typeof x === "function" ? x : constant$1(+x), treemap) : paddingInner;
|
|
564
|
+
};
|
|
565
|
+
|
|
566
|
+
treemap.paddingOuter = function(x) {
|
|
567
|
+
return arguments.length ? treemap.paddingTop(x).paddingRight(x).paddingBottom(x).paddingLeft(x) : treemap.paddingTop();
|
|
568
|
+
};
|
|
569
|
+
|
|
570
|
+
treemap.paddingTop = function(x) {
|
|
571
|
+
return arguments.length ? (paddingTop = typeof x === "function" ? x : constant$1(+x), treemap) : paddingTop;
|
|
572
|
+
};
|
|
573
|
+
|
|
574
|
+
treemap.paddingRight = function(x) {
|
|
575
|
+
return arguments.length ? (paddingRight = typeof x === "function" ? x : constant$1(+x), treemap) : paddingRight;
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
treemap.paddingBottom = function(x) {
|
|
579
|
+
return arguments.length ? (paddingBottom = typeof x === "function" ? x : constant$1(+x), treemap) : paddingBottom;
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
treemap.paddingLeft = function(x) {
|
|
583
|
+
return arguments.length ? (paddingLeft = typeof x === "function" ? x : constant$1(+x), treemap) : paddingLeft;
|
|
584
|
+
};
|
|
585
|
+
|
|
586
|
+
return treemap;
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
var treemapResquarify = (function custom(ratio) {
|
|
590
|
+
|
|
591
|
+
function resquarify(parent, x0, y0, x1, y1) {
|
|
592
|
+
if ((rows = parent._squarify) && (rows.ratio === ratio)) {
|
|
593
|
+
var rows,
|
|
594
|
+
row,
|
|
595
|
+
nodes,
|
|
596
|
+
i,
|
|
597
|
+
j = -1,
|
|
598
|
+
n,
|
|
599
|
+
m = rows.length,
|
|
600
|
+
value = parent.value;
|
|
601
|
+
|
|
602
|
+
while (++j < m) {
|
|
603
|
+
row = rows[j], nodes = row.children;
|
|
604
|
+
for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
|
|
605
|
+
if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);
|
|
606
|
+
else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);
|
|
607
|
+
value -= row.value;
|
|
608
|
+
}
|
|
609
|
+
} else {
|
|
610
|
+
parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
611
|
+
rows.ratio = ratio;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
resquarify.ratio = function(x) {
|
|
616
|
+
return custom((x = +x) > 1 ? x : 1);
|
|
617
|
+
};
|
|
618
|
+
|
|
619
|
+
return resquarify;
|
|
620
|
+
})(phi);
|
|
621
|
+
|
|
622
|
+
const isModuleTree = (mod) => "children" in mod;
|
|
623
|
+
|
|
624
|
+
let count = 0;
|
|
625
|
+
class Id {
|
|
626
|
+
constructor(id) {
|
|
627
|
+
this._id = id;
|
|
628
|
+
const url = new URL(window.location.href);
|
|
629
|
+
url.hash = id;
|
|
630
|
+
this._href = url.toString();
|
|
631
|
+
}
|
|
632
|
+
get id() {
|
|
633
|
+
return this._id;
|
|
634
|
+
}
|
|
635
|
+
get href() {
|
|
636
|
+
return this._href;
|
|
637
|
+
}
|
|
638
|
+
toString() {
|
|
639
|
+
return `url(${this.href})`;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
function generateUniqueId(name) {
|
|
643
|
+
count += 1;
|
|
644
|
+
const id = ["O", name, count].filter(Boolean).join("-");
|
|
645
|
+
return new Id(id);
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
const LABELS = {
|
|
649
|
+
renderedLength: "Rendered",
|
|
650
|
+
gzipLength: "Gzip",
|
|
651
|
+
brotliLength: "Brotli",
|
|
652
|
+
};
|
|
653
|
+
const getAvailableSizeOptions = (options) => {
|
|
654
|
+
const availableSizeProperties = ["renderedLength"];
|
|
655
|
+
if (options.gzip) {
|
|
656
|
+
availableSizeProperties.push("gzipLength");
|
|
657
|
+
}
|
|
658
|
+
if (options.brotli) {
|
|
659
|
+
availableSizeProperties.push("brotliLength");
|
|
660
|
+
}
|
|
661
|
+
return availableSizeProperties;
|
|
662
|
+
};
|
|
663
|
+
|
|
664
|
+
var t,r,u,i,o=0,f=[],c=[],e=l$1.__b,a=l$1.__r,v=l$1.diffed,l=l$1.__c,m=l$1.unmount;function d(t,u){l$1.__h&&l$1.__h(r,t,o||u),o=0;var i=r.__H||(r.__H={__:[],__h:[]});return t>=i.__.length&&i.__.push({__V:c}),i.__[t]}function p(n){return o=1,y(B$1,n)}function y(n,u,i){var o=d(t++,2);if(o.t=n,!o.__c&&(o.__=[i?i(u):B$1(void 0,u),function(n){var t=o.__N?o.__N[0]:o.__[0],r=o.t(t,n);t!==r&&(o.__N=[r,o.__[1]],o.__c.setState({}));}],o.__c=r,!r.u)){r.u=!0;var f=r.shouldComponentUpdate;r.shouldComponentUpdate=function(n,t,r){if(!o.__c.__H)return !0;var u=o.__c.__H.__.filter(function(n){return n.__c});if(u.every(function(n){return !n.__N}))return !f||f.call(this,n,t,r);var i=!1;return u.forEach(function(n){if(n.__N){var t=n.__[0];n.__=n.__N,n.__N=void 0,t!==n.__[0]&&(i=!0);}}),!(!i&&o.__c.props===n)&&(!f||f.call(this,n,t,r))};}return o.__N||o.__}function h(u,i){var o=d(t++,3);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__H.__h.push(o));}function s(u,i){var o=d(t++,4);!l$1.__s&&z(o.__H,i)&&(o.__=u,o.i=i,r.__h.push(o));}function _(n){return o=5,F(function(){return {current:n}},[])}function F(n,r){var u=d(t++,7);return z(u.__H,r)?(u.__V=n(),u.i=r,u.__h=n,u.__V):u.__}function T(n,t){return o=8,F(function(){return n},t)}function q(n){var u=r.context[n.__c],i=d(t++,9);return i.c=n,u?(null==i.__&&(i.__=!0,u.sub(r)),u.props.value):n.__}function b(){for(var t;t=f.shift();)if(t.__P&&t.__H)try{t.__H.__h.forEach(k),t.__H.__h.forEach(w),t.__H.__h=[];}catch(r){t.__H.__h=[],l$1.__e(r,t.__v);}}l$1.__b=function(n){r=null,e&&e(n);},l$1.__r=function(n){a&&a(n),t=0;var i=(r=n.__c).__H;i&&(u===r?(i.__h=[],r.__h=[],i.__.forEach(function(n){n.__N&&(n.__=n.__N),n.__V=c,n.__N=n.i=void 0;})):(i.__h.forEach(k),i.__h.forEach(w),i.__h=[])),u=r;},l$1.diffed=function(t){v&&v(t);var o=t.__c;o&&o.__H&&(o.__H.__h.length&&(1!==f.push(o)&&i===l$1.requestAnimationFrame||((i=l$1.requestAnimationFrame)||j)(b)),o.__H.__.forEach(function(n){n.i&&(n.__H=n.i),n.__V!==c&&(n.__=n.__V),n.i=void 0,n.__V=c;})),u=r=null;},l$1.__c=function(t,r){r.some(function(t){try{t.__h.forEach(k),t.__h=t.__h.filter(function(n){return !n.__||w(n)});}catch(u){r.some(function(n){n.__h&&(n.__h=[]);}),r=[],l$1.__e(u,t.__v);}}),l&&l(t,r);},l$1.unmount=function(t){m&&m(t);var r,u=t.__c;u&&u.__H&&(u.__H.__.forEach(function(n){try{k(n);}catch(n){r=n;}}),u.__H=void 0,r&&l$1.__e(r,u.__v));};var g="function"==typeof requestAnimationFrame;function j(n){var t,r=function(){clearTimeout(u),g&&cancelAnimationFrame(t),setTimeout(n);},u=setTimeout(r,100);g&&(t=requestAnimationFrame(r));}function k(n){var t=r,u=n.__c;"function"==typeof u&&(n.__c=void 0,u()),r=t;}function w(n){var t=r;n.__c=n.__(),r=t;}function z(n,t){return !n||n.length!==t.length||t.some(function(t,r){return t!==n[r]})}function B$1(n,t){return "function"==typeof t?t(n):t}
|
|
665
|
+
|
|
666
|
+
const PLACEHOLDER = "bundle-*:**/file/**,**/file**, bundle-*:";
|
|
667
|
+
const SideBar = ({ availableSizeProperties, sizeProperty, setSizeProperty, onExcludeChange, onIncludeChange, }) => {
|
|
668
|
+
const [includeValue, setIncludeValue] = p("");
|
|
669
|
+
const [excludeValue, setExcludeValue] = p("");
|
|
670
|
+
const handleSizePropertyChange = (sizeProp) => () => {
|
|
671
|
+
if (sizeProp !== sizeProperty) {
|
|
672
|
+
setSizeProperty(sizeProp);
|
|
673
|
+
}
|
|
674
|
+
};
|
|
675
|
+
const handleIncludeChange = (event) => {
|
|
676
|
+
const value = event.currentTarget.value;
|
|
677
|
+
setIncludeValue(value);
|
|
678
|
+
onIncludeChange(value);
|
|
679
|
+
};
|
|
680
|
+
const handleExcludeChange = (event) => {
|
|
681
|
+
const value = event.currentTarget.value;
|
|
682
|
+
setExcludeValue(value);
|
|
683
|
+
onExcludeChange(value);
|
|
684
|
+
};
|
|
685
|
+
return (o$1("aside", Object.assign({ className: "sidebar" }, { children: [o$1("div", Object.assign({ className: "size-selectors" }, { children: availableSizeProperties.length > 1 &&
|
|
686
|
+
availableSizeProperties.map((sizeProp) => {
|
|
687
|
+
const id = `selector-${sizeProp}`;
|
|
688
|
+
return (o$1("div", Object.assign({ className: "size-selector" }, { children: [o$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }), o$1("label", Object.assign({ htmlFor: id }, { children: LABELS[sizeProp] }))] }), sizeProp));
|
|
689
|
+
}) })), o$1("div", Object.assign({ className: "module-filters" }, { children: [o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-exclude" }, { children: "Exclude" })), o$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange, placeholder: PLACEHOLDER })] })), o$1("div", Object.assign({ className: "module-filter" }, { children: [o$1("label", Object.assign({ htmlFor: "module-filter-include" }, { children: "Include" })), o$1("input", { type: "text", id: "module-filter-include", value: includeValue, onInput: handleIncludeChange, placeholder: PLACEHOLDER })] }))] }))] })));
|
|
690
|
+
};
|
|
691
|
+
|
|
692
|
+
function getDefaultExportFromCjs (x) {
|
|
693
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
var picomatchBrowserExports = {};
|
|
697
|
+
var picomatchBrowser = {
|
|
698
|
+
get exports(){ return picomatchBrowserExports; },
|
|
699
|
+
set exports(v){ picomatchBrowserExports = v; },
|
|
700
|
+
};
|
|
701
|
+
|
|
702
|
+
var utils$3 = {};
|
|
703
|
+
|
|
704
|
+
const WIN_SLASH = '\\\\/';
|
|
705
|
+
const WIN_NO_SLASH = `[^${WIN_SLASH}]`;
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Posix glob regex
|
|
709
|
+
*/
|
|
710
|
+
|
|
711
|
+
const DOT_LITERAL = '\\.';
|
|
712
|
+
const PLUS_LITERAL = '\\+';
|
|
713
|
+
const QMARK_LITERAL = '\\?';
|
|
714
|
+
const SLASH_LITERAL = '\\/';
|
|
715
|
+
const ONE_CHAR = '(?=.)';
|
|
716
|
+
const QMARK = '[^/]';
|
|
717
|
+
const END_ANCHOR = `(?:${SLASH_LITERAL}|$)`;
|
|
718
|
+
const START_ANCHOR = `(?:^|${SLASH_LITERAL})`;
|
|
719
|
+
const DOTS_SLASH = `${DOT_LITERAL}{1,2}${END_ANCHOR}`;
|
|
720
|
+
const NO_DOT = `(?!${DOT_LITERAL})`;
|
|
721
|
+
const NO_DOTS = `(?!${START_ANCHOR}${DOTS_SLASH})`;
|
|
722
|
+
const NO_DOT_SLASH = `(?!${DOT_LITERAL}{0,1}${END_ANCHOR})`;
|
|
723
|
+
const NO_DOTS_SLASH = `(?!${DOTS_SLASH})`;
|
|
724
|
+
const QMARK_NO_DOT = `[^.${SLASH_LITERAL}]`;
|
|
725
|
+
const STAR = `${QMARK}*?`;
|
|
726
|
+
const SEP = '/';
|
|
727
|
+
|
|
728
|
+
const POSIX_CHARS = {
|
|
729
|
+
DOT_LITERAL,
|
|
730
|
+
PLUS_LITERAL,
|
|
731
|
+
QMARK_LITERAL,
|
|
732
|
+
SLASH_LITERAL,
|
|
733
|
+
ONE_CHAR,
|
|
734
|
+
QMARK,
|
|
735
|
+
END_ANCHOR,
|
|
736
|
+
DOTS_SLASH,
|
|
737
|
+
NO_DOT,
|
|
738
|
+
NO_DOTS,
|
|
739
|
+
NO_DOT_SLASH,
|
|
740
|
+
NO_DOTS_SLASH,
|
|
741
|
+
QMARK_NO_DOT,
|
|
742
|
+
STAR,
|
|
743
|
+
START_ANCHOR,
|
|
744
|
+
SEP
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
/**
|
|
748
|
+
* Windows glob regex
|
|
749
|
+
*/
|
|
750
|
+
|
|
751
|
+
const WINDOWS_CHARS = {
|
|
752
|
+
...POSIX_CHARS,
|
|
753
|
+
|
|
754
|
+
SLASH_LITERAL: `[${WIN_SLASH}]`,
|
|
755
|
+
QMARK: WIN_NO_SLASH,
|
|
756
|
+
STAR: `${WIN_NO_SLASH}*?`,
|
|
757
|
+
DOTS_SLASH: `${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$)`,
|
|
758
|
+
NO_DOT: `(?!${DOT_LITERAL})`,
|
|
759
|
+
NO_DOTS: `(?!(?:^|[${WIN_SLASH}])${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
760
|
+
NO_DOT_SLASH: `(?!${DOT_LITERAL}{0,1}(?:[${WIN_SLASH}]|$))`,
|
|
761
|
+
NO_DOTS_SLASH: `(?!${DOT_LITERAL}{1,2}(?:[${WIN_SLASH}]|$))`,
|
|
762
|
+
QMARK_NO_DOT: `[^.${WIN_SLASH}]`,
|
|
763
|
+
START_ANCHOR: `(?:^|[${WIN_SLASH}])`,
|
|
764
|
+
END_ANCHOR: `(?:[${WIN_SLASH}]|$)`,
|
|
765
|
+
SEP: '\\'
|
|
766
|
+
};
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* POSIX Bracket Regex
|
|
770
|
+
*/
|
|
771
|
+
|
|
772
|
+
const POSIX_REGEX_SOURCE$1 = {
|
|
773
|
+
alnum: 'a-zA-Z0-9',
|
|
774
|
+
alpha: 'a-zA-Z',
|
|
775
|
+
ascii: '\\x00-\\x7F',
|
|
776
|
+
blank: ' \\t',
|
|
777
|
+
cntrl: '\\x00-\\x1F\\x7F',
|
|
778
|
+
digit: '0-9',
|
|
779
|
+
graph: '\\x21-\\x7E',
|
|
780
|
+
lower: 'a-z',
|
|
781
|
+
print: '\\x20-\\x7E ',
|
|
782
|
+
punct: '\\-!"#$%&\'()\\*+,./:;<=>?@[\\]^_`{|}~',
|
|
783
|
+
space: ' \\t\\r\\n\\v\\f',
|
|
784
|
+
upper: 'A-Z',
|
|
785
|
+
word: 'A-Za-z0-9_',
|
|
786
|
+
xdigit: 'A-Fa-f0-9'
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
var constants$3 = {
|
|
790
|
+
MAX_LENGTH: 1024 * 64,
|
|
791
|
+
POSIX_REGEX_SOURCE: POSIX_REGEX_SOURCE$1,
|
|
792
|
+
|
|
793
|
+
// regular expressions
|
|
794
|
+
REGEX_BACKSLASH: /\\(?![*+?^${}(|)[\]])/g,
|
|
795
|
+
REGEX_NON_SPECIAL_CHARS: /^[^@![\].,$*+?^{}()|\\/]+/,
|
|
796
|
+
REGEX_SPECIAL_CHARS: /[-*+?.^${}(|)[\]]/,
|
|
797
|
+
REGEX_SPECIAL_CHARS_BACKREF: /(\\?)((\W)(\3*))/g,
|
|
798
|
+
REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
|
|
799
|
+
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,
|
|
800
|
+
|
|
801
|
+
// Replace globs with equivalent patterns to reduce parsing time.
|
|
802
|
+
REPLACEMENTS: {
|
|
803
|
+
'***': '*',
|
|
804
|
+
'**/**': '**',
|
|
805
|
+
'**/**/**': '**'
|
|
806
|
+
},
|
|
807
|
+
|
|
808
|
+
// Digits
|
|
809
|
+
CHAR_0: 48, /* 0 */
|
|
810
|
+
CHAR_9: 57, /* 9 */
|
|
811
|
+
|
|
812
|
+
// Alphabet chars.
|
|
813
|
+
CHAR_UPPERCASE_A: 65, /* A */
|
|
814
|
+
CHAR_LOWERCASE_A: 97, /* a */
|
|
815
|
+
CHAR_UPPERCASE_Z: 90, /* Z */
|
|
816
|
+
CHAR_LOWERCASE_Z: 122, /* z */
|
|
817
|
+
|
|
818
|
+
CHAR_LEFT_PARENTHESES: 40, /* ( */
|
|
819
|
+
CHAR_RIGHT_PARENTHESES: 41, /* ) */
|
|
820
|
+
|
|
821
|
+
CHAR_ASTERISK: 42, /* * */
|
|
822
|
+
|
|
823
|
+
// Non-alphabetic chars.
|
|
824
|
+
CHAR_AMPERSAND: 38, /* & */
|
|
825
|
+
CHAR_AT: 64, /* @ */
|
|
826
|
+
CHAR_BACKWARD_SLASH: 92, /* \ */
|
|
827
|
+
CHAR_CARRIAGE_RETURN: 13, /* \r */
|
|
828
|
+
CHAR_CIRCUMFLEX_ACCENT: 94, /* ^ */
|
|
829
|
+
CHAR_COLON: 58, /* : */
|
|
830
|
+
CHAR_COMMA: 44, /* , */
|
|
831
|
+
CHAR_DOT: 46, /* . */
|
|
832
|
+
CHAR_DOUBLE_QUOTE: 34, /* " */
|
|
833
|
+
CHAR_EQUAL: 61, /* = */
|
|
834
|
+
CHAR_EXCLAMATION_MARK: 33, /* ! */
|
|
835
|
+
CHAR_FORM_FEED: 12, /* \f */
|
|
836
|
+
CHAR_FORWARD_SLASH: 47, /* / */
|
|
837
|
+
CHAR_GRAVE_ACCENT: 96, /* ` */
|
|
838
|
+
CHAR_HASH: 35, /* # */
|
|
839
|
+
CHAR_HYPHEN_MINUS: 45, /* - */
|
|
840
|
+
CHAR_LEFT_ANGLE_BRACKET: 60, /* < */
|
|
841
|
+
CHAR_LEFT_CURLY_BRACE: 123, /* { */
|
|
842
|
+
CHAR_LEFT_SQUARE_BRACKET: 91, /* [ */
|
|
843
|
+
CHAR_LINE_FEED: 10, /* \n */
|
|
844
|
+
CHAR_NO_BREAK_SPACE: 160, /* \u00A0 */
|
|
845
|
+
CHAR_PERCENT: 37, /* % */
|
|
846
|
+
CHAR_PLUS: 43, /* + */
|
|
847
|
+
CHAR_QUESTION_MARK: 63, /* ? */
|
|
848
|
+
CHAR_RIGHT_ANGLE_BRACKET: 62, /* > */
|
|
849
|
+
CHAR_RIGHT_CURLY_BRACE: 125, /* } */
|
|
850
|
+
CHAR_RIGHT_SQUARE_BRACKET: 93, /* ] */
|
|
851
|
+
CHAR_SEMICOLON: 59, /* ; */
|
|
852
|
+
CHAR_SINGLE_QUOTE: 39, /* ' */
|
|
853
|
+
CHAR_SPACE: 32, /* */
|
|
854
|
+
CHAR_TAB: 9, /* \t */
|
|
855
|
+
CHAR_UNDERSCORE: 95, /* _ */
|
|
856
|
+
CHAR_VERTICAL_LINE: 124, /* | */
|
|
857
|
+
CHAR_ZERO_WIDTH_NOBREAK_SPACE: 65279, /* \uFEFF */
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Create EXTGLOB_CHARS
|
|
861
|
+
*/
|
|
862
|
+
|
|
863
|
+
extglobChars(chars) {
|
|
864
|
+
return {
|
|
865
|
+
'!': { type: 'negate', open: '(?:(?!(?:', close: `))${chars.STAR})` },
|
|
866
|
+
'?': { type: 'qmark', open: '(?:', close: ')?' },
|
|
867
|
+
'+': { type: 'plus', open: '(?:', close: ')+' },
|
|
868
|
+
'*': { type: 'star', open: '(?:', close: ')*' },
|
|
869
|
+
'@': { type: 'at', open: '(?:', close: ')' }
|
|
870
|
+
};
|
|
871
|
+
},
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Create GLOB_CHARS
|
|
875
|
+
*/
|
|
876
|
+
|
|
877
|
+
globChars(win32) {
|
|
878
|
+
return win32 === true ? WINDOWS_CHARS : POSIX_CHARS;
|
|
879
|
+
}
|
|
880
|
+
};
|
|
881
|
+
|
|
882
|
+
(function (exports) {
|
|
883
|
+
|
|
884
|
+
const {
|
|
885
|
+
REGEX_BACKSLASH,
|
|
886
|
+
REGEX_REMOVE_BACKSLASH,
|
|
887
|
+
REGEX_SPECIAL_CHARS,
|
|
888
|
+
REGEX_SPECIAL_CHARS_GLOBAL
|
|
889
|
+
} = constants$3;
|
|
890
|
+
|
|
891
|
+
exports.isObject = val => val !== null && typeof val === 'object' && !Array.isArray(val);
|
|
892
|
+
exports.hasRegexChars = str => REGEX_SPECIAL_CHARS.test(str);
|
|
893
|
+
exports.isRegexChar = str => str.length === 1 && exports.hasRegexChars(str);
|
|
894
|
+
exports.escapeRegex = str => str.replace(REGEX_SPECIAL_CHARS_GLOBAL, '\\$1');
|
|
895
|
+
exports.toPosixSlashes = str => str.replace(REGEX_BACKSLASH, '/');
|
|
896
|
+
|
|
897
|
+
exports.removeBackslashes = str => {
|
|
898
|
+
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
|
|
899
|
+
return match === '\\' ? '' : match;
|
|
900
|
+
});
|
|
901
|
+
};
|
|
902
|
+
|
|
903
|
+
exports.supportsLookbehinds = () => {
|
|
904
|
+
const segs = process.version.slice(1).split('.').map(Number);
|
|
905
|
+
if (segs.length === 3 && segs[0] >= 9 || (segs[0] === 8 && segs[1] >= 10)) {
|
|
906
|
+
return true;
|
|
907
|
+
}
|
|
908
|
+
return false;
|
|
909
|
+
};
|
|
910
|
+
|
|
911
|
+
exports.escapeLast = (input, char, lastIdx) => {
|
|
912
|
+
const idx = input.lastIndexOf(char, lastIdx);
|
|
913
|
+
if (idx === -1) return input;
|
|
914
|
+
if (input[idx - 1] === '\\') return exports.escapeLast(input, char, idx - 1);
|
|
915
|
+
return `${input.slice(0, idx)}\\${input.slice(idx)}`;
|
|
916
|
+
};
|
|
917
|
+
|
|
918
|
+
exports.removePrefix = (input, state = {}) => {
|
|
919
|
+
let output = input;
|
|
920
|
+
if (output.startsWith('./')) {
|
|
921
|
+
output = output.slice(2);
|
|
922
|
+
state.prefix = './';
|
|
923
|
+
}
|
|
924
|
+
return output;
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
exports.wrapOutput = (input, state = {}, options = {}) => {
|
|
928
|
+
const prepend = options.contains ? '' : '^';
|
|
929
|
+
const append = options.contains ? '' : '$';
|
|
930
|
+
|
|
931
|
+
let output = `${prepend}(?:${input})${append}`;
|
|
932
|
+
if (state.negated === true) {
|
|
933
|
+
output = `(?:^(?!${output}).*$)`;
|
|
934
|
+
}
|
|
935
|
+
return output;
|
|
936
|
+
};
|
|
937
|
+
|
|
938
|
+
exports.basename = (path, { windows } = {}) => {
|
|
939
|
+
if (windows) {
|
|
940
|
+
return path.replace(/[\\/]$/, '').replace(/.*[\\/]/, '');
|
|
941
|
+
} else {
|
|
942
|
+
return path.replace(/\/$/, '').replace(/.*\//, '');
|
|
943
|
+
}
|
|
944
|
+
};
|
|
945
|
+
} (utils$3));
|
|
946
|
+
|
|
947
|
+
const utils$2 = utils$3;
|
|
948
|
+
const {
|
|
949
|
+
CHAR_ASTERISK, /* * */
|
|
950
|
+
CHAR_AT, /* @ */
|
|
951
|
+
CHAR_BACKWARD_SLASH, /* \ */
|
|
952
|
+
CHAR_COMMA, /* , */
|
|
953
|
+
CHAR_DOT, /* . */
|
|
954
|
+
CHAR_EXCLAMATION_MARK, /* ! */
|
|
955
|
+
CHAR_FORWARD_SLASH, /* / */
|
|
956
|
+
CHAR_LEFT_CURLY_BRACE, /* { */
|
|
957
|
+
CHAR_LEFT_PARENTHESES, /* ( */
|
|
958
|
+
CHAR_LEFT_SQUARE_BRACKET, /* [ */
|
|
959
|
+
CHAR_PLUS, /* + */
|
|
960
|
+
CHAR_QUESTION_MARK, /* ? */
|
|
961
|
+
CHAR_RIGHT_CURLY_BRACE, /* } */
|
|
962
|
+
CHAR_RIGHT_PARENTHESES, /* ) */
|
|
963
|
+
CHAR_RIGHT_SQUARE_BRACKET /* ] */
|
|
964
|
+
} = constants$3;
|
|
965
|
+
|
|
966
|
+
const isPathSeparator = code => {
|
|
967
|
+
return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
|
|
968
|
+
};
|
|
969
|
+
|
|
970
|
+
const depth = token => {
|
|
971
|
+
if (token.isPrefix !== true) {
|
|
972
|
+
token.depth = token.isGlobstar ? Infinity : 1;
|
|
973
|
+
}
|
|
974
|
+
};
|
|
975
|
+
|
|
976
|
+
/**
|
|
977
|
+
* Quickly scans a glob pattern and returns an object with a handful of
|
|
978
|
+
* useful properties, like `isGlob`, `path` (the leading non-glob, if it exists),
|
|
979
|
+
* `glob` (the actual pattern), and `negated` (true if the path starts with `!`).
|
|
980
|
+
*
|
|
981
|
+
* ```js
|
|
982
|
+
* const pm = require('picomatch');
|
|
983
|
+
* console.log(pm.scan('foo/bar/*.js'));
|
|
984
|
+
* { isGlob: true, input: 'foo/bar/*.js', base: 'foo/bar', glob: '*.js' }
|
|
985
|
+
* ```
|
|
986
|
+
* @param {String} `str`
|
|
987
|
+
* @param {Object} `options`
|
|
988
|
+
* @return {Object} Returns an object with tokens and regex source string.
|
|
989
|
+
* @api public
|
|
990
|
+
*/
|
|
991
|
+
|
|
992
|
+
const scan$1 = (input, options) => {
|
|
993
|
+
const opts = options || {};
|
|
994
|
+
|
|
995
|
+
const length = input.length - 1;
|
|
996
|
+
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
|
|
997
|
+
const slashes = [];
|
|
998
|
+
const tokens = [];
|
|
999
|
+
const parts = [];
|
|
1000
|
+
|
|
1001
|
+
let str = input;
|
|
1002
|
+
let index = -1;
|
|
1003
|
+
let start = 0;
|
|
1004
|
+
let lastIndex = 0;
|
|
1005
|
+
let isBrace = false;
|
|
1006
|
+
let isBracket = false;
|
|
1007
|
+
let isGlob = false;
|
|
1008
|
+
let isExtglob = false;
|
|
1009
|
+
let isGlobstar = false;
|
|
1010
|
+
let braceEscaped = false;
|
|
1011
|
+
let backslashes = false;
|
|
1012
|
+
let negated = false;
|
|
1013
|
+
let finished = false;
|
|
1014
|
+
let braces = 0;
|
|
1015
|
+
let prev;
|
|
1016
|
+
let code;
|
|
1017
|
+
let token = { value: '', depth: 0, isGlob: false };
|
|
1018
|
+
|
|
1019
|
+
const eos = () => index >= length;
|
|
1020
|
+
const peek = () => str.charCodeAt(index + 1);
|
|
1021
|
+
const advance = () => {
|
|
1022
|
+
prev = code;
|
|
1023
|
+
return str.charCodeAt(++index);
|
|
1024
|
+
};
|
|
1025
|
+
|
|
1026
|
+
while (index < length) {
|
|
1027
|
+
code = advance();
|
|
1028
|
+
let next;
|
|
1029
|
+
|
|
1030
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1031
|
+
backslashes = token.backslashes = true;
|
|
1032
|
+
code = advance();
|
|
1033
|
+
|
|
1034
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1035
|
+
braceEscaped = true;
|
|
1036
|
+
}
|
|
1037
|
+
continue;
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
if (braceEscaped === true || code === CHAR_LEFT_CURLY_BRACE) {
|
|
1041
|
+
braces++;
|
|
1042
|
+
|
|
1043
|
+
while (eos() !== true && (code = advance())) {
|
|
1044
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1045
|
+
backslashes = token.backslashes = true;
|
|
1046
|
+
advance();
|
|
1047
|
+
continue;
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
if (code === CHAR_LEFT_CURLY_BRACE) {
|
|
1051
|
+
braces++;
|
|
1052
|
+
continue;
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
if (braceEscaped !== true && code === CHAR_DOT && (code = advance()) === CHAR_DOT) {
|
|
1056
|
+
isBrace = token.isBrace = true;
|
|
1057
|
+
isGlob = token.isGlob = true;
|
|
1058
|
+
finished = true;
|
|
1059
|
+
|
|
1060
|
+
if (scanToEnd === true) {
|
|
1061
|
+
continue;
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
break;
|
|
1065
|
+
}
|
|
1066
|
+
|
|
1067
|
+
if (braceEscaped !== true && code === CHAR_COMMA) {
|
|
1068
|
+
isBrace = token.isBrace = true;
|
|
1069
|
+
isGlob = token.isGlob = true;
|
|
1070
|
+
finished = true;
|
|
1071
|
+
|
|
1072
|
+
if (scanToEnd === true) {
|
|
1073
|
+
continue;
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
break;
|
|
1077
|
+
}
|
|
1078
|
+
|
|
1079
|
+
if (code === CHAR_RIGHT_CURLY_BRACE) {
|
|
1080
|
+
braces--;
|
|
1081
|
+
|
|
1082
|
+
if (braces === 0) {
|
|
1083
|
+
braceEscaped = false;
|
|
1084
|
+
isBrace = token.isBrace = true;
|
|
1085
|
+
finished = true;
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
if (scanToEnd === true) {
|
|
1092
|
+
continue;
|
|
1093
|
+
}
|
|
1094
|
+
|
|
1095
|
+
break;
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
if (code === CHAR_FORWARD_SLASH) {
|
|
1099
|
+
slashes.push(index);
|
|
1100
|
+
tokens.push(token);
|
|
1101
|
+
token = { value: '', depth: 0, isGlob: false };
|
|
1102
|
+
|
|
1103
|
+
if (finished === true) continue;
|
|
1104
|
+
if (prev === CHAR_DOT && index === (start + 1)) {
|
|
1105
|
+
start += 2;
|
|
1106
|
+
continue;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
lastIndex = index + 1;
|
|
1110
|
+
continue;
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
if (opts.noext !== true) {
|
|
1114
|
+
const isExtglobChar = code === CHAR_PLUS
|
|
1115
|
+
|| code === CHAR_AT
|
|
1116
|
+
|| code === CHAR_ASTERISK
|
|
1117
|
+
|| code === CHAR_QUESTION_MARK
|
|
1118
|
+
|| code === CHAR_EXCLAMATION_MARK;
|
|
1119
|
+
|
|
1120
|
+
if (isExtglobChar === true && peek() === CHAR_LEFT_PARENTHESES) {
|
|
1121
|
+
isGlob = token.isGlob = true;
|
|
1122
|
+
isExtglob = token.isExtglob = true;
|
|
1123
|
+
finished = true;
|
|
1124
|
+
|
|
1125
|
+
if (scanToEnd === true) {
|
|
1126
|
+
while (eos() !== true && (code = advance())) {
|
|
1127
|
+
if (code === CHAR_BACKWARD_SLASH) {
|
|
1128
|
+
backslashes = token.backslashes = true;
|
|
1129
|
+
code = advance();
|
|
1130
|
+
continue;
|
|
1131
|
+
}
|
|
1132
|
+
|
|
1133
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1134
|
+
isGlob = token.isGlob = true;
|
|
1135
|
+
finished = true;
|
|
1136
|
+
break;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
continue;
|
|
1140
|
+
}
|
|
1141
|
+
break;
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
|
|
1145
|
+
if (code === CHAR_ASTERISK) {
|
|
1146
|
+
if (prev === CHAR_ASTERISK) isGlobstar = token.isGlobstar = true;
|
|
1147
|
+
isGlob = token.isGlob = true;
|
|
1148
|
+
finished = true;
|
|
1149
|
+
|
|
1150
|
+
if (scanToEnd === true) {
|
|
1151
|
+
continue;
|
|
1152
|
+
}
|
|
1153
|
+
break;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
if (code === CHAR_QUESTION_MARK) {
|
|
1157
|
+
isGlob = token.isGlob = true;
|
|
1158
|
+
finished = true;
|
|
1159
|
+
|
|
1160
|
+
if (scanToEnd === true) {
|
|
1161
|
+
continue;
|
|
1162
|
+
}
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
|
|
1166
|
+
if (code === CHAR_LEFT_SQUARE_BRACKET) {
|
|
1167
|
+
while (eos() !== true && (next = advance())) {
|
|
1168
|
+
if (next === CHAR_BACKWARD_SLASH) {
|
|
1169
|
+
backslashes = token.backslashes = true;
|
|
1170
|
+
advance();
|
|
1171
|
+
continue;
|
|
1172
|
+
}
|
|
1173
|
+
|
|
1174
|
+
if (next === CHAR_RIGHT_SQUARE_BRACKET) {
|
|
1175
|
+
isBracket = token.isBracket = true;
|
|
1176
|
+
isGlob = token.isGlob = true;
|
|
1177
|
+
finished = true;
|
|
1178
|
+
|
|
1179
|
+
if (scanToEnd === true) {
|
|
1180
|
+
continue;
|
|
1181
|
+
}
|
|
1182
|
+
break;
|
|
1183
|
+
}
|
|
1184
|
+
}
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
|
|
1188
|
+
negated = token.negated = true;
|
|
1189
|
+
start++;
|
|
1190
|
+
continue;
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
if (opts.noparen !== true && code === CHAR_LEFT_PARENTHESES) {
|
|
1194
|
+
isGlob = token.isGlob = true;
|
|
1195
|
+
|
|
1196
|
+
if (scanToEnd === true) {
|
|
1197
|
+
while (eos() !== true && (code = advance())) {
|
|
1198
|
+
if (code === CHAR_LEFT_PARENTHESES) {
|
|
1199
|
+
backslashes = token.backslashes = true;
|
|
1200
|
+
code = advance();
|
|
1201
|
+
continue;
|
|
1202
|
+
}
|
|
1203
|
+
|
|
1204
|
+
if (code === CHAR_RIGHT_PARENTHESES) {
|
|
1205
|
+
finished = true;
|
|
1206
|
+
break;
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1209
|
+
continue;
|
|
1210
|
+
}
|
|
1211
|
+
break;
|
|
1212
|
+
}
|
|
1213
|
+
|
|
1214
|
+
if (isGlob === true) {
|
|
1215
|
+
finished = true;
|
|
1216
|
+
|
|
1217
|
+
if (scanToEnd === true) {
|
|
1218
|
+
continue;
|
|
1219
|
+
}
|
|
1220
|
+
|
|
1221
|
+
break;
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
|
|
1225
|
+
if (opts.noext === true) {
|
|
1226
|
+
isExtglob = false;
|
|
1227
|
+
isGlob = false;
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
let base = str;
|
|
1231
|
+
let prefix = '';
|
|
1232
|
+
let glob = '';
|
|
1233
|
+
|
|
1234
|
+
if (start > 0) {
|
|
1235
|
+
prefix = str.slice(0, start);
|
|
1236
|
+
str = str.slice(start);
|
|
1237
|
+
lastIndex -= start;
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
if (base && isGlob === true && lastIndex > 0) {
|
|
1241
|
+
base = str.slice(0, lastIndex);
|
|
1242
|
+
glob = str.slice(lastIndex);
|
|
1243
|
+
} else if (isGlob === true) {
|
|
1244
|
+
base = '';
|
|
1245
|
+
glob = str;
|
|
1246
|
+
} else {
|
|
1247
|
+
base = str;
|
|
1248
|
+
}
|
|
1249
|
+
|
|
1250
|
+
if (base && base !== '' && base !== '/' && base !== str) {
|
|
1251
|
+
if (isPathSeparator(base.charCodeAt(base.length - 1))) {
|
|
1252
|
+
base = base.slice(0, -1);
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
if (opts.unescape === true) {
|
|
1257
|
+
if (glob) glob = utils$2.removeBackslashes(glob);
|
|
1258
|
+
|
|
1259
|
+
if (base && backslashes === true) {
|
|
1260
|
+
base = utils$2.removeBackslashes(base);
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
const state = {
|
|
1265
|
+
prefix,
|
|
1266
|
+
input,
|
|
1267
|
+
start,
|
|
1268
|
+
base,
|
|
1269
|
+
glob,
|
|
1270
|
+
isBrace,
|
|
1271
|
+
isBracket,
|
|
1272
|
+
isGlob,
|
|
1273
|
+
isExtglob,
|
|
1274
|
+
isGlobstar,
|
|
1275
|
+
negated
|
|
1276
|
+
};
|
|
1277
|
+
|
|
1278
|
+
if (opts.tokens === true) {
|
|
1279
|
+
state.maxDepth = 0;
|
|
1280
|
+
if (!isPathSeparator(code)) {
|
|
1281
|
+
tokens.push(token);
|
|
1282
|
+
}
|
|
1283
|
+
state.tokens = tokens;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
if (opts.parts === true || opts.tokens === true) {
|
|
1287
|
+
let prevIndex;
|
|
1288
|
+
|
|
1289
|
+
for (let idx = 0; idx < slashes.length; idx++) {
|
|
1290
|
+
const n = prevIndex ? prevIndex + 1 : start;
|
|
1291
|
+
const i = slashes[idx];
|
|
1292
|
+
const value = input.slice(n, i);
|
|
1293
|
+
if (opts.tokens) {
|
|
1294
|
+
if (idx === 0 && start !== 0) {
|
|
1295
|
+
tokens[idx].isPrefix = true;
|
|
1296
|
+
tokens[idx].value = prefix;
|
|
1297
|
+
} else {
|
|
1298
|
+
tokens[idx].value = value;
|
|
1299
|
+
}
|
|
1300
|
+
depth(tokens[idx]);
|
|
1301
|
+
state.maxDepth += tokens[idx].depth;
|
|
1302
|
+
}
|
|
1303
|
+
if (idx !== 0 || value !== '') {
|
|
1304
|
+
parts.push(value);
|
|
1305
|
+
}
|
|
1306
|
+
prevIndex = i;
|
|
1307
|
+
}
|
|
1308
|
+
|
|
1309
|
+
if (prevIndex && prevIndex + 1 < input.length) {
|
|
1310
|
+
const value = input.slice(prevIndex + 1);
|
|
1311
|
+
parts.push(value);
|
|
1312
|
+
|
|
1313
|
+
if (opts.tokens) {
|
|
1314
|
+
tokens[tokens.length - 1].value = value;
|
|
1315
|
+
depth(tokens[tokens.length - 1]);
|
|
1316
|
+
state.maxDepth += tokens[tokens.length - 1].depth;
|
|
1317
|
+
}
|
|
1318
|
+
}
|
|
1319
|
+
|
|
1320
|
+
state.slashes = slashes;
|
|
1321
|
+
state.parts = parts;
|
|
1322
|
+
}
|
|
1323
|
+
|
|
1324
|
+
return state;
|
|
1325
|
+
};
|
|
1326
|
+
|
|
1327
|
+
var scan_1 = scan$1;
|
|
1328
|
+
|
|
1329
|
+
const constants$2 = constants$3;
|
|
1330
|
+
const utils$1 = utils$3;
|
|
1331
|
+
|
|
1332
|
+
/**
|
|
1333
|
+
* Constants
|
|
1334
|
+
*/
|
|
1335
|
+
|
|
1336
|
+
const {
|
|
1337
|
+
MAX_LENGTH,
|
|
1338
|
+
POSIX_REGEX_SOURCE,
|
|
1339
|
+
REGEX_NON_SPECIAL_CHARS,
|
|
1340
|
+
REGEX_SPECIAL_CHARS_BACKREF,
|
|
1341
|
+
REPLACEMENTS
|
|
1342
|
+
} = constants$2;
|
|
1343
|
+
|
|
1344
|
+
/**
|
|
1345
|
+
* Helpers
|
|
1346
|
+
*/
|
|
1347
|
+
|
|
1348
|
+
const expandRange = (args, options) => {
|
|
1349
|
+
if (typeof options.expandRange === 'function') {
|
|
1350
|
+
return options.expandRange(...args, options);
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
args.sort();
|
|
1354
|
+
const value = `[${args.join('-')}]`;
|
|
1355
|
+
|
|
1356
|
+
try {
|
|
1357
|
+
/* eslint-disable-next-line no-new */
|
|
1358
|
+
new RegExp(value);
|
|
1359
|
+
} catch (ex) {
|
|
1360
|
+
return args.map(v => utils$1.escapeRegex(v)).join('..');
|
|
1361
|
+
}
|
|
1362
|
+
|
|
1363
|
+
return value;
|
|
1364
|
+
};
|
|
1365
|
+
|
|
1366
|
+
/**
|
|
1367
|
+
* Create the message for a syntax error
|
|
1368
|
+
*/
|
|
1369
|
+
|
|
1370
|
+
const syntaxError = (type, char) => {
|
|
1371
|
+
return `Missing ${type}: "${char}" - use "\\\\${char}" to match literal characters`;
|
|
1372
|
+
};
|
|
1373
|
+
|
|
1374
|
+
/**
|
|
1375
|
+
* Parse the given input string.
|
|
1376
|
+
* @param {String} input
|
|
1377
|
+
* @param {Object} options
|
|
1378
|
+
* @return {Object}
|
|
1379
|
+
*/
|
|
1380
|
+
|
|
1381
|
+
const parse$2 = (input, options) => {
|
|
1382
|
+
if (typeof input !== 'string') {
|
|
1383
|
+
throw new TypeError('Expected a string');
|
|
1384
|
+
}
|
|
1385
|
+
|
|
1386
|
+
input = REPLACEMENTS[input] || input;
|
|
1387
|
+
|
|
1388
|
+
const opts = { ...options };
|
|
1389
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
1390
|
+
|
|
1391
|
+
let len = input.length;
|
|
1392
|
+
if (len > max) {
|
|
1393
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
1394
|
+
}
|
|
1395
|
+
|
|
1396
|
+
const bos = { type: 'bos', value: '', output: opts.prepend || '' };
|
|
1397
|
+
const tokens = [bos];
|
|
1398
|
+
|
|
1399
|
+
const capture = opts.capture ? '' : '?:';
|
|
1400
|
+
|
|
1401
|
+
// create constants based on platform, for windows or posix
|
|
1402
|
+
const PLATFORM_CHARS = constants$2.globChars(opts.windows);
|
|
1403
|
+
const EXTGLOB_CHARS = constants$2.extglobChars(PLATFORM_CHARS);
|
|
1404
|
+
|
|
1405
|
+
const {
|
|
1406
|
+
DOT_LITERAL,
|
|
1407
|
+
PLUS_LITERAL,
|
|
1408
|
+
SLASH_LITERAL,
|
|
1409
|
+
ONE_CHAR,
|
|
1410
|
+
DOTS_SLASH,
|
|
1411
|
+
NO_DOT,
|
|
1412
|
+
NO_DOT_SLASH,
|
|
1413
|
+
NO_DOTS_SLASH,
|
|
1414
|
+
QMARK,
|
|
1415
|
+
QMARK_NO_DOT,
|
|
1416
|
+
STAR,
|
|
1417
|
+
START_ANCHOR
|
|
1418
|
+
} = PLATFORM_CHARS;
|
|
1419
|
+
|
|
1420
|
+
const globstar = (opts) => {
|
|
1421
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
1422
|
+
};
|
|
1423
|
+
|
|
1424
|
+
const nodot = opts.dot ? '' : NO_DOT;
|
|
1425
|
+
const qmarkNoDot = opts.dot ? QMARK : QMARK_NO_DOT;
|
|
1426
|
+
let star = opts.bash === true ? globstar(opts) : STAR;
|
|
1427
|
+
|
|
1428
|
+
if (opts.capture) {
|
|
1429
|
+
star = `(${star})`;
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
// minimatch options support
|
|
1433
|
+
if (typeof opts.noext === 'boolean') {
|
|
1434
|
+
opts.noextglob = opts.noext;
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
const state = {
|
|
1438
|
+
input,
|
|
1439
|
+
index: -1,
|
|
1440
|
+
start: 0,
|
|
1441
|
+
dot: opts.dot === true,
|
|
1442
|
+
consumed: '',
|
|
1443
|
+
output: '',
|
|
1444
|
+
prefix: '',
|
|
1445
|
+
backtrack: false,
|
|
1446
|
+
negated: false,
|
|
1447
|
+
brackets: 0,
|
|
1448
|
+
braces: 0,
|
|
1449
|
+
parens: 0,
|
|
1450
|
+
quotes: 0,
|
|
1451
|
+
globstar: false,
|
|
1452
|
+
tokens
|
|
1453
|
+
};
|
|
1454
|
+
|
|
1455
|
+
input = utils$1.removePrefix(input, state);
|
|
1456
|
+
len = input.length;
|
|
1457
|
+
|
|
1458
|
+
const extglobs = [];
|
|
1459
|
+
const braces = [];
|
|
1460
|
+
const stack = [];
|
|
1461
|
+
let prev = bos;
|
|
1462
|
+
let value;
|
|
1463
|
+
|
|
1464
|
+
/**
|
|
1465
|
+
* Tokenizing helpers
|
|
1466
|
+
*/
|
|
1467
|
+
|
|
1468
|
+
const eos = () => state.index === len - 1;
|
|
1469
|
+
const peek = state.peek = (n = 1) => input[state.index + n];
|
|
1470
|
+
const advance = state.advance = () => input[++state.index];
|
|
1471
|
+
const remaining = () => input.slice(state.index + 1);
|
|
1472
|
+
const consume = (value = '', num = 0) => {
|
|
1473
|
+
state.consumed += value;
|
|
1474
|
+
state.index += num;
|
|
1475
|
+
};
|
|
1476
|
+
const append = token => {
|
|
1477
|
+
state.output += token.output != null ? token.output : token.value;
|
|
1478
|
+
consume(token.value);
|
|
1479
|
+
};
|
|
1480
|
+
|
|
1481
|
+
const negate = () => {
|
|
1482
|
+
let count = 1;
|
|
1483
|
+
|
|
1484
|
+
while (peek() === '!' && (peek(2) !== '(' || peek(3) === '?')) {
|
|
1485
|
+
advance();
|
|
1486
|
+
state.start++;
|
|
1487
|
+
count++;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
if (count % 2 === 0) {
|
|
1491
|
+
return false;
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
state.negated = true;
|
|
1495
|
+
state.start++;
|
|
1496
|
+
return true;
|
|
1497
|
+
};
|
|
1498
|
+
|
|
1499
|
+
const increment = type => {
|
|
1500
|
+
state[type]++;
|
|
1501
|
+
stack.push(type);
|
|
1502
|
+
};
|
|
1503
|
+
|
|
1504
|
+
const decrement = type => {
|
|
1505
|
+
state[type]--;
|
|
1506
|
+
stack.pop();
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* Push tokens onto the tokens array. This helper speeds up
|
|
1511
|
+
* tokenizing by 1) helping us avoid backtracking as much as possible,
|
|
1512
|
+
* and 2) helping us avoid creating extra tokens when consecutive
|
|
1513
|
+
* characters are plain text. This improves performance and simplifies
|
|
1514
|
+
* lookbehinds.
|
|
1515
|
+
*/
|
|
1516
|
+
|
|
1517
|
+
const push = tok => {
|
|
1518
|
+
if (prev.type === 'globstar') {
|
|
1519
|
+
const isBrace = state.braces > 0 && (tok.type === 'comma' || tok.type === 'brace');
|
|
1520
|
+
const isExtglob = tok.extglob === true || (extglobs.length && (tok.type === 'pipe' || tok.type === 'paren'));
|
|
1521
|
+
|
|
1522
|
+
if (tok.type !== 'slash' && tok.type !== 'paren' && !isBrace && !isExtglob) {
|
|
1523
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
1524
|
+
prev.type = 'star';
|
|
1525
|
+
prev.value = '*';
|
|
1526
|
+
prev.output = star;
|
|
1527
|
+
state.output += prev.output;
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
|
|
1531
|
+
if (extglobs.length && tok.type !== 'paren' && !EXTGLOB_CHARS[tok.value]) {
|
|
1532
|
+
extglobs[extglobs.length - 1].inner += tok.value;
|
|
1533
|
+
}
|
|
1534
|
+
|
|
1535
|
+
if (tok.value || tok.output) append(tok);
|
|
1536
|
+
if (prev && prev.type === 'text' && tok.type === 'text') {
|
|
1537
|
+
prev.value += tok.value;
|
|
1538
|
+
prev.output = (prev.output || '') + tok.value;
|
|
1539
|
+
return;
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
tok.prev = prev;
|
|
1543
|
+
tokens.push(tok);
|
|
1544
|
+
prev = tok;
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1547
|
+
const extglobOpen = (type, value) => {
|
|
1548
|
+
const token = { ...EXTGLOB_CHARS[value], conditions: 1, inner: '' };
|
|
1549
|
+
|
|
1550
|
+
token.prev = prev;
|
|
1551
|
+
token.parens = state.parens;
|
|
1552
|
+
token.output = state.output;
|
|
1553
|
+
const output = (opts.capture ? '(' : '') + token.open;
|
|
1554
|
+
|
|
1555
|
+
increment('parens');
|
|
1556
|
+
push({ type, value, output: state.output ? '' : ONE_CHAR });
|
|
1557
|
+
push({ type: 'paren', extglob: true, value: advance(), output });
|
|
1558
|
+
extglobs.push(token);
|
|
1559
|
+
};
|
|
1560
|
+
|
|
1561
|
+
const extglobClose = token => {
|
|
1562
|
+
let output = token.close + (opts.capture ? ')' : '');
|
|
1563
|
+
|
|
1564
|
+
if (token.type === 'negate') {
|
|
1565
|
+
let extglobStar = star;
|
|
1566
|
+
|
|
1567
|
+
if (token.inner && token.inner.length > 1 && token.inner.includes('/')) {
|
|
1568
|
+
extglobStar = globstar(opts);
|
|
1569
|
+
}
|
|
1570
|
+
|
|
1571
|
+
if (extglobStar !== star || eos() || /^\)+$/.test(remaining())) {
|
|
1572
|
+
output = token.close = `)$))${extglobStar}`;
|
|
1573
|
+
}
|
|
1574
|
+
|
|
1575
|
+
if (token.prev.type === 'bos' && eos()) {
|
|
1576
|
+
state.negatedExtglob = true;
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
push({ type: 'paren', extglob: true, value, output });
|
|
1581
|
+
decrement('parens');
|
|
1582
|
+
};
|
|
1583
|
+
|
|
1584
|
+
/**
|
|
1585
|
+
* Fast paths
|
|
1586
|
+
*/
|
|
1587
|
+
|
|
1588
|
+
if (opts.fastpaths !== false && !/(^[*!]|[/()[\]{}"])/.test(input)) {
|
|
1589
|
+
let backslashes = false;
|
|
1590
|
+
|
|
1591
|
+
let output = input.replace(REGEX_SPECIAL_CHARS_BACKREF, (m, esc, chars, first, rest, index) => {
|
|
1592
|
+
if (first === '\\') {
|
|
1593
|
+
backslashes = true;
|
|
1594
|
+
return m;
|
|
1595
|
+
}
|
|
1596
|
+
|
|
1597
|
+
if (first === '?') {
|
|
1598
|
+
if (esc) {
|
|
1599
|
+
return esc + first + (rest ? QMARK.repeat(rest.length) : '');
|
|
1600
|
+
}
|
|
1601
|
+
if (index === 0) {
|
|
1602
|
+
return qmarkNoDot + (rest ? QMARK.repeat(rest.length) : '');
|
|
1603
|
+
}
|
|
1604
|
+
return QMARK.repeat(chars.length);
|
|
1605
|
+
}
|
|
1606
|
+
|
|
1607
|
+
if (first === '.') {
|
|
1608
|
+
return DOT_LITERAL.repeat(chars.length);
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
if (first === '*') {
|
|
1612
|
+
if (esc) {
|
|
1613
|
+
return esc + first + (rest ? star : '');
|
|
1614
|
+
}
|
|
1615
|
+
return star;
|
|
1616
|
+
}
|
|
1617
|
+
return esc ? m : `\\${m}`;
|
|
1618
|
+
});
|
|
1619
|
+
|
|
1620
|
+
if (backslashes === true) {
|
|
1621
|
+
if (opts.unescape === true) {
|
|
1622
|
+
output = output.replace(/\\/g, '');
|
|
1623
|
+
} else {
|
|
1624
|
+
output = output.replace(/\\+/g, m => {
|
|
1625
|
+
return m.length % 2 === 0 ? '\\\\' : (m ? '\\' : '');
|
|
1626
|
+
});
|
|
1627
|
+
}
|
|
1628
|
+
}
|
|
1629
|
+
|
|
1630
|
+
if (output === input && opts.contains === true) {
|
|
1631
|
+
state.output = input;
|
|
1632
|
+
return state;
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1635
|
+
state.output = utils$1.wrapOutput(output, state, options);
|
|
1636
|
+
return state;
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
/**
|
|
1640
|
+
* Tokenize input until we reach end-of-string
|
|
1641
|
+
*/
|
|
1642
|
+
|
|
1643
|
+
while (!eos()) {
|
|
1644
|
+
value = advance();
|
|
1645
|
+
|
|
1646
|
+
if (value === '\u0000') {
|
|
1647
|
+
continue;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
/**
|
|
1651
|
+
* Escaped characters
|
|
1652
|
+
*/
|
|
1653
|
+
|
|
1654
|
+
if (value === '\\') {
|
|
1655
|
+
const next = peek();
|
|
1656
|
+
|
|
1657
|
+
if (next === '/' && opts.bash !== true) {
|
|
1658
|
+
continue;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
if (next === '.' || next === ';') {
|
|
1662
|
+
continue;
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
if (!next) {
|
|
1666
|
+
value += '\\';
|
|
1667
|
+
push({ type: 'text', value });
|
|
1668
|
+
continue;
|
|
1669
|
+
}
|
|
1670
|
+
|
|
1671
|
+
// collapse slashes to reduce potential for exploits
|
|
1672
|
+
const match = /^\\+/.exec(remaining());
|
|
1673
|
+
let slashes = 0;
|
|
1674
|
+
|
|
1675
|
+
if (match && match[0].length > 2) {
|
|
1676
|
+
slashes = match[0].length;
|
|
1677
|
+
state.index += slashes;
|
|
1678
|
+
if (slashes % 2 !== 0) {
|
|
1679
|
+
value += '\\';
|
|
1680
|
+
}
|
|
1681
|
+
}
|
|
1682
|
+
|
|
1683
|
+
if (opts.unescape === true) {
|
|
1684
|
+
value = advance() || '';
|
|
1685
|
+
} else {
|
|
1686
|
+
value += advance() || '';
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1689
|
+
if (state.brackets === 0) {
|
|
1690
|
+
push({ type: 'text', value });
|
|
1691
|
+
continue;
|
|
1692
|
+
}
|
|
1693
|
+
}
|
|
1694
|
+
|
|
1695
|
+
/**
|
|
1696
|
+
* If we're inside a regex character class, continue
|
|
1697
|
+
* until we reach the closing bracket.
|
|
1698
|
+
*/
|
|
1699
|
+
|
|
1700
|
+
if (state.brackets > 0 && (value !== ']' || prev.value === '[' || prev.value === '[^')) {
|
|
1701
|
+
if (opts.posix !== false && value === ':') {
|
|
1702
|
+
const inner = prev.value.slice(1);
|
|
1703
|
+
if (inner.includes('[')) {
|
|
1704
|
+
prev.posix = true;
|
|
1705
|
+
|
|
1706
|
+
if (inner.includes(':')) {
|
|
1707
|
+
const idx = prev.value.lastIndexOf('[');
|
|
1708
|
+
const pre = prev.value.slice(0, idx);
|
|
1709
|
+
const rest = prev.value.slice(idx + 2);
|
|
1710
|
+
const posix = POSIX_REGEX_SOURCE[rest];
|
|
1711
|
+
if (posix) {
|
|
1712
|
+
prev.value = pre + posix;
|
|
1713
|
+
state.backtrack = true;
|
|
1714
|
+
advance();
|
|
1715
|
+
|
|
1716
|
+
if (!bos.output && tokens.indexOf(prev) === 1) {
|
|
1717
|
+
bos.output = ONE_CHAR;
|
|
1718
|
+
}
|
|
1719
|
+
continue;
|
|
1720
|
+
}
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
}
|
|
1724
|
+
|
|
1725
|
+
if ((value === '[' && peek() !== ':') || (value === '-' && peek() === ']')) {
|
|
1726
|
+
value = `\\${value}`;
|
|
1727
|
+
}
|
|
1728
|
+
|
|
1729
|
+
if (value === ']' && (prev.value === '[' || prev.value === '[^')) {
|
|
1730
|
+
value = `\\${value}`;
|
|
1731
|
+
}
|
|
1732
|
+
|
|
1733
|
+
if (opts.posix === true && value === '!' && prev.value === '[') {
|
|
1734
|
+
value = '^';
|
|
1735
|
+
}
|
|
1736
|
+
|
|
1737
|
+
prev.value += value;
|
|
1738
|
+
append({ value });
|
|
1739
|
+
continue;
|
|
1740
|
+
}
|
|
1741
|
+
|
|
1742
|
+
/**
|
|
1743
|
+
* If we're inside a quoted string, continue
|
|
1744
|
+
* until we reach the closing double quote.
|
|
1745
|
+
*/
|
|
1746
|
+
|
|
1747
|
+
if (state.quotes === 1 && value !== '"') {
|
|
1748
|
+
value = utils$1.escapeRegex(value);
|
|
1749
|
+
prev.value += value;
|
|
1750
|
+
append({ value });
|
|
1751
|
+
continue;
|
|
1752
|
+
}
|
|
1753
|
+
|
|
1754
|
+
/**
|
|
1755
|
+
* Double quotes
|
|
1756
|
+
*/
|
|
1757
|
+
|
|
1758
|
+
if (value === '"') {
|
|
1759
|
+
state.quotes = state.quotes === 1 ? 0 : 1;
|
|
1760
|
+
if (opts.keepQuotes === true) {
|
|
1761
|
+
push({ type: 'text', value });
|
|
1762
|
+
}
|
|
1763
|
+
continue;
|
|
1764
|
+
}
|
|
1765
|
+
|
|
1766
|
+
/**
|
|
1767
|
+
* Parentheses
|
|
1768
|
+
*/
|
|
1769
|
+
|
|
1770
|
+
if (value === '(') {
|
|
1771
|
+
increment('parens');
|
|
1772
|
+
push({ type: 'paren', value });
|
|
1773
|
+
continue;
|
|
1774
|
+
}
|
|
1775
|
+
|
|
1776
|
+
if (value === ')') {
|
|
1777
|
+
if (state.parens === 0 && opts.strictBrackets === true) {
|
|
1778
|
+
throw new SyntaxError(syntaxError('opening', '('));
|
|
1779
|
+
}
|
|
1780
|
+
|
|
1781
|
+
const extglob = extglobs[extglobs.length - 1];
|
|
1782
|
+
if (extglob && state.parens === extglob.parens + 1) {
|
|
1783
|
+
extglobClose(extglobs.pop());
|
|
1784
|
+
continue;
|
|
1785
|
+
}
|
|
1786
|
+
|
|
1787
|
+
push({ type: 'paren', value, output: state.parens ? ')' : '\\)' });
|
|
1788
|
+
decrement('parens');
|
|
1789
|
+
continue;
|
|
1790
|
+
}
|
|
1791
|
+
|
|
1792
|
+
/**
|
|
1793
|
+
* Square brackets
|
|
1794
|
+
*/
|
|
1795
|
+
|
|
1796
|
+
if (value === '[') {
|
|
1797
|
+
if (opts.nobracket === true || !remaining().includes(']')) {
|
|
1798
|
+
if (opts.nobracket !== true && opts.strictBrackets === true) {
|
|
1799
|
+
throw new SyntaxError(syntaxError('closing', ']'));
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
value = `\\${value}`;
|
|
1803
|
+
} else {
|
|
1804
|
+
increment('brackets');
|
|
1805
|
+
}
|
|
1806
|
+
|
|
1807
|
+
push({ type: 'bracket', value });
|
|
1808
|
+
continue;
|
|
1809
|
+
}
|
|
1810
|
+
|
|
1811
|
+
if (value === ']') {
|
|
1812
|
+
if (opts.nobracket === true || (prev && prev.type === 'bracket' && prev.value.length === 1)) {
|
|
1813
|
+
push({ type: 'text', value, output: `\\${value}` });
|
|
1814
|
+
continue;
|
|
1815
|
+
}
|
|
1816
|
+
|
|
1817
|
+
if (state.brackets === 0) {
|
|
1818
|
+
if (opts.strictBrackets === true) {
|
|
1819
|
+
throw new SyntaxError(syntaxError('opening', '['));
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
push({ type: 'text', value, output: `\\${value}` });
|
|
1823
|
+
continue;
|
|
1824
|
+
}
|
|
1825
|
+
|
|
1826
|
+
decrement('brackets');
|
|
1827
|
+
|
|
1828
|
+
const prevValue = prev.value.slice(1);
|
|
1829
|
+
if (prev.posix !== true && prevValue[0] === '^' && !prevValue.includes('/')) {
|
|
1830
|
+
value = `/${value}`;
|
|
1831
|
+
}
|
|
1832
|
+
|
|
1833
|
+
prev.value += value;
|
|
1834
|
+
append({ value });
|
|
1835
|
+
|
|
1836
|
+
// when literal brackets are explicitly disabled
|
|
1837
|
+
// assume we should match with a regex character class
|
|
1838
|
+
if (opts.literalBrackets === false || utils$1.hasRegexChars(prevValue)) {
|
|
1839
|
+
continue;
|
|
1840
|
+
}
|
|
1841
|
+
|
|
1842
|
+
const escaped = utils$1.escapeRegex(prev.value);
|
|
1843
|
+
state.output = state.output.slice(0, -prev.value.length);
|
|
1844
|
+
|
|
1845
|
+
// when literal brackets are explicitly enabled
|
|
1846
|
+
// assume we should escape the brackets to match literal characters
|
|
1847
|
+
if (opts.literalBrackets === true) {
|
|
1848
|
+
state.output += escaped;
|
|
1849
|
+
prev.value = escaped;
|
|
1850
|
+
continue;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
// when the user specifies nothing, try to match both
|
|
1854
|
+
prev.value = `(${capture}${escaped}|${prev.value})`;
|
|
1855
|
+
state.output += prev.value;
|
|
1856
|
+
continue;
|
|
1857
|
+
}
|
|
1858
|
+
|
|
1859
|
+
/**
|
|
1860
|
+
* Braces
|
|
1861
|
+
*/
|
|
1862
|
+
|
|
1863
|
+
if (value === '{' && opts.nobrace !== true) {
|
|
1864
|
+
increment('braces');
|
|
1865
|
+
|
|
1866
|
+
const open = {
|
|
1867
|
+
type: 'brace',
|
|
1868
|
+
value,
|
|
1869
|
+
output: '(',
|
|
1870
|
+
outputIndex: state.output.length,
|
|
1871
|
+
tokensIndex: state.tokens.length
|
|
1872
|
+
};
|
|
1873
|
+
|
|
1874
|
+
braces.push(open);
|
|
1875
|
+
push(open);
|
|
1876
|
+
continue;
|
|
1877
|
+
}
|
|
1878
|
+
|
|
1879
|
+
if (value === '}') {
|
|
1880
|
+
const brace = braces[braces.length - 1];
|
|
1881
|
+
|
|
1882
|
+
if (opts.nobrace === true || !brace) {
|
|
1883
|
+
push({ type: 'text', value, output: value });
|
|
1884
|
+
continue;
|
|
1885
|
+
}
|
|
1886
|
+
|
|
1887
|
+
let output = ')';
|
|
1888
|
+
|
|
1889
|
+
if (brace.dots === true) {
|
|
1890
|
+
const arr = tokens.slice();
|
|
1891
|
+
const range = [];
|
|
1892
|
+
|
|
1893
|
+
for (let i = arr.length - 1; i >= 0; i--) {
|
|
1894
|
+
tokens.pop();
|
|
1895
|
+
if (arr[i].type === 'brace') {
|
|
1896
|
+
break;
|
|
1897
|
+
}
|
|
1898
|
+
if (arr[i].type !== 'dots') {
|
|
1899
|
+
range.unshift(arr[i].value);
|
|
1900
|
+
}
|
|
1901
|
+
}
|
|
1902
|
+
|
|
1903
|
+
output = expandRange(range, opts);
|
|
1904
|
+
state.backtrack = true;
|
|
1905
|
+
}
|
|
1906
|
+
|
|
1907
|
+
if (brace.comma !== true && brace.dots !== true) {
|
|
1908
|
+
const out = state.output.slice(0, brace.outputIndex);
|
|
1909
|
+
const toks = state.tokens.slice(brace.tokensIndex);
|
|
1910
|
+
brace.value = brace.output = '\\{';
|
|
1911
|
+
value = output = '\\}';
|
|
1912
|
+
state.output = out;
|
|
1913
|
+
for (const t of toks) {
|
|
1914
|
+
state.output += (t.output || t.value);
|
|
1915
|
+
}
|
|
1916
|
+
}
|
|
1917
|
+
|
|
1918
|
+
push({ type: 'brace', value, output });
|
|
1919
|
+
decrement('braces');
|
|
1920
|
+
braces.pop();
|
|
1921
|
+
continue;
|
|
1922
|
+
}
|
|
1923
|
+
|
|
1924
|
+
/**
|
|
1925
|
+
* Pipes
|
|
1926
|
+
*/
|
|
1927
|
+
|
|
1928
|
+
if (value === '|') {
|
|
1929
|
+
if (extglobs.length > 0) {
|
|
1930
|
+
extglobs[extglobs.length - 1].conditions++;
|
|
1931
|
+
}
|
|
1932
|
+
push({ type: 'text', value });
|
|
1933
|
+
continue;
|
|
1934
|
+
}
|
|
1935
|
+
|
|
1936
|
+
/**
|
|
1937
|
+
* Commas
|
|
1938
|
+
*/
|
|
1939
|
+
|
|
1940
|
+
if (value === ',') {
|
|
1941
|
+
let output = value;
|
|
1942
|
+
|
|
1943
|
+
const brace = braces[braces.length - 1];
|
|
1944
|
+
if (brace && stack[stack.length - 1] === 'braces') {
|
|
1945
|
+
brace.comma = true;
|
|
1946
|
+
output = '|';
|
|
1947
|
+
}
|
|
1948
|
+
|
|
1949
|
+
push({ type: 'comma', value, output });
|
|
1950
|
+
continue;
|
|
1951
|
+
}
|
|
1952
|
+
|
|
1953
|
+
/**
|
|
1954
|
+
* Slashes
|
|
1955
|
+
*/
|
|
1956
|
+
|
|
1957
|
+
if (value === '/') {
|
|
1958
|
+
// if the beginning of the glob is "./", advance the start
|
|
1959
|
+
// to the current index, and don't add the "./" characters
|
|
1960
|
+
// to the state. This greatly simplifies lookbehinds when
|
|
1961
|
+
// checking for BOS characters like "!" and "." (not "./")
|
|
1962
|
+
if (prev.type === 'dot' && state.index === state.start + 1) {
|
|
1963
|
+
state.start = state.index + 1;
|
|
1964
|
+
state.consumed = '';
|
|
1965
|
+
state.output = '';
|
|
1966
|
+
tokens.pop();
|
|
1967
|
+
prev = bos; // reset "prev" to the first token
|
|
1968
|
+
continue;
|
|
1969
|
+
}
|
|
1970
|
+
|
|
1971
|
+
push({ type: 'slash', value, output: SLASH_LITERAL });
|
|
1972
|
+
continue;
|
|
1973
|
+
}
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Dots
|
|
1977
|
+
*/
|
|
1978
|
+
|
|
1979
|
+
if (value === '.') {
|
|
1980
|
+
if (state.braces > 0 && prev.type === 'dot') {
|
|
1981
|
+
if (prev.value === '.') prev.output = DOT_LITERAL;
|
|
1982
|
+
const brace = braces[braces.length - 1];
|
|
1983
|
+
prev.type = 'dots';
|
|
1984
|
+
prev.output += value;
|
|
1985
|
+
prev.value += value;
|
|
1986
|
+
brace.dots = true;
|
|
1987
|
+
continue;
|
|
1988
|
+
}
|
|
1989
|
+
|
|
1990
|
+
if ((state.braces + state.parens) === 0 && prev.type !== 'bos' && prev.type !== 'slash') {
|
|
1991
|
+
push({ type: 'text', value, output: DOT_LITERAL });
|
|
1992
|
+
continue;
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
push({ type: 'dot', value, output: DOT_LITERAL });
|
|
1996
|
+
continue;
|
|
1997
|
+
}
|
|
1998
|
+
|
|
1999
|
+
/**
|
|
2000
|
+
* Question marks
|
|
2001
|
+
*/
|
|
2002
|
+
|
|
2003
|
+
if (value === '?') {
|
|
2004
|
+
const isGroup = prev && prev.value === '(';
|
|
2005
|
+
if (!isGroup && opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
2006
|
+
extglobOpen('qmark', value);
|
|
2007
|
+
continue;
|
|
2008
|
+
}
|
|
2009
|
+
|
|
2010
|
+
if (prev && prev.type === 'paren') {
|
|
2011
|
+
const next = peek();
|
|
2012
|
+
let output = value;
|
|
2013
|
+
|
|
2014
|
+
if (next === '<' && !utils$1.supportsLookbehinds()) {
|
|
2015
|
+
throw new Error('Node.js v10 or higher is required for regex lookbehinds');
|
|
2016
|
+
}
|
|
2017
|
+
|
|
2018
|
+
if ((prev.value === '(' && !/[!=<:]/.test(next)) || (next === '<' && !/<([!=]|\w+>)/.test(remaining()))) {
|
|
2019
|
+
output = `\\${value}`;
|
|
2020
|
+
}
|
|
2021
|
+
|
|
2022
|
+
push({ type: 'text', value, output });
|
|
2023
|
+
continue;
|
|
2024
|
+
}
|
|
2025
|
+
|
|
2026
|
+
if (opts.dot !== true && (prev.type === 'slash' || prev.type === 'bos')) {
|
|
2027
|
+
push({ type: 'qmark', value, output: QMARK_NO_DOT });
|
|
2028
|
+
continue;
|
|
2029
|
+
}
|
|
2030
|
+
|
|
2031
|
+
push({ type: 'qmark', value, output: QMARK });
|
|
2032
|
+
continue;
|
|
2033
|
+
}
|
|
2034
|
+
|
|
2035
|
+
/**
|
|
2036
|
+
* Exclamation
|
|
2037
|
+
*/
|
|
2038
|
+
|
|
2039
|
+
if (value === '!') {
|
|
2040
|
+
if (opts.noextglob !== true && peek() === '(') {
|
|
2041
|
+
if (peek(2) !== '?' || !/[!=<:]/.test(peek(3))) {
|
|
2042
|
+
extglobOpen('negate', value);
|
|
2043
|
+
continue;
|
|
2044
|
+
}
|
|
2045
|
+
}
|
|
2046
|
+
|
|
2047
|
+
if (opts.nonegate !== true && state.index === 0) {
|
|
2048
|
+
negate();
|
|
2049
|
+
continue;
|
|
2050
|
+
}
|
|
2051
|
+
}
|
|
2052
|
+
|
|
2053
|
+
/**
|
|
2054
|
+
* Plus
|
|
2055
|
+
*/
|
|
2056
|
+
|
|
2057
|
+
if (value === '+') {
|
|
2058
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
2059
|
+
extglobOpen('plus', value);
|
|
2060
|
+
continue;
|
|
2061
|
+
}
|
|
2062
|
+
|
|
2063
|
+
if ((prev && prev.value === '(') || opts.regex === false) {
|
|
2064
|
+
push({ type: 'plus', value, output: PLUS_LITERAL });
|
|
2065
|
+
continue;
|
|
2066
|
+
}
|
|
2067
|
+
|
|
2068
|
+
if ((prev && (prev.type === 'bracket' || prev.type === 'paren' || prev.type === 'brace')) || state.parens > 0) {
|
|
2069
|
+
push({ type: 'plus', value });
|
|
2070
|
+
continue;
|
|
2071
|
+
}
|
|
2072
|
+
|
|
2073
|
+
push({ type: 'plus', value: PLUS_LITERAL });
|
|
2074
|
+
continue;
|
|
2075
|
+
}
|
|
2076
|
+
|
|
2077
|
+
/**
|
|
2078
|
+
* Plain text
|
|
2079
|
+
*/
|
|
2080
|
+
|
|
2081
|
+
if (value === '@') {
|
|
2082
|
+
if (opts.noextglob !== true && peek() === '(' && peek(2) !== '?') {
|
|
2083
|
+
push({ type: 'at', extglob: true, value, output: '' });
|
|
2084
|
+
continue;
|
|
2085
|
+
}
|
|
2086
|
+
|
|
2087
|
+
push({ type: 'text', value });
|
|
2088
|
+
continue;
|
|
2089
|
+
}
|
|
2090
|
+
|
|
2091
|
+
/**
|
|
2092
|
+
* Plain text
|
|
2093
|
+
*/
|
|
2094
|
+
|
|
2095
|
+
if (value !== '*') {
|
|
2096
|
+
if (value === '$' || value === '^') {
|
|
2097
|
+
value = `\\${value}`;
|
|
2098
|
+
}
|
|
2099
|
+
|
|
2100
|
+
const match = REGEX_NON_SPECIAL_CHARS.exec(remaining());
|
|
2101
|
+
if (match) {
|
|
2102
|
+
value += match[0];
|
|
2103
|
+
state.index += match[0].length;
|
|
2104
|
+
}
|
|
2105
|
+
|
|
2106
|
+
push({ type: 'text', value });
|
|
2107
|
+
continue;
|
|
2108
|
+
}
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Stars
|
|
2112
|
+
*/
|
|
2113
|
+
|
|
2114
|
+
if (prev && (prev.type === 'globstar' || prev.star === true)) {
|
|
2115
|
+
prev.type = 'star';
|
|
2116
|
+
prev.star = true;
|
|
2117
|
+
prev.value += value;
|
|
2118
|
+
prev.output = star;
|
|
2119
|
+
state.backtrack = true;
|
|
2120
|
+
state.globstar = true;
|
|
2121
|
+
consume(value);
|
|
2122
|
+
continue;
|
|
2123
|
+
}
|
|
2124
|
+
|
|
2125
|
+
let rest = remaining();
|
|
2126
|
+
if (opts.noextglob !== true && /^\([^?]/.test(rest)) {
|
|
2127
|
+
extglobOpen('star', value);
|
|
2128
|
+
continue;
|
|
2129
|
+
}
|
|
2130
|
+
|
|
2131
|
+
if (prev.type === 'star') {
|
|
2132
|
+
if (opts.noglobstar === true) {
|
|
2133
|
+
consume(value);
|
|
2134
|
+
continue;
|
|
2135
|
+
}
|
|
2136
|
+
|
|
2137
|
+
const prior = prev.prev;
|
|
2138
|
+
const before = prior.prev;
|
|
2139
|
+
const isStart = prior.type === 'slash' || prior.type === 'bos';
|
|
2140
|
+
const afterStar = before && (before.type === 'star' || before.type === 'globstar');
|
|
2141
|
+
|
|
2142
|
+
if (opts.bash === true && (!isStart || (rest[0] && rest[0] !== '/'))) {
|
|
2143
|
+
push({ type: 'star', value, output: '' });
|
|
2144
|
+
continue;
|
|
2145
|
+
}
|
|
2146
|
+
|
|
2147
|
+
const isBrace = state.braces > 0 && (prior.type === 'comma' || prior.type === 'brace');
|
|
2148
|
+
const isExtglob = extglobs.length && (prior.type === 'pipe' || prior.type === 'paren');
|
|
2149
|
+
if (!isStart && prior.type !== 'paren' && !isBrace && !isExtglob) {
|
|
2150
|
+
push({ type: 'star', value, output: '' });
|
|
2151
|
+
continue;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2154
|
+
// strip consecutive `/**/`
|
|
2155
|
+
while (rest.slice(0, 3) === '/**') {
|
|
2156
|
+
const after = input[state.index + 4];
|
|
2157
|
+
if (after && after !== '/') {
|
|
2158
|
+
break;
|
|
2159
|
+
}
|
|
2160
|
+
rest = rest.slice(3);
|
|
2161
|
+
consume('/**', 3);
|
|
2162
|
+
}
|
|
2163
|
+
|
|
2164
|
+
if (prior.type === 'bos' && eos()) {
|
|
2165
|
+
prev.type = 'globstar';
|
|
2166
|
+
prev.value += value;
|
|
2167
|
+
prev.output = globstar(opts);
|
|
2168
|
+
state.output = prev.output;
|
|
2169
|
+
state.globstar = true;
|
|
2170
|
+
consume(value);
|
|
2171
|
+
continue;
|
|
2172
|
+
}
|
|
2173
|
+
|
|
2174
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && !afterStar && eos()) {
|
|
2175
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
2176
|
+
prior.output = `(?:${prior.output}`;
|
|
2177
|
+
|
|
2178
|
+
prev.type = 'globstar';
|
|
2179
|
+
prev.output = globstar(opts) + (opts.strictSlashes ? ')' : '|$)');
|
|
2180
|
+
prev.value += value;
|
|
2181
|
+
state.globstar = true;
|
|
2182
|
+
state.output += prior.output + prev.output;
|
|
2183
|
+
consume(value);
|
|
2184
|
+
continue;
|
|
2185
|
+
}
|
|
2186
|
+
|
|
2187
|
+
if (prior.type === 'slash' && prior.prev.type !== 'bos' && rest[0] === '/') {
|
|
2188
|
+
const end = rest[1] !== void 0 ? '|$' : '';
|
|
2189
|
+
|
|
2190
|
+
state.output = state.output.slice(0, -(prior.output + prev.output).length);
|
|
2191
|
+
prior.output = `(?:${prior.output}`;
|
|
2192
|
+
|
|
2193
|
+
prev.type = 'globstar';
|
|
2194
|
+
prev.output = `${globstar(opts)}${SLASH_LITERAL}|${SLASH_LITERAL}${end})`;
|
|
2195
|
+
prev.value += value;
|
|
2196
|
+
|
|
2197
|
+
state.output += prior.output + prev.output;
|
|
2198
|
+
state.globstar = true;
|
|
2199
|
+
|
|
2200
|
+
consume(value + advance());
|
|
2201
|
+
|
|
2202
|
+
push({ type: 'slash', value: '/', output: '' });
|
|
2203
|
+
continue;
|
|
2204
|
+
}
|
|
2205
|
+
|
|
2206
|
+
if (prior.type === 'bos' && rest[0] === '/') {
|
|
2207
|
+
prev.type = 'globstar';
|
|
2208
|
+
prev.value += value;
|
|
2209
|
+
prev.output = `(?:^|${SLASH_LITERAL}|${globstar(opts)}${SLASH_LITERAL})`;
|
|
2210
|
+
state.output = prev.output;
|
|
2211
|
+
state.globstar = true;
|
|
2212
|
+
consume(value + advance());
|
|
2213
|
+
push({ type: 'slash', value: '/', output: '' });
|
|
2214
|
+
continue;
|
|
2215
|
+
}
|
|
2216
|
+
|
|
2217
|
+
// remove single star from output
|
|
2218
|
+
state.output = state.output.slice(0, -prev.output.length);
|
|
2219
|
+
|
|
2220
|
+
// reset previous token to globstar
|
|
2221
|
+
prev.type = 'globstar';
|
|
2222
|
+
prev.output = globstar(opts);
|
|
2223
|
+
prev.value += value;
|
|
2224
|
+
|
|
2225
|
+
// reset output with globstar
|
|
2226
|
+
state.output += prev.output;
|
|
2227
|
+
state.globstar = true;
|
|
2228
|
+
consume(value);
|
|
2229
|
+
continue;
|
|
2230
|
+
}
|
|
2231
|
+
|
|
2232
|
+
const token = { type: 'star', value, output: star };
|
|
2233
|
+
|
|
2234
|
+
if (opts.bash === true) {
|
|
2235
|
+
token.output = '.*?';
|
|
2236
|
+
if (prev.type === 'bos' || prev.type === 'slash') {
|
|
2237
|
+
token.output = nodot + token.output;
|
|
2238
|
+
}
|
|
2239
|
+
push(token);
|
|
2240
|
+
continue;
|
|
2241
|
+
}
|
|
2242
|
+
|
|
2243
|
+
if (prev && (prev.type === 'bracket' || prev.type === 'paren') && opts.regex === true) {
|
|
2244
|
+
token.output = value;
|
|
2245
|
+
push(token);
|
|
2246
|
+
continue;
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
if (state.index === state.start || prev.type === 'slash' || prev.type === 'dot') {
|
|
2250
|
+
if (prev.type === 'dot') {
|
|
2251
|
+
state.output += NO_DOT_SLASH;
|
|
2252
|
+
prev.output += NO_DOT_SLASH;
|
|
2253
|
+
|
|
2254
|
+
} else if (opts.dot === true) {
|
|
2255
|
+
state.output += NO_DOTS_SLASH;
|
|
2256
|
+
prev.output += NO_DOTS_SLASH;
|
|
2257
|
+
|
|
2258
|
+
} else {
|
|
2259
|
+
state.output += nodot;
|
|
2260
|
+
prev.output += nodot;
|
|
2261
|
+
}
|
|
2262
|
+
|
|
2263
|
+
if (peek() !== '*') {
|
|
2264
|
+
state.output += ONE_CHAR;
|
|
2265
|
+
prev.output += ONE_CHAR;
|
|
2266
|
+
}
|
|
2267
|
+
}
|
|
2268
|
+
|
|
2269
|
+
push(token);
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
while (state.brackets > 0) {
|
|
2273
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ']'));
|
|
2274
|
+
state.output = utils$1.escapeLast(state.output, '[');
|
|
2275
|
+
decrement('brackets');
|
|
2276
|
+
}
|
|
2277
|
+
|
|
2278
|
+
while (state.parens > 0) {
|
|
2279
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', ')'));
|
|
2280
|
+
state.output = utils$1.escapeLast(state.output, '(');
|
|
2281
|
+
decrement('parens');
|
|
2282
|
+
}
|
|
2283
|
+
|
|
2284
|
+
while (state.braces > 0) {
|
|
2285
|
+
if (opts.strictBrackets === true) throw new SyntaxError(syntaxError('closing', '}'));
|
|
2286
|
+
state.output = utils$1.escapeLast(state.output, '{');
|
|
2287
|
+
decrement('braces');
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
if (opts.strictSlashes !== true && (prev.type === 'star' || prev.type === 'bracket')) {
|
|
2291
|
+
push({ type: 'maybe_slash', value: '', output: `${SLASH_LITERAL}?` });
|
|
2292
|
+
}
|
|
2293
|
+
|
|
2294
|
+
// rebuild the output if we had to backtrack at any point
|
|
2295
|
+
if (state.backtrack === true) {
|
|
2296
|
+
state.output = '';
|
|
2297
|
+
|
|
2298
|
+
for (const token of state.tokens) {
|
|
2299
|
+
state.output += token.output != null ? token.output : token.value;
|
|
2300
|
+
|
|
2301
|
+
if (token.suffix) {
|
|
2302
|
+
state.output += token.suffix;
|
|
2303
|
+
}
|
|
2304
|
+
}
|
|
2305
|
+
}
|
|
2306
|
+
|
|
2307
|
+
return state;
|
|
2308
|
+
};
|
|
2309
|
+
|
|
2310
|
+
/**
|
|
2311
|
+
* Fast paths for creating regular expressions for common glob patterns.
|
|
2312
|
+
* This can significantly speed up processing and has very little downside
|
|
2313
|
+
* impact when none of the fast paths match.
|
|
2314
|
+
*/
|
|
2315
|
+
|
|
2316
|
+
parse$2.fastpaths = (input, options) => {
|
|
2317
|
+
const opts = { ...options };
|
|
2318
|
+
const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
|
|
2319
|
+
const len = input.length;
|
|
2320
|
+
if (len > max) {
|
|
2321
|
+
throw new SyntaxError(`Input length: ${len}, exceeds maximum allowed length: ${max}`);
|
|
2322
|
+
}
|
|
2323
|
+
|
|
2324
|
+
input = REPLACEMENTS[input] || input;
|
|
2325
|
+
|
|
2326
|
+
// create constants based on platform, for windows or posix
|
|
2327
|
+
const {
|
|
2328
|
+
DOT_LITERAL,
|
|
2329
|
+
SLASH_LITERAL,
|
|
2330
|
+
ONE_CHAR,
|
|
2331
|
+
DOTS_SLASH,
|
|
2332
|
+
NO_DOT,
|
|
2333
|
+
NO_DOTS,
|
|
2334
|
+
NO_DOTS_SLASH,
|
|
2335
|
+
STAR,
|
|
2336
|
+
START_ANCHOR
|
|
2337
|
+
} = constants$2.globChars(opts.windows);
|
|
2338
|
+
|
|
2339
|
+
const nodot = opts.dot ? NO_DOTS : NO_DOT;
|
|
2340
|
+
const slashDot = opts.dot ? NO_DOTS_SLASH : NO_DOT;
|
|
2341
|
+
const capture = opts.capture ? '' : '?:';
|
|
2342
|
+
const state = { negated: false, prefix: '' };
|
|
2343
|
+
let star = opts.bash === true ? '.*?' : STAR;
|
|
2344
|
+
|
|
2345
|
+
if (opts.capture) {
|
|
2346
|
+
star = `(${star})`;
|
|
2347
|
+
}
|
|
2348
|
+
|
|
2349
|
+
const globstar = (opts) => {
|
|
2350
|
+
if (opts.noglobstar === true) return star;
|
|
2351
|
+
return `(${capture}(?:(?!${START_ANCHOR}${opts.dot ? DOTS_SLASH : DOT_LITERAL}).)*?)`;
|
|
2352
|
+
};
|
|
2353
|
+
|
|
2354
|
+
const create = str => {
|
|
2355
|
+
switch (str) {
|
|
2356
|
+
case '*':
|
|
2357
|
+
return `${nodot}${ONE_CHAR}${star}`;
|
|
2358
|
+
|
|
2359
|
+
case '.*':
|
|
2360
|
+
return `${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2361
|
+
|
|
2362
|
+
case '*.*':
|
|
2363
|
+
return `${nodot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2364
|
+
|
|
2365
|
+
case '*/*':
|
|
2366
|
+
return `${nodot}${star}${SLASH_LITERAL}${ONE_CHAR}${slashDot}${star}`;
|
|
2367
|
+
|
|
2368
|
+
case '**':
|
|
2369
|
+
return nodot + globstar(opts);
|
|
2370
|
+
|
|
2371
|
+
case '**/*':
|
|
2372
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${ONE_CHAR}${star}`;
|
|
2373
|
+
|
|
2374
|
+
case '**/*.*':
|
|
2375
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${slashDot}${star}${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2376
|
+
|
|
2377
|
+
case '**/.*':
|
|
2378
|
+
return `(?:${nodot}${globstar(opts)}${SLASH_LITERAL})?${DOT_LITERAL}${ONE_CHAR}${star}`;
|
|
2379
|
+
|
|
2380
|
+
default: {
|
|
2381
|
+
const match = /^(.*?)\.(\w+)$/.exec(str);
|
|
2382
|
+
if (!match) return;
|
|
2383
|
+
|
|
2384
|
+
const source = create(match[1]);
|
|
2385
|
+
if (!source) return;
|
|
2386
|
+
|
|
2387
|
+
return source + DOT_LITERAL + match[2];
|
|
2388
|
+
}
|
|
2389
|
+
}
|
|
2390
|
+
};
|
|
2391
|
+
|
|
2392
|
+
const output = utils$1.removePrefix(input, state);
|
|
2393
|
+
let source = create(output);
|
|
2394
|
+
|
|
2395
|
+
if (source && opts.strictSlashes !== true) {
|
|
2396
|
+
source += `${SLASH_LITERAL}?`;
|
|
2397
|
+
}
|
|
2398
|
+
|
|
2399
|
+
return source;
|
|
2400
|
+
};
|
|
2401
|
+
|
|
2402
|
+
var parse_1 = parse$2;
|
|
2403
|
+
|
|
2404
|
+
const scan = scan_1;
|
|
2405
|
+
const parse$1 = parse_1;
|
|
2406
|
+
const utils = utils$3;
|
|
2407
|
+
const constants$1 = constants$3;
|
|
2408
|
+
const isObject = val => val && typeof val === 'object' && !Array.isArray(val);
|
|
2409
|
+
|
|
2410
|
+
/**
|
|
2411
|
+
* Creates a matcher function from one or more glob patterns. The
|
|
2412
|
+
* returned function takes a string to match as its first argument,
|
|
2413
|
+
* and returns true if the string is a match. The returned matcher
|
|
2414
|
+
* function also takes a boolean as the second argument that, when true,
|
|
2415
|
+
* returns an object with additional information.
|
|
2416
|
+
*
|
|
2417
|
+
* ```js
|
|
2418
|
+
* const picomatch = require('picomatch');
|
|
2419
|
+
* // picomatch(glob[, options]);
|
|
2420
|
+
*
|
|
2421
|
+
* const isMatch = picomatch('*.!(*a)');
|
|
2422
|
+
* console.log(isMatch('a.a')); //=> false
|
|
2423
|
+
* console.log(isMatch('a.b')); //=> true
|
|
2424
|
+
* ```
|
|
2425
|
+
* @name picomatch
|
|
2426
|
+
* @param {String|Array} `globs` One or more glob patterns.
|
|
2427
|
+
* @param {Object=} `options`
|
|
2428
|
+
* @return {Function=} Returns a matcher function.
|
|
2429
|
+
* @api public
|
|
2430
|
+
*/
|
|
2431
|
+
|
|
2432
|
+
const picomatch = (glob, options, returnState = false) => {
|
|
2433
|
+
if (Array.isArray(glob)) {
|
|
2434
|
+
const fns = glob.map(input => picomatch(input, options, returnState));
|
|
2435
|
+
const arrayMatcher = str => {
|
|
2436
|
+
for (const isMatch of fns) {
|
|
2437
|
+
const state = isMatch(str);
|
|
2438
|
+
if (state) return state;
|
|
2439
|
+
}
|
|
2440
|
+
return false;
|
|
2441
|
+
};
|
|
2442
|
+
return arrayMatcher;
|
|
2443
|
+
}
|
|
2444
|
+
|
|
2445
|
+
const isState = isObject(glob) && glob.tokens && glob.input;
|
|
2446
|
+
|
|
2447
|
+
if (glob === '' || (typeof glob !== 'string' && !isState)) {
|
|
2448
|
+
throw new TypeError('Expected pattern to be a non-empty string');
|
|
2449
|
+
}
|
|
2450
|
+
|
|
2451
|
+
const opts = options || {};
|
|
2452
|
+
const posix = opts.windows;
|
|
2453
|
+
const regex = isState
|
|
2454
|
+
? picomatch.compileRe(glob, options)
|
|
2455
|
+
: picomatch.makeRe(glob, options, false, true);
|
|
2456
|
+
|
|
2457
|
+
const state = regex.state;
|
|
2458
|
+
delete regex.state;
|
|
2459
|
+
|
|
2460
|
+
let isIgnored = () => false;
|
|
2461
|
+
if (opts.ignore) {
|
|
2462
|
+
const ignoreOpts = { ...options, ignore: null, onMatch: null, onResult: null };
|
|
2463
|
+
isIgnored = picomatch(opts.ignore, ignoreOpts, returnState);
|
|
2464
|
+
}
|
|
2465
|
+
|
|
2466
|
+
const matcher = (input, returnObject = false) => {
|
|
2467
|
+
const { isMatch, match, output } = picomatch.test(input, regex, options, { glob, posix });
|
|
2468
|
+
const result = { glob, state, regex, posix, input, output, match, isMatch };
|
|
2469
|
+
|
|
2470
|
+
if (typeof opts.onResult === 'function') {
|
|
2471
|
+
opts.onResult(result);
|
|
2472
|
+
}
|
|
2473
|
+
|
|
2474
|
+
if (isMatch === false) {
|
|
2475
|
+
result.isMatch = false;
|
|
2476
|
+
return returnObject ? result : false;
|
|
2477
|
+
}
|
|
2478
|
+
|
|
2479
|
+
if (isIgnored(input)) {
|
|
2480
|
+
if (typeof opts.onIgnore === 'function') {
|
|
2481
|
+
opts.onIgnore(result);
|
|
2482
|
+
}
|
|
2483
|
+
result.isMatch = false;
|
|
2484
|
+
return returnObject ? result : false;
|
|
2485
|
+
}
|
|
2486
|
+
|
|
2487
|
+
if (typeof opts.onMatch === 'function') {
|
|
2488
|
+
opts.onMatch(result);
|
|
2489
|
+
}
|
|
2490
|
+
return returnObject ? result : true;
|
|
2491
|
+
};
|
|
2492
|
+
|
|
2493
|
+
if (returnState) {
|
|
2494
|
+
matcher.state = state;
|
|
2495
|
+
}
|
|
2496
|
+
|
|
2497
|
+
return matcher;
|
|
2498
|
+
};
|
|
2499
|
+
|
|
2500
|
+
/**
|
|
2501
|
+
* Test `input` with the given `regex`. This is used by the main
|
|
2502
|
+
* `picomatch()` function to test the input string.
|
|
2503
|
+
*
|
|
2504
|
+
* ```js
|
|
2505
|
+
* const picomatch = require('picomatch');
|
|
2506
|
+
* // picomatch.test(input, regex[, options]);
|
|
2507
|
+
*
|
|
2508
|
+
* console.log(picomatch.test('foo/bar', /^(?:([^/]*?)\/([^/]*?))$/));
|
|
2509
|
+
* // { isMatch: true, match: [ 'foo/', 'foo', 'bar' ], output: 'foo/bar' }
|
|
2510
|
+
* ```
|
|
2511
|
+
* @param {String} `input` String to test.
|
|
2512
|
+
* @param {RegExp} `regex`
|
|
2513
|
+
* @return {Object} Returns an object with matching info.
|
|
2514
|
+
* @api public
|
|
2515
|
+
*/
|
|
2516
|
+
|
|
2517
|
+
picomatch.test = (input, regex, options, { glob, posix } = {}) => {
|
|
2518
|
+
if (typeof input !== 'string') {
|
|
2519
|
+
throw new TypeError('Expected input to be a string');
|
|
2520
|
+
}
|
|
2521
|
+
|
|
2522
|
+
if (input === '') {
|
|
2523
|
+
return { isMatch: false, output: '' };
|
|
2524
|
+
}
|
|
2525
|
+
|
|
2526
|
+
const opts = options || {};
|
|
2527
|
+
const format = opts.format || (posix ? utils.toPosixSlashes : null);
|
|
2528
|
+
let match = input === glob;
|
|
2529
|
+
let output = (match && format) ? format(input) : input;
|
|
2530
|
+
|
|
2531
|
+
if (match === false) {
|
|
2532
|
+
output = format ? format(input) : input;
|
|
2533
|
+
match = output === glob;
|
|
2534
|
+
}
|
|
2535
|
+
|
|
2536
|
+
if (match === false || opts.capture === true) {
|
|
2537
|
+
if (opts.matchBase === true || opts.basename === true) {
|
|
2538
|
+
match = picomatch.matchBase(input, regex, options, posix);
|
|
2539
|
+
} else {
|
|
2540
|
+
match = regex.exec(output);
|
|
2541
|
+
}
|
|
2542
|
+
}
|
|
2543
|
+
|
|
2544
|
+
return { isMatch: Boolean(match), match, output };
|
|
2545
|
+
};
|
|
2546
|
+
|
|
2547
|
+
/**
|
|
2548
|
+
* Match the basename of a filepath.
|
|
2549
|
+
*
|
|
2550
|
+
* ```js
|
|
2551
|
+
* const picomatch = require('picomatch');
|
|
2552
|
+
* // picomatch.matchBase(input, glob[, options]);
|
|
2553
|
+
* console.log(picomatch.matchBase('foo/bar.js', '*.js'); // true
|
|
2554
|
+
* ```
|
|
2555
|
+
* @param {String} `input` String to test.
|
|
2556
|
+
* @param {RegExp|String} `glob` Glob pattern or regex created by [.makeRe](#makeRe).
|
|
2557
|
+
* @return {Boolean}
|
|
2558
|
+
* @api public
|
|
2559
|
+
*/
|
|
2560
|
+
|
|
2561
|
+
picomatch.matchBase = (input, glob, options) => {
|
|
2562
|
+
const regex = glob instanceof RegExp ? glob : picomatch.makeRe(glob, options);
|
|
2563
|
+
return regex.test(utils.basename(input));
|
|
2564
|
+
};
|
|
2565
|
+
|
|
2566
|
+
/**
|
|
2567
|
+
* Returns true if **any** of the given glob `patterns` match the specified `string`.
|
|
2568
|
+
*
|
|
2569
|
+
* ```js
|
|
2570
|
+
* const picomatch = require('picomatch');
|
|
2571
|
+
* // picomatch.isMatch(string, patterns[, options]);
|
|
2572
|
+
*
|
|
2573
|
+
* console.log(picomatch.isMatch('a.a', ['b.*', '*.a'])); //=> true
|
|
2574
|
+
* console.log(picomatch.isMatch('a.a', 'b.*')); //=> false
|
|
2575
|
+
* ```
|
|
2576
|
+
* @param {String|Array} str The string to test.
|
|
2577
|
+
* @param {String|Array} patterns One or more glob patterns to use for matching.
|
|
2578
|
+
* @param {Object} [options] See available [options](#options).
|
|
2579
|
+
* @return {Boolean} Returns true if any patterns match `str`
|
|
2580
|
+
* @api public
|
|
2581
|
+
*/
|
|
2582
|
+
|
|
2583
|
+
picomatch.isMatch = (str, patterns, options) => picomatch(patterns, options)(str);
|
|
2584
|
+
|
|
2585
|
+
/**
|
|
2586
|
+
* Parse a glob pattern to create the source string for a regular
|
|
2587
|
+
* expression.
|
|
2588
|
+
*
|
|
2589
|
+
* ```js
|
|
2590
|
+
* const picomatch = require('picomatch');
|
|
2591
|
+
* const result = picomatch.parse(pattern[, options]);
|
|
2592
|
+
* ```
|
|
2593
|
+
* @param {String} `pattern`
|
|
2594
|
+
* @param {Object} `options`
|
|
2595
|
+
* @return {Object} Returns an object with useful properties and output to be used as a regex source string.
|
|
2596
|
+
* @api public
|
|
2597
|
+
*/
|
|
2598
|
+
|
|
2599
|
+
picomatch.parse = (pattern, options) => {
|
|
2600
|
+
if (Array.isArray(pattern)) return pattern.map(p => picomatch.parse(p, options));
|
|
2601
|
+
return parse$1(pattern, { ...options, fastpaths: false });
|
|
2602
|
+
};
|
|
2603
|
+
|
|
2604
|
+
/**
|
|
2605
|
+
* Scan a glob pattern to separate the pattern into segments.
|
|
2606
|
+
*
|
|
2607
|
+
* ```js
|
|
2608
|
+
* const picomatch = require('picomatch');
|
|
2609
|
+
* // picomatch.scan(input[, options]);
|
|
2610
|
+
*
|
|
2611
|
+
* const result = picomatch.scan('!./foo/*.js');
|
|
2612
|
+
* console.log(result);
|
|
2613
|
+
* { prefix: '!./',
|
|
2614
|
+
* input: '!./foo/*.js',
|
|
2615
|
+
* start: 3,
|
|
2616
|
+
* base: 'foo',
|
|
2617
|
+
* glob: '*.js',
|
|
2618
|
+
* isBrace: false,
|
|
2619
|
+
* isBracket: false,
|
|
2620
|
+
* isGlob: true,
|
|
2621
|
+
* isExtglob: false,
|
|
2622
|
+
* isGlobstar: false,
|
|
2623
|
+
* negated: true }
|
|
2624
|
+
* ```
|
|
2625
|
+
* @param {String} `input` Glob pattern to scan.
|
|
2626
|
+
* @param {Object} `options`
|
|
2627
|
+
* @return {Object} Returns an object with
|
|
2628
|
+
* @api public
|
|
2629
|
+
*/
|
|
2630
|
+
|
|
2631
|
+
picomatch.scan = (input, options) => scan(input, options);
|
|
2632
|
+
|
|
2633
|
+
/**
|
|
2634
|
+
* Create a regular expression from a parsed glob pattern.
|
|
2635
|
+
*
|
|
2636
|
+
* ```js
|
|
2637
|
+
* const picomatch = require('picomatch');
|
|
2638
|
+
* const state = picomatch.parse('*.js');
|
|
2639
|
+
* // picomatch.compileRe(state[, options]);
|
|
2640
|
+
*
|
|
2641
|
+
* console.log(picomatch.compileRe(state));
|
|
2642
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
2643
|
+
* ```
|
|
2644
|
+
* @param {String} `state` The object returned from the `.parse` method.
|
|
2645
|
+
* @param {Object} `options`
|
|
2646
|
+
* @return {RegExp} Returns a regex created from the given pattern.
|
|
2647
|
+
* @api public
|
|
2648
|
+
*/
|
|
2649
|
+
|
|
2650
|
+
picomatch.compileRe = (parsed, options, returnOutput = false, returnState = false) => {
|
|
2651
|
+
if (returnOutput === true) {
|
|
2652
|
+
return parsed.output;
|
|
2653
|
+
}
|
|
2654
|
+
|
|
2655
|
+
const opts = options || {};
|
|
2656
|
+
const prepend = opts.contains ? '' : '^';
|
|
2657
|
+
const append = opts.contains ? '' : '$';
|
|
548
2658
|
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
2659
|
+
let source = `${prepend}(?:${parsed.output})${append}`;
|
|
2660
|
+
if (parsed && parsed.negated === true) {
|
|
2661
|
+
source = `^(?!${source}).*$`;
|
|
2662
|
+
}
|
|
552
2663
|
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
2664
|
+
const regex = picomatch.toRegex(source, options);
|
|
2665
|
+
if (returnState === true) {
|
|
2666
|
+
regex.state = parsed;
|
|
2667
|
+
}
|
|
556
2668
|
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
};
|
|
2669
|
+
return regex;
|
|
2670
|
+
};
|
|
560
2671
|
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
2672
|
+
picomatch.makeRe = (input, options, returnOutput = false, returnState = false) => {
|
|
2673
|
+
if (!input || typeof input !== 'string') {
|
|
2674
|
+
throw new TypeError('Expected a non-empty string');
|
|
2675
|
+
}
|
|
564
2676
|
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
2677
|
+
const opts = options || {};
|
|
2678
|
+
let parsed = { negated: false, fastpaths: true };
|
|
2679
|
+
let prefix = '';
|
|
2680
|
+
let output;
|
|
568
2681
|
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
2682
|
+
if (input.startsWith('./')) {
|
|
2683
|
+
input = input.slice(2);
|
|
2684
|
+
prefix = parsed.prefix = './';
|
|
2685
|
+
}
|
|
572
2686
|
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
}
|
|
2687
|
+
if (opts.fastpaths !== false && (input[0] === '.' || input[0] === '*')) {
|
|
2688
|
+
output = parse$1.fastpaths(input, options);
|
|
2689
|
+
}
|
|
576
2690
|
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
2691
|
+
if (output === undefined) {
|
|
2692
|
+
parsed = parse$1(input, options);
|
|
2693
|
+
parsed.prefix = prefix + (parsed.prefix || '');
|
|
2694
|
+
} else {
|
|
2695
|
+
parsed.output = output;
|
|
2696
|
+
}
|
|
580
2697
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
};
|
|
2698
|
+
return picomatch.compileRe(parsed, options, returnOutput, returnState);
|
|
2699
|
+
};
|
|
584
2700
|
|
|
585
|
-
|
|
586
|
-
|
|
2701
|
+
/**
|
|
2702
|
+
* Create a regular expression from the given regex source string.
|
|
2703
|
+
*
|
|
2704
|
+
* ```js
|
|
2705
|
+
* const picomatch = require('picomatch');
|
|
2706
|
+
* // picomatch.toRegex(source[, options]);
|
|
2707
|
+
*
|
|
2708
|
+
* const { output } = picomatch.parse('*.js');
|
|
2709
|
+
* console.log(picomatch.toRegex(output));
|
|
2710
|
+
* //=> /^(?:(?!\.)(?=.)[^/]*?\.js)$/
|
|
2711
|
+
* ```
|
|
2712
|
+
* @param {String} `source` Regular expression source string.
|
|
2713
|
+
* @param {Object} `options`
|
|
2714
|
+
* @return {RegExp}
|
|
2715
|
+
* @api public
|
|
2716
|
+
*/
|
|
587
2717
|
|
|
588
|
-
|
|
2718
|
+
picomatch.toRegex = (source, options) => {
|
|
2719
|
+
try {
|
|
2720
|
+
const opts = options || {};
|
|
2721
|
+
return new RegExp(source, opts.flags || (opts.nocase ? 'i' : ''));
|
|
2722
|
+
} catch (err) {
|
|
2723
|
+
if (options && options.debug === true) throw err;
|
|
2724
|
+
return /$^/;
|
|
2725
|
+
}
|
|
2726
|
+
};
|
|
589
2727
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
nodes,
|
|
595
|
-
i,
|
|
596
|
-
j = -1,
|
|
597
|
-
n,
|
|
598
|
-
m = rows.length,
|
|
599
|
-
value = parent.value;
|
|
2728
|
+
/**
|
|
2729
|
+
* Picomatch constants.
|
|
2730
|
+
* @return {Object}
|
|
2731
|
+
*/
|
|
600
2732
|
|
|
601
|
-
|
|
602
|
-
row = rows[j], nodes = row.children;
|
|
603
|
-
for (i = row.value = 0, n = nodes.length; i < n; ++i) row.value += nodes[i].value;
|
|
604
|
-
if (row.dice) treemapDice(row, x0, y0, x1, value ? y0 += (y1 - y0) * row.value / value : y1);
|
|
605
|
-
else treemapSlice(row, x0, y0, value ? x0 += (x1 - x0) * row.value / value : x1, y1);
|
|
606
|
-
value -= row.value;
|
|
607
|
-
}
|
|
608
|
-
} else {
|
|
609
|
-
parent._squarify = rows = squarifyRatio(ratio, parent, x0, y0, x1, y1);
|
|
610
|
-
rows.ratio = ratio;
|
|
611
|
-
}
|
|
612
|
-
}
|
|
2733
|
+
picomatch.constants = constants$1;
|
|
613
2734
|
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
2735
|
+
/**
|
|
2736
|
+
* Expose "picomatch"
|
|
2737
|
+
*/
|
|
617
2738
|
|
|
618
|
-
|
|
619
|
-
})(phi);
|
|
2739
|
+
var picomatch_1 = picomatch;
|
|
620
2740
|
|
|
621
|
-
|
|
2741
|
+
(function (module) {
|
|
622
2742
|
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
}
|
|
631
|
-
get id() {
|
|
632
|
-
return this._id;
|
|
633
|
-
}
|
|
634
|
-
get href() {
|
|
635
|
-
return this._href;
|
|
636
|
-
}
|
|
637
|
-
toString() {
|
|
638
|
-
return `url(${this.href})`;
|
|
639
|
-
}
|
|
2743
|
+
module.exports = picomatch_1;
|
|
2744
|
+
} (picomatchBrowser));
|
|
2745
|
+
|
|
2746
|
+
var pm = /*@__PURE__*/getDefaultExportFromCjs(picomatchBrowserExports);
|
|
2747
|
+
|
|
2748
|
+
function isArray(arg) {
|
|
2749
|
+
return Array.isArray(arg);
|
|
640
2750
|
}
|
|
641
|
-
function
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
2751
|
+
function ensureArray(thing) {
|
|
2752
|
+
if (isArray(thing))
|
|
2753
|
+
return thing;
|
|
2754
|
+
if (thing == null)
|
|
2755
|
+
return [];
|
|
2756
|
+
return [thing];
|
|
645
2757
|
}
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
2758
|
+
const globToTest = (glob) => {
|
|
2759
|
+
const pattern = glob;
|
|
2760
|
+
const fn = pm(pattern, { dot: true });
|
|
2761
|
+
return {
|
|
2762
|
+
test: (what) => {
|
|
2763
|
+
const result = fn(what);
|
|
2764
|
+
return result;
|
|
2765
|
+
},
|
|
2766
|
+
};
|
|
651
2767
|
};
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
if (options.gzip) {
|
|
655
|
-
availableSizeProperties.push("gzipLength");
|
|
656
|
-
}
|
|
657
|
-
if (options.brotli) {
|
|
658
|
-
availableSizeProperties.push("brotliLength");
|
|
659
|
-
}
|
|
660
|
-
return availableSizeProperties;
|
|
2768
|
+
const testTrue = {
|
|
2769
|
+
test: () => true,
|
|
661
2770
|
};
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
const
|
|
669
|
-
|
|
670
|
-
|
|
2771
|
+
const getMatcher = (filter) => {
|
|
2772
|
+
const bundleTest = "bundle" in filter && filter.bundle != null ? globToTest(filter.bundle) : testTrue;
|
|
2773
|
+
const fileTest = "file" in filter && filter.file != null ? globToTest(filter.file) : testTrue;
|
|
2774
|
+
return { bundleTest, fileTest };
|
|
2775
|
+
};
|
|
2776
|
+
const createFilter = (include, exclude) => {
|
|
2777
|
+
const includeMatchers = ensureArray(include).map(getMatcher);
|
|
2778
|
+
const excludeMatchers = ensureArray(exclude).map(getMatcher);
|
|
2779
|
+
return (bundleId, id) => {
|
|
2780
|
+
for (let i = 0; i < excludeMatchers.length; ++i) {
|
|
2781
|
+
const { bundleTest, fileTest } = excludeMatchers[i];
|
|
2782
|
+
if (bundleTest.test(bundleId) && fileTest.test(id))
|
|
2783
|
+
return false;
|
|
671
2784
|
}
|
|
2785
|
+
for (let i = 0; i < includeMatchers.length; ++i) {
|
|
2786
|
+
const { bundleTest, fileTest } = includeMatchers[i];
|
|
2787
|
+
if (bundleTest.test(bundleId) && fileTest.test(id))
|
|
2788
|
+
return true;
|
|
2789
|
+
}
|
|
2790
|
+
return !includeMatchers.length;
|
|
672
2791
|
};
|
|
673
|
-
const handleIncludeChange = (event) => {
|
|
674
|
-
const value = event.currentTarget.value;
|
|
675
|
-
setIncludeValue(value);
|
|
676
|
-
onIncludeChange(value);
|
|
677
|
-
};
|
|
678
|
-
const handleExcludeChange = (event) => {
|
|
679
|
-
const value = event.currentTarget.value;
|
|
680
|
-
setExcludeValue(value);
|
|
681
|
-
onExcludeChange(value);
|
|
682
|
-
};
|
|
683
|
-
return (e$1("aside", Object.assign({ className: "sidebar" }, { children: [e$1("div", Object.assign({ className: "size-selectors" }, { children: availableSizeProperties.length > 1 &&
|
|
684
|
-
availableSizeProperties.map((sizeProp) => {
|
|
685
|
-
const id = `selector-${sizeProp}`;
|
|
686
|
-
return (e$1("div", Object.assign({ className: "size-selector" }, { children: [e$1("input", { type: "radio", id: id, checked: sizeProp === sizeProperty, onChange: handleSizePropertyChange(sizeProp) }), e$1("label", Object.assign({ htmlFor: id }, { children: LABELS[sizeProp] }))] }), sizeProp));
|
|
687
|
-
}) })), e$1("div", Object.assign({ className: "module-filters" }, { children: [e$1("div", Object.assign({ className: "module-filter" }, { children: [e$1("label", Object.assign({ htmlFor: "module-filter-exclude" }, { children: "Exclude" })), e$1("input", { type: "text", id: "module-filter-exclude", value: excludeValue, onInput: handleExcludeChange, placeholder: "RegExp" })] })), e$1("div", Object.assign({ className: "module-filter" }, { children: [e$1("label", Object.assign({ htmlFor: "module-filter-include" }, { children: "Include" })), e$1("input", { type: "text", id: "module-filter-include", value: includeValue, onInput: handleIncludeChange, placeholder: "RegExp" })] }))] }))] })));
|
|
688
2792
|
};
|
|
689
2793
|
|
|
690
2794
|
const throttleFilter = (callback, limit) => {
|
|
@@ -699,44 +2803,45 @@ var drawChart = (function (exports) {
|
|
|
699
2803
|
}
|
|
700
2804
|
};
|
|
701
2805
|
};
|
|
2806
|
+
const prepareFilter = (filt) => {
|
|
2807
|
+
if (filt === "")
|
|
2808
|
+
return [];
|
|
2809
|
+
return (filt
|
|
2810
|
+
.split(",")
|
|
2811
|
+
// remove spaces before and after
|
|
2812
|
+
.map((entry) => entry.trim())
|
|
2813
|
+
// unquote "
|
|
2814
|
+
.map((entry) => entry.startsWith('"') && entry.endsWith('"') ? entry.substring(1, entry.length - 1) : entry)
|
|
2815
|
+
// unquote '
|
|
2816
|
+
.map((entry) => entry.startsWith("'") && entry.endsWith("'") ? entry.substring(1, entry.length - 1) : entry)
|
|
2817
|
+
// remove empty strings
|
|
2818
|
+
.filter((entry) => entry)
|
|
2819
|
+
// parse bundle:file
|
|
2820
|
+
.map((entry) => entry.split(":"))
|
|
2821
|
+
// normalize entry just in case
|
|
2822
|
+
.flatMap((entry) => {
|
|
2823
|
+
if (entry.length === 0)
|
|
2824
|
+
return [];
|
|
2825
|
+
let bundle = null;
|
|
2826
|
+
let file = null;
|
|
2827
|
+
if (entry.length === 1 && entry[0]) {
|
|
2828
|
+
file = entry[0];
|
|
2829
|
+
return [{ file, bundle }];
|
|
2830
|
+
}
|
|
2831
|
+
bundle = entry[0] || null;
|
|
2832
|
+
file = entry.slice(1).join(":") || null;
|
|
2833
|
+
return [{ bundle, file }];
|
|
2834
|
+
}));
|
|
2835
|
+
};
|
|
702
2836
|
const useFilter = () => {
|
|
703
|
-
const [includeFilter, setIncludeFilter] =
|
|
704
|
-
const [excludeFilter, setExcludeFilter] =
|
|
2837
|
+
const [includeFilter, setIncludeFilter] = p("");
|
|
2838
|
+
const [excludeFilter, setExcludeFilter] = p("");
|
|
705
2839
|
const setIncludeFilterTrottled = F(() => throttleFilter(setIncludeFilter, 200), []);
|
|
706
2840
|
const setExcludeFilterTrottled = F(() => throttleFilter(setExcludeFilter, 200), []);
|
|
707
|
-
const
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
try {
|
|
712
|
-
const re = new RegExp(includeFilter);
|
|
713
|
-
return ({ id }) => re.test(id);
|
|
714
|
-
}
|
|
715
|
-
catch (err) {
|
|
716
|
-
return () => false;
|
|
717
|
-
}
|
|
718
|
-
}, [includeFilter]);
|
|
719
|
-
const isModuleExcluded = F(() => {
|
|
720
|
-
if (excludeFilter === "") {
|
|
721
|
-
return () => false;
|
|
722
|
-
}
|
|
723
|
-
try {
|
|
724
|
-
const re = new RegExp(excludeFilter);
|
|
725
|
-
return ({ id }) => re.test(id);
|
|
726
|
-
}
|
|
727
|
-
catch (err) {
|
|
728
|
-
return () => false;
|
|
729
|
-
}
|
|
730
|
-
}, [excludeFilter]);
|
|
731
|
-
const isDefaultInclude = includeFilter === "";
|
|
732
|
-
const getModuleFilterMultiplier = F(() => {
|
|
733
|
-
return (data) => {
|
|
734
|
-
if (isDefaultInclude) {
|
|
735
|
-
return isModuleExcluded(data) ? 0 : 1;
|
|
736
|
-
}
|
|
737
|
-
return isModuleExcluded(data) && !isModuleIncluded(data) ? 0 : 1;
|
|
738
|
-
};
|
|
739
|
-
}, [isDefaultInclude, isModuleExcluded, isModuleIncluded]);
|
|
2841
|
+
const isIncluded = F(() => createFilter(prepareFilter(includeFilter), prepareFilter(excludeFilter)), [includeFilter, excludeFilter]);
|
|
2842
|
+
const getModuleFilterMultiplier = T((bundleId, data) => {
|
|
2843
|
+
return isIncluded(bundleId, data.id) ? 1 : 0;
|
|
2844
|
+
}, [isIncluded]);
|
|
740
2845
|
return {
|
|
741
2846
|
getModuleFilterMultiplier,
|
|
742
2847
|
includeFilter,
|
|
@@ -954,8 +3059,8 @@ var drawChart = (function (exports) {
|
|
|
954
3059
|
const { getModuleColor } = q(StaticContext);
|
|
955
3060
|
const { backgroundColor, fontColor } = getModuleColor(node);
|
|
956
3061
|
const { x0, x1, y1, y0, data, children = null } = node;
|
|
957
|
-
const textRef =
|
|
958
|
-
const textRectRef =
|
|
3062
|
+
const textRef = _(null);
|
|
3063
|
+
const textRectRef = _();
|
|
959
3064
|
const width = x1 - x0;
|
|
960
3065
|
const height = y1 - y0;
|
|
961
3066
|
const textProps = {
|
|
@@ -970,7 +3075,7 @@ var drawChart = (function (exports) {
|
|
|
970
3075
|
else {
|
|
971
3076
|
textProps.y = height / 2;
|
|
972
3077
|
}
|
|
973
|
-
|
|
3078
|
+
s(() => {
|
|
974
3079
|
if (width == 0 || height == 0 || !textRef.current) {
|
|
975
3080
|
return;
|
|
976
3081
|
}
|
|
@@ -995,13 +3100,13 @@ var drawChart = (function (exports) {
|
|
|
995
3100
|
if (width == 0 || height == 0) {
|
|
996
3101
|
return null;
|
|
997
3102
|
}
|
|
998
|
-
return (
|
|
3103
|
+
return (o$1("g", Object.assign({ className: "node", transform: `translate(${x0},${y0})`, onClick: (event) => {
|
|
999
3104
|
event.stopPropagation();
|
|
1000
3105
|
onClick(node);
|
|
1001
3106
|
}, onMouseOver: (event) => {
|
|
1002
3107
|
event.stopPropagation();
|
|
1003
3108
|
onMouseOver(node);
|
|
1004
|
-
} }, { children: [
|
|
3109
|
+
} }, { children: [o$1("rect", { fill: backgroundColor, rx: 2, ry: 2, width: x1 - x0, height: y1 - y0, stroke: selected ? "#fff" : undefined, "stroke-width": selected ? 2 : undefined }), o$1("text", Object.assign({ ref: textRef, fill: fontColor, onClick: (event) => {
|
|
1005
3110
|
var _a;
|
|
1006
3111
|
if (((_a = window.getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) !== "") {
|
|
1007
3112
|
event.stopPropagation();
|
|
@@ -1009,7 +3114,7 @@ var drawChart = (function (exports) {
|
|
|
1009
3114
|
} }, textProps, { children: data.name }))] })));
|
|
1010
3115
|
};
|
|
1011
3116
|
|
|
1012
|
-
const TreeMap = ({ root, onNodeHover, selectedNode, onNodeClick }) => {
|
|
3117
|
+
const TreeMap = ({ root, onNodeHover, selectedNode, onNodeClick, }) => {
|
|
1013
3118
|
const { width, height, getModuleIds } = q(StaticContext);
|
|
1014
3119
|
console.time("layering");
|
|
1015
3120
|
// this will make groups by height
|
|
@@ -1023,14 +3128,18 @@ var drawChart = (function (exports) {
|
|
|
1023
3128
|
return nestedData;
|
|
1024
3129
|
}, [root]);
|
|
1025
3130
|
console.timeEnd("layering");
|
|
1026
|
-
return (
|
|
1027
|
-
return (
|
|
1028
|
-
return (
|
|
3131
|
+
return (o$1("svg", Object.assign({ xmlns: "http://www.w3.org/2000/svg", viewBox: `0 0 ${width} ${height}` }, { children: nestedData.map(({ key, values }) => {
|
|
3132
|
+
return (o$1("g", Object.assign({ className: "layer" }, { children: values.map((node) => {
|
|
3133
|
+
return (o$1(Node, { node: node, onMouseOver: onNodeHover, selected: selectedNode === node, onClick: onNodeClick }, getModuleIds(node.data).nodeUid.id));
|
|
1029
3134
|
}) }), key));
|
|
1030
3135
|
}) })));
|
|
1031
3136
|
};
|
|
1032
3137
|
|
|
1033
|
-
var
|
|
3138
|
+
var bytesExports = {};
|
|
3139
|
+
var bytes$1 = {
|
|
3140
|
+
get exports(){ return bytesExports; },
|
|
3141
|
+
set exports(v){ bytesExports = v; },
|
|
3142
|
+
};
|
|
1034
3143
|
|
|
1035
3144
|
/*!
|
|
1036
3145
|
* bytes
|
|
@@ -1045,8 +3154,8 @@ var drawChart = (function (exports) {
|
|
|
1045
3154
|
*/
|
|
1046
3155
|
|
|
1047
3156
|
bytes$1.exports = bytes;
|
|
1048
|
-
var format_1 =
|
|
1049
|
-
|
|
3157
|
+
var format_1 = bytesExports.format = format$1;
|
|
3158
|
+
bytesExports.parse = parse;
|
|
1050
3159
|
|
|
1051
3160
|
/**
|
|
1052
3161
|
* Module variables.
|
|
@@ -1203,13 +3312,13 @@ var drawChart = (function (exports) {
|
|
|
1203
3312
|
|
|
1204
3313
|
const Tooltip_marginX = 10;
|
|
1205
3314
|
const Tooltip_marginY = 30;
|
|
1206
|
-
const SOURCEMAP_RENDERED = (
|
|
1207
|
-
const RENDRED = (
|
|
1208
|
-
const COMPRESSED = (
|
|
1209
|
-
const Tooltip = ({ node, visible, root, sizeProperty }) => {
|
|
3315
|
+
const SOURCEMAP_RENDERED = (o$1("span", { children: [" ", o$1("b", { children: LABELS.renderedLength }), " is a number of characters in the file after individual and ", o$1("br", {}), " ", "whole bundle transformations according to sourcemap."] }));
|
|
3316
|
+
const RENDRED = (o$1("span", { children: [o$1("b", { children: LABELS.renderedLength }), " is a byte size of individual file after transformations and treeshake."] }));
|
|
3317
|
+
const COMPRESSED = (o$1("span", { children: [o$1("b", { children: LABELS.gzipLength }), " and ", o$1("b", { children: LABELS.brotliLength }), " is a byte size of individual file after individual transformations,", o$1("br", {}), " treeshake and compression."] }));
|
|
3318
|
+
const Tooltip = ({ node, visible, root, sizeProperty, }) => {
|
|
1210
3319
|
const { availableSizeProperties, getModuleSize, data } = q(StaticContext);
|
|
1211
|
-
const ref =
|
|
1212
|
-
const [style, setStyle] =
|
|
3320
|
+
const ref = _(null);
|
|
3321
|
+
const [style, setStyle] = p({});
|
|
1213
3322
|
const content = F(() => {
|
|
1214
3323
|
if (!node)
|
|
1215
3324
|
return null;
|
|
@@ -1224,20 +3333,20 @@ var drawChart = (function (exports) {
|
|
|
1224
3333
|
.join("/");
|
|
1225
3334
|
let dataNode = null;
|
|
1226
3335
|
if (!isModuleTree(node.data)) {
|
|
1227
|
-
const mainUid = data.nodeParts[node.data.uid].
|
|
3336
|
+
const mainUid = data.nodeParts[node.data.uid].metaUid;
|
|
1228
3337
|
dataNode = data.nodeMetas[mainUid];
|
|
1229
3338
|
}
|
|
1230
|
-
return (
|
|
3339
|
+
return (o$1(p$1, { children: [o$1("div", { children: path }), availableSizeProperties.map((sizeProp) => {
|
|
1231
3340
|
if (sizeProp === sizeProperty) {
|
|
1232
|
-
return (
|
|
3341
|
+
return (o$1("div", { children: [o$1("b", { children: [LABELS[sizeProp], ": ", format_1(mainSize)] }), " ", "(", percentageString, ")"] }, sizeProp));
|
|
1233
3342
|
}
|
|
1234
3343
|
else {
|
|
1235
|
-
return (
|
|
3344
|
+
return (o$1("div", { children: [LABELS[sizeProp], ": ", format_1(getModuleSize(node.data, sizeProp))] }, sizeProp));
|
|
1236
3345
|
}
|
|
1237
|
-
}),
|
|
3346
|
+
}), o$1("br", {}), dataNode && dataNode.importedBy.length > 0 && (o$1("div", { children: [o$1("div", { children: [o$1("b", { children: "Imported By" }), ":"] }), dataNode.importedBy.map(({ uid }) => {
|
|
1238
3347
|
const id = data.nodeMetas[uid].id;
|
|
1239
|
-
return
|
|
1240
|
-
})] })),
|
|
3348
|
+
return o$1("div", { children: id }, id);
|
|
3349
|
+
})] })), o$1("br", {}), o$1("small", { children: data.options.sourcemap ? SOURCEMAP_RENDERED : RENDRED }), (data.options.gzip || data.options.brotli) && (o$1(p$1, { children: [o$1("br", {}), o$1("small", { children: COMPRESSED })] }))] }));
|
|
1241
3350
|
}, [availableSizeProperties, data, getModuleSize, node, root.data, sizeProperty]);
|
|
1242
3351
|
const updatePosition = (mouseCoords) => {
|
|
1243
3352
|
if (!ref.current)
|
|
@@ -1257,7 +3366,7 @@ var drawChart = (function (exports) {
|
|
|
1257
3366
|
}
|
|
1258
3367
|
setStyle(pos);
|
|
1259
3368
|
};
|
|
1260
|
-
|
|
3369
|
+
h(() => {
|
|
1261
3370
|
const handleMouseMove = (event) => {
|
|
1262
3371
|
updatePosition({
|
|
1263
3372
|
x: event.pageX,
|
|
@@ -1269,13 +3378,13 @@ var drawChart = (function (exports) {
|
|
|
1269
3378
|
document.removeEventListener("mousemove", handleMouseMove, true);
|
|
1270
3379
|
};
|
|
1271
3380
|
}, []);
|
|
1272
|
-
return (
|
|
3381
|
+
return (o$1("div", Object.assign({ className: `tooltip ${visible ? "" : "tooltip-hidden"}`, ref: ref, style: style }, { children: content })));
|
|
1273
3382
|
};
|
|
1274
3383
|
|
|
1275
|
-
const Chart = ({ root, sizeProperty, selectedNode, setSelectedNode }) => {
|
|
1276
|
-
const [showTooltip, setShowTooltip] =
|
|
1277
|
-
const [tooltipNode, setTooltipNode] =
|
|
1278
|
-
|
|
3384
|
+
const Chart = ({ root, sizeProperty, selectedNode, setSelectedNode, }) => {
|
|
3385
|
+
const [showTooltip, setShowTooltip] = p(false);
|
|
3386
|
+
const [tooltipNode, setTooltipNode] = p(undefined);
|
|
3387
|
+
h(() => {
|
|
1279
3388
|
const handleMouseOut = () => {
|
|
1280
3389
|
setShowTooltip(false);
|
|
1281
3390
|
};
|
|
@@ -1284,24 +3393,23 @@ var drawChart = (function (exports) {
|
|
|
1284
3393
|
document.removeEventListener("mouseover", handleMouseOut);
|
|
1285
3394
|
};
|
|
1286
3395
|
}, []);
|
|
1287
|
-
return (
|
|
3396
|
+
return (o$1(p$1, { children: [o$1(TreeMap, { root: root, onNodeHover: (node) => {
|
|
1288
3397
|
setTooltipNode(node);
|
|
1289
3398
|
setShowTooltip(true);
|
|
1290
3399
|
}, selectedNode: selectedNode, onNodeClick: (node) => {
|
|
1291
3400
|
setSelectedNode(selectedNode === node ? undefined : node);
|
|
1292
|
-
} }),
|
|
3401
|
+
} }), o$1(Tooltip, { visible: showTooltip, node: tooltipNode, root: root, sizeProperty: sizeProperty })] }));
|
|
1293
3402
|
};
|
|
1294
3403
|
|
|
1295
3404
|
const Main = () => {
|
|
1296
3405
|
const { availableSizeProperties, rawHierarchy, getModuleSize, layout, data } = q(StaticContext);
|
|
1297
|
-
const [sizeProperty, setSizeProperty] =
|
|
1298
|
-
const [selectedNode, setSelectedNode] =
|
|
3406
|
+
const [sizeProperty, setSizeProperty] = p(availableSizeProperties[0]);
|
|
3407
|
+
const [selectedNode, setSelectedNode] = p(undefined);
|
|
1299
3408
|
const { getModuleFilterMultiplier, setExcludeFilter, setIncludeFilter } = useFilter();
|
|
1300
3409
|
console.time("getNodeSizeMultiplier");
|
|
1301
3410
|
const getNodeSizeMultiplier = F(() => {
|
|
1302
|
-
const
|
|
1303
|
-
const
|
|
1304
|
-
const multiplier = rootSize * 0.2 > selectedSize ? (rootSize * 0.2) / selectedSize : 3;
|
|
3411
|
+
const selectedMultiplier = 1; // selectedSize < rootSize * increaseFactor ? (rootSize * increaseFactor) / selectedSize : rootSize / selectedSize;
|
|
3412
|
+
const nonSelectedMultiplier = 0; // 1 / selectedMultiplier
|
|
1305
3413
|
if (selectedNode === undefined) {
|
|
1306
3414
|
return () => 1;
|
|
1307
3415
|
}
|
|
@@ -1309,17 +3417,17 @@ var drawChart = (function (exports) {
|
|
|
1309
3417
|
const leaves = new Set(selectedNode.leaves().map((d) => d.data));
|
|
1310
3418
|
return (node) => {
|
|
1311
3419
|
if (leaves.has(node)) {
|
|
1312
|
-
return
|
|
3420
|
+
return selectedMultiplier;
|
|
1313
3421
|
}
|
|
1314
|
-
return
|
|
3422
|
+
return nonSelectedMultiplier;
|
|
1315
3423
|
};
|
|
1316
3424
|
}
|
|
1317
3425
|
else {
|
|
1318
3426
|
return (node) => {
|
|
1319
3427
|
if (node === selectedNode.data) {
|
|
1320
|
-
return
|
|
3428
|
+
return selectedMultiplier;
|
|
1321
3429
|
}
|
|
1322
|
-
return
|
|
3430
|
+
return nonSelectedMultiplier;
|
|
1323
3431
|
};
|
|
1324
3432
|
}
|
|
1325
3433
|
}, [getModuleSize, rawHierarchy.data, selectedNode, sizeProperty]);
|
|
@@ -1329,18 +3437,29 @@ var drawChart = (function (exports) {
|
|
|
1329
3437
|
const root = F(() => {
|
|
1330
3438
|
const rootWithSizesAndSorted = rawHierarchy
|
|
1331
3439
|
.sum((node) => {
|
|
3440
|
+
var _a;
|
|
1332
3441
|
if (isModuleTree(node))
|
|
1333
3442
|
return 0;
|
|
3443
|
+
const meta = data.nodeMetas[data.nodeParts[node.uid].metaUid];
|
|
3444
|
+
const bundleId = (_a = Object.entries(meta.moduleParts).find(([bundleId, uid]) => uid == node.uid)) === null || _a === void 0 ? void 0 : _a[0];
|
|
1334
3445
|
const ownSize = getModuleSize(node, sizeProperty);
|
|
1335
3446
|
const zoomMultiplier = getNodeSizeMultiplier(node);
|
|
1336
|
-
const filterMultiplier = getModuleFilterMultiplier(
|
|
3447
|
+
const filterMultiplier = getModuleFilterMultiplier(bundleId, meta);
|
|
1337
3448
|
return ownSize * zoomMultiplier * filterMultiplier;
|
|
1338
3449
|
})
|
|
1339
3450
|
.sort((a, b) => getModuleSize(a.data, sizeProperty) - getModuleSize(b.data, sizeProperty));
|
|
1340
3451
|
return layout(rootWithSizesAndSorted);
|
|
1341
|
-
}, [
|
|
3452
|
+
}, [
|
|
3453
|
+
data,
|
|
3454
|
+
getModuleFilterMultiplier,
|
|
3455
|
+
getModuleSize,
|
|
3456
|
+
getNodeSizeMultiplier,
|
|
3457
|
+
layout,
|
|
3458
|
+
rawHierarchy,
|
|
3459
|
+
sizeProperty,
|
|
3460
|
+
]);
|
|
1342
3461
|
console.timeEnd("root hierarchy compute");
|
|
1343
|
-
return (
|
|
3462
|
+
return (o$1(p$1, { children: [o$1(SideBar, { sizeProperty: sizeProperty, availableSizeProperties: availableSizeProperties, setSizeProperty: setSizeProperty, onExcludeChange: setExcludeFilter, onIncludeChange: setIncludeFilter }), o$1(Chart, { root: root, sizeProperty: sizeProperty, selectedNode: selectedNode, setSelectedNode: setSelectedNode })] }));
|
|
1344
3463
|
};
|
|
1345
3464
|
|
|
1346
3465
|
function initRange(domain, range) {
|
|
@@ -2799,47 +4918,46 @@ var drawChart = (function (exports) {
|
|
|
2799
4918
|
return linearish(scale);
|
|
2800
4919
|
}
|
|
2801
4920
|
|
|
2802
|
-
|
|
2803
|
-
t1 = new Date;
|
|
4921
|
+
const t0 = new Date, t1 = new Date;
|
|
2804
4922
|
|
|
2805
|
-
function
|
|
4923
|
+
function timeInterval(floori, offseti, count, field) {
|
|
2806
4924
|
|
|
2807
4925
|
function interval(date) {
|
|
2808
4926
|
return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;
|
|
2809
4927
|
}
|
|
2810
4928
|
|
|
2811
|
-
interval.floor =
|
|
4929
|
+
interval.floor = (date) => {
|
|
2812
4930
|
return floori(date = new Date(+date)), date;
|
|
2813
4931
|
};
|
|
2814
4932
|
|
|
2815
|
-
interval.ceil =
|
|
4933
|
+
interval.ceil = (date) => {
|
|
2816
4934
|
return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;
|
|
2817
4935
|
};
|
|
2818
4936
|
|
|
2819
|
-
interval.round =
|
|
2820
|
-
|
|
2821
|
-
d1 = interval.ceil(date);
|
|
4937
|
+
interval.round = (date) => {
|
|
4938
|
+
const d0 = interval(date), d1 = interval.ceil(date);
|
|
2822
4939
|
return date - d0 < d1 - date ? d0 : d1;
|
|
2823
4940
|
};
|
|
2824
4941
|
|
|
2825
|
-
interval.offset =
|
|
4942
|
+
interval.offset = (date, step) => {
|
|
2826
4943
|
return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;
|
|
2827
4944
|
};
|
|
2828
4945
|
|
|
2829
|
-
interval.range =
|
|
2830
|
-
|
|
4946
|
+
interval.range = (start, stop, step) => {
|
|
4947
|
+
const range = [];
|
|
2831
4948
|
start = interval.ceil(start);
|
|
2832
4949
|
step = step == null ? 1 : Math.floor(step);
|
|
2833
4950
|
if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date
|
|
4951
|
+
let previous;
|
|
2834
4952
|
do range.push(previous = new Date(+start)), offseti(start, step), floori(start);
|
|
2835
4953
|
while (previous < start && start < stop);
|
|
2836
4954
|
return range;
|
|
2837
4955
|
};
|
|
2838
4956
|
|
|
2839
|
-
interval.filter =
|
|
2840
|
-
return
|
|
4957
|
+
interval.filter = (test) => {
|
|
4958
|
+
return timeInterval((date) => {
|
|
2841
4959
|
if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);
|
|
2842
|
-
},
|
|
4960
|
+
}, (date, step) => {
|
|
2843
4961
|
if (date >= date) {
|
|
2844
4962
|
if (step < 0) while (++step <= 0) {
|
|
2845
4963
|
while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty
|
|
@@ -2851,46 +4969,47 @@ var drawChart = (function (exports) {
|
|
|
2851
4969
|
};
|
|
2852
4970
|
|
|
2853
4971
|
if (count) {
|
|
2854
|
-
interval.count =
|
|
4972
|
+
interval.count = (start, end) => {
|
|
2855
4973
|
t0.setTime(+start), t1.setTime(+end);
|
|
2856
4974
|
floori(t0), floori(t1);
|
|
2857
4975
|
return Math.floor(count(t0, t1));
|
|
2858
4976
|
};
|
|
2859
4977
|
|
|
2860
|
-
interval.every =
|
|
4978
|
+
interval.every = (step) => {
|
|
2861
4979
|
step = Math.floor(step);
|
|
2862
4980
|
return !isFinite(step) || !(step > 0) ? null
|
|
2863
4981
|
: !(step > 1) ? interval
|
|
2864
4982
|
: interval.filter(field
|
|
2865
|
-
?
|
|
2866
|
-
:
|
|
4983
|
+
? (d) => field(d) % step === 0
|
|
4984
|
+
: (d) => interval.count(0, d) % step === 0);
|
|
2867
4985
|
};
|
|
2868
4986
|
}
|
|
2869
4987
|
|
|
2870
4988
|
return interval;
|
|
2871
4989
|
}
|
|
2872
4990
|
|
|
2873
|
-
|
|
4991
|
+
const millisecond = timeInterval(() => {
|
|
2874
4992
|
// noop
|
|
2875
|
-
},
|
|
4993
|
+
}, (date, step) => {
|
|
2876
4994
|
date.setTime(+date + step);
|
|
2877
|
-
},
|
|
4995
|
+
}, (start, end) => {
|
|
2878
4996
|
return end - start;
|
|
2879
4997
|
});
|
|
2880
4998
|
|
|
2881
4999
|
// An optimized implementation for this simple case.
|
|
2882
|
-
millisecond.every =
|
|
5000
|
+
millisecond.every = (k) => {
|
|
2883
5001
|
k = Math.floor(k);
|
|
2884
5002
|
if (!isFinite(k) || !(k > 0)) return null;
|
|
2885
5003
|
if (!(k > 1)) return millisecond;
|
|
2886
|
-
return
|
|
5004
|
+
return timeInterval((date) => {
|
|
2887
5005
|
date.setTime(Math.floor(date / k) * k);
|
|
2888
|
-
},
|
|
5006
|
+
}, (date, step) => {
|
|
2889
5007
|
date.setTime(+date + step * k);
|
|
2890
|
-
},
|
|
5008
|
+
}, (start, end) => {
|
|
2891
5009
|
return (end - start) / k;
|
|
2892
5010
|
});
|
|
2893
5011
|
};
|
|
5012
|
+
|
|
2894
5013
|
millisecond.range;
|
|
2895
5014
|
|
|
2896
5015
|
const durationSecond = 1000;
|
|
@@ -2899,160 +5018,144 @@ var drawChart = (function (exports) {
|
|
|
2899
5018
|
const durationDay = durationHour * 24;
|
|
2900
5019
|
const durationWeek = durationDay * 7;
|
|
2901
5020
|
|
|
2902
|
-
|
|
5021
|
+
const second = timeInterval((date) => {
|
|
2903
5022
|
date.setTime(date - date.getMilliseconds());
|
|
2904
|
-
},
|
|
5023
|
+
}, (date, step) => {
|
|
2905
5024
|
date.setTime(+date + step * durationSecond);
|
|
2906
|
-
},
|
|
5025
|
+
}, (start, end) => {
|
|
2907
5026
|
return (end - start) / durationSecond;
|
|
2908
|
-
},
|
|
5027
|
+
}, (date) => {
|
|
2909
5028
|
return date.getUTCSeconds();
|
|
2910
5029
|
});
|
|
5030
|
+
|
|
2911
5031
|
second.range;
|
|
2912
5032
|
|
|
2913
|
-
|
|
5033
|
+
const timeMinute = timeInterval((date) => {
|
|
2914
5034
|
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);
|
|
2915
|
-
},
|
|
5035
|
+
}, (date, step) => {
|
|
2916
5036
|
date.setTime(+date + step * durationMinute);
|
|
2917
|
-
},
|
|
5037
|
+
}, (start, end) => {
|
|
2918
5038
|
return (end - start) / durationMinute;
|
|
2919
|
-
},
|
|
5039
|
+
}, (date) => {
|
|
2920
5040
|
return date.getMinutes();
|
|
2921
5041
|
});
|
|
2922
|
-
minute.range;
|
|
2923
5042
|
|
|
2924
|
-
|
|
5043
|
+
timeMinute.range;
|
|
5044
|
+
|
|
5045
|
+
const utcMinute = timeInterval((date) => {
|
|
5046
|
+
date.setUTCSeconds(0, 0);
|
|
5047
|
+
}, (date, step) => {
|
|
5048
|
+
date.setTime(+date + step * durationMinute);
|
|
5049
|
+
}, (start, end) => {
|
|
5050
|
+
return (end - start) / durationMinute;
|
|
5051
|
+
}, (date) => {
|
|
5052
|
+
return date.getUTCMinutes();
|
|
5053
|
+
});
|
|
5054
|
+
|
|
5055
|
+
utcMinute.range;
|
|
5056
|
+
|
|
5057
|
+
const timeHour = timeInterval((date) => {
|
|
2925
5058
|
date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);
|
|
2926
|
-
},
|
|
5059
|
+
}, (date, step) => {
|
|
2927
5060
|
date.setTime(+date + step * durationHour);
|
|
2928
|
-
},
|
|
5061
|
+
}, (start, end) => {
|
|
2929
5062
|
return (end - start) / durationHour;
|
|
2930
|
-
},
|
|
5063
|
+
}, (date) => {
|
|
2931
5064
|
return date.getHours();
|
|
2932
5065
|
});
|
|
2933
|
-
hour.range;
|
|
2934
5066
|
|
|
2935
|
-
|
|
5067
|
+
timeHour.range;
|
|
5068
|
+
|
|
5069
|
+
const utcHour = timeInterval((date) => {
|
|
5070
|
+
date.setUTCMinutes(0, 0, 0);
|
|
5071
|
+
}, (date, step) => {
|
|
5072
|
+
date.setTime(+date + step * durationHour);
|
|
5073
|
+
}, (start, end) => {
|
|
5074
|
+
return (end - start) / durationHour;
|
|
5075
|
+
}, (date) => {
|
|
5076
|
+
return date.getUTCHours();
|
|
5077
|
+
});
|
|
5078
|
+
|
|
5079
|
+
utcHour.range;
|
|
5080
|
+
|
|
5081
|
+
const timeDay = timeInterval(
|
|
2936
5082
|
date => date.setHours(0, 0, 0, 0),
|
|
2937
5083
|
(date, step) => date.setDate(date.getDate() + step),
|
|
2938
5084
|
(start, end) => (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay,
|
|
2939
5085
|
date => date.getDate() - 1
|
|
2940
5086
|
);
|
|
2941
|
-
day.range;
|
|
2942
5087
|
|
|
2943
|
-
|
|
2944
|
-
return newInterval(function(date) {
|
|
2945
|
-
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
2946
|
-
date.setHours(0, 0, 0, 0);
|
|
2947
|
-
}, function(date, step) {
|
|
2948
|
-
date.setDate(date.getDate() + step * 7);
|
|
2949
|
-
}, function(start, end) {
|
|
2950
|
-
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
2951
|
-
});
|
|
2952
|
-
}
|
|
5088
|
+
timeDay.range;
|
|
2953
5089
|
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
5090
|
+
const utcDay = timeInterval((date) => {
|
|
5091
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
5092
|
+
}, (date, step) => {
|
|
5093
|
+
date.setUTCDate(date.getUTCDate() + step);
|
|
5094
|
+
}, (start, end) => {
|
|
5095
|
+
return (end - start) / durationDay;
|
|
5096
|
+
}, (date) => {
|
|
5097
|
+
return date.getUTCDate() - 1;
|
|
5098
|
+
});
|
|
2961
5099
|
|
|
2962
|
-
|
|
2963
|
-
monday.range;
|
|
2964
|
-
tuesday.range;
|
|
2965
|
-
wednesday.range;
|
|
2966
|
-
thursday.range;
|
|
2967
|
-
friday.range;
|
|
2968
|
-
saturday.range;
|
|
5100
|
+
utcDay.range;
|
|
2969
5101
|
|
|
2970
|
-
|
|
2971
|
-
date.
|
|
2972
|
-
|
|
2973
|
-
|
|
2974
|
-
|
|
2975
|
-
|
|
2976
|
-
|
|
2977
|
-
|
|
2978
|
-
return date.getMonth();
|
|
5102
|
+
const unixDay = timeInterval((date) => {
|
|
5103
|
+
date.setUTCHours(0, 0, 0, 0);
|
|
5104
|
+
}, (date, step) => {
|
|
5105
|
+
date.setUTCDate(date.getUTCDate() + step);
|
|
5106
|
+
}, (start, end) => {
|
|
5107
|
+
return (end - start) / durationDay;
|
|
5108
|
+
}, (date) => {
|
|
5109
|
+
return Math.floor(date / durationDay);
|
|
2979
5110
|
});
|
|
2980
|
-
month.range;
|
|
2981
5111
|
|
|
2982
|
-
|
|
2983
|
-
date.setMonth(0, 1);
|
|
2984
|
-
date.setHours(0, 0, 0, 0);
|
|
2985
|
-
}, function(date, step) {
|
|
2986
|
-
date.setFullYear(date.getFullYear() + step);
|
|
2987
|
-
}, function(start, end) {
|
|
2988
|
-
return end.getFullYear() - start.getFullYear();
|
|
2989
|
-
}, function(date) {
|
|
2990
|
-
return date.getFullYear();
|
|
2991
|
-
});
|
|
5112
|
+
unixDay.range;
|
|
2992
5113
|
|
|
2993
|
-
|
|
2994
|
-
|
|
2995
|
-
|
|
2996
|
-
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
2997
|
-
date.setMonth(0, 1);
|
|
5114
|
+
function timeWeekday(i) {
|
|
5115
|
+
return timeInterval((date) => {
|
|
5116
|
+
date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);
|
|
2998
5117
|
date.setHours(0, 0, 0, 0);
|
|
2999
|
-
},
|
|
3000
|
-
date.
|
|
5118
|
+
}, (date, step) => {
|
|
5119
|
+
date.setDate(date.getDate() + step * 7);
|
|
5120
|
+
}, (start, end) => {
|
|
5121
|
+
return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;
|
|
3001
5122
|
});
|
|
3002
|
-
}
|
|
3003
|
-
year.range;
|
|
3004
|
-
|
|
3005
|
-
var utcMinute = newInterval(function(date) {
|
|
3006
|
-
date.setUTCSeconds(0, 0);
|
|
3007
|
-
}, function(date, step) {
|
|
3008
|
-
date.setTime(+date + step * durationMinute);
|
|
3009
|
-
}, function(start, end) {
|
|
3010
|
-
return (end - start) / durationMinute;
|
|
3011
|
-
}, function(date) {
|
|
3012
|
-
return date.getUTCMinutes();
|
|
3013
|
-
});
|
|
3014
|
-
utcMinute.range;
|
|
5123
|
+
}
|
|
3015
5124
|
|
|
3016
|
-
|
|
3017
|
-
|
|
3018
|
-
|
|
3019
|
-
|
|
3020
|
-
|
|
3021
|
-
|
|
3022
|
-
|
|
3023
|
-
return date.getUTCHours();
|
|
3024
|
-
});
|
|
3025
|
-
utcHour.range;
|
|
5125
|
+
const timeSunday = timeWeekday(0);
|
|
5126
|
+
const timeMonday = timeWeekday(1);
|
|
5127
|
+
const timeTuesday = timeWeekday(2);
|
|
5128
|
+
const timeWednesday = timeWeekday(3);
|
|
5129
|
+
const timeThursday = timeWeekday(4);
|
|
5130
|
+
const timeFriday = timeWeekday(5);
|
|
5131
|
+
const timeSaturday = timeWeekday(6);
|
|
3026
5132
|
|
|
3027
|
-
|
|
3028
|
-
|
|
3029
|
-
|
|
3030
|
-
|
|
3031
|
-
|
|
3032
|
-
|
|
3033
|
-
|
|
3034
|
-
return date.getUTCDate() - 1;
|
|
3035
|
-
});
|
|
3036
|
-
utcDay.range;
|
|
5133
|
+
timeSunday.range;
|
|
5134
|
+
timeMonday.range;
|
|
5135
|
+
timeTuesday.range;
|
|
5136
|
+
timeWednesday.range;
|
|
5137
|
+
timeThursday.range;
|
|
5138
|
+
timeFriday.range;
|
|
5139
|
+
timeSaturday.range;
|
|
3037
5140
|
|
|
3038
5141
|
function utcWeekday(i) {
|
|
3039
|
-
return
|
|
5142
|
+
return timeInterval((date) => {
|
|
3040
5143
|
date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);
|
|
3041
5144
|
date.setUTCHours(0, 0, 0, 0);
|
|
3042
|
-
},
|
|
5145
|
+
}, (date, step) => {
|
|
3043
5146
|
date.setUTCDate(date.getUTCDate() + step * 7);
|
|
3044
|
-
},
|
|
5147
|
+
}, (start, end) => {
|
|
3045
5148
|
return (end - start) / durationWeek;
|
|
3046
5149
|
});
|
|
3047
5150
|
}
|
|
3048
5151
|
|
|
3049
|
-
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
|
|
3053
|
-
|
|
3054
|
-
|
|
3055
|
-
|
|
5152
|
+
const utcSunday = utcWeekday(0);
|
|
5153
|
+
const utcMonday = utcWeekday(1);
|
|
5154
|
+
const utcTuesday = utcWeekday(2);
|
|
5155
|
+
const utcWednesday = utcWeekday(3);
|
|
5156
|
+
const utcThursday = utcWeekday(4);
|
|
5157
|
+
const utcFriday = utcWeekday(5);
|
|
5158
|
+
const utcSaturday = utcWeekday(6);
|
|
3056
5159
|
|
|
3057
5160
|
utcSunday.range;
|
|
3058
5161
|
utcMonday.range;
|
|
@@ -3062,39 +5165,78 @@ var drawChart = (function (exports) {
|
|
|
3062
5165
|
utcFriday.range;
|
|
3063
5166
|
utcSaturday.range;
|
|
3064
5167
|
|
|
3065
|
-
|
|
5168
|
+
const timeMonth = timeInterval((date) => {
|
|
5169
|
+
date.setDate(1);
|
|
5170
|
+
date.setHours(0, 0, 0, 0);
|
|
5171
|
+
}, (date, step) => {
|
|
5172
|
+
date.setMonth(date.getMonth() + step);
|
|
5173
|
+
}, (start, end) => {
|
|
5174
|
+
return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;
|
|
5175
|
+
}, (date) => {
|
|
5176
|
+
return date.getMonth();
|
|
5177
|
+
});
|
|
5178
|
+
|
|
5179
|
+
timeMonth.range;
|
|
5180
|
+
|
|
5181
|
+
const utcMonth = timeInterval((date) => {
|
|
3066
5182
|
date.setUTCDate(1);
|
|
3067
5183
|
date.setUTCHours(0, 0, 0, 0);
|
|
3068
|
-
},
|
|
5184
|
+
}, (date, step) => {
|
|
3069
5185
|
date.setUTCMonth(date.getUTCMonth() + step);
|
|
3070
|
-
},
|
|
5186
|
+
}, (start, end) => {
|
|
3071
5187
|
return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;
|
|
3072
|
-
},
|
|
5188
|
+
}, (date) => {
|
|
3073
5189
|
return date.getUTCMonth();
|
|
3074
5190
|
});
|
|
5191
|
+
|
|
3075
5192
|
utcMonth.range;
|
|
3076
5193
|
|
|
3077
|
-
|
|
5194
|
+
const timeYear = timeInterval((date) => {
|
|
5195
|
+
date.setMonth(0, 1);
|
|
5196
|
+
date.setHours(0, 0, 0, 0);
|
|
5197
|
+
}, (date, step) => {
|
|
5198
|
+
date.setFullYear(date.getFullYear() + step);
|
|
5199
|
+
}, (start, end) => {
|
|
5200
|
+
return end.getFullYear() - start.getFullYear();
|
|
5201
|
+
}, (date) => {
|
|
5202
|
+
return date.getFullYear();
|
|
5203
|
+
});
|
|
5204
|
+
|
|
5205
|
+
// An optimized implementation for this simple case.
|
|
5206
|
+
timeYear.every = (k) => {
|
|
5207
|
+
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
|
|
5208
|
+
date.setFullYear(Math.floor(date.getFullYear() / k) * k);
|
|
5209
|
+
date.setMonth(0, 1);
|
|
5210
|
+
date.setHours(0, 0, 0, 0);
|
|
5211
|
+
}, (date, step) => {
|
|
5212
|
+
date.setFullYear(date.getFullYear() + step * k);
|
|
5213
|
+
});
|
|
5214
|
+
};
|
|
5215
|
+
|
|
5216
|
+
timeYear.range;
|
|
5217
|
+
|
|
5218
|
+
const utcYear = timeInterval((date) => {
|
|
3078
5219
|
date.setUTCMonth(0, 1);
|
|
3079
5220
|
date.setUTCHours(0, 0, 0, 0);
|
|
3080
|
-
},
|
|
5221
|
+
}, (date, step) => {
|
|
3081
5222
|
date.setUTCFullYear(date.getUTCFullYear() + step);
|
|
3082
|
-
},
|
|
5223
|
+
}, (start, end) => {
|
|
3083
5224
|
return end.getUTCFullYear() - start.getUTCFullYear();
|
|
3084
|
-
},
|
|
5225
|
+
}, (date) => {
|
|
3085
5226
|
return date.getUTCFullYear();
|
|
3086
5227
|
});
|
|
3087
5228
|
|
|
3088
5229
|
// An optimized implementation for this simple case.
|
|
3089
|
-
utcYear.every =
|
|
3090
|
-
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null :
|
|
5230
|
+
utcYear.every = (k) => {
|
|
5231
|
+
return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : timeInterval((date) => {
|
|
3091
5232
|
date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);
|
|
3092
5233
|
date.setUTCMonth(0, 1);
|
|
3093
5234
|
date.setUTCHours(0, 0, 0, 0);
|
|
3094
|
-
},
|
|
5235
|
+
}, (date, step) => {
|
|
3095
5236
|
date.setUTCFullYear(date.getUTCFullYear() + step * k);
|
|
3096
5237
|
});
|
|
3097
5238
|
};
|
|
5239
|
+
|
|
3098
5240
|
utcYear.range;
|
|
3099
5241
|
|
|
3100
5242
|
function localDate(d) {
|
|
@@ -3285,7 +5427,7 @@ var drawChart = (function (exports) {
|
|
|
3285
5427
|
return function(string) {
|
|
3286
5428
|
var d = newDate(1900, undefined, 1),
|
|
3287
5429
|
i = parseSpecifier(d, specifier, string += "", 0),
|
|
3288
|
-
week, day
|
|
5430
|
+
week, day;
|
|
3289
5431
|
if (i != string.length) return null;
|
|
3290
5432
|
|
|
3291
5433
|
// If a UNIX timestamp is specified, return it.
|
|
@@ -3306,25 +5448,25 @@ var drawChart = (function (exports) {
|
|
|
3306
5448
|
if (d.V < 1 || d.V > 53) return null;
|
|
3307
5449
|
if (!("w" in d)) d.w = 1;
|
|
3308
5450
|
if ("Z" in d) {
|
|
3309
|
-
week = utcDate(newDate(d.y, 0, 1)), day
|
|
3310
|
-
week = day
|
|
5451
|
+
week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();
|
|
5452
|
+
week = day > 4 || day === 0 ? utcMonday.ceil(week) : utcMonday(week);
|
|
3311
5453
|
week = utcDay.offset(week, (d.V - 1) * 7);
|
|
3312
5454
|
d.y = week.getUTCFullYear();
|
|
3313
5455
|
d.m = week.getUTCMonth();
|
|
3314
5456
|
d.d = week.getUTCDate() + (d.w + 6) % 7;
|
|
3315
5457
|
} else {
|
|
3316
|
-
week = localDate(newDate(d.y, 0, 1)), day
|
|
3317
|
-
week = day
|
|
3318
|
-
week =
|
|
5458
|
+
week = localDate(newDate(d.y, 0, 1)), day = week.getDay();
|
|
5459
|
+
week = day > 4 || day === 0 ? timeMonday.ceil(week) : timeMonday(week);
|
|
5460
|
+
week = timeDay.offset(week, (d.V - 1) * 7);
|
|
3319
5461
|
d.y = week.getFullYear();
|
|
3320
5462
|
d.m = week.getMonth();
|
|
3321
5463
|
d.d = week.getDate() + (d.w + 6) % 7;
|
|
3322
5464
|
}
|
|
3323
5465
|
} else if ("W" in d || "U" in d) {
|
|
3324
5466
|
if (!("w" in d)) d.w = "u" in d ? d.u % 7 : "W" in d ? 1 : 0;
|
|
3325
|
-
day
|
|
5467
|
+
day = "Z" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();
|
|
3326
5468
|
d.m = 0;
|
|
3327
|
-
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day
|
|
5469
|
+
d.d = "W" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;
|
|
3328
5470
|
}
|
|
3329
5471
|
|
|
3330
5472
|
// If a time zone is specified, all fields are interpreted as UTC and then
|
|
@@ -3608,7 +5750,7 @@ var drawChart = (function (exports) {
|
|
|
3608
5750
|
}
|
|
3609
5751
|
|
|
3610
5752
|
function formatDayOfYear(d, p) {
|
|
3611
|
-
return pad(1 +
|
|
5753
|
+
return pad(1 + timeDay.count(timeYear(d), d), p, 3);
|
|
3612
5754
|
}
|
|
3613
5755
|
|
|
3614
5756
|
function formatMilliseconds(d, p) {
|
|
@@ -3637,17 +5779,17 @@ var drawChart = (function (exports) {
|
|
|
3637
5779
|
}
|
|
3638
5780
|
|
|
3639
5781
|
function formatWeekNumberSunday(d, p) {
|
|
3640
|
-
return pad(
|
|
5782
|
+
return pad(timeSunday.count(timeYear(d) - 1, d), p, 2);
|
|
3641
5783
|
}
|
|
3642
5784
|
|
|
3643
5785
|
function dISO(d) {
|
|
3644
5786
|
var day = d.getDay();
|
|
3645
|
-
return (day >= 4 || day === 0) ?
|
|
5787
|
+
return (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
|
|
3646
5788
|
}
|
|
3647
5789
|
|
|
3648
5790
|
function formatWeekNumberISO(d, p) {
|
|
3649
5791
|
d = dISO(d);
|
|
3650
|
-
return pad(
|
|
5792
|
+
return pad(timeThursday.count(timeYear(d), d) + (timeYear(d).getDay() === 4), p, 2);
|
|
3651
5793
|
}
|
|
3652
5794
|
|
|
3653
5795
|
function formatWeekdayNumberSunday(d) {
|
|
@@ -3655,7 +5797,7 @@ var drawChart = (function (exports) {
|
|
|
3655
5797
|
}
|
|
3656
5798
|
|
|
3657
5799
|
function formatWeekNumberMonday(d, p) {
|
|
3658
|
-
return pad(
|
|
5800
|
+
return pad(timeMonday.count(timeYear(d) - 1, d), p, 2);
|
|
3659
5801
|
}
|
|
3660
5802
|
|
|
3661
5803
|
function formatYear(d, p) {
|
|
@@ -3673,7 +5815,7 @@ var drawChart = (function (exports) {
|
|
|
3673
5815
|
|
|
3674
5816
|
function formatFullYearISO(d, p) {
|
|
3675
5817
|
var day = d.getDay();
|
|
3676
|
-
d = (day >= 4 || day === 0) ?
|
|
5818
|
+
d = (day >= 4 || day === 0) ? timeThursday(d) : timeThursday.ceil(d);
|
|
3677
5819
|
return pad(d.getFullYear() % 10000, p, 4);
|
|
3678
5820
|
}
|
|
3679
5821
|
|
|
@@ -3924,7 +6066,9 @@ var drawChart = (function (exports) {
|
|
|
3924
6066
|
const lightScale = linear().domain([0, root.height]).range([0.9, 0.3]);
|
|
3925
6067
|
const getBackgroundColor = (node) => {
|
|
3926
6068
|
const parents = node.ancestors();
|
|
3927
|
-
const colorStr = parents.length === 1
|
|
6069
|
+
const colorStr = parents.length === 1
|
|
6070
|
+
? colorParentMap.get(parents[0])
|
|
6071
|
+
: colorParentMap.get(parents[parents.length - 2]);
|
|
3928
6072
|
const hslColor = hsl(colorStr);
|
|
3929
6073
|
hslColor.l = lightScale(node.depth);
|
|
3930
6074
|
return hslColor;
|
|
@@ -3943,7 +6087,7 @@ var drawChart = (function (exports) {
|
|
|
3943
6087
|
};
|
|
3944
6088
|
};
|
|
3945
6089
|
|
|
3946
|
-
const StaticContext = B$
|
|
6090
|
+
const StaticContext = B$2({});
|
|
3947
6091
|
const drawChart = (parentNode, data, width, height) => {
|
|
3948
6092
|
const availableSizeProperties = getAvailableSizeOptions(data.options);
|
|
3949
6093
|
console.time("layout create");
|
|
@@ -3987,7 +6131,7 @@ var drawChart = (function (exports) {
|
|
|
3987
6131
|
console.time("color");
|
|
3988
6132
|
const getModuleColor = createRainbowColor(rawHierarchy);
|
|
3989
6133
|
console.timeEnd("color");
|
|
3990
|
-
P(
|
|
6134
|
+
P(o$1(StaticContext.Provider, Object.assign({ value: {
|
|
3991
6135
|
data,
|
|
3992
6136
|
availableSizeProperties,
|
|
3993
6137
|
width,
|
|
@@ -3997,24 +6141,23 @@ var drawChart = (function (exports) {
|
|
|
3997
6141
|
getModuleColor,
|
|
3998
6142
|
rawHierarchy,
|
|
3999
6143
|
layout,
|
|
4000
|
-
} }, { children:
|
|
6144
|
+
} }, { children: o$1(Main, {}) })), parentNode);
|
|
4001
6145
|
};
|
|
4002
6146
|
|
|
4003
6147
|
exports.StaticContext = StaticContext;
|
|
4004
|
-
exports
|
|
6148
|
+
exports.default = drawChart;
|
|
4005
6149
|
|
|
4006
6150
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4007
6151
|
|
|
4008
6152
|
return exports;
|
|
4009
6153
|
|
|
4010
6154
|
})({});
|
|
4011
|
-
//# sourceMappingURL=treemap.js.map
|
|
4012
6155
|
|
|
4013
6156
|
/*-->*/
|
|
4014
6157
|
</script>
|
|
4015
6158
|
<script>
|
|
4016
6159
|
/*<!--*/
|
|
4017
|
-
const data = {"version":2,"tree":{"name":"root","children":[{"name":"bubblechart.js","children":[{"name":"src","children":[{"uid":"
|
|
6160
|
+
const data = {"version":2,"tree":{"name":"root","children":[{"name":"bubblechart.js","children":[{"name":"src","children":[{"uid":"b6d2-1","name":"panzoom.js"},{"uid":"b6d2-3","name":"decorations.js"},{"uid":"b6d2-5","name":"component.js"},{"uid":"b6d2-7","name":"index.js"}]}]}],"isRoot":true},"nodeParts":{"b6d2-1":{"renderedLength":26745,"gzipLength":0,"brotliLength":0,"metaUid":"b6d2-0"},"b6d2-3":{"renderedLength":6591,"gzipLength":0,"brotliLength":0,"metaUid":"b6d2-2"},"b6d2-5":{"renderedLength":66804,"gzipLength":0,"brotliLength":0,"metaUid":"b6d2-4"},"b6d2-7":{"renderedLength":4677,"gzipLength":0,"brotliLength":0,"metaUid":"b6d2-6"}},"nodeMetas":{"b6d2-0":{"id":"/src/panzoom.js","moduleParts":{"bubblechart.js":"b6d2-1"},"imported":[{"uid":"b6d2-9"},{"uid":"b6d2-10"}],"importedBy":[{"uid":"b6d2-4"}]},"b6d2-2":{"id":"/src/decorations.js","moduleParts":{"bubblechart.js":"b6d2-3"},"imported":[{"uid":"b6d2-9"},{"uid":"b6d2-10"}],"importedBy":[{"uid":"b6d2-4"}]},"b6d2-4":{"id":"/src/component.js","moduleParts":{"bubblechart.js":"b6d2-5"},"imported":[{"uid":"b6d2-9"},{"uid":"b6d2-10"},{"uid":"b6d2-0"},{"uid":"b6d2-2"},{"uid":"b6d2-11"}],"importedBy":[{"uid":"b6d2-6"}]},"b6d2-6":{"id":"/src/index.js","moduleParts":{"bubblechart.js":"b6d2-7"},"imported":[{"uid":"b6d2-8"},{"uid":"b6d2-9"},{"uid":"b6d2-4"}],"importedBy":[],"isEntry":true},"b6d2-8":{"id":"/src/styles.scss","moduleParts":{},"imported":[],"importedBy":[{"uid":"b6d2-6"}]},"b6d2-9":{"id":"@vizabi/shared-components","moduleParts":{},"imported":[],"importedBy":[{"uid":"b6d2-6"},{"uid":"b6d2-4"},{"uid":"b6d2-0"},{"uid":"b6d2-2"}],"isExternal":true},"b6d2-10":{"id":"d3","moduleParts":{},"imported":[],"importedBy":[{"uid":"b6d2-4"},{"uid":"b6d2-0"},{"uid":"b6d2-2"}],"isExternal":true},"b6d2-11":{"id":"mobx","moduleParts":{},"imported":[],"importedBy":[{"uid":"b6d2-4"}],"isExternal":true}},"env":{"rollup":"2.79.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
|
|
4018
6161
|
|
|
4019
6162
|
const run = () => {
|
|
4020
6163
|
const width = window.innerWidth;
|