diff --git a/dist/sv.js b/dist/sv.js index e51ca26..86e6cf9 100644 --- a/dist/sv.js +++ b/dist/sv.js @@ -28,4 +28,4 @@ MERCHANTABLITY OR NON-INFRINGEMENT. See the Apache Version 2.0 License for specific language governing permissions and limitations under the License. ***************************************************************************** */ -var n;!function(n){!function(r){var i="object"==typeof e?e:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=a(n);function a(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===i.Reflect?i.Reflect=n:o=a(i.Reflect,o),function(e){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,c={create:a?function(){return N(Object.create(null))}:s?function(){return N({__proto__:null})}:function(){return N({})},has:u?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:u?function(t,e){return n.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),h="object"==typeof t&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i=0;--n){var r=(0,t[n])(e);if(!w(r)&&!_(r)){if(!k(r))throw new TypeError;e=r}}return e}(t,e)}if(!O(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(r)&&!w(r)&&!_(r))throw new TypeError;return _(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!w(o)&&!_(o)){if(!S(o))throw new TypeError;r=o}}return r}(t,e,n=M(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!S(n))throw new TypeError;if(!w(r)&&!function(t){switch(x(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;y(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!S(n))throw new TypeError;return w(r)||(r=M(r)),y(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),function t(e,n,r){if(v(e,n,r))return!0;var i=P(n);return!_(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),v(t,e,n)})),e("getMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),function t(e,n,r){if(v(e,n,r))return m(e,n,r);var i=P(n);return _(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),m(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=M(e)),function t(e,n){var r=b(e,n),i=P(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new d,s=[],u=0,c=r;u0)return!0;var i=p.get(e);return i.delete(n),i.size>0||p.delete(e),!0}))}(o)}()}(n||(n={}))}).call(this,n(178),n(188))},function(t,e,n){var r=n(242);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);no[0]&&(o[0]=s),u>o[1]&&(o[1]=u),c>o[2]&&(o[2]=c)}return e.setMinMax(n,o),e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";var r;!function(t){t.Normal="normal",t.PostProcessing="post-processing"}(r||(r={}))},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=1e-6},function(t,e){t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t}},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVMarker=e.SVIndexLabel=e.SVAddressLabel=e.SVFreedLabel=e.SVNodeAppendage=void 0;const r=n(33),i=n(148);class o extends i.SVModel{constructor(t,e,n,r,i,o){super(t,e,n,r,i),this.target=o,this.target.appendages.push(this)}}e.SVNodeAppendage=o;e.SVFreedLabel=class extends o{constructor(t,e,n,r,i){super(t,e,n,r,"freedLabel",i),this.target.freedLabel=this,this.G6ModelProps=this.generateG6ModelProps()}generateG6ModelProps(){return{id:this.id,x:0,y:0,type:"rect",label:"已释放",labelCfg:{style:{fill:"#b83b5e",opacity:.6}},size:[0,0],style:{opacity:0,stroke:null,fill:"transparent"}}}};e.SVAddressLabel=class extends o{constructor(t,e,n,r,i,o){super(t,e,n,r,"addressLabel",i),this.sourceId=i.sourceId,this.target.addressLabel=this,this.G6ModelProps=this.generateG6ModelProps(o)}generateG6ModelProps(t){return{id:this.id,x:0,y:0,type:"rect",label:this.sourceId,labelCfg:{style:Object.assign({fill:"#666",fontSize:16},t.style)},size:[0,0],style:{stroke:null,fill:"transparent"}}}};e.SVIndexLabel=class extends o{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"indexLabel",o),this.target.indexLabel=this,this.value=i,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){return{id:this.id,x:0,y:0,type:"rect",label:this.value,labelCfg:{style:Object.assign({fill:"#bbb",textAlign:"center",textBaseline:"middle",fontSize:14,fontStyle:"italic"},t.style)},size:[0,0],style:{stroke:null,fill:"transparent"}}}};e.SVMarker=class extends o{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"marker",o),this.label=i,this.target.marker=this,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){this.anchor=t.anchor;const e="pointer"===t.type?[8,30]:[12,12];return{id:this.id,x:0,y:0,rotation:0,type:t.type||"marker",size:t.size||e,anchorPoints:null,label:"string"==typeof this.label?this.label:this.label.join(", "),style:r.Util.objectClone(t.style),labelCfg:r.Util.objectClone(t.labelOptions)}}getLabelSizeRadius(){const{width:t,height:e}=this.shadowG6Item.getContainer().getChildren()[2].getBBox();return Math.max(t,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SolveZoomCanvasWithLeak=e.SolveDragCanvasWithLeak=e.SolveBrushSelectDrag=e.SolveNodeAppendagesDrag=e.DetermineNodeDrag=void 0;const r=n(119),i=n(118);e.DetermineNodeDrag=function(t,e,n){var r;const i=t.get(e.group),o=null===(r=i.options.behavior)||void 0===r?void 0:r.dragNode;if(function(t,e){const n=t.sourceType;return Array.isArray(e)?e.includes(n):void 0===e||!0===e}(e,o))return!0;const a=e.sourceType,s=e.getModelType(),u=i[s].filter(t=>t.sourceType===a),c=n.filter(t=>t.group===e.group&&t.getModelType()===s&&t.sourceType===a);return u.length===c.length},e.SolveNodeAppendagesDrag=function(t){const e=t.getG6Instance();e.on("node:dragstart",e=>{let n=e.item.SVModel;if(n instanceof i.SVNode==!1)return;void 0===t.brushSelectedModels.find(t=>t.id===n.id)&&(t.brushSelectedModels.forEach(t=>{t.setSelectedState(!1),t instanceof i.SVNode&&t.appendages.forEach(t=>t.setSelectedState(!1))}),t.brushSelectedModels.length=0)}),e.on("node:dragend",e=>{let n=e.item.SVModel;if(n instanceof i.SVNode==!1)return;void 0===t.brushSelectedModels.find(t=>t.id===n.id)&&(n.setSelectedState(!1),n.set({x:n.G6Item.getModel().x,y:n.G6Item.getModel().y}),n.appendages.forEach(t=>{t.setSelectedState(!1),t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y})})),t.brushSelectedModels.forEach(t=>{t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y}),t instanceof i.SVNode&&t.appendages.forEach(t=>{t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y})})})})},e.SolveBrushSelectDrag=function(t){t.getG6Instance().on("nodeselectchange",n=>{const r=n.selectedItems,i=[];n.target||(t.brushSelectedModels.length=0,r.nodes.forEach(t=>{i.push(t.SVModel)}),r.nodes.forEach(n=>{const r=n.SVModel;e.DetermineNodeDrag(t.getLayoutGroupTable(),r,i)?t.brushSelectedModels.push(r):r.setSelectedState(!1)}))})},e.SolveDragCanvasWithLeak=function(t){let e=t.getG6Instance(),n=0;e.on("viewportchange",e=>{if("translate"!==e.action)return!1;let i=e.matrix[7],o=i-n;n=i,t.leakAreaY=t.leakAreaY+o,t.hasLeak&&r.EventBus.emit("onLeakAreaUpdate",{leakAreaY:t.leakAreaY,hasLeak:t.hasLeak})})},e.SolveZoomCanvasWithLeak=function(t){}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return O})),n.d(r,"easeQuad",(function(){return C})),n.d(r,"easeQuadIn",(function(){return A})),n.d(r,"easeQuadOut",(function(){return k})),n.d(r,"easeQuadInOut",(function(){return C})),n.d(r,"easeCubic",(function(){return P})),n.d(r,"easeCubicIn",(function(){return T})),n.d(r,"easeCubicOut",(function(){return I})),n.d(r,"easeCubicInOut",(function(){return P})),n.d(r,"easePoly",(function(){return D})),n.d(r,"easePolyIn",(function(){return N})),n.d(r,"easePolyOut",(function(){return j})),n.d(r,"easePolyInOut",(function(){return D})),n.d(r,"easeSin",(function(){return F})),n.d(r,"easeSinIn",(function(){return B})),n.d(r,"easeSinOut",(function(){return G})),n.d(r,"easeSinInOut",(function(){return F})),n.d(r,"easeExp",(function(){return W})),n.d(r,"easeExpIn",(function(){return U})),n.d(r,"easeExpOut",(function(){return V})),n.d(r,"easeExpInOut",(function(){return W})),n.d(r,"easeCircle",(function(){return H})),n.d(r,"easeCircleIn",(function(){return Y})),n.d(r,"easeCircleOut",(function(){return X})),n.d(r,"easeCircleInOut",(function(){return H})),n.d(r,"easeBounce",(function(){return Z})),n.d(r,"easeBounceIn",(function(){return K})),n.d(r,"easeBounceOut",(function(){return Z})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return tt})),n.d(r,"easeBackIn",(function(){return Q})),n.d(r,"easeBackOut",(function(){return J})),n.d(r,"easeBackInOut",(function(){return tt})),n.d(r,"easeElastic",(function(){return rt})),n.d(r,"easeElasticIn",(function(){return nt})),n.d(r,"easeElasticOut",(function(){return rt})),n.d(r,"easeElasticInOut",(function(){return it}));var i,o,a=n(1),s=n(143),u=n(141),c=n(20),l=n(0),h=0,f=0,d=0,p=0,g=0,v=0,m="object"==typeof performance&&performance.now?performance:Date,y="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function b(){return g||(y(x),g=m.now()+v)}function x(){g=0}function w(){this._call=this._time=this._next=null}function _(t,e,n){var r=new w;return r.restart(t,e,n),r}function S(){g=(p=m.now())+v,h=f=0;try{!function(){b(),++h;for(var t,e=i;e;)(t=g-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=i,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:i=e);o=t,M(r)}(),g=0}}function E(){var t=m.now(),e=t-p;e>1e3&&(v-=e,p=t)}function M(t){h||(f&&(f=clearTimeout(f)),t-g>24?(t<1/0&&(f=setTimeout(S,t-m.now()-v)),d&&(d=clearInterval(d))):(d||(p=m.now(),d=setInterval(E,1e3)),h=1,y(S)))}function O(t){return+t}function A(t){return t*t}function k(t){return t*(2-t)}function C(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function T(t){return t*t*t}function I(t){return--t*t*t+1}function P(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}w.prototype=_.prototype={constructor:w,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||o===this||(o?o._next=this:i=this,o=this),this._call=t,this._time=n,M()},stop:function(){this._call&&(this._call=null,this._time=1/0,M())}};var N=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),j=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),D=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),L=Math.PI,R=L/2;function B(t){return 1==+t?1:1-Math.cos(t*R)}function G(t){return Math.sin(t*R)}function F(t){return(1-Math.cos(L*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function U(t){return z(1-+t)}function V(t){return 1-z(t)}function W(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function Y(t){return 1-Math.sqrt(1-t*t)}function X(t){return Math.sqrt(1- --t*t)}function H(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var q=7.5625;function K(t){return 1-Z(1-t)}function Z(t){return(t=+t)<4/11?q*t*t:t<8/11?q*(t-=6/11)*t+3/4:t<10/11?q*(t-=9/11)*t+15/16:q*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-Z(1-t):Z(t-1)+1)/2}var Q=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),J=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),et=2*Math.PI,nt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function at(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function st(){}var ut="\\s*([+-]?\\d+)\\s*",ct="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ht=/^#([0-9a-f]{3,8})$/,ft=new RegExp("^rgb\\("+[ut,ut,ut]+"\\)$"),dt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),pt=new RegExp("^rgba\\("+[ut,ut,ut,ct]+"\\)$"),gt=new RegExp("^rgba\\("+[lt,lt,lt,ct]+"\\)$"),vt=new RegExp("^hsl\\("+[ct,lt,lt]+"\\)$"),mt=new RegExp("^hsla\\("+[ct,lt,lt,ct]+"\\)$"),yt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function bt(){return this.rgb().formatHex()}function xt(){return this.rgb().formatRgb()}function wt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_t(e):3===n?new Ot(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?St(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?St(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ft.exec(t))?new Ot(e[1],e[2],e[3],1):(e=dt.exec(t))?new Ot(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=pt.exec(t))?St(e[1],e[2],e[3],e[4]):(e=gt.exec(t))?St(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vt.exec(t))?Tt(e[1],e[2]/100,e[3]/100,1):(e=mt.exec(t))?Tt(e[1],e[2]/100,e[3]/100,e[4]):yt.hasOwnProperty(t)?_t(yt[t]):"transparent"===t?new Ot(NaN,NaN,NaN,0):null}function _t(t){return new Ot(t>>16&255,t>>8&255,255&t,1)}function St(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ot(t,e,n,r)}function Et(t){return t instanceof st||(t=wt(t)),t?new Ot((t=t.rgb()).r,t.g,t.b,t.opacity):new Ot}function Mt(t,e,n,r){return 1===arguments.length?Et(t):new Ot(t,e,n,null==r?1:r)}function Ot(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function At(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)}function kt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ct(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Tt(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pt(t,e,n,r)}function It(t){if(t instanceof Pt)return new Pt(t.h,t.s,t.l,t.opacity);if(t instanceof st||(t=wt(t)),!t)return new Pt;if(t instanceof Pt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new Pt(a,s,u,t.opacity)}function Pt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function jt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}ot(st,wt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bt,formatHex:bt,formatHsl:function(){return It(this).formatHsl()},formatRgb:xt,toString:xt}),ot(Ot,Mt,at(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:At,formatHex:At,formatRgb:kt,toString:kt})),ot(Pt,(function(t,e,n,r){return 1===arguments.length?It(t):new Pt(t,e,n,null==r?1:r)}),at(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ot(Nt(t>=240?t-240:t+120,i,r),Nt(t,i,r),Nt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Dt=function(t){return function(){return t}};function Lt(t,e){return function(n){return t+n*e}}function Rt(t){return 1==(t=+t)?Bt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Dt(isNaN(e)?n:e)}}function Bt(t,e){var n=e-t;return n?Lt(t,n):Dt(isNaN(t)?e:t)}var Gt=function t(e){var n=Rt(e);function r(t,e){var r=n((t=Mt(t)).r,(e=Mt(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Bt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ft(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=ro&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Yt(n,r)})),o=qt.lastIndex;return od.length?(f=$t.parsePathString(o[h]),d=$t.parsePathString(i[h]),d=$t.fillPathByDiff(d,f),d=$t.formatPath(d,f),e.fromAttrs.path=d,e.toAttrs.path=f):e.pathFormatted||(f=$t.parsePathString(o[h]),d=$t.parsePathString(i[h]),d=$t.formatPath(d,f),e.fromAttrs.path=d,e.toAttrs.path=f,e.pathFormatted=!0),r[h]=[];for(var p=0;p0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],Jt(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ee=n(120),ne=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function re(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function ie(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(c.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var oe=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(c.a)(ne,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(c.a)(ne,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ee.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,l=a.clientY-t.clientY;u>120||c*c+l*l>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,re(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||ie(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{re(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ae=Object(s.a)(),se=ae&&"firefox"===ae.name,ue=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(a.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(c.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new oe({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new te(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");c.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");c.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(se&&!Object(c.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(c.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(u.a);e.a=ue},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=new Map;function i(t,e){r.set(t,e)}function o(t){return r.get(t)}var a=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},s=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}},u=n(21);function c(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function l(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=c(e,n.getCanvasBBox())),r&&(e=c(e,r.getCanvasBBox())),e}var h=n(70),f=n(39),d=n(0);function p(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(d.isNumberEqual)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i'})),n}var v=function(){function t(t){this.cfg={};var e=null,n=Object(h.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=f.exec(t),o=Object(h.mod)(Object(h.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},r={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=n},t}(),x=function(){function t(t,e){this.cfg={};var n=Object(u.b)("marker"),r=Object(h.uniqueId)("marker_");n.setAttribute("id",r);var i=Object(u.b)("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),n.appendChild(i),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=i,this.id=r;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,r=this.cfg.path,i=this.cfg.d;Object(h.isArray)(r)&&(r=r.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",r),n.appendChild(e),i&&n.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),w=function(){function t(t){this.type="clip",this.cfg={};var e=Object(u.b)("clipPath");this.el=e,this.id=Object(h.uniqueId)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),_=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,S=function(){function t(t){this.cfg={};var e=Object(u.b)("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Object(u.b)("image");e.appendChild(n);var r=Object(h.uniqueId)("pattern_");e.id=r,this.el=e,this.id=r,this.cfg=t;var i=_.exec(t)[2];n.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),E=function(){function t(t){var e=Object(u.b)("defs"),n=Object(h.uniqueId)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,r=null,i=0;i=u.minX&&e<=u.maxX&&n>=u.minY&&n<=u.maxY}var s=n(57),u=n(79),c=n(17),l=n(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return s},e.prototype.getGroupBase=function(){return u.a},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Object(c.d)();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!a(e,n,r))return null;for(var i=null,s=e.getChildren(),u=s.length-1;u>=0;u--){var c=s[u];if(c.isGroup())i=t(c,n,r);else if(a(c,n,r)){var l=c,h=o(c,n,r),f=h[0],d=h[1];l.isInShape(f,d)&&(i=c)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=Object(l.f)(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=Object(l.g)(t,n)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(c.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Object(l.a)(t,this),Object(l.d)(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),Object(l.a)(t,this),Object(l.b)(this,n,r),Object(l.d)(t,n,r),t.restore()):e.length&&Object(l.c)(e),Object(c.c)(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(c.n)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(i.AbstractCanvas);e.a=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return r.getAdjMatrixAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return r.connectedComponentAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return r.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return r.getInDegreeAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return r.getOutDegreeAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return r.detectCycleAsync}}),Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return r.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return r.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return r.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return r.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return r.floydWarshallAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return r.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return r.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return r.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return r.pageRankAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return r.getNeighborsAsync}}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return r.GADDIAsync}}),e.default=e.detectDirectedCycleAsync=void 0;var r=n(297),i=r.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:r.getAdjMatrixAsync,connectedComponentAsync:r.connectedComponentAsync,getDegreeAsync:r.getDegreeAsync,getInDegreeAsync:r.getInDegreeAsync,getOutDegreeAsync:r.getOutDegreeAsync,detectCycleAsync:r.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:r.detectAllCyclesAsync,detectAllDirectedCycleAsync:r.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:r.detectAllUndirectedCycleAsync,dijkstraAsync:r.dijkstraAsync,findAllPathAsync:r.findAllPathAsync,findShortestPathAsync:r.findShortestPathAsync,floydWarshallAsync:r.floydWarshallAsync,labelPropagationAsync:r.labelPropagationAsync,louvainAsync:r.louvainAsync,minimumSpanningTreeAsync:r.minimumSpanningTreeAsync,pageRankAsync:r.pageRankAsync,getNeighborsAsync:r.getNeighborsAsync,GADDIAsync:r.GADDIAsync};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(530);e.default=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},function(t,e,n){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:a,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";m(n,"string",s+" shader source must be a string",o);var c=p(n,o),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(a);!function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))}(c,l),Object.keys(c).forEach((function(t){var e=c[t];if(e.hasErrors){var n=[""],r=[""];i("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(u(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(n){var r=n.message,o=/^\s*'(.*)'\s*:\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}e=Math.max(t.line.indexOf(a,e),0)}else e=0;i(u("| ",6)),i(u("^^^",e+3)+"\n","font-weight:bold"),i(u("| ",6)),i(r+"\n","font-weight:bold")})),i(u("| ",6)+"\n")}else i(u(t.number,4)+"| "),i(t.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(t,e){n.push(t),r.push(e||"")}})),r.raise("Error compiling "+s+" shader, "+c[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=p(n,o),u='Error linking program with vertex shader, "'+p(i,o)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+a),r.raise(u)}},callSite:d,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?a(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):a(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:f,texture2D:function(t,e,n){var i,o=e.width,a=e.height,s=e.channels;r(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===t.wrapS&&33071===t.wrapT||r(x(o)&&x(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&r(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(r(x(o)&&x(a),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(i=0;i<16;++i)if(u[i]){var c=o>>i,l=a>>i;r(e.mipmask&1<0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),r(o===a,"cube map must be square"),r(33071===e.wrapS&&33071===e.wrapT,"wrap mode not supported by cube map");for(var u=0;u>h,p=a>>h;r(c.mipmask&1<1&&n===r&&('"'===n||"'"===n))return['"'+E(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+E(e)+'"'];for(var a=[],s=0;st(e,n+"["+r+"]"))):e instanceof S?e:void w(!1,"invalid option type in uniform "+n)},accessor:M},A={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},k="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function C(t){return"string"==typeof t?t.split():(w(Array.isArray(t),"invalid extension array"),t)}function T(t){return"string"==typeof t?(w("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function I(t){var n,r,i,o,a,s=t||{},u={},c=[],l=[],h="undefined"==typeof window?1:window.devicePixelRatio,f=!1,d=function(t){t&&w.raise(t)},p=function(){};if("string"==typeof s?(w("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),w(n,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=s:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(s)?i=(o=s).canvas:(w.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=T(s.canvas):"container"in s&&(r=T(s.container)),"attributes"in s&&(u=s.attributes,w.type(u,"object","invalid context attributes")),"extensions"in s&&(c=C(s.extensions)),"optionalExtensions"in s&&(l=C(s.optionalExtensions)),"onDone"in s&&(w.type(s.onDone,"function","invalid or missing onDone callback"),d=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(h=+s.pixelRatio,w(h>0,"invalid pixel ratio"))):w.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){w("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var g=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!g)return null;i=g.canvas,p=g.onDestroy}void 0===u.premultipliedAlpha&&(u.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,u)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:l,pixelRatio:h,profile:f,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function j(){var t=P(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[N(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var D=j();function L(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}D.zero=j();var R=function(t){return Object.keys(t).map((function(e){return t[e]}))},B={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function J(e){return Array.isArray(e)||t(e)}var tt=function(t){return!(t&t-1||!t)},et=[9984,9986,9985,9987],nt=[0,6409,6410,6407,6408],rt={};function it(t){return"[object "+t+"]"}rt[6409]=rt[6406]=rt[6402]=1,rt[34041]=rt[6410]=2,rt[6407]=rt[35904]=3,rt[6408]=rt[35906]=4;var ot=it("HTMLCanvasElement"),at=it("OffscreenCanvas"),st=it("CanvasRenderingContext2D"),ut=it("ImageBitmap"),ct=it("HTMLImageElement"),lt=it("HTMLVideoElement"),ht=Object.keys(F).concat([ot,at,st,ut,ct,lt]),ft=[];ft[5121]=1,ft[5126]=4,ft[36193]=2,ft[5123]=2,ft[5125]=4;var dt=[];function pt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function gt(t){return!!Array.isArray(t)&&!(0===t.length||!J(t[0]))}function vt(t){return Object.prototype.toString.call(t)}function mt(t){return vt(t)===ot}function yt(t){return vt(t)===at}function bt(t){if(!t)return!1;var e=vt(t);return ht.indexOf(e)>=0||pt(t)||gt(t)||L(t)}function xt(t){return 0|F[Object.prototype.toString.call(t)]}function wt(t,e){return D.allocType(36193===t.type?5126:t.type,e)}function _t(t,e){36193===t.type?(t.data=Q(e),D.freeType(e)):t.data=e}function St(t,e,n,r,i,o){var a;if(a=void 0!==dt[t]?dt[t]:rt[t]*ft[e],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function Et(n,r,i,o,a,s,u){var c={"don't care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},f=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),d={none:0,browser:37444},p={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},g={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},v={};r.ext_srgb&&(g.srgb=35904,g.srgba=35906),r.oes_texture_float&&(p.float32=p.float=5126),r.oes_texture_half_float&&(p.float16=p["half float"]=36193),r.webgl_depth_texture&&(e(g,{depth:6402,"depth stencil":34041}),e(p,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(v,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(v,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(v,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(v["rgb etc1"]=36196);var m=Array.prototype.slice.call(n.getParameter(34467));Object.keys(v).forEach((function(t){var e=v[t];m.indexOf(e)>=0&&(g[t]=e)}));var y=Object.keys(g);i.textureFormats=y;var b=[];Object.keys(g).forEach((function(t){var e=g[t];b[e]=t}));var x=[];Object.keys(p).forEach((function(t){var e=p[t];x[e]=t}));var _=[];Object.keys(h).forEach((function(t){_[h[t]]=t}));var S=[];Object.keys(f).forEach((function(t){var e=f[t];S[e]=t}));var E=[];Object.keys(l).forEach((function(t){E[l[t]]=t}));var M=y.reduce((function(t,e){var n=g[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||e.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t}),{});function O(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function A(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function k(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(w.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(w.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(w.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(w.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var n=e.type;w(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),w(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),w(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,s=t.channels,u=!1;"shape"in e?(w(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(s=e.shape[2],w(s>0&&s<=4,"invalid number of channels"),u=!0),w(o>=0&&o<=i.maxTextureSize,"invalid width"),w(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,w(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,w(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,w(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(s=e.channels,w(s>0&&s<=4,"invalid number of channels"),u=!0)),t.width=0|o,t.height=0|a,t.channels=0|s;var c=!1;if("format"in e){var l=e.format;w(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(l,g,"invalid texture format");var h=t.internalformat=g[l];t.format=M[h],l in p&&("type"in e||(t.type=p[l])),l in v&&(t.compressed=!0),c=!0}!u&&c?t.channels=rt[t.format]:u&&!c?t.channels!==nt[t.format]&&(t.format=t.internalformat=nt[t.channels]):c&&u&&w(t.channels===rt[t.format],"number of channels inconsistent with specified format")}}function C(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function T(){O.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function I(e,n){var r=null;if(bt(n)?r=n:n&&(w.type(n,"object","invalid pixel data type"),k(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),bt(n.data)&&(r=n.data)),w(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){w(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,s=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||s-e.yOffset,e.needsCopy=!0,w(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=s,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||5121!==e.type||(e.type=xt(r));else if(pt(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var r=D.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=Q(e);break;default:w.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(L(r)){var u=r.data;Array.isArray(u)||5121!==e.type||(e.type=xt(u));var c,l,h,f,d,p,g=r.shape,v=r.stride;3===g.length?(h=g[2],p=v[2]):(w(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),c=g[0],l=g[1],f=v[0],d=v[1],e.alignment=1,e.width=c,e.height=l,e.channels=h,e.format=e.internalformat=nt[h],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=wt(t,a*s*u),l=0,h=0;h=0,"oes_texture_float extension not enabled"):36193===e.type&&w(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function P(t,e,r){var i=t.element,a=t.data,s=t.internalformat,u=t.format,c=t.type,l=t.width,h=t.height;C(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,l,h,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,l,h,0)):n.texImage2D(e,r,u,l,h,0,u,c,a||null)}function N(t,e,r,i,a){var s=t.element,u=t.data,c=t.internalformat,l=t.format,h=t.type,f=t.width,d=t.height;C(t),s?n.texSubImage2D(e,a,r,i,l,h,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,f,d,u):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,f,d)):n.texSubImage2D(e,a,r,i,f,d,l,h,u)}var j=[];function G(){return j.pop()||new T}function F(t){t.needsFree&&D.freeType(t.data),T.call(t),j.push(t)}function z(){O.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function U(t,e,n){var r=t.images[0]=G();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function V(t,e){var n=null;if(bt(e))A(n=t.images[0]=G(),t),I(n,e),t.mipmask=1;else if(k(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i>=i,n.height>>=i,I(n,r[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;w.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(w.parameter(s,l),o=a=l[s]):Array.isArray(s)&&(w.parameter(s[0],l),w.parameter(s[1],l),o=l[s[0]],a=l[s[1]])}else{if("wrapS"in e){var u=e.wrapS;w.parameter(u,l),o=l[u]}if("wrapT"in e){var d=e.wrapT;w.parameter(d,l),a=l[d]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;w("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var g=!1;switch(typeof e.mipmap){case"string":w.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,g=!0;break;case"boolean":g=t.genMipmaps=e.mipmap;break;case"object":w(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,g=!0;break;default:w.raise("invalid mipmap type")}g&&!("min"in e)&&(t.minFilter=9984)}}function Z(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,it={},ot=i.maxTextureUnits,at=Array(ot).map((function(){return null}));function ht(t){O.call(this),this.mipmask=0,this.internalformat=6408,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new q,u.profile&&(this.stats={size:0})}function ft(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function dt(){var t=at[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function Et(t){var e=t.texture;w(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),at[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete it[t.id],s.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;r.unit=-1}at[e]=this,t=e;break}t>=ot&&w.raise("insufficient number of texture units"),u.profile&&s.maxTextureUnits>u)-a,c.height=c.height||(r.height>>u)-s,w(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),w(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),w(r.mipmask&1<>s;++s){var c=i>>s,l=a>>s;if(!c||!l)break;n.texImage2D(3553,s,r.format,c,l,0,r.format,r.type,null)}return dt(),u.profile&&(r.stats.size=St(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,u.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var l=new ht(34067);it[l.id]=l,s.cubeCount++;var h=new Array(6);function f(t,e,n,r,o,a){var s,c=l.texInfo;for(q.call(c),s=0;s<6;++s)h[s]=X();if("number"!=typeof t&&t)if("object"==typeof t)if(e)V(h[0],t),V(h[1],e),V(h[2],n),V(h[3],r),V(h[4],o),V(h[5],a);else if(K(c,t),k(l,t),"faces"in t){var d=t.faces;for(w(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),s=0;s<6;++s)w("object"==typeof d[s]&&!!d[s],"invalid input for cube map face"),A(h[s],l),V(h[s],d[s])}else for(s=0;s<6;++s)V(h[s],t);else w.raise("invalid arguments to cube map");else{var p=0|t||1;for(s=0;s<6;++s)U(h[s],p,p)}for(A(l,h[0]),i.npotTextureCube||w(tt(l.width)&&tt(l.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?l.mipmask=(h[0].width<<1)-1:l.mipmask=h[0].mipmask,w.textureCube(l,c,h,i),l.internalformat=h[0].internalformat,f.width=h[0].width,f.height=h[0].height,ft(l),s=0;s<6;++s)W(h[s],34069+s);for(Z(c,34067),dt(),u.profile&&(l.stats.size=St(l.internalformat,l.type,f.width,f.height,c.genMipmaps,!0)),f.format=b[l.internalformat],f.type=x[l.type],f.mag=_[c.magFilter],f.min=S[c.minFilter],f.wrapS=E[c.wrapS],f.wrapT=E[c.wrapT],s=0;s<6;++s)H(h[s]);return f}return f(t,e,r,o,a,c),f.subimage=function(t,e,n,r,i){w(!!e,"must specify image data"),w("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=G();return A(u,l),u.width=0,u.height=0,I(u,e),u.width=u.width||(l.width>>s)-o,u.height=u.height||(l.height>>s)-a,w(l.type===u.type&&l.format===u.format&&l.internalformat===u.internalformat,"incompatible format for texture.subimage"),w(o>=0&&a>=0&&o+u.width<=l.width&&a+u.height<=l.height,"texture.subimage write out of bounds"),w(l.mipmask&1<>i;++i)n.texImage2D(34069+r,i,l.format,e>>i,e>>i,0,l.format,l.type,null);return dt(),u.profile&&(l.stats.size=St(l.internalformat,l.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=l,u.profile&&(f.stats=l.stats),f.destroy=function(){l.decRef()},f},clear:function(){for(var t=0;t>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t=0&&l=0&&h0&&f+l<=i.framebufferWidth,"invalid width for read pixels"),w(d>0&&d+h<=i.framebufferHeight,"invalid height for read pixels"),r();var g=f*d*4;return p||(5121===c?p=new Uint8Array(g):5126===c&&(p=p||new Float32Array(g))),w.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),w(p.byteLength>=g,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(l,h,f,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=u(t)})),e}(t):u(t)}}function jt(t){return Array.prototype.slice.call(t)}function Dt(t){return jt(t).join("")}It[36053]="complete",It[36054]="incomplete attachment",It[36057]="incomplete dimensions",It[36055]="incomplete, missing attachment",It[36061]="unsupported";var Lt="xyzw".split(""),Rt="profile",Bt="framebuffer",Gt="vert",Ft="frag",zt="elements",Ut="primitive",Vt="count",Wt="offset",Yt="instances",Xt="vao",Ht=Bt+"Width",qt=Bt+"Height",Kt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Zt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},$t=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Qt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Jt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},te={frag:35632,vert:35633},ee={cw:2304,ccw:2305};function ne(e){return Array.isArray(e)||t(e)||L(e)}function re(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t=1,r>=2,e)}if(4===n){var i=t.data;return new ie(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new ie(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u=1&&(a=!0),l>=2&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new ie(o,a,s,e)}return new ie(3===n,2===n,1===n,e)}var ue=new ie(!1,!1,!1,(function(){}));function ce(t,n,r,i,o,a,s,u,c,l,h,f,d,p,g){var v=l.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=32775,m.max=32776);var y=r.angle_instanced_arrays,b=r.webgl_draw_buffers,x={dirty:!0,profile:g.profile},_={},S=[],E={},M={};function A(t){return t.replace(".","_")}function k(t,e,n){var r=A(t);S.push(t),_[r]=x[r]=!!n,E[r]=e}function C(t,e,n){var r=A(t);S.push(t),Array.isArray(n)?(x[r]=n.slice(),_[r]=n.slice()):x[r]=_[r]=n,M[r]=e}k("dither",3024),k("blend.enable",3042),C("blend.color","blendColor",[0,0,0,0]),C("blend.equation","blendEquationSeparate",[32774,32774]),C("blend.func","blendFuncSeparate",[1,0,1,0]),k("depth.enable",2929,!0),C("depth.func","depthFunc",513),C("depth.range","depthRange",[0,1]),C("depth.mask","depthMask",!0),C("colorMask","colorMask",[!0,!0,!0,!0]),k("cull.enable",2884),C("cull.face","cullFace",1029),C("frontFace","frontFace",2305),C("lineWidth","lineWidth",1),k("polygonOffset.enable",32823),C("polygonOffset.offset","polygonOffset",[0,0]),k("sample.alpha",32926),k("sample.enable",32928),C("sample.coverage","sampleCoverage",[1,!1]),k("stencil.enable",2960),C("stencil.mask","stencilMask",-1),C("stencil.func","stencilFunc",[519,0,-1]),C("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),C("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),k("scissor.enable",3089),C("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),C("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var T={gl:t,context:d,strings:n,next:_,current:x,draw:f,elements:a,buffer:o,shader:h,attributes:l.state,vao:l,uniforms:c,framebuffer:u,extensions:r,timer:p,isBufferArgs:ne},I={primTypes:K,compareFuncs:Qt,blendFuncs:Zt,blendEquations:m,stencilOps:Jt,glTypes:z,orientationType:ee};w.optional((function(){T.isArrayLike=J})),b&&(I.backBuffer=[1029],I.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var N=0;function j(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,jt(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,jt(arguments)),n.push(";")),e},toString:function(){return Dt([r.length>0?"var "+r.join(",")+";":"",Dt(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,jt(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i=0,'unknown parameter "'+e+'"',f.commandStr)}))}e(d),e(p)}));var g=function(t,e){var n=t.static;if("string"==typeof n[Ft]&&"string"==typeof n[Gt]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,w.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new ie(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",Ht,"-",c));var i=s;return"height"in o||(i=e.def(n,".",qt,"-",l)),[c,l,r,i]}))}if(t in i){var h=i[t],f=se(h,(function(e,n){var r=e.invoke(n,h);w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",Ht,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",qt,"-",a,")");return w.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new ie(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Ht),e.def(n,".",qt)]})):null}var a=o("viewport");if(a){var s=a;a=new ie(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(t,b,f),_=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(zt in n){var t=n[zt];ne(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),w.command(t,"invalid elements",e.commandStr));var i=ae((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(zt in r){var o=r[zt];return se(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(r,"(",a,")"),c=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return w.optional((function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")})),e.entry(c),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return w.command(!o||a>=0,"invalid "+t,e.commandStr),ae((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var s=r[t];return se(s,(function(e,n){var r=e.invoke(n,s);return o&&(e.OFFSET=r,w.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?ae((function(t,e){return t.OFFSET="0",0})):null}var s=o(Wt,!0);return{elements:i,primitive:function(){if(Ut in n){var t=n[Ut];return w.commandParameter(t,K,"invalid primitve",e.commandStr),ae((function(e,n){return K[t]}))}if(Ut in r){var o=r[Ut];return se(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return w.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(K))})),e.def(n,"[",r,"]")}))}return i?oe(i)?i.value?ae((function(t,e){return e.def(t.ELEMENTS,".primType")})):ae((function(){return 4})):new ie(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Vt in n){var t=0|n[Vt];return w.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ae((function(){return t}))}if(Vt in r){var o=r[Vt];return se(o,(function(t,e){var n=t.invoke(e,o);return w.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(oe(i)){if(i)return s?new ie(s.thisDep,s.contextDep,s.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return w.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):ae((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=ae((function(){return-1}));return w.optional((function(){a.MISSING=!0})),a}var u=new ie(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return w.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(Yt,!1),offset:s}}(t,f),E=function(t,e){var n=t.static,r=t.dynamic,o={};return S.forEach((function(t){var a=A(t);function s(e,i){if(t in n){var s=e(n[t]);o[a]=ae((function(){return s}))}else if(t in r){var u=r[t];o[a]=se(u,(function(t,e){return i(t,e,t.invoke(e,u))}))}}switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return s((function(n){return w.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return w.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return s((function(n){return w.commandParameter(n,Qt,"invalid "+t,e.commandStr),Qt[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return w.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qt))})),n.def(i,"[",r,"]")}));case"depth.range":return s((function(t){return w.command(J(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case"blend.func":return s((function(t){w.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return w.commandParameter(n,Zt,a+".srcRGB",e.commandStr),w.commandParameter(r,Zt,a+".srcAlpha",e.commandStr),w.commandParameter(i,Zt,a+".dstRGB",e.commandStr),w.commandParameter(o,Zt,a+".dstAlpha",e.commandStr),w.command(-1===$t.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Zt[n],Zt[i],Zt[r],Zt[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return w.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Zt))})),s}w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");w.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return s((function(n){return"string"==typeof n?(w.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(w.commandParameter(n.rgb,m,t+".rgb",e.commandStr),w.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void w.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,'==="string"');return w.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(m))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case"blend.color":return s((function(t){return w.command(J(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return s((function(t){return w.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return s((function(n){w.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return w.commandParameter(r,Qt,t+".cmp",e.commandStr),w.commandType(i,"number",t+".ref",e.commandStr),w.commandType(o,"number",t+".mask",e.commandStr),[Qt[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return w.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return s((function(n){w.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return w.commandParameter(r,Jt,t+".fail",e.commandStr),w.commandParameter(i,Jt,t+".zfail",e.commandStr),w.commandParameter(o,Jt,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,Jt[r],Jt[i],Jt[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return w.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Jt))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",7680)}return w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),["stencil.opBack"===t?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return s((function(t){w.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return w.commandType(n,"number",a+".factor",e.commandStr),w.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return s((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),w.command(!!n,a,e.commandStr),n}),(function(t,e,n){return w.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return s((function(t){return w.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return s((function(t){return w.commandParameter(t,ee,a,e.commandStr),ee[t]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:2305')}));case"colorMask":return s((function(t){return w.command(J(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return s((function(t){w.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return w.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,f),M=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);w.optional((function(){h.shader(te[t],e,w.guessCommand())}));var r=ae((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return se(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return w.optional((function(){n(e.shared.shader,".shader(",te[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(Ft),c=a(Gt),l=null;return oe(u)&&oe(c)?(l=h.program(c.id,u.id,null,r),s=ae((function(t,e){return t.link(l)}))):s=new ie(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.append(t,e):e.def(r,".",Ft);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Gt))+","+n;return w.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:c,progVar:s,program:l}}(t,0,g);function O(t){var e=x[t];e&&(E[t]=e)}O("viewport"),O(A("scissor.box"));var k=Object.keys(E).length>0,C={framebuffer:b,draw:_,shader:M,state:E,dirty:k,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=function(t){var e,n=t.static,r=t.dynamic;if(Rt in n){var i=!!n[Rt];(e=ae((function(t,e){return i}))).enable=i}else if(Rt in r){var o=r[Rt];e=se(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),C.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=ae((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=ae((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(w.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=ae((function(t){return t.link(o.color[0])}))):w.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else J(o)?r=ae((function(e){return e.global.def("[",P(o.length,(function(n){return w.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):w.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),i}(s,f),C.drawVAO=C.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Xt in n){var i=n[Xt];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),ae((function(t){return t.link(l.getVAO(i))}))}if(Xt in r){var o=r[Xt];return se(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!C.drawVAO&&M.program&&!g&&r.angle_instanced_arrays){var T=!0,I=M.program.attributes.map((function(t){var n=e.static[t];return T=T&&!!n,n}));if(T&&I.length>0){var N=l.getVAO(l.createVAO(I));C.drawVAO=new ie(null,null,null,(function(t,e){return t.link(N)})),C.useVAO=!0}}return g?C.useVAO=!0:C.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],s=n.id(t),u=new v;if(ne(i))u.state=1,u.buffer=o.getBuffer(o.create(i,34962,!1,!0)),u.type=0;else{var c=o.getBuffer(i);if(c)u.state=1,u.buffer=c,u.type=0;else if(w.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var l=i.constant;u.buffer="null",u.state=2,"number"==typeof l?u.x=l:(w.command(J(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+t,e.commandStr),Lt.forEach((function(t,e){e=0,'invalid offset for attribute "'+t+'"',e.commandStr);var f=0|i.stride;w.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;w.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,g=0;"type"in i&&(w.commandParameter(i.type,z,"invalid type for attribute "+t,e.commandStr),g=z[i.type]);var m=0|i.divisor;"divisor"in i&&(w.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),w.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),w.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){w.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),u.buffer=c,u.state=1,u.size=d,u.normalized=p,u.type=g||c.dtype,u.offset=h,u.stride=f,u.divisor=m}}a[t]=ae((function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(u).forEach((function(t){r[t]=u[t]})),u.buffer&&(r.buffer=t.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=se(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;w.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},l=new v;l.state=1,Object.keys(l).forEach((function(t){c[t]=r.def(""+l[t])}));var h=c.buffer,f=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",h,"=",u,".createStream(",34962,",",i,");",f,"=",h,".dtype;","}else{",h,"=",u,".getBuffer(",i,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[Lt[0]],"=",i,".constant;",Lt.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Lt.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",h,"=",u,".createStream(",34962,",",i,".buffer);","}else{",h,"=",u,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",h,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",h,");","}"),c}))})),a}(e,f),C.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=ae((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),C}function L(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function R(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,l=c.drawBuffer,h=c.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",l,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",u,";"),r||e("}")}function B(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,c=t.cond(s,".dirty");S.forEach((function(e){var r,l,h=A(e);if(!(h in n.state))if(h in a){r=a[h],l=o[h];var f=P(x[h].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(f.map((function(t,e){return t+"!=="+l+"["+e+"]"})).join("||")).then(i,".",M[h],"(",f,");",f.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(u,".",h);var d=t.cond(r,"!==",s,".",h);c(d),h in E?d(t.cond(r).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",r,";"):d(i,".",M[h],"(",r,");",s,".",h,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function G(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;re(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(E[i]){var l=E[i];oe(u)?e(s,c?".enable(":".disable(",l,");"):e(t.cond(c).then(s,".enable(",l,");").else(s,".disable(",l,");")),e(a,".",i,"=",c,";")}else if(J(c)){var h=o[i];e(s,".",M[i],"(",c,");",c.map((function(t,e){return h+"["+e+"]="+t})).join(";"),";")}else e(s,".",M[i],"(",c,");",a,".",i,"=",c,";")}}))}function F(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function U(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,l=u.current,h=u.timer,f=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function g(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function v(t){t(c,".cpuTime+=",d(),"-",o,";"),p&&(r?t(h,".pushScopeStats(",a,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function m(t){var n=e.def(l,".profile");e(l,".profile=",t,";"),e.exit(l,".profile=",n,";")}if(f){if(oe(f))return void(f.enable?(g(e),v(e.exit),m("true")):m("false"));m(s=f.append(t,e))}else s=e.def(l,".profile");var y=t.block();g(y),e("if(",s,"){",y,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function V(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ue))return;var c=t.scopeAttrib(s);w.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new v).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),c=i.state,l=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function d(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",f.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",34962,",",l,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",f.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),y){var c=i.divisor;e("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",Lt.map((function(t,e){return u+"."+t+"!=="+h[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",h,");",Lt.map((function(t,e){return u+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function W(t,e,r,i,o){for(var a,s=t.shared,u=s.gl,c=0;c1?e(P(x,(function(t){return Array.isArray(l)?l[t]:l+"["+t+"]"}))):(w(!Array.isArray(l),"uniform value must not be an array"),e(l));e(");")}}function Y(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw,u=function(){var i,u=s.elements,c=e;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(t,c)):i=c.def(a,".",zt),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var l,h,f=c(Ut),d=c(Wt),p=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),w.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",Vt),w.optional((function(){t.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");y&&(l=c(Yt),h=t.instancing);var g=u+".type",v=s.elements&&oe(s.elements);function m(){function t(){n(h,".drawElementsInstancedANGLE(",[f,p,g,d+"<<(("+g+"-5121)>>1)",l],");")}function e(){n(h,".drawArraysInstancedANGLE(",[f,d,p,l],");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[f,p,g,d+"<<(("+g+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[f,d,p]+");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}y&&("number"!=typeof l||l>=0)?"string"==typeof l?(n("if(",l,">0){"),m(),n("}else if(",l,"<0){"),b(),n("}")):m():b()}function X(t,e,n,r,i){var o=j(),a=o.proc("body",i);return w.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),y&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function H(t,e,n,r){F(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),V(t,e,n,r.attributes,(function(){return!0}))),W(t,e,n,r.uniforms,(function(){return!0})),Y(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",F(t,e),V(t,e,n,r.attributes,i),W(t,e,n,r.uniforms,i),Y(t,e,e,n)}function Z(t,e,n,r){F(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function c(t){return t.contextDep&&i||t.propDep}function l(t){return!c(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&L(t,u,n.context),n.needsFramebuffer&&R(t,u,n.framebuffer),G(t,u,n.state,c),n.profile&&c(n.profile)&&U(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),V(t,s,n,r.attributes,l),V(t,u,n,r.attributes,c)),W(t,s,n,r.uniforms,l),W(t,u,n,r.uniforms,c),Y(t,s,u,n);else{var h=t.global.def("{}"),f=n.shader.progVar.append(t,u),d=u.def(f,".id"),p=u.def(h,"[",d,"]");u(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",f,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!J(t)){for(var e=Object.keys(t),n=0;n0&&n(t.shared.current,".dirty=true;")}(s,u),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}L(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),re(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);J(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),U(t,r,e,!0,!0),[zt,Wt,Vt,Yt,Ut].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new v).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Gt),a(Ft),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",F(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(L(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||R(t,n,o)):R(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),B(t,n,e),G(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||U(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)Z(t,n,e,null);else{var c=u.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Z(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var l=t.global.def("{}"),h=n.def(c,".id"),f=n.def(l,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",l,"[",h,"]=",t.link((function(n){return X(Z,t,e,n,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var le=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(t){a.push(t)}var u=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var l=[],h=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){h.length=Math.max(h.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,h[0]=0;var a=0;for(t=0,n=0;n0)if(Array.isArray(n[0])){s=W(n);for(var l=1,h=1;h0)if("number"==typeof e[0]){var o=D.allocType(f.dtype,e.length);H(o,e),p(o,i),D.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=W(e);var a=V(e,r,f.dtype);p(a,i),D.freeType(a)}else w.raise("invalid buffer data")}else if(L(e)){r=e.shape;var s=e.stride,u=0,c=0,l=0,h=0;1===r.length?(u=r[0],c=1,l=s[0],h=0):2===r.length?(u=r[0],c=r[1],l=s[0],h=s[1]):w.raise("invalid shape");var g=Array.isArray(e.data)?f.dtype:X(e.data),v=D.allocType(g,u*c);q(v,e.data,u,c,l,h,e.offset),p(v,i),D.freeType(v)}else w.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=f.stats),d.destroy=function(){h(f)},d},createStream:function(t,e){var n=u.pop();return n||(n=new s(t)),n.bind(),l(n,e,35040,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){R(a).forEach(h),u.forEach(h)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){R(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:l}}(i,h,r,(function(t){return x.destroyBuffer(t)})),x=function(e,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=r.attributes;u.length=e.length;for(var c=0;c=d.byteLength?l.subdata(d):(l.destroy(),r.buffers[c]=null)),r.buffers[c]||(l=r.buffers[c]=o.create(h,34962,!1,!0)),f.buffer=o.getBuffer(l),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,i[c]=1):o.getBuffer(h)?(f.buffer=o.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):o.getBuffer(h.buffer)?(f.buffer=o.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,"type"in h?(w.parameter(h.type,z,"invalid buffer type"),f.type=z[h.type]):f.type=f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1,w(f.size>=1&&f.size<=4,"size must be between 1 and 4"),w(f.offset>=0,"invalid offset"),w(f.stride>=0&&f.stride<=255,"stride must be between 0 and 255"),w(f.divisor>=0,"divisor must be positive"),w(!f.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in h?(w(c>0,"first attribute must not be a constant"),f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2):w(!1,"invalid attribute spec for location "+c)}for(var p=0;p>=1:5125===h&&(d>>=2)),i.vertCount=d;var p=s;if(s<0){p=4;var g=i.buffer.dimension;1===g&&(p=0),2===g&&(p=1),3===g&&(p=4)}i.primType=p}function h(t){i.elementsCount--,w(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,34963,!0),a=new u(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var n=null,r=35044,i=-1,u=-1,h=0,f=0;Array.isArray(e)||t(e)||L(e)?n=e:(w.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,w(Array.isArray(n)||t(n)||L(n),"invalid data for element buffer")),"usage"in e&&(w.parameter(e.usage,U,"invalid element buffer usage"),r=U[e.usage]),"primitive"in e&&(w.parameter(e.primitive,K,"invalid element buffer primitive"),i=K[e.primitive]),"count"in e&&(w("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(w.parameter(e.type,s,"invalid buffer type"),f=s[e.type]),"length"in e?h=0|e.length:(h=u,5123===f||5122===f?h*=2:5125!==f&&5124!==f||(h*=4))),l(a,n,r,i,u,h,f)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){h(a)},c},createStream:function(t){var e=c.pop();return e||(e=new u(r.create(null,34963,!0,!1)._buffer)),l(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){R(o).forEach(h)}}}(i,f,b,h),S=function(t,n,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(t,e){for(var n=0;n1)for(var m=0;mt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);R(o).forEach(e),o={},R(a).forEach(e),a={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,l={},r.shaderCount=0},program:function(n,i,s,u){w.command(n>=0,"missing vertex shader",s),w.command(i>=0,"missing fragment shader",s);var c=l[i];c||(c=l[i]={});var f=c[n];if(f&&(f.refCount++,!u))return f;var g=new d(i,n);return r.shaderCount++,p(g,s,u),f||(c[n]=g),h.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=h.indexOf(g);h.splice(e,1),r.shaderCount--}c[g.vertId].refCount<=0&&(t.deleteShader(a[g.vertId]),delete a[g.vertId],delete l[g.fragId][g.vertId]),Object.keys(l[g.fragId]).length||(t.deleteShader(o[g.fragId]),delete o[g.fragId],delete l[g.fragId])}})},restore:function(){o={},a={};for(var t=0;t=2,"invalid renderbuffer shape"),s=0|d[0],u=0|d[1]}else"radius"in f&&(s=u=0|f.radius),"width"in f&&(s=0|f.width),"height"in f&&(u=0|f.height);"format"in f&&(w.parameter(f.format,o,"invalid renderbuffer format"),c=o[f.format])}else"number"==typeof e?(s=0|e,u="number"==typeof r?0|r:s):e?w.raise("invalid arguments to renderbuffer constructor"):s=u=1;if(w(s>0&&u>0&&s<=n.maxRenderbufferSize&&u<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==l.width||u!==l.height||c!==l.format)return h.width=l.width=s,h.height=l.height=u,l.format=c,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,c,s,u),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Ot(l.format,l.width,l.height)),h.format=a[l.format],h}return u[l.id]=l,r.renderbufferCount++,h(e,s),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===l.width&&a===l.height||(w(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=l.width=o,h.height=l.height=a,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,o,a),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Ot(l.format,l.width,l.height))),h},h._reglType="renderbuffer",h._renderbuffer=l,i.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){R(u).forEach(l)},restore:function(){R(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}}(i,f,y,h,r),C=function(t,n,r,i,o,a){var s={cur:null,next:null,dirty:!1,setFBO:null},u=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var l=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function f(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);w(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;w(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function g(t){var e=3553,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),w.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,w(3553===e)):"textureCube"===o?(n=i,w(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):w.raise("invalid regl object for attachment"),new h(e,n,r)}function v(t,e,n,r,a){if(n){var s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new h(3553,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new h(36161,null,u)}function m(t){return t&&(t.texture||t.renderbuffer)}function y(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var b=0,x={};function _(){this.id=b++,x[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(t){t.colorAttachments.forEach(f),f(t.depthAttachment),f(t.stencilAttachment),f(t.depthStencilAttachment)}function E(e){var n=e.framebuffer;w(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete x[e.id]}function M(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n=2,"invalid shape for framebuffer"),a=P[0],f=P[1]}else"radius"in I&&(a=f=I.radius),"width"in I&&(a=I.width),"height"in I&&(f=I.height);("color"in I||"colors"in I)&&(b=I.color||I.colors,Array.isArray(b)&&w(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in I&&(O=0|I.colorCount,w(O>0,"invalid color buffer count")),"colorTexture"in I&&(x=!!I.colorTexture,_="rgba4"),"colorType"in I&&(E=I.colorType,x?(w(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),w(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(w(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),_="rgba16f"):"float"!==E&&"float32"!==E||(w(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),_="rgba32f"),w.oneOf(E,l,"invalid color type")),"colorFormat"in I&&(_=I.colorFormat,u.indexOf(_)>=0?x=!0:c.indexOf(_)>=0?x=!1:x?w.oneOf(I.colorFormat,u,"invalid color format for texture"):w.oneOf(I.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(T=!(!I.depthTexture&&!I.depthStencilTexture),w(!T||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(A=I.depth,y=!1)),"stencil"in I&&("boolean"==typeof I.stencil?y=I.stencil:(k=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=y=I.depthStencil:(C=I.depthStencil,p=!1,y=!1))}else a=f=1;var N=null,j=null,D=null,L=null;if(Array.isArray(b))N=b.map(g);else if(b)N=[g(b)];else for(N=new Array(O),i=0;i=0||N[i].renderbuffer&&Tt.indexOf(N[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),N[i]&&N[i].texture){var B=kt[N[i].texture._texture.format]*Ct[N[i].texture._texture.type];null===R?R=B:w(R===B,"all color attachments much have the same number of bits per pixel.")}return d(j,a,f),w(!j||j.texture&&6402===j.texture._texture.format||j.renderbuffer&&33189===j.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(D,a,f),w(!D||D.renderbuffer&&36168===D.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(L,a,f),w(!L||L.texture&&34041===L.texture._texture.format||L.renderbuffer&&34041===L.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=a,o.height=f,o.colorAttachments=N,o.depthAttachment=j,o.stencilAttachment=D,o.depthStencilAttachment=L,h.color=N.map(m),h.depth=m(j),h.stencil=m(D),h.depthStencil=m(L),h.width=o.width,h.height=o.height,M(o),h}return a.framebufferCount++,h(t,i),e(h,{resize:function(t,e){w(s.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return h;for(var i=o.colorAttachments,a=0;a=2,"invalid shape for framebuffer"),w(y[0]===y[1],"cube framebuffer must be square"),f=y[0]}else"radius"in m&&(f=0|m.radius),"width"in m?(f=0|m.width,"height"in m&&w(m.height===f,"must be square")):"height"in m&&(f=0|m.height);("color"in m||"colors"in m)&&(d=m.color||m.colors,Array.isArray(d)&&w(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in m&&(v=0|m.colorCount,w(v>0,"invalid color buffer count")),"colorType"in m&&(w.oneOf(m.colorType,l,"invalid color type"),g=m.colorType),"colorFormat"in m&&(p=m.colorFormat,w.oneOf(m.colorFormat,u,"invalid color format for texture"))),"depth"in m&&(h.depth=m.depth),"stencil"in m&&(h.stencil=m.stencil),"depthStencil"in m&&(h.depthStencil=m.depthStencil)}else f=1;if(d)if(Array.isArray(d))for(c=[],r=0;r0&&(h.depth=o[0].depth,h.stencil=o[0].stencil,h.depthStencil=o[0].depthStencil),o[r]?o[r](h):o[r]=O(h)}return e(a,{width:f,height:f,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(w(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=B[t];e&&e(m,null,0)}i.flush(),d&&d.update()}function J(){!$&&B.length>0&&($=A.next(Q))}function tt(){$&&(A.cancel(Q),$=null)}function et(t){t.preventDefault(),a=!0,tt(),G.forEach((function(t){t()}))}function nt(t){i.getError(),a=!1,s.restore(),S.restore(),b.restore(),E.restore(),M.restore(),C.restore(),x.restore(),d&&d.restore(),T.procs.refresh(),J(),F.forEach((function(t){t()}))}function rt(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(O.isDynamic(o))r[i]=O.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return h.call(this,function(t){for(;d.length=0,"cannot cancel a frame twice"),B[e]=function t(){var e=he(B,t);B[e]=B[B.length-1],B.length-=1,B.length<=0&&tt()}}}}function st(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function ut(){m.tick+=1,m.time=lt(),st(),T.procs.poll()}function ct(){E.refresh(),st(),T.procs.refresh(),d&&d.update()}function lt(){return(k()-p)/1e3}ct();var ht=e(rt,{clear:function(t){if(w("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)it(e({framebuffer:t.framebuffer.faces[n]},t),ot);else it(t,ot);else ot(0,t)},prop:O.define.bind(null,1),context:O.define.bind(null,2),this:O.define.bind(null,3),draw:rt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return _.create(t,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:M.create,framebuffer:C.create,framebufferCube:C.createCube,vao:x.createVAO,attributes:o,frame:at,on:function(t,e){var n;switch(w.type(e,"function","listener callback must be a function"),t){case"frame":return at(e);case"lost":n=G;break;case"restore":n=F;break;case"destroy":n=Z;break;default:w.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t=0},read:P,destroy:function(){B.length=0,tt(),j&&(j.removeEventListener("webglcontextlost",et),j.removeEventListener("webglcontextrestored",nt)),S.clear(),C.clear(),M.clear(),E.clear(),_.clear(),b.clear(),x.clear(),d&&d.clear(),Z.forEach((function(t){t()}))},_gl:i,_refresh:ct,poll:function(){ut(),d&&d.update()},now:lt,stats:h});return r.onDone(null,ht),ht}}()},,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Engine=void 0;const r=n(295),i=n(119),o=n(565),a=n(118),s=n(33);e.Engine=class{constructor(t,e){this.engineOptions=Object.assign({},e),this.viewOptions=Object.assign({fitCenter:!0,fitView:!1,groupPadding:20,leakAreaHeight:150,updateHighlight:"#fc5185"},e.view),this.animationOptions=Object.assign({enable:!0,duration:750,timingFunction:"easePolyOut"},e.animation),this.behaviorOptions=Object.assign({drag:!0,zoom:!0,dragNode:!0,selectNode:!0},e.behavior),this.modelConstructor=new r.ModelConstructor(this),this.viewContainer=new o.ViewContainer(this,t)}render(t,e=!1){if(null==t)return;let n=JSON.stringify(t);if(!1===e&&this.prevStringSource===n)return;this.prevStringSource=n;const r=this.modelConstructor.construct(t);this.viewContainer.render(r)}reLayout(){this.viewContainer.reLayout()}getGraphInstance(){return this.viewContainer.getG6Instance()}hideGroups(t){const e=Array.isArray(t)?t:[t],n=this.viewContainer.getG6Instance();this.modelConstructor.getLayoutGroupTable().forEach(t=>{const r=e.find(e=>e===t.layout);r&&!t.isHide&&(t.modelList.forEach(t=>n.hideItem(t.G6Item)),t.isHide=!0),!r&&t.isHide&&(t.modelList.forEach(t=>n.showItem(t.G6Item)),t.isHide=!1)})}getAllModels(){return[...s.Util.convertGroupTable2ModelList(this.modelConstructor.getLayoutGroupTable()),...this.viewContainer.getAccumulateLeakModels()]}updateStyle(t,e){const n=this.getAllModels(),r=this.modelConstructor.getLayoutGroupTable().get(t);r.options=e,n.forEach(e=>{if(e.group!==t)return;const n=e.getModelType(),i=r.options[n];if(i)if("addressLabel"===n)e.updateG6ModelStyle(e.generateG6ModelProps(i));else{const t=i[e.sourceType];t&&e.updateG6ModelStyle(e.generateG6ModelProps(t))}})}findNode(t){const e=this.getAllModels(),n=t.toString();return e.find(t=>t instanceof a.SVNode&&t.sourceId===n)}resize(t,e){this.viewContainer.resize(t,e)}on(t,e){"function"==typeof e&&("onFreed"!==t&&"onLeak"!==t&&"onLeakAreaUpdate"!==t?this.viewContainer.getG6Instance().on(t,t=>{e(t.item.SVModel)}):i.EventBus.on(t,e))}switchBrushSelect(t){const e=this.viewContainer.getG6Instance();t?e.setMode("brush"):e.setMode("default")}destroy(){this.modelConstructor.destroy(),this.viewContainer.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ModelConstructor=void 0;const r=n(33),i=n(175),o=n(147),a=n(118),s=n(276);e.ModelConstructor=class{constructor(t){this.engine=t,this.prevSourcesStringMap={}}construct(t){const e=new Map,n=i.SV.registeredLayout;return Object.keys(t).forEach(r=>{let i=t[r],o=i.layouter,a=n[o];if(!o||!a)return;let s=JSON.stringify(i.data),u=this.prevSourcesStringMap[r],c=[],l=[],h=[],f=[],d=[];if(u===s)return;const p=a.defineOptions(i.data),g=a.sourcesPreprocess(i.data,p),v=p.node||p.element||{},m=p.marker||{},y=p.indexLabel||{},b=p.addressLabel||{};c=this.constructNodes(r,o,v,g),d=this.constructMarkers(r,o,m,c),f=this.constructIndexLabel(r,o,y,c),h=this.constructAddressLabel(r,o,b,c),c.forEach(t=>{t.freedLabel&&l.push(t.freedLabel)}),e.set(r,{name:r,node:c,freedLabel:l,addressLabel:h,indexLabel:f,link:[],marker:d,options:p,layoutCreator:a,modelList:[...c,...d,...l,...h,...f],layout:o,isHide:!1})}),e.forEach((t,n)=>{const r=t.options.link||{},i=this.constructLinks(n,t.layout,r,t.node,e);t.link=i,t.modelList.push(...i)}),this.layoutGroupTable=e,this.layoutGroupTable}constructNodes(t,e,n,r){let i=[];return r.forEach(r=>{null!==r&&(void 0!==r.type&&null!==r.type||(r.type="default"),i.push(this.createNode(r,r.type,t,e,n[r.type])))}),i}constructLinks(t,e,n,r,i){let o=[];return Object.keys(n).forEach(a=>{for(let s=0;s{l=this.fetchTargetNodes(i,u,r);let f=this.isGeneralLink(c.toString());return l&&(h=this.createLink(a,t,e,u,l,s,n[a]),o.push(h)),f?l:null});else{l=this.fetchTargetNodes(i,u,c);let r=this.isGeneralLink(c.toString());l&&(h=this.createLink(a,t,e,u,l,null,n[a]),o.push(h)),u[a]=r?l:null}else u[a]=null}}),o}constructIndexLabel(t,e,n,r){let i=[];return Object.keys(n).forEach(o=>{for(let a=0;a{const o=new s.SVAddressLabel(r.id+"-address-label",r.sourceType,t,e,r,n);i.push(o)}),i}constructMarkers(t,e,n,r){let i=[];return Object.keys(n).forEach(o=>{for(let a=0;a{var n;return null!==(n=this.parserNodeContent(e,t))&&void 0!==n?n:""}):this.parserNodeContent(e,t),"undefined"===n&&(n=""),null!=n?n:""}createNode(t,e,n,r,i){let o=this.resolveNodeLabel(i.label,t),u=e+"."+t.id.toString(),c=new a.SVNode(u,e,n,r,t,o,i);return c.freed&&(c.freedLabel=new s.SVFreedLabel(u+"-freed-label",e,n,r,c)),c.modelConstructor=this,c}createLink(t,e,n,r,i,a,s){let u=`${t}(${r.id}-${i.id})`;return new o.SVLink(u,t,e,n,r,i,a,s)}parserNodeContent(t,e){let n=r.Util.textParser(e);if(Array.isArray(n)){n.map(e=>t[e]).map((t,r)=>{e=e.replace("["+n[r]+"]",t)})}return e}fetchTargetNodes(t,e,n){let r,i=e.group,o=e.sourceType,a=n,s=i,u=null;if(null==n)return null;("number"==typeof n||"string"==typeof n&&!n.includes("#"))&&(n="default#"+n);let c=n.split("#");if(a=c.pop(),c.length>1)o=c.pop(),s=c.pop();else{let e=c.pop();if(t.get(s).node.find(t=>t.sourceType===e))o=e;else{if(!t.has(e))return null;s=e}}return r=t.get(s).node.filter(t=>t.sourceType===o),void 0===r?null:(u=r.find(t=>t.sourceId===a),u||null)}isGeneralLink(t){let e=0;for(let n=0;nt.id===e.id)}destroy(){this.layoutGroupTable=null,this.prevSourcesStringMap=null}}},function(t,e,n){"use strict";function r(){for(var t=[],e=0;e0;)for(var v=d.pop(),m=v.id,y=(0,s.getNeighbors)(m,t.edges),b=function(r){var i,a=y[r],s=t.nodes.find((function(t){return t.id===a}));if(a===m)o.push(((i={})[a]=v,i));else if(a in g){if(!g[m].has(s)){for(var u=!0,c=[s,v],l=p[m];g[a].size&&!g[a].has(l)&&(c.push(l),l!==p[l.id]);)l=p[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var h={},f=1;f-1)return h;r.push(a),i.add(a);for(var f=l[a.id],d=0;d0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(a);else for(d=0;d-1}));m-1?g[v.id].push(l[b]):u.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:a}},b=0;b=b})),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var _=y(w),S=_.minIdx,E=_.adjList,M=_.component;if(!(M.length>1))break;M.forEach((function(t){o[t.id]=new Set}));var O=c[S];if(e&&n&&-1===e.indexOf(O.id))return u;h(O,O,E),b=S+1}return u};e.detectAllDirectedCycle=l;e.detectAllCycles=function(t,e,n,r){return void 0===r&&(r=!0),e?l(t,n,r):c(t,n,r)};var h=function(t){var e=null,n=t.nodes,r={},i={},a={},s={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var u={enter:function(t){var n=t.current,o=t.previous;if(a[n]){e={};for(var s=n,u=o;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else a[n]=n,delete i[n],r[n]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var n=t.next;return!e&&!s[n]}};Object.keys(i).length;){var c=Object.keys(i)[0];(0,o.default)(t,c,u)}return e};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findAllPath=e.findShortestPath=void 0;var r,i=(r=n(150))&&r.__esModule?r:{default:r},o=n(47);e.findShortestPath=function(t,e,n,r,o){var a=(0,i.default)(t,e,r,o),s=a.length,u=a.path,c=a.allPath;return{length:s[n],path:u[n],allPath:c[n]}};e.findAllPath=function(t,e,n,r){var i;if(e===n)return[[e]];var a=t.edges,s=void 0===a?[]:a,u=[e],c=((i={})[e]=!0,i),l=[],h=[],f=r?(0,o.getNeighbors)(e,s,"target"):(0,o.getNeighbors)(e,s);for(l.push(f);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var p=d.shift();if(p&&(u.push(p),c[p]=!0,f=r?(0,o.getNeighbors)(p,s,"target"):(0,o.getNeighbors)(p,s),l.push(f.filter((function(t){return!c[t]})))),u[u.length-1]===n){var g=u.map((function(t){return t}));h.push(g);v=u.pop();c[v]=!1,l.pop()}}else{var v=u.pop();c[v]=!1,l.pop()}}return h}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(98))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,c=void 0===u?[]:u,l={},h={};s.forEach((function(t,e){var n=(0,o.uniqueId)();t.clusterId=n,l[n]={id:n,nodes:[t]},h[t.id]={node:t,idx:e}}));var f=(0,i.default)(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=s[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=s[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,v=function(){var t=!1;if(s.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=h[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=0&&i.splice(o,1),i&&i.length){t=!0;var a=l[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),c=l[i[u]];c.nodes.push(e),e.clusterId=c.id}}})),!t)return"break";g++};g100);)y=m,b++,Object.keys(h).forEach((function(t){var e=0;c.forEach((function(r){var i=r.source,o=r.target,a=f[i].node.clusterId,s=f[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),h[t].sumTot=e})),s.forEach((function(t,e){var r,i=h[t.clusterId],o=0,a=p[e]/(2*v),s=0;i.nodes.forEach((function(t){var n=f[t.id].idx;s+=d[e][n]||0}));var u=s-i.sumTot*a,l=g[t.id];if(Object.keys(l).forEach((function(n){var i=f[n].node.clusterId;if(i!==t.clusterId){var s=h[i],c=s.nodes;if(c&&c.length){var l=0;c.forEach((function(t){var n=f[t.id].idx;l+=d[e][n]||0}));var p=l-s.sumTot*a-u;p>o&&(o=p,r=s)}}})),o>0){r.nodes.push(t);var m=t.clusterId;t.clusterId=r.id;var y=i.nodes.indexOf(t);i.nodes.splice(y,1);var b=0,x=0;c.forEach((function(t){var e=t.source,i=t.target,o=f[e].node.clusterId,a=f[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===m&&a!==m||a===m&&o!==m)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));var x={},w=0;Object.keys(h).forEach((function(t){var e=h[t];if(e.nodes&&e.nodes.length){var n=String(w+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),h[n]=e,x[t]=n,delete h[t],w++)}else delete h[t]})),s.forEach((function(t){t.clusterId&&x[t.clusterId]&&(t.clusterId=x[t.clusterId])}));var _=[],S={};c.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=f[e].node.clusterId,a=f[r].node.clusterId,s=o+"---"+a;if(S[s])S[s].weight+=i,S[s].count++;else{var u={source:o,target:a,weight:i,count:1};S[s]=u,_.push(u)}}));var E=[];return Object.keys(h).forEach((function(t){E.push(h[t])})),{clusters:E,clusterEdges:_}};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(309)),i=a(n(310)),o=n(47);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var n=[],r=t.nodes,a=void 0===r?[]:r,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return n;var c=a[0],l=new Set;l.add(c);var h=new i.default((function(t,n){return e?t.weight-n.weight:0}));for((0,o.getEdgesByNodeId)(c.id,u).forEach((function(t){h.insert(t)}));!h.isEmpty();){var f=h.delMin(),d=f.source,p=f.target;l.has(d)&&l.has(p)||(n.push(f),l.has(d)||(l.add(d),(0,o.getEdgesByNodeId)(d,u).forEach((function(t){h.insert(t)}))),l.has(p)||(l.add(p),(0,o.getEdgesByNodeId)(p,u).forEach((function(t){h.insert(t)}))))}return n},u=function(t,e){var n=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return n;var u=s.map((function(t){return t}));e&&u.sort((function(t,e){return t.weight-e.weight}));for(var c=new r.default(o.map((function(t){return t.id})));u.length>0;){var l=u.shift(),h=l.source,f=l.target;c.connected(h,f)||(n.push(l),c.union(h,f))}return n},c=function(t,e,n){return n?{prim:s,kruskal:u}[n](t,e):u(t,e)};e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r0?n=r:null!==i&&i0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(182))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,a=1,s=0,u=1e3,c=t.nodes,l=void 0===c?[]:c,h=t.edges,f=void 0===h?[]:h,d=l.length,p={},g={},v=0;v0&&a>e;){s=0;for(v=0;v0&&(r+=g[w]/_)}p[y]=n*r,s+=p[y]}}s=(1-s)/d,a=0;for(v=0;ve&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var i=n[t.id].outDegree;c>i&&(c=i)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},y=function(t,e,n,s,u,y,b){if(void 0===n&&(n=!1),void 0===y&&(y="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var x=t.nodes.length;if(x){var w=(0,i.default)(t,n),_=(0,i.default)(e,n),S=g(t.nodes,w,n),E=g(e.nodes,_,n),M=d(t.nodes,y),O=M.nodeMap,A=M.nodeLabelMap,k=d(e.nodes,y),C=k.nodeMap,T=k.nodeLabelMap;p(t.edges,b,O);var I=p(e.edges,b,C).edgeLabelMap,P=[];null==_||_.forEach((function(t){P=P.concat(t)})),u||(u=Math.max.apply(Math,(0,r.__spreadArray)((0,r.__spreadArray)([],P),[2]))),s||(s=u);var N=c(t,w,y,s),j=c(e,_,y,s),D=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,h=t.neighborNum-1;u2*e)););if(d<2*e&&(a[r+"-"+f]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}u$[r][c]){s=!0;break}if(s)return X.splice(e,1),"continue";var l={};i.neighbors.forEach((function(t){var e=S[n.id+"-"+t.id];l[n.id+"-"+t.id]={start:O[n.id].idx,end:O[t.id].idx,distance:e}})),L=h(l,N,t,L);var d=[];Object.keys(l).forEach((function(t){if(V[t])d.push(V[t]);else{var e=L[t];V[t]=f(e,U,y,b),d.push(V[t])}})),d=d.sort((function(t,e){return e-t}));var p=!1;for(c=0;c=0;l--)c(l)}));var J=[];null==X||X.forEach((function(r){for(var i=O[r.id].idx,o=l(t.nodes,w[i],i,y,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1$[h][p])o.splice(s,1);else{if(n){var g=c.id+"-"+r.id,x=S[g];if(p=Q[h].length-1,x>Q[h][p]){o.splice(s,1);continue}}var _=V[f]?V[f]:v(t,r,c,O,d,N,U,y,b,V,L),E=W.id+"-"+h;if(_=0;d--){if("break"===x(d))break}if(v)return J.splice(r,1),"continue";i.edges=c;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[y];if(s[e]--,s[e]et[r][et[r].length-1]){e=u[t].node[y];if(s[e]--,s[e]=0;E--){var M=i.nodes[E],A=u[M.id].degree,k=u[M.id].inDegree,P=u[M.id].outDegree,N=M[y],j=m(H,N,C,T),D=j.minPatternNodeLabelDegree,L=j.minPatternNodeLabelInDegree,R=j.minPatternNodeLabelOutDegree;if(n?A=0;B--){var G=c[B];if(!u[G.source]||!u[G.target]){c.splice(B,1);var F=G[b];if(l[F]--,u[G.source]&&(u[G.source].degree--,u[G.source].outDegree--),u[G.target]&&(u[G.target].degree--,u[G.target].inDegree--),I[F]&&l[F]=0;rt--){if("break"===nt(rt))break}var it=J.length,ot=function(t){var e=J[t],n={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=J[t],r={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&J.splice(t,1)},i=it-1;i>t;i--)r(i);it=J.length};for(rt=0;rt<=it-1;rt++)ot(rt);return J}}};e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(0),i=n(314),o=function(){function t(t,e,n,r,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||i.VACANT_NODE_LABEL,edgeLabel:r||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rh||r.hasNode(o[l.to])||(e.labelm;b--){if("break"===y(b))break}if(g){var x=t.findMinLabel(p);c.dfsEdgeList.push(new o(d,v,i.VACANT_NODE_LABEL,x.edgeLabel,i.VACANT_NODE_LABEL));var w=c.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===c.dfsEdgeList[w]&&a(p[x.edgeLabel].projected)}var _={};g=!1;var S=0;l.forEach((function(e){var n=new s(e),i=t.findForwardPureEdges(r,n.edges[h[0]],f,n);i.length>0&&(g=!0,S=d,i.forEach((function(t){var n=t.label+"-"+u[t.to].label;_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var E=h.length,M=function(e){if(g)return"break";var n=h[e];l.forEach((function(e){var i=new s(e),o=t.findForwardRmpathEdges(r,i.edges[n],f,i);o.length>0&&(g=!0,S=c.dfsEdgeList[n].fromNode,o.forEach((function(t){var n=t.label+"-"+u[t.to].label;_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(b=0;b=0;f--){var d=e.findBackwardEdge(i,h.edges[r[f]],h.edges[r[0]],h);if(d){var p=e.dfsCode.dfsEdgeList[r[f]].fromNode+"-"+d.label;l[p]||(l[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[f]].fromNode,edgeLabel:d.label}),l[p].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(i,h.edges[r[0]],u,h).forEach((function(e){var n=a+"-"+e.label+"-"+o[e.to].label;c[n]||(c[n]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),c[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var g=function(n){e.findForwardRmpathEdges(i,h.edges[r[n]],u,h).forEach((function(i){var a=e.dfsCode.dfsEdgeList[r[n]].fromNode+"-"+i.label+"-"+o[i.to].label;c[a]||(c[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),c[a].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(f=0;fi){var a=i;i=r,r=a}var l=t.label,h=n+"-"+r+"-"+l+"-"+i,f=r+"-"+l+"-"+i;if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[h]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[t.slice(0,3)]}},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var r=n(318),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){var r=n(185),i=n(321),o={};Object.keys(r).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:r[t].channels}),Object.defineProperty(o[t],"labels",{value:r[t].labels});var e=i(t);Object.keys(e).forEach((function(n){var r=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var r=n.length,i=0;i1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=o},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){var r=n(185);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i-1}},function(t,e,n){var r=n(101);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(100);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(100),i=n(152),o=n(153);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(88),i=n(338),o=n(45),a=n(189),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?f:s).test(a(t))}},function(t,e,n){var r=n(74),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(339),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(49)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(342),i=n(100),o=n(152);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(343),i=n(344),o=n(345),a=n(346),s=n(347);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(211),i=n(416),o=n(420),a=n(212),s=n(421),u=n(165);t.exports=function(t,e,n){var c=-1,l=i,h=t.length,f=!0,d=[],p=d;if(n)f=!1,l=o;else if(h>=200){var g=e?null:s(t);if(g)return u(g);f=!1,l=a,p=new r}else p=e?[]:d;t:for(;++c-1}},function(t,e,n){var r=n(226),i=n(418),o=n(419);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(44);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(29),i=n(475),o=n(478),a=n(479),s=n(38).normalizeRanks,u=n(481),c=n(38).removeEmptyRanks,l=n(482),h=n(483),f=n(484),d=n(485),p=n(494),g=n(38),v=n(48).Graph,m=n(496);t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,i,o;n=t,i=e.prevGraph,o=i._nodes,r.forEach(n.nodes(),(function(t){var e=n.node(t);void 0!==o[t]?(e.fixorder=o[t]._order,delete o[t]._order):delete e.fixorder}))}));var k=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=A(t.graph());return e.setGraph(r.merge({},b,O(n,y),r.pick(n,x))),r.forEach(t.nodes(),(function(n){var i=A(t.node(n));e.setNode(n,r.defaults(O(i,w),_)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=A(t.edge(n));e.setEdge(n,r.merge({},E,O(i,S),r.pick(i,M)))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.nodes(),(function(e){var n=t.node(e);isNaN(n.layer)||(n.layer*=2)})),r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(k)}));try{n(" runLayout",(function(){!function(t,e,n){e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){l.run(t)})),e(" rank",(function(){a(g.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};g.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){l.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){h(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){m(t,n.nodeOrder)}));e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){f.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){f.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(k,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,k)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],w=["width","height","layer","fixorder"],_={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function O(t,e){return r.mapValues(r.pick(t,e),Number)}function A(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(186);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(114),i=n(73),o=n(115),a=n(67),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(226),i=n(55),o=n(441),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(t,i(e,3),u)}},function(t,e,n){var r=n(234);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(443),i=n(45),o=n(77),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(444),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},function(t,e){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var r=n(164),i=n(207),o=n(67);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(105),i=n(163),o=n(55);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},function(t,e,n){var r=n(168),i=n(449),o=n(68);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(451),i=n(455)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(99),i=n(236),o=n(164),a=n(452),s=n(45),u=n(67),c=n(237);t.exports=function t(e,n,l,h,f){e!==n&&o(n,(function(o,u){if(f||(f=new r),s(o))a(e,n,u,l,t,h,f);else{var d=h?h(c(e,u),o,u+"",e,n,f):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},function(t,e,n){var r=n(236),i=n(193),o=n(202),a=n(194),s=n(203),u=n(90),c=n(32),l=n(227),h=n(75),f=n(88),d=n(45),p=n(453),g=n(91),v=n(237),m=n(454);t.exports=function(t,e,n,y,b,x,w){var _=v(t,n),S=v(e,n),E=w.get(S);if(E)r(t,n,E);else{var M=x?x(_,S,n+"",t,e,w):void 0,O=void 0===M;if(O){var A=c(S),k=!A&&h(S),C=!A&&!k&&g(S);M=S,A||k||C?c(_)?M=_:l(_)?M=a(_):k?(O=!1,M=i(S,!0)):C?(O=!1,M=o(S,!0)):M=[]:p(S)||u(S)?(M=_,u(_)?M=m(_):d(_)&&!f(_)||(M=s(S))):O=!1}O&&(w.set(S,M),b(M,S,y,x,w),w.delete(S)),r(t,n,M)}}},function(t,e,n){var r=n(66),i=n(109),o=n(51),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var r=n(89),i=n(67);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(114),i=n(115);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(113),i=n(111),o=n(55),a=n(222),s=n(469),u=n(107),c=n(470),l=n(68),h=n(32);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return h(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[l];var f=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++f,value:t}}));return s(d,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(471);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(77);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,l=r(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&t0;--u)if(r=e[u].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,u(e,n,a)})),t.removeNode(i.v),a}function u(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(29),i=n(38);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,s=t.node(a).rank,u=e.w,c=t.node(u).rank,l=e.name,h=t.edge(e),f=h.labelRank;if(c===s+1)return;for(t.removeEdge(e),o=0,++s;su.lim&&(c=u,l=!0);var h=r.filter(e.edges(),(function(e){return l===y(t,t.node(e.v),c)&&l!==y(t,t.node(e.w),c)}));return r.minBy(h,(function(t){return o(e,t)}))}function m(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),h(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function y(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=l,l.initLowLimValues=d,l.initCutValues=h,l.calcCutValue=f,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=m},function(t,e,n){var r=n(29);t.exports=function(t){var e=function(t){var e={},n=0;function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));o=i,i=r;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],l=!0;n!==i.w;){if(r=t.node(n),l){for(;(c=a[u])!==s&&t.node(c).maxRank=2),s=l.buildLayerMatrix(t);var v=o(t,s);v=2,!0),s=l.buildLayerMatrix(t),(v=o(t,s))0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(29),i=n(38);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e,n){var a=i.partition(t,(function(t){return r.has(t,"fixorder")&&!isNaN(t.fixorder)||r.has(t,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(t){return-t.i})),c=[],l=0,h=0,f=0;s.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenterr.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.orderr.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),f=o(c,u,f),r.forEach(s,(function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=o(c,u,f)}));var d={vs:r.flatten(c,!0)};h&&(d.barycenter=l/h,d.weight=h);return d}},function(t,e,n){var r=n(29),i=n(48).Graph;t.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),u=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},function(t,e,n){var r=n(29);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},function(t,e,n){"use strict";var r=n(29),i=n(38),o=n(495).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(29),i=n(48).Graph,o=n(38);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,s=e.length,c=r.last(i);return r.forEach(i,(function(e,l){var h=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=h?t.node(h).order:s;(h||e===c)&&(r.forEach(i.slice(a,l+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(as)&&u(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,e.length)})),n})),n}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function l(t,e,n,i){var o={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var u=i(t);if(u.length)for(var l=((u=r.sortBy(u,(function(t){return s[t]}))).length-1)/2,h=Math.floor(l),f=Math.ceil(l);h<=f;++h){var d=u[h];a[t]===t&&e=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0,v=p.length>n.length,m=function(t,e,n,r,i){for(var o=[],a=0;a0?c:t(e,r)}return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var r=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(69),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(42),i=n(56),o=n(244),a=n(93),s=n(513),u=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,l=e.target&&e.target.isArray(),h=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(l&&h)return o.map((function(e){return c(t)(e)}));var f=null;if(!e.target.isOptional()||0!==n.length){var d=n[0],p=d.scope===i.BindingScopeEnum.Singleton,g=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(g&&null!==t&&t.has(d.id))return t.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)f=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)f=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)f=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)f=u("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)f=u("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)f=u("toProvider",d.serviceIdentifier,(function(){return d.provider(e.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var v=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+v)}f=s.resolveInstance(d.implementationType,o,c(t))}return"function"==typeof d.onActivation&&(f=d.onActivation(e.parentContext,f)),p&&(d.cache=f,d.activated=!0),g&&null!==t&&!t.has(d.id)&&t.set(d.id,f),f}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n0){var l=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n);u=l,c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((s=t).bind.apply(s,r([void 0],u))),e,n)}else c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(42),i=n(56),o=n(515),a=n(247),s=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(516),i=n(169),o=n(170),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(56),i=n(247),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(42),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(69),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(42),i=n(34);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(50),i=n(61);e.tagged=function(t,e){return function(n,o,a){var s=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,s):i.tagProperty(n,o,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(34),i=n(50),o=n(61);e.named=function(t){return function(e,n,a){var s=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(34),i=n(50),o=n(61);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(34),i=n(50),o=n(61);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(34),i=n(50),o=n(61);e.multiInject=function(t){return function(e,n,a){var s=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(34),i=n(50),o=n(61);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(42),i=n(34),o=n(50);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;rn*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewContainer=void 0;const r=n(566),i=n(33),o=n(567),a=n(568),s=n(119),u=n(174),c=n(570),l=n(277);e.ViewContainer=class{constructor(t,e){const n=c.InitG6Behaviors(t,this);this.engine=t,this.layoutProvider=new r.LayoutProvider(t,this),this.renderer=new o.Renderer(t,e,n),this.reconcile=new a.Reconcile(t,this.renderer),this.layoutGroupTable=new Map,this.prevModelList=[],this.accumulateLeakModels=[],this.hasLeak=!1,this.brushSelectedModels=[],this.clickSelectNode=null;this.renderer.getG6Instance();const i=this.engine.viewOptions.leakAreaHeight,s=this.getG6Instance().getHeight(),{drag:u,zoom:h}=this.engine.behaviorOptions;this.leakAreaY=s-i,l.SolveNodeAppendagesDrag(this),l.SolveBrushSelectDrag(this),u&&l.SolveDragCanvasWithLeak(this),h&&l.SolveZoomCanvasWithLeak(this)}reLayout(){const t=this.getG6Instance(),e=t.getGroup().getMatrix();if(e){let n=e[6],r=e[7];t.translate(-n,-r)}this.layoutProvider.layoutAll(this.layoutGroupTable,this.accumulateLeakModels,[]),t.refresh()}getG6Instance(){return this.renderer.getG6Instance()}getAccumulateLeakModels(){return this.accumulateLeakModels}getLayoutGroupTable(){return this.layoutGroupTable}refresh(){this.renderer.getG6Instance().refresh()}resize(t,e){const n=this.getG6Instance(),r=n.getHeight(),i=new u.Group;i.add(...this.prevModelList,...this.accumulateLeakModels),this.renderer.changeSize(t,e);const o=n.getHeight()-r;i.translate(0,o),this.renderer.refresh(),this.leakAreaY+=o,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})}render(t){const e=i.Util.convertGroupTable2ModelList(t),n=this.reconcile.diff(this.layoutGroupTable,this.prevModelList,e,this.accumulateLeakModels),r=[...e,...n.REMOVE,...n.LEAKED,...n.ACCUMULATE_LEAK];!0===this.hasLeak&&0===this.accumulateLeakModels.length&&(this.hasLeak=!1,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})),n.LEAKED.length&&(this.hasLeak=!0,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})),this.renderer.build(r),this.layoutProvider.layoutAll(t,this.accumulateLeakModels,n.LEAKED),this.beforeRender(),this.renderer.render(r),this.reconcile.patch(n),this.afterRender(),this.accumulateLeakModels.push(...n.LEAKED),this.layoutGroupTable=t,this.prevModelList=e}destroy(){this.renderer.destroy(),this.reconcile.destroy(),this.layoutProvider=null,this.layoutGroupTable=null,this.prevModelList.length=0,this.accumulateLeakModels.length=0,this.brushSelectedModels.length=0}afterRender(){this.prevModelList.forEach(t=>{!1===t.leaked&&(t.discarded=!0)})}beforeRender(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutProvider=void 0;const r=n(172),i=n(174),o=n(33),a=n(173);e.LayoutProvider=class{constructor(t,e){this.engine=t,this.viewOptions=this.engine.viewOptions,this.viewContainer=e}preLayoutProcess(t){o.Util.convertGroupTable2ModelList(t).forEach(t=>{t.preLayout=!0,t.set("rotation",t.get("rotation")),t.set({x:0,y:0})})}postLayoutProcess(t){o.Util.convertGroupTable2ModelList(t).forEach(t=>{t.preLayout=!1,t.layoutX=t.get("x"),t.layoutY=t.get("y")})}layoutMarker(t,e){t.forEach(t=>{var n,r,i;const o=e[t.sourceType],s=null!==(n=o.offset)&&void 0!==n?n:8,u=null!==(r=t.anchor)&&void 0!==r?r:0,c=null!==(i=o.labelOffset)&&void 0!==i?i:2;let l,h,f=t.target.getBound(),d=t.target.shadowG6Item.getAnchorPoints()[u],p=[f.x+f.width/2,f.y+f.height/2],g=[d.x,d.y],v=a.Vector.subtract(g,p),m=0,y=a.Vector.length(v)+s;m=0===v[0]?v[1]>0?-Math.PI:0:Math.sign(v[0])*(Math.PI/2-Math.atan(v[1]/v[0]));const b=t.get("size")[1],x=t.getLabelSizeRadius()/2;v=a.Vector.normalize(v),l=a.Vector.location(p,v,y),h=a.Vector.location(p,v,b+y+x+c),h=a.Vector.subtract(h,l),t.set({x:l[0],y:l[1],rotation:m,markerEndPosition:h})})}layoutFreedLabel(t){t.forEach(t=>{const e=t.target.getBound();t.set({x:e.x+e.width/2,y:e.y+1.5*e.height,size:[e.width,0]})})}layoutIndexLabel(t,e){const n={top:(t,e,n)=>({x:t.x+t.width/2,y:t.y-n}),right:(t,e,n)=>({x:t.x+t.width+n,y:t.y+t.height/2}),bottom:(t,e,n)=>({x:t.x+t.width/2,y:t.y+t.height+n}),left:(t,e,n)=>({x:t.x-e.width-n,y:t.y+t.height/2})};t.forEach(t=>{var r,i;const o=e[t.sourceType],a=t.target.getBound(),s=t.getBound(),u=null!==(r=o.offset)&&void 0!==r?r:20,c=null!==(i=o.position)&&void 0!==i?i:"bottom",l=n[c](a,s,u);t.set(l)})}layoutAddressLabel(t,e){const n=e.offset||16;t.forEach(t=>{const e=t.target.getBound();t.set({x:e.x+e.width/2,y:e.y-n})})}layoutModels(t){const e=[];return t.forEach(t=>{const n=t.modelList,r=new i.Group,o=t.options.layout;n.forEach(t=>{r.add(t)}),t.layoutCreator.layout(t.node,o),e.push(r)}),t.forEach(t=>{const e=t.options.marker||{},n=t.options.indexLabel||{},r=t.options.addressLabel||{};this.layoutIndexLabel(t.indexLabel,n),this.layoutFreedLabel(t.freedLabel),this.layoutAddressLabel(t.addressLabel,r),this.layoutMarker(t.marker,e)}),e}layoutLeakModels(t,e){const n=new i.Group,a=this.viewContainer.getG6Instance().getHeight()-this.engine.viewOptions.leakAreaHeight;let s;t.forEach(t=>{t.set({x:t.layoutX,y:t.layoutY})});const u=e.length?r.Bound.union(...e.map(t=>t.getBound())):{x:0,y:a,width:0,height:0},c=o.Util.groupBy(t,"group");Object.keys(c).forEach(t=>{n.add(...c[t]);const e=n.getBound(),i=s?s.x+s.width:0,{x:o,y:a}=e,l=u.x+u.width+i+60-o,h=u.y-a;n.translate(l,h),n.clear(),r.Bound.translate(e,l,h),s=e})}layoutGroups(t){let e,n,o,a=new i.Group,s=[],u=0;for(let i=0;it.item.SVModel.isNode(),getContent:t=>this.getTooltipContent(t.item.SVModel,{address:"sourceId",data:"data"}),itemTypes:["node"]});this.shadowG6Instance=new i.Graph({container:e.cloneNode()}),this.g6Instance=new i.Graph({container:e,width:e.offsetWidth,height:e.offsetHeight,groupByTypes:!1,animate:r,animateCfg:{duration:o,easing:a},fitView:!1,modes:n,plugins:[s]})}getTooltipContent(t,e){const n=document.createElement("div");if(null==t)return n;if(Object.keys(e).map(r=>{let i=t[e[r]];if(null!=i){let e=document.createElement("div");e.innerHTML=`${r}:${""!==i?i:t.G6ModelProps.label}`,n.appendChild(e)}}),t.freed){let t=document.createElement("div");t.innerHTML="(freed)",n.appendChild(t)}return n}build(t){const e=r.Util.convertModelList2G6Data(t);this.shadowG6Instance.clear(),this.shadowG6Instance.read(e),t.forEach(t=>{t.shadowG6Item=this.shadowG6Instance.findById(t.id),t.shadowG6Instance=this.shadowG6Instance})}render(t){const e=r.Util.convertModelList2G6Data(t);this.g6Instance.changeData(e),t.forEach(t=>{t.g6Instance=this.g6Instance,t.G6Item=this.g6Instance.findById(t.id),t.G6Item.SVModel=t}),this.g6Instance.getEdges().forEach(t=>t.toFront()),this.g6Instance.paint()}removeModel(t){this.g6Instance.removeItem(t.G6Item),this.shadowG6Instance.removeItem(t.shadowG6Item)}getG6Instance(){return this.g6Instance}refresh(){this.g6Instance.refresh(),this.shadowG6Instance.refresh()}changeSize(t,e){this.g6Instance.changeSize(t,e),this.shadowG6Instance.changeSize(t,e)}destroy(){this.shadowG6Instance.destroy(),this.g6Instance.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Reconcile=void 0;const r=n(119),i=n(33),o=n(147),a=n(118),s=n(276),u=n(569);e.Reconcile=class{constructor(t,e){this.engine=t,this.renderer=e,this.isFirstPatch=!0}getContinuousModels(t,e){return e.filter(e=>t.find(t=>e.id===t.id))}getAppendModels(t,e,n){const r=e.filter(e=>!t.find(t=>t.id===e.id));return r.forEach(t=>{let e=n.findIndex(e=>t.id===e.id);e>-1&&n.splice(e,1)}),r}getLeakModels(t,e,n){let r=e.filter(t=>!n.find(e=>e.id===t.id)&&!t.freed);const s=[],u=r.filter(t=>t.isNode()),c=i.Util.groupBy(u,"group");return r=r.filter(t=>!1===t.isNode()),Object.keys(c).forEach(e=>{const n=t.get(e).layoutCreator.defineLeakRule;n&&"function"==typeof n&&r.push(...n(c[e]))}),r.forEach(t=>{t instanceof a.SVNode&&(t.leaked=!0,s.push(t),t.appendages.forEach(t=>{t.leaked=!0,s.push(t)}))}),r.forEach(t=>{t instanceof o.SVLink&&!1!==t.node.leaked&&!1!==t.target.leaked&&(t.leaked=!0,s.push(t))}),s.forEach(t=>{t.G6Item=null}),s}getRemoveModels(t,e){let n=[];for(let r=0;rt.id===i.id)||i.leaked||n.push(i)}return n}getReTargetMarkers(t,e){const n=t.filter(t=>t instanceof s.SVMarker);return e.filter(t=>t instanceof s.SVMarker).filter(t=>n.find(e=>e.id===t.id&&e.target.id!==t.target.id))}getLabelChangeModels(t,e){let n=[];return e.forEach(e=>{const r=t.find(t=>t.id===e.id);if(void 0===r)return;const i=r.get("label"),o=e.get("label");String(i)!==String(o)&&n.push(e)}),n}getFreedModels(t,e){const n=e.filter(t=>t instanceof a.SVNode&&t.freed);return n.forEach(e=>{const n=t.find(t=>e.id===t.id);n&&e.set("label",n.get("label"))}),n}handleContinuousModels(t){for(let e=0;e{if(t instanceof s.SVNodeAppendage)if(t instanceof s.SVAddressLabel){t.G6Item.getContainer().attr({opacity:0})}else u.Animations.FADE_IN(t.G6Item,{duration:e,timingFunction:n});else u.Animations.APPEND(t.G6Item,{duration:e,timingFunction:n})})}handleRemoveModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{u.Animations.REMOVE(t.G6Item,{duration:e,timingFunction:n,callback:()=>{this.renderer.removeModel(t)}})})}handleLeakModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{t instanceof s.SVAddressLabel&&u.Animations.FADE_IN(t.G6Item,{duration:e,timingFunction:n}),t.G6Item.enableCapture(!1)}),r.EventBus.emit("onLeak",t)}handleAccumulateLeakModels(t){t.forEach(t=>{t.generalStyle&&t.set("style",Object.assign({},t.generalStyle))})}handleFreedModels(t){const{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{const r=t.G6Item.getContainer();if(t.set("style",{fill:"#ccc"}),r.attr({opacity:.4}),t.marker){const e=t.marker.G6Item.getContainer();t.marker.set("style",{fill:"#ccc"}),e.attr({opacity:.9})}t.freedLabel.G6Item.toFront(),u.Animations.FADE_IN(t.freedLabel.G6Item,{duration:e,timingFunction:n})}),r.EventBus.emit("onFreed",t)}handleChangeModels(t){const e=this.engine.viewOptions.updateHighlight;e&&"string"==typeof e&&t.forEach(t=>{void 0===t.generalStyle&&(t.generalStyle=i.Util.objectClone(t.G6ModelProps.style)),t instanceof o.SVLink?t.set("style",{stroke:e}):t.set("style",{fill:e})})}diff(t,e,n,r){const i=this.getContinuousModels(e,n),o=this.getLeakModels(t,e,n),a=this.getAppendModels(e,n,r),s=this.getRemoveModels(e,n),u=[...this.getReTargetMarkers(e,n),...this.getLabelChangeModels(e,n),...a,...o];return{CONTINUOUS:i,APPEND:a,REMOVE:s,FREED:this.getFreedModels(e,n),LEAKED:o,UPDATE:u,ACCUMULATE_LEAK:[...r]}}patch(t){const{APPEND:e,REMOVE:n,FREED:r,LEAKED:i,UPDATE:o,CONTINUOUS:a,ACCUMULATE_LEAK:s}=t;this.handleAccumulateLeakModels(s),!1===this.isFirstPatch&&this.handleChangeModels(o),this.handleContinuousModels(a),this.handleFreedModels(r),this.handleAppendModels(e),this.handleLeakModels(i),this.handleRemoveModels(n),this.isFirstPatch&&(this.isFirstPatch=!1)}destroy(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Animations=void 0;const r=n(78);e.Animations={APPEND(t,e){const n=t.getType(),i=t.getContainer(),o=r.Util.mat3,a={duration:e.duration,easing:e.timingFunction,callback:e.callback};if("node"===n){let t=i.getMatrix(),e=o.clone(t);o.scale(t,t,[0,0]),o.scale(e,e,[1,1]),i.attr({matrix:t,opacity:0}),i.animate({matrix:e,opacity:1},a)}if("edge"===n){const t=i.get("children")[0],e=t.getTotalLength();t.attr({lineDash:[0,e],opacity:0}),t.animate({lineDash:[e,0],opacity:1},a)}},REMOVE(t,e){const n=t.getType(),i=t.getContainer(),o=r.Util.mat3,a={duration:e.duration,easing:e.timingFunction,callback:e.callback};if("node"===n){let t=o.clone(i.getMatrix());o.scale(t,t,[0,0]),i.animate({opacity:0,matrix:t},a)}if("edge"===n){const t=i.get("children")[0],e=t.getTotalLength();t.animate({lineDash:[0,e],opacity:0},a)}},FADE_IN(t,e){const n=t.getContainer(),r={duration:e.duration,easing:e.timingFunction,callback:e.callback};n.attr({opacity:0}),n.animate({opacity:1},r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InitG6Behaviors=void 0;const r=n(277);e.InitG6Behaviors=function(t,e){const n={type:"drag-node",shouldBegin:t=>{let n=t.item,i=n.SVModel;if(null===n||!1===i.isNode())return!1;if(!1===r.DetermineNodeDrag(e.getLayoutGroupTable(),i,e.brushSelectedModels))return!1;if(e.clickSelectNode){void 0===e.brushSelectedModels.find(t=>t.id===e.clickSelectNode.id)&&(e.clickSelectNode.setSelectedState(!1),e.clickSelectNode=null)}return i.setSelectedState(!0),i.appendages.forEach(t=>{t.setSelectedState(!0)}),!0}};return{default:[n,{type:"drag-canvas"},{type:"click-select",multiple:!1,shouldBegin:t=>{let n=t.item,r=n.SVModel;return null!==n&&!1!==r.isNode()&&(e.clickSelectNode=r,!0)}}],brush:[{type:"brush-select",trigger:"drag",includeEdges:!1,shouldUpdate:t=>{const e=t.SVModel;return!e.leaked&&!1!==e.isNode()&&(e.setSelectedState(!0),!0)}},n]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("pointer",{draw(t,e){const n=e.addShape("path",{attrs:{path:this.getPath(t),fill:t.style.fill,matrix:t.style.matrix},name:"pointer-path"});if(t.label){const r=t.labelCfg&&t.labelCfg.style||{},i=e.addShape("rect",{attrs:{x:0,y:0,text:t.label,fill:null,radius:2},name:"bgRect"}),o=e.addShape("text",{attrs:{x:0,y:0,textAlign:"center",textBaseline:"middle",text:t.label,fill:r.fill||"#999",fontSize:r.fontSize||16},name:"pointer-text-shape"}),{width:a,height:s}=o.getBBox(),{width:u,height:c}=n.getBBox();i.attr({width:a+u+6,height:s+c+6});const l=t.markerEndPosition;if(l){let t=l[0],e=l[1];o.attr({x:t,y:e}),i.attr({x:t-a/2-3,y:e-s/2-3})}return i}return n},getPath(t){let e=t.size[0],n=t.size[1],r=e+4,i=.3*n;return[["M",0,0],["L",-e/2-r/2,-i],["L",-e/2,-i],["L",-e/2,-n],["L",e/2,-n],["L",e/2,-i],["L",e/2+r/2,-i],["Z"]]}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("link-list-node",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke||"#333",fill:t.style.backgroundFill||"#eee",cursor:t.style.cursor},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n*(2/3),height:r,fill:t.style.fill,stroke:t.style.stroke||"#333",cursor:t.style.cursor},name:"main-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.label&&e.addShape("text",{attrs:{x:n*(5/6),y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16},name:"text",draggable:!0}),t.next||t.loopNext||e.addShape("text",{attrs:{x:n*(4/3),y:1.2*r,textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[5/6,0],[5/6,.5],[1,.5],[5/6,1],[.5,1],[0,.5],[1/3,1]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("binary-tree-node",{draw(t,e){t.size=t.size;const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke||"#333",cursor:t.style.cursor,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/4+n/2,y:r/2,width:n/2,height:r,fill:t.style.fill,stroke:t.style.stroke||"#333",cursor:t.style.cursor},name:"mid",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.label&&e.addShape("text",{attrs:{x:n,y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),"0x0"==t.child[0]&&e.addShape("text",{attrs:{x:n*(5/8),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),"0x0"==t.child[1]&&e.addShape("text",{attrs:{x:n*(11/8),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[.875,.5],[.5,1],[.125,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(78),i=n(33);function o(t,e,n){const r=n(t.getMatrix(),[["r",e]]);t.setMatrix(r)}function a(t,e,n,r){const i=r(t.getMatrix(),[["t",e,n]]);t.setMatrix(i)}function s(t,e){let n=Math.cos(t)*e,r=-Math.sin(t)*e;return console.log(n,r,e),{offsetX:n,offsetY:r}}e.default=o,i.Util.registerShape("clen-queue-pointer",{draw(t,e){let n=t.id;const i=parseInt(n.split("-")[1]),u=parseInt(n.split("-")[2]),c=e.addShape("path",{attrs:{x:0,y:0,path:this.getPath(t),fill:t.style.fill},name:"pointer-path"}),l=i*Math.PI*2/u;if(t.label){const n=t.labelCfg&&t.labelCfg.style||{};e.addShape("rect",{attrs:{x:0,y:0,width:0,height:0,text:t.label,fill:null,radius:2},name:"bgRect"});let i=t.label.split("-")[0],o="front"==i?30:15;a(e.addShape("text",{attrs:{x:s(Math.PI/2-l,o).offsetX,y:s(Math.PI/2-l,o).offsetY,textAlign:"center",textBaseline:"middle",text:i,fill:n.fill||"#999",fontSize:n.fontSize||16},name:"pointer-text-shape"}),0,-75,r.default.Util.transform)}return o(c,l,r.default.Util.transform),a(c,0,-75,r.default.Util.transform),c},getPath:t=>[["M",0,0],["L",-.5,0],["L",-.5,-38],["L",-3,-38],["L",0,-49.4],["L",3,-38],["L",.5,-38],["L",.5,0],["Z"]]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("two-cell-node",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n/2,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"left-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};if(t.label)if(Array.isArray(t.label)){let i=t.label[0],a=t.label[1];e.addShape("text",{attrs:{x:n*(3/4),y:r,textAlign:"center",textBaseline:"middle",text:i,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n*(5/4),y:r,textAlign:"center",textBaseline:"middle",text:a,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0})}else e.addShape("text",{attrs:{x:n*(3/4),y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0});return console.log(t),t.id.includes("tableHeadNode")&&!t.headNext&&e.addShape("text",{attrs:{x:n*(5/4),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:20,cursor:t.style.cursor},name:"text",draggable:!0}),t.id.includes("head")&&!t.start&&e.addShape("text",{attrs:{x:n*(5/4),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:20,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[3/4,.5],[.5,1],[0,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(78);e.default=r.registerNode("three-cell",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n/3,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"left-rect",draggable:!0}),e.addShape("rect",{attrs:{x:n*(5/6),y:r/2,width:n/3,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"middle-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.root&&t.rootLabel&&(e.addShape("text",{attrs:{x:n*(2/3),y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[0],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n,y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[1],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n*(4/3),y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[2],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0})),null!==t.index&&e.addShape("text",{attrs:{x:.4*n,y:r,textAlign:"center",textBaseline:"middle",text:t.index,fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),t.label&&(e.addShape("text",{attrs:{x:n*(2/3),y:r,textAlign:"center",textBaseline:"middle",text:t.label[0],fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n,y:r,textAlign:"center",textBaseline:"middle",text:t.label[1],fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0})),t.headNext||e.addShape("text",{attrs:{x:n*(4/3),y:1.2*r,textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:25,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[5/6,.5],[.5,1],[0,.5]]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("array-node",{getAnchorPoints:()=>[[.5,0],[1,.5],[.5,1],[0,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("cursor",{draw(t,e){const n=e.addShape("path",{attrs:{path:this.getPath(t),fill:t.style.fill,matrix:t.style.matrix},name:"cursor-path"});if(t.label){const n=t.labelCfg&&t.labelCfg.style||{},r=e.addShape("rect",{attrs:{x:0,y:0,text:t.label,fill:"transparent",radius:2},name:"bgRect"}),i=e.addShape("text",{attrs:{x:0,y:0,textAlign:"center",textBaseline:"middle",text:t.label,fill:n.fill||"#999",fontSize:n.fontSize||16},name:"cursor-text-shape"}),{width:o,height:a}=i.getBBox();r.attr({width:o+6,height:a+6});const s=t.markerEndPosition;if(s){let t=s[0],e=s[1];i.attr({x:t,y:e}),r.attr({x:t-o/2-3,y:e-a/2-3})}}return n},getPath(t){let e=t.size[0],n=t.size[1];return[["M",0,0],["L",-e/2,-n],["L",e/2,-n],["L",0,0],["Z"]]}})}])})); \ No newline at end of file +var n;!function(n){!function(r){var i="object"==typeof e?e:"object"==typeof self?self:"object"==typeof this?this:Function("return this;")(),o=a(n);function a(t,e){return function(n,r){"function"!=typeof t[n]&&Object.defineProperty(t,n,{configurable:!0,writable:!0,value:r}),e&&e(n,r)}}void 0===i.Reflect?i.Reflect=n:o=a(i.Reflect,o),function(e){var n=Object.prototype.hasOwnProperty,r="function"==typeof Symbol,i=r&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",o=r&&void 0!==Symbol.iterator?Symbol.iterator:"@@iterator",a="function"==typeof Object.create,s={__proto__:[]}instanceof Array,u=!a&&!s,c={create:a?function(){return N(Object.create(null))}:s?function(){return N({__proto__:null})}:function(){return N({})},has:u?function(t,e){return n.call(t,e)}:function(t,e){return e in t},get:u?function(t,e){return n.call(t,e)?t[e]:void 0}:function(t,e){return t[e]}},l=Object.getPrototypeOf(Function),h="object"==typeof t&&t.env&&"true"===t.env.REFLECT_METADATA_USE_MAP_POLYFILL,f=h||"function"!=typeof Map||"function"!=typeof Map.prototype.entries?function(){var t={},e=[],n=function(){function t(t,e,n){this._index=0,this._keys=t,this._values=e,this._selector=n}return t.prototype["@@iterator"]=function(){return this},t.prototype[o]=function(){return this},t.prototype.next=function(){var t=this._index;if(t>=0&&t=this._keys.length?(this._index=-1,this._keys=e,this._values=e):this._index++,{value:n,done:!1}}return{value:void 0,done:!0}},t.prototype.throw=function(t){throw this._index>=0&&(this._index=-1,this._keys=e,this._values=e),t},t.prototype.return=function(t){return this._index>=0&&(this._index=-1,this._keys=e,this._values=e),{value:t,done:!0}},t}();return function(){function e(){this._keys=[],this._values=[],this._cacheKey=t,this._cacheIndex=-2}return Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),e.prototype.has=function(t){return this._find(t,!1)>=0},e.prototype.get=function(t){var e=this._find(t,!1);return e>=0?this._values[e]:void 0},e.prototype.set=function(t,e){var n=this._find(t,!0);return this._values[n]=e,this},e.prototype.delete=function(e){var n=this._find(e,!1);if(n>=0){for(var r=this._keys.length,i=n+1;i=0;--n){var r=(0,t[n])(e);if(!w(r)&&!_(r)){if(!k(r))throw new TypeError;e=r}}return e}(t,e)}if(!O(t))throw new TypeError;if(!S(e))throw new TypeError;if(!S(r)&&!w(r)&&!_(r))throw new TypeError;return _(r)&&(r=void 0),function(t,e,n,r){for(var i=t.length-1;i>=0;--i){var o=(0,t[i])(e,n,r);if(!w(o)&&!_(o)){if(!S(o))throw new TypeError;r=o}}return r}(t,e,n=M(n),r)})),e("metadata",(function(t,e){return function(n,r){if(!S(n))throw new TypeError;if(!w(r)&&!function(t){switch(x(t)){case 3:case 4:return!0;default:return!1}}(r))throw new TypeError;y(t,e,n,r)}})),e("defineMetadata",(function(t,e,n,r){if(!S(n))throw new TypeError;return w(r)||(r=M(r)),y(t,e,n,r)})),e("hasMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),function t(e,n,r){if(v(e,n,r))return!0;var i=P(n);return!_(i)&&t(e,i,r)}(t,e,n)})),e("hasOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),v(t,e,n)})),e("getMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),function t(e,n,r){if(v(e,n,r))return m(e,n,r);var i=P(n);return _(i)?void 0:t(e,i,r)}(t,e,n)})),e("getOwnMetadata",(function(t,e,n){if(!S(e))throw new TypeError;return w(n)||(n=M(n)),m(t,e,n)})),e("getMetadataKeys",(function(t,e){if(!S(t))throw new TypeError;return w(e)||(e=M(e)),function t(e,n){var r=b(e,n),i=P(e);if(null===i)return r;var o=t(i,n);if(o.length<=0)return r;if(r.length<=0)return o;for(var a=new d,s=[],u=0,c=r;u0)return!0;var i=p.get(e);return i.delete(n),i.size>0||p.delete(e),!0}))}(o)}()}(n||(n={}))}).call(this,n(178),n(188))},function(t,e,n){var r=n(242);t.exports=function(t,e){if(t){if("string"==typeof t)return r(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?r(t,e):void 0}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);no[0]&&(o[0]=s),u>o[1]&&(o[1]=u),c>o[2]&&(o[2]=c)}return e.setMinMax(n,o),e}},function(t,e,n){"use strict";n.d(e,"a",(function(){return r}));var r="undefined"!=typeof navigator&&/Version\/[\d\.]+.*Safari/.test(navigator.userAgent)},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e,n){"use strict";var r;!function(t){t.Normal="normal",t.PostProcessing="post-processing"}(r||(r={}))},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){},function(t,e){t.exports=1e-6},function(t,e){t.exports=function(){var t=new Float32Array(2);return t[0]=0,t[1]=0,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e,t[1]=n,t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]+n[0],t[1]=e[1]+n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]*n[0],t[1]=e[1]*n[1],t}},function(t,e){t.exports=function(t,e,n){return t[0]=e[0]/n[0],t[1]=e[1]/n[1],t}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return Math.sqrt(n*n+r*r)}},function(t,e){t.exports=function(t,e){var n=e[0]-t[0],r=e[1]-t[1];return n*n+r*r}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return Math.sqrt(e*e+n*n)}},function(t,e){t.exports=function(t){var e=t[0],n=t[1];return e*e+n*n}},function(t,e){t.exports=function(t,e){var n=e[0],r=e[1],i=n*n+r*r;i>0&&(i=1/Math.sqrt(i),t[0]=e[0]*i,t[1]=e[1]*i);return t}},function(t,e){t.exports=function(t,e){return t[0]*e[0]+t[1]*e[1]}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SVMarker=e.SVIndexLabel=e.SVAddressLabel=e.SVFreedLabel=e.SVNodeAppendage=void 0;const r=n(33),i=n(148);class o extends i.SVModel{constructor(t,e,n,r,i,o){super(t,e,n,r,i),this.target=o,this.target.appendages.push(this)}}e.SVNodeAppendage=o;e.SVFreedLabel=class extends o{constructor(t,e,n,r,i){super(t,e,n,r,"freedLabel",i),this.target.freedLabel=this,this.G6ModelProps=this.generateG6ModelProps()}generateG6ModelProps(){return{id:this.id,x:0,y:0,type:"rect",label:"已释放",labelCfg:{style:{fill:"#b83b5e",opacity:.6}},size:[0,0],style:{opacity:0,stroke:null,fill:"transparent"}}}};e.SVAddressLabel=class extends o{constructor(t,e,n,r,i,o){super(t,e,n,r,"addressLabel",i),this.sourceId=i.sourceId,this.target.addressLabel=this,this.G6ModelProps=this.generateG6ModelProps(o)}generateG6ModelProps(t){return{id:this.id,x:0,y:0,type:"rect",label:this.sourceId,labelCfg:{style:Object.assign({fill:"#666",fontSize:16},t.style)},size:[0,0],style:{stroke:null,fill:"transparent"}}}};e.SVIndexLabel=class extends o{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"indexLabel",o),this.target.indexLabel=this,this.value=i,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){return{id:this.id,x:0,y:0,type:"rect",label:this.value,labelCfg:{style:Object.assign({fill:"#bbb",textAlign:"center",textBaseline:"middle",fontSize:14,fontStyle:"italic"},t.style)},size:[0,0],style:{stroke:null,fill:"transparent"}}}};e.SVMarker=class extends o{constructor(t,e,n,r,i,o,a){super(t,e,n,r,"marker",o),this.label=i,this.target.marker=this,this.G6ModelProps=this.generateG6ModelProps(a)}generateG6ModelProps(t){this.anchor=t.anchor;const e="pointer"===t.type?[8,30]:[12,12];return{id:this.id,x:0,y:0,rotation:0,type:t.type||"marker",size:t.size||e,anchorPoints:null,label:"string"==typeof this.label?this.label:this.label.join(", "),style:r.Util.objectClone(t.style),labelCfg:r.Util.objectClone(t.labelOptions)}}getLabelSizeRadius(){const{width:t,height:e}=this.shadowG6Item.getContainer().getChildren()[2].getBBox();return Math.max(t,e)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SolveZoomCanvasWithLeak=e.SolveDragCanvasWithLeak=e.SolveBrushSelectDrag=e.SolveNodeAppendagesDrag=e.DetermineNodeDrag=void 0;const r=n(119),i=n(118);e.DetermineNodeDrag=function(t,e,n){var r;const i=t.get(e.group),o=null===(r=i.options.behavior)||void 0===r?void 0:r.dragNode;if(function(t,e){const n=t.sourceType;return Array.isArray(e)?e.includes(n):void 0===e||!0===e}(e,o))return!0;const a=e.sourceType,s=e.getModelType(),u=i[s].filter(t=>t.sourceType===a),c=n.filter(t=>t.group===e.group&&t.getModelType()===s&&t.sourceType===a);return u.length===c.length},e.SolveNodeAppendagesDrag=function(t){const e=t.getG6Instance();e.on("node:dragstart",e=>{let n=e.item.SVModel;if(n instanceof i.SVNode==!1)return;void 0===t.brushSelectedModels.find(t=>t.id===n.id)&&(t.brushSelectedModels.forEach(t=>{t.setSelectedState(!1),t instanceof i.SVNode&&t.appendages.forEach(t=>t.setSelectedState(!1))}),t.brushSelectedModels.length=0)}),e.on("node:dragend",e=>{let n=e.item.SVModel;if(n instanceof i.SVNode==!1)return;void 0===t.brushSelectedModels.find(t=>t.id===n.id)&&(n.setSelectedState(!1),n.set({x:n.G6Item.getModel().x,y:n.G6Item.getModel().y}),n.appendages.forEach(t=>{t.setSelectedState(!1),t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y})})),t.brushSelectedModels.forEach(t=>{t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y}),t instanceof i.SVNode&&t.appendages.forEach(t=>{t.set({x:t.G6Item.getModel().x,y:t.G6Item.getModel().y})})})})},e.SolveBrushSelectDrag=function(t){t.getG6Instance().on("nodeselectchange",n=>{const r=n.selectedItems,i=[];n.target||(t.brushSelectedModels.length=0,r.nodes.forEach(t=>{i.push(t.SVModel)}),r.nodes.forEach(n=>{const r=n.SVModel;e.DetermineNodeDrag(t.getLayoutGroupTable(),r,i)?t.brushSelectedModels.push(r):r.setSelectedState(!1)}))})},e.SolveDragCanvasWithLeak=function(t){let e=t.getG6Instance(),n=0;e.on("viewportchange",e=>{if("translate"!==e.action)return!1;let i=e.matrix[7],o=i-n;n=i,t.leakAreaY=t.leakAreaY+o,t.hasLeak&&r.EventBus.emit("onLeakAreaUpdate",{leakAreaY:t.leakAreaY,hasLeak:t.hasLeak})})},e.SolveZoomCanvasWithLeak=function(t){}},function(t,e,n){"use strict";var r={};n.r(r),n.d(r,"easeLinear",(function(){return O})),n.d(r,"easeQuad",(function(){return C})),n.d(r,"easeQuadIn",(function(){return A})),n.d(r,"easeQuadOut",(function(){return k})),n.d(r,"easeQuadInOut",(function(){return C})),n.d(r,"easeCubic",(function(){return P})),n.d(r,"easeCubicIn",(function(){return T})),n.d(r,"easeCubicOut",(function(){return I})),n.d(r,"easeCubicInOut",(function(){return P})),n.d(r,"easePoly",(function(){return D})),n.d(r,"easePolyIn",(function(){return N})),n.d(r,"easePolyOut",(function(){return j})),n.d(r,"easePolyInOut",(function(){return D})),n.d(r,"easeSin",(function(){return F})),n.d(r,"easeSinIn",(function(){return B})),n.d(r,"easeSinOut",(function(){return G})),n.d(r,"easeSinInOut",(function(){return F})),n.d(r,"easeExp",(function(){return W})),n.d(r,"easeExpIn",(function(){return U})),n.d(r,"easeExpOut",(function(){return V})),n.d(r,"easeExpInOut",(function(){return W})),n.d(r,"easeCircle",(function(){return H})),n.d(r,"easeCircleIn",(function(){return Y})),n.d(r,"easeCircleOut",(function(){return X})),n.d(r,"easeCircleInOut",(function(){return H})),n.d(r,"easeBounce",(function(){return Z})),n.d(r,"easeBounceIn",(function(){return K})),n.d(r,"easeBounceOut",(function(){return Z})),n.d(r,"easeBounceInOut",(function(){return $})),n.d(r,"easeBack",(function(){return tt})),n.d(r,"easeBackIn",(function(){return Q})),n.d(r,"easeBackOut",(function(){return J})),n.d(r,"easeBackInOut",(function(){return tt})),n.d(r,"easeElastic",(function(){return rt})),n.d(r,"easeElasticIn",(function(){return nt})),n.d(r,"easeElasticOut",(function(){return rt})),n.d(r,"easeElasticInOut",(function(){return it}));var i,o,a=n(1),s=n(143),u=n(141),c=n(20),l=n(0),h=0,f=0,d=0,p=0,g=0,v=0,m="object"==typeof performance&&performance.now?performance:Date,y="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function b(){return g||(y(x),g=m.now()+v)}function x(){g=0}function w(){this._call=this._time=this._next=null}function _(t,e,n){var r=new w;return r.restart(t,e,n),r}function S(){g=(p=m.now())+v,h=f=0;try{!function(){b(),++h;for(var t,e=i;e;)(t=g-e._time)>=0&&e._call.call(null,t),e=e._next;--h}()}finally{h=0,function(){var t,e,n=i,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),t=n,n=n._next):(e=n._next,n._next=null,n=t?t._next=e:i=e);o=t,M(r)}(),g=0}}function E(){var t=m.now(),e=t-p;e>1e3&&(v-=e,p=t)}function M(t){h||(f&&(f=clearTimeout(f)),t-g>24?(t<1/0&&(f=setTimeout(S,t-m.now()-v)),d&&(d=clearInterval(d))):(d||(p=m.now(),d=setInterval(E,1e3)),h=1,y(S)))}function O(t){return+t}function A(t){return t*t}function k(t){return t*(2-t)}function C(t){return((t*=2)<=1?t*t:--t*(2-t)+1)/2}function T(t){return t*t*t}function I(t){return--t*t*t+1}function P(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}w.prototype=_.prototype={constructor:w,restart:function(t,e,n){if("function"!=typeof t)throw new TypeError("callback is not a function");n=(null==n?b():+n)+(null==e?0:+e),this._next||o===this||(o?o._next=this:i=this,o=this),this._call=t,this._time=n,M()},stop:function(){this._call&&(this._call=null,this._time=1/0,M())}};var N=function t(e){function n(t){return Math.pow(t,e)}return e=+e,n.exponent=t,n}(3),j=function t(e){function n(t){return 1-Math.pow(1-t,e)}return e=+e,n.exponent=t,n}(3),D=function t(e){function n(t){return((t*=2)<=1?Math.pow(t,e):2-Math.pow(2-t,e))/2}return e=+e,n.exponent=t,n}(3),L=Math.PI,R=L/2;function B(t){return 1==+t?1:1-Math.cos(t*R)}function G(t){return Math.sin(t*R)}function F(t){return(1-Math.cos(L*t))/2}function z(t){return 1.0009775171065494*(Math.pow(2,-10*t)-.0009765625)}function U(t){return z(1-+t)}function V(t){return 1-z(t)}function W(t){return((t*=2)<=1?z(1-t):2-z(t-1))/2}function Y(t){return 1-Math.sqrt(1-t*t)}function X(t){return Math.sqrt(1- --t*t)}function H(t){return((t*=2)<=1?1-Math.sqrt(1-t*t):Math.sqrt(1-(t-=2)*t)+1)/2}var q=7.5625;function K(t){return 1-Z(1-t)}function Z(t){return(t=+t)<4/11?q*t*t:t<8/11?q*(t-=6/11)*t+3/4:t<10/11?q*(t-=9/11)*t+15/16:q*(t-=21/22)*t+63/64}function $(t){return((t*=2)<=1?1-Z(1-t):Z(t-1)+1)/2}var Q=function t(e){function n(t){return(t=+t)*t*(e*(t-1)+t)}return e=+e,n.overshoot=t,n}(1.70158),J=function t(e){function n(t){return--t*t*((t+1)*e+t)+1}return e=+e,n.overshoot=t,n}(1.70158),tt=function t(e){function n(t){return((t*=2)<1?t*t*((e+1)*t-e):(t-=2)*t*((e+1)*t+e)+2)/2}return e=+e,n.overshoot=t,n}(1.70158),et=2*Math.PI,nt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return e*z(- --t)*Math.sin((r-t)/n)}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),rt=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return 1-e*z(t=+t)*Math.sin((t+r)/n)}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),it=function t(e,n){var r=Math.asin(1/(e=Math.max(1,e)))*(n/=et);function i(t){return((t=2*t-1)<0?e*z(-t)*Math.sin((r-t)/n):2-e*z(t)*Math.sin((r+t)/n))/2}return i.amplitude=function(e){return t(e,n*et)},i.period=function(n){return t(e,n)},i}(1,.3),ot=function(t,e,n){t.prototype=e.prototype=n,n.constructor=t};function at(t,e){var n=Object.create(t.prototype);for(var r in e)n[r]=e[r];return n}function st(){}var ut="\\s*([+-]?\\d+)\\s*",ct="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)\\s*",lt="\\s*([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)%\\s*",ht=/^#([0-9a-f]{3,8})$/,ft=new RegExp("^rgb\\("+[ut,ut,ut]+"\\)$"),dt=new RegExp("^rgb\\("+[lt,lt,lt]+"\\)$"),pt=new RegExp("^rgba\\("+[ut,ut,ut,ct]+"\\)$"),gt=new RegExp("^rgba\\("+[lt,lt,lt,ct]+"\\)$"),vt=new RegExp("^hsl\\("+[ct,lt,lt]+"\\)$"),mt=new RegExp("^hsla\\("+[ct,lt,lt,ct]+"\\)$"),yt={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function bt(){return this.rgb().formatHex()}function xt(){return this.rgb().formatRgb()}function wt(t){var e,n;return t=(t+"").trim().toLowerCase(),(e=ht.exec(t))?(n=e[1].length,e=parseInt(e[1],16),6===n?_t(e):3===n?new Ot(e>>8&15|e>>4&240,e>>4&15|240&e,(15&e)<<4|15&e,1):8===n?St(e>>24&255,e>>16&255,e>>8&255,(255&e)/255):4===n?St(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|240&e,((15&e)<<4|15&e)/255):null):(e=ft.exec(t))?new Ot(e[1],e[2],e[3],1):(e=dt.exec(t))?new Ot(255*e[1]/100,255*e[2]/100,255*e[3]/100,1):(e=pt.exec(t))?St(e[1],e[2],e[3],e[4]):(e=gt.exec(t))?St(255*e[1]/100,255*e[2]/100,255*e[3]/100,e[4]):(e=vt.exec(t))?Tt(e[1],e[2]/100,e[3]/100,1):(e=mt.exec(t))?Tt(e[1],e[2]/100,e[3]/100,e[4]):yt.hasOwnProperty(t)?_t(yt[t]):"transparent"===t?new Ot(NaN,NaN,NaN,0):null}function _t(t){return new Ot(t>>16&255,t>>8&255,255&t,1)}function St(t,e,n,r){return r<=0&&(t=e=n=NaN),new Ot(t,e,n,r)}function Et(t){return t instanceof st||(t=wt(t)),t?new Ot((t=t.rgb()).r,t.g,t.b,t.opacity):new Ot}function Mt(t,e,n,r){return 1===arguments.length?Et(t):new Ot(t,e,n,null==r?1:r)}function Ot(t,e,n,r){this.r=+t,this.g=+e,this.b=+n,this.opacity=+r}function At(){return"#"+Ct(this.r)+Ct(this.g)+Ct(this.b)}function kt(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"rgb(":"rgba(")+Math.max(0,Math.min(255,Math.round(this.r)||0))+", "+Math.max(0,Math.min(255,Math.round(this.g)||0))+", "+Math.max(0,Math.min(255,Math.round(this.b)||0))+(1===t?")":", "+t+")")}function Ct(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function Tt(t,e,n,r){return r<=0?t=e=n=NaN:n<=0||n>=1?t=e=NaN:e<=0&&(t=NaN),new Pt(t,e,n,r)}function It(t){if(t instanceof Pt)return new Pt(t.h,t.s,t.l,t.opacity);if(t instanceof st||(t=wt(t)),!t)return new Pt;if(t instanceof Pt)return t;var e=(t=t.rgb()).r/255,n=t.g/255,r=t.b/255,i=Math.min(e,n,r),o=Math.max(e,n,r),a=NaN,s=o-i,u=(o+i)/2;return s?(a=e===o?(n-r)/s+6*(n0&&u<1?0:a,new Pt(a,s,u,t.opacity)}function Pt(t,e,n,r){this.h=+t,this.s=+e,this.l=+n,this.opacity=+r}function Nt(t,e,n){return 255*(t<60?e+(n-e)*t/60:t<180?n:t<240?e+(n-e)*(240-t)/60:e)}function jt(t,e,n,r,i){var o=t*t,a=o*t;return((1-3*t+3*o-a)*e+(4-6*o+3*a)*n+(1+3*t+3*o-3*a)*r+a*i)/6}ot(st,wt,{copy:function(t){return Object.assign(new this.constructor,this,t)},displayable:function(){return this.rgb().displayable()},hex:bt,formatHex:bt,formatHsl:function(){return It(this).formatHsl()},formatRgb:xt,toString:xt}),ot(Ot,Mt,at(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Ot(this.r*t,this.g*t,this.b*t,this.opacity)},rgb:function(){return this},displayable:function(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:At,formatHex:At,formatRgb:kt,toString:kt})),ot(Pt,(function(t,e,n,r){return 1===arguments.length?It(t):new Pt(t,e,n,null==r?1:r)}),at(st,{brighter:function(t){return t=null==t?1/.7:Math.pow(1/.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},darker:function(t){return t=null==t?.7:Math.pow(.7,t),new Pt(this.h,this.s,this.l*t,this.opacity)},rgb:function(){var t=this.h%360+360*(this.h<0),e=isNaN(t)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*e,i=2*n-r;return new Ot(Nt(t>=240?t-240:t+120,i,r),Nt(t,i,r),Nt(t<120?t+240:t-120,i,r),this.opacity)},displayable:function(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl:function(){var t=this.opacity;return(1===(t=isNaN(t)?1:Math.max(0,Math.min(1,t)))?"hsl(":"hsla(")+(this.h||0)+", "+100*(this.s||0)+"%, "+100*(this.l||0)+"%"+(1===t?")":", "+t+")")}}));var Dt=function(t){return function(){return t}};function Lt(t,e){return function(n){return t+n*e}}function Rt(t){return 1==(t=+t)?Bt:function(e,n){return n-e?function(t,e,n){return t=Math.pow(t,n),e=Math.pow(e,n)-t,n=1/n,function(r){return Math.pow(t+r*e,n)}}(e,n,t):Dt(isNaN(e)?n:e)}}function Bt(t,e){var n=e-t;return n?Lt(t,n):Dt(isNaN(t)?e:t)}var Gt=function t(e){var n=Rt(e);function r(t,e){var r=n((t=Mt(t)).r,(e=Mt(e)).r),i=n(t.g,e.g),o=n(t.b,e.b),a=Bt(t.opacity,e.opacity);return function(e){return t.r=r(e),t.g=i(e),t.b=o(e),t.opacity=a(e),t+""}}return r.gamma=t,r}(1);function Ft(t){return function(e){var n,r,i=e.length,o=new Array(i),a=new Array(i),s=new Array(i);for(n=0;n=1?(n=1,e-1):Math.floor(n*e),i=t[r],o=t[r+1],a=r>0?t[r-1]:2*i-o,s=ro&&(i=e.slice(o,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,u.push({i:a,x:Yt(n,r)})),o=qt.lastIndex;return od.length?(f=$t.parsePathString(o[h]),d=$t.parsePathString(i[h]),d=$t.fillPathByDiff(d,f),d=$t.formatPath(d,f),e.fromAttrs.path=d,e.toAttrs.path=f):e.pathFormatted||(f=$t.parsePathString(o[h]),d=$t.parsePathString(i[h]),d=$t.formatPath(d,f),e.fromAttrs.path=d,e.toAttrs.path=f,e.pathFormatted=!0),r[h]=[];for(var p=0;p0){for(var o=r.animators.length-1;o>=0;o--)if((t=r.animators[o]).destroyed)r.removeAnimator(o);else{if(!t.isAnimatePaused())for(var a=(e=t.get("animations")).length-1;a>=0;a--)n=e[a],Jt(t,n,i)&&(e.splice(a,1),!1,n.callback&&n.callback());0===e.length&&r.removeAnimator(o)}r.canvas.get("autoDraw")||r.canvas.draw()}}))},t.prototype.addAnimator=function(t){this.animators.push(t)},t.prototype.removeAnimator=function(t){this.animators.splice(t,1)},t.prototype.isAnimating=function(){return!!this.animators.length},t.prototype.stop=function(){this.timer&&this.timer.stop()},t.prototype.stopAllAnimations=function(t){void 0===t&&(t=!0),this.animators.forEach((function(e){e.stopAnimate(t)})),this.animators=[],this.canvas.draw()},t.prototype.getTime=function(){return this.current},t}(),ee=n(120),ne=["mousedown","mouseup","dblclick","mouseout","mouseover","mousemove","mouseleave","mouseenter","touchstart","touchmove","touchend","dragenter","dragover","dragleave","drop","contextmenu","mousewheel"];function re(t,e,n){n.name=e,n.target=t,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}function ie(t,e,n){if(n.bubbles){var r=void 0,i=!1;if("mouseenter"===e?(r=n.fromShape,i=!0):"mouseleave"===e&&(i=!0,r=n.toShape),t.isCanvas()&&i)return;if(r&&Object(c.g)(t,r))return void(n.bubbles=!1);n.name=e,n.currentTarget=t,n.delegateTarget=t,t.emit(e,n)}}var oe=function(){function t(t){var e=this;this.draggingShape=null,this.dragging=!1,this.currentShape=null,this.mousedownShape=null,this.mousedownPoint=null,this._eventCallback=function(t){var n=t.type;e._triggerEvent(n,t)},this._onDocumentMove=function(t){if(e.canvas.get("el")!==t.target&&(e.dragging||e.currentShape)){var n=e._getPointInfo(t);e.dragging&&e._emitEvent("drag",t,n,e.draggingShape)}},this._onDocumentMouseUp=function(t){if(e.canvas.get("el")!==t.target&&e.dragging){var n=e._getPointInfo(t);e.draggingShape&&e._emitEvent("drop",t,n,null),e._emitEvent("dragend",t,n,e.draggingShape),e._afterDrag(e.draggingShape,n,t)}},this.canvas=t.canvas}return t.prototype.init=function(){this._bindEvents()},t.prototype._bindEvents=function(){var t=this,e=this.canvas.get("el");Object(c.a)(ne,(function(n){e.addEventListener(n,t._eventCallback)})),document&&(document.addEventListener("mousemove",this._onDocumentMove),document.addEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._clearEvents=function(){var t=this,e=this.canvas.get("el");Object(c.a)(ne,(function(n){e.removeEventListener(n,t._eventCallback)})),document&&(document.removeEventListener("mousemove",this._onDocumentMove),document.removeEventListener("mouseup",this._onDocumentMouseUp))},t.prototype._getEventObj=function(t,e,n,r,i,o){var a=new ee.a(t,e);return a.fromShape=i,a.toShape=o,a.x=n.x,a.y=n.y,a.clientX=n.clientX,a.clientY=n.clientY,a.propagationPath.push(r),a},t.prototype._getShape=function(t,e){return this.canvas.getShape(t.x,t.y,e)},t.prototype._getPointInfo=function(t){var e=this.canvas,n=e.getClientByEvent(t),r=e.getPointByEvent(t);return{x:r.x,y:r.y,clientX:n.x,clientY:n.y}},t.prototype._triggerEvent=function(t,e){var n=this._getPointInfo(e),r=this._getShape(n,e),i=this["_on"+t],o=!1;if(i)i.call(this,n,r,e);else{var a=this.currentShape;"mouseenter"===t||"dragenter"===t||"mouseover"===t?(this._emitEvent(t,e,n,null,null,r),r&&this._emitEvent(t,e,n,r,null,r),"mouseenter"===t&&this.draggingShape&&this._emitEvent("dragenter",e,n,null)):"mouseleave"===t||"dragleave"===t||"mouseout"===t?(o=!0,a&&this._emitEvent(t,e,n,a,a,null),this._emitEvent(t,e,n,null,a,null),"mouseleave"===t&&this.draggingShape&&this._emitEvent("dragleave",e,n,null)):this._emitEvent(t,e,n,r,null,null)}if(o||(this.currentShape=r),r&&!r.get("destroyed")){var s=this.canvas;s.get("el").style.cursor=r.attr("cursor")||s.get("cursor")}},t.prototype._onmousedown=function(t,e,n){0===n.button&&(this.mousedownShape=e,this.mousedownPoint=t,this.mousedownTimeStamp=n.timeStamp),this._emitEvent("mousedown",n,t,e,null,null)},t.prototype._emitMouseoverEvents=function(t,e,n,r){var i=this.canvas.get("el");n!==r&&(n&&(this._emitEvent("mouseout",t,e,n,n,r),this._emitEvent("mouseleave",t,e,n,n,r),r&&!r.get("destroyed")||(i.style.cursor=this.canvas.get("cursor"))),r&&(this._emitEvent("mouseover",t,e,r,n,r),this._emitEvent("mouseenter",t,e,r,n,r)))},t.prototype._emitDragoverEvents=function(t,e,n,r,i){r?(r!==n&&(n&&this._emitEvent("dragleave",t,e,n,n,r),this._emitEvent("dragenter",t,e,r,n,r)),i||this._emitEvent("dragover",t,e,r)):n&&this._emitEvent("dragleave",t,e,n,n,r),i&&this._emitEvent("dragover",t,e,r)},t.prototype._afterDrag=function(t,e,n){t&&(t.set("capture",!0),this.draggingShape=null),this.dragging=!1;var r=this._getShape(e,n);r!==t&&this._emitMouseoverEvents(n,e,t,r),this.currentShape=r},t.prototype._onmouseup=function(t,e,n){if(0===n.button){var r=this.draggingShape;this.dragging?(r&&this._emitEvent("drop",n,t,e),this._emitEvent("dragend",n,t,r),this._afterDrag(r,t,n)):(this._emitEvent("mouseup",n,t,e),e===this.mousedownShape&&this._emitEvent("click",n,t,e),this.mousedownShape=null,this.mousedownPoint=null)}},t.prototype._ondragover=function(t,e,n){n.preventDefault();var r=this.currentShape;this._emitDragoverEvents(n,t,r,e,!0)},t.prototype._onmousemove=function(t,e,n){var r=this.canvas,i=this.currentShape,o=this.draggingShape;if(this.dragging)o&&this._emitDragoverEvents(n,t,i,e,!1),this._emitEvent("drag",n,t,o);else{var a=this.mousedownPoint;if(a){var s=this.mousedownShape,u=n.timeStamp-this.mousedownTimeStamp,c=a.clientX-t.clientX,l=a.clientY-t.clientY;u>120||c*c+l*l>40?s&&s.get("draggable")?((o=this.mousedownShape).set("capture",!1),this.draggingShape=o,this.dragging=!0,this._emitEvent("dragstart",n,t,o),this.mousedownShape=null,this.mousedownPoint=null):!s&&r.get("draggable")?(this.dragging=!0,this._emitEvent("dragstart",n,t,null),this.mousedownShape=null,this.mousedownPoint=null):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)):(this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e))}else this._emitMouseoverEvents(n,t,i,e),this._emitEvent("mousemove",n,t,e)}},t.prototype._emitEvent=function(t,e,n,r,i,o){var a=this._getEventObj(t,e,n,r,i,o);if(r){a.shape=r,re(r,t,a);for(var s=r.getParent();s;)s.emitDelegation(t,a),a.propagationStopped||ie(s,t,a),a.propagationPath.push(s),s=s.getParent()}else{re(this.canvas,t,a)}},t.prototype.destroy=function(){this._clearEvents(),this.canvas=null,this.currentShape=null,this.draggingShape=null,this.mousedownPoint=null,this.mousedownShape=null,this.mousedownTimeStamp=null},t}(),ae=Object(s.a)(),se=ae&&"firefox"===ae.name,ue=function(t){function e(e){var n=t.call(this,e)||this;return n.initContainer(),n.initDom(),n.initEvents(),n.initTimeline(),n}return Object(a.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.cursor="default",e.supportCSSTransform=!1,e},e.prototype.initContainer=function(){var t=this.get("container");Object(c.h)(t)&&(t=document.getElementById(t),this.set("container",t))},e.prototype.initDom=function(){var t=this.createDom();this.set("el",t),this.get("container").appendChild(t),this.setDOMSize(this.get("width"),this.get("height"))},e.prototype.initEvents=function(){var t=new oe({canvas:this});t.init(),this.set("eventController",t)},e.prototype.initTimeline=function(){var t=new te(this);this.set("timeline",t)},e.prototype.setDOMSize=function(t,e){var n=this.get("el");c.c&&(n.style.width=t+"px",n.style.height=e+"px")},e.prototype.changeSize=function(t,e){this.setDOMSize(t,e),this.set("width",t),this.set("height",e),this.onCanvasChange("changeSize")},e.prototype.getRenderer=function(){return this.get("renderer")},e.prototype.getCursor=function(){return this.get("cursor")},e.prototype.setCursor=function(t){this.set("cursor",t);var e=this.get("el");c.c&&e&&(e.style.cursor=t)},e.prototype.getPointByEvent=function(t){if(this.get("supportCSSTransform")){if(se&&!Object(c.e)(t.layerX)&&t.layerX!==t.offsetX)return{x:t.layerX,y:t.layerY};if(!Object(c.e)(t.offsetX))return{x:t.offsetX,y:t.offsetY}}var e=this.getClientByEvent(t),n=e.x,r=e.y;return this.getPointByClient(n,r)},e.prototype.getClientByEvent=function(t){var e=t;return t.touches&&(e="touchend"===t.type?t.changedTouches[0]:t.touches[0]),{x:e.clientX,y:e.clientY}},e.prototype.getPointByClient=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t-n.left,y:e-n.top}},e.prototype.getClientByPoint=function(t,e){var n=this.get("el").getBoundingClientRect();return{x:t+n.left,y:e+n.top}},e.prototype.draw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.parentNode.removeChild(t)},e.prototype.clearEvents=function(){this.get("eventController").destroy()},e.prototype.isCanvas=function(){return!0},e.prototype.getParent=function(){return null},e.prototype.destroy=function(){var e=this.get("timeline");this.get("destroyed")||(this.clear(),e&&e.stop(),this.clearEvents(),this.removeDom(),t.prototype.destroy.call(this))},e}(u.a);e.a=ue},function(t,e,n){"use strict";n.d(e,"a",(function(){return o}));var r=new Map;function i(t,e){r.set(t,e)}function o(t){return r.get(t)}var a=function(t){var e=t.attr();return{x:e.x,y:e.y,width:e.width,height:e.height}},s=function(t){var e=t.attr(),n=e.x,r=e.y,i=e.r;return{x:n-i,y:r-i,width:2*i,height:2*i}},u=n(21);function c(t,e){return t&&e?{minX:Math.min(t.minX,e.minX),minY:Math.min(t.minY,e.minY),maxX:Math.max(t.maxX,e.maxX),maxY:Math.max(t.maxY,e.maxY)}:t||e}function l(t,e){var n=t.get("startArrowShape"),r=t.get("endArrowShape");return n&&(e=c(e,n.getCanvasBBox())),r&&(e=c(e,r.getCanvasBBox())),e}var h=n(70),f=n(39),d=n(0);function p(t,e){var n=t.prePoint,r=t.currentPoint,i=t.nextPoint,o=Math.pow(r[0]-n[0],2)+Math.pow(r[1]-n[1],2),a=Math.pow(r[0]-i[0],2)+Math.pow(r[1]-i[1],2),s=Math.pow(n[0]-i[0],2)+Math.pow(n[1]-i[1],2),u=Math.acos((o+a-s)/(2*Math.sqrt(o)*Math.sqrt(a)));if(!u||0===Math.sin(u)||Object(d.isNumberEqual)(u,0))return{xExtra:0,yExtra:0};var c=Math.abs(Math.atan2(i[1]-r[1],i[0]-r[0])),l=Math.abs(Math.atan2(i[0]-r[0],i[1]-r[1]));return c=c>Math.PI/2?Math.PI-c:c,l=l>Math.PI/2?Math.PI-l:l,{xExtra:Math.cos(u/2-c)*(e/2*(1/Math.sin(u/2)))-e/2||0,yExtra:Math.cos(l-u/2)*(e/2*(1/Math.sin(u/2)))-e/2||0}}i("rect",a),i("image",a),i("circle",s),i("marker",s),i("polyline",(function(t){for(var e=t.attr().points,n=[],r=[],i=0;i'})),n}var v=function(){function t(t){this.cfg={};var e=null,n=Object(h.uniqueId)("gradient_");return"l"===t.toLowerCase()[0]?function(t,e){var n,r,i=f.exec(t),o=Object(h.mod)(Object(h.toRadian)(parseFloat(i[1])),2*Math.PI),a=i[2];o>=0&&o<.5*Math.PI?(n={x:0,y:0},r={x:1,y:1}):.5*Math.PI<=o&&o';e.innerHTML=n},t}(),x=function(){function t(t,e){this.cfg={};var n=Object(u.b)("marker"),r=Object(h.uniqueId)("marker_");n.setAttribute("id",r);var i=Object(u.b)("path");i.setAttribute("stroke",t.stroke||"none"),i.setAttribute("fill",t.fill||"none"),n.appendChild(i),n.setAttribute("overflow","visible"),n.setAttribute("orient","auto-start-reverse"),this.el=n,this.child=i,this.id=r;var o=t["marker-start"===e?"startArrow":"endArrow"];return this.stroke=t.stroke||"#000",!0===o?this._setDefaultPath(e,i):(this.cfg=o,this._setMarker(t.lineWidth,i)),this}return t.prototype.match=function(){return!1},t.prototype._setDefaultPath=function(t,e){var n=this.el;e.setAttribute("d","M0,0 L"+10*Math.cos(Math.PI/6)+",5 L0,10"),n.setAttribute("refX",""+10*Math.cos(Math.PI/6)),n.setAttribute("refY","5")},t.prototype._setMarker=function(t,e){var n=this.el,r=this.cfg.path,i=this.cfg.d;Object(h.isArray)(r)&&(r=r.map((function(t){return t.join(" ")})).join("")),e.setAttribute("d",r),n.appendChild(e),i&&n.setAttribute("refX",""+i/t)},t.prototype.update=function(t){var e=this.child;e.attr?e.attr("fill",t):e.setAttribute("fill",t)},t}(),w=function(){function t(t){this.type="clip",this.cfg={};var e=Object(u.b)("clipPath");this.el=e,this.id=Object(h.uniqueId)("clip_"),e.id=this.id;var n=t.cfg.el;return e.appendChild(n),this.cfg=t,this}return t.prototype.match=function(){return!1},t.prototype.remove=function(){var t=this.el;t.parentNode.removeChild(t)},t}(),_=/^p\s*\(\s*([axyn])\s*\)\s*(.*)/i,S=function(){function t(t){this.cfg={};var e=Object(u.b)("pattern");e.setAttribute("patternUnits","userSpaceOnUse");var n=Object(u.b)("image");e.appendChild(n);var r=Object(h.uniqueId)("pattern_");e.id=r,this.el=e,this.id=r,this.cfg=t;var i=_.exec(t)[2];n.setAttribute("href",i);var o=new Image;function a(){e.setAttribute("width",""+o.width),e.setAttribute("height",""+o.height)}return i.match(/^data:/i)||(o.crossOrigin="Anonymous"),o.src=i,o.complete?a():(o.onload=a,o.src=o.src),this}return t.prototype.match=function(t,e){return this.cfg===e},t}(),E=function(){function t(t){var e=Object(u.b)("defs"),n=Object(h.uniqueId)("defs_");e.id=n,t.appendChild(e),this.children=[],this.defaultArrow={},this.el=e,this.canvas=t}return t.prototype.find=function(t,e){for(var n=this.children,r=null,i=0;i=u.minX&&e<=u.maxX&&n>=u.minY&&n<=u.maxY}var s=n(57),u=n(79),c=n(17),l=n(31),h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return Object(r.__extends)(e,t),e.prototype.getDefaultCfg=function(){var e=t.prototype.getDefaultCfg.call(this);return e.renderer="canvas",e.autoDraw=!0,e.localRefresh=!0,e.refreshElements=[],e.clipView=!0,e.quickHit=!1,e},e.prototype.onCanvasChange=function(t){"attr"!==t&&"sort"!==t&&"changeSize"!==t||(this.set("refreshElements",[this]),this.draw())},e.prototype.getShapeBase=function(){return s},e.prototype.getGroupBase=function(){return u.a},e.prototype.getPixelRatio=function(){var t=this.get("pixelRatio")||Object(c.d)();return t>=1?Math.ceil(t):1},e.prototype.getViewRange=function(){return{minX:0,minY:0,maxX:this.cfg.width,maxY:this.cfg.height}},e.prototype.createDom=function(){var t=document.createElement("canvas"),e=t.getContext("2d");return this.set("context",e),t},e.prototype.setDOMSize=function(e,n){t.prototype.setDOMSize.call(this,e,n);var r=this.get("context"),i=this.get("el"),o=this.getPixelRatio();i.width=o*e,i.height=o*n,o>1&&r.scale(o,o)},e.prototype.clear=function(){t.prototype.clear.call(this),this._clearFrame();var e=this.get("context"),n=this.get("el");e.clearRect(0,0,n.width,n.height)},e.prototype.getShape=function(e,n){return this.get("quickHit")?function t(e,n,r){if(!a(e,n,r))return null;for(var i=null,s=e.getChildren(),u=s.length-1;u>=0;u--){var c=s[u];if(c.isGroup())i=t(c,n,r);else if(a(c,n,r)){var l=c,h=o(c,n,r),f=h[0],d=h[1];l.isInShape(f,d)&&(i=c)}if(i)break}return i}(this,e,n):t.prototype.getShape.call(this,e,n,null)},e.prototype._getRefreshRegion=function(){var t,e=this.get("refreshElements"),n=this.getViewRange();e.length&&e[0]===this?t=n:(t=Object(l.f)(e))&&(t.minX=Math.floor(t.minX),t.minY=Math.floor(t.minY),t.maxX=Math.ceil(t.maxX),t.maxY=Math.ceil(t.maxY),t.maxY+=1,this.get("clipView")&&(t=Object(l.g)(t,n)));return t},e.prototype.refreshElement=function(t){this.get("refreshElements").push(t)},e.prototype._clearFrame=function(){var t=this.get("drawFrame");t&&(Object(c.a)(t),this.set("drawFrame",null),this.set("refreshElements",[]))},e.prototype.draw=function(){var t=this.get("drawFrame");this.get("autoDraw")&&t||this._startDraw()},e.prototype._drawAll=function(){var t=this.get("context"),e=this.get("el"),n=this.getChildren();t.clearRect(0,0,e.width,e.height),Object(l.a)(t,this),Object(l.d)(t,n),this.set("refreshElements",[])},e.prototype._drawRegion=function(){var t=this.get("context"),e=this.get("refreshElements"),n=this.getChildren(),r=this._getRefreshRegion();r?(t.clearRect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.save(),t.beginPath(),t.rect(r.minX,r.minY,r.maxX-r.minX,r.maxY-r.minY),t.clip(),Object(l.a)(t,this),Object(l.b)(this,n,r),Object(l.d)(t,n,r),t.restore()):e.length&&Object(l.c)(e),Object(c.c)(e,(function(t){t.get("hasChanged")&&t.set("hasChanged",!1)})),this.set("refreshElements",[])},e.prototype._startDraw=function(){var t=this,e=this.get("drawFrame");e||(e=Object(c.n)((function(){t.get("localRefresh")?t._drawRegion():t._drawAll(),t.set("drawFrame",null)})),this.set("drawFrame",e))},e.prototype.skipDraw=function(){},e.prototype.removeDom=function(){var t=this.get("el");t.width=0,t.height=0,t.parentNode.removeChild(t)},e}(i.AbstractCanvas);e.a=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"getAdjMatrixAsync",{enumerable:!0,get:function(){return r.getAdjMatrixAsync}}),Object.defineProperty(e,"connectedComponentAsync",{enumerable:!0,get:function(){return r.connectedComponentAsync}}),Object.defineProperty(e,"getDegreeAsync",{enumerable:!0,get:function(){return r.getDegreeAsync}}),Object.defineProperty(e,"getInDegreeAsync",{enumerable:!0,get:function(){return r.getInDegreeAsync}}),Object.defineProperty(e,"getOutDegreeAsync",{enumerable:!0,get:function(){return r.getOutDegreeAsync}}),Object.defineProperty(e,"detectCycleAsync",{enumerable:!0,get:function(){return r.detectCycleAsync}}),Object.defineProperty(e,"detectAllCyclesAsync",{enumerable:!0,get:function(){return r.detectAllCyclesAsync}}),Object.defineProperty(e,"detectAllDirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllDirectedCycleAsync}}),Object.defineProperty(e,"detectAllUndirectedCycleAsync",{enumerable:!0,get:function(){return r.detectAllUndirectedCycleAsync}}),Object.defineProperty(e,"dijkstraAsync",{enumerable:!0,get:function(){return r.dijkstraAsync}}),Object.defineProperty(e,"findAllPathAsync",{enumerable:!0,get:function(){return r.findAllPathAsync}}),Object.defineProperty(e,"findShortestPathAsync",{enumerable:!0,get:function(){return r.findShortestPathAsync}}),Object.defineProperty(e,"floydWarshallAsync",{enumerable:!0,get:function(){return r.floydWarshallAsync}}),Object.defineProperty(e,"labelPropagationAsync",{enumerable:!0,get:function(){return r.labelPropagationAsync}}),Object.defineProperty(e,"louvainAsync",{enumerable:!0,get:function(){return r.louvainAsync}}),Object.defineProperty(e,"minimumSpanningTreeAsync",{enumerable:!0,get:function(){return r.minimumSpanningTreeAsync}}),Object.defineProperty(e,"pageRankAsync",{enumerable:!0,get:function(){return r.pageRankAsync}}),Object.defineProperty(e,"getNeighborsAsync",{enumerable:!0,get:function(){return r.getNeighborsAsync}}),Object.defineProperty(e,"GADDIAsync",{enumerable:!0,get:function(){return r.GADDIAsync}}),e.default=e.detectDirectedCycleAsync=void 0;var r=n(297),i=r.detectCycleAsync;e.detectDirectedCycleAsync=i;var o={getAdjMatrixAsync:r.getAdjMatrixAsync,connectedComponentAsync:r.connectedComponentAsync,getDegreeAsync:r.getDegreeAsync,getInDegreeAsync:r.getInDegreeAsync,getOutDegreeAsync:r.getOutDegreeAsync,detectCycleAsync:r.detectCycleAsync,detectDirectedCycleAsync:i,detectAllCyclesAsync:r.detectAllCyclesAsync,detectAllDirectedCycleAsync:r.detectAllDirectedCycleAsync,detectAllUndirectedCycleAsync:r.detectAllUndirectedCycleAsync,dijkstraAsync:r.dijkstraAsync,findAllPathAsync:r.findAllPathAsync,findShortestPathAsync:r.findShortestPathAsync,floydWarshallAsync:r.floydWarshallAsync,labelPropagationAsync:r.labelPropagationAsync,louvainAsync:r.louvainAsync,minimumSpanningTreeAsync:r.minimumSpanningTreeAsync,pageRankAsync:r.pageRankAsync,getNeighborsAsync:r.getNeighborsAsync,GADDIAsync:r.GADDIAsync};e.default=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(530);e.default=function(t,e){return void 0===e&&(e=!0),{lazyInject:r.makePropertyInjectDecorator(t,e),lazyInjectNamed:r.makePropertyInjectNamedDecorator(t,e),lazyInjectTagged:r.makePropertyInjectTaggedDecorator(t,e),lazyMultiInject:r.makePropertyMultiInjectDecorator(t,e)}}},function(t,e,n){t.exports=function(){"use strict";var t=function(t){return t instanceof Uint8Array||t instanceof Uint16Array||t instanceof Uint32Array||t instanceof Int8Array||t instanceof Int16Array||t instanceof Int32Array||t instanceof Float32Array||t instanceof Float64Array||t instanceof Uint8ClampedArray},e=function(t,e){for(var n=Object.keys(e),r=0;r=0&&(0|t)===t||n("invalid parameter type, ("+t+")"+i(e)+". must be a nonnegative integer")},oneOf:a,shaderError:function(t,e,n,i,o){if(!t.getShaderParameter(e,t.COMPILE_STATUS)){var a=t.getShaderInfoLog(e),s=i===t.FRAGMENT_SHADER?"fragment":"vertex";m(n,"string",s+" shader source must be a string",o);var c=p(n,o),l=function(t){var e=[];return t.split("\n").forEach((function(t){if(!(t.length<5)){var n=/^ERROR:\s+(\d+):(\d+):\s*(.*)$/.exec(t);n?e.push(new h(0|n[1],0|n[2],n[3].trim())):t.length>0&&e.push(new h("unknown",0,t))}})),e}(a);!function(t,e){e.forEach((function(e){var n=t[e.file];if(n){var r=n.index[e.line];if(r)return r.errors.push(e),void(n.hasErrors=!0)}t.unknown.hasErrors=!0,t.unknown.lines[0].errors.push(e)}))}(c,l),Object.keys(c).forEach((function(t){var e=c[t];if(e.hasErrors){var n=[""],r=[""];i("file number "+t+": "+e.name+"\n","color:red;text-decoration:underline;font-weight:bold"),e.lines.forEach((function(t){if(t.errors.length>0){i(u(t.number,4)+"| ","background-color:yellow; font-weight:bold"),i(t.line+"\n","color:red; background-color:yellow; font-weight:bold");var e=0;t.errors.forEach((function(n){var r=n.message,o=/^\s*'(.*)'\s*:\s*(.*)$/.exec(r);if(o){var a=o[1];switch(r=o[2],a){case"assign":a="="}e=Math.max(t.line.indexOf(a,e),0)}else e=0;i(u("| ",6)),i(u("^^^",e+3)+"\n","font-weight:bold"),i(u("| ",6)),i(r+"\n","font-weight:bold")})),i(u("| ",6)+"\n")}else i(u(t.number,4)+"| "),i(t.line+"\n","color:red")})),"undefined"==typeof document||window.chrome?console.log(n.join("")):(r[0]=n.join("%c"),console.log.apply(console,r))}function i(t,e){n.push(t),r.push(e||"")}})),r.raise("Error compiling "+s+" shader, "+c[0].name)}},linkError:function(t,e,n,i,o){if(!t.getProgramParameter(e,t.LINK_STATUS)){var a=t.getProgramInfoLog(e),s=p(n,o),u='Error linking program with vertex shader, "'+p(i,o)[0].name+'", and fragment shader "'+s[0].name+'"';"undefined"!=typeof document?console.log("%c"+u+"\n%c"+a,"color:red;text-decoration:underline;font-weight:bold","color:red"):console.log(u+"\n"+a),r.raise(u)}},callSite:d,saveCommandRef:g,saveDrawInfo:function(t,e,n,r){function i(t){return t?r.id(t):0}function o(t,e){Object.keys(e).forEach((function(e){t[r.id(e)]=!0}))}g(t),t._fragId=i(t.static.frag),t._vertId=i(t.static.vert);var a=t._uniformSet={};o(a,e.static),o(a,e.dynamic);var s=t._attributeSet={};o(s,n.static),o(s,n.dynamic),t._hasCount="count"in t.static||"count"in t.dynamic||"elements"in t.static||"elements"in t.dynamic},framebufferFormat:function(t,e,n){t.texture?a(t.texture._texture.internalformat,e,"unsupported texture format for attachment"):a(t.renderbuffer._renderbuffer.format,n,"unsupported renderbuffer format for attachment")},guessCommand:f,texture2D:function(t,e,n){var i,o=e.width,a=e.height,s=e.channels;r(o>0&&o<=n.maxTextureSize&&a>0&&a<=n.maxTextureSize,"invalid texture shape"),33071===t.wrapS&&33071===t.wrapT||r(x(o)&&x(a),"incompatible wrap mode for texture, both width and height must be power of 2"),1===e.mipmask?1!==o&&1!==a&&r(9984!==t.minFilter&&9986!==t.minFilter&&9985!==t.minFilter&&9987!==t.minFilter,"min filter requires mipmap"):(r(x(o)&&x(a),"texture must be a square power of 2 to support mipmapping"),r(e.mipmask===(o<<1)-1,"missing or incomplete mipmap data")),5126===e.type&&(n.extensions.indexOf("oes_texture_float_linear")<0&&r(9728===t.minFilter&&9728===t.magFilter,"filter not supported, must enable oes_texture_float_linear"),r(!t.genMipmaps,"mipmap generation not supported with float textures"));var u=e.images;for(i=0;i<16;++i)if(u[i]){var c=o>>i,l=a>>i;r(e.mipmask&1<0&&o<=i.maxTextureSize&&a>0&&a<=i.maxTextureSize,"invalid texture shape"),r(o===a,"cube map must be square"),r(33071===e.wrapS&&33071===e.wrapT,"wrap mode not supported by cube map");for(var u=0;u>h,p=a>>h;r(c.mipmask&1<1&&n===r&&('"'===n||"'"===n))return['"'+E(e.substr(1,e.length-2))+'"'];var i=/\[(false|true|null|\d+|'[^']*'|"[^"]*")\]/.exec(e);if(i)return t(e.substr(0,i.index)).concat(t(i[1])).concat(t(e.substr(i.index+i[0].length)));var o=e.split(".");if(1===o.length)return['"'+E(e)+'"'];for(var a=[],s=0;st(e,n+"["+r+"]"))):e instanceof S?e:void w(!1,"invalid option type in uniform "+n)},accessor:M},A={next:"function"==typeof requestAnimationFrame?function(t){return requestAnimationFrame(t)}:function(t){return setTimeout(t,16)},cancel:"function"==typeof cancelAnimationFrame?function(t){return cancelAnimationFrame(t)}:clearTimeout},k="undefined"!=typeof performance&&performance.now?function(){return performance.now()}:function(){return+new Date};function C(t){return"string"==typeof t?t.split():(w(Array.isArray(t),"invalid extension array"),t)}function T(t){return"string"==typeof t?(w("undefined"!=typeof document,"not supported outside of DOM"),document.querySelector(t)):t}function I(t){var n,r,i,o,a,s=t||{},u={},c=[],l=[],h="undefined"==typeof window?1:window.devicePixelRatio,f=!1,d=function(t){t&&w.raise(t)},p=function(){};if("string"==typeof s?(w("undefined"!=typeof document,"selector queries only supported in DOM enviroments"),n=document.querySelector(s),w(n,"invalid query string for element")):"object"==typeof s?"string"==typeof(a=s).nodeName&&"function"==typeof a.appendChild&&"function"==typeof a.getBoundingClientRect?n=s:function(t){return"function"==typeof t.drawArrays||"function"==typeof t.drawElements}(s)?i=(o=s).canvas:(w.constructor(s),"gl"in s?o=s.gl:"canvas"in s?i=T(s.canvas):"container"in s&&(r=T(s.container)),"attributes"in s&&(u=s.attributes,w.type(u,"object","invalid context attributes")),"extensions"in s&&(c=C(s.extensions)),"optionalExtensions"in s&&(l=C(s.optionalExtensions)),"onDone"in s&&(w.type(s.onDone,"function","invalid or missing onDone callback"),d=s.onDone),"profile"in s&&(f=!!s.profile),"pixelRatio"in s&&(h=+s.pixelRatio,w(h>0,"invalid pixel ratio"))):w.raise("invalid arguments to regl"),n&&("canvas"===n.nodeName.toLowerCase()?i=n:r=n),!o){if(!i){w("undefined"!=typeof document,"must manually specify webgl context outside of DOM environments");var g=function(t,n,r){var i,o=document.createElement("canvas");function a(){var n=window.innerWidth,i=window.innerHeight;if(t!==document.body){var a=t.getBoundingClientRect();n=a.right-a.left,i=a.bottom-a.top}o.width=r*n,o.height=r*i,e(o.style,{width:n+"px",height:i+"px"})}return e(o.style,{border:0,margin:0,padding:0,top:0,left:0}),t.appendChild(o),t===document.body&&(o.style.position="absolute",e(t.style,{margin:0,padding:0})),t!==document.body&&"function"==typeof ResizeObserver?(i=new ResizeObserver((function(){setTimeout(a)}))).observe(t):window.addEventListener("resize",a,!1),a(),{canvas:o,onDestroy:function(){i?i.disconnect():window.removeEventListener("resize",a),t.removeChild(o)}}}(r||document.body,0,h);if(!g)return null;i=g.canvas,p=g.onDestroy}void 0===u.premultipliedAlpha&&(u.premultipliedAlpha=!0),o=function(t,e){function n(n){try{return t.getContext(n,e)}catch(t){return null}}return n("webgl")||n("experimental-webgl")||n("webgl-experimental")}(i,u)}return o?{gl:o,canvas:i,container:r,extensions:c,optionalExtensions:l,pixelRatio:h,profile:f,onDone:d,onDestroy:p}:(p(),d("webgl not supported, try upgrading your browser or graphics drivers http://get.webgl.org"),null)}function P(t,e){for(var n=Array(t),r=0;r65535)<<4,e|=n=((t>>>=e)>255)<<3,e|=n=((t>>>=n)>15)<<2,(e|=n=((t>>>=n)>3)<<1)|(t>>>=n)>>1}function j(){var t=P(8,(function(){return[]}));function e(e){var n=function(t){for(var e=16;e<=1<<28;e*=16)if(t<=e)return e;return 0}(e),r=t[N(n)>>2];return r.length>0?r.pop():new ArrayBuffer(n)}function n(e){t[N(e.byteLength)>>2].push(e)}return{alloc:e,free:n,allocType:function(t,n){var r=null;switch(t){case 5120:r=new Int8Array(e(n),0,n);break;case 5121:r=new Uint8Array(e(n),0,n);break;case 5122:r=new Int16Array(e(2*n),0,n);break;case 5123:r=new Uint16Array(e(2*n),0,n);break;case 5124:r=new Int32Array(e(4*n),0,n);break;case 5125:r=new Uint32Array(e(4*n),0,n);break;case 5126:r=new Float32Array(e(4*n),0,n);break;default:return null}return r.length!==n?r.subarray(0,n):r},freeType:function(t){n(t.buffer)}}}var D=j();function L(e){return!!e&&"object"==typeof e&&Array.isArray(e.shape)&&Array.isArray(e.stride)&&"number"==typeof e.offset&&e.shape.length===e.stride.length&&(Array.isArray(e.data)||t(e.data))}D.zero=j();var R=function(t){return Object.keys(t).map((function(e){return t[e]}))},B={shape:function(t){for(var e=[],n=t;n.length;n=n[0])e.push(n.length);return e},flatten:function(t,e,n,r){var i=1;if(e.length)for(var o=0;o>>31<<15,o=(r<<1>>>24)-127,a=r>>13&1023;if(o<-24)e[n]=i;else if(o<-14){var s=-14-o;e[n]=i+(a+1024>>s)}else e[n]=o>15?i+31744:i+(o+15<<10)+a}return e}function J(e){return Array.isArray(e)||t(e)}var tt=function(t){return!(t&t-1||!t)},et=[9984,9986,9985,9987],nt=[0,6409,6410,6407,6408],rt={};function it(t){return"[object "+t+"]"}rt[6409]=rt[6406]=rt[6402]=1,rt[34041]=rt[6410]=2,rt[6407]=rt[35904]=3,rt[6408]=rt[35906]=4;var ot=it("HTMLCanvasElement"),at=it("OffscreenCanvas"),st=it("CanvasRenderingContext2D"),ut=it("ImageBitmap"),ct=it("HTMLImageElement"),lt=it("HTMLVideoElement"),ht=Object.keys(F).concat([ot,at,st,ut,ct,lt]),ft=[];ft[5121]=1,ft[5126]=4,ft[36193]=2,ft[5123]=2,ft[5125]=4;var dt=[];function pt(t){return Array.isArray(t)&&(0===t.length||"number"==typeof t[0])}function gt(t){return!!Array.isArray(t)&&!(0===t.length||!J(t[0]))}function vt(t){return Object.prototype.toString.call(t)}function mt(t){return vt(t)===ot}function yt(t){return vt(t)===at}function bt(t){if(!t)return!1;var e=vt(t);return ht.indexOf(e)>=0||pt(t)||gt(t)||L(t)}function xt(t){return 0|F[Object.prototype.toString.call(t)]}function wt(t,e){return D.allocType(36193===t.type?5126:t.type,e)}function _t(t,e){36193===t.type?(t.data=Q(e),D.freeType(e)):t.data=e}function St(t,e,n,r,i,o){var a;if(a=void 0!==dt[t]?dt[t]:rt[t]*ft[e],o&&(a*=6),i){for(var s=0,u=n;u>=1;)s+=a*u*u,u/=2;return s}return a*n*r}function Et(n,r,i,o,a,s,u){var c={"don't care":4352,"dont care":4352,nice:4354,fast:4353},l={repeat:10497,clamp:33071,mirror:33648},h={nearest:9728,linear:9729},f=e({mipmap:9987,"nearest mipmap nearest":9984,"linear mipmap nearest":9985,"nearest mipmap linear":9986,"linear mipmap linear":9987},h),d={none:0,browser:37444},p={uint8:5121,rgba4:32819,rgb565:33635,"rgb5 a1":32820},g={alpha:6406,luminance:6409,"luminance alpha":6410,rgb:6407,rgba:6408,rgba4:32854,"rgb5 a1":32855,rgb565:36194},v={};r.ext_srgb&&(g.srgb=35904,g.srgba=35906),r.oes_texture_float&&(p.float32=p.float=5126),r.oes_texture_half_float&&(p.float16=p["half float"]=36193),r.webgl_depth_texture&&(e(g,{depth:6402,"depth stencil":34041}),e(p,{uint16:5123,uint32:5125,"depth stencil":34042})),r.webgl_compressed_texture_s3tc&&e(v,{"rgb s3tc dxt1":33776,"rgba s3tc dxt1":33777,"rgba s3tc dxt3":33778,"rgba s3tc dxt5":33779}),r.webgl_compressed_texture_atc&&e(v,{"rgb atc":35986,"rgba atc explicit alpha":35987,"rgba atc interpolated alpha":34798}),r.webgl_compressed_texture_pvrtc&&e(v,{"rgb pvrtc 4bppv1":35840,"rgb pvrtc 2bppv1":35841,"rgba pvrtc 4bppv1":35842,"rgba pvrtc 2bppv1":35843}),r.webgl_compressed_texture_etc1&&(v["rgb etc1"]=36196);var m=Array.prototype.slice.call(n.getParameter(34467));Object.keys(v).forEach((function(t){var e=v[t];m.indexOf(e)>=0&&(g[t]=e)}));var y=Object.keys(g);i.textureFormats=y;var b=[];Object.keys(g).forEach((function(t){var e=g[t];b[e]=t}));var x=[];Object.keys(p).forEach((function(t){var e=p[t];x[e]=t}));var _=[];Object.keys(h).forEach((function(t){_[h[t]]=t}));var S=[];Object.keys(f).forEach((function(t){var e=f[t];S[e]=t}));var E=[];Object.keys(l).forEach((function(t){E[l[t]]=t}));var M=y.reduce((function(t,e){var n=g[e];return 6409===n||6406===n||6409===n||6410===n||6402===n||34041===n||r.ext_srgb&&(35904===n||35906===n)?t[n]=n:32855===n||e.indexOf("rgba")>=0?t[n]=6408:t[n]=6407,t}),{});function O(){this.internalformat=6408,this.format=6408,this.type=5121,this.compressed=!1,this.premultiplyAlpha=!1,this.flipY=!1,this.unpackAlignment=1,this.colorSpace=37444,this.width=0,this.height=0,this.channels=0}function A(t,e){t.internalformat=e.internalformat,t.format=e.format,t.type=e.type,t.compressed=e.compressed,t.premultiplyAlpha=e.premultiplyAlpha,t.flipY=e.flipY,t.unpackAlignment=e.unpackAlignment,t.colorSpace=e.colorSpace,t.width=e.width,t.height=e.height,t.channels=e.channels}function k(t,e){if("object"==typeof e&&e){if("premultiplyAlpha"in e&&(w.type(e.premultiplyAlpha,"boolean","invalid premultiplyAlpha"),t.premultiplyAlpha=e.premultiplyAlpha),"flipY"in e&&(w.type(e.flipY,"boolean","invalid texture flip"),t.flipY=e.flipY),"alignment"in e&&(w.oneOf(e.alignment,[1,2,4,8],"invalid texture unpack alignment"),t.unpackAlignment=e.alignment),"colorSpace"in e&&(w.parameter(e.colorSpace,d,"invalid colorSpace"),t.colorSpace=d[e.colorSpace]),"type"in e){var n=e.type;w(r.oes_texture_float||!("float"===n||"float32"===n),"you must enable the OES_texture_float extension in order to use floating point textures."),w(r.oes_texture_half_float||!("half float"===n||"float16"===n),"you must enable the OES_texture_half_float extension in order to use 16-bit floating point textures."),w(r.webgl_depth_texture||!("uint16"===n||"uint32"===n||"depth stencil"===n),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(n,p,"invalid texture type"),t.type=p[n]}var o=t.width,a=t.height,s=t.channels,u=!1;"shape"in e?(w(Array.isArray(e.shape)&&e.shape.length>=2,"shape must be an array"),o=e.shape[0],a=e.shape[1],3===e.shape.length&&(s=e.shape[2],w(s>0&&s<=4,"invalid number of channels"),u=!0),w(o>=0&&o<=i.maxTextureSize,"invalid width"),w(a>=0&&a<=i.maxTextureSize,"invalid height")):("radius"in e&&(o=a=e.radius,w(o>=0&&o<=i.maxTextureSize,"invalid radius")),"width"in e&&(o=e.width,w(o>=0&&o<=i.maxTextureSize,"invalid width")),"height"in e&&(a=e.height,w(a>=0&&a<=i.maxTextureSize,"invalid height")),"channels"in e&&(s=e.channels,w(s>0&&s<=4,"invalid number of channels"),u=!0)),t.width=0|o,t.height=0|a,t.channels=0|s;var c=!1;if("format"in e){var l=e.format;w(r.webgl_depth_texture||!("depth"===l||"depth stencil"===l),"you must enable the WEBGL_depth_texture extension in order to use depth/stencil textures."),w.parameter(l,g,"invalid texture format");var h=t.internalformat=g[l];t.format=M[h],l in p&&("type"in e||(t.type=p[l])),l in v&&(t.compressed=!0),c=!0}!u&&c?t.channels=rt[t.format]:u&&!c?t.channels!==nt[t.format]&&(t.format=t.internalformat=nt[t.channels]):c&&u&&w(t.channels===rt[t.format],"number of channels inconsistent with specified format")}}function C(t){n.pixelStorei(37440,t.flipY),n.pixelStorei(37441,t.premultiplyAlpha),n.pixelStorei(37443,t.colorSpace),n.pixelStorei(3317,t.unpackAlignment)}function T(){O.call(this),this.xOffset=0,this.yOffset=0,this.data=null,this.needsFree=!1,this.element=null,this.needsCopy=!1}function I(e,n){var r=null;if(bt(n)?r=n:n&&(w.type(n,"object","invalid pixel data type"),k(e,n),"x"in n&&(e.xOffset=0|n.x),"y"in n&&(e.yOffset=0|n.y),bt(n.data)&&(r=n.data)),w(!e.compressed||r instanceof Uint8Array,"compressed texture data must be stored in a uint8array"),n.copy){w(!r,"can not specify copy and data field for the same texture");var o=a.viewportWidth,s=a.viewportHeight;e.width=e.width||o-e.xOffset,e.height=e.height||s-e.yOffset,e.needsCopy=!0,w(e.xOffset>=0&&e.xOffset=0&&e.yOffset0&&e.width<=o&&e.height>0&&e.height<=s,"copy texture read out of bounds")}else if(r){if(t(r))e.channels=e.channels||4,e.data=r,"type"in n||5121!==e.type||(e.type=xt(r));else if(pt(r))e.channels=e.channels||4,function(t,e){var n=e.length;switch(t.type){case 5121:case 5123:case 5125:case 5126:var r=D.allocType(t.type,n);r.set(e),t.data=r;break;case 36193:t.data=Q(e);break;default:w.raise("unsupported texture type, must specify a typed array")}}(e,r),e.alignment=1,e.needsFree=!0;else if(L(r)){var u=r.data;Array.isArray(u)||5121!==e.type||(e.type=xt(u));var c,l,h,f,d,p,g=r.shape,v=r.stride;3===g.length?(h=g[2],p=v[2]):(w(2===g.length,"invalid ndarray pixel data, must be 2 or 3D"),h=1,p=1),c=g[0],l=g[1],f=v[0],d=v[1],e.alignment=1,e.width=c,e.height=l,e.channels=h,e.format=e.internalformat=nt[h],e.needsFree=!0,function(t,e,n,r,i,o){for(var a=t.width,s=t.height,u=t.channels,c=wt(t,a*s*u),l=0,h=0;h=0,"oes_texture_float extension not enabled"):36193===e.type&&w(i.extensions.indexOf("oes_texture_half_float")>=0,"oes_texture_half_float extension not enabled")}function P(t,e,r){var i=t.element,a=t.data,s=t.internalformat,u=t.format,c=t.type,l=t.width,h=t.height;C(t),i?n.texImage2D(e,r,u,u,c,i):t.compressed?n.compressedTexImage2D(e,r,s,l,h,0,a):t.needsCopy?(o(),n.copyTexImage2D(e,r,u,t.xOffset,t.yOffset,l,h,0)):n.texImage2D(e,r,u,l,h,0,u,c,a||null)}function N(t,e,r,i,a){var s=t.element,u=t.data,c=t.internalformat,l=t.format,h=t.type,f=t.width,d=t.height;C(t),s?n.texSubImage2D(e,a,r,i,l,h,s):t.compressed?n.compressedTexSubImage2D(e,a,r,i,c,f,d,u):t.needsCopy?(o(),n.copyTexSubImage2D(e,a,r,i,t.xOffset,t.yOffset,f,d)):n.texSubImage2D(e,a,r,i,f,d,l,h,u)}var j=[];function G(){return j.pop()||new T}function F(t){t.needsFree&&D.freeType(t.data),T.call(t),j.push(t)}function z(){O.call(this),this.genMipmaps=!1,this.mipmapHint=4352,this.mipmask=0,this.images=Array(16)}function U(t,e,n){var r=t.images[0]=G();t.mipmask=1,r.width=t.width=e,r.height=t.height=n,r.channels=t.channels=4}function V(t,e){var n=null;if(bt(e))A(n=t.images[0]=G(),t),I(n,e),t.mipmask=1;else if(k(t,e),Array.isArray(e.mipmap))for(var r=e.mipmap,i=0;i>=i,n.height>>=i,I(n,r[i]),t.mipmask|=1<=0&&!("faces"in e)&&(t.genMipmaps=!0)}if("mag"in e){var r=e.mag;w.parameter(r,h),t.magFilter=h[r]}var o=t.wrapS,a=t.wrapT;if("wrap"in e){var s=e.wrap;"string"==typeof s?(w.parameter(s,l),o=a=l[s]):Array.isArray(s)&&(w.parameter(s[0],l),w.parameter(s[1],l),o=l[s[0]],a=l[s[1]])}else{if("wrapS"in e){var u=e.wrapS;w.parameter(u,l),o=l[u]}if("wrapT"in e){var d=e.wrapT;w.parameter(d,l),a=l[d]}}if(t.wrapS=o,t.wrapT=a,"anisotropic"in e){var p=e.anisotropic;w("number"==typeof p&&p>=1&&p<=i.maxAnisotropic,"aniso samples must be between 1 and "),t.anisotropic=e.anisotropic}if("mipmap"in e){var g=!1;switch(typeof e.mipmap){case"string":w.parameter(e.mipmap,c,"invalid mipmap hint"),t.mipmapHint=c[e.mipmap],t.genMipmaps=!0,g=!0;break;case"boolean":g=t.genMipmaps=e.mipmap;break;case"object":w(Array.isArray(e.mipmap),"invalid mipmap type"),t.genMipmaps=!1,g=!0;break;default:w.raise("invalid mipmap type")}g&&!("min"in e)&&(t.minFilter=9984)}}function Z(t,e){n.texParameteri(e,10241,t.minFilter),n.texParameteri(e,10240,t.magFilter),n.texParameteri(e,10242,t.wrapS),n.texParameteri(e,10243,t.wrapT),r.ext_texture_filter_anisotropic&&n.texParameteri(e,34046,t.anisotropic),t.genMipmaps&&(n.hint(33170,t.mipmapHint),n.generateMipmap(e))}var $=0,it={},ot=i.maxTextureUnits,at=Array(ot).map((function(){return null}));function ht(t){O.call(this),this.mipmask=0,this.internalformat=6408,this.id=$++,this.refCount=1,this.target=t,this.texture=n.createTexture(),this.unit=-1,this.bindCount=0,this.texInfo=new q,u.profile&&(this.stats={size:0})}function ft(t){n.activeTexture(33984),n.bindTexture(t.target,t.texture)}function dt(){var t=at[0];t?n.bindTexture(t.target,t.texture):n.bindTexture(3553,null)}function Et(t){var e=t.texture;w(e,"must not double destroy texture");var r=t.unit,i=t.target;r>=0&&(n.activeTexture(33984+r),n.bindTexture(i,null),at[r]=null),n.deleteTexture(e),t.texture=null,t.params=null,t.pixels=null,t.refCount=0,delete it[t.id],s.textureCount--}return e(ht.prototype,{bind:function(){this.bindCount+=1;var t=this.unit;if(t<0){for(var e=0;e0)continue;r.unit=-1}at[e]=this,t=e;break}t>=ot&&w.raise("insufficient number of texture units"),u.profile&&s.maxTextureUnits>u)-a,c.height=c.height||(r.height>>u)-s,w(r.type===c.type&&r.format===c.format&&r.internalformat===c.internalformat,"incompatible format for texture.subimage"),w(a>=0&&s>=0&&a+c.width<=r.width&&s+c.height<=r.height,"texture.subimage write out of bounds"),w(r.mipmask&1<>s;++s){var c=i>>s,l=a>>s;if(!c||!l)break;n.texImage2D(3553,s,r.format,c,l,0,r.format,r.type,null)}return dt(),u.profile&&(r.stats.size=St(r.internalformat,r.type,i,a,!1,!1)),o},o._reglType="texture2d",o._texture=r,u.profile&&(o.stats=r.stats),o.destroy=function(){r.decRef()},o},createCube:function(t,e,r,o,a,c){var l=new ht(34067);it[l.id]=l,s.cubeCount++;var h=new Array(6);function f(t,e,n,r,o,a){var s,c=l.texInfo;for(q.call(c),s=0;s<6;++s)h[s]=X();if("number"!=typeof t&&t)if("object"==typeof t)if(e)V(h[0],t),V(h[1],e),V(h[2],n),V(h[3],r),V(h[4],o),V(h[5],a);else if(K(c,t),k(l,t),"faces"in t){var d=t.faces;for(w(Array.isArray(d)&&6===d.length,"cube faces must be a length 6 array"),s=0;s<6;++s)w("object"==typeof d[s]&&!!d[s],"invalid input for cube map face"),A(h[s],l),V(h[s],d[s])}else for(s=0;s<6;++s)V(h[s],t);else w.raise("invalid arguments to cube map");else{var p=0|t||1;for(s=0;s<6;++s)U(h[s],p,p)}for(A(l,h[0]),i.npotTextureCube||w(tt(l.width)&&tt(l.height),"your browser does not support non power or two texture dimensions"),c.genMipmaps?l.mipmask=(h[0].width<<1)-1:l.mipmask=h[0].mipmask,w.textureCube(l,c,h,i),l.internalformat=h[0].internalformat,f.width=h[0].width,f.height=h[0].height,ft(l),s=0;s<6;++s)W(h[s],34069+s);for(Z(c,34067),dt(),u.profile&&(l.stats.size=St(l.internalformat,l.type,f.width,f.height,c.genMipmaps,!0)),f.format=b[l.internalformat],f.type=x[l.type],f.mag=_[c.magFilter],f.min=S[c.minFilter],f.wrapS=E[c.wrapS],f.wrapT=E[c.wrapT],s=0;s<6;++s)H(h[s]);return f}return f(t,e,r,o,a,c),f.subimage=function(t,e,n,r,i){w(!!e,"must specify image data"),w("number"==typeof t&&t===(0|t)&&t>=0&&t<6,"invalid face");var o=0|n,a=0|r,s=0|i,u=G();return A(u,l),u.width=0,u.height=0,I(u,e),u.width=u.width||(l.width>>s)-o,u.height=u.height||(l.height>>s)-a,w(l.type===u.type&&l.format===u.format&&l.internalformat===u.internalformat,"incompatible format for texture.subimage"),w(o>=0&&a>=0&&o+u.width<=l.width&&a+u.height<=l.height,"texture.subimage write out of bounds"),w(l.mipmask&1<>i;++i)n.texImage2D(34069+r,i,l.format,e>>i,e>>i,0,l.format,l.type,null);return dt(),u.profile&&(l.stats.size=St(l.internalformat,l.type,f.width,f.height,!1,!0)),f}},f._reglType="textureCube",f._texture=l,u.profile&&(f.stats=l.stats),f.destroy=function(){l.decRef()},f},clear:function(){for(var t=0;t>e,t.height>>e,0,t.internalformat,t.type,null);else for(var r=0;r<6;++r)n.texImage2D(34069+r,e,t.internalformat,t.width>>e,t.height>>e,0,t.internalformat,t.type,null);Z(t.texInfo,t.target)}))},refresh:function(){for(var t=0;t=0&&l=0&&h0&&f+l<=i.framebufferWidth,"invalid width for read pixels"),w(d>0&&d+h<=i.framebufferHeight,"invalid height for read pixels"),r();var g=f*d*4;return p||(5121===c?p=new Uint8Array(g):5126===c&&(p=p||new Float32Array(g))),w.isTypedArray(p,"data buffer for regl.read() must be a typedarray"),w(p.byteLength>=g,"data buffer for regl.read() too small"),e.pixelStorei(3333,4),e.readPixels(l,h,f,d,6408,c,p),p}return function(t){return t&&"framebuffer"in t?function(t){var e;return n.setFBO({framebuffer:t.framebuffer},(function(){e=u(t)})),e}(t):u(t)}}function jt(t){return Array.prototype.slice.call(t)}function Dt(t){return jt(t).join("")}It[36053]="complete",It[36054]="incomplete attachment",It[36057]="incomplete dimensions",It[36055]="incomplete, missing attachment",It[36061]="unsupported";var Lt="xyzw".split(""),Rt="profile",Bt="framebuffer",Gt="vert",Ft="frag",zt="elements",Ut="primitive",Vt="count",Wt="offset",Yt="instances",Xt="vao",Ht=Bt+"Width",qt=Bt+"Height",Kt=["blend.func","blend.equation","stencil.func","stencil.opFront","stencil.opBack","sample.coverage","viewport","scissor.box","polygonOffset.offset"],Zt={0:0,1:1,zero:0,one:1,"src color":768,"one minus src color":769,"src alpha":770,"one minus src alpha":771,"dst color":774,"one minus dst color":775,"dst alpha":772,"one minus dst alpha":773,"constant color":32769,"one minus constant color":32770,"constant alpha":32771,"one minus constant alpha":32772,"src alpha saturate":776},$t=["constant color, constant alpha","one minus constant color, constant alpha","constant color, one minus constant alpha","one minus constant color, one minus constant alpha","constant alpha, constant color","constant alpha, one minus constant color","one minus constant alpha, constant color","one minus constant alpha, one minus constant color"],Qt={never:512,less:513,"<":513,equal:514,"=":514,"==":514,"===":514,lequal:515,"<=":515,greater:516,">":516,notequal:517,"!=":517,"!==":517,gequal:518,">=":518,always:519},Jt={0:0,zero:0,keep:7680,replace:7681,increment:7682,decrement:7683,"increment wrap":34055,"decrement wrap":34056,invert:5386},te={frag:35632,vert:35633},ee={cw:2304,ccw:2305};function ne(e){return Array.isArray(e)||t(e)||L(e)}function re(t){return t.sort((function(t,e){return"viewport"===t?-1:"viewport"===e?1:t=1,r>=2,e)}if(4===n){var i=t.data;return new ie(i.thisDep,i.contextDep,i.propDep,e)}if(5===n)return new ie(!1,!1,!1,e);if(6===n){for(var o=!1,a=!1,s=!1,u=0;u=1&&(a=!0),l>=2&&(s=!0)}else 4===c.type&&(o=o||c.data.thisDep,a=a||c.data.contextDep,s=s||c.data.propDep)}return new ie(o,a,s,e)}return new ie(3===n,2===n,1===n,e)}var ue=new ie(!1,!1,!1,(function(){}));function ce(t,n,r,i,o,a,s,u,c,l,h,f,d,p,g){var v=l.Record,m={add:32774,subtract:32778,"reverse subtract":32779};r.ext_blend_minmax&&(m.min=32775,m.max=32776);var y=r.angle_instanced_arrays,b=r.webgl_draw_buffers,x={dirty:!0,profile:g.profile},_={},S=[],E={},M={};function A(t){return t.replace(".","_")}function k(t,e,n){var r=A(t);S.push(t),_[r]=x[r]=!!n,E[r]=e}function C(t,e,n){var r=A(t);S.push(t),Array.isArray(n)?(x[r]=n.slice(),_[r]=n.slice()):x[r]=_[r]=n,M[r]=e}k("dither",3024),k("blend.enable",3042),C("blend.color","blendColor",[0,0,0,0]),C("blend.equation","blendEquationSeparate",[32774,32774]),C("blend.func","blendFuncSeparate",[1,0,1,0]),k("depth.enable",2929,!0),C("depth.func","depthFunc",513),C("depth.range","depthRange",[0,1]),C("depth.mask","depthMask",!0),C("colorMask","colorMask",[!0,!0,!0,!0]),k("cull.enable",2884),C("cull.face","cullFace",1029),C("frontFace","frontFace",2305),C("lineWidth","lineWidth",1),k("polygonOffset.enable",32823),C("polygonOffset.offset","polygonOffset",[0,0]),k("sample.alpha",32926),k("sample.enable",32928),C("sample.coverage","sampleCoverage",[1,!1]),k("stencil.enable",2960),C("stencil.mask","stencilMask",-1),C("stencil.func","stencilFunc",[519,0,-1]),C("stencil.opFront","stencilOpSeparate",[1028,7680,7680,7680]),C("stencil.opBack","stencilOpSeparate",[1029,7680,7680,7680]),k("scissor.enable",3089),C("scissor.box","scissor",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]),C("viewport","viewport",[0,0,t.drawingBufferWidth,t.drawingBufferHeight]);var T={gl:t,context:d,strings:n,next:_,current:x,draw:f,elements:a,buffer:o,shader:h,attributes:l.state,vao:l,uniforms:c,framebuffer:u,extensions:r,timer:p,isBufferArgs:ne},I={primTypes:K,compareFuncs:Qt,blendFuncs:Zt,blendEquations:m,stencilOps:Jt,glTypes:z,orientationType:ee};w.optional((function(){T.isArrayLike=J})),b&&(I.backBuffer=[1029],I.drawBuffer=P(i.maxDrawbuffers,(function(t){return 0===t?[0]:P(t,(function(t){return 36064+t}))})));var N=0;function j(){var t=function(){var t=0,n=[],r=[];function i(){var n=[],r=[];return e((function(){n.push.apply(n,jt(arguments))}),{def:function(){var e="v"+t++;return r.push(e),arguments.length>0&&(n.push(e,"="),n.push.apply(n,jt(arguments)),n.push(";")),e},toString:function(){return Dt([r.length>0?"var "+r.join(",")+";":"",Dt(n)])}})}function o(){var t=i(),n=i(),r=t.toString,o=n.toString;function a(e,r){n(e,r,"=",t.def(e,r),";")}return e((function(){t.apply(t,jt(arguments))}),{def:t.def,entry:t,exit:n,save:a,set:function(e,n,r){a(e,n),t(e,n,"=",r,";")},toString:function(){return r()+o()}})}var a=i(),s={};return{global:a,link:function(e){for(var i=0;i=0,'unknown parameter "'+e+'"',f.commandStr)}))}e(d),e(p)}));var g=function(t,e){var n=t.static;if("string"==typeof n[Ft]&&"string"==typeof n[Gt]){if(Object.keys(e.dynamic).length>0)return null;var r=e.static,i=Object.keys(r);if(i.length>0&&"number"==typeof r[i[0]]){for(var o=[],a=0;a=0,"invalid "+t,n.commandStr)):u=!1,"height"in o?(s=0|o.height,w.command(s>=0,"invalid "+t,n.commandStr)):u=!1,new ie(!u&&e&&e.thisDep,!u&&e&&e.contextDep,!u&&e&&e.propDep,(function(t,e){var n=t.shared.context,r=a;"width"in o||(r=e.def(n,".",Ht,"-",c));var i=s;return"height"in o||(i=e.def(n,".",qt,"-",l)),[c,l,r,i]}))}if(t in i){var h=i[t],f=se(h,(function(e,n){var r=e.invoke(n,h);w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)}));var i=e.shared.context,o=n.def(r,".x|0"),a=n.def(r,".y|0"),s=n.def('"width" in ',r,"?",r,".width|0:","(",i,".",Ht,"-",o,")"),u=n.def('"height" in ',r,"?",r,".height|0:","(",i,".",qt,"-",a,")");return w.optional((function(){e.assert(n,s+">=0&&"+u+">=0","invalid "+t)})),[o,a,s,u]}));return e&&(f.thisDep=f.thisDep||e.thisDep,f.contextDep=f.contextDep||e.contextDep,f.propDep=f.propDep||e.propDep),f}return e?new ie(e.thisDep,e.contextDep,e.propDep,(function(t,e){var n=t.shared.context;return[0,0,e.def(n,".",Ht),e.def(n,".",qt)]})):null}var a=o("viewport");if(a){var s=a;a=new ie(a.thisDep,a.contextDep,a.propDep,(function(t,e){var n=s.append(t,e),r=t.shared.context;return e.set(r,".viewportWidth",n[2]),e.set(r,".viewportHeight",n[3]),n}))}return{viewport:a,scissor_box:o("scissor.box")}}(t,b,f),_=function(t,e){var n=t.static,r=t.dynamic,i=function(){if(zt in n){var t=n[zt];ne(t)?t=a.getElements(a.create(t,!0)):t&&(t=a.getElements(t),w.command(t,"invalid elements",e.commandStr));var i=ae((function(e,n){if(t){var r=e.link(t);return e.ELEMENTS=r,r}return e.ELEMENTS=null,null}));return i.value=t,i}if(zt in r){var o=r[zt];return se(o,(function(t,e){var n=t.shared,r=n.isBufferArgs,i=n.elements,a=t.invoke(e,o),s=e.def("null"),u=e.def(r,"(",a,")"),c=t.cond(u).then(s,"=",i,".createStream(",a,");").else(s,"=",i,".getElements(",a,");");return w.optional((function(){t.assert(c.else,"!"+a+"||"+s,"invalid elements")})),e.entry(c),e.exit(t.cond(u).then(i,".destroyStream(",s,");")),t.ELEMENTS=s,s}))}return null}();function o(t,o){if(t in n){var a=0|n[t];return w.command(!o||a>=0,"invalid "+t,e.commandStr),ae((function(t,e){return o&&(t.OFFSET=a),a}))}if(t in r){var s=r[t];return se(s,(function(e,n){var r=e.invoke(n,s);return o&&(e.OFFSET=r,w.optional((function(){e.assert(n,r+">=0","invalid "+t)}))),r}))}return o&&i?ae((function(t,e){return t.OFFSET="0",0})):null}var s=o(Wt,!0);return{elements:i,primitive:function(){if(Ut in n){var t=n[Ut];return w.commandParameter(t,K,"invalid primitve",e.commandStr),ae((function(e,n){return K[t]}))}if(Ut in r){var o=r[Ut];return se(o,(function(t,e){var n=t.constants.primTypes,r=t.invoke(e,o);return w.optional((function(){t.assert(e,r+" in "+n,"invalid primitive, must be one of "+Object.keys(K))})),e.def(n,"[",r,"]")}))}return i?oe(i)?i.value?ae((function(t,e){return e.def(t.ELEMENTS,".primType")})):ae((function(){return 4})):new ie(i.thisDep,i.contextDep,i.propDep,(function(t,e){var n=t.ELEMENTS;return e.def(n,"?",n,".primType:",4)})):null}(),count:function(){if(Vt in n){var t=0|n[Vt];return w.command("number"==typeof t&&t>=0,"invalid vertex count",e.commandStr),ae((function(){return t}))}if(Vt in r){var o=r[Vt];return se(o,(function(t,e){var n=t.invoke(e,o);return w.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">=0&&"+n+"===("+n+"|0)","invalid vertex count")})),n}))}if(i){if(oe(i)){if(i)return s?new ie(s.thisDep,s.contextDep,s.propDep,(function(t,e){var n=e.def(t.ELEMENTS,".vertCount-",t.OFFSET);return w.optional((function(){t.assert(e,n+">=0","invalid vertex offset/element buffer too small")})),n})):ae((function(t,e){return e.def(t.ELEMENTS,".vertCount")}));var a=ae((function(){return-1}));return w.optional((function(){a.MISSING=!0})),a}var u=new ie(i.thisDep||s.thisDep,i.contextDep||s.contextDep,i.propDep||s.propDep,(function(t,e){var n=t.ELEMENTS;return t.OFFSET?e.def(n,"?",n,".vertCount-",t.OFFSET,":-1"):e.def(n,"?",n,".vertCount:-1")}));return w.optional((function(){u.DYNAMIC=!0})),u}return null}(),instances:o(Yt,!1),offset:s}}(t,f),E=function(t,e){var n=t.static,r=t.dynamic,o={};return S.forEach((function(t){var a=A(t);function s(e,i){if(t in n){var s=e(n[t]);o[a]=ae((function(){return s}))}else if(t in r){var u=r[t];o[a]=se(u,(function(t,e){return i(t,e,t.invoke(e,u))}))}}switch(t){case"cull.enable":case"blend.enable":case"dither":case"stencil.enable":case"depth.enable":case"scissor.enable":case"polygonOffset.enable":case"sample.alpha":case"sample.enable":case"depth.mask":return s((function(n){return w.commandType(n,"boolean",t,e.commandStr),n}),(function(e,n,r){return w.optional((function(){e.assert(n,"typeof "+r+'==="boolean"',"invalid flag "+t,e.commandStr)})),r}));case"depth.func":return s((function(n){return w.commandParameter(n,Qt,"invalid "+t,e.commandStr),Qt[n]}),(function(e,n,r){var i=e.constants.compareFuncs;return w.optional((function(){e.assert(n,r+" in "+i,"invalid "+t+", must be one of "+Object.keys(Qt))})),n.def(i,"[",r,"]")}));case"depth.range":return s((function(t){return w.command(J(t)&&2===t.length&&"number"==typeof t[0]&&"number"==typeof t[1]&&t[0]<=t[1],"depth range is 2d array",e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===2&&typeof "+n+'[0]==="number"&&typeof '+n+'[1]==="number"&&'+n+"[0]<="+n+"[1]","depth range must be a 2d array")})),[e.def("+",n,"[0]"),e.def("+",n,"[1]")]}));case"blend.func":return s((function(t){w.commandType(t,"object","blend.func",e.commandStr);var n="srcRGB"in t?t.srcRGB:t.src,r="srcAlpha"in t?t.srcAlpha:t.src,i="dstRGB"in t?t.dstRGB:t.dst,o="dstAlpha"in t?t.dstAlpha:t.dst;return w.commandParameter(n,Zt,a+".srcRGB",e.commandStr),w.commandParameter(r,Zt,a+".srcAlpha",e.commandStr),w.commandParameter(i,Zt,a+".dstRGB",e.commandStr),w.commandParameter(o,Zt,a+".dstAlpha",e.commandStr),w.command(-1===$t.indexOf(n+", "+i),"unallowed blending combination (srcRGB, dstRGB) = ("+n+", "+i+")",e.commandStr),[Zt[n],Zt[i],Zt[r],Zt[o]]}),(function(e,n,r){var i=e.constants.blendFuncs;function o(o,a){var s=n.def('"',o,a,'" in ',r,"?",r,".",o,a,":",r,".",o);return w.optional((function(){e.assert(n,s+" in "+i,"invalid "+t+"."+o+a+", must be one of "+Object.keys(Zt))})),s}w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid blend func, must be an object")}));var a=o("src","RGB"),s=o("dst","RGB");w.optional((function(){var t=e.constants.invalidBlendCombinations;e.assert(n,t+".indexOf("+a+'+", "+'+s+") === -1 ","unallowed blending combination for (srcRGB, dstRGB)")}));var u=n.def(i,"[",a,"]"),c=n.def(i,"[",o("src","Alpha"),"]");return[u,n.def(i,"[",s,"]"),c,n.def(i,"[",o("dst","Alpha"),"]")]}));case"blend.equation":return s((function(n){return"string"==typeof n?(w.commandParameter(n,m,"invalid "+t,e.commandStr),[m[n],m[n]]):"object"==typeof n?(w.commandParameter(n.rgb,m,t+".rgb",e.commandStr),w.commandParameter(n.alpha,m,t+".alpha",e.commandStr),[m[n.rgb],m[n.alpha]]):void w.commandRaise("invalid blend.equation",e.commandStr)}),(function(e,n,r){var i=e.constants.blendEquations,o=n.def(),a=n.def(),s=e.cond("typeof ",r,'==="string"');return w.optional((function(){function n(t,n,r){e.assert(t,r+" in "+i,"invalid "+n+", must be one of "+Object.keys(m))}n(s.then,t,r),e.assert(s.else,r+"&&typeof "+r+'==="object"',"invalid "+t),n(s.else,t+".rgb",r+".rgb"),n(s.else,t+".alpha",r+".alpha")})),s.then(o,"=",a,"=",i,"[",r,"];"),s.else(o,"=",i,"[",r,".rgb];",a,"=",i,"[",r,".alpha];"),n(s),[o,a]}));case"blend.color":return s((function(t){return w.command(J(t)&&4===t.length,"blend.color must be a 4d array",e.commandStr),P(4,(function(e){return+t[e]}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","blend.color must be a 4d array")})),P(4,(function(t){return e.def("+",n,"[",t,"]")}))}));case"stencil.mask":return s((function(t){return w.commandType(t,"number",a,e.commandStr),0|t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+'==="number"',"invalid stencil.mask")})),e.def(n,"|0")}));case"stencil.func":return s((function(n){w.commandType(n,"object",a,e.commandStr);var r=n.cmp||"keep",i=n.ref||0,o="mask"in n?n.mask:-1;return w.commandParameter(r,Qt,t+".cmp",e.commandStr),w.commandType(i,"number",t+".ref",e.commandStr),w.commandType(o,"number",t+".mask",e.commandStr),[Qt[r],i,o]}),(function(t,e,n){var r=t.constants.compareFuncs;return w.optional((function(){function i(){t.assert(e,Array.prototype.join.call(arguments,""),"invalid stencil.func")}i(n+"&&typeof ",n,'==="object"'),i('!("cmp" in ',n,")||(",n,".cmp in ",r,")")})),[e.def('"cmp" in ',n,"?",r,"[",n,".cmp]",":",7680),e.def(n,".ref|0"),e.def('"mask" in ',n,"?",n,".mask|0:-1")]}));case"stencil.opFront":case"stencil.opBack":return s((function(n){w.commandType(n,"object",a,e.commandStr);var r=n.fail||"keep",i=n.zfail||"keep",o=n.zpass||"keep";return w.commandParameter(r,Jt,t+".fail",e.commandStr),w.commandParameter(i,Jt,t+".zfail",e.commandStr),w.commandParameter(o,Jt,t+".zpass",e.commandStr),["stencil.opBack"===t?1029:1028,Jt[r],Jt[i],Jt[o]]}),(function(e,n,r){var i=e.constants.stencilOps;function o(o){return w.optional((function(){e.assert(n,'!("'+o+'" in '+r+")||("+r+"."+o+" in "+i+")","invalid "+t+"."+o+", must be one of "+Object.keys(Jt))})),n.def('"',o,'" in ',r,"?",i,"[",r,".",o,"]:",7680)}return w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),["stencil.opBack"===t?1029:1028,o("fail"),o("zfail"),o("zpass")]}));case"polygonOffset.offset":return s((function(t){w.commandType(t,"object",a,e.commandStr);var n=0|t.factor,r=0|t.units;return w.commandType(n,"number",a+".factor",e.commandStr),w.commandType(r,"number",a+".units",e.commandStr),[n,r]}),(function(e,n,r){return w.optional((function(){e.assert(n,r+"&&typeof "+r+'==="object"',"invalid "+t)})),[n.def(r,".factor|0"),n.def(r,".units|0")]}));case"cull.face":return s((function(t){var n=0;return"front"===t?n=1028:"back"===t&&(n=1029),w.command(!!n,a,e.commandStr),n}),(function(t,e,n){return w.optional((function(){t.assert(e,n+'==="front"||'+n+'==="back"',"invalid cull.face")})),e.def(n,'==="front"?',1028,":",1029)}));case"lineWidth":return s((function(t){return w.command("number"==typeof t&&t>=i.lineWidthDims[0]&&t<=i.lineWidthDims[1],"invalid line width, must be a positive number between "+i.lineWidthDims[0]+" and "+i.lineWidthDims[1],e.commandStr),t}),(function(t,e,n){return w.optional((function(){t.assert(e,"typeof "+n+'==="number"&&'+n+">="+i.lineWidthDims[0]+"&&"+n+"<="+i.lineWidthDims[1],"invalid line width")})),n}));case"frontFace":return s((function(t){return w.commandParameter(t,ee,a,e.commandStr),ee[t]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+'==="cw"||'+n+'==="ccw"',"invalid frontFace, must be one of cw,ccw")})),e.def(n+'==="cw"?2304:2305')}));case"colorMask":return s((function(t){return w.command(J(t)&&4===t.length,"color.mask must be length 4 array",e.commandStr),t.map((function(t){return!!t}))}),(function(t,e,n){return w.optional((function(){t.assert(e,t.shared.isArrayLike+"("+n+")&&"+n+".length===4","invalid color.mask")})),P(4,(function(t){return"!!"+n+"["+t+"]"}))}));case"sample.coverage":return s((function(t){w.command("object"==typeof t&&t,a,e.commandStr);var n="value"in t?t.value:1,r=!!t.invert;return w.command("number"==typeof n&&n>=0&&n<=1,"sample.coverage.value must be a number between 0 and 1",e.commandStr),[n,r]}),(function(t,e,n){return w.optional((function(){t.assert(e,n+"&&typeof "+n+'==="object"',"invalid sample.coverage")})),[e.def('"value" in ',n,"?+",n,".value:1"),e.def("!!",n,".invert")]}))}})),o}(t,f),M=function(t,e,r){var i=t.static,o=t.dynamic;function a(t){if(t in i){var e=n.id(i[t]);w.optional((function(){h.shader(te[t],e,w.guessCommand())}));var r=ae((function(){return e}));return r.id=e,r}if(t in o){var a=o[t];return se(a,(function(e,n){var r=e.invoke(n,a),i=n.def(e.shared.strings,".id(",r,")");return w.optional((function(){n(e.shared.shader,".shader(",te[t],",",i,",",e.command,");")})),i}))}return null}var s,u=a(Ft),c=a(Gt),l=null;return oe(u)&&oe(c)?(l=h.program(c.id,u.id,null,r),s=ae((function(t,e){return t.link(l)}))):s=new ie(u&&u.thisDep||c&&c.thisDep,u&&u.contextDep||c&&c.contextDep,u&&u.propDep||c&&c.propDep,(function(t,e){var n,r=t.shared.shader;n=u?u.append(t,e):e.def(r,".",Ft);var i=r+".program("+(c?c.append(t,e):e.def(r,".",Gt))+","+n;return w.optional((function(){i+=","+t.command})),e.def(i+")")})),{frag:u,vert:c,progVar:s,program:l}}(t,0,g);function O(t){var e=x[t];e&&(E[t]=e)}O("viewport"),O(A("scissor.box"));var k=Object.keys(E).length>0,C={framebuffer:b,draw:_,shader:M,state:E,dirty:k,scopeVAO:null,drawVAO:null,useVAO:!1,attributes:{}};if(C.profile=function(t){var e,n=t.static,r=t.dynamic;if(Rt in n){var i=!!n[Rt];(e=ae((function(t,e){return i}))).enable=i}else if(Rt in r){var o=r[Rt];e=se(o,(function(t,e){return t.invoke(e,o)}))}return e}(t),C.uniforms=function(t,e){var n=t.static,r=t.dynamic,i={};return Object.keys(n).forEach((function(t){var r,o=n[t];if("number"==typeof o||"boolean"==typeof o)r=ae((function(){return o}));else if("function"==typeof o){var a=o._reglType;"texture2d"===a||"textureCube"===a?r=ae((function(t){return t.link(o)})):"framebuffer"===a||"framebufferCube"===a?(w.command(o.color.length>0,'missing color attachment for framebuffer sent to uniform "'+t+'"',e.commandStr),r=ae((function(t){return t.link(o.color[0])}))):w.commandRaise('invalid data for uniform "'+t+'"',e.commandStr)}else J(o)?r=ae((function(e){return e.global.def("[",P(o.length,(function(n){return w.command("number"==typeof o[n]||"boolean"==typeof o[n],"invalid uniform "+t,e.commandStr),o[n]})),"]")})):w.commandRaise('invalid or missing data for uniform "'+t+'"',e.commandStr);r.value=o,i[t]=r})),Object.keys(r).forEach((function(t){var e=r[t];i[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),i}(s,f),C.drawVAO=C.scopeVAO=function(t,e){var n=t.static,r=t.dynamic;if(Xt in n){var i=n[Xt];return null!==i&&null===l.getVAO(i)&&(i=l.createVAO(i)),ae((function(t){return t.link(l.getVAO(i))}))}if(Xt in r){var o=r[Xt];return se(o,(function(t,e){var n=t.invoke(e,o);return e.def(t.shared.vao+".getVAO("+n+")")}))}return null}(t),!C.drawVAO&&M.program&&!g&&r.angle_instanced_arrays){var T=!0,I=M.program.attributes.map((function(t){var n=e.static[t];return T=T&&!!n,n}));if(T&&I.length>0){var N=l.getVAO(l.createVAO(I));C.drawVAO=new ie(null,null,null,(function(t,e){return t.link(N)})),C.useVAO=!0}}return g?C.useVAO=!0:C.attributes=function(t,e){var r=t.static,i=t.dynamic,a={};return Object.keys(r).forEach((function(t){var i=r[t],s=n.id(t),u=new v;if(ne(i))u.state=1,u.buffer=o.getBuffer(o.create(i,34962,!1,!0)),u.type=0;else{var c=o.getBuffer(i);if(c)u.state=1,u.buffer=c,u.type=0;else if(w.command("object"==typeof i&&i,"invalid data for attribute "+t,e.commandStr),"constant"in i){var l=i.constant;u.buffer="null",u.state=2,"number"==typeof l?u.x=l:(w.command(J(l)&&l.length>0&&l.length<=4,"invalid constant for attribute "+t,e.commandStr),Lt.forEach((function(t,e){e=0,'invalid offset for attribute "'+t+'"',e.commandStr);var f=0|i.stride;w.command(f>=0&&f<256,'invalid stride for attribute "'+t+'", must be integer betweeen [0, 255]',e.commandStr);var d=0|i.size;w.command(!("size"in i)||d>0&&d<=4,'invalid size for attribute "'+t+'", must be 1,2,3,4',e.commandStr);var p=!!i.normalized,g=0;"type"in i&&(w.commandParameter(i.type,z,"invalid type for attribute "+t,e.commandStr),g=z[i.type]);var m=0|i.divisor;"divisor"in i&&(w.command(0===m||y,'cannot specify divisor for attribute "'+t+'", instancing not supported',e.commandStr),w.command(m>=0,'invalid divisor for attribute "'+t+'"',e.commandStr)),w.optional((function(){var n=e.commandStr,r=["buffer","offset","divisor","normalized","type","size","stride"];Object.keys(i).forEach((function(e){w.command(r.indexOf(e)>=0,'unknown parameter "'+e+'" for attribute pointer "'+t+'" (valid parameters are '+r+")",n)}))})),u.buffer=c,u.state=1,u.size=d,u.normalized=p,u.type=g||c.dtype,u.offset=h,u.stride=f,u.divisor=m}}a[t]=ae((function(t,e){var n=t.attribCache;if(s in n)return n[s];var r={isStream:!1};return Object.keys(u).forEach((function(t){r[t]=u[t]})),u.buffer&&(r.buffer=t.link(u.buffer),r.type=r.type||r.buffer+".dtype"),n[s]=r,r}))})),Object.keys(i).forEach((function(t){var e=i[t];a[t]=se(e,(function(n,r){var i=n.invoke(r,e),o=n.shared,a=n.constants,s=o.isBufferArgs,u=o.buffer;w.optional((function(){n.assert(r,i+"&&(typeof "+i+'==="object"||typeof '+i+'==="function")&&('+s+"("+i+")||"+u+".getBuffer("+i+")||"+u+".getBuffer("+i+".buffer)||"+s+"("+i+'.buffer)||("constant" in '+i+"&&(typeof "+i+'.constant==="number"||'+o.isArrayLike+"("+i+".constant))))",'invalid dynamic attribute "'+t+'"')}));var c={isStream:r.def(!1)},l=new v;l.state=1,Object.keys(l).forEach((function(t){c[t]=r.def(""+l[t])}));var h=c.buffer,f=c.type;function d(t){r(c[t],"=",i,".",t,"|0;")}return r("if(",s,"(",i,")){",c.isStream,"=true;",h,"=",u,".createStream(",34962,",",i,");",f,"=",h,".dtype;","}else{",h,"=",u,".getBuffer(",i,");","if(",h,"){",f,"=",h,".dtype;",'}else if("constant" in ',i,"){",c.state,"=",2,";","if(typeof "+i+'.constant === "number"){',c[Lt[0]],"=",i,".constant;",Lt.slice(1).map((function(t){return c[t]})).join("="),"=0;","}else{",Lt.map((function(t,e){return c[t]+"="+i+".constant.length>"+e+"?"+i+".constant["+e+"]:0;"})).join(""),"}}else{","if(",s,"(",i,".buffer)){",h,"=",u,".createStream(",34962,",",i,".buffer);","}else{",h,"=",u,".getBuffer(",i,".buffer);","}",f,'="type" in ',i,"?",a.glTypes,"[",i,".type]:",h,".dtype;",c.normalized,"=!!",i,".normalized;"),d("size"),d("offset"),d("stride"),d("divisor"),r("}}"),r.exit("if(",c.isStream,"){",u,".destroyStream(",h,");","}"),c}))})),a}(e,f),C.context=function(t){var e=t.static,n=t.dynamic,r={};return Object.keys(e).forEach((function(t){var n=e[t];r[t]=ae((function(t,e){return"number"==typeof n||"boolean"==typeof n?""+n:t.link(n)}))})),Object.keys(n).forEach((function(t){var e=n[t];r[t]=se(e,(function(t,n){return t.invoke(n,e)}))})),r}(c),C}function L(t,e,n){var r=t.shared.context,i=t.scope();Object.keys(n).forEach((function(o){e.save(r,"."+o);var a=n[o].append(t,e);Array.isArray(a)?i(r,".",o,"=[",a.join(),"];"):i(r,".",o,"=",a,";")})),e(i)}function R(t,e,n,r){var i,o=t.shared,a=o.gl,s=o.framebuffer;b&&(i=e.def(o.extensions,".webgl_draw_buffers"));var u,c=t.constants,l=c.drawBuffer,h=c.backBuffer;u=n?n.append(t,e):e.def(s,".next"),r||e("if(",u,"!==",s,".cur){"),e("if(",u,"){",a,".bindFramebuffer(",36160,",",u,".framebuffer);"),b&&e(i,".drawBuffersWEBGL(",l,"[",u,".colorAttachments.length]);"),e("}else{",a,".bindFramebuffer(",36160,",null);"),b&&e(i,".drawBuffersWEBGL(",h,");"),e("}",s,".cur=",u,";"),r||e("}")}function B(t,e,n){var r=t.shared,i=r.gl,o=t.current,a=t.next,s=r.current,u=r.next,c=t.cond(s,".dirty");S.forEach((function(e){var r,l,h=A(e);if(!(h in n.state))if(h in a){r=a[h],l=o[h];var f=P(x[h].length,(function(t){return c.def(r,"[",t,"]")}));c(t.cond(f.map((function(t,e){return t+"!=="+l+"["+e+"]"})).join("||")).then(i,".",M[h],"(",f,");",f.map((function(t,e){return l+"["+e+"]="+t})).join(";"),";"))}else{r=c.def(u,".",h);var d=t.cond(r,"!==",s,".",h);c(d),h in E?d(t.cond(r).then(i,".enable(",E[h],");").else(i,".disable(",E[h],");"),s,".",h,"=",r,";"):d(i,".",M[h],"(",r,");",s,".",h,"=",r,";")}})),0===Object.keys(n.state).length&&c(s,".dirty=false;"),e(c)}function G(t,e,n,r){var i=t.shared,o=t.current,a=i.current,s=i.gl;re(Object.keys(n)).forEach((function(i){var u=n[i];if(!r||r(u)){var c=u.append(t,e);if(E[i]){var l=E[i];oe(u)?e(s,c?".enable(":".disable(",l,");"):e(t.cond(c).then(s,".enable(",l,");").else(s,".disable(",l,");")),e(a,".",i,"=",c,";")}else if(J(c)){var h=o[i];e(s,".",M[i],"(",c,");",c.map((function(t,e){return h+"["+e+"]="+t})).join(";"),";")}else e(s,".",M[i],"(",c,");",a,".",i,"=",c,";")}}))}function F(t,e){y&&(t.instancing=e.def(t.shared.extensions,".angle_instanced_arrays"))}function U(t,e,n,r,i){var o,a,s,u=t.shared,c=t.stats,l=u.current,h=u.timer,f=n.profile;function d(){return"undefined"==typeof performance?"Date.now()":"performance.now()"}function g(t){t(o=e.def(),"=",d(),";"),"string"==typeof i?t(c,".count+=",i,";"):t(c,".count++;"),p&&(r?t(a=e.def(),"=",h,".getNumPendingQueries();"):t(h,".beginQuery(",c,");"))}function v(t){t(c,".cpuTime+=",d(),"-",o,";"),p&&(r?t(h,".pushScopeStats(",a,",",h,".getNumPendingQueries(),",c,");"):t(h,".endQuery();"))}function m(t){var n=e.def(l,".profile");e(l,".profile=",t,";"),e.exit(l,".profile=",n,";")}if(f){if(oe(f))return void(f.enable?(g(e),v(e.exit),m("true")):m("false"));m(s=f.append(t,e))}else s=e.def(l,".profile");var y=t.block();g(y),e("if(",s,"){",y,"}");var b=t.block();v(b),e.exit("if(",s,"){",b,"}")}function V(t,e,n,r,i){var o=t.shared;r.forEach((function(r){var a,s=r.name,u=n.attributes[s];if(u){if(!i(u))return;a=u.append(t,e)}else{if(!i(ue))return;var c=t.scopeAttrib(s);w.optional((function(){t.assert(e,c+".state","missing attribute "+s)})),a={},Object.keys(new v).forEach((function(t){a[t]=e.def(c,".",t)}))}!function(n,r,i){var a=o.gl,s=e.def(n,".location"),u=e.def(o.attributes,"[",s,"]"),c=i.state,l=i.buffer,h=[i.x,i.y,i.z,i.w],f=["buffer","normalized","offset","stride"];function d(){e("if(!",u,".buffer){",a,".enableVertexAttribArray(",s,");}");var n,o=i.type;if(n=i.size?e.def(i.size,"||",r):r,e("if(",u,".type!==",o,"||",u,".size!==",n,"||",f.map((function(t){return u+"."+t+"!=="+i[t]})).join("||"),"){",a,".bindBuffer(",34962,",",l,".buffer);",a,".vertexAttribPointer(",[s,n,o,i.normalized,i.stride,i.offset],");",u,".type=",o,";",u,".size=",n,";",f.map((function(t){return u+"."+t+"="+i[t]+";"})).join(""),"}"),y){var c=i.divisor;e("if(",u,".divisor!==",c,"){",t.instancing,".vertexAttribDivisorANGLE(",[s,c],");",u,".divisor=",c,";}")}}function p(){e("if(",u,".buffer){",a,".disableVertexAttribArray(",s,");",u,".buffer=null;","}if(",Lt.map((function(t,e){return u+"."+t+"!=="+h[e]})).join("||"),"){",a,".vertexAttrib4f(",s,",",h,");",Lt.map((function(t,e){return u+"."+t+"="+h[e]+";"})).join(""),"}")}1===c?d():2===c?p():(e("if(",c,"===",1,"){"),d(),e("}else{"),p(),e("}"))}(t.link(r),function(t){switch(t){case 35664:case 35667:case 35671:return 2;case 35665:case 35668:case 35672:return 3;case 35666:case 35669:case 35673:return 4;default:return 1}}(r.info.type),a)}))}function W(t,e,r,i,o){for(var a,s=t.shared,u=s.gl,c=0;c1?e(P(x,(function(t){return Array.isArray(l)?l[t]:l+"["+t+"]"}))):(w(!Array.isArray(l),"uniform value must not be an array"),e(l));e(");")}}function Y(t,e,n,r){var i=t.shared,o=i.gl,a=i.draw,s=r.draw,u=function(){var i,u=s.elements,c=e;return u?((u.contextDep&&r.contextDynamic||u.propDep)&&(c=n),i=u.append(t,c)):i=c.def(a,".",zt),i&&c("if("+i+")"+o+".bindBuffer(34963,"+i+".buffer.buffer);"),i}();function c(i){var o=s[i];return o?o.contextDep&&r.contextDynamic||o.propDep?o.append(t,n):o.append(t,e):e.def(a,".",i)}var l,h,f=c(Ut),d=c(Wt),p=function(){var i,o=s.count,u=e;return o?((o.contextDep&&r.contextDynamic||o.propDep)&&(u=n),i=o.append(t,u),w.optional((function(){o.MISSING&&t.assert(e,"false","missing vertex count"),o.DYNAMIC&&t.assert(u,i+">=0","missing vertex count")}))):(i=u.def(a,".",Vt),w.optional((function(){t.assert(u,i+">=0","missing vertex count")}))),i}();if("number"==typeof p){if(0===p)return}else n("if(",p,"){"),n.exit("}");y&&(l=c(Yt),h=t.instancing);var g=u+".type",v=s.elements&&oe(s.elements);function m(){function t(){n(h,".drawElementsInstancedANGLE(",[f,p,g,d+"<<(("+g+"-5121)>>1)",l],");")}function e(){n(h,".drawArraysInstancedANGLE(",[f,d,p,l],");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}function b(){function t(){n(o+".drawElements("+[f,p,g,d+"<<(("+g+"-5121)>>1)"]+");")}function e(){n(o+".drawArrays("+[f,d,p]+");")}u?v?t():(n("if(",u,"){"),t(),n("}else{"),e(),n("}")):e()}y&&("number"!=typeof l||l>=0)?"string"==typeof l?(n("if(",l,">0){"),m(),n("}else if(",l,"<0){"),b(),n("}")):m():b()}function X(t,e,n,r,i){var o=j(),a=o.proc("body",i);return w.optional((function(){o.commandStr=e.commandStr,o.command=o.link(e.commandStr)})),y&&(o.instancing=a.def(o.shared.extensions,".angle_instanced_arrays")),t(o,a,n,r),o.compile().body}function H(t,e,n,r){F(t,e),n.useVAO?n.drawVAO?e(t.shared.vao,".setVAO(",n.drawVAO.append(t,e),");"):e(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(e(t.shared.vao,".setVAO(null);"),V(t,e,n,r.attributes,(function(){return!0}))),W(t,e,n,r.uniforms,(function(){return!0})),Y(t,e,e,n)}function q(t,e,n,r){function i(){return!0}t.batchId="a1",F(t,e),V(t,e,n,r.attributes,i),W(t,e,n,r.uniforms,i),Y(t,e,e,n)}function Z(t,e,n,r){F(t,e);var i=n.contextDep,o=e.def(),a=e.def();t.shared.props=a,t.batchId=o;var s=t.scope(),u=t.scope();function c(t){return t.contextDep&&i||t.propDep}function l(t){return!c(t)}if(e(s.entry,"for(",o,"=0;",o,"<","a1",";++",o,"){",a,"=","a0","[",o,"];",u,"}",s.exit),n.needsContext&&L(t,u,n.context),n.needsFramebuffer&&R(t,u,n.framebuffer),G(t,u,n.state,c),n.profile&&c(n.profile)&&U(t,u,n,!1,!0),r)n.useVAO?n.drawVAO?c(n.drawVAO)?u(t.shared.vao,".setVAO(",n.drawVAO.append(t,u),");"):s(t.shared.vao,".setVAO(",n.drawVAO.append(t,s),");"):s(t.shared.vao,".setVAO(",t.shared.vao,".targetVAO);"):(s(t.shared.vao,".setVAO(null);"),V(t,s,n,r.attributes,l),V(t,u,n,r.attributes,c)),W(t,s,n,r.uniforms,l),W(t,u,n,r.uniforms,c),Y(t,s,u,n);else{var h=t.global.def("{}"),f=n.shader.progVar.append(t,u),d=u.def(f,".id"),p=u.def(h,"[",d,"]");u(t.shared.gl,".useProgram(",f,".program);","if(!",p,"){",p,"=",h,"[",d,"]=",t.link((function(e){return X(q,t,n,e,2)})),"(",f,");}",p,".call(this,a0[",o,"],",o,");")}}function $(t,e,n){var r=e.static[n];if(r&&function(t){if("object"==typeof t&&!J(t)){for(var e=Object.keys(t),n=0;n0&&n(t.shared.current,".dirty=true;")}(s,u),function(t,e){var r=t.proc("scope",3);t.batchId="a2";var i=t.shared,o=i.current;function a(n){var o=e.shader[n];o&&r.set(i.shader,"."+n,o.append(t,r))}L(t,r,e.context),e.framebuffer&&e.framebuffer.append(t,r),re(Object.keys(e.state)).forEach((function(n){var o=e.state[n].append(t,r);J(o)?o.forEach((function(e,i){r.set(t.next[n],"["+i+"]",e)})):r.set(i.next,"."+n,o)})),U(t,r,e,!0,!0),[zt,Wt,Vt,Yt,Ut].forEach((function(n){var o=e.draw[n];o&&r.set(i.draw,"."+n,""+o.append(t,r))})),Object.keys(e.uniforms).forEach((function(o){var a=e.uniforms[o].append(t,r);Array.isArray(a)&&(a="["+a.join()+"]"),r.set(i.uniforms,"["+n.id(o)+"]",a)})),Object.keys(e.attributes).forEach((function(n){var i=e.attributes[n].append(t,r),o=t.scopeAttrib(n);Object.keys(new v).forEach((function(t){r.set(o,"."+t,i[t])}))})),e.scopeVAO&&r.set(i.vao,".targetVAO",e.scopeVAO.append(t,r)),a(Gt),a(Ft),Object.keys(e.state).length>0&&(r(o,".dirty=true;"),r.exit(o,".dirty=true;")),r("a1(",t.shared.context,",a0,",t.batchId,");")}(s,u),function(t,e){var n=t.proc("batch",2);t.batchId="0",F(t,n);var r=!1,i=!0;Object.keys(e.context).forEach((function(t){r=r||e.context[t].propDep})),r||(L(t,n,e.context),i=!1);var o=e.framebuffer,a=!1;function s(t){return t.contextDep&&r||t.propDep}o?(o.propDep?r=a=!0:o.contextDep&&r&&(a=!0),a||R(t,n,o)):R(t,n,null),e.state.viewport&&e.state.viewport.propDep&&(r=!0),B(t,n,e),G(t,n,e.state,(function(t){return!s(t)})),e.profile&&s(e.profile)||U(t,n,e,!1,"a1"),e.contextDep=r,e.needsContext=i,e.needsFramebuffer=a;var u=e.shader.progVar;if(u.contextDep&&r||u.propDep)Z(t,n,e,null);else{var c=u.append(t,n);if(n(t.shared.gl,".useProgram(",c,".program);"),e.shader.program)Z(t,n,e,e.shader.program);else{n(t.shared.vao,".setVAO(null);");var l=t.global.def("{}"),h=n.def(c,".id"),f=n.def(l,"[",h,"]");n(t.cond(f).then(f,".call(this,a0,a1);").else(f,"=",l,"[",h,"]=",t.link((function(n){return X(Z,t,e,n,2)})),"(",c,");",f,".call(this,a0,a1);"))}}Object.keys(e.state).length>0&&n(t.shared.current,".dirty=true;")}(s,u),e(s.compile(),{destroy:function(){u.shader.program.destroy()}})}}}var le=function(t,e){if(!e.ext_disjoint_timer_query)return null;var n=[];function r(t){n.push(t)}var i=[];function o(){this.startQueryIndex=-1,this.endQueryIndex=-1,this.sum=0,this.stats=null}var a=[];function s(t){a.push(t)}var u=[];function c(t,e,n){var r=a.pop()||new o;r.startQueryIndex=t,r.endQueryIndex=e,r.sum=0,r.stats=n,u.push(r)}var l=[],h=[];return{beginQuery:function(t){var r=n.pop()||e.ext_disjoint_timer_query.createQueryEXT();e.ext_disjoint_timer_query.beginQueryEXT(35007,r),i.push(r),c(i.length-1,i.length,t)},endQuery:function(){e.ext_disjoint_timer_query.endQueryEXT(35007)},pushScopeStats:c,update:function(){var t,n,o=i.length;if(0!==o){h.length=Math.max(h.length,o+1),l.length=Math.max(l.length,o+1),l[0]=0,h[0]=0;var a=0;for(t=0,n=0;n0)if(Array.isArray(n[0])){s=W(n);for(var l=1,h=1;h0)if("number"==typeof e[0]){var o=D.allocType(f.dtype,e.length);H(o,e),p(o,i),D.freeType(o)}else if(Array.isArray(e[0])||t(e[0])){r=W(e);var a=V(e,r,f.dtype);p(a,i),D.freeType(a)}else w.raise("invalid buffer data")}else if(L(e)){r=e.shape;var s=e.stride,u=0,c=0,l=0,h=0;1===r.length?(u=r[0],c=1,l=s[0],h=0):2===r.length?(u=r[0],c=r[1],l=s[0],h=s[1]):w.raise("invalid shape");var g=Array.isArray(e.data)?f.dtype:X(e.data),v=D.allocType(g,u*c);q(v,e.data,u,c,l,h,e.offset),p(v,i),D.freeType(v)}else w.raise("invalid data for buffer subdata");return d},r.profile&&(d.stats=f.stats),d.destroy=function(){h(f)},d},createStream:function(t,e){var n=u.pop();return n||(n=new s(t)),n.bind(),l(n,e,35040,0,1,!1),n},destroyStream:function(t){u.push(t)},clear:function(){R(a).forEach(h),u.forEach(h)},getBuffer:function(t){return t&&t._buffer instanceof s?t._buffer:null},restore:function(){R(a).forEach((function(t){t.buffer=e.createBuffer(),e.bindBuffer(t.type,t.buffer),e.bufferData(t.type,t.persistentData||t.byteLength,t.usage)}))},_initBuffer:l}}(i,h,r,(function(t){return x.destroyBuffer(t)})),x=function(e,n,r,i,o){for(var a=r.maxAttributes,s=new Array(a),u=0;u0,"must specify at least one attribute");var i={},u=r.attributes;u.length=e.length;for(var c=0;c=d.byteLength?l.subdata(d):(l.destroy(),r.buffers[c]=null)),r.buffers[c]||(l=r.buffers[c]=o.create(h,34962,!1,!0)),f.buffer=o.getBuffer(l),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1,i[c]=1):o.getBuffer(h)?(f.buffer=o.getBuffer(h),f.size=0|f.buffer.dimension,f.normalized=!1,f.type=f.buffer.dtype,f.offset=0,f.stride=0,f.divisor=0,f.state=1):o.getBuffer(h.buffer)?(f.buffer=o.getBuffer(h.buffer),f.size=0|(+h.size||f.buffer.dimension),f.normalized=!!h.normalized||!1,"type"in h?(w.parameter(h.type,z,"invalid buffer type"),f.type=z[h.type]):f.type=f.buffer.dtype,f.offset=0|(h.offset||0),f.stride=0|(h.stride||0),f.divisor=0|(h.divisor||0),f.state=1,w(f.size>=1&&f.size<=4,"size must be between 1 and 4"),w(f.offset>=0,"invalid offset"),w(f.stride>=0&&f.stride<=255,"stride must be between 0 and 255"),w(f.divisor>=0,"divisor must be positive"),w(!f.divisor||!!n.angle_instanced_arrays,"ANGLE_instanced_arrays must be enabled to use divisor")):"x"in h?(w(c>0,"first attribute must not be a constant"),f.x=+h.x||0,f.y=+h.y||0,f.z=+h.z||0,f.w=+h.w||0,f.state=2):w(!1,"invalid attribute spec for location "+c)}for(var p=0;p>=1:5125===h&&(d>>=2)),i.vertCount=d;var p=s;if(s<0){p=4;var g=i.buffer.dimension;1===g&&(p=0),2===g&&(p=1),3===g&&(p=4)}i.primType=p}function h(t){i.elementsCount--,w(null!==t.buffer,"must not double destroy elements"),delete o[t.id],t.buffer.destroy(),t.buffer=null}return{create:function(e,n){var o=r.create(null,34963,!0),a=new u(o._buffer);function c(e){if(e)if("number"==typeof e)o(e),a.primType=4,a.vertCount=0|e,a.type=5121;else{var n=null,r=35044,i=-1,u=-1,h=0,f=0;Array.isArray(e)||t(e)||L(e)?n=e:(w.type(e,"object","invalid arguments for elements"),"data"in e&&(n=e.data,w(Array.isArray(n)||t(n)||L(n),"invalid data for element buffer")),"usage"in e&&(w.parameter(e.usage,U,"invalid element buffer usage"),r=U[e.usage]),"primitive"in e&&(w.parameter(e.primitive,K,"invalid element buffer primitive"),i=K[e.primitive]),"count"in e&&(w("number"==typeof e.count&&e.count>=0,"invalid vertex count for elements"),u=0|e.count),"type"in e&&(w.parameter(e.type,s,"invalid buffer type"),f=s[e.type]),"length"in e?h=0|e.length:(h=u,5123===f||5122===f?h*=2:5125!==f&&5124!==f||(h*=4))),l(a,n,r,i,u,h,f)}else o(),a.primType=4,a.vertCount=0,a.type=5121;return c}return i.elementsCount++,c(e),c._reglType="elements",c._elements=a,c.subdata=function(t,e){return o.subdata(t,e),c},c.destroy=function(){h(a)},c},createStream:function(t){var e=c.pop();return e||(e=new u(r.create(null,34963,!0,!1)._buffer)),l(e,t,35040,-1,-1,0,0),e},destroyStream:function(t){c.push(t)},getElements:function(t){return"function"==typeof t&&t._elements instanceof u?t._elements:null},clear:function(){R(o).forEach(h)}}}(i,f,b,h),S=function(t,n,r,i){var o={},a={};function s(t,e,n,r){this.name=t,this.id=e,this.location=n,this.info=r}function u(t,e){for(var n=0;n1)for(var m=0;mt&&(t=e.stats.uniformsCount)})),t},r.getMaxAttributesCount=function(){var t=0;return h.forEach((function(e){e.stats.attributesCount>t&&(t=e.stats.attributesCount)})),t}),{clear:function(){var e=t.deleteShader.bind(t);R(o).forEach(e),o={},R(a).forEach(e),a={},h.forEach((function(e){t.deleteProgram(e.program)})),h.length=0,l={},r.shaderCount=0},program:function(n,i,s,u){w.command(n>=0,"missing vertex shader",s),w.command(i>=0,"missing fragment shader",s);var c=l[i];c||(c=l[i]={});var f=c[n];if(f&&(f.refCount++,!u))return f;var g=new d(i,n);return r.shaderCount++,p(g,s,u),f||(c[n]=g),h.push(g),e(g,{destroy:function(){if(g.refCount--,g.refCount<=0){t.deleteProgram(g.program);var e=h.indexOf(g);h.splice(e,1),r.shaderCount--}c[g.vertId].refCount<=0&&(t.deleteShader(a[g.vertId]),delete a[g.vertId],delete l[g.fragId][g.vertId]),Object.keys(l[g.fragId]).length||(t.deleteShader(o[g.fragId]),delete o[g.fragId],delete l[g.fragId])}})},restore:function(){o={},a={};for(var t=0;t=2,"invalid renderbuffer shape"),s=0|d[0],u=0|d[1]}else"radius"in f&&(s=u=0|f.radius),"width"in f&&(s=0|f.width),"height"in f&&(u=0|f.height);"format"in f&&(w.parameter(f.format,o,"invalid renderbuffer format"),c=o[f.format])}else"number"==typeof e?(s=0|e,u="number"==typeof r?0|r:s):e?w.raise("invalid arguments to renderbuffer constructor"):s=u=1;if(w(s>0&&u>0&&s<=n.maxRenderbufferSize&&u<=n.maxRenderbufferSize,"invalid renderbuffer size"),s!==l.width||u!==l.height||c!==l.format)return h.width=l.width=s,h.height=l.height=u,l.format=c,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,c,s,u),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Ot(l.format,l.width,l.height)),h.format=a[l.format],h}return u[l.id]=l,r.renderbufferCount++,h(e,s),h.resize=function(e,r){var o=0|e,a=0|r||o;return o===l.width&&a===l.height||(w(o>0&&a>0&&o<=n.maxRenderbufferSize&&a<=n.maxRenderbufferSize,"invalid renderbuffer size"),h.width=l.width=o,h.height=l.height=a,t.bindRenderbuffer(36161,l.renderbuffer),t.renderbufferStorage(36161,l.format,o,a),w(0===t.getError(),"invalid render buffer format"),i.profile&&(l.stats.size=Ot(l.format,l.width,l.height))),h},h._reglType="renderbuffer",h._renderbuffer=l,i.profile&&(h.stats=l.stats),h.destroy=function(){l.decRef()},h},clear:function(){R(u).forEach(l)},restore:function(){R(u).forEach((function(e){e.renderbuffer=t.createRenderbuffer(),t.bindRenderbuffer(36161,e.renderbuffer),t.renderbufferStorage(36161,e.format,e.width,e.height)})),t.bindRenderbuffer(36161,null)}}}(i,f,y,h,r),C=function(t,n,r,i,o,a){var s={cur:null,next:null,dirty:!1,setFBO:null},u=["rgba"],c=["rgba4","rgb565","rgb5 a1"];n.ext_srgb&&c.push("srgba"),n.ext_color_buffer_half_float&&c.push("rgba16f","rgb16f"),n.webgl_color_buffer_float&&c.push("rgba32f");var l=["uint8"];function h(t,e,n){this.target=t,this.texture=e,this.renderbuffer=n;var r=0,i=0;e?(r=e.width,i=e.height):n&&(r=n.width,i=n.height),this.width=r,this.height=i}function f(t){t&&(t.texture&&t.texture._texture.decRef(),t.renderbuffer&&t.renderbuffer._renderbuffer.decRef())}function d(t,e,n){if(t)if(t.texture){var r=t.texture._texture,i=Math.max(1,r.width),o=Math.max(1,r.height);w(i===e&&o===n,"inconsistent width/height for supplied texture"),r.refCount+=1}else{var a=t.renderbuffer._renderbuffer;w(a.width===e&&a.height===n,"inconsistent width/height for renderbuffer"),a.refCount+=1}}function p(e,n){n&&(n.texture?t.framebufferTexture2D(36160,e,n.target,n.texture._texture.texture,0):t.framebufferRenderbuffer(36160,e,36161,n.renderbuffer._renderbuffer.renderbuffer))}function g(t){var e=3553,n=null,r=null,i=t;"object"==typeof t&&(i=t.data,"target"in t&&(e=0|t.target)),w.type(i,"function","invalid attachment data");var o=i._reglType;return"texture2d"===o?(n=i,w(3553===e)):"textureCube"===o?(n=i,w(e>=34069&&e<34075,"invalid cube map target")):"renderbuffer"===o?(r=i,e=36161):w.raise("invalid regl object for attachment"),new h(e,n,r)}function v(t,e,n,r,a){if(n){var s=i.create2D({width:t,height:e,format:r,type:a});return s._texture.refCount=0,new h(3553,s,null)}var u=o.create({width:t,height:e,format:r});return u._renderbuffer.refCount=0,new h(36161,null,u)}function m(t){return t&&(t.texture||t.renderbuffer)}function y(t,e,n){t&&(t.texture?t.texture.resize(e,n):t.renderbuffer&&t.renderbuffer.resize(e,n),t.width=e,t.height=n)}n.oes_texture_half_float&&l.push("half float","float16"),n.oes_texture_float&&l.push("float","float32");var b=0,x={};function _(){this.id=b++,x[this.id]=this,this.framebuffer=t.createFramebuffer(),this.width=0,this.height=0,this.colorAttachments=[],this.depthAttachment=null,this.stencilAttachment=null,this.depthStencilAttachment=null}function S(t){t.colorAttachments.forEach(f),f(t.depthAttachment),f(t.stencilAttachment),f(t.depthStencilAttachment)}function E(e){var n=e.framebuffer;w(n,"must not double destroy framebuffer"),t.deleteFramebuffer(n),e.framebuffer=null,a.framebufferCount--,delete x[e.id]}function M(e){var n;t.bindFramebuffer(36160,e.framebuffer);var i=e.colorAttachments;for(n=0;n=2,"invalid shape for framebuffer"),a=P[0],f=P[1]}else"radius"in I&&(a=f=I.radius),"width"in I&&(a=I.width),"height"in I&&(f=I.height);("color"in I||"colors"in I)&&(b=I.color||I.colors,Array.isArray(b)&&w(1===b.length||n.webgl_draw_buffers,"multiple render targets not supported")),b||("colorCount"in I&&(O=0|I.colorCount,w(O>0,"invalid color buffer count")),"colorTexture"in I&&(x=!!I.colorTexture,_="rgba4"),"colorType"in I&&(E=I.colorType,x?(w(n.oes_texture_float||!("float"===E||"float32"===E),"you must enable OES_texture_float in order to use floating point framebuffer objects"),w(n.oes_texture_half_float||!("half float"===E||"float16"===E),"you must enable OES_texture_half_float in order to use 16-bit floating point framebuffer objects")):"half float"===E||"float16"===E?(w(n.ext_color_buffer_half_float,"you must enable EXT_color_buffer_half_float to use 16-bit render buffers"),_="rgba16f"):"float"!==E&&"float32"!==E||(w(n.webgl_color_buffer_float,"you must enable WEBGL_color_buffer_float in order to use 32-bit floating point renderbuffers"),_="rgba32f"),w.oneOf(E,l,"invalid color type")),"colorFormat"in I&&(_=I.colorFormat,u.indexOf(_)>=0?x=!0:c.indexOf(_)>=0?x=!1:x?w.oneOf(I.colorFormat,u,"invalid color format for texture"):w.oneOf(I.colorFormat,c,"invalid color format for renderbuffer"))),("depthTexture"in I||"depthStencilTexture"in I)&&(T=!(!I.depthTexture&&!I.depthStencilTexture),w(!T||n.webgl_depth_texture,"webgl_depth_texture extension not supported")),"depth"in I&&("boolean"==typeof I.depth?p=I.depth:(A=I.depth,y=!1)),"stencil"in I&&("boolean"==typeof I.stencil?y=I.stencil:(k=I.stencil,p=!1)),"depthStencil"in I&&("boolean"==typeof I.depthStencil?p=y=I.depthStencil:(C=I.depthStencil,p=!1,y=!1))}else a=f=1;var N=null,j=null,D=null,L=null;if(Array.isArray(b))N=b.map(g);else if(b)N=[g(b)];else for(N=new Array(O),i=0;i=0||N[i].renderbuffer&&Tt.indexOf(N[i].renderbuffer._renderbuffer.format)>=0,"framebuffer color attachment "+i+" is invalid"),N[i]&&N[i].texture){var B=kt[N[i].texture._texture.format]*Ct[N[i].texture._texture.type];null===R?R=B:w(R===B,"all color attachments much have the same number of bits per pixel.")}return d(j,a,f),w(!j||j.texture&&6402===j.texture._texture.format||j.renderbuffer&&33189===j.renderbuffer._renderbuffer.format,"invalid depth attachment for framebuffer object"),d(D,a,f),w(!D||D.renderbuffer&&36168===D.renderbuffer._renderbuffer.format,"invalid stencil attachment for framebuffer object"),d(L,a,f),w(!L||L.texture&&34041===L.texture._texture.format||L.renderbuffer&&34041===L.renderbuffer._renderbuffer.format,"invalid depth-stencil attachment for framebuffer object"),S(o),o.width=a,o.height=f,o.colorAttachments=N,o.depthAttachment=j,o.stencilAttachment=D,o.depthStencilAttachment=L,h.color=N.map(m),h.depth=m(j),h.stencil=m(D),h.depthStencil=m(L),h.width=o.width,h.height=o.height,M(o),h}return a.framebufferCount++,h(t,i),e(h,{resize:function(t,e){w(s.next!==o,"can not resize a framebuffer which is currently in use");var n=Math.max(0|t,1),r=Math.max(0|e||n,1);if(n===o.width&&r===o.height)return h;for(var i=o.colorAttachments,a=0;a=2,"invalid shape for framebuffer"),w(y[0]===y[1],"cube framebuffer must be square"),f=y[0]}else"radius"in m&&(f=0|m.radius),"width"in m?(f=0|m.width,"height"in m&&w(m.height===f,"must be square")):"height"in m&&(f=0|m.height);("color"in m||"colors"in m)&&(d=m.color||m.colors,Array.isArray(d)&&w(1===d.length||n.webgl_draw_buffers,"multiple render targets not supported")),d||("colorCount"in m&&(v=0|m.colorCount,w(v>0,"invalid color buffer count")),"colorType"in m&&(w.oneOf(m.colorType,l,"invalid color type"),g=m.colorType),"colorFormat"in m&&(p=m.colorFormat,w.oneOf(m.colorFormat,u,"invalid color format for texture"))),"depth"in m&&(h.depth=m.depth),"stencil"in m&&(h.stencil=m.stencil),"depthStencil"in m&&(h.depthStencil=m.depthStencil)}else f=1;if(d)if(Array.isArray(d))for(c=[],r=0;r0&&(h.depth=o[0].depth,h.stencil=o[0].stencil,h.depthStencil=o[0].depthStencil),o[r]?o[r](h):o[r]=O(h)}return e(a,{width:f,height:f,color:c})}return a(t),e(a,{faces:o,resize:function(t){var e,n=0|t;if(w(n>0&&n<=r.maxCubeMapSize,"invalid radius for cube fbo"),n===a.width)return a;var i=a.color;for(e=0;e=0;--t){var e=B[t];e&&e(m,null,0)}i.flush(),d&&d.update()}function J(){!$&&B.length>0&&($=A.next(Q))}function tt(){$&&(A.cancel(Q),$=null)}function et(t){t.preventDefault(),a=!0,tt(),G.forEach((function(t){t()}))}function nt(t){i.getError(),a=!1,s.restore(),S.restore(),b.restore(),E.restore(),M.restore(),C.restore(),x.restore(),d&&d.restore(),T.procs.refresh(),J(),F.forEach((function(t){t()}))}function rt(t){function n(t,e){var n={},r={};return Object.keys(t).forEach((function(i){var o=t[i];if(O.isDynamic(o))r[i]=O.unbox(o,i);else{if(e&&Array.isArray(o))for(var a=0;a0)return h.call(this,function(t){for(;d.length=0,"cannot cancel a frame twice"),B[e]=function t(){var e=he(B,t);B[e]=B[B.length-1],B.length-=1,B.length<=0&&tt()}}}}function st(){var t=N.viewport,e=N.scissor_box;t[0]=t[1]=e[0]=e[1]=0,m.viewportWidth=m.framebufferWidth=m.drawingBufferWidth=t[2]=e[2]=i.drawingBufferWidth,m.viewportHeight=m.framebufferHeight=m.drawingBufferHeight=t[3]=e[3]=i.drawingBufferHeight}function ut(){m.tick+=1,m.time=lt(),st(),T.procs.poll()}function ct(){E.refresh(),st(),T.procs.refresh(),d&&d.update()}function lt(){return(k()-p)/1e3}ct();var ht=e(rt,{clear:function(t){if(w("object"==typeof t&&t,"regl.clear() takes an object as input"),"framebuffer"in t)if(t.framebuffer&&"framebufferCube"===t.framebuffer_reglType)for(var n=0;n<6;++n)it(e({framebuffer:t.framebuffer.faces[n]},t),ot);else it(t,ot);else ot(0,t)},prop:O.define.bind(null,1),context:O.define.bind(null,2),this:O.define.bind(null,3),draw:rt({}),buffer:function(t){return b.create(t,34962,!1,!1)},elements:function(t){return _.create(t,!1)},texture:E.create2D,cube:E.createCube,renderbuffer:M.create,framebuffer:C.create,framebufferCube:C.createCube,vao:x.createVAO,attributes:o,frame:at,on:function(t,e){var n;switch(w.type(e,"function","listener callback must be a function"),t){case"frame":return at(e);case"lost":n=G;break;case"restore":n=F;break;case"destroy":n=Z;break;default:w.raise("invalid event, must be one of frame,lost,restore,destroy")}return n.push(e),{cancel:function(){for(var t=0;t=0},read:P,destroy:function(){B.length=0,tt(),j&&(j.removeEventListener("webglcontextlost",et),j.removeEventListener("webglcontextrestored",nt)),S.clear(),C.clear(),M.clear(),E.clear(),_.clear(),b.clear(),x.clear(),d&&d.clear(),Z.forEach((function(t){t()}))},_gl:i,_refresh:ct,poll:function(){ut(),d&&d.update()},now:lt,stats:h});return r.onDone(null,ht),ht}}()},,,,,,,,function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Engine=void 0;const r=n(295),i=n(119),o=n(565),a=n(118),s=n(33);e.Engine=class{constructor(t,e){this.engineOptions=Object.assign({},e),this.viewOptions=Object.assign({fitCenter:!0,fitView:!1,groupPadding:20,leakAreaHeight:150,updateHighlight:"#fc5185"},e.view),this.animationOptions=Object.assign({enable:!0,duration:750,timingFunction:"easePolyOut"},e.animation),this.behaviorOptions=Object.assign({drag:!0,zoom:!0,dragNode:!0,selectNode:!0},e.behavior),this.modelConstructor=new r.ModelConstructor(this),this.viewContainer=new o.ViewContainer(this,t)}render(t,e=!1){if(null==t)return;let n=JSON.stringify(t);if(!1===e&&this.prevStringSource===n)return;this.prevStringSource=n;const r=this.modelConstructor.construct(t);this.viewContainer.render(r)}reLayout(){this.viewContainer.reLayout()}getGraphInstance(){return this.viewContainer.getG6Instance()}hideGroups(t){const e=Array.isArray(t)?t:[t],n=this.viewContainer.getG6Instance();this.modelConstructor.getLayoutGroupTable().forEach(t=>{const r=e.find(e=>e===t.layout);r&&!t.isHide&&(t.modelList.forEach(t=>n.hideItem(t.G6Item)),t.isHide=!0),!r&&t.isHide&&(t.modelList.forEach(t=>n.showItem(t.G6Item)),t.isHide=!1)})}getAllModels(){return[...s.Util.convertGroupTable2ModelList(this.modelConstructor.getLayoutGroupTable()),...this.viewContainer.getAccumulateLeakModels()]}updateStyle(t,e){const n=this.getAllModels(),r=this.modelConstructor.getLayoutGroupTable().get(t);r.options=e,n.forEach(e=>{if(e.group!==t)return;const n=e.getModelType(),i=r.options[n];if(i)if("addressLabel"===n)e.updateG6ModelStyle(e.generateG6ModelProps(i));else{const t=i[e.sourceType];t&&e.updateG6ModelStyle(e.generateG6ModelProps(t))}})}findNode(t){const e=this.getAllModels(),n=t.toString();return e.find(t=>t instanceof a.SVNode&&t.sourceId===n)}resize(t,e){this.viewContainer.resize(t,e)}on(t,e){"function"==typeof e&&("onFreed"!==t&&"onLeak"!==t&&"onLeakAreaUpdate"!==t?this.viewContainer.getG6Instance().on(t,t=>{e(t.item.SVModel)}):i.EventBus.on(t,e))}switchBrushSelect(t){const e=this.viewContainer.getG6Instance();t?e.setMode("brush"):e.setMode("default")}destroy(){this.modelConstructor.destroy(),this.viewContainer.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ModelConstructor=void 0;const r=n(33),i=n(175),o=n(147),a=n(118),s=n(276);e.ModelConstructor=class{constructor(t){this.engine=t,this.prevSourcesStringMap={}}construct(t){const e=new Map,n=i.SV.registeredLayout;return Object.keys(t).forEach(r=>{let i=t[r],o=i.layouter,a=n[o];if(!o||!a)return;let s=JSON.stringify(i.data),u=this.prevSourcesStringMap[r],c=[],l=[],h=[],f=[],d=[];if(u===s)return;const p=a.defineOptions(i.data),g=a.sourcesPreprocess(i.data,p),v=p.node||p.element||{},m=p.marker||{},y=p.indexLabel||{},b=p.addressLabel||{};c=this.constructNodes(r,o,v,g),d=this.constructMarkers(r,o,m,c),f=this.constructIndexLabel(r,o,y,c),h=this.constructAddressLabel(r,o,b,c),c.forEach(t=>{t.freedLabel&&l.push(t.freedLabel)}),e.set(r,{name:r,node:c,freedLabel:l,addressLabel:h,indexLabel:f,link:[],marker:d,options:p,layoutCreator:a,modelList:[...c,...d,...l,...h,...f],layout:o,isHide:!1})}),e.forEach((t,n)=>{const r=t.options.link||{},i=this.constructLinks(n,t.layout,r,t.node,e);t.link=i,t.modelList.push(...i)}),this.layoutGroupTable=e,this.layoutGroupTable}constructNodes(t,e,n,r){let i=[];return r.forEach(r=>{null!==r&&(void 0!==r.type&&null!==r.type||(r.type="default"),i.push(this.createNode(r,r.type,t,e,n[r.type])))}),i}constructLinks(t,e,n,r,i){let o=[];return Object.keys(n).forEach(a=>{for(let s=0;s{l=this.fetchTargetNodes(i,u,r);let f=this.isGeneralLink(c.toString());return l&&(h=this.createLink(a,t,e,u,l,s,n[a]),o.push(h)),f?l:null});else{l=this.fetchTargetNodes(i,u,c);let r=this.isGeneralLink(c.toString());l&&(h=this.createLink(a,t,e,u,l,null,n[a]),o.push(h)),u[a]=r?l:null}else u[a]=null}}),o}constructIndexLabel(t,e,n,r){let i=[];return Object.keys(n).forEach(o=>{for(let a=0;a{const o=new s.SVAddressLabel(r.id+"-address-label",r.sourceType,t,e,r,n);i.push(o)}),i}constructMarkers(t,e,n,r){let i=[];return Object.keys(n).forEach(o=>{for(let a=0;a{var n;return null!==(n=this.parserNodeContent(e,t))&&void 0!==n?n:""}):this.parserNodeContent(e,t),"undefined"===n&&(n=""),null!=n?n:""}createNode(t,e,n,r,i){let o=this.resolveNodeLabel(i.label,t),u=e+"."+t.id.toString(),c=new a.SVNode(u,e,n,r,t,o,i);return c.freed&&(c.freedLabel=new s.SVFreedLabel(u+"-freed-label",e,n,r,c)),c.modelConstructor=this,c}createLink(t,e,n,r,i,a,s){let u=`${t}(${r.id}-${i.id})`;return new o.SVLink(u,t,e,n,r,i,a,s)}parserNodeContent(t,e){let n=r.Util.textParser(e);if(Array.isArray(n)){n.map(e=>t[e]).map((t,r)=>{e=e.replace("["+n[r]+"]",t)})}return e}fetchTargetNodes(t,e,n){let r,i=e.group,o=e.sourceType,a=n,s=i,u=null;if(null==n)return null;("number"==typeof n||"string"==typeof n&&!n.includes("#"))&&(n="default#"+n);let c=n.split("#");if(a=c.pop(),c.length>1)o=c.pop(),s=c.pop();else{let e=c.pop();if(t.get(s).node.find(t=>t.sourceType===e))o=e;else{if(!t.has(e))return null;s=e}}return r=t.get(s).node.filter(t=>t.sourceType===o),void 0===r?null:(u=r.find(t=>t.sourceId===a),u||null)}isGeneralLink(t){let e=0;for(let n=0;nt.id===e.id)}destroy(){this.layoutGroupTable=null,this.prevSourcesStringMap=null}}},function(t,e,n){"use strict";function r(){for(var t=[],e=0;e0;)for(var v=d.pop(),m=v.id,y=(0,s.getNeighbors)(m,t.edges),b=function(r){var i,a=y[r],s=t.nodes.find((function(t){return t.id===a}));if(a===m)o.push(((i={})[a]=v,i));else if(a in g){if(!g[m].has(s)){for(var u=!0,c=[s,v],l=p[m];g[a].size&&!g[a].has(l)&&(c.push(l),l!==p[l.id]);)l=p[l.id];if(c.push(l),e&&n?(u=!1,c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!0)):e&&!n&&c.findIndex((function(t){return e.indexOf(t.id)>-1}))>-1&&(u=!1),u){for(var h={},f=1;f-1)return h;r.push(a),i.add(a);for(var f=l[a.id],d=0;d0;){var n=e.pop();i.has(n)&&(i.delete(n),o[n.id].forEach((function(t){e.push(t)})),o[n.id].clear())}}(a);else for(d=0;d-1}));m-1?g[v.id].push(l[b]):u.push(((i={})[v.id]=v,i))}}return{component:p,adjList:g,minIdx:a}},b=0;b=b})),w=(0,a.detectStrongConnectComponents)({nodes:x,edges:t.edges}).filter((function(t){return t.length>1}));if(0===w.length)break;var _=y(w),S=_.minIdx,E=_.adjList,M=_.component;if(!(M.length>1))break;M.forEach((function(t){o[t.id]=new Set}));var O=c[S];if(e&&n&&-1===e.indexOf(O.id))return u;h(O,O,E),b=S+1}return u};e.detectAllDirectedCycle=l;e.detectAllCycles=function(t,e,n,r){return void 0===r&&(r=!0),e?l(t,n,r):c(t,n,r)};var h=function(t){var e=null,n=t.nodes,r={},i={},a={},s={};(void 0===n?[]:n).forEach((function(t){i[t.id]=t}));for(var u={enter:function(t){var n=t.current,o=t.previous;if(a[n]){e={};for(var s=n,u=o;u!==n;)e[s]=u,s=u,u=r[u];e[s]=u}else a[n]=n,delete i[n],r[n]=o},leave:function(t){var e=t.current;s[e]=e,delete a[e]},allowTraversal:function(t){var n=t.next;return!e&&!s[n]}};Object.keys(i).length;){var c=Object.keys(i)[0];(0,o.default)(t,c,u)}return e};e.default=h},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.findAllPath=e.findShortestPath=void 0;var r,i=(r=n(150))&&r.__esModule?r:{default:r},o=n(47);e.findShortestPath=function(t,e,n,r,o){var a=(0,i.default)(t,e,r,o),s=a.length,u=a.path,c=a.allPath;return{length:s[n],path:u[n],allPath:c[n]}};e.findAllPath=function(t,e,n,r){var i;if(e===n)return[[e]];var a=t.edges,s=void 0===a?[]:a,u=[e],c=((i={})[e]=!0,i),l=[],h=[],f=r?(0,o.getNeighbors)(e,s,"target"):(0,o.getNeighbors)(e,s);for(l.push(f);u.length>0&&l.length>0;){var d=l[l.length-1];if(d.length){var p=d.shift();if(p&&(u.push(p),c[p]=!0,f=r?(0,o.getNeighbors)(p,s,"target"):(0,o.getNeighbors)(p,s),l.push(f.filter((function(t){return!c[t]})))),u[u.length-1]===n){var g=u.map((function(t){return t}));h.push(g);v=u.pop();c[v]=!1,l.pop()}}else{var v=u.pop();c[v]=!1,l.pop()}}return h}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(98))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n,r){void 0===e&&(e=!1),void 0===n&&(n="weight"),void 0===r&&(r=1e3);var a=t.nodes,s=void 0===a?[]:a,u=t.edges,c=void 0===u?[]:u,l={},h={};s.forEach((function(t,e){var n=(0,o.uniqueId)();t.clusterId=n,l[n]={id:n,nodes:[t]},h[t.id]={node:t,idx:e}}));var f=(0,i.default)(t,e),d=[],p={};f.forEach((function(t,e){var n=0,r=s[e].id;p[r]={},t.forEach((function(t,e){if(t){n+=t;var i=s[e].id;p[r][i]=t}})),d.push(n)}));for(var g=0,v=function(){var t=!1;if(s.forEach((function(e){var n={};Object.keys(p[e.id]).forEach((function(t){var r=p[e.id][t],i=h[t].node.clusterId;n[i]||(n[i]=0),n[i]+=r}));var r=-1/0,i=[];if(Object.keys(n).forEach((function(t){r=0&&i.splice(o,1),i&&i.length){t=!0;var a=l[e.clusterId],s=a.nodes.indexOf(e);a.nodes.splice(s,1);var u=Math.floor(Math.random()*i.length),c=l[i[u]];c.nodes.push(e),e.clusterId=c.id}}})),!t)return"break";g++};g100);)y=m,b++,Object.keys(h).forEach((function(t){var e=0;c.forEach((function(r){var i=r.source,o=r.target,a=f[i].node.clusterId,s=f[o].node.clusterId;(a===t&&s!==t||s===t&&a!==t)&&(e+=r[n]||1)})),h[t].sumTot=e})),s.forEach((function(t,e){var r,i=h[t.clusterId],o=0,a=p[e]/(2*v),s=0;i.nodes.forEach((function(t){var n=f[t.id].idx;s+=d[e][n]||0}));var u=s-i.sumTot*a,l=g[t.id];if(Object.keys(l).forEach((function(n){var i=f[n].node.clusterId;if(i!==t.clusterId){var s=h[i],c=s.nodes;if(c&&c.length){var l=0;c.forEach((function(t){var n=f[t.id].idx;l+=d[e][n]||0}));var p=l-s.sumTot*a-u;p>o&&(o=p,r=s)}}})),o>0){r.nodes.push(t);var m=t.clusterId;t.clusterId=r.id;var y=i.nodes.indexOf(t);i.nodes.splice(y,1);var b=0,x=0;c.forEach((function(t){var e=t.source,i=t.target,o=f[e].node.clusterId,a=f[i].node.clusterId;(o===r.id&&a!==r.id||a===r.id&&o!==r.id)&&(b+=t[n]||1),(o===m&&a!==m||a===m&&o!==m)&&(x+=t[n]||1)})),r.sumTot=b,i.sumTot=x}}));var x={},w=0;Object.keys(h).forEach((function(t){var e=h[t];if(e.nodes&&e.nodes.length){var n=String(w+1);n!==t&&(e.id=n,e.nodes=e.nodes.map((function(t){return{id:t.id,clusterId:n}})),h[n]=e,x[t]=n,delete h[t],w++)}else delete h[t]})),s.forEach((function(t){t.clusterId&&x[t.clusterId]&&(t.clusterId=x[t.clusterId])}));var _=[],S={};c.forEach((function(t){var e=t.source,r=t.target,i=t[n]||1,o=f[e].node.clusterId,a=f[r].node.clusterId,s=o+"---"+a;if(S[s])S[s].weight+=i,S[s].count++;else{var u={source:o,target:a,weight:i,count:1};S[s]=u,_.push(u)}}));var E=[];return Object.keys(h).forEach((function(t){E.push(h[t])})),{clusters:E,clusterEdges:_}};e.default=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=a(n(309)),i=a(n(310)),o=n(47);function a(t){return t&&t.__esModule?t:{default:t}}var s=function(t,e){var n=[],r=t.nodes,a=void 0===r?[]:r,s=t.edges,u=void 0===s?[]:s;if(0===a.length)return n;var c=a[0],l=new Set;l.add(c);var h=new i.default((function(t,n){return e?t.weight-n.weight:0}));for((0,o.getEdgesByNodeId)(c.id,u).forEach((function(t){h.insert(t)}));!h.isEmpty();){var f=h.delMin(),d=f.source,p=f.target;l.has(d)&&l.has(p)||(n.push(f),l.has(d)||(l.add(d),(0,o.getEdgesByNodeId)(d,u).forEach((function(t){h.insert(t)}))),l.has(p)||(l.add(p),(0,o.getEdgesByNodeId)(p,u).forEach((function(t){h.insert(t)}))))}return n},u=function(t,e){var n=[],i=t.nodes,o=void 0===i?[]:i,a=t.edges,s=void 0===a?[]:a;if(0===o.length)return n;var u=s.map((function(t){return t}));e&&u.sort((function(t,e){return t.weight-e.weight}));for(var c=new r.default(o.map((function(t){return t.id})));u.length>0;){var l=u.shift(),h=l.source,f=l.target;c.connected(h,f)||(n.push(l),c.union(h,f))}return n},c=function(t,e,n){return n?{prim:s,kruskal:u}[n](t,e):u(t,e)};e.default=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=function(){function t(t){this.count=t.length,this.parent={};for(var e=0,n=t;e0&&(this.list[0]=e,this.moveDown(0)),t},t.prototype.insert=function(t){if(null!==t){this.list.push(t);var e=this.list.length-1;return this.moveUp(e),!0}return!1},t.prototype.moveUp=function(t){for(var e=this.getParent(t);t&&t>0&&this.compareFn(this.list[e],this.list[t])>0;){var n=this.list[e];this.list[e]=this.list[t],this.list[t]=n,t=e,e=this.getParent(t)}},t.prototype.moveDown=function(t){var e,n=t,r=this.getLeft(t),i=this.getRight(t),o=this.list.length;null!==r&&r0?n=r:null!==i&&i0&&(n=i),t!==n&&(e=[this.list[n],this.list[t]],this.list[t]=e[0],this.list[n]=e[1],this.moveDown(n))},t}();e.default=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r,i=(r=n(182))&&r.__esModule?r:{default:r},o=n(47);var a=function(t,e,n){"number"!=typeof e&&(e=1e-6),"number"!=typeof n&&(n=.85);for(var r,a=1,s=0,u=1e3,c=t.nodes,l=void 0===c?[]:c,h=t.edges,f=void 0===h?[]:h,d=l.length,p={},g={},v=0;v0&&a>e;){s=0;for(v=0;v0&&(r+=g[w]/_)}p[y]=n*r,s+=p[y]}}s=(1-s)/d,a=0;for(v=0;ve&&(s=e);var r=n[t.id].inDegree;u>r&&(u=r);var i=n[t.id].outDegree;c>i&&(c=i)})),t[e]={degree:s,inDegree:u,outDegree:c}),{minPatternNodeLabelDegree:s,minPatternNodeLabelInDegree:u,minPatternNodeLabelOutDegree:c}},y=function(t,e,n,s,u,y,b){if(void 0===n&&(n=!1),void 0===y&&(y="cluster"),void 0===b&&(b="cluster"),t&&t.nodes){var x=t.nodes.length;if(x){var w=(0,i.default)(t,n),_=(0,i.default)(e,n),S=g(t.nodes,w,n),E=g(e.nodes,_,n),M=d(t.nodes,y),O=M.nodeMap,A=M.nodeLabelMap,k=d(e.nodes,y),C=k.nodeMap,T=k.nodeLabelMap;p(t.edges,b,O);var I=p(e.edges,b,C).edgeLabelMap,P=[];null==_||_.forEach((function(t){P=P.concat(t)})),u||(u=Math.max.apply(Math,(0,r.__spreadArray)((0,r.__spreadArray)([],P),[2]))),s||(s=u);var N=c(t,w,y,s),j=c(e,_,y,s),D=function(t,e,n,r,i){var o=Math.ceil(n/e),a={},s=0;return r.forEach((function(t,r){for(var u=0,c=0,l=t.nodeIdxs,h=t.neighborNum-1;u2*e)););if(d<2*e&&(a[r+"-"+f]={start:r,end:f,distance:i[r][f]},u++,++s>=n))return a;if(++c>2*e)break}u$[r][c]){s=!0;break}if(s)return X.splice(e,1),"continue";var l={};i.neighbors.forEach((function(t){var e=S[n.id+"-"+t.id];l[n.id+"-"+t.id]={start:O[n.id].idx,end:O[t.id].idx,distance:e}})),L=h(l,N,t,L);var d=[];Object.keys(l).forEach((function(t){if(V[t])d.push(V[t]);else{var e=L[t];V[t]=f(e,U,y,b),d.push(V[t])}})),d=d.sort((function(t,e){return e-t}));var p=!1;for(c=0;c=0;l--)c(l)}));var J=[];null==X||X.forEach((function(r){for(var i=O[r.id].idx,o=l(t.nodes,w[i],i,y,u).neighbors,a=!1,s=o.length-1;s>=0;s--){if(o.length+1$[h][p])o.splice(s,1);else{if(n){var g=c.id+"-"+r.id,x=S[g];if(p=Q[h].length-1,x>Q[h][p]){o.splice(s,1);continue}}var _=V[f]?V[f]:v(t,r,c,O,d,N,U,y,b,V,L),E=W.id+"-"+h;if(_=0;d--){if("break"===x(d))break}if(v)return J.splice(r,1),"continue";i.edges=c;var w=(0,a.default)(i,i.nodes[0].id,!1).length;if(Object.keys(w).reverse().forEach((function(t){if(t!==i.nodes[0].id&&!v){if(w[t]===1/0){var e=u[t].node[y];if(s[e]--,s[e]et[r][et[r].length-1]){e=u[t].node[y];if(s[e]--,s[e]=0;E--){var M=i.nodes[E],A=u[M.id].degree,k=u[M.id].inDegree,P=u[M.id].outDegree,N=M[y],j=m(H,N,C,T),D=j.minPatternNodeLabelDegree,L=j.minPatternNodeLabelInDegree,R=j.minPatternNodeLabelOutDegree;if(n?A=0;B--){var G=c[B];if(!u[G.source]||!u[G.target]){c.splice(B,1);var F=G[b];if(l[F]--,u[G.source]&&(u[G.source].degree--,u[G.source].outDegree--),u[G.target]&&(u[G.target].degree--,u[G.target].inDegree--),I[F]&&l[F]=0;rt--){if("break"===nt(rt))break}var it=J.length,ot=function(t){var e=J[t],n={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;n[e]?n[e]++:n[e]=1}));for(var r=function(t){var e=J[t],r={};e.edges.forEach((function(t){var e=t.source+"-"+t.target+"-"+t.label;r[e]?r[e]++:r[e]=1}));var i=!0;Object.keys(r).length!==Object.keys(n).length?i=!1:Object.keys(n).forEach((function(t){r[t]!==n[t]&&(i=!1)})),i&&J.splice(t,1)},i=it-1;i>t;i--)r(i);it=J.length};for(rt=0;rt<=it-1;rt++)ot(rt);return J}}};e.default=y},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var r=n(0),i=n(314),o=function(){function t(t,e,n,r,o){this.fromNode=t,this.toNode=e,this.nodeEdgeNodeLabel={nodeLabel1:n||i.VACANT_NODE_LABEL,edgeLabel:r||i.VACANT_EDGE_LABEL,nodeLabel2:o||i.VACANT_NODE_LABEL}}return t.prototype.equalTo=function(t){return this.fromNode===t.formNode&&this.toNode===t.toNode&&this.nodeEdgeNodeLabel===t.nodeEdgeNodeLabel},t.prototype.notEqualTo=function(t){return!this.equalTo(t)},t}(),a=function(){function t(){this.rmpath=[],this.dfsEdgeList=[]}return t.prototype.equalTo=function(t){var e=this.dfsEdgeList.length;if(e!==t.length)return!1;for(var n=0;n=0;e--){var n=this.dfsEdgeList[e],r=n.fromNode,i=n.toNode;rh||r.hasNode(o[l.to])||(e.labelm;b--){if("break"===y(b))break}if(g){var x=t.findMinLabel(p);c.dfsEdgeList.push(new o(d,v,i.VACANT_NODE_LABEL,x.edgeLabel,i.VACANT_NODE_LABEL));var w=c.dfsEdgeList.length-1;return t.dfsCode.dfsEdgeList[w]===c.dfsEdgeList[w]&&a(p[x.edgeLabel].projected)}var _={};g=!1;var S=0;l.forEach((function(e){var n=new s(e),i=t.findForwardPureEdges(r,n.edges[h[0]],f,n);i.length>0&&(g=!0,S=d,i.forEach((function(t){var n=t.label+"-"+u[t.to].label;_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}));var E=h.length,M=function(e){if(g)return"break";var n=h[e];l.forEach((function(e){var i=new s(e),o=t.findForwardRmpathEdges(r,i.edges[n],f,i);o.length>0&&(g=!0,S=c.dfsEdgeList[n].fromNode,o.forEach((function(t){var n=t.label+"-"+u[t.to].label;_[n]||(_[n]={projected:[],edgeLabel:t.label,nodeLabel2:u[t.to].label}),_[n].projected.push({graphId:r.id,edge:t,preNode:e})})))}))};for(b=0;b=0;f--){var d=e.findBackwardEdge(i,h.edges[r[f]],h.edges[r[0]],h);if(d){var p=e.dfsCode.dfsEdgeList[r[f]].fromNode+"-"+d.label;l[p]||(l[p]={projected:[],toNodeId:e.dfsCode.dfsEdgeList[r[f]].fromNode,edgeLabel:d.label}),l[p].projected.push({graphId:t.graphId,edge:d,preNode:t})}}if(!(n>=e.maxNodeNum)){e.findForwardPureEdges(i,h.edges[r[0]],u,h).forEach((function(e){var n=a+"-"+e.label+"-"+o[e.to].label;c[n]||(c[n]={projected:[],fromNodeId:a,edgeLabel:e.label,nodeLabel2:o[e.to].label}),c[n].projected.push({graphId:t.graphId,edge:e,preNode:t})}));var g=function(n){e.findForwardRmpathEdges(i,h.edges[r[n]],u,h).forEach((function(i){var a=e.dfsCode.dfsEdgeList[r[n]].fromNode+"-"+i.label+"-"+o[i.to].label;c[a]||(c[a]={projected:[],fromNodeId:e.dfsCode.dfsEdgeList[r[n]].fromNode,edgeLabel:i.label,nodeLabel2:o[i.to].label}),c[a].projected.push({graphId:t.graphId,edge:i,preNode:t})}))};for(f=0;fi){var a=i;i=r,r=a}var l=t.label,h=n+"-"+r+"-"+l+"-"+i,f=r+"-"+l+"-"+i;if(!o[f]){var d=o[f]||0;d++,o[f]=d}s[h]={graphId:n,nodeLabel1:r,edgeLabel:l,nodeLabel2:i}}))}))})),Object.keys(i).forEach((function(t){if(!(i[t]=4&&1!==t[3]&&(e=", "+t[3]),"hwb("+t[0]+", "+t[1]+"%, "+t[2]+"%"+e+")"},s.to.keyword=function(t){return o[t.slice(0,3)]}},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){"use strict";var r=n(318),i=Array.prototype.concat,o=Array.prototype.slice,a=t.exports=function(t){for(var e=[],n=0,a=t.length;n=0&&(t.splice instanceof Function||Object.getOwnPropertyDescriptor(t,t.length-1)&&"String"!==t.constructor.name))}},function(t,e,n){var r=n(185),i=n(321),o={};Object.keys(r).forEach((function(t){o[t]={},Object.defineProperty(o[t],"channels",{value:r[t].channels}),Object.defineProperty(o[t],"labels",{value:r[t].labels});var e=i(t);Object.keys(e).forEach((function(n){var r=e[n];o[t][n]=function(t){var e=function(e){if(null==e)return e;arguments.length>1&&(e=Array.prototype.slice.call(arguments));var n=t(e);if("object"==typeof n)for(var r=n.length,i=0;i1&&(e=Array.prototype.slice.call(arguments)),t(e))};return"conversion"in t&&(e.conversion=t.conversion),e}(r)}))})),t.exports=o},function(t,e,n){"use strict";t.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}},function(t,e,n){var r=n(185);function i(t){var e=function(){for(var t={},e=Object.keys(r),n=e.length,i=0;i-1}},function(t,e,n){var r=n(101);t.exports=function(t,e){var n=this.__data__,i=r(n,t);return i<0?(++this.size,n.push([t,e])):n[i][1]=e,this}},function(t,e,n){var r=n(100);t.exports=function(){this.__data__=new r,this.size=0}},function(t,e){t.exports=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}},function(t,e){t.exports=function(t){return this.__data__.get(t)}},function(t,e){t.exports=function(t){return this.__data__.has(t)}},function(t,e,n){var r=n(100),i=n(152),o=n(153);t.exports=function(t,e){var n=this.__data__;if(n instanceof r){var a=n.__data__;if(!i||a.length<199)return a.push([t,e]),this.size=++n.size,this;n=this.__data__=new o(a)}return n.set(t,e),this.size=n.size,this}},function(t,e,n){var r=n(88),i=n(338),o=n(45),a=n(189),s=/^\[object .+?Constructor\]$/,u=Function.prototype,c=Object.prototype,l=u.toString,h=c.hasOwnProperty,f=RegExp("^"+l.call(h).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");t.exports=function(t){return!(!o(t)||i(t))&&(r(t)?f:s).test(a(t))}},function(t,e,n){var r=n(74),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=r?r.toStringTag:void 0;t.exports=function(t){var e=o.call(t,s),n=t[s];try{t[s]=void 0;var r=!0}catch(t){}var i=a.call(t);return r&&(e?t[s]=n:delete t[s]),i}},function(t,e){var n=Object.prototype.toString;t.exports=function(t){return n.call(t)}},function(t,e,n){var r,i=n(339),o=(r=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+r:"";t.exports=function(t){return!!o&&o in t}},function(t,e,n){var r=n(49)["__core-js_shared__"];t.exports=r},function(t,e){t.exports=function(t,e){return null==t?void 0:t[e]}},function(t,e,n){var r=n(342),i=n(100),o=n(152);t.exports=function(){this.size=0,this.__data__={hash:new r,map:new(o||i),string:new r}}},function(t,e,n){var r=n(343),i=n(344),o=n(345),a=n(346),s=n(347);function u(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e0){if(++e>=800)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}},function(t,e,n){var r=n(211),i=n(416),o=n(420),a=n(212),s=n(421),u=n(165);t.exports=function(t,e,n){var c=-1,l=i,h=t.length,f=!0,d=[],p=d;if(n)f=!1,l=o;else if(h>=200){var g=e?null:s(t);if(g)return u(g);f=!1,l=a,p=new r}else p=e?[]:d;t:for(;++c-1}},function(t,e,n){var r=n(226),i=n(418),o=n(419);t.exports=function(t,e,n){return e==e?o(t,e,n):r(t,i,n)}},function(t,e){t.exports=function(t){return t!=t}},function(t,e){t.exports=function(t,e,n){for(var r=n-1,i=t.length;++r1||1===e.length&&t.hasEdge(e[0],e[0])}))}},function(t,e,n){var r=n(44);t.exports=function(t,e,n){return function(t,e,n){var r={},i=t.nodes();return i.forEach((function(t){r[t]={},r[t][t]={distance:0},i.forEach((function(e){t!==e&&(r[t][e]={distance:Number.POSITIVE_INFINITY})})),n(t).forEach((function(n){var i=n.v===t?n.w:n.v,o=e(n);r[t][i]={distance:o,predecessor:t}}))})),i.forEach((function(t){var e=r[t];i.forEach((function(n){var o=r[n];i.forEach((function(n){var r=o[t],i=e[n],a=o[n],s=r.distance+i.distance;s0;){if(n=u.removeMin(),r.has(s,n))a.setEdge(n,s[n]);else{if(l)throw new Error("Input graph is not connected: "+t);l=!0}t.nodeEdges(n).forEach(c)}return a}},function(t,e,n){"use strict";var r=n(29),i=n(475),o=n(478),a=n(479),s=n(38).normalizeRanks,u=n(481),c=n(38).removeEmptyRanks,l=n(482),h=n(483),f=n(484),d=n(485),p=n(494),g=n(38),v=n(48).Graph,m=n(496);t.exports=function(t,e){var n=e&&e.debugTiming?g.time:g.notime;n("layout",(function(){e&&!e.keepNodeOrder&&e.prevGraph&&n(" inheritOrder",(function(){var n,i,o;n=t,i=e.prevGraph,o=i._nodes,r.forEach(n.nodes(),(function(t){var e=n.node(t);void 0!==o[t]?(e.fixorder=o[t]._order,delete o[t]._order):delete e.fixorder}))}));var k=n(" buildLayoutGraph",(function(){return function(t){var e=new v({multigraph:!0,compound:!0}),n=A(t.graph());return e.setGraph(r.merge({},b,O(n,y),r.pick(n,x))),r.forEach(t.nodes(),(function(n){var i=A(t.node(n));e.setNode(n,r.defaults(O(i,w),_)),e.setParent(n,t.parent(n))})),r.forEach(t.edges(),(function(n){var i=A(t.edge(n));e.setEdge(n,r.merge({},E,O(i,S),r.pick(i,M)))})),e}(t)}));e&&!1===e.edgeLabelSpace||n(" makeSpaceForEdgeLabels",(function(){!function(t){var e=t.graph();e.ranksep/=2,r.forEach(t.nodes(),(function(e){var n=t.node(e);isNaN(n.layer)||(n.layer*=2)})),r.forEach(t.edges(),(function(n){var r=t.edge(n);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===e.rankdir||"BT"===e.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)}))}(k)}));try{n(" runLayout",(function(){!function(t,e,n){e(" removeSelfEdges",(function(){!function(t){r.forEach(t.edges(),(function(e){if(e.v===e.w){var n=t.node(e.v);n.selfEdges||(n.selfEdges=[]),n.selfEdges.push({e:e,label:t.edge(e)}),t.removeEdge(e)}}))}(t)})),e(" acyclic",(function(){i.run(t)})),e(" nestingGraph.run",(function(){l.run(t)})),e(" rank",(function(){a(g.asNonCompoundGraph(t))})),e(" injectEdgeLabelProxies",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(n.width&&n.height){var r=t.node(e.v),i={rank:(t.node(e.w).rank-r.rank)/2+r.rank,e:e};g.addDummyNode(t,"edge-proxy",i,"_ep")}}))}(t)})),e(" removeEmptyRanks",(function(){c(t)})),e(" nestingGraph.cleanup",(function(){l.cleanup(t)})),e(" normalizeRanks",(function(){s(t)})),e(" assignRankMinMax",(function(){!function(t){var e=0;r.forEach(t.nodes(),(function(n){var i=t.node(n);i.borderTop&&(i.minRank=t.node(i.borderTop).rank,i.maxRank=t.node(i.borderBottom).rank,e=r.max(e,i.maxRank))})),t.graph().maxRank=e}(t)})),e(" removeEdgeLabelProxies",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);"edge-proxy"===n.dummy&&(t.edge(n.e).labelRank=n.rank,t.removeNode(e))}))}(t)})),e(" normalize.run",(function(){o.run(t)})),e(" parentDummyChains",(function(){u(t)})),e(" addBorderSegments",(function(){h(t)})),n&&n.keepNodeOrder&&e(" initDataOrder",(function(){m(t,n.nodeOrder)}));e(" order",(function(){d(t)})),e(" insertSelfEdges",(function(){!function(t){var e=g.buildLayerMatrix(t);r.forEach(e,(function(e){var n=0;r.forEach(e,(function(e,i){var o=t.node(e);o.order=i+n,r.forEach(o.selfEdges,(function(e){g.addDummyNode(t,"selfedge",{width:e.label.width,height:e.label.height,rank:o.rank,order:i+ ++n,e:e.e,label:e.label},"_se")})),delete o.selfEdges}))}))}(t)})),e(" adjustCoordinateSystem",(function(){f.adjust(t)})),e(" position",(function(){p(t)})),e(" positionSelfEdges",(function(){!function(t){r.forEach(t.nodes(),(function(e){var n=t.node(e);if("selfedge"===n.dummy){var r=t.node(n.e.v),i=r.x+r.width/2,o=r.y,a=n.x-i,s=r.height/2;t.setEdge(n.e,n.label),t.removeNode(e),n.label.points=[{x:i+2*a/3,y:o-s},{x:i+5*a/6,y:o-s},{x:i+a,y:o},{x:i+5*a/6,y:o+s},{x:i+2*a/3,y:o+s}],n.label.x=n.x,n.label.y=n.y}}))}(t)})),e(" removeBorderNodes",(function(){!function(t){r.forEach(t.nodes(),(function(e){if(t.children(e).length){var n=t.node(e),i=t.node(n.borderTop),o=t.node(n.borderBottom),a=t.node(r.last(n.borderLeft)),s=t.node(r.last(n.borderRight));n.width=Math.abs(s.x-a.x),n.height=Math.abs(o.y-i.y),n.x=a.x+n.width/2,n.y=i.y+n.height/2}})),r.forEach(t.nodes(),(function(e){"border"===t.node(e).dummy&&t.removeNode(e)}))}(t)})),e(" normalize.undo",(function(){o.undo(t)})),e(" fixupEdgeLabelCoords",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);if(r.has(n,"x"))switch("l"!==n.labelpos&&"r"!==n.labelpos||(n.width-=n.labeloffset),n.labelpos){case"l":n.x-=n.width/2+n.labeloffset;break;case"r":n.x+=n.width/2+n.labeloffset}}))}(t)})),e(" undoCoordinateSystem",(function(){f.undo(t)})),e(" translateGraph",(function(){!function(t){var e=Number.POSITIVE_INFINITY,n=0,i=Number.POSITIVE_INFINITY,o=0,a=t.graph(),s=a.marginx||0,u=a.marginy||0;function c(t){var r=t.x,a=t.y,s=t.width,u=t.height;e=Math.min(e,r-s/2),n=Math.max(n,r+s/2),i=Math.min(i,a-u/2),o=Math.max(o,a+u/2)}r.forEach(t.nodes(),(function(e){c(t.node(e))})),r.forEach(t.edges(),(function(e){var n=t.edge(e);r.has(n,"x")&&c(n)})),e-=s,i-=u,r.forEach(t.nodes(),(function(n){var r=t.node(n);r.x-=e,r.y-=i})),r.forEach(t.edges(),(function(n){var o=t.edge(n);r.forEach(o.points,(function(t){t.x-=e,t.y-=i})),r.has(o,"x")&&(o.x-=e),r.has(o,"y")&&(o.y-=i)})),a.width=n-e+s,a.height=o-i+u}(t)})),e(" assignNodeIntersects",(function(){!function(t){r.forEach(t.edges(),(function(e){var n,r,i=t.edge(e),o=t.node(e.v),a=t.node(e.w);i.points?(n=i.points[0],r=i.points[i.points.length-1]):(i.points=[],n=a,r=o),i.points.unshift(g.intersectRect(o,n)),i.points.push(g.intersectRect(a,r))}))}(t)})),e(" reversePoints",(function(){!function(t){r.forEach(t.edges(),(function(e){var n=t.edge(e);n.reversed&&n.points.reverse()}))}(t)})),e(" acyclic.undo",(function(){i.undo(t)}))}(k,n,e)}))}catch(t){if("Not possible to find intersection inside of the rectangle"===t.message)return void console.error("The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\n",t);throw t}n(" updateInputGraph",(function(){!function(t,e){r.forEach(t.nodes(),(function(n){var r=t.node(n),i=e.node(n);r&&(r.x=i.x,r.y=i.y,r._order=i.order,r._rank=i.rank,e.children(n).length&&(r.width=i.width,r.height=i.height))})),r.forEach(t.edges(),(function(n){var i=t.edge(n),o=e.edge(n);i.points=o.points,r.has(o,"x")&&(i.x=o.x,i.y=o.y)})),t.graph().width=e.graph().width,t.graph().height=e.graph().height}(t,k)}))}))};var y=["nodesep","edgesep","ranksep","marginx","marginy"],b={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},x=["acyclicer","ranker","rankdir","align"],w=["width","height","layer","fixorder"],_={width:0,height:0},S=["minlen","weight","width","height","labeloffset"],E={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},M=["labelpos"];function O(t,e){return r.mapValues(r.pick(t,e),Number)}function A(t){var e={};return r.forEach(t,(function(t,n){e[n.toLowerCase()]=t})),e}},function(t,e,n){var r=n(186);t.exports=function(t){return r(t,5)}},function(t,e,n){var r=n(114),i=n(73),o=n(115),a=n(67),s=Object.prototype,u=s.hasOwnProperty,c=r((function(t,e){t=Object(t);var n=-1,r=e.length,c=r>2?e[2]:void 0;for(c&&o(e[0],e[1],c)&&(r=1);++n-1?s[u?e[c]:c]:void 0}}},function(t,e,n){var r=n(226),i=n(55),o=n(441),a=Math.max;t.exports=function(t,e,n){var s=null==t?0:t.length;if(!s)return-1;var u=null==n?0:o(n);return u<0&&(u=a(s+u,0)),r(t,i(e,3),u)}},function(t,e,n){var r=n(234);t.exports=function(t){var e=r(t),n=e%1;return e==e?n?e-n:e:0}},function(t,e,n){var r=n(443),i=n(45),o=n(77),a=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,u=/^0o[0-7]+$/i,c=parseInt;t.exports=function(t){if("number"==typeof t)return t;if(o(t))return NaN;if(i(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=i(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=r(t);var n=s.test(t);return n||u.test(t)?c(t.slice(2),n?2:8):a.test(t)?NaN:+t}},function(t,e,n){var r=n(444),i=/^\s+/;t.exports=function(t){return t?t.slice(0,r(t)+1).replace(i,""):t}},function(t,e){var n=/\s/;t.exports=function(t){for(var e=t.length;e--&&n.test(t.charAt(e)););return e}},function(t,e,n){var r=n(164),i=n(207),o=n(67);t.exports=function(t,e){return null==t?t:r(t,i(e),o)}},function(t,e){t.exports=function(t){var e=null==t?0:t.length;return e?t[e-1]:void 0}},function(t,e,n){var r=n(105),i=n(163),o=n(55);t.exports=function(t,e){var n={};return e=o(e,3),i(t,(function(t,i,o){r(n,i,e(t,i,o))})),n}},function(t,e,n){var r=n(168),i=n(449),o=n(68);t.exports=function(t){return t&&t.length?r(t,o,i):void 0}},function(t,e){t.exports=function(t,e){return t>e}},function(t,e,n){var r=n(451),i=n(455)((function(t,e,n){r(t,e,n)}));t.exports=i},function(t,e,n){var r=n(99),i=n(236),o=n(164),a=n(452),s=n(45),u=n(67),c=n(237);t.exports=function t(e,n,l,h,f){e!==n&&o(n,(function(o,u){if(f||(f=new r),s(o))a(e,n,u,l,t,h,f);else{var d=h?h(c(e,u),o,u+"",e,n,f):void 0;void 0===d&&(d=o),i(e,u,d)}}),u)}},function(t,e,n){var r=n(236),i=n(193),o=n(202),a=n(194),s=n(203),u=n(90),c=n(32),l=n(227),h=n(75),f=n(88),d=n(45),p=n(453),g=n(91),v=n(237),m=n(454);t.exports=function(t,e,n,y,b,x,w){var _=v(t,n),S=v(e,n),E=w.get(S);if(E)r(t,n,E);else{var M=x?x(_,S,n+"",t,e,w):void 0,O=void 0===M;if(O){var A=c(S),k=!A&&h(S),C=!A&&!k&&g(S);M=S,A||k||C?c(_)?M=_:l(_)?M=a(_):k?(O=!1,M=i(S,!0)):C?(O=!1,M=o(S,!0)):M=[]:p(S)||u(S)?(M=_,u(_)?M=m(_):d(_)&&!f(_)||(M=s(S))):O=!1}O&&(w.set(S,M),b(M,S,y,x,w),w.delete(S)),r(t,n,M)}}},function(t,e,n){var r=n(66),i=n(109),o=n(51),a=Function.prototype,s=Object.prototype,u=a.toString,c=s.hasOwnProperty,l=u.call(Object);t.exports=function(t){if(!o(t)||"[object Object]"!=r(t))return!1;var e=i(t);if(null===e)return!0;var n=c.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}},function(t,e,n){var r=n(89),i=n(67);t.exports=function(t){return r(t,i(t))}},function(t,e,n){var r=n(114),i=n(115);t.exports=function(t){return r((function(e,n){var r=-1,o=n.length,a=o>1?n[o-1]:void 0,s=o>2?n[2]:void 0;for(a=t.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(n[0],n[1],s)&&(a=o<3?void 0:a,o=1),e=Object(e);++r1&&a(t,e[0],e[1])?e=[]:n>2&&a(e[0],e[1],e[2])&&(e=[e[0]]),i(t,r(e,1),[])}));t.exports=s},function(t,e,n){var r=n(113),i=n(111),o=n(55),a=n(222),s=n(469),u=n(107),c=n(470),l=n(68),h=n(32);t.exports=function(t,e,n){e=e.length?r(e,(function(t){return h(t)?function(e){return i(e,1===t.length?t[0]:t)}:t})):[l];var f=-1;e=r(e,u(o));var d=a(t,(function(t,n,i){return{criteria:r(e,(function(e){return e(t)})),index:++f,value:t}}));return s(d,(function(t,e){return c(t,e,n)}))}},function(t,e){t.exports=function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}},function(t,e,n){var r=n(471);t.exports=function(t,e,n){for(var i=-1,o=t.criteria,a=e.criteria,s=o.length,u=n.length;++i=u?c:c*("desc"==n[i]?-1:1)}return t.index-e.index}},function(t,e,n){var r=n(77);t.exports=function(t,e){if(t!==e){var n=void 0!==t,i=null===t,o=t==t,a=r(t),s=void 0!==e,u=null===e,c=e==e,l=r(e);if(!u&&!l&&!a&&t>e||a&&s&&c&&!u&&!l||i&&s&&c||!n&&c||!o)return 1;if(!i&&!a&&!l&&t0;--u)if(r=e[u].dequeue()){i=i.concat(s(t,e,n,r,!0));break}}return i}(n.graph,n.buckets,n.zeroIdx);return r.flatten(r.map(c,(function(e){return t.outEdges(e.v,e.w)})),!0)};var a=r.constant(1);function s(t,e,n,i,o){var a=o?[]:void 0;return r.forEach(t.inEdges(i.v),(function(r){var i=t.edge(r),s=t.node(r.v);o&&a.push({v:r.v,w:r.w}),s.out-=i,u(e,n,s)})),r.forEach(t.outEdges(i.v),(function(r){var i=t.edge(r),o=r.w,a=t.node(o);a.in-=i,u(e,n,a)})),t.removeNode(i.v),a}function u(t,e,n){n.out?n.in?t[n.out-n.in+e].enqueue(n):t[t.length-1].enqueue(n):t[0].enqueue(n)}},function(t,e){function n(){var t={};t._next=t._prev=t,this._sentinel=t}function r(t){t._prev._next=t._next,t._next._prev=t._prev,delete t._next,delete t._prev}function i(t,e){if("_next"!==t&&"_prev"!==t)return e}t.exports=n,n.prototype.dequeue=function(){var t=this._sentinel,e=t._prev;if(e!==t)return r(e),e},n.prototype.enqueue=function(t){var e=this._sentinel;t._prev&&t._next&&r(t),t._next=e._next,e._next._prev=t,e._next=t,t._prev=e},n.prototype.toString=function(){for(var t=[],e=this._sentinel,n=e._prev;n!==e;)t.push(JSON.stringify(n,i)),n=n._prev;return"["+t.join(", ")+"]"}},function(t,e,n){"use strict";var r=n(29),i=n(38);t.exports={run:function(t){t.graph().dummyChains=[],r.forEach(t.edges(),(function(e){!function(t,e){var n,r,o,a=e.v,s=t.node(a).rank,u=e.w,c=t.node(u).rank,l=e.name,h=t.edge(e),f=h.labelRank;if(c===s+1)return;for(t.removeEdge(e),o=0,++s;su.lim&&(c=u,l=!0);var h=r.filter(e.edges(),(function(e){return l===y(t,t.node(e.v),c)&&l!==y(t,t.node(e.w),c)}));return r.minBy(h,(function(t){return o(e,t)}))}function m(t,e,n,i){var o=n.v,a=n.w;t.removeEdge(o,a),t.setEdge(i.v,i.w,{}),d(t),h(t,e),function(t,e){var n=r.find(t.nodes(),(function(t){return!e.node(t).parent})),i=s(t,n);i=i.slice(1),r.forEach(i,(function(n){var r=t.node(n).parent,i=e.edge(n,r),o=!1;i||(i=e.edge(r,n),o=!0),e.node(n).rank=e.node(r).rank+(o?i.minlen:-i.minlen)}))}(t,e)}function y(t,e,n){return n.low<=e.lim&&e.lim<=n.lim}t.exports=l,l.initLowLimValues=d,l.initCutValues=h,l.calcCutValue=f,l.leaveEdge=g,l.enterEdge=v,l.exchangeEdges=m},function(t,e,n){var r=n(29);t.exports=function(t){var e=function(t){var e={},n=0;function i(o){var a=n;r.forEach(t.children(o),i),e[o]={low:a,lim:n++}}return r.forEach(t.children(),i),e}(t);r.forEach(t.graph().dummyChains,(function(n){for(var r=t.node(n),i=r.edgeObj,o=function(t,e,n,r){var i,o,a=[],s=[],u=Math.min(e[n].low,e[r].low),c=Math.max(e[n].lim,e[r].lim);i=n;do{i=t.parent(i),a.push(i)}while(i&&(e[i].low>u||c>e[i].lim));o=i,i=r;for(;(i=t.parent(i))!==o;)s.push(i);return{path:a.concat(s.reverse()),lca:o}}(t,e,i.v,i.w),a=o.path,s=o.lca,u=0,c=a[u],l=!0;n!==i.w;){if(r=t.node(n),l){for(;(c=a[u])!==s&&t.node(c).maxRank=2),s=l.buildLayerMatrix(t);var v=o(t,s);v=2,!0),s=l.buildLayerMatrix(t),(v=o(t,s))0;)e%2&&(n+=u[e+1]),u[e=e-1>>1]+=t.weight;c+=t.weight*n}))),c}t.exports=function(t,e){for(var n=0,r=1;r=t.barycenter)&&function(t,e){var n=0,r=0;t.weight&&(n+=t.barycenter*t.weight,r+=t.weight);e.weight&&(n+=e.barycenter*e.weight,r+=e.weight);t.vs=e.vs.concat(t.vs),t.barycenter=n/r,t.weight=r,t.i=Math.min(e.i,t.i),e.merged=!0}(t,e)}}function i(e){return function(n){n.in.push(e),0==--n.indegree&&t.push(n)}}for(;t.length;){var o=t.pop();e.push(o),r.forEach(o.in.reverse(),n(o)),r.forEach(o.out,i(o))}return r.map(r.filter(e,(function(t){return!t.merged})),(function(t){return r.pick(t,["vs","i","barycenter","weight"])}))}(r.filter(n,(function(t){return!t.indegree})))}},function(t,e,n){var r=n(29),i=n(38);function o(t,e,n){for(var i;e.length&&(i=r.last(e)).i<=n;)e.pop(),t.push(i.vs),n++;return n}t.exports=function(t,e,n){var a=i.partition(t,(function(t){return r.has(t,"fixorder")&&!isNaN(t.fixorder)||r.has(t,"barycenter")})),s=a.lhs,u=r.sortBy(a.rhs,(function(t){return-t.i})),c=[],l=0,h=0,f=0;s.sort(function(t,e){return function(n,r){if(void 0!==n.fixorder&&void 0!==r.fixorder)return n.fixorder-r.fixorder;if(n.barycenterr.barycenter)return 1;if(e&&void 0!==n.order&&void 0!==r.order){if(n.orderr.order)return 1}return t?r.i-n.i:n.i-r.i}}(!!e,!!n)),f=o(c,u,f),r.forEach(s,(function(t){f+=t.vs.length,c.push(t.vs),l+=t.barycenter*t.weight,h+=t.weight,f=o(c,u,f)}));var d={vs:r.flatten(c,!0)};h&&(d.barycenter=l/h,d.weight=h);return d}},function(t,e,n){var r=n(29),i=n(48).Graph;t.exports=function(t,e,n){var o=function(t){var e;for(;t.hasNode(e=r.uniqueId("_root")););return e}(t),a=new i({compound:!0}).setGraph({root:o}).setDefaultNodeLabel((function(e){return t.node(e)}));return r.forEach(t.nodes(),(function(i){var s=t.node(i),u=t.parent(i);(s.rank===e||s.minRank<=e&&e<=s.maxRank)&&(a.setNode(i),a.setParent(i,u||o),r.forEach(t[n](i),(function(e){var n=e.v===i?e.w:e.v,o=a.edge(n,i),s=r.isUndefined(o)?0:o.weight;a.setEdge(n,i,{weight:t.edge(e).weight+s})})),r.has(s,"minRank")&&a.setNode(i,{borderLeft:s.borderLeft[e],borderRight:s.borderRight[e]}))})),a}},function(t,e,n){var r=n(29);t.exports=function(t,e,n){var i,o={};r.forEach(n,(function(n){for(var r,a,s=t.parent(n);s;){if((r=t.parent(s))?(a=o[r],o[r]=s):(a=i,i=s),a&&a!==s)return void e.setEdge(a,s);s=r}}))}},function(t,e,n){"use strict";var r=n(29),i=n(38),o=n(495).positionX;t.exports=function(t){(function(t){var e=i.buildLayerMatrix(t),n=t.graph().ranksep,o=0;r.forEach(e,(function(e){var i=r.max(r.map(e,(function(e){return t.node(e).height})));r.forEach(e,(function(e){t.node(e).y=o+i/2})),o+=i+n}))})(t=i.asNonCompoundGraph(t)),r.forEach(o(t),(function(e,n){t.node(n).x=e}))}},function(t,e,n){"use strict";var r=n(29),i=n(48).Graph,o=n(38);function a(t,e){var n={};return r.reduce(e,(function(e,i){var o=0,a=0,s=e.length,c=r.last(i);return r.forEach(i,(function(e,l){var h=function(t,e){if(t.node(e).dummy)return r.find(t.predecessors(e),(function(e){return t.node(e).dummy}))}(t,e),f=h?t.node(h).order:s;(h||e===c)&&(r.forEach(i.slice(a,l+1),(function(e){r.forEach(t.predecessors(e),(function(r){var i=t.node(r),a=i.order;!(as)&&u(n,e,c)}))}))}return r.reduce(e,(function(e,n){var o,a=-1,s=0;return r.forEach(n,(function(r,u){if("border"===t.node(r).dummy){var c=t.predecessors(r);c.length&&(o=t.node(c[0]).order,i(n,s,u,a,o),s=u,a=o)}i(n,s,n.length,o,e.length)})),n})),n}function u(t,e,n){if(e>n){var r=e;e=n,n=r}var i=t[e];i||(t[e]=i={}),i[n]=!0}function c(t,e,n){if(e>n){var i=e;e=n,n=i}return r.has(t[e],n)}function l(t,e,n,i){var o={},a={},s={};return r.forEach(e,(function(t){r.forEach(t,(function(t,e){o[t]=t,a[t]=t,s[t]=e}))})),r.forEach(e,(function(t){var e=-1;r.forEach(t,(function(t){var u=i(t);if(u.length)for(var l=((u=r.sortBy(u,(function(t){return s[t]}))).length-1)/2,h=Math.floor(l),f=Math.ceil(l);h<=f;++h){var d=u[h];a[t]===t&&e=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),_(n),l}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;_(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,n){return this.delegate={iterator:E(t),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=void 0),l}},t}(t.exports);try{regeneratorRuntime=r}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}},function(t,e){t.exports=function(t){if(Array.isArray(t))return t},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o=[],a=!0,s=!1;try{for(n=n.call(t);!(a=(r=n.next()).done)&&(o.push(r.value),!e||o.length!==e);a=!0);}catch(t){s=!0,i=t}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e){t.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.default=t.exports,t.exports.__esModule=!0},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))((function(i,o){function a(t){try{u(r.next(t))}catch(t){o(t)}}function s(t){try{u(r.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(a,s)}u((r=r.apply(t,e||[])).next())}))},i=this&&this.__generator||function(t,e){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]0,v=p.length>n.length,m=function(t,e,n,r,i){for(var o=[],a=0;a0?c:t(e,r)}return 0}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.QueryableString=void 0;var r=function(){function t(t){this.str=t}return t.prototype.startsWith=function(t){return 0===this.str.indexOf(t)},t.prototype.endsWith=function(t){var e,n=t.split("").reverse().join("");return e=this.str.split("").reverse().join(""),this.startsWith.call({str:e},n)},t.prototype.contains=function(t){return-1!==this.str.indexOf(t)},t.prototype.equals=function(t){return this.str===t},t.prototype.value=function(){return this.str},t}();e.QueryableString=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Request=void 0;var r=n(69),i=function(){function t(t,e,n,i,o){this.id=r.id(),this.serviceIdentifier=t,this.parentContext=e,this.parentRequest=n,this.target=o,this.childRequests=[],this.bindings=Array.isArray(i)?i:[i],this.requestScope=null===n?new Map:null}return t.prototype.addChildRequest=function(e,n,r){var i=new t(e,this.parentContext,this,n,r);return this.childRequests.push(i),i},t}();e.Request=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.resolve=void 0;var r=n(42),i=n(56),o=n(244),a=n(93),s=n(513),u=function(t,e,n){try{return n()}catch(n){throw o.isStackOverflowExeption(n)?new Error(r.CIRCULAR_DEPENDENCY_IN_FACTORY(t,e.toString())):n}},c=function(t){return function(e){e.parentContext.setCurrentRequest(e);var n=e.bindings,o=e.childRequests,l=e.target&&e.target.isArray(),h=!(e.parentRequest&&e.parentRequest.target&&e.target&&e.parentRequest.target.matchesArray(e.target.serviceIdentifier));if(l&&h)return o.map((function(e){return c(t)(e)}));var f=null;if(!e.target.isOptional()||0!==n.length){var d=n[0],p=d.scope===i.BindingScopeEnum.Singleton,g=d.scope===i.BindingScopeEnum.Request;if(p&&d.activated)return d.cache;if(g&&null!==t&&t.has(d.id))return t.get(d.id);if(d.type===i.BindingTypeEnum.ConstantValue)f=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Function)f=d.cache,d.activated=!0;else if(d.type===i.BindingTypeEnum.Constructor)f=d.implementationType;else if(d.type===i.BindingTypeEnum.DynamicValue&&null!==d.dynamicValue)f=u("toDynamicValue",d.serviceIdentifier,(function(){return d.dynamicValue(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Factory&&null!==d.factory)f=u("toFactory",d.serviceIdentifier,(function(){return d.factory(e.parentContext)}));else if(d.type===i.BindingTypeEnum.Provider&&null!==d.provider)f=u("toProvider",d.serviceIdentifier,(function(){return d.provider(e.parentContext)}));else{if(d.type!==i.BindingTypeEnum.Instance||null===d.implementationType){var v=a.getServiceIdentifierAsString(e.serviceIdentifier);throw new Error(r.INVALID_BINDING_TYPE+" "+v)}f=s.resolveInstance(d.implementationType,o,c(t))}return"function"==typeof d.onActivation&&(f=d.onActivation(e.parentContext,f)),p&&(d.cache=f,d.activated=!0),g&&null!==t&&!t.has(d.id)&&t.set(d.id,f),f}}};e.resolve=function(t){return c(t.plan.rootRequest.requestScope)(t.plan.rootRequest)}},function(t,e,n){"use strict";var r=this&&this.__spreadArray||function(t,e){for(var n=0,r=e.length,i=t.length;n0){var l=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ConstructorArgument})).map(n);u=l,c=function(t,e,n){var r=e.filter((function(t){return null!==t.target&&t.target.type===o.TargetTypeEnum.ClassProperty})),i=r.map(n);return r.forEach((function(e,n){var r;r=e.target.name.value();var o=i[n];t[r]=o})),t}(c=new((s=t).bind.apply(s,r([void 0],u))),e,n)}else c=new t;return function(t,e){if(Reflect.hasMetadata(a.POST_CONSTRUCT,t)){var n=Reflect.getMetadata(a.POST_CONSTRUCT,t);try{e[n.value]()}catch(e){throw new Error(i.POST_CONSTRUCT_ERROR(t.name,e.message))}}}(t,c),c}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingToSyntax=void 0;var r=n(42),i=n(56),o=n(515),a=n(247),s=function(){function t(t){this._binding=t}return t.prototype.to=function(t){return this._binding.type=i.BindingTypeEnum.Instance,this._binding.implementationType=t,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toSelf=function(){if("function"!=typeof this._binding.serviceIdentifier)throw new Error(""+r.INVALID_TO_SELF_VALUE);var t=this._binding.serviceIdentifier;return this.to(t)},t.prototype.toConstantValue=function(t){return this._binding.type=i.BindingTypeEnum.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toDynamicValue=function(t){return this._binding.type=i.BindingTypeEnum.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new o.BindingInWhenOnSyntax(this._binding)},t.prototype.toConstructor=function(t){return this._binding.type=i.BindingTypeEnum.Constructor,this._binding.implementationType=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toFunction=function(t){if("function"!=typeof t)throw new Error(r.INVALID_FUNCTION_BINDING);var e=this.toConstantValue(t);return this._binding.type=i.BindingTypeEnum.Function,this._binding.scope=i.BindingScopeEnum.Singleton,e},t.prototype.toAutoFactory=function(t){return this._binding.type=i.BindingTypeEnum.Factory,this._binding.factory=function(e){return function(){return e.container.get(t)}},this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toProvider=function(t){return this._binding.type=i.BindingTypeEnum.Provider,this._binding.provider=t,this._binding.scope=i.BindingScopeEnum.Singleton,new a.BindingWhenOnSyntax(this._binding)},t.prototype.toService=function(t){this.toDynamicValue((function(e){return e.container.get(t)}))},t}();e.BindingToSyntax=s},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInWhenOnSyntax=void 0;var r=n(516),i=n(169),o=n(170),a=function(){function t(t){this._binding=t,this._bindingWhenSyntax=new o.BindingWhenSyntax(this._binding),this._bindingOnSyntax=new i.BindingOnSyntax(this._binding),this._bindingInSyntax=new r.BindingInSyntax(t)}return t.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},t.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},t.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},t.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},t.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},t.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},t.prototype.whenTargetTagged=function(t,e){return this._bindingWhenSyntax.whenTargetTagged(t,e)},t.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},t.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},t.prototype.whenParentTagged=function(t,e){return this._bindingWhenSyntax.whenParentTagged(t,e)},t.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},t.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},t.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},t.prototype.whenAnyAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,e)},t.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},t.prototype.whenNoAncestorTagged=function(t,e){return this._bindingWhenSyntax.whenNoAncestorTagged(t,e)},t.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},t.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},t.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},t}();e.BindingInWhenOnSyntax=a},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.BindingInSyntax=void 0;var r=n(56),i=n(247),o=function(){function t(t){this._binding=t}return t.prototype.inRequestScope=function(){return this._binding.scope=r.BindingScopeEnum.Request,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inSingletonScope=function(){return this._binding.scope=r.BindingScopeEnum.Singleton,new i.BindingWhenOnSyntax(this._binding)},t.prototype.inTransientScope=function(){return this._binding.scope=r.BindingScopeEnum.Transient,new i.BindingWhenOnSyntax(this._binding)},t}();e.BindingInSyntax=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ContainerSnapshot=void 0;var r=function(){function t(){}return t.of=function(e,n){var r=new t;return r.bindings=e,r.middleware=n,r},t}();e.ContainerSnapshot=r},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Lookup=void 0;var r=n(42),i=function(){function t(){this._map=new Map}return t.prototype.getMap=function(){return this._map},t.prototype.add=function(t,e){if(null==t)throw new Error(r.NULL_ARGUMENT);if(null==e)throw new Error(r.NULL_ARGUMENT);var n=this._map.get(t);void 0!==n?(n.push(e),this._map.set(t,n)):this._map.set(t,[e])},t.prototype.get=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);var e=this._map.get(t);if(void 0!==e)return e;throw new Error(r.KEY_NOT_FOUND)},t.prototype.remove=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);if(!this._map.delete(t))throw new Error(r.KEY_NOT_FOUND)},t.prototype.removeByCondition=function(t){var e=this;this._map.forEach((function(n,r){var i=n.filter((function(e){return!t(e)}));i.length>0?e._map.set(r,i):e._map.delete(r)}))},t.prototype.hasKey=function(t){if(null==t)throw new Error(r.NULL_ARGUMENT);return this._map.has(t)},t.prototype.clone=function(){var e=new t;return this._map.forEach((function(t,n){t.forEach((function(t){return e.add(n,t.clone())}))})),e},t.prototype.traverse=function(t){this._map.forEach((function(e,n){t(n,e)}))},t}();e.Lookup=i},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AsyncContainerModule=e.ContainerModule=void 0;var r=n(69),i=function(t){this.id=r.id(),this.registry=t};e.ContainerModule=i;var o=function(t){this.id=r.id(),this.registry=t};e.AsyncContainerModule=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.injectable=void 0;var r=n(42),i=n(34);e.injectable=function(){return function(t){if(Reflect.hasOwnMetadata(i.PARAM_TYPES,t))throw new Error(r.DUPLICATED_INJECTABLE_DECORATOR);var e=Reflect.getMetadata(i.DESIGN_PARAM_TYPES,t)||[];return Reflect.defineMetadata(i.PARAM_TYPES,e,t),t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.tagged=void 0;var r=n(50),i=n(61);e.tagged=function(t,e){return function(n,o,a){var s=new r.Metadata(t,e);"number"==typeof a?i.tagParameter(n,o,a,s):i.tagProperty(n,o,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.named=void 0;var r=n(34),i=n(50),o=n(61);e.named=function(t){return function(e,n,a){var s=new i.Metadata(r.NAMED_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.optional=void 0;var r=n(34),i=n(50),o=n(61);e.optional=function(){return function(t,e,n){var a=new i.Metadata(r.OPTIONAL_TAG,!0);"number"==typeof n?o.tagParameter(t,e,n,a):o.tagProperty(t,e,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.unmanaged=void 0;var r=n(34),i=n(50),o=n(61);e.unmanaged=function(){return function(t,e,n){var a=new i.Metadata(r.UNMANAGED_TAG,!0);o.tagParameter(t,e,n,a)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiInject=void 0;var r=n(34),i=n(50),o=n(61);e.multiInject=function(t){return function(e,n,a){var s=new i.Metadata(r.MULTI_INJECT_TAG,t);"number"==typeof a?o.tagParameter(e,n,a,s):o.tagProperty(e,n,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.targetName=void 0;var r=n(34),i=n(50),o=n(61);e.targetName=function(t){return function(e,n,a){var s=new i.Metadata(r.NAME_TAG,t);o.tagParameter(e,n,a,s)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.postConstruct=void 0;var r=n(42),i=n(34),o=n(50);e.postConstruct=function(){return function(t,e,n){var a=new o.Metadata(i.POST_CONSTRUCT,e);if(Reflect.hasOwnMetadata(i.POST_CONSTRUCT,t.constructor))throw new Error(r.MULTIPLE_POST_CONSTRUCT_METHODS);Reflect.defineMetadata(i.POST_CONSTRUCT,a,t.constructor)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.multiBindToService=void 0;e.multiBindToService=function(t){return function(e){return function(){for(var n=[],r=0;rn*n){var i=Math.sqrt(r);t[0]=e[0]/i*n,t[1]=e[1]/i*n}else t[0]=e[0],t[1]=e[1];return t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ViewContainer=void 0;const r=n(566),i=n(33),o=n(567),a=n(568),s=n(119),u=n(174),c=n(570),l=n(277);e.ViewContainer=class{constructor(t,e){const n=c.InitG6Behaviors(t,this);this.engine=t,this.layoutProvider=new r.LayoutProvider(t,this),this.renderer=new o.Renderer(t,e,n),this.reconcile=new a.Reconcile(t,this.renderer),this.layoutGroupTable=new Map,this.prevModelList=[],this.accumulateLeakModels=[],this.hasLeak=!1,this.brushSelectedModels=[],this.clickSelectNode=null;this.renderer.getG6Instance();const i=this.engine.viewOptions.leakAreaHeight,s=this.getG6Instance().getHeight(),{drag:u,zoom:h}=this.engine.behaviorOptions;this.leakAreaY=s-i,l.SolveNodeAppendagesDrag(this),l.SolveBrushSelectDrag(this),u&&l.SolveDragCanvasWithLeak(this),h&&l.SolveZoomCanvasWithLeak(this)}reLayout(){const t=this.getG6Instance(),e=t.getGroup().getMatrix();if(e){let n=e[6],r=e[7];t.translate(-n,-r)}this.layoutProvider.layoutAll(this.layoutGroupTable,this.accumulateLeakModels,[]),t.refresh()}getG6Instance(){return this.renderer.getG6Instance()}getAccumulateLeakModels(){return this.accumulateLeakModels}getLayoutGroupTable(){return this.layoutGroupTable}refresh(){this.renderer.getG6Instance().refresh()}resize(t,e){const n=this.getG6Instance(),r=n.getHeight(),i=new u.Group;i.add(...this.prevModelList,...this.accumulateLeakModels),this.renderer.changeSize(t,e);const o=n.getHeight()-r;i.translate(0,o),this.renderer.refresh(),this.leakAreaY+=o,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})}render(t){const e=i.Util.convertGroupTable2ModelList(t),n=this.reconcile.diff(this.layoutGroupTable,this.prevModelList,e,this.accumulateLeakModels),r=[...e,...n.REMOVE,...n.LEAKED,...n.ACCUMULATE_LEAK];!0===this.hasLeak&&0===this.accumulateLeakModels.length&&(this.hasLeak=!1,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})),n.LEAKED.length&&(this.hasLeak=!0,s.EventBus.emit("onLeakAreaUpdate",{leakAreaY:this.leakAreaY,hasLeak:this.hasLeak})),this.renderer.build(r),this.layoutProvider.layoutAll(t,this.accumulateLeakModels,n.LEAKED),this.beforeRender(),this.renderer.render(r),this.reconcile.patch(n),this.afterRender(),this.accumulateLeakModels.push(...n.LEAKED),this.layoutGroupTable=t,this.prevModelList=e}destroy(){this.renderer.destroy(),this.reconcile.destroy(),this.layoutProvider=null,this.layoutGroupTable=null,this.prevModelList.length=0,this.accumulateLeakModels.length=0,this.brushSelectedModels.length=0}afterRender(){this.prevModelList.forEach(t=>{!1===t.leaked&&(t.discarded=!0)})}beforeRender(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LayoutProvider=void 0;const r=n(172),i=n(174),o=n(33),a=n(173);e.LayoutProvider=class{constructor(t,e){this.engine=t,this.viewOptions=this.engine.viewOptions,this.viewContainer=e}preLayoutProcess(t){o.Util.convertGroupTable2ModelList(t).forEach(t=>{t.preLayout=!0,t.set("rotation",t.get("rotation")),t.set({x:0,y:0})})}postLayoutProcess(t){o.Util.convertGroupTable2ModelList(t).forEach(t=>{t.preLayout=!1,t.layoutX=t.get("x"),t.layoutY=t.get("y")})}layoutMarker(t,e){t.forEach(t=>{var n,r,i;const o=e[t.sourceType],s=null!==(n=o.offset)&&void 0!==n?n:8,u=null!==(r=t.anchor)&&void 0!==r?r:0,c=null!==(i=o.labelOffset)&&void 0!==i?i:2;let l,h,f=t.target.getBound(),d=t.target.shadowG6Item.getAnchorPoints()[u],p=[f.x+f.width/2,f.y+f.height/2],g=[d.x,d.y],v=a.Vector.subtract(g,p),m=0,y=a.Vector.length(v)+s;m=0===v[0]?v[1]>0?-Math.PI:0:Math.sign(v[0])*(Math.PI/2-Math.atan(v[1]/v[0]));const b=t.get("size")[1],x=t.getLabelSizeRadius()/2;v=a.Vector.normalize(v),l=a.Vector.location(p,v,y),h=a.Vector.location(p,v,b+y+x+c),h=a.Vector.subtract(h,l),t.set({x:l[0],y:l[1],rotation:m,markerEndPosition:h})})}layoutFreedLabel(t){t.forEach(t=>{const e=t.target.getBound();t.set({x:e.x+e.width/2,y:e.y+1.5*e.height,size:[e.width,0]})})}layoutIndexLabel(t,e){const n={top:(t,e,n)=>({x:t.x+t.width/2,y:t.y-n}),right:(t,e,n)=>({x:t.x+t.width+n,y:t.y+t.height/2}),bottom:(t,e,n)=>({x:t.x+t.width/2,y:t.y+t.height+n}),left:(t,e,n)=>({x:t.x-e.width-n,y:t.y+t.height/2})};t.forEach(t=>{var r,i;const o=e[t.sourceType],a=t.target.getBound(),s=t.getBound(),u=null!==(r=o.offset)&&void 0!==r?r:20,c=null!==(i=o.position)&&void 0!==i?i:"bottom",l=n[c](a,s,u);t.set(l)})}layoutAddressLabel(t,e){const n=e.offset||16;t.forEach(t=>{const e=t.target.getBound();t.set({x:e.x+e.width/2,y:e.y-n})})}layoutModels(t){const e=[];return t.forEach(t=>{const n=t.modelList,r=new i.Group,o=t.options.layout;n.forEach(t=>{r.add(t)}),t.layoutCreator.layout(t.node,o),e.push(r)}),t.forEach(t=>{const e=t.options.marker||{},n=t.options.indexLabel||{},r=t.options.addressLabel||{};this.layoutIndexLabel(t.indexLabel,n),this.layoutFreedLabel(t.freedLabel),this.layoutAddressLabel(t.addressLabel,r),this.layoutMarker(t.marker,e)}),e}layoutLeakModels(t,e){const n=new i.Group,a=this.viewContainer.getG6Instance().getHeight()-this.engine.viewOptions.leakAreaHeight;let s;t.forEach(t=>{t.set({x:t.layoutX,y:t.layoutY})});const u=e.length?r.Bound.union(...e.map(t=>t.getBound())):{x:0,y:a,width:0,height:0},c=o.Util.groupBy(t,"group");Object.keys(c).forEach(t=>{n.add(...c[t]);const e=n.getBound(),i=s?s.x+s.width:0,{x:o,y:a}=e,l=u.x+u.width+i+60-o,h=u.y-a;n.translate(l,h),n.clear(),r.Bound.translate(e,l,h),s=e})}layoutGroups(t){let e,n,o,a=new i.Group,s=[],u=0;for(let i=0;it.item.SVModel.isNode(),getContent:t=>this.getTooltipContent(t.item.SVModel,{address:"sourceId",data:"data"}),itemTypes:["node"]});this.shadowG6Instance=new i.Graph({container:e.cloneNode()}),this.g6Instance=new i.Graph({container:e,width:e.offsetWidth,height:e.offsetHeight,groupByTypes:!1,animate:r,animateCfg:{duration:o,easing:a},fitView:!1,modes:n,plugins:[s]})}getTooltipContent(t,e){const n=document.createElement("div");if(null==t)return n;if(Object.keys(e).map(r=>{let i=t[e[r]];if(null!=i){let e=document.createElement("div");e.innerHTML=`${r}:${""!==i?i:t.G6ModelProps.label}`,n.appendChild(e)}}),t.freed){let t=document.createElement("div");t.innerHTML="(freed)",n.appendChild(t)}return n}build(t){const e=r.Util.convertModelList2G6Data(t);this.shadowG6Instance.clear(),this.shadowG6Instance.read(e),t.forEach(t=>{t.shadowG6Item=this.shadowG6Instance.findById(t.id),t.shadowG6Instance=this.shadowG6Instance})}render(t){const e=r.Util.convertModelList2G6Data(t);this.g6Instance.changeData(e),t.forEach(t=>{t.g6Instance=this.g6Instance,t.G6Item=this.g6Instance.findById(t.id),t.G6Item.SVModel=t}),this.g6Instance.getEdges().forEach(t=>t.toFront()),this.g6Instance.paint()}removeModel(t){this.g6Instance.removeItem(t.G6Item),this.shadowG6Instance.removeItem(t.shadowG6Item)}getG6Instance(){return this.g6Instance}refresh(){this.g6Instance.refresh(),this.shadowG6Instance.refresh()}changeSize(t,e){this.g6Instance.changeSize(t,e),this.shadowG6Instance.changeSize(t,e)}destroy(){this.shadowG6Instance.destroy(),this.g6Instance.destroy()}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Reconcile=void 0;const r=n(119),i=n(33),o=n(147),a=n(118),s=n(276),u=n(569);e.Reconcile=class{constructor(t,e){this.engine=t,this.renderer=e,this.isFirstPatch=!0}getContinuousModels(t,e){return e.filter(e=>t.find(t=>e.id===t.id))}getAppendModels(t,e,n){const r=e.filter(e=>!t.find(t=>t.id===e.id));return r.forEach(t=>{let e=n.findIndex(e=>t.id===e.id);e>-1&&n.splice(e,1)}),r}getLeakModels(t,e,n){let r=e.filter(t=>!n.find(e=>e.id===t.id)&&!t.freed);const s=[],u=r.filter(t=>t.isNode()),c=i.Util.groupBy(u,"group");return r=r.filter(t=>!1===t.isNode()),Object.keys(c).forEach(e=>{const n=t.get(e).layoutCreator.defineLeakRule;n&&"function"==typeof n&&r.push(...n(c[e]))}),r.forEach(t=>{t instanceof a.SVNode&&(t.leaked=!0,s.push(t),t.appendages.forEach(t=>{t.leaked=!0,s.push(t)}))}),r.forEach(t=>{t instanceof o.SVLink&&!1!==t.node.leaked&&!1!==t.target.leaked&&(t.leaked=!0,s.push(t))}),s.forEach(t=>{t.G6Item=null}),s}getRemoveModels(t,e){let n=[];for(let r=0;rt.id===i.id)||i.leaked||n.push(i)}return n}getReTargetMarkers(t,e){const n=t.filter(t=>t instanceof s.SVMarker);return e.filter(t=>t instanceof s.SVMarker).filter(t=>n.find(e=>e.id===t.id&&e.target.id!==t.target.id))}getLabelChangeModels(t,e){let n=[];return e.forEach(e=>{const r=t.find(t=>t.id===e.id);if(void 0===r)return;const i=r.get("label"),o=e.get("label");String(i)!==String(o)&&n.push(e)}),n}getFreedModels(t,e){const n=e.filter(t=>t instanceof a.SVNode&&t.freed);return n.forEach(e=>{const n=t.find(t=>e.id===t.id);n&&e.set("label",n.get("label"))}),n}handleContinuousModels(t){for(let e=0;e{if(t instanceof s.SVNodeAppendage)if(t instanceof s.SVAddressLabel){t.G6Item.getContainer().attr({opacity:0})}else u.Animations.FADE_IN(t.G6Item,{duration:e,timingFunction:n});else u.Animations.APPEND(t.G6Item,{duration:e,timingFunction:n})})}handleRemoveModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{u.Animations.REMOVE(t.G6Item,{duration:e,timingFunction:n,callback:()=>{this.renderer.removeModel(t)}})})}handleLeakModels(t){let{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{t instanceof s.SVAddressLabel&&u.Animations.FADE_IN(t.G6Item,{duration:e,timingFunction:n}),t.G6Item.enableCapture(!1)}),r.EventBus.emit("onLeak",t)}handleAccumulateLeakModels(t){t.forEach(t=>{t.generalStyle&&t.set("style",Object.assign({},t.generalStyle))})}handleFreedModels(t){const{duration:e,timingFunction:n}=this.engine.animationOptions;t.forEach(t=>{const r=t.G6Item.getContainer();if(t.set("style",{fill:"#ccc"}),r.attr({opacity:.4}),t.marker){const e=t.marker.G6Item.getContainer();t.marker.set("style",{fill:"#ccc"}),e.attr({opacity:.9})}t.freedLabel.G6Item.toFront(),u.Animations.FADE_IN(t.freedLabel.G6Item,{duration:e,timingFunction:n})}),r.EventBus.emit("onFreed",t)}handleChangeModels(t){const e=this.engine.viewOptions.updateHighlight;e&&"string"==typeof e&&t.forEach(t=>{void 0===t.generalStyle&&(t.generalStyle=i.Util.objectClone(t.G6ModelProps.style)),t instanceof o.SVLink?t.set("style",{stroke:e}):t.set("style",{fill:e})})}diff(t,e,n,r){const i=this.getContinuousModels(e,n),o=this.getLeakModels(t,e,n),a=this.getAppendModels(e,n,r),s=this.getRemoveModels(e,n),u=[...this.getReTargetMarkers(e,n),...this.getLabelChangeModels(e,n),...a,...o];return{CONTINUOUS:i,APPEND:a,REMOVE:s,FREED:this.getFreedModels(e,n),LEAKED:o,UPDATE:u,ACCUMULATE_LEAK:[...r]}}patch(t){const{APPEND:e,REMOVE:n,FREED:r,LEAKED:i,UPDATE:o,CONTINUOUS:a,ACCUMULATE_LEAK:s}=t;this.handleAccumulateLeakModels(s),!1===this.isFirstPatch&&this.handleChangeModels(o),this.handleContinuousModels(a),this.handleFreedModels(r),this.handleAppendModels(e),this.handleLeakModels(i),this.handleRemoveModels(n),this.isFirstPatch&&(this.isFirstPatch=!1)}destroy(){}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Animations=void 0;const r=n(78);e.Animations={APPEND(t,e){const n=t.getType(),i=t.getContainer(),o=r.Util.mat3,a={duration:e.duration,easing:e.timingFunction,callback:e.callback};if("node"===n){let t=i.getMatrix(),e=o.clone(t);o.scale(t,t,[0,0]),o.scale(e,e,[1,1]),i.attr({matrix:t,opacity:0}),i.animate({matrix:e,opacity:1},a)}if("edge"===n){const t=i.get("children")[0],e=t.getTotalLength();t.attr({lineDash:[0,e],opacity:0}),t.animate({lineDash:[e,0],opacity:1},a)}},REMOVE(t,e){const n=t.getType(),i=t.getContainer(),o=r.Util.mat3,a={duration:e.duration,easing:e.timingFunction,callback:e.callback};if("node"===n){let t=o.clone(i.getMatrix());o.scale(t,t,[0,0]),i.animate({opacity:0,matrix:t},a)}if("edge"===n){const t=i.get("children")[0],e=t.getTotalLength();t.animate({lineDash:[0,e],opacity:0},a)}},FADE_IN(t,e){const n=t.getContainer(),r={duration:e.duration,easing:e.timingFunction,callback:e.callback};n.attr({opacity:0}),n.animate({opacity:1},r)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.InitG6Behaviors=void 0;const r=n(277);e.InitG6Behaviors=function(t,e){const n={type:"drag-node",shouldBegin:t=>{let n=t.item,i=n.SVModel;if(null===n||!1===i.isNode())return!1;if(!1===r.DetermineNodeDrag(e.getLayoutGroupTable(),i,e.brushSelectedModels))return!1;if(e.clickSelectNode){void 0===e.brushSelectedModels.find(t=>t.id===e.clickSelectNode.id)&&(e.clickSelectNode.setSelectedState(!1),e.clickSelectNode=null)}return i.setSelectedState(!0),i.appendages.forEach(t=>{t.setSelectedState(!0)}),!0}};return{default:[n,{type:"drag-canvas"},{type:"click-select",multiple:!1,shouldBegin:t=>{let n=t.item,r=n.SVModel;return null!==n&&!1!==r.isNode()&&(e.clickSelectNode=r,!0)}}],brush:[{type:"brush-select",trigger:"drag",includeEdges:!1,shouldUpdate:t=>{const e=t.SVModel;return!e.leaked&&!1!==e.isNode()&&(e.setSelectedState(!0),!0)}},n]}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("pointer",{draw(t,e){const n=e.addShape("path",{attrs:{path:this.getPath(t),fill:t.style.fill,matrix:t.style.matrix},name:"pointer-path"});if(t.label){const r=t.labelCfg&&t.labelCfg.style||{},i=e.addShape("rect",{attrs:{x:0,y:0,text:t.label,fill:null,radius:2},name:"bgRect"}),o=e.addShape("text",{attrs:{x:0,y:0,textAlign:"center",textBaseline:"middle",text:t.label,fill:r.fill||"#999",fontSize:r.fontSize||16},name:"pointer-text-shape"}),{width:a,height:s}=o.getBBox(),{width:u,height:c}=n.getBBox();i.attr({width:a+u+6,height:s+c+6});const l=t.markerEndPosition;if(l){let t=l[0],e=l[1];o.attr({x:t,y:e}),i.attr({x:t-a/2-3,y:e-s/2-3})}return i}return n},getPath(t){let e=t.size[0],n=t.size[1],r=e+4,i=.3*n;return[["M",0,0],["L",-e/2-r/2,-i],["L",-e/2,-i],["L",-e/2,-n],["L",e/2,-n],["L",e/2,-i],["L",e/2+r/2,-i],["Z"]]}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("link-list-node",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke||"#333",fill:t.style.backgroundFill||"#eee",cursor:t.style.cursor},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n*(2/3),height:r,fill:t.style.fill,stroke:t.style.stroke||"#333",cursor:t.style.cursor},name:"main-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.label&&e.addShape("text",{attrs:{x:n*(5/6),y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16},name:"text",draggable:!0}),t.next||t.loopNext||e.addShape("text",{attrs:{x:n*(4/3),y:1.2*r,textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[5/6,0],[5/6,.5],[1,.5],[5/6,1],[.5,1],[0,.5],[1/3,1]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("binary-tree-node",{draw(t,e){t.size=t.size;const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke||"#333",cursor:t.style.cursor,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/4+n/2,y:r/2,width:n/2,height:r,fill:t.style.fill,stroke:t.style.stroke||"#333",cursor:t.style.cursor},name:"mid",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.label&&e.addShape("text",{attrs:{x:n,y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),"0x0"==t.child[0]&&e.addShape("text",{attrs:{x:n*(5/8),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),"0x0"==t.child[1]&&e.addShape("text",{attrs:{x:n*(11/8),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:18,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[.875,.5],[.5,1],[.125,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(78),i=n(33);function o(t,e,n){const r=n(t.getMatrix(),[["r",e]]);t.setMatrix(r)}function a(t,e,n,r){const i=r(t.getMatrix(),[["t",e,n]]);t.setMatrix(i)}function s(t,e){let n=Math.cos(t)*e,r=-Math.sin(t)*e;return console.log(n,r,e),{offsetX:n,offsetY:r}}e.default=o,i.Util.registerShape("clen-queue-pointer",{draw(t,e){let n=t.id;const i=parseInt(n.split("-")[1]),u=parseInt(n.split("-")[2]),c=e.addShape("path",{attrs:{x:0,y:0,path:this.getPath(t),fill:t.style.fill},name:"pointer-path"}),l=i*Math.PI*2/u;if(t.label){const n=t.labelCfg&&t.labelCfg.style||{};e.addShape("rect",{attrs:{x:0,y:0,width:0,height:0,text:t.label,fill:null,radius:2},name:"bgRect"});let i=t.label.split("-")[0],o="front"==i?30:15;a(e.addShape("text",{attrs:{x:s(Math.PI/2-l,o).offsetX,y:s(Math.PI/2-l,o).offsetY,textAlign:"center",textBaseline:"middle",text:i,fill:n.fill||"#999",fontSize:n.fontSize||16},name:"pointer-text-shape"}),0,-75,r.default.Util.transform)}return o(c,l,r.default.Util.transform),a(c,0,-75,r.default.Util.transform),c},getPath:t=>[["M",0,0],["L",-.5,0],["L",-.5,-38],["L",-3,-38],["L",0,-49.4],["L",3,-38],["L",.5,-38],["L",.5,0],["Z"]]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("two-cell-node",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n/2,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"left-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};if(t.label)if(Array.isArray(t.label)){let i=t.label[0],a=t.label[1];e.addShape("text",{attrs:{x:n*(3/4),y:r,textAlign:"center",textBaseline:"middle",text:i,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n*(5/4),y:r,textAlign:"center",textBaseline:"middle",text:a,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0})}else e.addShape("text",{attrs:{x:n*(3/4),y:r,textAlign:"center",textBaseline:"middle",text:t.label,fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0});return t.id.includes("tableHeadNode")&&!t.headNext&&e.addShape("text",{attrs:{x:n*(5/4),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:20,cursor:t.style.cursor},name:"text",draggable:!0}),t.id.includes("head")&&!t.start&&e.addShape("text",{attrs:{x:n*(5/4),y:r*(8/7),textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:20,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[3/4,.5],[.5,1],[0,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(78);e.default=r.registerNode("three-cell",{draw(t,e){t.size=t.size||[30,10];const n=t.size[0],r=t.size[1],i=e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n,height:r,stroke:t.style.stroke,fill:t.style.backgroundFill||"#eee"},name:"wrapper"});e.addShape("rect",{attrs:{x:n/2,y:r/2,width:n/3,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"left-rect",draggable:!0}),e.addShape("rect",{attrs:{x:n*(5/6),y:r/2,width:n/3,height:r,fill:t.style.fill,stroke:t.style.stroke},name:"middle-rect",draggable:!0});const o=t.labelCfg&&t.labelCfg.style||{};return t.root&&t.rootLabel&&(e.addShape("text",{attrs:{x:n*(2/3),y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[0],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n,y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[1],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n*(4/3),y:0,textAlign:"center",textBaseline:"middle",text:t.rootLabel[2],fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0})),null!==t.index&&e.addShape("text",{attrs:{x:.4*n,y:r,textAlign:"center",textBaseline:"middle",text:t.index,fill:o.fill||"#bbb",fontSize:o.fontSize||16,fontStyle:"italic",cursor:t.style.cursor},name:"text",draggable:!0}),t.label&&(e.addShape("text",{attrs:{x:n*(2/3),y:r,textAlign:"center",textBaseline:"middle",text:t.label[0],fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0}),e.addShape("text",{attrs:{x:n,y:r,textAlign:"center",textBaseline:"middle",text:t.label[1],fill:o.fill||"#000",fontSize:o.fontSize||16,cursor:t.style.cursor},name:"text",draggable:!0})),t.headNext||e.addShape("text",{attrs:{x:n*(4/3),y:1.2*r,textAlign:"center",textBaseline:"middle",text:"^",fill:o.fill||"#000",fontSize:25,cursor:t.style.cursor},name:"text",draggable:!0}),i},getAnchorPoints:()=>[[.5,0],[5/6,.5],[.5,1],[0,.5]]})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("array-node",{getAnchorPoints:()=>[[.5,0],[1,.5],[.5,1],[0,.5]]},"rect")},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const r=n(33);e.default=r.Util.registerShape("cursor",{draw(t,e){const n=e.addShape("path",{attrs:{path:this.getPath(t),fill:t.style.fill,matrix:t.style.matrix},name:"cursor-path"});if(t.label){const n=t.labelCfg&&t.labelCfg.style||{},r=e.addShape("rect",{attrs:{x:0,y:0,text:t.label,fill:"transparent",radius:2},name:"bgRect"}),i=e.addShape("text",{attrs:{x:0,y:0,textAlign:"center",textBaseline:"middle",text:t.label,fill:n.fill||"#999",fontSize:n.fontSize||16},name:"cursor-text-shape"}),{width:o,height:a}=i.getBBox();r.attr({width:o+6,height:a+6});const s=t.markerEndPosition;if(s){let t=s[0],e=s[1];i.attr({x:t,y:e}),r.attr({x:t-o/2-3,y:e-a/2-3})}}return n},getPath(t){let e=t.size[0],n=t.size[1];return[["M",0,0],["L",-e/2,-n],["L",e/2,-n],["L",0,0],["Z"]]}})}])})); \ No newline at end of file diff --git a/src/RegisteredShape/twoCellNode.ts b/src/RegisteredShape/twoCellNode.ts index 04c3f61..e81e078 100644 --- a/src/RegisteredShape/twoCellNode.ts +++ b/src/RegisteredShape/twoCellNode.ts @@ -87,8 +87,7 @@ export default Util.registerShape('two-cell-node', { }); } } - console.log(cfg); - + //图 数据结构中没有后续指针 if(cfg.id.includes('tableHeadNode') && !cfg.headNext){ group.addShape('text', {