You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1190 lines
1.8 MiB
1190 lines
1.8 MiB
(self.webpackChunk=self.webpackChunk||[]).push([[1482],{71749:function(){"use strict"},30483:function(){"use strict"},71736:function(on,In){"use strict";In.Z={lists:"lists___xhHyq",item:"item___pWJAA",children:"children___sDG61",diamond:"diamond___FwgzD",button:"button___WPN6r",mathWrap:"mathWrap___FmnMJ",mathFillWrap:"mathFillWrap___PmY3H"}},18023:function(){"use strict";function on(Nt,nt,et,ht){et===void 0&&(et=0),ht===void 0&&(ht=1/0),this._name=Nt,this._defaultValue=nt,this._minimum=et,this._maximum=ht}Object.defineProperty(on.prototype,"name",{get:function(){return this._name},set:function(Nt){if(typeof Nt!="string"||Nt==="")throw new Error("Shape name must be a valid string.");this._name=Nt}}),Object.defineProperty(on.prototype,"defaultValue",{get:function(){return this._defaultValue},set:function(Nt){if(typeof Nt!="number"||isNaN(Nt))throw new Error("The default value must be a real number, not: "+Nt);this._defaultValue=Nt}}),Object.defineProperty(on.prototype,"minimum",{get:function(){return this._minimum},set:function(Nt){if(typeof Nt!="number"||isNaN(Nt))throw new Error("Minimum must be a real number, not: "+Nt);this._minimum=Nt}}),Object.defineProperty(on.prototype,"maximum",{get:function(){return this._maximum},set:function(Nt){if(typeof Nt!="number"||isNaN(Nt))throw new Error("Maximum must be a real number, not: "+Nt);this._maximum=Nt}}),go.Shape._FigureParameters={},go.Shape.getFigureParameter=function(Nt,nt){var et=go.Shape._FigureParameters[Nt];return et?et[nt]:null},go.Shape.setFigureParameter=function(Nt,nt,et){if(!(et instanceof on))throw new Error("Third argument to Shape.setFigureParameter is not FigureParameter: "+et);if(et.defaultValue<et.minimum||et.defaultValue>et.maximum)throw new Error("defaultValue must be between minimum and maximum, not: "+et.defaultValue);var ht=go.Shape._FigureParameters[Nt];ht||(ht=[],go.Shape._FigureParameters[Nt]=ht),ht[nt]=et};var In=[];function Jt(Nt,nt){var et=In.pop();return et===void 0?new go.Point(Nt,nt):(et.x=Nt,et.y=nt,et)}function It(){var Nt=In.pop();return Nt===void 0?new go.Point:Nt}function ce(Nt){In.push(Nt)}function Be(Nt,nt,et,ht,lt,pt,vt,Ct,bt){bt||(bt=new go.Point);var zt=Nt-et,Qt=lt-vt,ie=NaN,oe=NaN;if(zt===0)if(Qt===0)Nt===et&&(ie=Nt,oe=nt);else{var re=(pt-Ct)/Qt,Ne=pt-re*lt;ie=Nt,oe=re*ie+Ne}else if(Qt===0){var ue=(nt-ht)/zt,ke=nt-ue*Nt;ie=lt,oe=ue*ie+ke}else{var ue=(nt-ht)/zt,re=(pt-Ct)/Qt,ke=nt-ue*Nt,Ne=pt-re*lt;ie=(Ne-ke)/(ue-re),oe=ue*ie+ke}return bt.x=ie,bt.y=oe,bt}function qe(Nt,nt,et,ht,lt,pt,vt,Ct,bt,zt,Qt,ie,oe,re){var Ne=1-bt,ue=bt,ke=Nt*Ne+et*ue,Ke=nt*Ne+ht*ue,Fe=et*Ne+lt*ue,wn=ht*Ne+pt*ue,Rn=lt*Ne+vt*ue,$n=pt*Ne+Ct*ue,di=ke*Ne+Fe*ue,ee=Ke*Ne+wn*ue,_t=Fe*Ne+Rn*ue,Kt=wn*Ne+$n*ue,pn=di*Ne+_t*ue,Ln=ee*Ne+Kt*ue;zt.x=ke,zt.y=Ke,Qt.x=di,Qt.y=ee,ie.x=pn,ie.y=Ln,oe.x=_t,oe.y=Kt,re.x=Rn,re.y=$n}var Se=new go.Spot(.156,.156),de=new go.Spot(.844,.844),$t=4*((Math.sqrt(2)-1)/3);go.Shape.setFigureParameter("RoundedRectangle",0,new on("CornerRounding",5)),go.Shape.defineFigureGenerator("RoundedRectangle",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=5),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var lt=ht*$t,pt=new go.Geometry().add(new go.PathFigure(ht,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-lt,0,nt,lt)).add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)).add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,et-lt,nt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,ht,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,lt,et,0,et-lt)).add(new go.PathSegment(go.PathSegment.Line,0,ht)).add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,lt,lt,0).close()));return lt>1&&(pt.spot1=new go.Spot(0,0,lt,lt),pt.spot2=new go.Spot(1,1,-lt,-lt)),pt}),go.Shape.defineFigureGenerator("Border","RoundedRectangle"),go.Shape.defineFigureGenerator("TriangleRight",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,.25,.5,.75)}),go.Shape.defineFigureGenerator("TriangleDown",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close())).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("TriangleLeft",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,et).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,0).close())).setSpots(.5,.25,1,.75)}),go.Shape.defineFigureGenerator("TriangleUp",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,et).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close())).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("Triangle","TriangleUp"),go.Shape.defineFigureGenerator("Diamond",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,0).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close())).setSpots(.25,.25,.75,.75)}),go.Shape.defineFigureGenerator("LineH",function(Nt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=et/2,ht.endX=nt,ht.endY=et/2,ht}),go.Shape.defineFigureGenerator("LineV",function(Nt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=nt/2,ht.startY=0,ht.endX=nt/2,ht.endY=et,ht}),go.Shape.defineFigureGenerator("BarH","Rectangle"),go.Shape.defineFigureGenerator("BarV","Rectangle"),go.Shape.defineFigureGenerator("MinusLine","LineH"),go.Shape.defineFigureGenerator("PlusLine",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et/2,!1).add(new go.PathSegment(go.PathSegment.Line,nt,et/2)).add(new go.PathSegment(go.PathSegment.Move,nt/2,0)).add(new go.PathSegment(go.PathSegment.Line,nt/2,et)))}),go.Shape.defineFigureGenerator("XLine",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,0,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)))}),go.Shape.defineFigureGenerator("LineRight",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.25*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)))}),go.Shape.defineFigureGenerator("LineDown",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.25*et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.75*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)))}),go.Shape.defineFigureGenerator("LineLeft",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.75*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)))}),go.Shape.defineFigureGenerator("LineUp",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.75*et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)))}),go.Shape.defineFigureGenerator("AsteriskLine",function(Nt,nt,et){var ht=.2/Math.SQRT2;return new go.Geometry().add(new go.PathFigure(ht*nt,(1-ht)*et,!1).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Move,0,et/2)).add(new go.PathSegment(go.PathSegment.Line,nt,et/2)).add(new go.PathSegment(go.PathSegment.Move,nt/2,0)).add(new go.PathSegment(go.PathSegment.Line,nt/2,et)))}),go.Shape.defineFigureGenerator("CircleLine",function(Nt,nt,et){var ht=nt/2,lt=new go.Geometry().add(new go.PathFigure(nt,nt/2,!1).add(new go.PathSegment(go.PathSegment.Arc,0,360,ht,ht,ht,ht).close()));return lt.spot1=Se,lt.spot2=de,lt.defaultStretch=go.GraphObject.Uniform,lt}),go.Shape.defineFigureGenerator("Line1",function(Nt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=0,ht.startY=0,ht.endX=nt,ht.endY=et,ht}),go.Shape.defineFigureGenerator("Line2",function(Nt,nt,et){var ht=new go.Geometry(go.Geometry.Line);return ht.startX=nt,ht.startY=0,ht.endX=0,ht.endY=et,ht}),go.Shape.defineFigureGenerator("Curve1",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,$t*nt,0,nt,(1-$t)*et)))}),go.Shape.defineFigureGenerator("Curve2",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,nt,et,0,$t*et,(1-$t)*nt,et)))}),go.Shape.defineFigureGenerator("Curve3",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,$t*et,$t*nt,et)))}),go.Shape.defineFigureGenerator("Curve4",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Bezier,0,et,(1-$t)*nt,0,0,(1-$t)*et)))}),go.Shape.defineFigureGenerator("TriangleDownLeft",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,.5,.5,1)}),go.Shape.defineFigureGenerator("TriangleDownRight",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(.5,.5,1,1)}),go.Shape.defineFigureGenerator("TriangleUpLeft",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())).setSpots(0,0,.5,.5)}),go.Shape.defineFigureGenerator("TriangleUpRight",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et).close())).setSpots(.5,0,1,.5)}),go.Shape.defineFigureGenerator("RightTriangle","TriangleDownLeft"),go.Shape.setFigureParameter("Parallelogram1",0,new on("Indent",.1,-.99,.99)),go.Shape.defineFigureGenerator("Parallelogram1",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)?ht=.1:ht<-1?ht=-1:ht>1&&(ht=1);var lt=Math.abs(ht)*nt;if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-lt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,lt,et).close())),lt<nt/2&&pt.setSpots(lt/nt,0,(nt-lt)/nt,1),pt}}),go.Shape.defineFigureGenerator("Parallelogram","Parallelogram1"),go.Shape.setFigureParameter("Parallelogram2",0,new on("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("Parallelogram2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt:ht>nt&&(ht=nt);var lt=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt-lt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,lt,et).close())),lt<nt/2&&pt.setSpots(lt/nt,0,(nt-lt)/nt,1),pt}}),go.Shape.setFigureParameter("Trapezoid1",0,new on("Indent",.2,-.99,.99)),go.Shape.defineFigureGenerator("Trapezoid1",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)?ht=.2:ht<.5?ht=-.5:ht>.5&&(ht=.5);var lt=Math.abs(ht)*nt;if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,nt-lt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,lt,et).close())),lt<nt/2&&pt.setSpots(lt/nt,0,(nt-lt)/nt,1),pt}}),go.Shape.defineFigureGenerator("Trapezoid","Trapezoid1"),go.Shape.setFigureParameter("Trapezoid2",0,new on("Indent",20,-1/0,1/0)),go.Shape.defineFigureGenerator("Trapezoid2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)?ht=20:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var lt=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,nt-lt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())):pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,lt,et).close())),lt<nt/2&&pt.setSpots(lt/nt,0,(nt-lt)/nt,1),pt}}),go.Shape.setFigureParameter("ManualOperation",0,new on("Indent",10,-1/0,1/0)),go.Shape.defineFigureGenerator("ManualOperation",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)?ht=10:ht<-nt?ht=-nt/2:ht>nt&&(ht=nt/2);var lt=Math.abs(ht);if(ht===0){var pt=new go.Geometry(go.Geometry.Rectangle);return pt.startX=0,pt.startY=0,pt.endX=nt,pt.endY=et,pt}else{var pt=new go.Geometry;return ht>0?pt.add(new go.PathFigure(0,0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,lt,et).close())):pt.add(new go.PathFigure(lt,0).add(new go.PathSegment(go.PathSegment.Line,nt-lt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close())),lt<nt/2&&pt.setSpots(lt/nt,0,(nt-lt)/nt,1),pt}});var He=[];function ve(){var Nt=He.pop();return Nt===void 0?[]:Nt}function Pe(Nt){Nt.length=0,He.push(Nt)}function ze(Nt){for(var nt=ve(),et=.5,ht=.5,lt=Math.PI*1.5,pt=0,vt=0;vt<Nt;vt++)pt=2*Math.PI/Nt*vt+lt,nt[vt]=new go.Point(ht+et*Math.cos(pt),ht+et*Math.sin(pt));return nt.push(nt[0]),nt}function Me(Nt){var nt=tn(Nt),et=ve();et[0]=nt[0];for(var ht=1,lt=1;ht<nt.length;ht+=2,lt+=3)et[lt]=nt[ht],et[lt+1]=nt[ht],et[lt+2]=nt[ht+1];return Pe(nt),et}function tn(Nt){for(var nt=ze(Nt),et=ve(),ht=Math.floor(nt.length/2),lt=nt.length-1,pt=Nt%2===0?2:1,vt=0;vt<lt;vt++){var Ct=nt[vt],bt=nt[vt+1],zt=nt[(ht+vt-1)%lt],Qt=nt[(ht+vt+pt)%lt];et[vt*2]=Ct,et[vt*2+1]=Be(Ct.x,Ct.y,zt.x,zt.y,bt.x,bt.y,Qt.x,Qt.y,new go.Point)}return et[et.length]=et[0],Pe(nt),et}go.Shape.defineFigureGenerator("Pentagon",function(Nt,nt,et){var ht=ze(5),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<5;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.2,.22),lt.spot2=new go.Spot(.8,.9),lt}),go.Shape.defineFigureGenerator("Hexagon",function(Nt,nt,et){var ht=ze(6),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<6;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.07,.25),lt.spot2=new go.Spot(.93,.75),lt}),go.Shape.defineFigureGenerator("Heptagon",function(Nt,nt,et){var ht=ze(7),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<7;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.2,.15),lt.spot2=new go.Spot(.8,.85),lt}),go.Shape.defineFigureGenerator("Octagon",function(Nt,nt,et){var ht=ze(8),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<8;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.15,.15),lt.spot2=new go.Spot(.85,.85),lt}),go.Shape.defineFigureGenerator("Nonagon",function(Nt,nt,et){var ht=ze(9),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<9;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.17,.13),lt.spot2=new go.Spot(.82,.82),lt}),go.Shape.defineFigureGenerator("Decagon",function(Nt,nt,et){var ht=ze(10),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("Dodecagon",function(Nt,nt,et){var ht=ze(12),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.16,.16),lt.spot2=new go.Spot(.84,.84),lt}),go.Shape.defineFigureGenerator("FivePointedStar",function(Nt,nt,et){var ht=tn(5),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<10;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.266,.333),lt.spot2=new go.Spot(.733,.733),lt}),go.Shape.defineFigureGenerator("SixPointedStar",function(Nt,nt,et){var ht=tn(6),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<12;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.17,.25),lt.spot2=new go.Spot(.83,.75),lt}),go.Shape.defineFigureGenerator("SevenPointedStar",function(Nt,nt,et){var ht=tn(7),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<14;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("EightPointedStar",function(Nt,nt,et){var ht=tn(8),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<16;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.25,.25),lt.spot2=new go.Spot(.75,.75),lt}),go.Shape.defineFigureGenerator("NinePointedStar",function(Nt,nt,et){var ht=tn(9),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<18;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.666),lt}),go.Shape.defineFigureGenerator("TenPointedStar",function(Nt,nt,et){var ht=tn(10),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<20;vt++)pt.add(new go.PathSegment(go.PathSegment.Line,ht[vt].x*nt,ht[vt].y*et));return pt.add(new go.PathSegment(go.PathSegment.Line,ht[0].x*nt,ht[0].y*et).close()),Pe(ht),lt.spot1=new go.Spot(.281,.261),lt.spot2=new go.Spot(.723,.748),lt}),go.Shape.defineFigureGenerator("FivePointedBurst",function(Nt,nt,et){var ht=Me(5),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),Pe(ht),lt.spot1=new go.Spot(.222,.277),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("SixPointedBurst",function(Nt,nt,et){var ht=Me(6),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),Pe(ht),lt.spot1=new go.Spot(.17,.222),lt.spot2=new go.Spot(.833,.777),lt}),go.Shape.defineFigureGenerator("SevenPointedBurst",function(Nt,nt,et){var ht=Me(7),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),Pe(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("EightPointedBurst",function(Nt,nt,et){var ht=Me(8),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),Pe(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("NinePointedBurst",function(Nt,nt,et){var ht=Me(9),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),Pe(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.defineFigureGenerator("TenPointedBurst",function(Nt,nt,et){var ht=Me(10),lt=new go.Geometry,pt=new go.PathFigure(ht[0].x*nt,ht[0].y*et,!0);lt.add(pt);for(var vt=1;vt<ht.length;vt+=3)pt.add(new go.PathSegment(go.PathSegment.Bezier,ht[vt+2].x*nt,ht[vt+2].y*et,ht[vt].x*nt,ht[vt].y*et,ht[vt+1].x*nt,ht[vt+1].y*et));return pt.segments.last().close(),Pe(ht),lt.spot1=new go.Spot(.222,.222),lt.spot2=new go.Spot(.777,.777),lt}),go.Shape.setFigureParameter("FramedRectangle",0,new on("ThicknessX",8)),go.Shape.setFigureParameter("FramedRectangle",1,new on("ThicknessY",8)),go.Shape.defineFigureGenerator("FramedRectangle",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN,lt=Nt?Nt.parameter2:NaN;isNaN(ht)&&(ht=8),isNaN(lt)&&(lt=8);var pt=new go.Geometry,vt=new go.PathFigure(0,0,!0);return pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht<nt/2&<<et/2&&(vt.add(new go.PathSegment(go.PathSegment.Move,ht,lt)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et-lt)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,et-lt)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,lt).close())),pt.setSpots(0,0,1,1,ht,lt,-ht,-lt),pt}),go.Shape.setFigureParameter("Ring",0,new on("Thickness",8)),go.Shape.defineFigureGenerator("Ring",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=8);var lt=nt/2,pt=new go.Geometry,vt=new go.PathFigure(nt,nt/2,!0);pt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Arc,0,360,lt,lt,lt,lt).close());var Ct=Math.max(lt-ht,0);return Ct>0&&(vt.add(new go.PathSegment(go.PathSegment.Move,nt/2+Ct,nt/2)),vt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,lt,lt,Ct,Ct).close())),pt.spot1=Se,pt.spot2=de,pt.defaultStretch=go.GraphObject.Uniform,pt}),go.Shape.defineFigureGenerator("Cloud",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.08034461*nt,.1944299*et,!0).add(new go.PathSegment(go.PathSegment.Bezier,.2008615*nt,.05349299*et,-.09239631*nt,.07836421*et,.1406031*nt,-.0542823*et)).add(new go.PathSegment(go.PathSegment.Bezier,.4338609*nt,.074219*et,.2450511*nt,-.00697547*et,.3776197*nt,-.01112067*et)).add(new go.PathSegment(go.PathSegment.Bezier,.6558228*nt,.07004196*et,.4539471*nt,0,.6066018*nt,-.02526587*et)).add(new go.PathSegment(go.PathSegment.Bezier,.8921095*nt,.08370865*et,.6914277*nt,-.01904177*et,.8921095*nt,-.01220843*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9147671*nt,.3194596*et,1.036446*nt,.04105738*et,1.020377*nt,.3022052*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9082935*nt,.562044*et,1.04448*nt,.360238*et,.992256*nt,.5219009*et)).add(new go.PathSegment(go.PathSegment.Bezier,.9212406*nt,.8217117*et,1.032337*nt,.5771781*et,1.018411*nt,.8120651*et)).add(new go.PathSegment(go.PathSegment.Bezier,.7592566*nt,.9156953*et,1.028411*nt,.9571472*et,.8556702*nt,1.052487*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5101666*nt,.9310455*et,.7431877*nt,1.009325*et,.5624123*nt,1.021761*et)).add(new go.PathSegment(go.PathSegment.Bezier,.2609328*nt,.9344623*et,.4820677*nt,1.031761*et,.3030112*nt,1.002796*et)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*nt,.870098*et,.2329994*nt,1.01518*et,.03213784*nt,1.01518*et)).add(new go.PathSegment(go.PathSegment.Bezier,.06829292*nt,.6545475*et,-.02812061*nt,.9032597*et,-.01205169*nt,.6835638*et)).add(new go.PathSegment(go.PathSegment.Bezier,.06427569*nt,.4265613*et,-.01812061*nt,.6089503*et,-.00606892*nt,.4555777*et)).add(new go.PathSegment(go.PathSegment.Bezier,.08034461*nt,.1944299*et,-.01606892*nt,.3892545*et,-.01205169*nt,.1944299*et))).setSpots(.1,.1,.9,.9)}),go.Shape.defineFigureGenerator("StopSign",function(Nt,nt,et){var ht=1/(Math.SQRT2+2);return new go.Geometry().add(new go.PathFigure(ht*nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close())).setSpots(ht/2,ht/2,1-ht/2,1-ht/2)}),go.Shape.setFigureParameter("Pie",0,new on("Start",0,-360,360)),go.Shape.setFigureParameter("Pie",1,new on("Sweep",315,-360,360)),go.Shape.defineFigureGenerator("Pie",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN,lt=Nt?Nt.parameter2:NaN;isNaN(ht)&&(ht=0),isNaN(lt)&&(lt=315);var pt=ht%360;pt<0&&(pt+=360);var vt=lt%360,Ct=Math.min(nt,et)/2;return new go.Geometry().add(new go.PathFigure(Ct,Ct).add(new go.PathSegment(go.PathSegment.Arc,pt,vt,Ct,Ct,Ct,Ct).close()))}),go.Shape.defineFigureGenerator("PiePiece",function(Nt,nt,et){var ht=$t/Math.SQRT2*.5,lt=Math.SQRT2/2,pt=1-Math.SQRT2/2;return new go.Geometry().add(new go.PathFigure(nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,lt*nt,pt*et,nt,(1-ht)*et,(lt+ht)*nt,(pt+ht)*et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()))}),go.Shape.setFigureParameter("ThickCross",0,new on("Thickness",30)),go.Shape.defineFigureGenerator("ThickCross",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30);var lt=Math.min(ht,nt)/2,pt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(pt-lt,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+lt,0)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,et)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt-lt).close()))}),go.Shape.setFigureParameter("ThinCross",0,new on("Thickness",10)),go.Shape.defineFigureGenerator("ThinCross",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var lt=Math.min(ht,nt)/2,pt=nt/2,vt=et/2;return new go.Geometry().add(new go.PathFigure(pt-lt,0,!0).add(new go.PathSegment(go.PathSegment.Line,pt+lt,0)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,nt,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,nt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,pt+lt,et)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,et)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt+lt)).add(new go.PathSegment(go.PathSegment.Line,0,vt-lt)).add(new go.PathSegment(go.PathSegment.Line,pt-lt,vt-lt).close()))}),go.Shape.setFigureParameter("ThickX",0,new on("Thickness",30)),go.Shape.defineFigureGenerator("ThickX",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;if((isNaN(ht)||ht<0)&&(ht=30),nt===0||et===0){var lt=new go.Geometry(go.Geometry.Rectangle);return lt.startX=0,lt.startY=0,lt.endX=nt,lt.endY=et,lt}else{var pt=nt/2,vt=et/2,Ct=Math.atan2(et,nt),bt=ht-Math.min(Math.cos(Ct)*ht/2,pt),zt=ht-Math.min(Math.sin(Ct)*ht/2,vt),lt=new go.Geometry,Qt=new go.PathFigure(bt,0,!0);return lt.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Line,pt,.2*et)),Qt.add(new go.PathSegment(go.PathSegment.Line,nt-bt,0)),Qt.add(new go.PathSegment(go.PathSegment.Line,nt,zt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,vt)),Qt.add(new go.PathSegment(go.PathSegment.Line,nt,et-zt)),Qt.add(new go.PathSegment(go.PathSegment.Line,nt-bt,et)),Qt.add(new go.PathSegment(go.PathSegment.Line,pt,.8*et)),Qt.add(new go.PathSegment(go.PathSegment.Line,bt,et)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,et-zt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,zt).close()),lt}}),go.Shape.setFigureParameter("ThinX",0,new on("Thickness",10)),go.Shape.defineFigureGenerator("ThinX",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=10);var lt=new go.Geometry,pt=new go.PathFigure(.1*nt,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et).close()),lt}),go.Shape.setFigureParameter("SquareIBeam",0,new on("BeamWidth",.2,.1,.9)),go.Shape.defineFigureGenerator("SquareIBeam",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.2);var lt=new go.Geometry,pt=new go.PathFigure(0,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5+ht/2)*nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,(1-ht)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(.5-ht/2)*nt,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et).close()),lt}),go.Shape.setFigureParameter("RoundedIBeam",0,new on("Curviness",.5,.05,.65)),go.Shape.defineFigureGenerator("RoundedIBeam",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.5);var lt=new go.Geometry,pt=new go.PathFigure(0,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,Math.abs(1-ht)*nt,.25*et,Math.abs(1-ht)*nt,.75*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),lt}),go.Shape.defineFigureGenerator("HalfEllipse",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,$t*nt,0,nt,(.5-$t/2)*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,(.5+$t/2)*et,$t*nt,et).close())).setSpots(0,.156,.844,.844)}),go.Shape.defineFigureGenerator("Crescent",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,et,nt,0,nt,et)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.5*nt,.75*et,.5*nt,.25*et).close())).setSpots(.311,.266,.744,.744)}),go.Shape.defineFigureGenerator("Heart",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,et,!0).add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,.1*nt,.8*et,0,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,0,0,.45*nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.55*nt,0,nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.5*et,.9*nt,.8*et).close())).setSpots(.14,.29,.86,.78)}),go.Shape.defineFigureGenerator("Spade",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,0,!0).add(new go.PathSegment(go.PathSegment.Line,.51*nt,.01*et)).add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.6*nt,.2*et,nt,.25*et)).add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.7*et,nt,.8*et,.6*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,.5*nt,.75*et,.55*nt,.95*et)).add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)).add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.7*et,.45*nt,.95*et,.5*nt,.75*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.4*nt,.8*et,0,.8*et)).add(new go.PathSegment(go.PathSegment.Bezier,.49*nt,.01*et,0,.25*et,.4*nt,.2*et).close())).setSpots(.14,.26,.86,.78)}),go.Shape.defineFigureGenerator("Club",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.4*nt,.6*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.15*nt,et,.5*nt,.75*et,.45*nt,.95*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.6*et,.55*nt,.95*et,.5*nt,.75*et));var pt=.2,vt=.3,Ct=0,bt=pt*$t;return lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+pt+Ct)*et,(.5-pt+vt)*nt,(.5+bt+Ct)*et,(.5-bt+vt)*nt,(.5+pt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*nt,(.5+Ct)*et,(.5+bt+vt)*nt,(.5+pt+Ct)*et,(.5+pt+vt)*nt,(.5+bt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+Ct)*et,(1-.5+pt+vt)*nt,(.5-bt+Ct)*et,(.5+bt+vt)*nt,(.5-pt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.65*nt,.36771243*et,(.5-bt+vt)*nt,(.5-pt+Ct)*et,(.5-pt+vt+.05)*nt,(.5-bt+Ct-.02)*et)),pt=.2,vt=0,Ct=-.3,bt=pt*$t,lt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+pt+vt)*nt,(.5+Ct)*et,(.5+bt+vt)*nt,(.5+pt+Ct)*et,(.5+pt+vt)*nt,(.5+bt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+Ct)*et,(1-.5+pt+vt)*nt,(.5-bt+Ct)*et,(.5+bt+vt)*nt,(.5-pt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*nt,(.5+Ct)*et,(.5-bt+vt)*nt,(.5-pt+Ct)*et,(.5-pt+vt)*nt,(.5-bt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-bt+vt)*nt,(.5+pt+Ct)*et,(.5-pt+vt)*nt,(.5+bt+Ct)*et,(.5-bt+vt)*nt,(.5+pt+Ct)*et)),pt=.2,vt=-.3,Ct=0,bt=pt*$t,lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5-pt+Ct)*et,(1-.5+pt+vt-.05)*nt,(.5-bt+Ct-.02)*et,(.5+bt+vt)*nt,(.5-pt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-pt+vt)*nt,(.5+Ct)*et,(.5-bt+vt)*nt,(.5-pt+Ct)*et,(.5-pt+vt)*nt,(.5-bt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+vt)*nt,(.5+pt+Ct)*et,(.5-pt+vt)*nt,(.5+bt+Ct)*et,(.5-bt+vt)*nt,(.5+pt+Ct)*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.6*et,(.5+bt+vt)*nt,(.5+pt+Ct)*et,(.5+pt+vt)*nt,(.5+bt+Ct)*et).close()),ht.setSpots(.06,.33,.93,.68),ht}),go.Shape.defineFigureGenerator("YinYang",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*.5,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*.5,nt*.5,nt*.5,nt*.5)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,-180,nt*.5,nt*.75,nt*.25,nt*.25)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,180,nt*.5,nt*.25,nt*.25,nt*.25));var pt=.1,vt=.5,Ct=.25;return lt.add(new go.PathSegment(go.PathSegment.Move,(vt+pt)*nt,Ct*et)),lt.add(new go.PathSegment(go.PathSegment.Arc,0,-360,nt*vt,et*Ct,pt*nt,pt*nt).close()),lt=new go.PathFigure(nt*.5,0,!1),ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*.5,nt*.5,nt*.5,nt*.5)),Ct=.75,lt=new go.PathFigure((vt+pt)*nt,Ct*et,!0),ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,0,360,nt*vt,et*Ct,pt*nt,pt*nt).close()),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Peace",function(Nt,nt,et){var ht=.8535533905932737,lt=.5*nt,pt=.5*et;return new go.Geometry().add(new go.PathFigure(lt,0,!1).add(new go.PathSegment(go.PathSegment.Arc,270,360,lt,pt,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,lt,et)).add(new go.PathSegment(go.PathSegment.Move,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Move,lt,pt)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,ht*et)))}),go.Shape.defineFigureGenerator("NotAllowed",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=.5,vt=.5,Ct=.5,bt=new go.PathFigure(vt*nt,(Ct-pt)*et);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-pt)*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),pt=.4,lt=$t*.4;var zt=It(),Qt=It(),ie=It(),oe=It();qe(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.42,zt,Qt,ie,oe,oe);var re=It(),Ne=It(),ue=It();qe(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.58,oe,oe,ue,re,Ne);var ke=It(),Ke=It(),Fe=It();qe(vt,Ct+pt,vt-lt,Ct+pt,vt-pt,Ct+lt,vt-pt,Ct,.42,ke,Ke,Fe,oe,oe);var wn=It(),Rn=It(),$n=It();return qe(vt,Ct+pt,vt-lt,Ct+pt,vt-pt,Ct+lt,vt-pt,Ct,.58,oe,oe,$n,wn,Rn),bt.add(new go.PathSegment(go.PathSegment.Move,$n.x*nt,$n.y*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,wn.x*nt,wn.y*et,Rn.x*nt,Rn.y*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,ie.x*nt,ie.y*et,zt.x*nt,zt.y*et,Qt.x*nt,Qt.y*et)),bt.add(new go.PathSegment(go.PathSegment.Line,$n.x*nt,$n.y*et).close()),bt.add(new go.PathSegment(go.PathSegment.Move,Fe.x*nt,Fe.y*et)),bt.add(new go.PathSegment(go.PathSegment.Line,ue.x*nt,ue.y*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,re.x*nt,re.y*et,Ne.x*nt,Ne.y*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,Fe.x*nt,Fe.y*et,ke.x*nt,ke.y*et,Ke.x*nt,Ke.y*et).close()),ce(zt),ce(Qt),ce(ie),ce(oe),ce(re),ce(Ne),ce(ue),ce(ke),ce(Ke),ce(Fe),ce(wn),ce(Rn),ce($n),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("Fragile",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.15*et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,.29*nt,.33*et)).add(new go.PathSegment(go.PathSegment.Line,.35*nt,.25*et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.15*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.5*et,nt,.25*et,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.5*et,0,.25*et).close()))}),go.Shape.setFigureParameter("HourGlass",0,new on("Thickness",30)),go.Shape.defineFigureGenerator("HourGlass",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=30),ht>nt&&(ht=nt);var lt=(nt-ht)/2,pt=lt+ht;return new go.Geometry().add(new go.PathFigure(pt,.5*et).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)).add(new go.PathSegment(go.PathSegment.Line,lt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,0)).add(new go.PathSegment(go.PathSegment.Line,nt,0).close()))}),go.Shape.defineFigureGenerator("Lightning",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,.55*et).add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.3*nt,.45*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.45*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.55*et).close()))}),go.Shape.defineFigureGenerator("GenderMale",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.4,pt=.4,vt=.5,Ct=.5,bt=It(),zt=It(),Qt=It(),ie=It(),oe=new go.PathFigure((vt-pt)*nt,Ct*et,!1);ht.add(oe),oe.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et)),qe(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.44,Qt,ie,zt,bt,bt),oe.add(new go.PathSegment(go.PathSegment.Bezier,zt.x*nt,zt.y*et,Qt.x*nt,Qt.y*et,ie.x*nt,ie.y*et));var re=Jt(zt.x,zt.y);qe(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.56,bt,bt,zt,Qt,ie);var Ne=Jt(zt.x,zt.y);oe.add(new go.PathSegment(go.PathSegment.Line,(re.x*.1+.95*.9)*nt,re.y*.1*et)),oe.add(new go.PathSegment(go.PathSegment.Line,.85*nt,re.y*.1*et)),oe.add(new go.PathSegment(go.PathSegment.Line,.85*nt,0)),oe.add(new go.PathSegment(go.PathSegment.Line,nt,0)),oe.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),oe.add(new go.PathSegment(go.PathSegment.Line,(Ne.x*.1+.9)*nt,.15*et)),oe.add(new go.PathSegment(go.PathSegment.Line,(Ne.x*.1+.9)*nt,(Ne.y*.1+.05*.9)*et)),oe.add(new go.PathSegment(go.PathSegment.Line,Ne.x*nt,Ne.y*et)),oe.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,Qt.x*nt,Qt.y*et,ie.x*nt,ie.y*et)),oe.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et)),oe.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,(vt-lt)*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et)),pt=.35,lt=$t*.35;var ue=new go.PathFigure(vt*nt,(Ct-pt)*et,!1);ht.add(ue),ue.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),ue.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et)),ue.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),ue.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-pt)*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et));var ke=new go.PathFigure((vt-pt)*nt,Ct*et,!1);return ht.add(ke),ce(bt),ce(zt),ce(Qt),ce(ie),ce(re),ce(Ne),ht.spot1=new go.Spot(.202,.257),ht.spot2=new go.Spot(.792,.739),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("GenderFemale",function(Nt,nt,et){var ht=new go.Geometry,lt=.375,pt=0,vt=-.125,Ct=lt*$t,bt=new go.PathFigure((.525+pt)*nt,(.5+lt+vt)*et,!1);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*nt,(.5+vt)*et,(.5+Ct+pt)*nt,(.5+lt+vt)*et,(.5+lt+pt)*nt,(.5+Ct+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5-lt+vt)*et,(1-.5+lt+pt)*nt,(.5-Ct+vt)*et,(.5+Ct+pt)*nt,(.5-lt+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*nt,(.5+vt)*et,(.5-Ct+pt)*nt,(.5-lt+vt)*et,(.5-lt+pt)*nt,(.5-Ct+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.475+pt)*nt,(.5+lt+vt)*et,(.5-lt+pt)*nt,(.5+Ct+vt)*et,(.5-Ct+pt)*nt,(.5+lt+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.85*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.85*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.9*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.475*nt,.9*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.475*nt,et)),bt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,et)),bt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.9*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.9*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.85*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et).close()),lt=.325,pt=0,vt=-.125,Ct=lt*$t;var bt=new go.PathFigure((1-.5+lt+pt)*nt,(.5+vt)*et,!1);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5+lt+vt)*et,(.5+lt+pt)*nt,(.5+Ct+vt)*et,(.5+Ct+pt)*nt,(.5+lt+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*nt,(.5+vt)*et,(.5-Ct+pt)*nt,(.5+lt+vt)*et,(.5-lt+pt)*nt,(.5+Ct+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(.5+pt)*nt,(.5-lt+vt)*et,(.5-lt+pt)*nt,(.5-Ct+vt)*et,(.5-Ct+pt)*nt,(.5-lt+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.5+lt+pt)*nt,(.5+vt)*et,(.5+Ct+pt)*nt,(.5-lt+vt)*et,(1-.5+lt+pt)*nt,(.5-Ct+vt)*et));var bt=new go.PathFigure((.525+pt)*nt,(.5+lt+vt)*et,!1);return ht.add(bt),ht.spot1=new go.Spot(.232,.136),ht.spot2=new go.Spot(.682,.611),ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicImplies",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et))).setSpots(0,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicIff",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;return isNaN(ht)&&(ht=.2),new go.Geometry().add(new go.PathFigure((1-ht)*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,(1-ht)*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Move,ht*nt,0)).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,ht*nt,et))).setSpots(.2,0,.8,.5)}),go.Shape.defineFigureGenerator("LogicNot",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)))}),go.Shape.defineFigureGenerator("LogicAnd",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(.25,.5,.75,1)}),go.Shape.defineFigureGenerator("LogicOr",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,0))).setSpots(.219,0,.78,.409)}),go.Shape.defineFigureGenerator("LogicXor",function(Nt,nt,et){var ht=new go.Geometry().add(new go.PathFigure(.5*nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Arc,0,360,.5*nt,.5*et,.5*nt,.5*et)));return ht.defaultStretch=go.GraphObject.Uniform,ht}),go.Shape.defineFigureGenerator("LogicTruth",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)))}),go.Shape.defineFigureGenerator("LogicFalsity",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)))}),go.Shape.defineFigureGenerator("LogicThereExists",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,0,.5*et)).add(new go.PathSegment(go.PathSegment.Move,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et)))}),go.Shape.defineFigureGenerator("LogicForAll",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et))).setSpots(.25,0,.75,.5)}),go.Shape.defineFigureGenerator("LogicIsDefinedAs",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Move,0,.5*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)).add(new go.PathSegment(go.PathSegment.Move,0,et)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(.01,.01,.99,.49)}),go.Shape.defineFigureGenerator("LogicIntersect",function(Nt,nt,et){var ht=.5;return new go.Geometry().add(new go.PathFigure(0,et,!1).add(new go.PathSegment(go.PathSegment.Line,0,ht*et)).add(new go.PathSegment(go.PathSegment.Arc,180,180,ht*nt,ht*et,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,nt,et))).setSpots(0,.5,1,1)}),go.Shape.defineFigureGenerator("LogicUnion",function(Nt,nt,et){var ht=.5;return new go.Geometry().add(new go.PathFigure(nt,0,!1).add(new go.PathSegment(go.PathSegment.Line,nt,ht*et)).add(new go.PathSegment(go.PathSegment.Arc,0,180,ht*nt,ht*et,ht*nt,ht*et)).add(new go.PathSegment(go.PathSegment.Line,0,0))).setSpots(0,0,1,.5)}),go.Shape.setFigureParameter("Arrow",0,new on("ArrowheadWidth",.3,.01,.99)),go.Shape.setFigureParameter("Arrow",1,new on("TailHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("Arrow",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.3);var pt=(1-ht)*nt,vt=(.5-lt/2)*et,Ct=(.5+lt/2)*et,bt=new go.Geometry,zt=new go.PathFigure(0,vt,!0);bt.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),zt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,et)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,Ct)),zt.add(new go.PathSegment(go.PathSegment.Line,0,Ct).close()),bt.spot1=new go.Spot(0,vt/et);var Qt=Be(0,Ct/et,1,Ct/et,pt/nt,1,1,.5,It());return bt.spot2=new go.Spot(Qt.x,Qt.y),ce(Qt),bt}),go.Shape.setFigureParameter("Arrow2",0,new on("ArrowheadWidth",30)),go.Shape.setFigureParameter("Arrow2",0,new on("TailHeight",30)),go.Shape.defineFigureGenerator("Arrow2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=30),ht>nt&&(ht=nt);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=30),lt=Math.min(lt,et/2);var pt=nt-ht,vt=(et-lt)/2,Ct=vt+lt,bt=new go.Geometry,zt=new go.PathFigure(0,vt,!0);bt.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,pt,vt)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,0)),zt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,et)),zt.add(new go.PathSegment(go.PathSegment.Line,pt,Ct)),zt.add(new go.PathSegment(go.PathSegment.Line,0,Ct).close()),bt.spot1=new go.Spot(0,vt/et);var Qt=Be(0,Ct/et,1,Ct/et,pt/nt,1,1,.5,It());return bt.spot2=new go.Spot(Qt.x,Qt.y),ce(Qt),bt}),go.Shape.defineFigureGenerator("Chevron",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("DoubleArrow",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.214*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,1*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.786*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,1*et).close()),ht}),go.Shape.setFigureParameter("DoubleEndArrow",0,new on("ConnecterHeight",.3,.01,.99)),go.Shape.defineFigureGenerator("DoubleEndArrow",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=(.5-ht/2)*et,pt=(.5+ht/2)*et,vt=new go.Geometry,Ct=new go.PathFigure(nt,.5*et,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*nt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),Ct.add(new go.PathSegment(go.PathSegment.Line,.3*nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close());var bt=Be(0,.5,.3,0,0,lt/et,.1,lt/et,It());return vt.spot1=new go.Spot(bt.x,bt.y),bt=Be(.7,1,1,.5,0,pt/et,1,pt/et,bt),vt.spot2=new go.Spot(bt.x,bt.y),ce(bt),vt}),go.Shape.setFigureParameter("DoubleEndArrow2",0,new on("ConnecterHeight",40)),go.Shape.setFigureParameter("DoubleEndArrow2",1,new on("ArrowHeight",100)),go.Shape.defineFigureGenerator("DoubleEndArrow2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=40);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(et-ht)/2,vt=pt+ht,Ct=(et-lt)/2,bt=Ct+lt;(ht>et||lt>et)&&(lt>ht?(ht=ht*et/lt,pt=(et-ht)/2,vt=pt+ht,Ct=0,bt=et):(pt=0,vt=et,Ct=0,bt=et));var zt=new go.Geometry,Qt=new go.PathFigure(nt,.5*et,!0);zt.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,bt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,vt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,bt)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),Qt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,Ct)),Qt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,pt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Ct).close());var ie=Be(0,.5,.3,Ct/et,0,pt/et,1,pt/et,It());return zt.spot1=new go.Spot(ie.x,ie.y),ie=Be(.7,bt/et,1,.5,0,vt/et,1,vt/et,ie),zt.spot2=new go.Spot(ie.x,ie.y),ce(ie),zt}),go.Shape.setFigureParameter("IBeamArrow",0,new on("ConnectorHeight",.7,.51,.97)),go.Shape.defineFigureGenerator("IBeamArrow",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=(.5-ht/2)*et,pt=(.5+ht/2)*et,vt=new go.Geometry,Ct=new go.PathFigure(nt,.5*et,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*nt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,0)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(0,lt/et);var bt=Be(.7,1,1,.5,0,pt/et,1,pt/et,It());return vt.spot2=new go.Spot(bt.x,bt.y),ce(bt),vt}),go.Shape.setFigureParameter("IBeamArrow2",0,new on("ConnectorHeight",40)),go.Shape.setFigureParameter("IBeamArrow2",1,new on("BeamArrowHeight",100)),go.Shape.defineFigureGenerator("IBeamArrow2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=40);var lt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=100);var pt=(et-ht)/2,vt=pt+ht,Ct=(et-lt)/2,bt=Ct+lt;(ht>et||lt>et)&&(lt>ht?(ht=ht*et/lt,pt=(et-ht)/2,vt=pt+ht,Ct=0,bt=et):(pt=0,vt=et,Ct=0,bt=et));var zt=new go.Geometry,Qt=new go.PathFigure(nt,.5*et,!0);zt.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,bt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,vt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,vt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,bt)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,bt)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,Ct)),Qt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,Ct)),Qt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,pt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),Qt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,Ct).close()),zt.spot1=new go.Spot(0,pt/et);var ie=Be(.7,bt/et,1,.5,0,vt/et,1,vt/et,It());return zt.spot2=new go.Spot(ie.x,ie.y),ce(ie),zt}),go.Shape.setFigureParameter("Pointer",0,new on("BackPoint",.1,0,.2)),go.Shape.defineFigureGenerator("Pointer",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.1);var lt=new go.Geometry,pt=new go.PathFigure(nt,.5*et,!0);lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0).close()),lt.spot1=new go.Spot(ht,.35);var vt=Be(.2,.65,1,.65,0,1,1,.5,It());return lt.spot2=new go.Spot(vt.x,vt.y),ce(vt),lt}),go.Shape.setFigureParameter("RoundedPointer",0,new on("RoundedEdge",.3,0,.5)),go.Shape.defineFigureGenerator("RoundedPointer",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.3);var lt=new go.Geometry,pt=new go.PathFigure(nt,.5*et,!0);lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,ht*nt,.75*et,ht*nt,.25*et).close()),lt.spot1=new go.Spot(ht,.35);var vt=Be(0,.65,1,.65,0,1,1,.5,It());return lt.spot2=new go.Spot(vt.x,vt.y),ce(vt),lt}),go.Shape.setFigureParameter("SplitEndArrow",0,new on("TailHeight",.4,.01,.99)),go.Shape.defineFigureGenerator("SplitEndArrow",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.4);var lt=(.5-ht/2)*et,pt=(.5+ht/2)*et,vt=new go.Geometry,Ct=new go.PathFigure(nt,.5*et,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,.3);var bt=Be(.7,1,1,.5,0,pt/et,1,pt/et,It());return vt.spot2=new go.Spot(bt.x,bt.y),ce(bt),vt}),go.Shape.setFigureParameter("SplitEndArrow2",0,new on("TailThickness",50)),go.Shape.defineFigureGenerator("SplitEndArrow2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=50);var lt=(et-ht)/2,pt=lt+ht;ht>et&&(lt=0,pt=et);var vt=new go.Geometry,Ct=new go.PathFigure(nt,.5*et,!0);vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0).close()),vt.spot1=new go.Spot(.2,lt/et);var bt=Be(.7,1,1,.5,0,pt/et,1,pt/et,It());return vt.spot2=new go.Spot(bt.x,bt.y),ce(bt),vt}),go.Shape.setFigureParameter("SquareArrow",0,new on("ArrowPoint",.7,.2,.9)),go.Shape.defineFigureGenerator("SquareArrow",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.7);var lt=new go.Geometry,pt=new go.PathFigure(nt,.5*et,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),lt.spot1=go.Spot.TopLeft,lt.spot2=new go.Spot(ht,1),lt}),go.Shape.defineFigureGenerator("Cone1",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=$t*.1,vt=new go.PathFigure(0,.9*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-lt)*nt,et,0,(.9+pt)*et).close()),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.97),ht}),go.Shape.defineFigureGenerator("Cone2",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.9*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,et,.85/.9*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.9*et).close());var pt=new go.PathFigure(0,.9*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.9*et,(1-.85/.9)*nt,.8*et,.85/.9*nt,.8*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.82),ht}),go.Shape.defineFigureGenerator("Cube1",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var pt=new go.PathFigure(.5*nt,et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.15*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.5,.85),ht}),go.Shape.defineFigureGenerator("Cube2",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.3*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0).close());var pt=new go.PathFigure(0,.3*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Move,.7*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(.7,1),ht}),go.Shape.defineFigureGenerator("Cylinder1",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var lt=new go.Geometry,pt=$t*.5,vt=new go.PathFigure(0,ht,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,$t*ht,(.5-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,1*nt,ht,(.5+pt)*nt,0,1*nt,$t*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,1*et,1*nt,et-$t*ht,(.5+pt)*nt,1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-pt)*nt,1*et,0,et-$t*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht));var Ct=new go.PathFigure(nt,ht,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,2*ht,1*nt,2*ht-$t*ht,(.5+pt)*nt,2*ht)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,ht,(.5-pt)*nt,2*ht,0,2*ht-$t*ht)),lt.spot1=new go.Spot(0,0,0,2*ht),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder2",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,et/3);var lt=new go.Geometry,pt=$t*.5,vt=new go.PathFigure(0,et-ht,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,$t*ht,(.5-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,(.5+pt)*nt,0,nt,$t*ht)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-ht)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,et-$t*ht,(.5+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-ht,(.5-pt)*nt,et,0,et-$t*ht));var Ct=new go.PathFigure(0,et-ht,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et-2*ht,0,et-ht-$t*ht,(.5-pt)*nt,et-2*ht)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,nt,et-ht,(.5+pt)*nt,et-2*ht,nt,et-ht-$t*ht)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,0,-2*ht),lt}),go.Shape.defineFigureGenerator("Cylinder3",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var lt=new go.Geometry,pt=$t*.5,vt=new go.PathFigure(ht,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-$t*ht,0,nt,(.5-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+pt)*et,nt-$t*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,$t*ht,et,0,(.5+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*et,$t*ht,0));var Ct=new go.PathFigure(ht,0,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,2*ht,.5*et,ht+$t*ht,0,2*ht,(.5-pt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,ht,et,2*ht,(.5+pt)*et,ht+$t*ht,et)),lt.spot1=new go.Spot(0,0,2*ht,0),lt.spot2=new go.Spot(1,1),lt}),go.Shape.defineFigureGenerator("Cylinder4",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=5),ht=Math.min(ht,nt/3);var lt=new go.Geometry,pt=$t*.5,vt=new go.PathFigure(nt-ht,0,!0);lt.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,nt-$t*ht,0,nt,(.5-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt,(.5+pt)*et,nt-$t*ht,et)),vt.add(new go.PathSegment(go.PathSegment.Line,ht,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,$t*ht,et,0,(.5+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,(.5-pt)*et,$t*ht,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0));var Ct=new go.PathFigure(nt-ht,0,!1);return lt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,nt-2*ht,.5*et,nt-ht-$t*ht,0,nt-2*ht,(.5-pt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,et,nt-2*ht,(.5+pt)*et,nt-ht-$t*ht,et)),lt.spot1=new go.Spot(0,0),lt.spot2=new go.Spot(1,1,-2*ht,0),lt}),go.Shape.defineFigureGenerator("Prism1",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.25*nt,.25*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(.25*nt,.25*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.408,.172),ht.spot2=new go.Spot(.833,.662),ht}),go.Shape.defineFigureGenerator("Prism2",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.25*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(0,et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.5*et)),ht.spot1=new go.Spot(.25,.5),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("Pyramid1",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*et).close());var pt=new go.PathFigure(.5*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Pyramid2",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et).close());var pt=new go.PathFigure(.5*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.85*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),ht.spot1=new go.Spot(.25,.367),ht.spot2=new go.Spot(.75,.875),ht}),go.Shape.defineFigureGenerator("Actor",function(Nt,nt,et){var ht=new go.Geometry,lt=.2,pt=.1,vt=$t*lt,Ct=$t*pt,bt=.5,zt=.1,Qt=new go.PathFigure(bt*nt,(zt+pt)*et,!0);ht.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Bezier,(bt-lt)*nt,zt*et,(bt-vt)*nt,(zt+pt)*et,(bt-lt)*nt,(zt+Ct)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-pt)*et,(bt-lt)*nt,(zt-Ct)*et,(bt-vt)*nt,(zt-pt)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,(bt+lt)*nt,zt*et,(bt+vt)*nt,(zt-pt)*et,(bt+lt)*nt,(zt-Ct)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt+pt)*et,(bt+lt)*nt,(zt+Ct)*et,(bt+vt)*nt,(zt+pt)*et));var ie=.05,oe=$t*ie;bt=.05,zt=.25;var re=new go.PathFigure(.5*nt,.2*et,!0);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.2*et)),bt=.95,zt=.25,re.add(new go.PathSegment(go.PathSegment.Bezier,(bt+ie)*nt,zt*et,(bt+oe)*nt,(zt-ie)*et,(bt+ie)*nt,(zt-oe)*et)),re.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),re.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),re.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.35*et)),ie=.025,oe=$t*ie,bt=.825,zt=.35,re.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-ie)*et,(bt+ie)*nt,(zt-oe)*et,(bt+oe)*nt,(zt-ie)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(bt-ie)*nt,zt*et,(bt-oe)*nt,(zt-ie)*et,(bt-ie)*nt,(zt-oe)*et)),re.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),re.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et)),re.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et)),ie=.05,oe=$t*ie,bt=.5,zt=.7,re.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-ie)*et,(bt+ie)*nt,(zt-oe)*et,(bt+oe)*nt,(zt-ie)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(bt-ie)*nt,zt*et,(bt-oe)*nt,(zt-ie)*et,(bt-ie)*nt,(zt-oe)*et)),re.add(new go.PathSegment(go.PathSegment.Line,.45*nt,et)),re.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),re.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.35*et)),ie=.025,oe=$t*ie,bt=.175,zt=.35,re.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-ie)*et,(bt+ie)*nt,(zt-oe)*et,(bt+oe)*nt,(zt-ie)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(bt-ie)*nt,zt*et,(bt-oe)*nt,(zt-ie)*et,(bt-ie)*nt,(zt-oe)*et)),re.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),re.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),re.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),ie=.05,oe=$t*ie,bt=.05,zt=.25,re.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-ie)*et,(bt-ie)*nt,(zt-oe)*et,(bt-oe)*nt,(zt-ie)*et)),re.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),ht.spot1=new go.Spot(.2,.2),ht.spot2=new go.Spot(.8,.65),ht}),go.Shape.setFigureParameter("Card",0,new on("CornerCutoutSize",.2,.1,.9)),go.Shape.defineFigureGenerator("Card",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;isNaN(ht)&&(ht=.2);var lt=new go.Geometry,pt=new go.PathFigure(nt,0,!0);return lt.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,ht*et)),pt.add(new go.PathSegment(go.PathSegment.Line,ht*nt,0).close()),lt.spot1=new go.Spot(0,ht),lt.spot2=go.Spot.BottomRight,lt}),go.Shape.defineFigureGenerator("Collate",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,.5*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et));var pt=new go.PathFigure(.5*nt,.5*et,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,.25),ht}),go.Shape.defineFigureGenerator("CreateRequest",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,lt*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,lt*et)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-lt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-lt)*et)),ht}),go.Shape.defineFigureGenerator("Database",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=$t*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-lt)*nt,et,0,(.9+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-pt)*et,(.5-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+lt)*nt,0,nt,(.1-pt)*et));var Ct=new go.PathFigure(nt,.1*et,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+pt)*et,(.5+lt)*nt,.2*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-lt)*nt,.2*et,0,(.1+pt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+pt)*et,(.5+lt)*nt,.3*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-lt)*nt,.3*et,0,(.2+pt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,nt,.3*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.4*et,nt,(.3+pt)*et,(.5+lt)*nt,.4*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.3*et,(.5-lt)*nt,.4*et,0,(.3+pt)*et)),ht.spot1=new go.Spot(0,.4),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("DataStorage",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.9*et,.25*nt,.1*et).close()),ht.spot1=new go.Spot(.226,0),ht.spot2=new go.Spot(.81,1),ht}),go.Shape.defineFigureGenerator("DiskStorage",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=$t*.1,vt=new go.PathFigure(nt,.1*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.9+pt)*et,(.5+lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,(.5-lt)*nt,et,0,(.9+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,(.1-pt)*et,(.5-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,(.5+lt)*nt,0,nt,(.1-pt)*et));var Ct=new go.PathFigure(nt,.1*et,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,nt,(.1+pt)*et,(.5+lt)*nt,.2*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.1*et,(.5-lt)*nt,.2*et,0,(.1+pt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,nt,.2*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.3*et,nt,(.2+pt)*et,(.5+lt)*nt,.3*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,.2*et,(.5-lt)*nt,.3*et,0,(.2+pt)*et)),ht.spot1=new go.Spot(0,.3),ht.spot2=new go.Spot(1,.9),ht}),go.Shape.defineFigureGenerator("Display",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.25*nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,et,nt,0,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close()),ht.spot1=new go.Spot(.25,0),ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("DividedEvent",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)?lt=.2:lt<.15&&(lt=.15);var pt=$t*.2,vt=new go.PathFigure(0,.2*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,0,(.2-pt)*et,(.2-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.2*et,(.8+pt)*nt,0,nt,(.2-pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,et,nt,(.8+pt)*et,(.8+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,.8*et,(.2-pt)*nt,et,0,(.8+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et));var Ct=new go.PathFigure(0,lt*et,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt,lt*et)),ht}),go.Shape.defineFigureGenerator("DividedProcess",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;(isNaN(lt)||lt<.1)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(0,lt*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,lt*et)),ht}),go.Shape.defineFigureGenerator("Document",function(Nt,nt,et){var ht=new go.Geometry;et=et/.8;var lt=new go.PathFigure(0,.7*et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("ExternalOrganization",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;(isNaN(lt)||lt<.2)&&(lt=.2);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(lt*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,0,lt*et)),vt.add(new go.PathSegment(go.PathSegment.Move,nt,lt*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Move,0,(1-lt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,lt*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,(1-lt)*et)),ht}),go.Shape.defineFigureGenerator("ExternalProcess",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var pt=new go.PathFigure(.1*nt,.4*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.9*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.6*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.9*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.9*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("File",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(.75*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Interrupt",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt,.5*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et));var pt=new go.PathFigure(nt,.5*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et));var vt=new go.PathFigure(nt,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("InternalStorage",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN,pt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.1);var vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var Ct=new go.PathFigure(lt*nt,0,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,lt*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Move,0,pt*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt,pt*et)),ht}),go.Shape.defineFigureGenerator("Junction",function(Nt,nt,et){var ht=new go.Geometry,lt=1/Math.SQRT2,pt=(1-1/Math.SQRT2)/2,vt=$t*.5,Ct=.5,bt=new go.PathFigure(nt,Ct*et,!0);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,Ct*nt,et,nt,(Ct+vt)*et,(Ct+vt)*nt,et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,Ct*et,(Ct-vt)*nt,et,0,(Ct+vt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,Ct*nt,0,0,(Ct-vt)*et,(Ct-vt)*nt,0)),bt.add(new go.PathSegment(go.PathSegment.Bezier,nt,Ct*et,(Ct+vt)*nt,0,nt,(Ct-vt)*et));var zt=new go.PathFigure((pt+lt)*nt,(pt+lt)*et,!1);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,pt*nt,pt*et)),zt.add(new go.PathSegment(go.PathSegment.Move,pt*nt,(pt+lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Line,(pt+lt)*nt,pt*et)),ht}),go.Shape.defineFigureGenerator("LinedDocument",function(Nt,nt,et){var ht=new go.Geometry;et=et/.8;var lt=new go.PathFigure(0,.7*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close());var pt=new go.PathFigure(.1*nt,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.75*et)),ht.spot1=new go.Spot(.1,0),ht.spot2=new go.Spot(1,.6),ht}),go.Shape.defineFigureGenerator("LoopLimit",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MagneticTape",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=.5,vt=new go.PathFigure(.5*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-lt)*nt,et,0,(pt+lt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-lt)*et,(pt-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+lt)*nt,0,nt,(pt-lt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,(pt+.1)*nt,.9*et,nt,(pt+lt)*et,(pt+lt)*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),ht.spot1=new go.Spot(.15,.15),ht.spot2=new go.Spot(.85,.8),ht}),go.Shape.defineFigureGenerator("ManualInput",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("MessageFromUser",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.7);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,lt*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("MicroformProcessing",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.25);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,lt*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,(1-lt)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("MicroformRecording",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("MultiDocument",function(Nt,nt,et){var ht=new go.Geometry;et=et/.8;var lt=new go.PathFigure(nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.44*et,.96*nt,.47*et,.93*nt,.45*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.54*et,.86*nt,.57*et,.83*nt,.55*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.4*nt,.4*et,.4*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0).close());var pt=new go.PathFigure(.1*nt,.2*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.44*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.8,.77),ht}),go.Shape.defineFigureGenerator("MultiProcess",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.1*nt,.1*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close());var pt=new go.PathFigure(.2*nt,.1*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.1*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.9*et)),ht.spot1=new go.Spot(0,.2),ht.spot2=new go.Spot(.8,1),ht}),go.Shape.defineFigureGenerator("OfflineStorage",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=1-lt,vt=new go.PathFigure(0,0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close());var Ct=new go.PathFigure(.5*lt*nt,lt*et,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,(1-.5*lt)*nt,lt*et)),ht}),go.Shape.defineFigureGenerator("OffPageConnector",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.75,1),ht}),go.Shape.defineFigureGenerator("Or",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=.5,vt=new go.PathFigure(nt,pt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,et,nt,(pt+lt)*et,(pt+lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-lt)*nt,et,0,(pt+lt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-lt)*et,(pt-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+lt)*nt,0,nt,(pt-lt)*et));var Ct=new go.PathFigure(nt,.5*et,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),ht}),go.Shape.defineFigureGenerator("PaperTape",function(Nt,nt,et){var ht=new go.Geometry;et=et/.8;var lt=new go.PathFigure(0,.7*et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.3*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.3*et,.5*nt,.6*et,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.7*et,.5*nt,.4*et,.5*nt,et).close()),ht.spot1=new go.Spot(0,.49),ht.spot2=new go.Spot(1,.75),ht}),go.Shape.defineFigureGenerator("PrimitiveFromCall",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN,pt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("PrimitiveToCall",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN,pt=Nt?Nt.parameter2:NaN;isNaN(lt)&&(lt=.1),isNaN(pt)&&(pt=.3);var vt=new go.PathFigure(0,0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Procedure",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure((1-lt)*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,lt*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,lt*nt,et)),ht}),go.Shape.defineFigureGenerator("Process",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var vt=new go.PathFigure(lt*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,lt*nt,et)),ht.spot2=go.Spot.BottomRight,ht}),go.Shape.defineFigureGenerator("Sort",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et).close());var pt=new go.PathFigure(0,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),ht.spot1=new go.Spot(.25,.25),ht.spot2=new go.Spot(.75,.5),ht}),go.Shape.defineFigureGenerator("Start",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.25);var pt=new go.PathFigure(lt*nt,0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et));var vt=new go.PathFigure(lt*nt,0,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,lt*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Move,(1-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,(1-lt)*nt,et)),ht.spot1=new go.Spot(lt,0),ht.spot2=new go.Spot(1-lt,1),ht}),go.Shape.defineFigureGenerator("Terminator",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.25*nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,.75*nt,.5*et,.25*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Arc,90,180,.25*nt,.5*et,.25*nt,.5*et)),ht.spot1=new go.Spot(.23,0),ht.spot2=new go.Spot(.77,1),ht}),go.Shape.defineFigureGenerator("TransmittalTape",function(Nt,nt,et){var ht=new go.Geometry,lt=Nt?Nt.parameter1:NaN;isNaN(lt)&&(lt=.1);var pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,(1-lt)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,(1-lt)*et).close()),ht.spot1=go.Spot.TopLeft,ht}),go.Shape.defineFigureGenerator("AndGate",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=new go.PathFigure(0,0,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(.5+lt)*nt,0,nt,(.5-lt)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,(.5+lt)*et,(.5+lt)*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=go.Spot.TopLeft,ht.spot2=new go.Spot(.55,1),ht}),go.Shape.defineFigureGenerator("Buffer",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Clock",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=.5,vt=new go.PathFigure(nt,pt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,et,nt,(pt+lt)*et,(pt+lt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,pt*et,(pt-lt)*nt,et,0,(pt+lt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,pt*nt,0,0,(pt-lt)*et,(pt-lt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,pt*et,(pt+lt)*nt,0,nt,(pt-lt)*et));var Ct=new go.PathFigure(nt,pt*et,!1);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt,pt*et));var bt=new go.PathFigure(.8*nt,.75*et,!1);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.25*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.25*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.75*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.75*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.25*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.25*et)),bt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.75*et)),ht}),go.Shape.defineFigureGenerator("Ground",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.3*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),ht}),go.Shape.defineFigureGenerator("Inverter",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.1,pt=.1,vt=.9,Ct=.5,bt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,0,et)),bt.add(new go.PathSegment(go.PathSegment.Line,0,0)),bt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et));var zt=new go.PathFigure((vt+pt)*nt,Ct*et,!0);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,(vt-lt)*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,(vt+lt)*nt,(Ct-pt)*et,(vt+pt)*nt,(Ct-lt)*et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.4,.75),ht}),go.Shape.defineFigureGenerator("NandGate",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=$t*.4,vt=$t*.1,Ct=.1,bt=.9,zt=.5,Qt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,.8*nt,(.5+pt)*et,(.4+lt)*nt,et)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,et)),Qt.add(new go.PathSegment(go.PathSegment.Line,0,0)),Qt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(.4+lt)*nt,0,.8*nt,(.5-pt)*et));var ie=new go.PathFigure((bt+Ct)*nt,zt*et,!0);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt+Ct)*et,(bt+Ct)*nt,(zt+vt)*et,(bt+vt)*nt,(zt+Ct)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Ct)*nt,zt*et,(bt-vt)*nt,(zt+Ct)*et,(bt-Ct)*nt,(zt+vt)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-Ct)*et,(bt-Ct)*nt,(zt-vt)*et,(bt-vt)*nt,(zt-Ct)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Ct)*nt,zt*et,(bt+vt)*nt,(zt-Ct)*et,(bt+Ct)*nt,(zt-vt)*et)),ht.spot1=new go.Spot(0,.05),ht.spot2=new go.Spot(.55,.95),ht}),go.Shape.defineFigureGenerator("NorGate",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*lt,vt=0,Ct=.5,bt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.7*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+pt)*nt,(Ct-lt)*et,.7*nt,(Ct-pt)*et)),lt=.1,pt=$t*.1,vt=.9,Ct=.5;var zt=new go.PathFigure((vt-lt)*nt,Ct*et,!0);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*nt,Ct*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*nt,Ct*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et)),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.6,.75),ht}),go.Shape.defineFigureGenerator("OrGate",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*lt,vt=0,Ct=.5,bt=new go.PathFigure(0,0,!0);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+pt+pt)*nt,(Ct-lt)*et,.8*nt,(Ct-pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.8*nt,(Ct+pt)*et,(vt+pt+pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,0,0,.25*nt,.75*et,.25*nt,.25*et).close()),ht.spot1=new go.Spot(.2,.25),ht.spot2=new go.Spot(.75,.75),ht}),go.Shape.defineFigureGenerator("XnorGate",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*lt,vt=.2,Ct=.5,bt=new go.PathFigure(.1*nt,0,!1);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var zt=new go.PathFigure(.8*nt,.5*et,!0);ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.7*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.5*et,(vt+pt)*nt,(Ct-lt)*et,.7*nt,(Ct-pt)*et)),lt=.1,pt=$t*.1,vt=.9,Ct=.5;var Qt=new go.PathFigure((vt-lt)*nt,Ct*et,!0);return ht.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*nt,Ct*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*nt,Ct*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et)),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.65,.75),ht}),go.Shape.defineFigureGenerator("XorGate",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*lt,vt=.2,Ct=.5,bt=new go.PathFigure(.1*nt,0,!1);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,et,.35*nt,.25*et,.35*nt,.75*et));var zt=new go.PathFigure(.2*nt,0,!0);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,(vt+pt)*nt,(Ct-lt)*et,.9*nt,(Ct-pt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,et,.9*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.2*nt,0,.45*nt,.75*et,.45*nt,.25*et).close()),ht.spot1=new go.Spot(.4,.25),ht.spot2=new go.Spot(.8,.75),ht}),go.Shape.defineFigureGenerator("Capacitor",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Move,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Resistor",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*et,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Inductor",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.1,pt=.1,vt=.1,Ct=.5,bt=new go.PathFigure((vt-lt*.5)*nt,et,!1);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-lt)*nt,et,(vt-pt)*nt,0)),vt=.3,bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+lt)*nt,et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-lt)*nt,et,(vt-pt)*nt,0)),vt=.5,bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+lt)*nt,et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-lt)*nt,et,(vt-pt)*nt,0)),vt=.7,bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,et,(vt+pt)*nt,0,(vt+lt)*nt,et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,0,(vt-lt)*nt,et,(vt-pt)*nt,0)),vt=.9,bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt*.5)*nt,et,(vt+pt)*nt,0,(vt+lt)*nt,et)),ht}),go.Shape.defineFigureGenerator("ACvoltageSource",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.5,pt=.5,vt=.5,Ct=.5,bt=new go.PathFigure((vt-pt)*nt,Ct*et,!1);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,(vt+lt)*nt,(Ct-pt)*et,(vt+pt)*nt,(Ct-lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,(vt-lt)*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Move,(vt-pt+.1)*nt,Ct*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt-.1)*nt,Ct*et,vt*nt,(Ct-pt)*et,vt*nt,(Ct+pt)*et)),ht}),go.Shape.defineFigureGenerator("DCvoltageSource",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.75*et,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Move,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("Diode",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht.spot1=new go.Spot(0,.25),ht.spot2=new go.Spot(.5,.75),ht}),go.Shape.defineFigureGenerator("Wifi",function(Nt,nt,et){var ht=new go.Geometry,lt=nt,pt=et;nt=nt*.38,et=et*.6;var vt=$t*.8,Ct=.8,bt=0,zt=.5,Qt=(lt-nt)/2,ie=(pt-et)/2,oe=new go.PathFigure(bt*nt+Qt,(zt+Ct)*et+ie,!0);ht.add(oe),oe.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Ct)*nt+Qt,zt*et+ie,(bt-vt)*nt+Qt,(zt+Ct)*et+ie,(bt-Ct)*nt+Qt,(zt+vt)*et+ie)),oe.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt-Ct)*et+ie,(bt-Ct)*nt+Qt,(zt-vt)*et+ie,(bt-vt)*nt+Qt,(zt-Ct)*et+ie)),oe.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Ct+vt*.5)*nt+Qt,zt*et+ie,bt*nt+Qt,(zt-Ct)*et+ie,(bt-Ct+vt*.5)*nt+Qt,(zt-vt)*et+ie)),oe.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt+Ct)*et+ie,(bt-Ct+vt*.5)*nt+Qt,(zt+vt)*et+ie,bt*nt+Qt,(zt+Ct)*et+ie).close()),vt=$t*.4,Ct=.4,bt=.2,zt=.5;var re=new go.PathFigure(bt*nt+Qt,(zt+Ct)*et+ie,!0);ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Ct)*nt+Qt,zt*et+ie,(bt-vt)*nt+Qt,(zt+Ct)*et+ie,(bt-Ct)*nt+Qt,(zt+vt)*et+ie)),re.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt-Ct)*et+ie,(bt-Ct)*nt+Qt,(zt-vt)*et+ie,(bt-vt)*nt+Qt,(zt-Ct)*et+ie)),re.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Ct+vt*.5)*nt+Qt,zt*et+ie,bt*nt+Qt,(zt-Ct)*et+ie,(bt-Ct+vt*.5)*nt+Qt,(zt-vt)*et+ie)),re.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt+Ct)*et+ie,(bt-Ct+vt*.5)*nt+Qt,(zt+vt)*et+ie,bt*nt+Qt,(zt+Ct)*et+ie).close()),vt=$t*.2,Ct=.2,bt=.5,zt=.5;var Ne=new go.PathFigure((bt-Ct)*nt+Qt,zt*et+ie,!0);ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt-Ct)*et+ie,(bt-Ct)*nt+Qt,(zt-vt)*et+ie,(bt-vt)*nt+Qt,(zt-Ct)*et+ie)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Ct)*nt+Qt,zt*et+ie,(bt+vt)*nt+Qt,(zt-Ct)*et+ie,(bt+Ct)*nt+Qt,(zt-vt)*et+ie)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt+Ct)*et+ie,(bt+Ct)*nt+Qt,(zt+vt)*et+ie,(bt+vt)*nt+Qt,(zt+Ct)*et+ie)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(bt-Ct)*nt+Qt,zt*et+ie,(bt-vt)*nt+Qt,(zt+Ct)*et+ie,(bt-Ct)*nt+Qt,(zt+vt)*et+ie)),vt=$t*.4,Ct=.4,bt=.8,zt=.5;var ue=new go.PathFigure(bt*nt+Qt,(zt-Ct)*et+ie,!0);ht.add(ue),ue.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Ct)*nt+Qt,zt*et+ie,(bt+vt)*nt+Qt,(zt-Ct)*et+ie,(bt+Ct)*nt+Qt,(zt-vt)*et+ie)),ue.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt+Ct)*et+ie,(bt+Ct)*nt+Qt,(zt+vt)*et+ie,(bt+vt)*nt+Qt,(zt+Ct)*et+ie)),ue.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Ct-vt*.5)*nt+Qt,zt*et+ie,bt*nt+Qt,(zt+Ct)*et+ie,(bt+Ct-vt*.5)*nt+Qt,(zt+vt)*et+ie)),ue.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt-Ct)*et+ie,(bt+Ct-vt*.5)*nt+Qt,(zt-vt)*et+ie,bt*nt+Qt,(zt-Ct)*et+ie).close()),vt=$t*.8,Ct=.8,bt=1,zt=.5;var ke=new go.PathFigure(bt*nt+Qt,(zt-Ct)*et+ie,!0);return ht.add(ke),ke.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Ct)*nt+Qt,zt*et+ie,(bt+vt)*nt+Qt,(zt-Ct)*et+ie,(bt+Ct)*nt+Qt,(zt-vt)*et+ie)),ke.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt+Ct)*et+ie,(bt+Ct)*nt+Qt,(zt+vt)*et+ie,(bt+vt)*nt+Qt,(zt+Ct)*et+ie)),ke.add(new go.PathSegment(go.PathSegment.Bezier,(bt+Ct-vt*.5)*nt+Qt,zt*et+ie,bt*nt+Qt,(zt+Ct)*et+ie,(bt+Ct-vt*.5)*nt+Qt,(zt+vt)*et+ie)),ke.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt+Qt,(zt-Ct)*et+ie,(bt+Ct-vt*.5)*nt+Qt,(zt-vt)*et+ie,bt*nt+Qt,(zt-Ct)*et+ie).close()),ht}),go.Shape.defineFigureGenerator("Email",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,0,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),pt.add(new go.PathSegment(go.PathSegment.Move,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Move,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Ethernet",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.35*nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*nt,0).close());var pt=new go.PathFigure(.1*nt,et,!0,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var vt=new go.PathFigure(.6*nt,et,!0,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,et).close());var Ct=new go.PathFigure(0,.5*et,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.4*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,.75*nt,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.6*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,.25*nt,.5*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Power",function(Nt,nt,et){var ht=new go.Geometry,lt=$t*.4,pt=.4,vt=.5,Ct=.5,bt=It(),zt=It(),Qt=It(),ie=It();qe(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.5,bt,bt,zt,Qt,ie);var oe=Jt(zt.x,zt.y),re=new go.PathFigure(zt.x*nt,zt.y*et,!0);ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,Qt.x*nt,Qt.y*et,ie.x*nt,ie.y*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,(vt-lt)*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et)),qe(vt-pt,Ct,vt-pt,Ct-lt,vt-lt,Ct-pt,vt,Ct-pt,.5,Qt,ie,zt,bt,bt),re.add(new go.PathSegment(go.PathSegment.Bezier,zt.x*nt,zt.y*et,Qt.x*nt,Qt.y*et,ie.x*nt,ie.y*et)),lt=$t*.3,pt=.3,qe(vt-pt,Ct,vt-pt,Ct-lt,vt-lt,Ct-pt,vt,Ct-pt,.5,Qt,ie,zt,bt,bt),re.add(new go.PathSegment(go.PathSegment.Line,zt.x*nt,zt.y*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt-pt)*nt,Ct*et,ie.x*nt,ie.y*et,Qt.x*nt,Qt.y*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+pt)*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(vt+pt)*nt,Ct*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),qe(vt,Ct-pt,vt+lt,Ct-pt,vt+pt,Ct-lt,vt+pt,Ct,.5,bt,bt,zt,Qt,ie),re.add(new go.PathSegment(go.PathSegment.Bezier,zt.x*nt,zt.y*et,ie.x*nt,ie.y*et,Qt.x*nt,Qt.y*et).close());var re=new go.PathFigure(.45*nt,0,!0);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.5*et)),re.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.5*et)),re.add(new go.PathSegment(go.PathSegment.Line,.55*nt,0).close()),ce(bt),ce(zt),ce(Qt),ce(ie),ce(oe),ht.spot1=new go.Spot(.25,.45),ht.spot2=new go.Spot(.75,.8),ht}),go.Shape.defineFigureGenerator("Fallout",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et/2,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,180,360,nt/2,et/2,nt/2,et/2));function pt(vt,Ct,bt){vt.add(new go.PathSegment(go.PathSegment.Move,(.3+Ct)*nt,(.8+bt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.5+Ct)*nt,(.5+bt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.1+Ct)*nt,(.5+bt)*et)),vt.add(new go.PathSegment(go.PathSegment.Line,(.3+Ct)*nt,(.8+bt)*et).close())}return pt(lt,0,0),pt(lt,.4,0),pt(lt,.2,-.3),ht}),go.Shape.defineFigureGenerator("IrritationHazard",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.2*nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.3*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close()),ht.spot1=new go.Spot(.3,.3),ht.spot2=new go.Spot(.7,.7),ht}),go.Shape.defineFigureGenerator("ElectricalHazard",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.37*nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.11*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.04*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.49*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.37*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.86*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.77*nt,.91*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.34*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.34*nt,.78*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.44*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.56*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.68*et).close()),ht}),go.Shape.defineFigureGenerator("FireHazard",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.1*nt,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.29*nt,0,-.25*nt,.63*et,.45*nt,.44*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.51*nt,.42*et,.48*nt,.17*et,.54*nt,.35*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.59*nt,.18*et,.59*nt,.29*et,.58*nt,.28*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.75*nt,.6*et,.8*nt,.34*et,.88*nt,.43*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.88*nt,.31*et,.87*nt,.48*et,.88*nt,.43*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,1.17*nt,.76*et,.82*nt,.8*et).close()),ht.spot1=new go.Spot(.07,.445),ht.spot2=new go.Spot(.884,.958),ht}),go.Shape.defineFigureGenerator("BpmnActivityLoop",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=0,vt=0,Ct=lt*$t,bt=.4*Math.SQRT2/2+.5,zt=.5-.5*Math.SQRT2/2,Qt=1,ie=.5,oe=.5,re=0,Ne=new go.PathFigure(bt*nt,(1-zt)*et,!1);return ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Bezier,Qt*nt,ie*et,Qt*nt,.7*et,Qt*nt,ie*et)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(oe+pt)*nt,(re+pt)*et,(.5+lt+pt)*nt,(.5-Ct+pt)*et,(.5+Ct+pt)*nt,(.5-lt+pt)*et)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(.5-lt+pt)*nt,(.5+vt)*et,(.5-Ct+pt)*nt,(.5-lt+vt)*et,(.5-lt+pt)*nt,(.5-Ct+vt)*et)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(.35+pt)*nt,.9*et,(.5-lt+pt)*nt,(.5+Ct+vt)*et,(.5-Ct+pt)*nt,.9*et)),Ne.add(new go.PathSegment(go.PathSegment.Move,(.25+pt)*nt,.8*et)),Ne.add(new go.PathSegment(go.PathSegment.Line,(.35+pt)*nt,.9*et)),Ne.add(new go.PathSegment(go.PathSegment.Line,(.2+pt)*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityParallel",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Move,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivitySequential",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Move,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityAdHoc",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt);var pt=new go.PathFigure(nt,et,!1);ht.add(pt);var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.2*nt,.35*et,.3*nt,.35*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.7*nt,.65*et,.8*nt,.65*et)),ht}),go.Shape.defineFigureGenerator("BpmnActivityCompensation",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et).close()),ht}),go.Shape.defineFigureGenerator("BpmnTaskMessage",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.2*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et).close());var lt=new go.PathFigure(0,.2*et,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskScript",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.7*nt,et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,0,.6*nt,.5*et,0,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,et,.4*nt,.5*et,nt,.5*et).close());var pt=new go.PathFigure(.45*nt,.73*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.73*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.38*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.63*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.31*nt,.27*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.56*nt,.27*et)),ht}),go.Shape.defineFigureGenerator("BpmnTaskUser",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt);var pt=new go.PathFigure(.335*nt,(1-.555)*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.68*et,(1-.12)*nt,.46*et,(1-.02)*nt,.54*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.68*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.335*nt,(1-.555)*et,.02*nt,.54*et,.12*nt,.46*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.365*nt,(1-.595)*et));var vt=.5-.285,Ct=.5,bt=vt,zt=Math.PI/4,Qt=4*(1-Math.cos(zt))/(3*Math.sin(zt)),ie=Qt*.5,oe=vt,re=vt,Ne=Qt*oe,ue=Qt*re;pt.add(new go.PathSegment(go.PathSegment.Bezier,(Ct-oe)*nt,bt*et,(Ct-(Ne+oe)/2)*nt,(bt+(re+ue)/2)*et,(Ct-oe)*nt,(bt+ue)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,Ct*nt,(bt-re)*et,(Ct-oe)*nt,(bt-ue)*et,(Ct-Ne)*nt,(bt-re)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(Ct+oe)*nt,bt*et,(Ct+Ne)*nt,(bt-re)*et,(Ct+oe)*nt,(bt-ue)*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,(1-.365)*nt,(1-.595)*et,(Ct+oe)*nt,(bt+ue)*et,(Ct+(Ne+oe)/2)*nt,(bt+(re+ue)/2)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.365)*nt,(1-.595)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.555)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,(1-.335)*nt,(1-.405)*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.335*nt,(1-.405)*et));var ke=new go.PathFigure(.2*nt,et,!1);ht.add(ke),ke.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.8*et));var Ke=new go.PathFigure(.8*nt,et,!1);return ht.add(Ke),Ke.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventConditional",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.1*nt,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,et).close());var pt=new go.PathFigure(.2*nt,.2*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventError",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("BpmnEventEscalation",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt);var pt=new go.PathFigure(nt,et,!1);ht.add(pt);var vt=new go.PathFigure(.1*nt,et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Caution",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.05*nt,et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.8*et,0,et,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.55*nt,.1*et,.5*nt,0,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.95*nt,.9*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,et,nt,et,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*nt,et));var pt=.05;return lt.add(new go.PathSegment(go.PathSegment.Move,(.5-pt)*nt,.875*et)),lt.add(new go.PathSegment(go.PathSegment.Arc,180,-360,.5*nt,.875*et,pt*nt,pt*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.325*et,.575*nt,.725*et,.625*nt,.375*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.75*et,.375*nt,.375*et,.425*nt,.725*et)),ht}),go.Shape.defineFigureGenerator("Recycle",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.45*nt,.95*et,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.95*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.185*nt,.85*et,.17*nt,.95*et,.15*nt,.9*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.235*nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.3*nt,.625*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.65*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.45*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.45*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.05*nt,.575*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1875*nt,.95*et,0,.675*et,0,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.45*nt,.95*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.775*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.22*nt,.775*et));var pt=new go.PathFigure(.475*nt,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.225*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.275*nt,.175*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.325*nt,.05*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,.05*et,.35*nt,0,.375*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.375*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.475*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.315*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.32*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.05*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,0,.65*nt,.05*et,.625*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.38*nt,.0105*et));var vt=new go.PathFigure(.675*nt,.575*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.875*nt,.525*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,.85*nt,.95*et,nt,.8*et,nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.95*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.85*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.725*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.775*et)),vt.add(new go.PathSegment(go.PathSegment.Move,.675*nt,.575*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.775*nt,.775*et)),ht}),go.Shape.defineFigureGenerator("BpmnEventTimer",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*.5,vt=new go.PathFigure(nt,lt*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt*nt,et,nt,(lt+pt)*et,(lt+pt)*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,lt*et,(lt-pt)*nt,et,0,(lt+pt)*et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt*nt,0,0,(lt-pt)*et,(lt-pt)*nt,0)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt,lt*et,(lt+pt)*nt,0,nt,(lt-pt)*et));var Ct=new go.PathFigure(lt*nt,0,!1);return ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,lt*nt,.15*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,lt*nt,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,lt*nt,.85*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,0,lt*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.15*nt,lt*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,nt,lt*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.85*nt,lt*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,lt*nt,lt*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.58*nt,.1*et)),Ct.add(new go.PathSegment(go.PathSegment.Move,lt*nt,lt*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.78*nt,.54*et)),ht}),go.Shape.defineFigureGenerator("Package",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.15*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.15*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close());var pt=new go.PathFigure(0,.15*et,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.15*et).close()),ht.spot1=new go.Spot(0,.1),ht.spot2=new go.Spot(1,1),ht}),go.Shape.defineFigureGenerator("Class",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(0,.5*et,!1);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et).close()),ht}),go.Shape.defineFigureGenerator("Component",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt,et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et).close());var pt=new go.PathFigure(0,.2*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.2*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.2*et).close());var vt=new go.PathFigure(0,.6*et,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.6*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et).close()),ht}),go.Shape.defineFigureGenerator("Boat Shipment",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.15*nt,.6*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.6*et));var pt=new go.PathFigure(.15*nt,.6*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.6*et)),ht}),go.Shape.defineFigureGenerator("Customer/Supplier",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*nt,.33*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.66*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*nt,.33*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.33*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Workcell",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.65*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.35*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),ht}),go.Shape.defineFigureGenerator("Supermarket",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.33*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.33*et)),lt.add(new go.PathSegment(go.PathSegment.Move,nt,.33*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.66*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.66*et)),lt.add(new go.PathSegment(go.PathSegment.Move,nt,.66*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),ht}),go.Shape.defineFigureGenerator("TruckShipment",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(nt,.8*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et).close());var vt=.1,Ct=$t*.1,bt=.2,zt=.9,Qt=new go.PathFigure((bt-vt)*nt,zt*et,!0);ht.add(Qt),Qt.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-vt)*et,(bt-vt)*nt,(zt-Ct)*et,(bt-Ct)*nt,(zt-vt)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,(bt+vt)*nt,zt*et,(bt+Ct)*nt,(zt-vt)*et,(bt+vt)*nt,(zt-Ct)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt+vt)*et,(bt+vt)*nt,(zt+Ct)*et,(bt+Ct)*nt,(zt+vt)*et)),Qt.add(new go.PathSegment(go.PathSegment.Bezier,(bt-vt)*nt,zt*et,(bt-Ct)*nt,(zt+vt)*et,(bt-vt)*nt,(zt+Ct)*et).close()),vt=.1,Ct=$t*.1,bt=.8,zt=.9;var ie=new go.PathFigure((bt-vt)*nt,zt*et,!0);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt-vt)*et,(bt-vt)*nt,(zt-Ct)*et,(bt-Ct)*nt,(zt-vt)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(bt+vt)*nt,zt*et,(bt+Ct)*nt,(zt-vt)*et,(bt+vt)*nt,(zt-Ct)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,bt*nt,(zt+vt)*et,(bt+vt)*nt,(zt+Ct)*et,(bt+Ct)*nt,(zt+vt)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(bt-vt)*nt,zt*et,(bt-Ct)*nt,(zt+vt)*et,(bt-vt)*nt,(zt+Ct)*et).close()),ht}),go.Shape.defineFigureGenerator("KanbanPost",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.2*nt,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,et)),ht}),go.Shape.defineFigureGenerator("Forklift",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0));var pt=new go.PathFigure(0,.5*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var vt=new go.PathFigure(.5*nt,.8*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.1*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.8*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.8*et));var Ct=new go.PathFigure(.5*nt,.7*et,!1);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt,.7*et));var bt=.1,zt=$t*.1,Qt=.1,ie=.9,oe=new go.PathFigure((Qt-bt)*nt,ie*et,!0);ht.add(oe),oe.add(new go.PathSegment(go.PathSegment.Bezier,Qt*nt,(ie-bt)*et,(Qt-bt)*nt,(ie-zt)*et,(Qt-zt)*nt,(ie-bt)*et)),oe.add(new go.PathSegment(go.PathSegment.Bezier,(Qt+bt)*nt,ie*et,(Qt+zt)*nt,(ie-bt)*et,(Qt+bt)*nt,(ie-zt)*et)),oe.add(new go.PathSegment(go.PathSegment.Bezier,Qt*nt,(ie+bt)*et,(Qt+bt)*nt,(ie+zt)*et,(Qt+zt)*nt,(ie+bt)*et)),oe.add(new go.PathSegment(go.PathSegment.Bezier,(Qt-bt)*nt,ie*et,(Qt-zt)*nt,(ie+bt)*et,(Qt-bt)*nt,(ie+zt)*et)),bt=.1,zt=$t*.1,Qt=.4,ie=.9;var re=new go.PathFigure((Qt-bt)*nt,ie*et,!0);return ht.add(re),re.add(new go.PathSegment(go.PathSegment.Bezier,Qt*nt,(ie-bt)*et,(Qt-bt)*nt,(ie-zt)*et,(Qt-zt)*nt,(ie-bt)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Qt+bt)*nt,ie*et,(Qt+zt)*nt,(ie-bt)*et,(Qt+bt)*nt,(ie-zt)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,Qt*nt,(ie+bt)*et,(Qt+bt)*nt,(ie+zt)*et,(Qt+zt)*nt,(ie+bt)*et)),re.add(new go.PathSegment(go.PathSegment.Bezier,(Qt-bt)*nt,ie*et,(Qt-zt)*nt,(ie+bt)*et,(Qt-bt)*nt,(ie+zt)*et)),ht}),go.Shape.defineFigureGenerator("RailShipment",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.1*nt,.4*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.45*nt,.9*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.4*et).close());var pt=new go.PathFigure(.45*nt,.7*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.7*et));var vt=new go.PathFigure(.55*nt,.4*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.9*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,.4*et).close());var Qt=.05,ie=$t*.05,oe=.175,re=.95,Ct=new go.PathFigure((oe-Qt)*nt,re*et,!0);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re-Qt)*et,(oe-Qt)*nt,(re-ie)*et,(oe-ie)*nt,(re-Qt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,(oe+Qt)*nt,re*et,(oe+ie)*nt,(re-Qt)*et,(oe+Qt)*nt,(re-ie)*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re+Qt)*et,(oe+Qt)*nt,(re+ie)*et,(oe+ie)*nt,(re+Qt)*et)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,(oe-Qt)*nt,re*et,(oe-ie)*nt,(re+Qt)*et,(oe-Qt)*nt,(re+ie)*et));var Qt=.05,ie=$t*.05,oe=.375,re=.95,bt=new go.PathFigure((oe-Qt)*nt,re*et,!0);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re-Qt)*et,(oe-Qt)*nt,(re-ie)*et,(oe-ie)*nt,(re-Qt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(oe+Qt)*nt,re*et,(oe+ie)*nt,(re-Qt)*et,(oe+Qt)*nt,(re-ie)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re+Qt)*et,(oe+Qt)*nt,(re+ie)*et,(oe+ie)*nt,(re+Qt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(oe-Qt)*nt,re*et,(oe-ie)*nt,(re+Qt)*et,(oe-Qt)*nt,(re+ie)*et));var Qt=.05,ie=$t*.05,oe=.625,re=.95,zt=new go.PathFigure((oe-Qt)*nt,re*et,!0);ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re-Qt)*et,(oe-Qt)*nt,(re-ie)*et,(oe-ie)*nt,(re-Qt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(oe+Qt)*nt,re*et,(oe+ie)*nt,(re-Qt)*et,(oe+Qt)*nt,(re-ie)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re+Qt)*et,(oe+Qt)*nt,(re+ie)*et,(oe+ie)*nt,(re+Qt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(oe-Qt)*nt,re*et,(oe-ie)*nt,(re+Qt)*et,(oe-Qt)*nt,(re+ie)*et));var Qt=.05,ie=$t*.05,oe=.825,re=.95,Ne=new go.PathFigure((oe-Qt)*nt,re*et,!0);ht.add(Ne),Ne.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re-Qt)*et,(oe-Qt)*nt,(re-ie)*et,(oe-ie)*nt,(re-Qt)*et)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(oe+Qt)*nt,re*et,(oe+ie)*nt,(re-Qt)*et,(oe+Qt)*nt,(re-ie)*et)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,oe*nt,(re+Qt)*et,(oe+Qt)*nt,(re+ie)*et,(oe+ie)*nt,(re+Qt)*et)),Ne.add(new go.PathSegment(go.PathSegment.Bezier,(oe-Qt)*nt,re*et,(oe-ie)*nt,(re+Qt)*et,(oe-Qt)*nt,(re+ie)*et).close());var ue=new go.PathFigure(0,et,!1);return ht.add(ue),ue.add(new go.PathSegment(go.PathSegment.Line,nt,et).close()),ht}),go.Shape.defineFigureGenerator("Warehouse",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0).close());var pt=new go.PathFigure(0,.2*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et).close());var vt=new go.PathFigure(.15*nt,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.5*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,et).close());var Ct=.05,bt=$t*.05,zt=.35,Qt=.775,ie=new go.PathFigure((zt-Ct)*nt,Qt*et,!0);return ht.add(ie),ie.add(new go.PathSegment(go.PathSegment.Bezier,zt*nt,(Qt-Ct)*et,(zt-Ct)*nt,(Qt-bt)*et,(zt-bt)*nt,(Qt-Ct)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(zt+Ct)*nt,Qt*et,(zt+bt)*nt,(Qt-Ct)*et,(zt+Ct)*nt,(Qt-bt)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,zt*nt,(Qt+Ct)*et,(zt+Ct)*nt,(Qt+bt)*et,(zt+bt)*nt,(Qt+Ct)*et)),ie.add(new go.PathSegment(go.PathSegment.Bezier,(zt-Ct)*nt,Qt*et,(zt-bt)*nt,(Qt+Ct)*et,(zt-Ct)*nt,(Qt+bt)*et).close()),ht}),go.Shape.defineFigureGenerator("ControlCenter",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Move,.1*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et).close()),ht}),go.Shape.defineFigureGenerator("Bluetooth",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.75*et,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.25*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Bookmark",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,0,0)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Globe",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.5*et,.75*nt,0,nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,nt,.75*et,.75*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.25*nt,et,0,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,0,.25*et,.25*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,et,.15*nt,.25*et,.15*nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.85*nt,.75*et,.85*nt,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.15*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.15*et,.35*nt,.3*et,.65*nt,.3*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.1675*nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8325*nt,.85*et,.35*nt,.7*et,.65*nt,.7*et)),ht}),go.Shape.defineFigureGenerator("Wave",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.25*et,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.25*et,.1*nt,0,.2*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.25*et,.425*nt,.5*et,.575*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.25*et,.8*nt,0,.9*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.25*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.75*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.75*et,.1*nt,.5*et,.2*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.7*nt,.75*et,.425*nt,et,.575*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.75*et,.8*nt,.5*et,.9*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Operator",function(Nt,nt,et){var ht=new go.Geometry,lt=.3,pt=$t*.3,vt=.5,Ct=.7,bt=new go.PathFigure((vt-lt)*nt,Ct*et,!0);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*nt,Ct*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*nt,Ct*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et));var zt=new go.PathFigure(0,.7*et,!1);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.7*et,0,0,nt,0)),ht}),go.Shape.defineFigureGenerator("TripleFanBlades",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.5*nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.65*nt,.3*et,.65*nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.35*nt,.5*et,.35*nt,.3*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,et,.3*nt,.6*et,.1*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.2*nt,et,.35*nt,.95*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.65*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,et,.7*nt,.6*et,.9*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.65*et,.8*nt,et,.65*nt,.95*et)),ht}),go.Shape.defineFigureGenerator("CentrifugalPump",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt,0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,0,.075*et,0,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.4*nt,et,0,et,.4*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.4*et,.8*nt,et,.85*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,0)),ht}),go.Shape.defineFigureGenerator("Battery",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Move,.4*nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.1*et));var pt=new go.PathFigure(0,.6*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,0,.4*et)),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.4*et)),ht}),go.Shape.defineFigureGenerator("Delete",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*.5,vt=.5,Ct=.5,bt=new go.PathFigure((vt-lt)*nt,Ct*et,!0);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*nt,Ct*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*nt,Ct*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et));var zt=new go.PathFigure(.15*nt,.5*et,!1);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.5*et)),ht}),go.Shape.defineFigureGenerator("Flag",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.1*et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Move,0,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.1*et,.15*nt,0,.35*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Bezier,nt,.1*et,.65*nt,.2*et,.85*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.5*et,.85*nt,.6*et,.65*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.5*et,.35*nt,.4*et,.15*nt,.4*et).close()),ht}),go.Shape.defineFigureGenerator("Help",function(Nt,nt,et){var ht=new go.Geometry,lt=.5,pt=$t*.5,vt=.5,Ct=.5,bt=new go.PathFigure((vt-lt)*nt,Ct*et,!1);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*nt,Ct*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),bt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*nt,Ct*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et).close()),lt=.05,pt=$t*.05,vt=.5,Ct=.8;var zt=new go.PathFigure((vt-lt)*nt,Ct*et,!1);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct-lt)*et,(vt-lt)*nt,(Ct-pt)*et,(vt-pt)*nt,(Ct-lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt+lt)*nt,Ct*et,(vt+pt)*nt,(Ct-lt)*et,(vt+lt)*nt,(Ct-pt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,vt*nt,(Ct+lt)*et,(vt+lt)*nt,(Ct+pt)*et,(vt+pt)*nt,(Ct+lt)*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,(vt-lt)*nt,Ct*et,(vt-pt)*nt,(Ct+lt)*et,(vt-lt)*nt,(Ct+pt)*et).close()),zt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.7*et)),zt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.5*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,.2*et,.75*nt,.475*et,.75*nt,.225*et)),zt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.35*et,.4*nt,.2*et,.3*nt,.25*et)),ht}),go.Shape.defineFigureGenerator("Location",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.5*nt,et,!0).add(new go.PathSegment(go.PathSegment.Line,.75*nt,.5*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5*nt,0,.975*nt,.025*et,.5*nt,0)).add(new go.PathSegment(go.PathSegment.Bezier,.25*nt,.5*et,.5*nt,0,.025*nt,.025*et).close()).add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)).add(new go.PathSegment(go.PathSegment.Arc,270,360,.5*nt,.3*et,.1*nt,.1*et).close()))}),go.Shape.defineFigureGenerator("Lock",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var pt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.3*et)),ht}),go.Shape.defineFigureGenerator("Unlocked",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.5*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.5*et));var pt=new go.PathFigure(.2*nt,.5*et,!1);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Move,.2*nt,.5*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.3*et)),pt.add(new go.PathSegment(go.PathSegment.Bezier,.8*nt,.3*et,.25*nt,0,.75*nt,0)),pt.add(new go.PathSegment(go.PathSegment.Line,.8*nt,.35*et)),ht}),go.Shape.defineFigureGenerator("Gear",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(.9375*nt,.56246875*et,!0).add(new go.PathSegment(go.PathSegment.Line,.9375*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Line,.80621875*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Bezier,.763*nt,.3316875*et,.79840625*nt,.39915625*et,.7834375*nt,.3635*et)).add(new go.PathSegment(go.PathSegment.Line,.8566875*nt,.23796875*et)).add(new go.PathSegment(go.PathSegment.Line,.76825*nt,.14959375*et)).add(new go.PathSegment(go.PathSegment.Line,.67596875*nt,.24184375*et)).add(new go.PathSegment(go.PathSegment.Bezier,.5625*nt,.19378125*et,.64228125*nt,.2188125*et,.603875*nt,.2021875*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.0625*et)).add(new go.PathSegment(go.PathSegment.Line,.4375*nt,.0625*et)).add(new go.PathSegment(go.PathSegment.Line,.4375*nt,.19378125*et)).add(new go.PathSegment(go.PathSegment.Bezier,.32775*nt,.239375*et,.39759375*nt,.20190625*et,.36053125*nt,.2176875*et)).add(new go.PathSegment(go.PathSegment.Line,.2379375*nt,.14959375*et)).add(new go.PathSegment(go.PathSegment.Line,.14953125*nt,.2379375*et)).add(new go.PathSegment(go.PathSegment.Line,.23934375*nt,.3278125*et)).add(new go.PathSegment(go.PathSegment.Bezier,.19378125*nt,.4375*et,.21765625*nt,.36059375*et,.201875*nt,.397625*et)).add(new go.PathSegment(go.PathSegment.Line,.0625*nt,.4375*et)).add(new go.PathSegment(go.PathSegment.Line,.0625*nt,.5625*et)).add(new go.PathSegment(go.PathSegment.Line,.1938125*nt,.5625*et)).add(new go.PathSegment(go.PathSegment.Bezier,.241875*nt,.67596875*et,.20221875*nt,.603875*et,.21884375*nt,.64228125*et)).add(new go.PathSegment(go.PathSegment.Line,.1495625*nt,.76825*et)).add(new go.PathSegment(go.PathSegment.Line,.238*nt,.8566875*et)).add(new go.PathSegment(go.PathSegment.Line,.3316875*nt,.76296875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.43753125*nt,.80621875*et,.36353125*nt,.78340625*et,.3991875*nt,.79840625*et)).add(new go.PathSegment(go.PathSegment.Line,.43753125*nt,.9375*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.9375*et)).add(new go.PathSegment(go.PathSegment.Line,.5625*nt,.80621875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.67225*nt,.760625*et,.602375*nt,.79809375*et,.63946875*nt,.78234375*et)).add(new go.PathSegment(go.PathSegment.Line,.76828125*nt,.8566875*et)).add(new go.PathSegment(go.PathSegment.Line,.85671875*nt,.76825*et)).add(new go.PathSegment(go.PathSegment.Line,.76065625*nt,.67221875*et)).add(new go.PathSegment(go.PathSegment.Bezier,.80621875*nt,.56246875*et,.78234375*nt,.63940625*et,.798125*nt,.602375*et)).add(new go.PathSegment(go.PathSegment.Line,.9375*nt,.56246875*et).close()).add(new go.PathSegment(go.PathSegment.Move,.5*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Arc,90,360,.5*nt,.5*et,.1*nt,.1*et).close()))}),go.Shape.defineFigureGenerator("Hand",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.5*et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Bezier,.1*nt,.3*et,0,.375*et,.05*nt,.325*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.45*nt,.075*et,.3*nt,.225*et,.4*nt,.175*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.525*nt,.075*et,.46*nt,.05*et,.525*nt,.05*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.3*nt,.4*et,.525*nt,.275*et,.475*nt,.325*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.55*et,nt,.4*et,nt,.55*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.425*nt,.55*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.55*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.6*nt,.7*et,.675*nt,.55*et,.675*nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.575*nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.575*nt,.85*et,.65*nt,.7*et,.65*nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.525*nt,.85*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.535*nt,et,.61*nt,.85*et,.61*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,0,.9*et,.435*nt,et,0,et).close()),ht}),go.Shape.defineFigureGenerator("Map",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,.2*et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et).close()),lt.add(new go.PathSegment(go.PathSegment.Move,.25*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.25*nt,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Move,.5*nt,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et)),lt.add(new go.PathSegment(go.PathSegment.Move,.75*nt,0)),lt.add(new go.PathSegment(go.PathSegment.Line,.75*nt,.8*et)),ht}),go.Shape.defineFigureGenerator("Eject",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et*.7)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*.7).close());var pt=new go.PathFigure(0,et*.6,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt,.6*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,0).close()),ht}),go.Shape.defineFigureGenerator("Pencil",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.1*et)).add(new go.PathSegment(go.PathSegment.Line,nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,et)).add(new go.PathSegment(go.PathSegment.Line,.1*nt,.2*et).close()))}),go.Shape.defineFigureGenerator("Building",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*1,et*1,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,.046*nt,et*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et*.3)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,(1-.046)*nt,et*.85)),lt.add(new go.PathSegment(go.PathSegment.Line,nt,et*.85).close());var pt=new go.PathFigure(.126*nt,.85*et,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,.126*nt,.45*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.45*et)),pt.add(new go.PathSegment(go.PathSegment.Line,.322*nt,.85*et).close());var vt=new go.PathFigure(.402*nt,.85*et,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,.402*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.45*et)),vt.add(new go.PathSegment(go.PathSegment.Line,.598*nt,.85*et).close());var Ct=new go.PathFigure(.678*nt,.85*et,!1);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,.678*nt,.45*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.45*et)),Ct.add(new go.PathSegment(go.PathSegment.Line,.874*nt,.85*et).close());var bt=new go.PathFigure(.5*nt,.1*et,!1);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,(.046+.15)*nt,.3*et)),bt.add(new go.PathSegment(go.PathSegment.Line,(1-(.046+.15))*nt,.3*et).close()),ht}),go.Shape.defineFigureGenerator("Staircase",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et*1,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.8)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.8)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.6)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.6)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.4)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.4)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.2)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.2)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.15)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.15)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.15,et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*.95).close()),ht}),go.Shape.defineFigureGenerator("5Bars",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,et*1,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.184,et*(1-.184)).close());var pt=new go.PathFigure(nt*.204,et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.204,et*(1-.184))),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*(1-.184*2))),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.388,et*1).close());var vt=new go.PathFigure(nt*.408,et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.408,et*(1-.184*2))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*(1-.184*3))),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.592,et*1).close());var Ct=new go.PathFigure(nt*.612,et,!0);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.612,et*(1-.184*3))),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*(1-.184*4))),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.796,et*1).close());var bt=new go.PathFigure(nt*.816,et,!0);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,nt*.816,et*(1-.184*4))),bt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-.184*5))),bt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1).close()),ht}),go.Shape.defineFigureGenerator("PC",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,0).close());var pt=new go.PathFigure(nt*.055,.07*et,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.07)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.1).close());var vt=new go.PathFigure(nt*.055,.13*et,!0);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.13)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.16)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.16).close());var Ct=new go.PathFigure(nt*.055,.18*et,!0);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.18)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.245,et*.21)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.055,et*.21).close());var bt=new go.PathFigure(nt*1,0,!0);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,0)),bt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.65)),bt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.65).close()),ht}),go.Shape.defineFigureGenerator("Plane",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(.55*nt,et,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.7*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.1*nt,.475*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.35*nt,.525*et,0,.4*et,.225*nt,.45*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.4*nt,.475*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.15*nt,.35*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.2*nt,.325*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.325*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.85*nt,.1*et)),lt.add(new go.PathSegment(go.PathSegment.Bezier,.9*nt,.2*et,.975*nt,0,nt,.08*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.7*nt,.45*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.6*nt,.95*et)),lt.add(new go.PathSegment(go.PathSegment.Line,.55*nt,et).close()),ht}),go.Shape.defineFigureGenerator("Key",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*1,et*.5,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.4*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.35*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.35*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.2*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.35*et)),lt.add(new go.PathSegment(go.PathSegment.Line,0,.65*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.15,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,.8*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,.65*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.65*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.65,.55*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,.55*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,.6*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.85,.575*et)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.9,.6*et).close()),lt.add(new go.PathSegment(go.PathSegment.Move,.17*nt,.425*et)),lt.add(new go.PathSegment(go.PathSegment.Arc,270,360,.17*nt,.5*et,.075*nt,.075*et).close()),ht}),go.Shape.defineFigureGenerator("FilmTape",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(0,0,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Arc,270,180,nt*0,nt*.3,nt*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,0,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.08,et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*1),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*2),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*3),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*4),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*5),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*6),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*7),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*8),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*9),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*10),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*11),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*12),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*13),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*14),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*.95)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(.08+.056*15),et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var pt=new go.PathFigure(0,0,!1);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*0)),pt.add(new go.PathSegment(go.PathSegment.Arc,270,-180,nt*1,nt*.3,nt*.055)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1));var vt=new go.PathFigure(nt*.11,et*.1,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.1)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*0),et*.8)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.11,et*.8).close());var Ct=new go.PathFigure(nt*(.11+.24133333*1+.028*1),et*.1,!1);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.1)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*1),et*.8)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*1+.028*1),et*.8).close());var bt=new go.PathFigure(nt*(.11+.24133333*2+.028*2),et*.1,!1);return ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.1)),bt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*3+.028*2),et*.8)),bt.add(new go.PathSegment(go.PathSegment.Line,nt*(.11+.24133333*2+.028*2),et*.8).close()),ht}),go.Shape.defineFigureGenerator("FloppyDisk",function(Nt,nt,et){var ht=new go.Geometry,lt=8,pt=lt*$t,vt=new go.PathFigure(lt,0,!1);ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.86,0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.14)),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-lt,et,nt,et-pt,nt-pt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,lt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-lt,pt,et,0,et-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,0,lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,lt,0,0,pt,pt,0).close());var Ct=new go.PathFigure(nt*.83,0,!1);ht.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.3)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.3)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*0).close());var bt=new go.PathFigure(nt*.83,et*1,!1);ht.add(bt),bt.add(new go.PathSegment(go.PathSegment.Line,nt*.83,et*.5)),bt.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*.5)),bt.add(new go.PathSegment(go.PathSegment.Line,nt*.17,et*1).close());var zt=new go.PathFigure(nt*.78,et*.05,!1);return ht.add(zt),zt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.05)),zt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.25)),zt.add(new go.PathSegment(go.PathSegment.Line,nt*.78,et*.25).close()),ht}),go.Shape.defineFigureGenerator("SpeechBubble",function(Nt,nt,et){var ht=Nt?Nt.parameter1:NaN;(isNaN(ht)||ht<0)&&(ht=15),ht=Math.min(ht,nt/3),ht=Math.min(ht,et/3);var lt=ht*$t,pt=et*.8,vt=new go.Geometry,Ct=new go.PathFigure(ht,0,!0);return vt.add(Ct),Ct.add(new go.PathSegment(go.PathSegment.Line,nt-ht,0)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,nt,ht,nt-lt,0,nt,lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt,pt-ht)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,nt-ht,pt,nt,pt-lt,nt-lt,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.7,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et)),Ct.add(new go.PathSegment(go.PathSegment.Line,nt*.55,pt)),Ct.add(new go.PathSegment(go.PathSegment.Line,ht,pt)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,0,pt-ht,lt,pt,0,pt-lt)),Ct.add(new go.PathSegment(go.PathSegment.Line,0,ht)),Ct.add(new go.PathSegment(go.PathSegment.Bezier,ht,0,0,lt,lt,0).close()),lt>1?(vt.spot1=new go.Spot(0,0,lt,lt),vt.spot2=new go.Spot(1,.8,-lt,-lt)):(vt.spot1=go.Spot.TopLeft,vt.spot2=new go.Spot(1,.8)),vt}),go.Shape.defineFigureGenerator("Repeat",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*0,et*.45,!0);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.2,et*.45).close());var pt=new go.PathFigure(nt*1,et*.55,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.55)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.1)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*.55).close()),ht}),go.Shape.defineFigureGenerator("Windows",function(Nt,nt,et){return new go.Geometry().add(new go.PathFigure(0,0,!0).add(new go.PathSegment(go.PathSegment.Line,nt,0)).add(new go.PathSegment(go.PathSegment.Line,nt,et)).add(new go.PathSegment(go.PathSegment.Line,0,et).close()).add(new go.PathSegment(go.PathSegment.Move,.4*nt,.4*et)).add(new go.PathSegment(go.PathSegment.Line,.4*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,.8*et)).add(new go.PathSegment(go.PathSegment.Line,.9*nt,.4*et).close()).add(new go.PathSegment(go.PathSegment.Move,.2*nt,.1*et)).add(new go.PathSegment(go.PathSegment.Line,.2*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.7*nt,.1*et).close()).add(new go.PathSegment(go.PathSegment.Move,.1*nt,.6*et)).add(new go.PathSegment(go.PathSegment.Line,.1*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.9*et)).add(new go.PathSegment(go.PathSegment.Line,.5*nt,.6*et).close()))}),go.Shape.defineFigureGenerator("Terminal",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*0,et*.1,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.9)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.9).close());var pt=new go.PathFigure(nt*.1,et*.2,!0);ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.25)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.22,et*.285)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.1,et*.37)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.32)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.275,et*.25).close());var vt=new go.PathFigure(nt*.28,et*.37,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.37)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.41)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.28,et*.41).close()),ht}),go.Shape.defineFigureGenerator("Beaker",function(Nt,nt,et){var ht=new go.Geometry,lt=15,pt=lt*$t,vt=new go.PathFigure(nt*.62,et*.475,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt,et-lt)),vt.add(new go.PathSegment(go.PathSegment.Bezier,nt-lt,et,nt,et-pt,nt-pt,et)),vt.add(new go.PathSegment(go.PathSegment.Line,lt,et)),vt.add(new go.PathSegment(go.PathSegment.Bezier,0,et-lt,pt,et,0,et-pt)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.475)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.38,et*.03)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*0)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.62,et*.03).close()),pt>1?(ht.spot1=new go.Spot(0,0,pt,pt),ht.spot2=new go.Spot(1,1,-pt,-pt)):(ht.spot1=go.Spot.TopLeft,ht.spot2=go.Spot.BottomRight),ht}),go.Shape.defineFigureGenerator("Download",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*0,et*1,!0);ht.add(lt);var pt=.1/.3;lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-pt)).close());var vt=new go.PathFigure(nt*.4,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.66)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.26),et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.44)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*0).close()),ht}),go.Shape.defineFigureGenerator("Bin",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*0,et*1,!0);ht.add(lt);var pt=.1/.3;return lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-pt)).close()),ht}),go.Shape.defineFigureGenerator("Upload",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*0,et*1,!0);ht.add(lt);var pt=.1/.3;lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.8,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.66,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.755,et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.93,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.64,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.61,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.39,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.36,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.07,et*(1-pt))),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.755),et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*.055)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.66),et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*(1-.8),et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*(1-pt)).close());var vt=new go.PathFigure(nt*.5,et*0,!0);return ht.add(vt),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.26,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.4,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.63)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.6,et*.25)),vt.add(new go.PathSegment(go.PathSegment.Line,nt*.74,et*.25).close()),ht}),go.Shape.defineFigureGenerator("EmptyDrink",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*.15,et*0,!1);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close()),ht}),go.Shape.defineFigureGenerator("Drink",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*.15,et*0,!1);ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.85,et*0)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.7,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.3,et*1).close());var pt=new go.PathFigure(nt*.235,et*.28,!0);return ht.add(pt),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.765,et*.28)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.655,et*.97)),pt.add(new go.PathSegment(go.PathSegment.Line,nt*.345,et*.97).close()),ht}),go.Shape.defineFigureGenerator("4Arrows",function(Nt,nt,et){var ht=new go.Geometry,lt=new go.PathFigure(nt*.5,et*0,!0);return ht.add(lt),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*1,et*.5)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.65)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.75,et*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.55,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.65,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.5,et*1)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.75)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.55)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.65)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*0,et*.5)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.35)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.25,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.45)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.45,et*.25)),lt.add(new go.PathSegment(go.PathSegment.Line,nt*.35,et*.25).close()),ht}),go.Shape.defineFigureGenerator("Connector","Ellipse"),go.Shape.defineFigureGenerator("Alternative","TriangleUp"),go.Shape.defineFigureGenerator("Merge","TriangleUp"),go.Shape.defineFigureGenerator("Decision","Diamond"),go.Shape.defineFigureGenerator("DataTransmissions","Hexagon"),go.Shape.defineFigureGenerator("Gate","Crescent"),go.Shape.defineFigureGenerator("Delay","HalfEllipse"),go.Shape.defineFigureGenerator("Input","Parallelogram1"),go.Shape.defineFigureGenerator("ManualLoop","ManualOperation"),go.Shape.defineFigureGenerator("ISOProcess","Chevron"),go.Shape.defineFigureGenerator("MessageToUser","SquareArrow"),go.Shape.defineFigureGenerator("MagneticData","Cylinder1"),go.Shape.defineFigureGenerator("DirectData","Cylinder4"),go.Shape.defineFigureGenerator("StoredData","DataStorage"),go.Shape.defineFigureGenerator("SequentialData","MagneticTape"),go.Shape.defineFigureGenerator("Subroutine","Procedure")},61016:function(module,exports,__webpack_require__){var __WEBPACK_AMD_DEFINE_ARRAY__,__WEBPACK_AMD_DEFINE_RESULT__;(function(){if(typeof window.GGBApplet=="function"){console.warn("deployggb.js was loaded twice");return}var isRenderGGBElementEnabled=!1,scriptLoadStarted=!1,html5AppletsToProcess=null,ggbHTML5LoadedCodebaseIsWebSimple=!1,ggbHTML5LoadedCodebaseVersion=null,ggbHTML5LoadedScript=null,GGBApplet=function(){"use strict";for(var on={},In="5.0",Jt={},It=null,ce=!1,Be=!1,qe=null,Se=!1,de=null,$t=null,He=0;He<arguments.length;He++){var ve=arguments[He];if(ve!==null)switch(typeof ve){case"number":In=ve.toFixed(1);break;case"string":ve.match(new RegExp("^[0-9]\\.[0-9]+$"))?In=ve:qe=ve;break;case"object":typeof ve.is3D!="undefined"?It=ve:Jt=ve;break;case"boolean":ce=ve,Be=!0;break}}It===null&&(It={is3D:!1,AV:!1,SV:!1,CV:!1,EV2:!1,CP:!1,PC:!1,DA:!1,FI:!1,PV:!1,macro:!1},Jt.material_id!==void 0&&!Be&&(ce=!0)),qe!==null&&Jt.id===void 0&&(Jt.id=qe);var Pe="",ze="",Me=!1,tn=null,Nt=null,nt=null,et=!1,ht=null,lt=null,pt=null,vt=null,Ct=null;Jt.height!==void 0&&(Jt.height=Math.round(Jt.height)),Jt.width!==void 0&&(Jt.width=Math.round(Jt.width));var bt=function(Ce){return parseFloat(Ce)>4?parseFloat(Ce):5};on.setHTML5Codebase=function(Ce,sn){$t=Ce,Kt(Ce,sn)},on.setJavaCodebase=on.setJavaCodebaseVersion=on.isCompiledInstalled=on.setPreCompiledScriptPath=on.setPreCompiledResourcePath=function(){},on.setHTML5CodebaseVersion=function(Ce,sn){var cn=parseFloat(Ce);if(cn!==NaN&&cn<5){console.log("The GeoGebra HTML5 codebase version "+cn+" is deprecated. Using version latest instead.");return}de=Ce,_t(Ce,sn)},on.getHTML5CodebaseVersion=function(){return Nt},on.getParameters=function(){return Jt},on.setFontsCSSURL=function(Ce){vt=Ce},on.setGiacJSURL=function(Ce){},on.setJNLPFile=function(Ce){Pe=Ce},on.setJNLPBaseDir=function(Ce){},on.inject=function(){function Ce(){return window.frameElement&&window.frameElement.getAttribute("data-singleton")}for(var sn="auto",cn=Jt.id,Jn,Sn=!1,he=0;he<arguments.length;he++){var Te=arguments[he];typeof Te=="string"?(Te=Te.toLowerCase(),Te.match(/^(prefer)?(java|html5|compiled|auto|screenshot)$/)?sn=Te:cn=arguments[he]):typeof Te=="boolean"?Sn=Te:Te instanceof HTMLElement&&(Jn=Te)}Nn();function Nn(){if(!Se){setTimeout(Nn,200);return}sn=di(sn);var Bn=Jn||document.getElementById(cn);if(!Bn){console.log("possibly bug on ajax loading? ");return}if(on.removeExistingApplet(Bn,!1),Jt.width===void 0&&Bn.clientWidth&&(Jt.width=Bn.clientWidth),Jt.height===void 0&&Bn.clientHeight&&(Jt.height=Bn.clientHeight),!(Jt.width&&Jt.height)&&sn==="html5"&&(delete Jt.width,delete Jt.height),tn=sn,sn==="screenshot")Ke(Bn,Jt);else{var Ht=!1;Jt.hasOwnProperty("playButton")&&Jt.playButton||Jt.hasOwnProperty("clickToLoad")&&Jt.clickToLoad?Ht=!0:Jt.hasOwnProperty("playButtonAutoDecide")&&Jt.playButtonAutoDecide&&(Ht=(!zt()||Ce())&&Qt()),Ht?(tn="screenshot",wn(Bn,Jt,Sn,sn)):ke(Bn,Jt,Sn)}}};function zt(){try{return window.self!==window.top}catch(Ce){return!0}}function Qt(){return Jt.hasOwnProperty("screenshotGenerator")&&Jt.screenshotGenerator?!1:Math.max(screen.width,screen.height)<800}on.getViews=function(){return It},on.isJavaInstalled=function(){return!1};var ie=function(Ce){var sn=function(he){var Te=JSON.parse(he),Nn=function(Mt){return Mt.type=="G"||Mt.type=="E"},Bn=Te.elements?Te.elements.filter(Nn)[0]:Te;if(!Bn||!Bn.url){cn();return}Jt.fileName=Bn.url,oe(Bn.settings||{}),It.is3D=!0;var Ht="https://www.geogebra.org/images/";on.setPreviewImage(ht||Bn.previewUrl,Ht+"GeoGebra_loading.png",Ht+"applet_play.png"),Ce()},cn=function(){Jt.onError&&Jt.onError(),pn("Error: Fetching material (id "+Jt.material_id+") failed.",Jt)},Jn=location.host.match(/(www|stage|beta|groot|alpha).geogebra.(org|net)/)?location.host:"www.geogebra.org",Sn="/materials/"+Jt.material_id+"?scope=basic";re("https://"+Jn+"/api/proxy.php?path="+encodeURIComponent(Sn),sn,cn)};function oe(Ce){var sn=["width","height","showToolBar","showMenuBar","showAlgebraInput","allowStyleBar","showResetIcon","enableLabelDrags","enableShiftDragZoom","enableRightClick","appName"];["enableLabelDrags","enableShiftDragZoom","enableRightClick"].forEach(function(cn){Ce[cn]=!!Ce[cn]}),sn.forEach(function(cn){Jt[cn]===void 0&&Ce[cn]!==void 0&&(Jt[cn]=Ce[cn])}),Jt.showToolBarHelp===void 0&&(Jt.showToolBarHelp=Jt.showToolBar)}function re(Ce,sn,cn){var Jn=new XMLHttpRequest;Jn.open("GET",Ce),Jn.onload=function(){sn(Jn.responseText)},Jn.onerror=cn,Jn.send()}on.isHTML5Installed=function(){return!0},on.getLoadedAppletType=function(){return tn},on.setPreviewImage=function(Ce,sn,cn){ht=Ce,lt=sn,pt=cn},on.removeExistingApplet=function(Ce,sn){var cn;typeof Ce=="string"&&(Ce=document.getElementById(Ce)),tn=null;var Jn=null;for(cn=0;cn<Ce.childNodes.length;cn++){var Sn=Ce.childNodes[cn],he=Sn.className;he==="applet_screenshot"?sn?(Sn.style.display="block",tn="screenshot"):Sn.style.display="none":he!=="applet_scaler prerender"&&(Ce.removeChild(Sn),Jn=he&&he.indexOf("appletParameters")!=-1?Sn.id:null,cn--)}var Te=Jt.id!==void 0?Jt.id:Jn,Nn=window[Te];Nn&&typeof Nn.getBase64=="function"&&(Nn.remove(),window[Te]=null)},on.refreshHitPoints=function(){if(bt(ggbHTML5LoadedCodebaseVersion)>=5)return!0;var Ce=on.getAppletObject();return Ce&&typeof Ce.recalculateEnvironments=="function"?(Ce.recalculateEnvironments(),!0):!1},on.startAnimation=function(){var Ce=on.getAppletObject();return Ce&&typeof Ce.startAnimation=="function"?(Ce.startAnimation(),!0):!1},on.stopAnimation=function(){var Ce=on.getAppletObject();return Ce&&typeof Ce.stopAnimation=="function"?(Ce.stopAnimation(),!0):!1},on.getAppletObject=function(){var Ce=Jt.id!==void 0?Jt.id:"ggbApplet";return window[Ce]},on.resize=function(){};var Ne=function(Ce,sn,cn){var Jn=document.createElement("param");Jn.setAttribute("name",sn),Jn.setAttribute("value",cn),Ce.appendChild(Jn)},ue=function(Ce){return Ce&&Ce!=="false"},ke=function(Ce,sn,cn){bt(Nt)<=4.2&&(cn=!0);var Jn=!isRenderGGBElementEnabled&&!scriptLoadStarted;(!isRenderGGBElementEnabled&&!scriptLoadStarted||ggbHTML5LoadedCodebaseVersion!==Nt||ggbHTML5LoadedCodebaseIsWebSimple&&!et)&&(Jn=!0,isRenderGGBElementEnabled=!1,scriptLoadStarted=!1);var Sn=document.createElement("div");Sn.classList.add("appletParameters","notranslate");var he=sn.width,Te=sn.height;if(sn.disableAutoScale=sn.disableAutoScale===void 0?GGBAppletUtils.isFlexibleWorksheetEditor():sn.disableAutoScale,sn.width!==void 0)if(bt(Nt)<=4.4)ue(sn.showToolBar)&&(sn.height-=7),ue(sn.showAlgebraInput)&&(sn.height-=37),sn.width<605&&ue(sn.showToolBar)&&(sn.width=605,he=605);else{var Nn=100;(ue(sn.showToolBar)||ue(sn.showMenuBar))&&(sn.hasOwnProperty("customToolBar")&&(sn.customToolbar=sn.customToolBar),Nn=ue(sn.showMenuBar)?245:155),he<Nn&&(sn.width=Nn,he=Nn)}Sn.style.border="none",Sn.style.display="inline-block";for(var Bn in sn)sn.hasOwnProperty(Bn)&&Bn!=="appletOnLoad"&&Sn.setAttribute("data-param-"+Bn,sn[Bn]);vt&&Sn.setAttribute("data-param-fontscssurl",vt),on.resize=function(){GGBAppletUtils.responsiveResize(Ce,sn)},window.addEventListener("resize",function(Mn){on.resize()});var Ht=typeof sn.appletOnLoad=="function"?sn.appletOnLoad:function(){};if(!cn&&sn.width!==void 0){sn.hasOwnProperty("showSplash")||Sn.setAttribute("data-param-showSplash","false");var Mt=Ce.querySelector(".applet_scaler.prerender"),wt=Mt!==null;if(wt)var At=Mt.querySelector(".ggb_preview");else{var At=$n(he,Te,sn.borderColor,!1);Mt=document.createElement("div"),Mt.className="applet_scaler",Mt.style.position="relative",Mt.style.display="block",Mt.style.width=he+"px",Mt.style.height=Te+"px"}window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Mt,"66%"),bt(Nt)>=5?(sn.appletOnLoad=function(Mn){var sr=Ce.querySelector(".ggb_preview");sr&&sr.parentNode.removeChild(sr),window.GGBT_spinner&&window.GGBT_spinner.removeSpinner(Mt),window.GGBT_wsf_view&&$(window).trigger("resize"),Ht(Mn)},wt||Mt.appendChild(At)):Sn.appendChild(At),Mt.appendChild(Sn),wt||Ce.appendChild(Mt),setTimeout(function(){on.resize()},1)}else{var Ut=document.createElement("div");Ut.className="applet_scaler",Ut.style.position="relative",Ut.style.display="block",Ut.appendChild(Sn),Ce.appendChild(Ut),sn.appletOnLoad=function(Mn){on.resize(),Ht(Mn)}}function Et(Mn,sr){sr&&typeof sr.appletOnLoad=="function"&&typeof renderGGBElement=="function"?renderGGBElement(Mn,sr.appletOnLoad):renderGGBElement(Mn),pn("GeoGebra HTML5 applet injected and rendered with previously loaded codebase.",sr)}function be(Mn,sr){typeof renderGGBElement=="undefined"?(html5AppletsToProcess===null&&(html5AppletsToProcess=[]),html5AppletsToProcess.push({article:Mn,params:sr}),window.renderGGBElementReady=function(){isRenderGGBElementEnabled=!0,html5AppletsToProcess!==null&&html5AppletsToProcess.length&&(html5AppletsToProcess.forEach(function(Yi){Et(Yi.article,Yi.params)}),html5AppletsToProcess=null)},bt(Nt)<5&&(Mn.className+=" geogebraweb")):Et(Mn,sr)}if(Jn){scriptLoadStarted=!0;for(var Dn=0;Dn<Sn.childNodes.length;Dn++){var zi=Sn.childNodes[Dn].tagName;zi==="TABLE"&&(Sn.removeChild(Sn.childNodes[Dn]),Dn--)}if(ggbHTML5LoadedScript!==null){var yi=document.querySelector('script[src="'+ggbHTML5LoadedScript+'"]');yi!=null&&yi.parentNode.removeChild(yi)}var ei=document.createElement("script"),Qi=function(){be(Sn,sn)};ei.src=ze+nt,ggbHTML5LoadedCodebaseIsWebSimple=et,ggbHTML5LoadedCodebaseVersion=Nt,ggbHTML5LoadedScript=ei.src,pn("GeoGebra HTML5 codebase loaded: '"+ze+"'.",sn),!$t&&(!de||de=="5.0")?(et?webSimple.succeeded=webSimple.succeeded||webSimple():web3d.succeeded=web3d.succeeded||web3d(),Qi()):ze.requirejs?__webpack_require__.e(12).then(function(){var Mn=[__webpack_require__(12)];Qi.apply(null,Mn)}.bind(this)).catch(__webpack_require__.oe):(ei.onload=Qi,Ce.appendChild(ei))}else be(Sn,sn);sn.height=Te,sn.width=he},Ke=function(Ce,sn,cn){var Jn=$n(sn.width,sn.height,sn.borderColor,cn),Sn=document.createElement("div");Sn.style.position="relative",Sn.style.display="block",Sn.style.width=sn.width+"px",Sn.style.height=sn.height+"px",Sn.className="applet_screenshot applet_scaler"+(cn?" applet_screenshot_play":""),Sn.appendChild(Jn);var he=GGBAppletUtils.getScale(sn,Ce,cn);cn?(Ce.appendChild(Rn()),window.GGBT_wsf_view||(Ce.style.position="relative")):window.GGBT_spinner&&window.GGBT_spinner.attachSpinner(Sn,"66%"),Ce.appendChild(Sn),he!==1&&!isNaN(he)&&(GGBAppletUtils.scaleElement(Sn,he),Sn.style.width=sn.width+"px",Sn.style.height=sn.height+"px",Sn.parentNode.style.width=sn.width*he+"px",Sn.parentNode.style.height=sn.height*he+"px"),on.resize=function(){Fe(Ce,Jn,Sn,cn)},window.addEventListener("resize",function(Te){on.resize()}),on.resize()};function Fe(Ce,sn,cn,Jn){if(Ce.contains(sn)){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(Ce.id!=="fullscreencontent")return;window.GGBT_wsf_view.setCloseBtnPosition(Ce)}var Sn=GGBAppletUtils.getScale(Jt,Ce,Jn);cn.parentNode!==null&&(!isNaN(Sn)&&Sn!==1?(GGBAppletUtils.scaleElement(cn,Sn),cn.parentNode.style.width=Jt.width*Sn+"px",cn.parentNode.style.height=Jt.height*Sn+"px"):(GGBAppletUtils.scaleElement(cn,1),cn.parentNode.style.width=Jt.width+"px",cn.parentNode.style.height=Jt.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&GGBAppletUtils.positionCenter(Ce),typeof window.GGBT_ws_header_footer=="object"&&window.GGBT_ws_header_footer.setWsScrollerHeight()}}on.onExitFullscreen=function(Ce,sn){sn.appendChild(Ce)};var wn=function(Ce,sn,cn,Jn){Ke(Ce,sn,!0);for(var Sn=function(){var Nn=[];for(Te=0;Te<Ce.childNodes.length;Te++)Nn.push(Ce.childNodes[Te]);if(window.GGBT_wsf_view){var Bn=window.GGBT_wsf_view.renderFullScreen(Ce,sn.id),Ht=document.getElementById("fullscreencontainer"),Mt=jQuery(Ce).find(".fullscreencontent");Mt.length>0?(Bn.remove(),Mt.attr("id","fullscreencontent").show(),jQuery(Ht).append(Mt),window.dispatchEvent(new Event("resize"))):ke(Bn,sn,!1),window.GGBT_wsf_view.launchFullScreen(Ht)}else tn=Jn,ke(Ce,sn,!1);if(!window.GGBT_wsf_view)for(Te=0;Te<Nn.length;Te++)Ce.removeChild(Nn[Te])},he=Ce.getElementsByClassName("ggb_preview_play"),Te=0;Te<he.length;Te++)he[Te].addEventListener("click",Sn,!1),he[Te].addEventListener("ontouchstart",Sn,!1);typeof window.ggbAppletPlayerOnload=="function"&&window.ggbAppletPlayerOnload(Ce),Qt()&&window.GGBT_wsf_view&&$(".wsf-element-fullscreen-button").remove()},Rn=function(){var Ce=document.createElement("div");if(Ce.className="ggb_preview_play icon-applet-play",!window.GGBT_wsf_view){var sn='.icon-applet-play { width: 100%; height: 100%;box-sizing: border-box;position: absolute;z-index: 1001;cursor: pointer;border-width: 0px; background-color: transparent;background-repeat: no-repeat;left: 0;top: 0;background-position: center center; background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet.png");}.icon-applet-play:hover {background-image: url("https://www.geogebra.org/images/worksheet/icon-start-applet-hover.png");}',cn=document.createElement("style");cn.styleSheet?cn.styleSheet.cssText=sn:cn.appendChild(document.createTextNode(sn)),document.getElementsByTagName("head")[0].appendChild(cn)}return Ce},$n=function(Ce,sn,cn,Jn){var Sn=document.createElement("div");Sn.className="ggb_preview",Sn.style.position="absolute",Sn.style.zIndex="90",Sn.style.width=Ce-2+"px",Sn.style.height=sn-2+"px",Sn.style.top="0px",Sn.style.left="0px",Sn.style.overflow="hidden",Sn.style.backgroundColor="white";var he="lightgrey";cn!==void 0&&(cn==="none"?he="transparent":he=cn),Sn.style.border="1px solid "+he;var Te=document.createElement("img");if(Te.style.position="relative",Te.style.zIndex="1000",Te.style.top="-1px",Te.style.left="-1px",ht!==null&&Te.setAttribute("src",ht),Te.style.opacity=.7,lt!==null){var Nn,Bn,Ht;if(!Jn){Nn=document.createElement("img"),Nn.style.position="absolute",Nn.style.zIndex="1001",Nn.style.opacity=1,Te.style.opacity=.3,Bn=360,Bn>Ce/4*3&&(Bn=Ce/4*3),Ht=Bn/5.8,Nn.setAttribute("src",lt),Nn.setAttribute("width",Bn),Nn.setAttribute("height",Ht);var Mt=(Ce-Bn)/2,wt=(sn-Ht)/2;Nn.style.left=Mt+"px",Nn.style.top=wt+"px",Sn.appendChild(Nn)}}return Sn.appendChild(Te),Sn},di=function(Ce){return Ce=Ce.toLowerCase(),Ce==="html5"||Ce==="screenshot"?Ce:"html5"},ee=["web","webSimple","web3d","tablet","tablet3d","phone"],_t=function(Ce,sn){if(Nt=Ce,sn){Kt(Nt,!0);return}var cn=!ce;if(cn){var Jn=bt(Nt);!isNaN(Jn)&&Jn<4.4&&(cn=!1)}var Sn,he;window.location.protocol.substr(0,4)==="http"?Sn=window.location.protocol:Sn="http:";var Te=Nt.indexOf("//");Te>0?he=Nt:Te===0?he=Sn+Nt:he="https://www.geogebra.org/apps/5.2.814.0/";for(var Nn in ee)if(Nt.slice(ee[Nn].length*-1)===ee[Nn]||Nt.slice((ee[Nn].length+1)*-1)===ee[Nn]+"/"){Kt(he,!1);return}!GGBAppletUtils.isFlexibleWorksheetEditor()&&cn&&!It.is3D&&!It.AV&&!It.SV&&!It.CV&&!It.EV2&&!It.CP&&!It.PC&&!It.DA&&!It.FI&&!It.PV&&!ue(Jt.showToolBar)&&!ue(Jt.showMenuBar)&&!ue(Jt.showAlgebraInput)&&!ue(Jt.enableRightClick)&&(!Jt.appName||Jt.appName=="classic")?he+="webSimple/":he+="web3d/",Kt(he,!1)},Kt=function(Ce,sn){if(Ce.requirejs){ze=Ce;return}Ce.slice(-1)!=="/"&&(Ce+="/"),ze=Ce,sn===null&&(sn=Ce.indexOf("http")===-1),Me=sn,nt="web.nocache.js",et=!1;var cn=ze.split("/");cn.length>1&&(!sn&&cn[cn.length-2]==="webSimple"?(nt="webSimple.nocache.js",et=!0):ee.indexOf(cn[cn.length-2])>=0&&(nt=cn[cn.length-2]+".nocache.js")),cn=Ce.split("/"),Nt=cn[cn.length-3],Nt.substr(0,4)==="test"?Nt=Nt.substr(4,1)+"."+Nt.substr(5,1):(Nt.substr(0,3)==="war"||Nt.substr(0,4)==="beta")&&(Nt="5.0");var Jn=parseFloat(Nt);Jn!==NaN&&Jn<5&&Ce.indexOf("geogebra.org")>=0&&(console.log("The GeoGebra HTML5 codebase version "+Jn+" is deprecated. Using version latest instead."),_t("5.0",sn))},pn=function(Ce,sn){window.console&&window.console.log&&(!sn||typeof sn.showLogging=="undefined"||sn.showLogging&&sn.showLogging!=="false")&&console.log(Ce)};Jt.material_id!==void 0?ie(Ln):Ln();function Ln(){var Ce=In;de!==null?Ce=de:parseFloat(Ce)<5&&(Ce="5.0"),_t(Ce,!1),$t!==null&&Kt($t,Me),Se=!0}return on},GGBAppletUtils=function(){"use strict";function on(){return window.GGBT_wsf_edit!==void 0}function In(Se,de){de!=1?(Se.style.transformOrigin="0% 0% 0px",Se.style.webkitTransformOrigin="0% 0% 0px",Se.style.transform="scale("+de+","+de+")",Se.style.webkitTransform="scale("+de+","+de+")",Se.style.maxWidth="initial",Se.querySelector(".ggb_preview")!==null&&(Se.querySelector(".ggb_preview").style.maxWidth="initial"),Se.querySelectorAll(".ggb_preview img")[0]!==void 0&&(Se.querySelectorAll(".ggb_preview img")[0].style.maxWidth="initial"),Se.querySelectorAll(".ggb_preview img")[1]!==void 0&&(Se.querySelectorAll(".ggb_preview img")[1].style.maxWidth="initial")):(Se.style.transform="none",Se.style.webkitTransform="none")}function Jt(Se,de,$t,He,ve,Pe){var ze=null;if(Pe!=null&&Pe!="")for(var Me=Se.parentNode;Me!=null;)if((" "+Me.className+" ").indexOf(" "+Pe+" ")>-1){ze=Me;break}else Me=Me.parentNode;var tn=0,Nt=0,nt=0,et=0,ht=0,lt=0,pt=0;if(ze)tn=ze.offsetWidth,Nt=Math.max(He?ze.offsetWidth:0,ze.offsetHeight);else{if(window.innerWidth&&document.documentElement.clientWidth?(tn=Math.min(window.innerWidth,document.documentElement.clientWidth),Nt=Math.min(window.innerHeight,document.documentElement.clientHeight),nt=tn):(tn=window.innerWidth,Nt=window.innerHeight,nt=window.innerWidth),Se){var vt=Se.getBoundingClientRect();vt.left>0&&vt.left<=tn&&(ve===void 0||!ve)&&(document.dir==="rtl"?(ht=tn-vt.width-vt.left,lt=nt<=480?10:30):(lt=vt.left,ht=nt<=480?10:30),et=lt+ht)}if(Se&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){var Ct=Se.getBoundingClientRect();window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(et=40,pt=0):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(et=0,pt=40)}}return Se&&(($t===void 0||!$t)&&de>0&&de+et<tn?tn=de:tn-=et,typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&($t===void 0||!$t)&&(Nt-=pt)),{width:tn,height:Nt}}function It(Se,de,$t,He,ve){if(Se.isScreenshoGenerator)return 1;var Pe=He!==void 0&&He,ze=Se.noScaleMargin!=null&&Se.noScaleMargin,Me=function(Ct){return Ct&&Ct!=="false"},tn=Me(Se.autoHeight),Nt=Jt(de,Se.width,$t,tn,Pe&&window.GGBT_wsf_view||ze,ve),nt=parseInt(Nt.width),et=Se.width,ht=Se.height;if(et===void 0){var lt=de.querySelector(".appletParameters");lt&&(et=lt.offsetWidth,ht=lt.offsetHeight)}var pt=nt/et,vt=Pe?1:Nt.height/ht;return $t!==void 0&&!$t&&(pt=Math.min(1,pt),vt=Math.min(1,vt)),Math.min(pt,vt)}function ce(Se,de,$t){var He=1,ve,Pe=!1;if(Se.hasOwnProperty("allowUpscale")&&(Pe=Se.allowUpscale),Se.hasOwnProperty("scale")&&(He=parseFloat(Se.scale),(isNaN(He)||He===null||He===0)&&(He=1),He>1&&(Pe=!0)),de&&typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&(Pe=!0),!(Se.hasOwnProperty("disableAutoScale")&&Se.disableAutoScale))ve=It(Se,de,Pe,$t,Se.scaleContainerClass);else return He;return Pe&&(!Se.hasOwnProperty("scale")||He===1)?ve:Math.min(He,ve)}function Be(Se){var de=Math.min(window.innerWidth,document.documentElement.clientWidth),$t=Math.min(window.innerHeight,document.documentElement.clientHeight),He=Se.getBoundingClientRect(),ve=(de-He.width)/2,Pe=($t-He.height)/2;Pe<0&&(Pe=0),Se.style.position="relative",window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionRight"?(ve<40?Se.style.left="40px":Se.style.left=ve+"px",Se.style.top=Pe+"px"):window.GGBT_wsf_view.getCloseBtnPosition()==="closePositionTop"&&(Pe<40?Se.style.top="40px":Se.style.top=Pe+"px",Se.style.left=ve+"px")}function qe(Se,de){var $t=Se.querySelector(".appletParameters");if($t){if(typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()){if(de.id!==$t.getAttribute("data-param-id"))return;window.GGBT_wsf_view.setCloseBtnPosition(Se)}if($t.parentElement&&/fullscreen/.test($t.parentElement.className))return;var He=ce(de,Se);on()&&$t.setAttribute("data-param-scale",He);for(var ve=null,Pe=0;Pe<Se.childNodes.length;Pe++)if(Se.childNodes[Pe].className!==void 0&&Se.childNodes[Pe].className.match(/^applet_scaler/)){ve=Se.childNodes[Pe];break}if(ve!==null&&ve.querySelector(".noscale")!==null)return;var ze=de.id!==void 0?de.id:"ggbApplet",Me=window[ze];(Me==null||!Me.recalculateEnvironments)&&ve!==null&&!ve.className.match(/fullscreen/)&&(ve.parentNode.style.transform="",!isNaN(He)&&He!==1?(ve.parentNode.style.width=de.width*He+"px",ve.parentNode.style.height=de.height*He+"px",In(ve,He)):(In(ve,1),ve.parentNode.style.width=de.width+"px",ve.parentNode.style.height=de.height+"px")),typeof window.GGBT_wsf_view=="object"&&window.GGBT_wsf_view.isFullscreen()&&Be(Se),window.GGBT_wsf_view&&!window.GGBT_wsf_view.isFullscreen()&&window.GGBT_wsf_general.adjustContentToResize($($t).parents(".content-added-content"))}}return{responsiveResize:qe,isFlexibleWorksheetEditor:on,positionCenter:Be,getScale:ce,scaleElement:In}}();__WEBPACK_AMD_DEFINE_ARRAY__=[],__WEBPACK_AMD_DEFINE_RESULT__=function(){return GGBApplet}.apply(exports,__WEBPACK_AMD_DEFINE_ARRAY__),__WEBPACK_AMD_DEFINE_RESULT__!==void 0&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__),GGBAppletUtils.makeModule=function(name,permutation){function webModule(){var H="bootstrap",I="begin",J="gwt.codesvr."+name+"=",K="gwt.codesvr=",L=name,M="startup",N="DUMMY",O=0,P=1,Q="iframe",R="position:absolute; width:0; height:0; border:none; left: -1000px;",S=" top: -1000px;",T="Chrome",U="CSS1Compat",V="<!doctype html>",W="",X="<html><head></head><body></body></html>",Y="undefined",Z="readystatechange",$=10,_="script",ab="javascript",bb="Failed to load ",cb="moduleStartup",db="scriptTagAdded",eb="moduleRequested",fb="meta",gb="name",hb=name+"::",ib="::",jb="gwt:property",kb="content",lb="=",mb="gwt:onPropertyErrorFn",nb='Bad handler "',ob='" for "gwt:onPropertyErrorFn"',pb="gwt:onLoadErrorFn",qb='" for "gwt:onLoadErrorFn"',rb="#",sb="?",tb="/",ub="img",vb="clear.cache.gif",wb="baseUrl",xb=name+".nocache.js",yb="base",zb="//",Ab="selectingPermutation",Bb=name+".devmode.js",Cb=permutation,Db=":",Eb=".cache.js",Fb="loadExternalRefs",Gb="end",n=window,o=document;function p(){var on=n.location.search;return on.indexOf(J)!=-1||on.indexOf(K)!=-1}function q(on,In){}webModule.__sendStats=q,webModule.__moduleName=L,webModule.__errFn=null,webModule.__moduleBase=N,webModule.__softPermutationId=O,webModule.__computePropValue=null,webModule.__getPropMap=null,webModule.__installRunAsyncCode=function(){},webModule.__gwtStartLoadingFragment=function(){return null},webModule.__gwt_isKnownPropertyValue=function(){return!1},webModule.__gwt_getMetaProperty=function(){return null};var r=null,s=n.__gwt_activeModules=n.__gwt_activeModules||{};s[L]={moduleName:L},webModule.__moduleStartupDone=function(on){var In=s[L].bindings;s[L].bindings=function(){for(var Jt=In?In():{},It=on[webModule.__softPermutationId],ce=O;ce<It.length;ce++){var Be=It[ce];Jt[Be[O]]=Be[P]}return Jt}};var t;function u(){return v(),t}function v(){if(!t){var on=o.createElement(Q);if(on.id=L,on.style.cssText=R+S,on.tabIndex=-1,o.body.appendChild(on),t=on.contentWindow.document,navigator.userAgent.indexOf(T)==-1){t.open();var In=document.compatMode==U?V:W;t.write(In+X),t.close()}}}function w(on){function In(It){function ce(){return typeof o.readyState==Y?typeof o.body!=Y&&o.body!=null:/loaded|complete/.test(o.readyState)}var Be=ce();if(Be){It();return}function qe(){if(!Be){if(!ce())return;Be=!0,It(),o.removeEventListener&&o.removeEventListener(Z,qe,!1),Se&&clearInterval(Se)}}o.addEventListener&&o.addEventListener(Z,qe,!1);var Se=setInterval(function(){qe()},$)}function Jt(It){var ce=u(),Be=ce.body,qe=ce.createElement(_);qe.language=ab,qe.crossOrigin=W,qe.src=It,webModule.__errFn&&(qe.onerror=function(){webModule.__errFn(L,new Error(bb+It))}),Be.appendChild(qe)}In(function(){Jt(on)})}webModule.__startLoadingFragment=function(on){return C(on)},webModule.__installRunAsyncCode=function(on){var In=u(),Jt=In.body,It=In.createElement(_);It.language=ab,It.text=on,Jt.appendChild(It),Jt.removeChild(It)};function A(){for(var c={},d,e,f=o.getElementsByTagName(fb),g=O,h=f.length;g<h;++g){var i=f[g],j=i.getAttribute(gb),k;if(j){if(j=j.replace(hb,W),j.indexOf(ib)>=O)continue;if(j==jb){if(k=i.getAttribute(kb),k){var l,m=k.indexOf(lb);m>=O?(j=k.substring(O,m),l=k.substring(m+P)):(j=k,l=W),c[j]=l}}else if(j==mb){if(k=i.getAttribute(kb),k)try{d=eval(k)}catch(on){alert(nb+k+ob)}}else if(j==pb&&(k=i.getAttribute(kb),k))try{e=eval(k)}catch(on){alert(nb+k+qb)}}}__gwt_getMetaProperty=function(on){var In=c[on];return In==null?null:In},r=d,webModule.__errFn=e}function B(){function on(Se){var de=Se.lastIndexOf(rb);de==-1&&(de=Se.length);var $t=Se.indexOf(sb);$t==-1&&($t=Se.length);var He=Se.lastIndexOf(tb,Math.min($t,de));return He>=O?Se.substring(O,He+P):W}function In(Se){if(!Se.match(/^\w+:\/\//)){var de=o.createElement(ub);de.src=Se+vb,Se=on(de.src)}return Se}function Jt(){var Se=__gwt_getMetaProperty(wb);return Se!=null?Se:W}function It(){for(var Se=o.getElementsByTagName(_),de=O;de<Se.length;++de)if(Se[de].src.indexOf(xb)!=-1)return on(Se[de].src);return W}function ce(){var Se=o.getElementsByTagName(yb);return Se.length>O?Se[Se.length-P].href:W}function Be(){var Se=o.location;return Se.href==Se.protocol+zb+Se.host+Se.pathname+Se.search+Se.hash}var qe=Jt();return qe==W&&(qe=It()),qe==W&&(qe=ce()),qe==W&&Be()&&(qe=on(o.location.href)),qe=In(qe),qe}function C(on){return on.match(/^\//)||on.match(/^[a-zA-Z]+:\/\//)?on:webModule.__moduleBase+on}function D(){var on=[],In=O,Jt=[],It=[];function ce(Se){var de=It[Se](),$t=Jt[Se];if(de in $t)return de;var He=[];for(var ve in $t)He[$t[ve]]=ve;throw r&&r(Se,He,de),null}if(__gwt_isKnownPropertyValue=function(Se,de){return de in Jt[Se]},webModule.__getPropMap=function(){var Se={};for(var de in Jt)Jt.hasOwnProperty(de)&&(Se[de]=ce(de));return Se},webModule.__computePropValue=ce,n.__gwt_activeModules[L].bindings=webModule.__getPropMap,p())return C(Bb);var Be;try{Be=Cb;var qe=Be.indexOf(Db);qe!=-1&&(In=parseInt(Be.substring(qe+P),$),Be=Be.substring(O,qe))}catch(Se){}return webModule.__softPermutationId=In,C(Be+Eb)}function F(){n.__gwt_stylesLoaded||(n.__gwt_stylesLoaded={})}A(),webModule.__moduleBase="/js/mathematicalGraphics/"+name+"/",s[L].moduleBase=webModule.__moduleBase;var G=D();return F(),w(G),!0}return webModule},typeof window.web3d!="function"&&(window.web3d=GGBAppletUtils.makeModule("web3d","A18F540516513B1292CA7CEF2F6AFC7E")),typeof window.webSimple!="function"&&(window.webSimple=GGBAppletUtils.makeModule("webSimple","96B09BF1B436BF53F0DF54116700F16A")),window.GGBApplet=GGBApplet})()},15476:function(on,In,Jt){"use strict";Jt.d(In,{Ax:function(){return qe},Ds:function(){return Se},KI:function(){return $t},SI:function(){return Be},f1:function(){return ce}});var It=Jt(11320);function ce(He){let ve=!0;if(He.length>0){for(let Pe=0;Pe<He.length;Pe++)if(He[Pe].compile_success==0||!He[Pe].compile_success){ve=!1;break}}else ve=!1;return ve}function Be(He,ve=""){let Pe=[];for(let ze=0;ze<He.length;ze++){let Me=He[ze],tn=ve?`${ve}/${Me.name}`:`${Me.name}`;Pe.push({title:Me.name,type:Me.type,isLeaf:Me.type!=="tree",key:tn})}return Pe}function qe(He,ve,Pe){for(let ze=0;ze<He.length;ze++){let Me=He[ze];if(Me.key===ve){Me.children=Pe;break}Me.children&&qe(Me.children,ve,Pe)}return He}function Se(He,ve,Pe){let ze;return function(){let Me=this,tn=arguments,Nt=function(){ze=null,Pe||He.apply(Me,tn)},nt=Pe&&!ze;clearTimeout(ze),ze=setTimeout(Nt,ve),nt&&He.apply(Me,tn)}}const de=!0,$t=It.Z.API_SERVER},63205:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return ze}});var It=Jt(67294),ce={imageDimensions:"imageDimensions___a7crR",img:"img___Kroat",fullWidth:"fullWidth___c492T"},Be=Jt(94184),qe=Jt.n(Be),Se=Jt(74330),de=Jt(15979),$t=Jt(33170),He=Jt(28706),ve=(Me,tn,Nt)=>new Promise((nt,et)=>{var ht=vt=>{try{pt(Nt.next(vt))}catch(Ct){et(Ct)}},lt=vt=>{try{pt(Nt.throw(vt))}catch(Ct){et(Ct)}},pt=vt=>vt.done?nt(vt.value):Promise.resolve(vt.value).then(ht,lt);pt((Nt=Nt.apply(Me,tn)).next())}),ze=({data:Me,className:tn,fullWidth:Nt,style:nt={},onClose:et,onOk:ht,showFullTools:lt,noAssociationId:pt})=>{const vt=(0,It.useRef)(null),Ct=(0,It.useRef)(null),bt=(0,It.useRef)(null),zt=(0,It.useRef)(null),[Qt,ie]=(0,It.useState)(!1),[oe,re]=(0,It.useState)("\u6B63\u5728\u52A0\u8F7D\u4E2D");(0,It.useEffect)(()=>(bt.current||(bt.current=document.createElement("style"),document.head.appendChild(bt.current)),Me!=null&&Me.visible?(document.body.setAttribute("data-custom","y-hidden"),bt.current.innerHTML=" html { overflow-y: hidden; }",Me!=null&&Me.src&&Ne()):(document.body.removeAttribute("data-custom"),bt.current&&(document.head.removeChild(bt.current),bt.current=null)),()=>{document.body.removeAttribute("data-custom"),bt.current&&(document.head.removeChild(bt.current),bt.current=null)}),[Me==null?void 0:Me.visible]);const Ne=()=>ve(void 0,null,function*(){ie(!0),re("\u6B63\u5728\u52A0\u8F7D\u4E2D");const Fe=yield(0,He.ZJ)(Me==null?void 0:Me.src);vt.current.src="",vt.current.src=Fe,vt.current.onload=function(){Ke()},ie(!1),re("")}),ue=Fe=>ve(void 0,null,function*(){ie(!0),re("\u6B63\u5728\u4FDD\u5B58\u4E2D");const wn=yield(0,$t.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Me.title,file:Fe.dataUrl}});wn!=null&&wn.id&&!pt?(yield(0,$t.ZP)(`/api/attachments/${Me.id}/add_subitem.json`,{method:"post",body:{subitem_id:wn==null?void 0:wn.id,settings:JSON.stringify(Fe.state)}})).status===0&&ht():wn!=null&&wn.id&&ht(wn),ie(!1),re("")}),ke=()=>{const Fe=document.querySelector('a[href="https://markerjs.com/"]');Fe&&Fe.parentNode&&(Fe.parentNode.style.display="none"),[{name:'[data-action="select"]',title:"\u9009\u62E9"},{name:'[data-action="delete"]',title:"\u5220\u9664\u5143\u7D20"},{name:'[data-action="undo"]',title:"\u64A4\u9500"},{name:'[data-type-name="FrameMarker"]',title:"\u77E9\u5F62"},{name:'[data-type-name="FreehandMarker"]',title:"\u753B\u7EBF"},{name:'[data-type-name="ArrowMarker"]',title:"\u7BAD\u5934"},{name:'[data-type-name="TextMarker"]',title:"\u6587\u672C"},{name:'[data-type-name="EllipseMarker"]',title:"\u692D\u5706"},{name:'[data-type-name="HighlightMarker"]',title:"\u65B9\u5757"},{name:'[data-type-name="CalloutMarker"]',title:"\u6CE8\u91CA"},{name:'[data-action="render"]',title:"\u4FDD\u5B58"},{name:'[data-action="close"]',title:"\u9000\u51FA"}].forEach(Rn=>{const $n=document.querySelector(Rn.name);$n&&$n.setAttribute("title",Rn.title)})},Ke=()=>{Ct.current=new de.hP(vt.current),Ct.current.targetRoot=zt.current,Ct.current.addEventListener("render",ue),Ct.current.addEventListener("beforeclose",et),lt&&(Ct.current.availableMarkerTypes=Ct.current.ALL_MARKER_TYPES,Ct.current.uiStyleSettings.redoButtonVisible=!0,Ct.current.uiStyleSettings.notesButtonVisible=!0,Ct.current.uiStyleSettings.zoomButtonVisible=!0,Ct.current.uiStyleSettings.zoomOutButtonVisible=!0,Ct.current.uiStyleSettings.clearButtonVisible=!0),window.markerArea=Ct.current.uiStyleSettings,Ct.current.show(),Me!=null&&Me.snapshotData&&Ct.current.restoreState(Me.snapshotData),setTimeout(()=>{window.scrollTo(0,0),ke()},300)};return It.createElement(It.Fragment,null,(Me==null?void 0:Me.visible)&&It.createElement(Se.Z,{spinning:Qt,tip:oe,style:{position:"absolute",width:"100vw"}},It.createElement("div",{ref:zt,className:qe()(ce.imageDimensions,tn,Nt?ce.fullWidth:""),style:nt},It.createElement("img",{className:ce.img,ref:vt}))))}},36527:function(on,In,Jt){"use strict";var It=Jt(67294),ce=Jt(71230),Be=Jt(15746),qe=Jt(55238),Se=Jt(85804),de=Jt(65226),$t=Jt(71736),He=Jt(84279),ve=Jt(67294);const Pe=(0,It.forwardRef)(({callback:ze,showSaveButton:Me,value:tn=""},Nt)=>{const nt=(0,It.useRef)(),et=[{name:"\u5206\u6570\u5F97\u5206",value:"\\frac{x}{y}",children:[{name:"\u5206\u6570 Fractions",data:[{value:"\\frac{a}{b}"},{value:"x\\tfrac{x}{a} "},{value:"\\mathrm{d}t"},{value:"\\partial t"},{value:"\\frac{\\partial y}{\\partial x}"},{value:"\\nabla\\psi"},{value:"\\frac{\\partial^2}{\\partial x_1\\partial x_2}y"},{value:"\\cfrac{1}{a + \\cfrac{7}{b + \\cfrac{2}{9}}} = c"}]},{name:"\u5BFC\u6570 Derivative",data:[{value:"\\dot{a} "},{value:"\\ddot{a}"},{value:"{f}^{\\prime}"},{value:"{f}^{\\prime\\prime}"},{value:"{f}^{(n)}"}]},{name:"\u6A21\u7B97\u672F Modular arithmetic",data:[{value:"a \\bmod b"},{value:"a \\equiv b \\pmod{m} "},{value:"\\gcd(m, n) "},{value:"\\operatorname{lcm}(m, n) "}]}]},{name:"\u6839\u5F0F\u89D2\u6807",value:"\\sqrt{x}",children:[{name:"\u6839\u5F0F Radicals",data:[{value:"\\sqrt{x}"},{value:"\\sqrt[y]{x}"}]},{name:"\u4E0A\u4E0B\u6807 Sub&Super",data:[{value:"x^{a}"},{value:"x_{a}"},{value:"x_{a}^{b} "},{value:"_{a}^{b} x"},{value:"x_{a}^{b} "}]},{name:"\u91CD\u97F3\u7B26\u53CA\u5176\u4ED6 Accents and Others",data:[{value:"\\hat{a} "},{value:"\\sqrt[y]{x}"},{value:"\\check{} "},{value:"\\grave{a} "},{value:"\\acute{a}"},{value:"\\tilde{a}"},{value:"\\breve{a}"},{value:"\\bar{a}"},{value:"\\vec{a}"},{value:"\\not{a}"},{value:"\\widetilde{abc}"},{value:"\\widehat{abc}"},{value:"\\overleftarrow{abc} "},{value:"\\overrightarrow{abc}"},{value:"\\overline{abc}"},{value:"\\underline{abc}"},{value:"\\overbrace{abc}"},{value:"\\underbrace{abc}"},{value:"\\overset{a}{abc}"},{value:"\\underset{a}{abc} \\stackrel\\frown{ab}"},{value:"\\overline{ab} "},{value:"\\overleftrightarrow{ab}"},{value:"\\overset{a}{\\leftarrow}"},{value:"\\overset{a}{\\rightarrow}"},{value:"\\xleftarrow[abc]{a}"},{value:"\\xrightarrow[abc]{a} "}]}]},{name:"\u6781\u9650\u5BF9\u6570",value:"\\lim_{x \\to 0}",children:[{name:"\u6781\u9650 Limits",data:[{value:"\\lim a"},{value:"\\lim_{x \\to 0}"},{value:"\\lim_{x \\to \\infty}"},{value:"\\max_b{a}"},{value:"\\min_a{b}"}]},{name:"\u5BF9\u6570\u6307\u6570 Logarithms and exponentials",data:[{value:"\\log_{a}{b}"},{value:"\\lg_{a}{b}"},{value:"\\ln_{a}{b}"},{value:"\\exp a"}]},{name:"\u754C\u9650 Bounds",data:[{value:"\\min x"},{value:"\\sup t"},{value:"\\inf s"},{value:"\\lim u"},{value:"\\limsup w"},{value:"\\dim p"},{value:"\\ker\\phi "}]}]},{name:"\u4E09\u89D2\u51FD\u6570",value:"\\sin a",children:[{name:"\u4E09\u89D2\u51FD\u6570 Trigonometric functions",data:[{value:"\\sin a"},{value:"\\cos a"},{value:"\\tan a"},{value:"\\cot a "},{value:"\\sec a "},{value:"\\csc a "}]},{name:"\u53CD\u4E09\u89D2\u51FD\u6570 Inverse trigonometric functions",data:[{value:"\\sin^{-1}"},{value:"\\cos^{-1}"},{value:"\\tan^{-1}"},{value:"\\cot^{-1}"},{value:"\\sec^{-1}"},{value:"\\csc^{-1}"},{value:"\\arcsin a"},{value:"\\arccos a"},{value:"\\arctan a"},{value:"\\operatorname{arccot} a"},{value:"\\operatorname{arcsec} a"},{value:"\\operatorname{arccsc} a"}]},{name:"\u53CC\u66F2\u51FD\u6570 Hyperblic functions",data:[{value:"\\sinh a"},{value:"\\cosh a"},{value:"\\tanh a"},{value:"\\coth a"},{value:"\\operatorname{sech} a"},{value:"\\operatorname{csch} a"}]},{name:"\u53CD\u53CC\u66F2\u51FD\u6570 Inverse hyperbolic functions",data:[{value:"\\sinh^{-1}"},{value:"a\\cosh^{-1} a"},{value:"\\tanh^{-1} a"},{value:"\\coth^{-1} a"},{value:"\\operatorname{sech}^{-1} a"},{value:"\\operatorname{csch}^{-1} a"}]}]},{name:"\u79EF\u5206\u8FD0\u7B97",value:"\\int_{a}^{b}",children:[{name:"\u79EF\u5206 Integral",data:[{value:"\\int"},{value:"\\int_{a}^{b}"},{value:"\\int\\limits_{a}^{b}"}]},{name:"\u53CC\u91CD\u79EF\u5206 Double integral",data:[{value:"\\iint"},{value:"\\iint_{a}^{b} "},{value:"\\iint\\limits_{a}^{b} "}]},{name:"\u4E09\u91CD\u79EF\u5206 Triple integral",data:[{value:"\\iiint"},{value:"\\iiint_{a}^{b}"},{value:"\\iiint\\limits_{a}^{b} "}]},{name:"\u66F2\u7EBF\u79EF\u5206 Closed line or path integral",data:[{value:"\\oint"},{value:"\\oint_{a}^{b} "}]}]},{name:"\u5927\u578B\u8FD0\u7B97",value:"\\sum_{a}^{b}",children:[{name:"\u6C42\u548C Summation",data:[{value:"\\sum"},{value:"\\sum_{a}^{b}"},{value:"{\\textstyle \\sum_{a}^{b}} "}]},{name:"\u4E58\u79EF\u4F59\u79EF Product and coproduct",data:[{value:"\\prod"},{value:"\\prod_{a}^{b}"},{value:"{\\textstyle \\prod_{a}^{b}}"},{value:"\\coprod"},{value:"\\coprod_{a}^{b}"},{value:"{\\textstyle \\coprod_{a}^{b}} "}]},{name:"\u5E76\u96C6\u4EA4\u96C6 Union and intersection",data:[{value:"\\bigcup"},{value:"\\bigcup_{a}^{b}"},{value:"{\\textstyle \\bigcup_{a}^{b}}"},{value:"\\bigcap"},{value:"\\bigcap_{a}^{b}"}]},{name:"\u6790\u53D6\u5408\u53D6 Disjunction and conjunction",data:[{value:"\\bigvee"},{value:"\\bigvee_{a}^{b}"},{value:"\\bigwedge"},{value:"\\bigwedge_{a}^{b}"}]}]},{name:"\u62EC\u53F7\u53D6\u6574",value:"\\left [ \\left ( \\right ) \\right ] ",children:[{name:"\u62EC\u53F7 Brackets",data:[{value:"\\left ( \\right )"},{value:"\\left [ \\right ]"},{value:"\\left \\langle \\right \\rangle "},{value:"\\left | \\right | "},{value:"\\left \\lfloor \\right \\rfloor "},{value:"\\left \\lceil \\right \\rceil "}]}]}],ht=[{name:"\u4EE3\u6570",value:"\\sqrt{a^2+b^2}",children:[{data:[{value:"\\left(x-1\\right)\\left(x+3\\right) "},{value:"\\sqrt{a^2+b^2}"},{value:"\\left ( \\frac{a}{b}\\right )^{n}= \\frac{a^{n}}{b^{n}}"},{value:"\\frac{a}{b}\\pm \\frac{c}{d}= \\frac{ad \\pm bc}{bd} "},{value:"\\frac{x^{2}}{a^{2}}-\\frac{y^{2}}{b^{2}}=1 "},{value:"\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0\\frac{1}{\\sqrt{a}}=\\frac{\\sqrt{a}}{a},a\\ge 0 "},{value:"\\sqrt[n]{a^{n}}=\\left ( \\sqrt[n]{a}\\right )^{n} "},{value:"x ={-b \\pm \\sqrt{b^2-4ac}\\over 2a} "},{value:"y-y_{1}=k \\left( x-x_{1}\\right) "},{value:`\\left\\{\\begin{matrix} \r
|
|
x=a + r\\text{cos}\\theta \\ \r
|
|
y=b + r\\text{sin}\\theta \r
|
|
\\end{matrix}\\right. `},{value:`\\begin{array}{l} \r
|
|
\\text{\u5BF9\u4E8E\u65B9\u7A0B\u5F62\u5982\uFF1A}x^{3}-1=0 \\ \r
|
|
\\text{\u8BBE}\\text{:}\\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
|
|
x_{1}=1,x_{2}= \\omega =\\frac{-1+\\sqrt{3}i}{2} \\ \r
|
|
x_{3}= \\omega ^{2}=\\frac{-1-\\sqrt{3}i}{2} \r
|
|
\\end{array} `},{value:`\\begin{array}{l} \r
|
|
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
|
|
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
|
|
\\left\\{\\begin{matrix} \r
|
|
\\Delta \\gt 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u4E0D\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
|
|
\\Delta = 0\\text{\u65B9\u7A0B\u6709\u4E24\u4E2A\u76F8\u7B49\u7684\u5B9E\u6839} \\ \r
|
|
\\Delta \\lt 0\\text{\u65B9\u7A0B\u65E0\u5B9E\u6839} \r
|
|
\\end{matrix}\\right. \r
|
|
\\end{array} `},{value:`\\begin{array}{l} \r
|
|
a\\mathop{{x}}\\nolimits^{{2}}+bx+c=0 \\ \r
|
|
\\Delta =\\mathop{{b}}\\nolimits^{{2}}-4ac \\ \r
|
|
\\mathop{{x}}\\nolimits_{{1,2}}=\\frac{{-b \\pm \r
|
|
\\sqrt{{\\mathop{{b}}\\nolimits^{{2}}-4ac}}}}{{2a}} \\ \r
|
|
\\mathop{{x}}\\nolimits_{{1}}+\\mathop{{x}}\\nolimits_{{2}}=-\\frac{{b}}{{a}} \\ \r
|
|
\\mathop{{x}}\\nolimits_{{1}}\\mathop{{x}}\\nolimits_{{2}}=\\frac{{c}}{{a}} \r
|
|
\\end{array} `}]}]},{name:"\u51E0\u4F55",value:"\\Delta A B C ",children:[{data:[{value:"\\Delta A B C "},{value:"a \\parallel c,b \\parallel c \\Rightarrow a \\parallel b "},{value:"l \\perp \\beta ,l \\subset \\alpha \\Rightarrow \\alpha \\perp \\beta"},{value:`\\left.\\begin{matrix} \r
|
|
a \\perp \\alpha \\ \r
|
|
b \\perp \\alpha \r
|
|
\\end{matrix}\\right\\}\\Rightarrow a \\parallel b`},{value:"P \\in \\alpha ,P \\in \\beta , \\alpha \\cap \\beta =l \\Rightarrow P \\in l "},{value:`\\alpha \\perp \\beta , \\alpha \\cap \\beta =l,a \\subset \\alpha ,a \\perp l \r
|
|
\\Rightarrow a \\perp \\beta `},{value:`\\left.\\begin{matrix} \r
|
|
a \\subset \\beta ,b \\subset \\beta ,a \\cap b=P \\ \r
|
|
a \\parallel \\partial ,b \\parallel \\partial \r
|
|
\\end{matrix}\\right\\}\\Rightarrow \\beta \\parallel \\alpha `},{value:"\\alpha \\parallel \\beta , \\gamma \\cap \\alpha =a, \\gamma \\cap \\beta =b \\Rightarrow a \\parallel b "},{value:"A \\in l,B \\in l,A \\in \\alpha ,B \\in \\alpha \\Rightarrow l \\subset \\alpha "},{value:`\\left.\\begin{matrix} \r
|
|
m \\subset \\alpha ,n \\subset \\alpha ,m \\cap n=P \\ \r
|
|
a \\perp m,a \\perp n \r
|
|
\\end{matrix}\\right\\}\\Rightarrow a \\perp \\alpha `},{value:`\\begin{array}{c} \r
|
|
\\text{\u76F4\u89D2\u4E09\u89D2\u5F62\u4E2D,\u76F4\u89D2\u8FB9\u957Fa,b,\u659C\u8FB9\u8FB9\u957Fc} \\ \r
|
|
a^{2}+b^{2}=c^{2} \r
|
|
\\end{array}`}]}]},{name:"\u4E0D\u7B49\u5F0F",value:"a > b",children:[{data:[{value:"a > b,b > c \\Rightarrow a > c "},{value:"a > b,c > d \\Rightarrow a+c > b+d "},{value:"a > b > 0,c > d > 0 \\Rightarrow ac bd "},{value:`\\begin{array}{c} \r
|
|
a \\gt b,c \\gt 0 \\Rightarrow ac \\gt bc \\ \r
|
|
a \\gt b,c \\lt 0 \\Rightarrow ac \\lt bc \r
|
|
\\end{array}`},{value:"\\left | a-b \\right | \\geqslant \\left | a \\right | -\\left | b \\right | "},{value:"-\\left | a \\right |\\leq a\\leqslant \\left | a \\right | "},{value:"\\left | a \\right |\\leqslant b \\Rightarrow -b \\leqslant a \\leqslant \\left | b \\right | "},{value:"\\left | a+b \\right | \\leqslant \\left | a \\right | + \\left | b \\right | "},{value:`\\begin{array}{c} \r
|
|
a \\gt b \\gt 0,n \\in N^{\\ast},n \\gt 1 \\ \r
|
|
\\Rightarrow a^{n}\\gt b^{n}, \\sqrt[n]{a}\\gt \\sqrt[n]{b} \r
|
|
\\end{array}`},{value:`\\left( \\sum_{k=1}^n a_k b_k \\right)^{\\!\\!2}\\leq \r
|
|
\\left( \\sum_{k=1}^n a_k^2 \\right) \\left( \\sum_{k=1}^n b_k^2 \\right) `},{value:`\\begin{array}{c} \r
|
|
a,b \\in R^{+} \\ \r
|
|
\\Rightarrow \\frac{a+b}{{2}}\\ge \\sqrt{ab} \\ \r
|
|
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
a,b \\in R \\ \r
|
|
\\Rightarrow a^{2}+b^{2}\\gt 2ab \\ \r
|
|
\\left( \\text{\u5F53\u4E14\u4EC5\u5F53}a=b\\text{\u65F6\u53D6\u201C}=\\text{\u201D\u53F7}\\right) \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
H_{n}=\\frac{n}{\\sum \\limits_{i=1}^{n}\\frac{1}{x_{i}}}= \\frac{n}{\\frac{1}{x_{1}}+ \\frac{1}{x_{2}}+ \\cdots + \\frac{1}{x_{n}}} \\ G_{n}=\\sqrt[n]{\\prod \\limits_{i=1}^{n}x_{i}}= \\sqrt[n]{x_{1}x_{2}\\cdots x_{n}} \\ A_{n}=\\frac{1}{n}\\sum \\limits_{i=1}^{n}x_{i}=\\frac{x_{1}+ x_{2}+ \\cdots + x_{n}}{n} \\ Q_{n}=\\sqrt{\\sum \\limits_{i=1}^{n}x_{i}^{2}}= \\sqrt{\\frac{x_{1}^{2}+ x_{2}^{2}+ \\cdots + x_{n}^{2}}{n}} \\ H_{n}\\leq G_{n}\\leq A_{n}\\leq Q_{n} \r
|
|
\\end{array}`}]}]},{name:"\u79EF\u5206",value:"\\frac{\\mathrm{d}\\partial}{\\partial x}",children:[{data:[{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}x^n=nx^{n-1} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}e^{ax}=a\\,e^{ax} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\ln(x)=\\frac{1}{x} "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\sin x=\\cos x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cos x=-\\sin x "},{value:"\\int k\\mathrm{d}x = kx+C "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\tan x=\\sec^2 x "},{value:"\\frac{\\mathrm{d}}{\\mathrm{d}x}\\cot x=-\\csc^2 x "},{value:"\\int \\frac{1}{x}\\mathrm{d}x= \\ln \\left| x \\right| +C "},{value:"\\int \\frac{1}{\\sqrt{1-x^{2}}}\\mathrm{d}x= \\arcsin x +C "},{value:"\\int \\frac{1}{1+x^{2}}\\mathrm{d}x= \\arctan x +C "},{value:"\\int u \\frac{\\mathrm{d}v}{\\mathrm{d}x}\\,\\mathrm{d}x=uv-\\int \\frac{\\mathrm{d}u}{\\mathrm{d}x}v\\,\\mathrm{d}x "},{value:"f(x) = \\int_{-\\infty}^\\infty \\hat f(x)\\xi\\,e^{2 \\pi i \\xi x} \\,\\mathrm{d}\\xi "},{value:"\\int x^{\\mu}\\mathrm{d}x=\\frac{x^{\\mu +1}}{\\mu +1}+C, \\left({\\mu \\neq -1}\\right) "}]}]},{name:"\u4E09\u89D2",value:"e^{i \\theta}",children:[{name:"\u6C42\u548C Summation",data:[{value:"e^{i \\theta} "},{value:"\\left(\\frac{\\pi}{2}-\\theta \\right ) "},{value:"\\text{sin}^{2}\\frac{\\alpha}{2}=\\frac{1- \\text{cos}\\alpha}{2} "},{value:"\\text{cos}^{2}\\frac{\\alpha}{2}=\\frac{1+ \\text{cos}\\alpha}{2} "},{value:"\\text{tan}\\frac{\\alpha}{2}=\\frac{\\text{sin}\\alpha}{1+ \\text{cos}\\alpha} "},{value:"\\sin \\alpha + \\sin \\beta =2 \\sin \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\sin \\alpha - \\sin \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha + \\cos \\beta =2 \\cos \\frac{\\alpha + \\beta}{2}\\cos \\frac{\\alpha - \\beta}{2} "},{value:"\\cos \\alpha - \\cos \\beta =-2\\sin \\frac{\\alpha + \\beta}{2}\\sin \\frac{\\alpha - \\beta}{2} "},{value:"a^{2}=b^{2}+c^{2}-2bc\\cos A "},{value:"\\frac{\\sin A}{a}=\\frac{\\sin B}{b}=\\frac{\\sin C}{c}=\\frac{1}{2R} "},{value:"\\sin \\left ( \\frac{\\pi}{2}-\\alpha \\right ) = \\cos \\alpha "},{value:"\\sin \\left ( \\frac{\\pi}{2}+\\alpha \\right ) = \\cos \\alpha "}]}]},{name:"\u7EDF\u8BA1",value:"C_{r}^{n}",children:[{data:[{value:"C_{r}^{n} "},{value:"\\frac{n!}{r!(n-r)!} "},{value:"\\sum_{i=1}^{n}{X_i} "},{value:"\\sum_{i=1}^{n}{X_i^2} "},{value:"X_1, \\cdots,X_n "},{value:"\\frac{x-\\mu}{\\sigma} "},{value:"\\sum_{i=1}^{n}{(X_i - \\overline{X})^2} "},{value:`\\begin{array}{c} \r
|
|
\\text{\u82E5}P \\left( AB \\right) =P \\left( A \\right) P \\left( B \\right) \\\\ \r
|
|
\\text{\u5219}P \\left( A \\left| B\\right. \\right) =P \\left({B}\\right) \r
|
|
\\end{array}`},{value:"P(E) ={n \\choose k}p^k (1-p)^{n-k} "},{value:"P \\left( A \\right) = \\lim \\limits_{n \\to \\infty}f_{n}\\left ( A \\right ) "},{value:"P \\left( \\bigcup \\limits_{i=1}^{+ \\infty}A_{i}\\right) = \\prod \\limits_{i=1}^{+ \\infty}P{\\left( A_{i}\\right)} "},{value:`\\begin{array}{c} \r
|
|
P \\left( \\emptyset \\right) =0 \\\\ \r
|
|
P \\left( S \\right) =1 \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
\\forall A \\in S \\\\ \r
|
|
P \\left( A \\right) \\ge 0 \r
|
|
\\end{array}`},{value:"P \\left( \\bigcup \\limits_{i=1}^{n}A_{i}\\right) = \\prod \\limits_{i=1}^{n}P \\left( A_{i}\\right) "},{value:`\\begin{array}{c} \r
|
|
S= \\binom{N}{n},A_{k}=\\binom{M}{k}\\cdot \\binom{N-M}{n-k} \\\\ \r
|
|
P\\left ( A_{k}\\right ) = \\frac{\\binom{M}{k}\\cdot \\binom{N-M}{n-k}}{\\binom{N}{n}} \r
|
|
\\end{array}`},{value:`\\begin{array}{c} \r
|
|
P_{n}=n! \\\\ \r
|
|
A_{n}^{k}=\\frac{n!}{\\left( n-k \\left) !\\right. \\right.} \r
|
|
\\end{array}`}]}]}],lt=Ct=>{nt.current.setValue(nt.current.getValue()+" "+Ct.value+" ")},pt=[{key:"1",label:"\u5FEB\u6377\u6A21\u677F",children:ve.createElement(ce.Z,{className:$t.Z.lists,gutter:[10,10]},et.map((Ct,bt)=>ve.createElement(Be.Z,{flex:"110px",className:$t.Z.item},ve.createElement("div",null,ve.createElement(de.Z,{value:`$$${Ct.value}$$`}),Ct.name),ve.createElement("div",{className:$t.Z.children},Ct.children.map((zt,Qt)=>ve.createElement("div",{key:Qt},ve.createElement("h1",null,zt.name),ve.createElement(ce.Z,{gutter:[10,10]},zt.data.map((ie,oe)=>ve.createElement(Be.Z,{key:oe,onClick:()=>lt(ie),className:$t.Z.diamond},ve.createElement(de.Z,{value:"`$$"+ie.value+"$$`"}))))))))))},{key:"2",label:"\u516C\u5F0F\u6A21\u677F",children:ve.createElement(ce.Z,{className:$t.Z.lists,gutter:[10,10]},ht.map((Ct,bt)=>ve.createElement(Be.Z,{flex:"110px",className:$t.Z.item},ve.createElement("div",null,ve.createElement(de.Z,{value:"`$$"+Ct.value+"$$`"}),Ct.name),ve.createElement("div",{className:$t.Z.children},Ct.children.map((zt,Qt)=>ve.createElement("div",{key:Qt},zt.name&&ve.createElement("h1",null,zt.name),ve.createElement(ce.Z,{gutter:[10,10]},zt.data.map((ie,oe)=>ve.createElement(Be.Z,{key:oe,onClick:()=>lt(ie),className:$t.Z.diamond},ve.createElement(de.Z,{value:"`$$"+ie.value+"$$`"}))))))))))}],vt=()=>{var Ct=document.createElement("div");Ct.innerHTML=nt.current.getValue();var bt=Ct.innerText;return ze&&ze(bt),bt};return(0,It.useImperativeHandle)(Nt,()=>({getData:vt})),ve.createElement("div",{className:$t.Z.mathWrap},ve.createElement(qe.default,{defaultActiveKey:"1",items:pt}),ve.createElement("math-field",{locale:"zh_cn",className:$t.Z.mathField,placeholder:"\u8BF7\u6253\u5F00\u952E\u76D8\uFF0C\u8F93\u5165\u516C\u5F0F",ref:nt,style:{width:800,marginTop:30,fontSize:18}},tn||""),Me&&ve.createElement("div",{className:$t.Z.button},ve.createElement(Se.ZP,{size:"large",onClick:vt,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))});In.Z=Pe},26194:function(on,In,Jt){"use strict";var It=Jt(67294),ce=Jt(4977),Be=Jt(85804),qe=Object.defineProperty,Se=Object.defineProperties,de=Object.getOwnPropertyDescriptors,$t=Object.getOwnPropertySymbols,He=Object.prototype.hasOwnProperty,ve=Object.prototype.propertyIsEnumerable,Pe=(Nt,nt,et)=>nt in Nt?qe(Nt,nt,{enumerable:!0,configurable:!0,writable:!0,value:et}):Nt[nt]=et,ze=(Nt,nt)=>{for(var et in nt||(nt={}))He.call(nt,et)&&Pe(Nt,et,nt[et]);if($t)for(var et of $t(nt))ve.call(nt,et)&&Pe(Nt,et,nt[et]);return Nt},Me=(Nt,nt)=>Se(Nt,de(nt));const tn=({img:Nt,buttonProps:nt={},styles:et={},customText:ht,ButtonText:lt,ButtonClick:pt,Buttonclass:vt,ButtonTwo:Ct,imgStyles:bt,loading:zt=!1,className:Qt=""})=>It.createElement("section",{className:`tc animated fadeIn ${Qt}`,style:ze({color:"#999",margin:"100px auto",visibility:zt?"hidden":"visible"},et)},It.createElement("img",{src:Nt||ce,style:Me(ze({},bt),{pointerEvents:"none",userSelect:"none"})}),It.createElement("p",{className:"mt20 font14"},ht||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),lt&&It.createElement(Be.ZP,ze({className:vt,onClick:pt},nt),lt),Ct&&Ct);In.Z=tn},20819:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return vt}});var It=Jt(67294),ce={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},Be=Jt(85804),qe=Jt(30153),Se=Jt(36295),de=Jt(83062),$t=Jt(28706),He=Jt(15835),ve=Jt(26194),Pe=Jt(11320),ze=Jt(66540),Me=Jt(67294),tn=Object.defineProperty,Nt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(Ct,bt,zt)=>bt in Ct?tn(Ct,bt,{enumerable:!0,configurable:!0,writable:!0,value:zt}):Ct[bt]=zt,lt=(Ct,bt)=>{for(var zt in bt||(bt={}))nt.call(bt,zt)&&ht(Ct,zt,bt[zt]);if(Nt)for(var zt of Nt(bt))et.call(bt,zt)&&ht(Ct,zt,bt[zt]);return Ct},pt=(Ct,bt,zt)=>new Promise((Qt,ie)=>{var oe=ue=>{try{Ne(zt.next(ue))}catch(ke){ie(ke)}},re=ue=>{try{Ne(zt.throw(ue))}catch(ke){ie(ke)}},Ne=ue=>ue.done?Qt(ue.value):Promise.resolve(ue.value).then(oe,re);Ne((zt=zt.apply(Ct,bt)).next())}),vt=({editOffice:Ct="view",data:bt,issaver:zt,onSaver:Qt,theme:ie,type:oe,filename:re,monacoEditor:Ne,className:ue,style:ke,close:Ke,onClose:Fe,hasMask:wn,disabledDownload:Rn,onImgDimensions:$n,showNodata:di,recordInfo:ee})=>{const[_t,Kt]=(0,It.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[pn,Ln]=(0,It.useState)(""),[Ce,sn]=(0,It.useState)(),cn=window.ENV==="build"?"/react/build":"",Jn=location.host.startsWith("localhost")?Pe.Z.PROXY_SERVER:Pe.Z.API_SERVER,he=10*(1024*1024),Te=(0,It.useRef)();bt!=null&&bt.startsWith("/api")&&oe!=="txt"&&(bt=Pe.Z.API_SERVER+bt);const Nn=At=>At.substring(At.lastIndexOf("/")+1).split(".").pop();re&&Ne&&(Ne.filename=re),(0,It.useEffect)(()=>{var At,Ut;const Et=(Ut=(At=document.cookie)==null?void 0:At.replace(/\s/g,""))==null?void 0:Ut.split(";");Et==null||Et.map(be=>{let Dn=be.split("=");Dn[0]==="_educoder_session"&&Ln(Dn[1])})},[]),(0,It.useEffect)(()=>{oe==="office"&&(bt.indexOf("bigfilescdn.")>-1||bt.indexOf("bigfiles1")>-1?sn({url:bt,fileType:Nn(bt),model:bt.indexOf("model=edit")?"edit":"view"}):Ht())},[oe,bt]);function Bn(At){return pt(this,null,function*(){At.data.type==="pdfdata"&&(Qt(At.data.data),window.removeEventListener("message",Bn,!1)),console.log("mess---:",At.data)})}const Ht=()=>pt(void 0,null,function*(){console.log("data:",bt);let At=bt;bt.startsWith("http")||(At=location.origin+At);let Ut=new URL(At).pathname.split("/").pop();const Et=yield(0,He.gJ)({attachment_id:Ut});Et.url=Jn+Et.url,sn(Et)}),Mt=()=>{if(bt.startsWith("http")||bt.startsWith("blob:")){wt();return}(0,$t.Sv)(re||"educoder",bt,re)},wt=()=>{ee&&(0,ze.fc)({id:ee==null?void 0:ee.id,watch_type:1,course_id:ee==null?void 0:ee.course_id}),(0,$t.Nd)(re||"educoder",decodeURIComponent(bt))};return Me.createElement("div",{style:lt({},ke||{}),className:`${wn&&ce.bgBlack} ${oe?ce.wrp:"hide"}`},Ke&&Me.createElement("div",{className:ce.close,ref:Te},!!$n&&Me.createElement(de.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>Te.current},Me.createElement("span",{onClick:()=>{Fe(),$n()}},Me.createElement("i",{className:"icon-yulanpizhu"}))),!Rn&&Me.createElement(de.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>Te.current},Me.createElement("span",{onClick:wt},Me.createElement("i",{className:"icon-quxiaozhiding"}))),zt&&Me.createElement(de.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>Te.current},Me.createElement("span",{className:"",onClick:()=>{const At=document.getElementById("pdfiframe");window.addEventListener("message",Bn,!1),setTimeout(()=>{At.contentWindow.postMessage("getData","*")},300)}},Me.createElement("i",{className:"icon-baocun"}))),Me.createElement(de.Z,{title:"\u5173\u95ED",getPopupContainer:()=>Te.current},Me.createElement("span",{className:"",onClick:()=>{Fe()}},Me.createElement("i",{className:"icon-guanbi1"})))),Me.createElement("div",{className:`${ce[ue]} ${ue} ${ce.monaco} ${oe==="txt"?"show":"hide"}`},oe==="txt"&&Me.createElement(Me.Fragment,null,Me.createElement(Se.ZP,lt({},Ne)))),oe==="audio"&&Me.createElement("audio",{src:`${(bt==null?void 0:bt.indexOf("http://"))>-1||(bt==null?void 0:bt.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${bt}`,autoPlay:!0}),oe==="video"&&Me.createElement(Me.Fragment,null,(bt==null?void 0:bt.indexOf("http"))>-1?Me.createElement("video",{controls:!0,src:`${bt}`,autoPlay:!0}):Me.createElement("video",{controls:!0,src:`data:video/mp4;base64,${bt}`,autoPlay:!0})),oe==="office"&&Ce&&Me.createElement("iframe",{src:`${cn}/office.html?key=${Ce.key}&url=${btoa(Ce.url)}&callbackUrl=${Jn+(Ce.callbackUrl||"")}&fileType=${Ce.fileType}&title=${Ce.title||""}&model=${Ct}&officeServer=${Pe.Z.ONLYOFFICE}&disabledDownload=${!!Rn}`}),oe==="html"&&Me.createElement("iframe",{src:bt+"&disposition=inline"}),oe==="pdf"&&Me.createElement("iframe",{id:"pdfiframe",src:`${cn}/js/pdfview/index.html?filename=${re||"educoder.pdf"}&url=${encodeURIComponent(bt)}&disabledDownload=${!!Rn}&model=${Ct}`}),oe==="image"&&Me.createElement("img",{src:`${(bt==null?void 0:bt.indexOf("http://"))>-1||(bt==null?void 0:bt.indexOf("https://"))>-1?"":"data:image/png;base64,"}${bt}`}),(oe==="other"||oe==="download")&&Me.createElement(Me.Fragment,null,di?Me.createElement(ve.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:Me.createElement(Be.ZP,{icon:Me.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:Mt,disabled:Rn},"\u4E0B\u8F7D")}):Me.createElement(Be.ZP,{type:"primary",size:"middle",onClick:Mt,disabled:Rn},Me.createElement(qe.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},65226:function(on,In,Jt){"use strict";Jt.d(In,{z:function(){return oe},Z:function(){return re}});var It=Jt(67294),ce=Jt(81897),Be=Jt(51161),qe=Jt(11771),Se=Jt(67631),de=Jt.n(Se),$t=Jt(11320),He=Jt(28706),ve=Jt(20527),Pe=Jt(25934),ze=Jt(20819),Me=Jt(67294),Nt=({html:Ne})=>{const ue=(0,It.useRef)(null),ke=(0,It.useRef)(null),Ke=`.markdown-body p {
|
|
margin: 0 0 16px 0 !important;
|
|
line-height: 28px;
|
|
white-space: pre-wrap;
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
li {
|
|
list-style-type: none
|
|
}
|
|
|
|
ol,
|
|
ul,
|
|
dl {
|
|
margin-bottom: 0px;
|
|
}
|
|
|
|
.markdown-body {
|
|
-ms-text-size-adjust: 100%;
|
|
-webkit-text-size-adjust: 100%;
|
|
color: #333;
|
|
overflow: hidden;
|
|
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
|
|
word-break: break-word;
|
|
font-size: 16px;
|
|
line-height: 1.6;
|
|
white-space: normal;
|
|
word-wrap: break-word;
|
|
position: relative;
|
|
}
|
|
|
|
.markdown-body ul>li {
|
|
list-style-type: disc;
|
|
}
|
|
|
|
.markdown-body ol>li {
|
|
list-style-type: decimal;
|
|
}
|
|
|
|
.markdown-body a {
|
|
background: transparent;
|
|
}
|
|
|
|
.markdown-body a:active,
|
|
.markdown-body a:hover {
|
|
outline: 0;
|
|
}
|
|
|
|
.markdown-body strong {
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 2em;
|
|
margin: 0.67em 0;
|
|
}
|
|
|
|
.markdown-body img {
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
-moz-box-sizing: content-box;
|
|
box-sizing: content-box;
|
|
height: 0;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
overflow: auto;
|
|
}
|
|
|
|
.markdown-body code,
|
|
.markdown-body kbd,
|
|
.markdown-body pre {
|
|
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body input {
|
|
color: inherit;
|
|
font: inherit;
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body html input[disabled] {
|
|
cursor: default;
|
|
}
|
|
|
|
.markdown-body input {
|
|
line-height: normal;
|
|
}
|
|
|
|
.markdown-body input[type="checkbox"] {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
border-collapse: collapse;
|
|
border-spacing: 0;
|
|
}
|
|
|
|
.markdown-body td,
|
|
.markdown-body th {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body * {
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body input {
|
|
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
|
|
}
|
|
|
|
.markdown-body a {
|
|
color: #4183c4;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body a:hover,
|
|
.markdown-body a:active {
|
|
text-decoration: underline;
|
|
}
|
|
|
|
.markdown-body hr {
|
|
height: 0;
|
|
margin: 15px 0;
|
|
overflow: hidden;
|
|
background: transparent;
|
|
border: 0;
|
|
border-bottom: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body hr:before {
|
|
display: table;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body hr:after {
|
|
display: table;
|
|
clear: both;
|
|
content: "";
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
margin-top: 15px;
|
|
margin-bottom: 15px;
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
font-size: 30px;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
font-size: 21px;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 16px;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 14px;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 11px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
margin: 0;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding: 0;
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
ul.linenums,
|
|
ol.linenums {
|
|
padding: 16px 0 0 56px !important;
|
|
}
|
|
|
|
.markdown-body ul,
|
|
.markdown-body ol {
|
|
padding-left: 2em;
|
|
}
|
|
|
|
|
|
.markdown-body ol ol,
|
|
.markdown-body ul ol {
|
|
list-style-type: lower-roman;
|
|
}
|
|
|
|
.markdown-body ul ul ol,
|
|
.markdown-body ul ol ol,
|
|
.markdown-body ol ul ol,
|
|
.markdown-body ol ol ol {
|
|
list-style-type: lower-alpha;
|
|
}
|
|
|
|
.markdown-body dd {
|
|
margin-left: 0;
|
|
}
|
|
|
|
.markdown-body code {
|
|
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
font-size: 12px;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
}
|
|
|
|
.markdown-body .octicon {
|
|
font: normal normal 16px octicons-anchor;
|
|
line-height: 1;
|
|
display: inline-block;
|
|
text-decoration: none;
|
|
-webkit-font-smoothing: antialiased;
|
|
-moz-osx-font-smoothing: grayscale;
|
|
-webkit-user-select: none;
|
|
-moz-user-select: none;
|
|
-ms-user-select: none;
|
|
user-select: none;
|
|
}
|
|
|
|
.markdown-body .octicon-link:before {
|
|
content: '\f05c';
|
|
}
|
|
|
|
.markdown-body>*:first-child {
|
|
margin-top: 0 !important;
|
|
}
|
|
|
|
.markdown-body>*:last-child {
|
|
margin-bottom: 0 !important;
|
|
}
|
|
|
|
.markdown-body .anchor {
|
|
position: absolute;
|
|
top: 0;
|
|
left: 0;
|
|
display: block;
|
|
padding-right: 6px;
|
|
padding-left: 30px;
|
|
margin-left: -30px;
|
|
}
|
|
|
|
.markdown-body .anchor:focus {
|
|
outline: none;
|
|
}
|
|
|
|
.markdown-body h1,
|
|
.markdown-body h2,
|
|
.markdown-body h3,
|
|
.markdown-body h4,
|
|
.markdown-body h5,
|
|
.markdown-body h6 {
|
|
position: relative;
|
|
margin-top: 1em;
|
|
margin-bottom: 16px;
|
|
font-weight: bold;
|
|
line-height: 1.4;
|
|
}
|
|
|
|
.markdown-body h1 .octicon-link,
|
|
.markdown-body h2 .octicon-link,
|
|
.markdown-body h3 .octicon-link,
|
|
.markdown-body h4 .octicon-link,
|
|
.markdown-body h5 .octicon-link,
|
|
.markdown-body h6 .octicon-link {
|
|
display: none;
|
|
color: #000;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor,
|
|
.markdown-body h2:hover .anchor,
|
|
.markdown-body h3:hover .anchor,
|
|
.markdown-body h4:hover .anchor,
|
|
.markdown-body h5:hover .anchor,
|
|
.markdown-body h6:hover .anchor {
|
|
padding-left: 8px;
|
|
margin-left: -30px;
|
|
text-decoration: none;
|
|
}
|
|
|
|
.markdown-body h1:hover .anchor .octicon-link,
|
|
.markdown-body h2:hover .anchor .octicon-link,
|
|
.markdown-body h3:hover .anchor .octicon-link,
|
|
.markdown-body h4:hover .anchor .octicon-link,
|
|
.markdown-body h5:hover .anchor .octicon-link,
|
|
.markdown-body h6:hover .anchor .octicon-link {
|
|
display: inline-block;
|
|
}
|
|
|
|
.markdown-body h1 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 2.25em;
|
|
line-height: 1.2;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h1 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h2 {
|
|
padding-bottom: 0.3em;
|
|
font-size: 1.75em;
|
|
line-height: 1.225;
|
|
border-bottom: 1px solid #eee;
|
|
}
|
|
|
|
.markdown-body h2 .anchor {
|
|
line-height: 1;
|
|
}
|
|
|
|
.markdown-body h3 {
|
|
font-size: 1.5em;
|
|
line-height: 1.43;
|
|
}
|
|
|
|
.markdown-body h3 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h4 {
|
|
font-size: 1.25em;
|
|
}
|
|
|
|
.markdown-body h4 .anchor {
|
|
line-height: 1.2;
|
|
}
|
|
|
|
.markdown-body h5 {
|
|
font-size: 1em;
|
|
}
|
|
|
|
.markdown-body h5 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body h6 {
|
|
font-size: 1em;
|
|
color: #777;
|
|
}
|
|
|
|
.markdown-body h6 .anchor {
|
|
line-height: 1.1;
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body ul ul,
|
|
.markdown-body ul ol,
|
|
.markdown-body ol ol,
|
|
.markdown-body ol ul {
|
|
margin-top: 0;
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body li>p {
|
|
margin-top: 16px;
|
|
}
|
|
|
|
.markdown-body dl {
|
|
padding: 0;
|
|
}
|
|
|
|
.markdown-body dl dt {
|
|
padding: 0;
|
|
margin-top: 16px;
|
|
font-size: 1em;
|
|
font-style: italic;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body dl dd {
|
|
padding: 0 16px;
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body blockquote {
|
|
padding: 0 15px;
|
|
color: #777;
|
|
border-left: 4px solid #ddd;
|
|
}
|
|
|
|
.markdown-body blockquote> :first-child {
|
|
margin-top: 0;
|
|
}
|
|
|
|
.markdown-body blockquote> :last-child {
|
|
margin-bottom: 0;
|
|
}
|
|
|
|
.markdown-body table {
|
|
display: block;
|
|
width: 100%;
|
|
overflow: auto;
|
|
word-break: normal;
|
|
word-break: keep-all;
|
|
}
|
|
|
|
.markdown-body table th {
|
|
font-weight: bold;
|
|
text-align: revert;
|
|
}
|
|
|
|
.markdown-body table th,
|
|
.markdown-body table td {
|
|
padding: 6px 13px;
|
|
border: 1px solid #ddd;
|
|
}
|
|
|
|
.markdown-body table tr {
|
|
background-color: #fff;
|
|
border-top: 1px solid #ccc;
|
|
}
|
|
|
|
.markdown-body table tr:nth-child(2n) {
|
|
background-color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body img {
|
|
max-width: 100%;
|
|
-moz-box-sizing: border-box;
|
|
box-sizing: border-box;
|
|
}
|
|
|
|
.markdown-body code {
|
|
padding: 0;
|
|
padding-top: 0.2em;
|
|
padding-bottom: 0.2em;
|
|
margin: 0;
|
|
font-size: 85%;
|
|
background-color: rgba(0, 0, 0, 0.04);
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body code:has(.katex) {
|
|
background-color: transparent;
|
|
}
|
|
|
|
.markdown-body code:before,
|
|
.markdown-body code:after {
|
|
letter-spacing: -0.2em;
|
|
content: "\\00a0";
|
|
}
|
|
|
|
.markdown-body pre>code {
|
|
padding: 0;
|
|
margin: 0;
|
|
font-size: 100%;
|
|
word-break: normal;
|
|
white-space: pre;
|
|
background: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body .highlight {
|
|
margin-bottom: 16px;
|
|
}
|
|
|
|
.markdown-body .highlight pre,
|
|
.markdown-body pre {
|
|
padding: 16px;
|
|
overflow: auto;
|
|
font-size: 85%;
|
|
line-height: 1.45;
|
|
background-color: #f7f7f7;
|
|
border-radius: 3px;
|
|
}
|
|
|
|
.markdown-body .highlight pre {
|
|
margin-bottom: 0;
|
|
word-break: normal;
|
|
}
|
|
|
|
.markdown-body pre {
|
|
word-wrap: normal;
|
|
}
|
|
|
|
.markdown-body pre code {
|
|
display: inline;
|
|
max-width: initial;
|
|
padding: 0;
|
|
margin: 0;
|
|
overflow: initial;
|
|
line-height: inherit;
|
|
word-wrap: normal;
|
|
background-color: transparent;
|
|
border: 0;
|
|
}
|
|
|
|
.markdown-body pre code:before,
|
|
.markdown-body pre code:after {
|
|
content: normal;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font-size: 11px;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .pl-c {
|
|
color: #969896;
|
|
}
|
|
|
|
.markdown-body .pl-c1,
|
|
.markdown-body .pl-mdh,
|
|
.markdown-body .pl-mm,
|
|
.markdown-body .pl-mp,
|
|
.markdown-body .pl-mr,
|
|
.markdown-body .pl-s1 .pl-v,
|
|
.markdown-body .pl-s3,
|
|
.markdown-body .pl-sc,
|
|
.markdown-body .pl-sv {
|
|
color: #0086b3;
|
|
}
|
|
|
|
.markdown-body .pl-e,
|
|
.markdown-body .pl-en {
|
|
color: #795da3;
|
|
}
|
|
|
|
.markdown-body .pl-s1 .pl-s2,
|
|
.markdown-body .pl-smi,
|
|
.markdown-body .pl-smp,
|
|
.markdown-body .pl-stj,
|
|
.markdown-body .pl-vo,
|
|
.markdown-body .pl-vpf {
|
|
color: #333;
|
|
}
|
|
|
|
.markdown-body .pl-ent {
|
|
color: #63a35c;
|
|
}
|
|
|
|
.markdown-body .pl-k,
|
|
.markdown-body .pl-s,
|
|
.markdown-body .pl-st {
|
|
color: #a71d5d;
|
|
}
|
|
|
|
.markdown-body .pl-pds,
|
|
.markdown-body .pl-s1,
|
|
.markdown-body .pl-s1 .pl-pse .pl-s2,
|
|
.markdown-body .pl-sr,
|
|
.markdown-body .pl-sr .pl-cce,
|
|
.markdown-body .pl-sr .pl-sra,
|
|
.markdown-body .pl-sr .pl-sre,
|
|
.markdown-body .pl-src {
|
|
color: #df5000;
|
|
}
|
|
|
|
.markdown-body .pl-mo,
|
|
.markdown-body .pl-v {
|
|
color: #1d3e81;
|
|
}
|
|
|
|
.markdown-body .pl-id {
|
|
color: #b52a1d;
|
|
}
|
|
|
|
.markdown-body .pl-ii {
|
|
background-color: #b52a1d;
|
|
color: #f8f8f8;
|
|
}
|
|
|
|
.markdown-body .pl-sr .pl-cce {
|
|
color: #63a35c;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-ml {
|
|
color: #693a17;
|
|
}
|
|
|
|
.markdown-body .pl-mh,
|
|
.markdown-body .pl-mh .pl-en,
|
|
.markdown-body .pl-ms {
|
|
color: #1d3e81;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-mq {
|
|
color: #008080;
|
|
}
|
|
|
|
.markdown-body .pl-mi {
|
|
color: #333;
|
|
font-style: italic;
|
|
}
|
|
|
|
.markdown-body .pl-mb {
|
|
color: #333;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body .pl-md,
|
|
.markdown-body .pl-mdhf {
|
|
background-color: #ffecec;
|
|
color: #bd2c00;
|
|
}
|
|
|
|
.markdown-body .pl-mdht,
|
|
.markdown-body .pl-mi1 {
|
|
background-color: #eaffea;
|
|
color: #55a532;
|
|
}
|
|
|
|
.markdown-body .pl-mdr {
|
|
color: #795da3;
|
|
font-weight: bold;
|
|
}
|
|
|
|
.markdown-body kbd {
|
|
display: inline-block;
|
|
padding: 3px 5px;
|
|
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
|
line-height: 10px;
|
|
color: #555;
|
|
vertical-align: middle;
|
|
background-color: #fcfcfc;
|
|
border: solid 1px #ccc;
|
|
border-bottom-color: #bbb;
|
|
border-radius: 3px;
|
|
box-shadow: inset 0 -1px 0 #bbb;
|
|
}
|
|
|
|
.markdown-body .task-list-item {
|
|
list-style-type: none;
|
|
}
|
|
|
|
.markdown-body .task-list-item+.task-list-item {
|
|
margin-top: 3px;
|
|
}
|
|
|
|
.markdown-body .task-list-item input {
|
|
float: left;
|
|
margin: 0.3em 0 0.25em -1.6em;
|
|
vertical-align: middle;
|
|
}
|
|
|
|
.markdown-body :checked+.radio-label {
|
|
z-index: 1;
|
|
position: relative;
|
|
border-color: #4183c4;
|
|
}
|
|
|
|
|
|
/*! Pretty printing styles. Used with prettify.js. */
|
|
/* SPAN elements with the classes below are added by prettyprint. */
|
|
.pln {
|
|
color: #000
|
|
}
|
|
|
|
/* plain text */
|
|
|
|
@media screen {
|
|
.str {
|
|
color: #080
|
|
}
|
|
|
|
/* string content */
|
|
.kwd {
|
|
color: #008
|
|
}
|
|
|
|
/* a keyword */
|
|
.com {
|
|
color: #800
|
|
}
|
|
|
|
/* a comment */
|
|
.typ {
|
|
color: #606
|
|
}
|
|
|
|
/* a type name */
|
|
.lit {
|
|
color: #066
|
|
}
|
|
|
|
/* a literal value */
|
|
/* punctuation, lisp open bracket, lisp close bracket */
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #660
|
|
}
|
|
|
|
.tag {
|
|
color: #008
|
|
}
|
|
|
|
/* a markup tag name */
|
|
.atn {
|
|
color: #606
|
|
}
|
|
|
|
/* a markup attribute name */
|
|
.atv {
|
|
color: #080
|
|
}
|
|
|
|
/* a markup attribute value */
|
|
.dec,
|
|
.var {
|
|
color: #606
|
|
}
|
|
|
|
/* a declaration; a variable name */
|
|
.fun {
|
|
color: red
|
|
}
|
|
|
|
/* a function name */
|
|
}
|
|
|
|
/* Use higher contrast and text-weight for printable form. */
|
|
@media print,
|
|
projection {
|
|
.str {
|
|
color: #060
|
|
}
|
|
|
|
.kwd {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.com {
|
|
color: #600;
|
|
font-style: italic
|
|
}
|
|
|
|
.typ {
|
|
color: #404;
|
|
font-weight: bold
|
|
}
|
|
|
|
.lit {
|
|
color: #044
|
|
}
|
|
|
|
.pun,
|
|
.opn,
|
|
.clo {
|
|
color: #440
|
|
}
|
|
|
|
.tag {
|
|
color: #006;
|
|
font-weight: bold
|
|
}
|
|
|
|
.atn {
|
|
color: #404
|
|
}
|
|
|
|
.atv {
|
|
color: #060
|
|
}
|
|
}
|
|
|
|
/* Put a border around prettyprinted code snippets. */
|
|
pre.prettyprint {
|
|
padding: 2px;
|
|
/* border: 1px solid #888 */
|
|
}
|
|
|
|
/* Specify class=linenums on a pre to get line numbering */
|
|
ol.linenums {
|
|
margin-top: 0;
|
|
margin-bottom: 0
|
|
}
|
|
|
|
/* IE indents via margin-left */
|
|
li.L0,
|
|
li.L1,
|
|
li.L2,
|
|
li.L3,
|
|
li.L5,
|
|
li.L6,
|
|
li.L7,
|
|
li.L8 {
|
|
list-style-type: none
|
|
}
|
|
|
|
/* Alternate shading for lines */
|
|
li.L1,
|
|
li.L3,
|
|
li.L5,
|
|
li.L7,
|
|
li.L9 {
|
|
background: #eee
|
|
}
|
|
|
|
.markdown-body p,
|
|
.markdown-body blockquote,
|
|
.markdown-body ul,
|
|
.markdown-body ol,
|
|
.markdown-body dl,
|
|
.markdown-body table,
|
|
.markdown-body pre {
|
|
margin-top: 0;
|
|
margin-bottom: 16px;
|
|
}`;return(0,It.useEffect)(()=>{const Fe=ue.current.attachShadow({mode:"open"});ke.current=document.createElement("div"),ke.current.className="markdown-body",ke.current.innerHTML=Ne,Fe.appendChild(ke.current);const wn=document.createElement("style");return wn.textContent=Ke,Fe.appendChild(wn),()=>{Fe.innerHTML=""}},[]),(0,It.useEffect)(()=>{ke.current&&(ke.current.innerHTML=Ne)},[Ne]),Me.createElement("div",{ref:ue})};function nt(Ne){const ue=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],ke=new RegExp(`\\b(${ue.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return Ne.replace(ke,"").trim()}var et=Object.defineProperty,ht=Object.getOwnPropertySymbols,lt=Object.prototype.hasOwnProperty,pt=Object.prototype.propertyIsEnumerable,vt=(Ne,ue,ke)=>ue in Ne?et(Ne,ue,{enumerable:!0,configurable:!0,writable:!0,value:ke}):Ne[ue]=ke,Ct=(Ne,ue)=>{for(var ke in ue||(ue={}))lt.call(ue,ke)&&vt(Ne,ke,ue[ke]);if(ht)for(var ke of ht(ue))pt.call(ue,ke)&&vt(Ne,ke,ue[ke]);return Ne};const bt="@\u2581\u2581@",zt="@\u2581@",Qt=/<pre[^>]*>/g;function ie(Ne){let ue=document.createElement("div");return ue.innerHTML=Ne,ue.childNodes.length===0?"":ue.childNodes[0].nodeValue}const oe=(Ne,ue)=>{Ne=Ne||"";const ke=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Ke=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,Fe=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,wn=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return ue?Ne.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(ke,(Rn,$n,di,ee,_t,Kt,pn)=>{const Ln=$n||ee||Kt,Ce=di||_t||pn||"?";return $t.Z.API_SERVER+"/api/attachments/"+Ln+Ce+"&t="+(0,He.Jn)(Ln,Date.now())+(Rn.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(Ne=Ne.replace(wn,(Rn,$n,di,ee,_t,Kt,pn)=>{const Ln=$n||ee||Kt,Ce=di||_t||pn||"?";return $t.Z.API_SERVER+"/attachments/download/"+Ln+Ce+"&t="+(0,He.Jn)(Ln,Date.now())+(Rn.indexOf(")")>-1?")":"&")}).replace(ke,(Rn,$n,di,ee,_t,Kt,pn)=>{const Ln=$n||ee||Kt,Ce=di||_t||pn||"?";return $t.Z.API_SERVER+"/api/attachments/"+Ln+Ce+"&t="+(0,He.Jn)(Ln,Date.now())+(Rn.indexOf(")")>-1?")":"&")}).replace(Ke,(Rn,$n,di,ee,_t)=>{const Kt=$n||ee,pn=di||_t||"";return'"'+$t.Z.API_SERVER+"/api/attachments/"+Kt+pn+Kt+pn+"&t="+(0,He.Jn)(Kt,Date.now())}).replace(Fe,(Rn,$n,di,ee,_t)=>{const Kt=$n||ee,pn=di||_t||"";return"("+$t.Z.API_SERVER+"/files/uploads/"+Kt+pn+Kt+pn+"&t="+(0,He.Jn)(Kt,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`),Ne)};var re=({value:Ne="",className:ue,showTextOnly:ke,showLines:Ke,style:Fe={},stylesPrev:wn={},highlightKeywords:Rn,showProgramFill:$n,isProgramFill:di,disabledFill:ee=!1,programFillValue:_t,onFillChange:Kt=Ce=>{},onFillBlur:pn=()=>{},onFillFocus:Ln=()=>{}})=>{let Ce=nt(String(Ne||""));const[sn,cn]=(0,It.useState)(""),[Jn,Sn]=(0,It.useState)("office"),[he,Te]=(0,It.useState)([]),Nn=(0,It.useRef)("a"+(0,Pe.Z)()),Bn={},Ht=Mn=>/<style[\s\S]*?>/i.test(Mn||""),Mt=(Mn,sr,Yi)=>{const Vr=document.createElement(Mn===zt?"input":"textarea");Vr.style.width="100%",Vr.style.height=Mn===zt?"40px":"151px",Vr.rows=5,Vr.spellcheck=!1,Vr.name="edu-program-fill",Vr.placeholder="\u8BF7\u8F93\u5165",Vr.dataset.id=sr;const Ci=Object.keys(Bn).length;return Bn[Ci]=Vr,`<span class="edu-program-fill-wrap ${Mn===zt?"":"show"}" style="width:${Mn===zt?"600px":"100%"}" title=${Yi||""}><span>${Vr.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function wt(Mn){return Mn=Mn.replace(/!\[.*?\]\(.*?\)/g,""),Mn=Mn.replace(/\[.*?\]\(.*?\)/g,""),Mn=Mn.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),Mn=Mn.replace(/<embed.*?>/g,""),Mn=Mn.replace(/<img.*?>/g,""),Mn=Mn.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),Mn=Mn.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),Mn=Mn.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),Mn=Mn.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),Mn}const At=Mn=>!ke&&Ht(Ce)?Mn:Mn.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(sr,Yi){let Vr=Yi.replace(/(\n|\r)/g,"").split("}"),Ci=[];return Vr.map(Us=>{Us!=""&&Ci.push(`.${Nn.current} ${Us}`)}),`<style>${Ci.join("}")}</style>`}),Ut=(0,It.useMemo)(()=>{try{const Vr=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Ci=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Us=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,is=/\(\/attachments\/download\//g;Ce=Ce.replace(is,"("+$t.Z.API_SERVER+"/attachments/download/").replace(Vr,"("+$t.Z.API_SERVER+"/api/attachments/").replace(Ci,'"'+$t.Z.API_SERVER+"/api/attachments/").replace(Us,'"'+$t.Z.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Vr){}if($n){let Vr=-1;return Ce=Ce.replaceAll("<","<").replaceAll(">",">").replace(/(@▁▁@|@▁@)/g,function(Ci,Us,is){var xo;return++Vr,Mt(Ci,Vr,(xo=_t==null?void 0:_t[Vr])==null?void 0:xo.value.replaceAll("<","<").replaceAll(">",">"))}),`<pre style="background:#fff;padding:4px">${At(Ce||"")}</pre>`}let Mn=At(Ce);Mn=(0,Be.ZP)(Mn);const sr=(0,Be.ez)();Ce.match(/\[TOC\]/)&&(Mn=Mn.replace("<p>[TOC]</p>",(0,Be.Qv)()),(0,Be.Iy)()),Mn=Mn.replace(/(__special_katext_id_\d+__)/g,(Vr,Ci)=>{const{type:Us,expression:is}=sr[Ci];return(0,ve.renderToString)(ie(is)||"",{displayMode:Us==="block",throwOnError:!1,output:"html"})}),Mn=Mn.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,Be.AL)();const Yi=document.createElement("div");if(Yi.innerHTML=Mn,ke)return Yi.innerText;if(Rn){const Vr=Rn.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return zi(Yi,Vr),Yi.innerHTML}return setTimeout(()=>Qi(),500),Yi.innerHTML},[Ce,Rn]);(0,It.useEffect)(()=>{yi.current&&yi.current.querySelectorAll(["input","textarea"]).forEach(sr=>{sr.oninput=Et,sr.onblur=be,sr.onfocus=Dn})},[he]),(0,It.useEffect)(()=>{var Mn,sr,Yi,Vr,Ci;if(_t!=null&&_t.length)try{const Us=yi.current.querySelectorAll(".edu-program-fill-score"),is=yi.current.querySelectorAll('[name="edu-program-fill"]');for(const[xo,zr]of is.entries())zr.value=((Mn=_t==null?void 0:_t[xo])==null?void 0:Mn.value)||"",((sr=_t==null?void 0:_t[xo])==null?void 0:sr.type)==="warning"?zr.className="program-fill-warning":((Yi=_t==null?void 0:_t[xo])==null?void 0:Yi.type)==="success"?zr.className="program-fill-success":zr.className="";for(const[xo,zr]of Us.entries())zr.innerHTML=(Vr=_t==null?void 0:_t[xo])!=null&&Vr.score?`${(Ci=_t==null?void 0:_t[xo])==null?void 0:Ci.score}\u5206`:"";Te(_t)}catch(Us){console.log(Us,"error")}},[_t]);const Et=Mn=>{he[Mn.target.dataset.id]=he[Mn.target.dataset.id]||{},he[Mn.target.dataset.id].value=Mn.target.value,Te([...he]),Kt(he,Mn.target.dataset.id)},be=Mn=>{he[Mn.target.dataset.id]=he[Mn.target.dataset.id]||{},he[Mn.target.dataset.id].value=Mn.target.value,Te([...he]),pn(he,Mn.target.dataset.id)},Dn=Mn=>{he[Mn.target.dataset.id]=he[Mn.target.dataset.id]||{},he[Mn.target.dataset.id].value=Mn.target.value,Te([...he]),Ln(he,Mn.target.dataset.id)};function zi(Mn,sr){return Mn.childNodes.forEach(Yi=>{var Vr;if(Yi.childNodes.length>0)zi(Yi,sr);else if(Yi.nodeName!=="IMG")if(Yi.innerHTML)Yi.innerHTML=(Vr=Yi.innerHTML)==null?void 0:Vr.replace(new RegExp(sr,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Ci=document.createElement("span");Ci.innerHTML=Yi.textContent.replace(new RegExp(sr,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),Yi.replaceWith(Ci)}})}const yi=(0,It.useRef)();Be.jb.WebkitLineClamp=Ke,Ke&&(Fe=Ct(Ct({},Fe),Be.jb));function ei(Mn){let sr=Mn.target;if(sr.tagName.toUpperCase()==="A"){let Yi=sr.getAttribute("href");if(Yi.indexOf("office")>-1)Mn.preventDefault(),cn(Yi),Sn("office");else if(Yi.indexOf("application/pdf")>-1)Mn.preventDefault(),cn(Yi),Sn("pdf");else if(Yi.indexOf("text/html")>-1)Mn.preventDefault(),cn(Yi),Sn("html");else if(Yi.startsWith("#")){Mn.preventDefault();let Vr=document.getElementById(Yi.replace("#",""));Vr&&Vr.scrollIntoView(!0)}}}const Qi=()=>{var Mn;const sr=(Mn=yi.current)==null?void 0:Mn.querySelectorAll("video");sr==null||sr.forEach(Yi=>{if(Yi.oncontextmenu=()=>!1,Yi.src.indexOf(".m3u8")>-1&&!Yi.canPlayType("application/vnd.apple.mpegurl")){if(de().isSupported()){var Vr=new(de());Vr.loadSource(Yi.src),Vr.attachMedia(Yi)}}})};return(0,It.useEffect)(()=>{if(yi.current&&Ut&&Ut.match(Qt)&&window.PR.prettyPrint(),yi.current)return yi.current.addEventListener("click",ei),()=>{var Mn;(Mn=yi.current)==null||Mn.removeEventListener("click",ei),(0,Be.AL)(),(0,Be.Iy)()}},[Ut,yi.current,ei]),(0,It.useEffect)(()=>{var Mn;const sr=Yi=>{Yi.preventDefault(),Yi.clipboardData.setData("text",window.getSelection().toString())};return(Mn=yi.current)==null||Mn.addEventListener("copy",sr),()=>{var Yi;(Yi=yi.current)==null||Yi.removeEventListener("copy",sr)}},[yi.current]),It.createElement(It.Fragment,null,ke&&It.createElement("div",{ref:yi},Ut),!ke&&!Ht(Ut)&&It.createElement("div",{ref:yi,style:Ct({},Fe),className:`${ue||""} ${ee?"disabled-fill":""} markdown-body ${Nn.current}`,dangerouslySetInnerHTML:{__html:Ut}}),!ke&&Ht(Ut)&&It.createElement(Nt,{html:Ut}),It.createElement(ze.Z,{close:!0,data:sn,type:sn!=null&&sn.length?Jn:"",style:Ct({},wn),onClose:()=>cn("")}))}},57444:function(on,In,Jt){"use strict";Jt.d(In,{h:function(){return Ct}});var It=Jt(67294),ce=Jt(88044),Be=Jt(91773),qe=Jt(85804),Se=Jt(4631),de=Jt.n(Se),$t=Jt(71749),He=Jt(30483),ve=Object.defineProperty,Pe=Object.defineProperties,ze=Object.getOwnPropertyDescriptors,Me=Object.getOwnPropertySymbols,tn=Object.prototype.hasOwnProperty,Nt=Object.prototype.propertyIsEnumerable,nt=(bt,zt,Qt)=>zt in bt?ve(bt,zt,{enumerable:!0,configurable:!0,writable:!0,value:Qt}):bt[zt]=Qt,et=(bt,zt)=>{for(var Qt in zt||(zt={}))tn.call(zt,Qt)&&nt(bt,Qt,zt[Qt]);if(Me)for(var Qt of Me(zt))Nt.call(zt,Qt)&&nt(bt,Qt,zt[Qt]);return bt},ht=(bt,zt)=>Pe(bt,ze(zt));const lt=ce.default.Option,pt={labelCol:{span:4},wrapperCol:{span:20}},vt={asp:["ASP","vbscript"],actionscript:["ActionScript(3.0)/Flash/Flex","clike"],bash:["Bash/Bat","shell"],css:["CSS","css"],c:["C","clike"],cpp:["C++","clike"],csharp:["C#","clike"],coffeescript:["CoffeeScript","coffeescript"],d:["D","d"],dart:["Dart","dart"],delphi:["Delphi/Pascal","pascal"],erlang:["Erlang","erlang"],go:["Golang","go"],groovy:["Groovy","groovy"],html:["HTML","text/html"],java:["Java","clike"],json:["JSON","text/json"],javascript:["Javascript","javascript"],lua:["Lua","lua"],less:["LESS","css"],markdown:["Markdown","gfm"],"objective-c":["Objective-C","clike"],php:["PHP","php"],perl:["Perl","perl"],python:["Python","python"],r:["R","r"],rst:["reStructedText","rst"],ruby:["Ruby","ruby"],sql:["SQL","sql"],sass:["SASS/SCSS","sass"],shell:["Shell","shell"],scala:["Scala","clike"],swift:["Swift","clike"],vb:["VB/VBScript","vb"],xml:["XML","text/xml"],yaml:["YAML","yaml"]};In.Z=({callback:bt,onCancel:zt})=>{const[Qt,ie]=(0,It.useState)("python");function oe(Ne){ie(vt[Ne][1])}function re(Ne){bt(Ne)}return It.createElement(Be.default,ht(et({},pt),{className:"code-block-panel",initialValues:{language:"python",content:""},onFinish:re,style:{width:500}}),It.createElement(Be.default.Item,{label:"\u4EE3\u7801\u8BED\u8A00",name:"language"},It.createElement(ce.default,{getPopupContainer:Ne=>Ne.parentNode,onChange:oe},Object.keys(vt).map(Ne=>It.createElement(lt,{key:Ne,value:Ne},vt[Ne][0])))),It.createElement(Be.default.Item,{label:"\u4EE3\u7801\u5185\u5BB9",name:"content",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u4EE3\u7801\u5185\u5BB9"}]},It.createElement(Ct,{mode:Qt})),It.createElement("div",{className:"flex-container flex-end"},It.createElement(qe.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),It.createElement(qe.ZP,{type:"ghost",onClick:zt},"\u53D6\u6D88")))};function Ct({value:bt,onChange:zt,mode:Qt,options:ie={}}){const oe=(0,It.useRef)(),[re,Ne]=(0,It.useState)();return(0,It.useEffect)(()=>{if(re){let ue=function(ke){const Ke=ke.getValue();zt&&zt(Ke)};return re.on("change",ue),()=>{re.off("change",ue)}}},[re,zt]),(0,It.useEffect)(()=>{re&&re.setOption("mode",Qt)},[re,Qt]),(0,It.useEffect)(()=>{re&&(bt!==re.getValue()||bt==="")&&setTimeout(()=>{re.setValue(bt||"")},300)},[re,bt]),(0,It.useEffect)(()=>{if(oe.current&&!re){const ue=de().fromTextArea(oe.current,et({mode:Qt,lineNumbers:!0,lineWrapping:!0,autoCloseBrackets:!0,tabSize:4,autofocus:!0,autoCloseTags:!0,matchBrackets:!0,styleActiveLine:!0},ie));Ne(ue)}},[oe.current,re]),It.createElement("div",{className:"my-codemirror-container"},It.createElement("textarea",{ref:oe}))}},35567:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return br}});var It=Jt(67294),ce=Jt(4631),Be=Jt.n(ce),qe=Jt(91033),Se=Jt(71749),de=Jt(57341),$t=Jt(82801),He=Jt(88386),ve=Jt(49047),Pe=Jt(80785),ze=Jt(65226),Me=({value:Le="",className:Ie,showTextOnly:le,showLines:Oe,style:On={}})=>{const Wn=(0,It.useMemo)(()=>"",[Le]);return It.createElement(It.Fragment,null,It.createElement("div",{dangerouslySetInnerHTML:{__html:Wn}}))},tn=Object.defineProperty,Nt=Object.defineProperties,nt=Object.getOwnPropertyDescriptors,et=Object.getOwnPropertySymbols,ht=Object.prototype.hasOwnProperty,lt=Object.prototype.propertyIsEnumerable,pt=(Le,Ie,le)=>Ie in Le?tn(Le,Ie,{enumerable:!0,configurable:!0,writable:!0,value:le}):Le[Ie]=le,vt=(Le,Ie)=>{for(var le in Ie||(Ie={}))ht.call(Ie,le)&&pt(Le,le,Ie[le]);if(et)for(var le of et(Ie))lt.call(Ie,le)&&pt(Le,le,Ie[le]);return Le},Ct=(Le,Ie)=>Nt(Le,nt(Ie));let bt=[{title:"\u7C97\u4F53",icon:"md-iconfont icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"md-iconfont icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"md-iconfont icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"md-iconfont icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"md-iconfont icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"md-iconfont icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"md-iconfont icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"md-iconfont icon-sum",actionName:"inline-latex"},{title:"\u6570\u5B66\u516C\u5F0F",icon:"iconfont icon-shuxuetuxiang2",actionName:"maths-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"md-iconfont icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"md-iconfont icon-picture",actionName:"upload-image"},{title:"\u63D2\u5165\u753B\u56FE",icon:"iconfont icon-sheji",actionName:"draw-image"},{title:"\u63D2\u5165\u6D41\u7A0B\u56FE",icon:"iconfont icon-liucheng",actionName:"add-flowchart"},{title:"\u8868\u683C",icon:"md-iconfont icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"md-iconfont icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"md-iconfont icon-eraser",actionName:"eraser"}];function zt({onActionCallback:Le,title:Ie,icon:le,actionName:Oe,className:On="",children:Wn}){function Mi(){Le(Oe)}return It.createElement("a",{title:Ie,className:On,onClick:Mi},It.createElement("i",{className:`${le}`}),Wn)}var Qt=({watch:Le,showNullButton:Ie,showNullProgramButton:le,onActionCallback:Oe,fullScreen:On,insertTemp:Wn,hidetoolBar:Mi,extraUse:xe})=>{const Xe=[...bt,{title:`${Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"}`,icon:`${Le?"md-iconfont icon-eye-slash":"md-iconfont icon-eye"}`,actionName:"trigger-watch"}];return It.createElement("ul",{className:"markdown-toolbar-container"},!Mi&&Xe.map((Zn,Oi)=>It.createElement("li",{key:Oi},Zn.actionName?It.createElement(zt,Ct(vt({},Zn),{onActionCallback:Oe})):It.createElement("span",{className:"v-line"}))),Ie?It.createElement("li",null,It.createElement(zt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Oe},It.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,le?It.createElement(It.Fragment,null,It.createElement("li",null,It.createElement(zt,{icon:"md-iconfont icon-edit insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-signal",onActionCallback:Oe},It.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u5355\u884C\u586B\u7A7A\u9879"))),It.createElement("li",null,It.createElement(zt,{icon:"md-iconfont icon-uniE900 insert-blank",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-multiple",onActionCallback:Oe},It.createElement("span",{className:"fill-tip"},"\u6DFB\u52A0\u591A\u884C\u586B\u7A7A\u9879")))):null,Wn&&It.createElement("li",null,It.createElement(zt,{icon:"md-iconfont icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:`inster-template-${Wn}`,onActionCallback:Oe},It.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),xe&&It.createElement("li",null,xe),It.createElement("li",{className:"btn-full-screen"},It.createElement(zt,{icon:`${On?"md-iconfont icon-shrink":"md-iconfont icon-enlarge"}`,title:On?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Oe})))},ie=Jt(76621),oe=Jt(91773),re=Jt(28802),Ne=Jt(85804),ue=Object.defineProperty,ke=Object.defineProperties,Ke=Object.getOwnPropertyDescriptors,Fe=Object.getOwnPropertySymbols,wn=Object.prototype.hasOwnProperty,Rn=Object.prototype.propertyIsEnumerable,$n=(Le,Ie,le)=>Ie in Le?ue(Le,Ie,{enumerable:!0,configurable:!0,writable:!0,value:le}):Le[Ie]=le,di=(Le,Ie)=>{for(var le in Ie||(Ie={}))wn.call(Ie,le)&&$n(Le,le,Ie[le]);if(Fe)for(var le of Fe(Ie))Rn.call(Ie,le)&&$n(Le,le,Ie[le]);return Le},ee=(Le,Ie)=>ke(Le,Ke(Ie));const _t={labelCol:{span:4},wrapperCol:{span:20}};var Kt=({callback:Le,onCancel:Ie})=>{function le(Oe){Le(Oe)}return It.createElement(oe.default,ee(di({},_t),{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:le,style:{width:500}}),It.createElement(oe.default.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},It.createElement(re.default,null)),It.createElement(oe.default.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},It.createElement(re.default,null)),It.createElement("div",{className:"flex-container flex-end"},It.createElement(Ne.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),It.createElement(Ne.ZP,{type:"ghost",onClick:Ie},"\u53D6\u6D88")))},pn=Jt(57444),Ln=Jt(70859),Ce=Jt(62844),sn=Jt(71230),cn=Jt(63205),Jn=Jt(67294),Sn=({callback:Le,onCancel:Ie})=>{const le=document.createElement("canvas"),Oe=le.getContext("2d");le.width=1e3,le.height=800,Oe.fillStyle="#ffffff",Oe.fillRect(0,0,le.width,le.height);const On=le.toDataURL("image/png");return Jn.createElement(Ce.default,{open:!0,width:"100vw",style:{height:"100vh",top:0},footer:null,title:null,closable:!1},Jn.createElement(sn.Z,{style:{height:"100vh"}},Jn.createElement(cn.Z,{fullWidth:!0,noAssociationId:!0,showFullTools:!0,data:{src:On,visible:!0,title:String(Date.now())},onOk:Wn=>{Le({src:Wn.url})},onClose:Ie})))},he=Jt(23495);function Te(){go.CommandHandler.call(this),this._arrowKeyBehavior="move",this._pasteOffset=new go.Point(10,10),this._lastPasteOffset=new go.Point(0,0)}go.Diagram.inherit(Te,go.CommandHandler),Te.prototype.canAlignSelection=function(){var Le=this.diagram;return!(Le===null||Le.isReadOnly||Le.isModelReadOnly||Le.selection.count<2)},Te.prototype.alignLeft=function(){var Le=this.diagram;Le.startTransaction("aligning left");var Ie=1/0;Le.selection.each(function(le){le instanceof go.Link||(Ie=Math.min(le.position.x,Ie))}),Le.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(Ie,le.position.y))}),Le.commitTransaction("aligning left")},Te.prototype.alignRight=function(){var Le=this.diagram;Le.startTransaction("aligning right");var Ie=-1/0;Le.selection.each(function(le){if(!(le instanceof go.Link)){var Oe=le.actualBounds.x+le.actualBounds.width;Ie=Math.max(Oe,Ie)}}),Le.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(Ie-le.actualBounds.width,le.position.y))}),Le.commitTransaction("aligning right")},Te.prototype.alignTop=function(){var Le=this.diagram;Le.startTransaction("alignTop");var Ie=1/0;Le.selection.each(function(le){le instanceof go.Link||(Ie=Math.min(le.position.y,Ie))}),Le.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(le.position.x,Ie))}),Le.commitTransaction("alignTop")},Te.prototype.alignBottom=function(){var Le=this.diagram;Le.startTransaction("aligning bottom");var Ie=-1/0;Le.selection.each(function(le){if(!(le instanceof go.Link)){var Oe=le.actualBounds.y+le.actualBounds.height;Ie=Math.max(Oe,Ie)}}),Le.selection.each(function(le){le instanceof go.Link||le.move(new go.Point(le.actualBounds.x,Ie-le.actualBounds.height))}),Le.commitTransaction("aligning bottom")},Te.prototype.alignCenterX=function(){var Le=this.diagram,Ie=Le.selection.first();if(Ie){Le.startTransaction("aligning Center X");var le=Ie.actualBounds.x+Ie.actualBounds.width/2;Le.selection.each(function(Oe){Oe instanceof go.Link||Oe.move(new go.Point(le-Oe.actualBounds.width/2,Oe.actualBounds.y))}),Le.commitTransaction("aligning Center X")}},Te.prototype.alignCenterY=function(){var Le=this.diagram,Ie=Le.selection.first();if(Ie){Le.startTransaction("aligning Center Y");var le=Ie.actualBounds.y+Ie.actualBounds.height/2;Le.selection.each(function(Oe){Oe instanceof go.Link||Oe.move(new go.Point(Oe.actualBounds.x,le-Oe.actualBounds.height/2))}),Le.commitTransaction("aligning Center Y")}},Te.prototype.alignColumn=function(Le){var Ie=this.diagram;Ie.startTransaction("align Column"),Le===void 0&&(Le=0),Le=parseFloat(Le);var le=new Array;Ie.selection.each(function(xe){xe instanceof go.Link||le.push(xe)});for(var Oe=0;Oe<le.length-1;Oe++){var On=le[Oe],Wn=On.actualBounds.y+On.actualBounds.height+Le,Mi=le[Oe+1];Mi.move(new go.Point(On.actualBounds.x,Wn))}Ie.commitTransaction("align Column")},Te.prototype.alignRow=function(Le){Le===void 0&&(Le=0),Le=parseFloat(Le);var Ie=this.diagram;Ie.startTransaction("align Row");var le=new Array;Ie.selection.each(function(xe){xe instanceof go.Link||le.push(xe)});for(var Oe=0;Oe<le.length-1;Oe++){var On=le[Oe],Wn=On.actualBounds.x+On.actualBounds.width+Le,Mi=le[Oe+1];Mi.move(new go.Point(Wn,On.actualBounds.y))}Ie.commitTransaction("align Row")},Te.prototype.canRotate=function(Le){var Ie=this.diagram;return!(Ie===null||Ie.isReadOnly||Ie.isModelReadOnly||Ie.selection.count<1)},Te.prototype.rotate=function(Le){Le===void 0&&(Le=90);var Ie=this.diagram;Ie.startTransaction("rotate "+Le.toString());var Ie=this.diagram;Ie.selection.each(function(le){le instanceof go.Link||le instanceof go.Group||(le.angle+=Le)}),Ie.commitTransaction("rotate "+Le.toString())},Te.prototype.pullToFront=function(){var Le=this.diagram;Le.startTransaction("pullToFront");var Ie=new go.Map;Le.selection.each(function(le){Ie.set(le.layer,0)}),Ie.iteratorKeys.each(function(le){var Oe=0;le.parts.each(function(On){if(!On.isSelected){var Wn=On.zOrder;isNaN(Wn)?On.zOrder=0:Oe=Math.max(Oe,Wn)}}),Ie.set(le,Oe)}),Le.selection.each(function(le){Te._assignZOrder(le,Ie.get(le.layer)+1)}),Le.commitTransaction("pullToFront")},Te.prototype.pushToBack=function(){var Le=this.diagram;Le.startTransaction("pushToBack");var Ie=new go.Map;Le.selection.each(function(le){Ie.set(le.layer,0)}),Ie.iteratorKeys.each(function(le){var Oe=0;le.parts.each(function(On){if(!On.isSelected){var Wn=On.zOrder;isNaN(Wn)?On.zOrder=0:Oe=Math.min(Oe,Wn)}}),Ie.set(le,Oe)}),Le.selection.each(function(le){Te._assignZOrder(le,Ie.get(le.layer)-1-Te._findGroupDepth(le))}),Le.commitTransaction("pushToBack")},Te._assignZOrder=function(Le,Ie,le){le===void 0&&(le=Le),Le.layer===le.layer&&(Le.zOrder=Ie),Le instanceof go.Group&&Le.memberParts.each(function(Oe){Te._assignZOrder(Oe,Ie+1,le)})},Te._findGroupDepth=function(Le){if(Le instanceof go.Group){var Ie=0;return Le.memberParts.each(function(le){Ie=Math.max(Ie,Te._findGroupDepth(le))}),Ie+1}else return 0},Te.prototype.doKeyDown=function(){var Le=this.diagram;if(Le!==null){var Ie=Le.lastInput;if(Ie.key==="Up"||Ie.key==="Down"||Ie.key==="Left"||Ie.key==="Right"){var le=this.arrowKeyBehavior;if(le==="none")return;if(le==="select"){this._arrowKeySelect();return}else if(le==="move"){this._arrowKeyMove();return}else if(le==="tree"){this._arrowKeyTree();return}}go.CommandHandler.prototype.doKeyDown.call(this)}},Te.prototype._getAllParts=function(){var Le=new Array;return this.diagram.nodes.each(function(Ie){Le.push(Ie)}),this.diagram.parts.each(function(Ie){Le.push(Ie)}),Le},Te.prototype._arrowKeyMove=function(){var Le=this.diagram,Ie=Le.lastInput,le=0,Oe=0;if(Ie.control||Ie.meta)le=1,Oe=1;else if(Le.grid!==null){var On=Le.grid.gridCellSize;Oe=On.width,le=On.height}Le.startTransaction("arrowKeyMove"),Le.selection.each(function(Wn){Ie.key==="Up"?Wn.move(new go.Point(Wn.actualBounds.x,Wn.actualBounds.y-le)):Ie.key==="Down"?Wn.move(new go.Point(Wn.actualBounds.x,Wn.actualBounds.y+le)):Ie.key==="Left"?Wn.move(new go.Point(Wn.actualBounds.x-Oe,Wn.actualBounds.y)):Ie.key==="Right"&&Wn.move(new go.Point(Wn.actualBounds.x+Oe,Wn.actualBounds.y))}),Le.commitTransaction("arrowKeyMove")},Te.prototype._arrowKeySelect=function(){var Le=this.diagram,Ie=Le.lastInput,le=null;Ie.key==="Up"?le=this._findNearestPartTowards(270):Ie.key==="Down"?le=this._findNearestPartTowards(90):Ie.key==="Left"?le=this._findNearestPartTowards(180):Ie.key==="Right"&&(le=this._findNearestPartTowards(0)),le!==null&&(Ie.shift?le.isSelected=!0:Ie.control||Ie.meta?le.isSelected=!le.isSelected:Le.select(le))},Te.prototype._findNearestPartTowards=function(Le){var Ie=this.diagram.selection.first();if(Ie===null)return null;for(var le=Ie.actualBounds.center,Oe=this._getAllParts(),On=1/0,Wn=Ie,Mi=0;Mi<Oe.length;Mi++){var xe=Oe[Mi];if(xe!==Ie&&xe.canSelect()){var Xe=xe.actualBounds.center,Zn=le.directionPoint(Xe),Oi=this._angleCloseness(Zn,Le);if(Oi<=45){var an=le.distanceSquaredPoint(Xe);an*=1+Math.sin(Oi*Math.PI/180),an<On&&(On=an,Wn=xe)}}}return Wn},Te.prototype._angleCloseness=function(Le,Ie){return Math.min(Math.abs(Ie-Le),Math.min(Math.abs(Ie+360-Le),Math.abs(Ie-360-Le)))},Te.prototype._arrowKeyTree=function(){var Le=this.diagram,Ie=Le.selection.first();if(Ie instanceof go.Node){var le=Le.lastInput;if(le.key==="Right"){if(!Ie.isTreeLeaf)if(!Ie.isTreeExpanded)Le.commandHandler.canExpandTree(Ie)&&Le.commandHandler.expandTree(Ie);else{var Oe=this._sortTreeChildrenByY(Ie).first();Oe!==null&&Le.select(Oe)}}else if(le.key==="Left")if(!Ie.isTreeLeaf&&Ie.isTreeExpanded)Le.commandHandler.canCollapseTree(Ie)&&Le.commandHandler.collapseTree(Ie);else{var On=Ie.findTreeParentNode();On!==null&&Le.select(On)}else if(le.key==="Up"){var On=Ie.findTreeParentNode();if(On!==null){var Wn=this._sortTreeChildrenByY(On),Mi=Wn.indexOf(Ie);if(Mi>0){for(var xe=Wn.elt(Mi-1);xe!==null&&xe.isTreeExpanded&&!xe.isTreeLeaf;){var Xe=this._sortTreeChildrenByY(xe);xe=Xe.last()}xe!==null&&Le.select(xe)}else Le.select(On)}}else if(le.key==="Down")if(Ie.isTreeExpanded&&!Ie.isTreeLeaf){var Oe=this._sortTreeChildrenByY(Ie).first();Oe!==null&&Le.select(Oe)}else for(;Ie!==null;){var On=Ie.findTreeParentNode();if(On===null)break;var Wn=this._sortTreeChildrenByY(On),Mi=Wn.indexOf(Ie);if(Mi<Wn.length-1){Le.select(Wn.elt(Mi+1));break}else Ie=On}var Zn=Le.selection.first();Zn!==null&&Le.scrollToRect(Zn.actualBounds)}},Te.prototype._sortTreeChildrenByY=function(Le){var Ie=new go.List().addAll(Le.findTreeChildrenNodes());return Ie.sort(function(le,Oe){var On=le.location,Wn=Oe.location;return On.y<Wn.y?-1:On.y>Wn.y?1:On.x<Wn.x?-1:On.x>Wn.x?1:0}),Ie},Te.prototype.copyToClipboard=function(Le){go.CommandHandler.prototype.copyToClipboard.call(this,Le),this._lastPasteOffset.set(this.pasteOffset)},Te.prototype.pasteFromClipboard=function(){var Le=go.CommandHandler.prototype.pasteFromClipboard.call(this);return this.diagram.moveParts(Le,this._lastPasteOffset),this._lastPasteOffset.add(this.pasteOffset),Le},Object.defineProperty(Te.prototype,"arrowKeyBehavior",{get:function(){return this._arrowKeyBehavior},set:function(Le){if(Le!=="move"&&Le!=="select"&&Le!=="scroll"&&Le!=="tree"&&Le!=="none")throw new Error('DrawCommandHandler.arrowKeyBehavior must be either "move", "select", "scroll", "tree", or "none", not: '+Le);this._arrowKeyBehavior=Le}}),Object.defineProperty(Te.prototype,"pasteOffset",{get:function(){return this._pasteOffset},set:function(Le){if(!(Le instanceof go.Point))throw new Error("DrawCommandHandler.pasteOffset must be a Point, not: "+Le);this._pasteOffset.set(Le)}});var Nn=Te,Bn=Jt(18023),Ht=Jt(15746),Mt=Jt(33170),wt={myPaletteDiv:"myPaletteDiv___Xjz2I",flowChartWrp:"flowChartWrp____f45r",maxH60:"maxH60___Pd4Re"},At=Jt(52262),Ut=Jt(67294),Et=(Le,Ie,le)=>new Promise((Oe,On)=>{var Wn=Xe=>{try{xe(le.next(Xe))}catch(Zn){On(Zn)}},Mi=Xe=>{try{xe(le.throw(Xe))}catch(Zn){On(Zn)}},xe=Xe=>Xe.done?Oe(Xe.value):Promise.resolve(Xe.value).then(Wn,Mi);xe((le=le.apply(Le,Ie)).next())});function be({onCancel:Le,callback:Ie}){let le=(0,It.useRef)(),Oe=(0,It.useRef)(),On=(0,It.useRef)(),Wn=(0,It.useRef)(!1);const Mi=(0,It.useRef)(!1),[xe,Xe]=(0,It.useState)(0);function Zn(){const an=he.bx.make,fe={red:"#ff3333",blue:"#3358ff",green:"#25ad23",magenta:"#d533ff",purple:"#7d33ff",orange:"#ff6233",brown:"#8e571e",white:"#ffffff",black:"#000000",beige:"#fffcd5",extralightblue:"#d5ebff",extralightred:"#f2dfe0",lightblue:"#a5d2fa",lightgray:"#cccccc",lightgreen:"#b3e6b3",lightred:"#fcbbbd"};le.current=new he.S0(Oe.current,{padding:20,grid:an(he.s_,"Grid",an(he.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),an(he.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),"draggingTool.isGridSnapEnabled":!0,handlesDragDropForTopLevelParts:!0,mouseDrop:me=>{var xi=me.diagram.commandHandler.addTopLevelParts(me.diagram.selection,!0);xi||me.diagram.currentTool.doCancel()},commandHandler:an(Nn),"clickCreatingTool.archetypeNodeData":{text:"\u672A\u547D\u540D",fill:null,stroke:null,borderColor:"rgba(0,0,0,0)"},PartCreated:me=>{var xi=me.subject;xi.location=xi.location.copy().snapToGridPoint(me.diagram.grid.gridOrigin,me.diagram.grid.gridCellSize),setTimeout(()=>{me.diagram.commandHandler.editTextBlock()},20)},"commandHandler.archetypeGroupData":{isGroup:!0,text:"NEW GROUP"},SelectionGrouped:me=>{var xi=me.subject;setTimeout(()=>{me.diagram.commandHandler.editTextBlock()})},LinkRelinked:me=>{var xi=me.parameter.part;xi.invalidateConnectedLinks();var gr=me.subject;me.diagram.toolManager.linkingTool.isForwards?gr.toNode.invalidateConnectedLinks():gr.fromNode.invalidateConnectedLinks()},"undoManager.isEnabled":!0}),le.current.nodeTemplate=an(he.NB,"Auto",{locationSpot:he.z6.Center,locationObjectName:"SHAPE",desiredSize:new he.$u(120,60),minSize:new he.$u(40,40),resizable:!0,resizeCellSize:new he.$u(10,10),rotatable:!0},new he.KX("location","loc",he.E9.parse).makeTwoWay(he.E9.stringify),new he.KX("desiredSize","size",he.$u.parse).makeTwoWay(he.$u.stringify),an(he.bn,{name:"SHAPE",fill:fe.white,cursor:"pointer",portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:he.z6.AllSides,toSpot:he.z6.AllSides},new he.KX("figure"),new he.KX("fill"),new he.KX("stroke","borderColor"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),an(he.bn,{width:100,height:20,strokeWidth:0,fill:"transparent"}),an(he.al,{margin:1,textAlign:"center",overflow:he.al.OverflowEllipsis,editable:!0},new he.KX("text").makeTwoWay(),new he.KX("stroke","color"))),le.current.nodeTemplate.toolTip=an("ToolTip",an(he.s_,"Vertical",{maxSize:new he.$u(200,NaN)},an(he.al,{font:"bold 10pt sans-serif",textAlign:"center"},new he.KX("text")),an(he.al,{font:"10pt sans-serif",textAlign:"center"},new he.KX("text","details"))));function An(me,xi){var gr=(ai,ho)=>{ai.handled=!0,ai.diagram.model.commit(pr=>{var Sr=ho.part.adornedPart,lr=new he.E9().setRectSpot(Sr.actualBounds,me);lr.subtract(Sr.location),lr.scale(2,2),lr.x+=Math.sign(lr.x)*130,lr.y+=Math.sign(lr.y)*130,lr.add(Sr.location),lr.snapToGridPoint(ai.diagram.grid.gridOrigin,ai.diagram.grid.gridCellSize);var ur=pr.copyNodeData(Sr.data);pr.setGroupKeyForNodeData(ur,pr.getGroupKeyForNodeData(Sr.data)),pr.addNodeData(ur);var Wr={from:Sr.key,to:pr.getKeyForNodeData(ur)};pr.addLinkData(Wr);var Ve=ai.diagram.findNodeForData(ur);Ve.location=lr,ai.diagram.select(Ve),setTimeout(()=>{ai.diagram.commandHandler.editTextBlock()},20)})};return an(he.bn,{figure:xi,alignment:me,alignmentFocus:me.opposite(),width:me.equals(he.z6.Top)||me.equals(he.z6.Bottom)?25:18,height:me.equals(he.z6.Top)||me.equals(he.z6.Bottom)?18:25,fill:"orange",stroke:fe.white,strokeWidth:4,mouseEnter:(ai,ho)=>ho.fill="dodgerblue",mouseLeave:(ai,ho)=>ho.fill="orange",isActionable:!0,click:gr,contextClick:gr})}function ri(me){return an(he.bn,{fill:"orange",stroke:"rgba(0, 0, 0, 0)",strokeWidth:15,background:"transparent",geometryString:"F1 M0 0 b 0 360 -4 0 4 z M10 0 b 0 360 -4 0 4 z M20 0 b 0 360 -4 0 4",isActionable:!0,cursor:"context-menu",mouseEnter:(xi,gr)=>gr.fill="dodgerblue",mouseLeave:(xi,gr)=>gr.fill="orange",click:(xi,gr)=>{xi.diagram.commandHandler.showContextMenu(gr.part.adornedPart)}},me||{})}le.current.nodeTemplate.selectionAdornmentTemplate=an(he.uz,"Spot",an(he.Vm,{padding:10}),An(he.z6.Top,"TriangleUp"),An(he.z6.Left,"TriangleLeft"),An(he.z6.Right,"TriangleRight"),An(he.z6.Bottom,"TriangleDown"),ri({alignment:new he.z6(.75,0)}));function Ki(me,xi){return(gr,ai)=>{gr.handled=!0,gr.diagram.model.commit(ho=>{ho.set(ai.part.adornedPart.data,me,xi)})}}function Ue(me,xi){return xi||(xi="color"),an(he.bn,{width:16,height:16,stroke:"lightgray",fill:me,margin:1,background:"transparent",mouseEnter:(gr,ai)=>ai.stroke="dodgerblue",mouseLeave:(gr,ai)=>ai.stroke="lightgray",click:Ki(xi,me),contextClick:Ki(xi,me)})}function Gn(){return[an("ContextMenuButton",an(he.s_,"Horizontal",Ue(fe.white,"fill"),Ue(fe.beige,"fill"),Ue(fe.extralightblue,"fill"),Ue(fe.extralightred,"fill"))),an("ContextMenuButton",an(he.s_,"Horizontal",Ue(fe.lightgray,"fill"),Ue(fe.lightgreen,"fill"),Ue(fe.lightblue,"fill"),Ue(fe.lightred,"fill")))]}function uo(){return[an("ContextMenuButton",an(he.s_,"Horizontal",Ue(fe.black),Ue(fe.green),Ue(fe.blue),Ue(fe.red))),an("ContextMenuButton",an(he.s_,"Horizontal",Ue(fe.white),Ue(fe.magenta),Ue(fe.purple),Ue(fe.orange)))]}function zo(me,xi){return xi||(xi="thickness"),an(he.bn,"LineH",{width:16,height:16,strokeWidth:me,margin:1,background:"transparent",mouseEnter:(gr,ai)=>ai.background="dodgerblue",mouseLeave:(gr,ai)=>ai.background="transparent",click:Ki(xi,me),contextClick:Ki(xi,me)})}function $r(me,xi){return xi||(xi="dash"),an(he.bn,"LineH",{width:24,height:16,strokeWidth:2,strokeDashArray:me,margin:1,background:"transparent",mouseEnter:(gr,ai)=>ai.background="dodgerblue",mouseLeave:(gr,ai)=>ai.background="transparent",click:Ki(xi,me),contextClick:Ki(xi,me)})}function Kn(){return[an("ContextMenuButton",an(he.s_,"Horizontal",zo(1),zo(2),zo(3),zo(4))),an("ContextMenuButton",an(he.s_,"Horizontal",$r(null),$r([2,4]),$r([4,4])))]}function zn(me,xi){return xi||(xi="figure"),an(he.bn,{width:32,height:32,scale:.5,fill:"lightgray",figure:me,margin:1,background:"transparent",mouseEnter:(gr,ai)=>ai.fill="dodgerblue",mouseLeave:(gr,ai)=>ai.fill="lightgray",click:Ki(xi,me),contextClick:Ki(xi,me)})}le.current.nodeTemplate.contextMenu=an("ContextMenu",an("ContextMenuButton",an(he.s_,"Horizontal",zn("Rectangle"),zn("RoundedRectangle"),zn("Ellipse"),zn("Diamond"))),an("ContextMenuButton",an(he.s_,"Horizontal",zn("Parallelogram2"),zn("ManualOperation"),zn("Procedure"),zn("Cylinder1"))),an("ContextMenuButton",an(he.s_,"Horizontal",zn("Terminator"),zn("CreateRequest"),zn("Document"),zn("TriangleDown"))),Gn(),uo(),Kn()),le.current.groupTemplate=an(he.ZA,"Spot",{layerName:"Background",ungroupable:!0,locationSpot:he.z6.Center,selectionObjectName:"BODY",computesBoundsAfterDrag:!0,handlesDragDropForMembers:!0,mouseDrop:(me,xi)=>{var gr=xi.addMembers(xi.diagram.selection,!0);gr||xi.diagram.currentTool.doCancel()},avoidable:!1},new he.KX("location","loc",he.E9.parse).makeTwoWay(he.E9.stringify),an(he.s_,"Auto",{name:"BODY"},an(he.bn,{parameter1:10,fill:fe.white,strokeWidth:2,cursor:"pointer",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromSpot:he.z6.AllSides,toSpot:he.z6.AllSides},new he.KX("fill"),new he.KX("stroke","color"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),an(he.Vm,{background:"transparent",margin:20})),an(he.al,{alignment:he.z6.Top,alignmentFocus:he.z6.Bottom,font:"bold 12pt sans-serif",editable:!0},new he.KX("text"),new he.KX("stroke","color"))),le.current.groupTemplate.selectionAdornmentTemplate=an(he.uz,"Spot",an(he.s_,"Auto",an(he.bn,{fill:null,stroke:"dodgerblue",strokeWidth:3}),an(he.Vm,{margin:1.5})),ri({alignment:he.z6.TopRight,alignmentFocus:he.z6.BottomRight})),le.current.groupTemplate.contextMenu=an("ContextMenu",Gn(),uo(),Kn()),le.current.linkTemplate=an(he.rU,{layerName:"Foreground",routing:he.rU.AvoidsNodes,corner:10,fromShortLength:10,toShortLength:15,relinkableFrom:!0,relinkableTo:!0,reshapable:!0,resegmentable:!0},new he.KX("fromSpot","fromSpot",he.z6.parse),new he.KX("toSpot","toSpot",he.z6.parse),new he.KX("fromShortLength","dir",me=>me>=1?10:0),new he.KX("toShortLength","dir",me=>me>=1?10:0),new he.KX("points").makeTwoWay(),an(he.bn,{strokeWidth:2},new he.KX("stroke","color"),new he.KX("strokeWidth","thickness"),new he.KX("strokeDashArray","dash")),an(he.bn,{segmentIndex:0,segmentOffset:new he.E9(15,0),segmentOrientation:he.rU.OrientAlong,alignmentFocus:he.z6.Right,figure:"circle",width:10,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",me=>me===1)),an(he.bn,{segmentIndex:-1,segmentOffset:new he.E9(-10,6),segmentOrientation:he.rU.OrientPlus90,alignmentFocus:he.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",me=>me>=1),new he.KX("width","thickness",me=>7+3*me),new he.KX("height","thickness",me=>7+3*me),new he.KX("segmentOffset","thickness",me=>new he.E9(-15,4+1.5*me))),an(he.bn,{segmentIndex:0,segmentOffset:new he.E9(15,-6),segmentOrientation:he.rU.OrientMinus90,alignmentFocus:he.z6.Right,figure:"triangle",width:12,height:12,strokeWidth:0},new he.KX("fill","color"),new he.KX("visible","dir",me=>me===2),new he.KX("width","thickness",me=>7+3*me),new he.KX("height","thickness",me=>7+3*me),new he.KX("segmentOffset","thickness",me=>new he.E9(-15,4+1.5*me))),an(he.al,{alignmentFocus:new he.z6(0,1,-4,0),editable:!0},new he.KX("text").makeTwoWay(),new he.KX("stroke","color"))),le.current.linkTemplate.selectionAdornmentTemplate=an(he.uz,an(he.bn,{isPanelMain:!0,stroke:"transparent",strokeWidth:6,pathPattern:qn(2)},new he.KX("pathPattern","thickness",qn)),ri({alignmentFocus:new he.z6(0,0,-6,-4)}));function qn(me){return an(he.bn,{stroke:"dodgerblue",strokeWidth:2,strokeCap:"square",geometryString:"M0 0 M4 2 H3 M4 "+(me+4).toString()+" H3"})}function Ir(me){var xi="M0 0 M8 16 M0 8 L16 8 M12 11 L16 8 L12 5";return me===0?xi="M0 0 M16 16 M0 8 L16 8":me===2&&(xi="M0 0 M16 16 M0 8 L16 8 M12 11 L16 8 L12 5 M4 11 L0 8 L4 5"),an(he.bn,{geometryString:xi,margin:2,background:"transparent",mouseEnter:(gr,ai)=>ai.background="dodgerblue",mouseLeave:(gr,ai)=>ai.background="transparent",click:Ki("dir",me),contextClick:Ki("dir",me)})}function no(me){var xi=(gr,ai)=>{gr.handled=!0,gr.diagram.model.commit(ho=>{var pr=ai.part.adornedPart;ho.set(pr.data,me?"toSpot":"fromSpot",he.z6.stringify(he.z6.AllSides)),(me?pr.toNode:pr.fromNode).invalidateConnectedLinks()})};return an(he.bn,{width:12,height:12,fill:"transparent",mouseEnter:(gr,ai)=>ai.background="dodgerblue",mouseLeave:(gr,ai)=>ai.background="transparent",click:xi,contextClick:xi})}function hn(me,xi){var gr=0,ai=he.z6.RightSide;me.equals(he.z6.Top)?(gr=270,ai=he.z6.TopSide):me.equals(he.z6.Left)?(gr=180,ai=he.z6.LeftSide):me.equals(he.z6.Bottom)&&(gr=90,ai=he.z6.BottomSide),xi||(gr-=180);var ho=(pr,Sr)=>{pr.handled=!0,pr.diagram.model.commit(lr=>{var ur=Sr.part.adornedPart;lr.set(ur.data,xi?"toSpot":"fromSpot",he.z6.stringify(ai)),(xi?ur.toNode:ur.fromNode).invalidateConnectedLinks()})};return an(he.bn,{alignment:me,alignmentFocus:me.opposite(),geometryString:"M0 0 M12 12 M12 6 L1 6 L4 4 M1 6 L4 8",angle:gr,background:"transparent",mouseEnter:(pr,Sr)=>Sr.background="dodgerblue",mouseLeave:(pr,Sr)=>Sr.background="transparent",click:ho,contextClick:ho})}le.current.linkTemplate.contextMenu=an("ContextMenu",uo(),Kn(),an("ContextMenuButton",an(he.s_,"Horizontal",Ir(0),Ir(1),Ir(2))),an("ContextMenuButton",an(he.s_,"Horizontal",an(he.s_,"Spot",no(!1),hn(he.z6.Top,!1),hn(he.z6.Left,!1),hn(he.z6.Right,!1),hn(he.z6.Bottom,!1)),an(he.s_,"Spot",{margin:new he.Zt(0,0,0,2)},no(!0),hn(he.z6.Top,!0),hn(he.z6.Left,!0),hn(he.z6.Right,!0),hn(he.z6.Bottom,!0)))));const ci=`{ "class": "GraphLinksModel",
|
|
"nodeDataArray": [
|
|
{"text":"Find Problem","key":-9,"loc":"-20 -140","color":"#3358ff","fill":"white","figure":"Procedure","thickness":3},
|
|
{"text":"What do we want?","key":-10,"loc":"-65 -324.305","group":-16,"figure":"Ellipse","fill":"white"},
|
|
{"text":"What do our users want?","key":-11,"loc":"105 -334.305","group":-20,"figure":"Ellipse","fill":"#ffffff","color":"black"},
|
|
{"text":"Meetings","key":-12,"loc":"-65 -444.305","group":-16,"figure":"TriangleDown","fill":"#ffffff"},
|
|
{"text":"Reviews","key":-13,"loc":"105 -454.305","group":-20,"figure":"TriangleDown","fill":"#ffffff","color":"black"},
|
|
{"text":"Can we solve it?","key":-14,"loc":"190 -140","color":"#7d33ff","fill":"#ffffff","figure":"Diamond","size":"140 80","thickness":3},
|
|
{"isGroup":true,"text":"Internal","key":-16,"loc":"-65 -384.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
|
|
{"isGroup":true,"text":"External","key":-20,"loc":"105 -394.305","fill":"#d5ebff","dash":null,"thickness":1,"group":-22},
|
|
{"isGroup":true,"text":"Sources","key":-22,"loc":"20 -400","fill":"#a5d2fa","dash":[4,4],"color":"#3358ff"}
|
|
],
|
|
"linkDataArray": [
|
|
{"from":-12,"to":-10,"points":[-65,-414.305,-65,-404.305,-65,-384.305,-65,-384.305,-65,-364.305,-65,-354.305],"dash":null,"dir":1},
|
|
{"from":-13,"to":-11,"points":[105,-424.305,105,-414.305,105,-394.305,105,-394.305,105,-374.305,105,-364.305],"dash":null,"color":"#000000","dir":1},
|
|
{"from":-10,"to":-9,"points":[-65,-294.305,-65,-284.305,-65,-232.1525,-40,-232.1525,-40,-180,-40,-170],"dir":2,"dash":[4,4]},
|
|
{"from":-11,"to":-9,"points":[105,-304.305,105,-294.305,105,-237.1525,0,-237.1525,0,-180,0,-170],"dash":[4,4],"dir":2},
|
|
{"from":-9,"to":-14,"points":[40,-150,58,-150,80,-150,80,-153.33333333333331,102,-153.33333333333331,120,-153.33333333333331],"dir":1,"color":"#3358ff"},
|
|
{"from":-14,"to":-9,"points":[190,-100,190,-90,-20,-90,-20,-95,-20,-100,-20,-110],"fromSpot":"BottomSide","toSpot":"BottomSide","text":"No","color":"#ff3333","thickness":2,"dir":1},
|
|
{"from":-9,"to":-14,"points":[40,-130,58,-130,80,-130,80,-126.66666666666666,102,-126.66666666666666,120,-126.66666666666666]}
|
|
]}`;var Za=["Rectangle","Square","RoundedRectangle","Border","Ellipse","Circle","TriangleRight","TriangleDown","TriangleLeft","TriangleUp","Triangle","Diamond","LineH","LineV","None","BarH","BarV","MinusLine","PlusLine","XLine","LineRight","LineDown","LineLeft","LineUp"];function Ps(me){return console.log("shapeName:",me),Za.indexOf(me)>=0}var rs=new he.YI(On.current,{maxSelectionCount:1,linkTemplate:an(he.rU,{locationSpot:he.z6.Center,selectionAdornmentTemplate:an(he.uz,"Link",{locationSpot:he.z6.Center},an(he.bn,{isPanelMain:!0,fill:null,stroke:"deepskyblue",strokeWidth:0}),an(he.bn,{toArrow:"Standard",stroke:null}))},{routing:he.rU.AvoidsNodes,curve:he.rU.JumpOver,corner:5,toShortLength:4},new he.KX("points"),an(he.bn,{isPanelMain:!0,strokeWidth:2}),an(he.bn,{toArrow:"Standard",stroke:null})),model:new he.FJ([{text:"\u672A\u547D\u540D",size:"100 100",fill:null,stroke:"#000"},...he.bn.getFigureGenerators().toArray().map(me=>({text:"\u672A\u547D\u540D",size:"100 100",figure:me.key,fill:"white",stroke:"#666",borderColor:"#000"}))])});return le.current.addDiagramListener("TextEdited",function(me){var xi;const gr=me.subject.part;var ai=(xi=document.activeElement)==null?void 0:xi.value;typeof ai=="string"&&ai.trim()===""&&le.current.model.commit(function(ho){ho.set(gr.data,"text","\u672A\u547D\u540D"),le.current.commandHandler.stopCommand()},"increment")}),rs.nodeTemplate=an(he.NB,"Auto",{locationSpot:he.z6.Center},new he.KX("location","location",he.E9.parse).makeTwoWay(he.E9.stringify),an(he.bn,"Circle",{fill:"white",stroke:"gray",strokeWidth:2,width:20,height:20,portId:"",fromLinkable:!0,toLinkable:!0,fromLinkableDuplicates:!0,toLinkableDuplicates:!0,fromLinkableSelfNode:!0,toLinkableSelfNode:!0},new he.KX("stroke").makeTwoWay(),new he.KX("fill").makeTwoWay(),new he.KX("figure")),an(he.al,{margin:new he.Zt(5,5,3,5),font:"10pt sans-serif",minSize:new he.$u(16,16),maxSize:new he.$u(10,NaN),textAlign:"center",editable:!0},new he.KX("key").makeTwoWay())),setTimeout(()=>{le.current.grid=an(he.s_,"Grid",an(he.bn,"LineH",{stroke:"lightgray",strokeWidth:.5}),an(he.bn,"LineV",{stroke:"lightgray",strokeWidth:.5})),le.current.grid.visible=!0,le.current.grid.gridCellStroke="darkgray",le.current.grid.gridCellStrokeWidth=1},300),window.myDiagrams=le.current,le.current}const Oi=()=>Et(this,null,function*(){var an,fe=le.current.makeImage();const An=yield(0,Mt.ZP)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:Date.now(),file:fe.src,file_data:JSON.stringify({login:(an=(0,At.eY)())==null?void 0:an.login,data:JSON.parse(le.current.model.toJson())})}});Ie({src:An.url})});return(0,It.useEffect)(()=>(setTimeout(()=>{Zn()},500),Xe(xe+1),()=>{le.current=null}),[]),Ut.createElement("div",{ref:Mi,className:"body-overflow-initial"},Ut.createElement(Ce.default,{width:1200,icon:null,footer:null,closable:!0,visible:!!xe,destroyOnClose:!0,maskClosable:!1,rootClassName:"zIndex-9999",title:Ut.createElement(sn.Z,null,Ut.createElement(Ht.Z,{flex:1},"\u63D2\u5165\u6D41\u7A0B\u56FE"),Ut.createElement(Ht.Z,{onClick:()=>{var an,fe,An=le.current.selection.first();if(Wn.current=!Wn.current,document.activeElement&&An){let ri=(fe=(an=document.activeElement)==null?void 0:an.value)==null?void 0:fe.trim();typeof ri=="string"&&le.current.model.commit(function(Ki){Ki.set(An.data,"text",ri||"\u672A\u547D\u540D"),le.current.commandHandler.stopCommand()},"increment")}Xe(xe+1)}},Ut.createElement("span",{className:"current c-blue mr30",style:{fontWeight:400}},"\u5C55\u5F00/\u6536\u8D77"))),onCancel:Le},Ut.createElement("div",{style:{width:"100%",height:"80vh",overflow:"hidden",position:"relative",display:Wn.current?"none":"block"},className:wt.flowChartWrp},Ut.createElement("div",{style:{display:"flex",height:"100%"}},Ut.createElement("div",{style:{width:"300px",height:"100%"}},Ut.createElement("div",{style:{background:"#fff",position:"relative",zIndex:12,fontSize:16,color:"#3061d0"}},"\u56FE\u5F62\u5E93"),Ut.createElement("div",{style:{height:"calc(100% - 50px)"},className:wt.myPaletteDiv,ref:On})),Ut.createElement("div",{style:{flex:1,position:"relative"}},Ut.createElement("div",{ref:Oe,style:{height:"80vh"}}))),Ut.createElement("div",{className:"tr"},Ut.createElement(Ne.ZP,{size:"large",onClick:Oi,style:{position:"absolute",right:0,bottom:0,zIndex:8},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668")))))}var Dn=be,zi=Jt(98813),yi=Jt(37720);const ei=zi.ZP.Group,Qi={margin:"0 8px"};var Mn=({callback:Le,onCancel:Ie})=>{function le(Oe){Le(Oe)}return It.createElement(oe.default,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:le},It.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},It.createElement("span",{style:Qi},"\u5355\u5143\u683C\u6570\uFF1A"),It.createElement("span",{style:Qi},"\u884C\u6570"),It.createElement(oe.default.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},It.createElement(yi.Z,null)),It.createElement("span",{style:Qi},"\u5217\u6570"),It.createElement(oe.default.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},It.createElement(yi.Z,null))),It.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},It.createElement("span",{style:Qi},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),It.createElement(oe.default.Item,{name:"align"},It.createElement(ei,null,It.createElement(zi.ZP,{value:"default"},It.createElement("i",{className:"fa fa-align-justify"})),It.createElement(zi.ZP,{value:"left"},It.createElement("i",{className:"fa fa-align-left"})),It.createElement(zi.ZP,{value:"center"},It.createElement("i",{className:"fa fa-align-center"})),It.createElement(zi.ZP,{value:"right"},It.createElement("i",{className:"fa fa-align-right"}))))),It.createElement("div",{className:"flex-container flex-end"},It.createElement(Ne.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),It.createElement(Ne.ZP,{type:"ghost",onClick:Ie},"\u53D6\u6D88")))},sr=Jt(59637),Yi=Jt(61016),Vr=Jt.n(Yi),Us=(0,It.forwardRef)(({use3d:Le,width:Ie,height:le,callback:Oe,showSaveButton:On},Wn)=>{const Mi=(0,It.useRef)(),xe=(0,It.useRef)(),[Xe,Zn]=(0,It.useState)(!1),Oi=(0,It.useRef)({id:Mi,appName:"graphing",width:Ie||1e3,height:le||600,showToolBar:!0,showMenuBar:!0,allowStyleBar:!0,showAlgebraInput:!0,enableLabelDrags:!1,enableShiftDragZoom:!0,showToolBarHelp:!1,errorDialogsActive:!0,showTutorialLink:!0,showLogging:!0,useBrowserForJS:!1});(0,It.useEffect)(()=>{xe.current=new(Vr())(Oi.current,!0),window.onload=function(){xe.current.inject("applet_container")}},[]);const an=()=>{var fe=window.ggbApplet.getPNGBase64(1,!0,72);return Oe&&Oe(fe),fe};return(0,It.useEffect)(()=>{Oi.current.appName=Xe?"3D":"graphing",xe.current.inject("applet_container")},[Xe]),(0,It.useEffect)(()=>{Zn(Le)},[Le]),(0,It.useImperativeHandle)(Wn,()=>({getImgData:an})),It.createElement(It.Fragment,null,It.createElement("div",{style:{width:"100%",height:"100%"},id:"applet_container",ref:Mi}),It.createElement(sn.Z,{align:"middle"},It.createElement(Ht.Z,{flex:1},It.createElement(sr.Z,{size:"default",checkedChildren:"\u5173\u95ED3D\u56FE\u50CF",unCheckedChildren:"\u5F00\u542F3D\u56FE\u50CF",checked:Xe,onChange:fe=>Zn(fe)})),It.createElement(Ht.Z,null,It.createElement(Ne.ZP,{size:"large",onClick:an,style:{zIndex:8,marginTop:10},type:"primary"},"\u4FDD\u5B58\u5230\u7F16\u8F91\u5668"))))}),is=Jt(36527),xo=Jt(2453);const zr="link",wl="upload-image",Li="add-flowchart",qi="draw-image",aa="add-flowchart",Oa="code-block",Or="add-table",Il="------------",ku={default:Il,left:`:${Il}`,center:`:${Il}:`,right:`${Il}:`};var bu=Jt(99914);function Rh(){}let Xl=0;const Ia=1e4,Cl="\u2581",bs="@\u2581\u2581@",Qe="@\u2581@",xt=`
|
|
**\u6A21\u677F\u6807\u9898**
|
|
\u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`,En=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"];function mn(Le){return/^\d+$/.test(Le)?`${Le}px`:Le}const gi=navigator.platform.toUpperCase().indexOf("MAC")>=0?"Cmd":"Ctrl",fi={[gi+"-B"]:"bold",[gi+"-I"]:"italic"},Gi={[zr]:"\u6DFB\u52A0\u94FE\u63A5",[Oa]:"\u6DFB\u52A0\u4EE3\u7801\u5757",[wl]:"\u6DFB\u52A0\u56FE\u7247",[qi]:"\u6DFB\u52A0\u753B\u56FE",[Li]:"\u63D2\u5165\u6D41\u7A0B\u56FE",[Or]:"\u6DFB\u52A0\u8868\u683C","maths-latex":"\u6570\u5B66\u56FE\u50CF","inline-latex":"LATEX\u516C\u5F0F"};var br=({defaultValue:Le="",onChange:Ie,width:le="100%",height:Oe=400,miniToolbar:On=!1,isFocus:Wn=!1,watch:Mi,insertTemp:xe,mode:Xe="markdown",id:Zn="markdown-editor-id",showResizeBar:Oi=!1,noStorage:an=!1,showNullButton:fe=!1,showNullProgramButton:An=!1,hidetoolBar:ri=!1,fullScreen:Ki=!1,onBlur:Ue,onCMBeforeChange:Gn,onFullScreen:uo,className:zo="",disablePaste:$r=!1,disabled:Kn=!1,disabledFill:zn=!1,placeholder:qn="",values:Ir="",extraUse:no})=>{const[hn,ci]=(0,It.useState)(null),[Za,Ps]=(0,It.useState)(Le),[rs,me]=(0,It.useState)(Mi),[xi,gr]=(0,It.useState)(Ki),[ai,ho]=(0,It.useState)(""),[pr,Sr]=(0,It.useState)(0),[lr,ur]=(0,It.useState)(Oe),[Wr,Ve]=(0,It.useState)(!1),[Ko,Ye]=(0,It.useState)(0),[qr,ma]=(0,It.useState)(0),Co=(0,It.useRef)(),hl=(0,It.useRef)(),Fo=(0,It.useRef)(),vr=(0,It.useRef)();(0,It.useEffect)(()=>{const wi=window.scrollY||window.pageYOffset;Ps(Ir),hn==null||hn.setValue(Ir),window.scrollTo(0,wi)},[Ir]),(0,It.useEffect)(()=>{uo==null||uo(xi)},[xi]),(0,It.useEffect)(()=>{if(Co.current){let wi=function(Ii,Ze){var Rr;if($r){Ze.preventDefault();return}const fo=Ze.clipboardData;if(fo){const ls=fo.types.toString(),Mo=fo.items;if(ls==="Files"||fo.types.indexOf("Files")>-1){if(Ze.preventDefault(),Xe=="stex")return;try{let $o=Mo[1];((Rr=Mo[0])==null?void 0:Rr.kind)==="file"&&($o=Mo[0]);const Es=$o.getAsFile(),va=Es.name.split(".").pop();(0,Ln.I)(Es,la=>{var Zu,Tu,ye;la.id?((Zu=Es==null?void 0:Es.type)==null?void 0:Zu.indexOf("image"))>-1?li.replaceSelection(`<img width="100%" src="/api/attachments/${la.id}?type=${la.content_type})" alt="" />`):((Tu=Es==null?void 0:Es.type)==null?void 0:Tu.indexOf("video"))>-1?li.replaceSelection(`<video width="100%" controls src="/api/attachments/${la.id}"></video>`):((ye=Es==null?void 0:Es.type)==null?void 0:ye.indexOf("pdf"))>-1?li.replaceSelection(`<a href="/api/attachments/${la.id}?type=${Es.type}&disposition=inline" target="_blank">${Es.name}</a>`):En.includes(va)?li.replaceSelection(`<a href="/api/attachments/${la.id}?type=office&disposition=inline" target="_blank">${Es.name}</a>`):li.replaceSelection(`[${Es.name}](/api/attachments/${la.id}?type=${la.content_type})`):(la==null?void 0:la.status)===401&&(document.location.href="/user/login")})}catch($o){xo.ZP.warning("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0};const li=Be().fromTextArea(Co.current,{mode:Xe,lineNumbers:!On,lineWrapping:!0,value:Le,autoCloseTags:!0,autoCloseBrackets:!0});return li.on("keyup",function(Ii,Ze){Ze.keyCode===8&&(Ii.getValue()==""?li.setOption("placeholder",qn):li.setOption("placeholder",null))}),li.on("keydown",function(Ii,Ze){if(Ze.keyCode===8){var Rr=Ja(Ii);Rr&&Ze.preventDefault()}}),Wn&&li.focus(),li.on("paste",wi),Kn&&li.on("beforeChange",function(Ii,Ze){(Ze.origin==="paste"||Ze.origin==="+input")&&Ze.cancel()}),ci(li),()=>{li.off("paste",wi)}}},[]);const Ao=(0,It.useCallback)(()=>{if(hl.current)try{}catch(wi){console.log(wi,"---- to set md editor body height")}},[lr,hl,xi]);(0,It.useEffect)(()=>{function wi(){let li=new qe.Z(Ii=>{for(let Ze of Ii)(Ze.target.offsetHeight>0||Ze.target.offsetWidth>0)&&(Ao(),hn.setSize("100%","100%"),hn.refresh())});return li.observe(Co.current.parentElement),li}if(hn){const li=wi();return()=>{var Ii,Ze;(Ii=Co.current)!=null&&Ii.parentElement&&li.unobserve((Ze=Co.current)==null?void 0:Ze.parentElement)}}},[hn,Ao]),(0,It.useEffect)(()=>{if(hn){let wi=[];for(const[li,Ii]of Object.entries(fi)){let Ze={[li]:()=>{To(Ii)}};wi.push(Ze),hn.addKeyMap(Ze)}return()=>{for(let li of wi)hn.removeKeyMap(li)}}},[hn]),(0,It.useEffect)(()=>{Ki!==xi&&gr(Ki)},[Ki]),(0,bu.Z)(()=>{if(!an&&pr>0){let wi=new Date().getTime(),li=window.sessionStorage.getItem(Zn);wi>=pr+Ia&&(!li||li!==Za)&&(window.sessionStorage.setItem(Zn,Za),Ve(!0))}},Ia),(0,It.useEffect)(()=>{me(Mi)},[hn,Mi]),(0,It.useEffect)(()=>{hn&&Wn&&hn.focus()},[hn,Wn]),(0,It.useEffect)(()=>{if(rs&&hn){let wi=function(Ii){let Ze=Ii.target;if(vr.current){let Rr=Ze.scrollTop/Ze.scrollHeight;vr.current.scrollTop=vr.current.scrollHeight*Rr}};const li=hn.getScrollerElement();return li.addEventListener("scroll",wi),()=>{li.removeEventListener("scroll",wi)}}},[hn,rs]),(0,It.useEffect)(()=>{if(hn&&Gn){let wi=function(li,Ii){Gn(li,Ii)};return hn.on("beforeChange",wi),()=>{hn.off("beforeChange",wi)}}},[hn,Gn]),(0,It.useEffect)(()=>{if(hn&&Ue){let wi=function(){Ue(hn.getValue())};return hn.on("blur",wi),()=>{hn.off("blur",wi)}}},[hn,Ue]);function Ja(wi,li){var Ii=wi.getDoc(),Ze=Ii.getCursor(),Rr=Ii.getLine(Ze.line),fo=Rr.charAt(Ze.ch-1),ls=Rr.lastIndexOf("@\u2581@",Ze.ch),Mo=Rr.lastIndexOf("@\u2581\u2581@",Ze.ch),$o=ls>Mo?ls:Mo,Es=ls>Mo?3:4;if(bs.indexOf(fo)===-1)return null;if(console.log("change1:",li,wi,Rr,Ze,$o,ls,Mo,fo),$o>=0&&Ze.ch-$o<5){var va=$o+Es;return Ii.replaceRange("",{line:Ze.line,ch:$o},{line:Ze.line,ch:va}),{line:Ze.line,ch:va}}return null}(0,It.useEffect)(()=>{if(hn){let wi=function(li,Ii){const Ze=li.getValue();Ps(Ze),Sr(new Date().getTime()),li.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ie&&(An?Ie(Ze,Xu(Ze)):Ie(Ze))};return hn.on("change",wi),()=>{hn.off("change",wi)}}},[hn,Ie]),(0,It.useEffect)(()=>{if(hn)if(Le==null)hn.setValue(""),Ps("");else{const wi=window.scrollY||window.pageYOffset;Le!==hn.getValue()&&(hn.setValue(Le),Ps(Le),hn.setCursor(Kn?1:hn.lineCount(),0),window.scrollTo(0,wi))}},[hn,Le]);const To=(0,It.useCallback)(wi=>{const li=hn.getCursor(),Ii=hn.getSelection();let Ze=Ii.split(`
|
|
`);switch(wi){case"bold":return hn.replaceSelection("**"+Ii+"**"),Ii===""&&hn.setCursor(li.line,li.ch+2),hn.focus();case"italic":return hn.replaceSelection("*"+Ii+"*"),Ii===""&&hn.setCursor(li.line,li.ch+1),hn.focus();case"code":return hn.replaceSelection("`"+Ii+"`"),Ii===""&&hn.setCursor(li.line,li.ch+1),hn.focus();case"inline-latex":return ho("inline-latex"),hn.focus();case"latex":return hn.replaceSelection("```latex\n"+Ii+"\n```"),hn.setCursor(li.line+1,Ii.length+1),hn.focus();case"line-break":return hn.replaceSelection(`<br/>
|
|
`),hn.focus();case"list-ul":return Ii===""?hn.replaceSelection("- "+Ii):hn.replaceSelection(Ze.map(Rr=>Rr===""?"":`- ${Rr}`).join(`
|
|
`)),hn.focus();case"list-ol":return Ii===""?hn.replaceSelection("1. "+Ii):hn.replaceSelection(Ze.map((Rr,fo)=>Rr===""?"":`${fo+1}. ${Rr}`).join(`
|
|
`)),hn.focus();case"add-null-ch":return Ii===""&&hn.setCursor(li.line,li.ch),hn.replaceSelection(Cl),hn.focus();case"add-signal":return Ii===""&&hn.setCursor(li.line,li.ch),hn.replaceSelection(Qe),hn.focus();case"add-multiple":return Ii===""&&hn.setCursor(li.line,li.ch),hn.replaceSelection(bs),hn.focus();case"inster-template-1":return Ii===""&&hn.setCursor(li.line,li.ch),hn.replaceSelection(xt),hn.focus();case"eraser":return hn.setValue(""),hn.focus();case"trigger-watch":return me(!rs),hn.focus();case"trigger-full-screen":return gr(!xi),hn.focus();case zr:ho(zr);return;case Oa:ho(Oa);return;case wl:ho(wl);return;case qi:ho(qi);return;case"maths-latex":ho("maths-latex");return;case Li:ho(Li);return;case Or:ho(Or);return;default:throw new Error}},[hn,rs,xi]),xn=(0,It.useCallback)((wi,li)=>{var Ii,Ze,Rr,fo,ls,Mo;switch(ho(""),ai){case zr:const{title:Zu,link:Tu}=wi;return hn.replaceSelection(`[${Zu}](${Tu})`),hn.focus();case Oa:const{language:ye,content:Ra}=wi;return hn.replaceSelection(["```"+ye,Ra,"```"].join(`
|
|
`)),hn.focus();case"maths-latex":for(var $o=atob(wi),Es=new Uint8Array($o.length),va=0;va<$o.length;va++)Es[va]=$o.charCodeAt(va);var la=new Blob([Es],{type:"image/png"});(0,Ln.I)(la,nr=>{nr.id?hn.replaceSelection(``):(nr==null?void 0:nr.status)===401&&(document.location.href="/user/login")});break;case"inline-latex":hn.replaceSelection("`$$"+wi+"$$`");break;case wl:case qi:case aa:const{src:Rl,alt:Ju}=wi,os=li,Nu=(Rr=(Ze=(Ii=os==null?void 0:os.name)==null?void 0:Ii.split("."))==null?void 0:Ze.pop)==null?void 0:Rr.call(Ze);return((fo=os==null?void 0:os.type)==null?void 0:fo.indexOf("image"))>-1||!(os!=null&&os.type)?os!=null&&os.align||os!=null&&os.width?hn.replaceSelection(`<p style="text-align:${os.align||"initial"}"><img width="${os.width?os.width+"%":"initial"}" src="${Rl}" alt="${Ju||""}" /></p>`):hn.replaceSelection(`<img width="100%" src="${Rl}" alt="${Ju||""}" />`):((ls=os==null?void 0:os.type)==null?void 0:ls.indexOf("video"))>-1?hn.replaceSelection(`<video width="100%" controls src="${Rl}"></video>`):((Mo=os==null?void 0:os.type)==null?void 0:Mo.indexOf("pdf"))>-1?hn.replaceSelection(`<a href="${Rl}?type=${os.type}&disposition=inline" target="_blank">${os.name}</a>`):En.includes(Nu)?hn.replaceSelection(`<a href="${Rl}?type=office&disposition=inline" target="_blank">${os.name}</a>`):hn.replaceSelection(`[${os.name}](${Rl})`),hn.focus();case Or:const{row:hd,col:gh,align:co}=wi;let ps=`
|
|
`;for(let nr=0;nr<hd;nr++){let mr=[],vo=[];for(let ss=0;ss<gh;ss++)nr===1&&vo.push(ku[co]),mr.push(" ");nr===1&&(ps+=`| ${vo.join(" | ")} |
|
|
`),ps+=`| ${mr.join(gh===1?"":" | ")} |
|
|
`}return hn.replaceSelection(ps+`
|
|
`),hn.focus();default:throw new Error}},[hn,ai]),jt=(0,It.useMemo)(()=>{switch(ai){case zr:return It.createElement(Kt,{callback:xn,onCancel:cs});case Oa:return It.createElement(pn.Z,{callback:xn,onCancel:cs});case wl:return It.createElement(Ln.Z,{callback:xn,onCancel:cs});case Li:return It.createElement(Dn,{callback:xn,onCancel:cs});case Or:return It.createElement(Mn,{callback:xn,onCancel:cs});case"maths-latex":return It.createElement(Us,{showSaveButton:!0,callback:xn});case"inline-latex":return It.createElement(is.Z,{showSaveButton:!0,callback:xn});default:return null}},[ai]);function cs(){ho("")}(0,It.useEffect)(()=>{if(Fo.current){let wi=function(ls){Rr=!0,fo=ls.pageY},li=function(){Rr=!1},Ii=function(ls){if(Rr){let Mo=ls.pageY-fo;Mo<0&&(Mo=0),Mo>300&&(Mo=300);let $o=Oe+Mo+"px";ur($o)}},Ze=Fo.current,Rr=!1,fo=0;return Ze.addEventListener("mousedown",wi),document.addEventListener("mousemove",Ii),document.addEventListener("mouseup",li),()=>{Ze.removeEventListener("mousedown",wi),document.removeEventListener("mousemove",Ii),document.removeEventListener("mouseup",li)}}},[hn,Fo]),(0,It.useEffect)(()=>{ur(Oe)},[Oe]);const Eu=mn(le),Fu=mn(lr),dl={width:Eu,height:Fu},ch=(0,It.useMemo)(()=>{if(pr){let wi=new Date(pr),li=wi.getHours(),Ii=wi.getMinutes(),Ze=wi.getSeconds();return li=li<10?"0"+li:li,Ii=Ii<10?"0"+Ii:Ii,Ze=Ze<10?"0"+Ze:Ze,`${li}:${Ii}:${Ze}`}return 0},[pr]),Xu=wi=>{const li=[];if(An){let Ii=-1;wi=wi.replace(/(@▁▁@|@▁@)/g,function(Ze,Rr,fo){li.push({multiLine:Ze!==Qe})})}return li};function ud(){window.sessionStorage.removeItem(Zn),Ve(!1),Sr(0)}function jh(){Ve(!1),Sr(0),hn.setValue(window.sessionStorage.getItem(Zn))}(0,It.useEffect)(()=>{Gi[ai]&&ai!==qi&&ai!==Li&&setTimeout(()=>{const wi=document.getElementsByClassName("markdown-popup-form")[0],li=window.innerWidth/2-wi.offsetWidth/2,Ii=window.innerHeight/2-wi.offsetHeight/2;Ye(li),ma(Ii)},0)},[ai]);const Lo=wi=>{wi.preventDefault();const li=wi.clientX-Ko,Ii=wi.clientY-qr;document.body.onmousemove=Ze=>{let Rr=Ze.clientX-li,fo=Ze.clientY-Ii;const ls=document.getElementsByClassName("markdown-popup-form")[0],Mo=window.innerWidth-ls.offsetWidth,$o=window.innerHeight-ls.offsetHeight;Rr=Math.max(0,Math.min(Rr,Mo)),fo=Math.max(0,Math.min(fo,$o)),gs(Ze.clientX,Ze.clientY,li,Ii)&&(Ye(Rr),ma(fo))},document.body.onmouseup=function(){document.body.onmousemove=null}},gs=(wi,li,Ii,Ze)=>{const Rr=document.body.clientHeight,fo=document.body.clientWidth;return wi<20&&Ii>wi||wi>fo-20&&Ii<wi||li<20&&Ze>li||li>Rr-20&&Ze<li?(document.body.onmousemove=null,document.body.onmouseup=null,!1):!0};return It.createElement(It.Fragment,null,It.createElement("div",{className:"markdown-editor-wrapper",ref:hl},It.createElement("div",{className:`markdown-editor-container ${zo} ${rs?"on-preview":""} ${On?"mini":""} ${xi?"full-screen":""}`,style:dl},It.createElement(Qt,{insertTemp:xe,watch:rs,fullScreen:xi,showNullButton:fe,showNullProgramButton:An,onActionCallback:To,hidetoolBar:ri,extraUse:no}),It.createElement("div",{className:"markdown-editor-body"},It.createElement("div",{className:"codemirror-container"},It.createElement("textarea",{ref:Co,placeholder:qn})),rs?It.createElement("div",{ref:vr,className:"preview-container"},Xe==="stex"&&It.createElement(Me,{value:Za}),Xe!=="stex"&&It.createElement(ze.Z,{disabledFill:zn,showProgramFill:An,value:Za})):null))),Oi?It.createElement("a",{ref:Fo,className:"editor-resize"}):null,ai===qi&&It.createElement(Sn,{callback:xn,onCancel:cs}),ai===Li&&It.createElement(Dn,{callback:xn,onCancel:cs}),It.createElement(ie.Z,null,Gi[ai]&&ai!==qi&&ai!==Li?It.createElement(Ce.default,{maskClosable:!1,centered:!0,style:{position:"absolute",left:Ko,top:qr},title:It.createElement("div",{style:{cursor:"move"},onMouseDown:Lo},Gi[ai]),open:!0,onCancel:cs,footer:null,destroyOnClose:!0,width:ai===Li?"1200px":null,height:ai===Li?"80vh":null,className:"markdown-popup-form"},jt):null))}},70859:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return zt},I:function(){return ie}});var It=Jt(91773),ce=Jt(2453),Be=Jt(28802),qe=Jt(78957),Se=Jt(37720),de=Jt(98813),$t=Jt(85804),He=Jt(15476),ve=Jt(67294),Pe=Jt(67294),ze=Object.defineProperty,Me=Object.defineProperties,tn=Object.getOwnPropertyDescriptors,Nt=Object.getOwnPropertySymbols,nt=Object.prototype.hasOwnProperty,et=Object.prototype.propertyIsEnumerable,ht=(oe,re,Ne)=>re in oe?ze(oe,re,{enumerable:!0,configurable:!0,writable:!0,value:Ne}):oe[re]=Ne,lt=(oe,re)=>{for(var Ne in re||(re={}))nt.call(re,Ne)&&ht(oe,Ne,re[Ne]);if(Nt)for(var Ne of Nt(re))et.call(re,Ne)&&ht(oe,Ne,re[Ne]);return oe},pt=(oe,re)=>Me(oe,tn(re));const{useForm:vt}=It.default,Ct={width:280,marginRight:10},bt={labelCol:{span:5},wrapperCol:{span:19}};var zt=({callback:oe,onCancel:re})=>{const[Ne]=vt();let ue=(0,ve.useRef)();function ke(wn){ue.current.width=Ne.getFieldValue("width"),ue.current.align=Ne.getFieldValue("align"),oe(wn,ue.current)}function Ke(wn,Rn){if(wn.status===-1){ce.ZP.error(wn.message);return}Ne.setFieldsValue({src:`/api/attachments/${wn.id}`,type:Rn.type})}function Fe(wn){let Rn=wn.target.files[0];ue.current=Rn,ie(Rn,Ke)}return Pe.createElement(It.default,pt(lt({form:Ne},bt),{className:"upload-image-panel",onFinish:ke,style:{width:470,overflow:"hidden"}}),Pe.createElement(It.default.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},Pe.createElement("div",{className:"flex-container"},Pe.createElement(It.default.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},Pe.createElement(Be.default,{style:Ct})),Pe.createElement(Qt,{onFileChange:Fe}))),Pe.createElement(It.default.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},Pe.createElement(Be.default,{style:{width:264}})),Pe.createElement(It.default.Item,{label:"\u56FE\u7247\u5BBD\u5EA6",name:"width"},Pe.createElement(qe.Z,null,Pe.createElement(It.default.Item,{name:"width",style:{margin:0}},Pe.createElement(Se.Z,{style:{width:264}})),Pe.createElement("span",{className:"ml8"},"%"))),Pe.createElement(It.default.Item,{label:"\u5BF9\u9F50\u65B9\u5F0F",name:"align"},Pe.createElement(de.ZP.Group,{name:"align",defaultValue:1,options:[{value:"left",label:"\u5DE6\u5BF9\u9F50"},{value:"center",label:"\u5C45\u4E2D\u5BF9\u9F50"},{value:"right",label:"\u53F3\u5BF9\u9F50"}]})),Pe.createElement("aside",null,Pe.createElement(It.default.Item,{style:{textAlign:"right",position:"relative",right:-98}},Pe.createElement($t.ZP,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),Pe.createElement($t.ZP,{type:"default",onClick:re},"\u53D6\u6D88"))))};function Qt({onFileChange:oe}){return Pe.createElement("label",{className:"upload-button",style:{cursor:"pointer"}},"\u672C\u5730\u4E0A\u4F20",Pe.createElement("input",{type:"file",onChange:oe}))}function ie(oe,re){if(!oe)throw new String("\u6CA1\u6709\u6587\u4EF6");let Ne=new FormData;Ne.append("editormd-image-file",oe),Ne.append("file_param_name","editormd-image-file"),Ne.append("byxhr","true");var ue=new window.XMLHttpRequest;ue.withCredentials=!0,ue.addEventListener("load",function(ke){re(JSON.parse(ke.target.responseText),oe)},!1),ue.addEventListener("error",function(ke){console.error(ke)},!1),ue.open("POST",`${He.KI}/api/attachments.json`),ue.send(Ne)}},76621:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return Be}});var It=Jt(67294),ce=Jt(73935);class Be extends It.Component{constructor(Se){super(Se);const de=window.document;this.node=de.createElement("div"),de.body.appendChild(this.node)}render(){const{children:Se}=this.props;return(0,ce.createPortal)(Se,this.node)}componentWillUnmount(){window.document.body.removeChild(this.node)}}},36295:function(on,In,Jt){"use strict";Jt.d(In,{SV:function(){return he},ZP:function(){return Sn}});var It=Jt(67294),ce=Jt(91033);const Be={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},qe={quickKey:[{label:"main",content:["public static void main(String[] args) {"," $0","}"].join(`
|
|
`)},{label:"System.out.println",content:["System.out.println($0)"].join(`
|
|
`)},{label:"System.out.print",content:["System.out.print($0)"].join(`
|
|
`)}],keywords:["abstract","continue","for","new","switch","assert","default","goto","package","synchronized","boolean","do","if","private","this","break","double","implements","protected","throw","byte","else","import","public","throws","case","enum","instanceof","return","transient","catch","extends","int","short","try","char","final","interface","static","void","class","finally","long","strictfp","volatile","const","float","native","super","while","true","false"]},Se={keywords:["abstract","amp","array","auto","bool","break","case","catch","char","class","const","constexpr","const_cast","continue","cpu","decltype","default","delegate","delete","do","double","dynamic_cast","each","else","enum","event","explicit","export","extern","false","final","finally","float","friend","gcnew","generic","goto","in","initonly","inline","int","interface","interior_ptr","internal","literal","long","mutable","namespace","new","noexcept","nullptr","__nullptr","operator","override","partial","pascal","pin_ptr","private","property","protected","public","ref","register","reinterpret_cast","restrict","return","safe_cast","sealed","short","signed","sizeof","static","static_assert","static_cast","struct","switch","template","this","thread_local","throw","tile_static","true","try","typedef","typeid","typename","union","unsigned","using","virtual","void","volatile","wchar_t","where","while","_asm","_based","_cdecl","_declspec","_fastcall","_if_exists","_if_not_exists","_inline","_multiple_inheritance","_pascal","_single_inheritance","_stdcall","_virtual_inheritance","_w64","__abstract","__alignof","__asm","__assume","__based","__box","__builtin_alignof","__cdecl","__clrcall","__declspec","__delegate","__event","__except","__fastcall","__finally","__forceinline","__gc","__hook","__identifier","__if_exists","__if_not_exists","__inline","__int128","__int16","__int32","__int64","__int8","__interface","__leave","__m128","__m128d","__m128i","__m256","__m256d","__m256i","__m64","__multiple_inheritance","__newslot","__nogc","__noop","__nounwind","__novtordisp","__pascal","__pin","__pragma","__property","__ptr32","__ptr64","__raise","__restrict","__resume","__sealed","__single_inheritance","__stdcall","__super","__thiscall","__try","__try_cast","__typeof","__unaligned","__unhook","__uuidof","__value","__virtual_inheritance","__w64","__wchar_t"],operators:["=",">","<","!","~","?",":","==","<=",">=","!=","&&","||","++","--","+","-","*","/","&","|","^","%","<<",">>",">>>","+=","-=","*=","/=","&=","|=","^=","%=","<<=",">>=",">>>="],quickKey:[{label:"ifelse",content:["if (${1:condition}) {"," $0","} else {"," ","}"].join(`
|
|
`)},{label:"include",content:"include<$0>"},{label:"printf",content:"printf($0)"},{label:"system",content:'system("$0")'},{label:"main",content:["int main () {"," $0","}"].join(`
|
|
`)},{label:"if",content:["if () {"," $0","}"].join(`
|
|
`)},{label:"for",content:["for(int j=0 ; j<10; j++){"," $0","}"].join(`
|
|
`)},{label:"trycatch",content:["try{"," $0","}catch(ExceptionName e){","}"].join(`
|
|
`)},{label:"using namespace std;",content:["using namespace std;"].join(`
|
|
`)},{label:"include <iostream>",content:["#include <iostream>"].join(`
|
|
`)},{label:"include <vector>",content:["#include <vector>"].join(`
|
|
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
|
|
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
|
|
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
|
|
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
|
|
`)},{label:"include <map>",content:["#include <map>"].join(`
|
|
`)},{label:"include <string>",content:["#include <string>"].join(`
|
|
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
|
|
`)}]},de={keywords:["and","as","assert","break","class","continue","def","del","elif","else","except","exec","finally","for","from","global","if","import","in","is","lambda","None","not","or","pass","raise","return","self","try","while","with","yield","int","float","long","complex","hex","abs","all","any","apply","basestring","bin","bool","buffer","bytearray","callable","chr","classmethod","cmp","coerce","compile","complex","delattr","dict","dir","divmod","enumerate","eval","execfile","file","filter","format","frozenset","getattr","globals","hasattr","hash","help","id","input","intern","isinstance","issubclass","iter","len","locals","list","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","reversed","range","raw_input","reduce","reload","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","unichr","unicode","vars","xrange","zip","True","False","__dict__","__methods__","__members__","__class__","__bases__","__name__","__mro__","__subclasses__","__init__","__import__"],quickKey:[{label:"print",content:["print($0)"].join(`
|
|
`)}]},$t={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
|
|
`)}]};var He=Jt(84204),ve=Jt.n(He),Pe=(Te,Nn,Bn)=>new Promise((Ht,Mt)=>{var wt=Et=>{try{Ut(Bn.next(Et))}catch(be){Mt(be)}},At=Et=>{try{Ut(Bn.throw(Et))}catch(be){Mt(be)}},Ut=Et=>Et.done?Ht(Et.value):Promise.resolve(Et.value).then(wt,At);Ut((Bn=Bn.apply(Te,Nn)).next())});const ze={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},Me=(Te,Nn,Bn,Ht)=>{const Mt=Nn.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:Bn.lineNumber,endColumn:Bn.column});return Array.from(new Set(Mt.match(/\b\w{2,}\b/g)||[])).map(At=>({label:At,kind:Te.languages.CompletionItemKind.Text,insertText:At,range:Ht}))},tn=(Te,Nn,Bn,Ht)=>{Te.languages.registerCompletionItemProvider(Nn,{provideCompletionItems(Mt,wt){const At=Mt.getWordUntilPosition(wt),Ut={startLineNumber:wt.lineNumber,endLineNumber:wt.lineNumber,startColumn:At.startColumn,endColumn:At.endColumn},Et=Mt.getLineContent(wt.lineNumber).substring(At.startColumn-2,At.endColumn);return{suggestions:[...Me(Te,Mt,wt,Ut),...Bn.map(Dn=>({label:Dn,kind:Te.languages.CompletionItemKind.Keyword,documentation:Dn,insertText:Dn,insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ut})),...Ht.map(Dn=>({label:Dn.label,kind:Te.languages.CompletionItemKind.Snippet,documentation:Dn.content,insertText:Et.startsWith("#")?Dn.content.replace(/#/,""):Dn.content,insertTextRules:Te.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ut}))]}}})};var Nt=Te=>{ze.languages.forEach(Nn=>{Te.languages.registerDocumentFormattingEditProvider(Nn,{provideDocumentFormattingEdits(Bn){return Pe(this,null,function*(){const Ht=ve()(Bn.getValue(),{indent_size:2,indent_char:" ",max_preserve_newlines:2,preserve_newlines:!0,keep_array_indentation:!0,break_chained_methods:!1,indent_scripts:"normal",brace_style:"collapse",space_before_conditional:!0,unescape_strings:!1,jslint_happy:!1,end_with_newline:!0,wrap_line_length:0,indent_inner_html:!1,comma_first:!1,e4x:!1,indent_empty_lines:!1});return[{range:Bn.getFullModelRange(),text:Ht}]})}})}),tn(Te,"java",qe.keywords,qe.quickKey),tn(Te,"cpp",Se.keywords,Se.quickKey),tn(Te,"c",Be.keywords,[]),tn(Te,"python",de.keywords,de.quickKey),tn(Te,"scala",$t.keywords,$t.quickKey)};const nt="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var et=Object.defineProperty,ht=(Te,Nn,Bn)=>Nn in Te?et(Te,Nn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Te[Nn]=Bn,lt=(Te,Nn,Bn)=>ht(Te,typeof Nn!="symbol"?Nn+"":Nn,Bn);const pt=class px{constructor(Nn,Bn,Ht){this.placeholder=Nn,this.editor=Bn,this.monaco=Ht,Bn.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return px.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};lt(pt,"ID","editor.widget.placeholderHint");var Ct=pt,bt=Jt(84144),zt=Jt(2453),Qt=Jt(83062),ie=Jt(96486),oe=Jt(33054),re=Jt(74855),Ne=Object.defineProperty,ue=Object.defineProperties,ke=Object.getOwnPropertyDescriptors,Ke=Object.getOwnPropertySymbols,Fe=Object.prototype.hasOwnProperty,wn=Object.prototype.propertyIsEnumerable,Rn=(Te,Nn,Bn)=>Nn in Te?Ne(Te,Nn,{enumerable:!0,configurable:!0,writable:!0,value:Bn}):Te[Nn]=Bn,$n=(Te,Nn)=>{for(var Bn in Nn||(Nn={}))Fe.call(Nn,Bn)&&Rn(Te,Bn,Nn[Bn]);if(Ke)for(var Bn of Ke(Nn))wn.call(Nn,Bn)&&Rn(Te,Bn,Nn[Bn]);return Te},di=(Te,Nn)=>ue(Te,ke(Nn)),ee=(Te,Nn)=>{var Bn={};for(var Ht in Te)Fe.call(Te,Ht)&&Nn.indexOf(Ht)<0&&(Bn[Ht]=Te[Ht]);if(Te!=null&&Ke)for(var Ht of Ke(Te))Nn.indexOf(Ht)<0&&wn.call(Te,Ht)&&(Bn[Ht]=Te[Ht]);return Bn},_t=(Te,Nn,Bn)=>new Promise((Ht,Mt)=>{var wt=Et=>{try{Ut(Bn.next(Et))}catch(be){Mt(be)}},At=Et=>{try{Ut(Bn.throw(Et))}catch(be){Mt(be)}},Ut=Et=>Et.done?Ht(Et.value):Promise.resolve(Et.value).then(wt,At);Ut((Bn=Bn.apply(Te,Nn)).next())});function Kt(Te){return/^\d+$/.test(Te)?`${Te}px`:Te}function pn(){}let Ln=!1;const Ce={"Python3.6":"python","Python2.7":"python",Dynamips:"cpp",Java:"java",Web:"php",Html:"html",Hive:"sql",Hadoop:"java",SDL:"cpp",PHP:"php",Matlab:"python",Git:"python",Python:"python","C/C++":"cpp","C++":"cpp",C:"cpp",Ruby:"ruby",Shell:"shell",JavaScript:"javascript",Perl6:"perl",Kotlin:"kotlin",Elixir:"elixir",Android:"java",JavaWeb:"java",Go:"go",Spark:"sql",MachineLearning:"python",Verilog:"xml","Verilog/VNC":"xml",Docker:"dockerfile","C#":"csharp",SQLite3:"sql",Oracle:"sql",Vhdl:"vhdl",R:"r",Swift:"swift",SQLServer:"mysql",MySQL:"mysql",Mongo:"sql",PostgreSql:"pgsql",Hbase:"powershell",Sqoop:"sql",Nasm:"cpp",Kafka:"java",Flink:"java",Sml:"javascript",OpenGL:"cpp",Perl5:"perl",Orange:"python",Scala:"scale",solidity:"sol"};function sn(Te=[]){let Nn=Te;if(Array.isArray(Te)){for(let Bn=0;Bn<Te.length;Bn++){let Ht=Ce[Te[Bn]];if(Ht)return Ht}return Nn[0]}return Ce[Nn]||Nn}let cn=null;const Jn=()=>_t(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(Te){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",Te)}});var Sn=Te=>{var Nn=Te,{width:Bn="100%",height:Ht="100%",value:Mt,language:wt="javascript",style:At={},options:Ut={},overrideServices:Et={},theme:be="vs-dark",onEditBlur:Dn,isCopy:zi=!1,onSave:yi,autoHeight:ei=!1,forbidCopy:Qi=!1,onChange:Mn=pn,editorDidMount:sr=pn,onFocus:Yi=pn,onBreakPoint:Vr=pn,breakPointValue:Ci=[],filename:Us="educoder.txt",errorLine:is,errorContent:xo="",highlightLine:zr,openBreakPoint:wl=!1,placeholder:Li="",showMiniMap:qi=!0}=Nn,aa=ee(Nn,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const Oa=(0,It.useRef)(),Or=(0,It.useRef)({}),Il=(0,It.useRef)(),ku=(0,It.useRef)(),bu=(0,It.useRef)([]),Rh=(0,It.useRef)(!1),Xl=(0,It.useRef)(),Ia=(0,It.useRef)(),Cl=(0,It.useRef)(!1),[bs,Qe]=(0,It.useState)(!1);function xt(){let xe;return Oa.current&&(xe=new ce.Z(Xe=>{for(let Zn of Xe)(Zn.target.offsetHeight>0||Zn.target.offsetWidth>0)&&Or.current.instance.layout()}),xe.observe(Oa.current)),xe}function En(){zt.ZP.warning({content:decodeURIComponent(nt),key:"monaco-editor-tip"})}const mn=()=>{let xe=Or.current.instance;if(Mt!=null&&xe&&bs){const Xe=xe.getModel();Xe&&Mt!==Xe.getValue()&&(Ln=!0,Xe.setValue(Mt),xe.layout(),Ln=!1)}};(0,It.useEffect)(()=>{const xe=oe.Z.subscribe("formatDocument",Xe=>{var Zn;let Oi=Or.current.instance;(Zn=Oi==null?void 0:Oi.getAction)==null||Zn.call(Oi,"editor.action.formatDocument").run()});return window.updateMonacoValue=Xe=>{Mn(Xe)},xe},[]),(0,It.useEffect)(()=>{var xe;let Xe=Or.current.instance;ku.current&&clearTimeout(ku.current),ku.current=setTimeout(()=>{mn()},500),Mt&&(Mt!=null&&Mt.length)&&((xe=Xe==null?void 0:Xe.updateOptions)==null||xe.call(Xe,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(Mt.split(/\r\n|\r|\n/g).length))+3,5)}))},[Mt,bs,Or.current]),(0,It.useEffect)(()=>{if(is&&Or.current&&Or.current.instance){let Xe=Or.current.instance;Xe.changeViewZones(function(Zn){var Oi=document.createElement("div");Oi.style.padding="10px 20px",Oi.style.width="calc(100% - 20px)",Oi.className="my-error-line-wrp",Oi.innerHTML=xo,Zn.addZone({afterLineNumber:is||11,heightInLines:3,domNode:Oi})});var xe={domNode:null,getId:function(){return"my.overlay.widget"},getDomNode:function(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.innerHTML="",this.domNode.style.width="100%",this.domNode.style.padding="20px 100px",this.domNode.style.right="0px",this.domNode.style.top="50px",this.domNode.style.position="relative",this.domNode.style.color="#333"),this.domNode},getPosition:function(){return null}};Xe.addOverlayWidget(xe),Xe.revealPositionInCenter({lineNumber:20,column:1})}},[is,Or.current,bs]);const bi=(xe="",Xe)=>{if(!xe||xe.trim()==="")return!0;const Oi=Or.current.instance.getModel().getLineTokens(Xe);let an=!1;for(let fe=0;fe<2;fe++)Oi.getStandardTokenType(fe)===1&&(an=!0);return an};(0,It.useEffect)(()=>{var xe;const Xe=(xe=Or.current)==null?void 0:xe.instance;if(Xe&&bs&&Qi){const Zn=Xe.onDidBlurEditorWidget(()=>{Cl.current=!1}),Oi=Xe.onDidFocusEditorText(()=>{Cl.current=!0});return()=>{Zn.dispose(),Oi.dispose()}}},[Or.current,bs,Qi]),(0,It.useEffect)(()=>{var xe;if((xe=Or.current)!=null&&xe.instance&&bs&&wl){let Xe=Or.current.instance,Zn=Xe.getModel();if(!Zn)return;(()=>{var Kn;let zn=[],qn=[];const Ir=Zn.getAllDecorations();for(let hn of Ir)hn.options.className==="highlighted-line"&&(zn.push((Kn=hn==null?void 0:hn.range)==null?void 0:Kn.startLineNumber),qn.push(hn==null?void 0:hn.id));if(zr===zn[0])return;Zn.deltaDecorations(qn,[]);const no=Zn.getLineCount();zr&&zr<=no&&(Xe.deltaDecorations([],[{range:new cn.Range(zr,1,zr,Zn.getLineMaxColumn(zr)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Xe.revealLineInCenter(zr))})();const an=(Kn=!1)=>{var zn;let qn=[],Ir=[];const no=Zn.getAllDecorations();for(let hn of no)hn.options.linesDecorationsClassName==="breakpoints-select"&&(qn.push((zn=hn==null?void 0:hn.range)==null?void 0:zn.startLineNumber),Ir.push(hn==null?void 0:hn.id));if(Kn)return{lines:qn,ids:Ir};Vr(qn)},fe=Kn=>_t(void 0,null,function*(){let zn={range:new cn.Range(Kn,1,Kn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield Zn.deltaDecorations([],[zn]),an()}),An=Kn=>_t(void 0,null,function*(){let zn=[];const qn=Xe.getLineDecorations(Kn);for(let Ir of qn)Ir.options.linesDecorationsClassName==="breakpoints-select"&&zn.push(Ir.id);yield Zn.deltaDecorations(zn,[]),an()}),ri=Kn=>{let zn=Xe.getLineDecorations(Kn);for(let qn of zn)if(qn.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,ie.isEqual)(Ci,an(!0).lines)){Zn.deltaDecorations(an(!0).ids,[]);const Kn=Ci.map(zn=>({range:new cn.Range(zn,1,zn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));Zn.deltaDecorations([],Kn)}const Ki=Xe.onDidChangeModelContent(Kn=>{let zn=Xe.getPosition();if(zn){let qn=zn.lineNumber;clearTimeout(Ia.current),Ia.current=setTimeout(()=>{bi(Zn.getLineContent(qn),qn)?An(qn):ri(qn)?(An(qn),fe(qn)):an()},100)}}),Ue=Xe.onMouseDown(Kn=>{var zn,qn,Ir;if(Kn.target.detail&&((Ir=(qn=(zn=Kn.target)==null?void 0:zn.element)==null?void 0:qn.className)!=null&&Ir.includes("line-numbers"))){let no=Kn.target.position.lineNumber;if(bi(Zn.getLineContent(no),no))return;ri(no)?An(no):fe(no)}}),Gn=Kn=>{let zn={range:new cn.Range(Kn,1,Kn,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};bu.current=Xe.deltaDecorations(bu.current,[zn])},uo=()=>{bu.current=Xe.deltaDecorations(bu.current,[])},zo=Xe.onMouseMove(Kn=>{var zn,qn,Ir;if(uo(),Kn.target.detail&&((Ir=(qn=(zn=Kn.target)==null?void 0:zn.element)==null?void 0:qn.className)!=null&&Ir.includes("line-numbers"))){let no=Kn.target.position.lineNumber;if(bi(Zn.getLineContent(no),no))return;Gn(no)}}),$r=Xe.onMouseLeave(()=>{uo()});return()=>{Ki.dispose(),Ue.dispose(),zo.dispose(),$r.dispose()}}},[Or.current,bs,Ci,zr,wl,wt]),(0,It.useEffect)(()=>{var xe;(xe=Or.current)!=null&&xe.instance&&wl&&Or.current.instance.setPosition({lineNumber:0,column:0})},[zr]);function gi(){let xe=Or.current.instance;if(xe){const Xe=xe.getSelection(),Zn=Or.current.pastePos||{},Oi=new cn.Range(Zn.startLineNumber||Xe.endLineNumber,Zn.startColumn||Xe.endColumn,Zn.endLineNumber||Xe.endLineNumber,Zn.endColumn||Xe.endColumn);setTimeout(()=>{xe.executeEdits("",[{range:Oi,text:""}])},300)}}function fi(xe){(window.navigator.platform.match("Mac")?xe.metaKey:xe.ctrlKey)&&xe.keyCode==83&&(xe.preventDefault(),yi())}const Gi=()=>{if(ei&&Or.current.instance){const xe=Or.current.instance.getContentHeight();Wn(xe<Ht?Ht:xe)}else Wn(Ht)};function br(xe){var Xe=document.createEvent("MouseEvents");Xe.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),xe.dispatchEvent(Xe)}const Le=xe=>{if(!Cl.current)return;const{keyCode:Xe,ctrlKey:Zn,metaKey:Oi,target:an,type:fe}=xe;return(fe==="paste"||(Xe===67||Xe===86)&&(Oi||Zn))&&an.nodeName==="TEXTAREA"&&(En(),xe.preventDefault()),!1};function Ie(xe,Xe){var Zn=window.URL||window.webkitURL||window,Oi=new Blob([Xe]),an=document.createElementNS("http://www.w3.org/1999/xhtml","a");an.href=Zn.createObjectURL(Oi),an.download=xe,br(an)}(0,It.useEffect)(()=>{Gi()},[Gi]),(0,It.useEffect)(()=>{Oa.current&&!bs&&Promise.all([Jt.e(5552),Jt.e(9651)]).then(Jt.bind(Jt,55826)).then(xe=>{try{cn=xe,Or.current.instance=cn.editor.create(Oa.current,{value:Mt,language:sn(wt),theme:be,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:qi||!1}},Et);const Xe=Or.current.instance;let an=[...bt.BH._menuItems].find(Ki=>Ki[0]._debugName=="EditorContext")[1],fe=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],An=(Ki,Ue)=>{var Gn,uo;let zo=Ki._first;do Ue.includes((uo=(Gn=zo.element)==null?void 0:Gn.command)==null?void 0:uo.id)&&Ki._remove(zo);while(zo=zo.next)};if(sr(Xe,cn),setTimeout(()=>{Gi(),Or.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Ie(Us||"educoder.txt",Xe.getValue())}})},500),Or.current.subscription=Xe.onDidChangeModelContent(Ki=>{Rh.current?clearTimeout(Xl.current):(Gi(),Mn(Xe.getValue(),Ki)),Xl.current=setTimeout(()=>{Rh.current=!1},500)}),window.Monaco||Nt(cn,sn(wt)),Qi&&(An(an,fe),Oa.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",Le),window.removeEventListener("paste",Le),window.addEventListener("keydown",Le),window.addEventListener("paste",Le)),window.Monaco=cn,Dn&&Xe.onDidBlurEditorWidget(()=>{Dn(Xe.getValue())}),Yi&&Xe.onDidFocusEditorText(()=>{Qi&&Jn(),Yi(Xe.getValue())}),Qi){Jn();try{Xe.onDidPaste(Ki=>{const Ue=Xe.getSelection(),Gn=Or.current.pastePos||{},uo=new cn.Range(Gn.startLineNumber||Ue.endLineNumber,Gn.startColumn||Ue.endColumn,Gn.endLineNumber||Ue.endLineNumber,Gn.endColumn||Ue.endColumn);Xe.executeEdits("",[{range:Ki.range,text:""}])})}catch(Ki){}}let ri=xt();return Li&&typeof Li=="string"&&new Ct(Li,Xe,cn),Qe(!0),()=>{const Ki=Or.current.instance;Ki.dispose();const Ue=Ki.getModel();Ue&&Ue.dispose(),Or.current.subscription&&Or.current.subscription.dispose(),ri.unobserve(Oa.current)}}catch(Xe){}})},[]),(0,It.useEffect)(()=>{if(Or.current.instance&&bs)return document.addEventListener("keydown",fi,!1),()=>{document.removeEventListener("keydown",fi)}},[yi,bs]),(0,It.useEffect)(()=>{let xe=Or.current.instance;if(xe&&bs){let Xe=sn(wt);cn.editor.setModelLanguage(xe.getModel(),Xe)}},[wt,bs]),(0,It.useEffect)(()=>{Or.current.instance&&bs&&cn.editor.setTheme(be)},[be,bs]),(0,It.useEffect)(()=>{let xe=Or.current.instance;Il.current=Ut,xe&&bs&&(xe.updateOptions($n({},Ut)),setTimeout(()=>{xe.getModel().updateOptions($n({},Ut))},200))},[JSON.stringify(Ut),bs]),(0,It.useEffect)(()=>{let xe=Or.current.instance;xe&&bs&&xe.layout()},[Bn,Ht,bs]);const[le,Oe]=(0,It.useState)(Kt(Bn)),[On,Wn]=(0,It.useState)(Kt(Ht)),Mi=di($n({},At),{width:le,height:On,position:"relative"});return It.createElement("div",{className:"my-monaco-editor",ref:Oa,style:Mi},zi&&It.createElement(re.CopyToClipboard,{text:Mt,onCopy:()=>zt.ZP.success("\u590D\u5236\u6210\u529F")},It.createElement(Qt.Z,{title:"\u590D\u5236\u4EE3\u7801"},It.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},It.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function he({width:Te="100%",height:Nn="100%",original:Bn,modified:Ht,language:Mt,options:wt={}}){const At=(0,It.useRef)(),[Ut,Et]=(0,It.useState)(null);function be(ei){let Qi;return At.current&&(Qi=new ce.Z(Mn=>{for(let sr of Mn)(sr.target.offsetHeight>0||sr.target.offsetWidth>0)&&ei.layout()}),Qi.observe(At.current)),Qi}(0,It.useEffect)(()=>(At.current&&Promise.all([Jt.e(5552),Jt.e(9404)]).then(Jt.bind(Jt,50048)).then(ei=>{cn=ei;const Qi=cn.editor.createDiffEditor(At.current,di($n({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},wt),{wordWrap:!0}));Et(Qi);let Mn=be(Qi);return()=>{Qi.dispose();const sr=Qi.getModel();sr&&sr.dispose(),Mn.unobserve(At.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,It.useEffect)(()=>{Ut&&Ut.setModel({original:cn.editor.createModel(Bn,Mt),modified:cn.editor.createModel(Ht,Mt)})},[Bn,Ht,Mt,Ut]);const Dn=Kt(Te),zi=Kt(Nn),yi={width:Dn,height:zi};return It.createElement("div",{className:"my-diff-editor",ref:At,style:yi})}},99914:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return ce}});var It=Jt(67294);function ce(Be,qe){const Se=(0,It.useRef)();(0,It.useEffect)(()=>{Se.current=Be}),(0,It.useEffect)(()=>{function de(){Se.current()}if(qe!==null){let $t=setInterval(de,qe);return()=>clearInterval($t)}},[qe])}},11264:function(on,In,Jt){"use strict";Jt.r(In),Jt.d(In,{default:function(){return ke}});var It=Jt(67294),ce=Jt(35567),Be=Jt(35973),qe=Jt(50136),Se=Jt(26058),de=Jt(91773),$t=Jt(2453),He=Jt(85673),ve=Jt(71230),Pe=Jt(15746),ze=Jt(88044),Me=Jt(28802),tn=Jt(96074),Nt=Jt(38089),nt=Jt(85804),et=Jt(70757),ht={flex_box_center:"flex_box_center___oUI48",flex_space_between:"flex_space_between___ygvRP",flex_box_vertical_center:"flex_box_vertical_center___eHXbG",flex_box_center_end:"flex_box_center_end___VqFf6",flex_box_column:"flex_box_column___VdaxG",bg:"bg___AuzLD",title:"title___ig1Ym",titleLeft:"titleLeft___HQ0Kv",titleRight:"titleRight___gvlMr",btns:"btns___vjaR0"},lt=Object.defineProperty,pt=Object.getOwnPropertySymbols,vt=Object.prototype.hasOwnProperty,Ct=Object.prototype.propertyIsEnumerable,bt=(Ke,Fe,wn)=>Fe in Ke?lt(Ke,Fe,{enumerable:!0,configurable:!0,writable:!0,value:wn}):Ke[Fe]=wn,zt=(Ke,Fe)=>{for(var wn in Fe||(Fe={}))vt.call(Fe,wn)&&bt(Ke,wn,Fe[wn]);if(pt)for(var wn of pt(Fe))Ct.call(Fe,wn)&&bt(Ke,wn,Fe[wn]);return Ke},Qt=(Ke,Fe)=>{var wn={};for(var Rn in Ke)vt.call(Ke,Rn)&&Fe.indexOf(Rn)<0&&(wn[Rn]=Ke[Rn]);if(Ke!=null&&pt)for(var Rn of pt(Ke))Fe.indexOf(Rn)<0&&Ct.call(Ke,Rn)&&(wn[Rn]=Ke[Rn]);return wn},ie=(Ke,Fe,wn)=>new Promise((Rn,$n)=>{var di=Kt=>{try{_t(wn.next(Kt))}catch(pn){$n(pn)}},ee=Kt=>{try{_t(wn.throw(Kt))}catch(pn){$n(pn)}},_t=Kt=>Kt.done?Rn(Kt.value):Promise.resolve(Kt.value).then(di,ee);_t((wn=wn.apply(Ke,Fe)).next())});const{SubMenu:oe}=qe.default,{Content:re,Sider:Ne}=Se.default,ue=Ke=>{var Fe=Ke,{graduation:wn,globalSetting:Rn,loading:$n,user:di,dispatch:ee}=Fe,_t=Qt(Fe,["graduation","globalSetting","loading","user","dispatch"]),Kt,pn,Ln,Ce,sn,cn,Jn,Sn;const he=(0,Be.useParams)(),Te=(0,Be.useLocation)(),{userInfo:Nn}=di,[Bn]=de.default.useForm(),{editTopicData:Ht}=wn,Mt=()=>ie(void 0,null,function*(){const wt=Bn.getFieldsValue(),At=zt({},wt);At.city&&(At.province=At.city[0],At.city=At.city[1]);const Ut=yield ee({type:"graduation/editTopic",payload:{categoryId:he.categoryId,coursesId:he.coursesId,attachment_ids:[],graduation_topic:At}});Ut.status?$t.ZP.error(Ut.message):Be.history.push(`/classrooms/${he.coursesId}/graduation_topics/${Ht.left_banner_id}`)});return(0,It.useEffect)(()=>{function wt(){return ie(this,null,function*(){const At=yield ee({type:"graduation/editTopicDefaultData",payload:zt({},he)}),Ut=zt({},At.selected_data);Ut.city=[Ut.province,Ut.city],Bn.setFieldsValue(Ut)})}wt()},[he.coursesId]),It.createElement("section",{className:"edu-container"},It.createElement("section",{className:"animated fadeIn"},It.createElement("aside",{className:"mt10"},Nn&&It.createElement(He.Z,{separator:">"},It.createElement(He.Z.Item,null,It.createElement(Be.Link,{to:`${Nn.first_category_url}`},(Kt=Nn==null?void 0:Nn.course)==null?void 0:Kt.course_name)),It.createElement(He.Z.Item,null,It.createElement(Be.Link,{to:`/classrooms/${he.coursesId}/graduation_topics/${Ht.left_banner_id}`},"\u6BD5\u8BBE\u9009\u9898")),It.createElement(He.Z.Item,null,"\u7F16\u8F91"))),It.createElement("aside",{className:[ht.title,"mt20"].join(" ")},It.createElement(ve.Z,{style:{width:"100%"}},It.createElement(Pe.Z,{flex:"1"},It.createElement("strong",{className:"font20 ml5"},"\u7F16\u8F91\u6BD5\u8BBE\u9009\u9898")),It.createElement(Pe.Z,null,It.createElement(Be.Link,{className:"font16 c-light-black",to:`/classrooms/${he.coursesId}/graduation_topics/${Ht.left_banner_id}`},"\u8FD4\u56DE"))))),It.createElement("section",{className:[ht.bg,"pt30","pl30","pr30","pb30","mt20"].join(" ")},It.createElement(de.default,{layout:"vertical",form:Bn,scrollToFirstError:!0,initialValues:Ht==null?void 0:Ht.selected_data,onFinish:wt=>ie(void 0,null,function*(){Mt()})},It.createElement(de.default.Item,{name:"tea_id",label:"\u6307\u5BFC\u8001\u5E08\uFF1A",rules:[{required:!0,message:"\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08"}]},It.createElement(ze.default,{size:"middle",placeholder:"\u8BF7\u9009\u62E9\u6307\u5BFC\u8001\u5E08",style:{width:200}},(pn=Ht.teacher_list)==null?void 0:pn.map(function(wt,At){return It.createElement(ze.default.Option,{value:wt.id,key:At},wt.name)}))),It.createElement(de.default.Item,{name:"name",label:"\u9009\u9898\u540D\u79F0\uFF1A",rules:[{required:!0,message:"\u8BF7\u586B\u5199\u8BD5\u5377\u6807\u9898"}]},It.createElement(Me.default,{maxLength:60,size:"middle",placeholder:"\u8BD5\u5377\u6807\u9898\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26"})),It.createElement(tn.Z,null),It.createElement(de.default.Item,{label:"\u9009\u9898\u7B80\u4ECB",name:"description",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5185\u5BB9"}]},It.createElement(ce.Z,{watch:!0,defaultValue:(Ln=Ht.selected_data)==null?void 0:Ln.description,placeholder:"\u8BF7\u7B80\u8981\u8BF4\u660E\u9009\u9898\u5185\u5BB9\uFF0C\u6700\u5927\u9650\u52365000\u4E2A\u5B57\u7B26"})),It.createElement(ve.Z,{gutter:[20,0]},It.createElement(Pe.Z,{flex:"1"},It.createElement(de.default.Item,{name:"topic_type"},It.createElement(ze.default,{size:"middle",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u7C7B\u578B"},(Ce=Ht.topic_type)==null?void 0:Ce.map(function(wt,At){return It.createElement(ze.default.Option,{value:wt.id,key:At},wt.name)})))),It.createElement(Pe.Z,{flex:"1"},It.createElement(de.default.Item,{name:"topic_source"},It.createElement(ze.default,{size:"middle",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6765\u6E90"},(sn=Ht.topic_source)==null?void 0:sn.map(function(wt,At){return It.createElement(ze.default.Option,{value:wt.id,key:At},wt.name)})))),It.createElement(Pe.Z,{flex:"1"},It.createElement(de.default.Item,{name:"topic_property_first"},It.createElement(ze.default,{size:"middle",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6027\u8D281"},(cn=Ht.topic_property_first)==null?void 0:cn.map(function(wt,At){return It.createElement(ze.default.Option,{value:wt.id,key:At},wt.name)})))),It.createElement(Pe.Z,{flex:"1"},It.createElement(de.default.Item,{name:"topic_property_second"},It.createElement(ze.default,{size:"middle",placeholder:"\u8BF7\u9009\u62E9\u9009\u9898\u6027\u8D282"},(Jn=Ht.topic_property_second)==null?void 0:Jn.map(function(wt,At){return It.createElement(ze.default.Option,{value:wt.id,key:At},wt.name)})))),It.createElement(Pe.Z,{flex:"150px"})),It.createElement(tn.Z,null),It.createElement(de.default.Item,{name:"source_unit",label:"\u9009\u9898\u6765\u6E90\u5355\u4F4D\uFF1A"},It.createElement(Me.default,{width:"200",size:"middle",style:{width:200},placeholder:"\u8BF7\u586B\u5199\u6765\u6E90\u5355\u4F4D"})),It.createElement(de.default.Item,{name:"topic_repeat",label:"\u9009\u9898\u91CD\u590D\u60C5\u51B5\uFF1A"},It.createElement(ze.default,{size:"middle",placeholder:"\u8BF7\u9009\u62E9\u91CD\u590D\u60C5\u51B5",style:{width:200}},(Sn=Ht.topic_repeat)==null?void 0:Sn.map(function(wt,At){return It.createElement(ze.default.Option,{value:wt.id,key:At},wt.name)}))),It.createElement(de.default.Item,{name:"city",label:"\u8C03\u7814\u6216\u5B9E\u4E60\u5730\u70B9\uFF1A"},It.createElement(Nt.Z,{size:"middle",style:{width:200},options:et.P,placeholder:"\u8BF7\u9009\u62E9\u6240\u5728\u5730"})))),It.createElement("aside",{className:ht.btns},It.createElement(nt.ZP,{type:"primary",onClick:()=>{Bn.submit()}},"\u4FDD\u5B58"),It.createElement(Be.Link,{to:`/classrooms/${he.coursesId}/graduation_topics/${he.categoryId}`},"\u53D6\u6D88")))};var ke=(0,Be.connect)(({graduation:Ke,loading:Fe,user:wn,globalSetting:Rn})=>({graduation:Ke,globalSetting:Rn,user:wn,loading:Fe.effects}))(ue)},70757:function(on,In,Jt){"use strict";Jt.d(In,{P:function(){return It}});const It=[{value:"\u5317\u4EAC",label:"\u5317\u4EAC",children:[{value:"\u4E1C\u57CE",label:"\u4E1C\u57CE"},{value:"\u897F\u57CE",label:"\u897F\u57CE"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u4E30\u53F0",label:"\u4E30\u53F0"},{value:"\u77F3\u666F\u5C71",label:"\u77F3\u666F\u5C71"},{value:"\u6D77\u6DC0",label:"\u6D77\u6DC0"},{value:"\u95E8\u5934\u6C9F",label:"\u95E8\u5934\u6C9F"},{value:"\u623F\u5C71",label:"\u623F\u5C71"},{value:"\u901A\u5DDE",label:"\u901A\u5DDE"},{value:"\u987A\u4E49",label:"\u987A\u4E49"},{value:"\u660C\u5E73",label:"\u660C\u5E73"},{value:"\u5927\u5174",label:"\u5927\u5174"},{value:"\u5E73\u8C37",label:"\u5E73\u8C37"},{value:"\u6000\u67D4",label:"\u6000\u67D4"},{value:"\u5BC6\u4E91",label:"\u5BC6\u4E91"},{value:"\u5EF6\u5E86",label:"\u5EF6\u5E86"}]},{value:"\u4E0A\u6D77",label:"\u4E0A\u6D77",children:[{value:"\u5D07\u660E",label:"\u5D07\u660E"},{value:"\u9EC4\u6D66",label:"\u9EC4\u6D66"},{value:"\u5362\u6E7E",label:"\u5362\u6E7E"},{value:"\u5F90\u6C47",label:"\u5F90\u6C47"},{value:"\u957F\u5B81",label:"\u957F\u5B81"},{value:"\u9759\u5B89",label:"\u9759\u5B89"},{value:"\u666E\u9640",label:"\u666E\u9640"},{value:"\u95F8\u5317",label:"\u95F8\u5317"},{value:"\u8679\u53E3",label:"\u8679\u53E3"},{value:"\u6768\u6D66",label:"\u6768\u6D66"},{value:"\u95F5\u884C",label:"\u95F5\u884C"},{value:"\u5B9D\u5C71",label:"\u5B9D\u5C71"},{value:"\u5609\u5B9A",label:"\u5609\u5B9A"},{value:"\u6D66\u4E1C",label:"\u6D66\u4E1C"},{value:"\u91D1\u5C71",label:"\u91D1\u5C71"},{value:"\u677E\u6C5F",label:"\u677E\u6C5F"},{value:"\u9752\u6D66",label:"\u9752\u6D66"},{value:"\u5357\u6C47",label:"\u5357\u6C47"},{value:"\u5949\u8D24",label:"\u5949\u8D24"}]},{value:"\u5E7F\u4E1C",label:"\u5E7F\u4E1C",children:[{value:"\u5E7F\u5DDE",label:"\u5E7F\u5DDE"},{value:"\u6DF1\u5733",label:"\u6DF1\u5733"},{value:"\u73E0\u6D77",label:"\u73E0\u6D77"},{value:"\u4E1C\u839E",label:"\u4E1C\u839E"},{value:"\u4E2D\u5C71",label:"\u4E2D\u5C71"},{value:"\u4F5B\u5C71",label:"\u4F5B\u5C71"},{value:"\u60E0\u5DDE",label:"\u60E0\u5DDE"},{value:"\u6CB3\u6E90",label:"\u6CB3\u6E90"},{value:"\u6F6E\u5DDE",label:"\u6F6E\u5DDE"},{value:"\u6C5F\u95E8",label:"\u6C5F\u95E8"},{value:"\u63ED\u9633",label:"\u63ED\u9633"},{value:"\u8302\u540D",label:"\u8302\u540D"},{value:"\u6885\u5DDE",label:"\u6885\u5DDE"},{value:"\u6E05\u8FDC",label:"\u6E05\u8FDC"},{value:"\u6C55\u5934",label:"\u6C55\u5934"},{value:"\u6C55\u5C3E",label:"\u6C55\u5C3E"},{value:"\u97F6\u5173",label:"\u97F6\u5173"},{value:"\u987A\u5FB7",label:"\u987A\u5FB7"},{value:"\u9633\u6C5F",label:"\u9633\u6C5F"},{value:"\u4E91\u6D6E",label:"\u4E91\u6D6E"},{value:"\u6E5B\u6C5F",label:"\u6E5B\u6C5F"},{value:"\u8087\u5E86",label:"\u8087\u5E86"}]},{value:"\u6C5F\u82CF",label:"\u6C5F\u82CF",children:[{value:"\u5357\u4EAC",label:"\u5357\u4EAC"},{value:"\u5E38\u719F",label:"\u5E38\u719F"},{value:"\u5E38\u5DDE",label:"\u5E38\u5DDE"},{value:"\u6D77\u95E8",label:"\u6D77\u95E8"},{value:"\u6DEE\u5B89",label:"\u6DEE\u5B89"},{value:"\u6C5F\u90FD",label:"\u6C5F\u90FD"},{value:"\u6C5F\u9634",label:"\u6C5F\u9634"},{value:"\u6606\u5C71",label:"\u6606\u5C71"},{value:"\u8FDE\u4E91\u6E2F",label:"\u8FDE\u4E91\u6E2F"},{value:"\u5357\u901A",label:"\u5357\u901A"},{value:"\u542F\u4E1C",label:"\u542F\u4E1C"},{value:"\u6CAD\u9633",label:"\u6CAD\u9633"},{value:"\u5BBF\u8FC1",label:"\u5BBF\u8FC1"},{value:"\u82CF\u5DDE",label:"\u82CF\u5DDE"},{value:"\u592A\u4ED3",label:"\u592A\u4ED3"},{value:"\u6CF0\u5DDE",label:"\u6CF0\u5DDE"},{value:"\u540C\u91CC",label:"\u540C\u91CC"},{value:"\u65E0\u9521",label:"\u65E0\u9521"},{value:"\u5F90\u5DDE",label:"\u5F90\u5DDE"},{value:"\u76D0\u57CE",label:"\u76D0\u57CE"},{value:"\u626C\u5DDE",label:"\u626C\u5DDE"},{value:"\u5B9C\u5174",label:"\u5B9C\u5174"},{value:"\u4EEA\u5F81",label:"\u4EEA\u5F81"},{value:"\u5F20\u5BB6\u6E2F",label:"\u5F20\u5BB6\u6E2F"},{value:"\u9547\u6C5F",label:"\u9547\u6C5F"}]},{value:"\u91CD\u5E86",label:"\u91CD\u5E86",children:[{value:"\u4E07\u5DDE",label:"\u4E07\u5DDE"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u6E1D\u4E2D",label:"\u6E1D\u4E2D"},{value:"\u5927\u6E21\u53E3",label:"\u5927\u6E21\u53E3"},{value:"\u6C5F\u5317",label:"\u6C5F\u5317"},{value:"\u6C99\u576A\u575D",label:"\u6C99\u576A\u575D"},{value:"\u4E5D\u9F99\u5761",label:"\u4E5D\u9F99\u5761"},{value:"\u5357\u5CB8",label:"\u5357\u5CB8"},{value:"\u5317\u789A",label:"\u5317\u789A"},{value:"\u4E07\u76DB",label:"\u4E07\u76DB"},{value:"\u53CC\u6322",label:"\u53CC\u6322"},{value:"\u6E1D\u5317",label:"\u6E1D\u5317"},{value:"\u5DF4\u5357",label:"\u5DF4\u5357"},{value:"\u9ED4\u6C5F",label:"\u9ED4\u6C5F"},{value:"\u957F\u5BFF",label:"\u957F\u5BFF"},{value:"\u7DA6\u6C5F",label:"\u7DA6\u6C5F"},{value:"\u6F7C\u5357",label:"\u6F7C\u5357"},{value:"\u94DC\u6881",label:"\u94DC\u6881"},{value:"\u5927\u8DB3",label:"\u5927\u8DB3"},{value:"\u8363\u660C",label:"\u8363\u660C"},{value:"\u58C1\u5C71",label:"\u58C1\u5C71"},{value:"\u6881\u5E73",label:"\u6881\u5E73"},{value:"\u57CE\u53E3",label:"\u57CE\u53E3"},{value:"\u4E30\u90FD",label:"\u4E30\u90FD"},{value:"\u57AB\u6C5F",label:"\u57AB\u6C5F"},{value:"\u6B66\u9686",label:"\u6B66\u9686"},{value:"\u5FE0\u53BF",label:"\u5FE0\u53BF"},{value:"\u5F00\u53BF",label:"\u5F00\u53BF"},{value:"\u4E91\u9633",label:"\u4E91\u9633"},{value:"\u5949\u8282",label:"\u5949\u8282"},{value:"\u5DEB\u5C71",label:"\u5DEB\u5C71"},{value:"\u5DEB\u6EAA",label:"\u5DEB\u6EAA"},{value:"\u77F3\u67F1",label:"\u77F3\u67F1"},{value:"\u79C0\u5C71",label:"\u79C0\u5C71"},{value:"\u9149\u9633",label:"\u9149\u9633"},{value:"\u5F6D\u6C34",label:"\u5F6D\u6C34"},{value:"\u6C5F\u6D25",label:"\u6C5F\u6D25"},{value:"\u5408\u5DDD",label:"\u5408\u5DDD"},{value:"\u6C38\u5DDD",label:"\u6C38\u5DDD"},{value:"\u5357\u5DDD",label:"\u5357\u5DDD"}]},{value:"\u5B89\u5FBD",label:"\u5B89\u5FBD",children:[{value:"\u5408\u80A5",label:"\u5408\u80A5"},{value:"\u5B89\u5E86",label:"\u5B89\u5E86"},{value:"\u868C\u57E0",label:"\u868C\u57E0"},{value:"\u4EB3\u5DDE",label:"\u4EB3\u5DDE"},{value:"\u5DE2\u6E56",label:"\u5DE2\u6E56"},{value:"\u6EC1\u5DDE",label:"\u6EC1\u5DDE"},{value:"\u961C\u9633",label:"\u961C\u9633"},{value:"\u8D35\u6C60",label:"\u8D35\u6C60"},{value:"\u6DEE\u5317",label:"\u6DEE\u5317"},{value:"\u6DEE\u5316",label:"\u6DEE\u5316"},{value:"\u6DEE\u5357",label:"\u6DEE\u5357"},{value:"\u9EC4\u5C71",label:"\u9EC4\u5C71"},{value:"\u4E5D\u534E\u5C71",label:"\u4E5D\u534E\u5C71"},{value:"\u516D\u5B89",label:"\u516D\u5B89"},{value:"\u9A6C\u978D\u5C71",label:"\u9A6C\u978D\u5C71"},{value:"\u5BBF\u5DDE",label:"\u5BBF\u5DDE"},{value:"\u94DC\u9675",label:"\u94DC\u9675"},{value:"\u5C6F\u6EAA",label:"\u5C6F\u6EAA"},{value:"\u829C\u6E56",label:"\u829C\u6E56"},{value:"\u5BA3\u57CE",label:"\u5BA3\u57CE"}]},{value:"\u798F\u5EFA",label:"\u798F\u5EFA",children:[{value:"\u798F\u5DDE",label:"\u798F\u5DDE"},{value:"\u53A6\u95E8",label:"\u53A6\u95E8"},{value:"\u6CC9\u5DDE",label:"\u6CC9\u5DDE"},{value:"\u6F33\u5DDE",label:"\u6F33\u5DDE"},{value:"\u9F99\u5CA9",label:"\u9F99\u5CA9"},{value:"\u5357\u5E73",label:"\u5357\u5E73"},{value:"\u5B81\u5FB7",label:"\u5B81\u5FB7"},{value:"\u8386\u7530",label:"\u8386\u7530"},{value:"\u4E09\u660E",label:"\u4E09\u660E"}]},{value:"\u7518\u8083",label:"\u7518\u8083",children:[{value:"\u5170\u5DDE",label:"\u5170\u5DDE"},{value:"\u5609\u5CEA\u5173",label:"\u5609\u5CEA\u5173"},{value:"\u767D\u94F6",label:"\u767D\u94F6"},{value:"\u5B9A\u897F",label:"\u5B9A\u897F"},{value:"\u6566\u714C",label:"\u6566\u714C"},{value:"\u7518\u5357",label:"\u7518\u5357"},{value:"\u91D1\u660C",label:"\u91D1\u660C"},{value:"\u9152\u6CC9",label:"\u9152\u6CC9"},{value:"\u4E34\u590F",label:"\u4E34\u590F"},{value:"\u5E73\u51C9",label:"\u5E73\u51C9"},{value:"\u5929\u6C34",label:"\u5929\u6C34"},{value:"\u9647\u5357",label:"\u9647\u5357"},{value:"\u6B66\u5A01",label:"\u6B66\u5A01"},{value:"\u897F\u5CF0",label:"\u897F\u5CF0"},{value:"\u5F20\u6396",label:"\u5F20\u6396"}]},{value:"\u5E7F\u897F",label:"\u5E7F\u897F",children:[{value:"\u5357\u5B81",label:"\u5357\u5B81"},{value:"\u6765\u5BBE",label:"\u6765\u5BBE"},{value:"\u767E\u8272",label:"\u767E\u8272"},{value:"\u5317\u6D77",label:"\u5317\u6D77"},{value:"\u6842\u6797",label:"\u6842\u6797"},{value:"\u9632\u57CE\u6E2F",label:"\u9632\u57CE\u6E2F"},{value:"\u8D35\u6E2F",label:"\u8D35\u6E2F"},{value:"\u6CB3\u6C60",label:"\u6CB3\u6C60"},{value:"\u8D3A\u5DDE",label:"\u8D3A\u5DDE"},{value:"\u67F3\u5DDE",label:"\u67F3\u5DDE"},{value:"\u94A6\u5DDE",label:"\u94A6\u5DDE"},{value:"\u68A7\u5DDE",label:"\u68A7\u5DDE"},{value:"\u7389\u6797",label:"\u7389\u6797"}]},{value:"\u8D35\u5DDE",label:"\u8D35\u5DDE",children:[{value:"\u8D35\u9633",label:"\u8D35\u9633"},{value:"\u5B89\u987A",label:"\u5B89\u987A"},{value:"\u6BD5\u8282",label:"\u6BD5\u8282"},{value:"\u90FD\u5300",label:"\u90FD\u5300"},{value:"\u51EF\u91CC",label:"\u51EF\u91CC"},{value:"\u516D\u76D8\u6C34",label:"\u516D\u76D8\u6C34"},{value:"\u94DC\u4EC1",label:"\u94DC\u4EC1"},{value:"\u5174\u4E49",label:"\u5174\u4E49"},{value:"\u7389\u5C4F",label:"\u7389\u5C4F"},{value:"\u9075\u4E49",label:"\u9075\u4E49"}]},{value:"\u6D77\u5357",label:"\u6D77\u5357",children:[{value:"\u6D77\u53E3",label:"\u6D77\u53E3"},{value:"\u510B\u53BF",label:"\u510B\u53BF"},{value:"\u9675\u6C34",label:"\u9675\u6C34"},{value:"\u743C\u6D77",label:"\u743C\u6D77"},{value:"\u4E09\u4E9A",label:"\u4E09\u4E9A"},{value:"\u901A\u4EC0",label:"\u901A\u4EC0"},{value:"\u4E07\u5B81",label:"\u4E07\u5B81"}]},{value:"\u6CB3\u5317",label:"\u6CB3\u5317",children:[{value:"\u77F3\u5BB6\u5E84",label:"\u77F3\u5BB6\u5E84"},{value:"\u4FDD\u5B9A",label:"\u4FDD\u5B9A"},{value:"\u5317\u6234\u6CB3",label:"\u5317\u6234\u6CB3"},{value:"\u6CA7\u5DDE",label:"\u6CA7\u5DDE"},{value:"\u627F\u5FB7",label:"\u627F\u5FB7"},{value:"\u4E30\u6DA6",label:"\u4E30\u6DA6"},{value:"\u90AF\u90F8",label:"\u90AF\u90F8"},{value:"\u8861\u6C34",label:"\u8861\u6C34"},{value:"\u5ECA\u574A",label:"\u5ECA\u574A"},{value:"\u5357\u6234\u6CB3",label:"\u5357\u6234\u6CB3"},{value:"\u79E6\u7687\u5C9B",label:"\u79E6\u7687\u5C9B"},{value:"\u5510\u5C71",label:"\u5510\u5C71"},{value:"\u65B0\u57CE",label:"\u65B0\u57CE"},{value:"\u90A2\u53F0",label:"\u90A2\u53F0"},{value:"\u5F20\u5BB6\u53E3",label:"\u5F20\u5BB6\u53E3"}]},{value:"\u9ED1\u9F99\u6C5F",label:"\u9ED1\u9F99\u6C5F",children:[{value:"\u54C8\u5C14\u6EE8",label:"\u54C8\u5C14\u6EE8"},{value:"\u5317\u5B89",label:"\u5317\u5B89"},{value:"\u5927\u5E86",label:"\u5927\u5E86"},{value:"\u5927\u5174\u5B89\u5CAD",label:"\u5927\u5174\u5B89\u5CAD"},{value:"\u9E64\u5C97",label:"\u9E64\u5C97"},{value:"\u9ED1\u6CB3",label:"\u9ED1\u6CB3"},{value:"\u4F73\u6728\u65AF",label:"\u4F73\u6728\u65AF"},{value:"\u9E21\u897F",label:"\u9E21\u897F"},{value:"\u7261\u4E39\u6C5F",label:"\u7261\u4E39\u6C5F"},{value:"\u9F50\u9F50\u54C8\u5C14",label:"\u9F50\u9F50\u54C8\u5C14"},{value:"\u4E03\u53F0\u6CB3",label:"\u4E03\u53F0\u6CB3"},{value:"\u53CC\u9E2D\u5C71",label:"\u53CC\u9E2D\u5C71"},{value:"\u7EE5\u5316",label:"\u7EE5\u5316"},{value:"\u4F0A\u6625",label:"\u4F0A\u6625"}]},{value:"\u6CB3\u5357",label:"\u6CB3\u5357",children:[{value:"\u90D1\u5DDE",label:"\u90D1\u5DDE"},{value:"\u5B89\u9633",label:"\u5B89\u9633"},{value:"\u9E64\u58C1",label:"\u9E64\u58C1"},{value:"\u6F62\u5DDD",label:"\u6F62\u5DDD"},{value:"\u7126\u4F5C",label:"\u7126\u4F5C"},{value:"\u6D4E\u6E90",label:"\u6D4E\u6E90"},{value:"\u5F00\u5C01",label:"\u5F00\u5C01"},{value:"\u6F2F\u6CB3",label:"\u6F2F\u6CB3"},{value:"\u6D1B\u9633",label:"\u6D1B\u9633"},{value:"\u5357\u9633",label:"\u5357\u9633"},{value:"\u5E73\u9876\u5C71",label:"\u5E73\u9876\u5C71"},{value:"\u6FEE\u9633",label:"\u6FEE\u9633"},{value:"\u4E09\u95E8\u5CE1",label:"\u4E09\u95E8\u5CE1"},{value:"\u5546\u4E18",label:"\u5546\u4E18"},{value:"\u65B0\u4E61",label:"\u65B0\u4E61"},{value:"\u4FE1\u9633",label:"\u4FE1\u9633"},{value:"\u8BB8\u660C",label:"\u8BB8\u660C"},{value:"\u5468\u53E3",label:"\u5468\u53E3"},{value:"\u9A7B\u9A6C\u5E97",label:"\u9A7B\u9A6C\u5E97"}]},{value:"\u9999\u6E2F",label:"\u9999\u6E2F",children:[{value:"\u9999\u6E2F",label:"\u9999\u6E2F"},{value:"\u4E5D\u9F99",label:"\u4E5D\u9F99"},{value:"\u65B0\u754C",label:"\u65B0\u754C"}]},{value:"\u6E56\u5317",label:"\u6E56\u5317",children:[{value:"\u6B66\u6C49",label:"\u6B66\u6C49"},{value:"\u5929\u95E8",label:"\u5929\u95E8"},{value:"\u6069\u65BD",label:"\u6069\u65BD"},{value:"\u9102\u5DDE",label:"\u9102\u5DDE"},{value:"\u9EC4\u5188",label:"\u9EC4\u5188"},{value:"\u9EC4\u77F3",label:"\u9EC4\u77F3"},{value:"\u8346\u95E8",label:"\u8346\u95E8"},{value:"\u8346\u5DDE",label:"\u8346\u5DDE"},{value:"\u6F5C\u6C5F",label:"\u6F5C\u6C5F"},{value:"\u5341\u5830",label:"\u5341\u5830"},{value:"\u968F\u5DDE",label:"\u968F\u5DDE"},{value:"\u6B66\u7A74",label:"\u6B66\u7A74"},{value:"\u4ED9\u6843",label:"\u4ED9\u6843"},{value:"\u54B8\u5B81",label:"\u54B8\u5B81"},{value:"\u8944\u9633",label:"\u8944\u9633"},{value:"\u8944\u6A0A",label:"\u8944\u6A0A"},{value:"\u5B5D\u611F",label:"\u5B5D\u611F"},{value:"\u5B9C\u660C",label:"\u5B9C\u660C"}]},{value:"\u6E56\u5357",label:"\u6E56\u5357",children:[{value:"\u957F\u6C99",label:"\u957F\u6C99"},{value:"\u5E38\u5FB7",label:"\u5E38\u5FB7"},{value:"\u90F4\u5DDE",label:"\u90F4\u5DDE"},{value:"\u8861\u9633",label:"\u8861\u9633"},{value:"\u6000\u5316",label:"\u6000\u5316"},{value:"\u5409\u9996",label:"\u5409\u9996"},{value:"\u5A04\u5E95",label:"\u5A04\u5E95"},{value:"\u90B5\u9633",label:"\u90B5\u9633"},{value:"\u6E58\u6F6D",label:"\u6E58\u6F6D"},{value:"\u76CA\u9633",label:"\u76CA\u9633"},{value:"\u5CB3\u9633",label:"\u5CB3\u9633"},{value:"\u6C38\u5DDE",label:"\u6C38\u5DDE"},{value:"\u5F20\u5BB6\u754C",label:"\u5F20\u5BB6\u754C"},{value:"\u682A\u6D32",label:"\u682A\u6D32"}]},{value:"\u6C5F\u897F",label:"\u6C5F\u897F",children:[{value:"\u5357\u660C",label:"\u5357\u660C"},{value:"\u629A\u5DDE",label:"\u629A\u5DDE"},{value:"\u8D63\u5DDE",label:"\u8D63\u5DDE"},{value:"\u5409\u5B89",label:"\u5409\u5B89"},{value:"\u666F\u5FB7\u9547",label:"\u666F\u5FB7\u9547"},{value:"\u4E95\u5188\u5C71",label:"\u4E95\u5188\u5C71"},{value:"\u4E5D\u6C5F",label:"\u4E5D\u6C5F"},{value:"\u5E90\u5C71",label:"\u5E90\u5C71"},{value:"\u840D\u4E61",label:"\u840D\u4E61"},{value:"\u4E0A\u9976",label:"\u4E0A\u9976"},{value:"\u65B0\u4F59",label:"\u65B0\u4F59"},{value:"\u5B9C\u6625",label:"\u5B9C\u6625"},{value:"\u9E70\u6F6D",label:"\u9E70\u6F6D"}]},{value:"\u5409\u6797",label:"\u5409\u6797",children:[{value:"\u957F\u6625",label:"\u957F\u6625"},{value:"\u5409\u6797",label:"\u5409\u6797"},{value:"\u767D\u57CE",label:"\u767D\u57CE"},{value:"\u767D\u5C71",label:"\u767D\u5C71"},{value:"\u73F2\u6625",label:"\u73F2\u6625"},{value:"\u8FBD\u6E90",label:"\u8FBD\u6E90"},{value:"\u6885\u6CB3",label:"\u6885\u6CB3"},{value:"\u56DB\u5E73",label:"\u56DB\u5E73"},{value:"\u677E\u539F",label:"\u677E\u539F"},{value:"\u901A\u5316",label:"\u901A\u5316"},{value:"\u5EF6\u5409",label:"\u5EF6\u5409"}]},{value:"\u8FBD\u5B81",label:"\u8FBD\u5B81",children:[{value:"\u6C88\u9633",label:"\u6C88\u9633"},{value:"\u978D\u5C71",label:"\u978D\u5C71"},{value:"\u672C\u6EAA",label:"\u672C\u6EAA"},{value:"\u671D\u9633",label:"\u671D\u9633"},{value:"\u5927\u8FDE",label:"\u5927\u8FDE"},{value:"\u4E39\u4E1C",label:"\u4E39\u4E1C"},{value:"\u629A\u987A",label:"\u629A\u987A"},{value:"\u961C\u65B0",label:"\u961C\u65B0"},{value:"\u846B\u82A6\u5C9B",label:"\u846B\u82A6\u5C9B"},{value:"\u9526\u5DDE",label:"\u9526\u5DDE"},{value:"\u8FBD\u9633",label:"\u8FBD\u9633"},{value:"\u76D8\u9526",label:"\u76D8\u9526"},{value:"\u94C1\u5CAD",label:"\u94C1\u5CAD"},{value:"\u8425\u53E3",label:"\u8425\u53E3"}]},{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8",children:[{value:"\u6FB3\u95E8",label:"\u6FB3\u95E8"}]},{value:"\u5185\u8499\u53E4",label:"\u5185\u8499\u53E4",children:[{value:"\u547C\u548C\u6D69\u7279",label:"\u547C\u548C\u6D69\u7279"},{value:"\u963F\u62C9\u5584\u76DF",label:"\u963F\u62C9\u5584\u76DF"},{value:"\u5305\u5934",label:"\u5305\u5934"},{value:"\u8D64\u5CF0",label:"\u8D64\u5CF0"},{value:"\u4E1C\u80DC",label:"\u4E1C\u80DC"},{value:"\u6D77\u62C9\u5C14",label:"\u6D77\u62C9\u5C14"},{value:"\u96C6\u5B81",label:"\u96C6\u5B81"},{value:"\u4E34\u6CB3",label:"\u4E34\u6CB3"},{value:"\u901A\u8FBD",label:"\u901A\u8FBD"},{value:"\u4E4C\u6D77",label:"\u4E4C\u6D77"},{value:"\u4E4C\u5170\u6D69\u7279",label:"\u4E4C\u5170\u6D69\u7279"},{value:"\u9521\u6797\u6D69\u7279",label:"\u9521\u6797\u6D69\u7279"}]},{value:"\u5B81\u590F",label:"\u5B81\u590F",children:[{value:"\u94F6\u5DDD",label:"\u94F6\u5DDD"},{value:"\u56FA\u6E90",label:"\u56FA\u6E90"},{value:"\u77F3\u5634\u5C71",label:"\u77F3\u5634\u5C71"},{value:"\u5434\u5FE0",label:"\u5434\u5FE0"}]},{value:"\u9752\u6D77",label:"\u9752\u6D77",children:[{value:"\u897F\u5B81",label:"\u897F\u5B81"},{value:"\u5FB7\u4EE4\u54C8",label:"\u5FB7\u4EE4\u54C8"},{value:"\u683C\u5C14\u6728",label:"\u683C\u5C14\u6728"},{value:"\u5171\u548C",label:"\u5171\u548C"},{value:"\u6D77\u4E1C",label:"\u6D77\u4E1C"},{value:"\u6D77\u664F",label:"\u6D77\u664F"},{value:"\u739B\u6C81",label:"\u739B\u6C81"},{value:"\u540C\u4EC1",label:"\u540C\u4EC1"},{value:"\u7389\u6811",label:"\u7389\u6811"}]},{value:"\u5C71\u4E1C",label:"\u5C71\u4E1C",children:[{value:"\u6D4E\u5357",label:"\u6D4E\u5357"},{value:"\u6EE8\u5DDE",label:"\u6EE8\u5DDE"},{value:"\u5156\u5DDE",label:"\u5156\u5DDE"},{value:"\u5FB7\u5DDE",label:"\u5FB7\u5DDE"},{value:"\u4E1C\u8425",label:"\u4E1C\u8425"},{value:"\u83CF\u6CFD",label:"\u83CF\u6CFD"},{value:"\u6D4E\u5B81",label:"\u6D4E\u5B81"},{value:"\u83B1\u829C",label:"\u83B1\u829C"},{value:"\u804A\u57CE",label:"\u804A\u57CE"},{value:"\u4E34\u6C82",label:"\u4E34\u6C82"},{value:"\u84EC\u83B1",label:"\u84EC\u83B1"},{value:"\u9752\u5C9B",label:"\u9752\u5C9B"},{value:"\u66F2\u961C",label:"\u66F2\u961C"},{value:"\u65E5\u7167",label:"\u65E5\u7167"},{value:"\u6CF0\u5B89",label:"\u6CF0\u5B89"},{value:"\u6F4D\u574A",label:"\u6F4D\u574A"},{value:"\u5A01\u6D77",label:"\u5A01\u6D77"},{value:"\u70DF\u53F0",label:"\u70DF\u53F0"},{value:"\u67A3\u5E84",label:"\u67A3\u5E84"},{value:"\u6DC4\u535A",label:"\u6DC4\u535A"}]},{value:"\u5C71\u897F",label:"\u5C71\u897F",children:[{value:"\u592A\u539F",label:"\u592A\u539F"},{value:"\u5415\u6881",label:"\u5415\u6881"},{value:"\u957F\u6CBB",label:"\u957F\u6CBB"},{value:"\u5927\u540C",label:"\u5927\u540C"},{value:"\u5019\u9A6C",label:"\u5019\u9A6C"},{value:"\u664B\u57CE",label:"\u664B\u57CE"},{value:"\u79BB\u77F3",label:"\u79BB\u77F3"},{value:"\u4E34\u6C7E",label:"\u4E34\u6C7E"},{value:"\u5B81\u6B66",label:"\u5B81\u6B66"},{value:"\u6714\u5DDE",label:"\u6714\u5DDE"},{value:"\u5FFB\u5DDE",label:"\u5FFB\u5DDE"},{value:"\u9633\u6CC9",label:"\u9633\u6CC9"},{value:"\u6986\u6B21",label:"\u6986\u6B21"},{value:"\u664B\u4E2D",label:"\u664B\u4E2D"},{value:"\u8FD0\u57CE",label:"\u8FD0\u57CE"}]},{value:"\u9655\u897F",label:"\u9655\u897F",children:[{value:"\u897F\u5B89",label:"\u897F\u5B89"},{value:"\u5B89\u5EB7",label:"\u5B89\u5EB7"},{value:"\u5B9D\u9E21",label:"\u5B9D\u9E21"},{value:"\u6C49\u4E2D",label:"\u6C49\u4E2D"},{value:"\u6E2D\u5357",label:"\u6E2D\u5357"},{value:"\u5546\u5DDE",label:"\u5546\u5DDE"},{value:"\u7EE5\u5FB7",label:"\u7EE5\u5FB7"},{value:"\u94DC\u5DDD",label:"\u94DC\u5DDD"},{value:"\u54B8\u9633",label:"\u54B8\u9633"},{value:"\u5EF6\u5B89",label:"\u5EF6\u5B89"},{value:"\u6986\u6797",label:"\u6986\u6797"}]},{value:"\u56DB\u5DDD",label:"\u56DB\u5DDD",children:[{value:"\u6210\u90FD",label:"\u6210\u90FD"},{value:"\u5DF4\u4E2D",label:"\u5DF4\u4E2D"},{value:"\u8FBE\u5DDD",label:"\u8FBE\u5DDD"},{value:"\u5FB7\u9633",label:"\u5FB7\u9633"},{value:"\u90FD\u6C5F\u5830",label:"\u90FD\u6C5F\u5830"},{value:"\u5CE8\u7709\u5C71",label:"\u5CE8\u7709\u5C71"},{value:"\u6DAA\u9675",label:"\u6DAA\u9675"},{value:"\u5E7F\u5B89",label:"\u5E7F\u5B89"},{value:"\u5E7F\u5143",label:"\u5E7F\u5143"},{value:"\u4E5D\u5BE8\u6C9F",label:"\u4E5D\u5BE8\u6C9F"},{value:"\u5EB7\u5B9A",label:"\u5EB7\u5B9A"},{value:"\u4E50\u5C71",label:"\u4E50\u5C71"},{value:"\u6CF8\u5DDE",label:"\u6CF8\u5DDE"},{value:"\u9A6C\u5C14\u5EB7",label:"\u9A6C\u5C14\u5EB7"},{value:"\u7EF5\u9633",label:"\u7EF5\u9633"},{value:"\u7709\u5C71",label:"\u7709\u5C71"},{value:"\u5357\u5145",label:"\u5357\u5145"},{value:"\u5185\u6C5F",label:"\u5185\u6C5F"},{value:"\u6500\u679D\u82B1",label:"\u6500\u679D\u82B1"},{value:"\u9042\u5B81",label:"\u9042\u5B81"},{value:"\u6C76\u5DDD",label:"\u6C76\u5DDD"},{value:"\u897F\u660C",label:"\u897F\u660C"},{value:"\u96C5\u5B89",label:"\u96C5\u5B89"},{value:"\u5B9C\u5BBE",label:"\u5B9C\u5BBE"},{value:"\u81EA\u8D21",label:"\u81EA\u8D21"},{value:"\u8D44\u9633",label:"\u8D44\u9633"}]},{value:"\u53F0\u6E7E",label:"\u53F0\u6E7E",children:[{value:"\u53F0\u5317",label:"\u53F0\u5317"},{value:"\u57FA\u9686",label:"\u57FA\u9686"},{value:"\u53F0\u5357",label:"\u53F0\u5357"},{value:"\u53F0\u4E2D",label:"\u53F0\u4E2D"},{value:"\u9AD8\u96C4",label:"\u9AD8\u96C4"},{value:"\u5C4F\u4E1C",label:"\u5C4F\u4E1C"},{value:"\u5357\u6295",label:"\u5357\u6295"},{value:"\u4E91\u6797",label:"\u4E91\u6797"},{value:"\u65B0\u7AF9",label:"\u65B0\u7AF9"},{value:"\u5F70\u5316",label:"\u5F70\u5316"},{value:"\u82D7\u6817",label:"\u82D7\u6817"},{value:"\u5609\u4E49",label:"\u5609\u4E49"},{value:"\u6843\u56ED",label:"\u6843\u56ED"},{value:"\u5B9C\u5170",label:"\u5B9C\u5170"},{value:"\u53F0\u4E1C",label:"\u53F0\u4E1C"},{value:"\u91D1\u95E8",label:"\u91D1\u95E8"},{value:"\u9A6C\u7956",label:"\u9A6C\u7956"},{value:"\u6F8E\u6E56",label:"\u6F8E\u6E56"}]},{value:"\u5929\u6D25",label:"\u5929\u6D25",children:[{value:"\u5929\u6D25",label:"\u5929\u6D25"},{value:"\u548C\u5E73",label:"\u548C\u5E73"},{value:"\u4E1C\u4E3D",label:"\u4E1C\u4E3D"},{value:"\u6CB3\u4E1C",label:"\u6CB3\u4E1C"},{value:"\u897F\u9752",label:"\u897F\u9752"},{value:"\u6CB3\u897F",label:"\u6CB3\u897F"},{value:"\u6D25\u5357",label:"\u6D25\u5357"},{value:"\u5357\u5F00",label:"\u5357\u5F00"},{value:"\u5317\u8FB0",label:"\u5317\u8FB0"},{value:"\u6CB3\u5317",label:"\u6CB3\u5317"},{value:"\u6B66\u6E05",label:"\u6B66\u6E05"},{value:"\u7EA2\u6322",label:"\u7EA2\u6322"},{value:"\u5858\u6CBD",label:"\u5858\u6CBD"},{value:"\u6C49\u6CBD",label:"\u6C49\u6CBD"},{value:"\u5927\u6E2F",label:"\u5927\u6E2F"},{value:"\u5B81\u6CB3",label:"\u5B81\u6CB3"},{value:"\u9759\u6D77",label:"\u9759\u6D77"},{value:"\u5B9D\u577B",label:"\u5B9D\u577B"},{value:"\u84DF\u53BF",label:"\u84DF\u53BF"}]},{value:"\u65B0\u7586",label:"\u65B0\u7586",children:[{value:"\u4E4C\u9C81\u6728\u9F50",label:"\u4E4C\u9C81\u6728\u9F50"},{value:"\u963F\u514B\u82CF",label:"\u963F\u514B\u82CF"},{value:"\u963F\u52D2\u6CF0",label:"\u963F\u52D2\u6CF0"},{value:"\u963F\u56FE\u4EC0",label:"\u963F\u56FE\u4EC0"},{value:"\u535A\u4E50",label:"\u535A\u4E50"},{value:"\u660C\u5409",label:"\u660C\u5409"},{value:"\u4E1C\u5C71",label:"\u4E1C\u5C71"},{value:"\u54C8\u5BC6",label:"\u54C8\u5BC6"},{value:"\u548C\u7530",label:"\u548C\u7530"},{value:"\u5580\u4EC0",label:"\u5580\u4EC0"},{value:"\u514B\u62C9\u739B\u4F9D",label:"\u514B\u62C9\u739B\u4F9D"},{value:"\u5E93\u8F66",label:"\u5E93\u8F66"},{value:"\u5E93\u5C14\u52D2",label:"\u5E93\u5C14\u52D2"},{value:"\u594E\u5C6F",label:"\u594E\u5C6F"},{value:"\u77F3\u6CB3\u5B50",label:"\u77F3\u6CB3\u5B50"},{value:"\u5854\u57CE",label:"\u5854\u57CE"},{value:"\u5410\u9C81\u756A",label:"\u5410\u9C81\u756A"},{value:"\u4F0A\u5B81",label:"\u4F0A\u5B81"}]},{value:"\u897F\u85CF",label:"\u897F\u85CF",children:[{value:"\u62C9\u8428",label:"\u62C9\u8428"},{value:"\u963F\u91CC",label:"\u963F\u91CC"},{value:"\u660C\u90FD",label:"\u660C\u90FD"},{value:"\u6797\u829D",label:"\u6797\u829D"},{value:"\u90A3\u66F2",label:"\u90A3\u66F2"},{value:"\u65E5\u5580\u5219",label:"\u65E5\u5580\u5219"},{value:"\u5C71\u5357",label:"\u5C71\u5357"}]},{value:"\u4E91\u5357",label:"\u4E91\u5357",children:[{value:"\u6606\u660E",label:"\u6606\u660E"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4FDD\u5C71",label:"\u4FDD\u5C71"},{value:"\u695A\u96C4",label:"\u695A\u96C4"},{value:"\u5927\u7406",label:"\u5927\u7406"},{value:"\u4E1C\u5DDD",label:"\u4E1C\u5DDD"},{value:"\u4E2A\u65E7",label:"\u4E2A\u65E7"},{value:"\u666F\u6D2A",label:"\u666F\u6D2A"},{value:"\u5F00\u8FDC",label:"\u5F00\u8FDC"},{value:"\u4E34\u6CA7",label:"\u4E34\u6CA7"},{value:"\u4E3D\u6C5F",label:"\u4E3D\u6C5F"},{value:"\u516D\u5E93",label:"\u516D\u5E93"},{value:"\u6F5E\u897F",label:"\u6F5E\u897F"},{value:"\u66F2\u9756",label:"\u66F2\u9756"},{value:"\u601D\u8305",label:"\u601D\u8305"},{value:"\u6587\u5C71",label:"\u6587\u5C71"},{value:"\u897F\u53CC\u7248\u7EB3",label:"\u897F\u53CC\u7248\u7EB3"},{value:"\u7389\u6EAA",label:"\u7389\u6EAA"},{value:"\u4E2D\u7538",label:"\u4E2D\u7538"},{value:"\u662D\u901A",label:"\u662D\u901A"}]},{value:"\u6D59\u6C5F",label:"\u6D59\u6C5F",children:[{value:"\u676D\u5DDE",label:"\u676D\u5DDE"},{value:"\u6E29\u5DDE",label:"\u6E29\u5DDE"},{value:"\u5B89\u5409",label:"\u5B89\u5409"},{value:"\u6148\u6EAA",label:"\u6148\u6EAA"},{value:"\u5B9A\u6D77",label:"\u5B9A\u6D77"},{value:"\u5949\u5316",label:"\u5949\u5316"},{value:"\u6D77\u76D0",label:"\u6D77\u76D0"},{value:"\u9EC4\u5CA9",label:"\u9EC4\u5CA9"},{value:"\u6E56\u5DDE",label:"\u6E56\u5DDE"},{value:"\u5609\u5174",label:"\u5609\u5174"},{value:"\u91D1\u534E",label:"\u91D1\u534E"},{value:"\u4E34\u5B89",label:"\u4E34\u5B89"},{value:"\u4E34\u6D77",label:"\u4E34\u6D77"},{value:"\u4E3D\u6C34",label:"\u4E3D\u6C34"},{value:"\u5B81\u6CE2",label:"\u5B81\u6CE2"},{value:"\u74EF\u6D77",label:"\u74EF\u6D77"},{value:"\u5E73\u6E56",label:"\u5E73\u6E56"},{value:"\u5343\u5C9B\u6E56",label:"\u5343\u5C9B\u6E56"},{value:"\u8862\u5DDE",label:"\u8862\u5DDE"},{value:"\u6C5F\u5C71",label:"\u6C5F\u5C71"},{value:"\u745E\u5B89",label:"\u745E\u5B89"},{value:"\u7ECD\u5174",label:"\u7ECD\u5174"},{value:"\u5D4A\u5DDE",label:"\u5D4A\u5DDE"},{value:"\u53F0\u5DDE",label:"\u53F0\u5DDE"},{value:"\u6E29\u5CAD",label:"\u6E29\u5CAD"},{value:"\u4F59\u59DA",label:"\u4F59\u59DA"},{value:"\u821F\u5C71",label:"\u821F\u5C71"}]},{value:"\u6D77\u5916",label:"\u6D77\u5916",children:[{value:"\u7F8E\u56FD",label:"\u7F8E\u56FD"},{value:"\u65E5\u672C",label:"\u65E5\u672C"},{value:"\u82F1\u56FD",label:"\u82F1\u56FD"},{value:"\u6CD5\u56FD",label:"\u6CD5\u56FD"},{value:"\u5FB7\u56FD",label:"\u5FB7\u56FD"},{value:"\u5176\u4ED6",label:"\u5176\u4ED6"}]}]},51161:function(on,In,Jt){"use strict";Jt.d(In,{AL:function(){return Ct},Iy:function(){return ze},Qv:function(){return Nt},ez:function(){return vt},jb:function(){return Me}});var It=Jt(47084),ce=Jt.n(It),Be=Jt(90621),qe=Jt.n(Be);let Se=1;function de(oe,re){const Ne=oe.match(/^(\s+)(?:```)/);if(Ne===null)return re;const ue=Ne[1];return re.split(`
|
|
`).map(ke=>{const Ke=ke.match(/^\s+/);if(Ke===null)return ke;const[Fe]=Ke;return Fe.length>=ue.length?ke.slice(ue.length):ke}).join(`
|
|
`)}let $t=[],He=["<ul>"];const ve=new(ce()).Renderer,Pe=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function ze(){$t.length=0,He=["<ul>"]}const Me={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function tn(oe,re,Ne,ue){if(re>=oe.length||oe[re].level<=Ne)return re;var ke=oe[re];ue.push("<li><a href='#"+Se+ke.anchor+"'>"+ke.text+"</a>"),re++;var Ke=[];return re=tn(oe,re,ke.level,Ke),Ke.length>0&&(ue.push("<ul>"),Ke.forEach(function(Fe){ue.push(Fe)}),ue.push("</ul>")),ue.push("</li>"),re=tn(oe,re,Ne,ue),re}function Nt(){return tn($t,0,0,He),He.push("</ul>"),He.join("")}const nt={heading(oe){const re=Pe.exec(oe);if(Se+=1,re)return{type:"heading",raw:re[0],depth:re[1].length,text:re[2]}},fences(oe){const re=this.rules.block.fences.exec(oe);if(re){const Ne=re[0];let ue=de(Ne,re[3]||"");const ke=re[2]?re[2].trim():re[2];if(["latex","katex","math"].indexOf(ke)>=0){const Ke=lt(),Fe=ue;ue=Ke,pt[Ke]={type:"block",expression:Fe}}return{type:"code",raw:Ne,lang:ke,text:ue}}}},et=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let ht=0;const lt=()=>`__special_katext_id_${ht++}__`;let pt={};function vt(){return pt}function Ct(){ht=0,pt={}}function bt(oe){return oe=oe.replace(et,(re,Ne)=>{const ue=lt();return pt[ue]={type:"inline",expression:Ne},ue}),oe}const zt=ve.listitem;ve.listitem=function(oe){return zt(bt(oe))};const Qt=ve.paragraph;ve.paragraph=function(oe){return Qt(bt(oe))};const ie=ve.tablecell;ve.tablecell=function(oe,re){return ie(bt(oe),re)},ve.code=function(oe,re,Ne){const ue=(re||"").match(/\S*/)[0];return ue?["latex","katex","math"].indexOf(ue)>=0?`<p class='editormd-tex'>${oe}</p>`:`<pre class="prettyprint linenums"><code class="language-${re}">${Ne?oe:(0,Be.escape)(oe,!0)}</code></pre>
|
|
`:'<pre class="prettyprint linenums"><code>'+(Ne?oe:(0,Be.escape)(oe,!0))+"</code></pre>"},ve.heading=function(oe,re,Ne){let ue=this.options.headerPrefix+Ne.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return $t.push({anchor:ue,level:re,text:oe}),"<h"+re+' id="'+Se+ue+'">'+oe+"</h"+re+">"},ce().setOptions({silent:!0,gfm:!0,pedantic:!1}),ce().use({tokenizer:nt,renderer:ve}),In.ZP=ce()},88386:function(on,In,Jt){(function(It){It(Jt(4631))})(function(It){It.defineOption("placeholder","",function(He,ve,Pe){var ze=Pe&&Pe!=It.Init;if(ve&&!ze)He.on("blur",Se),He.on("change",de),He.on("swapDoc",de),It.on(He.getInputField(),"compositionupdate",He.state.placeholderCompose=function(){qe(He)}),de(He);else if(!ve&&ze){He.off("blur",Se),He.off("change",de),He.off("swapDoc",de),It.off(He.getInputField(),"compositionupdate",He.state.placeholderCompose),ce(He);var Me=He.getWrapperElement();Me.className=Me.className.replace(" CodeMirror-empty","")}ve&&!He.hasFocus()&&Se(He)});function ce(He){He.state.placeholder&&(He.state.placeholder.parentNode.removeChild(He.state.placeholder),He.state.placeholder=null)}function Be(He){ce(He);var ve=He.state.placeholder=document.createElement("pre");ve.style.cssText="height: 0; overflow: visible",ve.style.direction=He.getOption("direction"),ve.className="CodeMirror-placeholder CodeMirror-line-like";var Pe=He.getOption("placeholder");typeof Pe=="string"&&(Pe=document.createTextNode(Pe)),ve.appendChild(Pe),He.display.lineSpace.insertBefore(ve,He.display.lineSpace.firstChild)}function qe(He){setTimeout(function(){var ve=!1,Pe=He.getInputField();Pe.nodeName=="TEXTAREA"?ve=!Pe.value:He.lineCount()==1&&(ve=!/[^\u200b]/.test(Pe.querySelector(".CodeMirror-line").textContent)),ve?Be(He):ce(He)},20)}function Se(He){$t(He)&&Be(He)}function de(He){var ve=He.getWrapperElement(),Pe=$t(He);ve.className=ve.className.replace(" CodeMirror-empty","")+(Pe?" CodeMirror-empty":""),Pe?Be(He):ce(He)}function $t(He){return He.lineCount()===1&&He.getLine(0)===""}})},82801:function(on,In,Jt){(function(It){It(Jt(4631))})(function(It){var ce={pairs:`()[]{}''""`,closeBefore:`)]}'":;>`,triples:"",explode:"[]{}"},Be=It.Pos;It.defineOption("autoCloseBrackets",!1,function(nt,et,ht){ht&&ht!=It.Init&&(nt.removeKeyMap(Se),nt.state.closeBrackets=null),et&&(de(qe(et,"pairs")),nt.state.closeBrackets=et,nt.addKeyMap(Se))});function qe(nt,et){return et=="pairs"&&typeof nt=="string"?nt:typeof nt=="object"&&nt[et]!=null?nt[et]:ce[et]}var Se={Backspace:ve,Enter:Pe};function de(nt){for(var et=0;et<nt.length;et++){var ht=nt.charAt(et),lt="'"+ht+"'";Se[lt]||(Se[lt]=$t(ht))}}de(ce.pairs+"`");function $t(nt){return function(et){return Me(et,nt)}}function He(nt){var et=nt.state.closeBrackets;if(!et||et.override)return et;var ht=nt.getModeAt(nt.getCursor());return ht.closeBrackets||et}function ve(nt){var et=He(nt);if(!et||nt.getOption("disableInput"))return It.Pass;for(var ht=qe(et,"pairs"),lt=nt.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return It.Pass;var vt=tn(nt,lt[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return It.Pass}for(var pt=lt.length-1;pt>=0;pt--){var Ct=lt[pt].head;nt.replaceRange("",Be(Ct.line,Ct.ch-1),Be(Ct.line,Ct.ch+1),"+delete")}}function Pe(nt){var et=He(nt),ht=et&&qe(et,"explode");if(!ht||nt.getOption("disableInput"))return It.Pass;for(var lt=nt.listSelections(),pt=0;pt<lt.length;pt++){if(!lt[pt].empty())return It.Pass;var vt=tn(nt,lt[pt].head);if(!vt||ht.indexOf(vt)%2!=0)return It.Pass}nt.operation(function(){var Ct=nt.lineSeparator()||`
|
|
`;nt.replaceSelection(Ct+Ct,null),nt.execCommand("goCharLeft"),lt=nt.listSelections();for(var bt=0;bt<lt.length;bt++){var zt=lt[bt].head.line;nt.indentLine(zt,null,!0),nt.indentLine(zt+1,null,!0)}})}function ze(nt){var et=It.cmpPos(nt.anchor,nt.head)>0;return{anchor:new Be(nt.anchor.line,nt.anchor.ch+(et?-1:1)),head:new Be(nt.head.line,nt.head.ch+(et?1:-1))}}function Me(nt,et){var ht=He(nt);if(!ht||nt.getOption("disableInput"))return It.Pass;var lt=qe(ht,"pairs"),pt=lt.indexOf(et);if(pt==-1)return It.Pass;for(var vt=qe(ht,"closeBefore"),Ct=qe(ht,"triples"),bt=lt.charAt(pt+1)==et,zt=nt.listSelections(),Qt=pt%2==0,ie,oe=0;oe<zt.length;oe++){var re=zt[oe],Ne=re.head,ue,ke=nt.getRange(Ne,Be(Ne.line,Ne.ch+1));if(Qt&&!re.empty())ue="surround";else if((bt||!Qt)&&ke==et)bt&&Nt(nt,Ne)?ue="both":Ct.indexOf(et)>=0&&nt.getRange(Ne,Be(Ne.line,Ne.ch+3))==et+et+et?ue="skipThree":ue="skip";else if(bt&&Ne.ch>1&&Ct.indexOf(et)>=0&&nt.getRange(Be(Ne.line,Ne.ch-2),Ne)==et+et){if(Ne.ch>2&&/\bstring/.test(nt.getTokenTypeAt(Be(Ne.line,Ne.ch-2))))return It.Pass;ue="addFour"}else if(bt){var Ke=Ne.ch==0?" ":nt.getRange(Be(Ne.line,Ne.ch-1),Ne);if(!It.isWordChar(ke)&&Ke!=et&&!It.isWordChar(Ke))ue="both";else return It.Pass}else if(Qt&&(ke.length===0||/\s/.test(ke)||vt.indexOf(ke)>-1))ue="both";else return It.Pass;if(!ie)ie=ue;else if(ie!=ue)return It.Pass}var Fe=pt%2?lt.charAt(pt-1):et,wn=pt%2?et:lt.charAt(pt+1);nt.operation(function(){if(ie=="skip")nt.execCommand("goCharRight");else if(ie=="skipThree")for(var Rn=0;Rn<3;Rn++)nt.execCommand("goCharRight");else if(ie=="surround"){for(var $n=nt.getSelections(),Rn=0;Rn<$n.length;Rn++)$n[Rn]=Fe+$n[Rn]+wn;nt.replaceSelections($n,"around"),$n=nt.listSelections().slice();for(var Rn=0;Rn<$n.length;Rn++)$n[Rn]=ze($n[Rn]);nt.setSelections($n)}else ie=="both"?(nt.replaceSelection(Fe+wn,null),nt.triggerElectric(Fe+wn),nt.execCommand("goCharLeft")):ie=="addFour"&&(nt.replaceSelection(Fe+Fe+Fe+Fe,"before"),nt.execCommand("goCharRight"))})}function tn(nt,et){var ht=nt.getRange(Be(et.line,et.ch-1),Be(et.line,et.ch+1));return ht.length==2?ht:null}function Nt(nt,et){var ht=nt.getTokenAt(Be(et.line,et.ch+1));return/\bstring/.test(ht.type)&&ht.start==et.ch&&(et.ch==0||!/\bstring/.test(nt.getTokenTypeAt(et)))}})},57341:function(on,In,Jt){(function(It){It(Jt(4631),Jt(4786))})(function(It){It.defineOption("autoCloseTags",!1,function(ve,Pe,ze){if(ze!=It.Init&&ze&&ve.removeKeyMap("autoCloseTags"),!!Pe){var Me={name:"autoCloseTags"};(typeof Pe!="object"||Pe.whenClosing!==!1)&&(Me["'/'"]=function(tn){return de(tn)}),(typeof Pe!="object"||Pe.whenOpening!==!1)&&(Me["'>'"]=function(tn){return qe(tn)}),ve.addKeyMap(Me)}});var ce=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],Be=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function qe(ve){if(ve.getOption("disableInput"))return It.Pass;for(var Pe=ve.listSelections(),ze=[],Me=ve.getOption("autoCloseTags"),tn=0;tn<Pe.length;tn++){if(!Pe[tn].empty())return It.Pass;var Nt=Pe[tn].head,nt=ve.getTokenAt(Nt),et=It.innerMode(ve.getMode(),nt.state),ht=et.state,lt=et.mode.xmlCurrentTag&&et.mode.xmlCurrentTag(ht),pt=lt&<.name;if(!pt)return It.Pass;var vt=et.mode.configuration=="html",Ct=typeof Me=="object"&&Me.dontCloseTags||vt&&ce,bt=typeof Me=="object"&&Me.indentTags||vt&&Be;nt.end>Nt.ch&&(pt=pt.slice(0,pt.length-nt.end+Nt.ch));var zt=pt.toLowerCase();if(!pt||nt.type=="string"&&(nt.end!=Nt.ch||!/[\"\']/.test(nt.string.charAt(nt.string.length-1))||nt.string.length==1)||nt.type=="tag"&<.close||nt.string.indexOf("/")==Nt.ch-nt.start-1||Ct&&$t(Ct,zt)>-1||He(ve,et.mode.xmlCurrentContext&&et.mode.xmlCurrentContext(ht)||[],pt,Nt,!0))return It.Pass;var Qt=typeof Me=="object"&&Me.emptyTags;if(Qt&&$t(Qt,pt)>-1){ze[tn]={text:"/>",newPos:It.Pos(Nt.line,Nt.ch+2)};continue}var ie=bt&&$t(bt,zt)>-1;ze[tn]={indent:ie,text:">"+(ie?`
|
|
|
|
`:"")+"</"+pt+">",newPos:ie?It.Pos(Nt.line+1,0):It.Pos(Nt.line,Nt.ch+1)}}for(var oe=typeof Me=="object"&&Me.dontIndentOnAutoClose,tn=Pe.length-1;tn>=0;tn--){var re=ze[tn];ve.replaceRange(re.text,Pe[tn].head,Pe[tn].anchor,"+insert");var Ne=ve.listSelections().slice(0);Ne[tn]={head:re.newPos,anchor:re.newPos},ve.setSelections(Ne),!oe&&re.indent&&(ve.indentLine(re.newPos.line,null,!0),ve.indentLine(re.newPos.line+1,null,!0))}}function Se(ve,Pe){for(var ze=ve.listSelections(),Me=[],tn=Pe?"/":"</",Nt=ve.getOption("autoCloseTags"),nt=typeof Nt=="object"&&Nt.dontIndentOnSlash,et=0;et<ze.length;et++){if(!ze[et].empty())return It.Pass;var ht=ze[et].head,lt=ve.getTokenAt(ht),pt=It.innerMode(ve.getMode(),lt.state),vt=pt.state;if(Pe&&(lt.type=="string"||lt.string.charAt(0)!="<"||lt.start!=ht.ch-1))return It.Pass;var Ct,bt=pt.mode.name!="xml"&&ve.getMode().name=="htmlmixed";if(bt&&pt.mode.name=="javascript")Ct=tn+"script";else if(bt&&pt.mode.name=="css")Ct=tn+"style";else{var zt=pt.mode.xmlCurrentContext&&pt.mode.xmlCurrentContext(vt);if(!zt||zt.length&&He(ve,zt,zt[zt.length-1],ht))return It.Pass;Ct=tn+zt[zt.length-1]}ve.getLine(ht.line).charAt(lt.end)!=">"&&(Ct+=">"),Me[et]=Ct}if(ve.replaceSelections(Me),ze=ve.listSelections(),!nt)for(var et=0;et<ze.length;et++)(et==ze.length-1||ze[et].head.line<ze[et+1].head.line)&&ve.indentLine(ze[et].head.line)}function de(ve){return ve.getOption("disableInput")?It.Pass:Se(ve,!0)}It.commands.closeTag=function(ve){return Se(ve)};function $t(ve,Pe){if(ve.indexOf)return ve.indexOf(Pe);for(var ze=0,Me=ve.length;ze<Me;++ze)if(ve[ze]==Pe)return ze;return-1}function He(ve,Pe,ze,Me,tn){if(!It.scanForClosingTag)return!1;var Nt=Math.min(ve.lastLine()+1,Me.line+500),nt=It.scanForClosingTag(ve,Me,null,Nt);if(!nt||nt.tag!=ze)return!1;for(var et=tn?1:0,ht=Pe.length-1;ht>=0&&Pe[ht]==ze;ht--)++et;Me=nt.to;for(var ht=1;ht<et;ht++){var lt=It.scanForClosingTag(ve,Me,null,Nt);if(!lt||lt.tag!=ze)return!1;Me=lt.to}return!0}})},4786:function(on,In,Jt){(function(It){It(Jt(4631))})(function(It){"use strict";var ce=It.Pos;function Be(ht,lt){return ht.line-lt.line||ht.ch-lt.ch}var qe="A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Se=qe+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",de=new RegExp("<(/?)(["+qe+"]["+Se+"]*)","g");function $t(ht,lt,pt,vt){this.line=lt,this.ch=pt,this.cm=ht,this.text=ht.getLine(lt),this.min=vt?Math.max(vt.from,ht.firstLine()):ht.firstLine(),this.max=vt?Math.min(vt.to-1,ht.lastLine()):ht.lastLine()}function He(ht,lt){var pt=ht.cm.getTokenTypeAt(ce(ht.line,lt));return pt&&/\btag\b/.test(pt)}function ve(ht){if(!(ht.line>=ht.max))return ht.ch=0,ht.text=ht.cm.getLine(++ht.line),!0}function Pe(ht){if(!(ht.line<=ht.min))return ht.text=ht.cm.getLine(--ht.line),ht.ch=ht.text.length,!0}function ze(ht){for(;;){var lt=ht.text.indexOf(">",ht.ch);if(lt==-1){if(ve(ht))continue;return}if(!He(ht,lt+1)){ht.ch=lt+1;continue}var pt=ht.text.lastIndexOf("/",lt),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,lt));return ht.ch=lt+1,vt?"selfClose":"regular"}}function Me(ht){for(;;){var lt=ht.ch?ht.text.lastIndexOf("<",ht.ch-1):-1;if(lt==-1){if(Pe(ht))continue;return}if(!He(ht,lt+1)){ht.ch=lt;continue}de.lastIndex=lt,ht.ch=lt;var pt=de.exec(ht.text);if(pt&&pt.index==lt)return pt}}function tn(ht){for(;;){de.lastIndex=ht.ch;var lt=de.exec(ht.text);if(!lt){if(ve(ht))continue;return}if(!He(ht,lt.index+1)){ht.ch=lt.index+1;continue}return ht.ch=lt.index+lt[0].length,lt}}function Nt(ht){for(;;){var lt=ht.ch?ht.text.lastIndexOf(">",ht.ch-1):-1;if(lt==-1){if(Pe(ht))continue;return}if(!He(ht,lt+1)){ht.ch=lt;continue}var pt=ht.text.lastIndexOf("/",lt),vt=pt>-1&&!/\S/.test(ht.text.slice(pt+1,lt));return ht.ch=lt+1,vt?"selfClose":"regular"}}function nt(ht,lt){for(var pt=[];;){var vt=tn(ht),Ct,bt=ht.line,zt=ht.ch-(vt?vt[0].length:0);if(!vt||!(Ct=ze(ht)))return;if(Ct!="selfClose")if(vt[1]){for(var Qt=pt.length-1;Qt>=0;--Qt)if(pt[Qt]==vt[2]){pt.length=Qt;break}if(Qt<0&&(!lt||lt==vt[2]))return{tag:vt[2],from:ce(bt,zt),to:ce(ht.line,ht.ch)}}else pt.push(vt[2])}}function et(ht,lt){for(var pt=[];;){var vt=Nt(ht);if(!vt)return;if(vt=="selfClose"){Me(ht);continue}var Ct=ht.line,bt=ht.ch,zt=Me(ht);if(!zt)return;if(zt[1])pt.push(zt[2]);else{for(var Qt=pt.length-1;Qt>=0;--Qt)if(pt[Qt]==zt[2]){pt.length=Qt;break}if(Qt<0&&(!lt||lt==zt[2]))return{tag:zt[2],from:ce(ht.line,ht.ch),to:ce(Ct,bt)}}}}It.registerHelper("fold","xml",function(ht,lt){for(var pt=new $t(ht,lt.line,0);;){var vt=tn(pt);if(!vt||pt.line!=lt.line)return;var Ct=ze(pt);if(!Ct)return;if(!vt[1]&&Ct!="selfClose"){var bt=ce(pt.line,pt.ch),zt=nt(pt,vt[2]);return zt&&Be(zt.from,bt)>0?{from:bt,to:zt.from}:null}}}),It.findMatchingTag=function(ht,lt,pt){var vt=new $t(ht,lt.line,lt.ch,pt);if(!(vt.text.indexOf(">")==-1&&vt.text.indexOf("<")==-1)){var Ct=ze(vt),bt=Ct&&ce(vt.line,vt.ch),zt=Ct&&Me(vt);if(!(!Ct||!zt||Be(vt,lt)>0)){var Qt={from:ce(vt.line,vt.ch),to:bt,tag:zt[2]};return Ct=="selfClose"?{open:Qt,close:null,at:"open"}:zt[1]?{open:et(vt,zt[2]),close:Qt,at:"close"}:(vt=new $t(ht,bt.line,bt.ch,pt),{open:Qt,close:nt(vt,zt[2]),at:"open"})}}},It.findEnclosingTag=function(ht,lt,pt,vt){for(var Ct=new $t(ht,lt.line,lt.ch,pt);;){var bt=et(Ct,vt);if(!bt)break;var zt=new $t(ht,lt.line,lt.ch,pt),Qt=nt(zt,bt.tag);if(Qt)return{open:bt,close:Qt}}},It.scanForClosingTag=function(ht,lt,pt,vt){var Ct=new $t(ht,lt.line,lt.ch,vt?{from:0,to:vt}:null);return nt(Ct,pt)}})},4631:function(on){(function(In,Jt){on.exports=Jt()})(this,function(){"use strict";var In=navigator.userAgent,Jt=navigator.platform,It=/gecko\/\d/i.test(In),ce=/MSIE \d/.test(In),Be=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(In),qe=/Edge\/(\d+)/.exec(In),Se=ce||Be||qe,de=Se&&(ce?document.documentMode||6:+(qe||Be)[1]),$t=!qe&&/WebKit\//.test(In),He=$t&&/Qt\/\d+\.\d+/.test(In),ve=!qe&&/Chrome\//.test(In),Pe=/Opera\//.test(In),ze=/Apple Computer/.test(navigator.vendor),Me=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(In),tn=/PhantomJS/.test(In),Nt=!qe&&/AppleWebKit/.test(In)&&/Mobile\/\w+/.test(In),nt=/Android/.test(In),et=Nt||nt||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(In),ht=Nt||/Mac/.test(Jt),lt=/\bCrOS\b/.test(In),pt=/win/i.test(Jt),vt=Pe&&In.match(/Version\/(\d*\.\d*)/);vt&&(vt=Number(vt[1])),vt&&vt>=15&&(Pe=!1,$t=!0);var Ct=ht&&(He||Pe&&(vt==null||vt<12.11)),bt=It||Se&&de>=9;function zt(it){return new RegExp("(^|\\s)"+it+"(?:$|\\s)\\s*")}var Qt=function(it,st){var ft=it.className,dt=zt(st).exec(ft);if(dt){var gt=ft.slice(dt.index+dt[0].length);it.className=ft.slice(0,dt.index)+(gt?dt[1]+gt:"")}};function ie(it){for(var st=it.childNodes.length;st>0;--st)it.removeChild(it.firstChild);return it}function oe(it,st){return ie(it).appendChild(st)}function re(it,st,ft,dt){var gt=document.createElement(it);if(ft&&(gt.className=ft),dt&&(gt.style.cssText=dt),typeof st=="string")gt.appendChild(document.createTextNode(st));else if(st)for(var Pt=0;Pt<st.length;++Pt)gt.appendChild(st[Pt]);return gt}function Ne(it,st,ft,dt){var gt=re(it,st,ft,dt);return gt.setAttribute("role","presentation"),gt}var ue;document.createRange?ue=function(it,st,ft,dt){var gt=document.createRange();return gt.setEnd(dt||it,ft),gt.setStart(it,st),gt}:ue=function(it,st,ft){var dt=document.body.createTextRange();try{dt.moveToElementText(it.parentNode)}catch(gt){return dt}return dt.collapse(!0),dt.moveEnd("character",ft),dt.moveStart("character",st),dt};function ke(it,st){if(st.nodeType==3&&(st=st.parentNode),it.contains)return it.contains(st);do if(st.nodeType==11&&(st=st.host),st==it)return!0;while(st=st.parentNode)}function Ke(){var it;try{it=document.activeElement}catch(st){it=document.body||null}for(;it&&it.shadowRoot&&it.shadowRoot.activeElement;)it=it.shadowRoot.activeElement;return it}function Fe(it,st){var ft=it.className;zt(st).test(ft)||(it.className+=(ft?" ":"")+st)}function wn(it,st){for(var ft=it.split(" "),dt=0;dt<ft.length;dt++)ft[dt]&&!zt(ft[dt]).test(st)&&(st+=" "+ft[dt]);return st}var Rn=function(it){it.select()};Nt?Rn=function(it){it.selectionStart=0,it.selectionEnd=it.value.length}:Se&&(Rn=function(it){try{it.select()}catch(st){}});function $n(it){var st=Array.prototype.slice.call(arguments,1);return function(){return it.apply(null,st)}}function di(it,st,ft){st||(st={});for(var dt in it)it.hasOwnProperty(dt)&&(ft!==!1||!st.hasOwnProperty(dt))&&(st[dt]=it[dt]);return st}function ee(it,st,ft,dt,gt){st==null&&(st=it.search(/[^\s\u00a0]/),st==-1&&(st=it.length));for(var Pt=dt||0,Tt=gt||0;;){var Rt=it.indexOf(" ",Pt);if(Rt<0||Rt>=st)return Tt+(st-Pt);Tt+=Rt-Pt,Tt+=ft-Tt%ft,Pt=Rt+1}}var _t=function(){this.id=null,this.f=null,this.time=0,this.handler=$n(this.onTimeout,this)};_t.prototype.onTimeout=function(it){it.id=0,it.time<=+new Date?it.f():setTimeout(it.handler,it.time-+new Date)},_t.prototype.set=function(it,st){this.f=st;var ft=+new Date+it;(!this.id||ft<this.time)&&(clearTimeout(this.id),this.id=setTimeout(this.handler,it),this.time=ft)};function Kt(it,st){for(var ft=0;ft<it.length;++ft)if(it[ft]==st)return ft;return-1}var pn=50,Ln={toString:function(){return"CodeMirror.Pass"}},Ce={scroll:!1},sn={origin:"*mouse"},cn={origin:"+move"};function Jn(it,st,ft){for(var dt=0,gt=0;;){var Pt=it.indexOf(" ",dt);Pt==-1&&(Pt=it.length);var Tt=Pt-dt;if(Pt==it.length||gt+Tt>=st)return dt+Math.min(Tt,st-gt);if(gt+=Pt-dt,gt+=ft-gt%ft,dt=Pt+1,gt>=st)return dt}}var Sn=[""];function he(it){for(;Sn.length<=it;)Sn.push(Te(Sn)+" ");return Sn[it]}function Te(it){return it[it.length-1]}function Nn(it,st){for(var ft=[],dt=0;dt<it.length;dt++)ft[dt]=st(it[dt],dt);return ft}function Bn(it,st,ft){for(var dt=0,gt=ft(st);dt<it.length&&ft(it[dt])<=gt;)dt++;it.splice(dt,0,st)}function Ht(){}function Mt(it,st){var ft;return Object.create?ft=Object.create(it):(Ht.prototype=it,ft=new Ht),st&&di(st,ft),ft}var wt=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function At(it){return/\w/.test(it)||it>"\x80"&&(it.toUpperCase()!=it.toLowerCase()||wt.test(it))}function Ut(it,st){return st?st.source.indexOf("\\w")>-1&&At(it)?!0:st.test(it):At(it)}function Et(it){for(var st in it)if(it.hasOwnProperty(st)&&it[st])return!1;return!0}var be=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function Dn(it){return it.charCodeAt(0)>=768&&be.test(it)}function zi(it,st,ft){for(;(ft<0?st>0:st<it.length)&&Dn(it.charAt(st));)st+=ft;return st}function yi(it,st,ft){for(var dt=st>ft?-1:1;;){if(st==ft)return st;var gt=(st+ft)/2,Pt=dt<0?Math.ceil(gt):Math.floor(gt);if(Pt==st)return it(Pt)?st:ft;it(Pt)?ft=Pt:st=Pt+dt}}function ei(it,st,ft,dt){if(!it)return dt(st,ft,"ltr",0);for(var gt=!1,Pt=0;Pt<it.length;++Pt){var Tt=it[Pt];(Tt.from<ft&&Tt.to>st||st==ft&&Tt.to==st)&&(dt(Math.max(Tt.from,st),Math.min(Tt.to,ft),Tt.level==1?"rtl":"ltr",Pt),gt=!0)}gt||dt(st,ft,"ltr")}var Qi=null;function Mn(it,st,ft){var dt;Qi=null;for(var gt=0;gt<it.length;++gt){var Pt=it[gt];if(Pt.from<st&&Pt.to>st)return gt;Pt.to==st&&(Pt.from!=Pt.to&&ft=="before"?dt=gt:Qi=gt),Pt.from==st&&(Pt.from!=Pt.to&&ft!="before"?dt=gt:Qi=gt)}return dt!=null?dt:Qi}var sr=function(){var it="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",st="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function ft(Xt){return Xt<=247?it.charAt(Xt):1424<=Xt&&Xt<=1524?"R":1536<=Xt&&Xt<=1785?st.charAt(Xt-1536):1774<=Xt&&Xt<=2220?"r":8192<=Xt&&Xt<=8203?"w":Xt==8204?"b":"L"}var dt=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,gt=/[stwN]/,Pt=/[LRr]/,Tt=/[Lb1n]/,Rt=/[1n]/;function Bt(Xt,ge,te){this.level=Xt,this.from=ge,this.to=te}return function(Xt,ge){var te=ge=="ltr"?"L":"R";if(Xt.length==0||ge=="ltr"&&!dt.test(Xt))return!1;for(var Ae=Xt.length,Ee=[],dn=0;dn<Ae;++dn)Ee.push(ft(Xt.charCodeAt(dn)));for(var gn=0,Fn=te;gn<Ae;++gn){var Xn=Ee[gn];Xn=="m"?Ee[gn]=Fn:Fn=Xn}for(var Pi=0,si=te;Pi<Ae;++Pi){var Di=Ee[Pi];Di=="1"&&si=="r"?Ee[Pi]="n":Pt.test(Di)&&(si=Di,Di=="r"&&(Ee[Pi]="R"))}for(var hr=1,ii=Ee[0];hr<Ae-1;++hr){var Br=Ee[hr];Br=="+"&&ii=="1"&&Ee[hr+1]=="1"?Ee[hr]="1":Br==","&&ii==Ee[hr+1]&&(ii=="1"||ii=="n")&&(Ee[hr]=ii),ii=Br}for(var hs=0;hs<Ae;++hs){var fa=Ee[hs];if(fa==",")Ee[hs]="N";else if(fa=="%"){var Ms=void 0;for(Ms=hs+1;Ms<Ae&&Ee[Ms]=="%";++Ms);for(var Tl=hs&&Ee[hs-1]=="!"||Ms<Ae&&Ee[Ms]=="1"?"1":"N",rl=hs;rl<Ms;++rl)Ee[rl]=Tl;hs=Ms-1}}for(var ra=0,zl=te;ra<Ae;++ra){var Va=Ee[ra];zl=="L"&&Va=="1"?Ee[ra]="L":Pt.test(Va)&&(zl=Va)}for(var oa=0;oa<Ae;++oa)if(gt.test(Ee[oa])){var wo=void 0;for(wo=oa+1;wo<Ae&>.test(Ee[wo]);++wo);for(var Os=(oa?Ee[oa-1]:te)=="L",La=(wo<Ae?Ee[wo]:te)=="L",Wa=Os==La?Os?"L":"R":te,ju=oa;ju<wo;++ju)Ee[ju]=Wa;oa=wo-1}for(var ks=[],vu,Hs=0;Hs<Ae;)if(Tt.test(Ee[Hs])){var Ec=Hs;for(++Hs;Hs<Ae&&Tt.test(Ee[Hs]);++Hs);ks.push(new Bt(0,Ec,Hs))}else{var nu=Hs,Gl=ks.length,Nl=ge=="rtl"?1:0;for(++Hs;Hs<Ae&&Ee[Hs]!="L";++Hs);for(var Zo=nu;Zo<Hs;)if(Rt.test(Ee[Zo])){nu<Zo&&(ks.splice(Gl,0,new Bt(1,nu,Zo)),Gl+=Nl);var Ma=Zo;for(++Zo;Zo<Hs&&Rt.test(Ee[Zo]);++Zo);ks.splice(Gl,0,new Bt(2,Ma,Zo)),Gl+=Nl,nu=Zo}else++Zo;nu<Hs&&ks.splice(Gl,0,new Bt(1,nu,Hs))}return ge=="ltr"&&(ks[0].level==1&&(vu=Xt.match(/^\s+/))&&(ks[0].from=vu[0].length,ks.unshift(new Bt(0,0,vu[0].length))),Te(ks).level==1&&(vu=Xt.match(/\s+$/))&&(Te(ks).to-=vu[0].length,ks.push(new Bt(0,Ae-vu[0].length,Ae)))),ge=="rtl"?ks.reverse():ks}}();function Yi(it,st){var ft=it.order;return ft==null&&(ft=it.order=sr(it.text,st)),ft}var Vr=[],Ci=function(it,st,ft){if(it.addEventListener)it.addEventListener(st,ft,!1);else if(it.attachEvent)it.attachEvent("on"+st,ft);else{var dt=it._handlers||(it._handlers={});dt[st]=(dt[st]||Vr).concat(ft)}};function Us(it,st){return it._handlers&&it._handlers[st]||Vr}function is(it,st,ft){if(it.removeEventListener)it.removeEventListener(st,ft,!1);else if(it.detachEvent)it.detachEvent("on"+st,ft);else{var dt=it._handlers,gt=dt&&dt[st];if(gt){var Pt=Kt(gt,ft);Pt>-1&&(dt[st]=gt.slice(0,Pt).concat(gt.slice(Pt+1)))}}}function xo(it,st){var ft=Us(it,st);if(ft.length)for(var dt=Array.prototype.slice.call(arguments,2),gt=0;gt<ft.length;++gt)ft[gt].apply(null,dt)}function zr(it,st,ft){return typeof st=="string"&&(st={type:st,preventDefault:function(){this.defaultPrevented=!0}}),xo(it,ft||st.type,it,st),Or(st)||st.codemirrorIgnore}function wl(it){var st=it._handlers&&it._handlers.cursorActivity;if(st)for(var ft=it.curOp.cursorActivityHandlers||(it.curOp.cursorActivityHandlers=[]),dt=0;dt<st.length;++dt)Kt(ft,st[dt])==-1&&ft.push(st[dt])}function Li(it,st){return Us(it,st).length>0}function qi(it){it.prototype.on=function(st,ft){Ci(this,st,ft)},it.prototype.off=function(st,ft){is(this,st,ft)}}function aa(it){it.preventDefault?it.preventDefault():it.returnValue=!1}function Oa(it){it.stopPropagation?it.stopPropagation():it.cancelBubble=!0}function Or(it){return it.defaultPrevented!=null?it.defaultPrevented:it.returnValue==!1}function Il(it){aa(it),Oa(it)}function ku(it){return it.target||it.srcElement}function bu(it){var st=it.which;return st==null&&(it.button&1?st=1:it.button&2?st=3:it.button&4&&(st=2)),ht&&it.ctrlKey&&st==1&&(st=3),st}var Rh=function(){if(Se&&de<9)return!1;var it=re("div");return"draggable"in it||"dragDrop"in it}(),Xl;function Ia(it){if(Xl==null){var st=re("span","\u200B");oe(it,re("span",[st,document.createTextNode("x")])),it.firstChild.offsetHeight!=0&&(Xl=st.offsetWidth<=1&&st.offsetHeight>2&&!(Se&&de<8))}var ft=Xl?re("span","\u200B"):re("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return ft.setAttribute("cm-text",""),ft}var Cl;function bs(it){if(Cl!=null)return Cl;var st=oe(it,document.createTextNode("A\u062EA")),ft=ue(st,0,1).getBoundingClientRect(),dt=ue(st,1,2).getBoundingClientRect();return ie(it),!ft||ft.left==ft.right?!1:Cl=dt.right-ft.right<3}var Qe=`
|
|
|
|
b`.split(/\n/).length!=3?function(it){for(var st=0,ft=[],dt=it.length;st<=dt;){var gt=it.indexOf(`
|
|
`,st);gt==-1&&(gt=it.length);var Pt=it.slice(st,it.charAt(gt-1)=="\r"?gt-1:gt),Tt=Pt.indexOf("\r");Tt!=-1?(ft.push(Pt.slice(0,Tt)),st+=Tt+1):(ft.push(Pt),st=gt+1)}return ft}:function(it){return it.split(/\r\n?|\n/)},xt=window.getSelection?function(it){try{return it.selectionStart!=it.selectionEnd}catch(st){return!1}}:function(it){var st;try{st=it.ownerDocument.selection.createRange()}catch(ft){}return!st||st.parentElement()!=it?!1:st.compareEndPoints("StartToEnd",st)!=0},En=function(){var it=re("div");return"oncopy"in it?!0:(it.setAttribute("oncopy","return;"),typeof it.oncopy=="function")}(),mn=null;function bi(it){if(mn!=null)return mn;var st=oe(it,re("span","x")),ft=st.getBoundingClientRect(),dt=ue(st,0,1).getBoundingClientRect();return mn=Math.abs(ft.left-dt.left)>1}var gi={},fi={};function Gi(it,st){arguments.length>2&&(st.dependencies=Array.prototype.slice.call(arguments,2)),gi[it]=st}function br(it,st){fi[it]=st}function Le(it){if(typeof it=="string"&&fi.hasOwnProperty(it))it=fi[it];else if(it&&typeof it.name=="string"&&fi.hasOwnProperty(it.name)){var st=fi[it.name];typeof st=="string"&&(st={name:st}),it=Mt(st,it),it.name=st.name}else{if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(it))return Le("application/xml");if(typeof it=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(it))return Le("application/json")}return typeof it=="string"?{name:it}:it||{name:"null"}}function Ie(it,st){st=Le(st);var ft=gi[st.name];if(!ft)return Ie(it,"text/plain");var dt=ft(it,st);if(le.hasOwnProperty(st.name)){var gt=le[st.name];for(var Pt in gt)gt.hasOwnProperty(Pt)&&(dt.hasOwnProperty(Pt)&&(dt["_"+Pt]=dt[Pt]),dt[Pt]=gt[Pt])}if(dt.name=st.name,st.helperType&&(dt.helperType=st.helperType),st.modeProps)for(var Tt in st.modeProps)dt[Tt]=st.modeProps[Tt];return dt}var le={};function Oe(it,st){var ft=le.hasOwnProperty(it)?le[it]:le[it]={};di(st,ft)}function On(it,st){if(st===!0)return st;if(it.copyState)return it.copyState(st);var ft={};for(var dt in st){var gt=st[dt];gt instanceof Array&&(gt=gt.concat([])),ft[dt]=gt}return ft}function Wn(it,st){for(var ft;it.innerMode&&(ft=it.innerMode(st),!(!ft||ft.mode==it));)st=ft.state,it=ft.mode;return ft||{mode:it,state:st}}function Mi(it,st,ft){return it.startState?it.startState(st,ft):!0}var xe=function(it,st,ft){this.pos=this.start=0,this.string=it,this.tabSize=st||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=ft};xe.prototype.eol=function(){return this.pos>=this.string.length},xe.prototype.sol=function(){return this.pos==this.lineStart},xe.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},xe.prototype.next=function(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)},xe.prototype.eat=function(it){var st=this.string.charAt(this.pos),ft;if(typeof it=="string"?ft=st==it:ft=st&&(it.test?it.test(st):it(st)),ft)return++this.pos,st},xe.prototype.eatWhile=function(it){for(var st=this.pos;this.eat(it););return this.pos>st},xe.prototype.eatSpace=function(){for(var it=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>it},xe.prototype.skipToEnd=function(){this.pos=this.string.length},xe.prototype.skipTo=function(it){var st=this.string.indexOf(it,this.pos);if(st>-1)return this.pos=st,!0},xe.prototype.backUp=function(it){this.pos-=it},xe.prototype.column=function(){return this.lastColumnPos<this.start&&(this.lastColumnValue=ee(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue-(this.lineStart?ee(this.string,this.lineStart,this.tabSize):0)},xe.prototype.indentation=function(){return ee(this.string,null,this.tabSize)-(this.lineStart?ee(this.string,this.lineStart,this.tabSize):0)},xe.prototype.match=function(it,st,ft){if(typeof it=="string"){var dt=function(Tt){return ft?Tt.toLowerCase():Tt},gt=this.string.substr(this.pos,it.length);if(dt(gt)==dt(it))return st!==!1&&(this.pos+=it.length),!0}else{var Pt=this.string.slice(this.pos).match(it);return Pt&&Pt.index>0?null:(Pt&&st!==!1&&(this.pos+=Pt[0].length),Pt)}},xe.prototype.current=function(){return this.string.slice(this.start,this.pos)},xe.prototype.hideFirstChars=function(it,st){this.lineStart+=it;try{return st()}finally{this.lineStart-=it}},xe.prototype.lookAhead=function(it){var st=this.lineOracle;return st&&st.lookAhead(it)},xe.prototype.baseToken=function(){var it=this.lineOracle;return it&&it.baseToken(this.pos)};function Xe(it,st){if(st-=it.first,st<0||st>=it.size)throw new Error("There is no line "+(st+it.first)+" in the document.");for(var ft=it;!ft.lines;)for(var dt=0;;++dt){var gt=ft.children[dt],Pt=gt.chunkSize();if(st<Pt){ft=gt;break}st-=Pt}return ft.lines[st]}function Zn(it,st,ft){var dt=[],gt=st.line;return it.iter(st.line,ft.line+1,function(Pt){var Tt=Pt.text;gt==ft.line&&(Tt=Tt.slice(0,ft.ch)),gt==st.line&&(Tt=Tt.slice(st.ch)),dt.push(Tt),++gt}),dt}function Oi(it,st,ft){var dt=[];return it.iter(st,ft,function(gt){dt.push(gt.text)}),dt}function an(it,st){var ft=st-it.height;if(ft)for(var dt=it;dt;dt=dt.parent)dt.height+=ft}function fe(it){if(it.parent==null)return null;for(var st=it.parent,ft=Kt(st.lines,it),dt=st.parent;dt;st=dt,dt=dt.parent)for(var gt=0;dt.children[gt]!=st;++gt)ft+=dt.children[gt].chunkSize();return ft+st.first}function An(it,st){var ft=it.first;t:do{for(var dt=0;dt<it.children.length;++dt){var gt=it.children[dt],Pt=gt.height;if(st<Pt){it=gt;continue t}st-=Pt,ft+=gt.chunkSize()}return ft}while(!it.lines);for(var Tt=0;Tt<it.lines.length;++Tt){var Rt=it.lines[Tt],Bt=Rt.height;if(st<Bt)break;st-=Bt}return ft+Tt}function ri(it,st){return st>=it.first&&st<it.first+it.size}function Ki(it,st){return String(it.lineNumberFormatter(st+it.firstLineNumber))}function Ue(it,st,ft){if(ft===void 0&&(ft=null),!(this instanceof Ue))return new Ue(it,st,ft);this.line=it,this.ch=st,this.sticky=ft}function Gn(it,st){return it.line-st.line||it.ch-st.ch}function uo(it,st){return it.sticky==st.sticky&&Gn(it,st)==0}function zo(it){return Ue(it.line,it.ch)}function $r(it,st){return Gn(it,st)<0?st:it}function Kn(it,st){return Gn(it,st)<0?it:st}function zn(it,st){return Math.max(it.first,Math.min(st,it.first+it.size-1))}function qn(it,st){if(st.line<it.first)return Ue(it.first,0);var ft=it.first+it.size-1;return st.line>ft?Ue(ft,Xe(it,ft).text.length):Ir(st,Xe(it,st.line).text.length)}function Ir(it,st){var ft=it.ch;return ft==null||ft>st?Ue(it.line,st):ft<0?Ue(it.line,0):it}function no(it,st){for(var ft=[],dt=0;dt<st.length;dt++)ft[dt]=qn(it,st[dt]);return ft}var hn=function(it,st){this.state=it,this.lookAhead=st},ci=function(it,st,ft,dt){this.state=st,this.doc=it,this.line=ft,this.maxLookAhead=dt||0,this.baseTokens=null,this.baseTokenPos=1};ci.prototype.lookAhead=function(it){var st=this.doc.getLine(this.line+it);return st!=null&&it>this.maxLookAhead&&(this.maxLookAhead=it),st},ci.prototype.baseToken=function(it){if(!this.baseTokens)return null;for(;this.baseTokens[this.baseTokenPos]<=it;)this.baseTokenPos+=2;var st=this.baseTokens[this.baseTokenPos+1];return{type:st&&st.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-it}},ci.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},ci.fromSaved=function(it,st,ft){return st instanceof hn?new ci(it,On(it.mode,st.state),ft,st.lookAhead):new ci(it,On(it.mode,st),ft)},ci.prototype.save=function(it){var st=it!==!1?On(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new hn(st,this.maxLookAhead):st};function Za(it,st,ft,dt){var gt=[it.state.modeGen],Pt={};Sr(it,st.text,it.doc.mode,ft,function(Xt,ge){return gt.push(Xt,ge)},Pt,dt);for(var Tt=ft.state,Rt=function(Xt){ft.baseTokens=gt;var ge=it.state.overlays[Xt],te=1,Ae=0;ft.state=!0,Sr(it,st.text,ge.mode,ft,function(Ee,dn){for(var gn=te;Ae<Ee;){var Fn=gt[te];Fn>Ee&>.splice(te,1,Ee,gt[te+1],Fn),te+=2,Ae=Math.min(Ee,Fn)}if(dn)if(ge.opaque)gt.splice(gn,te-gn,Ee,"overlay "+dn),te=gn+2;else for(;gn<te;gn+=2){var Xn=gt[gn+1];gt[gn+1]=(Xn?Xn+" ":"")+"overlay "+dn}},Pt),ft.state=Tt,ft.baseTokens=null,ft.baseTokenPos=1},Bt=0;Bt<it.state.overlays.length;++Bt)Rt(Bt);return{styles:gt,classes:Pt.bgClass||Pt.textClass?Pt:null}}function Ps(it,st,ft){if(!st.styles||st.styles[0]!=it.state.modeGen){var dt=rs(it,fe(st)),gt=st.text.length>it.options.maxHighlightLength&&On(it.doc.mode,dt.state),Pt=Za(it,st,dt);gt&&(dt.state=gt),st.stateAfter=dt.save(!gt),st.styles=Pt.styles,Pt.classes?st.styleClasses=Pt.classes:st.styleClasses&&(st.styleClasses=null),ft===it.doc.highlightFrontier&&(it.doc.modeFrontier=Math.max(it.doc.modeFrontier,++it.doc.highlightFrontier))}return st.styles}function rs(it,st,ft){var dt=it.doc,gt=it.display;if(!dt.mode.startState)return new ci(dt,!0,st);var Pt=lr(it,st,ft),Tt=Pt>dt.first&&Xe(dt,Pt-1).stateAfter,Rt=Tt?ci.fromSaved(dt,Tt,Pt):new ci(dt,Mi(dt.mode),Pt);return dt.iter(Pt,st,function(Bt){me(it,Bt.text,Rt);var Xt=Rt.line;Bt.stateAfter=Xt==st-1||Xt%5==0||Xt>=gt.viewFrom&&Xt<gt.viewTo?Rt.save():null,Rt.nextLine()}),ft&&(dt.modeFrontier=Rt.line),Rt}function me(it,st,ft,dt){var gt=it.doc.mode,Pt=new xe(st,it.options.tabSize,ft);for(Pt.start=Pt.pos=dt||0,st==""&&xi(gt,ft.state);!Pt.eol();)gr(gt,Pt,ft.state),Pt.start=Pt.pos}function xi(it,st){if(it.blankLine)return it.blankLine(st);if(it.innerMode){var ft=Wn(it,st);if(ft.mode.blankLine)return ft.mode.blankLine(ft.state)}}function gr(it,st,ft,dt){for(var gt=0;gt<10;gt++){dt&&(dt[0]=Wn(it,ft).mode);var Pt=it.token(st,ft);if(st.pos>st.start)return Pt}throw new Error("Mode "+it.name+" failed to advance stream.")}var ai=function(it,st,ft){this.start=it.start,this.end=it.pos,this.string=it.current(),this.type=st||null,this.state=ft};function ho(it,st,ft,dt){var gt=it.doc,Pt=gt.mode,Tt;st=qn(gt,st);var Rt=Xe(gt,st.line),Bt=rs(it,st.line,ft),Xt=new xe(Rt.text,it.options.tabSize,Bt),ge;for(dt&&(ge=[]);(dt||Xt.pos<st.ch)&&!Xt.eol();)Xt.start=Xt.pos,Tt=gr(Pt,Xt,Bt.state),dt&&ge.push(new ai(Xt,Tt,On(gt.mode,Bt.state)));return dt?ge:new ai(Xt,Tt,Bt.state)}function pr(it,st){if(it)for(;;){var ft=it.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!ft)break;it=it.slice(0,ft.index)+it.slice(ft.index+ft[0].length);var dt=ft[1]?"bgClass":"textClass";st[dt]==null?st[dt]=ft[2]:new RegExp("(?:^|\\s)"+ft[2]+"(?:$|\\s)").test(st[dt])||(st[dt]+=" "+ft[2])}return it}function Sr(it,st,ft,dt,gt,Pt,Tt){var Rt=ft.flattenSpans;Rt==null&&(Rt=it.options.flattenSpans);var Bt=0,Xt=null,ge=new xe(st,it.options.tabSize,dt),te,Ae=it.options.addModeClass&&[null];for(st==""&&pr(xi(ft,dt.state),Pt);!ge.eol();){if(ge.pos>it.options.maxHighlightLength?(Rt=!1,Tt&&me(it,st,dt,ge.pos),ge.pos=st.length,te=null):te=pr(gr(ft,ge,dt.state,Ae),Pt),Ae){var Ee=Ae[0].name;Ee&&(te="m-"+(te?Ee+" "+te:Ee))}if(!Rt||Xt!=te){for(;Bt<ge.start;)Bt=Math.min(ge.start,Bt+5e3),gt(Bt,Xt);Xt=te}ge.start=ge.pos}for(;Bt<ge.pos;){var dn=Math.min(ge.pos,Bt+5e3);gt(dn,Xt),Bt=dn}}function lr(it,st,ft){for(var dt,gt,Pt=it.doc,Tt=ft?-1:st-(it.doc.mode.innerMode?1e3:100),Rt=st;Rt>Tt;--Rt){if(Rt<=Pt.first)return Pt.first;var Bt=Xe(Pt,Rt-1),Xt=Bt.stateAfter;if(Xt&&(!ft||Rt+(Xt instanceof hn?Xt.lookAhead:0)<=Pt.modeFrontier))return Rt;var ge=ee(Bt.text,null,it.options.tabSize);(gt==null||dt>ge)&&(gt=Rt-1,dt=ge)}return gt}function ur(it,st){if(it.modeFrontier=Math.min(it.modeFrontier,st),!(it.highlightFrontier<st-10)){for(var ft=it.first,dt=st-1;dt>ft;dt--){var gt=Xe(it,dt).stateAfter;if(gt&&(!(gt instanceof hn)||dt+gt.lookAhead<st)){ft=dt+1;break}}it.highlightFrontier=Math.min(it.highlightFrontier,ft)}}var Wr=!1,Ve=!1;function Ko(){Wr=!0}function Ye(){Ve=!0}function qr(it,st,ft){this.marker=it,this.from=st,this.to=ft}function ma(it,st){if(it)for(var ft=0;ft<it.length;++ft){var dt=it[ft];if(dt.marker==st)return dt}}function Co(it,st){for(var ft,dt=0;dt<it.length;++dt)it[dt]!=st&&(ft||(ft=[])).push(it[dt]);return ft}function hl(it,st){it.markedSpans=it.markedSpans?it.markedSpans.concat([st]):[st],st.marker.attachLine(it)}function Fo(it,st,ft){var dt;if(it)for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Tt=Pt.marker,Rt=Pt.from==null||(Tt.inclusiveLeft?Pt.from<=st:Pt.from<st);if(Rt||Pt.from==st&&Tt.type=="bookmark"&&(!ft||!Pt.marker.insertLeft)){var Bt=Pt.to==null||(Tt.inclusiveRight?Pt.to>=st:Pt.to>st);(dt||(dt=[])).push(new qr(Tt,Pt.from,Bt?null:Pt.to))}}return dt}function vr(it,st,ft){var dt;if(it)for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Tt=Pt.marker,Rt=Pt.to==null||(Tt.inclusiveRight?Pt.to>=st:Pt.to>st);if(Rt||Pt.from==st&&Tt.type=="bookmark"&&(!ft||Pt.marker.insertLeft)){var Bt=Pt.from==null||(Tt.inclusiveLeft?Pt.from<=st:Pt.from<st);(dt||(dt=[])).push(new qr(Tt,Bt?null:Pt.from-st,Pt.to==null?null:Pt.to-st))}}return dt}function Ao(it,st){if(st.full)return null;var ft=ri(it,st.from.line)&&Xe(it,st.from.line).markedSpans,dt=ri(it,st.to.line)&&Xe(it,st.to.line).markedSpans;if(!ft&&!dt)return null;var gt=st.from.ch,Pt=st.to.ch,Tt=Gn(st.from,st.to)==0,Rt=Fo(ft,gt,Tt),Bt=vr(dt,Pt,Tt),Xt=st.text.length==1,ge=Te(st.text).length+(Xt?gt:0);if(Rt)for(var te=0;te<Rt.length;++te){var Ae=Rt[te];if(Ae.to==null){var Ee=ma(Bt,Ae.marker);Ee?Xt&&(Ae.to=Ee.to==null?null:Ee.to+ge):Ae.to=gt}}if(Bt)for(var dn=0;dn<Bt.length;++dn){var gn=Bt[dn];if(gn.to!=null&&(gn.to+=ge),gn.from==null){var Fn=ma(Rt,gn.marker);Fn||(gn.from=ge,Xt&&(Rt||(Rt=[])).push(gn))}else gn.from+=ge,Xt&&(Rt||(Rt=[])).push(gn)}Rt&&(Rt=Ja(Rt)),Bt&&Bt!=Rt&&(Bt=Ja(Bt));var Xn=[Rt];if(!Xt){var Pi=st.text.length-2,si;if(Pi>0&&Rt)for(var Di=0;Di<Rt.length;++Di)Rt[Di].to==null&&(si||(si=[])).push(new qr(Rt[Di].marker,null,null));for(var hr=0;hr<Pi;++hr)Xn.push(si);Xn.push(Bt)}return Xn}function Ja(it){for(var st=0;st<it.length;++st){var ft=it[st];ft.from!=null&&ft.from==ft.to&&ft.marker.clearWhenEmpty!==!1&&it.splice(st--,1)}return it.length?it:null}function To(it,st,ft){var dt=null;if(it.iter(st.line,ft.line+1,function(Ee){if(Ee.markedSpans)for(var dn=0;dn<Ee.markedSpans.length;++dn){var gn=Ee.markedSpans[dn].marker;gn.readOnly&&(!dt||Kt(dt,gn)==-1)&&(dt||(dt=[])).push(gn)}}),!dt)return null;for(var gt=[{from:st,to:ft}],Pt=0;Pt<dt.length;++Pt)for(var Tt=dt[Pt],Rt=Tt.find(0),Bt=0;Bt<gt.length;++Bt){var Xt=gt[Bt];if(!(Gn(Xt.to,Rt.from)<0||Gn(Xt.from,Rt.to)>0)){var ge=[Bt,1],te=Gn(Xt.from,Rt.from),Ae=Gn(Xt.to,Rt.to);(te<0||!Tt.inclusiveLeft&&!te)&&ge.push({from:Xt.from,to:Rt.from}),(Ae>0||!Tt.inclusiveRight&&!Ae)&&ge.push({from:Rt.to,to:Xt.to}),gt.splice.apply(gt,ge),Bt+=ge.length-3}}return gt}function xn(it){var st=it.markedSpans;if(st){for(var ft=0;ft<st.length;++ft)st[ft].marker.detachLine(it);it.markedSpans=null}}function jt(it,st){if(st){for(var ft=0;ft<st.length;++ft)st[ft].marker.attachLine(it);it.markedSpans=st}}function cs(it){return it.inclusiveLeft?-1:0}function Eu(it){return it.inclusiveRight?1:0}function Fu(it,st){var ft=it.lines.length-st.lines.length;if(ft!=0)return ft;var dt=it.find(),gt=st.find(),Pt=Gn(dt.from,gt.from)||cs(it)-cs(st);if(Pt)return-Pt;var Tt=Gn(dt.to,gt.to)||Eu(it)-Eu(st);return Tt||st.id-it.id}function dl(it,st){var ft=Ve&&it.markedSpans,dt;if(ft)for(var gt=void 0,Pt=0;Pt<ft.length;++Pt)gt=ft[Pt],gt.marker.collapsed&&(st?gt.from:gt.to)==null&&(!dt||Fu(dt,gt.marker)<0)&&(dt=gt.marker);return dt}function ch(it){return dl(it,!0)}function Xu(it){return dl(it,!1)}function ud(it,st){var ft=Ve&&it.markedSpans,dt;if(ft)for(var gt=0;gt<ft.length;++gt){var Pt=ft[gt];Pt.marker.collapsed&&(Pt.from==null||Pt.from<st)&&(Pt.to==null||Pt.to>st)&&(!dt||Fu(dt,Pt.marker)<0)&&(dt=Pt.marker)}return dt}function jh(it,st,ft,dt,gt){var Pt=Xe(it,st),Tt=Ve&&Pt.markedSpans;if(Tt)for(var Rt=0;Rt<Tt.length;++Rt){var Bt=Tt[Rt];if(Bt.marker.collapsed){var Xt=Bt.marker.find(0),ge=Gn(Xt.from,ft)||cs(Bt.marker)-cs(gt),te=Gn(Xt.to,dt)||Eu(Bt.marker)-Eu(gt);if(!(ge>=0&&te<=0||ge<=0&&te>=0)&&(ge<=0&&(Bt.marker.inclusiveRight&>.inclusiveLeft?Gn(Xt.to,ft)>=0:Gn(Xt.to,ft)>0)||ge>=0&&(Bt.marker.inclusiveRight&>.inclusiveLeft?Gn(Xt.from,dt)<=0:Gn(Xt.from,dt)<0)))return!0}}}function Lo(it){for(var st;st=ch(it);)it=st.find(-1,!0).line;return it}function gs(it){for(var st;st=Xu(it);)it=st.find(1,!0).line;return it}function wi(it){for(var st,ft;st=Xu(it);)it=st.find(1,!0).line,(ft||(ft=[])).push(it);return ft}function li(it,st){var ft=Xe(it,st),dt=Lo(ft);return ft==dt?st:fe(dt)}function Ii(it,st){if(st>it.lastLine())return st;var ft=Xe(it,st),dt;if(!Ze(it,ft))return st;for(;dt=Xu(ft);)ft=dt.find(1,!0).line;return fe(ft)+1}function Ze(it,st){var ft=Ve&&st.markedSpans;if(ft){for(var dt=void 0,gt=0;gt<ft.length;++gt)if(dt=ft[gt],!!dt.marker.collapsed){if(dt.from==null)return!0;if(!dt.marker.widgetNode&&dt.from==0&&dt.marker.inclusiveLeft&&Rr(it,st,dt))return!0}}}function Rr(it,st,ft){if(ft.to==null){var dt=ft.marker.find(1,!0);return Rr(it,dt.line,ma(dt.line.markedSpans,ft.marker))}if(ft.marker.inclusiveRight&&ft.to==st.text.length)return!0;for(var gt=void 0,Pt=0;Pt<st.markedSpans.length;++Pt)if(gt=st.markedSpans[Pt],gt.marker.collapsed&&!gt.marker.widgetNode&>.from==ft.to&&(gt.to==null||gt.to!=ft.from)&&(gt.marker.inclusiveLeft||ft.marker.inclusiveRight)&&Rr(it,st,gt))return!0}function fo(it){it=Lo(it);for(var st=0,ft=it.parent,dt=0;dt<ft.lines.length;++dt){var gt=ft.lines[dt];if(gt==it)break;st+=gt.height}for(var Pt=ft.parent;Pt;ft=Pt,Pt=ft.parent)for(var Tt=0;Tt<Pt.children.length;++Tt){var Rt=Pt.children[Tt];if(Rt==ft)break;st+=Rt.height}return st}function ls(it){if(it.height==0)return 0;for(var st=it.text.length,ft,dt=it;ft=ch(dt);){var gt=ft.find(0,!0);dt=gt.from.line,st+=gt.from.ch-gt.to.ch}for(dt=it;ft=Xu(dt);){var Pt=ft.find(0,!0);st-=dt.text.length-Pt.from.ch,dt=Pt.to.line,st+=dt.text.length-Pt.to.ch}return st}function Mo(it){var st=it.display,ft=it.doc;st.maxLine=Xe(ft,ft.first),st.maxLineLength=ls(st.maxLine),st.maxLineChanged=!0,ft.iter(function(dt){var gt=ls(dt);gt>st.maxLineLength&&(st.maxLineLength=gt,st.maxLine=dt)})}var $o=function(it,st,ft){this.text=it,jt(this,st),this.height=ft?ft(this):1};$o.prototype.lineNo=function(){return fe(this)},qi($o);function Es(it,st,ft,dt){it.text=st,it.stateAfter&&(it.stateAfter=null),it.styles&&(it.styles=null),it.order!=null&&(it.order=null),xn(it),jt(it,ft);var gt=dt?dt(it):1;gt!=it.height&&an(it,gt)}function va(it){it.parent=null,xn(it)}var la={},Zu={};function Tu(it,st){if(!it||/^\s*$/.test(it))return null;var ft=st.addModeClass?Zu:la;return ft[it]||(ft[it]=it.replace(/\S+/g,"cm-$&"))}function ye(it,st){var ft=Ne("span",null,null,$t?"padding-right: .1px":null),dt={pre:Ne("pre",[ft],"CodeMirror-line"),content:ft,col:0,pos:0,cm:it,trailingSpace:!1,splitSpaces:it.getOption("lineWrapping")};st.measure={};for(var gt=0;gt<=(st.rest?st.rest.length:0);gt++){var Pt=gt?st.rest[gt-1]:st.line,Tt=void 0;dt.pos=0,dt.addToken=Rl,bs(it.display.measure)&&(Tt=Yi(Pt,it.doc.direction))&&(dt.addToken=os(dt.addToken,Tt)),dt.map=[];var Rt=st!=it.display.externalMeasured&&fe(Pt);hd(Pt,dt,Ps(it,Pt,Rt)),Pt.styleClasses&&(Pt.styleClasses.bgClass&&(dt.bgClass=wn(Pt.styleClasses.bgClass,dt.bgClass||"")),Pt.styleClasses.textClass&&(dt.textClass=wn(Pt.styleClasses.textClass,dt.textClass||""))),dt.map.length==0&&dt.map.push(0,0,dt.content.appendChild(Ia(it.display.measure))),gt==0?(st.measure.map=dt.map,st.measure.cache={}):((st.measure.maps||(st.measure.maps=[])).push(dt.map),(st.measure.caches||(st.measure.caches=[])).push({}))}if($t){var Bt=dt.content.lastChild;(/\bcm-tab\b/.test(Bt.className)||Bt.querySelector&&Bt.querySelector(".cm-tab"))&&(dt.content.className="cm-tab-wrap-hack")}return xo(it,"renderLine",it,st.line,dt.pre),dt.pre.className&&(dt.textClass=wn(dt.pre.className,dt.textClass||"")),dt}function Ra(it){var st=re("span","\u2022","cm-invalidchar");return st.title="\\u"+it.charCodeAt(0).toString(16),st.setAttribute("aria-label",st.title),st}function Rl(it,st,ft,dt,gt,Pt,Tt){if(st){var Rt=it.splitSpaces?Ju(st,it.trailingSpace):st,Bt=it.cm.state.specialChars,Xt=!1,ge;if(!Bt.test(st))it.col+=st.length,ge=document.createTextNode(Rt),it.map.push(it.pos,it.pos+st.length,ge),Se&&de<9&&(Xt=!0),it.pos+=st.length;else{ge=document.createDocumentFragment();for(var te=0;;){Bt.lastIndex=te;var Ae=Bt.exec(st),Ee=Ae?Ae.index-te:st.length-te;if(Ee){var dn=document.createTextNode(Rt.slice(te,te+Ee));Se&&de<9?ge.appendChild(re("span",[dn])):ge.appendChild(dn),it.map.push(it.pos,it.pos+Ee,dn),it.col+=Ee,it.pos+=Ee}if(!Ae)break;te+=Ee+1;var gn=void 0;if(Ae[0]==" "){var Fn=it.cm.options.tabSize,Xn=Fn-it.col%Fn;gn=ge.appendChild(re("span",he(Xn),"cm-tab")),gn.setAttribute("role","presentation"),gn.setAttribute("cm-text"," "),it.col+=Xn}else Ae[0]=="\r"||Ae[0]==`
|
|
`?(gn=ge.appendChild(re("span",Ae[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),gn.setAttribute("cm-text",Ae[0]),it.col+=1):(gn=it.cm.options.specialCharPlaceholder(Ae[0]),gn.setAttribute("cm-text",Ae[0]),Se&&de<9?ge.appendChild(re("span",[gn])):ge.appendChild(gn),it.col+=1);it.map.push(it.pos,it.pos+1,gn),it.pos++}}if(it.trailingSpace=Rt.charCodeAt(st.length-1)==32,ft||dt||gt||Xt||Pt||Tt){var Pi=ft||"";dt&&(Pi+=dt),gt&&(Pi+=gt);var si=re("span",[ge],Pi,Pt);if(Tt)for(var Di in Tt)Tt.hasOwnProperty(Di)&&Di!="style"&&Di!="class"&&si.setAttribute(Di,Tt[Di]);return it.content.appendChild(si)}it.content.appendChild(ge)}}function Ju(it,st){if(it.length>1&&!/ /.test(it))return it;for(var ft=st,dt="",gt=0;gt<it.length;gt++){var Pt=it.charAt(gt);Pt==" "&&ft&&(gt==it.length-1||it.charCodeAt(gt+1)==32)&&(Pt="\xA0"),dt+=Pt,ft=Pt==" "}return dt}function os(it,st){return function(ft,dt,gt,Pt,Tt,Rt,Bt){gt=gt?gt+" cm-force-border":"cm-force-border";for(var Xt=ft.pos,ge=Xt+dt.length;;){for(var te=void 0,Ae=0;Ae<st.length&&(te=st[Ae],!(te.to>Xt&&te.from<=Xt));Ae++);if(te.to>=ge)return it(ft,dt,gt,Pt,Tt,Rt,Bt);it(ft,dt.slice(0,te.to-Xt),gt,Pt,null,Rt,Bt),Pt=null,dt=dt.slice(te.to-Xt),Xt=te.to}}}function Nu(it,st,ft,dt){var gt=!dt&&ft.widgetNode;gt&&it.map.push(it.pos,it.pos+st,gt),!dt&&it.cm.display.input.needsContentAttribute&&(gt||(gt=it.content.appendChild(document.createElement("span"))),gt.setAttribute("cm-marker",ft.id)),gt&&(it.cm.display.input.setUneditable(gt),it.content.appendChild(gt)),it.pos+=st,it.trailingSpace=!1}function hd(it,st,ft){var dt=it.markedSpans,gt=it.text,Pt=0;if(!dt){for(var Tt=1;Tt<ft.length;Tt+=2)st.addToken(st,gt.slice(Pt,Pt=ft[Tt]),Tu(ft[Tt+1],st.cm.options));return}for(var Rt=gt.length,Bt=0,Xt=1,ge="",te,Ae,Ee=0,dn,gn,Fn,Xn,Pi;;){if(Ee==Bt){dn=gn=Fn=Ae="",Pi=null,Xn=null,Ee=1/0;for(var si=[],Di=void 0,hr=0;hr<dt.length;++hr){var ii=dt[hr],Br=ii.marker;if(Br.type=="bookmark"&&ii.from==Bt&&Br.widgetNode)si.push(Br);else if(ii.from<=Bt&&(ii.to==null||ii.to>Bt||Br.collapsed&&ii.to==Bt&&ii.from==Bt)){if(ii.to!=null&&ii.to!=Bt&&Ee>ii.to&&(Ee=ii.to,gn=""),Br.className&&(dn+=" "+Br.className),Br.css&&(Ae=(Ae?Ae+";":"")+Br.css),Br.startStyle&&ii.from==Bt&&(Fn+=" "+Br.startStyle),Br.endStyle&&ii.to==Ee&&(Di||(Di=[])).push(Br.endStyle,ii.to),Br.title&&((Pi||(Pi={})).title=Br.title),Br.attributes)for(var hs in Br.attributes)(Pi||(Pi={}))[hs]=Br.attributes[hs];Br.collapsed&&(!Xn||Fu(Xn.marker,Br)<0)&&(Xn=ii)}else ii.from>Bt&&Ee>ii.from&&(Ee=ii.from)}if(Di)for(var fa=0;fa<Di.length;fa+=2)Di[fa+1]==Ee&&(gn+=" "+Di[fa]);if(!Xn||Xn.from==Bt)for(var Ms=0;Ms<si.length;++Ms)Nu(st,0,si[Ms]);if(Xn&&(Xn.from||0)==Bt){if(Nu(st,(Xn.to==null?Rt+1:Xn.to)-Bt,Xn.marker,Xn.from==null),Xn.to==null)return;Xn.to==Bt&&(Xn=!1)}}if(Bt>=Rt)break;for(var Tl=Math.min(Rt,Ee);;){if(ge){var rl=Bt+ge.length;if(!Xn){var ra=rl>Tl?ge.slice(0,Tl-Bt):ge;st.addToken(st,ra,te?te+dn:dn,Fn,Bt+ra.length==Ee?gn:"",Ae,Pi)}if(rl>=Tl){ge=ge.slice(Tl-Bt),Bt=Tl;break}Bt=rl,Fn=""}ge=gt.slice(Pt,Pt=ft[Xt++]),te=Tu(ft[Xt++],st.cm.options)}}}function gh(it,st,ft){this.line=st,this.rest=wi(st),this.size=this.rest?fe(Te(this.rest))-ft+1:1,this.node=this.text=null,this.hidden=Ze(it,st)}function co(it,st,ft){for(var dt=[],gt,Pt=st;Pt<ft;Pt=gt){var Tt=new gh(it.doc,Xe(it.doc,Pt),Pt);gt=Pt+Tt.size,dt.push(Tt)}return dt}var ps=null;function nr(it){ps?ps.ops.push(it):it.ownsGroup=ps={ops:[it],delayedCallbacks:[]}}function mr(it){var st=it.delayedCallbacks,ft=0;do{for(;ft<st.length;ft++)st[ft].call(null);for(var dt=0;dt<it.ops.length;dt++){var gt=it.ops[dt];if(gt.cursorActivityHandlers)for(;gt.cursorActivityCalled<gt.cursorActivityHandlers.length;)gt.cursorActivityHandlers[gt.cursorActivityCalled++].call(null,gt.cm)}}while(ft<st.length)}function vo(it,st){var ft=it.ownsGroup;if(ft)try{mr(ft)}finally{ps=null,st(ft)}}var ss=null;function ni(it,st){var ft=Us(it,st);if(ft.length){var dt=Array.prototype.slice.call(arguments,2),gt;ps?gt=ps.delayedCallbacks:ss?gt=ss:(gt=ss=[],setTimeout(kf,0));for(var Pt=function(Rt){gt.push(function(){return ft[Rt].apply(null,dt)})},Tt=0;Tt<ft.length;++Tt)Pt(Tt)}}function kf(){var it=ss;ss=null;for(var st=0;st<it.length;++st)it[st]()}function hu(it,st,ft,dt){for(var gt=0;gt<st.changes.length;gt++){var Pt=st.changes[gt];Pt=="text"?yn(it,st):Pt=="gutter"?ms(it,st,ft,dt):Pt=="class"?us(it,st):Pt=="widget"&&du(it,st,dt)}st.changes=null}function Zl(it){return it.node==it.text&&(it.node=re("div",null,null,"position: relative"),it.text.parentNode&&it.text.parentNode.replaceChild(it.node,it.text),it.node.appendChild(it.text),Se&&de<8&&(it.node.style.zIndex=2)),it.node}function dd(it,st){var ft=st.bgClass?st.bgClass+" "+(st.line.bgClass||""):st.line.bgClass;if(ft&&(ft+=" CodeMirror-linebackground"),st.background)ft?st.background.className=ft:(st.background.parentNode.removeChild(st.background),st.background=null);else if(ft){var dt=Zl(st);st.background=dt.insertBefore(re("div",null,ft),dt.firstChild),it.display.input.setUneditable(st.background)}}function fd(it,st){var ft=it.display.externalMeasured;return ft&&ft.line==st.line?(it.display.externalMeasured=null,st.measure=ft.measure,ft.built):ye(it,st)}function yn(it,st){var ft=st.text.className,dt=fd(it,st);st.text==st.node&&(st.node=dt.pre),st.text.parentNode.replaceChild(dt.pre,st.text),st.text=dt.pre,dt.bgClass!=st.bgClass||dt.textClass!=st.textClass?(st.bgClass=dt.bgClass,st.textClass=dt.textClass,us(it,st)):ft&&(st.text.className=ft)}function us(it,st){dd(it,st),st.line.wrapClass?Zl(st).className=st.line.wrapClass:st.node!=st.text&&(st.node.className="");var ft=st.textClass?st.textClass+" "+(st.line.textClass||""):st.line.textClass;st.text.className=ft||""}function ms(it,st,ft,dt){if(st.gutter&&(st.node.removeChild(st.gutter),st.gutter=null),st.gutterBackground&&(st.node.removeChild(st.gutterBackground),st.gutterBackground=null),st.line.gutterClass){var gt=Zl(st);st.gutterBackground=re("div",null,"CodeMirror-gutter-background "+st.line.gutterClass,"left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px; width: "+dt.gutterTotalWidth+"px"),it.display.input.setUneditable(st.gutterBackground),gt.insertBefore(st.gutterBackground,st.text)}var Pt=st.line.gutterMarkers;if(it.options.lineNumbers||Pt){var Tt=Zl(st),Rt=st.gutter=re("div",null,"CodeMirror-gutter-wrapper","left: "+(it.options.fixedGutter?dt.fixedPos:-dt.gutterTotalWidth)+"px");if(it.display.input.setUneditable(Rt),Tt.insertBefore(Rt,st.text),st.line.gutterClass&&(Rt.className+=" "+st.line.gutterClass),it.options.lineNumbers&&(!Pt||!Pt["CodeMirror-linenumbers"])&&(st.lineNumber=Rt.appendChild(re("div",Ki(it.options,ft),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+dt.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+it.display.lineNumInnerWidth+"px"))),Pt)for(var Bt=0;Bt<it.display.gutterSpecs.length;++Bt){var Xt=it.display.gutterSpecs[Bt].className,ge=Pt.hasOwnProperty(Xt)&&Pt[Xt];ge&&Rt.appendChild(re("div",[ge],"CodeMirror-gutter-elt","left: "+dt.gutterLeft[Xt]+"px; width: "+dt.gutterWidth[Xt]+"px"))}}}function du(it,st,ft){st.alignable&&(st.alignable=null);for(var dt=zt("CodeMirror-linewidget"),gt=st.node.firstChild,Pt=void 0;gt;gt=Pt)Pt=gt.nextSibling,dt.test(gt.className)&&st.node.removeChild(gt);gd(it,st,ft)}function cd(it,st,ft,dt){var gt=fd(it,st);return st.text=st.node=gt.pre,gt.bgClass&&(st.bgClass=gt.bgClass),gt.textClass&&(st.textClass=gt.textClass),us(it,st),ms(it,st,ft,dt),gd(it,st,dt),st.node}function gd(it,st,ft){if(Xi(it,st.line,st,ft,!0),st.rest)for(var dt=0;dt<st.rest.length;dt++)Xi(it,st.rest[dt],st,ft,!1)}function Xi(it,st,ft,dt,gt){if(st.widgets)for(var Pt=Zl(ft),Tt=0,Rt=st.widgets;Tt<Rt.length;++Tt){var Bt=Rt[Tt],Xt=re("div",[Bt.node],"CodeMirror-linewidget"+(Bt.className?" "+Bt.className:""));Bt.handleMouseEvents||Xt.setAttribute("cm-ignore-events","true"),Wd(Bt,Xt,ft,dt),it.display.input.setUneditable(Xt),gt&&Bt.above?Pt.insertBefore(Xt,ft.gutter||ft.text):Pt.appendChild(Xt),ni(Bt,"redraw")}}function Wd(it,st,ft,dt){if(it.noHScroll){(ft.alignable||(ft.alignable=[])).push(st);var gt=dt.wrapperWidth;st.style.left=dt.fixedPos+"px",it.coverGutter||(gt-=dt.gutterTotalWidth,st.style.paddingLeft=dt.gutterTotalWidth+"px"),st.style.width=gt+"px"}it.coverGutter&&(st.style.zIndex=5,st.style.position="relative",it.noHScroll||(st.style.marginLeft=-dt.gutterTotalWidth+"px"))}function Du(it){if(it.height!=null)return it.height;var st=it.doc.cm;if(!st)return 0;if(!ke(document.body,it.node)){var ft="position: relative;";it.coverGutter&&(ft+="margin-left: -"+st.display.gutters.offsetWidth+"px;"),it.noHScroll&&(ft+="width: "+st.display.wrapper.clientWidth+"px;"),oe(st.display.measure,re("div",[it.node],null,ft))}return it.height=it.node.parentNode.offsetHeight}function Qa(it,st){for(var ft=ku(st);ft!=it.wrapper;ft=ft.parentNode)if(!ft||ft.nodeType==1&&ft.getAttribute("cm-ignore-events")=="true"||ft.parentNode==it.sizer&&ft!=it.mover)return!0}function Ll(it){return it.lineSpace.offsetTop}function zh(it){return it.mover.offsetHeight-it.lineSpace.offsetHeight}function pd(it){if(it.cachedPaddingH)return it.cachedPaddingH;var st=oe(it.measure,re("pre","x","CodeMirror-line-like")),ft=window.getComputedStyle?window.getComputedStyle(st):st.currentStyle,dt={left:parseInt(ft.paddingLeft),right:parseInt(ft.paddingRight)};return!isNaN(dt.left)&&!isNaN(dt.right)&&(it.cachedPaddingH=dt),dt}function fl(it){return pn-it.display.nativeBarWidth}function Jl(it){return it.display.scroller.clientWidth-fl(it)-it.display.barWidth}function Ud(it){return it.display.scroller.clientHeight-fl(it)-it.display.barHeight}function gc(it,st,ft){var dt=it.options.lineWrapping,gt=dt&&Jl(it);if(!st.measure.heights||dt&&st.measure.width!=gt){var Pt=st.measure.heights=[];if(dt){st.measure.width=gt;for(var Tt=st.text.firstChild.getClientRects(),Rt=0;Rt<Tt.length-1;Rt++){var Bt=Tt[Rt],Xt=Tt[Rt+1];Math.abs(Bt.bottom-Xt.bottom)>2&&Pt.push((Bt.bottom+Xt.top)/2-ft.top)}}Pt.push(ft.bottom-ft.top)}}function Kd(it,st,ft){if(it.line==st)return{map:it.measure.map,cache:it.measure.cache};for(var dt=0;dt<it.rest.length;dt++)if(it.rest[dt]==st)return{map:it.measure.maps[dt],cache:it.measure.caches[dt]};for(var gt=0;gt<it.rest.length;gt++)if(fe(it.rest[gt])>ft)return{map:it.measure.maps[gt],cache:it.measure.caches[gt],before:!0}}function Qc(it,st){st=Lo(st);var ft=fe(st),dt=it.display.externalMeasured=new gh(it.doc,st,ft);dt.lineN=ft;var gt=dt.built=ye(it,dt);return dt.text=gt.pre,oe(it.display.lineMeasure,gt.pre),dt}function pc(it,st,ft,dt){return Ql(it,ph(it,st),ft,dt)}function Au(it,st){if(st>=it.display.viewFrom&&st<it.display.viewTo)return it.display.view[ua(it,st)];var ft=it.display.externalMeasured;if(ft&&st>=ft.lineN&&st<ft.lineN+ft.size)return ft}function ph(it,st){var ft=fe(st),dt=Au(it,ft);dt&&!dt.text?dt=null:dt&&dt.changes&&(hu(it,dt,ft,Af(it)),it.curOp.forceUpdate=!0),dt||(dt=Qc(it,st));var gt=Kd(dt,st,ft);return{line:st,view:dt,rect:null,map:gt.map,cache:gt.cache,before:gt.before,hasHeights:!1}}function Ql(it,st,ft,dt,gt){st.before&&(ft=-1);var Pt=ft+(dt||""),Tt;return st.cache.hasOwnProperty(Pt)?Tt=st.cache[Pt]:(st.rect||(st.rect=st.view.text.getBoundingClientRect()),st.hasHeights||(gc(it,st.view,st.rect),st.hasHeights=!0),Tt=vs(it,st,ft,dt),Tt.bogus||(st.cache[Pt]=Tt)),{left:Tt.left,right:Tt.right,top:gt?Tt.rtop:Tt.top,bottom:gt?Tt.rbottom:Tt.bottom}}var Yd={left:0,right:0,top:0,bottom:0};function bf(it,st,ft){for(var dt,gt,Pt,Tt,Rt,Bt,Xt=0;Xt<it.length;Xt+=3)if(Rt=it[Xt],Bt=it[Xt+1],st<Rt?(gt=0,Pt=1,Tt="left"):st<Bt?(gt=st-Rt,Pt=gt+1):(Xt==it.length-3||st==Bt&&it[Xt+3]>st)&&(Pt=Bt-Rt,gt=Pt-1,st>=Bt&&(Tt="right")),gt!=null){if(dt=it[Xt+2],Rt==Bt&&ft==(dt.insertLeft?"left":"right")&&(Tt=ft),ft=="left"&>==0)for(;Xt&&it[Xt-2]==it[Xt-3]&&it[Xt-1].insertLeft;)dt=it[(Xt-=3)+2],Tt="left";if(ft=="right"&>==Bt-Rt)for(;Xt<it.length-3&&it[Xt+3]==it[Xt+4]&&!it[Xt+5].insertLeft;)dt=it[(Xt+=3)+2],Tt="right";break}return{node:dt,start:gt,end:Pt,collapse:Tt,coverStart:Rt,coverEnd:Bt}}function mc(it,st){var ft=Yd;if(st=="left")for(var dt=0;dt<it.length&&(ft=it[dt]).left==ft.right;dt++);else for(var gt=it.length-1;gt>=0&&(ft=it[gt]).left==ft.right;gt--);return ft}function vs(it,st,ft,dt){var gt=bf(st.map,ft,dt),Pt=gt.node,Tt=gt.start,Rt=gt.end,Bt=gt.collapse,Xt;if(Pt.nodeType==3){for(var ge=0;ge<4;ge++){for(;Tt&&Dn(st.line.text.charAt(gt.coverStart+Tt));)--Tt;for(;gt.coverStart+Rt<gt.coverEnd&&Dn(st.line.text.charAt(gt.coverStart+Rt));)++Rt;if(Se&&de<9&&Tt==0&&Rt==gt.coverEnd-gt.coverStart?Xt=Pt.parentNode.getBoundingClientRect():Xt=mc(ue(Pt,Tt,Rt).getClientRects(),dt),Xt.left||Xt.right||Tt==0)break;Rt=Tt,Tt=Tt-1,Bt="right"}Se&&de<11&&(Xt=$c(it.display.measure,Xt))}else{Tt>0&&(Bt=dt="right");var te;it.options.lineWrapping&&(te=Pt.getClientRects()).length>1?Xt=te[dt=="right"?te.length-1:0]:Xt=Pt.getBoundingClientRect()}if(Se&&de<9&&!Tt&&(!Xt||!Xt.left&&!Xt.right)){var Ae=Pt.parentNode.getClientRects()[0];Ae?Xt={left:Ae.left,right:Ae.left+fu(it.display),top:Ae.top,bottom:Ae.bottom}:Xt=Yd}for(var Ee=Xt.top-st.rect.top,dn=Xt.bottom-st.rect.top,gn=(Ee+dn)/2,Fn=st.view.measure.heights,Xn=0;Xn<Fn.length-1&&!(gn<Fn[Xn]);Xn++);var Pi=Xn?Fn[Xn-1]:0,si=Fn[Xn],Di={left:(Bt=="right"?Xt.right:Xt.left)-st.rect.left,right:(Bt=="left"?Xt.left:Xt.right)-st.rect.left,top:Pi,bottom:si};return!Xt.left&&!Xt.right&&(Di.bogus=!0),it.options.singleCursorHeightPerLine||(Di.rtop=Ee,Di.rbottom=dn),Di}function $c(it,st){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!bi(it))return st;var ft=screen.logicalXDPI/screen.deviceXDPI,dt=screen.logicalYDPI/screen.deviceYDPI;return{left:st.left*ft,right:st.right*ft,top:st.top*dt,bottom:st.bottom*dt}}function Ef(it){if(it.measure&&(it.measure.cache={},it.measure.heights=null,it.rest))for(var st=0;st<it.rest.length;st++)it.measure.caches[st]={}}function Xd(it){it.display.externalMeasure=null,ie(it.display.lineMeasure);for(var st=0;st<it.display.view.length;st++)Ef(it.display.view[st])}function Gh(it){Xd(it),it.display.cachedCharWidth=it.display.cachedTextHeight=it.display.cachedPaddingH=null,it.options.lineWrapping||(it.display.maxLineChanged=!0),it.display.lineNumChars=null}function $a(){return ve&&nt?-(document.body.getBoundingClientRect().left-parseInt(getComputedStyle(document.body).marginLeft)):window.pageXOffset||(document.documentElement||document.body).scrollLeft}function ya(){return ve&&nt?-(document.body.getBoundingClientRect().top-parseInt(getComputedStyle(document.body).marginTop)):window.pageYOffset||(document.documentElement||document.body).scrollTop}function js(it){var st=0;if(it.widgets)for(var ft=0;ft<it.widgets.length;++ft)it.widgets[ft].above&&(st+=Du(it.widgets[ft]));return st}function Ks(it,st,ft,dt,gt){if(!gt){var Pt=js(st);ft.top+=Pt,ft.bottom+=Pt}if(dt=="line")return ft;dt||(dt="local");var Tt=fo(st);if(dt=="local"?Tt+=Ll(it.display):Tt-=it.display.viewOffset,dt=="page"||dt=="window"){var Rt=it.display.lineSpace.getBoundingClientRect();Tt+=Rt.top+(dt=="window"?0:ya());var Bt=Rt.left+(dt=="window"?0:$a());ft.left+=Bt,ft.right+=Bt}return ft.top+=Tt,ft.bottom+=Tt,ft}function Ff(it,st,ft){if(ft=="div")return st;var dt=st.left,gt=st.top;if(ft=="page")dt-=$a(),gt-=ya();else if(ft=="local"||!ft){var Pt=it.display.sizer.getBoundingClientRect();dt+=Pt.left,gt+=Pt.top}var Tt=it.display.lineSpace.getBoundingClientRect();return{left:dt-Tt.left,top:gt-Tt.top}}function Bu(it,st,ft,dt,gt){return dt||(dt=Xe(it.doc,st.line)),Ks(it,dt,pc(it,dt,st.ch,gt),ft)}function Go(it,st,ft,dt,gt,Pt){dt=dt||Xe(it.doc,st.line),gt||(gt=ph(it,dt));function Tt(dn,gn){var Fn=Ql(it,gt,dn,gn?"right":"left",Pt);return gn?Fn.left=Fn.right:Fn.right=Fn.left,Ks(it,dt,Fn,ft)}var Rt=Yi(dt,it.doc.direction),Bt=st.ch,Xt=st.sticky;if(Bt>=dt.text.length?(Bt=dt.text.length,Xt="before"):Bt<=0&&(Bt=0,Xt="after"),!Rt)return Tt(Xt=="before"?Bt-1:Bt,Xt=="before");function ge(dn,gn,Fn){var Xn=Rt[gn],Pi=Xn.level==1;return Tt(Fn?dn-1:dn,Pi!=Fn)}var te=Mn(Rt,Bt,Xt),Ae=Qi,Ee=ge(Bt,te,Xt=="before");return Ae!=null&&(Ee.other=ge(Bt,Ae,Xt!="before")),Ee}function Tf(it,st){var ft=0;st=qn(it.doc,st),it.options.lineWrapping||(ft=fu(it.display)*st.ch);var dt=Xe(it.doc,st.line),gt=fo(dt)+Ll(it.display);return{left:ft,right:ft,top:gt,bottom:gt+dt.height}}function Nf(it,st,ft,dt,gt){var Pt=Ue(it,st,ft);return Pt.xRel=gt,dt&&(Pt.outside=dt),Pt}function Df(it,st,ft){var dt=it.doc;if(ft+=it.display.viewOffset,ft<0)return Nf(dt.first,0,null,-1,-1);var gt=An(dt,ft),Pt=dt.first+dt.size-1;if(gt>Pt)return Nf(dt.first+dt.size-1,Xe(dt,Pt).text.length,null,1,1);st<0&&(st=0);for(var Tt=Xe(dt,gt);;){var Rt=We(it,Tt,gt,st,ft),Bt=ud(Tt,Rt.ch+(Rt.xRel>0||Rt.outside>0?1:0));if(!Bt)return Rt;var Xt=Bt.find(1);if(Xt.line==gt)return Xt;Tt=Xe(dt,gt=Xt.line)}}function oi(it,st,ft,dt){dt-=js(st);var gt=st.text.length,Pt=yi(function(Tt){return Ql(it,ft,Tt-1).bottom<=dt},gt,0);return gt=yi(function(Tt){return Ql(it,ft,Tt).top>dt},Pt,gt),{begin:Pt,end:gt}}function Zd(it,st,ft,dt){ft||(ft=ph(it,st));var gt=Ks(it,st,Ql(it,ft,dt),"line").top;return oi(it,st,ft,gt)}function ne(it,st,ft,dt){return it.bottom<=ft?!1:it.top>ft?!0:(dt?it.left:it.right)>st}function We(it,st,ft,dt,gt){gt-=fo(st);var Pt=ph(it,st),Tt=js(st),Rt=0,Bt=st.text.length,Xt=!0,ge=Yi(st,it.doc.direction);if(ge){var te=(it.options.lineWrapping?_h:$l)(it,st,ft,Pt,ge,dt,gt);Xt=te.level!=1,Rt=Xt?te.from:te.to-1,Bt=Xt?te.to:te.from-1}var Ae=null,Ee=null,dn=yi(function(hr){var ii=Ql(it,Pt,hr);return ii.top+=Tt,ii.bottom+=Tt,ne(ii,dt,gt,!1)?(ii.top<=gt&&ii.left<=dt&&(Ae=hr,Ee=ii),!0):!1},Rt,Bt),gn,Fn,Xn=!1;if(Ee){var Pi=dt-Ee.left<Ee.right-dt,si=Pi==Xt;dn=Ae+(si?0:1),Fn=si?"after":"before",gn=Pi?Ee.left:Ee.right}else{!Xt&&(dn==Bt||dn==Rt)&&dn++,Fn=dn==0?"after":dn==st.text.length?"before":Ql(it,Pt,dn-(Xt?1:0)).bottom+Tt<=gt==Xt?"after":"before";var Di=Go(it,Ue(ft,dn,Fn),"line",st,Pt);gn=Di.left,Xn=gt<Di.top?-1:gt>=Di.bottom?1:0}return dn=zi(st.text,dn,1),Nf(ft,dn,Fn,Xn,dt-gn)}function $l(it,st,ft,dt,gt,Pt,Tt){var Rt=yi(function(te){var Ae=gt[te],Ee=Ae.level!=1;return ne(Go(it,Ue(ft,Ee?Ae.to:Ae.from,Ee?"before":"after"),"line",st,dt),Pt,Tt,!0)},0,gt.length-1),Bt=gt[Rt];if(Rt>0){var Xt=Bt.level!=1,ge=Go(it,Ue(ft,Xt?Bt.from:Bt.to,Xt?"after":"before"),"line",st,dt);ne(ge,Pt,Tt,!0)&&ge.top>Tt&&(Bt=gt[Rt-1])}return Bt}function _h(it,st,ft,dt,gt,Pt,Tt){var Rt=oi(it,st,dt,Tt),Bt=Rt.begin,Xt=Rt.end;/\s/.test(st.text.charAt(Xt-1))&&Xt--;for(var ge=null,te=null,Ae=0;Ae<gt.length;Ae++){var Ee=gt[Ae];if(!(Ee.from>=Xt||Ee.to<=Bt)){var dn=Ee.level!=1,gn=Ql(it,dt,dn?Math.min(Xt,Ee.to)-1:Math.max(Bt,Ee.from)).right,Fn=gn<Pt?Pt-gn+1e9:gn-Pt;(!ge||te>Fn)&&(ge=Ee,te=Fn)}}return ge||(ge=gt[gt.length-1]),ge.from<Bt&&(ge={from:Bt,to:ge.to,level:ge.level}),ge.to>Xt&&(ge={from:ge.from,to:Xt,level:ge.level}),ge}var Qu;function Ou(it){if(it.cachedTextHeight!=null)return it.cachedTextHeight;if(Qu==null){Qu=re("pre",null,"CodeMirror-line-like");for(var st=0;st<49;++st)Qu.appendChild(document.createTextNode("x")),Qu.appendChild(re("br"));Qu.appendChild(document.createTextNode("x"))}oe(it.measure,Qu);var ft=Qu.offsetHeight/50;return ft>3&&(it.cachedTextHeight=ft),ie(it.measure),ft||1}function fu(it){if(it.cachedCharWidth!=null)return it.cachedCharWidth;var st=re("span","xxxxxxxxxx"),ft=re("pre",[st],"CodeMirror-line-like");oe(it.measure,ft);var dt=st.getBoundingClientRect(),gt=(dt.right-dt.left)/10;return gt>2&&(it.cachedCharWidth=gt),gt||10}function Af(it){for(var st=it.display,ft={},dt={},gt=st.gutters.clientLeft,Pt=st.gutters.firstChild,Tt=0;Pt;Pt=Pt.nextSibling,++Tt){var Rt=it.display.gutterSpecs[Tt].className;ft[Rt]=Pt.offsetLeft+Pt.clientLeft+gt,dt[Rt]=Pt.clientWidth}return{fixedPos:md(st),gutterTotalWidth:st.gutters.offsetWidth,gutterLeft:ft,gutterWidth:dt,wrapperWidth:st.wrapper.clientWidth}}function md(it){return it.scroller.getBoundingClientRect().left-it.sizer.getBoundingClientRect().left}function qo(it){var st=Ou(it.display),ft=it.options.lineWrapping,dt=ft&&Math.max(5,it.display.scroller.clientWidth/fu(it.display)-3);return function(gt){if(Ze(it.doc,gt))return 0;var Pt=0;if(gt.widgets)for(var Tt=0;Tt<gt.widgets.length;Tt++)gt.widgets[Tt].height&&(Pt+=gt.widgets[Tt].height);return ft?Pt+(Math.ceil(gt.text.length/dt)||1)*st:Pt+st}}function Ni(it){var st=it.doc,ft=qo(it);st.iter(function(dt){var gt=ft(dt);gt!=dt.height&&an(dt,gt)})}function Sa(it,st,ft,dt){var gt=it.display;if(!ft&&ku(st).getAttribute("cm-not-content")=="true")return null;var Pt,Tt,Rt=gt.lineSpace.getBoundingClientRect();try{Pt=st.clientX-Rt.left,Tt=st.clientY-Rt.top}catch(te){return null}var Bt=Df(it,Pt,Tt),Xt;if(dt&&Bt.xRel>0&&(Xt=Xe(it.doc,Bt.line).text).length==Bt.ch){var ge=ee(Xt,Xt.length,it.options.tabSize)-Xt.length;Bt=Ue(Bt.line,Math.max(0,Math.round((Pt-pd(it.display).left)/fu(it.display))-ge))}return Bt}function ua(it,st){if(st>=it.display.viewTo||(st-=it.display.viewFrom,st<0))return null;for(var ft=it.display.view,dt=0;dt<ft.length;dt++)if(st-=ft[dt].size,st<0)return dt}function ts(it,st,ft,dt){st==null&&(st=it.doc.first),ft==null&&(ft=it.doc.first+it.doc.size),dt||(dt=0);var gt=it.display;if(dt&&ft<gt.viewTo&&(gt.updateLineNumbers==null||gt.updateLineNumbers>st)&&(gt.updateLineNumbers=st),it.curOp.viewChanged=!0,st>=gt.viewTo)Ve&&li(it.doc,st)<gt.viewTo&&Fs(it);else if(ft<=gt.viewFrom)Ve&&Ii(it.doc,ft+dt)>gt.viewFrom?Fs(it):(gt.viewFrom+=dt,gt.viewTo+=dt);else if(st<=gt.viewFrom&&ft>=gt.viewTo)Fs(it);else if(st<=gt.viewFrom){var Pt=qa(it,ft,ft+dt,1);Pt?(gt.view=gt.view.slice(Pt.index),gt.viewFrom=Pt.lineN,gt.viewTo+=dt):Fs(it)}else if(ft>=gt.viewTo){var Tt=qa(it,st,st,-1);Tt?(gt.view=gt.view.slice(0,Tt.index),gt.viewTo=Tt.lineN):Fs(it)}else{var Rt=qa(it,st,st,-1),Bt=qa(it,ft,ft+dt,1);Rt&&Bt?(gt.view=gt.view.slice(0,Rt.index).concat(co(it,Rt.lineN,Bt.lineN)).concat(gt.view.slice(Bt.index)),gt.viewTo+=dt):Fs(it)}var Xt=gt.externalMeasured;Xt&&(ft<Xt.lineN?Xt.lineN+=dt:st<Xt.lineN+Xt.size&&(gt.externalMeasured=null))}function xr(it,st,ft){it.curOp.viewChanged=!0;var dt=it.display,gt=it.display.externalMeasured;if(gt&&st>=gt.lineN&&st<gt.lineN+gt.size&&(dt.externalMeasured=null),!(st<dt.viewFrom||st>=dt.viewTo)){var Pt=dt.view[ua(it,st)];if(Pt.node!=null){var Tt=Pt.changes||(Pt.changes=[]);Kt(Tt,ft)==-1&&Tt.push(ft)}}}function Fs(it){it.display.viewFrom=it.display.viewTo=it.doc.first,it.display.view=[],it.display.viewOffset=0}function qa(it,st,ft,dt){var gt=ua(it,st),Pt,Tt=it.display.view;if(!Ve||ft==it.doc.first+it.doc.size)return{index:gt,lineN:ft};for(var Rt=it.display.viewFrom,Bt=0;Bt<gt;Bt++)Rt+=Tt[Bt].size;if(Rt!=st){if(dt>0){if(gt==Tt.length-1)return null;Pt=Rt+Tt[gt].size-st,gt++}else Pt=Rt-st;st+=Pt,ft+=Pt}for(;li(it.doc,ft)!=ft;){if(gt==(dt<0?0:Tt.length-1))return null;ft+=dt*Tt[gt-(dt<0?1:0)].size,gt+=dt}return{index:gt,lineN:ft}}function No(it,st,ft){var dt=it.display,gt=dt.view;gt.length==0||st>=dt.viewTo||ft<=dt.viewFrom?(dt.view=co(it,st,ft),dt.viewFrom=st):(dt.viewFrom>st?dt.view=co(it,st,dt.viewFrom).concat(dt.view):dt.viewFrom<st&&(dt.view=dt.view.slice(ua(it,st))),dt.viewFrom=st,dt.viewTo<ft?dt.view=dt.view.concat(co(it,dt.viewTo,ft)):dt.viewTo>ft&&(dt.view=dt.view.slice(0,ua(it,ft)))),dt.viewTo=ft}function ja(it){for(var st=it.display.view,ft=0,dt=0;dt<st.length;dt++){var gt=st[dt];!gt.hidden&&(!gt.node||gt.changes)&&++ft}return ft}function Ys(it){it.display.input.showSelection(it.display.input.prepareSelection())}function mh(it,st){st===void 0&&(st=!0);for(var ft=it.doc,dt={},gt=dt.cursors=document.createDocumentFragment(),Pt=dt.selection=document.createDocumentFragment(),Tt=0;Tt<ft.sel.ranges.length;Tt++)if(!(!st&&Tt==ft.sel.primIndex)){var Rt=ft.sel.ranges[Tt];if(!(Rt.from().line>=it.display.viewTo||Rt.to().line<it.display.viewFrom)){var Bt=Rt.empty();(Bt||it.options.showCursorWhenSelecting)&&Jr(it,Rt.head,gt),Bt||Ur(it,Rt,Pt)}}return dt}function Jr(it,st,ft){var dt=Go(it,st,"div",null,null,!it.options.singleCursorHeightPerLine),gt=ft.appendChild(re("div","\xA0","CodeMirror-cursor"));if(gt.style.left=dt.left+"px",gt.style.top=dt.top+"px",gt.style.height=Math.max(0,dt.bottom-dt.top)*it.options.cursorHeight+"px",dt.other){var Pt=ft.appendChild(re("div","\xA0","CodeMirror-cursor CodeMirror-secondarycursor"));Pt.style.display="",Pt.style.left=dt.other.left+"px",Pt.style.top=dt.other.top+"px",Pt.style.height=(dt.other.bottom-dt.other.top)*.85+"px"}}function za(it,st){return it.top-st.top||it.left-st.left}function Ur(it,st,ft){var dt=it.display,gt=it.doc,Pt=document.createDocumentFragment(),Tt=pd(it.display),Rt=Tt.left,Bt=Math.max(dt.sizerWidth,Jl(it)-dt.sizer.offsetLeft)-Tt.right,Xt=gt.direction=="ltr";function ge(si,Di,hr,ii){Di<0&&(Di=0),Di=Math.round(Di),ii=Math.round(ii),Pt.appendChild(re("div",null,"CodeMirror-selected","position: absolute; left: "+si+`px;
|
|
top: `+Di+"px; width: "+(hr==null?Bt-si:hr)+`px;
|
|
height: `+(ii-Di)+"px"))}function te(si,Di,hr){var ii=Xe(gt,si),Br=ii.text.length,hs,fa;function Ms(ra,zl){return Bu(it,Ue(si,ra),"div",ii,zl)}function Tl(ra,zl,Va){var oa=Zd(it,ii,null,ra),wo=zl=="ltr"==(Va=="after")?"left":"right",Os=Va=="after"?oa.begin:oa.end-(/\s/.test(ii.text.charAt(oa.end-1))?2:1);return Ms(Os,wo)[wo]}var rl=Yi(ii,gt.direction);return ei(rl,Di||0,hr==null?Br:hr,function(ra,zl,Va,oa){var wo=Va=="ltr",Os=Ms(ra,wo?"left":"right"),La=Ms(zl-1,wo?"right":"left"),Wa=Di==null&&ra==0,ju=hr==null&&zl==Br,ks=oa==0,vu=!rl||oa==rl.length-1;if(La.top-Os.top<=3){var Hs=(Xt?Wa:ju)&&ks,Ec=(Xt?ju:Wa)&&vu,nu=Hs?Rt:(wo?Os:La).left,Gl=Ec?Bt:(wo?La:Os).right;ge(nu,Os.top,Gl-nu,Os.bottom)}else{var Nl,Zo,Ma,Ch;wo?(Nl=Xt&&Wa&&ks?Rt:Os.left,Zo=Xt?Bt:Tl(ra,Va,"before"),Ma=Xt?Rt:Tl(zl,Va,"after"),Ch=Xt&&ju&&vu?Bt:La.right):(Nl=Xt?Tl(ra,Va,"before"):Rt,Zo=!Xt&&Wa&&ks?Bt:Os.right,Ma=!Xt&&ju&&vu?Rt:La.left,Ch=Xt?Tl(zl,Va,"after"):Bt),ge(Nl,Os.top,Zo-Nl,Os.bottom),Os.bottom<La.top&&ge(Rt,Os.bottom,null,La.top),ge(Ma,La.top,Ch-Ma,La.bottom)}(!hs||za(Os,hs)<0)&&(hs=Os),za(La,hs)<0&&(hs=La),(!fa||za(Os,fa)<0)&&(fa=Os),za(La,fa)<0&&(fa=La)}),{start:hs,end:fa}}var Ae=st.from(),Ee=st.to();if(Ae.line==Ee.line)te(Ae.line,Ae.ch,Ee.ch);else{var dn=Xe(gt,Ae.line),gn=Xe(gt,Ee.line),Fn=Lo(dn)==Lo(gn),Xn=te(Ae.line,Ae.ch,Fn?dn.text.length+1:null).end,Pi=te(Ee.line,Fn?0:null,Ee.ch).start;Fn&&(Xn.top<Pi.top-2?(ge(Xn.right,Xn.top,null,Xn.bottom),ge(Rt,Pi.top,Pi.left,Pi.bottom)):ge(Xn.right,Xn.top,Pi.left-Xn.right,Xn.bottom)),Xn.bottom<Pi.top&&ge(Rt,Xn.bottom,null,Pi.top)}ft.appendChild(Pt)}function ko(it){if(it.state.focused){var st=it.display;clearInterval(st.blinker);var ft=!0;st.cursorDiv.style.visibility="",it.options.cursorBlinkRate>0?st.blinker=setInterval(function(){it.hasFocus()||Hh(it),st.cursorDiv.style.visibility=(ft=!ft)?"":"hidden"},it.options.cursorBlinkRate):it.options.cursorBlinkRate<0&&(st.cursorDiv.style.visibility="hidden")}}function Bo(it){it.state.focused||(it.display.input.focus(),eo(it))}function as(it){it.state.delayingBlurEvent=!0,setTimeout(function(){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1,Hh(it))},100)}function eo(it,st){it.state.delayingBlurEvent&&(it.state.delayingBlurEvent=!1),it.options.readOnly!="nocursor"&&(it.state.focused||(xo(it,"focus",it,st),it.state.focused=!0,Fe(it.display.wrapper,"CodeMirror-focused"),!it.curOp&&it.display.selForContextMenu!=it.doc.sel&&(it.display.input.reset(),$t&&setTimeout(function(){return it.display.input.reset(!0)},20)),it.display.input.receivedFocus()),ko(it))}function Hh(it,st){it.state.delayingBlurEvent||(it.state.focused&&(xo(it,"blur",it,st),it.state.focused=!1,Qt(it.display.wrapper,"CodeMirror-focused")),clearInterval(it.display.blinker),setTimeout(function(){it.state.focused||(it.display.shift=!1)},150))}function Ei(it){for(var st=it.display,ft=st.lineDiv.offsetTop,dt=0;dt<st.view.length;dt++){var gt=st.view[dt],Pt=it.options.lineWrapping,Tt=void 0,Rt=0;if(!gt.hidden){if(Se&&de<8){var Bt=gt.node.offsetTop+gt.node.offsetHeight;Tt=Bt-ft,ft=Bt}else{var Xt=gt.node.getBoundingClientRect();Tt=Xt.bottom-Xt.top,!Pt&>.text.firstChild&&(Rt=gt.text.firstChild.getBoundingClientRect().right-Xt.left-1)}var ge=gt.line.height-Tt;if((ge>.005||ge<-.005)&&(an(gt.line,Tt),vc(gt.line),gt.rest))for(var te=0;te<gt.rest.length;te++)vc(gt.rest[te]);if(Rt>it.display.sizerWidth){var Ae=Math.ceil(Rt/fu(it.display));Ae>it.display.maxLineLength&&(it.display.maxLineLength=Ae,it.display.maxLine=gt.line,it.display.maxLineChanged=!0)}}}}function vc(it){if(it.widgets)for(var st=0;st<it.widgets.length;++st){var ft=it.widgets[st],dt=ft.node.parentNode;dt&&(ft.height=dt.offsetHeight)}}function jr(it,st,ft){var dt=ft&&ft.top!=null?Math.max(0,ft.top):it.scroller.scrollTop;dt=Math.floor(dt-Ll(it));var gt=ft&&ft.bottom!=null?ft.bottom:dt+it.wrapper.clientHeight,Pt=An(st,dt),Tt=An(st,gt);if(ft&&ft.ensure){var Rt=ft.ensure.from.line,Bt=ft.ensure.to.line;Rt<Pt?(Pt=Rt,Tt=An(st,fo(Xe(st,Rt))+it.wrapper.clientHeight)):Math.min(Bt,st.lastLine())>=Tt&&(Pt=An(st,fo(Xe(st,Bt))-it.wrapper.clientHeight),Tt=Bt)}return{from:Pt,to:Math.max(Tt,Pt+1)}}function qc(it,st){if(!zr(it,"scrollCursorIntoView")){var ft=it.display,dt=ft.sizer.getBoundingClientRect(),gt=null;if(st.top+dt.top<0?gt=!0:st.bottom+dt.top>(window.innerHeight||document.documentElement.clientHeight)&&(gt=!1),gt!=null&&!tn){var Pt=re("div","\u200B",null,`position: absolute;
|
|
top: `+(st.top-ft.viewOffset-Ll(it.display))+`px;
|
|
height: `+(st.bottom-st.top+fl(it)+ft.barHeight)+`px;
|
|
left: `+st.left+"px; width: "+Math.max(2,st.right-st.left)+"px;");it.display.lineSpace.appendChild(Pt),Pt.scrollIntoView(gt),it.display.lineSpace.removeChild(Pt)}}}function vd(it,st,ft,dt){dt==null&&(dt=0);var gt;!it.options.lineWrapping&&st==ft&&(st=st.ch?Ue(st.line,st.sticky=="before"?st.ch-1:st.ch,"after"):st,ft=st.sticky=="before"?Ue(st.line,st.ch+1,"before"):st);for(var Pt=0;Pt<5;Pt++){var Tt=!1,Rt=Go(it,st),Bt=!ft||ft==st?Rt:Go(it,ft);gt={left:Math.min(Rt.left,Bt.left),top:Math.min(Rt.top,Bt.top)-dt,right:Math.max(Rt.left,Bt.left),bottom:Math.max(Rt.bottom,Bt.bottom)+dt};var Xt=Bf(it,gt),ge=it.doc.scrollTop,te=it.doc.scrollLeft;if(Xt.scrollTop!=null&&(Wh(it,Xt.scrollTop),Math.abs(it.doc.scrollTop-ge)>1&&(Tt=!0)),Xt.scrollLeft!=null&&(qu(it,Xt.scrollLeft),Math.abs(it.doc.scrollLeft-te)>1&&(Tt=!0)),!Tt)break}return gt}function Jd(it,st){var ft=Bf(it,st);ft.scrollTop!=null&&Wh(it,ft.scrollTop),ft.scrollLeft!=null&&qu(it,ft.scrollLeft)}function Bf(it,st){var ft=it.display,dt=Ou(it.display);st.top<0&&(st.top=0);var gt=it.curOp&&it.curOp.scrollTop!=null?it.curOp.scrollTop:ft.scroller.scrollTop,Pt=Ud(it),Tt={};st.bottom-st.top>Pt&&(st.bottom=st.top+Pt);var Rt=it.doc.height+zh(ft),Bt=st.top<dt,Xt=st.bottom>Rt-dt;if(st.top<gt)Tt.scrollTop=Bt?0:st.top;else if(st.bottom>gt+Pt){var ge=Math.min(st.top,(Xt?Rt:st.bottom)-Pt);ge!=gt&&(Tt.scrollTop=ge)}var te=it.options.fixedGutter?0:ft.gutters.offsetWidth,Ae=it.curOp&&it.curOp.scrollLeft!=null?it.curOp.scrollLeft:ft.scroller.scrollLeft-te,Ee=Jl(it)-ft.gutters.offsetWidth,dn=st.right-st.left>Ee;return dn&&(st.right=st.left+Ee),st.left<10?Tt.scrollLeft=0:st.left<Ae?Tt.scrollLeft=Math.max(0,st.left+te-(dn?0:10)):st.right>Ee+Ae-3&&(Tt.scrollLeft=st.right+(dn?0:10)-Ee),Tt}function Of(it,st){st!=null&&(xa(it),it.curOp.scrollTop=(it.curOp.scrollTop==null?it.doc.scrollTop:it.curOp.scrollTop)+st)}function $u(it){xa(it);var st=it.getCursor();it.curOp.scrollToPos={from:st,to:st,margin:it.options.cursorScrollMargin}}function Vh(it,st,ft){(st!=null||ft!=null)&&xa(it),st!=null&&(it.curOp.scrollLeft=st),ft!=null&&(it.curOp.scrollTop=ft)}function ti(it,st){xa(it),it.curOp.scrollToPos=st}function xa(it){var st=it.curOp.scrollToPos;if(st){it.curOp.scrollToPos=null;var ft=Tf(it,st.from),dt=Tf(it,st.to);If(it,ft,dt,st.margin)}}function If(it,st,ft,dt){var gt=Bf(it,{left:Math.min(st.left,ft.left),top:Math.min(st.top,ft.top)-dt,right:Math.max(st.right,ft.right),bottom:Math.max(st.bottom,ft.bottom)+dt});Vh(it,gt.scrollLeft,gt.scrollTop)}function Wh(it,st){Math.abs(it.doc.scrollTop-st)<2||(It||Ph(it,{top:st}),Rf(it,st,!0),It&&Ph(it),Qd(it,100))}function Rf(it,st,ft){st=Math.max(0,Math.min(it.display.scroller.scrollHeight-it.display.scroller.clientHeight,st)),!(it.display.scroller.scrollTop==st&&!ft)&&(it.doc.scrollTop=st,it.display.scrollbars.setScrollTop(st),it.display.scroller.scrollTop!=st&&(it.display.scroller.scrollTop=st))}function qu(it,st,ft,dt){st=Math.max(0,Math.min(st,it.display.scroller.scrollWidth-it.display.scroller.clientWidth)),!((ft?st==it.doc.scrollLeft:Math.abs(it.doc.scrollLeft-st)<2)&&!dt)&&(it.doc.scrollLeft=st,Wt(it),it.display.scroller.scrollLeft!=st&&(it.display.scroller.scrollLeft=st),it.display.scrollbars.setScrollLeft(st))}function jl(it){var st=it.display,ft=st.gutters.offsetWidth,dt=Math.round(it.doc.height+zh(it.display));return{clientHeight:st.scroller.clientHeight,viewHeight:st.wrapper.clientHeight,scrollWidth:st.scroller.scrollWidth,clientWidth:st.scroller.clientWidth,viewWidth:st.wrapper.clientWidth,barLeft:it.options.fixedGutter?ft:0,docHeight:dt,scrollHeight:dt+fl(it)+st.barHeight,nativeBarWidth:st.nativeBarWidth,gutterWidth:ft}}var Uh=function(it,st,ft){this.cm=ft;var dt=this.vert=re("div",[re("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),gt=this.horiz=re("div",[re("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");dt.tabIndex=gt.tabIndex=-1,it(dt),it(gt),Ci(dt,"scroll",function(){dt.clientHeight&&st(dt.scrollTop,"vertical")}),Ci(gt,"scroll",function(){gt.clientWidth&&st(gt.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,Se&&de<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};Uh.prototype.update=function(it){var st=it.scrollWidth>it.clientWidth+1,ft=it.scrollHeight>it.clientHeight+1,dt=it.nativeBarWidth;if(ft){this.vert.style.display="block",this.vert.style.bottom=st?dt+"px":"0";var gt=it.viewHeight-(st?dt:0);this.vert.firstChild.style.height=Math.max(0,it.scrollHeight-it.clientHeight+gt)+"px"}else this.vert.style.display="",this.vert.firstChild.style.height="0";if(st){this.horiz.style.display="block",this.horiz.style.right=ft?dt+"px":"0",this.horiz.style.left=it.barLeft+"px";var Pt=it.viewWidth-it.barLeft-(ft?dt:0);this.horiz.firstChild.style.width=Math.max(0,it.scrollWidth-it.clientWidth+Pt)+"px"}else this.horiz.style.display="",this.horiz.firstChild.style.width="0";return!this.checkedZeroWidth&&it.clientHeight>0&&(dt==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:ft?dt:0,bottom:st?dt:0}},Uh.prototype.setScrollLeft=function(it){this.horiz.scrollLeft!=it&&(this.horiz.scrollLeft=it),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},Uh.prototype.setScrollTop=function(it){this.vert.scrollTop!=it&&(this.vert.scrollTop=it),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},Uh.prototype.zeroWidthHack=function(){var it=ht&&!Me?"12px":"18px";this.horiz.style.height=this.vert.style.width=it,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new _t,this.disableVert=new _t},Uh.prototype.enableZeroWidthBar=function(it,st,ft){it.style.pointerEvents="auto";function dt(){var gt=it.getBoundingClientRect(),Pt=ft=="vert"?document.elementFromPoint(gt.right-1,(gt.top+gt.bottom)/2):document.elementFromPoint((gt.right+gt.left)/2,gt.bottom-1);Pt!=it?it.style.pointerEvents="none":st.set(1e3,dt)}st.set(1e3,dt)},Uh.prototype.clear=function(){var it=this.horiz.parentNode;it.removeChild(this.horiz),it.removeChild(this.vert)};var Iu=function(){};Iu.prototype.update=function(){return{bottom:0,right:0}},Iu.prototype.setScrollLeft=function(){},Iu.prototype.setScrollTop=function(){},Iu.prototype.clear=function(){};function vh(it,st){st||(st=jl(it));var ft=it.display.barWidth,dt=it.display.barHeight;jf(it,st);for(var gt=0;gt<4&&ft!=it.display.barWidth||dt!=it.display.barHeight;gt++)ft!=it.display.barWidth&&it.options.lineWrapping&&Ei(it),jf(it,jl(it)),ft=it.display.barWidth,dt=it.display.barHeight}function jf(it,st){var ft=it.display,dt=ft.scrollbars.update(st);ft.sizer.style.paddingRight=(ft.barWidth=dt.right)+"px",ft.sizer.style.paddingBottom=(ft.barHeight=dt.bottom)+"px",ft.heightForcer.style.borderBottom=dt.bottom+"px solid transparent",dt.right&&dt.bottom?(ft.scrollbarFiller.style.display="block",ft.scrollbarFiller.style.height=dt.bottom+"px",ft.scrollbarFiller.style.width=dt.right+"px"):ft.scrollbarFiller.style.display="",dt.bottom&&it.options.coverGutterNextToScrollbar&&it.options.fixedGutter?(ft.gutterFiller.style.display="block",ft.gutterFiller.style.height=dt.bottom+"px",ft.gutterFiller.style.width=st.gutterWidth+"px"):ft.gutterFiller.style.display=""}var yc={native:Uh,null:Iu};function tg(it){it.display.scrollbars&&(it.display.scrollbars.clear(),it.display.scrollbars.addClass&&Qt(it.display.wrapper,it.display.scrollbars.addClass)),it.display.scrollbars=new yc[it.options.scrollbarStyle](function(st){it.display.wrapper.insertBefore(st,it.display.scrollbarFiller),Ci(st,"mousedown",function(){it.state.focused&&setTimeout(function(){return it.display.input.focus()},0)}),st.setAttribute("cm-not-content","true")},function(st,ft){ft=="horizontal"?qu(it,st):Wh(it,st)},it),it.display.scrollbars.addClass&&Fe(it.display.wrapper,it.display.scrollbars.addClass)}var eg=0;function yh(it){it.curOp={cm:it,viewChanged:!1,startHeight:it.doc.height,forceUpdate:!1,updateInput:0,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++eg},nr(it.curOp)}function Sh(it){var st=it.curOp;st&&vo(st,function(ft){for(var dt=0;dt<ft.ops.length;dt++)ft.ops[dt].cm.curOp=null;om(ft)})}function om(it){for(var st=it.ops,ft=0;ft<st.length;ft++)Zg(st[ft]);for(var dt=0;dt<st.length;dt++)Sc(st[dt]);for(var gt=0;gt<st.length;gt++)Jg(st[gt]);for(var Pt=0;Pt<st.length;Pt++)ws(st[Pt]);for(var Tt=0;Tt<st.length;Tt++)th(st[Tt])}function Zg(it){var st=it.cm,ft=st.display;Qg(st),it.updateMaxLine&&Mo(st),it.mustUpdate=it.viewChanged||it.forceUpdate||it.scrollTop!=null||it.scrollToPos&&(it.scrollToPos.from.line<ft.viewFrom||it.scrollToPos.to.line>=ft.viewTo)||ft.maxLineChanged&&st.options.lineWrapping,it.update=it.mustUpdate&&new xh(st,it.mustUpdate&&{top:it.scrollTop,ensure:it.scrollToPos},it.forceUpdate)}function Sc(it){it.updatedDisplay=it.mustUpdate&&zf(it.cm,it.update)}function Jg(it){var st=it.cm,ft=st.display;it.updatedDisplay&&Ei(st),it.barMeasure=jl(st),ft.maxLineChanged&&!st.options.lineWrapping&&(it.adjustWidthTo=pc(st,ft.maxLine,ft.maxLine.text.length).left+3,st.display.sizerWidth=it.adjustWidthTo,it.barMeasure.scrollWidth=Math.max(ft.scroller.clientWidth,ft.sizer.offsetLeft+it.adjustWidthTo+fl(st)+st.display.barWidth),it.maxScrollLeft=Math.max(0,ft.sizer.offsetLeft+it.adjustWidthTo-Jl(st))),(it.updatedDisplay||it.selectionChanged)&&(it.preparedSelection=ft.input.prepareSelection())}function ws(it){var st=it.cm;it.adjustWidthTo!=null&&(st.display.sizer.style.minWidth=it.adjustWidthTo+"px",it.maxScrollLeft<st.doc.scrollLeft&&qu(st,Math.min(st.display.scroller.scrollLeft,it.maxScrollLeft),!0),st.display.maxLineChanged=!1);var ft=it.focus&&it.focus==Ke();it.preparedSelection&&st.display.input.showSelection(it.preparedSelection,ft),(it.updatedDisplay||it.startHeight!=st.doc.height)&&vh(st,it.barMeasure),it.updatedDisplay&&Ft(st,it.barMeasure),it.selectionChanged&&ko(st),st.state.focused&&it.updateInput&&st.display.input.reset(it.typing),ft&&Bo(it.cm)}function th(it){var st=it.cm,ft=st.display,dt=st.doc;if(it.updatedDisplay&&yo(st,it.update),ft.wheelStartX!=null&&(it.scrollTop!=null||it.scrollLeft!=null||it.scrollToPos)&&(ft.wheelStartX=ft.wheelStartY=null),it.scrollTop!=null&&Rf(st,it.scrollTop,it.forceScroll),it.scrollLeft!=null&&qu(st,it.scrollLeft,!0,!0),it.scrollToPos){var gt=vd(st,qn(dt,it.scrollToPos.from),qn(dt,it.scrollToPos.to),it.scrollToPos.margin);qc(st,gt)}var Pt=it.maybeHiddenMarkers,Tt=it.maybeUnhiddenMarkers;if(Pt)for(var Rt=0;Rt<Pt.length;++Rt)Pt[Rt].lines.length||xo(Pt[Rt],"hide");if(Tt)for(var Bt=0;Bt<Tt.length;++Bt)Tt[Bt].lines.length&&xo(Tt[Bt],"unhide");ft.wrapper.offsetHeight&&(dt.scrollTop=st.display.scroller.scrollTop),it.changeObjs&&xo(st,"changes",st,it.changeObjs),it.update&&it.update.finish()}function so(it,st){if(it.curOp)return st();yh(it);try{return st()}finally{Sh(it)}}function Xs(it,st){return function(){if(it.curOp)return st.apply(it,arguments);yh(it);try{return st.apply(it,arguments)}finally{Sh(it)}}}function Zs(it){return function(){if(this.curOp)return it.apply(this,arguments);yh(this);try{return it.apply(this,arguments)}finally{Sh(this)}}}function ta(it){return function(){var st=this.cm;if(!st||st.curOp)return it.apply(this,arguments);yh(st);try{return it.apply(this,arguments)}finally{Sh(st)}}}function Qd(it,st){it.doc.highlightFrontier<it.display.viewTo&&it.state.highlight.set(st,$n(ea,it))}function ea(it){var st=it.doc;if(!(st.highlightFrontier>=it.display.viewTo)){var ft=+new Date+it.options.workTime,dt=rs(it,st.highlightFrontier),gt=[];st.iter(dt.line,Math.min(st.first+st.size,it.display.viewTo+500),function(Pt){if(dt.line>=it.display.viewFrom){var Tt=Pt.styles,Rt=Pt.text.length>it.options.maxHighlightLength?On(st.mode,dt.state):null,Bt=Za(it,Pt,dt,!0);Rt&&(dt.state=Rt),Pt.styles=Bt.styles;var Xt=Pt.styleClasses,ge=Bt.classes;ge?Pt.styleClasses=ge:Xt&&(Pt.styleClasses=null);for(var te=!Tt||Tt.length!=Pt.styles.length||Xt!=ge&&(!Xt||!ge||Xt.bgClass!=ge.bgClass||Xt.textClass!=ge.textClass),Ae=0;!te&&Ae<Tt.length;++Ae)te=Tt[Ae]!=Pt.styles[Ae];te&>.push(dt.line),Pt.stateAfter=dt.save(),dt.nextLine()}else Pt.text.length<=it.options.maxHighlightLength&&me(it,Pt.text,dt),Pt.stateAfter=dt.line%5==0?dt.save():null,dt.nextLine();if(+new Date>ft)return Qd(it,it.options.workDelay),!0}),st.highlightFrontier=dt.line,st.modeFrontier=Math.max(st.modeFrontier,dt.line),gt.length&&so(it,function(){for(var Pt=0;Pt<gt.length;Pt++)xr(it,gt[Pt],"text")})}}var xh=function(it,st,ft){var dt=it.display;this.viewport=st,this.visible=jr(dt,it.doc,st),this.editorIsHidden=!dt.wrapper.offsetWidth,this.wrapperHeight=dt.wrapper.clientHeight,this.wrapperWidth=dt.wrapper.clientWidth,this.oldDisplayWidth=Jl(it),this.force=ft,this.dims=Af(it),this.events=[]};xh.prototype.signal=function(it,st){Li(it,st)&&this.events.push(arguments)},xh.prototype.finish=function(){for(var it=0;it<this.events.length;it++)xo.apply(null,this.events[it])};function Qg(it){var st=it.display;!st.scrollbarsClipped&&st.scroller.offsetWidth&&(st.nativeBarWidth=st.scroller.offsetWidth-st.scroller.clientWidth,st.heightForcer.style.height=fl(it)+"px",st.sizer.style.marginBottom=-st.nativeBarWidth+"px",st.sizer.style.borderRightWidth=fl(it)+"px",st.scrollbarsClipped=!0)}function $g(it){if(it.hasFocus())return null;var st=Ke();if(!st||!ke(it.display.lineDiv,st))return null;var ft={activeElt:st};if(window.getSelection){var dt=window.getSelection();dt.anchorNode&&dt.extend&&ke(it.display.lineDiv,dt.anchorNode)&&(ft.anchorNode=dt.anchorNode,ft.anchorOffset=dt.anchorOffset,ft.focusNode=dt.focusNode,ft.focusOffset=dt.focusOffset)}return ft}function cl(it){if(!(!it||!it.activeElt||it.activeElt==Ke())&&(it.activeElt.focus(),!/^(INPUT|TEXTAREA)$/.test(it.activeElt.nodeName)&&it.anchorNode&&ke(document.body,it.anchorNode)&&ke(document.body,it.focusNode))){var st=window.getSelection(),ft=document.createRange();ft.setEnd(it.anchorNode,it.anchorOffset),ft.collapse(!1),st.removeAllRanges(),st.addRange(ft),st.extend(it.focusNode,it.focusOffset)}}function zf(it,st){var ft=it.display,dt=it.doc;if(st.editorIsHidden)return Fs(it),!1;if(!st.force&&st.visible.from>=ft.viewFrom&&st.visible.to<=ft.viewTo&&(ft.updateLineNumbers==null||ft.updateLineNumbers>=ft.viewTo)&&ft.renderedView==ft.view&&ja(it)==0)return!1;Zt(it)&&(Fs(it),st.dims=Af(it));var gt=dt.first+dt.size,Pt=Math.max(st.visible.from-it.options.viewportMargin,dt.first),Tt=Math.min(gt,st.visible.to+it.options.viewportMargin);ft.viewFrom<Pt&&Pt-ft.viewFrom<20&&(Pt=Math.max(dt.first,ft.viewFrom)),ft.viewTo>Tt&&ft.viewTo-Tt<20&&(Tt=Math.min(gt,ft.viewTo)),Ve&&(Pt=li(it.doc,Pt),Tt=Ii(it.doc,Tt));var Rt=Pt!=ft.viewFrom||Tt!=ft.viewTo||ft.lastWrapHeight!=st.wrapperHeight||ft.lastWrapWidth!=st.wrapperWidth;No(it,Pt,Tt),ft.viewOffset=fo(Xe(it.doc,ft.viewFrom)),it.display.mover.style.top=ft.viewOffset+"px";var Bt=ja(it);if(!Rt&&Bt==0&&!st.force&&ft.renderedView==ft.view&&(ft.updateLineNumbers==null||ft.updateLineNumbers>=ft.viewTo))return!1;var Xt=$g(it);return Bt>4&&(ft.lineDiv.style.display="none"),xc(it,ft.updateLineNumbers,st.dims),Bt>4&&(ft.lineDiv.style.display=""),ft.renderedView=ft.view,cl(Xt),ie(ft.cursorDiv),ie(ft.selectionDiv),ft.gutters.style.height=ft.sizer.style.minHeight=0,Rt&&(ft.lastWrapHeight=st.wrapperHeight,ft.lastWrapWidth=st.wrapperWidth,Qd(it,400)),ft.updateLineNumbers=null,!0}function yo(it,st){for(var ft=st.viewport,dt=!0;;dt=!1){if(!dt||!it.options.lineWrapping||st.oldDisplayWidth==Jl(it)){if(ft&&ft.top!=null&&(ft={top:Math.min(it.doc.height+zh(it.display)-Ud(it),ft.top)}),st.visible=jr(it.display,it.doc,ft),st.visible.from>=it.display.viewFrom&&st.visible.to<=it.display.viewTo)break}else dt&&(st.visible=jr(it.display,it.doc,ft));if(!zf(it,st))break;Ei(it);var gt=jl(it);Ys(it),vh(it,gt),Ft(it,gt),st.force=!1}st.signal(it,"update",it),(it.display.viewFrom!=it.display.reportedViewFrom||it.display.viewTo!=it.display.reportedViewTo)&&(st.signal(it,"viewportChange",it,it.display.viewFrom,it.display.viewTo),it.display.reportedViewFrom=it.display.viewFrom,it.display.reportedViewTo=it.display.viewTo)}function Ph(it,st){var ft=new xh(it,st);if(zf(it,ft)){Ei(it),yo(it,ft);var dt=jl(it);Ys(it),vh(it,dt),Ft(it,dt),ft.finish()}}function xc(it,st,ft){var dt=it.display,gt=it.options.lineNumbers,Pt=dt.lineDiv,Tt=Pt.firstChild;function Rt(dn){var gn=dn.nextSibling;return $t&&ht&&it.display.currentWheelTarget==dn?dn.style.display="none":dn.parentNode.removeChild(dn),gn}for(var Bt=dt.view,Xt=dt.viewFrom,ge=0;ge<Bt.length;ge++){var te=Bt[ge];if(!te.hidden)if(!te.node||te.node.parentNode!=Pt){var Ae=cd(it,te,Xt,ft);Pt.insertBefore(Ae,Tt)}else{for(;Tt!=te.node;)Tt=Rt(Tt);var Ee=gt&&st!=null&&st<=Xt&&te.lineNumber;te.changes&&(Kt(te.changes,"gutter")>-1&&(Ee=!1),hu(it,te,Xt,ft)),Ee&&(ie(te.lineNumber),te.lineNumber.appendChild(document.createTextNode(Ki(it.options,Xt)))),Tt=te.node.nextSibling}Xt+=te.size}for(;Tt;)Tt=Rt(Tt)}function kt(it){var st=it.gutters.offsetWidth;it.sizer.style.marginLeft=st+"px"}function Ft(it,st){it.display.sizer.style.minHeight=st.docHeight+"px",it.display.heightForcer.style.top=st.docHeight+"px",it.display.gutters.style.height=st.docHeight+it.display.barHeight+fl(it)+"px"}function Wt(it){var st=it.display,ft=st.view;if(!(!st.alignWidgets&&(!st.gutters.firstChild||!it.options.fixedGutter))){for(var dt=md(st)-st.scroller.scrollLeft+it.doc.scrollLeft,gt=st.gutters.offsetWidth,Pt=dt+"px",Tt=0;Tt<ft.length;Tt++)if(!ft[Tt].hidden){it.options.fixedGutter&&(ft[Tt].gutter&&(ft[Tt].gutter.style.left=Pt),ft[Tt].gutterBackground&&(ft[Tt].gutterBackground.style.left=Pt));var Rt=ft[Tt].alignable;if(Rt)for(var Bt=0;Bt<Rt.length;Bt++)Rt[Bt].style.left=Pt}it.options.fixedGutter&&(st.gutters.style.left=dt+gt+"px")}}function Zt(it){if(!it.options.lineNumbers)return!1;var st=it.doc,ft=Ki(it.options,st.first+st.size-1),dt=it.display;if(ft.length!=dt.lineNumChars){var gt=dt.measure.appendChild(re("div",[re("div",ft)],"CodeMirror-linenumber CodeMirror-gutter-elt")),Pt=gt.firstChild.offsetWidth,Tt=gt.offsetWidth-Pt;return dt.lineGutter.style.width="",dt.lineNumInnerWidth=Math.max(Pt,dt.lineGutter.offsetWidth-Tt)+1,dt.lineNumWidth=dt.lineNumInnerWidth+Tt,dt.lineNumChars=dt.lineNumInnerWidth?ft.length:-1,dt.lineGutter.style.width=dt.lineNumWidth+"px",kt(it.display),!0}return!1}function pe(it,st){for(var ft=[],dt=!1,gt=0;gt<it.length;gt++){var Pt=it[gt],Tt=null;if(typeof Pt!="string"&&(Tt=Pt.style,Pt=Pt.className),Pt=="CodeMirror-linenumbers")if(st)dt=!0;else continue;ft.push({className:Pt,style:Tt})}return st&&!dt&&ft.push({className:"CodeMirror-linenumbers",style:null}),ft}function De(it){var st=it.gutters,ft=it.gutterSpecs;ie(st),it.lineGutter=null;for(var dt=0;dt<ft.length;++dt){var gt=ft[dt],Pt=gt.className,Tt=gt.style,Rt=st.appendChild(re("div",null,"CodeMirror-gutter "+Pt));Tt&&(Rt.style.cssText=Tt),Pt=="CodeMirror-linenumbers"&&(it.lineGutter=Rt,Rt.style.width=(it.lineNumWidth||1)+"px")}st.style.display=ft.length?"":"none",kt(it)}function je(it){De(it.display),ts(it),Wt(it)}function en(it,st,ft,dt){var gt=this;this.input=ft,gt.scrollbarFiller=re("div",null,"CodeMirror-scrollbar-filler"),gt.scrollbarFiller.setAttribute("cm-not-content","true"),gt.gutterFiller=re("div",null,"CodeMirror-gutter-filler"),gt.gutterFiller.setAttribute("cm-not-content","true"),gt.lineDiv=Ne("div",null,"CodeMirror-code"),gt.selectionDiv=re("div",null,null,"position: relative; z-index: 1"),gt.cursorDiv=re("div",null,"CodeMirror-cursors"),gt.measure=re("div",null,"CodeMirror-measure"),gt.lineMeasure=re("div",null,"CodeMirror-measure"),gt.lineSpace=Ne("div",[gt.measure,gt.lineMeasure,gt.selectionDiv,gt.cursorDiv,gt.lineDiv],null,"position: relative; outline: none");var Pt=Ne("div",[gt.lineSpace],"CodeMirror-lines");gt.mover=re("div",[Pt],null,"position: relative"),gt.sizer=re("div",[gt.mover],"CodeMirror-sizer"),gt.sizerWidth=null,gt.heightForcer=re("div",null,null,"position: absolute; height: "+pn+"px; width: 1px;"),gt.gutters=re("div",null,"CodeMirror-gutters"),gt.lineGutter=null,gt.scroller=re("div",[gt.sizer,gt.heightForcer,gt.gutters],"CodeMirror-scroll"),gt.scroller.setAttribute("tabIndex","-1"),gt.wrapper=re("div",[gt.scrollbarFiller,gt.gutterFiller,gt.scroller],"CodeMirror"),Se&&de<8&&(gt.gutters.style.zIndex=-1,gt.scroller.style.paddingRight=0),!$t&&!(It&&et)&&(gt.scroller.draggable=!0),it&&(it.appendChild?it.appendChild(gt.wrapper):it(gt.wrapper)),gt.viewFrom=gt.viewTo=st.first,gt.reportedViewFrom=gt.reportedViewTo=st.first,gt.view=[],gt.renderedView=null,gt.externalMeasured=null,gt.viewOffset=0,gt.lastWrapHeight=gt.lastWrapWidth=0,gt.updateLineNumbers=null,gt.nativeBarWidth=gt.barHeight=gt.barWidth=0,gt.scrollbarsClipped=!1,gt.lineNumWidth=gt.lineNumInnerWidth=gt.lineNumChars=null,gt.alignWidgets=!1,gt.cachedCharWidth=gt.cachedTextHeight=gt.cachedPaddingH=null,gt.maxLine=null,gt.maxLineLength=0,gt.maxLineChanged=!1,gt.wheelDX=gt.wheelDY=gt.wheelStartX=gt.wheelStartY=null,gt.shift=!1,gt.selForContextMenu=null,gt.activeTouch=null,gt.gutterSpecs=pe(dt.gutters,dt.lineNumbers),De(gt),ft.init(gt)}var rn=0,ln=null;Se?ln=-.53:It?ln=15:ve?ln=-.7:ze&&(ln=-1/3);function Cn(it){var st=it.wheelDeltaX,ft=it.wheelDeltaY;return st==null&&it.detail&&it.axis==it.HORIZONTAL_AXIS&&(st=it.detail),ft==null&&it.detail&&it.axis==it.VERTICAL_AXIS?ft=it.detail:ft==null&&(ft=it.wheelDelta),{x:st,y:ft}}function Tn(it){var st=Cn(it);return st.x*=ln,st.y*=ln,st}function _n(it,st){var ft=Cn(st),dt=ft.x,gt=ft.y,Pt=it.display,Tt=Pt.scroller,Rt=Tt.scrollWidth>Tt.clientWidth,Bt=Tt.scrollHeight>Tt.clientHeight;if(dt&&Rt||gt&&Bt){if(gt&&ht&&$t){t:for(var Xt=st.target,ge=Pt.view;Xt!=Tt;Xt=Xt.parentNode)for(var te=0;te<ge.length;te++)if(ge[te].node==Xt){it.display.currentWheelTarget=Xt;break t}}if(dt&&!It&&!Pe&&ln!=null){gt&&Bt&&Wh(it,Math.max(0,Tt.scrollTop+gt*ln)),qu(it,Math.max(0,Tt.scrollLeft+dt*ln)),(!gt||gt&&Bt)&&aa(st),Pt.wheelStartX=null;return}if(gt&&ln!=null){var Ae=gt*ln,Ee=it.doc.scrollTop,dn=Ee+Pt.wrapper.clientHeight;Ae<0?Ee=Math.max(0,Ee+Ae-50):dn=Math.min(it.doc.height,dn+Ae+50),Ph(it,{top:Ee,bottom:dn})}rn<20&&(Pt.wheelStartX==null?(Pt.wheelStartX=Tt.scrollLeft,Pt.wheelStartY=Tt.scrollTop,Pt.wheelDX=dt,Pt.wheelDY=gt,setTimeout(function(){if(Pt.wheelStartX!=null){var gn=Tt.scrollLeft-Pt.wheelStartX,Fn=Tt.scrollTop-Pt.wheelStartY,Xn=Fn&&Pt.wheelDY&&Fn/Pt.wheelDY||gn&&Pt.wheelDX&&gn/Pt.wheelDX;Pt.wheelStartX=Pt.wheelStartY=null,Xn&&(ln=(ln*rn+Xn)/(rn+1),++rn)}},200)):(Pt.wheelDX+=dt,Pt.wheelDY+=gt))}}var kn=function(it,st){this.ranges=it,this.primIndex=st};kn.prototype.primary=function(){return this.ranges[this.primIndex]},kn.prototype.equals=function(it){if(it==this)return!0;if(it.primIndex!=this.primIndex||it.ranges.length!=this.ranges.length)return!1;for(var st=0;st<this.ranges.length;st++){var ft=this.ranges[st],dt=it.ranges[st];if(!uo(ft.anchor,dt.anchor)||!uo(ft.head,dt.head))return!1}return!0},kn.prototype.deepCopy=function(){for(var it=[],st=0;st<this.ranges.length;st++)it[st]=new bn(zo(this.ranges[st].anchor),zo(this.ranges[st].head));return new kn(it,this.primIndex)},kn.prototype.somethingSelected=function(){for(var it=0;it<this.ranges.length;it++)if(!this.ranges[it].empty())return!0;return!1},kn.prototype.contains=function(it,st){st||(st=it);for(var ft=0;ft<this.ranges.length;ft++){var dt=this.ranges[ft];if(Gn(st,dt.from())>=0&&Gn(it,dt.to())<=0)return ft}return-1};var bn=function(it,st){this.anchor=it,this.head=st};bn.prototype.from=function(){return Kn(this.anchor,this.head)},bn.prototype.to=function(){return $r(this.anchor,this.head)},bn.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function Vn(it,st,ft){var dt=it&&it.options.selectionsMayTouch,gt=st[ft];st.sort(function(Ae,Ee){return Gn(Ae.from(),Ee.from())}),ft=Kt(st,gt);for(var Pt=1;Pt<st.length;Pt++){var Tt=st[Pt],Rt=st[Pt-1],Bt=Gn(Rt.to(),Tt.from());if(dt&&!Tt.empty()?Bt>0:Bt>=0){var Xt=Kn(Rt.from(),Tt.from()),ge=$r(Rt.to(),Tt.to()),te=Rt.empty()?Tt.from()==Tt.head:Rt.from()==Rt.head;Pt<=ft&&--ft,st.splice(--Pt,2,new bn(te?ge:Xt,te?Xt:ge))}}return new kn(st,ft)}function Hn(it,st){return new kn([new bn(it,st||it)],0)}function Fi(it){return it.text?Ue(it.from.line+it.text.length-1,Te(it.text).length+(it.text.length==1?it.from.ch:0)):it.to}function Zi(it,st){if(Gn(it,st.from)<0)return it;if(Gn(it,st.to)<=0)return Fi(st);var ft=it.line+st.text.length-(st.to.line-st.from.line)-1,dt=it.ch;return it.line==st.to.line&&(dt+=Fi(st).ch-st.to.ch),Ue(ft,dt)}function Si(it,st){for(var ft=[],dt=0;dt<it.sel.ranges.length;dt++){var gt=it.sel.ranges[dt];ft.push(new bn(Zi(gt.anchor,st),Zi(gt.head,st)))}return Vn(it.cm,ft,it.sel.primIndex)}function Ti(it,st,ft){return it.line==st.line?Ue(ft.line,it.ch-st.ch+ft.ch):Ue(ft.line+(it.line-st.line),it.ch)}function dr(it,st,ft){for(var dt=[],gt=Ue(it.first,0),Pt=gt,Tt=0;Tt<st.length;Tt++){var Rt=st[Tt],Bt=Ti(Rt.from,gt,Pt),Xt=Ti(Fi(Rt),gt,Pt);if(gt=Rt.to,Pt=Xt,ft=="around"){var ge=it.sel.ranges[Tt],te=Gn(ge.head,ge.anchor)<0;dt[Tt]=new bn(te?Xt:Bt,te?Bt:Xt)}else dt[Tt]=new bn(Bt,Bt)}return new kn(dt,it.sel.primIndex)}function Pn(it){it.doc.mode=Ie(it.options,it.doc.modeOption),Ai(it)}function Ai(it){it.doc.iter(function(st){st.stateAfter&&(st.stateAfter=null),st.styles&&(st.styles=null)}),it.doc.modeFrontier=it.doc.highlightFrontier=it.doc.first,Qd(it,100),it.state.modeGen++,it.curOp&&ts(it)}function Wi(it,st){return st.from.ch==0&&st.to.ch==0&&Te(st.text)==""&&(!it.cm||it.cm.options.wholeLineUpdateBefore)}function _i(it,st,ft,dt){function gt(Pi){return ft?ft[Pi]:null}function Pt(Pi,si,Di){Es(Pi,si,Di,dt),ni(Pi,"change",Pi,st)}function Tt(Pi,si){for(var Di=[],hr=Pi;hr<si;++hr)Di.push(new $o(Xt[hr],gt(hr),dt));return Di}var Rt=st.from,Bt=st.to,Xt=st.text,ge=Xe(it,Rt.line),te=Xe(it,Bt.line),Ae=Te(Xt),Ee=gt(Xt.length-1),dn=Bt.line-Rt.line;if(st.full)it.insert(0,Tt(0,Xt.length)),it.remove(Xt.length,it.size-Xt.length);else if(Wi(it,st)){var gn=Tt(0,Xt.length-1);Pt(te,te.text,Ee),dn&&it.remove(Rt.line,dn),gn.length&&it.insert(Rt.line,gn)}else if(ge==te)if(Xt.length==1)Pt(ge,ge.text.slice(0,Rt.ch)+Ae+ge.text.slice(Bt.ch),Ee);else{var Fn=Tt(1,Xt.length-1);Fn.push(new $o(Ae+ge.text.slice(Bt.ch),Ee,dt)),Pt(ge,ge.text.slice(0,Rt.ch)+Xt[0],gt(0)),it.insert(Rt.line+1,Fn)}else if(Xt.length==1)Pt(ge,ge.text.slice(0,Rt.ch)+Xt[0]+te.text.slice(Bt.ch),gt(0)),it.remove(Rt.line+1,dn);else{Pt(ge,ge.text.slice(0,Rt.ch)+Xt[0],gt(0)),Pt(te,Ae+te.text.slice(Bt.ch),Ee);var Xn=Tt(1,Xt.length-1);dn>1&&it.remove(Rt.line+1,dn-1),it.insert(Rt.line+1,Xn)}ni(it,"change",it,st)}function Ji(it,st,ft){function dt(gt,Pt,Tt){if(gt.linked)for(var Rt=0;Rt<gt.linked.length;++Rt){var Bt=gt.linked[Rt];if(Bt.doc!=Pt){var Xt=Tt&&Bt.sharedHist;ft&&!Xt||(st(Bt.doc,Xt),dt(Bt.doc,gt,Xt))}}}dt(it,null,!0)}function vi(it,st){if(st.cm)throw new Error("This document is already in use.");it.doc=st,st.cm=it,Ni(it),Pn(it),ar(it),it.options.lineWrapping||Mo(it),it.options.mode=st.modeOption,ts(it)}function ar(it){(it.doc.direction=="rtl"?Fe:Qt)(it.display.lineDiv,"CodeMirror-rtl")}function ir(it){so(it,function(){ar(it),ts(it)})}function Ar(it){this.done=[],this.undone=[],this.undoDepth=1/0,this.lastModTime=this.lastSelTime=0,this.lastOp=this.lastSelOp=null,this.lastOrigin=this.lastSelOrigin=null,this.generation=this.maxGeneration=it||1}function Pr(it,st){var ft={from:zo(st.from),to:Fi(st),text:Zn(it,st.from,st.to)};return Yr(it,ft,st.from.line,st.to.line+1),Ji(it,function(dt){return Yr(dt,ft,st.from.line,st.to.line+1)},!0),ft}function wr(it){for(;it.length;){var st=Te(it);if(st.ranges)it.pop();else break}}function Gr(it,st){if(st)return wr(it.done),Te(it.done);if(it.done.length&&!Te(it.done).ranges)return Te(it.done);if(it.done.length>1&&!it.done[it.done.length-2].ranges)return it.done.pop(),Te(it.done)}function Kr(it,st,ft,dt){var gt=it.history;gt.undone.length=0;var Pt=+new Date,Tt,Rt;if((gt.lastOp==dt||gt.lastOrigin==st.origin&&st.origin&&(st.origin.charAt(0)=="+"&>.lastModTime>Pt-(it.cm?it.cm.options.historyEventDelay:500)||st.origin.charAt(0)=="*"))&&(Tt=Gr(gt,gt.lastOp==dt)))Rt=Te(Tt.changes),Gn(st.from,st.to)==0&&Gn(st.from,Rt.to)==0?Rt.to=Fi(st):Tt.changes.push(Pr(it,st));else{var Bt=Te(gt.done);for((!Bt||!Bt.ranges)&&fr(it.sel,gt.done),Tt={changes:[Pr(it,st)],generation:gt.generation},gt.done.push(Tt);gt.done.length>gt.undoDepth;)gt.done.shift(),gt.done[0].ranges||gt.done.shift()}gt.done.push(ft),gt.generation=++gt.maxGeneration,gt.lastModTime=gt.lastSelTime=Pt,gt.lastOp=gt.lastSelOp=dt,gt.lastOrigin=gt.lastSelOrigin=st.origin,Rt||xo(it,"historyAdded")}function Er(it,st,ft,dt){var gt=st.charAt(0);return gt=="*"||gt=="+"&&ft.ranges.length==dt.ranges.length&&ft.somethingSelected()==dt.somethingSelected()&&new Date-it.history.lastSelTime<=(it.cm?it.cm.options.historyEventDelay:500)}function pi(it,st,ft,dt){var gt=it.history,Pt=dt&&dt.origin;ft==gt.lastSelOp||Pt&>.lastSelOrigin==Pt&&(gt.lastModTime==gt.lastSelTime&>.lastOrigin==Pt||Er(it,Pt,Te(gt.done),st))?gt.done[gt.done.length-1]=st:fr(st,gt.done),gt.lastSelTime=+new Date,gt.lastSelOrigin=Pt,gt.lastSelOp=ft,dt&&dt.clearRedo!==!1&&wr(gt.undone)}function fr(it,st){var ft=Te(st);ft&&ft.ranges&&ft.equals(it)||st.push(it)}function Yr(it,st,ft,dt){var gt=st["spans_"+it.id],Pt=0;it.iter(Math.max(it.first,ft),Math.min(it.first+it.size,dt),function(Tt){Tt.markedSpans&&((gt||(gt=st["spans_"+it.id]={}))[Pt]=Tt.markedSpans),++Pt})}function Fr(it){if(!it)return null;for(var st,ft=0;ft<it.length;++ft)it[ft].marker.explicitlyCleared?st||(st=it.slice(0,ft)):st&&st.push(it[ft]);return st?st.length?st:null:it}function io(it,st){var ft=st["spans_"+it.id];if(!ft)return null;for(var dt=[],gt=0;gt<st.text.length;++gt)dt.push(Fr(ft[gt]));return dt}function ao(it,st){var ft=io(it,st),dt=Ao(it,st);if(!ft)return dt;if(!dt)return ft;for(var gt=0;gt<ft.length;++gt){var Pt=ft[gt],Tt=dt[gt];if(Pt&&Tt)t:for(var Rt=0;Rt<Tt.length;++Rt){for(var Bt=Tt[Rt],Xt=0;Xt<Pt.length;++Xt)if(Pt[Xt].marker==Bt.marker)continue t;Pt.push(Bt)}else Tt&&(ft[gt]=Tt)}return ft}function po(it,st,ft){for(var dt=[],gt=0;gt<it.length;++gt){var Pt=it[gt];if(Pt.ranges){dt.push(ft?kn.prototype.deepCopy.call(Pt):Pt);continue}var Tt=Pt.changes,Rt=[];dt.push({changes:Rt});for(var Bt=0;Bt<Tt.length;++Bt){var Xt=Tt[Bt],ge=void 0;if(Rt.push({from:Xt.from,to:Xt.to,text:Xt.text}),st)for(var te in Xt)(ge=te.match(/^spans_(\d+)$/))&&Kt(st,Number(ge[1]))>-1&&(Te(Rt)[te]=Xt[te],delete Xt[te])}}return dt}function ro(it,st,ft,dt){if(dt){var gt=it.anchor;if(ft){var Pt=Gn(st,gt)<0;Pt!=Gn(ft,gt)<0?(gt=st,st=ft):Pt!=Gn(st,ft)<0&&(st=ft)}return new bn(gt,st)}else return new bn(ft||st,st)}function Oo(it,st,ft,dt,gt){gt==null&&(gt=it.cm&&(it.cm.display.shift||it.extend)),ui(it,new kn([ro(it.sel.primary(),st,ft,gt)],0),dt)}function Vs(it,st,ft){for(var dt=[],gt=it.cm&&(it.cm.display.shift||it.extend),Pt=0;Pt<it.sel.ranges.length;Pt++)dt[Pt]=ro(it.sel.ranges[Pt],st[Pt],null,gt);var Tt=Vn(it.cm,dt,it.sel.primIndex);ui(it,Tt,ft)}function _o(it,st,ft,dt){var gt=it.sel.ranges.slice(0);gt[st]=ft,ui(it,Vn(it.cm,gt,it.sel.primIndex),dt)}function Ui(it,st,ft,dt){ui(it,Hn(st,ft),dt)}function Hi(it,st,ft){var dt={ranges:st.ranges,update:function(gt){this.ranges=[];for(var Pt=0;Pt<gt.length;Pt++)this.ranges[Pt]=new bn(qn(it,gt[Pt].anchor),qn(it,gt[Pt].head))},origin:ft&&ft.origin};return xo(it,"beforeSelectionChange",it,dt),it.cm&&xo(it.cm,"beforeSelectionChange",it.cm,dt),dt.ranges!=st.ranges?Vn(it.cm,dt.ranges,dt.ranges.length-1):st}function Ri(it,st,ft){var dt=it.history.done,gt=Te(dt);gt&>.ranges?(dt[dt.length-1]=st,hi(it,st,ft)):ui(it,st,ft)}function ui(it,st,ft){hi(it,st,ft),pi(it,it.sel,it.cm?it.cm.curOp.id:NaN,ft)}function hi(it,st,ft){(Li(it,"beforeSelectionChange")||it.cm&&Li(it.cm,"beforeSelectionChange"))&&(st=Hi(it,st,ft));var dt=ft&&ft.bias||(Gn(st.primary().head,it.sel.primary().head)<0?-1:1);Vi(it,Xr(it,st,dt,!0)),!(ft&&ft.scroll===!1)&&it.cm&&$u(it.cm)}function Vi(it,st){st.equals(it.sel)||(it.sel=st,it.cm&&(it.cm.curOp.updateInput=1,it.cm.curOp.selectionChanged=!0,wl(it.cm)),ni(it,"cursorActivity",it))}function yr(it){Vi(it,Xr(it,it.sel,null,!1))}function Xr(it,st,ft,dt){for(var gt,Pt=0;Pt<st.ranges.length;Pt++){var Tt=st.ranges[Pt],Rt=st.ranges.length==it.sel.ranges.length&&it.sel.ranges[Pt],Bt=Ho(it,Tt.anchor,Rt&&Rt.anchor,ft,dt),Xt=Ho(it,Tt.head,Rt&&Rt.head,ft,dt);(gt||Bt!=Tt.anchor||Xt!=Tt.head)&&(gt||(gt=st.ranges.slice(0,Pt)),gt[Pt]=new bn(Bt,Xt))}return gt?Vn(it.cm,gt,st.primIndex):st}function Tr(it,st,ft,dt,gt){var Pt=Xe(it,st.line);if(Pt.markedSpans)for(var Tt=0;Tt<Pt.markedSpans.length;++Tt){var Rt=Pt.markedSpans[Tt],Bt=Rt.marker,Xt="selectLeft"in Bt?!Bt.selectLeft:Bt.inclusiveLeft,ge="selectRight"in Bt?!Bt.selectRight:Bt.inclusiveRight;if((Rt.from==null||(Xt?Rt.from<=st.ch:Rt.from<st.ch))&&(Rt.to==null||(ge?Rt.to>=st.ch:Rt.to>st.ch))){if(gt&&(xo(Bt,"beforeCursorEnter"),Bt.explicitlyCleared))if(Pt.markedSpans){--Tt;continue}else break;if(!Bt.atomic)continue;if(ft){var te=Bt.find(dt<0?1:-1),Ae=void 0;if((dt<0?ge:Xt)&&(te=Ts(it,te,-dt,te&&te.line==st.line?Pt:null)),te&&te.line==st.line&&(Ae=Gn(te,ft))&&(dt<0?Ae<0:Ae>0))return Tr(it,te,st,dt,gt)}var Ee=Bt.find(dt<0?-1:1);return(dt<0?Xt:ge)&&(Ee=Ts(it,Ee,dt,Ee.line==st.line?Pt:null)),Ee?Tr(it,Ee,st,dt,gt):null}}return st}function Ho(it,st,ft,dt,gt){var Pt=dt||1,Tt=Tr(it,st,ft,Pt,gt)||!gt&&Tr(it,st,ft,Pt,!0)||Tr(it,st,ft,-Pt,gt)||!gt&&Tr(it,st,ft,-Pt,!0);return Tt||(it.cantEdit=!0,Ue(it.first,0))}function Ts(it,st,ft,dt){return ft<0&&st.ch==0?st.line>it.first?qn(it,Ue(st.line-1)):null:ft>0&&st.ch==(dt||Xe(it,st.line)).text.length?st.line<it.first+it.size-1?Ue(st.line+1,0):null:new Ue(st.line,st.ch+ft)}function lo(it){it.setSelection(Ue(it.firstLine(),0),Ue(it.lastLine()),Ce)}function zs(it,st,ft){var dt={canceled:!1,from:st.from,to:st.to,text:st.text,origin:st.origin,cancel:function(){return dt.canceled=!0}};return ft&&(dt.update=function(gt,Pt,Tt,Rt){gt&&(dt.from=qn(it,gt)),Pt&&(dt.to=qn(it,Pt)),Tt&&(dt.text=Tt),Rt!==void 0&&(dt.origin=Rt)}),xo(it,"beforeChange",it,dt),it.cm&&xo(it.cm,"beforeChange",it.cm,dt),dt.canceled?(it.cm&&(it.cm.curOp.updateInput=2),null):{from:dt.from,to:dt.to,text:dt.text,origin:dt.origin}}function Io(it,st,ft){if(it.cm){if(!it.cm.curOp)return Xs(it.cm,Io)(it,st,ft);if(it.cm.state.suppressEdits)return}if(!((Li(it,"beforeChange")||it.cm&&Li(it.cm,"beforeChange"))&&(st=zs(it,st,!0),!st))){var dt=Wr&&!ft&&To(it,st.from,st.to);if(dt)for(var gt=dt.length-1;gt>=0;--gt)ha(it,{from:dt[gt].from,to:dt[gt].to,text:gt?[""]:st.text,origin:st.origin});else ha(it,st)}}function ha(it,st){if(!(st.text.length==1&&st.text[0]==""&&Gn(st.from,st.to)==0)){var ft=Si(it,st);Kr(it,st,ft,it.cm?it.cm.curOp.id:NaN),Ns(it,st,ft,Ao(it,st));var dt=[];Ji(it,function(gt,Pt){!Pt&&Kt(dt,gt.history)==-1&&(Ga(gt.history,st),dt.push(gt.history)),Ns(gt,st,null,Ao(gt,st))})}}function Cs(it,st,ft){var dt=it.cm&&it.cm.state.suppressEdits;if(!(dt&&!ft)){for(var gt=it.history,Pt,Tt=it.sel,Rt=st=="undo"?gt.done:gt.undone,Bt=st=="undo"?gt.undone:gt.done,Xt=0;Xt<Rt.length&&(Pt=Rt[Xt],!(ft?Pt.ranges&&!Pt.equals(it.sel):!Pt.ranges));Xt++);if(Xt!=Rt.length){for(gt.lastOrigin=gt.lastSelOrigin=null;;)if(Pt=Rt.pop(),Pt.ranges){if(fr(Pt,Bt),ft&&!Pt.equals(it.sel)){ui(it,Pt,{clearRedo:!1});return}Tt=Pt}else if(dt){Rt.push(Pt);return}else break;var ge=[];fr(Tt,Bt),Bt.push({changes:ge,generation:gt.generation}),gt.generation=Pt.generation||++gt.maxGeneration;for(var te=Li(it,"beforeChange")||it.cm&&Li(it.cm,"beforeChange"),Ae=function(gn){var Fn=Pt.changes[gn];if(Fn.origin=st,te&&!zs(it,Fn,!1))return Rt.length=0,{};ge.push(Pr(it,Fn));var Xn=gn?Si(it,Fn):Te(Rt);Ns(it,Fn,Xn,ao(it,Fn)),!gn&&it.cm&&it.cm.scrollIntoView({from:Fn.from,to:Fi(Fn)});var Pi=[];Ji(it,function(si,Di){!Di&&Kt(Pi,si.history)==-1&&(Ga(si.history,Fn),Pi.push(si.history)),Ns(si,Fn,null,ao(si,Fn))})},Ee=Pt.changes.length-1;Ee>=0;--Ee){var dn=Ae(Ee);if(dn)return dn.v}}}}function Pa(it,st){if(st!=0&&(it.first+=st,it.sel=new kn(Nn(it.sel.ranges,function(gt){return new bn(Ue(gt.anchor.line+st,gt.anchor.ch),Ue(gt.head.line+st,gt.head.ch))}),it.sel.primIndex),it.cm)){ts(it.cm,it.first,it.first-st,st);for(var ft=it.cm.display,dt=ft.viewFrom;dt<ft.viewTo;dt++)xr(it.cm,dt,"gutter")}}function Ns(it,st,ft,dt){if(it.cm&&!it.cm.curOp)return Xs(it.cm,Ns)(it,st,ft,dt);if(st.to.line<it.first){Pa(it,st.text.length-1-(st.to.line-st.from.line));return}if(!(st.from.line>it.lastLine())){if(st.from.line<it.first){var gt=st.text.length-1-(it.first-st.from.line);Pa(it,gt),st={from:Ue(it.first,0),to:Ue(st.to.line+gt,st.to.ch),text:[Te(st.text)],origin:st.origin}}var Pt=it.lastLine();st.to.line>Pt&&(st={from:st.from,to:Ue(Pt,Xe(it,Pt).text.length),text:[st.text[0]],origin:st.origin}),st.removed=Zn(it,st.from,st.to),ft||(ft=Si(it,st)),it.cm?ys(it.cm,st,dt):_i(it,st,dt),hi(it,ft,Ce),it.cantEdit&&Ho(it,Ue(it.firstLine(),0))&&(it.cantEdit=!1)}}function ys(it,st,ft){var dt=it.doc,gt=it.display,Pt=st.from,Tt=st.to,Rt=!1,Bt=Pt.line;it.options.lineWrapping||(Bt=fe(Lo(Xe(dt,Pt.line))),dt.iter(Bt,Tt.line+1,function(Ee){if(Ee==gt.maxLine)return Rt=!0,!0})),dt.sel.contains(st.from,st.to)>-1&&wl(it),_i(dt,st,ft,qo(it)),it.options.lineWrapping||(dt.iter(Bt,Pt.line+st.text.length,function(Ee){var dn=ls(Ee);dn>gt.maxLineLength&&(gt.maxLine=Ee,gt.maxLineLength=dn,gt.maxLineChanged=!0,Rt=!1)}),Rt&&(it.curOp.updateMaxLine=!0)),ur(dt,Pt.line),Qd(it,400);var Xt=st.text.length-(Tt.line-Pt.line)-1;st.full?ts(it):Pt.line==Tt.line&&st.text.length==1&&!Wi(it.doc,st)?xr(it,Pt.line,"text"):ts(it,Pt.line,Tt.line+1,Xt);var ge=Li(it,"changes"),te=Li(it,"change");if(te||ge){var Ae={from:Pt,to:Tt,text:st.text,removed:st.removed,origin:st.origin};te&&ni(it,"change",it,Ae),ge&&(it.curOp.changeObjs||(it.curOp.changeObjs=[])).push(Ae)}it.display.selForContextMenu=null}function Do(it,st,ft,dt,gt){var Pt;dt||(dt=ft),Gn(dt,ft)<0&&(Pt=[dt,ft],ft=Pt[0],dt=Pt[1]),typeof st=="string"&&(st=it.splitLines(st)),Io(it,{from:ft,to:dt,text:st,origin:gt})}function Yo(it,st,ft,dt){ft<it.line?it.line+=dt:st<it.line&&(it.line=st,it.ch=0)}function Ml(it,st,ft,dt){for(var gt=0;gt<it.length;++gt){var Pt=it[gt],Tt=!0;if(Pt.ranges){Pt.copied||(Pt=it[gt]=Pt.deepCopy(),Pt.copied=!0);for(var Rt=0;Rt<Pt.ranges.length;Rt++)Yo(Pt.ranges[Rt].anchor,st,ft,dt),Yo(Pt.ranges[Rt].head,st,ft,dt);continue}for(var Bt=0;Bt<Pt.changes.length;++Bt){var Xt=Pt.changes[Bt];if(ft<Xt.from.line)Xt.from=Ue(Xt.from.line+dt,Xt.from.ch),Xt.to=Ue(Xt.to.line+dt,Xt.to.ch);else if(st<=Xt.to.line){Tt=!1;break}}Tt||(it.splice(0,gt+1),gt=0)}}function Ga(it,st){var ft=st.from.line,dt=st.to.line,gt=st.text.length-(dt-ft)-1;Ml(it.done,ft,dt,gt),Ml(it.undone,ft,dt,gt)}function Js(it,st,ft,dt){var gt=st,Pt=st;return typeof st=="number"?Pt=Xe(it,zn(it,st)):gt=fe(st),gt==null?null:(dt(Pt,gt)&&it.cm&&xr(it.cm,gt,ft),Pt)}function Gs(it){this.lines=it,this.parent=null;for(var st=0,ft=0;ft<it.length;++ft)it[ft].parent=this,st+=it[ft].height;this.height=st}Gs.prototype={chunkSize:function(){return this.lines.length},removeInner:function(it,st){for(var ft=it,dt=it+st;ft<dt;++ft){var gt=this.lines[ft];this.height-=gt.height,va(gt),ni(gt,"delete")}this.lines.splice(it,st)},collapse:function(it){it.push.apply(it,this.lines)},insertInner:function(it,st,ft){this.height+=ft,this.lines=this.lines.slice(0,it).concat(st).concat(this.lines.slice(it));for(var dt=0;dt<st.length;++dt)st[dt].parent=this},iterN:function(it,st,ft){for(var dt=it+st;it<dt;++it)if(ft(this.lines[it]))return!0}};function bo(it){this.children=it;for(var st=0,ft=0,dt=0;dt<it.length;++dt){var gt=it[dt];st+=gt.chunkSize(),ft+=gt.height,gt.parent=this}this.size=st,this.height=ft,this.parent=null}bo.prototype={chunkSize:function(){return this.size},removeInner:function(it,st){this.size-=st;for(var ft=0;ft<this.children.length;++ft){var dt=this.children[ft],gt=dt.chunkSize();if(it<gt){var Pt=Math.min(st,gt-it),Tt=dt.height;if(dt.removeInner(it,Pt),this.height-=Tt-dt.height,gt==Pt&&(this.children.splice(ft--,1),dt.parent=null),(st-=Pt)==0)break;it=0}else it-=gt}if(this.size-st<25&&(this.children.length>1||!(this.children[0]instanceof Gs))){var Rt=[];this.collapse(Rt),this.children=[new Gs(Rt)],this.children[0].parent=this}},collapse:function(it){for(var st=0;st<this.children.length;++st)this.children[st].collapse(it)},insertInner:function(it,st,ft){this.size+=st.length,this.height+=ft;for(var dt=0;dt<this.children.length;++dt){var gt=this.children[dt],Pt=gt.chunkSize();if(it<=Pt){if(gt.insertInner(it,st,ft),gt.lines&>.lines.length>50){for(var Tt=gt.lines.length%25+25,Rt=Tt;Rt<gt.lines.length;){var Bt=new Gs(gt.lines.slice(Rt,Rt+=25));gt.height-=Bt.height,this.children.splice(++dt,0,Bt),Bt.parent=this}gt.lines=gt.lines.slice(0,Tt),this.maybeSpill()}break}it-=Pt}},maybeSpill:function(){if(!(this.children.length<=10)){var it=this;do{var st=it.children.splice(it.children.length-5,5),ft=new bo(st);if(it.parent){it.size-=ft.size,it.height-=ft.height;var gt=Kt(it.parent.children,it);it.parent.children.splice(gt+1,0,ft)}else{var dt=new bo(it.children);dt.parent=it,it.children=[dt,ft],it=dt}ft.parent=it.parent}while(it.children.length>10);it.parent.maybeSpill()}},iterN:function(it,st,ft){for(var dt=0;dt<this.children.length;++dt){var gt=this.children[dt],Pt=gt.chunkSize();if(it<Pt){var Tt=Math.min(st,Pt-it);if(gt.iterN(it,Tt,ft))return!0;if((st-=Tt)==0)break;it=0}else it-=Pt}}};var Ls=function(it,st,ft){if(ft)for(var dt in ft)ft.hasOwnProperty(dt)&&(this[dt]=ft[dt]);this.doc=it,this.node=st};Ls.prototype.clear=function(){var it=this.doc.cm,st=this.line.widgets,ft=this.line,dt=fe(ft);if(!(dt==null||!st)){for(var gt=0;gt<st.length;++gt)st[gt]==this&&st.splice(gt--,1);st.length||(ft.widgets=null);var Pt=Du(this);an(ft,Math.max(0,ft.height-Pt)),it&&(so(it,function(){cu(it,ft,-Pt),xr(it,dt,"widget")}),ni(it,"lineWidgetCleared",it,this,dt))}},Ls.prototype.changed=function(){var it=this,st=this.height,ft=this.doc.cm,dt=this.line;this.height=null;var gt=Du(this)-st;gt&&(Ze(this.doc,dt)||an(dt,dt.height+gt),ft&&so(ft,function(){ft.curOp.forceUpdate=!0,cu(ft,dt,gt),ni(ft,"lineWidgetChanged",ft,it,fe(dt))}))},qi(Ls);function cu(it,st,ft){fo(st)<(it.curOp&&it.curOp.scrollTop||it.doc.scrollTop)&&Of(it,ft)}function Qs(it,st,ft,dt){var gt=new Ls(it,ft,dt),Pt=it.cm;return Pt&>.noHScroll&&(Pt.display.alignWidgets=!0),Js(it,st,"widget",function(Tt){var Rt=Tt.widgets||(Tt.widgets=[]);if(gt.insertAt==null?Rt.push(gt):Rt.splice(Math.min(Rt.length-1,Math.max(0,gt.insertAt)),0,gt),gt.line=Tt,Pt&&!Ze(it,Tt)){var Bt=fo(Tt)<it.scrollTop;an(Tt,Tt.height+Du(gt)),Bt&&Of(Pt,gt.height),Pt.curOp.forceUpdate=!0}return!0}),Pt&&ni(Pt,"lineWidgetAdded",Pt,gt,typeof st=="number"?st:fe(st)),gt}var eh=0,se=function(it,st){this.lines=[],this.type=st,this.doc=it,this.id=++eh};se.prototype.clear=function(){if(!this.explicitlyCleared){var it=this.doc.cm,st=it&&!it.curOp;if(st&&yh(it),Li(this,"clear")){var ft=this.find();ft&&ni(this,"clear",ft.from,ft.to)}for(var dt=null,gt=null,Pt=0;Pt<this.lines.length;++Pt){var Tt=this.lines[Pt],Rt=ma(Tt.markedSpans,this);it&&!this.collapsed?xr(it,fe(Tt),"text"):it&&(Rt.to!=null&&(gt=fe(Tt)),Rt.from!=null&&(dt=fe(Tt))),Tt.markedSpans=Co(Tt.markedSpans,Rt),Rt.from==null&&this.collapsed&&!Ze(this.doc,Tt)&&it&&an(Tt,Ou(it.display))}if(it&&this.collapsed&&!it.options.lineWrapping)for(var Bt=0;Bt<this.lines.length;++Bt){var Xt=Lo(this.lines[Bt]),ge=ls(Xt);ge>it.display.maxLineLength&&(it.display.maxLine=Xt,it.display.maxLineLength=ge,it.display.maxLineChanged=!0)}dt!=null&&it&&this.collapsed&&ts(it,dt,gt+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,it&&yr(it.doc)),it&&ni(it,"markerCleared",it,this,dt,gt),st&&Sh(it),this.parent&&this.parent.clear()}},se.prototype.find=function(it,st){it==null&&this.type=="bookmark"&&(it=1);for(var ft,dt,gt=0;gt<this.lines.length;++gt){var Pt=this.lines[gt],Tt=ma(Pt.markedSpans,this);if(Tt.from!=null&&(ft=Ue(st?Pt:fe(Pt),Tt.from),it==-1))return ft;if(Tt.to!=null&&(dt=Ue(st?Pt:fe(Pt),Tt.to),it==1))return dt}return ft&&{from:ft,to:dt}},se.prototype.changed=function(){var it=this,st=this.find(-1,!0),ft=this,dt=this.doc.cm;!st||!dt||so(dt,function(){var gt=st.line,Pt=fe(st.line),Tt=Au(dt,Pt);if(Tt&&(Ef(Tt),dt.curOp.selectionChanged=dt.curOp.forceUpdate=!0),dt.curOp.updateMaxLine=!0,!Ze(ft.doc,gt)&&ft.height!=null){var Rt=ft.height;ft.height=null;var Bt=Du(ft)-Rt;Bt&&an(gt,gt.height+Bt)}ni(dt,"markerChanged",dt,it)})},se.prototype.attachLine=function(it){if(!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(!st.maybeHiddenMarkers||Kt(st.maybeHiddenMarkers,this)==-1)&&(st.maybeUnhiddenMarkers||(st.maybeUnhiddenMarkers=[])).push(this)}this.lines.push(it)},se.prototype.detachLine=function(it){if(this.lines.splice(Kt(this.lines,it),1),!this.lines.length&&this.doc.cm){var st=this.doc.cm.curOp;(st.maybeHiddenMarkers||(st.maybeHiddenMarkers=[])).push(this)}},qi(se);function kl(it,st,ft,dt,gt){if(dt&&dt.shared)return gu(it,st,ft,dt,gt);if(it.cm&&!it.cm.curOp)return Xs(it.cm,kl)(it,st,ft,dt,gt);var Pt=new se(it,gt),Tt=Gn(st,ft);if(dt&&di(dt,Pt,!1),Tt>0||Tt==0&&Pt.clearWhenEmpty!==!1)return Pt;if(Pt.replacedWith&&(Pt.collapsed=!0,Pt.widgetNode=Ne("span",[Pt.replacedWith],"CodeMirror-widget"),dt.handleMouseEvents||Pt.widgetNode.setAttribute("cm-ignore-events","true"),dt.insertLeft&&(Pt.widgetNode.insertLeft=!0)),Pt.collapsed){if(jh(it,st.line,st,ft,Pt)||st.line!=ft.line&&jh(it,ft.line,st,ft,Pt))throw new Error("Inserting collapsed marker partially overlapping an existing one");Ye()}Pt.addToHistory&&Kr(it,{from:st,to:ft,origin:"markText"},it.sel,NaN);var Rt=st.line,Bt=it.cm,Xt;if(it.iter(Rt,ft.line+1,function(te){Bt&&Pt.collapsed&&!Bt.options.lineWrapping&&Lo(te)==Bt.display.maxLine&&(Xt=!0),Pt.collapsed&&Rt!=st.line&&an(te,0),hl(te,new qr(Pt,Rt==st.line?st.ch:null,Rt==ft.line?ft.ch:null)),++Rt}),Pt.collapsed&&it.iter(st.line,ft.line+1,function(te){Ze(it,te)&&an(te,0)}),Pt.clearOnEnter&&Ci(Pt,"beforeCursorEnter",function(){return Pt.clear()}),Pt.readOnly&&(Ko(),(it.history.done.length||it.history.undone.length)&&it.clearHistory()),Pt.collapsed&&(Pt.id=++eh,Pt.atomic=!0),Bt){if(Xt&&(Bt.curOp.updateMaxLine=!0),Pt.collapsed)ts(Bt,st.line,ft.line+1);else if(Pt.className||Pt.startStyle||Pt.endStyle||Pt.css||Pt.attributes||Pt.title)for(var ge=st.line;ge<=ft.line;ge++)xr(Bt,ge,"text");Pt.atomic&&yr(Bt.doc),ni(Bt,"markerAdded",Bt,Pt)}return Pt}var wa=function(it,st){this.markers=it,this.primary=st;for(var ft=0;ft<it.length;++ft)it[ft].parent=this};wa.prototype.clear=function(){if(!this.explicitlyCleared){this.explicitlyCleared=!0;for(var it=0;it<this.markers.length;++it)this.markers[it].clear();ni(this,"clear")}},wa.prototype.find=function(it,st){return this.primary.find(it,st)},qi(wa);function gu(it,st,ft,dt,gt){dt=di(dt),dt.shared=!1;var Pt=[kl(it,st,ft,dt,gt)],Tt=Pt[0],Rt=dt.widgetNode;return Ji(it,function(Bt){Rt&&(dt.widgetNode=Rt.cloneNode(!0)),Pt.push(kl(Bt,qn(Bt,st),qn(Bt,ft),dt,gt));for(var Xt=0;Xt<Bt.linked.length;++Xt)if(Bt.linked[Xt].isParent)return;Tt=Te(Pt)}),new wa(Pt,Tt)}function ql(it){return it.findMarks(Ue(it.first,0),it.clipPos(Ue(it.lastLine())),function(st){return st.parent})}function Ds(it,st){for(var ft=0;ft<st.length;ft++){var dt=st[ft],gt=dt.find(),Pt=it.clipPos(gt.from),Tt=it.clipPos(gt.to);if(Gn(Pt,Tt)){var Rt=kl(it,Pt,Tt,dt.primary,dt.primary.type);dt.markers.push(Rt),Rt.parent=dt}}}function $i(it){for(var st=function(dt){var gt=it[dt],Pt=[gt.primary.doc];Ji(gt.primary.doc,function(Bt){return Pt.push(Bt)});for(var Tt=0;Tt<gt.markers.length;Tt++){var Rt=gt.markers[Tt];Kt(Pt,Rt.doc)==-1&&(Rt.parent=null,gt.markers.splice(Tt--,1))}},ft=0;ft<it.length;ft++)st(ft)}var to=0,tr=function(it,st,ft,dt,gt){if(!(this instanceof tr))return new tr(it,st,ft,dt,gt);ft==null&&(ft=0),bo.call(this,[new Gs([new $o("",null)])]),this.first=ft,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.modeFrontier=this.highlightFrontier=ft;var Pt=Ue(ft,0);this.sel=Hn(Pt),this.history=new Ar(null),this.id=++to,this.modeOption=st,this.lineSep=dt,this.direction=gt=="rtl"?"rtl":"ltr",this.extend=!1,typeof it=="string"&&(it=this.splitLines(it)),_i(this,{from:Pt,to:Pt,text:it}),ui(this,Hn(Pt),Ce)};tr.prototype=Mt(bo.prototype,{constructor:tr,iter:function(it,st,ft){ft?this.iterN(it-this.first,st-it,ft):this.iterN(this.first,this.first+this.size,it)},insert:function(it,st){for(var ft=0,dt=0;dt<st.length;++dt)ft+=st[dt].height;this.insertInner(it-this.first,st,ft)},remove:function(it,st){this.removeInner(it-this.first,st)},getValue:function(it){var st=Oi(this,this.first,this.first+this.size);return it===!1?st:st.join(it||this.lineSeparator())},setValue:ta(function(it){var st=Ue(this.first,0),ft=this.first+this.size-1;Io(this,{from:st,to:Ue(ft,Xe(this,ft).text.length),text:this.splitLines(it),origin:"setValue",full:!0},!0),this.cm&&Vh(this.cm,0,0),ui(this,Hn(st),Ce)}),replaceRange:function(it,st,ft,dt){st=qn(this,st),ft=ft?qn(this,ft):st,Do(this,it,st,ft,dt)},getRange:function(it,st,ft){var dt=Zn(this,qn(this,it),qn(this,st));return ft===!1?dt:dt.join(ft||this.lineSeparator())},getLine:function(it){var st=this.getLineHandle(it);return st&&st.text},getLineHandle:function(it){if(ri(this,it))return Xe(this,it)},getLineNumber:function(it){return fe(it)},getLineHandleVisualStart:function(it){return typeof it=="number"&&(it=Xe(this,it)),Lo(it)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(it){return qn(this,it)},getCursor:function(it){var st=this.sel.primary(),ft;return it==null||it=="head"?ft=st.head:it=="anchor"?ft=st.anchor:it=="end"||it=="to"||it===!1?ft=st.to():ft=st.from(),ft},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:ta(function(it,st,ft){Ui(this,qn(this,typeof it=="number"?Ue(it,st||0):it),null,ft)}),setSelection:ta(function(it,st,ft){Ui(this,qn(this,it),qn(this,st||it),ft)}),extendSelection:ta(function(it,st,ft){Oo(this,qn(this,it),st&&qn(this,st),ft)}),extendSelections:ta(function(it,st){Vs(this,no(this,it),st)}),extendSelectionsBy:ta(function(it,st){var ft=Nn(this.sel.ranges,it);Vs(this,no(this,ft),st)}),setSelections:ta(function(it,st,ft){if(it.length){for(var dt=[],gt=0;gt<it.length;gt++)dt[gt]=new bn(qn(this,it[gt].anchor),qn(this,it[gt].head));st==null&&(st=Math.min(it.length-1,this.sel.primIndex)),ui(this,Vn(this.cm,dt,st),ft)}}),addSelection:ta(function(it,st,ft){var dt=this.sel.ranges.slice(0);dt.push(new bn(qn(this,it),qn(this,st||it))),ui(this,Vn(this.cm,dt,dt.length-1),ft)}),getSelection:function(it){for(var st=this.sel.ranges,ft,dt=0;dt<st.length;dt++){var gt=Zn(this,st[dt].from(),st[dt].to());ft=ft?ft.concat(gt):gt}return it===!1?ft:ft.join(it||this.lineSeparator())},getSelections:function(it){for(var st=[],ft=this.sel.ranges,dt=0;dt<ft.length;dt++){var gt=Zn(this,ft[dt].from(),ft[dt].to());it!==!1&&(gt=gt.join(it||this.lineSeparator())),st[dt]=gt}return st},replaceSelection:function(it,st,ft){for(var dt=[],gt=0;gt<this.sel.ranges.length;gt++)dt[gt]=it;this.replaceSelections(dt,st,ft||"+input")},replaceSelections:ta(function(it,st,ft){for(var dt=[],gt=this.sel,Pt=0;Pt<gt.ranges.length;Pt++){var Tt=gt.ranges[Pt];dt[Pt]={from:Tt.from(),to:Tt.to(),text:this.splitLines(it[Pt]),origin:ft}}for(var Rt=st&&st!="end"&&dr(this,dt,st),Bt=dt.length-1;Bt>=0;Bt--)Io(this,dt[Bt]);Rt?Ri(this,Rt):this.cm&&$u(this.cm)}),undo:ta(function(){Cs(this,"undo")}),redo:ta(function(){Cs(this,"redo")}),undoSelection:ta(function(){Cs(this,"undo",!0)}),redoSelection:ta(function(){Cs(this,"redo",!0)}),setExtending:function(it){this.extend=it},getExtending:function(){return this.extend},historySize:function(){for(var it=this.history,st=0,ft=0,dt=0;dt<it.done.length;dt++)it.done[dt].ranges||++st;for(var gt=0;gt<it.undone.length;gt++)it.undone[gt].ranges||++ft;return{undo:st,redo:ft}},clearHistory:function(){var it=this;this.history=new Ar(this.history.maxGeneration),Ji(this,function(st){return st.history=it.history},!0)},markClean:function(){this.cleanGeneration=this.changeGeneration(!0)},changeGeneration:function(it){return it&&(this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null),this.history.generation},isClean:function(it){return this.history.generation==(it||this.cleanGeneration)},getHistory:function(){return{done:po(this.history.done),undone:po(this.history.undone)}},setHistory:function(it){var st=this.history=new Ar(this.history.maxGeneration);st.done=po(it.done.slice(0),null,!0),st.undone=po(it.undone.slice(0),null,!0)},setGutterMarker:ta(function(it,st,ft){return Js(this,it,"gutter",function(dt){var gt=dt.gutterMarkers||(dt.gutterMarkers={});return gt[st]=ft,!ft&&Et(gt)&&(dt.gutterMarkers=null),!0})}),clearGutter:ta(function(it){var st=this;this.iter(function(ft){ft.gutterMarkers&&ft.gutterMarkers[it]&&Js(st,ft,"gutter",function(){return ft.gutterMarkers[it]=null,Et(ft.gutterMarkers)&&(ft.gutterMarkers=null),!0})})}),lineInfo:function(it){var st;if(typeof it=="number"){if(!ri(this,it)||(st=it,it=Xe(this,it),!it))return null}else if(st=fe(it),st==null)return null;return{line:st,handle:it,text:it.text,gutterMarkers:it.gutterMarkers,textClass:it.textClass,bgClass:it.bgClass,wrapClass:it.wrapClass,widgets:it.widgets}},addLineClass:ta(function(it,st,ft){return Js(this,it,st=="gutter"?"gutter":"class",function(dt){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass";if(!dt[gt])dt[gt]=ft;else{if(zt(ft).test(dt[gt]))return!1;dt[gt]+=" "+ft}return!0})}),removeLineClass:ta(function(it,st,ft){return Js(this,it,st=="gutter"?"gutter":"class",function(dt){var gt=st=="text"?"textClass":st=="background"?"bgClass":st=="gutter"?"gutterClass":"wrapClass",Pt=dt[gt];if(Pt)if(ft==null)dt[gt]=null;else{var Tt=Pt.match(zt(ft));if(!Tt)return!1;var Rt=Tt.index+Tt[0].length;dt[gt]=Pt.slice(0,Tt.index)+(!Tt.index||Rt==Pt.length?"":" ")+Pt.slice(Rt)||null}else return!1;return!0})}),addLineWidget:ta(function(it,st,ft){return Qs(this,it,st,ft)}),removeLineWidget:function(it){it.clear()},markText:function(it,st,ft){return kl(this,qn(this,it),qn(this,st),ft,ft&&ft.type||"range")},setBookmark:function(it,st){var ft={replacedWith:st&&(st.nodeType==null?st.widget:st),insertLeft:st&&st.insertLeft,clearWhenEmpty:!1,shared:st&&st.shared,handleMouseEvents:st&&st.handleMouseEvents};return it=qn(this,it),kl(this,it,it,ft,"bookmark")},findMarksAt:function(it){it=qn(this,it);var st=[],ft=Xe(this,it.line).markedSpans;if(ft)for(var dt=0;dt<ft.length;++dt){var gt=ft[dt];(gt.from==null||gt.from<=it.ch)&&(gt.to==null||gt.to>=it.ch)&&st.push(gt.marker.parent||gt.marker)}return st},findMarks:function(it,st,ft){it=qn(this,it),st=qn(this,st);var dt=[],gt=it.line;return this.iter(it.line,st.line+1,function(Pt){var Tt=Pt.markedSpans;if(Tt)for(var Rt=0;Rt<Tt.length;Rt++){var Bt=Tt[Rt];!(Bt.to!=null&>==it.line&&it.ch>=Bt.to||Bt.from==null&>!=it.line||Bt.from!=null&>==st.line&&Bt.from>=st.ch)&&(!ft||ft(Bt.marker))&&dt.push(Bt.marker.parent||Bt.marker)}++gt}),dt},getAllMarks:function(){var it=[];return this.iter(function(st){var ft=st.markedSpans;if(ft)for(var dt=0;dt<ft.length;++dt)ft[dt].from!=null&&it.push(ft[dt].marker)}),it},posFromIndex:function(it){var st,ft=this.first,dt=this.lineSeparator().length;return this.iter(function(gt){var Pt=gt.text.length+dt;if(Pt>it)return st=it,!0;it-=Pt,++ft}),qn(this,Ue(ft,st))},indexFromPos:function(it){it=qn(this,it);var st=it.ch;if(it.line<this.first||it.ch<0)return 0;var ft=this.lineSeparator().length;return this.iter(this.first,it.line,function(dt){st+=dt.text.length+ft}),st},copy:function(it){var st=new tr(Oi(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);return st.scrollTop=this.scrollTop,st.scrollLeft=this.scrollLeft,st.sel=this.sel,st.extend=!1,it&&(st.history.undoDepth=this.history.undoDepth,st.setHistory(this.getHistory())),st},linkedDoc:function(it){it||(it={});var st=this.first,ft=this.first+this.size;it.from!=null&&it.from>st&&(st=it.from),it.to!=null&&it.to<ft&&(ft=it.to);var dt=new tr(Oi(this,st,ft),it.mode||this.modeOption,st,this.lineSep,this.direction);return it.sharedHist&&(dt.history=this.history),(this.linked||(this.linked=[])).push({doc:dt,sharedHist:it.sharedHist}),dt.linked=[{doc:this,isParent:!0,sharedHist:it.sharedHist}],Ds(dt,ql(this)),dt},unlinkDoc:function(it){if(it instanceof So&&(it=it.doc),this.linked)for(var st=0;st<this.linked.length;++st){var ft=this.linked[st];if(ft.doc==it){this.linked.splice(st,1),it.unlinkDoc(this),$i(ql(this));break}}if(it.history==this.history){var dt=[it.id];Ji(it,function(gt){return dt.push(gt.id)},!0),it.history=new Ar(null),it.history.done=po(this.history.done,dt),it.history.undone=po(this.history.undone,dt)}},iterLinkedDocs:function(it){Ji(this,it)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(it){return this.lineSep?it.split(this.lineSep):Qe(it)},lineSeparator:function(){return this.lineSep||`
|
|
`},setDirection:ta(function(it){it!="rtl"&&(it="ltr"),it!=this.direction&&(this.direction=it,this.iter(function(st){return st.order=null}),this.cm&&ir(this.cm))})}),tr.prototype.eachLine=tr.prototype.iter;var _s=0;function tl(it){var st=this;if(Cr(st),!(zr(st,it)||Qa(st.display,it))){aa(it),Se&&(_s=+new Date);var ft=Sa(st,it,!0),dt=it.dataTransfer.files;if(!(!ft||st.isReadOnly()))if(dt&&dt.length&&window.FileReader&&window.File)for(var gt=dt.length,Pt=Array(gt),Tt=0,Rt=function(){++Tt==gt&&Xs(st,function(){ft=qn(st.doc,ft);var Ee={from:ft,to:ft,text:st.doc.splitLines(Pt.filter(function(dn){return dn!=null}).join(st.doc.lineSeparator())),origin:"paste"};Io(st.doc,Ee),Ri(st.doc,Hn(qn(st.doc,ft),qn(st.doc,Fi(Ee))))})()},Bt=function(Ee,dn){if(st.options.allowDropFileTypes&&Kt(st.options.allowDropFileTypes,Ee.type)==-1){Rt();return}var gn=new FileReader;gn.onerror=function(){return Rt()},gn.onload=function(){var Fn=gn.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(Fn)){Rt();return}Pt[dn]=Fn,Rt()},gn.readAsText(Ee)},Xt=0;Xt<dt.length;Xt++)Bt(dt[Xt],Xt);else{if(st.state.draggingText&&st.doc.sel.contains(ft)>-1){st.state.draggingText(it),setTimeout(function(){return st.display.input.focus()},20);return}try{var ge=it.dataTransfer.getData("Text");if(ge){var te;if(st.state.draggingText&&!st.state.draggingText.copy&&(te=st.listSelections()),hi(st.doc,Hn(ft,ft)),te)for(var Ae=0;Ae<te.length;++Ae)Do(st.doc,"",te[Ae].anchor,te[Ae].head,"drag");st.replaceSelection(ge,"around","paste"),st.display.input.focus()}}catch(Ee){}}}}function cr(it,st){if(Se&&(!it.state.draggingText||+new Date-_s<100)){Il(st);return}if(!(zr(it,st)||Qa(it.display,st))&&(st.dataTransfer.setData("Text",it.getSelection()),st.dataTransfer.effectAllowed="copyMove",st.dataTransfer.setDragImage&&!ze)){var ft=re("img",null,null,"position: fixed; left: 0; top: 0;");ft.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==",Pe&&(ft.width=ft.height=1,it.display.wrapper.appendChild(ft),ft._top=ft.offsetTop),st.dataTransfer.setDragImage(ft,0,0),Pe&&ft.parentNode.removeChild(ft)}}function _r(it,st){var ft=Sa(it,st);if(ft){var dt=document.createDocumentFragment();Jr(it,ft,dt),it.display.dragCursor||(it.display.dragCursor=re("div",null,"CodeMirror-cursors CodeMirror-dragcursors"),it.display.lineSpace.insertBefore(it.display.dragCursor,it.display.cursorDiv)),oe(it.display.dragCursor,dt)}}function Cr(it){it.display.dragCursor&&(it.display.lineSpace.removeChild(it.display.dragCursor),it.display.dragCursor=null)}function Nr(it){if(document.getElementsByClassName){for(var st=document.getElementsByClassName("CodeMirror"),ft=[],dt=0;dt<st.length;dt++){var gt=st[dt].CodeMirror;gt&&ft.push(gt)}ft.length&&ft[0].operation(function(){for(var Pt=0;Pt<ft.length;Pt++)it(ft[Pt])})}}var Ro=!1;function mo(){Ro||(bl(),Ro=!0)}function bl(){var it;Ci(window,"resize",function(){it==null&&(it=setTimeout(function(){it=null,Nr(tu)},100))}),Ci(window,"blur",function(){return Nr(Hh)})}function tu(it){var st=it.display;st.cachedCharWidth=st.cachedTextHeight=st.cachedPaddingH=null,st.scrollbarsClipped=!1,it.setSize()}for(var _a={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"},$s=0;$s<10;$s++)_a[$s+48]=_a[$s+96]=String($s);for(var pu=65;pu<=90;pu++)_a[pu]=String.fromCharCode(pu);for(var mu=1;mu<=12;mu++)_a[mu+111]=_a[mu+63235]="F"+mu;var Ha={};Ha.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},Ha.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},Ha.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"},Ha.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},Ha.default=ht?Ha.macDefault:Ha.pcDefault;function Gf(it){var st=it.split(/-(?!$)/);it=st[st.length-1];for(var ft,dt,gt,Pt,Tt=0;Tt<st.length-1;Tt++){var Rt=st[Tt];if(/^(cmd|meta|m)$/i.test(Rt))Pt=!0;else if(/^a(lt)?$/i.test(Rt))ft=!0;else if(/^(c|ctrl|control)$/i.test(Rt))dt=!0;else if(/^s(hift)?$/i.test(Rt))gt=!0;else throw new Error("Unrecognized modifier name: "+Rt)}return ft&&(it="Alt-"+it),dt&&(it="Ctrl-"+it),Pt&&(it="Cmd-"+it),gt&&(it="Shift-"+it),it}function Kh(it){var st={};for(var ft in it)if(it.hasOwnProperty(ft)){var dt=it[ft];if(/^(name|fallthrough|(de|at)tach)$/.test(ft))continue;if(dt=="..."){delete it[ft];continue}for(var gt=Nn(ft.split(" "),Gf),Pt=0;Pt<gt.length;Pt++){var Tt=void 0,Rt=void 0;Pt==gt.length-1?(Rt=gt.join(" "),Tt=dt):(Rt=gt.slice(0,Pt+1).join(" "),Tt="...");var Bt=st[Rt];if(!Bt)st[Rt]=Tt;else if(Bt!=Tt)throw new Error("Inconsistent bindings for "+Rt)}delete it[ft]}for(var Xt in st)it[Xt]=st[Xt];return it}function qs(it,st,ft,dt){st=eu(st);var gt=st.call?st.call(it,dt):st[it];if(gt===!1)return"nothing";if(gt==="...")return"multi";if(gt!=null&&ft(gt))return"handled";if(st.fallthrough){if(Object.prototype.toString.call(st.fallthrough)!="[object Array]")return qs(it,st.fallthrough,ft,dt);for(var Pt=0;Pt<st.fallthrough.length;Pt++){var Tt=qs(it,st.fallthrough[Pt],ft,dt);if(Tt)return Tt}}}function wh(it){var st=typeof it=="string"?it:_a[it.keyCode];return st=="Ctrl"||st=="Alt"||st=="Shift"||st=="Mod"}function Pc(it,st,ft){var dt=it;return st.altKey&&dt!="Alt"&&(it="Alt-"+it),(Ct?st.metaKey:st.ctrlKey)&&dt!="Ctrl"&&(it="Ctrl-"+it),(Ct?st.ctrlKey:st.metaKey)&&dt!="Mod"&&(it="Cmd-"+it),!ft&&st.shiftKey&&dt!="Shift"&&(it="Shift-"+it),it}function ng(it,st){if(Pe&&it.keyCode==34&&it.char)return!1;var ft=_a[it.keyCode];return ft==null||it.altGraphKey?!1:(it.keyCode==3&&it.code&&(ft=it.code),Pc(ft,it,st))}function eu(it){return typeof it=="string"?Ha[it]:it}function gl(it,st){for(var ft=it.doc.sel.ranges,dt=[],gt=0;gt<ft.length;gt++){for(var Pt=st(ft[gt]);dt.length&&Gn(Pt.from,Te(dt).to)<=0;){var Tt=dt.pop();if(Gn(Tt.from,Pt.from)<0){Pt.from=Tt.from;break}}dt.push(Pt)}so(it,function(){for(var Rt=dt.length-1;Rt>=0;Rt--)Do(it.doc,"",dt[Rt].from,dt[Rt].to,"+delete");$u(it)})}function wc(it,st,ft){var dt=zi(it.text,st+ft,ft);return dt<0||dt>it.text.length?null:dt}function As(it,st,ft){var dt=wc(it,st.ch,ft);return dt==null?null:new Ue(st.line,dt,ft<0?"after":"before")}function $d(it,st,ft,dt,gt){if(it){st.doc.direction=="rtl"&&(gt=-gt);var Pt=Yi(ft,st.doc.direction);if(Pt){var Tt=gt<0?Te(Pt):Pt[0],Rt=gt<0==(Tt.level==1),Bt=Rt?"after":"before",Xt;if(Tt.level>0||st.doc.direction=="rtl"){var ge=ph(st,ft);Xt=gt<0?ft.text.length-1:0;var te=Ql(st,ge,Xt).top;Xt=yi(function(Ae){return Ql(st,ge,Ae).top==te},gt<0==(Tt.level==1)?Tt.from:Tt.to-1,Xt),Bt=="before"&&(Xt=wc(ft,Xt,1))}else Xt=gt<0?Tt.to:Tt.from;return new Ue(dt,Xt,Bt)}}return new Ue(dt,gt<0?ft.text.length:0,gt<0?"before":"after")}function _f(it,st,ft,dt){var gt=Yi(st,it.doc.direction);if(!gt)return As(st,ft,dt);ft.ch>=st.text.length?(ft.ch=st.text.length,ft.sticky="before"):ft.ch<=0&&(ft.ch=0,ft.sticky="after");var Pt=Mn(gt,ft.ch,ft.sticky),Tt=gt[Pt];if(it.doc.direction=="ltr"&&Tt.level%2==0&&(dt>0?Tt.to>ft.ch:Tt.from<ft.ch))return As(st,ft,dt);var Rt=function(Xn,Pi){return wc(st,Xn instanceof Ue?Xn.ch:Xn,Pi)},Bt,Xt=function(Xn){return it.options.lineWrapping?(Bt=Bt||ph(it,st),Zd(it,st,Bt,Xn)):{begin:0,end:st.text.length}},ge=Xt(ft.sticky=="before"?Rt(ft,-1):ft.ch);if(it.doc.direction=="rtl"||Tt.level==1){var te=Tt.level==1==dt<0,Ae=Rt(ft,te?1:-1);if(Ae!=null&&(te?Ae<=Tt.to&&Ae<=ge.end:Ae>=Tt.from&&Ae>=ge.begin)){var Ee=te?"before":"after";return new Ue(ft.line,Ae,Ee)}}var dn=function(Xn,Pi,si){for(var Di=function(hs,fa){return fa?new Ue(ft.line,Rt(hs,1),"before"):new Ue(ft.line,hs,"after")};Xn>=0&&Xn<gt.length;Xn+=Pi){var hr=gt[Xn],ii=Pi>0==(hr.level!=1),Br=ii?si.begin:Rt(si.end,-1);if(hr.from<=Br&&Br<hr.to||(Br=ii?hr.from:Rt(hr.to,-1),si.begin<=Br&&Br<si.end))return Di(Br,ii)}},gn=dn(Pt+dt,dt,ge);if(gn)return gn;var Fn=dt>0?ge.end:Rt(ge.begin,-1);return Fn!=null&&!(dt>0&&Fn==st.text.length)&&(gn=dn(dt>0?0:gt.length-1,dt,Xt(Fn)),gn)?gn:null}var nh={selectAll:lo,singleSelection:function(it){return it.setSelection(it.getCursor("anchor"),it.getCursor("head"),Ce)},killLine:function(it){return gl(it,function(st){if(st.empty()){var ft=Xe(it.doc,st.head.line).text.length;return st.head.ch==ft&&st.head.line<it.lastLine()?{from:st.head,to:Ue(st.head.line+1,0)}:{from:st.head,to:Ue(st.head.line,ft)}}else return{from:st.from(),to:st.to()}})},deleteLine:function(it){return gl(it,function(st){return{from:Ue(st.from().line,0),to:qn(it.doc,Ue(st.to().line+1,0))}})},delLineLeft:function(it){return gl(it,function(st){return{from:Ue(st.from().line,0),to:st.from()}})},delWrappedLineLeft:function(it){return gl(it,function(st){var ft=it.charCoords(st.head,"div").top+5,dt=it.coordsChar({left:0,top:ft},"div");return{from:dt,to:st.from()}})},delWrappedLineRight:function(it){return gl(it,function(st){var ft=it.charCoords(st.head,"div").top+5,dt=it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ft},"div");return{from:st.from(),to:dt}})},undo:function(it){return it.undo()},redo:function(it){return it.redo()},undoSelection:function(it){return it.undoSelection()},redoSelection:function(it){return it.redoSelection()},goDocStart:function(it){return it.extendSelection(Ue(it.firstLine(),0))},goDocEnd:function(it){return it.extendSelection(Ue(it.lastLine()))},goLineStart:function(it){return it.extendSelectionsBy(function(st){return yd(it,st.head.line)},{origin:"+move",bias:1})},goLineStartSmart:function(it){return it.extendSelectionsBy(function(st){return Hf(it,st.head)},{origin:"+move",bias:1})},goLineEnd:function(it){return it.extendSelectionsBy(function(st){return Yh(it,st.head.line)},{origin:"+move",bias:-1})},goLineRight:function(it){return it.extendSelectionsBy(function(st){var ft=it.cursorCoords(st.head,"div").top+5;return it.coordsChar({left:it.display.lineDiv.offsetWidth+100,top:ft},"div")},cn)},goLineLeft:function(it){return it.extendSelectionsBy(function(st){var ft=it.cursorCoords(st.head,"div").top+5;return it.coordsChar({left:0,top:ft},"div")},cn)},goLineLeftSmart:function(it){return it.extendSelectionsBy(function(st){var ft=it.cursorCoords(st.head,"div").top+5,dt=it.coordsChar({left:0,top:ft},"div");return dt.ch<it.getLine(dt.line).search(/\S/)?Hf(it,st.head):dt},cn)},goLineUp:function(it){return it.moveV(-1,"line")},goLineDown:function(it){return it.moveV(1,"line")},goPageUp:function(it){return it.moveV(-1,"page")},goPageDown:function(it){return it.moveV(1,"page")},goCharLeft:function(it){return it.moveH(-1,"char")},goCharRight:function(it){return it.moveH(1,"char")},goColumnLeft:function(it){return it.moveH(-1,"column")},goColumnRight:function(it){return it.moveH(1,"column")},goWordLeft:function(it){return it.moveH(-1,"word")},goGroupRight:function(it){return it.moveH(1,"group")},goGroupLeft:function(it){return it.moveH(-1,"group")},goWordRight:function(it){return it.moveH(1,"word")},delCharBefore:function(it){return it.deleteH(-1,"codepoint")},delCharAfter:function(it){return it.deleteH(1,"char")},delWordBefore:function(it){return it.deleteH(-1,"word")},delWordAfter:function(it){return it.deleteH(1,"word")},delGroupBefore:function(it){return it.deleteH(-1,"group")},delGroupAfter:function(it){return it.deleteH(1,"group")},indentAuto:function(it){return it.indentSelection("smart")},indentMore:function(it){return it.indentSelection("add")},indentLess:function(it){return it.indentSelection("subtract")},insertTab:function(it){return it.replaceSelection(" ")},insertSoftTab:function(it){for(var st=[],ft=it.listSelections(),dt=it.options.tabSize,gt=0;gt<ft.length;gt++){var Pt=ft[gt].from(),Tt=ee(it.getLine(Pt.line),Pt.ch,dt);st.push(he(dt-Tt%dt))}it.replaceSelections(st)},defaultTab:function(it){it.somethingSelected()?it.indentSelection("add"):it.execCommand("insertTab")},transposeChars:function(it){return so(it,function(){for(var st=it.listSelections(),ft=[],dt=0;dt<st.length;dt++)if(st[dt].empty()){var gt=st[dt].head,Pt=Xe(it.doc,gt.line).text;if(Pt){if(gt.ch==Pt.length&&(gt=new Ue(gt.line,gt.ch-1)),gt.ch>0)gt=new Ue(gt.line,gt.ch+1),it.replaceRange(Pt.charAt(gt.ch-1)+Pt.charAt(gt.ch-2),Ue(gt.line,gt.ch-2),gt,"+transpose");else if(gt.line>it.doc.first){var Tt=Xe(it.doc,gt.line-1).text;Tt&&(gt=new Ue(gt.line,1),it.replaceRange(Pt.charAt(0)+it.doc.lineSeparator()+Tt.charAt(Tt.length-1),Ue(gt.line-1,Tt.length-1),gt,"+transpose"))}}ft.push(new bn(gt,gt))}it.setSelections(ft)})},newlineAndIndent:function(it){return so(it,function(){for(var st=it.listSelections(),ft=st.length-1;ft>=0;ft--)it.replaceRange(it.doc.lineSeparator(),st[ft].anchor,st[ft].head,"+input");st=it.listSelections();for(var dt=0;dt<st.length;dt++)it.indentLine(st[dt].from().line,null,!0);$u(it)})},openLine:function(it){return it.replaceSelection(`
|
|
`,"start")},toggleOverwrite:function(it){return it.toggleOverwrite()}};function yd(it,st){var ft=Xe(it.doc,st),dt=Lo(ft);return dt!=ft&&(st=fe(dt)),$d(!0,it,dt,st,1)}function Yh(it,st){var ft=Xe(it.doc,st),dt=gs(ft);return dt!=ft&&(st=fe(dt)),$d(!0,it,ft,st,-1)}function Hf(it,st){var ft=yd(it,st.line),dt=Xe(it.doc,ft.line),gt=Yi(dt,it.doc.direction);if(!gt||gt[0].level==0){var Pt=Math.max(ft.ch,dt.text.search(/\S/)),Tt=st.line==ft.line&&st.ch<=Pt&&st.ch;return Ue(ft.line,Tt?0:Pt,ft.sticky)}return ft}function Sd(it,st,ft){if(typeof st=="string"&&(st=nh[st],!st))return!1;it.display.input.ensurePolled();var dt=it.display.shift,gt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),ft&&(it.display.shift=!1),gt=st(it)!=Ln}finally{it.display.shift=dt,it.state.suppressEdits=!1}return gt}function Vf(it,st,ft){for(var dt=0;dt<it.state.keyMaps.length;dt++){var gt=qs(st,it.state.keyMaps[dt],ft,it);if(gt)return gt}return it.options.extraKeys&&qs(st,it.options.extraKeys,ft,it)||qs(st,it.options.keyMap,ft,it)}var Ru=new _t;function Xh(it,st,ft,dt){var gt=it.state.keySeq;if(gt){if(wh(st))return"handled";if(/\'$/.test(st)?it.state.keySeq=null:Ru.set(50,function(){it.state.keySeq==gt&&(it.state.keySeq=null,it.display.input.reset())}),Wf(it,gt+" "+st,ft,dt))return!0}return Wf(it,st,ft,dt)}function Wf(it,st,ft,dt){var gt=Vf(it,st,dt);return gt=="multi"&&(it.state.keySeq=st),gt=="handled"&&ni(it,"keyHandled",it,st,ft),(gt=="handled"||gt=="multi")&&(aa(ft),ko(it)),!!gt}function Uf(it,st){var ft=ng(st,!0);return ft?st.shiftKey&&!it.state.keySeq?Xh(it,"Shift-"+ft,st,function(dt){return Sd(it,dt,!0)})||Xh(it,ft,st,function(dt){if(typeof dt=="string"?/^go[A-Z]/.test(dt):dt.motion)return Sd(it,dt)}):Xh(it,ft,st,function(dt){return Sd(it,dt)}):!1}function qd(it,st,ft){return Xh(it,"'"+ft+"'",st,function(dt){return Sd(it,dt,!0)})}var ih=null;function Po(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&(st.curOp.focus=Ke(),!zr(st,it))){Se&&de<11&&it.keyCode==27&&(it.returnValue=!1);var ft=it.keyCode;st.display.shift=ft==16||it.shiftKey;var dt=Uf(st,it);Pe&&(ih=dt?ft:null,!dt&&ft==88&&!En&&(ht?it.metaKey:it.ctrlKey)&&st.replaceSelection("",null,"cut")),It&&!ht&&!dt&&ft==46&&it.shiftKey&&!it.ctrlKey&&document.execCommand&&document.execCommand("cut"),ft==18&&!/\bCodeMirror-crosshair\b/.test(st.display.lineDiv.className)&&Qr(st)}}function Qr(it){var st=it.display.lineDiv;Fe(st,"CodeMirror-crosshair");function ft(dt){(dt.keyCode==18||!dt.altKey)&&(Qt(st,"CodeMirror-crosshair"),is(document,"keyup",ft),is(document,"mouseover",ft))}Ci(document,"keyup",ft),Ci(document,"mouseover",ft)}function el(it){it.keyCode==16&&(this.doc.sel.shift=!1),zr(this,it)}function Bs(it){var st=this;if(!(it.target&&it.target!=st.display.input.getField())&&!(Qa(st.display,it)||zr(st,it)||it.ctrlKey&&!it.altKey||ht&&it.metaKey)){var ft=it.keyCode,dt=it.charCode;if(Pe&&ft==ih){ih=null,aa(it);return}if(!(Pe&&(!it.which||it.which<10)&&Uf(st,it))){var gt=String.fromCharCode(dt==null?ft:dt);gt!="\b"&&(qd(st,it,gt)||st.display.input.onKeyPress(it))}}}var na=400,Ca=function(it,st,ft){this.time=it,this.pos=st,this.button=ft};Ca.prototype.compare=function(it,st,ft){return this.time+na>it&&Gn(st,this.pos)==0&&ft==this.button};var El,nl;function rh(it,st){var ft=+new Date;return nl&&nl.compare(ft,it,st)?(El=nl=null,"triple"):El&&El.compare(ft,it,st)?(nl=new Ca(ft,it,st),El=null,"double"):(El=new Ca(ft,it,st),nl=null,"single")}function il(it){var st=this,ft=st.display;if(!(zr(st,it)||ft.activeTouch&&ft.input.supportsTouch())){if(ft.input.ensurePolled(),ft.shift=it.shiftKey,Qa(ft,it)){$t||(ft.scroller.draggable=!1,setTimeout(function(){return ft.scroller.draggable=!0},100));return}if(!rg(st,it)){var dt=Sa(st,it),gt=bu(it),Pt=dt?rh(dt,gt):"single";window.focus(),gt==1&&st.state.selectingText&&st.state.selectingText(it),!(dt&&oh(st,gt,dt,Pt,it))&&(gt==1?dt?tf(st,dt,Pt,it):ku(it)==ft.scroller&&aa(it):gt==2?(dt&&Oo(st.doc,dt),setTimeout(function(){return ft.input.focus()},20)):gt==3&&(bt?st.display.input.onContextMenu(it):as(st)))}}}function oh(it,st,ft,dt,gt){var Pt="Click";return dt=="double"?Pt="Double"+Pt:dt=="triple"&&(Pt="Triple"+Pt),Pt=(st==1?"Left":st==2?"Middle":"Right")+Pt,Xh(it,Pc(Pt,gt),gt,function(Tt){if(typeof Tt=="string"&&(Tt=nh[Tt]),!Tt)return!1;var Rt=!1;try{it.isReadOnly()&&(it.state.suppressEdits=!0),Rt=Tt(it,ft)!=Ln}finally{it.state.suppressEdits=!1}return Rt})}function Zh(it,st,ft){var dt=it.getOption("configureMouse"),gt=dt?dt(it,st,ft):{};if(gt.unit==null){var Pt=lt?ft.shiftKey&&ft.metaKey:ft.altKey;gt.unit=Pt?"rectangle":st=="single"?"char":st=="double"?"word":"line"}return(gt.extend==null||it.doc.extend)&&(gt.extend=it.doc.extend||ft.shiftKey),gt.addNew==null&&(gt.addNew=ht?ft.metaKey:ft.ctrlKey),gt.moveOnDrag==null&&(gt.moveOnDrag=!(ht?ft.altKey:ft.ctrlKey)),gt}function tf(it,st,ft,dt){Se?setTimeout($n(Bo,it),0):it.curOp.focus=Ke();var gt=Zh(it,ft,dt),Pt=it.doc.sel,Tt;it.options.dragDrop&&Rh&&!it.isReadOnly()&&ft=="single"&&(Tt=Pt.contains(st))>-1&&(Gn((Tt=Pt.ranges[Tt]).from(),st)<0||st.xRel>0)&&(Gn(Tt.to(),st)>0||st.xRel<0)?qg(it,dt,st,gt):ev(it,dt,st,gt)}function qg(it,st,ft,dt){var gt=it.display,Pt=!1,Tt=Xs(it,function(Xt){$t&&(gt.scroller.draggable=!1),it.state.draggingText=!1,is(gt.wrapper.ownerDocument,"mouseup",Tt),is(gt.wrapper.ownerDocument,"mousemove",Rt),is(gt.scroller,"dragstart",Bt),is(gt.scroller,"drop",Tt),Pt||(aa(Xt),dt.addNew||Oo(it.doc,ft,null,null,dt.extend),$t&&!ze||Se&&de==9?setTimeout(function(){gt.wrapper.ownerDocument.body.focus({preventScroll:!0}),gt.input.focus()},20):gt.input.focus())}),Rt=function(Xt){Pt=Pt||Math.abs(st.clientX-Xt.clientX)+Math.abs(st.clientY-Xt.clientY)>=10},Bt=function(){return Pt=!0};$t&&(gt.scroller.draggable=!0),it.state.draggingText=Tt,Tt.copy=!dt.moveOnDrag,gt.scroller.dragDrop&>.scroller.dragDrop(),Ci(gt.wrapper.ownerDocument,"mouseup",Tt),Ci(gt.wrapper.ownerDocument,"mousemove",Rt),Ci(gt.scroller,"dragstart",Bt),Ci(gt.scroller,"drop",Tt),as(it),setTimeout(function(){return gt.input.focus()},20)}function tp(it,st,ft){if(ft=="char")return new bn(st,st);if(ft=="word")return it.findWordAt(st);if(ft=="line")return new bn(Ue(st.line,0),qn(it.doc,Ue(st.line+1,0)));var dt=ft(it,st);return new bn(dt.from,dt.to)}function ev(it,st,ft,dt){var gt=it.display,Pt=it.doc;aa(st);var Tt,Rt,Bt=Pt.sel,Xt=Bt.ranges;if(dt.addNew&&!dt.extend?(Rt=Pt.sel.contains(ft),Rt>-1?Tt=Xt[Rt]:Tt=new bn(ft,ft)):(Tt=Pt.sel.primary(),Rt=Pt.sel.primIndex),dt.unit=="rectangle")dt.addNew||(Tt=new bn(ft,ft)),ft=Sa(it,st,!0,!0),Rt=-1;else{var ge=tp(it,ft,dt.unit);dt.extend?Tt=ro(Tt,ge.anchor,ge.head,dt.extend):Tt=ge}dt.addNew?Rt==-1?(Rt=Xt.length,ui(Pt,Vn(it,Xt.concat([Tt]),Rt),{scroll:!1,origin:"*mouse"})):Xt.length>1&&Xt[Rt].empty()&&dt.unit=="char"&&!dt.extend?(ui(Pt,Vn(it,Xt.slice(0,Rt).concat(Xt.slice(Rt+1)),0),{scroll:!1,origin:"*mouse"}),Bt=Pt.sel):_o(Pt,Rt,Tt,sn):(Rt=0,ui(Pt,new kn([Tt],0),sn),Bt=Pt.sel);var te=ft;function Ae(si){if(Gn(te,si)!=0)if(te=si,dt.unit=="rectangle"){for(var Di=[],hr=it.options.tabSize,ii=ee(Xe(Pt,ft.line).text,ft.ch,hr),Br=ee(Xe(Pt,si.line).text,si.ch,hr),hs=Math.min(ii,Br),fa=Math.max(ii,Br),Ms=Math.min(ft.line,si.line),Tl=Math.min(it.lastLine(),Math.max(ft.line,si.line));Ms<=Tl;Ms++){var rl=Xe(Pt,Ms).text,ra=Jn(rl,hs,hr);hs==fa?Di.push(new bn(Ue(Ms,ra),Ue(Ms,ra))):rl.length>ra&&Di.push(new bn(Ue(Ms,ra),Ue(Ms,Jn(rl,fa,hr))))}Di.length||Di.push(new bn(ft,ft)),ui(Pt,Vn(it,Bt.ranges.slice(0,Rt).concat(Di),Rt),{origin:"*mouse",scroll:!1}),it.scrollIntoView(si)}else{var zl=Tt,Va=tp(it,si,dt.unit),oa=zl.anchor,wo;Gn(Va.anchor,oa)>0?(wo=Va.head,oa=Kn(zl.from(),Va.anchor)):(wo=Va.anchor,oa=$r(zl.to(),Va.head));var Os=Bt.ranges.slice(0);Os[Rt]=sm(it,new bn(qn(Pt,oa),wo)),ui(Pt,Vn(it,Os,Rt),sn)}}var Ee=gt.wrapper.getBoundingClientRect(),dn=0;function gn(si){var Di=++dn,hr=Sa(it,si,!0,dt.unit=="rectangle");if(hr)if(Gn(hr,te)!=0){it.curOp.focus=Ke(),Ae(hr);var ii=jr(gt,Pt);(hr.line>=ii.to||hr.line<ii.from)&&setTimeout(Xs(it,function(){dn==Di&&gn(si)}),150)}else{var Br=si.clientY<Ee.top?-20:si.clientY>Ee.bottom?20:0;Br&&setTimeout(Xs(it,function(){dn==Di&&(gt.scroller.scrollTop+=Br,gn(si))}),50)}}function Fn(si){it.state.selectingText=!1,dn=1/0,si&&(aa(si),gt.input.focus()),is(gt.wrapper.ownerDocument,"mousemove",Xn),is(gt.wrapper.ownerDocument,"mouseup",Pi),Pt.history.lastSelOrigin=null}var Xn=Xs(it,function(si){si.buttons===0||!bu(si)?Fn(si):gn(si)}),Pi=Xs(it,Fn);it.state.selectingText=Pi,Ci(gt.wrapper.ownerDocument,"mousemove",Xn),Ci(gt.wrapper.ownerDocument,"mouseup",Pi)}function sm(it,st){var ft=st.anchor,dt=st.head,gt=Xe(it.doc,ft.line);if(Gn(ft,dt)==0&&ft.sticky==dt.sticky)return st;var Pt=Yi(gt);if(!Pt)return st;var Tt=Mn(Pt,ft.ch,ft.sticky),Rt=Pt[Tt];if(Rt.from!=ft.ch&&Rt.to!=ft.ch)return st;var Bt=Tt+(Rt.from==ft.ch==(Rt.level!=1)?0:1);if(Bt==0||Bt==Pt.length)return st;var Xt;if(dt.line!=ft.line)Xt=(dt.line-ft.line)*(it.doc.direction=="ltr"?1:-1)>0;else{var ge=Mn(Pt,dt.ch,dt.sticky),te=ge-Tt||(dt.ch-ft.ch)*(Rt.level==1?-1:1);ge==Bt-1||ge==Bt?Xt=te<0:Xt=te>0}var Ae=Pt[Bt+(Xt?-1:0)],Ee=Xt==(Ae.level==1),dn=Ee?Ae.from:Ae.to,gn=Ee?"after":"before";return ft.ch==dn&&ft.sticky==gn?st:new bn(new Ue(ft.line,dn,gn),dt)}function ig(it,st,ft,dt){var gt,Pt;if(st.touches)gt=st.touches[0].clientX,Pt=st.touches[0].clientY;else try{gt=st.clientX,Pt=st.clientY}catch(Ae){return!1}if(gt>=Math.floor(it.display.gutters.getBoundingClientRect().right))return!1;dt&&aa(st);var Tt=it.display,Rt=Tt.lineDiv.getBoundingClientRect();if(Pt>Rt.bottom||!Li(it,ft))return Or(st);Pt-=Rt.top-Tt.viewOffset;for(var Bt=0;Bt<it.display.gutterSpecs.length;++Bt){var Xt=Tt.gutters.childNodes[Bt];if(Xt&&Xt.getBoundingClientRect().right>=gt){var ge=An(it.doc,Pt),te=it.display.gutterSpecs[Bt];return xo(it,ft,it,ge,te.className,st),Or(st)}}}function rg(it,st){return ig(it,st,"gutterClick",!0)}function og(it,st){Qa(it.display,st)||am(it,st)||zr(it,st,"contextmenu")||bt||it.display.input.onContextMenu(st)}function am(it,st){return Li(it,"gutterContextMenu")?ig(it,st,"gutterContextMenu",!1):!1}function sg(it){it.display.wrapper.className=it.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+it.options.theme.replace(/(^|\s)\s*/g," cm-s-"),Gh(it)}var xd={toString:function(){return"CodeMirror.Init"}},ep={},Cc={};function lm(it){var st=it.optionHandlers;function ft(dt,gt,Pt,Tt){it.defaults[dt]=gt,Pt&&(st[dt]=Tt?function(Rt,Bt,Xt){Xt!=xd&&Pt(Rt,Bt,Xt)}:Pt)}it.defineOption=ft,it.Init=xd,ft("value","",function(dt,gt){return dt.setValue(gt)},!0),ft("mode",null,function(dt,gt){dt.doc.modeOption=gt,Pn(dt)},!0),ft("indentUnit",2,Pn,!0),ft("indentWithTabs",!1),ft("smartIndent",!0),ft("tabSize",4,function(dt){Ai(dt),Gh(dt),ts(dt)},!0),ft("lineSeparator",null,function(dt,gt){if(dt.doc.lineSep=gt,!!gt){var Pt=[],Tt=dt.doc.first;dt.doc.iter(function(Bt){for(var Xt=0;;){var ge=Bt.text.indexOf(gt,Xt);if(ge==-1)break;Xt=ge+gt.length,Pt.push(Ue(Tt,ge))}Tt++});for(var Rt=Pt.length-1;Rt>=0;Rt--)Do(dt.doc,gt,Pt[Rt],Ue(Pt[Rt].line,Pt[Rt].ch+gt.length))}}),ft("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(dt,gt,Pt){dt.state.specialChars=new RegExp(gt.source+(gt.test(" ")?"":"| "),"g"),Pt!=xd&&dt.refresh()}),ft("specialCharPlaceholder",Ra,function(dt){return dt.refresh()},!0),ft("electricChars",!0),ft("inputStyle",et?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),ft("spellcheck",!1,function(dt,gt){return dt.getInputField().spellcheck=gt},!0),ft("autocorrect",!1,function(dt,gt){return dt.getInputField().autocorrect=gt},!0),ft("autocapitalize",!1,function(dt,gt){return dt.getInputField().autocapitalize=gt},!0),ft("rtlMoveVisually",!pt),ft("wholeLineUpdateBefore",!0),ft("theme","default",function(dt){sg(dt),je(dt)},!0),ft("keyMap","default",function(dt,gt,Pt){var Tt=eu(gt),Rt=Pt!=xd&&eu(Pt);Rt&&Rt.detach&&Rt.detach(dt,Tt),Tt.attach&&Tt.attach(dt,Rt||null)}),ft("extraKeys",null),ft("configureMouse",null),ft("lineWrapping",!1,um,!0),ft("gutters",[],function(dt,gt){dt.display.gutterSpecs=pe(gt,dt.options.lineNumbers),je(dt)},!0),ft("fixedGutter",!0,function(dt,gt){dt.display.gutters.style.left=gt?md(dt.display)+"px":"0",dt.refresh()},!0),ft("coverGutterNextToScrollbar",!1,function(dt){return vh(dt)},!0),ft("scrollbarStyle","native",function(dt){tg(dt),vh(dt),dt.display.scrollbars.setScrollTop(dt.doc.scrollTop),dt.display.scrollbars.setScrollLeft(dt.doc.scrollLeft)},!0),ft("lineNumbers",!1,function(dt,gt){dt.display.gutterSpecs=pe(dt.options.gutters,gt),je(dt)},!0),ft("firstLineNumber",1,je,!0),ft("lineNumberFormatter",function(dt){return dt},je,!0),ft("showCursorWhenSelecting",!1,Ys,!0),ft("resetSelectionOnContextMenu",!0),ft("lineWiseCopyCut",!0),ft("pasteLinesPerSelection",!0),ft("selectionsMayTouch",!1),ft("readOnly",!1,function(dt,gt){gt=="nocursor"&&(Hh(dt),dt.display.input.blur()),dt.display.input.readOnlyChanged(gt)}),ft("screenReaderLabel",null,function(dt,gt){gt=gt===""?null:gt,dt.display.input.screenReaderLabelChanged(gt)}),ft("disableInput",!1,function(dt,gt){gt||dt.display.input.reset()},!0),ft("dragDrop",!0,ag),ft("allowDropFileTypes",null),ft("cursorBlinkRate",530),ft("cursorScrollMargin",0),ft("cursorHeight",1,Ys,!0),ft("singleCursorHeightPerLine",!0,Ys,!0),ft("workTime",100),ft("workDelay",100),ft("flattenSpans",!0,Ai,!0),ft("addModeClass",!1,Ai,!0),ft("pollInterval",100),ft("undoDepth",200,function(dt,gt){return dt.doc.history.undoDepth=gt}),ft("historyEventDelay",1250),ft("viewportMargin",10,function(dt){return dt.refresh()},!0),ft("maxHighlightLength",1e4,Ai,!0),ft("moveInputWithCursor",!0,function(dt,gt){gt||dt.display.input.resetPosition()}),ft("tabindex",null,function(dt,gt){return dt.display.input.getField().tabIndex=gt||""}),ft("autofocus",null),ft("direction","ltr",function(dt,gt){return dt.doc.setDirection(gt)},!0),ft("phrases",null)}function ag(it,st,ft){var dt=ft&&ft!=xd;if(!st!=!dt){var gt=it.display.dragFunctions,Pt=st?Ci:is;Pt(it.display.scroller,"dragstart",gt.start),Pt(it.display.scroller,"dragenter",gt.enter),Pt(it.display.scroller,"dragover",gt.over),Pt(it.display.scroller,"dragleave",gt.leave),Pt(it.display.scroller,"drop",gt.drop)}}function um(it){it.options.lineWrapping?(Fe(it.display.wrapper,"CodeMirror-wrap"),it.display.sizer.style.minWidth="",it.display.sizerWidth=null):(Qt(it.display.wrapper,"CodeMirror-wrap"),Mo(it)),Ni(it),ts(it),Gh(it),setTimeout(function(){return vh(it)},100)}function So(it,st){var ft=this;if(!(this instanceof So))return new So(it,st);this.options=st=st?di(st):{},di(ep,st,!1);var dt=st.value;typeof dt=="string"?dt=new tr(dt,st.mode,null,st.lineSeparator,st.direction):st.mode&&(dt.modeOption=st.mode),this.doc=dt;var gt=new So.inputStyles[st.inputStyle](this),Pt=this.display=new en(it,dt,gt,st);Pt.wrapper.CodeMirror=this,sg(this),st.lineWrapping&&(this.display.wrapper.className+=" CodeMirror-wrap"),tg(this),this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:!1,delayingBlurEvent:!1,focused:!1,suppressEdits:!1,pasteIncoming:-1,cutIncoming:-1,selectingText:!1,draggingText:!1,highlight:new _t,keySeq:null,specialChars:null},st.autofocus&&!et&&Pt.input.focus(),Se&&de<11&&setTimeout(function(){return ft.display.input.reset(!0)},20),Kf(this),mo(),yh(this),this.curOp.forceUpdate=!0,vi(this,dt),st.autofocus&&!et||this.hasFocus()?setTimeout(function(){ft.hasFocus()&&!ft.state.focused&&eo(ft)},20):Hh(this);for(var Tt in Cc)Cc.hasOwnProperty(Tt)&&Cc[Tt](this,st[Tt],xd);Zt(this),st.finishInit&&st.finishInit(this);for(var Rt=0;Rt<ef.length;++Rt)ef[Rt](this);Sh(this),$t&&st.lineWrapping&&getComputedStyle(Pt.lineDiv).textRendering=="optimizelegibility"&&(Pt.lineDiv.style.textRendering="auto")}So.defaults=ep,So.optionHandlers=Cc;function Kf(it){var st=it.display;Ci(st.scroller,"mousedown",Xs(it,il)),Se&&de<11?Ci(st.scroller,"dblclick",Xs(it,function(Bt){if(!zr(it,Bt)){var Xt=Sa(it,Bt);if(!(!Xt||rg(it,Bt)||Qa(it.display,Bt))){aa(Bt);var ge=it.findWordAt(Xt);Oo(it.doc,ge.anchor,ge.head)}}})):Ci(st.scroller,"dblclick",function(Bt){return zr(it,Bt)||aa(Bt)}),Ci(st.scroller,"contextmenu",function(Bt){return og(it,Bt)}),Ci(st.input.getField(),"contextmenu",function(Bt){st.scroller.contains(Bt.target)||og(it,Bt)});var ft,dt={end:0};function gt(){st.activeTouch&&(ft=setTimeout(function(){return st.activeTouch=null},1e3),dt=st.activeTouch,dt.end=+new Date)}function Pt(Bt){if(Bt.touches.length!=1)return!1;var Xt=Bt.touches[0];return Xt.radiusX<=1&&Xt.radiusY<=1}function Tt(Bt,Xt){if(Xt.left==null)return!0;var ge=Xt.left-Bt.left,te=Xt.top-Bt.top;return ge*ge+te*te>20*20}Ci(st.scroller,"touchstart",function(Bt){if(!zr(it,Bt)&&!Pt(Bt)&&!rg(it,Bt)){st.input.ensurePolled(),clearTimeout(ft);var Xt=+new Date;st.activeTouch={start:Xt,moved:!1,prev:Xt-dt.end<=300?dt:null},Bt.touches.length==1&&(st.activeTouch.left=Bt.touches[0].pageX,st.activeTouch.top=Bt.touches[0].pageY)}}),Ci(st.scroller,"touchmove",function(){st.activeTouch&&(st.activeTouch.moved=!0)}),Ci(st.scroller,"touchend",function(Bt){var Xt=st.activeTouch;if(Xt&&!Qa(st,Bt)&&Xt.left!=null&&!Xt.moved&&new Date-Xt.start<300){var ge=it.coordsChar(st.activeTouch,"page"),te;!Xt.prev||Tt(Xt,Xt.prev)?te=new bn(ge,ge):!Xt.prev.prev||Tt(Xt,Xt.prev.prev)?te=it.findWordAt(ge):te=new bn(Ue(ge.line,0),qn(it.doc,Ue(ge.line+1,0))),it.setSelection(te.anchor,te.head),it.focus(),aa(Bt)}gt()}),Ci(st.scroller,"touchcancel",gt),Ci(st.scroller,"scroll",function(){st.scroller.clientHeight&&(Wh(it,st.scroller.scrollTop),qu(it,st.scroller.scrollLeft,!0),xo(it,"scroll",it))}),Ci(st.scroller,"mousewheel",function(Bt){return _n(it,Bt)}),Ci(st.scroller,"DOMMouseScroll",function(Bt){return _n(it,Bt)}),Ci(st.wrapper,"scroll",function(){return st.wrapper.scrollTop=st.wrapper.scrollLeft=0}),st.dragFunctions={enter:function(Bt){zr(it,Bt)||Il(Bt)},over:function(Bt){zr(it,Bt)||(_r(it,Bt),Il(Bt))},start:function(Bt){return cr(it,Bt)},drop:Xs(it,tl),leave:function(Bt){zr(it,Bt)||Cr(it)}};var Rt=st.input.getField();Ci(Rt,"keyup",function(Bt){return el.call(it,Bt)}),Ci(Rt,"keydown",Xs(it,Po)),Ci(Rt,"keypress",Xs(it,Bs)),Ci(Rt,"focus",function(Bt){return eo(it,Bt)}),Ci(Rt,"blur",function(Bt){return Hh(it,Bt)})}var ef=[];So.defineInitHook=function(it){return ef.push(it)};function da(it,st,ft,dt){var gt=it.doc,Pt;ft==null&&(ft="add"),ft=="smart"&&(gt.mode.indent?Pt=rs(it,st).state:ft="prev");var Tt=it.options.tabSize,Rt=Xe(gt,st),Bt=ee(Rt.text,null,Tt);Rt.stateAfter&&(Rt.stateAfter=null);var Xt=Rt.text.match(/^\s*/)[0],ge;if(!dt&&!/\S/.test(Rt.text))ge=0,ft="not";else if(ft=="smart"&&(ge=gt.mode.indent(Pt,Rt.text.slice(Xt.length),Rt.text),ge==Ln||ge>150)){if(!dt)return;ft="prev"}ft=="prev"?st>gt.first?ge=ee(Xe(gt,st-1).text,null,Tt):ge=0:ft=="add"?ge=Bt+it.options.indentUnit:ft=="subtract"?ge=Bt-it.options.indentUnit:typeof ft=="number"&&(ge=Bt+ft),ge=Math.max(0,ge);var te="",Ae=0;if(it.options.indentWithTabs)for(var Ee=Math.floor(ge/Tt);Ee;--Ee)Ae+=Tt,te+=" ";if(Ae<ge&&(te+=he(ge-Ae)),te!=Xt)return Do(gt,te,Ue(st,0),Ue(st,Xt.length),"+input"),Rt.stateAfter=null,!0;for(var dn=0;dn<gt.sel.ranges.length;dn++){var gn=gt.sel.ranges[dn];if(gn.head.line==st&&gn.head.ch<Xt.length){var Fn=Ue(st,Xt.length);_o(gt,dn,new bn(Fn,Fn));break}}}var Fl=null;function nf(it){Fl=it}function Lc(it,st,ft,dt,gt){var Pt=it.doc;it.display.shift=!1,dt||(dt=Pt.sel);var Tt=+new Date-200,Rt=gt=="paste"||it.state.pasteIncoming>Tt,Bt=Qe(st),Xt=null;if(Rt&&dt.ranges.length>1)if(Fl&&Fl.text.join(`
|
|
`)==st){if(dt.ranges.length%Fl.text.length==0){Xt=[];for(var ge=0;ge<Fl.text.length;ge++)Xt.push(Pt.splitLines(Fl.text[ge]))}}else Bt.length==dt.ranges.length&&it.options.pasteLinesPerSelection&&(Xt=Nn(Bt,function(Xn){return[Xn]}));for(var te=it.curOp.updateInput,Ae=dt.ranges.length-1;Ae>=0;Ae--){var Ee=dt.ranges[Ae],dn=Ee.from(),gn=Ee.to();Ee.empty()&&(ft&&ft>0?dn=Ue(dn.line,dn.ch-ft):it.state.overwrite&&!Rt?gn=Ue(gn.line,Math.min(Xe(Pt,gn.line).text.length,gn.ch+Te(Bt).length)):Rt&&Fl&&Fl.lineWise&&Fl.text.join(`
|
|
`)==Bt.join(`
|
|
`)&&(dn=gn=Ue(dn.line,0)));var Fn={from:dn,to:gn,text:Xt?Xt[Ae%Xt.length]:Bt,origin:gt||(Rt?"paste":it.state.cutIncoming>Tt?"cut":"+input")};Io(it.doc,Fn),ni(it,"inputRead",it,Fn)}st&&!Rt&&ip(it,st),$u(it),it.curOp.updateInput<2&&(it.curOp.updateInput=te),it.curOp.typing=!0,it.state.pasteIncoming=it.state.cutIncoming=-1}function np(it,st){var ft=it.clipboardData&&it.clipboardData.getData("Text");if(ft)return it.preventDefault(),!st.isReadOnly()&&!st.options.disableInput&&so(st,function(){return Lc(st,ft,0,null,"paste")}),!0}function ip(it,st){if(!(!it.options.electricChars||!it.options.smartIndent))for(var ft=it.doc.sel,dt=ft.ranges.length-1;dt>=0;dt--){var gt=ft.ranges[dt];if(!(gt.head.ch>100||dt&&ft.ranges[dt-1].head.line==gt.head.line)){var Pt=it.getModeAt(gt.head),Tt=!1;if(Pt.electricChars){for(var Rt=0;Rt<Pt.electricChars.length;Rt++)if(st.indexOf(Pt.electricChars.charAt(Rt))>-1){Tt=da(it,gt.head.line,"smart");break}}else Pt.electricInput&&Pt.electricInput.test(Xe(it.doc,gt.head.line).text.slice(0,gt.head.ch))&&(Tt=da(it,gt.head.line,"smart"));Tt&&ni(it,"electricInput",it,gt.head.line)}}}function rp(it){for(var st=[],ft=[],dt=0;dt<it.doc.sel.ranges.length;dt++){var gt=it.doc.sel.ranges[dt].head.line,Pt={anchor:Ue(gt,0),head:Ue(gt+1,0)};ft.push(Pt),st.push(it.getRange(Pt.anchor,Pt.head))}return{text:st,ranges:ft}}function op(it,st,ft,dt){it.setAttribute("autocorrect",ft?"":"off"),it.setAttribute("autocapitalize",dt?"":"off"),it.setAttribute("spellcheck",!!st)}function sp(){var it=re("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; outline: none"),st=re("div",[it],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");return $t?it.style.width="1000px":it.setAttribute("wrap","off"),Nt&&(it.style.border="1px solid black"),op(it),st}function Pd(it){var st=it.optionHandlers,ft=it.helpers={};it.prototype={constructor:it,focus:function(){window.focus(),this.display.input.focus()},setOption:function(dt,gt){var Pt=this.options,Tt=Pt[dt];Pt[dt]==gt&&dt!="mode"||(Pt[dt]=gt,st.hasOwnProperty(dt)&&Xs(this,st[dt])(this,gt,Tt),xo(this,"optionChange",this,dt))},getOption:function(dt){return this.options[dt]},getDoc:function(){return this.doc},addKeyMap:function(dt,gt){this.state.keyMaps[gt?"push":"unshift"](eu(dt))},removeKeyMap:function(dt){for(var gt=this.state.keyMaps,Pt=0;Pt<gt.length;++Pt)if(gt[Pt]==dt||gt[Pt].name==dt)return gt.splice(Pt,1),!0},addOverlay:Zs(function(dt,gt){var Pt=dt.token?dt:it.getMode(this.options,dt);if(Pt.startState)throw new Error("Overlays may not be stateful.");Bn(this.state.overlays,{mode:Pt,modeSpec:dt,opaque:gt&>.opaque,priority:gt&>.priority||0},function(Tt){return Tt.priority}),this.state.modeGen++,ts(this)}),removeOverlay:Zs(function(dt){for(var gt=this.state.overlays,Pt=0;Pt<gt.length;++Pt){var Tt=gt[Pt].modeSpec;if(Tt==dt||typeof dt=="string"&&Tt.name==dt){gt.splice(Pt,1),this.state.modeGen++,ts(this);return}}}),indentLine:Zs(function(dt,gt,Pt){typeof gt!="string"&&typeof gt!="number"&&(gt==null?gt=this.options.smartIndent?"smart":"prev":gt=gt?"add":"subtract"),ri(this.doc,dt)&&da(this,dt,gt,Pt)}),indentSelection:Zs(function(dt){for(var gt=this.doc.sel.ranges,Pt=-1,Tt=0;Tt<gt.length;Tt++){var Rt=gt[Tt];if(Rt.empty())Rt.head.line>Pt&&(da(this,Rt.head.line,dt,!0),Pt=Rt.head.line,Tt==this.doc.sel.primIndex&&$u(this));else{var Bt=Rt.from(),Xt=Rt.to(),ge=Math.max(Pt,Bt.line);Pt=Math.min(this.lastLine(),Xt.line-(Xt.ch?0:1))+1;for(var te=ge;te<Pt;++te)da(this,te,dt);var Ae=this.doc.sel.ranges;Bt.ch==0&>.length==Ae.length&&Ae[Tt].from().ch>0&&_o(this.doc,Tt,new bn(Bt,Ae[Tt].to()),Ce)}}}),getTokenAt:function(dt,gt){return ho(this,dt,gt)},getLineTokens:function(dt,gt){return ho(this,Ue(dt),gt,!0)},getTokenTypeAt:function(dt){dt=qn(this.doc,dt);var gt=Ps(this,Xe(this.doc,dt.line)),Pt=0,Tt=(gt.length-1)/2,Rt=dt.ch,Bt;if(Rt==0)Bt=gt[2];else for(;;){var Xt=Pt+Tt>>1;if((Xt?gt[Xt*2-1]:0)>=Rt)Tt=Xt;else if(gt[Xt*2+1]<Rt)Pt=Xt+1;else{Bt=gt[Xt*2+2];break}}var ge=Bt?Bt.indexOf("overlay "):-1;return ge<0?Bt:ge==0?null:Bt.slice(0,ge-1)},getModeAt:function(dt){var gt=this.doc.mode;return gt.innerMode?it.innerMode(gt,this.getTokenAt(dt).state).mode:gt},getHelper:function(dt,gt){return this.getHelpers(dt,gt)[0]},getHelpers:function(dt,gt){var Pt=[];if(!ft.hasOwnProperty(gt))return Pt;var Tt=ft[gt],Rt=this.getModeAt(dt);if(typeof Rt[gt]=="string")Tt[Rt[gt]]&&Pt.push(Tt[Rt[gt]]);else if(Rt[gt])for(var Bt=0;Bt<Rt[gt].length;Bt++){var Xt=Tt[Rt[gt][Bt]];Xt&&Pt.push(Xt)}else Rt.helperType&&Tt[Rt.helperType]?Pt.push(Tt[Rt.helperType]):Tt[Rt.name]&&Pt.push(Tt[Rt.name]);for(var ge=0;ge<Tt._global.length;ge++){var te=Tt._global[ge];te.pred(Rt,this)&&Kt(Pt,te.val)==-1&&Pt.push(te.val)}return Pt},getStateAfter:function(dt,gt){var Pt=this.doc;return dt=zn(Pt,dt==null?Pt.first+Pt.size-1:dt),rs(this,dt+1,gt).state},cursorCoords:function(dt,gt){var Pt,Tt=this.doc.sel.primary();return dt==null?Pt=Tt.head:typeof dt=="object"?Pt=qn(this.doc,dt):Pt=dt?Tt.from():Tt.to(),Go(this,Pt,gt||"page")},charCoords:function(dt,gt){return Bu(this,qn(this.doc,dt),gt||"page")},coordsChar:function(dt,gt){return dt=Ff(this,dt,gt||"page"),Df(this,dt.left,dt.top)},lineAtHeight:function(dt,gt){return dt=Ff(this,{top:dt,left:0},gt||"page").top,An(this.doc,dt+this.display.viewOffset)},heightAtLine:function(dt,gt,Pt){var Tt=!1,Rt;if(typeof dt=="number"){var Bt=this.doc.first+this.doc.size-1;dt<this.doc.first?dt=this.doc.first:dt>Bt&&(dt=Bt,Tt=!0),Rt=Xe(this.doc,dt)}else Rt=dt;return Ks(this,Rt,{top:0,left:0},gt||"page",Pt||Tt).top+(Tt?this.doc.height-fo(Rt):0)},defaultTextHeight:function(){return Ou(this.display)},defaultCharWidth:function(){return fu(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(dt,gt,Pt,Tt,Rt){var Bt=this.display;dt=Go(this,qn(this.doc,dt));var Xt=dt.bottom,ge=dt.left;if(gt.style.position="absolute",gt.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(gt),Bt.sizer.appendChild(gt),Tt=="over")Xt=dt.top;else if(Tt=="above"||Tt=="near"){var te=Math.max(Bt.wrapper.clientHeight,this.doc.height),Ae=Math.max(Bt.sizer.clientWidth,Bt.lineSpace.clientWidth);(Tt=="above"||dt.bottom+gt.offsetHeight>te)&&dt.top>gt.offsetHeight?Xt=dt.top-gt.offsetHeight:dt.bottom+gt.offsetHeight<=te&&(Xt=dt.bottom),ge+gt.offsetWidth>Ae&&(ge=Ae-gt.offsetWidth)}gt.style.top=Xt+"px",gt.style.left=gt.style.right="",Rt=="right"?(ge=Bt.sizer.clientWidth-gt.offsetWidth,gt.style.right="0px"):(Rt=="left"?ge=0:Rt=="middle"&&(ge=(Bt.sizer.clientWidth-gt.offsetWidth)/2),gt.style.left=ge+"px"),Pt&&Jd(this,{left:ge,top:Xt,right:ge+gt.offsetWidth,bottom:Xt+gt.offsetHeight})},triggerOnKeyDown:Zs(Po),triggerOnKeyPress:Zs(Bs),triggerOnKeyUp:el,triggerOnMouseDown:Zs(il),execCommand:function(dt){if(nh.hasOwnProperty(dt))return nh[dt].call(null,this)},triggerElectric:Zs(function(dt){ip(this,dt)}),findPosH:function(dt,gt,Pt,Tt){var Rt=1;gt<0&&(Rt=-1,gt=-gt);for(var Bt=qn(this.doc,dt),Xt=0;Xt<gt&&(Bt=Mc(this.doc,Bt,Rt,Pt,Tt),!Bt.hitSide);++Xt);return Bt},moveH:Zs(function(dt,gt){var Pt=this;this.extendSelectionsBy(function(Tt){return Pt.display.shift||Pt.doc.extend||Tt.empty()?Mc(Pt.doc,Tt.head,dt,gt,Pt.options.rtlMoveVisually):dt<0?Tt.from():Tt.to()},cn)}),deleteH:Zs(function(dt,gt){var Pt=this.doc.sel,Tt=this.doc;Pt.somethingSelected()?Tt.replaceSelection("",null,"+delete"):gl(this,function(Rt){var Bt=Mc(Tt,Rt.head,dt,gt,!1);return dt<0?{from:Bt,to:Rt.head}:{from:Rt.head,to:Bt}})}),findPosV:function(dt,gt,Pt,Tt){var Rt=1,Bt=Tt;gt<0&&(Rt=-1,gt=-gt);for(var Xt=qn(this.doc,dt),ge=0;ge<gt;++ge){var te=Go(this,Xt,"div");if(Bt==null?Bt=te.left:te.left=Bt,Xt=wd(this,te,Rt,Pt),Xt.hitSide)break}return Xt},moveV:Zs(function(dt,gt){var Pt=this,Tt=this.doc,Rt=[],Bt=!this.display.shift&&!Tt.extend&&Tt.sel.somethingSelected();if(Tt.extendSelectionsBy(function(ge){if(Bt)return dt<0?ge.from():ge.to();var te=Go(Pt,ge.head,"div");ge.goalColumn!=null&&(te.left=ge.goalColumn),Rt.push(te.left);var Ae=wd(Pt,te,dt,gt);return gt=="page"&&ge==Tt.sel.primary()&&Of(Pt,Bu(Pt,Ae,"div").top-te.top),Ae},cn),Rt.length)for(var Xt=0;Xt<Tt.sel.ranges.length;Xt++)Tt.sel.ranges[Xt].goalColumn=Rt[Xt]}),findWordAt:function(dt){var gt=this.doc,Pt=Xe(gt,dt.line).text,Tt=dt.ch,Rt=dt.ch;if(Pt){var Bt=this.getHelper(dt,"wordChars");(dt.sticky=="before"||Rt==Pt.length)&&Tt?--Tt:++Rt;for(var Xt=Pt.charAt(Tt),ge=Ut(Xt,Bt)?function(te){return Ut(te,Bt)}:/\s/.test(Xt)?function(te){return/\s/.test(te)}:function(te){return!/\s/.test(te)&&!Ut(te)};Tt>0&&ge(Pt.charAt(Tt-1));)--Tt;for(;Rt<Pt.length&&ge(Pt.charAt(Rt));)++Rt}return new bn(Ue(dt.line,Tt),Ue(dt.line,Rt))},toggleOverwrite:function(dt){dt!=null&&dt==this.state.overwrite||((this.state.overwrite=!this.state.overwrite)?Fe(this.display.cursorDiv,"CodeMirror-overwrite"):Qt(this.display.cursorDiv,"CodeMirror-overwrite"),xo(this,"overwriteToggle",this,this.state.overwrite))},hasFocus:function(){return this.display.input.getField()==Ke()},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Zs(function(dt,gt){Vh(this,dt,gt)}),getScrollInfo:function(){var dt=this.display.scroller;return{left:dt.scrollLeft,top:dt.scrollTop,height:dt.scrollHeight-fl(this)-this.display.barHeight,width:dt.scrollWidth-fl(this)-this.display.barWidth,clientHeight:Ud(this),clientWidth:Jl(this)}},scrollIntoView:Zs(function(dt,gt){dt==null?(dt={from:this.doc.sel.primary().head,to:null},gt==null&&(gt=this.options.cursorScrollMargin)):typeof dt=="number"?dt={from:Ue(dt,0),to:null}:dt.from==null&&(dt={from:dt,to:null}),dt.to||(dt.to=dt.from),dt.margin=gt||0,dt.from.line!=null?ti(this,dt):If(this,dt.from,dt.to,dt.margin)}),setSize:Zs(function(dt,gt){var Pt=this,Tt=function(Bt){return typeof Bt=="number"||/^\d+$/.test(String(Bt))?Bt+"px":Bt};dt!=null&&(this.display.wrapper.style.width=Tt(dt)),gt!=null&&(this.display.wrapper.style.height=Tt(gt)),this.options.lineWrapping&&Xd(this);var Rt=this.display.viewFrom;this.doc.iter(Rt,this.display.viewTo,function(Bt){if(Bt.widgets){for(var Xt=0;Xt<Bt.widgets.length;Xt++)if(Bt.widgets[Xt].noHScroll){xr(Pt,Rt,"widget");break}}++Rt}),this.curOp.forceUpdate=!0,xo(this,"refresh",this)}),operation:function(dt){return so(this,dt)},startOperation:function(){return yh(this)},endOperation:function(){return Sh(this)},refresh:Zs(function(){var dt=this.display.cachedTextHeight;ts(this),this.curOp.forceUpdate=!0,Gh(this),Vh(this,this.doc.scrollLeft,this.doc.scrollTop),kt(this.display),(dt==null||Math.abs(dt-Ou(this.display))>.5||this.options.lineWrapping)&&Ni(this),xo(this,"refresh",this)}),swapDoc:Zs(function(dt){var gt=this.doc;return gt.cm=null,this.state.selectingText&&this.state.selectingText(),vi(this,dt),Gh(this),this.display.input.reset(),Vh(this,dt.scrollLeft,dt.scrollTop),this.curOp.forceScroll=!0,ni(this,"swapDoc",this,gt),gt}),phrase:function(dt){var gt=this.options.phrases;return gt&&Object.prototype.hasOwnProperty.call(gt,dt)?gt[dt]:dt},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}},qi(it),it.registerHelper=function(dt,gt,Pt){ft.hasOwnProperty(dt)||(ft[dt]=it[dt]={_global:[]}),ft[dt][gt]=Pt},it.registerGlobalHelper=function(dt,gt,Pt,Tt){it.registerHelper(dt,gt,Tt),ft[dt]._global.push({pred:Pt,val:Tt})}}function Mc(it,st,ft,dt,gt){var Pt=st,Tt=ft,Rt=Xe(it,st.line),Bt=gt&&it.direction=="rtl"?-ft:ft;function Xt(){var Pi=st.line+Bt;return Pi<it.first||Pi>=it.first+it.size?!1:(st=new Ue(Pi,st.ch,st.sticky),Rt=Xe(it,Pi))}function ge(Pi){var si;if(dt=="codepoint"){var Di=Rt.text.charCodeAt(st.ch+(dt>0?0:-1));isNaN(Di)?si=null:si=new Ue(st.line,Math.max(0,Math.min(Rt.text.length,st.ch+ft*(Di>=55296&&Di<56320?2:1))),-ft)}else gt?si=_f(it.cm,Rt,st,ft):si=As(Rt,st,ft);if(si==null)if(!Pi&&Xt())st=$d(gt,it.cm,Rt,st.line,Bt);else return!1;else st=si;return!0}if(dt=="char"||dt=="codepoint")ge();else if(dt=="column")ge(!0);else if(dt=="word"||dt=="group")for(var te=null,Ae=dt=="group",Ee=it.cm&&it.cm.getHelper(st,"wordChars"),dn=!0;!(ft<0&&!ge(!dn));dn=!1){var gn=Rt.text.charAt(st.ch)||`
|
|
`,Fn=Ut(gn,Ee)?"w":Ae&&gn==`
|
|
`?"n":!Ae||/\s/.test(gn)?null:"p";if(Ae&&!dn&&!Fn&&(Fn="s"),te&&te!=Fn){ft<0&&(ft=1,ge(),st.sticky="after");break}if(Fn&&(te=Fn),ft>0&&!ge(!dn))break}var Xn=Ho(it,st,Pt,Tt,!0);return uo(Pt,Xn)&&(Xn.hitSide=!0),Xn}function wd(it,st,ft,dt){var gt=it.doc,Pt=st.left,Tt;if(dt=="page"){var Rt=Math.min(it.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Bt=Math.max(Rt-.5*Ou(it.display),3);Tt=(ft>0?st.bottom:st.top)+ft*Bt}else dt=="line"&&(Tt=ft>0?st.bottom+3:st.top-3);for(var Xt;Xt=Df(it,Pt,Tt),!!Xt.outside;){if(ft<0?Tt<=0:Tt>=gt.height){Xt.hitSide=!0;break}Tt+=ft*5}return Xt}var Xo=function(it){this.cm=it,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new _t,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Xo.prototype.init=function(it){var st=this,ft=this,dt=ft.cm,gt=ft.div=it.lineDiv;op(gt,dt.options.spellcheck,dt.options.autocorrect,dt.options.autocapitalize);function Pt(Rt){for(var Bt=Rt.target;Bt;Bt=Bt.parentNode){if(Bt==gt)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Bt.className))break}return!1}Ci(gt,"paste",function(Rt){!Pt(Rt)||zr(dt,Rt)||np(Rt,dt)||de<=11&&setTimeout(Xs(dt,function(){return st.updateFromDOM()}),20)}),Ci(gt,"compositionstart",function(Rt){st.composing={data:Rt.data,done:!1}}),Ci(gt,"compositionupdate",function(Rt){st.composing||(st.composing={data:Rt.data,done:!1})}),Ci(gt,"compositionend",function(Rt){st.composing&&(Rt.data!=st.composing.data&&st.readFromDOMSoon(),st.composing.done=!0)}),Ci(gt,"touchstart",function(){return ft.forceCompositionEnd()}),Ci(gt,"input",function(){st.composing||st.readFromDOMSoon()});function Tt(Rt){if(!(!Pt(Rt)||zr(dt,Rt))){if(dt.somethingSelected())nf({lineWise:!1,text:dt.getSelections()}),Rt.type=="cut"&&dt.replaceSelection("",null,"cut");else if(dt.options.lineWiseCopyCut){var Bt=rp(dt);nf({lineWise:!0,text:Bt.text}),Rt.type=="cut"&&dt.operation(function(){dt.setSelections(Bt.ranges,0,Ce),dt.replaceSelection("",null,"cut")})}else return;if(Rt.clipboardData){Rt.clipboardData.clearData();var Xt=Fl.text.join(`
|
|
`);if(Rt.clipboardData.setData("Text",Xt),Rt.clipboardData.getData("Text")==Xt){Rt.preventDefault();return}}var ge=sp(),te=ge.firstChild;dt.display.lineSpace.insertBefore(ge,dt.display.lineSpace.firstChild),te.value=Fl.text.join(`
|
|
`);var Ae=document.activeElement;Rn(te),setTimeout(function(){dt.display.lineSpace.removeChild(ge),Ae.focus(),Ae==gt&&ft.showPrimarySelection()},50)}}Ci(gt,"copy",Tt),Ci(gt,"cut",Tt)},Xo.prototype.screenReaderLabelChanged=function(it){it?this.div.setAttribute("aria-label",it):this.div.removeAttribute("aria-label")},Xo.prototype.prepareSelection=function(){var it=mh(this.cm,!1);return it.focus=document.activeElement==this.div,it},Xo.prototype.showSelection=function(it,st){!it||!this.cm.display.view.length||((it.focus||st)&&this.showPrimarySelection(),this.showMultipleSelections(it))},Xo.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Xo.prototype.showPrimarySelection=function(){var it=this.getSelection(),st=this.cm,ft=st.doc.sel.primary(),dt=ft.from(),gt=ft.to();if(st.display.viewTo==st.display.viewFrom||dt.line>=st.display.viewTo||gt.line<st.display.viewFrom){it.removeAllRanges();return}var Pt=kc(st,it.anchorNode,it.anchorOffset),Tt=kc(st,it.focusNode,it.focusOffset);if(!(Pt&&!Pt.bad&&Tt&&!Tt.bad&&Gn(Kn(Pt,Tt),dt)==0&&Gn($r(Pt,Tt),gt)==0)){var Rt=st.display.view,Bt=dt.line>=st.display.viewFrom&&lg(st,dt)||{node:Rt[0].measure.map[2],offset:0},Xt=gt.line<st.display.viewTo&&lg(st,gt);if(!Xt){var ge=Rt[Rt.length-1].measure,te=ge.maps?ge.maps[ge.maps.length-1]:ge.map;Xt={node:te[te.length-1],offset:te[te.length-2]-te[te.length-3]}}if(!Bt||!Xt){it.removeAllRanges();return}var Ae=it.rangeCount&&it.getRangeAt(0),Ee;try{Ee=ue(Bt.node,Bt.offset,Xt.offset,Xt.node)}catch(dn){}Ee&&(!It&&st.state.focused?(it.collapse(Bt.node,Bt.offset),Ee.collapsed||(it.removeAllRanges(),it.addRange(Ee))):(it.removeAllRanges(),it.addRange(Ee)),Ae&&it.anchorNode==null?it.addRange(Ae):It&&this.startGracePeriod()),this.rememberSelection()}},Xo.prototype.startGracePeriod=function(){var it=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){it.gracePeriod=!1,it.selectionChanged()&&it.cm.operation(function(){return it.cm.curOp.selectionChanged=!0})},20)},Xo.prototype.showMultipleSelections=function(it){oe(this.cm.display.cursorDiv,it.cursors),oe(this.cm.display.selectionDiv,it.selection)},Xo.prototype.rememberSelection=function(){var it=this.getSelection();this.lastAnchorNode=it.anchorNode,this.lastAnchorOffset=it.anchorOffset,this.lastFocusNode=it.focusNode,this.lastFocusOffset=it.focusOffset},Xo.prototype.selectionInEditor=function(){var it=this.getSelection();if(!it.rangeCount)return!1;var st=it.getRangeAt(0).commonAncestorContainer;return ke(this.div,st)},Xo.prototype.focus=function(){this.cm.options.readOnly!="nocursor"&&((!this.selectionInEditor()||document.activeElement!=this.div)&&this.showSelection(this.prepareSelection(),!0),this.div.focus())},Xo.prototype.blur=function(){this.div.blur()},Xo.prototype.getField=function(){return this.div},Xo.prototype.supportsTouch=function(){return!0},Xo.prototype.receivedFocus=function(){var it=this;this.selectionInEditor()?this.pollSelection():so(this.cm,function(){return it.cm.curOp.selectionChanged=!0});function st(){it.cm.state.focused&&(it.pollSelection(),it.polling.set(it.cm.options.pollInterval,st))}this.polling.set(this.cm.options.pollInterval,st)},Xo.prototype.selectionChanged=function(){var it=this.getSelection();return it.anchorNode!=this.lastAnchorNode||it.anchorOffset!=this.lastAnchorOffset||it.focusNode!=this.lastFocusNode||it.focusOffset!=this.lastFocusOffset},Xo.prototype.pollSelection=function(){if(!(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged())){var it=this.getSelection(),st=this.cm;if(nt&&ve&&this.cm.display.gutterSpecs.length&&ap(it.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs}),this.blur(),this.focus();return}if(!this.composing){this.rememberSelection();var ft=kc(st,it.anchorNode,it.anchorOffset),dt=kc(st,it.focusNode,it.focusOffset);ft&&dt&&so(st,function(){ui(st.doc,Hn(ft,dt),Ce),(ft.bad||dt.bad)&&(st.curOp.selectionChanged=!0)})}}},Xo.prototype.pollContent=function(){this.readDOMTimeout!=null&&(clearTimeout(this.readDOMTimeout),this.readDOMTimeout=null);var it=this.cm,st=it.display,ft=it.doc.sel.primary(),dt=ft.from(),gt=ft.to();if(dt.ch==0&&dt.line>it.firstLine()&&(dt=Ue(dt.line-1,Xe(it.doc,dt.line-1).length)),gt.ch==Xe(it.doc,gt.line).text.length&>.line<it.lastLine()&&(gt=Ue(gt.line+1,0)),dt.line<st.viewFrom||gt.line>st.viewTo-1)return!1;var Pt,Tt,Rt;dt.line==st.viewFrom||(Pt=ua(it,dt.line))==0?(Tt=fe(st.view[0].line),Rt=st.view[0].node):(Tt=fe(st.view[Pt].line),Rt=st.view[Pt-1].node.nextSibling);var Bt=ua(it,gt.line),Xt,ge;if(Bt==st.view.length-1?(Xt=st.viewTo-1,ge=st.lineDiv.lastChild):(Xt=fe(st.view[Bt+1].line)-1,ge=st.view[Bt+1].node.previousSibling),!Rt)return!1;for(var te=it.doc.splitLines(Xf(it,Rt,ge,Tt,Xt)),Ae=Zn(it.doc,Ue(Tt,0),Ue(Xt,Xe(it.doc,Xt).text.length));te.length>1&&Ae.length>1;)if(Te(te)==Te(Ae))te.pop(),Ae.pop(),Xt--;else if(te[0]==Ae[0])te.shift(),Ae.shift(),Tt++;else break;for(var Ee=0,dn=0,gn=te[0],Fn=Ae[0],Xn=Math.min(gn.length,Fn.length);Ee<Xn&&gn.charCodeAt(Ee)==Fn.charCodeAt(Ee);)++Ee;for(var Pi=Te(te),si=Te(Ae),Di=Math.min(Pi.length-(te.length==1?Ee:0),si.length-(Ae.length==1?Ee:0));dn<Di&&Pi.charCodeAt(Pi.length-dn-1)==si.charCodeAt(si.length-dn-1);)++dn;if(te.length==1&&Ae.length==1&&Tt==dt.line)for(;Ee&&Ee>dt.ch&&Pi.charCodeAt(Pi.length-dn-1)==si.charCodeAt(si.length-dn-1);)Ee--,dn++;te[te.length-1]=Pi.slice(0,Pi.length-dn).replace(/^\u200b+/,""),te[0]=te[0].slice(Ee).replace(/\u200b+$/,"");var hr=Ue(Tt,Ee),ii=Ue(Xt,Ae.length?Te(Ae).length-dn:0);if(te.length>1||te[0]||Gn(hr,ii))return Do(it.doc,te,hr,ii,"+input"),!0},Xo.prototype.ensurePolled=function(){this.forceCompositionEnd()},Xo.prototype.reset=function(){this.forceCompositionEnd()},Xo.prototype.forceCompositionEnd=function(){this.composing&&(clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus())},Xo.prototype.readFromDOMSoon=function(){var it=this;this.readDOMTimeout==null&&(this.readDOMTimeout=setTimeout(function(){if(it.readDOMTimeout=null,it.composing)if(it.composing.done)it.composing=null;else return;it.updateFromDOM()},80))},Xo.prototype.updateFromDOM=function(){var it=this;(this.cm.isReadOnly()||!this.pollContent())&&so(this.cm,function(){return ts(it.cm)})},Xo.prototype.setUneditable=function(it){it.contentEditable="false"},Xo.prototype.onKeyPress=function(it){it.charCode==0||this.composing||(it.preventDefault(),this.cm.isReadOnly()||Xs(this.cm,Lc)(this.cm,String.fromCharCode(it.charCode==null?it.keyCode:it.charCode),0))},Xo.prototype.readOnlyChanged=function(it){this.div.contentEditable=String(it!="nocursor")},Xo.prototype.onContextMenu=function(){},Xo.prototype.resetPosition=function(){},Xo.prototype.needsContentAttribute=!0;function lg(it,st){var ft=Au(it,st.line);if(!ft||ft.hidden)return null;var dt=Xe(it.doc,st.line),gt=Kd(ft,dt,st.line),Pt=Yi(dt,it.doc.direction),Tt="left";if(Pt){var Rt=Mn(Pt,st.ch);Tt=Rt%2?"right":"left"}var Bt=bf(gt.map,st.ch,Tt);return Bt.offset=Bt.collapse=="right"?Bt.end:Bt.start,Bt}function ap(it){for(var st=it;st;st=st.parentNode)if(/CodeMirror-gutter-wrapper/.test(st.className))return!0;return!1}function Yf(it,st){return st&&(it.bad=!0),it}function Xf(it,st,ft,dt,gt){var Pt="",Tt=!1,Rt=it.doc.lineSeparator(),Bt=!1;function Xt(Ee){return function(dn){return dn.id==Ee}}function ge(){Tt&&(Pt+=Rt,Bt&&(Pt+=Rt),Tt=Bt=!1)}function te(Ee){Ee&&(ge(),Pt+=Ee)}function Ae(Ee){if(Ee.nodeType==1){var dn=Ee.getAttribute("cm-text");if(dn){te(dn);return}var gn=Ee.getAttribute("cm-marker"),Fn;if(gn){var Xn=it.findMarks(Ue(dt,0),Ue(gt+1,0),Xt(+gn));Xn.length&&(Fn=Xn[0].find(0))&&te(Zn(it.doc,Fn.from,Fn.to).join(Rt));return}if(Ee.getAttribute("contenteditable")=="false")return;var Pi=/^(pre|div|p|li|table|br)$/i.test(Ee.nodeName);if(!/^br$/i.test(Ee.nodeName)&&Ee.textContent.length==0)return;Pi&&ge();for(var si=0;si<Ee.childNodes.length;si++)Ae(Ee.childNodes[si]);/^(pre|p)$/i.test(Ee.nodeName)&&(Bt=!0),Pi&&(Tt=!0)}else Ee.nodeType==3&&te(Ee.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}for(;Ae(st),st!=ft;)st=st.nextSibling,Bt=!1;return Pt}function kc(it,st,ft){var dt;if(st==it.display.lineDiv){if(dt=it.display.lineDiv.childNodes[ft],!dt)return Yf(it.clipPos(Ue(it.display.viewTo-1)),!0);st=null,ft=0}else for(dt=st;;dt=dt.parentNode){if(!dt||dt==it.display.lineDiv)return null;if(dt.parentNode&&dt.parentNode==it.display.lineDiv)break}for(var gt=0;gt<it.display.view.length;gt++){var Pt=it.display.view[gt];if(Pt.node==dt)return hm(Pt,st,ft)}}function hm(it,st,ft){var dt=it.text.firstChild,gt=!1;if(!st||!ke(dt,st))return Yf(Ue(fe(it.line),0),!0);if(st==dt&&(gt=!0,st=dt.childNodes[ft],ft=0,!st)){var Pt=it.rest?Te(it.rest):it.line;return Yf(Ue(fe(Pt),Pt.text.length),gt)}var Tt=st.nodeType==3?st:null,Rt=st;for(!Tt&&st.childNodes.length==1&&st.firstChild.nodeType==3&&(Tt=st.firstChild,ft&&(ft=Tt.nodeValue.length));Rt.parentNode!=dt;)Rt=Rt.parentNode;var Bt=it.measure,Xt=Bt.maps;function ge(Fn,Xn,Pi){for(var si=-1;si<(Xt?Xt.length:0);si++)for(var Di=si<0?Bt.map:Xt[si],hr=0;hr<Di.length;hr+=3){var ii=Di[hr+2];if(ii==Fn||ii==Xn){var Br=fe(si<0?it.line:it.rest[si]),hs=Di[hr]+Pi;return(Pi<0||ii!=Fn)&&(hs=Di[hr+(Pi?1:0)]),Ue(Br,hs)}}}var te=ge(Tt,Rt,ft);if(te)return Yf(te,gt);for(var Ae=Rt.nextSibling,Ee=Tt?Tt.nodeValue.length-ft:0;Ae;Ae=Ae.nextSibling){if(te=ge(Ae,Ae.firstChild,0),te)return Yf(Ue(te.line,te.ch-Ee),gt);Ee+=Ae.textContent.length}for(var dn=Rt.previousSibling,gn=ft;dn;dn=dn.previousSibling){if(te=ge(dn,dn.firstChild,-1),te)return Yf(Ue(te.line,te.ch+gn),gt);gn+=dn.textContent.length}}var ia=function(it){this.cm=it,this.prevInput="",this.pollingFast=!1,this.polling=new _t,this.hasSelection=!1,this.composing=null};ia.prototype.init=function(it){var st=this,ft=this,dt=this.cm;this.createField(it);var gt=this.textarea;it.wrapper.insertBefore(this.wrapper,it.wrapper.firstChild),Nt&&(gt.style.width="0px"),Ci(gt,"input",function(){Se&&de>=9&&st.hasSelection&&(st.hasSelection=null),ft.poll()}),Ci(gt,"paste",function(Tt){zr(dt,Tt)||np(Tt,dt)||(dt.state.pasteIncoming=+new Date,ft.fastPoll())});function Pt(Tt){if(!zr(dt,Tt)){if(dt.somethingSelected())nf({lineWise:!1,text:dt.getSelections()});else if(dt.options.lineWiseCopyCut){var Rt=rp(dt);nf({lineWise:!0,text:Rt.text}),Tt.type=="cut"?dt.setSelections(Rt.ranges,null,Ce):(ft.prevInput="",gt.value=Rt.text.join(`
|
|
`),Rn(gt))}else return;Tt.type=="cut"&&(dt.state.cutIncoming=+new Date)}}Ci(gt,"cut",Pt),Ci(gt,"copy",Pt),Ci(it.scroller,"paste",function(Tt){if(!(Qa(it,Tt)||zr(dt,Tt))){if(!gt.dispatchEvent){dt.state.pasteIncoming=+new Date,ft.focus();return}var Rt=new Event("paste");Rt.clipboardData=Tt.clipboardData,gt.dispatchEvent(Rt)}}),Ci(it.lineSpace,"selectstart",function(Tt){Qa(it,Tt)||aa(Tt)}),Ci(gt,"compositionstart",function(){var Tt=dt.getCursor("from");ft.composing&&ft.composing.range.clear(),ft.composing={start:Tt,range:dt.markText(Tt,dt.getCursor("to"),{className:"CodeMirror-composing"})}}),Ci(gt,"compositionend",function(){ft.composing&&(ft.poll(),ft.composing.range.clear(),ft.composing=null)})},ia.prototype.createField=function(it){this.wrapper=sp(),this.textarea=this.wrapper.firstChild},ia.prototype.screenReaderLabelChanged=function(it){it?this.textarea.setAttribute("aria-label",it):this.textarea.removeAttribute("aria-label")},ia.prototype.prepareSelection=function(){var it=this.cm,st=it.display,ft=it.doc,dt=mh(it);if(it.options.moveInputWithCursor){var gt=Go(it,ft.sel.primary().head,"div"),Pt=st.wrapper.getBoundingClientRect(),Tt=st.lineDiv.getBoundingClientRect();dt.teTop=Math.max(0,Math.min(st.wrapper.clientHeight-10,gt.top+Tt.top-Pt.top)),dt.teLeft=Math.max(0,Math.min(st.wrapper.clientWidth-10,gt.left+Tt.left-Pt.left))}return dt},ia.prototype.showSelection=function(it){var st=this.cm,ft=st.display;oe(ft.cursorDiv,it.cursors),oe(ft.selectionDiv,it.selection),it.teTop!=null&&(this.wrapper.style.top=it.teTop+"px",this.wrapper.style.left=it.teLeft+"px")},ia.prototype.reset=function(it){if(!(this.contextMenuPending||this.composing)){var st=this.cm;if(st.somethingSelected()){this.prevInput="";var ft=st.getSelection();this.textarea.value=ft,st.state.focused&&Rn(this.textarea),Se&&de>=9&&(this.hasSelection=ft)}else it||(this.prevInput=this.textarea.value="",Se&&de>=9&&(this.hasSelection=null))}},ia.prototype.getField=function(){return this.textarea},ia.prototype.supportsTouch=function(){return!1},ia.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!et||Ke()!=this.textarea))try{this.textarea.focus()}catch(it){}},ia.prototype.blur=function(){this.textarea.blur()},ia.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},ia.prototype.receivedFocus=function(){this.slowPoll()},ia.prototype.slowPoll=function(){var it=this;this.pollingFast||this.polling.set(this.cm.options.pollInterval,function(){it.poll(),it.cm.state.focused&&it.slowPoll()})},ia.prototype.fastPoll=function(){var it=!1,st=this;st.pollingFast=!0;function ft(){var dt=st.poll();!dt&&!it?(it=!0,st.polling.set(60,ft)):(st.pollingFast=!1,st.slowPoll())}st.polling.set(20,ft)},ia.prototype.poll=function(){var it=this,st=this.cm,ft=this.textarea,dt=this.prevInput;if(this.contextMenuPending||!st.state.focused||xt(ft)&&!dt&&!this.composing||st.isReadOnly()||st.options.disableInput||st.state.keySeq)return!1;var gt=ft.value;if(gt==dt&&!st.somethingSelected())return!1;if(Se&&de>=9&&this.hasSelection===gt||ht&&/[\uf700-\uf7ff]/.test(gt))return st.display.input.reset(),!1;if(st.doc.sel==st.display.selForContextMenu){var Pt=gt.charCodeAt(0);if(Pt==8203&&!dt&&(dt="\u200B"),Pt==8666)return this.reset(),this.cm.execCommand("undo")}for(var Tt=0,Rt=Math.min(dt.length,gt.length);Tt<Rt&&dt.charCodeAt(Tt)==gt.charCodeAt(Tt);)++Tt;return so(st,function(){Lc(st,gt.slice(Tt),dt.length-Tt,null,it.composing?"*compose":null),gt.length>1e3||gt.indexOf(`
|
|
`)>-1?ft.value=it.prevInput="":it.prevInput=gt,it.composing&&(it.composing.range.clear(),it.composing.range=st.markText(it.composing.start,st.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ia.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},ia.prototype.onKeyPress=function(){Se&&de>=9&&(this.hasSelection=null),this.fastPoll()},ia.prototype.onContextMenu=function(it){var st=this,ft=st.cm,dt=ft.display,gt=st.textarea;st.contextMenuPending&&st.contextMenuPending();var Pt=Sa(ft,it),Tt=dt.scroller.scrollTop;if(!Pt||Pe)return;var Rt=ft.options.resetSelectionOnContextMenu;Rt&&ft.doc.sel.contains(Pt)==-1&&Xs(ft,ui)(ft.doc,Hn(Pt),Ce);var Bt=gt.style.cssText,Xt=st.wrapper.style.cssText,ge=st.wrapper.offsetParent.getBoundingClientRect();st.wrapper.style.cssText="position: static",gt.style.cssText=`position: absolute; width: 30px; height: 30px;
|
|
top: `+(it.clientY-ge.top-5)+"px; left: "+(it.clientX-ge.left-5)+`px;
|
|
z-index: 1000; background: `+(Se?"rgba(255, 255, 255, .05)":"transparent")+`;
|
|
outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var te;$t&&(te=window.scrollY),dt.input.focus(),$t&&window.scrollTo(null,te),dt.input.reset(),ft.somethingSelected()||(gt.value=st.prevInput=" "),st.contextMenuPending=Ee,dt.selForContextMenu=ft.doc.sel,clearTimeout(dt.detectingSelectAll);function Ae(){if(gt.selectionStart!=null){var gn=ft.somethingSelected(),Fn="\u200B"+(gn?gt.value:"");gt.value="\u21DA",gt.value=Fn,st.prevInput=gn?"":"\u200B",gt.selectionStart=1,gt.selectionEnd=Fn.length,dt.selForContextMenu=ft.doc.sel}}function Ee(){if(st.contextMenuPending==Ee&&(st.contextMenuPending=!1,st.wrapper.style.cssText=Xt,gt.style.cssText=Bt,Se&&de<9&&dt.scrollbars.setScrollTop(dt.scroller.scrollTop=Tt),gt.selectionStart!=null)){(!Se||Se&&de<9)&&Ae();var gn=0,Fn=function(){dt.selForContextMenu==ft.doc.sel&>.selectionStart==0&>.selectionEnd>0&&st.prevInput=="\u200B"?Xs(ft,lo)(ft):gn++<10?dt.detectingSelectAll=setTimeout(Fn,500):(dt.selForContextMenu=null,dt.input.reset())};dt.detectingSelectAll=setTimeout(Fn,200)}}if(Se&&de>=9&&Ae(),bt){Il(it);var dn=function(){is(window,"mouseup",dn),setTimeout(Ee,20)};Ci(window,"mouseup",dn)}else setTimeout(Ee,50)},ia.prototype.readOnlyChanged=function(it){it||this.reset(),this.textarea.disabled=it=="nocursor",this.textarea.readOnly=!!it},ia.prototype.setUneditable=function(){},ia.prototype.needsContentAttribute=!1;function dm(it,st){if(st=st?di(st):{},st.value=it.value,!st.tabindex&&it.tabIndex&&(st.tabindex=it.tabIndex),!st.placeholder&&it.placeholder&&(st.placeholder=it.placeholder),st.autofocus==null){var ft=Ke();st.autofocus=ft==it||it.getAttribute("autofocus")!=null&&ft==document.body}function dt(){it.value=Rt.getValue()}var gt;if(it.form&&(Ci(it.form,"submit",dt),!st.leaveSubmitMethodAlone)){var Pt=it.form;gt=Pt.submit;try{var Tt=Pt.submit=function(){dt(),Pt.submit=gt,Pt.submit(),Pt.submit=Tt}}catch(Bt){}}st.finishInit=function(Bt){Bt.save=dt,Bt.getTextArea=function(){return it},Bt.toTextArea=function(){Bt.toTextArea=isNaN,dt(),it.parentNode.removeChild(Bt.getWrapperElement()),it.style.display="",it.form&&(is(it.form,"submit",dt),!st.leaveSubmitMethodAlone&&typeof it.form.submit=="function"&&(it.form.submit=gt))}},it.style.display="none";var Rt=So(function(Bt){return it.parentNode.insertBefore(Bt,it.nextSibling)},st);return Rt}function Zf(it){it.off=is,it.on=Ci,it.wheelEventPixels=Tn,it.Doc=tr,it.splitLines=Qe,it.countColumn=ee,it.findColumn=Jn,it.isWordChar=At,it.Pass=Ln,it.signal=xo,it.Line=$o,it.changeEnd=Fi,it.scrollbarModel=yc,it.Pos=Ue,it.cmpPos=Gn,it.modes=gi,it.mimeModes=fi,it.resolveMode=Le,it.getMode=Ie,it.modeExtensions=le,it.extendMode=Oe,it.copyState=On,it.startState=Mi,it.innerMode=Wn,it.commands=nh,it.keyMap=Ha,it.keyName=ng,it.isModifierKey=wh,it.lookupKey=qs,it.normalizeKeyMap=Kh,it.StringStream=xe,it.SharedTextMarker=wa,it.TextMarker=se,it.LineWidget=Ls,it.e_preventDefault=aa,it.e_stopPropagation=Oa,it.e_stop=Il,it.addClass=Fe,it.contains=ke,it.rmClass=Qt,it.keyNames=_a}lm(So),Pd(So);var Jh="iter insert remove copy getEditor constructor".split(" ");for(var bc in tr.prototype)tr.prototype.hasOwnProperty(bc)&&Kt(Jh,bc)<0&&(So.prototype[bc]=function(it){return function(){return it.apply(this.doc,arguments)}}(tr.prototype[bc]));return qi(tr),So.inputStyles={textarea:ia,contenteditable:Xo},So.defineMode=function(it){!So.defaults.mode&&it!="null"&&(So.defaults.mode=it),Gi.apply(this,arguments)},So.defineMIME=br,So.defineMode("null",function(){return{token:function(it){return it.skipToEnd()}}}),So.defineMIME("text/plain","null"),So.defineExtension=function(it,st){So.prototype[it]=st},So.defineDocExtension=function(it,st){tr.prototype[it]=st},So.fromTextArea=dm,Zf(So),So.version="5.58.2",So})},49047:function(on,In,Jt){(function(It){It(Jt(4631),Jt(29589),Jt(52539))})(function(It){"use strict";It.defineMode("markdown",function(ce,Be){var qe=It.getMode(ce,"text/html"),Se=qe.name=="null";function de(ee){if(It.findModeByName){var _t=It.findModeByName(ee);_t&&(ee=_t.mime||_t.mimes[0])}var Kt=It.getMode(ce,ee);return Kt.name=="null"?null:Kt}Be.highlightFormatting===void 0&&(Be.highlightFormatting=!1),Be.maxBlockquoteDepth===void 0&&(Be.maxBlockquoteDepth=0),Be.taskLists===void 0&&(Be.taskLists=!1),Be.strikethrough===void 0&&(Be.strikethrough=!1),Be.emoji===void 0&&(Be.emoji=!1),Be.fencedCodeBlockHighlighting===void 0&&(Be.fencedCodeBlockHighlighting=!0),Be.fencedCodeBlockDefaultMode===void 0&&(Be.fencedCodeBlockDefaultMode="text/plain"),Be.xml===void 0&&(Be.xml=!0),Be.tokenTypeOverrides===void 0&&(Be.tokenTypeOverrides={});var $t={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"image",imageAltText:"image-alt-text",imageMarker:"image-marker",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough",emoji:"builtin"};for(var He in $t)$t.hasOwnProperty(He)&&Be.tokenTypeOverrides[He]&&($t[He]=Be.tokenTypeOverrides[He]);var ve=/^([*\-_])(?:\s*\1){2,}\s*$/,Pe=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,ze=/^\[(x| )\](?=\s)/i,Me=Be.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,tn=/^ {0,3}(?:\={1,}|-{2,})\s*$/,Nt=/^[^#!\[\]*_\\<>` "'(~:]+/,nt=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,et=/^\s*\[[^\]]+?\]:.*$/,ht=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u0AF0\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E42\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC9\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDF3C-\uDF3E]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]/,lt=" ";function pt(ee,_t,Kt){return _t.f=_t.inline=Kt,Kt(ee,_t)}function vt(ee,_t,Kt){return _t.f=_t.block=Kt,Kt(ee,_t)}function Ct(ee){return!ee||!/\S/.test(ee.string)}function bt(ee){if(ee.linkTitle=!1,ee.linkHref=!1,ee.linkText=!1,ee.em=!1,ee.strong=!1,ee.strikethrough=!1,ee.quote=0,ee.indentedCode=!1,ee.f==Qt){var _t=Se;if(!_t){var Kt=It.innerMode(qe,ee.htmlState);_t=Kt.mode.name=="xml"&&Kt.state.tagStart===null&&!Kt.state.context&&Kt.state.tokenize.isInText}_t&&(ee.f=Ne,ee.block=zt,ee.htmlState=null)}return ee.trailingSpace=0,ee.trailingSpaceNewLine=!1,ee.prevLine=ee.thisLine,ee.thisLine={stream:null},null}function zt(ee,_t){var Kt=ee.column()===_t.indentation,pn=Ct(_t.prevLine.stream),Ln=_t.indentedCode,Ce=_t.prevLine.hr,sn=_t.list!==!1,cn=(_t.listStack[_t.listStack.length-1]||0)+3;_t.indentedCode=!1;var Jn=_t.indentation;if(_t.indentationDiff===null&&(_t.indentationDiff=_t.indentation,sn)){for(_t.list=null;Jn<_t.listStack[_t.listStack.length-1];)_t.listStack.pop(),_t.listStack.length?_t.indentation=_t.listStack[_t.listStack.length-1]:_t.list=!1;_t.list!==!1&&(_t.indentationDiff=Jn-_t.listStack[_t.listStack.length-1])}var Sn=!pn&&!Ce&&!_t.prevLine.header&&(!sn||!Ln)&&!_t.prevLine.fencedCodeEnd,he=(_t.list===!1||Ce||pn)&&_t.indentation<=cn&&ee.match(ve),Te=null;if(_t.indentationDiff>=4&&(Ln||_t.prevLine.fencedCodeEnd||_t.prevLine.header||pn))return ee.skipToEnd(),_t.indentedCode=!0,$t.code;if(ee.eatSpace())return null;if(Kt&&_t.indentation<=cn&&(Te=ee.match(Me))&&Te[1].length<=6)return _t.quote=0,_t.header=Te[1].length,_t.thisLine.header=!0,Be.highlightFormatting&&(_t.formatting="header"),_t.f=_t.inline,oe(_t);if(_t.indentation<=cn&&ee.eat(">"))return _t.quote=Kt?1:_t.quote+1,Be.highlightFormatting&&(_t.formatting="quote"),ee.eatSpace(),oe(_t);if(!he&&!_t.setext&&Kt&&_t.indentation<=cn&&(Te=ee.match(Pe))){var Nn=Te[1]?"ol":"ul";return _t.indentation=Jn+ee.current().length,_t.list=!0,_t.quote=0,_t.listStack.push(_t.indentation),_t.em=!1,_t.strong=!1,_t.code=!1,_t.strikethrough=!1,Be.taskLists&&ee.match(ze,!1)&&(_t.taskList=!0),_t.f=_t.inline,Be.highlightFormatting&&(_t.formatting=["list","list-"+Nn]),oe(_t)}else{if(Kt&&_t.indentation<=cn&&(Te=ee.match(nt,!0)))return _t.quote=0,_t.fencedEndRE=new RegExp(Te[1]+"+ *$"),_t.localMode=Be.fencedCodeBlockHighlighting&&de(Te[2]||Be.fencedCodeBlockDefaultMode),_t.localMode&&(_t.localState=It.startState(_t.localMode)),_t.f=_t.block=ie,Be.highlightFormatting&&(_t.formatting="code-block"),_t.code=-1,oe(_t);if(_t.setext||(!Sn||!sn)&&!_t.quote&&_t.list===!1&&!_t.code&&!he&&!et.test(ee.string)&&(Te=ee.lookAhead(1))&&(Te=Te.match(tn)))return _t.setext?(_t.header=_t.setext,_t.setext=0,ee.skipToEnd(),Be.highlightFormatting&&(_t.formatting="header")):(_t.header=Te[0].charAt(0)=="="?1:2,_t.setext=_t.header),_t.thisLine.header=!0,_t.f=_t.inline,oe(_t);if(he)return ee.skipToEnd(),_t.hr=!0,_t.thisLine.hr=!0,$t.hr;if(ee.peek()==="[")return pt(ee,_t,wn)}return pt(ee,_t,_t.inline)}function Qt(ee,_t){var Kt=qe.token(ee,_t.htmlState);if(!Se){var pn=It.innerMode(qe,_t.htmlState);(pn.mode.name=="xml"&&pn.state.tagStart===null&&!pn.state.context&&pn.state.tokenize.isInText||_t.md_inside&&ee.current().indexOf(">")>-1)&&(_t.f=Ne,_t.block=zt,_t.htmlState=null)}return Kt}function ie(ee,_t){var Kt=_t.listStack[_t.listStack.length-1]||0,pn=_t.indentation<Kt,Ln=Kt+3;if(_t.fencedEndRE&&_t.indentation<=Ln&&(pn||ee.match(_t.fencedEndRE))){Be.highlightFormatting&&(_t.formatting="code-block");var Ce;return pn||(Ce=oe(_t)),_t.localMode=_t.localState=null,_t.block=zt,_t.f=Ne,_t.fencedEndRE=null,_t.code=0,_t.thisLine.fencedCodeEnd=!0,pn?vt(ee,_t,_t.block):Ce}else return _t.localMode?_t.localMode.token(ee,_t.localState):(ee.skipToEnd(),$t.code)}function oe(ee){var _t=[];if(ee.formatting){_t.push($t.formatting),typeof ee.formatting=="string"&&(ee.formatting=[ee.formatting]);for(var Kt=0;Kt<ee.formatting.length;Kt++)_t.push($t.formatting+"-"+ee.formatting[Kt]),ee.formatting[Kt]==="header"&&_t.push($t.formatting+"-"+ee.formatting[Kt]+"-"+ee.header),ee.formatting[Kt]==="quote"&&(!Be.maxBlockquoteDepth||Be.maxBlockquoteDepth>=ee.quote?_t.push($t.formatting+"-"+ee.formatting[Kt]+"-"+ee.quote):_t.push("error"))}if(ee.taskOpen)return _t.push("meta"),_t.length?_t.join(" "):null;if(ee.taskClosed)return _t.push("property"),_t.length?_t.join(" "):null;if(ee.linkHref?_t.push($t.linkHref,"url"):(ee.strong&&_t.push($t.strong),ee.em&&_t.push($t.em),ee.strikethrough&&_t.push($t.strikethrough),ee.emoji&&_t.push($t.emoji),ee.linkText&&_t.push($t.linkText),ee.code&&_t.push($t.code),ee.image&&_t.push($t.image),ee.imageAltText&&_t.push($t.imageAltText,"link"),ee.imageMarker&&_t.push($t.imageMarker)),ee.header&&_t.push($t.header,$t.header+"-"+ee.header),ee.quote&&(_t.push($t.quote),!Be.maxBlockquoteDepth||Be.maxBlockquoteDepth>=ee.quote?_t.push($t.quote+"-"+ee.quote):_t.push($t.quote+"-"+Be.maxBlockquoteDepth)),ee.list!==!1){var pn=(ee.listStack.length-1)%3;pn?pn===1?_t.push($t.list2):_t.push($t.list3):_t.push($t.list1)}return ee.trailingSpaceNewLine?_t.push("trailing-space-new-line"):ee.trailingSpace&&_t.push("trailing-space-"+(ee.trailingSpace%2?"a":"b")),_t.length?_t.join(" "):null}function re(ee,_t){if(ee.match(Nt,!0))return oe(_t)}function Ne(ee,_t){var Kt=_t.text(ee,_t);if(typeof Kt!="undefined")return Kt;if(_t.list)return _t.list=null,oe(_t);if(_t.taskList){var pn=ee.match(ze,!0)[1]===" ";return pn?_t.taskOpen=!0:_t.taskClosed=!0,Be.highlightFormatting&&(_t.formatting="task"),_t.taskList=!1,oe(_t)}if(_t.taskOpen=!1,_t.taskClosed=!1,_t.header&&ee.match(/^#+$/,!0))return Be.highlightFormatting&&(_t.formatting="header"),oe(_t);var Ln=ee.next();if(_t.linkTitle){_t.linkTitle=!1;var Ce=Ln;Ln==="("&&(Ce=")"),Ce=(Ce+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var sn="^\\s*(?:[^"+Ce+"\\\\]+|\\\\\\\\|\\\\.)"+Ce;if(ee.match(new RegExp(sn),!0))return $t.linkHref}if(Ln==="`"){var cn=_t.formatting;Be.highlightFormatting&&(_t.formatting="code"),ee.eatWhile("`");var Jn=ee.current().length;if(_t.code==0&&(!_t.quote||Jn==1))return _t.code=Jn,oe(_t);if(Jn==_t.code){var Sn=oe(_t);return _t.code=0,Sn}else return _t.formatting=cn,oe(_t)}else if(_t.code)return oe(_t);if(Ln==="\\"&&(ee.next(),Be.highlightFormatting)){var he=oe(_t),Te=$t.formatting+"-escape";return he?he+" "+Te:Te}if(Ln==="!"&&ee.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return _t.imageMarker=!0,_t.image=!0,Be.highlightFormatting&&(_t.formatting="image"),oe(_t);if(Ln==="["&&_t.imageMarker&&ee.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return _t.imageMarker=!1,_t.imageAltText=!0,Be.highlightFormatting&&(_t.formatting="image"),oe(_t);if(Ln==="]"&&_t.imageAltText){Be.highlightFormatting&&(_t.formatting="image");var he=oe(_t);return _t.imageAltText=!1,_t.image=!1,_t.inline=_t.f=ke,he}if(Ln==="["&&!_t.image)return _t.linkText&&ee.match(/^.*?\]/)||(_t.linkText=!0,Be.highlightFormatting&&(_t.formatting="link")),oe(_t);if(Ln==="]"&&_t.linkText){Be.highlightFormatting&&(_t.formatting="link");var he=oe(_t);return _t.linkText=!1,_t.inline=_t.f=ee.match(/\(.*?\)| ?\[.*?\]/,!1)?ke:Ne,he}if(Ln==="<"&&ee.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){_t.f=_t.inline=ue,Be.highlightFormatting&&(_t.formatting="link");var he=oe(_t);return he?he+=" ":he="",he+$t.linkInline}if(Ln==="<"&&ee.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){_t.f=_t.inline=ue,Be.highlightFormatting&&(_t.formatting="link");var he=oe(_t);return he?he+=" ":he="",he+$t.linkEmail}if(Be.xml&&Ln==="<"&&ee.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var Nn=ee.string.indexOf(">",ee.pos);if(Nn!=-1){var Bn=ee.string.substring(ee.start,Nn);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(Bn)&&(_t.md_inside=!0)}return ee.backUp(1),_t.htmlState=It.startState(qe),vt(ee,_t,Qt)}if(Be.xml&&Ln==="<"&&ee.match(/^\/\w*?>/))return _t.md_inside=!1,"tag";if(Ln==="*"||Ln==="_"){for(var Ht=1,Mt=ee.pos==1?" ":ee.string.charAt(ee.pos-2);Ht<3&&ee.eat(Ln);)Ht++;var wt=ee.peek()||" ",At=!/\s/.test(wt)&&(!ht.test(wt)||/\s/.test(Mt)||ht.test(Mt)),Ut=!/\s/.test(Mt)&&(!ht.test(Mt)||/\s/.test(wt)||ht.test(wt)),Et=null,be=null;if(Ht%2&&(!_t.em&&At&&(Ln==="*"||!Ut||ht.test(Mt))?Et=!0:_t.em==Ln&&Ut&&(Ln==="*"||!At||ht.test(wt))&&(Et=!1)),Ht>1&&(!_t.strong&&At&&(Ln==="*"||!Ut||ht.test(Mt))?be=!0:_t.strong==Ln&&Ut&&(Ln==="*"||!At||ht.test(wt))&&(be=!1)),be!=null||Et!=null){Be.highlightFormatting&&(_t.formatting=Et==null?"strong":be==null?"em":"strong em"),Et===!0&&(_t.em=Ln),be===!0&&(_t.strong=Ln);var Sn=oe(_t);return Et===!1&&(_t.em=!1),be===!1&&(_t.strong=!1),Sn}}else if(Ln===" "&&(ee.eat("*")||ee.eat("_"))){if(ee.peek()===" ")return oe(_t);ee.backUp(1)}if(Be.strikethrough){if(Ln==="~"&&ee.eatWhile(Ln)){if(_t.strikethrough){Be.highlightFormatting&&(_t.formatting="strikethrough");var Sn=oe(_t);return _t.strikethrough=!1,Sn}else if(ee.match(/^[^\s]/,!1))return _t.strikethrough=!0,Be.highlightFormatting&&(_t.formatting="strikethrough"),oe(_t)}else if(Ln===" "&&ee.match(/^~~/,!0)){if(ee.peek()===" ")return oe(_t);ee.backUp(2)}}if(Be.emoji&&Ln===":"&&ee.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){_t.emoji=!0,Be.highlightFormatting&&(_t.formatting="emoji");var Dn=oe(_t);return _t.emoji=!1,Dn}return Ln===" "&&(ee.match(/^ +$/,!1)?_t.trailingSpace++:_t.trailingSpace&&(_t.trailingSpaceNewLine=!0)),oe(_t)}function ue(ee,_t){var Kt=ee.next();if(Kt===">"){_t.f=_t.inline=Ne,Be.highlightFormatting&&(_t.formatting="link");var pn=oe(_t);return pn?pn+=" ":pn="",pn+$t.linkInline}return ee.match(/^[^>]+/,!0),$t.linkInline}function ke(ee,_t){if(ee.eatSpace())return null;var Kt=ee.next();return Kt==="("||Kt==="["?(_t.f=_t.inline=Fe(Kt==="("?")":"]"),Be.highlightFormatting&&(_t.formatting="link-string"),_t.linkHref=!0,oe(_t)):"error"}var Ke={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function Fe(ee){return function(_t,Kt){var pn=_t.next();if(pn===ee){Kt.f=Kt.inline=Ne,Be.highlightFormatting&&(Kt.formatting="link-string");var Ln=oe(Kt);return Kt.linkHref=!1,Ln}return _t.match(Ke[ee]),Kt.linkHref=!0,oe(Kt)}}function wn(ee,_t){return ee.match(/^([^\]\\]|\\.)*\]:/,!1)?(_t.f=Rn,ee.next(),Be.highlightFormatting&&(_t.formatting="link"),_t.linkText=!0,oe(_t)):pt(ee,_t,Ne)}function Rn(ee,_t){if(ee.match(/^\]:/,!0)){_t.f=_t.inline=$n,Be.highlightFormatting&&(_t.formatting="link");var Kt=oe(_t);return _t.linkText=!1,Kt}return ee.match(/^([^\]\\]|\\.)+/,!0),$t.linkText}function $n(ee,_t){return ee.eatSpace()?null:(ee.match(/^[^\s]+/,!0),ee.peek()===void 0?_t.linkTitle=!0:ee.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),_t.f=_t.inline=Ne,$t.linkHref+" url")}var di={startState:function(){return{f:zt,prevLine:{stream:null},thisLine:{stream:null},block:zt,htmlState:null,indentation:0,inline:Ne,text:re,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,setext:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,emoji:!1,fencedEndRE:null}},copyState:function(ee){return{f:ee.f,prevLine:ee.prevLine,thisLine:ee.thisLine,block:ee.block,htmlState:ee.htmlState&&It.copyState(qe,ee.htmlState),indentation:ee.indentation,localMode:ee.localMode,localState:ee.localMode?It.copyState(ee.localMode,ee.localState):null,inline:ee.inline,text:ee.text,formatting:!1,linkText:ee.linkText,linkTitle:ee.linkTitle,linkHref:ee.linkHref,code:ee.code,em:ee.em,strong:ee.strong,strikethrough:ee.strikethrough,emoji:ee.emoji,header:ee.header,setext:ee.setext,hr:ee.hr,taskList:ee.taskList,list:ee.list,listStack:ee.listStack.slice(0),quote:ee.quote,indentedCode:ee.indentedCode,trailingSpace:ee.trailingSpace,trailingSpaceNewLine:ee.trailingSpaceNewLine,md_inside:ee.md_inside,fencedEndRE:ee.fencedEndRE}},token:function(ee,_t){if(_t.formatting=!1,ee!=_t.thisLine.stream){if(_t.header=0,_t.hr=!1,ee.match(/^\s*$/,!0))return bt(_t),null;if(_t.prevLine=_t.thisLine,_t.thisLine={stream:ee},_t.taskList=!1,_t.trailingSpace=0,_t.trailingSpaceNewLine=!1,!_t.localState&&(_t.f=_t.block,_t.f!=Qt)){var Kt=ee.match(/^\s*/,!0)[0].replace(/\t/g,lt).length;if(_t.indentation=Kt,_t.indentationDiff=null,Kt>0)return null}}return _t.f(ee,_t)},innerMode:function(ee){return ee.block==Qt?{state:ee.htmlState,mode:qe}:ee.localState?{state:ee.localState,mode:ee.localMode}:{state:ee,mode:di}},indent:function(ee,_t,Kt){return ee.block==Qt&&qe.indent?qe.indent(ee.htmlState,_t,Kt):ee.localState&&ee.localMode.indent?ee.localMode.indent(ee.localState,_t,Kt):It.Pass},blankLine:bt,getType:oe,blockCommentStart:"<!--",blockCommentEnd:"-->",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return di},"xml"),It.defineMIME("text/markdown","markdown"),It.defineMIME("text/x-markdown","markdown")})},52539:function(on,In,Jt){(function(It){It(Jt(4631))})(function(It){"use strict";It.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-encrypted","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["asc","pgp","sig"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h","ino"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp","cs"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists\.txt$/},{name:"CoffeeScript",mimes:["application/vnd.coffeescript","text/coffeescript","text/x-coffeescript"],mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Esper",mime:"text/x-esper",mode:"sql"},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90","f95"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history)\.md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"],file:/^Jenkinsfile$/},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm","handlebars","hbs"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Pug",mime:"text/x-pug",mode:"pug",ext:["jade","pug"],alias:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"text/jinja2",mode:"jinja2",ext:["j2","jinja","jinja2"]},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb","wl","wls"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mimes:["application/n-triples","application/n-quads","text/n-triples"],mode:"ntriples",ext:["nt","nq"]},{name:"Objective-C",mime:"text/x-objectivec",mode:"clike",ext:["m"],alias:["objective-c","objc"]},{name:"Objective-C++",mime:"text/x-objectivec++",mode:"clike",ext:["mm"],alias:["objective-c++","objc++"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mimes:["text/x-php","application/x-httpd-php","application/x-httpd-php-open"],mode:"php",ext:["php","php3","php4","php5","php7","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PostgreSQL",mime:"text/x-pgsql",mode:"sql"},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r","R"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mimes:["text/x-sh","application/x-sh"],mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"SML",mime:"text/x-sml",mode:"mllike",ext:["sml","sig","fun","smackspec"]},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"SQLite",mime:"text/x-sqlite",mode:"sql"},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Stylus",mime:"text/x-styl",mode:"stylus",ext:["styl"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx","tex"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v","sv","svh"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"TypeScript-JSX",mime:"text/typescript-jsx",mode:"jsx",ext:["tsx"],alias:["tsx"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"Vue.js Component",mimes:["script/x-vue","text/x-vue"],mode:"vue",ext:["vue"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd","svg"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mimes:["text/x-yaml","text/yaml"],mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]},{name:"WebAssembly",mime:"text/webassembly",mode:"wast",ext:["wat","wast"]}];for(var ce=0;ce<It.modeInfo.length;ce++){var Be=It.modeInfo[ce];Be.mimes&&(Be.mime=Be.mimes[0])}It.findModeByMIME=function(qe){qe=qe.toLowerCase();for(var Se=0;Se<It.modeInfo.length;Se++){var de=It.modeInfo[Se];if(de.mime==qe)return de;if(de.mimes){for(var $t=0;$t<de.mimes.length;$t++)if(de.mimes[$t]==qe)return de}}if(/\+xml$/.test(qe))return It.findModeByMIME("application/xml");if(/\+json$/.test(qe))return It.findModeByMIME("application/json")},It.findModeByExtension=function(qe){qe=qe.toLowerCase();for(var Se=0;Se<It.modeInfo.length;Se++){var de=It.modeInfo[Se];if(de.ext){for(var $t=0;$t<de.ext.length;$t++)if(de.ext[$t]==qe)return de}}},It.findModeByFileName=function(qe){for(var Se=0;Se<It.modeInfo.length;Se++){var de=It.modeInfo[Se];if(de.file&&de.file.test(qe))return de}var $t=qe.lastIndexOf("."),He=$t>-1&&qe.substring($t+1,qe.length);if(He)return It.findModeByExtension(He)},It.findModeByName=function(qe){qe=qe.toLowerCase();for(var Se=0;Se<It.modeInfo.length;Se++){var de=It.modeInfo[Se];if(de.name.toLowerCase()==qe)return de;if(de.alias){for(var $t=0;$t<de.alias.length;$t++)if(de.alias[$t].toLowerCase()==qe)return de}}}})},80785:function(on,In,Jt){(function(It){It(Jt(4631))})(function(It){"use strict";It.defineMode("stex",function(ce,Be){"use strict";function qe(Nt,nt){Nt.cmdState.push(nt)}function Se(Nt){return Nt.cmdState.length>0?Nt.cmdState[Nt.cmdState.length-1]:null}function de(Nt){var nt=Nt.cmdState.pop();nt&&nt.closeBracket()}function $t(Nt){for(var nt=Nt.cmdState,et=nt.length-1;et>=0;et--){var ht=nt[et];if(ht.name!="DEFAULT")return ht}return{styleIdentifier:function(){return null}}}function He(Nt,nt,et){return function(){this.name=Nt,this.bracketNo=0,this.style=nt,this.styles=et,this.argument=null,this.styleIdentifier=function(){return this.styles[this.bracketNo-1]||null},this.openBracket=function(){return this.bracketNo++,"bracket"},this.closeBracket=function(){}}}var ve={};ve.importmodule=He("importmodule","tag",["string","builtin"]),ve.documentclass=He("documentclass","tag",["","atom"]),ve.usepackage=He("usepackage","tag",["atom"]),ve.begin=He("begin","tag",["atom"]),ve.end=He("end","tag",["atom"]),ve.label=He("label","tag",["atom"]),ve.ref=He("ref","tag",["atom"]),ve.eqref=He("eqref","tag",["atom"]),ve.cite=He("cite","tag",["atom"]),ve.bibitem=He("bibitem","tag",["atom"]),ve.Bibitem=He("Bibitem","tag",["atom"]),ve.RBibitem=He("RBibitem","tag",["atom"]),ve.DEFAULT=function(){this.name="DEFAULT",this.style="tag",this.styleIdentifier=this.openBracket=this.closeBracket=function(){}};function Pe(Nt,nt){Nt.f=nt}function ze(Nt,nt){var et;if(Nt.match(/^\\[a-zA-Z@]+/)){var ht=Nt.current().slice(1);return et=ve.hasOwnProperty(ht)?ve[ht]:ve.DEFAULT,et=new et,qe(nt,et),Pe(nt,tn),et.style}if(Nt.match(/^\\[$&%#{}_]/)||Nt.match(/^\\[,;!\/\\]/))return"tag";if(Nt.match("\\["))return Pe(nt,function(pt,vt){return Me(pt,vt,"\\]")}),"keyword";if(Nt.match("\\("))return Pe(nt,function(pt,vt){return Me(pt,vt,"\\)")}),"keyword";if(Nt.match("$$"))return Pe(nt,function(pt,vt){return Me(pt,vt,"$$")}),"keyword";if(Nt.match("$"))return Pe(nt,function(pt,vt){return Me(pt,vt,"$")}),"keyword";var lt=Nt.next();if(lt=="%")return Nt.skipToEnd(),"comment";if(lt=="}"||lt=="]"){if(et=Se(nt),et)et.closeBracket(lt),Pe(nt,tn);else return"error";return"bracket"}else return lt=="{"||lt=="["?(et=ve.DEFAULT,et=new et,qe(nt,et),"bracket"):/\d/.test(lt)?(Nt.eatWhile(/[\w.%]/),"atom"):(Nt.eatWhile(/[\w\-_]/),et=$t(nt),et.name=="begin"&&(et.argument=Nt.current()),et.styleIdentifier())}function Me(Nt,nt,et){if(Nt.eatSpace())return null;if(et&&Nt.match(et))return Pe(nt,ze),"keyword";if(Nt.match(/^\\[a-zA-Z@]+/))return"tag";if(Nt.match(/^[a-zA-Z]+/))return"variable-2";if(Nt.match(/^\\[$&%#{}_]/)||Nt.match(/^\\[,;!\/]/)||Nt.match(/^[\^_&]/))return"tag";if(Nt.match(/^[+\-<>|=,\/@!*:;'"`~#?]/))return null;if(Nt.match(/^(\d+\.\d*|\d*\.\d+|\d+)/))return"number";var ht=Nt.next();return ht=="{"||ht=="}"||ht=="["||ht=="]"||ht=="("||ht==")"?"bracket":ht=="%"?(Nt.skipToEnd(),"comment"):"error"}function tn(Nt,nt){var et=Nt.peek(),ht;return et=="{"||et=="["?(ht=Se(nt),ht.openBracket(et),Nt.eat(et),Pe(nt,ze),"bracket"):/[ \t\r]/.test(et)?(Nt.eat(et),null):(Pe(nt,ze),de(nt),ze(Nt,nt))}return{startState:function(){var Nt=Be.inMathMode?function(nt,et){return Me(nt,et)}:ze;return{cmdState:[],f:Nt}},copyState:function(Nt){return{cmdState:Nt.cmdState.slice(),f:Nt.f}},token:function(Nt,nt){return nt.f(Nt,nt)},blankLine:function(Nt){Nt.f=ze,Nt.cmdState.length=0},lineComment:"%"}}),It.defineMIME("text/x-stex","stex"),It.defineMIME("text/x-latex","stex")})},29589:function(on,In,Jt){(function(It){It(Jt(4631))})(function(It){"use strict";var ce={autoSelfClosers:{area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},implicitlyClosed:{dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},contextGrabbers:{dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}},doNotIndent:{pre:!0},allowUnquoted:!0,allowMissing:!0,caseFold:!0},Be={autoSelfClosers:{},implicitlyClosed:{},contextGrabbers:{},doNotIndent:{},allowUnquoted:!1,allowMissing:!1,allowMissingTagName:!1,caseFold:!1};It.defineMode("xml",function(qe,Se){var de=qe.indentUnit,$t={},He=Se.htmlMode?ce:Be;for(var ve in He)$t[ve]=He[ve];for(var ve in Se)$t[ve]=Se[ve];var Pe,ze;function Me(ue,ke){function Ke(Rn){return ke.tokenize=Rn,Rn(ue,ke)}var Fe=ue.next();if(Fe=="<")return ue.eat("!")?ue.eat("[")?ue.match("CDATA[")?Ke(nt("atom","]]>")):null:ue.match("--")?Ke(nt("comment","-->")):ue.match("DOCTYPE",!0,!0)?(ue.eatWhile(/[\w\._\-]/),Ke(et(1))):null:ue.eat("?")?(ue.eatWhile(/[\w\._\-]/),ke.tokenize=nt("meta","?>"),"meta"):(Pe=ue.eat("/")?"closeTag":"openTag",ke.tokenize=tn,"tag bracket");if(Fe=="&"){var wn;return ue.eat("#")?ue.eat("x")?wn=ue.eatWhile(/[a-fA-F\d]/)&&ue.eat(";"):wn=ue.eatWhile(/[\d]/)&&ue.eat(";"):wn=ue.eatWhile(/[\w\.\-:]/)&&ue.eat(";"),wn?"atom":"error"}else return ue.eatWhile(/[^&<]/),null}Me.isInText=!0;function tn(ue,ke){var Ke=ue.next();if(Ke==">"||Ke=="/"&&ue.eat(">"))return ke.tokenize=Me,Pe=Ke==">"?"endTag":"selfcloseTag","tag bracket";if(Ke=="=")return Pe="equals",null;if(Ke=="<"){ke.tokenize=Me,ke.state=vt,ke.tagName=ke.tagStart=null;var Fe=ke.tokenize(ue,ke);return Fe?Fe+" tag error":"tag error"}else return/[\'\"]/.test(Ke)?(ke.tokenize=Nt(Ke),ke.stringStartCol=ue.column(),ke.tokenize(ue,ke)):(ue.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function Nt(ue){var ke=function(Ke,Fe){for(;!Ke.eol();)if(Ke.next()==ue){Fe.tokenize=tn;break}return"string"};return ke.isInAttribute=!0,ke}function nt(ue,ke){return function(Ke,Fe){for(;!Ke.eol();){if(Ke.match(ke)){Fe.tokenize=Me;break}Ke.next()}return ue}}function et(ue){return function(ke,Ke){for(var Fe;(Fe=ke.next())!=null;){if(Fe=="<")return Ke.tokenize=et(ue+1),Ke.tokenize(ke,Ke);if(Fe==">")if(ue==1){Ke.tokenize=Me;break}else return Ke.tokenize=et(ue-1),Ke.tokenize(ke,Ke)}return"meta"}}function ht(ue,ke,Ke){this.prev=ue.context,this.tagName=ke,this.indent=ue.indented,this.startOfLine=Ke,($t.doNotIndent.hasOwnProperty(ke)||ue.context&&ue.context.noIndent)&&(this.noIndent=!0)}function lt(ue){ue.context&&(ue.context=ue.context.prev)}function pt(ue,ke){for(var Ke;;){if(!ue.context||(Ke=ue.context.tagName,!$t.contextGrabbers.hasOwnProperty(Ke)||!$t.contextGrabbers[Ke].hasOwnProperty(ke)))return;lt(ue)}}function vt(ue,ke,Ke){return ue=="openTag"?(Ke.tagStart=ke.column(),Ct):ue=="closeTag"?bt:vt}function Ct(ue,ke,Ke){return ue=="word"?(Ke.tagName=ke.current(),ze="tag",ie):$t.allowMissingTagName&&ue=="endTag"?(ze="tag bracket",ie(ue,ke,Ke)):(ze="error",Ct)}function bt(ue,ke,Ke){if(ue=="word"){var Fe=ke.current();return Ke.context&&Ke.context.tagName!=Fe&&$t.implicitlyClosed.hasOwnProperty(Ke.context.tagName)&<(Ke),Ke.context&&Ke.context.tagName==Fe||$t.matchClosing===!1?(ze="tag",zt):(ze="tag error",Qt)}else return $t.allowMissingTagName&&ue=="endTag"?(ze="tag bracket",zt(ue,ke,Ke)):(ze="error",Qt)}function zt(ue,ke,Ke){return ue!="endTag"?(ze="error",zt):(lt(Ke),vt)}function Qt(ue,ke,Ke){return ze="error",zt(ue,ke,Ke)}function ie(ue,ke,Ke){if(ue=="word")return ze="attribute",oe;if(ue=="endTag"||ue=="selfcloseTag"){var Fe=Ke.tagName,wn=Ke.tagStart;return Ke.tagName=Ke.tagStart=null,ue=="selfcloseTag"||$t.autoSelfClosers.hasOwnProperty(Fe)?pt(Ke,Fe):(pt(Ke,Fe),Ke.context=new ht(Ke,Fe,wn==Ke.indented)),vt}return ze="error",ie}function oe(ue,ke,Ke){return ue=="equals"?re:($t.allowMissing||(ze="error"),ie(ue,ke,Ke))}function re(ue,ke,Ke){return ue=="string"?Ne:ue=="word"&&$t.allowUnquoted?(ze="string",ie):(ze="error",ie(ue,ke,Ke))}function Ne(ue,ke,Ke){return ue=="string"?Ne:ie(ue,ke,Ke)}return{startState:function(ue){var ke={tokenize:Me,state:vt,indented:ue||0,tagName:null,tagStart:null,context:null};return ue!=null&&(ke.baseIndent=ue),ke},token:function(ue,ke){if(!ke.tagName&&ue.sol()&&(ke.indented=ue.indentation()),ue.eatSpace())return null;Pe=null;var Ke=ke.tokenize(ue,ke);return(Ke||Pe)&&Ke!="comment"&&(ze=null,ke.state=ke.state(Pe||Ke,ue,ke),ze&&(Ke=ze=="error"?Ke+" error":ze)),Ke},indent:function(ue,ke,Ke){var Fe=ue.context;if(ue.tokenize.isInAttribute)return ue.tagStart==ue.indented?ue.stringStartCol+1:ue.indented+de;if(Fe&&Fe.noIndent)return It.Pass;if(ue.tokenize!=tn&&ue.tokenize!=Me)return Ke?Ke.match(/^(\s*)/)[0].length:0;if(ue.tagName)return $t.multilineTagIndentPastTag!==!1?ue.tagStart+ue.tagName.length+2:ue.tagStart+de*($t.multilineTagIndentFactor||1);if($t.alignCDATA&&/<!\[CDATA\[/.test(ke))return 0;var wn=ke&&/^<(\/)?([\w_:\.-]*)/.exec(ke);if(wn&&wn[1])for(;Fe;)if(Fe.tagName==wn[2]){Fe=Fe.prev;break}else if($t.implicitlyClosed.hasOwnProperty(Fe.tagName))Fe=Fe.prev;else break;else if(wn)for(;Fe;){var Rn=$t.contextGrabbers[Fe.tagName];if(Rn&&Rn.hasOwnProperty(wn[2]))Fe=Fe.prev;else break}for(;Fe&&Fe.prev&&!Fe.startOfLine;)Fe=Fe.prev;return Fe?Fe.indent+de:ue.baseIndent||0},electricInput:/<\/[\s\w:]+>$/,blockCommentStart:"<!--",blockCommentEnd:"-->",configuration:$t.htmlMode?"html":"xml",helperType:$t.htmlMode?"html":"xml",skipAttribute:function(ue){ue.state==re&&(ue.state=ie)},xmlCurrentTag:function(ue){return ue.tagName?{name:ue.tagName,close:ue.type=="closeTag"}:null},xmlCurrentContext:function(ue){for(var ke=[],Ke=ue.context;Ke;Ke=Ke.prev)Ke.tagName&&ke.push(Ke.tagName);return ke.reverse()}}}),It.defineMIME("text/xml","xml"),It.defineMIME("application/xml","xml"),It.mimeModes.hasOwnProperty("text/html")||It.defineMIME("text/html",{name:"xml",htmlMode:!0})})},23495:function(on,In,Jt){"use strict";Jt.d(In,{$u:function(){return ve},BD:function(){return Ht},E9:function(){return He},FF:function(){return Xl},FJ:function(){return vt},Hn:function(){return pt},KX:function(){return bt},NB:function(){return ei},S0:function(){return Te},UL:function(){return Pe},Vk:function(){return lt},Vm:function(){return Mn},YI:function(){return Nn},ZA:function(){return Be},Zt:function(){return ze},al:function(){return Et},bn:function(){return Ut},bx:function(){return Mt},g2:function(){return Bn},h1:function(){return re},hD:function(){return qi},l4:function(){return de},rU:function(){return Qi},s_:function(){return wt},uz:function(){return yi},z6:function(){return Me}}),on=Jt.hmd(on),function(){var xt;function En(a){var y=0;return function(){return y<a.length?{done:!1,value:a[y++]}:{done:!0}}}function mn(a){var y=typeof Symbol!="undefined"&&Symbol.iterator&&a[Symbol.iterator];return y?y.call(a):{next:En(a)}}function bi(a){for(var y,x=[];!(y=a.next()).done;)x.push(y.value);return x}var gi=typeof Object.create=="function"?Object.create:function(a){function y(){}return y.prototype=a,new y},fi;if(typeof Object.setPrototypeOf=="function")fi=Object.setPrototypeOf;else{var Gi;t:{var br={a:!0},Le={};try{Le.__proto__=br,Gi=Le.a;break t}catch(a){}Gi=!1}fi=Gi?function(a,y){if(a.__proto__=y,a.__proto__!==y)throw new TypeError(a+" is not extensible");return a}:null}var Ie=fi;function le(a,y){if(a.prototype=gi(y.prototype),a.prototype.constructor=a,Ie)Ie(a,y);else for(var x in y)if(x!="prototype")if(Object.defineProperties){var b=Object.getOwnPropertyDescriptor(y,x);b&&Object.defineProperty(a,x,b)}else a[x]=y[x];a.QA=y.prototype}var Oe=typeof Jt.g!="undefined"&&Jt.g!=null?Jt.g:self,On=typeof Object.assign=="function"?Object.assign:function(a,y){for(var x=1;x<arguments.length;x++){var b=arguments[x];if(b)for(var E in b)Object.prototype.hasOwnProperty.call(b,E)&&(a[E]=b[E])}return a},Wn=typeof Object.defineProperties=="function"?Object.defineProperty:function(a,y,x){a!=Array.prototype&&a!=Object.prototype&&(a[y]=x.value)};function Mi(a,y){if(y){var x=Oe;a=a.split(".");for(var b=0;b<a.length-1;b++){var E=a[b];E in x||(x[E]={}),x=x[E]}a=a[a.length-1],b=x[a],y=y(b),y!=b&&y!=null&&Wn(x,a,{writable:!0,value:y})}}Mi("Object.assign",function(a){return a||On}),Mi("Array.prototype.fill",function(a){return a||function(y,x,b){var E=this.length||0;for(0>x&&(x=Math.max(0,E+x)),(b==null||b>E)&&(b=E),b=Number(b),0>b&&(b=Math.max(0,E+b)),x=Number(x||0);x<b;x++)this[x]=y;return this}});var xe=typeof globalThis=="object"&&globalThis||typeof Jt.g=="object"&&Jt.g.global===Jt.g&&Jt.g||typeof self=="object"&&self.self===self&&self||{};xe.requestAnimationFrame===void 0&&(xe.setImmediate===void 0?xe.requestAnimationFrame=function(a){xe.setTimeout(a,0)}:xe.requestAnimationFrame=xe.setImmediate);function Xe(){}function Zn(a,y){var x=-1;return function(){var b=this,E=arguments;x!==-1&&xe.clearTimeout(x),x=Oi(function(){x=-1,a.apply(b,E)},y)}}function Oi(a,y){return xe.setTimeout(a,y)}function an(a){return xe.document.createElement(a)}function fe(a){throw Error(a)}function An(a,y){a="The object is frozen, so its properties cannot be set: "+a.toString(),y!==void 0&&(a+=" to value: "+y),fe(a)}function ri(a,y,x,b){x=x===null?"*":typeof x=="string"?x:typeof x=="function"&&typeof x.className=="string"?x.className:"",b!==void 0&&(x+="."+b),fe(x+" is not in the range "+y+": "+a)}function Ki(a){xe.console&&xe.console.log(a)}function Ue(a){return typeof a=="object"&&a!==null}function Gn(a){return Array.isArray(a)||xe.NodeList&&a instanceof xe.NodeList||xe.HTMLCollection&&a instanceof xe.HTMLCollection}function uo(a){return Array.prototype.slice.call(a)}function zo(a,y,x){Array.isArray(a)?y>=a.length?a.push(x):a.splice(y,0,x):fe("Cannot insert an object into an HTMLCollection or NodeList: "+x+" at "+y)}function $r(a,y){Array.isArray(a)?y>=a.length?a.pop():a.splice(y,1):fe("Cannot remove an object from an HTMLCollection or NodeList at "+y)}function Kn(){var a=rs.pop();return a===void 0?[]:a}function zn(a){a.length=0,rs.push(a)}function qn(a){if(typeof a=="function"){if(a.className)return a.className;if(a.name)return a.name;var y=a.toString();if(y=y.substring(9,y.indexOf("(")).trim(),y!=="")return a._className=y}else if(Ue(a)&&a.constructor)return qn(a.constructor);return typeof a}function Ir(a){var y=a;return Ue(a)&&(a.text?y=a.text:a.name?y=a.name:a.key!==void 0?y=a.key:a.id!==void 0?y=a.id:a.constructor===Object&&(a.Text?y=a.Text:a.Name?y=a.Name:a.Key!==void 0?y=a.Key:a.Id!==void 0?y=a.Id:a.ID!==void 0&&(y=a.ID))),y===void 0?"undefined":y===null?"null":y.toString()}function no(a,y){if(a.hasOwnProperty(y))return!0;for(a=Object.getPrototypeOf(a);a&&a!==Function;){if(a.hasOwnProperty(y))return!0;var x=a.CA;if(x&&x[y])return!0;a=Object.getPrototypeOf(a)}return!1}function hn(a,y,x){Object.defineProperty(jr.prototype,a,{get:y,set:x})}function ci(a){for(var y=[],x=0;256>x;x++)y["0123456789abcdef".charAt(x>>4)+"0123456789abcdef".charAt(x&15)]=String.fromCharCode(x);a.length%2&&(a="0"+a),x=[];for(var b=0,E=0;E<a.length;E+=2)x[b++]=y[a.substr(E,2)];for(a=x.join(""),a=a===""?"0":a,y=[],x=0;256>x;x++)y[x]=x;for(x=b=0;256>x;x++)b=(b+y[x]+119)%256,E=y[x],y[x]=y[b],y[b]=E;b=x=0;for(var z="",tt=0;tt<a.length;tt++)x=(x+1)%256,b=(b+y[x])%256,E=y[x],y[x]=y[b],y[b]=E,z+=String.fromCharCode(a.charCodeAt(tt)^y[(y[x]+y[b])%256]);return z.indexOf("GoJS 2.1 evaluation")>-1||z.indexOf("\xA9 1998-2021 Northwoods Software")>-1||z.indexOf("Not for distribution or production use")>-1||z.indexOf("gojs.net")>-1?"":z}var Za=xe.navigator!==void 0&&0<xe.navigator.userAgent.indexOf("Trident/7"),Ps=xe.navigator!==void 0&&xe.navigator.platform!==void 0&&xe.navigator.platform.match(/(iPhone|iPod|iPad|Mac)/i)!==null,rs=[];Object.freeze([]),Xe.className="Util",Xe.Dx="32ab5ff3b26f42dc0ed90f21472913b5",Xe.adym="gojs.net",Xe.vfo="28e645fdb266",Xe.className="Util";function me(a,y,x){qr(this),this.j=a,this.xa=y,this.o=x}me.prototype.toString=function(){return"EnumValue."+this.xa};function xi(a,y){return y==null||y===""?null:a[y]}Oe.Object.defineProperties(me.prototype,{classType:{get:function(){return this.j}},name:{get:function(){return this.xa}},value:{get:function(){return this.o}}}),me.className="EnumValue";function gr(){this.ew=[]}gr.prototype.toString=function(){return this.ew.join("")},gr.prototype.add=function(a){a!==""&&this.ew.push(a)},gr.className="StringBuilder";function ai(){}ai.className="PropertyCollection";var ho={EA:!1,JA:!1,GA:!1,IA:!1,NA:!1,LA:!1,nx:!1,FA:null,trace:function(a){xe.console&&xe.console.log(a)},HA:function(a,y,x,b){a.strokeStyle="red",a.fillStyle="red",a.font="8px sans-serif",a.beginPath(),a.moveTo(-10,0),a.lineTo(10,0),a.moveTo(0,-10),a.lineTo(0,10),a.stroke(),a.setTransform(1,0,0,1,0,0),a.scale(x,x),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.lineWidth=2,a.beginPath(),a.moveTo(b.left,b.top+20),a.lineTo(b.left,b.top),a.lineTo(b.left+20,b.top),a.moveTo(b.right,b.bottom-20),a.lineTo(b.right,b.bottom),a.lineTo(b.right-20,b.bottom),a.stroke(),a.fillText("DB: "+Math.round(b.x)+", "+Math.round(b.y)+", "+Math.round(b.width)+", "+Math.round(b.height),b.left,b.top-5)},DA:function(a){var y={},x;for(x in a){if(y.x=x,y.x!=="licenseKey"){var b=a[y.x];if(b.prototype!==void 0){y.Zl=Object.getOwnPropertyNames(b.prototype);for(var E={Tj:0};E.Tj<y.Zl.length;E={Tj:E.Tj},E.Tj++){var z=Object.getOwnPropertyDescriptor(b.prototype,y.Zl[E.Tj]);z.get!==void 0&&z.set===void 0&&Object.defineProperty(b.prototype,y.Zl[E.Tj],{set:function(tt,rt){return function(){throw Error("Property "+tt.Zl[rt.Tj]+" of "+tt.x+" is read-only.")}}(y,E)})}}}y={Zl:y.Zl,x:y.x}}}};function pr(){}pr.prototype.reset=function(){},pr.prototype.next=function(){return!1},pr.prototype.Ad=function(){return!1},pr.prototype.first=function(){return null},pr.prototype.any=function(){return!1},pr.prototype.all=function(){return!0},pr.prototype.each=function(){return this},pr.prototype.map=function(){return this},pr.prototype.filter=function(){return this},pr.prototype.de=function(){},pr.prototype.toString=function(){return"EmptyIterator"},Oe.Object.defineProperties(pr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 0}}}),pr.prototype.first=pr.prototype.first,pr.prototype.hasNext=pr.prototype.Ad,pr.prototype.next=pr.prototype.next,pr.prototype.reset=pr.prototype.reset;var Sr=null;pr.className="EmptyIterator",Sr=new pr;function lr(a){this.key=-1,this.value=a}lr.prototype.reset=function(){this.key=-1},lr.prototype.next=function(){return this.key===-1?(this.key=0,!0):!1},lr.prototype.Ad=function(){return this.next()},lr.prototype.first=function(){return this.key=0,this.value},lr.prototype.any=function(a){return this.key=-1,a(this.value)},lr.prototype.all=function(a){return this.key=-1,a(this.value)},lr.prototype.each=function(a){return this.key=-1,a(this.value),this},lr.prototype.map=function(a){return new lr(a(this.value))},lr.prototype.filter=function(a){return a(this.value)?new lr(this.value):Sr},lr.prototype.de=function(){this.value=null},lr.prototype.toString=function(){return"SingletonIterator("+this.value+")"},Oe.Object.defineProperties(lr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return 1}}}),lr.prototype.first=lr.prototype.first,lr.prototype.hasNext=lr.prototype.Ad,lr.prototype.next=lr.prototype.next,lr.prototype.reset=lr.prototype.reset,lr.className="SingletonIterator";function ur(a){this.Bb=a,this.qf=null,a.Sa=null,this.qa=a.Ja,this.Za=-1}ur.prototype.reset=function(){var a=this.Bb;a.Sa=null,this.qa=a.Ja,this.Za=-1},ur.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;a=a.s;var y=a.length,x=++this.Za,b=this.qf;if(b!==null)for(;x<y;){var E=a[x];if(b(E))return this.key=this.Za=x,this.value=E,!0;x++}else{if(x<y)return this.key=x,this.value=a[x],!0;this.de()}return!1},ur.prototype.Ad=function(){return this.next()},ur.prototype.first=function(){var a=this.Bb;this.qa=a.Ja,this.Za=0,a=a.s;var y=a.length,x=this.qf;if(x!==null){for(var b=0;b<y;){var E=a[b];if(x(E))return this.key=this.Za=b,this.value=E;b++}return null}return 0<y?(a=a[0],this.key=0,this.value=a):null},ur.prototype.any=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,b=this.qf,E=0;E<x;E++){var z=y[E];if((b===null||b(z))&&a(z))return!0}return!1},ur.prototype.all=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,b=this.qf,E=0;E<x;E++){var z=y[E];if((b===null||b(z))&&!a(z))return!1}return!0},ur.prototype.each=function(a){var y=this.Bb;y.Sa=null,this.Za=-1,y=y.s;for(var x=y.length,b=this.qf,E=0;E<x;E++){var z=y[E];(b===null||b(z))&&a(z)}return this},ur.prototype.map=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var b=y.length,E=this.qf,z=0;z<b;z++){var tt=y[z];(E===null||E(tt))&&x.push(a(tt))}return a=new Ve,a.s=x,a.xb(),a.iterator},ur.prototype.filter=function(a){var y=this.Bb;y.Sa=null,this.Za=-1;var x=[];y=y.s;for(var b=y.length,E=this.qf,z=0;z<b;z++){var tt=y[z];(E===null||E(tt))&&a(tt)&&x.push(tt)}return a=new Ve,a.s=x,a.xb(),a.iterator},ur.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.qf=null,this.Bb.Sa=this},ur.prototype.toString=function(){return"ListIterator@"+this.Za+"/"+this.Bb.count},Oe.Object.defineProperties(ur.prototype,{iterator:{get:function(){return this}},predicate:{get:function(){return this.qf},set:function(a){this.qf=a}},count:{get:function(){var a=this.qf;if(a!==null){for(var y=0,x=this.Bb.s,b=x.length,E=0;E<b;E++)a(x[E])&&y++;return y}return this.Bb.s.length}}}),ur.prototype.first=ur.prototype.first,ur.prototype.hasNext=ur.prototype.Ad,ur.prototype.next=ur.prototype.next,ur.prototype.reset=ur.prototype.reset,ur.className="ListIterator";function Wr(a){this.Bb=a,a.Hg=null,this.qa=a.Ja,this.Za=a.s.length}Wr.prototype.reset=function(){var a=this.Bb;a.Hg=null,this.qa=a.Ja,this.Za=a.s.length},Wr.prototype.next=function(){var a=this.Bb;if(a.Ja!==this.qa&&0>this.key)return!1;var y=--this.Za;return 0<=y?(this.key=y,this.value=a.s[y],!0):(this.de(),!1)},Wr.prototype.Ad=function(){return this.next()},Wr.prototype.first=function(){var a=this.Bb;this.qa=a.Ja;var y=a.s;return this.Za=a=y.length-1,0<=a?(y=y[a],this.key=a,this.value=y):null},Wr.prototype.any=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(a(y[x]))return!0;return!1},Wr.prototype.all=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)if(!a(y[x]))return!1;return!0},Wr.prototype.each=function(a){var y=this.Bb;y.Hg=null,y=y.s;var x=y.length;for(this.Za=x,--x;0<=x;x--)a(y[x]);return this},Wr.prototype.map=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var b=y.length;for(this.Za=b,--b;0<=b;b--)x.push(a(y[b]));return a=new Ve,a.s=x,a.xb(),a.iterator},Wr.prototype.filter=function(a){var y=this.Bb;y.Hg=null;var x=[];y=y.s;var b=y.length;for(this.Za=b,--b;0<=b;b--){var E=y[b];a(E)&&x.push(E)}return a=new Ve,a.s=x,a.xb(),a.iterator},Wr.prototype.de=function(){this.key=-1,this.value=null,this.qa=-1,this.Bb.Hg=this},Wr.prototype.toString=function(){return"ListIteratorBackwards("+this.Za+"/"+this.Bb.count+")"},Oe.Object.defineProperties(Wr.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.Bb.s.length}}}),Wr.prototype.first=Wr.prototype.first,Wr.prototype.hasNext=Wr.prototype.Ad,Wr.prototype.next=Wr.prototype.next,Wr.prototype.reset=Wr.prototype.reset,Wr.className="ListIteratorBackwards";function Ve(a){qr(this),this._isFrozen=!1,this.s=[],this.Ja=0,this.Hg=this.Sa=null,typeof a=="string"&&fe("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=Ve.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"List()#"+Co(this)},xt.add=function(a){return a===null?this:(this._isFrozen&&An(this,a),this.s.push(a),this.xb(),this)},xt.push=function(a){this.add(a)},xt.addAll=function(a){if(a===null)return this;this._isFrozen&&An(this);var y=this.s;if(Gn(a))for(var x=a.length,b=0;b<x;b++)y.push(a[b]);else for(a=a.iterator;a.next();)y.push(a.value);return this.xb(),this},xt.clear=function(){this._isFrozen&&An(this),this.s.length=0,this.xb()},xt.contains=function(a){return a===null?!1:this.s.indexOf(a)!==-1},xt.has=function(a){return this.contains(a)},xt.indexOf=function(a){return a===null?-1:this.s.indexOf(a)},xt.M=function(a){var y=this.s;return(0>a||a>=y.length)&&ri(a,"0 <= i < length",Ve,"elt:i"),y[a]},xt.get=function(a){return this.M(a)},xt.cd=function(a,y){var x=this.s;(0>a||a>=x.length)&&ri(a,"0 <= i < length",Ve,"setElt:i"),this._isFrozen&&An(this,a),x[a]=y},xt.set=function(a,y){this.cd(a,y)},xt.first=function(){var a=this.s;return a.length===0?null:a[0]},xt.jc=function(){var a=this.s,y=a.length;return 0<y?a[y-1]:null},xt.pop=function(){this._isFrozen&&An(this);var a=this.s;return 0<a.length?a.pop():null},Ve.prototype.any=function(a){for(var y=this.s,x=y.length,b=0;b<x;b++)if(a(y[b]))return!0;return!1},Ve.prototype.all=function(a){for(var y=this.s,x=y.length,b=0;b<x;b++)if(!a(y[b]))return!1;return!0},Ve.prototype.each=function(a){for(var y=this.s,x=y.length,b=0;b<x;b++)a(y[b]);return this},Ve.prototype.map=function(a){for(var y=new Ve,x=[],b=this.s,E=b.length,z=0;z<E;z++)x.push(a(b[z]));return y.s=x,y.xb(),y},Ve.prototype.filter=function(a){for(var y=new Ve,x=[],b=this.s,E=b.length,z=0;z<E;z++){var tt=b[z];a(tt)&&x.push(tt)}return y.s=x,y.xb(),y},xt=Ve.prototype,xt.Gb=function(a,y){0>a&&ri(a,">= 0",Ve,"insertAt:i"),this._isFrozen&&An(this,a);var x=this.s;a>=x.length?x.push(y):x.splice(a,0,y),this.xb()},xt.remove=function(a){if(a===null)return!1;this._isFrozen&&An(this,a);var y=this.s;return a=y.indexOf(a),a===-1?!1:(a===y.length-1?y.pop():y.splice(a,1),this.xb(),!0)},xt.delete=function(a){return this.remove(a)},xt.mb=function(a){var y=this.s;(0>a||a>=y.length)&&ri(a,"0 <= i < length",Ve,"removeAt:i"),this._isFrozen&&An(this,a),a===y.length-1?y.pop():y.splice(a,1),this.xb()},xt.removeRange=function(a,y){var x=this.s,b=x.length;if(0>a)a=0;else if(a>=b)return this;if(0>y)return this;if(y>=b&&(y=b-1),a>y)return this;this._isFrozen&&An(this);for(var E=a,z=y+1;z<b;)x[E++]=x[z++];return x.length=b-(y-a+1),this.xb(),this},Ve.prototype.copy=function(){var a=new Ve,y=this.s;return 0<y.length&&(a.s=Array.prototype.slice.call(y)),a},xt=Ve.prototype,xt.Fa=function(){for(var a=this.s,y=this.count,x=Array(y),b=0;b<y;b++)x[b]=a[b];return x},xt.Iv=function(){for(var a=new Ye,y=this.s,x=this.count,b=0;b<x;b++)a.add(y[b]);return a},xt.sort=function(a){return this._isFrozen&&An(this),this.s.sort(a),this.xb(),this},xt.zi=function(a,y,x){var b=this.s,E=b.length;y===void 0&&(y=0),x===void 0&&(x=E),this._isFrozen&&An(this);var z=x-y;if(1>=z)return this;if((0>y||y>=E-1)&&ri(y,"0 <= from < length",Ve,"sortRange:from"),z===2)return x=b[y],E=b[y+1],0<a(x,E)&&(b[y]=E,b[y+1]=x,this.xb()),this;if(y===0)if(x>=E)b.sort(a);else for(y=b.slice(0,x),y.sort(a),a=0;a<x;a++)b[a]=y[a];else if(x>=E)for(x=b.slice(y),x.sort(a),a=y;a<E;a++)b[a]=x[a-y];else for(E=b.slice(y,x),E.sort(a),a=y;a<x;a++)b[a]=E[a-y];return this.xb(),this},xt.reverse=function(){return this._isFrozen&&An(this),this.s.reverse(),this.xb(),this},Oe.Object.defineProperties(Ve.prototype,{_dataArray:{get:function(){return this.s}},count:{get:function(){return this.s.length}},size:{get:function(){return this.s.length}},length:{get:function(){return this.s.length}},iterator:{get:function(){if(0>=this.s.length)return Sr;var a=this.Sa;return a!==null?(a.reset(),a):new ur(this)}},iteratorBackwards:{get:function(){if(0>=this.s.length)return Sr;var a=this.Hg;return a!==null?(a.reset(),a):new Wr(this)}}}),Ve.prototype.reverse=Ve.prototype.reverse,Ve.prototype.sortRange=Ve.prototype.zi,Ve.prototype.sort=Ve.prototype.sort,Ve.prototype.toSet=Ve.prototype.Iv,Ve.prototype.toArray=Ve.prototype.Fa,Ve.prototype.removeRange=Ve.prototype.removeRange,Ve.prototype.removeAt=Ve.prototype.mb,Ve.prototype.delete=Ve.prototype.delete,Ve.prototype.remove=Ve.prototype.remove,Ve.prototype.insertAt=Ve.prototype.Gb,Ve.prototype.pop=Ve.prototype.pop,Ve.prototype.last=Ve.prototype.jc,Ve.prototype.first=Ve.prototype.first,Ve.prototype.set=Ve.prototype.set,Ve.prototype.setElt=Ve.prototype.cd,Ve.prototype.get=Ve.prototype.get,Ve.prototype.elt=Ve.prototype.M,Ve.prototype.indexOf=Ve.prototype.indexOf,Ve.prototype.has=Ve.prototype.has,Ve.prototype.contains=Ve.prototype.contains,Ve.prototype.clear=Ve.prototype.clear,Ve.prototype.addAll=Ve.prototype.addAll,Ve.prototype.push=Ve.prototype.push,Ve.prototype.add=Ve.prototype.add,Ve.prototype.thaw=Ve.prototype.ka,Ve.prototype.freeze=Ve.prototype.freeze,Ve.className="List";function Ko(a){this.eg=a,a.Sa=null,this.qa=a.Ja,this.sa=null}Ko.prototype.reset=function(){var a=this.eg;a.Sa=null,this.qa=a.Ja,this.sa=null},Ko.prototype.next=function(){var a=this.eg;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},Ko.prototype.Ad=function(){return this.next()},Ko.prototype.first=function(){var a=this.eg;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},Ko.prototype.any=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Ko.prototype.all=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Ko.prototype.each=function(a){var y=this.eg;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},Ko.prototype.map=function(a){var y=this.eg;y.Sa=null;var x=new Ve;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Ko.prototype.filter=function(a){var y=this.eg;y.Sa=null;var x=new Ve;for(y=y.ea;y!==null;){var b=y.value;a(b)&&x.add(b),y=y.va}return x.iterator},Ko.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.eg.Sa=this},Ko.prototype.toString=function(){return this.sa!==null?"SetIterator@"+this.sa.value:"SetIterator"},Oe.Object.defineProperties(Ko.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.eg.Sb}}}),Ko.prototype.first=Ko.prototype.first,Ko.prototype.hasNext=Ko.prototype.Ad,Ko.prototype.next=Ko.prototype.next,Ko.prototype.reset=Ko.prototype.reset,Ko.className="SetIterator";function Ye(a){qr(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&fe("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=Ye.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"Set()#"+Co(this)},xt.add=function(a){if(a===null)return this;this._isFrozen&&An(this,a);var y=a;return Ue(a)&&(y=ma(a)),this.Tb[y]===void 0&&(this.Sb++,a=new Ja(a,a),this.Tb[y]=a,y=this.kf,y===null?this.ea=a:(a.ll=y,y.va=a),this.kf=a,this.xb()),this},xt.addAll=function(a){if(a===null)return this;if(this._isFrozen&&An(this),Gn(a))for(var y=a.length,x=0;x<y;x++)this.add(a[x]);else for(a=a.iterator;a.next();)this.add(a.value);return this},xt.contains=function(a){if(a===null)return!1;var y=a;return Ue(a)&&(y=Co(a),y===void 0)?!1:this.Tb[y]!==void 0},xt.has=function(a){return this.contains(a)},xt.Sy=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0},xt.Ty=function(a){if(a===null)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1},xt.first=function(){var a=this.ea;return a===null?null:a.value},Ye.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Ye.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Ye.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y.value),y=y.va;return this},Ye.prototype.map=function(a){for(var y=new Ye,x=this.ea;x!==null;)y.add(a(x.value)),x=x.va;return y},Ye.prototype.filter=function(a){for(var y=new Ye,x=this.ea;x!==null;){var b=x.value;a(b)&&y.add(b),x=x.va}return y},xt=Ye.prototype,xt.remove=function(a){if(a===null)return!1;this._isFrozen&&An(this,a);var y=a;if(Ue(a)&&(y=Co(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,b=a.ll;return x!==null&&(x.ll=b),b!==null&&(b.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=b),delete this.Tb[y],this.Sb--,this.xb(),!0},xt.delete=function(a){return this.remove(a)},xt.hp=function(a){if(a===null)return this;if(this._isFrozen&&An(this),Gn(a))for(var y=a.length,x=0;x<y;x++)this.remove(a[x]);else for(a=a.iterator;a.next();)this.remove(a.value);return this},xt.pA=function(a){if(a===null||this.count===0)return this;this._isFrozen&&An(this);var y=new Ye;y.addAll(a),a=[];for(var x=this.iterator;x.next();){var b=x.value;y.contains(b)||a.push(b)}return this.hp(a),this},xt.clear=function(){this._isFrozen&&An(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.kf=this.ea=null,this.xb()},Ye.prototype.copy=function(){var a=new Ye,y=this.Tb,x;for(x in y)a.add(y[x].value);return a},Ye.prototype.Fa=function(){var a=Array(this.Sb),y=this.Tb,x=0,b;for(b in y)a[x]=y[b].value,x++;return a},Ye.prototype.Hv=function(){var a=new Ve,y=this.Tb,x;for(x in y)a.add(y[x].value);return a};function qr(a){a.__gohashid=hl++}function ma(a){var y=a.__gohashid;return y===void 0&&(y=hl++,a.__gohashid=y),y}function Co(a){return a.__gohashid}Oe.Object.defineProperties(Ye.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.Sb)return Sr;var a=this.Sa;return a!==null?(a.reset(),a):new Ko(this)}}}),Ye.prototype.toList=Ye.prototype.Hv,Ye.prototype.toArray=Ye.prototype.Fa,Ye.prototype.clear=Ye.prototype.clear,Ye.prototype.retainAll=Ye.prototype.pA,Ye.prototype.removeAll=Ye.prototype.hp,Ye.prototype.delete=Ye.prototype.delete,Ye.prototype.remove=Ye.prototype.remove,Ye.prototype.first=Ye.prototype.first,Ye.prototype.containsAny=Ye.prototype.Ty,Ye.prototype.containsAll=Ye.prototype.Sy,Ye.prototype.has=Ye.prototype.has,Ye.prototype.contains=Ye.prototype.contains,Ye.prototype.addAll=Ye.prototype.addAll,Ye.prototype.add=Ye.prototype.add,Ye.prototype.thaw=Ye.prototype.ka,Ye.prototype.freeze=Ye.prototype.freeze;var hl=1;Ye.className="Set",Ye.uniqueHash=qr,Ye.hashIdUnique=ma,Ye.hashId=Co;function Fo(a){this.ma=a,this.qa=a.Ja,this.sa=null}Fo.prototype.reset=function(){this.qa=this.ma.Ja,this.sa=null},Fo.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=this.key=a=y.key,!0):(this.de(),!1)},Fo.prototype.Ad=function(){return this.next()},Fo.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.value=this.key=a=a.key):null},Fo.prototype.any=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},Fo.prototype.all=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},Fo.prototype.each=function(a){var y=this.ma;for(this.sa=null,y=y.ea;y!==null;)a(y.key),y=y.va;return this},Fo.prototype.map=function(a){var y=this.ma;this.sa=null;var x=new Ve;for(y=y.ea;y!==null;)x.add(a(y.key)),y=y.va;return x.iterator},Fo.prototype.filter=function(a){var y=this.ma;this.sa=null;var x=new Ve;for(y=y.ea;y!==null;){var b=y.key;a(b)&&x.add(b),y=y.va}return x.iterator},Fo.prototype.de=function(){this.value=this.key=null,this.qa=-1},Fo.prototype.toString=function(){return this.sa!==null?"MapKeySetIterator@"+this.sa.value:"MapKeySetIterator"},Oe.Object.defineProperties(Fo.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Fo.prototype.first=Fo.prototype.first,Fo.prototype.hasNext=Fo.prototype.Ad,Fo.prototype.next=Fo.prototype.next,Fo.prototype.reset=Fo.prototype.reset,Fo.className="MapKeySetIterator";function vr(a){Ye.call(this),qr(this),this._isFrozen=!0,this.ma=a}le(vr,Ye),xt=vr.prototype,xt.freeze=function(){return this},xt.ka=function(){return this},xt.toString=function(){return"MapKeySet("+this.ma.toString()+")"},xt.add=function(){fe("This Set is read-only: "+this.toString())},xt.contains=function(a){return this.ma.contains(a)},xt.has=function(a){return this.contains(a)},xt.remove=function(){fe("This Set is read-only: "+this.toString())},xt.delete=function(a){return this.remove(a)},xt.clear=function(){fe("This Set is read-only: "+this.toString())},xt.first=function(){var a=this.ma.ea;return a!==null?a.key:null},vr.prototype.any=function(a){for(var y=this.ma.ea;y!==null;){if(a(y.key))return!0;y=y.va}return!1},vr.prototype.all=function(a){for(var y=this.ma.ea;y!==null;){if(!a(y.key))return!1;y=y.va}return!0},vr.prototype.each=function(a){for(var y=this.ma.ea;y!==null;)a(y.key),y=y.va;return this},vr.prototype.map=function(a){for(var y=new Ye,x=this.ma.ea;x!==null;)y.add(a(x.key)),x=x.va;return y},vr.prototype.filter=function(a){for(var y=new Ye,x=this.ma.ea;x!==null;){var b=x.key;a(b)&&y.add(b),x=x.va}return y},vr.prototype.copy=function(){return new vr(this.ma)},vr.prototype.Iv=function(){var a=new Ye,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},vr.prototype.Fa=function(){var a=this.ma.Tb,y=Array(this.ma.Sb),x=0,b;for(b in a)y[x]=a[b].key,x++;return y},vr.prototype.Hv=function(){var a=new Ve,y=this.ma.Tb,x;for(x in y)a.add(y[x].key);return a},Oe.Object.defineProperties(vr.prototype,{count:{get:function(){return this.ma.Sb}},size:{get:function(){return this.ma.Sb}},iterator:{get:function(){return 0>=this.ma.Sb?Sr:new Fo(this.ma)}}}),vr.prototype.toList=vr.prototype.Hv,vr.prototype.toArray=vr.prototype.Fa,vr.prototype.toSet=vr.prototype.Iv,vr.prototype.first=vr.prototype.first,vr.prototype.clear=vr.prototype.clear,vr.prototype.delete=vr.prototype.delete,vr.prototype.remove=vr.prototype.remove,vr.prototype.has=vr.prototype.has,vr.prototype.contains=vr.prototype.contains,vr.prototype.add=vr.prototype.add,vr.prototype.thaw=vr.prototype.ka,vr.prototype.freeze=vr.prototype.freeze,vr.className="MapKeySet";function Ao(a){this.ma=a,a.jf=null,this.qa=a.Ja,this.sa=null}Ao.prototype.reset=function(){var a=this.ma;a.jf=null,this.qa=a.Ja,this.sa=null},Ao.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.value=y.value,this.key=y.key,!0):(this.de(),!1)},Ao.prototype.Ad=function(){return this.next()},Ao.prototype.first=function(){var a=this.ma;if(this.qa=a.Ja,a=a.ea,a!==null){this.sa=a;var y=a.value;return this.key=a.key,this.value=y}return null},Ao.prototype.any=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(a(y.value))return!0;y=y.va}return!1},Ao.prototype.all=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;){if(!a(y.value))return!1;y=y.va}return!0},Ao.prototype.each=function(a){var y=this.ma;for(this.sa=y.jf=null,y=y.ea;y!==null;)a(y.value),y=y.va;return this},Ao.prototype.map=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Ve;for(y=y.ea;y!==null;)x.add(a(y.value)),y=y.va;return x.iterator},Ao.prototype.filter=function(a){var y=this.ma;this.sa=y.jf=null;var x=new Ve;for(y=y.ea;y!==null;){var b=y.value;a(b)&&x.add(b),y=y.va}return x.iterator},Ao.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.jf=this},Ao.prototype.toString=function(){return this.sa!==null?"MapValueSetIterator@"+this.sa.value:"MapValueSetIterator"},Oe.Object.defineProperties(Ao.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),Ao.prototype.first=Ao.prototype.first,Ao.prototype.hasNext=Ao.prototype.Ad,Ao.prototype.next=Ao.prototype.next,Ao.prototype.reset=Ao.prototype.reset,Ao.className="MapValueSetIterator";function Ja(a,y){this.key=a,this.value=y,this.ll=this.va=null}Ja.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"},Ja.className="KeyValuePair";function To(a){this.ma=a,a.Sa=null,this.qa=a.Ja,this.sa=null}To.prototype.reset=function(){var a=this.ma;a.Sa=null,this.qa=a.Ja,this.sa=null},To.prototype.next=function(){var a=this.ma;if(a.Ja!==this.qa&&this.key===null)return!1;var y=this.sa;return y=y===null?a.ea:y.va,y!==null?(this.sa=y,this.key=y.key,this.value=y.value,!0):(this.de(),!1)},To.prototype.Ad=function(){return this.next()},To.prototype.first=function(){var a=this.ma;return this.qa=a.Ja,a=a.ea,a!==null?(this.sa=a,this.key=a.key,this.value=a.value,a):null},To.prototype.any=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},To.prototype.all=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},To.prototype.each=function(a){var y=this.ma;for(this.sa=y.Sa=null,y=y.ea;y!==null;)a(y),y=y.va;return this},To.prototype.map=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Ve;for(y=y.ea;y!==null;)x.add(a(y)),y=y.va;return x.iterator},To.prototype.filter=function(a){var y=this.ma;this.sa=y.Sa=null;var x=new Ve;for(y=y.ea;y!==null;)a(y)&&x.add(y),y=y.va;return x.iterator},To.prototype.de=function(){this.value=this.key=null,this.qa=-1,this.ma.Sa=this},To.prototype.toString=function(){return this.sa!==null?"MapIterator@"+this.sa:"MapIterator"},Oe.Object.defineProperties(To.prototype,{iterator:{get:function(){return this}},count:{get:function(){return this.ma.Sb}}}),To.prototype.first=To.prototype.first,To.prototype.hasNext=To.prototype.Ad,To.prototype.next=To.prototype.next,To.prototype.reset=To.prototype.reset,To.className="MapIterator";function xn(a){qr(this),this._isFrozen=!1,this.Tb={},this.Sb=0,this.jf=this.Sa=null,this.Ja=0,this.kf=this.ea=null,typeof a=="string"&&fe("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type."),a!==void 0&&this.addAll(a)}xt=xn.prototype,xt.xb=function(){var a=this.Ja;a++,999999999<a&&(a=0),this.Ja=a},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.toString=function(){return"Map()#"+Co(this)},xt.add=function(a,y){this._isFrozen&&An(this,a);var x=a;Ue(a)&&(x=ma(a));var b=this.Tb[x];return b===void 0?(this.Sb++,a=new Ja(a,y),this.Tb[x]=a,x=this.kf,x===null?this.ea=a:(a.ll=x,x.va=a),this.kf=a,this.xb()):b.value=y,this},xt.set=function(a,y){return this.add(a,y)},xt.addAll=function(a){if(a===null)return this;if(Gn(a))for(var y=a.length,x=0;x<y;x++){var b=a[x];this.add(b.key,b.value)}else if(a instanceof xn)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)y=a.value,this.add(y.key,y.value);return this},xt.first=function(){return this.ea},xn.prototype.any=function(a){for(var y=this.ea;y!==null;){if(a(y))return!0;y=y.va}return!1},xn.prototype.all=function(a){for(var y=this.ea;y!==null;){if(!a(y))return!1;y=y.va}return!0},xn.prototype.each=function(a){for(var y=this.ea;y!==null;)a(y),y=y.va;return this},xn.prototype.map=function(a){for(var y=new xn,x=this.ea;x!==null;)y.add(x.key,a(x)),x=x.va;return y},xn.prototype.filter=function(a){for(var y=new xn,x=this.ea;x!==null;)a(x)&&y.add(x.key,x.value),x=x.va;return y},xt=xn.prototype,xt.contains=function(a){var y=a;return Ue(a)&&(y=Co(a),y===void 0)?!1:this.Tb[y]!==void 0},xt.has=function(a){return this.contains(a)},xt.I=function(a){var y=a;return Ue(a)&&(y=Co(a),y===void 0)?null:(a=this.Tb[y],a===void 0?null:a.value)},xt.get=function(a){return this.I(a)},xt.remove=function(a){if(a===null)return!1;this._isFrozen&&An(this,a);var y=a;if(Ue(a)&&(y=Co(a),y===void 0)||(a=this.Tb[y],a===void 0))return!1;var x=a.va,b=a.ll;return x!==null&&(x.ll=b),b!==null&&(b.va=x),this.ea===a&&(this.ea=x),this.kf===a&&(this.kf=b),delete this.Tb[y],this.Sb--,this.xb(),!0},xt.delete=function(a){return this.remove(a)},xt.clear=function(){this._isFrozen&&An(this),this.Tb={},this.Sb=0,this.Sa!==null&&this.Sa.reset(),this.jf!==null&&this.jf.reset(),this.kf=this.ea=null,this.xb()},xn.prototype.copy=function(){var a=new xn,y=this.Tb,x;for(x in y){var b=y[x];a.add(b.key,b.value)}return a},xn.prototype.Fa=function(){var a=this.Tb,y=Array(this.Sb),x=0,b;for(b in a){var E=a[b];y[x]=new Ja(E.key,E.value),x++}return y},xn.prototype.Lf=function(){return new vr(this)},Oe.Object.defineProperties(xn.prototype,{count:{get:function(){return this.Sb}},size:{get:function(){return this.Sb}},iterator:{get:function(){if(0>=this.count)return Sr;var a=this.Sa;return a!==null?(a.reset(),a):new To(this)}},iteratorKeys:{get:function(){return 0>=this.count?Sr:new Fo(this)}},iteratorValues:{get:function(){if(0>=this.count)return Sr;var a=this.jf;return a!==null?(a.reset(),a):new Ao(this)}}}),xn.prototype.toKeySet=xn.prototype.Lf,xn.prototype.toArray=xn.prototype.Fa,xn.prototype.clear=xn.prototype.clear,xn.prototype.delete=xn.prototype.delete,xn.prototype.remove=xn.prototype.remove,xn.prototype.get=xn.prototype.get,xn.prototype.getValue=xn.prototype.I,xn.prototype.has=xn.prototype.has,xn.prototype.contains=xn.prototype.contains,xn.prototype.first=xn.prototype.first,xn.prototype.addAll=xn.prototype.addAll,xn.prototype.set=xn.prototype.set,xn.prototype.add=xn.prototype.add,xn.prototype.thaw=xn.prototype.ka,xn.prototype.freeze=xn.prototype.freeze,xn.className="Map";function jt(a,y){a===void 0?this.y=this.x=0:typeof a=="number"&&typeof y=="number"?(this.x=a,this.y=y):fe("Invalid arguments to Point constructor: "+a+", "+y),this._isFrozen=!1}var cs,Eu,Fu,dl,ch;jt.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this},jt.prototype.h=function(a,y){return this.x=a,this.y=y,this},jt.prototype.sg=function(a,y){return this.x=a,this.y=y,this},jt.prototype.set=function(a){return this.x=a.x,this.y=a.y,this},jt.prototype.copy=function(){var a=new jt;return a.x=this.x,a.y=this.y,a},xt=jt.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this};function Xu(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var b=a[y++];b&&(x=parseFloat(b));for(var E=0;a[y]==="";)y++;return(b=a[y++])&&(E=parseFloat(b)),new jt(x,E)}return new jt}function ud(a){return a.x.toString()+" "+a.y.toString()}xt.toString=function(){return"Point("+this.x+","+this.y+")"},xt.D=function(a){return a instanceof jt?this.x===a.x&&this.y===a.y:!1},xt.hi=function(a,y){return this.x===a&&this.y===y},xt.Xa=function(a){return ne.B(this.x,a.x)&&ne.B(this.y,a.y)},xt.add=function(a){return this.x+=a.x,this.y+=a.y,this},xt.re=function(a){return this.x-=a.x,this.y-=a.y,this},xt.offset=function(a,y){return this.x+=a,this.y+=y,this},jt.prototype.rotate=function(a){if(a===0)return this;var y=this.x,x=this.y;if(y===0&&x===0)return this;if(360<=a?a-=360:0>a&&(a+=360),a===90){a=0;var b=1}else a===180?(a=-1,b=0):a===270?(a=0,b=-1):(b=a*Math.PI/180,a=Math.cos(b),b=Math.sin(b));return this.x=a*y-b*x,this.y=b*y+a*x,this},xt=jt.prototype,xt.scale=function(a,y){return this.x*=a,this.y*=y,this},xt.Bf=function(a){var y=a.x-this.x;return a=a.y-this.y,y*y+a*a},xt.zd=function(a,y){return a-=this.x,y-=this.y,a*a+y*y},xt.normalize=function(){var a=this.x,y=this.y,x=Math.sqrt(a*a+y*y);return 0<x&&(this.x=a/x,this.y=y/x),this},xt.ab=function(a){return jh(a.x-this.x,a.y-this.y)},xt.direction=function(a,y){return jh(a-this.x,y-this.y)};function jh(a,y){if(a===0)return 0<y?90:0>y?270:0;if(y===0)return 0<a?0:180;if(isNaN(a)||isNaN(y))return 0;var x=180*Math.atan(Math.abs(y/a))/Math.PI;return 0>a?x=0>y?x+180:180-x:0>y&&(x=360-x),x}xt.Ry=function(a,y){return ne.Fl(a.x,a.y,y.x,y.y,this.x,this.y)},xt.fA=function(a,y,x,b){return ne.qh(a,y,x,b,this.x,this.y,this),this},xt.gA=function(a,y){return ne.qh(a.x,a.y,y.x,y.y,this.x,this.y,this),this},xt.uA=function(a,y,x,b){return ne.No(this.x,this.y,a,y,x,b,this),this},xt.vA=function(a,y){return ne.No(this.x,this.y,a.x,a.y,y.width,y.height,this),this},xt.xi=function(a,y){return this.x=a.x+y.x*a.width+y.offsetX,this.y=a.y+y.y*a.height+y.offsetY,this},xt.yi=function(a,y,x,b,E){return this.x=a+E.x*x+E.offsetX,this.y=y+E.y*b+E.offsetY,this},xt.transform=function(a){return a.Ga(this),this};function Lo(a,y){return y.Cd(a),a}function gs(a,y,x,b,E,z){var tt=E-x,rt=z-b,ot=tt*tt+rt*rt;x-=a,b-=y;var at=-x*tt-b*rt;return 0>=at||at>=ot?(tt=E-a,rt=z-y,Math.min(x*x+b*b,tt*tt+rt*rt)):(a=tt*b-rt*x,a*a/ot)}function wi(a,y,x,b){return a=x-a,y=b-y,a*a+y*y}function li(a,y,x,b){return a=x-a,y=b-y,a===0?0<y?90:0>y?270:0:y===0?0<a?0:180:isNaN(a)||isNaN(y)?0:(b=180*Math.atan(Math.abs(y/a))/Math.PI,0>a?b=0>y?b+180:180-b:0>y&&(b=360-b),b)}xt.w=function(){return isFinite(this.x)&&isFinite(this.y)},jt.alloc=function(){var a=Ii.pop();return a===void 0?new jt:a},jt.allocAt=function(a,y){var x=Ii.pop();return x===void 0?new jt(a,y):(x.x=a,x.y=y,x)},jt.free=function(a){Ii.push(a)},jt.prototype.isReal=jt.prototype.w,jt.prototype.setSpot=jt.prototype.yi,jt.prototype.setRectSpot=jt.prototype.xi,jt.prototype.snapToGridPoint=jt.prototype.vA,jt.prototype.snapToGrid=jt.prototype.uA,jt.prototype.projectOntoLineSegmentPoint=jt.prototype.gA,jt.prototype.projectOntoLineSegment=jt.prototype.fA,jt.intersectingLineSegments=function(a,y,x,b,E,z,tt,rt){return ne.Rl(a,y,x,b,E,z,tt,rt)},jt.prototype.compareWithLineSegmentPoint=jt.prototype.Ry,jt.compareWithLineSegment=function(a,y,x,b,E,z){return ne.Fl(a,y,x,b,E,z)},jt.prototype.direction=jt.prototype.direction,jt.prototype.directionPoint=jt.prototype.ab,jt.prototype.normalize=jt.prototype.normalize,jt.prototype.distanceSquared=jt.prototype.zd,jt.prototype.distanceSquaredPoint=jt.prototype.Bf,jt.prototype.scale=jt.prototype.scale,jt.prototype.rotate=jt.prototype.rotate,jt.prototype.offset=jt.prototype.offset,jt.prototype.subtract=jt.prototype.re,jt.prototype.add=jt.prototype.add,jt.prototype.equalsApprox=jt.prototype.Xa,jt.prototype.equalTo=jt.prototype.hi,jt.prototype.equals=jt.prototype.D,jt.prototype.set=jt.prototype.set,jt.prototype.setTo=jt.prototype.sg;var Ii=[];jt.className="Point",jt.parse=Xu,jt.stringify=ud,jt.distanceLineSegmentSquared=gs,jt.distanceSquared=wi,jt.direction=li,jt.Origin=cs=new jt(0,0).ja(),jt.InfiniteTopLeft=Eu=new jt(-1/0,-1/0).ja(),jt.InfiniteBottomRight=Fu=new jt(1/0,1/0).ja(),jt.SixPoint=dl=new jt(6,6).ja(),jt.NoPoint=ch=new jt(NaN,NaN).ja(),jt.parse=Xu,jt.stringify=ud,jt.distanceLineSegmentSquared=gs,jt.distanceSquared=wi,jt.direction=li;function Ze(a,y){a===void 0?this.height=this.width=0:typeof a=="number"&&(0<=a||isNaN(a))&&typeof y=="number"&&(0<=y||isNaN(y))?(this.width=a,this.height=y):fe("Invalid arguments to Size constructor: "+a+", "+y),this._isFrozen=!1}var Rr,fo,ls,Mo,$o,Es,va;Ze.prototype.assign=function(a){return this.width=a.width,this.height=a.height,this},Ze.prototype.h=function(a,y){return this.width=a,this.height=y,this},Ze.prototype.sg=function(a,y){return this.width=a,this.height=y,this},Ze.prototype.set=function(a){return this.width=a.width,this.height=a.height,this},Ze.prototype.copy=function(){var a=new Ze;return a.width=this.width,a.height=this.height,a},xt=Ze.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this};function la(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var b=a[y++];b&&(x=parseFloat(b));for(var E=0;a[y]==="";)y++;return(b=a[y++])&&(E=parseFloat(b)),new Ze(x,E)}return new Ze}function Zu(a){return a.width.toString()+" "+a.height.toString()}xt.toString=function(){return"Size("+this.width+","+this.height+")"},xt.D=function(a){return a instanceof Ze?this.width===a.width&&this.height===a.height:!1},xt.hi=function(a,y){return this.width===a&&this.height===y},xt.Xa=function(a){return ne.B(this.width,a.width)&&ne.B(this.height,a.height)},xt.Bc=function(a,y){return a=this.width+a,this.width=0<=a?a:0,y=this.height+y,this.height=0<=y?y:0,this},xt.w=function(){return isFinite(this.width)&&isFinite(this.height)},Ze.alloc=function(){var a=Tu.pop();return a===void 0?new Ze:a},Ze.free=function(a){Tu.push(a)},Ze.prototype.isReal=Ze.prototype.w,Ze.prototype.inflate=Ze.prototype.Bc,Ze.prototype.equalsApprox=Ze.prototype.Xa,Ze.prototype.equalTo=Ze.prototype.hi,Ze.prototype.equals=Ze.prototype.D,Ze.prototype.set=Ze.prototype.set,Ze.prototype.setTo=Ze.prototype.sg;var Tu=[];Ze.className="Size",Ze.parse=la,Ze.stringify=Zu,Ze.ZeroSize=Rr=new Ze(0,0).ja(),Ze.OneSize=fo=new Ze(1,1).ja(),Ze.SixSize=ls=new Ze(6,6).ja(),Ze.EightSize=Mo=new Ze(8,8).ja(),Ze.TenSize=$o=new Ze(10,10).ja(),Ze.InfiniteSize=Es=new Ze(1/0,1/0).ja(),Ze.NoSize=va=new Ze(NaN,NaN).ja(),Ze.parse=la,Ze.stringify=Zu;function ye(a,y,x,b){a===void 0?this.height=this.width=this.y=this.x=0:typeof a=="number"&&typeof y=="number"&&typeof x=="number"&&(0<=x||isNaN(x))&&typeof b=="number"&&(0<=b||isNaN(b))?(this.x=a,this.y=y,this.width=x,this.height=b):a instanceof jt?(x=a.x,a=a.y,y instanceof jt?(b=y.x,y=y.y,this.x=Math.min(x,b),this.y=Math.min(a,y),this.width=Math.abs(x-b),this.height=Math.abs(a-y)):y instanceof Ze?(this.x=x,this.y=a,this.width=y.width,this.height=y.height):fe("Incorrect second argument supplied to Rect constructor "+y)):fe("Invalid arguments to Rect constructor: "+a+", "+y+", "+x+", "+b),this._isFrozen=!1}xt=ye.prototype,xt.assign=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},xt.h=function(a,y,x,b){return this.x=a,this.y=y,this.width=x,this.height=b,this};function Ra(a,y,x){a.width=y,a.height=x}xt.sg=function(a,y,x,b){return this.x=a,this.y=y,this.width=x,this.height=b,this},xt.set=function(a){return this.x=a.x,this.y=a.y,this.width=a.width,this.height=a.height,this},xt.dd=function(a){return this.x=a.x,this.y=a.y,this},xt.tA=function(a){return this.width=a.width,this.height=a.height,this},ye.prototype.copy=function(){var a=new ye;return a.x=this.x,a.y=this.y,a.width=this.width,a.height=this.height,a},xt=ye.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this};function Rl(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var b=a[y++];b&&(x=parseFloat(b));for(var E=0;a[y]==="";)y++;(b=a[y++])&&(E=parseFloat(b));for(var z=0;a[y]==="";)y++;(b=a[y++])&&(z=parseFloat(b));for(var tt=0;a[y]==="";)y++;return(b=a[y++])&&(tt=parseFloat(b)),new ye(x,E,z,tt)}return new ye}function Ju(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}xt.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"},xt.D=function(a){return a instanceof ye?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1},xt.hi=function(a,y,x,b){return this.x===a&&this.y===y&&this.width===x&&this.height===b},xt.Xa=function(a){return ne.B(this.x,a.x)&&ne.B(this.y,a.y)&&ne.B(this.width,a.width)&&ne.B(this.height,a.height)};function os(a,y){return ne.$(a.x,y.x)&&ne.$(a.y,y.y)&&ne.$(a.width,y.width)&&ne.$(a.height,y.height)}xt.ca=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y},xt.Re=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height},xt.contains=function(a,y,x,b){return x===void 0&&(x=0),b===void 0&&(b=0),this.x<=a&&a+x<=this.x+this.width&&this.y<=y&&y+b<=this.y+this.height},xt.offset=function(a,y){return this.x+=a,this.y+=y,this},xt.Bc=function(a,y){return Nu(this,y,a,y,a)},xt.Co=function(a){return Nu(this,a.top,a.right,a.bottom,a.left)},xt.Fv=function(a){return Nu(this,-a.top,-a.right,-a.bottom,-a.left)},xt.Hz=function(a,y,x,b){return Nu(this,a,y,x,b)};function Nu(a,y,x,b,E){var z=a.width;return x+E<=-z?(a.x+=z/2,a.width=0):(a.x-=E,a.width+=x+E),x=a.height,y+b<=-x?(a.y+=x/2,a.height=0):(a.y-=y,a.height+=y+b),a}xt.Ex=function(a){return hd(this,a.x,a.y,a.width,a.height)},xt.Uu=function(a,y,x,b){return hd(this,a,y,x,b)};function hd(a,y,x,b,E){var z=Math.max(a.x,y),tt=Math.max(a.y,x);return y=Math.min(a.x+a.width,y+b),x=Math.min(a.y+a.height,x+E),a.x=z,a.y=tt,a.width=Math.max(0,y-z),a.height=Math.max(0,x-tt),a}xt.Yc=function(a){return this.Vu(a.x,a.y,a.width,a.height)},xt.Vu=function(a,y,x,b){var E=this.width,z=this.x;return E!==1/0&&x!==1/0&&(E+=z,x+=a,isNaN(x)||isNaN(E)||z>x||a>E)?!1:(a=this.height,x=this.y,!(a!==1/0&&b!==1/0&&(a+=x,b+=y,isNaN(b)||isNaN(a)||x>b||y>a)))};function gh(a,y){var x=a.width,b=a.x,E=y.x-10;return b>y.width+10+10+E||E>x+b?!1:(x=a.height,a=a.y,b=y.y-10,!(a>y.height+10+10+b||b>x+a))}xt.Ye=function(a){return co(this,a.x,a.y,0,0)},xt.ed=function(a){return co(this,a.x,a.y,a.width,a.height)},xt.Kv=function(a,y,x,b){return x===void 0&&(x=0),b===void 0&&(b=0),co(this,a,y,x,b)};function co(a,y,x,b,E){var z=Math.min(a.x,y),tt=Math.min(a.y,x);return y=Math.max(a.x+a.width,y+b),x=Math.max(a.y+a.height,x+E),a.x=z,a.y=tt,a.width=y-z,a.height=x-tt,a}xt.yi=function(a,y,x){return this.x=a-x.offsetX-x.x*this.width,this.y=y-x.offsetY-x.y*this.height,this};function ps(a,y,x,b,E,z,tt,rt){return tt===void 0&&(tt=0),rt===void 0&&(rt=0),a<=E&&E+tt<=a+x&&y<=z&&z+rt<=y+b}function nr(a,y,x,b,E,z,tt,rt){return a>tt+E||E>x+a?!1:!(y>rt+z||z>b+y)}xt.w=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},xt.Mz=function(){return this.width===0&&this.height===0},ye.alloc=function(){var a=ss.pop();return a===void 0?new ye:a},ye.allocAt=function(a,y,x,b){var E=ss.pop();return E===void 0?new ye(a,y,x,b):E.h(a,y,x,b)},ye.free=function(a){ss.push(a)},Oe.Object.defineProperties(ye.prototype,{left:{get:function(){return this.x},set:function(a){this.x=a}},top:{get:function(){return this.y},set:function(a){this.y=a}},right:{get:function(){return this.x+this.width},set:function(a){this.x+=a-(this.x+this.width)}},bottom:{get:function(){return this.y+this.height},set:function(a){this.y+=a-(this.y+this.height)}},position:{get:function(){return new jt(this.x,this.y)},set:function(a){this.x=a.x,this.y=a.y}},size:{get:function(){return new Ze(this.width,this.height)},set:function(a){this.width=a.width,this.height=a.height}},center:{get:function(){return new jt(this.x+this.width/2,this.y+this.height/2)},set:function(a){this.x=a.x-this.width/2,this.y=a.y-this.height/2}},centerX:{get:function(){return this.x+this.width/2},set:function(a){this.x=a-this.width/2}},centerY:{get:function(){return this.y+this.height/2},set:function(a){this.y=a-this.height/2}}}),ye.prototype.isEmpty=ye.prototype.Mz,ye.prototype.isReal=ye.prototype.w,ye.intersectsLineSegment=function(a,y,x,b,E,z,tt,rt){return ne.Fx(a,y,x,b,E,z,tt,rt)},ye.prototype.setSpot=ye.prototype.yi,ye.prototype.union=ye.prototype.Kv,ye.prototype.unionRect=ye.prototype.ed,ye.prototype.unionPoint=ye.prototype.Ye,ye.prototype.intersects=ye.prototype.Vu,ye.prototype.intersectsRect=ye.prototype.Yc,ye.prototype.intersect=ye.prototype.Uu,ye.prototype.intersectRect=ye.prototype.Ex,ye.prototype.grow=ye.prototype.Hz,ye.prototype.subtractMargin=ye.prototype.Fv,ye.prototype.addMargin=ye.prototype.Co,ye.prototype.inflate=ye.prototype.Bc,ye.prototype.offset=ye.prototype.offset,ye.prototype.contains=ye.prototype.contains,ye.prototype.containsRect=ye.prototype.Re,ye.prototype.containsPoint=ye.prototype.ca,ye.prototype.equalsApprox=ye.prototype.Xa,ye.prototype.equalTo=ye.prototype.hi,ye.prototype.equals=ye.prototype.D,ye.prototype.setSize=ye.prototype.tA,ye.prototype.setPoint=ye.prototype.dd,ye.prototype.set=ye.prototype.set,ye.prototype.setTo=ye.prototype.sg;var mr=null,vo=null,ss=[];ye.className="Rect",ye.parse=Rl,ye.stringify=Ju,ye.contains=ps,ye.intersects=nr,ye.ZeroRect=mr=new ye(0,0,0,0).ja(),ye.NoRect=vo=new ye(NaN,NaN,NaN,NaN).ja(),ye.parse=Rl,ye.stringify=Ju,ye.contains=ps,ye.intersects=nr;function ni(a,y,x,b){a===void 0?this.left=this.bottom=this.right=this.top=0:y===void 0?this.left=this.bottom=this.right=this.top=a:x===void 0?(this.top=a,this.right=y,this.bottom=a,this.left=y):b!==void 0?(this.top=a,this.right=y,this.bottom=x,this.left=b):fe("Invalid arguments to Margin constructor: "+a+", "+y+", "+x+", "+b),this._isFrozen=!1}ni.prototype.assign=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},ni.prototype.sg=function(a,y,x,b){return this.top=a,this.right=y,this.bottom=x,this.left=b,this},ni.prototype.set=function(a){return this.top=a.top,this.right=a.right,this.bottom=a.bottom,this.left=a.left,this},ni.prototype.copy=function(){var a=new ni;return a.top=this.top,a.right=this.right,a.bottom=this.bottom,a.left=this.left,a},xt=ni.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this};function kf(a){if(typeof a=="string"){a=a.split(" ");for(var y=0,x=NaN;a[y]==="";)y++;var b=a[y++];if(b&&(x=parseFloat(b)),isNaN(x))return new ni;for(var E=NaN;a[y]==="";)y++;if((b=a[y++])&&(E=parseFloat(b)),isNaN(E))return new ni(x);for(var z=NaN;a[y]==="";)y++;if((b=a[y++])&&(z=parseFloat(b)),isNaN(z))return new ni(x,E);for(var tt=NaN;a[y]==="";)y++;return(b=a[y++])&&(tt=parseFloat(b)),isNaN(tt)?new ni(x,E):new ni(x,E,z,tt)}return new ni}function hu(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}xt.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"},xt.D=function(a){return a instanceof ni?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1},xt.hi=function(a,y,x,b){return this.top===a&&this.right===y&&this.bottom===x&&this.left===b},xt.Xa=function(a){return ne.B(this.top,a.top)&&ne.B(this.right,a.right)&&ne.B(this.bottom,a.bottom)&&ne.B(this.left,a.left)},xt.w=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)},ni.alloc=function(){var a=fd.pop();return a===void 0?new ni:a},ni.free=function(a){fd.push(a)},ni.prototype.isReal=ni.prototype.w,ni.prototype.equalsApprox=ni.prototype.Xa,ni.prototype.equalTo=ni.prototype.hi,ni.prototype.equals=ni.prototype.D,ni.prototype.set=ni.prototype.set,ni.prototype.setTo=ni.prototype.sg;var Zl=null,dd=null,fd=[];ni.className="Margin",ni.parse=kf,ni.stringify=hu,ni.ZeroMargin=Zl=new ni(0,0,0,0).ja(),ni.TwoMargin=dd=new ni(2,2,2,2).ja(),ni.parse=kf,ni.stringify=hu;function yn(a,y,x,b){a===void 0?this.offsetY=this.offsetX=this.y=this.x=0:(y===void 0&&(y=0),x===void 0&&(x=0),b===void 0&&(b=0),this.x=a,this.y=y,this.offsetX=x,this.offsetY=b),this._isFrozen=!1}var us,ms,du,cd,gd,Xi,Wd,Du,Qa,Ll,zh,pd,fl,Jl,Ud,gc,Kd,Qc,pc,Au,ph,Ql,Yd,bf,mc,vs,$c,Ef,Xd,Gh,$a,ya,js,Ks,Ff,Bu;yn.prototype.assign=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},yn.prototype.sg=function(a,y,x,b){return this.x=a,this.y=y,this.offsetX=x,this.offsetY=b,this},yn.prototype.set=function(a){return this.x=a.x,this.y=a.y,this.offsetX=a.offsetX,this.offsetY=a.offsetY,this},yn.prototype.copy=function(){var a=new yn;return a.x=this.x,a.y=this.y,a.offsetX=this.offsetX,a.offsetY=this.offsetY,a},xt=yn.prototype,xt.ja=function(){return this._isFrozen=!0,Object.freeze(this),this},xt.J=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this};function Go(a,y){return a.x=NaN,a.y=NaN,a.offsetX=y,a}function Tf(a){if(typeof a=="string"){if(a=a.trim(),a==="None")return us;if(a==="TopLeft")return ms;if(a==="Top"||a==="TopCenter"||a==="MiddleTop")return du;if(a==="TopRight")return cd;if(a==="Left"||a==="LeftCenter"||a==="MiddleLeft")return gd;if(a==="Center")return Xi;if(a==="Right"||a==="RightCenter"||a==="MiddleRight")return Wd;if(a==="BottomLeft")return Du;if(a==="Bottom"||a==="BottomCenter"||a==="MiddleBottom")return Qa;if(a==="BottomRight")return Ll;if(a==="TopSide")return zh;if(a==="LeftSide")return pd;if(a==="RightSide")return fl;if(a==="BottomSide")return Jl;if(a==="TopBottomSides")return Ud;if(a==="LeftRightSides")return gc;if(a==="TopLeftSides")return Kd;if(a==="TopRightSides")return Qc;if(a==="BottomLeftSides")return pc;if(a==="BottomRightSides")return Au;if(a==="NotTopSide")return ph;if(a==="NotLeftSide")return Ql;if(a==="NotRightSide")return Yd;if(a==="NotBottomSide")return bf;if(a==="AllSides")return mc;if(a==="Default")return vs;a=a.split(" ");for(var y=0,x=0;a[y]==="";)y++;var b=a[y++];b!==void 0&&0<b.length&&(x=parseFloat(b));for(var E=0;a[y]==="";)y++;b=a[y++],b!==void 0&&0<b.length&&(E=parseFloat(b));for(var z=0;a[y]==="";)y++;b=a[y++],b!==void 0&&0<b.length&&(z=parseFloat(b));for(var tt=0;a[y]==="";)y++;return b=a[y++],b!==void 0&&0<b.length&&(tt=parseFloat(b)),new yn(x,E,z,tt)}return new yn}function Nf(a){return a.sb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}xt.toString=function(){return this.sb()?this.offsetX===0&&this.offsetY===0?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.D(us)?"None":this.D(ms)?"TopLeft":this.D(du)?"Top":this.D(cd)?"TopRight":this.D(gd)?"Left":this.D(Xi)?"Center":this.D(Wd)?"Right":this.D(Du)?"BottomLeft":this.D(Qa)?"Bottom":this.D(Ll)?"BottomRight":this.D(zh)?"TopSide":this.D(pd)?"LeftSide":this.D(fl)?"RightSide":this.D(Jl)?"BottomSide":this.D(Ud)?"TopBottomSides":this.D(gc)?"LeftRightSides":this.D(Kd)?"TopLeftSides":this.D(Qc)?"TopRightSides":this.D(pc)?"BottomLeftSides":this.D(Au)?"BottomRightSides":this.D(ph)?"NotTopSide":this.D(Ql)?"NotLeftSide":this.D(Yd)?"NotRightSide":this.D(bf)?"NotBottomSide":this.D(mc)?"AllSides":this.D(vs)?"Default":"None"},xt.D=function(a){return a instanceof yn?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1},xt.gv=function(){return new yn(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)},xt.Hf=function(a){if(!this.$c())return!1;if(!a.$c())if(a.D($c))a=pd;else if(a.D(Ef))a=fl;else if(a.D(Xd))a=zh;else if(a.D(Gh))a=Jl;else return!1;return a=a.offsetY,(this.offsetY&a)===a},xt.sb=function(){return!isNaN(this.x)&&!isNaN(this.y)},xt.Mc=function(){return isNaN(this.x)||isNaN(this.y)},xt.$c=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===1&&this.offsetY!==0},xt.ys=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===0&&this.offsetY===0},xt.Xb=function(){return isNaN(this.x)&&isNaN(this.y)&&this.offsetX===-1&&this.offsetY===0},yn.alloc=function(){var a=Df.pop();return a===void 0?new yn:a},yn.free=function(a){Df.push(a)},yn.prototype.isDefault=yn.prototype.Xb,yn.prototype.isNone=yn.prototype.ys,yn.prototype.isSide=yn.prototype.$c,yn.prototype.isNoSpot=yn.prototype.Mc,yn.prototype.isSpot=yn.prototype.sb,yn.prototype.includesSide=yn.prototype.Hf,yn.prototype.opposite=yn.prototype.gv,yn.prototype.equals=yn.prototype.D,yn.prototype.set=yn.prototype.set,yn.prototype.setTo=yn.prototype.sg;var Df=[];yn.className="Spot",yn.parse=Tf,yn.stringify=Nf,yn.None=us=Go(new yn(0,0,0,0),0).ja(),yn.Default=vs=Go(new yn(0,0,-1,0),-1).ja(),yn.TopLeft=ms=new yn(0,0,0,0).ja(),yn.TopCenter=du=new yn(.5,0,0,0).ja(),yn.TopRight=cd=new yn(1,0,0,0).ja(),yn.LeftCenter=gd=new yn(0,.5,0,0).ja(),yn.Center=Xi=new yn(.5,.5,0,0).ja(),yn.RightCenter=Wd=new yn(1,.5,0,0).ja(),yn.BottomLeft=Du=new yn(0,1,0,0).ja(),yn.BottomCenter=Qa=new yn(.5,1,0,0).ja(),yn.BottomRight=Ll=new yn(1,1,0,0).ja(),yn.MiddleTop=$a=du,yn.MiddleLeft=ya=gd,yn.MiddleRight=js=Wd,yn.MiddleBottom=Ks=Qa,yn.Top=Xd=du,yn.Left=$c=gd,yn.Right=Ef=Wd,yn.Bottom=Gh=Qa,yn.TopSide=zh=Go(new yn(0,0,1,1),1).ja(),yn.LeftSide=pd=Go(new yn(0,0,1,2),1).ja(),yn.RightSide=fl=Go(new yn(0,0,1,4),1).ja(),yn.BottomSide=Jl=Go(new yn(0,0,1,8),1).ja(),yn.TopBottomSides=Ud=Go(new yn(0,0,1,9),1).ja(),yn.LeftRightSides=gc=Go(new yn(0,0,1,6),1).ja(),yn.TopLeftSides=Kd=Go(new yn(0,0,1,3),1).ja(),yn.TopRightSides=Qc=Go(new yn(0,0,1,5),1).ja(),yn.BottomLeftSides=pc=Go(new yn(0,0,1,10),1).ja(),yn.BottomRightSides=Au=Go(new yn(0,0,1,12),1).ja(),yn.NotTopSide=ph=Go(new yn(0,0,1,14),1).ja(),yn.NotLeftSide=Ql=Go(new yn(0,0,1,13),1).ja(),yn.NotRightSide=Yd=Go(new yn(0,0,1,11),1).ja(),yn.NotBottomSide=bf=Go(new yn(0,0,1,7),1).ja(),yn.AllSides=mc=Go(new yn(0,0,1,15),1).ja(),Ff=new yn(.156,.156).ja(),Bu=new yn(.844,.844).ja(),yn.parse=Tf,yn.stringify=Nf;function oi(){this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0}oi.prototype.set=function(a){return this.m11=a.m11,this.m12=a.m12,this.m21=a.m21,this.m22=a.m22,this.dx=a.dx,this.dy=a.dy,this},oi.prototype.setTransform=function(a,y,x,b,E,z){return this.m11=a,this.m12=y,this.m21=x,this.m22=b,this.dx=E,this.dy=z,this},oi.prototype.copy=function(){var a=new oi;return a.m11=this.m11,a.m12=this.m12,a.m21=this.m21,a.m22=this.m22,a.dx=this.dx,a.dy=this.dy,a},oi.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"},oi.prototype.D=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy},oi.prototype.ws=function(){return this.dx===0&&this.dy===0&&this.m11===1&&this.m12===0&&this.m21===0&&this.m22===1},oi.prototype.reset=function(){return this.m11=1,this.m21=this.m12=0,this.m22=1,this.dy=this.dx=0,this},oi.prototype.multiply=function(a){var y=this.m11*a.m11+this.m21*a.m12,x=this.m12*a.m11+this.m22*a.m12,b=this.m11*a.m21+this.m21*a.m22,E=this.m12*a.m21+this.m22*a.m22;return this.dx=this.m11*a.dx+this.m21*a.dy+this.dx,this.dy=this.m12*a.dx+this.m22*a.dy+this.dy,this.m11=y,this.m12=x,this.m21=b,this.m22=E,this},oi.prototype.bv=function(a){var y=1/(a.m11*a.m22-a.m12*a.m21),x=a.m22*y,b=-a.m12*y,E=-a.m21*y,z=a.m11*y,tt=y*(a.m21*a.dy-a.m22*a.dx);return a=y*(a.m12*a.dx-a.m11*a.dy),y=this.m11*x+this.m21*b,x=this.m12*x+this.m22*b,b=this.m11*E+this.m21*z,E=this.m12*E+this.m22*z,this.dx=this.m11*tt+this.m21*a+this.dx,this.dy=this.m12*tt+this.m22*a+this.dy,this.m11=y,this.m12=x,this.m21=b,this.m22=E,this},oi.prototype.Vj=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),y=-this.m12*a,x=-this.m21*a,b=this.m11*a,E=a*(this.m21*this.dy-this.m22*this.dx),z=a*(this.m12*this.dx-this.m11*this.dy);return this.m11=this.m22*a,this.m12=y,this.m21=x,this.m22=b,this.dx=E,this.dy=z,this},oi.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a===0)return this;if(this.translate(y,x),a===90){a=0;var b=1}else a===180?(a=-1,b=0):a===270?(a=0,b=-1):(b=a*Math.PI/180,a=Math.cos(b),b=Math.sin(b));var E=this.m12*a+this.m22*b,z=this.m11*-b+this.m21*a,tt=this.m12*-b+this.m22*a;return this.m11=this.m11*a+this.m21*b,this.m12=E,this.m21=z,this.m22=tt,this.translate(-y,-x),this},xt=oi.prototype,xt.translate=function(a,y){return this.dx+=this.m11*a+this.m21*y,this.dy+=this.m12*a+this.m22*y,this},xt.scale=function(a,y){return y===void 0&&(y=a),this.m11*=a,this.m12*=a,this.m21*=y,this.m22*=y,this},xt.Ga=function(a){var y=a.x,x=a.y;return a.h(y*this.m11+x*this.m21+this.dx,y*this.m12+x*this.m22+this.dy)},xt.Cd=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=a.x,b=a.y;return a.h(x*this.m22*y+b*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+b*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},xt.Eu=function(a){var y=1/(this.m11*this.m22-this.m12*this.m21),x=1.25*a.x,b=1.2*a.y;return a.h(x*this.m22*y+b*-this.m21*y+y*(this.m21*this.dy-this.m22*this.dx),x*-this.m12*y+b*this.m11*y+y*(this.m12*this.dx-this.m11*this.dy))},xt.pp=function(a){var y=a.x,x=a.y,b=y+a.width,E=x+a.height,z=this.m11,tt=this.m12,rt=this.m21,ot=this.m22,at=this.dx,ut=this.dy,ct=y*z+x*rt+at,mt=y*tt+x*ot+ut,yt=b*z+x*rt+at,St=b*tt+x*ot+ut;return x=y*z+E*rt+at,y=y*tt+E*ot+ut,z=b*z+E*rt+at,b=b*tt+E*ot+ut,E=Math.min(ct,yt),ct=Math.max(ct,yt),yt=Math.min(mt,St),mt=Math.max(mt,St),E=Math.min(E,x),ct=Math.max(ct,x),yt=Math.min(yt,y),mt=Math.max(mt,y),E=Math.min(E,z),ct=Math.max(ct,z),yt=Math.min(yt,b),mt=Math.max(mt,b),a.h(E,yt,ct-E,mt-yt),a},oi.alloc=function(){var a=Zd.pop();return a===void 0?new oi:a},oi.free=function(a){Zd.push(a)},oi.prototype.transformRect=oi.prototype.pp,oi.prototype.transformPoint=oi.prototype.Ga,oi.prototype.scale=oi.prototype.scale,oi.prototype.translate=oi.prototype.translate,oi.prototype.rotate=oi.prototype.rotate,oi.prototype.invert=oi.prototype.Vj,oi.prototype.multiplyInverted=oi.prototype.bv,oi.prototype.multiply=oi.prototype.multiply,oi.prototype.reset=oi.prototype.reset,oi.prototype.isIdentity=oi.prototype.ws,oi.prototype.equals=oi.prototype.D,oi.prototype.setTransform=oi.prototype.setTransform,oi.prototype.set=oi.prototype.set;var Zd=[];oi.className="Transform",oi.xF="54a702f3e53909c447824c6706603faf4c";var ne={AA:"7da71ca0ad381e90",wg:(Math.sqrt(2)-1)/3*4,Uv:null,sqrt:function(a){if(0>=a)return 0;var y=ne.Uv;if(y===null){y=[];for(var x=0;2e3>=x;x++)y[x]=Math.sqrt(x);ne.Uv=y}return 1>a?(x=1/a,2e3>=x?1/y[x|0]:Math.sqrt(a)):2e3>=a?y[a|0]:Math.sqrt(a)},B:function(a,y){return a-=y,.5>a&&-.5<a},$:function(a,y){return a-=y,5e-8>a&&-5e-8<a},Yb:function(a,y,x,b,E,z,tt){if(0>=E&&(E=1e-6),a<x)var rt=a,ot=x;else rt=x,ot=a;if(y<b)var at=y,ut=b;else at=b,ut=y;if(a===x)return at<=tt&&tt<=ut&&a-E<=z&&z<=a+E;if(y===b)return rt<=z&&z<=ot&&y-E<=tt&&tt<=y+E;if(ot+=E,rt-=E,rt<=z&&z<=ot&&(ut+=E,at-=E,at<=tt&&tt<=ut))if(ot-rt>ut-at)if(a-x>E||x-a>E){if(z=(b-y)/(x-a)*(z-a)+y,z-E<=tt&&tt<=z+E)return!0}else return!0;else if(y-b>E||b-y>E){if(tt=(x-a)/(b-y)*(tt-y)+a,tt-E<=z&&z<=tt+E)return!0}else return!0;return!1},cs:function(a,y,x,b,E,z,tt,rt,ot,at,ut,ct){if(ne.Yb(a,y,tt,rt,ct,x,b)&&ne.Yb(a,y,tt,rt,ct,E,z))return ne.Yb(a,y,tt,rt,ct,at,ut);var mt=(a+x)/2,yt=(y+b)/2,St=(x+E)/2,Lt=(b+z)/2;E=(E+tt)/2,z=(z+rt)/2,b=(mt+St)/2,x=(yt+Lt)/2,St=(St+E)/2,Lt=(Lt+z)/2;var Ot=(b+St)/2,Dt=(x+Lt)/2;return ne.cs(a,y,mt,yt,b,x,Ot,Dt,ot,at,ut,ct)||ne.cs(Ot,Dt,St,Lt,E,z,tt,rt,ot,at,ut,ct)},ax:function(a,y,x,b,E,z,tt,rt,ot){var at=(x+E)/2,ut=(b+z)/2;return ot.h((((a+x)/2+at)/2+(at+(E+tt)/2)/2)/2,(((y+b)/2+ut)/2+(ut+(z+rt)/2)/2)/2),ot},My:function(a,y,x,b,E,z,tt,rt){var ot=(x+E)/2,at=(b+z)/2;return li(((a+x)/2+ot)/2,((y+b)/2+at)/2,(ot+(E+tt)/2)/2,(at+(z+rt)/2)/2)},Dl:function(a,y,x,b,E,z,tt,rt,ot,at){if(ne.Yb(a,y,tt,rt,ot,x,b)&&ne.Yb(a,y,tt,rt,ot,E,z))co(at,a,y,0,0),co(at,tt,rt,0,0);else{var ut=(a+x)/2,ct=(y+b)/2,mt=(x+E)/2,yt=(b+z)/2;E=(E+tt)/2,z=(z+rt)/2,b=(ut+mt)/2,x=(ct+yt)/2,mt=(mt+E)/2,yt=(yt+z)/2;var St=(b+mt)/2,Lt=(x+yt)/2;ne.Dl(a,y,ut,ct,b,x,St,Lt,ot,at),ne.Dl(St,Lt,mt,yt,E,z,tt,rt,ot,at)}return at},Qe:function(a,y,x,b,E,z,tt,rt,ot,at){if(ne.Yb(a,y,tt,rt,ot,x,b)&&ne.Yb(a,y,tt,rt,ot,E,z))at.length===0&&(at.push(a),at.push(y)),at.push(tt),at.push(rt);else{var ut=(a+x)/2,ct=(y+b)/2,mt=(x+E)/2,yt=(b+z)/2;E=(E+tt)/2,z=(z+rt)/2,b=(ut+mt)/2,x=(ct+yt)/2,mt=(mt+E)/2,yt=(yt+z)/2;var St=(b+mt)/2,Lt=(x+yt)/2;ne.Qe(a,y,ut,ct,b,x,St,Lt,ot,at),ne.Qe(St,Lt,mt,yt,E,z,tt,rt,ot,at)}return at},jv:function(a,y,x,b,E,z,tt,rt,ot,at){if(ne.Yb(a,y,E,z,at,x,b))return ne.Yb(a,y,E,z,at,rt,ot);var ut=(a+x)/2,ct=(y+b)/2;x=(x+E)/2,b=(b+z)/2;var mt=(ut+x)/2,yt=(ct+b)/2;return ne.jv(a,y,ut,ct,mt,yt,tt,rt,ot,at)||ne.jv(mt,yt,x,b,E,z,tt,rt,ot,at)},OA:function(a,y,x,b,E,z,tt){return tt.h(((a+x)/2+(x+E)/2)/2,((y+b)/2+(b+z)/2)/2),tt},iv:function(a,y,x,b,E,z,tt,rt){if(ne.Yb(a,y,E,z,tt,x,b))co(rt,a,y,0,0),co(rt,E,z,0,0);else{var ot=(a+x)/2,at=(y+b)/2;x=(x+E)/2,b=(b+z)/2;var ut=(ot+x)/2,ct=(at+b)/2;ne.iv(a,y,ot,at,ut,ct,tt,rt),ne.iv(ut,ct,x,b,E,z,tt,rt)}return rt},ep:function(a,y,x,b,E,z,tt,rt){if(ne.Yb(a,y,E,z,tt,x,b))rt.length===0&&(rt.push(a),rt.push(y)),rt.push(E),rt.push(z);else{var ot=(a+x)/2,at=(y+b)/2;x=(x+E)/2,b=(b+z)/2;var ut=(ot+x)/2,ct=(at+b)/2;ne.ep(a,y,ot,at,ut,ct,tt,rt),ne.ep(ut,ct,x,b,E,z,tt,rt)}return rt},Eo:function(a,y,x,b,E,z,tt,rt,ot,at,ut,ct,mt,yt){if(ne.Yb(a,y,tt,rt,mt,x,b)&&ne.Yb(a,y,tt,rt,mt,E,z))return!ne.Rl(a,y,tt,rt,ot,at,ut,ct)||(mt=(a-tt)*(at-ct)-(y-rt)*(ot-ut),mt===0)?!1:(yt.h(((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ct-at*ut))/mt,((a*rt-y*tt)*(at-ct)-(y-rt)*(ot*ct-at*ut))/mt),!0);var St=(a+x)/2,Lt=(y+b)/2,Ot=(x+E)/2,Dt=(b+z)/2;E=(E+tt)/2,z=(z+rt)/2,b=(St+Ot)/2,x=(Lt+Dt)/2,Ot=(Ot+E)/2,Dt=(Dt+z)/2;var Gt=(b+Ot)/2,Vt=(x+Dt)/2,Yt=1/0,qt=!1,ae=0,Je=0;return ne.Eo(a,y,St,Lt,b,x,Gt,Vt,ot,at,ut,ct,mt,yt)&&(a=(yt.x-ot)*(yt.x-ot)+(yt.y-at)*(yt.y-at),a<Yt&&(Yt=a,qt=!0,ae=yt.x,Je=yt.y)),ne.Eo(Gt,Vt,Ot,Dt,E,z,tt,rt,ot,at,ut,ct,mt,yt)&&(yt.x-ot)*(yt.x-ot)+(yt.y-at)*(yt.y-at)<Yt&&(qt=!0,ae=yt.x,Je=yt.y),qt&&(yt.x=ae,yt.y=Je),qt},Fo:function(a,y,x,b,E,z,tt,rt,ot,at,ut,ct,mt){var yt=0;if(ne.Yb(a,y,tt,rt,mt,x,b)&&ne.Yb(a,y,tt,rt,mt,E,z)){if(mt=(a-tt)*(at-ct)-(y-rt)*(ot-ut),mt===0)return yt;var St=((a*rt-y*tt)*(ot-ut)-(a-tt)*(ot*ct-at*ut))/mt,Lt=((a*rt-y*tt)*(at-ct)-(y-rt)*(ot*ct-at*ut))/mt;if(St>=ut)return yt;if((ot>ut?ot-ut:ut-ot)<(at>ct?at-ct:ct-at)){if(y<rt?(ot=y,a=rt):(ot=rt,a=y),Lt<ot||Lt>a)return yt}else if(a<tt?(ot=a,a=tt):ot=tt,St<ot||St>a)return yt;0<mt?yt++:0>mt&&yt--}else{St=(a+x)/2,Lt=(y+b)/2;var Ot=(x+E)/2,Dt=(b+z)/2;E=(E+tt)/2,z=(z+rt)/2,b=(St+Ot)/2,x=(Lt+Dt)/2,Ot=(Ot+E)/2,Dt=(Dt+z)/2;var Gt=(b+Ot)/2,Vt=(x+Dt)/2;yt+=ne.Fo(a,y,St,Lt,b,x,Gt,Vt,ot,at,ut,ct,mt),yt+=ne.Fo(Gt,Vt,Ot,Dt,E,z,tt,rt,ot,at,ut,ct,mt)}return yt},qh:function(a,y,x,b,E,z,tt){return ne.$(a,x)?(y<b?(x=y,y=b):x=b,z<x?(tt.h(a,x),!1):z>y?(tt.h(a,y),!1):(tt.h(a,z),!0)):ne.$(y,b)?(a<x?(b=a,a=x):b=x,E<b?(tt.h(b,y),!1):E>a?(tt.h(a,y),!1):(tt.h(E,y),!0)):(E=((a-E)*(a-x)+(y-z)*(y-b))/((x-a)*(x-a)+(b-y)*(b-y)),-5e-6>E?(tt.h(a,y),!1):1.000005<E?(tt.h(x,b),!1):(tt.h(a+E*(x-a),y+E*(b-y)),!0))},Ve:function(a,y,x,b,E,z,tt,rt,ot){return ne.B(a,x)&&ne.B(y,b)?(ot.h(a,y),!1):ne.$(E,tt)?ne.$(a,x)?(ne.qh(a,y,x,b,E,z,ot),!1):ne.qh(a,y,x,b,E,(b-y)/(x-a)*(E-a)+y,ot):(rt=(rt-z)/(tt-E),ne.$(a,x)?(x=rt*(a-E)+z,y<b?(E=y,y=b):E=b,x<E?(ot.h(a,E),!1):x>y?(ot.h(a,y),!1):(ot.h(a,x),!0)):(tt=(b-y)/(x-a),ne.$(rt,tt)?(ne.qh(a,y,x,b,E,z,ot),!1):(E=(tt*a-rt*E+z-y)/(tt-rt),ne.$(tt,0)?(a<x?(b=a,a=x):b=x,E<b?(ot.h(b,y),!1):E>a?(ot.h(a,y),!1):(ot.h(E,y),!0)):ne.qh(a,y,x,b,E,tt*(E-a)+y,ot))))},MA:function(a,y,x,b,E){return ne.Ve(x.x,x.y,b.x,b.y,a.x,a.y,y.x,y.y,E)},KA:function(a,y,x,b,E,z,tt,rt,ot,at){function ut(Ot,Dt){var Gt=(Ot-a)*(Ot-a)+(Dt-y)*(Dt-y);Gt<ct&&(ct=Gt,ot.h(Ot,Dt))}var ct=1/0;ut(ot.x,ot.y);var mt=0,yt=0,St=0,Lt=0;if(E<tt?(mt=E,yt=tt):(mt=tt,yt=E),z<rt?(St=E,Lt=tt):(St=tt,Lt=E),mt=(yt-mt)/2+at,at=(Lt-St)/2+at,E=(E+tt)/2,z=(z+rt)/2,mt===0||at===0)return ot;if(.5>(x>a?x-a:a-x)){if(mt=1-(x-E)*(x-E)/(mt*mt),0>mt)return ot;mt=Math.sqrt(mt),b=-at*mt+z,ut(x,at*mt+z),ut(x,b)}else{if(x=(b-y)/(x-a),b=1/(mt*mt)+x*x/(at*at),rt=2*x*(y-x*a)/(at*at)-2*x*z/(at*at)-2*E/(mt*mt),mt=rt*rt-4*b*(2*x*a*z/(at*at)-2*y*z/(at*at)+z*z/(at*at)+E*E/(mt*mt)-1+(y-x*a)*(y-x*a)/(at*at)),0>mt)return ot;mt=Math.sqrt(mt),at=(-rt+mt)/(2*b),ut(at,x*at-x*a+y),mt=(-rt-mt)/(2*b),ut(mt,x*mt-x*a+y)}return ot},Ff:function(a,y,x,b,E,z,tt,rt,ot){var at=1e21,ut=a,ct=y;if(ne.Ve(a,y,a,b,E,z,tt,rt,ot)){var mt=(ot.x-E)*(ot.x-E)+(ot.y-z)*(ot.y-z);mt<at&&(at=mt,ut=ot.x,ct=ot.y)}return ne.Ve(x,y,x,b,E,z,tt,rt,ot)&&(mt=(ot.x-E)*(ot.x-E)+(ot.y-z)*(ot.y-z),mt<at&&(at=mt,ut=ot.x,ct=ot.y)),ne.Ve(a,y,x,y,E,z,tt,rt,ot)&&(y=(ot.x-E)*(ot.x-E)+(ot.y-z)*(ot.y-z),y<at&&(at=y,ut=ot.x,ct=ot.y)),ne.Ve(a,b,x,b,E,z,tt,rt,ot)&&(a=(ot.x-E)*(ot.x-E)+(ot.y-z)*(ot.y-z),a<at&&(at=a,ut=ot.x,ct=ot.y)),ot.h(ut,ct),1e21>at},us:function(a,y,x){return ne.Fx(a.x,a.y,a.width,a.height,y.x,y.y,x.x,x.y)},Fx:function(a,y,x,b,E,z,tt,rt){var ot=a+x,at=y+b;return E===tt?(z<rt?(tt=z,z=rt):tt=rt,a<=E&&E<=ot&&tt<=at&&z>=y):z===rt?(E<tt?(rt=E,E=tt):rt=tt,y<=z&&z<=at&&rt<=ot&&E>=a):!!(ps(a,y,x,b,E,z)||ps(a,y,x,b,tt,rt)||ne.Rl(a,y,ot,y,E,z,tt,rt)||ne.Rl(ot,y,ot,at,E,z,tt,rt)||ne.Rl(ot,at,a,at,E,z,tt,rt)||ne.Rl(a,at,a,y,E,z,tt,rt))},Rl:function(a,y,x,b,E,z,tt,rt){return a===x&&y===b&&E===tt&&z===rt?a===E&&y===z:0>=ne.Fl(a,y,x,b,E,z)*ne.Fl(a,y,x,b,tt,rt)&&0>=ne.Fl(E,z,tt,rt,a,y)*ne.Fl(E,z,tt,rt,x,b)},Fl:function(a,y,x,b,E,z){return x-=a,b-=y,a=E-a,y=z-y,z=a*b-y*x,z===0&&(z=a*x+y*b,0<z&&(z=(a-x)*x+(y-b)*b,0>z&&(z=0))),z},bp:function(a){return 0>a&&(a+=360),360<=a&&(a-=360),a},jx:function(a,y,x,b,E,z){var tt=Math.PI;z||(b*=tt/180,E*=tt/180);var rt=b>E?-1:1;z=[];var ot=tt/2,at=b;if(b=Math.min(2*tt,Math.abs(E-b)),1e-5>b)return ot=at+rt*Math.min(b,ot),rt=a+x*Math.cos(at),at=y+x*Math.sin(at),a+=x*Math.cos(ot),y+=x*Math.sin(ot),x=(rt+a)/2,ot=(at+y)/2,z.push([rt,at,x,ot,x,ot,a,y]),z;for(;1e-5<b;)E=at+rt*Math.min(b,ot),z.push(ne.Vy(x,at,E,a,y)),b-=Math.abs(E-at),at=E;return z},Vy:function(a,y,x,b,E){var z=(x-y)/2,tt=a*Math.cos(z),rt=a*Math.sin(z),ot=-rt,at=tt*tt+ot*ot,ut=at+tt*tt+ot*rt;return at=4/3*(Math.sqrt(2*at*ut)-ut)/(tt*rt-ot*tt),rt=tt-at*ot,tt=ot+at*tt,ot=-tt,at=z+y,z=Math.cos(at),at=Math.sin(at),[b+a*Math.cos(y),E+a*Math.sin(y),b+rt*z-tt*at,E+rt*at+tt*z,b+rt*z-ot*at,E+rt*at+ot*z,b+a*Math.cos(x),E+a*Math.sin(x)]},No:function(a,y,x,b,E,z,tt){x=Math.floor((a-x)/E)*E+x,b=Math.floor((y-b)/z)*z+b;var rt=x;return x+E-a<E/2&&(rt=x+E),a=b,b+z-y<z/2&&(a=b+z),tt.h(rt,a),tt},vx:function(a,y){var x=Math.max(a,y);a=Math.min(a,y);var b;do y=x%a,x=b=a,a=y;while(0<y);return b},$y:function(a,y,x,b){var E=0>x,z=0>b;if(a<y)var tt=1,rt=0;else tt=0,rt=1;var ot=tt===0?a:y,at=tt===0?x:b;return(tt===0?E:z)&&(at=-at),tt=rt,x=tt===0?x:b,(tt===0?E:z)&&(x=-x),ne.az(ot,tt===0?a:y,at,x,0,0)},az:function(a,y,x,b,E,z){if(0<b)if(0<x){E=a*a,z=y*y,a*=x;var tt=y*b,rt=-z+tt,ot=-z+Math.sqrt(a*a+tt*tt);y=rt;for(var at=0;9999999999>at&&(y=.5*(rt+ot),!(y===rt||y===ot));++at){var ut=a/(y+E),ct=tt/(y+z);if(ut=ut*ut+ct*ct-1,0<ut)rt=y;else if(0>ut)ot=y;else break}x=E*x/(y+E)-x,b=z*b/(y+z)-b,x=Math.sqrt(x*x+b*b)}else x=Math.abs(b-y);else b=a*a-y*y,z=a*x,z<b?(b=z/b,z=y*Math.sqrt(Math.abs(1-b*b)),x=a*b-x,x=Math.sqrt(x*x+z*z)):x=Math.abs(x-a);return x},Ze:new ai,um:new ai,Mf:new ai,Nf:0,vm:100};ne.za=ne.AA;function We(a){qr(this),this.l=2,a===void 0&&(a=We.o),this.na=a,this.Ec=this.Dc=this.pd=this.od=0,a===We.o?this.ee=new Ve:(We.V===null&&(We.V=new Ve().freeze()),this.ee=We.V),this.aq=this.ee.Ja,this.Ip=new ye().freeze(),this.ym=this.tk=null,this.zm=NaN,this.fg=ms,this.gg=Ll,this.Rk=this.Sk=NaN,this.Uf=Ae}We.prototype.copy=function(){var a=new We;if(a.l=this.l&-2,a.na=this.na,a.od=this.od,a.pd=this.pd,a.Dc=this.Dc,a.Ec=this.Ec,this.na===We.o){for(var y=this.ee.s,x=a.ee,b=0;b<y.length;b++)x.add(y[b].copy());a.ee=x}else a.ee=this.ee;return a.aq=this.aq,a.Ip.assign(this.Ip),a.tk=this.tk,a.ym=this.ym,a.zm=this.zm,a.fg=this.fg.J(),a.gg=this.gg.J(),a.Sk=this.Sk,a.Rk=this.Rk,a.Uf=this.Uf,a},We.prototype.ja=function(){return this.freeze(),Object.freeze(this),this},We.prototype.freeze=function(){if(this._isFrozen=!0,this.type!==We.o)return this;var a=this.figures;a.freeze(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].freeze();return this},We.prototype.ka=function(){if(Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this.type!==We.o)return this;var a=this.figures;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},We.prototype.Xa=function(a){if(!(a instanceof We))return!1;if(this.type!==a.type)return this.type===We.j&&a.type===We.o?$l(this,a):a.type===We.j&&this.type===We.o?$l(a,this):!1;if(this.type===We.o){var y=this.figures.s;a=a.figures.s;var x=y.length;if(x!==a.length)return!1;for(var b=0;b<x;b++)if(!y[b].Xa(a[b]))return!1;return!0}return ne.B(this.startX,a.startX)&&ne.B(this.startY,a.startY)&&ne.B(this.endX,a.endX)&&ne.B(this.endY,a.endY)};function $l(a,y){return a.type!==We.j||y.type!==We.o?!1:!!(y.figures.count===1&&(y=y.figures.M(0),y.segments.count===1&&ne.B(a.startX,y.startX)&&ne.B(a.startY,y.startY)&&(y=y.segments.M(0),y.type===xr&&ne.B(a.endX,y.endX)&&ne.B(a.endY,y.endY))))}We.ia=function(a){return a.toString()},We.prototype.qb=function(a){a.classType===We&&(this.type=a)},We.prototype.toString=function(a){switch(a===void 0&&(a=-1),this.type){case We.j:return 0>a?"M"+this.startX.toString()+" "+this.startY.toString()+"L"+this.endX.toString()+" "+this.endY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a)+"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);case We.u:var y=new ye(this.startX,this.startY,0,0);return y.Kv(this.endX,this.endY,0,0),0>a?"M"+y.x.toString()+" "+y.y.toString()+"H"+y.right.toString()+"V"+y.bottom.toString()+"H"+y.left.toString()+"z":"M"+y.x.toFixed(a)+" "+y.y.toFixed(a)+"H"+y.right.toFixed(a)+"V"+y.bottom.toFixed(a)+"H"+y.left.toFixed(a)+"z";case We.F:if(y=new ye(this.startX,this.startY,0,0),y.Kv(this.endX,this.endY,0,0),0>a)return a=y.left.toString()+" "+(y.y+y.height/2).toString(),"M"+a+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+(y.right.toString()+" "+(y.y+y.height/2).toString())+"A"+(y.width/2).toString()+" "+(y.height/2).toString()+" 0 0 1 "+a;var x=y.left.toFixed(a)+" "+(y.y+y.height/2).toFixed(a);return"M"+x+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+(y.right.toFixed(a)+" "+(y.y+y.height/2).toFixed(a))+"A"+(y.width/2).toFixed(a)+" "+(y.height/2).toFixed(a)+" 0 0 1 "+x;case We.o:y="",x=this.figures.s;for(var b=x.length,E=0;E<b;E++){var z=x[E];0<E&&(y+=" x "),z.isFilled&&(y+="F "),y+=z.toString(a)}return y;default:return this.type.toString()}},We.nb=function(a){a=a.split(/[Xx]/);for(var y=a.length,x="",b=0;b<y;b++){var E=a[b];x=E.match(/[Ff]/)!==null?b===0?x+E:x+("X"+(E[0]===" "?"":" ")+E):x+((b===0?"":"X ")+"F"+(E[0]===" "?"":" ")+E)}return x},We.parse=function(a,y){function x(){return Lt>=Yt-1?!0:at[Lt+1].match(qt)!==null}function b(){return Lt++,at[Lt]}function E(Un){var jn=parseFloat(b()),ji=parseFloat(b());Ot===Ot.toLowerCase()&&(jn=Vt.x+jn,ji=Vt.y+ji),Un.h(jn,ji)}function z(){return E(Vt),Vt}function tt(){return E(Gt),Gt}function rt(){var Un=Dt.toLowerCase();return Un!=="c"&&Un!=="s"&&Un!=="q"&&Un!=="t"?Vt:new jt(2*Vt.x-Gt.x,2*Vt.y-Gt.y)}y===void 0&&(y=!1);var ot=/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm;a=a.replace(/,/gm," "),a=a.replace(ot,"$1 $2"),a=a.replace(ot,"$1 $2"),a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])([^s])/gm,"$1 $2"),a=a.replace(/([^s])([UuBbMmZzLlHhVvCcSsQqTtAaFfXx])/gm,"$1 $2"),a=a.replace(/([0-9])([+\-])/gm,"$1 $2"),a=a.replace(/[\s\r\t\n]+/gm," "),a=a.replace(/^\s+|\s+$/g,"");var at=a.split(" ");for(a=0;a<at.length;a++){var ut=at[a];if(ut.match(/(\.[0-9]*)(\.)/gm)!==null){ot=Kn();for(var ct="",mt=!1,yt=0;yt<ut.length;yt++){var St=ut[yt];St!=="."||mt?St==="."?(ot.push(ct),ct="."):ct+=St:(mt=!0,ct+=St)}for(ot.push(ct),at.splice(a,1),ut=0;ut<ot.length;ut++)at.splice(a+ut,0,ot[ut]);a+=ot.length-1,zn(ot)}}var Lt=-1,Ot="",Dt="";ot=new jt(0,0);var Gt=new jt(0,0),Vt=new jt(0,0),Yt=at.length;a=T1(null),mt=ct=ut=!1,yt=!0,St=null;for(var qt=/[UuBbMmZzLlHhVvCcSsQqTtAaFfXx]/;!(Lt>=Yt-1);)if(Dt=Ot,Ot=b(),Ot!=="")switch(Ot.toUpperCase()){case"X":yt=!0,ct=ut=!1;break;case"M":for(St=z(),a.mc===null||yt===!0?(wg(a,St.x,St.y,ut,!ct,mt),yt=!1):a.moveTo(St.x,St.y),ot.assign(Vt);!x();)St=z(),a.lineTo(St.x,St.y);break;case"L":for(;!x();)St=z(),a.lineTo(St.x,St.y);break;case"H":for(;!x();)Vt=new jt((Ot===Ot.toLowerCase()?Vt.x:0)+parseFloat(b()),Vt.y),a.lineTo(Vt.x,Vt.y);break;case"V":for(;!x();)Vt=new jt(Vt.x,(Ot===Ot.toLowerCase()?Vt.y:0)+parseFloat(b())),a.lineTo(Vt.x,Vt.y);break;case"C":for(;!x();){St=new jt,E(St);var ae=tt(),Je=z();kd(a,St.x,St.y,ae.x,ae.y,Je.x,Je.y)}break;case"S":for(;!x();)St=rt(),ae=tt(),Je=z(),kd(a,St.x,St.y,ae.x,ae.y,Je.x,Je.y);break;case"Q":for(;!x();)St=tt(),ae=z(),_m(a,St.x,St.y,ae.x,ae.y);break;case"T":for(;!x();)Gt=St=rt(),ae=z(),_m(a,St.x,St.y,ae.x,ae.y);break;case"B":for(;!x();){St=parseFloat(b()),ae=parseFloat(b()),Je=parseFloat(b());var un=parseFloat(b()),nn=parseFloat(b()),Ge=nn,we=!1;x()||(Ge=parseFloat(b()),x()||(we=parseFloat(b())!==0)),Ot===Ot.toLowerCase()&&(Je+=Vt.x,un+=Vt.y),a.arcTo(St,ae,Je,un,nn,Ge,we)}break;case"A":for(;!x();)St=Math.abs(parseFloat(b())),ae=Math.abs(parseFloat(b())),Je=parseFloat(b()),nn=un=!1,we=Ge=0,Ge=b(),Ge.length===1?(un=!!parseFloat(Ge),nn=!!parseFloat(b()),Ge=parseFloat(b())):Ge.length===2?(un=!!parseFloat(Ge[0]),nn=!!parseFloat(Ge[1]),Ge=parseFloat(b())):(un=!!parseFloat(Ge[0]),nn=!!parseFloat(Ge[1]),Ge=parseFloat(Ge.slice(2))),we=parseFloat(b()),Ot===Ot.toLowerCase()&&(Ge=Vt.x+Ge,we=Vt.y+we),Vt.h(Ge,we),wx(a,St,ae,Je,un,nn,Ge,we);break;case"Z":Px(a),Vt.assign(ot);break;case"F":for(St="",ae=1;at[Lt+ae];)if(at[Lt+ae]==="0")mt=!0,ae++;else if(at[Lt+ae].match(/[Uu]/)!==null)ae++;else if(at[Lt+ae].match(qt)===null)ae++;else{St=at[Lt+ae];break}St.match(/[Mm]/)?ut=!0:0<a.mc.segments.length&&(a.mc.isFilled=!0);break;case"U":for(St="",ae=1;at[Lt+ae];)if(at[Lt+ae].match(/[Ff]/)!==null)ae++;else if(at[Lt+ae].match(qt)===null)ae++;else{St=at[Lt+ae];break}St.match(/[Mm]/)?ct=!0:a.mc.isShadowed=!1}if(ot=a.os,Hm=a,y)for(y=ot.figures.iterator;y.next();)y.value.isFilled=!0;return ot},We.Ha=function(a,y){for(var x=a.length,b=jt.alloc(),E=0;E<x;E++){var z=a[E];b.x=z[0],b.y=z[1],y.Ga(b),z[0]=b.x,z[1]=b.y,b.x=z[2],b.y=z[3],y.Ga(b),z[2]=b.x,z[3]=b.y,b.x=z[4],b.y=z[5],y.Ga(b),z[4]=b.x,z[5]=b.y,b.x=z[6],b.y=z[7],y.Ga(b),z[6]=b.x,z[7]=b.y}jt.free(b)},We.prototype.Zu=function(){if(this._isInvalidBounds)return!0;if(this.type===We.o){if(this.aq!==this.figures.Ja)return!0;for(var a=this.figures.s,y=a.length,x=0;x<y;x++)if(a[x].Zu())return!0}return!1},We.prototype.computeBounds=function(){if(this._isInvalidBounds=!1,this.ym=this.tk=null,this.zm=NaN,this.type===We.o){this.aq=this.figures.Ja;for(var a=this.figures.s,y=a.length,x=0;x<y;x++){var b=a[x];b._isInvalidBounds=!1;var E=b.segments;b.sr=E.Ja,b=E.s,E=b.length;for(var z=0;z<E;z++){var tt=b[z];tt._isInvalidBounds=!1,tt.ae=null}}}a=this.Ip,a.ka(),isNaN(this.Sk)||isNaN(this.Rk)?a.h(0,0,0,0):a.h(0,0,this.Sk,this.Rk),_h(this,a,!1),co(a,0,0,0,0),a.freeze()},We.prototype.ix=function(){var a=new ye;return _h(this,a,!0),a};function _h(a,y,x){switch(a.type){case We.j:case We.u:case We.F:x?y.h(a.od,a.pd,0,0):co(y,a.od,a.pd,0,0),co(y,a.Dc,a.Ec,0,0);break;case We.o:var b=a.figures;a=b.s,b=b.length;for(var E=0;E<b;E++){var z=a[E];x&&E===0?y.h(z.startX,z.startY,0,0):co(y,z.startX,z.startY,0,0);for(var tt=z.segments.s,rt=tt.length,ot=z.startX,at=z.startY,ut=0;ut<rt;ut++){var ct=tt[ut];switch(ct.type){case xr:case ts:ot=ct.endX,at=ct.endY,co(y,ot,at,0,0);break;case Fs:ne.Dl(ot,at,ct.point1X,ct.point1Y,ct.point2X,ct.point2Y,ct.endX,ct.endY,.5,y),ot=ct.endX,at=ct.endY;break;case qa:ne.iv(ot,at,ct.point1X,ct.point1Y,ct.endX,ct.endY,.5,y),ot=ct.endX,at=ct.endY;break;case No:case ja:var mt=ct.type===No?Sa(ct,z):ua(ct,z,ot,at),yt=mt.length;if(yt===0){ot=ct.type===No?ct.centerX:ct.endX,at=ct.type===No?ct.centerY:ct.endY,co(y,ot,at,0,0);break}ct=null;for(var St=0;St<yt;St++)ct=mt[St],ne.Dl(ct[0],ct[1],ct[2],ct[3],ct[4],ct[5],ct[6],ct[7],.5,y);ct!==null&&(ot=ct[6],at=ct[7]);break;default:fe("Unknown Segment type: "+ct.type)}}}break;default:fe("Unknown Geometry type: "+a.type)}}We.prototype.normalize=function(){this._isFrozen&&An(this);var a=this.ix();return this.offset(-a.x,-a.y),new jt(-a.x,-a.y)},We.prototype.offset=function(a,y){return this._isFrozen&&An(this),this.transform(1,0,0,1,a,y),this},We.prototype.scale=function(a,y){return this._isFrozen&&An(this),this.transform(a,0,0,y,0,0),this},We.prototype.rotate=function(a,y,x){this._isFrozen&&An(this),y===void 0&&(y=0),x===void 0&&(x=0);var b=oi.alloc();return b.reset(),b.rotate(a,y,x),this.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy),oi.free(b),this},xt=We.prototype,xt.transform=function(a,y,x,b,E,z){switch(this.type){case We.j:case We.u:case We.F:var tt=this.od,rt=this.pd;this.od=tt*a+rt*x+E,this.pd=tt*y+rt*b+z,tt=this.Dc,rt=this.Ec,this.Dc=tt*a+rt*x+E,this.Ec=tt*y+rt*b+z;break;case We.o:for(var ot=this.figures.s,at=ot.length,ut=0;ut<at;ut++){var ct=ot[ut];tt=ct.startX,rt=ct.startY,ct.startX=tt*a+rt*x+E,ct.startY=tt*y+rt*b+z,ct=ct.segments.s;for(var mt=ct.length,yt=0;yt<mt;yt++){var St=ct[yt];switch(St.type){case xr:case ts:tt=St.endX,rt=St.endY,St.endX=tt*a+rt*x+E,St.endY=tt*y+rt*b+z;break;case Fs:tt=St.point1X,rt=St.point1Y,St.point1X=tt*a+rt*x+E,St.point1Y=tt*y+rt*b+z,tt=St.point2X,rt=St.point2Y,St.point2X=tt*a+rt*x+E,St.point2Y=tt*y+rt*b+z,tt=St.endX,rt=St.endY,St.endX=tt*a+rt*x+E,St.endY=tt*y+rt*b+z;break;case qa:tt=St.point1X,rt=St.point1Y,St.point1X=tt*a+rt*x+E,St.point1Y=tt*y+rt*b+z,tt=St.endX,rt=St.endY,St.endX=tt*a+rt*x+E,St.endY=tt*y+rt*b+z;break;case No:tt=St.centerX,rt=St.centerY,St.centerX=tt*a+rt*x+E,St.centerY=tt*y+rt*b+z,y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),St.startAngle+=tt),0>a&&(St.startAngle=180-St.startAngle,St.sweepAngle=-St.sweepAngle),0>b&&(St.startAngle=-St.startAngle,St.sweepAngle=-St.sweepAngle),St.radiusX*=Math.sqrt(a*a+x*x),St.radiusY!==void 0&&(St.radiusY*=Math.sqrt(y*y+b*b));break;case ja:if(tt=St.endX,rt=St.endY,St.endX=tt*a+rt*x+E,St.endY=tt*y+rt*b+z,St.radiusX===0||St.radiusY===0)break;y!==0&&(tt=180*Math.atan2(y,a)/Math.PI,0>tt&&(tt+=360),St.xAxisRotation+=tt),0>a&&(St.xAxisRotation=180-St.xAxisRotation,St.isClockwiseArc=!St.isClockwiseArc),0>b&&(St.xAxisRotation=-St.xAxisRotation,St.isClockwiseArc=!St.isClockwiseArc),St.radiusX*=Math.sqrt(a*a+x*x),St.radiusY*=Math.sqrt(y*y+b*b);break;default:fe("Unknown Segment type: "+St.type)}}}}return this._isInvalidBounds=!0,this},xt.ca=function(a,y){y===void 0&&(y=0);var x=this.od,b=this.pd,E=this.Dc,z=this.Ec;switch(this.type){case We.j:return ne.Yb(x,b,E,z,y,a.x,a.y);case We.u:var tt=ye.allocAt(Math.min(x,E)-y,Math.min(b,z)-y,Math.abs(E-x)+2*y,Math.abs(z-b)+2*y);return a=tt.ca(a),ye.free(tt),a;case We.F:tt=Math.min(x,E)-y;var rt=Math.min(b,z)-y;return x=(Math.abs(E-x)+2*y)/2,y=(Math.abs(z-b)+2*y)/2,0>=x||0>=y?!1:(tt=a.x-(tt+x),rt=a.y-(rt+y),1>=tt*tt/(x*x)+rt*rt/(y*y));case We.o:return Qu(this,a,y,!0,!1);default:return!1}};function Qu(a,y,x,b,E){var z=y.x;y=y.y;for(var tt=a.bounds.x-20,rt=0,ot,at,ut,ct,mt=a.figures.s,yt=mt.length,St=0;St<yt;St++){var Lt=mt[St],Ot=!Lt.isEvenOdd;if(Lt.isFilled){if(b&&Lt.ca(z,y,x))return!0;var Dt=Lt.segments;ot=Lt.startX,at=Lt.startY;for(var Gt=ot,Vt=at,Yt=Dt.s,qt=0;qt<=Dt.length;qt++){var ae=void 0;if(qt!==Dt.length){ae=Yt[qt];var Je=ae.type;a=ae.endX,ct=ae.endY}else Je=xr,a=Gt,ct=Vt;switch(Je){case ts:if(Gt=Ou(z,y,tt,y,ot,at,Gt,Vt),isNaN(Gt))return!0;rt+=Gt,Gt=a,Vt=ct;break;case xr:if(ot=Ou(z,y,tt,y,ot,at,a,ct),isNaN(ot))return!0;rt+=ot;break;case Fs:ut=ne.Fo(ot,at,ae.point1X,ae.point1Y,ae.point2X,ae.point2Y,a,ct,tt,y,z,y,.5),rt+=ut;break;case qa:ut=ne.Fo(ot,at,(ot+2*ae.point1X)/3,(at+2*ae.point1Y)/3,(2*ae.point1X+a)/3,(2*ae.point1Y+ct)/3,a,ct,tt,y,z,y,.5),rt+=ut;break;case No:case ja:Je=ae.type===No?Sa(ae,Lt):ua(ae,Lt,ot,at);var un=Je.length;if(un===0){if(ot=Ou(z,y,tt,y,ot,at,ae.type===No?ae.centerX:ae.endX,ae.type===No?ae.centerY:ae.endY),isNaN(ot))return!0;rt+=ot;break}ae=null;for(var nn=0;nn<un;nn++){if(ae=Je[nn],nn===0){if(ut=Ou(z,y,tt,y,ot,at,ae[0],ae[1]),isNaN(ut))return!0;rt+=ut}ut=ne.Fo(ae[0],ae[1],ae[2],ae[3],ae[4],ae[5],ae[6],ae[7],tt,y,z,y,.5),rt+=ut}ae!==null&&(a=ae[6],ct=ae[7]);break;default:fe("Unknown Segment type: "+ae.type)}ot=a,at=ct}if(Ot){if(rt!==0)return!0}else if(rt%2!==0)return!0;rt=0}else if(Lt.ca(z,y,E?x:x+2))return!0}return!1}function Ou(a,y,x,b,E,z,tt,rt){if(ne.Yb(E,z,tt,rt,.05,a,y))return NaN;var ot=(a-x)*(z-rt);if(ot===0)return 0;var at=((a*b-y*x)*(E-tt)-(a-x)*(E*rt-z*tt))/ot;if(y=(a*b-y*x)*(z-rt)/ot,at>=a)return 0;if((E>tt?E-tt:tt-E)<(z>rt?z-rt:rt-z)){if(z<rt){if(y<z||y>rt)return 0}else if(y<rt||y>z)return 0}else if(E<tt){if(at<E||at>tt)return 0}else if(at<tt||at>E)return 0;return 0<ot?1:-1}function fu(a,y,x,b){a=a.figures.s;for(var E=a.length,z=0;z<E;z++)if(a[z].ca(y,x,b))return!0;return!1}xt.Pu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=new jt),this.type===We.j)return y.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),y;for(var x=this.flattenedSegments,b=this.flattenedLengths,E=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<E;rt++){var ot=b[rt],at=ot.length;for(a=0;a<at;a++){var ut=ot[a];if(tt+ut>=z)return b=z-tt,b=ut===0?0:b/ut,x=x[rt],rt=x[2*a],E=x[2*a+1],y.h(rt+(x[2*a+2]-rt)*b,E+(x[2*a+3]-E)*b),y;tt+=ut}}return y},xt.wx=function(a){if(0>a?a=0:1<a&&(a=1),this.type===We.j)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var y=this.flattenedSegments,x=this.flattenedLengths,b=y.length,E=this.flattenedTotalLength*a,z=0,tt=0;tt<b;tt++){var rt=x[tt],ot=rt.length;for(a=0;a<ot;a++){var at=rt[a];if(z+at>=E)return E=y[tt],y=E[2*a],x=E[2*a+1],b=E[2*a+2],a=E[2*a+3],1>Math.abs(b-y)&&1>Math.abs(a-x)?0:1>Math.abs(b-y)?0<=a-x?90:270:1>Math.abs(a-x)?0<=b-y?0:180:180*Math.atan2(a-x,b-y)/Math.PI;z+=at}}return NaN},xt.Qu=function(a,y){if(0>a?a=0:1<a&&(a=1),y===void 0&&(y=[]),y.length=3,this.type===We.j)return y[0]=this.startX+a*(this.endX-this.startX),y[1]=this.startY+a*(this.endY-this.startY),y[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,y;for(var x=this.flattenedSegments,b=this.flattenedLengths,E=x.length,z=this.flattenedTotalLength*a,tt=0,rt=0;rt<E;rt++){var ot=b[rt],at=ot.length;for(a=0;a<at;a++){var ut=ot[a];if(tt+ut>=z)return b=z-tt,b=ut===0?0:b/ut,ut=x[rt],x=ut[2*a],rt=ut[2*a+1],E=ut[2*a+2],a=ut[2*a+3],y[0]=x+(E-x)*b,y[1]=rt+(a-rt)*b,y[2]=1>Math.abs(E-x)&&1>Math.abs(a-rt)?0:1>Math.abs(E-x)?0<=a-rt?90:270:1>Math.abs(a-rt)?0<=E-x?0:180:180*Math.atan2(a-rt,E-x)/Math.PI,y;tt+=ut}}return y},xt.xx=function(a){if(this.type===We.j){var y=this.startX,x=this.startY,b=this.endX,E=this.endY;if(y!==b||x!==E){var z=a.x;if(a=a.y,y===b){if(x<E){var tt=x;b=E}else tt=E,b=x;return a<=tt?tt===x?0:1:a>=b?b===x?0:1:Math.abs(a-x)/(b-tt)}if(x===E)return y<b?tt=y:(tt=b,b=y),z<=tt?tt===y?0:1:z>=b?b===y?0:1:Math.abs(z-y)/(b-tt);tt=(b-y)*(b-y)+(E-x)*(E-x);var rt=jt.alloc();return ne.qh(y,x,b,E,z,a,rt),a=rt.x,z=rt.y,jt.free(rt),Math.sqrt(((a-y)*(a-y)+(z-x)*(z-x))/tt)}}else if(this.type===We.u){tt=this.startX,rt=this.startY;var ot=this.endX;if(E=this.endY,tt!==ot||rt!==E){y=ot-tt,x=E-rt,z=2*y+2*x,b=a.x,a=a.y,b=Math.min(Math.max(b,tt),ot),a=Math.min(Math.max(a,rt),E),tt=Math.abs(b-tt),ot=Math.abs(b-ot),rt=Math.abs(a-rt),E=Math.abs(a-E);var at=Math.min(tt,ot,rt,E);if(at===rt)return b/z;if(at===ot)return(y+a)/z;if(at===E)return(2*y+x-b)/z;if(at===tt)return(2*y+2*x-a)/z}}else{y=this.flattenedSegments,x=this.flattenedLengths,z=this.flattenedTotalLength,b=jt.alloc(),E=1/0,rt=tt=0,ot=y.length;for(var ut=at=0,ct=0;ct<ot;ct++)for(var mt=y[ct],yt=x[ct],St=mt.length,Lt=0;Lt<St;Lt+=2){var Ot=mt[Lt],Dt=mt[Lt+1];if(Lt!==0){ne.qh(at,ut,Ot,Dt,a.x,a.y,b);var Gt=(b.x-a.x)*(b.x-a.x)+(b.y-a.y)*(b.y-a.y);Gt<E&&(E=Gt,tt=rt,tt+=Math.sqrt((b.x-at)*(b.x-at)+(b.y-ut)*(b.y-ut))),rt+=yt[(Lt-2)/2]}at=Ot,ut=Dt}return jt.free(b),a=tt/z,0>a?0:1<a?1:a}return 0};function Af(a){if(a.tk===null){var y=a.tk=[],x=a.ym=[],b=[],E=[];if(a.type===We.j)b.push(a.startX),b.push(a.startY),b.push(a.endX),b.push(a.endY),y.push(b),E.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),x.push(E);else if(a.type===We.u)b.push(a.startX),b.push(a.startY),b.push(a.endX),b.push(a.startY),b.push(a.endX),b.push(a.endY),b.push(a.startX),b.push(a.endY),b.push(a.startX),b.push(a.startY),y.push(b),E.push(Math.abs(a.startX-a.endX)),E.push(Math.abs(a.startY-a.endY)),E.push(Math.abs(a.startX-a.endX)),E.push(Math.abs(a.startY-a.endY)),x.push(E);else if(a.type===We.F){var z=new qo;z.startX=a.endX,z.startY=(a.startY+a.endY)/2;var tt=new Ni(No);if(tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(a.startX+a.endX)/2,tt.centerY=(a.startY+a.endY)/2,tt.radiusX=Math.abs(a.startX-a.endX)/2,tt.radiusY=Math.abs(a.startY-a.endY)/2,z.add(tt),a=Sa(tt,z),E=a.length,E===0)b.push(tt.centerX),b.push(tt.centerY);else{tt=z.startX,z=z.startY;for(var rt=0;rt<E;rt++){var ot=a[rt];ne.Qe(tt,z,ot[2],ot[3],ot[4],ot[5],ot[6],ot[7],.5,b),tt=ot[6],z=ot[7]}}y.push(b),x.push(md(b))}else for(a=a.figures.iterator;a.next();){E=a.value,b=[],b.push(E.startX),b.push(E.startY),tt=E.startX,z=E.startY,rt=tt,ot=z;for(var at=E.segments.s,ut=at.length,ct=0;ct<ut;ct++){var mt=at[ct];switch(mt.type){case ts:4<=b.length&&(y.push(b),x.push(md(b))),b=[],b.push(mt.endX),b.push(mt.endY),tt=mt.endX,z=mt.endY,rt=tt,ot=z;break;case xr:b.push(mt.endX),b.push(mt.endY),tt=mt.endX,z=mt.endY;break;case Fs:ne.Qe(tt,z,mt.point1X,mt.point1Y,mt.point2X,mt.point2Y,mt.endX,mt.endY,.5,b),tt=mt.endX,z=mt.endY;break;case qa:ne.ep(tt,z,mt.point1X,mt.point1Y,mt.endX,mt.endY,.5,b),tt=mt.endX,z=mt.endY;break;case No:var yt=Sa(mt,E),St=yt.length;if(St===0){b.push(mt.centerX),b.push(mt.centerY),tt=mt.centerX,z=mt.centerY;break}for(var Lt=0;Lt<St;Lt++){var Ot=yt[Lt];ne.Qe(tt,z,Ot[2],Ot[3],Ot[4],Ot[5],Ot[6],Ot[7],.5,b),tt=Ot[6],z=Ot[7]}break;case ja:if(yt=ua(mt,E,tt,z),St=yt.length,Lt=mt.endX,Ot=mt.endY,St===0){b.push(Lt),b.push(Ot),tt=Lt,z=Ot;break}for(Lt=0;Lt<St;Lt++)Ot=yt[Lt],ne.Qe(tt,z,Ot[2],Ot[3],Ot[4],Ot[5],Ot[6],Ot[7],.5,b),tt=Ot[6],z=Ot[7];break;default:fe("Segment not of valid type: "+mt.type)}mt.isClosed&&(b.push(rt),b.push(ot))}4<=b.length&&(y.push(b),x.push(md(b)))}}}function md(a){for(var y=[],x=0,b=0,E=a.length,z=0;z<E;z+=2){var tt=a[z],rt=a[z+1];z!==0&&y.push(Math.sqrt(wi(x,b,tt,rt))),x=tt,b=rt}return y}xt.add=function(a){return this.ee.add(a),this},xt.pm=function(a,y,x,b,E,z,tt,rt){return this._isFrozen&&An(this),this.fg=new yn(a,y,E,z).freeze(),this.gg=new yn(x,b,tt,rt).freeze(),this},Oe.Object.defineProperties(We.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},flattenedSegments:{get:function(){return Af(this),this.tk}},flattenedLengths:{get:function(){return Af(this),this.ym}},flattenedTotalLength:{get:function(){var a=this.zm;if(isNaN(a)){if(this.type===We.j){a=Math.abs(this.endX-this.startX);var y=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+y*y)}else if(this.type===We.u)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-this.startY);else{y=this.flattenedLengths;for(var x=y.length,b=a=0;b<x;b++)for(var E=y[b],z=E.length,tt=0;tt<z;tt++)a+=E[tt]}this.zm=a}return a}},type:{get:function(){return this.na},set:function(a){this.na!==a&&(this._isFrozen&&An(this,a),this.na=a,a===We.o?this.ee=new Ve:(We.V===null&&(We.V=new Ve().freeze()),this.ee=We.V),this._isInvalidBounds=!0)}},startX:{get:function(){return this.od},set:function(a){this.od!==a&&(this._isFrozen&&An(this,a),this.od=a,this._isInvalidBounds=!0)}},startY:{get:function(){return this.pd},set:function(a){this.pd!==a&&(this._isFrozen&&An(this,a),this.pd=a,this._isInvalidBounds=!0)}},endX:{get:function(){return this.Dc},set:function(a){this.Dc!==a&&(this._isFrozen&&An(this,a),this.Dc=a,this._isInvalidBounds=!0)}},endY:{get:function(){return this.Ec},set:function(a){this.Ec!==a&&(this._isFrozen&&An(this,a),this.Ec=a,this._isInvalidBounds=!0)}},figures:{get:function(){return this.ee},set:function(a){this.ee!==a&&(this._isFrozen&&An(this,a),this.ee=a,this._isInvalidBounds=!0)}},spot1:{get:function(){return this.fg},set:function(a){this._isFrozen&&An(this,a),this.fg=a.J()}},spot2:{get:function(){return this.gg},set:function(a){this._isFrozen&&An(this,a),this.gg=a.J()}},defaultStretch:{get:function(){return this.Uf},set:function(a){this._isFrozen&&An(this,a),this.Uf=a}},bounds:{get:function(){return this.Zu()&&this.computeBounds(),this.Ip}}}),We.prototype.setSpots=We.prototype.pm,We.prototype.add=We.prototype.add,We.prototype.getFractionForPoint=We.prototype.xx,We.prototype.getPointAndAngleAlongPath=We.prototype.Qu,We.prototype.getAngleAlongPath=We.prototype.wx,We.prototype.getPointAlongPath=We.prototype.Pu,We.prototype.containsPoint=We.prototype.ca,We.prototype.transform=We.prototype.transform,We.prototype.rotate=We.prototype.rotate,We.prototype.scale=We.prototype.scale,We.prototype.offset=We.prototype.offset,We.prototype.normalize=We.prototype.normalize,We.prototype.computeBoundsWithoutOrigin=We.prototype.ix,We.prototype.equalsApprox=We.prototype.Xa,We.className="Geometry",We.j=new me(We,"Line",0),We.u=new me(We,"Rectangle",1),We.F=new me(We,"Ellipse",2),We.o=new me(We,"Path",3),We.V=null,We.hb="UuBbMmZzLlHhVvCcSsQqTtAaFfXx",We.className="Geometry",We.stringify=We.ia,We.fillPath=We.nb,We.parse=We.parse,We.Line=We.j,We.Rectangle=We.u,We.Ellipse=We.F,We.Path=We.o;function qo(a,y,x,b,E){qr(this),x===void 0&&(x=!0),b===void 0&&(b=!0),E===void 0&&(E=!1),this.l=2|(x?4:0)|(b?8:0)|(E?16:0),a!==void 0?this.od=a:this.od=0,y!==void 0?this.pd=y:this.pd=0,this.pl=new Ve,this.sr=this.pl.Ja,this.fw=null}qo.prototype.copy=function(){var a=new qo;a.l=this.l&-2,a.od=this.od,a.pd=this.pd;for(var y=this.pl.s,x=y.length,b=a.pl,E=0;E<x;E++){var z=y[E].copy();b.add(z)}return a.sr=this.sr,a.fw=this.fw,a},xt=qo.prototype,xt.Xa=function(a){if(!(a instanceof qo&&ne.B(this.startX,a.startX)&&ne.B(this.startY,a.startY)))return!1;var y=this.segments.s;a=a.segments.s;var x=y.length;if(x!==a.length)return!1;for(var b=0;b<x;b++)if(!y[b].Xa(a[b]))return!1;return!0},xt.toString=function(a){a===void 0&&(a=-1);for(var y=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a),x=this.segments.s,b=x.length,E=0;E<b;E++)y+=" "+x[E].toString(a);return y},xt.freeze=function(){this._isFrozen=!0;var a=this.segments;a.freeze();var y=a.s;a=a.length;for(var x=0;x<a;x++)y[x].freeze();return this},xt.ka=function(){this._isFrozen=!1;var a=this.segments;a.ka(),a=a.s;for(var y=a.length,x=0;x<y;x++)a[x].ka();return this},xt.Zu=function(){if(this._isInvalidBounds)return!0;var a=this.segments;if(this.sr!==a.Ja)return!0;a=a.s;for(var y=a.length,x=0;x<y;x++)if(a[x]._isInvalidBounds)return!0;return!1},xt.add=function(a){return this.pl.add(a),this},xt.ca=function(a,y,x){for(var b=this.startX,E=this.startY,z=b,tt=E,rt=this.segments.s,ot=rt.length,at=0;at<ot;at++){var ut=rt[at];switch(ut.type){case ts:z=ut.endX,tt=ut.endY,b=ut.endX,E=ut.endY;break;case xr:if(ne.Yb(b,E,ut.endX,ut.endY,x,a,y))return!0;b=ut.endX,E=ut.endY;break;case Fs:if(ne.cs(b,E,ut.point1X,ut.point1Y,ut.point2X,ut.point2Y,ut.endX,ut.endY,.5,a,y,x))return!0;b=ut.endX,E=ut.endY;break;case qa:if(ne.jv(b,E,ut.point1X,ut.point1Y,ut.endX,ut.endY,.5,a,y,x))return!0;b=ut.endX,E=ut.endY;break;case No:case ja:var ct=ut.type===No?Sa(ut,this):ua(ut,this,b,E),mt=ct.length,yt=ut.type===No?ut.centerX:ut.endX,St=ut.type===No?ut.centerY:ut.endY;if(mt===0){if(ne.Yb(b,E,yt,St,x,a,y))return!0;b=yt,E=St;break}for(yt=null,St=0;St<mt;St++)if(yt=ct[St],St===0&&ne.Yb(b,E,yt[0],yt[1],x,a,y)||ne.cs(yt[0],yt[1],yt[2],yt[3],yt[4],yt[5],yt[6],yt[7],.5,a,y,x))return!0;yt!==null&&(b=yt[6],E=yt[7]);break;default:fe("Unknown Segment type: "+ut.type)}if(ut.isClosed&&(b!==z||E!==tt)&&ne.Yb(b,E,z,tt,x,a,y))return!0}return!1},Oe.Object.defineProperties(qo.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isFilled:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&An(this,a),this.l=a?this.l|4:this.l&-5}},isShadowed:{get:function(){return(this.l&8)!==0},set:function(a){this._isFrozen&&An(this,a),this.l=a?this.l|8:this.l&-9}},isEvenOdd:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&An(this,a),this.l=a?this.l|16:this.l&-17}},startX:{get:function(){return this.od},set:function(a){this._isFrozen&&An(this,a),this.od=a,this._isInvalidBounds=!0}},startY:{get:function(){return this.pd},set:function(a){this._isFrozen&&An(this,a),this.pd=a,this._isInvalidBounds=!0}},segments:{get:function(){return this.pl},set:function(a){this._isFrozen&&An(this,a),this.pl=a,this._isInvalidBounds=!0}}}),qo.prototype.add=qo.prototype.add,qo.prototype.equalsApprox=qo.prototype.Xa,qo.className="PathFigure";function Ni(a,y,x,b,E,z,tt,rt){qr(this),a===void 0&&(a=xr),this.na=a,this.l=2,y!==void 0?this.Dc=y:this.Dc=0,x!==void 0?this.Ec=x:this.Ec=0,b===void 0&&(b=0),E===void 0&&(E=0),z===void 0&&(z=0),tt===void 0&&(tt=0),a===ja?(a=z%360,0>a&&(a+=360),this.Ne=a,this.Vh=0,this.Wh=Math.max(b,0),this.Pg=Math.max(E,0),typeof tt=="boolean"?tt&&(this.isLargeArc=!0):typeof tt=="number"&&tt&&(this.isLargeArc=!0),rt&&(this.isClockwiseArc=!0)):(this.Ne=b,this.Vh=E,a===No&&(z=Math.max(z,0)),this.Wh=z,typeof tt=="number"?(a===No&&(tt=Math.max(tt,0)),this.Pg=tt):this.Pg=0),this.ae=null}Ni.prototype.copy=function(){var a=new Ni;return a.na=this.na,a.l=this.l&-2,a.Dc=this.Dc,a.Ec=this.Ec,a.Ne=this.Ne,a.Vh=this.Vh,a.Wh=this.Wh,a.Pg=this.Pg,a},xt=Ni.prototype,xt.Xa=function(a){if(!(a instanceof Ni)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ts:case xr:return ne.B(this.endX,a.endX)&&ne.B(this.endY,a.endY);case Fs:return ne.B(this.endX,a.endX)&&ne.B(this.endY,a.endY)&&ne.B(this.point1X,a.point1X)&&ne.B(this.point1Y,a.point1Y)&&ne.B(this.point2X,a.point2X)&&ne.B(this.point2Y,a.point2Y);case qa:return ne.B(this.endX,a.endX)&&ne.B(this.endY,a.endY)&&ne.B(this.point1X,a.point1X)&&ne.B(this.point1Y,a.point1Y);case No:return ne.B(this.startAngle,a.startAngle)&&ne.B(this.sweepAngle,a.sweepAngle)&&ne.B(this.centerX,a.centerX)&&ne.B(this.centerY,a.centerY)&&ne.B(this.radiusX,a.radiusX)&&ne.B(this.radiusY,a.radiusY);case ja:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&ne.B(this.xAxisRotation,a.xAxisRotation)&&ne.B(this.endX,a.endX)&&ne.B(this.endY,a.endY)&&ne.B(this.radiusX,a.radiusX)&&ne.B(this.radiusY,a.radiusY);default:return!1}},xt.qb=function(a){a.classType===Ni&&(this.type=a)},xt.toString=function(a){switch(a===void 0&&(a=-1),this.type){case ts:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case xr:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Fs:a=0>a?"C"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.point2X.toString()+" "+this.point2Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"C"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case qa:a=0>a?"Q"+this.point1X.toString()+" "+this.point1Y.toString()+" "+this.endX.toString()+" "+this.endY.toString():"Q"+this.point1X.toFixed(a)+" "+this.point1Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case No:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+" "+this.radiusX.toString()+" "+this.radiusY.toString():"B"+this.startAngle.toFixed(a)+" "+this.sweepAngle.toFixed(a)+" "+this.centerX.toFixed(a)+" "+this.centerY.toFixed(a)+" "+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a);break;case ja:a=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xAxisRotation.toString()+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toString()+" "+this.endY.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xAxisRotation.toFixed(a)+" "+(this.isLargeArc?1:0)+" "+(this.isClockwiseArc?1:0)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;default:a=this.type.toString()}return a+(this.isClosed?"z":"")},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.close=function(){return this.isClosed=!0,this};function Sa(a,y){if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;var x=a.radiusX,b=a.radiusY;if(b===void 0&&(b=x),x===0||b===0)return a.ae=[],a.ae;y=a.Ne;var E=a.Vh,z=ne.jx(0,0,x<b?x:b,a.startAngle,a.startAngle+a.sweepAngle,!1);if(x!==b){var tt=oi.alloc();tt.reset(),x<b?tt.scale(1,b/x):tt.scale(x/b,1),We.Ha(z,tt),oi.free(tt)}for(x=z.length,b=0;b<x;b++)tt=z[b],tt[0]+=y,tt[1]+=E,tt[2]+=y,tt[3]+=E,tt[4]+=y,tt[5]+=E,tt[6]+=y,tt[7]+=E;return a.ae=z,a.ae}function ua(a,y,x,b){function E(Lt,Ot,Dt,Gt){return(Lt*Gt<Ot*Dt?-1:1)*Math.acos((Lt*Dt+Ot*Gt)/(Math.sqrt(Lt*Lt+Ot*Ot)*Math.sqrt(Dt*Dt+Gt*Gt)))}if(a.ae!==null&&y._isInvalidBounds===!1)return a.ae;if(a.radiusX===0||a.radiusY===0)return a.ae=[],a.ae;y=a.Wh;var z=a.Pg;y===0&&(y=1e-4),z===0&&(z=1e-4);var tt=Math.PI/180*a.Ne,rt=a.isLargeArc,ot=a.isClockwiseArc,at=a.Dc,ut=a.Ec,ct=Math.cos(tt),mt=Math.sin(tt),yt=ct*(x-at)/2+mt*(b-ut)/2;tt=-mt*(x-at)/2+ct*(b-ut)/2;var St=yt*yt/(y*y)+tt*tt/(z*z);return 1<St&&(y*=Math.sqrt(St),z*=Math.sqrt(St)),St=(rt===ot?-1:1)*Math.sqrt((y*y*z*z-y*y*tt*tt-z*z*yt*yt)/(y*y*tt*tt+z*z*yt*yt)),isNaN(St)&&(St=0),rt=St*y*tt/z,St=St*-z*yt/y,isNaN(rt)&&(rt=0),isNaN(St)&&(St=0),x=(x+at)/2+ct*rt-mt*St,b=(b+ut)/2+mt*rt+ct*St,ut=E(1,0,(yt-rt)/y,(tt-St)/z),ct=(yt-rt)/y,at=(tt-St)/z,yt=(-yt-rt)/y,rt=(-tt-St)/z,tt=E(ct,at,yt,rt),yt=(ct*yt+at*rt)/(Math.sqrt(ct*ct+at*at)*Math.sqrt(yt*yt+rt*rt)),-1>=yt?tt=Math.PI:1<=yt&&(tt=0),!ot&&0<tt&&(tt-=2*Math.PI),ot&&0>tt&&(tt+=2*Math.PI),ot=y>z?1:y/z,yt=y>z?z/y:1,y=ne.jx(0,0,y>z?y:z,ut,ut+tt,!0),z=oi.alloc(),z.reset(),z.translate(x,b),z.rotate(a.Ne,0,0),z.scale(ot,yt),We.Ha(y,z),oi.free(z),a.ae=y,a.ae}Oe.Object.defineProperties(Ni.prototype,{_isFrozen:{get:function(){return(this.l&1)!==0},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{get:function(){return(this.l&2)!==0},set:function(a){this.l=a?this.l|2:this.l&-3}},isClosed:{get:function(){return(this.l&8)!==0},set:function(a){this.isClosed!==a&&(this.l=a?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{get:function(){return this.na},set:function(a){this._isFrozen&&An(this,a),this.na=a,this._isInvalidBounds=!0}},endX:{get:function(){return this.Dc},set:function(a){this._isFrozen&&An(this,a),this.Dc=a,this._isInvalidBounds=!0}},endY:{get:function(){return this.Ec},set:function(a){this._isFrozen&&An(this,a),this.Ec=a,this._isInvalidBounds=!0}},point1X:{get:function(){return this.Ne},set:function(a){this._isFrozen&&An(this,a),this.Ne=a,this._isInvalidBounds=!0}},point1Y:{get:function(){return this.Vh},set:function(a){this._isFrozen&&An(this,a),this.Vh=a,this._isInvalidBounds=!0}},point2X:{get:function(){return this.Wh},set:function(a){this._isFrozen&&An(this,a),this.Wh=a,this._isInvalidBounds=!0}},point2Y:{get:function(){return this.Pg},set:function(a){this._isFrozen&&An(this,a),this.Pg=a,this._isInvalidBounds=!0}},centerX:{get:function(){return this.Ne},set:function(a){this._isFrozen&&An(this,a),this.Ne=a,this._isInvalidBounds=!0}},centerY:{get:function(){return this.Vh},set:function(a){this._isFrozen&&An(this,a),this.Vh=a,this._isInvalidBounds=!0}},radiusX:{get:function(){return this.Wh},set:function(a){0>a&&ri(a,">= zero",Ni,"radiusX"),this._isFrozen&&An(this,a),this.Wh=a,this._isInvalidBounds=!0}},radiusY:{get:function(){return this.Pg},set:function(a){0>a&&ri(a,">= zero",Ni,"radiusY"),this._isFrozen&&An(this,a),this.Pg=a,this._isInvalidBounds=!0}},startAngle:{get:function(){return this.Dc},set:function(a){this._isFrozen&&An(this,a),a%=360,0>a&&(a+=360),this.Dc=a,this._isInvalidBounds=!0}},sweepAngle:{get:function(){return this.Ec},set:function(a){this._isFrozen&&An(this,a),360<a&&(a=360),-360>a&&(a=-360),this.Ec=a,this._isInvalidBounds=!0}},isClockwiseArc:{get:function(){return(this.l&4)!==0},set:function(a){this._isFrozen&&An(this,a),this.l=a?this.l|4:this.l&-5,this._isInvalidBounds=!0}},isLargeArc:{get:function(){return(this.l&16)!==0},set:function(a){this._isFrozen&&An(this,a),this.l=a?this.l|16:this.l&-17,this._isInvalidBounds=!0}},xAxisRotation:{get:function(){return this.Ne},set:function(a){this._isFrozen&&An(this,a),a%=360,0>a&&(a+=360),this.Ne=a,this._isInvalidBounds=!0}}}),Ni.prototype.equalsApprox=Ni.prototype.Xa;var ts=new me(Ni,"Move",0),xr=new me(Ni,"Line",1),Fs=new me(Ni,"Bezier",2),qa=new me(Ni,"QuadraticBezier",3),No=new me(Ni,"Arc",4),ja=new me(Ni,"SvgArc",4);Ni.className="PathSegment",Ni.Move=ts,Ni.Line=xr,Ni.Bezier=Fs,Ni.QuadraticBezier=qa,Ni.Arc=No,Ni.SvgArc=ja;function Ys(){this.H=null,this.xu=new jt(0,0).freeze(),this.mt=new jt(0,0).freeze(),this.Bp=this.Rq=0,this.Cp=1,this.xq="",this.Wr=this.Tp=!1,this.Rp=this.Ep=0,this.xg=this.nq=this.tq=!1,this.Zp=null,this.Rr=0,this.xd=this.Nr=null}Ys.prototype.copy=function(){var a=new Ys;return this.clone(a)},Ys.prototype.clone=function(a){return a.H=this.H,a.xu.assign(this.viewPoint),a.mt.assign(this.documentPoint),a.Rq=this.Rq,a.Bp=this.Bp,a.Cp=this.Cp,a.xq=this.xq,a.Tp=this.Tp,a.Wr=this.Wr,a.Ep=this.Ep,a.Rp=this.Rp,a.tq=this.tq,a.nq=this.nq,a.xg=this.xg,a.Zp=this.Zp,a.Rr=this.Rr,a.Nr=this.Nr,a.xd=this.xd,a},Ys.prototype.toString=function(){var a="^";return this.modifiers!==0&&(a+="M:"+this.modifiers),this.button!==0&&(a+="B:"+this.button),this.key!==""&&(a+="K:"+this.key),this.clickCount!==0&&(a+="C:"+this.clickCount),this.delta!==0&&(a+="D:"+this.delta),this.handled&&(a+="h"),this.bubbles&&(a+="b"),this.documentPoint!==null&&(a+="@"+this.documentPoint.toString()),a},Ys.prototype.So=function(a,y){var x=this.diagram;return x===null||Pc(x,a,y),y},Ys.prototype.Bz=function(a,y){var x=this.diagram;return x===null||(Pc(x,a,y),y.assign(x.Ps(y))),y},Oe.Object.defineProperties(Ys.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{get:function(){return this.xu},set:function(a){this.xu.assign(a)}},documentPoint:{get:function(){return this.mt},set:function(a){this.mt.assign(a)}},modifiers:{get:function(){return this.Rq},set:function(a){this.Rq=a}},button:{get:function(){return this.Bp},set:function(a){if(this.Bp=a,this.event===null)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}}},buttons:{get:function(){return this.Cp},set:function(a){this.Cp=a}},key:{get:function(){return this.xq},set:function(a){this.xq=a}},down:{get:function(){return this.Tp},set:function(a){this.Tp=a}},up:{get:function(){return this.Wr},set:function(a){this.Wr=a}},clickCount:{get:function(){return this.Ep},set:function(a){this.Ep=a}},delta:{get:function(){return this.Rp},set:function(a){this.Rp=a}},isMultiTouch:{get:function(){return this.tq},set:function(a){this.tq=a}},handled:{get:function(){return this.nq},set:function(a){this.nq=a}},bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},event:{get:function(){return this.Zp},set:function(a){this.Zp=a}},isTouchEvent:{get:function(){var a=this.event;return a===null?!1:a.pointerType==="touch"||a.pointerType==="pen"}},timestamp:{get:function(){return this.Rr},set:function(a){this.Rr=a}},targetDiagram:{get:function(){return this.Nr},set:function(a){this.Nr=a}},targetObject:{get:function(){return this.xd},set:function(a){this.xd=a}},control:{get:function(){return(this.modifiers&1)!==0},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{get:function(){return(this.modifiers&4)!==0},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{get:function(){return(this.modifiers&2)!==0},set:function(a){this.modifiers=a?this.modifiers|2:this.modifiers&-3}},meta:{get:function(){return(this.modifiers&8)!==0},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&1)!==0:this.button===0},set:function(a){this.buttons=a?this.buttons|1:this.buttons&-2}},right:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&2)!==0:this.button===2},set:function(a){this.buttons=a?this.buttons|2:this.buttons&-3}},middle:{get:function(){var a=this.event;return a===null||a.type!=="mousedown"&&a.type!=="mouseup"&&a.type!=="pointerdown"&&a.type!=="pointerup"?(this.buttons&4)!==0:this.button===1},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}}),Ys.prototype.getMultiTouchDocumentPoint=Ys.prototype.Bz,Ys.prototype.getMultiTouchViewPoint=Ys.prototype.So,Ys.className="InputEvent";function mh(){this.H=null,this.xa="",this.ar=this.Lr=null}mh.prototype.copy=function(){var a=new mh;return a.H=this.H,a.xa=this.xa,a.Lr=this.Lr,a.ar=this.ar,a},mh.prototype.toString=function(){var a="*"+this.name;return this.subject!==null&&(a+=":"+this.subject.toString()),this.parameter!==null&&(a+="("+this.parameter.toString()+")"),a},Oe.Object.defineProperties(mh.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},subject:{get:function(){return this.Lr},set:function(a){this.Lr=a}},parameter:{get:function(){return this.ar},set:function(a){this.ar=a}}}),mh.className="DiagramEvent";function Jr(){this.Fm=Ur,this.rf=this.Qq="",this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null}Jr.prototype.clear=function(){this.Ln=this.Mn=this.Rn=this.Sn=this.Qn=this.H=this.cc=null},Jr.prototype.copy=function(){var a=new Jr;a.Fm=this.Fm,a.Qq=this.Qq,a.rf=this.rf,a.cc=this.cc,a.H=this.H,a.Qn=this.Qn;var y=this.Sn;return a.Sn=Ue(y)&&typeof y.J=="function"?y.J():y,y=this.Rn,a.Rn=Ue(y)&&typeof y.J=="function"?y.J():y,y=this.Mn,a.Mn=Ue(y)&&typeof y.J=="function"?y.J():y,y=this.Ln,a.Ln=Ue(y)&&typeof y.J=="function"?y.J():y,a},Jr.prototype.qb=function(a){a.classType===Jr&&(this.change=a)},Jr.prototype.toString=function(){var a="";return a=this.change===za?a+"* ":this.change===Ur?a+(this.model!==null?"!m":"!d"):a+((this.model!==null?"!m":"!d")+this.change),this.propertyName&&typeof this.propertyName=="string"&&(a+=" "+this.propertyName),this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange),a+=": ",this.change===za?this.oldValue!==null&&(a+=" "+this.oldValue):(this.object!==null&&(a+=Ir(this.object)),this.oldValue!==null&&(a+=" old: "+Ir(this.oldValue)),this.oldParam!==null&&(a+=" "+this.oldParam),this.newValue!==null&&(a+=" new: "+Ir(this.newValue)),this.newParam!==null&&(a+=" "+this.newParam)),a},Jr.prototype.I=function(a){return a?this.oldValue:this.newValue},Jr.prototype.Dz=function(a){return a?this.oldParam:this.newParam},Jr.prototype.canUndo=function(){return this.model!==null||this.diagram!==null},Jr.prototype.undo=function(){this.canUndo()&&(this.model!==null?this.model.changeState(this,!0):this.diagram!==null&&this.diagram.changeState(this,!0))},Jr.prototype.canRedo=function(){return this.model!==null||this.diagram!==null},Jr.prototype.redo=function(){this.canRedo()&&(this.model!==null?this.model.changeState(this,!1):this.diagram!==null&&this.diagram.changeState(this,!1))},Oe.Object.defineProperties(Jr.prototype,{model:{get:function(){return this.cc},set:function(a){this.cc=a}},diagram:{get:function(){return this.H},set:function(a){this.H=a}},change:{get:function(){return this.Fm},set:function(a){this.Fm=a}},modelChange:{get:function(){return this.Qq},set:function(a){this.Qq=a}},propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},isTransactionFinished:{get:function(){return this.Fm===za&&(this.rf==="CommittedTransaction"||this.rf==="FinishedUndo"||this.rf==="FinishedRedo")}},object:{get:function(){return this.Qn},set:function(a){this.Qn=a}},oldValue:{get:function(){return this.Sn},set:function(a){this.Sn=a}},oldParam:{get:function(){return this.Rn},set:function(a){this.Rn=a}},newValue:{get:function(){return this.Mn},set:function(a){this.Mn=a}},newParam:{get:function(){return this.Ln},set:function(a){this.Ln=a}}}),Jr.prototype.redo=Jr.prototype.redo,Jr.prototype.canRedo=Jr.prototype.canRedo,Jr.prototype.undo=Jr.prototype.undo,Jr.prototype.canUndo=Jr.prototype.canUndo,Jr.prototype.getParam=Jr.prototype.Dz,Jr.prototype.getValue=Jr.prototype.I,Jr.prototype.clear=Jr.prototype.clear;var za=new me(Jr,"Transaction",-1),Ur=new me(Jr,"Property",0),ko=new me(Jr,"Insert",1),Bo=new me(Jr,"Remove",2);Jr.className="ChangedEvent",Jr.Transaction=za,Jr.Property=Ur,Jr.Insert=ko,Jr.Remove=Bo;function as(){this.o=new Ve().freeze(),this.xa="",this.j=!1}as.prototype.toString=function(a){var y="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(a!==void 0&&0<a){a=this.changes.count;for(var x=0;x<a;x++){var b=this.changes.M(x);b!==null&&(y+=`
|
|
`+b.toString())}}return y},as.prototype.clear=function(){var a=this.changes;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),a.freeze()},as.prototype.canUndo=function(){return this.isComplete},as.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var y=this.changes.M(a);y!==null&&y.undo()}},as.prototype.canRedo=function(){return this.isComplete},as.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,y=0;y<a;y++){var x=this.changes.M(y);x!==null&&x.redo()}},as.prototype.ak=function(){if(this.isComplete){var a=this.changes;a.ka();for(var y=new xn,x=0;x<a.count;x++){var b=a.M(x);if(b!==null&&b.change===Ur&&b.object){var E=y.get(b.object);E||(E=new xn,y.set(b.object,E));var z=E.get(b.propertyName);z===null?E.set(b.propertyName,-1):(0<z&&a.cd(z,null),E.set(b.propertyName,x))}}for(x=y=0;x<a.count;x++)b=a.M(x),b!==null&&(x>y&&a.cd(y,b),y++);for(;a.length>y;)a.pop();a.freeze()}},Oe.Object.defineProperties(as.prototype,{changes:{get:function(){return this.o}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isComplete:{get:function(){return this.j},set:function(a){this.j=a}}}),as.prototype.optimize=as.prototype.ak,as.prototype.redo=as.prototype.redo,as.prototype.canRedo=as.prototype.canRedo,as.prototype.undo=as.prototype.undo,as.prototype.canUndo=as.prototype.canUndo,as.prototype.clear=as.prototype.clear,as.className="Transaction";function eo(){this.Pt=new Ye,this.Jd=!1,this.u=new Ve().freeze(),this.Ce=-1,this.o=999,this.Fe=!1,this.Np=null,this.bi=0,this.j=!1,this.Ie=new Ve().freeze(),this.hl=new Ve,this.tt=!0,this.Dt=this.rq=this.Gt=this.Ft=!1}eo.prototype.toString=function(a){var y="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;y+="[";for(var x=this.nestedTransactionNames.count,b=0;b<x;b++)0<b&&(y+=" "),y+=this.nestedTransactionNames.M(b);if(y+="]",a!==void 0&&0<a)for(x=this.history.count,b=0;b<x;b++)y+=`
|
|
`+this.history.M(b).toString(a-1);return y},eo.prototype.clear=function(){var a=this.history;a.ka();for(var y=a.count-1;0<=y;y--){var x=a.M(y);x!==null&&x.clear()}a.clear(),this.Ce=-1,a.freeze(),this.Fe=!1,this.Np=null,this.bi=0,this.Ie.ka(),this.Ie.clear(),this.Ie.freeze(),this.hl.clear(),this.Dt=this.rq=this.Gt=this.Ft=!1},eo.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled,this.maxHistoryLength=a.maxHistoryLength,this.checksTransactionLevel=a.checksTransactionLevel},xt=eo.prototype,xt.Xw=function(a){this.Pt.add(a)},xt.Rx=function(a){this.Pt.remove(a)},xt.Ea=function(a){if(a===void 0&&(a=""),a===null&&(a=""),this.isUndoingRedoing)return!1;this.tt===!0&&(this.tt=!1,this.bi++,this.isInternalTransaction||this.Ob("StartingFirstTransaction",a,this.currentTransaction),0<this.bi&&this.bi--),this.isEnabled&&(this.Ie.ka(),this.Ie.add(a),this.Ie.freeze(),this.currentTransaction===null?this.hl.add(0):this.hl.add(this.currentTransaction.changes.count)),this.bi++;var y=this.transactionLevel===1;return y&&(this.isInternalTransaction||this.Ob("StartedTransaction",a,this.currentTransaction)),y},xt.eb=function(a){return a===void 0&&(a=""),Hh(this,!0,a)},xt.Kf=function(){return Hh(this,!1,"")};function Hh(a,y,x){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Ki("Ending transaction without having started a transaction: "+x);var b=a.transactionLevel===1,E=a.currentTransaction;b&&y&&(a.isInternalTransaction||a.Ob("CommittingTransaction",x,E));var z=0;if(0<a.transactionLevel&&(a.bi--,a.isEnabled)){var tt=a.Ie.count;0<tt&&(x===""&&(x=a.Ie.M(0)),a.Ie.ka(),a.Ie.mb(tt-1),a.Ie.freeze()),tt=a.hl.count,0<tt&&(z=a.hl.M(tt-1),a.hl.mb(tt-1))}if(b){if(y)a.rq=!1,E===null&&x!==""&&(E=a.currentTransaction),a.isEnabled&&E!==null&&(E.isComplete||(E.isComplete=!0,E.name=x),a.lx(),y=a.history,y.ka(),b=a.maxHistoryLength,0<=b&&(b===0?y.clear():y.count>=b&&(z=y.M(0),z!==null&&z.clear(),y.mb(0),a.Ce--)),b===0||y.count!==0&&y.get(y.count-1)===E||(y.add(E),a.Ce++),y.freeze()),a.isInternalTransaction||a.Ob("CommittedTransaction",x,E);else{a.Fe=!0;try{a.isEnabled&&E!==null&&(E.isComplete=!0,E.undo())}finally{a.isInternalTransaction||a.Ob("RolledBackTransaction",x,E),a.Fe=!1}E!==null&&E.clear()}return a.Np=null,a.isPendingClear&&a.clear(),a.isPendingClear=!1,a.isPendingUnmodified=!1,!0}if(a.isEnabled&&!y&&E!==null){for(a=z,x=E.changes,E=x.count-1;E>=a;E--)y=x.M(E),y!==null&&y.undo(),x.ka(),x.mb(E);x.freeze()}return!1}xt.lx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.ka();for(var y=a.count-1;y>this.historyIndex;y--){var x=a.M(y);x!==null&&x.clear(),a.mb(y),this.rq=!0}a.freeze()}},eo.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return!!(a!==null&&a.canUndo())},eo.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Fe=!0,this.Ob("StartingUndo","Undo",a),this.Ce--,a.undo()}catch(y){Ki("undo error: "+y.toString())}finally{this.Ob("FinishedUndo","Undo",a),this.Fe=!1}}},eo.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return!!(a!==null&&a.canRedo())},eo.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Fe=!0,this.Ob("StartingRedo","Redo",a),this.Ce++,a.redo()}catch(y){Ki("redo error: "+y.toString())}finally{this.Ob("FinishedRedo","Redo",a),this.Fe=!1}}},eo.prototype.Ob=function(a,y,x){x===void 0&&(x=null);var b=new Jr;for(b.change=za,b.propertyName=a,b.object=x,b.oldValue=y,a=this.models;a.next();)y=a.value,b.model=y,y.ds(b)},eo.prototype.Tu=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var y=this.currentTransaction;y===null&&(this.Np=y=new as);var x=a.copy();y=y.changes,y.ka(),y.add(x),y.freeze(),this.checksTransactionLevel&&0>=this.transactionLevel&&!this.tt&&(a=a.diagram,a!==null&&a.pi===!1||Ki("Change not within a transaction: "+x.toString()))}},eo.prototype.skipsEvent=function(a){if(a===null||0>a.change.value)return!0;if(a=a.object,a===null)return!1;if(a.layer!==void 0){if(a=a.layer,a!==null&&a.isTemporary)return!0}else if(a.isTemporary)return!0;return!1},Oe.Object.defineProperties(eo.prototype,{models:{get:function(){return this.Pt.iterator}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},transactionToUndo:{get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{get:function(){return this.historyIndex<this.history.count-1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{get:function(){return this.Fe}},history:{get:function(){return this.u}},maxHistoryLength:{get:function(){return this.o},set:function(a){this.o=a}},historyIndex:{get:function(){return this.Ce}},currentTransaction:{get:function(){return this.Np}},transactionLevel:{get:function(){return this.bi}},isInTransaction:{get:function(){return 0<this.bi}},checksTransactionLevel:{get:function(){return this.j},set:function(a){this.j=a}},nestedTransactionNames:{get:function(){return this.Ie}},isPendingClear:{get:function(){return this.Ft},set:function(a){this.Ft=a}},isPendingUnmodified:{get:function(){return this.Gt},set:function(a){this.Gt=a}},isInternalTransaction:{get:function(){return this.Dt},set:function(a){this.Dt=a}},isJustDiscarded:{get:function(){return this.rq}}}),eo.prototype.handleChanged=eo.prototype.Tu,eo.prototype.redo=eo.prototype.redo,eo.prototype.undo=eo.prototype.undo,eo.prototype.canUndo=eo.prototype.canUndo,eo.prototype.discardHistoryAfterIndex=eo.prototype.lx,eo.prototype.rollbackTransaction=eo.prototype.Kf,eo.prototype.commitTransaction=eo.prototype.eb,eo.prototype.startTransaction=eo.prototype.Ea,eo.prototype.removeModel=eo.prototype.Rx,eo.prototype.addModel=eo.prototype.Xw,eo.prototype.clear=eo.prototype.clear,eo.className="UndoManager";function Ei(){qr(this),this.H=wa,this.xa="",this.Jd=!0,this.nb=!1,this.wm=null,this.yy=new Ys,this.Zr=-1}Ei.prototype.toString=function(){return this.name!==""?this.name+" Tool":qn(this.constructor)},Ei.prototype.updateAdornments=function(){},Ei.prototype.canStart=function(){return this.isEnabled},Ei.prototype.doStart=function(){},Ei.prototype.doActivate=function(){this.isActive=!0},Ei.prototype.doDeactivate=function(){this.isActive=!1},Ei.prototype.doStop=function(){},Ei.prototype.doCancel=function(){this.transactionResult=null,this.stopTool()},Ei.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")},Ei.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()},Ei.prototype.doMouseMove=function(){},Ei.prototype.doMouseUp=function(){this.stopTool()},Ei.prototype.doMouseWheel=function(){},Ei.prototype.canStartMultiTouch=function(){return!0},Ei.prototype.standardPinchZoomStart=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,jt.allocAt(NaN,NaN)),b=y.So(1,jt.allocAt(NaN,NaN));if(x.w()&&b.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){a.Bw=a.scale;var E=b.x-x.x,z=b.y-x.y;a.Jw=Math.sqrt(E*E+z*z),y.bubbles=!1}jt.free(x),jt.free(b)},Ei.prototype.standardPinchZoomMove=function(){var a=this.diagram,y=a.lastInput,x=y.So(0,jt.allocAt(NaN,NaN)),b=y.So(1,jt.allocAt(NaN,NaN));if(x.w()&&b.w()&&(this.doCancel(),a.Ql("hasGestureZoom"))){var E=b.x-x.x,z=b.y-x.y;z=Math.sqrt(E*E+z*z)/a.Jw,E=new jt((Math.min(b.x,x.x)+Math.max(b.x,x.x))/2,(Math.min(b.y,x.y)+Math.max(b.y,x.y))/2),z*=a.Bw;var tt=a.commandHandler;if(z!==a.scale&&tt.canResetZoom(z)){var rt=a.zoomPoint;a.zoomPoint=E,tt.resetZoom(z),a.zoomPoint=rt}y.bubbles=!1}jt.free(x),jt.free(b)},Ei.prototype.doKeyDown=function(){this.diagram.lastInput.key==="Esc"&&this.doCancel()},Ei.prototype.doKeyUp=function(){},Ei.prototype.Ea=function(a){return a===void 0&&(a=this.name),this.transactionResult=null,this.diagram.Ea(a)},Ei.prototype.stopTransaction=function(){var a=this.diagram;return this.transactionResult===null?a.Kf():a.eb(this.transactionResult)},Ei.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.lastInput,x=a.Ol(y.documentPoint,!1);if(x!==null){if(Ps?y.meta:y.control){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!y.isSelected),a.R("ChangedSelection",a.selection)}else if(y.shift){if(!x.isSelected){for(a.R("ChangingSelection",a.selection),y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&(y.isSelected=!0),a.R("ChangedSelection",a.selection)}}else if(!x.isSelected){for(y=x;y!==null&&!y.canSelect();)y=y.containingGroup;y!==null&&a.select(y)}}else!y.left||(Ps?y.meta:y.control)||y.shift||a.clearSelection()}},Ei.prototype.standardMouseClick=function(a,y){a===void 0&&(a=null),y===void 0&&(y=function(E){return!E.layer.isTemporary});var x=this.diagram,b=x.lastInput;return a=x.ic(b.documentPoint,a,y),b.targetObject=a,vc(a,b,x),b.handled};function vc(a,y,x){if(y.handled=!1,a===null||a.If()){var b=0;y.left?b=y.clickCount===1?1:y.clickCount===2?2:1:y.right&&y.clickCount===1&&(b=3);var E="ObjectSingleClicked";if(a!==null){switch(b){case 1:E="ObjectSingleClicked";break;case 2:E="ObjectDoubleClicked";break;case 3:E="ObjectContextClicked"}b!==0&&x.R(E,a)}else{switch(b){case 1:E="BackgroundSingleClicked";break;case 2:E="BackgroundDoubleClicked";break;case 3:E="BackgroundContextClicked"}b!==0&&x.R(E)}if(a!==null)for(;a!==null;){switch(x=null,b){case 1:x=a.click;break;case 2:x=a.doubleClick?a.doubleClick:a.click;break;case 3:x=a.contextClick}if(x!==null&&(x(y,a),y.handled))break;a=a.panel}else{switch(a=null,b){case 1:a=x.click;break;case 2:a=x.doubleClick?x.doubleClick:x.click;break;case 3:a=x.contextClick}a!==null&&a(y)}}}Ei.prototype.standardMouseOver=function(){var a=this.diagram,y=a.lastInput;if(a.animationManager.zb!==!0){var x=a.skipsUndoManager;a.skipsUndoManager=!0;var b=a.viewportBounds.ca(y.documentPoint)?a.ic(y.documentPoint,null,null):null;!y.event||y.event.type!=="pointercancel"&&y.event.type!=="pointerout"||(b=null),y.targetObject=b;var E=!1;if(b!==a.Ck){var z=a.Ck,tt=z;for(a.Ck=b,this.doCurrentObjectChanged(z,b),y.handled=!1;z!==null;){var rt=z.mouseLeave;if(rt!==null&&(b===z||b!==null&&b.rg(z)||(rt(y,z,b),E=!0,y.handled)))break;z=z.panel}for(z=tt,y.handled=!1;b!==null&&(tt=b.mouseEnter,!(tt!==null&&(z===b||z!==null&&z.rg(b)||(tt(y,b,z),E=!0,y.handled))));)b=b.panel;b=a.Ck}if(b!==null){for(z=b,tt="";z!==null&&(tt=z.cursor,tt==="");)z=z.panel;for(a.currentCursor=tt,y.handled=!1,z=b;z!==null&&(b=z.mouseOver,!(b!==null&&(b(y,z),E=!0,y.handled)));)z=z.panel}else this.doUpdateCursor(null),b=a.mouseOver,b!==null&&(b(y),E=!0);E&&a.$b(),a.skipsUndoManager=x}},Ei.prototype.doUpdateCursor=function(){var a=this.diagram;a&&(a.currentCursor="")},Ei.prototype.doCurrentObjectChanged=function(){},Ei.prototype.standardMouseWheel=function(){var a=this.diagram,y=a.lastInput,x=y.delta;if(x!==0&&a.documentBounds.w()){var b=a.commandHandler,E=a.toolManager.mouseWheelBehavior;if(b!==null&&(E===Jd&&!y.shift||E===vd&&y.control))(0<x?b.canIncreaseZoom():b.canDecreaseZoom())&&(E=a.zoomPoint,a.zoomPoint=y.viewPoint,0<x?b.increaseZoom():b.decreaseZoom(),a.zoomPoint=E),y.bubbles=!1;else if(E===Jd&&y.shift||E===vd&&!y.control){b=a.position.copy();var z=y.event;E=z.deltaMode;var tt=z.deltaX;z=z.deltaY;var rt="pixel";if(tt===0&&z===0||y.shift)!y.shift&&a.allowVerticalScroll?(x=3*x*a.scrollVerticalLineChange,a.scroll(rt,0<x?"up":"down",Math.abs(x))):y.shift&&a.allowHorizontalScroll&&(x=3*x*a.scrollHorizontalLineChange,a.scroll(rt,0<x?"left":"right",Math.abs(x)));else{switch(E){case 0:rt="pixel";break;case 1:rt="line";break;case 2:rt="page"}tt!==0&&a.allowHorizontalScroll&&(tt*=a.scrollHorizontalLineChange/16,a.scroll(rt,0<tt?"right":"left",Math.abs(tt))),z!==0&&a.allowVerticalScroll&&(z*=a.scrollVerticalLineChange/16,a.scroll(rt,0<z?"down":"up",Math.abs(z)))}this.doWheelChange(a,b,y)}}},Ei.prototype.doWheelChange=function(a,y,x){a.position.D(y)&&x.event.wheelDeltaX===0||(x.bubbles=!1)},Ei.prototype.standardWaitAfter=function(a,y){y===void 0&&(y=this.diagram.lastInput),this.cancelWaitAfter();var x=this,b=y.clone(this.yy);this.Zr=Oi(function(){x.doWaitAfter(b)},a)},Ei.prototype.cancelWaitAfter=function(){this.Zr!==-1&&xe.clearTimeout(this.Zr),this.Zr=-1},Ei.prototype.doWaitAfter=function(){},Ei.prototype.findToolHandleAt=function(a,y){return a=this.diagram.ic(a,function(x){for(;x!==null&&!(x.panel instanceof Bi);)x=x.panel;return x}),a===null?null:a.part.category===y?a:null},Ei.prototype.isBeyondDragSize=function(a,y){var x=this.diagram;a===void 0&&(a=x.firstInput.viewPoint),y===void 0&&(y=x.lastInput.viewPoint);var b=x.toolManager.dragSize,E=b.width;return b=b.height,x.firstInput.isTouchEvent&&(E+=6,b+=6),Math.abs(y.x-a.x)>E||Math.abs(y.y-a.y)>b},Oe.Object.defineProperties(Ei.prototype,{diagram:{get:function(){return this.H},set:function(a){a instanceof se&&(this.H=a)}},name:{get:function(){return this.xa},set:function(a){this.xa=a}},isEnabled:{get:function(){return this.Jd},set:function(a){this.Jd=a}},isActive:{get:function(){return this.nb},set:function(a){this.nb=a}},transactionResult:{get:function(){return this.wm},set:function(a){this.wm=a}}}),Ei.prototype.startTransaction=Ei.prototype.Ea,Ei.className="Tool";function jr(){Ei.call(this),this.name="ToolManager",this.hb=new Ve,this.ob=new Ve,this.Hb=new Ve,this.F=this.V=850,this.o=new Ze(2,2).ja(),this.Ha=5e3,this.ia=vd,this.u=Of,this.Mp=this.j=null,this.zj=-1}le(jr,Ei),jr.prototype.initializeStandardTools=function(){},jr.prototype.updateAdornments=function(a){var y=this.currentToolTip;if(y instanceof Bi&&this.Mp===a){var x=y.adornedObject;(a!==null?x.part===a:x===null)?this.showToolTip(y,x):this.hideToolTip()}},jr.prototype.doMouseDown=function(){var a=this.diagram,y=a.lastInput;if(y.isTouchEvent&&this.gestureBehavior===$u&&(y.bubbles=!1),y.isMultiTouch){if(this.cancelWaitAfter(),this.gestureBehavior===Vh){y.bubbles=!0;return}if(this.gestureBehavior===$u)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}for(var x=this.mouseDownTools.length,b=0;b<x;b++){var E=this.mouseDownTools.M(b);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseDown());return}}a.lastInput.button===1&&(this.mouseWheelBehavior===vd?this.mouseWheelBehavior=Jd:this.mouseWheelBehavior===Jd&&(this.mouseWheelBehavior=vd)),this.doActivate(),this.standardWaitAfter(this.holdDelay,y)},jr.prototype.doMouseMove=function(){var a=this.diagram,y=a.lastInput;if(y.isMultiTouch){if(this.gestureBehavior===Vh){y.bubbles=!0;return}if(this.gestureBehavior===$u)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var x=this.mouseMoveTools.length,b=0;b<x;b++){var E=this.mouseMoveTools.M(b);if(E.diagram=this.diagram,E.canStart()){a.doFocus(),a.currentTool=E,a.currentTool===E&&(E.isActive||E.doActivate(),E.doMouseMove());return}}qc(this,a),a=y.event,a===null||a.type!=="pointermove"&&a.cancelable||(y.bubbles=!0)};function qc(a,y){a.standardMouseOver(),a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,y.lastInput)}jr.prototype.doCurrentObjectChanged=function(a,y){a=this.currentToolTip,a===null||y!==null&&a instanceof Bi&&(y===a||y.rg(a))||this.hideToolTip()},jr.prototype.doWaitAfter=function(a){var y=this.diagram;y.ta!==null&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!y.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,y.lastInput=a,y.qu=!0,y.doMouseUp()))},jr.prototype.doMouseHover=function(){var a=this.diagram,y=a.lastInput;y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null));var x=y.targetObject;if(x!==null)for(y.handled=!1;x!==null&&(a=this.isActive?x.mouseHold:x.mouseHover,!(a!==null&&(a(y,x),y.handled)));)x=x.panel;else x=this.isActive?a.mouseHold:a.mouseHover,x!==null&&x(y)},jr.prototype.doToolTip=function(){var a=this.diagram,y=a.lastInput;if(y.targetObject===null&&(y.targetObject=a.ic(y.documentPoint,null,null)),y=y.targetObject,y!==null){if(a=this.currentToolTip,!(a instanceof Bi)||y!==a&&!y.rg(a)){for(;y!==null;){if(a=y.toolTip,a!==null){this.showToolTip(a,y);return}y=y.panel}this.hideToolTip()}}else y=a.toolTip,y!==null?this.showToolTip(y,null):this.hideToolTip()},jr.prototype.showToolTip=function(a,y){var x=this.diagram;if(a!==this.currentToolTip&&this.hideToolTip(),a instanceof Bi){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category="ToolTip",a.placeholder!==null&&(a.placeholder.scale=x.scale);var b=a.diagram;b!==null&&b!==x&&b.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionToolTip(a,y)}else a instanceof Cn&&a!==this.currentToolTip&&a.show(y,x,this);if(this.currentToolTip=a,this.zj!==-1&&(xe.clearTimeout(this.zj),this.zj=-1),a=this.toolTipDuration,0<a&&a!==1/0){var E=this;this.zj=Oi(function(){E.hideToolTip()},a)}},jr.prototype.positionToolTip=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),b=a.measuredBounds,E=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=b.width),x.x+b.width>E.right&&(x.x-=b.width+5/y.scale),x.x<E.x&&(x.x=E.x),x.y=x.y+20/y.scale+b.height>E.bottom?x.y-(b.height+5/y.scale):x.y+20/y.scale,x.y<E.y&&(x.y=E.y),a.position=x}},jr.prototype.hideToolTip=function(){this.zj!==-1&&(xe.clearTimeout(this.zj),this.zj=-1);var a=this.diagram,y=this.currentToolTip;y!==null&&(y instanceof Bi?(a.remove(y),this.Mp!==null&&this.Mp.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Cn&&y.hide!==null&&y.hide(a,this),this.currentToolTip=null)},jr.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var y=this.mouseUpTools.length,x=0;x<y;x++){var b=this.mouseUpTools.M(x);if(b.diagram=this.diagram,b.canStart()){a.doFocus(),a.currentTool=b,a.currentTool===b&&(b.isActive||b.doActivate(),b.doMouseUp());return}}a.doFocus(),this.doDeactivate()},jr.prototype.doMouseWheel=function(){this.standardMouseWheel()},jr.prototype.doKeyDown=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyDown()},jr.prototype.doKeyUp=function(){var a=this.diagram;a.commandHandler!==null&&a.commandHandler.doKeyUp()},jr.prototype.findTool=function(a){for(var y=this.mouseDownTools.length,x=0;x<y;x++){var b=this.mouseDownTools.M(x);if(b.name===a)return b}for(y=this.mouseMoveTools.length,x=0;x<y;x++)if(b=this.mouseMoveTools.M(x),b.name===a)return b;for(y=this.mouseUpTools.length,x=0;x<y;x++)if(b=this.mouseUpTools.M(x),b.name===a)return b;return null},jr.prototype.replaceTool=function(a,y){y!==null&&(y.diagram=this.diagram);for(var x=this.mouseDownTools.length,b=0;b<x;b++){var E=this.mouseDownTools.M(b);if(E.name===a)return y!==null?this.mouseDownTools.cd(b,y):this.mouseDownTools.mb(b),E}for(x=this.mouseMoveTools.length,b=0;b<x;b++)if(E=this.mouseMoveTools.M(b),E.name===a)return y!==null?this.mouseMoveTools.cd(b,y):this.mouseMoveTools.mb(b),E;for(x=this.mouseUpTools.length,b=0;b<x;b++)if(E=this.mouseUpTools.M(b),E.name===a)return y!==null?this.mouseUpTools.cd(b,y):this.mouseUpTools.mb(b),E;return null},jr.prototype.gb=function(a,y,x){y!==null&&(y.name=a,y.diagram=this.diagram),this.findTool(a)?this.replaceTool(a,y):y!==null&&x.add(y)},Oe.Object.defineProperties(jr.prototype,{mouseWheelBehavior:{get:function(){return this.ia},set:function(a){this.ia=a}},gestureBehavior:{get:function(){return this.u},set:function(a){this.u=a}},currentToolTip:{get:function(){return this.j},set:function(a){this.j=a,this.Mp=a!==null&&a instanceof Bi?a.adornedPart:null}},mouseDownTools:{get:function(){return this.hb}},mouseMoveTools:{get:function(){return this.ob}},mouseUpTools:{get:function(){return this.Hb}},hoverDelay:{get:function(){return this.V},set:function(a){this.V=a}},holdDelay:{get:function(){return this.F},set:function(a){this.F=a}},dragSize:{get:function(){return this.o},set:function(a){this.o=a.J()}},toolTipDuration:{get:function(){return this.Ha},set:function(a){this.Ha=a}}}),jr.prototype.replaceStandardTool=jr.prototype.gb;var vd=new me(jr,"WheelScroll",0),Jd=new me(jr,"WheelZoom",1),Bf=new me(jr,"WheelNone",2),Of=new me(jr,"GestureZoom",3),$u=new me(jr,"GestureCancel",4),Vh=new me(jr,"GestureNone",5);jr.className="ToolManager",jr.WheelScroll=vd,jr.WheelZoom=Jd,jr.WheelNone=Bf,jr.GestureZoom=Of,jr.GestureCancel=$u,jr.GestureNone=Vh;function ti(){Ei.call(this),this.name="Dragging",this.u=this.Sw=this.ob=!0,this.o=this.Ha=this.V=this.Oe=null,this.Ym=this.Hb=!1,this.tl=new jt(NaN,NaN),this.Fr=new jt,this.hb=!0,this.Ik=100,this.Cg=[],this.te=new Ye().freeze(),this.ia=new st,this.Bn=null,this.F="copy",this.Oc="",this.Pc="no-drop"}var xa;le(ti,Ei),ti.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var y=a.lastInput;return!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.isTouchEvent&&y.timestamp-a.firstInput.timestamp<this.Ik)?!1:this.findDraggablePart()!==null},ti.prototype.findDraggablePart=function(){var a=this.diagram;if(a=a.Ol(a.firstInput.documentPoint,!1),a===null)return null;for(;a!==null&&!a.canSelect();)a=a.containingGroup;return a!==null&&(a.canMove()||a.canCopy())?a:null},ti.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var y=a.Ol(a.firstInput.documentPoint,!1);if(y!==null){for(;y!==null&&!y.canSelect();)y=y.containingGroup;this.currentPart=y,this.currentPart===null||this.currentPart.isSelected||(a.R("ChangingSelection",a.selection),y=a.lastInput,(Ps?y.meta:y.control)||y.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.R("ChangedSelection",a.selection))}}},ti.prototype.doActivate=function(){var a=this.diagram;this.Bn=null,this.currentPart===null&&this.standardMouseSelect();var y=this.currentPart;y!==null&&(y.canMove()||y.canCopy())&&(a.Fu(!0),ws=null,this.isActive=!0,this.tl.set(a.position),If(this,a.selection),this.Cg.length=0,a.animationManager.Cc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),this.Sw=this.diagram.layout.isRealtime,this.diagram.layout.isRealtime=!1,a.Ns=!0,a.Gf("temporaryPixelRatio")===!0&&30<a.$w&&tr(a),qd(a,this.draggedParts),this.Ea("Drag"),this.startPoint=a.firstInput.documentPoint,a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.Ym=!1,ws=this,th=this.diagram,this.doSimulatedDragOut()))};function If(a,y){if(a.dragsLink){var x=a.diagram;x.allowRelink&&(x.model.Wj()&&y.count===1&&y.first()instanceof _e?(a.draggedLink=y.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Ej(),a.Oe=x.toolManager.findTool("Relinking"),a.Oe===null&&(a.Oe=new cl,a.Oe.diagram=x),a.Oe.originalLink=a.draggedLink):(a.draggedLink=null,a.Oe=null))}}ti.prototype.computeEffectiveCollection=function(a,y){return this.diagram.commandHandler.computeEffectiveCollection(a,y)},ti.prototype.Pd=function(a){return a===void 0?new Jh(cs):this.isGridSnapEnabled?new Jh(new jt(Math.round(1e3*a.x)/1e3,Math.round(1e3*a.y)/1e3)):new Jh(a.copy())},ti.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;if(this.diagram.layout.isRealtime=this.Sw,a.Fu(!1),a.ug(),Wh(this),ih(a,this.draggedParts),this.draggedParts=this.currentPart=this.Bn=null,this.Ym=this.isDragOutStarted=!1,0<xa.count){for(var y=xa,x=y.length,b=0;b<x;b++){var E=y.M(b);Uh(E),jl(E),Wh(E),E.diagram.ug()}y.clear()}Uh(this),this.tl.h(NaN,NaN),th!==null&&(th.currentCursor=""),ws=th=null,jl(this),a.isMouseCaptured=!1,a.currentCursor="",a.Ns=!1,this.stopTransaction(),_s(a,!0)},ti.prototype.stopTransaction=function(){var a=this.diagram,y=Ei.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y};function Wh(a){var y=a.diagram,x=y.skipsUndoManager;y.skipsUndoManager=!0,yc(a,y.lastInput,null),y.skipsUndoManager=x,a.Cg.length=0}function Rf(){var a=ws;jl(a),vh(a);var y=a.diagram;a.tl.w()&&(y.position=a.tl),y.ug()}ti.prototype.doCancel=function(){jl(this),vh(this);var a=this.diagram;this.tl.w()&&(a.position=this.tl),this.stopTool()},ti.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput;this.isActive&&(y.key==="Esc"?this.doCancel():y.key!==a.previousInput.key&&this.doMouseMove())},ti.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};function qu(a,y){if(a.copiedParts===null){var x=a.diagram;if((!y||!x.isReadOnly&&!x.isModelReadOnly)&&a.draggedParts!==null){var b=x.undoManager;for(b.isEnabled&&b.isInTransaction?b.currentTransaction!==null&&0<b.currentTransaction.changes.count&&(x.undoManager.Kf(),x.Ea("Drag")):vh(a),x.skipsUndoManager=!y,x.partManager.addsToTemporaryLayer=!y,a.startPoint=x.firstInput.documentPoint,y=a.copiesEffectiveCollection?a.draggedParts.Lf():x.selection,y=x.Kj(y,x,!0),x=new xn,b=a.draggedParts.iterator;b.next();){var E=b.key;if(E.Zc()&&E.canCopy()){var z=y.I(E);z!==null&&(z.location=E.location,z.Va(),x.add(z,a.Pd(z.location)))}}for(y=y.iterator;y.next();)b=y.value,b instanceof _e&&b.canCopy()&&x.add(b,a.Pd());a.copiedParts=x,If(a,x.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,Fd(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}function jl(a){var y=a.diagram;if(a.copiedParts!==null){if(y.Is(a.copiedParts.Lf(),!1),a.copiedParts=null,a.draggedParts!==null)for(var x=a.draggedParts.iterator;x.next();)x.key instanceof _e&&(x.value.point=new jt(0,0));a.doUpdateCursor(null)}y.skipsUndoManager=!1,y.partManager.addsToTemporaryLayer=!1,a.startPoint=y.firstInput.documentPoint}function Uh(a){if(a.draggedLink!==null){if(a.dragsLink&&a.Oe!==null){var y=a.Oe;y.diagram.remove(y.temporaryFromNode),y.diagram.remove(y.temporaryToNode),a.Oe.originalLink=null}a.draggedLink=null,a.Oe=null}}function Iu(a,y,x){var b=a.diagram,E=a.startPoint,z=jt.alloc();z.assign(b.lastInput.documentPoint),a.moveParts(y,z.re(E),x),jt.free(z),b.Gf("temporaryPixelRatio")===!0&&b.Yh===null&&30<b.$w&&(tr(b),b.hk())}ti.prototype.moveParts=function(a,y,x){x===void 0&&(x=!1);var b=this.diagram;b!==null&&Xh(b,a,y,this.dragOptions,x)};function vh(a){if(a.draggedParts!==null){for(var y=a.diagram,x=a.draggedParts.iterator;x.next();){var b=x.key;b.Zc()&&(b.location=x.value.point)}for(x=a.draggedParts.iterator;x.next();)if(b=x.key,b instanceof _e&&b.suspendsRouting){var E=x.value.point;a.draggedParts.add(b,a.Pd()),Fd(b,-E.x,-E.y)}y.bd()}}function jf(a,y){var x=a.diagram;a.dragsLink&&(a.draggedLink!==null&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),yh(a,!1));var b=a.findDragOverObject(y),E=x.lastInput;E.targetObject=b,a.doUpdateCursor(b);var z=x.skipsUndoManager,tt=!1;try{if(x.skipsUndoManager=!0,tt=yc(a,E,b),!a.isActive&&ws===null)return;var rt=b!==null?b.part:null;if(rt===null||x.handlesDragDropForTopLevelParts&&rt.isTopLevel&&!(rt instanceof Yn)){var ot=x.mouseDragOver;ot!==null&&(ot(E),tt=!0)}if(!a.isActive&&ws===null||(a.doDragOver(y,b),!a.isActive&&ws===null))return}finally{x.skipsUndoManager=z,tt&&x.bd()}a.Bn=b,x.isReadOnly||!x.allowMove&&!x.allowCopy||!x.allowHorizontalScroll&&!x.allowVerticalScroll||x.gs(E.viewPoint)}ti.prototype.findDragOverObject=function(a){var y=this;return _a(this.diagram,a,null,function(x){return x===null?x=!0:(x=x.part,x=!!(x===null||x instanceof Bi||x.layer.isTemporary||y.draggedParts&&y.draggedParts.contains(x)||y.copiedParts&&y.copiedParts.contains(x))),!x})},ti.prototype.doUpdateCursor=function(a){var y=this.diagram;(a===null||this.Bn!==a)&&(!this.diagram.currentTool.isActive||this.mayCopy()?y.currentCursor=this.copyCursor:this.mayMove()?y.currentCursor=this.moveCursor:this.mayDragOut()&&(y.currentCursor=this.nodropCursor))};function yc(a,y,x){var b=!1,E=a.Cg.length,z=0<E?a.Cg[0]:null;if(x===z)return!1;y.handled=!1;for(var tt=0;tt<E;tt++){var rt=a.Cg[tt],ot=rt.mouseDragLeave;if(ot!==null&&(ot(y,rt,x),b=!0,y.handled))break}if(a.Cg.length=0,!a.isActive&&ws===null||x===null)return b;for(y.handled=!1,E=x;E!==null;)a.Cg.push(E),E=tg(E);for(E=a.Cg.length,x=0;x<E&&(tt=a.Cg[x],rt=tt.mouseDragEnter,rt===null||(rt(y,tt,z),b=!0,!y.handled));x++);return b}function tg(a){var y=a.panel;return y!==null?y:a instanceof vn&&!(a instanceof Yn)&&(a=a.containingGroup,a!==null&&a.handlesDragDropForMembers)?a:null}function eg(a,y,x){var b=a.Oe;if(b===null)return null;var E=a.diagram.og(y,b.portGravity,function(at){return b.findValidLinkablePort(at,x)});a=jt.alloc();var z=1/0,tt=null;for(E=E.iterator;E.next();){var rt=E.value;if(rt.part!==null){var ot=rt.ga(Xi,a);ot=y.Bf(ot),ot<z&&(tt=rt,z=ot)}}return jt.free(a),tt}function yh(a,y){var x=a.draggedLink;if(x!==null&&!(2>x.pointsCount)){var b=a.diagram;if(!b.isReadOnly){var E=a.Oe;if(E!==null){var z=null,tt=null;x.fromNode===null&&(z=eg(a,x.i(0),!1),z!==null&&(tt=z.part));var rt=null,ot=null;x.toNode===null&&(rt=eg(a,x.i(x.pointsCount-1),!0),rt!==null&&(ot=rt.part)),E.isValidLink(tt,z,ot,rt)?y?(x.defaultFromPoint=x.i(0),x.defaultToPoint=x.i(x.pointsCount-1),x.suspendsRouting=!1,x.fromNode=tt,z!==null&&(x.fromPortId=z.portId),x.toNode=ot,rt!==null&&(x.toPortId=rt.portId),x.fromPort!==b.Mx&&b.R("LinkRelinked",x,b.Mx),x.toPort!==b.Nx&&b.R("LinkRelinked",x,b.Nx)):zf(E,tt,z,ot,rt):zf(E,null,null,null,null)}}}}ti.prototype.doDragOver=function(){};function Sh(a,y){var x=a.diagram;a.dragsLink&&yh(a,!0),Wh(a);var b=a.findDragOverObject(y),E=x.lastInput;if(E.targetObject=b,b!==null){E.handled=!1;for(var z=b;z!==null;){var tt=z.mouseDrop;if(tt!==null&&(tt(E,z),E.handled))break;om(a,E,z),z=tg(z)}}else z=x.mouseDrop,z!==null&&z(E);if(a.isActive||ws!==null){for(E=(a.copiedParts||a.draggedParts).iterator;E.next();)z=E.key,z instanceof $e&&z.linksConnected.each(function(rt){rt.suspendsRouting=!1});if(a.doDropOnto(y,b),a.isActive||ws!==null){for(a=ye.alloc(),y=x.selection.iterator;y.next();)b=y.value,b instanceof $e&&Zg(x,b,a);ye.free(a)}}}function om(a,y,x){a=a.diagram,x=x.part,!a.handlesDragDropForTopLevelParts||!x.isTopLevel||x instanceof Yn||(x=a.mouseDrop,x!==null&&x(y))}function Zg(a,y,x){var b=!1;if(x=y.getAvoidableRect(x),a.viewportBounds.Re(x)&&(b=!0),a=a.Nu(x,function(E){return E.part},function(E){return E instanceof _e},!0,function(E){return E instanceof _e},b),a.count!==0)for(a=a.iterator;a.next();)x=a.value,!x.Td(y)&&x.isAvoiding&&x.bb()}ti.prototype.doDropOnto=function(){},ti.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;this.simulatedMouseMove(y.event,y.documentPoint,y.targetDiagram)||this.currentPart===null||this.draggedParts===null||(this.mayCopy()?(qu(this,!1),qd(a,this.copiedParts),Iu(this,this.copiedParts,!1),ih(a,this.copiedParts)):this.mayMove()?(jl(this),Iu(this,this.draggedParts,!0)):this.mayDragOut()?(qu(this,!1),Iu(this,this.copiedParts,!1)):jl(this),jf(this,a.lastInput.documentPoint))}},ti.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=a.lastInput;if(!this.simulatedMouseUp(y.event,y.documentPoint,y.targetDiagram)){y=!1;var x=this.mayCopy();if(x&&this.copiedParts!==null?(jl(this),qu(this,!0),qd(a,this.copiedParts),Iu(this,this.copiedParts,!1),ih(a,this.copiedParts),this.copiedParts!==null&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(E){E.isSelected=!0}))):(y=!0,jl(this),this.mayMove()&&(Iu(this,this.draggedParts,!0),jf(this,a.lastInput.documentPoint))),this.Ym=!0,Sh(this,a.lastInput.documentPoint),this.isActive){var b=x?this.copiedParts.Lf():this.draggedParts.Lf();this.copiedParts=null,y&&Sc(this),a.Ya(),ih(a,this.draggedParts),this.transactionResult=x?"Copy":"Move",a.R(x?"SelectionCopied":"SelectionMoved",b)}this.stopTool(),x&&a.R("ChangedSelection",a.selection)}}},ti.prototype.simulatedMouseMove=function(a,y,x){if(ws===null)return!1;var b=ws.diagram;x instanceof se||(x=null);var E=th;return x!==E&&(E!==null&&E!==b&&(E.ug(),ws.isDragOutStarted=!1,E=E.toolManager.findTool("Dragging"),E!==null&&E.doSimulatedDragLeave()),th=x,x!==null&&x!==b&&(Rf(),E=x.toolManager.findTool("Dragging"),E!==null&&(xa.contains(E)||xa.add(E),E.doSimulatedDragEnter())),this.doUpdateCursor(null)),x===null||x===b||!x.allowDrop||x.isReadOnly||!x.allowInsert?!1:(b=x.toolManager.findTool("Dragging"),b!==null&&(a!==null&&(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!1,b.doSimulatedDragOver()),!0)},ti.prototype.simulatedMouseUp=function(a,y,x){if(ws===null)return!1;var b=th,E=ws.diagram;if(x===null)return ws.doCancel(),!0;if(x!==b){var z=b.toolManager.findTool("Dragging");if(b!==null&&b!==E&&z!==null)return b.ug(),ws.isDragOutStarted=!1,z.doSimulatedDragLeave(),!1;th=x,b=x.toolManager.findTool("Dragging"),b!==null&&(Rf(),xa.contains(b)||xa.add(b),b.doSimulatedDragEnter())}return x!==this.diagram?(a!==null?(a.targetTouches!==void 0&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),y=x.getMouse(a)):y===null&&(y=new jt),x.lastInput.documentPoint=y,x.lastInput.viewPoint=x.op(y),x.lastInput.down=!1,x.lastInput.up=!0,a=x.toolManager.findTool("Dragging"),a!==null&&a.doSimulatedDrop(),a=ws,a!==null&&(x=a.mayCopy(),a.transactionResult=x?"Copy":"Move",a.stopTool()),!0):!1};function Sc(a){if(a.draggedParts!==null)for(var y=a.draggedParts.iterator;y.next();){var x=y.key;x instanceof $e&&(x=x.containingGroup,x===null||x.placeholder===null||a.draggedParts.contains(x)||x.placeholder.v())}}ti.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(Ps?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},ti.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canCopy())},ti.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return!!(this.draggedLink!==null&&this.dragsLink&&this.draggedLink.canMove())},ti.prototype.computeBorder=function(a,y,x){return this.Ym||this.draggedParts===null||this.draggedParts.contains(a)?null:x.assign(y)},ti.prototype.Az=function(){return ws},ti.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var y=ws;return!(y===null||y.diagram.model.dataFormat!==a.model.dataFormat)},ti.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Cc(),gl(a),a.animationManager.Cc(),a=ws,a!==null&&(a.diagram.Ns=!1),this.doUpdateCursor(null)}},ti.prototype.doSimulatedDragLeave=function(){var a=ws;a!==null&&a.doSimulatedDragOut(),this.doCancel()},ti.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Dm=!0;var y=ws;if(y!==null&&y.draggedParts!==null){if(!this.mayDragIn())return;Jg(this,y.draggedParts.Lf(),!1,a.firstInput),Iu(this,this.copiedParts,!1),jf(this,a.lastInput.documentPoint)}a.animationManager.Dm=!1},ti.prototype.doSimulatedDrop=function(){var a=this.diagram,y=ws;if(y!==null){var x=y.diagram;if(y.Ym=!0,jl(this),!this.mayDragIn())return;a.animationManager.Dm=!0,a.R("ChangingSelection",a.selection),this.Ea("Drop"),Jg(this,y.draggedParts.Lf(),!0,a.lastInput),Iu(this,this.copiedParts,!1);var b=new Ye;this.copiedParts!==null&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(E){E.isSelected=!0,b.add(E)})),Sh(this,a.lastInput.documentPoint),a.Ya(),this.copiedParts!==null&&(this.transactionResult="ExternalCopy"),this.copiedParts=null,a.doFocus(),a.R("ExternalObjectsDropped",b,x),this.stopTransaction(),a.R("ChangedSelection",a.selection)}a.animationManager.Dm=!1};function Jg(a,y,x,b){if(a.copiedParts===null){var E=a.diagram;if(!E.isReadOnly&&!E.isModelReadOnly){E.skipsUndoManager=!x,E.partManager.addsToTemporaryLayer=!x,a.startPoint=b.documentPoint,x=E.Kj(y,E,!0);var z=ye.alloc();E=b=1/0;for(var tt=-1/0,rt=-1/0,ot=y.iterator;ot.next();){var at=ot.value;if(at.isVisible()){var ut=at.location;at=ut.x,ut=ut.y,isNaN(at)||isNaN(ut)||(at<b&&(b=at),ut<E&&(E=ut),at>tt&&(tt=at),ut>rt&&(rt=ut))}}for(b===1/0?z.h(0,0,0,0):z.h(b,E,tt-b,rt-E),b=z.x+z.width/2,E=z.y+z.height/2,ye.free(z),z=a.Fr,tt=new xn,rt=jt.alloc(),ot=y.iterator;ot.next();)at=ot.value,at instanceof _e&&at.canCopy()&&(ut=x.I(at),ut!==null&&(ut.points=at.points,Fd(ut,z.x-b,z.y-E),ut.suspendsRouting=!0,tt.add(ut,a.Pd())));for(y=y.iterator;y.next();)at=y.value,at.Zc()&&at.canCopy()&&(ot=x.I(at),ot!==null&&(at=at.location,rt.h(z.x-(b-at.x),z.y-(E-at.y)),ot.location=rt,ot.Va(),tt.add(ot,a.Pd(rt))));jt.free(rt),a.copiedParts=tt,If(a,tt.Lf()),a.draggedLink!==null&&(x=a.draggedLink,y=x.routeBounds,Fd(x,a.startPoint.x-(y.x+y.width/2),a.startPoint.y-(y.y+y.height/2))),a.doUpdateCursor(null)}}}ti.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.Ns=!1,this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor,this.Bn=null},ti.prototype.computeMove=function(a,y,x,b){return x=this.diagram,x!==null?x.computeMove(a,y,this.dragOptions,b):new jt},Oe.Object.defineProperties(ti.prototype,{isCopyEnabled:{get:function(){return this.ob},set:function(a){this.ob=a}},copiesEffectiveCollection:{get:function(){return this.u},set:function(a){this.u=a}},dragOptions:{get:function(){return this.ia},set:function(a){this.ia=a}},isGridSnapEnabled:{get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{get:function(){return this.hb},set:function(a){this.hb=a}},isGridSnapRealtime:{get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){this.dragOptions.isGridSnapRealtime=a}},gridSnapCellSize:{get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){this.dragOptions.gridSnapCellSize.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){this.dragOptions.gridSnapCellSpot.D(a)||(a=a.J(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){this.dragOptions.gridSnapOrigin.D(a)||(a=a.J(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{get:function(){return this.dragOptions.dragsLink},set:function(a){this.dragOptions.dragsLink=a}},dragsTree:{get:function(){return this.dragOptions.dragsTree},set:function(a){this.dragOptions.dragsTree=a}},copyCursor:{get:function(){return this.F},set:function(a){this.F=a}},moveCursor:{get:function(){return this.Oc},set:function(a){this.Oc=a}},nodropCursor:{get:function(){return this.Pc},set:function(a){this.Pc=a}},currentPart:{get:function(){return this.V},set:function(a){this.V=a}},copiedParts:{get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{get:function(){return this.Ha},set:function(a){this.Ha=a}},draggingParts:{get:function(){return this.copiedParts!==null?this.copiedParts.Lf():this.draggedParts!==null?this.draggedParts.Lf():this.te}},draggedLink:{get:function(){return this.diagram.draggedLink},set:function(a){this.diagram.draggedLink=a}},isDragOutStarted:{get:function(){return this.Hb},set:function(a){this.Hb=a}},startPoint:{get:function(){return this.Fr},set:function(a){this.Fr.D(a)||this.Fr.assign(a)}},delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}}}),ti.prototype.getDraggingSource=ti.prototype.Az;var ws=null,th=null;ti.className="DraggingTool",xa=new Ve,hn("draggingTool",function(){return this.findTool("Dragging")},function(a){this.gb("Dragging",a,this.mouseMoveTools)}),jr.prototype.doCancel=function(){ws!==null&&ws.doCancel(),Ei.prototype.doCancel.call(this)};function so(){Ei.call(this),this.te=100,this.Ha=!1,this.u="pointer";var a=new _e,y=new Qn;y.isPanelMain=!0,y.stroke="blue",a.add(y),y=new Qn,y.toArrow="Standard",y.fill="blue",y.stroke="blue",a.add(y),a.layerName="Tool",this.Ci=a,a=new $e,y=new Qn,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=fo,a.add(y),a.selectable=!1,a.layerName="Tool",this.Bi=a,this.j=y,a=new $e,y=new Qn,y.portId="",y.figure="Rectangle",y.fill=null,y.stroke="magenta",y.strokeWidth=2,y.desiredSize=fo,a.add(y),a.selectable=!1,a.layerName="Tool",this.Di=a,this.o=y,this.Pc=this.Oc=this.ob=this.hb=this.Hb=null,this.ia=!0,this.hy=new xn,this.Of=this.gj=this.Pf=null}le(so,Ei),so.prototype.doStop=function(){this.diagram.ug(),this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null,this.validPortsCache.clear(),this.targetPort=null},so.prototype.copyPortProperties=function(a,y,x,b,E){if(a!==null&&y!==null&&x!==null&&b!==null){var z=y.Df(),tt=Ze.alloc();tt.width=y.naturalBounds.width*z,tt.height=y.naturalBounds.height*z,b.desiredSize=tt,Ze.free(tt),E?(b.toSpot=y.toSpot,b.toEndSegmentLength=y.toEndSegmentLength):(b.fromSpot=y.fromSpot,b.fromEndSegmentLength=y.fromEndSegmentLength),x.locationSpot=Xi,z=jt.alloc(),x.location=y.ga(Xi,z),jt.free(z),b.angle=y.li(),this.portTargeted!==null&&this.portTargeted(a,y,x,b,E)}},so.prototype.setNoTargetPortProperties=function(a,y,x){y!==null&&(y.desiredSize=fo,y.fromSpot=us,y.toSpot=us),a!==null&&(a.location=this.diagram.lastInput.documentPoint),this.portTargeted!==null&&this.portTargeted(null,null,a,y,x)},so.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()},so.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null&&this.targetPort.part instanceof $e){var y=this.targetPort.part;this.isForwards?this.copyPortProperties(y,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(y,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,!0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},so.prototype.findValidLinkablePort=function(a,y){if(a===null)return null;var x=a.part;if(!(x instanceof $e))return null;for(;a!==null;){var b=y?a.toLinkable:a.fromLinkable;if(b===!0&&(a.portId!==null||a instanceof $e)&&(y?this.isValidTo(x,a):this.isValidFrom(x,a)))return a;if(b===!1)break;a=a.panel}return null},so.prototype.findTargetPort=function(a){var y=this.diagram,x=y.lastInput.documentPoint,b=this.portGravity;0>=b&&(b=.1);var E=this,z=y.og(x,b,function(ct){return E.findValidLinkablePort(ct,a)},null,!0);for(b=1/0,y=null,z=z.iterator;z.next();){var tt=z.value,rt=tt.part;if(rt instanceof $e){var ot=tt.ga(Xi,jt.alloc()),at=x.x-ot.x,ut=x.y-ot.y;jt.free(ot),ot=at*at+ut*ut,ot<b&&(at=this.validPortsCache.I(tt),at!==null?at&&(y=tt,b=ot):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,rt,tt)||!a&&this.isValidLink(rt,tt,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(tt,!0),y=tt,b=ot):this.validPortsCache.add(tt,!1))}}return y!==null&&(x=y.part,x instanceof $e&&(x.layer===null||x.layer.allowLink))?y:null},so.prototype.isValidFrom=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.fromLinkable!==!0))return!1;var x=y.fromMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalFromNode&&y===this.originalFromPort)return!0;if(y=y.portId,y===null&&(y=""),a.Mo(y).count>=x)return!1}return!0},so.prototype.isValidTo=function(a,y){if(a===null||y===null)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(a.layer!==null&&!a.layer.allowLink||y.toLinkable!==!0))return!1;var x=y.toMaxLinks;if(1/0>x){if(this.originalLink!==null&&a===this.originalToNode&&y===this.originalToPort)return!0;if(y=y.portId,y===null&&(y=""),a.Sd(y).count>=x)return!1}return!0},so.prototype.isInSameNode=function(a,y){return a===null||y===null?!1:a===y?!0:(a=a.part,y=y.part,a!==null&&a===y)},so.prototype.isLinked=function(a,y){if(a===null||y===null)return!1;var x=a.part;if(!(x instanceof $e))return!1;a=a.portId,a===null&&(a="");var b=y.part;if(!(b instanceof $e))return!1;for(y=y.portId,y===null&&(y=""),y=b.Sd(y);y.next();)if(b=y.value,b.fromNode===x&&b.fromPortId===a)return!0;return!1},so.prototype.isValidLink=function(a,y,x,b){if(!this.isValidFrom(a,y)||!this.isValidTo(x,b)||!(y===null||b===null||(y.fromLinkableSelfNode&&b.toLinkableSelfNode||!this.isInSameNode(y,b))&&(y.fromLinkableDuplicates&&b.toLinkableDuplicates||!this.isLinked(y,b)))||this.originalLink!==null&&(a!==null&&this.isLabelDependentOnLink(a,this.originalLink)||x!==null&&this.isLabelDependentOnLink(x,this.originalLink))||a!==null&&x!==null&&(a.data===null&&x.data!==null||a.data!==null&&x.data===null)||!this.isValidCycle(a,x,this.originalLink))return!1;if(a!==null){var E=a.linkValidation;if(E!==null&&!E(a,y,x,b,this.originalLink))return!1}return x!==null&&(E=x.linkValidation,E!==null&&!E(a,y,x,b,this.originalLink))?!1:(E=this.linkValidation,E!==null?E(a,y,x,b,this.originalLink):!0)},so.prototype.isLabelDependentOnLink=function(a,y){if(a===null)return!1;var x=a.labeledLink;if(x===null)return!1;if(x===y)return!0;var b=new Ye;return b.add(a),Xs(this,x,y,b)};function Xs(a,y,x,b){if(y===x)return!0;var E=y.fromNode;return E!==null&&E.isLinkLabel&&(b.add(E),Xs(a,E.labeledLink,x,b))?!0:(y=y.toNode,!!(y!==null&&y.isLinkLabel&&(b.add(y),Xs(a,y.labeledLink,x,b))))}so.prototype.isValidCycle=function(a,y,x){if(x===void 0&&(x=null),a===null||y===null)return this.isUnconnectedLinkValid;var b=this.diagram.validCycle;if(b!==Lc){if(b===op){if(b=x||this.temporaryLink,b!==null&&!b.isTreeLink)return!0;for(b=y.linksConnected;b.next();){var E=b.value;if(E!==x&&E.isTreeLink&&E.toNode===y)return!1}return!Zs(this,a,y,x,!0)}if(b===sp){if(b=x||this.temporaryLink,b!==null&&!b.isTreeLink)return!0;for(b=a.linksConnected;b.next();)if(E=b.value,E!==x&&E.isTreeLink&&E.fromNode===a)return!1;return!Zs(this,a,y,x,!0)}if(b===np)return a===y?a=!0:(b=new Ye,b.add(y),a=ta(this,b,a,y,x)),!a;if(b===ip)return!Zs(this,a,y,x,!1);if(b===rp)return a===y?a=!0:(b=new Ye,b.add(y),a=Qd(this,b,a,y,x)),!a}return!0};function Zs(a,y,x,b,E){if(y===x)return!0;if(y===null||x===null)return!1;for(var z=y.linksConnected;z.next();){var tt=z.value;if(tt!==b&&(!E||tt.isTreeLink)&&tt.toNode===y&&(tt=tt.fromNode,tt!==y&&Zs(a,tt,x,b,E)))return!0}return!1}function ta(a,y,x,b,E){if(x===b)return!0;if(x===null||b===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==E&&tt.toNode===x&&(tt=tt.fromNode,tt!==x&&ta(a,y,tt,b,E)))return!0}return!1}function Qd(a,y,x,b,E){if(x===b)return!0;if(x===null||b===null||y.contains(x))return!1;y.add(x);for(var z=x.linksConnected;z.next();){var tt=z.value;if(tt!==E){var rt=tt.fromNode;if(tt=tt.toNode,rt=rt===x?tt:rt,rt!==x&&Qd(a,y,rt,b,E))return!0}}return!1}Oe.Object.defineProperties(so.prototype,{portGravity:{get:function(){return this.te},set:function(a){0<=a&&(this.te=a)}},isUnconnectedLinkValid:{get:function(){return this.Ha},set:function(a){this.Ha=a}},linkingCursor:{get:function(){return this.u},set:function(a){this.u=a}},temporaryLink:{get:function(){return this.Ci},set:function(a){this.Ci=a}},temporaryFromNode:{get:function(){return this.Bi},set:function(a){(this.Bi=a)&&(this.j=a.port)}},temporaryFromPort:{get:function(){return this.j},set:function(a){if(this.j!==null){var y=this.j.panel;if(y!==null){var x=y.O.indexOf(this.j);y.mb(x),y.Gb(x,a)}}this.j=a}},temporaryToNode:{get:function(){return this.Di},set:function(a){(this.Di=a)&&(this.o=a.port)}},temporaryToPort:{get:function(){return this.o},set:function(a){if(this.o!==null){var y=this.o.panel;if(y!==null){var x=y.O.indexOf(this.o);y.mb(x),y.Gb(x,a)}}this.o=a}},originalLink:{get:function(){return this.Hb},set:function(a){this.Hb=a}},originalFromNode:{get:function(){return this.hb},set:function(a){this.hb=a}},originalFromPort:{get:function(){return this.ob},set:function(a){this.ob=a}},originalToNode:{get:function(){return this.Oc},set:function(a){this.Oc=a}},originalToPort:{get:function(){return this.Pc},set:function(a){this.Pc=a}},isForwards:{get:function(){return this.ia},set:function(a){this.ia=a}},validPortsCache:{get:function(){return this.hy}},targetPort:{get:function(){return this.Pf},set:function(a){this.Pf=a}},linkValidation:{get:function(){return this.gj},set:function(a){this.gj=a}},portTargeted:{get:function(){return this.Of},set:function(a){this.Of=a}}}),so.className="LinkingBaseTool";function ea(){so.call(this),this.name="Linking",this.V={},this.F=null,this.K=xh,this.Xd=null}le(ea,so),ea.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.xs()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:this.findLinkablePort()!==null},ea.prototype.findLinkablePort=function(){var a=this.diagram,y=this.startObject;if(y===null&&(y=a.ic(a.firstInput.documentPoint,null,null)),y===null||(a=y.part,!(a instanceof $e)))return null;var x=this.direction;if(x===xh||x===Qg){var b=this.findValidLinkablePort(y,!1);if(b!==null||this.startObject===a&&(b=a.port,this.findValidLinkablePort(b,!1)))return this.isForwards=!0,b}return(x===xh||x===$g)&&(y=this.findValidLinkablePort(y,!0),y!==null||this.startObject===a&&(y=a.port,this.findValidLinkablePort(y,!0)))?(this.isForwards=!1,y):null},ea.prototype.doActivate=function(){var a=this.diagram,y=this.findLinkablePort();y===null?this.stopTool():(this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(this.temporaryToNode!==null&&(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=y,y=this.originalFromPort.part,y instanceof $e&&(this.originalFromNode=y),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1)):(this.temporaryFromNode!==null&&(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=y,y=this.originalToPort.part,y instanceof $e&&(this.originalToNode=y),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),this.temporaryFromNode&&this.temporaryFromNode.Va(),a.add(this.temporaryToNode),this.temporaryToNode&&this.temporaryToNode.Va(),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0)},ea.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},ea.prototype.doStop=function(){so.prototype.doStop.call(this),this.startObject=null},ea.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,y=this.transactionResult=null,x=null,b=null,E=null,z=null;try{var tt=this.targetPort=this.findTargetPort(this.isForwards);if(tt!==null){var rt=tt.part;rt instanceof $e&&(this.isForwards?(this.originalFromNode!==null&&(y=this.originalFromNode,x=this.originalFromPort),b=rt,E=tt):(y=rt,x=tt,this.originalToNode!==null&&(b=this.originalToNode,E=this.originalToPort)))}else this.isForwards?this.originalFromNode!==null&&this.isUnconnectedLinkValid&&(y=this.originalFromNode,x=this.originalFromPort):this.originalToNode!==null&&this.isUnconnectedLinkValid&&(b=this.originalToNode,E=this.originalToPort);y!==null||b!==null?(z=this.insertLink(y,x,b,E),z!==null?(tt===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint),a.allowSelect&&(a.R("ChangingSelection",a.selection),a.clearSelection(!0),z.isSelected=!0),this.transactionResult=this.name,a.R("LinkDrawn",z)):this.doNoLink(y,x,b,E)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),z&&a.allowSelect&&a.R("ChangedSelection",a.selection)}}},ea.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(a===null)return!0;if(a instanceof _e)return a.isTreeLink;var y=this.diagram;return y===null?!0:(a=y.partManager.getLinkCategoryForData(a),y=y.partManager.findLinkTemplateForCategory(a),y!==null?y.isTreeLink:!0)},ea.prototype.insertLink=function(a,y,x,b){return this.diagram.partManager.insertLink(a,y,x,b)},ea.prototype.doNoLink=function(){},Oe.Object.defineProperties(ea.prototype,{archetypeLinkData:{get:function(){return this.V},set:function(a){this.V=a}},archetypeLabelNodeData:{get:function(){return this.F},set:function(a){this.F=a}},direction:{get:function(){return this.K},set:function(a){this.K=a}},startObject:{get:function(){return this.Xd},set:function(a){this.Xd=a}}});var xh=new me(ea,"Either",0),Qg=new me(ea,"ForwardsOnly",0),$g=new me(ea,"BackwardsOnly",0);ea.className="LinkingTool",ea.Either=xh,ea.ForwardsOnly=Qg,ea.BackwardsOnly=$g;function cl(){so.call(this),this.name="Relinking";var a=new Qn;a.figure="Diamond",a.desiredSize=Mo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=0,this.V=a,a=new Qn,a.figure="Diamond",a.desiredSize=Mo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor=this.linkingCursor,a.segmentIndex=-1,this.Xd=a,this.F=null,this.Ew=new ye}le(cl,so),cl.prototype.updateAdornments=function(a){if(a!==null&&a instanceof _e){var y="RelinkFrom",x=null;if(a.isSelected&&!this.diagram.isReadOnly){var b=a.selectionObject;b!==null&&a.canRelinkFrom()&&a.actualBounds.w()&&a.isVisible()&&b.actualBounds.w()&&b.Ed()&&(x=a.Pj(y),x===null&&(x=this.makeAdornment(b,!1),a.bh(y,x)))}x===null&&a.Jf(y),y="RelinkTo",x=null,a.isSelected&&!this.diagram.isReadOnly&&(b=a.selectionObject,b!==null&&a.canRelinkTo()&&a.actualBounds.w()&&a.isVisible()&&b.actualBounds.w()&&b.Ed()&&(x=a.Pj(y),x===null?(x=this.makeAdornment(b,!0),a.bh(y,x)):x.v())),x===null&&a.Jf(y)}},cl.prototype.makeAdornment=function(a,y){var x=new Bi;return x.type=Re.Link,y=y?this.toHandleArchetype:this.fromHandleArchetype,y!==null&&x.add(y.copy()),x.adornedObject=a,x},cl.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.xs()||!a.lastInput.left)return!1;var y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");return y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")),y!==null},cl.prototype.doActivate=function(){var a=this.diagram;if(this.originalLink===null){var y=this.handle;if(y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),y===null&&(y=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"))),y===null)return;var x=y.part;if(!(x instanceof Bi&&x.adornedPart instanceof _e))return;this.handle=y,this.isForwards=x===null||x.category==="RelinkTo",this.originalLink=x.adornedPart}this.Ea(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.originalFromPort=this.originalLink.fromPort,this.originalFromNode=this.originalLink.fromNode,this.originalToPort=this.originalLink.toPort,this.originalToNode=this.originalLink.toNode,this.Ew.set(this.originalLink.actualBounds),this.originalLink!==null&&0<this.originalLink.pointsCount&&(this.originalLink.fromNode===null&&(this.temporaryFromPort!==null&&(this.temporaryFromPort.desiredSize=Rr),this.temporaryFromNode!==null&&(this.temporaryFromNode.location=this.originalLink.i(0))),this.originalLink.toNode===null&&(this.temporaryToPort!==null&&(this.temporaryToPort.desiredSize=Rr),this.temporaryToNode!==null&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1)))),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),this.temporaryLink!==null&&(this.temporaryFromNode!==null&&(this.temporaryLink.fromNode=this.temporaryFromNode),this.temporaryToNode!==null&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.bb(),a.add(this.temporaryLink)),this.isActive=!0},cl.prototype.copyLinkProperties=function(a,y){if(a!==null&&y!==null){y.adjusting=a.adjusting,y.corner=a.corner;var x=a.curve;(x===Mg||x===Td)&&(x=Ea),y.curve=x,y.curviness=a.curviness,y.isTreeLink=a.isTreeLink,y.points=a.points,y.routing=a.routing,y.smoothness=a.smoothness,y.fromSpot=a.fromSpot,y.fromEndSegmentLength=a.fromEndSegmentLength,y.fromShortLength=a.fromShortLength,y.toSpot=a.toSpot,y.toEndSegmentLength=a.toEndSegmentLength,y.toShortLength=a.toShortLength}},cl.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink),a.remove(this.temporaryFromNode),a.remove(this.temporaryToNode),a.isMouseCaptured=!1,a.currentCursor="",this.stopTransaction()},cl.prototype.doStop=function(){so.prototype.doStop.call(this),this.handle=null},cl.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var y=this.originalFromNode,x=this.originalFromPort,b=this.originalToNode,E=this.originalToPort,z=this.originalLink;try{if(this.targetPort=this.findTargetPort(this.isForwards),this.targetPort!==null){var tt=this.targetPort.part;tt instanceof $e&&(this.isForwards?(b=tt,E=this.targetPort):(y=tt,x=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?E=b=null:x=y=null:z=null;z!==null?(this.reconnectLink(z,this.isForwards?b:y,this.isForwards?E:x,this.isForwards),this.targetPort===null&&(this.isForwards?z.defaultToPoint=a.lastInput.documentPoint:z.defaultFromPoint=a.lastInput.documentPoint,z.bb()),this.transactionResult=this.name,a.R("LinkRelinked",z,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards),this.originalLink.Xo(this.Ew)}finally{this.stopTool()}}},cl.prototype.reconnectLink=function(a,y,x,b){return x=x!==null&&x.portId!==null?x.portId:"",b?(a.toNode=y,a.toPortId=x):(a.fromNode=y,a.fromPortId=x),!0},cl.prototype.doNoRelink=function(){};function zf(a,y,x,b,E){y!==null?(a.copyPortProperties(y,x,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode),b!==null?(a.copyPortProperties(b,E,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)}Oe.Object.defineProperties(cl.prototype,{fromHandleArchetype:{get:function(){return this.V},set:function(a){this.V=a}},toHandleArchetype:{get:function(){return this.Xd},set:function(a){this.Xd=a}},handle:{get:function(){return this.F},set:function(a){if(a!==null&&!(a.part instanceof Bi))throw Error("new handle is not in an Adornment: "+a);this.F=a}}}),cl.className="RelinkingTool",hn("linkingTool",function(){return this.findTool("Linking")},function(a){this.gb("Linking",a,this.mouseMoveTools)}),hn("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.gb("Relinking",a,this.mouseDownTools)});function yo(){Ei.call(this),this.name="LinkReshaping";var a=new Qn;a.figure="Rectangle",a.desiredSize=ls,a.fill="lightblue",a.stroke="dodgerblue",this.o=a,a=new Qn,a.figure="Diamond",a.desiredSize=Mo,a.fill="lightblue",a.stroke="dodgerblue",a.cursor="move",this.u=a,this.F=3,this.Ts=this.j=null,this.Fw=new jt,this.Yq=new Ve}le(yo,Ei),yo.prototype.Ru=function(a){return a&&a.reshapingBehavior.value!==0?a.reshapingBehavior:xc},yo.prototype.om=function(a,y){a.reshapingBehavior=y},yo.prototype.updateAdornments=function(a){if(a!==null&&a instanceof _e){var y=null;if(a.isSelected&&!this.diagram.isReadOnly){var x=a.path;x!==null&&a.canReshape()&&a.actualBounds.w()&&a.isVisible()&&x.actualBounds.w()&&x.Ed()&&(y=a.Pj(this.name),y===null||y.Aw!==a.pointsCount||y.Uw!==a.resegmentable)&&(y=this.makeAdornment(x),y!==null&&(y.Aw=a.pointsCount,y.Uw=a.resegmentable,a.bh(this.name,y)))}y===null&&a.Jf(this.name)}},yo.prototype.makeAdornment=function(a){var y=a.part,x=y.pointsCount,b=y.isOrthogonal,E=null;if(y.points!==null&&1<x){E=new Bi,E.type=Re.Link,x=y.firstPickIndex;var z=y.lastPickIndex,tt=b?1:0;if(y.resegmentable&&y.computeCurve()!==Al)for(var rt=x+tt;rt<z-tt;rt++){var ot=this.makeResegmentHandle(a,rt);ot!==null&&(ot.segmentIndex=rt,ot.segmentFraction=.5,ot.fromMaxLinks=999,E.add(ot))}for(tt=x+1;tt<z;tt++)if(rt=this.makeHandle(a,tt),rt!==null){if(rt.segmentIndex=tt,tt!==x)if(tt===x+1&&b){ot=y.i(x);var at=y.i(x+1);ne.B(ot.x,at.x)&&ne.B(ot.y,at.y)&&(at=y.i(x-1)),ne.B(ot.x,at.x)?(this.om(rt,Ft),rt.cursor="n-resize"):ne.B(ot.y,at.y)&&(this.om(rt,kt),rt.cursor="w-resize")}else tt===z-1&&b?(ot=y.i(z-1),at=y.i(z),ne.B(ot.x,at.x)&&ne.B(ot.y,at.y)&&(ot=y.i(z+1)),ne.B(ot.x,at.x)?(this.om(rt,Ft),rt.cursor="n-resize"):ne.B(ot.y,at.y)&&(this.om(rt,kt),rt.cursor="w-resize")):tt!==z&&(this.om(rt,Wt),rt.cursor="move");E.add(rt)}E.adornedObject=a}return E},yo.prototype.makeHandle=function(){var a=this.handleArchetype;return a===null?null:a.copy()},yo.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return a===null?null:a.copy()},yo.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},yo.prototype.doActivate=function(){var a=this.diagram;if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null){var y=this.handle.part.adornedPart;if(y instanceof _e){if(this.Ts=y,a.isMouseCaptured=!0,this.Ea(this.name),y.resegmentable&&this.handle.fromMaxLinks===999){var x=y.points.copy(),b=this.getResegmentingPoint();if(x.Gb(this.handle.segmentIndex+1,b),y.isOrthogonal&&x.Gb(this.handle.segmentIndex+1,b),y.points=x,y.Wb(),y.updateAdornments(),this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name),this.handle===null){this.doDeactivate();return}}this.Fw=y.i(this.handle.segmentIndex),this.Yq=y.points.copy(),this.isActive=!0}}},yo.prototype.doDeactivate=function(){this.stopTransaction(),this.Ts=this.handle=null,this.isActive=this.diagram.isMouseCaptured=!1},yo.prototype.stopTransaction=function(){var a=this.diagram,y=Ei.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},yo.prototype.doCancel=function(){var a=this.adornedLink;a!==null&&(a.points=this.Yq),this.stopTool()},yo.prototype.getResegmentingPoint=function(){return this.handle.ga(Xi)},yo.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))},yo.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.computeReshape(a.lastInput.documentPoint);if(this.reshape(y),y=this.adornedLink,y!==null&&y.resegmentable){var x=this.handle.segmentIndex,b=y.i(x-1),E=y.i(x),z=y.i(x+1);if(y.isOrthogonal){if(x>y.firstPickIndex+1&&x<y.lastPickIndex-1){var tt=y.i(x-2);if(Math.abs(b.x-E.x)<this.resegmentingDistance&&Math.abs(b.y-E.y)<this.resegmentingDistance&&(Ph(this,tt,b,E,z,!0)||Ph(this,tt,b,E,z,!1))){var rt=y.points.copy();Ph(this,tt,b,E,z,!0)?(rt.cd(x-2,new jt(tt.x,(z.y+tt.y)/2)),rt.cd(x+1,new jt(z.x,(z.y+tt.y)/2))):(rt.cd(x-2,new jt((z.x+tt.x)/2,tt.y)),rt.cd(x+1,new jt((z.x+tt.x)/2,z.y))),rt.mb(x),rt.mb(x-1),y.points=rt,y.Wb()}else tt=y.i(x+2),Math.abs(E.x-z.x)<this.resegmentingDistance&&Math.abs(E.y-z.y)<this.resegmentingDistance&&(Ph(this,b,E,z,tt,!0)||Ph(this,b,E,z,tt,!1))&&(rt=y.points.copy(),Ph(this,b,E,z,tt,!0)?(rt.cd(x-1,new jt(b.x,(b.y+tt.y)/2)),rt.cd(x+2,new jt(tt.x,(b.y+tt.y)/2))):(rt.cd(x-1,new jt((b.x+tt.x)/2,b.y)),rt.cd(x+2,new jt((b.x+tt.x)/2,tt.y))),rt.mb(x+1),rt.mb(x),y.points=rt,y.Wb())}}else tt=jt.alloc(),ne.qh(b.x,b.y,z.x,z.y,E.x,E.y,tt)&&tt.Bf(E)<this.resegmentingDistance*this.resegmentingDistance&&(b=y.points.copy(),b.mb(x),y.points=b,y.Wb()),jt.free(tt)}a.Ya(),this.transactionResult=this.name,a.R("LinkReshaped",this.adornedLink,this.Yq)}this.stopTool()};function Ph(a,y,x,b,E,z){return z?Math.abs(y.y-x.y)<a.resegmentingDistance&&Math.abs(x.y-b.y)<a.resegmentingDistance&&Math.abs(b.y-E.y)<a.resegmentingDistance:Math.abs(y.x-x.x)<a.resegmentingDistance&&Math.abs(x.x-b.x)<a.resegmentingDistance&&Math.abs(b.x-E.x)<a.resegmentingDistance}yo.prototype.reshape=function(a){var y=this.adornedLink;y.uh();var x=this.handle.segmentIndex,b=this.Ru(this.handle);if(y.isOrthogonal)if(x===y.firstPickIndex+1)x=y.firstPickIndex+1,b===Ft?(y.L(x,y.i(x-1).x,a.y),y.L(x+1,y.i(x+2).x,a.y)):b===kt&&(y.L(x,a.x,y.i(x-1).y),y.L(x+1,a.x,y.i(x+2).y));else if(x===y.lastPickIndex-1)x=y.lastPickIndex-1,b===Ft?(y.L(x-1,y.i(x-2).x,a.y),y.L(x,y.i(x+1).x,a.y)):b===kt&&(y.L(x-1,a.x,y.i(x-2).y),y.L(x,a.x,y.i(x+1).y));else{b=x;var E=y.i(b),z=y.i(b-1),tt=y.i(b+1);ne.B(z.x,E.x)&&ne.B(E.y,tt.y)?(ne.B(z.x,y.i(b-2).x)&&!ne.B(z.y,y.i(b-2).y)?(y.m(b,a.x,z.y),x++,b++):y.L(b-1,a.x,z.y),ne.B(tt.y,y.i(b+2).y)&&!ne.B(tt.x,y.i(b+2).x)?y.m(b+1,tt.x,a.y):y.L(b+1,tt.x,a.y)):ne.B(z.y,E.y)&&ne.B(E.x,tt.x)?(ne.B(z.y,y.i(b-2).y)&&!ne.B(z.x,y.i(b-2).x)?(y.m(b,z.x,a.y),x++,b++):y.L(b-1,z.x,a.y),ne.B(tt.x,y.i(b+2).x)&&!ne.B(tt.y,y.i(b+2).y)?y.m(b+1,a.x,tt.y):y.L(b+1,a.x,tt.y)):ne.B(z.x,E.x)&&ne.B(E.x,tt.x)?(ne.B(z.x,y.i(b-2).x)&&!ne.B(z.y,y.i(b-2).y)?(y.m(b,a.x,z.y),x++,b++):y.L(b-1,a.x,z.y),ne.B(tt.x,y.i(b+2).x)&&!ne.B(tt.y,y.i(b+2).y)?y.m(b+1,a.x,tt.y):y.L(b+1,a.x,tt.y)):ne.B(z.y,E.y)&&ne.B(E.y,tt.y)&&(ne.B(z.y,y.i(b-2).y)&&!ne.B(z.x,y.i(b-2).x)?(y.m(b,z.x,a.y),x++,b++):y.L(b-1,z.x,a.y),ne.B(tt.y,y.i(b+2).y)&&!ne.B(tt.x,y.i(b+2).x)?y.m(b+1,tt.x,a.y):y.L(b+1,tt.x,a.y)),y.L(x,a.x,a.y)}else y.L(x,a.x,a.y),b=y.fromNode,E=y.fromPort,b!==null&&(z=b.findVisibleNode(),z!==null&&z!==b&&(b=z,E=b.port)),x===1&&y.computeSpot(!0,E).Mc()&&(z=E.ga(Xi,jt.alloc()),b=y.getLinkPointFromPoint(b,E,z,a,!0,jt.alloc()),y.L(0,b.x,b.y),jt.free(z),jt.free(b)),b=y.toNode,E=y.toPort,b!==null&&(z=b.findVisibleNode(),z!==null&&z!==b&&(b=z,E=b.port)),x===y.pointsCount-2&&y.computeSpot(!1,E).Mc()&&(x=E.ga(Xi,jt.alloc()),a=y.getLinkPointFromPoint(b,E,x,a,!1,jt.alloc()),y.L(y.pointsCount-1,a.x,a.y),jt.free(x),jt.free(a));y.zf()},yo.prototype.computeReshape=function(a){var y=this.adornedLink,x=this.handle.segmentIndex;switch(this.Ru(this.handle)){case Wt:return a;case Ft:return new jt(y.i(x).x,a.y);case kt:return new jt(a.x,y.i(x).y);default:case xc:return y.i(x)}},Oe.Object.defineProperties(yo.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},midHandleArchetype:{get:function(){return this.u},set:function(a){this.u=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof Bi))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedLink:{get:function(){return this.Ts}},resegmentingDistance:{get:function(){return this.F},set:function(a){this.F=a}},originalPoint:{get:function(){return this.Fw}},originalPoints:{get:function(){return this.Yq}}}),yo.prototype.setReshapingBehavior=yo.prototype.om,yo.prototype.getReshapingBehavior=yo.prototype.Ru;var xc=new me(yo,"None",0),kt=new me(yo,"Horizontal",1),Ft=new me(yo,"Vertical",2),Wt=new me(yo,"All",3);yo.className="LinkReshapingTool",yo.None=xc,yo.Horizontal=kt,yo.Vertical=Ft,yo.All=Wt,hn("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.gb("LinkReshaping",a,this.mouseDownTools)});function Zt(){Ei.call(this),this.name="Resizing",this.o=new Ze(1,1).freeze(),this.j=new Ze(9999,9999).freeze(),this.yg=new Ze(NaN,NaN).freeze(),this.V=!1,this.ia=!0,this.ue=null;var a=new Qn;a.alignmentFocus=Xi,a.figure="Rectangle",a.desiredSize=ls,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.F=a,this.u=null,this.Xq=new jt,this.Dw=new Ze,this.Tn=new jt,this.rt=new Ze(0,0),this.qt=new Ze(1/0,1/0),this.pt=new Ze(1,1)}le(Zt,Ei),Zt.prototype.updateAdornments=function(a){if(!(a===null||a instanceof _e)){if(a.isSelected&&!this.diagram.isReadOnly){var y=a.resizeObject,x=a.Pj(this.name);if(y!==null&&a.canResize()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed()&&((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null)){y=y.li(),sf(a)&&this.updateResizeHandles(x,y),a.bh(this.name,x);return}}a.Jf(this.name)}},Zt.prototype.makeAdornment=function(a){var y=a.part.resizeAdornmentTemplate;if(y===null){y=new Bi,y.type=Re.Spot,y.locationSpot=Xi;var x=new ba;x.isPanelMain=!0,y.add(x),y.add(this.makeHandle(a,ms)),y.add(this.makeHandle(a,cd)),y.add(this.makeHandle(a,Ll)),y.add(this.makeHandle(a,Du)),y.add(this.makeHandle(a,$a)),y.add(this.makeHandle(a,js)),y.add(this.makeHandle(a,Ks)),y.add(this.makeHandle(a,ya))}else if(ru(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},Zt.prototype.makeHandle=function(a,y){return a=this.handleArchetype,a===null?null:(a=a.copy(),a.alignment=y,a)},Zt.prototype.updateResizeHandles=function(a,y){if(a!==null){if(!a.alignment.Xb()&&(a.cursor==="pointer"||0<a.cursor.indexOf("resize")))t:{var x=a.alignment;if(x.Mc()&&(x=Xi),0>=x.x)y=0>=x.y?y+225:1<=x.y?y+135:y+180;else if(1<=x.x)0>=x.y?y+=315:1<=x.y&&(y+=45);else if(0>=x.y)y+=270;else if(1<=x.y)y+=90;else break t;0>y?y+=360:360<=y&&(y-=360),a.cursor=22.5>y?"e-resize":67.5>y?"se-resize":112.5>y?"s-resize":157.5>y?"sw-resize":202.5>y?"w-resize":247.5>y?"nw-resize":292.5>y?"n-resize":337.5>y?"ne-resize":"e-resize"}else if(a instanceof Re)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,y)}},Zt.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowResize&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},Zt.prototype.doActivate=function(){var a=this.diagram;this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle!==null&&(this.adornedObject=this.handle.part.adornedObject,this.adornedObject!==null&&(a.isMouseCaptured=!0,a.animationManager.Cc(),this.Ea(this.name),this.Xq.set(this.adornedObject.ga(this.handle.alignment.gv())),this.Tn.set(this.adornedObject.part.location),this.Dw.set(this.adornedObject.desiredSize),this.pt=this.computeCellSize(),this.rt=this.computeMinSize(),this.qt=this.computeMaxSize(),this.isActive=!0))},Zt.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.isActive=a.isMouseCaptured=!1},Zt.prototype.stopTransaction=function(){var a=this.diagram,y=Ei.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},Zt.prototype.doCancel=function(){this.adornedObject!==null&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation),this.stopTool()},Zt.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,b=this.pt,E=this.adornedObject.qs(a.lastInput.documentPoint,jt.alloc()),z=this.computeReshape();y=this.computeResize(E,this.handle.alignment,y,x,b,z),this.resize(y),a.bd(),jt.free(E)}},Zt.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var y=this.rt,x=this.qt,b=this.pt,E=this.adornedObject.qs(a.lastInput.documentPoint,jt.alloc()),z=this.computeReshape();y=this.computeResize(E,this.handle.alignment,y,x,b,z),this.resize(y),jt.free(E),a.Ya(),this.transactionResult=this.name,a.R("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()},Zt.prototype.resize=function(a){var y=this.diagram,x=this.adornedObject;if(x!==null){if(x.desiredSize=a.size,a=x.part,a.Va(),x=x.ga(this.handle.alignment.gv()),a instanceof Yn){var b=new Ve;if(b.add(a),!this.dragsMembers&&a.placeholder===null){var E=new st;E.dragsMembers=!1}y.moveParts(b,this.oppositePoint.copy().re(x),!0,E)}else a.location=a.location.copy().re(x).add(this.oppositePoint);y.bd()}},Zt.prototype.computeResize=function(a,y,x,b,E,z){y.Mc()&&(y=Xi);var tt=this.adornedObject.naturalBounds,rt=tt.x,ot=tt.y,at=tt.x+tt.width,ut=tt.y+tt.height,ct=1;if(!z){ct=tt.width;var mt=tt.height;0>=ct&&(ct=1),0>=mt&&(mt=1),ct=mt/ct}return mt=jt.alloc(),ne.No(a.x,a.y,rt,ot,E.width,E.height,mt),a=tt.copy(),0>=y.x?0>=y.y?(a.x=Math.max(mt.x,at-b.width),a.x=Math.min(a.x,at-x.width),a.width=Math.max(at-a.x,x.width),a.y=Math.max(mt.y,ut-b.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,b.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,b.width),x.width),a.height=ct*a.width),a.x=at-a.width,a.y=ut-a.height)):1<=y.y?(a.x=Math.max(mt.x,at-b.width),a.x=Math.min(a.x,at-x.width),a.width=Math.max(at-a.x,x.width),a.height=Math.max(Math.min(mt.y-ot,b.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,b.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,b.width),x.width),a.height=ct*a.width),a.x=at-a.width)):(a.x=Math.max(mt.x,at-b.width),a.x=Math.min(a.x,at-x.width),a.width=at-a.x,z||(a.height=Math.max(Math.min(ct*a.width,b.height),x.height),a.width=a.height/ct,a.y=ot+.5*(ut-ot-a.height))):1<=y.x?0>=y.y?(a.width=Math.max(Math.min(mt.x-rt,b.width),x.width),a.y=Math.max(mt.y,ut-b.height),a.y=Math.min(a.y,ut-x.height),a.height=Math.max(ut-a.y,x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,b.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,b.width),x.width),a.height=ct*a.width),a.y=ut-a.height)):1<=y.y?(a.width=Math.max(Math.min(mt.x-rt,b.width),x.width),a.height=Math.max(Math.min(mt.y-ot,b.height),x.height),z||(1<=a.height/a.width?(a.height=Math.max(Math.min(ct*a.width,b.height),x.height),a.width=a.height/ct):(a.width=Math.max(Math.min(a.height/ct,b.width),x.width),a.height=ct*a.width))):(a.width=Math.max(Math.min(mt.x-rt,b.width),x.width),z||(a.height=Math.max(Math.min(ct*a.width,b.height),x.height),a.width=a.height/ct,a.y=ot+.5*(ut-ot-a.height))):0>=y.y?(a.y=Math.max(mt.y,ut-b.height),a.y=Math.min(a.y,ut-x.height),a.height=ut-a.y,z||(a.width=Math.max(Math.min(a.height/ct,b.width),x.width),a.height=ct*a.width,a.x=rt+.5*(at-rt-a.width))):1<=y.y&&(a.height=Math.max(Math.min(mt.y-ot,b.height),x.height),z||(a.width=Math.max(Math.min(a.height/ct,b.width),x.width),a.height=ct*a.width,a.x=rt+.5*(at-rt-a.width))),jt.free(mt),a},Zt.prototype.computeReshape=function(){var a=Ee;return this.adornedObject instanceof Qn&&(a=Lv(this.adornedObject)),!(a===dn||this.diagram.lastInput.shift)},Zt.prototype.computeMinSize=function(){var a=this.adornedObject.minSize.copy(),y=this.minSize;return!isNaN(y.width)&&y.width>a.width&&(a.width=y.width),!isNaN(y.height)&&y.height>a.height&&(a.height=y.height),a},Zt.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),y=this.maxSize;return!isNaN(y.width)&&y.width<a.width&&(a.width=y.width),!isNaN(y.height)&&y.height<a.height&&(a.height=y.height),a},Zt.prototype.computeCellSize=function(){var a=new Ze(NaN,NaN),y=this.adornedObject.part;return y!==null&&(y=y.resizeCellSize,!isNaN(y.width)&&0<y.width&&(a.width=y.width),!isNaN(y.height)&&0<y.height&&(a.height=y.height)),y=this.cellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height),y=this.diagram,(isNaN(a.width)||isNaN(a.height))&&y&&(y=y.grid,y!==null&&y.visible&&this.isGridSnapEnabled&&(y=y.gridCellSize,isNaN(a.width)&&!isNaN(y.width)&&0<y.width&&(a.width=y.width),isNaN(a.height)&&!isNaN(y.height)&&0<y.height&&(a.height=y.height))),(isNaN(a.width)||a.width===0||a.width===1/0)&&(a.width=1),(isNaN(a.height)||a.height===0||a.height===1/0)&&(a.height=1),a},Oe.Object.defineProperties(Zt.prototype,{handleArchetype:{get:function(){return this.F},set:function(a){this.F=a}},handle:{get:function(){return this.u},set:function(a){if(a!==null&&!(a.part instanceof Bi))throw Error("new handle is not in an Adornment: "+a);this.u=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof Bi)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},minSize:{get:function(){return this.o},set:function(a){if(!this.o.D(a)){var y=a.width;isNaN(y)&&(y=0),a=a.height,isNaN(a)&&(a=0),this.o.h(y,a)}}},maxSize:{get:function(){return this.j},set:function(a){if(!this.j.D(a)){var y=a.width;isNaN(y)&&(y=1/0),a=a.height,isNaN(a)&&(a=1/0),this.j.h(y,a)}}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||this.yg.assign(a)}},isGridSnapEnabled:{get:function(){return this.V},set:function(a){this.V=a}},dragsMembers:{get:function(){return this.ia},set:function(a){this.ia=a}},oppositePoint:{get:function(){return this.Xq},set:function(a){this.Xq.D(a)||this.Xq.assign(a)}},originalDesiredSize:{get:function(){return this.Dw}},originalLocation:{get:function(){return this.Tn}}}),Zt.className="ResizingTool",hn("resizingTool",function(){return this.findTool("Resizing")},function(a){this.gb("Resizing",a,this.mouseDownTools)});function pe(){Ei.call(this),this.name="Rotating",this.ia=45,this.V=2,this.Tn=new jt,this.ue=null;var a=new Qn;a.figure="Ellipse",a.desiredSize=Mo,a.fill="lightblue",a.stroke="dodgerblue",a.strokeWidth=1,a.cursor="pointer",this.o=a,this.j=null,this.Cw=0,this.kr=new jt(NaN,NaN),this.u=0,this.F=50}le(pe,Ei),pe.prototype.updateAdornments=function(a){if(a!==null){if(a.ph()){var y=a.rotateObject;if(y===a||y===a.path||y.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(y=a.rotateObject,y!==null&&a.canRotate()&&a.actualBounds.w()&&a.isVisible()&&y.actualBounds.w()&&y.Ed())){var x=a.Pj(this.name);if((x===null||x.adornedObject!==y)&&(x=this.makeAdornment(y)),x!==null){x.angle=y.li(),x.placeholder===null&&(x.location=this.computeAdornmentLocation(y)),a.bh(this.name,x);return}}a.Jf(this.name)}},pe.prototype.makeAdornment=function(a){var y=a.part.rotateAdornmentTemplate;if(y===null){y=new Bi,y.type=Re.Position,y.locationSpot=Xi;var x=this.handleArchetype;x!==null&&y.add(x.copy())}else if(ru(y),y=y.copy(),y===null)return null;return y.adornedObject=a,y},pe.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?this.findToolHandleAt(a.firstInput.documentPoint,this.name)!==null:!1},pe.prototype.doActivate=function(){var a=this.diagram;if(this.adornedObject===null){if(this.handle===null&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name)),this.handle===null)return;this.adornedObject=this.handle.part.adornedObject}this.adornedObject!==null&&(a.isMouseCaptured=!0,a.delaysLayout=!0,this.Ea(this.name),this.Cw=this.adornedObject.angle,this.kr=this.computeRotationPoint(this.adornedObject),this.Tn=this.adornedObject.part.location.copy(),this.isActive=!0)},pe.prototype.computeRotationPoint=function(a){var y=a.part,x=y.locationObject;return y.rotationSpot.sb()?a.ga(y.rotationSpot):a===y||a===x?x.ga(y.locationSpot):a.ga(Xi)},pe.prototype.computeAdornmentLocation=function(a){var y=this.rotationPoint;y.w()||(y=this.computeRotationPoint(a)),y=a.qs(y);var x=this.handleAngle;0>x?x+=360:360<=x&&(x-=360),x=Math.round(45*Math.round(x/45));var b=this.handleDistance;return x===0?y.x=a.naturalBounds.width+b:x===45?(y.x=a.naturalBounds.width+b,y.y=a.naturalBounds.height+b):x===90?y.y=a.naturalBounds.height+b:x===135?(y.x=-b,y.y=a.naturalBounds.height+b):x===180?y.x=-b:x===225?(y.x=-b,y.y=-b):x===270?y.y=-b:x===315&&(y.x=a.naturalBounds.width+b,y.y=-b),a.ga(y)},pe.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction(),this.ue=this.handle=null,this.kr=new jt(NaN,NaN),this.isActive=a.isMouseCaptured=!1},pe.prototype.stopTransaction=function(){var a=this.diagram,y=Ei.prototype.stopTransaction.call(this);return y&&a.undoManager.transactionToUndo!==null&&a.undoManager.transactionToUndo.ak(),y},pe.prototype.doCancel=function(){this.diagram.delaysLayout=!1,this.rotate(this.originalAngle),this.stopTool()},pe.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))},pe.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var y=this.computeRotate(a.lastInput.documentPoint);this.rotate(y),a.Ya(),this.transactionResult=this.name,a.R("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()},pe.prototype.rotate=function(a){var y=this.adornedObject;if(y!==null){y.angle=a,y=y.part,y.Va();var x=y.locationObject,b=y.rotateObject;(x===b||x.rg(b))&&(x=this.Tn.copy(),y.location=x.re(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint)),this.diagram.bd()}},pe.prototype.computeRotate=function(a){a=this.rotationPoint.ab(a)-this.handleAngle;var y=this.adornedObject.panel;y!==null&&(a-=y.li()),360<=a?a-=360:0>a&&(a+=360),y=Math.min(Math.abs(this.snapAngleMultiple),180);var x=Math.min(Math.abs(this.snapAngleEpsilon),y/2);return!this.diagram.lastInput.shift&&0<y&&0<x&&(a%y<x?a=Math.floor(a/y)*y:a%y>y-x&&(a=(Math.floor(a/y)+1)*y)),360<=a?a-=360:0>a&&(a+=360),a},Oe.Object.defineProperties(pe.prototype,{handleArchetype:{get:function(){return this.o},set:function(a){this.o=a}},handle:{get:function(){return this.j},set:function(a){if(a!==null&&!(a.part instanceof Bi))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{get:function(){return this.ue},set:function(a){if(a!==null&&a.part instanceof Bi)throw Error("new handle must not be in an Adornment: "+a);this.ue=a}},snapAngleMultiple:{get:function(){return this.ia},set:function(a){this.ia=a}},snapAngleEpsilon:{get:function(){return this.V},set:function(a){this.V=a}},originalAngle:{get:function(){return this.Cw}},rotationPoint:{get:function(){return this.kr},set:function(a){this.kr=a.copy()}},handleAngle:{get:function(){return this.u},set:function(a){this.u=a}},handleDistance:{get:function(){return this.F},set:function(a){this.F=a}}}),pe.className="RotatingTool",hn("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.gb("Rotating",a,this.mouseDownTools)});function De(){Ei.call(this),this.name="ClickSelecting"}le(De,Ei),De.prototype.canStart=function(){return!(!this.isEnabled||this.isBeyondDragSize())},De.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip()),this.stopTool()},De.className="ClickSelectingTool";function je(){Ei.call(this),this.name="Action",this.pk=null}le(je,Ei),je.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,y=a.lastInput,x=a.ic(y.documentPoint,function(b){for(;b.panel!==null&&!b.isActionable;)b=b.panel;return b});return x!==null&&x.isActionable?(this.pk=x,a.Ck=a.ic(y.documentPoint,null,null),!0):!1},je.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionDown!==null&&y.actionDown(a,y))}else this.canStart()&&this.doActivate()},je.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionMove!==null&&y.actionMove(a,y))}},je.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,y=this.pk;if(y===null)return;a.targetObject=y,y.actionUp!==null&&y.actionUp(a,y),this.standardMouseClick(function(x){for(;x.panel!==null&&(!x.isActionable||x!==y);)x=x.panel;return x},function(x){return x===y})}this.stopTool()},je.prototype.doCancel=function(){var a=this.diagram.lastInput,y=this.pk;y!==null&&(a.targetObject=y,y.actionCancel!==null&&y.actionCancel(a,y),this.stopTool())},je.prototype.doStop=function(){this.pk=null},je.className="ActionTool";function en(){Ei.call(this),this.name="ClickCreating",this.Ri=null,this.o=!0,this.j=!1,this.mw=new jt(0,0)}le(en,Ei),en.prototype.canStart=function(){if(!this.isEnabled||this.archetypeNodeData===null)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(a.lastInput.clickCount===1&&(this.mw=a.lastInput.viewPoint.copy()),a.lastInput.clickCount!==2||this.isBeyondDragSize(this.mw))return!1}else if(a.lastInput.clickCount!==1)return!1;return!(a.currentTool!==this&&a.Ol(a.lastInput.documentPoint,!0)!==null)},en.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint),this.stopTool()},en.prototype.insertPart=function(a){var y=this.diagram,x=this.archetypeNodeData;if(x===null)return null;var b=null;try{if(y.R("ChangingSelection",y.selection),this.Ea(this.name),x instanceof vn)x.Zc()&&(ru(x),b=x.copy(),b!==null&&y.add(b));else if(x!==null){var E=y.model.copyNodeData(x);Ue(E)&&(y.model.xf(E),b=y.Lc(E))}if(b!==null){var z=jt.allocAt(a.x,a.y);this.isGridSnapEnabled&&Uf(this.diagram,b,a,z),b.location=z,y.allowSelect&&(y.clearSelection(!0),b.isSelected=!0),jt.free(z)}y.Ya(),this.transactionResult=this.name,y.R("PartCreated",b)}finally{this.stopTransaction(),y.R("ChangedSelection",y.selection)}return b},Oe.Object.defineProperties(en.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){this.Ri=a}},isDoubleClick:{get:function(){return this.o},set:function(a){this.o=a}},isGridSnapEnabled:{get:function(){return this.j},set:function(a){this.j=a}}}),en.className="ClickCreatingTool";function rn(){Ei.call(this),this.name="DragSelecting",this.Ik=175,this.o=!1;var a=new vn;a.layerName="Tool",a.selectable=!1;var y=new Qn;y.name="SHAPE",y.figure="Rectangle",y.fill=null,y.stroke="magenta",a.add(y),this.j=a}le(rn,Ei),rn.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var y=a.lastInput;return!(!y.left||a.currentTool!==this&&(!this.isBeyondDragSize()||y.timestamp-a.firstInput.timestamp<this.delay||a.Ol(y.documentPoint,!0)!==null))},rn.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0,a.isMouseCaptured=!0,a.skipsUndoManager=!0,a.add(this.box),this.doMouseMove()},rn.prototype.doDeactivate=function(){var a=this.diagram;a.ug(),a.remove(this.box),a.skipsUndoManager=!1,this.isActive=a.isMouseCaptured=!1},rn.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&this.box!==null){var y=this.computeBoxBounds(),x=this.box.fb("SHAPE");x===null&&(x=this.box.Pb());var b=Ze.alloc().h(y.width,y.height);x.desiredSize=b,this.box.mm(y.x,y.y,!1),Ze.free(b),(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.gs(a.lastInput.viewPoint)}},rn.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.R("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()},rn.prototype.computeBoxBounds=function(){var a=this.diagram;return new ye(a.firstInput.documentPoint,a.lastInput.documentPoint)},rn.prototype.selectInRect=function(a){var y=this.diagram,x=y.lastInput;if(a=y.ux(a,this.isPartialInclusion),Ps?x.meta:x.control)if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected&&(y.isSelected=!1);else for(a=a.iterator;a.next();)y=a.value,y.isSelected=!y.isSelected;else if(x.shift)for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0);else{for(x=new Ve,y=y.selection.iterator;y.next();){var b=y.value;a.contains(b)||x.add(b)}for(y=x.iterator;y.next();)y.value.isSelected=!1;for(a=a.iterator;a.next();)y=a.value,y.isSelected||(y.isSelected=!0)}},Oe.Object.defineProperties(rn.prototype,{delay:{get:function(){return this.Ik},set:function(a){this.Ik=a}},isPartialInclusion:{get:function(){return this.o},set:function(a){this.o=a}},box:{get:function(){return this.j},set:function(a){this.j=a}}}),rn.className="DragSelectingTool";function ln(){Ei.call(this),this.name="Panning",this.Xt=new jt,this.xy=new jt,this.xg=!1;var a=this;this.Kw=function(){var y=a.diagram;y!==null&&y.removeEventListener(xe.document,"scroll",a.Kw,!1),a.stopTool()}}le(ln,Ei),ln.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!(!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize())},ln.prototype.doActivate=function(){var a=this.diagram;this.xg?(a.lastInput.bubbles=!0,a.addEventListener(xe.document,"scroll",this.Kw,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.Xt.assign(a.position)),this.isActive=!0},ln.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="",this.isActive=a.isMouseCaptured=!1},ln.prototype.doCancel=function(){var a=this.diagram;a.position=this.Xt,a.isMouseCaptured=!1,this.stopTool()},ln.prototype.doMouseMove=function(){this.move()},ln.prototype.doMouseUp=function(){this.move(),this.stopTool()},ln.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.xg)a.lastInput.bubbles=!0;else{var y=a.position,x=a.firstInput.documentPoint,b=a.lastInput.documentPoint,E=y.x+x.x-b.x;x=y.y+x.y-b.y,a.allowHorizontalScroll||(E=y.x),a.allowVerticalScroll||(x=y.y),a.position=this.xy.h(E,x)}},Oe.Object.defineProperties(ln.prototype,{bubbles:{get:function(){return this.xg},set:function(a){this.xg=a}},originalPosition:{get:function(){return this.Xt}}}),ln.className="PanningTool",hn("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.gb("ClickCreating",a,this.mouseUpTools)}),hn("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.gb("ClickSelecting",a,this.mouseUpTools)}),hn("panningTool",function(){return this.findTool("Panning")},function(a){this.gb("Panning",a,this.mouseMoveTools)}),hn("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.gb("DragSelecting",a,this.mouseMoveTools)}),hn("actionTool",function(){return this.findTool("Action")},function(a){this.gb("Action",a,this.mouseDownTools)});function Cn(){this.F=this.u=this.j=this.o=null}Oe.Object.defineProperties(Cn.prototype,{mainElement:{get:function(){return this.u},set:function(a){this.u=a}},show:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},hide:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},valueFunction:{get:function(){return this.F},set:function(a){this.F=a}}}),Cn.className="HTMLInfo";function Tn(a,y,x){this.text=a,this.hx=y,this.visible=x}Tn.className="ContextMenuButtonInfo";function _n(){Ei.call(this),this.name="ContextMenu",this.o=this.ht=this.j=null,this.yw=new jt,this.jt=null,this.Et=!1;var a=this;this.tu=function(){a.stopTool()}}le(_n,Ei);function kn(a){var y=new Cn;y.show=function(E,z,tt){tt.showDefaultContextMenu()},y.hide=function(E,z){z.hideDefaultContextMenu()},Zi=y,a.tu=function(){a.stopTool()},y=an("div");var x=an("div");y.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px",x.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";var b=an("style");xe.document.getElementsByTagName("head")[0].appendChild(b),b.sheet.insertRule(".goCXul { list-style: none; }",0),b.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0),b.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0),b=a.diagram,b!==null&&(b.addEventListener(y,"contextmenu",bn,!1),b.addEventListener(y,"selectstart",bn,!1),b.addEventListener(x,"contextmenu",bn,!1)),y.className="goCXforeground",x.className="goCXbackground",xe.document.body&&(xe.document.body.appendChild(y),xe.document.body.appendChild(x)),dr=y,Ti=x,Si=!0}function bn(a){return a.preventDefault(),!1}_n.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right||1<a.lastInput.clickCount?!1:!!(a.lastInput.isTouchEvent&&this.defaultTouchContextMenu!==null||this.findObjectWithContextMenu()!==null)},_n.prototype.doStart=function(){this.yw.set(this.diagram.firstInput.documentPoint)},_n.prototype.doStop=function(){this.hideContextMenu(),this.currentObject=null},_n.prototype.findObjectWithContextMenu=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.lastInput,b=null;if(a instanceof se||(a instanceof te?b=a:b=y.ic(x.documentPoint,null,function(E){return!E.layer.isTemporary})),b!==null){for(a=b;a!==null;){if(a.contextMenu!==null)return a;a=a.panel}if(y.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return b.part}else if(y.contextMenu!==null)return y;return null},_n.prototype.doActivate=function(){},_n.prototype.doMouseDown=function(){if(Ei.prototype.doMouseDown.call(this),this.isActive&&this.currentContextMenu instanceof Bi){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&Vn(this)},_n.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Bi){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}Vn(this)};function Vn(a){var y=a.diagram;if(a.isActive){var x=a.currentContextMenu;if(x!==null){var b=null;x instanceof Cn||(b=y.ic(y.lastInput.documentPoint,null,null),b!==null&&b.rg(x)&&a.standardMouseClick(null,null)),a.maybeStopTool(b)}}else a.canStart()&&(Hn(a,!0),a.isActive||a.stopTool())}_n.prototype.maybeStopTool=function(){this.stopTool(),this.canStart()&&(this.diagram.currentTool=this,this.doMouseUp())};function Hn(a,y,x){if(x===void 0&&(x=null),!a.Et&&(a.Et=!0,y&&a.standardMouseSelect(),y=a.standardMouseClick(),a.Et=!1,!y)){if(a.isActive=!0,y=Zi,x===null&&(x=a.findObjectWithContextMenu()),x!==null){var b=x.contextMenu;b!==null?(a.currentObject=x instanceof te?x:null,a.showContextMenu(b,a.currentObject)):y!==null&&a.showContextMenu(y,a.currentObject)}else y!==null&&a.showContextMenu(y,null);a.currentContextMenu instanceof Bi&&!a.currentContextMenu.visible&&a.stopTool()}}_n.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");a!==null&&a.doMouseMove(),this.isActive&&this.diagram.toolManager.doMouseMove()},_n.prototype.showContextMenu=function(a,y){var x=this.diagram;if(a!==this.currentContextMenu&&this.hideContextMenu(),a instanceof Bi){a.layerName="Tool",a.selectable=!1,a.scale=1/x.scale,a.category=this.name,a.placeholder!==null&&(a.placeholder.scale=x.scale);var b=a.diagram;b!==null&&b!==x&&b.remove(a),x.add(a),y!==null?a.adornedObject=y:a.data=x.model,a.Va(),this.positionContextMenu(a,y)}else a instanceof Cn&&a.show(y,x,this);this.currentContextMenu=a},_n.prototype.positionContextMenu=function(a){if(a.placeholder===null){var y=this.diagram,x=y.lastInput.documentPoint.copy(),b=a.measuredBounds,E=y.viewportBounds;y.lastInput.isTouchEvent&&(x.x-=b.width),x.x+b.width>E.right&&(x.x-=b.width+5/y.scale),x.x<E.x&&(x.x=E.x),x.y+b.height>E.bottom&&(x.y-=b.height+5/y.scale),x.y<E.y&&(x.y=E.y),a.position=x}},_n.prototype.hideContextMenu=function(){var a=this.diagram,y=this.currentContextMenu;y!==null&&(y instanceof Bi?(a.remove(y),this.ht!==null&&this.ht.Jf(y.category),y.data=null,y.adornedObject=null):y instanceof Cn&&(y.hide!==null?y.hide(a,this):y.mainElement!==null&&(y.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};function Fi(a){var y=new Ve;return y.add(new Tn("Copy",function(x){x.commandHandler.copySelection()},function(x){return x.commandHandler.canCopySelection()})),y.add(new Tn("Cut",function(x){x.commandHandler.cutSelection()},function(x){return x.commandHandler.canCutSelection()})),y.add(new Tn("Delete",function(x){x.commandHandler.deleteSelection()},function(x){return x.commandHandler.canDeleteSelection()})),y.add(new Tn("Paste",function(x){x.commandHandler.pasteSelection(a.mouseDownPoint)},function(x){return x.commandHandler.canPasteSelection(a.mouseDownPoint)})),y.add(new Tn("Select All",function(x){x.commandHandler.selectAll()},function(x){return x.commandHandler.canSelectAll()})),y.add(new Tn("Undo",function(x){x.commandHandler.undo()},function(x){return x.commandHandler.canUndo()})),y.add(new Tn("Redo",function(x){x.commandHandler.redo()},function(x){return x.commandHandler.canRedo()})),y.add(new Tn("Scroll To Part",function(x){x.commandHandler.scrollToPart()},function(x){return x.commandHandler.canScrollToPart()})),y.add(new Tn("Zoom To Fit",function(x){x.commandHandler.zoomToFit()},function(x){return x.commandHandler.canZoomToFit()})),y.add(new Tn("Reset Zoom",function(x){x.commandHandler.resetZoom()},function(x){return x.commandHandler.canResetZoom()})),y.add(new Tn("Group Selection",function(x){x.commandHandler.groupSelection()},function(x){return x.commandHandler.canGroupSelection()})),y.add(new Tn("Ungroup Selection",function(x){x.commandHandler.ungroupSelection()},function(x){return x.commandHandler.canUngroupSelection()})),y.add(new Tn("Edit Text",function(x){x.commandHandler.editTextBlock()},function(x){return x.commandHandler.canEditTextBlock()})),y}_n.prototype.showDefaultContextMenu=function(){var a=this.diagram;this.jt===null&&(this.jt=Fi(this)),dr.innerHTML="",Ti.addEventListener("pointerdown",this.tu,!1);var y=this,x=an("ul");x.className="goCXul",dr.appendChild(x),x.innerHTML="";for(var b=this.jt.iterator;b.next();){var E=b.value,z=E.visible;if(typeof E.hx=="function"&&(typeof z!="function"||z(a))){z=an("li"),z.className="goCXli";var tt=an("a");tt.className="goCXa",tt.href="#",tt.ky=E.hx,tt.addEventListener("pointerdown",function(rt){return this.ky(a),y.stopTool(),rt.preventDefault(),!1},!1),tt.textContent=E.text,z.appendChild(tt),x.appendChild(z)}}dr.style.display="block",Ti.style.display="block"},_n.prototype.hideDefaultContextMenu=function(){if(this.currentContextMenu!==null&&this.currentContextMenu===Zi){dr.style.display="none",Ti.style.display="none";var a=this.diagram;a!==null&&a.removeEventListener(Ti,"pointerdown",this.tu,!1),this.currentContextMenu=null}},Oe.Object.defineProperties(_n.prototype,{currentContextMenu:{get:function(){return this.j},set:function(a){this.j=a,this.ht=a instanceof Bi?a.adornedPart:null}},defaultTouchContextMenu:{get:function(){return Si===!1&&Zi===null&&So&&kn(this),Zi},set:function(a){a===null&&(Si=!0),Zi=a}},currentObject:{get:function(){return this.o},set:function(a){this.o=a}},mouseDownPoint:{get:function(){return this.yw}}});var Zi=null,Si=!1,Ti=null,dr=null;_n.className="ContextMenuTool",hn("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.gb("ContextMenu",a,this.mouseUpTools)});function Pn(){Ei.call(this),this.name="TextEditing",this.Zh=new Mr,this.ia=null,this.V=Ar,this.vj=null,this.qa=wr,this.u=1,this.F=!0,this.o=null,this.j=new Cn,this.kt=null,Ai(this,this.j)}le(Pn,Ei);function Ai(a,y){if(So){var x=an("textarea");a.kt=x,x.addEventListener("input",function(){if(a.textBlock!==null){var b=a.Lx(this.value);this.style.width=20+b.measuredBounds.width*this.wA+"px",this.rows=b.lineCount}},!1),x.addEventListener("keydown",function(b){if(!b.isComposing&&a.textBlock!==null){var E=b.key;E==="Enter"?(a.textBlock.isMultiline===!1&&b.preventDefault(),a.acceptText(ar)):E==="Tab"?(a.acceptText(vi),b.preventDefault()):E==="Escape"&&(a.doCancel(),a.diagram!==null&&a.diagram.doFocus())}},!1),x.addEventListener("focus",function(){if(a.currentTextEditor!==null&&a.state!==wr){var b=a.kt;a.qa===Gr&&(a.qa=Kr),typeof b.select=="function"&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1),x.addEventListener("blur",function(){if(a.currentTextEditor!==null&&a.state!==wr){var b=a.kt;typeof b.focus=="function"&&b.focus(),typeof b.select=="function"&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1),y.valueFunction=function(){return x.value},y.mainElement=x,y.show=function(b,E,z){if(b instanceof Mr&&z instanceof Pn)if(z.state===pi)x.style.border="3px solid red",x.focus();else{var tt=b.ga(Xi),rt=E.position,ot=E.scale,at=b.Df()*ot;at<z.minimumEditorScale&&(at=z.minimumEditorScale);var ut=b.naturalBounds.width*at+6,ct=b.naturalBounds.height*at+2,mt=(tt.x-rt.x)*ot;tt=(tt.y-rt.y)*ot,rt=b.verticalAlignment,ot=(b.lineHeight+b.spacingAbove+b.spacingBelow)*b.lineCount*at,ct=rt.y*ct-rt.y*ot+rt.offsetY-(.5*ct-.5*ot)-ot/2,x.value=b.text,E.div.style.font=b.font,x.style.position="absolute",x.style.zIndex="100",x.style.font="inherit",x.style.fontSize=100*at+"%",x.style.lineHeight="normal",x.style.width=ut+"px",x.style.left=(mt-ut/2|0)-1+"px",x.style.top=(tt+ct|0)-1+"px",x.style.textAlign=b.textAlign,x.style.margin="0",x.style.padding="1px",x.style.border="0",x.style.outline="none",x.style.whiteSpace="pre-wrap",x.style.overflow="hidden",x.rows=b.lineCount,x.wA=at,x.className="goTXarea",E.div.appendChild(x),x.focus(),z.selectsTextOnActivate&&(x.select(),x.setSelectionRange(0,9999))}},y.hide=function(b){b.div.removeChild(x)}}}Pn.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||a.isReadOnly||Yr&&Yr!==this&&(Yr.acceptText(Ji),Yr&&Yr!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var y=a.ic(a.lastInput.documentPoint);return y!==null&&y instanceof Mr&&y.editable&&y.part.canEdit()?(y=y.part,!(y===null||this.starting===Ar&&!y.isSelected||this.starting===Pr&&2>a.lastInput.clickCount)):!1},Pn.prototype.doStart=function(){Yr=this,this.textBlock!==null&&this.doActivate()},Pn.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(a!==null){var y=this.textBlock;if(y===null&&(y=a.ic(a.lastInput.documentPoint)),y!==null&&y instanceof Mr&&(this.textBlock=y,y.part!==null)){a.animationManager.Cc(),this.isActive=!0,this.qa=Gr;var x=this.defaultTextEditor;y.textEditor!==null&&(x=y.textEditor),this.Zh=this.textBlock.copy();var b=new ye(this.textBlock.ga(ms),this.textBlock.ga(Ll));a.tv(b),x.show(y,a,this),this.currentTextEditor=x}}}},Pn.prototype.doCancel=function(){this.stopTool()},Pn.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()},Pn.prototype.doMouseDown=function(){this.isActive&&this.acceptText(Ji)},Pn.prototype.acceptText=function(a){switch(a){case Ji:this.qa===fr?this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus():(this.qa===Gr||this.qa===pi||this.qa===Kr)&&(this.qa=Er,Wi(this));break;case _i:case ar:case vi:(ar!==a||this.textBlock.isMultiline!==!0)&&(this.qa===Gr||this.qa===pi||this.qa===Kr)&&(this.qa=Er,Wi(this))}};function Wi(a){var y=a.textBlock,x=a.diagram,b=a.currentTextEditor;if(y!==null&&b!==null){var E=y.text,z="";b.valueFunction!==null&&(z=b.valueFunction()),a.isValidText(y,E,z)?(a.Ea(a.name),a.qa=fr,a.transactionResult=a.name,y.text=z,a.doSuccess(E,z),x!==null&&x.R("TextEdited",y,E),a.stopTransaction(),a.stopTool(),x!==null&&x.doFocus()):(a.qa=pi,a.doError(E,z))}}Pn.prototype.doError=function(a,y){var x=this.textBlock;x.errorFunction!==null&&x.errorFunction(this,a,y),(a=this.currentTextEditor)&&a.show(x,this.diagram,this)},Pn.prototype.doSuccess=function(a,y){var x=this.textBlock;x.textEdited!==null&&x.textEdited(x,a,y)},Pn.prototype.doDeactivate=function(){var a=this.diagram;a!==null&&(this.qa=wr,this.currentTextEditor!==null&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)},Pn.prototype.doStop=function(){Yr=null},Pn.prototype.isValidText=function(a,y,x){var b=this.textValidation;return b!==null&&!b(a,y,x)?!1:(b=a.textValidation,!!(b===null||b(a,y,x)))},Pn.prototype.Lx=function(a){var y=this.Zh;return y.text=a,y.measure(this.textBlock.Ih,1/0),y},Oe.Object.defineProperties(Pn.prototype,{textBlock:{get:function(){return this.ia},set:function(a){this.ia=a}},currentTextEditor:{get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{get:function(){return this.j},set:function(a){this.j=a}},starting:{get:function(){return this.V},set:function(a){this.V=a}},textValidation:{get:function(){return this.vj},set:function(a){this.vj=a}},minimumEditorScale:{get:function(){return this.u},set:function(a){this.u=a}},selectsTextOnActivate:{get:function(){return this.F},set:function(a){this.F=a}},state:{get:function(){return this.qa},set:function(a){this.qa!==a&&(this.qa=a)}}}),Pn.prototype.measureTemporaryTextBlock=Pn.prototype.Lx;var _i=new me(Pn,"LostFocus",0),Ji=new me(Pn,"MouseDown",1),vi=new me(Pn,"Tab",2),ar=new me(Pn,"Enter",3),ir=new me(Pn,"SingleClick",0),Ar=new me(Pn,"SingleClickSelected",1),Pr=new me(Pn,"DoubleClick",2),wr=new me(Pn,"StateNone",0),Gr=new me(Pn,"StateActive",1),Kr=new me(Pn,"StateEditing",2),Er=new me(Pn,"StateValidating",3),pi=new me(Pn,"StateInvalid",4),fr=new me(Pn,"StateValidated",5),Yr=null;Pn.className="TextEditingTool",Pn.LostFocus=_i,Pn.MouseDown=Ji,Pn.Tab=vi,Pn.Enter=ar,Pn.SingleClick=ir,Pn.SingleClickSelected=Ar,Pn.DoubleClick=Pr,Pn.StateNone=wr,Pn.StateActive=Gr,Pn.StateEditing=Kr,Pn.StateValidating=Er,Pn.StateInvalid=pi,Pn.StateValidated=fr,hn("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.gb("TextEditing",a,this.mouseUpTools)});function Fr(a){Xr||(Vi(),Xr=!0),this.H=wa,this.Ok=this.zb=this.vq=this.bc=!1,this.Qw=!0,this.Pk=Tr,this.Dm=!1,this.Gh=this.Jd=!0,this.Dg=600,this.cw=this.Ow=!1,this.Zd=new Ye,this.ce=new lo,this.ce.Yd=this,this.Ei=new Ye,this.pu=new Ye,this.Sr=new Ye,this.pr=new Ye,a&&Object.assign(this,a)}Fr.prototype.Xe=function(a){this.H=a},Fr.prototype.canStart=function(){return!0};function io(a,y){a.Jd&&a.canStart(y)&&(a.Zd.add(y),a.defaultAnimation.isAnimating&&a.Cc(),As(a.H),a.zb=!0)}function ao(a){if(a.Jd&&a.zb){var y=a.ce,x=a.H,b=a.Zd.contains("Model");b&&(a.Ok=!0,a.Pk===Tr?(y.isViewportUnconstrained=!0,y.vc.clear(),y.add(x,"position",x.position.copy().offset(0,-200),x.position),y.add(x,"opacity",0,1)):a.Pk===Ts&&y.vc.clear(),a.Qw=!!(a.Pk===Ho&&x.du.D(x.pa)),x.R("InitialAnimationStarting",a)),b&&!a.Gh||y.vc.count===0?(a.Zd.clear(),a.zb=!1,y.vc.clear(),zs(y,x),a.Ok=!1,x.N()):(a.Zd.clear(),x.kg=!1,b=y.vc.get(x),x.autoScale!==da&&b!==null&&(delete b.start.scale,delete b.end.scale),xe.requestAnimationFrame(function(){a.zb===!1||y.bc||(x.Gf("temporaryPixelRatio")&&tr(x),tl(x),a.zb=!1,y.start(),y.bc&&(_o(a),x.Ya(),Pa(y,0),gl(x,!0),Ui(a),x.R("AnimationStarting",a)))}))}}function po(a){return a.Zd.contains("Trigger")&&a.Zd.count===1}function ro(a,y,x,b){a.isTicking||po(a)||y instanceof _e&&(y.fromNode!==null||y.toNode!==null)||a.ce.add(y,"position",x,b,!1)}xt=Fr.prototype,xt.fv=function(a){return this.ce.fv(a)},xt.Xu=function(a){return this.ce.Xu(a)};function Oo(a,y){function x(){if(0<E.Sr.count&&(b.addAll(E.Sr),E.Sr.clear(),E.bc=!0),E.bc!==!1&&b.count!==0){E.pu.addAll(b);for(var z=E.pu.iterator;z.next();){var tt=z.value;if(tt.bc!==!1){t:if(0<tt.yl.count)var rt=!0;else{for(rt=tt.vc.iterator;rt.next();){var ot=rt.key;if(ot instanceof te&&ot.diagram!==null||ot instanceof se){rt=!0;break t}}rt=!1}rt?Cs(tt,!1):tt.Xk=!0}}E.pu.clear(),E.bc!==!1&&(_o(E),gl(E.H),Ui(E)),xe.requestAnimationFrame(x)}}var b=a.Ei,E=a;a.bc?a.Sr.add(y):(a.bc=!0,b.add(y),xe.requestAnimationFrame(function(){x()}))}function Vs(a){for(a=a.Ei.iterator;a.next();)a.value.Xk=!1}function _o(a){if(!a.vq){var y=a.H;a.Ow=y.skipsUndoManager,a.cw=y.skipsModelSourceBindings,y.skipsUndoManager=!0,y.skipsModelSourceBindings=!0,a.vq=!0}}function Ui(a){var y=a.H;y.skipsUndoManager=a.Ow,y.skipsModelSourceBindings=a.cw,a.vq=!1}xt.Cc=function(a){var y=this.ce;if(this.zb===!0&&(this.Ok=this.zb=!1,this.Zd.clear(),0<y.vc.count&&this.H.$b()),this.bc){if(y.Ml(!0),y.vc.clear(),zs(y,null),a===!0)for(a=this.Ei.Fa(),y=0;y<a.length;y++)a[y].Ml(!0)}else y.vc.clear(),zs(y,this.H)},xt.Ml=function(a){a===this.defaultAnimation&&this.defaultAnimation.vc.clear(),this.Ei.remove(a),this.Ei.count===0&&(this.bc=!1,this.H.$b()),a===this.defaultAnimation&&(this.defaultAnimation.vc.clear(),this.H.R("AnimationFinished",this))},xt.Cj=function(a,y){this.zb&&(this.Zd.contains("Expand Tree")||this.Zd.contains("Expand SubGraph"))&&(this.ce.Cj(a,y),ui(this,a))},xt.Aj=function(a,y){this.zb&&(this.Zd.contains("Collapse Tree")||this.Zd.contains("Collapse SubGraph"))&&(this.ce.Aj(a,y),Io(this.ce,y,"position",y.position,y.position),ui(this,a))};function Hi(a,y,x){!a.zb||y.D(x)||po(a)||(a.H.pi||(y=x.copy()),Io(a.ce,a.H,"position",y,x))}function Ri(a,y,x){y.fd&&(y.Tg=x,a.pr.add(y))}function ui(a,y){for(y=y.findLinksConnected();y.next();){var x=y.value;x.fd&&(x.Tg=x.points.copy(),a.pr.add(x))}}function hi(a,y,x,b,E){a===null&&(a=[0,0,0,0]),y===null&&(y=[0,0,0,0]);var z=a[0],tt=a[1],rt=a[2];a=a[3];var ot=y[0],at=y[1],ut=y[2];return y=y[3],rt===0||rt===100?(z=ot,tt=at):(ut===0||ut===100)&&(ot=z,at=tt),180<Math.abs(ot-z)&&(ot>z?z+=360:ot+=360),z=E(x,z,ot-z,b)%360,tt=E(x,tt,at-tt,b),rt=E(x,rt,ut-rt,b),x=E(x,a,y-a,b),"hsla("+z+", "+tt+"%, "+rt+"%, "+x+")"}function Vi(){function a(x,b,E,z,tt,rt){x.position=new jt(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt))}var y=new xn;y.add("position:diagram",a),y.add("position",a),y.add("position:part",function(x,b,E,z,tt,rt){tt<rt?x.mm(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt),!1):x.position=new jt(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt))}),y.add("location",function(x,b,E,z,tt,rt){tt<rt?x.mm(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt),!0):x.location=new jt(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt))}),y.add("position:placeholder",function(x,b,E,z,tt,rt){tt<rt?x.mm(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt),!1):x.position=new jt(z(tt,b.x,E.x-b.x,rt),z(tt,b.y,E.y-b.y,rt))}),y.add("position:nodeCollapse",function(x,b,E,z,tt,rt){var ot=x.actualBounds,at=E.actualBounds;E=at.x+at.width/2-ot.width/2,ot=at.y+at.height/2-ot.height/2,tt<rt?x.mm(z(tt,b.x,E-b.x,rt),z(tt,b.y,ot-b.y,rt),!1):x.position=new jt(z(tt,b.x,E-b.x,rt),z(tt,b.y,ot-b.y,rt))}),y.add("desiredSize",function(x,b,E,z,tt,rt){x.desiredSize=new ye(z(tt,b.width,E.width-b.width,rt),z(tt,b.height,E.height-b.height,rt))}),y.add("width",function(x,b,E,z,tt,rt){x.width=z(tt,b,E-b,rt)}),y.add("height",function(x,b,E,z,tt,rt){x.height=z(tt,b,E-b,rt)}),y.add("fill",function(x,b,E,z,tt,rt){x.fill=hi(b,E,tt,rt,z)}),y.add("stroke",function(x,b,E,z,tt,rt){x.stroke=hi(b,E,tt,rt,z)}),y.add("strokeWidth",function(x,b,E,z,tt,rt){x.strokeWidth=z(tt,b,E-b,rt)}),y.add("strokeDashOffset",function(x,b,E,z,tt,rt){x.strokeDashOffset=z(tt,b,E-b,rt)}),y.add("background",function(x,b,E,z,tt,rt){x.background=hi(b,E,tt,rt,z)}),y.add("areaBackground",function(x,b,E,z,tt,rt){x.areaBackground=hi(b,E,tt,rt,z)}),y.add("opacity",function(x,b,E,z,tt,rt){x.opacity=z(tt,b,E-b,rt)}),y.add("scale",function(x,b,E,z,tt,rt){x.scale=z(tt,b,E-b,rt)}),y.add("angle",function(x,b,E,z,tt,rt){x.angle=z(tt,b,E-b,rt)}),yr=y}Oe.Object.defineProperties(Fr.prototype,{animationReasons:{get:function(){return this.Zd}},isEnabled:{get:function(){return this.Jd},set:function(a){(this.Jd=a)&&this.Ei.each(function(y){y.isAnimating||y.runCount!==1/0||y.start()})}},duration:{get:function(){return this.Dg},set:function(a){1>a&&ri(a,">= 1",Fr,"duration"),this.Dg=a}},isAnimating:{get:function(){return this.bc}},isTicking:{get:function(){return this.vq}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a}},defaultAnimation:{get:function(){return this.ce}},activeAnimations:{get:function(){return this.Ei}},initialAnimationStyle:{get:function(){return this.Pk},set:function(a){this.Pk=a}}}),Fr.prototype.stopAnimation=Fr.prototype.Cc;var yr=null,Xr=!1,Tr=new me(Fr,"Default",1),Ho=new me(Fr,"AnimateLocations",2),Ts=new me(Fr,"None",3);Fr.className="AnimationManager",Fr.defineAnimationEffect=function(a,y){Xr||(Vi(),Xr=!0),yr.add(a,y)},Fr.Default=Tr,Fr.AnimateLocations=Ho,Fr.None=Ts;function lo(a){this.vu=this.Nw=this.Yd=this.H=null,this.Xk=this.bc=this.j=!1,this.cn=this.Qd=0,this.Lp=this.ot=Ns,this.Wk=this.ho=!1,this.cu=1,this.au=0,this.Gd=this.Dg=NaN,this.gw=0,this.dn=null,this.o=cs,this.vc=new xn,this.Tt=new xn,this.yl=new Ye,this.Ut=new Ye,this.dw=Pd,a&&Object.assign(this,a)}lo.prototype.suspend=function(){this.Xk=!0},lo.prototype.advanceTo=function(a,y){y&&(this.Xk=!1),this.ho&&a>=this.Gd&&(this.Wk=!0,a-=this.Gd),this.gw=a,Cs(this,!0),_o(this.Yd),gl(this.H),Ui(this.Yd),this.H.redraw()};function zs(a,y){if(a.Tt.clear(),a.Wk=!1,a.au=0,a.Gd=NaN,0<a.yl.count&&a.yl.clear(),0<a.Ut.count&&a.Ut.clear(),y!==null)for(a=y.links;a.next();)a.value.Tg=null}xt=lo.prototype,xt.start=function(){if(this.vc.count===0||this.bc)return this;for(var a=this.H,y=this.vc.iterator;y.next();){var x=y.key;a===null&&(x instanceof se?a=x:x instanceof te&&(a=x.diagram))}if(a!==null)this.H=a,this.Yd=a.animationManager;else return this;return y=this.Yd,y.isEnabled===!1?this:(this.Gd=isNaN(this.Dg)?y.duration:this.Dg,this.Lp=this.ot,y.Ok&&y.Pk===Tr&&this===y.defaultAnimation&&(this.Lp=ys,this.Gd=isNaN(this.Dg)?y.duration===600?900:y.duration:this.Dg),this.dw=a.scrollMode,this.isViewportUnconstrained&&(a.sj=Mc),_o(y),this.yl.each(function(b){b.data=null,a.add(b)}),Ui(y),this.bc=!0,this.Qd=+new Date,this.cn=this.Qd+this.Gd,Oo(y,this),this)},xt.Iy=function(a,y){return a.Zc()?(this.yl.add(a),this.H=y,this):this},xt.add=function(a,y,x,b,E){if(y==="position"&&x.Xa(b))return this;if(this.H===null&&(a instanceof se?this.H=a:a instanceof te&&a.diagram!==null&&(this.H=a.diagram)),a instanceof vn){if(!a.isAnimated)return this;y==="position"&&(y="position:part")}return Io(this,a,y,x,b,E),this};function Io(a,y,x,b,E,z){var tt=a.vc;if(y instanceof se&&x==="position"&&(x="position:diagram"),(x==="fill"||x==="stroke"||x==="background"||x==="areaBackground")&&($h(b),sv(),b=[Dl.j,Dl.u,Dl.o,Dl.F],$h(E),sv(),E=[Dl.j,Dl.u,Dl.o,Dl.F]),tt.contains(y)){var rt=tt.I(y),ot=rt.start,at=rt.end;ot[x]===void 0&&(ot[x]=ha(b)),at[x]=ha(E)}else ot={},at={},ot[x]=ha(b),at[x]=ha(E),rt=ot.position,y instanceof te&&rt instanceof jt&&!rt.w()&&y.diagram.animationManager.Zd.contains("Expand SubGraph")&&rt.assign(at.position),rt=new Do(ot,at,z),tt.add(y,rt);tt=ot[x],tt instanceof jt&&!tt.w()&&tt.assign(a.o),z&&x.indexOf("position:")===0&&y instanceof vn?rt.Ku.location=ha(y.location):z&&(rt.Ku[x]=ha(b))}function ha(a){return a instanceof jt||a instanceof Ze?a.copy():a}xt.fv=function(a){return this.bc?(a=this.vc.I(a),a!==null&&a.nv):!1},xt.Xu=function(a){return this.bc?(a=this.vc.I(a),a!==null&&(a.start.position||a.start.location)):!1};function Cs(a,y){if(!a.Xk||y){var x=a.Yd;if(a.bc!==!1){var b=+new Date,E=b>a.cn?a.Gd:b-a.Qd;y&&(E=a.gw,E<a.Gd?(a.Qd=+new Date-E,a.cn=a.Qd+a.Gd):E=a.Gd),_o(x),Pa(a,E),gl(a.H,!0),Ui(x),b>a.cn&&(a.ho&&!a.Wk?(a.Qd=+new Date,a.cn=a.Qd+a.Gd,a.Wk=!0):a.Ml(!1))}}}function Pa(a,y){for(var x=a.Gd,b=a.vc.iterator,E=a.Wk;b.next();){var z=b.key;if(!(z instanceof te&&z.diagram===null)){var tt=b.value,rt=E?tt.end:tt.start;tt=E?tt.start:tt.end;var ot=yr,at;for(at in tt)at==="position"&&(tt["position:placeholder"]||tt["position:nodeCollapse"])||ot.get(at)===null||ot.get(at)(z,rt[at],tt[at],a.Lp,y,x,a)}}}xt.stop=function(){return this.bc?(this.Ml(!0),this):this},xt.Ml=function(a){if(this.vu!==null&&this.vu.jo.remove(this.Nw),this.bc){var y=this.H,x=this.Yd;this.Xk=this.bc=x.Ok=!1,_o(x);for(var b=this.vc,E=this.yl.iterator;E.next();)y.remove(E.value);for(E=this.Ut.iterator;E.next();)E.value.v();E=this.ho,b=b.iterator;for(var z=yr;b.next();){var tt=b.key,rt=b.value,ot=E?rt.end:rt.start,at=E?rt.start:rt.end,ut=rt.Ku,ct;for(ct in at)if(z.get(ct)!==null){var mt=ct;!rt.Hu||mt!=="position:nodeCollapse"&&mt!=="position:placeholder"||(mt="position"),z.get(mt)(tt,ot[ct],ut[ct]!==void 0?ut[ct]:rt.Hu?ot[ct]:at[ct],this.Lp,this.Gd,this.Gd,this)}rt.Hu&&ut.location!==void 0&&tt instanceof vn&&(tt.location=ut.location),rt.nv&&tt instanceof vn&&tt.Zb(!1)}if(y.As.clear(),_s(y,!1),y.Ya(),y.N(),gl(y,!0),x.defaultAnimation===this){for(ct=x.pr.iterator;ct.next();)E=ct.value,E.Tg!==null&&(E.points=E.Tg,E.Tg=null);x.pr.clear()}gl(y,!0),this.isViewportUnconstrained&&(y.scrollMode=this.dw),Ui(x),this.au++,!a&&this.cu>this.au?(this.Wk=!1,this.start()):(this.dn&&this.dn(this),zs(this,null),x.Ml(this),y.$b())}},xt.Cj=function(a,y){var x=y.actualBounds,b=null;if(y instanceof Yn&&(b=y.placeholder),b!==null?(x=b.ga(ms),b=b.padding,x.x+=b.left,x.y+=b.top,this.add(a,"position",x,a.position,!1)):this.add(a,"position",new jt(x.x+x.width/2,x.y+x.height/2),a.position,!1),this.add(a,"scale",.01,a.scale,!1),a instanceof Yn)for(a=a.memberParts;a.next();)b=a.value,b instanceof $e&&this.Cj(b,y)},xt.Aj=function(a,y){if(a.isVisible()){var x=null;if(y instanceof Yn&&(x=y.placeholder),x!==null){var b=x.ga(ms);x=x.padding,b.x+=x.left,b.y+=x.top,this.add(a,"position:placeholder",a.position,b,!0)}else this.add(a,"position:nodeCollapse",a.position,y,!0);if(this.add(a,"scale",a.scale,.01,!0),b=this.vc,b.contains(a)&&(b.I(a).nv=!0),a instanceof Yn)for(a=a.memberParts;a.next();)b=a.value,b instanceof $e&&this.Aj(b,y)}},xt.Ez=function(a){var y=this.Tt.get(a);return y===null&&(y={},this.Tt.add(a,y)),y},Oe.Object.defineProperties(lo.prototype,{duration:{get:function(){return this.Dg},set:function(a){1>a&&ri(a,">= 1",lo,"duration"),this.Dg=a}},reversible:{get:function(){return this.ho},set:function(a){this.ho=a}},runCount:{get:function(){return this.cu},set:function(a){0<a?this.cu=a:fe("Animation.runCount value must be a positive integer.")}},finished:{get:function(){return this.dn},set:function(a){this.dn!==a&&(this.dn=a)}},easing:{get:function(){return this.ot},set:function(a){this.ot=a}},isViewportUnconstrained:{get:function(){return this.j},set:function(a){this.j=a}},isAnimating:{get:function(){return this.bc}}}),lo.prototype.getTemporaryState=lo.prototype.Ez,lo.prototype.stop=lo.prototype.stop,lo.prototype.add=lo.prototype.add,lo.prototype.addTemporaryPart=lo.prototype.Iy;function Ns(a,y,x,b){return a/=b/2,1>a?x/2*a*a+y:-x/2*(--a*(a-2)-1)+y}function ys(a,y,x,b){return a===b?y+x:x*(-Math.pow(2,-10*a/b)+1)+y}lo.className="Animation",lo.EaseLinear=function(a,y,x,b){return x*a/b+y},lo.EaseInOutQuad=Ns,lo.EaseInQuad=function(a,y,x,b){return x*(a/=b)*a+y},lo.EaseOutQuad=function(a,y,x,b){return-x*(a/=b)*(a-2)+y},lo.EaseInExpo=function(a,y,x,b){return a===0?y:x*Math.pow(2,10*(a/b-1))+y},lo.EaseOutExpo=ys;function Do(a,y,x){this.start=a,this.end=y,this.Ku={},this.Hu=x,this.nv=!1}Do.className="AnimationState";function Yo(a,y,x){this.xd=null,this.rf=a,this.so=x||Ga,this.uk=null,y!==void 0&&(this.uk=y,x===void 0&&(this.so=Js))}Yo.prototype.copy=function(){var a=new Yo(this.rf);a.so=this.so;var y=this.uk;if(y!==null){var x={};y.duration!==void 0&&(x.duration=y.duration),y.finished!==void 0&&(x.finished=y.finished),y.easing!==void 0&&(x.easing=y.easing),a.uk=x}return a};function Ml(a,y){a=a.uk,a!==null&&(a.duration&&(y.duration=a.duration),a.finished&&(y.finished=a.finished),a.easing&&(y.easing=a.easing))}Oe.Object.defineProperties(Yo.prototype,{propertyName:{get:function(){return this.rf},set:function(a){this.rf=a}},animationSettings:{get:function(){return this.uk},set:function(a){this.uk=a}},startCondition:{get:function(){return this.so},set:function(a){this.so=a}}});var Ga=new me(Yo,"Default",1),Js=new me(Yo,"Immediate",2),Gs=new me(Yo,"Bundled",3);Yo.className="AnimationTrigger",Yo.Default=Ga,Yo.Immediate=Js,Yo.Bundled=Gs;function bo(a){qr(this),this.H=null,this.Pa=new Ve,this.xa="",this.pb=1,this.o=!1,this.j=this.Uh=this.u=this.Oi=this.Ni=this.Mi=this.Li=this.Ji=this.Ki=this.Ii=this.Qi=this.Hi=this.Pi=this.Gi=this.Fi=!0,this.Zq=[],a&&Object.assign(this,a)}xt=bo.prototype,xt.clear=function(){for(var a=this.Pa,y=0;y<a.length;y++){var x=a.s[y];x.Ig=null,oa(x)}a.clear(),this.Zq.length=0},xt.Xe=function(a){this.H=a},xt.toString=function(a){a===void 0&&(a=0);var y='Layer "'+this.name+'"';if(0>=a)return y;for(var x=0,b=0,E=0,z=0,tt=0,rt=this.Pa.iterator;rt.next();){var ot=rt.value;ot instanceof Yn?E++:ot instanceof $e?b++:ot instanceof _e?z++:ot instanceof Bi?tt++:x++}if(rt="",0<x&&(rt+=x+" Parts "),0<b&&(rt+=b+" Nodes "),0<E&&(rt+=E+" Groups "),0<z&&(rt+=z+" Links "),0<tt&&(rt+=tt+" Adornments "),1<a)for(a=this.Pa.iterator;a.next();)x=a.value,rt+=`
|
|
`+x.toString(),b=x.data,b!==null&&Co(b)&&(rt+=" #"+Co(b)),x instanceof $e?rt+=" "+Ir(b):x instanceof _e&&(rt+=" "+Ir(x.fromNode)+" "+Ir(x.toNode));return y+" "+this.Pa.count+": "+rt},xt.ic=function(a,y,x){if(y===void 0&&(y=null),x===void 0&&(x=null),this.Uh===!1)return null;var b=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(b=!0);for(var E=jt.alloc(),z=this.Pa.s,tt=z.length;tt--;){var rt=z[tt];if((b!==!0||sf(rt)!==!1)&&rt.isVisible()&&(E.assign(a),Lo(E,rt.oe),rt=rt.ic(E,y,x),rt!==null&&(y!==null&&(rt=y(rt)),rt!==null&&(x===null||x(rt)))))return jt.free(E),rt}return jt.free(E),null},xt.ji=function(a,y,x,b){if(y===void 0&&(y=null),x===void 0&&(x=null),b instanceof Ve||b instanceof Ye||(b=new Ye),this.Uh===!1)return b;var E=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(E=!0);for(var z=jt.alloc(),tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((E!==!0||sf(ot)!==!1)&&ot.isVisible()){z.assign(a),Lo(z,ot.oe);var at=ot;ot.ji(z,y,x,b)&&(y!==null&&(at=y(at)),at===null||x!==null&&!x(at)||b.add(at))}}return jt.free(z),b},xt.Cf=function(a,y,x,b,E){if(y===void 0&&(y=null),x===void 0&&(x=null),b===void 0&&(b=!1),E instanceof Ve||E instanceof Ye||(E=new Ye),this.Uh===!1)return E;var z=!1;this.diagram!==null&&this.diagram.viewportBounds.Re(a)&&(z=!0);for(var tt=this.Pa.s,rt=tt.length;rt--;){var ot=tt[rt];if((z!==!0||sf(ot)!==!1)&&ot.isVisible()){var at=ot;ot.Cf(a,y,x,b,E)&&(y!==null&&(at=y(at)),at===null||x!==null&&!x(at)||E.add(at))}}return E},xt.Nu=function(a,y,x,b,E,z,tt){if(this.Uh===!1)return E;for(var rt=this.Pa.s,ot=rt.length;ot--;){var at=rt[ot];if((tt!==!0||sf(at)!==!1)&&z(at)&&at.isVisible()){var ut=at;at.Cf(a,y,x,b,E)&&(y!==null&&(ut=y(ut)),ut===null||x!==null&&!x(ut)||E.add(ut))}}return E},xt.og=function(a,y,x,b,E,z){if(x===void 0&&(x=null),b===void 0&&(b=null),E===void 0&&(E=!0),E!==!1&&E!==!0&&((E instanceof Ve||E instanceof Ye)&&(z=E),E=!0),z instanceof Ve||z instanceof Ye||(z=new Ye),this.Uh===!1)return z;var tt=!1;this.diagram!==null&&this.diagram.viewportBounds.ca(a)&&(tt=!0);for(var rt=jt.alloc(),ot=jt.alloc(),at=this.Pa.s,ut=at.length;ut--;){var ct=at[ut];if((tt!==!0||sf(ct)!==!1)&&ct.isVisible()){rt.assign(a),Lo(rt,ct.oe),ot.h(a.x+y,a.y),Lo(ot,ct.oe);var mt=ct;ct.og(rt,ot,x,b,E,z)&&(x!==null&&(mt=x(mt)),mt===null||b!==null&&!b(mt)||z.add(mt))}}return jt.free(rt),jt.free(ot),z},xt.Fd=function(a,y){if(this.visible){var x=this.Pa.s,b=x.length;if(b!==0){a=Kn();for(var E=Kn(),z=0;z<b;z++){var tt=x[z];if(tt.vw=z,tt instanceof _e){if(tt.fd===!1)continue}else if(tt instanceof Bi&&tt.adornedPart!==null)continue;var rt=tt.actualBounds;tt.isVisible()&&gh(rt,y)?(tt.Fd(!0),a.push(tt)):(tt.Fd(!1),tt.adornments!==null&&0<tt.adornments.count&&E.push(tt))}for(y=0;y<a.length;y++)for(x=a[y],Ov(x),x=x.adornments;x.next();)b=x.value,b.measure(1/0,1/0),b.arrange(),b.Fd(!0);for(y=0;y<E.length;y++)Ov(E[y]);zn(a),zn(E)}}};function Ls(a,y){var x=1;return a.pb!==1&&(x=y.globalAlpha,y.globalAlpha=x*a.pb),x}xt.gc=function(a,y,x){if(this.visible&&this.pb!==0&&(x===void 0&&(x=!0),x||!this.isTemporary)){x=this.Pa.s;var b=x.length;if(b!==0){if(a.isTemporary)for(var E=0;E<b;E++)x[E].Gj();E=Ls(this,a);var z=this.Zq;z.length=0;for(var tt=y.scale,rt=ye.alloc(),ot=0;ot<b;ot++)this.Oj(a,x[ot],y,z,tt,rt,!0);if(ye.free(rt),a.isTemporary)for(y=0;y<b;y++)x[y].Gj();a.globalAlpha=E}}};function cu(a,y,x,b,E){if(a.visible&&a.pb!==0&&(E||!a.isTemporary)){E=a.Pa.s;var z=E.length;if(z!==0){var tt=Ls(a,y),rt=a.Zq;rt.length=0;for(var ot=x.scale,at=ye.alloc(),ut=0;ut<z;ut++){var ct=E[ut];b.contains(ct)&&a.Oj(y,ct,x,rt,ot,at,!1)}ye.free(at),y.globalAlpha=tt}}}xt.Oj=function(a,y,x,b,E,z,tt){if(tt&&!sf(y))a.Hs(y);else{if(b!==null&&y instanceof _e&&(y.isOrthogonal&&b.push(y),y.fd===!1)){a.Hs(y);return}for(tt=!1,b=y.containingGroup;b!==null;)tt?b.tb!==null&&z.Ex(b.tb):b.tb!==null&&(tt=!0,z.assign(b.tb)),b=b.containingGroup;var rt=y.actualBounds;if(b=!1,tt&&y.isVisible()){if(!z.Yc(rt)){a.Hs(y);return}b=!z.Re(rt)}b&&(a.save(),a instanceof pl?a.bk=z.copy():(a.beginPath(),a.rect(z.x,z.y,z.width,z.height),a.clip())),rt.width*E>x.Oq||rt.height*E>x.Oq?y.gc(a,x):(E=y.actualBounds,z=y.naturalBounds,E.width===0||E.height===0||isNaN(E.x)||isNaN(E.y)||!y.isVisible()||(x=y.transform,y.areaBackground!==null&&(wo(y,a,y.areaBackground,!0,!0,z,E),a.fillRect(E.x,E.y,E.width,E.height)),y.areaBackground===null&&y.background===null&&(wo(y,a,"rgba(0,0,0,0.3)",!0,!1,z,E),a.fillRect(E.x,E.y,E.width,E.height)),y.background!==null&&(a.transform(x.m11,x.m12,x.m21,x.m22,x.dx,x.dy),wo(y,a,y.background,!0,!1,z,E),a.fillRect(0,0,z.width/2,z.height/2),x.ws()||(y=1/(x.m11*x.m22-x.m12*x.m21),a.transform(x.m22*y,-x.m12*y,-x.m21*y,x.m11*y,y*(x.m21*x.dy-x.m22*x.dx),y*(x.m12*x.dx-x.m11*x.dy)))))),b&&(a.restore(),a.Vc(!0))}},xt.g=function(a,y,x,b,E){var z=this.diagram;z!==null&&z.cb(Ur,a,this,y,x,b,E)},xt.oi=function(a,y,x){var b=this.Pa;if(y.Ig=this,this===null&&oa(y),a>=b.count)a=b.count;else if(b.M(a)===y)return-1;return b.Gb(a,y),y.Vo(x),b=this.diagram,b!==null&&(x?b.N():b.oi(y)),Qs(this,a,y),a},xt.pc=function(a,y,x){if(!x&&y.layer!==this&&y.layer!==null)return y.layer.pc(a,y,x);var b=this.Pa;if(0>a||a>=b.length){if(a=b.indexOf(y),0>a)return-1}else if(b.M(a)!==y&&(a=b.indexOf(y),0>a))return-1;return y.Wo(x),b.mb(a),b=this.diagram,b!==null&&(x?b.N():b.pc(y)),y.Ig=null,oa(y),a};function Qs(a,y,x){if(y=eh(a,y,x),x instanceof Yn&&x!==null&&isNaN(x.zOrder)){if(x.memberParts.count!==0){for(var b=-1,E=a.Pa.s,z=E.length,tt=0;tt<z;tt++){var rt=E[tt];if(rt===x&&(y=tt,0<=b)||0>b&&rt.containingGroup===x&&(b=tt,0<=y))break}!(0>b)&&b<y&&(E=a.Pa,E.mb(y),E.Gb(b,x))}y=x.containingGroup,y!==null&&Qs(a,-1,y)}x.svg!==null&&x.svg.remove()}function eh(a,y,x){var b=x.zOrder;if(isNaN(b))return y;a=a.Pa;var E=a.count;if(1>=E)return y;if(0>y&&(y=a.indexOf(x)),0>y)return-1;for(var z=y-1,tt=NaN;0<=z&&(tt=a.M(z).zOrder,!!isNaN(tt));)z--;for(var rt=y+1,ot=NaN;rt<E&&(ot=a.M(rt).zOrder,!!isNaN(ot));)rt++;if(!isNaN(tt)&&tt>b)for(;;){if(z===-1||tt<=b){if(z++,z===y)break;return a.mb(y),a.Gb(z,x),z}for(tt=NaN;0<=--z&&(tt=a.M(z).zOrder,isNaN(tt)););}else if(!isNaN(ot)&&ot<b)for(;;){if(rt===E||ot>=b){if(rt--,rt===y)break;return a.mb(y),a.Gb(rt,x),rt}for(ot=NaN;++rt<E&&(ot=a.M(rt).zOrder,isNaN(ot)););}return y}Oe.Object.defineProperties(bo.prototype,{parts:{get:function(){return this.Pa.iterator}},partsBackwards:{get:function(){return this.Pa.iteratorBackwards}},diagram:{get:function(){return this.H}},name:{get:function(){return this.xa},set:function(a){var y=this.xa;if(y!==a){var x=this.diagram;if(x!==null)for(y===""&&fe("Cannot rename default Layer to: "+a),x=x.layers;x.next();)x.value.name===a&&fe("Layer.name is already present in this diagram: "+a);for(this.xa=a,this.g("name",y,a),a=this.Pa.iterator;a.next();)a.value.layerName=this.xa}}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&ri(a,"0 <= value <= 1",bo,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,a!==null&&a.N())}},isTemporary:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&((this.o=a)&&(this.isInDocumentBounds=!1),this.g("isTemporary",y,a))}},visible:{get:function(){return this.u},set:function(a){var y=this.u;if(y!==a){for(this.u=a,this.g("visible",y,a),y=this.Pa.iterator;y.next();)y.value.Zb(a);a=this.diagram,a!==null&&a.N()}}},pickable:{get:function(){return this.Uh},set:function(a){var y=this.Uh;y!==a&&(this.Uh=a,this.g("pickable",y,a))}},isInDocumentBounds:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,this.diagram!==null&&this.diagram.Ya())}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}}}),bo.prototype.findObjectsNear=bo.prototype.og,bo.prototype.findObjectsIn=bo.prototype.Cf,bo.prototype.findObjectsAt=bo.prototype.ji,bo.prototype.findObjectAt=bo.prototype.ic,bo.className="Layer";function se(a,y){if(hm||(ia(),hm=!0),qr(this),wa=this,this.vb=!0,this.Ka=null,this.ya=this.Aa=0,this.ta=null,So){var x=this,b=function(){x.removeEventListener(xe.document,"DOMContentLoaded",b,!1),x.setRTL()};xe.document.body!==null?this.setRTL():x.addEventListener(xe.document,"DOMContentLoaded",b,!1)}this.ol=null,ag.add("Model",rr);var E=this;return this.Hb=function(z){var tt=E.partManager;if(z.model===tt.diagram.model&&tt.diagram.aa){tt.diagram.aa=!1;try{var rt=z.change;z.modelChange===""&&rt===Ur&&tt.updateDataBindings(z.object,z.propertyName)}finally{tt.diagram.aa=!0}}},this.Oc=function(z){E.partManager.doModelChanged(z)},this.hu=this.ku=null,gu(this),this.model=hy(),this.Wg=!0,cr(this),this.layout=new Zr,this.Wg=!1,this.ck=this.ek=this.fk=this.dk=this.ui=this.aA=this.$j=this.Ov=null,this.hk=function(){},this.preventDefault=null,this.rn=!1,this.Yf=new dm,a!==void 0&&(typeof a=="string"||xe.Element&&a instanceof Element?$i(this,a):y=a),this.vb=!1,y&&this.nm(y),this}var kl,wa;function gu(a){a.Yd=new Fr,a.Yd.Xe(a),a.Db=17,a.Gw=!1,a.tn=!1,a.bu="default",a.Wa=new Ve,a.pj=new xn,a.nl="default",a.Tx(),a.Sx(),a.pb=1,a.pa=new jt(NaN,NaN).freeze(),a.du=new jt(NaN,NaN),a.Ca=1,a.Pp=1,a.zt=new jt(NaN,NaN).freeze(),a.At=NaN,a.Ot=1e-4,a.Mt=100,a.Ab=new oi,a.zu=new jt(NaN,NaN).freeze(),a.ut=new ye(NaN,NaN,NaN,NaN).freeze(),a.rj=new ni(0,0,0,0).freeze(),a.sj=Pd,a.nu=!1,a.Zt=null,a.fu=null,a.yh=da,a.zk=vs,a.Fg=da,a.pq=vs,a.yt=ms,a.Bt=ms,a.Fc=!0,a.pn=!1,a.De=new Ye,a.Eh=new xn,a.Xm=!0,a.vp=250,a.vk=-1,a.xp=new ni(16,16,16,16).freeze(),a.kg=!1,a.Jk=!1,a.fn=!0,a.bq=new Ys,a.bq.diagram=a,a.Qg=new Ys,a.Qg.diagram=a,a.cj=new Ys,a.cj.diagram=a,a.zg=null,a.pf=null,a.qu=!1,ev(a),a.ai=new Ye,a.Ht=!0,a.uu=wd,a.pw=!1,a.wu=Lc,a.it="auto",a.Op="auto",a.zh=null,a.Fh=null,a.Bh=null,a.Qh=null,a.Oh=null,a.Nh=null,a.Qt=null,a.Lh=null,a.xt=!1,a.Mh=null,a.Ph=null,a.$h=null,a.Ch=null,a.Rt=!1,a.Yt={},a.oj=[null,null],a.Wg=!1,a.Iw=!1,a.ou=!1,a.lt=!1,a.rw=!0,a.ld=!1,a.$i=!1,a.Tw=!0,a.Ce=-2,a.Og=new xn,a.Xn=new Ve,a.Gg=!1,a.Jd=!0,a.Us=!0,a.Fi=!0,a.Gi=!0,a.Vs=!1,a.Ws=!0,a.Pi=!0,a.Hi=!0,a.Qi=!0,a.Ys=!0,a.Ii=!0,a.Ki=!0,a.Ji=!0,a.Li=!0,a.Mi=!0,a.Ni=!0,a.Oi=!0,a.Zs=!0,a.at=!0,a.qw=!1,a.Vk=!1,a.mn=!0,a.nn=!0,a.Xs=!0,a.$s=!0,a.iu=16,a.mu=16,a.qr=!1,a.gu=!1,a.lu=0,a.ju=0,a.yb=new ni(5).freeze(),a.Hw=new Ye().freeze(),a.Nt=999999999,a.nw=new Ye().freeze(),a.Zi=!0,a.Ee=!0,a.vd=!0,a.Be=!1,a.gf=!1,a.xh=!0,a.hf=!1,a.sy=new Ye,a.ow=new Ye,a.Xh=null,a.aw=new Ze(8,8),a.bw=999,a.Bw=1,a.Jw=0,a.fc={scale:1,position:new jt,bounds:new ye,Py:new Ze,bA:new Ze,Oz:!1},a.fc.canvasSize=a.fc.Py,a.fc.newCanvasSize=a.fc.bA,a.fc.isScroll=!1,a.Rw=new ye(NaN,NaN,NaN,NaN).freeze(),a.wo=new Ze(NaN,NaN).freeze(),a.Sp=new ye(NaN,NaN,NaN,NaN).freeze(),a.It=!1,a.Lg=new xn;var y=new $e,x=new Mr;x.bind(new Vo("text","",Ir)),y.add(x),a.ny=y,a.Lg.add("",y),y=new $e,x=new Mr,x.stroke="brown",x.bind(new Vo("text","",Ir)),y.add(x),a.Lg.add("Comment",y),y=new $e,y.selectable=!1,y.avoidable=!1,x=new Qn,x.figure="Ellipse",x.fill="black",x.stroke=null,x.desiredSize=new Ze(3,3).ja(),y.add(x),a.Lg.add("LinkLabel",y),a.Yi=new xn,y=new Yn,y.selectionObjectName="GROUPPANEL",y.type=Re.Vertical,x=new Mr,x.font="bold 12pt sans-serif",x.bind(new Vo("text","",Ir)),y.add(x),x=new Re(Re.Auto),x.name="GROUPPANEL";var b=new Qn;b.figure="Rectangle",b.fill="rgba(128,128,128,0.2)",b.stroke="black",x.add(b),b=new ba,b.padding=new ni(5,5,5,5).ja(),x.add(b),y.add(x),a.ly=y,a.Yi.add("",y),a.Kh=new xn,y=new _e,x=new Qn,x.isPanelMain=!0,y.add(x),x=new Qn,x.toArrow="Standard",x.fill="black",x.stroke=null,x.strokeWidth=0,y.add(x),a.my=y,a.Kh.add("",y),y=new _e,x=new Qn,x.isPanelMain=!0,x.stroke="brown",y.add(x),a.Kh.add("Comment",y),y=new Bi,y.type=Re.Auto,x=new Qn,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),x=new ba,x.margin=new ni(1.5,1.5,1.5,1.5).ja(),y.add(x),a.St=y,a.wt=y,y=new Bi,y.type=Re.Link,x=new Qn,x.isPanelMain=!0,x.fill=null,x.stroke="dodgerblue",x.strokeWidth=3,y.add(x),a.Kt=y,a.fe=null,a.mq=!1,a.Ck=null,a.partManager=new rr,a.toolManager=new jr,a.toolManager.initializeStandardTools(),a.defaultTool=a.toolManager,a.currentTool=a.defaultTool,a.nt=null,a.Wm=new st,a.Vt=null,a.Wt=null,a.Mr=!1,a.commandHandler=Ds(),a.eq=null,a.fq=ch,a.Pw=!1,a.Mb=1,a.Yh=null,a.Oq=1,a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0,a.yq=1,a.tw=0,a.uw=new jt,a.zy=500,a.wp=new jt,a.wq=!1}se.prototype.clear=function(){this.animationManager.Cc(),this.model.clear(),Kf=null,ef="",ql(this,!1),this.Xn.clear(),xg(),this.Og.clear(),this.Xh=null,this.Ya(),this.Va(),this.N()};function ql(a,y){a.animationManager.Cc(!0),a.Hw=new Ye().freeze(),a.nw=new Ye().freeze();var x=a.skipsUndoManager,b=a.cc!==null&&a.cc!==void 0;b&&(a.skipsUndoManager=!0);var E=null;a.fe!==null&&(E=a.fe.part,E!==null&&a.remove(E));var z=[],tt=a.Wa.length;if(y){for(y=0;y<tt;y++)for(var rt=a.Wa.s[y].parts;rt.next();){var ot=rt.value;ot!==E&&ot.data===null&&z.push(ot)}for(y=0;y<z.length;y++)a.remove(z[y])}for(y=0;y<tt;y++)a.Wa.s[y].clear();return a.partManager.clear(),a.De.clear(),a.Eh.clear(),a.ai.clear(),a.Ck=null,a.Xn.clear(),xg(),a.Og.clear(),rs=[],E!==null&&(a.add(E),a.partManager.parts.remove(E)),b&&(a.skipsUndoManager=x),z}function Ds(){return null}se.prototype.reset=function(){this.clear(),this.vb=!0,gu(this),il(this),this.Wg=!0,cr(this),this.layout=new Zr,this.Wg=!1,this.model=hy(),this.model.undoManager=new eo,this.vb=this.rn=!1,this.N()},se.prototype.setRTL=function(a){a=a===void 0?this.div:a,a===null&&(a=xe.document.body);var y=an("div");y.dir="rtl",y.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;",y.textContent="A",a.appendChild(y);var x="reverse";0<y.scrollLeft?x="default":(y.scrollLeft=1,y.scrollLeft===0&&(x="negative")),a.removeChild(y),this.bu=x},se.prototype.setScrollWidth=function(a){a=a===void 0?this.div:a,a===null&&(a=xe.document.body);var y=0;if(So){var x=um;y=kl,x===null&&(x=um=an("p"),x.style.width="100%",x.style.height="200px",x.style.boxSizing="content-box",y=kl=an("div"),y.style.position="absolute",y.style.visibility="hidden",y.style.width="200px",y.style.height="150px",y.style.boxSizing="content-box",y.appendChild(x)),y.style.overflow="hidden",a.appendChild(y);var b=x.offsetWidth;y.style.overflow="scroll",x=x.offsetWidth,b===x&&(x=y.clientWidth),a.removeChild(y),y=b-x,y!==0||Ps||(y=11)}this.Db=y,this.Gw=!0},se.prototype.qb=function(a){a.classType===se&&(this.autoScale=a)},se.prototype.toString=function(a){a===void 0&&(a=0);var y="";if(this.div&&this.div.id&&(y=this.div.id),y='Diagram "'+y+'"',0>=a)return y;for(var x=this.Wa.iterator;x.next();)y+=`
|
|
`+x.value.toString(a-1);return y};function $i(a,y){if(So){if(y!=null||fe("Diagram setup requires an argument DIV."),a.Ka!==null&&fe("Diagram has already completed setup."),typeof y=="string"?a.Ka=xe.document.getElementById(y):y instanceof HTMLDivElement?a.Ka=y:fe("No DIV or DIV id supplied: "+y),a.Ka===null&&fe("Invalid DIV id; could not get element with id: "+y),a.Ka.H!==void 0&&fe("Invalid div id; div already has a Diagram associated with it."),!a.ol&&xe.ResizeObserver){var x=Zn(function(){a.$b()},250);a.ol=new xe.ResizeObserver(function(){x()}),a.ol.observe(a.Ka)}xe.getComputedStyle(a.Ka,null).position==="static"&&(a.Ka.style.position="relative"),y=5;var b="rgba(2"+y+"5, 255, 255, 0)";y--,a.Ka.style["-webkit-tap-highlight-color"]=b,a.Ka.innerHTML="",a.Ka.H=a,a.Ka.goDiagram=a,a.Ka.go=xe.go;var E=new iu(a);if(E.style!==void 0&&(E.style.position="absolute",E.style.top="0px",E.style.left="0px",xe.getComputedStyle(a.Ka,null).getPropertyValue("direction")==="rtl"&&(a.tn=!0),E.style.zIndex="2",E.style.userSelect="none",E.style.MozUserSelect="none",E.style.touchAction="none",E.style.letterSpacing="normal !important",E.style.wordSpacing="normal !important"),a.ta=E,a.ib=E.context,b=a.ib,a.Mb=a.computePixelRatio(),a.viewSize.w()||(a.Aa=a.Ka.clientWidth||1,a.ya=a.Ka.clientHeight||1),Hf(a,a.Aa,a.ya),a.Ka.insertBefore(E.Oa,a.Ka.firstChild),E=new iu(null),E.width=1,E.height=1,a.jw=E,a.oy=E.context,So){E=an("div");var z=an("div");E.style.position="absolute",E.style.overflow="auto",E.style.width=a.Aa+"px",E.style.height=a.ya+"px",E.style.zIndex="1",z.style.position="absolute",z.style.width="1px",z.style.height="1px",a.Ka.appendChild(E),E.appendChild(z),E.onscroll=Cr,E.addEventListener("pointerdown",Nr),E.H=a,E.uy=!0,E.vy=!0,a.ku=E,a.hu=z}a.hk=Zn(function(){a.Yh=null,a.N()},300),a.Ov=Zn(function(){tl(a)},250),a.preventDefault=function(tt){return tt.preventDefault(),!1},a.$j=function(tt){if(a.isEnabled){var rt=Ha(a,tt,!0);rt.bubbles=!0;var ot=0,at=0;rt.delta=0,tt.deltaX!==void 0?(tt.deltaX!==0&&(ot=0<tt.deltaX?1:-1),tt.deltaY!==0&&(at=0<tt.deltaY?1:-1),rt.delta=Math.abs(tt.deltaX)>Math.abs(tt.deltaY)?-ot:-at):tt.wheelDeltaX!==void 0?(tt.wheelDeltaX!==0&&(ot=0<tt.wheelDeltaX?-1:1),tt.wheelDeltaY!==0&&(at=0<tt.wheelDeltaY?-1:1),rt.delta=Math.abs(tt.wheelDeltaX)>Math.abs(tt.wheelDeltaY)?-ot:-at):tt.wheelDelta!==void 0&&tt.wheelDelta!==0&&(rt.delta=0<tt.wheelDelta?1:-1),a.doMouseWheel(),qs(rt,tt)}},a.aA=function(tt){a.isEnabled&&(a.Vk=!1,Ha(a,tt,!0),tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())},a.ui=function(tt){if(a.isEnabled){a.Vk=!0;var rt=a.Yt;rt[tt.pointerId]===void 0&&(rt[tt.pointerId]=tt),rt=a.oj;var ot=!1;if(rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType)if(rt[1]!==null&&rt[1].pointerId===tt.pointerId)rt[1]=tt,ot=!0;else if(rt[0]===null)rt[0]=tt;else if(rt[1]===null)rt[1]=tt,ot=!0;else{tt.preventDefault();return}else rt[0]=tt;(rt=tt.pointerType==="touch"||tt.pointerType==="pen")&&(a.qu=!1,a.wq=!0);var at=ot;ot=Kh(a,tt,!0,!1,!0,at),wh(a,tt,ot),ot.targetDiagram=Gf(tt,tt.target),ot.targetObject=null,at||ot.clone(a.bq),at=a.uw,rt=rt?25:10,tt.timeStamp-a.tw<a.zy&&!(Math.abs(at.x-tt.screenX)>rt||Math.abs(at.y-tt.screenY)>rt)?a.yq++:a.yq=1,ot.clickCount=a.yq,a.tw=tt.timeStamp,a.uw.sg(tt.screenX,tt.screenY),a.doMouseDown(),tt.button===1?tt.preventDefault():qs(ot,tt)}},a.dk=function(tt){if(a.isEnabled){a.Vk=!0;var rt=a.oj;if(rt[0]===null||rt[0].pointerId!==tt.pointerId&&rt[0].pointerType===tt.pointerType){if(rt[1]!==null&&rt[1].pointerId===tt.pointerId){rt[1]=tt;return}if(rt[0]===null)rt[0]=tt;else return}else rt[0]=tt;if(rt[0].pointerId===tt.pointerId){rt=Kh(a,tt,!1,!1,!1,rt[1]!==null);var ot=xe.document.elementFromPoint(tt.clientX,tt.clientY)||null;ot!==null&&ot.shadowRoot!==void 0&&ot.shadowRoot!==null&&(ot=ot.shadowRoot.elementFromPoint(tt.clientX,tt.clientY));var at=a,ut=tt;ot&&ot.H&&(ut=tt,at=ot.H),rt.targetDiagram=at,wh(a,ut,rt),rt.targetObject=null,a.doMouseMove(),qs(rt,tt)}}},a.fk=function(tt){if(a.isEnabled){a.Vk=!0;var rt=tt.pointerType==="touch"||tt.pointerType==="pen",ot=a.Yt;if(rt&&a.qu)delete ot[tt.pointerId],tt.preventDefault();else if(ot=a.oj,ot[0]===null||ot[0].pointerId!==tt.pointerId&&ot[0].pointerType===tt.pointerType)ot[1]!==null&&ot[1].pointerId===tt.pointerId&&(ot[1]=null);else{ot[0]=null,ot=Kh(a,tt,!1,!0,!0,!1);var at=xe.document.elementFromPoint(tt.clientX,tt.clientY)||null;at!==null&&at.shadowRoot!==void 0&&at.shadowRoot!==null&&(at=at.shadowRoot.elementFromPoint(tt.clientX,tt.clientY)),at!==null&&at.H instanceof se&&at.H!==a&&wh(at.H,tt,ot),at===null&&(at=tt.target),wh(a,tt,ot),ot.clickCount=a.yq,ot.targetDiagram=Gf(tt,at),ot.targetObject=null,a.doMouseUp(),qs(ot,tt),rt&&(a.wq=!1)}}},a.ek=function(tt){if(a.isEnabled){a.Vk=!1;var rt=a.Yt;rt[tt.pointerId]&&delete rt[tt.pointerId],rt=a.oj,rt[0]!==null&&rt[0].pointerId===tt.pointerId&&(rt[0]=null),rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null),tt.pointerType!=="touch"&&tt.pointerType!=="pen"&&(tt=a.currentTool,tt.cancelWaitAfter(),tt.standardMouseOver())}},a.ck=function(tt){var rt=a.oj;rt[0]!==null&&rt[0].pointerId===tt.pointerId?(rt[0]=null,a.wq=!1):rt[1]!==null&&rt[1].pointerId===tt.pointerId&&(rt[1]=null)},a.Vp=b.Z["d"+bc[1]+bc[2]+"wI"+Xf.slice(1,5)]["b"+Dx.slice(1,y)](b.Z,kc,y,y),b.Vc(!0),to(a),a.nl==="svg"&&(y=a.pj.get("svg"),a.Ka.appendChild(y.Oa),a.ib=y.context)}}se.prototype.addEventListener=function(a,y,x,b){a.addEventListener(y,x,{capture:b,passive:!1})},se.prototype.removeEventListener=function(a,y,x,b){a.removeEventListener(y,x,{capture:b})};function to(a){var y=a.ta.Oa;y instanceof HTMLCanvasElement||(y=a.div),a.addEventListener(y,"pointerdown",a.ui,!1),a.addEventListener(y,"pointermove",a.dk,!1),a.addEventListener(y,"pointerup",a.fk,!1),a.addEventListener(y,"pointerout",a.ek,!1),a.addEventListener(y,"pointercancel",a.ck,!1),a.addEventListener(y,"pointerenter",a.bz,!1),a.addEventListener(y,"pointerleave",a.cz,!1),a.addEventListener(y,"wheel",a.$j,!1),a.addEventListener(y,"keydown",a.Qz,!1),a.addEventListener(y,"keyup",a.Rz,!1),a.addEventListener(y,"blur",a.Ny,!1),a.addEventListener(y,"focus",a.Oy,!1),a.addEventListener(y,"selectstart",function(x){return x.preventDefault(),!1},!1),a.addEventListener(y,"contextmenu",function(x){return x.preventDefault(),!1},!1),a.addEventListener(xe,"resize",a.Ov,!1)}function tr(a){30<a.Sq&&(a.Yh=1)}function _s(a,y){a.Yh!==null&&(a.Yh=null,y&&a.hk(),ho&&ho.nx||(a.Sq=0,a.zw=[0,0,0,0,0],a.Tq=0))}se.prototype.computePixelRatio=function(){return this.Yh!==null?this.Yh:xe.devicePixelRatio||1},se.prototype.doMouseMove=function(){this.currentTool.doMouseMove()},se.prototype.doMouseDown=function(){this.currentTool.doMouseDown()},se.prototype.doMouseUp=function(){this.currentTool.doMouseUp()},se.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()},se.prototype.doKeyDown=function(){this.currentTool.doKeyDown()},se.prototype.doKeyUp=function(){this.currentTool.doKeyUp()},se.prototype.doFocus=function(){this.focus()},se.prototype.focus=function(){if(this.ta)if(this.scrollsPageOnFocus)this.ta.focus();else{var a=xe.scrollX||xe.pageXOffset,y=xe.scrollY||xe.pageYOffset;this.ta.focus(),xe.scrollTo(a,y)}},se.prototype.Oy=function(){this.H.R("GainedFocus")},se.prototype.Ny=function(){this.H.R("LostFocus")};function tl(a){if(a.ta!==null){var y=a.Ka;if(y!==null&&y.clientWidth!==0&&y.clientHeight!==0){a.Gw||a.setScrollWidth();var x=a.gf?a.Db:0,b=a.Be?a.Db:0,E=a.Mb;a.Mb=a.computePixelRatio(),a.Mb!==E&&(a.pn=!0,a.$b()),(y.clientWidth!==a.Aa+x||y.clientHeight!==a.ya+b)&&(a.Ee=!0,a.Fc=!0,y=a.layout,y!==null&&y.isViewportSized&&a.autoScale===da&&(a.Jk=!0,y.C()),a.ld||a.$b())}}}function cr(a){var y=new bo;y.name="Background",a.Al(y),y=new bo,y.name="",a.Al(y),y=new bo,y.name="Foreground",a.Al(y),y=new bo,y.name="Adornment",y.isTemporary=!0,y.isInDocumentBounds=!1,a.Al(y),y=new bo,y.name="Tool",y.isTemporary=!0,y.isInDocumentBounds=!0,a.Al(y),y=new bo,y.name="Grid",y.allowSelect=!1,y.pickable=!1,y.isTemporary=!0,y.isInDocumentBounds=!1,a.Ww(y,a.Qj("Background"))}function _r(a){var y=new Re(Re.Grid);y.name="GRID";var x=new Qn;return x.figure="LineH",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new Qn,x.figure="LineH",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new Qn,x.figure="LineH",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new Qn,x.figure="LineV",x.stroke="lightgray",x.strokeWidth=.5,x.interval=1,y.add(x),x=new Qn,x.figure="LineV",x.stroke="gray",x.strokeWidth=.5,x.interval=5,y.add(x),x=new Qn,x.figure="LineV",x.stroke="gray",x.strokeWidth=1,x.interval=10,y.add(x),x=new vn,x.add(y),x.layerName="Grid",x.zOrder=0,x.isInDocumentBounds=!1,x.isAnimated=!1,x.pickable=!1,x.locationObjectName="GRID",a.add(x),a.partManager.parts.remove(x),y.visible=!1,y}function Cr(){this.H.gu?this.H.gu=!1:this.H.isEnabled?this.H.kx(this):Sd(this.H)}function Nr(a){this.H.isEnabled?(this.H.lu=a.target.scrollTop,this.H.ju=a.target.scrollLeft):Sd(this.H)}se.prototype.kx=function(a){if(this.ta!==null){var y=this.ku,x=this.hu;this.qr=!0;var b=this.documentBounds,E=this.viewportBounds,z=this.rj,tt=b.x-z.left,rt=b.y-z.top,ot=b.width+z.left+z.right,at=b.height+z.top+z.bottom,ut=b.right+z.right;z=b.bottom+z.bottom;var ct=E.x;b=E.y;var mt=E.width,yt=E.height,St=E.right,Lt=E.bottom;E=this.scale;var Ot=a.scrollLeft;if(this.tn)switch(this.bu){case"negative":Ot=Ot+a.scrollWidth-a.clientWidth;break;case"reverse":Ot=a.scrollWidth-Ot-a.clientWidth}var Dt=Ot;mt<ot||yt<at?(Ot=jt.allocAt(this.position.x,this.position.y),this.allowHorizontalScroll&&this.ju!==Dt&&(Ot.x=Dt/E+tt,this.ju=Dt),this.allowVerticalScroll&&this.lu!==a.scrollTop&&(Ot.y=a.scrollTop/E+rt,this.lu=a.scrollTop),this.position=Ot,jt.free(Ot),this.Ee=this.qr=!1):(Ot=jt.alloc(),a.uy&&this.allowHorizontalScroll&&(tt<ct&&(this.position=Ot.h(Dt+tt,this.position.y)),ut>St&&(this.position=Ot.h(-(y.scrollWidth-this.Aa)+Dt-this.Aa/E+ut,this.position.y))),a.vy&&this.allowVerticalScroll&&(rt<b&&(this.position=Ot.h(this.position.x,a.scrollTop+rt)),z>Lt&&(this.position=Ot.h(this.position.x,-(y.scrollHeight-this.ya)+a.scrollTop-this.ya/E+z))),jt.free(Ot),this.vd=!0,this.Ee=this.qr=!1,b=this.documentBounds,E=this.viewportBounds,ut=b.right,St=E.right,z=b.bottom,Lt=E.bottom,tt=b.x,ct=E.x,rt=b.y,b=E.y,mt>=ot&&tt>=ct&&ut<=St&&(x.style.width="1px"),yt>=at&&rt>=b&&z<=Lt&&(x.style.height="1px"))}},se.prototype.computeBounds=function(a){return a===void 0&&(a=new ye),As(this),Ro(this,a)};function Ro(a,y){if(a.fixedBounds.w())return y.assign(a.fixedBounds),y.Co(a.yb),y;for(var x=!0,b=a.Wa.s,E=b.length,z=0;z<E;z++){var tt=b[z];if(tt.visible&&tt.isInDocumentBounds){tt=tt.Pa.s;for(var rt=tt.length,ot=0;ot<rt;ot++){var at=tt[ot];at.isInDocumentBounds&&at.isVisible()&&(at=at.actualBounds,at.w()&&(x?(x=!1,y.assign(at)):y.ed(at)))}}}return x&&y.h(0,0,0,0),y.Co(a.yb),y}se.prototype.computePartsBounds=function(a,y){y===void 0&&(y=!1);var x=null;if(Gn(a))for(var b=0;b<a.length;b++){var E=a[b];!y&&E instanceof _e||(E.Va(),x===null?x=E.actualBounds.copy():x.ed(E.actualBounds))}else for(a=a.iterator;a.next();)b=a.value,!y&&b instanceof _e||(b.Va(),x===null?x=b.actualBounds.copy():x.ed(b.actualBounds));return x===null?new ye(NaN,NaN,0,0):x};function mo(a,y){if((y||a.hf)&&!a.vb&&a.ta!==null&&a.documentBounds.w()){if(a.vb=!0,y){var x=a.initialPosition;if(x.w()){a.vb=!1,a.position=x;return}x=jt.alloc(),x.xi(a.documentBounds,a.initialDocumentSpot);var b=a.viewportBounds;b=ye.allocAt(0,0,b.width,b.height);var E=jt.alloc();E.xi(b,a.initialViewportSpot),E.h(x.x-E.x,x.y-E.y),a.position=E,ye.free(b),jt.free(E),jt.free(x)}x=a.yh,y&&a.Fg!==da&&(x=a.Fg);var z=x!==da?bl(a,x):a.scale;x=a.pa.x,b=a.pa.y,E=a.Aa/z;var tt=a.ya/z,rt=a.zk,ot=a.pq;y&&!rt.sb()&&(ot.sb()||ot.Xb())&&(rt=ot.Xb()?Xi:ot),tu(a,a.documentBounds,E,tt,rt,y),y=a.scale,a.scale=z,a.vb=!1,z=a.viewportBounds,ne.B(z.x,x)&&ne.B(z.y,b)&&ne.B(z.width,E)&&ne.B(z.height,tt)||a.onViewportBoundsChanged(new ye(x,b,E,tt),z,y,!1)}}function bl(a,y){var x=a.Pp;if(a.ta===null)return x;a.Va();var b=a.documentBounds;if(!b.w())return x;var E=b.width;b=b.height;var z=a.Aa+(a.gf?a.Db:0),tt=a.ya+(a.Be?a.Db:0),rt=z/E,ot=tt/b;return y===Fl?(y=Math.min(ot,rt),y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):y===nf?(y=ot>rt?(tt-a.Db)/b:(z-a.Db)/E,y>x&&(y=x),y<a.minScale&&(y=a.minScale),y>a.maxScale&&(y=a.maxScale),y):a.scale}se.prototype.zoomToFit=function(){var a=this.sj;this.sj=Pd,this.scale=bl(this,Fl),a!==Pd&&(mo(this,!1),tu(this,this.documentBounds,this.Aa/this.Ca,this.ya/this.Ca,this.zk,!1)),this.sj=a},xt=se.prototype,xt.BA=function(a,y){y===void 0&&(y=Fl);var x=a.width,b=a.height;if(!(x===0||b===0||isNaN(x)&&isNaN(b))){var E=1;if(y===Fl||y===nf)if(isNaN(x))E=this.viewportBounds.height*this.scale/b;else if(isNaN(b))E=this.viewportBounds.width*this.scale/x;else{E=this.Aa;var z=this.ya;E=y===nf?z/b>E/x?(z-(this.Be?this.Db:0))/b:(E-(this.gf?this.Db:0))/x:Math.min(z/b,E/x)}this.scale=E,this.position=new jt(a.x,a.y)}},xt.Jy=function(a,y){this.Va();var x=this.documentBounds,b=this.viewportBounds;this.position=new jt(x.x+(a.x*x.width+a.offsetX)-(y.x*b.width-y.offsetX),x.y+(a.y*x.height+a.offsetY)-(y.y*b.height-y.offsetY))},xt.zz=function(a){if(a instanceof te){this.eq=a;var y=jt.alloc();this.fq=this.op(a.ga(ms,y)),jt.free(y)}else this.eq=null,this.fq=ch};function tu(a,y,x,b,E,z){var tt=jt.allocAt(a.pa.x,a.pa.y),rt=tt.x,ot=tt.y;if(a.eq!==null){var at=jt.alloc();at=a.eq.ga(ms,at),rt=at.x-a.fq.x/a.scale,ot=at.y-a.fq.y/a.scale,E=us,jt.free(at)}(z||a.scrollMode===Pd)&&(E.sb()&&(x>y.width&&(rt=y.x+(E.x*y.width+E.offsetX)-(E.x*x-E.offsetX)),b>y.height&&(ot=y.y+(E.y*y.height+E.offsetY)-(E.y*b-E.offsetY))),E=a.rj,z=x-y.width,x<y.width+E.left+E.right?(rt=Math.min(rt+x/2,y.right+Math.max(z,E.right)-x/2),rt=Math.max(rt,y.left-Math.max(z,E.left)+x/2),rt-=x/2):rt>y.left?rt=y.left:rt<y.right-x&&(rt=y.right-x),x=b-y.height,b<y.height+E.top+E.bottom?(ot=Math.min(ot+b/2,y.bottom+Math.max(x,E.bottom)-b/2),ot=Math.max(ot,y.top-Math.max(x,E.top)+b/2),ot-=b/2):ot>y.top?ot=y.top:ot<y.bottom-b&&(ot=y.bottom-b)),tt.x=isFinite(rt)?rt:-a.yb.left,tt.y=isFinite(ot)?ot:-a.yb.top,a.positionComputation!==null&&(y=a.positionComputation(a,tt),tt.x=y.x,tt.y=y.y),Hi(a.Yd,a.pa,tt),a.pa.h(tt.x,tt.y),il(a),jt.free(tt)}xt.Ol=function(a,y){if(y===void 0&&(y=!0),y){if(a=_a(this,a,function(x){return x.part},function(x){return x.canSelect()}),a instanceof vn)return a}else if(a=_a(this,a,function(x){return x.part}),a instanceof vn)return a;return null},xt.ic=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null),As(this);for(var b=this.Wa.iteratorBackwards;b.next();){var E=b.value;if(E.visible&&(E=E.ic(a,y,x),E!==null))return E}return null};function _a(a,y,x,b){for(x===void 0&&(x=null),b===void 0&&(b=null),As(a),a=a.Wa.iteratorBackwards;a.next();){var E=a.value;if(E.visible&&!E.isTemporary&&(E=E.ic(y,x,b),E!==null))return E}return null}xt.lz=function(a,y,x){return y===void 0&&(y=!0),$s(this,a,function(b){return b.part},y?function(b){return b instanceof vn&&b.canSelect()}:null,x)};function $s(a,y,x,b,E){for(x===void 0&&(x=null),b===void 0&&(b=null),E instanceof Ve||E instanceof Ye||(E=new Ye),As(a),a=a.Wa.iteratorBackwards;a.next();){var z=a.value;z.visible&&!z.isTemporary&&z.ji(y,x,b,E)}return E}xt.ji=function(a,y,x,b){y===void 0&&(y=null),x===void 0&&(x=null),b instanceof Ve||b instanceof Ye||(b=new Ye),As(this);for(var E=this.Wa.iteratorBackwards;E.next();){var z=E.value;z.visible&&z.ji(a,y,x,b)}return b},xt.ux=function(a,y,x,b){return y===void 0&&(y=!1),x===void 0&&(x=!0),pu(this,a,function(E){return E instanceof vn&&(!x||E.canSelect())},y,b)},xt.Cf=function(a,y,x,b,E){y===void 0&&(y=null),x===void 0&&(x=null),b===void 0&&(b=!1),E instanceof Ve||E instanceof Ye||(E=new Ye),As(this);for(var z=this.Wa.iteratorBackwards;z.next();){var tt=z.value;tt.visible&&tt.Cf(a,y,x,b,E)}return E},xt.Nu=function(a,y,x,b,E,z){var tt=new Ye;As(this);for(var rt=this.Wa.iteratorBackwards;rt.next();){var ot=rt.value;ot.visible&&ot.Nu(a,y,x,b,tt,E,z)}return tt};function pu(a,y,x,b,E){var z=null;for(z===void 0&&(z=null),x===void 0&&(x=null),b===void 0&&(b=!1),E instanceof Ve||E instanceof Ye||(E=new Ye),As(a),a=a.Wa.iteratorBackwards;a.next();){var tt=a.value;tt.visible&&!tt.isTemporary&&tt.Cf(y,z,x,b,E)}return E}xt.mz=function(a,y,x,b,E){return x===void 0&&(x=!0),b===void 0&&(b=!0),mu(this,a,y,function(z){return z instanceof vn&&(!b||z.canSelect())},x,E)},xt.og=function(a,y,x,b,E,z){x===void 0&&(x=null),b===void 0&&(b=null),E===void 0&&(E=!0),E!==!1&&E!==!0&&((E instanceof Ve||E instanceof Ye)&&(z=E),E=!0),z instanceof Ve||z instanceof Ye||(z=new Ye),As(this);for(var tt=this.Wa.iteratorBackwards;tt.next();){var rt=tt.value;rt.visible&&rt.og(a,y,x,b,E,z)}return z};function mu(a,y,x,b,E,z){var tt=null;for(tt===void 0&&(tt=null),b===void 0&&(b=null),E===void 0&&(E=!0),E!==!1&&E!==!0&&((E instanceof Ve||E instanceof Ye)&&(z=E),E=!0),z instanceof Ve||z instanceof Ye||(z=new Ye),As(a),a=a.Wa.iteratorBackwards;a.next();){var rt=a.value;rt.visible&&!rt.isTemporary&&rt.og(y,x,tt,b,E,z)}return z}se.prototype.acceptEvent=function(a){return Ha(this,a,a instanceof MouseEvent)};function Ha(a,y,x){var b=a.Qg;return a.Qg=a.cj,a.cj=b,b.diagram=a,b.event=y,x?wh(a,y,b):(b.viewPoint=a.Qg.viewPoint,b.documentPoint=a.Qg.documentPoint),a=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),b.modifiers=a,b.button=y.button,y.buttons!==void 0&&(b.buttons=y.buttons),Ps&&y.button===0&&y.ctrlKey&&(b.button=2),b.down=!1,b.up=!1,b.clickCount=1,b.delta=0,b.handled=!1,b.bubbles=!1,b.timestamp=y.timeStamp,b.isMultiTouch=!1,b.targetDiagram=Gf(y,y.target),b.targetObject=null,b}function Gf(a,y){return y===null?null:(y=y.H)?y:((y=a.path)||typeof a.composedPath!="function"||(y=a.composedPath()),y&&y[0]&&y[0].H?y[0].H:null)}function Kh(a,y,x,b,E,z){var tt=a.Qg;return a.Qg=a.cj,a.cj=tt,tt.diagram=a,tt.clickCount=1,a=tt.delta=0,y.ctrlKey&&(a+=1),y.altKey&&(a+=2),y.shiftKey&&(a+=4),y.metaKey&&(a+=8),tt.modifiers=a,tt.event=y,tt.timestamp=y.timeStamp,tt.button=y.button,tt.buttons=y.buttons,Ps&&y.button===0&&y.ctrlKey&&(tt.button=2),tt.down=x,tt.up=b,tt.handled=!1,tt.bubbles=E,tt.isMultiTouch=z,tt}function qs(a,y){return a.bubbles?!0:(y.stopPropagation!==void 0&&y.stopPropagation(),y.cancelable!==!1&&y.preventDefault(),y.cancelBubble=!0,!1)}se.prototype.Qz=function(a){var y=this.H;if(!this.H.isEnabled)return!1;var x=Ha(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.down=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del";break;case 48:x.key="0";break;case 187:case 61:case 107:x.key="Add";break;case 189:case 173:case 109:x.key="Subtract";break;case 27:x.key="Esc"}return y.doKeyDown(),qs(x,a)},se.prototype.Rz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ha(y,a,!1);switch(x.key=String.fromCharCode(a.which),x.up=!0,a.which){case 8:x.key="Backspace";break;case 33:x.key="PageUp";break;case 34:x.key="PageDown";break;case 35:x.key="End";break;case 36:x.key="Home";break;case 37:x.key="Left";break;case 38:x.key="Up";break;case 39:x.key="Right";break;case 40:x.key="Down";break;case 45:x.key="Insert";break;case 46:x.key="Del"}return y.doKeyUp(),qs(x,a)},se.prototype.bz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ha(y,a,!0);return y.mouseEnter!==null&&y.mouseEnter(x),y.currentTool.standardMouseOver(),qs(x,a)},se.prototype.cz=function(a){var y=this.H;if(!y.isEnabled)return!1;var x=Ha(y,a,!0);return y.mouseLeave!==null&&y.mouseLeave(x),qs(x,a)},se.prototype.getMouse=function(a){var y=this.ta;if(y===null)return new jt(0,0);var x=y.getBoundingClientRect();return y=a.clientX-this.Aa/x.width*x.left,a=a.clientY-this.ya/x.height*x.top,this.Ab!==null?Lo(new jt(y,a),this.Ab):new jt(y,a)};function wh(a,y,x){var b=a.ta,E=a.Aa,z=a.ya,tt=0,rt=0;b!==null&&(b=b.getBoundingClientRect(),tt=y.clientX-E/b.width*b.left,rt=y.clientY-z/b.height*b.top),x.viewPoint.h(tt,rt),a.Ab!==null?(y=jt.allocAt(tt,rt),a.Ab.Cd(y),x.documentPoint.assign(y),jt.free(y)):x.documentPoint.h(tt,rt)}function Pc(a,y,x){if(a.oj[0]!==null){y=a.oj[y];var b=a.ta;b!==null&&(b=b.getBoundingClientRect(),x.h(y.clientX-a.Aa/b.width*b.left,y.clientY-a.ya/b.height*b.top))}}se.prototype.Ya=function(){this.Zi||(this.Zi=!0,this.$b(!1))};function ng(a){a.ld||As(a),a.Va()}se.prototype.redraw=function(){this.vb||this.ld||(this.N(),this.bd())},xt=se.prototype,xt.Pz=function(){return this.kg},xt.Xy=function(a){a===void 0&&(a=null);var y=this.animationManager,x=y.isEnabled;y.Cc(),y.isEnabled=!1,gl(this),this.hf=!1,this.du=new jt(NaN,NaN),y.isEnabled=x,this.ld=!0;var b=this;a!==null&&Oi(function(){b.ld=!1,io(y,"Model"),a(b)},1)},xt.$b=function(a){if(a===void 0&&(a=!1),this.kg!==!0&&!(this.vb||a===!1&&this.ld)){this.kg=!0;var y=this;xe.requestAnimationFrame(function(){y.kg&&y.bd()})}},xt.bd=function(){(!this.fn||this.kg)&&(this.fn&&(this.fn=!1),gl(this))};function eu(a,y,x){!a.Ee||a.vb||a.animationManager.defaultAnimation.isAnimating||Sd(a)||(y&&As(a),x&&mo(a,!1))}function gl(a,y){if(!a.ld&&(a.kg=!1,a.Ka!==null||a.wo.w())){a.ld=!0;var x=a.animationManager,b=a.Xn;if(!x.isAnimating&&b.length!==0){for(var E=b.s,z=E.length,tt=0;tt<z;tt++){var rt=E[tt];Zo(rt,!1),rt.v()}b.clear()}b=a.ow,0<b.count&&(b.each(function(ot){ot.Nv()}),b.clear()),E=b=!1,x.defaultAnimation.isAnimating&&(E=!0,b=a.skipsUndoManager,a.skipsUndoManager=!0),x.zb||tl(a),eu(a,!1,!0),a.fe!==null&&(a.fe.visible&&!a.mq&&(Bs(a),a.mq=!0),!a.fe.visible&&a.mq&&(a.mq=!1)),As(a),z=!1,(!a.hf||a.xh)&&(a.hf?qg(a,!a.Jk):(a.Ea("Initial Layout"),x.isEnabled===!1&&x.Cc(),qg(a,!1)),z=!0),a.Jk=!1,As(a),a.ou||ng(a),eu(a,!0,!1),tt=!1,z?(x=ye.alloc(),x.assign(a.viewportBounds),a.hf||(tt=a.hf=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,wc(a)),a.R("LayoutCompleted"),eu(a,!0,!1),ye.free(x)):x.Ok&&x.Qw&&(a.Fg!==da?a.scale=bl(a,a.Fg):a.yh!==da?a.scale=bl(a,a.yh):(x=a.initialScale,isFinite(x)&&0<x&&(a.scale=x)),mo(a,!0)),z&&tt&&a.eb("Initial Layout"),As(a),y||a.gc(a.ib),E&&(a.skipsUndoManager=b),a.ld=!1}}function wc(a){if(a.Fg!==da)a.scale=bl(a,a.Fg);else if(a.yh!==da)a.scale=bl(a,a.yh);else{var y=a.initialScale;isFinite(y)&&0<y&&(a.scale=y)}mo(a,!0),y=a.Wa.s,a.Fd(y,y.length,a,a.viewportBounds),a.R("InitialLayoutCompleted"),a.du.assign(a.pa),Bs(a)}function As(a){if(a.De.count!==0&&(a.ld||!a.animationManager.isTicking)){for(var y=0;23>y;y++){var x=a.De.iterator;if(x===null||a.De.count===0)break;a.De=new Ye,a.Nv(x,a.De)}a.nodes.each(function(b){b instanceof Yn&&b.U&65536&&(b.U=b.U^65536)})}}xt.Nv=function(a,y){for(a.reset();a.next();){var x=a.value;!x.Zc()||x instanceof Yn||(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))}for(a.reset();a.next();)x=a.value,x instanceof Yn&&x.isVisible()&&$d(this,x);for(a.reset();a.next();)x=a.value,x instanceof _e&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x));for(a.reset();a.next();)x=a.value,x instanceof Bi&&x.isVisible()&&(x.si()?(x.measure(1/0,1/0),x.arrange()):y.add(x))};function $d(a,y){for(var x=Kn(),b=Kn(),E=y.memberParts;E.next();){var z=E.value;z.isVisible()&&(z instanceof Yn?(Nl(z)||Ma(z)||of(z))&&$d(a,z):z instanceof _e?z.fromNode===y||z.toNode===y?b.push(z):x.push(z):(z.measure(1/0,1/0),z.arrange()))}for(a=x.length,E=0;E<a;E++)z=x[E],z.measure(1/0,1/0),z.arrange();for(zn(x),y.measure(1/0,1/0),y.arrange(),a=b.length,y=0;y<a;y++)x=b[y],x.measure(1/0,1/0),x.arrange();zn(b)}xt.Fd=function(a,y,x,b){if(this.vd||this.animationManager.isAnimating)for(var E=0;E<y;E++)a[E].Fd(x,b)},xt.gc=function(a){if(this.Ka!==null){if(this.ta===null&&fe("No canvas specified"),this.nl==="svg"){if(this.Ka!==null){var y=this.animationManager;if(!y.zb&&(!y.isAnimating||y.isTicking)){Yh(this);var x=this.Aa,b=this.ya;if(a.Gv.resize(x,b,x,b),x=this.Wa.s,b=x.length,this.Fd(x,b,this,this.viewportBounds),this.Fc||y.isAnimating){y=this.pa;var E=this.Ca,z=Math.round(y.x*E)/E,tt=Math.round(y.y*E)/E,rt=this.Ab;for(rt.reset(),E!==1&&rt.scale(E),y.x===0&&y.y===0||rt.translate(-z,-tt),a.ti=null,Xy(a,rt.m11,rt.m12,rt.m21,rt.m22,rt.dx,rt.dy),this.pb!==1&&(a.globalAlpha=this.pb),nh(this,a),y=this.Mb,this.ta.context.setTransform(y,0,0,y,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya),y=0;y<b;y++)x[y].gc(a,this);a=!1,this.Yf?Zf(this.Yf,this)&&(a=this.Vp()):a=!0,a&&(oi.prototype.Cd=oi.prototype.Eu),this.Fc=this.vd=!1}}}}else t:if(z=this.animationManager,!z.zb&&(!z.isAnimating||z.isTicking)&&(x=new Date,Yh(this),this.Ka.style.opacity!=="0")){if(b=a!==this.ib,y=this.Wa.s,E=y.length,this.Fd(y,E,this,this.viewportBounds),b)a.Vc(!0),this.vd=!0;else if(!this.Fc&&!z.isAnimating)break t;z=this.Ab,z.reset(),tt=this.Mb,rt=this.pa;var ot=this.Ca,at=Math.round(rt.x*ot)/ot,ut=Math.round(rt.y*ot)/ot;for(ot!==1&&z.scale(ot),rt.x===0&&rt.y===0||z.translate(-at,-ut),a.setTransform(tt,0,0,tt,0,0),a.clearRect(0,0,this.Aa,this.ya),this.pb!==1&&(a.globalAlpha=this.pb),nh(this,a),rt=0;rt<E;rt++)a.setTransform(tt,0,0,tt,0,0),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),a.yc(),y[rt].gc(a,this);if(y=!1,this.Yf?Zf(this.Yf,this)&&(y=this.Vp()):y=!0,y&&(oi.prototype.Cd=oi.prototype.Eu),b?(this.ib.Vc(!0),this.vd=!0):this.Fc=this.vd=!1,y=+new Date-+x,b=ho&&ho.nx,x=this.zw,b||this.Yh===null){for(x[this.Tq]=y,this.Tq=(this.Tq+1)%x.length,E=y=0;E<x.length;E++)y+=x[E];this.Sq=y/x.length}if(this.pb!==1&&(a.globalAlpha=1),b)for(a.setTransform(1,0,0,1,0,0),b=0;b<x.length;b++)a.fillText(x[b].toString(),20,150+ +(20*b))}}};function _f(a,y,x,b,E,z,tt,rt,ot,at){if(a.Ka!==null){a.ta===null&&fe("No canvas specified"),tt===void 0&&(tt=null),rt===void 0&&(rt=null),ot===void 0&&(ot=!1),at===void 0&&(at=!1),Yh(a),a.ib.Vc(!0),a.vd=!0,a.$i=!0;var ut=a.Ca;a.Ca=E;var ct=a.Wa.s,mt=ct.length;try{var yt=new ye(z.x,z.y,b.width/E,b.height/E),St=yt.copy();St.Co(x),Bs(a,St),As(a),a.Fd(ct,mt,a,yt),y.setTransform(1,0,0,1,0,0),y.clearRect(0,0,b.width,b.height),rt!==null&&rt!==""&&(y.fillStyle=rt,y.ox(0,0,b.width,b.height));var Lt=a.Mb;y.scale(Lt,Lt);var Ot=oi.alloc();Ot.reset(),Ot.translate(x.left,x.top),Ot.scale(E),z.x===0&&z.y===0||Ot.translate(-z.x,-z.y),y.setTransform(Ot.m11,Ot.m12,Ot.m21,Ot.m22,Ot.dx,Ot.dy),y.yc(),y instanceof pl&&Xy(y,Ot.m11,Ot.m12,Ot.m21,Ot.m22,Ot.dx,Ot.dy),oi.free(Ot),nh(a,y),y.globalAlpha=a.pb;var Dt=a.Qj("Grid");if(tt){var Gt=new Ye,Vt=tt.iterator;for(Vt.reset();Vt.next();){var Yt=Vt.value;Yt instanceof vn&&(at||Yt.layer!==Dt)&&(Yt.Gj(),Gt.add(Yt))}for(at=0;at<mt;at++)cu(ct[at],y,a,Gt,ot);Gt.each(function(ae){return ae.Gj()})}else for(Gt=0;Gt<mt;Gt++){var qt=ct[Gt];qt===Dt?at&&qt.gc(y,a,!0):qt.gc(y,a,ot)}a.$i=!1,a.Yf&&Zf(a.Yf,a)&&a.Vp()}finally{a.Ca=ut,a.ib.Vc(!0),a.vd=!0,a.Fd(ct,mt,a,a.viewportBounds),Bs(a),a.ib instanceof pl&&(a.ib.Nj.PA(),a.redraw())}}}xt.Gf=function(a){return this.Rg[a]},xt.Xx=function(a,y){a==="minDrawingLength"&&(this.Oq=y),this.Rg[a]=y,this.redraw()},xt.Tx=function(){this.Rg=new ai,this.Rg.drawShadows=!0,this.Rg.textGreeking=!0,this.Rg.viewportOptimizations=!(Ps||Za),this.Rg.temporaryPixelRatio=!0,this.Rg.pictureRatioOptimization=!0,this.Oq=this.Rg.minDrawingLength=1};function nh(a,y){a=a.Rg,a!==null&&(a.imageSmoothingEnabled!==void 0&&y.Wx(!!a.imageSmoothingEnabled),a=a.defaultFont,a!=null&&(y.font=a))}xt.Ql=function(a){return this.on[a]},xt.sA=function(a,y){this.on[a]=y},xt.Sx=function(){this.on=new ai,this.on.extraTouchArea=10,this.on.extraTouchThreshold=10,this.on.hasGestureZoom=!0},xt.set=function(a){return Object.assign(this,a),this},xt.Du=function(a){return this.nm(a)},xt.nm=function(a){return yd(this,a),this};function yd(a,y){var x=a instanceof Re,b=a instanceof se,E;for(E in y){E===""&&fe("Setting properties requires non-empty property names");var z=a,tt=E;if(x||b){var rt=E.indexOf(".");if(0<rt){var ot=E.substring(0,rt);x?z=a.fb(ot):(z=a[ot],z==null&&(z=a.toolManager[ot])),Ue(z)?tt=E.substr(rt+1):fe("Unable to find object named: "+ot+" in "+a.toString()+" when trying to set property: "+E)}}if(tt[0]!=="_"&&!no(z,tt))if(b&&tt==="ModelChanged"){a.Yw(y[tt]);continue}else if(b&&tt==="Changed"){a.Pe(y[tt]);continue}else if(b&&no(a.toolManager,tt))z=a.toolManager;else if(b&&sm(a,tt)){a.Bj(tt,y[tt]);continue}else if(a instanceof fn&&tt==="Changed"){a.Pe(y[tt]);continue}else fe('Trying to set undefined property "'+tt+'" on object: '+z.toString());z[tt]=y[E],tt[0]==="_"&&z instanceof te&&z.Vw(tt)}}xt.bx=function(){if(this.Eh.count!==0&&!(1<this.undoManager.transactionLevel)){for(;0<this.Eh.count;){var a=this.Eh;for(this.Eh=new xn,a=a.iterator;a.next();){var y=a.key;y.Xo(a.value),y.qc()}}this.N()}},xt.N=function(a){if(a===void 0)this.Fc=!0,this.$b();else{var y=this.viewportBounds;a.w()&&y.Yc(a)&&(this.Fc=!0,this.$b())}this.R("InvalidateDraw")},se.prototype.invalidateViewport=function(a,y){if(this.Fc!==!0)if(this.Fc=!0,this.nl==="svg")this.bd();else{var x=this.Gf("temporaryPixelRatio")===!0;if(this.Gf("viewportOptimizations")===!0&&this.scrollMode!==Mc&&this.rj.hi(0,0,0,0)&&y.width===a.width&&y.height===a.height){var b=this.scale,E=Math.max(a.y,y.y),z=Math.min(a.y+a.height,y.y+y.height);if(0<Math.max(0,Math.min(a.x+a.width,y.x+y.width)-Math.max(a.x,y.x))*b&&0<Math.max(0,z-E)*b){if(!(this.ld||(this.kg=!1,this.Ka===null||(this.ld=!0,this.documentBounds.w()||(b=ye.alloc(),oh(this,this.computeBounds(b)),ye.free(b)),b=this.ta,b===null||b instanceof sh)))){var tt=this.Mb;E=this.Aa*tt;var rt=this.ya*tt,ot=this.scale*tt;z=Math.round(Math.round(y.x*ot)-Math.round(a.x*ot)),y=Math.round(Math.round(y.y*ot)-Math.round(a.y*ot)),ot=this.jw,a=this.oy,ot.width!==E&&(ot.width=E),ot.height!==rt&&(ot.height=rt),a.clearRect(0,0,E,rt),ot=190*tt;var at=70*tt,ut=Math.max(z,0),ct=Math.max(y,0),mt=Math.floor(E-ut),yt=Math.floor(rt-ct);a.drawImage(b.Oa,ut,ct,mt,yt,0,0,mt,yt),Zf(this.Yf,this)&&a.clearRect(0,0,ot,at),b=Kn(),a=Kn(),yt=Math.abs(z),mt=Math.abs(y);var St=ut===0?0:E-yt;ut=jt.allocAt(St,0),yt=jt.allocAt(yt+St,rt),a.push(new ye(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)));var Lt=this.Ab;if(Lt.reset(),Lt.scale(tt,tt),this.Ca!==1&&Lt.scale(this.Ca),tt=this.pa,(tt.x!==0||tt.y!==0)&&isFinite(tt.x)&&isFinite(tt.y)&&Lt.translate(-tt.x,-tt.y),Lo(ut,Lt),Lo(yt,Lt),b.push(new ye(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),St=ct===0?0:rt-mt,ut.h(0,St),yt.h(E,mt+St),a.push(new ye(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Lo(ut,Lt),Lo(yt,Lt),b.push(new ye(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Zf(this.Yf,this)&&(E=0<z?0:-z,rt=0<y?0:-y,ut.h(E,rt),yt.h(ot+E,at+rt),a.push(new ye(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y))),Lo(ut,Lt),Lo(yt,Lt),b.push(new ye(Math.min(ut.x,yt.x),Math.min(ut.y,yt.y),Math.abs(ut.x-yt.x),Math.abs(ut.y-yt.y)))),jt.free(ut),jt.free(yt),eu(this,!1,!0),this.Ka===null&&fe("No div specified"),this.ta===null&&fe("No canvas specified"),!this.animationManager.zb&&(E=this.ib,this.Fc)){for(Yh(this),rt=this.Mb,E.setTransform(1,0,0,1,0,0),E.clearRect(0,0,this.Aa*rt,this.ya*rt),E.drawImage(this.jw.Oa,0<z?0:Math.round(-z),0<y?0:Math.round(-y)),z=this.pa,tt=this.Ca,ot=Math.round(z.x*tt)/tt,at=Math.round(z.y*tt)/tt,y=this.Ab,y.reset(),tt!==1&&y.scale(tt),z.x===0&&z.y===0||y.translate(-ot,-at),E.save(),E.beginPath(),z=a.length,tt=0;tt<z;tt++)ot=a[tt],ot.width!==0&&ot.height!==0&&E.rect(Math.floor(ot.x),Math.floor(ot.y),Math.ceil(ot.width),Math.ceil(ot.height));for(E.clip(),E.setTransform(rt,0,0,rt,0,0),E.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),E.yc(),y=this.Wa.s,z=y.length,this.Fd(y,z,this,this.viewportBounds),nh(this,E),E.globalAlpha=this.pb,rt=0;rt<z;rt++)if(tt=y[rt],ot=b,tt.visible&&tt.pb!==0){at=Ls(tt,E),ct=tt.Zq,ct.length=0,ut=this.scale,mt=ye.alloc(),yt=tt.Pa.s,Lt=yt.length,St=ot.length;for(var Ot=0;Ot<Lt;Ot++){var Dt=yt[Ot],Gt=nc(Dt,Dt.actualBounds);t:{for(var Vt=2/ut,Yt=4/ut,qt=0;qt<St;qt++){var ae=ot[qt];if(ae.width!==0&&ae.height!==0&&Gt.Vu(ae.x-Vt,ae.y-Vt,ae.width+Yt,ae.height+Yt)){Gt=!0;break t}}Gt=!1}Gt&&tt.Oj(E,Dt,this,ct,ut,mt,!0)}ye.free(mt),E.globalAlpha=at}E.restore(),E.Vc(!0),this.Yf&&Zf(this.Yf,this)&&this.Vp(),this.Fc=this.vd=!1,this.hk()}zn(b),zn(a),this.ld=!1}}else this.bd();x&&(tr(this),this.bd(),_s(this,!0))}else x?(tr(this),this.bd(),_s(this,!0)):this.bd()}};function Yh(a){a.pn!==!1&&(a.pn=!1,Hf(a,a.Aa,a.ya))}function Hf(a,y,x){il(a);var b=a.Mb;a.ta.resize(y*b,x*b,y,x)&&(a.Fc=!0,a.ib.Vc(!0))}function Sd(a){var y=a.ta;if(y===null||a.wo.w())return!0;var x=a.Aa,b=a.ya,E=a.Ka,z=!1,tt=a.gf?a.Db:0,rt=a.Be?a.Db:0,ot=E.clientWidth||x+tt,at=E.clientHeight||b+rt,ut=a.viewportBounds;E=ut.x;var ct=ut.y,mt=ut.width,yt=ut.height;if((ot!==x+tt||at!==b+rt)&&(a.gf=!1,a.Be=!1,rt=tt=0,a.Aa=ot,a.ya=at,z=a.pn=!0,il(a)),!a.hf||!a.viewportBounds.w())return!0;var St=a.ku,Lt=a.hu;if(a.Ee=!1,!(z||a.gf||a.Be||a.mn||a.nn))return!0;var Ot=a.documentBounds,Dt=0,Gt=0,Vt=0,Yt=0,qt=ut.width,ae=ut.height,Je=a.rj;a.contentAlignment.sb()?(Ot.width>qt&&(Dt=Je.left,Gt=Je.right),Ot.height>ae&&(Vt=Je.top,Yt=Je.bottom)):(Dt=Je.left,Gt=Je.right,Vt=Je.top,Yt=Je.bottom);var un=Ot.width+Dt+Gt,nn=Ot.height+Vt+Yt;Je=a.scale;var Ge=un>ot/Je,we=nn>at/Je;if(!(z||a.gf||a.Be||Ge||we))return!0;Dt=Ot.x-Dt,ot=ut.x,Gt=Ot.right+Gt,at=ut.right+tt,Vt=Ot.y-Vt;var Un=ut.y;Ot=Ot.bottom+Yt,ut=ut.bottom+rt;var jn="1px";if(Yt="1px",a.scrollMode===Pd&&(Ge||we)&&(Ge&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(Ge=1,Dt+1<ot&&(Ge=Math.max((ot-Dt)*Je+a.Aa,Ge)),Gt>at+1&&(Ge=Math.max((Gt-at)*Je+a.Aa,Ge)),qt+tt+1<un&&(Ge=Math.max((un-qt)*Je+a.Aa,Ge)),jn=Ge.toString()+"px"),we&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(Ge=1,Vt+1<Un&&(Ge=Math.max((Un-Vt)*Je+a.ya,Ge)),Ot>ut+1&&(Ge=Math.max((Ot-ut)*Je+a.ya,Ge)),ae+rt+1<nn&&(Ge=Math.max((nn-ae)*Je+a.ya,Ge)),Yt=Ge.toString()+"px")),Ge=jn!=="1px",we=Yt!=="1px",Ge&&we||!Ge&&!we||(we&&(at-=a.Db),Ge&&(ut-=a.Db),un<qt+tt||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(tt=1,Dt+1<ot&&(tt=Math.max((ot-Dt)*Je+a.Aa,tt)),Gt>at+1&&(tt=Math.max((Gt-at)*Je+a.Aa,tt)),qt+1<un&&(tt=Math.max((un-qt)*Je+a.Aa,tt)),jn=tt.toString()+"px"),Ge=jn!=="1px",tt=a.ya,Ge!==a.Be&&(tt=Ge?a.ya-a.Db:a.ya+a.Db),nn<ae+rt||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(rt=1,Vt+1<Un&&(rt=Math.max((Un-Vt)*Je+tt,rt)),Ot>ut+1&&(rt=Math.max((Ot-ut)*Je+tt,rt)),ae+1<nn&&(rt=Math.max((nn-ae)*Je+tt,rt)),Yt=rt.toString()+"px"),we=Yt!=="1px"),a.qr&&Ge===a.Be&&we===a.gf)return x===a.Aa&&b===a.ya||a.bd(),!1;if(Ge!==a.Be&&(jn==="1px"?a.ya=a.ya+a.Db:a.ya=Math.max(a.ya-a.Db,1),z=!0),a.Be=Ge,Lt.style.width=jn,we!==a.gf&&(Yt==="1px"?a.Aa=a.Aa+a.Db:a.Aa=Math.max(a.Aa-a.Db,1),z=!0,a.tn&&(rt=jt.alloc(),we?(y.style.left=a.Db+"px",a.position=rt.h(a.pa.x+a.Db/a.scale,a.pa.y)):(y.style.left="0px",a.position=rt.h(a.pa.x-a.Db/a.scale,a.pa.y)),jt.free(rt))),z&&il(a),a.gf=we,Lt.style.height=Yt,a.gu=!0,z&&(a.pn=!0),y=St.scrollLeft,a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(qt+1<un?y=(a.position.x-Dt)*Je:Dt+1<ot?y=St.scrollWidth-St.clientWidth:Gt>at+1&&(y=a.position.x*Je)),a.tn)switch(a.bu){case"negative":y=-(St.scrollWidth-y-St.clientWidth);break;case"reverse":y=St.scrollWidth-y-St.clientWidth}return St.scrollLeft=y,a.hasVerticalScrollbar&&a.allowVerticalScroll&&(ae+1<nn?St.scrollTop=(a.position.y-Vt)*Je:Vt+1<Un?St.scrollTop=St.scrollHeight-St.clientHeight:Ot>ut+1&&(St.scrollTop=a.position.y*Je)),ot=a.Aa,at=a.ya,St.style.width=ot+(a.gf?a.Db:0)+"px",St.style.height=at+(a.Be?a.Db:0)+"px",x!==ot||b!==at||a.animationManager.zb?(x=ye.allocAt(E,ct,mt,yt),a.onViewportBoundsChanged(x,a.viewportBounds,Je,z),ye.free(x),!1):!0}xt=se.prototype,xt.add=function(a){var y=a.diagram;if(y!==this&&(y!==null&&fe("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+y.toString()),y=this.Qj(a.layerName),y===null&&(y=this.Qj("")),y===null&&fe('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==y)){var x=y.oi(99999999,a,a.diagram===this);0<=x&&this.cb(ko,"parts",y,null,a,null,x),y.isTemporary||this.Ya(),a.C(1),x=a.layerChanged,x!==null&&x(a,null,y)}},xt.oi=function(a){this.partManager.oi(a);var y=this;qf(a,function(x){El(y,x)}),(a instanceof Bi||a instanceof Yn&&a.placeholder!==null)&&a.v(),a.data!==null&&qf(a,function(x){ay(y.partManager,x)}),Ma(a)!==!0&&of(a)!==!0||this.De.add(a),R1(a,!0,this),z1(a)?(a.actualBounds.w()&&this.N(nc(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(nc(a,a.actualBounds)),this.$b()},xt.pc=function(a){a.Ej(),this.partManager.pc(a);var y=this;a.data!==null&&qf(a,function(x){ly(y.partManager,x,y)}),this.De.remove(a),z1(a)?(a.actualBounds.w()&&this.N(nc(a,a.actualBounds)),this.Ya()):a.isVisible()&&a.actualBounds.w()&&this.N(nc(a,a.actualBounds)),this.$b()},xt.remove=function(a){Vf(this,a,!0)};function Vf(a,y,x){var b=y.layer;b!==null&&b.diagram===a&&(y.isSelected=!1,y.isHighlighted=!1,y.C(2),x&&y.Lj(),x=b.pc(-1,y,!1),0<=x&&a.cb(Bo,"parts",b,y,null,x,null),a=y.layerChanged,a!==null&&a(y,b,null))}xt.Is=function(a,y){if(y===void 0&&(y=!1),Gn(a))for(var x=a.length,b=0;b<x;b++){var E=a[b];y&&!E.canDelete()||this.remove(E)}else for(x=new Ye,x.addAll(a),a=x.iterator;a.next();)x=a.value,y&&!x.canDelete()||this.remove(x)},xt.Kj=function(a,y,x){return x===void 0&&(x=!1),this.partManager.Kj(a,y,x)},se.prototype.moveParts=function(a,y,x,b){if(x===void 0&&(x=!1),b===void 0&&(b=Wf(this)),this.toolManager!==null){var E=new xn;if(a!==null)if(Gn(a))for(var z=0;z<a.length;z++)Ru(this,E,a[z],x,b);else for(a=a.iterator;a.next();)Ru(this,E,a.value,x,b);else{for(a=this.parts;a.next();)Ru(this,E,a.value,x,b);for(a=this.nodes;a.next();)Ru(this,E,a.value,x,b);for(a=this.links;a.next();)Ru(this,E,a.value,x,b)}Xh(this,E,y,b,x)}};function Ru(a,y,x,b,E,z){if(!y.contains(x)&&(z===void 0&&(z=!1),!b||z||x.canMove()||x.canCopy()))if(E===void 0&&(E=Wf(a)),x instanceof $e){if(y.add(x,a.Pd(E,x,x.location)),x instanceof Yn&&(x.placeholder!==null||E.dragsMembers))for(z=x.memberParts;z.next();)Ru(a,y,z.value,b,E,E.groupsAlwaysMove);for(z=x.linksConnected;z.next();){var tt=z.value;if(!y.contains(tt)){var rt=tt.fromNode,ot=tt.toNode;rt!==null&&y.contains(rt)&&ot!==null&&y.contains(ot)&&Ru(a,y,tt,b,E)}}if(E.dragsTree)for(x=x.Ou();x.next();)Ru(a,y,x.value,b,E)}else if(x instanceof _e)for(y.add(x,a.Pd(E,x)),x=x.labelNodes;x.next();)Ru(a,y,x.value,b,E);else x instanceof Bi||y.add(x,a.Pd(E,x,x.location))}function Xh(a,y,x,b,E){if(y!==null&&y.count!==0){var z=jt.alloc(),tt=jt.alloc();tt.assign(x),isNaN(tt.x)&&(tt.x=0),isNaN(tt.y)&&(tt.y=0),(x=a.Mr)||qd(a,y);for(var rt=Kn(),ot=Kn(),at=y.iterator,ut=jt.alloc();at.next();){var ct=at.key,mt=at.value;if(ct.Zc()){var yt=Po(a,ct,y);yt!==null?rt.push(new it(ct,mt,yt)):(!E||ct.canMove())&&(yt=mt.point,z.assign(yt),a.computeMove(ct,z.add(tt),b,ut),ct.location=ut,mt.shifted===void 0&&(mt.shifted=new jt),mt.shifted.assign(ut.re(yt)))}else at.key instanceof _e&&ot.push(at.sa)}for(jt.free(ut),E=rt.length,at=0;at<E;at++)ct=rt[at],z.assign(ct.info.point),ct.Su.shifted===void 0&&(ct.Su.shifted=new jt),ct.node.location=z.add(ct.Su.shifted);for(E=jt.alloc(),at=jt.alloc(),ct=ot.length,mt=0;mt<ct;mt++){var St=ot[mt];if(yt=St.key,yt instanceof _e)if(yt.suspendsRouting){yt.Tg=null,ut=yt.fromNode;var Lt=yt.toNode;if(a.draggedLink!==null&&b.dragsLink)if(Lt=St.value.point,yt.dragComputation===null)y.add(yt,a.Pd(b,yt,tt)),Fd(yt,tt.x-Lt.x,tt.y-Lt.y);else{St=jt.allocAt(0,0),(ut=yt.i(0))&&ut.w()&&St.assign(ut);var Ot=ut=jt.alloc().assign(St).add(tt);b.isGridSnapEnabled&&(b.isGridSnapRealtime||a.lastInput.up)&&(Ot=jt.alloc(),Uf(a,yt,ut,Ot,b)),ut.assign(yt.dragComputation(yt,ut,Ot)).re(St),y.add(yt,a.Pd(b,yt,ut)),Fd(yt,ut.x-Lt.x,ut.y-Lt.y),jt.free(St),jt.free(ut),Ot!==ut&&jt.free(Ot)}else ut!==null&&(E.assign(ut.location),Ot=y.I(ut),Ot!==null&&E.re(Ot.point)),Lt!==null&&(at.assign(Lt.location),Ot=y.I(Lt),Ot!==null&&at.re(Ot.point)),ut!==null&&Lt!==null?E.Xa(at)?(ut=St.value.point,Lt=z,Lt.assign(E),Lt.re(ut),y.add(yt,a.Pd(b,yt,E)),Fd(yt,Lt.x,Lt.y)):(yt.suspendsRouting=!1,yt.bb()):(St=St.value.point,ut=ut!==null?E:Lt!==null?at:tt,y.add(yt,a.Pd(b,yt,ut)),Fd(yt,ut.x-St.x,ut.y-St.y))}else(yt.fromNode===null||yt.toNode===null)&&(ut=St.value.point,y.add(yt,a.Pd(b,yt,tt)),Fd(yt,tt.x-ut.x,tt.y-ut.y))}jt.free(z),jt.free(tt),jt.free(E),jt.free(at),zn(rt),zn(ot),x||(As(a),ih(a,y))}}se.prototype.computeMove=function(a,y,x,b){if(b===void 0&&(b=new jt),b.assign(y),a===null)return b;var E=y,z=x.isGridSnapEnabled;z&&(x.isGridSnapRealtime||this.lastInput.up)&&(E=jt.alloc(),Uf(this,a,y,E,x)),x=a.dragComputation!==null?a.dragComputation(a,y,E):E;var tt=a.minLocation,rt=tt.x;isNaN(rt)&&(rt=z?Math.round(1e3*a.location.x)/1e3:a.location.x),tt=tt.y,isNaN(tt)&&(tt=z?Math.round(1e3*a.location.y)/1e3:a.location.y);var ot=a.maxLocation,at=ot.x;return isNaN(at)&&(at=z?Math.round(1e3*a.location.x)/1e3:a.location.x),ot=ot.y,isNaN(ot)&&(ot=z?Math.round(1e3*a.location.y)/1e3:a.location.y),b.h(Math.max(rt,Math.min(x.x,at)),Math.max(tt,Math.min(x.y,ot))),E!==y&&jt.free(E),b};function Wf(a){var y=a.toolManager.findTool("Dragging");return y!==null?y.dragOptions:a.Wm}function Uf(a,y,x,b,E){if(E===void 0&&(E=Wf(a)),b.assign(x),y!==null){var z=a.grid;y=E.gridSnapCellSize,a=y.width,y=y.height;var tt=E.gridSnapOrigin,rt=tt.x;if(tt=tt.y,E=E.gridSnapCellSpot,z!==null){var ot=z.gridCellSize;isNaN(a)&&(a=ot.width),isNaN(y)&&(y=ot.height),z=z.gridOrigin,isNaN(rt)&&(rt=z.x),isNaN(tt)&&(tt=z.y)}z=jt.allocAt(0,0),z.yi(0,0,a,y,E),ne.No(x.x,x.y,rt+z.x,tt+z.y,a,y,b),jt.free(z)}}function qd(a,y){if(y!==null)for(a.Mr=!0,a=y.iterator;a.next();)y=a.key,y instanceof _e&&(y.suspendsRouting=!0)}function ih(a,y){if(y!==null){for(y=y.iterator;y.next();){var x=y.key;x instanceof _e&&(x.suspendsRouting=!1,Yv(x)&&x.bb())}a.Mr=!1}}function Po(a,y,x){return y=y.containingGroup,y!==null&&(a=Po(a,y,x),a!==null||(a=x.I(y),a!==null))?a:null}xt=se.prototype,xt.Pd=function(a,y,x){if(x===void 0)return new Jh(cs);var b=a.isGridSnapEnabled;return a.groupsSnapMembers||y.containingGroup===null||(b=!1),b?new Jh(new jt(Math.round(1e3*x.x)/1e3,Math.round(1e3*x.y)/1e3)):new Jh(x.copy())};function Qr(a,y,x){if(y.diagram!==null&&y.diagram!==a&&fe("Cannot share a Layer with another Diagram: "+y+" of "+y.diagram),x===null?y.diagram!==null&&fe("Cannot add an existing Layer to this Diagram again: "+y):(x.diagram!==a&&fe("Existing Layer must be in this Diagram: "+x+" not in "+x.diagram),y===x&&fe("Cannot move a Layer before or after itself: "+y)),y.diagram!==a){y=y.name,a=a.Wa,x=a.count;for(var b=0;b<x;b++)a.M(b).name===y&&fe("Cannot add Layer with the name '"+y+"'; a Layer with the same name is already present in this Diagram.")}}xt.Al=function(a){Qr(this,a,null),a.Xe(this);var y=this.Wa,x=y.count-1;if(!a.isTemporary)for(;0<=x&&y.M(x).isTemporary;)x--;return y.Gb(x+1,a),this.cc!==null&&this.cb(ko,"layers",this,null,a,null,x+1),this.N(),this.Ya(),this},xt.Ww=function(a,y){Qr(this,a,y),a.Xe(this);var x=this.Wa,b=x.indexOf(a);0<=b&&(x.remove(a),this.cc!==null&&this.cb(Bo,"layers",this,a,null,b,null));var E=x.count,z;for(z=0;z<E;z++)if(x.M(z)===y){x.Gb(z,a);break}return this.cc!==null&&this.cb(ko,"layers",this,null,a,null,z),this.N(),0>b&&this.Ya(),this},xt.Cy=function(a,y){Qr(this,a,y),a.Xe(this);var x=this.Wa,b=x.indexOf(a);0<=b&&(x.remove(a),this.cc!==null&&this.cb(Bo,"layers",this,a,null,b,null));var E=x.count,z;for(z=0;z<E;z++)if(x.M(z)===y){x.Gb(z+1,a);break}return this.cc!==null&&this.cb(ko,"layers",this,null,a,null,z+1),this.N(),0>b&&this.Ya(),this},xt.kA=function(a){if(a.diagram!==this&&fe("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram),a.name!==""){var y=this.Wa,x=y.indexOf(a);if(y.remove(a)){for(y=a.Pa.copy().iterator;y.next();){var b=y.value,E=b.layerName;E!==a.name?b.layerName=E:b.layerName=""}this.cc!==null&&this.cb(Bo,"layers",this,a,null,x,null),this.N(),this.Ya()}}},xt.Qj=function(a){for(var y=this.layers;y.next();){var x=y.value;if(x.name===a)return x}return null},xt.Yw=function(a){return this.pf===null&&(this.pf=new Ve),this.pf.add(a),this.model.Pe(a),this},xt.mA=function(a){this.pf!==null&&(this.pf.remove(a),this.pf.count===0&&(this.pf=null)),this.model.ik(a)},xt.Pe=function(a){return this.zg===null&&(this.zg=new Ve),this.zg.add(a),this},xt.ik=function(a){this.zg!==null&&(this.zg.remove(a),this.zg.count===0&&(this.zg=null))},xt.ds=function(a){if(this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.Tu(a),a.change!==za&&(this.isModified=!0),this.zg!==null)for(var y=this.zg,x=y.length,b=0;b<x;b++)y.M(b)(a)},xt.cb=function(a,y,x,b,E,z,tt){z===void 0&&(z=null),tt===void 0&&(tt=null);var rt=new Jr;rt.diagram=this,rt.change=a,rt.propertyName=y,rt.object=x,rt.oldValue=b,rt.oldParam=z,rt.newValue=E,rt.newParam=tt,this.ds(rt)},xt.g=function(a,y,x,b,E){this.cb(Ur,a,this,y,x,b,E)},se.prototype.changeState=function(a,y){if(a!==null&&a.diagram===this){var x=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var b=a.change;if(b===Ur){var E=a.object;if(Hr(E,a.propertyName,a.I(y)),E instanceof te){var z=E.part;z!==null&&z.Wb()}this.isModified=!0}else if(b===ko){var tt=a.object,rt=a.newParam,ot=a.newValue;if(tt instanceof Re)if(typeof rt=="number"&&ot instanceof te){y?tt.pc(rt):tt.Gb(rt,ot);var at=tt.part;at!==null&&at.Wb()}else typeof rt=="number"&&ot instanceof Jo&&(ot.isRow?h1(tt,rt,y?void 0:ot):d1(tt,rt,y?void 0:ot));else if(tt instanceof bo){var ut=a.oldParam===!0;typeof rt=="number"&&ot instanceof vn&&(y?(ot.isSelected=!1,ot.isHighlighted=!1,ot.Wb(),tt.pc(ut?rt:-1,ot,ut)):tt.oi(rt,ot,ut))}else tt instanceof se?typeof rt=="number"&&ot instanceof bo&&(y?this.Wa.mb(rt):(ot.Xe(this),this.Wa.Gb(rt,ot))):fe("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(b===Bo){var ct=a.object,mt=a.oldParam,yt=a.oldValue;if(ct instanceof Re)typeof mt=="number"&&yt instanceof te?y?ct.Gb(mt,yt):ct.pc(mt):typeof mt=="number"&&yt instanceof Jo&&(yt.isRow?h1(ct,mt,y?yt:void 0):d1(ct,mt,y?yt:void 0));else if(ct instanceof bo){var St=a.newParam===!0;typeof mt=="number"&&yt instanceof vn&&(y?0>ct.Pa.indexOf(yt)&&ct.oi(mt,yt,St):(yt.isSelected=!1,yt.isHighlighted=!1,yt.Wb(),ct.pc(St?mt:-1,yt,St)))}else ct instanceof se?typeof mt=="number"&&yt instanceof bo&&(y?(yt.Xe(this),this.Wa.Gb(mt,yt)):this.Wa.mb(mt)):fe("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else b!==za&&fe("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=x}}},se.prototype.Ea=function(a){return this.undoManager.Ea(a)},se.prototype.eb=function(a){return this.undoManager.eb(a)},se.prototype.Kf=function(){return this.undoManager.Kf()},se.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var b=!1;try{a(this),b=!0}finally{b?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},se.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)},se.prototype.rp=function(){this.partManager.rp()};function el(a,y,x){var b=a.animationManager;if(a.vb||a.ld)a.Ca=x,il(a),a.N(),a.Ee=!0,b.zb&&(po(b)||b.ce.add(b.H,"scale",y,a.Ca));else if(a.ta===null)a.Ca=x,il(a);else{a.vb=!0;var E=a.viewportBounds.copy(),z=a.Aa,tt=a.ya,rt=a.zoomPoint.x,ot=a.zoomPoint.y,at=a.contentAlignment;isNaN(rt)&&(at.$c()?at.Hf(pd)?rt=0:at.Hf(fl)&&(rt=z-1):rt=at.sb()?at.x*(z-1):z/2),isNaN(ot)&&(at.$c()?at.Hf(zh)?ot=0:at.Hf(Jl)&&(ot=tt-1):ot=at.sb()?at.y*(tt-1):tt/2),a.scaleComputation===null||a.animationManager.defaultAnimation.isAnimating||(x=a.scaleComputation(a,x)),x<a.minScale&&(x=a.minScale),x>a.maxScale&&(x=a.maxScale),z=jt.allocAt(a.pa.x+rt/y-rt/x,a.pa.y+ot/y-ot/x),a.position=z,jt.free(z),a.Ca=x,il(a),a.vb=!1,a.onViewportBoundsChanged(E,a.viewportBounds,y,!1),mo(a,!1),b.zb&&(po(b)||b.ce.add(b.H,"scale",y,a.Ca))}}se.prototype.onViewportBoundsChanged=function(a,y,x,b){if(!a.D(y)){b===void 0&&(b=!1),b||(this.Ee=!0),this.vd=!0;var E=this.layout;E===null||!E.isViewportSized||this.autoScale!==da||a.width===y.width&&a.height===y.height||E.C(),E=this.currentTool,this.Vk===!0&&E instanceof jr&&(this.lastInput.documentPoint=this.Ps(this.lastInput.viewPoint),qc(E,this)),this.vb||this.invalidateViewport(a,y),Bs(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.canvasSize.width=Math.round(a.width*x),this.fc.canvasSize.height=Math.round(a.height*x),this.fc.newCanvasSize.width=this.Aa,this.fc.newCanvasSize.height=this.ya,this.fc.isScroll=b,this.R("ViewportBoundsChanged",this.fc,a),this.isVirtualized&&this.links.each(function(z){z.isAvoiding&&z.actualBounds.Yc(y)&&z.bb()})}};function Bs(a,y){var x=a.fe;if(x!==null&&x.visible){for(var b=Ze.alloc(),E=1,z=1,tt=x.O.s,rt=tt.length,ot=0;ot<rt;ot++){var at=tt[ot],ut=Math.abs(at.interval);2>ut||(pv(at.figure)?z=z*ut/ne.vx(z,ut):E=E*ut/ne.vx(E,ut))}if(tt=x.gridCellSize,b.h(z*tt.width,E*tt.height),y!==void 0)E=y.width,z=y.height,a=y.x,tt=y.y;else{if(y=ye.alloc(),a=a.viewportBounds,y.h(a.x,a.y,a.width,a.height),!y.w()){ye.free(y);return}E=y.width,z=y.height,a=y.x,tt=y.y,ye.free(y)}x.width=E+2*b.width,x.height=z+2*b.height,y=jt.alloc(),ne.No(a,tt,0,0,b.width,b.height,y),y.offset(-b.width,-b.height),Ze.free(b),x.part.location=y,jt.free(y)}}se.prototype.clearSelection=function(a){a===void 0&&(a=!1);var y=this.selection;if(y.count!==0){a||this.R("ChangingSelection",y);for(var x=y.Fa(),b=x.length,E=0;E<b;E++)x[E].isSelected=!1;y.ka(),y.clear(),y.freeze(),a||this.R("ChangedSelection",y)}},se.prototype.select=function(a){a!==null&&a.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.R("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.R("ChangedSelection",this.selection))},se.prototype.rA=function(a){if(this.R("ChangingSelection",this.selection),this.clearSelection(!0),Gn(a))for(var y=a.length,x=0;x<y;x++){var b=a[x];b instanceof vn||fe("Diagram.selectCollection given something that is not a Part: "+b),b.isSelected=!0}else for(a=a.iterator;a.next();)y=a.value,y instanceof vn||fe("Diagram.selectCollection given something that is not a Part: "+y),y.isSelected=!0;this.R("ChangedSelection",this.selection)},se.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var y=a.Fa(),x=y.length,b=0;b<x;b++)y[b].isHighlighted=!1;a.ka(),a.clear(),a.freeze()}},xt=se.prototype,xt.Iz=function(a){a!==null&&a.diagram===this&&(!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)},xt.Jz=function(a){a=new Ye().addAll(a);for(var y=this.highlighteds.copy().hp(a).iterator;y.next();)y.value.isHighlighted=!1;for(a=a.iterator;a.next();)y=a.value,y instanceof vn||fe("Diagram.highlightCollection given something that is not a Part: "+y),y.isHighlighted=!0},xt.scroll=function(a,y,x){x===void 0&&(x=1);var b=y==="up"||y==="down",E=0,z=jt.alloc();if(a==="pixel")E=x;else if(a==="line")E=x*(b?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if(a==="page")a=b?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,a!==0&&(E=x*Math.max(a-(b?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if(a==="document"){E=this.documentBounds,x=this.viewportBounds,y==="up"?this.position=z.h(x.x,E.y):y==="left"?this.position=z.h(E.x,x.y):y==="down"?this.position=z.h(x.x,E.bottom-x.height):y==="right"&&(this.position=z.h(E.right-x.width,x.y)),jt.free(z);return}fe("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}E/=this.scale,x=this.position,y==="up"?this.position=z.h(x.x,x.y-E):y==="down"?this.position=z.h(x.x,x.y+E):y==="left"?this.position=z.h(x.x-E,x.y):y==="right"?this.position=z.h(x.x+E,x.y):fe("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+y),jt.free(z)},xt.tv=function(a){var y=this.viewportBounds;y.Re(a)||(a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a)},xt.es=function(a){var y=this.viewportBounds;a=a.center,a.x-=y.width/2,a.y-=y.height/2,this.position=a},xt.op=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),a.copy().transform(this.Ab)},xt.zA=function(a){var y=this.Ab,x=a.x,b=a.y,E=x+a.width,z=b+a.height,tt=y.m11,rt=y.m12,ot=y.m21,at=y.m22,ut=y.dx,ct=y.dy,mt=x*tt+b*ot+ut;y=x*rt+b*at+ct;var yt=E*tt+b*ot+ut;return a=E*rt+b*at+ct,b=x*tt+z*ot+ut,x=x*rt+z*at+ct,tt=E*tt+z*ot+ut,E=E*rt+z*at+ct,z=Math.min(mt,yt),mt=Math.max(mt,yt),yt=Math.min(y,a),y=Math.max(y,a),z=Math.min(z,b),mt=Math.max(mt,b),yt=Math.min(yt,x),y=Math.max(y,x),z=Math.min(z,tt),mt=Math.max(mt,tt),yt=Math.min(yt,E),y=Math.max(y,E),new ye(z,yt,mt-z,y-yt)},xt.Ps=function(a){var y=this.Ab;y.reset(),this.Ca!==1&&y.scale(this.Ca);var x=this.pa;return(x.x!==0||x.y!==0)&&isFinite(x.x)&&isFinite(x.y)&&y.translate(-x.x,-x.y),Lo(a.copy(),this.Ab)};function na(a){var y=a.isModified;a.Tw!==y&&(a.Tw=y,a.R("Modified"))}function Ca(a){return a=ag.get(a),a!==null?new a:new rr}se.prototype.doModelChanged=function(a){var y=this;if(a.model===this.model){var x=a.change,b=a.propertyName;if(x===za&&b[0]==="S")if(b==="StartingFirstTransaction"){var E=this;a=this.toolManager,a.mouseDownTools.each(function(ot){return ot.diagram=E}),a.mouseMoveTools.each(function(ot){return ot.diagram=E}),a.mouseUpTools.each(function(ot){return ot.diagram=E}),this.ld||this.hf||(this.Jk=!0,this.fn&&(this.kg=!0))}else b==="StartingUndo"||b==="StartingRedo"?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc(),this.R("ChangingSelection",this.selection)):b==="StartedTransaction"&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Cc());else if(this.aa){this.aa=!1;try{if(a.modelChange===""&&x===za){(b==="FinishedUndo"||b==="FinishedRedo")&&(this.R("ChangedSelection",this.selection),As(this));var z=this.animationManager;b==="RolledBackTransaction"&&z.Cc(),this.bx(),this.Jk=!0,this.bd(),this.undoManager.transactionLevel!==0&&this.undoManager.transactionLevel!==1||ao(z),b==="CommittedTransaction"&&this.undoManager.isJustDiscarded&&(this.Ce=Math.min(this.Ce,this.undoManager.historyIndex-1)),b!=="CommittedTransaction"&&b!=="RolledBackTransaction"||!this.undoManager.isPendingUnmodified||setTimeout(function(){y.isModified=!1},1);var tt=a.isTransactionFinished;if(tt&&(na(this),this.As.clear(),Vs(this.animationManager)),!this.Rt&&tt&&this.lastInput.targetDiagram){this.Rt=!0;var rt=this;Oi(function(){rt.currentTool.standardMouseOver(),rt.Rt=!1},10)}}}finally{this.aa=!0}}}};function El(a,y){y=y.O.s;for(var x=y.length,b=0;b<x;b++)nl(a,y[b])}function nl(a,y){if(y instanceof Ka){var x=y.element;if(x!==null&&x instanceof HTMLImageElement){x.Bg instanceof Ye&&x.Bg.add(a);var b=y.Eg;if(b!==null&&b.sq===!0&&y.diagram!==null&&y.diagram.Xn.add(y),x.hn)if(x=x.getAttribute("src")||"",b=a.Og.I(x),b===null)b=[],b.push(y),a.Og.add(x,b);else{for(a=0;a<b.length;a++)if(b[a]===y)return;b.push(y)}}}}function rh(a,y){if(y instanceof Ka){var x=y.element;if(x!==null&&x instanceof HTMLImageElement&&x.hn){var b=x.getAttribute("src")||"",E=a.Og.I(b);if(E!==null){for(var z=0;z<E.length;z++)if(E[z]===y){E.splice(z,1),E.length===0&&(a.Og.remove(b),x.Fq&&x.removeEventListener("load",x.Fq),x.Yp&&x.removeEventListener("error",x.Yp),delete x.Fq,delete x.Yp,x.Bg instanceof Ye&&x.Bg.remove(a),xg(b));break}}}}}se.prototype.Wd=function(){this.partManager.Wd()},se.prototype.Aj=function(a,y){this.Yd.Aj(a,y)},se.prototype.Cj=function(a,y){this.Yd.Cj(a,y)},se.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)},se.prototype.Vb=function(a){return this.partManager.Vb(a)},se.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)},xt=se.prototype,xt.Lc=function(a){return this.partManager.Lc(a)},xt.ii=function(a){return this.partManager.ii(a)},xt.Kc=function(a){return this.partManager.Kc(a)},xt.ms=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ms.apply(this.partManager,y instanceof Array?y:bi(mn(y)))},xt.ls=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];return this.partManager.ls.apply(this.partManager,y instanceof Array?y:bi(mn(y)))};function il(a){var y=a.pa,x=a.Ca;a.Rw.h(y.x,y.y,Math.max(a.Aa,0)/x,Math.max(a.ya,0)/x),a.vd=!0}function oh(a,y){a.Zi=!1;var x=a.Sp;x.D(y)||(x=x.copy(),a.Sp.assign(y),mo(a,!1),a.R("DocumentBoundsChanged",void 0,x),a.Ee=!0,a.N())}xt.Va=function(){if(this.Zi){var a=ye.alloc();oh(this,this.computeBounds(a)),ye.free(a)}},xt.rz=function(){for(var a=new Ye,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&a.add(x)}for(y=this.links;y.next();)x=y.value,x.isTopLevel&&a.add(x);return a.iterator},xt.qz=function(){return this.ai.iterator},xt.Uz=function(a){As(this),a&&Zh(this,!0),this.ld?qg(this,!1):(this.Jk=!0,gl(this))};function Zh(a,y){for(var x=a.ai.iterator;x.next();)tf(a,x.value,y);a.layout&&(y?a.layout.isValidLayout=!1:a.layout.C())}function tf(a,y,x){if(y!==null){for(var b=y.gl.iterator;b.next();)tf(a,b.value,x);y.layout!==null&&(x?y.layout.isValidLayout=!1:y.layout.C())}}function qg(a,y){if(a.xh&&!a.lt){var x=a.aa;a.aa=!0;var b=a.undoManager.transactionLevel,E=a.layout,z=a.animationManager;try{b===0&&(a.undoManager.isInternalTransaction=!0,a.Ea("Layout")),1>=b&&!z.defaultAnimation.isAnimating&&!z.zb&&(y||io(z,"Layout")),a.xh=!1;for(var tt=a.ai.iterator;tt.next();)tp(a,tt.value,y,b);E.isValidLayout||(!y||E.isRealtime||E.isRealtime===null||b===0?(E.doLayout(a),As(a),E.isValidLayout=!0):a.xh=!0)}finally{y=a.undoManager.isInternalTransaction,b===0&&(a.eb("Layout"),a.undoManager.isInternalTransaction=!1),!y||b!==0&&b!==1||ao(z),a.aa=x}}}function tp(a,y,x,b){if(y!==null){for(var E=y.gl.iterator;E.next();)tp(a,E.value,x,b);E=y.layout,E===null||E.isValidLayout||(!x||E.isRealtime||b===0?(y.rh=!y.location.w(),E.doLayout(y),y.C(32),$d(a,y),E.isValidLayout=!0):a.xh=!0)}}xt.yz=function(){for(var a=new Ve,y=this.nodes;y.next();){var x=y.value;x.isTopLevel&&x.kh()===null&&a.add(x)}return a.iterator};function ev(a){function y(E){var z=E.toLowerCase(),tt=new Ve;x.add(E,tt),x.add(z,tt),b.add(E,E),b.add(z,E)}var x=new xn,b=new xn;y("InitialAnimationStarting"),y("AnimationStarting"),y("AnimationFinished"),y("BackgroundSingleClicked"),y("BackgroundDoubleClicked"),y("BackgroundContextClicked"),y("ClipboardChanged"),y("ClipboardPasted"),y("DocumentBoundsChanged"),y("ExternalObjectsDropped"),y("GainedFocus"),y("InitialLayoutCompleted"),y("LayoutCompleted"),y("LinkDrawn"),y("LinkRelinked"),y("LinkReshaped"),y("LostFocus"),y("Modified"),y("ObjectSingleClicked"),y("ObjectDoubleClicked"),y("ObjectContextClicked"),y("PartCreated"),y("PartResized"),y("PartRotated"),y("SelectionMoved"),y("SelectionCopied"),y("SelectionDeleting"),y("SelectionDeleted"),y("SelectionGrouped"),y("SelectionUngrouped"),y("ChangingSelection"),y("ChangedSelection"),y("SubGraphCollapsed"),y("SubGraphExpanded"),y("TextEdited"),y("TreeCollapsed"),y("TreeExpanded"),y("ViewportBoundsChanged"),y("InvalidateDraw"),a.iw=x,a.hw=b}function sm(a,y){var x=a.hw.I(y);return x!==null?x:a.hw.I(y.toLowerCase())}function ig(a,y){var x=a.iw.I(y);if(x!==null||(x=a.iw.I(y.toLowerCase()),x!==null))return x;fe("Unknown DiagramEvent name: "+y)}xt.Bj=function(a,y){return a=ig(this,a),a!==null&&a.add(y),this},xt.am=function(a,y){a=ig(this,a),a!==null&&a.remove(y)},xt.R=function(a,y,x){var b=ig(this,a),E=new mh;if(E.diagram=this,a=sm(this,a),a!==null&&(E.name=a),y!==void 0&&(E.subject=y),x!==void 0&&(E.parameter=x),y=b.length,y===1)b.M(0)(E);else if(y!==0)for(b=b.Fa(),x=0;x<y;x++)(0,b[x])(E)};function rg(a){if(a.animationManager.isTicking)return!1;var y=a.currentTool;return y===a.toolManager.findTool("Dragging")?!a.Mr||y.isComplexRoutingRealtime:!0}xt.Yj=function(a,y){return og(this,!1,null,y||null).Yj(a.x,a.y,a.width,a.height)},se.prototype.computeOccupiedArea=function(a){return this.isVirtualized?this.viewportBounds.copy():this.Zi?Ro(this,a):a.assign(this.documentBounds)};function og(a,y,x,b){var E=a.Xh;if(E===null&&(a.Xh=E=new Fp(a.avoidanceCellSize)),E.vs||E.group!==x||E.Yx!==b){if(E.Hx=Math.max(E.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.width)),E.Ix=Math.max(E.Os+1,Math.floor(a.avoidanceLimit/a.avoidanceCellSize.height)),x!==null&&(x=am(a,x)),x===null){y=ye.alloc(),a.computeOccupiedArea(y),y.Bc(100,100),E.initialize(y);for(var z=a.nodes;z.next();){var tt=z.value,rt=tt.layer;rt!==null&&rt.visible&&!rt.isTemporary&&sg(a,tt,b,y)}ye.free(y)}else{for(0<x.memberParts.count&&(y=a.computePartsBounds(x.memberParts,!1),y.Bc(20,20),E.initialize(y)),y=ye.alloc(),z=x.memberParts;z.next();)tt=z.value,tt instanceof $e&&sg(a,tt,b,y);ye.free(y)}E.group=x,E.Yx=b,E.vs=!1}else y&&rS(E);return E}function am(a,y){return y.avoidable&&!y.isLinkLabel?y:y.containingGroup!==null?am(a,y.containingGroup):null}function sg(a,y,x,b){if(y!==x&&y.isVisible()){if(y.avoidable&&!y.isLinkLabel){y=y.getAvoidableRect(b),a=a.Xh;var E=y.x,z=y.y;if(kg(a,E,z))for(x=(z-a.Od)/a.sc|0,b=Math.min((E+y.width-a.Nd)/a.rc|0,a.di),y=Math.min((z+y.height-a.Od)/a.sc|0,a.ei),E=(E-a.Nd)/a.rc|0;E<=b;E++)if(z=a.ac[E],z.fill)z.fill(Nd,x,y+1);else for(var tt=x;tt<=y;tt++)z[tt]=Nd}else if(y instanceof Yn)for(y=y.memberParts;y.next();)E=y.value,E instanceof $e&&sg(a,E,x,b)}}function xd(a,y){a.Xh===null||a.Xh.vs||y!==void 0&&(!y.avoidable||y.isLinkLabel)||(a.Xh.vs=!0)}se.prototype.gs=function(a){this.wp.assign(a),this.computeAutoScrollPosition(this.wp).Xa(this.position)?this.ug():ep(this)};function ep(a){a.vk===-1&&(a.vk=Oi(function(){if(a.vk!==-1&&(a.ug(),a.lastInput.event!==null)){var y=a.computeAutoScrollPosition(a.wp);y.Xa(a.position)||(a.position=y,a.lastInput.documentPoint=a.Ps(a.wp),a.doMouseMove(),a.Zi=!0,y=ye.alloc(),a.computeBounds(y),y.ed(a.documentBounds),oh(a,y),ye.free(y),a.Fc=!0,a.bd(),ep(a))}},a.vp))}se.prototype.ug=function(){this.vk!==-1&&(xe.clearTimeout(this.vk),this.vk=-1)},se.prototype.computeAutoScrollPosition=function(a){var y=this.position,x=this.xp;if(0>=x.top&&0>=x.left&&0>=x.right&&0>=x.bottom)return y;var b=this.viewportBounds,E=this.scale;b=ye.allocAt(0,0,b.width*E,b.height*E);var z=jt.allocAt(0,0);if(a.x>=b.x&&a.x<b.x+x.left&&this.allowHorizontalScroll){var tt=Math.max(this.scrollHorizontalLineChange,1);tt|=0,z.x-=tt,a.x<b.x+x.left/2&&(z.x-=tt),a.x<b.x+x.left/4&&(z.x-=4*tt)}else a.x<=b.x+b.width&&a.x>b.x+b.width-x.right&&this.allowHorizontalScroll&&(tt=Math.max(this.scrollHorizontalLineChange,1),tt|=0,z.x+=tt,a.x>b.x+b.width-x.right/2&&(z.x+=tt),a.x>b.x+b.width-x.right/4&&(z.x+=4*tt));return a.y>=b.y&&a.y<b.y+x.top&&this.allowVerticalScroll?(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y-=tt,a.y<b.y+x.top/2&&(z.y-=tt),a.y<b.y+x.top/4&&(z.y-=4*tt)):a.y<=b.y+b.height&&a.y>b.y+b.height-x.bottom&&this.allowVerticalScroll&&(tt=Math.max(this.scrollVerticalLineChange,1),tt|=0,z.y+=tt,a.y>b.y+b.height-x.bottom/2&&(z.y+=tt),a.y>b.y+b.height-x.bottom/4&&(z.y+=4*tt)),z.Xa(cs)||(y=new jt(y.x+z.x/E,y.y+z.y/E)),ye.free(b),jt.free(z),y},xt=se.prototype,xt.Cs=function(){return null},xt.av=function(){return null},xt.bs=function(a,y){this.pj.add(a,y)},xt.Fu=function(a){(this.Pw=a)||this.nodes.each(function(y){y instanceof Yn&&(y.$p=null)})};function Cc(a,y,x){function b(){var ut=+new Date;for(z=!0,tt.reset();tt.next();)if(!tt.value[0].al){z=!1;break}z||ut-at>ot?y(x,E,rt):xe.requestAnimationFrame(b)}for(var E=x.callback,z=!0,tt=a.Og.iterator;tt.next();)if(!tt.value[0].al){z=!1;break}if(typeof E!="function"||z)return y(x,E,a);var rt=a,ot=x.callbackTimeout||300,at=+new Date;return xe.requestAnimationFrame(function(){b()}),null}xt.Wz=function(a){return So?(a===void 0&&(a={}),a.returnType="Image",this.Jx(a)):null},xt.Jx=function(a){return a===void 0&&(a={}),Cc(this,this.Xz,a)},xt.Xz=function(a,y,x){var b=lm(x,a,"canvas",null);if(b===null)return null;x=b.Z.canvas;var E=null;if(x!==null)switch(E=a.returnType,E===void 0?E="string":E=E.toLowerCase(),E){case Xf+"data":E=b.getImageData(0,0,x.width,x.height);break;case Xf:b=(a.document||document).createElement("img"),b.src=x.toDataURL(a.type,a.details),E=b;break;case"blob":return typeof y!="function"&&fe('Error: Diagram.makeImageData called with "returnType: toBlob", but no required "callback" function property defined.'),typeof x.toBlob=="function"?(x.toBlob(y,a.type,a.details),"toBlob"):(y(null),null);default:E=x.toDataURL(a.type,a.details)}return typeof y=="function"?(y(E),null):E};function lm(a,y,x,b){if(a.animationManager.Cc(),a.bd(),a.ta===null)return null;typeof y!="object"&&fe("properties argument must be an Object.");var E=y.size||null,z=y.scale||null;y.scale!==void 0&&isNaN(y.scale)&&(z="NaN");var tt=y.maxSize;y.maxSize===void 0&&(tt=x==="SVG"?new Ze(1/0,1/0):new Ze(2e3,2e3));var rt=y.position||null,ot=y.parts||null,at=y.padding===void 0?1:y.padding,ut=y.background||null,ct=y.omitTemporary;ct===void 0&&(ct=!0);var mt=y.document||document,yt=y.elementFinished||null,St=y.showTemporary;St===void 0&&(St=!ct),y=y.showGrid,y===void 0&&(y=St),E!==null&&isNaN(E.width)&&isNaN(E.height)&&(E=null),typeof at=="number"?at=new ni(at):at instanceof ni||fe("MakeImage padding must be a Margin or a number."),at.left=Math.max(at.left,0),at.right=Math.max(at.right,0),at.top=Math.max(at.top,0),at.bottom=Math.max(at.bottom,0),a.ib.Vc(!0),ct=new iu(null,mt,void 0,!0);var Lt=ct.context;if(!(E||z||ot||rt))return ct.width=a.Aa+Math.ceil(at.left+at.right),ct.height=a.ya+Math.ceil(at.top+at.bottom),x==="SVG"?b===null?null:(b.resize(ct.width,ct.height,ct.width,ct.height),b.ownerDocument=mt,b.hs=yt,_f(a,b.context,at,new Ze(ct.width,ct.height),a.Ca,a.pa,ot,ut,St,y),b.context):(a.Xm=!1,_f(a,Lt,at,new Ze(ct.width,ct.height),a.Ca,a.pa,ot,ut,St,y),a.Xm=!0,ct.context);var Ot=a.Pp,Dt=a.documentBounds.copy();if(Dt.Fv(a.yb),St)for(var Gt=a.Wa.s,Vt=Gt.length,Yt=0;Yt<Vt;Yt++){var qt=Gt[Yt];if(qt.visible&&qt.isTemporary){qt=qt.Pa.s;for(var ae=qt.length,Je=0;Je<ae;Je++){var un=qt[Je];un.isInDocumentBounds&&un.isVisible()&&(un=un.actualBounds,un.w()&&Dt.ed(un))}}}if(Gt=new jt(Dt.x,Dt.y),ot!==null){for(Vt=new ye(0,0,0,0),Yt=!0,qt=ot.iterator,qt.reset();qt.next();)ae=qt.value,ae instanceof vn&&(Je=ae.layer,Je!==null&&!Je.visible||Je!==null&&!St&&Je.isTemporary||!ae.isVisible()||(ae=ae.actualBounds,ae.w()&&(Yt?(Yt=!1,Vt.assign(ae)):Vt.ed(ae))));Dt.width=Vt.width,Dt.height=Vt.height,Gt.x=Vt.x,Gt.y=Vt.y}return rt!==null&&rt.w()&&(Gt=rt,z||(z=Ot)),Vt=rt=0,at!==null&&(rt=at.left+at.right,Vt=at.top+at.bottom),Yt=qt=0,E!==null&&(qt=E.width,Yt=E.height,isFinite(qt)&&(qt=Math.max(0,qt-rt)),isFinite(Yt)&&(Yt=Math.max(0,Yt-Vt))),E!==null&&z!==null?(z==="NaN"&&(z=Ot),E.w()?(E=qt,Dt=Yt):isNaN(Yt)?(E=qt,Dt=Dt.height*z):(E=Dt.width*z,Dt=Yt)):E!==null?E.w()?(z=Math.min(qt/Dt.width,Yt/Dt.height),E=qt,Dt=Yt):isNaN(Yt)?(z=qt/Dt.width,E=qt,Dt=Dt.height*z):(z=Yt/Dt.height,E=Dt.width*z,Dt=Yt):z!==null?z==="NaN"&&tt.w()?(z=Math.min((tt.width-rt)/Dt.width,(tt.height-Vt)/Dt.height),z>Ot?(z=Ot,E=Dt.width,Dt=Dt.height):(E=tt.width,Dt=tt.height)):(E=Dt.width*z,Dt=Dt.height*z):(z=Ot,E=Dt.width,Dt=Dt.height),at!==null?(E+=rt,Dt+=Vt):at=new ni(0),tt!==null&&(Ot=tt.width,tt=tt.height,isNaN(Ot)&&(Ot=2e3),isNaN(tt)&&(tt=2e3),isFinite(Ot)&&(E=Math.min(E,Ot)),isFinite(tt)&&(Dt=Math.min(Dt,tt))),ct.width=Math.ceil(E),ct.height=Math.ceil(Dt),x==="SVG"?b===null?null:(b.resize(ct.width,ct.height,ct.width,ct.height),b.ownerDocument=mt,b.hs=yt,_f(a,b.context,at,new Ze(Math.ceil(E),Math.ceil(Dt)),z,Gt,ot,ut,St,y),b.context):(a.Xm=!1,_f(a,Lt,at,new Ze(Math.ceil(E),Math.ceil(Dt)),z,Gt,ot,ut,St,y),a.Xm=!0,ct.context)}Oe.Object.defineProperties(se.prototype,{renderer:{get:function(){return this.nl},set:function(a){this instanceof gt||(a===""&&(a="default"),a=a.toLowerCase(),a!==this.nl&&(this.nl=a,a==="default"||a==="canvas"?(a=this.pj.get("svg"),a!==null&&a.Oa.remove(),this.ta&&(this.ib=this.ta.context)):a==="svg"?(this.pj.contains("svg")?a=this.pj.get("svg"):(a=new sh(this,xe.document),this.bs("svg",a)),this.div!==null&&this.div.appendChild(a.Oa),this.ib=a.context,this.ta&&(this.ta.context.setTransform(this.Mb,0,0,this.Mb,0,0),this.ta.context.clearRect(0,0,this.Aa,this.ya))):a!=="debug"||this.pj.contains("SVG")||(a=new sh(this,xe.document),this.bs("SVG",a),a.Oa.style.backgroundColor="whitesmoke",this.div!==null&&this.div.after(a.Oa)),this.hk()))}},div:{get:function(){return this.Ka},set:function(a){if(this.Ka!==a){var y=this.Ka;y!==null?(y.H=void 0,y.goDiagram=void 0,y.go=void 0,y.innerHTML="",this.ta!==null&&(y=this.ta.Oa,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.ta.mx()),this.ol&&(this.ol.disconnect(),this.ol=null),y=this.toolManager,y!==null&&(y.mouseDownTools.each(function(x){x.cancelWaitAfter()}),y.mouseMoveTools.each(function(x){x.cancelWaitAfter()}),y.mouseUpTools.each(function(x){x.cancelWaitAfter()})),y.cancelWaitAfter(),this.currentTool.doCancel(),this.ta=null,this.removeEventListener(xe,"resize",this.Ov,!1),this.removeEventListener(xe,"wheel",this.$j,!0),wa===this&&(wa=null)):this.ui===null&&(this.hf=!1),this.Ka=null,a!==null&&((y=a.H)&&(y.div=null),$i(this,a),this.hk())}}},$w:{get:function(){return this.Sq}},pi:{get:function(){return this.hf}},draggedLink:{get:function(){return this.nt},set:function(a){this.nt!==a&&(this.nt=a,a!==null&&(this.Vt=a.fromPort,this.Wt=a.toPort))}},Mx:{get:function(){return this.Vt},set:function(a){this.Vt=a}},Nx:{get:function(){return this.Wt},set:function(a){this.Wt=a}},animationManager:{get:function(){return this.Yd}},undoManager:{get:function(){return this.cc.undoManager}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a,this.cc.skipsUndoManager=a}},delaysLayout:{get:function(){return this.lt},set:function(a){this.lt=a}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&ri(a,"0 <= value <= 1",se,"opacity"),this.pb=a,this.g("opacity",y,a),this.N())}},validCycle:{get:function(){return this.wu},set:function(a){var y=this.wu;y!==a&&(this.wu=a,this.g("validCycle",y,a))}},layers:{get:function(){return this.Wa.iterator}},isModelReadOnly:{get:function(){var a=this.cc;return a===null?!1:a.isReadOnly},set:function(a){var y=this.cc;y!==null&&(y.isReadOnly=a)}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},isEnabled:{get:function(){return this.Jd},set:function(a){var y=this.Jd;y!==a&&(this.Jd=a,this.g("isEnabled",y,a))}},allowClipboard:{get:function(){return this.Us},set:function(a){var y=this.Us;y!==a&&(this.Us=a,this.g("allowClipboard",y,a))}},allowCopy:{get:function(){return this.Fi},set:function(a){var y=this.Fi;y!==a&&(this.Fi=a,this.g("allowCopy",y,a))}},allowDelete:{get:function(){return this.Gi},set:function(a){var y=this.Gi;y!==a&&(this.Gi=a,this.g("allowDelete",y,a))}},allowDragOut:{get:function(){return this.Vs},set:function(a){var y=this.Vs;y!==a&&(this.Vs=a,this.g("allowDragOut",y,a))}},allowDrop:{get:function(){return this.Ws},set:function(a){var y=this.Ws;y!==a&&(this.Ws=a,this.g("allowDrop",y,a))}},allowTextEdit:{get:function(){return this.Pi},set:function(a){var y=this.Pi;y!==a&&(this.Pi=a,this.g("allowTextEdit",y,a))}},allowGroup:{get:function(){return this.Hi},set:function(a){var y=this.Hi;y!==a&&(this.Hi=a,this.g("allowGroup",y,a))}},allowUngroup:{get:function(){return this.Qi},set:function(a){var y=this.Qi;y!==a&&(this.Qi=a,this.g("allowUngroup",y,a))}},allowInsert:{get:function(){return this.Ys},set:function(a){var y=this.Ys;y!==a&&(this.Ys=a,this.g("allowInsert",y,a))}},allowLink:{get:function(){return this.Ii},set:function(a){var y=this.Ii;y!==a&&(this.Ii=a,this.g("allowLink",y,a))}},allowRelink:{get:function(){return this.Ki},set:function(a){var y=this.Ki;y!==a&&(this.Ki=a,this.g("allowRelink",y,a))}},allowMove:{get:function(){return this.Ji},set:function(a){var y=this.Ji;y!==a&&(this.Ji=a,this.g("allowMove",y,a))}},allowReshape:{get:function(){return this.Li},set:function(a){var y=this.Li;y!==a&&(this.Li=a,this.g("allowReshape",y,a))}},allowResize:{get:function(){return this.Mi},set:function(a){var y=this.Mi;y!==a&&(this.Mi=a,this.g("allowResize",y,a))}},allowRotate:{get:function(){return this.Ni},set:function(a){var y=this.Ni;y!==a&&(this.Ni=a,this.g("allowRotate",y,a))}},allowSelect:{get:function(){return this.Oi},set:function(a){var y=this.Oi;y!==a&&(this.Oi=a,this.g("allowSelect",y,a))}},allowUndo:{get:function(){return this.Zs},set:function(a){var y=this.Zs;y!==a&&(this.Zs=a,this.g("allowUndo",y,a))}},allowZoom:{get:function(){return this.at},set:function(a){var y=this.at;y!==a&&(this.at=a,this.g("allowZoom",y,a))}},hasVerticalScrollbar:{get:function(){return this.nn},set:function(a){var y=this.nn;y!==a&&(this.nn=a,this.Ee=!0,this.N(),this.g("hasVerticalScrollbar",y,a),mo(this,!1))}},hasHorizontalScrollbar:{get:function(){return this.mn},set:function(a){var y=this.mn;y!==a&&(this.mn=a,this.Ee=!0,this.N(),this.g("hasHorizontalScrollbar",y,a),mo(this,!1))}},allowHorizontalScroll:{get:function(){return this.Xs},set:function(a){var y=this.Xs;y!==a&&(this.Xs=a,this.g("allowHorizontalScroll",y,a),mo(this,!1))}},allowVerticalScroll:{get:function(){return this.$s},set:function(a){var y=this.$s;y!==a&&(this.$s=a,this.g("allowVerticalScroll",y,a),mo(this,!1))}},scrollHorizontalLineChange:{get:function(){return this.iu},set:function(a){var y=this.iu;y!==a&&(0>a&&ri(a,">= 0",se,"scrollHorizontalLineChange"),this.iu=a,this.g("scrollHorizontalLineChange",y,a))}},scrollVerticalLineChange:{get:function(){return this.mu},set:function(a){var y=this.mu;y!==a&&(0>a&&ri(a,">= 0",se,"scrollVerticalLineChange"),this.mu=a,this.g("scrollVerticalLineChange",y,a))}},lastInput:{get:function(){return this.cj},set:function(a){this.cj=a}},previousInput:{get:function(){return this.Qg},set:function(a){this.Qg=a}},firstInput:{get:function(){return this.bq},set:function(a){this.bq=a}},currentCursor:{get:function(){return this.it},set:function(a){if(a===""&&(a=this.Op),this.it!==a){var y=this.ta,x=this.Ka;if(y!==null&&x!==null){this.it=a;var b=y.style.cursor;y.style.cursor=a,x.style.cursor=a,y.style.cursor===b&&(y.style.cursor="-webkit-"+a,x.style.cursor="-webkit-"+a,y.style.cursor===b&&(y.style.cursor="-moz-"+a,x.style.cursor="-moz-"+a,y.style.cursor===b&&(y.style.cursor=a,x.style.cursor=a)))}}}},defaultCursor:{get:function(){return this.Op},set:function(a){a===""&&(a="auto");var y=this.Op;y!==a&&(this.Op=a,this.g("defaultCursor",y,a))}},click:{get:function(){return this.zh},set:function(a){var y=this.zh;y!==a&&(this.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.Fh},set:function(a){var y=this.Fh;y!==a&&(this.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.Bh},set:function(a){var y=this.Bh;y!==a&&(this.Bh=a,this.g("contextClick",y,a))}},mouseOver:{get:function(){return this.Qh},set:function(a){var y=this.Qh;y!==a&&(this.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.Oh},set:function(a){var y=this.Oh;y!==a&&(this.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.Nh},set:function(a){var y=this.Nh;y!==a&&(this.Nh=a,this.g("mouseHold",y,a))}},mouseDragOver:{get:function(){return this.Qt},set:function(a){var y=this.Qt;y!==a&&(this.Qt=a,this.g("mouseDragOver",y,a))}},mouseDrop:{get:function(){return this.Lh},set:function(a){var y=this.Lh;y!==a&&(this.Lh=a,this.g("mouseDrop",y,a))}},handlesDragDropForTopLevelParts:{get:function(){return this.xt},set:function(a){var y=this.xt;y!==a&&(this.xt=a,this.g("handlesDragDropForTopLevelParts",y,a))}},mouseEnter:{get:function(){return this.Mh},set:function(a){var y=this.Mh;y!==a&&(this.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.Ph},set:function(a){var y=this.Ph;y!==a&&(this.Ph=a,this.g("mouseLeave",y,a))}},toolTip:{get:function(){return this.$h},set:function(a){var y=this.$h;y!==a&&(this.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.Ch},set:function(a){var y=this.Ch;y!==a&&(this.Ch=a,this.g("contextMenu",y,a))}},commandHandler:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a,a.Xe(this))}},toolManager:{get:function(){return this.te},set:function(a){this.te!==a&&(this.te=a,a.diagram=this)}},defaultTool:{get:function(){return this.ob},set:function(a){var y=this.ob;y!==a&&(this.ob=a,a.diagram=this,this.currentTool===y&&(this.currentTool=a))}},currentTool:{get:function(){return this.hb},set:function(a){var y=this.hb;y&&(y.isActive&&y.doDeactivate(),y.cancelWaitAfter(),y.doStop()),a===null&&(a=this.defaultTool),a!==null&&(this.hb=a,a.diagram=this,a.doStart())}},selection:{get:function(){return this.Hw}},maxSelectionCount:{get:function(){return this.Nt},set:function(a){var y=this.Nt;if(y!==a)if(0<=a&&!isNaN(a)){if(this.Nt=a,this.g("maxSelectionCount",y,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.R("ChangingSelection",this.selection),y=this.selection.Fa();for(var x=0;x<a;x++)y[x].isSelected=!1;this.R("ChangedSelection",this.selection)}}else ri(a,">= 0",se,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{get:function(){return this.St},set:function(a){var y=this.St;y!==a&&(this.St=a,this.g("nodeSelectionAdornmentTemplate",y,a))}},groupSelectionAdornmentTemplate:{get:function(){return this.wt},set:function(a){var y=this.wt;y!==a&&(this.wt=a,this.g("groupSelectionAdornmentTemplate",y,a))}},linkSelectionAdornmentTemplate:{get:function(){return this.Kt},set:function(a){var y=this.Kt;y!==a&&(this.Kt=a,this.g("linkSelectionAdornmentTemplate",y,a))}},highlighteds:{get:function(){return this.nw}},isModified:{get:function(){var a=this.undoManager;return a.isEnabled?a.currentTransaction!==null?!0:this.rn&&this.Ce!==a.historyIndex:this.rn},set:function(a){if(this.rn!==a){this.rn=a;var y=this.undoManager;!a&&y.isEnabled&&(this.Ce=y.historyIndex),a||na(this)}}},model:{get:function(){return this.cc},set:function(a){var y=this.cc;if(y!==a){this.currentTool.doCancel(),y&&y.undoManager!==a.undoManager&&y.undoManager.isInTransaction&&fe("Do not replace a Diagram.model while a transaction is in progress."),this.animationManager.Cc(!0);var x=ql(this,!0);this.hf=!1,this.fn=!0,this.Ce=-2,this.kg=!1;var b=this.vb;this.vb=!0,io(this.animationManager,"Model"),y&&(this.pf!==null&&this.pf.each(function(z){return y.ik(z)}),y.ik(this.Oc)),this.cc=a,this.partManager=Ca(this.cc.type);for(var E=0;E<x.length;E++)this.add(x[E]);a.Pe(this.Hb),this.partManager.addAllModeledParts(),a.ik(this.Hb),a.Pe(this.Oc),this.pf!==null&&this.pf.each(function(z){return a.Pe(z)}),this.vb=b,this.Ya(),this.vb||this.N(),y&&a.undoManager.copyProperties(y.undoManager)}}},aa:{get:function(){return this.rw},set:function(a){this.rw=a}},As:{get:function(){return this.sy}},skipsModelSourceBindings:{get:function(){return this.Iw},set:function(a){this.Iw=a}},Ns:{get:function(){return this.ou},set:function(a){this.ou=a}},nodeTemplate:{get:function(){return this.Lg.I("")},set:function(a){var y=this.Lg.I("");y!==a&&(this.Lg.add("",a),this.g("nodeTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},nodeTemplateMap:{get:function(){return this.Lg},set:function(a){var y=this.Lg;y!==a&&(this.Lg=a,this.g("nodeTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplate:{get:function(){return this.Yi.I("")},set:function(a){var y=this.Yi.I("");y!==a&&(this.Yi.add("",a),this.g("groupTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},groupTemplateMap:{get:function(){return this.Yi},set:function(a){var y=this.Yi;y!==a&&(this.Yi=a,this.g("groupTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplate:{get:function(){return this.Kh.I("")},set:function(a){var y=this.Kh.I("");y!==a&&(this.Kh.add("",a),this.g("linkTemplate",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},linkTemplateMap:{get:function(){return this.Kh},set:function(a){var y=this.Kh;y!==a&&(this.Kh=a,this.g("linkTemplateMap",y,a),this.undoManager.isUndoingRedoing||this.Wd())}},isMouseCaptured:{get:function(){return this.qw},set:function(a){var y=this.ta;y!==null&&(y=y.Oa,y instanceof SVGElement||(a?(this.lastInput.bubbles=!1,this.removeEventListener(y,"pointermove",this.dk,!1),this.removeEventListener(y,"pointerdown",this.ui,!1),this.removeEventListener(y,"pointerup",this.fk,!1),this.removeEventListener(y,"pointerout",this.ek,!1),this.removeEventListener(y,"pointercancel",this.ck,!1),this.addEventListener(xe,"pointermove",this.dk,!0),this.addEventListener(xe,"pointerdown",this.ui,!0),this.addEventListener(xe,"pointerup",this.fk,!0),this.addEventListener(xe,"pointerout",this.ek,!0),this.addEventListener(xe,"pointercancel",this.ck,!0),this.removeEventListener(y,"wheel",this.$j,!1),this.addEventListener(xe,"wheel",this.$j,!0),this.addEventListener(xe,"selectstart",this.preventDefault,!1)):(this.removeEventListener(xe,"pointermove",this.dk,!0),this.removeEventListener(xe,"pointerdown",this.ui,!0),this.removeEventListener(xe,"pointerup",this.fk,!0),this.removeEventListener(xe,"pointerout",this.ek,!0),this.removeEventListener(xe,"pointercancel",this.ck,!0),this.addEventListener(y,"pointermove",this.dk,!1),this.addEventListener(y,"pointerdown",this.ui,!1),this.addEventListener(y,"pointerup",this.fk,!1),this.addEventListener(y,"pointerout",this.ek,!1),this.addEventListener(y,"pointercancel",this.ck,!1),this.removeEventListener(xe,"wheel",this.$j,!0),this.removeEventListener(xe,"selectstart",this.preventDefault,!1),this.addEventListener(y,"wheel",this.$j,!1)),this.qw=a))}},position:{get:function(){return this.pa},set:function(a){var y=jt.alloc().assign(this.pa);if(!y.D(a)){var x=this.viewportBounds.copy();this.pa.assign(a),Hi(this.animationManager,y,this.pa),this.vb||this.ta===null&&!this.wo.w()?il(this):(this.vb=!0,a=this.scale,tu(this,this.Sp,this.Aa/a,this.ya/a,this.zk,!1),this.vb=!1),this.vb||this.onViewportBoundsChanged(x,this.viewportBounds,this.Ca,!1)}jt.free(y)}},initialPosition:{get:function(){return this.zt},set:function(a){this.zt.D(a)||(this.zt=a.J())}},initialScale:{get:function(){return this.At},set:function(a){this.At!==a&&(this.At=a)}},grid:{get:function(){return this.fe===null&&(this.fe=_r(this)),this.fe},set:function(a){var y=this.fe;if(y!==a){y===null&&(y=this.fe=_r(this)),a.type!==Re.Grid&&fe("Diagram.grid must be a Panel of type Panel.Grid");var x=y.panel;x!==null&&x.remove(y),this.fe=a,a.name="GRID",x!==null&&x.add(a),Bs(this),this.N(),this.g("grid",y,a)}}},viewportBounds:{get:function(){return this.Rw}},viewSize:{get:function(){return this.wo},set:function(a){var y=this.viewSize;y.D(a)||(this.wo=a=a.J(),this.ya=this.Aa=0,a.w()?(this.Aa=a.width,this.ya=a.height):this.Ka!==null&&(this.Aa=this.Ka.clientWidth||1,this.ya=this.Ka.clientHeight||1),il(this),this.Ya(),this.g("viewSize",y,a),this.redraw())}},fixedBounds:{get:function(){return this.ut},set:function(a){var y=this.ut;y.D(a)||(a.width!==-1/0&&a.height!==1/0&&a.height!==-1/0||fe("fixedBounds width/height must not be Infinity"),this.ut=a=a.J(),this.Ya(),this.g("fixedBounds",y,a))}},scrollMargin:{get:function(){return this.rj},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.rj;y.D(a)||(this.rj=a=a.J(),this.g("scrollMargin",y,a),this.hk())}},scrollMode:{get:function(){return this.sj},set:function(a){var y=this.sj;y!==a&&(this.sj=a,a===Pd&&mo(this,!1),this.g("scrollMode",y,a),this.Ee=!0,this.N())}},scrollsPageOnFocus:{get:function(){return this.nu},set:function(a){var y=this.nu;y!==a&&(this.nu=a,this.g("scrollsPageOnFocus",y,a))}},positionComputation:{get:function(){return this.Zt},set:function(a){var y=this.Zt;y!==a&&(this.Zt=a,mo(this,!1),this.g("positionComputation",y,a))}},scaleComputation:{get:function(){return this.fu},set:function(a){var y=this.fu;y!==a&&(this.fu=a,el(this,this.scale,this.scale),this.g("scaleComputation",y,a))}},documentBounds:{get:function(){return this.Sp}},isVirtualized:{get:function(){return this.It},set:function(a){var y=this.It;y!==a&&(this.It=a,this.g("isVirtualized",y,a))}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&el(this,y,a)}},defaultScale:{get:function(){return this.Pp},set:function(a){this.Pp=a}},autoScale:{get:function(){return this.yh},set:function(a){var y=this.yh;y!==a&&(this.yh=a,this.g("autoScale",y,a),a!==da&&mo(this,!1))}},initialAutoScale:{get:function(){return this.Fg},set:function(a){var y=this.Fg;y!==a&&(this.Fg=a,this.g("initialAutoScale",y,a))}},initialViewportSpot:{get:function(){return this.Bt},set:function(a){var y=this.Bt;y!==a&&(a.sb()||fe("initialViewportSpot must be a specific Spot: "+a),this.Bt=a,this.g("initialViewportSpot",y,a))}},initialDocumentSpot:{get:function(){return this.yt},set:function(a){var y=this.yt;y!==a&&(a.sb()||fe("initialViewportSpot must be a specific Spot: "+a),this.yt=a,this.g("initialDocumentSpot",y,a))}},minScale:{get:function(){return this.Ot},set:function(a){var y=this.Ot;y!==a&&(0<a?(this.Ot=a,this.g("minScale",y,a),a>this.scale&&(this.scale=a)):ri(a,"> 0",se,"minScale"))}},maxScale:{get:function(){return this.Mt},set:function(a){var y=this.Mt;y!==a&&(0<a?(this.Mt=a,this.g("maxScale",y,a),a<this.scale&&(this.scale=a)):ri(a,"> 0",se,"maxScale"))}},zoomPoint:{get:function(){return this.zu},set:function(a){this.zu.D(a)||(this.zu=a=a.J())}},contentAlignment:{get:function(){return this.zk},set:function(a){var y=this.zk;y.D(a)||(this.zk=a=a.J(),this.g("contentAlignment",y,a),mo(this,!1))}},initialContentAlignment:{get:function(){return this.pq},set:function(a){var y=this.pq;y.D(a)||(this.pq=a=a.J(),this.g("initialContentAlignment",y,a))}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.Ya(),this.g("padding",y,a))}},partManager:{get:function(){return this.Pc},set:function(a){var y=this.Pc;y!==a&&(a.diagram!==null&&fe("Cannot share PartManagers between Diagrams: "+a.toString()),y&&y.Xe(null),this.Pc=a,a.Xe(this))}},nodes:{get:function(){return this.partManager.nodes.iterator}},links:{get:function(){return this.partManager.links.iterator}},parts:{get:function(){return this.partManager.parts.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;y!==a&&(this.Sc=a,a.diagram=this,a.group=null,this.xh=!0,this.g("layout",y,a),this.$b())}},isTreePathToChildren:{get:function(){return this.Ht},set:function(a){var y=this.Ht;if(y!==a&&(this.Ht=a,this.g("isTreePathToChildren",y,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Sp(a.value)}},treeCollapsePolicy:{get:function(){return this.uu},set:function(a){var y=this.uu;y!==a&&(a!==wd&&a!==Xo&&a!==lg&&fe("Unknown Diagram.treeCollapsePolicy: "+a),this.uu=a,this.g("treeCollapsePolicy",y,a))}},Ue:{get:function(){return this.pw},set:function(a){this.pw=a}},avoidanceCellSize:{get:function(){return this.aw},set:function(a){this.Xh=null,this.aw=new Ze(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{get:function(){return this.bw},set:function(a){this.bw=Math.max(1,a)}},autoScrollInterval:{get:function(){return this.vp},set:function(a){var y=this.vp;y!==a&&(this.vp=a,this.g("autoScrollInterval",y,a))}},autoScrollRegion:{get:function(){return this.xp},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.xp;y.D(a)||(this.xp=a=a.J(),this.Ya(),this.g("autoScrollRegion",y,a))}}}),Oe.Object.defineProperties(se,{licenseKey:{get:function(){return ap.jc()},set:function(a){ap.add(a.replace(/\s/g,""))}},version:{get:function(){return Yf}}}),se.prototype.makeImageData=se.prototype.Jx,se.prototype.makeImage=se.prototype.Wz,se.prototype.cacheGroupExternalLinks=se.prototype.Fu,se.prototype.addRenderer=se.prototype.bs,se.prototype.makeSVG=se.prototype.av,se.prototype.makeSvg=se.prototype.Cs,se.prototype.stopAutoScroll=se.prototype.ug,se.prototype.doAutoScroll=se.prototype.gs,se.prototype.isUnoccupied=se.prototype.Yj,se.prototype.raiseDiagramEvent=se.prototype.R,se.prototype.removeDiagramListener=se.prototype.am,se.prototype.addDiagramListener=se.prototype.Bj,se.prototype.findTreeRoots=se.prototype.yz,se.prototype.layoutDiagram=se.prototype.Uz,se.prototype.findTopLevelGroups=se.prototype.qz,se.prototype.findTopLevelNodesAndLinks=se.prototype.rz,se.prototype.ensureBounds=se.prototype.Va,se.prototype.findLinksByExample=se.prototype.ls,se.prototype.findNodesByExample=se.prototype.ms,se.prototype.findLinkForData=se.prototype.Kc,se.prototype.findNodeForData=se.prototype.ii,se.prototype.findPartForData=se.prototype.Lc,se.prototype.findLinkForKey=se.prototype.findLinkForKey,se.prototype.findNodeForKey=se.prototype.Vb,se.prototype.findPartForKey=se.prototype.findPartForKey,se.prototype.rebuildParts=se.prototype.Wd,se.prototype.transformViewToDoc=se.prototype.Ps,se.prototype.transformRectDocToView=se.prototype.zA,se.prototype.transformDocToView=se.prototype.op,se.prototype.centerRect=se.prototype.es,se.prototype.scrollToRect=se.prototype.tv,se.prototype.scroll=se.prototype.scroll,se.prototype.highlightCollection=se.prototype.Jz,se.prototype.highlight=se.prototype.Iz,se.prototype.selectCollection=se.prototype.rA,se.prototype.select=se.prototype.select,se.prototype.updateAllRelationshipsFromData=se.prototype.rp,se.prototype.updateAllTargetBindings=se.prototype.updateAllTargetBindings,se.prototype.commit=se.prototype.commit,se.prototype.rollbackTransaction=se.prototype.Kf,se.prototype.commitTransaction=se.prototype.eb,se.prototype.startTransaction=se.prototype.Ea,se.prototype.raiseChanged=se.prototype.g,se.prototype.raiseChangedEvent=se.prototype.cb,se.prototype.removeChangedListener=se.prototype.ik,se.prototype.addChangedListener=se.prototype.Pe,se.prototype.removeModelChangedListener=se.prototype.mA,se.prototype.addModelChangedListener=se.prototype.Yw,se.prototype.findLayer=se.prototype.Qj,se.prototype.removeLayer=se.prototype.kA,se.prototype.addLayerAfter=se.prototype.Cy,se.prototype.addLayerBefore=se.prototype.Ww,se.prototype.addLayer=se.prototype.Al,se.prototype.moveParts=se.prototype.moveParts,se.prototype.copyParts=se.prototype.Kj,se.prototype.removeParts=se.prototype.Is,se.prototype.remove=se.prototype.remove,se.prototype.add=se.prototype.add,se.prototype.clearDelayedGeometries=se.prototype.bx,se.prototype.setProperties=se.prototype.nm,se.prototype.attach=se.prototype.Du,se.prototype.set=se.prototype.set,se.prototype.resetInputOptions=se.prototype.Sx,se.prototype.setInputOption=se.prototype.sA,se.prototype.getInputOption=se.prototype.Ql,se.prototype.resetRenderingHints=se.prototype.Tx,se.prototype.setRenderingHint=se.prototype.Xx,se.prototype.getRenderingHint=se.prototype.Gf,se.prototype.maybeUpdate=se.prototype.bd,se.prototype.requestUpdate=se.prototype.$b,se.prototype.delayInitialization=se.prototype.Xy,se.prototype.isUpdateRequested=se.prototype.Pz,se.prototype.invalidateDocumentBounds=se.prototype.Ya,se.prototype.findObjectsNear=se.prototype.og,se.prototype.findPartsNear=se.prototype.mz,se.prototype.findObjectsIn=se.prototype.Cf,se.prototype.findPartsIn=se.prototype.ux,se.prototype.findObjectsAt=se.prototype.ji,se.prototype.findPartsAt=se.prototype.lz,se.prototype.findObjectAt=se.prototype.ic,se.prototype.findPartAt=se.prototype.Ol,se.prototype.focusObject=se.prototype.zz,se.prototype.alignDocument=se.prototype.Jy,se.prototype.zoomToRect=se.prototype.BA,se.prototype.zoomToFit=se.prototype.zoomToFit,se.prototype.diagramScroll=se.prototype.kx,se.prototype.focus=se.prototype.focus;var ag=new xn,um=null,So=xe.document!==void 0,Kf=null,ef="",da=new me(se,"None",0),Fl=new me(se,"Uniform",1),nf=new me(se,"UniformToFill",2),Lc=new me(se,"CycleAll",10),np=new me(se,"CycleNotDirected",11),ip=new me(se,"CycleNotDirectedFast",12),rp=new me(se,"CycleNotUndirected",13),op=new me(se,"CycleDestinationTree",14),sp=new me(se,"CycleSourceTree",15),Pd=new me(se,"DocumentScroll",1),Mc=new me(se,"InfiniteScroll",2),wd=new me(se,"TreeParentCollapsed",21),Xo=new me(se,"AllParentsCollapsed",22),lg=new me(se,"AnyParentsCollapsed",23),ap=new Ve,Yf="2.3.10",Xf="image",kc=null,hm=!1;function ia(){if(So){var a=xe.document.createElement("canvas"),y=a.getContext("2d"),x=ci("7ca11abfd022028846");y[x]=ci("398c3597c01238");for(var b=["5da73c80a36455d7038e4972187c3cae51fd22",Xe.Dx+"4ae6247590da4bb21c324ba3a84e385776",oi.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",ne.za],E=1;5>E;E++)y[ci("7ca11abfd7330390")](ci(b[E-1]),10,15*E);for(y[x]=ci("39f046ebb36e4b"),x=1;5>x;x++)y[ci("7ca11abfd7330390")](ci(b[x-1]),10,15*x);(b.length!==4||b[0][0]!=="5"||b[3][0]!=="7")&&(oi.prototype.Cd=oi.prototype.Eu),kc=a}}se.className="Diagram",se.fromDiv=function(a){var y=a;return typeof a=="string"&&(y=xe.document.getElementById(a)),y instanceof HTMLDivElement&&y.H instanceof se?y.H:null},se.inherit=function(a,y){function x(){}if(Object.getPrototypeOf(a).prototype)throw Error(`Used go.Diagram.inherit defining already defined class
|
|
`+a);x.prototype=y.prototype,a.prototype=new x,a.prototype.constructor=a},se.useDOM=function(a){So=a?xe.document!==void 0:!1},se.isUsingDOM=function(){return So},se.None=da,se.Uniform=Fl,se.UniformToFill=nf,se.CycleAll=Lc,se.CycleNotDirected=np,se.CycleNotDirectedFast=ip,se.CycleNotUndirected=rp,se.CycleDestinationTree=op,se.CycleSourceTree=sp,se.DocumentScroll=Pd,se.InfiniteScroll=Mc,se.TreeParentCollapsed=wd,se.AllParentsCollapsed=Xo,se.AnyParentsCollapsed=lg;function dm(){this.wy=null,this.j="zz@orderNum",this._tk==="63ad05bbe23a1786468a4c741b6d2"?this.Rc=this.j=!0:this.Rc=null}function Zf(a,y){if(y.ib.setTransform(y.Mb,0,0,y.Mb,0,0),y.ib.yc(),a.Rc===null)t:{y="f";var x=xe[ci("76a715b2f73f148a")][ci("72ba13b5")]||"";if(a.Rc=!0,So){var b=se[ci("76a115b6ed251eaf4692")];if(b)for(var E=ap.iterator;E.next()&&(b=E.value,b=ci(b).split(ci("39e9")),!(6>b.length));){var z=ci(b[1]).split(".");if(b[4]!=="7da71ca0")break;var tt=ci(Xe[ci("6cae19")]).split(".");if(z[0]>tt[0]||z[0]===tt[0]&&z[1]>=tt[1]){var rt=xe[ci("74a900bae4370f8b51")][ci("6fbb13a1c2311e8a57")].toLowerCase();if(tt=rt[ci("73a612b6fb191d")](ci("3aad1ab6e022098b4dc4")),z=ci(b[2]),-1<tt&&(rt=rt[ci("73a612b6fb191d")](z.toLowerCase()+"/"),a.Rc=!(-1<rt&&rt<tt),!a.Rc))break;for(tt=x[ci("76ad18b4f73e")],rt=x[ci("73a612b6fb191d")](ci("35e7"))+2;rt<tt;rt++)y+=x[rt];if(tt=y[ci("73a612b6fb191d")](z),0>tt&&z!==ci("7da71ca0ad381e90")&&(tt=y[ci("73a612b6fb191d")](ci("76a715b2ef3e149757"))),0>tt&&(tt=y[ci("73a612b6fb191d")](ci("76a715b2ef3e149757"))),0>tt&&(tt=y[ci("73a612b6fb191d")](ci("2bfa41fdb3784bca12"))),0>tt&&(tt=x[ci("73a612b6fb191d")](ci("7baa19a6f76c1988428554"))),a.Rc=!(0<=tt&&tt<y[ci("73a612b6fb191d")](ci("35"))||y[ci("73a612b6fb191d")](ci("35"))===-1),!a.Rc||x[ci("73a612b6fb191d")](ci("7fb002b6ed25128b4da25b2e"))&&(a.Rc=!(-1<x[ci("73a612b6fb191d")](z)),!a.Rc)||(tt=xe[ci("76a715b2f73f148a")][ci("69ad17a1e03e")],rt=tt[ci("73a612b6fb191d")](ci("7fb002b6ed25128b4da25b2e")),-1<rt&&(a.Rc=!(tt[ci("73a612b6fb191d")](z)>rt),!a.Rc)))break;if(z[0]==="#"){tt=xe.document.createElement("div");for(var ot=b[0].replace(/[A-Za-z]/g,"");4>ot.length;)ot+="9";if(rt=ot,ot=ot.substr(ot.length-4),b="",b+=["gsh","gsf"][parseInt(ot.substr(0,1),10)%2],b+=["Header","Background","Display","Feedback"][parseInt(ot.substr(0,1),10)%4],tt[ci("79a417a0f0181a8946")]=b,xe.document[ci("78a712aa")]){xe.document[ci("78a712aa")][ci("7bb806b6ed32388c4a875b")](tt),ot=xe.getComputedStyle(tt).getPropertyValue(ci("78a704b7e62456904c9b12701b6532a8"));var at=xe.getComputedStyle(tt).getPropertyValue(ci("75b817b0ea2202"));if(xe.document[ci("78a712aa")][ci("68ad1bbcf533388c4a875b")](tt),ot){if(tt=xe[ci("77a902b0eb1b1e804a8a")],at==="0."+parseInt(rt,10)%100||ot.indexOf(parseInt(z[1]+z[2],16))!==-1&&ot.indexOf(parseInt(z[3]+z[4],16))!==-1){a.Rc=!1;break}else if(tt&&tt(ci("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(b="."+b,z=0;z<document.styleSheets.length;z++){tt=document.styleSheets[z].rules||document.styleSheets[z].cssRules;for(var ut in tt)if(b===tt[ut].selectorText){a.Rc=!1;break t}}}}else a.Rc=null,a.Rc=!1}}}else{for(ut=x[ci("76ad18b4f73e")],E=x[ci("73a612b6fb191d")](ci("35e7"))+2;E<ut;E++)y+=x[E];x=y[ci("73a612b6fb191d")](ci("7da71ca0ad381e90")),a.Rc=!(0<=x&&x<y[ci("73a612b6fb191d")](ci("35")))}}}return 0<a.Rc&&a!==a.wy}dm.className="DiagramHelper";function Jh(a){this.j=a===void 0?new jt:a,this.o=new jt}Oe.Object.defineProperties(Jh.prototype,{point:{get:function(){return this.j},set:function(a){this.j=a}},shifted:{get:function(){return this.o},set:function(a){this.o=a}}});var bc="DraggingInfo";Jh.className="DraggingInfo";function it(a,y,x){this.node=a,this.info=y,this.Su=x}it.className="DraggingNodeInfoPair";function st(){this.reset()}st.prototype.reset=function(){this.isGridSnapEnabled=!1,this.isGridSnapRealtime=!0,this.gridSnapCellSize=new Ze(NaN,NaN).freeze(),this.gridSnapCellSpot=ms,this.gridSnapOrigin=new jt(NaN,NaN).freeze(),this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1,this.dragsMembers=this.groupsAlwaysMove=!0},st.className="DraggingOptions";function ft(a,y){if(typeof a=="string"||xe.Element&&a instanceof Element)var x=se.call(this,a)||this;else x=se.call(this)||this,y=a;return dt(x),y&&x.nm(y),x}le(ft,se);function dt(a){a.allowDragOut=!0,a.allowMove=!1,a.isReadOnly=!0,a.contentAlignment=du,a.layout=new Is}ft.prototype.reset=function(){se.prototype.reset.call(this),dt(this)},ft.className="Palette";function gt(a,y){if(typeof a=="string"||xe.Element&&a instanceof Element)var x=se.call(this,a)||this;else x=se.call(this)||this,y=a;var b=x;x.animationManager.isEnabled=!1,x.vb=!0,x.V=null,x.mn=!1,x.nn=!1,x.F=!0,x.u=!0,x.ia=0,x.o=!1,x.ql=null,x.Xx("drawShadows",!1),a=new vn;var E=new Qn;return E.stroke="magenta",E.strokeWidth=2,E.fill="transparent",E.name="BOXSHAPE",a.selectable=!0,a.selectionAdorned=!1,a.selectionObjectName="BOXSHAPE",a.locationObjectName="BOXSHAPE",a.resizeObjectName="BOXSHAPE",a.cursor="move",a.add(E),x.j=a,x.allowCopy=!1,x.allowDelete=!1,x.allowSelect=!0,x.autoScrollRegion=new ni(0,0,0,0),x.pa.h(0,0),x.toolManager.gb("Dragging",new Rt,x.toolManager.mouseMoveTools),x.click=function(){var z=b.observed;if(z!==null){var tt=z.viewportBounds,rt=b.lastInput.documentPoint;z.position=new jt(rt.x-tt.width/2,rt.y-tt.height/2)}},x.Pf=function(){b.Ya(),Tt(b)},x.Xd=function(){b.observed!==null&&(b.Ya(),b.N())},x.Ha=function(){1>b.updateDelay?b.N():b.o||(b.o=!0,setTimeout(function(){return b.redraw()},b.updateDelay))},x.Of=function(){b.observed!==null&&Tt(b)},x.autoScale=Fl,x.vb=!1,y&&Object.assign(x,y),x}le(gt,se),gt.prototype.computePixelRatio=function(){return 1},gt.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.ta,y=this.ib;if(a!==null&&y!==null){if(Yh(this),this.ql===null){var x=new iu(null);x.width=a.width,x.height=a.height,this.ql=x}try{this.ta=this.ql,this.ib=this.ta.context,this.ib.Vc(!0),this.ib.setTransform(1,0,0,1,0,0),this.ib.clearRect(0,0,this.ta.width,this.ta.height),Pt(this)}finally{this.ta=a,this.ib=y}}}se.prototype.redraw.call(this)},gt.prototype.gc=function(){if(this.Ka===null&&fe("No div specified"),this.ta===null&&fe("No canvas specified"),!(this.ta instanceof sh)&&(Ov(this.box),this.Fc)){var a=this.observed;if(a!==null&&!a.animationManager.defaultAnimation.isAnimating&&a.pi){Yh(this);var y=this.ta;a=this.ib,a.Vc(!0),a.setTransform(1,0,0,1,0,0),a.clearRect(0,0,y.width,y.height),1>this.updateDelay?Pt(this):this.ql!==null&&(a.drawImage(this.ql.Oa,0,0),y=this.Ab,y.reset(),this.scale!==1&&y.scale(this.scale),this.position.x===0&&this.position.y===0||y.translate(-this.position.x,-this.position.y),a.scale(this.Mb,this.Mb),a.transform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy),a.yc()),y=this.Wa.s;for(var x=y.length,b=0;b<x;b++)y[b].gc(a,this);this.Fc=this.vd=!1}}};function Pt(a){var y=a.observed;if(y!==null){var x=a.drawsTemporaryLayers,b=a.drawsGrid&&x,E=y.grid;b&&E!==null&&E.visible&&!isNaN(E.width)&&!isNaN(E.height)&&(E=ye.alloc().assign(a.viewportBounds).ed(y.viewportBounds),Bs(y,E),ye.free(E),As(y));var z=a.Ab;z.reset(),a.scale!==1&&z.scale(a.scale),a.position.x===0&&a.position.y===0||z.translate(-a.position.x,-a.position.y),E=a.ib,E.scale(a.Mb,a.Mb),E.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),E.yc(),y=y.Wa.s,z=y.length;for(var tt=0;tt<z;tt++){var rt=y[tt],ot=a;if(rt.visible&&rt.opacity!==0){var at=rt.diagram.grid.part;if(!x&&rt.isTemporary)b&&at.layer===rt&&(rt=Ls(rt,E),at.gc(E,ot),E.globalAlpha=rt);else{for(var ut=Ls(rt,E),ct=ot.scale,mt=ye.alloc(),yt=rt.Pa.s,St=yt.length,Lt=0;Lt<St;Lt++){var Ot=yt[Lt];(b||Ot!==at)&&rt.Oj(E,Ot,ot,null,ct,mt,!1)}ye.free(mt),E.globalAlpha=ut}}}}}function Tt(a){var y=a.box;if(y!==null){var x=a.observed;if(x!==null){a.Fc=!0,x=x.viewportBounds;var b=y.selectionObject,E=Ze.alloc();E.h(x.width,x.height),b.desiredSize=E,Ze.free(E),a=2/a.scale,b instanceof Qn&&(b.strokeWidth=a),y.location=new jt(x.x-a/2,x.y-a/2),y.isSelected=!0}}}gt.prototype.computeBounds=function(){var a=this.observed;if(a===null)return mr;var y=a.documentBounds.copy();return y.ed(a.viewportBounds),y},gt.prototype.invalidateViewport=function(){this.Fc!==!0&&(this.Fc=!0,this.$b())},gt.prototype.onViewportBoundsChanged=function(a,y,x,b){this.vb||(this.vd=!0,this.N(),this.Ee=!0,this.Ya(),Tt(this),this.fc.scale=x,this.fc.position.x=a.x,this.fc.position.y=a.y,this.fc.bounds.assign(a),this.fc.Oz=b,this.R("ViewportBoundsChanged",this.fc,a))},Oe.Object.defineProperties(gt.prototype,{observed:{get:function(){return this.V},set:function(a){var y=this.V;if(a instanceof gt&&fe("Overview.observed Diagram may not be an Overview itself: "+a),y!==a){if(y!==null&&(this.remove(this.box),y.am("ViewportBoundsChanged",this.Pf),y.am("DocumentBoundsChanged",this.Xd),y.am("InvalidateDraw",this.Ha),y.am("AnimationFinished",this.Of)),this.V=a,a!==null&&(a.Bj("ViewportBoundsChanged",this.Pf),a.Bj("DocumentBoundsChanged",this.Xd),a.Bj("InvalidateDraw",this.Ha),a.Bj("AnimationFinished",this.Of),this.add(this.box)),this.Ya(),a===null){this.ql=null;var x=this.ta,b=this.ib;x&&b&&(b.setTransform(1,0,0,1,0,0),b.clearRect(0,0,x.width,x.height))}else this.Ha(null),Tt(this),this.N();this.g("observed",y,a)}}},box:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.remove(y),this.add(this.j),Tt(this),this.g("box",y,a))}},drawsTemporaryLayers:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a,this.redraw())}},drawsGrid:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a,this.redraw())}},updateDelay:{get:function(){return this.ia},set:function(a){0>a&&(a=0),this.ia!==a&&(this.ia=a)}}}),gt.className="Overview";function Rt(){ti.call(this),this.j=null}le(Rt,ti),Rt.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a===null||!a.allowMove||!a.allowSelect)return!1;var y=a.observed;if(y===null)return!1;var x=a.lastInput;return!x.left||a.currentTool!==this&&(!this.isBeyondDragSize()||x.isTouchEvent&&x.timestamp-a.firstInput.timestamp<this.delay)?!1:(this.findDraggablePart()===null&&(x=y.viewportBounds,this.j=new jt(x.width/2,x.height/2),a=a.firstInput.documentPoint,y.position=new jt(a.x-this.j.x,a.y-this.j.y)),!0)},Rt.prototype.doActivate=function(){this.j=null,ti.prototype.doActivate.call(this)},Rt.prototype.doUpdateCursor=function(){var a=this.diagram,y=a.box;y!==null&&y.cursor&&(a.currentCursor=y.cursor)},Rt.prototype.moveParts=function(){var a=this.diagram,y=a.observed;if(y!==null){var x=a.box;if(x!==null){if(this.j===null){var b=a.firstInput.documentPoint;x=x.location,this.j=new jt(b.x-x.x,b.y-x.y)}a=a.lastInput.documentPoint,y.position=new jt(a.x-this.j.x,a.y-this.j.y)}}},Rt.className="OverviewDraggingTool";function Bt(){qr(this),this.H=wa,this.Ha=this.u=this.o=!0,this.F=this.V=this.nb=this.ia=!1,this.ij=this.j=null,this.Hb=1.05,this.Jt=NaN,this.sw=null,this.Au=NaN,this.yu=mr,this.hb=!0,this.cg=null,this.ob=200}Bt.prototype.toString=function(){return"CommandHandler"},Bt.prototype.Xe=function(a){this.H=a},Bt.prototype.doKeyDown=function(){var a=this.diagram,y=a.lastInput,x=Ps?y.meta:y.control,b=y.shift,E=y.alt,z=y.key;!x||z!=="C"&&z!=="Insert"?x&&z==="X"||b&&z==="Del"?this.canCutSelection()&&this.cutSelection():x&&z==="V"||b&&z==="Insert"?this.canPasteSelection()&&this.pasteSelection():x&&z==="Y"||E&&b&&z==="Backspace"?this.canRedo()&&this.redo():x&&z==="Z"||E&&z==="Backspace"?this.canUndo()&&this.undo():z==="Del"||z==="Backspace"?this.canDeleteSelection()&&this.deleteSelection():x&&z==="A"?this.canSelectAll()&&this.selectAll():z==="Esc"?this.canStopCommand()&&this.stopCommand():z==="Up"?a.allowVerticalScroll&&(x?a.scroll("pixel","up"):a.scroll("line","up")):z==="Down"?a.allowVerticalScroll&&(x?a.scroll("pixel","down"):a.scroll("line","down")):z==="Left"?a.allowHorizontalScroll&&(x?a.scroll("pixel","left"):a.scroll("line","left")):z==="Right"?a.allowHorizontalScroll&&(x?a.scroll("pixel","right"):a.scroll("line","right")):z==="PageUp"?b&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&a.scroll("page","up"):z==="PageDown"?b&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):z==="Home"?x&&a.allowVerticalScroll?a.scroll("document","up"):!x&&a.allowHorizontalScroll&&a.scroll("document","left"):z==="End"?x&&a.allowVerticalScroll?a.scroll("document","down"):!x&&a.allowHorizontalScroll&&a.scroll("document","right"):z===" "?this.canScrollToPart()&&this.scrollToPart():z==="Subtract"?this.canDecreaseZoom()&&this.decreaseZoom():z==="Add"?this.canIncreaseZoom()&&this.increaseZoom():x&&z==="0"?this.canResetZoom()&&this.resetZoom():b&&z==="Z"?this.canZoomToFit()&&this.zoomToFit():x&&!b&&z==="G"?this.canGroupSelection()&&this.groupSelection():x&&b&&z==="G"?this.canUngroupSelection()&&this.ungroupSelection():z==="F2"||y.event&&y.event.key==="F2"?this.canEditTextBlock()&&this.editTextBlock():z==="ContextMenu"||y.event&&y.event.key==="ContextMenu"?this.canShowContextMenu()&&this.showContextMenu():y.bubbles=!0:this.canCopySelection()&&this.copySelection()},Bt.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0},Bt.prototype.stopCommand=function(){var a=this.diagram,y=a.currentTool;y instanceof jr&&a.allowSelect&&a.clearSelection(),y!==null&&y.doCancel()},Bt.prototype.canStopCommand=function(){return!0},Bt.prototype.selectAll=function(){var a=this.diagram;a.N();try{a.currentCursor="wait",a.R("ChangingSelection",a.selection);for(var y=a.parts;y.next();)y.value.isSelected=!0;for(var x=a.nodes;x.next();)x.value.isSelected=!0;for(var b=a.links;b.next();)b.value.isSelected=!0}finally{a.R("ChangedSelection",a.selection),a.currentCursor=""}},Bt.prototype.canSelectAll=function(){return this.diagram.allowSelect},Bt.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Delete"),a.R("SelectionDeleting",a.selection);for(var y=new Ye,x=a.selection.iterator;x.next();)af(y,x.value,!0,this.deletesTree?1/0:0,this.deletesConnectedLinks?null:!1,function(b){return b.canDelete()});a.Is(y,!0),a.R("SelectionDeleted",y)}finally{a.eb("Delete"),a.R("ChangedSelection",a.selection),a.currentCursor=""}},Bt.prototype.canDeleteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowDelete||a.selection.count===0)},Bt.prototype.copySelection=function(){var a=this.diagram,y=new Ye;for(a=a.selection.iterator;a.next();)af(y,a.value,!0,this.copiesTree?1/0:0,this.copiesConnectedLinks,function(x){return x.canCopy()});this.copyToClipboard(y)},Bt.prototype.canCopySelection=function(){var a=this.diagram;return!!(a.allowCopy&&a.allowClipboard&&a.selection.count!==0)},Bt.prototype.cutSelection=function(){this.copySelection(),this.deleteSelection()},Bt.prototype.canCutSelection=function(){var a=this.diagram;return!!(!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&a.selection.count!==0)},Bt.prototype.copyToClipboard=function(a){var y=this.diagram,x=null;if(a===null)Kf=null,ef="";else{x=y.model;var b=!1,E=!1,z=null;try{x.Tl()&&(b=x.Jj,x.Jj=this.copiesParentKey),x.Wj()&&(E=x.Ij,x.Ij=this.copiesGroupKey),z=y.Kj(a,null,!0)}finally{x.Tl()&&(x.Jj=b),x.Wj()&&(x.Ij=E),x=new Ve,x.addAll(z),Kf=x,ef=y.model.dataFormat}}y.R("ClipboardChanged",x)},Bt.prototype.pasteFromClipboard=function(){var a=new Ye,y=Kf;if(y===null)return a;var x=this.diagram;if(ef!==x.model.dataFormat)return a;var b=x.model,E=!1,z=!1,tt=null;try{b.Tl()&&(E=b.Jj,b.Jj=this.copiesParentKey),b.Wj()&&(z=b.Ij,b.Ij=this.copiesGroupKey),tt=x.Kj(y,x,!1)}finally{for(b.Tl()&&(b.Jj=E),b.Wj()&&(b.Ij=z),y=tt.iterator;y.next();)x=y.value,b=y.key,x.location.w()||(b.location.w()?x.location=b.location:!x.position.w()&&b.position.w()&&(x.position=b.position)),a.add(x)}return a},Bt.prototype.pasteSelection=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Paste");var x=this.pasteFromClipboard();0<x.count&&y.clearSelection(!0);for(var b=x.iterator;b.next();)b.value.isSelected=!0;if(a!==null){var E=y.computePartsBounds(y.selection);if(E.w()){var z=this.computeEffectiveCollection(y.selection,y.Wm);Xh(y,z,new jt(a.x-E.centerX,a.y-E.centerY),y.Wm,!1)}}y.R("ClipboardPasted",x)}finally{y.eb("Paste"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Bt.prototype.canPasteSelection=function(){var a=this.diagram;return!(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||Kf===null||Kf.count===0||ef!==a.model.dataFormat)},Bt.prototype.undo=function(){this.diagram.undoManager.undo()},Bt.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()},Bt.prototype.redo=function(){this.diagram.undoManager.redo()},Bt.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()},Bt.prototype.decreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;y.autoScale===da&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Bt.prototype.canDecreaseZoom=function(a){a===void 0&&(a=1/this.zoomFactor);var y=this.diagram;return y.autoScale!==da?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Bt.prototype.increaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;y.autoScale===da&&(a=y.scale*a,a<y.minScale||a>y.maxScale||(y.scale=a))},Bt.prototype.canIncreaseZoom=function(a){a===void 0&&(a=this.zoomFactor);var y=this.diagram;return y.autoScale!==da?!1:(a=y.scale*a,a<y.minScale||a>y.maxScale?!1:y.allowZoom)},Bt.prototype.resetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;a<y.minScale||a>y.maxScale||(y.scale=a)},Bt.prototype.canResetZoom=function(a){a===void 0&&(a=this.defaultScale);var y=this.diagram;return a<y.minScale||a>y.maxScale?!1:y.allowZoom},Bt.prototype.zoomToFit=function(){var a=this.diagram,y=a.animationManager;y.Cc(),a.redraw();var x=a.position,b=a.scale;io(y,"Zoom To Fit"),this.isZoomToFitRestoreEnabled&&b===this.Au&&!isNaN(this.Jt)&&a.documentBounds.D(this.yu)?(a.scale=this.Jt,a.position=this.sw,this.Au=NaN,this.yu=mr):(this.Jt=b,this.sw=x.copy(),a.zoomToFit(),this.Au=a.scale,this.yu=a.documentBounds.copy()),ao(y)},Bt.prototype.canZoomToFit=function(){return this.diagram.allowZoom},Bt.prototype.scrollToPart=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.Va(),a===null){try{this.cg!==null&&(this.cg.next()?a=this.cg.value:this.cg=null)}catch(ot){this.cg=null}a===null&&(0<y.highlighteds.count?this.cg=y.highlighteds.iterator:0<y.selection.count&&(this.cg=y.selection.iterator),this.cg!==null&&this.cg.next()&&(a=this.cg.value))}if(a!==null){var x=y.animationManager;io(x,"Scroll To Part");var b=this.scrollToPartPause;if(0<b){var E=Xt(this,a,[a]);if(E.length===1)y.Ea(),y.es(a.actualBounds),y.eb("Scroll To Part");else{var z=function(){y.Ea();for(var ot=E.pop();0<E.length&&ot instanceof $e&&ot.isTreeExpanded&&(!(ot instanceof Yn)||ot.isSubGraphExpanded);)ot=E.pop();0<E.length?(ot instanceof vn&&y.tv(ot.actualBounds),ot instanceof $e&&!ot.isTreeExpanded&&(ot.isTreeExpanded=!0),ot instanceof Yn&&!ot.isSubGraphExpanded&&(ot.isSubGraphExpanded=!0)):(ot instanceof vn&&y.es(ot.actualBounds),y.am("LayoutCompleted",tt)),y.eb("Scroll To Part")},tt=function(){Oi(z,(x.isEnabled?x.duration:0)+b)};y.Bj("LayoutCompleted",tt),z()}}else{var rt=y.position.copy();y.es(a.actualBounds),rt.Xa(y.position)&&x.Cc()}}};function Xt(a,y,x){if(y.isVisible())return x;if(y instanceof Bi)Xt(a,y.adornedPart,x);else if(y instanceof _e){var b=y.fromNode;b!==null&&Xt(a,b,x),y=y.toNode,y!==null&&Xt(a,y,x)}else y instanceof $e&&(b=y.labeledLink,b!==null&&Xt(a,b,x),b=y.pg(),b!==null&&(b.isTreeExpanded||b.wasTreeExpanded||x.push(b),Xt(a,b,x))),y=y.containingGroup,y!==null&&(y.isSubGraphExpanded||y.wasSubGraphExpanded||x.push(y),Xt(a,y,x));return x}Bt.prototype.canScrollToPart=function(a){return a===void 0&&(a=null),a!==null&&!(a instanceof vn)?!1:(a=this.diagram,a.selection.count===0&&a.highlighteds.count===0?!1:a.allowHorizontalScroll&&a.allowVerticalScroll)},Bt.prototype.collapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse Tree"),io(y.animationManager,"Collapse Tree");var x=new Ve;if(a!==null&&a.isTreeExpanded)a.collapseTree(),x.add(a);else if(a===null)for(var b=y.selection.iterator;b.next();){var E=b.value;E instanceof $e&&E.isTreeExpanded&&(E.collapseTree(),x.add(E))}y.R("TreeCollapsed",x)}finally{y.eb("Collapse Tree")}},Bt.prototype.canCollapseTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof $e&&a.isTreeExpanded))return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof $e&&y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Bt.prototype.expandTree=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand Tree"),io(y.animationManager,"Expand Tree");var x=new Ve;if(a!==null&&!a.isTreeExpanded)a.expandTree(),x.add(a);else if(a===null)for(var b=y.selection.iterator;b.next();){var E=b.value;E instanceof $e&&!E.isTreeExpanded&&(E.expandTree(),x.add(E))}y.R("TreeExpanded",x)}finally{y.eb("Expand Tree")}},Bt.prototype.canExpandTree=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null){if(!(a instanceof $e)||a.isTreeExpanded)return!1;if(0<a.Qo().count)return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof $e&&!y.isTreeExpanded&&0<y.Qo().count)return!0;return!1},Bt.prototype.groupSelection=function(){var a=this.diagram,y=a.model;if(y.Xj()){var x=this.archetypeGroupData;if(x!==null){var b=null;try{a.currentCursor="wait",a.R("ChangingSelection",a.selection),a.Ea("Group");for(var E=new Ve,z=a.selection.iterator;z.next();){var tt=z.value;tt.Zc()&&tt.canGroup()&&E.add(tt)}for(var rt=new Ve,ot=E.iterator;ot.next();){var at=ot.value;z=!1;for(var ut=E.iterator;ut.next();)if(at.Td(ut.value)){z=!0;break}z||rt.add(at)}if(0<rt.count){var ct=rt.first().containingGroup;if(ct!==null)for(;ct!==null;){E=!1;for(var mt=rt.iterator;mt.next();)if(!mt.value.Td(ct)){E=!0;break}if(E)ct=ct.containingGroup;else break}if(x instanceof Yn)ru(x),b=x.copy(),b!==null&&a.add(b);else if(y.Yu(x)){var yt=y.copyNodeData(x);Ue(yt)&&(y.xf(yt),b=a.ii(yt))}if(b!==null){ct!==null&&this.isValidMember(ct,b)&&(b.containingGroup=ct);for(var St=rt.iterator;St.next();){var Lt=St.value;this.isValidMember(b,Lt)&&(Lt.containingGroup=b)}a.clearSelection(!0),b.isSelected=!0}}a.R("SelectionGrouped",b)}finally{a.eb("Group"),a.R("ChangedSelection",a.selection),a.currentCursor=""}}}},Bt.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.Xj()||this.archetypeGroupData===null)return!1;for(a=a.selection.iterator;a.next();){var y=a.value;if(y.Zc()&&y.canGroup())return!0}return!1};function ge(a){var y=Kn();for(a=a.iterator;a.next();){var x=a.value;x instanceof _e||y.push(x)}a=new Ye,x=y.length;for(var b=0;b<x;b++){for(var E=y[b],z=!0,tt=0;tt<x;tt++)if(E.Td(y[tt])){z=!1;break}z&&a.add(E)}return zn(y),a}Bt.prototype.isValidMember=function(a,y){if(y===null||a===y||y instanceof _e)return!1;if(a!==null){if(a===y||a.Td(y))return!1;var x=a.memberValidation;if(x!==null&&!x(a,y)||a.data===null&&y.data!==null||a.data!==null&&y.data===null)return!1}return x=this.memberValidation,x!==null?x(a,y):!0},Bt.prototype.ungroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.model;if(x.Xj())try{y.currentCursor="wait",y.R("ChangingSelection",y.selection),y.Ea("Ungroup");var b=new Ve;if(a!==null)b.add(a);else for(var E=y.selection.iterator;E.next();){var z=E.value;z instanceof Yn&&z.canUngroup()&&b.add(z)}var tt=new Ve;if(0<b.count){y.clearSelection(!0);for(var rt=b.iterator;rt.next();){var ot=rt.value;ot.expandSubGraph();var at=ot.containingGroup,ut=at!==null&&at.data!==null?x.wa(at.data):void 0;tt.addAll(ot.memberParts);for(var ct=tt.iterator;ct.next();){var mt=ct.value;if(mt.isSelected=!0,!(mt instanceof _e)){var yt=mt.data;yt!==null?x.mp(yt,ut):mt.containingGroup=at}}y.remove(ot)}}y.R("SelectionUngrouped",b,tt)}finally{y.eb("Ungroup"),y.R("ChangedSelection",y.selection),y.currentCursor=""}},Bt.prototype.canUngroupSelection=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowDelete||!y.allowUngroup||!y.model.Xj())return!1;if(a!==null){if(!(a instanceof Yn))return!1;if(a.canUngroup())return!0}else for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Yn&&y.canUngroup())return!0;return!1},Bt.prototype.addTopLevelParts=function(a,y){var x=!0;for(a=ge(a).iterator;a.next();){var b=a.value;b.containingGroup!==null&&(!y||this.isValidMember(null,b)?b.containingGroup=null:x=!1)}return x},Bt.prototype.collapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Collapse SubGraph"),io(y.animationManager,"Collapse SubGraph");var x=new Ve;if(a!==null&&a.isSubGraphExpanded)a.collapseSubGraph(),x.add(a);else if(a===null)for(var b=y.selection.iterator;b.next();){var E=b.value;E instanceof Yn&&E.isSubGraphExpanded&&(E.collapseSubGraph(),x.add(E))}y.R("SubGraphCollapsed",x)}finally{y.eb("Collapse SubGraph")}},Bt.prototype.canCollapseSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return!!(a instanceof Yn&&a.isSubGraphExpanded);for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Yn&&y.isSubGraphExpanded)return!0;return!1},Bt.prototype.expandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;try{y.Ea("Expand SubGraph"),io(y.animationManager,"Expand SubGraph");var x=new Ve;if(a!==null&&!a.isSubGraphExpanded)a.expandSubGraph(),x.add(a);else if(a===null)for(var b=y.selection.iterator;b.next();){var E=b.value;E instanceof Yn&&!E.isSubGraphExpanded&&(E.expandSubGraph(),x.add(E))}y.R("SubGraphExpanded",x)}finally{y.eb("Expand SubGraph")}},Bt.prototype.canExpandSubGraph=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly)return!1;if(a!==null)return a instanceof Yn&&!a.isSubGraphExpanded;for(a=y.selection.iterator;a.next();)if(y=a.value,y instanceof Yn&&!y.isSubGraphExpanded)return!0;return!1},Bt.prototype.editTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram,x=y.toolManager.findTool("TextEditing");if(x!==null){if(a===null){a=null;for(var b=y.selection.iterator;b.next();){var E=b.value;if(E.canEdit()){a=E;break}}if(a===null)return;a=a.Nl(function(z){return z instanceof Mr&&z.editable})}a!==null&&(y.currentTool=null,x.textBlock=a,y.currentTool=x)}},Bt.prototype.canEditTextBlock=function(a){a===void 0&&(a=null);var y=this.diagram;if(y.isReadOnly||y.isModelReadOnly||!y.allowTextEdit||y.toolManager.findTool("TextEditing")===null)return!1;if(a!==null){if(!(a instanceof Mr))return!1;if(a=a.part,a!==null&&a.canEdit())return!0}else for(y=y.selection.iterator;y.next();)if(a=y.value,a.canEdit()&&(a=a.Nl(function(x){return x instanceof Mr&&x.editable}),a!==null))return!0;return!1},Bt.prototype.showContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");if(x!==null&&(a===void 0&&(a=0<y.selection.count?y.selection.first():y),a=x.findObjectWithContextMenu(a),a!==null)){var b=y.lastInput,E=null;a instanceof te?E=a.ga(Xi):y.viewportBounds.ca(b.documentPoint)||(E=y.viewportBounds,E=new jt(E.x+E.width/2,E.y+E.height/2)),E!==null&&(b.viewPoint=y.op(E),b.documentPoint=E,b.left=!1,b.right=!0,b.up=!0),y.currentTool=x,Hn(x,!1,a)}},Bt.prototype.canShowContextMenu=function(a){var y=this.diagram,x=y.toolManager.findTool("ContextMenu");return x===null?!1:(a===void 0&&(a=0<y.selection.count?y.selection.first():y),x.findObjectWithContextMenu(a)!==null)},Bt.prototype.computeEffectiveCollection=function(a,y){var x=this.diagram,b=x.toolManager.findTool("Dragging"),E=x.currentTool===b;if(y===void 0&&(y=E?b.dragOptions:x.Wm),b=new xn,a===null)return b;for(var z=a.iterator;z.next();)Ru(x,b,z.value,E,y);if(x.draggedLink!==null&&y.dragsLink)return b;for(z=a.iterator;z.next();)a=z.value,a instanceof _e&&(y=a.fromNode,y===null||b.contains(y)?(y=a.toNode,y===null||b.contains(y)||b.remove(a)):b.remove(a));return b},Oe.Object.defineProperties(Bt.prototype,{diagram:{get:function(){return this.H}},copiesClipboardData:{get:function(){return this.o},set:function(a){this.o=a}},copiesConnectedLinks:{get:function(){return this.u},set:function(a){this.u=a}},deletesConnectedLinks:{get:function(){return this.Ha},set:function(a){this.Ha=a}},copiesTree:{get:function(){return this.ia},set:function(a){this.ia=a}},deletesTree:{get:function(){return this.nb},set:function(a){this.nb=a}},copiesParentKey:{get:function(){return this.V},set:function(a){this.V=a}},copiesGroupKey:{get:function(){return this.F},set:function(a){this.F=a}},archetypeGroupData:{get:function(){return this.j},set:function(a){this.j=a}},memberValidation:{get:function(){return this.ij},set:function(a){this.ij=a}},defaultScale:{get:function(){return this.diagram.defaultScale},set:function(a){this.diagram.defaultScale=a}},zoomFactor:{get:function(){return this.Hb},set:function(a){1<a||fe("zoomFactor must be larger than 1.0, not: "+a),this.Hb=a}},isZoomToFitRestoreEnabled:{get:function(){return this.hb},set:function(a){this.hb=a}},scrollToPartPause:{get:function(){return this.ob},set:function(a){this.ob=a}}}),Bt.className="CommandHandler",Ds=function(){return new Bt};function te(){qr(this),this.l=30723,this.pb=1,this.bn="",this.Ma=this.Me=null,this.pa=new jt(NaN,NaN).freeze(),this.jd=va,this.Ab=new oi,this.wh=new oi,this.Lb=null,this.Ca=this.Kk=1,this.Kb=0,this.Kg=Zl,this.uc=new ye(NaN,NaN,NaN,NaN).freeze(),this.Ib=new ye(NaN,NaN,NaN,NaN).freeze(),this.dc=new ye(0,0,NaN,NaN).freeze(),this.ba=this.Yn=this.Zn=null,this.sk=this.Jb=vs,this.Ag=this.io=0,this.V=this.tb=this.Dh=this.A=this.Ua=null,this.Uc=!1,this.jo=this.Ng=null}var Ae,Ee,dn,gn,Fn,Xn,Pi,si,Di,hr;te.prototype.cloneProtected=function(a){a.l=this.l|6144,a.pb=this.pb,a.bn=this.bn,a.Ma=this.Ma,a.pa.assign(this.pa),a.jd=this.jd.J(),this.Lb!==null?a.Lb=this.Lb.copy():a.Lb=null,a.Ca=this.Ca,a.Kb=this.Kb,a.Kg=this.Kg.J(),a.uc.assign(this.uc),a.Ib.assign(this.Ib),a.dc.assign(this.dc),a.Yn=this.Yn,this.ba!==null&&(a.ba=this.ba.copy()),a.Jb=this.Jb.J(),a.sk=this.sk.J(),a.io=this.io,a.Ag=this.Ag,this.Ua!==null&&(a.Ua=this.Ua.copy()),this.A!==null&&(a.A=this.A.nc?this.A:this.A.copy()),this.Dh!==null&&(a.Dh=uo(this.Dh)),this.tb!==null&&(a.tb=this.tb.copy())},te.prototype.Vw=function(a){var y=this.Dh;if(Gn(y)){for(var x=0;x<y.length;x++)if(y[x]===a)return}else this.Dh=y=[];y.push(a)},te.prototype.Af=function(a){a.Zn=null,a.Ng=null,a.v()},te.prototype.clone=function(){var a=new this.constructor;if(this.cloneProtected(a),this.Dh!==null)for(var y=0;y<this.Dh.length;y++){var x=this.Dh[y];a[x]=this[x]}return a},te.prototype.copy=function(){return this.clone()},xt=te.prototype,xt.qb=function(a){a.classType===_e?a.name.indexOf("Orient")===0?this.segmentOrientation=a:fe("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===te&&(this.stretch=a)},xt.toString=function(){return qn(this.constructor)+"#"+Co(this)},xt.th=function(){this.A!==null&&(this.A.nc=!0)};function ii(a){a.A===null?a.A=new Fc:a.A.nc&&(a.A=a.A.copy())}xt.Xc=function(){if(this.ba===null){var a=new lp;a.Xi=us,a.yj=us,a.Vi=10,a.wj=10,a.Wi=0,a.xj=0,this.ba=a}},xt.cb=function(a,y,x,b,E,z,tt){var rt=this.part;if(rt!==null&&(rt.gk(a,y,x,b,E,z,tt),x===this&&a===Ur&&Hs(this)&&Br(this,rt,y),z=this.diagram,this.animationTriggers===null||z===null||!z.pi||z.undoManager.isUndoingRedoing||z.animationManager.Dm||(a=this.animationTriggers.get(y),a!==null&&z.animationManager.isEnabled&&!z.animationManager.isTicking&&(this.jo===null&&(this.jo=new xn),tt=z.undoManager.transactionLevel===0,a.startCondition===Js?tt=!0:a.startCondition===Gs&&(tt=!1),tt?(z=new lo,Ml(a,z),tt=this.jo.get(a),tt!==null&&tt.stop(),this.jo.add(a,z),z.vu=this,z.Nw=a,z.add(this,y,b,E),z.start()):(io(z.animationManager,"Trigger"),z.animationManager.defaultAnimation.add(this,y,b,E)))),this instanceof Re&&x===rt&&(rt.l&16777216)!==0&&rt.data!==null))for(x=this.O.s,b=x.length,E=0;E<b;E++)rt=x[E],rt instanceof Re&&qf(rt,function(ot){ot.data!==null&&ot.l&16777216&&ot.La(y)})};function Br(a,y,x){var b=a.ih();if(b!==null)for(var E=a.localBindings.iterator;E.next();){var z=E.value,tt=null;if(z.sourceName!==null){if(tt=kS(z,b,a),tt===null)continue;z.sp(a,tt,x,null)}else if(z.isToModel){var rt=y.diagram;rt===null||rt.skipsModelSourceBindings||z.sp(a,rt.model.modelData,x,b)}else{if(rt=b.data,rt===null)continue;var ot=y.diagram;ot===null||ot.skipsModelSourceBindings||z.sp(a,rt,x,b)}tt===a&&(rt=b.ks(z.Ai),rt!==null&&z.Mv(rt,tt,x))}}xt.ks=function(a){return this.bindingId===a?this:null},xt.g=function(a,y,x){this.cb(Ur,a,this,y,x)},xt.Ge=function(a,y,x,b){var E=this.uc;if(E.h(a,y,x,b),this.Ca!==1||this.Kb!==0){this.Lb===null&&(this.Lb=new oi);var z=this.Lb;z.reset(),this.no(z,a,y,x,b),z.pp(E)}};function hs(a,y,x,b){return a.pickable===!1?!1:(b.multiply(a.transform),x?a.Yc(y,b):a.fh(y,b))}xt.tx=function(a,y,x){if(this.pickable===!1)return!1;var b=this.naturalBounds;return y=a.Bf(y),x?gs(a.x,a.y,0,0,0,b.height)<=y||gs(a.x,a.y,0,b.height,b.width,b.height)<=y||gs(a.x,a.y,b.width,b.height,b.width,0)<=y||gs(a.x,a.y,b.width,0,0,0)<=y:a.zd(0,0)<=y&&a.zd(0,b.height)<=y&&a.zd(b.width,0)<=y&&a.zd(b.width,b.height)<=y},xt.se=function(){return!0},xt.ca=function(a){var y=jt.alloc();y.assign(a),this.transform.Ga(y);var x=this.actualBounds;if(!x.w())return jt.free(y),!1;var b=this.diagram;if(b!==null&&b.wq){var E=b.Ql("extraTouchThreshold"),z=b.Ql("extraTouchArea"),tt=z/2,rt=this.naturalBounds;b=this.Df()*b.scale;var ot=1/b;if(rt.width*b<E&&rt.height*b<E)return a=ps(x.x-tt*ot,x.y-tt*ot,x.width+z*ot,x.height+z*ot,y.x,y.y),jt.free(y),a}return E=!1,(this instanceof Bi||this instanceof Qn?ps(x.x-5,x.y-5,x.width+10,x.height+10,y.x,y.y):x.ca(y))&&(this.tb&&!this.tb.ca(y)?E=!1:this.areaBackground!==null&&x.ca(y)||this.Ma!==null&&this.dc.ca(a)?E=!0:E=this.gh(a)),jt.free(y),E},xt.gh=function(a){var y=this.naturalBounds;return ps(0,0,y.width,y.height,a.x,a.y)},xt.Re=function(a){if(this.angle===0)return this.actualBounds.Re(a);var y=this.naturalBounds;y=ye.allocAt(0,0,y.width,y.height);var x=this.transform,b=!1,E=jt.allocAt(a.x,a.y);return y.ca(x.Cd(E))&&(E.h(a.x,a.bottom),y.ca(x.Cd(E))&&(E.h(a.right,a.bottom),y.ca(x.Cd(E))&&(E.h(a.right,a.y),y.ca(x.Cd(E))&&(b=!0)))),jt.free(E),ye.free(y),b},xt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.naturalBounds,b=!1,E=jt.allocAt(0,0);return a.ca(y.Ga(E))&&(E.h(0,x.height),a.ca(y.Ga(E))&&(E.h(x.width,x.height),a.ca(y.Ga(E))&&(E.h(x.width,0),a.ca(y.Ga(E))&&(b=!0)))),jt.free(E),b},xt.Yc=function(a,y){if(y===void 0&&(y=this.transform,this.angle===0))return a.Yc(this.actualBounds);var x=this.naturalBounds,b=jt.allocAt(0,0),E=jt.allocAt(0,x.height),z=jt.allocAt(x.width,x.height),tt=jt.allocAt(x.width,0),rt=!1;if(a.ca(y.Ga(b))||a.ca(y.Ga(E))||a.ca(y.Ga(z))||a.ca(y.Ga(tt)))rt=!0;else{x=ye.allocAt(0,0,x.width,x.height);var ot=jt.allocAt(a.x,a.y);x.ca(y.Cd(ot))?rt=!0:(ot.h(a.x,a.bottom),x.ca(y.Cd(ot))?rt=!0:(ot.h(a.right,a.bottom),x.ca(y.Cd(ot))?rt=!0:(ot.h(a.right,a.y),x.ca(y.Cd(ot))&&(rt=!0)))),jt.free(ot),ye.free(x),!rt&&(ne.us(a,b,E)||ne.us(a,E,z)||ne.us(a,z,tt)||ne.us(a,tt,b))&&(rt=!0)}return jt.free(b),jt.free(E),jt.free(z),jt.free(tt),rt},xt.ga=function(a,y){if(y===void 0&&(y=new jt),a instanceof yn){var x=this.naturalBounds;y.h(a.x*x.width+a.offsetX,a.y*x.height+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},xt.mi=function(a){a===void 0&&(a=new ye);var y=this.naturalBounds,x=this.oe,b=jt.allocAt(0,0).transform(x);return a.h(b.x,b.y,0,0),b.h(y.width,0).transform(x),co(a,b.x,b.y,0,0),b.h(y.width,y.height).transform(x),co(a,b.x,b.y,0,0),b.h(0,y.height).transform(x),co(a,b.x,b.y,0,0),jt.free(b),a},xt.li=function(){var a=this.oe;return a.m11===1&&a.m12===0?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360)),a},xt.Df=function(){if(!(this.l&4096))return this.Kk;var a=this.Ca;return this.panel!==null?a*this.panel.Df():a},xt.qs=function(a,y){return y===void 0&&(y=new jt),y.assign(a),this.oe.Cd(y),y},xt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},xt.Sj=function(a,y,x,b,E){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,at=-z.m21*tt,ut=z.m11*tt,ct=tt*(z.m21*z.dy-z.m22*z.dx),mt=tt*(z.m12*z.dx-z.m11*z.dy);return this.areaBackground!==null?(z=this.actualBounds,ne.Ff(z.left,z.top,z.right,z.bottom,a,y,x,b,E)):(tt=a*rt+y*at+ct,a=a*ot+y*ut+mt,y=x*rt+b*at+ct,x=x*ot+b*ut+mt,E.h(0,0),b=this.naturalBounds,x=ne.Ff(0,0,b.width,b.height,tt,a,y,x,E),E.transform(z),x)},te.prototype.measure=function(a,y,x,b){if(Nl(this)!==!1){var E=this.Kg,z=E.right+E.left;E=E.top+E.bottom,a=Math.max(a-z,0),y=Math.max(y-E,0),x=Math.max((x||0)-z,0),b=Math.max((b||0)-E,0),z=this.angle,E=this.desiredSize;var tt=this.kq();z===90||z===270?(a=isFinite(E.height)?E.height+tt:a,y=isFinite(E.width)?E.width+tt:y):(a=isFinite(E.width)?E.width+tt:a,y=isFinite(E.height)?E.height+tt:y),E=x||0,tt=b||0;var rt=this instanceof Re;switch(Wa(this,!0)){case Ee:tt=E=0,rt&&(y=a=1/0);break;case Ae:isFinite(a)&&a>x&&(E=a),isFinite(y)&&y>b&&(tt=y);break;case gn:isFinite(a)&&a>x&&(E=a),tt=0,rt&&(y=1/0);break;case Fn:isFinite(y)&&y>b&&(tt=y),E=0,rt&&(a=1/0)}rt=this.maxSize;var ot=this.minSize;E>rt.width&&ot.width<rt.width&&(E=rt.width),tt>rt.height&&ot.height<rt.height&&(tt=rt.height),x=Math.max(E,ot.width),b=Math.max(tt,ot.height),rt.width<x&&(x=Math.min(ot.width,x)),rt.height<b&&(b=Math.min(ot.height,b)),a=Math.min(rt.width,a),y=Math.min(rt.height,y),a=Math.max(x,a),y=Math.max(b,y),(z===90||z===270)&&(z=a,a=y,y=z,z=x,x=b,b=z),this.uc.ka(),this.Wl(a,y,x,b),this.uc.freeze(),this.uc.w()||fe("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.uc.toString()),Zo(this,!1)}},te.prototype.Wl=function(){},te.prototype.Dd=function(){return!1},te.prototype.arrange=function(a,y,x,b,E){this.Uk();var z=ye.alloc();z.assign(this.Ib),this.Ib.ka(),Ma(this)===!1?this.Ib.h(a,y,x,b):this.eh(a,y,x,b),this.Ib.freeze(),E===void 0?this.tb=null:this.tb=E,x=!1,E!==void 0?x=!0:(E=this.panel,E!==null&&Md(E)&&(E=E.panel),E!==null&&(E=E.dc,b=this.measuredBounds,this.areaBackground!==null&&(b=this.Ib),x=y+b.height,b=a+b.width,x=!(0<=a+.05&&b<=E.width+.05&&0<=y+.05&&x<=E.height+.05),this instanceof Mr&&(a=this.naturalBounds,this.Lq>a.height||this.Cb>a.width))&&(x=!0)),this.l=x?this.l|256:this.l&-257,this.Ib.w()||fe("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ib.toString()),this.Xl(z,this.Ib),Ch(this,!1),ye.free(z)},xt=te.prototype,xt.eh=function(){};function fa(a,y,x,b,E){if(a.Ib.h(y,x,b,E),!a.desiredSize.w()){var z=a.uc;x=a.Kg,y=x.right+x.left;var tt=x.top+x.bottom;switch(x=z.width+y,z=z.height+tt,b+=y,E+=tt,y=Wa(a,!0),x===b&&z===E&&(y=Ee),y){case Ee:(x>b||z>E)&&(Zo(a,!0),a.measure(x>b?b:x,z>E?E:z,0,0));break;case Ae:Zo(a,!0),a.measure(b,E,0,0);break;case gn:Zo(a,!0),a.measure(b,z,0,0);break;case Fn:Zo(a,!0),a.measure(x,E,0,0)}}}xt.Xl=function(a,y){var x=this.part;x!==null&&x.diagram!==null&&(x.selectionObject!==this&&x.resizeObject!==this&&x.rotateObject!==this||jv(x,!0),this.N(),os(a,y)||(x.oh(),this.Pn(x)))},xt.Pn=function(a){this.portId!==null&&(jv(a,!0),a instanceof $e&&V1(a,this))},xt.gc=function(a,y){if(!zl(this,a,y)&&this.visible){var x=this.opacity;if(x!==0){var b=1;x!==1&&(b=a.globalAlpha,a.globalAlpha=b*x);var E="";this.filter!==""&&(E=a.filter,a.filter=this.filter);var z=this instanceof Re&&Md(this),tt=this.Ib;if(z){var rt=this.Ib,ot=this.dc,at=this.areaBackground,ut=this.Ma;at===null&&ut===null||a.yc(),at!==null&&(wo(this,a,at,!0,!0,ot,rt),at instanceof er&&at.type===Hl?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(at)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),ut!==null&&(wo(this,a,ut,!0,!1,ot,rt),ut instanceof er&&ut.type===Hl?(a.beginPath(),a.rect(rt.x,rt.y,rt.width,rt.height),a.ng(ut)):a.fillRect(rt.x,rt.y,rt.width,rt.height)),this.hh(a,y)}if(!z&&(z||tt.width!==0&&tt.height!==0&&!isNaN(tt.x)&&!isNaN(tt.y))){z=this.transform,rt=this.panel,this.l&4096&&Os(this),at=this.part,ot=!1;var ct=0;at&&y.Gf("drawShadows")&&(ot=at.isShadowed)&&(ut=at.shadowOffset,ct=Math.max(ut.y,ut.x)*y.scale*y.Mb),ut=this.Dd();var mt;if(!(mt=y.$i||!ut)){var yt=this.naturalBounds;mt=this.wh;var St=mt.m11,Lt=mt.m21,Ot=mt.dx,Dt=mt.m12,Gt=mt.m22,Vt=mt.dy,Yt,qt=Yt=0;mt=Yt*St+qt*Lt+Ot;var ae=Yt*Dt+qt*Gt+Vt;Yt=yt.width+ct,qt=0;var Je=Yt*St+qt*Lt+Ot;Yt=Yt*Dt+qt*Gt+Vt,qt=Math.min(mt,Je);var un=Math.min(ae,Yt),nn=Math.max(mt+0,Je)-qt,Ge=Math.max(ae+0,Yt)-un;mt=qt,ae=un,Yt=yt.width+ct,qt=yt.height+ct,Je=Yt*St+qt*Lt+Ot,Yt=Yt*Dt+qt*Gt+Vt,qt=Math.min(mt,Je),un=Math.min(ae,Yt),nn=Math.max(mt+nn,Je)-qt,Ge=Math.max(ae+Ge,Yt)-un,mt=qt,ae=un,Yt=0,qt=yt.height+ct,Je=Yt*St+qt*Lt+Ot,Yt=Yt*Dt+qt*Gt+Vt,qt=Math.min(mt,Je),un=Math.min(ae,Yt),nn=Math.max(mt+nn,Je)-qt,Ge=Math.max(ae+Ge,Yt)-un,mt=qt,ae=un,ct=y.viewportBounds,yt=ct.x,St=ct.y,mt=!(mt>ct.width+yt||yt>nn+mt||ae>ct.height+St||St>Ge+ae)}if(mt){if(mt=(this.l&256)!==0,a.clipInsteadOfFill&&(mt=!1),this instanceof Mr&&(a.font=this.font),mt){if(ae=rt.se()?rt.naturalBounds:rt.actualBounds,nn=Math.max(tt.x,ae.x),Ge=Math.max(tt.y,ae.y),ct=Math.min(tt.right,ae.right)-nn,yt=Math.min(tt.bottom,ae.bottom)-Ge,St=this.tb,St!==null&&(nn=St.x,Ge=St.y,ct=St.width,yt=St.height),nn>tt.width+tt.x||tt.x>ae.width+ae.x){x!==1&&(a.globalAlpha=b),this.filter!==""&&(a.filter=E);return}a.save(),a.beginPath(),a.rect(nn,Ge,ct,yt),a.clip()}if(ut){if(!at.isVisible()){x!==1&&(a.globalAlpha=b),this.filter!==""&&(a.filter=E);return}ot&&(ae=at.shadowOffset,a.Ev(ae.x*y.scale*this.scale*y.Mb,ae.y*y.scale*this.scale*y.Mb,at.shadowBlur),Qh(a),a.shadowColor=at.shadowColor)}ot&&this.shadowVisible===!0?Qh(a):ot&&this.shadowVisible===!1&&Lh(a),at=this.naturalBounds,this.areaBackground!==null&&(a.yc(),Tl(this,a,at,tt)),a.transform(z.m11,z.m12,z.m21,z.m22,z.dx,z.dy),ot&&Ms(this,rt)&&this.shadowVisible===null&&Lh(a),this.Ma!==null&&(a.yc(),rl(this,a,at,tt)),ot&&(this.Ma!==null||this.areaBackground!==null||Ms(this,rt))?(vu(this,!0),this.shadowVisible===null&&Lh(a)):vu(this,!1),this.hh(a,y),ot&&this.l&512&&Qh(a),ut&&ot&&Lh(a),mt&&(a.restore(),a.Vc(this instanceof Re)),z.ws()||(y=1/(z.m11*z.m22-z.m12*z.m21),a.transform(z.m22*y,-z.m12*y,-z.m21*y,z.m11*y,y*(z.m21*z.dy-z.m22*z.dx),y*(z.m12*z.dx-z.m11*z.dy)))}}x!==1&&(a.globalAlpha=b),this.filter!==""&&(a.filter=E)}}};function Ms(a,y){return y===null?!1:(Md(y)&&(y=y.panel),(y.l&512)!==0||(y.type===Re.Auto||y.type===Re.Spot)&&y.Pb()!==a)}xt.Dv=function(){};function Tl(a,y,x,b){wo(a,y,a.areaBackground,!0,!0,x,b),a.areaBackground instanceof er&&a.areaBackground.type===Hl?(y.beginPath(),y.rect(b.x,b.y,b.width,b.height),y.ng(a.areaBackground)):y.fillRect(b.x,b.y,b.width,b.height)}function rl(a,y,x,b){var E=a.kq(),z=x.x,tt=x.y,rt=x.width+E,ot=x.height+E;wo(a,y,a.Ma,!0,!1,x,b),a.Ma instanceof er&&a.Ma.type===Hl?(y.beginPath(),y.rect(z-E/2,tt-E/2,rt,ot),y.ng(a.Ma)):y.fillRect(z-E/2,tt-E/2,rt,ot)}function ra(a,y,x){for(var b=y.O.s,E=b.length,z=-1,tt=0;tt<E;tt++)if(b[tt]===a){z=tt;break}if(a=z,a!==-1)if(a===0)y.svg.gd?y.svg.gd.after(x):y.svg.Ma?y.svg.Ma.after(x):y.type===Re.Table?(y=y.svg.getElementsByClassName("gojs-ts"),y=y.length!==0?y[0]:null,y!==null&&y.after(x)):y.svg.prepend(x);else{for(;a!==0&&!y.M(a-1).Ed();)a--;a===0?y.svg.prepend(x):(a=y.M(a-1).svg,a!==null?a.after(x):y.svg.appendChild(x))}}function zl(a,y,x){if(!(y instanceof pl))return!1;if(!a.visible||a.opacity===0||a.Dd()&&!a.isVisible())return a.svg!==null&&a.svg.parentNode!==null&&a.svg.remove(),!0;var b=a.panel,E=a.nk(y);if(a.kk(y,x,E))return a.svg.parentElement!==null?(a.Dd()&&(y.ti=a.svg),!0):(a.Dd()?(y.ti!==null?y.ti.after(a.svg):y.Nj.prepend(a.svg),y.ti=a.svg):b&&ra(a,b,a.svg),!0);if(a.Dd()&&a.isShadowed){var z=a.shadowOffset;y.Ev(z.x*x.scale*a.scale*x.Mb,z.y*x.scale*a.scale*x.Mb,a.shadowBlur),Qh(y),y.shadowColor=a.shadowColor}a instanceof Mr&&(y.font=a.font),y.yd=null;var tt=a.transform;z=a instanceof Re;var rt=a instanceof Re?Md(a):!1;a.l&4096&&Os(a);var ot=a.Ib;if(y.rb.ha=[1,0,0,1,0,0],y.o=!1,E&&(y.o=!0,z&&rt?(up(y,1,0,0,1,0,0),a.svg=y.ad):z?(up(y,tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy),a.svg=y.ad):up(y,1,0,0,1,0,0)),E=a.naturalBounds,a.areaBackground!==null){var at=tt.copy().Vj();y.rb.ha=[at.m11,at.m12,at.m21,at.m22,at.dx,at.dy],Tl(a,y,E,ot),y.rb.ha=[1,0,0,1,0,0],y.yd.gd=y.ad,y.yd.prepend(y.ad)}return z||(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),a.background!==null&&(z?(rt&&(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy]),rl(a,y,E,ot),rt&&(y.rb.ha=[1,0,0,1,0,0])):(y.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],rl(a,y,E,ot)),y.yd.Ma=y.ad,y.yd.prepend(y.ad)),tt=y.yd,E=a.part,rt=!1,E&&x.Gf("drawShadows")&&(rt=E.isShadowed),y.clipInsteadOfFill&&(rt=!1),a.Dd()&&rt&&Qh(y),rt&&a.shadowVisible===!0?Qh(y):rt&&a.shadowVisible===!1&&Lh(y),E=a.panel,rt&&Ms(a,E)&&a.shadowVisible===null&&Lh(y),y.Il&&(at=x.computePixelRatio(),at="drop-shadow("+y.shadowOffsetX/at+"px "+y.shadowOffsetY/at+"px "+y.shadowBlur/at/2+"px "+y.shadowColor+")",a.background!==null&&tt.Ma.setAttributeNS(null,"filter",at),a.areaBackground!==null&&tt.gd.setAttributeNS(null,"filter",at)),rt&&(a.Ma!==null||a.areaBackground!==null||Ms(a,E))?(vu(a,!0),a.shadowVisible===null&&Lh(y)):vu(a,!1),E=rt,a.hh(y,x),z&&y.nh.pop(),y.o&&y.nh.pop(),tt=y.Gv.hs,rt=z?a.svg:y.yd,at=a.svg,!z&&at!==null&&rt!==at&&at.parentNode===a.panel.svg?(a.svg.replaceWith(rt),a.svg=rt,rt!==null&&a.$o(y,b,ot,rt),Va(y,at),!0):(a.svg=rt,tt!==null&&rt===null&&(cm(y),y.nh.pop()),rt===null||(a.$o(y,b,ot,rt),y.Il&&(x=x.computePixelRatio(),a.Dv(rt,"drop-shadow("+y.shadowOffsetX/x+"px "+y.shadowOffsetY/x+"px "+y.shadowBlur/x/2+"px "+y.shadowColor+")")),E&&a.l&512&&Qh(y),a.Dd()&&Lh(y),x=a.Dd()?a.opacity*y.globalAlpha:a.opacity,x!==1&&rt.setAttributeNS(null,"opacity",x.toString()),a.filter!==""&&rt.setAttributeNS(null,"filter",a.filter),a.Dd()?(y.ti?y.ti.after(rt):y.Nj.prepend(rt),y.ti=rt):b!==null&&ra(a,b,rt),tt!==null&&tt(a,rt)),!0)}xt.$o=function(a,y,x,b){var E=(this.l&256)!==0;if(a.clipInsteadOfFill&&(E=!1),E){var z=y.se()?y.naturalBounds:y.actualBounds;y=Math.max(x.x,z.x),E=Math.max(x.y,z.y);var tt=Math.min(x.right,z.right)-y;x=Math.min(x.bottom,z.bottom)-E,z=this.tb,z!==null&&(y=z.x,E=z.y,tt=z.width,x=z.height),z=b.getAttribute("clip-path");var rt=null;z!==null&&(rt=a.svg.getElementById(z.split("#")[1].slice(0,-1))),rt===null?(z="CLIP"+hl++,rt=a.Ud("clipPath",{id:z}),y=a.Ud("rect",{x:y,y:E,width:tt,height:x}),this instanceof Re&&(E=this.transform.copy().Vj(),y.setAttribute("transform","matrix("+E.m11+", "+E.m12+", "+E.m21+", "+E.m22+", "+E.dx+", "+E.dy+")")),rt.appendChild(y),a.svg.appendChild(rt),b.setAttributeNS(null,"clip-path","url(#"+z+")")):(a=rt.firstElementChild,a.setAttribute("x",y.toString()),a.setAttribute("y",E.toString()),a.setAttribute("width",tt.toString()),a.setAttribute("height",x.toString()))}else b.removeAttributeNS(null,"clip-path"),Va(a,b)};function Va(a,y){y=y.getAttribute("clip-path"),y!==null&&(a=a.svg.getElementById(y.split("#")[1].slice(0,-1)),a!==null&&a.remove())}function oa(a){if(a.svg!==null){var y=a.svg.innerHTML.match(/url\(#((CLIP|GRAD).+?)\)/g),x=a.svg.ownerDocument;if(y!==null){y=mn(y);for(var b=y.next();!b.done;b=y.next())b=x.getElementById(b.value.split("#")[1].slice(0,-1)),b!==null&&b.remove()}a.svg.remove()}}xt.hh=function(){},xt.lv=function(){this.Uc=!0},xt.kk=function(a,y,x){if(this.Uc)return this.lv(),this.Uc=!1;if(y=this.svg,y===null)return!1;if(!this.visible)return y.remove(),!1;if(y.nodeName!=="g"&&x||y.nodeName==="g"&&!x)return!1;var b=this.transform,E=this instanceof Re?Md(this):!1;if(!(this instanceof Re&&E))if(this instanceof Ka){var z=this.bt;a.rb.ha=[b.m11,b.m12,b.m21,b.m22,b.dx,b.dy],z!==null&&Zy(a,z[0],z[1],z[2],z[3],z[4],z[5],z[6],z[7]),x?y.lastElementChild.setAttributeNS(null,"transform",Jy(a)):y.setAttributeNS(null,"transform",Jy(a))}else if(!x||this instanceof Re)y.setAttributeNS(null,"transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")");else if(this instanceof Qn){z=y.getElementsByTagName("path");for(var tt=0;tt<z.length;tt++)z[tt].setAttributeNS(null,"transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")")}else y.lastElementChild.setAttributeNS(null,"transform","matrix("+b.m11+", "+b.m12+", "+b.m21+", "+b.m22+", "+b.dx+", "+b.dy+")");return z=this.Dd()?this.opacity*a.globalAlpha:this.opacity,z===1?y.removeAttribute("opacity"):y.setAttributeNS(null,"opacity",z.toString()),a.rb.ha=[1,0,0,1,0,0],(this.areaBackground!==null||y.gd!==void 0)&&(z=y.gd,this.areaBackground===null?(y.gd.remove(),y.gd=void 0):(tt=b.copy().Vj(),a.rb.ha=[tt.m11,tt.m12,tt.m21,tt.m22,tt.dx,tt.dy],Tl(this,a,this.naturalBounds,this.actualBounds),a.rb.ha=[1,0,0,1,0,0],y.gd?(tt=y.gd.getAttribute("filter"),tt!==null&&a.ad.setAttribute("filter",tt),y.gd.replaceWith(a.ad)):y.prepend(a.ad),y.gd=a.ad),z&&gm(a,z)),(this.background!==null||y.Ma!==void 0)&&(z=y.Ma,this.background===null?(gm(a,y.Ma),y.Ma.remove(),y.Ma=void 0):((E||x&&!(this instanceof Re))&&(a.rb.ha=[b.m11,b.m12,b.m21,b.m22,b.dx,b.dy]),rl(this,a,this.naturalBounds,this.actualBounds),y.Ma?(gm(a,y.Ma),x=y.Ma.getAttribute("filter"),x!==null&&a.ad.setAttribute("filter",x),y.Ma.replaceWith(a.ad)):y.prepend(a.ad),y.Ma=a.ad),z&&gm(a,z)),this.$o(a,this.panel,this.actualBounds,y),!0},xt.nk=function(a){if(this.background!==null||this.areaBackground!==null)return!0;var y=(this.l&256)!==0;return a.clipInsteadOfFill&&(y=!1),!!y};function wo(a,y,x,b,E,z,tt){if(x!==null){var rt=1,ot=1;if(typeof x=="string")b?y.fillStyle=x:y.strokeStyle=x;else if(x.type===Ld)b?y.fillStyle=x.color:y.strokeStyle=x.color;else{var at=a.kq();if(rt=z.width,ot=z.height,E?(rt=tt.width,ot=tt.height):b||(rt+=at,ot+=at),(z=y instanceof $f)&&x.xe&&(x.type===pg||x.yk===rt&&x.ft===ot))var ut=x.xe;else{var ct=0,mt=0,yt=0,St=0,Lt=0,Ot=0;if(Ot=Lt=0,E?(Lt=tt.x,Ot=tt.y):b||(Lt-=at/2,Ot-=at/2),ct=x.start.x*rt+x.start.offsetX,mt=x.start.y*ot+x.start.offsetY,yt=x.end.x*rt+x.end.offsetX,St=x.end.y*ot+x.end.offsetY,ct+=Lt,yt+=Lt,mt+=Ot,St+=Ot,x.type===qh)ut=y.createLinearGradient(ct,mt,yt,St);else if(x.type===Hl)Ot=isNaN(x.endRadius)?Math.max(rt,ot)/2:x.endRadius,isNaN(x.startRadius)?(Lt=0,Ot=Math.max(rt,ot)/2):Lt=x.startRadius,ut=y.createRadialGradient(ct,mt,Lt,yt,St,Ot);else if(x.type===pg)try{ut=y.createPattern(x.pattern,"repeat")}catch(Gt){ut=null}if(x.type!==pg&&(E=x.colorStops,E!==null))for(E=E.iterator;E.next();)ut.addColorStop(E.key,E.value);if(z&&(x.xe=ut,ut!==null&&(x.yk=rt,x.ft=ot),ut===null&&x.type===pg&&x.yk!==-1)){x.yk=-1;var Dt=a.diagram;Dt!==null&&x.yk===-1&&Oi(function(){Dt.redraw()},600)}}b?y.fillStyle=ut:y.strokeStyle=ut}}}xt.rg=function(a){if(a instanceof Re)t:{if(this!==a&&a!==null)for(var y=this.panel;y!==null;){if(y===a){a=!0;break t}y=y.panel}a=!1}else a=!1;return a},xt.Ed=function(){if(!this.visible)return!1;var a=this.panel;return a!==null?a.Ed():!0},xt.If=function(){for(var a=this instanceof Re?this:this.panel;a!==null&&a.isEnabled;)a=a.panel;return a===null};function Os(a){if(a.l&2048){var y=a.Ab;if(y.reset(),!a.Ib.w()||!a.uc.w()){nu(a,!1);return}if(y.translate(a.Ib.x-a.uc.x,a.Ib.y-a.uc.y),a.scale!==1||a.angle!==0){var x=a.naturalBounds;a.no(y,x.x,x.y,x.width,x.height)}nu(a,!1),Gl(a,!0)}a.l&4096&&(y=a.panel,y===null?(a.wh.set(a.Ab),a.Kk=a.scale,Gl(a,!1)):y.oe!==null&&(x=a.wh,x.reset(),y.se()?x.multiply(y.wh):y.panel!==null&&x.multiply(y.panel.wh),x.multiply(a.Ab),a.Kk=a.scale*y.Kk,Gl(a,!1)))}xt.no=function(a,y,x,b,E){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=jt.alloc();z.yi(y,x,b,E,Xi),a.rotate(this.Kb,z.x,z.y),jt.free(z)}},xt.v=function(a){if(!Nl(this)){a===void 0&&(a=!1),Zo(this,!0),Ch(this,!0);var y=this.panel;y===null||a||y.v()}},xt.Uj=function(){Nl(this)||(Zo(this,!0),Ch(this,!0))};function La(a){if(!Ma(a)){var y=a.panel;y!==null?y.v():a.Dd()&&(y=a.diagram,y!==null&&(y.De.add(a),a instanceof $e&&a.Bd(),y.$b())),Ch(a,!0)}}xt.Uk=function(){!(this.l&2048)&&(nu(this,!0),Gl(this,!0))},xt.Wu=function(){Gl(this,!0)},xt.N=function(){var a=this.part;a!==null&&a.N()};function Wa(a,y){var x=a.stretch,b=a.panel;return b!==null&&b.type===Re.Table?ju(a,b.Fb(a.row),b.Eb(a.column),y):b!==null&&b.type===Re.Auto&&b.Pb()===a?ks(a,Ae,y):x===Xn?b!==null?b.type===Re.Spot&&b.Pb()===a?ks(a,Ae,y):(x=b.defaultStretch,x===Xn?ks(a,Ee,y):ks(a,x,y)):ks(a,Ee,y):ks(a,x,y)}function ju(a,y,x,b){var E=a.stretch;if(E!==Xn)return ks(a,E,b);var z=E=null;switch(y.stretch){case Fn:z=!0;break;case Ae:z=!0}switch(x.stretch){case gn:E=!0;break;case Ae:E=!0}return y=a.panel.defaultStretch,E===null&&(E=y===gn||y===Ae),z===null&&(z=y===Fn||y===Ae),E===!0&&z===!0?ks(a,Ae,b):E===!0?ks(a,gn,b):z===!0?ks(a,Fn,b):ks(a,Ee,b)}function ks(a,y,x){if(x)return y;if(y===Ee||(x=a.desiredSize,x.w()))return Ee;if(a=a.angle,!isNaN(x.width))if(a!==90&&a!==270){if(y===gn)return Ee;if(y===Ae)return Fn}else{if(y===Fn)return Ee;if(y===Ae)return gn}if(!isNaN(x.height))if(a!==90&&a!==270){if(y===Fn)return Ee;if(y===Ae)return gn}else{if(y===gn)return Ee;if(y===Ae)return Fn}return y}function vu(a,y){a.l=y?a.l|512:a.l&-513}function Hs(a){return(a.l&1024)!==0}function Ec(a,y){a.l=y?a.l|1024:a.l&-1025}function nu(a,y){a.l=y?a.l|2048:a.l&-2049}function Gl(a,y){a.l=y?a.l|4096:a.l&-4097}function Nl(a){return(a.l&8192)!==0}function Zo(a,y){a.l=y?a.l|8192:a.l&-8193}function Ma(a){return(a.l&16384)!==0}function Ch(a,y){a.l=y?a.l|16384:a.l&-16385}xt.Gj=function(){this.svg=null},xt.wi=function(a){this.Me=a,this.svg!==null&&this.svg.remove()},xt.Av=function(){},xt.zv=function(a){return this.pa=a,La(this),!0},xt.mm=function(a,y){(this.pa.x!==a||this.pa.y!==y)&&(this.pa.h(a,y),this.Uk())},xt.kq=function(){return 0};function Jf(a){var y=a.part;if(y instanceof $e&&(a.portId!==null||a===y.port)){var x=y.diagram;x===null||x.undoManager.isUndoingRedoing||V1(y,a)}}function Yy(a){var y=a.diagram;y===null||y.undoManager.isUndoingRedoing||(a instanceof Re?a instanceof $e?a.Bd():a.qm(a,function(x){Jf(x)}):Jf(a))}xt.bind=function(a,y,x,b){var E=null;return typeof a=="string"?E=new Vo(a,y,x,b):E=a,E.xd=this,a=this.ih(),a!==null&&f1(a)&&fe("Cannot add a Binding to a template that has already been copied: "+E),this.localBindings===null&&(this.localBindings=new Ve),this.localBindings.add(E),this},xt.set=function(a){return Object.assign(this,a),this},xt.Du=function(a){return nv(this,a),this},xt.apply=function(a){return a(this),this},xt.nm=function(a){return yd(this,a),this},xt.pz=function(){return this.ih()},xt.ih=function(){for(var a=this instanceof Re?this:this.panel;a!==null;){if(a.allBindings!==null)return a;a=a.panel}return null},xt.Jv=function(a){return a.xd=this,this.animationTriggers===null&&(this.animationTriggers=new xn),this.animationTriggers.add(a.propertyName,a),this};function _l(a,y){for(var x=1;x<arguments.length;++x);x=arguments;var b=null,E=null;if(typeof a=="function")E=a;else if(typeof a=="string"){var z=ug.I(a);typeof z=="function"?(x=uo(arguments),b=z(x),Ue(b)||fe('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):E=xe.go[a]}if(b===null&&(E!=null&&E.constructor||fe("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),b=new E),E=1,b instanceof se&&1<x.length){z=b;var tt=x[1];(typeof tt=="string"||tt instanceof HTMLDivElement)&&($i(z,tt),E++)}for(;E<x.length;E++)z=x[E],z===void 0?fe("Undefined value at argument "+E+" for object being constructed by GraphObject.make: "+b):nv(b,z);return b}function nv(a,y){if(typeof y=="string")if(a instanceof Mr)a.text=y;else if(a instanceof Qn)a.figure=y;else if(a instanceof Ka)a.source=y;else if(a instanceof Re)y=yu.I(y),y!==null&&(a.type=y);else if(a instanceof er){var x=xi(er,y);x!==null?a.type=x:fe("Unknown Brush type as an argument to GraphObject.make: "+y)}else a instanceof We?(y=xi(We,y),y!==null&&(a.type=y)):a instanceof Ni&&(y=xi(Ni,y),y!==null&&(a.type=y));else if(y instanceof te)a instanceof Re||fe("A GraphObject can only be added to a Panel, not to: "+a),a.add(y);else if(y instanceof Jo){var b;y.isRow&&typeof a.getRowDefinition=="function"?b=a.getRowDefinition(y.index):y.isRow||typeof a.getColumnDefinition!="function"||(b=a.getColumnDefinition(y.index)),b instanceof Jo?Tm(b,y):fe("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(y instanceof me)typeof a.qb=="function"&&a.qb(y);else if(y instanceof es)a.type=y;else if(y instanceof Vo)a instanceof te||a instanceof Jo?a.bind(y):fe("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(y instanceof Yo)a instanceof te?a.Jv(y):fe("An AnimationTrigger can only be applied to a GraphObject, not to: "+a);else if(y instanceof qo)a instanceof We&&a.type===We.o?a.figures.add(y):fe("A PathFigure can only be added to a Path Geometry, not to: "+a);else if(y instanceof Ni)a instanceof qo?a.segments.add(y):fe("A PathSegment can only be added to a PathFigure, not to: "+a);else if(y instanceof Zr)a instanceof se||a instanceof Yn?a.layout=y:fe("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(y))for(x=0;x<y.length;x++)nv(a,y[x]);else if(typeof y=="object"&&y!==null)if(a instanceof er){x=new ai;for(var E in y)b=parseFloat(E),isNaN(b)?x[E]=y[E]:a.addColorStop(b,y[E]);yd(a,x)}else if(a instanceof Jo){y.row!==void 0?(E=y.row,(E==null||E===1/0||isNaN(E)||0>E)&&fe("Must specify non-negative integer row for RowColumnDefinition "+y+", not: "+E),a.isRow=!0,a.index=E):y.column!==void 0&&(E=y.column,(E==null||E===1/0||isNaN(E)||0>E)&&fe("Must specify non-negative integer column for RowColumnDefinition "+y+", not: "+E),a.isRow=!1,a.index=E),E=new ai;for(x in y)x!=="row"&&x!=="column"&&(E[x]=y[x]);yd(a,E)}else yd(a,y);else fe('Unknown initializer "'+y+'" for object being constructed by GraphObject.make: '+a)}function Cd(a,y){ug.add(a,y)}function fm(a,y,x){x===void 0&&(x=null);var b=a[1];if(typeof x=="function"?x(b):typeof b=="string")return a.splice(1,1),b;if(y===void 0)throw Error("no "+(typeof x=="function"?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return y}Oe.Object.defineProperties(te.prototype,{bindingId:{get:function(){return this.A!==null?this.A.zp:-1},set:function(a){this.bindingId!==a&&(this.A===null&&(this.A=new Fc),this.A.zp=a)}},localBindings:{get:function(){return this.A!==null?this.A.te:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new Fc),this.A.te=a)}},srcBindings:{get:function(){return this.A!==null?this.A.wm:null},set:function(a){this.srcBindings!==a&&(this.A===null&&(this.A=new Fc),this.A.wm=a)}},shadowVisible:{get:function(){return this.A!==null?this.A.Ci:null},set:function(a){var y=this.shadowVisible;y!==a&&(ii(this),this.A.Ci=a,this.Uc=!0,this.N(),this.g("shadowVisible",y,a))}},enabledChanged:{get:function(){return this.A!==null?this.A.Hb:null},set:function(a){var y=this.enabledChanged;y!==a&&(ii(this),this.A.Hb=a,this.g("enabledChanged",y,a))}},segmentOrientation:{get:function(){return this.Ua!==null?this.Ua.rr:Ea},set:function(a){var y=this.segmentOrientation;y!==a&&(this.Ua===null&&(this.Ua=new rf),this.Ua.rr=a,this.v(),this.g("segmentOrientation",y,a),a===Ea&&(this.angle=0))}},segmentIndex:{get:function(){return this.Ua!==null?this.Ua.u:-1/0},set:function(a){a=Math.round(a);var y=this.segmentIndex;y!==a&&(this.Ua===null&&(this.Ua=new rf),this.Ua.u=a,this.v(),this.g("segmentIndex",y,a))}},segmentFraction:{get:function(){return this.Ua!==null?this.Ua.o:0},set:function(a){isNaN(a)||0>a?a=0:1<a&&(a=1);var y=this.segmentFraction;y!==a&&(this.Ua===null&&(this.Ua=new rf),this.Ua.o=a,this.v(),this.g("segmentFraction",y,a))}},segmentOffset:{get:function(){return this.Ua!==null?this.Ua.F:cs},set:function(a){var y=this.segmentOffset;y.D(a)||(a=a.J(),this.Ua===null&&(this.Ua=new rf),this.Ua.F=a,this.v(),this.g("segmentOffset",y,a))}},stretch:{get:function(){return this.A!==null?this.A.hg:Xn},set:function(a){var y=this.stretch;y!==a&&(ii(this),this.A.hg=a,this.v(),this.g("stretch",y,a))}},name:{get:function(){return this.A!==null?this.A.xa:""},set:function(a){var y=this.name;y!==a&&(ii(this),this.A.xa=a,this.part!==null&&(this.part.Rh=null),this.g("name",y,a))}},opacity:{get:function(){return this.pb},set:function(a){var y=this.pb;y!==a&&((0>a||1<a)&&ri(a,"0 <= value <= 1",te,"opacity"),this.pb=a,this.g("opacity",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(nc(y,y.actualBounds)))}},filter:{get:function(){return this.bn},set:function(a){var y=this.bn;y!==a&&(this.bn=a,this.Uc=!0,this.g("filter",y,a),a=this.diagram,y=this.part,a!==null&&y!==null&&a.N(nc(y,y.actualBounds)))}},visible:{get:function(){return(this.l&1)!==0},set:function(a){var y=(this.l&1)!==0;y!==a&&(this.l^=1,this.g("visible",y,a),y=this.panel,y!==null?y.v():this.Dd()&&this.Zb(a),this.N(),Yy(this))}},pickable:{get:function(){return(this.l&2)!==0},set:function(a){var y=(this.l&2)!==0;y!==a&&(this.l^=2,this.g("pickable",y,a))}},fromLinkableDuplicates:{get:function(){return(this.l&4)!==0},set:function(a){var y=(this.l&4)!==0;y!==a&&(this.l^=4,this.g("fromLinkableDuplicates",y,a))}},fromLinkableSelfNode:{get:function(){return(this.l&8)!==0},set:function(a){var y=(this.l&8)!==0;y!==a&&(this.l^=8,this.g("fromLinkableSelfNode",y,a))}},toLinkableDuplicates:{get:function(){return(this.l&16)!==0},set:function(a){var y=(this.l&16)!==0;y!==a&&(this.l^=16,this.g("toLinkableDuplicates",y,a))}},toLinkableSelfNode:{get:function(){return(this.l&32)!==0},set:function(a){var y=(this.l&32)!==0;y!==a&&(this.l^=32,this.g("toLinkableSelfNode",y,a))}},isPanelMain:{get:function(){return(this.l&64)!==0},set:function(a){var y=(this.l&64)!==0;y!==a&&(this.l^=64,this.v(),this.g("isPanelMain",y,a))}},isActionable:{get:function(){return(this.l&128)!==0},set:function(a){var y=(this.l&128)!==0;y!==a&&(this.l^=128,this.g("isActionable",y,a))}},areaBackground:{get:function(){return this.A!==null?this.A.gd:null},set:function(a){var y=this.areaBackground;y!==a&&(a!==null&&Nc(a,"GraphObject.areaBackground"),a instanceof er&&a.freeze(),ii(this),this.A.gd=a,this.N(),this.g("areaBackground",y,a))}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&Nc(a,"GraphObject.background"),a instanceof er&&a.freeze(),this.Ma=a,this.N(),this.g("background",y,a))}},part:{get:function(){if(this.Dd())return this;if(this.Ng!==null)return this.Ng;var a;for(a=this.panel;a;){if(a instanceof vn)return this.Ng=a;a=a.panel}return null}},svg:{get:function(){return this.V},set:function(a){this.V=a}},panel:{get:function(){return this.Me}},layer:{get:function(){var a=this.part;return a!==null?a.layer:null}},diagram:{get:function(){var a=this.part;return a!==null?a.diagram:null}},position:{get:function(){return this.pa},set:function(a){var y=a.x,x=a.y,b=this.pa,E=b.x;b=b.y,(E===y||isNaN(E)&&isNaN(y))&&(b===x||isNaN(b)&&isNaN(x))?this.Av():(a=a.copy(),this.zv(a,E,b)&&this.g("position",new jt(E,b),a))}},actualBounds:{get:function(){return this.Ib}},scale:{get:function(){return this.Ca},set:function(a){var y=this.Ca;y!==a&&(0>=a&&fe("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ca=a,this.v(),this.g("scale",y,a))}},angle:{get:function(){return this.Kb},set:function(a){var y=this.Kb;y!==a&&(a%=360,0>a&&(a+=360),y!==a&&(this.Kb=a,Yy(this),this.v(),this.g("angle",y,a)))}},desiredSize:{get:function(){return this.jd},set:function(a){var y=a.width,x=a.height,b=this.jd,E=b.width,z=b.height;(E===y||isNaN(E)&&isNaN(y))&&(z===x||isNaN(z)&&isNaN(x))||(this.jd=a=a.J(),this.v(),this instanceof Qn&&this.qc(),this.g("desiredSize",b,a),Hs(this)&&(a=this.part,a!==null&&(Br(this,a,"width"),Br(this,a,"height"))))}},width:{get:function(){return this.jd.width},set:function(a){var y=this.jd.width;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new Ze(a,this.jd.height).freeze(),this.v(),this instanceof Qn&&this.qc(),this.g("desiredSize",y,a),Hs(this)&&(a=this.part,a!==null&&Br(this,a,"width")))}},height:{get:function(){return this.jd.height},set:function(a){var y=this.jd.height;y===a||isNaN(y)&&isNaN(a)||(y=this.jd,this.jd=a=new Ze(this.jd.width,a).freeze(),this.v(),this instanceof Qn&&this.qc(),this.g("desiredSize",y,a),Hs(this)&&(a=this.part,a!==null&&Br(this,a,"height")))}},minSize:{get:function(){return this.A!==null?this.A.u:Rr},set:function(a){var y=this.minSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),ii(this),this.A.u=a,this.v(),this.g("minSize",y,a))}},maxSize:{get:function(){return this.A!==null?this.A.o:Es},set:function(a){var y=this.maxSize;y.D(a)||(a=a.copy(),isNaN(a.width)&&(a.width=1/0),isNaN(a.height)&&(a.height=1/0),a.freeze(),ii(this),this.A.o=a,this.v(),this.g("maxSize",y,a))}},measuredBounds:{get:function(){return this.uc}},naturalBounds:{get:function(){return this.dc}},margin:{get:function(){return this.Kg},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.Kg;y.D(a)||(this.Kg=a=a.J(),this.v(),this.g("margin",y,a))}},transform:{get:function(){return this.l&2048&&Os(this),this.Ab}},oe:{get:function(){return this.l&4096&&Os(this),this.wh}},animationTriggers:{get:function(){return this.A!==null?this.A.hb:null},set:function(a){this.animationTriggers!==a&&(ii(this),this.A.hb=a)}},reshapingBehavior:{get:function(){return this.A!==null?this.A.Pf:Ee},set:function(a){this.reshapingBehavior!==a&&(ii(this),this.A.Pf=a)}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(a.Mc()&&!a.Xb()&&fe("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Jb=a=a.J(),La(this),this.g("alignment",y,a))}},column:{get:function(){return this.Ag},set:function(a){a=Math.round(a);var y=this.Ag;y!==a&&(0>a&&ri(a,">= 0",te,"column"),this.Ag=a,this.v(),this.g("column",y,a),this.svg!==null&&this.svg.remove())}},columnSpan:{get:function(){return this.A!==null?this.A.ob:1},set:function(a){a=Math.round(a);var y=this.columnSpan;y!==a&&(1>a&&ri(a,">= 1",te,"columnSpan"),ii(this),this.A.ob=a,this.v(),this.g("columnSpan",y,a))}},row:{get:function(){return this.io},set:function(a){a=Math.round(a);var y=this.io;y!==a&&(0>a&&ri(a,">= 0",te,"row"),this.io=a,this.v(),this.g("row",y,a),this.svg!==null&&this.svg.remove())}},rowSpan:{get:function(){return this.A!==null?this.A.Bi:1},set:function(a){a=Math.round(a);var y=this.rowSpan;y!==a&&(1>a&&ri(a,">= 1",te,"rowSpan"),ii(this),this.A.Bi=a,this.v(),this.g("rowSpan",y,a))}},spanAllocation:{get:function(){return this.A!==null?this.A.Di:null},set:function(a){var y=this.spanAllocation;y!==a&&(ii(this),this.A.Di=a,this.v(),this.g("spanAllocation",y,a))}},alignmentFocus:{get:function(){return this.sk},set:function(a){var y=this.sk;y.D(a)||(this.sk=a=a.J(),this.v(),this.g("alignmentFocus",y,a))}},portId:{get:function(){return this.Yn},set:function(a){var y=this.Yn;if(y!==a){var x=this.part;x===null||x instanceof $e||fe("Cannot set portID on a Link: "+a),y!==null&&x!==null&&Hv(x,this),this.Yn=a,a!==null&&x!==null&&(x.Te=!0,K1(x,this)),this.g("portId",y,a)}}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:us},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),Jf(this))}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:10},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&ri(a,">= 0",te,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),Jf(this))}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:0},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.g("toShortLength",y,a),Jf(this))}},toLinkable:{get:function(){return this.ba!==null?this.ba.Tr:null},set:function(a){var y=this.toLinkable;y!==a&&(this.Xc(),this.ba.Tr=a,this.g("toLinkable",y,a))}},toMaxLinks:{get:function(){return this.ba!==null?this.ba.Ur:1/0},set:function(a){var y=this.toMaxLinks;y!==a&&(0>a&&ri(a,">= 0",te,"toMaxLinks"),this.Xc(),this.ba.Ur=a,this.g("toMaxLinks",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:us},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),Jf(this))}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:10},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&ri(a,">= 0",te,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),Jf(this))}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:0},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.g("fromShortLength",y,a),Jf(this))}},fromLinkable:{get:function(){return this.ba!==null?this.ba.hq:null},set:function(a){var y=this.fromLinkable;y!==a&&(this.Xc(),this.ba.hq=a,this.g("fromLinkable",y,a))}},fromMaxLinks:{get:function(){return this.ba!==null?this.ba.iq:1/0},set:function(a){var y=this.fromMaxLinks;y!==a&&(0>a&&ri(a,">= 0",te,"fromMaxLinks"),this.Xc(),this.ba.iq=a,this.g("fromMaxLinks",y,a))}},cursor:{get:function(){return this.A!==null?this.A.j:""},set:function(a){var y=this.cursor;y!==a&&(ii(this),this.A.j=a,this.g("cursor",y,a))}},click:{get:function(){return this.A!==null?this.A.zh:null},set:function(a){var y=this.click;y!==a&&(ii(this),this.A.zh=a,this.g("click",y,a))}},doubleClick:{get:function(){return this.A!==null?this.A.Fh:null},set:function(a){var y=this.doubleClick;y!==a&&(ii(this),this.A.Fh=a,this.g("doubleClick",y,a))}},contextClick:{get:function(){return this.A!==null?this.A.Bh:null},set:function(a){var y=this.contextClick;y!==a&&(ii(this),this.A.Bh=a,this.g("contextClick",y,a))}},mouseEnter:{get:function(){return this.A!==null?this.A.Mh:null},set:function(a){var y=this.mouseEnter;y!==a&&(ii(this),this.A.Mh=a,this.g("mouseEnter",y,a))}},mouseLeave:{get:function(){return this.A!==null?this.A.Ph:null},set:function(a){var y=this.mouseLeave;y!==a&&(ii(this),this.A.Ph=a,this.g("mouseLeave",y,a))}},mouseOver:{get:function(){return this.A!==null?this.A.Qh:null},set:function(a){var y=this.mouseOver;y!==a&&(ii(this),this.A.Qh=a,this.g("mouseOver",y,a))}},mouseHover:{get:function(){return this.A!==null?this.A.Oh:null},set:function(a){var y=this.mouseHover;y!==a&&(ii(this),this.A.Oh=a,this.g("mouseHover",y,a))}},mouseHold:{get:function(){return this.A!==null?this.A.Nh:null},set:function(a){var y=this.mouseHold;y!==a&&(ii(this),this.A.Nh=a,this.g("mouseHold",y,a))}},mouseDragEnter:{get:function(){return this.A!==null?this.A.Of:null},set:function(a){var y=this.mouseDragEnter;y!==a&&(ii(this),this.A.Of=a,this.g("mouseDragEnter",y,a))}},mouseDragLeave:{get:function(){return this.A!==null?this.A.Xd:null},set:function(a){var y=this.mouseDragLeave;y!==a&&(ii(this),this.A.Xd=a,this.g("mouseDragLeave",y,a))}},mouseDrop:{get:function(){return this.A!==null?this.A.Lh:null},set:function(a){var y=this.mouseDrop;y!==a&&(ii(this),this.A.Lh=a,this.g("mouseDrop",y,a))}},actionDown:{get:function(){return this.A!==null?this.A.V:null},set:function(a){var y=this.actionDown;y!==a&&(ii(this),this.A.V=a,this.g("actionDown",y,a))}},actionMove:{get:function(){return this.A!==null?this.A.ia:null},set:function(a){var y=this.actionMove;y!==a&&(ii(this),this.A.ia=a,this.g("actionMove",y,a))}},actionUp:{get:function(){return this.A!==null?this.A.Ha:null},set:function(a){var y=this.actionUp;y!==a&&(ii(this),this.A.Ha=a,this.g("actionUp",y,a))}},actionCancel:{get:function(){return this.A!==null?this.A.F:null},set:function(a){var y=this.actionCancel;y!==a&&(ii(this),this.A.F=a,this.g("actionCancel",y,a))}},toolTip:{get:function(){return this.A!==null?this.A.$h:null},set:function(a){var y=this.toolTip;y!==a&&(ii(this),this.A.$h=a,this.g("toolTip",y,a))}},contextMenu:{get:function(){return this.A!==null?this.A.Ch:null},set:function(a){var y=this.contextMenu;y!==a&&(ii(this),this.A.Ch=a,this.g("contextMenu",y,a))}}}),te.prototype.trigger=te.prototype.Jv,te.prototype.findBindingPanel=te.prototype.ih,te.prototype.findTemplateBinder=te.prototype.pz,te.prototype.setProperties=te.prototype.nm,te.prototype.apply=te.prototype.apply,te.prototype.attach=te.prototype.Du,te.prototype.set=te.prototype.set,te.prototype.isEnabledObject=te.prototype.If,te.prototype.isVisibleObject=te.prototype.Ed,te.prototype.isContainedBy=te.prototype.rg,te.prototype.getNearestIntersectionPoint=te.prototype.rs,te.prototype.getLocalPoint=te.prototype.qs,te.prototype.getDocumentScale=te.prototype.Df,te.prototype.getDocumentAngle=te.prototype.li,te.prototype.getDocumentBounds=te.prototype.mi,te.prototype.getDocumentPoint=te.prototype.ga,te.prototype.intersectsRect=te.prototype.Yc,te.prototype.containedInRect=te.prototype.fh,te.prototype.containsRect=te.prototype.Re,te.prototype.containsPoint=te.prototype.ca,te.prototype.raiseChanged=te.prototype.g,te.prototype.raiseChangedEvent=te.prototype.cb,te.prototype.addCopyProperty=te.prototype.Vw;var ug=null;te.className="GraphObject",ug=new xn,Cd("Button",function(){function a(x,b){return x.diagram.ic(x.documentPoint,function(E){for(;E.panel!==null&&!E.isActionable;)E=E.panel;return E},function(E){return E===b})!==null}var y=_l(Re,Re.Auto,{isActionable:!0,enabledChanged:function(x,b){if(x instanceof Re){var E=x.fb("ButtonBorder");E!==null&&(E.fill=b?x._buttonFillNormal:x._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",_buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},_l(Qn,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new yn(0,0,2.76142374915397,2.761423749153969),spot2:new yn(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));return y.mouseEnter=function(x,b){if(b.If()&&b instanceof Re&&(x=b.fb("ButtonBorder"),x instanceof Qn)){var E=b._buttonFillOver;b._buttonFillNormal=x.fill,x.fill=E,E=b._buttonStrokeOver,b._buttonStrokeNormal=x.stroke,x.stroke=E}},y.mouseLeave=function(x,b){b.If()&&b instanceof Re&&(x=b.fb("ButtonBorder"),x instanceof Qn&&(x.fill=b._buttonFillNormal,x.stroke=b._buttonStrokeNormal))},y.actionDown=function(x,b){if(b.If()&&b instanceof Re&&b._buttonFillPressed!==null&&x.button===0){var E=b.fb("ButtonBorder");if(E instanceof Qn){x=x.diagram;var z=x.skipsUndoManager;x.skipsUndoManager=!0;var tt=b._buttonFillPressed;b._buttonFillOver=E.fill,E.fill=tt,tt=b._buttonStrokePressed,b._buttonStrokeOver=E.stroke,E.stroke=tt,x.skipsUndoManager=z}}},y.actionUp=function(x,b){if(b.If()&&b instanceof Re&&b._buttonFillPressed!==null&&x.button===0){var E=b.fb("ButtonBorder");if(E instanceof Qn){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,b)?(E.fill=b._buttonFillOver,E.stroke=b._buttonStrokeOver):(E.fill=b._buttonFillNormal,E.stroke=b._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionCancel=function(x,b){if(b.If()&&b instanceof Re&&b._buttonFillPressed!==null){var E=b.fb("ButtonBorder");if(E instanceof Qn){var z=x.diagram,tt=z.skipsUndoManager;z.skipsUndoManager=!0,a(x,b)?(E.fill=b._buttonFillOver,E.stroke=b._buttonStrokeOver):(E.fill=b._buttonFillNormal,E.stroke=b._buttonStrokeNormal),z.skipsUndoManager=tt}}},y.actionMove=function(x,b){if(b.If()&&b instanceof Re&&b._buttonFillPressed!==null){var E=x.diagram;if(E.firstInput.button===0&&(E.currentTool.standardMouseOver(),a(x,b)&&(x=b.fb("ButtonBorder"),x instanceof Qn))){var z=E.skipsUndoManager;E.skipsUndoManager=!0;var tt=b._buttonFillPressed;x.fill!==tt&&(x.fill=tt),tt=b._buttonStrokePressed,x.stroke!==tt&&(x.stroke=tt),E.skipsUndoManager=z}}},y}),Cd("TreeExpanderButton",function(){var a=_l("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},_l(Qn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Mo},new Vo("figure","isTreeExpanded",function(y,x){return x=x.panel,y?x._treeExpandedFigure:x._treeCollapsedFigure}).cp()),{visible:!1},new Vo("visible","isTreeLeaf",function(y){return!y}).cp());return a.click=function(y,x){if(x=x.part,x instanceof Bi&&(x=x.adornedPart),x instanceof $e){var b=x.diagram;if(b!==null){if(b=b.commandHandler,x.isTreeExpanded){if(!b.canCollapseTree(x))return}else if(!b.canExpandTree(x))return;y.handled=!0,x.isTreeExpanded?b.collapseTree(x):b.expandTree(x)}}},a}),Cd("SubGraphExpanderButton",function(){var a=_l("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},_l(Qn,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Mo},new Vo("figure","isSubGraphExpanded",function(y,x){return x=x.panel,y?x._subGraphExpandedFigure:x._subGraphCollapsedFigure}).cp()));return a.click=function(y,x){if(x=x.part,x instanceof Bi&&(x=x.adornedPart),x instanceof Yn){var b=x.diagram;if(b!==null){if(b=b.commandHandler,x.isSubGraphExpanded){if(!b.canCollapseSubGraph(x))return}else if(!b.canExpandSubGraph(x))return;y.handled=!0,x.isSubGraphExpanded?b.collapseSubGraph(x):b.expandSubGraph(x)}}},a}),Cd("ToolTip",function(){return _l(Bi,Re.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new jt(0,3),shadowBlur:5},_l(Qn,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new yn(0,0,4,6),spot2:new yn(1,1,-4,-4)}))}),Cd("ContextMenu",function(){return _l(Bi,Re.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new jt(0,3),shadowBlur:5},new Vo("background","",function(a){return a.adornedPart!==null&&a.placeholder!==null?null:"#F5F5F5"}))}),Cd("ContextMenuButton",function(){var a=_l("Button");a.stretch=gn;var y=a.fb("ButtonBorder");return y instanceof Qn&&(y.figure="Rectangle",y.strokeWidth=0,y.spot1=new yn(0,0,2,3),y.spot2=new yn(1,1,-2,-2)),a}),Cd("PanelExpanderButton",function(a){var y=fm(a,"COLLAPSIBLE"),x=_l("Button",{_buttonExpandedFigure:"M0 0 M0 6 L4 2 8 6 M8 8",_buttonCollapsedFigure:"M0 0 M0 2 L4 6 8 2 M8 8",_buttonFillNormal:"rgba(0, 0, 0, 0)",_buttonStrokeNormal:null,_buttonFillOver:"rgba(0, 0, 0, .2)",_buttonStrokeOver:null,_buttonFillPressed:"rgba(0, 0, 0, .4)",_buttonStrokePressed:null},_l(Qn,{name:"ButtonIcon",strokeWidth:2},new Vo("geometryString","visible",function(b){return b?x._buttonExpandedFigure:x._buttonCollapsedFigure}).cp(y)));return a=x.fb("ButtonBorder"),a instanceof Qn&&(a.stroke=null,a.fill="rgba(0, 0, 0, 0)"),x.click=function(b,E){var z=E.diagram;if(z!==null&&!z.isReadOnly){var tt=E.ih();tt===null&&(tt=E.part),tt!==null&&(E=tt.fb(y),E!==null&&(b.handled=!0,z.Ea("Collapse/Expand Panel"),E.visible=!E.visible,z.eb("Collapse/Expand Panel")))}},x}),Cd("CheckBoxButton",function(a){var y=fm(a);return a=_l("Button",{desiredSize:new Ze(14,14)},_l(Qn,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Ae,geometryStretch:dn,visible:!1},y!==""?new Vo("visible",y).Kx():[])),a.click=function(x,b){if(b instanceof Re){var E=x.diagram;if(!(E===null||E.isReadOnly||y!==""&&E.model.isReadOnly)){x.handled=!0;var z=b.fb("ButtonIcon");E.Ea("checkbox"),z.visible=!z.visible,typeof b._doClick=="function"&&b._doClick(x,b),E.eb("checkbox")}}},a}),Cd("CheckBox",function(a){a=fm(a),a=_l("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new ni(0,1,0,0)});var y=_l(Re,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new ni(1),_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave,actionDown:a.actionDown,actionUp:a.actionUp,actionCancel:a.actionCancel,actionMove:a.actionMove,click:a.click,_buttonClick:a.click});return a.mouseEnter=null,a.mouseLeave=null,a.actionDown=null,a.actionUp=null,a.actionCancel=null,a.actionMove=null,a.click=null,y}),te.None=Ee=new me(te,"None",0),te.Default=Xn=new me(te,"Default",0),te.Vertical=Fn=new me(te,"Vertical",4),te.Horizontal=gn=new me(te,"Horizontal",5),te.Fill=Ae=new me(te,"Fill",3),te.Uniform=dn=new me(te,"Uniform",1),te.UniformToFill=Pi=new me(te,"UniformToFill",2),te.FlipVertical=si=new me(te,"FlipVertical",1),te.FlipHorizontal=Di=new me(te,"FlipHorizontal",2),te.FlipBoth=hr=new me(te,"FlipBoth",3),te.make=_l,te.getBuilders=function(){var a=new xn,y;for(y in ug)if(y!==y.toLowerCase()){var x=ug.I(y);typeof x=="function"&&a.add(y,x)}return a.freeze(),a},te.defineBuilder=Cd,te.build=function(a,y,x){for(var b=[],E=2;E<arguments.length;++E)b[E-2]=arguments[E];if(E=ug.I(a),typeof E=="function"&&(b=E([a].concat(b)),b instanceof te))return y&&b.set(y),b;fe('GraphObject.build invoked object builder "'+a+'", but it did not return an Object')},te.takeBuilderArgument=fm;function Fc(){this.nc=!1,this.xa="",this.zp=-1,this.nb=this.wm=this.te=null,this.j="",this.hb=this.Di=this.Hb=this.Ch=this.$h=this.F=this.Ha=this.ia=this.V=this.Lh=this.Xd=this.Of=this.Nh=this.Oh=this.Qh=this.Ph=this.Mh=this.Bh=this.Fh=this.zh=null,this.u=Rr,this.o=Es,this.hg=Xn,this.ob=this.Bi=1,this.Pf=Ee,this.Pc=this.Ci=this.gd=null,this.Oc="category"}Fc.prototype.copy=function(){var a=new Fc;return a.xa=this.xa,a.zp=this.zp,a.te=this.te,a.nb=this.nb,a.j=this.j,a.zh=this.zh,a.Fh=this.Fh,a.Bh=this.Bh,a.Mh=this.Mh,a.Ph=this.Ph,a.Qh=this.Qh,a.Oh=this.Oh,a.Nh=this.Nh,a.Of=this.Of,a.Xd=this.Xd,a.Lh=this.Lh,a.V=this.V,a.ia=this.ia,a.Ha=this.Ha,a.F=this.F,a.$h=this.$h,a.Ch=this.Ch,a.Hb=this.Hb,a.Di=this.Di,a.hb=this.hb,a.u=this.u.J(),a.o=this.o.J(),a.hg=this.hg,a.Bi=this.Bi,a.ob=this.ob,a.Pf=this.Pf,a.gd=this.gd,a.Ci=this.Ci,a.Pc=this.Pc,a.Oc=this.Oc,a};function rf(){this.u=-1/0,this.o=0,this.F=cs,this.rr=Ea,this.j=this.V="None"}rf.prototype.copy=function(){var a=new rf;return a.u=this.u,a.o=this.o,a.F=this.F.J(),a.rr=this.rr,a.V=this.V,a.j=this.j,a},rf.className="LinkElementSettings";function lp(){this.yj=this.Xi=vs,this.xj=this.Wi=this.wj=this.Vi=NaN,this.Tr=this.hq=null,this.Ur=this.iq=1/0}lp.prototype.copy=function(){var a=new lp;return a.Xi=this.Xi.J(),a.yj=this.yj.J(),a.Vi=this.Vi,a.wj=this.wj,a.Wi=this.Wi,a.xj=this.xj,a.hq=this.hq,a.Tr=this.Tr,a.iq=this.iq,a.Ur=this.Ur,a},lp.className="LinkSettings";function Qf(){this.ha=[1,0,0,1,0,0]}Qf.prototype.copy=function(){var a=new Qf;return a.ha[0]=this.ha[0],a.ha[1]=this.ha[1],a.ha[2]=this.ha[2],a.ha[3]=this.ha[3],a.ha[4]=this.ha[4],a.ha[5]=this.ha[5],a},Qf.prototype.translate=function(a,y){this.ha[4]+=this.ha[0]*a+this.ha[2]*y,this.ha[5]+=this.ha[1]*a+this.ha[3]*y},Qf.prototype.scale=function(a,y){this.ha[0]*=a,this.ha[1]*=a,this.ha[2]*=y,this.ha[3]*=y},Qf.prototype.rotate=function(a,y,x){if(360<=a?a-=360:0>a&&(a+=360),a!==0){if(this.translate(y,x),a===90){a=0;var b=1}else a===180?(a=-1,b=0):a===270?(a=0,b=-1):(b=a*Math.PI/180,a=Math.cos(b),b=Math.sin(b));var E=this.ha[1]*a+this.ha[3]*b,z=this.ha[0]*-b+this.ha[2]*a,tt=this.ha[1]*-b+this.ha[3]*a;this.ha[0]=this.ha[0]*a+this.ha[2]*b,this.ha[1]=E,this.ha[2]=z,this.ha[3]=tt,this.translate(-y,-x)}},Qf.className="STransform";function Tc(a){this.type=a,this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0,this.gx=[],this.pattern=null}Tc.prototype.addColorStop=function(a,y){this.gx.push({offset:a,color:y})},Tc.className="SGradient";function sh(a,y,x){this.ownerDocument=a=y===void 0?xe.document:y,this.cA="http://www.w3.org/2000/svg",a!==void 0&&(this.Oa=this.Ud("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink")),this.hs=null,this.context=new pl(this,x)}sh.prototype.resize=function(a,y,x,b){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=b+"px",this.Oa.setAttributeNS(null,"width",x+"px"),this.Oa.setAttributeNS(null,"height",b+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+x+" "+b),this.context.ww.firstElementChild.setAttributeNS(null,"width",x+"px"),this.context.ww.firstElementChild.setAttributeNS(null,"height",b+"px"),!0):!1},sh.prototype.Ud=function(a,y,x){if(a=this.ownerDocument.createElementNS(this.cA,a),Ue(y))for(var b in y)a.setAttributeNS(b==="href"?"http://www.w3.org/1999/xlink":"",b,y[b]);return x!==void 0&&(a.textContent=x),a},sh.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},sh.prototype.focus=function(){this.Oa.focus()},sh.prototype.mx=function(){this.ownerDocument=null},Oe.Object.defineProperties(sh.prototype,{width:{get:function(){return this.Oa.width.baseVal.value},set:function(a){this.Oa.setAttribute("width",a+"px")}},height:{get:function(){return this.Oa.height.baseVal.value},set:function(a){this.Oa.setAttribute("height",a+"px")}},style:{get:function(){return this.Oa.style}}}),sh.className="SVGSurface";function pl(a,y){this.Gv=a,this.svg=a.Oa,this.stack=[],this.nh=[],this.fillStyle="#000000",this.font="10px sans-serif",this.globalAlpha=1,this.lineCap="butt",this.lineDashOffset=0,this.lineJoin="miter",this.lineWidth=1,this.miterLimit=10,this.shadowBlur=0,this.shadowColor="rgba(0, 0, 0, 0)",this.shadowOffsetY=this.shadowOffsetX=0,this.Il=!1,this.strokeStyle="#000000",this.textAlign="start",this.clipInsteadOfFill=!1,this.Vg=this.Br=this.Ar=0,this.yd=this.ad=null,this.path=[],this.Yl={},this.Ct=!1,this.Yg=null,this.uj=0,this.rb=new Qf,this.j=cm(this),this.Nj=cm(this,"gojs-diagram"),this.Hl=this.ti=null;var x=hl++,b=this.Ud("clipPath",{id:"mainClip"+x});b.appendChild(this.Ud("rect",{x:0,y:0,width:a.width,height:a.height})),this.ww=b,this.svg.appendChild(this.j),this.j.appendChild(this.Nj),this.svg.appendChild(b),this.j.setAttributeNS(null,"clip-path","url(#mainClip"+x+")"),this.eA={},this.isTemporary=!!y,this.filter="",this.bk=null}function Xy(a,y,x,b,E,z,tt){a.Nj===void 0?up(a,y,x,b,E,z,tt):a.Nj.setAttribute("transform","matrix("+y+", "+x+", "+b+", "+E+", "+z+", "+tt+")")}xt=pl.prototype,xt.arc=function(a,y,x,b,E,z,tt,rt){var ot=2*Math.PI,at=ot-1e-6,ut=x*Math.cos(b),ct=x*Math.sin(b),mt=a+ut,yt=y+ct,St=z?0:1;b=z?b-E:E-b,(1e-6<Math.abs(tt-mt)||1e-6<Math.abs(rt-yt))&&this.path.push(["L",mt,+yt]),0>b&&(b=b%ot+ot),b>at?(this.path.push(["A",x,x,0,1,St,a-ut,y-ct]),this.path.push(["A",x,x,0,1,St,mt,yt])):1e-6<b&&this.path.push(["A",x,x,0,+(b>=Math.PI),St,a+x*Math.cos(E),y+x*Math.sin(E)])},xt.beginPath=function(){this.path=[],this.Yl={stroke:"none",fill:"none"}},xt.Se=function(a){this.addPath(this.path,this.rb,a||0)},xt.bezierCurveTo=function(a,y,x,b,E,z){this.path.push(["C",a,y,x,b,E,z])},xt.clearRect=function(){},xt.clip=function(){this.Yl.clipPath=!0},xt.closePath=function(){this.path.push(["z"])},xt.createLinearGradient=function(a,y,x,b){var E=new Tc("linear");return E.x1=a,E.y1=y,E.x2=x,E.y2=b,E},xt.createPattern=function(a){var y="";a instanceof HTMLCanvasElement&&(y=a.toDataURL()),a instanceof HTMLImageElement&&(y=a.getAttribute("src"));var x=this.eA;if(x[y])return"url(#"+x[y]+")";var b="PATTERN"+hl++,E={x:0,y:0,width:a.width,height:a.height,href:y};return a=this.Ud("pattern",{width:a.width,height:a.height,id:b,patternUnits:"userSpaceOnUse"}),a.appendChild(this.Ud(Xf,E)),this.svg.appendChild(a),x[y]=b,"url(#"+b+")"},xt.createRadialGradient=function(a,y,x,b,E,z){var tt=new Tc("radial");return tt.x1=a,tt.y1=y,tt.r1=x,tt.x2=b,tt.y2=E,tt.r2=z,tt};function Zy(a,y,x,b,E,z,tt,rt,ot){b=rt/b,E=ot/E,z===0&&tt===0||a.rb.translate(z,tt),b===1&&E===1||a.rb.scale(b,E),y===0&&x===0||a.rb.translate(-y,-x)}xt.drawImage=function(a,y,x,b,E,z,tt,rt,ot){var at="";a instanceof HTMLCanvasElement&&(at=a.toDataURL()),a instanceof HTMLImageElement&&(at=a.getAttribute("src"));var ut=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height,b===void 0&&(z=y,tt=x,rt=b=ut,ot=E=a),b=b||0,E=E||0,rt=rt||0,ot=ot||0,Zy(this,y,x,b,E,z||0,tt||0,rt,ot),z={x:0,y:0,width:ut||b,height:a||E,href:at},ne.$(b,rt)&&ne.$(E,ot)?at.toLowerCase().indexOf(".svg")===-1&&at.toLowerCase().indexOf("data:image/svg")===-1&&(z.preserveAspectRatio="xMidYMid slice"):z.preserveAspectRatio="none",(y!==0||x!==0||b!==ut||E!==a)&&(b+=y,E+=x,z["clip-path"]="path('M "+y+","+x+" L "+b+" "+x+" L "+b+" "+E+" L "+y+" "+E+" z')"),hg(this,Xf,z,this.rb),this.addElement(Xf,z)},xt.fill=function(a){a&&(this.Yl["fill-rule"]="evenodd"),iv(this,this.Yl)},xt.ng=function(a,y){this.clipInsteadOfFill?this.clip():this.fill(y)},xt.fillRect=function(a,y,x,b){a=[a,y,x,b],a={x:a[0],y:a[1],width:a[2],height:a[3]},hg(this,"fill",a,this.rb),this.addElement("rect",a)},xt.ox=function(a,y,x,b){a={x:a,y,width:x,height:b},hg(this,"fill",a,this.rb),iv(this,a),this.svg.prepend(this.Ud("rect",a))},xt.fillText=function(a,y,x){a=[a,y,x],y=this.textAlign,y==="left"?y="start":y==="right"?y="end":y==="center"&&(y="middle"),y={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":y},hg(this,"fill",y,this.rb),this.addElement("text",y,a[0])},xt.lineTo=function(a,y){this.path.push(["L",a,y])},xt.moveTo=function(a,y){this.path.push(["M",a,y])},xt.quadraticCurveTo=function(a,y,x,b){this.path.push(["Q",a,y,x,b])},xt.rect=function(a,y,x,b){this.path.push(["M",a,y],["L",a+x,y],["L",a+x,y+b],["L",a,y+b],["z"])},xt.restore=function(){this.rb=this.stack.pop(),this.path=this.stack.pop();var a=this.stack.pop();this.fillStyle=a.fillStyle,this.font=a.font,this.globalAlpha=a.globalAlpha,this.lineCap=a.lineCap,this.lineDashOffset=a.lineDashOffset,this.lineJoin=a.lineJoin,this.lineWidth=a.lineWidth,this.miterLimit=a.miterLimit,this.shadowBlur=a.shadowBlur,this.shadowColor=a.shadowColor,this.shadowOffsetX=a.shadowOffsetX,this.shadowOffsetY=a.shadowOffsetY,this.strokeStyle=a.strokeStyle,this.textAlign=a.textAlign,this.bk=a.bk},xt.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign,bk:this.bk});for(var a=[],y=0;y<this.path.length;y++)a.push(this.path[y]);this.stack.push(a),this.stack.push(this.rb.copy())},xt.setTransform=function(a,y,x,b,E,z){a===1&&y===0&&x===0&&b===1&&E===0&&z===0||up(this,a,y,x,b,E,z)};function Jy(a){return a=a.rb.ha,"matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")"}xt.scale=function(a,y){this.rb.scale(a,y)},xt.translate=function(a,y){this.rb.translate(a,y)},xt.transform=function(){},xt.yc=function(){},xt.stroke=function(){$y(this,this.Yl)},xt.jk=function(){this.clipInsteadOfFill||this.stroke()},xt.Ud=function(a,y,x){return this.Gv.Ud(a,y,x)},xt.addElement=function(a,y,x){return a=this.Ud(a,y,x),this.yd!==null?this.yd.appendChild(a):this.yd=a,this.ad=a};function hg(a,y,x,b){y==="fill"?iv(a,x):y==="stroke"&&$y(a,x),b!==null&&(a=b.ha,x.transform="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")")}function iv(a,y){a.fillStyle instanceof Tc?y.fill=rv(a,a.fillStyle,!0):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",y["fill-opacity"]=a[4]):y.fill=a.fillStyle}function Qy(a,y,x){x=x?"fill":"stroke",a.fillStyle instanceof Tc?y.setAttributeNS(null,"fill",rv(a,a.fillStyle,!0)):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),y.setAttributeNS(null,x,"rgb("+a[1]+","+a[2]+","+a[3]+")"),y.setAttributeNS(null,x+"-opacity",a[4])):y.setAttributeNS(null,x,a.fillStyle)}function $y(a,y){if(a.strokeStyle instanceof Tc)y.stroke=rv(a,a.strokeStyle,!1);else if(/^rgba\(/.test(a.strokeStyle)){var x=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle);y.stroke="rgb("+x[1]+","+x[2]+","+x[3]+")",y["stroke-opacity"]=x[4]}else y.stroke=a.strokeStyle;y["stroke-width"]=a.lineWidth,y["stroke-linecap"]=a.lineCap,y["stroke-linejoin"]=a.lineJoin,y["stroke-miterlimit"]=a.miterLimit,a.Ct&&(y["stroke-dasharray"]=a.Yg.toString(),y["stroke-dashoffset"]=a.uj)}function rv(a,y,x){var b="";if(b=a.Hl!==null?a.Hl.getAttribute(x?"fill":"stroke"):null,b!==null&&b.indexOf("GRAD")!==-1?(b=b.split("#")[1].slice(0,-1),x=a.svg.getElementById(b),x!==null&&x.remove()):b="GRAD"+hl++,y.type==="linear")x=a.Ud("linearGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,id:b,gradientUnits:"userSpaceOnUse"});else if(y.type==="radial")x=a.Ud("radialGradient",{x1:y.x1,x2:y.x2,y1:y.y1,y2:y.y2,r1:y.r1,r2:y.r2,id:b});else throw Error("invalid gradient");var E=y.gx;y=E.length;for(var z=[],tt=0;tt<y;tt++){var rt=E[tt],ot=rt.color;rt={offset:rt.offset,"stop-color":ot},/^rgba\(/.test(ot)&&(ot=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(ot),rt["stop-color"]="rgb("+ot[1]+","+ot[2]+","+ot[3]+")",rt["stop-opacity"]=ot[4]),z.push(rt)}for(z.sort(function(at,ut){return at.offset>ut.offset?1:-1}),E=0;E<y;E++)x.appendChild(a.Ud("stop",z[E]));return a.svg.appendChild(x),"url(#"+b+")"}xt.addPath=function(a,y,x){for(var b=[],E=0;E<a.length;E++){var z=uo(a[E]),tt=[z.shift()];if(tt[0]==="A")tt.push(z.shift()+","+z.shift(),z.shift(),z.shift()+","+z.shift(),z.shift()+","+z.shift());else for(;z.length;)tt.push(z.shift()+","+z.shift());b.push(tt.join(" "))}if(b=b.join(" "),a=this.Yl,a.clipPath)0<this.nh.length&&this.nh[this.nh.length-1].setAttributeNS(null,"clip-path",'path("'+b+'")');else if(a.d=b,hg(this,"",a,y),this.Hl!==null)if(y=this.Hl,y.nodeName!=="g")for(var rt in a)rt!=="transform"&&y.setAttributeNS(null,rt,a[rt]);else{rt=y.getElementsByTagName("path");for(var ot in a)ot!=="transform"&&rt[x].setAttributeNS(null,ot,a[ot])}else this.addElement("path",a)};function up(a,y,x,b,E,z,tt){var rt=new Qf;rt.ha=[y,x,b,E,z,tt],y={},hg(a,"g",y,rt),rt=a.addElement("g",y),a.nh.push(rt)}function cm(a,y){var x={};return y&&(x.class=y),y=a.addElement("g",x),a.nh.push(y),y}xt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x};function Lh(a){a.Il=!1,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0}function Qh(a){a.Il=!0,a.shadowOffsetX=a.Ar,a.shadowOffsetY=a.Br,a.shadowBlur=a.Vg}xt.js=function(a,y){this.Ct=!0,this.Yg=a,this.uj=y},xt.fs=function(){this.Ct=!1},xt.Vc=function(){},xt.Wx=function(){},pl.prototype.rotate=function(a){this.rb.rotate(57.2958*a,0,0)},pl.prototype.getImageData=function(){return null},pl.prototype.measureText=function(){return null};function gm(a,y){y=y.getAttribute("fill"),y!==null&&(y=y.split("#"),y.length!==1&&(y=a.svg.getElementById(y[1].slice(0,-1)),y!==null&&a.svg.innerHTML.match(new RegExp(y.id,"g")).length===1&&y.remove()))}pl.prototype.Hs=function(a){a.svg!==null&&a.svg.parentNode===this.Nj&&a.svg.remove()},pl.className="SVGContext",se.prototype.Cs=function(a){this.pj.contains("SVG")||this.bs("SVG",new sh(this,xe.document));var y=new sh(this,xe.document,!0);a===void 0&&(a=new ai);var x=this;return Cc(this,function(b,E){return b=lm(x,b,"SVG",y),b=b!==null?b.svg:null,typeof E=="function"?(E(b),null):b},a)},se.prototype.makeSvg=se.prototype.Cs,se.prototype.av=function(a){return this.Cs(a)},se.prototype.makeSVG=se.prototype.av;function iu(a,y,x,b){this.ownerDocument=y=y===void 0?xe.document:y,this.hs=null,y=y.createElement("canvas"),y.tabIndex=0,this.Oa=y,this.context=new $f(y,x,b),y.H=a}iu.prototype.resize=function(a,y,x,b){return this.width!==a||this.height!==y?(this.width=a,this.height=y,this.style.width=x+"px",this.style.height=b+"px",!0):!1},iu.prototype.toDataURL=function(a,y){return this.Oa.toDataURL(a,y)},iu.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()},iu.prototype.focus=function(){this.Oa.focus()},iu.prototype.mx=function(){this.ownerDocument=this.Oa.H=null},Oe.Object.defineProperties(iu.prototype,{width:{get:function(){return this.Oa.width},set:function(a){this.Oa.width=a}},height:{get:function(){return this.Oa.height},set:function(a){this.Oa.height=a}},style:{get:function(){return this.Oa.style}}}),iu.className="CanvasSurface";function $f(a,y,x){this.Z=a.getContext?a.getContext("2d",y):null,this.Z===null&&fe("Browser does not support HTML Canvas Element"),this.ct=this.et=this.dt="",this.Hm=!1,this.Vg=this.Br=this.Ar=0,this.Il=!1,this.El=new oi,this.isTemporary=!!x}xt=$f.prototype,xt.Wx=function(a){this.Z.imageSmoothingEnabled=a},xt.arc=function(a,y,x,b,E,z){this.Z.arc(a,y,x,b,E,z)},xt.beginPath=function(){this.Z.beginPath()},xt.Se=function(){},xt.bezierCurveTo=function(a,y,x,b,E,z){this.Z.bezierCurveTo(a,y,x,b,E,z)},xt.clearRect=function(a,y,x,b){this.yc(),this.Z.clearRect(a,y,x,b)},xt.clip=function(){this.Z.clip()},xt.closePath=function(){this.Z.closePath()},xt.createLinearGradient=function(a,y,x,b){return this.Z.createLinearGradient(a,y,x,b)},xt.createPattern=function(a,y){return this.Z.createPattern(a,y)},xt.createRadialGradient=function(a,y,x,b,E,z){return this.Z.createRadialGradient(a,y,x,b,E,z)},xt.drawImage=function(a,y,x,b,E,z,tt,rt,ot){b===void 0?this.Z.drawImage(a,y,x):this.Z.drawImage(a,y,x,b,E,z,tt,rt,ot)},xt.fill=function(a){this.Z.fill(a?"evenodd":"nonzero")},xt.fillRect=function(a,y,x,b){this.Z.fillRect(a,y,x,b)},xt.ox=function(a,y,x,b){this.Z.fillRect(a,y,x,b)},xt.fillText=function(a,y,x){this.Z.fillText(a,y,x)},xt.getImageData=function(a,y,x,b){return this.Z.getImageData(a,y,x,b)},xt.lineTo=function(a,y){this.Z.lineTo(a,y)},xt.measureText=function(a){return this.Z.measureText(a)},xt.moveTo=function(a,y){this.Z.moveTo(a,y)},xt.quadraticCurveTo=function(a,y,x,b){this.Z.quadraticCurveTo(a,y,x,b)},xt.rect=function(a,y,x,b){this.Z.rect(a,y,x,b)},xt.restore=function(){this.Z.restore()},xt.save=function(){this.yc(),this.Z.save()},$f.prototype.rotate=function(a){this.El.rotate(57.2958*a,0,0)},xt=$f.prototype,xt.setTransform=function(a,y,x,b,E,z){this.El.setTransform(a,y,x,b,E,z)},xt.scale=function(a,y){this.El.scale(a,y)},xt.translate=function(a,y){this.El.translate(a,y)},xt.stroke=function(){this.Z.stroke()},xt.transform=function(a,y,x,b,E,z){if(a!==1||y!==0||x!==0||b!==1||E!==0||z!==0){var tt=this.El,rt=tt.m11*a+tt.m21*y;a=tt.m12*a+tt.m22*y,y=tt.m11*x+tt.m21*b,x=tt.m12*x+tt.m22*b,tt.dx=tt.m11*E+tt.m21*z+tt.dx,tt.dy=tt.m12*E+tt.m22*z+tt.dy,tt.m11=rt,tt.m12=a,tt.m21=y,tt.m22=x}},xt.yc=function(){var a=this.El;this.Z.setTransform(a.m11,a.m12,a.m21,a.m22,a.dx,a.dy)},xt.ng=function(a,y){if(a instanceof er&&a.type===Hl){var x=a.yk;a=a.ft,a>x?(this.scale(x/a,1),this.translate((a-x)/2,0)):x>a&&(this.scale(1,a/x),this.translate(0,(x-a)/2)),this.Hm?this.clip():this.fill(y),a>x?(this.translate(-(a-x)/2,0),this.scale(1/(x/a),1)):x>a&&(this.translate(0,-(x-a)/2),this.scale(1,1/(a/x)))}else this.Hm?this.clip():this.fill(y)},xt.jk=function(){this.Hm||this.stroke()},xt.Ev=function(a,y,x){this.Ar=a,this.Br=y,this.Vg=x},xt.js=function(a,y){var x=this.Z;x.setLineDash!==void 0&&(x.setLineDash(a),x.lineDashOffset=y)},xt.fs=function(){var a=this.Z;a.setLineDash!==void 0&&(a.setLineDash(mx),a.lineDashOffset=0)},xt.Vc=function(a){a&&(this.dt=""),this.ct=this.et=""},xt.Hs=function(){},Oe.Object.defineProperties($f.prototype,{fillStyle:{get:function(){return this.Z.fillStyle},set:function(a){this.ct!==a&&(this.ct=this.Z.fillStyle=a)}},font:{get:function(){return this.Z.font},set:function(a){this.dt!==a&&(this.dt=this.Z.font=a)}},globalAlpha:{get:function(){return this.Z.globalAlpha},set:function(a){this.Z.globalAlpha=a}},lineCap:{get:function(){return this.Z.lineCap},set:function(a){this.Z.lineCap=a}},lineDashOffset:{get:function(){return this.Z.lineDashOffset},set:function(a){this.Z.lineDashOffset=a}},lineJoin:{get:function(){return this.Z.lineJoin},set:function(a){this.Z.lineJoin=a}},lineWidth:{get:function(){return this.Z.lineWidth},set:function(a){this.Z.lineWidth=a}},miterLimit:{get:function(){return this.Z.miterLimit},set:function(a){this.Z.miterLimit=a}},shadowBlur:{get:function(){return this.Z.shadowBlur},set:function(a){this.Z.shadowBlur=a}},shadowColor:{get:function(){return this.Z.shadowColor},set:function(a){this.Z.shadowColor=a}},shadowOffsetX:{get:function(){return this.Z.shadowOffsetX},set:function(a){this.Z.shadowOffsetX=a}},shadowOffsetY:{get:function(){return this.Z.shadowOffsetY},set:function(a){this.Z.shadowOffsetY=a}},strokeStyle:{get:function(){return this.Z.strokeStyle},set:function(a){this.et!==a&&(this.et=this.Z.strokeStyle=a)}},textAlign:{get:function(){return this.Z.textAlign},set:function(a){this.Z.textAlign=a}},imageSmoothingEnabled:{get:function(){return this.Z.imageSmoothingEnabled},set:function(a){this.Z.imageSmoothingEnabled=a}},filter:{get:function(){return this.Z.filter},set:function(a){this.Z.filter=a===""?"none":a}},clipInsteadOfFill:{get:function(){return this.Hm},set:function(a){this.Hm=a}}});var mx=Object.freeze([]);$f.className="CanvasSurfaceContext";function hp(){this.F=this.o=this.u=this.j=0}hp.className="ColorNumbers";function er(a,y){gg||(hv(),gg=!0),qr(this),this._isFrozen=!1,a===void 0?(this.na=Ld,this.xk="black"):typeof a=="string"?(this.na=Ld,this.xk=a):(this.na=a,this.xk="black"),a=this.na,a===qh?(this.Qd=du,this.Lk=Qa):this.Lk=a===Hl?this.Qd=Xi:this.Qd=us,this.Gr=0,this.Xp=NaN,this.xe=this.cr=this.we=null,this.ft=this.yk=0,y&&Object.assign(this,y)}er.prototype.copy=function(){var a=new er;return a.na=this.na,a.xk=this.xk,a.Qd=this.Qd.J(),a.Lk=this.Lk.J(),a.Gr=this.Gr,a.Xp=this.Xp,this.we!==null&&(a.we=this.we.copy()),a.cr=this.cr,a},xt=er.prototype,xt.freeze=function(){return this._isFrozen=!0,this.we!==null&&this.we.freeze(),this},xt.ka=function(){return Object.isFrozen(this)&&fe("cannot thaw constant: "+this),this._isFrozen=!1,this.we!==null&&this.we.ka(),this},xt.qb=function(a){a.classType===er&&(this.type=a)},xt.toString=function(){var a="Brush(";if(this.type===Ld)a+=this.color;else if(a=this.type===qh?a+"Linear ":this.type===Hl?a+"Radial ":this.type===pg?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,this.colorStops!==null)for(var y=this.colorStops.iterator;y.next();)a+=" "+y.key+":"+y.value;return a+")"},xt.addColorStop=function(a,y){return this._isFrozen&&An(this),(typeof a!="number"||!isFinite(a)||1<a||0>a)&&ri(a,"0 <= loc <= 1",er,"addColorStop:loc"),this.we===null&&(this.we=new xn),this.we.add(a,y),this.na===Ld&&(this.type=qh),this.xe=null,this},xt.Vz=function(a,y){if(this._isFrozen&&An(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?mg:y,this.type===Ld)$h(this.color),this.color=fg(a,y);else if((this.type===qh||this.type===Hl)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)$h(x.value),this.addColorStop(x.key,fg(a,y));return this};function qy(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?mg:x,$h(a),fg(y,x)}xt.Wy=function(a,y){if(this._isFrozen&&An(this),a=a===void 0||typeof a!="number"?.2:a,y=y===void 0?mg:y,this.type===Ld)$h(this.color),this.color=fg(-a,y);else if((this.type===qh||this.type===Hl)&&this.colorStops!==null)for(var x=this.colorStops.iterator;x.next();)$h(x.value),this.addColorStop(x.key,fg(-a,y));return this};function t1(a,y,x){return y=y===void 0||typeof y!="number"?.2:y,x=x===void 0?mg:x,$h(a),fg(-y,x)}function ov(a,y,x){$h(a),a=Dr.j;var b=Dr.u,E=Dr.o,z=Dr.F;return $h(y),x===void 0&&(x=.5),"rgba("+Math.round((Dr.j-a)*x+a)+", "+Math.round((Dr.u-b)*x+b)+", "+Math.round((Dr.o-E)*x+E)+", "+Math.round((Dr.F-z)*x+z)+")"}xt.Gx=function(){if(this.type===Ld)return dg(this.color);if((this.type===qh||this.type===Hl)&&this.colorStops!==null){var a=this.colorStops;if(this.type===Hl)return dg(a.first().value);if(a.get(.5)!==null)return dg(a.get(.5));if(a.count===2)return a=a.Fa(),dg(ov(a[0].value,a[1].value));for(var y=a.iterator,x=-1,b=-1,E=1,z=1;y.next();){var tt=y.key,rt=Math.abs(.5-y.key);E>z&&rt<E?(x=tt,E=rt):z>=E&&rt<z&&(b=tt,z=rt)}return x>b&&(z=x,x=b,b=z,z=E),E=b-x,dg(ov(a.get(x),a.get(b),1-z/E))}return!1};function dg(a){return a?a instanceof er?a.Gx():($h(a),128>(299*Dr.j+587*Dr.u+114*Dr.o)/1e3):!1}function fg(a,y){switch(y){case mg:y=100*av(Dr.j);var x=100*av(Dr.u),b=100*av(Dr.o);return ka.j=.4124564*y+.3575761*x+.1804375*b,ka.u=.2126729*y+.7151522*x+.072175*b,ka.o=.0193339*y+.119192*x+.9503041*b,ka.F=Dr.F,y=uv(ka.j/cg[0]),x=uv(ka.u/cg[1]),b=uv(ka.o/cg[2]),Mh.j=116*x-16,Mh.u=500*(y-x),Mh.o=200*(x-b),Mh.F=ka.F,Mh.j=Math.min(100,Math.max(0,Mh.j+100*a)),a=(Mh.j+16)/116,y=a-Mh.o/200,ka.j=cg[0]*e1(Mh.u/500+a),ka.u=cg[1]*(Mh.j>pm*dv?Math.pow(a,3):Mh.j/pm),ka.o=cg[2]*e1(y),ka.F=Mh.F,a=-.969266*ka.j+1.8760108*ka.u+.041556*ka.o,y=.0556434*ka.j+-.2040259*ka.u+1.0572252*ka.o,Dr.j=255*lv((3.2404542*ka.j+-1.5371385*ka.u+-.4985314*ka.o)/100),Dr.u=255*lv(a/100),Dr.o=255*lv(y/100),Dr.F=ka.F,Dr.j=Math.round(Dr.j),255<Dr.j?Dr.j=255:0>Dr.j&&(Dr.j=0),Dr.u=Math.round(Dr.u),255<Dr.u?Dr.u=255:0>Dr.u&&(Dr.u=0),Dr.o=Math.round(Dr.o),255<Dr.o?Dr.o=255:0>Dr.o&&(Dr.o=0),"rgba("+Dr.j+", "+Dr.u+", "+Dr.o+", "+Dr.F+")";case n1:return sv(),Dl.o=Math.min(100,Math.max(0,Dl.o+100*a)),"hsla("+Dl.j+", "+Dl.u+"%, "+Dl.o+"%, "+Dl.F+")";default:fe("Unknown color space: "+y)}}function $h(a){gg||(hv(),gg=!0);var y=fv;if(y!==null){y.clearRect(0,0,1,1),y.fillStyle="#000000";var x=y.fillStyle;y.fillStyle=a,y.fillStyle!==x?(y.fillRect(0,0,1,1),a=y.getImageData(0,0,1,1).data,Dr.j=a[0],Dr.u=a[1],Dr.o=a[2],Dr.F=a[3]/255):(y.fillStyle="#FFFFFF",y.fillStyle=a,Dr.j=0,Dr.u=0,Dr.o=0,Dr.F=1)}}function sv(){var a=Dr.j/255,y=Dr.u/255,x=Dr.o/255,b=Math.max(a,y,x),E=Math.min(a,y,x),z=b-E;if(E=(b+E)/2,z===0)var tt=a=0;else{switch(b){case a:tt=(y-x)/z%6;break;case y:tt=(x-a)/z+2;break;case x:tt=(a-y)/z+4}tt*=60,0>tt&&(tt+=360),a=z/(1-Math.abs(2*E-1))}Dl.j=Math.round(tt),Dl.u=Math.round(100*a),Dl.o=Math.round(100*E),Dl.F=Dr.F}function av(a){return a/=255,.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function lv(a){return .0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}function uv(a){return a>dv?Math.pow(a,1/3):(pm*a+16)/116}function e1(a){var y=a*a*a;return y>dv?y:(116*a-16)/pm}function Nc(a,y){typeof a!="string"&&(a instanceof er||fe("Value for "+y+" must be a color string or a Brush, not "+a))}function hv(){fv=So?new iu(null,void 0,{willReadFrequently:!0}).context:null}Oe.Object.defineProperties(er.prototype,{type:{get:function(){return this.na},set:function(a){this._isFrozen&&An(this,a),this.na=a,this.start.Mc()&&(a===qh?this.start=du:a===Hl&&(this.start=Xi)),this.end.Mc()&&(a===qh?this.end=Qa:a===Hl&&(this.end=Xi)),this.xe=null}},color:{get:function(){return this.xk},set:function(a){this._isFrozen&&An(this,a),this.xk=a,this.xe=null}},start:{get:function(){return this.Qd},set:function(a){this._isFrozen&&An(this,a),this.Qd=a.J(),this.xe=null}},end:{get:function(){return this.Lk},set:function(a){this._isFrozen&&An(this,a),this.Lk=a.J(),this.xe=null}},startRadius:{get:function(){return this.Gr},set:function(a){this._isFrozen&&An(this,a),0>a&&ri(a,">= zero",er,"startRadius"),this.Gr=a,this.xe=null}},endRadius:{get:function(){return this.Xp},set:function(a){this._isFrozen&&An(this,a),0>a&&ri(a,">= zero",er,"endRadius"),this.Xp=a,this.xe=null}},colorStops:{get:function(){return this.we},set:function(a){this._isFrozen&&An(this,a),this.we=a,this.xe=null}},pattern:{get:function(){return this.cr},set:function(a){this._isFrozen&&An(this,a),this.cr=a,this.xe=null}}}),er.prototype.isDark=er.prototype.Gx,er.prototype.darkenBy=er.prototype.Wy,er.prototype.lightenBy=er.prototype.Vz,er.prototype.addColorStop=er.prototype.addColorStop;var dv=216/24389,pm=24389/27,cg=[95.047,100,108.883],fv=null,Dr=new hp,Dl=new hp,ka=new hp,Mh=new hp,gg=!1;er.className="Brush";var Ld;er.Solid=Ld=new me(er,"Solid",0);var qh;er.Linear=qh=new me(er,"Linear",1);var Hl;er.Radial=Hl=new me(er,"Radial",2);var pg;er.Pattern=pg=new me(er,"Pattern",4);var mg;er.Lab=mg=new me(er,"Lab",5);var n1;er.HSL=n1=new me(er,"HSL",6),er.randomColor=function(a,y){a===void 0&&(a=128),y===void 0&&(y=Math.max(a,255));var x=Math.abs(y-a);y=Math.floor(a+Math.random()*x).toString(16);var b=Math.floor(a+Math.random()*x).toString(16);return a=Math.floor(a+Math.random()*x).toString(16),2>y.length&&(y="0"+y),2>b.length&&(b="0"+b),2>a.length&&(a="0"+a),"#"+y+b+a},er.isValidColor=function(a){if(a==="black")return!0;if(a==="")return!1;gg||(hv(),gg=!0);var y=fv;if(y===null)return!0;y.fillStyle="#000000";var x=y.fillStyle;return y.fillStyle=a,y.fillStyle!==x?!0:(y.fillStyle="#FFFFFF",x=y.fillStyle,y.fillStyle=a,y.fillStyle!==x)},er.lighten=function(a){return qy(a)},er.lightenBy=qy,er.darken=function(a){return t1(a)},er.darkenBy=t1,er.mix=ov,er.isDark=dg;function es(){this.xa="Base"}es.prototype.measure=function(){},es.prototype.Yz=function(a,y,x,b,E){a.measure(y,x,b,E)},es.prototype.arrange=function(){},es.prototype.Ly=function(a,y,x,b,E,z){a.arrange(y,x,b,E,z)},es.prototype.iA=function(a){a.Uj()},es.prototype.gc=function(){},Oe.Object.defineProperties(es.prototype,{name:{get:function(){return this.xa},set:function(a){this.xa=a}},classType:{get:function(){return Re}}}),es.prototype.remeasureObject=es.prototype.iA,es.prototype.arrangeElement=es.prototype.Ly,es.prototype.measureElement=es.prototype.Yz,es.className="PanelLayout";function mm(){this.xa="Base"}le(mm,es),mm.prototype.measure=function(a,y,x,b,E,z,tt){var rt=b.length;a=td(a);for(var ot=0;ot<rt;ot++){var at=b[ot];if(at.visible||at===a){var ut=at.margin,ct=ut.right+ut.left;ut=ut.top+ut.bottom,at.measure(y,x,z,tt);var mt=at.measuredBounds;ct=Math.max(mt.width+ct,0),ut=Math.max(mt.height+ut,0),mt=at.position.x;var yt=at.position.y;isFinite(mt)||(mt=0),isFinite(yt)||(yt=0),at instanceof Qn&&at.isGeometryPositioned&&(at=at.strokeWidth/2,mt-=at,yt-=at),co(E,mt,yt,ct,ut)}}},mm.prototype.arrange=function(a,y,x){var b=y.length,E=a.padding;for(a=x.x-E.left,x=x.y-E.top,E=0;E<b;E++){var z=y[E],tt=z.measuredBounds,rt=z.margin,ot=z.position.x,at=z.position.y;if(ot=isNaN(ot)?-a:ot-a,at=isNaN(at)?-x:at-x,z instanceof Qn&&z.isGeometryPositioned){var ut=z.strokeWidth/2;ot-=ut,at-=ut}z.visible&&z.arrange(ot+rt.left,at+rt.top,tt.width,tt.height)}};function vm(){this.xa="Base"}le(vm,es),vm.prototype.measure=function(a,y,x,b,E,z,tt){var rt=b.length;y=Kn(),z=td(a);for(var ot=0;ot<rt;ot++){var at=b[ot];if(at.visible||at===z){var ut=Wa(at,!1);if(ut!==Ee&&ut!==gn)y.push(at);else{at.measure(1/0,x,0,tt),ut=at.margin,at=at.measuredBounds;var ct=Math.max(at.height+ut.top+ut.bottom,0);E.width+=Math.max(at.width+ut.right+ut.left,0),E.height=Math.max(E.height,ct)}}}for(b=y.length,a.desiredSize.height?x=Math.min(a.desiredSize.height,a.maxSize.height):E.height!==0&&(x=Math.min(E.height,a.maxSize.height)),a=0;a<b;a++)ot=y[a],(ot.visible||ot===z)&&(ut=ot.margin,rt=ut.right+ut.left,ut=ut.top+ut.bottom,ot.measure(1/0,x,0,tt),ot=ot.measuredBounds,ut=Math.max(ot.height+ut,0),E.width+=Math.max(ot.width+rt,0),E.height=Math.max(E.height,ut));zn(y)},vm.prototype.arrange=function(a,y,x){for(var b=y.length,E=a.padding,z=E.top,tt=a.isOpposite,rt=tt?x.width:E.left,ot=0;ot<b;ot++){var at=z,ut=y[ot];if(ut.visible){var ct=ut.measuredBounds,mt=ut.margin,yt=mt.top+mt.bottom,St=z+E.bottom,Lt=ct.height,Ot=Wa(ut,!1);(isNaN(ut.desiredSize.height)&&Ot===Ae||Ot===Fn)&&(Lt=Math.max(x.height-yt-St,0)),yt=Lt+yt+St,St=ut.alignment,St.Xb()&&(St=a.defaultAlignment),St.sb()||(St=Xi),tt&&(rt-=ct.width+mt.left+mt.right),ut.arrange(rt+St.offsetX+mt.left,at+St.offsetY+mt.top+(x.height*St.y-yt*St.y),ct.width,Lt),tt||(rt+=ct.width+mt.left+mt.right)}}};function ym(){this.xa="Base"}le(ym,es),ym.prototype.measure=function(a,y,x,b,E,z){var tt=b.length;x=Kn();for(var rt=td(a),ot=0;ot<tt;ot++){var at=b[ot];if(at.visible||at===rt){var ut=Wa(at,!1);if(ut!==Ee&&ut!==Fn)x.push(at);else{var ct=at.margin;ut=ct.right+ct.left,ct=ct.top+ct.bottom,at.measure(y,1/0,z,0),at=at.measuredBounds,Ra(E,Math.max(E.width,Math.max(at.width+ut,0)),E.height+Math.max(at.height+ct,0))}}}if(b=x.length,b!==0){for(a.desiredSize.width?y=Math.min(a.desiredSize.width,a.maxSize.width):E.width!==0&&(y=Math.min(E.width,a.maxSize.width)),a=0;a<b;a++)ot=x[a],(ot.visible||ot===rt)&&(at=ot.margin,tt=at.right+at.left,at=at.top+at.bottom,ot.measure(y,1/0,z,0),ot=ot.measuredBounds,at=Math.max(ot.height+at,0),E.width=Math.max(E.width,Math.max(ot.width+tt,0)),E.height+=at);zn(x)}},ym.prototype.arrange=function(a,y,x){for(var b=y.length,E=a.padding,z=E.left,tt=a.isOpposite,rt=tt?x.height:E.top,ot=0;ot<b;ot++){var at=z,ut=y[ot];if(ut.visible){var ct=ut.measuredBounds,mt=ut.margin,yt=mt.left+mt.right,St=z+E.right,Lt=ct.width,Ot=Wa(ut,!1);(isNaN(ut.desiredSize.width)&&Ot===Ae||Ot===gn)&&(Lt=Math.max(x.width-yt-St,0)),yt=Lt+yt+St,St=ut.alignment,St.Xb()&&(St=a.defaultAlignment),St.sb()||(St=Xi),tt&&(rt-=ct.height+mt.bottom+mt.top),ut.arrange(at+St.offsetX+mt.left+(x.width*St.x-yt*St.x),rt+St.offsetY+mt.top,Lt,ct.height),tt||(rt+=ct.height+mt.bottom+mt.top)}}};function Sm(){this.xa="Base"}le(Sm,es),Sm.prototype.measure=function(a,y,x,b,E,z,tt){var rt=b.length,ot=a.Pb(),at=ot.margin,ut=at.right+at.left,ct=at.top+at.bottom;ot.measure(y,x,z,tt);var mt=ot.measuredBounds;z=mt.width,tt=mt.height;var yt=Math.max(z+ut,0),St=Math.max(tt+ct,0),Lt=a.isClipping,Ot=ye.allocAt(-at.left,-at.top,yt,St),Dt=ye.allocAt(0,0,z,tt);cv(ot,Dt,!0),z=Dt.width,tt=Dt.height;for(var Gt=!0,Vt=td(a),Yt=0;Yt<rt;Yt++){var qt=b[Yt];mt=y;var ae=x;if(qt!==ot&&(qt.visible||qt===Vt)){at=qt.margin;var Je=at.left,un=at.top;switch(yt=at.right+at.left,St=at.top+at.bottom,at=Wa(qt,!1),at){case Ae:mt=z,ae=tt,un=Je=St=yt=0;break;case gn:mt=z,Je=yt=0;break;case Fn:ae=tt,un=St=0}qt.measure(mt,ae,0,0),mt=qt.measuredBounds,yt=Math.max(mt.width+yt,0),St=Math.max(mt.height+St,0),at=qt.alignment,at.Xb()&&(at=a.defaultAlignment),at.sb()||(at=Xi);var nn=qt.alignmentFocus;if(nn.Xb()&&(nn=Xi),ae=null,qt instanceof Re&&qt.$e!==""&&(ae=qt.fb(qt.$e),ae===qt&&(ae=null)),Je=Dt.x-Je,un=Dt.y-un,ae!==null){for(qt.arrange(0,0,mt.width,mt.height),mt=ae.actualBounds,mt=jt.allocAt(mt.x+(nn.x*mt.width-nn.offsetX),mt.y+(nn.y*mt.height-nn.offsetY)),ae=ae.panel;ae!==qt;)ae.transform.Ga(mt),ae=ae.panel;Je+=at.x*z+at.offsetX-mt.x,un+=at.y*tt+at.offsetY-mt.y,jt.free(mt)}else Je+=at.x*z+at.offsetX-(nn.x*mt.width+nn.offsetX),un+=at.y*tt+at.offsetY-(nn.y*mt.height+nn.offsetY);Gt?(Gt=!1,E.h(Je,un,yt,St)):co(E,Je,un,yt,St)}}switch(Gt?E.assign(Ot):Lt?E.Uu(Dt.x,Dt.y,Dt.width,Dt.height):co(E,Ot.x,Ot.y,Ot.width,Ot.height),ye.free(Ot),ye.free(Dt),at=ot.stretch,at===Xn&&(at=Wa(ot,!1)),at){case Ee:return;case Ae:if(!isFinite(y)&&!isFinite(x))return;break;case gn:if(!isFinite(y))return;break;case Fn:if(!isFinite(x))return}for(mt=ot.measuredBounds,z=mt.width,tt=mt.height,yt=Math.max(z+ut,0),St=Math.max(tt+ct,0),at=ot.margin,Dt=ye.allocAt(-at.left,-at.top,yt,St),cv(ot,Dt,!0),z=Dt.width,tt=Dt.height,y=0;y<rt;y++)x=b[y],x===ot||!x.visible&&x!==Vt||(at=x.margin,yt=at.right+at.left,St=at.top+at.bottom,mt=x.measuredBounds,yt=Math.max(mt.width+yt,0),St=Math.max(mt.height+St,0),ut=x.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Xi),x=x.alignmentFocus,x.Xb()&&(x=Xi),Gt?(Gt=!1,E.h(ut.x*z+ut.offsetX-(x.x*mt.width+x.offsetX)-at.left,ut.y*tt+ut.offsetY-(x.y*mt.height+x.offsetY)-at.top,yt,St)):co(E,ut.x*z+ut.offsetX-(x.x*mt.width+x.offsetX)-at.left,ut.y*tt+ut.offsetY-(x.y*mt.height+x.offsetY)-at.top,yt,St));Gt?E.assign(Ot):Lt?E.Uu(Dt.x,Dt.y,Dt.width,Dt.height):co(E,Ot.x,Ot.y,Ot.width,Ot.height),ye.free(Dt)},Sm.prototype.arrange=function(a,y,x){var b=y.length,E=a.Pb(),z=E.measuredBounds,tt=z.width,rt=z.height,ot=a.padding;z=ot.left,ot=ot.top;var at=z-x.x,ut=ot-x.y;for(E.arrange(at,ut,tt,rt),tt=ye.allocAt(0,0,tt,rt),cv(E,tt,!1),rt=0;rt<b;rt++){var ct=y[rt];if(ct!==E){at=ct.measuredBounds;var mt=at.width,yt=at.height;ut=ct.alignment,ut.Xb()&&(ut=a.defaultAlignment),ut.sb()||(ut=Xi);var St=ct.alignmentFocus;if(St.Xb()&&(St=Xi),at=null,ct instanceof Re&&ct.$e!==""&&(at=ct.fb(ct.$e),at===ct&&(at=null)),at!==null){var Lt=at.actualBounds;for(St=jt.allocAt(Lt.x+(St.x*Lt.width-St.offsetX),Lt.y+(St.y*Lt.height-St.offsetY)),at=at.panel;at!==ct;)at.transform.Ga(St),at=at.panel;at=ut.x*tt.width+ut.offsetX-St.x,ut=ut.y*tt.height+ut.offsetY-St.y,jt.free(St)}else at=ut.x*tt.width+ut.offsetX-(St.x*mt+St.offsetX),ut=ut.y*tt.height+ut.offsetY-(St.y*yt+St.offsetY);at+=tt.x-x.x,ut+=tt.y-x.y,ct.visible&&ct.arrange(z+at,ot+ut,mt,yt)}}ye.free(tt)};function cv(a,y,x){var b=null;if(a instanceof Re&&a.$e!==""&&(b=a.fb(a.$e),b===a&&(b=null)),b!==null)for(x&&a.arrange(0,0,y.width,y.height),y.assign(b.actualBounds),b=b.panel;b!==a;)b.transform.pp(y),b=b.panel}function xm(){this.xa="Base"}le(xm,es),xm.prototype.measure=function(a,y,x,b,E,z,tt){var rt=b.length,ot=a.Pb(),at=ot.margin,ut=y,ct=x,mt=at.right+at.left,yt=at.top+at.bottom;ot.measure(y,x,z,tt),at=ot.measuredBounds;var St=0,Lt=null;ot instanceof Qn&&(Lt=ot,St=Lt.strokeWidth*Lt.scale);var Ot=Math.max(at.width+mt,0);at=Math.max(at.height+yt,0);var Dt=vv(ot),Gt=Dt.x*Ot+Dt.offsetX;Dt=Dt.y*at+Dt.offsetY;var Vt=yv(ot),Yt=Vt.x*Ot+Vt.offsetX;for(Vt=Vt.y*at+Vt.offsetY,isFinite(y)&&(ut=Math.max(Math.abs(Gt-Yt)-St,0)),isFinite(x)&&(ct=Math.max(Math.abs(Dt-Vt)-St,0)),St=Ze.alloc(),St.h(0,0),a=td(a),Vt=0;Vt<rt;Vt++)Dt=b[Vt],Dt===ot||!Dt.visible&&Dt!==a||(at=Dt.margin,Ot=at.right+at.left,Gt=at.top+at.bottom,Dt.measure(ut,ct,0,0),at=Dt.measuredBounds,Ot=Math.max(at.width+Ot,0),at=Math.max(at.height+Gt,0),St.h(Math.max(Ot,St.width),Math.max(at,St.height)));if(rt===1)E.width=Ot,E.height=at,Ze.free(St);else{switch(Dt=vv(ot),Vt=yv(ot),rt=b=0,Vt.x!==Dt.x&&Vt.y!==Dt.y&&(b=St.width/Math.abs(Vt.x-Dt.x),rt=St.height/Math.abs(Vt.y-Dt.y)),Ze.free(St),St=0,Lt!==null&&(St=Lt.strokeWidth*Lt.scale,Lv(Lt)===dn&&(b=rt=Math.max(b,rt))),b+=Math.abs(Dt.offsetX)+Math.abs(Vt.offsetX)+St,rt+=Math.abs(Dt.offsetY)+Math.abs(Vt.offsetY)+St,Lt=ot.stretch,Lt===Xn&&(Lt=Wa(ot,!1)),Lt){case Ee:tt=z=0;break;case Ae:isFinite(y)&&(b=y),isFinite(x)&&(rt=x);break;case gn:isFinite(y)&&(b=y),tt=0;break;case Fn:z=0,isFinite(x)&&(rt=x)}ot.Uj(),ot.measure(b,rt,z,tt),E.width=ot.measuredBounds.width+mt,E.height=ot.measuredBounds.height+yt}},xm.prototype.arrange=function(a,y){var x=y.length,b=a.Pb(),E=b.measuredBounds,z=ye.alloc();z.h(0,0,1,1);var tt=b.margin,rt=tt.left;tt=tt.top;var ot=a.padding,at=ot.left;ot=ot.top,b.arrange(at+rt,ot+tt,E.width,E.height);var ut=vv(b),ct=yv(b),mt=ut.y*E.height+ut.offsetY,yt=ct.x*E.width+ct.offsetX;for(ct=ct.y*E.height+ct.offsetY,z.x=ut.x*E.width+ut.offsetX,z.y=mt,co(z,yt,ct,0,0),z.x+=rt+at,z.y+=tt+ot,E=0;E<x;E++)rt=y[E],rt!==b&&(at=rt.measuredBounds,tt=rt.margin,ot=Math.max(at.width+tt.right+tt.left,0),ut=Math.max(at.height+tt.top+tt.bottom,0),mt=rt.alignment,mt.Xb()&&(mt=a.defaultAlignment),mt.sb()||(mt=Xi),ot=z.width*mt.x+mt.offsetX-ot*mt.x+tt.left+z.x,tt=z.height*mt.y+mt.offsetY-ut*mt.y+tt.top+z.y,rt.visible&&(ps(z.x,z.y,z.width,z.height,ot,tt,at.width,at.height)?rt.arrange(ot,tt,at.width,at.height):rt.arrange(ot,tt,at.width,at.height,new ye(z.x,z.y,z.width,z.height))));ye.free(z)};function Pm(){this.xa="Base",this.name="Table"}le(Pm,es),Pm.prototype.measure=function(a,y,x,b,E){for(var z=b.length,tt=Kn(),rt=Kn(),ot=0;ot<z;ot++){var at=b[ot],ut=at instanceof Re?at:null;if(ut!==null&&Md(ut)&&at.visible){rt.push(ut);for(var ct=ut.O.s,mt=ct.length,yt=0;yt<mt;yt++){var St=ct[yt];ut.type===Re.TableRow?St.row=at.row:ut.type===Re.TableColumn&&(St.column=at.column),tt.push(St)}}else tt.push(at)}z=tt.length,z===0&&(a.Fb(0),a.Eb(0));for(var Lt=[],Ot=0;Ot<z;Ot++){var Dt=tt[Ot];Dt.visible&&(Zo(Dt,!0),Ch(Dt,!0),Lt[Dt.row]||(Lt[Dt.row]=[]),Lt[Dt.row][Dt.column]||(Lt[Dt.row][Dt.column]=[]),Lt[Dt.row][Dt.column].push(Dt))}zn(tt);var Gt=Kn(),Vt=Kn(),Yt=Kn(),qt={count:0},ae={count:0},Je=y,un=x,nn=a.rowDefs,Ge=a.colDefs,we=null;z=nn.length;for(var Un=0;Un<z;Un++)we=nn[Un],we!==void 0&&(we.actual=0);z=Ge.length;for(var jn=0;jn<z;jn++)we=Ge[jn],we!==void 0&&(we.actual=0);for(var ji=Lt.length,Lr=0,ds=0;ds<ji;ds++)Lt[ds]&&(Lr=Math.max(Lr,Lt[ds].length));var xs=Math.min(a.topIndex,ji-1),ca=Math.min(a.leftIndex,Lr-1),fs=0;ji=Lt.length;for(var Od=td(a),Wo=0;Wo<ji;Wo++)if(Lt[Wo]){Lr=Lt[Wo].length;var Vu=a.Fb(Wo);Vu.actual=0;for(var ga=Vu.oc=0;ga<Lr;ga++)if(Lt[Wo][ga]){var Id=a.Eb(ga);Gt[ga]===void 0&&(Id.actual=0,Id.oc=0,Gt[ga]=!0);for(var Ol=Lt[Wo][ga],au=Ol.length,yl=0;yl<au;yl++){var sl=Ol[yl];if(sl.visible||sl===Od){var yf=1<sl.rowSpan||1<sl.columnSpan;yf&&(Wo<xs||ga<ca||Vt.push(sl));var Wu=sl.margin,zg=Wu.right+Wu.left,Sl=Wu.top+Wu.bottom,pa=ju(sl,Vu,Id,!1),Qp=sl.desiredSize,Vc=!isNaN(Qp.height),uh=!isNaN(Qp.width)&&Vc;if(yf||pa===Ee||uh||Wo<xs||ga<ca||(qt[ga]!==void 0||pa!==Ae&&pa!==gn||(qt[ga]=-1,qt.count++),ae[Wo]!==void 0||pa!==Ae&&pa!==Fn||(ae[Wo]=-1,ae.count++),Yt.push(sl)),sl.measure(1/0,1/0,0,0),!(Wo<xs||ga<ca)){var al=sl.measuredBounds,ac=Math.max(al.width+zg,0),xl=Math.max(al.height+Sl,0);if(sl.rowSpan===1&&(pa===Ee||pa===gn)){we=a.Fb(Wo);var Sf=we.Wc();fs=Math.max(xl-we.actual,0),fs+Sf>un&&(fs=Math.max(un-Sf,0));var W0=we.oa===0;we.oc=we.oc+fs,we.actual=we.oa+fs,un=Math.max(un-(fs+(W0?Sf:0)),0)}if(sl.columnSpan===1&&(pa===Ee||pa===Fn)){we=a.Eb(ga);var $p=we.Wc();fs=Math.max(ac-we.actual,0),fs+$p>Je&&(fs=Math.max(Je-$p,0));var Gy=we.oa===0;we.oc=we.oc+fs,we.actual=we.oa+fs,Je=Math.max(Je-(fs+(Gy?$p:0)),0)}yf&&sl.Uj()}}}}}zn(Gt);var Bh=0,id=0;z=a.columnCount;for(var Wc=0;Wc<z;Wc++){var xf=Ge[Wc];xf!==void 0&&(Bh+=isNaN(xf.Hc)?xf.oc:xf.Hc,xf.oc!==0&&(Bh+=xf.Wc()))}z=a.rowCount;for(var Gg=0;Gg<z;Gg++){var Pf=nn[Gg];Pf!==void 0&&(id+=isNaN(Pf.Hc)?Pf.oc:Pf.Hc,Pf.oc!==0&&(id+=Pf.Wc()))}Je=Math.max(y-Bh,0);var Oh=un=Math.max(x-id,0),Rd=Je;z=Yt.length;for(var ll=0;ll<z;ll++){var hh=Yt[ll],U0=a.Fb(hh.row),rd=a.Eb(hh.column),_g=hh.measuredBounds,Uu=hh.margin,lc=Uu.right+Uu.left,dh=Uu.top+Uu.bottom;qt[hh.column]=rd.oc===0&&qt[hh.column]!==void 0?Math.max(_g.width+lc,qt[hh.column]):null,ae[hh.row]=U0.oc===0&&ae[hh.row]!==void 0?Math.max(_g.height+dh,ae[hh.row]):null}var Uc=0,Hg=0,Lu;for(Lu in ae)Lu!=="count"&&(Uc+=ae[Lu]);for(Lu in qt)Lu!=="count"&&(Hg+=qt[Lu]);for(var Rs=Ze.alloc(),qp=0;qp<z;qp++){var Aa=Yt[qp];if(Aa.visible||Aa===Od){var Uo=a.Fb(Aa.row),Ba=a.Eb(Aa.column),od=0;isFinite(Ba.width)?od=Ba.width:(isFinite(Je)&&qt[Aa.column]!==null?Hg===0?od=Ba.actual+Je:od=qt[Aa.column]/Hg*Rd:qt[Aa.column]!==null?od=Je:od=Ba.actual||Je,od=Math.max(0,od-Ba.Wc()));var jd=0;switch(isFinite(Uo.height)?jd=Uo.height:(isFinite(un)&&ae[Aa.row]!==null?Uc===0?jd=Uo.actual+un:jd=ae[Aa.row]/Uc*Oh:ae[Aa.row]!==null?jd=un:jd=Uo.actual||un,jd=Math.max(0,jd-Uo.Wc())),Rs.h(Math.max(Ba.minimum,Math.min(od,Ba.maximum)),Math.max(Uo.minimum,Math.min(jd,Uo.maximum))),pa=ju(Aa,Uo,Ba,!1),pa){case gn:Rs.height=Math.max(Rs.height,Uo.actual+un);break;case Fn:Rs.width=Math.max(Rs.width,Ba.actual+Je)}var uc=Aa.margin,_y=uc.right+uc.left,K0=uc.top+uc.bottom;Aa.Uj(),Aa.measure(Rs.width,Rs.height,Ba.minimum,Uo.minimum);var Vg=Aa.measuredBounds,hc=Math.max(Vg.width+_y,0),Kc=Math.max(Vg.height+K0,0);isFinite(Je)&&(hc=Math.min(hc,Rs.width)),isFinite(un)&&(Kc=Math.min(Kc,Rs.height));var ul=0;ul=Uo.actual,Uo.actual=Math.max(Uo.actual,Kc),Uo.oc=Math.max(Uo.oc,Kc),fs=Uo.actual-ul,un=Math.max(un-fs,0),ae[Aa.row]===null&&(Oh=Math.max(Oh-fs,0)),ul=Ba.actual,Ba.actual=Math.max(Ba.actual,hc),Ba.oc=Math.max(Ba.oc,hc),fs=Ba.actual-ul,Je=Math.max(Je-fs,0),qt[Aa.column]===null&&(Rd=Math.max(Rd-fs,0))}}zn(Yt);var sd=Ze.alloc(),Ku=Kn(),Yl=Kn();if(z=Vt.length,z!==0){for(var wf=0;wf<ji;wf++)if(Lt[wf]){Lr=Lt[wf].length;var Wg=a.Fb(wf);Ku[wf]=Wg.actual;for(var Cf=0;Cf<Lr;Cf++)if(Lt[wf][Cf]){var Y0=a.Eb(Cf);Yl[Cf]=Y0.actual}}}for(var Ug=0;Ug<z;Ug++){var Eo=Vt[Ug];if(Eo.visible||Eo===Od){var Mu=a.Fb(Eo.row),lu=a.Eb(Eo.column);switch(Rs.h(Math.max(lu.minimum,Math.min(y,lu.maximum)),Math.max(Mu.minimum,Math.min(x,Mu.maximum))),pa=ju(Eo,Mu,lu,!1),pa){case Ae:Yl[lu.index]!==0&&(Rs.width=Math.min(Rs.width,Yl[lu.index])),Ku[Mu.index]!==0&&(Rs.height=Math.min(Rs.height,Ku[Mu.index]));break;case gn:Yl[lu.index]!==0&&(Rs.width=Math.min(Rs.width,Yl[lu.index]));break;case Fn:Ku[Mu.index]!==0&&(Rs.height=Math.min(Rs.height,Ku[Mu.index]))}isFinite(lu.width)&&(Rs.width=lu.width),isFinite(Mu.height)&&(Rs.height=Mu.height),sd.h(0,0);for(var X0=lu.minimum,Pl=Mu.minimum,zd=1;zd<Eo.rowSpan&&!(Eo.row+zd>=a.rowCount);zd++)we=a.Fb(Eo.row+zd),fs=0,fs=pa===Ae||pa===Fn?Math.max(we.minimum,Ku[Eo.row+zd]===0?we.maximum:Math.min(Ku[Eo.row+zd],we.maximum)):Math.max(we.minimum,isNaN(we.Hc)?we.maximum:Math.min(we.Hc,we.maximum)),sd.height+=fs,Pl+=we.minimum;for(var uu=1;uu<Eo.columnSpan&&!(Eo.column+uu>=a.columnCount);uu++)we=a.Eb(Eo.column+uu),fs=0,fs=pa===Ae||pa===gn?Math.max(we.minimum,Yl[Eo.column+uu]===0?we.maximum:Math.min(Yl[Eo.column+uu],we.maximum)):Math.max(we.minimum,isNaN(we.Hc)?we.maximum:Math.min(we.Hc,we.maximum)),sd.width+=fs,X0+=we.minimum;Rs.width+=sd.width,Rs.height+=sd.height;var Kg=Eo.margin,Lf=Kg.right+Kg.left,tm=Kg.top+Kg.bottom;Eo.measure(Rs.width,Rs.height,X0,Pl);for(var Yg=Eo.measuredBounds,fh=Math.max(Yg.width+Lf,0),dc=Math.max(Yg.height+tm,0),Mf=0,Xg=0;Xg<Eo.rowSpan&&!(Eo.row+Xg>=a.rowCount);Xg++)we=a.Fb(Eo.row+Xg),Mf+=we.total||0;if(Mf<dc){var Gd=dc-Mf,Ih=dc-Mf;if(Eo.spanAllocation!==null)for(var _d=Eo.spanAllocation,ad=0;ad<Eo.rowSpan&&!(0>=Gd)&&!(Eo.row+ad>=a.rowCount);ad++){we=a.Fb(Eo.row+ad);var Hd=we.oa||0,fc=_d(Eo,we,Ih);we.actual=Math.min(we.maximum,Hd+fc),we.oa!==Hd&&(Gd-=we.oa-Hd)}for(;0<Gd;){var Yu=we.oa||0;if(isNaN(we.height)&&we.maximum>Yu&&(we.actual=Math.min(we.maximum,Yu+Gd),we.oa!==Yu&&(Gd-=we.oa-Yu)),we.index===0)break;we=a.Fb(we.index-1)}}for(var Yc=0,Vd=0;Vd<Eo.columnSpan&&!(Eo.column+Vd>=a.columnCount);Vd++)we=a.Eb(Eo.column+Vd),Yc+=we.total||0;if(Yc<fh){var Xc=fh-Yc,Hy=fh-Yc;if(Eo.spanAllocation!==null)for(var ld=Eo.spanAllocation,cc=0;cc<Eo.columnSpan&&!(0>=Xc)&&!(Eo.column+cc>=a.columnCount);cc++){we=a.Eb(Eo.column+cc);var em=we.oa||0,Vy=ld(Eo,we,Hy);we.actual=Math.min(we.maximum,em+Vy),we.oa!==em&&(Xc-=we.oa-em)}for(;0<Xc;){var Z0=we.oa||0;if(isNaN(we.width)&&we.maximum>Z0&&(we.actual=Math.min(we.maximum,Z0+Xc),we.oa!==Z0&&(Xc-=we.oa-Z0)),we.index===0)break;we=a.Eb(we.index-1)}}}}zn(Vt),Ze.free(sd),Ze.free(Rs),Ku!==void 0&&zn(Ku),Yl!==void 0&&zn(Yl);var Zc=0,Jc=0,J0=a.desiredSize,gx=a.maxSize;pa=Wa(a,!0);var nm=id=Bh=0,im=0;z=a.columnCount;for(var Q0=0;Q0<z;Q0++)Ge[Q0]!==void 0&&(we=a.Eb(Q0),isFinite(we.width)?(nm+=we.width,nm+=we.Wc()):Nm(we)===gp?(nm+=we.oa,nm+=we.Wc()):we.oa!==0&&(Bh+=we.oa,Bh+=we.Wc()));isFinite(J0.width)?Zc=Math.min(J0.width,gx.width):Zc=pa!==Ee&&isFinite(y)?y:Bh,Zc=Math.max(Zc,a.minSize.width),Zc=Math.max(Zc-nm,0);for(var Qx=Bh===0?1:Math.max(Zc/Bh,1),$0=0;$0<z;$0++)Ge[$0]!==void 0&&(we=a.Eb($0),isFinite(we.width)||Nm(we)===gp||(we.actual=we.oa*Qx),we.position=E.width,we.oa!==0&&(E.width+=we.oa,E.width+=we.Wc()));z=a.rowCount;for(var q0=0;q0<z;q0++)nn[q0]!==void 0&&(we=a.Fb(q0),isFinite(we.height)?(im+=we.height,im+=we.Wc()):Nm(we)===gp?(im+=we.oa,im+=we.Wc()):we.oa!==0&&(id+=we.oa,id+=we.Wc()));isFinite(J0.height)?Jc=Math.min(J0.height,gx.height):Jc=pa!==Ee&&isFinite(x)?x:id,Jc=Math.max(Jc,a.minSize.height),Jc=Math.max(Jc-im,0);for(var $x=id===0?1:Math.max(Jc/id,1),tv=0;tv<z;tv++)nn[tv]!==void 0&&(we=a.Fb(tv),isFinite(we.height)||Nm(we)===gp||(we.actual=we.oa*$x),we.position=E.height,we.oa!==0&&(E.height+=we.oa,E.height+=we.Wc()));z=rt.length;for(var Wy=0;Wy<z;Wy++){var rm=rt[Wy],Uy=0,Ky=0;rm.type===Re.TableRow?(Uy=E.width,we=a.Fb(rm.row),Ky=we.actual):(we=a.Eb(rm.column),Uy=we.actual,Ky=E.height),rm.measuredBounds.h(0,0,Uy,Ky),Zo(rm,!1)}zn(rt),a.inRowsCols=Lt},Pm.prototype.arrange=function(a,y,x){var b=y.length,E=a.padding,z=E.left;E=E.top;var tt=a.inRowsCols;if(tt!==null){for(var rt,ot,at=tt.length,ut=0,ct=0;ct<at;ct++)tt[ct]&&(ut=Math.max(ut,tt[ct].length));ot=a.rowDefs,rt=a.colDefs;var mt=ct=0,yt=Math.min(a.topIndex,at-1);if(0<ot.length){for(;yt!==at&&(ot[yt]===void 0||ot[yt].oa===0);)yt++;yt=Math.max(Math.min(yt,at-1),0),ct=-ot[yt].position}var St=Math.min(a.leftIndex,ut-1);if(0<rt.length){for(;St!==ut&&(rt[St]===void 0||rt[St].oa===0);)St++;St=Math.max(Math.min(St,ut-1),0),mt=-rt[St].position}for(var Lt=0,Ot=0;Lt!==at&&ot[Lt]===void 0;)Lt++;for(;Ot!==at&&rt[Ot]===void 0;)Ot++;ut=a.part,a.Fb(Lt),a.Eb(Ot);for(var Dt=0;Dt<y.length;Dt++){var Gt=y[Dt];if(Gt instanceof Re&&Gt.visible&&Md(Gt)){if(Gt.type===Re.TableRow){rt=a.Fb(Gt.row);var Vt=a.Eb(Ot)}else rt=a.Fb(Lt),Vt=a.Eb(Gt.column);ot=rt.position+ct+E,rt.oa!==0&&(ot+=rt.Io(Math.max(Lt,yt))),rt=Vt.position+mt+z,Vt.oa!==0&&(rt+=Vt.Io(Math.max(Ot,St))),Vt=Gt.measuredBounds,Gt.Uk(),Gt.actualBounds.ka();var Yt=Gt.actualBounds,qt=ye.allocAt(Yt.x,Yt.y,Yt.width,Yt.height);Yt.x=Gt.type===Re.TableRow?z:rt,Yt.y=Gt.type===Re.TableColumn?E:ot,Yt.width=Vt.width,Yt.height=Vt.height,Gt.actualBounds.freeze(),Ch(Gt,!1),os(qt,Yt)||ut===null||(ut.oh(),Gt.Pn(ut)),ye.free(qt)}}for(Dt=Ze.alloc(),Gt=0;Gt<at;Gt++)if(tt[Gt]){for(ut=tt[Gt].length,Vt=a.Fb(Gt),ot=Vt.position+ct+E,Vt.oa!==0&&(ot+=Vt.Io(Math.max(Lt,yt))),Yt=0;Yt<ut;Yt++)if(tt[Gt][Yt]){qt=a.Eb(Yt),rt=qt.position+mt+z,qt.oa!==0&&(rt+=qt.Io(Math.max(Ot,St)));for(var ae=tt[Gt][Yt],Je=ae.length,un=0;un<Je;un++){var nn=ae[un],Ge=nn.measuredBounds;Dt.h(0,0);for(var we=1;we<nn.rowSpan&&!(Gt+we>=a.rowCount);we++){var Un=a.Fb(Gt+we);Un.oa!==0&&(Dt.height+=Un.total)}for(we=1;we<nn.columnSpan&&!(Yt+we>=a.columnCount);we++)Un=a.Eb(Yt+we),Un.oa!==0&&(Dt.width+=Un.total);var jn=qt.oa+Dt.width,ji=Vt.oa+Dt.height;we=rt,Un=ot;var Lr=jn,ds=ji,xs=rt,ca=ot,fs=jn,Od=ji;rt+jn>x.width&&(fs=Math.max(x.width-rt,0)),ot+ji>x.height&&(Od=Math.max(x.height-ot,0));var Wo=nn.alignment;if(Wo.Xb()){Wo=a.defaultAlignment,Wo.sb()||(Wo=Xi);var Vu=Wo.x,ga=Wo.y,Id=Wo.offsetX;Wo=Wo.offsetY;var Ol=qt.alignment,au=Vt.alignment;Ol.sb()&&(Vu=Ol.x,Id=Ol.offsetX),au.sb()&&(ga=au.y,Wo=au.offsetY)}else Vu=Wo.x,ga=Wo.y,Id=Wo.offsetX,Wo=Wo.offsetY;(isNaN(Vu)||isNaN(ga))&&(ga=Vu=.5,Wo=Id=0),Ol=Ge.width,au=Ge.height;var yl=nn.margin,sl=yl.left+yl.right,yf=yl.top+yl.bottom,Wu=ju(nn,Vt,qt,!1);!isNaN(nn.desiredSize.width)||Wu!==Ae&&Wu!==gn||(Ol=Math.max(jn-sl,0)),!isNaN(nn.desiredSize.height)||Wu!==Ae&&Wu!==Fn||(au=Math.max(ji-yf,0)),jn=nn.maxSize,ji=nn.minSize,Ol=Math.min(jn.width,Ol),au=Math.min(jn.height,au),Ol=Math.max(ji.width,Ol),au=Math.max(ji.height,au),jn=au+yf,we+=Lr*Vu-(Ol+sl)*Vu+Id+yl.left,Un+=ds*ga-jn*ga+Wo+yl.top,nn.visible&&(ps(xs,ca,fs,Od,we,Un,Ge.width,Ge.height)?nn.arrange(we,Un,Ol,au):nn.arrange(we,Un,Ol,au,new ye(xs,ca,fs,Od)))}}}for(Ze.free(Dt),a=0;a<b;a++)x=y[a],z=x instanceof Re?x:null,z!==null&&Md(z)&&(z=x.actualBounds,x.naturalBounds.ka(),x.naturalBounds.h(0,0,z.width,z.height),x.naturalBounds.freeze())}};function wm(){this.xa="Base"}le(wm,es),wm.prototype.measure=function(){},wm.prototype.arrange=function(){};function Cm(){this.xa="Base"}le(Cm,es),Cm.prototype.measure=function(){},Cm.prototype.arrange=function(){};function Lm(){this.xa="Base"}le(Lm,es),Lm.prototype.measure=function(a,y,x,b,E,z,tt){1<b.length&&fe("Viewbox Panel cannot contain more than one GraphObject."),b=b[0],b.Ca=1,b.Uj(),b.measure(1/0,1/0,z,tt);var rt=b.measuredBounds,ot=b.margin,at=ot.right+ot.left;if(ot=ot.top+ot.bottom,isFinite(y)||isFinite(x)){var ut=b.scale,ct=rt.width;rt=rt.height;var mt=Math.max(y-at,0),yt=Math.max(x-ot,0),St=1;a.viewboxStretch===dn?ct!==0&&rt!==0&&(St=Math.min(mt/ct,yt/rt)):ct!==0&&rt!==0&&(St=Math.max(mt/ct,yt/rt)),St===0&&(St=1e-4),b.Ca*=St,ut!==b.scale&&(Zo(b,!0),b.measure(1/0,1/0,z,tt))}rt=b.measuredBounds,E.width=isFinite(y)?y:Math.max(rt.width+at,0),E.height=isFinite(x)?x:Math.max(rt.height+ot,0)},Lm.prototype.arrange=function(a,y,x){y=y[0];var b=y.measuredBounds,E=y.margin,z=Math.max(b.width+(E.right+E.left),0);E=Math.max(b.height+(E.top+E.bottom),0);var tt=y.alignment;tt.Xb()&&(tt=a.defaultAlignment),tt.sb()||(tt=Xi),y.arrange(x.width*tt.x-z*tt.x+tt.offsetX,x.height*tt.y-E*tt.y+tt.offsetY,b.width,b.height)};function dp(){this.xa="Base"}le(dp,es),dp.prototype.measure=function(){},dp.prototype.arrange=function(){},dp.prototype.gc=function(a,y,x){x=a.Df()*x.scale,0>=x&&(x=1);var b=a.gridCellSize,E=b.width;b=b.height;var z=a.naturalBounds,tt=a.actualBounds,rt=z.width,ot=z.height,at=Math.ceil(rt/E),ut=Math.ceil(ot/b),ct=a.gridOrigin,mt=ct.x;ct=ct.y,y.save(),y.beginPath(),y.rect(0,0,rt,ot),y.clip(),y.Se();for(var yt=[],St=a.O.s,Lt=St.length,Ot=0;Ot<Lt;Ot++){var Dt=St[Ot],Gt=[];if(yt.push(Gt),Dt.visible){var Vt=Dt.interval;if(!(0>Vt)){Dt=pv(Dt.figure);for(var Yt=0;Yt<Lt;Yt++)if(Yt!==Ot){var qt=St[Yt];qt.visible&&pv(qt.figure)===Dt&&(qt=qt.interval,qt>Vt&&Gt.push(qt))}}}}for(St=a.O.s,Lt=St.length,Ot=0;Ot<Lt;Ot++){var ae=St[Ot];if(ae.visible&&(Gt=ae.interval||1,Dt=Math.abs(Gt),!(2>E*Dt*x))){if(Vt=ae.segmentIndex,(!isFinite(Vt)||isNaN(Vt))&&(Vt=0),0>Vt&&(Vt=Dt-Math.min(-Vt,Dt)),Vt=Math.round(Vt%Dt),Dt=ae.opacity,Yt=1,Dt!==1){if(Dt===0)continue;Yt=y.globalAlpha,y.globalAlpha=Yt*Dt}qt=yt[Ot];var Je=!1,un=ae.strokeDashArray;if(un!==null&&(Je=!0,y.js(un,ae.strokeDashOffset)),ae.figure==="LineV"&&ae.stroke!==null&&0<ae.strokeWidth){for(y.lineWidth=ae.strokeWidth,wo(a,y,ae.stroke,!1,!1,z,tt),y.beginPath(),un=ae=Math.floor((mt-E)/E);un<=ae+at;un++){var nn=un*E+mt;0<=nn&&nn<=rt&&Mm(un,Gt,Vt,qt)&&(y.moveTo(nn,0),y.lineTo(nn,ot))}y.stroke(),y.Se()}else if(ae.figure==="LineH"&&ae.stroke!==null&&0<ae.strokeWidth){for(y.lineWidth=ae.strokeWidth,wo(a,y,ae.stroke,!1,!1,z,tt),y.beginPath(),un=ae=Math.floor((ct-b)/b);un<=ae+ut;un++)nn=un*b+ct,0<=nn&&nn<=ot&&Mm(un,Gt,Vt,qt)&&(y.moveTo(0,nn),y.lineTo(rt,nn));y.stroke(),y.Se()}else if(ae.figure==="BarV"&&ae.fill!==null)for(wo(a,y,ae.fill,!0,!1,z,tt),ae=ae.width,isNaN(ae)&&(ae=E),nn=un=Math.floor((mt-E)/E);nn<=un+at;nn++){var Ge=nn*E+mt;0<=Ge+ae&&Ge<=rt&&Mm(nn,Gt,Vt,qt)&&y.fillRect(Ge,0,ae,ot)}else if(ae.figure==="BarH"&&ae.fill!==null)for(wo(a,y,ae.fill,!0,!1,z,tt),ae=ae.height,isNaN(ae)&&(ae=b),nn=un=Math.floor((ct-b)/b);nn<=un+ut;nn++)Ge=nn*b+ct,0<=Ge+ae&&Ge<=ot&&Mm(nn,Gt,Vt,qt)&&y.fillRect(0,Ge,rt,ae);Je&&y.fs(),Dt!==1&&(y.globalAlpha=Yt)}}y.restore(),y.Vc(!1)};function Mm(a,y,x,b){if(0>y)return a%y===x;if(a%y!==x)return!1;y=b.length;for(var E=0;E<y;E++)if(a%b[E]===x)return!1;return!0}function km(){this.xa="Base"}le(km,es),km.prototype.measure=function(a,y,x,b,E){var z=b.length;if(a instanceof Bi||a instanceof _e){var tt=null,rt=null;if(a instanceof _e&&(tt=a),a instanceof Bi&&(rt=a,tt=rt.adornedPart,a.j===null&&(a.j=[])),tt instanceof _e){var ot=tt;if(z===0)Ra(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var at=a instanceof Bi?null:tt.path;y=tt.routeBounds,x=a.jg,x.h(0,0,y.width,y.height);var ut=ot.points,ct=tt.pointsCount;rt!==null?rt.Ul(!1):tt!==null&&tt.Ul(!1),rt=y.width;var mt=y.height,yt=a.j;if(yt.length=0,at!==null){i1(a,rt,mt,at);var St=at.measuredBounds;x.ed(St),yt.push(St)}St=oi.alloc();for(var Lt=jt.alloc(),Ot=jt.alloc(),Dt=0;Dt<z;Dt++){var Gt=b[Dt];if(Gt!==at)if(Gt.isPanelMain&&Gt instanceof Qn){i1(a,rt,mt,Gt);var Vt=Gt.measuredBounds;x.ed(Vt),yt.push(Vt)}else if(2>ct)Gt.measure(1/0,1/0,0,0),Vt=Gt.measuredBounds,x.ed(Vt),yt.push(Vt);else{var Yt=Gt.segmentIndex,qt=Gt.segmentFraction,ae=Gt.alignmentFocus;ae.Mc()&&(ae=Xi);var Je=Gt.segmentOrientation,un=Gt.segmentOffset;if(isNaN(Yt)){var nn=ot.ua;Vt=Kn(),nn.Qu(qt,Vt);var Ge=jt.allocAt(Vt[0],Vt[1]);if(Ge.add(ot.i(0)),nn.type===We.j?Ge.offset(-nn.startX,-nn.startY):(nn=nn.figures.first(),nn!==null&&Ge.offset(-nn.startX,-nn.startY)),nn=Vt[2],Je!==Ea){var we=ot.computeAngle(Gt,Je,nn);Gt.Kb=we}we=Ge.x-y.x;var Un=Ge.y-y.y;jt.free(Ge),zn(Vt)}else if(Yt<-ct||Yt>=ct)Vt=jt.alloc(),ot.vg(),ot.computeMidPoint(Vt),nn=ot.midAngle,Je!==Ea&&(we=ot.computeAngle(Gt,Je,nn),Gt.Kb=we),we=Vt.x-y.x,Un=Vt.y-y.y,jt.free(Vt);else{if(we=0,0<=Yt?(Un=ut.M(Yt),Vt=Yt<ct-1?ut.M(Yt+1):Un):(we=ct+Yt,Un=ut.M(we),Vt=0<we?ut.M(we-1):Un),Un.Xa(Vt)){0<=Yt?(nn=0<Yt?ut.M(Yt-1):Un,we=Yt<ct-2?ut.M(Yt+2):Vt):(nn=we<ct-1?ut.M(we+1):Un,we=1<we?ut.M(we-2):Vt),Ge=nn.Bf(Un);var jn=Vt.Bf(we);nn=Ge>jn+10?0<=Yt?nn.ab(Un):Un.ab(nn):jn>Ge+10?0<=Yt?Vt.ab(we):we.ab(Vt):0<=Yt?nn.ab(we):we.ab(nn)}else nn=0<=Yt?Un.ab(Vt):Vt.ab(Un);Je!==Ea&&(we=ot.computeAngle(Gt,Je,nn),Gt.Kb=we),we=Un.x+(Vt.x-Un.x)*qt-y.x,Un=Un.y+(Vt.y-Un.y)*qt-y.y}Gt.measure(1/0,1/0,0,0),Vt=Gt.measuredBounds,Ge=Gt.naturalBounds;var ji=0;Gt instanceof Qn&&(ji=Gt.strokeWidth),jn=Ge.width+ji;var Lr=Ge.height+ji;St.reset(),St.translate(-Vt.x,-Vt.y),St.scale(Gt.scale,Gt.scale),St.rotate(Je===Ea?Gt.angle:nn,jn/2,Lr/2),Je!==Lp&&Je!==kp||St.rotate(90,jn/2,Lr/2),Je!==Mp&&Je!==bp||St.rotate(-90,jn/2,Lr/2),Je===n0&&(45<nn&&135>nn||225<nn&&315>nn)&&St.rotate(-nn,jn/2,Lr/2),Ge=new ye(0,0,jn,Lr),Lt.xi(Ge,ae),St.Ga(Lt),ae=-Lt.x+ji/2*Gt.scale,Gt=-Lt.y+ji/2*Gt.scale,Ot.assign(un),ji=isNaN(un.x);var ds=isNaN(un.y);if(ji||ds){jn=jn/2+3,Lr=Lr/2+3;var xs=45<=nn&&135>=nn,ca=225<=nn&&315>=nn;Je===Ea&&(xs||ca)?(Ot.x=ds?jn:un.y,Ot.y=ji?Lr:un.x,xs?0<=Yt||isNaN(Yt)&&.5>qt||!ji||(Ot.y=-Lr):ca&&((0<=Yt||isNaN(Yt)&&.5>qt)&&ji&&(Ot.y=-Lr),ds&&(Ot.x=-jn))):(ji&&(Ot.x=0<=Yt||isNaN(Yt)&&.5>qt?jn:-jn),ds&&(Ot.y=-Lr),Ot.rotate(nn))}else Ot.rotate(nn);we+=Ot.x,Un+=Ot.y,Ge.set(Vt),Ge.h(we+ae,Un+Gt,Vt.width,Vt.height),yt.push(Ge),x.ed(Ge)}}if(tt!==null)for(b=tt.labelNodes;b.next();)b.value.measure(1/0,1/0);a.jg=x,a.position.h(y.x+x.x,y.y+x.y),Ra(E,x.width||0,x.height||0),oi.free(St),jt.free(Lt),jt.free(Ot)}}}},km.prototype.arrange=function(a,y){var x=y.length;if(a instanceof Bi||a instanceof _e){var b=a,E=null;a instanceof Bi&&(E=a,b=E.adornedPart);var z=a instanceof Bi?null:b.path,tt=a.j;if(tt.length!==0){var rt=0;if(z!==null&&rt<tt.length){var ot=tt[rt];rt++,z.arrange(ot.x-a.jg.x,ot.y-a.jg.y,ot.width,ot.height)}for(ot=0;ot<x;ot++){var at=y[ot];if(at!==z&&rt<tt.length){var ut=tt[rt];rt++,at.arrange(ut.x-a.jg.x,ut.y-a.jg.y,ut.width,ut.height)}}}if(y=b.points,x=y.count,2<=x&&a instanceof _e)for(z=a.labelNodes;z.next();){var ct=a;tt=z.value,rt=tt.segmentIndex,ot=tt.segmentFraction;var mt=tt.alignmentFocus;if(at=tt.segmentOrientation,ut=tt.segmentOffset,isNaN(rt)){var yt=ct.ua,St=Kn();yt.Qu(ot,St);var Lt=jt.allocAt(St[0],St[1]);Lt.add(ct.i(0)),yt.type===We.j||(yt=yt.figures.first()),Lt.offset(-yt.startX,-yt.startY),yt=St[2],at!==Ea&&(ct=ct.computeAngle(tt,at,yt),tt.angle=ct),ct=Lt.x;var Ot=Lt.y;jt.free(Lt),zn(St)}else if(rt<-x||rt>=x)St=jt.alloc(),yt=ct,Ot=St,yt.vg(),yt.computeMidPoint(Ot),yt=ct.midAngle,at!==Ea&&(ct=ct.computeAngle(tt,at,yt),tt.angle=ct),ct=St.x,Ot=St.y,jt.free(St);else{if(Lt=0,0<=rt?(St=y.s[rt],Ot=rt<x-1?y.s[rt+1]:St):(Lt=x+rt,St=y.s[Lt],Ot=0<Lt?y.s[Lt-1]:St),St.Xa(Ot)){0<=rt?(yt=0<rt?y.s[rt-1]:St,Lt=rt<x-2?y.s[rt+2]:Ot):(yt=Lt<x-1?y.s[Lt+1]:St,Lt=1<Lt?y.s[Lt-2]:Ot);var Dt=yt.Bf(St),Gt=Ot.Bf(Lt);yt=Dt>Gt+10?0<=rt?yt.ab(St):St.ab(yt):Gt>Dt+10?0<=rt?Ot.ab(Lt):Lt.ab(Ot):0<=rt?yt.ab(Lt):Lt.ab(yt)}else yt=0<=rt?St.ab(Ot):Ot.ab(St);at!==Ea&&(ct=ct.computeAngle(tt,at,yt),tt.angle=ct),ct=St.x+(Ot.x-St.x)*ot,Ot=St.y+(Ot.y-St.y)*ot}if(mt.ys())tt.location=new jt(ct,Ot);else{mt.Mc()&&(mt=Xi),St=oi.alloc(),St.reset(),St.scale(tt.scale,tt.scale),St.rotate(tt.angle,0,0);var Vt=tt.naturalBounds;Lt=ye.allocAt(0,0,Vt.width,Vt.height),Dt=jt.alloc(),Dt.xi(Lt,mt),St.Ga(Dt),mt=-Dt.x,Gt=-Dt.y;var Yt=Vt.width,qt=Vt.height;Vt=jt.alloc(),Vt.assign(ut);var ae=isNaN(ut.x),Je=isNaN(ut.y);if(ae||Je){Yt=Yt/2+3,qt=qt/2+3;var un=45<=yt&&135>=yt,nn=225<=yt&&315>=yt;at===Ea&&(un||nn)?(Vt.x=Je?Yt:ut.y,Vt.y=ae?qt:ut.x,un?0<=rt||isNaN(rt)&&.5>ot||!ae||(Vt.y=-qt):nn&&((0<=rt||isNaN(rt)&&.5>ot)&&ae&&(Vt.y=-qt),Je&&(Vt.x=-Yt))):(ae&&(Vt.x=0<=rt||isNaN(rt)&&.5>ot?Yt:-Yt),Je&&(Vt.y=-qt),Vt.rotate(yt))}else Vt.rotate(yt);ct+=Vt.x,Ot+=Vt.y,St.pp(Lt),mt+=Lt.x,Gt+=Lt.y,rt=jt.allocAt(ct+mt,Ot+Gt),tt.move(rt),jt.free(rt),jt.free(Vt),jt.free(Dt),ye.free(Lt),oi.free(St)}}E!==null?E.Ul(!1):b.Ul(!1),b=D1(a),a.location.h(a.position.x+b.x,a.position.y+b.y),jt.free(b)}};function i1(a,y,x,b){if(Nl(b)!==!1){var E=b.strokeWidth;E===0&&a instanceof Bi&&a.type===Re.Link&&a.adornedObject instanceof Qn&&(E=a.adornedObject.strokeWidth),E*=b.Ca,a instanceof _e&&a.ua!==null?(a=a.geometry.bounds,b.Ge(a.x-E/2,a.y-E/2,a.width+E,a.height+E)):a instanceof Bi&&a.adornedPart.ua!==null?(a=a.adornedPart.ua.bounds,b.Ge(a.x-E/2,a.y-E/2,a.width+E,a.height+E)):b.Ge(-(E/2),-(E/2),y+E,x+E),E=b.desiredSize,E.w()||b.ua===null?b.dc.h(0,0,E.width,E.height):b.dc.assign(b.ua.bounds),Zo(b,!1)}}function fp(){this.xa="Base"}le(fp,es),fp.prototype.measure=function(a,y,x,b,E,z,tt){var rt=a.Pb();a.graduatedBounds=[];var ot=rt.margin,at=ot.right+ot.left,ut=ot.top+ot.bottom;rt.measure(y,x,z,tt);var ct=rt.measuredBounds,mt=new ye(-ot.left,-ot.top,Math.max(ct.width+at,0),Math.max(ct.height+ut,0));a.graduatedBounds.push(mt),E.assign(mt);for(var yt=rt.geometry,St=rt.strokeWidth,Lt=yt.flattenedSegments,Ot=yt.flattenedLengths,Dt=yt.flattenedTotalLength,Gt=Lt.length,Vt=0,Yt=0,qt=Kn(),ae=0;ae<Gt;ae++){var Je=Lt[ae],un=[];Yt=Vt=0;for(var nn=Je.length,Ge=0;Ge<nn;Ge+=2){var we=Je[Ge],Un=Je[Ge+1];if(Ge!==0){var jn=180*Math.atan2(Un-Yt,we-Vt)/Math.PI;0>jn&&(jn+=360),un.push(jn)}Vt=we,Yt=Un}qt.push(un)}if(a.graduatedIntervals===null){for(var ji=[],Lr=a.O.s,ds=Lr.length,xs=0;xs<ds;xs++){var ca=Lr[xs],fs=[];if(ji.push(fs),ca.visible){var Od=ca.interval;if(!(0>Od)){for(var Wo=0;Wo<ds;Wo++)if(Wo!==xs){var Vu=Lr[Wo];if(Vu.visible&&ca.constructor===Vu.constructor){var ga=Vu.interval;ga>Od&&fs.push(ga)}}}}}a.graduatedIntervals=ji}var Id=a.graduatedIntervals,Ol=a.O.s,au=Ol.length,yl=0,sl=0,yf=Dt;a.graduatedMarks=[];for(var Wu,zg=0;zg<au;zg++){var Sl=Ol[zg];if(Wu=[],Sl.visible&&Sl!==rt){var pa=Math.abs(Sl.interval),Qp=a.graduatedTickUnit;if(!(2>Qp*pa*Dt/a.graduatedRange&&Sl.graduatedSkip===null)){var Vc=Ot[0][0],uh=0,al=0;sl=Dt*Sl.graduatedStart-1e-4,yf=Dt*Sl.graduatedEnd+1e-4;var ac=Qp*pa,xl=a.graduatedTickBase;if(xl<a.graduatedMin){var Sf=(a.graduatedMin-xl)/ac;Sf=Sf%1===0?Sf:Math.floor(Sf+1),xl+=Sf*ac}else xl>a.graduatedMin+ac&&(xl-=Math.floor((xl-a.graduatedMin)/ac)*ac);for(var W0=Id[zg],$p=xl,Gy=1e-6*a.graduatedMax,Bh=1;xl<=a.graduatedMax+Gy;Bh++){t:{for(var id=W0.length,Wc=0;Wc<id;Wc++){var xf=(xl-a.graduatedTickBase)%(W0[Wc]*a.graduatedTickUnit),Gg=1e-6*a.graduatedTickUnit;if(xf<Gg&&xf>-Gg){var Pf=!1;break t}}Pf=!0}if(Pf&&(xl>a.graduatedMax&&(xl=a.graduatedMax),Sl.graduatedSkip===null||Sl instanceof Mr&&!Sl.graduatedSkip(xl,Sl)||Sl instanceof Qn&&!Sl.graduatedSkip(xl,Sl))&&(yl=(xl-a.graduatedMin)*Dt/a.graduatedRange,yl>Dt&&(yl=Dt),sl<=yl&&yl<=yf)){for(var Oh=qt[uh][al],Rd=Ot[uh][al];uh<Ot.length;){for(;yl>Vc&&al<Ot[uh].length-1;)al++,Oh=qt[uh][al],Rd=Ot[uh][al],Vc+=Rd;if(yl<=Vc)break;uh++,al=0,Oh=qt[uh][al],Rd=Ot[uh][al],Vc+=Rd}var ll=Lt[uh],hh=ll[2*al],U0=ll[2*al+1],rd=(yl-(Vc-Rd))/Rd,_g=new jt(hh+(ll[2*al+2]-hh)*rd+St/2-yt.bounds.x,U0+(ll[2*al+3]-U0)*rd+St/2-yt.bounds.y);_g.scale(rt.scale,rt.scale);t:{var Uu=Oh,lc=qt[uh];if(!(.5005>rd&&.4995<rd)){var dh=Uu;if(.5>rd?0<al?dh=lc[al-1]:ne.$(ll[0],ll[ll.length-2])&&ne.$(ll[1],ll[ll.length-1])&&(dh=lc[lc.length-1]):.5<rd&&(al+1<lc.length?dh=lc[al+1]:ne.$(ll[0],ll[ll.length-2])&&ne.$(ll[1],ll[ll.length-1])&&(dh=lc[0])),Uu!==dh){var Uc=Math.abs(Uu-dh);if(180<Uc&&(Uu<dh?Uu+=360:dh+=360,Uc=Math.abs(Uu-dh)),5e-4>rd||.9995<rd){Oh=(Uu+dh)/2%360;break t}if(10>Uc){var Hg=1-Math.abs(.5-rd);Oh=(Uu*Hg+dh*(1-Hg))%360;break t}}}Oh=Uu}if(Sl instanceof Mr){var Lu="";Sl.graduatedFunction!==null?(Lu=Sl.graduatedFunction(xl,Sl),Lu=Lu!=null?Lu.toString():""):Lu=(+xl.toFixed(2)).toString(),Lu!==""&&Wu.push({$l:_g,angle:Oh,text:Lu})}else Wu.push({$l:_g,angle:Oh})}xl=$p+Bh*ac}}}a.graduatedMarks.push(Wu)}zn(qt);var Rs=a.graduatedMarks;if(Rs!==null)for(var qp=b.length,Aa=0;Aa<qp;Aa++){var Uo=b[Aa],Ba=Rs[Aa];if(Uo.visible&&Uo!==rt&&Ba.length!==0){if(Uo instanceof Qn){var od=a,jd=E,uc=Uo.alignmentFocus;uc.Mc()&&(uc=du);var _y=Uo.angle;Uo.Kb=0,Uo.measure(1/0,1/0,0,0),Uo.Kb=_y;var K0=Uo.measuredBounds,Vg=K0.width,hc=K0.height,Kc=ye.allocAt(0,0,Vg,hc),ul=jt.alloc();ul.xi(Kc,uc),ye.free(Kc);for(var sd=-ul.x,Ku=-ul.y,Yl=new ye,wf=Ba.length,Wg=0;Wg<wf;Wg++)for(var Cf=Ba[Wg],Y0=Cf.$l.x,Ug=Cf.$l.y,Eo=Cf.angle,Mu=0;4>Mu;Mu++){switch(Mu){case 0:ul.h(sd,Ku);break;case 1:ul.h(sd+Vg,Ku);break;case 2:ul.h(sd,Ku+hc);break;case 3:ul.h(sd+Vg,Ku+hc)}ul.rotate(Eo+Uo.angle),ul.offset(Y0,Ug),Wg===0&&Mu===0?Yl.h(ul.x,ul.y,0,0):Yl.Ye(ul),ul.offset(-Y0,-Ug),ul.rotate(-Eo-Uo.angle)}jt.free(ul),od.graduatedBounds!==null&&od.graduatedBounds.push(Yl),co(jd,Yl.x,Yl.y,Yl.width,Yl.height)}else if(Uo instanceof Mr){var lu=a,X0=E;lu.temporaryTextBlock===null&&(lu.temporaryTextBlock=new Mr);var Pl=lu.temporaryTextBlock;y1(Pl,Uo);var zd=Uo.alignmentFocus;zd.Mc()&&(zd=du);for(var uu=Uo.segmentOrientation,Kg=Uo.segmentOffset,Lf=new ye,tm=0,Yg=0,fh=0,dc=0,Mf=0,Xg=Ba.length,Gd=0;Gd<Xg;Gd++){var Ih=Ba[Gd];tm=Ih.$l.x,Yg=Ih.$l.y,fh=Ih.angle,Mf=dc=Uo.angle,uu!==Ea&&(Mf=uu===Cp||uu===e0?fh+Uo.angle:fh,dc=_e.computeAngle(uu,Mf)),Pl.Kb=dc,Pl.text=Ih.text||"",Pl.measure(1/0,1/0,0,0);var _d=Pl.measuredBounds,ad=Pl.naturalBounds,Hd=ad.width,fc=ad.height,Yu=oi.alloc();Yu.reset(),Yu.translate(-_d.x,-_d.y),Yu.scale(Pl.scale,Pl.scale),Yu.rotate(Mf,Hd/2,fc/2),uu!==Lp&&uu!==kp||Yu.rotate(90,Hd/2,fc/2),uu!==Mp&&uu!==bp||Yu.rotate(-90,Hd/2,fc/2),uu===n0&&(45<fh&&135>fh||225<fh&&315>fh)&&Yu.rotate(-fh,Hd/2,fc/2);var Yc=ye.allocAt(0,0,Hd,fc),Vd=jt.alloc();Vd.xi(Yc,zd),Yu.Ga(Vd);var Xc=-Vd.x,Hy=-Vd.y,ld=jt.alloc();ld.assign(Kg),isNaN(ld.x)&&(ld.x=Hd/2+3),isNaN(ld.y)&&(ld.y=-(fc/2+3)),ld.rotate(fh),tm+=ld.x+Xc,Yg+=ld.y+Hy;var cc=new ye(tm,Yg,_d.width,_d.height),em=new ye(_d.x,_d.y,_d.width,_d.height),Vy=new ye(ad.x,ad.y,ad.width,ad.height);Ih.Sz=dc,Ih.lineCount=Pl.lineCount,Ih.lines=[Pl.Cb,Pl.Ih,Pl.df,Pl.Le,Pl.Qc,Pl.Qb,Pl.ze],Ih.actualBounds=cc,Ih.measuredBounds=em,Ih.naturalBounds=Vy,Gd===0?Lf.assign(cc):Lf.ed(cc),jt.free(ld),jt.free(Vd),ye.free(Yc),oi.free(Yu)}lu.graduatedBounds!==null&&lu.graduatedBounds.push(Lf),co(X0,Lf.x,Lf.y,Lf.width,Lf.height)}Zo(Uo,!1)}}},fp.prototype.arrange=function(a,y,x){if(a.graduatedBounds!==null){var b=a.Pb(),E=a.graduatedMarks;if(E!==null){var z=a.graduatedBounds,tt=0,rt=z[tt];tt++,b!==null&&b.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height);for(var ot=y.length,at=0;at<ot;at++){var ut=y[at];rt=E[at],ut.visible&&ut!==b&&rt.length!==0&&(rt=z[tt],tt++,ut.arrange(rt.x-x.x,rt.y-x.y,rt.width,rt.height))}a.graduatedBounds=null}}},fp.prototype.gc=function(a,y,x){var b=x.$i;x.$i=!0;var E=a.naturalBounds,z=E.width,tt=E.height;E=y instanceof pl,y.save(),y.beginPath(),y.rect(-1,-1,z+1,tt+1),y.clip(),y.Se(),z=a.Pb(),z.gc(y,x),tt=a.Df()*x.scale,0>=tt&&(tt=1);for(var rt=z.actualBounds,ot=a.O.s,at=a.graduatedMarks,ut=ot.length,ct=0;ct<ut;ct++){var mt=ot[ct],yt=at[ct],St=yt.length;if(mt.visible&&mt!==z&&yt.length!==0){if(mt instanceof Qn){if(!(2>a.graduatedTickUnit*mt.interval*z.geometry.flattenedTotalLength/a.graduatedRange*tt&&mt.graduatedSkip===null)){var Lt=mt.measuredBounds,Ot=mt.strokeWidth*mt.scale,Dt=mt.alignmentFocus;Dt.Mc()&&(Dt=du);for(var Gt=0;Gt<St;Gt++){var Vt=yt[Gt].$l,Yt=yt[Gt].angle,qt=Dt,ae=mt.Ab;ae.reset(),ae.translate(Vt.x+rt.x,Vt.y+rt.y),ae.rotate(Yt+mt.angle,0,0),ae.translate(-Lt.width*qt.x+qt.offsetX+Ot/2,-Lt.height*qt.y+qt.offsetY+Ot/2),ae.scale(mt.scale,mt.scale),nu(mt,!1),mt.wh.set(mt.Ab),mt.Kk=mt.scale,Gl(mt,!1),mt.gc(y,x),E&&(a.svg.appendChild(mt.svg),mt.svg=null),mt.Ab.reset()}}}else if(mt instanceof Mr)for(a.temporaryTextBlock===null&&(a.temporaryTextBlock=new Mr),Lt=a.temporaryTextBlock,y1(Lt,mt),Ot=0;Ot<St;Ot++)Dt=yt[Ot],Dt.actualBounds&&Dt.measuredBounds&&Dt.naturalBounds&&(Lt.ec=Dt.text||"",Lt.Kb=Dt.Sz||0,Lt.Gc=Dt.lineCount||0,Gt=Dt.lines,Gt!==void 0&&(Lt.Cb=Gt[0],Lt.Ih=Gt[1],Lt.df=Gt[2],Lt.Le=Gt[3],Lt.Qc=Gt[4],Lt.Qb=Gt[5],Lt.ze=Gt[6]),Dt.naturalBounds&&(Lt.dc=Dt.naturalBounds),Dt.actualBounds&&(Gt=Dt.actualBounds,Lt.arrange(Gt.x,Gt.y,Gt.width,Gt.height)),Gt=Dt.actualBounds,Lt.arrange(Gt.x,Gt.y,Gt.width,Gt.height),Vt=Dt.measuredBounds,Dt=Dt.naturalBounds,Yt=Lt.Ab,Yt.reset(),Yt.translate(Gt.x+rt.x,Gt.y+rt.y),Yt.translate(-Vt.x,-Vt.y),Lt.no(Yt,Dt.x,Dt.y,Dt.width,Dt.height),nu(Lt,!1),Lt.wh.set(Lt.Ab),Lt.Kk=Lt.scale,Gl(Lt,!1),Lt.Ng=mt.part,Lt.Me=mt.panel,Lt.gc(y,x),Lt.Me=null,Lt.Ng=null,E&&(a.svg.appendChild(Lt.svg),Lt.svg=null))}}x.$i=b,y.restore(),y.Vc(!0)};function Re(a,y){if(te.call(this),this.na=null,a===void 0)this.na=Re.Position;else if(typeof a=="string"){var x=yu.I(a);x!==null&&(this.na=x)}else a instanceof es?this.na=a:a&&(this.na=Re.Position,y=a);this.na===null&&fe("Panel type not specified or PanelLayout not loaded: "+a),this.l=this.l|4194304|(this.na===Re.Grid?1048576:0),this.O=new Ve,this.yb=Zl,this.Tm=vs,this.Uf=Xn,this.$g=null,this.$e="",this.jg=new ye(NaN,NaN,NaN,NaN),this.T=this.F=null,this.xo=dn,this.jn=$o,this.kn=cs,this.ub=this.ra=null,this.zn=NaN,this.ge=this.Hh=null,y&&Object.assign(this,y)}le(Re,te),Re.prototype.cloneProtected=function(a){te.prototype.cloneProtected.call(this,a),a.na=this.na,a.yb=this.yb.J(),a.Tm=this.Tm.J(),a.Uf=this.Uf,a.$e=this.$e,a.jg.assign(this.jg),this.T!==null&&(a.T=this.T.copy(a)),a.xo=this.xo,a.jn=this.jn.J(),a.kn=this.kn.J(),this.ra!==null&&(a.ra=this.ra.copy()),a.ub=this.ub,a.zn=this.zn,a.Hh=this.Hh},Re.prototype.Af=function(a){te.prototype.Af.call(this,a),a.O=this.O;for(var y=a.O.s,x=y.length,b=0;b<x;b++)y[b].Me=a;a.$g=null},Re.prototype.copy=function(){var a=te.prototype.copy.call(this);if(a!==null){for(var y=this.O.s,x=y.length,b=0;b<x;b++){var E=y[b].copy();E.wi(a),E.Ng=null;var z=a.O,tt=z.count;if(z.Gb(tt,E),z=a.part,z!==null){z.Rh=null,E.portId!==null&&z instanceof $e&&(z.Te=!0);var rt=a.diagram;rt!==null&&rt.undoManager.isUndoingRedoing||z.cb(ko,"elements",a,null,E,null,tt)}}return a}return null},xt=Re.prototype,xt.toString=function(){return"Panel("+this.type.name+")#"+Co(this)},xt.Pn=function(a){te.prototype.Pn.call(this,a);for(var y=this.O.s,x=y.length,b=0;b<x;b++)y[b].Pn(a)},xt.hh=function(a,y){if(this.na===Re.Grid)a.yc(),this.na.gc(this,a,y);else if(this.na===Re.Graduated)a.yc(),this.na.gc(this,a,y);else{if(this.na===Re.Table)if(a.yc(),a instanceof pl){var x=a.yd;a.yd=cm(a,"gojs-ts"),gv(this,a),a.nh.pop(),a.yd=x}else gv(this,a);(x=this.isClipping&&this.na===Re.Spot)&&a.save();for(var b=this.Pb(),E=this.O.s,z=E.length,tt=0;tt<z;tt++){var rt=E[tt];x&&rt===b&&(a.clipInsteadOfFill=!0),rt.gc(a,y),x&&rt===b&&(a.clipInsteadOfFill=!1)}x&&(a.restore(),a.Vc(!0))}};function gv(a,y){y.lineCap="butt";var x=0<a.rowCount?a.rowDefs:null,b=0<a.columnCount?a.colDefs:null;x!==null&&bm(a,y,!0,x,!0),b!==null&&bm(a,y,!1,b,!0),x!==null&&r1(a,y,!0,x),b!==null&&r1(a,y,!1,b),x!==null&&bm(a,y,!0,x,!1),b!==null&&bm(a,y,!1,b,!1)}function r1(a,y,x,b){for(var E=b.length,z=a.actualBounds,tt=a.naturalBounds,rt=!0,ot=0;ot<E;ot++){var at=b[ot];if(at!==void 0&&at.actual!==0)if(rt)rt=!1;else{if(x){if(at.position>tt.height)continue}else if(at.position>tt.width)continue;var ut=at.separatorStrokeWidth;isNaN(ut)&&(ut=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var ct=at.separatorStroke;if(ct===null&&(ct=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),ut!==0&&ct!==null){wo(a,y,ct,!1,!1,tt,z),ct=!1;var mt=at.separatorDashArray;mt===null&&(mt=x?a.defaultRowSeparatorDashArray:a.defaultColumnSeparatorDashArray),mt!==null&&(ct=!0,y.js(mt,0)),y.beginPath(),mt=at.position+ut,x?mt>tt.height&&(ut-=mt-tt.height):mt>tt.width&&(ut-=mt-tt.width),at=at.position+ut/2,y.lineWidth=ut,ut=a.yb,x?(at+=ut.top,mt=tt.width-ut.right,y.moveTo(ut.left,at),y.lineTo(mt,at)):(at+=ut.left,mt=tt.height-ut.bottom,y.moveTo(at,ut.top),y.lineTo(at,mt)),y.stroke(),y.Se(),ct&&y.fs()}}}}function bm(a,y,x,b,E){for(var z=b.length,tt=a.actualBounds,rt=a.naturalBounds,ot=o1(a,!0),at=o1(a,!1),ut=0;ut<z;ut++){var ct=b[ut];if(ct!==void 0&&ct.background!==null&&ct.coversSeparators!==E&&ct.actual!==0){var mt=x?tt.height:tt.width;if(!(ct.position>mt)){var yt=ct.Wc(),St=ct.separatorStrokeWidth;isNaN(St)&&(St=x?a.defaultRowSeparatorStrokeWidth:a.defaultColumnSeparatorStrokeWidth);var Lt=ct.separatorStroke;Lt===null&&(Lt=x?a.defaultRowSeparatorStroke:a.defaultColumnSeparatorStroke),(Lt===null||ct.index===(x?ot:at))&&(St=0),yt-=St,St=ct.position+St,yt+=ct.actual,St+yt>mt&&(yt=mt-St),0>=yt||(mt=a.yb,wo(a,y,ct.background,!0,!1,rt,tt),x?y.fillRect(mt.left,St+mt.top,tt.width-(mt.left+mt.right),yt):y.fillRect(St+mt.left,mt.top,yt,tt.height-(mt.top+mt.bottom)))}}}}function o1(a,y){for(var x=y?a.rowCount:a.columnCount,b=0;b<x;b++){var E=y?a.rowDefs[b]:a.colDefs[b];if(E!==void 0)return E.index}return 0}function pv(a){return a==="LineV"||a==="BarV"}xt.lv=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].lv();this.Uc=!0},xt.kk=function(a,y,x){if(!te.prototype.kk.call(this,a,y,x))return!1;if(this.type===Re.Table)x=this.svg.getElementsByClassName("gojs-ts"),x=x.length!==0?x[0]:null,x!==null&&(x.innerHTML=""),a.yd=x,gv(this,a),a.yd=null;else if(this.na===Re.Grid||this.na===Re.Graduated)return this.svg.innerHTML="",this.svg.remove(),!1;x=this.O.s;for(var b=x.length,E=0;E<b;E++)x[E].gc(a,y);return!0},xt.nk=function(){return!0},xt.$o=function(a,y,x,b){if(!this.isClipping)if(this.Dd()&&a.bk!==null){a=a.bk,y=this.O.s;for(var E=0,z=0,tt=0;tt<y.length;tt++)if(y[tt].Ed()){var rt=y[tt].actualBounds;E=tt===0?rt.x:Math.min(rt.x,E),z=tt===0?rt.y:Math.min(rt.y,z)}b.setAttributeNS(null,"clip-path","path('M "+(a.x-x.x-E)+","+(a.y-x.y-z)+" l "+a.width+" 0 l 0 "+a.height+" l -"+a.width+" 0 z')")}else te.prototype.$o.call(this,a,y,x,b)},xt.Sj=function(a,y,x,b,E){var z=this.se(),tt=this.transform,rt=1/(tt.m11*tt.m22-tt.m12*tt.m21),ot=tt.m22*rt,at=-tt.m12*rt,ut=-tt.m21*rt,ct=tt.m11*rt,mt=rt*(tt.m21*tt.dy-tt.m22*tt.dx),yt=rt*(tt.m12*tt.dx-tt.m11*tt.dy);if(this.areaBackground!==null)return tt=this.actualBounds,ne.Ff(tt.left,tt.top,tt.right,tt.bottom,a,y,x,b,E);if(this.background!==null)return z=a*ot+y*ut+mt,rt=a*at+y*ct+yt,a=x*ot+b*ut+mt,ot=x*at+b*ct+yt,E.h(0,0),x=this.naturalBounds,z=ne.Ff(0,0,x.width,x.height,z,rt,a,ot,E),E.transform(tt),z;z||(ot=1,ut=at=0,ct=1,yt=mt=0),rt=a*ot+y*ut+mt,a=a*at+y*ct+yt,ot=x*ot+b*ut+mt,x=x*at+b*ct+yt,E.h(ot,x),b=(ot-rt)*(ot-rt)+(x-a)*(x-a),at=!1,ct=this.O.s,yt=ct.length,ut=jt.alloc(),mt=null,y=1/0;var St=null,Lt=this.isClipping&&this.na===Re.Spot;Lt&&(St=jt.alloc(),mt=this.Pb(),(at=mt.Sj(rt,a,ot,x,St))&&(y=(rt-St.x)*(rt-St.x)+(a-St.y)*(a-St.y)));for(var Ot=0;Ot<yt;Ot++){var Dt=ct[Ot];Dt.visible&&Dt!==mt&&Dt.Sj(rt,a,ot,x,ut)&&(at=!0,Dt=(rt-ut.x)*(rt-ut.x)+(a-ut.y)*(a-ut.y),Dt<b&&(b=Dt,E.set(ut)))}return Lt&&(y>b&&E.set(St),jt.free(St)),jt.free(ut),z&&E.transform(tt),at},xt.Gj=function(){for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Gj();te.prototype.Gj.call(this)},xt.v=function(a){if(!Nl(this)){te.prototype.v.call(this,a),a=null,(this.na===Re.Auto||this.na===Re.Link)&&(a=this.Pb());for(var y=this.O.s,x=y.length,b=0;b<x;b++){var E=y[b];if((E===a||E.isPanelMain)&&E.v(!0),!E.desiredSize.w()){var z=Wa(E,!1);(E instanceof ba||E instanceof Re||E instanceof Mr||z!==Ee)&&E.v(!0)}}}},xt.Uj=function(){if(!Nl(this)){Zo(this,!0),Ch(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Uj()}},xt.Uk=function(){if(!(this.l&2048)){nu(this,!0),Gl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()}},xt.Wu=function(){Gl(this,!0);for(var a=this.O.s,y=a.length,x=0;x<y;x++)a[x].Wu()},xt.Wl=function(a,y,x,b){var E=this.jg;E.h(0,0,0,0);var z=this.desiredSize,tt=this.minSize;x===void 0&&(x=tt.width,b=tt.height),x=Math.max(x,tt.width),b=Math.max(b,tt.height);var rt=this.maxSize;isNaN(z.width)||(a=Math.min(z.width,rt.width)),isNaN(z.height)||(y=Math.min(z.height,rt.height)),a=Math.max(x,a),y=Math.max(b,y);var ot=this.yb;a=Math.max(a-ot.left-ot.right,0),y=Math.max(y-ot.top-ot.bottom,0);var at=this.O.s;at.length!==0&&this.na.measure(this,a,y,at,E,x,b),a=E.width+ot.left+ot.right,ot=E.height+ot.top+ot.bottom,isFinite(z.width)&&(a=z.width),isFinite(z.height)&&(ot=z.height),a=Math.min(rt.width,a),ot=Math.min(rt.height,ot),a=Math.max(tt.width,a),ot=Math.max(tt.height,ot),a=Math.max(x,a),ot=Math.max(b,ot),Ra(E,a,ot),Ra(this.naturalBounds,a,ot),this.Ge(0,0,a,ot)},xt.Pb=function(){if(this.$g===null){var a=this.O.s,y=a.length;if(y===0)return null;for(var x=0;x<y;x++){var b=a[x];if(b.isPanelMain===!0)return this.$g=b}this.$g=a[0]}return this.$g};function td(a){return a.part!==null?a.part.locationObject:null}xt.eh=function(a,y,x,b){var E=this.O.s;if(this.actualBounds.h(a,y,x,b),E.length!==0){if(!this.desiredSize.w()){a=Wa(this,!0);var z=this.measuredBounds;y=z.width,z=z.height;var tt=this.Kg,rt=tt.left+tt.right;switch(tt=tt.top+tt.bottom,y===x&&z===b&&(a=Ee),a){case Ee:(y>x||z>b)&&(this.v(),this.measure(y>x?x:y,z>b?b:z,0,0));break;case Ae:this.v(!0),this.measure(x+rt,b+tt,0,0);break;case gn:this.v(!0),this.measure(x+rt,z+tt,0,0);break;case Fn:this.v(!0),this.measure(y+rt,b+tt,0,0)}}this.na.arrange(this,E,this.jg)}},xt.gh=function(a){var y=this.naturalBounds,x=td(this);if(ps(0,0,y.width,y.height,a.x,a.y)){y=this.O.s;for(var b=y.length,E=jt.allocAt(0,0);b--;){var z=y[b];if((z.visible||z===x)&&(Lo(E.set(a),z.transform),z.ca(E)))return jt.free(E),!0}return jt.free(E),!(this.Ma===null&&this.areaBackground===null)}return!1},xt.ks=function(a){if(this.bindingId===a)return this;for(var y=this.O.s,x=y.length,b=0;b<x;b++){var E=y[b].ks(a);if(E!==null)return E}return null},xt.qm=function(a,y){if(y(this,a),a instanceof Re){a=a.O.s;for(var x=a.length,b=0;b<x;b++)this.qm(a[b],y)}};function qf(a,y){s1(a,a,y)}function s1(a,y,x){x(y),y=y.O.s;for(var b=y.length,E=0;E<b;E++){var z=y[E];z instanceof Re&&s1(a,z,x)}}function vx(a,y){a1(a,a,y)}function a1(a,y,x){if(x(y),y instanceof Re){y=y.O.s;for(var b=y.length,E=0;E<b;E++)a1(a,y[E],x)}}xt.Nl=function(a){return l1(this,this,a)};function l1(a,y,x){if(x(y))return y;if(y instanceof Re){y=y.O.s;for(var b=y.length,E=0;E<b;E++){var z=l1(a,y[E],x);if(z!==null)return z}}return null}xt.fb=function(a){if(this.name===a)return this;var y=this.O.s,x=y.length;this.Hh===null&&this.itemTemplateMap===null||(x=cp(this));for(var b=0;b<x;b++){var E=y[b];if(E instanceof Re){var z=E.fb(a);if(z!==null)return z}if(E.name===a)return E}return null};function u1(a){a=a.O.s;for(var y=a.length,x=0,b=0;b<y;b++){var E=a[b];E instanceof Re?x=Math.max(x,u1(E)):E instanceof Qn&&(x=Math.max(x,E.ig/2*E.strokeMiterLimit*E.Df()))}return x}xt.se=function(){return!(this.type===Re.TableRow||this.type===Re.TableColumn)};function Md(a){return a.type===Re.TableRow||a.type===Re.TableColumn}xt.ic=function(a,y,x){if(this.pickable===!1||(y===void 0&&(y=null),x===void 0&&(x=null),Ma(this)))return null;var b=this.naturalBounds,E=1/this.Df(),z=this.se(),tt=z?a:Lo(jt.allocAt(a.x,a.y),this.transform),rt=this.diagram,ot=10,at=5;if(rt!==null&&(ot=rt.Ql("extraTouchArea"),at=ot/2),ps(-(at*E),-(at*E),b.width+ot*E,b.height+ot*E,tt.x,tt.y)){if(!this.isAtomic){E=this.O.s;var ut=E.length;if(rt=jt.alloc(),at=(ot=this.isClipping&&this.na===Re.Spot)?this.Pb():null,ot&&(at.se()?Lo(rt.set(a),at.transform):rt.set(a),!at.ca(rt)))return jt.free(rt),z||jt.free(tt),null;for(var ct=td(this);ut--;){var mt=E[ut];if((mt.visible||mt===ct)&&(mt.se()?Lo(rt.set(a),mt.transform):rt.set(a),!ot||mt!==at)){var yt=null;if(mt instanceof Re?yt=mt.ic(rt,y,x):mt.pickable===!0&&mt.ca(rt)&&(yt=mt),yt!==null&&(y!==null&&(yt=y(yt)),yt!==null&&(x===null||x(yt))))return jt.free(rt),z||jt.free(tt),yt}}jt.free(rt)}return this.background===null&&this.areaBackground===null?(z||jt.free(tt),null):(a=ps(0,0,b.width,b.height,tt.x,tt.y)?this:null,z||jt.free(tt),a)}return z||jt.free(tt),null},xt.ji=function(a,y,x,b){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var E=this.naturalBounds,z=this.se(),tt=z?a:Lo(jt.allocAt(a.x,a.y),this.transform);if(E=ps(0,0,E.width,E.height,tt.x,tt.y),Md(this)||E){if(!this.isAtomic){for(var rt=this.O.s,ot=rt.length,at=jt.alloc(),ut=td(this);ot--;){var ct=rt[ot];if(ct.visible||ct===ut){ct.se()?Lo(at.set(a),ct.transform):at.set(a);var mt=ct;ct=ct instanceof Re?ct:null,(ct!==null?ct.ji(at,y,x,b):mt.ca(at))&&mt.pickable!==!1&&(y!==null&&(mt=y(mt)),mt===null||x!==null&&!x(mt)||b.add(mt))}}jt.free(at)}return z||jt.free(tt),E&&(this.background!==null||this.areaBackground!==null)}return z||jt.free(tt),!1},xt.Cf=function(a,y,x,b,E,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=oi.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,E),z===void 0&&oi.free(tt),!0;if(this.Yc(a,tt)){if(!this.isAtomic)for(var rt=td(this),ot=this.O.s,at=ot.length;at--;){var ut=ot[at];if(ut.visible||ut===rt){var ct=ut.actualBounds,mt=this.naturalBounds;ct.x>mt.width||ct.y>mt.height||0>ct.x+ct.width||0>ct.y+ct.height||(ct=ut,ut=ut instanceof Re?ut:null,mt=oi.alloc(),mt.set(tt),(ut!==null?ut.Cf(a,y,x,b,E,mt):hs(ct,a,b,mt))&&(y!==null&&(ct=y(ct)),ct===null||x!==null&&!x(ct)||E.add(ct)),oi.free(mt))}}return z===void 0&&oi.free(tt),b}return z===void 0&&oi.free(tt),!1};function mv(a,y,x,b){for(var E=a.O.s,z=E.length;z--;){var tt=E[z];if(tt.visible){var rt=tt.actualBounds,ot=a.naturalBounds;rt.x>ot.width||rt.y>ot.height||0>rt.x+rt.width||0>rt.y+rt.height||(tt instanceof Re&&mv(tt,y,x,b),y!==null&&(tt=y(tt)),tt===null||x!==null&&!x(tt)||b.add(tt))}}}xt.og=function(a,y,x,b,E,z){if(this.pickable===!1)return!1;x===void 0&&(x=null),b===void 0&&(b=null);var tt=this.naturalBounds,rt=this.se(),ot=rt?a:Lo(jt.allocAt(a.x,a.y),this.transform),at=rt?y:Lo(jt.allocAt(y.x,y.y),this.transform),ut=ot.Bf(at),ct=0<ot.x&&ot.x<tt.width&&0<ot.y&&ot.y<tt.height||gs(ot.x,ot.y,0,0,0,tt.height)<=ut||gs(ot.x,ot.y,0,tt.height,tt.width,tt.height)<=ut||gs(ot.x,ot.y,tt.width,tt.height,tt.width,0)<=ut||gs(ot.x,ot.y,tt.width,0,0,0)<=ut;if(tt=ot.zd(0,0)<=ut&&ot.zd(0,tt.height)<=ut&&ot.zd(tt.width,0)<=ut&&ot.zd(tt.width,tt.height)<=ut,rt||(jt.free(ot),jt.free(at)),ct){if(!this.isAtomic){ot=jt.alloc(),at=jt.alloc(),ut=td(this);for(var mt=this.O.s,yt=mt.length;yt--;){var St=mt[yt];if(St.visible||St===ut){var Lt=St.actualBounds,Ot=this.naturalBounds;(!rt||!(Lt.x>Ot.width||Lt.y>Ot.height||0>Lt.x+Lt.width||0>Lt.y+Lt.height))&&(St.se()?(Lt=St.transform,Lo(ot.set(a),Lt),Lo(at.set(y),Lt)):(ot.set(a),at.set(y)),Lt=St,St=St instanceof Re?St:null,(St!==null?St.og(ot,at,x,b,E,z):Lt.tx(ot,at,E))&&(x!==null&&(Lt=x(Lt)),Lt===null||b!==null&&!b(Lt)||z.add(Lt)))}}jt.free(ot),jt.free(at)}return E?ct:tt}return!1};function vv(a){var y=null;return a instanceof Qn&&(y=a.spot1,y===vs&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot1)),y===null&&(y=ms),y}function yv(a){var y=null;return a instanceof Qn&&(y=a.spot2,y===vs&&(y=null),a=a.geometry,a!==null&&y===null&&(y=a.spot2)),y===null&&(y=Ll),y}xt.add=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];for(x=0;x<y.length;x++)this.Gb(this.O.count,y[x]);return this},xt.M=function(a){return this.O.M(a)},xt.Gb=function(a,y){y instanceof vn&&fe("Cannot add a Part to a Panel: "+y+"; use a Panel instead"),(this===y||this.rg(y))&&(this===y&&fe("Cannot make a Panel contain itself: "+this.toString()),fe("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+y.toString()));var x=y.panel;if(x!==null&&x!==this&&fe("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+y.toString()+", already contained by "+x.toString()+", cannot be shared by this Panel: "+this.toString()),this.na!==Re.Grid||y instanceof Qn||fe("Can only add Shapes to a Grid Panel, not: "+y),this.na!==Re.Graduated||y instanceof Qn||y instanceof Mr||fe("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+y),y.wi(this),y.Ng=null,this.itemArray!==null){var b=y.data;b!==null&&typeof b=="object"&&(this.ge===null&&(this.ge=new xn),this.ge.add(b,y))}var E=this.O;if(b=-1,x===this){for(var z=-1,tt=this.O.s,rt=tt.length,ot=0;ot<rt;ot++)if(tt[ot]===y){z=ot;break}if(z!==-1){if(z===a||z+1>=E.count&&a>=E.count)return;E.mb(z),b=z}else fe("element "+y.toString()+" has panel "+x.toString()+" but is not contained by it.")}(0>a||a>E.count)&&(a=E.count),E.Gb(a,y),(a===0||y.isPanelMain)&&(this.$g=null),Nl(this)||this.v(),y.v(!1),y.portId!==null?this.Te=!0:y instanceof Re&&y.Te===!0&&(this.Te=!0),this.graduatedIntervals=null,this.If()||Fm(this,y,!1),x=this.part,x!==null&&(x.Rh=null,x.ag=NaN,this.Te&&x instanceof $e&&(x.Te=!0),x.Te&&x instanceof $e&&(x.wc=null),E=this.diagram,E!==null&&E.undoManager.isUndoingRedoing||(b!==-1&&x.cb(Bo,"elements",this,y,null,b,null),x.cb(ko,"elements",this,null,y,null,a)))};function Sv(a,y){a.l=y?a.l|16777216:a.l&-16777217}xt.remove=function(a){for(var y=this.O.s,x=y.length,b=-1,E=0;E<x;E++)if(y[E]===a){b=E;break}b!==-1&&this.pc(b,!0)},xt.mb=function(a){0<=a&&this.pc(a,!0)},xt.pc=function(a,y){var x=this.O,b=x.M(a);if(b.Ng=null,b.wi(null),this.ge!==null){var E=b.data;typeof E=="object"&&this.ge.remove(E)}x.mb(a),Zo(this,!1),this.v(),this.$g===b&&(this.$g=null),this.graduatedIntervals=null;var z=this.part;z!==null&&(z.Rh=null,z.ag=NaN,z.Wb(),z instanceof $e&&(b instanceof Re?b.qm(b,function(tt,rt){Hv(z,rt,y)}):Hv(z,b,y)),x=this.diagram,x!==null&&x.undoManager.isUndoingRedoing||z.cb(Bo,"elements",this,b,null,a,null))},xt.Fb=function(a){0>a&&ri(a,">= 0",Re,"getRowDefinition:idx"),a=Math.round(a);var y=this.rowDefs;if(y[a]===void 0){var x=new Jo;x.wi(this),x.isRow=!0,x.index=a,y[a]=x,this.cb(ko,"rowdefs",this,null,x,null,a)}return y[a]},xt.oA=function(a){if(0>a&&ri(a,">= 0",Re,"removeRowDefinition:idx"),this.rowCount!==0){a=Math.round(a);var y=this.rowDefs,x=y[a];if(x){y[a]=void 0;for(var b=y.length-1;0<=b&&y[b--]===void 0;)y.length--;this.cb(Bo,"rowdefs",this,x,null,a,null),this.v()}}};function h1(a,y,x){var b=a.rowDefs;if(!(0>y)){if(b[y]=x instanceof Jo?x:void 0,!x)for(y=b.length-1;0<=y&&b[y--]===void 0;)b.length--;a.v()}}xt.Eb=function(a){0>a&&ri(a,">= 0",Re,"getColumnDefinition:idx"),a=Math.round(a);var y=this.colDefs;if(y[a]===void 0){var x=new Jo;x.wi(this),x.isRow=!1,x.index=a,y[a]=x,this.cb(ko,"coldefs",this,null,x,null,a)}return y[a]},xt.jA=function(a){if(0>a&&ri(a,">= 0",Re,"removeColumnDefinition:idx"),this.columnCount!==0){a=Math.round(a);var y=this.colDefs,x=y[a];if(x){y[a]=void 0;for(var b=y.length-1;0<=b&&y[b--]===void 0;)y.length--;this.cb(Bo,"coldefs",this,x,null,a,null),this.v()}}};function d1(a,y,x){var b=a.colDefs;if(!(0>y)){if(b[y]=x instanceof Jo?x:void 0,!x)for(y=b.length-1;0<=y&&b[y--]===void 0;)b.length--;a.v()}}xt.Gy=function(a){var y=null;return a.isRow?y=this.Fb(a.index):a.isRow||(y=this.Eb(a.index)),y&&Tm(y,a),this},xt.Hy=function(a,y){return(a=this.Fb(a))&&Tm(a,new Jo(y)),this},xt.By=function(a,y){return(a=this.Eb(a))&&Tm(a,new Jo(y)),this},xt.nz=function(a){if(0>a||this.type!==Re.Table||this.rowCount===0)return-1;for(var y=0,x=this.rowDefs,b=x.length,E=this.topIndex;E<b;E++){var z=x[E];if(z!==void 0&&(y+=z.total,a<y))break}return E},xt.fz=function(a){if(0>a||this.type!==Re.Table||this.columnCount===0)return-1;for(var y=0,x=this.colDefs,b=x.length,E=this.leftIndex;E<b;E++){var z=x[E];if(z!==void 0&&(y+=z.total,a<y))break}return E},xt.Fz=function(a,y){if(y===void 0&&(y=new jt(NaN,NaN)),this.type!==Re.Graduated)return y.h(NaN,NaN),y;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var x=this.Pb();return x.geometry.Pu((a-this.graduatedMin)/this.graduatedRange,y),x.transform.Ga(y)},xt.Gz=function(a){if(this.type!==Re.Graduated)return NaN;var y=this.Pb();return y.transform.Cd(a),y.geometry.xx(a)*this.graduatedRange+this.graduatedMin};function f1(a){return a=a.allBindings,a!==null&&a._isFrozen}function ru(a){var y=a.allBindings;if(y===null)a.data!==null&&fe("Template cannot have .data be non-null: "+a),a.allBindings=y=new Ve;else if(y._isFrozen)return;var x=new Ve;Sv(a,!1),a.qm(a,function(at,ut){ut.th();var ct=ut.localBindings;if(ct!==null)for(Ec(ut,!1),ct=ct.iterator;ct.next();){var mt=ct.value;mt.mode===Op&&Ec(ut,!0);var yt=mt.sourceName;yt!==null&&(yt==="/"&&Sv(at,!0),yt=kS(mt,at,ut),yt!==null&&(x.add(yt),yt.srcBindings===null&&(yt.srcBindings=new Ve),yt.srcBindings.add(mt))),y.add(mt)}if(ut instanceof Re&&ut.type===Re.Table){if(0<ut.rowCount){for(at=ut.rowDefs,ct=at.length,mt=0;mt<ct;mt++)if(yt=at[mt],yt!==void 0&&yt.be!==null)for(var St=yt.be.iterator;St.next();){var Lt=St.value;Lt.xd=yt,Lt.to=2,Lt.wl=yt.index,y.add(Lt)}}if(0<ut.columnCount){for(ut=ut.colDefs,at=ut.length,ct=0;ct<at;ct++)if(mt=ut[ct],mt!==void 0&&mt.be!==null)for(yt=mt.be.iterator;yt.next();)St=yt.value,St.xd=mt,St.to=1,St.wl=mt.index,y.add(St)}}});for(var b=x.iterator;b.next();){var E=b.value;if(E.srcBindings!==null){Ec(E,!0);for(var z=E.srcBindings.iterator;z.next();){var tt=z.value;E.localBindings===null&&(E.localBindings=new Ve),E.localBindings.add(tt)}}E.srcBindings=null}for(b=y.iterator;b.next();)if(E=b.value,z=E.xd,z!==null){E.xd=null;var rt=E.targetProperty,ot=rt.indexOf(".");0<ot&&z instanceof Re&&(tt=rt.substring(0,ot),rt=rt.substr(ot+1),ot=z.fb(tt),ot!==null?(z=ot,E.targetProperty=rt):Ki('Warning: unable to find GraphObject named "'+tt+'" for Binding: '+E.toString())),z instanceof Jo?(tt=Co(z.panel),E.Ai=tt===void 0?-1:tt,z.panel.bindingId=E.Ai):z instanceof te?(tt=Co(z),E.Ai=tt===void 0?-1:tt,z.bindingId=E.Ai):fe("Unknown type of binding target: "+z)}y.freeze(),a instanceof vn&&a.Zc()&&a.Va()}xt.Uy=function(a){a===void 0&&(a=!1);var y=this.copy();return vx(y,function(x){x instanceof Re&&(x.allBindings=null,x.ub=null);var b=x.localBindings;b!==null&&(x.localBindings=null,b.each(function(E){x.bind(E.copy())})),b=x.animationTriggers,b!==null&&(x.animationTriggers=null,b.each(function(E){x.Jv(E.value.copy())}))}),a&&ru(y),y},xt.La=function(a){var y=this.allBindings;if(y!==null)for(a===void 0&&(a=""),y=y.iterator;y.next();){var x=y.value,b=x.sourceProperty;if((a===""||b===""||b===a)&&(b=x.targetProperty,x.converter!==null||b!=="")){b=this.data;var E=x.sourceName;if(E!==null){if(E==="")b=this;else if(E==="/")b=this;else if(E===".")b=this;else if(E==="..")b=this;else if(b=this.fb(E),b===null)continue}else if(x.isToModel)if(b=this.diagram,b!==null)b=b.model.modelData;else continue;var z=this,tt=x.Ai;if(tt!==-1){if(z=this.ks(tt),z===null)continue}else x.xd!==null&&(z=x.xd);if(E==="/"?b=z.part:E==="."?b=z:E===".."&&(b=z.panel),E=x.to,E!==0){if(!(z instanceof Re))continue;E===1?z=z.Eb(x.wl):E===2&&(z=z.Fb(x.wl))}z!==void 0&&x.Mv(z,b)}}},xt.sx=function(a){return a==null||this.ge===null?null:this.ge.I(a)};function yx(a,y){a=a.O.s;for(var x=a.length,b=y.length,E=0,z=null;E<x&&(z=a[E],!(z instanceof Re&&z.data!==null));)E++,z=a[E];if(x-E!==b)return!0;if(z===null)return 0<b;for(var tt=0;E<x&&tt<b;){if(z=a[E],!(z instanceof Re)||z.data!==y[tt])return!0;E++,tt++}return!1}function cp(a){if(a.type===Re.Spot||a.type===Re.Auto)return Math.min(a.O.length,1);if(a.type===Re.Link){a=a.O;for(var y=a.length,x=0;x<y;x++){var b=a.M(x);if(!(b instanceof Qn&&b.isPanelMain))break}return x}return a.type===Re.Table&&0<a.O.length&&(a=a.O.M(0),a.isPanelMain&&a instanceof Re&&Md(a))?1:0}xt.mv=function(){for(var a=cp(this);this.O.length>a;)this.pc(this.O.length-1,!1);c1(this,this.itemArray)};function c1(a,y){var x=cp(a);if(y===null||y.length===0)for(;a.O.length>x;)a.pc(a.O.length-1,!1);else if(a.O.length<=x){x=y.length;for(var b=0;b<x;b++)Em(a,y[b],b,!0)}else{b=x;for(var E=0;E<y.length;E++,b++){var z=y[E],tt=b<a.O.length?a.O.M(b):null;if(tt instanceof Re){if(tt.data!==z){var rt=Pv(a,tt.data),ot=Pv(a,z),at=ot!==rt;at||(rt=wv(a,rt),at=wv(a,ot)!==rt),at?(a.pc(b,!1),Em(a,z,E,!1)):tt.data=z}}else Em(a,z,E,!1)}for(;b<a.O.length;)a.pc(b,!1);a.$g=null,xv(a,x,0),Nl(a)||a.v(),a.graduatedIntervals=null,a.If()||Fm(a,a,!1),y=a.part,y!==null&&(y.Rh=null,y.ag=NaN,a.Te&&y instanceof $e&&(y.Te=!0),y.Te&&y instanceof $e&&(y.wc=null))}}function Em(a,y,x,b){if(!(y==null||0>x)){var E=Pv(a,y);if(E=wv(a,E),E!==null){if(ru(E),E=E.copy(),E.l&16777216){var z=a.ih();z!==null&&Sv(z,!0)}typeof y=="object"&&(a.ge===null&&(a.ge=new xn),a.ge.add(y,E)),z=x+cp(a),a.Gb(z,E),b&&(E.ub=y,xv(a,z,x),E.ub=null),E.data=y}}}function xv(a,y,x){for(a=a.O;y<a.length;){var b=a.M(y);if(b instanceof Re){var E=y,z=x;b.type===Re.TableRow?b.row=E:b.type===Re.TableColumn&&(b.column=E),b.itemIndex=z}y++,x++}}function Pv(a,y){if(y===null)return"";if(a=a.itemCategoryProperty,typeof a=="function")a=a(y);else if(typeof a=="string"&&typeof y=="object"){if(a==="")return"";a=jo(y,a)}else return"";if(a===void 0)return"";if(typeof a=="string")return a;fe("Panel.getCategoryForItemData found a non-string category for "+y+": "+a)}function wv(a,y){var x=a.itemTemplateMap,b=null;return x!==null&&(b=x.I(y)),b===null&&(x!==null&&(b=x.I("")),b===null&&(g1||(g1=!0,Ki('No item template Panel found for category "'+y+'" on '+a),Ki(" Using default item template."),a=new Re,y=new Mr,y.bind(new Vo("text","",Ir)),a.add(y),p1=a),b=p1)),b}function Fm(a,y,x){var b=y.enabledChanged;if(b!==null&&b(y,x),y instanceof Re){y=y.O.s,b=y.length;for(var E=0;E<b;E++){var z=y[E];x&&z instanceof Re&&!z.isEnabled||Fm(a,z,x)}}}function ah(a,y){y.name=a,yu.add(a,y)}Oe.Object.defineProperties(Re.prototype,{type:{get:function(){return this.na},set:function(a){var y=this.na;y!==a&&(this.na=a,this.isAtomic=this.na===Re.Grid,this.v(),this.g("type",y,a))}},elements:{get:function(){return this.O.iterator}},naturalBounds:{get:function(){return this.dc}},padding:{get:function(){return this.yb},set:function(a){typeof a=="number"?(0>a&&ri(a,">= 0",Re,"padding"),a=new ni(a)):(0>a.left&&ri(a.left,">= 0",Re,"padding:value.left"),0>a.right&&ri(a.right,">= 0",Re,"padding:value.right"),0>a.top&&ri(a.top,">= 0",Re,"padding:value.top"),0>a.bottom&&ri(a.bottom,">= 0",Re,"padding:value.bottom"));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.v(),this.g("padding",y,a))}},defaultAlignment:{get:function(){return this.Tm},set:function(a){var y=this.Tm;y.D(a)||(this.Tm=a=a.J(),this.v(),this.g("defaultAlignment",y,a))}},defaultStretch:{get:function(){return this.Uf},set:function(a){var y=this.Uf;y!==a&&(this.Uf=a,this.v(),this.g("defaultStretch",y,a))}},defaultSeparatorPadding:{get:function(){return this.T!==null?this.T.Qp:Zl},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.defaultSeparatorPadding;y.D(a)||(a=a.J(),this.T===null&&(this.T=new Vl),this.T.Qp=a,this.v(),this.g("defaultSeparatorPadding",y,a))}},defaultRowSeparatorStroke:{get:function(){return this.T!==null?this.T.ia:null},set:function(a){var y=this.defaultRowSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof er)&&(a instanceof er&&a.freeze(),this.T===null&&(this.T=new Vl),this.T.ia=a,this.N(),this.g("defaultRowSeparatorStroke",y,a))}},defaultRowSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.Ha:1},set:function(a){var y=this.defaultRowSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new Vl),this.T.Ha=a,this.v(),this.g("defaultRowSeparatorStrokeWidth",y,a))}},defaultRowSeparatorDashArray:{get:function(){return this.T!==null?this.T.V:null},set:function(a){var y=this.defaultRowSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,b=0,E=0;E<x;E++){var z=a[E];typeof z=="number"&&0<=z&&isFinite(z)||fe("defaultRowSeparatorDashArray value "+z+" at index "+E+" must be a positive number or zero."),b+=z}if(b===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Vl),this.T.V=a,this.N(),this.g("defaultRowSeparatorDashArray",y,a)}}},defaultColumnSeparatorStroke:{get:function(){return this.T!==null?this.T.u:null},set:function(a){var y=this.defaultColumnSeparatorStroke;y!==a&&(a===null||typeof a=="string"||a instanceof er)&&(a instanceof er&&a.freeze(),this.T===null&&(this.T=new Vl),this.T.u=a,this.N(),this.g("defaultColumnSeparatorStroke",y,a))}},defaultColumnSeparatorStrokeWidth:{get:function(){return this.T!==null?this.T.F:1},set:function(a){var y=this.defaultColumnSeparatorStrokeWidth;y!==a&&isFinite(a)&&0<=a&&(this.T===null&&(this.T=new Vl),this.T.F=a,this.v(),this.g("defaultColumnSeparatorStrokeWidth",y,a))}},defaultColumnSeparatorDashArray:{get:function(){return this.T!==null?this.T.o:null},set:function(a){var y=this.defaultColumnSeparatorDashArray;if(y!==a){if(a!==null){for(var x=a.length,b=0,E=0;E<x;E++){var z=a[E];typeof z=="number"&&0<=z&&isFinite(z)||fe("defaultColumnSeparatorDashArray value "+z+" at index "+E+" must be a positive number or zero."),b+=z}if(b===0){if(y===null)return;a=null}}this.T===null&&(this.T=new Vl),this.T.o=a,this.N(),this.g("defaultColumnSeparatorDashArray",y,a)}}},inRowsCols:{get:function(){return this.T!==null?this.T.nb:null},set:function(a){this.T===null&&(this.T=new Vl),this.T.nb=a}},viewboxStretch:{get:function(){return this.xo},set:function(a){var y=this.xo;y!==a&&(this.xo=a,this.v(),this.g("viewboxStretch",y,a))}},gridCellSize:{get:function(){return this.jn},set:function(a){var y=this.jn;if(!y.D(a)){a.w()&&a.width!==0&&a.height!==0||fe("Invalid Panel.gridCellSize: "+a),this.jn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Bs(x),this.N(),this.g("gridCellSize",y,a)}}},gridOrigin:{get:function(){return this.kn},set:function(a){var y=this.kn;if(!y.D(a)){a.w()||fe("Invalid Panel.gridOrigin: "+a),this.kn=a.J();var x=this.diagram;x!==null&&this===x.grid&&Bs(x),this.N(),this.g("gridOrigin",y,a)}}},graduatedMin:{get:function(){return this.ra!==null?this.ra.lq:0},set:function(a){var y=this.graduatedMin;y!==a&&(this.ra===null&&(this.ra=new ed),this.ra.lq=a,this.v(),this.g("graduatedMin",y,a),Hs(this)&&(a=this.part,a!==null&&Br(this,a,"graduatedRange")))}},graduatedMax:{get:function(){return this.ra!==null?this.ra.F:100},set:function(a){var y=this.graduatedMax;y!==a&&(this.ra===null&&(this.ra=new ed),this.ra.F=a,this.v(),this.g("graduatedMax",y,a),Hs(this)&&(a=this.part,a!==null&&Br(this,a,"graduatedRange")))}},graduatedRange:{get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{get:function(){return this.ra!==null?this.ra.ia:10},set:function(a){var y=this.graduatedTickUnit;y!==a&&0<a&&(this.ra===null&&(this.ra=new ed),this.ra.ia=a,this.v(),this.g("graduatedTickUnit",y,a))}},graduatedTickBase:{get:function(){return this.ra!==null?this.ra.V:0},set:function(a){var y=this.graduatedTickBase;y!==a&&(this.ra===null&&(this.ra=new ed),this.ra.V=a,this.v(),this.g("graduatedTickBase",y,a))}},graduatedMarks:{get:function(){return this.ra!==null?this.ra.u:null},set:function(a){this.ra!==null?this.ra.u=a:a!==null&&(this.ra=new ed,this.ra.u=a)}},graduatedBounds:{get:function(){return this.ra!==null?this.ra.j:null},set:function(a){this.ra!==null?this.ra.j=a:a!==null&&(this.ra=new ed,this.ra.j=a)}},graduatedIntervals:{get:function(){return this.ra!==null?this.ra.o:null},set:function(a){this.ra!==null?this.ra.o=a:a!==null&&(this.ra=new ed,this.ra.o=a)}},temporaryTextBlock:{get:function(){return this.ra!==null?this.ra.Zh:null},set:function(a){this.ra!==null?this.ra.Zh=a:a!==null&&(this.ra=new ed,this.ra.Zh=a)}},panelLayoutState:{get:function(){return this.F},set:function(a){this.F=a}},Te:{get:function(){return(this.l&8388608)!==0},set:function(a){(this.l&8388608)!==0!==a&&(this.l^=8388608)}},rowDefs:{get:function(){return this.T===null&&(this.T=new Vl),this.T.Pc}},rowCount:{get:function(){return this.T===null?0:this.rowDefs.length}},colDefs:{get:function(){return this.T===null&&(this.T=new Vl),this.T.Oc}},columnCount:{get:function(){return this.T===null?0:this.colDefs.length}},rowSizing:{get:function(){return this.T!==null?this.T.ob:Dm},set:function(a){var y=this.rowSizing;y!==a&&(this.T===null&&(this.T=new Vl),this.T.ob=a,this.v(),this.g("rowSizing",y,a))}},columnSizing:{get:function(){return this.T!==null?this.T.j:Dm},set:function(a){var y=this.columnSizing;y!==a&&(this.T===null&&(this.T=new Vl),this.T.j=a,this.v(),this.g("columnSizing",y,a))}},topIndex:{get:function(){return this.T!==null?this.T.Hb:0},set:function(a){var y=this.topIndex;y!==a&&((!isFinite(a)||0>a)&&fe("Panel.topIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Vl),this.T.Hb=a,this.v(),this.g("topIndex",y,a))}},leftIndex:{get:function(){return this.T!==null?this.T.hb:0},set:function(a){var y=this.leftIndex;y!==a&&((!isFinite(a)||0>a)&&fe("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.T===null&&(this.T=new Vl),this.T.hb=a,this.v(),this.g("leftIndex",y,a))}},data:{get:function(){return this.ub},set:function(a){var y=this.ub;if(y!==a){var x=this instanceof vn&&!(this instanceof Bi);ru(this),this.ub=a;var b=this.diagram;b!==null&&(x?(x=b.partManager,this instanceof _e?(y!==null&&x.bf.remove(y),a!==null&&x.bf.add(a,this)):this instanceof vn&&(y!==null&&x.cf.remove(y),a!==null&&x.cf.add(a,this))):(x=this.panel,x!==null&&x.ge!==null&&(y!==null&&x.ge.remove(y),a!==null&&x.ge.add(a,this)))),this.g("data",y,a),b!==null&&b.undoManager.isUndoingRedoing||a!==null&&this.La()}}},itemIndex:{get:function(){return this.zn},set:function(a){var y=this.zn;y!==a&&(this.zn=a,this.g("itemIndex",y,a))}},allBindings:{get:function(){return this.A!==null?this.A.nb:null},set:function(a){this.localBindings!==a&&(this.A===null&&(this.A=new Fc),this.A.nb=a)}},itemArray:{get:function(){return this.Hh},set:function(a){var y=this.Hh;if(y!==a||a!==null&&yx(this,a)){var x=this.diagram;y!==a&&(x!==null&&y!==null&&ly(x.partManager,this,x),this.Hh=a,x!==null&&a!==null&&ay(x.partManager,this)),this.g("itemArray",y,a),x!==null&&x.undoManager.isUndoingRedoing||c1(this,a)}}},itemTemplate:{get:function(){return this.itemTemplateMap===null?null:this.itemTemplateMap.I("")},set:function(a){if(this.itemTemplateMap===null){if(a===null)return;this.itemTemplateMap=new xn}var y=this.itemTemplateMap.I("");y!==a&&((a instanceof vn||a.isPanelMain)&&fe("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.itemTemplateMap.add("",a),this.g("itemTemplate",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv())}},itemTemplateMap:{get:function(){return this.A!==null?this.A.Pc:null},set:function(a){var y=this.itemTemplateMap;if(y!==a){for(var x=a.iterator;x.next(););ii(this),this.A.Pc=a,this.g("itemTemplateMap",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.mv()}}},itemCategoryProperty:{get:function(){return this.A!==null?this.A.Oc:"category"},set:function(a){var y=this.itemCategoryProperty;y!==a&&(ii(this),this.A.Oc=a,this.g("itemCategoryProperty",y,a))}},isAtomic:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("isAtomic",y,a))}},isClipping:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this instanceof Yn&&(this.tb=null),this.v(),this.g("isClipping",y,a))}},isOpposite:{get:function(){return(this.l&33554432)!==0},set:function(a){var y=(this.l&33554432)!==0;y!==a&&(this.l^=33554432,this.v(),this.g("isOpposite",y,a))}},isEnabled:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;if(y!==a){var x=this.panel===null||this.panel.If();this.l^=4194304,this.g("isEnabled",y,a),y=this.diagram,y!==null&&y.undoManager.isUndoingRedoing||x&&Fm(this,this,a)}}},alignmentFocusName:{get:function(){return this.$e},set:function(a){var y=this.$e;y!==a&&(this.$e=a,this.v(),this.g("alignmentFocusName",y,a))}}}),Oe.Object.defineProperties(Re,{Position:{get:function(){return yu.I("Position")}},Horizontal:{get:function(){return yu.I("Horizontal")}},Vertical:{get:function(){return yu.I("Vertical")}},Spot:{get:function(){return yu.I("Spot")}},Auto:{get:function(){return yu.I("Auto")}},Table:{get:function(){return yu.I("Table")}},Viewbox:{get:function(){return yu.I("Viewbox")}},TableRow:{get:function(){return yu.I("TableRow")}},TableColumn:{get:function(){return yu.I("TableColumn")}},Link:{get:function(){return yu.I("Link")}},Grid:{get:function(){return yu.I("Grid")}},Graduated:{get:function(){return yu.I("Graduated")}}}),Re.prototype.rebuildItemElements=Re.prototype.mv,Re.prototype.findItemPanelForData=Re.prototype.sx,Re.prototype.updateTargetBindings=Re.prototype.La,Re.prototype.copyTemplate=Re.prototype.Uy,Re.prototype.graduatedValueForPoint=Re.prototype.Gz,Re.prototype.graduatedPointForValue=Re.prototype.Fz,Re.prototype.findColumnForLocalX=Re.prototype.fz,Re.prototype.findRowForLocalY=Re.prototype.nz,Re.prototype.addColumnDefinition=Re.prototype.By,Re.prototype.addRowDefinition=Re.prototype.Hy,Re.prototype.addRowColumnDefinition=Re.prototype.Gy,Re.prototype.removeColumnDefinition=Re.prototype.jA,Re.prototype.getColumnDefinition=Re.prototype.Eb,Re.prototype.removeRowDefinition=Re.prototype.oA,Re.prototype.getRowDefinition=Re.prototype.Fb,Re.prototype.removeAt=Re.prototype.mb,Re.prototype.remove=Re.prototype.remove,Re.prototype.insertAt=Re.prototype.Gb,Re.prototype.elt=Re.prototype.M,Re.prototype.add=Re.prototype.add,Re.prototype.findObject=Re.prototype.fb,Re.prototype.findInVisualTree=Re.prototype.Nl,Re.prototype.walkVisualTreeFrom=Re.prototype.qm,Re.prototype.findMainElement=Re.prototype.Pb;var g1=!1,p1=null,yu=new xn;Re.className="Panel",Re.definePanelLayout=ah,ah("Position",new mm),ah("Vertical",new ym),ah("Auto",new xm),ah("Link",new km);function ed(){this.lq=0,this.F=100,this.ia=10,this.V=0,this.Zh=this.o=this.j=this.u=null}ed.prototype.copy=function(){var a=new ed;return a.lq=this.lq,a.F=this.F,a.ia=this.ia,a.V=this.V,a.u=this.u,a.j=this.j,a.o=this.o,a.Zh=this.Zh,a},ed.className="GradPanelSettings";function Vl(){this.Pc=[],this.Oc=[],this.j=this.ob=Dm,this.hb=this.Hb=0,this.Qp=Zl,this.Ha=1,this.V=this.ia=null,this.F=1,this.nb=this.o=this.u=null}Vl.prototype.copy=function(a){for(var y=new Vl,x=this.Pc,b=x.length,E=y.Pc,z=0;z<b;z++)if(x[z]!==void 0){var tt=x[z].copy();tt.wi(a),E[z]=tt}for(x=this.Oc,b=x.length,E=y.Oc,z=0;z<b;z++)x[z]!==void 0&&(tt=x[z].copy(),tt.wi(a),E[z]=tt);return y.ob=this.ob,y.j=this.j,y.Hb=this.Hb,y.hb=this.hb,y.Qp=this.Qp.J(),y.Ha=this.Ha,y.ia=this.ia,y.V=this.V,y.F=this.F,y.u=this.u,y.o=this.o,y.nb=this.nb,y},Vl.className="TablePanelSettings";function Jo(a){qr(this),this.Me=null,this.uq=!0,this.Za=0,this.Hc=NaN,this.jj=0,this.hj=1/0,this.Jb=vs,this.pa=this.oc=this.oa=0,this.be=null,this.oo=Cv,this.hg=Xn,this.lo=this.dg=null,this.mo=NaN,this.Ma=this.tj=null,this.Pm=!1,a&&(Object.assign(this,a),a.column!==void 0?(this.isRow=!1,this.index=a.column):a.row!==void 0&&(this.isRow=!0,this.index=a.row))}Jo.prototype.copy=function(){var a=new Jo;return a.uq=this.uq,a.Za=this.Za,a.Hc=this.Hc,a.jj=this.jj,a.hj=this.hj,a.Jb=this.Jb,a.oa=this.oa,a.oc=this.oc,a.pa=this.pa,a.hg=this.hg,a.oo=this.oo,this.dg===null?a.dg=null:a.dg=this.dg.J(),a.lo=this.lo,a.mo=this.mo,a.tj=null,this.tj!==null&&(a.separatorDashArray=uo(this.separatorDashArray)),a.Ma=this.Ma,a.Pm=this.Pm,a.be=this.be,a};function Tm(a,y){y.isRow?a.height=y.height:a.width=y.width,a.minimum=y.minimum,a.maximum=y.maximum,a.alignment=y.alignment,a.stretch=y.stretch,a.sizing=y.sizing,a.dg=y.separatorPadding===null?null:y.separatorPadding.J(),a.separatorStroke=y.separatorStroke,a.separatorStrokeWidth=y.separatorStrokeWidth,a.tj=null,y.separatorDashArray&&(a.tj=uo(y.separatorDashArray)),a.background=y.background,a.coversSeparators=y.coversSeparators,a.be=y.be}xt=Jo.prototype,xt.qb=function(a){a.classType===Jo&&(this.sizing=a)},xt.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+Co(this)},xt.wi=function(a){this.Me=a},xt.Io=function(a){var y=0,x=this.Me;if(this.index!==a&&(a=this.separatorStroke,a===null&&x!==null&&(a=this.isRow?x.defaultRowSeparatorStroke:x.defaultColumnSeparatorStroke),a!==null&&(y=this.separatorStrokeWidth,isNaN(y)&&(x!==null?y=this.isRow?x.defaultRowSeparatorStrokeWidth:x.defaultColumnSeparatorStrokeWidth:y=0))),a=this.dg,a===null)if(x!==null)a=x.defaultSeparatorPadding;else return y;return y+(this.isRow?a.top:a.left)},xt.Wc=function(){var a=0,y=this.Me,x=0,b=this.isRow;if(y!==null&&y.type===Re.Table)for(var E=b?y.rowDefs.length:y.colDefs.length,z=0;z<E;z++){var tt=b?y.rowDefs[z]:y.colDefs[z];if(tt!==void 0&&tt.oa!==0){x=tt.index;break}}if(this.index!==x&&(x=this.separatorStroke,x===null&&y!==null&&(x=b?y.defaultRowSeparatorStroke:y.defaultColumnSeparatorStroke),x!==null&&(a=this.separatorStrokeWidth,isNaN(a)&&(y!==null?a=b?y.defaultRowSeparatorStrokeWidth:y.defaultColumnSeparatorStrokeWidth:a=0))),b=this.dg,b===null)if(y!==null)b=y.defaultSeparatorPadding;else return a;return a+(this.isRow?b.top+b.bottom:b.left+b.right)},xt.Ob=function(a,y,x){var b=this.Me;if(b!==null&&(b.cb(Ur,a,this,y,x,void 0,void 0),this.be!==null&&(y=b.diagram,y!==null&&!y.skipsModelSourceBindings&&(b=b.ih(),b!==null&&(y=b.data,y!==null)))))for(x=this.be.iterator;x.next();)x.value.sp(this,y,a,b)};function Nm(a){if(a.sizing===Cv){var y=a.Me;return a.isRow?y.rowSizing:y.columnSizing}return a.sizing}xt.bind=function(a,y,x,b){var E=null;return typeof a=="string"?E=new Vo(a,y,x,b):E=a,E.xd=this,a=this.panel,a!==null&&(y=a.ih(),y!==null&&f1(y)&&fe("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+E+" on "+a)),this.be===null&&(this.be=new Ve),this.be.add(E),this},Oe.Object.defineProperties(Jo.prototype,{panel:{get:function(){return this.Me}},isRow:{get:function(){return this.uq},set:function(a){this.uq=a}},index:{get:function(){return this.Za},set:function(a){this.Za=a}},height:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&ri(a,">= 0",Jo,"height"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("height",y,a))}},width:{get:function(){return this.Hc},set:function(a){var y=this.Hc;y!==a&&(0>a&&ri(a,">= 0",Jo,"width"),this.Hc=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("width",y,a))}},minimum:{get:function(){return this.jj},set:function(a){var y=this.jj;y!==a&&((0>a||!isFinite(a))&&ri(a,">= 0",Jo,"minimum"),this.jj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("minimum",y,a))}},maximum:{get:function(){return this.hj},set:function(a){var y=this.hj;y!==a&&(0>a&&ri(a,">= 0",Jo,"maximum"),this.hj=a,this.actual=this.oa,this.panel!==null&&this.panel.v(),this.Ob("maximum",y,a))}},alignment:{get:function(){return this.Jb},set:function(a){var y=this.Jb;y.D(a)||(this.Jb=a.J(),this.panel!==null&&this.panel.v(),this.Ob("alignment",y,a))}},stretch:{get:function(){return this.hg},set:function(a){var y=this.hg;y!==a&&(this.hg=a,this.panel!==null&&this.panel.v(),this.Ob("stretch",y,a))}},separatorPadding:{get:function(){return this.dg},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.dg;a!==null&&y!==null&&y.D(a)||(a!==null&&(a=a.J()),this.dg=a,this.panel!==null&&this.panel.v(),this.Ob("separatorPadding",y,a))}},separatorStroke:{get:function(){return this.lo},set:function(a){var y=this.lo;y!==a&&(a!==null&&Nc(a,"RowColumnDefinition.separatorStroke"),a instanceof er&&a.freeze(),this.lo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStroke",y,a))}},separatorStrokeWidth:{get:function(){return this.mo},set:function(a){var y=this.mo;y!==a&&(this.mo=a,this.panel!==null&&this.panel.v(),this.Ob("separatorStrokeWidth",y,a))}},separatorDashArray:{get:function(){return this.tj},set:function(a){var y=this.tj;if(y!==a){if(a!==null){for(var x=a.length,b=0,E=0;E<x;E++){var z=a[E];typeof z=="number"&&0<=z&&isFinite(z)||fe("separatorDashArray value "+z+" at index "+E+" must be a positive number or zero."),b+=z}if(b===0){if(y===null)return;a=null}}this.tj=a,this.panel!==null&&this.panel.N(),this.Ob("separatorDashArray",y,a)}}},background:{get:function(){return this.Ma},set:function(a){var y=this.Ma;y!==a&&(a!==null&&Nc(a,"RowColumnDefinition.background"),a instanceof er&&a.freeze(),this.Ma=a,this.panel!==null&&this.panel.N(),this.Ob("background",y,a))}},coversSeparators:{get:function(){return this.Pm},set:function(a){var y=this.Pm;y!==a&&(this.Pm=a,this.panel!==null&&this.panel.N(),this.Ob("coversSeparators",y,a))}},sizing:{get:function(){return this.oo},set:function(a){var y=this.oo;y!==a&&(this.oo=a,this.panel!==null&&this.panel.v(),this.Ob("sizing",y,a))}},actual:{get:function(){return this.oa},set:function(a){this.oa=isNaN(this.Hc)?Math.max(Math.min(this.hj,a),this.jj):Math.max(Math.min(this.hj,this.Hc),this.jj)}},measured:{get:function(){return this.oc},set:function(a){this.oc=a}},total:{get:function(){return this.oa+this.Wc()}},position:{get:function(){return this.pa},set:function(a){this.pa=a}}}),Jo.prototype.computeEffectiveSpacing=Jo.prototype.Wc,Jo.prototype.computeEffectiveSpacingTop=Jo.prototype.Io;var Cv=new me(Jo,"Default",0),gp=new me(Jo,"None",1),Dm=new me(Jo,"ProportionalExtra",2);Jo.className="RowColumnDefinition",Jo.Default=Cv,Jo.None=gp,Jo.ProportionalExtra=Dm;function Qn(a,y){te.call(this),this.Rd=this.ua=null,this.an="None",this.xc=this.Ui="black",this.ig=1,this.Na=this.Yg=null,this.Vn=this.Un=NaN,this.fa=null,typeof a=="string"?this.figure=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}le(Qn,te),Qn.prototype.cloneProtected=function(a){te.prototype.cloneProtected.call(this,a),a.ua=this.ua,a.Rd=this.Rd,a.an=this.an,a.Ui=this.Ui,a.xc=this.xc,a.ig=this.ig,this.Yg!==null&&(a.Yg=uo(this.Yg)),this.Na!==null&&(a.Na=this.Na.nc?this.Na:this.Na.copy()),a.Un=this.Un,a.Vn=this.Vn,this.fa!==null&&(a.fa=this.fa.copy())};function tc(a){a.Na===null?a.Na=new kv:a.Na.nc&&(a.Na=a.Na.copy())}xt=Qn.prototype,xt.th=function(){te.prototype.th.call(this),this.Na!==null&&(this.Na.nc=!0)},xt.qb=function(a){a===Ee||a===dn||a===Pi||a===Xn?this.geometryStretch=a:te.prototype.qb.call(this,a)},xt.toString=function(){return"Shape("+(this.figure!=="None"?this.figure:this.toArrow!=="None"?this.toArrow:this.fromArrow)+")#"+Co(this)};function vg(a,y,x,b){var E=x.length;if(!(4>E)){var z=b.measuredBounds,tt=Math.max(1,z.width);z=z.height;for(var rt=x[0],ot=x[1],at,ut,ct,mt,yt,St,Lt=0,Ot=Kn(),Dt=2;Dt<E;Dt+=2)at=x[Dt],ut=x[Dt+1],ct=at-rt,rt=ut-ot,ct===0&&(ct=.001),mt=rt/ct,yt=Math.atan2(rt,ct),St=Math.sqrt(ct*ct+rt*rt),Ot.push([ct,yt,mt,St]),Lt+=St,rt=at,ot=ut;rt=x[0],ot=x[1],ct=b.measuredBounds.width,b instanceof Qn&&(ct-=b.strokeWidth),1>ct&&(ct=1),E=x=ct,at=tt/2,ut=at!==0,Dt=0,St=Ot[Dt],ct=St[0],yt=St[1],mt=St[2],St=St[3];for(var Gt=0;.1<=Lt;){if(Gt===0&&(ut?(E=x,E-=at,Lt-=at,ut=!1):E=x,E===0&&(E=1)),E>Lt){zn(Ot);return}E>St?(Gt=E-St,E=St):Gt=0;var Vt=Math.sqrt(E*E/(1+mt*mt));if(0>ct&&(Vt=-Vt),rt+=Vt,ot+=mt*Vt,a.translate(rt,ot),a.rotate(yt),a.translate(-(tt/2),-(z/2)),Gt===0&&b.hh(a,y),a.translate(tt/2,z/2),a.rotate(-yt),a.translate(-rt,-ot),Lt-=E,St-=E,Gt!==0){if(Dt++,Dt===Ot.length){zn(Ot);return}St=Ot[Dt],ct=St[0],yt=St[1],mt=St[2],St=St[3],E=Gt}}zn(Ot)}}xt.hh=function(a,y){var x=this.xc,b=this.Ui;if(x!==null||b!==null){var E=this.ua;if(E!==null){a.yc();var z=this.actualBounds,tt=this.naturalBounds;b!==null&&wo(this,a,b,!0,!1,tt,z);var rt=this.part,ot=this.ig;if(x===null||ot!==0||rt===null||!this.isPanelMain&&rt.Pb()!==this||(ot=rt.type===Re.Link&&rt instanceof Bi&&rt.category==="Selection"&&rt.adornedObject instanceof Qn&&rt.adornedPart.Pb()===rt.adornedObject?rt.adornedObject.strokeWidth:0),ot===0&&(x=null),x!==null&&ot!==0&&(wo(this,a,x,!1,!1,tt,z),a.lineWidth=ot,a.lineJoin=this.strokeJoin,a.lineCap=this.strokeCap,a.miterLimit=this.strokeMiterLimit),z=!1,rt&&y.Gf("drawShadows")&&(z=rt.isShadowed),a.Il===!1&&(z=!1),rt=!0,x===null||b!==null&&b!=="transparent"||(rt=!1),tt=!1,ot=this.strokeDashArray,ot!==null&&(tt=!0,a.js(ot,this.strokeDashOffset)),E.type===We.j)a.beginPath(),a.moveTo(E.startX,E.startY),a.lineTo(E.endX,E.endY),x!==null&&a.jk(),a.Se();else if(E.type===We.u){var at=E.startX;ot=E.startY;var ut=E.endX,ct=E.endY;E=Math.min(at,ut);var mt=Math.min(ot,ct);at=Math.abs(ut-at),ot=Math.abs(ct-ot),a.beginPath(),a.rect(E,mt,at,ot),b!==null&&a.ng(b),x!==null&&(rt&&z&&Lh(a),a.jk(),rt&&z&&Qh(a)),a.Se()}else if(E.type===We.F)at=E.startX,ot=E.startY,ut=E.endX,ct=E.endY,E=Math.abs(ut-at)/2,mt=Math.abs(ct-ot)/2,at=Math.min(at,ut)+E,ot=Math.min(ot,ct)+mt,a.beginPath(),a.moveTo(at,ot-mt),a.bezierCurveTo(at+ne.wg*E,ot-mt,at+E,ot-ne.wg*mt,at+E,ot),a.bezierCurveTo(at+E,ot+ne.wg*mt,at+ne.wg*E,ot+mt,at,ot+mt),a.bezierCurveTo(at-ne.wg*E,ot+mt,at-E,ot+ne.wg*mt,at-E,ot),a.bezierCurveTo(at-E,ot-ne.wg*mt,at-ne.wg*E,ot-mt,at,ot-mt),a.closePath(),b!==null&&a.ng(b),x!==null&&(rt&&z&&Lh(a),a.jk(),rt&&z&&Qh(a)),a.Se();else if(E.type===We.o)for(E=E.figures,ot=E.length,mt=0;mt<ot;mt++){at=E.s[mt],a.beginPath(),a.moveTo(at.startX,at.startY),ut=at.segments.s,ct=ut.length;for(var yt=null,St=0;St<ct;St++){var Lt=ut[St];switch(Lt.type){case ts:a.moveTo(Lt.endX,Lt.endY);break;case xr:a.lineTo(Lt.endX,Lt.endY);break;case Fs:a.bezierCurveTo(Lt.point1X,Lt.point1Y,Lt.point2X,Lt.point2Y,Lt.endX,Lt.endY);break;case qa:a.quadraticCurveTo(Lt.point1X,Lt.point1Y,Lt.endX,Lt.endY);break;case No:if(Lt.radiusX===Lt.radiusY){var Ot=Math.PI/180;a.arc(Lt.point1X,Lt.point1Y,Lt.radiusX,Lt.startAngle*Ot,(Lt.startAngle+Lt.sweepAngle)*Ot,0>Lt.sweepAngle,yt!==null?yt.endX:at.startX,yt!==null?yt.endY:at.startY)}else if(yt=Sa(Lt,at),Ot=yt.length,Ot===0)a.lineTo(Lt.centerX,Lt.centerY);else for(var Dt=0;Dt<Ot;Dt++){var Gt=yt[Dt];Dt===0&&a.lineTo(Gt[0],Gt[1]),a.bezierCurveTo(Gt[2],Gt[3],Gt[4],Gt[5],Gt[6],Gt[7])}break;case ja:if(Dt=Ot=0,yt!==null&&yt.type===No){if(yt=Sa(yt,at),Gt=yt.length,Gt===0){a.lineTo(Lt.endX,Lt.endY);break}yt=yt[Gt-1]||null,yt!==null&&(Ot=yt[6],Dt=yt[7])}else Ot=yt!==null?yt.endX:at.startX,Dt=yt!==null?yt.endY:at.startY;if(yt=ua(Lt,at,Ot,Dt),Ot=yt.length,Ot===0){a.lineTo(Lt.endX,Lt.endY);break}for(Dt=0;Dt<Ot;Dt++)Gt=yt[Dt],a.bezierCurveTo(Gt[2],Gt[3],Gt[4],Gt[5],Gt[6],Gt[7]);break;default:fe("Segment not of valid type: "+Lt.type)}Lt.isClosed&&a.closePath(),yt=Lt}ut=at.isFilled,z?at.isShadowed?(ut===!0&&b!=="transparent"&&b!==null&&a.ng(b,at.isEvenOdd),x!==null&&(ut&&rt&&Lh(a),a.jk(),ut&&rt&&Qh(a))):(Lh(a),ut&&b!=="transparent"&&b!==null&&a.ng(b,at.isEvenOdd),x!==null&&a.jk(),Qh(a)):(ut&&b!==null&&a.ng(b,at.isEvenOdd),x!==null&&a.jk()),a.Se(mt)}if(tt&&a.fs(),this.pathPattern!==null){if(x=this.pathPattern,x.measure(1/0,1/0),b=x.measuredBounds,x.arrange(0,0,b.width,b.height),z=this.geometry,a.save(),a.beginPath(),b=Kn(),z.type===We.j)b.push(z.startX),b.push(z.startY),b.push(z.endX),b.push(z.endY),vg(a,y,b,x);else if(z.type===We.o)for(z=z.figures.iterator;z.next();){for(rt=z.value,b.length=0,b.push(rt.startX),b.push(rt.startY),tt=rt.startX,E=rt.startY,ot=tt,mt=E,at=rt.segments.s,ut=at.length,ct=0;ct<ut;ct++){switch(St=at[ct],St.type){case ts:vg(a,y,b,x),b.length=0,b.push(St.endX),b.push(St.endY),tt=St.endX,E=St.endY,ot=tt,mt=E;break;case xr:b.push(St.endX),b.push(St.endY),tt=St.endX,E=St.endY;break;case Fs:ne.Qe(tt,E,St.point1X,St.point1Y,St.point2X,St.point2Y,St.endX,St.endY,.5,b),tt=St.endX,E=St.endY;break;case qa:ne.ep(tt,E,St.point1X,St.point1Y,St.endX,St.endY,.5,b),tt=St.endX,E=St.endY;break;case No:if(Lt=Sa(St,rt),yt=Lt.length,yt===0){b.push(St.centerX),b.push(St.centerY),tt=St.centerX,E=St.centerY;break}for(Ot=0;Ot<yt;Ot++)Dt=Lt[Ot],ne.Qe(tt,E,Dt[2],Dt[3],Dt[4],Dt[5],Dt[6],Dt[7],.5,b),tt=Dt[6],E=Dt[7];break;case ja:if(Lt=ua(St,rt,tt,E),yt=Lt.length,yt===0){b.push(St.endX),b.push(St.endY),tt=St.endX,E=St.endY;break}for(Ot=0;Ot<yt;Ot++)Dt=Lt[Ot],ne.Qe(tt,E,Dt[2],Dt[3],Dt[4],Dt[5],Dt[6],Dt[7],.5,b),tt=Dt[6],E=Dt[7];break;default:fe("Segment not of valid type: "+St.type)}St.isClosed&&(b.push(ot),b.push(mt),vg(a,y,b,x))}vg(a,y,b,x)}else if(z.type===We.u)b.push(z.startX),b.push(z.startY),b.push(z.endX),b.push(z.startY),b.push(z.endX),b.push(z.endY),b.push(z.startX),b.push(z.endY),b.push(z.startX),b.push(z.startY),vg(a,y,b,x);else if(z.type===We.F){if(E=new qo,E.startX=z.endX,E.startY=(z.startY+z.endY)/2,tt=new Ni(No),tt.startAngle=0,tt.sweepAngle=360,tt.centerX=(z.startX+z.endX)/2,tt.centerY=(z.startY+z.endY)/2,tt.radiusX=Math.abs(z.startX-z.endX)/2,tt.radiusY=Math.abs(z.startY-z.endY)/2,E.add(tt),z=Sa(tt,E),rt=z.length,rt===0)b.push(tt.centerX),b.push(tt.centerY);else for(tt=E.startX,E=E.startY,ot=0;ot<rt;ot++)mt=z[ot],ne.Qe(tt,E,mt[2],mt[3],mt[4],mt[5],mt[6],mt[7],.5,b),tt=mt[6],E=mt[7];vg(a,y,b,x)}zn(b),a.restore(),a.Vc(!1)}}}},xt.kk=function(a,y,x){return!te.prototype.kk.call(this,a,y,x)||this.xc===null&&this.Ui===null||this.ua===null||this.pathPattern!==null||this.geometry.figures.length!==this.svg.getElementsByTagName("path").length?!1:(a.Hl=this.svg,this.hh(a,y),a.Hl=null,!0)},xt.nk=function(a){return this.geometry!==null&&1<this.geometry.figures.length||this.pathPattern!==null?!0:te.prototype.nk.call(this,a)},xt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("path");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},xt.ga=function(a,y){if(y===void 0&&(y=new jt),a instanceof yn){a.Mc()&&fe("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var x=this.naturalBounds,b=this.strokeWidth;y.h(a.x*(x.width+b)-b/2+x.x+a.offsetX,a.y*(x.height+b)-b/2+x.y+a.offsetY)}else y.set(a);return this.oe.Ga(y),y},xt.mi=function(a){a===void 0&&(a=new ye);var y=this.naturalBounds,x=this.oe;y=ye.allocAt(y.x,y.y,y.width,y.height);var b=this.strokeWidth;return y.Bc(b/2,b/2),b=jt.allocAt(y.x,y.y).transform(x),a.h(b.x,b.y,0,0),b.h(y.right,y.y).transform(x),co(a,b.x,b.y,0,0),b.h(y.right,y.bottom).transform(x),co(a,b.x,b.y,0,0),b.h(y.x,y.bottom).transform(x),co(a,b.x,b.y,0,0),ye.free(y),jt.free(b),a},xt.gh=function(a,y){var x=this.geometry;if(x===null||this.fill===null&&this.stroke===null)return!1;var b=x.bounds,E=this.strokeWidth/2;x.type!==We.j||y||(E+=2);var z=ye.alloc();if(z.assign(b),z.Bc(E+2,E+2),!z.ca(a))return ye.free(z),!1;if(b=E+1e-4,x.type===We.j)return this.stroke===null||(b=(x.endX-x.startX)*(a.x-x.startX)+(x.endY-x.startY)*(a.y-x.startY),0>(x.startX-x.endX)*(a.x-x.endX)+(x.startY-x.endY)*(a.y-x.endY)||0>b)?!1:(ye.free(z),ne.Yb(x.startX,x.startY,x.endX,x.endY,E,a.x,a.y));if(x.type===We.u){y=x.startX;var tt=x.startY,rt=x.endX;if(x=x.endY,z.x=Math.min(y,rt),z.y=Math.min(tt,x),z.width=Math.abs(rt-y),z.height=Math.abs(x-tt),this.fill===null){if(z.Bc(-b,-b),z.ca(a))return ye.free(z),!1;z.Bc(b,b)}return this.stroke!==null&&z.Bc(E,E),a=z.ca(a),ye.free(z),a}if(x.type===We.F){tt=x.startX,E=x.startY,rt=x.endX;var ot=x.endY;if(x=Math.min(tt,rt),y=Math.min(E,ot),tt=Math.abs(rt-tt)/2,E=Math.abs(ot-E)/2,x=a.x-(x+tt),y=a.y-(y+E),this.fill===null){if(tt-=b,E-=b,0>=tt||0>=E||1>=x*x/(tt*tt)+y*y/(E*E))return ye.free(z),!1;tt+=b,E+=b}return this.stroke!==null&&(tt+=b,E+=b),ye.free(z),0>=tt||0>=E?!1:1>=x*x/(tt*tt)+y*y/(E*E)}if(x.type===We.o)return ye.free(z),this.fill===null?fu(x,a.x,a.y,E):Qu(x,a,E,1<this.strokeWidth,y);fe("Unknown Geometry type: "+x.type)},xt.Wl=function(a,y,x,b){var E=this.desiredSize,z=this.ig;if(a=Math.max(a,0),y=Math.max(y,0),this.Rd!==null)var tt=this.geometry.bounds;else{var rt=this.figure,ot=Mv[rt];if(ot===void 0){var at=ne.Ze[rt];typeof at=="string"&&(at=ne.Ze[at]),typeof at=="function"?(ot=at(null,100,100),Mv[rt]=ot):fe("Unsupported Figure: "+rt)}tt=ot.bounds}rt=tt.width,ot=tt.height,at=tt.width;var ut=tt.height;switch(Wa(this,!0)){case Ee:b=x=0;break;case Ae:at=Math.max(a-z,0),ut=Math.max(y-z,0);break;case gn:at=Math.max(a-z,0),b=0;break;case Fn:x=0,ut=Math.max(y-z,0)}isFinite(E.width)&&(at=E.width),isFinite(E.height)&&(ut=E.height);var ct=this.maxSize,mt=this.minSize;switch(x=Math.max(x-z,mt.width),b=Math.max(b-z,mt.height),at=Math.min(ct.width,at),ut=Math.min(ct.height,ut),at=isFinite(at)?Math.max(x,at):Math.max(rt,x),ut=isFinite(ut)?Math.max(b,ut):Math.max(ot,b),x=Lv(this),x){case Ee:break;case Ae:rt=at,ot=ut;break;case dn:x=Math.min(at/rt,ut/ot),isFinite(x)||(x=1),rt*=x,ot*=x;break;default:fe(x+" is not a valid geometryStretch.")}this.Rd!==null?(rt===0&&(rt=.001),ot===0&&(ot=.001),x=this.Rd!==null?this.Rd:this.ua,tt=x.bounds,b=rt/tt.width,tt=ot/tt.height,isFinite(b)||(b=1),isFinite(tt)||(tt=1),this.ua=b===1&&tt===1?x:x.copy().scale(b,tt)):this.ua!==null&&ne.$(this.ua.Sk,a-z)&&ne.$(this.ua.Rk,y-z)||(this.ua=Qn.makeGeometry(this,rt,ot)),tt=this.ua.bounds,a===1/0||y===1/0?this.Ge(tt.x-z/2,tt.y-z/2,a===0&&rt===0?0:tt.width+z,y===0&&ot===0?0:tt.height+z):this.Ge(-(z/2),-(z/2),at+z,ut+z),E.w()?(at=E.width,ut=E.height,at=Math.min(ct.width,at),ut=Math.min(ct.height,ut),at=Math.max(mt.width,at),ut=Math.max(mt.height,ut),this.dc.h(0,0,at,ut)):this.dc.assign(tt)};function Lv(a){var y=a.geometryStretch;return a.Rd!==null?y===Xn?Ae:y:y===Xn?Mv[a.figure].defaultStretch:y}xt.eh=function(a,y,x,b){fa(this,a,y,x,b)},xt.rs=function(a,y,x){return this.Sj(a.x,a.y,y.x,y.y,x)},xt.Sj=function(a,y,x,b,E){var z=this.transform,tt=1/(z.m11*z.m22-z.m12*z.m21),rt=z.m22*tt,ot=-z.m12*tt,at=-z.m21*tt,ut=z.m11*tt,ct=tt*(z.m21*z.dy-z.m22*z.dx),mt=tt*(z.m12*z.dx-z.m11*z.dy);z=a*rt+y*at+ct,tt=a*ot+y*ut+mt,rt=x*rt+b*at+ct,ot=x*ot+b*ut+mt,ct=this.ig/2,at=this.ua,at===null&&(this.measure(1/0,1/0),at=this.ua);var yt=at.bounds;if(ut=!1,at.type===We.j)if(1.5>=this.strokeWidth)ut=ne.Ve(at.startX,at.startY,at.endX,at.endY,z,tt,rt,ot,E);else{if(at.startX===at.endX?(b=ct,ut=0):(y=(at.endY-at.startY)/(at.endX-at.startX),ut=ct/Math.sqrt(1+y*y),b=ut*y),y=Kn(),a=new jt,ne.Ve(at.startX+b,at.startY+ut,at.endX+b,at.endY+ut,z,tt,rt,ot,a)&&y.push(a),a=new jt,ne.Ve(at.startX-b,at.startY-ut,at.endX-b,at.endY-ut,z,tt,rt,ot,a)&&y.push(a),a=new jt,ne.Ve(at.startX+b,at.startY+ut,at.startX-b,at.startY-ut,z,tt,rt,ot,a)&&y.push(a),a=new jt,ne.Ve(at.endX+b,at.endY+ut,at.endX-b,at.endY-ut,z,tt,rt,ot,a)&&y.push(a),rt=y.length,rt===0)return zn(y),!1;for(ut=!0,ot=1/0,b=0;b<rt;b++)a=y[b],x=(a.x-z)*(a.x-z)+(a.y-tt)*(a.y-tt),x<ot&&(ot=x,E.x=a.x,E.y=a.y);zn(y)}else if(at.type===We.u)ut=ne.Ff(yt.x-ct,yt.y-ct,yt.x+yt.width+ct,yt.y+yt.height+ct,z,tt,rt,ot,E);else if(at.type===We.F){y=ye.allocAt(yt.x,yt.y,yt.width,yt.height).Bc(ct,ct);t:if(y.width===0)ut=ne.Ve(y.x,y.y,y.x,y.y+y.height,z,tt,rt,ot,E);else if(y.height===0)ut=ne.Ve(y.x,y.y,y.x+y.width,y.y,z,tt,rt,ot,E);else{if(a=y.width/2,at=y.height/2,b=y.x+a,ut=y.y+at,x=9999,z!==rt&&(x=(tt-ot)/(z-rt)),9999>Math.abs(x)){if(ot=tt-ut-x*(z-b),0>a*a*x*x+at*at-ot*ot){E.x=NaN,E.y=NaN,ut=!1;break t}ct=Math.sqrt(a*a*x*x+at*at-ot*ot),rt=(-(a*a*x*ot)+a*at*ct)/(at*at+a*a*x*x)+b,a=(-(a*a*x*ot)-a*at*ct)/(at*at+a*a*x*x)+b,at=x*(rt-b)+ot+ut,ot=x*(a-b)+ot+ut,Math.abs((z-rt)*(z-rt))+Math.abs((tt-at)*(tt-at))<Math.abs((z-a)*(z-a))+Math.abs((tt-ot)*(tt-ot))?(E.x=rt,E.y=at):(E.x=a,E.y=ot)}else{if(rt=at*at,ot=z-b,rt-=rt/(a*a)*ot*ot,0>rt){E.x=NaN,E.y=NaN,ut=!1;break t}ot=Math.sqrt(rt),rt=ut+ot,ot=ut-ot,Math.abs(rt-tt)<Math.abs(ot-tt)?(E.x=z,E.y=rt):(E.x=z,E.y=ot)}ut=!0}ye.free(y)}else if(at.type===We.o){mt=jt.alloc();var St=rt-z,Lt=ot-tt,Ot=St*St+Lt*Lt,Dt=z,Gt=tt;if(0<Ot&&yt.contains(Dt,Gt)&&(mt.x=Dt,mt.y=Gt,this.ca(mt)))for(St!==0&&.5>Math.abs(St)?(Lt*=.5/St,St=.5):Lt!==0&&.5>Math.abs(Lt)&&(St*=.5/Lt,Lt=.5),Dt-=St,Gt-=Lt;yt.contains(Dt,Gt);)Dt-=St,Gt-=Lt;for(E.x=rt,E.y=ot,Lt=0;Lt<at.figures.count;Lt++){var Vt=at.figures.s[Lt],Yt=Vt.isFilled?Dt:z,qt=Vt.isFilled?Gt:tt,ae=Vt.segments;yt=Vt.startX,St=Vt.startY;for(var Je=yt,un=St,nn=0;nn<ae.count;nn++){var Ge=ae.s[nn],we=Ge.type,Un=Ge.endX,jn=Ge.endY,ji=!1;switch(we){case ts:Je=Un,un=jn;break;case xr:ji=Bm(yt,St,Un,jn,Yt,qt,rt,ot,mt);break;case Fs:ji=ne.Eo(yt,St,Ge.point1X,Ge.point1Y,Ge.point2X,Ge.point2Y,Un,jn,Yt,qt,rt,ot,.6,mt);break;case qa:ji=ne.Eo(yt,St,yt+2/3*(Ge.point1X-yt),St+2/3*(Ge.point1Y-St),Un+2/3*(Ge.point1X-Un),jn+2/3*(Ge.point1Y-jn),Un,jn,Yt,qt,rt,ot,.6,mt);break;case No:case ja:we=Ge.type===No?Sa(Ge,Vt):ua(Ge,Vt,yt,St);var Lr=we.length;if(Lr===0){ji=Bm(yt,St,Ge.type===No?Ge.centerX:Ge.endX,Ge.type===No?Ge.centerY:Ge.endY,Yt,qt,rt,ot,mt);break}for(jn=null,Un=0;Un<Lr;Un++){if(jn=we[Un],Un===0&&Bm(yt,St,jn[0],jn[1],Yt,qt,rt,ot,mt)){var ds=Am(Yt,qt,mt,Ot,E);ds<Ot&&(Ot=ds,ut=!0)}ne.Eo(jn[0],jn[1],jn[2],jn[3],jn[4],jn[5],jn[6],jn[7],Yt,qt,rt,ot,.6,mt)&&(ds=Am(Yt,qt,mt,Ot,E),ds<Ot&&(Ot=ds,ut=!0))}Un=jn[6],jn=jn[7];break;default:fe("Unknown Segment type: "+we)}yt=Un,St=jn,ji&&(ji=Am(Yt,qt,mt,Ot,E),ji<Ot&&(Ot=ji,ut=!0)),Ge.isClosed&&(Un=Je,jn=un,Bm(yt,St,Un,jn,Yt,qt,rt,ot,mt)&&(Ge=Am(Yt,qt,mt,Ot,E),Ge<Ot&&(Ot=Ge,ut=!0)))}}z=x-a,tt=b-y,rt=Math.sqrt(z*z+tt*tt),rt!==0&&(z/=rt,tt/=rt),E.x-=z*ct,E.y-=tt*ct,jt.free(mt)}else fe("Unknown Geometry type: "+at.type);return ut?(this.transform.Ga(E),!0):!1};function Am(a,y,x,b,E){return a=x.x-a,y=x.y-y,y=a*a+y*y,y<b?(E.x=x.x,E.y=x.y,y):b}function Bm(a,y,x,b,E,z,tt,rt,ot){if(ne.$(a,x)&&ne.$(y,b)||ne.$(E,tt)&&ne.$(z,rt))return!1;var at=!1,ut=(E-tt)*(y-b)-(z-rt)*(a-x);return ut===0?!1:(ot.x=((E*rt-z*tt)*(a-x)-(E-tt)*(a*b-y*x))/ut,ot.y=((E*rt-z*tt)*(y-b)-(z-rt)*(a*b-y*x))/ut,(a>x?a-x:x-a)<(y>b?y-b:b-y)?(a=y<b?y:b,y=y<b?b:y,(ot.y>a||ne.$(ot.y,a))&&(ot.y<y||ne.$(ot.y,y))&&(at=!0)):(y=a<x?a:x,a=a<x?x:a,(ot.x>y||ne.$(ot.x,y))&&(ot.x<a||ne.$(ot.x,a))&&(at=!0)),at)}xt.fh=function(a,y){if(y===void 0)return a.Re(this.actualBounds);var x=this.ua;x===null&&(this.measure(1/0,1/0),x=this.ua),x=x.bounds;var b=this.strokeWidth/2,E=!1,z=jt.alloc();return z.h(x.x-b,x.y-b),a.ca(y.Ga(z))&&(z.h(x.x-b,x.bottom+b),a.ca(y.Ga(z))&&(z.h(x.right+b,x.bottom+b),a.ca(y.Ga(z))&&(z.h(x.right+b,x.y-b),a.ca(y.Ga(z))&&(E=!0)))),jt.free(z),E},xt.Yc=function(a,y){if(this.fh(a,y)||y===void 0&&(y=this.transform,a.Re(this.actualBounds)))return!0;var x=oi.alloc();x.set(y),x.Vj();var b=a.left,E=a.right,z=a.top;a=a.bottom;var tt=jt.alloc();if(tt.h(b,z),x.Ga(tt),this.gh(tt,!0)||(tt.h(E,z),x.Ga(tt),this.gh(tt,!0))||(tt.h(b,a),x.Ga(tt),this.gh(tt,!0))||(tt.h(E,a),x.Ga(tt),this.gh(tt,!0)))return jt.free(tt),!0;var rt=jt.alloc(),ot=jt.alloc();return x.set(y),x.bv(this.transform),x.Vj(),rt.x=E,rt.y=z,rt.transform(x),tt.x=b,tt.y=z,tt.transform(x),y=!1,ec(this,tt,rt,ot)?y=!0:(tt.x=E,tt.y=a,tt.transform(x),ec(this,tt,rt,ot)?y=!0:(rt.x=b,rt.y=a,rt.transform(x),ec(this,tt,rt,ot)?y=!0:(tt.x=b,tt.y=z,tt.transform(x),ec(this,tt,rt,ot)&&(y=!0)))),jt.free(tt),oi.free(x),jt.free(rt),jt.free(ot),y};function ec(a,y,x,b){if(!a.rs(y,x,b))return!1;a=y.x,y=y.y;var E=x.x,z=x.y;return x=b.x,b=b.y,a===E?(y<z?(a=y,y=z):a=z,b>=a&&b<=y):(a<E?(b=a,a=E):b=E,x>=b&&x<=a)}xt.tx=function(a,y,x){function b(Ot,Dt){for(var Gt=Ot.length,Vt=0;Vt<Gt;Vt+=2)if(Dt.zd(Ot[Vt],Ot[Vt+1])>E)return!0;return!1}if(x&&this.fill!==null&&this.gh(a,!0))return!0;var E=a.Bf(y),z=E;if(1.5<this.strokeWidth&&(E=this.strokeWidth/2+Math.sqrt(E),E*=E),y=this.ua,y===null&&(this.measure(1/0,1/0),y=this.ua,y===null))return!1;if(!x){var tt=y.bounds,rt=tt.x,ot=tt.y,at=tt.x+tt.width;if(tt=tt.y+tt.height,wi(a.x,a.y,rt,ot)<=E&&wi(a.x,a.y,at,ot)<=E&&wi(a.x,a.y,rt,tt)<=E&&wi(a.x,a.y,at,tt)<=E)return!0}if(rt=y.startX,ot=y.startY,at=y.endX,tt=y.endY,y.type===We.j){if(x=(rt-at)*(a.x-at)+(ot-tt)*(a.y-tt),gs(a.x,a.y,rt,ot,at,tt)<=(0<=(at-rt)*(a.x-rt)+(tt-ot)*(a.y-ot)&&0<=x?E:z))return!0}else{if(y.type===We.u)return y=!1,x&&(y=gs(a.x,a.y,rt,ot,rt,tt)<=E||gs(a.x,a.y,rt,ot,at,ot)<=E||gs(a.x,a.y,at,ot,at,tt)<=E||gs(a.x,a.y,rt,tt,at,tt)<=E),y;if(y.type===We.F){y=a.x-(rt+at)/2,z=a.y-(ot+tt)/2;var ut=Math.abs(at-rt)/2,ct=Math.abs(tt-ot)/2;if(ut===0||ct===0)return gs(a.x,a.y,rt,ot,at,tt)<=E;if(x){if(a=ne.$y(ut,ct,y,z),a*a<=E)return!0}else return!(wi(y,z,-ut,0)>=E||wi(y,z,0,-ct)>=E||wi(y,z,0,ct)>=E||wi(y,z,ut,0)>=E)}else if(y.type===We.o){if(at=y.bounds,z=at.x,rt=at.y,ot=at.x+at.width,at=at.y+at.height,a.x>ot&&a.x<z&&a.y>at&&a.y<rt&&gs(a.x,a.y,z,rt,z,at)>E&&gs(a.x,a.y,z,rt,ot,rt)>E&&gs(a.x,a.y,ot,at,z,at)>E&&gs(a.x,a.y,ot,at,ot,rt)>E)return!1;if(z=Math.sqrt(E),x){if(this.fill===null?fu(y,a.x,a.y,z):Qu(y,a,z,!0,!1))return!0}else{for(x=y.figures,y=0;y<x.count;y++){if(z=x.s[y],tt=z.startX,ut=z.startY,a.zd(tt,ut)>E)return!1;for(rt=z.segments.s,ot=rt.length,at=0;at<ot;at++)switch(ct=rt[at],ct.type){case ts:case xr:if(tt=ct.endX,ut=ct.endY,a.zd(tt,ut)>E)return!1;break;case Fs:var mt=Kn();if(ne.Qe(tt,ut,ct.point1X,ct.point1Y,ct.point2X,ct.point2Y,ct.endX,ct.endY,.8,mt),tt=b(mt,a),zn(mt),tt||(tt=ct.endX,ut=ct.endY,a.zd(tt,ut)>E))return!1;break;case qa:if(mt=Kn(),ne.ep(tt,ut,ct.point1X,ct.point1Y,ct.endX,ct.endY,.8,mt),tt=b(mt,a),zn(mt),tt||(tt=ct.endX,ut=ct.endY,a.zd(tt,ut)>E))return!1;break;case No:case ja:mt=ct.type===No?Sa(ct,z):ua(ct,z,tt,ut);var yt=mt.length;if(yt===0){if(tt=ct.type===No?ct.centerX:ct.endX,ut=ct.type===No?ct.centerY:ct.endY,a.zd(tt,ut)>E)return!1;break}ct=null;for(var St=Kn(),Lt=0;Lt<yt;Lt++)if(ct=mt[Lt],St.length=0,ne.Qe(ct[0],ct[1],ct[2],ct[3],ct[4],ct[5],ct[6],ct[7],.8,St),b(St,a))return zn(St),!1;zn(St),ct!==null&&(tt=ct[6],ut=ct[7]);break;default:fe("Unknown Segment type: "+ct.type)}}return!0}}}return!1},xt.qc=function(){this.ua=null},xt.kq=function(){return this.ig};function m1(a){var y=a.diagram;y!==null&&y.undoManager.isUndoingRedoing||(a.segmentOrientation=Cp,a.toArrow!=="None"?(a.segmentIndex=-1,a.alignmentFocus=js):a.fromArrow!=="None"&&(a.segmentIndex=0,a.alignmentFocus=new yn(1-js.x,js.y)))}Qn.makeGeometry=function(a,y,x){if(a.toArrow!=="None")var b=kh[a.toArrow];else a.fromArrow!=="None"?b=kh[a.fromArrow]:(b=ne.Ze[a.figure],typeof b=="string"&&(b=ne.Ze[b]),b===void 0&&fe("Unknown Shape.figure: "+a.figure),b=b(a,y,x),b.Sk=y,b.Rk=x);if(b===null){var E=ne.Ze.Rectangle;typeof E=="function"&&(b=E(a,y,x))}return b};function v1(a){var y=kh[a];if(y===void 0){var x=a.toLowerCase();if(x==="none")return"None";if(y=kh[x],y===void 0){var b=null,E;for(E in ne.um)if(E.toLowerCase()===x){b=E;break}if(b!==null)return a=We.parse(ne.um[b],!1),kh[b]=a,x!==b&&(kh[x]=b),b}}return typeof y=="string"?y:y instanceof We?a:null}Oe.Object.defineProperties(Qn.prototype,{geometry:{get:function(){return this.ua!==null?this.ua:this.Rd},set:function(a){var y=this.ua,x=this.Rd;if(y!==a){a!==null?this.Rd=this.ua=a.freeze():this.Rd=this.ua=null;var b=this.part;b!==null&&(b.ag=NaN),this.v(),this.g("geometry",y||x,a),Hs(this)&&(a=this.part,a!==null&&Br(this,a,"geometryString"))}}},geometryString:{get:function(){return this.geometry===null?"":this.geometry.toString()},set:function(a){a=We.parse(a);var y=a.normalize();this.geometry=a,this.position=a=jt.allocAt(-y.x,-y.y),jt.free(a)}},isGeometryPositioned:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.v(),this.g("isGeometryPositioned",y,a))}},fill:{get:function(){return this.Ui},set:function(a){var y=this.Ui;y!==a&&(a!==null&&Nc(a,"Shape.fill"),a instanceof er&&a.freeze(),this.Ui=a,this.N(),this.g("fill",y,a))}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&Nc(a,"Shape.stroke"),a instanceof er&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},strokeWidth:{get:function(){return this.ig},set:function(a){var y=this.ig;if(y!==a)if(0<=a){this.ig=a,this.v();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeWidth",y,a)}else ri(a,"value >= 0",Qn,"strokeWidth:value")}},strokeCap:{get:function(){return this.Na!==null?this.Na.Hr:"butt"},set:function(a){var y=this.strokeCap;y!==a&&(typeof a!="string"||a!=="butt"&&a!=="round"&&a!=="square"?ri(a,'"butt", "round", or "square"',Qn,"strokeCap"):(tc(this),this.Na.Hr=a,this.N(),this.g("strokeCap",y,a)))}},strokeJoin:{get:function(){return this.Na!==null?this.Na.Ir:"miter"},set:function(a){var y=this.strokeJoin;y!==a&&(typeof a!="string"||a!=="miter"&&a!=="bevel"&&a!=="round"?ri(a,'"miter", "bevel", or "round"',Qn,"strokeJoin"):(tc(this),this.Na.Ir=a,this.N(),this.g("strokeJoin",y,a)))}},strokeMiterLimit:{get:function(){return this.Na!==null?this.Na.Jr:10},set:function(a){var y=this.strokeMiterLimit;if(y!==a&&1<=a){tc(this),this.Na.Jr=a,this.N();var x=this.part;x!==null&&(x.ag=NaN),this.g("strokeMiterLimit",y,a)}}},strokeDashArray:{get:function(){return this.Yg},set:function(a){var y=this.Yg;if(y!==a){if(a!==null){for(var x=a.length,b=0,E=0;E<x;E++){var z=a[E];0<=z&&isFinite(z)||fe("strokeDashArray:value "+z+" at index "+E+" must be a positive number or zero."),b+=z}if(b===0){if(y===null)return;a=null}}this.Yg=a,this.N(),this.g("strokeDashArray",y,a)}}},strokeDashOffset:{get:function(){return this.Na!==null?this.Na.uj:0},set:function(a){var y=this.strokeDashOffset;y!==a&&0<=a&&(tc(this),this.Na.uj=a,this.N(),this.g("strokeDashOffset",y,a))}},figure:{get:function(){return this.an},set:function(a){var y=this.an;if(y!==a){var x=ne.Ze[a];typeof x=="function"?x=a:(x=ne.Ze[a.toLowerCase()])||fe("Unknown Shape.figure: "+a),y!==x&&(a=this.part,a!==null&&(a.ag=NaN),this.an=x,this.Rd=null,this.qc(),this.v(),this.g("figure",y,x))}}},toArrow:{get:function(){return this.Ua!==null?this.Ua.V:"None"},set:function(a){var y=this.toArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?fe("Unknown Shape.toArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new rf),this.Ua.V=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("toArrow",y,x))}}},fromArrow:{get:function(){return this.Ua!==null?this.Ua.j:"None"},set:function(a){var y=this.fromArrow;if(a===!0?a="Standard":a===!1&&(a=""),y!==a){var x=v1(a);x===null?fe("Unknown Shape.fromArrow: "+a):y!==x&&(this.Ua===null&&(this.Ua=new rf),this.Ua.j=x,this.Rd=null,this.qc(),this.v(),m1(this),this.g("fromArrow",y,x))}}},spot1:{get:function(){return this.Na!==null?this.Na.fg:vs},set:function(a){var y=this.spot1;y.D(a)||(a=a.J(),tc(this),this.Na.fg=a,this.v(),this.g("spot1",y,a))}},spot2:{get:function(){return this.Na!==null?this.Na.gg:vs},set:function(a){var y=this.spot2;y.D(a)||(a=a.J(),tc(this),this.Na.gg=a,this.v(),this.g("spot2",y,a))}},parameter1:{get:function(){return this.Un},set:function(a){var y=this.Un;y!==a&&(this.Un=a,this.qc(),this.v(),this.g("parameter1",y,a))}},parameter2:{get:function(){return this.Vn},set:function(a){var y=this.Vn;y!==a&&(this.Vn=a,this.qc(),this.v(),this.g("parameter2",y,a))}},naturalBounds:{get:function(){return this.dc}},pathPattern:{get:function(){return this.Na!==null?this.Na.br:null},set:function(a){var y=this.pathPattern;y!==a&&(tc(this),this.Na.br=a,this.N(),this.g("pathPattern",y,a))}},geometryStretch:{get:function(){return this.Na!==null?this.Na.jq:Xn},set:function(a){var y=this.geometryStretch;y!==a&&(tc(this),this.Na.jq=a,this.v(),this.g("geometryStretch",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new bh),this.fa.Tk=a;var x=this.diagram;x!==null&&this.panel===x.grid&&Bs(x),this.v(),x=this.panel,x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new bh),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new bh),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new bh),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}}}),Qn.prototype.intersectsRect=Qn.prototype.Yc,Qn.prototype.containedInRect=Qn.prototype.fh,Qn.prototype.getNearestIntersectionPoint=Qn.prototype.rs,Qn.prototype.getDocumentBounds=Qn.prototype.mi,Qn.prototype.getDocumentPoint=Qn.prototype.ga;var kh=new ai,Mv=new ai;Qn.className="Shape",Qn.getFigureGenerators=function(){var a=new xn,y;for(y in ne.Ze)y!==y.toLowerCase()&&a.add(y,ne.Ze[y]);return a.freeze(),a},Qn.defineFigureGenerator=function(a,y){var x=a.toLowerCase(),b=ne.Ze;b[a]=y,b[x]=a},Qn.getArrowheadGeometries=function(){var a=new xn;for(b in ne.um)if(kh[b]===void 0){var y=We.parse(ne.um[b],!1);kh[b]=y,y=b.toLowerCase(),y!==b&&(kh[y]=b)}for(var x in kh)if(x!==x.toLowerCase()){var b=kh[x];b instanceof We&&a.add(x,b)}return a.freeze(),a},Qn.defineArrowheadGeometry=function(a,y){var x=null;typeof y=="string"?x=We.parse(y,!1):x=y,y=a.toLowerCase(),y!=="none"&&a!==y||fe("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var b=kh;b[a]=x,b[y]=a};function kv(){this.nc=!1,this.Hr="butt",this.Ir="miter",this.Jr=10,this.uj=0,this.br=null,this.jq=Xn,this.gg=this.fg=vs}kv.prototype.copy=function(){var a=new kv;return a.Hr=this.Hr,a.Ir=this.Ir,a.Jr=this.Jr,a.uj=this.uj,a.br=this.br,a.jq=this.jq,a.fg=this.fg.J(),a.gg=this.gg.J(),a};function Mr(a,y){return te.call(this),zm||(Ua=So?new iu(null).context:null,zm=!0),this.l|=2097152,this.ec="",this.xc="black",this.Ae="13px sans-serif",this.Lq=this.Cb=this.Gc=0,this.da=this.fa=this.Gm=null,this.Ih=0,this.df=null,this.Le=0,this.ze=this.Qb=this.Qc=null,typeof a=="string"?this.text=a:a&&Object.assign(this,a),y&&Object.assign(this,y),this}le(Mr,te),Mr.prototype.cloneProtected=function(a){te.prototype.cloneProtected.call(this,a),a.ec=this.ec,a.xc=this.xc,a.Ae=this.Ae,a.Gc=this.Gc,a.Cb=this.Cb,a.Lq=this.Lq,a.Gm=this.Gm,this.fa!==null&&(a.fa=this.fa.copy()),this.da!==null&&(a.da=this.da.nc?this.da:this.da.copy()),a.Ih=this.Ih,a.df=this.df,a.Le=this.Le,a.Qc=this.Qc,a.Qb=this.Qb,a.ze=this.ze};function lh(a){a.da===null?a.da=new Av:a.da.nc&&(a.da=a.da.copy())}xt=Mr.prototype,xt.th=function(){te.prototype.th.call(this),this.da!==null&&(this.da.nc=!0)};function y1(a,y){a.l=y.l|6144,a.pb=y.opacity,a.Ma=y.background,a.areaBackground=y.areaBackground,a.jd=y.desiredSize.J(),a.minSize=y.minSize.J(),a.maxSize=y.maxSize.J(),y.Lb!==null?a.Lb=y.Lb.copy():a.Lb=null,a.Ca=y.scale,a.Kb=y.angle,a.stretch=y.stretch,a.Kg=y.margin.J(),a.Jb=y.alignment.J(),a.sk=y.alignmentFocus.J(),a.segmentFraction=y.segmentFraction,a.segmentOffset=y.segmentOffset.J(),a.segmentOrientation=y.segmentOrientation,y.tb!==null&&(a.tb=y.tb.copy()),a.shadowVisible=y.shadowVisible,a.ec=y.ec,a.xc=y.xc,a.Ae=y.Ae,a.fa!==null&&(a.fa=y.fa.copy()),y.da!==null&&(a.da=y.da.nc?y.da:y.da.copy()),a.Ih=y.Ih}xt.qb=function(a){a.classType===Mr?this.wrap=a:te.prototype.qb.call(this,a)},xt.toString=function(){return 22<this.ec.length?'TextBlock("'+this.ec.substring(0,20)+'"...)':'TextBlock("'+this.ec+'")'},xt.v=function(){te.prototype.v.call(this)},xt.hh=function(a,y){if(this.xc!==null&&this.ec.length!==0&&this.Ae!==null){var x=this.naturalBounds,b=this.actualBounds,E=x.width,z=x.height,tt=mp(this),rt=a.textAlign=this.textAlign,ot=y.tn;rt==="start"?rt=ot?"right":"left":rt==="end"&&(rt=ot?"left":"right"),ot=this.isUnderline;var at=this.isStrikethrough;wo(this,a,this.xc,!0,!1,x,b),(ot||at)&&wo(this,a,this.xc,!1,!1,x,b),b=0,x=!1;var ut=this.oe,ct=ut.dx-(tt*ut.m21+ut.dx);ut=ut.dy-(tt*ut.m22+ut.dy);var mt=y.scale;switch(8>(ct*ct+ut*ut)*mt*mt&&(x=!0),y.ib!==a&&(x=!1),y.ib instanceof pl&&(x=!1),y.Gf("textGreeking")===!1&&(x=!1),y=this.spacingAbove,ct=this.spacingBelow,this.flip){case Di:a.translate(E,0),a.scale(-1,1);break;case si:a.translate(0,z),a.scale(1,-1);break;case hr:a.translate(E,z),a.scale(-1,-1)}if(a.yc(),ut=this.Gc,mt=(y+tt+ct)*ut,z>mt&&(b=this.verticalAlignment,b=b.y*z-b.y*mt+b.offsetY),ut===1&&this.ze!==null)ct=this.Cb,ct>E&&(ct=E),this.Oj(this.ze,a,0,b+y,E,tt,ct,x,rt,ot,at);else if(this.Qc!==null&&this.Qb!==null)for(mt=0;mt<ut;mt++){var yt=this.Qc[mt];yt>E&&(yt=E),b+=y,this.Oj(this.Qb[mt],a,0,b,E,tt,yt,x,rt,ot,at),b+=tt+ct}switch(this.flip){case Di:a.scale(-1,1),a.translate(-E,0);break;case si:a.scale(1,-1),a.translate(0,-z);break;case hr:a.scale(-1,-1),a.translate(-E,-z)}}},xt.Oj=function(a,y,x,b,E,z,tt,rt,ot,at,ut){var ct=0;if(rt)ot==="left"?ct=0:ot==="right"?ct=E-tt:ot==="center"&&(ct=(E-tt)/2),y.fillRect(x+ct,b+.25*z,tt,1);else{if(ot==="left"?ct=0:ot==="right"?ct=E:ot==="center"&&(ct=E/2),E=Om!==null?Om(this,z):.75*z,y.fillText(a,x+ct,b+E),a=z/20|0,a===0&&(a=1),ot==="right"?ct-=tt:ot==="center"&&(ct-=tt/2),at){rt=Im!==null?Im(this,z):.8*z,ot=x+ct,at=b+rt,E=x+ct+tt,rt=b+rt;var mt=a;y.beginPath(),y.lineWidth=mt,y.moveTo(ot,at),y.lineTo(E,rt),y.stroke(),y.Se(),y instanceof pl&&y.ad.classList.add("gojs-td")}ut&&(ut=b+z-z/2.2|0,a%2!==0&&(ut+=.5),b=x+ct,z=ut,x=x+ct+tt,tt=ut,ct=a,y.beginPath(),y.lineWidth=ct,y.moveTo(b,z),y.lineTo(x,tt),y.stroke(),y.Se(),y instanceof pl&&y.ad.classList.add("gojs-td"))}},xt.kk=function(a,y,x){if(!te.prototype.kk.call(this,a,y,x))return!1;if(wo(this,a,this.xc,!0,!1,this.naturalBounds,this.actualBounds),x){if(this.svg.getElementsByTagName("text").length===0)return!0;for(y=this.svg.getElementsByClassName("gojs-td"),x=0;x<y.length;x++)Qy(a,y[x],!1)}else y=this.svg,y.innerHTML=this.text,Qy(a,y,!0);return!0},xt.nk=function(a){return 1<this.lineCount||this.isUnderline||this.isStrikethrough?!0:te.prototype.nk.call(this,a)},xt.Dv=function(a,y){if(a.nodeName!=="g")a.setAttributeNS(null,"filter",y);else{a=a.getElementsByTagName("text");for(var x=0;x<a.length;x++)a[x].setAttributeNS(null,"filter",y)}},xt.Wl=function(a,y,x,b){var E=this.Gc;this.Ih=a,this.l&=-16777217;var z=this.Ae;Ua!==null&&M1!==z&&(M1=Ua.font=z),this.Cb=this.Le=0,this.ze=this.Qb=this.Qc=this.df=null;var tt;if(isNaN(this.desiredSize.width)){if(z=this.ec.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),z.length===0)z=8;else if(this.isMultiline){for(var rt=tt=0,ot=!1;!ot;){var at=z.indexOf(`
|
|
`,rt);at===-1&&(at=z.length,ot=!0),rt=z.substr(rt,at-rt),this.formatting===vp&&(rt=rt.trim()),tt=Math.max(tt,Su(rt)),rt=at+1}z=tt}else tt=z.indexOf(`
|
|
`,0),0<=tt&&(z=z.substr(0,tt)),z=Su(z);z=Math.min(z,a/this.scale)}else z=this.desiredSize.width;if(this.panel!==null&&(z=Math.min(z,this.panel.maxSize.width)),tt=x1(this,z),isNaN(this.desiredSize.height)?tt=Math.min(tt,y/this.scale):tt=this.desiredSize.height,ot=tt,this.Cb!==0&&this.Qc!==null&&this.Qb!==null&&this.overflow===Rm&&(y=this.Ae,y=this.overflow===Rm?S1(y):0,at=this.spacingAbove+this.spacingBelow,at=Math.max(0,mp(this)+at),ot=Math.min(this.maxLines-1,Math.max(Math.floor(ot/at+.01)-1,0)),!(ot+1>=this.Qb.length))){for(this.l|=16777216,at=this.Qb[ot],y=Math.max(1,a-y);Su(at)>y&&1<at.length;)at=at.substr(0,at.length-1);at+=yp,y=Su(at),this.Qb[ot]=at,this.Qb=this.Qb.slice(0,ot+1),this.Qc[ot]=y,this.Qc=this.Qc.slice(0,ot+1),this.Le=this.Qb.length,this.Cb=Math.max(this.Cb,y),this.Gc=this.Le,this.Gc===1&&(this.ze=this.Qb[0])}(this.wrap===P1||isNaN(this.desiredSize.width))&&(z=isNaN(a)?this.Cb:Math.min(a,this.Cb)),z=Math.max(x,z),tt=Math.max(b,tt),Ra(this.dc,z,tt),this.Ge(0,0,z,tt),this.svg!==null&&E!==this.Gc&&(this.Uc=!0)},xt.eh=function(a,y,x,b){fa(this,a,y,x,b)};function pp(a,y,x){a.ze===null?(a.ze=y,a.Cb=x):((a.Qb===null||a.Qc===null)&&(a.Qb=[],a.Qc=[],a.Qb.push(a.ze),a.Qc.push(a.Cb)),a.Qb.push(y),a.Qc.push(x),a.Qb.length>a.maxLines&&(a.l|=16777216))}function bv(a,y,x,b){var E=a.formatting===vp;E&&(y=y.trim());var z=0,tt=a.Ae,rt=a.spacingAbove+a.spacingBelow;rt=Math.max(0,mp(a)+rt);var ot=a.overflow===Rm?S1(tt):0;if(a.Gc>=a.maxLines)b!==null&&b.h(0,rt);else if(tt=y,a.wrap===Ev){a.Le=1;var at=Su(y);if(ot===0||at<=x)a.Cb=Math.max(a.Cb,at),pp(a,y,a.Cb),b!==null&&b.h(at,rt);else{for(z=yg(a,tt),tt=tt.substr(z.length),y=yg(a,tt),at=Su(z+y);0<y.length&&at<=x;)z+=y,tt=tt.substr(y.length),y=yg(a,tt),at=z+y,E&&(at=at.trim()),at=Su(at);for(E&&(y=y.trim()),z+=y,x=Math.max(1,x-ot);Su(z)>x&&1<z.length;)z=z.substr(0,z.length-1);a.l|=16777216,z+=yp;var ut=Su(z);a.Cb=ut,pp(a,z,ut),b!==null&&b.h(ut,rt)}}else{for(ot=0,tt.length===0&&(ot=1,pp(a,tt,0));0<tt.length;){for(y=yg(a,tt),tt=tt.substr(y.length);Su(y)>x;){var ct=1;for(at=Su(y.substr(0,ct)),ut=0;at<=x;)ct++,ut=at,at=Su(y.substr(0,ct));if(ct===1){var mt=at;z=Math.max(z,at)}else mt=ut,z=Math.max(z,ut);if(ct--,1>ct&&(ct=1),pp(a,y.substr(0,ct),mt),ot++,y=y.substr(ct),a.Gc+ot>a.maxLines)break}for(ut=yg(a,tt),at=Su(y+ut);0<ut.length&&at<=x;)y+=ut,tt=tt.substr(ut.length),ut=yg(a,tt),at=y+ut,E&&(at=at.trim()),at=Su(at);if(E&&(y=y.trim()),y!==""&&(y[y.length-1]==="\xAD"&&(y=y.substring(0,y.length-1)+"\u2010"),ut.length===0?(ct=at,z=Math.max(z,at)):(ct=ut=Su(y),z=Math.max(z,ut)),pp(a,y,ct),ot++,a.Gc+ot>a.maxLines))break}a.Le=Math.min(a.maxLines,ot),a.Cb=Math.max(a.Cb,z),b!==null&&b.h(a.Cb,rt*a.Le)}}function yg(a,y){if(a.wrap===w1)return y.substr(0,1);for(var x=y.length,b=0,E=Sx;b<x&&!E.test(y.charAt(b));)b++;for(a.formatting===C1&&(x=Math.min(x,b+1));b<x&&E.test(y.charAt(b));)b++;return b>=y.length?y:y.substr(0,b)}function Su(a){return Ua===null?8*a.length:Ua.measureText(a).width}function mp(a){if(a.df!==null)return a.df;var y=a.Ae;if(Ua===null){var x=16;return a.df=x}return Nv[y]!==void 0&&5e3>L1?x=Nv[y]:(x=1.3*Ua.measureText("M").width,Nv[y]=x,L1++),a.df=x}function S1(a){if(Ua===null)return 6;if(jm[a]!==void 0&&5e3>Dv)var y=jm[a];else y=Ua.measureText(yp).width,jm[a]=y,Dv++;return y}function x1(a,y){var x=a.ec.replace(/\r\n/g,`
|
|
`).replace(/\r/g,`
|
|
`),b=a.spacingAbove+a.spacingBelow;if(b=Math.max(0,mp(a)+b),x.length===0)return a.Cb=0,a.Gc=1,b;if(!a.isMultiline){var E=x.indexOf(`
|
|
`,0);0<=E&&(x=x.substr(0,E))}E=0;for(var z=a.Gc=0,tt,rt=!1;!rt;){if(tt=x.indexOf(`
|
|
`,z),tt===-1&&(tt=x.length,rt=!0),z<=tt){if(z=x.substr(z,tt-z),a.wrap!==Ev){a.Le=0;var ot=Ze.alloc();bv(a,z,y,ot),E+=ot.height,Ze.free(ot),a.Gc+=a.Le}else bv(a,z,y,null),E+=b,a.Gc++;a.Gc===a.maxLines&&(rt=!0)}z=tt+1}return a.Lq=E}Oe.Object.defineProperties(Mr.prototype,{font:{get:function(){return this.Ae},set:function(a){var y=this.Ae;y!==a&&(this.Ae=a,this.df=null,this.v(),this.g("font",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;a!=null?a=a.toString():a="",y!==a&&(this.ec=a,this.v(),this.g("text",y,a),this.Uc=!0)}},textAlign:{get:function(){return this.da!==null?this.da.Or:"start"},set:function(a){var y=this.textAlign;y===a||a!=="start"&&a!=="end"&&a!=="left"&&a!=="right"&&a!=="center"||(lh(this),this.da.Or=a,this.N(),this.g("textAlign",y,a))}},flip:{get:function(){return this.da!==null?this.da.Xf:Ee},set:function(a){var y=this.flip;y!==a&&(lh(this),this.da.Xf=a,this.N(),this.g("flip",y,a))}},verticalAlignment:{get:function(){return this.da!==null?this.da.Yr:Xd},set:function(a){var y=this.verticalAlignment;y.D(a)||(a=a.J(),lh(this),this.da.Yr=a,La(this),this.g("verticalAlignment",y,a))}},naturalBounds:{get:function(){if(!this.dc.w()){var a=Ze.alloc();bv(this,this.ec,999999,a);var y=a.width;Ze.free(a),a=x1(this,y);var x=this.desiredSize;isNaN(x.width)||(y=x.width),isNaN(x.height)||(a=x.height),Ra(this.dc,y,a)}return this.dc}},isMultiline:{get:function(){return(this.l&2097152)!==0},set:function(a){var y=(this.l&2097152)!==0;y!==a&&(this.l^=2097152,this.v(),this.g("isMultiline",y,a))}},isUnderline:{get:function(){return(this.l&4194304)!==0},set:function(a){var y=(this.l&4194304)!==0;y!==a&&(this.l^=4194304,this.Uc=!0,this.N(),this.g("isUnderline",y,a))}},isStrikethrough:{get:function(){return(this.l&8388608)!==0},set:function(a){var y=(this.l&8388608)!==0;y!==a&&(this.l^=8388608,this.Uc=!0,this.N(),this.g("isStrikethrough",y,a))}},wrap:{get:function(){return this.da!==null?this.da.$r:Fv},set:function(a){var y=this.wrap;y!==a&&(lh(this),this.da.$r=a,this.v(),this.g("wrap",y,a))}},overflow:{get:function(){return this.da!==null?this.da.$q:Tv},set:function(a){var y=this.overflow;y!==a&&(lh(this),this.da.$q=a,this.v(),this.g("overflow",y,a))}},isOverflowed:{get:function(){return(this.l&16777216)!==0}},stroke:{get:function(){return this.xc},set:function(a){var y=this.xc;y!==a&&(a!==null&&Nc(a,"TextBlock.stroke"),a instanceof er&&a.freeze(),this.xc=a,this.N(),this.g("stroke",y,a))}},lineCount:{get:function(){return this.Gc}},lineHeight:{get:function(){return mp(this)}},editable:{get:function(){return(this.l&1048576)!==0},set:function(a){var y=(this.l&1048576)!==0;y!==a&&(this.l^=1048576,this.g("editable",y,a))}},textEditor:{get:function(){return this.da!==null?this.da.Qr:null},set:function(a){var y=this.textEditor;y!==a&&(lh(this),this.da.Qr=a,this.g("textEditor",y,a))}},errorFunction:{get:function(){return this.da!==null?this.da.Hd:null},set:function(a){var y=this.errorFunction;y!==a&&(lh(this),this.da.Hd=a,this.g("errorFunction",y,a))}},interval:{get:function(){return this.fa!==null?this.fa.Tk:1},set:function(a){var y=this.interval;if(a=Math.round(a),y!==a&&a!==0&&isFinite(a)){this.fa===null&&(this.fa=new bh),this.fa.Tk=a,this.v();var x=this.panel;x!==null&&(x.graduatedIntervals=null),this.g("interval",y,a)}}},graduatedStart:{get:function(){return this.fa!==null?this.fa.u:0},set:function(a){var y=this.graduatedStart;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new bh),this.fa.u=a,this.v(),this.g("graduatedStart",y,a))}},graduatedEnd:{get:function(){return this.fa!==null?this.fa.j:1},set:function(a){var y=this.graduatedEnd;y!==a&&(0>a?a=0:1<a&&(a=1),this.fa===null&&(this.fa=new bh),this.fa.j=a,this.v(),this.g("graduatedEnd",y,a))}},graduatedFunction:{get:function(){return this.fa!==null?this.fa.F:null},set:function(a){var y=this.graduatedFunction;y!==a&&(this.fa===null&&(this.fa=new bh),this.fa.F=a,this.v(),this.g("graduatedFunction",y,a))}},graduatedSkip:{get:function(){return this.fa!==null?this.fa.o:null},set:function(a){var y=this.graduatedSkip;y!==a&&(this.fa===null&&(this.fa=new bh),this.fa.o=a,this.v(),this.g("graduatedSkip",y,a))}},textValidation:{get:function(){return this.da!==null?this.da.vj:null},set:function(a){var y=this.textValidation;y!==a&&(lh(this),this.da.vj=a,this.g("textValidation",y,a))}},textEdited:{get:function(){return this.da!==null?this.da.Pr:null},set:function(a){var y=this.textEdited;y!==a&&(lh(this),this.da.Pr=a,this.g("textEdited",y,a))}},spacingAbove:{get:function(){return this.da!==null?this.da.Dr:0},set:function(a){var y=this.spacingAbove;y!==a&&(lh(this),this.da.Dr=a,this.v(),this.g("spacingAbove",y,a))}},spacingBelow:{get:function(){return this.da!==null?this.da.Er:0},set:function(a){var y=this.spacingBelow;y!==a&&(lh(this),this.da.Er=a,this.v(),this.g("spacingBelow",y,a))}},formatting:{get:function(){return this.da!==null?this.da.gq:vp},set:function(a){var y=this.formatting;y!==a&&(lh(this),this.da.gq=a,this.v(),this.g("formatting",y,a))}},maxLines:{get:function(){return this.da!==null?this.da.Jq:1/0},set:function(a){var y=this.maxLines;y!==a&&(a=Math.floor(a),0>=a&&ri(a,"> 0",Mr,"maxLines"),lh(this),this.da.Jq=a,this.v(),this.g("maxLines",y,a))}},metrics:{get:function(){return{arrSize:this.Qc!==null?this.Qc:[this.Cb],arrText:this.Qb!==null?this.Qb:[this.ze],maxLineWidth:this.Cb,fontHeight:this.df}}},choices:{get:function(){return this.Gm},set:function(a){var y=this.Gm;y!==a&&(this.Gm=a,this.g("choices",y,a))}}});var Om=null,Im=null,Ev=new me(Mr,"None",0),P1=new me(Mr,"WrapFit",1),Fv=new me(Mr,"WrapDesiredSize",2),w1=new me(Mr,"WrapBreakAll",3),Tv=new me(Mr,"OverflowClip",0),Rm=new me(Mr,"OverflowEllipsis",1),vp=new me(Mr,"FormatTrim",0),C1=new me(Mr,"FormatNone",0),Sx=/[ \u200b\u00ad]/,Nv=new ai,L1=0,jm=new ai,Dv=0,yp="...",M1="",Ua=null,zm=!1;Mr.className="TextBlock";function Av(){this.nc=!1,this.Hd=null,this.Xf=Ee,this.gq=vp,this.Jq=1/0,this.$q=Tv,this.Er=this.Dr=0,this.Or="start",this.vj=this.Qr=this.Pr=null,this.Yr=Xd,this.$r=Fv}Av.prototype.copy=function(){var a=new Av;return a.Hd=this.Hd,a.Xf=this.Xf,a.gq=this.gq,a.Jq=this.Jq,a.$q=this.$q,a.Dr=this.Dr,a.Er=this.Er,a.Or=this.Or,a.Pr=this.Pr,a.Qr=this.Qr,a.vj=this.vj,a.Yr=this.Yr,a.$r=this.$r,a},Mr.getEllipsis=function(){return yp},Mr.setEllipsis=function(a){yp=a,jm=new ai,Dv=0},Mr.getBaseline=function(){return Om},Mr.setBaseline=function(a){Om=a},Mr.getUnderline=function(){return Im},Mr.setUnderline=function(a){Im=a},Mr.isValidFont=function(a){if(zm||(Ua=So?new iu(null).context:null,zm=!0),Ua===null)return!0;var y=Ua.font;if(a===y||a==="10px sans-serif")return!0;Ua.font="10px sans-serif",Ua.font=a;var x=Ua.font;if(x!=="10px sans-serif")return Ua.font=y,!0;Ua.font="19px serif";var b=Ua.font;return Ua.font=a,x=Ua.font,Ua.font=y,x!==b},Mr.FormatNone=C1,Mr.FormatTrim=vp,Mr.None=Ev,Mr.OverflowClip=Tv,Mr.OverflowEllipsis=Rm,Mr.WrapBreakAll=w1,Mr.WrapDesiredSize=Fv,Mr.WrapFit=P1;function bh(){this.Tk=1,this.u=0,this.j=1,this.o=this.F=null}bh.prototype.copy=function(){var a=new bh;return a.Tk=this.Tk,a.u=this.u,a.j=this.j,a.F=this.F,a.o=this.o,a},bh.className="GradElementSettings";function Ka(a,y){te.call(this),this.Eg=null,this.qo="",this.Xg=vo,this.Nk=Ae,this.Zg=this.Hd=null,this.Mk=Xi,this.Xf=Ee,this.vl=null,this.qn=!1,this.en=!0,this.al=!1,this.bt=this.rl=null,typeof a=="string"?this.source=a:a&&Object.assign(this,a),y&&Object.assign(this,y)}var Sg;le(Ka,te),Ka.prototype.cloneProtected=function(a){te.prototype.cloneProtected.call(this,a),a.qo=this.qo,a.element=this.Eg,a.Xg=this.Xg.J(),a.Nk=this.Nk,a.Xf=this.Xf,a.Hd=this.Hd,a.Zg=this.Zg,a.Mk=this.Mk.J(),a.en=this.en,a.rl=this.rl},Ka.prototype.qb=function(a){a===Ee||a===dn||a===Pi?this.imageStretch=a:te.prototype.qb.call(this,a)},Ka.prototype.toString=function(){return"Picture("+this.source+")#"+Co(this)};function xg(a){a===void 0&&(a=""),a!==""?Sg[a]&&(delete Sg[a],Gm--):(Sg=new ai,Gm=0)}function k1(a,y){y.qy||(y.Fq=function(x){y.sq=!0,y.ln=!1;var b=y.Bg.copy();if(b!=null){for(b=b.iterator;b.next();){var E=b.value;E.N();var z=y.getAttribute("src")||"",tt=E.Og.I(z);if(tt!==null)for(var rt=tt.length,ot=0;ot<rt;ot++)z=tt[ot],E.Xn.add(z),z.Uc=!0,E.$b(),y.hn&&(y.eu===void 0&&(y.eu=x),z.Zg!==null&&z.Zg(z,x))}y.Bg.clear()}a.desiredSize.w()||(Zo(a,!1),a.v())},y.Yp=function(x){y.ln=x;var b=y.Bg.copy();if(b!=null){for(b=b.iterator;b.next();){var E=b.value,z=y.getAttribute("src")||"",tt=E.Og.I(z);if(tt!==null){E=tt.length,z=Kn();for(var rt=0;rt<E;rt++)z.push(tt[rt]);if(y.hn)for(rt=0;rt<E;rt++)tt=z[rt],tt.Hd!==null&&tt.Hd(tt,x);zn(z)}}y.Bg.clear()}},y.addEventListener("load",y.Fq),y.addEventListener("error",y.Yp),y.qy=!0)}Ka.prototype.hA=function(){if(this.source!==""){xg(this.source);var a=this.source;this.source="",this.source=a}},Ka.prototype.redraw=function(){this.N(),this.Uc=!0},Ka.prototype.hh=function(a,y){var x=this.Eg;if(x!==null){var b=x.getAttribute("src");if(!(x instanceof HTMLImageElement&&(b===null||b==="")||x.ln instanceof Event&&a instanceof $f)){var E=a instanceof pl;b=this.naturalBounds;var z=0,tt=0,rt=this.qn,ot=rt?+x.width:x.naturalWidth;if(rt=rt?+x.height:x.naturalHeight,ot===void 0&&x.videoWidth&&(ot=x.videoWidth),rt===void 0&&x.videoHeight&&(rt=x.videoHeight),ot=ot||b.width,rt=rt||b.height,ot!==0&&rt!==0){var at=ot,ut=rt;this.sourceRect.w()&&(z=this.Xg.x,tt=this.Xg.y,ot=this.Xg.width,rt=this.Xg.height);var ct=ot,mt=rt,yt=this.Nk,St=this.Mk;switch(yt){case Ee:if(this.sourceRect.w())break;ct>=b.width&&(z=z+St.offsetX+(ct*St.x-b.width*St.x)),mt>=b.height&&(tt=tt+St.offsetY+(mt*St.y-b.height*St.y)),ot=Math.min(b.width,ct),rt=Math.min(b.height,mt);break;case Ae:ct=b.width,mt=b.height;break;case dn:case Pi:yt===dn?(yt=Math.min(b.height/mt,b.width/ct),ct*=yt,mt*=yt):yt===Pi&&(yt=Math.max(b.height/mt,b.width/ct),ct*=yt,mt*=yt,ct>=b.width&&(z=(z+St.offsetX+(ct*St.x-b.width*St.x)/ct)*ot),mt>=b.height&&(tt=(tt+St.offsetY+(mt*St.y-b.height*St.y)/mt)*rt),ot*=1/(ct/b.width),rt*=1/(mt/b.height),ct=b.width,mt=b.height)}yt=this.Df()*y.scale;var Lt=ct*yt*mt*yt,Ot=ot*rt/Lt,Dt=x.__goCache;yt=null;var Gt=xx;if(!E){if(x.sq&&Dt!==void 0&&4<Lt&&Ot>Gt*Gt)for(Dt.gi===null&&(E1(Dt,4,at,ut,x),E1(Dt,16,at,ut,x)),E=Dt.gi,at=E.length,ut=0;ut<at&&E[ut].ratio*E[ut].ratio<Ot;ut++)yt=E[ut];if(!y.Xm){if(this.vl===null)if(this.Eg===null)this.vl=!1;else{E=new iu(null).context;try{E.drawImage(this.Eg,0,0)}catch(Vt){this.en=!1}try{E.getImageData(0,0,1,1).data[3]&&(this.vl=!1),this.vl=!1}catch(Vt){this.vl=!0}}if(this.vl)return}}switch(E=ct<b.width?St.offsetX+(b.width*St.x-ct*St.x):0,St=mt<b.height?St.offsetY+(b.height*St.y-mt*St.y):0,this.flip){case Di:a.translate(Math.min(b.width,ct),0),a.scale(-1,1);break;case si:a.translate(0,Math.min(b.height,mt)),a.scale(1,-1);break;case hr:a.translate(Math.min(b.width,ct),Math.min(b.height,mt)),a.scale(-1,-1)}if(a.yc(),y.Gf("pictureRatioOptimization")&&!y.$i&&Dt!==void 0&&yt!==null&&yt.ratio!==1){a.save(),y=yt.ratio;try{a.drawImage(yt.source,z/y,tt/y,Math.min(yt.source.width,ot/y),Math.min(yt.source.height,rt/y),E,St,Math.min(b.width,ct),Math.min(b.height,mt)),a instanceof pl&&(this.bt=[z/y,tt/y,Math.min(yt.source.width,ot/y),Math.min(yt.source.height,rt/y),E,St,Math.min(b.width,ct),Math.min(b.height,mt)])}catch(Vt){this.en=!1}a.restore()}else try{a.drawImage(x,z,tt,ot,rt,E,St,Math.min(b.width,ct),Math.min(b.height,mt)),a instanceof pl&&(this.bt=[z,tt,ot,rt,E,St,Math.min(b.width,ct),Math.min(b.height,mt)])}catch(Vt){this.en=!1}switch(this.flip){case Di:a.scale(-1,1),a.translate(-Math.min(b.width,ct),0);break;case si:a.scale(1,-1),a.translate(0,-Math.min(b.height,mt));break;case hr:a.scale(-1,-1),a.translate(-Math.min(b.width,ct),-Math.min(b.height,mt))}}}}},Ka.prototype.Wl=function(a,y,x,b){var E=this.desiredSize,z=Wa(this,!0),tt=this.Eg,rt=this.qn,ot=0,at=0;(rt||!this.al&&tt&&tt.complete)&&(this.al=!0),tt===null?(isFinite(E.width)||(a=0),isFinite(E.height)||(y=0)):(ot=rt?+tt.width:tt.naturalWidth,at=rt?+tt.height:tt.naturalHeight),isFinite(E.width)||z===Ae||z===gn?(isFinite(a)||(this.sourceRect.w()?a=this.sourceRect.width:tt!==null&&(a=ot)),x=0):tt!==null&&this.al!==!1&&(a=this.sourceRect.w()?this.sourceRect.width:ot),isFinite(E.height)||z===Ae||z===Fn?(isFinite(y)||(this.sourceRect.w()?y=this.sourceRect.height:tt!==null&&(y=at)),b=0):tt!==null&&this.al!==!1&&(y=this.sourceRect.w()?this.sourceRect.height:at),isFinite(E.width)&&(a=E.width),isFinite(E.height)&&(y=E.height),E=this.maxSize,z=this.minSize,x=Math.max(x||0,z.width),b=Math.max(b||0,z.height),a=Math.min(E.width,a),y=Math.min(E.height,y),a=Math.max(x,a),y=Math.max(b,y),tt===null||tt.complete||(isFinite(a)||(a=0),isFinite(y)||(y=0)),Ra(this.dc,a,y),this.Ge(0,0,a,y)},Ka.prototype.eh=function(a,y,x,b){fa(this,a,y,x,b)},Oe.Object.defineProperties(Ka.prototype,{element:{get:function(){return this.Eg},set:function(a){var y=this.Eg;if(this.Uc=!0,y!==a){this.qn=a instanceof HTMLCanvasElement;var x=a instanceof HTMLImageElement;a===null||x||a instanceof HTMLVideoElement||this.qn||fe("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var b=this.diagram;b!==null&&rh(b,this),this.Eg=a,a!==null&&x&&a.Bg===void 0&&(a.Bg=new Ye),b!==null&&x&&nl(b,this),a!==null&&(this.qn||a.complete===!0?(a.hn&&(a.ln instanceof Event&&this.Hd!==null?this.Hd(this,a.ln):a.sq===!0&&!a.ln&&this.Zg!==null&&a.eu&&this.Zg(this,a.eu)),a.sq=!0,this.desiredSize.w()||(Zo(this,!1),this.v())):x&&k1(this,a)),this.g("element",y,a),this.N()}}},source:{get:function(){return this.qo},set:function(a){var y=this.qo;if(y!==a){this.Uc=!0,this.qo=a;var x=Sg;if(So){var b=null;if(x[a]!==void 0)b=x[a];else if(a!==""){30<Gm&&(xg(),x=Sg),b=an("img"),b.hn=!0,k1(this,b);var E=this.rl;E!==null&&(b.crossOrigin=E(this)),b.src=a,x[a]=b,Gm++}this.element=b,b!==null&&b.__goCache===void 0&&(b.__goCache=new b1),this.v(),this.N()}this.g("source",y,a)}}},sourceCrossOrigin:{get:function(){return this.rl},set:function(a){if(this.rl!==a&&(this.rl=a,this.element!==null)){var y=this.element.getAttribute("src");a===null&&typeof y=="string"?this.element.crossOrigin=null:a!==null&&(this.element.crossOrigin=a(this)),this.element.src=y}}},sourceRect:{get:function(){return this.Xg},set:function(a){var y=this.Xg;y.D(a)||(this.Xg=a=a.J(),this.N(),this.g("sourceRect",y,a))}},imageStretch:{get:function(){return this.Nk},set:function(a){var y=this.Nk;y!==a&&(this.Nk=a,this.N(),this.g("imageStretch",y,a))}},flip:{get:function(){return this.Xf},set:function(a){var y=this.Xf;y!==a&&(this.Xf=a,this.N(),this.g("flip",y,a))}},imageAlignment:{get:function(){return this.Mk},set:function(a){var y=this.Mk;y.D(a)||(this.Mk=a=a.J(),this.N(),this.g("imageAlignment",y,a))}},errorFunction:{get:function(){return this.Hd},set:function(a){var y=this.Hd;y!==a&&(this.Hd=a,this.g("errorFunction",y,a))}},successFunction:{get:function(){return this.Zg},set:function(a){var y=this.Zg;y!==a&&(this.Zg=a,this.g("successFunction",y,a))}},naturalBounds:{get:function(){return this.dc}}}),Ka.prototype.redraw=Ka.prototype.redraw,Ka.prototype.reloadSource=Ka.prototype.hA;var Gm=0,xx=4;Ka.className="Picture",Sg=new ai,Ka.clearCache=xg;function b1(){this.gi=null}function E1(a,y,x,b,E){a.gi===null&&(a.gi=[]);var z=new iu(null),tt=z.context,rt=1/y;z.width=x/y,z.height=b/y,z.width!==0&&z.height!==0&&(y=new F1(z.Oa,y),x=1,0<a.gi.length&&(x=a.gi[a.gi.length-1],E=x.source,x=x.ratio),tt.setTransform(rt*x,0,0,rt*x,0,0),tt.yc(),tt.drawImage(E,0,0),a.gi.push(y))}b1.className="PictureCacheArray";function F1(a,y){this.source=a,this.ratio=y}F1.className="PictureCacheInstance";function Pg(){this.os=new We,this.mc=null}Pg.prototype.reset=function(a){a!==null?(a.ka(),this.os=a,a.figures.clear()):this.os=new We,this.mc=null};function wg(a,y,x,b,E,z){a.mc=new qo,a.mc.startX=y,a.mc.startY=x,a.mc.isFilled=b,a.mc.isEvenOdd=z||!1,a.os.figures.add(a.mc),E!==void 0&&(a.mc.isShadowed=E)}function Px(a){var y=a.mc.segments.length;0<y&&a.mc.segments.M(y-1).close()}Pg.prototype.moveTo=function(a,y,x){x===void 0&&(x=!1);var b=new Ni(ts);b.endX=a,b.endY=y,x&&b.close(),this.mc.segments.add(b)},Pg.prototype.lineTo=function(a,y,x){x===void 0&&(x=!1);var b=new Ni(xr);b.endX=a,b.endY=y,x&&b.close(),this.mc.segments.add(b)};function kd(a,y,x,b,E,z,tt){var rt;rt===void 0&&(rt=!1);var ot=new Ni(Fs);ot.point1X=y,ot.point1Y=x,ot.point2X=b,ot.point2Y=E,ot.endX=z,ot.endY=tt,rt&&ot.close(),a.mc.segments.add(ot)}function _m(a,y,x,b,E){var z;z===void 0&&(z=!1);var tt=new Ni(qa);tt.point1X=y,tt.point1Y=x,tt.endX=b,tt.endY=E,z&&tt.close(),a.mc.segments.add(tt)}Pg.prototype.arcTo=function(a,y,x,b,E,z,tt){z===void 0&&(z=0),tt===void 0&&(tt=!1);var rt=new Ni(No);rt.startAngle=a,rt.sweepAngle=y,rt.centerX=x,rt.centerY=b,rt.radiusX=E,rt.radiusY=z!==0?z:E,tt&&rt.close(),this.mc.segments.add(rt)};function wx(a,y,x,b,E,z,tt,rt){var ot;ot===void 0&&(ot=!1),y=new Ni(ja,tt,rt,y,x,b,E,z),ot&&y.close(),a.mc.segments.add(y)}function T1(a){var y=Hm;return y!==null?(Hm=null,y.reset(a),y):(y=new Pg,y.reset(a),y)}var Hm=null;Pg.className="StreamGeometryContext";function sa(a,y){var x=a.toLowerCase(),b=ne.Ze;b[a]=y,b[x]=a}sa("Rectangle",function(a,y,x){a="r"+y+","+x;var b=ne.Mf[a];return b!==void 0||(b=new We(We.u),b.endX=y,b.endY=x,ne.Nf<ne.vm&&(ne.Mf[a]=b,ne.Nf++)),b}),sa("Square",function(a,y,x){a="s"+y+","+x;var b=ne.Mf[a];return b!==void 0||(b=new We(We.u),b.endX=y,b.endY=x,b.defaultStretch=dn,ne.Nf<ne.vm&&(ne.Mf[a]=b,ne.Nf++)),b}),sa("RoundedRectangle",function(a,y,x){a=a?a.parameter1:NaN,(isNaN(a)||0>a)&&(a=5),a=Math.min(a,y/3),a=Math.min(a,x/3);var b="rr"+y+","+x+","+a,E=ne.Mf[b];if(E!==void 0)return E;var z=a*ne.wg;return E=new We().add(new qo(a,0,!0).add(new Ni(xr,y-a,0)).add(new Ni(Fs,y,a,y-z,0,y,z)).add(new Ni(xr,y,x-a)).add(new Ni(Fs,y-a,x,y,x-z,y-z,x)).add(new Ni(xr,a,x)).add(new Ni(Fs,0,x-a,z,x,0,x-z)).add(new Ni(xr,0,a)).add(new Ni(Fs,a,0,0,z,z,0).close())),1<z&&(E.spot1=new yn(0,0,z,z),E.spot2=new yn(1,1,-z,-z)),ne.Nf<ne.vm&&(ne.Mf[b]=E,ne.Nf++),E}),sa("Border","RoundedRectangle"),sa("Ellipse",function(a,y,x){a="e"+y+","+x;var b=ne.Mf[a];return b!==void 0||(b=new We(We.F),b.endX=y,b.endY=x,b.spot1=Ff,b.spot2=Bu,ne.Nf<ne.vm&&(ne.Mf[a]=b,ne.Nf++)),b}),sa("Circle",function(a,y,x){a="c"+y+","+x;var b=ne.Mf[a];return b!==void 0||(b=new We(We.F),b.endX=y,b.endY=x,b.spot1=Ff,b.spot2=Bu,b.defaultStretch=dn,ne.Nf<ne.vm&&(ne.Mf[a]=b,ne.Nf++)),b}),sa("TriangleRight",function(a,y,x){return new We().add(new qo(0,0).add(new Ni(xr,y,.5*x)).add(new Ni(xr,0,x).close())).pm(0,.25,.5,.75)}),sa("TriangleDown",function(a,y,x){return new We().add(new qo(0,0).add(new Ni(xr,y,0)).add(new Ni(xr,.5*y,x).close())).pm(.25,0,.75,.5)}),sa("TriangleLeft",function(a,y,x){return new We().add(new qo(y,x).add(new Ni(xr,0,.5*x)).add(new Ni(xr,y,0).close())).pm(.5,.25,1,.75)}),sa("TriangleUp",function(a,y,x){return new We().add(new qo(y,x).add(new Ni(xr,0,x)).add(new Ni(xr,.5*y,0).close())).pm(.25,.5,.75,1)}),sa("Triangle","TriangleUp"),sa("Diamond",function(a,y,x){return new We().add(new qo(.5*y,0).add(new Ni(xr,0,.5*x)).add(new Ni(xr,.5*y,x)).add(new Ni(xr,y,.5*x).close())).pm(.25,.25,.75,.75)}),sa("LineH",function(a,y,x){return a=new We(We.j),a.startX=0,a.startY=x/2,a.endX=y,a.endY=x/2,a}),sa("LineV",function(a,y,x){return a=new We(We.j),a.startX=y/2,a.startY=0,a.endX=y/2,a.endY=x,a}),sa("None","Rectangle"),sa("BarH","Rectangle"),sa("BarV","Rectangle"),sa("MinusLine","LineH"),sa("PlusLine",function(a,y,x){return new We().add(new qo(0,x/2,!1).add(new Ni(xr,y,x/2)).add(new Ni(ts,y/2,0)).add(new Ni(xr,y/2,x)))}),sa("XLine",function(a,y,x){return new We().add(new qo(0,x,!1).add(new Ni(xr,y,0)).add(new Ni(ts,0,0)).add(new Ni(xr,y,x)))}),sa("LineRight",function(a,y,x){return new We().add(new qo(.25*y,0,!1).add(new Ni(xr,.75*y,.5*x)).add(new Ni(xr,.25*y,x)))}),sa("LineDown",function(a,y,x){return new We().add(new qo(0,.25*x,!1).add(new Ni(xr,.5*y,.75*x)).add(new Ni(xr,y,.25*x)))}),sa("LineLeft",function(a,y,x){return new We().add(new qo(.75*y,0,!1).add(new Ni(xr,.25*y,.5*x)).add(new Ni(xr,.75*y,x)))}),sa("LineUp",function(a,y,x){return new We().add(new qo(0,.75*x,!1).add(new Ni(xr,.5*y,.25*x)).add(new Ni(xr,y,.75*x)))}),ne.um={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};function Bv(){this.nc=!1,this.tr=this.Kp=this.zq=null,this.vr="",this.fr=this.oq=this.ur=null,this.hr="",this.gr=va,this.ir=null,this.jr="",this.lr=vs,this.Gq="",this.Hq=ms,this.Pq=Eu,this.Kq=Fu,this.Up=null,this.Cq=127,this.zr=dl,this.yr="gray",this.Vg=4}Bv.prototype.copy=function(){var a=new Bv;return a.zq=this.zq,a.Kp=this.Kp,a.tr=this.tr,a.vr=this.vr,a.ur=this.ur,a.oq=this.oq,a.fr=this.fr,a.hr=this.hr,a.gr=this.gr.J(),a.ir=this.ir,a.jr=this.jr,a.lr=this.lr.J(),a.Gq=this.Gq,a.Hq=this.Hq.J(),a.Pq=this.Pq.J(),a.Kq=this.Kq.J(),a.Up=this.Up,a.Cq=this.Cq,a.zr=this.zr.J(),a.yr=this.yr,a.Vg=this.Vg,a};function vn(a,y){a===void 0||a instanceof es||typeof a=="string"?Re.call(this,a):(Re.call(this),a&&(y=a)),this.G=2408959,this.Tf="",this.P=null,this.Jg="",this.Qf=this.Ug=null,this.ec="",this.Ah=this.Ig=null,this.ke=new jt(NaN,NaN).freeze(),this.nf=null,this.Ao=NaN,this.vw=-1,this.py=new ye,this.Rh=null,this.ag=NaN,y&&Object.assign(this,y)}le(vn,Re),vn.prototype.cloneProtected=function(a){Re.prototype.cloneProtected.call(this,a),a.G=this.G&-4097|49152,a.Tf=this.Tf,this.P!==null&&(a.P=this.P.nc?this.P:this.P.copy()),a.Jg=this.Jg,a.Qf=null,a.ec=this.ec,a.ke.assign(this.ke),a.Ao=this.Ao},xt=vn.prototype,xt.Af=function(a){Re.prototype.Af.call(this,a),a.oh(),a.Ug=null,a.nf=null,a.Rh=null},xt.toString=function(){var a=qn(this.constructor)+"#"+Co(this);return this.data!==null&&(a+="("+Ir(this.data)+")"),a};function Ya(a){a.P===null?a.P=new Bv:a.P.nc&&(a.P=a.P.copy())}xt.th=function(){Re.prototype.th.call(this),this.P!==null&&(this.P.nc=!0)},xt.gk=function(a,y,x,b,E,z,tt){var rt=this.diagram;rt!==null&&(a===ko&&y==="elements"?E instanceof Re?qf(E,function(ot){ay(rt.partManager,ot),El(rt,ot)}):nl(rt,E):a===Bo&&y==="elements"&&(E instanceof Re?qf(E,function(ot){ly(rt.partManager,ot,rt)}):rh(rt,E)),rt.cb(a,y,x,b,E,z,tt))},xt.La=function(a){if(Re.prototype.La.call(this,a),this.data!==null){for(var y=this.O.s,x=y.length,b=0;b<x;b++){var E=y[b];E instanceof Re&&qf(E,function(z){z.data!==null&&z.La()})}for(y=this.adornments;y.next();)y.value.La(a)}},vn.prototype.updateRelationshipsFromData=function(){var a;this.data!==null&&((a=this.diagram)===null||a===void 0||a.partManager.updateRelationshipsFromData(this))},vn.prototype.Pj=function(a){var y=this.Qf;return y===null?null:y.I(a)},vn.prototype.bh=function(a,y){if(y!==null){var x=null,b=this.Qf;if(b!==null&&(x=b.I(a)),x!==y){if(x!==null){var E=x.diagram;E!==null&&E.remove(x)}b===null&&(this.Qf=b=new xn),y.Tf!==a&&(y.category=a),b.add(a,y),a=this.diagram,a!==null&&(a.add(y),a=y.adornedObject,a!==null&&(a=a.ih(),a!==null&&(y.data=a.data)))}}},vn.prototype.Jf=function(a){var y=this.Qf;if(y!==null){var x=y.I(a);if(x!==null){var b=x.diagram;b!==null&&b.remove(x)}y.remove(a),y.count===0&&(this.Qf=null)}},vn.prototype.Ej=function(){var a=this.Qf;if(a!==null){var y=Kn();for(a=a.iterator;a.next();)y.push(a.key);a=y.length;for(var x=0;x<a;x++)this.Jf(y[x]);zn(y)}},vn.prototype.updateAdornments=function(){var a=this.diagram;if(a!==null){for(var y=this.adornments;y.next();){var x=y.value;x.v(),x.placeholder&&x.placeholder.v()}t:{if(this.isSelected&&this.selectionAdorned&&(y=this.selectionObject,y!==null&&this.actualBounds.w()&&this.isVisible()&&y.Ed()&&y.actualBounds.w())){if(x=this.Pj("Selection"),x===null){if(x=this.selectionAdornmentTemplate,x===null&&(x=this.ph()?a.linkSelectionAdornmentTemplate:this instanceof Yn?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate),!(x instanceof Bi))break t;ru(x),x=x.copy(),x!==null&&(this.ph()&&this.selectionObject===this.path&&(x.type=Re.Link),x.adornedObject=y)}if(x!==null){x.type===Re.Link&&x.v(),this.bh("Selection",x);break t}}this.Jf("Selection")}for(Cx(this,a),y=this.adornments;y.next();)y.value.La()}},vn.prototype.Wb=function(){var a=this.diagram;a!==null&&(a.vd=!0,!(this.G&16384)&&(this.G|=16384))};function Ov(a){a.G&16384&&(a.updateAdornments(),a.G&=-16385)}function Cx(a,y){y.toolManager.mouseDownTools.each(function(x){x.isEnabled&&x.updateAdornments(a)}),y.toolManager.updateAdornments(a)}function Vm(a){if(of(a)===!1){Rv(a,!0),a.Uk();var y=a.diagram;y!==null&&(y.De.add(a),y.$b())}}function N1(a){if(a.G|=2097152,of(a)!==!1){var y=a.position,x=a.location;x.w()&&y.w()||B1(a,y,x),x=a.Ib;var b=ye.alloc().assign(x);x.ka(),x.x=y.x,x.y=y.y,x.freeze(),a.Xl(b,x),ye.free(b),Rv(a,!1)}}vn.prototype.Ge=function(a,y,x,b){var E=this.uc;E.h(a,y,x,b),this.Lb===null&&(this.Lb=new oi);var z=this.Lb;z.reset(),this.no(z,a,y,x,b),this.Lb=z,z.ws()||z.pp(E)},vn.prototype.no=function(a,y,x,b,E){if(this.Ca!==1&&a.scale(this.Ca),this.Kb!==0){var z=Xi;this.locationSpot.sb()&&(z=this.locationSpot);var tt=jt.alloc();if(this.locationObject!==this)for(y=this.locationObject,x=y.naturalBounds,tt.yi(x.x,x.y,x.width,x.height,z),y.Lb!==null&&y.Lb.Ga(tt),tt.offset(-y.measuredBounds.x,-y.measuredBounds.y),z=y.panel;z!==null&&z!==this;)z.Lb!==null&&z.Lb.Ga(tt),tt.offset(-z.measuredBounds.x,-z.measuredBounds.y),z=z.panel;else tt.yi(y,x,b,E,z);a.rotate(this.Kb,tt.x,tt.y),jt.free(tt)}},vn.prototype.move=function(a,y){y===!0?this.location=a:this.position=a},vn.prototype.moveTo=function(a,y,x){a=jt.allocAt(a,y),this.move(a,x),jt.free(a)},vn.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(a!==null){if(!a.visible)return!1;if(a=a.diagram,a!==null&&a.animationManager.fv(this))return!0}return a=this.containingGroup,!!(a===null||a.isSubGraphExpanded&&a.isVisible())},vn.prototype.Zb=function(a){var y=this.diagram;a?(this.C(4),this.Wb(),y!==null&&y.De.add(this)):(this.C(8),this.Ej()),this.oh(),y!==null&&(y.Ya(),y.N())},vn.prototype.fb=function(a){if(this.name===a)return this;var y=this.Rh;if(y===null&&(this.Rh=y=new xn),y.I(a)!==null)return y.I(a);var x=Re.prototype.fb.call(this,a);return x!==null?(y.set(a,x),x):(y.set(a,null),null)};function bd(a,y,x,b){b===void 0&&(b=new jt),x=x.Mc()?Xi:x;var E=y.naturalBounds;if(b.h(E.width*x.x+x.offsetX,E.height*x.y+x.offsetY),y===null||y===a)return b;for(y.transform.Ga(b),y=y.panel;y!==null&&y!==a;)y.transform.Ga(b),y=y.panel;return a.Lb!==null&&a.Lb.Ga(b),b.offset(-a.uc.x,-a.uc.y),b}vn.prototype.mi=function(a){return a===void 0&&(a=new ye),a.assign(this.actualBounds)},vn.prototype.Va=function(){this.measure(1/0,1/0),this.arrange()};function D1(a){var y=jt.alloc(),x=a.locationObject,b=x.naturalBounds,E=x instanceof Qn?x.strokeWidth:0;if(y.yi(0,0,b.width+E,b.height+E,a.locationSpot),x!==a)for(y.offset(-E/2,-E/2),x.transform.Ga(y),x=x.panel;x!==null&&x!==a;)x.transform.Ga(y),x=x.panel;return a.Lb!==null&&a.Lb.Ga(y),y.offset(-a.uc.x,-a.uc.y),y}function nc(a,y){var x=a.py;isNaN(a.ag)&&(a.ag=u1(a));var b=a.ag,E=2*b;if(!a.isShadowed)return x.h(y.x-1-b,y.y-1-b,y.width+2+E,y.height+2+E),x;b=y.x,E=y.y;var z=y.width;y=y.height;var tt=a.shadowBlur;return a=a.shadowOffset,z+=tt,y+=tt,b-=tt/2,E-=tt/2,0<a.x?z+=a.x:(b+=a.x,z-=a.x),0<a.y?y+=a.y:(E+=a.y,y-=a.y),x.h(b-1,E-1,z+2,y+2),x}vn.prototype.arrange=function(){if(Ma(this)===!1)N1(this);else{Ch(this,!1);var a=this.Ib,y=ye.alloc();y.assign(a);var x=sf(this);this.eh(0,0,this.uc.width,this.uc.height);var b=this.position;B1(this,b,this.location),a.ka(),a.x=b.x,a.y=b.y,a.freeze(),this.Xl(y,a),y.D(a)?this.Fd(x):!this.Zc()||ne.B(y.width,a.width)&&ne.B(y.height,a.height)||0<=this.vw&&this.C(16),ye.free(y),Rv(this,!1)}},xt=vn.prototype,xt.Xl=function(a,y){var x=this.diagram;if(x!==null){var b=!1;if(x.Zi===!1&&a.w()){var E=ye.alloc();E.assign(x.documentBounds),E.Fv(x.padding),a.x>E.x&&a.y>E.y&&a.right<E.right&&a.bottom<E.bottom&&y.x>E.x&&y.y>E.y&&y.right<E.right&&y.bottom<E.bottom&&(b=!0),ye.free(E)}!(this.G&65536)&&a.D(y)||R1(this,b,x),x.N(),!a.w()&&!y.w()||os(a,y)||(this instanceof $e&&!x.undoManager.isUndoingRedoing&&this.Bd(),this.oh())}},xt.zv=function(a,y,x){if(this.ph()||!a.w())return!1;var b=this.diagram;return b!==null&&A1(this,b,a,y,x),this.pa=a,this.G&=-2097153,!this.ke.w()||b!==null&&!b.animationManager.isTicking&&b.undoManager.isUndoingRedoing||(b=this.ke,this.ke=new jt(b.x+(a.x-y),b.y+(a.y-x)),this.g("location",b,this.ke.copy())),of(this)===!1&&Ma(this)===!1&&(Vm(this),N1(this)),!0};function A1(a,y,x,b,E){y===null||a instanceof Bi||(y=y.animationManager,y.zb&&ro(y,a,new jt(b,E),x))}xt.mm=function(a,y,x){var b=this.ke,E=this.pa;if(x){if(b.x===a&&b.y===y)return;of(this)||Ma(this)?E.h(NaN,NaN):E.h(E.x+a-b.x,E.y+y-b.y),b.h(a,y)}else{if(E.x===a&&E.y===y)return;b.h(b.x+a-E.x,b.y+y-E.y),E.h(a,y)}Vm(this)},xt.Av=function(){this.G&=-2097153,Vm(this)};function B1(a,y,x){var b=D1(a),E=a.diagram,z=x.w(),tt=y.w();z&&tt?a.G&2097152?O1(a,y,x,E,b):I1(a,y,x,E,b):z?O1(a,y,x,E,b):tt&&I1(a,y,x,E,b),a.G|=2097152,jt.free(b),a.Uk()}function O1(a,y,x,b,E){var z=y.x,tt=y.y;y.h(x.x-E.x,x.y-E.y),b!==null&&(x=b.animationManager,(b=x.defaultAnimation.isAnimating)||!x.zb||a instanceof Bi||ro(x,a,new jt(z,tt),y),b||y.x===z&&y.y===tt||a.g("position",new jt(z,tt),y.copy()))}function I1(a,y,x,b,E){var z=x.copy();x.h(y.x+E.x,y.y+E.y),x.D(z)||b===null||a.g("location",z,x.copy())}function R1(a,y,x){jv(a,!1),a instanceof $e&&xd(x,a),a.layer.isTemporary||y||x.Ya(),y=a.Ib;var b=x.viewportBounds;b.w()?sf(a)?(gh(y,b)||a.Fd(!1),a.updateAdornments()):a.isVisible()&&y.Yc(b)?(a.Fd(!0),a.updateAdornments()):a.Wb():x.vd=!0}xt.si=function(){return!0},xt.Zc=function(){return!0},xt.ph=function(){return!1},xt.Dd=function(){return!0};function Iv(a,y,x,b){y.constructor===a.constructor||G1||(G1=!0,Ki('Should not change the class of the Part when changing category from "'+x+'" to "'+b+'"'),Ki(" Old class: "+qn(a.constructor)+", new class: "+qn(y.constructor)+", part: "+a.toString())),a.Ej();var E=a.data;x=a.layerName;var z=a.isSelected,tt=a.isHighlighted,rt=!0,ot=!0,at=!1;a instanceof $e&&(rt=a.isTreeLeaf,ot=a.isTreeExpanded,at=a.wasTreeExpanded),y.Af(a),y.cloneProtected(a),a.Tf=b,a.svg!==null&&(a.svg.remove(),a.svg=null,a.Uc=!0),a.v(),a.N(),y=a.diagram,b=!0,y!==null&&(b=y.skipsUndoManager,y.skipsUndoManager=!0),a.ub=E,a.G=z?a.G|4096:a.G&-4097,a.G=tt?a.G|524288:a.G&-524289,a instanceof $e&&(a.U=rt?a.U|4:a.U&-5,a.U=ot?a.U|1:a.U&-2,a.U=at?a.U|2:a.U&-3),E!==null&&a.La(),E=a.layerName,E!==x&&(a.Jg=x,a.layerName=E),y!==null&&(y.skipsUndoManager=b),a.Zc()&&a.C(64)}vn.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;return a===null?!0:a.allowCopy?(a=a.diagram,a===null?!0:!!a.allowCopy):!1},vn.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;return a===null?!0:a.allowDelete?(a=a.diagram,a===null?!0:!!a.allowDelete):!1},vn.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;return a===null?!0:a.allowTextEdit?(a=a.diagram,a===null?!0:!!a.allowTextEdit):!1},vn.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;return a===null?!0:a.allowGroup?(a=a.diagram,a===null?!0:!!a.allowGroup):!1},vn.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;return a===null?!0:a.allowMove?(a=a.diagram,a===null?!0:!!a.allowMove):!1},vn.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;return a===null?!0:a.allowReshape?(a=a.diagram,a===null?!0:!!a.allowReshape):!1},vn.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;return a===null?!0:a.allowResize?(a=a.diagram,a===null?!0:!!a.allowResize):!1},vn.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;return a===null?!0:a.allowRotate?(a=a.diagram,a===null?!0:!!a.allowRotate):!1},vn.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;return a===null?!0:a.allowSelect?(a=a.diagram,a===null?!0:!!a.allowSelect):!1};function of(a){return(a.G&32768)!==0}function Rv(a,y){a.G=y?a.G|32768:a.G&-32769}function jv(a,y){a.G=y?a.G|65536:a.G&-65537}function sf(a){return(a.G&131072)!==0}xt=vn.prototype,xt.Fd=function(a){this.G=a?this.G|131072:this.G&-131073};function Wm(a,y){a.G=y?a.G|1048576:a.G&-1048577}xt.oh=function(){var a=this.containingGroup;a!==null&&(a.v(),a.placeholder!==null&&a.placeholder.v(),a.Bd())},xt.N=function(){var a=this.diagram;a!==null&&!Ma(this)&&!of(this)&&this.isVisible()&&this.Ib.w()&&a.N(nc(this,this.Ib))},xt.v=function(){Re.prototype.v.call(this);var a=this.diagram;a!==null&&(a.De.add(this),this instanceof $e&&this.labeledLink!==null&&La(this.labeledLink),a.$b(!0))},xt.Vo=function(a){a||(a=this.Ah,a!==null&&Wv(a,this))},xt.Wo=function(a){a||(a=this.Ah,a!==null&&Uv(a,this))},xt.Lj=function(){var a=this.data;if(a!==null){var y=this.diagram;y!==null&&(y=y.model,y!==null&&y.cm(a))}},xt.oz=function(){return zv(this,this)};function zv(a,y){var x=y.containingGroup;return x!==null?1+zv(a,x):y instanceof $e&&(y=y.labeledLink,y!==null)?zv(a,y):0}xt.sz=function(){return j1(this,this)};function j1(a,y){var x=y.containingGroup;return x!==null||y instanceof $e&&(x=y.labeledLink,x!==null)?j1(a,x):y}xt.Td=function(a){return a instanceof Yn?Gv(this,this,a):!1};function Gv(a,y,x){if(y===x||x===null)return!1;var b=y.containingGroup;return b===null||b!==x&&!Gv(a,b,x)?y instanceof $e&&(y=y.labeledLink,y!==null)?Gv(a,y,x):!1:!0}xt.px=function(a){if(a===null)return null;if(this===a)return this.containingGroup;for(var y=this;y!==null;){if(y instanceof Yn&&Wm(y,!0),y instanceof $e){var x=y.labeledLink;x!==null&&(y=x)}y=y.containingGroup}for(x=null,y=a;y!==null;){if(y.G&1048576){x=y;break}y instanceof $e&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup}for(y=this;y!==null;)y instanceof Yn&&Wm(y,!1),y instanceof $e&&(a=y.labeledLink,a!==null&&(y=a)),y=y.containingGroup;return x},vn.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return!(a!==null&&a.isTemporary||this instanceof $e&&this.isLinkLabel)},vn.prototype.C=function(a){if(a===void 0&&(a=16777215),this.isLayoutPositioned&&a&this.layoutConditions){var y=this.layer;y!==null&&y.isTemporary||this instanceof $e&&this.isLinkLabel?y=!1:(y=this.diagram,y=!(y!==null&&y.undoManager.isUndoingRedoing))}else y=!1;if(y)if(y=this.Ah,y!==null){var x=y.layout;x!==null?x.C():y.C(a)}else a=this.diagram,a!==null&&(a=a.layout,a!==null&&a.C())};function z1(a){return a.isVisible()?(a=a.layer,!(a!==null&&a.isTemporary)):!1}function af(a,y,x,b,E,z){if(z===void 0&&(z=null),!(a.contains(y)||z!==null&&!z(y)||y instanceof Bi)){if(a.add(y),y instanceof $e){if(x&&y instanceof Yn)for(var tt=y.memberParts;tt.next();)af(a,tt.value,x,b,E,z);if(E!==!1)for(tt=y.linksConnected;tt.next();){var rt=tt.value;if(!a.contains(rt)){var ot=rt.fromNode,at=rt.toNode;ot=ot===null||a.contains(ot),at=at===null||a.contains(at),(E?ot&&at:ot||at)&&af(a,rt,x,b,E,z)}}if(1<b)for(y=y.Ou();y.next();)af(a,y.value,x,b-1,E,z)}else if(y instanceof _e)for(y=y.labelNodes;y.next();)af(a,y.value,x,b,E,z)}}Oe.Object.defineProperties(vn.prototype,{key:{get:function(){var a=this.diagram;if(a!==null)return a.model.wa(this.data)}},adornments:{get:function(){return this.Qf===null?Sr:this.Qf.iteratorValues}},layer:{get:function(){return this.Ig}},diagram:{get:function(){var a=this.Ig;return a==null?null:a.diagram}},layerName:{get:function(){return this.Jg},set:function(a){var y=this.Jg;if(y!==a){var x=this.diagram;if((x===null||x.Qj(a)!==null&&!x.partManager.addsToTemporaryLayer)&&(this.Jg=a,x!==null&&x.Ya(),this.g("layerName",y,a),y=this.layer,y!==null&&y.name!==a&&(x=y.diagram,x!==null&&(a=x.Qj(a),a!==null&&a!==y)))){var b=y.pc(-1,this,!0);if(0<=b&&x.cb(Bo,"parts",y,this,null,b,!0),b=a.oi(99999999,this,!0),y.visible!==a.visible&&this.Zb(a.visible),0<=b&&x.cb(ko,"parts",a,null,this,!0,b),b=this.layerChanged,b!==null){var E=x.aa;x.aa=!0,b(this,y,a),x.aa=E}}}}},layerChanged:{get:function(){return this.P!==null?this.P.zq:null},set:function(a){var y=this.layerChanged;y!==a&&(Ya(this),this.P.zq=a,this.g("layerChanged",y,a))}},zOrder:{get:function(){return this.Ao},set:function(a){var y=this.Ao;if(y!==a){this.Ao=a;var x=this.layer;x!==null&&Qs(x,-1,this),this.g("zOrder",y,a),a=this.diagram,a!==null&&a.N()}}},locationObject:{get:function(){if(this.nf===null){var a=this.locationObjectName;a!==""?(a=this.fb(a),a!==null?this.nf=a:this.nf=this):this instanceof Bi?this.type!==Re.Link&&this.placeholder!==null?this.nf=this.placeholder:this.nf=this:this.nf=this}return this.nf.visible?this.nf:this}},minLocation:{get:function(){return this.P!==null?this.P.Pq:Eu},set:function(a){var y=this.minLocation;y.D(a)||(a=a.J(),Ya(this),this.P.Pq=a,this.g("minLocation",y,a))}},maxLocation:{get:function(){return this.P!==null?this.P.Kq:Fu},set:function(a){var y=this.maxLocation;y.D(a)||(a=a.J(),Ya(this),this.P.Kq=a,this.g("maxLocation",y,a))}},locationObjectName:{get:function(){return this.P!==null?this.P.Gq:""},set:function(a){var y=this.locationObjectName;y!==a&&(Ya(this),this.P.Gq=a,this.nf=null,this.v(),this.g("locationObjectName",y,a))}},locationSpot:{get:function(){return this.P!==null?this.P.Hq:ms},set:function(a){var y=this.locationSpot;y.D(a)||(a=a.J(),Ya(this),this.P.Hq=a,this.v(),this.g("locationSpot",y,a))}},location:{get:function(){return this.ke},set:function(a){var y=a.x,x=a.y,b=this.ke;if(!(b.x===y||isNaN(b.x)&&isNaN(y))||!(b.y===x||isNaN(b.y)&&isNaN(x))){if(a=a.copy(),y=a,this.ph())y=!1;else{if(this.ke=y,this.G|=2097152,Ma(this)===!1&&(Vm(this),x=this.pa,x.w())){var E=this.diagram;if(E===null||E.animationManager.isTicking||!E.undoManager.isUndoingRedoing){var z=x.copy();x.h(x.x+(y.x-b.x),x.y+(y.y-b.y)),A1(this,E,x,z.x,z.y),this.g("position",z,x.copy())}}y=!0}y&&this.g("location",b,a.copy())}}},category:{get:function(){return this.Tf},set:function(a){var y=this.Tf;if(y!==a){this.svg!==null&&(this.svg.remove(),this.Uc=!0);var x=this.diagram,b=this.data,E=null;if(x!==null&&b!==null&&!(this instanceof Bi)){var z=x.model.undoManager;z.isEnabled&&!z.isUndoingRedoing&&(E=this.clone(),E.O.addAll(this.O))}this.Tf=a,this.g("category",y,a),x===null||b===null||this instanceof Bi?this instanceof Bi&&(E=this.adornedPart,E!==null&&(a=E.Qf,a!==null&&a.remove(y),E.bh(this.category,this))):(z=x.model,z.undoManager.isUndoingRedoing||(this.ph()?(x.partManager.setLinkCategoryForData(b,a),x=x.partManager.findLinkTemplateForCategory(a),x!==null&&(ru(x),x=x.copy(),x!==null&&Iv(this,x,y,a))):(z!==null&&z.jm(b,a),x=dS(x.partManager,b,a),x!==null&&(ru(x),x=x.copy(),x===null||x instanceof _e||(b=this.location.copy(),Iv(this,x,y,a),this.location.w()||(this.location=b)))),E!==null&&(y=this.clone(),y.O.addAll(this.O),this.g("self",E,y))))}}},self:{get:function(){return this},set:function(a){Iv(this,a,this.category,a.category)}},copyable:{get:function(){return(this.G&1)!==0},set:function(a){var y=(this.G&1)!==0;y!==a&&(this.G^=1,this.g("copyable",y,a))}},deletable:{get:function(){return(this.G&2)!==0},set:function(a){var y=(this.G&2)!==0;y!==a&&(this.G^=2,this.g("deletable",y,a))}},textEditable:{get:function(){return(this.G&4)!==0},set:function(a){var y=(this.G&4)!==0;y!==a&&(this.G^=4,this.g("textEditable",y,a),this.Wb())}},groupable:{get:function(){return(this.G&8)!==0},set:function(a){var y=(this.G&8)!==0;y!==a&&(this.G^=8,this.g("groupable",y,a))}},movable:{get:function(){return(this.G&16)!==0},set:function(a){var y=(this.G&16)!==0;y!==a&&(this.G^=16,this.g("movable",y,a))}},selectionAdorned:{get:function(){return(this.G&32)!==0},set:function(a){var y=(this.G&32)!==0;y!==a&&(this.G^=32,this.g("selectionAdorned",y,a),this.Wb())}},isInDocumentBounds:{get:function(){return(this.G&64)!==0},set:function(a){var y=(this.G&64)!==0;if(y!==a){this.G^=64;var x=this.diagram;x!==null&&x.Ya(),this.g("isInDocumentBounds",y,a)}}},isLayoutPositioned:{get:function(){return(this.G&128)!==0},set:function(a){var y=(this.G&128)!==0;y!==a&&(this.G^=128,this.g("isLayoutPositioned",y,a),this.C(a?4:8))}},selectable:{get:function(){return(this.G&256)!==0},set:function(a){var y=(this.G&256)!==0;y!==a&&(this.G^=256,this.g("selectable",y,a),this.Wb())}},reshapable:{get:function(){return(this.G&512)!==0},set:function(a){var y=(this.G&512)!==0;y!==a&&(this.G^=512,this.g("reshapable",y,a),this.Wb())}},resizable:{get:function(){return(this.G&1024)!==0},set:function(a){var y=(this.G&1024)!==0;y!==a&&(this.G^=1024,this.g("resizable",y,a),this.Wb())}},rotatable:{get:function(){return(this.G&2048)!==0},set:function(a){var y=(this.G&2048)!==0;y!==a&&(this.G^=2048,this.g("rotatable",y,a),this.Wb())}},isSelected:{get:function(){return(this.G&4096)!==0},set:function(a){var y=(this.G&4096)!==0;if(y!==a){var x=this.diagram;if(!a||this.canSelect()&&!(x!==null&&x.selection.count>=x.maxSelectionCount)){this.G^=4096;var b=!1;if(x!==null){b=x.skipsUndoManager,x.skipsUndoManager=!0;var E=x.selection;E.ka(),a?E.add(this):E.remove(this),E.freeze()}this.g("isSelected",y,a),this.Wb(),a=this.selectionChanged,a!==null&&a(this),x!==null&&(x.$b(),x.skipsUndoManager=b)}}}},isHighlighted:{get:function(){return(this.G&524288)!==0},set:function(a){var y=(this.G&524288)!==0;if(y!==a){this.G^=524288;var x=this.diagram;x!==null&&(x=x.highlighteds,x.ka(),a?x.add(this):x.remove(this),x.freeze()),this.g("isHighlighted",y,a),this.N(),a=this.highlightedChanged,a!==null&&a(this)}}},isShadowed:{get:function(){return(this.G&8192)!==0},set:function(a){var y=(this.G&8192)!==0;y!==a&&(this.G^=8192,this.Uc=!0,this.g("isShadowed",y,a),this.N())}},isAnimated:{get:function(){return(this.G&262144)!==0},set:function(a){var y=(this.G&262144)!==0;y!==a&&(this.G^=262144,this.g("isAnimated",y,a))}},highlightedChanged:{get:function(){return this.P!==null?this.P.oq:null},set:function(a){var y=this.highlightedChanged;y!==a&&(Ya(this),this.P.oq=a,this.g("highlightedChanged",y,a))}},selectionObjectName:{get:function(){return this.P!==null?this.P.vr:""},set:function(a){var y=this.selectionObjectName;y!==a&&(Ya(this),this.P.vr=a,this.Ug=null,this.g("selectionObjectName",y,a))}},selectionAdornmentTemplate:{get:function(){return this.P!==null?this.P.tr:null},set:function(a){var y=this.selectionAdornmentTemplate;y!==a&&(Ya(this),this.P.tr=a,this.g("selectionAdornmentTemplate",y,a))}},selectionObject:{get:function(){if(this.Ug===null){var a=this.selectionObjectName;a!==null&&a!==""?(a=this.fb(a),a!==null?this.Ug=a:this.Ug=this):this instanceof _e?(a=this.path,a!==null?this.Ug=a:this.Ug=this):this.Ug=this}return this.Ug}},selectionChanged:{get:function(){return this.P!==null?this.P.ur:null},set:function(a){var y=this.selectionChanged;y!==a&&(Ya(this),this.P.ur=a,this.g("selectionChanged",y,a))}},resizeAdornmentTemplate:{get:function(){return this.P!==null?this.P.fr:null},set:function(a){var y=this.resizeAdornmentTemplate;y!==a&&(Ya(this),this.P.fr=a,this.g("resizeAdornmentTemplate",y,a))}},resizeObjectName:{get:function(){return this.P!==null?this.P.hr:""},set:function(a){var y=this.resizeObjectName;y!==a&&(Ya(this),this.P.hr=a,this.g("resizeObjectName",y,a))}},resizeObject:{get:function(){var a=this.resizeObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},resizeCellSize:{get:function(){return this.P!==null?this.P.gr:va},set:function(a){var y=this.resizeCellSize;y.D(a)||(a=a.J(),Ya(this),this.P.gr=a,this.g("resizeCellSize",y,a))}},rotateAdornmentTemplate:{get:function(){return this.P!==null?this.P.ir:null},set:function(a){var y=this.rotateAdornmentTemplate;y!==a&&(Ya(this),this.P.ir=a,this.g("rotateAdornmentTemplate",y,a))}},rotateObjectName:{get:function(){return this.P!==null?this.P.jr:""},set:function(a){var y=this.rotateObjectName;y!==a&&(Ya(this),this.P.jr=a,this.g("rotateObjectName",y,a))}},rotateObject:{get:function(){var a=this.rotateObjectName;return a!==""&&(a=this.fb(a),a!==null)?a:this}},rotationSpot:{get:function(){return this.P!==null?this.P.lr:vs},set:function(a){var y=this.rotationSpot;y.D(a)||(a=a.J(),Ya(this),this.P.lr=a,this.g("rotationSpot",y,a))}},text:{get:function(){return this.ec},set:function(a){var y=this.ec;y!==a&&(this.ec=a,this.g("text",y,a))}},containingGroup:{get:function(){return this.Ah},set:function(a){if(this.Zc()){var y=this.Ah;if(y!==a){a===null||this!==a&&!a.Td(this)||(this===a&&fe("Cannot make a Group a member of itself: "+this.toString()),fe("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString())),this.C(2);var x=this.diagram;if(y!==null?Uv(y,this):this instanceof Yn&&x!==null&&x.ai.remove(this),this.Ah=a,a!==null?Wv(a,this):this instanceof Yn&&x!==null&&x.ai.add(this),this.C(1),x!==null&&x.aa){var b=this.data,E=x.model;if(b!==null&&E.Xj()){var z=E.wa(a!==null?a.data:null);E.mp(b,z)}}if(b=this.containingGroupChanged,b!==null&&(E=!0,x!==null&&(E=x.aa,x.aa=!0),b(this,y,a),x!==null&&(x.aa=E)),this instanceof Yn){for(x=new Ye,af(x,this,!0,0,!0),x=x.iterator;x.next();)if(b=x.value,b instanceof $e)for(b=b.linksConnected;b.next();)Cg(b.value)}if(this instanceof $e){for(x=this.linksConnected;x.next();)Cg(x.value);x=this.labeledLink,x!==null&&Cg(x)}this.g("containingGroup",y,a),a!==null&&(y=a.layer,y!==null&&Qs(y,-1,a))}}else fe("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{get:function(){return this.P!==null?this.P.Kp:null},set:function(a){var y=this.containingGroupChanged;y!==a&&(Ya(this),this.P.Kp=a,this.g("containingGroupChanged",y,a))}},isTopLevel:{get:function(){return!(this.containingGroup!==null||this instanceof $e&&this.labeledLink!==null)}},layoutConditions:{get:function(){return this.P!==null?this.P.Cq:127},set:function(a){var y=this.layoutConditions;y!==a&&(Ya(this),this.P.Cq=a,this.g("layoutConditions",y,a))}},dragComputation:{get:function(){return this.P!==null?this.P.Up:null},set:function(a){var y=this.dragComputation;y!==a&&(Ya(this),this.P.Up=a,this.g("dragComputation",y,a))}},shadowOffset:{get:function(){return this.P!==null?this.P.zr:dl},set:function(a){var y=this.shadowOffset;y.D(a)||(a=a.J(),Ya(this),this.P.zr=a,this.N(),this.g("shadowOffset",y,a))}},shadowColor:{get:function(){return this.P!==null?this.P.yr:"gray"},set:function(a){var y=this.shadowColor;y!==a&&(Ya(this),this.P.yr=a,this.N(),this.g("shadowColor",y,a))}},shadowBlur:{get:function(){return this.P!==null?this.P.Vg:4},set:function(a){var y=this.shadowBlur;y!==a&&(Ya(this),this.P.Vg=a,this.N(),this.g("shadowBlur",y,a))}}}),vn.prototype.invalidateLayout=vn.prototype.C,vn.prototype.findCommonContainingGroup=vn.prototype.px,vn.prototype.isMemberOf=vn.prototype.Td,vn.prototype.findTopLevelPart=vn.prototype.sz,vn.prototype.findSubGraphLevel=vn.prototype.oz,vn.prototype.ensureBounds=vn.prototype.Va,vn.prototype.getDocumentBounds=vn.prototype.mi,vn.prototype.findObject=vn.prototype.fb,vn.prototype.moveTo=vn.prototype.moveTo,vn.prototype.invalidateAdornments=vn.prototype.Wb,vn.prototype.clearAdornments=vn.prototype.Ej,vn.prototype.removeAdornment=vn.prototype.Jf,vn.prototype.addAdornment=vn.prototype.bh,vn.prototype.findAdornment=vn.prototype.Pj,vn.prototype.updateTargetBindings=vn.prototype.La;var G1=!1;vn.className="Part",vn.LayoutNone=0,vn.LayoutAdded=1,vn.LayoutRemoved=2,vn.LayoutShown=4,vn.LayoutHidden=8,vn.LayoutNodeSized=16,vn.LayoutGroupLayout=32,vn.LayoutNodeReplaced=64,vn.LayoutStandard=127,vn.LayoutAll=16777215;function Bi(a,y){a===void 0||a instanceof es||typeof a=="string"?vn.call(this,a):(vn.call(this),a&&(y=a)),this.G&=-257,this.Jg="Adornment",this.ue=null,this.Aw=0,this.Uw=!1,this.j=this.$a=null,y&&Object.assign(this,y)}le(Bi,vn),Bi.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(a!==null?a.toString():"")},Bi.prototype.updateRelationshipsFromData=function(){},Bi.prototype.Ul=function(a){var y=this.adornedObject,x=y==null?void 0:y.part;if(x instanceof _e&&y instanceof Qn){y=x.path,x.Ul(a),a=y.geometry,x=this.O.s,y=x.length;for(var b=0;b<y;b++){var E=x[b];E.isPanelMain&&E instanceof Qn&&(E.ua=a)}}},Bi.prototype.si=function(){var a=this.ue;return a===null?!0:(a=a.part,a===null||!Ma(a))},Bi.prototype.Zc=function(){return!1},Bi.prototype.gk=function(a,y,x,b,E,z,tt){if(a===ko&&y==="elements"){if(E instanceof ba)this.$a===null&&(this.$a=E);else if(E instanceof Re){var rt=E.Nl(function(ot){return ot instanceof ba});rt instanceof ba&&this.$a===null&&(this.$a=rt)}}else a===Bo&&y==="elements"&&this.$a!==null&&(b===this.$a?this.$a=null:b instanceof Re&&this.$a.rg(b)&&(this.$a=null));vn.prototype.gk.call(this,a,y,x,b,E,z,tt)},Bi.prototype.updateAdornments=function(){},Bi.prototype.Lj=function(){},Oe.Object.defineProperties(Bi.prototype,{placeholder:{get:function(){return this.$a}},adornedObject:{get:function(){return this.ue},set:function(a){var y=this.adornedPart,x=null;a!==null&&(x=a.part),y===null||a!==null&&y===x||y.Jf(this.category),this.ue=a,x!==null&&x.bh(this.category,this)}},adornedPart:{get:function(){var a=this.ue;return a!==null?a.part:null}},containingGroup:{get:function(){return null}}}),Bi.className="Adornment";function _v(){this.nc=!1,this.Vr=this.gj=this.Eq=this.Dq=null,this.yp=dd,this.er=Ym,this.Kr=this.ij=this.Nq=this.Mq=null}_v.prototype.copy=function(){var a=new _v;return a.Dq=this.Dq,a.Eq=this.Eq,a.gj=this.gj,a.Vr=this.Vr,a.yp=this.yp.J(),a.er=this.er,a.Mq=this.Mq,a.Nq=this.Nq,a.ij=this.ij,a.Kr=this.Kr,a};function $e(a,y){a===void 0||a instanceof es||typeof a=="string"?vn.call(this,a):(vn.call(this),a&&(y=a)),this.U=13,this.Ba=null,this.jb=new Ve,this.wc=this.af=this.Yk=null,this.ci=!1,y&&Object.assign(this,y)}le($e,vn),$e.prototype.cloneProtected=function(a){vn.prototype.cloneProtected.call(this,a),a.U=this.U,this.Ba!==null&&(a.Ba=this.Ba.nc?this.Ba:this.Ba.copy())},xt=$e.prototype,xt.Af=function(a){vn.prototype.Af.call(this,a),a.Bd(),a.af=this.af,a.wc=null};function Ed(a){a.Ba===null?a.Ba=new _v:a.Ba.nc&&(a.Ba=a.Ba.copy())}xt.th=function(){vn.prototype.th.call(this),this.Ba!==null&&(this.Ba.nc=!0)};function _1(a,y){y!==null&&(a.af===null&&(a.af=new Ye),a.af.add(y))}function H1(a,y,x,b){if(y===null||a.af===null)return null;for(var E=a.af.iterator;E.next();){var z=E.value;if(z.Ds===a&&z.cv===y&&z.Ox===x&&z.Px===b||z.Ds===y&&z.cv===a&&z.Ox===b&&z.Px===x)return z}return null}xt.Lz=function(a,y,x){y==null&&(y=""),x==null&&(x=""),a=H1(this,a,y,x),a!==null&&a.Sl()},xt.gk=function(a,y,x,b,E,z,tt){a===ko&&y==="elements"?this.wc=null:a===Bo&&y==="elements"&&(this.wc=null),vn.prototype.gk.call(this,a,y,x,b,E,z,tt)},xt.Bd=function(a){for(var y=this.linksConnected;y.next();){var x=y.value;a!==void 0&&a.contains(x)||(ml(x.fromPort),ml(x.toPort),x.bb())}};function V1(a,y){for(a=a.linksConnected;a.next();){var x=a.value;(x.fromPort===y||x.toPort===y)&&(ml(x.fromPort),ml(x.toPort),x.bb())}}function ml(a){if(a!==null){var y=a.Zn;y!==null&&y.Sl(),a=a.part,y=a.containingGroup,y===null||a.isVisible()||ml(y.port)}}xt.si=function(){return!0},$e.prototype.getAvoidableRect=function(a){return a.set(this.actualBounds),a.Co(this.avoidableMargin),a},$e.prototype.findVisibleNode=function(){for(var a=this;a!==null&&!a.isVisible();)a=a.containingGroup;return a},$e.prototype.isVisible=function(){if(!vn.prototype.isVisible.call(this))return!1;var a=!0,y=wd,x=this.diagram;if(x!==null&&(a=x.isTreePathToChildren,y=x.treeCollapsePolicy),y===wd){if(a=this.pg(),a!==null&&!a.isTreeExpanded)return!1}else if(y===Xo){if(a=a?this.Oo():this.Po(),0<a.count&&a.all(function(b){return!b.isTreeExpanded}))return!1}else if(y===lg&&(a=a?this.Oo():this.Po(),0<a.count&&a.any(function(b){return!b.isTreeExpanded})))return!1;return a=this.labeledLink,a!==null?a.isVisible():!0},$e.prototype.Zb=function(a){vn.prototype.Zb.call(this,a);for(var y=this.linksConnected;y.next();){var x=y.value;if(a&&this.containingGroup!==null){var b=x.To(this);b===null||b.Td(this.containingGroup)||x.bb()}x.Zb(a)}},$e.prototype.qx=function(){var a=new Ye,y=new Ye;return W1(this,this,a,y),y.iterator};function W1(a,y,x,b){if(y!==null&&!x.has(y)){x.add(y);var E=!0,z=a.diagram;z!==null&&(E=z.isTreePathToChildren),y.linksConnected.each(function(tt){tt.isTreeLink?(E?tt.fromNode===y:tt.toNode===y)&&W1(a,E?tt.toNode:tt.fromNode,x,b):b.add(tt)})}}$e.prototype.findLinksConnected=function(a){if(a===void 0&&(a=null),a===null)return this.jb.iterator;var y=new ur(this.jb),x=this;return y.predicate=function(b){return b.fromNode===x&&b.fromPortId===a||b.toNode===x&&b.toPortId===a},y},xt=$e.prototype,xt.Mo=function(a){a===void 0&&(a=null);var y=new ur(this.jb),x=this;return y.predicate=function(b){return b.fromNode!==x?!1:a===null?!0:b.fromPortId===a},y},xt.Sd=function(a){a===void 0&&(a=null);var y=new ur(this.jb),x=this;return y.predicate=function(b){return b.toNode!==x?!1:a===null?!0:b.toPortId===a},y},xt.Mu=function(a){a===void 0&&(a=null);for(var y=null,x=null,b=this.jb.iterator;b.next();){var E=b.value;E.fromNode===this?(a===null||E.fromPortId===a)&&(E=E.toNode,y!==null?y.add(E):x!==null&&x!==E?(y=new Ye,y.add(x),y.add(E)):x=E):E.toNode!==this||a!==null&&E.toPortId!==a||(E=E.fromNode,y!==null?y.add(E):x!==null&&x!==E?(y=new Ye,y.add(x),y.add(E)):x=E)}return y!==null?y.iterator:x!==null?new lr(x):Sr},xt.Po=function(a){a===void 0&&(a=null);for(var y=null,x=null,b=this.jb.iterator;b.next();){var E=b.value;E.fromNode!==this||a!==null&&E.fromPortId!==a||(E=E.toNode,y!==null?y.add(E):x!==null&&x!==E?(y=new Ye,y.add(x),y.add(E)):x=E)}return y!==null?y.iterator:x!==null?new lr(x):Sr},xt.Oo=function(a){a===void 0&&(a=null);for(var y=null,x=null,b=this.jb.iterator;b.next();){var E=b.value;E.toNode!==this||a!==null&&E.toPortId!==a||(E=E.fromNode,y!==null?y.add(E):x!==null&&x!==E?(y=new Ye,y.add(x),y.add(E)):x=E)}return y!==null?y.iterator:x!==null?new lr(x):Sr},xt.jz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var b=new ur(this.jb),E=this;return b.predicate=function(z){return!((z.fromNode!==E||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)&&(z.fromNode!==a||z.toNode!==E||x!==null&&z.fromPortId!==x||y!==null&&z.toPortId!==y))},b},xt.kz=function(a,y,x){y===void 0&&(y=null),x===void 0&&(x=null);var b=new ur(this.jb),E=this;return b.predicate=function(z){return!(z.fromNode!==E||z.toNode!==a||y!==null&&z.fromPortId!==y||x!==null&&z.toPortId!==x)},b};function Um(a,y,x){ml(x);var b=a.jb.contains(y);if(b||a.jb.add(y),!b||y.fromNode===y.toNode){var E=a.linkConnected;if(E!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),E(a,y,x),tt!==null&&(tt.aa=z)}}!b&&y.isTreeLink&&(x=y.fromNode,y=y.toNode,x!==null&&y!==null&&x!==y&&(b=!0,a=a.diagram,a!==null&&(b=a.isTreePathToChildren),E=b?y:x,z=b?x:y,E.ci||(E.ci=z),!z.isTreeLeaf||a!==null&&a.undoManager.isUndoingRedoing||(b?x===z&&(z.isTreeLeaf=!1):y===z&&(z.isTreeLeaf=!1))))}function Km(a,y,x){ml(x);var b=a.jb.remove(y),E=null;if(b||y.toNode===y.fromNode){var z=a.linkDisconnected;if(E=a.diagram,z!==null){var tt=!0;E!==null&&(tt=E.aa,E.aa=!0),z(a,y,x),E!==null&&(E.aa=tt)}}b&&y.isTreeLink&&(x=!0,E!==null&&(x=E.isTreePathToChildren),a=x?y.toNode:y.fromNode,y=x?y.fromNode:y.toNode,a!==null&&(a.ci=!1),y===null||y.isTreeLeaf||(y.jb.count===0?(y.ci=null,E!==null&&E.undoManager.isUndoingRedoing||(y.isTreeLeaf=!0)):Sp(y)))}function Sp(a){if(a.ci=!1,a.jb.count!==0){var y=!0,x=a.diagram;if(x===null||!x.undoManager.isUndoingRedoing){for(x!==null&&(y=x.isTreePathToChildren),x=a.jb.iterator;x.next();){var b=x.value;if(b.isTreeLink){if(y){if(b.fromNode===a){a.isTreeLeaf=!1;return}}else if(b.toNode===a){a.isTreeLeaf=!1;return}}}a.isTreeLeaf=!0}}}$e.prototype.updateRelationshipsFromData=function(){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)},xt=$e.prototype,xt.Vo=function(a){vn.prototype.Vo.call(this,a),a||(Sp(this),a=this.Yk,a!==null&&q1(a,this))},xt.Wo=function(a){vn.prototype.Wo.call(this,a),a||(a=this.Yk,a!==null&&a.wd!==null&&(a.wd.remove(this),a.v()))},xt.Lj=function(){if(0<this.jb.count){var a=this.diagram;if(a!==null)for(var y=a.commandHandler!==null?a.commandHandler.deletesConnectedLinks:!0,x=this.jb.copy().iterator;x.next();){var b=x.value;y?a.remove(b):(b.fromNode===this&&(b.fromNode=null),b.toNode===this&&(b.toNode=null))}}this.labeledLink=null,vn.prototype.Lj.call(this)},xt.ns=function(a){if(this.wc===null){if(a===""&&this.Te===!1)return this;U1(this)}var y=this.wc.I(a);return y!==null||a!==""&&(y=this.wc.I(""),y!==null)?y:this};function U1(a){a.wc===null?a.wc=new xn:a.wc.clear(),a.qm(a,function(y,x){K1(y,x)}),a.wc.count===0&&a.wc.add("",a)}function K1(a,y){var x=y.portId;x!==null&&a.wc!==null&&a.wc.add(x,y)}function Hv(a,y,x){var b=y.portId;if(b!==null&&(a.wc!==null&&a.wc.remove(b),y=a.diagram,y!==null&&x)){for(x=null,a=a.findLinksConnected(b);a.next();)b=a.value,x===null&&(x=Kn()),x.push(b);if(x!==null){for(a=0;a<x.length;a++)y.remove(x[a]);zn(x)}}}xt.Nz=function(a){if(a===null||a===this)return!1;var y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this,y)for(;x!==a;){y=null;for(var b=x.jb.iterator;b.next();){var E=b.value;if(E.isTreeLink&&(y=E.fromNode,y!==x&&y!==this))break}if(y===this||y===null||y===x)return!1;x=y}else for(;x!==a;){for(y=null,b=x.jb.iterator;b.next()&&(E=b.value,!E.isTreeLink||(y=E.toNode,y===x||y===this)););if(y===this||y===null||y===x)return!1;x=y}return!0},xt.xz=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this,a)for(;;){a=null;for(var x=y.jb.iterator;x.next();){var b=x.value;if(b.isTreeLink&&(a=b.fromNode,a!==y&&a!==this))break}if(a===this)return this;if(a===null||a===y)return y;y=a}else for(;;){for(a=null,x=y.jb.iterator;x.next()&&(b=x.value,!b.isTreeLink||(a=b.toNode,a===y||a===this)););if(a===this)return this;if(a===null||a===y)return y;y=a}},xt.gz=function(a){if(a===null)return null;if(this===a)return this;for(var y=this;y!==null;)Wm(y,!0),y=y.pg();var x=null;for(y=a;y!==null;){if(y.G&1048576){x=y;break}y=y.pg()}for(y=this;y!==null;)Wm(y,!1),y=y.pg();return x},xt.kh=function(){var a=!0,y=this.diagram;if(y!==null&&(a=y.isTreePathToChildren),y=this.jb.iterator,a){for(;y.next();)if(a=y.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;y.next();)if(a=y.value,a.isTreeLink&&a.toNode!==this)return a;return null},xt.pg=function(){var a=this.ci;if(a===null)return null;if(a instanceof $e)return a;a=this.diagram,a=a!==null?a.isTreePathToChildren:!0;for(var y=this.jb.iterator;y.next();){var x=y.value;if(x.isTreeLink&&(x=a?x.fromNode:x.toNode,x!==this))return this.ci=x}return this.ci=null},xt.vz=function(){function a(x,b){b.add(x);var E=x.kh();E!==null&&(b.add(E),x=x.pg(),x!==null&&a(x,b))}var y=new Ye;return a(this,y),y},xt.uz=function(){return Y1(this,this)};function Y1(a,y){return y=y.pg(),y===null?0:1+Y1(a,y)}xt.Qo=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren),y=new ur(this.jb);var x=this;return y.predicate=a?function(b){return!!(b.isTreeLink&&b.fromNode===x)}:function(b){return!!(b.isTreeLink&&b.toNode===x)},y},xt.Ou=function(){var a=!0,y=this.diagram;y!==null&&(a=y.isTreePathToChildren);var x=y=null,b=this.jb.iterator;if(a)for(;b.next();)a=b.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,y!==null?y.add(a):x!==null&&x!==a?(y=new Ve,y.add(x),y.add(a)):x=a);else for(;b.next();)a=b.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,y!==null?y.add(a):x!==null&&x!==a?(y=new Ve,y.add(x),y.add(a)):x=a);return y!==null?y.iterator:x!==null?new lr(x):Sr},xt.wz=function(a){a===void 0&&(a=1/0);var y=new Ye;return af(y,this,!1,a,!0),y},$e.prototype.collapseTree=function(a){a===void 0&&(a=1),1>a&&(a=1);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new Ye;x.add(this),X1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===wd),y.Ue=!1}};function X1(a,y,x,b,E,z,tt){if(1<b)for(var rt=x?a.Mo():a.Sd();rt.next();){var ot=rt.value;ot.isTreeLink&&(ot=ot.To(a),ot===null||ot===a||y.contains(ot)||(y.add(ot),X1(ot,y,x,b-1,E,z,tt)))}else Z1(a,y,x,E,z,tt)}function Z1(a,y,x,b,E,z){for(var tt=E===a?!0:a.isTreeExpanded,rt=x?a.Mo():a.Sd(),ot={};rt.next();){var at=rt.value;if(at.isTreeLink&&(at=at.To(a),at!==null&&at!==a)){var ut=y.contains(at);if(ut||y.add(at),tt){var ct=x?at.Oo():at.Po();ot.uv=a,ct.all(function(mt){return function(yt){return yt===mt.uv||!yt.isTreeExpanded}}(ot))&&b.Aj(at,E),at.oh(),at.Zb(!1)}at.isTreeExpanded&&(at.wasTreeExpanded=at.isTreeExpanded,ut||Z1(at,y,x,b,E,z))}ot={uv:ot.uv}}a.isTreeExpanded=!1}$e.prototype.expandTree=function(a){a===void 0&&(a=2),2>a&&(a=2);var y=this.diagram;if(y!==null&&!y.Ue){y.Ue=!0;var x=new Ye;x.add(this),J1(this,x,y.isTreePathToChildren,a,y,this,y.treeCollapsePolicy===wd),y.Ue=!1}};function J1(a,y,x,b,E,z,tt){for(var rt=z===a?!1:a.isTreeExpanded,ot=x?a.Mo():a.Sd(),at={};ot.next();){var ut=ot.value;if(ut.isTreeLink&&(rt||ut.fd||ut.bb(),ut=ut.To(a),ut!==null&&ut!==a&&!y.contains(ut))){if(y.add(ut),!rt){ut.Zb(!0),ut.oh();var ct=x?ut.Oo():ut.Po();at.vv=a,ct.all(function(mt){return function(yt){return yt===mt.vv||!yt.isTreeExpanded}}(at))&&E.Cj(ut,z)}(2<b||ut.wasTreeExpanded)&&(ut.wasTreeExpanded=!1,J1(ut,y,x,b-1,E,z,tt))}at={vv:at.vv}}a.isTreeExpanded=!0}Oe.Object.defineProperties($e.prototype,{portSpreading:{get:function(){return this.Ba!==null?this.Ba.er:Ym},set:function(a){var y=this.portSpreading;y!==a&&(Ed(this),this.Ba.er=a,this.g("portSpreading",y,a),a=this.diagram,a!==null&&a.undoManager.isUndoingRedoing||this.Bd())}},avoidable:{get:function(){return(this.U&8)!==0},set:function(a){var y=(this.U&8)!==0;if(y!==a){this.U^=8;var x=this.diagram;x!==null&&xd(x,this),this.g("avoidable",y,a)}}},avoidableMargin:{get:function(){return this.Ba!==null?this.Ba.yp:dd},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.avoidableMargin;if(!y.D(a)){a=a.J(),Ed(this),this.Ba.yp=a;var x=this.diagram;x!==null&&xd(x,this),this.g("avoidableMargin",y,a)}}},linksConnected:{get:function(){return this.jb.iterator}},linkConnected:{get:function(){return this.Ba!==null?this.Ba.Dq:null},set:function(a){var y=this.linkConnected;y!==a&&(Ed(this),this.Ba.Dq=a,this.g("linkConnected",y,a))}},linkDisconnected:{get:function(){return this.Ba!==null?this.Ba.Eq:null},set:function(a){var y=this.linkDisconnected;y!==a&&(Ed(this),this.Ba.Eq=a,this.g("linkDisconnected",y,a))}},linkValidation:{get:function(){return this.Ba!==null?this.Ba.gj:null},set:function(a){var y=this.linkValidation;y!==a&&(Ed(this),this.Ba.gj=a,this.g("linkValidation",y,a))}},isLinkLabel:{get:function(){return this.Yk!==null}},labeledLink:{get:function(){return this.Yk},set:function(a){var y=this.Yk;if(y!==a){var x=this.diagram,b=this.data;if(y!==null){if(y.wd!==null&&(y.wd.remove(this),y.v()),x!==null&&b!==null&&!x.undoManager.isUndoingRedoing){var E=y.data,z=x.model;if(E!==null&&z.ri()){var tt=z.wa(b);tt!==void 0&&z.Qx(E,tt)}}this.containingGroup=null}this.Yk=a,a!==null&&(q1(a,this),x===null||b===null||x.undoManager.isUndoingRedoing||(E=a.data,x=x.model,E!==null&&x.ri()&&(b=x.wa(b),b!==void 0&&x.Bu(E,b))),this.containingGroup=a.containingGroup),La(this),this.g("labeledLink",y,a)}}},port:{get:function(){return this.ns("")}},ports:{get:function(){return this.wc===null&&U1(this),this.wc.iteratorValues}},isTreeExpanded:{get:function(){return(this.U&1)!==0},set:function(a){var y=(this.U&1)!==0;if(y!==a){this.U^=1;var x=this.diagram;if(this.g("isTreeExpanded",y,a),y=this.treeExpandedChanged,y!==null){var b=!0;x!==null&&(b=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=b)}x!==null&&x.undoManager.isUndoingRedoing?this.Zb(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{get:function(){return(this.U&2)!==0},set:function(a){var y=(this.U&2)!==0;y!==a&&(this.U^=2,this.g("wasTreeExpanded",y,a))}},treeExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Vr:null},set:function(a){var y=this.treeExpandedChanged;y!==a&&(Ed(this),this.Ba.Vr=a,this.g("treeExpandedChanged",y,a))}},isTreeLeaf:{get:function(){return(this.U&4)!==0},set:function(a){var y=(this.U&4)!==0;y!==a&&(this.U^=4,this.g("isTreeLeaf",y,a))}}}),$e.prototype.expandTree=$e.prototype.expandTree,$e.prototype.collapseTree=$e.prototype.collapseTree,$e.prototype.findTreeParts=$e.prototype.wz,$e.prototype.findTreeChildrenNodes=$e.prototype.Ou,$e.prototype.findTreeChildrenLinks=$e.prototype.Qo,$e.prototype.findTreeLevel=$e.prototype.uz,$e.prototype.findTreeParentChain=$e.prototype.vz,$e.prototype.findTreeParentNode=$e.prototype.pg,$e.prototype.findTreeParentLink=$e.prototype.kh,$e.prototype.findCommonTreeParent=$e.prototype.gz,$e.prototype.findTreeRoot=$e.prototype.xz,$e.prototype.isInTreeOf=$e.prototype.Nz,$e.prototype.findPort=$e.prototype.ns,$e.prototype.findLinksTo=$e.prototype.kz,$e.prototype.findLinksBetween=$e.prototype.jz,$e.prototype.findNodesInto=$e.prototype.Oo,$e.prototype.findNodesOutOf=$e.prototype.Po,$e.prototype.findNodesConnected=$e.prototype.Mu,$e.prototype.findLinksInto=$e.prototype.Sd,$e.prototype.findLinksOutOf=$e.prototype.Mo,$e.prototype.findExternalTreeLinksConnected=$e.prototype.qx,$e.prototype.invalidateConnectedLinks=$e.prototype.Bd,$e.prototype.invalidateLinkBundle=$e.prototype.Lz;var Lx=new me($e,"SpreadingNone",10),Ym=new me($e,"SpreadingEvenly",11),Vv=new me($e,"SpreadingPacked",12);$e.className="Node",$e.SpreadingNone=Lx,$e.SpreadingEvenly=Ym,$e.SpreadingPacked=Vv;function Yn(a,y){a===void 0||a instanceof es||typeof a=="string"?$e.call(this,a):($e.call(this),a&&(y=a)),this.U|=4608,this.Gn=new Ye,this.$a=null,this.Sc=new Zr,this.Sc.group=this,this.gl=new Ye,this.tb=this.$p=null,y&&Object.assign(this,y)}le(Yn,$e),Yn.prototype.cloneProtected=function(a){$e.prototype.cloneProtected.call(this,a),this.U=this.U&-32769;var y=a.Nl(function(x){return x instanceof ba});y instanceof ba?a.$a=y:a.$a=null,this.Sc!==null?(a.Sc=this.Sc.copy(),a.Sc.group=a):(a.Sc!==null&&(a.Sc.group=null),a.Sc=null),this.tb!==null&&(a.tb=this.tb.copy())},xt=Yn.prototype,xt.Af=function(a){$e.prototype.Af.call(this,a);var y=a.Rj();for(a=a.memberParts;a.next();){var x=a.value;if(x.v(),x.C(8),x.Ej(),x instanceof $e)x.Bd(y);else if(x instanceof _e)for(x=x.labelNodes;x.next();)x.value.Bd(y)}},xt.gk=function(a,y,x,b,E,z,tt){if(a===ko&&y==="elements"){if(E instanceof ba)this.$a===null?this.$a=E:this.$a!==E&&fe("Cannot insert a second Placeholder into the visual tree of a Group.");else if(E instanceof Re){var rt=E.Nl(function(ot){return ot instanceof ba});rt instanceof ba&&(this.$a===null?this.$a=rt:this.$a!==rt&&fe("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Bo&&y==="elements"&&this.$a!==null&&(b===this.$a?this.$a=null:b instanceof Re&&this.$a.rg(b)&&(this.$a=null));$e.prototype.gk.call(this,a,y,x,b,E,z,tt)},xt.Xl=function(a,y){$e.prototype.Xl.call(this,a,y),this.isClipping&&this.type!==Re.Spot&&this.isSubGraphExpanded&&(a=this.resizeObject,a instanceof Re&&(a=a.Pb()),this.tb===null&&(this.tb=new ye),a.mi(this.tb),a instanceof Qn&&this.tb.Bc(-a.strokeWidth,-a.strokeWidth))},xt.eh=function(a,y,x,b){this.nf=this.$a,$e.prototype.eh.call(this,a,y,x,b)},xt.Va=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(y){!a.computesBoundsIncludingLinks&&y instanceof _e||y.Va()}),$e.prototype.Va.call(this)},xt.si=function(){if(!$e.prototype.si.call(this))return!1;for(var a=this.memberParts;a.next();){var y=a.value;if(y instanceof $e){if(y.isVisible()&&Ma(y))return!1}else if(y instanceof _e&&y.isVisible()&&Ma(y)&&y.fromNode!==this&&y.toNode!==this)return!1}return!0};function Wv(a,y){if(a.Gn.add(y)){y instanceof Yn&&a.gl.add(y);var x=a.memberAdded;if(x!==null){var b=!0,E=a.diagram;E!==null&&(b=E.aa,E.aa=!0),x(a,y),E!==null&&(E.aa=b)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!1)}y instanceof _e&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}function Uv(a,y){if(a.Gn.remove(y)){y instanceof Yn&&a.gl.remove(y);var x=a.memberRemoved;if(x!==null){var b=!0,E=a.diagram;E!==null&&(b=E.aa,E.aa=!0),x(a,y),E!==null&&(E.aa=b)}a.isVisible()&&a.isSubGraphExpanded||y.Zb(!0)}y instanceof _e&&!a.computesBoundsIncludingLinks||(y=a.$a,y===null&&(y=a),y.v())}xt.Lj=function(){if(0<this.Gn.count){var a=this.diagram;if(a!==null)for(var y=this.Gn.copy().iterator;y.next();)a.remove(y.value)}$e.prototype.Lj.call(this)},Yn.prototype.canAddMembers=function(a){var y=this.diagram;if(y===null)return!1;for(y=y.commandHandler,a=ge(a).iterator;a.next();)if(!y.isValidMember(this,a.value))return!1;return!0},Yn.prototype.addMembers=function(a,y){var x=this.diagram;if(x===null)return!1;x=x.commandHandler;var b=!0;for(a=ge(a).iterator;a.next();){var E=a.value;!y||x.isValidMember(this,E)?E.containingGroup=this:b=!1}return b},Yn.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;return a===null||!a.allowUngroup?!1:(a=a.diagram,!!(a===null||a.allowUngroup))},xt=Yn.prototype,xt.Bd=function(a){var y=(this.U&65536)!==0;if($e.prototype.Bd.call(this,a),!y)for(!(this.U&65536)&&(this.U=this.U^65536),y=this.Lu();y.next();){var x=y.value;if(a===void 0||!a.contains(x)){var b=x.fromNode;b!==null&&b!==this&&b.Td(this)&&!b.isVisible()?(ml(x.fromPort),ml(x.toPort),x.bb()):(b=x.toNode,b!==null&&b!==this&&b.Td(this)&&!b.isVisible()&&(ml(x.fromPort),ml(x.toPort),x.bb()))}}},xt.Lu=function(){var a=this.diagram!==null&&this.diagram.Pw;if(a&&this.$p!==null)return this.$p.iterator;var y=this.Rj();y.add(this);for(var x=new Ye,b=y.iterator;b.next();){var E=b.value;if(E instanceof $e)for(E=E.linksConnected;E.next();){var z=E.value;y.contains(z)||x.add(z)}}return a&&(this.$p=x),x.iterator},xt.iz=function(){var a=this.Rj();a.add(this);for(var y=new Ye,x=a.iterator;x.next();){var b=x.value;if(b instanceof $e)for(b=b.linksConnected;b.next();){var E=b.value,z=E.fromNode;z===null||a.contains(z)&&z!==this||y.add(z),E=E.toNode,E===null||a.contains(E)&&E!==this||y.add(E)}}return y.iterator},xt.hz=function(){function a(x,b){x!==null&&(b.add(x),a(x.containingGroup,b))}var y=new Ye;return a(this,y),y},xt.Rj=function(){var a=new Ye;return af(a,this,!0,0,!0),a.remove(this),a},xt.Zb=function(a){$e.prototype.Zb.call(this,a);for(var y=this.memberParts;y.next();)y.value.Zb(a)},Yn.prototype.collapseSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();Q1(this,y,a,this),a.Ue=!1}};function Q1(a,y,x,b){for(var E=a.memberParts;E.next();){var z=E.value;if(z.Zb(!1),z instanceof Yn&&z.isSubGraphExpanded&&(z.wasSubGraphExpanded=z.isSubGraphExpanded,Q1(z,y,x,b)),z instanceof $e)z.Bd(y),x.Aj(z,b);else if(z instanceof _e)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!1}Yn.prototype.expandSubGraph=function(){var a=this.diagram;if(a!==null&&!a.Ue){a.Ue=!0;var y=this.Rj();$1(this,y,a,this),a.Ue=!1}};function $1(a,y,x,b){for(var E=a.memberParts;E.next();){var z=E.value;if(z.Zb(!0),z instanceof Yn&&z.wasSubGraphExpanded&&(z.wasSubGraphExpanded=!1,$1(z,y,x,b)),z instanceof $e)z.Bd(y),x.Cj(z,b);else if(z instanceof _e)for(z=z.labelNodes;z.next();)z.value.Bd(y)}a.isSubGraphExpanded=!0}Yn.prototype.move=function(a,y){y===void 0&&(y=!1);var x=y?this.location:this.position,b=x.x;x=x.y;var E=a.x,z=a.y;if(!(b===E||isNaN(b)&&isNaN(E))||!(x===z||isNaN(x)&&isNaN(z))){for(b=E-(isNaN(b)?0:b),x=z-(isNaN(x)?0:x),z=jt.alloc(),$e.prototype.move.call(this,a,y),a=new Ye,y=this.Rj().iterator;y.next();)E=y.value,E instanceof _e&&(E.suspendsRouting&&a.add(E),E.fd||E.fromNode!==this&&E.toNode!==this)&&(E.suspendsRouting=!0);for(y.reset();y.next();)if(E=y.value,!(E.ph()||E instanceof $e&&E.isLinkLabel)){var tt=E.position,rt=E.location;tt.w()?(z.x=tt.x+b,z.y=tt.y+x,E.position=z):rt.w()&&(z.x=rt.x+b,z.y=rt.y+x,E.location=z)}for(y.reset();y.next();)E=y.value,E instanceof _e&&(E.suspendsRouting=a.contains(E),E.fd||E.fromNode!==this&&E.toNode!==this)&&(tt=E.position,z.x=tt.x+b,z.y=tt.y+x,z.w()?E.move(z):E.bb(),Yv(E)&&E.bb());jt.free(z)}},Oe.Object.defineProperties(Yn.prototype,{placeholder:{get:function(){return this.$a}},computesBoundsAfterDrag:{get:function(){return(this.U&2048)!==0},set:function(a){var y=(this.U&2048)!==0;y!==a&&(this.U^=2048,this.g("computesBoundsAfterDrag",y,a))}},computesBoundsIncludingLinks:{get:function(){return(this.U&4096)!==0},set:function(a){var y=(this.U&4096)!==0;y!==a&&(this.U^=4096,this.g("computesBoundsIncludingLinks",y,a))}},computesBoundsIncludingLocation:{get:function(){return(this.U&8192)!==0},set:function(a){var y=(this.U&8192)!==0;y!==a&&(this.U^=8192,this.g("computesBoundsIncludingLocation",y,a))}},handlesDragDropForMembers:{get:function(){return(this.U&16384)!==0},set:function(a){var y=(this.U&16384)!==0;y!==a&&(this.U^=16384,this.g("handlesDragDropForMembers",y,a))}},memberParts:{get:function(){return this.Gn.iterator}},layout:{get:function(){return this.Sc},set:function(a){var y=this.Sc;if(y!==a){a!==null&&a.diagram!==null&&a.diagram.layout===a&&fe("A layout cannot be both the Diagram.layout and a Group.layout: "+a),y!==null&&(y.diagram=null,y.group=null),this.Sc=a;var x=this.diagram;a!==null&&(a.diagram=x,a.group=this),x!==null&&(x.xh=!0),this.g("layout",y,a),x!==null&&x.$b()}}},memberAdded:{get:function(){return this.Ba!==null?this.Ba.Mq:null},set:function(a){var y=this.memberAdded;y!==a&&(Ed(this),this.Ba.Mq=a,this.g("memberAdded",y,a))}},memberRemoved:{get:function(){return this.Ba!==null?this.Ba.Nq:null},set:function(a){var y=this.memberRemoved;y!==a&&(Ed(this),this.Ba.Nq=a,this.g("memberRemoved",y,a))}},memberValidation:{get:function(){return this.Ba!==null?this.Ba.ij:null},set:function(a){var y=this.memberValidation;y!==a&&(Ed(this),this.Ba.ij=a,this.g("memberValidation",y,a))}},ungroupable:{get:function(){return(this.U&256)!==0},set:function(a){var y=(this.U&256)!==0;y!==a&&(this.U^=256,this.g("ungroupable",y,a))}},isSubGraphExpanded:{get:function(){return(this.U&512)!==0},set:function(a){var y=(this.U&512)!==0;if(y!==a){this.U^=512;var x=this.diagram;if(this.g("isSubGraphExpanded",y,a),y=this.subGraphExpandedChanged,y!==null){var b=!0;x!==null&&(b=x.aa,x.aa=!0),y(this),x!==null&&(x.aa=b)}x!==null&&x.undoManager.isUndoingRedoing?(this.$a!==null&&this.$a.v(),this.memberParts.each(function(E){E.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{get:function(){return(this.U&1024)!==0},set:function(a){var y=(this.U&1024)!==0;y!==a&&(this.U^=1024,this.g("wasSubGraphExpanded",y,a))}},subGraphExpandedChanged:{get:function(){return this.Ba!==null?this.Ba.Kr:null},set:function(a){var y=this.subGraphExpandedChanged;y!==a&&(Ed(this),this.Ba.Kr=a,this.g("subGraphExpandedChanged",y,a))}},rh:{get:function(){return(this.U&32768)!==0},set:function(a){(this.U&32768)!==0!==a&&(this.U^=32768)}}}),Yn.prototype.expandSubGraph=Yn.prototype.expandSubGraph,Yn.prototype.collapseSubGraph=Yn.prototype.collapseSubGraph,Yn.prototype.findSubGraphParts=Yn.prototype.Rj,Yn.prototype.findContainingGroupChain=Yn.prototype.hz,Yn.prototype.findExternalNodesConnected=Yn.prototype.iz,Yn.prototype.findExternalLinksConnected=Yn.prototype.Lu,Yn.prototype.ensureBounds=Yn.prototype.Va,Yn.className="Group";function ba(a){te.call(this),this.yb=Zl,this.ko=new ye(NaN,NaN,NaN,NaN),a&&Object.assign(this,a)}le(ba,te),ba.prototype.cloneProtected=function(a){te.prototype.cloneProtected.call(this,a),a.yb=this.yb.J(),a.ko=this.ko.copy()},ba.prototype.gh=function(a){if(this.background===null&&this.areaBackground===null)return!1;var y=this.naturalBounds;return ps(0,0,y.width,y.height,a.x,a.y)},ba.prototype.Wl=function(){var a=this.part;if(a!==null&&(a instanceof Yn||a instanceof Bi)||fe("Placeholder is not inside a Group or Adornment."),a instanceof Yn){var y=this.computeBorder(this.ko),x=this.minSize,b=this.dc;for(Ra(b,(isFinite(x.width)?Math.max(x.width,y.width):y.width)||0,(isFinite(x.height)?Math.max(x.height,y.height):y.height)||0),this.Ge(0,0,b.width,b.height),b=a.memberParts,x=!1;b.next();)if(b.value.isVisible()){x=!0;break}b=a.diagram,!x||b===null||b.animationManager.Xu(a)||isNaN(y.x)||isNaN(y.y)||(x=jt.alloc(),x.xi(y,a.locationSpot),x.D(a.location)||(a.location=x),jt.free(x))}else{y=this.dc,x=this.yb,b=x.left+x.right;var E=x.top+x.bottom,z=a.adornedObject;a.angle=z.li();var tt=0;z instanceof Qn&&(tt=z.strokeWidth);var rt=z.Df(),ot=z.naturalBounds,at=(ot.width+tt)*rt;tt=(ot.height+tt)*rt,a.type!==Re.Link&&(rt=z.ga(a.category==="Selection"?ms:a.locationSpot,jt.alloc()),a.location=rt,jt.free(rt)),isNaN(at)||isNaN(tt)?(a=z.ga(ms,jt.alloc()),at=ye.allocAt(a.x,a.y,0,0),at.Ye(z.ga(Ll,a)),at.Ye(z.ga(cd,a)),at.Ye(z.ga(Du,a)),Ra(y,at.width+b||0,at.height+E||0),this.Ge(-x.left,-x.top,y.width,y.height),jt.free(a),ye.free(at)):(Ra(y,at+b||0,tt+E||0),this.Ge(-x.left,-x.top,y.width,y.height))}},ba.prototype.eh=function(a,y,x,b){this.actualBounds.h(a,y,x,b)},ba.prototype.computeBorder=function(a){var y=this.part,x=y.diagram,b=x===null||!x.animationManager.isAnimating;if(x!==null&&y instanceof Yn&&!y.layer.isTemporary&&y.computesBoundsAfterDrag&&this.ko.w()){var E=x.toolManager.findTool("Dragging");if(E===x.currentTool&&(x=E.computeBorder(y,this.ko,a),x!==null))return x}x=ye.alloc(),E=this.computeMemberBounds(x);var z=this.yb;return y instanceof Yn&&!y.isSubGraphExpanded?a.h(E.x-z.left,E.y-z.top,0,0):a.h(E.x-z.left,E.y-z.top,Math.max(E.width+z.left+z.right,0),Math.max(E.height+z.top+z.bottom,0)),ye.free(x),b&&y instanceof Yn&&y.computesBoundsIncludingLocation&&y.location.w()&&a.Ye(y.location),a},ba.prototype.computeMemberBounds=function(a){if(!(this.part instanceof Yn))return a.h(0,0,0,0),a;for(var y=this.part,x=1/0,b=1/0,E=-1/0,z=-1/0,tt=y.memberParts;tt.next();){var rt=tt.value;if(rt.isVisible()){if(rt instanceof _e&&(!y.computesBoundsIncludingLinks||Nl(rt)||rt.fromNode===y||rt.toNode===y))continue;rt=rt.actualBounds,rt.left<x&&(x=rt.left),rt.top<b&&(b=rt.top),rt.right>E&&(E=rt.right),rt.bottom>z&&(z=rt.bottom)}}return isFinite(x)&&isFinite(b)?a.h(x,b,E-x,z-b):(y=y.location,a.h(y.x,y.y,0,0)),a},Oe.Object.defineProperties(ba.prototype,{padding:{get:function(){return this.yb},set:function(a){typeof a=="number"&&(a=new ni(a));var y=this.yb;y.D(a)||(this.yb=a=a.J(),this.g("padding",y,a),this.v())}}}),ba.className="Placeholder";function _e(a){vn.call(this,Re.Link),this.Qa=8,this.ef=null,this.ff="",this.uf=this.gn=null,this.vf="",this.uo=null,this.qk=Ea,this.Om=0,this.Qm=Ea,this.Rm=NaN,this.qj=Jv,this.po=.5,this.wd=null,this.Nb=new Ve().freeze(),this.Tg=this.Mg=null,this.ml=new ye,this.ua=new We,this.u=this.o=this.Sf=this.Wf=null,this.su=new jt,this.cq=this.Mw=this.Lw=null,this.vt=NaN,this.ba=null,this.j=[],a&&Object.assign(this,a)}le(_e,vn),_e.prototype.cloneProtected=function(a){vn.prototype.cloneProtected.call(this,a),a.Qa=this.Qa&-113,a.ff=this.ff,a.gn=this.gn,a.vf=this.vf,a.uo=this.uo,a.qk=this.qk,a.Om=this.Om,a.Qm=this.Qm,a.Rm=this.Rm,a.qj=this.qj,a.po=this.po,this.ba!==null&&(a.ba=this.ba.copy())},xt=_e.prototype,xt.Af=function(a){vn.prototype.Af.call(this,a),this.ff=a.ff,this.vf=a.vf,a.Mg=null,a.bb(),a.Sf=this.Sf;var y=a.fromPort;y!==null&&ml(y),a=a.toPort,a!==null&&ml(a)},xt.qb=function(a){a.classType===_e?(a.value&2)===2?this.routing=a:a===Al||a===Td||a===Mg?this.curve=a:a===wp||a===qm||a===t0?this.adjusting=a:a!==Jv&&a!==Ea&&fe("Unknown Link enum value for a Link property: "+a):vn.prototype.qb.call(this,a)},xt.Xc=function(){this.ba===null&&(this.ba=new lp)},xt.si=function(){var a=this.fromNode;if(a!==null){var y=a.findVisibleNode();if(y!==null&&(a=y),Ma(a)||of(a))return!1}return a=this.toNode,!(a!==null&&(y=a.findVisibleNode(),y!==null&&(a=y),Ma(a)||of(a)))},xt.zv=function(){return!1},xt.Av=function(){},xt.Zc=function(){return!1},_e.prototype.computeAngle=function(a,y,x){return _e.computeAngle(y,x)},_e.computeAngle=function(a,y){switch(a){default:case Ea:a=0;break;case Cp:a=y;break;case Lp:a=y+90;break;case Mp:a=y-90;break;case Qv:a=y+180;break;case e0:a=ne.bp(y),90<a&&270>a&&(a-=180);break;case kp:a=ne.bp(y+90),90<a&&270>a&&(a-=180);break;case bp:a=ne.bp(y-90),90<a&&270>a&&(a-=180);break;case n0:if(a=ne.bp(y),45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return ne.bp(a)};function Cg(a){var y=a.fromNode,x=a.toNode,b=null;if(y!==null?b=x!==null?y.px(x):y.containingGroup:x!==null?b=x.containingGroup:b=null,y=b,x=a.Ah,x!==y){x!==null&&Uv(x,a),a.Ah=y,y!==null&&Wv(y,a);var E=a.containingGroupChanged;if(E!==null){var z=!0,tt=a.diagram;tt!==null&&(z=tt.aa,tt.aa=!0),E(a,x,y),tt!==null&&(tt.aa=z)}!a.fd||a.Lw!==x&&a.Mw!==x||a.bb()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=b}xt=_e.prototype,xt.oh=function(){var a=this.containingGroup;a!==null&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&vn.prototype.oh.call(this)},xt.To=function(a){var y=this.fromNode;return a===y?this.toNode:y},xt.Cz=function(a){var y=this.fromPort;return a===y?this.toPort:y};function q1(a,y){a.wd===null&&(a.wd=new Ye),a.wd.add(y),a.v()}xt.Vo=function(a){if(vn.prototype.Vo.call(this,a),ic(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Um(a,this,y));var x=this.uf;if(x!==null){var b=this.toPort;x===a&&b===y||Um(x,this,b)}xp(this)}},xt.Wo=function(a){if(vn.prototype.Wo.call(this,a),ic(this)&&this.Xo(this.actualBounds),!a){a=this.ef;var y=null;a!==null&&(y=this.fromPort,Km(a,this,y));var x=this.uf;if(x!==null){var b=this.toPort;x===a&&b===y||Km(x,this,b)}Pp(this)}},xt.Lj=function(){if(this.fd=!0,this.wd!==null){var a=this.diagram;if(a!==null)for(var y=this.wd.copy().iterator;y.next();)a.remove(y.value)}this.data!==null&&(a=this.diagram,a!==null&&a.partManager.removeDataForLink(this))},_e.prototype.updateRelationshipsFromData=function(){if(this.data!==null){var a=this.diagram;a!==null&&a.partManager.updateRelationshipsFromData(this)}},_e.prototype.move=function(a,y){var x=y?this.location:this.position,b=x.x;isNaN(b)&&(b=0);var E=x.y;for(isNaN(E)&&(E=0),b=a.x-b,E=a.y-E,y===!0?vn.prototype.move.call(this,a,!1):(a=jt.allocAt(x.x+b,x.y+E),vn.prototype.move.call(this,a,!1),jt.free(a)),Fd(this,b,E),a=this.labelNodes;a.next();)y=a.value,x=y.position,y.moveTo(x.x+b,x.y+E)},_e.prototype.canRelinkFrom=function(){if(!this.relinkableFrom)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},_e.prototype.canRelinkTo=function(){if(!this.relinkableTo)return!1;var a=this.layer;return a===null?!0:a.allowRelink?(a=a.diagram,!!(a===null||a.allowRelink)):!1},_e.prototype.computeMidPoint=function(a){var y=this.pointsCount;if(y===0)return a.assign(ch),a;if(y===1)return a.assign(this.i(0)),a;if(y===2){var x=this.i(0),b=this.i(1);return a.h((x.x+b.x)/2,(x.y+b.y)/2),a}if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Al))return this.ua.Pu(.5,a),a.add(this.i(0)),x=this.ua.figures.first(),a.offset(-x.startX,-x.startY),a;if(this.computeCurve()===Al){if(y===3){x=this.i(0),b=this.i(1);var E=this.i(2);return ne.ax(x.x,x.y,b.x,b.y,b.x,b.y,E.x,E.y,a),a}if(b=(y-1)/3|0,x=3*(b/2|0),b%2===1){b=this.i(x),E=this.i(x+1);var z=this.i(x+2);x=this.i(x+3),ne.ax(b.x,b.y,E.x,E.y,z.x,z.y,x.x,x.y,a)}else a.assign(this.i(x));return a}var tt=this.flattenedLengths;for(x=this.flattenedTotalLength,E=z=b=0;b<x/2&&z<y&&(E=tt[z],!(b+E>x/2));)b+=E,z++;return y=this.i(z),z=this.i(z+1),1>Math.abs(y.x-z.x)?y.y>z.y?a.h(y.x,y.y-(x/2-b)):a.h(y.x,y.y+(x/2-b)):1>Math.abs(y.y-z.y)?y.x>z.x?a.h(y.x-(x/2-b),y.y):a.h(y.x+(x/2-b),y.y):(x=(x/2-b)/E,a.h(y.x+x*(z.x-y.x),y.y+x*(z.y-y.y))),a},_e.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(a===2)return this.i(0).ab(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===Al))return this.ua.wx(.5);if(this.computeCurve()===Al&&4<=a){var y=(a-1)/3|0,x=3*(y/2|0);if(y%2===1){x=Math.floor(x),a=this.i(x),y=this.i(x+1);var b=this.i(x+2);return x=this.i(x+3),ne.My(a.x,a.y,y.x,y.y,b.x,b.y,x.x,x.y)}if(0<x&&x+1<a)return this.i(x-1).ab(this.i(x+1))}y=this.flattenedLengths,b=this.flattenedTotalLength;var E=0;x=0;for(var z;E<b/2&&x<a&&(z=y[x],!(E+z>b/2));)E+=z,x++;if(y=this.i(x),b=this.i(x+1),1>Math.abs(y.x-b.x)&&1>Math.abs(y.y-b.y)){if(0<x&&x+2<a)return this.i(x-1).ab(this.i(x+2))}else{if(1>Math.abs(y.x-b.x))return y.y>b.y?270:90;if(1>Math.abs(y.y-b.y))return y.x>b.x?180:0}return y.ab(b)},xt=_e.prototype,xt.i=function(a){return this.Nb.s[a]},xt.dd=function(a,y){this.Nb.cd(a,y)},xt.L=function(a,y,x){this.Nb.cd(a,new jt(y,x))},xt.Kz=function(a,y){this.Nb.Gb(a,y)},xt.m=function(a,y,x){this.Nb.Gb(a,new jt(y,x))},xt.ne=function(a){this.Nb.add(a)},xt.yf=function(a,y){this.Nb.add(new jt(a,y))},xt.pv=function(a){this.Nb.mb(a)},xt.Fj=function(){this.Nb.clear()};function Fd(a,y,x){if(y!==0||x!==0)if(a.pointsCount===0)a.defaultFromPoint&&a.defaultFromPoint.offset(y,x),a.defaultToPoint&&a.defaultToPoint.offset(y,x);else{for(var b=a.fd,E=new Ve,z=a.Nb.iterator;z.next();){var tt=z.value;E.add(new jt(tt.x+y,tt.y+x).freeze())}E.freeze(),z=a.Nb,a.Nb=E,tt=a.diagram,isNaN(y)||isNaN(x)||tt!==null&&tt.animationManager.zb?a.v():(a.ke.h(a.ke.x+y,a.ke.y+x),a.pa.h(a.pa.x+y,a.pa.y+x),La(a)),b?Xm(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint=a.i(a.pointsCount-1))),tt!==null&&tt.animationManager.zb&&Ri(tt.animationManager,a,E),a.g("points",z,E)}}xt.uh=function(){this.Mg===null&&(this.Mg=this.Nb,this.Nb=this.Nb.copy())},xt.zf=function(){if(this.Mg!==null){for(var a=this.Mg,y=this.Nb,x=1/0,b=1/0,E=a.s,z=E.length,tt=0;tt<z;tt++){var rt=E[tt];x=Math.min(rt.x,x),b=Math.min(rt.y,b)}rt=tt=1/0;for(var ot=y.s,at=ot.length,ut=0;ut<at;ut++){var ct=ot[ut];tt=Math.min(ct.x,tt),rt=Math.min(ct.y,rt),ct.freeze()}if(y.freeze(),at===z){for(z=0;z<at;z++)if(ut=E[z],ct=ot[z],ut.x-x!==ct.x-tt||ut.y-b!==ct.y-rt){this.qc();break}}else this.qc();this.Mg=null,x=this.diagram,x!==null&&x.animationManager.zb&&Ri(x.animationManager,this,y),Xm(this),this.g("points",a,y)}},xt.rv=function(){this.Mg!==null&&(this.Nb=this.Mg,this.Mg=null)};function Xm(a){a.Nb.count===0?a.fd=!1:(a.fd=!0,a.cq=null,a.vt=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),$m(a,!1))}xt.bb=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.As.contains(this)||a.undoManager.isUndoingRedoing||(a=a.animationManager,a.isTicking&&!a.isAnimating))return;this.Tg===null||a.isTicking||(this.Tg=null)}a=this.path,a!==null&&(this.fd=!1,this.v(),a.v())}},xt.vg=function(){if(!this.fd&&!this.computingPoints){var a=!0;try{this.computingPoints=!0,this.uh(),a=this.computePoints()}catch(y){this.computingPoints=!1,this.rv()}finally{this.computingPoints=!1,a?this.zf():this.rv()}}},_e.prototype.computePoints=function(){if(this.diagram===null)return!1;var a=this.fromNode,y=null;if(a===null?(Bc||(Bc=new $e,Bc.desiredSize=Rr,Bc.Va()),this.defaultFromPoint&&(Bc.location=this.defaultFromPoint,Bc.Va(),y=a=Bc)):y=this.fromPort,y!==null&&!a.isVisible()){var x=a.findVisibleNode();x!==null&&x!==a?(a=x,y=x.port):a=x}if(this.Lw=a,a===null||!a.location.w())return!1;for(;!(y===null||y.actualBounds.w()&&y.Ed());)y=y.panel;if(y===null)return!1;var b=this.toNode,E=null;if(b===null?(Oc||(Oc=new $e,Oc.desiredSize=Rr,Oc.Va()),this.defaultToPoint&&(Oc.location=this.defaultToPoint,Oc.Va(),E=b=Oc)):E=this.toPort,E===null||b.isVisible()||(x=b.findVisibleNode(),x!==null&&x!==b?(b=x,E=x.port):b=x),this.Mw=b,b===null||!b.location.w())return!1;for(;!(E===null||E.actualBounds.w()&&E.Ed());)E=E.panel;if(E===null)return!1;var z=this.pointsCount,tt=this.computeSpot(!0,y);x=this.computeSpot(!1,E);var rt=Lg(tt),ot=Lg(x),at=y===E&&y!==null,ut=this.isOrthogonal,ct=this.curve===Al;this.Wf=at&&!ut?ct=!0:!1;var mt=this.computeAdjusting()===Ea||at;if(!ut&&!at&&rt&&ot){if(rt=!1,!mt&&3<=z&&(mt=this.getLinkPoint(a,y,tt,!0,!1,b,E),ot=this.getLinkPoint(b,E,x,!1,!1,a,y),rt=this.adjustPoints(0,mt,z-1,ot))&&(mt=this.getLinkPoint(a,y,tt,!0,!1,b,E),ot=this.getLinkPoint(b,E,x,!1,!1,a,y),this.adjustPoints(0,mt,z-1,ot)),!rt)if(this.Fj(),ct){z=this.getLinkPoint(a,y,tt,!0,!1,b,E),mt=this.getLinkPoint(b,E,x,!1,!1,a,y),rt=mt.x-z.x,ot=mt.y-z.y,at=this.computeCurviness(),ct=ut=0;var yt=z.x+rt/3,St=z.y+ot/3,Lt=yt,Ot=St;ne.B(ot,0)?Ot=0<rt?Ot-at:Ot+at:(ut=-rt/ot,ct=Math.sqrt(at*at/(ut*ut+1)),0>at&&(ct=-ct),Lt=(0>ot?-1:1)*ct+yt,Ot=ut*(Lt-yt)+St),yt=z.x+2*rt/3,St=z.y+2*ot/3;var Dt=yt,Gt=St;ne.B(ot,0)?Gt=0<rt?Gt-at:Gt+at:(Dt=(0>ot?-1:1)*ct+yt,Gt=ut*(Dt-yt)+St),this.Fj(),this.ne(z),this.yf(Lt,Ot),this.yf(Dt,Gt),this.ne(mt),this.dd(0,this.getLinkPoint(a,y,tt,!0,!1,b,E)),this.dd(3,this.getLinkPoint(b,E,x,!1,!1,a,y))}else z=b,mt=E,b=this.getLinkPoint(a,y,tt,!0,!1,z,mt),E=this.getLinkPoint(z,mt,x,!1,!1,a,y),this.hasCurviness()?(mt=E.x-b.x,x=E.y-b.y,tt=this.computeCurviness(),a=b.x+mt/2,y=b.y+x/2,z=a,rt=y,ne.B(x,0)?rt=0<mt?rt-tt:rt+tt:(mt=-mt/x,z=Math.sqrt(tt*tt/(mt*mt+1)),0>tt&&(z=-z),z=(0>x?-1:1)*z+a,rt=mt*(z-a)+y),this.ne(b),this.yf(z,rt),this.ne(E)):(this.ne(b),this.ne(E),rt=ye.alloc(),y.mi(rt),ot=rt.ca(E),mt.mi(rt),at=rt.ca(b),(ot||at)&&(tt=y.ga(Jm(tt),new jt),this.dd(0,this.getLinkPointFromPoint(a,y,tt,E,!0,tt)),x=mt.ga(Jm(x),new jt),this.dd(1,this.getLinkPointFromPoint(z,mt,x,b,!1,x))),ye.free(rt))}else{ct=this.isAvoiding,mt&&(ut&&ct||at)&&this.Fj();var Vt=at?this.computeCurviness():0;ct=this.getLinkPoint(a,y,tt,!0,ut,b,E),yt=Lt=St=0,(ut||!rt||at)&&(Ot=this.computeEndSegmentLength(a,y,tt,!0),yt=this.getLinkDirection(a,y,ct,tt,!0,ut,b,E),at&&(rt||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(yt-=ut?90:30,0>Vt&&(yt-=180)),0>yt?yt+=360:360<=yt&&(yt-=360),at&&(Ot+=Math.abs(Vt)*(ut?1:2)),yt===0?St=Ot:yt===90?Lt=Ot:yt===180?St=-Ot:yt===270?Lt=-Ot:(St=Ot*Math.cos(yt*Math.PI/180),Lt=Ot*Math.sin(yt*Math.PI/180)),tt.Mc()&&at&&(Ot=y.ga(Xi,jt.alloc()),Dt=jt.allocAt(Ot.x+1e3*St,Ot.y+1e3*Lt),this.getLinkPointFromPoint(a,y,Ot,Dt,!0,ct),jt.free(Ot),jt.free(Dt))),Ot=this.getLinkPoint(b,E,x,!1,ut,a,y);var Yt=Gt=Dt=0;if(ut||!ot||at){var qt=this.computeEndSegmentLength(b,E,x,!1);Yt=this.getLinkDirection(b,E,Ot,x,!1,ut,a,y),at&&(ot||tt.D(x)||!ut&&tt.x+x.x===1&&tt.y+x.y===1)&&(Yt+=ut?0:30,0>Vt&&(Yt+=180)),0>Yt?Yt+=360:360<=Yt&&(Yt-=360),at&&(qt+=Math.abs(Vt)*(ut?1:2)),Yt===0?Dt=qt:Yt===90?Gt=qt:Yt===180?Dt=-qt:Yt===270?Gt=-qt:(Dt=qt*Math.cos(Yt*Math.PI/180),Gt=qt*Math.sin(Yt*Math.PI/180)),x.Mc()&&at&&(x=E.ga(Xi,jt.alloc()),tt=jt.allocAt(x.x+1e3*Dt,x.y+1e3*Gt),this.getLinkPointFromPoint(b,E,x,tt,!1,Ot),jt.free(x),jt.free(tt))}x=ct,(ut||!rt||at)&&(x=new jt(ct.x+St,ct.y+Lt)),tt=Ot,(ut||!ot||at)&&(tt=new jt(Ot.x+Dt,Ot.y+Gt)),!mt&&!ut&&rt&&3<z&&this.adjustPoints(0,ct,z-2,tt)?this.dd(z-1,Ot):!mt&&!ut&&ot&&3<z&&this.adjustPoints(1,x,z-1,Ot)?this.dd(0,ct):!mt&&(ut?6<=z:4<z)&&this.adjustPoints(1,x,z-2,tt)?(this.dd(0,ct),this.dd(z-1,Ot)):(this.Fj(),this.ne(ct),(ut||!rt||at)&&this.ne(x),ut&&this.addOrthoPoints(x,yt,tt,Yt,a,b),(ut||!ot||at)&&this.ne(tt),this.ne(Ot))}return!0};function Kv(a,y){return Math.abs(y.x-a.x)>Math.abs(y.y-a.y)?(y.x>=a.x?y.x=a.x+9e9:y.x=a.x-9e9,y.y=a.y):(y.y>=a.y?y.y=a.y+9e9:y.y=a.y-9e9,y.x=a.x),y}_e.prototype.getLinkPointFromPoint=function(a,y,x,b,E,z){if(z===void 0&&(z=new jt),a===null||y===null)return z.assign(x),z;if(a.isVisible()||(E=a.findVisibleNode(),E!==null&&E!==a&&(y=E.port)),a=null,E=y.panel,E===null||E.se()||(E=E.panel),E===null){E=b.x,b=b.y;var tt=x.x;x=x.y}else{a=E.oe,E=1/(a.m11*a.m22-a.m12*a.m21),tt=a.m22*E;var rt=-a.m12*E,ot=-a.m21*E,at=a.m11*E,ut=E*(a.m21*a.dy-a.m22*a.dx),ct=E*(a.m12*a.dx-a.m11*a.dy);E=b.x*tt+b.y*ot+ut,b=b.x*rt+b.y*at+ct,tt=x.x*tt+x.y*ot+ut,x=x.x*rt+x.y*at+ct}return y.Sj(E,b,tt,x,z),a!==null&&z.transform(a),z};function Zm(a,y){var x=y.Zn;return x===null&&(x=new Ic,x.port=y,x.node=y.part,y.Zn=x),aS(x,a)}_e.prototype.getLinkPoint=function(a,y,x,b,E,z,tt,rt){if(rt===void 0&&(rt=new jt),x.sb()&&!Lg(x))return y.ga(x,rt),rt;if(x.$c()){var ot=Zm(this,y);if(ot!==null){if(rt.assign(ot.Zo),E&&this.routing===eS){var at=Zm(this,tt);if(at!==null&&ot.Gl<at.Gl){ot=jt.alloc(),at=jt.alloc();var ut=new ye(y.ga(ms,ot),y.ga(Ll,at)),ct=this.computeSpot(!b,tt);a=this.getLinkPoint(z,tt,ct,!b,E,a,y,at),(x.Hf(pd)||x.Hf(fl))&&a.y>=ut.y&&a.y<=ut.y+ut.height?rt.y=a.y:(x.Hf(zh)||x.Hf(Jl))&&a.x>=ut.x&&a.x<=ut.x+ut.width&&(rt.x=a.x),jt.free(ot),jt.free(at)}}return rt}}return x=y.ga(Jm(x),jt.alloc()),this.pointsCount>(E?6:2)?(tt=b?this.i(1):this.i(this.pointsCount-2),E&&(tt=Kv(x,tt.copy()))):(ot=this.computeSpot(!b,tt),z=jt.alloc(),tt=tt.ga(Jm(ot),z),E&&(tt=Kv(x,tt)),jt.free(z)),this.getLinkPointFromPoint(a,y,x,tt,b,rt),jt.free(x),rt},_e.prototype.getLinkDirection=function(a,y,x,b,E,z,tt,rt){t:if(b.sb())var ot=b.x>b.y?b.x>1-b.y?0:b.x<1-b.y?270:315:b.x<b.y?b.x>1-b.y?90:b.x<1-b.y?180:135:.5>b.x?225:.5<b.x?45:0;else{if(b.$c()&&(ot=Zm(this,y),ot!==null))switch(ot.Nc){case 1:ot=270;break t;case 2:ot=180;break t;default:case 4:ot=0;break t;case 8:ot=90;break t}ot=y.ga(Xi,jt.alloc()),this.pointsCount>(z?6:2)?(rt=E?this.i(1):this.i(this.pointsCount-2),rt=z?Kv(ot,rt.copy()):x):(x=jt.alloc(),rt=rt.ga(Xi,x),jt.free(x)),x=Math.abs(rt.x-ot.x)>Math.abs(rt.y-ot.y)?rt.x>=ot.x?0:180:rt.y>=ot.y?90:270,jt.free(ot),ot=x}return b.Mc()&&tt.Td(a)&&(ot+=180,360<=ot&&(ot-=360)),Lg(b)||(a=y.li(),a===0)||(45<=a&&135>a?ot+=90:135<=a&&225>a?ot+=180:225<=a&&315>a&&(ot+=270),360<=ot&&(ot-=360)),ot},_e.prototype.computeEndSegmentLength=function(a,y,x,b){return y!==null&&x.$c()&&(a=Zm(this,y),a!==null)?a.Ju:(a=b?this.fromEndSegmentLength:this.toEndSegmentLength,y!==null&&isNaN(a)&&(a=b?y.fromEndSegmentLength:y.toEndSegmentLength),isNaN(a)&&(a=10),a)},_e.prototype.computeSpot=function(a,y){return y===void 0&&(y=null),a?(a=y||this.fromPort,a===null?a=Xi:(y=this.fromSpot,y.Xb()&&(y=a.fromSpot),a=y===vs?us:y)):(a=y||this.toPort,a===null?a=Xi:(y=this.toSpot,y.Xb()&&(y=a.toSpot),a=y===vs?us:y)),a};function Lg(a){return a===us||a.x===.5&&a.y===.5}function Jm(a){return a.x===.5&&a.y===.5?a:Xi}_e.prototype.computeOtherPoint=function(a,y){return this.computeAdjusting()!==Ea&&4<this.pointsCount?this.computeMidPoint(new jt):(a=y.Zn,a=a!==null?aS(a,this):null,a!==null?a.Zo:y.ga(Xi))},_e.prototype.computeShortLength=function(a){if(a){if(a=this.fromShortLength,isNaN(a)){var y=this.fromPort;y!==null&&(a=y.fromShortLength)}return isNaN(a)?0:a}return a=this.toShortLength,isNaN(a)&&(y=this.toPort,y!==null&&(a=y.toShortLength)),isNaN(a)?0:a},_e.prototype.Cf=function(a,y,x,b,E,z){if(this.pickable===!1)return!1;y===void 0&&(y=null),x===void 0&&(x=null);var tt=z;if(z===void 0&&(tt=oi.alloc(),tt.reset()),tt.multiply(this.transform),this.fh(a,tt))return mv(this,y,x,E),z===void 0&&oi.free(tt),!0;if(this.Yc(a,tt)){var rt=!1;if(!this.isAtomic)for(var ot=this.O.s,at=ot.length;at--;){var ut=ot[at];if(ut.visible||ut===this.locationObject){var ct=ut.actualBounds,mt=this.naturalBounds;if(!(ct.x>mt.width||ct.y>mt.height||0>ct.x+ct.width||0>ct.y+ct.height)){if(ct=oi.alloc(),ct.set(tt),ut instanceof Re)rt=ut.Cf(a,y,x,b,E,ct);else if(this.path===ut){if(ut instanceof Qn)if(rt=a,mt=b,ut.pickable===!1)rt=!1;else if(ct.multiply(ut.transform),mt)t:{var yt=rt,St=ct;if(ut.fh(yt,St))rt=!0;else{if(St===void 0&&(St=ut.transform,yt.Re(ut.actualBounds))){rt=!0;break t}rt=yt.left,mt=yt.right;var Lt=yt.top;yt=yt.bottom;var Ot=jt.alloc(),Dt=jt.alloc(),Gt=jt.alloc(),Vt=oi.alloc();Vt.set(St),Vt.bv(ut.transform),Vt.Vj(),Dt.x=mt,Dt.y=Lt,Dt.transform(Vt),Ot.x=rt,Ot.y=Lt,Ot.transform(Vt),St=!1,ec(ut,Ot,Dt,Gt)?St=!0:(Ot.x=mt,Ot.y=yt,Ot.transform(Vt),ec(ut,Ot,Dt,Gt)?St=!0:(Dt.x=rt,Dt.y=yt,Dt.transform(Vt),ec(ut,Ot,Dt,Gt)?St=!0:(Ot.x=rt,Ot.y=Lt,Ot.transform(Vt),ec(ut,Ot,Dt,Gt)&&(St=!0)))),oi.free(Vt),jt.free(Ot),jt.free(Dt),jt.free(Gt),rt=St}}else rt=ut.fh(rt,ct)}else rt=hs(ut,a,b,ct);rt&&(mt=ut,y!==null&&(mt=y(ut)),mt&&(x===null||x(mt))&&E.add(mt)),oi.free(ct)}}}return z===void 0&&oi.free(tt),rt||this.background!==null||this.areaBackground!==null}return z===void 0&&oi.free(tt),!1},_e.prototype.computeCurve=function(){if(this.Wf===null){var a=this.fromPort,y=this.isOrthogonal;this.Wf=a!==null&&a===this.toPort&&!y}return this.Wf?Al:this.curve},_e.prototype.computeCorner=function(){if(this.curve===Al)return 0;var a=this.corner;return(isNaN(a)||0>a)&&(a=10),a},_e.prototype.findMidLabel=function(){for(var a=this.path,y=this.O.s,x=y.length,b=0;b<x;b++){var E=y[b];if(E!==a&&!E.isPanelMain&&(E.segmentIndex===-1/0||isNaN(E.segmentIndex)))return E}for(a=this.labelNodes;a.next();)if(y=a.value,y.segmentIndex===-1/0||isNaN(y.segmentIndex))return y;return null},_e.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=iS;a=Math.max(a,this.computeThickness());var y=this.fromPort,x=this.toPort;if(y!==null&&x!==null){var b=this.findMidLabel();if(b!==null){var E=b.naturalBounds,z=b.margin,tt=isNaN(E.width)?30:E.width*b.scale+z.left+z.right;E=isNaN(E.height)?14:E.height*b.scale+z.top+z.bottom,b=b.segmentOrientation,b===Cp||b===e0||b===Qv?a=Math.max(a,E):b===Mp||b===bp||b===Lp||b===kp?a=Math.max(a,tt):(y=y.ga(Xi).ab(x.ga(Xi))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(y)*tt)+Math.abs(Math.cos(y)*E)+1)),this.curve===Al&&(a*=1.333)}}return a},_e.prototype.arrangeBundledLinks=function(a,y){if(y)for(y=0;y<a.length;y++){var x=a[y];x.computeAdjusting()===Ea&&x.bb()}},_e.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=nS;var y=this.Sf;if(y!==null){for(var x=Kn(),b=0,E=y.links,z=0;z<E.length;z++){var tt=E[z].computeSpacing();x.push(tt),b+=tt}for(b=-b/2,z=0;z<E.length;z++){if(E[z]===this){a=b+x[z]/2;break}b+=x[z]}y.Ds===this.fromNode&&(a=-a),zn(x)}}return a},_e.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return a!==null?Math.max(a.strokeWidth,1):1},_e.prototype.hasCurviness=function(){return!isNaN(this.curviness)||this.Sf!==null},_e.prototype.adjustPoints=function(a,y,x,b){var E=this.computeAdjusting();if(this.isOrthogonal){if(E===qm)return!1;E===t0&&(E=wp)}switch(E){case qm:var z=this.i(a),tt=this.i(x);if(!z.Xa(y)||!tt.Xa(b)){E=z.x,z=z.y;var rt=tt.x-E,ot=tt.y-z,at=Math.sqrt(rt*rt+ot*ot);if(!ne.$(at,0)){if(ne.$(rt,0))var ut=0>ot?-Math.PI/2:Math.PI/2;else ut=Math.atan(ot/Math.abs(rt)),0>rt&&(ut=Math.PI-ut);tt=y.x;var ct=y.y;rt=b.x-tt;var mt=b.y-ct;for(ot=Math.sqrt(rt*rt+mt*mt),ne.$(rt,0)?mt=0>mt?-Math.PI/2:Math.PI/2:(mt=Math.atan(mt/Math.abs(rt)),0>rt&&(mt=Math.PI-mt)),at=ot/at,ut=mt-ut,this.dd(a,y),a+=1;a<x;a++)y=this.i(a),rt=y.x-E,ot=y.y-z,y=Math.sqrt(rt*rt+ot*ot),ne.$(y,0)||(ne.$(rt,0)?ot=0>ot?-Math.PI/2:Math.PI/2:(ot=Math.atan(ot/Math.abs(rt)),0>rt&&(ot=Math.PI-ot)),rt=ot+ut,y*=at,this.L(a,tt+y*Math.cos(rt),ct+y*Math.sin(rt)));this.dd(x,b)}}return!0;case t0:if(z=this.i(a),ct=this.i(x),!z.Xa(y)||!ct.Xa(b)){E=z.x,z=z.y,tt=ct.x,ct=ct.y,at=(tt-E)*(tt-E)+(ct-z)*(ct-z),rt=y.x,ut=y.y,ot=b.x,mt=b.y;var yt=1;if(ot-rt!==0){var St=(mt-ut)/(ot-rt);yt=Math.sqrt(1+1/(St*St))}else St=9e9;for(this.dd(a,y),a+=1;a<x;a++){y=this.i(a);var Lt=y.x,Ot=y.y,Dt=.5;at!==0&&(Dt=((E-Lt)*(E-tt)+(z-Ot)*(z-ct))/at);var Gt=E+Dt*(tt-E),Vt=z+Dt*(ct-z);y=Math.sqrt((Lt-Gt)*(Lt-Gt)+(Ot-Vt)*(Ot-Vt)),Ot<St*(Lt-Gt)+Vt&&(y=-y),0<St&&(y=-y),Lt=rt+Dt*(ot-rt),Dt=ut+Dt*(mt-ut),St!==0?(y=Lt+y/yt,this.L(a,y,Dt-(y-Lt)/St)):this.L(a,Lt,Dt+y)}this.dd(x,b)}return!0;case wp:t:{if(this.isOrthogonal&&(E=this.i(a),z=this.i(a+1),tt=this.i(a+2),rt=z.x,ut=z.y,ct=rt,at=ut,ne.B(E.y,z.y)?ne.B(z.x,tt.x)?ut=y.y:ne.B(z.y,tt.y)&&(rt=y.x):ne.B(E.x,z.x)&&(ne.B(z.y,tt.y)?rt=y.x:ne.B(z.x,tt.x)&&(ut=y.y)),this.L(a+1,rt,ut),E=this.i(x),z=this.i(x-1),tt=this.i(x-2),rt=z.x,ut=z.y,ot=rt,mt=ut,ne.B(E.y,z.y)?ne.B(z.x,tt.x)?ut=b.y:ne.B(z.y,tt.y)&&(rt=b.x):ne.B(E.x,z.x)&&(ne.B(z.y,tt.y)?rt=b.x:ne.B(z.x,tt.x)&&(ut=b.y)),this.L(x-1,rt,ut),Yv(this))){this.L(a+1,ct,at),this.L(x-1,ot,mt),x=!1;break t}this.dd(a,y),this.dd(x,b),x=!0}return x;default:return!1}},_e.prototype.addOrthoPoints=function(a,y,x,b,E,z){0>y?y+=360:360<=y&&(y-=360),0>b?b+=360:360<=b&&(b-=360);var tt=b;y=315<=y||45>y?0:45<=y&&135>y?90:135<=y&&225>y?180:270,b=315<=b||45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;var rt=E.actualBounds.copy(),ot=z.actualBounds.copy();if(rt.w()&&ot.w()){rt.Bc(Ep,Ep),ot.Bc(Ep,Ep),rt.Ye(a),ot.Ye(x);var at=jt.alloc(),ut=jt.alloc();y===0?x.x>a.x||b===270&&x.y<a.y&&ot.right>a.x||b===90&&x.y>a.y&&ot.right>a.x?(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),b===180?(at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=at.x,ut.y=x.y):b===270&&x.y<a.y||b===90&&x.y>a.y?(at.x=a.x<ot.left?this.computeMidOrthoPosition(a.x,a.y,ot.left,x.y,!1):a.x<ot.right&&(b===270&&a.y<ot.top||b===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.right,ut.x=at.x,ut.y=x.y):b===0&&a.x<ot.left&&a.y>ot.top&&a.y<ot.bottom&&(at.x=a.x,at.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=at.y)):(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(b===180||b===90&&x.y<rt.top||b===270&&x.y>rt.bottom)&&(b===180&&(ot.ca(a)||rt.ca(x))?at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(b===180||b===90)?at.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(b===180||b===270)&&(at.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=at.y),at.y>rt.top&&at.y<rt.bottom&&(x.x>=rt.left&&x.x<=a.x||a.x<=ot.right&&a.x>=x.x?(b===90||b===270)&&(at.h(Math.max((a.x+x.x)/2,a.x),a.y),ut.h(at.x,x.y)):(at.y=b===270||(b===0||b===180)&&x.y<a.y?Math.min(x.y,b===0?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,b===0?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=at.y))):y===180?x.x<a.x||b===270&&x.y<a.y&&ot.left<a.x||b===90&&x.y>a.y&&ot.left<a.x?(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),b===0?(at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1),ut.x=at.x,ut.y=x.y):b===270&&x.y<a.y||b===90&&x.y>a.y?(at.x=a.x>ot.right?this.computeMidOrthoPosition(a.x,a.y,ot.right,x.y,!1):a.x>ot.left&&(b===270&&a.y<ot.top||b===90&&a.y>ot.bottom)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):ot.left,ut.x=at.x,ut.y=x.y):b===180&&a.x>ot.right&&a.y>ot.top&&a.y<ot.bottom&&(at.x=a.x,at.y=a.y<x.y?Math.min(x.y,ot.top):Math.max(x.y,ot.bottom),ut.y=at.y)):(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),(b===0||b===90&&x.y<rt.top||b===270&&x.y>rt.bottom)&&(b===0&&(ot.ca(a)||rt.ca(x))?at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):x.y<a.y&&(b===0||b===90)?at.y=this.computeMidOrthoPosition(a.x,rt.top,x.x,Math.max(x.y,ot.bottom),!0):x.y>a.y&&(b===0||b===270)&&(at.y=this.computeMidOrthoPosition(a.x,rt.bottom,x.x,Math.min(x.y,ot.top),!0)),ut.x=x.x,ut.y=at.y),at.y>rt.top&&at.y<rt.bottom&&(x.x<=rt.right&&x.x>=a.x||a.x>=ot.left&&a.x<=x.x?(b===90||b===270)&&(at.h(Math.min((a.x+x.x)/2,a.x),a.y),ut.h(at.x,x.y)):(at.y=b===270||(b===0||b===180)&&x.y<a.y?Math.min(x.y,b===180?rt.top:Math.min(rt.top,ot.top)):Math.max(x.y,b===180?rt.bottom:Math.max(rt.bottom,ot.bottom)),ut.x=x.x,ut.y=at.y))):y===90?x.y>a.y||b===180&&x.x<a.x&&ot.bottom>a.y||b===0&&x.x>a.x&&ot.bottom>a.y?(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),b===270?(at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=at.y):b===180&&x.x<a.x||b===0&&x.x>a.x?(at.y=a.y<ot.top?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.top,!0):a.y<ot.bottom&&(b===180&&a.x<ot.left||b===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.bottom,ut.x=x.x,ut.y=at.y):b===90&&a.y<ot.top&&a.x>ot.left&&a.x<ot.right&&(at.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),at.y=a.y,ut.x=at.x)):(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(b===270||b===0&&x.x<rt.left||b===180&&x.x>rt.right)&&(b===270&&(ot.ca(a)||rt.ca(x))?at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(b===270||b===0)?at.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(b===270||b===180)&&(at.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=at.x,ut.y=x.y),at.x>rt.left&&at.x<rt.right&&(x.y>=rt.top&&x.y<=a.y||a.y<=ot.bottom&&a.y>=x.y?(b===0||b===180)&&(at.h(a.x,Math.max((a.y+x.y)/2,a.y)),ut.h(x.x,at.y)):(at.x=b===180||(b===90||b===270)&&x.x<a.x?Math.min(x.x,b===90?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,b===90?rt.right:Math.max(rt.right,ot.right)),ut.x=at.x,ut.y=x.y))):x.y<a.y||b===180&&x.x<a.x&&ot.top<a.y||b===0&&x.x>a.x&&ot.top<a.y?(at.h(a.x,x.y),ut.h((a.x+x.x)/2,x.y),b===90?(at.y=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0),ut.x=x.x,ut.y=at.y):b===180&&x.x<a.x||b===0&&x.x>=a.x?(at.y=a.y>ot.bottom?this.computeMidOrthoPosition(a.x,a.y,x.x,ot.bottom,!0):a.y>ot.top&&(b===180&&a.x<ot.left||b===0&&a.x>ot.right)?this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!0):ot.top,ut.x=x.x,ut.y=at.y):b===270&&a.y>ot.bottom&&a.x>ot.left&&a.x<ot.right&&(at.x=a.x<x.x?Math.min(x.x,ot.left):Math.max(x.x,ot.right),at.y=a.y,ut.x=at.x)):(at.h(x.x,a.y),ut.h(x.x,(a.y+x.y)/2),(b===90||b===0&&x.x<rt.left||b===180&&x.x>rt.right)&&(b===90&&(ot.ca(a)||rt.ca(x))?at.x=this.computeMidOrthoPosition(a.x,a.y,x.x,x.y,!1):x.x<a.x&&(b===90||b===0)?at.x=this.computeMidOrthoPosition(rt.left,a.y,Math.max(x.x,ot.right),x.y,!1):x.x>a.x&&(b===90||b===180)&&(at.x=this.computeMidOrthoPosition(rt.right,a.y,Math.min(x.x,ot.left),x.y,!1)),ut.x=at.x,ut.y=x.y),at.x>rt.left&&at.x<rt.right&&(x.y<=rt.bottom&&x.y>=a.y||a.y>=ot.top&&a.y<=x.y?(b===0||b===180)&&(at.h(a.x,Math.min((a.y+x.y)/2,a.y)),ut.h(x.x,at.y)):(at.x=b===180||(b===90||b===270)&&x.x<a.x?Math.min(x.x,b===270?rt.left:Math.min(rt.left,ot.left)):Math.max(x.x,b===270?rt.right:Math.max(rt.right,ot.right)),ut.x=at.x,ut.y=x.y)));var ct=x;if(this.isAvoiding){var mt=this.diagram;if(mt===null||E===z||this.layer.isTemporary||!rg(mt)||rt.ca(ct)&&!z.Td(E)||ot.ca(a)&&!E.Td(z))y=!1;else{var yt=og(mt,!0,this.containingGroup,null);if(this.segmentIndex!==17&&yt.Yj(Math.min(a.x,at.x),Math.min(a.y,at.y),Math.abs(a.x-at.x),Math.abs(a.y-at.y))&&yt.Yj(Math.min(at.x,ut.x),Math.min(at.y,ut.y),Math.abs(at.x-ut.x),Math.abs(at.y-ut.y))&&yt.Yj(Math.min(ut.x,ct.x),Math.min(ut.y,ct.y),Math.abs(ut.x-ct.x),Math.abs(ut.y-ct.y)))y=!1;else{E=a,z=ct;var St=x=null;if(mt.isVirtualized){mt=yt.bounds.copy(),mt.Bc(-yt.Ho,-yt.Go);var Lt=jt.alloc();kg(yt,a.x,a.y)||(ne.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,a.x,a.y,at.x,at.y,Lt)?(x=a=Lt.copy(),y=Lt.ab(at)):ne.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,ut.x,ut.y,Lt)?(x=a=Lt.copy(),y=Lt.ab(ut)):ne.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,ct.x,ct.y,Lt)&&(x=a=Lt.copy(),y=Lt.ab(ct))),kg(yt,ct.x,ct.y)||(ne.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ct.x,ct.y,ut.x,ut.y,Lt)?(St=ct=Lt.copy(),b=ut.ab(Lt)):ne.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,ut.x,ut.y,at.x,at.y,Lt)?(St=ct=Lt.copy(),b=at.ab(Lt)):ne.Ff(mt.x,mt.y,mt.x+mt.width,mt.y+mt.height,at.x,at.y,a.x,a.y,Lt)&&(St=ct=Lt.copy(),b=a.ab(Lt))),jt.free(Lt)}rt=rt.copy().ed(ot),rt.Bc(yt.Ho*yt.Os,yt.Go*yt.Os),oS(yt,a,y,ct,b,rt,!0),ot=Eh(yt,ct.x,ct.y),!yt.abort&&ot>=bg&&(rS(yt),rt.Bc(yt.Ho*yt.Hx,yt.Go*yt.Ix),oS(yt,a,y,ct,b,rt,!1),ot=Eh(yt,ct.x,ct.y)),!yt.abort&&ot<bg&&Eh(yt,ct.x,ct.y)!==Nd?(Xv(this,yt,ct.x,ct.y,b,!0,tt),rt=this.i(2),4>this.pointsCount?(y===0||y===180?(rt.x=a.x,rt.y=ct.y):(rt.x=ct.x,rt.y=a.y),this.L(2,rt.x,rt.y),this.m(3,rt.x,rt.y)):(tt=this.i(3),y===0||y===180?ne.B(rt.x,tt.x)?(rt=y===0?Math.max(rt.x,a.x):Math.min(rt.x,a.x),this.L(2,rt,a.y),this.L(3,rt,tt.y)):ne.B(rt.y,tt.y)?(Math.abs(a.y-rt.y)<=yt.Go/2&&(this.L(2,rt.x,a.y),this.L(3,tt.x,a.y)),this.m(2,rt.x,a.y)):this.L(2,a.x,rt.y):(y===90||y===270)&&(ne.B(rt.y,tt.y)?(rt=y===90?Math.max(rt.y,a.y):Math.min(rt.y,a.y),this.L(2,a.x,rt),this.L(3,tt.x,rt)):ne.B(rt.x,tt.x)?(Math.abs(a.x-rt.x)<=yt.Ho/2&&(this.L(2,a.x,rt.y),this.L(3,a.x,tt.y)),this.m(2,a.x,rt.y)):this.L(2,rt.x,a.y))),x!==null&&(a=this.i(1),tt=this.i(2),a.x!==tt.x&&a.y!==tt.y?y===0||y===180?this.m(2,a.x,tt.y):this.m(2,tt.x,a.y):y===0||y===180?this.m(2,E.x,x.y):this.m(2,x.x,E.y)),St!==null&&(b===0||b===180?this.yf(z.x,St.y):this.yf(St.x,z.y)),y=!0):y=!1}}}else y=!1;y||(this.ne(at.copy()),this.ne(ut.copy())),jt.free(at),jt.free(ut)}},_e.prototype.computeMidOrthoPosition=function(a,y,x,b,E){var z=0;return!this.hasCurviness()||this.computeSpot(!0,this.fromPort).$c()||this.computeSpot(!1,this.toPort).$c()||(z=this.computeCurviness()),E?(y+b)/2+z:(a+x)/2+z};function Yv(a){if(a.diagram===null||!a.isAvoiding||!rg(a.diagram))return!1;var y=a.points.s,x=y.length;if(4>x)return!1;a=og(a.diagram,!0,a.containingGroup,null);for(var b=1;b<x-2;b++){var E=y[b],z=y[b+1];if(!a.Yj(Math.min(E.x,z.x),Math.min(E.y,z.y),Math.abs(E.x-z.x),Math.abs(E.y-z.y)))return!0}return!1}function Xv(a,y,x,b,E,z,tt){var rt=y.Ho,ot=y.Go,at=Eh(y,x,b),ut=x,ct=b;for(E===0?ut+=rt:E===90?ct+=ot:E===180?ut-=rt:ct-=ot,E!==tt&&at>rc&&Eh(y,ut,ct)!==at-1&&(Eh(y,x-rt,b)===at-1?(E=180,ut=x-rt,ct=b):Eh(y,x+rt,b)===at-1?(E=0,ut=x+rt,ct=b):Eh(y,x,b-ot)===at-1?(E=270,ut=x,ct=b-ot):Eh(y,x,b+ot)===at-1&&(E=90,ut=x,ct=b+ot));at>rc&&Eh(y,ut,ct)===at-1;)x=ut,b=ct,E===0?ut+=rt:E===90?ct+=ot:E===180?ut-=rt:ct-=ot,--at;z?at>rc&&(E===180||E===0?x=Math.floor(x/rt)*rt+rt/2:(E===90||E===270)&&(b=Math.floor(b/ot)*ot+ot/2)):(x=Math.floor(x/rt)*rt+rt/2,b=Math.floor(b/ot)*ot+ot/2),at>rc&&(z=E,tt=x,ut=b,E===0?(z=90,ut+=ot):E===90?(z=180,tt-=rt):E===180?(z=270,ut-=ot):E===270&&(z=0,tt+=rt),Eh(y,tt,ut)===at-1?Xv(a,y,tt,ut,z,!1,z):(tt=x,ut=b,E===0?(z=270,ut-=ot):E===90?(z=0,tt+=rt):E===180?(z=90,ut+=ot):E===270&&(z=180,tt-=rt),Eh(y,tt,ut)===at-1&&Xv(a,y,tt,ut,z,!1,z))),a.yf(x,b)}_e.prototype.ez=function(a){var y=a.x;a=a.y;for(var x=this.i(0),b=this.i(1),E=gs(y,a,x.x,x.y,b.x,b.y),z=0,tt=1;tt<this.pointsCount-1;tt++){x=this.i(tt+1);var rt=gs(y,a,b.x,b.y,x.x,x.y);b=x,rt<E&&(z=tt,E=rt)}return z},_e.prototype.qc=function(){this.lk=!1,this.v()},_e.prototype.Ul=function(a){if(!(!a&&(this.fd===!1||(a=this.Pb(),this.lk&&(a===null||a.geometry!==null))))&&(2>this.pointsCount?this.lk=!0:this.ua=this.makeGeometry(),a=this.path,a!==null)){a.ua=this.ua;for(var y=this.O.s,x=y.length,b=0;b<x;b++){var E=y[b];E!==a&&E.isPanelMain&&E instanceof Qn&&(E.ua=this.ua)}}},_e.prototype.makeGeometry=function(){var a=this.ua,y=this.pointsCount,x=!1,b=this.diagram;b!==null&&ic(this)&&b.Eh.contains(this)&&(this.ml.width!==0||this.ml.height!==0)&&(b.animationManager.isAnimating||b.currentTool!==b.toolManager)&&(x=!0);var E=this.i(0).copy(),z=E.copy();b=this.Nb.s;var tt=this.computeCurve();if(tt===Al&&3<=y&&!ne.$(this.smoothness,0))if(y===3){var rt=this.i(1);b=Math.min(E.x,rt.x);var ot=Math.min(E.y,rt.y);rt=this.i(2),b=Math.min(b,rt.x),ot=Math.min(ot,rt.y)}else{if(this.isOrthogonal)for(ot=0;ot<y;ot++)rt=b[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);else for(b=3;b<y;b+=3)b+3>=y&&(b=y-1),ot=this.i(b),z.x=Math.min(ot.x,z.x),z.y=Math.min(ot.y,z.y);b=z.x,ot=z.y}else{for(ot=0;ot<y;ot++)rt=b[ot],z.x=Math.min(rt.x,z.x),z.y=Math.min(rt.y,z.y);b=z.x,ot=z.y}if(b-=this.su.x,ot-=this.su.y,E.x-=b,E.y-=ot,y!==2||ic(this)){if(a.type=We.o,rt=T1(a),this.computeShortLength(!0)!==0&&(E=Dc(this,E,!0,z)),wg(rt,E.x,E.y,!1),tt===Al&&3<=y&&!ne.$(this.smoothness,0))if(y===3)x=this.i(1),y=x.x-b,x=x.y-ot,E=this.i(2).copy(),E.x-=b,E.y-=ot,this.computeShortLength(!1)!==0&&(E=Dc(this,E,!1,z)),kd(rt,y,x,y,x,E.x,E.y);else if(this.isOrthogonal){y=jt.allocAt(b,ot),x=jt.alloc(),x.assign(this.i(1)),z=jt.allocAt(b,ot),E=jt.allocAt(b,ot),tt=this.i(0);for(var at,ut=this.smoothness/3,ct=1;ct<this.pointsCount-1;ct++){at=this.i(ct);var mt=tt,yt=at,St=this.i(Zv(this,at,ct,!1));if((!ne.$(mt.x,yt.x)||!ne.$(yt.x,St.x))&&(!ne.$(mt.y,yt.y)||!ne.$(yt.y,St.y))){var Lt=ut;isNaN(Lt)&&(Lt=this.smoothness/3);var Ot=mt.x;mt=mt.y;var Dt=yt.x;yt=yt.y;var Gt=St.x;St=St.y;var Vt=Lt*Qm(Ot,mt,Dt,yt);Lt*=Qm(Dt,yt,Gt,St),ne.$(mt,yt)&&ne.$(Dt,Gt)&&(Dt>Ot?St>yt?(z.x=Dt-Vt,z.y=yt-Vt,E.x=Dt+Lt,E.y=yt+Lt):(z.x=Dt-Vt,z.y=yt+Vt,E.x=Dt+Lt,E.y=yt-Lt):St>yt?(z.x=Dt+Vt,z.y=yt-Vt,E.x=Dt-Lt,E.y=yt+Lt):(z.x=Dt+Vt,z.y=yt+Vt,E.x=Dt-Lt,E.y=yt-Lt)),ne.$(Ot,Dt)&&ne.$(yt,St)&&(yt>mt?(Gt>Dt?(z.x=Dt-Vt,z.y=yt-Vt,E.x=Dt+Lt):(z.x=Dt+Vt,z.y=yt-Vt,E.x=Dt-Lt),E.y=yt+Lt):(Gt>Dt?(z.x=Dt-Vt,z.y=yt+Vt,E.x=Dt+Lt):(z.x=Dt+Vt,z.y=yt+Vt,E.x=Dt-Lt),E.y=yt-Lt)),(ne.$(Ot,Dt)&&ne.$(Dt,Gt)||ne.$(mt,yt)&&ne.$(yt,St))&&(Ot=.5*(Ot+Gt),mt=.5*(mt+St),z.x=Ot,z.y=mt,E.x=Ot,E.y=mt),(ct===1||ct===2&&ne.$(tt.x,this.i(0).x)&&ne.$(tt.y,this.i(0).y))&&(x.x=.5*(tt.x+at.x),x.y=.5*(tt.y+at.y)),kd(rt,x.x-b,x.y-ot,z.x-b,z.y-ot,at.x-b,at.y-ot),y.set(z),x.set(E),tt=at}}at=tt.x,tt=tt.y,ut=this.i(this.pointsCount-1),this.computeShortLength(!1)!==0&&(ut=Dc(this,ut.copy(),!1,cs)),at=.5*(at+ut.x),tt=.5*(tt+ut.y),kd(rt,E.x-b,E.y-ot,at-b,tt-ot,ut.x-b,ut.y-ot),jt.free(y),jt.free(x),jt.free(z),jt.free(E)}else for(x=3;x<y;x+=3)z=this.i(x-2),x+3>=y&&(x=y-1),E=this.i(x-1),tt=this.i(x),x===y-1&&this.computeShortLength(!1)!==0&&(tt=Dc(this,tt.copy(),!1,cs)),kd(rt,z.x-b,z.y-ot,E.x-b,E.y-ot,tt.x-b,tt.y-ot);else{for(z=jt.alloc(),z.assign(this.i(0)),E=jt.alloc(),E.assign(z),tt=this.computeCorner(),ct=1,at=0;ct<y;){if(ct=Zv(this,z,ct,1<ct),ut=this.i(ct),ct>=y-1){if(!z.D(ut))this.computeShortLength(!1)!==0&&(ut=Dc(this,ut.copy(),!1,cs)),Ac(this,rt,-b,-ot,z,ut,x);else if(at===0)for(ct=1;ct<y;)E.assign(z),ut=this.i(ct++),Ac(this,rt,-b,-ot,z,ut,x),z.assign(ut);break}if(at=Zv(this,ut,ct+1,ct<y-3),ct=-b,Ot=-ot,mt=ut,Dt=this.i(at),Lt=x,ne.B(z.y,mt.y)&&ne.B(mt.x,Dt.x))if(St=Math.min(tt,Math.abs(mt.x-E.x)/2),St=Vt=Math.min(St,Math.abs(Dt.y-mt.y)/2),ne.B(St,0))Ac(this,rt,ct,Ot,z,mt,Lt),z.assign(mt);else{var Yt=mt.x,qt=mt.y;yt=Yt,Gt=qt,mt.x>z.x?Yt=mt.x-St:Yt=mt.x+St,Dt.y>mt.y?Gt=mt.y+Vt:Gt=mt.y-Vt,Dt=jt.allocAt(Yt,qt),Ac(this,rt,ct,Ot,z,Dt,Lt),jt.free(Dt),_m(rt,mt.x+ct,mt.y+Ot,yt+ct,Gt+Ot),z.h(yt,Gt)}else ne.B(z.x,mt.x)&&ne.B(mt.y,Dt.y)?(St=Math.min(tt,Math.abs(mt.y-E.y)/2),St=Vt=Math.min(St,Math.abs(Dt.x-mt.x)/2),ne.B(Vt,0)?(Ac(this,rt,ct,Ot,z,mt,Lt),z.assign(mt)):(Yt=mt.x,qt=mt.y,yt=Yt,Gt=qt,mt.y>z.y?qt=mt.y-St:qt=mt.y+St,Dt.x>mt.x?yt=mt.x+Vt:yt=mt.x-Vt,Dt=jt.allocAt(Yt,qt),Ac(this,rt,ct,Ot,z,Dt,Lt),jt.free(Dt),_m(rt,mt.x+ct,mt.y+Ot,yt+ct,Gt+Ot),z.h(yt,Gt))):(Ac(this,rt,ct,Ot,z,mt,Lt),z.assign(mt));E.assign(ut),ct=at}jt.free(z)}Hm=rt}else rt=this.i(1).copy(),rt.x-=b,rt.y-=ot,this.computeShortLength(!0)!==0&&(E=Dc(this,E,!0,z)),this.computeShortLength(!1)!==0&&(rt=Dc(this,rt,!1,z)),a.type=We.j,a.startX=E.x,a.startY=E.y,a.endX=rt.x,a.endY=rt.y;return this.lk=!0,a};function Qm(a,y,x,b){return a=x-a,isNaN(a)||a===1/0||a===-1/0?NaN:(0>a&&(a=-a),y=b-y,isNaN(y)||y===1/0||y===-1/0?NaN:(0>y&&(y=-y),ne.$(a,0)?y:ne.$(y,0)?a:Math.sqrt(a*a+y*y)))}function Dc(a,y,x,b){var E=a.pointsCount;if(2>E)return y;if(x){var z=a.i(1);if(x=z.x-b.x,z=z.y-b.y,b=Qm(y.x,y.y,x,z),b===0)return y;E=E===2?.5*b:b,a=a.computeShortLength(!0),a>E&&(a=E),E=a*(z-y.y)/b,y.x+=a*(x-y.x)/b,y.y+=E}else{if(z=a.i(E-2),x=z.x-b.x,z=z.y-b.y,b=Qm(y.x,y.y,x,z),b===0)return y;E=E===2?.5*b:b,a=a.computeShortLength(!1),a>E&&(a=E),E=a*(y.y-z)/b,y.x-=a*(y.x-x)/b,y.y-=E}return y}function Zv(a,y,x,b){for(var E=a.pointsCount,z=y;ne.$(y.x,z.x)&&ne.$(y.y,z.y);){if(x>=E)return E-1;z=a.i(x++)}if(!ne.$(y.x,z.x)&&!ne.$(y.y,z.y))return x-1;for(var tt=z;ne.$(y.x,z.x)&&ne.$(z.x,tt.x)&&(!b||(y.y>=z.y?z.y>=tt.y:z.y<=tt.y))||ne.$(y.y,z.y)&&ne.$(z.y,tt.y)&&(!b||(y.x>=z.x?z.x>=tt.x:z.x<=tt.x));){if(x>=E)return E-1;tt=a.i(x++)}return x-2}_e.prototype.computeJumpLength=function(){return 10};function Ac(a,y,x,b,E,z,tt){if(!tt&&ic(a)){tt=a.computeJumpLength();var rt=tt/2,ot=[],at=0;if(a.isVisible()&&(at=Mx(a,E,z,ot)),0<at){if(ne.B(E.y,z.y))if(E.x<z.x)for(var ut=0;ut<at;){var ct=Math.max(E.x,Math.min(ot[ut++]-rt,z.x-tt));y.lineTo(ct+x,z.y+b);for(var mt=ct+x,yt=Math.min(ct+tt,z.x);ut<at&&(ct=ot[ut],ct<yt+tt);)ut++,yt=Math.min(ct+rt,z.x);ct=z.y-tt+b,yt+=x;var St=z.y+b;a.curve===Td?wg(y,yt,St,!1):kd(y,mt,ct,yt,ct,yt,St)}else for(--at;0<=at;){for(ut=Math.min(E.x,Math.max(ot[at--]+rt,z.x+tt)),y.lineTo(ut+x,z.y+b),mt=ut+x,ct=Math.max(ut-tt,z.x);0<=at&&(ut=ot[at],ut>ct-tt);)at--,ct=Math.max(ut-rt,z.x);ut=z.y-tt+b,ct+=x,yt=z.y+b,a.curve===Td?wg(y,ct,yt,!1):kd(y,mt,ut,ct,ut,ct,yt)}else if(ne.B(E.x,z.x))if(E.y<z.y)for(ut=0;ut<at;){for(ct=Math.max(E.y,Math.min(ot[ut++]-rt,z.y-tt)),y.lineTo(z.x+x,ct+b),mt=ct+b,ct=Math.min(ct+tt,z.y);ut<at&&(yt=ot[ut],yt<ct+tt);)ut++,ct=Math.min(yt+rt,z.y);yt=z.x-tt+x,St=z.x+x,ct+=b,a.curve===Td?wg(y,St,ct,!1):kd(y,yt,mt,yt,ct,St,ct)}else for(--at;0<=at;){for(ut=Math.min(E.y,Math.max(ot[at--]+rt,z.y+tt)),y.lineTo(z.x+x,ut+b),mt=ut+b,ut=Math.max(ut-tt,z.y);0<=at&&(ct=ot[at],ct>ut-tt);)at--,ut=Math.max(ct-rt,z.y);ct=z.x-tt+x,yt=z.x+x,ut+=b,a.curve===Td?wg(y,yt,ut,!1):kd(y,ct,mt,ct,ut,yt,ut)}}}y.lineTo(z.x+x,z.y+b)}function Mx(a,y,x,b){var E=a.diagram;if(E===null||y.D(x))return 0;for(E=E.layers;E.next();){var z=E.value;if(z!==null&&z.visible){z=z.Pa.s;for(var tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];if(ot instanceof _e){if(ot===a)return 0<b.length&&b.sort(function(ut,ct){return ut-ct}),b.length;if(ot.isVisible()&&ic(ot)){var at=ot.routeBounds;at.w()&&a.routeBounds.Yc(at)&&!a.usesSamePort(ot)&&(at=ot.path,at!==null&&at.Ed()&&kx(y,x,b,ot))}}}}}return 0<b.length&&b.sort(function(ut,ct){return ut-ct}),b.length}function kx(a,y,x,b){for(var E=ne.B(a.y,y.y),z=b.pointsCount,tt=b.i(0),rt=jt.alloc(),ot=1;ot<z;ot++){var at=b.i(ot);if(ot<z-1){var ut=b.i(ot+1);if(tt.y===at.y&&at.y===ut.y){if(at.x>tt.x&&ut.x>=at.x||at.x<tt.x&&ut.x<=at.x)continue}else if(tt.x===at.x&&at.x===ut.x&&(at.y>tt.y&&ut.y>=at.y||at.y<tt.y&&ut.y<=at.y))continue}t:{ut=a.x;var ct=a.y,mt=y.x,yt=y.y,St=tt.x;tt=tt.y;var Lt=at.x,Ot=at.y;if(ne.B(ut,mt)){if(!ne.B(ct,yt)&&ne.B(tt,Ot)&&Math.min(ct,yt)<tt&&Math.max(ct,yt)>tt&&Math.min(St,Lt)<ut&&Math.max(St,Lt)>ut&&!ne.B(St,Lt)){rt.x=ut,rt.y=tt,ut=!0;break t}}else if(ne.B(ct,yt)&&ne.B(St,Lt)&&Math.min(ut,mt)<St&&Math.max(ut,mt)>St&&Math.min(tt,Ot)<ct&&Math.max(tt,Ot)>ct&&!ne.B(tt,Ot)){rt.x=St,rt.y=ct,ut=!0;break t}rt.x=0,rt.y=0,ut=!1}ut&&(E?x.push(rt.x):x.push(rt.y)),tt=at}jt.free(rt)}function ic(a){return a=a.curve,a===Mg||a===Td}function $m(a,y){(y||ic(a))&&(y=a.diagram,y===null||y.animationManager.isTicking||y.Eh.contains(a)||a.ml.width===0&&a.ml.height===0||y.Eh.add(a,a.ml.copy()))}_e.prototype.Xo=function(a){var y=this.layer;if(y!==null&&y.visible&&!y.isTemporary){var x=y.diagram;if(x!==null&&!x.animationManager.isTicking){var b=!1;for(x=x.layers;x.next();){var E=x.value;if(E.visible){if(E===y){b=!0;var z=!1;E=E.Pa.s;for(var tt=E.length,rt=0;rt<tt;rt++){var ot=E[rt];ot instanceof _e&&(ot===this?z=!0:z&&tS(this,ot,a))}}else if(b)for(z=E.Pa.s,E=z.length,tt=0;tt<E;tt++)rt=z[tt],rt instanceof _e&&tS(this,rt,a)}}}}};function tS(a,y,x){if(y!==null&&y.lk&&y.fd&&ic(y)){var b=y.routeBounds;b.w()&&(a.routeBounds.Yc(b)||x.Yc(b))&&(a.usesSamePort(y)||y.qc())}}_e.prototype.usesSamePort=function(a){var y=this.pointsCount,x=a.pointsCount;if(0<y&&0<x){var b=this.i(0),E=a.i(0);if(b.Xa(E)||(y=this.i(y-1),a=a.i(x-1),y.Xa(a)||b.Xa(a)||y.Xa(E)))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1},_e.prototype.isVisible=function(){if(!vn.prototype.isVisible.call(this))return!1;var a=this.containingGroup,y=!0,x=this.diagram;if(x!==null&&(y=x.isTreePathToChildren),x=this.fromNode,x!==null){if(this.isTreeLink&&y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(var b=x;b!==null;){if(b.labeledLink===this)return!0;b=b.containingGroup}if(x=x.findVisibleNode(),x===null||x===a)return!1}if(x=this.toNode,x!==null){if(this.isTreeLink&&!y&&!x.isTreeExpanded)return!1;if(x===a)return!0;for(y=x;y!==null;){if(y.labeledLink===this)return!0;y=y.containingGroup}if(y=x.findVisibleNode(),y===null||y===a)return!1}return!0},_e.prototype.Zb=function(a){if(vn.prototype.Zb.call(this,a),a&&$m(this,!1),this.Sf!==null&&this.Sf.Sl(),this.wd!==null)for(var y=this.wd.iterator;y.next();)y.value.Zb(a)},_e.prototype.computeAdjusting=function(){return this.isAvoiding&&this.diagram!==null&&this.diagram.animationManager.defaultAnimation.isAnimating?wp:this.qk};function xp(a){var y=a.ef;if(y!==null){var x=a.uf;if(x!==null&&isNaN(a.curviness)){for(var b=a.ff,E=a.vf,z=a=null,tt=y.jb.s,rt=tt.length,ot=0;ot<rt;ot++){var at=tt[ot];(at.ef===y&&at.ff===b&&at.uf===x&&at.vf===E||at.ef===x&&at.ff===E&&at.uf===y&&at.vf===b)&&(z===null?z=at:(a===null&&(a=[],a.push(z)),a.push(at)))}if(a!==null){for(z=H1(y,x,b,E),z===null&&(z=new i0(y,b,x,E),_1(y,z),_1(x,z)),z.links=a,y=0;y<a.length;y++)a[y].Sf=z;z.Sl()}}}}function Pp(a){var y=a.Sf;y!==null&&isNaN(a.curviness)&&(a.Sf=null,a=y.links.indexOf(a),0<=a&&($r(y.links,a),y.Sl()))}_e.prototype.ph=function(){return!0},Oe.Object.defineProperties(_e.prototype,{fromNode:{get:function(){return this.ef},set:function(a){var y=this.ef;if(y!==a){var x=this.fromPort;y!==null&&(this.uf!==y&&Km(y,this,x),Pp(this),this.C(2)),this.ef=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var b=this.diagram;b!==null&&b.aa&&b.partManager.setFromNodeForLink(this,a,y);var E=this.fromPort,z=this.fromPortChanged;if(z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt)}a!==null&&(this.uf!==a&&Um(a,this,E),xp(this),this.C(1)),this.g("fromNode",y,a),Cg(this)}}},fromPortId:{get:function(){return this.ff},set:function(a){var y=this.ff;if(y!==a){var x=this.fromPort;x!==null&&ml(x),Pp(this),this.ff=a;var b=this.fromPort;b!==null&&ml(b);var E=this.diagram;if(E!==null){var z=this.data,tt=E.model;z!==null&&tt.ri()&&tt.xv(z,a)}x!==b&&(this.Wf=null,this.bb(),z=this.fromPortChanged,z!==null&&(tt=!0,E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt))),xp(this),this.g("fromPortId",y,a)}}},fromPort:{get:function(){var a=this.ef;return a===null?null:a.ns(this.ff)}},fromPortChanged:{get:function(){return this.gn},set:function(a){var y=this.gn;y!==a&&(this.gn=a,this.g("fromPortChanged",y,a))}},toNode:{get:function(){return this.uf},set:function(a){var y=this.uf;if(y!==a){var x=this.toPort;y!==null&&(this.ef!==y&&Km(y,this,x),Pp(this),this.C(2)),this.uf=a,a!==null&&this.Zb(a.isVisible()),this.Wf=null,this.bb();var b=this.diagram;b!==null&&b.aa&&b.partManager.setToNodeForLink(this,a,y);var E=this.toPort,z=this.toPortChanged;if(z!==null){var tt=!0;b!==null&&(tt=b.aa,b.aa=!0),z(this,x,E),b!==null&&(b.aa=tt)}a!==null&&(this.ef!==a&&Um(a,this,E),xp(this),this.C(1)),this.g("toNode",y,a),Cg(this)}}},toPortId:{get:function(){return this.vf},set:function(a){var y=this.vf;if(y!==a){var x=this.toPort;x!==null&&ml(x),Pp(this),this.vf=a;var b=this.toPort;b!==null&&ml(b);var E=this.diagram;if(E!==null){var z=this.data,tt=E.model;z!==null&&tt.ri()&&tt.Cv(z,a)}x!==b&&(this.Wf=null,this.bb(),z=this.toPortChanged,z!==null&&(tt=!0,E!==null&&(tt=E.aa,E.aa=!0),z(this,x,b),E!==null&&(E.aa=tt))),xp(this),this.g("toPortId",y,a)}}},toPort:{get:function(){var a=this.uf;return a===null?null:a.ns(this.vf)}},toPortChanged:{get:function(){return this.uo},set:function(a){var y=this.uo;y!==a&&(this.uo=a,this.g("toPortChanged",y,a))}},fromSpot:{get:function(){return this.ba!==null?this.ba.Xi:vs},set:function(a){var y=this.fromSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.Xi=a,this.g("fromSpot",y,a),(y.$c()||a.$c())&&this.fromNode!==null&&ml(this.fromPort),this.bb())}},fromEndSegmentLength:{get:function(){return this.ba!==null?this.ba.Vi:NaN},set:function(a){var y=this.fromEndSegmentLength;y!==a&&(0>a&&ri(a,">= 0",_e,"fromEndSegmentLength"),this.Xc(),this.ba.Vi=a,this.g("fromEndSegmentLength",y,a),this.bb())}},fromShortLength:{get:function(){return this.ba!==null?this.ba.Wi:NaN},set:function(a){var y=this.fromShortLength;y!==a&&(this.Xc(),this.ba.Wi=a,this.qc(),this.g("fromShortLength",y,a))}},toSpot:{get:function(){return this.ba!==null?this.ba.yj:vs},set:function(a){var y=this.toSpot;y.D(a)||(a=a.J(),this.Xc(),this.ba.yj=a,this.g("toSpot",y,a),(y.$c()||a.$c())&&this.toNode!==null&&ml(this.toPort),this.bb())}},toEndSegmentLength:{get:function(){return this.ba!==null?this.ba.wj:NaN},set:function(a){var y=this.toEndSegmentLength;y!==a&&(0>a&&ri(a,">= 0",_e,"toEndSegmentLength"),this.Xc(),this.ba.wj=a,this.g("toEndSegmentLength",y,a),this.bb())}},toShortLength:{get:function(){return this.ba!==null?this.ba.xj:NaN},set:function(a){var y=this.toShortLength;y!==a&&(this.Xc(),this.ba.xj=a,this.qc(),this.g("toShortLength",y,a))}},isLabeledLink:{get:function(){return this.wd===null?!1:0<this.wd.count}},labelNodes:{get:function(){return this.wd===null?Sr:this.wd.iterator}},relinkableFrom:{get:function(){return(this.Qa&1)!==0},set:function(a){var y=(this.Qa&1)!==0;y!==a&&(this.Qa^=1,this.g("relinkableFrom",y,a),this.Wb())}},relinkableTo:{get:function(){return(this.Qa&2)!==0},set:function(a){var y=(this.Qa&2)!==0;y!==a&&(this.Qa^=2,this.g("relinkableTo",y,a),this.Wb())}},resegmentable:{get:function(){return(this.Qa&4)!==0},set:function(a){var y=(this.Qa&4)!==0;y!==a&&(this.Qa^=4,this.g("resegmentable",y,a),this.Wb())}},isTreeLink:{get:function(){return(this.Qa&8)!==0},set:function(a){var y=(this.Qa&8)!==0;y!==a&&(this.Qa^=8,this.g("isTreeLink",y,a),this.fromNode!==null&&Sp(this.fromNode),this.toNode!==null&&Sp(this.toNode))}},path:{get:function(){var a=this.Pb();return a instanceof Qn?a:null}},routeBounds:{get:function(){this.vg();var a=this.ml,y=1/0,x=1/0,b=this.pointsCount;if(b===0)a.h(NaN,NaN,0,0);else{if(b===1)b=this.i(0),y=Math.min(b.x,y),x=Math.min(b.y,x),a.h(b.x,b.y,0,0);else if(b===2){b=this.i(0);var E=this.i(1);y=Math.min(b.x,E.x),x=Math.min(b.y,E.y),a.h(b.x,b.y,0,0),a.Ye(E)}else if(this.computeCurve()===Al&&3<=b&&!this.isOrthogonal)if(E=this.i(0),y=E.x,x=E.y,a.h(y,x,0,0),b===3){b=this.i(1),y=Math.min(b.x,y),x=Math.min(b.y,x);var z=this.i(2);y=Math.min(z.x,y),x=Math.min(z.y,x),ne.Dl(E.x,E.y,b.x,b.y,b.x,b.y,z.x,z.y,.5,a)}else for(z=3;z<b;z+=3){var tt=this.i(z-2);z+3>=b&&(z=b-1);var rt=this.i(z-1),ot=this.i(z);ne.Dl(E.x,E.y,tt.x,tt.y,rt.x,rt.y,ot.x,ot.y,.5,a),y=Math.min(ot.x,y),x=Math.min(ot.y,x),E=ot}else for(E=this.i(0),z=this.i(1),y=Math.min(E.x,z.x),x=Math.min(E.y,z.y),a.h(E.x,E.y,0,0),a.Ye(z),E=2;E<b;E++)z=this.i(E),y=Math.min(z.x,y),x=Math.min(z.y,x),a.Ye(z);this.su.h(y-a.x,x-a.y)}return a}},midPoint:{get:function(){return this.vg(),this.computeMidPoint(new jt)}},midAngle:{get:function(){return this.vg(),this.computeMidAngle()}},flattenedLengths:{get:function(){if(this.cq===null){this.fd||Xm(this);for(var a=this.cq=[],y=this.pointsCount,x=0;x<y-1;x++){var b=this.i(x),E=this.i(x+1);ne.$(b.x,E.x)?(b=E.y-b.y,0>b&&(b=-b)):ne.$(b.y,E.y)?(b=E.x-b.x,0>b&&(b=-b)):b=Math.sqrt(b.Bf(E)),a.push(b)}}return this.cq}},flattenedTotalLength:{get:function(){var a=this.vt;if(isNaN(a)){for(var y=this.flattenedLengths,x=y.length,b=a=0;b<x;b++)a+=y[b];this.vt=a}return a}},points:{get:function(){return this.Nb},set:function(a){var y=this.Nb;if(y!==a){var x=null;if(Array.isArray(a)){var b=a.length%2===0;if(b){for(var E=0;E<a.length;E++)if(typeof a[E]!="number"||isNaN(a[E])){b=!1;break}}if(b)for(x=new Ve,b=0;b<a.length/2;b++)E=new jt(a[2*b],a[2*b+1]).freeze(),x.add(E);else{for(b=!0,E=0;E<a.length;E++){var z=a[E];if(!Ue(z)||typeof z.x!="number"||isNaN(z.x)||typeof z.y!="number"||isNaN(z.y)){b=!1;break}}if(b)for(x=new Ve,b=0;b<a.length;b++)E=a[b],x.add(new jt(E.x,E.y).freeze())}}else if(a instanceof Ve)for(x=a.copy(),a=x.iterator;a.next();)a.value.freeze();else fe("Link.points value is not an instance of List or Array: "+a);x.freeze(),this.Nb=x,this.qc(),Xm(this),a=this.diagram,a!==null&&(a.pi||a.undoManager.isUndoingRedoing||a.As.add(this),a.animationManager.zb&&Ri(a.animationManager,this,x)),this.g("points",y,x)}}},pointsCount:{get:function(){return this.Nb.count}},fd:{get:function(){return(this.Qa&16)!==0},set:function(a){(this.Qa&16)!==0!==a&&(this.Qa^=16)}},suspendsRouting:{get:function(){return(this.Qa&32)!==0},set:function(a){(this.Qa&32)!==0!==a&&(this.Qa^=32)}},computingPoints:{get:function(){return(this.Qa&64)!==0},set:function(a){(this.Qa&64)!==0!==a&&(this.Qa^=64)}},defaultFromPoint:{get:function(){return this.o},set:function(a){this.o=a.copy()}},defaultToPoint:{get:function(){return this.u},set:function(a){this.u=a.copy()}},isOrthogonal:{get:function(){return(this.qj.value&2)===2}},isAvoiding:{get:function(){return(this.qj.value&4)===4}},lk:{get:function(){return(this.Qa&128)!==0},set:function(a){(this.Qa&128)!==0!==a&&(this.Qa^=128)}},geometry:{get:function(){if(!this.lk){if(this.vg(),2>this.pointsCount)return this.lk=!0,this.ua;this.ua=this.makeGeometry()}return this.ua}},firstPickIndex:{get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Lg(this.computeSpot(!0))?1:0}},lastPickIndex:{get:function(){var a=this.pointsCount;return a===0?0:2>=a?a-1:this.isOrthogonal||!Lg(this.computeSpot(!1))?a-2:a-1}},adjusting:{get:function(){return this.qk},set:function(a){var y=this.qk;y!==a&&(this.qk=a,this.g("adjusting",y,a))}},corner:{get:function(){return this.Om},set:function(a){var y=this.Om;y!==a&&(this.Om=a,this.qc(),this.g("corner",y,a))}},curve:{get:function(){return this.Qm},set:function(a){var y=this.Qm;y!==a&&(this.Qm=a,this.bb(),this.qc(),$m(this,y===Td||y===Mg||a===Td||a===Mg),this.g("curve",y,a))}},curviness:{get:function(){return this.Rm},set:function(a){var y=this.Rm;y!==a&&(this.Rm=a,this.bb(),this.qc(),this.g("curviness",y,a))}},routing:{get:function(){return this.qj},set:function(a){var y=this.qj;y!==a&&(this.qj=a,this.Wf=null,this.bb(),$m(this,(y.value&2)===2||(a.value&2)===2),this.g("routing",y,a))}},smoothness:{get:function(){return this.po},set:function(a){var y=this.po;y!==a&&(this.po=a,this.qc(),this.g("smoothness",y,a))}},key:{get:function(){var a=this.diagram;if(a!==null&&a.model.ri())return a.model.Ac(this.data)}}}),_e.prototype.invalidateOtherJumpOvers=_e.prototype.Xo,_e.prototype.findClosestSegment=_e.prototype.ez,_e.prototype.updateRoute=_e.prototype.vg,_e.prototype.invalidateRoute=_e.prototype.bb,_e.prototype.rollbackRoute=_e.prototype.rv,_e.prototype.commitRoute=_e.prototype.zf,_e.prototype.startRoute=_e.prototype.uh,_e.prototype.clearPoints=_e.prototype.Fj,_e.prototype.removePoint=_e.prototype.pv,_e.prototype.addPointAt=_e.prototype.yf,_e.prototype.addPoint=_e.prototype.ne,_e.prototype.insertPointAt=_e.prototype.m,_e.prototype.insertPoint=_e.prototype.Kz,_e.prototype.setPointAt=_e.prototype.L,_e.prototype.setPoint=_e.prototype.dd,_e.prototype.getPoint=_e.prototype.i,_e.prototype.getOtherPort=_e.prototype.Cz,_e.prototype.getOtherNode=_e.prototype.To;var Bc=null,Oc=null,Jv=new me(_e,"Normal",1),bx=new me(_e,"Orthogonal",2),Ex=new me(_e,"AvoidsNodes",6),eS=new me(_e,"AvoidsNodesStraight",7),Ea=new me(_e,"None",0),Al=new me(_e,"Bezier",9),Td=new me(_e,"JumpGap",10),Mg=new me(_e,"JumpOver",11),wp=new me(_e,"End",17),qm=new me(_e,"Scale",18),t0=new me(_e,"Stretch",19),Cp=new me(_e,"OrientAlong",21),Lp=new me(_e,"OrientPlus90",22),Mp=new me(_e,"OrientMinus90",23),Qv=new me(_e,"OrientOpposite",24),e0=new me(_e,"OrientUpright",25),kp=new me(_e,"OrientPlus90Upright",26),bp=new me(_e,"OrientMinus90Upright",27),n0=new me(_e,"OrientUpright45",28),nS=16,iS=14,Ep=8;_e.className="Link",_e.Normal=Jv,_e.Orthogonal=bx,_e.AvoidsNodes=Ex,_e.AvoidsNodesStraight=eS,_e.None=Ea,_e.Bezier=Al,_e.JumpGap=Td,_e.JumpOver=Mg,_e.End=wp,_e.Scale=qm,_e.Stretch=t0,_e.OrientAlong=Cp,_e.OrientPlus90=Lp,_e.OrientMinus90=Mp,_e.OrientOpposite=Qv,_e.OrientUpright=e0,_e.OrientPlus90Upright=kp,_e.OrientMinus90Upright=bp,_e.OrientUpright45=n0,_e.EndSegmentStep=8,_e.CurvinessStart=nS,_e.SpacingMin=iS,_e.OrthoShortCut=Ep;function i0(a,y,x,b){qr(this),this.Fe=this.qq=!1,this.Ds=a,this.Ox=y,this.cv=x,this.Px=b,this.links=[]}i0.prototype.Sl=function(){if(!this.qq){var a=this.links;0<a.length&&(a=a[0].diagram,a!==null&&(a.ow.add(this),this.Fe=a.undoManager.isUndoingRedoing))}this.qq=!0},i0.prototype.Nv=function(){if(this.qq){this.qq=!1;var a=this.links;if(0<a.length){var y=a[0],x=y.diagram;x=x===null||x.pi&&!this.Fe,this.Fe=!1,y.arrangeBundledLinks(a,x),a.length===1&&(y.Sf=null,a.length=0)}a.length===0&&(a=this.Ds,this!==null&&a.af!==null&&a.af.remove(this),a=this.cv,this!==null&&a.af!==null&&a.af.remove(this))}},i0.className="LinkBundle";function Fp(a){qr(this),this.Yx=this.group=null,this.vs=!0,this.abort=!1,this.Od=this.Nd=1,this.Fn=this.En=-1,this.rc=a.width,this.sc=a.height,this.ac=null,this.ei=this.di=0,this.Os=11,this.Ix=this.Hx=22}Fp.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var y=a.y,x=a.x+a.width,b=a.y+a.height;if(this.Nd=Math.floor((a.x-this.rc)/this.rc)*this.rc,this.Od=Math.floor((y-this.sc)/this.sc)*this.sc,this.En=Math.ceil((x+2*this.rc)/this.rc)*this.rc,this.Fn=Math.ceil((b+2*this.sc)/this.sc)*this.sc,a=1+(Math.ceil((this.En-this.Nd)/this.rc)|0),y=1+(Math.ceil((this.Fn-this.Od)/this.sc)|0),this.ac===null||this.di<a-1||this.ei<y-1){for(x=[],b=0;b<=a;b++)x[b]=new Uint32Array(y);this.ac=x,this.di=a-1,this.ei=y-1}if(a=$v,this.ac!==null)for(y=0;y<=this.di;y++)if(x=this.ac[y],x.fill)x.fill(a);else for(b=0;b<=this.ei;b++)x[b]=a}};function kg(a,y,x){return a.Nd<=y&&y<=a.En&&a.Od<=x&&x<=a.Fn}function Eh(a,y,x){return kg(a,y,x)?(y-=a.Nd,y/=a.rc,x-=a.Od,x/=a.sc,a.ac[y|0][x|0]):$v}function rS(a){if(a.ac!==null)for(var y=0;y<=a.di;y++)for(var x=a.ac[y],b=0;b<=a.ei;b++)x[b]>=rc&&(x[b]=$v)}Fp.prototype.Yj=function(a,y,x,b){if(a>this.En||a+x<this.Nd||y>this.Fn||y+b<this.Od)return!0;a=(a-this.Nd)/this.rc|0,y=(y-this.Od)/this.sc|0,x=Math.max(0,x)/this.rc+1|0;var E=Math.max(0,b)/this.sc+1|0;if(0>a&&(x+=a,a=0),0>y&&(E+=y,y=0),0>x||0>E)return!0;for(b=Math.min(a+x-1,this.di)|0,x=Math.min(y+E-1,this.ei)|0;a<=b;a++){E=this.ac[a];for(var z=y;z<=x;z++)if(E[z]===Nd)return!1}return!0};function Fh(a,y,x,b,E,z,tt,rt,ot){if(!(y<z||y>tt||x<rt||x>ot)){var at=y|0,ut=x|0,ct=a.ac[at][ut];if(ct>=rc&&ct<bg)for(E?ut+=b:at+=b,ct+=1;z<=at&&at<=tt&&rt<=ut&&ut<=ot&&!(ct>=a.ac[at][ut]);)a.ac[at][ut]=ct,ct+=1,E?ut+=b:at+=b;if(at=E?ut:at,E)if(0<b)for(x+=b;x<at;x+=b)Fh(a,y,x,1,!E,z,tt,rt,ot),Fh(a,y,x,-1,!E,z,tt,rt,ot);else for(x+=b;x>at;x+=b)Fh(a,y,x,1,!E,z,tt,rt,ot),Fh(a,y,x,-1,!E,z,tt,rt,ot);else if(0<b)for(y+=b;y<at;y+=b)Fh(a,y,x,1,!E,z,tt,rt,ot),Fh(a,y,x,-1,!E,z,tt,rt,ot);else for(y+=b;y>at;y+=b)Fh(a,y,x,1,!E,z,tt,rt,ot),Fh(a,y,x,-1,!E,z,tt,rt,ot)}}function r0(a,y,x,b,E,z,tt,rt,ot){y|=0,x|=0;var at=Nd,ut=rc;for(a.ac[y][x]=ut;at===Nd&&y>z&&y<tt&&x>rt&&x<ot;)ut+=1,a.ac[y][x]=ut,E?x+=b:y+=b,at=a.ac[y][x]}function o0(a,y,x,b,E,z,tt,rt,ot){y|=0,x|=0;var at=Nd,ut=bg;for(a.ac[y][x]=ut;at===Nd&&y>z&&y<tt&&x>rt&&x<ot;)a.ac[y][x]=ut,E?x+=b:y+=b,at=a.ac[y][x]}function oS(a,y,x,b,E,z,tt){if(a.ac!==null){a.abort=!1;var rt=y.x,ot=y.y;if(kg(a,rt,ot)){rt-=a.Nd,rt/=a.rc,ot-=a.Od,ot/=a.sc;var at=b.x,ut=b.y;if(kg(a,at,ut))if(at-=a.Nd,at/=a.rc,ut-=a.Od,ut/=a.sc,1>=Math.abs(rt-at)&&1>=Math.abs(ot-ut))a.abort=!0;else{var ct=z.x;b=z.y,y=z.x+z.width;var mt=z.y+z.height;ct-=a.Nd,ct/=a.rc,b-=a.Od,b/=a.sc,y-=a.Nd,y/=a.rc,mt-=a.Od,mt/=a.sc,z=Math.max(0,Math.min(a.di,ct|0)),y=Math.min(a.di,Math.max(0,y|0)),ct=Math.max(0,Math.min(a.ei,b|0)),mt=Math.min(a.ei,Math.max(0,mt|0)),b=a.ac,rt|=0,ot|=0,at|=0,ut|=0;var yt=x===0||x===90?1:-1;if(x=x===90||x===270,b[rt][ot]===Nd?(r0(a,rt,ot,yt,x,z,y,ct,mt),r0(a,rt,ot,1,!x,z,y,ct,mt),r0(a,rt,ot,-1,!x,z,y,ct,mt)):r0(a,rt,ot,yt,x,rt,ot,rt,ot),b[at][ut]===Nd?(o0(a,at,ut,E===0||E===90?1:-1,E===90||E===270,z,y,ct,mt),o0(a,at,ut,1,!(E===90||E===270),z,y,ct,mt),o0(a,at,ut,-1,!(E===90||E===270),z,y,ct,mt)):o0(a,at,ut,yt,x,at,ut,at,ut),x=Kn(),tt&&sS(a,at,ut,E,rt,ot,x))for((x[0]!==at||x[1]!==ut)&&(x.unshift(ut),x.unshift(at)),(x[x.length-2]!==rt||x[x.length-1]!==ot)&&(x.push(rt),x.push(ot)),a=rc,E=x[x.length-2],tt=x[x.length-1],b[E][tt]=a++,z=x.length-4;0<=z;z-=2)for(E=x[z+2],tt=x[z+3],y=x[z],at=x[z+1];y>E?E++:y<E?E--:at>tt?tt++:at<tt&&tt--,b[E][tt]=a++,E!==y||tt!==at;);else Fh(a,rt,ot,1,!1,z,y,ct,mt),Fh(a,rt,ot,-1,!1,z,y,ct,mt),Fh(a,rt,ot,1,!0,z,y,ct,mt),Fh(a,rt,ot,-1,!0,z,y,ct,mt);zn(x)}}}}function sS(a,y,x,b,E,z,tt){for(var rt=a.ac,ot=y,at=x;;){if(ot===E&&at===z)return!0;var ut=ot,ct=at;if(b===0)if(ut<E)ut++;else break;else if(b===90)if(ct<z)ct++;else break;else if(b===180)if(ut>E)ut--;else break;else if(ct>z)ct--;else break;var mt=rt[ut][ct];if(mt===0||mt===qv)break;ot=ut,at=ct}for(;;){if(ut=b,ct=ot,mt=at,b===0?mt<z?(ut=90,mt++):mt>z&&(ut=270,mt--):b===90?ct<E?(ut=0,ct++):ct>E&&(ut=180,ct--):b===180?mt<z?(ut=90,mt++):mt>z&&(ut=270,mt--):ct<E?(ut=0,ct++):ct>E&&(ut=180,ct--),ct=rt[ct][mt],ut!==b&&ct!==0&&ct!==qv){if(tt.push(ot),tt.push(at),sS(a,ot,at,ut,E,z,tt))return!0;tt.pop(),tt.pop()}if(rt[ot][at]=qv,b===0){if(ot===y)return!1;ot--}else if(b===90){if(at===x)return!1;at--}else if(b===180){if(ot===y)return!1;ot++}else{if(at===x)return!1;at++}}}Oe.Object.defineProperties(Fp.prototype,{bounds:{get:function(){return new ye(this.Nd,this.Od,this.En-this.Nd,this.Fn-this.Od)}},Ho:{get:function(){return this.rc},set:function(a){0<a&&a!==this.rc&&(this.rc=a,this.initialize(this.bounds))}},Go:{get:function(){return this.sc},set:function(a){0<a&&a!==this.sc&&(this.sc=a,this.initialize(this.bounds))}}});var Nd=0,rc=1,bg=999999,$v=bg+1,qv=bg+2;Fp.className="PositionArray";function Ic(){qr(this),this.port=this.node=null,this.pe=[],this.ap=!1}Ic.prototype.toString=function(){for(var a=this.pe,y=this.node.toString()+" "+a.length.toString()+":",x=0;x<a.length;x++){var b=a[x];b!==null&&(y+=`
|
|
`+b.toString())}return y};function Fx(a,y,x,b){switch(y=y.offsetY,y){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(y){case 9:return 180<x?270:90;case 6:return 90<x&&270>=x?180:0}switch(a=180*Math.atan2(a.height,a.width)/Math.PI,y){case 3:return x>a&&x<=180+a?180:270;case 5:return x>180-a&&x<=360-a?270:0;case 12:return x>a&&x<=180+a?90:0;case 10:return x>180-a&&x<=360-a?180:90;case 7:return 90<x&&x<=180+a?180:x>180+a&&x<=360-a?270:0;case 13:return 180<x&&x<=360-a?270:x>a&&180>=x?90:0;case 14:return x>a&&x<=180-a?90:x>180-a&&270>=x?180:0;case 11:return x>180-a&&x<=180+a?180:x>180+a?270:90}return b&&y!==15&&(x-=15,0>x&&(x+=360)),x>a&&x<180-a?90:x>=180-a&&x<=180+a?180:x>180+a&&x<360-a?270:0}Ic.prototype.Sl=function(){this.pe.length=0};function aS(a,y){var x=a.pe;if(x.length===0){t:if(!a.ap){x=a.ap,a.ap=!0;var b=null,E=a.node,z=E instanceof Yn?E:null;if(z===null||z.isSubGraphExpanded)var tt=E.isTreeExpanded?E.findLinksConnected(a.port.portId):E.qx();else{if(!z.actualBounds.w()){a.ap=x;break t}b=z,tt=b.Lu()}z=a.pe.length=0;var rt=a.port.ga(ms,jt.alloc()),ot=a.port.ga(Ll,jt.alloc());for(E=ye.allocAt(rt.x,rt.y,0,0),E.Ye(ot),jt.free(rt),jt.free(ot),rt=jt.allocAt(E.x+E.width/2,E.y+E.height/2),ot=a.port.li(),tt=tt.iterator;tt.next();){var at=tt.value;if(at.isVisible()&&at.fromPort!==at.toPort){var ut=at.fromPort===a.port||at.fromNode!==null&&at.fromNode.Td(b),ct=at.computeSpot(ut,a.port);if(ct.$c()&&(ut=ut?at.toPort:at.fromPort,ut!==null)){var mt=ut.part;if(mt!==null){var yt=mt.findVisibleNode();yt!==null&&yt!==mt&&(mt=yt,ut=mt.port),ut=at.computeOtherPoint(mt,ut),mt=rt.ab(ut),mt-=ot,0>mt?mt+=360:360<=mt&&(mt-=360),ct=Fx(E,ct,mt,at.isOrthogonal),ct===0?(ct=4,180<mt&&(mt-=360)):ct===90?(ct=8,270<mt&&(mt-=360)):ct===180?ct=2:(ct=1,90>mt&&(mt+=360)),yt=a.pe[z],yt===void 0?(yt=new ty(at,mt,ct),a.pe[z]=yt):(yt.link=at,yt.angle=mt,yt.Nc=ct),yt.hv.set(ut),z++}}}}for(jt.free(rt),a.pe.sort(Ic.prototype.j),ot=a.pe.length,b=-1,z=rt=0;z<ot;z++)tt=a.pe[z],tt!==void 0&&(tt.Nc!==b&&(b=tt.Nc,rt=0),tt.Uo=rt,rt++);for(b=-1,rt=0,z=ot-1;0<=z;z--)ot=a.pe[z],ot!==void 0&&(ot.Nc!==b&&(b=ot.Nc,rt=ot.Uo+1),ot.Gl=rt);if(z=a.pe,ct=a.port,b=a.node.portSpreading,rt=jt.alloc(),ot=jt.alloc(),tt=jt.alloc(),at=jt.alloc(),ct.ga(ms,rt),ct.ga(cd,ot),ct.ga(Ll,tt),ct.ga(Du,at),yt=mt=ut=ct=0,b===Vv)for(var St=0;St<z.length;St++){var Lt=z[St];if(Lt!==null){var Ot=Lt.link.computeThickness();switch(Lt.Nc){case 8:mt+=Ot;break;case 2:yt+=Ot;break;case 1:ct+=Ot;break;default:case 4:ut+=Ot}}}var Dt=St=0,Gt=1,Vt=Lt=0;for(Ot=0;Ot<z.length;Ot++){var Yt=z[Ot];if(Yt!==null){if(St!==Yt.Nc){switch(St=Yt.Nc,St){case 8:var qt=tt;Dt=at;break;case 2:qt=at,Dt=rt;break;case 1:qt=rt,Dt=ot;break;default:case 4:qt=ot,Dt=tt}switch(Lt=Dt.x-qt.x,Vt=Dt.y-qt.y,St){case 8:mt>Math.abs(Lt)?(Gt=Math.abs(Lt)/mt,mt=Math.abs(Lt)):Gt=1;break;case 2:yt>Math.abs(Vt)?(Gt=Math.abs(Vt)/yt,yt=Math.abs(Vt)):Gt=1;break;case 1:ct>Math.abs(Lt)?(Gt=Math.abs(Lt)/ct,ct=Math.abs(Lt)):Gt=1;break;default:case 4:ut>Math.abs(Vt)?(Gt=Math.abs(Vt)/ut,ut=Math.abs(Vt)):Gt=1}Dt=0}var ae=Yt.Zo;if(b===Vv){switch(Yt=Yt.link.computeThickness(),Yt*=Gt,ae.set(qt),St){case 8:ae.x=qt.x+Lt/2+mt/2-Dt-Yt/2;break;case 2:ae.y=qt.y+Vt/2+yt/2-Dt-Yt/2;break;case 1:ae.x=qt.x+Lt/2-ct/2+Dt+Yt/2;break;default:case 4:ae.y=qt.y+Vt/2-ut/2+Dt+Yt/2}Dt+=Yt}else{var Je=.5;b===Ym&&(Je=(Yt.Uo+1)/(Yt.Gl+1)),ae.x=qt.x+Lt*Je,ae.y=qt.y+Vt*Je}}}for(jt.free(rt),jt.free(ot),jt.free(tt),jt.free(at),qt=a.pe,z=0;z<qt.length;z++)b=qt[z],b!==null&&(b.Ju=a.computeEndSegmentLength(b));a.ap=x,ye.free(E)}x=a.pe}for(a=0;a<x.length;a++)if(E=x[a],E!==null&&E.link===y)return E;return null}Ic.prototype.j=function(a,y){return a===y?0:a===null?-1:y===null?1:a.Nc<y.Nc?-1:a.Nc>y.Nc?1:a.angle<y.angle?-1:a.angle>y.angle?1:0},Ic.prototype.computeEndSegmentLength=function(a){var y=a.link,x=y.computeEndSegmentLength(this.node,this.port,us,y.fromPort===this.port),b=a.Uo;if(0>b)return x;var E=a.Gl;if(1>=E||!y.isOrthogonal)return x;y=a.hv;var z=a.Zo;return(a.Nc===2||a.Nc===8)&&(b=E-1-b),((a=a.Nc===2||a.Nc===4)?y.y<z.y:y.x<z.x)?x+8*b:(a?y.y===z.y:y.x===z.x)?x:x+8*(E-1-b)},Ic.className="Knot";function ty(a,y,x){this.link=a,this.angle=y,this.Nc=x,this.hv=new jt,this.Gl=this.Uo=0,this.Zo=new jt,this.Ju=0}ty.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Nc.toString()+":"+this.Uo.toString()+"/"+this.Gl.toString()+" "+this.Zo.toString()+" "+this.Ju.toString()+" "+this.hv.toString()},ty.className="LinkInfo";function Zr(a){qr(this),this.o=this.H=null,this.Gh=this.sn=!0,this.yn=!1,this.Am=new jt(0,0).freeze(),this.vn=!0,this.Em=this.un=null,this.xn=!1,this.j=null,a&&Object.assign(this,a)}Zr.prototype.cloneProtected=function(a){a.sn=this.sn,a.Gh=this.Gh,a.yn=this.yn,a.Am.assign(this.Am),a.vn=this.vn,a.un=this.un,a.Em=this.Em,a.xn=!0},Zr.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},Zr.prototype.qb=function(){},Zr.prototype.toString=function(){var a=qn(this.constructor);return a+="(",this.group!==null&&(a+=" in "+this.group),this.diagram!==null&&(a+=" for "+this.diagram),a+")"},Zr.prototype.C=function(){if(this.isValidLayout){var a=this.diagram;if(a!==null&&!a.undoManager.isUndoingRedoing){var y=a.animationManager;!y.isTicking&&(y.defaultAnimation.isAnimating&&y.Cc(),this.isOngoing&&a.pi||this.isInitial&&!a.pi)&&(this.isValidLayout=!1,a.$b())}}},Zr.prototype.createNetwork=function(){return new kr(this)},Zr.prototype.makeNetwork=function(a){var y=this.createNetwork();return a instanceof se?(y.lg(a.nodes,!0),y.lg(a.links,!0)):a instanceof Yn?y.lg(a.memberParts):y.lg(a.iterator),y},Zr.prototype.updateParts=function(){this.isValidLayout=!0;var a=this.diagram;if(a===null&&this.network!==null)for(var y=this.network.vertexes.iterator;y.next();){var x=y.value.node;if(x!==null&&(a=x.diagram,a!==null))break}try{a!==null&&a.Ea("Layout"),this.commitLayout()}finally{a!==null&&a.eb("Layout")}},Zr.prototype.commitLayout=function(){if(this.network!==null){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}},Zr.prototype.doLayout=function(a){var y=new Ye;a instanceof se?(lf(this,y,a.nodes,!0,this.rh,!0,!1,!0),lf(this,y,a.parts,!0,this.rh,!0,!1,!0)):a instanceof Yn?lf(this,y,a.memberParts,!1,this.rh,!0,!1,!0):y.addAll(a.iterator),0<y.count&&(a=this.diagram,a!==null&&a.Ea("Layout"),this.doMinimalNoNetworkLayout(y),a!==null&&a.eb("Layout")),this.isValidLayout=!0},Zr.prototype.doMinimalNoNetworkLayout=function(a){var y=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var x=this.arrangementOrigin.x,b=x,E=this.arrangementOrigin.y,z=0,tt=0;for(a=a.iterator;a.next();){var rt=a.value;Tp(rt);var ot=rt.measuredBounds,at=ot.width;ot=ot.height,rt.moveTo(b,E),rt instanceof Yn&&(rt.rh=!1),b+=Math.max(at,50)+20,tt=Math.max(tt,Math.max(ot,50)),z>=y-1?(z=0,b=x,E+=tt+20,tt=0):z++}},Zr.prototype.doMinimalNetworkLayout=function(){var a=Math.ceil(Math.sqrt(this.network.vertexes.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);for(var y=this.arrangementOrigin.x,x=y,b=this.arrangementOrigin.y,E=0,z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value.node;if(!(rt===null||rt instanceof _e)&&(Tp(rt),this.rh(rt))){var ot=rt.measuredBounds,at=ot.width;ot=ot.height,rt.moveTo(x,b),rt instanceof Yn&&(rt.rh=!1),x+=Math.max(at,50)+20,z=Math.max(z,Math.max(ot,50)),E>=a-1?(E=0,x=y,b+=z+20,z=0):E++}}},Zr.prototype.rh=function(a){return!!(!a.location.w()||a instanceof Yn&&a.rh)};function lf(a,y,x,b,E,z,tt,rt){for(x=x.iterator;x.next();){var ot=x.value;b&&!ot.isTopLevel||E!==null&&!E(ot)||!ot.canLayout()||(z&&ot instanceof $e?ot.isLinkLabel||(ot instanceof Yn&&ot.layout===null?lf(a,y,ot.memberParts,!1,E,z,tt,rt):(Tp(ot),y.add(ot))):tt&&ot instanceof _e?y.add(ot):!rt||!ot.Zc()||ot instanceof $e||(Tp(ot),y.add(ot)))}}function Tp(a){var y=a.actualBounds;(y.width===0||y.height===0||isNaN(y.width)||isNaN(y.height))&&a.Va()}Zr.prototype.ni=function(a,y){var x=this.boundsComputation;return x!==null?(y||(y=new ye),x(a,this,y)):y?(y.set(a.actualBounds),y):a.actualBounds},Zr.prototype.ex=function(a){var y=new Ye;return a instanceof se?(lf(this,y,a.nodes,!0,null,!0,!0,!0),lf(this,y,a.links,!0,null,!0,!0,!0),lf(this,y,a.parts,!0,null,!0,!0,!0)):a instanceof Yn?lf(this,y,a.memberParts,!1,null,!0,!0,!0):lf(this,y,a.iterator,!1,null,!0,!0,!0),y},Zr.prototype.initialOrigin=function(a){var y=this.group;if(y!==null){var x=y.position.copy();return(isNaN(x.x)||isNaN(x.y))&&x.set(a),y=y.placeholder,y!==null&&(x=y.ga(ms),(isNaN(x.x)||isNaN(x.y))&&x.set(a),a=y.padding,x.x+=a.left,x.y+=a.top),x}return a},Oe.Object.defineProperties(Zr.prototype,{diagram:{get:function(){return this.H},set:function(a){this.H=a}},group:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a,a!==null&&(this.H=a.diagram))}},isOngoing:{get:function(){return this.sn},set:function(a){this.sn!==a&&(this.sn=a)}},isInitial:{get:function(){return this.Gh},set:function(a){this.Gh=a,a||(this.xn=!0)}},isViewportSized:{get:function(){return this.yn},set:function(a){this.yn!==a&&(this.yn=a)&&this.C()}},isRouting:{get:function(){return this.vn},set:function(a){this.vn!==a&&(this.vn=a)}},isRealtime:{get:function(){return this.un},set:function(a){this.un!==a&&(this.un=a)}},isValidLayout:{get:function(){return this.xn},set:function(a){this.xn!==a&&(this.xn=a,a||(a=this.diagram,a!==null&&(a.xh=!0)))}},network:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a,a!==null&&(a.layout=this))}},boundsComputation:{get:function(){return this.Em},set:function(a){this.Em!==a&&(this.Em=a,this.C())}},arrangementOrigin:{get:function(){return this.Am},set:function(a){this.Am.D(a)||(this.Am.assign(a),this.C())}}}),Zr.prototype.collectParts=Zr.prototype.ex,Zr.prototype.getLayoutBounds=Zr.prototype.ni,Zr.prototype.invalidateLayout=Zr.prototype.C,Zr.className="Layout";function kr(a){qr(this),this.Sc=a,this.wf=new Ye,this.ye=new Ye,this.Es=new xn,this.zs=new xn}kr.prototype.clear=function(){if(this.wf)for(var a=this.wf.iterator;a.next();)a.value.clear();if(this.ye)for(a=this.ye.iterator;a.next();)a.value.clear();this.wf=new Ye,this.ye=new Ye,this.Es=new xn,this.zs=new xn},kr.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutNetwork"+(this.layout!==null?"("+this.layout.toString()+")":"");if(0>=a)return y;if(y+=" vertexes: "+this.wf.count+" edges: "+this.ye.count,1<a){for(var x=this.wf.iterator;x.next();)y+=`
|
|
`+x.value.toString(a-1);for(x=this.ye.iterator;x.next();)y+=`
|
|
`+x.value.toString(a-1)}return y},kr.prototype.createVertex=function(){return new ns(this)},kr.prototype.createEdge=function(){return new vl(this)},kr.prototype.lg=function(a,y,x){if(a!==null){for(y===void 0&&(y=!1),x===void 0&&(x=null),x===null&&(x=function(tt){if(tt instanceof $e)return!tt.isLinkLabel;if(tt instanceof _e){var rt=tt.fromNode;return rt===null||rt.isLinkLabel?!1:(tt=tt.toNode,!(tt===null||tt.isLinkLabel))}return!1}),a=a.iterator;a.next();){var b=a.value;if(b instanceof $e&&(!y||b.isTopLevel)&&b.canLayout()&&x(b)){if(b instanceof Yn&&b.layout===null)this.lg(b.memberParts,!1);else if(this.ki(b)===null){var E=this.createVertex();E.node=b,this.dh(E)}}}for(a.reset();a.next();)if(b=a.value,b instanceof _e&&(!y||b.isTopLevel)&&b.canLayout()&&x(b)&&this.Lo(b)===null){var z=b.fromNode;E=b.toNode,z!==null&&E!==null&&z!==E&&(z=this.findGroupVertex(z),E=this.findGroupVertex(E),z!==null&&E!==null&&this.Zj(z,E,b))}}},kr.prototype.findGroupVertex=function(a){if(a===null)return null;var y=a.findVisibleNode();if(y===null)return null;if(a=this.ki(y),a!==null)return a;for(y=y.containingGroup;y!==null;){if(a=this.ki(y),a!==null)return a;y=y.containingGroup}return null},xt=kr.prototype,xt.dh=function(a){if(a!==null){this.wf.add(a);var y=a.node;y!==null&&this.Es.add(y,a),a.network=this}},xt.Bl=function(a){if(a===null)return null;var y=this.ki(a);return y===null&&(y=this.createVertex(),y.node=a,this.dh(y)),y},xt.Iu=function(a){if(a!==null&&lS(this,a)){for(var y=a.tg,x=y.count-1;0<=x;x--){var b=y.M(x);this.Mj(b)}for(y=a.mg,a=y.count-1;0<=a;a--)x=y.M(a),this.Mj(x)}};function lS(a,y){if(y===null)return!1;var x=a.wf.remove(y);return x&&(y=y.node,y!==null&&a.Es.remove(y)),x}xt.Zy=function(a){a!==null&&(a=this.ki(a),a!==null&&this.Iu(a))},xt.ki=function(a){return a===null?null:this.Es.I(a)},xt.Bo=function(a){if(a!==null){ey(this,a);var y=a.toVertex;y!==null&&y.Cl(a),y=a.fromVertex,y!==null&&y.zl(a)}};function ey(a,y){if(y!==null){a.ye.add(y);var x=y.link;x!==null&&a.Lo(x)===null&&a.zs.add(x,y),y.network=a}}xt.Dy=function(a){if(a===null)return null;var y=a.fromNode,x=a.toNode,b=this.Lo(a);return b===null?(b=this.createEdge(),b.link=a,y!==null&&(b.fromVertex=this.Bl(y)),x!==null&&(b.toVertex=this.Bl(x)),this.Bo(b)):(y!==null?b.fromVertex=this.Bl(y):b.fromVertex=null,x!==null?b.toVertex=this.Bl(x):b.toVertex=null),b},xt.Mj=function(a){if(a!==null){var y=a.toVertex;y!==null&&y.Kl(a),y=a.fromVertex,y!==null&&y.Jl(a),ny(this,a)}};function ny(a,y){y!==null&&a.ye.remove(y)&&(y=y.link,y!==null&&a.zs.remove(y))}xt.Yy=function(a){a!==null&&(a=this.Lo(a),a!==null&&this.Mj(a))},xt.Lo=function(a){return a===null?null:this.zs.I(a)},xt.Zj=function(a,y,x){if(a===null||y===null)return null;if(a.network===this&&y.network===this){var b=this.createEdge();return b.link=x,b.fromVertex=a,b.toVertex=y,this.Bo(b),b}return null},xt.gm=function(a){if(a!==null){var y=a.fromVertex,x=a.toVertex;y!==null&&x!==null&&(y.Jl(a),x.Kl(a),a.gm(),y.Cl(a),x.zl(a))}},xt.Ko=function(){for(var a=Kn(),y=this.ye.iterator;y.next();){var x=y.value;x.fromVertex===x.toVertex&&a.push(x)}for(y=a.length,x=0;x<y;x++)this.Mj(a[x]);zn(a)},kr.prototype.deleteArtificialVertexes=function(){for(var a=Kn(),y=this.wf.iterator;y.next();){var x=y.value;x.node===null&&x.data===null&&a.push(x)}for(x=a.length,y=0;y<x;y++)this.Iu(a[y]);for(y=Kn(),x=this.ye.iterator;x.next();){var b=x.value;b.link===null&&b.data===null&&y.push(b)}for(x=y.length,b=0;b<x;b++)this.Mj(y[b]);zn(a),zn(y)};function Tx(a){for(var y=Kn(),x=a.ye.iterator;x.next();){var b=x.value;b.fromVertex!==null&&b.toVertex!==null||y.push(b)}for(x=y.length,b=0;b<x;b++)a.Mj(y[b]);zn(y)}kr.prototype.Zx=function(a){a===void 0&&(a=!0),a&&(this.deleteArtificialVertexes(),Tx(this),this.Ko()),a=new Ve;for(var y=!0;y;){y=!1;for(var x=this.wf.iterator;x.next();){var b=x.value;if(0<b.tg.count||0<b.mg.count){y=this.layout.createNetwork(),a.add(y),iy(this,y,b),y=!0;break}}}return a.sort(function(E,z){return E===null||z===null||E===z?0:z.vertexes.count-E.vertexes.count}),a};function iy(a,y,x){if(x!==null&&x.network!==y){lS(a,x),y.dh(x);for(var b=x.sourceEdges;b.next();){var E=b.value;E.network!==y&&(ny(a,E),ey(y,E),iy(a,y,E.fromVertex))}for(b=x.destinationEdges;b.next();)x=b.value,x.network!==y&&(ny(a,x),ey(y,x),iy(a,y,x.toVertex))}}kr.prototype.dz=function(){for(var a=new Ye,y=this.wf.iterator;y.next();)a.add(y.value.node);for(y=this.ye.iterator;y.next();)a.add(y.value.link);return a},Oe.Object.defineProperties(kr.prototype,{layout:{get:function(){return this.Sc},set:function(a){a!==null&&(this.Sc=a)}},vertexes:{get:function(){return this.wf}},edges:{get:function(){return this.ye}}}),kr.prototype.findAllParts=kr.prototype.dz,kr.prototype.splitIntoSubNetworks=kr.prototype.Zx,kr.prototype.deleteSelfEdges=kr.prototype.Ko,kr.prototype.reverseEdge=kr.prototype.gm,kr.prototype.linkVertexes=kr.prototype.Zj,kr.prototype.findEdge=kr.prototype.Lo,kr.prototype.deleteLink=kr.prototype.Yy,kr.prototype.deleteEdge=kr.prototype.Mj,kr.prototype.addLink=kr.prototype.Dy,kr.prototype.addEdge=kr.prototype.Bo,kr.prototype.findVertex=kr.prototype.ki,kr.prototype.deleteNode=kr.prototype.Zy,kr.prototype.deleteVertex=kr.prototype.Iu,kr.prototype.addNode=kr.prototype.Bl,kr.prototype.addVertex=kr.prototype.dh,kr.prototype.addParts=kr.prototype.lg,kr.className="LayoutNetwork";function ns(a){qr(this),this.ob=a,this.j=new ye(0,0,10,10).freeze(),this.o=new jt(5,5).freeze(),this.Sh=this.ub=null,this.tg=new Ve,this.mg=new Ve}ns.prototype.clear=function(){this.Sh=this.ub=null,this.tg=new Ve,this.mg=new Ve},ns.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutVertex#"+Co(this);if(0<a&&(y+=this.node!==null?"("+this.node.toString()+")":"",1<a)){a="";for(var x=!0,b=this.tg.iterator;b.next();){var E=b.value;x?x=!1:a+=",",a+=E.toString(0)}for(E="",x=!0,b=this.mg.iterator;b.next();){var z=b.value;x?x=!1:E+=",",E+=z.toString(0)}y+=" sources: "+a+" destinations: "+E}return y},ns.prototype.commit=function(){var a=this.ub;if(a!==null){var y=this.bounds,x=a.bounds;Ue(x)?(x.x=y.x,x.y=y.y,x.width=y.width,x.height=y.height):a.bounds=y.copy()}else if(a=this.node,a!==null){if(y=this.bounds,!(a instanceof Yn)){x=ye.alloc(),a.Va();var b=this.network.layout.ni(a,x),E=a.locationObject.ga(Xi);if(b.w()&&E.w()){a.moveTo(y.x+this.focusX-(E.x-b.x),y.y+this.focusY-(E.y-b.y)),ye.free(x);return}ye.free(x)}a.moveTo(y.x,y.y)}},ns.prototype.Cl=function(a){a!==null&&(this.tg.contains(a)||this.tg.add(a))},ns.prototype.Kl=function(a){a!==null&&this.tg.remove(a)},ns.prototype.zl=function(a){a!==null&&(this.mg.contains(a)||this.mg.add(a))},ns.prototype.Jl=function(a){a!==null&&this.mg.remove(a)};function ry(a,y){return a=a.Sh,y=y.Sh,a?y?(a=a.text,y=y.text,a<y?-1:a>y?1:0):1:y!==null?-1:0}Oe.Object.defineProperties(ns.prototype,{sourceEdgesArrayAccess:{get:function(){return this.tg._dataArray}},destinationEdgesArrayAccess:{get:function(){return this.mg._dataArray}},data:{get:function(){return this.ub},set:function(a){if(this.ub=a,a!==null&&a.bounds){var y=a.bounds;a=y.x;var x=y.y,b=y.width;y=y.height,this.o.h(b/2,y/2),this.j.h(a,x,b,y)}}},node:{get:function(){return this.Sh},set:function(a){if(this.Sh!==a){this.Sh=a,a.Va();var y=this.network.layout,x=ye.alloc(),b=y.ni(a,x);y=b.x;var E=b.y,z=b.width;if(b=b.height,isNaN(y)&&(y=0),isNaN(E)&&(E=0),this.j.h(y,E,z,b),ye.free(x),!(a instanceof Yn)&&(a=a.locationObject.ga(Xi),a.w())){this.o.h(a.x-y,a.y-E);return}this.o.h(z/2,b/2)}}},bounds:{get:function(){return this.j},set:function(a){this.j.D(a)||this.j.assign(a)}},focus:{get:function(){return this.o},set:function(a){this.o.D(a)||this.o.assign(a)}},centerX:{get:function(){return this.j.x+this.o.x},set:function(a){var y=this.j;y.x+this.o.x!==a&&(y.ka(),y.x=a-this.o.x,y.freeze())}},centerY:{get:function(){return this.j.y+this.o.y},set:function(a){var y=this.j;y.y+this.o.y!==a&&(y.ka(),y.y=a-this.o.y,y.freeze())}},focusX:{get:function(){return this.o.x},set:function(a){var y=this.o;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},focusY:{get:function(){return this.o.y},set:function(a){var y=this.o;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},x:{get:function(){return this.j.x},set:function(a){var y=this.j;y.x!==a&&(y.ka(),y.x=a,y.freeze())}},y:{get:function(){return this.j.y},set:function(a){var y=this.j;y.y!==a&&(y.ka(),y.y=a,y.freeze())}},width:{get:function(){return this.j.width},set:function(a){var y=this.j;y.width!==a&&(y.ka(),y.width=a,y.freeze())}},height:{get:function(){return this.j.height},set:function(a){var y=this.j;y.height!==a&&(y.ka(),y.height=a,y.freeze())}},network:{get:function(){return this.ob},set:function(a){this.ob=a}},sourceVertexes:{get:function(){for(var a=new Ye,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);return a.iterator}},destinationVertexes:{get:function(){for(var a=new Ye,y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},vertexes:{get:function(){for(var a=new Ye,y=this.sourceEdges;y.next();)a.add(y.value.fromVertex);for(y=this.destinationEdges;y.next();)a.add(y.value.toVertex);return a.iterator}},sourceEdges:{get:function(){return this.tg.iterator}},destinationEdges:{get:function(){return this.mg.iterator}},edges:{get:function(){for(var a=new Ve,y=this.sourceEdges;y.next();)a.add(y.value);for(y=this.destinationEdges;y.next();)a.add(y.value);return a.iterator}},edgesCount:{get:function(){return this.tg.count+this.mg.count}}}),ns.prototype.deleteDestinationEdge=ns.prototype.Jl,ns.prototype.addDestinationEdge=ns.prototype.zl,ns.prototype.deleteSourceEdge=ns.prototype.Kl,ns.prototype.addSourceEdge=ns.prototype.Cl,ns.className="LayoutVertex",ns.standardComparer=ry,ns.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.Sh;var x=y.Sh;if(a!==null){if(x!==null){for(y=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),a=x.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),x=0;x<y.length;x++)if(a[x]!==""&&a[x]!==void 0){var b=parseFloat(y[x]),E=parseFloat(a[x]);if(isNaN(b))if(isNaN(E)){if(y[x].localeCompare(a[x])!==0)return y[x].localeCompare(a[x])}else return 1;else{if(isNaN(E))return-1;if(b-E!==0)return b-E}}else if(y[x]!=="")return 1;return a[x]!==""&&a[x]!==void 0?-1:0}return 1}return x!==null?-1:0}return 1}return y!==null?-1:0};function vl(a){qr(this),this.nb=a,this.qd=this.kd=this.$k=this.ub=null}vl.prototype.clear=function(){this.qd=this.kd=this.$k=this.ub=null},vl.prototype.toString=function(a){a===void 0&&(a=0);var y="LayoutEdge#"+Co(this);return 0<a&&(y+=this.$k!==null?"("+this.$k.toString()+")":"",1<a&&(y+=" "+(this.kd?this.kd.toString():"null")+" --> "+(this.qd?this.qd.toString():"null"))),y},vl.prototype.gm=function(){var a=this.kd;this.kd=this.qd,this.qd=a},vl.prototype.commit=function(){},vl.prototype.Ax=function(a){return this.qd===a?this.kd:this.kd===a?this.qd:null},Oe.Object.defineProperties(vl.prototype,{network:{get:function(){return this.nb},set:function(a){this.nb=a}},data:{get:function(){return this.ub},set:function(a){this.ub!==a&&(this.ub=a)}},link:{get:function(){return this.$k},set:function(a){this.$k!==a&&(this.$k=a)}},fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}}}),vl.prototype.getOtherVertex=vl.prototype.Ax,vl.className="LayoutEdge";function Is(a){Zr.call(this),this.isViewportSized=!0,this.yo=this.zo=NaN,this.yg=new Ze(NaN,NaN).freeze(),this.tf=new Ze(10,10).freeze(),this.Jb=Np,this.Rb=a0,this.nd=Dp,this.hd=uS,a&&Object.assign(this,a)}le(Is,Zr),Is.prototype.cloneProtected=function(a){Zr.prototype.cloneProtected.call(this,a),a.zo=this.zo,a.yo=this.yo,a.yg.assign(this.yg),a.tf.assign(this.tf),a.Jb=this.Jb,a.Rb=this.Rb,a.nd=this.nd,a.hd=this.hd},Is.prototype.qb=function(a){a.classType===Is?a===Dp||a===u0||a===oy||a===l0?this.sorting=a:a===a0||a===zu?this.arrangement=a:a===Np||a===s0?this.alignment=a:fe("Unknown enum value: "+a):Zr.prototype.qb.call(this,a)},Is.prototype.doLayout=function(a){this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var y=this.ex(a);a=this.diagram;for(var x=y.copy().iterator;x.next();){var b=x.value;if(!b.ph()||b.fromNode===null&&b.toNode===null){if(b.Va(),b instanceof Yn)for(b=b.memberParts;b.next();)y.remove(b.value)}else y.remove(b)}var E=y.Fa();if(E.length!==0){switch(this.sorting){case l0:E.reverse();break;case Dp:E.sort(this.comparer);break;case u0:E.sort(this.comparer),E.reverse()}var z=this.wrappingColumn;isNaN(z)&&(z=0);var tt=this.wrappingWidth;switch(isNaN(tt)&&a!==null?(y=a.padding,tt=Math.max(a.viewportBounds.width-y.left-y.right,0)):tt=Math.max(this.wrappingWidth,0),0>=z&&0>=tt&&(z=1),y=this.spacing.width,isFinite(y)||(y=0),x=this.spacing.height,isFinite(x)||(x=0),a!==null&&a.Ea("Layout"),b=[],this.alignment){case s0:var rt=y,ot=x,at=ye.alloc(),ut=Math.max(this.cellSize.width,1);if(!isFinite(ut))for(var ct=ut=0;ct<E.length;ct++){var mt=this.ni(E[ct],at);ut=Math.max(ut,mt.width)}if(ut=Math.max(ut+rt,1),ct=Math.max(this.cellSize.height,1),!isFinite(ct))for(mt=ct=0;mt<E.length;mt++){var yt=this.ni(E[mt],at);ct=Math.max(ct,yt.height)}ct=Math.max(ct+ot,1),mt=this.arrangement;for(var St=yt=this.arrangementOrigin.x,Lt=this.arrangementOrigin.y,Ot=0,Dt=0,Gt=0;Gt<E.length;Gt++){var Vt=E[Gt],Yt=this.ni(Vt,at),qt=Math.ceil((Yt.width+rt)/ut)*ut,ae=Math.ceil((Yt.height+ot)/ct)*ct;switch(mt){case zu:var Je=Math.abs(St-Yt.width);break;default:Je=St+Yt.width}switch((0<z&&Ot>z-1||0<tt&&0<Ot&&Je-yt>tt)&&(b.push(new ye(0,Lt,tt+rt,Dt)),Ot=0,St=yt,Lt+=Dt,Dt=0),Dt=Math.max(Dt,ae),mt){case zu:Yt=-Yt.width;break;default:Yt=0}switch(Vt.moveTo(St+Yt,Lt),mt){case zu:St-=qt;break;default:St+=qt}Ot++}b.push(new ye(0,Lt,tt+rt,Dt)),ye.free(at);break;case Np:for(ot=tt,ut=z,ct=y,mt=x,tt=ye.alloc(),yt=Math.max(this.cellSize.width,1),z=Lt=at=0,rt=jt.alloc(),St=0;St<E.length;St++)Dt=E[St],Ot=this.ni(Dt,tt),Dt=bd(Dt,Dt.locationObject,Dt.locationSpot,rt),at=Math.max(at,Dt.x),Lt=Math.max(Lt,Ot.width-Dt.x),z=Math.max(z,Dt.y);switch(St=this.arrangement,St){case zu:at+=ct;break;default:Lt+=ct}yt=isFinite(yt)?Math.max(yt+ct,1):Math.max(at+Lt,1);var un=Dt=this.arrangementOrigin.x;for(Gt=this.arrangementOrigin.y,Lt=0,ot>=at&&(ot-=at),at=Vt=0,qt=Math.max(this.cellSize.height,1),Yt=z=0,ae=!0,Ot=jt.alloc(),Je=0;Je<E.length;Je++){var nn=E[Je],Ge=this.ni(nn,tt),we=bd(nn,nn.locationObject,nn.locationSpot,rt);if(0<Lt)switch(St){case zu:un=(un-Dt-(Ge.width-we.x))/yt,un=ne.$(Math.round(un),un)?Math.round(un):Math.floor(un),un=un*yt+Dt;break;default:un=(un-Dt+we.x)/yt,un=ne.$(Math.round(un),un)?Math.round(un):Math.ceil(un),un=un*yt+Dt}else switch(St){case zu:Vt=un+we.x+Ge.width;break;default:Vt=un-we.x}switch(St){case zu:var Un=-(un+we.x)+Vt;break;default:Un=un+Ge.width-we.x-Vt}if(0<ut&&Lt>ut-1||0<ot&&0<Lt&&Un>ot){for(b.push(new ye(0,ae?Gt-z:Gt,ot+ct,Yt+z+mt)),un=0;un<Lt&&Je!==Lt;un++){Un=E[Je-Lt+un];var jn=bd(Un,Un.locationObject,Un.locationSpot,Ot);Un.moveTo(Un.position.x,Un.position.y+z-jn.y)}Yt+=mt,Gt=ae?Gt+Yt:Gt+(Yt+z),Lt=Yt=z=0,un=Dt,ae=!1}switch(un===Dt&&(at=St===zu?Math.max(at,Ge.width-we.x):Math.min(at,-we.x)),z=Math.max(z,we.y),Yt=Math.max(Yt,Ge.height-we.y),isFinite(qt)&&(Yt=Math.max(Yt,Math.max(Ge.height,qt)-we.y)),ae?nn.moveTo(un-we.x,Gt-we.y):nn.moveTo(un-we.x,Gt),St){case zu:un-=we.x+ct;break;default:un+=Ge.width-we.x+ct}Lt++}if(b.push(new ye(0,Gt,ot+ct,(ae?Yt:Yt+z)+mt)),E.length!==Lt)for(ot=0;ot<Lt;ot++)ut=E[E.length-Lt+ot],ct=bd(ut,ut.locationObject,ut.locationSpot,rt),ut.moveTo(ut.position.x,ut.position.y+z-ct.y);if(jt.free(rt),jt.free(Ot),St===zu)for(E=0;E<b.length;E++)z=b[E],z.width+=at,z.x-=at;else for(E=0;E<b.length;E++)z=b[E],z.x>at&&(z.width+=z.x-at,z.x=at);ye.free(tt)}for(rt=z=tt=E=0;rt<b.length;rt++)ot=b[rt],E=Math.min(E,ot.x),tt=Math.min(tt,ot.y),z=Math.max(z,ot.x+ot.width);this.arrangement===zu?this.commitLayers(b,new jt(E+y/2-(z+E),tt-x/2)):this.commitLayers(b,new jt(E-y/2,tt-x/2)),a!==null&&a.eb("Layout"),this.isValidLayout=!0}},Is.prototype.commitLayers=function(){};function uS(a,y){return a=a.text,y=y.text,a<y?-1:a>y?1:0}Oe.Object.defineProperties(Is.prototype,{wrappingWidth:{get:function(){return this.zo},set:function(a){this.zo!==a&&(0<a||isNaN(a))&&(this.zo=a,this.isViewportSized=isNaN(a),this.C())}},wrappingColumn:{get:function(){return this.yo},set:function(a){this.yo!==a&&(0<a||isNaN(a))&&(this.yo=a,this.C())}},cellSize:{get:function(){return this.yg},set:function(a){this.yg.D(a)||(this.yg.assign(a),this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf.D(a)||(this.tf.assign(a),this.C())}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb===a||a!==Np&&a!==s0||(this.Jb=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==a0&&a!==zu||(this.Rb=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==oy&&a!==l0&&a!==Dp&&a!==u0||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}}});var s0=new me(Is,"Position",0),Np=new me(Is,"Location",1),a0=new me(Is,"LeftToRight",2),zu=new me(Is,"RightToLeft",3),oy=new me(Is,"Forward",4),l0=new me(Is,"Reverse",5),Dp=new me(Is,"Ascending",6),u0=new me(Is,"Descending",7);Is.className="GridLayout",Is.standardComparer=uS,Is.smartComparer=function(a,y){if(a!==null){if(y!==null){a=a.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/),y=y.text.toLocaleLowerCase().split(/([+-]?[.]?\d+(?:\.\d*)?(?:e[+-]?\d+)?)/);for(var x=0;x<a.length;x++)if(y[x]!==""&&y[x]!==void 0){var b=parseFloat(a[x]),E=parseFloat(y[x]);if(isNaN(b))if(isNaN(E)){if(a[x].localeCompare(y[x])!==0)return a[x].localeCompare(y[x])}else return 1;else{if(isNaN(E))return-1;if(b-E!==0)return b-E}}else if(a[x]!=="")return 1;return y[x]!==""&&y[x]!==void 0?-1:0}return 1}return y!==null?-1:0},Is.Position=s0,Is.Location=Np,Is.LeftToRight=a0,Is.RightToLeft=zu,Is.Forward=oy,Is.Reverse=l0,Is.Ascending=Dp,Is.Descending=u0;function rr(){this.On=new Ye,this.Dn=new Ye,this.Pa=new Ye,this.cf=new xn,this.bf=new xn,this.aj=new xn,this.H=null,this.tp=!1}xt=rr.prototype,xt.clear=function(){this.On.clear(),this.Dn.clear(),this.Pa.clear(),this.cf.clear(),this.bf.clear(),this.aj.clear()},xt.Xe=function(a){this.H=a},xt.oi=function(a){if(a instanceof $e){if(this.On.add(a),a instanceof Yn){var y=a.containingGroup;y===null?this.H.ai.add(a):y.gl.add(a),y=a.layout,y!==null&&(y.diagram=this.H)}}else a instanceof _e?this.Dn.add(a):a instanceof Bi||this.Pa.add(a);y=a.data,y===null||a instanceof Bi||(a instanceof _e?this.bf.add(y,a):this.cf.add(y,a))},xt.pc=function(a){if(a.Ej(),a instanceof $e){if(this.On.remove(a),a instanceof Yn){var y=a.containingGroup;y===null?this.H.ai.remove(a):y.gl.remove(a),y=a.layout,y!==null&&(y.diagram=null)}}else a instanceof _e?this.Dn.remove(a):a instanceof Bi||this.Pa.remove(a);y=a.data,y===null||a instanceof Bi||(a instanceof _e?this.bf.remove(y):this.cf.remove(y))},xt.Wd=function(){var a=this.H;if(a!==null){for(var y=a.nodeTemplateMap.iterator;y.next();){var x=y.value,b=y.key;(!x.Zc()||x instanceof Yn)&&fe('Invalid node template in Diagram.nodeTemplateMap: template for "'+b+'" must be a Node or a simple Part, not a Group or Link: '+x)}for(y=a.groupTemplateMap.iterator;y.next();)x=y.value,b=y.key,x instanceof Yn||fe('Invalid group template in Diagram.groupTemplateMap: template for "'+b+'" must be a Group, not a normal Node or Link: '+x);for(y=a.linkTemplateMap.iterator;y.next();)x=y.value,b=y.key,x instanceof _e||fe('Invalid link template in Diagram.linkTemplateMap: template for "'+b+'" must be a Link, not a normal Node or simple Part: '+x);for(y=Kn(),x=a.selection.iterator;x.next();)(b=x.value.data)&&y.push(b);for(x=Kn(),a=a.highlighteds.iterator;a.next();)(b=a.value.data)&&x.push(b);for(a=Kn(),b=this.nodes.iterator;b.next();){var E=b.value;E.data!==null&&(a.push(E.data),a.push(E.location))}for(b=this.links.iterator;b.next();)E=b.value,E.data!==null&&(a.push(E.data),a.push(E.location));for(b=this.parts.iterator;b.next();)E=b.value,E.data!==null&&(a.push(E.data),a.push(E.location));for(this.removeAllModeledParts(),this.addAllModeledParts(),b=0;b<y.length;b++)E=this.Lc(y[b]),E!==null&&(E.isSelected=!0);for(b=0;b<x.length;b++)E=this.Lc(x[b]),E!==null&&(E.isHighlighted=!0);for(b=0;b<a.length;b+=2)E=this.Lc(a[b]),E!==null&&(E.location=a[b+1]);zn(y),zn(x),zn(a)}},rr.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)},rr.prototype.addModeledParts=function(a,y){var x=this,b=this.diagram.model;a.forEach(function(E){b.lb(E)&&hS(x,E,!1)}),a.forEach(function(E){b.lb(E)&&x.resolveReferencesForData(E)}),y!==!1&&Zh(this.diagram,!1)};function hS(a,y,x){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.cf.contains(y)){x===void 0&&(x=!0);t:{if(y!=null&&!a.H.undoManager.isUndoingRedoing&&!a.cf.contains(y)){var b=a.Ro(y),E=dS(a,y,b);if(E!==null&&(ru(E),E=E.copy(),E!==null)){var z=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,E.Tf=b,E.ub=y,a.tp&&(E.Jg="Tool"),a.diagram.add(E),E.ub=null,E.data=y,a.diagram.skipsModelSourceBindings=z,b=E;break t}}b=null}b!==null&&x&&a.resolveReferencesForData(y)}}rr.prototype.insertLink=function(){return null},rr.prototype.resolveReferencesForData=function(){},rr.prototype.Ro=function(a){return this.H.model.Ro(a)};function dS(a,y,x){a=a.H;var b=a.model;return b.Xj()&&b.Yu(y)?(y=a.groupTemplateMap.I(x),y===null&&(y=a.groupTemplateMap.I(""),y===null&&(gS||(gS=!0,Ki('No Group template found for category "'+x+'"'),Ki(" Using default group template")),y=a.ly))):(y=a.nodeTemplateMap.I(x),y===null&&(y=a.nodeTemplateMap.I(""),y===null&&(cS||(cS=!0,Ki('No Node template found for category "'+x+'"'),Ki(" Using default node template")),y=a.ny))),y}rr.prototype.getLinkCategoryForData=function(){return""},rr.prototype.setLinkCategoryForData=function(){},rr.prototype.setFromNodeForLink=function(){},rr.prototype.setToNodeForLink=function(){},rr.prototype.findLinkTemplateForCategory=function(a){var y=this.H,x=y.linkTemplateMap.I(a);return x===null&&(x=y.linkTemplateMap.I(""),x===null&&(pS||(pS=!0,Ki('No Link template found for category "'+a+'"'),Ki(" Using default link template")),x=y.my)),x},rr.prototype.removeAllModeledParts=function(){this.Gs(this.diagram.model.nodeDataArray)},rr.prototype.Gs=function(a){var y=this;a.forEach(function(x){y.ip(x)})},rr.prototype.ip=function(a){a=this.Lc(a),a!==null&&(Vf(this.diagram,a,!1),this.unresolveReferencesForPart(a))},rr.prototype.unresolveReferencesForPart=function(){},rr.prototype.removeDataForLink=function(){},rr.prototype.findPartForKey=function(a){return a==null?null:(a=this.H.model.hc(a),a!==null?this.cf.I(a):null)},rr.prototype.Vb=function(a){return a==null||(a=this.H.model.hc(a),a===null)?null:(a=this.cf.I(a),a instanceof $e?a:null)},rr.prototype.findLinkForKey=function(){return null},xt=rr.prototype,xt.Lc=function(a){if(a===null)return null;var y=this.cf.I(a);return y!==null?y:y=this.bf.I(a)},xt.ii=function(a){return a===null?null:(a=this.cf.I(a),a instanceof $e?a:null)},xt.Kc=function(a){return a===null?null:this.bf.I(a)},xt.ms=function(a){for(var y=0;y<arguments.length;++y);y=new Ye;for(var x=this.On.iterator;x.next();){var b=x.value,E=b.data;if(E!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Ue(tt)&&sy(this,E,tt)){y.add(b);break}}}return y.iterator},xt.ls=function(a){for(var y=0;y<arguments.length;++y);y=new Ye;for(var x=this.Dn.iterator;x.next();){var b=x.value,E=b.data;if(E!==null)for(var z=0;z<arguments.length;z++){var tt=arguments[z];if(Ue(tt)&&sy(this,E,tt)){y.add(b);break}}}return y.iterator};function sy(a,y,x){for(var b in x){var E=y[b],z=x[b];if(Gn(z)){if(!Gn(E)||E.length<z.length)return!1;for(var tt=0;tt<E.length;tt++){var rt=z[tt];if(rt!==void 0&&!fS(a,E[tt],rt))return!1}}else if(!fS(a,E,z))return!1}return!0}function fS(a,y,x){if(typeof x=="function"){if(!x(y))return!1}else if(x instanceof RegExp){if(!y||!x.test(y.toString()))return!1}else if(Ue(y)&&Ue(x)){if(!sy(a,y,x))return!1}else if(y!==x)return!1;return!0}rr.prototype.doModelChanged=function(a){if(this.H){var y=this.H;if(a.model===y.model){var x=a.change;if(y.doModelChanged(a),y.aa){y.aa=!1;try{var b=a.modelChange;if(b!=="")if(x===Ur){if(b==="nodeCategory"){var E=this.Lc(a.object),z=a.newValue;E!==null&&typeof z=="string"&&(E.category=z)}else b==="nodeDataArray"&&(this.Gs(a.oldValue),this.addModeledParts(a.newValue));y.isModified=!0}else if(x===ko){var tt=a.newValue;b==="nodeDataArray"&&Ue(tt)&&hS(this,tt),y.isModified=!0}else if(x===Bo){var rt=a.oldValue;b==="nodeDataArray"&&Ue(rt)&&this.ip(rt),y.isModified=!0}else x===za&&(b==="SourceChanged"?a.object!==null?this.updateDataBindings(a.object,a.propertyName):(this.rp(),this.updateAllTargetBindings()):b==="ModelDisplaced"&&this.Wd());else if(x===Ur){var ot=a.propertyName,at=a.object;at===y.model?(ot==="nodeKeyProperty"||ot==="nodeCategoryProperty")&&(y.undoManager.isUndoingRedoing||this.Wd()):this.updateDataBindings(at,ot),y.isModified=!0}else if(x===ko||x===Bo){var ut=a.change===ko,ct=ut?a.newParam:a.oldParam,mt=ut?a.newValue:a.oldValue,yt=this.aj.I(a.object);if(Array.isArray(yt))for(a=0;a<yt.length;a++){var St=yt[a];if(ut)Em(St,mt,ct,!0);else if(!(0>ct)){var Lt=ct+cp(St);St.pc(Lt,!0),xv(St,Lt,ct)}}y.isModified=!0}}finally{y.aa=!0}}}}},rr.prototype.updateAllTargetBindings=function(a){a===void 0&&(a="");for(var y=this.parts.iterator;y.next();)y.value.La(a);for(y=this.nodes.iterator;y.next();)y.value.La(a);for(y=this.links.iterator;y.next();)y.value.La(a)},rr.prototype.rp=function(){for(var a=this.H.model,y=new Ye,x=a.nodeDataArray,b=0;b<x.length;b++)y.add(x[b]);var E=[];for(this.nodes.each(function(tt){tt.data===null||y.contains(tt.data)||E.push(tt.data)}),this.parts.each(function(tt){tt.data===null||y.contains(tt.data)||E.push(tt.data)}),E.forEach(function(tt){LS(a,tt,!1)}),b=0;b<x.length;b++){var z=x[b];this.Lc(z)===null&&CS(a,z,!1)}for(this.refreshDataBoundLinks(),x=this.parts.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.nodes.iterator;x.next();)x.value.updateRelationshipsFromData();for(x=this.links.iterator;x.next();)x.value.updateRelationshipsFromData()},rr.prototype.refreshDataBoundLinks=function(){},rr.prototype.updateRelationshipsFromData=function(){},rr.prototype.updateDataBindings=function(a,y){if(typeof y=="string"){var x=this.Lc(a);if(x!==null)x.La(y);else{x=null;for(var b=this.aj.iterator;b.next();){for(var E=b.value,z=0;z<E.length;z++){var tt=E[z].sx(a);tt!==null&&(x===null&&(x=Kn()),x.push(tt))}if(x!==null)break}if(x!==null){for(b=0;b<x.length;b++)x[b].La(y);zn(x)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(y)}};function ay(a,y){var x=y.Hh;if(Gn(x)){var b=a.aj.I(x);if(b===null)b=[],b.push(y),a.aj.add(x,b);else{for(a=0;a<b.length;a++)if(b[a]===y)return;b.push(y)}}}function ly(a,y,x){qf(y,function(tt){tt=tt.O.s;for(var rt=tt.length,ot=0;ot<rt;ot++)rh(x,tt[ot])});var b=y.Hh;if(Gn(b)){var E=a.aj.I(b);if(E!==null){for(var z=0;z<E.length;z++)if(E[z]===y){E.splice(z,1),E.length===0&&a.aj.remove(b);break}}}}rr.prototype.Kj=function(a,y,x){x===void 0&&(x=!1);var b=new xn;if(Gn(a))for(var E=0;E<a.length;E++)h0(this,a[E],y,b,x);else for(a=a.iterator;a.next();)h0(this,a.value,y,b,x);if(y!==null){x=y.model,a=y.toolManager.findTool("Dragging"),a=a!==null?a.dragOptions.dragsLink:y.Wm.dragsLink,E=new Ye;for(var z=new xn,tt=b.iterator;tt.next();){var rt=tt.value;if(rt instanceof _e)a||rt.fromNode!==null&&rt.toNode!==null||E.add(rt);else if(rt instanceof $e&&rt.data!==null&&x.Tl()){var ot=rt;rt=tt.key;var at=rt.pg();at!==null&&(at=b.I(at),at!==null?(x.qe(ot.data,x.wa(at.data)),ot=y.Kc(ot.data),rt=rt.kh(),rt!==null&&ot!==null&&z.add(rt,ot)):x.qe(ot.data,void 0))}}if(0<E.count&&y.Is(E,!1),0<z.count)for(x=z.iterator;x.next();)b.add(x.key,x.value)}if(y!==null&&this.H!==null&&(y=y.model,x=y.afterCopyFunction,x!==null)){var ut=new xn;b.each(function(ct){ct.key.data!==null&&ut.add(ct.key.data,ct.value.data)}),x(ut,y,this.H.model)}for(y=b.iterator;y.next();)y.value.La();return b};function h0(a,y,x,b,E){if(y===null||E&&!y.canCopy())return null;if(b.contains(y))return b.I(y);var z=a.copyPartData(y,x);if(!(z instanceof vn))return null;if(z.isSelected=!1,z.isHighlighted=!1,b.add(y,z),y instanceof $e){for(var tt=y.linksConnected;tt.next();){var rt=tt.value;if(rt.fromNode===y){var ot=b.I(rt);ot!==null&&(ot.fromNode=z)}rt.toNode===y&&(rt=b.I(rt),rt!==null&&(rt.toNode=z))}if(y instanceof Yn&&z instanceof Yn)for(y=y.memberParts;y.next();)tt=h0(a,y.value,x,b,E),tt instanceof _e||tt===null||(tt.containingGroup=z)}else if(y instanceof _e&&z instanceof _e)for(tt=y.fromNode,tt!==null&&(tt=b.I(tt),tt!==null&&(z.fromNode=tt)),tt=y.toNode,tt!==null&&(tt=b.I(tt),tt!==null&&(z.toNode=tt)),y=y.labelNodes;y.next();)tt=h0(a,y.value,x,b,E),tt!==null&&tt instanceof $e&&(tt.labeledLink=z);return z}rr.prototype.copyPartData=function(a,y){var x=null,b=a.data;if(b!==null&&y!==null){var E=y.model;a instanceof _e||(b=E.copyNodeData(b),Ue(b)&&(E.xf(b),x=y.Lc(b)))}else ru(a),x=a.copy(),x!==null&&(E=this.H,y!==null?y.add(x):b!==null&&E!==null&&E.commandHandler!==null&&E.commandHandler.copiesClipboardData&&(y=E.model,E=null,x instanceof _e||(E=y.copyNodeData(b)),Ue(E)&&(x.data=E)));return x},Oe.Object.defineProperties(rr.prototype,{nodes:{get:function(){return this.On}},links:{get:function(){return this.Dn}},parts:{get:function(){return this.Pa}},diagram:{get:function(){return this.H}},addsToTemporaryLayer:{get:function(){return this.tp},set:function(a){this.tp=a}}}),rr.prototype.updateAllRelationshipsFromData=rr.prototype.rp,rr.prototype.findLinksByExample=rr.prototype.ls,rr.prototype.findNodesByExample=rr.prototype.ms,rr.prototype.findLinkForData=rr.prototype.Kc,rr.prototype.findNodeForData=rr.prototype.ii,rr.prototype.findPartForData=rr.prototype.Lc,rr.prototype.findNodeForKey=rr.prototype.Vb,rr.prototype.removeModeledPart=rr.prototype.ip,rr.prototype.removeModeledParts=rr.prototype.Gs,rr.prototype.rebuildParts=rr.prototype.Wd;var cS=!1,gS=!1,pS=!1;rr.className="PartManager";function Ss(a){rr.apply(this,arguments)}le(Ss,rr),Ss.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray),mS(this,a.linkDataArray)},Ss.prototype.addModeledParts=function(a){for(rr.prototype.addModeledParts.call(this,a,!1),a=this.links.iterator;a.next();)Cg(a.value);Zh(this.diagram,!1)};function mS(a,y){y.forEach(function(x){vS(a,x)}),Zh(a.diagram,!1)}function vS(a,y){if(y!=null&&!a.diagram.undoManager.isUndoingRedoing&&!a.bf.contains(y)){var x=a.getLinkCategoryForData(y),b=a.findLinkTemplateForCategory(x);if(b!==null){ru(b);var E=b.copy();if(E!==null){b=a.diagram.skipsModelSourceBindings,a.diagram.skipsModelSourceBindings=!0,E.Tf=x,E.ub=y,x=a.diagram.model;var z=g0(x,y,!0);z!==""&&(E.fromPortId=z),z=Bl(x,y,!0),z!==void 0&&(z=a.Vb(z),z instanceof $e&&(E.fromNode=z)),z=g0(x,y,!1),z!==""&&(E.toPortId=z),z=Bl(x,y,!1),z!==void 0&&(z=a.Vb(z),z instanceof $e&&(E.toNode=z)),x=x.Ef(y),Array.isArray(x)&&x.forEach(function(tt){tt=a.Vb(tt),tt!==null&&(tt.labeledLink=E)}),a.tp&&(E.Jg="Tool"),a.diagram.add(E),E.ub=null,E.data=y,a.diagram.skipsModelSourceBindings=b}}}}Ss.prototype.removeAllModeledParts=function(){var a=this.diagram.model;yS(this,a.linkDataArray),this.Gs(a.nodeDataArray)};function yS(a,y){y.forEach(function(x){a.ip(x)})}Ss.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ps(a)},Ss.prototype.setLinkCategoryForData=function(a,y){return this.diagram.model.lp(a,y)},Ss.prototype.setFromNodeForLink=function(a,y){var x=this.diagram.model;x.wv(a.data,x.wa(y!==null?y.data:null))},Ss.prototype.setToNodeForLink=function(a,y){var x=this.diagram.model;x.Bv(a.data,x.wa(y!==null?y.data:null))},Ss.prototype.removeDataForLink=function(a){this.diagram.model.bm(a.data)},Ss.prototype.findPartForKey=function(a){var y=rr.prototype.findPartForKey.call(this,a);return y===null&&(a=this.diagram.model.jh(a),a!==null)?this.bf.I(a):y},Ss.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.jh(a),a!==null?this.bf.I(a):null)},Ss.prototype.doModelChanged=function(a){var y=this;if(rr.prototype.doModelChanged.call(this,a),this.diagram){var x=this.diagram;if(a.model===x.model){var b=a.change;if(x.aa){x.aa=!1;try{var E=a.modelChange;if(E!==""){if(b===Ur){if(E==="linkFromKey"){var z=this.Kc(a.object);if(z!==null){var tt=this.Vb(a.newValue);z.fromNode=tt}}else if(E==="linkToKey"){var rt=this.Kc(a.object);if(rt!==null){var ot=this.Vb(a.newValue);rt.toNode=ot}}else if(E==="linkFromPortId"){var at=this.Kc(a.object);if(at!==null){var ut=a.newValue;typeof ut=="string"&&(at.fromPortId=ut)}}else if(E==="linkToPortId"){var ct=this.Kc(a.object);if(ct!==null){var mt=a.newValue;typeof mt=="string"&&(ct.toPortId=mt)}}else if(E==="nodeGroupKey"){var yt=this.Lc(a.object);if(yt!==null){var St=a.newValue;if(St!==void 0){var Lt=this.Vb(St);Lt instanceof Yn?yt.containingGroup=Lt:yt.containingGroup=null}else yt.containingGroup=null}}else if(E==="linkLabelKeys"){var Ot=this.Kc(a.object);if(Ot!==null){var Dt=a.oldValue,Gt=a.newValue;Array.isArray(Dt)&&Dt.forEach(function(we){0<=Gt.indexOf(we)||(we=y.Vb(we),we!==null&&(we.labeledLink=null))}),Array.isArray(Gt)&&Gt.forEach(function(we){we=y.Vb(we),we!==null&&(we.labeledLink=Ot)})}}else if(E==="linkCategory"){var Vt=this.Kc(a.object),Yt=a.newValue;Vt!==null&&typeof Yt=="string"&&(Vt.category=Yt)}else E==="linkDataArray"&&(yS(this,a.oldValue),mS(this,a.newValue));x.isModified=!0}else if(b===ko){var qt=a.newValue;if(E==="linkDataArray"&&typeof qt=="object"&&qt!==null)vS(this,qt);else if(E==="linkLabelKeys"&&hf(qt)){var ae=this.Kc(a.object),Je=this.Vb(qt);ae!==null&&Je!==null&&(Je.labeledLink=ae)}x.isModified=!0}else if(b===Bo){var un=a.oldValue;if(E==="linkDataArray"&&typeof un=="object"&&un!==null)this.ip(un);else if(E==="linkLabelKeys"&&hf(un)){var nn=this.Vb(un);nn!==null&&(nn.labeledLink=null)}x.isModified=!0}}else if(b===Ur){var Ge=a.propertyName;a.object!==x.model||Ge!=="linkFromKeyProperty"&&Ge!=="linkToKeyProperty"&&Ge!=="linkFromPortIdProperty"&&Ge!=="linkToPortIdProperty"&&Ge!=="linkLabelKeysProperty"&&Ge!=="nodeIsGroupProperty"&&Ge!=="nodeGroupKeyProperty"&&Ge!=="linkCategoryProperty"||x.undoManager.isUndoingRedoing||this.Wd(),x.isModified=!0}}finally{x.aa=!0}}}}},Ss.prototype.refreshDataBoundLinks=function(){var a=this,y=this.diagram.model,x=new Ye,b=y.linkDataArray;b.forEach(function(z){x.add(z)});var E=[];this.links.each(function(z){z.data===null||x.contains(z.data)||E.push(z.data)}),E.forEach(function(z){TS(y,z,!1)}),b.forEach(function(z){a.Kc(z)===null&&FS(y,z,!1)})},Ss.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var b=x.model;if(a instanceof _e){var E=Bl(b,y,!0);if(E=x.Vb(E),a.fromNode=E,E=Bl(b,y,!1),E=x.Vb(E),a.toNode=E,y=b.Ef(y),0<y.length||0<a.labelNodes.count){if(y.length===1&&a.labelNodes.count===1){E=y[0];var z=a.labelNodes.first();if(b.wa(z.data)===E)return}E=new Ye().addAll(y);var tt=new Ye;a.labelNodes.each(function(rt){rt.data!==null&&(rt=b.wa(rt.data),rt!==void 0&&tt.add(rt))}),y=tt.copy(),y.hp(E),E=E.copy(),E.hp(tt),(0<y.count||0<E.count)&&(y.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink===a&&(rt.labeledLink=null)}),E.each(function(rt){rt=x.Vb(rt),rt!==null&&rt.labeledLink!==a&&(rt.labeledLink=a)}))}}else!(a instanceof Bi)&&(y=b.lh(y),y=x.findPartForKey(y),y===null||y instanceof Yn)&&(a.containingGroup=y)}}},Ss.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var b=Ap(y,x),E=this.Lc(a);if(b!==null&&E!==null){b=b.iterator;for(var z={};b.next();){var tt=b.value;y.lb(tt)?E instanceof Yn&&y.lh(tt)===x&&(tt=this.Lc(tt),tt!==null&&(tt.containingGroup=E)):(z.link=this.Kc(tt),z.link!==null&&E instanceof $e&&(Bl(y,tt,!0)===x&&(z.link.fromNode=E),Bl(y,tt,!1)===x&&(z.link.toNode=E),tt=y.Ef(tt),Array.isArray(tt)&&tt.some(function(rt){return function(ot){return ot===x?(E.labeledLink=rt.link,!0):!1}}(z)))),z={link:z.link}}_u(y,x)}a=y.lh(a),a!==void 0&&(a=this.Vb(a),a instanceof Yn&&(E.containingGroup=a))}},Ss.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof $e){var x=y.wa(a.data);if(x!==void 0){for(var b=a.linksConnected;b.next();)Gu(y,x,b.value.data);if(a.isLinkLabel&&(b=a.labeledLink,b!==null&&Gu(y,x,b.data)),a instanceof Yn)for(a=a.memberParts;a.next();)b=a.value.data,y.lb(b)&&Gu(y,x,b)}}},Ss.prototype.copyPartData=function(a,y){var x=rr.prototype.copyPartData.call(this,a,y);if(a instanceof _e)if(a=a.data,a!==null&&y!==null){var b=y.model;a=b.Jo(a),typeof a=="object"&&a!==null&&(b.fi(a),x=y.Kc(a))}else x!==null&&(y=this.diagram,a!==null&&y!==null&&y.commandHandler!==null&&y.commandHandler.copiesClipboardData&&(y=y.model.Jo(a),typeof y=="object"&&y!==null&&(x.data=y)));return x},Ss.prototype.insertLink=function(a,y,x,b){var E=this.diagram,z=E.model,tt=E.toolManager.findTool("Linking"),rt="";if(a!==null&&(y===null&&(y=a),rt=y.portId,rt===null&&(rt="")),y="",x!==null&&(b===null&&(b=x),y=b.portId,y===null&&(y="")),b=tt.archetypeLinkData,b instanceof _e){if(ru(b),z=b.copy(),z!==null)return z.fromNode=a,z.fromPortId=rt,z.toNode=x,z.toPortId=y,E.add(z),a=tt.archetypeLabelNodeData,a instanceof $e&&(ru(a),a=a.copy(),a!==null&&(a.labeledLink=z,E.add(a))),z}else if(b!==null&&(b=z.Jo(b),typeof b=="object"&&b!==null))return a!==null&&Fg(z,b,z.wa(a.data),!0),Tg(z,b,rt,!0),x!==null&&Fg(z,b,z.wa(x.data),!1),Tg(z,b,y,!1),z.fi(b),a=tt.archetypeLabelNodeData,a===null||a instanceof $e||(a=z.copyNodeData(a),typeof a=="object"&&a!==null&&(z.xf(a),a=z.wa(a),a!==void 0&&z.Bu(b,a))),E.Kc(b);return null},Ss.prototype.findLinkForKey=Ss.prototype.findLinkForKey,Ss.prototype.findPartForKey=Ss.prototype.findPartForKey,Ss.prototype.removeAllModeledParts=Ss.prototype.removeAllModeledParts,Ss.prototype.addModeledParts=Ss.prototype.addModeledParts,Ss.prototype.addAllModeledParts=Ss.prototype.addAllModeledParts,Ss.className="GraphLinksPartManager";function Wl(){rr.apply(this,arguments),this.Sg=null}le(Wl,rr);function d0(a,y,x){if(y!==null&&x!==null&&x.kh()===null){var b=a.diagram.toolManager.findTool("Linking"),E=y,z=x;if(a.diagram.isTreePathToChildren||(E=x,z=y),(b===null||!Zs(b,E,z,null,!0))&&(y=a.getLinkCategoryForData(x.data),b=a.findLinkTemplateForCategory(y),b!==null&&(ru(b),b=b.copy(),b!==null))){var tt=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0,b.Tf=y,b.ub=x.data,b.fromNode=E,b.toNode=z,a.diagram.add(b),b.ub=null,b.data=x.data,a.diagram.skipsModelSourceBindings=tt}}}Wl.prototype.getLinkCategoryForData=function(a){return this.diagram.model.ss(a)},Wl.prototype.setLinkCategoryForData=function(a,y){this.diagram.model.Ms(a,y)},Wl.prototype.setFromNodeForLink=function(a,y,x){var b=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren)b.qe(a.data,b.wa(y));else{var E=this.Sg;this.Sg=a,x!==null&&b.qe(x.data,void 0),b.qe(y,b.wa(a.toNode!==null?a.toNode.data:null)),this.Sg=E}},Wl.prototype.setToNodeForLink=function(a,y,x){var b=this.diagram.model;if(x===void 0&&(x=null),y=y!==null?y.data:null,this.diagram.isTreePathToChildren){var E=this.Sg;this.Sg=a,x!==null&&b.qe(x.data,void 0),b.qe(y,b.wa(a.fromNode!==null?a.fromNode.data:null)),this.Sg=E}else b.qe(a.data,b.wa(y))},Wl.prototype.removeDataForLink=function(a){this.diagram.model.qe(a.data,void 0)},Wl.prototype.findLinkForKey=function(a){return a==null?null:(a=this.diagram.model.hc(a),a!==null?this.bf.I(a):null)},Wl.prototype.doModelChanged=function(a){if(rr.prototype.doModelChanged.call(this,a),this.diagram){var y=this.diagram;if(a.model===y.model){var x=a.change;if(y.aa){y.aa=!1;try{var b=a.modelChange;if(b!==""){if(x===Ur){if(b==="nodeParentKey"){var E=a.object,z=this.Vb(a.newValue),tt=this.ii(E);if(this.Sg!==null)z!==null&&(this.Sg.data=E,this.Sg.category=this.getLinkCategoryForData(E));else if(tt!==null){var rt=tt.kh();rt!==null?z===null?y.remove(rt):y.isTreePathToChildren?rt.fromNode=z:rt.toNode=z:d0(this,z,tt)}}else if(b==="parentLinkCategory"){var ot=this.ii(a.object),at=a.newValue;if(ot!==null&&typeof at=="string"){var ut=ot.kh();ut!==null&&(ut.category=at)}}y.isModified=!0}}else if(x===Ur){var ct=a.propertyName;a.object===y.model&&ct==="nodeParentKeyProperty"&&(y.undoManager.isUndoingRedoing||this.Wd()),y.isModified=!0}}finally{y.aa=!0}}}}},Wl.prototype.updateRelationshipsFromData=function(a){var y=a.data;if(y!==null){var x=a.diagram;if(x!==null){var b=x.model;a instanceof $e&&(y=b.mh(y),y=x.Vb(y),b=a.pg(),y!==b&&(b=a.kh(),y!==null?b!==null?x.isTreePathToChildren?b.fromNode=y:b.toNode=y:d0(this,y,a):b!==null&&Vf(x,b,!1)))}}},Wl.prototype.updateDataBindings=function(a,y){rr.prototype.updateDataBindings.call(this,a,y),typeof y=="string"&&this.Lc(a)!==null&&(a=this.Kc(a),a!==null&&a.La(y))},Wl.prototype.resolveReferencesForData=function(a){var y=this.diagram.model,x=y.wa(a);if(x!==void 0){var b=Ap(y,x),E=this.Lc(a);if(b!==null&&E!==null){for(b=b.iterator;b.next();){var z=b.value;y.lb(z)&&E instanceof $e&&y.mh(z)===x&&d0(this,E,this.ii(z))}_u(y,x)}a=y.mh(a),a!==void 0&&E instanceof $e&&(a=this.Vb(a),d0(this,a,E))}},Wl.prototype.unresolveReferencesForPart=function(a){var y=this.diagram.model;if(a instanceof $e){var x=y.wa(a.data),b=this.Kc(a.data);if(b!==null){b.isSelected=!1,b.isHighlighted=!1;var E=b.layer;if(E!==null){var z=E.pc(-1,b,!1);0<=z&&this.diagram.cb(Bo,"parts",E,b,null,z,null),z=b.layerChanged,z!==null&&z(b,E,null)}}for(b=this.diagram.isTreePathToChildren,a=a.linksConnected;a.next();)E=a.value,E=(b?E.toNode:E.fromNode).data,y.lb(E)&&Gu(y,x,E)}},Wl.prototype.insertLink=function(a,y,x){y=this.diagram.model;var b=a,E=x;return this.diagram.isTreePathToChildren||(b=x,E=a),b!==null&&E!==null?(y.qe(E.data,y.wa(b.data)),E.kh()):null},Wl.prototype.findLinkForKey=Wl.prototype.findLinkForKey,Wl.className="TreePartManager";function fn(a,y){this.kl=new Ye,this.il=new Ye,this.Wv=`,
|
|
"insertedNodeKeys": `,this.jy=`,
|
|
"modifiedNodeData": `,this.Yv=`,
|
|
"removedNodeKeys": `,this.vh=null,qr(this),this.Sm=this.xa="",this.Gg=!1,this.j={},this.Tc=[],this.kb=new xn,this.Th="key",this.Bk=this.bl=null,this.Jm=this.Km=!1,this.Mm=!0,this.xm=null,this.lj="category",this.Vf=new xn,this.Lt=new Ve,this.Wg=!1,this.o=null,this.undoManager=new eo,a!==void 0&&(Gn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}fn.prototype.cloneProtected=function(a){a.xa=this.xa,a.Sm=this.Sm,a.Gg=this.Gg,a.Th=this.Th,a.bl=this.bl,a.Bk=this.Bk,a.Km=this.Km,a.Jm=this.Jm,a.Mm=this.Mm,a.xm=this.xm,a.lj=this.lj},fn.prototype.copy=function(){var a=new this.constructor;return this.cloneProtected(a),a},fn.prototype.clear=function(){this.Tc=[],this.kb.clear(),this.Vf.clear(),this.undoManager.clear()},fn.prototype.toString=function(a){if(a===void 0&&(a=0),1<a)return this.np();var y=(this.name!==""?this.name:"")+" Model";if(0<a){y+=`
|
|
node data:`,a=this.nodeDataArray;for(var x=a.length,b=0;b<x;b++){var E=a[b];y+=" "+this.wa(E)+":"+Ir(E)}}return y},fn.prototype.xA=function(a){a.change!==za&&fe("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var y=a.object;return a.isTransactionFinished&&y instanceof as?(xS(this,y),a=this.Qv(y,a.propertyName==="FinishedUndo"),this.vh=null,a):null},fn.prototype.Qv=function(a,y){var x=this,b=!1,E=new Ye,z=new Ye,tt=new Ye,rt=this.vh;a.changes.each(function(ct){ct.model===x&&(ct.modelChange==="nodeDataArray"?ct.change===ko?E.add(ct.newValue):ct.change===Bo&&tt.add(ct.oldValue):x.lb(ct.object)?z.add(ct.object):ct.change!==Ur||x.modelData!==ct.object&&ct.propertyName!=="modelData"?ct.object!==null&&(rt&&rt.contains(ct.object)?rt.get(ct.object).each(function(mt){x.lb(mt)&&z.add(mt)}):ct.object instanceof fn||x.ri()&&x.Jc(ct.object)||PS(x,ct.object).each(function(mt){z.add(mt)})):b=!0)});var ot=this.il;ot.clear(),E.each(function(ct){ot.add(x.wa(ct)),y||z.add(ct)});var at=this.kl;at.clear(),tt.each(function(ct){at.add(x.wa(ct)),y&&z.add(ct)}),a=x.cloneDeep(z.Fa());var ut=null;return b&&(ut===null&&(ut={}),ut.modelData=this.cloneDeep(this.modelData)),0<ot.count&&(ut===null&&(ut={}),y?ut.removedNodeKeys=ot.Fa():ut.insertedNodeKeys=ot.Fa()),0<a.length&&(ut===null&&(ut={}),ut.modifiedNodeData=a),0<at.count&&(ut===null&&(ut={}),y?ut.insertedNodeKeys=at.Fa():ut.removedNodeKeys=at.Fa()),at.clear(),ot.clear(),ut},fn.prototype.cloneDeep=function(a){return Eg(this,a,!0)};function Eg(a,y,x,b,E,z){function tt(ct,mt){rt?(ct.__gohashid===void 0&&z.push(ct),b.set(ct,mt)):(ct=hl++,b.set(ct,mt),E.set(ct,y))}if(!Ue(y))return y;z||(z=[]);var rt=Object.isExtensible(y);if(b||(b=new xn),rt){var ot=b.get(y);if(ot)return ot}else for(E||(E=new xn),ot=E.iterator;ot.next();){var at=ot.key;if(ot.value===y&&(at=b.get(at)))return at}if(Array.isArray(y)){ot=[],tt(y,ot);for(var ut=0;ut<y.length;ut++)ot.push(Eg(a,y[ut],!1,b,E,z))}else if(y instanceof jt||y instanceof Ze||y instanceof ye||y instanceof ni||y instanceof yn)ot=y.copy(),tt(y,ot);else{if(y instanceof er||y instanceof We||y instanceof me)return y;if(y instanceof Ve)ot=new Ve().addAll(Eg(a,y.Fa(),!1,b,E,z)),tt(y,ot);else if(y instanceof Ye)ot=new Ye().addAll(Eg(a,y.Fa(),!1,b,E,z)),tt(y,ot);else if(y instanceof xn)ot=new xn().addAll(Eg(a,y.Fa(),!1,b,E,z)),tt(y,ot);else if(y instanceof Date)ot=new Date(y.getTime()),tt(y,ot);else if(y instanceof RegExp)ot=new RegExp(y),tt(y,ot),ot.lastIndex=y.lastIndex;else if(typeof y.copy=="function")ot=y.copy(),tt(y,ot);else for(ut in ot={},tt(y,ot),y)ut!=="__gohashid"&&(ot[ut]=Eg(a,y[ut],!1,b,E,z))}return x&&z.forEach(function(ct){delete ct.__gohashid}),ot}xt=fn.prototype,xt.quote=function(a){return JSON.stringify(a).replace(/[\u007F-\uFFFF]/g,function(y){return"\\u"+("0000"+y.charCodeAt(0).toString(16)).substr(-4)})},xt.rm=function(){var a="";return this.name!==""&&(a+=`,
|
|
"name": `+this.quote(this.name)),this.dataFormat!==""&&(a+=`,
|
|
"dataFormat": `+this.quote(this.dataFormat)),this.isReadOnly&&(a+=`,
|
|
"isReadOnly": `+this.isReadOnly),this.nodeKeyProperty!=="key"&&typeof this.nodeKeyProperty=="string"&&(a+=`,
|
|
"nodeKeyProperty": `+this.quote(this.nodeKeyProperty)),this.copiesArrays&&(a+=`,
|
|
"copiesArrays": true`),this.copiesArrayObjects&&(a+=`,
|
|
"copiesArrayObjects": true`),this.copiesKey||(a+=`,
|
|
"copiesKey": false`),this.nodeCategoryProperty!=="category"&&typeof this.nodeCategoryProperty=="string"&&(a+=`,
|
|
"nodeCategoryProperty": `+this.quote(this.nodeCategoryProperty)),a},xt.gp=function(a){a.name&&(this.name=a.name),a.dataFormat&&(this.dataFormat=a.dataFormat),a.isReadOnly&&(this.isReadOnly=!0),a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty),a.copiesArrays&&(this.copiesArrays=!0),a.copiesArrayObjects&&(this.copiesArrayObjects=!0),a.copiesKey===!1&&(this.copiesKey=!1),a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function SS(a,y){y=y.modelData,Ue(y)&&(a.dm(y),a.modelData=y)}xt.Rv=function(){var a=this.modelData,y=!1,x;for(x in a)if(!wS(x,a[x])){y=!0;break}return a="",y&&(a=`,
|
|
"modelData": `+uy(this,this.modelData)),a+`,
|
|
"nodeDataArray": `+uf(this,this.nodeDataArray,!0)},xt.kv=function(a){SS(this,a),a=a.nodeDataArray,Gn(a)&&(this.dm(a),this.nodeDataArray=a)};function xS(a,y){function x(E,z){if((z=z.part)&&(z=z.data,E!==z)){var tt=b.get(E);tt===null?(tt=new Ye,tt.add(z),b.add(E,tt)):tt.add(z)}}var b=a.vh;b===null&&(b=new xn,y.changes.each(function(E){if(E.diagram!==null){var z=E.change;z===Ur?(E=E.object.panel)&&(z=E.data)&&x(z,E):(z===ko||z===Bo)&&(E=E.object,(z=E.itemArray)&&x(z,E))}}),a.vh=b)}function PS(a,y){for(var x=new Ye,b=0;b<a.nodeDataArray.length;b++){var E=a.nodeDataArray[b];f0(a,y,E,E,x)}return x}function f0(a,y,x,b,E){if(Array.isArray(x))for(var z=0;z<x.length;z++){var tt=x[z];if(tt===y)return E.add(b),!0;if(f0(a,y,tt,b,E))return!0}else if(Ue(x)&&Object.getPrototypeOf(x)===Object.prototype)for(z in x){if(tt=x[z],tt===y)return E.add(b),!0;if(f0(a,y,tt,b,E))return!0}return!1}xt.Pv=function(a,y){var x=this,b=!1,E=new Ye,z=new Ye,tt=new Ye,rt=this.vh;a.changes.each(function(ut){ut.model===x&&(ut.modelChange==="nodeDataArray"?ut.change===ko?E.add(ut.newValue):ut.change===Bo&&tt.add(ut.oldValue):x.lb(ut.object)?z.add(ut.object):ut.change!==Ur||x.modelData!==ut.object&&ut.propertyName!=="modelData"?ut.object!==null&&(rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ct){x.lb(ct)&&z.add(ct)}):ut.object instanceof fn||x.ri()&&x.Jc(ut.object)||PS(x,ut.object).each(function(ct){z.add(ct)})):b=!0)});var ot=this.il;ot.clear(),E.each(function(ut){ot.add(x.wa(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(x.wa(ut)),y&&z.add(ut)}),a="",b&&(a+=`,
|
|
"modelData": `+uy(this,this.modelData)),0<ot.count&&(a+=(y?this.Yv:this.Wv)+uf(this,ot.Fa(),!0)),0<z.count&&(a+=this.jy+uf(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Wv:this.Yv)+uf(this,at.Fa(),!0)),at.clear(),ot.clear(),a},xt.fp=function(a){(a.name!==void 0&&a.name!==this.name||a.dataFormat!==void 0&&a.dataFormat!==this.dataFormat||a.isReadOnly!==void 0&&a.isReadOnly!==this.isReadOnly||a.nodeKeyProperty!==void 0&&a.nodeKeyProperty!==this.nodeKeyProperty||a.copiesArrays!==void 0&&a.copiesArrays!==this.copiesArrays||a.copiesArrayObjects!==void 0&&a.copiesArrayObjects!==this.copiesArrayObjects||a.copiesKey!==void 0&&a.copiesKey!==this.copiesKey||a.nodeCategoryProperty!==void 0&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&&fe("applyIncrementalJson cannot change Model properties"),SS(this,a);var y=a.insertedNodeKeys,x=a.modifiedNodeData,b=new xn;if(Array.isArray(x))for(var E=0;E<x.length;E++){var z=x[E],tt=this.wa(z);tt!=null&&b.set(tt,z)}if(Array.isArray(y))for(E=y.length,z=0;z<E;z++){tt=y[z];var rt=this.hc(tt);rt===null&&(rt=(rt=b.get(tt))?rt:this.copyNodeData({}),this.km(rt,tt),this.xf(rt))}if(Array.isArray(x)){for(y=x.length,b=0;b<y;b++)if(E=x[b],z=this.wa(E),z=this.hc(z),z!==null){for(var ot in E)ot==="__gohashid"||ot===this.nodeKeyProperty||this.Wj()&&ot===this.nodeIsGroupProperty||this.setDataProperty(z,ot,E[ot]);this.lm(E,z)}}if(a=a.removedNodeKeys,Array.isArray(a))for(x=a.length,ot=0;ot<x;ot++)y=this.hc(a[ot]),y!==null&&this.cm(y)},xt.$x=function(a,y){a.change!==za&&fe("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var x=a.object;return a.isTransactionFinished&&x instanceof as?(y===void 0&&(y=Bp(this,this)),xS(this,x),a=this.Pv(x,a.propertyName==="FinishedUndo"),this.vh=null,y==="2"?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(y)+', "incremental": 1'+this.rm()+a+"}"):'{ "incremental": 0 }'},xt.yA=function(a,y){return this.$x(a,y)},xt.np=function(a){return a===void 0&&(a=Bp(this,this)),'{ "class": '+this.quote(a)+this.rm()+this.Rv()+"}"},xt.toJSON=function(a){return this.np(a)},xt.Zw=function(a){var y=null;if(typeof a=="string")try{y=xe.JSON.parse(a)}catch(b){}else typeof a=="object"?y=a:fe("Unable to modify a Model from: "+a);var x=y.incremental;typeof x!="number"&&fe("Unable to apply non-incremental changes to Model: "+a),x!==0&&(this.Ea("applyIncrementalJson"),this.fp(y),this.eb("applyIncrementalJson"))},xt.Ky=function(a){return this.Zw(a)},fn.constructGraphLinksModel=function(){return new fn},xt=fn.prototype,xt.dm=function(a){if(Gn(a))for(var y=a.length,x=0;x<y;x++){var b=a[x];if(Ue(b)){var E=x;b=this.dm(b),Array.isArray(a)?a[E]=b:fe("Cannot replace an object in an HTMLCollection or NodeList at "+E)}}else if(Ue(a)){for(y in a)if(x=a[y],Ue(x)&&(x=this.dm(x),a[y]=x,y==="points"&&Array.isArray(x))){for(E=x.length%2===0,b=0;b<x.length;b++)if(typeof x[b]!="number"){E=!1;break}if(E){for(E=new Ve,b=0;b<x.length/2;b++)E.add(new jt(x[2*b],x[2*b+1]));E.freeze(),a[y]=E}}return Nx(a)}return a},xt.sm=function(a){return a===void 0?"undefined":a===null?"null":a===!0?"true":a===!1?"false":typeof a=="string"?this.quote(a):typeof a=="number"?a===1/0?"9e9999":a===-1/0?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.sm(a.valueOf()):Gn(a)?uf(this,a):Ue(a)?uy(this,a):typeof a=="function"?"null":a.toString()};function uf(a,y,x){x===void 0&&(x=!1);var b=y.length;if(0>=b)return"[]";var E=new gr;E.add("["),x&&1<b&&E.add(`
|
|
`);for(var z=0;z<b;z++){var tt=y[z];tt!==void 0&&(0<z&&(E.add(","),x&&E.add(`
|
|
`)),E.add(a.sm(tt)))}return x&&1<b&&E.add(`
|
|
`),E.add("]"),E.toString()}function wS(a,y){return y===void 0||a==="__gohashid"||a[0]==="_"||typeof y=="function"}function Fa(a){return isNaN(a)?"NaN":a===1/0?"9e9999":a===-1/0?"-9e9999":a}function uy(a,y){var x=y;if(x instanceof jt)y={class:"go.Point",x:Fa(x.x),y:Fa(x.y)};else if(x instanceof Ze)y={class:"go.Size",width:Fa(x.width),height:Fa(x.height)};else if(x instanceof ye)y={class:"go.Rect",x:Fa(x.x),y:Fa(x.y),width:Fa(x.width),height:Fa(x.height)};else if(x instanceof ni)y={class:"go.Margin",top:Fa(x.top),right:Fa(x.right),bottom:Fa(x.bottom),left:Fa(x.left)};else if(x instanceof yn)x.sb()?y={class:"go.Spot",x:Fa(x.x),y:Fa(x.y),offsetX:Fa(x.offsetX),offsetY:Fa(x.offsetY)}:y={class:"go.Spot",enum:x.toString()};else if(x instanceof er){if(y={class:"go.Brush",type:x.type.name},x.type===Ld?y.color=x.color:(x.type===qh||x.type===Hl)&&(y.start=x.start,y.end=x.end,x.type===Hl&&(x.startRadius!==0&&(y.startRadius=Fa(x.startRadius)),isNaN(x.endRadius)||(y.endRadius=Fa(x.endRadius)))),x.colorStops!==null){var b={};for(x=x.colorStops.iterator;x.next();)b[x.key]=x.value;y.colorStops=b}}else x instanceof We?(y={class:"go.Geometry",type:x.type.name},x.startX!==0&&(y.startX=Fa(x.startX)),x.startY!==0&&(y.startY=Fa(x.startY)),x.endX!==0&&(y.endX=Fa(x.endX)),x.endY!==0&&(y.endY=Fa(x.endY)),x.spot1.D(ms)||(y.spot1=x.spot1),x.spot2.D(Ll)||(y.spot2=x.spot2),x.type===We.o&&(y.path=We.ia(x))):x instanceof me&&(y={class:"go.EnumValue",classType:Bp(a,x.classType),name:x.name});b="{",x=!0;for(var E in y){var z=jo(y,E);if(!wS(E,z))if(x?x=!1:b+=",",b+=a.quote(E)+":",E==="points"&&z instanceof Ve){var tt="[";for(z=z.iterator;z.next();){var rt=z.value;1<tt.length&&(tt+=","),tt+=a.sm(rt.x),tt+=",",tt+=a.sm(rt.y)}tt+="]",b+=tt}else b+=a.sm(z)}return b+"}"}function Ta(a){return typeof a=="number"?a:a==="NaN"?NaN:a==="9e9999"?1/0:a==="-9e9999"?-1/0:parseFloat(a)}function Nx(a){if(typeof a!="object")return a;var y=a.class||"";if(y==="NaN")return NaN;if(y==="Date")return new Date(a.value);if(y.indexOf("go.")!==0)return a;y=y.substr(3);var x=a;if(y==="Point")x=new jt(Ta(a.x),Ta(a.y));else if(y==="Size")x=new Ze(Ta(a.width),Ta(a.height));else if(y==="Rect")x=new ye(Ta(a.x),Ta(a.y),Ta(a.width),Ta(a.height));else if(y==="Margin")x=new ni(Ta(a.top),Ta(a.right),Ta(a.bottom),Ta(a.left));else if(y==="Spot")typeof a.enum=="string"?x=Tf(a.enum):x=new yn(Ta(a.x),Ta(a.y),Ta(a.offsetX),Ta(a.offsetY));else if(y==="Brush"){if(x=new er,x.type=xi(er,a.type),typeof a.color=="string"&&(x.color=a.color),a.start instanceof yn&&(x.start=a.start),a.end instanceof yn&&(x.end=a.end),typeof a.startRadius=="number"&&(x.startRadius=Ta(a.startRadius)),typeof a.endRadius=="number"&&(x.endRadius=Ta(a.endRadius)),a=a.colorStops,Ue(a))for(var b in a)x.addColorStop(parseFloat(b),a[b])}else y==="Geometry"?(x=null,typeof a.path=="string"?x=We.parse(a.path):x=new We,x.type=xi(We,a.type),typeof a.startX=="number"&&(x.startX=Ta(a.startX)),typeof a.startY=="number"&&(x.startY=Ta(a.startY)),typeof a.endX=="number"&&(x.endX=Ta(a.endX)),typeof a.endY=="number"&&(x.endY=Ta(a.endY)),a.spot1 instanceof yn&&(x.spot1=a.spot1),a.spot2 instanceof yn&&(x.spot2=a.spot2)):y==="EnumValue"&&(b=a.classType,b.indexOf("go.")===0&&(b=b.substr(3)),b=dy(b),typeof b=="function"&&(x=xi(b,a.name)));return x}xt.Pe=function(a){return this.Lt.add(a),this},xt.ik=function(a){this.Lt.remove(a)},xt.ds=function(a){this.skipsUndoManager||this.undoManager.Tu(a);for(var y=this.Lt,x=y.length,b=0;b<x;b++)y.M(b)(a)},xt.cb=function(a,y,x,b,E,z,tt){Qo(this,"",a,y,x,b,E,z,tt)},xt.g=function(a,y,x,b,E){Qo(this,"",Ur,a,this,y,x,b,E)},xt.Fs=function(a,y,x,b,E,z){Qo(this,"",Ur,y,a,x,b,E,z)};function Qo(a,y,x,b,E,z,tt,rt,ot){rt===void 0&&(rt=null),ot===void 0&&(ot=null);var at=new Jr;at.model=a,at.change=x,at.modelChange=y,at.propertyName=b,at.object=E,at.oldValue=z,at.oldParam=rt,at.newValue=tt,at.newParam=ot,a.ds(at)}fn.prototype.changeState=function(a,y){if(a!==null&&a.model===this)if(a.change===Ur){var x=a.object,b=a.propertyName,E=a.I(y);b===this.nodeKeyProperty&&this.lb(x)&&(y=a.I(!y),y!==void 0&&this.kb.remove(y),E!==void 0&&this.kb.add(E,x)),Hr(x,b,E)}else a.change===ko?(x=a.newParam,a.modelChange==="nodeDataArray"?(a=a.newValue,Ue(a)&&typeof x=="number"&&(b=this.wa(a),y?(this.Tc[x]===a&&$r(this.Tc,x),b!==void 0&&this.kb.remove(b)):(this.Tc[x]!==a&&zo(this.Tc,x,a),b!==void 0&&this.kb.add(b,a)))):a.modelChange===""?((b=a.object)&&!Gn(b)&&a.propertyName&&(b=jo(a.object,a.propertyName)),Gn(b)&&typeof x=="number"&&(a=a.newValue,y?$r(b,x):zo(b,x,a))):fe("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===Bo?(x=a.oldParam,a.modelChange==="nodeDataArray"?(a=a.oldValue,Ue(a)&&typeof x=="number"&&(b=this.wa(a),y?(this.Tc[x]!==a&&zo(this.Tc,x,a),b!==void 0&&this.kb.add(b,a)):(this.Tc[x]===a&&$r(this.Tc,x),b!==void 0&&this.kb.remove(b)))):a.modelChange===""?((b=a.object)&&!Gn(b)&&a.propertyName&&(b=jo(a.object,a.propertyName)),Gn(b)&&typeof x=="number"&&(a=a.oldValue,y?zo(b,x,a):$r(b,x))):fe("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==za&&fe("unknown ChangedEvent: "+a.toString())},fn.prototype.Ea=function(a){return this.undoManager.Ea(a)},fn.prototype.eb=function(a){return this.undoManager.eb(a)},fn.prototype.Kf=function(){return this.undoManager.Kf()},fn.prototype.commit=function(a,y){y===void 0&&(y="");var x=this.skipsUndoManager;y===null&&(this.skipsUndoManager=!0,y=""),this.undoManager.Ea(y);var b=!1;try{a(this),b=!0}finally{b?this.undoManager.eb(y):this.undoManager.Kf(),this.skipsUndoManager=x}},xt=fn.prototype,xt.La=function(a,y){y===void 0&&(y=""),Qo(this,"SourceChanged",za,y,a,null,null)},xt.wa=function(a){if(a!==null){var y=this.Th;if(y!==""&&(y=jo(a,y),y!==void 0)){if(hf(y))return y;fe("Key value for node data "+a+" is not a number or a string: "+y)}}},xt.km=function(a,y){if(a!==null){var x=this.Th;if(x!=="")if(this.lb(a)){var b=jo(a,x);b!==y&&this.hc(y)===null&&(Hr(a,x,y),b!==void 0&&this.kb.remove(b),this.kb.add(y,a),Qo(this,"nodeKey",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x),this.jp(b,y))}else Hr(a,x,y)}};function hf(a){return typeof a=="number"||typeof a=="string"}xt.lb=function(a){var y=this.wa(a);return y===void 0?!1:this.kb.I(y)===a},xt.hc=function(a){return a===null&&fe("Model.findNodeDataForKey:key must not be null"),a!==void 0&&hf(a)?this.kb.I(a):null},xt.$u=function(a){if(a!==null){var y=this.Th;if(y!==""){var x=this.wa(a);if(x===void 0||this.kb.contains(x)){var b=this.bl;if(b!==null&&(x=b(this,a),x!=null&&!this.kb.contains(x))){Hr(a,y,x);return}if(typeof x=="string"){for(b=2;this.kb.contains(x+b);)b++;Hr(a,y,x+b)}else if(x===void 0||typeof x=="number"){for(x=-this.kb.count-1;this.kb.contains(x);)x--;Hr(a,y,x)}}}}},xt.xf=function(a){a!==null&&(ma(a),this.lb(a)||CS(this,a,!0))};function CS(a,y,x){var b=a.wa(y);(b===void 0||a.kb.I(b)!==y)&&(a.$u(y),b=a.wa(y),b===void 0&&fe("Model.makeNodeDataKeyUnique failed on "+y+". Data not added to Model."),a.kb.add(b,y),b=null,x&&(b=a.Tc.length,zo(a.Tc,b,y)),Qo(a,"nodeDataArray",ko,"nodeDataArray",a,null,y,null,b),a.fm(y),a.em(y))}xt.Fy=function(a){if(Gn(a))for(var y=a.length,x=0;x<y;x++)this.xf(a[x]);else for(a=a.iterator;a.next();)this.xf(a.value)},xt.cm=function(a){a!==null&&LS(this,a,!0)};function LS(a,y,x){var b=a.wa(y);if(b!==void 0&&a.kb.remove(b),b=null,x){t:if(x=a.Tc,Array.isArray(x))b=x.indexOf(y);else{b=x.length;for(var E=0;E<b;E++)if(x[E]===y){b=E;break t}b=-1}if(0>b)return;$r(a.Tc,b)}Qo(a,"nodeDataArray",Bo,"nodeDataArray",a,y,null,b,null),a.qp(y)}xt.nA=function(a){if(Gn(a))for(var y=a.length,x=0;x<y;x++)this.cm(a[x]);else for(a=a.iterator;a.next();)this.cm(a.value)},xt.$z=function(a){if(a!==this.nodeDataArray&&Gn(a)){var y=this.kl;y.clear(),y.addAll(this.kb.iteratorKeys);var x=this.il;x.clear();for(var b=a.length,E=0;E<b;E++){var z=a[E],tt=this.wa(z);if(tt!==void 0){x.add(tt);var rt=this.hc(tt);rt!==z&&(rt!==null?(this.Do(rt,z),this.lm(z,rt)):(z=this.cloneDeep(z),this.km(z,tt),this.xf(z)))}else tt=this.cloneDeep(z),this.xf(tt),x.add(this.wa(tt))}for(a=y.iterator;a.next();)b=a.value,x.contains(b)||(b=this.hc(b))&&this.cm(b);y.clear(),x.clear()}},xt.jp=function(a,y){y!==void 0&&(a=Ap(this,a),a instanceof Ye&&this.Vf.add(y,a))},xt.Lv=function(){},xt.fm=function(){},xt.em=function(){},xt.qp=function(){};function Gu(a,y,x){if(y!==void 0){var b=a.Vf.I(y);b===null&&(b=new Ye,a.Vf.add(y,b)),b.add(x)}}function _u(a,y,x){if(y!==void 0){var b=a.Vf.I(y);b instanceof Ye&&(x==null?a.Vf.remove(y):(b.remove(x),b.count===0&&a.Vf.remove(y)))}}function Ap(a,y){return y===void 0?null:(a=a.Vf.I(y),a instanceof Ye?a:null)}xt.Qy=function(a){a===void 0?this.Vf.clear():this.Vf.remove(a)},fn.prototype.copyNodeData=function(a){if(a===null)return null;var y=this.Bk;return a=y!==null?y(a,this):c0(this,a,!0),Ue(a)&&qr(a),a};function c0(a,y,x){if(a.copiesArrays&&Array.isArray(y)){var b=[];for(x=0;x<y.length;x++){var E=c0(a,y[x],a.copiesArrayObjects);b.push(E)}return qr(b),b}if(x&&Ue(y)){x=(x=y.constructor)?new x:{},E=a.copiesKey||typeof a.nodeKeyProperty!="string"?null:a.nodeKeyProperty;for(b in y)if(b==="__gohashid")x.__gohashid=void 0;else if(b===E)x[E]=void 0;else{var z=jo(y,b),tt=Bp(a,z);tt==="GraphObject"||tt==="Diagram"||tt==="Layer"||tt==="RowColumnDefinition"||tt==="AnimationManager"||tt==="Tool"||tt==="CommandHandler"||tt==="Layout"||tt==="InputEvent"||tt==="DiagramEvent"||z instanceof fn||z instanceof eo||z instanceof as||z instanceof Jr||(z=c0(a,z,!1)),Hr(x,b,z)}return qr(x),x}return y instanceof jt||y instanceof Ze||y instanceof ye||y instanceof yn||y instanceof ni?y.copy():y}fn.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}}else!MS&&a instanceof te&&(MS=!0,Ki('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Ki(" Is that really your intent?"));var b=jo(a,y);b!==x&&(Hr(a,y,x),this.Fs(a,y,b,x))},xt=fn.prototype,xt.set=function(a,y,x){this.setDataProperty(a,y,x)},xt.Do=function(a,y){if(y){var x=this.lb(a),b;for(b in y)b==="__gohashid"||x&&b===this.nodeKeyProperty||this.setDataProperty(a,b,y[b])}},xt.Ay=function(a,y){this.ts(a,-1,y)},xt.ts=function(a,y,x){0>y&&(y=a.length),zo(a,y,x),Qo(this,"",ko,"",a,null,x,null,y)},xt.ov=function(a,y){y===void 0&&(y=-1),a===this.Tc&&fe("Model.removeArrayItem should not be called on the Model.nodeDataArray"),y===-1&&(y=a.length-1);var x=a[y];$r(a,y),Qo(this,"",Bo,"",a,x,null,y,null)},xt.Ro=function(a){if(a===null)return"";var y=this.lj;if(y===""||(y=jo(a,y),y===void 0))return"";if(typeof y=="string")return y;fe("getCategoryForNodeData found a non-string category for "+a+": "+y)},xt.jm=function(a,y){if(a!==null){var x=this.lj;if(x!=="")if(this.lb(a)){var b=jo(a,x);b===void 0&&(b=""),b!==y&&(Hr(a,x,y),Qo(this,"nodeCategory",Ur,x,a,b,y))}else Hr(a,x,y)}},xt.lm=function(a,y){this.jm(y,this.Ro(a))},xt.Tl=function(){return!1},xt.Wj=function(){return!1},xt.ri=function(){return!1},xt.xs=function(){return!1},xt.Xj=function(){return!1};function hy(){return new fn}function Bp(a,y){if(typeof y=="function"){if(y.className)return y.className;if(y.name)return y.name}else if(typeof y=="object"&&y!==null&&y.constructor)return Bp(a,y.constructor);return typeof y}function dy(a){return xu[a]?xu[a]:xe.go!==void 0&&xe.go[a]?xe.go[a]:null}function jo(a,y){if(!a||!y)return null;try{if(typeof y=="function")var x=y(a);else typeof a.getAttribute=="function"?(x=a.getAttribute(y),x===null&&(x=void 0)):x=a[y]}catch(b){}return x}function Hr(a,y,x){if(a&&y)try{typeof y=="function"?y(a,x):typeof a.setAttribute=="function"?a.setAttribute(y,x):a[y]=x}catch(b){}}Oe.Object.defineProperties(fn.prototype,{name:{get:function(){return this.xa},set:function(a){var y=this.xa;y!==a&&(this.xa=a,this.g("name",y,a))}},dataFormat:{get:function(){return this.Sm},set:function(a){var y=this.Sm;y!==a&&(this.Sm=a,this.g("dataFormat",y,a))}},isReadOnly:{get:function(){return this.Gg},set:function(a){var y=this.Gg;y!==a&&(this.Gg=a,this.g("isReadOnly",y,a))}},modelData:{get:function(){return this.j},set:function(a){var y=this.j;y!==a&&(this.j=a,this.g("modelData",y,a),this.La(a))}},undoManager:{get:function(){return this.o},set:function(a){var y=this.o;y!==a&&(y!==null&&y.Rx(this),this.o=a,a!==null&&a.Xw(this))}},skipsUndoManager:{get:function(){return this.Wg},set:function(a){this.Wg=a}},nodeKeyProperty:{get:function(){return this.Th},set:function(a){var y=this.Th;y!==a&&(a===""&&fe("Model.nodeKeyProperty may not be the empty string"),0<this.kb.count&&fe("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Th=a,this.g("nodeKeyProperty",y,a))}},makeUniqueKeyFunction:{get:function(){return this.bl},set:function(a){var y=this.bl;y!==a&&(this.bl=a,this.g("makeUniqueKeyFunction",y,a))}},nodeDataArray:{get:function(){return this.Tc},set:function(a){var y=this.Tc;if(y!==a){this.kb.clear(),this.Lv();for(var x=a.length,b=0;b<x;b++){var E=a[b];Ue(E)||fe("Model.nodeDataArray must only contain Objects, not: "+E),ma(E)}for(this.Tc=a,b=new Ve,E=0;E<x;E++){var z=a[E],tt=this.wa(z);tt===void 0||this.kb.I(tt)!==null?b.add(z):this.kb.add(tt,z)}for(b=b.iterator;b.next();)E=b.value,this.$u(E),z=this.wa(E),z!==void 0&&this.kb.add(z,E);for(Qo(this,"nodeDataArray",Ur,"nodeDataArray",this,y,a),y=0;y<x;y++)b=a[y],this.fm(b),this.em(b);Array.isArray(a)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{get:function(){return this.Bk},set:function(a){var y=this.Bk;y!==a&&(this.Bk=a,this.g("copyNodeDataFunction",y,a))}},copiesArrays:{get:function(){return this.Km},set:function(a){var y=this.Km;y!==a&&(this.Km=a,this.g("copiesArrays",y,a))}},copiesArrayObjects:{get:function(){return this.Jm},set:function(a){var y=this.Jm;y!==a&&(this.Jm=a,this.g("copiesArrayObjects",y,a))}},copiesKey:{get:function(){return this.Mm},set:function(a){var y=this.Mm;y!==a&&(this.Mm=a,this.g("copiesKey",y,a))}},afterCopyFunction:{get:function(){return this.xm},set:function(a){var y=this.xm;y!==a&&(this.xm=a,this.g("afterCopyFunction",y,a))}},nodeCategoryProperty:{get:function(){return this.lj},set:function(a){var y=this.lj;y!==a&&(this.lj=a,this.g("nodeCategoryProperty",y,a))}},type:{get:function(){return"Model"}}}),fn.prototype.setCategoryForNodeData=fn.prototype.jm,fn.prototype.getCategoryForNodeData=fn.prototype.Ro,fn.prototype.removeArrayItem=fn.prototype.ov,fn.prototype.insertArrayItem=fn.prototype.ts,fn.prototype.addArrayItem=fn.prototype.Ay,fn.prototype.assignAllDataProperties=fn.prototype.Do,fn.prototype.set=fn.prototype.set,fn.prototype.clearUnresolvedReferences=fn.prototype.Qy,fn.prototype.mergeNodeDataArray=fn.prototype.$z,fn.prototype.removeNodeDataCollection=fn.prototype.nA,fn.prototype.removeNodeData=fn.prototype.cm,fn.prototype.addNodeDataCollection=fn.prototype.Fy,fn.prototype.addNodeData=fn.prototype.xf,fn.prototype.makeNodeDataKeyUnique=fn.prototype.$u,fn.prototype.findNodeDataForKey=fn.prototype.hc,fn.prototype.containsNodeData=fn.prototype.lb,fn.prototype.setKeyForNodeData=fn.prototype.km,fn.prototype.getKeyForNodeData=fn.prototype.wa,fn.prototype.updateTargetBindings=fn.prototype.La,fn.prototype.commit=fn.prototype.commit,fn.prototype.rollbackTransaction=fn.prototype.Kf,fn.prototype.commitTransaction=fn.prototype.eb,fn.prototype.startTransaction=fn.prototype.Ea,fn.prototype.raiseDataChanged=fn.prototype.Fs,fn.prototype.raiseChanged=fn.prototype.g,fn.prototype.raiseChangedEvent=fn.prototype.cb,fn.prototype.removeChangedListener=fn.prototype.ik,fn.prototype.addChangedListener=fn.prototype.Pe,fn.prototype.writeJsonValue=fn.prototype.sm,fn.prototype.replaceJsonObjects=fn.prototype.dm,fn.prototype.applyIncrementalJSON=fn.prototype.Ky,fn.prototype.applyIncrementalJson=fn.prototype.Zw,fn.prototype.toJSON=fn.prototype.toJSON,fn.prototype.toJson=fn.prototype.np,fn.prototype.toIncrementalJSON=fn.prototype.yA,fn.prototype.toIncrementalJson=fn.prototype.$x,fn.prototype.toIncrementalData=fn.prototype.xA,fn.prototype.clear=fn.prototype.clear;var MS=!1,xu={};fn.className="Model",fn.fromJSON=fn.fromJson=function(a,y){y===void 0&&(y=null);var x=null;if(typeof a=="string")try{x=xe.JSON.parse(a)}catch(z){}else typeof a=="object"?x=a:fe("Unable to construct a Model from: "+a);if(y===null){a=null;var b=x.class;if(typeof b=="string")try{var E=null;b.indexOf("go.")===0?(b=b.substr(3),E=dy(b)):(E=dy(b),E===null&&(E=xe[b])),typeof E=="function"&&(a=new E)}catch(z){}a===null||a instanceof fn?y=a:fe("Unable to construct a Model of declared class: "+x.class)}return y===null&&(y=fn.constructGraphLinksModel()),y.gp(x),y.kv(x),y},fn.safePropertyValue=jo,fn.safePropertySet=Hr,xu.Brush=er,xu.ChangedEvent=Jr,xu.Geometry=We,xu.Margin=ni,xu.Panel=Re,xu.Point=jt,xu.Rect=ye,xu.Size=Ze,xu.Spot=yn,xu.Transaction=as,xu.UndoManager=eo;function Vo(a,y,x,b){qr(this),this._isFrozen=!1,a===void 0&&(a=""),y===void 0&&(y=a),x===void 0&&(x=null),this.j=-1,this.xd=null,this.xl=a,this.wl=this.to=0,this.Cr=null,this.wn=!1,this.sl=y,this.Im=x,b===void 0?(this.el=bS,this.wk=null):(this.el=Op,this.wk=b),this.st=new Ye}Vo.prototype.copy=function(){var a=new Vo;return a.xl=this.xl,a.to=this.to,a.wl=this.wl,a.Cr=this.Cr,a.wn=this.wn,a.sl=this.sl,a.Im=this.Im,a.el=this.el,a.wk=this.wk,a},xt=Vo.prototype,xt.qb=function(a){a.classType===Vo&&(this.mode=a)},xt.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(this.Ai!==-1?" "+this.Ai:"")+" "+this.mode.name+")"},xt.freeze=function(){return this._isFrozen=!0,this},xt.ka=function(){return this._isFrozen=!1,this},xt.Kx=function(a){return a===void 0&&(a=null),this.mode=Op,this.backConverter=a,this},xt.cp=function(a){return a===void 0&&(a=""),this.sourceName=a,this.isToModel=!1,this},xt.dA=function(){return this.sourceName=null,this.isToModel=!0,this};function kS(a,y,x){return a=a.sourceName,a===null||a===""?y:a==="/"?x.part:a==="."?x:a===".."?x.panel:y.fb(a)}xt.Mv=function(a,y,x){var b=this.sl;if(x===void 0||b===""||b===x){x=this.xl;var E=this.Im;if(E===null&&x==="")Ki("Binding error: target property is the empty string: "+this.toString());else{var z=y;if(b!==""&&(z=jo(y,b)),z!==void 0)if(E===null)x!==""&&Hr(a,x,z);else try{if(x!==""){var tt=E(z,a);Hr(a,x,tt)}else E(z,a)}catch(rt){}}}},xt.sp=function(a,y,x,b){if(this.el===Op){var E=this.xl;if(x===void 0||E===x){x=this.sl;var z=this.wk,tt=a;if(E!==""&&(tt=jo(a,E)),tt!==void 0&&!this.st.contains(a))try{this.st.add(a);var rt=b!==null?b.diagram:null,ot=rt!==null?rt.model:null;if(z===null){if(x!=="")ot!==null?ot.setDataProperty(y,x,tt):Hr(y,x,tt);else if(ot!==null&&b!==null&&0<=b.itemIndex&&b.panel!==null&&Array.isArray(b.panel.itemArray)){var at=b.itemIndex,ut=b.panel.itemArray;ot.ov(ut,at),ot.ts(ut,at,tt)}}else try{if(x!==""){var ct=z(tt,y,ot);ot!==null?ot.setDataProperty(y,x,ct):Hr(y,x,ct)}else{var mt=z(tt,y,ot);if(mt!==void 0&&ot!==null&&b!==null&&0<=b.itemIndex&&b.panel!==null&&Array.isArray(b.panel.itemArray)){var yt=b.itemIndex,St=b.panel.itemArray;ot.ov(St,yt),ot.ts(St,yt,mt)}}}catch(Lt){}}finally{this.st.remove(a)}}}},Oe.Object.defineProperties(Vo.prototype,{Ai:{get:function(){return this.j},set:function(a){this._isFrozen&&An(this),this.j=a}},targetProperty:{get:function(){return this.xl},set:function(a){this._isFrozen&&An(this),this.xl=a}},sourceName:{get:function(){return this.Cr},set:function(a){this._isFrozen&&An(this),this.Cr=a,a!==null&&(this.wn=!1)}},isToModel:{get:function(){return this.wn},set:function(a){this._isFrozen&&An(this),this.wn=a}},sourceProperty:{get:function(){return this.sl},set:function(a){this._isFrozen&&An(this),this.sl=a}},converter:{get:function(){return this.Im},set:function(a){this._isFrozen&&An(this),this.Im=a}},backConverter:{get:function(){return this.wk},set:function(a){this._isFrozen&&An(this),this.wk=a}},mode:{get:function(){return this.el},set:function(a){this._isFrozen&&An(this),this.el=a}}}),Vo.prototype.updateSource=Vo.prototype.sp,Vo.prototype.updateTarget=Vo.prototype.Mv,Vo.prototype.ofModel=Vo.prototype.dA,Vo.prototype.ofObject=Vo.prototype.cp,Vo.prototype.makeTwoWay=Vo.prototype.Kx;var Dx="Binding",bS=new me(Vo,"OneWay",1),Op=new me(Vo,"TwoWay",2);Vo.className="Binding",Vo.parseEnum=function(a,y){return function(x){return x=xi(a,x),x===null?y:x}},Vo.toString=Ir,Vo.OneWay=bS,Vo.TwoWay=Op;function ki(a,y,x){fn.call(this),this.Vv=`,
|
|
"insertedLinkKeys": `,this.iy=`,
|
|
"modifiedLinkData": `,this.Xv=`,
|
|
"removedLinkKeys": `,this.md=[],this.$f=new Ye,this.wb=new xn,this.Jh="",this.Ri=this.Ak=this.cl=null,this.lf="from",this.mf="to",this.fj=this.ej="",this.dj="category",this.je="",this.jl="isGroup",this.Je="group",this.Lm=!1,y!==void 0&&(this.linkDataArray=y),a!==void 0&&(Gn(a)?this.nodeDataArray=a:x=a),x&&(Object.assign(this,x),a=x.Changed)&&(delete this.Changed,this.Pe(a))}le(ki,fn),ki.constructGraphLinksModel=fn.constructGraphLinksModel,ki.prototype.cloneProtected=function(a){fn.prototype.cloneProtected.call(this,a),a.Jh=this.Jh,a.cl=this.cl,a.Ak=this.Ak,a.lf=this.lf,a.mf=this.mf,a.ej=this.ej,a.fj=this.fj,a.dj=this.dj,a.je=this.je,a.jl=this.jl,a.Je=this.Je,a.Lm=this.Lm},xt=ki.prototype,xt.clear=function(){fn.prototype.clear.call(this),this.md=[],this.wb.clear(),this.$f.clear()},xt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" GraphLinksModel";if(0<a){y+=`
|
|
node data:`,a=this.nodeDataArray;var x=a.length,b;for(b=0;b<x;b++){var E=a[b];y+=" "+this.wa(E)+":"+Ir(E)}for(y+=`
|
|
link data:`,a=this.linkDataArray,x=a.length,b=0;b<x;b++)E=a[b],y+=" "+Bl(this,E,!0)+"-->"+Bl(this,E,!1)}return y},xt.Qv=function(a,y){this.linkKeyProperty===""&&fe("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var x=fn.prototype.Qv.call(this,a,y),b=this,E=new Ye,z=new Ye,tt=new Ye,rt=this.vh;a.changes.each(function(ut){ut.model===b&&(ut.modelChange==="linkDataArray"?ut.change===ko?E.add(ut.newValue):ut.change===Bo&&tt.add(ut.oldValue):b.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ct){b.Jc(ct)&&z.add(ct)}):ut.object instanceof fn||b.lb(ut.object)||ES(b,ut.object).each(function(ct){z.add(ct)})))});var ot=this.il;ot.clear(),E.each(function(ut){ot.add(b.Ac(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(b.Ac(ut)),y&&z.add(ut)}),a=b.cloneDeep(z.Fa()),0<ot.count&&(x===null&&(x={}),y?x.removedLinkKeys=ot.Fa():x.insertedLinkKeys=ot.Fa()),0<a.length&&(x===null&&(x={}),x.modifiedLinkData=a),0<at.count&&(x===null&&(x={}),y?x.insertedLinkKeys=at.Fa():x.removedLinkKeys=at.Fa()),at.clear(),ot.clear(),x},xt.rm=function(){var a=fn.prototype.rm.call(this),y="";return this.linkCategoryProperty!=="category"&&typeof this.linkCategoryProperty=="string"&&(y+=`,
|
|
"linkCategoryProperty": `+this.quote(this.linkCategoryProperty)),this.linkKeyProperty!==""&&typeof this.linkKeyProperty=="string"&&(y+=`,
|
|
"linkKeyProperty": `+this.quote(this.linkKeyProperty)),this.linkFromKeyProperty!=="from"&&typeof this.linkFromKeyProperty=="string"&&(y+=`,
|
|
"linkFromKeyProperty": `+this.quote(this.linkFromKeyProperty)),this.linkToKeyProperty!=="to"&&typeof this.linkToKeyProperty=="string"&&(y+=`,
|
|
"linkToKeyProperty": `+this.quote(this.linkToKeyProperty)),this.linkFromPortIdProperty!==""&&typeof this.linkFromPortIdProperty=="string"&&(y+=`,
|
|
"linkFromPortIdProperty": `+this.quote(this.linkFromPortIdProperty)),this.linkToPortIdProperty!==""&&typeof this.linkToPortIdProperty=="string"&&(y+=`,
|
|
"linkToPortIdProperty": `+this.quote(this.linkToPortIdProperty)),this.linkLabelKeysProperty!==""&&typeof this.linkLabelKeysProperty=="string"&&(y+=`,
|
|
"linkLabelKeysProperty": `+this.quote(this.linkLabelKeysProperty)),this.nodeIsGroupProperty!=="isGroup"&&typeof this.nodeIsGroupProperty=="string"&&(y+=`,
|
|
"nodeIsGroupProperty": `+this.quote(this.nodeIsGroupProperty)),this.nodeGroupKeyProperty!=="group"&&typeof this.nodeGroupKeyProperty=="string"&&(y+=`,
|
|
"nodeGroupKeyProperty": `+this.quote(this.nodeGroupKeyProperty)),a+y},xt.gp=function(a){fn.prototype.gp.call(this,a),a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty),a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty),a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty),a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty),a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty),a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty),a.linkLabelKeysProperty&&(this.linkLabelKeysProperty=a.linkLabelKeysProperty),a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty),a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)},xt.Rv=function(){var a=fn.prototype.Rv.call(this),y=`,
|
|
"linkDataArray": `+uf(this,this.linkDataArray,!0);return a+y},xt.kv=function(a){fn.prototype.kv.call(this,a),a=a.linkDataArray,Array.isArray(a)&&(this.dm(a),this.linkDataArray=a)};function ES(a,y){for(var x=new Ye,b=0;b<a.linkDataArray.length;b++){var E=a.linkDataArray[b];f0(a,y,E,E,x)}return x}xt.Pv=function(a,y){this.linkKeyProperty===""&&fe("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var x=fn.prototype.Pv.call(this,a,y),b=this,E=new Ye,z=new Ye,tt=new Ye,rt=this.vh;a.changes.each(function(ut){ut.model===b&&(ut.modelChange==="linkDataArray"?ut.change===ko?E.add(ut.newValue):ut.change===Bo&&tt.add(ut.oldValue):b.Jc(ut.object)?z.add(ut.object):ut.object!==null&&(ut.object!==null&&rt&&rt.contains(ut.object)?rt.get(ut.object).each(function(ct){b.Jc(ct)&&z.add(ct)}):ut.object instanceof fn||b.lb(ut.object)||ES(b,ut.object).each(function(ct){z.add(ct)})))});var ot=this.il;ot.clear(),E.each(function(ut){ot.add(b.Ac(ut)),y||z.add(ut)});var at=this.kl;return at.clear(),tt.each(function(ut){at.add(b.Ac(ut)),y&&z.add(ut)}),a=x,0<ot.count&&(a+=(y?this.Xv:this.Vv)+uf(this,ot.Fa(),!0)),0<z.count&&(a+=this.iy+uf(this,z.Fa(),!0)),0<at.count&&(a+=(y?this.Vv:this.Xv)+uf(this,at.Fa(),!0)),at.clear(),ot.clear(),a},xt.fp=function(a){(a.linkCategoryProperty!==void 0&&a.linkCategoryProperty!==this.linkCategoryProperty||a.linkKeyProperty!==void 0&&a.linkKeyProperty!==this.linkKeyProperty||a.linkFromKeyProperty!==void 0&&a.linkFromKeyProperty!==this.linkFromKeyProperty||a.linkToKeyProperty!==void 0&&a.linkToKeyProperty!==this.linkToKeyProperty||a.linkFromPortIdProperty!==void 0&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||a.linkToPortIdProperty!==void 0&&a.linkToPortIdProperty!==this.linkToPortIdProperty||a.linkLabelKeysProperty!==void 0&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||a.nodeIsGroupProperty!==void 0&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||a.nodeGroupKeyProperty!==void 0&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&fe("applyIncrementalJson cannot change Model properties"),fn.prototype.fp.call(this,a);var y=a.insertedLinkKeys;if(Array.isArray(y))for(var x=y.length,b=0;b<x;b++){var E=y[b],z=this.jh(E);z===null&&(z=this.Jo({}),this.Ks(z,E),this.fi(z))}if(y=a.modifiedLinkData,Array.isArray(y)){for(x=y.length,b=0;b<x;b++)if(E=y[b],z=this.Ac(E),z=this.jh(z),z!==null){for(var tt in E)tt!=="__gohashid"&&tt!==this.linkKeyProperty&&this.setDataProperty(z,tt,E[tt]);NS(this,E,z)}}if(a=a.removedLinkKeys,Array.isArray(a))for(tt=a.length,y=0;y<tt;y++)x=this.jh(a[y]),x!==null&&this.bm(x)},ki.prototype.changeState=function(a,y){if(a!==null&&a.model===this){if(a.change===Ur){var x=a.object,b=a.propertyName;if(b===this.linkKeyProperty&&this.Jc(x)){var E=a.I(y);y=a.I(!y),y!==void 0&&this.wb.remove(y),E!==void 0&&this.wb.add(E,x),Hr(x,b,E);return}}else if(a.change===ko){if(x=a.newParam,a.modelChange==="linkDataArray"){a=a.newValue,Ue(a)&&typeof x=="number"&&(b=this.Ac(a),y?(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),b!==void 0&&this.wb.remove(b)):(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),b!==void 0&&this.wb.add(b,a)));return}if(a.modelChange==="linkLabelKeys"){b=this.Ef(a.object),Array.isArray(b)&&typeof x=="number"&&(y?(x=b.indexOf(a.newValue),0<=x&&b.splice(x,1)):0>b.indexOf(a.newValue)&&b.splice(x,0,a.newValue));return}}else if(a.change===Bo){if(x=a.oldParam,a.modelChange==="linkDataArray"){a=a.oldValue,Ue(a)&&typeof x=="number"&&(b=this.Ac(a),y?(this.$f.add(a),this.md[x]!==a&&this.md.splice(x,0,a),b!==void 0&&this.wb.add(b,a)):(this.$f.remove(a),this.md[x]===a&&this.md.splice(x,1),b!==void 0&&this.wb.remove(b)));return}if(a.modelChange==="linkLabelKeys"){b=this.Ef(a.object),Array.isArray(b)&&typeof x=="number"&&(y?0>b.indexOf(a.newValue)&&b.splice(x,0,a.newValue):(x=b.indexOf(a.newValue),0<=x&&b.splice(x,1)));return}}fn.prototype.changeState.call(this,a,y)}},xt=ki.prototype,xt.Vl=function(a){if(a!==void 0){var y=this.Ri;if(y!==null){var x=this.hc(a);x===null&&(x=this.copyNodeData(y),Hr(x,this.nodeKeyProperty,a),this.xf(x))}return a}},xt.yx=function(a){return Bl(this,a,!0)},xt.wv=function(a,y){Fg(this,a,y,!0)},xt.Bx=function(a){return Bl(this,a,!1)},xt.Bv=function(a,y){Fg(this,a,y,!1)};function Bl(a,y,x){if(y!==null&&(a=x?a.lf:a.mf,a!==""&&(a=jo(y,a),a!==void 0))){if(hf(a))return a;fe((x?"FromKey":"ToKey")+" value for link data "+y+" is not a number or a string: "+a)}}function Fg(a,y,x,b){if(x===null&&(x=void 0),y!==null){var E=b?a.lf:a.mf;if(E!=="")if(x=a.Vl(x),a.Jc(y)){var z=jo(y,E);z!==x&&(_u(a,z,y),Hr(y,E,x),a.hc(x)===null&&Gu(a,x,y),Qo(a,b?"linkFromKey":"linkToKey",Ur,E,y,z,x),typeof E=="string"&&a.La(y,E))}else Hr(y,E,x)}}xt.zx=function(a){return g0(this,a,!0)},xt.xv=function(a,y){Tg(this,a,y,!0)},xt.Cx=function(a){return g0(this,a,!1)},xt.Cv=function(a,y){Tg(this,a,y,!1)};function g0(a,y,x){return y===null||(a=x?a.ej:a.fj,a==="")?"":(y=jo(y,a),y===void 0?"":y)}function Tg(a,y,x,b){if(y!==null){var E=b?a.ej:a.fj;if(E!=="")if(a.Jc(y)){var z=jo(y,E);z===void 0&&(z=""),z!==x&&(Hr(y,E,x),Qo(a,b?"linkFromPortId":"linkToPortId",Ur,E,y,z,x),typeof E=="string"&&a.La(y,E))}else Hr(y,E,x)}}xt.Ef=function(a){if(a===null)return p0;var y=this.je;return y===""?p0:(a=jo(a,y),a===void 0?p0:a)},xt.Ls=function(a,y){if(a!==null){var x=this.je;if(x!=="")if(this.Jc(a)){var b=jo(a,x);if(b===void 0&&(b=p0),b!==y){if(Array.isArray(b))for(var E=b.length,z=0;z<E;z++)_u(this,b[z],a);for(Hr(a,x,y),E=y.length,z=0;z<E;z++){var tt=y[z];this.hc(tt)===null&&Gu(this,tt,a)}Qo(this,"linkLabelKeys",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x)}}else Hr(a,x,y)}},xt.Bu=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var b=jo(a,x);if(b===void 0)x=[],x.push(y),this.Ls(a,x);else if(Array.isArray(b)){var E=b.indexOf(y);0<=E||(E=b.length,b.push(y),this.Jc(a)&&(this.hc(y)===null&&Gu(this,y,a),Qo(this,"linkLabelKeys",ko,x,a,null,y,null,E)))}else fe(x+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}},xt.Qx=function(a,y){if(y!=null&&a!==null){var x=this.je;if(x!==""){var b=jo(a,x);if(Array.isArray(b)){var E=b.indexOf(y);0>E||(b.splice(E,1),this.Jc(a)&&(_u(this,y,a),Qo(this,"linkLabelKeys",Bo,x,a,y,null,E,null)))}else b!==void 0&&fe(x+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}},xt.Ac=function(a){if(a!==null){var y=this.Jh;if(y!==""&&(y=jo(a,y),y!==void 0)){if(hf(y))return y;fe("Key value for link data "+a+" is not a number or a string: "+y)}}},xt.Ks=function(a,y){if(a!==null){var x=this.Jh;if(x!=="")if(this.Jc(a)){var b=jo(a,x);b!==y&&this.jh(y)===null&&(Hr(a,x,y),b!==void 0&&this.wb.remove(b),this.wb.add(y,a),Qo(this,"linkKey",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x))}else Hr(a,x,y)}},xt.jh=function(a){return a===null&&fe("GraphLinksModel.findLinkDataForKey:key must not be null"),a!==void 0&&hf(a)?this.wb.I(a):null},xt.Bs=function(a){if(a!==null){var y=this.Jh;if(y!==""){var x=this.Ac(a);if(x===void 0||this.wb.contains(x)){var b=this.cl;if(b!==null&&(x=b(this,a),x!=null&&!this.wb.contains(x))){Hr(a,y,x);return}if(typeof x=="string"){for(b=2;this.wb.contains(x+b);)b++;Hr(a,y,x+b)}else if(x===void 0||typeof x=="number"){for(x=-this.wb.count-1;this.wb.contains(x);)x--;Hr(a,y,x)}}}}},xt.Jc=function(a){return a===null?!1:this.$f.contains(a)},xt.fi=function(a){a!==null&&(ma(a),this.Jc(a)||FS(this,a,!0))};function FS(a,y,x){if(a.linkKeyProperty!==""){var b=a.Ac(y);if(b!==void 0&&a.wb.I(b)===y)return;a.Bs(y),b=a.Ac(y),b===void 0&&fe("GraphLinksModel.makeLinkDataKeyUnique failed on "+y+". Data not added to model."),a.wb.add(b,y)}a.$f.add(y),b=null,x&&(b=a.md.length,a.md.splice(b,0,y)),Qo(a,"linkDataArray",ko,"linkDataArray",a,null,y,null,b),fy(a,y)}xt.Ey=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.fi(a[x]);else for(a=a.iterator;a.next();)this.fi(a.value)},xt.bm=function(a){a!==null&&TS(this,a,!0)};function TS(a,y,x){a.$f.remove(y);var b=a.Ac(y);if(b!==void 0&&a.wb.remove(b),b=null,x){if(b=a.md.indexOf(y),0>b)return;a.md.splice(b,1)}if(Qo(a,"linkDataArray",Bo,"linkDataArray",a,y,null,b,null),x=Bl(a,y,!0),_u(a,x,y),x=Bl(a,y,!1),_u(a,x,y),b=a.Ef(y),Array.isArray(b))for(var E=b.length,z=0;z<E;z++)x=b[z],_u(a,x,y)}xt.lA=function(a){if(Array.isArray(a))for(var y=a.length,x=0;x<y;x++)this.bm(a[x]);else for(a=a.iterator;a.next();)this.bm(a.value)},xt.Zz=function(a){if(this.linkKeyProperty===""&&fe("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed."),a!==this.linkDataArray&&Gn(a)){var y=this.kl;y.clear(),y.addAll(this.wb.iteratorKeys);var x=this.il;x.clear();for(var b=a.length,E=0;E<b;E++){var z=a[E],tt=this.Ac(z);if(tt!==void 0){x.add(tt);var rt=this.jh(tt);rt!==z&&(rt!==null?(this.Do(rt,z),NS(this,z,rt)):(z=this.cloneDeep(z),this.Ks(z,tt),this.fi(z)))}else tt=this.cloneDeep(z),this.fi(tt),x.add(this.Ac(tt))}for(a=y.iterator;a.next();)b=a.value,x.contains(b)||(b=this.jh(b))&&this.bm(b);y.clear(),x.clear()}};function fy(a,y){var x=Bl(a,y,!0);x=a.Vl(x),a.hc(x)===null&&Gu(a,x,y),x=Bl(a,y,!1),x=a.Vl(x),a.hc(x)===null&&Gu(a,x,y);var b=a.Ef(y);if(Array.isArray(b))for(var E=b.length,z=0;z<E;z++)x=b[z],a.hc(x)===null&&Gu(a,x,y)}xt.Jo=function(a){if(a===null)return null;var y=this.Ak;return a=y!==null?y(a,this):c0(this,a,!0),Ue(a)&&(qr(a),this.lf!==""&&Hr(a,this.lf,void 0),this.mf!==""&&Hr(a,this.mf,void 0),this.je!==""&&Hr(a,this.je,[])),a},xt.Yu=function(a){if(a===null)return!1;var y=this.jl;return y===""?!1:!!jo(a,y)},xt.lh=function(a){if(a!==null){var y=this.Je;if(y!==""&&(y=jo(a,y),y!==void 0)){if(hf(y))return y;fe("GroupKey value for node data "+a+" is not a number or a string: "+y)}}},xt.mp=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Je;if(x!=="")if(this.lb(a)){var b=jo(a,x);b!==y&&(_u(this,b,a),Hr(a,x,y),this.hc(y)===null&&Gu(this,y,a),Qo(this,"nodeGroupKey",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x))}else Hr(a,x,y)}},ki.prototype.copyNodeData=function(a){return a===null?null:(a=fn.prototype.copyNodeData.call(this,a),this.Ij||this.Je===""||jo(a,this.Je)===void 0||Hr(a,this.Je,void 0),a)},ki.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeGroupKeyProperty){this.mp(a,x);return}}else if(this.Jc(a)){if(y===this.linkFromKeyProperty){Fg(this,a,x,!0);return}if(y===this.linkToKeyProperty){Fg(this,a,x,!1);return}if(y===this.linkFromPortIdProperty){Tg(this,a,x,!0);return}if(y===this.linkToPortIdProperty){Tg(this,a,x,!1);return}if(y===this.linkKeyProperty){this.Ks(a,x);return}if(y===this.linkCategoryProperty){this.lp(a,x);return}if(y===this.linkLabelKeysProperty){this.Ls(a,x);return}}var b=jo(a,y);b!==x&&(Hr(a,y,x),this.Fs(a,y,b,x))},xt=ki.prototype,xt.Do=function(a,y){if(y){var x=this.lb(a),b=this.Jc(a),E;for(E in y)E==="__gohashid"||x&&E===this.nodeKeyProperty||x&&E===this.nodeIsGroupProperty&&jo(a,E)===y[E]||b&&E===this.linkKeyProperty||this.setDataProperty(a,E,y[E])}},xt.jp=function(a,y){fn.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y);for(x=this.$f.iterator;x.next();){var b=x.value,E=a,z=y;if(Bl(this,b,!0)===E){var tt=this.lf;Hr(b,tt,z),Qo(this,"linkFromKey",Ur,tt,b,E,z),typeof tt=="string"&&this.La(b,tt)}if(Bl(this,b,!1)===E&&(tt=this.mf,Hr(b,tt,z),Qo(this,"linkToKey",Ur,tt,b,E,z),typeof tt=="string"&&this.La(b,tt)),tt=this.Ef(b),Array.isArray(tt))for(var rt=tt.length,ot=this.je,at=0;at<rt;at++)tt[at]===E&&(tt[at]=z,Qo(this,"linkLabelKeys",ko,ot,b,E,z,at,at))}},xt.qv=function(a,y,x){if(this.lh(a)===y){var b=this.Je;Hr(a,b,x),Qo(this,"nodeGroupKey",Ur,b,a,y,x),typeof b=="string"&&this.La(a,b)}},xt.Lv=function(){fn.prototype.Lv.call(this);for(var a=this.linkDataArray,y=a.length,x=0;x<y;x++)fy(this,a[x])},xt.fm=function(a){fn.prototype.fm.call(this,a),a=this.wa(a);var y=Ap(this,a);if(y!==null){var x=Kn();for(y=y.iterator;y.next();){var b=y.value;if(this.lb(b)){if(this.lh(b)===a){var E=this.Je;Qo(this,"nodeGroupKey",Ur,E,b,a,a),typeof E=="string"&&this.La(b,E),x.push(b)}}else if(Bl(this,b,!0)===a&&(E=this.lf,Qo(this,"linkFromKey",Ur,E,b,a,a),typeof E=="string"&&this.La(b,E),x.push(b)),Bl(this,b,!1)===a&&(E=this.mf,Qo(this,"linkToKey",Ur,E,b,a,a),typeof E=="string"&&this.La(b,E),x.push(b)),E=this.Ef(b),Array.isArray(E))for(var z=E.length,tt=this.je,rt=0;rt<z;rt++)E[rt]===a&&(Qo(this,"linkLabelKeys",ko,tt,b,a,a,rt,rt),x.push(b))}for(y=0;y<x.length;y++)_u(this,a,x[y]);zn(x)}},xt.em=function(a){fn.prototype.em.call(this,a);var y=this.lh(a);this.hc(y)===null&&Gu(this,y,a)},xt.qp=function(a){fn.prototype.qp.call(this,a);var y=this.lh(a);_u(this,y,a)},xt.ps=function(a){if(a===null)return"";var y=this.dj;if(y===""||(y=jo(a,y),y===void 0))return"";if(typeof y=="string")return y;fe("getCategoryForLinkData found a non-string category for "+a+": "+y)},ki.prototype.getLinkCategoryForData=function(a){return this.ps(a)},ki.prototype.lp=function(a,y){if(a!==null){var x=this.dj;if(x!=="")if(this.Jc(a)){var b=jo(a,x);b===void 0&&(b=""),b!==y&&(Hr(a,x,y),Qo(this,"linkCategory",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x))}else Hr(a,x,y)}},ki.prototype.setLinkCategoryForData=function(a,y){this.lp(a,y)},xt=ki.prototype,xt.lm=function(a,y){fn.prototype.lm.call(this,a,y),this.mp(y,this.lh(a))};function NS(a,y,x){a.lp(x,a.ps(y)),a.wv(x,a.yx(y)),a.Bv(x,a.Bx(y)),a.Ls(x,a.Ef(y)),a.xv(x,a.zx(y)),a.Cv(x,a.Cx(y))}xt.Wj=function(){return!0},xt.ri=function(){return!0},xt.xs=function(){return!0},xt.Xj=function(){return!0},Oe.Object.defineProperties(ki.prototype,{archetypeNodeData:{get:function(){return this.Ri},set:function(a){var y=this.Ri;y!==a&&(this.Ri=a,this.g("archetypeNodeData",y,a))}},linkFromKeyProperty:{get:function(){return this.lf},set:function(a){var y=this.lf;y!==a&&(this.lf=a,this.g("linkFromKeyProperty",y,a))}},linkToKeyProperty:{get:function(){return this.mf},set:function(a){var y=this.mf;y!==a&&(this.mf=a,this.g("linkToKeyProperty",y,a))}},linkFromPortIdProperty:{get:function(){return this.ej},set:function(a){var y=this.ej;y!==a&&(this.ej=a,this.g("linkFromPortIdProperty",y,a))}},linkToPortIdProperty:{get:function(){return this.fj},set:function(a){var y=this.fj;y!==a&&(this.fj=a,this.g("linkToPortIdProperty",y,a))}},linkLabelKeysProperty:{get:function(){return this.je},set:function(a){var y=this.je;y!==a&&(this.je=a,this.g("linkLabelKeysProperty",y,a))}},linkDataArray:{get:function(){return this.md},set:function(a){var y=this.md;if(y!==a){this.wb.clear();for(var x=a.length,b=0;b<x;b++){var E=a[b];Ue(E)||fe("GraphLinksModel.linkDataArray must only contain Objects, not: "+E),ma(E)}if(this.md=a,this.linkKeyProperty!==""){for(b=new Ve,E=0;E<x;E++){var z=a[E],tt=this.Ac(z);tt===void 0||this.wb.I(tt)!==null?b.add(z):this.wb.add(tt,z)}for(b=b.iterator;b.next();)E=b.value,this.Bs(E),z=this.Ac(E),z!==void 0&&this.wb.add(z,E)}for(b=new Ye,E=0;E<x;E++)b.add(a[E]);for(this.$f=b,Qo(this,"linkDataArray",Ur,"linkDataArray",this,y,a),y=0;y<x;y++)fy(this,a[y])}}},linkKeyProperty:{get:function(){return this.Jh},set:function(a){var y=this.Jh;if(y!==a){this.Jh=a,this.wb.clear();for(var x=this.linkDataArray.length,b=0;b<x;b++){var E=this.linkDataArray[b],z=this.Ac(E);z===void 0&&(this.Bs(E),z=this.Ac(E)),z!==void 0&&this.wb.add(z,E)}this.g("linkKeyProperty",y,a)}}},makeUniqueLinkKeyFunction:{get:function(){return this.cl},set:function(a){var y=this.cl;y!==a&&(this.cl=a,this.g("makeUniqueLinkKeyFunction",y,a))}},copyLinkDataFunction:{get:function(){return this.Ak},set:function(a){var y=this.Ak;y!==a&&(this.Ak=a,this.g("copyLinkDataFunction",y,a))}},nodeIsGroupProperty:{get:function(){return this.jl},set:function(a){var y=this.jl;y!==a&&(this.jl=a,this.g("nodeIsGroupProperty",y,a))}},nodeGroupKeyProperty:{get:function(){return this.Je},set:function(a){var y=this.Je;y!==a&&(this.Je=a,this.g("nodeGroupKeyProperty",y,a))}},Ij:{get:function(){return this.Lm},set:function(a){this.Lm!==a&&(this.Lm=a)}},linkCategoryProperty:{get:function(){return this.dj},set:function(a){var y=this.dj;y!==a&&(this.dj=a,this.g("linkCategoryProperty",y,a))}},type:{get:function(){return"GraphLinksModel"}}}),ki.prototype.setCategoryForLinkData=ki.prototype.lp,ki.prototype.getCategoryForLinkData=ki.prototype.ps,ki.prototype.assignAllDataProperties=ki.prototype.Do,ki.prototype.setGroupKeyForNodeData=ki.prototype.mp,ki.prototype.getGroupKeyForNodeData=ki.prototype.lh,ki.prototype.isGroupForNodeData=ki.prototype.Yu,ki.prototype.copyLinkData=ki.prototype.Jo,ki.prototype.mergeLinkDataArray=ki.prototype.Zz,ki.prototype.removeLinkDataCollection=ki.prototype.lA,ki.prototype.removeLinkData=ki.prototype.bm,ki.prototype.addLinkDataCollection=ki.prototype.Ey,ki.prototype.addLinkData=ki.prototype.fi,ki.prototype.containsLinkData=ki.prototype.Jc,ki.prototype.makeLinkDataKeyUnique=ki.prototype.Bs,ki.prototype.findLinkDataForKey=ki.prototype.jh,ki.prototype.setKeyForLinkData=ki.prototype.Ks,ki.prototype.getKeyForLinkData=ki.prototype.Ac,ki.prototype.removeLabelKeyForLinkData=ki.prototype.Qx,ki.prototype.addLabelKeyForLinkData=ki.prototype.Bu,ki.prototype.setLabelKeysForLinkData=ki.prototype.Ls,ki.prototype.getLabelKeysForLinkData=ki.prototype.Ef,ki.prototype.setToPortIdForLinkData=ki.prototype.Cv,ki.prototype.getToPortIdForLinkData=ki.prototype.Cx,ki.prototype.setFromPortIdForLinkData=ki.prototype.xv,ki.prototype.getFromPortIdForLinkData=ki.prototype.zx,ki.prototype.setToKeyForLinkData=ki.prototype.Bv,ki.prototype.getToKeyForLinkData=ki.prototype.Bx,ki.prototype.setFromKeyForLinkData=ki.prototype.wv,ki.prototype.getFromKeyForLinkData=ki.prototype.yx,ki.prototype.clear=ki.prototype.clear;var p0=Object.freeze([]);ki.className="GraphLinksModel",xu.GraphLinksModel=ki,fn.constructGraphLinksModel=fn.constructGraphLinksModel=function(){return new ki},fn.initDiagramModel=hy=function(){return new ki};function Na(a,y){fn.call(this),this.Ke="parent",this.Nm=!1,this.nj="parentLinkCategory",a!==void 0&&(Gn(a)?this.nodeDataArray=a:y=a),y&&(Object.assign(this,y),a=y.Changed)&&(delete this.Changed,this.Pe(a))}le(Na,fn),Na.constructGraphLinksModel=fn.constructGraphLinksModel,Na.prototype.cloneProtected=function(a){fn.prototype.cloneProtected.call(this,a),a.Ke=this.Ke,a.Nm=this.Nm,a.nj=this.nj},xt=Na.prototype,xt.toString=function(a){if(a===void 0&&(a=0),2<=a)return this.np();var y=(this.name!==""?this.name:"")+" TreeModel";if(0<a){y+=`
|
|
node data:`,a=this.nodeDataArray;for(var x=a.length,b=0;b<x;b++){var E=a[b];y+=" "+this.wa(E)+":"+Ir(E)}}return y},xt.rm=function(){var a=fn.prototype.rm.call(this),y="";return this.nodeParentKeyProperty!=="parent"&&typeof this.nodeParentKeyProperty=="string"&&(y+=`,
|
|
"nodeParentKeyProperty": `+this.quote(this.nodeParentKeyProperty)),a+y},xt.gp=function(a){fn.prototype.gp.call(this,a),a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)},xt.fp=function(a){a.nodeParentKeyProperty!==void 0&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&fe("applyIncrementalJson cannot change Model properties"),fn.prototype.fp.call(this,a)},xt.Vl=function(a){return a},xt.mh=function(a){if(a!==null){var y=this.Ke;if(y!==""&&(y=jo(a,y),y!==void 0)){if(hf(y))return y;fe("ParentKey value for node data "+a+" is not a number or a string: "+y)}}},xt.qe=function(a,y){if(y===null&&(y=void 0),a!==null){var x=this.Ke;if(x!=="")if(y=this.Vl(y),this.lb(a)){var b=jo(a,x);b!==y&&(_u(this,b,a),Hr(a,x,y),this.hc(y)===null&&Gu(this,y,a),Qo(this,"nodeParentKey",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x))}else Hr(a,x,y)}},xt.ss=function(a){if(a===null)return"";var y=this.nj;return y===""||(y=jo(a,y),y===void 0)?"":typeof y=="string"?y:(fe("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+y),"")},Na.prototype.getLinkCategoryForData=function(a){return this.ss(a)},Na.prototype.Ms=function(a,y){if(a!==null){var x=this.nj;if(x!=="")if(this.lb(a)){var b=jo(a,x);b===void 0&&(b=""),b!==y&&(Hr(a,x,y),Qo(this,"parentLinkCategory",Ur,x,a,b,y),typeof x=="string"&&this.La(a,x))}else Hr(a,x,y)}},Na.prototype.setLinkCategoryForData=function(a,y){this.Ms(a,y)},Na.prototype.copyNodeData=function(a){return a===null?null:(a=fn.prototype.copyNodeData.call(this,a),this.Jj||this.Ke===""||jo(a,this.Ke)===void 0||Hr(a,this.Ke,void 0),a)},Na.prototype.setDataProperty=function(a,y,x){if(this.lb(a)){if(y===this.nodeKeyProperty){this.km(a,x);return}if(y===this.nodeCategoryProperty){this.jm(a,x);return}if(y===this.nodeParentKeyProperty){this.qe(a,x);return}}var b=jo(a,y);b!==x&&(Hr(a,y,x),this.Fs(a,y,b,x))},xt=Na.prototype,xt.jp=function(a,y){fn.prototype.jp.call(this,a,y);for(var x=this.kb.iterator;x.next();)this.qv(x.value,a,y)},xt.qv=function(a,y,x){if(this.mh(a)===y){var b=this.Ke;Hr(a,b,x),Qo(this,"nodeParentKey",Ur,b,a,y,x),typeof b=="string"&&this.La(a,b)}},xt.fm=function(a){fn.prototype.fm.call(this,a),a=this.wa(a);var y=Ap(this,a);if(y!==null){var x=Kn();for(y=y.iterator;y.next();){var b=y.value;if(this.lb(b)&&this.mh(b)===a){var E=this.Ke;Qo(this,"nodeParentKey",Ur,E,b,a,a),typeof E=="string"&&this.La(b,E),x.push(b)}}for(y=0;y<x.length;y++)_u(this,a,x[y]);zn(x)}},xt.em=function(a){fn.prototype.em.call(this,a);var y=this.mh(a);y=this.Vl(y),this.hc(y)===null&&Gu(this,y,a)},xt.qp=function(a){fn.prototype.qp.call(this,a);var y=this.mh(a);_u(this,y,a)},xt.lm=function(a,y){fn.prototype.lm.call(this,a,y),this.Ms(y,this.ss(a)),this.qe(y,this.mh(a))},xt.Tl=function(){return!0},xt.xs=function(){return!0},Oe.Object.defineProperties(Na.prototype,{nodeParentKeyProperty:{get:function(){return this.Ke},set:function(a){var y=this.Ke;y!==a&&(this.Ke=a,this.g("nodeParentKeyProperty",y,a))}},Jj:{get:function(){return this.Nm},set:function(a){this.Nm!==a&&(this.Nm=a)}},parentLinkCategoryProperty:{get:function(){return this.nj},set:function(a){var y=this.nj;y!==a&&(this.nj=a,this.g("parentLinkCategoryProperty",y,a))}},linkCategoryProperty:{get:function(){return this.parentLinkCategoryProperty},set:function(a){this.parentLinkCategoryProperty=a}},type:{get:function(){return"TreeModel"}}}),Na.prototype.setParentLinkCategoryForNodeData=Na.prototype.Ms,Na.prototype.getParentLinkCategoryForNodeData=Na.prototype.ss,Na.prototype.setParentKeyForNodeData=Na.prototype.qe,Na.prototype.getParentKeyForNodeData=Na.prototype.mh,Na.className="TreeModel",xu.TreeModel=Na;function oo(a){Zr.call(this),this.lw=this.Zm=this.lc=0,this.Wp=360,this.kw=Pu,this.Ti=0,this.Zv=new jt,this.Jp=this.me=0,this.Xr=new zp,this.gt=this.mj=0,this.ty=600,this.eo=NaN,this.Cm=1,this.ro=0,this.ul=360,this.Rb=Pu,this.K=Da,this.nd=Dg,this.hd=ry,this.tf=6,this.Nn=w0,a&&Object.assign(this,a)}le(oo,Zr),oo.prototype.cloneProtected=function(a){Zr.prototype.cloneProtected.call(this,a),a.eo=this.eo,a.Cm=this.Cm,a.ro=this.ro,a.ul=this.ul,a.Rb=this.Rb,a.K=this.K,a.nd=this.nd,a.hd=this.hd,a.tf=this.tf,a.Nn=this.Nn},oo.prototype.qb=function(a){a.classType===oo?a===x0||a===P0||a===y0||a===S0||a===Dg?this.sorting=a:a===oc||a===Ng||a===Da||a===ff?this.direction=a:a===Dd||a===df||a===Pu||a===wu?this.arrangement=a:(a===Rc||a===w0)&&(this.nodeDiameterFormula=a):Zr.prototype.qb.call(this,a)},oo.prototype.createNetwork=function(){return new Ag(this)},oo.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),a=this.network.vertexes,1>=a.count)a.count===1&&(a=a.first(),a.centerX=0,a.centerY=0);else{var y=new Ve;y.addAll(a.iterator),a=new Ve;var x=new Ve,b=this.sort(y),E,z,tt=this.Jp,rt=this.arrangement,ot=this.nodeDiameterFormula,at=this.radius;(!isFinite(at)||0>=at)&&(at=NaN);var ut=this.aspectRatio;(!isFinite(ut)||0>=ut)&&(ut=1);var ct=this.startAngle;isFinite(ct)||(ct=0);var mt=this.sweepAngle;if((!isFinite(mt)||360<mt||1>mt)&&(mt=360),y=this.spacing,isFinite(y)||(y=NaN),rt===wu&&ot===Rc?rt=Pu:rt===wu&&ot!==Rc&&(rt=this.arrangement),(this.direction===oc||this.direction===Ng)&&this.sorting!==Dg){for(ot=0;!(ot>=b.length)&&(a.add(b.M(ot)),!(ot+1>=b.length));ot+=2)x.add(b.M(ot+1));this.direction===oc?(this.arrangement===wu&&a.reverse(),b=new Ve,b.addAll(a),b.addAll(x)):(this.arrangement===wu&&x.reverse(),b=new Ve,b.addAll(x),b.addAll(a))}ot=b.length;for(var yt=z=E=0;yt<b.length;yt++){var St=ct+mt*z*(this.direction===Da?1:-1)/ot,Lt=b.M(yt).diameter;isNaN(Lt)&&(Lt=cf(b.M(yt),St)),360>mt&&(yt===0||yt===b.length-1)&&(Lt/=2),E+=Lt,z++}if(isNaN(at)||rt===wu){if(isNaN(y)&&(y=6),rt!==Pu&&rt!==wu){for(z=-1/0,tt=0;tt<ot;tt++)yt=b.M(tt),E=b.M(tt===ot-1?0:tt+1),isNaN(yt.diameter)&&cf(yt,0),isNaN(E.diameter)&&cf(E,0),z=Math.max(z,(yt.diameter+E.diameter)/2);tt=z+y,rt===Dd?at=(z+y)/(2*Math.PI/ot):at=m0(this,tt*(360<=mt?ot:ot-1),ut,ct*Math.PI/180,mt*Math.PI/180)}else at=m0(this,E+(360<=mt?ot:ot-1)*(rt!==wu?y:1.6*y),ut,ct*Math.PI/180,mt*Math.PI/180);z=at*ut}else if(z=at*ut,yt=cy(this,at,z,ct*Math.PI/180,mt*Math.PI/180),isNaN(y))(rt===Pu||rt===wu)&&(y=(yt-E)/(360<=mt?ot:ot-1));else if(rt===Pu||rt===wu)yt=(yt-E)/(360<=mt?ot:ot-1),yt<y?(at=m0(this,E+y*(360<=mt?ot:ot-1),ut,ct*Math.PI/180,mt*Math.PI/180),z=at*ut):y=yt;else{for(tt=-1/0,E=0;E<ot;E++)St=b.M(E),Lt=b.M(E===ot-1?0:E+1),isNaN(St.diameter)&&cf(St,0),isNaN(Lt.diameter)&&cf(Lt,0),tt=Math.max(tt,(St.diameter+Lt.diameter)/2);tt+=y,E=m0(this,tt*(360<=mt?ot:ot-1),ut,ct*Math.PI/180,mt*Math.PI/180),E>at?(at=E,z=at*ut):tt=yt/(360<=mt?ot:ot-1)}if(this.kw=rt,this.lc=at,this.Zm=ut,this.lw=ct,this.Wp=mt,this.Ti=y,this.me=z,this.Jp=tt,y=b,b=this.kw,rt=this.lc,at=this.lw,ut=this.Wp,ct=this.Ti,mt=this.me,ot=this.Jp,this.direction!==oc&&this.direction!==Ng||b!==wu)if(this.direction===oc||this.direction===Ng){switch(tt=0,b){case df:tt=180*v0(this,rt,mt,at,ot)/Math.PI;break;case Pu:ot=y=0,tt=a.first(),tt!==null&&(y=cf(tt,Math.PI/2)),tt=x.first(),tt!==null&&(ot=cf(tt,Math.PI/2)),tt=180*v0(this,rt,mt,at,ct+(y+ot)/2)/Math.PI;break;case Dd:tt=ut/y.length}if(this.direction===oc){switch(b){case df:jp(this,a,at,ff);break;case Pu:Rp(this,a,at,ff);break;case Dd:Ip(this,a,ut/2,at,ff)}switch(b){case df:jp(this,x,at+tt,Da);break;case Pu:Rp(this,x,at+tt,Da);break;case Dd:Ip(this,x,ut/2,at+tt,Da)}}else{switch(b){case df:jp(this,x,at,ff);break;case Pu:Rp(this,x,at,ff);break;case Dd:Ip(this,x,ut/2,at,ff)}switch(b){case df:jp(this,a,at+tt,Da);break;case Pu:Rp(this,a,at+tt,Da);break;case Dd:Ip(this,a,ut/2,at+tt,Da)}}}else switch(b){case df:jp(this,y,at,this.direction);break;case Pu:Rp(this,y,at,this.direction);break;case Dd:Ip(this,y,ut,at,this.direction);break;case wu:DS(this,y,ut,at,this.direction)}else DS(this,y,ut,at-ut/2,Da)}this.updateParts(),this.network=null,this.isValidLayout=!0};function Ip(a,y,x,b,E){var z=a.Wp,tt=a.lc;a=a.me,b=b*Math.PI/180,x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var at=b+(E===Da?ot*x/(360<=z?rt:rt-1):-(ot*x)/rt),ut=y.M(ot),ct=tt*Math.tan(at)/a;ct=Math.sqrt((tt*tt+a*a*ct*ct)/(1+ct*ct)),ut.centerX=ct*Math.cos(at),ut.centerY=ct*Math.sin(at),ut.actualAngle=180*at/Math.PI}}function Rp(a,y,x,b){var E=a.lc,z=a.me,tt=a.Ti;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var at=y.M(ot),ut=y.M(ot===rt-1?0:ot+1),ct=z*Math.sin(x);at.centerX=E*Math.cos(x),at.centerY=ct,at.actualAngle=180*x/Math.PI,isNaN(at.diameter)&&cf(at,0),isNaN(ut.diameter)&&cf(ut,0),at=v0(a,E,z,b===Da?x:-x,(at.diameter+ut.diameter)/2+tt),x+=b===Da?at:-at}}function jp(a,y,x,b){var E=a.lc,z=a.me,tt=a.Jp;x=x*Math.PI/180;for(var rt=y.length,ot=0;ot<rt;ot++){var at=y.M(ot);at.centerX=E*Math.cos(x),at.centerY=z*Math.sin(x),at.actualAngle=180*x/Math.PI,at=v0(a,E,z,b===Da?x:-x,tt),x+=b===Da?at:-at}}function DS(a,y,x,b,E){var z=a.Wp;if(a.mj=0,a.Xr=new zp,360>x){for(z=b+(E===Da?z:-z);0>z;)z+=360;z%=360,180<z&&(z-=360),z*=Math.PI/180,a.gt=z,BS(a,y,x,b,E)}else AS(a,y,x,b,E);a.Xr.commit(y)}function AS(a,y,x,b,E){var z=a.lc,tt=a.Ti,rt=a.Zm,ot=z*Math.cos(b*Math.PI/180),at=a.me*Math.sin(b*Math.PI/180),ut=y.Fa();if(ut.length===3)ut[0].centerX=z,ut[0].centerY=0,ut[1].centerX=ut[0].centerX-ut[0].width/2-ut[1].width/2-tt,ut[1].y=ut[0].y,ut[2].centerX=(ut[0].centerX+ut[1].centerX)/2,ut[2].y=ut[0].y-ut[2].height-tt;else if(ut.length===4)ut[0].centerX=z,ut[0].centerY=0,ut[2].centerX=-ut[0].centerX,ut[2].centerY=ut[0].centerY,ut[1].centerX=0,ut[1].y=Math.min(ut[0].y,ut[2].y)-ut[1].height-tt,ut[3].centerX=0,ut[3].y=Math.max(ut[0].y+ut[0].height+tt,ut[2].y+ut[2].height+tt);else{z=jt.alloc();for(var ct=0;ct<ut.length&&(ut[ct].centerX=ot,ut[ct].centerY=at,!(ct>=ut.length-1));ct++)OS(a,ot,at,ut,ct,E,z)||IS(a,ot,at,ut,ct,E,z),ot=z.x,at=z.y;if(jt.free(z),a.mj++,!(23<a.mj)){ot=ut[0].centerX,at=ut[0].centerY,z=ut[ut.length-1].centerX,ct=ut[ut.length-1].centerY;var mt=Math.abs(ot-z)-((ut[0].width+ut[ut.length-1].width)/2+tt),yt=Math.abs(at-ct)-((ut[0].height+ut[ut.length-1].height)/2+tt);tt=0,1>Math.abs(yt)?Math.abs(ot-z)<(ut[0].width+ut[ut.length-1].width)/2&&(tt=0):tt=0<yt?yt:1>Math.abs(mt)?0:mt,ot=Math.abs(z)>Math.abs(ct)?0<z!=at>ct:0<ct!=ot<z,(ot=E===Da?ot:!ot)&&(tt=-Math.abs(tt),tt=Math.min(tt,-ut[ut.length-1].width),tt=Math.min(tt,-ut[ut.length-1].height)),a.Xr.compare(tt,ut),1<Math.abs(tt)&&(a.lc=8>a.mj?a.lc-tt/(2*Math.PI):5>ut.length&&10<tt?a.lc/2:a.lc-(0<tt?1.7:-2.3),a.me=a.lc*rt,AS(a,y,x,b,E))}}}function BS(a,y,x,b,E){for(var z=a.lc,tt=a.me,rt=a.Zm,ot=z*Math.cos(b*Math.PI/180),at=tt*Math.sin(b*Math.PI/180),ut=jt.alloc(),ct=y.Fa(),mt=0;mt<ct.length&&(ct[mt].centerX=ot,ct[mt].centerY=at,!(mt>=ct.length-1));mt++)OS(a,ot,at,ct,mt,E,ut)||IS(a,ot,at,ct,mt,E,ut),ot=ut.x,at=ut.y;if(jt.free(ut),a.mj++,!(23<a.mj)){if(ot=Math.atan2(at,ot),ot=E===Da?a.gt-ot:ot-a.gt,ot=Math.abs(ot)<Math.abs(ot-2*Math.PI)?ot:ot-2*Math.PI,z=ot*(z+tt)/2,tt=a.Xr,Math.abs(z)<Math.abs(tt.Pl))for(tt.Pl=z,tt.mk=[],tt.tm=[],ot=0;ot<ct.length;ot++)tt.mk[ot]=ct[ot].bounds.x,tt.tm[ot]=ct[ot].bounds.y;1<Math.abs(z)&&(a.lc=8>a.mj?a.lc-z/(2*Math.PI):a.lc-(0<z?1.7:-2.3),a.me=a.lc*rt,BS(a,y,x,b,E))}}function OS(a,y,x,b,E,z,tt){var rt=a.lc,ot=a.me,at=0;a=(b[E].width+b[E+1].width)/2+a.Ti;var ut=!1;if(0<=x!=(z===Da)){if(z=y+a,z>rt){if(z=y-a,z<-rt)return tt.x=z,tt.y=at,!1;ut=!0}}else if(z=y-a,z<-rt){if(z=y+a,z>rt)return tt.x=z,tt.y=at,!1;ut=!0}return at=Math.sqrt(1-Math.min(1,z*z/(rt*rt)))*ot,0>x!==ut&&(at=-at),Math.abs(x-at)>(b[E].height+b[E+1].height)/2?(tt.x=z,tt.y=at,!1):(tt.x=z,tt.y=at,!0)}function IS(a,y,x,b,E,z,tt){var rt=a.lc,ot=a.me,at=0;if(a=(b[E].height+b[E+1].height)/2+a.Ti,b=!1,0<=y!=(z===Da)){if(z=x-a,z<-ot){if(z=x+a,z>ot){tt.x=at,tt.y=z;return}b=!0}}else if(z=x+a,z>ot){if(z=x-a,z<-ot){tt.x=at,tt.y=z;return}b=!0}at=Math.sqrt(1-Math.min(1,z*z/(ot*ot)))*rt,0>y!==b&&(at=-at),tt.x=at,tt.y=z}oo.prototype.commitLayout=function(){this.commitNodes(),this.isRouting&&this.commitLinks()},oo.prototype.commitNodes=function(){var a=this.group!==null&&this.group.placeholder!==null&&this.group.isSubGraphExpanded,y=a?this.group.location.copy():null,x=this.actualCenter;a?x=new jt(0,0):(x.x=this.arrangementOrigin.x+this.lc,x.y=this.arrangementOrigin.y+this.me);for(var b=this.network.vertexes.iterator;b.next();){var E=b.value;E.x+=x.x,E.y+=x.y,E.commit()}a&&(this.group.Va(),a=this.group.position.copy(),x=this.group.location.copy(),y=y.re(x.re(a)),this.group.move(y),this.Zv=y.re(a))},oo.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function cy(a,y,x,b,E){var z=a.ty;if(.001>Math.abs(a.Zm-1))return b!==void 0&&E!==void 0?E*y:2*Math.PI*y;a=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x;for(var tt=0,rt=b!==void 0&&E!==void 0?E/(z+1):Math.PI/(2*(z+1)),ot=0,at=0;at<=z;at++){b!==void 0&&E!==void 0?ot=b+at*E/z:ot=at*Math.PI/(2*z);var ut=Math.sin(ot);tt+=Math.sqrt(1-a*a*ut*ut)*rt}return b!==void 0&&E!==void 0?(y>x?y:x)*tt:4*(y>x?y:x)*tt}function m0(a,y,x,b,E){return y/(b!==void 0&&E!==void 0?cy(a,1,x,b,E):cy(a,1,x))}function v0(a,y,x,b,E){if(.001>Math.abs(a.Zm-1))return E/y;var z=y>x?Math.sqrt(y*y-x*x)/y:Math.sqrt(x*x-y*y)/x,tt=0;a=2*Math.PI/(700*a.network.vertexes.count),y>x&&(b+=Math.PI/2);for(var rt=0;;rt++){var ot=Math.sin(b+rt*a);if(tt+=(y>x?y:x)*Math.sqrt(1-z*z*ot*ot)*a,tt>=E)return rt*a}}oo.prototype.sort=function(a){switch(this.sorting){case y0:break;case S0:a.reverse();break;case x0:a.sort(this.comparer);break;case P0:a.sort(this.comparer),a.reverse();break;case Dg:return this.ak(Ax(a));default:fe("Invalid sorting type.")}return a};function Ax(a){for(var y=[],x=0;x<a.length;x++)y.push(0);x=new Ve;for(var b=0;b<a.length;b++){var E=-1,z=-1;if(b===0)for(var tt=0;tt<a.length;tt++){var rt=a.M(tt).edgesCount;rt>E&&(E=rt,z=tt)}else for(tt=0;tt<a.length;tt++)rt=y[tt],rt>E&&(E=rt,z=tt);for(x.add(a.M(z)),y[z]=-1,z=a.M(z),tt=z.sourceEdges;tt.next();)E=a.indexOf(tt.value.fromVertex),0>E||0<=y[E]&&y[E]++;for(z=z.destinationEdges;z.next();)E=a.indexOf(z.value.toVertex),0>E||0<=y[E]&&y[E]++}return x}oo.prototype.ak=function(a){for(var y=[],x=0;x<a.length;x++){var b=a.M(x);y[x]=[];for(var E,z=b.destinationEdges;z.next();)E=a.indexOf(z.value.toVertex),E!==x&&0>y[x].indexOf(E)&&y[x].push(E);for(b=b.sourceEdges;b.next();)E=a.indexOf(b.value.fromVertex),E!==x&&0>y[x].indexOf(E)&&y[x].push(E)}for(z=[],x=0;x<y.length;x++)z[x]=0;x=[];var tt=[],rt=[];b=[],E=new Ve;for(var ot=0,at=0;at<y.length;at++){var ut=y[at].length;if(ut===1)b.push(at);else if(ut===0)E.add(a.M(at));else{if(ot===0)x.push(at);else{for(var ct=ut=1/0,mt=-1,yt=[],St=0;St<x.length;St++)0>y[x[St]].indexOf(x[St===x.length-1?0:St+1])&&yt.push(St===x.length-1?0:St+1);if(yt.length===0)for(St=0;St<x.length;St++)yt.push(St);for(St=0;St<yt.length;St++){for(var Lt=yt[St],Ot=y[at],Dt=0,Gt=0;Gt<tt.length;Gt++){var Vt=z[tt[Gt]],Yt=z[rt[Gt]];if(Vt<Yt){var qt=Vt;Vt=Yt}else qt=Yt;if(qt<Lt&&Lt<=Vt)for(Yt=0;Yt<Ot.length;Yt++){var ae=Ot[Yt];0>x.indexOf(ae)||qt<z[ae]&&z[ae]<Vt||qt===z[ae]||Vt===z[ae]||Dt++}else for(Yt=0;Yt<Ot.length;Yt++)ae=Ot[Yt],0>x.indexOf(ae)||qt<z[ae]&&z[ae]<Vt&&qt!==z[ae]&&Vt!==z[ae]&&Dt++}for(Ot=Dt,Gt=Dt=0;Gt<y[at].length;Gt++)qt=x.indexOf(y[at][Gt]),0<=qt&&(qt=Math.abs(Lt-(qt>=Lt?qt+1:qt)),Dt+=qt<x.length+1-qt?qt:x.length+1-qt);for(Gt=0;Gt<tt.length;Gt++)qt=z[tt[Gt]],Vt=z[rt[Gt]],qt>=Lt&&qt++,Vt>=Lt&&Vt++,qt>Vt&&(Yt=Vt,Vt=qt,qt=Yt),Vt-qt<(x.length+2)/2==(qt<Lt&&Lt<=Vt)&&Dt++;(Ot<ut||Ot===ut&&Dt<ct)&&(ut=Ot,ct=Dt,mt=Lt)}for(x.splice(mt,0,at),ut=0;ut<x.length;ut++)z[x[ut]]=ut;for(ut=0;ut<y[at].length;ut++)ct=y[at][ut],0<=x.indexOf(ct)&&(tt.push(at),rt.push(ct))}ot++}}for(tt=x.length;;){for(z=!0,rt=0;rt<b.length;rt++)if(ot=b[rt],at=y[ot][0],ut=x.indexOf(at),0<=ut){for(mt=ct=0;mt<y[at].length;mt++)yt=x.indexOf(y[at][mt]),0>yt||yt===ut||(St=yt>ut?yt-ut:ut-yt,ct+=yt<ut!=St>tt-St?1:-1);x.splice(0>ct?ut:ut+1,0,ot),b.splice(rt,1),rt--}else z=!1;if(z)break;x.push(b[0]),b.splice(0,1)}for(y=0;y<x.length;y++)E.add(a.M(x[y]));return E},Oe.Object.defineProperties(oo.prototype,{radius:{get:function(){return this.eo},set:function(a){this.eo!==a&&(0<a||isNaN(a))&&(this.eo=a,this.C())}},aspectRatio:{get:function(){return this.Cm},set:function(a){this.Cm!==a&&0<a&&(this.Cm=a,this.C())}},startAngle:{get:function(){return this.ro},set:function(a){this.ro!==a&&(this.ro=a,this.C())}},sweepAngle:{get:function(){return this.ul},set:function(a){this.ul!==a&&(0<a&&360>=a?this.ul=a:this.ul=360,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==wu&&a!==Pu&&a!==df&&a!==Dd||(this.Rb=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K===a||a!==Da&&a!==ff&&a!==oc&&a!==Ng||(this.K=a,this.C())}},sorting:{get:function(){return this.nd},set:function(a){this.nd===a||a!==y0&&a!==S0&&a!==x0&&!P0&&a!==Dg||(this.nd=a,this.C())}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a,this.C())}},spacing:{get:function(){return this.tf},set:function(a){this.tf!==a&&(this.tf=a,this.C())}},nodeDiameterFormula:{get:function(){return this.Nn},set:function(a){this.Nn===a||a!==w0&&a!==Rc||(this.Nn=a,this.C())}},actualXRadius:{get:function(){return this.lc}},actualYRadius:{get:function(){return this.me}},actualSpacing:{get:function(){return this.Ti}},actualCenter:{get:function(){return this.Zv}}});var Pu=new me(oo,"ConstantSpacing",0),df=new me(oo,"ConstantDistance",1),Dd=new me(oo,"ConstantAngle",2),wu=new me(oo,"Packed",3),Da=new me(oo,"Clockwise",4),ff=new me(oo,"Counterclockwise",5),oc=new me(oo,"BidirectionalLeft",6),Ng=new me(oo,"BidirectionalRight",7),y0=new me(oo,"Forwards",8),S0=new me(oo,"Reverse",9),x0=new me(oo,"Ascending",10),P0=new me(oo,"Descending",11),Dg=new me(oo,"Optimized",12),w0=new me(oo,"Pythagorean",13),Rc=new me(oo,"Circular",14);oo.className="CircularLayout",oo.ConstantSpacing=Pu,oo.ConstantDistance=df,oo.ConstantAngle=Dd,oo.Packed=wu,oo.Clockwise=Da,oo.Counterclockwise=ff,oo.BidirectionalLeft=oc,oo.BidirectionalRight=Ng,oo.Forwards=y0,oo.Reverse=S0,oo.Ascending=x0,oo.Descending=P0,oo.Optimized=Dg,oo.Pythagorean=w0,oo.Circular=Rc;function zp(){this.Pl=-1/0,this.tm=this.mk=null}zp.prototype.compare=function(a,y){if(0<a&&0>this.Pl||Math.abs(a)<Math.abs(this.Pl)&&!(0>a&&0<this.Pl))for(this.Pl=a,this.mk=[],this.tm=[],a=0;a<y.length;a++)this.mk[a]=y[a].bounds.x,this.tm[a]=y[a].bounds.y},zp.prototype.commit=function(a){if(this.mk!==null&&this.tm!==null)for(var y=0;y<this.mk.length;y++){var x=a.M(y);x.x=this.mk[y],x.y=this.tm[y]}},zp.className="VertexArrangement";function Ag(a){kr.call(this,a)}le(Ag,kr),Ag.prototype.createVertex=function(){return new Gp(this)},Ag.prototype.createEdge=function(){return new C0(this)},Ag.className="CircularNetwork";function Gp(a){ns.call(this,a),this.u=this.Si=NaN}le(Gp,ns);function cf(a,y){var x=a.network;if(x===null)return NaN;if(x=x.layout,x===null)return NaN;if(x.arrangement===wu)if(x.nodeDiameterFormula===Rc)a.Si=Math.max(a.width,a.height);else{if(x=Math.abs(Math.sin(y)),y=Math.abs(Math.cos(y)),x===0)return a.width;if(y===0)return a.height;a.Si=Math.min(a.height/x,a.width/y)}else a.Si=x.nodeDiameterFormula===Rc?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Si}Oe.Object.defineProperties(Gp.prototype,{diameter:{get:function(){return this.Si},set:function(a){this.Si!==a&&(this.Si=a)}},actualAngle:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}}}),Gp.className="CircularVertex";function C0(a){vl.call(this,a)}le(C0,vl),C0.className="CircularEdge";function Ws(a){Zr.call(this),this.ah=null,this.An=0,this.$d=new Ze(100,100).freeze(),this.Bm=!1,this.sf=!0,this.td=!1,this.dl=100,this.$m=1,this.Zf=1e3,this.In=10,this.fo=Math,this.Hk=.05,this.Gk=50,this.Ek=150,this.Fk=0,this.Vm=10,this.Um=5,a&&Object.assign(this,a)}le(Ws,Zr),Ws.prototype.cloneProtected=function(a){Zr.prototype.cloneProtected.call(this,a),a.$d.assign(this.$d),a.Bm=this.Bm,a.sf=this.sf,a.td=this.td,a.dl=this.dl,a.$m=this.$m,a.Zf=this.Zf,a.In=this.In,a.fo=this.fo,a.Hk=this.Hk,a.Gk=this.Gk,a.Ek=this.Ek,a.Fk=this.Fk,a.Vm=this.Vm,a.Um=this.Um},Ws.prototype.createNetwork=function(){return new jc(this)},Ws.prototype.doLayout=function(a){if(this.network===null&&(this.network=this.makeNetwork(a)),a=this.maxIterations,0<this.network.vertexes.count){this.network.Ko();for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;x.charge=this.electricalCharge(x),x.mass=this.gravitationalMass(x)}for(y=this.network.edges.iterator;y.next();)x=y.value,x.stiffness=this.springStiffness(x),x.length=this.springLength(x);if(this.Cu(),this.An=0,this.needsClusterLayout()){y=this.network,x=y.Zx();for(var b=x.iterator;b.next();){this.network=b.value;for(var E=this.network.vertexes.iterator;E.next();){var z=E.value;z.Vd=z.vertexes.count,z.sh=1,z.Hj=null,z.We=null}RS(this,0,a)}this.network=y;var tt=b=x.iterator;b=this.arrangementSpacing;var rt=tt.count,ot=!0;z=E=0;for(var at=Kn(),ut=0;ut<rt+y.vertexes.count+2;ut++)at[ut]=null;rt=0,tt.reset();for(var ct=ye.alloc();tt.next();)if(ut=tt.value,this.computeBounds(ut,ct),ot)ot=!1,E=ct.x+ct.width/2,z=ct.y+ct.height/2,at[0]=new jt(ct.x+ct.width+b.width,ct.y),at[1]=new jt(ct.x,ct.y+ct.height+b.height),rt=2;else{var mt=jS(at,rt,E,z,ct.width,ct.height,b),yt=at[mt],St=new jt(yt.x+ct.width+b.width,yt.y),Lt=new jt(yt.x,yt.y+ct.height+b.height);for(mt+1<rt&&at.splice(mt+1,0,null),at[mt]=St,at[mt+1]=Lt,rt++,mt=yt.x-ct.x,yt=yt.y-ct.y,ut=ut.vertexes.iterator;ut.next();)St=ut.value,St.centerX+=mt,St.centerY+=yt}for(ye.free(ct),ut=y.vertexes.iterator;ut.next();)tt=ut.value,mt=tt.bounds,2>rt?(E=mt.x+mt.width/2,z=mt.y+mt.height/2,at[0]=new jt(mt.x+mt.width+b.width,mt.y),at[1]=new jt(mt.x,mt.y+mt.height+b.height),rt=2):(ot=jS(at,rt,E,z,mt.width,mt.height,b),ct=at[ot],yt=new jt(ct.x+mt.width+b.width,ct.y),mt=new jt(ct.x,ct.y+mt.height+b.height),ot+1<rt&&at.splice(ot+1,0,null),at[ot]=yt,at[ot+1]=mt,rt++,tt.centerX=ct.x+tt.width/2,tt.centerY=ct.y+tt.height/2);for(zn(at),b=x.iterator;b.next();){for(x=b.value,E=x.vertexes.iterator;E.next();)y.dh(E.value);for(x=x.edges.iterator;x.next();)y.Bo(x.value)}}GS(this,a),this.updateParts()}this.dl=a,this.network=null,this.isValidLayout=!0},Ws.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,y=0,x=this.network.vertexes.first().bounds,b=this.network.vertexes.iterator;b.next();){if(b.value.bounds.Yc(x)&&(a++,2<a))return!0;if(10<y)break;y++}return!1},Ws.prototype.computeBounds=function(a,y){var x=!0;for(a=a.vertexes.iterator;a.next();){var b=a.value;x?(x=!1,y.set(b.bounds)):y.ed(b.bounds)}return y};function RS(a,y,x){if(Bx(a,y)){var b=a.Zf;a.Zf*=1+1/(y+1);var E=Ox(a,y),z=Math.max(0,Math.max(Math.min(a.network.vertexes.count,x*(y+1)/11),10));for(a.maxIterations+=z,RS(a,y+1,x),GS(a,z),Ix(a,E),y=E.vertexes.Fa(),y.sort(function(tt,rt){return tt===null||rt===null||tt===rt?0:rt.Vd-tt.Vd}),x=0;x<y.length;x++)Rx(a,y[x]);a.Zf=b}}function Bx(a,y){if(10<y||3>a.network.vertexes.count)return!1;for(a.ah=a.network.vertexes.Fa(),a=a.ah,a.sort(function(x,b){return x===null||b===null||x===b?0:b.Vd-x.Vd}),y=a.length-1;0<=y&&1>=a[y].Vd;)y--;return 1<a.length-y}function Ox(a,y){for(var x=a.network,b=new jc(a),E=0;E<a.ah.length;E++){var z=a.ah[E];if(1<z.Vd){b.dh(z);var tt=new _S;tt.Rs=z.Vd,tt.Ss=z.width,tt.Qs=z.height,tt.Sv=z.focus.x,tt.Tv=z.focus.y,z.We===null&&(z.We=new Ve),z.We.add(tt),z.sv=z.We.count-1}else break}for(z=x.edges.iterator;z.next();){var rt=z.value;E=rt.fromVertex,tt=rt.toVertex,E.network===b&&tt.network===b?b.Bo(rt):E.network===b?(rt=E.Hj,rt===null&&(rt=new Ve,E.Hj=rt),rt.add(tt),E.Vd--,E.sh+=tt.sh):tt.network===b&&(rt=tt.Hj,rt===null&&(rt=new Ve,tt.Hj=rt),rt.add(E),tt.Vd--,tt.sh+=E.sh)}for(E=b.edges.iterator;E.next();)z=E.value,z.length*=Math.max(1,ne.sqrt((z.fromVertex.sh+z.toVertex.sh)/(4*y+1)));for(y=b.vertexes.iterator;y.next();){E=y.value;var ot=E.Hj;if(ot!==null&&0<ot.count&&(tt=E.We.M(E.We.count-1).Rs-E.Vd,!(0>=tt))){for(var at=rt=0,ut=ot.count-tt;ut<ot.count;ut++){var ct=ot.M(ut),mt=null;for(z=ct.edges.iterator;z.next();){var yt=z.value;if(yt.Ax(ct)===E){mt=yt;break}}mt!==null&&(at+=mt.length,rt+=ct.width*ct.height)}z=E.centerX,ot=E.centerY,ut=E.width,ct=E.height,mt=E.focus,yt=ut*ct,1>yt&&(yt=1),rt=ne.sqrt((rt+yt+at*at*4/(tt*tt))/yt),tt=(rt-1)*ut/2,rt=(rt-1)*ct/2,E.bounds=new ye(z-mt.x-tt,ot-mt.y-rt,ut+2*tt,ct+2*rt),E.focus=new jt(mt.x+tt,mt.y+rt)}}return a.network=b,x}function Ix(a,y){for(var x=a.network.vertexes.iterator;x.next();){var b=x.value;if(b.network=y,b.We!==null){var E=b.We.M(b.sv);b.Vd=E.Rs;var z=E.Sv,tt=E.Tv;b.bounds=new ye(b.centerX-z,b.centerY-tt,E.Ss,E.Qs),b.focus=new jt(z,tt),b.sv--}}for(x=a.network.edges.iterator;x.next();)x.value.network=y;a.network=y}function Rx(a,y){var x=y.Hj;if(x!==null&&x.count!==0){var b=y.centerX,E=y.centerY,z=y.width,tt=y.height;y.We!==null&&0<y.We.count&&(tt=y.We.M(0),z=tt.Ss,tt=tt.Qs),z=ne.sqrt(z*z+tt*tt)/2;for(var rt=!1,ot=tt=0,at=0,ut=y.vertexes.iterator;ut.next();){var ct=ut.value;1>=ct.Vd?ot++:(rt=!0,at++,tt+=Math.atan2(y.centerY-ct.centerY,y.centerX-ct.centerX))}if(ot!==0){for(0<at&&(tt/=at),at=y=0,y=rt?2*Math.PI/(ot+1):2*Math.PI/ot,ot%2===0&&(at=y/2),1<x.count&&x.sort(function(yt,St){return yt===null||St===null||yt===St?0:St.width*St.height-yt.width*yt.height}),rt=ot%2===0?0:1,x=x.iterator;x.next();)if(ot=x.value,!(1<ot.Vd||a.isFixed(ot))){for(ut=null,ct=ot.edges.iterator;ct.next();){ut=ct.value;break}ct=ot.width;var mt=ot.height;ct=ne.sqrt(ct*ct+mt*mt)/2,ut=z+ut.length+ct,ct=tt+(y*(rt/2>>1)+at)*(rt%2===0?1:-1),ot.centerX=b+ut*Math.cos(ct),ot.centerY=E+ut*Math.sin(ct),rt++}}}}function jS(a,y,x,b,E,z,tt){var rt=9e19,ot=-1,at=0;t:for(;at<y;at++){var ut=a[at],ct=ut.x-x,mt=ut.y-b;if(ct=ct*ct+mt*mt,ct<rt){for(mt=at-1;0<=mt;mt--)if(a[mt].y>ut.y&&a[mt].x-ut.x<E+tt.width)continue t;for(mt=at+1;mt<y;mt++)if(a[mt].x>ut.x&&a[mt].y-ut.y<z+tt.height)continue t;ot=at,rt=ct}}return ot}Ws.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},Ws.prototype.addComments=function(a){var y=a.node;if(y!==null)for(y=y.Mu();y.next();){var x=y.value;if(x.category==="Comment"&&x.isVisible()){var b=this.network.ki(x);b===null&&(b=this.network.Bl(x)),b.charge=this.defaultCommentElectricalCharge,x=null;for(var E=b.destinationEdges;E.next();){var z=E.value;if(z.toVertex===a){x=z;break}}if(x===null){for(E=b.sourceEdges;E.next();)if(z=E.value,z.fromVertex===a){x=z;break}}x===null&&(x=this.network.Zj(a,b,null)),x.length=this.defaultCommentSpringLength}}};function zS(a,y){var x=a.bounds,b=x.x;a=x.y;var E=x.width;x=x.height;var z=y.bounds,tt=z.x;y=z.y;var rt=z.width;return z=z.height,b+E<tt?a>y+z?(x=b+E-tt,a=a-y-z,ne.sqrt(x*x+a*a)):a+x<y?(b=b+E-tt,a=a+x-y,ne.sqrt(b*b+a*a)):tt-(b+E):b>tt+rt?a>y+z?(x=b-tt-rt,a=a-y-z,ne.sqrt(x*x+a*a)):a+x<y?(b=b-tt-rt,a=a+x-y,ne.sqrt(b*b+a*a)):b-(tt+rt):a>y+z?a-(y+z):a+x<y?y-(a+x):.1}function GS(a,y){for(a.ah=null,y=a.An+y;a.An<y&&(a.An++,jx(a)););a.ah=null}function jx(a){a.ah===null&&(a.ah=a.network.vertexes.Fa());var y=a.ah;if(0>=y.length)return!1;var x=y[0];x.forceX=0,x.forceY=0;for(var b=x.centerX,E=b,z=x=x.centerY,tt=1;tt<y.length;tt++){var rt=y[tt];rt.forceX=0,rt.forceY=0;var ot=rt.centerX;rt=rt.centerY,b=Math.min(b,ot),E=Math.max(E,ot),x=Math.min(x,rt),z=Math.max(z,rt)}(E=E-b>z-x)?y.sort(function(Lt,Ot){return Lt===null||Ot===null||Lt===Ot?0:Lt.centerX-Ot.centerX}):y.sort(function(Lt,Ot){return Lt===null||Ot===null||Lt===Ot?0:Lt.centerY-Ot.centerY}),x=a.Zf;var at=b=rt=0;for(z=0;z<y.length;z++){tt=y[z],b=tt.bounds,rt=tt.focus,ot=b.x+rt.x;var ut=b.y+rt.y;b=tt.charge*a.electricalFieldX(ot,ut),at=tt.charge*a.electricalFieldY(ot,ut),b+=tt.mass*a.gravitationalFieldX(ot,ut),at+=tt.mass*a.gravitationalFieldY(ot,ut),tt.forceX+=b,tt.forceY+=at;for(var ct=z+1;ct<y.length;ct++){var mt=y[ct];if(mt!==tt){b=mt.bounds,rt=mt.focus,at=b.x+rt.x;var yt=b.y+rt.y;if(ot-at>x||at-ot>x){if(E)break}else if(ut-yt>x||yt-ut>x){if(!E)break}else{var St=zS(tt,mt);1>St?(b=a.randomNumberGenerator,b===null&&(a.randomNumberGenerator=b=new L0),St=b.random(),rt=b.random(),ot>at?(b=Math.abs(mt.bounds.right-tt.bounds.x),b=(1+b)*St):ot<at?(b=Math.abs(mt.bounds.x-tt.bounds.right),b=-(1+b)*St):(b=Math.max(mt.width,tt.width),b=(1+b)*St-b/2),ut>yt?(at=Math.abs(mt.bounds.bottom-tt.bounds.y),at=(1+at)*rt):ot<at?(at=Math.abs(mt.bounds.y-tt.bounds.bottom),at=-(1+at)*rt):(at=Math.max(mt.height,tt.height),at=(1+at)*rt-at/2)):(rt=-(tt.charge*mt.charge)/(St*St),b=(at-ot)/St*rt,at=(yt-ut)/St*rt),tt.forceX+=b,tt.forceY+=at,mt.forceX-=b,mt.forceY-=at}}}}for(E=a.network.edges.iterator;E.next();)rt=E.value,x=rt.fromVertex,z=rt.toVertex,tt=x.bounds,ot=x.focus,b=tt.x+ot.x,tt=tt.y+ot.y,ut=z.bounds,ct=z.focus,ot=ut.x+ct.x,ut=ut.y+ct.y,ct=zS(x,z),1>ct?(ct=a.randomNumberGenerator,ct===null&&(a.randomNumberGenerator=ct=new L0),rt=ct.random(),ct=ct.random(),b=(b>ot?1:-1)*(1+(z.width>x.width?z.width:x.width))*rt,at=(tt>ut?1:-1)*(1+(z.height>x.height?z.height:x.height))*ct):(rt=rt.stiffness*(ct-rt.length),b=(ot-b)/ct*rt,at=(ut-tt)/ct*rt),x.forceX+=b,x.forceY+=at,z.forceX-=b,z.forceY-=at;for(E=b=0;E<y.length;E++)x=y[E],a.isFixed(x)?a.moveFixedVertex(x):b=Math.max(b,a.moveVertex(x)||0);return b>a.epsilonDistance*a.epsilonDistance}Ws.prototype.moveVertex=function(a){var y=a.forceX,x=a.forceY,b=this.moveLimit;return y<-b?y=-b:y>b&&(y=b),x<-b?x=-b:x>b&&(x=b),a.centerX+=y,a.centerY+=x,y*y+x*x},Ws.prototype.moveFixedVertex=function(){},Ws.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.isRouting&&this.commitLinks()},Ws.prototype.yv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var y=a.value.link;y!==null&&(y.fromSpot=vs,y.toSpot=vs)}},Ws.prototype.commitNodes=function(){var a=0,y=0;if(this.arrangesToOrigin){var x=ye.alloc();this.computeBounds(this.network,x),y=this.arrangementOrigin,a=y.x-x.x,y=y.y-x.y,ye.free(x)}x=ye.alloc();for(var b=this.network.vertexes.iterator;b.next();){var E=b.value;(a!==0||y!==0)&&(x.assign(E.bounds),x.x+=a,x.y+=y,E.bounds=x),E.commit()}ye.free(x)},Ws.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},Ws.prototype.springStiffness=function(a){return a=a.stiffness,isNaN(a)?this.Hk:a},Ws.prototype.springLength=function(a){return a=a.length,isNaN(a)?this.Gk:a},Ws.prototype.electricalCharge=function(a){return a=a.charge,isNaN(a)?this.Ek:a},Ws.prototype.electricalFieldX=function(){return 0},Ws.prototype.electricalFieldY=function(){return 0},Ws.prototype.gravitationalMass=function(a){return a=a.mass,isNaN(a)?this.Fk:a},Ws.prototype.gravitationalFieldX=function(){return 0},Ws.prototype.gravitationalFieldY=function(){return 0},Ws.prototype.isFixed=function(a){return a.isFixed},Oe.Object.defineProperties(Ws.prototype,{currentIteration:{get:function(){return this.An}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},arrangesToOrigin:{get:function(){return this.Bm},set:function(a){this.Bm!==a&&(this.Bm=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},maxIterations:{get:function(){return this.dl},set:function(a){this.dl!==a&&0<=a&&(this.dl=a,this.C())}},epsilonDistance:{get:function(){return this.$m},set:function(a){this.$m!==a&&0<a&&(this.$m=a,this.C())}},infinityDistance:{get:function(){return this.Zf},set:function(a){this.Zf!==a&&1<a&&(this.Zf=a,this.C())}},moveLimit:{get:function(){return this.In},set:function(a){this.In!==a&&1<a&&(this.In=a,this.C())}},randomNumberGenerator:{get:function(){return this.fo},set:function(a){this.fo!==a&&(a!==null&&typeof a.random!="function"&&fe('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.fo=a)}},defaultSpringStiffness:{get:function(){return this.Hk},set:function(a){this.Hk!==a&&(this.Hk=a,this.C())}},defaultSpringLength:{get:function(){return this.Gk},set:function(a){this.Gk!==a&&(this.Gk=a,this.C())}},defaultElectricalCharge:{get:function(){return this.Ek},set:function(a){this.Ek!==a&&(this.Ek=a,this.C())}},defaultGravitationalMass:{get:function(){return this.Fk},set:function(a){this.Fk!==a&&(this.Fk=a,this.C())}},defaultCommentSpringLength:{get:function(){return this.Vm},set:function(a){this.Vm!==a&&(this.Vm=a,this.C())}},defaultCommentElectricalCharge:{get:function(){return this.Um},set:function(a){this.Um!==a&&(this.Um=a,this.C())}}}),Ws.className="ForceDirectedLayout";function _S(){this.Tv=this.Sv=this.Qs=this.Ss=this.Rs=0}_S.className="ForceDirectedSubnet";function jc(a){kr.call(this,a)}le(jc,kr),jc.prototype.createVertex=function(){return new _p(this)},jc.prototype.createEdge=function(){return new Hp(this)},jc.className="ForceDirectedNetwork";function _p(a){ns.call(this,a),this.ia=!1,this.Ha=this.u=NaN,this.sh=this.Vd=this.V=this.F=0,this.We=this.Hj=null,this.sv=0}le(_p,ns),Oe.Object.defineProperties(_p.prototype,{isFixed:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},charge:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},mass:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},forceX:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},forceY:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}}}),_p.className="ForceDirectedVertex";function Hp(a){vl.call(this,a),this.j=this.o=NaN}le(Hp,vl),Oe.Object.defineProperties(Hp.prototype,{stiffness:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},length:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}}}),Hp.className="ForceDirectedEdge";function L0(){var a=0;a===void 0&&(a=42),this.seed=a,this.ay=48271,this.ey=2147483647,this.Q=44488.07041494893,this.gy=3399,this.by=1/2147483647,this.random()}L0.prototype.random=function(){var a=this.seed%this.Q*this.ay-this.seed/this.Q*this.gy;return 0<a?this.seed=a:this.seed=a+this.ey,this.seed*this.by},L0.className="RandomNumberGenerator";function or(a){Zr.call(this),this.kc=this.ie=25,this.K=0,this.Dk=F0,this.Zk=T0,this.Qk=N0,this.bj=4,this.rk=D0,this.bg=15,this.sf=!0,this.Cn=4,this.Ra=this.Iq=this.Ia=-1,this.Md=this.Hn=0,this.Ta=this.Kd=this.Ld=this.he=this.tc=null,this.Kn=0,this.Jn=this.kj=null,this.le=0,this.fl=null,this.Rf=new jt,this.He=[],this.He.length=100,this.xw=this.ve=0,a&&Object.assign(this,a)}le(or,Zr),or.prototype.cloneProtected=function(a){Zr.prototype.cloneProtected.call(this,a),a.ie=this.ie,a.kc=this.kc,a.K=this.K,a.Dk=this.Dk,a.Zk=this.Zk,a.Qk=this.Qk,a.bj=this.bj,a.rk=this.rk,a.bg=this.bg,a.sf=this.sf,a.Cn=this.Cn,a.ve=this.ve},or.prototype.qb=function(a){a.classType===or?a.name.indexOf("Aggressive")===0?this.aggressiveOption=a:a.name.indexOf("Cycle")===0?this.cycleRemoveOption=a:a.name.indexOf("Init")===0?this.initializeOption=a:a.name.indexOf("Layer")===0?this.layeringOption=a:fe("Unknown enum value: "+a):Zr.prototype.qb.call(this,a)},or.prototype.createNetwork=function(){return new Og(this)},or.prototype.doLayout=function(a){for(this.network===null&&(this.network=this.makeNetwork(a)),this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin),this.Iq=-1,this.Md=this.Hn=0,this.fl=this.Jn=this.kj=null,a=0;a<this.He.length;a++)this.He[a]=null;if(0<this.network.vertexes.count){for(this.network.Ko(),this.cycleRemoveOption!==Wp&&this.removeCycles(),a=this.network.vertexes.iterator;a.next();)a.value.layer=-1;for(this.Ia=-1,this.assignLayers(),a.reset();a.next();)this.Ia=Math.max(this.Ia,a.value.layer);this.cycleRemoveOption===Wp&&this.removeCycles(),a=this.network;for(var y=[],x=a.edges.iterator;x.next();){var b=x.value;b.valid=!1,y.push(b)}for(x=0;x<y.length;x++){b=y[x];var E=b.fromVertex,z=b.toVertex;if(!(b.valid||(E.node===null&&E.data===null||z.node===null&&z.data===null)&&E.layer===z.layer)){var tt=0,rt=0,ot=0,at=0;if(b.link!==null){if(rt=b.link,rt===null)continue;var ut=E.node;if(tt=z.node,ut===null||tt===null)continue;var ct=rt.fromNode;ot=rt.toNode;for(var mt=rt.fromPort;mt!==null&&!mt.Ed();)mt=mt.panel;for(rt=rt.toPort;rt!==null&&!rt.Ed();)rt=rt.panel;if(b.rev){at=ct;var yt=mt;ct=ot,mt=rt,ot=at,rt=yt}var St=E.focus;at=z.focus;var Lt=b.rev?z.bounds:E.bounds;yt=jt.alloc(),ut!==ct?Lt.w()&&ct.isVisible()?ct.actualBounds.w()?(bd(ct,mt,Xi,yt),yt.x+=ct.actualBounds.x-Lt.x,yt.y+=ct.actualBounds.y-Lt.y):(bd(ct,mt,Xi,yt),yt.w()||yt.assign(St)):yt.assign(St):Lt.w()?(bd(ct,mt,Xi,yt),yt.w()||yt.assign(St)):yt.assign(St),ct=b.rev?E.bounds:z.bounds,ut=jt.alloc(),tt!==ot?ct.w()&&ot.isVisible()?ot.actualBounds.w()?(bd(ot,rt,Xi,ut),ut.x+=ot.actualBounds.x-ct.x,ut.y+=ot.actualBounds.y-ct.y):(bd(ot,rt,Xi,ut),ut.w()||ut.assign(at)):ut.assign(at):ct.w()?(bd(ot,rt,Xi,ut),ut.w()||ut.assign(at)):ut.assign(at),this.K===90||this.K===270?(tt=Math.round((yt.x-St.x)/this.kc),ot=yt.x,rt=Math.round((ut.x-at.x)/this.kc),at=ut.x):(tt=Math.round((yt.y-St.y)/this.kc),ot=yt.y,rt=Math.round((ut.y-at.y)/this.kc),at=ut.y),jt.free(yt),jt.free(ut),b.portFromColOffset=tt,b.portFromPos=ot,b.portToColOffset=rt,b.portToPos=at}else b.portFromColOffset=0,b.portFromPos=0,b.portToColOffset=0,b.portToPos=0;if(yt=E.layer,ut=z.layer,ct=0,Lt=b.link,Lt!==null){var Ot=Lt.fromPort,Dt=Lt.toPort;if(Ot!==null&&Dt!==null){var Gt=Lt.fromNode;if(mt=Lt.toNode,Gt!==null&&mt!==null){var Vt=E0(this,!0),Yt=E0(this,!1),qt=this.setsPortSpots?Vt:Lt.computeSpot(!0,Ot);St=this.setsPortSpots?Yt:Lt.computeSpot(!1,Dt);var ae=Lt.isOrthogonal;qt.$c()&&qt.Hf(Yt)&&St.$c()&&St.Hf(Vt)?ct=0:(Vt=Lt.getLinkPoint(Gt,Ot,qt,!0,ae,mt,Dt,jt.alloc()),Yt=Lt.getLinkDirection(Gt,Ot,Vt,qt,!0,ae,mt,Dt),jt.free(Vt),qt.ys()||Yt!==JS(this,b,!0)?this.setsPortSpots&&Gt!==null&&Gt.ports.count===1&&b.rev&&(ct+=1):ct+=1,qt=Lt.getLinkPoint(mt,Dt,St,!1,ae,Gt,Ot,jt.alloc()),Lt=Lt.getLinkDirection(mt,Dt,qt,St,!1,ae,Gt,Ot),jt.free(qt),St.ys()||Lt!==JS(this,b,!1)?this.setsPortSpots&&mt!==null&&mt.ports.count===1&&b.rev&&(ct+=2):ct+=2)}}}if(mt=ct,ct=mt===1||mt===3,(mt=mt===2||mt===3)&&(St=a.createVertex(),St.node=null,St.Dj=1,St.layer=yt,St.near=E,a.dh(St),E=a.Zj(E,St,b.link),E.valid=!1,E.rev=b.rev,E.portFromColOffset=tt,E.portToColOffset=0,E.portFromPos=ot,E.portToPos=0,E=St),Lt=1,ct&&Lt--,yt-ut>Lt&&0<yt){for(b.valid=!1,St=a.createVertex(),St.node=null,St.Dj=2,St.layer=yt-1,a.dh(St),E=a.Zj(E,St,b.link),E.valid=!0,E.rev=b.rev,E.portFromColOffset=mt?0:tt,E.portToColOffset=0,E.portFromPos=mt?0:ot,E.portToPos=0,E=St,yt--;yt-ut>Lt&&0<yt;)St=a.createVertex(),St.node=null,St.Dj=3,St.layer=yt-1,a.dh(St),E=a.Zj(E,St,b.link),E.valid=!0,E.rev=b.rev,E.portFromColOffset=0,E.portToColOffset=0,E.portFromPos=0,E.portToPos=0,E=St,yt--;E=a.Zj(St,z,b.link),E.valid=!ct,ct&&(St.near=z),E.rev=b.rev,E.portFromColOffset=0,E.portToColOffset=rt,E.portFromPos=0,E.portToPos=at}else b.valid=!0}}for(a=this.tc=[],y=0;y<=this.Ia;y++)a[y]=0;for(y=this.network.vertexes.iterator;y.next();)y.value.index=-1;for(this.initializeIndices(),this.Iq=-1,x=this.Md=this.Hn=0;x<=this.Ia;x++)a[x]>a[this.Md]&&(this.Iq=a[x]-1,this.Md=x),a[x]<a[this.Hn]&&(this.Hn=x);for(this.fl=[],x=0;x<a.length;x++)this.fl[x]=[];for(y.reset();y.next();)a=y.value,this.fl[a.layer][a.index]=a;for(this.Ra=-1,a=0;a<=this.Ia;a++){for(y=gf(this,a),x=0,b=this.tc[a],z=0;z<b;z++)E=y[z],x+=this.nodeMinColumnSpace(E,!0),E.column=x,x+=1,x+=this.nodeMinColumnSpace(E,!1);this.Ra=Math.max(this.Ra,x-1),pf(this,a,y)}this.reduceCrossings(),this.straightenAndPack(),this.updateParts()}this.network=null,this.isValidLayout=!0},or.prototype.linkMinLength=function(){return 1};function gy(a){var y=a.fromVertex.node||a.fromVertex.data;return a=a.toVertex.node||a.toVertex.data,y===null&&a===null?8:y===null||a===null?4:1}or.prototype.nodeMinLayerSpace=function(a,y){return a.node===null&&a.data===null?0:this.K===90||this.K===270?y?a.focus.y+10:a.bounds.height-a.focus.y+10:y?a.focus.x+10:a.bounds.width-a.focus.x+10},or.prototype.nodeMinColumnSpace=function(a,y){if(a.node===null&&a.data===null)return 0;var x=y?a.ev:a.dv;return x!==null?x:(x=this.K,x===90||x===270?y?a.ev=a.focus.x/this.kc+1|0:a.dv=(a.bounds.width-a.focus.x)/this.kc+1|0:y?a.ev=a.focus.y/this.kc+1|0:a.dv=(a.bounds.height-a.focus.y)/this.kc+1|0)};function Xa(a){a.kj===null&&(a.kj=[]);for(var y=0,x=a.network.vertexes.iterator;x.next();){var b=x.value;a.kj[y]=b.layer,y++,a.kj[y]=b.column,y++,a.kj[y]=b.index,y++}return a.kj}function Ul(a,y){var x=0;for(a=a.network.vertexes.iterator;a.next();){var b=a.value;b.layer=y[x],x++,b.column=y[x],x++,b.index=y[x],x++}}function HS(a,y,x){var b=gf(a,y),E=a.tc[y];(a.Jn===null||a.Jn.length<E*E)&&(a.Jn=[]);for(var z=a.Jn,tt=0;tt<E;tt++){var rt=0,ot=b[tt],at=ot.near;if(at!==null&&at.layer===ot.layer)if(ot=at.index,ot>tt)for(var ut=tt+1;ut<ot;ut++){var ct=b[ut];ct.near===at&&ct.Dj===at.Dj||rt++}else for(ut=tt-1;ut>ot;ut--)ct=b[ut],ct.near===at&&ct.Dj===at.Dj||rt++;var mt;if(0<=x)for(ot=b[tt].sourceEdgesArrayAccess,at=0;at<ot.length;at++){var yt=ot[at];if(yt.valid&&yt.fromVertex.layer!==y)for(ct=yt.fromVertex.index,ut=yt.portToPos,yt=yt.portFromPos,mt=at+1;mt<ot.length;mt++){var St=ot[mt];if(St.valid&&St.fromVertex.layer!==y){var Lt=St.fromVertex.index,Ot=St.portToPos;St=St.portFromPos,ut<Ot&&(ct>Lt||ct===Lt&&yt>St)&&rt++,Ot<ut&&(Lt>ct||Lt===ct&&St>yt)&&rt++}}}if(0>=x){for(ot=b[tt].destinationEdgesArrayAccess,at=0;at<ot.length;at++)if(yt=ot[at],yt.valid&&yt.toVertex.layer!==y)for(ct=yt.toVertex.index,ut=yt.portToPos,yt=yt.portFromPos,mt=at+1;mt<ot.length;mt++)St=ot[mt],St.valid&&St.toVertex.layer!==y&&(Lt=St.toVertex.index,Ot=St.portToPos,St=St.portFromPos,yt<St&&(ct>Lt||ct===Lt&&ut>Ot)&&rt++,St<yt&&(Lt>ct||Lt===ct&&Ot>ut)&&rt++)}for(z[tt*E+tt]=rt,ot=tt+1;ot<E;ot++){var Dt=0,Gt=0;if(0<=x){rt=b[tt].sourceEdgesArrayAccess;var Vt=b[ot].sourceEdgesArrayAccess;for(at=0;at<rt.length;at++)if(yt=rt[at],yt.valid&&yt.fromVertex.layer!==y)for(ct=yt.fromVertex.index,yt=yt.portFromPos,mt=0;mt<Vt.length;mt++)St=Vt[mt],St.valid&&St.fromVertex.layer!==y&&(Lt=St.fromVertex.index,St=St.portFromPos,(ct<Lt||ct===Lt&&yt<St)&&Gt++,(Lt<ct||Lt===ct&&St<yt)&&Dt++)}if(0>=x){for(rt=b[tt].destinationEdgesArrayAccess,Vt=b[ot].destinationEdgesArrayAccess,at=0;at<rt.length;at++)if(yt=rt[at],yt.valid&&yt.toVertex.layer!==y)for(ct=yt.toVertex.index,ut=yt.portToPos,mt=0;mt<Vt.length;mt++)St=Vt[mt],St.valid&&St.toVertex.layer!==y&&(Lt=St.toVertex.index,Ot=St.portToPos,(ct<Lt||ct===Lt&&ut<Ot)&&Gt++,(Lt<ct||Lt===ct&&Ot<ut)&&Dt++)}z[tt*E+ot]=Dt,z[ot*E+tt]=Gt}}return pf(a,y,b),z}or.prototype.countCrossings=function(){for(var a=0,y=0;y<=this.Ia;y++)for(var x=HS(this,y,1),b=this.tc[y],E=0;E<b;E++)for(var z=E;z<b;z++)a+=x[E*b+z];return a};function M0(a){for(var y=0,x=0;x<=a.Ia;x++){for(var b=a,E=x,z=gf(b,E),tt=b.tc[E],rt=0,ot=0;ot<tt;ot++){var at=z[ot].destinationEdgesArrayAccess;if(at!==null)for(var ut=0;ut<at.length;ut++){var ct=at[ut];if(ct.valid&&ct.toVertex.layer!==E){var mt=ct.fromVertex.column+ct.portFromColOffset,yt=ct.toVertex.column+ct.portToColOffset;rt+=(Math.abs(mt-yt)+1)*gy(ct)}}}pf(b,E,z),y+=rt}return y}or.prototype.normalize=function(){var a=1/0;this.Ra=-1;for(var y=this.network.vertexes.iterator;y.next();){var x=y.value;a=Math.min(a,x.column-this.nodeMinColumnSpace(x,!0)),this.Ra=Math.max(this.Ra,x.column+this.nodeMinColumnSpace(x,!1))}for(y.reset();y.next();)y.value.column-=a;this.Ra-=a};function py(a,y,x){for(var b=gf(a,y),E=a.tc[y],z=[],tt=0;tt<E;tt++){var rt=b[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var at=null;0<=x&&(at=rt.destinationEdgesArrayAccess);var ut=0,ct=0,mt=rt.near;if(mt!==null&&mt.layer===rt.layer&&(ut+=mt.column-1,ct++),ot!==null)for(mt=0;mt<ot.length;mt++){rt=ot[mt];var yt=rt.fromVertex;rt.valid&&!rt.rev&&yt.layer!==y&&(ut+=yt.column,ct++)}if(at!==null)for(ot=0;ot<at.length;ot++)rt=at[ot],mt=rt.toVertex,rt.valid&&!rt.rev&&mt.layer!==y&&(ut+=mt.column,ct++);z[tt]=ct===0?-1:ut/ct}return pf(a,y,b),z}function VS(a,y,x){for(var b=gf(a,y),E=a.tc[y],z=[],tt=0;tt<E;tt++){var rt=b[tt],ot=null;0>=x&&(ot=rt.sourceEdgesArrayAccess);var at=null;0<=x&&(at=rt.destinationEdgesArrayAccess);var ut=0,ct=[],mt=rt.near;if(mt!==null&&mt.layer===rt.layer&&(ct[ut]=mt.column-1,ut++),rt=void 0,ot!==null)for(mt=0;mt<ot.length;mt++){rt=ot[mt];var yt=rt.fromVertex;rt.valid&&!rt.rev&&yt.layer!==y&&(ct[ut]=yt.column+rt.portFromColOffset,ut++)}if(at!==null)for(ot=0;ot<at.length;ot++)rt=at[ot],mt=rt.toVertex,rt.valid&&!rt.rev&&mt.layer!==y&&(ct[ut]=mt.column+rt.portToColOffset,ut++);ut===0?z[tt]=-1:(ct.sort(function(St,Lt){return St-Lt}),at=ut>>1,z[tt]=ut&1?ct[at]:ct[at-1]+ct[at]>>1)}return pf(a,y,b),z}function Vp(a,y,x,b,E,z){if(y.component===b){if(y.component=x,E)for(var tt=y.destinationEdges;tt.next();){var rt=tt.value,ot=rt.toVertex,at=y.layer-ot.layer;rt=a.linkMinLength(rt),at===rt&&Vp(a,ot,x,b,E,z)}if(z)for(tt=y.sourceEdges;tt.next();)rt=tt.value,ot=rt.fromVertex,at=ot.layer-y.layer,rt=a.linkMinLength(rt),at===rt&&Vp(a,ot,x,b,E,z)}}function my(a,y,x,b,E,z){if(y.component===b){if(y.component=x,E)for(var tt=y.destinationEdges;tt.next();)my(a,tt.value.toVertex,x,b,E,z);if(z)for(y=y.sourceEdges;y.next();)my(a,y.value.fromVertex,x,b,E,z)}}or.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Dk){default:case Sy:a=this.network;var y=0,x=a.vertexes.count-1,b=[];b.length=x+1;for(var E=a.vertexes.iterator;E.next();)E.value.valid=!0;for(;zx(a)!==null;){for(E=WS(a);E!==null;)b[x]=E,x--,E.valid=!1,E=WS(a);for(E=US(a);E!==null;)b[y]=E,y++,E.valid=!1,E=US(a);E=null;for(var z=0,tt=this.network.vertexes.iterator;tt.next();){var rt=tt.value;if(rt.valid){for(var ot=0,at=rt.destinationEdges;at.next();)at.value.toVertex.valid&&ot++;at=0;for(var ut=rt.sourceEdges;ut.next();)ut.value.fromVertex.valid&&at++;(E===null||z<ot-at)&&(E=rt,z=ot-at)}}E!==null&&(b[y]=E,y++,E.valid=!1)}for(y=0;y<a.vertexes.count;y++)b[y].index=y;for(b=a.edges.iterator;b.next();)y=b.value,y.fromVertex.index>y.toVertex.index&&(a.gm(y),y.rev=!0);break;case F0:for(b=this.network.vertexes.iterator;b.next();)a=b.value,a.Ll=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;for(this.Kn=0,b.reset();b.next();)y=b.value,y.sourceEdges.count===0&&vy(this,y);for(b.reset();b.next();)y=b.value,y.Ll===-1&&vy(this,y);for(a.reset();a.next();)b=a.value,b.forest||(y=b.fromVertex,x=y.finish,E=b.toVertex,z=E.finish,E.Ll<y.Ll&&x<z&&(this.network.gm(b),b.rev=!0));break;case Wp:for(a=this.network,y=a.vertexes.iterator,b=1/0;y.next();)b=Math.min(b,y.value.layer);if(1/0>b){if(0>b)for(y.reset();y.next();)y.value.layer-=b;for(b=[],y.reset();y.next();)x=y.value,E=b[x.layer],E===void 0?b[x.layer]=[x]:E.push(x);for(x=y=0;x<b.length;x++)if(E=b[x],!E||E.length===0)y++;else if(0<x)for(z=0;z<E.length;z++)E[z].layer-=y;for(b=a.edges.iterator;b.next();)y=b.value,y.fromVertex.layer<y.toVertex.layer&&(a.gm(y),y.rev=!0)}}};function zx(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid)return y}return null}function WS(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,b=y.destinationEdges;b.next();)if(b.value.toVertex.valid){x=!1;break}if(x)return y}}return null}function US(a){for(a=a.vertexes.iterator;a.next();){var y=a.value;if(y.valid){for(var x=!0,b=y.sourceEdges;b.next();)if(b.value.fromVertex.valid){x=!1;break}if(x)return y}}return null}function vy(a,y){y.Ll=a.Kn,a.Kn++;for(var x=y.destinationEdges;x.next();){var b=x.value,E=b.toVertex;E.Ll===-1&&(b.forest=!0,vy(a,E))}y.finish=a.Kn,a.Kn++}or.prototype.assignLayers=function(){switch(this.Zk){case xy:KS(this);break;case Py:for(var a,y=this.network.vertexes.iterator;y.next();)a=XS(this,y.value),this.Ia=Math.max(a,this.Ia);for(y.reset();y.next();)a=y.value,a.layer=this.Ia-a.layer;break;default:case T0:for(KS(this),y=this.network.vertexes.iterator;y.next();)y.value.valid=!1;for(y.reset();y.next();)a=y.value,a.sourceEdges.count===0&&ZS(this,a);for(a=1/0,y.reset();y.next();)a=Math.min(a,y.value.layer);for(this.Ia=-1,y.reset();y.next();){var x=y.value;x.layer-=a,this.Ia=Math.max(this.Ia,x.layer)}}};function KS(a){for(var y=a.network.vertexes.iterator;y.next();){var x=YS(a,y.value);a.Ia=Math.max(x,a.Ia)}}function YS(a,y){var x=0;if(y.layer===-1){for(var b=y.destinationEdges;b.next();){var E=b.value,z=E.toVertex;E=a.linkMinLength(E),x=Math.max(x,YS(a,z)+E)}y.layer=x}else x=y.layer;return x}function XS(a,y){var x=0;if(y.layer===-1){for(var b=y.sourceEdges;b.next();){var E=b.value,z=E.fromVertex;E=a.linkMinLength(E),x=Math.max(x,XS(a,z)+E)}y.layer=x}else x=y.layer;return x}function ZS(a,y){if(!y.valid){y.valid=!0;for(var x=y.destinationEdges;x.next();)ZS(a,x.value.toVertex);for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(var b=y.sourceEdgesArrayAccess,E=b.length,z=0;z<E;z++){var tt=b[z],rt=tt.fromVertex,ot=tt.toVertex;tt=a.linkMinLength(tt),rt.layer-ot.layer>tt&&Vp(a,rt,0,-1,!0,!1)}for(Vp(a,y,1,-1,!0,!0);y.component!==0;){for(z=0,b=1/0,rt=0,ot=null,tt=a.network.vertexes.iterator;tt.next();){var at=tt.value;if(at.component===1){var ut=0,ct=!1,mt=at.sourceEdgesArrayAccess;E=mt.length;for(var yt=0;yt<E;yt++){var St=mt[yt],Lt=St.fromVertex;ut+=1,Lt.component!==1&&(z+=1,Lt=Lt.layer-at.layer,St=a.linkMinLength(St),b=Math.min(b,Lt-St))}for(mt=at.destinationEdgesArrayAccess,E=mt.length,yt=0;yt<E;yt++)St=mt[yt].toVertex,--ut,St.component!==1?--z:ct=!0;(ot===null||ut<rt)&&!ct&&(ot=at,rt=ut)}}if(0<z){for(x.reset();x.next();)E=x.value,E.component===1&&(E.layer+=b);y.component=0}else ot.component=0}for(x=a.network.vertexes.iterator;x.next();)x.value.component=-1;for(Vp(a,y,1,-1,!0,!1);y.component!==0;){for(b=0,E=1/0,z=0,rt=null,ot=a.network.vertexes.iterator;ot.next();)if(tt=ot.value,tt.component===1){for(at=0,ut=!1,mt=tt.sourceEdgesArrayAccess,ct=mt.length,yt=0;yt<ct;yt++)St=mt[yt].fromVertex,at+=1,St.component!==1?b+=1:ut=!0;for(mt=tt.destinationEdgesArrayAccess,ct=mt.length,yt=0;yt<ct;yt++)St=mt[yt],Lt=St.toVertex,--at,Lt.component!==1&&(--b,Lt=tt.layer-Lt.layer,St=a.linkMinLength(St),E=Math.min(E,Lt-St));(rt===null||at>z)&&!ut&&(rt=tt,z=at)}if(0>b){for(x.reset();x.next();)b=x.value,b.component===1&&(b.layer-=E);y.component=0}else rt.component=0}}}function JS(a,y,x){return a.K===90?x&&!y.rev||!x&&y.rev?270:90:a.K===180?x&&!y.rev||!x&&y.rev?0:180:a.K===270?x&&!y.rev||!x&&y.rev?90:270:x&&!y.rev||!x&&y.rev?180:0}or.prototype.initializeIndices=function(){switch(this.Qk){default:case Cy:for(var a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;y.index=this.tc[x],this.tc[x]++}break;case N0:for(a=this.network.vertexes.iterator,y=this.Ia;0<=y;y--)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&QS(this,x);break;case wy:for(a=this.network.vertexes.iterator,y=0;y<=this.Ia;y++)for(a.reset();a.next();)x=a.value,x.layer===y&&x.index===-1&&$S(this,x)}};function QS(a,y){var x=y.layer;for(y.index=a.tc[x],a.tc[x]++,y=y.destinationEdgesArrayAccess,x=!0;x;){x=!1;for(var b=0;b<y.length-1;b++){var E=y[b],z=y[b+1];E.portFromColOffset>z.portFromColOffset&&(x=!0,y[b]=z,y[b+1]=E)}}for(x=0;x<y.length;x++)b=y[x],b.valid&&(b=b.toVertex,b.index===-1&&QS(a,b))}function $S(a,y){var x=y.layer;y.index=a.tc[x],a.tc[x]++,y=y.sourceEdgesArrayAccess;for(var b=!0;b;)for(b=!1,x=0;x<y.length-1;x++){var E=y[x],z=y[x+1];E.portToColOffset>z.portToColOffset&&(b=!0,y[x]=z,y[x+1]=E)}for(x=0;x<y.length;x++)b=y[x],b.valid&&(b=b.fromVertex,b.index===-1&&$S(a,b))}or.prototype.reduceCrossings=function(){var a=this.countCrossings(),y=Xa(this),x,b;for(x=0;x<this.bj;x++){for(b=0;b<=this.Ia;b++)k0(this,b,1),ou(this,b,1);var E=this.countCrossings();for(E<a&&(a=E,y=Xa(this)),b=this.Ia;0<=b;b--)k0(this,b,-1),ou(this,b,-1);E=this.countCrossings(),E<a&&(a=E,y=Xa(this))}for(Ul(this,y),x=0;x<this.bj;x++){for(b=0;b<=this.Ia;b++)k0(this,b,0),ou(this,b,0);for(E=this.countCrossings(),E<a&&(a=E,y=Xa(this)),b=this.Ia;0<=b;b--)k0(this,b,0),ou(this,b,0);E=this.countCrossings(),E<a&&(a=E,y=Xa(this))}Ul(this,y);var z,tt,rt;switch(this.rk){case Ly:break;case My:for(rt=a+1;(b=this.countCrossings())<rt;)for(rt=b,x=this.Ia;0<=x;x--)for(tt=0;tt<=x;tt++){for(z=!0;z;)for(z=!1,b=x;b>=tt;b--)z=ou(this,b,-1)||z;for(E=this.countCrossings(),E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=x;b>=tt;b--)z=ou(this,b,1)||z;for(E=this.countCrossings(),E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=tt;b<=x;b++)z=ou(this,b,1)||z;for(E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=tt;b<=x;b++)z=ou(this,b,-1)||z;for(E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=x;b>=tt;b--)z=ou(this,b,0)||z;for(E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=tt;b<=x;b++)z=ou(this,b,0)||z;E>=a?Ul(this,y):(a=E,y=Xa(this))}break;default:case D0:for(x=this.Ia,tt=0,rt=a+1;(b=this.countCrossings())<rt;){for(rt=b,z=!0;z;)for(z=!1,b=x;b>=tt;b--)z=ou(this,b,-1)||z;for(E=this.countCrossings(),E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=x;b>=tt;b--)z=ou(this,b,1)||z;for(E=this.countCrossings(),E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=tt;b<=x;b++)z=ou(this,b,1)||z;for(E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=tt;b<=x;b++)z=ou(this,b,-1)||z;for(E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=x;b>=tt;b--)z=ou(this,b,0)||z;for(E>=a?Ul(this,y):(a=E,y=Xa(this)),z=!0;z;)for(z=!1,b=tt;b<=x;b++)z=ou(this,b,0)||z;E>=a?Ul(this,y):(a=E,y=Xa(this))}}Ul(this,y)};function k0(a,y,x){var b=gf(a,y),E=a.tc[y],z=VS(a,y,x),tt=py(a,y,x);for(x=0;x<E;x++)tt[x]===-1&&(tt[x]=b[x].column),z[x]===-1&&(z[x]=b[x].column);for(var rt=!0,ot;rt;)for(rt=!1,x=0;x<E-1;x++)(z[x+1]<z[x]||z[x+1]===z[x]&&tt[x+1]<tt[x])&&(rt=!0,ot=z[x],z[x]=z[x+1],z[x+1]=ot,ot=tt[x],tt[x]=tt[x+1],tt[x+1]=ot,ot=b[x],b[x]=b[x+1],b[x+1]=ot);for(x=z=0;x<E;x++)ot=b[x],ot.index=x,z+=a.nodeMinColumnSpace(ot,!0),ot.column=z,z+=1,z+=a.nodeMinColumnSpace(ot,!1);pf(a,y,b)}function ou(a,y,x){var b=gf(a,y),E=a.tc[y];x=HS(a,y,x);var z,tt=[];for(z=0;z<E;z++)tt[z]=-1;var rt=[];for(z=0;z<E;z++)rt[z]=-1;for(var ot=!1,at=!0;at;)for(at=!1,z=0;z<E-1;z++){var ut=x[b[z].index*E+b[z+1].index],ct=x[b[z+1].index*E+b[z].index],mt=0,yt=0,St=b[z].column,Lt=b[z+1].column,Ot=a.nodeMinColumnSpace(b[z],!0),Dt=a.nodeMinColumnSpace(b[z],!1),Gt=a.nodeMinColumnSpace(b[z+1],!0),Vt=a.nodeMinColumnSpace(b[z+1],!1);Ot=St-Ot+Gt,Dt=Lt-Dt+Vt;var Yt=b[z].sourceEdges.iterator;for(Yt.reset();Yt.next();)if(Gt=Yt.value,Vt=Gt.fromVertex,Gt.valid&&Vt.layer===y){for(Gt=0;b[Gt]!==Vt;)Gt++;Gt<z&&(mt+=2*(z-Gt),yt+=2*(z+1-Gt)),Gt===z+1&&(mt+=1),Gt>z+1&&(mt+=4*(Gt-z),yt+=4*(Gt-(z+1)))}for(Yt=b[z].destinationEdges.iterator,Yt.reset();Yt.next();)if(Gt=Yt.value,Vt=Gt.toVertex,Gt.valid&&Vt.layer===y){for(Gt=0;b[Gt]!==Vt;)Gt++;Gt===z+1&&(yt+=1)}for(Yt=b[z+1].sourceEdges.iterator,Yt.reset();Yt.next();)if(Gt=Yt.value,Vt=Gt.fromVertex,Gt.valid&&Vt.layer===y){for(Gt=0;b[Gt]!==Vt;)Gt++;Gt<z&&(mt+=2*(z+1-Gt),yt+=2*(z-Gt)),Gt===z&&(yt+=1),Gt>z+1&&(mt+=4*(Gt-(z+1)),yt+=4*(Gt-z))}for(Yt=b[z+1].destinationEdges.iterator,Yt.reset();Yt.next();)if(Gt=Yt.value,Vt=Gt.toVertex,Gt.valid&&Vt.layer===y){for(Gt=0;b[Gt]!==Vt;)Gt++;Gt===z&&(mt+=1)}Gt=Vt=0,Yt=tt[b[z].index];var qt=rt[b[z].index],ae=tt[b[z+1].index],Je=rt[b[z+1].index];Yt!==-1&&(Vt+=Math.abs(Yt-St),Gt+=Math.abs(Yt-Dt)),qt!==-1&&(Vt+=Math.abs(qt-St),Gt+=Math.abs(qt-Dt)),ae!==-1&&(Vt+=Math.abs(ae-Lt),Gt+=Math.abs(ae-Ot)),Je!==-1&&(Vt+=Math.abs(Je-Lt),Gt+=Math.abs(Je-Ot)),(yt<mt-.5||yt===mt&&ct<ut-.5||yt===mt&&ct===ut&&Gt<Vt-.5)&&(at=ot=!0,b[z].column=Dt,b[z+1].column=Ot,ut=b[z],b[z]=b[z+1],b[z+1]=ut)}for(z=0;z<E;z++)b[z].index=z;return pf(a,y,b),ot}or.prototype.straightenAndPack=function(){if(this.ve===0){var a=(this.bg&1)!==0,y=(this.bg&Yx)!==0;if(1e3<this.network.edges.count&&y&&(a=!1),a){var x=[];for(y=0;y<=this.Ia;y++)x[y]=0;for(var b,E=this.network.vertexes.iterator;E.next();){var z=E.value;y=z.layer,b=z.column,z=this.nodeMinColumnSpace(z,!1),x[y]=Math.max(x[y],b+z)}for(E.reset();E.next();)z=E.value,y=z.layer,b=z.column,z.column=(8*(this.Ra-x[y])>>1)+8*b;this.Ra*=8}if(this.bg&2)for(x=!0;x;){for(x=!1,y=this.Md+1;y<=this.Ia;y++)x=Bg(this,y,1)||x;for(y=this.Md-1;0<=y;y--)x=Bg(this,y,-1)||x;x=Bg(this,this.Md,0)||x}if(this.bg&4){for(y=this.Md+1;y<=this.Ia;y++)yy(this,y,1);for(y=this.Md-1;0<=y;y--)yy(this,y,-1);yy(this,this.Md,0)}if(a&&(qS(this,-1),qS(this,1)),this.bg&2)for(x=!0;x;){for(x=!1,x=Bg(this,this.Md,0)||x,y=this.Md+1;y<=this.Ia;y++)x=Bg(this,y,0)||x;for(y=this.Md-1;0<=y;y--)x=Bg(this,y,0)||x}}else Vx(this)};function Bg(a,y,x){for(var b=!1;Gx(a,y,x);)b=!0;return b}function Gx(a,y,x){var b,E=gf(a,y),z=a.tc[y],tt=py(a,y,-1);if(0<x)for(b=0;b<z;b++)tt[b]=-1;var rt=py(a,y,1);if(0>x)for(b=0;b<z;b++)rt[b]=-1;for(var ot=!1,at=!0;at;)for(at=!1,b=0;b<z;b++){var ut=E[b].column,ct=a.nodeMinColumnSpace(E[b],!0),mt=a.nodeMinColumnSpace(E[b],!1),yt=0;0>b-1||ut-E[b-1].column-1>ct+a.nodeMinColumnSpace(E[b-1],!1)?yt=ut-1:yt=ut,ct=b+1>=z||E[b+1].column-ut-1>mt+a.nodeMinColumnSpace(E[b+1],!0)?ut+1:ut;var St=mt=0,Lt=0;if(0>=x)for(var Ot=E[b].sourceEdges.iterator;Ot.next();){var Dt=Ot.value,Gt=Dt.fromVertex;if(Dt.valid&&Gt.layer!==y){var Vt=gy(Dt),Yt=Dt.portFromColOffset;Dt=Dt.portToColOffset,Gt=Gt.column,mt+=(Math.abs(ut+Dt-(Gt+Yt))+1)*Vt,St+=(Math.abs(yt+Dt-(Gt+Yt))+1)*Vt,Lt+=(Math.abs(ct+Dt-(Gt+Yt))+1)*Vt}}if(0<=x)for(Ot=E[b].destinationEdges.iterator;Ot.next();)Dt=Ot.value,Gt=Dt.toVertex,Dt.valid&&Gt.layer!==y&&(Vt=gy(Dt),Yt=Dt.portFromColOffset,Dt=Dt.portToColOffset,Gt=Gt.column,mt+=(Math.abs(ut+Yt-(Gt+Dt))+1)*Vt,St+=(Math.abs(yt+Yt-(Gt+Dt))+1)*Vt,Lt+=(Math.abs(ct+Yt-(Gt+Dt))+1)*Vt);Dt=Yt=Vt=0,Ot=tt[E[b].index],Gt=rt[E[b].index],Ot!==-1&&(Vt+=Math.abs(Ot-ut),Yt+=Math.abs(Ot-yt),Dt+=Math.abs(Ot-ct)),Gt!==-1&&(Vt+=Math.abs(Gt-ut),Yt+=Math.abs(Gt-yt),Dt+=Math.abs(Gt-ct)),St<mt||St===mt&&Yt<Vt?(at=ot=!0,E[b].column=yt):(Lt<mt||Lt===mt&&Dt<Vt)&&(at=ot=!0,E[b].column=ct)}return pf(a,y,E),a.normalize(),ot}function yy(a,y,x){var b=gf(a,y),E=a.tc[y],z=VS(a,y,x),tt=[];for(x=0;x<E;x++)tt[x]=z[x];for(z=!0;z;)for(z=!1,x=0;x<E;x++){var rt=b[x].column,ot=a.nodeMinColumnSpace(b[x],!0),at=a.nodeMinColumnSpace(b[x],!1),ut=0;if(tt[x]===-1)if(x===0&&x===E-1)ut=rt;else if(x===0){var ct=b[x+1].column;ct-rt===at+a.nodeMinColumnSpace(b[x+1],!0)?ut=rt-1:ut=rt}else x===E-1?(ct=b[x-1].column,ut=rt-ct===ot+a.nodeMinColumnSpace(b[x-1],!1)?rt+1:rt):(ct=b[x-1].column,ot=ct+a.nodeMinColumnSpace(b[x-1],!1)+ot+1,ct=b[x+1].column,at=ct-a.nodeMinColumnSpace(b[x+1],!0)-at-1,ut=(ot+at)/2|0);else x===0&&x===E-1?ut=tt[x]:x===0?(ct=b[x+1].column,at=ct-a.nodeMinColumnSpace(b[x+1],!0)-at-1,ut=Math.min(tt[x],at)):x===E-1?(ct=b[x-1].column,ot=ct+a.nodeMinColumnSpace(b[x-1],!1)+ot+1,ut=Math.max(tt[x],ot)):(ct=b[x-1].column,ot=ct+a.nodeMinColumnSpace(b[x-1],!1)+ot+1,ct=b[x+1].column,at=ct-a.nodeMinColumnSpace(b[x+1],!0)-at-1,ot<tt[x]&&tt[x]<at?ut=tt[x]:ot>=tt[x]?ut=ot:at<=tt[x]&&(ut=at));ut!==rt&&(z=!0,b[x].column=ut)}pf(a,y,b),a.normalize()}function _x(a,y){for(var x=!0,b=a.network.vertexes.iterator;b.next();){var E=b.value,z=a.nodeMinColumnSpace(E,!0),tt=a.nodeMinColumnSpace(E,!1);if(E.column-z<=y&&E.column+tt>=y){x=!1;break}}if(a=!1,x)for(b.reset();b.next();)x=b.value,x.column>y&&(--x.column,a=!0);return a}function Hx(a,y){var x=y+1,b,E=[],z=[];for(b=0;b<=a.Ia;b++)E[b]=!1,z[b]=!1;for(var tt=a.network.vertexes.iterator;tt.next();){b=tt.value;var rt=b.column-a.nodeMinColumnSpace(b,!0),ot=b.column+a.nodeMinColumnSpace(b,!1);rt<=y&&ot>=y&&(E[b.layer]=!0),rt<=x&&ot>=x&&(z[b.layer]=!0)}for(rt=!0,x=!1,b=0;b<=a.Ia;b++)rt=rt&&!(E[b]&&z[b]);if(rt)for(tt.reset();tt.next();)a=tt.value,a.column>y&&(--a.column,x=!0);return x}function qS(a,y){for(var x=0;x<=a.Ra;x++)for(;_x(a,x););for(a.normalize(),x=0;x<a.Ra;x++)for(;Hx(a,x););a.normalize();var b;if(0<y)for(x=0;x<=a.Ra;x++){var E=Xa(a),z=M0(a);for(b=z+1;z<b;){b=z,tx(a,x,1);var tt=M0(a);tt>z?Ul(a,E):tt<z&&(z=tt,E=Xa(a))}}if(0>y)for(x=a.Ra;0<=x;x--)for(E=Xa(a),z=M0(a),b=z+1;z<b;)b=z,tx(a,x,-1),tt=M0(a),tt>z?Ul(a,E):tt<z&&(z=tt,E=Xa(a));a.normalize()}function tx(a,y,x){a.le=0;for(var b=a.network.vertexes.iterator;b.next();)b.value.component=-1;if(0<x)for(b.reset();b.next();){var E=b.value;E.column-a.nodeMinColumnSpace(E,!0)<=y&&(E.component=a.le)}if(0>x)for(b.reset();b.next();)E=b.value,E.column+a.nodeMinColumnSpace(E,!1)>=y&&(E.component=a.le);for(a.le++,b.reset();b.next();)y=b.value,y.component===-1&&(my(a,y,a.le,-1,!0,!0),a.le++);var z;for(y=[],z=0;z<a.le*a.le;z++)y[z]=!1;for(E=[],z=0;z<(a.Ia+1)*(a.Ra+1);z++)E[z]=-1;for(b.reset();b.next();){z=b.value;for(var tt=z.layer,rt=Math.max(0,z.column-a.nodeMinColumnSpace(z,!0)),ot=Math.min(a.Ra,z.column+a.nodeMinColumnSpace(z,!1));rt<=ot;rt++)E[tt*(a.Ra+1)+rt]=z.component}for(z=0;z<=a.Ia;z++){if(0<x)for(tt=0;tt<a.Ra;tt++)E[z*(a.Ra+1)+tt]!==-1&&E[z*(a.Ra+1)+tt+1]!==-1&&E[z*(a.Ra+1)+tt]!==E[z*(a.Ra+1)+tt+1]&&(y[E[z*(a.Ra+1)+tt]*a.le+E[z*(a.Ra+1)+tt+1]]=!0);if(0>x)for(tt=a.Ra;0<tt;tt--)E[z*(a.Ra+1)+tt]!==-1&&E[z*(a.Ra+1)+tt-1]!==-1&&E[z*(a.Ra+1)+tt]!==E[z*(a.Ra+1)+tt-1]&&(y[E[z*(a.Ra+1)+tt]*a.le+E[z*(a.Ra+1)+tt-1]]=!0)}for(E=[],z=0;z<a.le;z++)E[z]=!0;for(tt=[],tt.push(0);tt.length!==0;)if(ot=tt[tt.length-1],tt.pop(),E[ot])for(E[ot]=!1,z=0;z<a.le;z++)y[ot*a.le+z]&&tt.splice(0,0,z);if(0<x)for(b.reset();b.next();)a=b.value,E[a.component]&&--a.column;if(0>x)for(b.reset();b.next();)x=b.value,E[x.component]&&(x.column+=1)}function Vx(a){for(var y=Kn(),x=a.fl.length,b=0;b<=x;b++)y[b]=[];for(b=a.network.vertexes.iterator;b.next();){var E=b.value;y[x-E.layer][E.index]=E}x=new Ye,Wx(y,x);var z=null,tt=null,rt=null,ot=null,at=(a.ve&1)!==0,ut=(a.ve&2)!==0,ct=(a.ve&4)!==0,mt=(a.ve&8)!==0;for(at&&(a.verticalAlignment(y,x,!0),z=b0(a,y,!0,!1)),y.reverse(),ct&&(a.verticalAlignment(y,x,!1),rt=b0(a,y,!1,!1)),b=mn(y),E=b.next();!E.done;E=b.next())E.value.reverse();mt&&(a.verticalAlignment(y,x,!1),ot=b0(a,y,!1,!0)),y.reverse(),ut&&(a.verticalAlignment(y,x,!0),tt=b0(a,y,!0,!0)),zn(y),a.u(z,tt,rt,ot),a.network.vertexes.each(function(yt){var St=Kn();at&&St.push(z.get(yt)),ut&&St.push(tt.get(yt)),ct&&St.push(rt.get(yt)),mt&&St.push(ot.get(yt)),St.sort(function(Ot,Dt){return Ot-Dt});var Lt=St.length;Lt=(St[Math.floor((Lt-1)/2)]+St[Math.ceil((Lt-1)/2)])/2,zn(St),yt.zc=Lt})}function Wx(a,y){for(var x=a.length,b=1;b<x-1;b++)for(var E=0,z=0,tt=a[b],rt=a[b+1],ot=0;z<rt.length;ot++){var at=rt[ot];t:{if(at.node===null){var ut=ky(at);if(0<ut.length){ut=ut[0].node===null;break t}}ut=!1}var ct=ut;if(ot===rt.length-1||ct){for(ut=tt.length-1,ct&&(ut=ky(at)[0].index);z<=ot;){if(at=rt[z],!at.bo){ct=[];for(var mt=mn(at.sourceEdgesArrayAccess),yt=mt.next();!yt.done;yt=mt.next())yt=yt.value,yt.valid&&ct.push(yt);at.bo=ct}for(at=mn(at.bo),ct=at.next();!ct.done;ct=at.next())ct=ct.value,mt=ct.fromVertex.index,(mt<E||mt>ut)&&y.add(ct);z++}E=ut}}}or.prototype.verticalAlignment=function(a,y,x){Ux(a),a=mn(a);for(var b=a.next();!b.done;b=a.next()){var E=-1;b=mn(b.value);for(var z=b.next();!z.done;z=b.next()){z=z.value;var tt=x?ky(z):Xx(z),rt=tt.length;if(0<rt){tt.sort(function(ct,mt){return ct.vi-mt.vi});var ot=(rt-1)/2;for(rt=Math.floor(ot),ot=Math.ceil(ot);rt<=ot;rt++)if(z.align===z){var at=tt[rt],ut=void 0;ut=x?A0(at,z):A0(z,at),!y.contains(ut)&&E<at.vi&&(at.align=z,z.root=at.root,z.align=at.root,E=at.vi)}}}}};function Ux(a){for(var y=0;y<a.length;y++)for(var x=a[y],b=0;b<x.length;b++){var E=x[b];E.root=E,E.align=E,E.Tz=y,E.vi=b}}function b0(a,y,x,b){for(var E=a.K===90||a.K===270,z=mn(y),tt=z.next();!tt.done;tt=z.next()){var rt=mn(tt.value);for(tt=rt.next();!tt.done;tt=rt.next())tt=tt.value,tt.sd=tt,tt.shift=1/0,tt.zc=NaN,tt.qg=0}for(tt=a.K===90||a.K===270,z=mn(y),rt=z.next();!rt.done;rt=z.next()){rt=mn(rt.value);for(var ot=rt.next();!ot.done;ot=rt.next())if(ot=ot.value,ot.root===ot){for(var at=0,ut=ot;ut.align!==ot;){var ct=ut.align,mt=tt?ut.width:ut.height,yt=tt?ct.width:ct.height;if(x){var St=A0(ut,ct),Lt=St.portFromPos,Ot=St.portToPos;St.link!==null&&(ut.node&&ut.node!==St.link.fromNode&&(Lt=tt?ut.focusX:ut.focusY),ct.node&&ct.node!==St.link.toNode&&(Ot=tt?ct.focusX:ct.focusY))}else St=A0(ct,ut),Lt=St.portToPos,Ot=St.portFromPos,St.link!==null&&(ut.node&&ut.node!==St.link.toNode&&(Lt=tt?ut.focusX:ut.focusY),ct.node&&ct.node!==St.link.fromNode&&(Ot=tt?ct.focusX:ct.focusY));mt=b?ut.qg+(mt-Lt)-(yt-Ot):ut.qg+Lt-Ot,ct.qg=mt,at=Math.min(at,mt),ut=ut.align}ut=ot;do ut.qg=ut.qg-at,ut=ut.align;while(ut!==ot)}}for(x=mn(y),tt=x.next();!tt.done;tt=x.next())for(z=mn(tt.value),tt=z.next();!tt.done;tt=z.next())tt=tt.value,tt.root===tt&&ex(a,tt,y);for(x=0;x<y.length;x++)if(!(0>=y[x].length)&&(tt=y[x][0],tt.sd===tt)){tt.sd.shift===1/0&&(tt.sd.shift=0),tt=x,rt=0;do{for(z=y[tt][rt];z.align!==z.root;)z=z.align,tt++,0<z.vi&&(rt=nx(z,y),rt.sd.shift=Math.min(rt.sd.shift,z.sd.shift+z.zc+z.qg-(rt.zc+rt.qg+(E?rt.width:rt.height)+a.columnSpacing)));rt=z.vi+1}while(tt<y.length&&rt<y[tt].length&&z.sd===y[tt][rt].sd)}for(a=new xn,y=mn(y),tt=y.next();!tt.done;tt=y.next())for(x=mn(tt.value),tt=x.next();!tt.done;tt=x.next())tt=tt.value,tt.zc=tt.zc+tt.sd.shift+tt.qg,z=E?tt.width:tt.height,a.add(tt,b?-tt.zc-z:tt.zc);return a}function ex(a,y,x){if(isNaN(y.zc)){y.zc=0;var b=y;do{if(0<b.vi){var E=nx(b,x),z=E.root;ex(a,z,x),y.sd===y&&(y.sd=z.sd);var tt=a.K===90||a.K===270?E.width:E.height;y.sd===z.sd&&(y.zc=Math.max(y.zc,z.zc+E.qg+tt-b.qg+a.columnSpacing))}b=b.align}while(b!==y);for(;b.align!==y;)b=b.align,b.zc=y.zc,b.sd=y.sd}}function nx(a,y){var x=a.Tz;return a=a.vi,1>a&&fe("Could not determine previous vertex in layer"),y[x][a-1]}or.prototype.u=function(a){for(var y=[],x=0;x<arguments.length;++x)y[x]=arguments[x];x=-1;for(var b=Kn(),E=Kn(),z=1/0,tt=0;4>tt;tt++)if(y[tt]){var rt=Kx(this,y[tt],b,E,tt);rt<z&&(x=tt,z=rt)}for(z={},tt=0;4>tt;z={delta:z.delta},tt++)y[tt]&&(z.delta=tt===0||tt===2?b[x]-b[tt]:E[x]-E[tt],z.delta!==0&&y[tt].each(function(ot){return function(at){at.value+=ot.delta}}(z)));zn(b),zn(E)};function Kx(a,y,x,b,E){if(!y||y.count===0)return x[E]=0,b[E]=0,1/0;var z=1/0,tt=-1/0;return y.each(function(rt){var ot=rt.key;rt=rt.value,ot=a.K===90||a.K===270?ot.width:ot.height,rt<z&&(z=rt),rt+ot>tt&&(tt=rt+ot)}),x[E]=z,b[E]=tt,tt-z}or.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=E0(this,!0),y=E0(this,!1),x=this.network.edges.iterator;x.next();){var b=x.value.link;b!==null&&(b.fromSpot=a,b.toSpot=y)}this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()};function E0(a,y){return a.K===270?y?$a:Ks:a.K===90?y?Ks:$a:a.K===180?y?ya:js:y?js:ya}or.prototype.commitNodes=function(){this.he=[],this.Ld=[],this.Kd=[],this.Ta=[];for(var a=0;a<=this.Ia;a++)this.he[a]=0,this.Ld[a]=0,this.Kd[a]=0,this.Ta[a]=0;for(a=this.network.vertexes.iterator;a.next();){var y=a.value,x=y.layer;this.he[x]=Math.max(this.he[x],this.nodeMinLayerSpace(y,!0)),this.Ld[x]=Math.max(this.Ld[x],this.nodeMinLayerSpace(y,!1))}y=0,x=this.ie;for(var b=0;b<=this.Ia;b++){var E=x;0>=this.he[b]+this.Ld[b]&&(E=0),0<b&&(y+=E/2),this.K===90||this.K===0?(y+=this.Ld[b],this.Kd[b]=y,y+=this.he[b]):(y+=this.he[b],this.Kd[b]=y,y+=this.Ld[b]),b<this.Ia&&(y+=E/2),this.Ta[b]=y}for(x=y,y=this.arrangementOrigin,b=0;b<=this.Ia;b++)this.K===270?this.Kd[b]=y.y+this.Kd[b]:this.K===90?(this.Kd[b]=y.y+x-this.Kd[b],this.Ta[b]=x-this.Ta[b]):this.K===180?this.Kd[b]=y.x+this.Kd[b]:(this.Kd[b]=y.x+x-this.Kd[b],this.Ta[b]=x-this.Ta[b]);x=this.ve!==0,a.reset(),b=this.K===270||this.K===90;for(var z=1/0,tt=E=1/0,rt=-1/0;a.next();){var ot=a.value,at=ot.layer,ut=ot.column|0;b?(tt=y.x+this.kc*ut,at=this.Kd[at]):(tt=this.Kd[at],at=y.y+this.kc*ut),ot.centerX=tt,ot.centerY=at,x&&isFinite(ot.zc)&&(b?ot.node?ot.x=y.x+ot.zc:ot.centerX=y.x+ot.zc:ot.node?ot.y=y.y+ot.zc:ot.centerY=y.y+ot.zc),z=Math.min(ot.x,z),E=Math.min(ot.y,E),b?(tt=z,rt=Math.max(rt,ot.bounds.right)):(tt=E,rt=Math.max(rt,ot.bounds.bottom))}for(this.xw=rt-tt,z=y.x-z,y=y.y-E,this.Rf=new jt(x&&b?0:z,x&&!b?0:y),a.reset();a.next();)x=a.value,x.x+=z,x.y+=y,x.commit()},or.prototype.Gu=function(){for(var a=0,y=this.ie,x=0;x<=this.Ia;x++)a+=this.he[x],a+=this.Ld[x];a+=this.Ia*y,y=[],x=this.ve!==0?this.xw:this.kc*this.Ra;for(var b=this.maxLayer;0<=b;b--)this.K===270?b===0?y.push(new ye(0,0,x,Math.abs(this.Ta[0]))):y.push(new ye(0,this.Ta[b-1],x,Math.abs(this.Ta[b-1]-this.Ta[b]))):this.K===90?b===0?y.push(new ye(0,this.Ta[0],x,Math.abs(this.Ta[0]-a))):y.push(new ye(0,this.Ta[b],x,Math.abs(this.Ta[b-1]-this.Ta[b]))):this.K===180?b===0?y.push(new ye(0,0,Math.abs(this.Ta[0]),x)):y.push(new ye(this.Ta[b-1],0,Math.abs(this.Ta[b-1]-this.Ta[b]),x)):b===0?y.push(new ye(this.Ta[0],0,Math.abs(this.Ta[0]-a),x)):y.push(new ye(this.Ta[b],0,Math.abs(this.Ta[b-1]-this.Ta[b]),x));this.commitLayers(y,this.Rf)},or.prototype.commitLayers=function(){},or.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,y;a.next();)y=a.value.link,y!==null&&(y.uh(),y.Fj(),y.zf());for(a.reset();a.next();)y=a.value.link,y!==null&&y.vg();for(a.reset();a.next();){var x=a.value;if(y=x.link,y!==null){y.uh();var b=y,E=b.fromNode,z=b.toNode,tt=b.fromPort,rt=b.toPort;if(E!==null){var ot=E.findVisibleNode();ot!==null&&ot!==E&&(E=ot,tt=ot.port)}z!==null&&(ot=z.findVisibleNode(),ot!==null&&ot!==z&&(z=ot,rt=ot.port));var at=y.computeSpot(!0,tt);ot=y.computeSpot(!1,rt);var ut=x.fromVertex,ct=x.toVertex;if(x.valid)y.curve===Al&&y.pointsCount===4&&(ut.column===ct.column&&this.alignOption===0?(x=y.getLinkPoint(E,tt,at,!0,!1,z,rt),rt=y.getLinkPoint(z,rt,ot,!1,!1,E,tt),x.w()||x.set(E.actualBounds.center),rt.w()||rt.set(z.actualBounds.center),y.Fj(),y.yf(x.x,x.y),y.yf((2*x.x+rt.x)/3,(2*x.y+rt.y)/3),y.yf((x.x+2*rt.x)/3,(x.y+2*rt.y)/3),y.yf(rt.x,rt.y)):(x=b=!1,tt!==null&&at===us&&(b=!0),rt!==null&&ot===us&&(x=!0),(b||x)&&(ot=null,b&&(ot=y.getLinkPointFromPoint(E,tt,tt.ga(Xi),y.i(3),!0),ot.w()||ot.set(E.actualBounds.center),y.L(0,ot.x,ot.y)),E=null,x&&(E=y.getLinkPointFromPoint(z,rt,rt.ga(Xi),y.i(0),!1),E.w()||E.set(z.actualBounds.center),y.L(3,E.x,E.y)),ot&&(z=y.i(2),y.L(1,(2*ot.x+z.x)/3,(2*ot.y+z.y)/3)),E&&(z=y.i(1),y.L(2,(2*E.x+z.x)/3,(2*E.y+z.y)/3))))),y.zf();else if(ut.layer===ct.layer)y.zf();else{var mt=!1,yt=!1,St=this.ie,Lt=y.firstPickIndex+1;if(y.isOrthogonal){yt=!0;var Ot=y.pointsCount;4<Ot&&y.points.removeRange(2,Ot-3)}else if(y.curve===Al)mt=!0,Ot=y.pointsCount,4<Ot&&y.points.removeRange(2,Ot-3),Ot===4&&(Lt=2);else{Ot=y.pointsCount;var Dt=at===us,Gt=ot===us;2<Ot&&Dt&&Gt?y.points.removeRange(1,Ot-2):3<Ot&&Dt&&!Gt?y.points.removeRange(1,Ot-3):3<Ot&&!Dt&&Gt?y.points.removeRange(2,Ot-2):4<Ot&&!Dt&&!Gt&&y.points.removeRange(2,Ot-3)}if(x.rev){for(;ct!==null&&ut!==ct;){var Vt=Ot=null;for(Dt=ct.sourceEdges.iterator;Dt.next()&&(Gt=Dt.value,Gt.link!==x.link||(Ot=Gt.fromVertex,Vt=Gt.toVertex,Ot.node!==null)););if(Ot===null)break;if(Ot!==ut){Dt=y.i(Lt-1).x,Gt=y.i(Lt-1).y;var Yt=Ot.centerX,qt=Ot.centerY;if(yt)this.K===180||this.K===0?Lt===y.firstPickIndex+1?(y.m(Lt++,Dt,Gt),y.m(Lt++,Dt,qt)):(Vt!==null?Vt.centerY:Gt)!==qt&&(Vt=this.Ta[Ot.layer-1]+this.Rf.x,y.m(Lt++,Vt,Gt),y.m(Lt++,Vt,qt)):Lt===y.firstPickIndex+1?(y.m(Lt++,Dt,Gt),y.m(Lt++,Yt,Gt)):(Vt!==null?Vt.centerX:Dt)!==Yt&&(Vt=this.Ta[Ot.layer-1]+this.Rf.y,y.m(Lt++,Dt,Vt),y.m(Lt++,Yt,Vt));else if(Lt===y.firstPickIndex+1){Vt=Math.max(10,this.he[ct.layer]);var ae=Math.max(10,this.Ld[ct.layer]);if(mt)this.K===180?Yt<=ct.bounds.x?(ct=ct.bounds.x,y.m(Lt++,ct-Vt,qt),y.m(Lt++,ct,qt),y.m(Lt++,ct+ae,qt)):(y.m(Lt++,Yt-Vt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt+ae,qt)):this.K===90?qt>=ct.bounds.bottom?(ct=ct.bounds.y+ct.bounds.height,y.m(Lt++,Yt,ct+ae),y.m(Lt++,Yt,ct),y.m(Lt++,Yt,ct-Vt)):(y.m(Lt++,Yt,qt+ae),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt-Vt)):this.K===270?qt<=ct.bounds.y?(ct=ct.bounds.y,y.m(Lt++,Yt,ct-Vt),y.m(Lt++,Yt,ct),y.m(Lt++,Yt,ct+ae)):(y.m(Lt++,Yt,qt-Vt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt+ae)):this.K===0&&(Yt>=ct.bounds.right?(ct=ct.bounds.x+ct.bounds.width,y.m(Lt++,ct+ae,qt),y.m(Lt++,ct,qt),y.m(Lt++,ct-Vt,qt)):(y.m(Lt++,Yt+ae,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt-Vt,qt)));else{y.m(Lt++,Dt,Gt);var Je=0;this.K===180||this.K===0?((this.K===180?Yt>=ct.bounds.right:Yt<=ct.bounds.x)&&(Je=(this.K===0?-Vt:ae)/2),y.m(Lt++,Dt+Je,qt)):((this.K===270?qt>=ct.bounds.bottom:qt<=ct.bounds.y)&&(Je=(this.K===90?-Vt:ae)/2),y.m(Lt++,Yt,Gt+Je)),y.m(Lt++,Yt,qt)}}else Vt=Math.max(10,this.he[Ot.layer]),ae=Math.max(10,this.Ld[Ot.layer]),mt?this.K===180?(y.m(Lt++,Yt-Vt-St,qt),y.m(Lt++,Math.min(Yt-Vt+St/2,Yt),qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Math.max(Yt+ae-St/2,Yt),qt),y.m(Lt++,Yt+ae+St,qt)):this.K===90?(y.m(Lt++,Yt,qt+ae+St),y.m(Lt++,Yt,Math.max(qt+ae-St/2,qt)),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,Math.min(qt-Vt+St/2,qt)),y.m(Lt++,Yt,qt-Vt-St)):this.K===270?(y.m(Lt++,Yt,qt-Vt-St),y.m(Lt++,Yt,Math.min(qt-Vt+St/2,qt)),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,Math.max(qt+ae-St/2,qt)),y.m(Lt++,Yt,qt+ae+St)):(y.m(Lt++,Yt+ae+St,qt),y.m(Lt++,Math.max(Yt+ae-St/2,Yt),qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Math.min(Yt-Vt+St/2,Yt),qt),y.m(Lt++,Yt-Vt-St,qt)):y.m(Lt++,Yt,qt)}ct=Ot}(rt===null||at!==us||yt)&&(Dt=y.i(Lt-1).x,Gt=y.i(Lt-1).y,Yt=y.i(Lt).x,qt=y.i(Lt).y,yt?(St=this.Ld[ut.layer],this.K===180||this.K===0?(yt=Gt,yt>=ut.bounds.y&&yt<=ut.bounds.bottom&&(this.K===180?Yt>=ut.bounds.x:Yt<=ut.bounds.right)&&(ct=ut.centerX+(this.K===180?-St:St),yt<ut.bounds.y+ut.bounds.height/2?yt=ut.bounds.y-this.kc/2:yt=ut.bounds.bottom+this.kc/2,y.m(Lt++,ct,Gt),y.m(Lt++,ct,yt)),y.m(Lt++,Yt,yt)):(yt=Dt,yt>=ut.bounds.x&&yt<=ut.bounds.right&&(this.K===270?qt>=ut.bounds.y:qt<=ut.bounds.bottom)&&(ct=ut.centerY+(this.K===270?-St:St),yt<ut.bounds.x+ut.bounds.width/2?yt=ut.bounds.x-this.kc/2:yt=ut.bounds.right+this.kc/2,y.m(Lt++,Dt,ct),y.m(Lt++,yt,ct)),y.m(Lt++,yt,qt)),y.m(Lt++,Yt,qt)):mt?(Vt=Math.max(10,this.he[ut.layer]),ae=Math.max(10,this.Ld[ut.layer]),this.K===180&&Yt>=ut.bounds.x?(ct=ut.bounds.x+ut.bounds.width,y.L(Lt-2,ct,Gt),y.L(Lt-1,ct+ae,Gt)):this.K===90&&qt<=ut.bounds.bottom?(ct=ut.bounds.y,y.L(Lt-2,Dt,ct),y.L(Lt-1,Dt,ct-Vt)):this.K===270&&qt>=ut.bounds.y?(ct=ut.bounds.y+ut.bounds.height,y.L(Lt-2,Dt,ct),y.L(Lt-1,Dt,ct+ae)):this.K===0&&Yt<=ut.bounds.right&&(ct=ut.bounds.x,y.L(Lt-2,ct,Gt),y.L(Lt-1,ct-Vt,Gt))):(Vt=Math.max(10,this.he[ut.layer]),ae=Math.max(10,this.Ld[ut.layer]),yt=0,this.K===180||this.K===0?((this.K===180?Yt<=ut.bounds.x:Yt>=ut.bounds.right)&&(yt=(this.K===0?ae:-Vt)/2),y.m(Lt++,Yt+yt,Gt)):((this.K===270?qt<=ut.bounds.y:qt>=ut.bounds.bottom)&&(yt=(this.K===90?ae:-Vt)/2),y.m(Lt++,Dt,qt+yt)),y.m(Lt++,Yt,qt)))}else{for(;ut!==null&&ut!==ct;){for(Vt=Ot=null,ut=ut.destinationEdges.iterator;ut.next()&&(Dt=ut.value,Dt.link!==x.link||(Ot=Dt.toVertex,Vt=Dt.fromVertex,Vt.node!==null&&(Vt=null),Ot.node!==null)););if(Ot===null)break;Ot!==ct&&(Dt=y.i(Lt-1).x,Gt=y.i(Lt-1).y,Yt=Ot.centerX,qt=Ot.centerY,yt?this.K===180||this.K===0?(Vt!==null?Vt.centerY:Gt)!==qt&&(Vt=this.Ta[Ot.layer]+this.Rf.x,Lt===y.firstPickIndex+1&&(Vt=this.K===0?Math.max(Vt,Dt):Math.min(Vt,Dt)),y.m(Lt++,Vt,Gt),y.m(Lt++,Vt,qt)):(Vt!==null?Vt.centerX:Dt)!==Yt&&(Vt=this.Ta[Ot.layer]+this.Rf.y,Lt===y.firstPickIndex+1&&(Vt=this.K===90?Math.max(Vt,Gt):Math.min(Vt,Gt)),y.m(Lt++,Dt,Vt),y.m(Lt++,Yt,Vt)):(Vt=Math.max(10,this.he[Ot.layer]),ae=Math.max(10,this.Ld[Ot.layer]),mt?this.K===180?(y.m(Lt++,Yt+ae+St,qt),y.m(Lt++,Math.max(Yt+ae-St/2,Yt),qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Math.min(Yt-Vt+St/2,Yt),qt),y.m(Lt++,Yt-Vt-St,qt)):this.K===90?(y.m(Lt++,Yt,qt-Vt-St),y.m(Lt++,Yt,Math.min(qt-Vt+St/2,qt)),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,Math.max(qt+ae-St/2,qt)),y.m(Lt++,Yt,qt+ae+St)):this.K===270?(y.m(Lt++,Yt,qt+ae+St),y.m(Lt++,Yt,Math.max(qt+ae-St/2,qt)),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,Math.min(qt-Vt+St/2,qt)),y.m(Lt++,Yt,qt-Vt-St)):(y.m(Lt++,Yt-Vt-St,qt),y.m(Lt++,Math.min(Yt-Vt+St/2,Yt),qt),y.m(Lt++,Yt,qt),y.m(Lt++,Yt,qt),y.m(Lt++,Math.max(Yt+ae-St/2,Yt),qt),y.m(Lt++,Yt+ae+St,qt)):this.K===180?(y.m(Lt++,Yt+ae,qt),y.m(Lt++,Yt-Vt,qt)):this.K===90?(y.m(Lt++,Yt,qt-Vt),y.m(Lt++,Yt,qt+ae)):this.K===270?(y.m(Lt++,Yt,qt+ae),y.m(Lt++,Yt,qt-Vt)):(y.m(Lt++,Yt-Vt,qt),y.m(Lt++,Yt+ae,qt)))),ut=Ot}yt&&(Dt=y.i(Lt-1).x,Gt=y.i(Lt-1).y,Yt=y.i(Lt).x,qt=y.i(Lt).y,this.K===180||this.K===0?Gt!==qt&&(Vt=this.K===0?Math.min(Math.max((Yt+Dt)/2,this.Ta[ct.layer]+this.Rf.x),Yt):Math.max(Math.min((Yt+Dt)/2,this.Ta[ct.layer]+this.Rf.x),Yt),y.m(Lt++,Vt,Gt),y.m(Lt++,Vt,qt)):Dt!==Yt&&(Vt=this.K===90?Math.min(Math.max((qt+Gt)/2,this.Ta[ct.layer]+this.Rf.y),qt):Math.max(Math.min((qt+Gt)/2,this.Ta[ct.layer]+this.Rf.y),qt),y.m(Lt++,Dt,Vt),y.m(Lt++,Yt,Vt)))}b!==null&&mt&&4<=y.pointsCount&&(tt!==null&&(tt=at===us?y.getLinkPointFromPoint(E,tt,tt.ga(Xi),y.i(3),!0):y.i(0),at===us&&(at=y.i(2),b=y.i(3),this.direction===90||this.direction===270?(y.L(1,(tt.x+at.x)/2,at.y),y.L(2,b.x,(at.y+b.y)/2)):(y.L(1,at.x,(tt.y+at.y)/2),y.L(2,(at.x+b.x)/2,b.y))),tt.w()||tt.set(E.actualBounds.center),y.L(0,tt.x,tt.y)),rt!==null&&(E=ot===us?y.getLinkPointFromPoint(z,rt,rt.ga(Xi),y.i(y.pointsCount-4),!1):y.i(y.pointsCount-1),ot===us&&(rt=y.i(y.pointsCount-3),ot=y.i(y.pointsCount-4),this.direction===90||this.direction===270?(y.L(y.pointsCount-2,(E.x+rt.x)/2,rt.y),y.L(y.pointsCount-2,ot.x,(rt.y+ot.y)/2)):(y.L(y.pointsCount-2,rt.x,(E.y+rt.y)/2),y.L(y.pointsCount-3,(rt.x+ot.x)/2,ot.y))),E.w()||E.set(z.actualBounds.center),y.L(y.pointsCount-1,E.x,E.y))),y.zf(),x.commit()}}}this.avoidOrthogonalOverlaps()},or.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new Ve,y=this.network.edges.iterator;y.next();){var x=y.value.link;x!==null&&x.isOrthogonal&&!a.contains(x)&&a.add(x)}if(0<a.count)if(this.K===90||this.K===270){for(y=0,x=[],a=a.iterator;a.next();){var b=a.value;if(b!==null&&b.isOrthogonal)for(var E=2;E<b.pointsCount-3;E++){var z=b.i(E),tt=b.i(E+1);if(this.B(z.y,tt.y)&&!this.B(z.x,tt.x)){var rt=new mf;rt.layer=Math.floor(z.y/2);var ot=b.i(0),at=b.i(b.pointsCount-1);if(rt.first=ot.x*ot.x+ot.y,rt.jc=at.x*at.x+at.y,rt.rd=Math.min(z.x,tt.x),rt.Ic=Math.max(z.x,tt.x),rt.index=E,rt.link=b,E+2<b.pointsCount){ot=b.i(E-1),at=b.i(E+2);var ut=0;ot.y<z.y?ut=at.y<z.y?3:z.x<tt.x?2:1:ot.y>z.y&&(ut=at.y>z.y?0:tt.x<z.x?2:1),rt.j=ut}x.push(rt)}}}if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,b=a+1;b<x.length&&x[b].layer===z;)b++;if(1<b-a)for(z=a;z<b;){for(tt=x[z].Ic,E=a+1;E<b&&x[E].rd<tt;)tt=Math.max(tt,x[E].Ic),E++;if(tt=E-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<E;ot++)at=x[ot],at.jc!==rt&&(ut++,rt=at.jc);this.zi(x,this.Ux,z,z+tt);var ct=1;for(rt=x[z].first,ot=z;ot<E;ot++)at=x[ot],at.first!==rt&&(ct++,rt=at.first);for(ot=!0,at=ct,ut<ct?(ot=!1,at=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ct=z;ct<E;ct++){var mt=x[ct];(ot?mt.first:mt.jc)!==rt&&(ut++,rt=ot?mt.first:mt.jc);var yt=mt.link;z=yt.i(mt.index),tt=yt.i(mt.index+1);var St=this.linkSpacing*(ut-(at-1)/2);y++,yt.uh(),yt.L(mt.index,z.x,z.y+St),yt.L(mt.index+1,tt.x,tt.y+St),yt.zf()}}z=E}a=b}}else{for(y=0,x=[],a=a.iterator;a.next();)if(b=a.value,b!==null&&b.isOrthogonal)for(E=2;E<b.pointsCount-3;E++)z=b.i(E),tt=b.i(E+1),this.B(z.x,tt.x)&&!this.B(z.y,tt.y)&&(rt=new mf,rt.layer=Math.floor(z.x/2),ot=b.i(0),at=b.i(b.pointsCount-1),rt.first=ot.x+ot.y*ot.y,rt.jc=at.x+at.y*at.y,rt.rd=Math.min(z.y,tt.y),rt.Ic=Math.max(z.y,tt.y),rt.index=E,rt.link=b,E+2<b.pointsCount&&(ot=b.i(E-1),at=b.i(E+2),ut=0,ot.x<z.x?ut=at.x<z.x?3:z.y<tt.y?2:1:ot.x>z.x&&(ut=at.x>z.x?0:tt.y<z.y?2:1),rt.j=ut),x.push(rt));if(1<x.length)for(x.sort(this.Vx),a=0;a<x.length;){for(z=x[a].layer,b=a+1;b<x.length&&x[b].layer===z;)b++;if(1<b-a)for(z=a;z<b;){for(tt=x[z].Ic,E=a+1;E<b&&x[E].rd<tt;)tt=Math.max(tt,x[E].Ic),E++;if(tt=E-z,1<tt){for(this.zi(x,this.Js,z,z+tt),ut=1,rt=x[z].jc,ot=z;ot<E;ot++)at=x[ot],at.jc!==rt&&(ut++,rt=at.jc);for(this.zi(x,this.Ux,z,z+tt),ct=1,rt=x[z].first,ot=z;ot<E;ot++)at=x[ot],at.first!==rt&&(ct++,rt=at.first);for(ot=!0,at=ct,ut<ct?(ot=!1,at=ut,rt=x[z].jc,this.zi(x,this.Js,z,z+tt)):rt=x[z].first,ut=0,ct=z;ct<E;ct++)mt=x[ct],(ot?mt.first:mt.jc)!==rt&&(ut++,rt=ot?mt.first:mt.jc),yt=mt.link,z=yt.i(mt.index),tt=yt.i(mt.index+1),St=this.linkSpacing*(ut-(at-1)/2),y++,yt.uh(),yt.L(mt.index,z.x+St,z.y),yt.L(mt.index+1,tt.x+St,tt.y),yt.zf()}z=E}a=b}}}},xt=or.prototype,xt.Vx=function(a,y){return a instanceof mf&&y instanceof mf&&a!==y?a.layer<y.layer?-1:a.layer>y.layer?1:a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},xt.Ux=function(a,y){return a instanceof mf&&y instanceof mf&&a!==y?a.first<y.first?-1:a.first>y.first||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},xt.Js=function(a,y){return a instanceof mf&&y instanceof mf&&a!==y?a.jc<y.jc?-1:a.jc>y.jc||a.j<y.j?1:a.j>y.j||a.rd<y.rd?-1:a.rd>y.rd?1:a.Ic<y.Ic?-1:a.Ic>y.Ic?1:0:0},xt.B=function(a,y){return a-=y,-1<a&&1>a},xt.zi=function(a,y,x,b){var E=a.length,z=b-x;if(!(1>=z))if((0>x||x>=E-1)&&fe("not in range 0 <= from < length: "+x),z===2)b=a[x],E=a[x+1],0<y(b,E)&&(a[x]=E,a[x+1]=b);else if(x===0)if(b>=E)a.sort(y);else for(x=a.slice(0,b),x.sort(y),y=0;y<b;y++)a[y]=x[y];else if(b>=E)for(b=a.slice(x),b.sort(y),y=x;y<E;y++)a[y]=b[y-x];else for(E=a.slice(x,b),E.sort(y),y=x;y<b;y++)a[y]=E[y-x]};function gf(a,y){var x=a.tc[y];if(x>=a.He.length){for(var b=[],E=0;E<a.He.length;E++)b[E]=a.He[E];a.He=b}for(a.He[x]===void 0||a.He[x]===null?b=[]:(b=a.He[x],a.He[x]=null),a=a.fl[y],y=0;y<a.length;y++)x=a[y],b[x.index]=x;return b}function pf(a,y,x){a.He[a.tc[y]]=x}Oe.Object.defineProperties(or.prototype,{layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&0<=a&&(this.ie=a,this.C())}},columnSpacing:{get:function(){return this.kc},set:function(a){this.kc!==a&&0<a&&(this.kc=a,this.C())}},direction:{get:function(){return this.K},set:function(a){this.K!==a&&(a===0||a===90||a===180||a===270?(this.K=a,this.C()):fe("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{get:function(){return this.Dk},set:function(a){this.Dk===a||a!==Sy&&a!==F0&&a!==Wp||(this.Dk=a,this.C())}},layeringOption:{get:function(){return this.Zk},set:function(a){this.Zk===a||a!==T0&&a!==xy&&a!==Py||(this.Zk=a,this.C())}},initializeOption:{get:function(){return this.Qk},set:function(a){this.Qk===a||a!==N0&&a!==wy&&a!==Cy||(this.Qk=a,this.C())}},iterations:{get:function(){return this.bj},set:function(a){this.bj!==a&&0<=a&&(this.bj=a,this.C())}},aggressiveOption:{get:function(){return this.rk},set:function(a){this.rk===a||a!==Ly&&a!==D0&&a!==My||(this.rk=a,this.C())}},packOption:{get:function(){return this.bg},set:function(a){this.bg!==a&&0<=a&&8>a&&(this.bg=a,this.C())}},alignOption:{get:function(){return this.ve},set:function(a){this.ve!==a&&0<=a&&16>a&&(this.ve=a,this.C())}},setsPortSpots:{get:function(){return this.sf},set:function(a){this.sf!==a&&(this.sf=a,this.C())}},linkSpacing:{get:function(){return this.Cn},set:function(a){this.Cn!==a&&0<=a&&(this.Cn=a,this.C())}},maxLayer:{get:function(){return this.Ia}},maxIndex:{get:function(){return this.Iq}},maxColumn:{get:function(){return this.Ra}},minIndexLayer:{get:function(){return this.Hn}},maxIndexLayer:{get:function(){return this.Md}}});var F0=new me(or,"CycleDepthFirst",0),Sy=new me(or,"CycleGreedy",1),Wp=new me(or,"CycleFromLayers",2),T0=new me(or,"LayerOptimalLinkLength",0),xy=new me(or,"LayerLongestPathSink",1),Py=new me(or,"LayerLongestPathSource",2),N0=new me(or,"InitDepthFirstOut",0),wy=new me(or,"InitDepthFirstIn",1),Cy=new me(or,"InitNaive",2),Ly=new me(or,"AggressiveNone",0),D0=new me(or,"AggressiveLess",1),My=new me(or,"AggressiveMore",2),Yx=8;or.className="LayeredDigraphLayout",or.CycleDepthFirst=F0,or.CycleGreedy=Sy,or.CycleFromLayers=Wp,or.LayerOptimalLinkLength=T0,or.LayerLongestPathSink=xy,or.LayerLongestPathSource=Py,or.InitDepthFirstOut=N0,or.InitDepthFirstIn=wy,or.InitNaive=Cy,or.AggressiveNone=Ly,or.AggressiveLess=D0,or.AggressiveMore=My,or.PackNone=0,or.PackExpand=1,or.PackStraighten=2,or.PackMedian=4,or.PackAll=15,or.AlignNone=0,or.AlignUpperLeft=1,or.AlignUpperRight=2,or.AlignLowerLeft=4,or.AlignLowerRight=8,or.AlignAll=15;function mf(){this.index=this.Ic=this.rd=this.jc=this.first=this.layer=0,this.link=null,this.j=0}mf.className="SegInfo";function Og(a){kr.call(this,a)}le(Og,kr),Og.prototype.createVertex=function(){return new Kl(this)},Og.prototype.createEdge=function(){return new Up(this)},Og.className="LayeredDigraphNetwork";function Kl(a){ns.call(this,a),this.$n=this.bo=this.ao=this.co=null,this.Za=this.Ag=this.Ig=-1,this.u=NaN,this.F=null,this.valid=!1,this.finish=this.Ll=NaN,this.Dj=0,this.dv=this.ev=null}le(Kl,ns);function ix(a,y){return a.index-y.index}function A0(a,y){if(!a.$n){for(var x=[],b=mn(a.destinationEdgesArrayAccess),E=b.next();!E.done;E=b.next())E=E.value,E.valid&&x.push(E);a.$n=x}for(a=mn(a.$n),x=a.next();!x.done;x=a.next())if(x=x.value,x.toVertex===y)return x;fe("Unable to find destination edge to given vertex")}function ky(a){if(!a.co){for(var y=[],x=mn(a.sourceEdgesArrayAccess),b=x.next();!b.done;b=x.next())b=b.value,b.valid&&y.push(b.fromVertex);y.sort(ix),a.co=y}return a.co}function Xx(a){if(!a.ao){for(var y=[],x=mn(a.destinationEdgesArrayAccess),b=x.next();!b.done;b=x.next())b=b.value,b.valid&&y.push(b.toVertex);y.sort(ix),a.ao=y}return a.ao}Kl.prototype.Cl=function(a){ns.prototype.Cl.call(this,a),this.bo=this.co=null},Kl.prototype.Kl=function(a){ns.prototype.Kl.call(this,a),this.bo=this.co=null},Kl.prototype.zl=function(a){ns.prototype.zl.call(this,a),this.$n=this.ao=null},Kl.prototype.Jl=function(a){ns.prototype.Jl.call(this,a),this.$n=this.ao=null},Oe.Object.defineProperties(Kl.prototype,{layer:{get:function(){return this.Ig},set:function(a){this.Ig!==a&&(this.Ig=a)}},column:{get:function(){return this.Ag},set:function(a){this.Ag!==a&&(this.Ag=a)}},index:{get:function(){return this.Za},set:function(a){this.Za!==a&&(this.Za=a)}},component:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},near:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),Kl.prototype.deleteDestinationEdge=Kl.prototype.Jl,Kl.prototype.addDestinationEdge=Kl.prototype.zl,Kl.prototype.deleteSourceEdge=Kl.prototype.Kl,Kl.prototype.addSourceEdge=Kl.prototype.Cl,Kl.className="LayeredDigraphVertex";function Up(a){vl.call(this,a),this.j=this.ia=this.Ha=!1,this.V=this.u=NaN,this.F=this.o=0}le(Up,vl),Oe.Object.defineProperties(Up.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},valid:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},rev:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},forest:{get:function(){return this.j},set:function(a){this.j!==a&&(this.j=a)}},portFromPos:{get:function(){return this.u},set:function(a){this.u!==a&&(this.u=a)}},portToPos:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},portFromColOffset:{get:function(){return this.o},set:function(a){this.o!==a&&(this.o=a)}},portToColOffset:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}}}),Up.className="LayeredDigraphEdge";function mi(a){Zr.call(this),this.Ub=new Ye,this.Wn=R0,this.ud=Th,this.vo=z0,this.Bq=Ry,this.$v=[],this.td=!0,this.Rb=G0,this.$d=new Ze(10,10).freeze();var y=new Hc(this);this.W=new su(y),this.Y=new su(y),this.ru=[],a&&Object.assign(this,a)}le(mi,Zr),mi.prototype.cloneProtected=function(a){Zr.prototype.cloneProtected.call(this,a),a.Wn=this.Wn,a.vo=this.vo,a.Bq=this.Bq,a.td=this.td,a.Rb=this.Rb,a.$d.assign(this.$d),a.W.copyInheritedPropertiesFrom(this.W),a.Y.copyInheritedPropertiesFrom(this.Y)},mi.prototype.qb=function(a){a.classType===mi?a.name.indexOf("Alignment")===0?this.alignment=a:a.name.indexOf("Arrangement")===0?this.arrangement=a:a.name.indexOf("Compaction")===0?this.compaction=a:a.name.indexOf("Path")===0?this.path=a:a.name.indexOf("Sorting")===0?this.sorting=a:a.name.indexOf("Style")===0?this.treeStyle=a:fe("Unknown enum value: "+a):Zr.prototype.qb.call(this,a)},mi.prototype.createNetwork=function(){return new Hc(this)},mi.prototype.makeNetwork=function(a){function y(b){if(b instanceof $e)return!b.isLinkLabel&&b.category!=="Comment";if(b instanceof _e){var E=b.fromNode;return E===null||E.isLinkLabel||E.category==="Comment"?!1:(b=b.toNode,!(b===null||b.isLinkLabel||b.category==="Comment"))}return!1}var x=this.createNetwork();return a instanceof se?(x.lg(a.nodes,!0,y),x.lg(a.links,!0,y)):a instanceof Yn?x.lg(a.memberParts,!1,y):x.lg(a.iterator,!1,y),x},mi.prototype.doLayout=function(a){this.network===null&&(this.network=this.makeNetwork(a)),this.arrangement!==_0&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var y=this.diagram;if(y===null&&a instanceof se&&(y=a),this.path===R0&&y!==null?this.ud=y.isTreePathToChildren?Th:Gc:this.ud=this.path===R0?Th:this.path,0<this.network.vertexes.count){for(this.network.Ko(),a=this.network.vertexes.iterator;a.next();)y=a.value,y.initialized=!1,y.level=0,y.parent=null,y.children=[];if(0<this.Ub.count){for(a=new Ye,y=this.Ub.iterator;y.next();){var x=y.value;x instanceof $e?(x=this.network.ki(x),x!==null&&a.add(x)):x instanceof su&&a.add(x)}this.Ub=a}for(this.Ub.count===0&&this.findRoots(),a=this.Ub.copy().iterator;a.next();)y=a.value,y.initialized||(y.initialized=!0,by(this,y));for(y=this.network.vertexes,a=null;a=Zx(y),0<a.count;)y=rx(this,a),y!==null&&this.Ub.add(y),y.initialized=!0,by(this,y),y=a;for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof su&&sx(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof su&&ax(this,y);for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof su&&lx(this,y);if(this.Cu(),this.layerStyle===H0){for(a=[],y=this.network.vertexes.iterator;y.next();){x=y.value;var b=x.parent;b===null&&(b=x),b=b.angle===0||b.angle===180;var E=a[x.level];E===void 0&&(E=0),a[x.level]=Math.max(E,b?x.width:x.height)}for(y=0;y<a.length;y++)a[y]===void 0&&(a[y]=0);for(this.$v=a,y=this.network.vertexes.iterator;y.next();)x=y.value,b=x.parent,b===null&&(b=x),b.angle===0||b.angle===180?(b.angle===180&&(x.focusX+=a[x.level]-x.width),x.width=a[x.level]):(b.angle===270&&(x.focusY+=a[x.level]-x.height),x.height=a[x.level])}else if(this.layerStyle===jy)for(a=this.network.vertexes.iterator;a.next();){for(y=a.value,x=y.angle===0||y.angle===180,b=-1,E=0;E<y.children.length;E++){var z=y.children[E];b=Math.max(b,x?z.width:z.height)}if(0<=b)for(E=0;E<y.children.length;E++)z=y.children[E],x?(y.angle===180&&(z.focusX+=b-z.width),z.width=b):(y.angle===270&&(z.focusY+=b-z.height),z.height=b)}for(a=this.Ub.iterator;a.next();)y=a.value,y instanceof su&&this.layoutTree(y);this.arrangeTrees(),this.updateParts()}this.network=null,this.Ub=new Ye,this.isValidLayout=!0};function Zx(a){var y=new Ye;for(a=a.iterator;a.next();){var x=a.value;x.initialized||y.add(x)}return y}mi.prototype.findRoots=function(){for(var a=this.network.vertexes,y=a.iterator;y.next();){var x=y.value;switch(this.ud){case Th:x.sourceEdges.count===0&&this.Ub.add(x);break;case Gc:x.destinationEdges.count===0&&this.Ub.add(x);break;default:fe("Unhandled path value "+this.ud.toString())}}this.Ub.count===0&&(a=rx(this,a),a!==null&&this.Ub.add(a))};function rx(a,y){var x=999999,b=null;for(y=y.iterator;y.next();){var E=y.value;switch(a.ud){case Th:E.sourceEdges.count<x&&(x=E.sourceEdges.count,b=E);break;case Gc:E.destinationEdges.count<x&&(x=E.destinationEdges.count,b=E);break;default:fe("Unhandled path value "+a.ud.toString())}}return b}function by(a,y){if(y!==null){switch(a.ud){case Th:if(0<y.destinationEdges.count){for(var x=new Ve,b=y.destinationVertexes;b.next();){var E=b.value;ox(a,y,E)&&x.add(E)}0<x.count&&(y.children=x.Fa())}break;case Gc:if(0<y.sourceEdges.count){for(x=new Ve,b=y.sourceVertexes;b.next();)E=b.value,ox(a,y,E)&&x.add(E);0<x.count&&(y.children=x.Fa())}break;default:fe("Unhandled path value"+a.ud.toString())}for(x=y.children,b=x.length,E=0;E<b;E++){var z=x[E];z.initialized=!0,z.level=y.level+1,z.parent=y,a.Ub.remove(z)}for(y=0;y<b;y++)by(a,x[y])}}function ox(a,y,x){if(x.initialized){if(y===null)var b=!1;else{for(b=y.parent;b!==null&&b!==x;)b=b.parent;b=b===x}if(b||x.level>y.level)return!1;a.removeChild(x.parent,x)}return!0}mi.prototype.removeChild=function(a,y){if(a!==null&&y!==null){for(var x=a.children,b=0,E=0;E<x.length;E++)x[E]===y&&b++;if(0<b){b=Array(x.length-b);for(var z=E=0;z<x.length;z++)x[z]!==y&&(b[E++]=x[z]);a.children=b}}};function sx(a,y){if(y!==null){a.initializeTreeVertexValues(y),y.alignment===Ah&&a.sortTreeVertexChildren(y);for(var x=0,b=y.childrenCount,E=0,z=y.children,tt=z.length,rt=0;rt<tt;rt++){var ot=z[rt];sx(a,ot),x+=ot.descendantCount+1,b=Math.max(b,ot.maxChildrenCount),E=Math.max(E,ot.maxGenerationCount)}y.descendantCount=x,y.maxChildrenCount=b,y.maxGenerationCount=0<b?E+1:0}}function Jx(a,y){switch(a.vo){default:case z0:return y.parent!==null?y.parent:a.W;case Oy:return y.parent===null?a.W:y.parent.parent===null?a.Y:y.parent;case By:return y.parent!==null?y.parent.parent!==null?y.parent.parent:a.Y:a.W;case Ay:var x=!0;if(y.childrenCount===0)x=!1;else for(var b=y.children,E=b.length,z=0;z<E;z++)if(0<b[z].childrenCount){x=!1;break}return x&&y.parent!==null?a.Y:y.parent!==null?y.parent:a.W}}mi.prototype.initializeTreeVertexValues=function(a){if(a.copyInheritedPropertiesFrom(Jx(this,a)),a.parent!==null&&a.parent.alignment===Ah){for(var y=a.angle,x=a.parent.children,b=0;b<x.length&&a!==x[b];)b++;b%2===0?b!==x.length-1&&(y=y===90?180:y===180?270:y===270?180:270):y=y===90?0:y===180?90:y===270?0:90,a.angle=y}a.initialized=!0};function ax(a,y){if(y!==null){a.assignTreeVertexValues(y),y=y.children;for(var x=y.length,b=0;b<x;b++)ax(a,y[b])}}mi.prototype.assignTreeVertexValues=function(){};function lx(a,y){if(y!==null){y.alignment!==Ah&&a.sortTreeVertexChildren(y),y=y.children;for(var x=y.length,b=0;b<x;b++)lx(a,y[b])}}mi.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Ig:break;case Yp:a.children.reverse();break;case Xp:a.children.sort(a.comparer);break;case Zp:a.children.sort(a.comparer),a.children.reverse();break;default:fe("Unhandled sorting value "+a.sorting.toString())}},mi.prototype.Cu=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)},mi.prototype.addComments=function(a){var y=a.angle,x=a.parent,b=0,E=!1;x!==null&&(b=x.angle,E=x.alignment,E=vf(E)),y=y===90||y===270,b=b===90||b===270,x=a.childrenCount===0;var z=0,tt=0,rt=0,ot=a.commentSpacing;if(a.node!==null)for(var at=a.node.Mu();at.next();){var ut=at.value;ut.category==="Comment"&&ut.canLayout()&&(a.comments===null&&(a.comments=[]),a.comments.push(ut),ut.Va(),ut=ut.measuredBounds,y&&!x||!E&&!b&&x||E&&b&&x?(z=Math.max(z,ut.width),tt+=ut.height+Math.abs(rt)):(z+=ut.width+Math.abs(rt),tt=Math.max(tt,ut.height)),rt=ot)}a.comments!==null&&(y&&!x||!E&&!b&&x||E&&b&&x?(z+=Math.abs(a.commentMargin),tt=Math.max(0,tt-a.height)):(tt+=Math.abs(a.commentMargin),z=Math.max(0,z-a.width)),E=ye.allocAt(0,0,a.bounds.width+z,a.bounds.height+tt),a.bounds=E,ye.free(E))};function vf(a){return a===Ad||a===Ah||a===Bd||a===nd}function Kp(a){return a===Ad||a===Ah}function Ey(a){var y=a.parent;if(y!==null){var x=y.alignment;if(vf(x)){if(Kp(x)){for(y=y.children,x=0;x<y.length&&a!==y[x];)x++;return x%2===0}if(x===Bd)return!0}}return!1}mi.prototype.layoutComments=function(a){if(a.comments!==null){var y=a.node.measuredBounds,x=a.parent,b=a.angle,E=0,z=!1;x!==null&&(E=x.angle,z=x.alignment,z=vf(z)),b=b===90||b===270,x=E===90||E===270;for(var tt=a.childrenCount===0,rt=Ey(a),ot=0,at=a.comments,ut=at.length,ct=jt.alloc(),mt=0;mt<ut;mt++){var yt=at[mt],St=yt.measuredBounds;if(b&&!tt||!z&&!x&&tt||z&&x&&tt){if(135<E&&!z||x&&rt)if(0<=a.commentMargin)for(ct.h(a.bounds.x-a.commentMargin-St.width,a.bounds.y+ot),yt.move(ct),yt=yt.Sd();yt.next();){var Lt=yt.value;Lt.fromSpot=ya,Lt.toSpot=js}else for(ct.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+ot),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=js,Lt.toSpot=ya;else if(0<=a.commentMargin)for(ct.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+ot),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=js,Lt.toSpot=ya;else for(ct.h(a.bounds.x+a.commentMargin-St.width,a.bounds.y+ot),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=ya,Lt.toSpot=js;ot=0<=a.commentSpacing?ot+(St.height+a.commentSpacing):ot+(a.commentSpacing-St.height)}else{if(135<E&&!z||!x&&rt)if(0<=a.commentMargin)for(ct.h(a.bounds.x+ot,a.bounds.y-a.commentMargin-St.height),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=$a,Lt.toSpot=Ks;else for(ct.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y-a.commentMargin),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=Ks,Lt.toSpot=$a;else if(0<=a.commentMargin)for(ct.h(a.bounds.x+ot,a.bounds.y+2*a.focus.y+a.commentMargin),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=Ks,Lt.toSpot=$a;else for(ct.h(a.bounds.x+ot,a.bounds.y+a.commentMargin-St.height),yt.move(ct),yt=yt.Sd();yt.next();)Lt=yt.value,Lt.fromSpot=$a,Lt.toSpot=Ks;ot=0<=a.commentSpacing?ot+(St.width+a.commentSpacing):ot+(a.commentSpacing-St.width)}}if(jt.free(ct),y=ot-a.commentSpacing-(b?y.height:y.width),this.ud===Th)for(a=a.destinationEdges;a.next();)E=a.value.link,E===null||E.isAvoiding||(E.fromEndSegmentLength=0<y?y:NaN);else for(a=a.sourceEdges;a.next();)E=a.value.link,E===null||E.isAvoiding||(E.toEndSegmentLength=0<y?y:NaN)}},mi.prototype.layoutTree=function(a){if(a!==null){for(var y=a.children,x=y.length,b=0;b<x;b++)this.layoutTree(y[b]);switch(a.compaction){case j0:ux(this,a);break;case Jp:if(a.alignment===Ah)ux(this,a);else if(a.childrenCount===0)b=a.parent,x=!1,y=0,b!==null&&(y=b.angle,x=b.alignment,x=vf(x)),b=Ey(a),a.S.h(0,0),a.Da.h(a.width,a.height),a.parent===null||a.comments===null||(y!==180&&y!==270||x)&&!b?a.la.h(0,0):y===180&&!x||(y===90||y===270)&&b?a.la.h(a.width-2*a.focus.x,0):a.la.h(0,a.height-2*a.focus.y),a.Yo=null,a.kp=null;else{var E=Cu(a);y=E===90||E===270;var z=0,tt=a.children,rt=tt.length;for(x=0;x<rt;x++)b=tt[x],z=Math.max(z,y?b.Da.width:b.Da.height);var ot=a.alignment;b=ot===Nh;var at=ot===Dh,ut=vf(ot),ct=Math.max(0,a.breadthLimit);x=this.computeLayerSpacing(a);var mt=a.nodeSpacing,yt=this.computeNodeIndent(a),St=a.rowSpacing,Lt=0;(b||at||a.hm||a.im&&a.maxGenerationCount===1)&&(Lt=Math.max(0,a.rowIndent)),b=a.width;var Ot=a.height,Dt=0,Gt=0,Vt=0,Yt=null,qt=null,ae=0,Je=0,un=0,nn=0,Ge=0,we=0,Un=0,jn=0;if(ut&&!Kp(ot)&&135<E&&tt.reverse(),Kp(ot))if(1<rt)for(var ji=0;ji<rt;ji++)ji%2===0&&ji!==rt-1&&(jn=Math.max(jn,y?tt[ji].Da.width:tt[ji].Da.height));else rt===1&&(jn=y?tt[0].Da.width:tt[0].Da.height);if(ut){switch(ot){case Ad:Gt=135>E?hx(this,a,tt,jn,Dt,Gt):dx(this,a,tt,jn,Dt,Gt),jn=Gt.x,Dt=Gt.width,Gt=Gt.height;break;case Bd:for(Yt=0;Yt<rt;Yt++)qt=tt[Yt],ct=qt.Da,Vt=we===0?0:St,y?(qt.S.h(z-ct.width,nn+Vt),Dt=Math.max(Dt,ct.width),Gt=Math.max(Gt,nn+Vt+ct.height),nn+=Vt+ct.height):(qt.S.h(un+Vt,z-ct.height),Dt=Math.max(Dt,un+Vt+ct.width),Gt=Math.max(Gt,ct.height),un+=Vt+ct.width),we++;break;case nd:for(Yt=0;Yt<rt;Yt++)qt=tt[Yt],z=qt.Da,ct=we===0?0:St,y?(qt.S.h(mt/2+a.focus.x,nn+ct),Dt=Math.max(Dt,z.width),Gt=Math.max(Gt,nn+ct+z.height),nn+=ct+z.height):(qt.S.h(un+ct,mt/2+a.focus.y),Dt=Math.max(Dt,un+ct+z.width),Gt=Math.max(Gt,z.height),un+=ct+z.width),we++}Yt=ol(this,2),qt=ol(this,2),y?(Yt[0].h(0,0),Yt[1].h(0,Gt),qt[0].h(Dt,0)):(Yt[0].h(0,0),Yt[1].h(Dt,0),qt[0].h(0,Gt)),qt[1].h(Dt,Gt)}else for(ji=0;ji<rt;ji++){var Lr=tt[ji],ds=Lr.Da;if(y){0<ct&&0<we&&un+mt+ds.width>ct&&(un<z&&sc(a,ot,z-un,0,Un,ji-1),Ge++,we=0,Un=ji,Vt=Gt,un=0,nn=135<E?-Gt-St:Gt+St),O0(this,Lr,0,nn);var xs=0;if(we===0)Yt=Lr.Yo,qt=Lr.kp,ae=ds.width,Je=ds.height,(Yt===null||qt===null||E!==Cu(Lr))&&(Yt=ol(this,2),qt=ol(this,2),Yt[0].h(0,0),Yt[1].h(0,Je),qt[0].h(ae,0),qt[1].h(ae,Je));else{var ca=Kn();Je=fx(this,a,Lr,Yt,qt,ae,Je,ca),xs=Je.x,Yt=ca[0],qt=ca[1],ae=Je.width,Je=Je.height,zn(ca),un<ds.width&&0>xs&&(zc(a,-xs,0,Un,ji-1),I0(Yt,-xs,0),I0(qt,-xs,0),xs=0)}Lr.S.h(xs,nn),Dt=Math.max(Dt,ae),Gt=Math.max(Gt,Vt+(Ge===0?0:St)+ds.height),un=ae}else 0<ct&&0<we&&nn+mt+ds.height>ct&&(nn<z&&sc(a,ot,0,z-nn,Un,ji-1),Ge++,we=0,Un=ji,Vt=Dt,nn=0,un=135<E?-Dt-St:Dt+St),O0(this,Lr,un,0),xs=0,we===0?(Yt=Lr.Yo,qt=Lr.kp,ae=ds.width,Je=ds.height,(Yt===null||qt===null||E!==Cu(Lr))&&(Yt=ol(this,2),qt=ol(this,2),Yt[0].h(0,0),Yt[1].h(ae,0),qt[0].h(0,Je),qt[1].h(ae,Je))):(ca=Kn(),Je=fx(this,a,Lr,Yt,qt,ae,Je,ca),xs=Je.x,Yt=ca[0],qt=ca[1],ae=Je.width,Je=Je.height,zn(ca),nn<ds.height&&0>xs&&(zc(a,0,-xs,Un,ji-1),I0(Yt,0,-xs),I0(qt,0,-xs),xs=0)),Lr.S.h(un,xs),Gt=Math.max(Gt,Je),Dt=Math.max(Dt,Vt+(Ge===0?0:St)+ds.width),nn=Je;we++}switch(0<Ge&&(y?(Gt+=Math.max(0,x),un<Dt&&sc(a,ot,Dt-un,0,Un,rt-1),0<Lt&&(at||zc(a,Lt,0,0,rt-1),Dt+=Lt)):(Dt+=Math.max(0,x),nn<Gt&&sc(a,ot,0,Gt-nn,Un,rt-1),0<Lt&&(at||zc(a,0,Lt,0,rt-1),Gt+=Lt))),Lt=at=0,ot){case Rg:y?at+=Dt/2-a.focus.x-yt/2:Lt+=Gt/2-a.focus.y-yt/2;break;case _c:0<Ge?y?at+=Dt/2-a.focus.x-yt/2:Lt+=Gt/2-a.focus.y-yt/2:y?(jn=tt[0].S.x+tt[0].la.x,at+=jn+(tt[rt-1].S.x+tt[rt-1].la.x+2*tt[rt-1].focus.x-jn)/2-a.focus.x-yt/2):(jn=tt[0].S.y+tt[0].la.y,Lt+=jn+(tt[rt-1].S.y+tt[rt-1].la.y+2*tt[rt-1].focus.y-jn)/2-a.focus.y-yt/2);break;case Nh:y?(at-=yt,Dt+=yt):(Lt-=yt,Gt+=yt);break;case Dh:y?(at+=Dt-a.width+yt,Dt+=yt):(Lt+=Gt-a.height+yt,Gt+=yt);break;case Ad:y?1<rt?at+=jn+mt/2-a.focus.x:at+=tt[0].focus.x-a.focus.x+tt[0].la.x:1<rt?Lt+=jn+mt/2-a.focus.y:Lt+=tt[0].focus.y-a.focus.y+tt[0].la.y;break;case Bd:y?at+=Dt+mt/2-a.focus.x:Lt+=Gt+mt/2-a.focus.y;break;case nd:break;default:Gt=this.customAlignment(a,at,Lt,Dt,Gt),at=Gt[0],Lt=Gt[1],Dt=Gt[2],Gt=Gt[3]}for(yt=0;yt<rt;yt++)jn=tt[yt],y?jn.S.h(jn.S.x+jn.la.x-at,jn.S.y+(135<E?(ut?-Gt:-jn.Da.height)+jn.la.y-x:Ot+x+jn.la.y)):jn.S.h(jn.S.x+(135<E?(ut?-Dt:-jn.Da.width)+jn.la.x-x:b+x+jn.la.x),jn.S.y+jn.la.y-Lt);if(rt=tt=0,ut?y?(Dt=Fy(a,Dt,at),0>at&&(at=0),135<E&&(Lt+=Gt+x),Gt+=Ot+x,ot===nd&&(tt+=mt/2+a.focus.x),rt+=Ot+x):(135<E&&(at+=Dt+x),Dt+=b+x,Gt=Ty(a,Gt,Lt),0>Lt&&(Lt=0),ot===nd&&(rt+=mt/2+a.focus.y),tt+=b+x):y?(a.comments===null?b>Dt&&(Dt=Ny(ot,b-Dt,0),tt=Dt.x,rt=Dt.y,Dt=b,at=0):Dt=Fy(a,Dt,at),0>at&&(tt-=at,at=0),135<E&&(Lt+=Gt+x),Gt=Math.max(Math.max(Gt,Ot),Gt+Ot+x),rt+=Ot+x):(135<E&&(at+=Dt+x),Dt=Math.max(Math.max(Dt,b),Dt+b+x),a.comments===null?Ot>Gt&&(Gt=Ny(ot,0,Ot-Gt),tt=Gt.x,rt=Gt.y,Gt=Ot,Lt=0):Gt=Ty(a,Gt,Lt),0>Lt&&(rt-=Lt,Lt=0),tt+=b+x),0<Ge)E=ol(this,4),Ge=ol(this,4),y?(E[2].h(0,Ot+x),E[3].h(E[2].x,Gt),Ge[2].h(Dt,E[2].y),Ge[3].h(Ge[2].x,E[3].y)):(E[2].h(b+x,0),E[3].h(Dt,E[2].y),Ge[2].h(E[2].x,Gt),Ge[3].h(E[3].x,Ge[2].y));else{for(E=ol(this,Yt.length+2),Ge=ol(this,qt.length+2),ot=0;ot<Yt.length;ot++)ut=Yt[ot],E[ot+2].h(ut.x+tt,ut.y+rt);for(ot=0;ot<qt.length;ot++)ut=qt[ot],Ge[ot+2].h(ut.x+tt,ut.y+rt)}y?(E[0].h(at,0),E[1].h(E[0].x,Ot),E[2].y<E[1].y&&(E[2].x>E[0].x?E[2].assign(E[1]):E[1].assign(E[2])),E[3].y<E[2].y&&(E[3].x>E[0].x?E[3].assign(E[2]):E[2].assign(E[3])),Ge[0].h(at+b,0),Ge[1].h(Ge[0].x,Ot),Ge[2].y<Ge[1].y&&(Ge[2].x<Ge[0].x?Ge[2].assign(Ge[1]):Ge[1].assign(Ge[2])),Ge[3].y<Ge[2].y&&(Ge[3].x<Ge[0].x?Ge[3].assign(Ge[2]):Ge[2].assign(Ge[3])),E[2].y-=x/2,Ge[2].y-=x/2):(E[0].h(0,Lt),E[1].h(b,E[0].y),E[2].x<E[1].x&&(E[2].y>E[0].y?E[2].assign(E[1]):E[1].assign(E[2])),E[3].x<E[2].x&&(E[3].y>E[0].y?E[3].assign(E[2]):E[2].assign(E[3])),Ge[0].h(0,Lt+Ot),Ge[1].h(b,Ge[0].y),Ge[2].x<Ge[1].x&&(Ge[2].y<Ge[0].y?Ge[2].assign(Ge[1]):Ge[1].assign(Ge[2])),Ge[3].x<Ge[2].x&&(Ge[3].y<Ge[0].y?Ge[3].assign(Ge[2]):Ge[2].assign(Ge[3])),E[2].x-=x/2,Ge[2].x-=x/2),Hu(this,Yt),Hu(this,qt),a.Yo=E,a.kp=Ge,a.la.h(at,Lt),a.Da.h(Dt,Gt)}break;default:fe("Unhandled compaction value "+a.compaction.toString())}}};function ux(a,y){if(y.childrenCount===0){var x=!1,b=0;y.parent!==null&&(b=y.parent.angle,x=y.parent.alignment,x=vf(x));var E=Ey(y);y.S.h(0,0),y.Da.h(y.width,y.height),y.parent===null||y.comments===null||(b!==180&&b!==270||x)&&!E?y.la.h(0,0):b===180&&!x||(b===90||b===270)&&E?y.la.h(y.width-2*y.focus.x,0):y.la.h(0,y.height-2*y.focus.y)}else{b=Cu(y),x=b===90||b===270;var z=0;E=y.children;for(var tt=E.length,rt=0;rt<tt;rt++){var ot=E[rt];z=Math.max(z,x?ot.Da.width:ot.Da.height)}var at=y.alignment,ut=at===Nh,ct=at===Dh;rt=vf(at);var mt=Math.max(0,y.breadthLimit);ot=a.computeLayerSpacing(y);var yt=y.nodeSpacing,St=a.computeNodeIndent(y),Lt=ut||ct?0:St/2,Ot=y.rowSpacing,Dt=0;(ut||ct||y.hm||y.im&&y.maxGenerationCount===1)&&(Dt=Math.max(0,y.rowIndent)),ut=y.width;var Gt=y.height,Vt=0,Yt=0,qt=0,ae=0,Je=0,un=0,nn=0,Ge=0,we=0,Un=0;if(rt&&!Kp(at)&&135<b&&E.reverse(),Kp(at))if(1<tt)for(var jn=0;jn<tt;jn++){var ji=E[jn],Lr=ji.Da;jn%2===0&&jn!==tt-1?we=Math.max(we,(x?Lr.width:Lr.height)+a.computeBusNodeSpacing(ji)-yt):jn%2!==0&&(Un=Math.max(Un,(x?Lr.width:Lr.height)+a.computeBusNodeSpacing(ji)-yt))}else tt===1&&(we=x?E[0].Da.width:E[0].Da.height);if(rt)switch(at){case Ad:case Ah:Yt=135>b?hx(a,y,E,we,Vt,Yt):dx(a,y,E,we,Vt,Yt),we=Yt.x,Vt=Yt.width,Yt=Yt.height;break;case Bd:for(mt=0;mt<tt;mt++)Lt=E[mt],qt=Lt.Da,Un=nn===0?0:Ot,x?(Lt.S.h(z-qt.width,Je+Un),Vt=Math.max(Vt,qt.width),Yt=Math.max(Yt,Je+Un+qt.height),Je+=Un+qt.height):(Lt.S.h(ae+Un,z-qt.height),Vt=Math.max(Vt,ae+Un+qt.width),Yt=Math.max(Yt,qt.height),ae+=Un+qt.width),nn++;break;case nd:for(z=0;z<tt;z++)mt=E[z],Lt=mt.Da,qt=nn===0?0:Ot,x?(mt.S.h(yt/2+y.focus.x,Je+qt),Vt=Math.max(Vt,Lt.width),Yt=Math.max(Yt,Je+qt+Lt.height),Je+=qt+Lt.height):(mt.S.h(ae+qt,yt/2+y.focus.y),Vt=Math.max(Vt,ae+qt+Lt.width),Yt=Math.max(Yt,Lt.height),ae+=qt+Lt.width),nn++}else for(Un=0;Un<tt;Un++)jn=E[Un],ji=jn.Da,x?(0<mt&&0<nn&&ae+yt+ji.width>mt&&(ae<z&&sc(y,at,z-ae,0,Ge,Un-1),un++,nn=0,Ge=Un,qt=Yt,ae=0,Je=135<b?-Yt-Ot:Yt+Ot),Lr=nn===0?Lt:yt,O0(a,jn,0,Je),jn.S.h(ae+Lr,Je),Vt=Math.max(Vt,ae+Lr+ji.width),Yt=Math.max(Yt,qt+(un===0?0:Ot)+ji.height),ae+=Lr+ji.width):(0<mt&&0<nn&&Je+yt+ji.height>mt&&(Je<z&&sc(y,at,0,z-Je,Ge,Un-1),un++,nn=0,Ge=Un,qt=Vt,Je=0,ae=135<b?-Vt-Ot:Vt+Ot),Lr=nn===0?Lt:yt,O0(a,jn,ae,0),jn.S.h(ae,Je+Lr),Yt=Math.max(Yt,Je+Lr+ji.height),Vt=Math.max(Vt,qt+(un===0?0:Ot)+ji.width),Je+=Lr+ji.height),nn++;switch(0<un&&(x?(Yt+=Math.max(0,ot),ae<Vt&&sc(y,at,Vt-ae,0,Ge,tt-1),0<Dt&&(ct||zc(y,Dt,0,0,tt-1),Vt+=Dt)):(Vt+=Math.max(0,ot),Je<Yt&&sc(y,at,0,Yt-Je,Ge,tt-1),0<Dt&&(ct||zc(y,0,Dt,0,tt-1),Yt+=Dt))),Dt=ct=0,at){case Rg:x?ct+=Vt/2-y.focus.x-St/2:Dt+=Yt/2-y.focus.y-St/2;break;case _c:0<un?x?ct+=Vt/2-y.focus.x-St/2:Dt+=Yt/2-y.focus.y-St/2:x?(a=E[0].S.x+E[0].la.x,ct+=a+(E[tt-1].S.x+E[tt-1].la.x+2*E[tt-1].focus.x-a)/2-y.focus.x-St/2):(a=E[0].S.y+E[0].la.y,Dt+=a+(E[tt-1].S.y+E[tt-1].la.y+2*E[tt-1].focus.y-a)/2-y.focus.y-St/2);break;case Nh:x?(ct-=St,Vt+=St):(Dt-=St,Yt+=St);break;case Dh:x?(ct+=Vt-y.width+St,Vt+=St):(Dt+=Yt-y.height+St,Yt+=St);break;case Ad:case Ah:x?1<tt?ct+=we+yt/2-y.focus.x:ct+=E[0].focus.x-y.focus.x+E[0].la.x:1<tt?Dt+=we+yt/2-y.focus.y:Dt+=E[0].focus.y-y.focus.y+E[0].la.y;break;case Bd:x?ct+=Vt+yt/2-y.focus.x:Dt+=Yt+yt/2-y.focus.y;break;case nd:break;default:a=a.customAlignment(y,ct,Dt,Vt,Yt),ct=a[0],Dt=a[1],Vt=a[2],Yt=a[3]}for(a=0;a<tt;a++)St=E[a],x?St.S.h(St.S.x+St.la.x-ct,St.S.y+(135<b?(rt?-Yt:-St.Da.height)+St.la.y-ot:Gt+ot+St.la.y)):St.S.h(St.S.x+(135<b?(rt?-Vt:-St.Da.width)+St.la.x-ot:ut+ot+St.la.x),St.S.y+St.la.y-Dt);x?(Vt=Fy(y,Vt,ct),0>ct&&(ct=0),135<b&&(Dt+=Yt+ot),Yt=Math.max(Math.max(Yt,Gt),Yt+Gt+ot)):(135<b&&(ct+=Vt+ot),Vt=Math.max(Math.max(Vt,ut),Vt+ut+ot),Yt=Ty(y,Yt,Dt),0>Dt&&(Dt=0)),y.la.h(ct,Dt),y.Da.h(Vt,Yt)}}mi.prototype.customAlignment=function(a,y,x,b,E){return[y,x,b,E]};function hx(a,y,x,b,E,z){var tt=x.length;if(tt===0)return new ye(b,0,E,z);if(tt===1)return y=x[0],E=y.Da.width,z=y.Da.height,new ye(b,0,E,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,at=Cu(y)===90,ut=0,ct=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var St=x[yt],Lt=St.Da,Ot=ut===0?0:ot;if(at){var Dt=a.computeBusNodeSpacing(St)-rt;St.S.h(b-(Lt.width+Dt),mt+Ot),E=Math.max(E,Lt.width+Dt),z=Math.max(z,mt+Ot+Lt.height),mt+=Ot+Lt.height}else Dt=a.computeBusNodeSpacing(St)-rt,St.S.h(ct+Ot,b-(Lt.height+Dt)),z=Math.max(z,Lt.height+Dt),E=Math.max(E,ct+Ot+Lt.width),ct+=Ot+Lt.width;ut++}for(ut=0,St=ct,yt=mt,at?(ct=b+rt,mt=0):(ct=0,mt=b+rt),Lt=0;Lt<tt;Lt++)if(Lt%2!==0){Ot=x[Lt],Dt=Ot.Da;var Gt=ut===0?0:ot;if(at){var Vt=a.computeBusNodeSpacing(Ot)-rt;Ot.S.h(ct+Vt,mt+Gt),E=Math.max(E,ct+Dt.width+Vt),z=Math.max(z,mt+Gt+Dt.height),mt+=Gt+Dt.height}else Vt=a.computeBusNodeSpacing(Ot)-rt,Ot.S.h(ct+Gt,mt+Vt),E=Math.max(E,ct+Gt+Dt.width),z=Math.max(z,mt+Dt.height+Vt),ct+=Gt+Dt.width;ut++}return 1<tt&&tt%2===1&&(x=x[tt-1],tt=x.Da,a=a.computeBusLastRowSpacing(x,at?Math.max(Math.abs(yt),Math.abs(mt)):Math.max(Math.abs(St),Math.abs(ct))),at?(x.S.h(b+rt/2-x.focus.x-x.la.x,z+a),at=b+rt/2-x.focus.x-x.la.x,E=Math.max(E,at+tt.width),0>at&&(E-=at),z=Math.max(z,Math.max(yt,mt)+a+tt.height),0>x.S.x&&(b=B0(y,x.S.x,!1,b,rt))):(x.S.h(E+a,b+rt/2-x.focus.y-x.la.y),E=Math.max(E,Math.max(St,ct)+a+tt.width),mt=b+rt/2-x.focus.y-x.la.y,z=Math.max(z,mt+tt.height),0>mt&&(z-=mt),0>x.S.y&&(b=B0(y,x.S.y,!0,b,rt)))),new ye(b,0,E,z)}function dx(a,y,x,b,E,z){var tt=x.length;if(tt===0)return new ye(b,0,E,z);if(tt===1)return x=x[0],E=x.Da.width,z=x.Da.height,new ye(b,0,E,z);for(var rt=y.nodeSpacing,ot=y.rowSpacing,at=Cu(y)===270,ut=0,ct=0,mt=0,yt=0;yt<tt;yt++)if(!(yt%2!==0||1<tt&&yt===tt-1)){var St=x[yt],Lt=St.Da,Ot=ut===0?0:ot;if(at){var Dt=a.computeBusNodeSpacing(St)-rt;mt-=Ot+Lt.height,St.S.h(b-(Lt.width+Dt),mt),E=Math.max(E,Lt.width+Dt),z=Math.max(z,Math.abs(mt))}else Dt=a.computeBusNodeSpacing(St)-rt,ct-=Ot+Lt.width,St.S.h(ct,b-(Lt.height+Dt)),z=Math.max(z,Lt.height+Dt),E=Math.max(E,Math.abs(ct));ut++}for(ut=0,St=ct,yt=mt,at?(ct=b+rt,mt=0):(ct=0,mt=b+rt),Lt=0;Lt<tt;Lt++)if(Lt%2!==0){Ot=x[Lt],Dt=Ot.Da;var Gt=ut===0?0:ot;if(at){var Vt=a.computeBusNodeSpacing(Ot)-rt;mt-=Gt+Dt.height,Ot.S.h(ct+Vt,mt),E=Math.max(E,ct+Dt.width+Vt),z=Math.max(z,Math.abs(mt))}else Vt=a.computeBusNodeSpacing(Ot)-rt,ct-=Gt+Dt.width,Ot.S.h(ct,mt+Vt),z=Math.max(z,mt+Dt.height+Vt),E=Math.max(E,Math.abs(ct));ut++}for(1<tt&&tt%2===1&&(ot=x[tt-1],ut=ot.Da,a=a.computeBusLastRowSpacing(ot,at?Math.max(Math.abs(yt),Math.abs(mt)):Math.max(Math.abs(St),Math.abs(ct))),at?(ot.S.h(b+rt/2-ot.focus.x-ot.la.x,-z-ut.height-a),ct=b+rt/2-ot.focus.x-ot.la.x,E=Math.max(E,ct+ut.width),0>ct&&(E-=ct),z=Math.max(z,Math.abs(Math.min(yt,mt))+a+ut.height),0>ot.S.x&&(b=B0(y,ot.S.x,!1,b,rt))):(ot.S.h(-E-ut.width-a,b+rt/2-ot.focus.y-ot.la.y),E=Math.max(E,Math.abs(Math.min(St,ct))+a+ut.width),mt=b+rt/2-ot.focus.y-ot.la.y,z=Math.max(z,mt+ut.height),0>mt&&(z-=mt),0>ot.S.y&&(b=B0(y,ot.S.y,!0,b,rt)))),y=0;y<tt;y++)rt=x[y],at?rt.S.h(rt.S.x,rt.S.y+z):rt.S.h(rt.S.x+E,rt.S.y);return new ye(b,0,E,z)}mi.prototype.computeBusNodeSpacing=function(a){return a.parent===null?0:a.parent.nodeSpacing},mi.prototype.computeBusLastRowSpacing=function(a){return a.parent===null?0:a.parent.rowSpacing};function B0(a,y,x,b,E){a=a.children;for(var z=a.length,tt=0;tt<z;tt++)x?a[tt].S.h(a[tt].S.x,a[tt].S.y-y):a[tt].S.h(a[tt].S.x-y,a[tt].S.y);return y=a[z-1],Math.max(b,x?y.la.y+y.focus.y-E/2:y.la.x+y.focus.x-E/2)}function Fy(a,y,x){switch(a.alignment){case _c:case Rg:return x+a.width>y&&(y=x+a.width),0>x&&(y-=x),y;case Nh:return a.width>y?a.width:y;case Dh:return 2*a.focus.x>y?a.width:y+a.width-2*a.focus.x;case Ad:case Ah:return Math.max(a.width,Math.max(y,x+a.width)-Math.min(0,x));case Bd:return a.width-a.focus.x+a.nodeSpacing/2+y;case nd:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+y);default:return y}}function Ty(a,y,x){switch(a.alignment){case _c:case Rg:return x+a.height>y&&(y=x+a.height),0>x&&(y-=x),y;case Nh:return a.height>y?a.height:y;case Dh:return 2*a.focus.y>y?a.height:y+a.height-2*a.focus.y;case Ad:case Ah:return Math.max(a.height,Math.max(y,x+a.height)-Math.min(0,x));case Bd:return a.height-a.focus.y+a.nodeSpacing/2+y;case nd:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+y);default:return y}}function Ny(a,y,x){switch(a){case Rg:y/=2,x/=2;break;case _c:y/=2,x/=2;break;case Nh:x=y=0;break;case Dh:break;default:fe("Unhandled alignment value "+a.toString())}return new jt(y,x)}function sc(a,y,x,b,E,z){y=Ny(y,x,b),zc(a,y.x,y.y,E,z)}function zc(a,y,x,b,E){if(y!==0||x!==0)for(a=a.children;b<=E;b++){var z=a[b].S;z.x+=y,z.y+=x}}function O0(a,y,x,b){var E=y.parent;switch(a.ud){case Th:for(a=y.sourceEdges;a.next();)y=a.value,y.fromVertex===E&&y.relativePoint.h(x,b);break;case Gc:for(a=y.destinationEdges;a.next();)y=a.value,y.toVertex===E&&y.relativePoint.h(x,b);break;default:fe("Unhandled path value "+a.ud.toString())}}function I0(a,y,x){for(var b=0;b<a.length;b++){var E=a[b];E.x+=y,E.y+=x}}function fx(a,y,x,b,E,z,tt,rt){var ot=Cu(y),at=ot===90||ot===270,ut=y.nodeSpacing;y=b;var ct=E;b=z;var mt=tt,yt=x.Yo,St=x.kp;tt=x.Da;var Lt=at?Math.max(mt,tt.height):Math.max(b,tt.width);if((yt===null||ot!==Cu(x))&&(yt=ol(a,2),St=ol(a,2),at?(yt[0].h(0,0),yt[1].h(0,tt.height),St[0].h(tt.width,0),St[1].h(St[0].x,yt[1].y)):(yt[0].h(0,0),yt[1].h(tt.width,0),St[0].h(0,tt.height),St[1].h(yt[1].x,St[0].y))),at){if(mt=9999999,!(ct===null||2>ct.length||yt===null||2>yt.length))for(E=x=0;x<ct.length&&E<yt.length;){z=ct[x];var Ot=yt[E];ot=Ot.x,at=Ot.y,ot+=b;var Dt=z;x+1<ct.length&&(Dt=ct[x+1]);var Gt=Ot;Ot=Gt.x,Gt=Gt.y,E+1<yt.length&&(Gt=yt[E+1],Ot=Gt.x,Gt=Gt.y,Ot+=b);var Vt=mt;z.y===at?Vt=ot-z.x:z.y>at&&z.y<Gt?Vt=ot+(z.y-at)/(Gt-at)*(Ot-ot)-z.x:at>z.y&&at<Dt.y&&(Vt=ot-(z.x+(at-z.y)/(Dt.y-z.y)*(Dt.x-z.x))),Vt<mt&&(mt=Vt),Dt.y<=z.y?x++:Gt<=at?E++:(Dt.y<=Gt&&x++,Gt<=Dt.y&&E++)}if(mt=b-mt,mt+=ut,x=yt,E=mt,y===null||2>y.length||x===null||2>x.length)b=null;else{for(ut=ol(a,y.length+x.length),b=z=ot=0;z<x.length&&x[z].y<y[0].y;)at=x[z++],ut[b++].h(at.x+E,at.y);for(;ot<y.length;)at=y[ot++],ut[b++].h(at.x,at.y);for(ot=y[y.length-1].y;z<x.length&&x[z].y<=ot;)z++;for(;z<x.length&&x[z].y>ot;)at=x[z++],ut[b++].h(at.x+E,at.y);for(x=ol(a,b),ot=0;ot<b;ot++)x[ot].assign(ut[ot]);Hu(a,ut),b=x}if(z=St,ot=mt,ct===null||2>ct.length||z===null||2>z.length)E=null;else{for(ut=ol(a,ct.length+z.length),E=at=x=0;x<ct.length&&ct[x].y<z[0].y;)Dt=ct[x++],ut[E++].h(Dt.x,Dt.y);for(;at<z.length;)Dt=z[at++],ut[E++].h(Dt.x+ot,Dt.y);for(z=z[z.length-1].y;x<ct.length&&ct[x].y<=z;)x++;for(;x<ct.length&&ct[x].y>z;)ot=ct[x++],ut[E++].h(ot.x,ot.y);for(z=ol(a,E),x=0;x<E;x++)z[x].assign(ut[x]);Hu(a,ut),E=z}return z=Math.max(0,mt)+tt.width,tt=Lt,Hu(a,y),Hu(a,yt),Hu(a,ct),Hu(a,St),rt[0]=b,rt[1]=E,new ye(mt,0,z,tt)}if(b=9999999,!(ct===null||2>ct.length||yt===null||2>yt.length))for(E=x=0;x<ct.length&&E<yt.length;)z=ct[x],Ot=yt[E],ot=Ot.x,at=Ot.y,at+=mt,Dt=z,x+1<ct.length&&(Dt=ct[x+1]),Gt=Ot,Ot=Gt.x,Gt=Gt.y,E+1<yt.length&&(Gt=yt[E+1],Ot=Gt.x,Gt=Gt.y,Gt+=mt),Vt=b,z.x===ot?Vt=at-z.y:z.x>ot&&z.x<Ot?Vt=at+(z.x-ot)/(Ot-ot)*(Gt-at)-z.y:ot>z.x&&ot<Dt.x&&(Vt=at-(z.y+(ot-z.x)/(Dt.x-z.x)*(Dt.y-z.y))),Vt<b&&(b=Vt),Dt.x<=z.x?x++:Ot<=ot?E++:(Dt.x<=Ot&&x++,Ot<=Dt.x&&E++);if(mt-=b,mt+=ut,x=yt,E=mt,y===null||2>y.length||x===null||2>x.length)b=null;else{for(ut=ol(a,y.length+x.length),b=z=ot=0;z<x.length&&x[z].x<y[0].x;)at=x[z++],ut[b++].h(at.x,at.y+E);for(;ot<y.length;)at=y[ot++],ut[b++].h(at.x,at.y);for(ot=y[y.length-1].x;z<x.length&&x[z].x<=ot;)z++;for(;z<x.length&&x[z].x>ot;)at=x[z++],ut[b++].h(at.x,at.y+E);for(x=ol(a,b),ot=0;ot<b;ot++)x[ot].assign(ut[ot]);Hu(a,ut),b=x}if(z=St,ot=mt,ct===null||2>ct.length||z===null||2>z.length)E=null;else{for(ut=ol(a,ct.length+z.length),E=at=x=0;x<ct.length&&ct[x].x<z[0].x;)Dt=ct[x++],ut[E++].h(Dt.x,Dt.y);for(;at<z.length;)Dt=z[at++],ut[E++].h(Dt.x,Dt.y+ot);for(z=z[z.length-1].x;x<ct.length&&ct[x].x<=z;)x++;for(;x<ct.length&&ct[x].x>z;)ot=ct[x++],ut[E++].h(ot.x,ot.y);for(z=ol(a,E),x=0;x<E;x++)z[x].assign(ut[x]);Hu(a,ut),E=z}return z=Lt,tt=Math.max(0,mt)+tt.height,Hu(a,y),Hu(a,yt),Hu(a,ct),Hu(a,St),rt[0]=b,rt[1]=E,new ye(mt,0,z,tt)}function ol(a,y){if(a=a.ru[y],a!==void 0&&(a=a.pop(),a!==void 0))return a;a=[];for(var x=0;x<y;x++)a[x]=new jt;return a}function Hu(a,y){var x=y.length,b=a.ru[x];b===void 0&&(b=[],a.ru[x]=b),b.push(y)}mi.prototype.arrangeTrees=function(){if(this.Rb===_0)for(var a=this.Ub.iterator;a.next();){var y=a.value;if(y instanceof su){var x=y.node;if(x!==null){var b=x.position;x=b.x,b=b.y,isFinite(x)||(x=0),isFinite(b)||(b=0),Dy(this,y,x,b)}}}else{for(a=[],y=this.Ub.iterator;y.next();)x=y.value,x instanceof su&&a.push(x);switch(this.sorting){case Ig:break;case Yp:a.reverse();break;case Xp:a.sort(this.comparer);break;case Zp:a.sort(this.comparer),a.reverse();break;default:fe("Unhandled sorting value "+this.sorting.toString())}for(x=this.arrangementOrigin,y=x.x,x=x.y,b=0;b<a.length;b++){var E=a[b];switch(Dy(this,E,y+E.la.x,x+E.la.y),this.Rb){case G0:x+=E.Da.height+this.$d.height;break;case Iy:y+=E.Da.width+this.$d.width;break;default:fe("Unhandled arrangement value "+this.Rb.toString())}}}};function Dy(a,y,x,b){if(y!==null){y.x=x,y.y=b,y=y.children;for(var E=y.length,z=0;z<E;z++){var tt=y[z];Dy(a,tt,x+tt.S.x,b+tt.S.y)}}}mi.prototype.commitLayout=function(){this.yv(),this.commitNodes(),this.Gu(),this.isRouting&&this.commitLinks()},mi.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)},mi.prototype.Gu=function(){if(this.layerStyle===H0){for(var a=this.$v,y=[],x=null,b=this.network.vertexes.iterator;b.next();){var E=b.value;x===null?x=E.bounds.copy():x.ed(E.bounds);var z=y[E.level];z===void 0?z=this.computeLayerSpacing(E):z=Math.max(z,this.computeLayerSpacing(E)),y[E.level]=z}for(b=0;b<y.length;b++)y[b]===void 0&&(y[b]=0);if(this.angle===90||this.angle===270?(x.Bc(this.nodeSpacing/2,this.layerSpacing),b=new jt(-this.nodeSpacing/2,-this.layerSpacing/2)):(x.Bc(this.layerSpacing,this.nodeSpacing/2),b=new jt(-this.layerSpacing/2,-this.nodeSpacing/2)),E=[],x=this.angle===90||this.angle===270?x.width:x.height,z=0,this.angle===180||this.angle===270)for(var tt=0;tt<a.length;tt++)z+=a[tt]+y[tt];for(tt=0;tt<a.length;tt++){var rt=a[tt]+y[tt];this.angle===270?(z-=rt,E.push(new ye(0,z,x,rt))):this.angle===90?(E.push(new ye(0,z,x,rt)),z+=rt):this.angle===180?(z-=rt,E.push(new ye(z,0,rt,x))):(E.push(new ye(z,0,rt,x)),z+=rt)}this.commitLayers(E,b)}},mi.prototype.commitLayers=function(){},mi.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()},mi.prototype.yv=function(){for(var a=this.Ub.iterator;a.next();){var y=a.value;y instanceof su&&cx(this,y)}};function cx(a,y){if(y!==null){a.setPortSpots(y),y=y.children;for(var x=y.length,b=0;b<x;b++)cx(a,y[b])}}mi.prototype.setPortSpots=function(a){var y=a.alignment;if(vf(y)){var x=this.ud===Th,b=Cu(a);switch(b){case 0:var E=js;break;case 90:E=Ks;break;case 180:E=ya;break;default:E=$a}var z=a.children,tt=z.length;switch(y){case Ad:case Ah:for(y=0;y<tt;y++){var rt=z[y];if(rt=(x?rt.sourceEdges:rt.destinationEdges).first(),rt!==null&&(rt=rt.link,rt!==null)){var ot=b===90||b===270?ya:$a;if(tt===1||y===tt-1&&tt%2===1)switch(b){case 0:ot=ya;break;case 90:ot=$a;break;case 180:ot=js;break;default:ot=Ks}else y%2===0&&(ot=b===90||b===270?js:Ks);x?(a.setsPortSpot&&(rt.fromSpot=E),a.setsChildPortSpot&&(rt.toSpot=ot)):(a.setsPortSpot&&(rt.fromSpot=ot),a.setsChildPortSpot&&(rt.toSpot=E))}}break;case Bd:for(b=b===90||b===270?js:Ks,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)):(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)));break;case nd:for(b=b===90||b===270?ya:$a,z=x?a.destinationEdges:a.sourceEdges;z.next();)tt=z.value.link,tt!==null&&(x?(a.setsPortSpot&&(tt.fromSpot=E),a.setsChildPortSpot&&(tt.toSpot=b)):(a.setsPortSpot&&(tt.fromSpot=b),a.setsChildPortSpot&&(tt.toSpot=E)))}}else if(x=Cu(a),this.ud===Th){for(E=a.destinationEdges;E.next();)if(b=E.value.link,b!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:b.fromSpot=js;break;case 90:b.fromSpot=Ks;break;case 180:b.fromSpot=ya;break;default:b.fromSpot=$a}else b.fromSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:b.toSpot=ya;break;case 90:b.toSpot=$a;break;case 180:b.toSpot=js;break;default:b.toSpot=Ks}else b.toSpot=a.childPortSpot}}else for(E=a.sourceEdges;E.next();)if(b=E.value.link,b!==null){if(a.setsPortSpot)if(a.portSpot.Xb())switch(x){case 0:b.toSpot=js;break;case 90:b.toSpot=Ks;break;case 180:b.toSpot=ya;break;default:b.toSpot=$a}else b.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xb())switch(x){case 0:b.fromSpot=ya;break;case 90:b.fromSpot=$a;break;case 180:b.fromSpot=js;break;default:b.fromSpot=Ks}else b.fromSpot=a.childPortSpot}};function Cu(a){return a=a.angle,45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}mi.prototype.computeLayerSpacing=function(a){var y=Cu(a);y=y===90||y===270;var x=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var b=Math.min(1,a.layerSpacingParentOverlap);x-=y?a.height*b:a.width*b}return x<(y?-a.height:-a.width)&&(x=y?-a.height:-a.width),x},mi.prototype.computeNodeIndent=function(a){var y=Cu(a),x=a.nodeIndent;if(0<a.nodeIndentPastParent){var b=Math.min(1,a.nodeIndentPastParent);x+=y===90||y===270?a.width*b:a.height*b}return x=Math.max(0,x)},Oe.Object.defineProperties(mi.prototype,{roots:{get:function(){return this.Ub},set:function(a){this.Ub!==a&&(this.Ub=a,this.C())}},path:{get:function(){return this.Wn},set:function(a){this.Wn!==a&&(this.Wn=a,this.C())}},treeStyle:{get:function(){return this.vo},set:function(a){this.Rb===a||a!==z0&&a!==By&&a!==Ay&&a!==Oy||(this.vo=a,this.C())}},layerStyle:{get:function(){return this.Bq},set:function(a){this.Rb===a||a!==Ry&&a!==jy&&a!==H0||(this.Bq=a,this.C())}},comments:{get:function(){return this.td},set:function(a){this.td!==a&&(this.td=a,this.C())}},arrangement:{get:function(){return this.Rb},set:function(a){this.Rb===a||a!==G0&&a!==Iy&&a!==_0||(this.Rb=a,this.C())}},arrangementSpacing:{get:function(){return this.$d},set:function(a){this.$d.D(a)||(this.$d.assign(a),this.C())}},rootDefaults:{get:function(){return this.W},set:function(a){this.W!==a&&(this.W=a,this.C())}},alternateDefaults:{get:function(){return this.Y},set:function(a){this.Y!==a&&(this.Y=a,this.C())}},sorting:{get:function(){return this.W.sorting},set:function(a){this.W.sorting===a||a!==Ig&&a!==Yp&&a!==Xp&&!Zp||(this.W.sorting=a,this.C())}},comparer:{get:function(){return this.W.comparer},set:function(a){this.W.comparer!==a&&(this.W.comparer=a,this.C())}},angle:{get:function(){return this.W.angle},set:function(a){this.W.angle!==a&&(a===0||a===90||a===180||a===270?(this.W.angle=a,this.C()):fe("TreeLayout.angle must be 0, 90, 180, or 270"))}},alignment:{get:function(){return this.W.alignment},set:function(a){this.W.alignment!==a&&(this.W.alignment=a,this.C())}},nodeIndent:{get:function(){return this.W.nodeIndent},set:function(a){this.W.nodeIndent!==a&&0<=a&&(this.W.nodeIndent=a,this.C())}},nodeIndentPastParent:{get:function(){return this.W.nodeIndentPastParent},set:function(a){this.W.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.W.nodeIndentPastParent=a,this.C())}},nodeSpacing:{get:function(){return this.W.nodeSpacing},set:function(a){this.W.nodeSpacing!==a&&(this.W.nodeSpacing=a,this.C())}},layerSpacing:{get:function(){return this.W.layerSpacing},set:function(a){this.W.layerSpacing!==a&&(this.W.layerSpacing=a,this.C())}},layerSpacingParentOverlap:{get:function(){return this.W.layerSpacingParentOverlap},set:function(a){this.W.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.W.layerSpacingParentOverlap=a,this.C())}},compaction:{get:function(){return this.W.compaction},set:function(a){this.W.compaction===a||a!==j0&&a!==Jp||(this.W.compaction=a,this.C())}},breadthLimit:{get:function(){return this.W.breadthLimit},set:function(a){this.W.breadthLimit!==a&&0<=a&&(this.W.breadthLimit=a,this.C())}},rowSpacing:{get:function(){return this.W.rowSpacing},set:function(a){this.W.rowSpacing!==a&&(this.W.rowSpacing=a,this.C())}},rowIndent:{get:function(){return this.W.rowIndent},set:function(a){this.W.rowIndent!==a&&0<=a&&(this.W.rowIndent=a,this.C())}},commentSpacing:{get:function(){return this.W.commentSpacing},set:function(a){this.W.commentSpacing!==a&&(this.W.commentSpacing=a,this.C())}},commentMargin:{get:function(){return this.W.commentMargin},set:function(a){this.W.commentMargin!==a&&(this.W.commentMargin=a,this.C())}},setsPortSpot:{get:function(){return this.W.setsPortSpot},set:function(a){this.W.setsPortSpot!==a&&(this.W.setsPortSpot=a,this.C())}},portSpot:{get:function(){return this.W.portSpot},set:function(a){this.W.portSpot.D(a)||(this.W.portSpot=a,this.C())}},setsChildPortSpot:{get:function(){return this.W.setsChildPortSpot},set:function(a){this.W.setsChildPortSpot!==a&&(this.W.setsChildPortSpot=a,this.C())}},childPortSpot:{get:function(){return this.W.childPortSpot},set:function(a){this.W.childPortSpot.D(a)||(this.W.childPortSpot=a,this.C())}},alternateSorting:{get:function(){return this.Y.sorting},set:function(a){this.Y.sorting===a||a!==Ig&&a!==Yp&&a!==Xp&&!Zp||(this.Y.sorting=a,this.C())}},alternateComparer:{get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(this.Y.comparer=a,this.C())}},alternateAngle:{get:function(){return this.Y.angle},set:function(a){this.Y.angle===a||a!==0&&a!==90&&a!==180&&a!==270||(this.Y.angle=a,this.C())}},alternateAlignment:{get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!==a&&(this.Y.alignment=a,this.C())}},alternateNodeIndent:{get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&0<=a&&(this.Y.nodeIndent=a,this.C())}},alternateNodeIndentPastParent:{get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==a&&0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.C())}},alternateNodeSpacing:{get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(this.Y.nodeSpacing=a,this.C())}},alternateLayerSpacing:{get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(this.Y.layerSpacing=a,this.C())}},alternateLayerSpacingParentOverlap:{get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.C())}},alternateCompaction:{get:function(){return this.Y.compaction},set:function(a){this.Y.compaction===a||a!==j0&&a!==Jp||(this.Y.compaction=a,this.C())}},alternateBreadthLimit:{get:function(){return this.Y.breadthLimit},set:function(a){this.Y.breadthLimit!==a&&0<=a&&(this.Y.breadthLimit=a,this.C())}},alternateRowSpacing:{get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(this.Y.rowSpacing=a,this.C())}},alternateRowIndent:{get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&0<=a&&(this.Y.rowIndent=a,this.C())}},alternateCommentSpacing:{get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(this.Y.commentSpacing=a,this.C())}},alternateCommentMargin:{get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(this.Y.commentMargin=a,this.C())}},alternateSetsPortSpot:{get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(this.Y.setsPortSpot=a,this.C())}},alternatePortSpot:{get:function(){return this.Y.portSpot},set:function(a){this.Y.portSpot.D(a)||(this.Y.portSpot=a,this.C())}},alternateSetsChildPortSpot:{get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(this.Y.setsChildPortSpot=a,this.C())}},alternateChildPortSpot:{get:function(){return this.Y.childPortSpot},set:function(a){this.Y.childPortSpot.D(a)||(this.Y.childPortSpot=a,this.C())}}});var R0=new me(mi,"PathDefault",-1),Th=new me(mi,"PathDestination",0),Gc=new me(mi,"PathSource",1),Ig=new me(mi,"SortingForwards",10),Yp=new me(mi,"SortingReverse",11),Xp=new me(mi,"SortingAscending",12),Zp=new me(mi,"SortingDescending",13),Rg=new me(mi,"AlignmentCenterSubtrees",20),_c=new me(mi,"AlignmentCenterChildren",21),Nh=new me(mi,"AlignmentStart",22),Dh=new me(mi,"AlignmentEnd",23),Ad=new me(mi,"AlignmentBus",24),Ah=new me(mi,"AlignmentBusBranching",25),Bd=new me(mi,"AlignmentTopLeftBus",26),nd=new me(mi,"AlignmentBottomRightBus",27),j0=new me(mi,"CompactionNone",30),Jp=new me(mi,"CompactionBlock",31),z0=new me(mi,"StyleLayered",40),Ay=new me(mi,"StyleLastParents",41),By=new me(mi,"StyleAlternating",42),Oy=new me(mi,"StyleRootOnly",43),G0=new me(mi,"ArrangementVertical",50),Iy=new me(mi,"ArrangementHorizontal",51),_0=new me(mi,"ArrangementFixedRoots",52),Ry=new me(mi,"LayerIndividual",60),jy=new me(mi,"LayerSiblings",61),H0=new me(mi,"LayerUniform",62);mi.className="TreeLayout",mi.PathDefault=R0,mi.PathDestination=Th,mi.PathSource=Gc,mi.SortingForwards=Ig,mi.SortingReverse=Yp,mi.SortingAscending=Xp,mi.SortingDescending=Zp,mi.AlignmentCenterSubtrees=Rg,mi.AlignmentCenterChildren=_c,mi.AlignmentStart=Nh,mi.AlignmentEnd=Dh,mi.AlignmentBus=Ad,mi.AlignmentBusBranching=Ah,mi.AlignmentTopLeftBus=Bd,mi.AlignmentBottomRightBus=nd,mi.CompactionNone=j0,mi.CompactionBlock=Jp,mi.StyleLayered=z0,mi.StyleLastParents=Ay,mi.StyleAlternating=By,mi.StyleRootOnly=Oy,mi.ArrangementVertical=G0,mi.ArrangementHorizontal=Iy,mi.ArrangementFixedRoots=_0,mi.LayerIndividual=Ry,mi.LayerSiblings=jy,mi.LayerUniform=H0;function Hc(a){kr.call(this,a)}le(Hc,kr),Hc.prototype.createVertex=function(){return new su(this)},Hc.prototype.createEdge=function(){return new jg(this)},Hc.className="TreeNetwork";function su(a){ns.call(this,a),this.V=!1,this.hb=null,this.u=[],this.nb=this.Ha=this.F=this.ia=0,this.td=null,this.S=new jt(0,0),this.Da=new Ze(0,0),this.la=new jt(0,0),this.im=this.hm=this.qA=!1,this.kp=this.Yo=null,this.nd=Ig,this.hd=ry,this.Kb=0,this.Jb=_c,this.Vq=this.Uq=0,this.Wq=20,this.ie=50,this.Aq=0,this.Hp=Jp,this.Ap=0,this.nr=25,this.Gp=this.mr=10,this.Fp=20,this.xr=!0,this.dr=vs,this.wr=!0,this.Dp=vs}le(su,ns),su.prototype.copyInheritedPropertiesFrom=function(a){a!==null&&(this.nd=a.sorting,this.hd=a.comparer,this.Kb=a.angle,this.Jb=a.alignment,this.Uq=a.nodeIndent,this.Vq=a.nodeIndentPastParent,this.Wq=a.nodeSpacing,this.ie=a.layerSpacing,this.Aq=a.layerSpacingParentOverlap,this.Hp=a.compaction,this.Ap=a.breadthLimit,this.nr=a.rowSpacing,this.mr=a.rowIndent,this.Gp=a.commentSpacing,this.Fp=a.commentMargin,this.xr=a.setsPortSpot,this.dr=a.portSpot,this.wr=a.setsChildPortSpot,this.Dp=a.childPortSpot)},Oe.Object.defineProperties(su.prototype,{initialized:{get:function(){return this.V},set:function(a){this.V!==a&&(this.V=a)}},parent:{get:function(){return this.hb},set:function(a){this.hb!==a&&(this.hb=a)}},children:{get:function(){return this.u},set:function(a){if(this.u!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.u=a}}},level:{get:function(){return this.ia},set:function(a){this.ia!==a&&(this.ia=a)}},descendantCount:{get:function(){return this.F},set:function(a){this.F!==a&&(this.F=a)}},maxChildrenCount:{get:function(){return this.Ha},set:function(a){this.Ha!==a&&(this.Ha=a)}},maxGenerationCount:{get:function(){return this.nb},set:function(a){this.nb!==a&&(this.nb=a)}},comments:{get:function(){return this.td},set:function(a){if(this.td!==a){if(a!==null)for(var y=a.length,x=0;x<y;x++);this.td=a}}},sorting:{get:function(){return this.nd},set:function(a){this.nd!==a&&(this.nd=a)}},comparer:{get:function(){return this.hd},set:function(a){this.hd!==a&&(this.hd=a)}},angle:{get:function(){return this.Kb},set:function(a){this.Kb!==a&&(this.Kb=a)}},alignment:{get:function(){return this.Jb},set:function(a){this.Jb!==a&&(this.Jb=a)}},nodeIndent:{get:function(){return this.Uq},set:function(a){this.Uq!==a&&(this.Uq=a)}},nodeIndentPastParent:{get:function(){return this.Vq},set:function(a){this.Vq!==a&&(this.Vq=a)}},nodeSpacing:{get:function(){return this.Wq},set:function(a){this.Wq!==a&&(this.Wq=a)}},layerSpacing:{get:function(){return this.ie},set:function(a){this.ie!==a&&(this.ie=a)}},layerSpacingParentOverlap:{get:function(){return this.Aq},set:function(a){this.Aq!==a&&(this.Aq=a)}},compaction:{get:function(){return this.Hp},set:function(a){this.Hp!==a&&(this.Hp=a)}},breadthLimit:{get:function(){return this.Ap},set:function(a){this.Ap!==a&&(this.Ap=a)}},rowSpacing:{get:function(){return this.nr},set:function(a){this.nr!==a&&(this.nr=a)}},rowIndent:{get:function(){return this.mr},set:function(a){this.mr!==a&&(this.mr=a)}},commentSpacing:{get:function(){return this.Gp},set:function(a){this.Gp!==a&&(this.Gp=a)}},commentMargin:{get:function(){return this.Fp},set:function(a){this.Fp!==a&&(this.Fp=a)}},setsPortSpot:{get:function(){return this.xr},set:function(a){this.xr!==a&&(this.xr=a)}},portSpot:{get:function(){return this.dr},set:function(a){this.dr.D(a)||(this.dr=a)}},setsChildPortSpot:{get:function(){return this.wr},set:function(a){this.wr!==a&&(this.wr=a)}},childPortSpot:{get:function(){return this.Dp},set:function(a){this.Dp.D(a)||(this.Dp=a)}},childrenCount:{get:function(){return this.children.length}},relativePosition:{get:function(){return this.S},set:function(a){this.S.set(a)}},subtreeSize:{get:function(){return this.Da},set:function(a){this.Da.set(a)}},subtreeOffset:{get:function(){return this.la},set:function(a){this.la.set(a)}}}),su.className="TreeVertex";function jg(a){vl.call(this,a),this.$t=new jt(0,0)}le(jg,vl),jg.prototype.commit=function(){var a=this.link;if(a!==null&&!a.isAvoiding){var y=this.network.layout,x=null,b=null;switch(y.ud){case Th:x=this.fromVertex,b=this.toVertex;break;case Gc:x=this.toVertex,b=this.fromVertex;break;default:fe("Unhandled path value "+y.ud.toString())}if(x!==null&&b!==null){var E=this.$t;if(E.x!==0||E.y!==0||x.qA){b=x.bounds;var z=Cu(x),tt=y.computeLayerSpacing(x),rt=x.rowSpacing;a.vg();var ot=a.curve===Al,at=a.isOrthogonal,ut;if(a.uh(),at||ot){for(ut=2;4<a.pointsCount;)a.pv(2);var ct=a.i(1),mt=a.i(2)}else{for(ut=1;3<a.pointsCount;)a.pv(1);ct=a.i(0),mt=a.i(a.pointsCount-1)}var yt=a.i(a.pointsCount-1);z===0?(x.alignment===Dh?(z=b.bottom+E.y,E.y===0&&ct.y>yt.y+x.rowIndent&&(z=Math.min(z,Math.max(ct.y,z-y.computeNodeIndent(x))))):x.alignment===Nh?(z=b.top+E.y,E.y===0&&ct.y<yt.y-x.rowIndent&&(z=Math.max(z,Math.min(ct.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?b.top-x.la.y+E.y:b.y+b.height/2+E.y,ot?(a.m(ut,ct.x,z),ut++,a.m(ut,b.right+tt,z),ut++,a.m(ut,b.right+tt+(E.x-rt)/3,z),ut++,a.m(ut,b.right+tt+2*(E.x-rt)/3,z),ut++,a.m(ut,b.right+tt+(E.x-rt),z),ut++,a.m(ut,mt.x,z)):(at&&(a.m(ut,b.right+tt/2,ct.y),ut++),a.m(ut,b.right+tt/2,z),ut++,a.m(ut,b.right+tt+E.x-(at?rt/2:rt),z),ut++,at&&a.m(ut,a.i(ut-1).x,mt.y))):z===90?(x.alignment===Dh?(z=b.right+E.x,E.x===0&&ct.x>yt.x+x.rowIndent&&(z=Math.min(z,Math.max(ct.x,z-y.computeNodeIndent(x))))):x.alignment===Nh?(z=b.left+E.x,E.x===0&&ct.x<yt.x-x.rowIndent&&(z=Math.max(z,Math.min(ct.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?b.left-x.la.x+E.x:b.x+b.width/2+E.x,ot?(a.m(ut,z,ct.y),ut++,a.m(ut,z,b.bottom+tt),ut++,a.m(ut,z,b.bottom+tt+(E.y-rt)/3),ut++,a.m(ut,z,b.bottom+tt+2*(E.y-rt)/3),ut++,a.m(ut,z,b.bottom+tt+(E.y-rt)),ut++,a.m(ut,z,mt.y)):(at&&(a.m(ut,ct.x,b.bottom+tt/2),ut++),a.m(ut,z,b.bottom+tt/2),ut++,a.m(ut,z,b.bottom+tt+E.y-(at?rt/2:rt)),ut++,at&&a.m(ut,mt.x,a.i(ut-1).y))):z===180?(x.alignment===Dh?(z=b.bottom+E.y,E.y===0&&ct.y>yt.y+x.rowIndent&&(z=Math.min(z,Math.max(ct.y,z-y.computeNodeIndent(x))))):x.alignment===Nh?(z=b.top+E.y,E.y===0&&ct.y<yt.y-x.rowIndent&&(z=Math.max(z,Math.min(ct.y,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?b.top-x.la.y+E.y:b.y+b.height/2+E.y,ot?(a.m(ut,ct.x,z),ut++,a.m(ut,b.left-tt,z),ut++,a.m(ut,b.left-tt+(E.x+rt)/3,z),ut++,a.m(ut,b.left-tt+2*(E.x+rt)/3,z),ut++,a.m(ut,b.left-tt+(E.x+rt),z),ut++,a.m(ut,mt.x,z)):(at&&(a.m(ut,b.left-tt/2,ct.y),ut++),a.m(ut,b.left-tt/2,z),ut++,a.m(ut,b.left-tt+E.x+(at?rt/2:rt),z),ut++,at&&a.m(ut,a.i(ut-1).x,mt.y))):z===270?(x.alignment===Dh?(z=b.right+E.x,E.x===0&&ct.x>yt.x+x.rowIndent&&(z=Math.min(z,Math.max(ct.x,z-y.computeNodeIndent(x))))):x.alignment===Nh?(z=b.left+E.x,E.x===0&&ct.x<yt.x-x.rowIndent&&(z=Math.max(z,Math.min(ct.x,z+y.computeNodeIndent(x))))):z=x.hm||x.im&&x.maxGenerationCount===1?b.left-x.la.x+E.x:b.x+b.width/2+E.x,ot?(a.m(ut,z,ct.y),ut++,a.m(ut,z,b.top-tt),ut++,a.m(ut,z,b.top-tt+(E.y+rt)/3),ut++,a.m(ut,z,b.top-tt+2*(E.y+rt)/3),ut++,a.m(ut,z,b.top-tt+(E.y+rt)),ut++,a.m(ut,z,mt.y)):(at&&(a.m(ut,ct.x,b.top-tt/2),ut++),a.m(ut,z,b.top-tt/2),ut++,a.m(ut,z,b.top-tt+E.y+(at?rt/2:rt)),ut++,at&&a.m(ut,mt.x,a.i(ut-1).y))):fe("Invalid angle "+z),a.zf()}else E=b,a=this.link,b=this.network.layout,y=Cu(x),y!==Cu(E)&&(tt=b.computeLayerSpacing(x),rt=x.bounds,x=E.bounds,y===0&&x.left-rt.right<tt+1||y===90&&x.top-rt.bottom<tt+1||y===180&&rt.left-x.right<tt+1||y===270&&rt.top-x.bottom<tt+1||(a.vg(),x=a.curve===Al,E=a.isOrthogonal,b=vf(this.fromVertex.alignment),a.uh(),y===0?(y=rt.right+tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y-20,a.i(1).y),a.m(2,y-20,x),a.m(3,y,x),a.m(4,y+20,x),a.L(5,a.i(5).x,x)):E?b?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===90?(y=rt.bottom+tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y-20),a.m(2,x,y-20),a.m(3,x,y),a.m(4,x,y+20),a.L(5,x,a.i(5).y)):E?b?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)):y===180?(y=rt.left-tt/2,x?a.pointsCount===4&&(x=a.i(3).y,a.L(1,y+20,a.i(1).y),a.m(2,y+20,x),a.m(3,y,x),a.m(4,y-20,x),a.L(5,a.i(5).x,x)):E?b?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,y,a.i(2).y),a.L(3,y,a.i(3).y)):a.pointsCount===4?a.m(2,y,a.i(2).y):a.pointsCount===3?a.L(1,y,a.i(2).y):a.pointsCount===2&&a.m(1,y,a.i(1).y)):y===270&&(y=rt.top-tt/2,x?a.pointsCount===4&&(x=a.i(3).x,a.L(1,a.i(1).x,y+20),a.m(2,x,y+20),a.m(3,x,y),a.m(4,x,y-20),a.L(5,x,a.i(5).y)):E?b?a.L(3,a.i(2).x,a.i(4).y):a.pointsCount===6&&(a.L(2,a.i(2).x,y),a.L(3,a.i(3).x,y)):a.pointsCount===4?a.m(2,a.i(2).x,y):a.pointsCount===3?a.L(1,a.i(2).x,y):a.pointsCount===2&&a.m(1,a.i(1).x,y)),a.zf()))}}},Oe.Object.defineProperties(jg.prototype,{fromVertex:{get:function(){return this.kd},set:function(a){this.kd!==a&&(this.kd=a)}},toVertex:{get:function(){return this.qd},set:function(a){this.qd!==a&&(this.qd=a)}},relativePoint:{get:function(){return this.$t},set:function(a){this.$t.set(a)}}}),jg.className="TreeEdge",jr.prototype.initializeStandardTools=function(){this.gb("Action",new je,this.mouseDownTools),this.gb("Relinking",new cl,this.mouseDownTools),this.gb("LinkReshaping",new yo,this.mouseDownTools),this.gb("Rotating",new pe,this.mouseDownTools),this.gb("Resizing",new Zt,this.mouseDownTools),this.gb("Linking",new ea,this.mouseMoveTools),this.gb("Dragging",new ti,this.mouseMoveTools),this.gb("DragSelecting",new rn,this.mouseMoveTools),this.gb("Panning",new ln,this.mouseMoveTools),this.gb("ContextMenu",new _n,this.mouseUpTools),this.gb("TextEditing",new Pn,this.mouseUpTools),this.gb("ClickCreating",new en,this.mouseUpTools),this.gb("ClickSelecting",new De,this.mouseUpTools)},ah("Horizontal",new vm),ah("Spot",new Sm),ah("Table",new Pm),ah("Viewbox",new Lm),ah("TableRow",new wm),ah("TableColumn",new Cm),ah("Graduated",new fp),ah("Grid",new dp),ag.add("GraphLinksModel",Ss),ag.add("TreeModel",Wl);var V0=xe.go,zy={get licenseKey(){return se.licenseKey},set licenseKey(a){se.licenseKey=a},get version(){return se.version},Group:Yn,EnumValue:me,List:Ve,Set:Ye,Map:xn,Point:jt,Size:Ze,Rect:ye,Margin:ni,Spot:yn,Geometry:We,PathFigure:qo,PathSegment:Ni,InputEvent:Ys,DiagramEvent:mh,ChangedEvent:Jr,Model:fn,GraphLinksModel:ki,TreeModel:Na,Binding:Vo,Transaction:as,UndoManager:eo,CommandHandler:Bt,Tool:Ei,DraggingTool:ti,DraggingInfo:Jh,DraggingOptions:st,LinkingBaseTool:so,LinkingTool:ea,RelinkingTool:cl,LinkReshapingTool:yo,ResizingTool:Zt,RotatingTool:pe,ClickSelectingTool:De,ActionTool:je,ClickCreatingTool:en,HTMLInfo:Cn,ContextMenuTool:_n,DragSelectingTool:rn,PanningTool:ln,TextEditingTool:Pn,ToolManager:jr,Animation:lo,AnimationManager:Fr,AnimationTrigger:Yo,Layer:bo,Diagram:se,Palette:ft,Overview:gt,Brush:er,GraphObject:te,Panel:Re,RowColumnDefinition:Jo,Shape:Qn,TextBlock:Mr,Picture:Ka,Part:vn,Adornment:Bi,Node:$e,Link:_e,Placeholder:ba,Layout:Zr,LayoutNetwork:kr,LayoutVertex:ns,LayoutEdge:vl,GridLayout:Is,PanelLayout:es,CircularLayout:oo,CircularNetwork:Ag,CircularVertex:Gp,CircularEdge:C0,ForceDirectedLayout:Ws,ForceDirectedNetwork:jc,ForceDirectedVertex:_p,ForceDirectedEdge:Hp,LayeredDigraphLayout:or,LayeredDigraphNetwork:Og,LayeredDigraphVertex:Kl,LayeredDigraphEdge:Up,TreeLayout:mi,TreeNetwork:Hc,TreeVertex:su,TreeEdge:jg};typeof V0=="object"&&V0.version&&Ki("WARNING: a `go` object on the root object is already defined. "+("Debug"in V0?"debug ":"")+"version: "+V0.version+", replaced with version: "+zy.version),se.prototype.go=zy,xe.go=zy,typeof on.exports=="object"&&(on.exports=typeof Jt.g!="undefined"?Jt.g.go:self.go)}();var It=typeof Jt.g!="undefined"?Jt.g.go:self.go;const ce=typeof Jt.g!="undefined"?Jt.g.go:self.go,Be=ce.Group,qe=ce.EnumValue,Se=ce.List,de=ce.Set,$t=ce.Map,He=ce.Point,ve=ce.Size,Pe=ce.Rect,ze=ce.Margin,Me=ce.Spot,tn=ce.Geometry,Nt=ce.PathFigure,nt=ce.PathSegment,et=ce.InputEvent,ht=ce.DiagramEvent,lt=ce.ChangedEvent,pt=ce.Model,vt=ce.GraphLinksModel,Ct=ce.TreeModel,bt=ce.Binding,zt=ce.Transaction,Qt=ce.UndoManager,ie=ce.CommandHandler,oe=ce.Tool,re=ce.DraggingTool,Ne=ce.DraggingInfo,ue=ce.LinkingBaseTool,ke=ce.LinkingTool,Ke=ce.RelinkingTool,Fe=ce.LinkReshapingTool,wn=ce.ResizingTool,Rn=ce.RotatingTool,$n=ce.ClickSelectingTool,di=ce.ActionTool,ee=ce.ClickCreatingTool,_t=ce.HTMLInfo,Kt=ce.ContextMenuTool,pn=ce.DragSelectingTool,Ln=ce.PanningTool,Ce=ce.TextEditingTool,sn=ce.ToolManager,cn=ce.Animation,Jn=ce.AnimationManager,Sn=ce.AnimationTrigger,he=ce.Layer,Te=ce.Diagram,Nn=ce.Palette,Bn=ce.Overview,Ht=ce.Brush,Mt=ce.GraphObject,wt=ce.Panel,At=ce.RowColumnDefinition,Ut=ce.Shape,Et=ce.TextBlock,be=ce.TextBlockMetrics,Dn=ce.Picture,zi=ce.Part,yi=ce.Adornment,ei=ce.Node,Qi=ce.Link,Mn=ce.Placeholder,sr=ce.Layout,Yi=ce.LayoutNetwork,Vr=ce.LayoutVertex,Ci=ce.LayoutEdge,Us=ce.GridLayout,is=ce.PanelLayout,xo=ce.CircularLayout,zr=ce.CircularNetwork,wl=ce.CircularVertex,Li=ce.CircularEdge,qi=ce.ForceDirectedLayout,aa=ce.ForceDirectedNetwork,Oa=ce.ForceDirectedVertex,Or=ce.ForceDirectedEdge,Il=ce.LayeredDigraphLayout,ku=ce.LayeredDigraphNetwork,bu=ce.LayeredDigraphVertex,Rh=ce.LayeredDigraphEdge,Xl=ce.TreeLayout,Ia=ce.TreeNetwork,Cl=ce.TreeVertex,bs=ce.TreeEdge,Qe=ce.version},15979:function(on,In,Jt){"use strict";Jt.d(In,{hP:function(){return Bn}});var It=function(Ht,Mt){return(It=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(wt,At){wt.__proto__=At}||function(wt,At){for(var Ut in At)Object.prototype.hasOwnProperty.call(At,Ut)&&(wt[Ut]=At[Ut])})(Ht,Mt)};function ce(Ht,Mt){function wt(){this.constructor=Ht}It(Ht,Mt),Ht.prototype=Mt===null?Object.create(Mt):(wt.prototype=Mt.prototype,new wt)}function Be(Ht,Mt,wt,At){return new(wt||(wt=Promise))(function(Ut,Et){function be(yi){try{zi(At.next(yi))}catch(ei){Et(ei)}}function Dn(yi){try{zi(At.throw(yi))}catch(ei){Et(ei)}}function zi(yi){var ei;yi.done?Ut(yi.value):(ei=yi.value,ei instanceof wt?ei:new wt(function(Qi){Qi(ei)})).then(be,Dn)}zi((At=At.apply(Ht,Mt||[])).next())})}function qe(Ht,Mt){var wt,At,Ut,Et,be={label:0,sent:function(){if(1&Ut[0])throw Ut[1];return Ut[1]},trys:[],ops:[]};return Et={next:Dn(0),throw:Dn(1),return:Dn(2)},typeof Symbol=="function"&&(Et[Symbol.iterator]=function(){return this}),Et;function Dn(zi){return function(yi){return function(ei){if(wt)throw new TypeError("Generator is already executing.");for(;be;)try{if(wt=1,At&&(Ut=2&ei[0]?At.return:ei[0]?At.throw||((Ut=At.return)&&Ut.call(At),0):At.next)&&!(Ut=Ut.call(At,ei[1])).done)return Ut;switch(At=0,Ut&&(ei=[2&ei[0],Ut.value]),ei[0]){case 0:case 1:Ut=ei;break;case 4:return be.label++,{value:ei[1],done:!1};case 5:be.label++,At=ei[1],ei=[0];continue;case 7:ei=be.ops.pop(),be.trys.pop();continue;default:if(Ut=be.trys,!((Ut=Ut.length>0&&Ut[Ut.length-1])||ei[0]!==6&&ei[0]!==2)){be=0;continue}if(ei[0]===3&&(!Ut||ei[1]>Ut[0]&&ei[1]<Ut[3])){be.label=ei[1];break}if(ei[0]===6&&be.label<Ut[1]){be.label=Ut[1],Ut=ei;break}if(Ut&&be.label<Ut[2]){be.label=Ut[2],be.ops.push(ei);break}Ut[2]&&be.ops.pop(),be.trys.pop();continue}ei=Mt.call(Ht,be)}catch(Qi){ei=[6,Qi],At=0}finally{wt=Ut=0}if(5&ei[0])throw ei[1];return{value:ei[0]?ei[1]:void 0,done:!0}}([zi,yi])}}}function Se(){for(var Ht=0,Mt=0,wt=arguments.length;Mt<wt;Mt++)Ht+=arguments[Mt].length;var At=Array(Ht),Ut=0;for(Mt=0;Mt<wt;Mt++)for(var Et=arguments[Mt],be=0,Dn=Et.length;be<Dn;be++,Ut++)At[Ut]=Et[be];return At}var de=function(){function Ht(){}return Ht.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Ht.setAttributes=function(Mt,wt){for(var At=0,Ut=wt;At<Ut.length;At++){var Et=Ut[At],be=Et[0],Dn=Et[1];Mt.setAttribute(be,Dn)}},Ht.createRect=function(Mt,wt,At){var Ut=document.createElementNS("http://www.w3.org/2000/svg","rect");return Ut.setAttribute("width",Mt.toString()),Ut.setAttribute("height",wt.toString()),At&&Ht.setAttributes(Ut,At),Ut},Ht.createLine=function(Mt,wt,At,Ut,Et){var be=document.createElementNS("http://www.w3.org/2000/svg","line");return be.setAttribute("x1",Mt.toString()),be.setAttribute("y1",wt.toString()),be.setAttribute("x2",At.toString()),be.setAttribute("y2",Ut.toString()),Et&&Ht.setAttributes(be,Et),be},Ht.createPolygon=function(Mt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","polygon");return At.setAttribute("points",Mt),wt&&Ht.setAttributes(At,wt),At},Ht.createCircle=function(Mt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","circle");return At.setAttribute("cx",(Mt/2).toString()),At.setAttribute("cy",(Mt/2).toString()),At.setAttribute("r",Mt.toString()),wt&&Ht.setAttributes(At,wt),At},Ht.createEllipse=function(Mt,wt,At){var Ut=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return Ut.setAttribute("cx",(Mt/2).toString()),Ut.setAttribute("cy",(wt/2).toString()),Ut.setAttribute("rx",(Mt/2).toString()),Ut.setAttribute("ry",(wt/2).toString()),At&&Ht.setAttributes(Ut,At),Ut},Ht.createGroup=function(Mt){var wt=document.createElementNS("http://www.w3.org/2000/svg","g");return Mt&&Ht.setAttributes(wt,Mt),wt},Ht.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Ht.createMarker=function(Mt,wt,At,Ut,Et,be,Dn){var zi=document.createElementNS("http://www.w3.org/2000/svg","marker");return Ht.setAttributes(zi,[["id",Mt],["orient",wt],["markerWidth",At.toString()],["markerHeight",Ut.toString()],["refX",Et.toString()],["refY",be.toString()]]),zi.appendChild(Dn),zi},Ht.createText=function(Mt){var wt=document.createElementNS("http://www.w3.org/2000/svg","text");return wt.setAttribute("x","0"),wt.setAttribute("y","0"),Mt&&Ht.setAttributes(wt,Mt),wt},Ht.createTSpan=function(Mt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","tspan");return At.textContent=Mt,wt&&Ht.setAttributes(At,wt),At},Ht.createImage=function(Mt){var wt=document.createElementNS("http://www.w3.org/2000/svg","image");return Mt&&Ht.setAttributes(wt,Mt),wt},Ht.createPoint=function(Mt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return At.x=Mt,At.y=wt,At},Ht.createPath=function(Mt,wt){var At=document.createElementNS("http://www.w3.org/2000/svg","path");return At.setAttribute("d",Mt),wt&&Ht.setAttributes(At,wt),At},Ht}(),$t=function(){function Ht(){}return Ht.addKey=function(Mt){Ht.key=Mt},Object.defineProperty(Ht,"isLicensed",{get:function(){return!!Ht.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Ht.key)},enumerable:!1,configurable:!0}),Ht}(),He=function(){function Ht(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return Ht.prototype.rasterize=function(Mt,wt,At){var Ut=this;return new Promise(function(Et){var be=At!==void 0?At:document.createElement("canvas");Mt===null&&(Ut.markersOnly=!0,Ut.naturalSize=!1);var Dn=document.createElementNS("http://www.w3.org/2000/svg","svg");Dn.setAttribute("xmlns","http://www.w3.org/2000/svg"),Dn.setAttribute("width",wt.width.baseVal.valueAsString),Dn.setAttribute("height",wt.height.baseVal.valueAsString),Dn.setAttribute("viewBox","0 0 "+wt.viewBox.baseVal.width.toString()+" "+wt.viewBox.baseVal.height.toString()),Dn.innerHTML=wt.innerHTML,Ut.naturalSize===!0?(Dn.width.baseVal.value=Mt.naturalWidth,Dn.height.baseVal.value=Mt.naturalHeight):Ut.width!==void 0&&Ut.height!==void 0&&(Dn.width.baseVal.value=Ut.width,Dn.height.baseVal.value=Ut.height),be.width=Dn.width.baseVal.value,be.height=Dn.height.baseVal.value;var zi=Dn.outerHTML,yi=be.getContext("2d");Ut.markersOnly!==!0&&yi.drawImage(Mt,0,0,be.width,be.height);var ei=window.URL,Qi=new Image(be.width,be.height);Qi.setAttribute("crossOrigin","anonymous");var Mn=new Blob([zi],{type:"image/svg+xml"}),sr=ei.createObjectURL(Mn);Qi.onload=function(){yi.drawImage(Qi,0,0),ei.revokeObjectURL(sr);var Yi=be.toDataURL(Ut.imageType,Ut.imageQuality);Et(Yi)},Qi.src=sr})},Ht}(),ve=function(){},Pe=function(){function Ht(Mt){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+Mt+"_"}return Object.defineProperty(Ht.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),Ht.prototype.addClass=function(Mt){return this.styleSheet===void 0&&this.addStyleSheet(),Mt.name=""+this.classNamePrefix+Mt.localName,this.classes.push(Mt),this.styleSheet.sheet.insertRule("."+Mt.name+" {"+Mt.style+"}",this.styleSheet.sheet.cssRules.length),Mt},Ht.prototype.addRule=function(Mt){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(Mt),this.styleSheet.sheet.insertRule(Mt.selector+" {"+Mt.style+"}",this.styleSheet.sheet.cssRules.length)},Ht.prototype.addStyleSheet=function(){var Mt;this.styleSheet=document.createElement("style"),((Mt=this.styleSheetRoot)!==null&&Mt!==void 0?Mt:document.head).appendChild(this.styleSheet),this.addRule(new ze("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new ze("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Me("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Me("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},Ht.prototype.removeStyleSheet=function(){var Mt;this.styleSheet&&(((Mt=this.styleSheetRoot)!==null&&Mt!==void 0?Mt:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Ht}(),ze=function(Ht,Mt){this.selector=Ht,this.style=Mt},Me=function(Ht,Mt){this.localName=Ht,this.style=Mt},tn=function(){function Ht(Mt,wt,At,Ut,Et){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=Mt,this.displayMode=wt,this.markerItems=At,this.uiStyleSettings=Ut,this.styles=Et,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return Ht.prototype.show=function(Mt){var wt=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Mt,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var At=document.createElement("div");At.className=this.toolbarBlockStyleClass.name,At.style.whiteSpace="nowrap",this.uiContainer.appendChild(At),this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(At,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"notes"),this.markerButtonBlock=document.createElement("div"),this.markerButtonBlock.className=this.toolbarBlockStyleClass.name,this.markerButtonBlock.style.flexGrow="2",this.markerButtonBlock.style.textAlign="center",this.uiContainer.appendChild(this.markerButtonBlock),this.markerButtonOverflowBlock=document.createElement("div"),this.markerButtonOverflowBlock.className=this.toolbarOverflowBlockStyleClass.name+" "+(this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName?this.uiStyleSettings.toolbarOverflowBlockStyleColorsClassName:this.toolbarOverflowBlockStyleColorsClass.name),this.markerButtonOverflowBlock.style.display="none",this.uiContainer.appendChild(this.markerButtonOverflowBlock),this.markerItems&&(this.markerItems.forEach(function(Et){var be=document.createElement("div");be.className=""+wt.toolbarButtonStyleClass.name,be.setAttribute("data-type-name",Et.typeName),be.innerHTML=Et.icon,be.addEventListener("click",function(){wt.markerToolbarButtonClicked(be,Et)}),wt.buttons.push(be),wt.markerButtons.push(be)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var Ut=document.createElement("div");Ut.className=this.toolbarBlockStyleClass.name,Ut.style.whiteSpace="nowrap",Ut.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(Ut),this.addActionButton(Ut,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(Ut,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},Ht.prototype.addButtonClickListener=function(Mt){this.buttonClickListeners.push(Mt)},Ht.prototype.removeButtonClickListener=function(Mt){this.buttonClickListeners.indexOf(Mt)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(Mt),1)},Ht.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},Ht.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var Mt=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var wt=0;wt<this.markerButtons.length;wt++)wt<Mt||wt===Mt&&this.markerButtons.length-1===Mt?this.markerButtonBlock.appendChild(this.markerButtons[wt]):(wt===Mt&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[wt]))}},Ht.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},Ht.prototype.resetButtonStyles=function(){var Mt=this;this.buttons.forEach(function(wt){wt.className=wt.className.replace(Mt.uiStyleSettings.toolbarButtonStyleColorsClassName?Mt.uiStyleSettings.toolbarButtonStyleColorsClassName:Mt.toolbarButtonStyleColorsClass.name,"").trim(),wt.className=wt.className.replace(Mt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?Mt.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:Mt.toolbarActiveButtonStyleColorsClass.name,"").trim(),wt.className+=" "+(Mt.uiStyleSettings.toolbarButtonStyleColorsClassName?Mt.uiStyleSettings.toolbarButtonStyleColorsClassName:Mt.toolbarButtonStyleColorsClass.name)})},Ht.prototype.addActionButton=function(Mt,wt,At){var Ut=this,Et=document.createElement("div");switch(Et.className=""+this.toolbarButtonStyleClass.name,Et.innerHTML=wt,Et.setAttribute("data-action",At),Et.addEventListener("click",function(){Ut.actionToolbarButtonClicked(Et,At)}),At){case"select":Et.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":Et.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":Et.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":Et.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":Et.style.fill=this.uiStyleSettings.closeButtonColor}Mt.appendChild(Et),this.buttons.push(Et)},Ht.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Me("toolbar",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: row;
|
|
justify-content: space-between;
|
|
height: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolbarStyleColorsClass=this.styles.addClass(new Me("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Me("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new Me("toolbar-overflow-block",`
|
|
position: absolute;
|
|
top: `+this.uiStyleSettings.toolbarHeight+`px;
|
|
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
|
|
z-index: 10;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new Me("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var Mt=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Me("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*Mt)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*Mt)+`px;
|
|
padding: `+Mt+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Me("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Me("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new ze("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},Ht.prototype.markerToolbarButtonClicked=function(Mt,wt){this.setActiveButton(Mt),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(At){return At("marker",wt)}),this.markerButtonOverflowBlock.style.display="none"},Ht.prototype.actionToolbarButtonClicked=function(Mt,wt){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(At){return At("action",wt)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},Ht.prototype.setActiveButton=function(Mt){this.resetButtonStyles(),Mt.className=Mt.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),Mt.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},Ht.prototype.setActiveMarkerButton=function(Mt){var wt=this.markerButtons.find(function(At){return At.getAttribute("data-type-name")===Mt});wt&&this.setActiveButton(wt)},Ht.prototype.setCurrentMarker=function(Mt){var wt=this;this.currentMarker=Mt,this.buttons.filter(function(At){return/delete|notes/.test(At.getAttribute("data-action"))}).forEach(function(At){wt.currentMarker===void 0?(At.style.fillOpacity="0.4",At.style.pointerEvents="none"):(At.style.fillOpacity="1",At.style.pointerEvents="all")})},Ht}(),Nt=function(){function Ht(Mt,wt,At,Ut){this.panels=[],this.panelButtons=[],this.markerjsContainer=Mt,this.displayMode=wt,this.uiStyleSettings=At,this.styles=Ut,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return Ht.prototype.addStyles=function(){var Mt;this.toolboxStyleClass=this.styles.addClass(new Me("toolbox",`
|
|
width: 100%;
|
|
flex-shrink: 0;
|
|
display: flex;
|
|
flex-direction: column;
|
|
font-family: sans-serif;
|
|
`+(this.displayMode==="popup"?"height:"+2.5*this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
box-sizing: content-box;
|
|
`+(this.displayMode==="popup"?"background-color: "+this.uiStyleSettings.canvasBackgroundColor+";":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
`+(this.displayMode==="inline"?"border-bottom-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
|
|
overflow: hidden;
|
|
`)),this.toolboxStyleColorsClass=this.styles.addClass(new Me("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var wt=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new Me("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new Me("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new Me("toolbox-panel-row",`
|
|
display: flex;
|
|
`+(this.displayMode==="inline"?"position: absolute;":"")+`
|
|
`+(this.displayMode==="inline"?"bottom: "+this.uiStyleSettings.toolbarHeight+"px;":"")+`
|
|
cursor: default;
|
|
height: `+1.5*this.uiStyleSettings.toolbarHeight+`px;
|
|
`+(this.displayMode==="inline"?"width: 100%;":"")+`
|
|
box-sizing: content-box;
|
|
`)),this.toolboxPanelRowStyleColorsClass=this.styles.addClass(new Me("toolbox-panel-row_colors",`
|
|
background-color: `+((Mt=this.uiStyleSettings.toolboxBackgroundColor)!==null&&Mt!==void 0?Mt:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new Me("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*wt)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*wt)+`px;
|
|
padding: `+wt+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new Me("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new Me("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new ze("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new ze("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},Ht.prototype.show=function(Mt){var wt;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=Mt,this.uiContainer.className=this.toolboxStyleClass.name+" "+((wt=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&wt!==void 0?wt:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},Ht.prototype.setPanelButtons=function(Mt){var wt,At,Ut=this;this.panels=Mt,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((wt=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&wt!==void 0?wt:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((At=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&At!==void 0?At:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(Et){var be;Et.uiStyleSettings=Ut.uiStyleSettings;var Dn=document.createElement("div");Dn.className=Ut.toolboxButtonStyleClass.name+" "+((be=Ut.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&be!==void 0?be:Ut.toolboxButtonStyleColorsClass.name),Dn.innerHTML=Et.icon,Dn.title=Et.title,Dn.addEventListener("click",function(){Ut.panelButtonClick(Et)}),Ut.panelButtons.push(Dn),Ut.buttonRow.appendChild(Dn)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},Ht.prototype.panelButtonClick=function(Mt){var wt=this,At=-1;if(Mt!==this.activePanel){At=this.panels.indexOf(Mt),this.panelRow.innerHTML="";var Ut=Mt.getUi();Ut.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(Ut),this.panelRow.style.display="flex",this.panelRow.style.visibility="visible",this.panelRow.className=this.panelRow.className.replace(this.styles.fadeOutAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeInAnimationClassName,this.activePanel=Mt}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){wt.displayMode==="inline"?wt.panelRow.style.display="none":wt.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(Et,be){var Dn,zi;Et.className=wt.toolboxButtonStyleClass.name+" "+(be===At?""+((Dn=wt.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Dn!==void 0?Dn:wt.toolboxActiveButtonStyleColorsClass.name):""+((zi=wt.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&zi!==void 0?zi:wt.toolboxButtonStyleColorsClass.name))})},Ht}(),nt=function(Ht,Mt){this.title=Ht,this.icon=Mt},et=function(Ht){function Mt(wt,At,Ut,Et){var be=Ht.call(this,wt,Et||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return be.colors=[],be.addTransparent=!1,be.colorBoxes=[],be.colors=At,be.currentColor=Ut,be.setCurrentColor=be.setCurrentColor.bind(be),be.getColorBox=be.getColorBox.bind(be),be}return ce(Mt,Ht),Mt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.overflow="hidden",At.style.whiteSpace="nowrap",this.colors.forEach(function(Ut){var Et=wt.getColorBox(Ut);At.appendChild(Et),wt.colorBoxes.push(Et)}),At},Mt.prototype.getColorBox=function(wt){var At=this,Ut=this.uiStyleSettings.toolbarHeight/4,Et=this.uiStyleSettings.toolbarHeight-Ut,be=document.createElement("div");be.style.display="inline-block",be.style.boxSizing="content-box",be.style.width=Et-2+"px",be.style.height=Et-2+"px",be.style.padding="1px",be.style.marginRight="2px",be.style.marginBottom="2px",be.style.borderWidth="2px",be.style.borderStyle="solid",be.style.borderRadius=(Et+2)/2+"px",be.style.borderColor=wt===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",be.addEventListener("click",function(){At.setCurrentColor(wt,be)});var Dn=document.createElement("div");return Dn.style.display="inline-block",Dn.style.width=Et-2+"px",Dn.style.height=Et-2+"px",Dn.style.backgroundColor=wt,Dn.style.borderRadius=Et/2+"px",wt==="transparent"&&(Dn.style.fill=this.uiStyleSettings.toolboxAccentColor,Dn.innerHTML=`<svg viewBox="0 0 24 24">
|
|
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
|
|
</svg>`),be.appendChild(Dn),be},Mt.prototype.setCurrentColor=function(wt,At){var Ut=this;this.currentColor=wt,this.colorBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Ut.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(wt)},Mt}(nt),ht=function(){function Ht(Mt,wt,At){this._state="new",this._isSelected=!1,this._container=Mt,this._overlayContainer=wt,this.globalSettings=At,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(Ht.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),Ht.prototype.ownsTarget=function(Mt){return!1},Object.defineProperty(Ht.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),Ht.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},Ht.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},Ht.prototype.pointerDown=function(Mt,wt){},Ht.prototype.dblClick=function(Mt,wt){},Ht.prototype.manipulate=function(Mt){},Ht.prototype.pointerUp=function(Mt){this.stateChanged()},Ht.prototype.dispose=function(){},Ht.prototype.addMarkerVisualToContainer=function(Mt){this.container.childNodes.length>0?this.container.insertBefore(Mt,this.container.childNodes[0]):this.container.appendChild(Mt)},Ht.prototype.getState=function(){return{typeName:Ht.typeName,state:this.state,notes:this.notes}},Ht.prototype.restoreState=function(Mt){this._state=Mt.state,this.notes=Mt.notes},Ht.prototype.scale=function(Mt,wt){},Ht.prototype.colorChanged=function(Mt){this.onColorChanged&&this.onColorChanged(Mt),this.stateChanged()},Ht.prototype.fillColorChanged=function(Mt){this.onFillColorChanged&&this.onFillColorChanged(Mt),this.stateChanged()},Ht.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var Mt=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),Mt.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(Mt)&&this.onStateChanged(this)}},Ht.typeName="MarkerBase",Ht}(),lt=function(){function Ht(){this.findGripByVisual=this.findGripByVisual.bind(this)}return Ht.prototype.findGripByVisual=function(Mt){return this.topLeft.ownsTarget(Mt)?this.topLeft:this.topCenter.ownsTarget(Mt)?this.topCenter:this.topRight.ownsTarget(Mt)?this.topRight:this.centerLeft.ownsTarget(Mt)?this.centerLeft:this.centerRight.ownsTarget(Mt)?this.centerRight:this.bottomLeft.ownsTarget(Mt)?this.bottomLeft:this.bottomCenter.ownsTarget(Mt)?this.bottomCenter:this.bottomRight.ownsTarget(Mt)?this.bottomRight:void 0},Ht}(),pt=function(){function Ht(){this.GRIP_SIZE=10,this.visual=de.createGroup(),this.visual.appendChild(de.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(de.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Ht.prototype.ownsTarget=function(Mt){return Mt===this.visual||Mt===this.visual.childNodes[0]||Mt===this.visual.childNodes[1]},Ht}(),vt=function(){function Ht(){}return Ht.toITransformMatrix=function(Mt){return{a:Mt.a,b:Mt.b,c:Mt.c,d:Mt.d,e:Mt.e,f:Mt.f}},Ht.toSVGMatrix=function(Mt,wt){return Mt.a=wt.a,Mt.b=wt.b,Mt.c=wt.c,Mt.d=wt.d,Mt.e=wt.e,Mt.f=wt.f,Mt},Ht}(),Ct=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.left=0,Et.top=0,Et.width=0,Et.height=0,Et.defaultSize={x:50,y:20},Et.offsetX=0,Et.offsetY=0,Et.rotationAngle=0,Et.CB_DISTANCE=10,Et._suppressMarkerCreateEvent=!1,Et.container.transform.baseVal.appendItem(de.createTransform()),Et.setupControlBox(),Et}return ce(Mt,Ht),Object.defineProperty(Mt.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(Mt.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(Mt.prototype,"visual",{get:function(){return this._visual},set:function(wt){this._visual=wt;var At=de.createTransform();this._visual.transform.baseVal.appendItem(At)},enumerable:!1,configurable:!0}),Mt.prototype.ownsTarget=function(wt){return!!Ht.prototype.ownsTarget.call(this,wt)||!!(this.controlGrips.findGripByVisual(wt)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(wt))},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.left=wt.x,this.top=wt.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var Ut=this.unrotatePoint(wt);if(this.manipulationStartX=Ut.x,this.manipulationStartY=Ut.y,this.offsetX=Ut.x-this.left,this.offsetY=Ut.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(At),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(At)){this.activeGrip=this.rotatorGrip;var Et=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=Et.x-this.width/2,this.top=Et.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var be=this.container.transform.baseVal.getItem(0);be.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(be,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},Mt.prototype.pointerUp=function(wt){var At=this.state;Ht.prototype.pointerUp.call(this,wt),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(wt),this._state="select",At==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},Mt.prototype.moveVisual=function(wt){this.visual.style.transform="translate("+wt.x+"px, "+wt.y+"px)"},Mt.prototype.manipulate=function(wt){var At=this.unrotatePoint(wt);this.state==="creating"?this.resize(wt):this.state==="move"?(this.left=this.manipulationStartLeft+(At.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(At.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(At):this.state==="rotate"&&this.rotate(wt)},Mt.prototype.resize=function(wt){var At=this.manipulationStartLeft,Ut=this.manipulationStartWidth,Et=this.manipulationStartTop,be=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:At=this.manipulationStartLeft+wt.x-this.manipulationStartX,Ut=this.manipulationStartWidth+this.manipulationStartLeft-At;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:Ut=this.manipulationStartWidth+wt.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:Et=this.manipulationStartTop+wt.y-this.manipulationStartY,be=this.manipulationStartHeight+this.manipulationStartTop-Et;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:be=this.manipulationStartHeight+wt.y-this.manipulationStartY}Ut>=0?(this.left=At,this.width=Ut):(this.left=At+Ut,this.width=-Ut),be>=0?(this.top=Et,this.height=be):(this.top=Et+be,this.height=-be),this.setSize()},Mt.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},Mt.prototype.rotate=function(wt){if(Math.abs(wt.x-this.centerX)>.1){var At=Math.sign(wt.x-this.centerX);this.rotationAngle=180*Math.atan((wt.y-this.centerY)/(wt.x-this.centerX))/Math.PI+90*At,this.applyRotation()}},Mt.prototype.applyRotation=function(){var wt=this.container.transform.baseVal.getItem(0);wt.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(wt,0)},Mt.prototype.rotatePoint=function(wt){if(this.rotationAngle===0)return wt;var At=this.container.getCTM(),Ut=de.createPoint(wt.x,wt.y);return{x:(Ut=Ut.matrixTransform(At)).x,y:Ut.y}},Mt.prototype.unrotatePoint=function(wt){if(this.rotationAngle===0)return wt;var At=this.container.getCTM();At=At.inverse();var Ut=de.createPoint(wt.x,wt.y);return{x:(Ut=Ut.matrixTransform(At)).x,y:Ut.y}},Mt.prototype.select=function(){Ht.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Mt.prototype.deselect=function(){Ht.prototype.deselect.call(this),this.controlBox.style.display="none"},Mt.prototype.setupControlBox=function(){this.controlBox=de.createGroup();var wt=de.createTransform();wt.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(wt),this.container.appendChild(this.controlBox),this.controlRect=de.createRect(this.width+this.CB_DISTANCE,this.height+this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"],["fill","transparent"],["pointer-events","none"]]),this.controlBox.appendChild(this.controlRect),this.globalSettings.disableRotation!==!0&&(this.rotatorGripLine=de.createLine((this.width+2*this.CB_DISTANCE)/2,this.top-this.CB_DISTANCE,(this.width+2*this.CB_DISTANCE)/2,this.top-3*this.CB_DISTANCE,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.appendChild(this.rotatorGripLine)),this.controlGrips=new lt,this.addControlGrips(),this.controlBox.style.display="none"},Mt.prototype.adjustControlBox=function(){var wt=this.controlBox.transform.baseVal.getItem(0);wt.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(wt,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},Mt.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},Mt.prototype.createGrip=function(){var wt=new pt;return wt.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(wt.visual),wt},Mt.prototype.positionGrips=function(){var wt=this.controlGrips.topLeft.GRIP_SIZE,At=-wt/2,Ut=At,Et=(this.width+this.CB_DISTANCE)/2-wt/2,be=(this.height+this.CB_DISTANCE)/2-wt/2,Dn=this.height+this.CB_DISTANCE-wt/2,zi=this.width+this.CB_DISTANCE-wt/2;this.positionGrip(this.controlGrips.topLeft.visual,At,Ut),this.positionGrip(this.controlGrips.topCenter.visual,Et,Ut),this.positionGrip(this.controlGrips.topRight.visual,zi,Ut),this.positionGrip(this.controlGrips.centerLeft.visual,At,be),this.positionGrip(this.controlGrips.centerRight.visual,zi,be),this.positionGrip(this.controlGrips.bottomLeft.visual,At,Dn),this.positionGrip(this.controlGrips.bottomCenter.visual,Et,Dn),this.positionGrip(this.controlGrips.bottomRight.visual,zi,Dn),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,Et,Ut-3*this.CB_DISTANCE)},Mt.prototype.positionGrip=function(wt,At,Ut){var Et=wt.transform.baseVal.getItem(0);Et.setTranslate(At,Ut),wt.transform.baseVal.replaceItem(Et,0)},Mt.prototype.hideControlBox=function(){this.controlBox.style.display="none"},Mt.prototype.showControlBox=function(){this.controlBox.style.display=""},Mt.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:vt.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:vt.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},Ht.prototype.getState.call(this))},Mt.prototype.restoreState=function(wt){Ht.prototype.restoreState.call(this,wt);var At=wt;this.left=At.left,this.top=At.top,this.width=At.width,this.height=At.height,this.rotationAngle=At.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,At.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(vt.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,At.containerTransformMatrix))},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At);var Ut=this.rotatePoint({x:this.left,y:this.top}),Et=this.unrotatePoint({x:Ut.x*wt,y:Ut.y*At});this.left=Et.x,this.top=Et.y,this.width=this.width*wt,this.height=this.height*At,this.adjustControlBox()},Mt}(ht),bt=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.opacity=1,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setFillColor=Et.setFillColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.createVisual=Et.createVisual.bind(Et),Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.visual)},Mt.prototype.createVisual=function(){this.visual=de.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},Mt.prototype.manipulate=function(wt){Ht.prototype.manipulate.call(this,wt)},Mt.prototype.resize=function(wt){Ht.prototype.resize.call(this,wt),this.setSize()},Mt.prototype.setSize=function(){Ht.prototype.setSize.call(this),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},Mt.prototype.pointerUp=function(wt){Ht.prototype.pointerUp.call(this,wt),this.setSize()},Mt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(wt),this.stateChanged()},Mt.prototype.setFillColor=function(wt){this.fillColor=wt,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},Mt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Mt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Mt.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ht.prototype.getState.call(this))},Mt.prototype.restoreState=function(wt){var At=wt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.opacity=At.opacity,this.createVisual(),Ht.prototype.restoreState.call(this,wt),this.setSize()},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.setSize()},Mt.title="Rectangle marker",Mt}(Ct),zt=function(Ht){function Mt(wt,At,Ut,Et){var be=Ht.call(this,wt,Et||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return be.widths=[],be.widthBoxes=[],be.widths=At,be.currentWidth=Ut,be.setCurrentWidth=be.setCurrentWidth.bind(be),be}return ce(Mt,Ht),Mt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",this.widths.forEach(function(Ut){var Et=document.createElement("div");Et.style.display="flex",Et.style.flexGrow="2",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.borderColor=Ut===wt.currentWidth?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentWidth(Ut,Et)}),At.appendChild(Et);var be=document.createElement("div");be.innerText=Ut.toString(),be.style.marginRight="5px",Et.appendChild(be);var Dn=document.createElement("div");Dn.style.minHeight="20px",Dn.style.flexGrow="2",Dn.style.display="flex",Dn.style.alignItems="center";var zi=document.createElement("hr");zi.style.minWidth="20px",zi.style.border="0px",zi.style.borderTop=Ut+"px solid "+wt.uiStyleSettings.toolboxColor,zi.style.flexGrow="2",Dn.appendChild(zi),Et.appendChild(Dn),wt.widthBoxes.push(Et)}),At},Mt.prototype.setCurrentWidth=function(wt,At){var Ut=this;this.currentWidth=wt,this.widthBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Ut.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},Mt}(nt),Qt=function(Ht){function Mt(wt,At,Ut,Et){var be=Ht.call(this,wt,Et||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return be.styles=[],be.styleBoxes=[],be.styles=At,be.currentStyle=Ut,be.setCurrentStyle=be.setCurrentStyle.bind(be),be}return ce(Mt,Ht),Mt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",this.styles.forEach(function(Ut){var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.overflow="hidden",Et.style.maxWidth=100/wt.styles.length-5+"%",Et.style.borderColor=Ut===wt.currentStyle?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentStyle(Ut,Et)}),At.appendChild(Et);var be=document.createElement("div");be.style.minHeight="20px",be.style.flexGrow="2",be.style.overflow="hidden";var Dn=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+wt.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(Ut!==""?'stroke-dasharray="'+Ut+'"':"")+` />
|
|
</svg>`;be.innerHTML=Dn,Et.appendChild(be),wt.styleBoxes.push(Et)}),At},Mt.prototype.setCurrentStyle=function(wt,At){var Ut=this;this.currentStyle=wt,this.styleBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Ut.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},Mt}(nt),ie=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.strokeColor=Ut.defaultColor,Et.strokeWidth=Ut.defaultStrokeWidth,Et.strokeDasharray=Ut.defaultStrokeDasharray,Et.strokePanel=new et("Line color",Ut.defaultColorSet,Ut.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new zt("Line width",Ut.defaultStrokeWidths,Ut.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Qt("Line style",Ut.defaultStrokeDasharrays,Ut.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return ce(Mt,Ht),Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Ht.prototype.getState.call(this);return wt.typeName=Mt.typeName,wt},Mt.typeName="FrameMarker",Mt.title="Frame marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',Mt}(bt),oe=function(){this.defaultColorSet=["#EF4444","#10B981","#2563EB","#FFFF00","#7C3AED","#F472B6","#000000","#FFFFFF"],this.defaultColor=this.defaultColorSet[0],this.defaultFillColor=this.defaultColorSet[0],this.defaultStrokeColor=this.defaultColorSet[7],this.defaultHighlightColor=this.defaultColorSet[3],this.defaultStrokeWidth=3,this.defaultStrokeDasharray="",this.defaultHighlightOpacity=.5,this.defaultFontFamily="Helvetica, Arial, sans-serif",this.defaultStrokeWidths=[1,2,3,5,10],this.defaultStrokeDasharrays=["","3","12 3","9 6 3 6"],this.defaultOpacitySteps=[.1,.25,.5,.75,1],this.displayMode="inline",this.defaultFontFamilies=['Times, "Times New Roman", serif',"Helvetica, Arial, sans-serif",'Courier, "Courier New", monospace',"cursive","fantasy"],this.popupMargin=30,this.newFreehandMarkerOnPointerUp=!1,this.defaultColorsFollowCurrentColors=!1,this.freehandPixelRatio=1,this.disableRotation=!1,this.defaultCaptionFontSize="1rem",this.defaultCaptionText="Text"},re=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.x1=0,Et.y1=0,Et.x2=0,Et.y2=0,Et.defaultLength=50,Et.manipulationStartX=0,Et.manipulationStartY=0,Et.manipulationStartX1=0,Et.manipulationStartY1=0,Et.manipulationStartX2=0,Et.manipulationStartY2=0,Et.setupControlBox(),Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!!Ht.prototype.ownsTarget.call(this,wt)||!(!this.grip1.ownsTarget(wt)&&!this.grip2.ownsTarget(wt))},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.manipulationStartX=wt.x,this.manipulationStartY=wt.y,this.state==="new"&&(this.x1=wt.x,this.y1=wt.y,this.x2=wt.x,this.y2=wt.y),this.manipulationStartX1=this.x1,this.manipulationStartY1=this.y1,this.manipulationStartX2=this.x2,this.manipulationStartY2=this.y2,this.state!=="new"&&(this.select(),this.grip1.ownsTarget(At)?this.activeGrip=this.grip1:this.grip2.ownsTarget(At)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},Mt.prototype.pointerUp=function(wt){var At=this.state;Ht.prototype.pointerUp.call(this,wt),this.state==="creating"&&Math.abs(this.x1-this.x2)<10&&Math.abs(this.y1-this.y2)<10?(this.x2=this.x1+this.defaultLength,this.adjustVisual(),this.adjustControlBox()):this.manipulate(wt),this._state="select",At==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},Mt.prototype.adjustVisual=function(){},Mt.prototype.manipulate=function(wt){this.state==="creating"?this.resize(wt):this.state==="move"?(this.x1=this.manipulationStartX1+wt.x-this.manipulationStartX,this.y1=this.manipulationStartY1+wt.y-this.manipulationStartY,this.x2=this.manipulationStartX2+wt.x-this.manipulationStartX,this.y2=this.manipulationStartY2+wt.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(wt)},Mt.prototype.resize=function(wt){switch(this.activeGrip){case this.grip1:this.x1=wt.x,this.y1=wt.y;break;case this.grip2:case void 0:this.x2=wt.x,this.y2=wt.y}this.adjustVisual(),this.adjustControlBox()},Mt.prototype.select=function(){Ht.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},Mt.prototype.deselect=function(){Ht.prototype.deselect.call(this),this.controlBox.style.display="none"},Mt.prototype.setupControlBox=function(){this.controlBox=de.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},Mt.prototype.adjustControlBox=function(){this.positionGrips()},Mt.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},Mt.prototype.createGrip=function(){var wt=new pt;return wt.visual.transform.baseVal.appendItem(de.createTransform()),this.controlBox.appendChild(wt.visual),wt},Mt.prototype.positionGrips=function(){var wt=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-wt/2,this.y1-wt/2),this.positionGrip(this.grip2.visual,this.x2-wt/2,this.y2-wt/2)},Mt.prototype.positionGrip=function(wt,At,Ut){var Et=wt.transform.baseVal.getItem(0);Et.setTranslate(At,Ut),wt.transform.baseVal.replaceItem(Et,0)},Mt.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},Ht.prototype.getState.call(this))},Mt.prototype.restoreState=function(wt){Ht.prototype.restoreState.call(this,wt);var At=wt;this.x1=At.x1,this.y1=At.y1,this.x2=At.x2,this.y2=At.y2},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.x1=this.x1*wt,this.y1=this.y1*At,this.x2=this.x2*wt,this.y2=this.y2*At,this.adjustVisual(),this.adjustControlBox()},Mt}(ht),Ne=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.strokeColor=Ut.defaultColor,Et.strokeWidth=Ut.defaultStrokeWidth,Et.strokeDasharray=Ut.defaultStrokeDasharray,Et.strokePanel=new et("Line color",Ut.defaultColorSet,Ut.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new zt("Line width",Ut.defaultStrokeWidths,Ut.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Qt("Line style",Ut.defaultStrokeDasharrays,Ut.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.selectorLine&&wt!==this.visibleLine)},Mt.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=de.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},Mt.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),de.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Mt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.adjustVisual(),this.colorChanged(wt)},Mt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.adjustVisual()},Mt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){Ht.prototype.restoreState.call(this,wt);var At=wt;this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.createVisual(),this.adjustVisual()},Mt.typeName="LineMarker",Mt.title="Line marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',Mt}(re),ue=function(Ht){function Mt(wt,At,Ut,Et){var be=Ht.call(this,wt,Et||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return be.fonts=[],be.fontBoxes=[],be.fonts=At,be.currentFont=Ut,be.setCurrentFont=be.setCurrentFont.bind(be),be}return ce(Mt,Ht),Mt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.overflow="hidden",At.style.flexGrow="2",this.fonts.forEach(function(Ut){var Et=document.createElement("div");Et.style.display="inline-block",Et.style.alignItems="center",Et.style.justifyContent="space-between",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.overflow="hidden",Et.style.maxWidth=100/wt.fonts.length-5+"%",Et.style.borderColor=Ut===wt.currentFont?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentFont(Ut,Et)}),At.appendChild(Et);var be=document.createElement("div");be.style.display="flex",be.style.minHeight="20px",be.style.flexGrow="2",be.style.fontFamily=Ut,be.style.overflow="hidden";var Dn=document.createElement("div");Dn.style.whiteSpace="nowrap",Dn.style.overflow="hidden",Dn.style.textOverflow="ellipsis",Dn.innerHTML="The quick brown fox jumps over the lazy dog",be.appendChild(Dn),Et.appendChild(be),wt.fontBoxes.push(Et)}),At},Mt.prototype.setCurrentFont=function(wt,At){var Ut=this;this.currentFont=wt,this.fontBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Ut.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},Mt}(nt),ke=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.color="transparent",Et.padding=5,Et.DEFAULT_TEXT="\u8BF7\u8F93\u5165\u6587\u672C",Et.text=Et.DEFAULT_TEXT,Et.isMoved=!1,Et.color=Ut.defaultColor,Et.fontFamily=Ut.defaultFontFamily,Et.defaultSize={x:100,y:30},Et.setColor=Et.setColor.bind(Et),Et.setFont=Et.setFont.bind(Et),Et.renderText=Et.renderText.bind(Et),Et.sizeText=Et.sizeText.bind(Et),Et.textEditDivClicked=Et.textEditDivClicked.bind(Et),Et.showTextEditor=Et.showTextEditor.bind(Et),Et.setSize=Et.setSize.bind(Et),Et.positionTextEditor=Et.positionTextEditor.bind(Et),Et.colorPanel=new et("Color",Ut.defaultColorSet,Ut.defaultColor),Et.colorPanel.onColorChanged=Et.setColor,Et.fontFamilyPanel=new ue("Font",Ut.defaultFontFamilies,Ut.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){if(Ht.prototype.ownsTarget.call(this,wt)||wt===this.visual||wt===this.textElement||wt===this.bgRectangle)return!0;var At=!1;return this.textElement.childNodes.forEach(function(Ut){Ut===wt&&(At=!0)}),At},Mt.prototype.createVisual=function(){this.visual=de.createGroup(),this.bgRectangle=de.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=de.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.textElement.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.isMoved=!1,this.pointerDownPoint=wt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},Mt.prototype.renderText=function(){var wt=this;if(this.textElement){for(;this.textElement.lastChild;)this.textElement.removeChild(this.textElement.lastChild);this.text.split(/\r\n|[\n\v\f\r\x85\u2028\u2029]/).forEach(function(At){wt.textElement.appendChild(de.createTSpan(At.trim()===""?" ":At.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},Mt.prototype.getTextScale=function(){var wt=this.textElement.getBBox(),At=1;if(wt.width>0&&wt.height>0){var Ut=(1*this.width-this.width*this.padding*2/100)/wt.width,Et=(1*this.height-this.height*this.padding*2/100)/wt.height;At=Math.min(Ut,Et)}return At},Mt.prototype.getTextPosition=function(wt){var At=this.textElement.getBBox(),Ut=0,Et=0;return At.width>0&&At.height>0&&(Ut=(this.width-At.width*wt)/2,Et=this.height/2-At.height*wt/2),{x:Ut,y:Et}},Mt.prototype.sizeText=function(){var wt=this.textElement.getBBox(),At=this.getTextScale(),Ut=this.getTextPosition(At);Ut.y-=wt.y*At,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+Ut.x+"px, "+Ut.y+"px) scale("+At+", "+At+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(Ut.x,Ut.y),this.textElement.transform.baseVal.getItem(1).setScale(At,At))},Mt.prototype.manipulate=function(wt){Ht.prototype.manipulate.call(this,wt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(wt.x-this.pointerDownPoint.x)>5||Math.abs(wt.y-this.pointerDownPoint.y)>5)},Mt.prototype.resize=function(wt){Ht.prototype.resize.call(this,wt),this.isMoved=!0,this.setSize(),this.sizeText()},Mt.prototype.setSize=function(){Ht.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},Mt.prototype.pointerUp=function(wt){var At=this.state;At==="creating"&&(this._suppressMarkerCreateEvent=!0),Ht.prototype.pointerUp.call(this,wt),this.setSize(),(At==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},Mt.prototype.showTextEditor=function(){var wt=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditor=document.createElement("div"),this.textEditor.style.position="absolute",this.textEditor.style.fontFamily=this.fontFamily,this.textEditor.style.lineHeight="1em",this.textEditor.innerText=this.text,this.textEditor.contentEditable="true",this.textEditor.style.color=this.color,this.textEditor.style.whiteSpace="pre",this.positionTextEditor(),this.textEditor.addEventListener("pointerup",function(At){At.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var At=Number.parseFloat(wt.textEditor.style.fontSize);wt.textEditor.clientWidth>=Number.parseInt(wt.textEditor.style.maxWidth)&&At>.9;)At-=.1,wt.textEditor.style.fontSize=Math.max(At,.9)+"em"}),this.textEditor.addEventListener("keyup",function(At){At.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(At){if(At.clipboardData){var Ut=At.clipboardData.getData("text"),Et=window.getSelection();if(!Et.rangeCount)return!1;Et.deleteFromDocument(),Et.getRangeAt(0).insertNode(document.createTextNode(Ut)),At.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){wt.textEditDivClicked(wt.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},Mt.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var wt=this.getTextScale(),At=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),Ut=this.textElement.getBBox(),Et={x:Ut.width*wt,y:Ut.height*wt};At.x-=Et.x/2,At.y-=Et.y/2,this.textEditor.style.top=At.y+"px",this.textEditor.style.left=At.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-At.x+"px",this.textEditor.style.fontSize=Math.max(16*wt,12)+"px",this.textElement.style.display="none"}},Mt.prototype.textEditDivClicked=function(wt){this.text=wt.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},Mt.prototype.select=function(){Ht.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},Mt.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),Ht.prototype.deselect.call(this)},Mt.prototype.dblClick=function(wt,At){Ht.prototype.dblClick.call(this,wt,At),this.showTextEditor()},Mt.prototype.setColor=function(wt){this.textElement&&de.setAttributes(this.textElement,[["fill",wt]]),this.color=wt,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(wt)},Mt.prototype.setFont=function(wt){this.textElement&&de.setAttributes(this.textElement,[["font-family",wt]]),this.fontFamily=wt,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},Mt.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},Mt.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){var At=wt;this.color=At.color,this.fontFamily=At.fontFamily,this.padding=At.padding,this.text=At.text,this.createVisual(),Ht.prototype.restoreState.call(this,wt),this.setSize()},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.setSize(),this.sizeText(),this.positionTextEditor()},Mt.typeName="TextMarker",Mt.title="Text marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',Mt}(Ct),Ke=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.color="transparent",Et.lineWidth=3,Et.drawing=!1,Et.pixelRatio=1,Et.color=Ut.defaultColor,Et.lineWidth=Ut.defaultStrokeWidth,Et.pixelRatio=Ut.freehandPixelRatio,Et.setColor=Et.setColor.bind(Et),Et.addCanvas=Et.addCanvas.bind(Et),Et.finishCreation=Et.finishCreation.bind(Et),Et.setLineWidth=Et.setLineWidth.bind(Et),Et.colorPanel=new et("Color",Ut.defaultColorSet,Ut.defaultColor),Et.colorPanel.onColorChanged=Et.setColor,Et.lineWidthPanel=new zt("Line width",Ut.defaultStrokeWidths,Ut.defaultStrokeWidth),Et.lineWidthPanel.onWidthChanged=Et.setLineWidth,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.drawingImage)},Mt.prototype.createVisual=function(){this.visual=de.createGroup(),this.drawingImage=de.createImage(),this.visual.appendChild(this.drawingImage);var wt=de.createTransform();this.visual.transform.baseVal.appendItem(wt),this.addMarkerVisualToContainer(this.visual)},Mt.prototype.pointerDown=function(wt,At){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(wt.x,wt.y),this.drawing=!0):Ht.prototype.pointerDown.call(this,wt,At)},Mt.prototype.manipulate=function(wt){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(wt.x,wt.y),this.canvasContext.stroke()):Ht.prototype.manipulate.call(this,wt)},Mt.prototype.resize=function(wt){Ht.prototype.resize.call(this,wt),de.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},Mt.prototype.pointerUp=function(wt){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):Ht.prototype.pointerUp.call(this,wt)},Mt.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},Mt.prototype.select=function(){this.state==="creating"&&this.finishCreation(),Ht.prototype.select.call(this)},Mt.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),Ht.prototype.deselect.call(this)},Mt.prototype.finishCreation=function(){for(var wt=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),At=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],Ut=At[0],Et=At[1],be=At[2],Dn=At[3],zi=!1,yi=0;yi<this.canvasElement.height;yi++)for(var ei=0;ei<this.canvasElement.width;ei++)wt.data[yi*this.canvasElement.width*4+4*ei+3]>0&&(zi=!0,yi<Et&&(Et=yi),ei<Ut&&(Ut=ei),yi>Dn&&(Dn=yi),ei>be&&(be=ei));if(zi){this.left=Ut/this.pixelRatio,this.top=Et/this.pixelRatio,this.width=(be-Ut)/this.pixelRatio,this.height=(Dn-Et)/this.pixelRatio;var Qi=document.createElement("canvas");Qi.width=be-Ut,Qi.height=Dn-Et,Qi.getContext("2d").putImageData(this.canvasContext.getImageData(Ut,Et,be-Ut,Dn-Et),0,0),this.drawingImgUrl=Qi.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},Mt.prototype.setDrawingImage=function(){de.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),de.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},Mt.prototype.setColor=function(wt){this.color=wt,this.colorChanged(wt)},Mt.prototype.setLineWidth=function(wt){this.lineWidth=wt},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({drawingImgUrl:this.drawingImgUrl},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){this.createVisual(),Ht.prototype.restoreState.call(this,wt),this.drawingImgUrl=wt.drawingImgUrl,this.setDrawingImage()},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.setDrawingImage()},Mt.typeName="FreehandMarker",Mt.title="Freehand marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',Mt}(Ct),Fe=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,Ut||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return Et.typeBoxes=[],Et.currentType=At,Et.setCurrentType=Et.setCurrentType.bind(Et),Et}return ce(Mt,Ht),Mt.prototype.getUi=function(){var wt=this,At=document.createElement("div");At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2";for(var Ut=function(Dn){var zi="both";switch(Dn){case 0:zi="both";break;case 1:zi="start";break;case 2:zi="end";break;case 3:zi="none"}var yi=document.createElement("div");if(yi.style.display="flex",yi.style.flexGrow="2",yi.style.alignItems="center",yi.style.justifyContent="space-between",yi.style.padding="5px",yi.style.borderWidth="2px",yi.style.borderStyle="solid",yi.style.borderColor=zi===Et.currentType?Et.uiStyleSettings.toolboxAccentColor:"transparent",yi.addEventListener("click",function(){wt.setCurrentType(zi,yi)}),At.appendChild(yi),zi==="both"||zi==="start"){var ei=document.createElement("div");ei.style.display="flex",ei.style.alignItems="center",ei.style.minHeight="20px",ei.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,5 10,0 10,10" fill="`+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,ei.style.marginLeft="5px",yi.appendChild(ei)}var Qi=document.createElement("div");Qi.style.display="flex",Qi.style.alignItems="center",Qi.style.minHeight="20px",Qi.style.flexGrow="2";var Mn=document.createElement("hr");if(Mn.style.minWidth="20px",Mn.style.border="0px",Mn.style.borderTop="3px solid "+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee"),Mn.style.flexGrow="2",Qi.appendChild(Mn),yi.appendChild(Qi),zi==="both"||zi==="end"){var sr=document.createElement("div");sr.style.display="flex",sr.style.alignItems="center",sr.style.minHeight="20px",sr.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
|
|
<polygon points="0,0 10,5 0,10" fill="`+(Et.uiStyleSettings!==void 0?Et.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,sr.style.marginRight="5px",yi.appendChild(sr)}Et.typeBoxes.push(yi)},Et=this,be=0;be<4;be++)Ut(be);return At},Mt.prototype.setCurrentType=function(wt,At){var Ut=this;this.currentType=wt,this.typeBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Ut.uiStyleSettings!==void 0?Ut.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},Mt}(nt),wn=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.arrowType="end",Et.arrowBaseHeight=10,Et.arrowBaseWidth=10,Et.getArrowPoints=Et.getArrowPoints.bind(Et),Et.setArrowType=Et.setArrowType.bind(Et),Et.arrowTypePanel=new Fe("Arrow type","end"),Et.arrowTypePanel.onArrowTypeChanged=Et.setArrowType,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.arrow1&&wt!==this.arrow2)},Mt.prototype.getArrowPoints=function(wt,At){var Ut=this.arrowBaseWidth+2*this.strokeWidth,Et=this.arrowBaseHeight+2*this.strokeWidth;return wt-Ut/2+","+(At+Et/2)+" "+wt+","+(At-Et/2)+" "+(wt+Ut/2)+","+(At+Et/2)},Mt.prototype.createTips=function(){this.arrow1=de.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=de.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.arrow2)},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.state==="creating"&&this.createTips()},Mt.prototype.adjustVisual=function(){if(Ht.prototype.adjustVisual.call(this),this.arrow1&&this.arrow2){this.arrow1.style.display=this.arrowType==="both"||this.arrowType==="start"?"":"none",this.arrow2.style.display=this.arrowType==="both"||this.arrowType==="end"?"":"none",de.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),de.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]);var wt=0;Math.abs(this.x1-this.x2)>.1&&(wt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2));var At=this.arrow1.transform.baseVal.getItem(0);At.setRotate(wt,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(At,0);var Ut=this.arrow2.transform.baseVal.getItem(0);Ut.setRotate(wt+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(Ut,0)}},Mt.prototype.setArrowType=function(wt){this.arrowType=wt,this.adjustVisual(),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({arrowType:this.arrowType},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){Ht.prototype.restoreState.call(this,wt);var At=wt;this.arrowType=At.arrowType,this.createTips(),this.adjustVisual()},Mt.typeName="ArrowMarker",Mt.title="Arrow marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',Mt}(Ne),Rn=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.fillColor=Ut.defaultFillColor,Et.strokeWidth=0,Et.fillPanel=new et("Color",Ut.defaultColorSet,Ut.defaultFillColor),Et.fillPanel.onColorChanged=Et.setFillColor,Et}return ce(Mt,Ht),Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Ht.prototype.getState.call(this);return wt.typeName=Mt.typeName,wt},Mt.typeName="CoverMarker",Mt.title="Cover marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',Mt}(bt),$n=function(Ht){function Mt(wt,At,Ut,Et){var be=Ht.call(this,wt,Et||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return be.opacities=[],be.opacityBoxes=[],be.opacities=At,be.currentOpacity=Ut,be.setCurrentOpacity=be.setCurrentOpacity.bind(be),be}return ce(Mt,Ht),Mt.prototype.getUi=function(){var wt=this,At=document.createElement("div");return At.style.display="flex",At.style.overflow="hidden",At.style.flexGrow="2",At.style.justifyContent="space-between",this.opacities.forEach(function(Ut){var Et=document.createElement("div");Et.style.display="flex",Et.style.alignItems="center",Et.style.justifyContent="center",Et.style.padding="5px",Et.style.borderWidth="2px",Et.style.borderStyle="solid",Et.style.borderColor=Ut===wt.currentOpacity?wt.uiStyleSettings.toolboxAccentColor:"transparent",Et.addEventListener("click",function(){wt.setCurrentOpacity(Ut,Et)}),At.appendChild(Et);var be=document.createElement("div");be.innerText=100*Ut+"%",Et.appendChild(be),wt.opacityBoxes.push(Et)}),At},Mt.prototype.setCurrentOpacity=function(wt,At){var Ut=this;this.currentOpacity=wt,this.opacityBoxes.forEach(function(Et){Et.style.borderColor=Et===At?Ut.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},Mt}(nt),di=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.setOpacity=Et.setOpacity.bind(Et),Et.fillColor=Ut.defaultHighlightColor,Et.strokeWidth=0,Et.opacity=Ut.defaultHighlightOpacity,Et.fillPanel=new et("Color",Ut.defaultColorSet,Et.fillColor),Et.fillPanel.onColorChanged=Et.setFillColor,Et.opacityPanel=new $n("Opacity",Ut.defaultOpacitySteps,Et.opacity),Et.opacityPanel.onOpacityChanged=Et.setOpacity,Et}return ce(Mt,Ht),Mt.prototype.setOpacity=function(wt){this.opacity=wt,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Ht.prototype.getState.call(this);return wt.typeName=Mt.typeName,wt},Mt.typeName="HighlightMarker",Mt.title="Highlight marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',Mt}(Rn),ee='<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>',_t='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',Kt=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.bgColor="transparent",Et.tipPosition={x:0,y:0},Et.tipBase1Position={x:0,y:0},Et.tipBase2Position={x:0,y:0},Et.tipMoving=!1,Et.color=Ut.defaultStrokeColor,Et.bgColor=Ut.defaultFillColor,Et.fontFamily=Ut.defaultFontFamily,Et.defaultSize={x:100,y:30},Et.setBgColor=Et.setBgColor.bind(Et),Et.getTipPoints=Et.getTipPoints.bind(Et),Et.positionTip=Et.positionTip.bind(Et),Et.setTipPoints=Et.setTipPoints.bind(Et),Et.colorPanel=new et("Text color",Ut.defaultColorSet,Et.color,ee),Et.colorPanel.onColorChanged=Et.setColor,Et.bgColorPanel=new et("Fill color",Ut.defaultColorSet,Et.bgColor,_t),Et.bgColorPanel.onColorChanged=Et.setBgColor,Et.fontFamilyPanel=new ue("Font",Ut.defaultFontFamilies,Ut.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et.tipGrip=new pt,Et.tipGrip.visual.transform.baseVal.appendItem(de.createTransform()),Et.controlBox.appendChild(Et.tipGrip.visual),Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return Ht.prototype.ownsTarget.call(this,wt)||this.tipGrip.ownsTarget(wt)||this.tip===wt},Mt.prototype.createTip=function(){de.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=de.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},Mt.prototype.pointerDown=function(wt,At){this.state==="new"&&Ht.prototype.pointerDown.call(this,wt,At),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(At)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):Ht.prototype.pointerDown.call(this,wt,At)},Mt.prototype.pointerUp=function(wt){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,Ht.prototype.pointerUp.call(this,wt);else{var At=this.state==="creating";Ht.prototype.pointerUp.call(this,wt),this.setTipPoints(At),this.positionTip()}},Mt.prototype.manipulate=function(wt){if(this.tipMoving){var At=this.unrotatePoint(wt);this.tipPosition={x:At.x-this.manipulationStartLeft,y:At.y-this.manipulationStartTop},this.positionTip()}else Ht.prototype.manipulate.call(this,wt)},Mt.prototype.setBgColor=function(wt){this.bgRectangle&&this.tip&&(de.setAttributes(this.bgRectangle,[["fill",wt]]),de.setAttributes(this.tip,[["fill",wt]])),this.bgColor=wt,this.fillColorChanged(wt)},Mt.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},Mt.prototype.setTipPoints=function(wt){wt===void 0&&(wt=!1);var At=Math.min(this.height/2,15),Ut=this.height/5;wt&&(this.tipPosition={x:At+Ut/2,y:this.height+20});var Et=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?Et<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(Ut=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:At,y:0},this.tipBase2Position={x:At+Ut,y:0}):(this.tipBase1Position={x:0,y:At},this.tipBase2Position={x:0,y:At+Ut}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?Et<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(Ut=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-At-Ut,y:0},this.tipBase2Position={x:this.width-At,y:0}):(this.tipBase1Position={x:this.width,y:At},this.tipBase2Position={x:this.width,y:At+Ut}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?Et<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(Ut=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-At-Ut,y:this.height},this.tipBase2Position={x:this.width-At,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-At-Ut},this.tipBase2Position={x:this.width,y:this.height-At}):Et<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(Ut=this.width/5,At=Math.min(this.width/2,15),this.tipBase1Position={x:At,y:this.height},this.tipBase2Position={x:At+Ut,y:this.height}):(this.tipBase1Position={x:0,y:this.height-At},this.tipBase2Position={x:0,y:this.height-At-Ut})},Mt.prototype.resize=function(wt){Ht.prototype.resize.call(this,wt),this.positionTip()},Mt.prototype.positionTip=function(){de.setAttributes(this.tip,[["points",this.getTipPoints()]]);var wt=this.tipGrip.visual.transform.baseVal.getItem(0);wt.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(wt,0)},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),Mt.prototype.select=function(){this.positionTip(),Ht.prototype.select.call(this)},Mt.prototype.getState=function(){var wt=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){var At=wt;this.bgColor=At.bgColor,this.tipPosition=At.tipPosition,Ht.prototype.restoreState.call(this,wt),this.createTip(),this.setTipPoints()},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.tipPosition={x:this.tipPosition.x*wt,y:this.tipPosition.y*At},this.positionTip()},Mt.typeName="CalloutMarker",Mt.title="Callout marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',Mt}(ke),pn=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.opacity=1,Et.strokeColor=Ut.defaultColor,Et.strokeWidth=Ut.defaultStrokeWidth,Et.strokeDasharray=Ut.defaultStrokeDasharray,Et.fillColor=Ut.defaultFillColor,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setFillColor=Et.setFillColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.setOpacity=Et.setOpacity.bind(Et),Et.createVisual=Et.createVisual.bind(Et),Et.strokePanel=new et("Line color",Se(Ut.defaultColorSet,["transparent"]),Ut.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.fillPanel=new et("Fill color",Se(Ut.defaultColorSet,["transparent"]),Et.fillColor,_t),Et.fillPanel.onColorChanged=Et.setFillColor,Et.strokeWidthPanel=new zt("Line width",Ut.defaultStrokeWidths,Ut.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Qt("Line style",Ut.defaultStrokeDasharrays,Ut.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et.opacityPanel=new $n("Opacity",Ut.defaultOpacitySteps,Et.opacity),Et.opacityPanel.onOpacityChanged=Et.setOpacity,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.visual)},Mt.prototype.createVisual=function(){this.visual=de.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},Mt.prototype.manipulate=function(wt){Ht.prototype.manipulate.call(this,wt)},Mt.prototype.resize=function(wt){Ht.prototype.resize.call(this,wt),this.setSize()},Mt.prototype.setSize=function(){Ht.prototype.setSize.call(this),de.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},Mt.prototype.pointerUp=function(wt){Ht.prototype.pointerUp.call(this,wt),this.setSize()},Mt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.visual&&de.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(wt),this.stateChanged()},Mt.prototype.setFillColor=function(wt){this.fillColor=wt,this.visual&&de.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(wt),this.stateChanged()},Mt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.visual&&de.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Mt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.visual&&de.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Mt.prototype.setOpacity=function(wt){this.opacity=wt,this.visual&&de.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){var At=wt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.opacity=At.opacity,this.createVisual(),Ht.prototype.restoreState.call(this,wt),this.setSize()},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.setSize()},Mt.typeName="EllipseMarker",Mt.title="Ellipse marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Mt}(Ct),Ln=function(Ht){function Mt(wt,At,Ut){return Ht.call(this,wt,At,Ut)||this}return ce(Mt,Ht),Object.defineProperty(Mt.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.tip1&&wt!==this.tip2)},Mt.prototype.createTips=function(){this.tip1=de.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.tip1),this.tip2=de.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(de.createTransform()),this.visual.appendChild(this.tip2)},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.state==="creating"&&this.createTips()},Mt.prototype.adjustVisual=function(){if(Ht.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(de.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var wt=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),At=this.tip1.transform.baseVal.getItem(0);At.setRotate(wt,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(At,0);var Ut=this.tip2.transform.baseVal.getItem(0);Ut.setRotate(wt+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(Ut,0)}},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Ht.prototype.getState.call(this);return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){Ht.prototype.restoreState.call(this,wt),this.createTips(),this.adjustVisual()},Mt.typeName="MeasurementMarker",Mt.title="Measurement marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',Mt}(Ne),Ce=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.strokePanel.colors=Ut.defaultColorSet,Et.fillColor="transparent",Et}return ce(Mt,Ht),Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Ht.prototype.getState.call(this);return wt.typeName=Mt.typeName,wt},Mt.typeName="EllipseFrameMarker",Mt.title="Ellipse frame marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',Mt}(pn),sn=function(){function Ht(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(Ht.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),Ht.prototype.addUndoStep=function(Mt){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(Mt)||(this.undoStack.push(Mt),JSON.stringify(this.lastRedoStep)!==JSON.stringify(Mt)&&this.redoStack.splice(0,this.redoStack.length))},Ht.prototype.replaceLastUndoStep=function(Mt){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=Mt)},Ht.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},Ht.prototype.undo=function(){if(this.undoStack.length>1){var Mt=this.undoStack.pop();return Mt!==void 0&&this.redoStack.push(Mt),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},Ht.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},Ht}(),cn=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.curveX=0,Et.curveY=0,Et.manipulationStartCurveX=0,Et.manipulationStartCurveY=0,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.positionGrips=Et.positionGrips.bind(Et),Et.addControlGrips=Et.addControlGrips.bind(Et),Et.adjustVisual=Et.adjustVisual.bind(Et),Et.setupControlBox=Et.setupControlBox.bind(Et),Et.resize=Et.resize.bind(Et),Et.strokeColor=Ut.defaultColor,Et.strokeWidth=Ut.defaultStrokeWidth,Et.strokeDasharray=Ut.defaultStrokeDasharray,Et.strokePanel=new et("Line color",Ut.defaultColorSet,Ut.defaultColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.strokeWidthPanel=new zt("Line width",Ut.defaultStrokeWidths,Ut.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Qt("Line style",Ut.defaultStrokeDasharrays,Ut.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.selectorCurve&&wt!==this.visibleCurve&&!this.curveGrip.ownsTarget(wt))},Mt.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},Mt.prototype.createVisual=function(){this.visual=de.createGroup(),this.selectorCurve=de.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=de.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=wt.x,this.curveY=wt.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(At)&&(this.activeGrip=this.curveGrip,this._state="resize")},Mt.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),de.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),de.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),de.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},Mt.prototype.setupControlBox=function(){Ht.prototype.setupControlBox.call(this),this.curveControlLine1=de.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=de.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},Mt.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,Ht.prototype.addControlGrips.call(this)},Mt.prototype.positionGrips=function(){Ht.prototype.positionGrips.call(this);var wt=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-wt/2,this.curveY-wt/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},Mt.prototype.manipulate=function(wt){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+wt.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+wt.y-this.manipulationStartY),Ht.prototype.manipulate.call(this,wt)},Mt.prototype.resize=function(wt){this.activeGrip===this.curveGrip&&(this.curveX=wt.x,this.curveY=wt.y),Ht.prototype.resize.call(this,wt),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},Mt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.adjustVisual(),this.colorChanged(wt)},Mt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.adjustVisual()},Mt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.adjustVisual()},Mt.prototype.scale=function(wt,At){this.curveX=this.curveX*wt,this.curveY=this.curveY*At,Ht.prototype.scale.call(this,wt,At)},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},Ht.prototype.getState.call(this));return wt.typeName=Mt.typeName,wt},Mt.prototype.restoreState=function(wt){Ht.prototype.restoreState.call(this,wt);var At=wt;this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.curveX=At.curveX,this.curveY=At.curveY,this.createVisual(),this.adjustVisual()},Mt.typeName="CurveMarker",Mt.title="Curve marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',Mt}(re),Jn=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,At,Ut)||this;return Et.fillColor="transparent",Et.strokeColor="transparent",Et.strokeWidth=0,Et.strokeDasharray="",Et.textColor="transparent",Et.fontSize="1rem",Et.isMoved=!1,Et.captionText="Caption",Et.PADDING=5,Et.captionBoxWidth=0,Et.captionBoxHeight=0,Et.strokeColor=Ut.defaultColor,Et.strokeWidth=Ut.defaultStrokeWidth,Et.strokeDasharray=Ut.defaultStrokeDasharray,Et.fillColor=Ut.defaultFillColor,Et.textColor=Ut.defaultStrokeColor,Et.fontFamily=Ut.defaultFontFamily,Et.fontSize=Ut.defaultCaptionFontSize,Et.captionText=Ut.defaultCaptionText,Et.setStrokeColor=Et.setStrokeColor.bind(Et),Et.setFillColor=Et.setFillColor.bind(Et),Et.setStrokeWidth=Et.setStrokeWidth.bind(Et),Et.setStrokeDasharray=Et.setStrokeDasharray.bind(Et),Et.createVisual=Et.createVisual.bind(Et),Et.sizeCaption=Et.sizeCaption.bind(Et),Et.setCaptionText=Et.setCaptionText.bind(Et),Et.showTextEditor=Et.showTextEditor.bind(Et),Et.positionTextEditor=Et.positionTextEditor.bind(Et),Et.finishTextEditing=Et.finishTextEditing.bind(Et),Et.setFont=Et.setFont.bind(Et),Et.setTextColor=Et.setTextColor.bind(Et),Et.strokePanel=new et("Line color",Se(Ut.defaultColorSet,["transparent"]),Et.strokeColor),Et.strokePanel.onColorChanged=Et.setStrokeColor,Et.fillPanel=new et("Fill color",Se(Ut.defaultColorSet,["transparent"]),Et.fillColor,_t),Et.fillPanel.onColorChanged=Et.setFillColor,Et.strokeWidthPanel=new zt("Line width",Ut.defaultStrokeWidths,Ut.defaultStrokeWidth),Et.strokeWidthPanel.onWidthChanged=Et.setStrokeWidth,Et.strokeStylePanel=new Qt("Line style",Ut.defaultStrokeDasharrays,Ut.defaultStrokeDasharray),Et.strokeStylePanel.onStyleChanged=Et.setStrokeDasharray,Et.fontFamilyPanel=new ue("Font",Ut.defaultFontFamilies,Ut.defaultFontFamily),Et.fontFamilyPanel.onFontChanged=Et.setFont,Et.textColorPanel=new et("Text color",Ut.defaultColorSet,Et.textColor,ee),Et.textColorPanel.onColorChanged=Et.setTextColor,Et}return ce(Mt,Ht),Mt.prototype.ownsTarget=function(wt){return!(!Ht.prototype.ownsTarget.call(this,wt)&&wt!==this.visual&&wt!==this.frame&&wt!==this.captionBg&&wt!==this.captionElement)},Mt.prototype.createVisual=function(){this.visual=de.createGroup(),this.addMarkerVisualToContainer(this.visual),this.captionBg=de.createRect(1,1,[["fill",this.fillColor]]),this.visual.appendChild(this.captionBg),this.captionElement=de.createText([["fill",this.textColor],["font-family",this.fontFamily]]),this.captionElement.style.fontSize=this.fontSize,this.captionElement.style.textAnchor="start",this.captionElement.style.dominantBaseline="text-before-edge",this.captionElement.textContent=this.captionText,this.visual.appendChild(this.captionElement),this.frame=de.createRect(this.width,this.height,[["fill","transparent"],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray]]),this.visual.appendChild(this.frame),this.sizeCaption()},Mt.prototype.setCaptionText=function(wt){this.captionText=wt,this.captionElement.textContent=this.captionText,this.sizeCaption()},Mt.prototype.pointerDown=function(wt,At){Ht.prototype.pointerDown.call(this,wt,At),this.isMoved=!1,this.pointerDownPoint=wt,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(wt),this._state="creating")},Mt.prototype.manipulate=function(wt){Ht.prototype.manipulate.call(this,wt),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(wt.x-this.pointerDownPoint.x)>5||Math.abs(wt.y-this.pointerDownPoint.y)>5)},Mt.prototype.resize=function(wt){Ht.prototype.resize.call(this,wt),this.setSize()},Mt.prototype.sizeCaption=function(){var wt=this.captionElement.getBBox();this.captionText.trim()!==""?(this.captionBoxWidth=wt.width+2*this.PADDING,this.captionBoxHeight=wt.height+2*this.PADDING):(this.captionBoxWidth=0,this.captionBoxHeight=0),de.setAttributes(this.captionBg,[["width",this.captionBoxWidth.toString()],["height",this.captionBoxHeight.toString()],["clip-path","path('M0,0 H"+this.width+" V"+this.height+" H"+-this.width+" Z')"]]),de.setAttributes(this.captionElement,[["x",this.PADDING.toString()],["y",this.PADDING.toString()],["clip-path","path('M0,0 H"+(this.width-this.PADDING)+" V"+this.height+" H"+(-this.width-this.PADDING)+" Z')"]])},Mt.prototype.showTextEditor=function(){var wt=this;this._state="edit",this.overlayContainer.innerHTML="",this.textEditDiv=document.createElement("div"),this.textEditDiv.style.flexGrow="2",this.textEditDiv.style.alignItems="center",this.textEditDiv.style.justifyContent="center",this.textEditDiv.style.pointerEvents="auto",this.textEditDiv.style.overflow="hidden",this.textEditBox=document.createElement("input"),this.textEditBox.style.position="absolute",this.textEditBox.style.width=this.width+"px",this.captionBoxHeight>0&&(this.textEditBox.style.height=this.captionBoxHeight+"px"),this.textEditBox.style.fontSize=this.fontSize,this.textEditBox.style.fontFamily=this.fontFamily,this.textEditBox.style.backgroundColor=this.fillColor,this.textEditBox.style.color=this.textColor,this.textEditBox.style.borderWidth="0",this.textEditBox.setAttribute("value",this.captionText),this.textEditBox.select(),this.textEditDiv.appendChild(this.textEditBox),this.overlayContainer.appendChild(this.textEditDiv),this.textEditBox.addEventListener("pointerup",function(At){At.stopPropagation()}),this.textEditBox.addEventListener("keypress",function(At){At.key==="Enter"&&wt.finishTextEditing(wt.textEditBox.value)}),this.textEditBox.addEventListener("keyup",function(At){At.cancelBubble=!0}),this.textEditBox.addEventListener("blur",function(){wt.finishTextEditing(wt.textEditBox.value)}),this.textEditDiv.addEventListener("pointerup",function(){wt.finishTextEditing(wt.textEditBox.value)}),this.positionTextEditor(),this.textEditBox.focus()},Mt.prototype.positionTextEditor=function(){this.state==="edit"&&(this.textEditBox===void 0?this.showTextEditor():(this.textEditBox.style.left=this.left+"px",this.textEditBox.style.top=this.top+"px",this.textEditBox.style.transform="rotate("+this.rotationAngle+"deg)",this.textEditBox.style.transformOrigin=this.width/2+"px "+this.height/2+"px"))},Mt.prototype.finishTextEditing=function(wt){this.setCaptionText(wt.trim()),this.overlayContainer.innerHTML="",this.stateChanged()},Mt.prototype.setFont=function(wt){this.captionElement&&de.setAttributes(this.captionElement,[["font-family",wt]]),this.fontFamily=wt,this.textEditBox&&(this.textEditBox.style.fontFamily=this.fontFamily),this.sizeCaption(),this.stateChanged()},Mt.prototype.setTextColor=function(wt){this.captionElement&&de.setAttributes(this.captionElement,[["fill",wt]]),this.textColor=wt,this.textEditBox&&(this.textEditBox.style.color=this.textColor),this.stateChanged()},Mt.prototype.setSize=function(){Ht.prototype.setSize.call(this),de.setAttributes(this.frame,[["width",this.width.toString()],["height",this.height.toString()]]),this.sizeCaption()},Mt.prototype.pointerUp=function(wt){Ht.prototype.pointerUp.call(this,wt),this.setSize(),!this.isMoved&&Date.now()-this.pointerDownTimestamp>500&&this.showTextEditor(),this.pointerDownPoint=void 0},Mt.prototype.dblClick=function(wt,At){Ht.prototype.dblClick.call(this,wt,At),this.showTextEditor()},Mt.prototype.setStrokeColor=function(wt){this.strokeColor=wt,this.frame&&de.setAttributes(this.frame,[["stroke",this.strokeColor]]),this.colorChanged(wt),this.stateChanged()},Mt.prototype.setFillColor=function(wt){this.fillColor=wt,this.captionBg&&de.setAttributes(this.captionBg,[["fill",this.fillColor]]),this.fillColorChanged(wt),this.stateChanged()},Mt.prototype.setStrokeWidth=function(wt){this.strokeWidth=wt,this.frame&&de.setAttributes(this.frame,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},Mt.prototype.setStrokeDasharray=function(wt){this.strokeDasharray=wt,this.frame&&de.setAttributes(this.frame,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},Object.defineProperty(Mt.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.fontFamilyPanel,this.textColorPanel]},enumerable:!1,configurable:!0}),Mt.prototype.getState=function(){var wt=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:1,textColor:this.textColor,fontFamily:this.fontFamily,fontSize:this.fontSize,captionText:this.captionText},Ht.prototype.getState.call(this));return wt.typeName=this.typeName,wt},Mt.prototype.restoreState=function(wt){var At=wt;this.fillColor=At.fillColor,this.strokeColor=At.strokeColor,this.strokeWidth=At.strokeWidth,this.strokeDasharray=At.strokeDasharray,this.textColor=At.textColor,this.fontFamily=At.fontFamily,this.captionText=At.captionText,this.fontSize=At.fontSize,this.createVisual(),Ht.prototype.restoreState.call(this,wt),this.setSize()},Mt.prototype.scale=function(wt,At){Ht.prototype.scale.call(this,wt,At),this.setSize()},Mt.typeName="CaptionFrameMarker",Mt.title="Caption frame marker",Mt.icon='<svg viewBox="0 0 24 24"><path d="M5 3c-1.11 0-2 .89-2 2v14c0 1.11.89 2 2 2h14c1.11 0 2-.89 2-2V5c0-1.11-.89-2-2-2H5m0 2h14v14H5V5m2 2v2h10V7H7z"/></svg>',Mt}(Ct),Sn=function(){function Ht(Mt,wt){wt===void 0&&(wt=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=Mt,this.cancelable=wt}return Object.defineProperty(Ht.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),Ht.prototype.preventDefault=function(){this._defaultPrevented=!0},Ht}(),he=function(Ht){function Mt(wt,At,Ut){var Et=Ht.call(this,wt,!1)||this;return Et.dataUrl=At,Et.state=Ut,Et}return ce(Mt,Ht),Mt}(Sn),Te=function(Ht){function Mt(wt,At,Ut){Ut===void 0&&(Ut=!1);var Et=Ht.call(this,wt,Ut)||this;return Et.marker=At,Et}return ce(Mt,Ht),Mt}(Sn),Nn=function(){function Ht(){this.render=[],this.beforeclose=[],this.close=[],this.show=[],this.restorestate=[],this.statechange=[],this.markerselect=[],this.markerdeselect=[],this.markercreating=[],this.markercreate=[],this.markerbeforedelete=[],this.markerdelete=[],this.markerchange=[],this.focus=[],this.blur=[]}return Ht.prototype.addEventListener=function(Mt,wt){this[Mt].push(wt)},Ht.prototype.removeEventListener=function(Mt,wt){var At=this[Mt].indexOf(wt);At>-1&&this[Mt].splice(At,1)},Ht}(),Bn=function(){function Ht(Mt){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new oe,this._isOpen=!1,this.undoRedoManager=new sn,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.renderMarkersOnly=!1,this.zoomSteps=[1,1.5,2,4],this._zoomLevel=1,this._isResizing=!1,this.prevPanPoint={x:0,y:0},this.eventListeners=new Nn,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=Ht.instanceCounter++,this.styles=new Pe(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=Mt,this.targetRoot=document.body,this.width=Mt.clientWidth,this.height=Mt.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(Ht.prototype,"ALL_MARKER_TYPES",{get:function(){return[ie,Ke,wn,ke,Ce,pn,di,Kt,Ln,Rn,Ne,cn,Jn]},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[ie,Ke,wn,ke,pn,di,Kt]},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"BASIC_MARKER_TYPES",{get:function(){return[ie,Ke,wn,ke,di]},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(Mt){var wt=this;this._availableMarkerTypes.splice(0),Mt.forEach(function(At){if(typeof At=="string"){var Ut=wt.ALL_MARKER_TYPES.find(function(Et){return Et.typeName===At});Ut!==void 0&&wt._availableMarkerTypes.push(Ut)}else wt._availableMarkerTypes.push(At)})},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(Mt){this._zoomLevel=Mt,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(Ht.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Ht.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),$t.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},Ht.prototype.show=function(){var Mt=this;this.styles.styleSheetRoot===void 0&&ve.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=ve.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(wt){return wt(new Sn(Mt))})},Ht.prototype.render=function(){return Be(this,void 0,void 0,function(){var Mt;return qe(this,function(wt){switch(wt.label){case 0:return this.setCurrentMarker(),(Mt=new He).naturalSize=this.renderAtNaturalSize,Mt.imageType=this.renderImageType,Mt.imageQuality=this.renderImageQuality,Mt.markersOnly=this.renderMarkersOnly,Mt.width=this.renderWidth,Mt.height=this.renderHeight,[4,Mt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return wt.sent(),[4,Mt.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,wt.sent()]}})})},Ht.prototype.close=function(Mt){var wt=this;if(Mt===void 0&&(Mt=!1),this.isOpen){var At=!1;Mt||this.eventListeners.beforeclose.forEach(function(Ut){var Et=new Sn(wt,!0);Ut(Et),Et.defaultPrevented&&(At=!0)}),At||(this.coverDiv&&this.closeUI(),this.targetObserver&&(this.targetObserver.unobserve(this.target),this.targetObserver.unobserve(this.editorCanvas)),this.settings.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),this.eventListeners.close.forEach(function(Ut){return Ut(new Sn(wt))}),this.detachEvents(),this._isOpen=!1)}},Ht.prototype.addMarkersToToolbar=function(){for(var Mt,wt=[],At=0;At<arguments.length;At++)wt[At]=arguments[At];(Mt=this._availableMarkerTypes).push.apply(Mt,wt)},Ht.prototype.addRenderEventListener=function(Mt){this.addEventListener("render",function(wt){Mt(wt.dataUrl,wt.state)})},Ht.prototype.removeRenderEventListener=function(Mt){},Ht.prototype.addCloseEventListener=function(Mt){this.addEventListener("close",function(){Mt()})},Ht.prototype.removeCloseEventListener=function(Mt){},Ht.prototype.setupResizeObserver=function(){var Mt=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){Mt.resize(Mt.target.clientWidth,Mt.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return Mt.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},Ht.prototype.onPopupTargetResize=function(){var Mt=1*this.target.clientWidth/this.target.clientHeight,wt=this.editorCanvas.clientWidth/Mt>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*Mt:this.editorCanvas.clientWidth,At=wt<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/Mt;this.resize(wt,At)},Ht.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Ht.prototype.resize=function(Mt,wt){this._isResizing=!0;var At=Mt/this.imageWidth,Ut=wt/this.imageHeight;this.imageWidth=Math.round(Mt),this.imageHeight=Math.round(wt),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(At,Ut),this._isResizing=!1},Ht.prototype.scaleMarkers=function(Mt,wt){var At,Ut=this;this._currentMarker&&this._currentMarker instanceof ke?this._currentMarker.scale(Mt,wt):(At=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(Et){Et!==Ut._currentMarker&&Et.scale(Mt,wt)}),At!==void 0&&this.setCurrentMarker(At)},Ht.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},Ht.prototype.setTopLeft=function(){var Mt=this.editingTarget.getBoundingClientRect(),wt=this.editorCanvas.getBoundingClientRect();this.left=Mt.left-wt.left,this.top=Mt.top-wt.top},Ht.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},Ht.prototype.addDefs=function(){for(var Mt,wt=[],At=0;At<arguments.length;At++)wt[At]=arguments[At];this.defs=de.createDefs(),this.addDefsToImage(),(Mt=this.defs).append.apply(Mt,wt)},Ht.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},Ht.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},Ht.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},Ht.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},Ht.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},Ht.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},Ht.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},Ht.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var Mt=document.createElement("a");Mt.href="https://markerjs.com/",Mt.target="_blank",Mt.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',Mt.title="Powered by marker.js",Mt.style.display="grid",Mt.style.alignItems="center",Mt.style.justifyItems="center",Mt.style.padding="3px",Mt.style.width="20px",Mt.style.height="20px",this.logoUI.appendChild(Mt),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},Ht.prototype.positionLogo=function(){this.logoUI&&(this.uiStyleSettings.logoPosition!=="right"?this.logoUI.style.left=this.markerImageHolder.offsetLeft+10+"px":this.logoUI.style.left=this.markerImageHolder.offsetLeft+this.markerImageHolder.offsetWidth-this.logoUI.clientWidth-10+"px",this.logoUI.style.top=this.markerImageHolder.offsetTop+this.markerImageHolder.offsetHeight-this.logoUI.clientHeight-10+"px")},Ht.prototype.overrideOverflow=function(){this.scrollXState=window.scrollX,this.scrollYState=window.scrollY,this.bodyOverflowState=document.body.style.overflow,window.scroll({top:0,left:0}),document.body.style.overflow="hidden"},Ht.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Ht.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var Mt=this.settings.uiOffsetTop!==void 0?this.target.offsetTop+this.settings.uiOffsetTop:this.target.offsetTop>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Mt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new tn(this.uiDiv,this.settings.displayMode,this._availableMarkerTypes,this.uiStyleSettings,this.styles),this.toolbar.addButtonClickListener(this.toolbarButtonClicked),this.toolbar.show(this._silentRenderMode||this.uiStyleSettings.hideToolbar?"hidden":"visible"),this.contentDiv=document.createElement("div"),this.contentDiv.style.display="flex",this.contentDiv.style.flexDirection="row",this.contentDiv.style.flexGrow="2",this.contentDiv.style.flexShrink="1",this.settings.displayMode==="popup"&&(this.contentDiv.style.backgroundColor=this.uiStyleSettings.canvasBackgroundColor,this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.uiStyleSettings.toolbarHeight+"px",this.contentDiv.style.maxWidth="calc(100vw - "+2*this.settings.popupMargin+"px)"),this.contentDiv.style.overflow="auto",this.uiDiv.appendChild(this.contentDiv),this.editorCanvas=document.createElement("div"),this.editorCanvas.style.flexGrow="2",this.editorCanvas.style.flexShrink="1",this.editorCanvas.style.position="relative",this.editorCanvas.style.overflow="hidden",this.editorCanvas.style.display="flex",this.settings.displayMode==="popup"&&(this.editorCanvas.style.alignItems="center",this.editorCanvas.style.justifyContent="center"),this.editorCanvas.style.pointerEvents="none",this.editorCanvas.style.transformOrigin="left top",this.editorCanvas.style.transform="scale("+this.zoomLevel+")",this.contentDiv.appendChild(this.editorCanvas),this.editingTarget=this.target instanceof HTMLImageElement?document.createElement("img"):document.createElement("canvas"),this.settings.uiOffsetTop===void 0&&this.target.offsetTop<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new Nt(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},Ht.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Ht.prototype.removeMarker=function(Mt){this.markerImage.removeChild(Mt.container),this.markers.indexOf(Mt)>-1&&this.markers.splice(this.markers.indexOf(Mt),1),Mt.dispose()},Ht.prototype.switchToSelectMode=function(){this.mode="select",this.hideNotesEditor(),this._currentMarker!==void 0&&(this._currentMarker.state!=="new"?this._currentMarker.select():(this.removeMarker(this._currentMarker),this.setCurrentMarker(),this.markerImage.style.cursor="default"),this.addUndoStep())},Ht.prototype.toolbarButtonClicked=function(Mt,wt){if(Mt==="marker"&&wt!==void 0)this.createNewMarker(wt);else if(Mt==="action")switch(wt){case"select":this.switchToSelectMode(),this.switchToSelectMode();break;case"delete":this.deleteSelectedMarker();break;case"clear":this.clear();break;case"undo":this.undo();break;case"redo":this.redo();break;case"zoom":this.stepZoom();break;case"zoom-out":this.zoomLevel=1;break;case"notes":this.notesArea===void 0?(this.switchToSelectMode(),this.zoomLevel=1,this.showNotesEditor()):this.switchToSelectMode();break;case"close":this.close();break;case"render":this.switchToSelectMode(),this.startRenderAndClose()}},Ht.prototype.deleteSelectedMarker=function(){var Mt=this;if(this._currentMarker!==void 0){var wt=!1;if(this.eventListeners.markerbeforedelete.forEach(function(Ut){var Et=new Te(Mt,Mt._currentMarker,!0);Ut(Et),Et.defaultPrevented&&(wt=!0)}),!wt){var At=this._currentMarker;this._currentMarker.dispose(),this.markerImage.removeChild(this._currentMarker.container),this.markers.splice(this.markers.indexOf(this._currentMarker),1),this.setCurrentMarker(),this.addUndoStep(),this.eventListeners.markerdelete.forEach(function(Ut){return Ut(new Te(Mt,At))})}}},Ht.prototype.clear=function(){var Mt=this,wt=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(be){var Dn=new Te(Mt,void 0,!0);be(Dn),Dn.defaultPrevented&&(wt=!0)}),!wt)){this.setCurrentMarker();for(var At=function(be){var Dn=Ut.markers[be];Ut.setCurrentMarker(Ut.markers[be]),Ut._currentMarker.dispose(),Ut.markerImage.removeChild(Ut._currentMarker.container),Ut.markers.splice(Ut.markers.indexOf(Ut._currentMarker),1),Ut.eventListeners.markerdelete.forEach(function(zi){return zi(new Te(Mt,Dn))})},Ut=this,Et=this.markers.length-1;Et>=0;Et--)At(Et);this.addUndoStep()}},Object.defineProperty(Ht.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),Ht.prototype.showNotesEditor=function(){var Mt;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(Mt=this._currentMarker.notes)!==null&&Mt!==void 0?Mt:"",this.overlayContainer.appendChild(this.notesArea))},Ht.prototype.hideNotesEditor=function(){this.isNotesAreaOpen&&(this._currentMarker!==void 0&&(this._currentMarker.notes=this.notesArea.value.trim()!==""?this.notesArea.value:void 0),this.overlayContainer.removeChild(this.notesArea),this.notesArea=void 0)},Ht.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},Ht.prototype.addUndoStep=function(){var Mt=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var wt=this.getState(),At=this.undoRedoManager.getLastUndoStep();if(!At||At.width===wt.width&&At.height===wt.height){var Ut=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(wt),Ut<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(Et){return Et(new Sn(Mt))})}else this.undoRedoManager.replaceLastUndoStep(wt),this.eventListeners.statechange.forEach(function(Et){return Et(new Sn(Mt))})}},Ht.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},Ht.prototype.undoStep=function(){var Mt=this,wt=this.undoRedoManager.undo();wt!==void 0&&(this.restoreState(wt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(At){return At(new Sn(Mt))}))},Ht.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},Ht.prototype.redoStep=function(){var Mt=this,wt=this.undoRedoManager.redo();wt!==void 0&&(this.restoreState(wt),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(At){return At(new Sn(Mt))}))},Ht.prototype.stepZoom=function(){var Mt=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=Mt<this.zoomSteps.length-1?this.zoomSteps[Mt+1]:this.zoomSteps[0]},Ht.prototype.panTo=function(Mt){this.contentDiv.scrollBy({left:this.prevPanPoint.x-Mt.x,top:this.prevPanPoint.y-Mt.y}),this.prevPanPoint=Mt},Ht.prototype.startRenderAndClose=function(){return Be(this,void 0,void 0,function(){var Mt,wt,At=this;return qe(this,function(Ut){switch(Ut.label){case 0:return[4,this.render()];case 1:return Mt=Ut.sent(),wt=this.getState(),this.eventListeners.render.forEach(function(Et){return Et(new he(At,Mt,wt))}),this.close(!0),[2]}})})},Ht.prototype.getState=function(Mt){Mt===!0&&this.setCurrentMarker();var wt={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(At){return wt.markers.push(At.getState())}),wt},Ht.prototype.restoreState=function(Mt){var wt=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);Mt.markers.forEach(function(At){var Ut=wt._availableMarkerTypes.find(function(be){return be.typeName===At.typeName});if(Ut!==void 0){var Et=wt.addNewMarker(Ut);Et.restoreState(At),wt.markers.push(Et)}}),Mt.width&&Mt.height&&(Mt.width!==this.imageWidth||Mt.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/Mt.width,this.imageHeight/Mt.height),this.eventListeners.restorestate.forEach(function(At){return At(new Sn(wt))})},Ht.prototype.addNewMarker=function(Mt){var wt=de.createGroup();return this.markerImage.appendChild(wt),new Mt(wt,this.overlayContainer,this.settings)},Ht.prototype.createNewMarker=function(Mt){var wt,At=this;(wt=typeof Mt=="string"?this._availableMarkerTypes.find(function(Ut){return Ut.typeName===Mt}):Mt)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(wt),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(wt.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(Ut){return Ut(new Te(At,At._currentMarker))}))},Ht.prototype.markerCreated=function(Mt){var wt=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(Mt),this.setCurrentMarker(Mt),Mt instanceof Ke&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(Ke):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(At){return At(new Te(wt,wt._currentMarker))})},Ht.prototype.colorChanged=function(Mt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=Mt,this.settings.defaultStrokeColor=Mt)},Ht.prototype.fillColorChanged=function(Mt){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=Mt)},Ht.prototype.markerStateChanged=function(Mt){var wt=this;this.eventListeners.markerchange.forEach(function(At){return At(new Te(wt,Mt))})},Ht.prototype.setCurrentMarker=function(Mt){var wt=this;this._currentMarker!==Mt&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(At){return At(new Te(wt,wt._currentMarker))})),this._currentMarker=Mt,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(At){return At(new Te(wt,wt._currentMarker))}))},Ht.prototype.onPointerDown=function(Mt){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||Mt.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var wt=this.markers.find(function(At){return At.ownsTarget(Mt.target)});wt!==void 0?(this.setCurrentMarker(wt),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY),Mt.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:Mt.clientX,y:Mt.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY))},Ht.prototype.onDblClick=function(Mt){if(this._isFocused||this.focus(),this.mode==="select"){var wt=this.markers.find(function(At){return At.ownsTarget(Mt.target)});wt!==void 0&&wt!==this._currentMarker&&this.setCurrentMarker(wt),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY),Mt.target):this.setCurrentMarker()}},Ht.prototype.onPointerMove=function(Mt){this.touchPoints!==1&&Mt.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||Mt.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY)):this.zoomLevel>1&&this.panTo({x:Mt.clientX,y:Mt.clientY}))},Ht.prototype.onPointerUp=function(Mt){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(Mt.clientX,Mt.clientY)),this.isDragging=!1,this.addUndoStep()},Ht.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},Ht.prototype.onKeyUp=function(Mt){this._currentMarker===void 0||this.notesArea!==void 0||Mt.key!=="Delete"&&Mt.key!=="Backspace"||this.deleteSelectedMarker()},Ht.prototype.clientToLocalCoordinates=function(Mt,wt){var At=this.markerImage.getBoundingClientRect();return{x:(Mt-At.left)/this.zoomLevel,y:(wt-At.top)/this.zoomLevel}},Ht.prototype.onWindowResize=function(){this.positionUI()},Ht.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var Mt=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=Mt+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},Ht.prototype.addLicenseKey=function(Mt){$t.addKey(Mt)},Ht.prototype.addEventListener=function(Mt,wt){this.eventListeners.addEventListener(Mt,wt)},Ht.prototype.removeEventListener=function(Mt,wt){this.eventListeners.removeEventListener(Mt,wt)},Ht.prototype.renderState=function(Mt){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(Mt),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(Ht.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),Ht.prototype.focus=function(){var Mt=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(wt){return wt(new Sn(Mt))}))},Ht.prototype.blur=function(){var Mt=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(wt){return wt(new Sn(Mt))}))},Ht.instanceCounter=0,Ht}()},13272:function(on,In,Jt){"use strict";Jt.d(In,{s:function(){return xh},default:function(){return xc}});function It(){return It=Object.assign?Object.assign.bind():function(kt){for(var Ft=1;Ft<arguments.length;Ft++){var Wt=arguments[Ft];for(var Zt in Wt)({}).hasOwnProperty.call(Wt,Zt)&&(kt[Zt]=Wt[Zt])}return kt},It.apply(null,arguments)}function ce(kt){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ft){return typeof Ft}:function(Ft){return Ft&&typeof Symbol=="function"&&Ft.constructor===Symbol&&Ft!==Symbol.prototype?"symbol":typeof Ft},ce(kt)}function Be(kt,Ft){if(ce(kt)!="object"||!kt)return kt;var Wt=kt[Symbol.toPrimitive];if(Wt!==void 0){var Zt=Wt.call(kt,Ft||"default");if(ce(Zt)!="object")return Zt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Ft==="string"?String:Number)(kt)}function qe(kt){var Ft=Be(kt,"string");return ce(Ft)=="symbol"?Ft:Ft+""}function Se(kt,Ft,Wt){return(Ft=qe(Ft))in kt?Object.defineProperty(kt,Ft,{value:Wt,enumerable:!0,configurable:!0,writable:!0}):kt[Ft]=Wt,kt}function de(kt,Ft){var Wt=Object.keys(kt);if(Object.getOwnPropertySymbols){var Zt=Object.getOwnPropertySymbols(kt);Ft&&(Zt=Zt.filter(function(pe){return Object.getOwnPropertyDescriptor(kt,pe).enumerable})),Wt.push.apply(Wt,Zt)}return Wt}function $t(kt){for(var Ft=1;Ft<arguments.length;Ft++){var Wt=arguments[Ft]!=null?arguments[Ft]:{};Ft%2?de(Object(Wt),!0).forEach(function(Zt){Se(kt,Zt,Wt[Zt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(kt,Object.getOwnPropertyDescriptors(Wt)):de(Object(Wt)).forEach(function(Zt){Object.defineProperty(kt,Zt,Object.getOwnPropertyDescriptor(Wt,Zt))})}return kt}function He(kt,Ft){(Ft==null||Ft>kt.length)&&(Ft=kt.length);for(var Wt=0,Zt=Array(Ft);Wt<Ft;Wt++)Zt[Wt]=kt[Wt];return Zt}function ve(kt){if(Array.isArray(kt))return He(kt)}function Pe(kt){if(typeof Symbol!="undefined"&&kt[Symbol.iterator]!=null||kt["@@iterator"]!=null)return Array.from(kt)}function ze(kt,Ft){if(kt){if(typeof kt=="string")return He(kt,Ft);var Wt={}.toString.call(kt).slice(8,-1);return Wt==="Object"&&kt.constructor&&(Wt=kt.constructor.name),Wt==="Map"||Wt==="Set"?Array.from(kt):Wt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Wt)?He(kt,Ft):void 0}}function Me(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tn(kt){return ve(kt)||Pe(kt)||ze(kt)||Me()}function Nt(kt){if(Array.isArray(kt))return kt}function nt(kt,Ft){var Wt=kt==null?null:typeof Symbol!="undefined"&&kt[Symbol.iterator]||kt["@@iterator"];if(Wt!=null){var Zt,pe,De,je,en=[],rn=!0,ln=!1;try{if(De=(Wt=Wt.call(kt)).next,Ft===0){if(Object(Wt)!==Wt)return;rn=!1}else for(;!(rn=(Zt=De.call(Wt)).done)&&(en.push(Zt.value),en.length!==Ft);rn=!0);}catch(Cn){ln=!0,pe=Cn}finally{try{if(!rn&&Wt.return!=null&&(je=Wt.return(),Object(je)!==je))return}finally{if(ln)throw pe}}return en}}function et(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ht(kt,Ft){return Nt(kt)||nt(kt,Ft)||ze(kt,Ft)||et()}function lt(kt,Ft){if(kt==null)return{};var Wt={};for(var Zt in kt)if({}.hasOwnProperty.call(kt,Zt)){if(Ft.indexOf(Zt)!==-1)continue;Wt[Zt]=kt[Zt]}return Wt}function pt(kt,Ft){if(kt==null)return{};var Wt,Zt,pe=lt(kt,Ft);if(Object.getOwnPropertySymbols){var De=Object.getOwnPropertySymbols(kt);for(Zt=0;Zt<De.length;Zt++)Wt=De[Zt],Ft.indexOf(Wt)===-1&&{}.propertyIsEnumerable.call(kt,Wt)&&(pe[Wt]=kt[Wt])}return pe}function vt(){return vt=Object.assign?Object.assign.bind():function(kt){for(var Ft=1;Ft<arguments.length;Ft++){var Wt=arguments[Ft];for(var Zt in Wt)Object.prototype.hasOwnProperty.call(Wt,Zt)&&(kt[Zt]=Wt[Zt])}return kt},vt.apply(this,arguments)}function Ct(kt,Ft){(Ft==null||Ft>kt.length)&&(Ft=kt.length);for(var Wt=0,Zt=new Array(Ft);Wt<Ft;Wt++)Zt[Wt]=kt[Wt];return Zt}function bt(kt){if(Array.isArray(kt))return Ct(kt)}function zt(kt){if(typeof Symbol!="undefined"&&kt[Symbol.iterator]!=null||kt["@@iterator"]!=null)return Array.from(kt)}function Qt(kt,Ft){if(kt){if(typeof kt=="string")return Ct(kt,Ft);var Wt=Object.prototype.toString.call(kt).slice(8,-1);if(Wt==="Object"&&kt.constructor&&(Wt=kt.constructor.name),Wt==="Map"||Wt==="Set")return Array.from(kt);if(Wt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Wt))return Ct(kt,Ft)}}function ie(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oe(kt){return bt(kt)||zt(kt)||Qt(kt)||ie()}function re(kt){"@babel/helpers - typeof";return re=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ft){return typeof Ft}:function(Ft){return Ft&&typeof Symbol=="function"&&Ft.constructor===Symbol&&Ft!==Symbol.prototype?"symbol":typeof Ft},re(kt)}function Ne(kt,Ft){if(re(kt)!=="object"||kt===null)return kt;var Wt=kt[Symbol.toPrimitive];if(Wt!==void 0){var Zt=Wt.call(kt,Ft||"default");if(re(Zt)!=="object")return Zt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Ft==="string"?String:Number)(kt)}function ue(kt){var Ft=Ne(kt,"string");return re(Ft)==="symbol"?Ft:String(Ft)}function ke(kt,Ft,Wt){return Ft=ue(Ft),Ft in kt?Object.defineProperty(kt,Ft,{value:Wt,enumerable:!0,configurable:!0,writable:!0}):kt[Ft]=Wt,kt}function Ke(kt,Ft){var Wt=Object.keys(kt);if(Object.getOwnPropertySymbols){var Zt=Object.getOwnPropertySymbols(kt);Ft&&(Zt=Zt.filter(function(pe){return Object.getOwnPropertyDescriptor(kt,pe).enumerable})),Wt.push.apply(Wt,Zt)}return Wt}function Fe(kt){for(var Ft=1;Ft<arguments.length;Ft++){var Wt=arguments[Ft]!=null?arguments[Ft]:{};Ft%2?Ke(Object(Wt),!0).forEach(function(Zt){ke(kt,Zt,Wt[Zt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(kt,Object.getOwnPropertyDescriptors(Wt)):Ke(Object(Wt)).forEach(function(Zt){Object.defineProperty(kt,Zt,Object.getOwnPropertyDescriptor(Wt,Zt))})}return kt}function wn(kt){if(Array.isArray(kt))return kt}function Rn(kt,Ft){var Wt=kt==null?null:typeof Symbol!="undefined"&&kt[Symbol.iterator]||kt["@@iterator"];if(Wt!=null){var Zt,pe,De,je,en=[],rn=!0,ln=!1;try{if(De=(Wt=Wt.call(kt)).next,Ft===0){if(Object(Wt)!==Wt)return;rn=!1}else for(;!(rn=(Zt=De.call(Wt)).done)&&(en.push(Zt.value),en.length!==Ft);rn=!0);}catch(Cn){ln=!0,pe=Cn}finally{try{if(!rn&&Wt.return!=null&&(je=Wt.return(),Object(je)!==je))return}finally{if(ln)throw pe}}return en}}function $n(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function di(kt,Ft){return wn(kt)||Rn(kt,Ft)||Qt(kt,Ft)||$n()}function ee(kt,Ft){if(kt==null)return{};var Wt={},Zt=Object.keys(kt),pe,De;for(De=0;De<Zt.length;De++)pe=Zt[De],!(Ft.indexOf(pe)>=0)&&(Wt[pe]=kt[pe]);return Wt}function _t(kt,Ft){if(kt==null)return{};var Wt=ee(kt,Ft),Zt,pe;if(Object.getOwnPropertySymbols){var De=Object.getOwnPropertySymbols(kt);for(pe=0;pe<De.length;pe++)Zt=De[pe],!(Ft.indexOf(Zt)>=0)&&Object.prototype.propertyIsEnumerable.call(kt,Zt)&&(Wt[Zt]=kt[Zt])}return Wt}var Kt=Jt(67294);function pn(kt){var Ft=Kt.useRef();Ft.current=kt;var Wt=Kt.useCallback(function(){for(var Zt,pe=arguments.length,De=new Array(pe),je=0;je<pe;je++)De[je]=arguments[je];return(Zt=Ft.current)===null||Zt===void 0?void 0:Zt.call.apply(Zt,[Ft].concat(De))},[]);return Wt}function Ln(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ce=Ln()?Kt.useLayoutEffect:Kt.useEffect,sn=Ce,cn=function(Ft,Wt){var Zt=Kt.useRef(!0);Ce(function(){if(!Zt.current)return Ft()},Wt),Ce(function(){return Zt.current=!1,function(){Zt.current=!0}},[])};function Jn(kt){var Ft=Kt.useRef(!1),Wt=Kt.useState(kt),Zt=di(Wt,2),pe=Zt[0],De=Zt[1];Kt.useEffect(function(){return Ft.current=!1,function(){Ft.current=!0}},[]);function je(en,rn){rn&&Ft.current||De(en)}return[pe,je]}function Sn(kt){return kt!==void 0}function he(kt,Ft){var Wt=Ft||{},Zt=Wt.defaultValue,pe=Wt.value,De=Wt.onChange,je=Wt.postState,en=Jn(function(){return Sn(pe)?pe:Sn(Zt)?typeof Zt=="function"?Zt():Zt:typeof kt=="function"?kt():kt}),rn=di(en,2),ln=rn[0],Cn=rn[1],Tn=pe!==void 0?pe:ln,_n=je?je(Tn):Tn,kn=pn(De),bn=Jn([Tn]),Vn=di(bn,2),Hn=Vn[0],Fi=Vn[1];cn(function(){var Si=Hn[0];ln!==Si&&kn(ln,Si)},[Hn]),cn(function(){Sn(pe)||Cn(pe)},[pe]);var Zi=pn(function(Si,Ti){Cn(Si,Ti),Fi([Tn],Ti)});return[_n,Zi]}var Te={};function Nn(kt,Ft){}function Bn(kt,Ft){}function Ht(){Te={}}function Mt(kt,Ft,Wt){!Ft&&!Te[Wt]&&(kt(!1,Wt),Te[Wt]=!0)}function wt(kt,Ft){Mt(Nn,kt,Ft)}function At(kt,Ft){Mt(Bn,kt,Ft)}var Ut=wt,Et=Jt(94184),be=Jt.n(Et),Dn=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var kt=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(kt)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(kt==null?void 0:kt.substr(0,4))},zi=Jt(16357);function yi(kt,Ft,Wt){var Zt=Kt.useRef({});return(!("value"in Zt.current)||Wt(Zt.current.condition,Ft))&&(Zt.current.value=kt(),Zt.current.condition=Ft),Zt.current.value}function ei(kt,Ft){typeof kt=="function"?kt(Ft):re(kt)==="object"&&kt&&"current"in kt&&(kt.current=Ft)}function Qi(){for(var kt=arguments.length,Ft=new Array(kt),Wt=0;Wt<kt;Wt++)Ft[Wt]=arguments[Wt];var Zt=Ft.filter(function(pe){return pe});return Zt.length<=1?Zt[0]:function(pe){Ft.forEach(function(De){ei(De,pe)})}}function Mn(){for(var kt=arguments.length,Ft=new Array(kt),Wt=0;Wt<kt;Wt++)Ft[Wt]=arguments[Wt];return yi(function(){return Qi.apply(void 0,Ft)},Ft,function(Zt,pe){return Zt.length===pe.length&&Zt.every(function(De,je){return De===pe[je]})})}function sr(kt){var Ft,Wt,Zt=isMemo(kt)?kt.type.type:kt.type;return!(typeof Zt=="function"&&!((Ft=Zt.prototype)!==null&&Ft!==void 0&&Ft.render)||typeof kt=="function"&&!((Wt=kt.prototype)!==null&&Wt!==void 0&&Wt.render))}var Yi=function(Ft){var Wt=Ft.className,Zt=Ft.customizeIcon,pe=Ft.customizeIconProps,De=Ft.children,je=Ft.onMouseDown,en=Ft.onClick,rn=typeof Zt=="function"?Zt(pe):Zt;return Kt.createElement("span",{className:Wt,onMouseDown:function(Cn){Cn.preventDefault(),je==null||je(Cn)},style:{userSelect:"none",WebkitUserSelect:"none"},unselectable:"on",onClick:en,"aria-hidden":!0},rn!==void 0?rn:Kt.createElement("span",{className:be()(Wt.split(/\s+/).map(function(ln){return"".concat(ln,"-icon")}))},De))},Vr=Yi,Ci=function(Ft,Wt,Zt,pe,De){var je=arguments.length>5&&arguments[5]!==void 0?arguments[5]:!1,en=arguments.length>6?arguments[6]:void 0,rn=arguments.length>7?arguments[7]:void 0,ln=Kt.useMemo(function(){if(re(pe)==="object")return pe.clearIcon;if(De)return De},[pe,De]),Cn=Kt.useMemo(function(){return!!(!je&&pe&&(Zt.length||en)&&!(rn==="combobox"&&en===""))},[pe,je,Zt.length,en,rn]);return{allowClear:Cn,clearIcon:Kt.createElement(Vr,{className:"".concat(Ft,"-clear"),onMouseDown:Wt,customizeIcon:ln},"\xD7")}},Us=Kt.createContext(null);function is(){return Kt.useContext(Us)}function xo(){var kt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:10,Ft=Kt.useState(!1),Wt=di(Ft,2),Zt=Wt[0],pe=Wt[1],De=Kt.useRef(null),je=function(){window.clearTimeout(De.current)};Kt.useEffect(function(){return je},[]);var en=function(ln,Cn){je(),De.current=window.setTimeout(function(){pe(ln),Cn&&Cn()},kt)};return[Zt,en,je]}function zr(){var kt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:250,Ft=Kt.useRef(null),Wt=Kt.useRef(null);Kt.useEffect(function(){return function(){window.clearTimeout(Wt.current)}},[]);function Zt(pe){(pe||Ft.current===null)&&(Ft.current=pe),window.clearTimeout(Wt.current),Wt.current=window.setTimeout(function(){Ft.current=null},kt)}return[function(){return Ft.current},Zt]}function wl(kt,Ft,Wt,Zt){var pe=Kt.useRef(null);pe.current={open:Ft,triggerOpen:Wt,customizedTrigger:Zt},Kt.useEffect(function(){function De(je){var en;if(!((en=pe.current)!==null&&en!==void 0&&en.customizedTrigger)){var rn=je.target;rn.shadowRoot&&je.composed&&(rn=je.composedPath()[0]||rn),pe.current.open&&kt().filter(function(ln){return ln}).every(function(ln){return!ln.contains(rn)&&ln!==rn})&&pe.current.triggerOpen(!1)}}return window.addEventListener("mousedown",De),function(){return window.removeEventListener("mousedown",De)}},[])}var Li={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Ft){var Wt=Ft.keyCode;if(Ft.altKey&&!Ft.ctrlKey||Ft.metaKey||Wt>=Li.F1&&Wt<=Li.F12)return!1;switch(Wt){case Li.ALT:case Li.CAPS_LOCK:case Li.CONTEXT_MENU:case Li.CTRL:case Li.DOWN:case Li.END:case Li.ESC:case Li.HOME:case Li.INSERT:case Li.LEFT:case Li.MAC_FF_META:case Li.META:case Li.NUMLOCK:case Li.NUM_CENTER:case Li.PAGE_DOWN:case Li.PAGE_UP:case Li.PAUSE:case Li.PRINT_SCREEN:case Li.RIGHT:case Li.SHIFT:case Li.UP:case Li.WIN_KEY:case Li.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Ft){if(Ft>=Li.ZERO&&Ft<=Li.NINE||Ft>=Li.NUM_ZERO&&Ft<=Li.NUM_MULTIPLY||Ft>=Li.A&&Ft<=Li.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Ft===0)return!0;switch(Ft){case Li.SPACE:case Li.QUESTION_MARK:case Li.NUM_PLUS:case Li.NUM_MINUS:case Li.NUM_PERIOD:case Li.NUM_DIVISION:case Li.SEMICOLON:case Li.DASH:case Li.EQUALS:case Li.COMMA:case Li.PERIOD:case Li.SLASH:case Li.APOSTROPHE:case Li.SINGLE_QUOTE:case Li.OPEN_SQUARE_BRACKET:case Li.BACKSLASH:case Li.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},qi=Li;function aa(kt){return kt&&![qi.ESC,qi.SHIFT,qi.BACKSPACE,qi.TAB,qi.WIN_KEY,qi.ALT,qi.META,qi.WIN_KEY_RIGHT,qi.CTRL,qi.SEMICOLON,qi.EQUALS,qi.CAPS_LOCK,qi.CONTEXT_MENU,qi.F1,qi.F2,qi.F3,qi.F4,qi.F5,qi.F6,qi.F7,qi.F8,qi.F9,qi.F10,qi.F11,qi.F12].includes(kt)}var Oa=`accept acceptCharset accessKey action allowFullScreen allowTransparency
|
|
alt async autoComplete autoFocus autoPlay capture cellPadding cellSpacing challenge
|
|
charSet checked classID className colSpan cols content contentEditable contextMenu
|
|
controls coords crossOrigin data dateTime default defer dir disabled download draggable
|
|
encType form formAction formEncType formMethod formNoValidate formTarget frameBorder
|
|
headers height hidden high href hrefLang htmlFor httpEquiv icon id inputMode integrity
|
|
is keyParams keyType kind label lang list loop low manifest marginHeight marginWidth max maxLength media
|
|
mediaGroup method min minLength multiple muted name noValidate nonce open
|
|
optimum pattern placeholder poster preload radioGroup readOnly rel required
|
|
reversed role rowSpan rows sandbox scope scoped scrolling seamless selected
|
|
shape size sizes span spellCheck src srcDoc srcLang srcSet start step style
|
|
summary tabIndex target title type useMap value width wmode wrap`,Or=`onCopy onCut onPaste onCompositionEnd onCompositionStart onCompositionUpdate onKeyDown
|
|
onKeyPress onKeyUp onFocus onBlur onChange onInput onSubmit onClick onContextMenu onDoubleClick
|
|
onDrag onDragEnd onDragEnter onDragExit onDragLeave onDragOver onDragStart onDrop onMouseDown
|
|
onMouseEnter onMouseLeave onMouseMove onMouseOut onMouseOver onMouseUp onSelect onTouchCancel
|
|
onTouchEnd onTouchMove onTouchStart onScroll onWheel onAbort onCanPlay onCanPlayThrough
|
|
onDurationChange onEmptied onEncrypted onEnded onError onLoadedData onLoadedMetadata
|
|
onLoadStart onPause onPlay onPlaying onProgress onRateChange onSeeked onSeeking onStalled onSuspend onTimeUpdate onVolumeChange onWaiting onLoad onError`,Il="".concat(Oa," ").concat(Or).split(/[\s\n]+/),ku="aria-",bu="data-";function Rh(kt,Ft){return kt.indexOf(Ft)===0}function Xl(kt){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Wt;Ft===!1?Wt={aria:!0,data:!0,attr:!0}:Ft===!0?Wt={aria:!0}:Wt=Fe({},Ft);var Zt={};return Object.keys(kt).forEach(function(pe){(Wt.aria&&(pe==="role"||Rh(pe,ku))||Wt.data&&Rh(pe,bu)||Wt.attr&&Il.includes(pe))&&(Zt[pe]=kt[pe])}),Zt}function Ia(){return Ia=Object.assign?Object.assign.bind():function(kt){for(var Ft=1;Ft<arguments.length;Ft++){var Wt=arguments[Ft];for(var Zt in Wt)Object.prototype.hasOwnProperty.call(Wt,Zt)&&(kt[Zt]=Wt[Zt])}return kt},Ia.apply(this,arguments)}function Cl(kt){"@babel/helpers - typeof";return Cl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(Ft){return typeof Ft}:function(Ft){return Ft&&typeof Symbol=="function"&&Ft.constructor===Symbol&&Ft!==Symbol.prototype?"symbol":typeof Ft},Cl(kt)}function bs(kt,Ft){if(Cl(kt)!=="object"||kt===null)return kt;var Wt=kt[Symbol.toPrimitive];if(Wt!==void 0){var Zt=Wt.call(kt,Ft||"default");if(Cl(Zt)!=="object")return Zt;throw new TypeError("@@toPrimitive must return a primitive value.")}return(Ft==="string"?String:Number)(kt)}function Qe(kt){var Ft=bs(kt,"string");return Cl(Ft)==="symbol"?Ft:String(Ft)}function xt(kt,Ft,Wt){return Ft=Qe(Ft),Ft in kt?Object.defineProperty(kt,Ft,{value:Wt,enumerable:!0,configurable:!0,writable:!0}):kt[Ft]=Wt,kt}function En(kt,Ft){var Wt=Object.keys(kt);if(Object.getOwnPropertySymbols){var Zt=Object.getOwnPropertySymbols(kt);Ft&&(Zt=Zt.filter(function(pe){return Object.getOwnPropertyDescriptor(kt,pe).enumerable})),Wt.push.apply(Wt,Zt)}return Wt}function mn(kt){for(var Ft=1;Ft<arguments.length;Ft++){var Wt=arguments[Ft]!=null?arguments[Ft]:{};Ft%2?En(Object(Wt),!0).forEach(function(Zt){xt(kt,Zt,Wt[Zt])}):Object.getOwnPropertyDescriptors?Object.defineProperties(kt,Object.getOwnPropertyDescriptors(Wt)):En(Object(Wt)).forEach(function(Zt){Object.defineProperty(kt,Zt,Object.getOwnPropertyDescriptor(Wt,Zt))})}return kt}function bi(kt){if(Array.isArray(kt))return kt}function gi(kt,Ft){var Wt=kt==null?null:typeof Symbol!="undefined"&&kt[Symbol.iterator]||kt["@@iterator"];if(Wt!=null){var Zt,pe,De,je,en=[],rn=!0,ln=!1;try{if(De=(Wt=Wt.call(kt)).next,Ft===0){if(Object(Wt)!==Wt)return;rn=!1}else for(;!(rn=(Zt=De.call(Wt)).done)&&(en.push(Zt.value),en.length!==Ft);rn=!0);}catch(Cn){ln=!0,pe=Cn}finally{try{if(!rn&&Wt.return!=null&&(je=Wt.return(),Object(je)!==je))return}finally{if(ln)throw pe}}return en}}function fi(kt,Ft){(Ft==null||Ft>kt.length)&&(Ft=kt.length);for(var Wt=0,Zt=new Array(Ft);Wt<Ft;Wt++)Zt[Wt]=kt[Wt];return Zt}function Gi(kt,Ft){if(kt){if(typeof kt=="string")return fi(kt,Ft);var Wt=Object.prototype.toString.call(kt).slice(8,-1);if(Wt==="Object"&&kt.constructor&&(Wt=kt.constructor.name),Wt==="Map"||Wt==="Set")return Array.from(kt);if(Wt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Wt))return fi(kt,Ft)}}function br(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Le(kt,Ft){return bi(kt)||gi(kt,Ft)||Gi(kt,Ft)||br()}function Ie(kt,Ft){if(kt==null)return{};var Wt={},Zt=Object.keys(kt),pe,De;for(De=0;De<Zt.length;De++)pe=Zt[De],!(Ft.indexOf(pe)>=0)&&(Wt[pe]=kt[pe]);return Wt}function le(kt,Ft){if(kt==null)return{};var Wt=Ie(kt,Ft),Zt,pe;if(Object.getOwnPropertySymbols){var De=Object.getOwnPropertySymbols(kt);for(pe=0;pe<De.length;pe++)Zt=De[pe],!(Ft.indexOf(Zt)>=0)&&Object.prototype.propertyIsEnumerable.call(kt,Zt)&&(Wt[Zt]=kt[Zt])}return Wt}var Oe=Jt(48555);function On(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Wn=On()?Kt.useLayoutEffect:Kt.useEffect,Mi=function(Ft,Wt){var Zt=Kt.useRef(!0);Wn(function(){return Ft(Zt.current)},Wt),Wn(function(){return Zt.current=!1,function(){Zt.current=!0}},[])},xe=function(Ft,Wt){Mi(function(Zt){if(!Zt)return Ft()},Wt)},Xe=Mi,Zn=["prefixCls","invalidate","item","renderItem","responsive","responsiveDisabled","registerSize","itemKey","className","style","children","display","order","component"],Oi=void 0;function an(kt,Ft){var Wt=kt.prefixCls,Zt=kt.invalidate,pe=kt.item,De=kt.renderItem,je=kt.responsive,en=kt.responsiveDisabled,rn=kt.registerSize,ln=kt.itemKey,Cn=kt.className,Tn=kt.style,_n=kt.children,kn=kt.display,bn=kt.order,Vn=kt.component,Hn=Vn===void 0?"div":Vn,Fi=le(kt,Zn),Zi=je&&!kn;function Si(Wi){rn(ln,Wi)}Kt.useEffect(function(){return function(){Si(null)}},[]);var Ti=De&&pe!==Oi?De(pe):_n,dr;Zt||(dr={opacity:Zi?0:1,height:Zi?0:Oi,overflowY:Zi?"hidden":Oi,order:je?bn:Oi,pointerEvents:Zi?"none":Oi,position:Zi?"absolute":Oi});var Pn={};Zi&&(Pn["aria-hidden"]=!0);var Ai=Kt.createElement(Hn,Ia({className:be()(!Zt&&Wt,Cn),style:mn(mn({},dr),Tn)},Pn,Fi,{ref:Ft}),Ti);return je&&(Ai=Kt.createElement(Oe.Z,{onResize:function(_i){var Ji=_i.offsetWidth;Si(Ji)},disabled:en},Ai)),Ai}var fe=Kt.forwardRef(an);fe.displayName="Item";var An=fe;function ri(kt){var Ft=Kt.useRef();Ft.current=kt;var Wt=Kt.useCallback(function(){for(var Zt,pe=arguments.length,De=new Array(pe),je=0;je<pe;je++)De[je]=arguments[je];return(Zt=Ft.current)===null||Zt===void 0?void 0:Zt.call.apply(Zt,[Ft].concat(De))},[]);return Wt}var Ki=Jt(73935),Ue=function(Ft){return+setTimeout(Ft,16)},Gn=function(Ft){return clearTimeout(Ft)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Ue=function(Ft){return window.requestAnimationFrame(Ft)},Gn=function(Ft){return window.cancelAnimationFrame(Ft)});var uo=0,zo=new Map;function $r(kt){zo.delete(kt)}var Kn=function(Ft){var Wt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;uo+=1;var Zt=uo;function pe(De){if(De===0)$r(Zt),Ft();else{var je=Ue(function(){pe(De-1)});zo.set(Zt,je)}}return pe(Wt),Zt};Kn.cancel=function(kt){var Ft=zo.get(kt);return $r(Ft),Gn(Ft)};var zn=Kn;function qn(kt){if(typeof MessageChannel=="undefined")zn(kt);else{var Ft=new MessageChannel;Ft.port1.onmessage=function(){return kt()},Ft.port2.postMessage(void 0)}}function Ir(){var kt=Kt.useRef(null),Ft=function(Zt){kt.current||(kt.current=[],qn(function(){(0,Ki.unstable_batchedUpdates)(function(){kt.current.forEach(function(pe){pe()}),kt.current=null})})),kt.current.push(Zt)};return Ft}function no(kt,Ft){var Wt=Kt.useState(Ft),Zt=Le(Wt,2),pe=Zt[0],De=Zt[1],je=ri(function(en){kt(function(){De(en)})});return[pe,je]}var hn=Kt.createContext(null),ci=["component"],Za=["className"],Ps=["className"],rs=function(Ft,Wt){var Zt=Kt.useContext(hn);if(!Zt){var pe=Ft.component,De=pe===void 0?"div":pe,je=le(Ft,ci);return Kt.createElement(De,Ia({},je,{ref:Wt}))}var en=Zt.className,rn=le(Zt,Za),ln=Ft.className,Cn=le(Ft,Ps);return Kt.createElement(hn.Provider,{value:null},Kt.createElement(An,Ia({ref:Wt,className:be()(en,ln)},rn,Cn)))},me=Kt.forwardRef(rs);me.displayName="RawItem";var xi=me,gr=["prefixCls","data","renderItem","renderRawItem","itemKey","itemWidth","ssr","style","className","maxCount","renderRest","renderRawRest","suffix","component","itemComponent","onVisibleChange"],ai="responsive",ho="invalidate";function pr(kt){return"+ ".concat(kt.length," ...")}function Sr(kt,Ft){var Wt=kt.prefixCls,Zt=Wt===void 0?"rc-overflow":Wt,pe=kt.data,De=pe===void 0?[]:pe,je=kt.renderItem,en=kt.renderRawItem,rn=kt.itemKey,ln=kt.itemWidth,Cn=ln===void 0?10:ln,Tn=kt.ssr,_n=kt.style,kn=kt.className,bn=kt.maxCount,Vn=kt.renderRest,Hn=kt.renderRawRest,Fi=kt.suffix,Zi=kt.component,Si=Zi===void 0?"div":Zi,Ti=kt.itemComponent,dr=kt.onVisibleChange,Pn=le(kt,gr),Ai=Tn==="full",Wi=Ir(),_i=no(Wi,null),Ji=Le(_i,2),vi=Ji[0],ar=Ji[1],ir=vi||0,Ar=no(Wi,new Map),Pr=Le(Ar,2),wr=Pr[0],Gr=Pr[1],Kr=no(Wi,0),Er=Le(Kr,2),pi=Er[0],fr=Er[1],Yr=no(Wi,0),Fr=Le(Yr,2),io=Fr[0],ao=Fr[1],po=no(Wi,0),ro=Le(po,2),Oo=ro[0],Vs=ro[1],_o=(0,Kt.useState)(null),Ui=Le(_o,2),Hi=Ui[0],Ri=Ui[1],ui=(0,Kt.useState)(null),hi=Le(ui,2),Vi=hi[0],yr=hi[1],Xr=Kt.useMemo(function(){return Vi===null&&Ai?Number.MAX_SAFE_INTEGER:Vi||0},[Vi,vi]),Tr=(0,Kt.useState)(!1),Ho=Le(Tr,2),Ts=Ho[0],lo=Ho[1],zs="".concat(Zt,"-item"),Io=Math.max(pi,io),ha=bn===ai,Cs=De.length&&ha,Pa=bn===ho,Ns=Cs||typeof bn=="number"&&De.length>bn,ys=(0,Kt.useMemo)(function(){var $i=De;return Cs?vi===null&&Ai?$i=De:$i=De.slice(0,Math.min(De.length,ir/Cn)):typeof bn=="number"&&($i=De.slice(0,bn)),$i},[De,Cn,vi,bn,Cs]),Do=(0,Kt.useMemo)(function(){return Cs?De.slice(Xr+1):De.slice(ys.length)},[De,ys,Cs,Xr]),Yo=(0,Kt.useCallback)(function($i,to){var tr;return typeof rn=="function"?rn($i):(tr=rn&&($i==null?void 0:$i[rn]))!==null&&tr!==void 0?tr:to},[rn]),Ml=(0,Kt.useCallback)(je||function($i){return $i},[je]);function Ga($i,to,tr){Vi===$i&&(to===void 0||to===Hi)||(yr($i),tr||(lo($i<De.length-1),dr==null||dr($i)),to!==void 0&&Ri(to))}function Js($i,to){ar(to.clientWidth)}function Gs($i,to){Gr(function(tr){var _s=new Map(tr);return to===null?_s.delete($i):_s.set($i,to),_s})}function bo($i,to){ao(to),fr(io)}function Ls($i,to){Vs(to)}function cu($i){return wr.get(Yo(ys[$i],$i))}Xe(function(){if(ir&&typeof Io=="number"&&ys){var $i=Oo,to=ys.length,tr=to-1;if(!to){Ga(0,null);return}for(var _s=0;_s<to;_s+=1){var tl=cu(_s);if(Ai&&(tl=tl||0),tl===void 0){Ga(_s-1,void 0,!0);break}if($i+=tl,tr===0&&$i<=ir||_s===tr-1&&$i+cu(tr)<=ir){Ga(tr,null);break}else if($i+Io>ir){Ga(_s-1,$i-tl-Oo+io);break}}Fi&&cu(0)+Oo>ir&&Ri(null)}},[ir,wr,io,Oo,Yo,ys]);var Qs=Ts&&!!Do.length,eh={};Hi!==null&&Cs&&(eh={position:"absolute",left:Hi,top:0});var se={prefixCls:zs,responsive:Cs,component:Ti,invalidate:Pa},kl=en?function($i,to){var tr=Yo($i,to);return Kt.createElement(hn.Provider,{key:tr,value:mn(mn({},se),{},{order:to,item:$i,itemKey:tr,registerSize:Gs,display:to<=Xr})},en($i,to))}:function($i,to){var tr=Yo($i,to);return Kt.createElement(An,Ia({},se,{order:to,key:tr,item:$i,renderItem:Ml,itemKey:tr,registerSize:Gs,display:to<=Xr}))},wa,gu={order:Qs?Xr:Number.MAX_SAFE_INTEGER,className:"".concat(zs,"-rest"),registerSize:bo,display:Qs};if(Hn)Hn&&(wa=Kt.createElement(hn.Provider,{value:mn(mn({},se),gu)},Hn(Do)));else{var ql=Vn||pr;wa=Kt.createElement(An,Ia({},se,gu),typeof ql=="function"?ql(Do):ql)}var Ds=Kt.createElement(Si,Ia({className:be()(!Pa&&Zt,kn),style:_n,ref:Ft},Pn),ys.map(kl),Ns?wa:null,Fi&&Kt.createElement(An,Ia({},se,{responsive:ha,responsiveDisabled:!Cs,order:Xr,className:"".concat(zs,"-suffix"),registerSize:Ls,display:!0,style:eh}),Fi));return ha&&(Ds=Kt.createElement(Oe.Z,{onResize:Js,disabled:!Cs},Ds)),Ds}var lr=Kt.forwardRef(Sr);lr.displayName="Overflow",lr.Item=xi,lr.RESPONSIVE=ai,lr.INVALIDATE=ho;var ur=lr,Wr=ur,Ve=function(Ft,Wt){var Zt,pe=Ft.prefixCls,De=Ft.id,je=Ft.inputElement,en=Ft.disabled,rn=Ft.tabIndex,ln=Ft.autoFocus,Cn=Ft.autoComplete,Tn=Ft.editable,_n=Ft.activeDescendantId,kn=Ft.value,bn=Ft.maxLength,Vn=Ft.onKeyDown,Hn=Ft.onMouseDown,Fi=Ft.onChange,Zi=Ft.onPaste,Si=Ft.onCompositionStart,Ti=Ft.onCompositionEnd,dr=Ft.onBlur,Pn=Ft.open,Ai=Ft.attrs,Wi=je||Kt.createElement("input",null),_i=Wi,Ji=_i.ref,vi=_i.props,ar=vi.onKeyDown,ir=vi.onChange,Ar=vi.onMouseDown,Pr=vi.onCompositionStart,wr=vi.onCompositionEnd,Gr=vi.onBlur,Kr=vi.style;return"maxLength"in Wi.props,Wi=Kt.cloneElement(Wi,Fe(Fe(Fe({type:"search"},vi),{},{id:De,ref:Qi(Wt,Ji),disabled:en,tabIndex:rn,autoComplete:Cn||"off",autoFocus:ln,className:be()("".concat(pe,"-selection-search-input"),(Zt=Wi)===null||Zt===void 0||(Zt=Zt.props)===null||Zt===void 0?void 0:Zt.className),role:"combobox","aria-expanded":Pn||!1,"aria-haspopup":"listbox","aria-owns":"".concat(De,"_list"),"aria-autocomplete":"list","aria-controls":"".concat(De,"_list"),"aria-activedescendant":Pn?_n:void 0},Ai),{},{value:Tn?kn:"",maxLength:bn,readOnly:!Tn,unselectable:Tn?null:"on",style:Fe(Fe({},Kr),{},{opacity:Tn?null:0}),onKeyDown:function(pi){Vn(pi),ar&&ar(pi)},onMouseDown:function(pi){Hn(pi),Ar&&Ar(pi)},onChange:function(pi){Fi(pi),ir&&ir(pi)},onCompositionStart:function(pi){Si(pi),Pr&&Pr(pi)},onCompositionEnd:function(pi){Ti(pi),wr&&wr(pi)},onPaste:Zi,onBlur:function(pi){dr(pi),Gr&&Gr(pi)}})),Wi},Ko=Kt.forwardRef(Ve),Ye=Ko;function qr(kt){return Array.isArray(kt)?kt:kt!==void 0?[kt]:[]}var ma=typeof window!="undefined"&&window.document&&window.document.documentElement,Co=ma;function hl(kt){return kt!=null}function Fo(kt){return!kt&&kt!==0}function vr(kt){return["string","number"].includes(re(kt))}function Ao(kt){var Ft=void 0;return kt&&(vr(kt.title)?Ft=kt.title.toString():vr(kt.label)&&(Ft=kt.label.toString())),Ft}function Ja(kt,Ft){Co?Kt.useLayoutEffect(kt,Ft):Kt.useEffect(kt,Ft)}function To(kt){var Ft;return(Ft=kt.key)!==null&&Ft!==void 0?Ft:kt.value}var xn=function(Ft){Ft.preventDefault(),Ft.stopPropagation()},jt=function(Ft){var Wt=Ft.id,Zt=Ft.prefixCls,pe=Ft.values,De=Ft.open,je=Ft.searchValue,en=Ft.autoClearSearchValue,rn=Ft.inputRef,ln=Ft.placeholder,Cn=Ft.disabled,Tn=Ft.mode,_n=Ft.showSearch,kn=Ft.autoFocus,bn=Ft.autoComplete,Vn=Ft.activeDescendantId,Hn=Ft.tabIndex,Fi=Ft.removeIcon,Zi=Ft.maxTagCount,Si=Ft.maxTagTextLength,Ti=Ft.maxTagPlaceholder,dr=Ti===void 0?function(ui){return"+ ".concat(ui.length," ...")}:Ti,Pn=Ft.tagRender,Ai=Ft.onToggleOpen,Wi=Ft.onRemove,_i=Ft.onInputChange,Ji=Ft.onInputPaste,vi=Ft.onInputKeyDown,ar=Ft.onInputMouseDown,ir=Ft.onInputCompositionStart,Ar=Ft.onInputCompositionEnd,Pr=Ft.onInputBlur,wr=Kt.useRef(null),Gr=(0,Kt.useState)(0),Kr=di(Gr,2),Er=Kr[0],pi=Kr[1],fr=(0,Kt.useState)(!1),Yr=di(fr,2),Fr=Yr[0],io=Yr[1],ao="".concat(Zt,"-selection"),po=De||Tn==="multiple"&&en===!1||Tn==="tags"?je:"",ro=Tn==="tags"||Tn==="multiple"&&en===!1||_n&&(De||Fr);Ja(function(){pi(wr.current.scrollWidth)},[po]);var Oo=function(hi,Vi,yr,Xr,Tr){return Kt.createElement("span",{title:Ao(hi),className:be()("".concat(ao,"-item"),ke({},"".concat(ao,"-item-disabled"),yr))},Kt.createElement("span",{className:"".concat(ao,"-item-content")},Vi),Xr&&Kt.createElement(Vr,{className:"".concat(ao,"-item-remove"),onMouseDown:xn,onClick:Tr,customizeIcon:Fi},"\xD7"))},Vs=function(hi,Vi,yr,Xr,Tr,Ho){var Ts=function(zs){xn(zs),Ai(!De)};return Kt.createElement("span",{onMouseDown:Ts},Pn({label:Vi,value:hi,disabled:yr,closable:Xr,onClose:Tr,isMaxTag:!!Ho}))},_o=function(hi){var Vi=hi.disabled,yr=hi.label,Xr=hi.value,Tr=!Cn&&!Vi,Ho=yr;if(typeof Si=="number"&&(typeof yr=="string"||typeof yr=="number")){var Ts=String(Ho);Ts.length>Si&&(Ho="".concat(Ts.slice(0,Si),"..."))}var lo=function(Io){Io&&Io.stopPropagation(),Wi(hi)};return typeof Pn=="function"?Vs(Xr,Ho,Vi,Tr,lo):Oo(hi,Ho,Vi,Tr,lo)},Ui=function(hi){if(!pe.length)return null;var Vi=typeof dr=="function"?dr(hi):dr;return typeof Pn=="function"?Vs(void 0,Vi,!1,!1,void 0,!0):Oo({title:Vi},Vi,!1)},Hi=Kt.createElement("div",{className:"".concat(ao,"-search"),style:{width:Er},onFocus:function(){io(!0)},onBlur:function(){io(!1)}},Kt.createElement(Ye,{ref:rn,open:De,prefixCls:Zt,id:Wt,inputElement:null,disabled:Cn,autoFocus:kn,autoComplete:bn,editable:ro,activeDescendantId:Vn,value:po,onKeyDown:vi,onMouseDown:ar,onChange:_i,onPaste:Ji,onCompositionStart:ir,onCompositionEnd:Ar,onBlur:Pr,tabIndex:Hn,attrs:Xl(Ft,!0)}),Kt.createElement("span",{ref:wr,className:"".concat(ao,"-search-mirror"),"aria-hidden":!0},po,"\xA0")),Ri=Kt.createElement(Wr,{prefixCls:"".concat(ao,"-overflow"),data:pe,renderItem:_o,renderRest:Ui,suffix:Hi,itemKey:To,maxCount:Zi});return Kt.createElement("span",{className:"".concat(ao,"-wrap")},Ri,!pe.length&&!po&&Kt.createElement("span",{className:"".concat(ao,"-placeholder")},ln))},cs=jt,Eu=function(Ft){var Wt=Ft.inputElement,Zt=Ft.prefixCls,pe=Ft.id,De=Ft.inputRef,je=Ft.disabled,en=Ft.autoFocus,rn=Ft.autoComplete,ln=Ft.activeDescendantId,Cn=Ft.mode,Tn=Ft.open,_n=Ft.values,kn=Ft.placeholder,bn=Ft.tabIndex,Vn=Ft.showSearch,Hn=Ft.searchValue,Fi=Ft.activeValue,Zi=Ft.maxLength,Si=Ft.onInputKeyDown,Ti=Ft.onInputMouseDown,dr=Ft.onInputChange,Pn=Ft.onInputPaste,Ai=Ft.onInputCompositionStart,Wi=Ft.onInputCompositionEnd,_i=Ft.onInputBlur,Ji=Ft.title,vi=Kt.useState(!1),ar=di(vi,2),ir=ar[0],Ar=ar[1],Pr=Cn==="combobox",wr=Pr||Vn,Gr=_n[0],Kr=Hn||"";Pr&&Fi&&!ir&&(Kr=Fi),Kt.useEffect(function(){Pr&&Ar(!1)},[Pr,Fi]);var Er=Cn!=="combobox"&&!Tn&&!Vn?!1:!!Kr,pi=Ji===void 0?Ao(Gr):Ji,fr=Kt.useMemo(function(){return Gr?null:Kt.createElement("span",{className:"".concat(Zt,"-selection-placeholder"),style:Er?{visibility:"hidden"}:void 0},kn)},[Gr,Er,kn,Zt]);return Kt.createElement("span",{className:"".concat(Zt,"-selection-wrap")},Kt.createElement("span",{className:"".concat(Zt,"-selection-search")},Kt.createElement(Ye,{ref:De,prefixCls:Zt,id:pe,open:Tn,inputElement:Wt,disabled:je,autoFocus:en,autoComplete:rn,editable:wr,activeDescendantId:ln,value:Kr,onKeyDown:Si,onMouseDown:Ti,onChange:function(Fr){Ar(!0),dr(Fr)},onPaste:Pn,onCompositionStart:Ai,onCompositionEnd:Wi,onBlur:_i,tabIndex:bn,attrs:Xl(Ft,!0),maxLength:Pr?Zi:void 0})),!Pr&&Gr?Kt.createElement("span",{className:"".concat(Zt,"-selection-item"),title:pi,style:Er?{visibility:"hidden"}:void 0},Gr.label):null,fr)},Fu=Eu,dl=function(Ft,Wt){var Zt=(0,Kt.useRef)(null),pe=(0,Kt.useRef)(!1),De=Ft.prefixCls,je=Ft.open,en=Ft.mode,rn=Ft.showSearch,ln=Ft.tokenWithEnter,Cn=Ft.disabled,Tn=Ft.prefix,_n=Ft.autoClearSearchValue,kn=Ft.onSearch,bn=Ft.onSearchSubmit,Vn=Ft.onToggleOpen,Hn=Ft.onInputKeyDown,Fi=Ft.onInputBlur,Zi=Ft.domRef;Kt.useImperativeHandle(Wt,function(){return{focus:function(pi){Zt.current.focus(pi)},blur:function(){Zt.current.blur()}}});var Si=zr(0),Ti=di(Si,2),dr=Ti[0],Pn=Ti[1],Ai=function(pi){var fr=pi.which,Yr=Zt.current instanceof HTMLTextAreaElement;!Yr&&je&&(fr===qi.UP||fr===qi.DOWN)&&pi.preventDefault(),Hn&&Hn(pi),fr===qi.ENTER&&en==="tags"&&!pe.current&&!je&&(bn==null||bn(pi.target.value)),!(Yr&&!je&&~[qi.UP,qi.DOWN,qi.LEFT,qi.RIGHT].indexOf(fr))&&aa(fr)&&Vn(!0)},Wi=function(){Pn(!0)},_i=(0,Kt.useRef)(null),Ji=function(pi){kn(pi,!0,pe.current)!==!1&&Vn(!0)},vi=function(){pe.current=!0},ar=function(pi){pe.current=!1,en!=="combobox"&&Ji(pi.target.value)},ir=function(pi){var fr=pi.target.value;if(ln&&_i.current&&/[\r\n]/.test(_i.current)){var Yr=_i.current.replace(/[\r\n]+$/,"").replace(/\r\n/g," ").replace(/[\r\n]/g," ");fr=fr.replace(Yr,_i.current)}_i.current=null,Ji(fr)},Ar=function(pi){var fr=pi.clipboardData,Yr=fr==null?void 0:fr.getData("text");_i.current=Yr||""},Pr=function(pi){var fr=pi.target;if(fr!==Zt.current){var Yr=document.body.style.msTouchAction!==void 0;Yr?setTimeout(function(){Zt.current.focus()}):Zt.current.focus()}},wr=function(pi){var fr=dr();pi.target!==Zt.current&&!fr&&!(en==="combobox"&&Cn)&&pi.preventDefault(),(en!=="combobox"&&(!rn||!fr)||!je)&&(je&&_n!==!1&&kn("",!0,!1),Vn())},Gr={inputRef:Zt,onInputKeyDown:Ai,onInputMouseDown:Wi,onInputChange:ir,onInputPaste:Ar,onInputCompositionStart:vi,onInputCompositionEnd:ar,onInputBlur:Fi},Kr=en==="multiple"||en==="tags"?Kt.createElement(cs,vt({},Ft,Gr)):Kt.createElement(Fu,vt({},Ft,Gr));return Kt.createElement("div",{ref:Zi,className:"".concat(De,"-selector"),onClick:Pr,onMouseDown:wr},Tn&&Kt.createElement("div",{className:"".concat(De,"-prefix")},Tn),Kr)},ch=Kt.forwardRef(dl),Xu=ch,ud=Jt(98280),jh=["prefixCls","disabled","visible","children","popupElement","animation","transitionName","dropdownStyle","dropdownClassName","direction","placement","builtinPlacements","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","getPopupContainer","empty","getTriggerDOMNode","onPopupVisibleChange","onPopupMouseEnter"],Lo=function(Ft){var Wt=Ft===!0?0:1;return{bottomLeft:{points:["tl","bl"],offset:[0,4],overflow:{adjustX:Wt,adjustY:1},htmlRegion:"scroll"},bottomRight:{points:["tr","br"],offset:[0,4],overflow:{adjustX:Wt,adjustY:1},htmlRegion:"scroll"},topLeft:{points:["bl","tl"],offset:[0,-4],overflow:{adjustX:Wt,adjustY:1},htmlRegion:"scroll"},topRight:{points:["br","tr"],offset:[0,-4],overflow:{adjustX:Wt,adjustY:1},htmlRegion:"scroll"}}},gs=function(Ft,Wt){var Zt=Ft.prefixCls,pe=Ft.disabled,De=Ft.visible,je=Ft.children,en=Ft.popupElement,rn=Ft.animation,ln=Ft.transitionName,Cn=Ft.dropdownStyle,Tn=Ft.dropdownClassName,_n=Ft.direction,kn=_n===void 0?"ltr":_n,bn=Ft.placement,Vn=Ft.builtinPlacements,Hn=Ft.dropdownMatchSelectWidth,Fi=Ft.dropdownRender,Zi=Ft.dropdownAlign,Si=Ft.getPopupContainer,Ti=Ft.empty,dr=Ft.getTriggerDOMNode,Pn=Ft.onPopupVisibleChange,Ai=Ft.onPopupMouseEnter,Wi=_t(Ft,jh),_i="".concat(Zt,"-dropdown"),Ji=en;Fi&&(Ji=Fi(en));var vi=Kt.useMemo(function(){return Vn||Lo(Hn)},[Vn,Hn]),ar=rn?"".concat(_i,"-").concat(rn):ln,ir=typeof Hn=="number",Ar=Kt.useMemo(function(){return ir?null:Hn===!1?"minWidth":"width"},[Hn,ir]),Pr=Cn;ir&&(Pr=Fe(Fe({},Pr),{},{width:Hn}));var wr=Kt.useRef(null);return Kt.useImperativeHandle(Wt,function(){return{getPopupElement:function(){var Kr;return(Kr=wr.current)===null||Kr===void 0?void 0:Kr.popupElement}}}),Kt.createElement(ud.Z,vt({},Wi,{showAction:Pn?["click"]:[],hideAction:Pn?["click"]:[],popupPlacement:bn||(kn==="rtl"?"bottomRight":"bottomLeft"),builtinPlacements:vi,prefixCls:_i,popupTransitionName:ar,popup:Kt.createElement("div",{onMouseEnter:Ai},Ji),ref:wr,stretch:Ar,popupAlign:Zi,popupVisible:De,getPopupContainer:Si,popupClassName:be()(Tn,ke({},"".concat(_i,"-empty"),Ti)),popupStyle:Pr,getTriggerDOMNode:dr,onPopupVisibleChange:Pn}),je)},wi=Kt.forwardRef(gs),li=wi;function Ii(kt){return wn(kt)||zt(kt)||Qt(kt)||$n()}function Ze(kt,Ft){var Wt=kt.key,Zt;return"value"in kt&&(Zt=kt.value),Wt!=null?Wt:Zt!==void 0?Zt:"rc-index-key-".concat(Ft)}function Rr(kt){return typeof kt!="undefined"&&!Number.isNaN(kt)}function fo(kt,Ft){var Wt=kt||{},Zt=Wt.label,pe=Wt.value,De=Wt.options,je=Wt.groupLabel,en=Zt||(Ft?"children":"label");return{label:en,value:pe||"value",options:De||"options",groupLabel:je||en}}function ls(kt){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wt=Ft.fieldNames,Zt=Ft.childrenAsData,pe=[],De=fo(Wt,!1),je=De.label,en=De.value,rn=De.options,ln=De.groupLabel;function Cn(Tn,_n){Array.isArray(Tn)&&Tn.forEach(function(kn){if(_n||!(rn in kn)){var bn=kn[en];pe.push({key:Ze(kn,pe.length),groupOption:_n,data:kn,label:kn[je],value:bn})}else{var Vn=kn[ln];Vn===void 0&&Zt&&(Vn=kn.label),pe.push({key:Ze(kn,pe.length),group:!0,data:kn,label:Vn}),Cn(kn[rn],!0)}})}return Cn(kt,!1),pe}function Mo(kt){var Ft=Fe({},kt);return"props"in Ft||Object.defineProperty(Ft,"props",{get:function(){return Ut(!1,"Return type is option instead of Option instance. Please read value directly instead of reading from `props`."),Ft}}),Ft}var $o=function(Ft,Wt,Zt){if(!Wt||!Wt.length)return null;var pe=!1,De=function en(rn,ln){var Cn=Ii(ln),Tn=Cn[0],_n=Cn.slice(1);if(!Tn)return[rn];var kn=rn.split(Tn);return pe=pe||kn.length>1,kn.reduce(function(bn,Vn){return[].concat(oe(bn),oe(en(Vn,_n)))},[]).filter(Boolean)},je=De(Ft,Wt);return pe?typeof Zt!="undefined"?je.slice(0,Zt):je:null},Es=Kt.createContext(null),va=Es;function la(kt){var Ft=kt.visible,Wt=kt.values;if(!Ft)return null;var Zt=50;return Kt.createElement("span",{"aria-live":"polite",style:{width:0,height:0,position:"absolute",overflow:"hidden",opacity:0}},"".concat(Wt.slice(0,Zt).map(function(pe){var De=pe.label,je=pe.value;return["number","string"].includes(re(De))?De:je}).join(", ")),Wt.length>Zt?", ...":null)}var Zu=["id","prefixCls","className","showSearch","tagRender","direction","omitDomProps","displayValues","onDisplayValuesChange","emptyOptions","notFoundContent","onClear","mode","disabled","loading","getInputElement","getRawInputElement","open","defaultOpen","onDropdownVisibleChange","activeValue","onActiveValueChange","activeDescendantId","searchValue","autoClearSearchValue","onSearch","onSearchSplit","tokenSeparators","allowClear","prefix","suffixIcon","clearIcon","OptionList","animation","transitionName","dropdownStyle","dropdownClassName","dropdownMatchSelectWidth","dropdownRender","dropdownAlign","placement","builtinPlacements","getPopupContainer","showAction","onFocus","onBlur","onKeyUp","onKeyDown","onMouseDown"],Tu=["value","onChange","removeIcon","placeholder","autoFocus","maxTagCount","maxTagTextLength","maxTagPlaceholder","choiceTransitionName","onInputKeyDown","onPopupScroll","tabIndex"],ye=function(Ft){return Ft==="tags"||Ft==="multiple"},Ra=Kt.forwardRef(function(kt,Ft){var Wt,Zt=kt.id,pe=kt.prefixCls,De=kt.className,je=kt.showSearch,en=kt.tagRender,rn=kt.direction,ln=kt.omitDomProps,Cn=kt.displayValues,Tn=kt.onDisplayValuesChange,_n=kt.emptyOptions,kn=kt.notFoundContent,bn=kn===void 0?"Not Found":kn,Vn=kt.onClear,Hn=kt.mode,Fi=kt.disabled,Zi=kt.loading,Si=kt.getInputElement,Ti=kt.getRawInputElement,dr=kt.open,Pn=kt.defaultOpen,Ai=kt.onDropdownVisibleChange,Wi=kt.activeValue,_i=kt.onActiveValueChange,Ji=kt.activeDescendantId,vi=kt.searchValue,ar=kt.autoClearSearchValue,ir=kt.onSearch,Ar=kt.onSearchSplit,Pr=kt.tokenSeparators,wr=kt.allowClear,Gr=kt.prefix,Kr=kt.suffixIcon,Er=kt.clearIcon,pi=kt.OptionList,fr=kt.animation,Yr=kt.transitionName,Fr=kt.dropdownStyle,io=kt.dropdownClassName,ao=kt.dropdownMatchSelectWidth,po=kt.dropdownRender,ro=kt.dropdownAlign,Oo=kt.placement,Vs=kt.builtinPlacements,_o=kt.getPopupContainer,Ui=kt.showAction,Hi=Ui===void 0?[]:Ui,Ri=kt.onFocus,ui=kt.onBlur,hi=kt.onKeyUp,Vi=kt.onKeyDown,yr=kt.onMouseDown,Xr=_t(kt,Zu),Tr=ye(Hn),Ho=(je!==void 0?je:Tr)||Hn==="combobox",Ts=Fe({},Xr);Tu.forEach(function(Po){delete Ts[Po]}),ln==null||ln.forEach(function(Po){delete Ts[Po]});var lo=Kt.useState(!1),zs=di(lo,2),Io=zs[0],ha=zs[1];Kt.useEffect(function(){ha(Dn())},[]);var Cs=Kt.useRef(null),Pa=Kt.useRef(null),Ns=Kt.useRef(null),ys=Kt.useRef(null),Do=Kt.useRef(null),Yo=Kt.useRef(!1),Ml=xo(),Ga=di(Ml,3),Js=Ga[0],Gs=Ga[1],bo=Ga[2];Kt.useImperativeHandle(Ft,function(){var Po,Qr;return{focus:(Po=ys.current)===null||Po===void 0?void 0:Po.focus,blur:(Qr=ys.current)===null||Qr===void 0?void 0:Qr.blur,scrollTo:function(Bs){var na;return(na=Do.current)===null||na===void 0?void 0:na.scrollTo(Bs)},nativeElement:Cs.current||Pa.current}});var Ls=Kt.useMemo(function(){var Po;if(Hn!=="combobox")return vi;var Qr=(Po=Cn[0])===null||Po===void 0?void 0:Po.value;return typeof Qr=="string"||typeof Qr=="number"?String(Qr):""},[vi,Hn,Cn]),cu=Hn==="combobox"&&typeof Si=="function"&&Si()||null,Qs=typeof Ti=="function"&&Ti(),eh=Mn(Pa,Qs==null||(Wt=Qs.props)===null||Wt===void 0?void 0:Wt.ref),se=Kt.useState(!1),kl=di(se,2),wa=kl[0],gu=kl[1];sn(function(){gu(!0)},[]);var ql=he(!1,{defaultValue:Pn,value:dr}),Ds=di(ql,2),$i=Ds[0],to=Ds[1],tr=wa?$i:!1,_s=!bn&&_n;(Fi||_s&&tr&&Hn==="combobox")&&(tr=!1);var tl=_s?!1:tr,cr=Kt.useCallback(function(Po){var Qr=Po!==void 0?Po:!tr;Fi||(to(Qr),tr!==Qr&&(Ai==null||Ai(Qr)))},[Fi,tr,to,Ai]),_r=Kt.useMemo(function(){return(Pr||[]).some(function(Po){return[`
|
|
`,`\r
|
|
`].includes(Po)})},[Pr]),Cr=Kt.useContext(va)||{},Nr=Cr.maxCount,Ro=Cr.rawValues,mo=function(Qr,el,Bs){if(!(Tr&&Rr(Nr)&&(Ro==null?void 0:Ro.size)>=Nr)){var na=!0,Ca=Qr;_i==null||_i(null);var El=$o(Qr,Pr,Rr(Nr)?Nr-Ro.size:void 0),nl=Bs?null:El;return Hn!=="combobox"&&nl&&(Ca="",Ar==null||Ar(nl),cr(!1),na=!1),ir&&Ls!==Ca&&ir(Ca,{source:el?"typing":"effect"}),na}},bl=function(Qr){!Qr||!Qr.trim()||ir(Qr,{source:"submit"})};Kt.useEffect(function(){!tr&&!Tr&&Hn!=="combobox"&&mo("",!1,!1)},[tr]),Kt.useEffect(function(){$i&&Fi&&to(!1),Fi&&!Yo.current&&Gs(!1)},[Fi]);var tu=zr(),_a=di(tu,2),$s=_a[0],pu=_a[1],mu=Kt.useRef(!1),Ha=function(Qr){var el=$s(),Bs=Qr.key,na=Bs==="Enter";if(na&&(Hn!=="combobox"&&Qr.preventDefault(),tr||cr(!0)),pu(!!Ls),Bs==="Backspace"&&!el&&Tr&&!Ls&&Cn.length){for(var Ca=oe(Cn),El=null,nl=Ca.length-1;nl>=0;nl-=1){var rh=Ca[nl];if(!rh.disabled){Ca.splice(nl,1),El=rh;break}}El&&Tn(Ca,{type:"remove",values:[El]})}for(var il=arguments.length,oh=new Array(il>1?il-1:0),Zh=1;Zh<il;Zh++)oh[Zh-1]=arguments[Zh];if(tr&&(!na||!mu.current)){var tf;na&&(mu.current=!0),(tf=Do.current)===null||tf===void 0||tf.onKeyDown.apply(tf,[Qr].concat(oh))}Vi==null||Vi.apply(void 0,[Qr].concat(oh))},Gf=function(Qr){for(var el=arguments.length,Bs=new Array(el>1?el-1:0),na=1;na<el;na++)Bs[na-1]=arguments[na];if(tr){var Ca;(Ca=Do.current)===null||Ca===void 0||Ca.onKeyUp.apply(Ca,[Qr].concat(Bs))}Qr.key==="Enter"&&(mu.current=!1),hi==null||hi.apply(void 0,[Qr].concat(Bs))},Kh=function(Qr){var el=Cn.filter(function(Bs){return Bs!==Qr});Tn(el,{type:"remove",values:[Qr]})},qs=function(){mu.current=!1},wh=Kt.useRef(!1),Pc=function(){Gs(!0),Fi||(Ri&&!wh.current&&Ri.apply(void 0,arguments),Hi.includes("focus")&&cr(!0)),wh.current=!0},ng=function(){Yo.current=!0,Gs(!1,function(){wh.current=!1,Yo.current=!1,cr(!1)}),!Fi&&(Ls&&(Hn==="tags"?ir(Ls,{source:"submit"}):Hn==="multiple"&&ir("",{source:"blur"})),ui&&ui.apply(void 0,arguments))},eu=[];Kt.useEffect(function(){return function(){eu.forEach(function(Po){return clearTimeout(Po)}),eu.splice(0,eu.length)}},[]);var gl=function(Qr){var el,Bs=Qr.target,na=(el=Ns.current)===null||el===void 0?void 0:el.getPopupElement();if(na&&na.contains(Bs)){var Ca=setTimeout(function(){var il=eu.indexOf(Ca);if(il!==-1&&eu.splice(il,1),bo(),!Io&&!na.contains(document.activeElement)){var oh;(oh=ys.current)===null||oh===void 0||oh.focus()}});eu.push(Ca)}for(var El=arguments.length,nl=new Array(El>1?El-1:0),rh=1;rh<El;rh++)nl[rh-1]=arguments[rh];yr==null||yr.apply(void 0,[Qr].concat(nl))},wc=Kt.useState({}),As=di(wc,2),$d=As[1];function _f(){$d({})}var nh;Qs&&(nh=function(Qr){cr(Qr)}),wl(function(){var Po;return[Cs.current,(Po=Ns.current)===null||Po===void 0?void 0:Po.getPopupElement()]},tl,cr,!!Qs);var yd=Kt.useMemo(function(){return Fe(Fe({},kt),{},{notFoundContent:bn,open:tr,triggerOpen:tl,id:Zt,showSearch:Ho,multiple:Tr,toggleOpen:cr})},[kt,bn,tl,tr,Zt,Ho,Tr,cr]),Yh=!!Kr||Zi,Hf;Yh&&(Hf=Kt.createElement(Vr,{className:be()("".concat(pe,"-arrow"),ke({},"".concat(pe,"-arrow-loading"),Zi)),customizeIcon:Kr,customizeIconProps:{loading:Zi,searchValue:Ls,open:tr,focused:Js,showSearch:Ho}}));var Sd=function(){var Qr;Vn==null||Vn(),(Qr=ys.current)===null||Qr===void 0||Qr.focus(),Tn([],{type:"clear",values:Cn}),mo("",!1,!1)},Vf=Ci(pe,Sd,Cn,wr,Er,Fi,Ls,Hn),Ru=Vf.allowClear,Xh=Vf.clearIcon,Wf=Kt.createElement(pi,{ref:Do}),Uf=be()(pe,De,ke(ke(ke(ke(ke(ke(ke(ke(ke(ke({},"".concat(pe,"-focused"),Js),"".concat(pe,"-multiple"),Tr),"".concat(pe,"-single"),!Tr),"".concat(pe,"-allow-clear"),wr),"".concat(pe,"-show-arrow"),Yh),"".concat(pe,"-disabled"),Fi),"".concat(pe,"-loading"),Zi),"".concat(pe,"-open"),tr),"".concat(pe,"-customize-input"),cu),"".concat(pe,"-show-search"),Ho)),qd=Kt.createElement(li,{ref:Ns,disabled:Fi,prefixCls:pe,visible:tl,popupElement:Wf,animation:fr,transitionName:Yr,dropdownStyle:Fr,dropdownClassName:io,direction:rn,dropdownMatchSelectWidth:ao,dropdownRender:po,dropdownAlign:ro,placement:Oo,builtinPlacements:Vs,getPopupContainer:_o,empty:_n,getTriggerDOMNode:function(Qr){return Pa.current||Qr},onPopupVisibleChange:nh,onPopupMouseEnter:_f},Qs?Kt.cloneElement(Qs,{ref:eh}):Kt.createElement(Xu,vt({},kt,{domRef:Pa,prefixCls:pe,inputElement:cu,ref:ys,id:Zt,prefix:Gr,showSearch:Ho,autoClearSearchValue:ar,mode:Hn,activeDescendantId:Ji,tagRender:en,values:Cn,open:tr,onToggleOpen:cr,activeValue:Wi,searchValue:Ls,onSearch:mo,onSearchSubmit:bl,onRemove:Kh,tokenWithEnter:_r,onInputBlur:qs}))),ih;return Qs?ih=qd:ih=Kt.createElement("div",vt({className:Uf},Ts,{ref:Cs,onMouseDown:gl,onKeyDown:Ha,onKeyUp:Gf,onFocus:Pc,onBlur:ng}),Kt.createElement(la,{visible:Js&&!tr,values:Cn}),qd,Hf,Ru&&Xh),Kt.createElement(Us.Provider,{value:yd},ih)}),Rl=Ra,Ju=function(){return null};Ju.isSelectOptGroup=!0;var os=Ju,Nu=function(){return null};Nu.isSelectOption=!0;var hd=Nu;function gh(kt,Ft){var Wt=Fe({},kt);return Array.isArray(Ft)&&Ft.forEach(function(Zt){delete Wt[Zt]}),Wt}var co=Jt(73299);function ps(){return/(mac\sos|macintosh)/i.test(navigator.appVersion)}var nr=["disabled","title","children","style","className"];function mr(kt){return typeof kt=="string"||typeof kt=="number"}var vo=function(Ft,Wt){var Zt=is(),pe=Zt.prefixCls,De=Zt.id,je=Zt.open,en=Zt.multiple,rn=Zt.mode,ln=Zt.searchValue,Cn=Zt.toggleOpen,Tn=Zt.notFoundContent,_n=Zt.onPopupScroll,kn=Kt.useContext(va),bn=kn.maxCount,Vn=kn.flattenOptions,Hn=kn.onActiveValue,Fi=kn.defaultActiveFirstOption,Zi=kn.onSelect,Si=kn.menuItemSelectedIcon,Ti=kn.rawValues,dr=kn.fieldNames,Pn=kn.virtual,Ai=kn.direction,Wi=kn.listHeight,_i=kn.listItemHeight,Ji=kn.optionRender,vi="".concat(pe,"-item"),ar=yi(function(){return Vn},[je,Vn],function(Ui,Hi){return Hi[0]&&Ui[1]!==Hi[1]}),ir=Kt.useRef(null),Ar=Kt.useMemo(function(){return en&&Rr(bn)&&(Ti==null?void 0:Ti.size)>=bn},[en,bn,Ti==null?void 0:Ti.size]),Pr=function(Hi){Hi.preventDefault()},wr=function(Hi){var Ri;(Ri=ir.current)===null||Ri===void 0||Ri.scrollTo(typeof Hi=="number"?{index:Hi}:Hi)},Gr=Kt.useCallback(function(Ui){return rn==="combobox"?!1:Ti.has(Ui)},[rn,oe(Ti).toString(),Ti.size]),Kr=function(Hi){for(var Ri=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,ui=ar.length,hi=0;hi<ui;hi+=1){var Vi=(Hi+hi*Ri+ui)%ui,yr=ar[Vi]||{},Xr=yr.group,Tr=yr.data;if(!Xr&&!(Tr!=null&&Tr.disabled)&&(Gr(Tr.value)||!Ar))return Vi}return-1},Er=Kt.useState(function(){return Kr(0)}),pi=di(Er,2),fr=pi[0],Yr=pi[1],Fr=function(Hi){var Ri=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;Yr(Hi);var ui={source:Ri?"keyboard":"mouse"},hi=ar[Hi];if(!hi){Hn(null,-1,ui);return}Hn(hi.value,Hi,ui)};(0,Kt.useEffect)(function(){Fr(Fi!==!1?Kr(0):-1)},[ar.length,ln]);var io=Kt.useCallback(function(Ui){return rn==="combobox"?String(Ui).toLowerCase()===ln.toLowerCase():Ti.has(Ui)},[rn,ln,oe(Ti).toString(),Ti.size]);(0,Kt.useEffect)(function(){var Ui=setTimeout(function(){if(!en&&je&&Ti.size===1){var Ri=Array.from(Ti)[0],ui=ar.findIndex(function(hi){var Vi=hi.data;return Vi.value===Ri});ui!==-1&&(Fr(ui),wr(ui))}});if(je){var Hi;(Hi=ir.current)===null||Hi===void 0||Hi.scrollTo(void 0)}return function(){return clearTimeout(Ui)}},[je,ln]);var ao=function(Hi){Hi!==void 0&&Zi(Hi,{selected:!Ti.has(Hi)}),en||Cn(!1)};if(Kt.useImperativeHandle(Wt,function(){return{onKeyDown:function(Hi){var Ri=Hi.which,ui=Hi.ctrlKey;switch(Ri){case qi.N:case qi.P:case qi.UP:case qi.DOWN:{var hi=0;if(Ri===qi.UP?hi=-1:Ri===qi.DOWN?hi=1:ps()&&ui&&(Ri===qi.N?hi=1:Ri===qi.P&&(hi=-1)),hi!==0){var Vi=Kr(fr+hi,hi);wr(Vi),Fr(Vi,!0)}break}case qi.TAB:case qi.ENTER:{var yr,Xr=ar[fr];Xr&&!(Xr!=null&&(yr=Xr.data)!==null&&yr!==void 0&&yr.disabled)&&!Ar?ao(Xr.value):ao(void 0),je&&Hi.preventDefault();break}case qi.ESC:Cn(!1),je&&Hi.stopPropagation()}},onKeyUp:function(){},scrollTo:function(Hi){wr(Hi)}}}),ar.length===0)return Kt.createElement("div",{role:"listbox",id:"".concat(De,"_list"),className:"".concat(vi,"-empty"),onMouseDown:Pr},Tn);var po=Object.keys(dr).map(function(Ui){return dr[Ui]}),ro=function(Hi){return Hi.label};function Oo(Ui,Hi){var Ri=Ui.group;return{role:Ri?"presentation":"option",id:"".concat(De,"_list_").concat(Hi)}}var Vs=function(Hi){var Ri=ar[Hi];if(!Ri)return null;var ui=Ri.data||{},hi=ui.value,Vi=Ri.group,yr=Xl(ui,!0),Xr=ro(Ri);return Ri?Kt.createElement("div",vt({"aria-label":typeof Xr=="string"&&!Vi?Xr:null},yr,{key:Hi},Oo(Ri,Hi),{"aria-selected":io(hi)}),hi):null},_o={role:"listbox",id:"".concat(De,"_list")};return Kt.createElement(Kt.Fragment,null,Pn&&Kt.createElement("div",vt({},_o,{style:{height:0,width:0,overflow:"hidden"}}),Vs(fr-1),Vs(fr),Vs(fr+1)),Kt.createElement(co.Z,{itemKey:"key",ref:ir,data:ar,height:Wi,itemHeight:_i,fullHeight:!1,onMouseDown:Pr,onScroll:_n,virtual:Pn,direction:Ai,innerProps:Pn?null:_o},function(Ui,Hi){var Ri=Ui.group,ui=Ui.groupOption,hi=Ui.data,Vi=Ui.label,yr=Ui.value,Xr=hi.key;if(Ri){var Tr,Ho=(Tr=hi.title)!==null&&Tr!==void 0?Tr:mr(Vi)?Vi.toString():void 0;return Kt.createElement("div",{className:be()(vi,"".concat(vi,"-group"),hi.className),title:Ho},Vi!==void 0?Vi:Xr)}var Ts=hi.disabled,lo=hi.title,zs=hi.children,Io=hi.style,ha=hi.className,Cs=_t(hi,nr),Pa=gh(Cs,po),Ns=Gr(yr),ys=Ts||!Ns&&Ar,Do="".concat(vi,"-option"),Yo=be()(vi,Do,ha,ke(ke(ke(ke({},"".concat(Do,"-grouped"),ui),"".concat(Do,"-active"),fr===Hi&&!ys),"".concat(Do,"-disabled"),ys),"".concat(Do,"-selected"),Ns)),Ml=ro(Ui),Ga=!Si||typeof Si=="function"||Ns,Js=typeof Ml=="number"?Ml:Ml||yr,Gs=mr(Js)?Js.toString():void 0;return lo!==void 0&&(Gs=lo),Kt.createElement("div",vt({},Xl(Pa),Pn?{}:Oo(Ui,Hi),{"aria-selected":io(yr),className:Yo,title:Gs,onMouseMove:function(){fr===Hi||ys||Fr(Hi)},onClick:function(){ys||ao(yr)},style:Io}),Kt.createElement("div",{className:"".concat(Do,"-content")},typeof Ji=="function"?Ji(Ui,{index:Hi}):Js),Kt.isValidElement(Si)||Ns,Ga&&Kt.createElement(Vr,{className:"".concat(vi,"-option-state"),customizeIcon:Si,customizeIconProps:{value:yr,disabled:ys,isSelected:Ns}},Ns?"\u2713":null))}))},ss=Kt.forwardRef(vo),ni=ss,kf=function(kt,Ft){var Wt=Kt.useRef({values:new Map,options:new Map}),Zt=Kt.useMemo(function(){var De=Wt.current,je=De.values,en=De.options,rn=kt.map(function(Tn){if(Tn.label===void 0){var _n;return Fe(Fe({},Tn),{},{label:(_n=je.get(Tn.value))===null||_n===void 0?void 0:_n.label})}return Tn}),ln=new Map,Cn=new Map;return rn.forEach(function(Tn){ln.set(Tn.value,Tn),Cn.set(Tn.value,Ft.get(Tn.value)||en.get(Tn.value))}),Wt.current.values=ln,Wt.current.options=Cn,rn},[kt,Ft]),pe=Kt.useCallback(function(De){return Ft.get(De)||Wt.current.options.get(De)},[Ft]);return[Zt,pe]};function hu(kt,Ft){return qr(kt).join("").toUpperCase().includes(Ft)}var Zl=function(kt,Ft,Wt,Zt,pe){return Kt.useMemo(function(){if(!Wt||Zt===!1)return kt;var De=Ft.options,je=Ft.label,en=Ft.value,rn=[],ln=typeof Zt=="function",Cn=Wt.toUpperCase(),Tn=ln?Zt:function(kn,bn){return pe?hu(bn[pe],Cn):bn[De]?hu(bn[je!=="children"?je:"label"],Cn):hu(bn[en],Cn)},_n=ln?function(kn){return Mo(kn)}:function(kn){return kn};return kt.forEach(function(kn){if(kn[De]){var bn=Tn(Wt,_n(kn));if(bn)rn.push(kn);else{var Vn=kn[De].filter(function(Hn){return Tn(Wt,_n(Hn))});Vn.length&&rn.push(Fe(Fe({},kn),{},ke({},De,Vn)))}return}Tn(Wt,_n(kn))&&rn.push(kn)}),rn},[kt,Zt,pe,Wt,Ft])},dd=0,fd=Ln();function yn(){var kt;return fd?(kt=dd,dd+=1):kt="TEST_OR_SSR",kt}function us(kt){var Ft=Kt.useState(),Wt=di(Ft,2),Zt=Wt[0],pe=Wt[1];return Kt.useEffect(function(){pe("rc_select_".concat(yn()))},[]),kt||Zt}function ms(kt){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Wt=[];return Kt.Children.forEach(kt,function(Zt){Zt==null&&!Ft.keepEmpty||(Array.isArray(Zt)?Wt=Wt.concat(ms(Zt)):(0,zi.isFragment)(Zt)&&Zt.props?Wt=Wt.concat(ms(Zt.props.children,Ft)):Wt.push(Zt))}),Wt}var du=["children","value"],cd=["children"];function gd(kt){var Ft=kt,Wt=Ft.key,Zt=Ft.props,pe=Zt.children,De=Zt.value,je=_t(Zt,du);return Fe({key:Wt,value:De!==void 0?De:Wt,children:pe},je)}function Xi(kt){var Ft=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ms(kt).map(function(Wt,Zt){if(!Kt.isValidElement(Wt)||!Wt.type)return null;var pe=Wt,De=pe.type.isSelectOptGroup,je=pe.key,en=pe.props,rn=en.children,ln=_t(en,cd);return Ft||!De?gd(Wt):Fe(Fe({key:"__RC_SELECT_GRP__".concat(je===null?Zt:je,"__"),label:je},ln),{},{options:Xi(rn)})}).filter(function(Wt){return Wt})}var Wd=function(Ft,Wt,Zt,pe,De){return Kt.useMemo(function(){var je=Ft,en=!Ft;en&&(je=Xi(Wt));var rn=new Map,ln=new Map,Cn=function(kn,bn,Vn){Vn&&typeof Vn=="string"&&kn.set(bn[Vn],bn)},Tn=function _n(kn){for(var bn=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Vn=0;Vn<kn.length;Vn+=1){var Hn=kn[Vn];!Hn[Zt.options]||bn?(rn.set(Hn[Zt.value],Hn),Cn(ln,Hn,Zt.label),Cn(ln,Hn,pe),Cn(ln,Hn,De)):_n(Hn[Zt.options],!0)}};return Tn(je),{options:je,valueOptions:rn,labelOptions:ln}},[Ft,Wt,Zt,pe,De])},Du=Wd;function Qa(kt){var Ft=Kt.useRef();Ft.current=kt;var Wt=Kt.useCallback(function(){return Ft.current.apply(Ft,arguments)},[]);return Wt}function Ll(kt){var Ft=kt.mode,Wt=kt.options,Zt=kt.children,pe=kt.backfill,De=kt.allowClear,je=kt.placeholder,en=kt.getInputElement,rn=kt.showSearch,ln=kt.onSearch,Cn=kt.defaultOpen,Tn=kt.autoFocus,_n=kt.labelInValue,kn=kt.value,bn=kt.inputValue,Vn=kt.optionLabelProp,Hn=isMultiple(Ft),Fi=rn!==void 0?rn:Hn||Ft==="combobox",Zi=Wt||convertChildrenToData(Zt);if(warning(Ft!=="tags"||Zi.every(function(Pn){return!Pn.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Ft==="tags"||Ft==="combobox"){var Si=Zi.some(function(Pn){return Pn.options?Pn.options.some(function(Ai){return typeof("value"in Ai?Ai.value:Ai.key)=="number"}):typeof("value"in Pn?Pn.value:Pn.key)=="number"});warning(!Si,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(warning(Ft!=="combobox"||!Vn,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),warning(Ft==="combobox"||!pe,"`backfill` only works with `combobox` mode."),warning(Ft==="combobox"||!en,"`getInputElement` only work with `combobox` mode."),noteOnce(Ft!=="combobox"||!en||!De||!je,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),ln&&!Fi&&Ft!=="combobox"&&Ft!=="tags"&&warning(!1,"`onSearch` should work with `showSearch` instead of use alone."),noteOnce(!Cn||Tn,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),kn!=null){var Ti=toArray(kn);warning(!_n||Ti.every(function(Pn){return _typeof(Pn)==="object"&&("key"in Pn||"value"in Pn)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),warning(!Hn||Array.isArray(kn),"`value` should be array when `mode` is `multiple` or `tags`")}if(Zt){var dr=null;toNodeArray(Zt).some(function(Pn){if(!React.isValidElement(Pn)||!Pn.type)return!1;var Ai=Pn,Wi=Ai.type;if(Wi.isSelectOption)return!1;if(Wi.isSelectOptGroup){var _i=toNodeArray(Pn.props.children).every(function(Ji){return!React.isValidElement(Ji)||!Pn.type||Ji.type.isSelectOption?!0:(dr=Ji.type,!1)});return!_i}return dr=Wi,!0}),dr&&warning(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(dr.displayName||dr.name||dr,"`.")),warning(bn===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}function zh(kt,Ft){if(kt){var Wt=function Zt(pe){for(var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,je=0;je<pe.length;je++){var en=pe[je];if(en[Ft==null?void 0:Ft.value]===null)return warning(!1,"`value` in Select options should not be `null`."),!0;if(!De&&Array.isArray(en[Ft==null?void 0:Ft.options])&&Zt(en[Ft==null?void 0:Ft.options],!0))break}};Wt(kt)}}var pd=null,fl=["id","mode","prefixCls","backfill","fieldNames","inputValue","searchValue","onSearch","autoClearSearchValue","onSelect","onDeselect","dropdownMatchSelectWidth","filterOption","filterSort","optionFilterProp","optionLabelProp","options","optionRender","children","defaultActiveFirstOption","menuItemSelectedIcon","virtual","direction","listHeight","listItemHeight","labelRender","value","defaultValue","labelInValue","onChange","maxCount"],Jl=["inputValue"];function Ud(kt){return!kt||re(kt)!=="object"}var gc=Kt.forwardRef(function(kt,Ft){var Wt=kt.id,Zt=kt.mode,pe=kt.prefixCls,De=pe===void 0?"rc-select":pe,je=kt.backfill,en=kt.fieldNames,rn=kt.inputValue,ln=kt.searchValue,Cn=kt.onSearch,Tn=kt.autoClearSearchValue,_n=Tn===void 0?!0:Tn,kn=kt.onSelect,bn=kt.onDeselect,Vn=kt.dropdownMatchSelectWidth,Hn=Vn===void 0?!0:Vn,Fi=kt.filterOption,Zi=kt.filterSort,Si=kt.optionFilterProp,Ti=kt.optionLabelProp,dr=kt.options,Pn=kt.optionRender,Ai=kt.children,Wi=kt.defaultActiveFirstOption,_i=kt.menuItemSelectedIcon,Ji=kt.virtual,vi=kt.direction,ar=kt.listHeight,ir=ar===void 0?200:ar,Ar=kt.listItemHeight,Pr=Ar===void 0?20:Ar,wr=kt.labelRender,Gr=kt.value,Kr=kt.defaultValue,Er=kt.labelInValue,pi=kt.onChange,fr=kt.maxCount,Yr=_t(kt,fl),Fr=us(Wt),io=ye(Zt),ao=!!(!dr&&Ai),po=Kt.useMemo(function(){return Fi===void 0&&Zt==="combobox"?!1:Fi},[Fi,Zt]),ro=Kt.useMemo(function(){return fo(en,ao)},[JSON.stringify(en),ao]),Oo=he("",{value:ln!==void 0?ln:rn,postState:function(_r){return _r||""}}),Vs=di(Oo,2),_o=Vs[0],Ui=Vs[1],Hi=Du(dr,Ai,ro,Si,Ti),Ri=Hi.valueOptions,ui=Hi.labelOptions,hi=Hi.options,Vi=Kt.useCallback(function(cr){var _r=qr(cr);return _r.map(function(Cr){var Nr,Ro,mo,bl,tu;if(Ud(Cr))Nr=Cr;else{var _a;mo=Cr.key,Ro=Cr.label,Nr=(_a=Cr.value)!==null&&_a!==void 0?_a:mo}var $s=Ri.get(Nr);if($s){var pu;if(Ro===void 0&&(Ro=$s==null?void 0:$s[Ti||ro.label]),mo===void 0&&(mo=(pu=$s==null?void 0:$s.key)!==null&&pu!==void 0?pu:Nr),bl=$s==null?void 0:$s.disabled,tu=$s==null?void 0:$s.title,0)var mu}return{label:Ro,value:Nr,key:mo,disabled:bl,title:tu}})},[ro,Ti,Ri]),yr=he(Kr,{value:Gr}),Xr=di(yr,2),Tr=Xr[0],Ho=Xr[1],Ts=Kt.useMemo(function(){var cr,_r=io&&Tr===null?[]:Tr,Cr=Vi(_r);return Zt==="combobox"&&Fo((cr=Cr[0])===null||cr===void 0?void 0:cr.value)?[]:Cr},[Tr,Vi,Zt,io]),lo=kf(Ts,Ri),zs=di(lo,2),Io=zs[0],ha=zs[1],Cs=Kt.useMemo(function(){if(!Zt&&Io.length===1){var cr=Io[0];if(cr.value===null&&(cr.label===null||cr.label===void 0))return[]}return Io.map(function(_r){var Cr;return Fe(Fe({},_r),{},{label:(Cr=typeof wr=="function"?wr(_r):_r.label)!==null&&Cr!==void 0?Cr:_r.value})})},[Zt,Io,wr]),Pa=Kt.useMemo(function(){return new Set(Io.map(function(cr){return cr.value}))},[Io]);Kt.useEffect(function(){if(Zt==="combobox"){var cr,_r=(cr=Io[0])===null||cr===void 0?void 0:cr.value;Ui(hl(_r)?String(_r):"")}},[Io]);var Ns=Qa(function(cr,_r){var Cr=_r!=null?_r:cr;return ke(ke({},ro.value,cr),ro.label,Cr)}),ys=Kt.useMemo(function(){if(Zt!=="tags")return hi;var cr=oe(hi),_r=function(Nr){return Ri.has(Nr)};return oe(Io).sort(function(Cr,Nr){return Cr.value<Nr.value?-1:1}).forEach(function(Cr){var Nr=Cr.value;_r(Nr)||cr.push(Ns(Nr,Cr.label))}),cr},[Ns,hi,Ri,Io,Zt]),Do=Zl(ys,ro,_o,po,Si),Yo=Kt.useMemo(function(){return Zt!=="tags"||!_o||Do.some(function(cr){return cr[Si||"value"]===_o})||Do.some(function(cr){return cr[ro.value]===_o})?Do:[Ns(_o)].concat(oe(Do))},[Ns,Si,Zt,Do,_o,ro]),Ml=function cr(_r){var Cr=oe(_r).sort(function(Nr,Ro){return Zi(Nr,Ro,{searchValue:_o})});return Cr.map(function(Nr){return Array.isArray(Nr.options)?Fe(Fe({},Nr),{},{options:Nr.options.length>0?cr(Nr.options):Nr.options}):Nr})},Ga=Kt.useMemo(function(){return Zi?Ml(Yo):Yo},[Yo,Zi,_o]),Js=Kt.useMemo(function(){return ls(Ga,{fieldNames:ro,childrenAsData:ao})},[Ga,ro,ao]),Gs=function(_r){var Cr=Vi(_r);if(Ho(Cr),pi&&(Cr.length!==Io.length||Cr.some(function(mo,bl){var tu;return((tu=Io[bl])===null||tu===void 0?void 0:tu.value)!==(mo==null?void 0:mo.value)}))){var Nr=Er?Cr:Cr.map(function(mo){return mo.value}),Ro=Cr.map(function(mo){return Mo(ha(mo.value))});pi(io?Nr:Nr[0],io?Ro:Ro[0])}},bo=Kt.useState(null),Ls=di(bo,2),cu=Ls[0],Qs=Ls[1],eh=Kt.useState(0),se=di(eh,2),kl=se[0],wa=se[1],gu=Wi!==void 0?Wi:Zt!=="combobox",ql=Kt.useCallback(function(cr,_r){var Cr=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},Nr=Cr.source,Ro=Nr===void 0?"keyboard":Nr;wa(_r),je&&Zt==="combobox"&&cr!==null&&Ro==="keyboard"&&Qs(String(cr))},[je,Zt]),Ds=function(_r,Cr,Nr){var Ro=function(){var Kh,qs=ha(_r);return[Er?{label:qs==null?void 0:qs[ro.label],value:_r,key:(Kh=qs==null?void 0:qs.key)!==null&&Kh!==void 0?Kh:_r}:_r,Mo(qs)]};if(Cr&&kn){var mo=Ro(),bl=di(mo,2),tu=bl[0],_a=bl[1];kn(tu,_a)}else if(!Cr&&bn&&Nr!=="clear"){var $s=Ro(),pu=di($s,2),mu=pu[0],Ha=pu[1];bn(mu,Ha)}},$i=Qa(function(cr,_r){var Cr,Nr=io?_r.selected:!0;Nr?Cr=io?[].concat(oe(Io),[cr]):[cr]:Cr=Io.filter(function(Ro){return Ro.value!==cr}),Gs(Cr),Ds(cr,Nr),Zt==="combobox"?Qs(""):(!ye||_n)&&(Ui(""),Qs(""))}),to=function(_r,Cr){Gs(_r);var Nr=Cr.type,Ro=Cr.values;(Nr==="remove"||Nr==="clear")&&Ro.forEach(function(mo){Ds(mo.value,!1,Nr)})},tr=function(_r,Cr){if(Ui(_r),Qs(null),Cr.source==="submit"){var Nr=(_r||"").trim();if(Nr){var Ro=Array.from(new Set([].concat(oe(Pa),[Nr])));Gs(Ro),Ds(Nr,!0),Ui("")}return}Cr.source!=="blur"&&(Zt==="combobox"&&Gs(_r),Cn==null||Cn(_r))},_s=function(_r){var Cr=_r;Zt!=="tags"&&(Cr=_r.map(function(Ro){var mo=ui.get(Ro);return mo==null?void 0:mo.value}).filter(function(Ro){return Ro!==void 0}));var Nr=Array.from(new Set([].concat(oe(Pa),oe(Cr))));Gs(Nr),Nr.forEach(function(Ro){Ds(Ro,!0)})},tl=Kt.useMemo(function(){var cr=Ji!==!1&&Hn!==!1;return Fe(Fe({},Hi),{},{flattenOptions:Js,onActiveValue:ql,defaultActiveFirstOption:gu,onSelect:$i,menuItemSelectedIcon:_i,rawValues:Pa,fieldNames:ro,virtual:cr,direction:vi,listHeight:ir,listItemHeight:Pr,childrenAsData:ao,maxCount:fr,optionRender:Pn})},[fr,Hi,Js,ql,gu,$i,_i,Pa,ro,Ji,Hn,vi,ir,Pr,ao,Pn]);return Kt.createElement(va.Provider,{value:tl},Kt.createElement(Rl,vt({},Yr,{id:Fr,prefixCls:De,ref:Ft,omitDomProps:Jl,mode:Zt,displayValues:Cs,onDisplayValuesChange:to,direction:vi,searchValue:_o,onSearch:tr,autoClearSearchValue:_n,onSearchSplit:_s,dropdownMatchSelectWidth:Hn,OptionList:ni,emptyOptions:!Js.length,activeValue:cu,activeDescendantId:"".concat(Fr,"_list_").concat(kl)})))}),Kd=gc;Kd.Option=hd,Kd.OptGroup=os;var Qc=null,pc=null;function Au(kt){var Ft=Kt.useRef();Ft.current=kt;var Wt=Kt.useCallback(function(){for(var Zt,pe=arguments.length,De=new Array(pe),je=0;je<pe;je++)De[je]=arguments[je];return(Zt=Ft.current)===null||Zt===void 0?void 0:Zt.call.apply(Zt,[Ft].concat(De))},[]);return Wt}function ph(kt){if(Array.isArray(kt))return kt}function Ql(kt,Ft){var Wt=kt==null?null:typeof Symbol!="undefined"&&kt[Symbol.iterator]||kt["@@iterator"];if(Wt!=null){var Zt,pe,De,je,en=[],rn=!0,ln=!1;try{if(De=(Wt=Wt.call(kt)).next,Ft===0){if(Object(Wt)!==Wt)return;rn=!1}else for(;!(rn=(Zt=De.call(Wt)).done)&&(en.push(Zt.value),en.length!==Ft);rn=!0);}catch(Cn){ln=!0,pe=Cn}finally{try{if(!rn&&Wt.return!=null&&(je=Wt.return(),Object(je)!==je))return}finally{if(ln)throw pe}}return en}}function Yd(kt,Ft){(Ft==null||Ft>kt.length)&&(Ft=kt.length);for(var Wt=0,Zt=new Array(Ft);Wt<Ft;Wt++)Zt[Wt]=kt[Wt];return Zt}function bf(kt,Ft){if(kt){if(typeof kt=="string")return Yd(kt,Ft);var Wt=Object.prototype.toString.call(kt).slice(8,-1);if(Wt==="Object"&&kt.constructor&&(Wt=kt.constructor.name),Wt==="Map"||Wt==="Set")return Array.from(kt);if(Wt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Wt))return Yd(kt,Ft)}}function mc(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function vs(kt,Ft){return ph(kt)||Ql(kt,Ft)||bf(kt,Ft)||mc()}function $c(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ef=$c()?Kt.useLayoutEffect:Kt.useEffect,Xd=function(Ft,Wt){var Zt=Kt.useRef(!0);Ef(function(){return Ft(Zt.current)},Wt),Ef(function(){return Zt.current=!1,function(){Zt.current=!0}},[])},Gh=function(Ft,Wt){Xd(function(Zt){if(!Zt)return Ft()},Wt)},$a=null;function ya(kt){var Ft=Kt.useRef(!1),Wt=Kt.useState(kt),Zt=vs(Wt,2),pe=Zt[0],De=Zt[1];Kt.useEffect(function(){return Ft.current=!1,function(){Ft.current=!0}},[]);function je(en,rn){rn&&Ft.current||De(en)}return[pe,je]}function js(kt){return kt!==void 0}function Ks(kt,Ft){var Wt=Ft||{},Zt=Wt.defaultValue,pe=Wt.value,De=Wt.onChange,je=Wt.postState,en=ya(function(){return js(pe)?pe:js(Zt)?typeof Zt=="function"?Zt():Zt:typeof kt=="function"?kt():kt}),rn=vs(en,2),ln=rn[0],Cn=rn[1],Tn=pe!==void 0?pe:ln,_n=je?je(Tn):Tn,kn=Au(De),bn=ya([Tn]),Vn=vs(bn,2),Hn=Vn[0],Fi=Vn[1];Gh(function(){var Si=Hn[0];ln!==Si&&kn(ln,Si)},[Hn]),Gh(function(){js(pe)||Cn(pe)},[pe]);var Zi=Au(function(Si,Ti){Cn(Si,Ti),Fi([Tn],Ti)});return[_n,Zi]}var Ff=Kt.createContext({}),Bu=Ff,Go="__rc_cascader_search_mark__",Tf=function(Ft,Wt,Zt){var pe=Zt.label,De=pe===void 0?"":pe;return Wt.some(function(je){return String(je[De]).toLowerCase().includes(Ft.toLowerCase())})},Nf=function(Ft,Wt,Zt,pe){return Wt.map(function(De){return De[pe.label]}).join(" / ")},Df=function(Ft,Wt,Zt,pe,De,je){var en=De.filter,rn=en===void 0?Tf:en,ln=De.render,Cn=ln===void 0?Nf:ln,Tn=De.limit,_n=Tn===void 0?50:Tn,kn=De.sort;return Kt.useMemo(function(){var bn=[];if(!Ft)return[];function Vn(Hn,Fi){var Zi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;Hn.forEach(function(Si){if(!(!kn&&_n!==!1&&_n>0&&bn.length>=_n)){var Ti=[].concat(tn(Fi),[Si]),dr=Si[Zt.children],Pn=Zi||Si.disabled;if((!dr||dr.length===0||je)&&rn(Ft,Ti,{label:Zt.label})){var Ai;bn.push($t($t({},Si),{},(Ai={disabled:Pn},Se(Ai,Zt.label,Cn(Ft,Ti,pe,Zt)),Se(Ai,Go,Ti),Se(Ai,Zt.children,void 0),Ai)))}dr&&Vn(Si[Zt.children],Ti,Pn)}})}return Vn(Wt,[]),kn&&bn.sort(function(Hn,Fi){return kn(Hn[Go],Fi[Go],Ft,Zt)}),_n!==!1&&_n>0?bn.slice(0,_n):bn},[Ft,Wt,Zt,pe,Cn,je,rn,kn,_n])},oi=Df,Zd="__RC_CASCADER_SPLIT__",ne="SHOW_PARENT",We="SHOW_CHILD";function $l(kt){return kt.join(Zd)}function _h(kt){return kt.map($l)}function Qu(kt){return kt.split(Zd)}function Ou(kt){var Ft=kt||{},Wt=Ft.label,Zt=Ft.value,pe=Ft.children,De=Zt||"value";return{label:Wt||"label",value:De,key:De,children:pe||"children"}}function fu(kt,Ft){var Wt,Zt;return(Wt=kt.isLeaf)!==null&&Wt!==void 0?Wt:!((Zt=kt[Ft.children])!==null&&Zt!==void 0&&Zt.length)}function Af(kt){var Ft=kt.parentElement;if(Ft){var Wt=kt.offsetTop-Ft.offsetTop;Wt-Ft.scrollTop<0?Ft.scrollTo({top:Wt}):Wt+kt.offsetHeight-Ft.scrollTop>Ft.offsetHeight&&Ft.scrollTo({top:Wt+kt.offsetHeight-Ft.offsetHeight})}}function md(kt,Ft){return kt.map(function(Wt){var Zt;return(Zt=Wt[Go])===null||Zt===void 0?void 0:Zt.map(function(pe){return pe[Ft.value]})})}function qo(kt){return Array.isArray(kt)&&Array.isArray(kt[0])}function Ni(kt){return kt?qo(kt)?kt:(kt.length===0?[]:[kt]).map(function(Ft){return Array.isArray(Ft)?Ft:[Ft]}):[]}function Sa(kt,Ft,Wt){var Zt=new Set(kt),pe=Ft();return kt.filter(function(De){var je=pe[De],en=je?je.parent:null,rn=je?je.children:null;return je&&je.node.disabled?!0:Wt===We?!(rn&&rn.some(function(ln){return ln.key&&Zt.has(ln.key)})):!(en&&!en.node.disabled&&Zt.has(en.key))})}function ua(kt,Ft,Wt){for(var Zt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,pe=Ft,De=[],je=function(){var ln,Cn,Tn,_n=kt[en],kn=(ln=pe)===null||ln===void 0?void 0:ln.findIndex(function(Vn){var Hn=Vn[Wt.value];return Zt?String(Hn)===String(_n):Hn===_n}),bn=kn!==-1?(Cn=pe)===null||Cn===void 0?void 0:Cn[kn]:null;De.push({value:(Tn=bn==null?void 0:bn[Wt.value])!==null&&Tn!==void 0?Tn:_n,index:kn,option:bn}),pe=bn==null?void 0:bn[Wt.children]},en=0;en<kt.length;en+=1)je();return De}var ts=function(kt,Ft,Wt,Zt,pe){return Kt.useMemo(function(){var De=pe||function(je){var en=Zt?je.slice(-1):je,rn=" / ";return en.every(function(ln){return["string","number"].includes(ce(ln))})?en.join(rn):en.reduce(function(ln,Cn,Tn){var _n=Kt.isValidElement(Cn)?Kt.cloneElement(Cn,{key:Tn}):Cn;return Tn===0?[_n]:[].concat(tn(ln),[rn,_n])},[])};return kt.map(function(je){var en,rn=ua(je,Ft,Wt),ln=De(rn.map(function(Tn){var _n,kn=Tn.option,bn=Tn.value;return(_n=kn==null?void 0:kn[Wt.label])!==null&&_n!==void 0?_n:bn}),rn.map(function(Tn){var _n=Tn.option;return _n})),Cn=$l(je);return{label:ln,value:Cn,key:Cn,valueCells:je,disabled:(en=rn[rn.length-1])===null||en===void 0||(en=en.option)===null||en===void 0?void 0:en.disabled}})},[kt,Ft,Wt,pe,Zt])};function xr(kt,Ft){return Kt.useCallback(function(Wt){var Zt=[],pe=[];return Wt.forEach(function(De){var je=ua(De,kt,Ft);je.every(function(en){return en.option})?pe.push(De):Zt.push(De)}),[pe,Zt]},[kt,Ft])}var Fs=Jt(1089),qa=function(kt,Ft){var Wt=Kt.useRef({options:[],info:{keyEntities:{},pathKeyEntities:{}}}),Zt=Kt.useCallback(function(){return Wt.current.options!==kt&&(Wt.current.options=kt,Wt.current.info=(0,Fs.I8)(kt,{fieldNames:Ft,initWrapper:function(De){return $t($t({},De),{},{pathKeyEntities:{}})},processEntity:function(De,je){var en=De.nodes.map(function(rn){return rn[Ft.value]}).join(Zd);je.pathKeyEntities[en]=De,De.key=en}})),Wt.current.info.pathKeyEntities},[Ft,kt]);return Zt};function No(kt,Ft){var Wt=Kt.useMemo(function(){return Ft||[]},[Ft]),Zt=qa(Wt,kt),pe=Kt.useCallback(function(De){var je=Zt();return De.map(function(en){var rn=je[en].nodes;return rn.map(function(ln){return ln[kt.value]})})},[Zt,kt]);return[Wt,Zt,pe]}var ja={},Ys=[],mh=function(Ft){Ys.push(Ft)};function Jr(kt,Ft){if(0)var Wt}function za(kt,Ft){if(0)var Wt}function Ur(){ja={}}function ko(kt,Ft,Wt){!Ft&&!ja[Wt]&&(kt(!1,Wt),ja[Wt]=!0)}function Bo(kt,Ft){ko(Jr,kt,Ft)}function as(kt,Ft){ko(za,kt,Ft)}Bo.preMessage=mh,Bo.resetWarned=Ur,Bo.noteOnce=as;var eo=null;function Hh(kt){return Kt.useMemo(function(){if(!kt)return[!1,{}];var Ft={matchInputWidth:!0,limit:50};return kt&&ce(kt)==="object"&&(Ft=$t($t({},Ft),kt)),Ft.limit<=0&&(Ft.limit=!1),[!0,Ft]},[kt])}var Ei=Jt(17341);function vc(kt,Ft,Wt,Zt,pe,De,je,en){return function(rn){if(!kt)Ft(rn);else{var ln=$l(rn),Cn=_h(Wt),Tn=_h(Zt),_n=Cn.includes(ln),kn=pe.some(function(Pn){return $l(Pn)===ln}),bn=Wt,Vn=pe;if(kn&&!_n)Vn=pe.filter(function(Pn){return $l(Pn)!==ln});else{var Hn=_n?Cn.filter(function(Pn){return Pn!==ln}):[].concat(tn(Cn),[ln]),Fi=De(),Zi;if(_n){var Si=(0,Ei.S)(Hn,{checked:!1,halfCheckedKeys:Tn},Fi);Zi=Si.checkedKeys}else{var Ti=(0,Ei.S)(Hn,!0,Fi);Zi=Ti.checkedKeys}var dr=Sa(Zi,De,en);bn=je(dr)}Ft([].concat(tn(Vn),tn(bn)))}}}function jr(kt,Ft,Wt,Zt,pe){return Kt.useMemo(function(){var De=pe(Ft),je=ht(De,2),en=je[0],rn=je[1];if(!kt||!Ft.length)return[en,[],rn];var ln=_h(en),Cn=Wt(),Tn=(0,Ei.S)(ln,!0,Cn),_n=Tn.checkedKeys,kn=Tn.halfCheckedKeys;return[Zt(_n),Zt(kn),rn]},[kt,Ft,Wt,Zt,pe])}var qc=Kt.memo(function(kt){var Ft=kt.children;return Ft},function(kt,Ft){return!Ft.open}),vd=qc;function Jd(kt){var Ft,Wt=kt.prefixCls,Zt=kt.checked,pe=kt.halfChecked,De=kt.disabled,je=kt.onClick,en=kt.disableCheckbox,rn=Kt.useContext(Bu),ln=rn.checkable,Cn=typeof ln!="boolean"?ln:null;return Kt.createElement("span",{className:be()("".concat(Wt),(Ft={},Se(Ft,"".concat(Wt,"-checked"),Zt),Se(Ft,"".concat(Wt,"-indeterminate"),!Zt&&pe),Se(Ft,"".concat(Wt,"-disabled"),De||en),Ft)),onClick:je},Cn)}var Bf="__cascader_fix_label__";function Of(kt){var Ft=kt.prefixCls,Wt=kt.multiple,Zt=kt.options,pe=kt.activeValue,De=kt.prevValuePath,je=kt.onToggleOpen,en=kt.onSelect,rn=kt.onActive,ln=kt.checkedSet,Cn=kt.halfCheckedSet,Tn=kt.loadingKeys,_n=kt.isSelectable,kn=kt.disabled,bn="".concat(Ft,"-menu"),Vn="".concat(Ft,"-menu-item"),Hn=Kt.useContext(Bu),Fi=Hn.fieldNames,Zi=Hn.changeOnSelect,Si=Hn.expandTrigger,Ti=Hn.expandIcon,dr=Hn.loadingIcon,Pn=Hn.dropdownMenuColumnStyle,Ai=Hn.optionRender,Wi=Si==="hover",_i=function(ar){return kn||ar},Ji=Kt.useMemo(function(){return Zt.map(function(vi){var ar,ir=vi.disabled,Ar=vi.disableCheckbox,Pr=vi[Go],wr=(ar=vi[Bf])!==null&&ar!==void 0?ar:vi[Fi.label],Gr=vi[Fi.value],Kr=fu(vi,Fi),Er=Pr?Pr.map(function(io){return io[Fi.value]}):[].concat(tn(De),[Gr]),pi=$l(Er),fr=Tn.includes(pi),Yr=ln.has(pi),Fr=Cn.has(pi);return{disabled:ir,label:wr,value:Gr,isLeaf:Kr,isLoading:fr,checked:Yr,halfChecked:Fr,option:vi,disableCheckbox:Ar,fullPath:Er,fullPathKey:pi}})},[Zt,ln,Fi,Cn,Tn,De]);return Kt.createElement("ul",{className:bn,role:"menu"},Ji.map(function(vi){var ar,ir=vi.disabled,Ar=vi.label,Pr=vi.value,wr=vi.isLeaf,Gr=vi.isLoading,Kr=vi.checked,Er=vi.halfChecked,pi=vi.option,fr=vi.fullPath,Yr=vi.fullPathKey,Fr=vi.disableCheckbox,io=function(){if(!_i(ir)){var Oo=tn(fr);Wi&&wr&&Oo.pop(),rn(Oo)}},ao=function(){_n(pi)&&!_i(ir)&&en(fr,wr)},po;return typeof pi.title=="string"?po=pi.title:typeof Ar=="string"&&(po=Ar),Kt.createElement("li",{key:Yr,className:be()(Vn,(ar={},Se(ar,"".concat(Vn,"-expand"),!wr),Se(ar,"".concat(Vn,"-active"),pe===Pr||pe===Yr),Se(ar,"".concat(Vn,"-disabled"),_i(ir)),Se(ar,"".concat(Vn,"-loading"),Gr),ar)),style:Pn,role:"menuitemcheckbox",title:po,"aria-checked":Kr,"data-path-key":Yr,onClick:function(){io(),!Fr&&(!Wt||wr)&&ao()},onDoubleClick:function(){Zi&&je(!1)},onMouseEnter:function(){Wi&&io()},onMouseDown:function(Oo){Oo.preventDefault()}},Wt&&Kt.createElement(Jd,{prefixCls:"".concat(Ft,"-checkbox"),checked:Kr,halfChecked:Er,disabled:_i(ir)||Fr,disableCheckbox:Fr,onClick:function(Oo){Fr||(Oo.stopPropagation(),ao())}}),Kt.createElement("div",{className:"".concat(Vn,"-content")},Ai?Ai(pi):Ar),!Gr&&Ti&&!wr&&Kt.createElement("div",{className:"".concat(Vn,"-expand-icon")},Ti),Gr&&dr&&Kt.createElement("div",{className:"".concat(Vn,"-loading-icon")},dr))}))}var $u=function(Ft,Wt){var Zt=Kt.useContext(Bu),pe=Zt.values,De=pe[0],je=Kt.useState([]),en=ht(je,2),rn=en[0],ln=en[1];return Kt.useEffect(function(){Ft||ln(De||[])},[Wt,De]),[rn,ln]},Vh=$u,ti={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(Ft){var Wt=Ft.keyCode;if(Ft.altKey&&!Ft.ctrlKey||Ft.metaKey||Wt>=ti.F1&&Wt<=ti.F12)return!1;switch(Wt){case ti.ALT:case ti.CAPS_LOCK:case ti.CONTEXT_MENU:case ti.CTRL:case ti.DOWN:case ti.END:case ti.ESC:case ti.HOME:case ti.INSERT:case ti.LEFT:case ti.MAC_FF_META:case ti.META:case ti.NUMLOCK:case ti.NUM_CENTER:case ti.PAGE_DOWN:case ti.PAGE_UP:case ti.PAUSE:case ti.PRINT_SCREEN:case ti.RIGHT:case ti.SHIFT:case ti.UP:case ti.WIN_KEY:case ti.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(Ft){if(Ft>=ti.ZERO&&Ft<=ti.NINE||Ft>=ti.NUM_ZERO&&Ft<=ti.NUM_MULTIPLY||Ft>=ti.A&&Ft<=ti.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&Ft===0)return!0;switch(Ft){case ti.SPACE:case ti.QUESTION_MARK:case ti.NUM_PLUS:case ti.NUM_MINUS:case ti.NUM_PERIOD:case ti.NUM_DIVISION:case ti.SEMICOLON:case ti.DASH:case ti.EQUALS:case ti.COMMA:case ti.PERIOD:case ti.SLASH:case ti.APOSTROPHE:case ti.SINGLE_QUOTE:case ti.OPEN_SQUARE_BRACKET:case ti.BACKSLASH:case ti.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},xa=ti,If=function(kt,Ft,Wt,Zt,pe,De,je){var en=je.direction,rn=je.searchValue,ln=je.toggleOpen,Cn=je.open,Tn=en==="rtl",_n=Kt.useMemo(function(){for(var Pn=-1,Ai=Ft,Wi=[],_i=[],Ji=Zt.length,vi=md(Ft,Wt),ar=function(Gr){var Kr=Ai.findIndex(function(Er,pi){return(vi[pi]?$l(vi[pi]):Er[Wt.value])===Zt[Gr]});if(Kr===-1)return 1;Pn=Kr,Wi.push(Pn),_i.push(Zt[Gr]),Ai=Ai[Pn][Wt.children]},ir=0;ir<Ji&&Ai&&!ar(ir);ir+=1);for(var Ar=Ft,Pr=0;Pr<Wi.length-1;Pr+=1)Ar=Ar[Wi[Pr]][Wt.children];return[_i,Pn,Ar,vi]},[Zt,Wt,Ft]),kn=ht(_n,4),bn=kn[0],Vn=kn[1],Hn=kn[2],Fi=kn[3],Zi=function(Ai){pe(Ai)},Si=function(Ai){var Wi=Hn.length,_i=Vn;_i===-1&&Ai<0&&(_i=Wi);for(var Ji=0;Ji<Wi;Ji+=1){_i=(_i+Ai+Wi)%Wi;var vi=Hn[_i];if(vi&&!vi.disabled){var ar=bn.slice(0,-1).concat(Fi[_i]?$l(Fi[_i]):vi[Wt.value]);Zi(ar);return}}},Ti=function(){if(bn.length>1){var Ai=bn.slice(0,-1);Zi(Ai)}else ln(!1)},dr=function(){var Ai,Wi=((Ai=Hn[Vn])===null||Ai===void 0?void 0:Ai[Wt.children])||[],_i=Wi.find(function(vi){return!vi.disabled});if(_i){var Ji=[].concat(tn(bn),[_i[Wt.value]]);Zi(Ji)}};Kt.useImperativeHandle(kt,function(){return{onKeyDown:function(Ai){var Wi=Ai.which;switch(Wi){case xa.UP:case xa.DOWN:{var _i=0;Wi===xa.UP?_i=-1:Wi===xa.DOWN&&(_i=1),_i!==0&&Si(_i);break}case xa.LEFT:{if(rn)break;Tn?dr():Ti();break}case xa.RIGHT:{if(rn)break;Tn?Ti():dr();break}case xa.BACKSPACE:{rn||Ti();break}case xa.ENTER:{if(bn.length){var Ji=Hn[Vn],vi=(Ji==null?void 0:Ji[Go])||[];vi.length?De(vi.map(function(ar){return ar[Wt.value]}),vi[vi.length-1]):De(bn,Hn[Vn])}break}case xa.ESC:ln(!1),Cn&&Ai.stopPropagation()}},onKeyUp:function(){}}})},Wh=Kt.forwardRef(function(kt,Ft){var Wt,Zt,pe,De=kt.prefixCls,je=kt.multiple,en=kt.searchValue,rn=kt.toggleOpen,ln=kt.notFoundContent,Cn=kt.direction,Tn=kt.open,_n=kt.disabled,kn=Kt.useRef(null),bn=Cn==="rtl",Vn=Kt.useContext(Bu),Hn=Vn.options,Fi=Vn.values,Zi=Vn.halfValues,Si=Vn.fieldNames,Ti=Vn.changeOnSelect,dr=Vn.onSelect,Pn=Vn.searchOptions,Ai=Vn.dropdownPrefixCls,Wi=Vn.loadData,_i=Vn.expandTrigger,Ji=Ai||De,vi=Kt.useState([]),ar=ht(vi,2),ir=ar[0],Ar=ar[1],Pr=function(ui){if(!(!Wi||en)){var hi=ua(ui,Hn,Si),Vi=hi.map(function(Tr){var Ho=Tr.option;return Ho}),yr=Vi[Vi.length-1];if(yr&&!fu(yr,Si)){var Xr=$l(ui);Ar(function(Tr){return[].concat(tn(Tr),[Xr])}),Wi(Vi)}}};Kt.useEffect(function(){ir.length&&ir.forEach(function(Ri){var ui=Qu(Ri),hi=ua(ui,Hn,Si,!0).map(function(yr){var Xr=yr.option;return Xr}),Vi=hi[hi.length-1];(!Vi||Vi[Si.children]||fu(Vi,Si))&&Ar(function(yr){return yr.filter(function(Xr){return Xr!==Ri})})})},[Hn,ir,Si]);var wr=Kt.useMemo(function(){return new Set(_h(Fi))},[Fi]),Gr=Kt.useMemo(function(){return new Set(_h(Zi))},[Zi]),Kr=Vh(je,Tn),Er=ht(Kr,2),pi=Er[0],fr=Er[1],Yr=function(ui){fr(ui),Pr(ui)},Fr=function(ui){if(_n)return!1;var hi=ui.disabled,Vi=fu(ui,Si);return!hi&&(Vi||Ti||je)},io=function(ui,hi){var Vi=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;dr(ui),!je&&(hi||Ti&&(_i==="hover"||Vi))&&rn(!1)},ao=Kt.useMemo(function(){return en?Pn:Hn},[en,Pn,Hn]),po=Kt.useMemo(function(){for(var Ri=[{options:ao}],ui=ao,hi=md(ui,Si),Vi=function(){var Tr=pi[yr],Ho=ui.find(function(lo,zs){return(hi[zs]?$l(hi[zs]):lo[Si.value])===Tr}),Ts=Ho==null?void 0:Ho[Si.children];if(!(Ts!=null&&Ts.length))return 1;ui=Ts,Ri.push({options:Ts})},yr=0;yr<pi.length&&!Vi();yr+=1);return Ri},[ao,pi,Si]),ro=function(ui,hi){Fr(hi)&&io(ui,fu(hi,Si),!0)};If(Ft,ao,Si,pi,Yr,ro,{direction:Cn,searchValue:en,toggleOpen:rn,open:Tn}),Kt.useEffect(function(){if(!en)for(var Ri=0;Ri<pi.length;Ri+=1){var ui,hi=pi.slice(0,Ri+1),Vi=$l(hi),yr=(ui=kn.current)===null||ui===void 0?void 0:ui.querySelector('li[data-path-key="'.concat(Vi.replace(/\\{0,2}"/g,'\\"'),'"]'));yr&&Af(yr)}},[pi,en]);var Oo=!((Wt=po[0])!==null&&Wt!==void 0&&(Wt=Wt.options)!==null&&Wt!==void 0&&Wt.length),Vs=[(Zt={},Se(Zt,Si.value,"__EMPTY__"),Se(Zt,Bf,ln),Se(Zt,"disabled",!0),Zt)],_o=$t($t({},kt),{},{multiple:!Oo&&je,onSelect:io,onActive:Yr,onToggleOpen:rn,checkedSet:wr,halfCheckedSet:Gr,loadingKeys:ir,isSelectable:Fr}),Ui=Oo?[{options:Vs}]:po,Hi=Ui.map(function(Ri,ui){var hi=pi.slice(0,ui),Vi=pi[ui];return Kt.createElement(Of,It({key:ui},_o,{prefixCls:Ji,options:Ri.options,prevValuePath:hi,activeValue:Vi}))});return Kt.createElement(vd,{open:Tn},Kt.createElement("div",{className:be()("".concat(Ji,"-menus"),(pe={},Se(pe,"".concat(Ji,"-menu-empty"),Oo),Se(pe,"".concat(Ji,"-rtl"),bn),pe)),ref:kn},Hi))}),Rf=Wh,qu=Kt.forwardRef(function(kt,Ft){var Wt=is();return Kt.createElement(Rf,It({},kt,Wt,{ref:Ft}))}),jl=qu,Uh=Jt(80705);function Iu(kt,Ft,Wt){var Zt=React.useRef({});return(!("value"in Zt.current)||Wt(Zt.current.condition,Ft))&&(Zt.current.value=kt(),Zt.current.condition=Ft),Zt.current.value}var vh=Symbol.for("react.element"),jf=Symbol.for("react.transitional.element"),yc=Symbol.for("react.fragment");function tg(kt){return kt&&_typeof(kt)==="object"&&(kt.$$typeof===vh||kt.$$typeof===jf)&&kt.type===yc}var eg=Number(Kt.version.split(".")[0]),yh=function(Ft,Wt){typeof Ft=="function"?Ft(Wt):_typeof(Ft)==="object"&&Ft&&"current"in Ft&&(Ft.current=Wt)},Sh=function(){for(var Ft=arguments.length,Wt=new Array(Ft),Zt=0;Zt<Ft;Zt++)Wt[Zt]=arguments[Zt];var pe=Wt.filter(Boolean);return pe.length<=1?pe[0]:function(De){Wt.forEach(function(je){yh(je,De)})}},om=function(){for(var Ft=arguments.length,Wt=new Array(Ft),Zt=0;Zt<Ft;Zt++)Wt[Zt]=arguments[Zt];return useMemo(function(){return Sh.apply(void 0,Wt)},Wt,function(pe,De){return pe.length!==De.length||pe.every(function(je,en){return je!==De[en]})})},Zg=function(Ft){var Wt,Zt;if(!Ft)return!1;if(Sc(Ft)&&eg>=19)return!0;var pe=isMemo(Ft)?Ft.type.type:Ft.type;return!(typeof pe=="function"&&!((Wt=pe.prototype)!==null&&Wt!==void 0&&Wt.render)&&pe.$$typeof!==ForwardRef||typeof Ft=="function"&&!((Zt=Ft.prototype)!==null&&Zt!==void 0&&Zt.render)&&Ft.$$typeof!==ForwardRef)};function Sc(kt){return isValidElement(kt)&&!isFragment(kt)}var Jg=function(Ft){return Sc(Ft)&&Zg(Ft)},ws=function(Ft){if(Ft&&Sc(Ft)){var Wt=Ft;return Wt.props.propertyIsEnumerable("ref")?Wt.props.ref:Wt.ref}return null};function th(kt,Ft,Wt,Zt){if(!Ft.length)return Wt;var pe=_toArray(Ft),De=pe[0],je=pe.slice(1),en;return!kt&&typeof De=="number"?en=[]:Array.isArray(kt)?en=_toConsumableArray(kt):en=_objectSpread({},kt),Zt&&Wt===void 0&&je.length===1?delete en[De][je[0]]:en[De]=th(en[De],je,Wt,Zt),en}function so(kt,Ft,Wt){var Zt=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return Ft.length&&Zt&&Wt===void 0&&!get(kt,Ft.slice(0,-1))?kt:th(kt,Ft,Wt,Zt)}function Xs(kt){return _typeof(kt)==="object"&&kt!==null&&Object.getPrototypeOf(kt)===Object.prototype}function Zs(kt){return Array.isArray(kt)?[]:{}}var ta=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function Qd(){for(var kt=arguments.length,Ft=new Array(kt),Wt=0;Wt<kt;Wt++)Ft[Wt]=arguments[Wt];var Zt=Zs(Ft[0]);return Ft.forEach(function(pe){function De(je,en){var rn=new Set(en),ln=get(pe,je),Cn=Array.isArray(ln);if(Cn||Xs(ln)){if(!rn.has(ln)){rn.add(ln);var Tn=get(Zt,je);Cn?Zt=so(Zt,je,[]):(!Tn||_typeof(Tn)!=="object")&&(Zt=so(Zt,je,Zs(ln))),ta(ln).forEach(function(_n){De([].concat(_toConsumableArray(je),[_n]),rn)})}}else Zt=so(Zt,je,ln)}De([])}),Zt}function ea(){}function xh(kt){var Ft,Wt=kt,Zt=Wt.prefixCls,pe=Zt===void 0?"rc-cascader":Zt,De=Wt.style,je=Wt.className,en=Wt.options,rn=Wt.checkable,ln=Wt.defaultValue,Cn=Wt.value,Tn=Wt.fieldNames,_n=Wt.changeOnSelect,kn=Wt.onChange,bn=Wt.showCheckedStrategy,Vn=Wt.loadData,Hn=Wt.expandTrigger,Fi=Wt.expandIcon,Zi=Fi===void 0?">":Fi,Si=Wt.loadingIcon,Ti=Wt.direction,dr=Wt.notFoundContent,Pn=dr===void 0?"Not Found":dr,Ai=Wt.disabled,Wi=!!rn,_i=Ks(ln,{value:Cn,postState:Ni}),Ji=ht(_i,2),vi=Ji[0],ar=Ji[1],ir=Kt.useMemo(function(){return Ou(Tn)},[JSON.stringify(Tn)]),Ar=No(ir,en),Pr=ht(Ar,3),wr=Pr[0],Gr=Pr[1],Kr=Pr[2],Er=xr(wr,ir),pi=jr(Wi,vi,Gr,Kr,Er),fr=ht(pi,3),Yr=fr[0],Fr=fr[1],io=fr[2],ao=Au(function(Ui){if(ar(Ui),kn){var Hi=Ni(Ui),Ri=Hi.map(function(Vi){return ua(Vi,wr,ir).map(function(yr){return yr.option})}),ui=Wi?Hi:Hi[0],hi=Wi?Ri:Ri[0];kn(ui,hi)}}),po=vc(Wi,ao,Yr,Fr,io,Gr,Kr,bn),ro=Au(function(Ui){po(Ui)}),Oo=Kt.useMemo(function(){return{options:wr,fieldNames:ir,values:Yr,halfValues:Fr,changeOnSelect:_n,onSelect:ro,checkable:rn,searchOptions:[],dropdownPrefixCls:void 0,loadData:Vn,expandTrigger:Hn,expandIcon:Zi,loadingIcon:Si,dropdownMenuColumnStyle:void 0}},[wr,ir,Yr,Fr,_n,ro,rn,Vn,Hn,Zi,Si]),Vs="".concat(pe,"-panel"),_o=!wr.length;return Kt.createElement(Bu.Provider,{value:Oo},Kt.createElement("div",{className:be()(Vs,(Ft={},Se(Ft,"".concat(Vs,"-rtl"),Ti==="rtl"),Se(Ft,"".concat(Vs,"-empty"),_o),Ft),je),style:De},_o?Pn:Kt.createElement(Rf,{prefixCls:pe,searchValue:"",multiple:Wi,toggleOpen:ea,open:!0,direction:Ti,disabled:Ai})))}function Qg(kt){var Ft=kt.onPopupVisibleChange,Wt=kt.popupVisible,Zt=kt.popupClassName,pe=kt.popupPlacement;warning(!Ft,"`onPopupVisibleChange` is deprecated. Please use `onDropdownVisibleChange` instead."),warning(Wt===void 0,"`popupVisible` is deprecated. Please use `open` instead."),warning(Zt===void 0,"`popupClassName` is deprecated. Please use `dropdownClassName` instead."),warning(pe===void 0,"`popupPlacement` is deprecated. Please use `placement` instead.")}function $g(kt,Ft){if(kt){var Wt=function Zt(pe){for(var De=0;De<pe.length;De++){var je=pe[De];if(je[Ft==null?void 0:Ft.value]===null)return warning(!1,"`value` in Cascader options should not be `null`."),!0;if(Array.isArray(je[Ft==null?void 0:Ft.children])&&Zt(je[Ft==null?void 0:Ft.children]))return!0}};Wt(kt)}}var cl=null,zf=["id","prefixCls","fieldNames","defaultValue","value","changeOnSelect","onChange","displayRender","checkable","autoClearSearchValue","searchValue","onSearch","showSearch","expandTrigger","options","dropdownPrefixCls","loadData","popupVisible","open","popupClassName","dropdownClassName","dropdownMenuColumnStyle","dropdownStyle","popupPlacement","placement","onDropdownVisibleChange","onPopupVisibleChange","expandIcon","loadingIcon","children","dropdownMatchSelectWidth","showCheckedStrategy","optionRender"],yo=Kt.forwardRef(function(kt,Ft){var Wt=kt.id,Zt=kt.prefixCls,pe=Zt===void 0?"rc-cascader":Zt,De=kt.fieldNames,je=kt.defaultValue,en=kt.value,rn=kt.changeOnSelect,ln=kt.onChange,Cn=kt.displayRender,Tn=kt.checkable,_n=kt.autoClearSearchValue,kn=_n===void 0?!0:_n,bn=kt.searchValue,Vn=kt.onSearch,Hn=kt.showSearch,Fi=kt.expandTrigger,Zi=kt.options,Si=kt.dropdownPrefixCls,Ti=kt.loadData,dr=kt.popupVisible,Pn=kt.open,Ai=kt.popupClassName,Wi=kt.dropdownClassName,_i=kt.dropdownMenuColumnStyle,Ji=kt.dropdownStyle,vi=kt.popupPlacement,ar=kt.placement,ir=kt.onDropdownVisibleChange,Ar=kt.onPopupVisibleChange,Pr=kt.expandIcon,wr=Pr===void 0?">":Pr,Gr=kt.loadingIcon,Kr=kt.children,Er=kt.dropdownMatchSelectWidth,pi=Er===void 0?!1:Er,fr=kt.showCheckedStrategy,Yr=fr===void 0?ne:fr,Fr=kt.optionRender,io=pt(kt,zf),ao=us(Wt),po=!!Tn,ro=Ks(je,{value:en,postState:Ni}),Oo=ht(ro,2),Vs=Oo[0],_o=Oo[1],Ui=Kt.useMemo(function(){return Ou(De)},[JSON.stringify(De)]),Hi=No(Ui,Zi),Ri=ht(Hi,3),ui=Ri[0],hi=Ri[1],Vi=Ri[2],yr=Ks("",{value:bn,postState:function($i){return $i||""}}),Xr=ht(yr,2),Tr=Xr[0],Ho=Xr[1],Ts=function($i,to){Ho($i),to.source!=="blur"&&Vn&&Vn($i)},lo=Hh(Hn),zs=ht(lo,2),Io=zs[0],ha=zs[1],Cs=oi(Tr,ui,Ui,Si||pe,ha,rn||po),Pa=xr(ui,Ui),Ns=jr(po,Vs,hi,Vi,Pa),ys=ht(Ns,3),Do=ys[0],Yo=ys[1],Ml=ys[2],Ga=Kt.useMemo(function(){var Ds=_h(Do),$i=Sa(Ds,hi,Yr);return[].concat(tn(Ml),tn(Vi($i)))},[Do,hi,Vi,Ml,Yr]),Js=ts(Ga,ui,Ui,po,Cn),Gs=Au(function(Ds){if(_o(Ds),ln){var $i=Ni(Ds),to=$i.map(function(tl){return ua(tl,ui,Ui).map(function(cr){return cr.option})}),tr=po?$i:$i[0],_s=po?to:to[0];ln(tr,_s)}}),bo=vc(po,Gs,Do,Yo,Ml,hi,Vi,Yr),Ls=Au(function(Ds){(!po||kn)&&Ho(""),bo(Ds)}),cu=function($i,to){if(to.type==="clear"){Gs([]);return}var tr=to.values[0],_s=tr.valueCells;Ls(_s)},Qs=Pn!==void 0?Pn:dr,eh=Wi||Ai,se=ar||vi,kl=function($i){ir==null||ir($i),Ar==null||Ar($i)},wa=Kt.useMemo(function(){return{options:ui,fieldNames:Ui,values:Do,halfValues:Yo,changeOnSelect:rn,onSelect:Ls,checkable:Tn,searchOptions:Cs,dropdownPrefixCls:Si,loadData:Ti,expandTrigger:Fi,expandIcon:wr,loadingIcon:Gr,dropdownMenuColumnStyle:_i,optionRender:Fr}},[ui,Ui,Do,Yo,rn,Ls,Tn,Cs,Si,Ti,Fi,wr,Gr,_i,Fr]),gu=!(Tr?Cs:ui).length,ql=Tr&&ha.matchInputWidth||gu?{}:{minWidth:"auto"};return Kt.createElement(Bu.Provider,{value:wa},Kt.createElement(Rl,It({},io,{ref:Ft,id:ao,prefixCls:pe,autoClearSearchValue:kn,dropdownMatchSelectWidth:pi,dropdownStyle:$t($t({},ql),Ji),displayValues:Js,onDisplayValuesChange:cu,mode:po?"multiple":void 0,searchValue:Tr,onSearch:Ts,showSearch:Io,OptionList:jl,emptyOptions:gu,open:Qs,dropdownClassName:eh,placement:se,onDropdownVisibleChange:kl,getRawInputElement:function(){return Kr}})))});yo.SHOW_PARENT=ne,yo.SHOW_CHILD=We,yo.Panel=xh;var Ph=yo,xc=Ph},42767:function(on,In){"use strict";var Jt;var It=typeof Symbol=="function"&&Symbol.for,ce=It?Symbol.for("react.element"):60103,Be=It?Symbol.for("react.portal"):60106,qe=It?Symbol.for("react.fragment"):60107,Se=It?Symbol.for("react.strict_mode"):60108,de=It?Symbol.for("react.profiler"):60114,$t=It?Symbol.for("react.provider"):60109,He=It?Symbol.for("react.context"):60110,ve=It?Symbol.for("react.async_mode"):60111,Pe=It?Symbol.for("react.concurrent_mode"):60111,ze=It?Symbol.for("react.forward_ref"):60112,Me=It?Symbol.for("react.suspense"):60113,tn=It?Symbol.for("react.suspense_list"):60120,Nt=It?Symbol.for("react.memo"):60115,nt=It?Symbol.for("react.lazy"):60116,et=It?Symbol.for("react.block"):60121,ht=It?Symbol.for("react.fundamental"):60117,lt=It?Symbol.for("react.responder"):60118,pt=It?Symbol.for("react.scope"):60119;function vt(bt){if(typeof bt=="object"&&bt!==null){var zt=bt.$$typeof;switch(zt){case ce:switch(bt=bt.type,bt){case ve:case Pe:case qe:case de:case Se:case Me:return bt;default:switch(bt=bt&&bt.$$typeof,bt){case He:case ze:case nt:case Nt:case $t:return bt;default:return zt}}case Be:return zt}}}function Ct(bt){return vt(bt)===Pe}Jt=ve,Jt=Pe,Jt=He,Jt=$t,Jt=ce,Jt=ze,Jt=qe,Jt=nt,Jt=Nt,Jt=Be,Jt=de,Jt=Se,Jt=Me,Jt=function(bt){return Ct(bt)||vt(bt)===ve},Jt=Ct,Jt=function(bt){return vt(bt)===He},Jt=function(bt){return vt(bt)===$t},Jt=function(bt){return typeof bt=="object"&&bt!==null&&bt.$$typeof===ce},Jt=function(bt){return vt(bt)===ze},In.isFragment=function(bt){return vt(bt)===qe},Jt=function(bt){return vt(bt)===nt},Jt=function(bt){return vt(bt)===Nt},Jt=function(bt){return vt(bt)===Be},Jt=function(bt){return vt(bt)===de},Jt=function(bt){return vt(bt)===Se},Jt=function(bt){return vt(bt)===Me},Jt=function(bt){return typeof bt=="string"||typeof bt=="function"||bt===qe||bt===Pe||bt===de||bt===Se||bt===Me||bt===tn||typeof bt=="object"&&bt!==null&&(bt.$$typeof===nt||bt.$$typeof===Nt||bt.$$typeof===$t||bt.$$typeof===He||bt.$$typeof===ze||bt.$$typeof===ht||bt.$$typeof===lt||bt.$$typeof===pt||bt.$$typeof===et)},Jt=vt},16357:function(on,In,Jt){"use strict";on.exports=Jt(42767)},16404:function(on,In){"use strict";var Jt;var It=Symbol.for("react.element"),ce=Symbol.for("react.portal"),Be=Symbol.for("react.fragment"),qe=Symbol.for("react.strict_mode"),Se=Symbol.for("react.profiler"),de=Symbol.for("react.provider"),$t=Symbol.for("react.context"),He=Symbol.for("react.server_context"),ve=Symbol.for("react.forward_ref"),Pe=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),tn=Symbol.for("react.lazy"),Nt=Symbol.for("react.offscreen"),nt;nt=Symbol.for("react.module.reference");function et(ht){if(typeof ht=="object"&&ht!==null){var lt=ht.$$typeof;switch(lt){case It:switch(ht=ht.type,ht){case Be:case Se:case qe:case Pe:case ze:return ht;default:switch(ht=ht&&ht.$$typeof,ht){case He:case $t:case ve:case tn:case Me:case de:return ht;default:return lt}}case ce:return lt}}}Jt=$t,Jt=de,Jt=It,Jt=ve,Jt=Be,Jt=tn,Jt=Me,Jt=ce,Jt=Se,Jt=qe,Jt=Pe,Jt=ze,Jt=function(){return!1},Jt=function(){return!1},Jt=function(ht){return et(ht)===$t},Jt=function(ht){return et(ht)===de},Jt=function(ht){return typeof ht=="object"&&ht!==null&&ht.$$typeof===It},Jt=function(ht){return et(ht)===ve},Jt=function(ht){return et(ht)===Be},Jt=function(ht){return et(ht)===tn},Jt=function(ht){return et(ht)===Me},Jt=function(ht){return et(ht)===ce},Jt=function(ht){return et(ht)===Se},Jt=function(ht){return et(ht)===qe},Jt=function(ht){return et(ht)===Pe},Jt=function(ht){return et(ht)===ze},Jt=function(ht){return typeof ht=="string"||typeof ht=="function"||ht===Be||ht===Se||ht===qe||ht===Pe||ht===ze||ht===Nt||typeof ht=="object"&&ht!==null&&(ht.$$typeof===tn||ht.$$typeof===Me||ht.$$typeof===de||ht.$$typeof===$t||ht.$$typeof===ve||ht.$$typeof===nt||ht.getModuleId!==void 0)},Jt=et},80705:function(on,In,Jt){"use strict";Jt(16404)},58212:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return di}});function It(){return It=Object.assign?Object.assign.bind():function(ee){for(var _t=1;_t<arguments.length;_t++){var Kt=arguments[_t];for(var pn in Kt)Object.prototype.hasOwnProperty.call(Kt,pn)&&(ee[pn]=Kt[pn])}return ee},It.apply(this,arguments)}function ce(ee){"@babel/helpers - typeof";return ce=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_t){return typeof _t}:function(_t){return _t&&typeof Symbol=="function"&&_t.constructor===Symbol&&_t!==Symbol.prototype?"symbol":typeof _t},ce(ee)}function Be(ee,_t){if(ce(ee)!=="object"||ee===null)return ee;var Kt=ee[Symbol.toPrimitive];if(Kt!==void 0){var pn=Kt.call(ee,_t||"default");if(ce(pn)!=="object")return pn;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_t==="string"?String:Number)(ee)}function qe(ee){var _t=Be(ee,"string");return ce(_t)==="symbol"?_t:String(_t)}function Se(ee,_t,Kt){return _t=qe(_t),_t in ee?Object.defineProperty(ee,_t,{value:Kt,enumerable:!0,configurable:!0,writable:!0}):ee[_t]=Kt,ee}function de(ee){if(Array.isArray(ee))return ee}function $t(ee,_t){var Kt=ee==null?null:typeof Symbol!="undefined"&&ee[Symbol.iterator]||ee["@@iterator"];if(Kt!=null){var pn,Ln,Ce,sn,cn=[],Jn=!0,Sn=!1;try{if(Ce=(Kt=Kt.call(ee)).next,_t===0){if(Object(Kt)!==Kt)return;Jn=!1}else for(;!(Jn=(pn=Ce.call(Kt)).done)&&(cn.push(pn.value),cn.length!==_t);Jn=!0);}catch(he){Sn=!0,Ln=he}finally{try{if(!Jn&&Kt.return!=null&&(sn=Kt.return(),Object(sn)!==sn))return}finally{if(Sn)throw Ln}}return cn}}function He(ee,_t){(_t==null||_t>ee.length)&&(_t=ee.length);for(var Kt=0,pn=new Array(_t);Kt<_t;Kt++)pn[Kt]=ee[Kt];return pn}function ve(ee,_t){if(ee){if(typeof ee=="string")return He(ee,_t);var Kt=Object.prototype.toString.call(ee).slice(8,-1);if(Kt==="Object"&&ee.constructor&&(Kt=ee.constructor.name),Kt==="Map"||Kt==="Set")return Array.from(ee);if(Kt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Kt))return He(ee,_t)}}function Pe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ze(ee,_t){return de(ee)||$t(ee,_t)||ve(ee,_t)||Pe()}function Me(ee,_t){if(ee==null)return{};var Kt={},pn=Object.keys(ee),Ln,Ce;for(Ce=0;Ce<pn.length;Ce++)Ln=pn[Ce],!(_t.indexOf(Ln)>=0)&&(Kt[Ln]=ee[Ln]);return Kt}function tn(ee,_t){if(ee==null)return{};var Kt=Me(ee,_t),pn,Ln;if(Object.getOwnPropertySymbols){var Ce=Object.getOwnPropertySymbols(ee);for(Ln=0;Ln<Ce.length;Ln++)pn=Ce[Ln],!(_t.indexOf(pn)>=0)&&Object.prototype.propertyIsEnumerable.call(ee,pn)&&(Kt[pn]=ee[pn])}return Kt}var Nt=Jt(67294),nt=Jt(94184),et=Jt.n(nt);function ht(ee){if(Array.isArray(ee))return ee}function lt(ee,_t){var Kt=ee==null?null:typeof Symbol!="undefined"&&ee[Symbol.iterator]||ee["@@iterator"];if(Kt!=null){var pn,Ln,Ce,sn,cn=[],Jn=!0,Sn=!1;try{if(Ce=(Kt=Kt.call(ee)).next,_t===0){if(Object(Kt)!==Kt)return;Jn=!1}else for(;!(Jn=(pn=Ce.call(Kt)).done)&&(cn.push(pn.value),cn.length!==_t);Jn=!0);}catch(he){Sn=!0,Ln=he}finally{try{if(!Jn&&Kt.return!=null&&(sn=Kt.return(),Object(sn)!==sn))return}finally{if(Sn)throw Ln}}return cn}}function pt(ee,_t){(_t==null||_t>ee.length)&&(_t=ee.length);for(var Kt=0,pn=new Array(_t);Kt<_t;Kt++)pn[Kt]=ee[Kt];return pn}function vt(ee,_t){if(ee){if(typeof ee=="string")return pt(ee,_t);var Kt=Object.prototype.toString.call(ee).slice(8,-1);if(Kt==="Object"&&ee.constructor&&(Kt=ee.constructor.name),Kt==="Map"||Kt==="Set")return Array.from(ee);if(Kt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Kt))return pt(ee,_t)}}function Ct(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function bt(ee,_t){return ht(ee)||lt(ee,_t)||vt(ee,_t)||Ct()}function zt(ee){var _t=Nt.useRef();_t.current=ee;var Kt=Nt.useCallback(function(){for(var pn,Ln=arguments.length,Ce=new Array(Ln),sn=0;sn<Ln;sn++)Ce[sn]=arguments[sn];return(pn=_t.current)===null||pn===void 0?void 0:pn.call.apply(pn,[_t].concat(Ce))},[]);return Kt}function Qt(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var ie=Qt()?Nt.useLayoutEffect:Nt.useEffect,oe=function(_t,Kt){var pn=Nt.useRef(!0);ie(function(){return _t(pn.current)},Kt),ie(function(){return pn.current=!1,function(){pn.current=!0}},[])},re=function(_t,Kt){oe(function(pn){if(!pn)return _t()},Kt)},Ne=null;function ue(ee){var _t=Nt.useRef(!1),Kt=Nt.useState(ee),pn=bt(Kt,2),Ln=pn[0],Ce=pn[1];Nt.useEffect(function(){return _t.current=!1,function(){_t.current=!0}},[]);function sn(cn,Jn){Jn&&_t.current||Ce(cn)}return[Ln,sn]}function ke(ee){return ee!==void 0}function Ke(ee,_t){var Kt=_t||{},pn=Kt.defaultValue,Ln=Kt.value,Ce=Kt.onChange,sn=Kt.postState,cn=ue(function(){return ke(Ln)?Ln:ke(pn)?typeof pn=="function"?pn():pn:typeof ee=="function"?ee():ee}),Jn=bt(cn,2),Sn=Jn[0],he=Jn[1],Te=Ln!==void 0?Ln:Sn,Nn=sn?sn(Te):Te,Bn=zt(Ce),Ht=ue([Te]),Mt=bt(Ht,2),wt=Mt[0],At=Mt[1];re(function(){var Et=wt[0];Sn!==Et&&Bn(Sn,Et)},[wt]),re(function(){ke(Ln)||he(Ln)},[Ln]);var Ut=zt(function(Et,be){he(Et,be),At([Te],be)});return[Nn,Ut]}var Fe={MAC_ENTER:3,BACKSPACE:8,TAB:9,NUM_CENTER:12,ENTER:13,SHIFT:16,CTRL:17,ALT:18,PAUSE:19,CAPS_LOCK:20,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,PRINT_SCREEN:44,INSERT:45,DELETE:46,ZERO:48,ONE:49,TWO:50,THREE:51,FOUR:52,FIVE:53,SIX:54,SEVEN:55,EIGHT:56,NINE:57,QUESTION_MARK:63,A:65,B:66,C:67,D:68,E:69,F:70,G:71,H:72,I:73,J:74,K:75,L:76,M:77,N:78,O:79,P:80,Q:81,R:82,S:83,T:84,U:85,V:86,W:87,X:88,Y:89,Z:90,META:91,WIN_KEY_RIGHT:92,CONTEXT_MENU:93,NUM_ZERO:96,NUM_ONE:97,NUM_TWO:98,NUM_THREE:99,NUM_FOUR:100,NUM_FIVE:101,NUM_SIX:102,NUM_SEVEN:103,NUM_EIGHT:104,NUM_NINE:105,NUM_MULTIPLY:106,NUM_PLUS:107,NUM_MINUS:109,NUM_PERIOD:110,NUM_DIVISION:111,F1:112,F2:113,F3:114,F4:115,F5:116,F6:117,F7:118,F8:119,F9:120,F10:121,F11:122,F12:123,NUMLOCK:144,SEMICOLON:186,DASH:189,EQUALS:187,COMMA:188,PERIOD:190,SLASH:191,APOSTROPHE:192,SINGLE_QUOTE:222,OPEN_SQUARE_BRACKET:219,BACKSLASH:220,CLOSE_SQUARE_BRACKET:221,WIN_KEY:224,MAC_FF_META:224,WIN_IME:229,isTextModifyingKeyEvent:function(_t){var Kt=_t.keyCode;if(_t.altKey&&!_t.ctrlKey||_t.metaKey||Kt>=Fe.F1&&Kt<=Fe.F12)return!1;switch(Kt){case Fe.ALT:case Fe.CAPS_LOCK:case Fe.CONTEXT_MENU:case Fe.CTRL:case Fe.DOWN:case Fe.END:case Fe.ESC:case Fe.HOME:case Fe.INSERT:case Fe.LEFT:case Fe.MAC_FF_META:case Fe.META:case Fe.NUMLOCK:case Fe.NUM_CENTER:case Fe.PAGE_DOWN:case Fe.PAGE_UP:case Fe.PAUSE:case Fe.PRINT_SCREEN:case Fe.RIGHT:case Fe.SHIFT:case Fe.UP:case Fe.WIN_KEY:case Fe.WIN_KEY_RIGHT:return!1;default:return!0}},isCharacterKey:function(_t){if(_t>=Fe.ZERO&&_t<=Fe.NINE||_t>=Fe.NUM_ZERO&&_t<=Fe.NUM_MULTIPLY||_t>=Fe.A&&_t<=Fe.Z||window.navigator.userAgent.indexOf("WebKit")!==-1&&_t===0)return!0;switch(_t){case Fe.SPACE:case Fe.QUESTION_MARK:case Fe.NUM_PLUS:case Fe.NUM_MINUS:case Fe.NUM_PERIOD:case Fe.NUM_DIVISION:case Fe.SEMICOLON:case Fe.DASH:case Fe.EQUALS:case Fe.COMMA:case Fe.PERIOD:case Fe.SLASH:case Fe.APOSTROPHE:case Fe.SINGLE_QUOTE:case Fe.OPEN_SQUARE_BRACKET:case Fe.BACKSLASH:case Fe.CLOSE_SQUARE_BRACKET:return!0;default:return!1}}},wn=Fe,Rn=["prefixCls","className","checked","defaultChecked","disabled","loadingIcon","checkedChildren","unCheckedChildren","onClick","onChange","onKeyDown"],$n=Nt.forwardRef(function(ee,_t){var Kt,pn=ee.prefixCls,Ln=pn===void 0?"rc-switch":pn,Ce=ee.className,sn=ee.checked,cn=ee.defaultChecked,Jn=ee.disabled,Sn=ee.loadingIcon,he=ee.checkedChildren,Te=ee.unCheckedChildren,Nn=ee.onClick,Bn=ee.onChange,Ht=ee.onKeyDown,Mt=tn(ee,Rn),wt=Ke(!1,{value:sn,defaultValue:cn}),At=ze(wt,2),Ut=At[0],Et=At[1];function be(ei,Qi){var Mn=Ut;return Jn||(Mn=ei,Et(Mn),Bn==null||Bn(Mn,Qi)),Mn}function Dn(ei){ei.which===wn.LEFT?be(!1,ei):ei.which===wn.RIGHT&&be(!0,ei),Ht==null||Ht(ei)}function zi(ei){var Qi=be(!Ut,ei);Nn==null||Nn(Qi,ei)}var yi=et()(Ln,Ce,(Kt={},Se(Kt,"".concat(Ln,"-checked"),Ut),Se(Kt,"".concat(Ln,"-disabled"),Jn),Kt));return Nt.createElement("button",It({},Mt,{type:"button",role:"switch","aria-checked":Ut,disabled:Jn,className:yi,ref:_t,onKeyDown:Dn,onClick:zi}),Sn,Nt.createElement("span",{className:"".concat(Ln,"-inner")},Nt.createElement("span",{className:"".concat(Ln,"-inner-checked")},he),Nt.createElement("span",{className:"".concat(Ln,"-inner-unchecked")},Te)))});$n.displayName="Switch";var di=$n},17341:function(on,In,Jt){"use strict";Jt.d(In,{S:function(){return $t}});var It=Jt(80334),ce=Jt(35381);function Be(He,ve){var Pe=new Set;return He.forEach(function(ze){ve.has(ze)||Pe.add(ze)}),Pe}function qe(He){var ve=He||{},Pe=ve.disabled,ze=ve.disableCheckbox,Me=ve.checkable;return!!(Pe||ze)||Me===!1}function Se(He,ve,Pe,ze){for(var Me=new Set(He),tn=new Set,Nt=0;Nt<=Pe;Nt+=1){var nt=ve.get(Nt)||new Set;nt.forEach(function(pt){var vt=pt.key,Ct=pt.node,bt=pt.children,zt=bt===void 0?[]:bt;Me.has(vt)&&!ze(Ct)&&zt.filter(function(Qt){return!ze(Qt.node)}).forEach(function(Qt){Me.add(Qt.key)})})}for(var et=new Set,ht=Pe;ht>=0;ht-=1){var lt=ve.get(ht)||new Set;lt.forEach(function(pt){var vt=pt.parent,Ct=pt.node;if(!(ze(Ct)||!pt.parent||et.has(pt.parent.key))){if(ze(pt.parent.node)){et.add(vt.key);return}var bt=!0,zt=!1;(vt.children||[]).filter(function(Qt){return!ze(Qt.node)}).forEach(function(Qt){var ie=Qt.key,oe=Me.has(ie);bt&&!oe&&(bt=!1),!zt&&(oe||tn.has(ie))&&(zt=!0)}),bt&&Me.add(vt.key),zt&&tn.add(vt.key),et.add(vt.key)}})}return{checkedKeys:Array.from(Me),halfCheckedKeys:Array.from(Be(tn,Me))}}function de(He,ve,Pe,ze,Me){for(var tn=new Set(He),Nt=new Set(ve),nt=0;nt<=ze;nt+=1){var et=Pe.get(nt)||new Set;et.forEach(function(vt){var Ct=vt.key,bt=vt.node,zt=vt.children,Qt=zt===void 0?[]:zt;!tn.has(Ct)&&!Nt.has(Ct)&&!Me(bt)&&Qt.filter(function(ie){return!Me(ie.node)}).forEach(function(ie){tn.delete(ie.key)})})}Nt=new Set;for(var ht=new Set,lt=ze;lt>=0;lt-=1){var pt=Pe.get(lt)||new Set;pt.forEach(function(vt){var Ct=vt.parent,bt=vt.node;if(!(Me(bt)||!vt.parent||ht.has(vt.parent.key))){if(Me(vt.parent.node)){ht.add(Ct.key);return}var zt=!0,Qt=!1;(Ct.children||[]).filter(function(ie){return!Me(ie.node)}).forEach(function(ie){var oe=ie.key,re=tn.has(oe);zt&&!re&&(zt=!1),!Qt&&(re||Nt.has(oe))&&(Qt=!0)}),zt||tn.delete(Ct.key),Qt&&Nt.add(Ct.key),ht.add(Ct.key)}})}return{checkedKeys:Array.from(tn),halfCheckedKeys:Array.from(Be(Nt,tn))}}function $t(He,ve,Pe,ze){var Me=[],tn;ze?tn=ze:tn=qe;var Nt=new Set(He.filter(function(lt){var pt=!!(0,ce.Z)(Pe,lt);return pt||Me.push(lt),pt})),nt=new Map,et=0;Object.keys(Pe).forEach(function(lt){var pt=Pe[lt],vt=pt.level,Ct=nt.get(vt);Ct||(Ct=new Set,nt.set(vt,Ct)),Ct.add(pt),et=Math.max(et,vt)}),(0,It.ZP)(!Me.length,"Tree missing follow keys: ".concat(Me.slice(0,100).map(function(lt){return"'".concat(lt,"'")}).join(", ")));var ht;return ve===!0?ht=Se(Nt,nt,et,tn):ht=de(Nt,ve.halfCheckedKeys,nt,et,tn),ht}},35381:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return It}});function It(ce,Be){return ce[Be]}},1089:function(on,In,Jt){"use strict";Jt.d(In,{F:function(){return vt},H8:function(){return pt},I8:function(){return lt},km:function(){return Me},oH:function(){return et},w$:function(){return tn},zn:function(){return nt}});var It=Jt(71002),ce=Jt(74902),Be=Jt(1413),qe=Jt(45987),Se=Jt(50344),de=Jt(98423),$t=Jt(80334),He=Jt(35381),ve=["children"];function Pe(Ct,bt){return"".concat(Ct,"-").concat(bt)}function ze(Ct){return Ct&&Ct.type&&Ct.type.isTreeNode}function Me(Ct,bt){return Ct!=null?Ct:bt}function tn(Ct){var bt=Ct||{},zt=bt.title,Qt=bt._title,ie=bt.key,oe=bt.children,re=zt||"title";return{title:re,_title:Qt||[re],key:ie||"key",children:oe||"children"}}function Nt(Ct,bt){var zt=new Map;function Qt(ie){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(ie||[]).forEach(function(re){var Ne=re[bt.key],ue=re[bt.children];warning(Ne!=null,"Tree node must have a certain key: [".concat(oe).concat(Ne,"]"));var ke=String(Ne);warning(!zt.has(ke)||Ne===null||Ne===void 0,"Same 'key' exist in the Tree: ".concat(ke)),zt.set(ke,!0),Qt(ue,"".concat(oe).concat(ke," > "))})}Qt(Ct)}function nt(Ct){function bt(zt){var Qt=(0,Se.Z)(zt);return Qt.map(function(ie){if(!ze(ie))return(0,$t.ZP)(!ie,"Tree/TreeNode can only accept TreeNode as children."),null;var oe=ie.key,re=ie.props,Ne=re.children,ue=(0,qe.Z)(re,ve),ke=(0,Be.Z)({key:oe},ue),Ke=bt(Ne);return Ke.length&&(ke.children=Ke),ke}).filter(function(ie){return ie})}return bt(Ct)}function et(Ct,bt,zt){var Qt=tn(zt),ie=Qt._title,oe=Qt.key,re=Qt.children,Ne=new Set(bt===!0?[]:bt),ue=[];function ke(Ke){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return Ke.map(function(wn,Rn){for(var $n=Pe(Fe?Fe.pos:"0",Rn),di=Me(wn[oe],$n),ee,_t=0;_t<ie.length;_t+=1){var Kt=ie[_t];if(wn[Kt]!==void 0){ee=wn[Kt];break}}var pn=Object.assign((0,de.Z)(wn,[].concat((0,ce.Z)(ie),[oe,re])),{title:ee,key:di,parent:Fe,pos:$n,children:null,data:wn,isStart:[].concat((0,ce.Z)(Fe?Fe.isStart:[]),[Rn===0]),isEnd:[].concat((0,ce.Z)(Fe?Fe.isEnd:[]),[Rn===Ke.length-1])});return ue.push(pn),bt===!0||Ne.has(di)?pn.children=ke(wn[re]||[],pn):pn.children=[],pn})}return ke(Ct),ue}function ht(Ct,bt,zt){var Qt={};(0,It.Z)(zt)==="object"?Qt=zt:Qt={externalGetKey:zt},Qt=Qt||{};var ie=Qt,oe=ie.childrenPropName,re=ie.externalGetKey,Ne=ie.fieldNames,ue=tn(Ne),ke=ue.key,Ke=ue.children,Fe=oe||Ke,wn;re?typeof re=="string"?wn=function(di){return di[re]}:typeof re=="function"&&(wn=function(di){return re(di)}):wn=function(di,ee){return Me(di[ke],ee)};function Rn($n,di,ee,_t){var Kt=$n?$n[Fe]:Ct,pn=$n?Pe(ee.pos,di):"0",Ln=$n?[].concat((0,ce.Z)(_t),[$n]):[];if($n){var Ce=wn($n,pn),sn={node:$n,index:di,pos:pn,key:Ce,parentPos:ee.node?ee.pos:null,level:ee.level+1,nodes:Ln};bt(sn)}Kt&&Kt.forEach(function(cn,Jn){Rn(cn,Jn,{node:$n,pos:pn,level:ee?ee.level+1:-1},Ln)})}Rn(null)}function lt(Ct){var bt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},zt=bt.initWrapper,Qt=bt.processEntity,ie=bt.onProcessFinished,oe=bt.externalGetKey,re=bt.childrenPropName,Ne=bt.fieldNames,ue=arguments.length>2?arguments[2]:void 0,ke=oe||ue,Ke={},Fe={},wn={posEntities:Ke,keyEntities:Fe};return zt&&(wn=zt(wn)||wn),ht(Ct,function(Rn){var $n=Rn.node,di=Rn.index,ee=Rn.pos,_t=Rn.key,Kt=Rn.parentPos,pn=Rn.level,Ln=Rn.nodes,Ce={node:$n,nodes:Ln,index:di,key:_t,pos:ee,level:pn},sn=Me(_t,ee);Ke[ee]=Ce,Fe[sn]=Ce,Ce.parent=Ke[Kt],Ce.parent&&(Ce.parent.children=Ce.parent.children||[],Ce.parent.children.push(Ce)),Qt&&Qt(Ce,wn)},{externalGetKey:ke,childrenPropName:re,fieldNames:Ne}),ie&&ie(wn),wn}function pt(Ct,bt){var zt=bt.expandedKeys,Qt=bt.selectedKeys,ie=bt.loadedKeys,oe=bt.loadingKeys,re=bt.checkedKeys,Ne=bt.halfCheckedKeys,ue=bt.dragOverNodeKey,ke=bt.dropPosition,Ke=bt.keyEntities,Fe=(0,He.Z)(Ke,Ct),wn={eventKey:Ct,expanded:zt.indexOf(Ct)!==-1,selected:Qt.indexOf(Ct)!==-1,loaded:ie.indexOf(Ct)!==-1,loading:oe.indexOf(Ct)!==-1,checked:re.indexOf(Ct)!==-1,halfChecked:Ne.indexOf(Ct)!==-1,pos:String(Fe?Fe.pos:""),dragOver:ue===Ct&&ke===0,dragOverGapTop:ue===Ct&&ke===-1,dragOverGapBottom:ue===Ct&&ke===1};return wn}function vt(Ct){var bt=Ct.data,zt=Ct.expanded,Qt=Ct.selected,ie=Ct.checked,oe=Ct.loaded,re=Ct.loading,Ne=Ct.halfChecked,ue=Ct.dragOver,ke=Ct.dragOverGapTop,Ke=Ct.dragOverGapBottom,Fe=Ct.pos,wn=Ct.active,Rn=Ct.eventKey,$n=(0,Be.Z)((0,Be.Z)({},bt),{},{expanded:zt,selected:Qt,checked:ie,loaded:oe,loading:re,halfChecked:Ne,dragOver:ue,dragOverGapTop:ke,dragOverGapBottom:Ke,pos:Fe,active:wn,key:Rn});return"props"in $n||Object.defineProperty($n,"props",{get:function(){return(0,$t.ZP)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),Ct}}),$n}},73299:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return bs}});var It=Jt(87462),ce=Jt(1413),Be=Jt(71002),qe=Jt(97685),Se=Jt(4942),de=Jt(45987),$t=Jt(67294),He=Jt(73935),ve=Jt(94184),Pe=Jt.n(ve),ze=Jt(48555),Me=$t.forwardRef(function(Qe,xt){var En=Qe.height,mn=Qe.offsetY,bi=Qe.offsetX,gi=Qe.children,fi=Qe.prefixCls,Gi=Qe.onInnerResize,br=Qe.innerProps,Le=Qe.rtl,Ie=Qe.extra,le={},Oe={display:"flex",flexDirection:"column"};if(mn!==void 0){var On;le={height:En,position:"relative",overflow:"hidden"},Oe=(0,ce.Z)((0,ce.Z)({},Oe),{},(On={transform:"translateY(".concat(mn,"px)")},(0,Se.Z)(On,Le?"marginRight":"marginLeft",-bi),(0,Se.Z)(On,"position","absolute"),(0,Se.Z)(On,"left",0),(0,Se.Z)(On,"right",0),(0,Se.Z)(On,"top",0),On))}return $t.createElement("div",{style:le},$t.createElement(ze.Z,{onResize:function(Mi){var xe=Mi.offsetHeight;xe&&Gi&&Gi()}},$t.createElement("div",(0,It.Z)({style:Oe,className:Pe()((0,Se.Z)({},"".concat(fi,"-holder-inner"),fi)),ref:xt},br),gi,Ie)))});Me.displayName="Filler";var tn=Me,Nt=function(xt){return+setTimeout(xt,16)},nt=function(xt){return clearTimeout(xt)};typeof window!="undefined"&&"requestAnimationFrame"in window&&(Nt=function(xt){return window.requestAnimationFrame(xt)},nt=function(xt){return window.cancelAnimationFrame(xt)});var et=0,ht=new Map;function lt(Qe){ht.delete(Qe)}var pt=function(xt){var En=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;et+=1;var mn=et;function bi(gi){if(gi===0)lt(mn),xt();else{var fi=Nt(function(){bi(gi-1)});ht.set(mn,fi)}}return bi(En),mn};pt.cancel=function(Qe){var xt=ht.get(Qe);return lt(xt),nt(xt)};var vt=pt;function Ct(Qe,xt){var En="touches"in Qe?Qe.touches[0]:Qe;return En[xt?"pageX":"pageY"]}var bt=$t.forwardRef(function(Qe,xt){var En,mn=Qe.prefixCls,bi=Qe.rtl,gi=Qe.scrollOffset,fi=Qe.scrollRange,Gi=Qe.onStartMove,br=Qe.onStopMove,Le=Qe.onScroll,Ie=Qe.horizontal,le=Qe.spinSize,Oe=Qe.containerSize,On=Qe.style,Wn=Qe.thumbStyle,Mi=$t.useState(!1),xe=(0,qe.Z)(Mi,2),Xe=xe[0],Zn=xe[1],Oi=$t.useState(null),an=(0,qe.Z)(Oi,2),fe=an[0],An=an[1],ri=$t.useState(null),Ki=(0,qe.Z)(ri,2),Ue=Ki[0],Gn=Ki[1],uo=!bi,zo=$t.useRef(),$r=$t.useRef(),Kn=$t.useState(!1),zn=(0,qe.Z)(Kn,2),qn=zn[0],Ir=zn[1],no=$t.useRef(),hn=function(){clearTimeout(no.current),Ir(!0),no.current=setTimeout(function(){Ir(!1)},3e3)},ci=fi-Oe||0,Za=Oe-le||0,Ps=ci>0,rs=$t.useMemo(function(){if(gi===0||ci===0)return 0;var ur=gi/ci;return ur*Za},[gi,ci,Za]),me=function(Wr){Wr.stopPropagation(),Wr.preventDefault()},xi=$t.useRef({top:rs,dragging:Xe,pageY:fe,startTop:Ue});xi.current={top:rs,dragging:Xe,pageY:fe,startTop:Ue};var gr=function(Wr){Zn(!0),An(Ct(Wr,Ie)),Gn(xi.current.top),Gi(),Wr.stopPropagation(),Wr.preventDefault()};$t.useEffect(function(){var ur=function(Ye){Ye.preventDefault()},Wr=zo.current,Ve=$r.current;return Wr.addEventListener("touchstart",ur),Ve.addEventListener("touchstart",gr),function(){Wr.removeEventListener("touchstart",ur),Ve.removeEventListener("touchstart",gr)}},[]);var ai=$t.useRef();ai.current=ci;var ho=$t.useRef();ho.current=Za,$t.useEffect(function(){if(Xe){var ur,Wr=function(Ye){var qr=xi.current,ma=qr.dragging,Co=qr.pageY,hl=qr.startTop;if(vt.cancel(ur),ma){var Fo=Ct(Ye,Ie)-Co,vr=hl;!uo&&Ie?vr-=Fo:vr+=Fo;var Ao=ai.current,Ja=ho.current,To=Ja?vr/Ja:0,xn=Math.ceil(To*Ao);xn=Math.max(xn,0),xn=Math.min(xn,Ao),ur=vt(function(){Le(xn,Ie)})}},Ve=function(){Zn(!1),br()};return window.addEventListener("mousemove",Wr),window.addEventListener("touchmove",Wr),window.addEventListener("mouseup",Ve),window.addEventListener("touchend",Ve),function(){window.removeEventListener("mousemove",Wr),window.removeEventListener("touchmove",Wr),window.removeEventListener("mouseup",Ve),window.removeEventListener("touchend",Ve),vt.cancel(ur)}}},[Xe]),$t.useEffect(function(){hn()},[gi]),$t.useImperativeHandle(xt,function(){return{delayHidden:hn}});var pr="".concat(mn,"-scrollbar"),Sr={position:"absolute",visibility:qn&&Ps?null:"hidden"},lr={position:"absolute",background:"rgba(0, 0, 0, 0.5)",borderRadius:99,cursor:"pointer",userSelect:"none"};return Ie?(Sr.height=8,Sr.left=0,Sr.right=0,Sr.bottom=0,lr.height="100%",lr.width=le,uo?lr.left=rs:lr.right=rs):(Sr.width=8,Sr.top=0,Sr.bottom=0,uo?Sr.right=0:Sr.left=0,lr.width="100%",lr.height=le,lr.top=rs),$t.createElement("div",{ref:zo,className:Pe()(pr,(En={},(0,Se.Z)(En,"".concat(pr,"-horizontal"),Ie),(0,Se.Z)(En,"".concat(pr,"-vertical"),!Ie),(0,Se.Z)(En,"".concat(pr,"-visible"),qn),En)),style:(0,ce.Z)((0,ce.Z)({},Sr),On),onMouseDown:me,onMouseMove:hn},$t.createElement("div",{ref:$r,className:Pe()("".concat(pr,"-thumb"),(0,Se.Z)({},"".concat(pr,"-thumb-moving"),Xe)),style:(0,ce.Z)((0,ce.Z)({},lr),Wn),onMouseDown:gr}))}),zt=bt;function Qt(Qe){var xt=Qe.children,En=Qe.setRef,mn=$t.useCallback(function(bi){En(bi)},[]);return $t.cloneElement(xt,{ref:mn})}function ie(Qe,xt,En,mn,bi,gi,fi){var Gi=fi.getKey;return Qe.slice(xt,En+1).map(function(br,Le){var Ie=xt+Le,le=gi(br,Ie,{style:{width:mn}}),Oe=Gi(br);return $t.createElement(Qt,{key:Oe,setRef:function(Wn){return bi(br,Wn)}},le)})}function oe(Qe){return Qe instanceof HTMLElement||Qe instanceof SVGElement}function re(Qe){return oe(Qe)?Qe:Qe instanceof $t.Component?He.findDOMNode(Qe):null}var Ne=Jt(15671),ue=Jt(43144),ke=function(){function Qe(){(0,Ne.Z)(this,Qe),this.maps=void 0,this.id=0,this.maps=Object.create(null)}return(0,ue.Z)(Qe,[{key:"set",value:function(En,mn){this.maps[En]=mn,this.id+=1}},{key:"get",value:function(En){return this.maps[En]}}]),Qe}(),Ke=ke;function Fe(Qe,xt,En){var mn=$t.useState(0),bi=(0,qe.Z)(mn,2),gi=bi[0],fi=bi[1],Gi=(0,$t.useRef)(new Map),br=(0,$t.useRef)(new Ke),Le=(0,$t.useRef)();function Ie(){vt.cancel(Le.current)}function le(){var On=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;Ie();var Wn=function(){Gi.current.forEach(function(xe,Xe){if(xe&&xe.offsetParent){var Zn=re(xe),Oi=Zn.offsetHeight;br.current.get(Xe)!==Oi&&br.current.set(Xe,Zn.offsetHeight)}}),fi(function(xe){return xe+1})};On?Wn():Le.current=vt(Wn)}function Oe(On,Wn){var Mi=Qe(On),xe=Gi.current.get(Mi);Wn?(Gi.current.set(Mi,Wn),le()):Gi.current.delete(Mi),!xe!=!Wn&&(Wn?xt==null||xt(On):En==null||En(On))}return(0,$t.useEffect)(function(){return Ie},[]),[Oe,le,br.current,gi]}function wn(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Rn=wn()?$t.useLayoutEffect:$t.useEffect,$n=function(xt,En){var mn=$t.useRef(!0);Rn(function(){return xt(mn.current)},En),Rn(function(){return mn.current=!1,function(){mn.current=!0}},[])},di=function(xt,En){$n(function(mn){if(!mn)return xt()},En)},ee=$n;function _t(Qe){var xt=$t.useRef();xt.current=Qe;var En=$t.useCallback(function(){for(var mn,bi=arguments.length,gi=new Array(bi),fi=0;fi<bi;fi++)gi[fi]=arguments[fi];return(mn=xt.current)===null||mn===void 0?void 0:mn.call.apply(mn,[xt].concat(gi))},[]);return En}function Kt(Qe){var xt=React.useRef(!1),En=React.useState(Qe),mn=_slicedToArray(En,2),bi=mn[0],gi=mn[1];React.useEffect(function(){return xt.current=!1,function(){xt.current=!0}},[]);function fi(Gi,br){br&&xt.current||gi(Gi)}return[bi,fi]}function pn(Qe){return Qe!==void 0}function Ln(Qe,xt){var En=xt||{},mn=En.defaultValue,bi=En.value,gi=En.onChange,fi=En.postState,Gi=useState(function(){return pn(bi)?bi:pn(mn)?typeof mn=="function"?mn():mn:typeof Qe=="function"?Qe():Qe}),br=_slicedToArray(Gi,2),Le=br[0],Ie=br[1],le=bi!==void 0?bi:Le,Oe=fi?fi(le):le,On=useEvent(gi),Wn=useState([le]),Mi=_slicedToArray(Wn,2),xe=Mi[0],Xe=Mi[1];useLayoutUpdateEffect(function(){var Oi=xe[0];Le!==Oi&&On(Le,Oi)},[xe]),useLayoutUpdateEffect(function(){pn(bi)||Ie(bi)},[bi]);var Zn=useEvent(function(Oi,an){Ie(Oi,an),Xe([le],an)});return[Oe,Zn]}var Ce=Jt(31461);function sn(Qe,xt,En){var mn=React.useRef({});return(!("value"in mn.current)||En(mn.current.condition,xt))&&(mn.current.value=Qe(),mn.current.condition=xt),mn.current.value}function cn(Qe,xt){typeof Qe=="function"?Qe(xt):_typeof(Qe)==="object"&&Qe&&"current"in Qe&&(Qe.current=xt)}function Jn(){for(var Qe=arguments.length,xt=new Array(Qe),En=0;En<Qe;En++)xt[En]=arguments[En];var mn=xt.filter(function(bi){return bi});return mn.length<=1?mn[0]:function(bi){xt.forEach(function(gi){cn(gi,bi)})}}function Sn(){for(var Qe=arguments.length,xt=new Array(Qe),En=0;En<Qe;En++)xt[En]=arguments[En];return useMemo(function(){return Jn.apply(void 0,xt)},xt,function(mn,bi){return mn.length!==bi.length||mn.every(function(gi,fi){return gi!==bi[fi]})})}function he(Qe){var xt,En,mn=isMemo(Qe)?Qe.type.type:Qe.type;return!(typeof mn=="function"&&!((xt=mn.prototype)!==null&&xt!==void 0&&xt.render)||typeof Qe=="function"&&!((En=Qe.prototype)!==null&&En!==void 0&&En.render))}function Te(Qe){return!isValidElement(Qe)||isFragment(Qe)?!1:he(Qe)}function Nn(Qe,xt,En,mn){if(!xt.length)return En;var bi=_toArray(xt),gi=bi[0],fi=bi.slice(1),Gi;return!Qe&&typeof gi=="number"?Gi=[]:Array.isArray(Qe)?Gi=_toConsumableArray(Qe):Gi=_objectSpread({},Qe),mn&&En===void 0&&fi.length===1?delete Gi[gi][fi[0]]:Gi[gi]=Nn(Gi[gi],fi,En,mn),Gi}function Bn(Qe,xt,En){var mn=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;return xt.length&&mn&&En===void 0&&!get(Qe,xt.slice(0,-1))?Qe:Nn(Qe,xt,En,mn)}function Ht(Qe){return _typeof(Qe)==="object"&&Qe!==null&&Object.getPrototypeOf(Qe)===Object.prototype}function Mt(Qe){return Array.isArray(Qe)?[]:{}}var wt=typeof Reflect=="undefined"?Object.keys:Reflect.ownKeys;function At(){for(var Qe=arguments.length,xt=new Array(Qe),En=0;En<Qe;En++)xt[En]=arguments[En];var mn=Mt(xt[0]);return xt.forEach(function(bi){function gi(fi,Gi){var br=new Set(Gi),Le=get(bi,fi),Ie=Array.isArray(Le);if(Ie||Ht(Le)){if(!br.has(Le)){br.add(Le);var le=get(mn,fi);Ie?mn=Bn(mn,fi,[]):(!le||_typeof(le)!=="object")&&(mn=Bn(mn,fi,Mt(Le))),wt(Le).forEach(function(Oe){gi([].concat(_toConsumableArray(fi),[Oe]),br)})}}else mn=Bn(mn,fi,Le)}gi([])}),mn}var Ut={},Et=[],be=function(xt){Et.push(xt)};function Dn(Qe,xt){if(0)var En}function zi(Qe,xt){if(0)var En}function yi(){Ut={}}function ei(Qe,xt,En){!xt&&!Ut[En]&&(Qe(!1,En),Ut[En]=!0)}function Qi(Qe,xt){ei(Dn,Qe,xt)}function Mn(Qe,xt){ei(zi,Qe,xt)}Qi.preMessage=be,Qi.resetWarned=yi,Qi.noteOnce=Mn;var sr=null,Yi=10;function Vr(Qe,xt,En,mn,bi,gi,fi,Gi){var br=$t.useRef(),Le=$t.useState(null),Ie=(0,qe.Z)(Le,2),le=Ie[0],Oe=Ie[1];return ee(function(){if(le&&le.times<Yi){if(!Qe.current){Oe(function(hn){return(0,ce.Z)({},hn)});return}gi();var On=le.targetAlign,Wn=le.originAlign,Mi=le.index,xe=le.offset,Xe=Qe.current.clientHeight,Zn=!1,Oi=On,an=null;if(Xe){for(var fe=On||Wn,An=0,ri=0,Ki=0,Ue=Math.min(xt.length-1,Mi),Gn=0;Gn<=Ue;Gn+=1){var uo=bi(xt[Gn]);ri=An;var zo=En.get(uo);Ki=ri+(zo===void 0?mn:zo),An=Ki}for(var $r=fe==="top"?xe:Xe-xe,Kn=Ue;Kn>=0;Kn-=1){var zn=bi(xt[Kn]),qn=En.get(zn);if(qn===void 0){Zn=!0;break}if($r-=qn,$r<=0)break}switch(fe){case"top":an=ri-xe;break;case"bottom":an=Ki-Xe+xe;break;default:{var Ir=Qe.current.scrollTop,no=Ir+Xe;ri<Ir?Oi="top":Ki>no&&(Oi="bottom")}}an!==null&&fi(an),an!==le.lastTop&&(Zn=!0)}Zn&&Oe(function(hn){return(0,ce.Z)((0,ce.Z)({},hn),{},{times:hn.times+1,targetAlign:Oi,lastTop:an})})}},[le,Qe.current]),function(On){if(On==null){Gi();return}if(vt.cancel(br.current),typeof On=="number")fi(On);else if(On&&(0,Be.Z)(On)==="object"){var Wn,Mi=On.align;"index"in On?Wn=On.index:Wn=xt.findIndex(function(Zn){return bi(Zn)===On.key});var xe=On.offset,Xe=xe===void 0?0:xe;Oe({times:0,index:Wn,offset:Xe,originAlign:Mi})}}}function Ci(Qe,xt,En,mn){var bi=En-Qe,gi=xt-En,fi=Math.min(bi,gi)*2;if(mn<=fi){var Gi=Math.floor(mn/2);return mn%2?En+Gi+1:En-Gi}return bi>gi?En-(mn-gi):En+(mn-bi)}function Us(Qe,xt,En){var mn=Qe.length,bi=xt.length,gi,fi;if(mn===0&&bi===0)return null;mn<bi?(gi=Qe,fi=xt):(gi=xt,fi=Qe);var Gi={__EMPTY_ITEM__:!0};function br(Wn){return Wn!==void 0?En(Wn):Gi}for(var Le=null,Ie=Math.abs(mn-bi)!==1,le=0;le<fi.length;le+=1){var Oe=br(gi[le]),On=br(fi[le]);if(Oe!==On){Le=le,Ie=Ie||Oe!==br(fi[le+1]);break}}return Le===null?null:{index:Le,multiple:Ie}}function is(Qe,xt,En){var mn=$t.useState(Qe),bi=(0,qe.Z)(mn,2),gi=bi[0],fi=bi[1],Gi=$t.useState(null),br=(0,qe.Z)(Gi,2),Le=br[0],Ie=br[1];return $t.useEffect(function(){var le=Us(gi||[],Qe||[],xt);(le==null?void 0:le.index)!==void 0&&(En==null||En(le.index),Ie(Qe[le.index])),fi(Qe)},[Qe]),[Le]}var xo=(typeof navigator=="undefined"?"undefined":(0,Be.Z)(navigator))==="object"&&/Firefox/i.test(navigator.userAgent),zr=xo,wl=function(Qe,xt){var En=(0,$t.useRef)(!1),mn=(0,$t.useRef)(null);function bi(){clearTimeout(mn.current),En.current=!0,mn.current=setTimeout(function(){En.current=!1},50)}var gi=(0,$t.useRef)({top:Qe,bottom:xt});return gi.current.top=Qe,gi.current.bottom=xt,function(fi){var Gi=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,br=fi<0&&gi.current.top||fi>0&&gi.current.bottom;return Gi&&br?(clearTimeout(mn.current),En.current=!1):(!br||En.current)&&bi(),!En.current&&br}};function Li(Qe,xt,En,mn,bi){var gi=(0,$t.useRef)(0),fi=(0,$t.useRef)(null),Gi=(0,$t.useRef)(null),br=(0,$t.useRef)(!1),Le=wl(xt,En);function Ie(xe,Xe){vt.cancel(fi.current),gi.current+=Xe,Gi.current=Xe,!Le(Xe)&&(zr||xe.preventDefault(),fi.current=vt(function(){var Zn=br.current?10:1;bi(gi.current*Zn),gi.current=0}))}function le(xe,Xe){bi(Xe,!0),zr||xe.preventDefault()}var Oe=(0,$t.useRef)(null),On=(0,$t.useRef)(null);function Wn(xe){if(Qe){vt.cancel(On.current),On.current=vt(function(){Oe.current=null},2);var Xe=xe.deltaX,Zn=xe.deltaY,Oi=xe.shiftKey,an=Xe,fe=Zn;(Oe.current==="sx"||!Oe.current&&Oi&&Zn&&!Xe)&&(an=Zn,fe=0,Oe.current="sx");var An=Math.abs(an),ri=Math.abs(fe);Oe.current===null&&(Oe.current=mn&&An>ri?"x":"y"),Oe.current==="y"?Ie(xe,fe):le(xe,an)}}function Mi(xe){Qe&&(br.current=xe.detail===Gi.current)}return[Wn,Mi]}var qi=14/15;function aa(Qe,xt,En){var mn=(0,$t.useRef)(!1),bi=(0,$t.useRef)(0),gi=(0,$t.useRef)(null),fi=(0,$t.useRef)(null),Gi,br=function(Oe){if(mn.current){var On=Math.ceil(Oe.touches[0].pageY),Wn=bi.current-On;bi.current=On,En(Wn)&&Oe.preventDefault(),clearInterval(fi.current),fi.current=setInterval(function(){Wn*=qi,(!En(Wn,!0)||Math.abs(Wn)<=.1)&&clearInterval(fi.current)},16)}},Le=function(){mn.current=!1,Gi()},Ie=function(Oe){Gi(),Oe.touches.length===1&&!mn.current&&(mn.current=!0,bi.current=Math.ceil(Oe.touches[0].pageY),gi.current=Oe.target,gi.current.addEventListener("touchmove",br),gi.current.addEventListener("touchend",Le))};Gi=function(){gi.current&&(gi.current.removeEventListener("touchmove",br),gi.current.removeEventListener("touchend",Le))},ee(function(){return Qe&&xt.current.addEventListener("touchstart",Ie),function(){var le;(le=xt.current)===null||le===void 0||le.removeEventListener("touchstart",Ie),Gi(),clearInterval(fi.current)}},[Qe])}var Oa=20;function Or(){var Qe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,xt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,En=Qe/xt*100;return isNaN(En)&&(En=0),En=Math.max(En,Oa),En=Math.min(En,Qe/2),Math.floor(En)}function Il(Qe,xt,En,mn){var bi=$t.useMemo(function(){return[new Map,[]]},[Qe,En.id,mn]),gi=(0,qe.Z)(bi,2),fi=gi[0],Gi=gi[1],br=function(Ie){var le=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Ie,Oe=fi.get(Ie),On=fi.get(le);if(Oe===void 0||On===void 0)for(var Wn=Qe.length,Mi=Gi.length;Mi<Wn;Mi+=1){var xe,Xe=Qe[Mi],Zn=xt(Xe);fi.set(Zn,Mi);var Oi=(xe=En.get(Zn))!==null&&xe!==void 0?xe:mn;if(Gi[Mi]=(Gi[Mi-1]||0)+Oi,Zn===Ie&&(Oe=Mi),Zn===le&&(On=Mi),Oe!==void 0&&On!==void 0)break}return{top:Gi[Oe-1]||0,bottom:Gi[On]}};return br}var ku=["prefixCls","className","height","itemHeight","fullHeight","style","data","children","itemKey","virtual","direction","scrollWidth","component","onScroll","onVirtualScroll","onVisibleChange","innerProps","extraRender","styles"],bu=[],Rh={overflowY:"auto",overflowAnchor:"none"};function Xl(Qe,xt){var En=Qe.prefixCls,mn=En===void 0?"rc-virtual-list":En,bi=Qe.className,gi=Qe.height,fi=Qe.itemHeight,Gi=Qe.fullHeight,br=Gi===void 0?!0:Gi,Le=Qe.style,Ie=Qe.data,le=Qe.children,Oe=Qe.itemKey,On=Qe.virtual,Wn=Qe.direction,Mi=Qe.scrollWidth,xe=Qe.component,Xe=xe===void 0?"div":xe,Zn=Qe.onScroll,Oi=Qe.onVirtualScroll,an=Qe.onVisibleChange,fe=Qe.innerProps,An=Qe.extraRender,ri=Qe.styles,Ki=(0,de.Z)(Qe,ku),Ue=!!(On!==!1&&gi&&fi),Gn=Ue&&Ie&&(fi*Ie.length>gi||!!Mi),uo=Wn==="rtl",zo=Pe()(mn,(0,Se.Z)({},"".concat(mn,"-rtl"),uo),bi),$r=Ie||bu,Kn=(0,$t.useRef)(),zn=(0,$t.useRef)(),qn=(0,$t.useState)(0),Ir=(0,qe.Z)(qn,2),no=Ir[0],hn=Ir[1],ci=(0,$t.useState)(0),Za=(0,qe.Z)(ci,2),Ps=Za[0],rs=Za[1],me=(0,$t.useState)(!1),xi=(0,qe.Z)(me,2),gr=xi[0],ai=xi[1],ho=function(){ai(!0)},pr=function(){ai(!1)},Sr=$t.useCallback(function(nr){return typeof Oe=="function"?Oe(nr):nr==null?void 0:nr[Oe]},[Oe]),lr={getKey:Sr};function ur(nr){hn(function(mr){var vo;typeof nr=="function"?vo=nr(mr):vo=nr;var ss=Ii(vo);return Kn.current.scrollTop=ss,ss})}var Wr=(0,$t.useRef)({start:0,end:$r.length}),Ve=(0,$t.useRef)(),Ko=is($r,Sr),Ye=(0,qe.Z)(Ko,1),qr=Ye[0];Ve.current=qr;var ma=Fe(Sr,null,null),Co=(0,qe.Z)(ma,4),hl=Co[0],Fo=Co[1],vr=Co[2],Ao=Co[3],Ja=$t.useMemo(function(){if(!Ue)return{scrollHeight:void 0,start:0,end:$r.length-1,offset:void 0};if(!Gn){var nr;return{scrollHeight:((nr=zn.current)===null||nr===void 0?void 0:nr.offsetHeight)||0,start:0,end:$r.length-1,offset:void 0}}for(var mr=0,vo,ss,ni,kf=$r.length,hu=0;hu<kf;hu+=1){var Zl=$r[hu],dd=Sr(Zl),fd=vr.get(dd),yn=mr+(fd===void 0?fi:fd);yn>=no&&vo===void 0&&(vo=hu,ss=mr),yn>no+gi&&ni===void 0&&(ni=hu),mr=yn}return vo===void 0&&(vo=0,ss=0,ni=Math.ceil(gi/fi)),ni===void 0&&(ni=$r.length-1),ni=Math.min(ni+1,$r.length-1),{scrollHeight:mr,start:vo,end:ni,offset:ss}},[Gn,Ue,no,$r,Ao,gi]),To=Ja.scrollHeight,xn=Ja.start,jt=Ja.end,cs=Ja.offset;Wr.current.start=xn,Wr.current.end=jt;var Eu=$t.useState({width:0,height:gi}),Fu=(0,qe.Z)(Eu,2),dl=Fu[0],ch=Fu[1],Xu=function(mr){ch({width:mr.width||mr.offsetWidth,height:mr.height||mr.offsetHeight})},ud=(0,$t.useRef)(),jh=(0,$t.useRef)(),Lo=$t.useMemo(function(){return Or(dl.width,Mi)},[dl.width,Mi]),gs=$t.useMemo(function(){return Or(dl.height,To)},[dl.height,To]),wi=To-gi,li=(0,$t.useRef)(wi);li.current=wi;function Ii(nr){var mr=nr;return Number.isNaN(li.current)||(mr=Math.min(mr,li.current)),mr=Math.max(mr,0),mr}var Ze=no<=0,Rr=no>=wi,fo=wl(Ze,Rr),ls=function(){return{x:uo?-Ps:Ps,y:no}},Mo=(0,$t.useRef)(ls()),$o=_t(function(){if(Oi){var nr=ls();(Mo.current.x!==nr.x||Mo.current.y!==nr.y)&&(Oi(nr),Mo.current=nr)}});function Es(nr,mr){var vo=nr;mr?((0,He.flushSync)(function(){rs(vo)}),$o()):ur(vo)}function va(nr){var mr=nr.currentTarget.scrollTop;mr!==no&&ur(mr),Zn==null||Zn(nr),$o()}var la=function(mr){var vo=mr,ss=Mi-dl.width;return vo=Math.max(vo,0),vo=Math.min(vo,ss),vo},Zu=_t(function(nr,mr){mr?((0,He.flushSync)(function(){rs(function(vo){var ss=vo+(uo?-nr:nr);return la(ss)})}),$o()):ur(function(vo){var ss=vo+nr;return ss})}),Tu=Li(Ue,Ze,Rr,!!Mi,Zu),ye=(0,qe.Z)(Tu,2),Ra=ye[0],Rl=ye[1];aa(Ue,Kn,function(nr,mr){return fo(nr,mr)?!1:(Ra({preventDefault:function(){},deltaY:nr}),!0)}),ee(function(){function nr(vo){Ue&&vo.preventDefault()}var mr=Kn.current;return mr.addEventListener("wheel",Ra),mr.addEventListener("DOMMouseScroll",Rl),mr.addEventListener("MozMousePixelScroll",nr),function(){mr.removeEventListener("wheel",Ra),mr.removeEventListener("DOMMouseScroll",Rl),mr.removeEventListener("MozMousePixelScroll",nr)}},[Ue]),ee(function(){Mi&&rs(function(nr){return la(nr)})},[dl.width,Mi]);var Ju=function(){var mr,vo;(mr=ud.current)===null||mr===void 0||mr.delayHidden(),(vo=jh.current)===null||vo===void 0||vo.delayHidden()},os=Vr(Kn,$r,vr,fi,Sr,function(){return Fo(!0)},ur,Ju);$t.useImperativeHandle(xt,function(){return{getScrollInfo:ls,scrollTo:function(mr){function vo(ss){return ss&&(0,Be.Z)(ss)==="object"&&("left"in ss||"top"in ss)}vo(mr)?(mr.left!==void 0&&rs(la(mr.left)),os(mr.top)):os(mr)}}}),ee(function(){if(an){var nr=$r.slice(xn,jt+1);an(nr,$r)}},[xn,jt,$r]);var Nu=Il($r,Sr,vr,fi),hd=An==null?void 0:An({start:xn,end:jt,virtual:Gn,offsetX:Ps,offsetY:cs,rtl:uo,getSize:Nu}),gh=ie($r,xn,jt,Mi,hl,le,lr),co=null;gi&&(co=(0,ce.Z)((0,Se.Z)({},br?"height":"maxHeight",gi),Rh),Ue&&(co.overflowY="hidden",Mi&&(co.overflowX="hidden"),gr&&(co.pointerEvents="none")));var ps={};return uo&&(ps.dir="rtl"),$t.createElement("div",(0,It.Z)({style:(0,ce.Z)((0,ce.Z)({},Le),{},{position:"relative"}),className:zo},ps,Ki),$t.createElement(ze.Z,{onResize:Xu},$t.createElement(Xe,{className:"".concat(mn,"-holder"),style:co,ref:Kn,onScroll:va,onMouseEnter:Ju},$t.createElement(tn,{prefixCls:mn,height:To,offsetX:Ps,offsetY:cs,scrollWidth:Mi,onInnerResize:Fo,ref:zn,innerProps:fe,rtl:uo,extra:hd},gh))),Gn&&To>gi&&$t.createElement(zt,{ref:ud,prefixCls:mn,scrollOffset:no,scrollRange:To,rtl:uo,onScroll:Es,onStartMove:ho,onStopMove:pr,spinSize:gs,containerSize:dl.height,style:ri==null?void 0:ri.verticalScrollBar,thumbStyle:ri==null?void 0:ri.verticalScrollBarThumb}),Gn&&Mi&&$t.createElement(zt,{ref:jh,prefixCls:mn,scrollOffset:Ps,scrollRange:Mi,rtl:uo,onScroll:Es,onStartMove:ho,onStopMove:pr,spinSize:Lo,containerSize:dl.width,horizontal:!0,style:ri==null?void 0:ri.horizontalScrollBar,thumbStyle:ri==null?void 0:ri.horizontalScrollBarThumb}))}var Ia=$t.forwardRef(Xl);Ia.displayName="List";var Cl=Ia,bs=Cl},66392:function(on,In){"use strict";var Jt;var It=Symbol.for("react.element"),ce=Symbol.for("react.portal"),Be=Symbol.for("react.fragment"),qe=Symbol.for("react.strict_mode"),Se=Symbol.for("react.profiler"),de=Symbol.for("react.provider"),$t=Symbol.for("react.context"),He=Symbol.for("react.server_context"),ve=Symbol.for("react.forward_ref"),Pe=Symbol.for("react.suspense"),ze=Symbol.for("react.suspense_list"),Me=Symbol.for("react.memo"),tn=Symbol.for("react.lazy"),Nt=Symbol.for("react.offscreen"),nt;nt=Symbol.for("react.module.reference");function et(ht){if(typeof ht=="object"&&ht!==null){var lt=ht.$$typeof;switch(lt){case It:switch(ht=ht.type,ht){case Be:case Se:case qe:case Pe:case ze:return ht;default:switch(ht=ht&&ht.$$typeof,ht){case He:case $t:case ve:case tn:case Me:case de:return ht;default:return lt}}case ce:return lt}}}Jt=$t,Jt=de,Jt=It,Jt=ve,Jt=Be,Jt=tn,Jt=Me,Jt=ce,Jt=Se,Jt=qe,Jt=Pe,Jt=ze,Jt=function(){return!1},Jt=function(){return!1},Jt=function(ht){return et(ht)===$t},Jt=function(ht){return et(ht)===de},Jt=function(ht){return typeof ht=="object"&&ht!==null&&ht.$$typeof===It},Jt=function(ht){return et(ht)===ve},Jt=function(ht){return et(ht)===Be},Jt=function(ht){return et(ht)===tn},Jt=function(ht){return et(ht)===Me},Jt=function(ht){return et(ht)===ce},Jt=function(ht){return et(ht)===Se},Jt=function(ht){return et(ht)===qe},Jt=function(ht){return et(ht)===Pe},Jt=function(ht){return et(ht)===ze},Jt=function(ht){return typeof ht=="string"||typeof ht=="function"||ht===Be||ht===Se||ht===qe||ht===Pe||ht===ze||ht===Nt||typeof ht=="object"&&ht!==null&&(ht.$$typeof===tn||ht.$$typeof===Me||ht.$$typeof===de||ht.$$typeof===$t||ht.$$typeof===ve||ht.$$typeof===nt||ht.getModuleId!==void 0)},Jt=et},31461:function(on,In,Jt){"use strict";Jt(66392)},4977:function(on){"use strict";on.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="},17423:function(on,In,Jt){"use strict";Jt.d(In,{Z:function(){return He}});const It=ve=>typeof ve=="object"&&ve!=null&&ve.nodeType===1,ce=(ve,Pe)=>(!Pe||ve!=="hidden")&&ve!=="visible"&&ve!=="clip",Be=(ve,Pe)=>{if(ve.clientHeight<ve.scrollHeight||ve.clientWidth<ve.scrollWidth){const ze=getComputedStyle(ve,null);return ce(ze.overflowY,Pe)||ce(ze.overflowX,Pe)||(Me=>{const tn=(Nt=>{if(!Nt.ownerDocument||!Nt.ownerDocument.defaultView)return null;try{return Nt.ownerDocument.defaultView.frameElement}catch(nt){return null}})(Me);return!!tn&&(tn.clientHeight<Me.scrollHeight||tn.clientWidth<Me.scrollWidth)})(ve)}return!1},qe=(ve,Pe,ze,Me,tn,Nt,nt,et)=>Nt<ve&&nt>Pe||Nt>ve&&nt<Pe?0:Nt<=ve&&et<=ze||nt>=Pe&&et>=ze?Nt-ve-Me:nt>Pe&&et<ze||Nt<ve&&et>ze?nt-Pe+tn:0,Se=ve=>{const Pe=ve.parentElement;return Pe==null?ve.getRootNode().host||null:Pe},de=(ve,Pe)=>{var ze,Me,tn,Nt;if(typeof document=="undefined")return[];const{scrollMode:nt,block:et,inline:ht,boundary:lt,skipOverflowHiddenElements:pt}=Pe,vt=typeof lt=="function"?lt:Ln=>Ln!==lt;if(!It(ve))throw new TypeError("Invalid target");const Ct=document.scrollingElement||document.documentElement,bt=[];let zt=ve;for(;It(zt)&&vt(zt);){if(zt=Se(zt),zt===Ct){bt.push(zt);break}zt!=null&&zt===document.body&&Be(zt)&&!Be(document.documentElement)||zt!=null&&Be(zt,pt)&&bt.push(zt)}const Qt=(Me=(ze=window.visualViewport)==null?void 0:ze.width)!=null?Me:innerWidth,ie=(Nt=(tn=window.visualViewport)==null?void 0:tn.height)!=null?Nt:innerHeight,{scrollX:oe,scrollY:re}=window,{height:Ne,width:ue,top:ke,right:Ke,bottom:Fe,left:wn}=ve.getBoundingClientRect(),{top:Rn,right:$n,bottom:di,left:ee}=(Ln=>{const Ce=window.getComputedStyle(Ln);return{top:parseFloat(Ce.scrollMarginTop)||0,right:parseFloat(Ce.scrollMarginRight)||0,bottom:parseFloat(Ce.scrollMarginBottom)||0,left:parseFloat(Ce.scrollMarginLeft)||0}})(ve);let _t=et==="start"||et==="nearest"?ke-Rn:et==="end"?Fe+di:ke+Ne/2-Rn+di,Kt=ht==="center"?wn+ue/2-ee+$n:ht==="end"?Ke+$n:wn-ee;const pn=[];for(let Ln=0;Ln<bt.length;Ln++){const Ce=bt[Ln],{height:sn,width:cn,top:Jn,right:Sn,bottom:he,left:Te}=Ce.getBoundingClientRect();if(nt==="if-needed"&&ke>=0&&wn>=0&&Fe<=ie&&Ke<=Qt&&ke>=Jn&&Fe<=he&&wn>=Te&&Ke<=Sn)return pn;const Nn=getComputedStyle(Ce),Bn=parseInt(Nn.borderLeftWidth,10),Ht=parseInt(Nn.borderTopWidth,10),Mt=parseInt(Nn.borderRightWidth,10),wt=parseInt(Nn.borderBottomWidth,10);let At=0,Ut=0;const Et="offsetWidth"in Ce?Ce.offsetWidth-Ce.clientWidth-Bn-Mt:0,be="offsetHeight"in Ce?Ce.offsetHeight-Ce.clientHeight-Ht-wt:0,Dn="offsetWidth"in Ce?Ce.offsetWidth===0?0:cn/Ce.offsetWidth:0,zi="offsetHeight"in Ce?Ce.offsetHeight===0?0:sn/Ce.offsetHeight:0;if(Ct===Ce)At=et==="start"?_t:et==="end"?_t-ie:et==="nearest"?qe(re,re+ie,ie,Ht,wt,re+_t,re+_t+Ne,Ne):_t-ie/2,Ut=ht==="start"?Kt:ht==="center"?Kt-Qt/2:ht==="end"?Kt-Qt:qe(oe,oe+Qt,Qt,Bn,Mt,oe+Kt,oe+Kt+ue,ue),At=Math.max(0,At+re),Ut=Math.max(0,Ut+oe);else{At=et==="start"?_t-Jn-Ht:et==="end"?_t-he+wt+be:et==="nearest"?qe(Jn,he,sn,Ht,wt+be,_t,_t+Ne,Ne):_t-(Jn+sn/2)+be/2,Ut=ht==="start"?Kt-Te-Bn:ht==="center"?Kt-(Te+cn/2)+Et/2:ht==="end"?Kt-Sn+Mt+Et:qe(Te,Sn,cn,Bn,Mt+Et,Kt,Kt+ue,ue);const{scrollLeft:yi,scrollTop:ei}=Ce;At=zi===0?0:Math.max(0,Math.min(ei+At/zi,Ce.scrollHeight-sn/zi+be)),Ut=Dn===0?0:Math.max(0,Math.min(yi+Ut/Dn,Ce.scrollWidth-cn/Dn+Et)),_t+=ei-At,Kt+=yi-Ut}pn.push({el:Ce,top:At,left:Ut})}return pn},$t=ve=>ve===!1?{block:"end",inline:"nearest"}:(Pe=>Pe===Object(Pe)&&Object.keys(Pe).length!==0)(ve)?ve:{block:"start",inline:"nearest"};function He(ve,Pe){if(!ve.isConnected||!(tn=>{let Nt=tn;for(;Nt&&Nt.parentNode;){if(Nt.parentNode===document)return!0;Nt=Nt.parentNode instanceof ShadowRoot?Nt.parentNode.host:Nt.parentNode}return!1})(ve))return;const ze=(tn=>{const Nt=window.getComputedStyle(tn);return{top:parseFloat(Nt.scrollMarginTop)||0,right:parseFloat(Nt.scrollMarginRight)||0,bottom:parseFloat(Nt.scrollMarginBottom)||0,left:parseFloat(Nt.scrollMarginLeft)||0}})(ve);if((tn=>typeof tn=="object"&&typeof tn.behavior=="function")(Pe))return Pe.behavior(de(ve,Pe));const Me=typeof Pe=="boolean"||Pe==null?void 0:Pe.behavior;for(const{el:tn,top:Nt,left:nt}of de(ve,$t(Pe))){const et=Nt-ze.top+ze.bottom,ht=nt-ze.left+ze.right;tn.scroll({top:et,left:ht,behavior:Me})}}}}]);
|